1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321 |
- var ax=Object.defineProperty;var lx=(e,t,n)=>t in e?ax(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Jt=(e,t,n)=>(lx(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 YI(e,t){const n=Object.create(null),r=e.split(",");for(let o=0;o<r.length;o++)n[r[o]]=!0;return t?o=>!!n[o.toLowerCase()]:o=>!!n[o]}const br={},rf=[],zs=()=>{},ux=()=>!1,cx=/^on[^a-z]/,wy=e=>cx.test(e),JI=e=>e.startsWith("onUpdate:"),to=Object.assign,XI=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},dx=Object.prototype.hasOwnProperty,jn=(e,t)=>dx.call(e,t),zt=Array.isArray,of=e=>fg(e)==="[object Map]",Gf=e=>fg(e)==="[object Set]",Yw=e=>fg(e)==="[object Date]",hn=e=>typeof e=="function",Gr=e=>typeof e=="string",Nh=e=>typeof e=="symbol",cr=e=>e!==null&&typeof e=="object",rL=e=>cr(e)&&hn(e.then)&&hn(e.catch),oL=Object.prototype.toString,fg=e=>oL.call(e),fx=e=>fg(e).slice(8,-1),iL=e=>fg(e)==="[object Object]",ZI=e=>Gr(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Xm=YI(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Sy=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},px=/-(\w)/g,Ta=Sy(e=>e.replace(px,(t,n)=>n?n.toUpperCase():"")),hx=/\B([A-Z])/g,sd=Sy(e=>e.replace(hx,"-$1").toLowerCase()),ky=Sy(e=>e.charAt(0).toUpperCase()+e.slice(1)),b1=Sy(e=>e?`on${ky(e)}`:""),Ph=(e,t)=>!Object.is(e,t),Zm=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},Mv=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Iv=e=>{const t=parseFloat(e);return isNaN(t)?e:t},gx=e=>{const t=Gr(e)?Number(e):NaN;return isNaN(t)?e:t};let Jw;const uM=()=>Jw||(Jw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ro(e){if(zt(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=Gr(r)?_x(r):Ro(r);if(o)for(const i in o)t[i]=o[i]}return t}else{if(Gr(e))return e;if(cr(e))return e}}const mx=/;(?![^(]*\))/g,vx=/:([^]+)/,yx=/\/\*[^]*?\*\//g;function _x(e){const t={};return e.replace(yx,"").split(mx).forEach(n=>{if(n){const r=n.split(vx);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function it(e){let t="";if(Gr(e))t=e;else if(zt(e))for(let n=0;n<e.length;n++){const r=it(e[n]);r&&(t+=r+" ")}else if(cr(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Vl(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Gr(t)&&(e.class=it(t)),n&&(e.style=Ro(n)),e}const bx="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Mx=YI(bx);function sL(e){return!!e||e===""}function Ix(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Zc(e[r],t[r]);return n}function Zc(e,t){if(e===t)return!0;let n=Yw(e),r=Yw(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Nh(e),r=Nh(t),n||r)return e===t;if(n=zt(e),r=zt(t),n||r)return n&&r?Ix(e,t):!1;if(n=cr(e),r=cr(t),n||r){if(!n||!r)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const s in e){const u=e.hasOwnProperty(s),d=t.hasOwnProperty(s);if(u&&!d||!u&&d||!Zc(e[s],t[s]))return!1}}return String(e)===String(t)}function QI(e,t){return e.findIndex(n=>Zc(n,t))}const De=e=>Gr(e)?e:e==null?"":zt(e)||cr(e)&&(e.toString===oL||!hn(e.toString))?JSON.stringify(e,aL,2):String(e),aL=(e,t)=>t&&t.__v_isRef?aL(e,t.value):of(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o])=>(n[`${r} =>`]=o,n),{})}:Gf(t)?{[`Set(${t.size})`]:[...t.values()]}:cr(t)&&!zt(t)&&!iL(t)?String(t):t;let ns;class Cx{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=ns,!t&&ns&&(this.index=(ns.scopes||(ns.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=ns;try{return ns=this,t()}finally{ns=n}}}on(){ns=this}off(){ns=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.scopes)for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0,this._active=!1}}}function Tx(e,t=ns){t&&t.active&&t.effects.push(e)}function eC(){return ns}function lL(e){ns&&ns.cleanups.push(e)}const tC=e=>{const t=new Set(e);return t.w=0,t.n=0,t},uL=e=>(e.w&vu)>0,cL=e=>(e.n&vu)>0,Sx=({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=vu},kx=e=>{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r<t.length;r++){const o=t[r];uL(o)&&!cL(o)?o.delete(e):t[n++]=o,o.w&=~vu,o.n&=~vu}t.length=n}},Cv=new WeakMap;let Wp=0,vu=1;const cM=30;let Hs;const xc=Symbol(""),dM=Symbol("");class nC{constructor(t,n=null,r){this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,Tx(this,r)}run(){if(!this.active)return this.fn();let t=Hs,n=su;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Hs,Hs=this,su=!0,vu=1<<++Wp,Wp<=cM?Sx(this):Xw(this),this.fn()}finally{Wp<=cM&&kx(this),vu=1<<--Wp,Hs=this.parent,su=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Hs===this?this.deferStop=!0:this.active&&(Xw(this),this.onStop&&this.onStop(),this.active=!1)}}function Xw(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let su=!0;const dL=[];function $f(){dL.push(su),su=!1}function Bf(){const e=dL.pop();su=e===void 0?!0:e}function Ki(e,t,n){if(su&&Hs){let r=Cv.get(e);r||Cv.set(e,r=new Map);let o=r.get(n);o||r.set(n,o=tC()),fL(o)}}function fL(e,t){let n=!1;Wp<=cM?cL(e)||(e.n|=vu,n=!uL(e)):n=!e.has(Hs),n&&(e.add(Hs),Hs.deps.push(e))}function fl(e,t,n,r,o,i){const s=Cv.get(e);if(!s)return;let u=[];if(t==="clear")u=[...s.values()];else if(n==="length"&&zt(e)){const d=Number(r);s.forEach((f,g)=>{(g==="length"||g>=d)&&u.push(f)})}else switch(n!==void 0&&u.push(s.get(n)),t){case"add":zt(e)?ZI(n)&&u.push(s.get("length")):(u.push(s.get(xc)),of(e)&&u.push(s.get(dM)));break;case"delete":zt(e)||(u.push(s.get(xc)),of(e)&&u.push(s.get(dM)));break;case"set":of(e)&&u.push(s.get(xc));break}if(u.length===1)u[0]&&fM(u[0]);else{const d=[];for(const f of u)f&&d.push(...f);fM(tC(d))}}function fM(e,t){const n=zt(e)?e:[...e];for(const r of n)r.computed&&Zw(r);for(const r of n)r.computed||Zw(r)}function Zw(e,t){(e!==Hs||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function Dx(e,t){var n;return(n=Cv.get(e))==null?void 0:n.get(t)}const Ex=YI("__proto__,__v_isRef,__isVue"),pL=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Nh)),Ax=rC(),Lx=rC(!1,!0),Ox=rC(!0),Qw=Rx();function Rx(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=Hn(this);for(let i=0,s=this.length;i<s;i++)Ki(r,"get",i+"");const o=r[t](...n);return o===-1||o===!1?r[t](...n.map(Hn)):o}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){$f();const r=Hn(this)[t].apply(this,n);return Bf(),r}}),e}function Nx(e){const t=Hn(this);return Ki(t,"has",e),t.hasOwnProperty(e)}function rC(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:yL:t?vL:mL).get(r))return r;const s=zt(r);if(!e){if(s&&jn(Qw,o))return Reflect.get(Qw,o,i);if(o==="hasOwnProperty")return Nx}const u=Reflect.get(r,o,i);return(Nh(o)?pL.has(o):Ex(o))||(e||Ki(r,"get",o),t)?u:gr(u)?s&&ZI(o)?u:u.value:cr(u)?e?xh(u):jt(u):u}}const Px=hL(),xx=hL(!0);function hL(e=!1){return function(n,r,o,i){let s=n[r];if(If(s)&&gr(s)&&!gr(o))return!1;if(!e&&(!Tv(o)&&!If(o)&&(s=Hn(s),o=Hn(o)),!zt(n)&&gr(s)&&!gr(o)))return s.value=o,!0;const u=zt(n)&&ZI(r)?Number(r)<n.length:jn(n,r),d=Reflect.set(n,r,o,i);return n===Hn(i)&&(u?Ph(o,s)&&fl(n,"set",r,o):fl(n,"add",r,o)),d}}function Ux(e,t){const n=jn(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&n&&fl(e,"delete",t,void 0),r}function Fx(e,t){const n=Reflect.has(e,t);return(!Nh(t)||!pL.has(t))&&Ki(e,"has",t),n}function Gx(e){return Ki(e,"iterate",zt(e)?"length":xc),Reflect.ownKeys(e)}const gL={get:Ax,set:Px,deleteProperty:Ux,has:Fx,ownKeys:Gx},$x={get:Ox,set(e,t){return!0},deleteProperty(e,t){return!0}},Bx=to({},gL,{get:Lx,set:xx}),oC=e=>e,Dy=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&&Ki(o,"get",t),Ki(o,"get",i));const{has:s}=Dy(o),u=r?oC:n?lC:Uh;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&&Ki(r,"has",e),Ki(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&&Ki(Hn(e),"iterate",xc),Reflect.get(e,"size",e)}function eS(e){e=Hn(e);const t=Hn(this);return Dy(t).has.call(t,e)||(t.add(e),fl(t,"add",e,e)),this}function tS(e,t){t=Hn(t);const n=Hn(this),{has:r,get:o}=Dy(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?Ph(t,s)&&fl(n,"set",e,t):fl(n,"add",e,t),this}function nS(e){const t=Hn(this),{has:n,get:r}=Dy(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&&fl(t,"delete",e,void 0),i}function rS(){const e=Hn(this),t=e.size!==0,n=e.clear();return t&&fl(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?oC:e?lC:Uh;return!e&&Ki(u,"iterate",xc),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=of(i),u=e==="entries"||e===Symbol.iterator&&s,d=e==="keys"&&s,f=o[e](...r),g=n?oC:t?lC:Uh;return!t&&Ki(i,"iterate",d?dM:xc),{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 Dl(e){return function(...t){return e==="delete"?!1:this}}function Hx(){const e={get(i){return cm(this,i)},get size(){return fm(this)},has:dm,add:eS,set:tS,delete:nS,clear:rS,forEach:pm(!1,!1)},t={get(i){return cm(this,i,!1,!0)},get size(){return fm(this)},has:dm,add:eS,set:tS,delete:nS,clear:rS,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:Dl("add"),set:Dl("set"),delete:Dl("delete"),clear:Dl("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:Dl("add"),set:Dl("set"),delete:Dl("delete"),clear:Dl("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[qx,Vx,zx,jx]=Hx();function iC(e,t){const n=t?e?jx:zx:e?Vx:qx;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 Wx={get:iC(!1,!1)},Kx={get:iC(!1,!0)},Yx={get:iC(!0,!1)},mL=new WeakMap,vL=new WeakMap,yL=new WeakMap,Jx=new WeakMap;function Xx(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Zx(e){return e.__v_skip||!Object.isExtensible(e)?0:Xx(fx(e))}function jt(e){return If(e)?e:sC(e,!1,gL,Wx,mL)}function Qx(e){return sC(e,!1,Bx,Kx,vL)}function xh(e){return sC(e,!0,$x,Yx,yL)}function sC(e,t,n,r,o){if(!cr(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=o.get(e);if(i)return i;const s=Zx(e);if(s===0)return e;const u=new Proxy(e,s===2?r:n);return o.set(e,u),u}function sf(e){return If(e)?sf(e.__v_raw):!!(e&&e.__v_isReactive)}function If(e){return!!(e&&e.__v_isReadonly)}function Tv(e){return!!(e&&e.__v_isShallow)}function _L(e){return sf(e)||If(e)}function Hn(e){const t=e&&e.__v_raw;return t?Hn(t):e}function aC(e){return Mv(e,"__v_skip",!0),e}const Uh=e=>cr(e)?jt(e):e,lC=e=>cr(e)?xh(e):e;function uC(e){su&&Hs&&(e=Hn(e),fL(e.dep||(e.dep=tC())))}function cC(e,t){e=Hn(e);const n=e.dep;n&&fM(n)}function gr(e){return!!(e&&e.__v_isRef===!0)}function Ne(e){return ML(e,!1)}function bL(e){return ML(e,!0)}function ML(e,t){return gr(e)?e:new eU(e,t)}class eU{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:Uh(t)}get value(){return uC(this),this._value}set value(t){const n=this.__v_isShallow||Tv(t)||If(t);t=n?t:Hn(t),Ph(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:Uh(t),cC(this))}}function Le(e){return gr(e)?e.value:e}const tU={get:(e,t,n)=>Le(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 IL(e){return sf(e)?e:new Proxy(e,tU)}class nU{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:r}=t(()=>uC(this),()=>cC(this));this._get=n,this._set=r}get value(){return this._get()}set value(t){this._set(t)}}function rU(e){return new nU(e)}function Kt(e){const t=zt(e)?new Array(e.length):{};for(const n in e)t[n]=CL(e,n);return t}class oU{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 Dx(Hn(this._object),this._key)}}class iU{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function dr(e,t,n){return gr(e)?e:hn(e)?new iU(e):cr(e)&&arguments.length>1?CL(e,t,n):Ne(e)}function CL(e,t,n){const r=e[t];return gr(r)?r:new oU(e,t,n)}class sU{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 nC(t,()=>{this._dirty||(this._dirty=!0,cC(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=r}get value(){const t=Hn(this);return uC(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function aU(e,t,n=!1){let r,o;const i=hn(e);return i?(r=e,o=zs):(r=e.get,o=e.set),new sU(r,o,i||!o,n)}function au(e,t,n,r){let o;try{o=r?e(...r):e()}catch(i){Ey(i,t,n)}return o}function Ss(e,t,n,r){if(hn(e)){const i=au(e,t,n,r);return i&&rL(i)&&i.catch(s=>{Ey(s,t,n)}),i}const o=[];for(let i=0;i<e.length;i++)o.push(Ss(e[i],t,n,r));return o}function Ey(e,t,n,r=!0){const o=t?t.vnode:null;if(t){let i=t.parent;const s=t.proxy,u=n;for(;i;){const f=i.ec;if(f){for(let g=0;g<f.length;g++)if(f[g](e,s,u)===!1)return}i=i.parent}const d=t.appContext.config.errorHandler;if(d){au(d,null,10,[e,s,u]);return}}lU(e,n,o,r)}function lU(e,t,n,r=!0){console.error(e)}let Fh=!1,pM=!1;const fi=[];let pa=0;const af=[];let Wa=null,oc=0;const TL=Promise.resolve();let dC=null;function Ir(e){const t=dC||TL;return e?t.then(this?e.bind(this):e):t}function uU(e){let t=pa+1,n=fi.length;for(;t<n;){const r=t+n>>>1;Gh(fi[r])<e?t=r+1:n=r}return t}function fC(e){(!fi.length||!fi.includes(e,Fh&&e.allowRecurse?pa+1:pa))&&(e.id==null?fi.push(e):fi.splice(uU(e.id),0,e),wL())}function wL(){!Fh&&!pM&&(pM=!0,dC=TL.then(kL))}function cU(e){const t=fi.indexOf(e);t>pa&&fi.splice(t,1)}function dU(e){zt(e)?af.push(...e):(!Wa||!Wa.includes(e,e.allowRecurse?oc+1:oc))&&af.push(e),wL()}function oS(e,t=Fh?pa+1:0){for(;t<fi.length;t++){const n=fi[t];n&&n.pre&&(fi.splice(t,1),t--,n())}}function SL(e){if(af.length){const t=[...new Set(af)];if(af.length=0,Wa){Wa.push(...t);return}for(Wa=t,Wa.sort((n,r)=>Gh(n)-Gh(r)),oc=0;oc<Wa.length;oc++)Wa[oc]();Wa=null,oc=0}}const Gh=e=>e.id==null?1/0:e.id,fU=(e,t)=>{const n=Gh(e)-Gh(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function kL(e){pM=!1,Fh=!0,fi.sort(fU);const t=zs;try{for(pa=0;pa<fi.length;pa++){const n=fi[pa];n&&n.active!==!1&&au(n,null,14)}}finally{pa=0,fi.length=0,SL(),Fh=!1,dC=null,(fi.length||af.length)&&kL()}}function pU(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||br;let o=n;const i=t.startsWith("update:"),s=i&&t.slice(7);if(s&&s in r){const g=`${s==="modelValue"?"model":s}Modifiers`,{number:v,trim:_}=r[g]||br;_&&(o=n.map(M=>Gr(M)?M.trim():M)),v&&(o=n.map(Iv))}let u,d=r[u=b1(t)]||r[u=b1(Ta(t))];!d&&i&&(d=r[u=b1(sd(t))]),d&&Ss(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,Ss(f,e,6,o)}}function DL(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=DL(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?(cr(e)&&r.set(e,null),null):(zt(i)?i.forEach(d=>s[d]=null):to(s,i),cr(e)&&r.set(e,s),s)}function Ay(e,t){return!e||!wy(t)?!1:(t=t.slice(2).replace(/Once$/,""),jn(e,t[0].toLowerCase()+t.slice(1))||jn(e,sd(t))||jn(e,t))}let Jo=null,Ly=null;function wv(e){const t=Jo;return Jo=e,Ly=e&&e.type.__scopeId||null,t}function mr(e){Ly=e}function vr(){Ly=null}function Ot(e,t=Jo,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&vS(-1);const i=wv(t);let s;try{s=e(...o)}finally{wv(i),r._d&&vS(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function M1(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 R=wv(e);try{if(n.shapeFlag&4){const N=o||r;w=ca(g.call(N,N,v,i,M,_,C)),S=d}else{const N=t;w=ca(N.length>1?N(i,{attrs:d,slots:u,emit:f}):N(i,null)),S=t.props?d:hU(d)}}catch(N){sh.length=0,Ey(N,e,1),w=Ct(Di)}let A=w;if(S&&D!==!1){const N=Object.keys(S),{shapeFlag:H}=A;N.length&&H&7&&(s&&N.some(JI)&&(S=gU(S,s)),A=wa(A,S))}return n.dirs&&(A=wa(A),A.dirs=A.dirs?A.dirs.concat(n.dirs):n.dirs),n.transition&&(A.transition=n.transition),w=A,wv(R),w}const hU=e=>{let t;for(const n in e)(n==="class"||n==="style"||wy(n))&&((t||(t={}))[n]=e[n]);return t},gU=(e,t)=>{const n={};for(const r in e)(!JI(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function mU(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?iS(r,s,f):!!s;if(d&8){const g=t.dynamicProps;for(let v=0;v<g.length;v++){const _=g[v];if(s[_]!==r[_]&&!Ay(f,_))return!0}}}else return(o||u)&&(!u||!u.$stable)?!0:r===s?!1:r?s?iS(r,s,f):!0:!!s;return!1}function iS(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const i=r[o];if(t[i]!==e[i]&&!Ay(n,i))return!0}return!1}function vU({vnode:e,parent:t},n){for(;t&&t.subTree===e;)(e=t.vnode).el=n,t=t.parent}const yU=e=>e.__isSuspense;function _U(e,t){t&&t.pendingBranch?zt(e)?t.effects.push(...e):t.effects.push(e):dU(e)}function nn(e,t){return pC(e,null,t)}const gm={};function $t(e,t,n){return pC(e,t,n)}function pC(e,t,{immediate:n,deep:r,flush:o,onTrack:i,onTrigger:s}=br){var u;const d=eC()===((u=Lo)==null?void 0:u.scope)?Lo:null;let f,g=!1,v=!1;if(gr(e)?(f=()=>e.value,g=Tv(e)):sf(e)?(f=()=>e,r=!0):zt(e)?(v=!0,g=e.some(N=>sf(N)||Tv(N)),f=()=>e.map(N=>{if(gr(N))return N.value;if(sf(N))return pc(N);if(hn(N))return au(N,d,2)})):hn(e)?t?f=()=>au(e,d,2):f=()=>{if(!(d&&d.isUnmounted))return _&&_(),Ss(e,d,3,[M])}:f=zs,t&&r){const N=f;f=()=>pc(N())}let _,M=N=>{_=R.onStop=()=>{au(N,d,4)}},C;if(Vh)if(M=zs,t?n&&Ss(t,d,3,[f(),v?[]:void 0,M]):f(),o==="sync"){const N=a7();C=N.__watcherHandles||(N.__watcherHandles=[])}else return zs;let D=v?new Array(e.length).fill(gm):gm;const w=()=>{if(R.active)if(t){const N=R.run();(r||g||(v?N.some((H,z)=>Ph(H,D[z])):Ph(N,D)))&&(_&&_(),Ss(t,d,3,[N,D===gm?void 0:v&&D[0]===gm?[]:D,M]),D=N)}else R.run()};w.allowRecurse=!!t;let S;o==="sync"?S=w:o==="post"?S=()=>Bi(w,d&&d.suspense):(w.pre=!0,d&&(w.id=d.uid),S=()=>fC(w));const R=new nC(f,S);t?n?w():D=R.run():o==="post"?Bi(R.run.bind(R),d&&d.suspense):R.run();const A=()=>{R.stop(),d&&d.scope&&XI(d.scope.effects,R)};return C&&C.push(A),A}function bU(e,t,n){const r=this.proxy,o=Gr(e)?e.includes(".")?EL(r,e):()=>r[e]:e.bind(r,r);let i;hn(t)?i=t:(i=t.handler,n=t);const s=Lo;Cf(this);const u=pC(o,i.bind(r),n);return s?Cf(s):Uc(),u}function EL(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}function pc(e,t){if(!cr(e)||e.__v_skip||(t=t||new Set,t.has(e)))return e;if(t.add(e),gr(e))pc(e.value,t);else if(zt(e))for(let n=0;n<e.length;n++)pc(e[n],t);else if(Gf(e)||of(e))e.forEach(n=>{pc(n,t)});else if(iL(e))for(const n in e)pc(e[n],t);return e}function $n(e,t){const n=Jo;if(n===null)return e;const r=Py(n)||n.proxy,o=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,u,d,f=br]=t[i];s&&(hn(s)&&(s={mounted:s,updated:s}),s.deep&&pc(u),o.push({dir:s,instance:r,value:u,oldValue:void 0,arg:d,modifiers:f}))}return e}function Ku(e,t,n,r){const o=e.dirs,i=t&&t.dirs;for(let s=0;s<o.length;s++){const u=o[s];i&&(u.oldValue=i[s].value);let d=u.dir[r];d&&($f(),Ss(d,n,8,[e.el,u,e,t]),Bf())}}function AL(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return On(()=>{e.isMounted=!0}),vi(()=>{e.isUnmounting=!0}),e}const ms=[Function,Array],LL={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ms,onEnter:ms,onAfterEnter:ms,onEnterCancelled:ms,onBeforeLeave:ms,onLeave:ms,onAfterLeave:ms,onLeaveCancelled:ms,onBeforeAppear:ms,onAppear:ms,onAfterAppear:ms,onAppearCancelled:ms},MU={name:"BaseTransition",props:LL,setup(e,{slots:t}){const n=Yi(),r=AL();let o;return()=>{const i=t.default&&hC(t.default(),!0);if(!i||!i.length)return;let s=i[0];if(i.length>1){for(const D of i)if(D.type!==Di){s=D;break}}const u=Hn(e),{mode:d}=u;if(r.isLeaving)return I1(s);const f=sS(s);if(!f)return I1(s);const g=$h(f,u,r,n);Bh(f,g);const v=n.subTree,_=v&&sS(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!==Di&&(!ic(f,_)||M)){const D=$h(_,u,r,n);if(Bh(_,D),d==="out-in")return r.isLeaving=!0,D.afterLeave=()=>{r.isLeaving=!1,n.update.active!==!1&&n.update()},I1(s);d==="in-out"&&f.type!==Di&&(D.delayLeave=(w,S,R)=>{const A=OL(r,_);A[String(_.key)]=_,w._leaveCb=()=>{S(),w._leaveCb=void 0,delete g.delayedLeave},g.delayedLeave=R})}return s}}},IU=MU;function OL(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 $h(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:R}=t,A=String(e.key),N=OL(n,e),H=(B,j)=>{B&&Ss(B,r,9,j)},z=(B,j)=>{const G=j[1];H(B,j),zt(B)?B.every(L=>L.length<=1)&&G():B.length<=1&&G()},x={mode:i,persisted:s,beforeEnter(B){let j=u;if(!n.isMounted)if(o)j=D||u;else return;B._leaveCb&&B._leaveCb(!0);const G=N[A];G&&ic(e,G)&&G.el._leaveCb&&G.el._leaveCb(),H(j,[B])},enter(B){let j=d,G=f,L=g;if(!n.isMounted)if(o)j=w||d,G=S||f,L=R||g;else return;let T=!1;const P=B._enterCb=Q=>{T||(T=!0,Q?H(L,[B]):H(G,[B]),x.delayedLeave&&x.delayedLeave(),B._enterCb=void 0)};j?z(j,[B,P]):P()},leave(B,j){const G=String(e.key);if(B._enterCb&&B._enterCb(!0),n.isUnmounting)return j();H(v,[B]);let L=!1;const T=B._leaveCb=P=>{L||(L=!0,j(),P?H(C,[B]):H(M,[B]),B._leaveCb=void 0,N[G]===e&&delete N[G])};N[G]=e,_?z(_,[B,T]):T()},clone(B){return $h(B,t,n,r)}};return x}function I1(e){if(Oy(e))return e=wa(e),e.children=null,e}function sS(e){return Oy(e)?e.children?e.children[0]:void 0:e}function Bh(e,t){e.shapeFlag&6&&e.component?Bh(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 hC(e,t=!1,n){let r=[],o=0;for(let i=0;i<e.length;i++){let s=e[i];const u=n==null?s.key:String(n)+String(s.key!=null?s.key:i);s.type===dt?(s.patchFlag&128&&o++,r=r.concat(hC(s.children,t,u))):(t||s.type!==Di)&&r.push(u!=null?wa(s,{key:u}):s)}if(o>1)for(let i=0;i<r.length;i++)r[i].patchFlag=-2;return r}function ot(e,t){return hn(e)?(()=>to({name:e.name},t,{setup:e}))():e}const rh=e=>!!e.type.__asyncLoader,Oy=e=>e.type.__isKeepAlive;function RL(e,t){PL(e,"a",t)}function NL(e,t){PL(e,"da",t)}function PL(e,t,n=Lo){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Ry(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Oy(o.parent.vnode)&&CU(r,t,n,o),o=o.parent}}function CU(e,t,n,r){const o=Ry(t,e,r,!0);hl(()=>{XI(r[t],o)},n)}function Ry(e,t,n=Lo,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{if(n.isUnmounted)return;$f(),Cf(n);const u=Ss(t,n,e,s);return Uc(),Bf(),u});return r?o.unshift(i):o.push(i),i}}const pl=e=>(t,n=Lo)=>(!Vh||e==="sp")&&Ry(e,(...r)=>t(...r),n),Hf=pl("bm"),On=pl("m"),xL=pl("bu"),UL=pl("u"),vi=pl("bum"),hl=pl("um"),TU=pl("sp"),wU=pl("rtg"),SU=pl("rtc");function kU(e,t=Lo){Ry("ec",e,t)}const gC="components",DU="directives";function Bt(e,t){return mC(gC,e,!0,t)||e}const FL=Symbol.for("v-ndc");function lf(e){return Gr(e)?mC(gC,e,!1)||e:e||FL}function EU(e){return mC(DU,e)}function mC(e,t,n=!0,r=!1){const o=Jo||Lo;if(o){const i=o.type;if(e===gC){const u=o7(i,!1);if(u&&(u===t||u===Ta(t)||u===ky(Ta(t))))return i}const s=aS(o[e]||i[e],t)||aS(o.appContext[e],t);return!s&&r?i:s}}function aS(e,t){return e&&(e[t]||e[Ta(t)]||e[ky(Ta(t))])}function Vt(e,t,n,r){let o;const i=n&&n[r];if(zt(e)||Gr(e)){o=new Array(e.length);for(let s=0,u=e.length;s<u;s++)o[s]=t(e[s],s,void 0,i&&i[s])}else if(typeof e=="number"){o=new Array(e);for(let s=0;s<e;s++)o[s]=t(s+1,s,void 0,i&&i[s])}else if(cr(e))if(e[Symbol.iterator])o=Array.from(e,(s,u)=>t(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<d;u++){const f=s[u];o[u]=t(e[f],f,u,i&&i[u])}}else o=[];return n&&(n[r]=o),o}function ji(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(zt(r))for(let o=0;o<r.length;o++)e[r[o].name]=r[o].fn;else r&&(e[r.name]=r.key?(...o)=>{const i=r.fn(...o);return i&&(i.key=r.key),i}:r.fn)}return e}function Ft(e,t,n={},r,o){if(Jo.isCE||Jo.parent&&rh(Jo.parent)&&Jo.parent.isCE)return t!=="default"&&(n.name=t),Ct("slot",n,r&&r());let i=e[t];i&&i._c&&(i._d=!1),Z();const s=i&&GL(i(n)),u=bt(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 GL(e){return e.some(t=>qh(t)?!(t.type===Di||t.type===dt&&!GL(t.children)):!0)?e:null}const hM=e=>e?JL(e)?Py(e)||e.proxy:hM(e.parent):null,oh=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=>hM(e.parent),$root:e=>hM(e.root),$emit:e=>e.emit,$options:e=>vC(e),$forceUpdate:e=>e.f||(e.f=()=>fC(e.update)),$nextTick:e=>e.n||(e.n=Ir.bind(e.proxy)),$watch:e=>bU.bind(e)}),C1=(e,t)=>e!==br&&!e.__isScriptSetup&&jn(e,t),AU={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(C1(r,t))return s[t]=1,r[t];if(o!==br&&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!==br&&jn(n,t))return s[t]=4,n[t];gM&&(s[t]=0)}}const g=oh[t];let v,_;if(g)return t==="$attrs"&&Ki(e,"get",t),g(e);if((v=u.__cssModules)&&(v=v[t]))return v;if(n!==br&&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 C1(o,t)?(o[t]=n,!0):r!==br&&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!==br&&jn(e,s)||C1(t,s)||(u=i[0])&&jn(u,s)||jn(r,s)||jn(oh,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 LU().slots}function LU(){const e=Yi();return e.setupContext||(e.setupContext=ZL(e))}function lS(e){return zt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let gM=!0;function OU(e){const t=vC(e),n=e.proxy,r=e.ctx;gM=!1,t.beforeCreate&&uS(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:R,destroyed:A,unmounted:N,render:H,renderTracked:z,renderTriggered:x,errorCaptured:B,serverPrefetch:j,expose:G,inheritAttrs:L,components:T,directives:P,filters:Q}=t;if(f&&RU(f,r,null),s)for(const X in s){const ae=s[X];hn(ae)&&(r[X]=ae.bind(n))}if(o){const X=o.call(n,n);cr(X)&&(e.data=jt(X))}if(gM=!0,i)for(const X in i){const ae=i[X],fe=hn(ae)?ae.bind(n,n):hn(ae.get)?ae.get.bind(n,n):zs,le=!hn(ae)&&hn(ae.set)?ae.set.bind(n):zs,ce=Ve({get:fe,set:le});Object.defineProperty(r,X,{enumerable:!0,configurable:!0,get:()=>ce.value,set:J=>ce.value=J})}if(u)for(const X in u)$L(u[X],r,n,X);if(d){const X=hn(d)?d.call(n):d;Reflect.ownKeys(X).forEach(ae=>{ci(ae,X[ae])})}g&&uS(g,e,"c");function oe(X,ae){zt(ae)?ae.forEach(fe=>X(fe.bind(n))):ae&&X(ae.bind(n))}if(oe(Hf,v),oe(On,_),oe(xL,M),oe(UL,C),oe(RL,D),oe(NL,w),oe(kU,B),oe(SU,z),oe(wU,x),oe(vi,R),oe(hl,N),oe(TU,j),zt(G))if(G.length){const X=e.exposed||(e.exposed={});G.forEach(ae=>{Object.defineProperty(X,ae,{get:()=>n[ae],set:fe=>n[ae]=fe})})}else e.exposed||(e.exposed={});H&&e.render===zs&&(e.render=H),L!=null&&(e.inheritAttrs=L),T&&(e.components=T),P&&(e.directives=P)}function RU(e,t,n=zs){zt(e)&&(e=mM(e));for(const r in e){const o=e[r];let i;cr(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 uS(e,t,n){Ss(zt(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function $L(e,t,n,r){const o=r.includes(".")?EL(n,r):()=>n[r];if(Gr(e)){const i=t[e];hn(i)&&$t(o,i)}else if(hn(e))$t(o,e.bind(n));else if(cr(e))if(zt(e))e.forEach(i=>$L(i,t,n,r));else{const i=hn(e.handler)?e.handler.bind(n):t[e.handler];hn(i)&&$t(o,i,e)}}function vC(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)),cr(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=NU[s]||n&&n[s];e[s]=u?u(e[s],t[s]):t[s]}return e}const NU={data:cS,props:dS,emits:dS,methods:Kp,computed:Kp,beforeCreate:Ci,created:Ci,beforeMount:Ci,mounted:Ci,beforeUpdate:Ci,updated:Ci,beforeDestroy:Ci,beforeUnmount:Ci,destroyed:Ci,unmounted:Ci,activated:Ci,deactivated:Ci,errorCaptured:Ci,serverPrefetch:Ci,components:Kp,directives:Kp,watch:xU,provide:cS,inject:PU};function cS(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 PU(e,t){return Kp(mM(e),mM(t))}function mM(e){if(zt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ci(e,t){return e?[...new Set([].concat(e,t))]:t}function Kp(e,t){return e?to(Object.create(null),e,t):t}function dS(e,t){return e?zt(e)&&zt(t)?[...new Set([...e,...t])]:to(Object.create(null),lS(e),lS(t??{})):t}function xU(e,t){if(!e)return t;if(!t)return e;const n=to(Object.create(null),e);for(const r in t)n[r]=Ci(e[r],t[r]);return n}function BL(){return{app:null,config:{isNativeTag:ux,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let UU=0;function FU(e,t){return function(r,o=null){hn(r)||(r=to({},r)),o!=null&&!cr(o)&&(o=null);const i=BL(),s=new Set;let u=!1;const d=i.app={_uid:UU++,_component:r,_props:o,_container:null,_context:i,_instance:null,version:l7,get config(){return i.config},set config(f){},use(f,...g){return s.has(f)||(f&&hn(f.install)?(s.add(f),f.install(d,...g)):hn(f)&&(s.add(f),f(d,...g))),d},mixin(f){return i.mixins.includes(f)||i.mixins.push(f),d},component(f,g){return g?(i.components[f]=g,d):i.components[f]},directive(f,g){return g?(i.directives[f]=g,d):i.directives[f]},mount(f,g,v){if(!u){const _=Ct(r,o);return _.appContext=i,g&&t?t(_,f):e(_,f,v),u=!0,d._container=f,f.__vue_app__=d,Py(_.component)||_.component.proxy}},unmount(){u&&(e(null,d._container),delete d._container.__vue_app__)},provide(f,g){return i.provides[f]=g,d},runWithContext(f){kv=d;try{return f()}finally{kv=null}}};return d}}let kv=null;function ci(e,t){if(Lo){let n=Lo.provides;const r=Lo.parent&&Lo.parent.provides;r===n&&(n=Lo.provides=Object.create(r)),n[e]=t}}function tn(e,t,n=!1){const r=Lo||Jo;if(r||kv){const o=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:kv._context.provides;if(o&&e in o)return o[e];if(arguments.length>1)return n&&hn(t)?t.call(r&&r.proxy):t}}function GU(e,t,n,r=!1){const o={},i={};Mv(i,Ny,1),e.propsDefaults=Object.create(null),HL(e,t,o,i);for(const s in e.propsOptions[0])s in o||(o[s]=void 0);n?e.props=r?o:Qx(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function $U(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<g.length;v++){let _=g[v];if(Ay(e.emitsOptions,_))continue;const M=t[_];if(d)if(jn(i,_))M!==i[_]&&(i[_]=M,f=!0);else{const C=Ta(_);o[C]=vM(d,u,C,M,e,!1)}else M!==i[_]&&(i[_]=M,f=!0)}}}else{HL(e,t,o,i)&&(f=!0);let g;for(const v in u)(!t||!jn(t,v)&&((g=sd(v))===v||!jn(t,g)))&&(d?n&&(n[v]!==void 0||n[g]!==void 0)&&(o[v]=vM(d,u,v,void 0,e,!0)):delete o[v]);if(i!==u)for(const v in i)(!t||!jn(t,v))&&(delete i[v],f=!0)}f&&fl(e,"set","$attrs")}function HL(e,t,n,r){const[o,i]=e.propsOptions;let s=!1,u;if(t)for(let d in t){if(Xm(d))continue;const f=t[d];let g;o&&jn(o,g=Ta(d))?!i||!i.includes(g)?n[g]=f:(u||(u={}))[g]=f:Ay(e.emitsOptions,d)||(!(d in r)||f!==r[d])&&(r[d]=f,s=!0)}if(i){const d=Hn(n),f=u||br;for(let g=0;g<i.length;g++){const v=i[g];n[v]=vM(o,d,v,f[v],e,!jn(f,v))}}return s}function vM(e,t,n,r,o,i){const s=e[n];if(s!=null){const u=jn(s,"default");if(u&&r===void 0){const d=s.default;if(s.type!==Function&&!s.skipFactory&&hn(d)){const{propsDefaults:f}=o;n in f?r=f[n]:(Cf(o),r=f[n]=d.call(null,t),Uc())}else r=d}s[0]&&(i&&!u?r=!1:s[1]&&(r===""||r===sd(n))&&(r=!0))}return r}function qL(e,t,n=!1){const r=t.propsCache,o=r.get(e);if(o)return o;const i=e.props,s={},u=[];let d=!1;if(!hn(e)){const g=v=>{d=!0;const[_,M]=qL(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 cr(e)&&r.set(e,rf),rf;if(zt(i))for(let g=0;g<i.length;g++){const v=Ta(i[g]);fS(v)&&(s[v]=br)}else if(i)for(const g in i){const v=Ta(g);if(fS(v)){const _=i[g],M=s[v]=zt(_)||hn(_)?{type:_}:to({},_);if(M){const C=gS(Boolean,M.type),D=gS(String,M.type);M[0]=C>-1,M[1]=D<0||C<D,(C>-1||jn(M,"default"))&&u.push(v)}}}const f=[s,u];return cr(e)&&r.set(e,f),f}function fS(e){return e[0]!=="$"}function pS(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function hS(e,t){return pS(e)===pS(t)}function gS(e,t){return zt(t)?t.findIndex(n=>hS(n,e)):hn(t)&&hS(t,e)?0:-1}const VL=e=>e[0]==="_"||e==="$stable",yC=e=>zt(e)?e.map(ca):[ca(e)],BU=(e,t,n)=>{if(t._n)return t;const r=Ot((...o)=>yC(t(...o)),n);return r._c=!1,r},zL=(e,t,n)=>{const r=e._ctx;for(const o in e){if(VL(o))continue;const i=e[o];if(hn(i))t[o]=BU(o,i,r);else if(i!=null){const s=yC(i);t[o]=()=>s}}},jL=(e,t)=>{const n=yC(t);e.slots.default=()=>n},HU=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=Hn(t),Mv(t,"_",n)):zL(t,e.slots={})}else e.slots={},t&&jL(e,t);Mv(e.slots,Ny,1)},qU=(e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,s=br;if(r.shapeFlag&32){const u=t._;u?n&&u===1?i=!1:(to(o,t),!n&&u===1&&delete o._):(i=!t.$stable,zL(t,o)),s=t}else t&&(jL(e,t),s={default:1});if(i)for(const u in o)!VL(u)&&!(u in s)&&delete o[u]};function yM(e,t,n,r,o=!1){if(zt(e)){e.forEach((_,M)=>yM(_,t&&(zt(t)?t[M]:t),n,r,o));return}if(rh(r)&&!o)return;const i=r.shapeFlag&4?Py(r.component)||r.component.proxy:r.el,s=o?null:i,{i:u,r:d}=e,f=t&&t.r,g=u.refs===br?u.refs={}:u.refs,v=u.setupState;if(f!=null&&f!==d&&(Gr(f)?(g[f]=null,jn(v,f)&&(v[f]=null)):gr(f)&&(f.value=null)),hn(d))au(d,u,12,[s,g]);else{const _=Gr(d),M=gr(d);if(_||M){const C=()=>{if(e.f){const D=_?jn(v,d)?v[d]:g[d]:d.value;o?zt(D)&&XI(D,i):zt(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,Bi(C,n)):C()}}}const Bi=_U;function VU(e){return zU(e)}function zU(e,t){const n=uM();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=zs,insertStaticContent:C}=e,D=(W,te,ie,Ie=null,ue=null,Se=null,Pe=!1,xe=null,He=!!te.dynamicChildren)=>{if(W===te)return;W&&!ic(W,te)&&(Ie=Me(W),J(W,ue,Se,!0),W=null),te.patchFlag===-2&&(He=!1,te.dynamicChildren=null);const{type:Te,ref:V,shapeFlag:ne}=te;switch(Te){case qf:w(W,te,ie,Ie);break;case Di:S(W,te,ie,Ie);break;case T1:W==null&&R(te,ie,Ie,Pe);break;case dt:T(W,te,ie,Ie,ue,Se,Pe,xe,He);break;default:ne&1?H(W,te,ie,Ie,ue,Se,Pe,xe,He):ne&6?P(W,te,ie,Ie,ue,Se,Pe,xe,He):(ne&64||ne&128)&&Te.process(W,te,ie,Ie,ue,Se,Pe,xe,He,me)}V!=null&&ue&&yM(V,W&&W.ref,Se,te||W,!te)},w=(W,te,ie,Ie)=>{if(W==null)r(te.el=u(te.children),ie,Ie);else{const ue=te.el=W.el;te.children!==W.children&&f(ue,te.children)}},S=(W,te,ie,Ie)=>{W==null?r(te.el=d(te.children||""),ie,Ie):te.el=W.el},R=(W,te,ie,Ie)=>{[W.el,W.anchor]=C(W.children,te,ie,Ie,W.el,W.anchor)},A=({el:W,anchor:te},ie,Ie)=>{let ue;for(;W&&W!==te;)ue=_(W),r(W,ie,Ie),W=ue;r(te,ie,Ie)},N=({el:W,anchor:te})=>{let ie;for(;W&&W!==te;)ie=_(W),o(W),W=ie;o(te)},H=(W,te,ie,Ie,ue,Se,Pe,xe,He)=>{Pe=Pe||te.type==="svg",W==null?z(te,ie,Ie,ue,Se,Pe,xe,He):j(W,te,ue,Se,Pe,xe,He)},z=(W,te,ie,Ie,ue,Se,Pe,xe)=>{let He,Te;const{type:V,props:ne,shapeFlag:ye,transition:Be,dirs:je}=W;if(He=W.el=s(W.type,Se,ne&&ne.is,ne),ye&8?g(He,W.children):ye&16&&B(W.children,He,null,Ie,ue,Se&&V!=="foreignObject",Pe,xe),je&&Ku(W,null,Ie,"created"),x(He,W,W.scopeId,Pe,Ie),ne){for(const Fe in ne)Fe!=="value"&&!Xm(Fe)&&i(He,Fe,null,ne[Fe],Se,W.children,Ie,ue,ve);"value"in ne&&i(He,"value",null,ne.value),(Te=ne.onVnodeBeforeMount)&&oa(Te,Ie,W)}je&&Ku(W,null,Ie,"beforeMount");const lt=(!ue||ue&&!ue.pendingBranch)&&Be&&!Be.persisted;lt&&Be.beforeEnter(He),r(He,te,ie),((Te=ne&&ne.onVnodeMounted)||lt||je)&&Bi(()=>{Te&&oa(Te,Ie,W),lt&&Be.enter(He),je&&Ku(W,null,Ie,"mounted")},ue)},x=(W,te,ie,Ie,ue)=>{if(ie&&M(W,ie),Ie)for(let Se=0;Se<Ie.length;Se++)M(W,Ie[Se]);if(ue){let Se=ue.subTree;if(te===Se){const Pe=ue.vnode;x(W,Pe,Pe.scopeId,Pe.slotScopeIds,ue.parent)}}},B=(W,te,ie,Ie,ue,Se,Pe,xe,He=0)=>{for(let Te=He;Te<W.length;Te++){const V=W[Te]=xe?$l(W[Te]):ca(W[Te]);D(null,V,te,ie,Ie,ue,Se,Pe,xe)}},j=(W,te,ie,Ie,ue,Se,Pe)=>{const xe=te.el=W.el;let{patchFlag:He,dynamicChildren:Te,dirs:V}=te;He|=W.patchFlag&16;const ne=W.props||br,ye=te.props||br;let Be;ie&&Yu(ie,!1),(Be=ye.onVnodeBeforeUpdate)&&oa(Be,ie,te,W),V&&Ku(te,W,ie,"beforeUpdate"),ie&&Yu(ie,!0);const je=ue&&te.type!=="foreignObject";if(Te?G(W.dynamicChildren,Te,xe,ie,Ie,je,Se):Pe||ae(W,te,xe,null,ie,Ie,je,Se,!1),He>0){if(He&16)L(xe,te,ne,ye,ie,Ie,ue);else if(He&2&&ne.class!==ye.class&&i(xe,"class",null,ye.class,ue),He&4&&i(xe,"style",ne.style,ye.style,ue),He&8){const lt=te.dynamicProps;for(let Fe=0;Fe<lt.length;Fe++){const st=lt[Fe],wt=ne[st],mn=ye[st];(mn!==wt||st==="value")&&i(xe,st,wt,mn,ue,W.children,ie,Ie,ve)}}He&1&&W.children!==te.children&&g(xe,te.children)}else!Pe&&Te==null&&L(xe,te,ne,ye,ie,Ie,ue);((Be=ye.onVnodeUpdated)||V)&&Bi(()=>{Be&&oa(Be,ie,te,W),V&&Ku(te,W,ie,"updated")},Ie)},G=(W,te,ie,Ie,ue,Se,Pe)=>{for(let xe=0;xe<te.length;xe++){const He=W[xe],Te=te[xe],V=He.el&&(He.type===dt||!ic(He,Te)||He.shapeFlag&70)?v(He.el):ie;D(He,Te,V,null,Ie,ue,Se,Pe,!0)}},L=(W,te,ie,Ie,ue,Se,Pe)=>{if(ie!==Ie){if(ie!==br)for(const xe in ie)!Xm(xe)&&!(xe in Ie)&&i(W,xe,ie[xe],null,Pe,te.children,ue,Se,ve);for(const xe in Ie){if(Xm(xe))continue;const He=Ie[xe],Te=ie[xe];He!==Te&&xe!=="value"&&i(W,xe,Te,He,Pe,te.children,ue,Se,ve)}"value"in Ie&&i(W,"value",ie.value,Ie.value)}},T=(W,te,ie,Ie,ue,Se,Pe,xe,He)=>{const Te=te.el=W?W.el:u(""),V=te.anchor=W?W.anchor:u("");let{patchFlag:ne,dynamicChildren:ye,slotScopeIds:Be}=te;Be&&(xe=xe?xe.concat(Be):Be),W==null?(r(Te,ie,Ie),r(V,ie,Ie),B(te.children,ie,V,ue,Se,Pe,xe,He)):ne>0&&ne&64&&ye&&W.dynamicChildren?(G(W.dynamicChildren,ye,ie,ue,Se,Pe,xe),(te.key!=null||ue&&te===ue.subTree)&&_C(W,te,!0)):ae(W,te,ie,V,ue,Se,Pe,xe,He)},P=(W,te,ie,Ie,ue,Se,Pe,xe,He)=>{te.slotScopeIds=xe,W==null?te.shapeFlag&512?ue.ctx.activate(te,ie,Ie,Pe,He):Q(te,ie,Ie,ue,Se,Pe,He):Y(W,te,He)},Q=(W,te,ie,Ie,ue,Se,Pe)=>{const xe=W.component=e7(W,Ie,ue);if(Oy(W)&&(xe.ctx.renderer=me),t7(xe),xe.asyncDep){if(ue&&ue.registerDep(xe,oe),!W.el){const He=xe.subTree=Ct(Di);S(null,He,te,ie)}return}oe(xe,W,te,ie,ue,Se,Pe)},Y=(W,te,ie)=>{const Ie=te.component=W.component;if(mU(W,te,ie))if(Ie.asyncDep&&!Ie.asyncResolved){X(Ie,te,ie);return}else Ie.next=te,cU(Ie.update),Ie.update();else te.el=W.el,Ie.vnode=te},oe=(W,te,ie,Ie,ue,Se,Pe)=>{const xe=()=>{if(W.isMounted){let{next:V,bu:ne,u:ye,parent:Be,vnode:je}=W,lt=V,Fe;Yu(W,!1),V?(V.el=je.el,X(W,V,Pe)):V=je,ne&&Zm(ne),(Fe=V.props&&V.props.onVnodeBeforeUpdate)&&oa(Fe,Be,V,je),Yu(W,!0);const st=M1(W),wt=W.subTree;W.subTree=st,D(wt,st,v(wt.el),Me(wt),W,ue,Se),V.el=st.el,lt===null&&vU(W,st.el),ye&&Bi(ye,ue),(Fe=V.props&&V.props.onVnodeUpdated)&&Bi(()=>oa(Fe,Be,V,je),ue)}else{let V;const{el:ne,props:ye}=te,{bm:Be,m:je,parent:lt}=W,Fe=rh(te);if(Yu(W,!1),Be&&Zm(Be),!Fe&&(V=ye&&ye.onVnodeBeforeMount)&&oa(V,lt,te),Yu(W,!0),ne&&pe){const st=()=>{W.subTree=M1(W),pe(ne,W.subTree,W,ue,null)};Fe?te.type.__asyncLoader().then(()=>!W.isUnmounted&&st()):st()}else{const st=W.subTree=M1(W);D(null,st,ie,Ie,W,ue,Se),te.el=st.el}if(je&&Bi(je,ue),!Fe&&(V=ye&&ye.onVnodeMounted)){const st=te;Bi(()=>oa(V,lt,st),ue)}(te.shapeFlag&256||lt&&rh(lt.vnode)&<.vnode.shapeFlag&256)&&W.a&&Bi(W.a,ue),W.isMounted=!0,te=ie=Ie=null}},He=W.effect=new nC(xe,()=>fC(Te),W.scope),Te=W.update=()=>He.run();Te.id=W.uid,Yu(W,!0),Te()},X=(W,te,ie)=>{te.component=W;const Ie=W.vnode.props;W.vnode=te,W.next=null,$U(W,te.props,Ie,ie),qU(W,te.children,ie),$f(),oS(),Bf()},ae=(W,te,ie,Ie,ue,Se,Pe,xe,He=!1)=>{const Te=W&&W.children,V=W?W.shapeFlag:0,ne=te.children,{patchFlag:ye,shapeFlag:Be}=te;if(ye>0){if(ye&128){le(Te,ne,ie,Ie,ue,Se,Pe,xe,He);return}else if(ye&256){fe(Te,ne,ie,Ie,ue,Se,Pe,xe,He);return}}Be&8?(V&16&&ve(Te,ue,Se),ne!==Te&&g(ie,ne)):V&16?Be&16?le(Te,ne,ie,Ie,ue,Se,Pe,xe,He):ve(Te,ue,Se,!0):(V&8&&g(ie,""),Be&16&&B(ne,ie,Ie,ue,Se,Pe,xe,He))},fe=(W,te,ie,Ie,ue,Se,Pe,xe,He)=>{W=W||rf,te=te||rf;const Te=W.length,V=te.length,ne=Math.min(Te,V);let ye;for(ye=0;ye<ne;ye++){const Be=te[ye]=He?$l(te[ye]):ca(te[ye]);D(W[ye],Be,ie,null,ue,Se,Pe,xe,He)}Te>V?ve(W,ue,Se,!0,!1,ne):B(te,ie,Ie,ue,Se,Pe,xe,He,ne)},le=(W,te,ie,Ie,ue,Se,Pe,xe,He)=>{let Te=0;const V=te.length;let ne=W.length-1,ye=V-1;for(;Te<=ne&&Te<=ye;){const Be=W[Te],je=te[Te]=He?$l(te[Te]):ca(te[Te]);if(ic(Be,je))D(Be,je,ie,null,ue,Se,Pe,xe,He);else break;Te++}for(;Te<=ne&&Te<=ye;){const Be=W[ne],je=te[ye]=He?$l(te[ye]):ca(te[ye]);if(ic(Be,je))D(Be,je,ie,null,ue,Se,Pe,xe,He);else break;ne--,ye--}if(Te>ne){if(Te<=ye){const Be=ye+1,je=Be<V?te[Be].el:Ie;for(;Te<=ye;)D(null,te[Te]=He?$l(te[Te]):ca(te[Te]),ie,je,ue,Se,Pe,xe,He),Te++}}else if(Te>ye)for(;Te<=ne;)J(W[Te],ue,Se,!0),Te++;else{const Be=Te,je=Te,lt=new Map;for(Te=je;Te<=ye;Te++){const vn=te[Te]=He?$l(te[Te]):ca(te[Te]);vn.key!=null&<.set(vn.key,Te)}let Fe,st=0;const wt=ye-je+1;let mn=!1,In=0;const Cn=new Array(wt);for(Te=0;Te<wt;Te++)Cn[Te]=0;for(Te=Be;Te<=ne;Te++){const vn=W[Te];if(st>=wt){J(vn,ue,Se,!0);continue}let Qe;if(vn.key!=null)Qe=lt.get(vn.key);else for(Fe=je;Fe<=ye;Fe++)if(Cn[Fe-je]===0&&ic(vn,te[Fe])){Qe=Fe;break}Qe===void 0?J(vn,ue,Se,!0):(Cn[Qe-je]=Te+1,Qe>=In?In=Qe:mn=!0,D(vn,te[Qe],ie,null,ue,Se,Pe,xe,He),st++)}const En=mn?jU(Cn):rf;for(Fe=En.length-1,Te=wt-1;Te>=0;Te--){const vn=je+Te,Qe=te[vn],yt=vn+1<V?te[vn+1].el:Ie;Cn[Te]===0?D(null,Qe,ie,yt,ue,Se,Pe,xe,He):mn&&(Fe<0||Te!==En[Fe]?ce(Qe,ie,yt,2):Fe--)}}},ce=(W,te,ie,Ie,ue=null)=>{const{el:Se,type:Pe,transition:xe,children:He,shapeFlag:Te}=W;if(Te&6){ce(W.component.subTree,te,ie,Ie);return}if(Te&128){W.suspense.move(te,ie,Ie);return}if(Te&64){Pe.move(W,te,ie,me);return}if(Pe===dt){r(Se,te,ie);for(let ne=0;ne<He.length;ne++)ce(He[ne],te,ie,Ie);r(W.anchor,te,ie);return}if(Pe===T1){A(W,te,ie);return}if(Ie!==2&&Te&1&&xe)if(Ie===0)xe.beforeEnter(Se),r(Se,te,ie),Bi(()=>xe.enter(Se),ue);else{const{leave:ne,delayLeave:ye,afterLeave:Be}=xe,je=()=>r(Se,te,ie),lt=()=>{ne(Se,()=>{je(),Be&&Be()})};ye?ye(Se,je,lt):lt()}else r(Se,te,ie)},J=(W,te,ie,Ie=!1,ue=!1)=>{const{type:Se,props:Pe,ref:xe,children:He,dynamicChildren:Te,shapeFlag:V,patchFlag:ne,dirs:ye}=W;if(xe!=null&&yM(xe,null,ie,W,!0),V&256){te.ctx.deactivate(W);return}const Be=V&1&&ye,je=!rh(W);let lt;if(je&&(lt=Pe&&Pe.onVnodeBeforeUnmount)&&oa(lt,te,W),V&6)Oe(W.component,ie,Ie);else{if(V&128){W.suspense.unmount(ie,Ie);return}Be&&Ku(W,null,te,"beforeUnmount"),V&64?W.type.remove(W,te,ie,ue,me,Ie):Te&&(Se!==dt||ne>0&&ne&64)?ve(Te,te,ie,!1,!0):(Se===dt&&ne&384||!ue&&V&16)&&ve(He,te,ie),Ie&&re(W)}(je&&(lt=Pe&&Pe.onVnodeUnmounted)||Be)&&Bi(()=>{lt&&oa(lt,te,W),Be&&Ku(W,null,te,"unmounted")},ie)},re=W=>{const{type:te,el:ie,anchor:Ie,transition:ue}=W;if(te===dt){de(ie,Ie);return}if(te===T1){N(W);return}const Se=()=>{o(ie),ue&&!ue.persisted&&ue.afterLeave&&ue.afterLeave()};if(W.shapeFlag&1&&ue&&!ue.persisted){const{leave:Pe,delayLeave:xe}=ue,He=()=>Pe(ie,Se);xe?xe(W.el,Se,He):He()}else Se()},de=(W,te)=>{let ie;for(;W!==te;)ie=_(W),o(W),W=ie;o(te)},Oe=(W,te,ie)=>{const{bum:Ie,scope:ue,update:Se,subTree:Pe,um:xe}=W;Ie&&Zm(Ie),ue.stop(),Se&&(Se.active=!1,J(Pe,W,te,ie)),xe&&Bi(xe,te),Bi(()=>{W.isUnmounted=!0},te),te&&te.pendingBranch&&!te.isUnmounted&&W.asyncDep&&!W.asyncResolved&&W.suspenseId===te.pendingId&&(te.deps--,te.deps===0&&te.resolve())},ve=(W,te,ie,Ie=!1,ue=!1,Se=0)=>{for(let Pe=Se;Pe<W.length;Pe++)J(W[Pe],te,ie,Ie,ue)},Me=W=>W.shapeFlag&6?Me(W.component.subTree):W.shapeFlag&128?W.suspense.next():_(W.anchor||W.el),K=(W,te,ie)=>{W==null?te._vnode&&J(te._vnode,null,null,!0):D(te._vnode||null,W,te,null,null,null,ie),oS(),SL(),te._vnode=W},me={p:D,um:J,m:ce,r:re,mt:Q,mc:B,pc:ae,pbc:G,n:Me,o:e};let ke,pe;return t&&([ke,pe]=t(me)),{render:K,hydrate:ke,createApp:FU(K,ke)}}function Yu({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function _C(e,t,n=!1){const r=e.children,o=t.children;if(zt(r)&&zt(o))for(let i=0;i<r.length;i++){const s=r[i];let u=o[i];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=o[i]=$l(o[i]),u.el=s.el),n||_C(s,u)),u.type===qf&&(u.el=s.el)}}function jU(e){const t=e.slice(),n=[0];let r,o,i,s,u;const d=e.length;for(r=0;r<d;r++){const f=e[r];if(f!==0){if(o=n[n.length-1],e[o]<f){t[r]=o,n.push(r);continue}for(i=0,s=n.length-1;i<s;)u=i+s>>1,e[n[u]]<f?i=u+1:s=u;f<e[n[i]]&&(i>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 WU=e=>e.__isTeleport,ih=e=>e&&(e.disabled||e.disabled===""),mS=e=>typeof SVGElement<"u"&&e instanceof SVGElement,_M=(e,t)=>{const n=e&&e.to;return Gr(n)?t?t(n):null:n},KU={__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=ih(t.props);let{shapeFlag:R,children:A,dynamicChildren:N}=t;if(e==null){const H=t.el=D(""),z=t.anchor=D("");M(H,n,r),M(z,n,r);const x=t.target=_M(t.props,C),B=t.targetAnchor=D("");x&&(M(B,x),s=s||mS(x));const j=(G,L)=>{R&16&&g(A,G,L,o,i,s,u,d)};S?j(n,z):x&&j(x,B)}else{t.el=e.el;const H=t.anchor=e.anchor,z=t.target=e.target,x=t.targetAnchor=e.targetAnchor,B=ih(e.props),j=B?n:z,G=B?H:x;if(s=s||mS(z),N?(_(e.dynamicChildren,N,j,o,i,s,u),_C(e,t,!0)):d||v(e,t,j,G,o,i,s,u,!1),S)B||mm(t,n,H,f,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const L=t.target=_M(t.props,C);L&&mm(t,L,null,f,0)}else B&&mm(t,z,x,f,1)}WL(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||!ih(_))&&(i(f),u&16))for(let M=0;M<d.length;M++){const C=d[M];o(C,t,n,!0,!!C.dynamicChildren)}},move:mm,hydrate:YU};function mm(e,t,n,{o:{insert:r},m:o},i=2){i===0&&r(e.targetAnchor,t,n);const{el:s,anchor:u,shapeFlag:d,children:f,props:g}=e,v=i===2;if(v&&r(s,t,n),(!v||ih(g))&&d&16)for(let _=0;_<f.length;_++)o(f[_],t,n,2);v&&r(u,t,n)}function YU(e,t,n,r,o,i,{o:{nextSibling:s,parentNode:u,querySelector:d}},f){const g=t.target=_M(t.props,d);if(g){const v=g._lpa||g.firstChild;if(t.shapeFlag&16)if(ih(t.props))t.anchor=f(s(e),t,u(e),n,r,o,i),t.targetAnchor=v;else{t.anchor=s(e);let _=v;for(;_;)if(_=s(_),_&&_.nodeType===8&&_.data==="teleport anchor"){t.targetAnchor=_,g._lpa=t.targetAnchor&&s(t.targetAnchor);break}f(v,t,g,n,r,o,i)}WL(t)}return t.anchor&&s(t.anchor)}const bC=KU;function WL(e){const t=e.ctx;if(t&&t.ut){let n=e.children[0].el;for(;n!==e.targetAnchor;)n.nodeType===1&&n.setAttribute("data-v-owner",t.uid),n=n.nextSibling;t.ut()}}const dt=Symbol.for("v-fgt"),qf=Symbol.for("v-txt"),Di=Symbol.for("v-cmt"),T1=Symbol.for("v-stc"),sh=[];let qs=null;function Z(e=!1){sh.push(qs=e?null:[])}function JU(){sh.pop(),qs=sh[sh.length-1]||null}let Hh=1;function vS(e){Hh+=e}function KL(e){return e.dynamicChildren=Hh>0?qs||rf:null,JU(),Hh>0&&qs&&qs.push(e),e}function se(e,t,n,r,o,i){return KL($(e,t,n,r,o,i,!0))}function bt(e,t,n,r,o){return KL(Ct(e,t,n,r,o,!0))}function qh(e){return e?e.__v_isVNode===!0:!1}function ic(e,t){return e.type===t.type&&e.key===t.key}const Ny="__vInternal",YL=({key:e})=>e??null,Qm=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Gr(e)||gr(e)||hn(e)?{i:Jo,r:e,k:t,f:!!n}:e:null);function $(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&&YL(t),ref:t&&Qm(t),scopeId:Ly,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:Jo};return u?(MC(d,n),i&128&&e.normalize(d)):n&&(d.shapeFlag|=Gr(n)?8:16),Hh>0&&!s&&qs&&(d.patchFlag>0||i&6)&&d.patchFlag!==32&&qs.push(d),d}const Ct=XU;function XU(e,t=null,n=null,r=0,o=null,i=!1){if((!e||e===FL)&&(e=Di),qh(e)){const u=wa(e,t,!0);return n&&MC(u,n),Hh>0&&!i&&qs&&(u.shapeFlag&6?qs[qs.indexOf(e)]=u:qs.push(u)),u.patchFlag|=-2,u}if(i7(e)&&(e=e.__vccOpts),t){t=zl(t);let{class:u,style:d}=t;u&&!Gr(u)&&(t.class=it(u)),cr(d)&&(_L(d)&&!zt(d)&&(d=to({},d)),t.style=Ro(d))}const s=Gr(e)?1:yU(e)?128:WU(e)?64:cr(e)?4:hn(e)?2:0;return $(e,t,n,r,o,s,i,!0)}function zl(e){return e?_L(e)||Ny in e?to({},e):e:null}function wa(e,t,n=!1){const{props:r,ref:o,patchFlag:i,children:s}=e,u=t?Ao(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&YL(u),ref:t&&t.ref?n&&o?zt(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&&wa(e.ssContent),ssFallback:e.ssFallback&&wa(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Fr(e=" ",t=0){return Ct(qf,null,e,t)}function Ce(e="",t=!1){return t?(Z(),bt(Di,null,e)):Ct(Di,null,e)}function ca(e){return e==null||typeof e=="boolean"?Ct(Di):zt(e)?Ct(dt,null,e.slice()):typeof e=="object"?$l(e):Ct(qf,null,String(e))}function $l(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wa(e)}function MC(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(zt(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),MC(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!(Ny in t)?t._ctx=Jo:o===3&&Jo&&(Jo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else hn(t)?(t={default:t,_ctx:Jo},n=32):(t=String(t),r&64?(n=16,t=[Fr(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ao(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=it([t.class,r.class]));else if(o==="style")t.style=Ro([t.style,r.style]);else if(wy(o)){const i=t[o],s=r[o];s&&i!==s&&!(zt(i)&&i.includes(s))&&(t[o]=i?[].concat(i,s):s)}else o!==""&&(t[o]=r[o])}return t}function oa(e,t,n,r=null){Ss(e,t,7,[n,r])}const ZU=BL();let QU=0;function e7(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||ZU,i={uid:QU++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,scope:new Cx(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:qL(r,o),emitsOptions:DL(r,o),emit:null,emitted:null,propsDefaults:br,inheritAttrs:r.inheritAttrs,ctx:br,data:br,props:br,attrs:br,slots:br,refs:br,setupState:br,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=pU.bind(null,i),e.ce&&e.ce(i),i}let Lo=null;const Yi=()=>Lo||Jo;let IC,Nd,yS="__VUE_INSTANCE_SETTERS__";(Nd=uM()[yS])||(Nd=uM()[yS]=[]),Nd.push(e=>Lo=e),IC=e=>{Nd.length>1?Nd.forEach(t=>t(e)):Nd[0](e)};const Cf=e=>{IC(e),e.scope.on()},Uc=()=>{Lo&&Lo.scope.off(),IC(null)};function JL(e){return e.vnode.shapeFlag&4}let Vh=!1;function t7(e,t=!1){Vh=t;const{props:n,children:r}=e.vnode,o=JL(e);GU(e,n,o,t),HU(e,r);const i=o?n7(e,t):void 0;return Vh=!1,i}function n7(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=aC(new Proxy(e.ctx,AU));const{setup:r}=n;if(r){const o=e.setupContext=r.length>1?ZL(e):null;Cf(e),$f();const i=au(r,e,0,[e.props,o]);if(Bf(),Uc(),rL(i)){if(i.then(Uc,Uc),t)return i.then(s=>{_S(e,s,t)}).catch(s=>{Ey(s,e,0)});e.asyncDep=i}else _S(e,i,t)}else XL(e,t)}function _S(e,t,n){hn(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:cr(t)&&(e.setupState=IL(t)),XL(e,n)}let bS;function XL(e,t,n){const r=e.type;if(!e.render){if(!t&&bS&&!r.render){const o=r.template||vC(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=bS(o,f)}}e.render=r.render||zs}Cf(e),$f(),OU(e),Bf(),Uc()}function r7(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return Ki(e,"get","$attrs"),t[n]}}))}function ZL(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return r7(e)},slots:e.slots,emit:e.emit,expose:t}}function Py(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(IL(aC(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in oh)return oh[n](e)},has(t,n){return n in t||n in oh}}))}function o7(e,t=!0){return hn(e)?e.displayName||e.name:e.name||t&&e.__name}function i7(e){return hn(e)&&"__vccOpts"in e}const Ve=(e,t)=>aU(e,t,Vh);function Re(e,t,n){const r=arguments.length;return r===2?cr(t)&&!zt(t)?qh(t)?Ct(e,null,[t]):Ct(e,t):Ct(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&qh(n)&&(n=[n]),Ct(e,t,n))}const s7=Symbol.for("v-scx"),a7=()=>tn(s7),l7="3.3.4",u7="http://www.w3.org/2000/svg",sc=typeof document<"u"?document:null,MS=sc&&sc.createElement("template"),c7={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?sc.createElementNS(u7,e):sc.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>sc.createTextNode(e),createComment:e=>sc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>sc.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{MS.innerHTML=r?`<svg>${e}</svg>`:e;const u=MS.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 d7(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 f7(e,t,n){const r=e.style,o=Gr(n);if(n&&!o){if(t&&!Gr(t))for(const i in t)n[i]==null&&bM(r,i,"");for(const i in n)bM(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 IS=/\s*!important$/;function bM(e,t,n){if(zt(n))n.forEach(r=>bM(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=p7(e,t);IS.test(n)?e.setProperty(sd(r),n.replace(IS,""),"important"):e[r]=n}}const CS=["Webkit","Moz","ms"],w1={};function p7(e,t){const n=w1[t];if(n)return n;let r=Ta(t);if(r!=="filter"&&r in e)return w1[t]=r;r=ky(r);for(let o=0;o<CS.length;o++){const i=CS[o]+r;if(i in e)return w1[t]=i}return t}const TS="http://www.w3.org/1999/xlink";function h7(e,t,n,r,o){if(r&&t.startsWith("xlink:"))n==null?e.removeAttributeNS(TS,t.slice(6,t.length)):e.setAttributeNS(TS,t,n);else{const i=Mx(t);n==null||i&&!sL(n)?e.removeAttribute(t):e.setAttribute(t,i?"":n)}}function g7(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=sL(n):n==null&&f==="string"?(n="",d=!0):f==="number"&&(n=0,d=!0)}try{e[t]=n}catch{}d&&e.removeAttribute(t)}function tl(e,t,n,r){e.addEventListener(t,n,r)}function m7(e,t,n,r){e.removeEventListener(t,n,r)}function v7(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]=y7(t);if(r){const f=i[t]=M7(r,o);tl(e,u,f,d)}else s&&(m7(e,u,s,d),i[t]=void 0)}}const wS=/(?:Once|Passive|Capture)$/;function y7(e){let t;if(wS.test(e)){t={};let r;for(;r=e.match(wS);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):sd(e.slice(2)),t]}let S1=0;const _7=Promise.resolve(),b7=()=>S1||(_7.then(()=>S1=0),S1=Date.now());function M7(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Ss(I7(r,n.value),t,5,[r])};return n.value=e,n.attached=b7(),n}function I7(e,t){if(zt(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 SS=/^on[a-z]/,C7=(e,t,n,r,o=!1,i,s,u,d)=>{t==="class"?d7(e,r,o):t==="style"?f7(e,n,r):wy(t)?JI(t)||v7(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):T7(e,t,r,o))?g7(e,t,r,i,s,u,d):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),h7(e,t,r,o))};function T7(e,t,n,r){return r?!!(t==="innerHTML"||t==="textContent"||t in e&&SS.test(t)&&hn(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||SS.test(t)&&Gr(n)?!1:t in e}const El="transition",Np="animation",bo=(e,{slots:t})=>Re(IU,eO(e),t);bo.displayName="Transition";const QL={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},w7=bo.props=to({},LL,QL),Ju=(e,t=[])=>{zt(e)?e.forEach(n=>n(...t)):e&&e(...t)},kS=e=>e?zt(e)?e.some(t=>t.length>1):e.length>1:!1;function eO(e){const t={};for(const T in e)T in QL||(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=S7(o),D=C&&C[0],w=C&&C[1],{onBeforeEnter:S,onEnter:R,onEnterCancelled:A,onLeave:N,onLeaveCancelled:H,onBeforeAppear:z=S,onAppear:x=R,onAppearCancelled:B=A}=t,j=(T,P,Q)=>{Nl(T,P?g:u),Nl(T,P?f:s),Q&&Q()},G=(T,P)=>{T._isLeaving=!1,Nl(T,v),Nl(T,M),Nl(T,_),P&&P()},L=T=>(P,Q)=>{const Y=T?x:R,oe=()=>j(P,T,Q);Ju(Y,[P,oe]),DS(()=>{Nl(P,T?d:i),ja(P,T?g:u),kS(Y)||ES(P,r,D,oe)})};return to(t,{onBeforeEnter(T){Ju(S,[T]),ja(T,i),ja(T,s)},onBeforeAppear(T){Ju(z,[T]),ja(T,d),ja(T,f)},onEnter:L(!1),onAppear:L(!0),onLeave(T,P){T._isLeaving=!0;const Q=()=>G(T,P);ja(T,v),nO(),ja(T,_),DS(()=>{T._isLeaving&&(Nl(T,v),ja(T,M),kS(N)||ES(T,r,w,Q))}),Ju(N,[T,Q])},onEnterCancelled(T){j(T,!1),Ju(A,[T])},onAppearCancelled(T){j(T,!0),Ju(B,[T])},onLeaveCancelled(T){G(T),Ju(H,[T])}})}function S7(e){if(e==null)return null;if(cr(e))return[k1(e.enter),k1(e.leave)];{const t=k1(e);return[t,t]}}function k1(e){return gx(e)}function ja(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function Nl(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 DS(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let k7=0;function ES(e,t,n,r){const o=e._endId=++k7,i=()=>{o===e._endId&&r()};if(n)return setTimeout(i,n);const{type:s,timeout:u,propCount:d}=tO(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<d&&v()},u+1),e.addEventListener(f,_)}function tO(e,t){const n=window.getComputedStyle(e),r=C=>(n[C]||"").split(", "),o=r(`${El}Delay`),i=r(`${El}Duration`),s=AS(o,i),u=r(`${Np}Delay`),d=r(`${Np}Duration`),f=AS(u,d);let g=null,v=0,_=0;t===El?s>0&&(g=El,v=s,_=i.length):t===Np?f>0&&(g=Np,v=f,_=d.length):(v=Math.max(s,f),g=v>0?s>f?El:Np:null,_=g?g===El?i.length:d.length:0);const M=g===El&&/\b(transform|all)(,|$)/.test(r(`${El}Property`).toString());return{type:g,timeout:v,propCount:_,hasTransform:M}}function AS(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>LS(n)+LS(e[r])))}function LS(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function nO(){return document.body.offsetHeight}const rO=new WeakMap,oO=new WeakMap,iO={name:"TransitionGroup",props:to({},w7,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Yi(),r=AL();let o,i;return UL(()=>{if(!o.length)return;const s=e.moveClass||`${e.name||"v"}-move`;if(!O7(o[0].el,n.vnode.el,s))return;o.forEach(E7),o.forEach(A7);const u=o.filter(L7);nO(),u.forEach(d=>{const f=d.el,g=f.style;ja(f,s),g.transform=g.webkitTransform=g.transitionDuration="";const v=f._moveCb=_=>{_&&_.target!==f||(!_||/transform$/.test(_.propertyName))&&(f.removeEventListener("transitionend",v),f._moveCb=null,Nl(f,s))};f.addEventListener("transitionend",v)})}),()=>{const s=Hn(e),u=eO(s);let d=s.tag||dt;o=i,i=t.default?hC(t.default()):[];for(let f=0;f<i.length;f++){const g=i[f];g.key!=null&&Bh(g,$h(g,u,r,n))}if(o)for(let f=0;f<o.length;f++){const g=o[f];Bh(g,$h(g,u,r,n)),rO.set(g,g.el.getBoundingClientRect())}return Ct(d,null,i)}}},D7=e=>delete e.mode;iO.props;const sO=iO;function E7(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function A7(e){oO.set(e,e.el.getBoundingClientRect())}function L7(e){const t=rO.get(e),n=oO.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 O7(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}=tO(r);return o.removeChild(r),i}const yu=e=>{const t=e.props["onUpdate:modelValue"]||!1;return zt(t)?n=>Zm(t,n):t};function R7(e){e.target.composing=!0}function OS(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ll={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e._assign=yu(o);const i=r||o.props&&o.props.type==="number";tl(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&&tl(e,"change",()=>{e.value=e.value.trim()}),t||(tl(e,"compositionstart",R7),tl(e,"compositionend",OS),tl(e,"change",OS))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:r,number:o}},i){if(e._assign=yu(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)}},N7={deep:!0,created(e,t,n){e._assign=yu(n),tl(e,"change",()=>{const r=e._modelValue,o=Tf(e),i=e.checked,s=e._assign;if(zt(r)){const u=QI(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(Gf(r)){const u=new Set(r);i?u.add(o):u.delete(o),s(u)}else s(aO(e,i))})},mounted:RS,beforeUpdate(e,t,n){e._assign=yu(n),RS(e,t,n)}};function RS(e,{value:t,oldValue:n},r){e._modelValue=t,zt(t)?e.checked=QI(t,r.props.value)>-1:Gf(t)?e.checked=t.has(r.props.value):t!==n&&(e.checked=Zc(t,aO(e,!0)))}const P7={created(e,{value:t},n){e.checked=Zc(t,n.props.value),e._assign=yu(n),tl(e,"change",()=>{e._assign(Tf(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e._assign=yu(r),t!==n&&(e.checked=Zc(t,r.props.value))}},x7={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=Gf(t);tl(e,"change",()=>{const i=Array.prototype.filter.call(e.options,s=>s.selected).map(s=>n?Iv(Tf(s)):Tf(s));e._assign(e.multiple?o?new Set(i):i:i[0])}),e._assign=yu(r)},mounted(e,{value:t}){NS(e,t)},beforeUpdate(e,t,n){e._assign=yu(n)},updated(e,{value:t}){NS(e,t)}};function NS(e,t){const n=e.multiple;if(!(n&&!zt(t)&&!Gf(t))){for(let r=0,o=e.options.length;r<o;r++){const i=e.options[r],s=Tf(i);if(n)zt(t)?i.selected=QI(t,s)>-1:i.selected=t.has(s);else if(Zc(Tf(i),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Tf(e){return"_value"in e?e._value:e.value}function aO(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const U7={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 F7(e,t){switch(e){case"SELECT":return x7;case"TEXTAREA":return ll;default:switch(t){case"checkbox":return N7;case"radio":return P7;default:return ll}}}function vm(e,t,n,r,o){const s=F7(e.tagName,n.props&&n.props.type)[o];s&&s(e,t,n,r)}const G7=["ctrl","shift","alt","meta"],$7={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)=>G7.some(n=>e[`${n}Key`]&&!t.includes(n))},bn=(e,t)=>(n,...r)=>{for(let o=0;o<t.length;o++){const i=$7[t[o]];if(i&&i(n,t))return}return e(n,...r)},B7={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},fr=(e,t)=>n=>{if(!("key"in n))return;const r=sd(n.key);if(t.some(o=>o===r||B7[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):Pp(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),Pp(e,!0),r.enter(e)):r.leave(e,()=>{Pp(e,!1)}):Pp(e,t))},beforeUnmount(e,{value:t}){Pp(e,t)}};function Pp(e,t){e.style.display=t?e._vod:"none"}const H7=to({patchProp:C7},c7);let PS;function lO(){return PS||(PS=VU(H7))}const xS=(...e)=>{lO().render(...e)},q7=(...e)=>{const t=lO().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=V7(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 V7(e){return Gr(e)?document.querySelector(e):e}const z7={theme:"dark"};function j7(e){e.setCommonStore(z7)}function W7(e){console.log("app",e)}const K7={name:"TUITheme",plugin:j7,install:W7};/*!
- * shared v9.2.0-beta.32
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */const Y7=typeof window<"u",J7=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",wu=e=>J7?Symbol(e):e,X7=(e,t,n)=>Z7({l:e,k:t,s:n}),Z7=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Oo=e=>typeof e=="number"&&isFinite(e),Q7=e=>TC(e)==="[object Date]",_u=e=>TC(e)==="[object RegExp]",xy=e=>dn(e)&&Object.keys(e).length===0;function eF(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Po=Object.assign;let US;const ah=()=>US||(US=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function FS(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const tF=Object.prototype.hasOwnProperty;function CC(e,t){return tF.call(e,t)}const Ar=Array.isArray,Xr=e=>typeof e=="function",kt=e=>typeof e=="string",Wn=e=>typeof e=="boolean",jr=e=>e!==null&&typeof e=="object",uO=Object.prototype.toString,TC=e=>uO.call(e),dn=e=>TC(e)==="[object Object]",nF=e=>e==null?"":Ar(e)||dn(e)&&e.toString===uO?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 Uy(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 rF(e){throw e}function oF(e,t,n){return{line:e,column:t,offset:n}}function MM(e,t,n){const r={start:e,end:t};return n!=null&&(r.source=n),r}const Ba=" ",iF="\r",Ti=`
- `,sF=String.fromCharCode(8232),aF=String.fromCharCode(8233);function lF(e){const t=e;let n=0,r=1,o=1,i=0;const s=x=>t[x]===iF&&t[x+1]===Ti,u=x=>t[x]===Ti,d=x=>t[x]===aF,f=x=>t[x]===sF,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)?Ti:t[x],w=()=>D(n),S=()=>D(n+i);function R(){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 N(){n=0,r=1,o=1,i=0}function H(x=0){i=x}function z(){const x=n+i;for(;x!==n;)R();i=0}return{index:v,line:_,column:M,peekOffset:C,charAt:D,currentChar:w,currentPeek:S,next:R,peek:A,reset:N,resetPeek:H,skipToPeek:z}}const Al=void 0,GS="'",uF="tokenizer";function cF(e,t={}){const n=t.location!==!1,r=lF(e),o=()=>r.index(),i=()=>oF(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(pe,W,te,...ie){const Ie=f();if(W.column+=te,W.offset+=te,g){const ue=MM(Ie.startLoc,W),Se=Uy(pe,ue,{domain:uF,args:ie});g(Se)}}function _(pe,W,te){pe.endLoc=i(),pe.currentType=W;const ie={type:W};return n&&(ie.loc=MM(pe.startLoc,pe.endLoc)),te!=null&&(ie.value=te),ie}const M=pe=>_(pe,14);function C(pe,W){return pe.currentChar()===W?(pe.next(),W):(v(Qn.EXPECTED_TOKEN,i(),0,W),"")}function D(pe){let W="";for(;pe.currentPeek()===Ba||pe.currentPeek()===Ti;)W+=pe.currentPeek(),pe.peek();return W}function w(pe){const W=D(pe);return pe.skipToPeek(),W}function S(pe){if(pe===Al)return!1;const W=pe.charCodeAt(0);return W>=97&&W<=122||W>=65&&W<=90||W===95}function R(pe){if(pe===Al)return!1;const W=pe.charCodeAt(0);return W>=48&&W<=57}function A(pe,W){const{currentType:te}=W;if(te!==2)return!1;D(pe);const ie=S(pe.currentPeek());return pe.resetPeek(),ie}function N(pe,W){const{currentType:te}=W;if(te!==2)return!1;D(pe);const ie=pe.currentPeek()==="-"?pe.peek():pe.currentPeek(),Ie=R(ie);return pe.resetPeek(),Ie}function H(pe,W){const{currentType:te}=W;if(te!==2)return!1;D(pe);const ie=pe.currentPeek()===GS;return pe.resetPeek(),ie}function z(pe,W){const{currentType:te}=W;if(te!==8)return!1;D(pe);const ie=pe.currentPeek()===".";return pe.resetPeek(),ie}function x(pe,W){const{currentType:te}=W;if(te!==9)return!1;D(pe);const ie=S(pe.currentPeek());return pe.resetPeek(),ie}function B(pe,W){const{currentType:te}=W;if(!(te===8||te===12))return!1;D(pe);const ie=pe.currentPeek()===":";return pe.resetPeek(),ie}function j(pe,W){const{currentType:te}=W;if(te!==10)return!1;const ie=()=>{const ue=pe.currentPeek();return ue==="{"?S(pe.peek()):ue==="@"||ue==="%"||ue==="|"||ue===":"||ue==="."||ue===Ba||!ue?!1:ue===Ti?(pe.peek(),ie()):S(ue)},Ie=ie();return pe.resetPeek(),Ie}function G(pe){D(pe);const W=pe.currentPeek()==="|";return pe.resetPeek(),W}function L(pe,W=!0){const te=(Ie=!1,ue="",Se=!1)=>{const Pe=pe.currentPeek();return Pe==="{"?ue==="%"?!1:Ie:Pe==="@"||!Pe?ue==="%"?!0:Ie:Pe==="%"?(pe.peek(),te(Ie,"%",!0)):Pe==="|"?ue==="%"||Se?!0:!(ue===Ba||ue===Ti):Pe===Ba?(pe.peek(),te(!0,Ba,Se)):Pe===Ti?(pe.peek(),te(!0,Ti,Se)):!0},ie=te();return W&&pe.resetPeek(),ie}function T(pe,W){const te=pe.currentChar();return te===Al?Al:W(te)?(pe.next(),te):null}function P(pe){return T(pe,te=>{const ie=te.charCodeAt(0);return ie>=97&&ie<=122||ie>=65&&ie<=90||ie>=48&&ie<=57||ie===95||ie===36})}function Q(pe){return T(pe,te=>{const ie=te.charCodeAt(0);return ie>=48&&ie<=57})}function Y(pe){return T(pe,te=>{const ie=te.charCodeAt(0);return ie>=48&&ie<=57||ie>=65&&ie<=70||ie>=97&&ie<=102})}function oe(pe){let W="",te="";for(;W=Q(pe);)te+=W;return te}function X(pe){let W="";for(;;){const te=pe.currentChar();if(te==="{"||te==="}"||te==="@"||te==="|"||!te)break;if(te==="%")if(L(pe))W+=te,pe.next();else break;else if(te===Ba||te===Ti)if(L(pe))W+=te,pe.next();else{if(G(pe))break;W+=te,pe.next()}else W+=te,pe.next()}return W}function ae(pe){w(pe);let W="",te="";for(;W=P(pe);)te+=W;return pe.currentChar()===Al&&v(Qn.UNTERMINATED_CLOSING_BRACE,i(),0),te}function fe(pe){w(pe);let W="";return pe.currentChar()==="-"?(pe.next(),W+=`-${oe(pe)}`):W+=oe(pe),pe.currentChar()===Al&&v(Qn.UNTERMINATED_CLOSING_BRACE,i(),0),W}function le(pe){w(pe),C(pe,"'");let W="",te="";const ie=ue=>ue!==GS&&ue!==Ti;for(;W=T(pe,ie);)W==="\\"?te+=ce(pe):te+=W;const Ie=pe.currentChar();return Ie===Ti||Ie===Al?(v(Qn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Ie===Ti&&(pe.next(),C(pe,"'")),te):(C(pe,"'"),te)}function ce(pe){const W=pe.currentChar();switch(W){case"\\":case"'":return pe.next(),`\\${W}`;case"u":return J(pe,W,4);case"U":return J(pe,W,6);default:return v(Qn.UNKNOWN_ESCAPE_SEQUENCE,i(),0,W),""}}function J(pe,W,te){C(pe,W);let ie="";for(let Ie=0;Ie<te;Ie++){const ue=Y(pe);if(!ue){v(Qn.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${W}${ie}${pe.currentChar()}`);break}ie+=ue}return`\\${W}${ie}`}function re(pe){w(pe);let W="",te="";const ie=Ie=>Ie!=="{"&&Ie!=="}"&&Ie!==Ba&&Ie!==Ti;for(;W=T(pe,ie);)te+=W;return te}function de(pe){let W="",te="";for(;W=P(pe);)te+=W;return te}function Oe(pe){const W=(te=!1,ie)=>{const Ie=pe.currentChar();return Ie==="{"||Ie==="%"||Ie==="@"||Ie==="|"||!Ie||Ie===Ba?ie:Ie===Ti?(ie+=Ie,pe.next(),W(te,ie)):(ie+=Ie,pe.next(),W(!0,ie))};return W(!1,"")}function ve(pe){w(pe);const W=C(pe,"|");return w(pe),W}function Me(pe,W){let te=null;switch(pe.currentChar()){case"{":return W.braceNest>=1&&v(Qn.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),pe.next(),te=_(W,2,"{"),w(pe),W.braceNest++,te;case"}":return W.braceNest>0&&W.currentType===2&&v(Qn.EMPTY_PLACEHOLDER,i(),0),pe.next(),te=_(W,3,"}"),W.braceNest--,W.braceNest>0&&w(pe),W.inLinked&&W.braceNest===0&&(W.inLinked=!1),te;case"@":return W.braceNest>0&&v(Qn.UNTERMINATED_CLOSING_BRACE,i(),0),te=K(pe,W)||M(W),W.braceNest=0,te;default:let Ie=!0,ue=!0,Se=!0;if(G(pe))return W.braceNest>0&&v(Qn.UNTERMINATED_CLOSING_BRACE,i(),0),te=_(W,1,ve(pe)),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,me(pe,W);if(Ie=A(pe,W))return te=_(W,5,ae(pe)),w(pe),te;if(ue=N(pe,W))return te=_(W,6,fe(pe)),w(pe),te;if(Se=H(pe,W))return te=_(W,7,le(pe)),w(pe),te;if(!Ie&&!ue&&!Se)return te=_(W,13,re(pe)),v(Qn.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,te.value),w(pe),te;break}return te}function K(pe,W){const{currentType:te}=W;let ie=null;const Ie=pe.currentChar();switch((te===8||te===9||te===12||te===10)&&(Ie===Ti||Ie===Ba)&&v(Qn.INVALID_LINKED_FORMAT,i(),0),Ie){case"@":return pe.next(),ie=_(W,8,"@"),W.inLinked=!0,ie;case".":return w(pe),pe.next(),_(W,9,".");case":":return w(pe),pe.next(),_(W,10,":");default:return G(pe)?(ie=_(W,1,ve(pe)),W.braceNest=0,W.inLinked=!1,ie):z(pe,W)||B(pe,W)?(w(pe),K(pe,W)):x(pe,W)?(w(pe),_(W,12,de(pe))):j(pe,W)?(w(pe),Ie==="{"?Me(pe,W)||ie:_(W,11,Oe(pe))):(te===8&&v(Qn.INVALID_LINKED_FORMAT,i(),0),W.braceNest=0,W.inLinked=!1,me(pe,W))}}function me(pe,W){let te={type:14};if(W.braceNest>0)return Me(pe,W)||M(W);if(W.inLinked)return K(pe,W)||M(W);const ie=pe.currentChar();switch(ie){case"{":return Me(pe,W)||M(W);case"}":return v(Qn.UNBALANCED_CLOSING_BRACE,i(),0),pe.next(),_(W,3,"}");case"@":return K(pe,W)||M(W);default:if(G(pe))return te=_(W,1,ve(pe)),W.braceNest=0,W.inLinked=!1,te;if(L(pe))return _(W,0,X(pe));if(ie==="%")return pe.next(),_(W,4,"%");break}return te}function ke(){const{currentType:pe,offset:W,startLoc:te,endLoc:ie}=d;return d.lastType=pe,d.lastOffset=W,d.lastStartLoc=te,d.lastEndLoc=ie,d.offset=o(),d.startLoc=i(),r.currentChar()===Al?_(d,14):me(r,d)}return{nextToken:ke,currentOffset:o,currentPosition:i,context:f}}const dF="parser",fF=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function pF(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 hF(e={}){const t=e.location!==!1,{onError:n}=e;function r(S,R,A,N,...H){const z=S.currentPosition();if(z.offset+=N,z.column+=N,n){const x=MM(A,z),B=Uy(R,x,{domain:dF,args:H});n(B)}}function o(S,R,A){const N={type:S,start:R,end:R};return t&&(N.loc={start:A,end:A}),N}function i(S,R,A,N){S.end=R,N&&(S.type=N),t&&S.loc&&(S.loc.end=A)}function s(S,R){const A=S.context(),N=o(3,A.offset,A.startLoc);return N.value=R,i(N,S.currentOffset(),S.currentPosition()),N}function u(S,R){const A=S.context(),{lastOffset:N,lastStartLoc:H}=A,z=o(5,N,H);return z.index=parseInt(R,10),S.nextToken(),i(z,S.currentOffset(),S.currentPosition()),z}function d(S,R){const A=S.context(),{lastOffset:N,lastStartLoc:H}=A,z=o(4,N,H);return z.key=R,S.nextToken(),i(z,S.currentOffset(),S.currentPosition()),z}function f(S,R){const A=S.context(),{lastOffset:N,lastStartLoc:H}=A,z=o(9,N,H);return z.value=R.replace(fF,pF),S.nextToken(),i(z,S.currentOffset(),S.currentPosition()),z}function g(S){const R=S.nextToken(),A=S.context(),{lastOffset:N,lastStartLoc:H}=A,z=o(8,N,H);return R.type!==12?(r(S,Qn.UNEXPECTED_EMPTY_LINKED_MODIFIER,A.lastStartLoc,0),z.value="",i(z,N,H),{nextConsumeToken:R,node:z}):(R.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,ia(R)),z.value=R.value||"",i(z,S.currentOffset(),S.currentPosition()),{node:z})}function v(S,R){const A=S.context(),N=o(7,A.offset,A.startLoc);return N.value=R,i(N,S.currentOffset(),S.currentPosition()),N}function _(S){const R=S.context(),A=o(6,R.offset,R.startLoc);let N=S.nextToken();if(N.type===9){const H=g(S);A.modifier=H.node,N=H.nextConsumeToken||S.nextToken()}switch(N.type!==10&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,R.lastStartLoc,0,ia(N)),N=S.nextToken(),N.type===2&&(N=S.nextToken()),N.type){case 11:N.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,R.lastStartLoc,0,ia(N)),A.key=v(S,N.value||"");break;case 5:N.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,R.lastStartLoc,0,ia(N)),A.key=d(S,N.value||"");break;case 6:N.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,R.lastStartLoc,0,ia(N)),A.key=u(S,N.value||"");break;case 7:N.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,R.lastStartLoc,0,ia(N)),A.key=f(S,N.value||"");break;default:r(S,Qn.UNEXPECTED_EMPTY_LINKED_KEY,R.lastStartLoc,0);const H=S.context(),z=o(7,H.offset,H.startLoc);return z.value="",i(z,H.offset,H.startLoc),A.key=z,i(A,H.offset,H.startLoc),{nextConsumeToken:N,node:A}}return i(A,S.currentOffset(),S.currentPosition()),{node:A}}function M(S){const R=S.context(),A=R.currentType===1?S.currentOffset():R.offset,N=R.currentType===1?R.endLoc:R.startLoc,H=o(2,A,N);H.items=[];let z=null;do{const j=z||S.nextToken();switch(z=null,j.type){case 0:j.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,R.lastStartLoc,0,ia(j)),H.items.push(s(S,j.value||""));break;case 6:j.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,R.lastStartLoc,0,ia(j)),H.items.push(u(S,j.value||""));break;case 5:j.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,R.lastStartLoc,0,ia(j)),H.items.push(d(S,j.value||""));break;case 7:j.value==null&&r(S,Qn.UNEXPECTED_LEXICAL_ANALYSIS,R.lastStartLoc,0,ia(j)),H.items.push(f(S,j.value||""));break;case 8:const G=_(S);H.items.push(G.node),z=G.nextConsumeToken||null;break}}while(R.currentType!==14&&R.currentType!==1);const x=R.currentType===1?R.lastOffset:S.currentOffset(),B=R.currentType===1?R.lastEndLoc:S.currentPosition();return i(H,x,B),H}function C(S,R,A,N){const H=S.context();let z=N.items.length===0;const x=o(1,R,A);x.cases=[],x.cases.push(N);do{const B=M(S);z||(z=B.items.length===0),x.cases.push(B)}while(H.currentType!==14);return z&&r(S,Qn.MUST_HAVE_MESSAGES_IN_PLURAL,A,0),i(x,S.currentOffset(),S.currentPosition()),x}function D(S){const R=S.context(),{offset:A,startLoc:N}=R,H=M(S);return R.currentType===14?H:C(S,A,N,H)}function w(S){const R=cF(S,Po({},e)),A=R.context(),N=o(0,A.offset,A.startLoc);return t&&N.loc&&(N.loc.source=S),N.body=D(R),A.currentType!==14&&r(R,Qn.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,S[A.offset]||""),i(N,R.currentOffset(),R.currentPosition()),N}return{parse:w}}function ia(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 gF(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function $S(e,t){for(let n=0;n<e.length;n++)wC(e[n],t)}function wC(e,t){switch(e.type){case 1:$S(e.cases,t),t.helper("plural");break;case 2:$S(e.items,t);break;case 6:wC(e.key,t),t.helper("linked");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function mF(e,t={}){const n=gF(e);n.helper("normalize"),e.body&&wC(e.body,n);const r=n.context();e.helpers=Array.from(r.helpers)}function vF(e,t){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:i}=t,s={source:e.loc.source,filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:i,indentLevel:0},u=()=>s;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 yF(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),wf(e,t.key),t.modifier&&(e.push(", "),wf(e,t.modifier)),e.push(")")}function _F(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let i=0;i<o&&(wf(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(r()),e.push("])")}function bF(e,t){const{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let i=0;i<o&&(wf(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(r()),e.push("])")}}function MF(e,t){t.body?wf(e,t.body):e.push("null")}function wf(e,t){const{helper:n}=e;switch(t.type){case 0:MF(e,t);break;case 1:bF(e,t);break;case 2:_F(e,t);break;case 6:yF(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const IF=(e,t={})=>{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=vF(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 "),wf(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 CF(e,t={}){const n=Po({},t),o=hF(n).parse(e);return mF(o,n),IF(o,n)}/*!
- * devtools-if v9.2.0-beta.32
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */const cO={I18nInit:"i18n:init",FunctionTranslate:"function:translate"};/*!
- * core-base v9.2.0-beta.32
- * (c) 2022 kazuya kawaguchi
- * Released under the MIT License.
- */const Su=[];Su[0]={w:[0],i:[3,0],"[":[4],o:[7]};Su[1]={w:[1],".":[2],"[":[4],o:[7]};Su[2]={w:[2],i:[3,0],0:[3,0]};Su[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Su[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Su[5]={"'":[4,0],o:8,l:[5,0]};Su[6]={'"':[4,0],o:8,l:[6,0]};const TF=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function wF(e){return TF.test(e)}function SF(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 kF(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 DF(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:wF(t)?SF(t):"*"+t}function EF(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=DF(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=kF(i),v=Su[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 BS=new Map;function AF(e,t){return jr(e)?e[t]:null}function LF(e,t){if(!jr(e))return null;let n=BS.get(t);if(n||(n=EF(t),n&&BS.set(t,n)),!n)return null;const r=n.length;let o=e,i=0;for(;i<r;){const s=o[n[i]];if(s===void 0)return null;o=s,i++}return o}const OF=e=>e,RF=e=>"",NF="text",PF=e=>e.length===0?"":e.join(""),xF=nF;function HS(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function UF(e){const t=Oo(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(Oo(e.named.count)||Oo(e.named.n))?Oo(e.named.count)?e.named.count:Oo(e.named.n)?e.named.n:t:t}function FF(e,t){t.count||(t.count=e),t.n||(t.n=e)}function GF(e={}){const t=e.locale,n=UF(e),r=jr(e.pluralRules)&&kt(t)&&Xr(e.pluralRules[t])?e.pluralRules[t]:HS,o=jr(e.pluralRules)&&kt(t)&&Xr(e.pluralRules[t])?HS:void 0,i=S=>S[r(n,S.length,o)],s=e.list||[],u=S=>s[S],d=e.named||{};Oo(e.pluralIndex)&&FF(n,d);const f=S=>d[S];function g(S){const R=Xr(e.messages)?e.messages(S):jr(e.messages)?e.messages[S]:!1;return R||(e.parent?e.parent.message(S):RF)}const v=S=>e.modifiers?e.modifiers[S]:OF,_=dn(e.processor)&&Xr(e.processor.normalize)?e.processor.normalize:PF,M=dn(e.processor)&&Xr(e.processor.interpolate)?e.processor.interpolate:xF,C=(S,R)=>{const A=g(S)(w);return kt(R)?v(R)(A):A},D=dn(e.processor)&&kt(e.processor.type)?e.processor.type:NF,w={list:u,named:f,plural:i,linked:C,message:g,type:D,interpolate:M,normalize:_};return w}let zh=null;function $F(e){zh=e}function BF(e,t,n){zh&&zh.emit(cO.I18nInit,{timestamp:Date.now(),i18n:e,version:t,meta:n})}const HF=qF(cO.FunctionTranslate);function qF(e){return t=>zh&&zh.emit(e,t)}function VF(e,t,n){return[...new Set([n,...Ar(t)?t:jr(t)?Object.keys(t):kt(t)?[t]:[n]])]}function dO(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=qS(i,s,t);const u=Ar(t)||!dn(t)?t:t.default?t.default:null;s=kt(u)?[u]:u,Ar(s)&&qS(i,s,!1),o.__localeChainCache.set(r,i)}return i}function qS(e,t,n){let r=!0;for(let o=0;o<t.length&&Wn(r);o++){const i=t[o];kt(i)&&(r=zF(e,t[o],n))}return r}function zF(e,t,n){let r;const o=t.split("-");do{const i=o.join("-");r=jF(e,i,n),o.splice(-1,1)}while(o.length&&r===!0);return r}function jF(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(Ar(n)||dn(n))&&n[o]&&(r=n[o])}return r}const WF="9.2.0-beta.32",Fy=-1,hg="en-US",VS="";function KF(){return{upper:e=>kt(e)?e.toUpperCase():e,lower:e=>kt(e)?e.toLowerCase():e,capitalize:e=>kt(e)?`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`:e}}let fO;function YF(e){fO=e}let pO;function JF(e){pO=e}let hO;function XF(e){hO=e}let gO=null;const zS=e=>{gO=e},ZF=()=>gO;let mO=null;const jS=e=>{mO=e},QF=()=>mO;let WS=0;function eG(e={}){const t=kt(e.version)?e.version:WF,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=Po({},e.modifiers||{},KF()),d=e.pluralRules||{},f=Xr(e.missing)?e.missing:null,g=Wn(e.missingWarn)||_u(e.missingWarn)?e.missingWarn:!0,v=Wn(e.fallbackWarn)||_u(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,R=Xr(e.messageCompiler)?e.messageCompiler:fO,A=Xr(e.messageResolver)?e.messageResolver:pO||AF,N=Xr(e.localeFallbacker)?e.localeFallbacker:hO||VF,H=jr(e.fallbackContext)?e.fallbackContext:void 0,z=Xr(e.onWarn)?e.onWarn:eF,x=e,B=jr(x.__datetimeFormatters)?x.__datetimeFormatters:new Map,j=jr(x.__numberFormatters)?x.__numberFormatters:new Map,G=jr(x.__meta)?x.__meta:{};WS++;const L={version:t,cid:WS,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:R,messageResolver:A,localeFallbacker:N,fallbackContext:H,onWarn:z,__meta:G};return L.datetimeFormats=i,L.numberFormats=s,L.__datetimeFormatters=B,L.__numberFormatters=j,__INTLIFY_PROD_DEVTOOLS__&&BF(L,t,G),L}function SC(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 xp(e,t,n){const r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}const tG=e=>e;let KS=Object.create(null);function nG(e,t={}){{const r=(t.onCacheKey||tG)(e),o=KS[r];if(o)return o;let i=!1;const s=t.onError||rF;t.onError=f=>{i=!0,s(f)};const{code:u}=CF(e,t),d=new Function(`return ${u}`)();return i?d:KS[r]=d}}let vO=Qn.__EXTEND_POINT__;const D1=()=>++vO,Jd={INVALID_ARGUMENT:vO,INVALID_DATE_ARGUMENT:D1(),INVALID_ISO_DATE_ARGUMENT:D1(),__EXTEND_POINT__:D1()};function Xd(e){return Uy(e,null,void 0)}const YS=()=>"",da=e=>Xr(e);function JS(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:i,fallbackLocale:s,messages:u}=e,[d,f]=IM(...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;_&&rG(f);let[S,R,A]=M?[d,w,u[w]||{}]:yO(e,d,w,s,v,g),N=S,H=d;if(!M&&!(kt(N)||da(N))&&D&&(N=C,H=N),!M&&(!(kt(N)||da(N))||!kt(R)))return o?Fy:d;let z=!1;const x=()=>{z=!0},B=da(N)?N:_O(e,d,R,N,H,x);if(z)return N;const j=sG(e,R,A,f),G=GF(j),L=oG(e,B,G),T=r?r(L):L;if(__INTLIFY_PROD_DEVTOOLS__){const P={timestamp:Date.now(),key:kt(d)?d:da(N)?N.key:"",locale:R||(da(N)?N.locale:""),format:kt(N)?N:da(N)?N.source:"",message:T};P.meta=Po({},e.__meta,ZF()||{}),HF(P)}return T}function rG(e){Ar(e.list)?e.list=e.list.map(t=>kt(t)?FS(t):t):jr(e.named)&&Object.keys(e.named).forEach(t=>{kt(e.named[t])&&(e.named[t]=FS(e.named[t]))})}function yO(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<g.length&&(_=g[D],v=s[_]||{},(M=d(v,t))===null&&(M=v[t]),!(kt(M)||Xr(M)));D++){const w=SC(e,t,_,i,C);w!==t&&(M=w)}return[M,_,v]}function _O(e,t,n,r,o,i){const{messageCompiler:s,warnHtmlMessage:u}=e;if(da(r)){const f=r;return f.locale=f.locale||n,f.key=f.key||t,f}const d=s(r,iG(e,n,o,r,u,i));return d.locale=n,d.key=t,d.source=r,d}function oG(e,t,n){return t(n)}function IM(...e){const[t,n,r]=e,o={};if(!kt(t)&&!Oo(t)&&!da(t))throw Xd(Jd.INVALID_ARGUMENT);const i=Oo(t)?String(t):(da(t),t);return Oo(n)?o.plural=n:kt(n)?o.default=n:dn(n)&&!xy(n)?o.named=n:Ar(n)&&(o.list=n),Oo(r)?o.plural=r:kt(r)?o.default=r:dn(r)&&Po(o,r),[i,o]}function iG(e,t,n,r,o,i){return{warnHtmlMessage:o,onError:s=>{throw i&&i(s),s},onCacheKey:s=>X7(t,n,s)}}function sG(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]=yO(g,M,t,u,d,f);C=s(D,M)}if(kt(C)){let D=!1;const S=_O(e,M,t,C,M,()=>{D=!0});return D?YS:S}else return da(C)?C:YS}};return e.processor&&(_.processor=e.processor),r.list&&(_.list=r.list),r.named&&(_.named=r.named),Oo(r.plural)&&(_.pluralIndex=r.plural),_}function XS(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:i,localeFallbacker:s}=e,{__datetimeFormatters:u}=e,[d,f,g,v]=CM(...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,R=null;const A="datetime format";for(let z=0;z<D.length&&(S=D[z],w=n[S]||{},R=w[d],!dn(R));z++)SC(e,d,S,_,A);if(!dn(R)||!kt(S))return r?Fy:d;let N=`${S}__${d}`;xy(v)||(N=`${N}__${JSON.stringify(v)}`);let H=u.get(N);return H||(H=new Intl.DateTimeFormat(S,Po({},R,v)),u.set(N,H)),M?H.formatToParts(f):H.format(f)}function CM(...e){const[t,n,r,o]=e;let i={},s={},u;if(kt(t)){const d=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!d)throw Xd(Jd.INVALID_ISO_DATE_ARGUMENT);const f=d[3]?d[3].trim().startsWith("T")?`${d[1].trim()}${d[3].trim()}`:`${d[1].trim()}T${d[3].trim()}`:d[1].trim();u=new Date(f);try{u.toISOString()}catch{throw Xd(Jd.INVALID_ISO_DATE_ARGUMENT)}}else if(Q7(t)){if(isNaN(t.getTime()))throw Xd(Jd.INVALID_DATE_ARGUMENT);u=t}else if(Oo(t))u=t;else throw Xd(Jd.INVALID_ARGUMENT);return kt(n)?i.key=n:dn(n)&&(i=n),kt(r)?i.locale=r:dn(r)&&(s=r),dn(o)&&(s=o),[i.key||"",u,i,s]}function ZS(e,t,n){const r=e;for(const o in n){const i=`${t}__${o}`;r.__datetimeFormatters.has(i)&&r.__datetimeFormatters.delete(i)}}function QS(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:i,localeFallbacker:s}=e,{__numberFormatters:u}=e,[d,f,g,v]=TM(...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.NumberFormat(C).format(f);let w={},S,R=null;const A="number format";for(let z=0;z<D.length&&(S=D[z],w=n[S]||{},R=w[d],!dn(R));z++)SC(e,d,S,_,A);if(!dn(R)||!kt(S))return r?Fy:d;let N=`${S}__${d}`;xy(v)||(N=`${N}__${JSON.stringify(v)}`);let H=u.get(N);return H||(H=new Intl.NumberFormat(S,Po({},R,v)),u.set(N,H)),M?H.formatToParts(f):H.format(f)}function TM(...e){const[t,n,r,o]=e;let i={},s={};if(!Oo(t))throw Xd(Jd.INVALID_ARGUMENT);const u=t;return kt(n)?i.key=n:dn(n)&&(i=n),kt(r)?i.locale=r:dn(r)&&(s=r),dn(o)&&(s=o),[i.key||"",u,i,s]}function ek(e,t,n){const r=e;for(const o in n){const i=`${t}__${o}`;r.__numberFormatters.has(i)&&r.__numberFormatters.delete(i)}}typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ah().__INTLIFY_PROD_DEVTOOLS__=!1);function aG(){return bO().__VUE_DEVTOOLS_GLOBAL_HOOK__}function bO(){return typeof navigator<"u"&&typeof window<"u"?window:typeof global<"u"?global:{}}const lG=typeof Proxy=="function",uG="devtools-plugin:setup",cG="plugin:settings:set";let Pd,wM;function dG(){var e;return Pd!==void 0||(typeof window<"u"&&window.performance?(Pd=!0,wM=window.performance):typeof global<"u"&&(!((e=global.perf_hooks)===null||e===void 0)&&e.performance)?(Pd=!0,wM=global.perf_hooks.performance):Pd=!1),Pd}function fG(){return dG()?wM.now():Date.now()}class pG{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const r={};if(t.settings)for(const s in t.settings){const u=t.settings[s];r[s]=u.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let i=Object.assign({},r);try{const s=localStorage.getItem(o),u=JSON.parse(s);Object.assign(i,u)}catch{}this.fallbacks={getSettings(){return i},setSettings(s){try{localStorage.setItem(o,JSON.stringify(s))}catch{}i=s},now(){return fG()}},n&&n.on(cG,(s,u)=>{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 hG(e,t){const n=e,r=bO(),o=aG(),i=lG&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))o.emit(uG,e,t);else{const s=i?new pG(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 gG="9.2.0-beta.32";function mG(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ah().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ah().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ah().__INTLIFY_PROD_DEVTOOLS__=!1)}let MO=Qn.__EXTEND_POINT__;const Fi=()=>++MO,Mo={UNEXPECTED_RETURN_TYPE:MO,INVALID_ARGUMENT:Fi(),MUST_BE_CALL_SETUP_TOP:Fi(),NOT_INSLALLED:Fi(),NOT_AVAILABLE_IN_LEGACY_MODE:Fi(),REQUIRED_VALUE:Fi(),INVALID_VALUE:Fi(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Fi(),NOT_INSLALLED_WITH_PROVIDE:Fi(),UNEXPECTED_ERROR:Fi(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Fi(),BRIDGE_SUPPORT_VUE_2_ONLY:Fi(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Fi(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Fi(),__EXTEND_POINT__:Fi()};function xo(e,...t){return Uy(e,null,void 0)}const SM=wu("__transrateVNode"),kM=wu("__datetimeParts"),DM=wu("__numberParts"),IO=wu("__setPluralRules");wu("__intlifyMeta");const CO=wu("__injectWithOption");function EM(e){if(!jr(e))return e;for(const t in e)if(CC(e,t))if(!t.includes("."))jr(e[t])&&EM(e[t]);else{const n=t.split("."),r=n.length-1;let o=e;for(let i=0;i<r;i++)n[i]in o||(o[n[i]]={}),o=o[n[i]];o[n[r]]=e[t],delete e[t],jr(o[n[r]])&&EM(o[n[r]])}return e}function Gy(e,t){const{messages:n,__i18n:r,messageResolver:o,flatJson:i}=t,s=dn(n)?n:Ar(r)?{}:{[e]:{}};if(Ar(r)&&r.forEach(u=>{if("locale"in u&&"resource"in u){const{locale:d,resource:f}=u;d?(s[d]=s[d]||{},lh(f,s[d])):lh(f,s)}else kt(u)&&lh(JSON.parse(u),s)}),o==null&&i)for(const u in s)CC(s,u)&&EM(s[u]);return s}const ym=e=>!jr(e)||Ar(e);function lh(e,t){if(ym(e)||ym(t))throw xo(Mo.INVALID_VALUE);for(const n in e)CC(e,n)&&(ym(e[n])||ym(t[n])?t[n]=e[n]:lh(e[n],t[n]))}function TO(e){return e.type}function wO(e,t,n){let r=jr(t.messages)?t.messages:{};"__i18nGlobal"in n&&(r=Gy(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,r[i])});{if(jr(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(s=>{e.mergeDateTimeFormat(s,t.datetimeFormats[s])})}if(jr(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(s=>{e.mergeNumberFormat(s,t.numberFormats[s])})}}}function tk(e){return Ct(qf,null,e,0)}const nk="__INTLIFY_META__";let rk=0;function ok(e){return(t,n,r,o)=>e(n,r,Yi()||void 0,o)}const vG=()=>{const e=Yi();let t=null;return e&&(t=TO(e)[nk])?{[nk]:t}:null};function kC(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(Gy(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)||_u(e.missingWarn)?e.missingWarn:!0,v=n?n.fallbackWarn:Wn(e.fallbackWarn)||_u(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)?ok(e.missing):null,w=Xr(e.postTranslation)?e.postTranslation:null,S=n?n.warnHtmlMessage:Wn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,R=!!e.escapeParameter;const A=n?n.modifiers:dn(e.modifiers)?e.modifiers:{};let N=e.pluralRules||n&&n.pluralRules,H;function z(){r&&jS(null);const V={version:gG,locale:i.value,fallbackLocale:s.value,messages:u.value,modifiers:A,pluralRules:N,missing:D===null?void 0:D,missingWarn:g,fallbackWarn:v,fallbackFormat:M,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:S,escapeParameter:R,messageResolver:e.messageResolver,__meta:{framework:"vue"}};V.datetimeFormats=d.value,V.numberFormats=f.value,V.__datetimeFormatters=dn(H)?H.__datetimeFormatters:void 0,V.__numberFormatters=dn(H)?H.__numberFormatters:void 0;const ne=eG(V);return r&&jS(ne),ne}H=z(),xp(H,i.value,s.value);function x(){return[i.value,s.value,u.value,d.value,f.value]}const B=Ve({get:()=>i.value,set:V=>{i.value=V,H.locale=i.value}}),j=Ve({get:()=>s.value,set:V=>{s.value=V,H.fallbackLocale=s.value,xp(H,i.value,V)}}),G=Ve(()=>u.value),L=Ve(()=>d.value),T=Ve(()=>f.value);function P(){return Xr(w)?w:null}function Q(V){w=V,H.postTranslation=V}function Y(){return C}function oe(V){V!==null&&(D=ok(V)),C=V,H.missing=D}function X(V,ne,ye,Be,je,lt){x();let Fe;if(__INTLIFY_PROD_DEVTOOLS__)try{zS(vG()),r||(H.fallbackContext=n?QF():void 0),Fe=V(H)}finally{zS(null),r||(H.fallbackContext=void 0)}else Fe=V(H);if(Oo(Fe)&&Fe===Fy){const[st,wt]=ne();return n&&_?Be(n):je(st)}else{if(lt(Fe))return Fe;throw xo(Mo.UNEXPECTED_RETURN_TYPE)}}function ae(...V){return X(ne=>Reflect.apply(JS,null,[ne,...V]),()=>IM(...V),"translate",ne=>Reflect.apply(ne.t,ne,[...V]),ne=>ne,ne=>kt(ne))}function fe(...V){const[ne,ye,Be]=V;if(Be&&!jr(Be))throw xo(Mo.INVALID_ARGUMENT);return ae(ne,ye,Po({resolvedMessage:!0},Be||{}))}function le(...V){return X(ne=>Reflect.apply(XS,null,[ne,...V]),()=>CM(...V),"datetime format",ne=>Reflect.apply(ne.d,ne,[...V]),()=>VS,ne=>kt(ne))}function ce(...V){return X(ne=>Reflect.apply(QS,null,[ne,...V]),()=>TM(...V),"number format",ne=>Reflect.apply(ne.n,ne,[...V]),()=>VS,ne=>kt(ne))}function J(V){return V.map(ne=>kt(ne)?tk(ne):ne)}const de={normalize:J,interpolate:V=>V,type:"vnode"};function Oe(...V){return X(ne=>{let ye;const Be=ne;try{Be.processor=de,ye=Reflect.apply(JS,null,[Be,...V])}finally{Be.processor=null}return ye},()=>IM(...V),"translate",ne=>ne[SM](...V),ne=>[tk(ne)],ne=>Ar(ne))}function ve(...V){return X(ne=>Reflect.apply(QS,null,[ne,...V]),()=>TM(...V),"number format",ne=>ne[DM](...V),()=>[],ne=>kt(ne)||Ar(ne))}function Me(...V){return X(ne=>Reflect.apply(XS,null,[ne,...V]),()=>CM(...V),"datetime format",ne=>ne[kM](...V),()=>[],ne=>kt(ne)||Ar(ne))}function K(V){N=V,H.pluralRules=N}function me(V,ne){const ye=kt(ne)?ne:i.value,Be=W(ye);return H.messageResolver(Be,V)!==null}function ke(V){let ne=null;const ye=dO(H,s.value,i.value);for(let Be=0;Be<ye.length;Be++){const je=u.value[ye[Be]]||{},lt=H.messageResolver(je,V);if(lt!=null){ne=lt;break}}return ne}function pe(V){const ne=ke(V);return ne??(n?n.tm(V)||{}:{})}function W(V){return u.value[V]||{}}function te(V,ne){u.value[V]=ne,H.messages=u.value}function ie(V,ne){u.value[V]=u.value[V]||{},lh(ne,u.value[V]),H.messages=u.value}function Ie(V){return d.value[V]||{}}function ue(V,ne){d.value[V]=ne,H.datetimeFormats=d.value,ZS(H,V,ne)}function Se(V,ne){d.value[V]=Po(d.value[V]||{},ne),H.datetimeFormats=d.value,ZS(H,V,ne)}function Pe(V){return f.value[V]||{}}function xe(V,ne){f.value[V]=ne,H.numberFormats=f.value,ek(H,V,ne)}function He(V,ne){f.value[V]=Po(f.value[V]||{},ne),H.numberFormats=f.value,ek(H,V,ne)}rk++,n&&Y7&&($t(n.locale,V=>{o&&(i.value=V,H.locale=V,xp(H,i.value,s.value))}),$t(n.fallbackLocale,V=>{o&&(s.value=V,H.fallbackLocale=V,xp(H,i.value,s.value))}));const Te={id:rk,locale:B,fallbackLocale:j,get inheritLocale(){return o},set inheritLocale(V){o=V,V&&n&&(i.value=n.locale.value,s.value=n.fallbackLocale.value,xp(H,i.value,s.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:G,get modifiers(){return A},get pluralRules(){return N||{}},get isGlobal(){return r},get missingWarn(){return g},set missingWarn(V){g=V,H.missingWarn=g},get fallbackWarn(){return v},set fallbackWarn(V){v=V,H.fallbackWarn=v},get fallbackRoot(){return _},set fallbackRoot(V){_=V},get fallbackFormat(){return M},set fallbackFormat(V){M=V,H.fallbackFormat=M},get warnHtmlMessage(){return S},set warnHtmlMessage(V){S=V,H.warnHtmlMessage=V},get escapeParameter(){return R},set escapeParameter(V){R=V,H.escapeParameter=V},t:ae,getLocaleMessage:W,setLocaleMessage:te,mergeLocaleMessage:ie,getPostTranslationHandler:P,setPostTranslationHandler:Q,getMissingHandler:Y,setMissingHandler:oe,[IO]:K};return Te.datetimeFormats=L,Te.numberFormats=T,Te.rt=fe,Te.te=me,Te.tm=pe,Te.d=le,Te.n=ce,Te.getDateTimeFormat=Ie,Te.setDateTimeFormat=ue,Te.mergeDateTimeFormat=Se,Te.getNumberFormat=Pe,Te.setNumberFormat=xe,Te.mergeNumberFormat=He,Te[CO]=e.__injectWithOption,Te[SM]=Oe,Te[kM]=Me,Te[DM]=ve,Te}function yG(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)||_u(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Wn(e.silentFallbackWarn)||_u(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 H=e.sharedMessages;C=Object.keys(H).reduce((x,B)=>{const j=x[B]||(x[B]={});return Po(j,H[B]),x},C||{})}const{__i18n:D,__root:w,__injectWithOption:S}=e,R=e.datetimeFormats,A=e.numberFormats,N=e.flatJson;return{locale:t,fallbackLocale:n,messages:C,flatJson:N,datetimeFormats:R,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 AM(e={},t){{const n=kC(yG(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 xo(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 xo(Mo.INVALID_ARGUMENT);const v=i;return kt(s)?d.locale=s:Oo(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 DC={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function _G({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 SO(e){return dt}const ik={name:"i18n-t",props:Po({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Oo(e)||!isNaN(e)}},DC),setup(e,t){const{slots:n,attrs:r}=t,o=e.i18n||$y({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=_G(t,i),d=o[SM](e.keypath,u,s),f=Po({},r),g=kt(e.tag)||jr(e.tag)?e.tag:SO();return Re(g,f,d)}}};function kO(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:jr(e.format)&&(kt(e.format.key)&&(s.key=e.format.key),u=Object.keys(e.format).reduce((_,M)=>n.includes(M)?Po({},_,{[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=Po({},i),v=kt(e.tag)||jr(e.tag)?e.tag:SO();return Re(v,g,f)}}const bG=["localeMatcher","style","unit","unitDisplay","currency","currencyDisplay","useGrouping","numberingSystem","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","notation","formatMatcher"],sk={name:"i18n-n",props:Po({value:{type:Number,required:!0},format:{type:[String,Object]}},DC),setup(e,t){const n=e.i18n||$y({useScope:"parent",__useComponent:!0});return kO(e,t,bG,(...r)=>n[DM](...r))}},MG=["dateStyle","timeStyle","fractionalSecondDigits","calendar","dayPeriod","numberingSystem","localeMatcher","timeZone","hour12","hourCycle","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"],ak={name:"i18n-d",props:Po({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},DC),setup(e,t){const n=e.i18n||$y({useScope:"parent",__useComponent:!0});return kO(e,t,MG,(...r)=>n[kM](...r))}};function IG(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 CG(e){const t=(n,{instance:r,value:o,modifiers:i})=>{if(!r||!r.$)throw xo(Mo.UNEXPECTED_ERROR);const s=IG(e,r.$),u=TG(o);n.textContent=Reflect.apply(s.t,s,[...wG(u)])};return{beforeMount:t,beforeUpdate:t}}function TG(e){if(kt(e))return{path:e};if(dn(e)){if(!("path"in e))throw xo(Mo.REQUIRED_VALUE,"path");return e}else throw xo(Mo.INVALID_VALUE)}function wG(e){const{path:t,locale:n,args:r,choice:o,plural:i}=e,s={},u=r||{};return kt(n)&&(s.locale=n),Oo(o)&&(s.plural=o),Oo(i)&&(s.plural=i),[t,u,s]}function SG(e,t,...n){const r=dn(n[0])?n[0]:{},o=!!r.useI18nComponentName;(Wn(r.globalInstall)?r.globalInstall:!0)&&(e.component(o?"i18n":ik.name,ik),e.component(sk.name,sk),e.component(ak.name,ak)),e.directive("t",CG(t))}function kG(e,t,n){return{beforeCreate(){const r=Yi();if(!r)throw xo(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=lk(e,i):(i.__injectWithOption=!0,this.$i18n=AM(i))}else o.__i18n?this===this.$root?this.$i18n=lk(e,o):this.$i18n=AM({__i18n:o.__i18n,__injectWithOption:!0,__root:t}):this.$i18n=e;o.__i18nGlobal&&wO(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=Yi();if(!r)throw xo(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 lk(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[IO](t.pluralizationRules||e.pluralizationRules);const n=Gy(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 DG=wu("global-vue-i18n");function EG(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=AG(e,n),u=wu("");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&&GG(_,v.global),__VUE_I18N_FULL_INSTALL__&&SG(_,v,...M),__VUE_I18N_LEGACY_API__&&n&&_.mixin(kG(s,s.__composer,v))},get global(){return s},__instances:i,__getInstance:d,__setInstance:f,__deleteInstance:g};return v}}function $y(e={}){const t=Yi();if(t==null)throw xo(Mo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw xo(Mo.NOT_INSLALLED);const n=LG(t),r=RG(n),o=TO(t),i=OG(e,o);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw xo(Mo.NOT_AVAILABLE_IN_LEGACY_MODE);return xG(t,i,r,e)}if(i==="global")return wO(r,e,o),r;if(i==="parent"){let d=NG(n,t,e.__useComponent);return d==null&&(d=r),d}const s=n;let u=s.__getInstance(t);if(u==null){const d=Po({},e);"__i18n"in o&&(d.__i18n=o.__i18n),r&&(d.__root=r),u=kC(d),PG(s,t),s.__setInstance(t,u)}return u}function AG(e,t,n){return __VUE_I18N_LEGACY_API__&&t?AM(e):kC(e)}function LG(e){{const t=tn(e.isCE?DG:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw xo(e.isCE?Mo.NOT_INSLALLED_WITH_PROVIDE:Mo.UNEXPECTED_ERROR);return t}}function OG(e,t){return xy(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function RG(e){return e.mode==="composition"?e.global:e.global.__composer}function NG(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[CO]&&(r=null))}if(r!=null||o===i)break;i=i.parent}return r}function PG(e,t,n){On(()=>{},t),hl(()=>{e.__deleteInstance(t)},t)}function xG(e,t,n,r={}){const o=t==="local",i=bL(null);if(o&&e.proxy&&!e.proxy.$options.i18n)throw xo(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(Gy(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)||_u(r.missingWarn)?r.missingWarn:!0,M=o?n.fallbackWarn:Wn(r.fallbackWarn)||_u(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,R=o?n.warnHtmlMessage:Wn(r.warnHtmlMessage)?r.warnHtmlMessage:!0,A=!!r.escapeParameter,N=o?n.modifiers:dn(r.modifiers)?r.modifiers:{},H=r.pluralRules||o&&n.pluralRules;function z(){return[u.value,d.value,f.value,g.value,v.value]}const x=Ve({get:()=>i.value?i.value.locale.value:u.value,set:ie=>{i.value&&(i.value.locale.value=ie),u.value=ie}}),B=Ve({get:()=>i.value?i.value.fallbackLocale.value:d.value,set:ie=>{i.value&&(i.value.fallbackLocale.value=ie),d.value=ie}}),j=Ve(()=>i.value?i.value.messages.value:f.value),G=Ve(()=>g.value),L=Ve(()=>v.value);function T(){return i.value?i.value.getPostTranslationHandler():S}function P(ie){i.value&&i.value.setPostTranslationHandler(ie)}function Q(){return i.value?i.value.getMissingHandler():w}function Y(ie){i.value&&i.value.setMissingHandler(ie)}function oe(ie){return z(),ie()}function X(...ie){return i.value?oe(()=>Reflect.apply(i.value.t,null,[...ie])):oe(()=>"")}function ae(...ie){return i.value?Reflect.apply(i.value.rt,null,[...ie]):""}function fe(...ie){return i.value?oe(()=>Reflect.apply(i.value.d,null,[...ie])):oe(()=>"")}function le(...ie){return i.value?oe(()=>Reflect.apply(i.value.n,null,[...ie])):oe(()=>"")}function ce(ie){return i.value?i.value.tm(ie):{}}function J(ie,Ie){return i.value?i.value.te(ie,Ie):!1}function re(ie){return i.value?i.value.getLocaleMessage(ie):{}}function de(ie,Ie){i.value&&(i.value.setLocaleMessage(ie,Ie),f.value[ie]=Ie)}function Oe(ie,Ie){i.value&&i.value.mergeLocaleMessage(ie,Ie)}function ve(ie){return i.value?i.value.getDateTimeFormat(ie):{}}function Me(ie,Ie){i.value&&(i.value.setDateTimeFormat(ie,Ie),g.value[ie]=Ie)}function K(ie,Ie){i.value&&i.value.mergeDateTimeFormat(ie,Ie)}function me(ie){return i.value?i.value.getNumberFormat(ie):{}}function ke(ie,Ie){i.value&&(i.value.setNumberFormat(ie,Ie),v.value[ie]=Ie)}function pe(ie,Ie){i.value&&i.value.mergeNumberFormat(ie,Ie)}const W={get id(){return i.value?i.value.id:-1},locale:x,fallbackLocale:B,messages:j,datetimeFormats:G,numberFormats:L,get inheritLocale(){return i.value?i.value.inheritLocale:s},set inheritLocale(ie){i.value&&(i.value.inheritLocale=ie)},get availableLocales(){return i.value?i.value.availableLocales:Object.keys(f.value)},get modifiers(){return i.value?i.value.modifiers:N},get pluralRules(){return i.value?i.value.pluralRules:H},get isGlobal(){return i.value?i.value.isGlobal:!1},get missingWarn(){return i.value?i.value.missingWarn:_},set missingWarn(ie){i.value&&(i.value.missingWarn=ie)},get fallbackWarn(){return i.value?i.value.fallbackWarn:M},set fallbackWarn(ie){i.value&&(i.value.missingWarn=ie)},get fallbackRoot(){return i.value?i.value.fallbackRoot:C},set fallbackRoot(ie){i.value&&(i.value.fallbackRoot=ie)},get fallbackFormat(){return i.value?i.value.fallbackFormat:D},set fallbackFormat(ie){i.value&&(i.value.fallbackFormat=ie)},get warnHtmlMessage(){return i.value?i.value.warnHtmlMessage:R},set warnHtmlMessage(ie){i.value&&(i.value.warnHtmlMessage=ie)},get escapeParameter(){return i.value?i.value.escapeParameter:A},set escapeParameter(ie){i.value&&(i.value.escapeParameter=ie)},t:X,getPostTranslationHandler:T,setPostTranslationHandler:P,getMissingHandler:Q,setMissingHandler:Y,rt:ae,d:fe,n:le,tm:ce,te:J,getLocaleMessage:re,setLocaleMessage:de,mergeLocaleMessage:Oe,getDateTimeFormat:ve,setDateTimeFormat:Me,mergeDateTimeFormat:K,getNumberFormat:me,setNumberFormat:ke,mergeNumberFormat:pe};function te(ie){ie.locale.value=u.value,ie.fallbackLocale.value=d.value,Object.keys(f.value).forEach(Ie=>{ie.mergeLocaleMessage(Ie,f.value[Ie])}),Object.keys(g.value).forEach(Ie=>{ie.mergeDateTimeFormat(Ie,g.value[Ie])}),Object.keys(v.value).forEach(Ie=>{ie.mergeNumberFormat(Ie,v.value[Ie])}),ie.escapeParameter=A,ie.fallbackFormat=D,ie.fallbackRoot=C,ie.fallbackWarn=M,ie.missingWarn=_,ie.warnHtmlMessage=R}return Hf(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw xo(Mo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const ie=i.value=e.proxy.$i18n.__composer;t==="global"?(u.value=ie.locale.value,d.value=ie.fallbackLocale.value,f.value=ie.messages.value,g.value=ie.datetimeFormats.value,v.value=ie.numberFormats.value):o&&te(ie)}),W}const UG=["locale","fallbackLocale","availableLocales"],FG=["t","rt","d","n","tm"];function GG(e,t){const n=Object.create(null);UG.forEach(r=>{const o=Object.getOwnPropertyDescriptor(t,r);if(!o)throw xo(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,FG.forEach(r=>{const o=Object.getOwnPropertyDescriptor(t,r);if(!o||!o.value)throw xo(Mo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${r}`,o)})}YF(nG);JF(LF);XF(dO);mG();if(__INTLIFY_PROD_DEVTOOLS__){const e=ah();e.__INTLIFY__=!0,$F(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const $G={群公告:"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"},BG={撤回:"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:$G},HG={发起单聊:"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"},qG={输入groupID搜索:"Enter groupId search",群名称:"Group name",群ID:"Group ID",加入群聊:"Join",解散群聊:"Dissolution",退出群聊:"Quit",群类型:"Group type",请填写验证信息:"Please fill in the verification information",申请加入:"Apply Join",已申请:"Applied"},VG={资料设置:"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"},zG={群聊通知:"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"},jG={发起会话:"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"},WG={群成员:"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"},KG={自定义消息:"Custom message",通话时长:"Call duration",结束群聊:"End",切换语音通话:"Switch voice call",切换视频通话:"Switch video call",发起通话:"Start a call",取消通话:"Cancel",已接听:"Answered",拒绝通话:"Decline",无应答:"No answer",对本次服务评价:"Rate this service","查看详情>>":"View details >>"},YG={tip:WG,custom:KG},JG={取消:"Cancel",完成:"Done",已选中:"Selected",人:"",保存:"Save",请输入userID:"Enter a user ID",确定:"submit",全选:"All",已在群聊中:"exists"},XG={周:"week(s) ",天:"day(s)",小时:"hour(s) ",分钟:"minute(s)",刚刚:"Just now",前:" ago",昨天:"Yesterday",星期一:"Monday",星期二:"Tuesday",星期三:"Wednesday",星期四:"Thursday",星期五:"Friday",星期六:"Saturday",星期日:"Sunday"},ZG={请对本次服务进行评价:"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."},QG={请对本次服务进行评价:"Please rate this service",提交评价:"Feedback",服务评价工具:"Service rate tool",使用:"Build with",自定义消息:"Custom message",搭建:"",星:"Star"},e$={en:{取消:"Cancel",发送:"Send",系统通知:"System notification",关闭:"Close",确定:"Save",TUIChat:BG,TUIConversation:HG,TUIGroup:qG,TUIProfile:VG,TUIContact:zG,message:YG,component:JG,time:XG,Evaluate:QG,Words:ZG,TUISearch:jG}},t$={群公告:"群公告",群成员:"群成员",群管理:"群管理",好友工作群:"好友工作群",陌生人社交群:"陌生人社交群",临时会议群:"临时会议群",直播群:"直播群",自由加入:"自由加入",需要验证:"需要验证",禁止加群:"禁止加群",人:"人",群ID:"群ID",群头像:"群头像",群类型:"群类型",加群方式:"加群方式",转让群组:"转让群组",解散群聊:"解散群聊",退出群组:"退出群组",群管理员:"群管理员",学生禁言:"学生禁言","学生禁言开启后,只允许群主和管理员发言。":"学生禁言开启后,只允许群主和管理员发言。",单独禁言人员:"单独禁言人员",删除成员:"删除成员","确定从群聊中删除该成员?":"确定从群聊中删除该成员?","确定从群聊中删除所选成员?":"确定从群聊中删除所选成员?",暂无公告:"暂无公告",发布:"发布",编辑:"编辑",群名称:"群名称",查看更多:"查看更多",管理员:"管理员",群主:"群主",我:"我",添加成员:"添加成员",新增管理员:"新增管理员",移除管理员:"移除管理员",新增禁言用户:"新增禁言用户",移除禁言用户:"移除禁言用户",修改群聊名称:"修改群聊名称","修改群聊名称后,将在群内通知其他成员":"修改群聊名称后,将在群内通知其他成员","仅限中文、字母、数字和下划线,2-20个字":"仅限中文、字母、数字和下划线,2-20个字","请先注册 TUIGroup 模块":"请先注册 TUIGroup 模块",该用户不存在:"该用户不存在",该用户不在群组内:"该用户不在群组内"},n$={撤回:"撤回",删除:"删除",复制:"复制",重新发送:"重新发送",转发:"转发",引用:"引用",回复:"回复",回复详情:"回复详情",条回复:"条回复",打开:"打开",已读:"已读",未读:"未读",人已读:"人已读",人未读:"人未读",人关闭阅读状态:"人关闭阅读状态",全部已读:"全部已读",消息详情:"消息详情",关闭阅读状态:"关闭",您:"您",撤回了一条消息:"撤回了一条消息",重新编辑:"重新编辑",我:"我",自定义消息:"自定义消息",查看更多:"查看更多","确认重发该消息?":"确认重发该消息?",取消:"取消",确定:"确定",转发给:"转发给",请输入消息:"请输入消息,按Ctrl + ↵ 换行",描述:"描述",经度:"经度",纬度:"纬度",图片:"[图片]",语音:"[语音]",视频:"[视频]",表情:"[表情]",文件:"[文件]",自定义:"[自定义消息]",管理员开启学生禁言:"管理员开启学生禁言",您已被管理员禁言:"您已被管理员禁言","按Enter发送,Ctrl+Enter换行":"按Enter发送,Ctrl+Enter换行",单击下载:"单击下载",该消息不存在:"该消息不存在",无法定位到原消息:"无法定位到原消息",对方正在输入:"对方正在输入...",回到最新位置:"回到最新位置",条新消息:"条新消息",安全提示:"【安全提示】本 APP 仅用于体验腾讯云即时通信 IM 产品功能,不可用于业务洽谈与拓展。请勿轻信汇款、中奖等涉及钱款的信息,勿轻易拨打陌生电话,谨防上当受骗。",点此投诉:"点此投诉",语音通话:"语音通话",视频通话:"视频通话",发起群语音:"发起群语音",发起群视频:"发起群视频",已接听:"已接听",拒绝通话:"拒绝通话",无应答:"无应答",取消通话:"取消通话",发起通话:"发起通话",结束群聊:"结束群聊",通话时长:"通话时长",欢迎使用TUICallKit:"欢迎使用腾讯云音视频通话组件TUICallKit ","检测到您暂未集成TUICallKit,无法体验音视频通话功能":"检测到您暂未集成TUICallKit,无法体验音视频通话功能。",请点击:"请点击",集成TUICallKit:"集成 TUICallKit ",开通腾讯实时音视频服务:"开通腾讯实时音视频服务",进行体验:"进行体验。",您当前购买使用的套餐包暂未开通群消息已读回执功能:"您当前购买使用的套餐包暂未开通【群消息已读回执】功能,请升级至旗舰版进行体验",您当前购买使用的套餐包暂未开通在线用户列表功能:"您当前购买使用的套餐包暂未开通【在线用户列表】功能,请升级至旗舰版进行体验",您当前购买使用的套餐包暂未开通此功能:"您当前购买使用的套餐包暂未开通此功能。",选择提醒的人:"选择提醒的人",manage:t$},r$={发起单聊:"发起单聊",发起群聊:"发起群聊",请输入userID:"请输入userID",删除会话:"删除会话",置顶会话:"置顶会话",取消置顶:"取消置顶",消息免打扰:"消息免打扰",取消免打扰:"取消免打扰",系统通知:"系统通知","有人@我":"有人{'@'}我","@所有人":"{'@'}所有人",条:"条",我:"我","网络异常,请您检查网络设置":"网络异常,请您检查网络设置"},o$={输入groupID搜索:"输入groupID搜索",群名称:"群名称",群ID:"群ID",加入群聊:"加入群聊",解散群聊:"解散群聊",退出群聊:"退出群聊",群类型:"群类型",请填写验证信息:"请填写验证信息",申请加入:"申请加入",已申请:"已申请"},i$={资料设置:"资料设置",头像:"头像",昵称:"昵称",账号:"账号",个性签名:"个性签名",性别:"性别",男:"男",女:"女",不显示:"不显示",出生年月:"出生年月",取消:"取消",保存:"保存",请选择出生日期:"请选择出生日期",选择头像:"选择头像",设置昵称:"设置昵称","仅限中文、字母、数字和下划线,2-20个字":"仅限中文、字母、数字和下划线,2-20个字",请输入昵称:"请输入昵称",性别选择:"性别选择",请输入内容:"请输入内容",用户ID:"用户ID",暂未设置:"暂未设置"},s$={群聊通知:"群聊通知",系统通知:"系统通知",我的群聊:"我的群聊","输入群ID,按回车搜索":"输入群ID,按回车搜索",群名称:"群名称",群ID:"群ID",加入群聊:"加入群聊",解散群聊:"解散群聊",退出群聊:"退出群聊",进入群聊:"进入群聊",群类型:"群类型",请填写验证信息:"请填写验证信息",申请加入:"申请加入",已申请:"已申请",接受:"接受",拒绝:"拒绝",已处理:"已处理",添加群聊:"添加群聊",已加入:"已加入",该群组不存在:"该群组不存在",加群:"加群",我的好友:"我的好友",发送消息:"发送消息",个性签名:"个性签名"},a$={发起会话:"发起会话",发起单聊:"发起单聊",发起群聊:"发起群聊",该用户不存在:"该用户不存在","创建群聊,请注册 TUIGroup 模块":"创建群聊,请注册 TUIGroup 模块",创建成功:"创建成功","发起多人会话(群聊)":"发起多人会话(群聊)",群头像:"群头像",群名称:"群名称",群ID:"群ID",群类型:"群类型",选填:"选填",取消:"取消",创建:"创建","类似普通微信群,创建后仅支持已在群内的好友邀请加群,且无需被邀请方同意或群主神奇。详见":"类似普通微信群,创建后仅支持已在群内的好友邀请加群,且无需被邀请方同意或群主神奇。详见","类似 QQ 群,创建后群主可以指定群管理员,用户搜索群 ID 发起加群申请后,需要群主或管理员审批通过才能入群。详见":"类似 QQ 群,创建后群主可以指定群管理员,用户搜索群 ID 发起加群申请后,需要群主或管理员审批通过才能入群。详见","创建后可以随意进出,且支持查看入群前消息;适合用于音视频会议场景、在线教育场景等与实时音视频产品结合的场景。详见":"创建后可以随意进出,且支持查看入群前消息;适合用于音视频会议场景、在线教育场景等与实时音视频产品结合的场景。详见","创建后可以随意进出,没有群成员数量上限,但不支持历史消息存储;适合与直播产品结合,用于弹幕聊天场景。详见":"创建后可以随意进出,没有群成员数量上限,但不支持历史消息存储;适合与直播产品结合,用于弹幕聊天场景。详见",产品文档:"产品文档",设置群名称:"设置群名称",请输入群名称:"请输入群名称",设置群ID:"设置群ID",请输入群ID:"请输入群ID",选择群类型:"选择群类型"},l$={群成员:"群成员",加入群组:"加入群组",退出群组:"退出群组",被:"被",踢出群组:"移除出群组",成为管理员:"成为管理员",被撤销管理员:"被撤销管理员",被禁言:"被禁言",被取消禁言:"被取消禁言",群提示消息:"群提示消息",管理员:"管理员",开启学生禁言:"开启学生禁言",取消学生禁言:"取消学生禁言",成为新的群主:"成为新的群主",修改群名为:"修改群名为",发布新公告:"发布新公告",申请加入群组:"申请加入群组",成功加入群组:"成功加入群组",被拒绝:"被拒绝",你被管理员:"你被管理员",群:"群",解散:"解散",创建群:"创建群",邀请你加群:"邀请你加群",你退出群组:"你退出群组",你被:"你被",设置为群:"设置为群",的管理员:"的管理员",撤销群:"撤销群",的管理员身份:"的管理员身份",同意加群:"同意加群",拒接加群:"拒接加群",自定义群系统通知:"自定义群系统通知"},u$={自定义消息:"自定义消息",通话时长:"通话时长",结束群聊:"结束群聊",切换语音通话:"切换语音通话",切换视频通话:"切换视频通话",发起通话:"发起通话",取消通话:"取消通话",已接听:"已接听",拒绝通话:"拒绝通话",无应答:"无应答",对本次服务评价:"对本次服务评价","查看详情>>":"查看详情>>"},c$={tip:l$,custom:u$},d$={取消:"取消",完成:"完成",已选中:"已选中",人:"人",保存:"保存",请输入userID:"请输入userID",确定:"确定",全选:"全选",已在群聊中:"已在群聊中"},f$={周:"周",天:"天",小时:"小时",分钟:"分钟",刚刚:"刚刚",前:"前",昨天:"昨天",星期一:"星期一",星期二:"星期二",星期三:"星期三",星期四:"星期四",星期五:"星期五",星期六:"星期六",星期日:"星期日"},p$={"常用语-快捷回复工具":"常用语-快捷回复工具","在吗?在吗?在吗?重要的话说三遍。":"在吗?在吗?在吗?重要的话说三遍。","好久没聊天了,快来和我说说话~":"好久没聊天了,快来和我说说话~","好的,就这么说定了。":"好的,就这么说定了。","感恩的心,感谢有你。":"感恩的心,感谢有你。","糟糕!是心动的感觉!":"糟糕!是心动的感觉!","心疼地抱抱自己,我太难了!":"心疼地抱抱自己,我太难了!","没关系,别在意,事情过去就过去了。":"没关系,别在意,事情过去就过去了。","早上好,今天也是让人期待的一天呢!":"早上好,今天也是让人期待的一天呢!","熬夜有什么用,又没人陪你聊天,早点休息吧。":"熬夜有什么用,又没人陪你聊天,早点休息吧。"},h$={请对本次服务进行评价:"请对本次服务进行评价",提交评价:"提交评价",服务评价工具:"服务评价工具",使用:"使用",自定义消息:"自定义消息",搭建:"搭建",星:"星"},g$={zh_cn:{取消:"取消",发送:"发送",系统通知:"系统通知",关闭:"关闭",确定:"确定",TUIChat:n$,TUIConversation:r$,TUIGroup:o$,TUIProfile:i$,TUIContact:s$,message:c$,component:d$,time:f$,Evaluate:h$,Words:p$,TUISearch:a$}},m$={...e$,...g$},Ya=class Ya{constructor(t){Jt(this,"messages",{en:{},zh_cn:{}});Jt(this,"i18n");this.messages=t}static getInstance(){return Ya.instance||(Ya.instance=new Ya(m$)),Ya.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 $y()}static install(t){const n=Ya.getInstance();n.i18n=EG({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=Ya.getInstance()}};Jt(Ya,"instance");let LM=Ya;const jh=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}},v$=[{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)}}],y$=e=>{v$.map(t=>{e.directive(t.name,{beforeMount:t.callback})})};function _$(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 uh="https://web.sdk.qcloud.com/im/assets/emoji/",uf={"[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"},DO=["[龇牙]","[调皮]","[流汗]","[偷笑]","[再见]","[敲打]","[擦汗]","[猪头]","[玫瑰]","[流泪]","[大哭]","[嘘]","[酷]","[抓狂]","[委屈]","[便便]","[炸弹]","[菜刀]","[可爱]","[色]","[害羞]","[得意]","[吐]","[微笑]","[怒]","[尴尬]","[惊恐]","[冷汗]","[爱心]","[示爱]","[白眼]","[傲慢]","[难过]","[惊讶]","[疑问]","[困]","[么么哒]","[憨笑]","[爱情]","[衰]","[撇嘴]","[阴险]","[奋斗]","[发呆]","[右哼哼]","[抱抱]","[坏笑]","[飞吻]","[鄙视]","[晕]","[大兵]","[可怜]","[强]","[弱]","[握手]","[胜利]","[抱拳]","[凋谢]","[米饭]","[蛋糕]","[西瓜]","[啤酒]","[瓢虫]","[勾引]","[OK]","[爱你]","[咖啡]","[月亮]","[刀]","[发抖]","[差劲]","[拳头]","[心碎了]","[太阳]","[礼物]","[皮球]","[骷髅]","[挥手]","[闪电]","[饥饿]","[咒骂]","[折磨]","[抠鼻]","[鼓掌]","[糗大了]","[左哼哼]","[打哈欠]","[快哭了]","[吓]","[篮球]","[乒乓]","[NO]","[跳跳]","[怄火]","[转圈]","[磕头]","[回头]","[跳绳]","[激动]","[街舞]","[献吻]","[左太极]","[右太极]","[闭嘴]","[猫咪]","[红双喜]","[鞭炮]","[红灯笼]","[麻将]","[麦克风]","[礼品袋]","[信封]","[象棋]","[彩带]","[蜡烛]","[爆筋]","[棒棒糖]","[奶瓶]","[面条]","[香蕉]","[飞机]","[左车头]","[车厢]","[右车头]","[多云]","[下雨]","[钞票]","[熊猫]","[灯泡]","[风车]","[闹钟]","[雨伞]","[彩球]","[钻戒]","[沙发]","[纸巾]","[手枪]","[青蛙]"],b$="https://web.sdk.qcloud.com/im/assets/face-elem/",M$=[{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 EO(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);uf[i]?(t.push({name:"img",src:uh+uf[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 gi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function I$(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 AO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(gi,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<arguments.length;l++){var p=arguments[l]!=null?arguments[l]:{};l%2?n(Object(p),!0).forEach(function(a){d(k,a,p[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(p)):n(Object(p)).forEach(function(a){Object.defineProperty(k,a,Object.getOwnPropertyDescriptor(p,a))})}return k}function o(k){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l})(k)}function i(k,l){if(!(k instanceof l))throw new TypeError("Cannot call a class as a function")}function s(k,l){for(var p=0;p<l.length;p++){var a=l[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(k,a.key,a)}}function u(k,l,p){return l&&s(k.prototype,l),p&&s(k,p),Object.defineProperty(k,"prototype",{writable:!1}),k}function d(k,l,p){return l in k?Object.defineProperty(k,l,{value:p,enumerable:!0,configurable:!0,writable:!0}):k[l]=p,k}function f(k,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(l&&l.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),Object.defineProperty(k,"prototype",{writable:!1}),l&&v(k,l)}function g(k){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)})(k)}function v(k,l){return(v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p})(k,l)}function _(){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 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={},O=Object.keys(m);for(I=0;I<O.length;I++)b=O[I],y.indexOf(b)>=0||(E[b]=m[b]);return E}(k,l);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(k);for(a=0;a<h.length;a++)p=h[a],l.indexOf(p)>=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 R(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 H(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)||j()}function N(k){return function(l){if(Array.isArray(l))return B(l)}(k)||z(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 H(k){if(Array.isArray(k))return k}function z(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 B(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)?B(k,l):void 0}}function B(k,l){(l==null||l>k.length)&&(l=k.length);for(var p=0,a=new Array(l);p<l;p++)a[p]=k[p];return a}function j(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G(k,l){var p=typeof Symbol<"u"&&k[Symbol.iterator]||k["@@iterator"];if(!p){if(Array.isArray(k)||(p=x(k))||l&&k&&typeof k.length=="number"){p&&(k=p);var a=0,c=function(){};return{s:c,n:function(){return a>=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 L={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},Q=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}(),Y=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"}}},X={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},ae="1.7.3",fe=537048168,le="CHINA",ce="OVERSEA",J="SINGAPORE",re="KOREA",de="GERMANY",Oe="IND",ve="JPN",Me="USA",K={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]:le;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"}},me={SEARCH_MSG:new Y(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new Y(0,Math.pow(2,1)).toString(),AVCHATROOM_HISTORY_MSG:new Y(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new Y(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new Y(0,Math.pow(2,4)).toString(),AVCHATROOM_MBR_LIST:new Y(0,Math.pow(2,6)).toString(),USER_STATUS:new Y(0,Math.pow(2,7)).toString(),CONV_MARK:new Y(0,Math.pow(2,9)).toString(),CONV_GROUP:new Y(0,Math.pow(2,10)).toString(),AVCHATROOM_BAN_MBR:new Y(0,Math.pow(2,11)).toString(),MSG_EXT:new Y(0,Math.pow(2,13)).toString(),GRP_COUNTER:new Y(0,Math.pow(2,15)).toString()},ke="c2c_text_message",pe="c2c_custom_message",W="group_text_message",te="group_custom_message",ie="user_profile",Ie="sns",ue="group_profile",Se="group_member_profile";K.HOST.setCurrent(le);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,Te=typeof swan<"u"&&typeof swan.getSystemInfoSync=="function"&&!!swan.getSystemInfoSync().fontSizeSetting,V=typeof my<"u"&&typeof my.getSystemInfoSync=="function"&&!!my.getSystemInfoSync().fontSizeSetting,ne=typeof jd<"u"&&typeof jd.getSystemInfoSync=="function",ye=typeof uni<"u"&&typeof window>"u"&&typeof uni.requireNativePlugin=="function",Be=typeof uni<"u",je=Pe||xe||He||Te||V||ye||ne,lt=(typeof uni<"u"||typeof window<"u")&&!je,Fe=xe?qq:He?tt:Te?swan:V?my:Pe?wx:ye?uni:ne?jd:{},st=lt&&window&&window.navigator&&window.navigator.userAgent||"",wt=/(micromessenger|webbrowser)/i.test(st),mn=/AppleWebKit\/([\d.]+)/i.exec(st);mn&&parseFloat(mn.pop());var In,Cn,En=(In="WEB",wt?In="WEB":xe?In="QQ_MP":He?In="TT_MP":Te?In="BAIDU_MP":V?In="ALI_MP":Pe?In="WX_MP":ye&&(In="UNI_NATIVE_APP"),X[In]),vn=/iPad/i.test(st),Qe=/iPhone/i.test(st)&&!vn,yt=/iPod/i.test(st),Pt=Qe||vn||yt,ln=(Cn=st.match(/OS (\d+)_/i))&&Cn[1]?Cn[1]:null,en=/Android/i.test(st),Tn=function(){var k=st.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=st.match(/Chrome\/(\d+)/);k&&k[1]&&parseFloat(k[1])})();var qn=/MSIE/.test(st)||st.indexOf("Trident")>-1&&st.indexOf("rv:11.0")>-1,ze=function(){var k=/MSIE\s(\d+)\.\d/.exec(st),l=k&&parseFloat(k[1]);return!l&&/Trident\/7.0/i.test(st)&&/rv:11.0/.test(st)&&(l=11),l}();(function(){var k=st.match(/TBS\/(\d+)/i);k&&k[1]&&k[1]})();var St,_t,Ht=/Windows/i.test(st),Yt=/MAC OS X/i.test(st),yr=lt&&typeof Worker<"u"&&!qn,Cr=en||Pt,Zo=lt&&window.tencent_cloud_im_csig_flutter_for_web_25F_cy!==void 0;St=typeof console<"u"?console:typeof gi<"u"&&gi.console?gi.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]||(St[_t]=ho);var qt=St,wn=0,Mn=function(){return new Date().getTime()+wn},Pn=function(){wn=0},Kr=function(){return Math.floor(Mn()/1e3)},$r=0;function ro(){return Hu()?"%c Chat %c":"Chat"}function us(){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<a;p++)fs(k[p])?ap(k[p])?l+=Il(k[p]):l+=JSON.stringify(k[p]):l+=k[p],l+=" ";return l},_exec:function(k,l){Hu()?qt[k](ro(),"background:#0abf5b; padding:1px; border-radius:3px; color: #fff","background:transparent",us(),l):qt[k]("".concat(ro()," ").concat(us()," ").concat(l))},d:function(){if($r<=-1){var k=this.arguments2String(arguments);this._exec("debug",k)}},l:function(){if($r<=0){var k=this.arguments2String(arguments);this._exec("log",k)}},log:function(){if($r<=0){var k=this.arguments2String(arguments);this._exec("log",k)}},i:function(){if($r<=1){var k=this.arguments2String(arguments);this._exec("info",k)}},w:function(){if($r<=2){var k=this.arguments2String(arguments);this._exec("warn",k)}},e:function(){if($r<=3){var k=this.arguments2String(arguments);this._exec("error",k)}},setLevel:function(k){k<4&&this._exec("log","set level from "+$r+" to "+k),$r=k},getLevel:function(){return $r}},cs={JPG:1,JPEG:1,GIF:2,PNG:3,BMP:4,UNKNOWN:255},Gt={NICK:"Tag_Profile_IM_Nick",GENDER:"Tag_Profile_IM_Gender",BIRTHDAY:"Tag_Profile_IM_BirthDay",LOCATION:"Tag_Profile_IM_Location",SELFSIGNATURE:"Tag_Profile_IM_SelfSignature",ALLOWTYPE:"Tag_Profile_IM_AllowType",LANGUAGE:"Tag_Profile_IM_Language",AVATAR:"Tag_Profile_IM_Image",MESSAGESETTINGS:"Tag_Profile_IM_MsgSettings",ADMINFORBIDTYPE:"Tag_Profile_IM_AdminForbidType",LEVEL:"Tag_Profile_IM_Level",ROLE:"Tag_Profile_IM_Role"},_l="Tag_SNS_IM_Group",Qs="Tag_SNS_IM_Remark",bl="Tag_SNS_IM_AddSource",Ml="Tag_SNS_IM_AddWording",Ra="Tag_SNS_IM_AddTime",Qo={UNKNOWN:"Gender_Type_Unknown",FEMALE:"Gender_Type_Female",MALE:"Gender_Type_Male"},Na={NONE:"AdminForbid_Type_None",SEND_OUT:"AdminForbid_Type_SendOut"},ds={NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_ANY:"AllowType_Type_AllowAny",DENY_ANY:"AllowType_Type_DenyAny"},Xi="JoinedSuccess",vd="WaitAdminApproval",yd="@TGS#_",ea="@TOPIC#_",sp=["url"],_d=function(k){return Os(k)==="map"},Br=function(k){return Os(k)==="file"},un=function(k){return k!==null&&(typeof k=="number"&&!isNaN(k-0)||o(k)==="object"&&k.constructor===Number)},Et=function(k){return typeof k=="string"},Zi=function(k){return k!==null&&o(k)==="object"},yn=function(k){if(o(k)!=="object"||k===null)return!1;var l=Object.getPrototypeOf(k);if(l===null)return!0;for(var p=l;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return l===p},rt=function(k){return typeof Array.isArray=="function"?Array.isArray(k):Os(k)==="array"},Ge=function(k){return k===void 0},fs=function(k){return rt(k)||Zi(k)},Go=function(k){return typeof k=="function"},ap=function(k){return k instanceof Error},bd=function(k){return Os(k)==="filelist"},Os=function(k){return Object.prototype.toString.call(k).match(/^\[object (.*)\]$/)[1].toLowerCase()},Md=function(k){if(typeof k!="string")return!1;var l=k[0];return!/[^a-zA-Z0-9]/.test(l)};Date.now||(Date.now=function(){return new Date().getTime()});var Ni=function k(l,p,a,c){if(!fs(l)||!fs(p))return 0;for(var h,m=0,y=Object.keys(p),b=0,I=y.length;b<I;b++)if(h=y[b],!(Ge(p[h])||a&&a.includes(h)))if(fs(l[h])&&fs(p[h]))m+=k(l[h],p[h],a,c);else{if(c&&c.includes(p[h]))continue;l[h]!==p[h]&&(l[h]=p[h],m+=1)}return m},Il=function(k){return JSON.stringify(k,["message","code"])},Cl=function(k){if(k.length===0)return 0;for(var l=0,p=0,a=typeof document<"u"&&document.characterSet!==void 0?document.characterSet:"UTF-8";k[l]!==void 0;)p+=k[l++].charCodeAt[l]<=255?1:a===!1?3:2;return p},ei=function(k){var l=k||99999999;return Math.round(Math.random()*l)},Id="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",lp=Id.length,ta=function(k,l){for(var p in k)if(k[p]===l)return!0;return!1},Tl={},wl=function(k){return k.indexOf("http://")===-1||k.indexOf("https://")===-1?"https://"+k:k.replace(/https|http/,"https")},Cd=function k(l){if(Object.getOwnPropertyNames(l).length===0)return Object.create(null);var p=Array.isArray(l)?[]:Object.create(null),a="";for(var c in l)l[c]!==null?l[c]!==void 0?(a=o(l[c]),["string","number","function","boolean"].indexOf(a)>=0?p[c]=l[c]:p[c]=k(l[c])):p[c]=void 0:p[c]=null;return p};function xu(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 $o=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(yd)&&!"".concat(p).includes(ea)},oo=function(k){return"".concat(k).startsWith(yd)&&"".concat(k).includes(ea)},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},Td=function(k){return Et(k)&&k===T.CONV_SYSTEM};function Uu(k,l){var p={};return Object.keys(k).forEach(function(a){p[a]=l(k[a],a)}),p}function Fu(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 Pa(){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 Rs(){var k="unknown";if(Yt&&(k="mac"),Ht&&(k="windows"),Pt&&(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.length<p;)k.push("0");for(;l.length<p;)l.push("0");for(var a=0;a<p;a++){var c=parseInt(k[a]),h=parseInt(l[a]);if(c>h)return 1;if(c<h)return-1}return 0}function wd(k){var l=k.originUrl,p=l===void 0?void 0:l,a=k.originWidth,c=k.originHeight,h=k.min,m=h===void 0?198:h,y=parseInt(a),b=parseInt(c),I={url:void 0,width:0,height:0};if((y<=b?y:b)<=m)I.url=p,I.width=y,I.height=b;else{b<=y?(I.width=Math.ceil(y*m/b),I.height=m):(I.width=m,I.height=Math.ceil(b*m/y));var E=p&&p.indexOf("?")>-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,sp)):I}function Gu(k){var l=k[2];k[2]=k[1],k[1]=l;for(var p=0;p<k.length;p++)k[p].setType(p)}function up(k){var l=k.servcmd;return l.slice(l.indexOf(".")+1)}function Qi(k,l){return Math.round(Number(k)*Math.pow(10,l))/Math.pow(10,l)}function Eg(k,l){return k.includes(l)}function cp(k,l){return k.includes(l)}function Lr(k){return k.split(ea)[0]}var $u=function(k,l,p){if(Ge(l))return"";switch(k){case T.MSG_TEXT:return l.text;case T.MSG_IMAGE:return p?"[Image]":"[图片]";case T.MSG_LOCATION:return p?"[Location]":"[位置]";case T.MSG_AUDIO:return p?"[Voice]":"[语音]";case T.MSG_VIDEO:return p?"[Video]":"[视频]";case T.MSG_FILE:return p?"[File]":"[文件]";case T.MSG_CUSTOM:return p?"[Custom Messages]":"[自定义消息]";case T.MSG_GRP_TIP:return p?"[Group Notification]":"[群提示消息]";case T.MSG_GRP_SYS_NOTICE:return p?"[Group System Message]":"[群系统通知]";case T.MSG_FACE:return p?"[Animated Sticker]":"[动画表情]";case T.MSG_MERGER:return p?"[Chat Record]":"[聊天记录]";default:return""}};function Bu(k){return k===T.MSG_TEXT||k===T.MSG_CUSTOM||k===T.MSG_LOCATION||k===T.MSG_FACE}function ps(k){var l=[];if(!Et(k))return l;var p=k.length;if(p===0)return l;for(var a=p-1;a>=0;a--)k[a]==="1"&&l.push(Math.pow(2,p-a-1));return l}function Hu(){return!qn&&!je}function xa(k){return"the length of userIDList cannot exceed ".concat(k)}function Pi(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 hs(k){if(rt(k)&&k.length!==0){var l=0;return k.forEach(function(p){l+=p}),l.toFixed(0)}}function dp(k){if(rt(k)&&k.length!==0){var l=0;return k.forEach(function(p){l+=p}),(l/k.length).toFixed(0)}}var b0=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(b0.call(k,l))return!1;return!0}return!(!_d(k)&&(p=k,Os(p)!=="set")&&!Br(k))&&k.size===0;var p}function fp(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=!!Ua(m,l[h],p,h)&&a});else if(rt(l))for(var c=0;c<l.length;c++)a=!!Ua(k[c],l[c],p,l[c].name)&&a;if(a)return a;throw new Error("Params validate failed.")}function Ua(k,l,p,a){if(l===void 0)return!0;var c=!0;if(l.required&&Ye(k)&&(U.e("[".concat(p,'] Missing required params: "').concat(a,'".')),c=!1),!Ye(k)){var h=Os(k),m=l.type.toLowerCase();h!==m&&(h==="asyncfunction"&&m==="function"||(U.e("[".concat(p,'] Invalid params: type check failed for "').concat(a,'".Expected ').concat(l.type,".")),c=!1))}return l.validator&&!l.validator(k)&&(U.e("[".concat(p,"] Invalid params: custom validator check failed for params.")),c=!1),c}var ti,so={UNSEND:"unSend",SUCCESS:"success",FAIL:"fail"},Tr={NOT_START:"notStart",PENDING:"pending",RESOLVED:"resolved",REJECTED:"rejected"},na=function(k){if(!k)return!1;if(mo(k)||io(k)||Td(k))return!0;var l=fn("InvalidConversationID",k);return l&&U.w(l),!1},Je=function(k){k.desc!==""&&fn("API_REFER")!==""&&U.w("[".concat(k.api,"] | ").concat(k.param," | ").concat(k.desc,", ").concat(fn("API_REFER")).concat(k.api))},yi=function(){return fn("StringRequiredLog")},Ns=function(k){return fn("NonEmptyStringRequiredLog",k)},qu=function(){return fn("NumberRequiredLog")},pp=function(){return fn("UndefinedNotAllowedLog")},hp=function(){return fn("FileRequiredLog")},he=function(){return fn("FunctionRequiredLog")},Ee=function(){return fn("ArrayRequiredLog")},Ke=function(){return fn("NonEmptyArrayLog")},ft=function(){return fn("CallbackMissingLog")},rn=function(){return fn("PositiveIntegerRequiredLog")},Nt=function(k,l){return fn("StringNotLongerThanLog",k,l)},xn=function(k,l){return fn("NumberLessThanLog",k,l)},Vn=function(k){return fn("KeyValueStringRequiredLog",k)},An=function(){return fn("PlainObjectRequiredLog")},Yr=function(){return fn("NonEmptyContentRequiredLog")},Hr=function(){return fn("FileNotSelectedLog")},To=function(){return fn("MessageInstanceRequiredLog")},wr=function(){return fn("NonAnonymousFunctionLog")},ni=function(){return fn("MessageExtensionNotAvailableLog")},_i=function(k,l){return fn("MaximumArrayLengthLog",k,l)},at={type:"String",required:!0},Xn={type:"Array",required:!0},Zn={type:"Object",required:!0},Sd={type:"Boolean",required:!0},Vu={type:"number",required:!0},fn=null,mw={hookGetAPITips:function(k){fn=k},login:{userID:at,userSig:at},addToBlacklist:{userIDList:Xn},removeFromBlacklist:{userIDList:Xn},on:[{name:"eventName",type:"String",validator:function(k){return typeof k=="string"&&k.length!==0||(Je({api:"on",param:"eventName",desc:Ns("eventName")}),!1)}},{name:"handler",type:"Function",validator:function(k){return typeof k!="function"?(Je({api:"on",param:"handler",desc:he()}),!1):(k.name===""&&Je({api:"on",param:"handler",desc:wr()}),!0)}}],once:[{name:"eventName",type:"String",validator:function(k){return typeof k=="string"&&k.length!==0||(Je({api:"once",param:"eventName",desc:Ns("eventName")}),!1)}},{name:"handler",type:"Function",validator:function(k){return typeof k!="function"?(Je({api:"once",param:"handler",desc:he()}),!1):(k.name===""&&Je({api:"once",param:"handler",desc:wr()}),!0)}}],off:[{name:"eventName",type:"String",validator:function(k){return typeof k=="string"&&k.length!==0||(Je({api:"off",param:"eventName",desc:Ns("eventName")}),!1)}},{name:"handler",type:"Function",validator:function(k){return typeof k!="function"?(Je({api:"off",param:"handler",desc:he()}),!1):(k.name===""&&Je({api:"off",param:"handler",desc:wr()}),!0)}}],sendMessage:[r({name:"message"},Zn)],setMessageExtensions:[r(r({name:"message"},Zn),{},{validator:function(k){return k.status===so.SUCCESS&&k.isSupportExtension===!0||(Je({api:"setMessageExtensions",param:"message",desc:ni()}),!1)}}),r({name:"extensions"},Xn)],getMessageExtensions:[r(r({name:"message"},Zn),{},{validator:function(k){return k.status===so.SUCCESS&&k.isSupportExtension===!0||(Je({api:"getMessageExtensions",param:"message",desc:ni()}),!1)}})],deleteMessageExtensions:[r(r({name:"message"},Zn),{},{validator:function(k){return k.status===so.SUCCESS&&k.isSupportExtension===!0||(Je({api:"deleteMessageExtensions",param:"message",desc:ni()}),!1)}})],getMessageList:{conversationID:r(r({},at),{},{validator:function(k){return na(k)}}),nextReqMessageID:{type:"String"},count:{type:"Number",validator:function(k){return!(!Ge(k)&&!/^[1-9][0-9]*$/.test(k))||(Je({api:"getMessageList",param:"count",desc:rn()}),!1)}}},getMessageListHopping:{conversationID:r(r({},at),{},{validator:function(k){return na(k)}}),sequence:{type:"Number"},time:{type:"Number"},direction:{type:"Number",validator:function(k){return!(!Ge(k)&&k!==0&&k!==1)||(Je({api:"getMessageListHopping",param:"direction",desc:fn("0Or1RequiredLog")}),!1)}},count:{type:"Number",validator:function(k){return!(!Ge(k)&&!/^[1-9][0-9]*$/.test(k))||(Je({api:"getMessageListHopping",param:"count",desc:rn}),!1)}}},setMessageRead:{conversationID:r(r({},at),{},{validator:function(k){return na(k)}})},setAllMessageRead:{scope:{type:"String",required:!1,validator:function(k){return!k||[T.READ_ALL_C2C_MSG,T.READ_ALL_GROUP_MSG,T.READ_ALL_MSG].indexOf(k)!==-1||(Je({api:"setAllMessageRead",param:"scope",desc:"TencentCloudChat.TYPES.READ_ALL_C2C_MSG or TencentCloudChat.TYPES.READ_ALL_GROUP_MSG or TencentCloudChat.TYPES.READ_ALL_MSG required"}),!1)}}},getConversationProfile:[r(r({name:"conversationID"},at),{},{validator:function(k){return na(k)}})],clearHistoryMessage:[r(r({name:"conversationID"},at),{},{validator:function(k){return na(k)}})],pinConversation:{conversationID:r(r({},at),{},{validator:function(k){return na(k)}}),isPinned:r({},Sd)},setConversationDraft:{conversationID:r(r({},at),{},{validator:function(k){return na(k)}}),draftText:{type:"String",validator:function(k){return!!Et(k)||(Je({api:"setConversationDraft",param:"draftText",desc:yi()}),!1)}}},setConversationCustomData:{conversationIDList:r({},Xn),customData:{type:"String",validator:function(k){return Et(k)?!(k.length>256)||(Je({api:"setConversationCustomData",param:"customData",desc:Nt("customData",256)}),!1):(Je({api:"setConversationCustomData",param:"customData",desc:yi()}),!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:qu()}),!1);var l,p}},enableMark:r({},Sd)},createConversationGroup:{conversationIDList:r({},Xn),groupName:r(r({},at),{},{validator:function(k){return!!k&&(!(k.length>32)||(Je({api:"createConversationGroup",param:"groupName",desc:Nt("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:Nt("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:Ee()}),!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:Ee()}),!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:Vu},decreaseGroupCounter:{groupID:at,key:at,value:Vu},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:yi()}),!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:qu()}),!1);var l,p}},userIDList:r({},Xn),enableMark:r({},Sd)},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:yi()}),!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:Ee()}),!1):(Je({api:"createTextAtMessage",param:"payload.text",desc:yi()}),!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:yi()}),!1):k.description&&!Et(k.description)?(Je({api:"createCustomMessage",param:"payload.description",desc:yi()}),!1):!(k.extension&&!Et(k.extension))||(Je({api:"createCustomMessage",param:"payload.extension",desc:yi()}),!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:pp()}),!1;if(lt){if(!(k.file instanceof HTMLInputElement||Br(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:Hr()}),!1):(Je({api:"createImageMessage",param:"payload.file",desc:hp()}),!1);if(k.file instanceof HTMLInputElement&&k.file.files.length===0)return Je({api:"createImageMessage",param:"payload.file",desc:Hr()}),!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:pp()}),!1;if(lt){if(!(k.file instanceof HTMLInputElement||Br(k.file)))return yn(k.file)&&typeof uni<"u"?!!Br(k.file.tempFile)||(Je({api:"createVideoMessage",param:"payload.file",desc:Hr()}),!1):(Je({api:"createVideoMessage",param:"payload.file",desc:hp()}),!1);if(k.file instanceof HTMLInputElement&&k.file.files.length===0)return Je({api:"createVideoMessage",param:"payload.file",desc:Hr()}),!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:yi()}),!1):(Je({api:"createFaceMessage",param:"payload.index",desc:qu()}),!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:pp()}),!1;if(lt){if(!(k.file instanceof HTMLInputElement||Br(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:Hr()}),!1):(Je({api:"createFileMessage",param:"payload.file",desc:hp()}),!1);if(k.file instanceof HTMLInputElement&&k.file.files.length===0)return Je({api:"createFileMessage",param:"payload.file",desc:Hr()}),!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:qu()}),!1):(Je({api:"createLocationMessage",param:"payload.longitude",desc:qu()}),!1):(Je({api:"createLocationMessage",param:"payload.description",desc:yi()}),!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:Ns("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:To()}),!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:To()}),!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:_i("keywordList",5)}),!1):(Je({api:"searchCloudMessages",param:"keywordList",desc:Ee()}),!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:_i("senderUserIDList",5)}),!1)):(Je({api:"searchCloudMessages",param:"senderUserIDList",desc:Ee()}),!1))}},messageTypeList:{type:"Array",required:!1,validator:function(k){if(!k)return!0;if(!rt(k))return Je({api:"searchCloudMessages",param:"messageTypeList",desc:Ee()}),!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||na(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:Ee()}),!1)}}},updateMyProfile:{profileCustomField:{type:"Array",validator:function(k){return!!Ge(k)||!!rt(k)||(Je({api:"updateMyProfile",param:"profileCustomField",desc:Ee()}),!1)}}},setSelfStatus:{customStatus:{type:"String",validator:function(k){return!!Et(k)||(Je({api:"setSelfStatus",param:"customStatus",desc:yi()}),!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:Ee()}),!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:Ee()}),!1)}}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:function(k){return!k||!!rt(k)||(Je({api:"subscribeUserStatus",param:"userIDList",desc:Ee()}),!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:Nt("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:Nt("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:Nt("remark",96)}),!1)}},friendCustomField:{type:"Array",required:!1,validator:function(k){if(k){if(!rt(k))return Je({api:"updateFriend",param:"friendCustomField",desc:Ee()}),!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:Nt("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:Ee()}),!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:Ee()}),!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:Ee()}),!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:Ee()}),!1)}}},addSignalingListener:[{name:"eventName",type:"String",validator:function(k){return typeof k=="string"&&k.length!==0||(Je({api:"addSignalingListener",param:"eventName",desc:Ns("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:Ns("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:yi()}),!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:Ee()}),!1):(Je({api:"inviteInGroupSync",param:"options.groupID",desc:yi()}),!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:To()}),!1)}})],modifyInvitation:{inviteID:at,data:at}},e6={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},Fa=1,sr=2,gp=3,pr=4,ao=6,It=7,hr=8,ar=10,ct=11,pn=12,ra=13,M0=14,Ga=15,vw=17,Ag=18,I0=19,xi=20,Ps=21,mp=22,vp=23,yp=24,yw=25,Bo=26,_p=27,bp=28,$a=29,C0=30,_w=31,bw=32,ri=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(Ga).getNetworkType()}},{key:"probeNetwork",value:function(l){return this._m.getModule(Ga).probe(l)}},{key:"getCloudConfig",value:function(l){return this._m.getModule(vp).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(L.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(xi).request(l)}},{key:"canIUse",value:function(l){return this._m.getModule(_p).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}(),Mp="wslogin",T0="wslogout",w0="wshello",S0="KickOther",k0="getmsg",Ip="sendmsg",Cp="send_group_msg",D0="portrait_get_all",E0="portrait_set",A0="black_list_get",L0="black_list_add",O0="black_list_delete",R0="friend_get",N0="friend_get_specified",P0="friend_check",x0="friend_delete",U0="friend_add",F0="friend_update",Lg="friend_response",G0="pendency_get",$0="pendency_delete",B0="pendency_report",H0="group_get",q0="group_add",V0="group_delete",Tp="group_update",z0="msgwithdraw",j0="msgreaded",W0="set_c2c_peer_mute_notifications",K0="get_c2c_peer_mute_notifications",wp="getroammsg",Y0="get_peer_read_time",J0="delete_c2c_msg_ramble",Og="modify_c2c_msg",X0="set_key_values",Z0="get_key_values",Q0="page_get",e_="batch_delete",t_="clear_msg",n_="top",r_="deletemsg",Mw="set_conv_custom_data",Rg="mark_contact",Iw="create_contact_group",o_="del_contact_group",kd="update_contact_group",Cw="add_conv_to_group",Tw="del_conv_from_group",i_="get_contact_group",Ng="get_joined_group_list",Pg="get_group_self_member_info",s_="create_group",a_="destroy_group",l_="modify_group_base_info",xg="apply_join_group",ww="apply_join_group_noauth",u_="quit_group",c_="get_group_public_info",d_="change_group_owner",f_="handle_apply_join_group",p_="handle_invite_join_permission_group",h_="handle_invite_join_group",g_="group_msg_recall",m_="msg_read_report",Ug="read_all_unread_msg",Sp="group_msg_get",v_="get_group_msg_receipt",y_="group_msg_receipt",__="c2c_msg_read_receipt",b_="get_group_msg_receipt_detail",Fg="get_pendency",M_="deletemsg",Gg="get_msg",Sw="get_msg_noauth",I_="get_online_member_num",C_="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",T_="batch_get_group_notify",Kg="update_group_counter",Yg="get_group_counter",w_="get_group_member_info",Jg="get_members",S_="get_specified_group_member_info",k_="add_group_member",D_="delete_group_member",E_="ban_group_member",A_="modify_group_member_info",L_="modify_user_info",O_="cos",R_="pre_sig",N_="video_cover",kp="tim_web_report_v2",P_="alive",kw="msg_push",Xg="query",Dw="multi_msg_push_ws",Zg="ws_msg_push_ack",Ew="stat_forceoffline",x_="save_relay_json_msg",U_="get_relay_json_msg",F_="fetch_config",G_="push_configv2",$_="fetch_imsdk_purchase_bitsv2",B_="push_imsdk_purchase_bitsv2",H_="notify2",q_="create_topic",V_="destroy_topic",z_="modify_topic",Qg="get_topic",j_="ws_set_custom_status",em="ws_get_user_status",tm="ws_status_subscribe",nm="ws_status_unsubscribe",W_="ws_stat_background",K_="ws_stat_foreground",Y_="ws_stat_settoken",J_="get_local_words",X_="ws_batch_trans_text",Ae={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},Z_="networkRTT",Q_="messageE2EDelay",Dd="sendMessageC2C",Ed="sendMessageGroup",Ad="sendMessageGroupAV",zu="sendMessageRichMedia",bi="cosUpload",Ld="messageReceivedGroup",Dp="messageReceivedGroupAVPush",Ep="messageReceivedGroupAVPull",t6=(d(ti={},Z_,2),d(ti,Q_,3),d(ti,Dd,4),d(ti,Ed,5),d(ti,Ad,6),d(ti,zu,7),d(ti,Ld,8),d(ti,Dp,9),d(ti,Ep,10),d(ti,bi,11),ti),n6={info:4,warning:5,error:6},Aw={wifi:1,"2g":2,"3g":3,"4g":4,"5g":5,unknown:6,none:7,online:8},r6={login:4},We=function(){function k(l){i(this,k),this._n="SSOLogData",this.eventType=r6[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=Ae.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=n6[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=Aw[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}(),e1=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}(),t1=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||cs.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=ei(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=Pi(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;c<a;c++)p=this.content.imageInfoArray[c],l[c].size&&(p.size=l[c].size),l[c].url&&p.setImageUrl(l[c].url),l[c].width&&(p.width=l[c].width),l[c].height&&(p.height=l[c].height)}},{key:"_autoFixUrl",value:function(){for(var l=this.content.imageInfoArray.length,p="",a="",c=["http","https"],h=null,m=0;m<l;m++)this.content.imageInfoArray[m].url&&(h=this.content.imageInfoArray[m]).imageUrl!==""&&(a=h.imageUrl.slice(0,h.imageUrl.indexOf("://")+1),p=h.imageUrl.slice(h.imageUrl.indexOf("://")+1),c.indexOf(a)<0&&(a="https:"),this.content.imageInfoArray[m].setImageUrl([a,p].join("")))}},{key:"updatePercent",value:function(l){this._percent=l,this._percent>1&&(this._percent=1)}},{key:"updateImageFormat",value:function(l){this.content.imageFormat=cs[l.toUpperCase()]||cs.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&&(Gu(l),Object.assign(l[2],wd({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}(),n1=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}(),r1=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:Pi(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}(),o6={from:!0,groupID:!0,groupName:!0,to:!0},Lw=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;a<p.length;a++){var c=p[a];o6[c]&&(this.content.groupProfile[c]=l[c])}}},{key:"_updateMemberList",value:function(l){Ye(this.content.memberList)?this.content.memberList=l:this.content.memberList.forEach(function(p){l.forEach(function(a){p.userID===a.userID&&Object.assign(p,a)})})}},{key:"_initNewGroupProfile",value:function(l){for(var p=Object.keys(l),a=0;a<p.length;a++){var c=p[a];c!=="muteAllMembers"?this.content.newGroupProfile[c]=l[c]:this.content.newGroupProfile[c]=l[c]===1}}}]),k}(),i6={from:!0,groupID:!0,groupName:!0,to:!0},Ow=function(){function k(l){i(this,k),this.type=T.MSG_GRP_SYS_NOTICE,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"memberInfoList":break;case"remarkInfo":p.content.handleMessage=l[a];break;case"groupProfile":p.content.groupProfile={},p._initGroupProfile(l[a]);break;default:p.content[a]=l[a]}})}},{key:"_initGroupProfile",value:function(l){for(var p=Object.keys(l),a=0;a<p.length;a++){var c=p[a];i6[c]&&(c==="groupName"?this.content.groupProfile.name=l[c]:this.content.groupProfile[c]=l[c])}}}]),k}(),o1=function(){function k(l,p){i(this,k),this.type=T.MSG_FILE,this._percent=0;var a=this._getFileInfo(l);this.content={downloadFlag:2,fileUrl:Pi(l.url,p)||"",uuid:l.uuid,fileName:a.name||"",fileSize:a.size||0}}return u(k,[{key:"_getFileInfo",value:function(l){if(!Ge(l.fileName)&&!Ge(l.fileSize))return{size:l.fileSize,name:l.fileName};var p=l.file.files[0];if(ye){if(p.path&&p.path.indexOf(".")!==-1){var a=p.path.slice(p.path.lastIndexOf(".")+1).toLowerCase();p.type=a,p.name||(p.name="".concat(ei(999999),".").concat(a))}p.name||(p.type="",p.name=p.path.slice(p.path.lastIndexOf("/")+1).toLowerCase()),p.suffix&&(p.type=p.suffix),p.url||(p.url=p.path)}return{size:p.size,name:p.name}}},{key:"updatePercent",value:function(l){this._percent=l,this._percent>1&&(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}(),i1=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}(),s1=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:Pi(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:Pi(l.thumbUrl,p),snapshotUrl:Pi(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}(),a1=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}(),Rw=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=Pi(c.url,a)}):l===T.MSG_VIDEO?(p.videoUrl=Pi(p.videoUrl,a),p.snapshotUrl=Pi(p.thumbUrl,a),p.snapshotHeight=p.thumbHeight,p.snapshotWidth=p.thumbWidth):l===T.MSG_AUDIO?p.url=Pi(p.url,a):l===T.MSG_FILE&&(p.fileUrl=Pi(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,O=l.abstractList,F=l.compatibleText,q=l.version,ee=[];I.forEach(function(ge){if(!Ye(ge)){var _e=new Rw(ge,p);ee.push(_e)}}),this.content.messageList=ee,this.content.title=E,this.content.abstractList=O,this.content.compatibleText=F,this.content.version=q||0}}return u(k,[{key:"sendable",value:function(){return!Ye(this.content.messageList)||!Ye(this.content.downloadKey)}}]),k}(),l1={1:T.MSG_PRIORITY_HIGH,2:T.MSG_PRIORITY_NORMAL,3:T.MSG_PRIORITY_LOW,4:T.MSG_PRIORITY_LOWEST},qr=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:ei(),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(Tl[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);Tl[p]=parseInt([c,h,m,"0001"].join("")),c=null,h=null,m=null,U.l("autoIncrementIndex start index:".concat(Tl[p]))}return Tl[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 e1||l instanceof t1||l instanceof n1||l instanceof r1||l instanceof o1||l instanceof s1||l instanceof Lw||l instanceof Ow||l instanceof i1||l instanceof a1||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;h<l.length;h++)c(l[h]);else c(l);this._initProxy()}},{key:"clearElement",value:function(){this._elements.length=0}},{key:"setTextElement",value:function(l){var p=typeof l=="string"?l:l.text,a=new e1({text:p});this._elements.push(a)}},{key:"setImageElement",value:function(l,p){var a=new t1(l,p);this._elements.push(a)}},{key:"setAudioElement",value:function(l,p){var a=new r1(l,p);this._elements.push(a)}},{key:"setFileElement",value:function(l,p){var a=new o1(l,p);this._elements.push(a)}},{key:"setVideoElement",value:function(l,p){var a=new s1(l,p);this._elements.push(a)}},{key:"setLocationElement",value:function(l){var p=new a1(l);this._elements.push(p)}},{key:"setCustomElement",value:function(l){var p=new i1(l);this._elements.push(p)}},{key:"setGroupTipElement",value:function(l){var p={},a=l.operationType;if(Ye(l.memberInfoList)?l.operatorInfo&&(p=l.operatorInfo):a!==T.GRP_TIP_MBR_JOIN&&a!==T.GRP_TIP_MBR_KICKED_OUT&&a!==T.GRP_TIP_MBR_SET_ADMIN&&a!==T.GRP_TIP_MBR_CANCELED_ADMIN||(p=l.memberInfoList[0]),!Ye(l.memberExtraInfo)){var c=l.memberExtraInfo.reason;l.msgMemberInfo.forEach(function(I){I.reason=c})}var h=p,m=h.nick,y=h.avatar;Et(m)&&(this.nick=m),Et(y)&&(this.avatar=y);var b=new Lw(l);this._elements.push(b)}},{key:"setGroupSystemNoticeElement",value:function(l){var p=new Ow(l);this._elements.push(p)}},{key:"setFaceElement",value:function(l){var p=new n1(l);this._elements.push(p)}},{key:"setMergerElement",value:function(l,p){var a=new rm(l,p);this._elements.push(a)}},{key:"setIsRead",value:function(l){this.isRead=l}},{key:"setRelayFlag",value:function(l){this._relayFlag=l}},{key:"getRelayFlag",value:function(){return this._relayFlag}},{key:"_computePriority",value:function(l){if(Ge(l))return T.MSG_PRIORITY_NORMAL;if(Et(l)&&Object.values(l1).indexOf(l)!==-1)return l;if(un(l)){var p=""+l;if(Object.keys(l1).indexOf(p)!==-1)return l1[p]}return T.MSG_PRIORITY_NORMAL}},{key:"setNickAndAvatar",value:function(l){var p=l.nick,a=l.avatar;Et(p)&&(this.nick=p),Et(a)&&(this.avatar=a)}},{key:"setNameCard",value:function(l){Et(l)&&(this.nameCard=l)}},{key:"initC2CReadReceiptInfo",value:function(l){this.conversationType===T.CONV_C2C&&this.needReadReceipt===!0&&(this.readReceiptInfo.isPeerRead=l===1)}}]),k}(),ht=function(k){return{code:0,data:k||{}}},Un=function(k){f(p,k);var l=R(p);function p(a){var c;i(this,p),c=l.call(this);var h=a.code,m=a.message,y=a.data;return c.code=h,c.message=m||c._getErrorMessage(c.code),c.data=y||{},c}return u(p)}(C(Error)),ju=null,s6=function(k){ju=k},At=function(k){return Promise.resolve(ht(k))},be=function(k){var l=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(k instanceof Un)return l&&ju!==null&&ju.emit(L.ERROR,k),Promise.reject(k);if(k instanceof Error){var p=new Un({code:Ae.UNCAUGHT_ERROR});return l&&ju!==null&&ju.emit(L.ERROR,p),Promise.reject(p)}if(Ge(k)||Ge(k.code))return Promise.reject(new Un({code:Ae.UNCAUGHT_ERROR}));var a=new Un(k);return l&&ju!==null&&ju.emit(L.ERROR,a),Promise.reject(a)},a6=function(k){f(p,k);var l=R(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,O=I.messageList,F=I.isUnreadC2CMessage;this.filterModifiedMessage(O),this.getModule(ct).onNewMessage({conversationOptionsList:E,isInstantMessage:h,isUnreadC2CMessage:F,isSyncingEnded:b});var q=this.filterUnmodifiedMessage(O);h&&q.length>0&&this.emitOuterEvent(L.MESSAGE_RECEIVED,q),O.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=[],O={},F=this.getModule(Bo),q=!1,ee=this.getModule(ct),ge=this.getModule(pr),_e=this.getFileDownloadProxy(),we=0,Ue=c.length;we<Ue;we++)if(this._isC2CNotice(c[we]))this._noticeFromUnreadDBList.push(c[we].eventArray[0].c2CNotifyMsgArray[0]);else{var qe=c[we];qe.currentUser=this.getMyUserID(),qe.conversationType=T.CONV_C2C,qe.isSystemMessage=!!qe.isSystemMessage,(Ge(qe.nick)||Ge(qe.avatar))&&(q=!0,U.d("".concat(this._n,"._newC2CMessageStoredAndSummary nick or avatar missing!"))),(b=new qr(qe)).setElement(qe.elements,_e),b.setNickAndAvatar({nick:qe.nick,avatar:qe.avatar});var nt=b.conversationID;if(y){if(this._messageFromUnreadDBMap.get(b.ID)===1)continue;var mt=!1;if(b.from!==this.getMyUserID()){var xt=ee.getLatestMessageSentByPeer(nt);if(xt){var gn=xt.nick,_n=xt.avatar;q?b.setNickAndAvatar({nick:gn,avatar:_n}):gn===b.nick&&_n===b.avatar||(mt=!0)}}else{var Or=ee.getLatestMessageSentByMe(nt);if(Or){var lo=Or.nick,Ho=Or.avatar;lo===b.nick&&Ho===b.avatar||(ee.modifyMessageSentByMe({conversationID:nt,latestNick:b.nick,latestAvatar:b.avatar}),ge.mockOnNickAvatarModified(b.nick,b.avatar))}}var oi=c[we].isModified===1;if(ee.isMessageSentByCurrentInstance(b)?b.isModified=oi:oi=!1,qe.msgLifeTime===0)b._onlineOnlyFlag=!0,ee.isMessageSentByCurrentInstance(b)||E.push(b);else{if(!ee.pushIntoMessageList(E,b,oi))continue;mt&&(ee.modifyMessageSentByPeer({conversationID:nt,latestNick:b.nick,latestAvatar:b.avatar}),ee.updateUserProfileSpecifiedKey({conversationID:nt,nick:b.nick,avatar:b.avatar}))}y&&b.clientTime>0&&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.time<vo)continue;if(Ge(O[nt])){var es=0;b.flow==="in"&&(b._isExcludedFromUnreadCount||(es=1)),O[nt]=I.push({conversationID:nt,unreadCount:es,type:b.conversationType,subType:b.conversationSubType,lastMessage:b._isExcludedFromLastMessage?"":b})-1}else{var Mi=O[nt];I[Mi].type=b.conversationType,I[Mi].subType=b.conversationSubType,I[Mi].lastMessage=b._isExcludedFromLastMessage?"":b,b.flow==="in"&&(b._isExcludedFromUnreadCount||I[Mi].unreadCount++)}}}else b._onlineOnlyFlag=!0}this._handleRevokedNoticeFromUnreadDB();var gs=!1;if(rt(m))for(var xs=function(Ui,ix){if(m[Ui].unreadCount>0){gs=!0;var um=I.find(function(sx){return sx.conversationID==="C2C".concat(m[Ui].from)});um?um.unreadCount=m[Ui].unreadCount:I.push({conversationID:"C2C".concat(m[Ui].from),unreadCount:m[Ui].unreadCount,type:T.CONV_C2C})}},Od=0,kl=m.length;Od<kl;Od++)xs(Od);if(rt(h))for(var _1=function(Ui,ix){I.find(function(um){return um.conversationID==="C2C".concat(h[Ui].from)})||I.push({conversationID:"C2C".concat(h[Ui].from),type:T.CONV_C2C,lastMsgTime:h[Ui].lastMsgTime})},Rd=0,lm=h.length;Rd<lm;Rd++)_1(Rd);return{conversationOptionsList:I,messageList:E,isUnreadC2CMessage:gs}}},{key:"_isC2CNotice",value:function(a){var c=a.eventArray;return!(!rt(c)||c[0].event!==10)}},{key:"_handleRevokedNoticeFromUnreadDB",value:function(){var a=this._noticeFromUnreadDBList.length;if(a!==0){U.l("".concat(this._n,"._handleRevokedNoticeFromUnreadDB count:").concat(a));var c=[];this._noticeFromUnreadDBList.forEach(function(h){h.hasOwnProperty("c2cMessageRevokedNotify")&&c.push(h)}),this.onC2CMessageRevoked({dataList:c}),this._noticeFromUnreadDBList.length=0,c.length=0}}},{key:"onC2CMessageRevoked",value:function(a){var c=this,h=this.getModule(ct),m=[],y=null,b=!0;a.dataList.forEach(function(I){if(I.c2cMessageRevokedNotify){var E=I.c2cMessageRevokedNotify.revokedInfos;Ge(E)||E.forEach(function(O){var F=c.getMyUserID()===O.from?"".concat(T.CONV_C2C).concat(O.to):"".concat(T.CONV_C2C).concat(O.from);y=h.revoke(F,O.sequence,O.random);var q=O.revokerInfo&&O.revokerInfo.revoker;if(y)y.revoker||(y.revoker=q,m.push(y));else{var ee={conversationID:F,sequence:O.sequence,time:O.time,revoker:q};h.isLastMessageRevoked(ee)&&(m.push(ee),b=!1)}})}}),m.length!==0&&(h.onMessageRevoked(m),b===!0&&(U.l("".concat(this._n,".onC2CMessageRevoked count:").concat(m.length)),this.emitOuterEvent(L.MESSAGE_REVOKED,m)))}},{key:"onC2CMessageReadReceipt",value:function(a){var c=this;a.dataList.forEach(function(h){if(!Ye(h.c2cMessageReadReceipt)){var m=h.c2cMessageReadReceipt.to;h.c2cMessageReadReceipt.uinPairReadArray.forEach(function(y){var b=y.peerReadTime;U.d("".concat(c._n,"._onC2CMessageReadReceipt to:").concat(m," peerReadTime:").concat(b));var I="".concat(T.CONV_C2C).concat(m),E=c.getModule(ct);E.recordPeerReadTime(I,b),E.updateMessageIsPeerReadProperty(I,b)})}})}},{key:"onC2CMessageReadNotice",value:function(a){var c=this;a.dataList.forEach(function(h){if(!Ye(h.c2cMessageReadNotice)){var m=c.getModule(ct);h.c2cMessageReadNotice.uinPairReadArray.forEach(function(y){var b=y.from,I=y.peerReadTime;U.d("".concat(c._n,".onC2CMessageReadNotice from:").concat(b," lastReadTime:").concat(I));var E="".concat(T.CONV_C2C).concat(b);m.updateIsReadAfterReadReport({conversationID:E,lastMessageTime:I}),m.updateUnreadCount(E)})}})}},{key:"onC2CMessageModified",value:function(a){U.d("".concat(this._n,".onC2CMessageModified options:"),JSON.stringify(a));var c=this.getModule(ct);a.dataList.forEach(function(h){c.onMessageModified(r(r({},h),{},{conversationType:T.CONV_C2C}))})}},{key:"onReadReceiptList",value:function(a){U.d("".concat(this._n,".onReadReceiptList options:"),JSON.stringify(a));var c=a.dataList,h=c.userID,m=c.readReceiptList;this.getModule(ct).updateReadReceiptInfo({userID:h,readReceiptList:m})}},{key:"sendMessage",value:function(a,c){var h=this._createC2CMessagePack(a,c);return this.request(h)}},{key:"_createC2CMessagePack",value:function(a,c){var h=null;c&&(c.offlinePushInfo&&(h=c.offlinePushInfo),c.onlineUserOnly===!0&&(h?h.disablePush=!0:h={disablePush:!0}));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,O=b.excludedFromContentModeration;I===!0&&y.push("NoUnread"),E===!0&&y.push("NoLastMsg"),O===!0&&y.push("NoMsgCheck")}var F=this.isOnlineMessage(a,c)?0:void 0;return{protocolName:Ip,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:z0,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:J0,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,O=a.payload,F=a.type,q=a.cloudCustomData,ee=void 0;return Bu(F)&&(ee=[]).push({type:F,content:O}),this.request({protocolName:Og,requestData:{from:c,to:h,version:y,sequence:b,random:I,time:E,elements:ee,cloudCustomData:q}})}},{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:j0,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 O=A(E,2),F=O[0],q=O[1];b.setError(I,F,q).end()}),U.l("".concat(y," failed. error:"),I),be(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,O="peerAccount:".concat(m," count:").concat(b||15," lastMessageTime:").concat(I||0," messageKey:").concat(E);U.l("".concat(h," ").concat(O));var F=new We("getC2CRoamingMessages");return this.request({protocolName:wp,requestData:{peerAccount:m,count:b||15,lastMessageTime:I||0,messageKey:E}}).then(function(q){var ee=q.data,ge=ee.complete,_e=ee.messageList,we=ee.messageKey,Ue=ee.lastMessageTime;Ge(_e)?U.l("".concat(h," ok. complete:").concat(ge," but messageList is undefined!")):U.l("".concat(h," ok. complete:").concat(ge," count:").concat(_e.length)),F.setNetworkType(c.getNetworkType()).setMessage("".concat(O," complete:").concat(ge," length:").concat(_e.length)).end();var qe=c.getModule(ct);ge===1&&qe.setCompleted(y);var nt=qe.onRoamingMessage(_e,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 xt=y.replace(T.CONV_C2C,"");c.getRemotePeerReadTime([xt]).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(q){return c.probeNetwork().then(function(ee){var ge=A(ee,2),_e=ge[0],we=ge[1];F.setMessage(O).setError(q,_e,we).end()}),U.w("".concat(h," failed. error:"),q),be(q)})}},{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,O="".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 q=new We("getC2CRoamingMessagesHopping");return this.request({protocolName:wp,requestData:{peerAccount:m,count:I+1,lastMessageTime:b,direction:E}}).then(function(ee){var ge=ee.data,_e=ge.complete,we=ge.messageList,Ue=we===void 0?[]:we,qe=ge.lastMessageTime;U.l("".concat(h," ok. complete:").concat(_e," count:").concat(Ue.length)),q.setNetworkType(c.getNetworkType()).setMessage("".concat(F," complete:").concat(_e," length:").concat(Ue.length)).end(),_e!==1&&(E===1?Ue.pop():Ue.shift());var nt=c.getModule(ct).onRoamingMessage(Ue,O,!1);c._modifyMessageList(O,nt);var mt=c._computeResult({complete:_e,lastMessageTime:qe,resultList:nt});return ht(mt)}).catch(function(ee){return c.probeNetwork().then(function(ge){var _e=A(ge,2),we=_e[0],Ue=_e[1];q.setMessage(F).setError(ee,we,Ue).end()}),U.w("".concat(h," failed. error:"),ee),be(ee)})}},{key:"_computeResult",value:function(a){var c=a.complete,h=c===void 0?0:c,m=a.lastMessageTime,y=a.resultList,b={messageList:N(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,O=c.length-1;O>=0;O--){var F=c[O];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:Y0,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),O=0;O<a.length;O++)I+="".concat(a[O],"-").concat(b[O]," "),b[O]>0&&E.recordPeerReadTime("C2C".concat(a[O]),b[O]);m.setNetworkType(c.getNetworkType()).setMessage(I).end()}).catch(function(y){c.probeNetwork().then(function(b){var I=A(b,2),E=I[0],O=I[1];m.setError(y,E,O).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 be({code:Ae.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:__,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(O){var F=A(O,2),q=F[0],ee=F[1];m.setError(E,q,ee).end()}),U.w("".concat(I," failed. error:"),E),be(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:Z0,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:X0,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),l6=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<a;b++){var I=this._getUniqueIDOfMessage(l[b]);m&&m.has(I)||(c.push([I,l[b]]),p.push(l[b]))}this.list.set(h,new Map(c.concat(y)))}},{key:"remove",value:function(l){var p=l.conversationID,a=this._getUniqueIDOfMessage(l);this.list.has(p)&&this.list.get(p).delete(a)}},{key:"revoke",value:function(l,p,a){if(U.d("revoke message",l,p,a),this.list.has(l)){var c,h=G(this.list.get(l));try{for(h.s();!(c=h.n()).done;){var m=A(c.value,2)[1];if(m.sequence===p&&(Ge(a)||m.random===a))return m.isRevoked||(m.isRevoked=!0),m}}catch(y){h.e(y)}finally{h.f()}}return null}},{key:"removeByConversationID",value:function(l){this.list.has(l)&&(this.list.delete(l),this._latestMessageSentByPeerMap.delete(l),this._latestMessageSentByMeMap.delete(l))}},{key:"findMessage",value:function(l){var p,a=null,c=G(this.list);try{for(c.s();!(p=c.n()).done;)for(var h=N(A(p.value,2)[1].values()),m=h.length,y=0;y<m;y++)if(h[y].ID===l){a=h[y];break}}catch(b){c.e(b)}finally{c.f()}return a}},{key:"updateMessageIsPeerReadProperty",value:function(l,p){var a=[];if(this.list.has(l)){var c,h=G(this.list.get(l));try{for(h.s();!(c=h.n()).done;){var m=A(c.value,2)[1];m.time<=p&&!m.isPeerRead&&m.flow==="out"&&(m.isPeerRead=!0,a.push(m))}}catch(y){h.e(y)}finally{h.f()}U.l("".concat(this._n,".updateMessageIsPeerReadProperty conversationID:").concat(l," peerReadTime:").concat(p," count:").concat(a.length))}return a}},{key:"updateMessageIsModifiedProperty",value:function(l){var p=l.conversationID;if(this.list.has(p)){var a=this._getUniqueIDOfMessage(l),c=this.list.get(p).get(a);c&&(c.isModified=!0)}}},{key:"hasLocalMessageList",value:function(l){return this.list.has(l)}},{key:"getLocalMessageList",value:function(l){return this.hasLocalMessageList(l)?N(this.list.get(l).values()):[]}},{key:"hasLocalMessage",value:function(l,p){for(var a=!1,c=this.getLocalMessageList(l),h=c.length,m=0;m<h;m++)c[m].ID===p&&(a=!0);return a}},{key:"getLocalMessage",value:function(l,p){for(var a=null,c=this.getLocalMessageList(l),h=c.length,m=0;m<h;m++)if(c[m].ID===p){a=c[m];break}return a}},{key:"getLocalLastMessage",value:function(l){var p=this.getLocalMessageList(l);return p[p.length-1]}},{key:"getLocalOldestMessage",value:function(l){return this.getLocalMessageList(l)[0]}},{key:"_setLatestMessageSentByPeer",value:function(l,p){l.startsWith(T.CONV_C2C)&&p.flow==="in"&&this._latestMessageSentByPeerMap.set(l,p)}},{key:"_setLatestMessageSentByMe",value:function(l,p){p.flow==="out"&&this._latestMessageSentByMeMap.set(l,p)}},{key:"getLatestMessageSentByPeer",value:function(l){return this._latestMessageSentByPeerMap.get(l)}},{key:"getLatestMessageSentByMe",value:function(l){return this._latestMessageSentByMeMap.get(l)}},{key:"modifyMessageSentByPeer",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,O=y-1;O>=0;O--)m[O].flow==="in"&&((b=m[O]).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,O=y-1;O>=0;O--)m[O].flow==="out"&&((b=m[O]).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 N(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.version<m?(h.version=m,h._elements=JSON.parse(JSON.stringify(y)),h.payload=JSON.parse(JSON.stringify(y[0].content)),h.type=y[0].type,h.cloudCustomData=b,h.isModified=!0,{isUpdated:!0,message:h}):{isUpdated:!1,message:h}}return{isUpdated:!1,message:null}}},{key:"_getUniqueIDOfMessage",value:function(l){var p=l.from,a=l.to,c=l.random,h=l.sequence,m=l.time;return"".concat(p,"-").concat(a,"-").concat(c,"-").concat(h,"-").concat(m)}},{key:"reset",value:function(){this.list.clear(),this._latestMessageSentByPeerMap.clear(),this._latestMessageSentByMeMap.clear()}}]),k}(),rr={A2KEY_AND_TINYID_UPDATED:"_inner".concat(1),CLOUD_CONFIG_UPDATED:"_inner".concat(2),PROFILE_UPDATED:"_inner".concat(3),CONV_SYNC_COMPLETED:"_inner".concat(4),C2C_UNREAD_HANDLE_COMPLETED:"_inner".concat(5)};function u1(k){this.mixin(k)}u1.mixin=function(k){var l=k.prototype||k;l._isReady=!1,l.ready=function(p){var a=arguments.length>1&&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 u6=["jpg","jpeg","gif","png","bmp","image","webp"],c6=["mp4","quicktime","mov"],d6=1,f6=2,p6=3,h6=255,Ap=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;m<c;m++){if(h=l.profileCustomField[m],!Et(h.key)||h.key.indexOf("Tag_Profile_Custom")===-1)return{valid:!1,tips:"The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom"};if(!Et(h.value))return{valid:!1,tips:"The type of values of the custom profile key-value pairs (which is profileCustomField) must be String"}}for(var y in l)if(Object.prototype.hasOwnProperty.call(l,y)){if(y==="profileCustomField")continue;if(Ye(l[y])&&!Et(l[y])&&!un(l[y])){a="key:"+y+", invalid value:"+l[y],p=!1;continue}switch(y){case"nick":Et(l[y])||(a="nick must be a string",p=!1),Cl(l[y])>500&&(a="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(Cl(l[y])," bytes"),p=!1);break;case"gender":ta(Qo,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":ta(ds,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":ta(Na,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}(),g6=u(function k(l){i(this,k),this.value=l,this.next=null}),c1=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 g6(l);if(this.map.size<this.MAX_LENGTH)this.pTail===null?(this.pTail=p,this.pNodeToDel=p):(this.pTail.next=p,this.pTail=p),this.map.set(l,1);else{var a=this.pNodeToDel;this.pNodeToDel=this.pNodeToDel.next,this.map.delete(a.value),a.next=null,a=null,this.pTail.next=p,this.pTail=p,this.map.set(l,1)}}},{key:"has",value:function(l){return this.map.has(l)}},{key:"delete",value:function(l){this.has(l)&&this.map.delete(l)}},{key:"tail",value:function(){return this.pTail}},{key:"size",value:function(){return this.map.size}},{key:"data",value:function(){return Array.from(this.map.keys())}},{key:"reset",value:function(){for(var l;this.pNodeToDel!==null;)l=this.pNodeToDel,this.pNodeToDel=this.pNodeToDel.next,l.next=null,l=null;this.pTail=null,this.map.clear()}}]),k}(),m6=["groupID","name","avatar","type","introduction","notification","ownerID","selfInfo","createTime","infoSequence","lastInfoTime","lastMessage","nextMessageSeq","memberNum","maxMemberNum","memberList","joinOption","groupCustomField","muteAllMembers","isSupportTopic","inviteOption","_lastRevokedTime"],Sl=function(){function k(l){i(this,k),this.groupID="",this.name="",this.avatar="",this.type="",this.introduction="",this.notification="",this.ownerID="",this.createTime="",this.infoSequence="",this.lastInfoTime="",this.selfInfo={messageRemindType:"",joinTime:"",nameCard:"",role:"",userID:"",memberCustomField:void 0,readedSequence:0,excludedUnreadSequenceList:void 0},this.lastMessage={lastTime:"",lastSequence:"",fromAccount:"",messageForShow:""},this.nextMessageSeq="",this.memberNum="",this.memberCount="",this.maxMemberNum="",this.maxMemberCount="",this.joinOption="",this.inviteOption="",this.groupCustomField=[],this.muteAllMembers=!1,this.isSupportTopic=!1,this._lastRevokedTime=0,this._initGroup(l)}return u(k,[{key:"memberNum",get:function(){return this.memberCount},set:function(l){}},{key:"maxMemberNum",get:function(){return this.maxMemberCount},set:function(l){}},{key:"_initGroup",value:function(l){for(var p in l)m6.indexOf(p)<0||(p!=="selfInfo"?(p==="memberNum"&&(this.memberCount=l[p]),p==="maxMemberNum"&&(this.maxMemberCount=l[p]),p!=="isSupportTopic"?this[p]=l[p]:this.isSupportTopic=l[p]===1):this.updateSelfInfo(l[p]))}},{key:"updateGroup",value:function(l){var p=this;l.appid=void 0,l.grossTopicNextMsgSeq=void 0,l.selfInfo&&(l.selfInfo.grossTopicReadSeq=void 0);var a=JSON.parse(JSON.stringify(l));a.lastMsgTime&&(this.lastMessage.lastTime=a.lastMsgTime),Ge(a.muteAllMembers)||(a.muteAllMembers==="On"?a.muteAllMembers=!0:a.muteAllMembers=!1),a.groupCustomField&&xu(this.groupCustomField,a.groupCustomField),Ge(a.memberNum)||(this.memberCount=a.memberNum),Ge(a.maxMemberNum)||(this.maxMemberCount=a.maxMemberNum),Ge(a.isSupportTopic)||(this.isSupportTopic=un(a.isSupportTopic)?a.isSupportTopic===1:a.isSupportTopic),Ni(this,a,["members","errorCode","lastMsgTime","groupCustomField","memberNum","maxMemberNum","isSupportTopic"]),rt(a.members)&&a.members.length>0&&a.members.forEach(function(c){c.userID===p.selfInfo.userID&&Ni(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};Ni(this.selfInfo,r({},p),[],["",null,void 0,0,NaN])}},{key:"setSelfNameCard",value:function(l){this.selfInfo.nameCard=l}}]),k}(),Nw=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 qr?{lastTime:k.time||0,lastSequence:k.sequence||0,fromAccount:k.from||"",messageForShow:$u(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:$u(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=Nw(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 Ap({userID:l.conversationID.replace("C2C","")}):Ge(this.groupProfile)&&this.type===T.CONV_GROUP&&(this.groupProfile=new Sl({groupID:l.conversationID.replace("GROUP","")}))}},{key:"updateUnreadCount",value:function(l){var p=l.nextUnreadCount,a=l.isFromGetConversations,c=l.isUnreadC2CMessage;Ge(p)||($o(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=Nw(l)}},{key:"updateGroupAtInfoList",value:function(l){if(!this._isNeedMergeGroupAtInfo(l)){var p,a=(H(p=l.groupAtType)||z(p)||x(p)||j()).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}(),v6=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:K0,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(It);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 O=A(E,2),F=O[0],q=O[1];y.setError(I,F,q).end()}),U.e("".concat(a," failed. error:"),I),be(I)}):be({code:Ae.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(It).getLocalGroupProfile(p);if(c&&(c.selfInfo.messageRemindType=a),oo(p)){var h=p,m=Lr(h),y=this._getModule(ar).getLocalTopic(m,h);return y&&(y.updateSelfInfo({messageRemindType:a}),this._conversationModule.emitOuterEvent(L.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:W0,requestData:{userIDList:m,muteFlag:y}}).then(function(E){I.setNetworkType(p._conversationModule.getNetworkType()).end();var O=E.data.errorList,F=[],q=[];rt(O)&&O.forEach(function(_e){F.push(_e.userID),q.push({userID:_e.userID,code:_e.errorCode})});var ee=m.filter(function(_e){return F.indexOf(_e)===-1});U.l("".concat(a," ok. ").concat(b," successUserIDList:").concat(ee," failureUserIDList:").concat(JSON.stringify(q)));var ge=0;return ee.forEach(function(_e){p._conversationModule.patchMessageRemindType({ID:_e,isC2CConversation:!0,messageRemindType:h})&&(ge+=1)}),ge>=1&&p._emitConversationUpdate(),m.length=F.length=0,p._conversationModule.emitTotalUnreadMessageCountUpdate(),At({successUserIDList:ee.map(function(_e){return{userID:_e}}),failureUserIDList:q})}).catch(function(E){return p._conversationModule.probeNetwork().then(function(O){var F=A(O,2),q=F[0],ee=F[1];I.setError(E,q,ee).end()}),U.e("".concat(a," failed. error:"),E),be(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}(),y6=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 O={operationType:2,contactItem:void 0,customMark:h};mo(E)?O.contactItem={type:1,toAccount:E.replace(T.CONV_C2C,"")}:io(E)&&(O.contactItem={type:2,groupID:E.replace(T.CONV_GROUP,"")}),y.itemList.push(O)}),I.length===c.length?At({successConversationIDList:b,failureConversationIDList:I}):this._conversationModule.request({protocolName:Mw,requestData:y}).then(function(E){m.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var O=E.data.resultItem;if(rt(O)){var F,q,ee=!1;O.forEach(function(ge){F=p._concatConversationID(ge.contactItem),ge.resultCode===0?(b.push(F),(q=p._getLocalConversation(F))&&q.customData!==h&&(q.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(O){var F=A(O,2),q=F[0],ee=F[1];m.setError(E,q,ee).end()}),U.e("".concat(a," failed. error:"),E),be(E)})}},{key:"markConversation",value:function(l){var p=this;if(!this._conversationModule.canIUse(me.CONV_MARK))return be({code:Ae.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 O={fromAccount:this._getMyUserID(),itemList:[]},F=[],q=[];return c.forEach(function(ee){if(!p._hasLocalConversation(ee))return p._onConversationNotFound(q,ee),!0;if(!mo(ee)&&!io(ee))return p._onConversationIDInvalid(q,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,"")}),O.itemList.push(ge)}),q.length===c.length?At({successConversationIDList:F,failureConversationIDList:q}):this._conversationModule.request({protocolName:Rg,requestData:O}).then(function(ee){y.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var ge=ee.data.resultItem;if(rt(ge)){var _e,we,Ue=!1;ge.forEach(function(qe){if(_e=p._concatConversationID(qe.contactItem),qe.resultCode===0){if(F.push(_e),we=p._getLocalConversation(_e)){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 q.push({conversationID:_e,code:qe.resultCode,message:qe.resultInfo})}),Ue===!0&&p._emitConversationUpdate()}return ht({successConversationIDList:F,failureConversationIDList:q})}).catch(function(ee){return p._conversationModule.probeNetwork().then(function(ge){var _e=A(ge,2),we=_e[0],Ue=_e[1];y.setError(ee,we,Ue).end()}),U.e("".concat(a," failed. error:"),ee),be(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(N(l._convGroupMap.values()))}):At(N(this._convGroupMap.values()))}},{key:"getRemoteConvGroupList",value:function(){var l=this,p="".concat(this._n,".getRemoteConvGroupList");return this._pagingStatus=Tr.PENDING,this._conversationModule.request({protocolName:i_,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,O=m.groupItem;if(l._startIndex=E,U.l("".concat(p," completeFlag:").concat(y," nextStartIndex:").concat(E)),rt(O)&&O.forEach(function(F){var q=F.convGroupID,ee=F.groupName;l._convGroupMap.set(q,ee)}),rt(b)&&b.forEach(function(F){var q=F.standardMark,ee=F.customData,ge=F.convGroupIDList;if(c=l._concatConversationID(F),(h=l._getLocalConversation(c))&&(h.markList=ps(q),h.customData=ee||"",rt(ge))){var _e=[];ge.forEach(function(we){l._convGroupMap.has(we)&&_e.push(l._convGroupMap.get(we))}),h.conversationGroupList=[].concat(_e),_e.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(me.CONV_GROUP))return be({code:Ae.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:Iw,requestData:y}).then(function(E){c.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var O=E.data.groupResultItem[0],F=O.groupItem,q=O.resultItem;if(yn(F)&&(p._convGroupMap.set(F.convGroupID,F.groupName),p._emitConvGroupListUpdate()),rt(q)){var ee,ge,_e=!1;q.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),_e=!0)):I.push({conversationID:ee,code:we.resultCode,message:we.resultInfo})}),_e===!0&&(p._emitConversationUpdate(),p._emitConvGroupListUpdate())}return ht({successConversationIDList:b,failureConversationIDList:I})}).catch(function(E){return p._conversationModule.probeNetwork().then(function(O){var F=A(O,2),q=F[0],ee=F[1];c.setError(E,q,ee).end()}),U.e("".concat(a," failed. error:"),E),be(E)})}},{key:"deleteConvGroup",value:function(l){var p=this;if(!this._conversationModule.canIUse(me.CONV_GROUP))return be({code:Ae.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:o_,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),be(h)})}},{key:"renameConvGroup",value:function(l){var p=this;if(!this._conversationModule.canIUse(me.CONV_GROUP))return be({code:Ae.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:kd,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,O=p._conversationModule.getLocalConversationList(),F=!1;O.forEach(function(q){I=q.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],O=I[1];c.setError(y,E,O).end()}),U.e("".concat(a," failed. error:"),y),be(y)})}},{key:"addConvsToGroup",value:function(l){var p=this;if(!this._conversationModule.canIUse(me.CONV_GROUP))return be({code:Ae.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:Cw,requestData:y}).then(function(E){c.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var O=E.data.updateGroupResult.contactResultItem;if(rt(O)){var F,q,ee=!1;O.forEach(function(ge){F=p._concatConversationID(ge.contactItem),ge.resultCode===0?(q=p._getLocalConversation(F))&&q.conversationGroupList.indexOf(m)===-1&&(q.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(O){var F=A(O,2),q=F[0],ee=F[1];c.setError(E,q,ee).end()}),U.e("".concat(a," failed. error:"),E),be(E)})}},{key:"deleteConvsFromGroup",value:function(l){var p=this;if(!this._conversationModule.canIUse(me.CONV_GROUP))return be({code:Ae.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:Tw,requestData:y}).then(function(E){c.setNetworkType(p._conversationModule.getNetworkType()).end(),U.l("".concat(a," ok"));var O=E.data.updateGroupResult.contactResultItem;if(rt(O)){var F,q,ee=!1;O.forEach(function(ge){if(F=p._concatConversationID(ge.contactItem),ge.resultCode===0){if(q=p._getLocalConversation(F)){var _e=q.conversationGroupList.indexOf(m);_e!==-1&&(q.conversationGroupList.splice(_e,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(O){var F=A(O,2),q=F[0],ee=F[1];c.setError(E,q,ee).end()}),U.e("".concat(a," failed. error:"),E),be(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 O=ps(I);(function(F,q){if(F===q)return!0;if(!F||!q||F.length!==q.length)return!1;for(var ee=0,ge=F.length;ee<ge;ee++)if(F[ee]!==q[ee])return!1;return!0})(c.markList,O)!==!0&&(c.markList=O,h=!0)}else b===2&&c.customData!==E&&E!==void 0&&(c.customData=E,h=!0)}),h===!0&&this._emitConversationUpdate()}}},{key:"onConvGroupCreated",value:function(l){var p=this;U.d("".concat(this._n,".onConvGroupCreated resultList:"),l);var a=!1,c=!1;rt(l)&&(l.forEach(function(h){var m=h.msgGroupItem,y=m.groupID,b=m.groupName;p._convGroupMap.get(y)!==b&&(p._convGroupMap.set(y,b),c=!0);var I,E,O=h.msgRecentContactItem;rt(O)&&O.forEach(function(F){I=p._concatConversationID(F),(E=p._getLocalConversation(I))&&E.conversationGroupList.indexOf(b)===-1&&(E.conversationGroupList.push(b),a=!0)})}),a===!0&&this._emitConversationUpdate(),c===!0&&this._emitConvGroupListUpdate())}},{key:"onConvGroupDeleted",value:function(l){var p=this;U.d("".concat(this._n,".onConvGroupDeleted groupItemList:"),l);var a=[];if(rt(l)){var c=!1;l.forEach(function(h){var m=h.groupID,y=h.groupName;p._convGroupMap.has(m)&&(p._convGroupMap.delete(m),c=!0,a.push(y))}),c===!0&&this._emitConvGroupListUpdate()}this._eraseFromConversationGroupList(a)}},{key:"_eraseFromConversationGroupList",value:function(l){Ye(l)||(this._conversationModule.getLocalConversationList().forEach(function(p){p.conversationGroupList=p.conversationGroupList.filter(function(a){return!l.includes(a)})}),this._emitConversationUpdate())}},{key:"onConvGroupNameUpdated",value:function(l){U.d("".concat(this._n,".onConvGroupNameUpdated options:"),l);var p=l.groupID,a=l.groupName,c=l.oldGroupName;if(this._convGroupMap.get(p)!==a){this._convGroupMap.set(p,a),this._emitConvGroupListUpdate();var h,m,y=this._conversationModule.getLocalConversationList(),b=!1;y.forEach(function(I){h=I.conversationGroupList,(m=h.indexOf(c))!==-1&&(h.splice(m,1,a),b=!0)}),b===!0&&this._emitConversationUpdate()}}},{key:"onConvInGroupUpdated",value:function(l){var p=this;U.d("".concat(this._n,".onConvInGroupUpdated options:"),l);var a=l.oldGroupName,c=l.recentContactUpdateGroupItem;if(rt(c)){var h,m,y,b=!1;c.forEach(function(I){var E=I.contactOptType,O=I.recentContactItem;h=p._concatConversationID(O),(m=p._getLocalConversation(h))&&(y=m.conversationGroupList.indexOf(a),E===1?y===-1&&(m.conversationGroupList.push(a),b=!0):E===2&&y!==-1&&(m.conversationGroupList.splice(y,1),b=!0))}),b===!0&&(this._emitConversationUpdate(),this._emitConvInGroupUpdate(a))}}},{key:"onConvAddedToOrDeletedFromGroup",value:function(l){var p=this;U.d("".concat(this._n,".onConvAddedToOrDeletedFromGroup options:"),l);var a=l.msgRecentContactItem,c=l.msgRecentContactUpdateContactItem,h=this._concatConversationID(a),m=this._getLocalConversation(h);if(m&&rt(c)){var y,b=!1;c.forEach(function(I){var E=I.groupOptType,O=I.recentContactGroupItem.groupName;y=m.conversationGroupList.indexOf(O),E===1?y===-1&&(m.conversationGroupList.push(O),b=!0):E===2&&y!==-1&&(m.conversationGroupList.splice(y,1),b=!0),b===!0&&p._emitConvInGroupUpdate(O)}),b===!0&&this._emitConversationUpdate()}}},{key:"onConvGroupListSynced",value:function(l){var p=this;rt(l)&&l.length!==0&&(U.l("".concat(this._n,".onConvGroupListSynced groupItemList:"),l),l.forEach(function(a){p._convGroupMap.set(a.convGroupID,a.groupName)}))}},{key:"getConvGroupListByID",value:function(l){var p=this;if(!Ye(l)){var a=[];return l.forEach(function(c){p._convGroupMap.has(c)&&a.push(p._convGroupMap.get(c))}),a}}},{key:"_onConversationNotFound",value:function(l,p){l.push({conversationID:p,code:Ae.CONV_NOT_FOUND,message:this._conversationModule.getErrorMessage(Ae.CONV_NOT_FOUND)})}},{key:"_onConversationIDInvalid",value:function(l,p){l.push({conversationID:p,code:Ae.INVALID_CONV_ID,message:this._conversationModule.getErrorMessage(Ae.INVALID_CONV_ID)})}},{key:"_getFlagBit",value:function(l){for(var p=l.toString(2),a=p.length,c=a-1;c>=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(L.CONVERSATION_GROUP_LIST_UPDATED,N(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(L.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}(),_6=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="ConversationModule",u1.mixin(w(c)),c._messageListHandler=new l6,c._messageRemindHandler=new v6(w(c)),c._convGroupHandler=new y6(w(c)),c.singlyLinkedList=new c1(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(rr.A2KEY_AND_TINYID_UPDATED,this._init,this),a.on(rr.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(ra).getItem("conversationMap"),h=this.isIntl();if(c){for(var m=c.length,y=0;y<m;y++){var b=c[y];if(b){if(this._isNonExistentAccount(b.conversationID))continue;if(b.groupProfile){var I=b.groupProfile.type;if($o(I))continue}}this._conversationMap.set(b.conversationID,new om(c[y],h))}this.emitConversationUpdate(!0,!1)}this.ready(function(){a._tmpGroupList.length>0&&(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,O=E===void 0||E,F=a.isSyncingEnded,q=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:O}),y||(this._convIDFromUnreadDBMap=new Map([].concat(N(this._convIDFromUnreadDBMap),N(h.map(function(ee){return[ee.conversationID,1]})))),this._diffAndDeleteConversation(),q&&this.emitInnerEvent(rr.C2C_UNREAD_HANDLE_COMPLETED)),h.filter(function(ee){return ee.type===T.CONV_TOPIC}).length>0||this.emitConversationUpdate()):q&&this.emitInnerEvent(rr.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<m.nextMessageSeq&&(b.lastMessage.lastSequence=m.nextMessageSeq-1),b.subType||(b.subType=m.type)}}),h&&this.emitConversationUpdate(!0,!1)}else this._tmpGroupList=a}},{key:"_updateConversationUserProfile",value:function(a){var c=this;a.data.forEach(function(h){var m="C2C".concat(h.userID);c._conversationMap.has(m)&&(c._conversationMap.get(m).userProfile=h)}),this.emitConversationUpdate(!0,!1)}},{key:"onMessageRevoked",value:function(a){var c=this;if(a.length!==0){var h=null,m=!1,y=[];a.forEach(function(b){(h=c._conversationMap.get(b.conversationID))&&(h.type===T.CONV_TOPIC?y.push(b):(h.reduceUnreadCount()&&(m=!0),h.isLastMessageRevoked({sequence:b.sequence,time:b.time})&&(h.setLastMessageRevoked(!0),h.setLastMessageRevoker(b.revoker),m=!0)))}),this.getModule(ar).onMessageRevoked(y),m&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate())}}},{key:"isLastMessageRevoked",value:function(a){var c=!1,h=a.conversationID,m=a.sequence,y=a.time,b=this._conversationMap.get(h);return b&&(c=b.type===T.CONV_TOPIC?this.getModule(ar).isLastMessageRevoked({topicID:h.replace(T.CONV_GROUP,""),sequence:m}):b.isLastMessageRevoked({sequence:m,time:y})),U.l("".concat(this._n,".isLastMessageRevoked options:").concat(JSON.stringify(a)," ret:").concat(c)),c}},{key:"onMessageDeleted",value:function(a){var c=this;if(a.length!==0){var h=null;a.forEach(function(F){(h=c._messageListHandler.getLocalMessage(F.conversationID,F.ID))&&(h.isDeleted=!0),F!==h&&(F.isDeleted=!0)});for(var m=a[0].conversationID,y=this._messageListHandler.getLocalMessageList(m),b={},I=y.length-1;I>=0;I--)if(!y[I].isDeleted){b=y[I];break}var E=this._conversationMap.get(m);if(E){var O=!1;E.lastMessage.lastSequence===b.sequence&&E.lastMessage.lastTime===b.time||(Ye(b)&&(b=void 0),E.updateLastMessage(b),E.type!==T.CONV_TOPIC&&(O=!0),U.l("".concat(this._n,".onMessageDeleted. update conversationID:").concat(m," with lastMessage:"),E.lastMessage)),m.startsWith(T.CONV_C2C)&&this.updateUnreadCount(m),O&&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,O=a.messageVersion,F=this.getMyUserID(),q="".concat(c).concat(m);m===F&&c===T.CONV_C2C&&(q="".concat(c).concat(h));var ee=this._messageListHandler.onMessageModified(q,a),ge=ee.isUpdated,_e=ee.message;ge===!0&&this.emitOuterEvent(L.MESSAGE_MODIFIED,[_e]);var we=this._isTopicConversation(q);if(U.l("".concat(this._n,".onMessageModified isUpdated:").concat(ge," isTopicMessage:").concat(we," from:").concat(h," to:").concat(m)),we)this.getModule(ar).onMessageModified(a);else{var Ue=this._conversationMap.get(q);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!==O&&(qe.type=I[0].type,qe.payload=I[0].content,qe.messageForShow=$u(qe.type,qe.payload,this.isIntl()),qe.cloudCustomData=E,qe.version=O,this.emitConversationUpdate(!0,!1))}}return _e}},{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,O=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 q=a._conversationMap.get("".concat(T.CONV_GROUP).concat(I));if(q){q.updateGroupAtInfoList(h);var ee=a.getModule(ar),ge=q.groupAtInfoList;ee.onConversationProxy({topicID:I,groupAtInfoList:ge})}Ye(q)&&O&&(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(It);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(ra);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(It);m&&m.updateGroupLastMessage(h)}a&&this.emitOuterEvent(L.CONVERSATION_LIST_UPDATED)}},{key:"getLocalConversationList",value:function(){return N(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=dp(a._pagingGetCostList),y=hs(a._pagingGetCostList);a._pagingGetCostList.length=0,a._pagingStatus=Tr.RESOLVED,a._diffAndDeleteConversation(),a.emitConversationUpdate(!0,!1),a._setStorageConversationList(),a._handleC2CPeerReadTime(),a.emitInnerEvent(rr.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()}),be(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:Q0,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,O=y.timeStamp,F=y.startIndex,q=y.pinnedTimeStamp,ee=y.pinnedStartIndex,ge=y.groupItem,_e=Date.now()-h;if(a._pagingGetCostList.push(_e),U.l("".concat(c," ok. completeFlag:").concat(b," count:").concat(E.length," cost ").concat(_e," ms")),a._convGroupHandler.onConvGroupListSynced(ge),E.length>0){var we=a._getConversationOptions(E);a._pagingConvIDMap=new Map([].concat(N(a._pagingConvIDMap),N(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=O,a._pagingStartIndex=F,a._pagingPinnedTimeStamp=q,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(N(c.toBeUpdatedConversationList),N(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=[],O=[],F=this.getModule(It),q=this.getModule(hr),ee=this.isIntl(),ge=0,_e=c.length;ge<_e;ge++){var we=new om(c[ge],ee),Ue=we.conversationID;if(!this._isNonExistentAccount(Ue))if(this._conversationMap.has(Ue)){var qe=this._conversationMap.get(Ue),nt=["unreadCount","allowType","adminForbidType","payload","isPinned"];m===!1&&nt.push("lastMessage");var mt=c[ge].lastMessage,xt=!Ge(mt);xt||c[ge].type===T.CONV_TOPIC||this._onLastMessageNotExist(c[ge]),Ge(m)&&xt&&qe.lastMessage.payload===null&&(qe.lastMessage.payload=mt.payload),Ye(qe.lastMessage.revoker)||(qe.lastMessage.revoker=null),Ni(qe,we,nt,[null,void 0,"",0,NaN]),I===!0&&qe.updateUnreadCount({nextUnreadCount:we.unreadCount,isFromGetConversations:h,isUnreadC2CMessage:b}),m&&xt&&(mt.payload&&(qe.lastMessage.payload=mt.payload),qe.type===T.CONV_GROUP&&(qe.lastMessage.nameCard=mt.nameCard,qe.lastMessage.nick=mt.nick)),xt&&qe.lastMessage.cloudCustomData!==mt.cloudCustomData&&(qe.lastMessage.cloudCustomData=mt.cloudCustomData||""),this._conversationMap.delete(Ue),E.push([Ue,qe])}else{if(we.type===T.CONV_GROUP&&F){var gn=we.groupProfile.groupID,_n=F.getLocalGroupProfile(gn);_n&&(we.groupProfile=_n,I===!0&&we.updateUnreadCount({nextUnreadCount:0}))}else if(we.type===T.CONV_C2C){var Or=Ue.replace(T.CONV_C2C,"");q&&q.isMyFriend(Or)&&(we.remark=q.getFriendRemark(Or))}O.push(we),E.push([Ue,we])}}for(var lo=this.getModule(ar),Ho=E.length,oi=0;oi<Ho;oi++)if(E[oi][1].type===T.CONV_TOPIC){var vo=E[oi][1],es=vo.conversationID,Mi=vo.unreadCount,gs=vo.groupAtInfoList;lo.onConversationProxy({topicID:es.replace(T.CONV_GROUP,""),unreadCount:Mi,groupAtInfoList:Ye(gs)?void 0:gs})}return{toBeUpdatedConversationList:E,newConversationList:O}}},{key:"_onLastMessageNotExist",value:function(a){new We("lastMessageNotExist").setMessage(JSON.stringify(a)).setNetworkType(this.getNetworkType()).end()}},{key:"_sortConversationList",value:function(a){var c=[],h=[],m=[],y=[];return a.forEach(function(b){b[1].isPinned===!0?Ye(b[1].lastMessage.lastTime)?h.push(b):c.push(b):Ye(b[1].lastMessage.lastTime)?y.push(b):m.push(b)}),c.sort(function(b,I){return I[1].lastMessage.lastTime-b[1].lastMessage.lastTime}).concat(h).concat(m.sort(function(b,I){return I[1].lastMessage.lastTime-b[1].lastMessage.lastTime})).concat(y)}},{key:"_sortConversationListAndEmitEvent",value:function(){this._conversationMap=new Map(this._sortConversationList(N(this._conversationMap))),this.emitConversationUpdate(!0,!1)}},{key:"_updateUserOrGroupProfile",value:function(a){var c=this;if(a.length!==0){var h=[],m=[],y=this.getModule(pr),b=this.getModule(It);a.forEach(function(I){if(I.type===T.CONV_C2C)h.push(I.toAccount);else if(I.type===T.CONV_GROUP){var E=I.toAccount;b.hasLocalGroup(E)?I.groupProfile=b.getLocalGroupProfile(E):m.push(E)}}),U.l("".concat(this._n,"._updateUserOrGroupProfile c2cUserIDList:").concat(h," groupIDList:").concat(m)),h.length>0&&y.getUserProfile({userIDList:h}).then(function(I){var E=I.data;rt(E)?E.forEach(function(O){c._doUpdateUserProfile("C2C".concat(O.userID),O)}):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 O="GROUP".concat(E.groupID);if(c._conversationMap.has(O)){var F=c._conversationMap.get(O);Ni(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,O=I.userID;return E===1&&!c._isNonExistentAccount(O)||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 Ap(E),peerReadTime:I.c2cPeerReadTime,isPinned:I.isPinned===1,customData:I.customMark||"",markList:ps(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 Sl({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:ps(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 O=new qr(E);O.setElement({type:T.MSG_GRP_TIP,content:r(r({},E.elements),{},{groupProfile:E.groupProfile})});var F=JSON.parse(JSON.stringify(O.payload));return O=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 qr&&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),$o(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 O=this._computeRemainingCount({conversationID:h,nextReqMessageID:m}),F=this._completedMap.has(h);if(U.l("".concat(b," conversationID:").concat(h," nextReqMessageID:").concat(m)+" remainingCount:".concat(O," count:").concat(y," isCompleted:").concat(F)),this._needGetHistory({conversationID:h,remainingCount:O,count:y}))return this.getHistoryMessages({conversationID:h,nextReqMessageID:m,count:20}).then(function(ee){var ge=ee.nextReqID,_e=ee.storedMessageList,we=c._completedMap.has(h),Ue=_e;O>0&&(Ue=c._messageListHandler.getLocalMessageList(h).slice(0,_e.length+O));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 q=this._getMessageListFromMemory({conversationID:h,nextReqMessageID:m,count:y});return At(q)}},{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,O={isCompleted:!1,nextReqMessageID:"",messageList:[]};return h?(E=b.findIndex(function(F){return F.ID===h}))>m?(O.messageList=b.slice(E-m,E),O.nextReqMessageID=b[E-m].ID):(O.messageList=b.slice(0,E),O.isCompleted=!0):I>m?(E=I-m,O.messageList=b.slice(E,I),O.nextReqMessageID=b[E].ID):(O.messageList=b.slice(0,I),O.isCompleted=!0),U.l("".concat(y," conversationID:").concat(c)+" ret.nextReqMessageID:".concat(O.nextReqMessageID," ret.isCompleted:").concat(O.isCompleted," ret.length:").concat(O.messageList.length)),O}},{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),O=c.replace(T.CONV_C2C,"");return E.getRoamingMessagesHopping({peerAccount:O,time:m,count:y,direction:I})}if(c.startsWith(T.CONV_GROUP)){var F=this.getModule(It),q=c.replace(T.CONV_GROUP,"");return F.getRoamingMessagesHopping({groupID:q,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),!Td(c)&&!$o(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:""}):be({code:Ae.CANNOT_FIND_MODULE})}if(io(c)){if(!(y=this.getModule(It)))return be({code:Ae.CANNOT_FIND_MODULE});var I=null;this._conversationMap.has(c)&&(I=this._conversationMap.get(c).lastMessage);var E=0;I&&(E=I.lastSequence);var O=this._roamingMessageSequenceMap.get(c);return y.getRoamingMessage({conversationID:c,groupID:c.replace(T.CONV_GROUP,""),count:m,sequence:O||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,O=a.length,F=null,q=m===T.CONV_GROUP,ee=this.getFileDownloadProxy(),ge=function(){E=q?a.length-1:0,O=q?0:a.length},_e=function(){q?--E:++E},we=function(){return q?E>=O:E<O};for(ge();we();_e())if(q&&a[E].sequence===1&&h&&this.setCompleted(c),a[E].isPlaceMessage!==1)if((y=new qr(a[E])).to=a[E].to,m!==T.CONV_GROUP||Ge(a[E].topicID)||(y.to=a[E].topicID),y.isSystemMessage=!!a[E].isSystemMessage,y.conversationType=m,F=a[E].event===4?{type:T.MSG_GRP_TIP,content:r(r({},a[E].elements),{},{groupProfile:a[E].groupProfile})}:a[E].elements,q||y.setNickAndAvatar({nick:a[E].nick,avatar:a[E].avatar}),Ye(F)){var Ue=new We("emptyMessageBody");Ue.setMessage("from:".concat(y.from," to:").concat(y.to," sequence:").concat(y.sequence," event:").concat(a[E].event)),Ue.setNetworkType(this.getNetworkType()).setLevel("warning").end()}else y.setElement(F,ee),y.reInitialize(this.getMyUserID()),b.push(y);return ge=_e=we=null,h?(this._messageListHandler.unshift(b,I),b=null,I):(I=null,b)}},{key:"findMessage",value:function(a){return this._messageListHandler.findMessage(a)}},{key:"_isNotInCommunity",value:function(a){var c=!1;if(a.startsWith(T.CONV_GROUP)&&this._isTopicConversation(a)){var h=Lr(a.replace(T.CONV_GROUP,""));this.getModule(It).hasLocalGroup(h)||(c=!0)}return c}},{key:"deleteTopicRoamingMessageInfo",value:function(a){var c=this;go({groupID:a})&&this._messageListHandler.getTopicConversationIDList(a).forEach(function(h){c._messageListHandler.removeByConversationID(h),c._completedMap.delete(h),c._roamingMessageSequenceMap.delete(h)})}},{key:"deleteGroupRomaingMessageInfo",value:function(a){var c="".concat(T.CONV_GROUP).concat(a);this._messageListHandler.removeByConversationID(c),this._completedMap.delete(c),this._roamingMessageSequenceMap.delete(c)}},{key:"setMessageRead",value:function(a){var c=a.conversationID,h=this.getLocalConversation(c);if(U.l("".concat(this._n,".setMessageRead conversationID:").concat(c," unreadCount:").concat(h?h.unreadCount:0)),!h||(h.type!==T.CONV_GROUP&&h.type!==T.CONV_TOPIC||Ye(h.groupAtInfoList)||this.deleteGroupAtTips(c),h.unreadCount===0))return At();if(h.type===T.CONV_GROUP&&!this._hasLocalGroup(c))return h.unreadCount!==0&&(h.unreadCount=0,this.emitConversationUpdate(!0,!1)),At();var m=this._messageListHandler.getLocalLastMessage(c),y=h.lastMessage.lastTime;m&&y<m.time&&(y=m.time);var b=h.lastMessage.lastSequence;if(m&&b<m.sequence&&(b=m.sequence),h.type===T.CONV_TOPIC&&Ge(m)){var I=this.getModule(ar),E=c.replace(T.CONV_GROUP,""),O=Lr(E),F=I.getLocalTopic(O,E);F&&(b=F.nextMessageSeq-1)}var q=null;switch(h.type){case T.CONV_C2C:return(q=this.getModule(ao))?q.setMessageRead({conversationID:c,lastMessageTime:y}):be({code:Ae.CANNOT_FIND_MODULE});case T.CONV_GROUP:case T.CONV_TOPIC:return(q=this.getModule(It))?q.setMessageRead({conversationID:c,lastMessageSeq:b}):be({code:Ae.CANNOT_FIND_MODULE});case T.CONV_SYSTEM:return h.unreadCount=0,this.emitConversationUpdate(!0,!1),At();default:return At()}}},{key:"setAllMessageRead",value:function(){var a=this,c=arguments.length>0&&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,O=a._handleAllMessageRead(E);return b.setMessage("scope:".concat(c.scope," failureGroups:").concat(JSON.stringify(O))).setNetworkType(a.getNetworkType()).end(),At()}).catch(function(I){return a.probeNetwork().then(function(E){var O=A(E,2),F=O[0],q=O[1];b.setError(I,F,q).end()}),U.w("".concat(m," failed. error:"),I),be({code:I&&I.code?I.code:Ae.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&&h<c.sequence&&(h=c.sequence),h}},{key:"_getConversationLastMessageTime",value:function(a){var c=this._messageListHandler.getLocalLastMessage(a.conversationID),h=a.lastMessage.lastTime;return c&&h<c.time&&(h=c.time),h}},{key:"_createSetAllMessageReadPack",value:function(a){var c,h={readAllC2CMessage:0,groupMessageReadInfoList:[]},m=a.scope,y=G(this._conversationMap);try{for(y.s();!(c=y.n()).done;){var b=A(c.value,2)[1];if(b.unreadCount>0){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<m;h++){var y=a[h],b=y.groupID,I=y.sequence,E=y.retCode,O=y.lastMessageSeq;Ge(E)?this._remoteGroupReadSequenceMap.set(b,O):(this._remoteGroupReadSequenceMap.set(b,I),E!==0&&c.push("".concat(b,"-").concat(I,"-").concat(E)))}return c}},{key:"_updateAllConversationUnreadCount",value:function(a){var c,h=a.readAllC2CMessage,m=0,y=G(this._conversationMap);try{for(y.s();!(c=y.n()).done;){var b=A(c.value,2),I=b[0],E=b[1];if(E.unreadCount>=1){if(h===1&&E.type===T.CONV_C2C){var O=this._getConversationLastMessageTime(E);this.updateIsReadAfterReadReport({conversationID:I,lastMessageTime:O})}else if(E.type===T.CONV_GROUP){var F=I.replace(T.CONV_GROUP,"");if(this._remoteGroupReadSequenceMap.has(F)){var q=this._remoteGroupReadSequenceMap.get(F),ee=this._getConversationLastMessageSequence(E);this.updateIsReadAfterReadReport({conversationID:I,remoteReadSequence:q}),ee>=q&&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(q){return!q.isRead&&!q._onlineOnlyFlag&&!q.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,O=this.getModule(ar),F=a.replace(T.CONV_GROUP,"");O.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(ar),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 O="".concat(T.CONV_GROUP).concat(b);I.forEach(function(q){var ee=q.tinyID,ge=q.clientTime,_e=q.random,we=q.readCount,Ue=q.unreadCount,qe="".concat(ee,"-").concat(ge,"-").concat(_e),nt=c._messageListHandler.getLocalMessage(O,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(q){var ee=q.tinyID,ge=q.clientTime,_e=q.random,we="".concat(ee,"-").concat(ge,"-").concat(_e),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(L.MESSAGE_READ_RECEIPT_RECEIVED,E)}}},{key:"updateIsRead",value:function(a){var c=this.getLocalConversation(a),h=this.getLocalMessageList(a);if(c&&h.length!==0&&!Td(c.type)){for(var m=[],y=0,b=h.length;y<b;y++)h[y].flow!=="in"?h[y].flow!=="out"||h[y].isRead||h[y].setIsRead(!0):m.push(h[y]);var I=0;if(c.type===T.CONV_C2C){var E=m.slice(-c.unreadCount).filter(function(F){return F.isRevoked}).length;I=m.length-c.unreadCount-E}else I=m.length-c.unreadCount;for(var O=0;O<I&&!m[O].isRead;O++)m[O].setIsRead(!0)}}},{key:"deleteGroupAtTips",value:function(a){var c=this,h="".concat(this._n,".deleteGroupAtTips");U.l("".concat(h));var m=this._conversationMap.get(a);if(!m)return Promise.resolve();var y=m.groupAtInfoList;if(y.length===0)return Promise.resolve();var b=void 0;a.startsWith(T.CONV_GROUP)&&(b=a.replace(T.CONV_GROUP,""));var I=N(y);if((go({groupID:b})||oo(b))&&(I=y.filter(function(O){return!O.atTypeArray.includes(T.CONV_AT_ALL)})).length===0)return this.clearGroupAtInfoList(a,!1),Promise.resolve();var E=this.getMyUserID();return this.request({protocolName:r_,requestData:{messageListToDelete:I.map(function(O){return{from:O.from,to:E,messageSeq:O.__sequence,messageRandom:O.__random,groupID:Ge(O.topicID)?O.groupID:O.topicID}})}}).then(function(){return U.l("".concat(h," ok. count:").concat(y.length)),c.clearGroupAtInfoList(a,!1),Promise.resolve()}).catch(function(O){return U.e("".concat(h," failed. error:"),O),be(O)})}},{key:"appendToMessageList",value:function(a){return this._messageListHandler.pushIn(a)}},{key:"setMessageRandom",value:function(a){this.singlyLinkedList.set(a.random)}},{key:"deleteMessageRandom",value:function(a){this.singlyLinkedList.delete(a.random)}},{key:"pushIntoMessageList",value:function(a,c,h){return!(!this._messageListHandler.pushIn(c,h)||this._isMessageFromCurrentInstance(c)&&!h)&&(a.push(c),!0)}},{key:"_isMessageFromCurrentInstance",value:function(a){return this.singlyLinkedList.has(a.random)}},{key:"revoke",value:function(a,c,h){return this._messageListHandler.revoke(a,c,h)}},{key:"getPeerReadTime",value:function(a){return this._peerReadTimeMap.get(a)}},{key:"recordPeerReadTime",value:function(a,c){this._peerReadTimeMap.has(a)?this._peerReadTimeMap.get(a)<c&&this._peerReadTimeMap.set(a,c):this._peerReadTimeMap.set(a,c)}},{key:"updateMessageIsPeerReadProperty",value:function(a,c){if(a.startsWith(T.CONV_C2C)&&c>0){var h=this._messageListHandler.updateMessageIsPeerReadProperty(a,c);if(h.length>0&&this.emitOuterEvent(L.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 O=A(E,2),F=O[0],q=O[1];y.setError(I,F,q).end()}),U.e("".concat(h," failed. error:"),I),be(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(It);return!a||a.isPagingGetCompleted()}},{key:"_getLocalGroupCount",value:function(){var a=this.getModule(It);return a?a.getLocalGroupList().length:0}},{key:"_hasLocalGroup",value:function(a){var c=this.getModule(It);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 O=I.getFriendRemark(E);c.remark!==O&&(c.remark=O,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),O=E[0],F=E[1];y.setError(b,O,F).setMessage("conversationID:".concat(a)).end()}),U.e("".concat(m," failed. error:"),b),be(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?be(new Un({code:Ae.USER_OR_GRP_NOT_FOUND})):(a.userProfile=m[0],a._isInfoCompleted=!0,c._unshiftConversation(a),At({conversation:a}))}):this.getModule(It).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(N(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)||Td(a)}},{key:"deleteConversation",value:function(a){var c=this,h="deleteConversation";return Et(a)||Zi(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,O="".concat(this._n,".").concat("deleteConversationList");U.l("".concat(O," 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(q){F.setNetworkType(c.getNetworkType()).end();var ee=[].concat(N(q[0]),N(q[1]));return ee.length===0?be(new Un({code:Ae.CONV_NOT_FOUND})):(U.l("".concat(O," ok")),At(E===1?{conversationID:ee[0]}:{conversationIDList:ee}))}).catch(function(q){return c.probeNetwork().then(function(ee){var ge=A(ee,2),_e=ge[0],we=ge[1];F.setError(q,_e,we).end()}),U.e("".concat(O," failed. error:"),q),be(q)})}},{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(It).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:e_,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 be({code:Ae.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 be({code:Ae.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(It).deleteGroupSystemNotice({messageList:this._messageListHandler.getLocalMessageList(a)}),At({conversationID:a})):be({code:Ae.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:t_,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 O=A(E,2),F=O[0],q=O[1];b.setError(I,F,q).end()}),U.e("".concat(y," failed. error:"),I),be(I)})}},{key:"pinConversation",value:function(a){var c=this,h=a.conversationID,m=a.isPinned;if(!this._conversationMap.has(h))return be({code:Ae.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:n_,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(O){return c.probeNetwork().then(function(F){var q=A(F,2),ee=q[0],ge=q[1];I.setError(O,ee,ge).end()}),U.e("".concat(b," failed. error:"),O),be(O)})}},{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),O=0;c.patchMessageRemindType({ID:b,isC2CConversation:!0,messageRemindType:E})&&(O+=1),U.l("".concat(h," updateCount:").concat(O)),O>=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=N(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(It)),h?h.sendReadReceipt(a):be({code:Ae.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(It)),h?h.getReadReceiptList(a):be({code:Ae.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(L.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),b6=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(L.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(q,ee){var ge=Cd(c[q]);if(a===6&&(p._groupModule.isGroupAttributesUpdatedNotice(ge)||p._groupModule.isGroupCountersNotice(ge)))return"continue";var _e=ge.groupProfile,we=_e.groupID,Ue=_e.communityType,qe=Ue===void 0?0:Ue,nt=_e.topicID,mt=nt===void 0?void 0:nt,xt=_e.invisible,gn=void 0,_n=p._groupModule.isMessageFromTopic(qe,mt);if(_n){gn=T.CONV_TOPIC,ge.to=mt;var Or=p._groupModule.getModule(ar);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 qr(ge)).setElement({type:T.MSG_GRP_TIP,content:r(r({},ge.elements),{},{groupProfile:ge.groupProfile})}),h.isSystemMessage=!1,xt===1)return p._qualityStat(h),"continue";var Ho=p._groupModule.getModule(ct),oi=h,vo=oi.conversationID,es=oi.sequence;if(a===6)h._onlineOnlyFlag=!0,y.push(h);else if(!Ho.pushIntoNoticeResult(y,h))return"continue";if(p._groupModule.isMessageFromCommunityOfTopic(qe,mt)||a===6&&Ho.getLocalConversation(vo))return"continue";a!==6&&p._qualityStat(h);var Mi=Ho.isRemoteRead({conversationID:vo,sequence:es});if(Ge(b[vo])){var gs=0;h.flow==="in"&&(h._isExcludedFromUnreadCount||h._onlineOnlyFlag||Mi||(gs=1)),b[vo]=m.push({conversationID:vo,unreadCount:gs,type:Ge(gn)?h.conversationType:gn,subType:h.conversationSubType,lastMessage:h._isExcludedFromLastMessage?"":h})-1}else{var xs=b[vo];m[xs].type=h.conversationType,m[xs].subType=h.conversationSubType,m[xs].lastMessage=h._isExcludedFromLastMessage?"":h,h.flow==="in"&&(h._isExcludedFromUnreadCount||h._onlineOnlyFlag||Mi||m[xs].unreadCount++)}},O=0,F=c.length;O<F;O++)E(O);return{eventDataList:m,result:y,AVChatRoomMessageList:I}}},{key:"_qualityStat",value:function(l){this._groupModule.getModule(Bo).addMessageSequence({key:Ld,message:l})}},{key:"handleMessageList",value:function(l){var p=this;l.forEach(function(a){switch(a.payload.operationType){case 1:p._onNewMemberComeIn(a);break;case 2:p._onMemberQuit(a);break;case 3:p._onMemberKickedOut(a);break;case 4:p._onMemberSetAdmin(a);break;case 5:p._onMemberCancelledAdmin(a);break;case 6:p._onGroupProfileModified(a);break;case 7:p._onMemberInfoModified(a);break;case 8:p._onTopicProfileUpdated(a);break;default:U.w("".concat(p._n,".handleMessageList unknown operationType:").concat(a.payload.operationType))}})}},{key:"_onNewMemberComeIn",value:function(l){var p=l.payload,a=p.memberNum,c=p.groupProfile.groupID,h=this._groupModule.getLocalGroupProfile(c);h&&un(a)&&h.memberCount!==a&&(h.memberCount=a,this._updateConversationGroupProfile(h))}},{key:"_onMemberQuit",value:function(l){var p=l.payload,a=p.memberNum,c=p.groupProfile.groupID,h=this._groupModule.getLocalGroupProfile(c);h&&un(a)&&h.memberCount!==a&&(h.memberCount=a,this._updateConversationGroupProfile(h)),this._groupModule.getGroupMemberHandler().deleteLocalGroupMembers(c,l.payload.userIDList)}},{key:"_onMemberKickedOut",value:function(l){var p=l.payload,a=p.memberNum,c=p.groupProfile.groupID,h=this._groupModule.getLocalGroupProfile(c);h&&un(a)&&h.memberCount!==a&&(h.memberCount=a,this._updateConversationGroupProfile(h)),this._groupModule.getGroupMemberHandler().deleteLocalGroupMembers(c,l.payload.userIDList)}},{key:"_updateConversationGroupProfile",value:function(l){this._groupModule.getModule(ct).updateConversationGroupProfile([l])}},{key:"_onMemberSetAdmin",value:function(l){var p=l.payload.groupProfile.groupID,a=l.payload.userIDList,c=this._groupModule.getGroupMemberHandler();a.forEach(function(h){var m=c.getLocalGroupMemberInfo(p,h);m&&m.updateRole(T.GRP_MBR_ROLE_ADMIN)})}},{key:"_onMemberCancelledAdmin",value:function(l){var p=l.payload.groupProfile.groupID,a=l.payload.userIDList,c=this._groupModule.getGroupMemberHandler();a.forEach(function(h){var m=c.getLocalGroupMemberInfo(p,h);m&&m.updateRole(T.GRP_MBR_ROLE_MEMBER)})}},{key:"_onGroupProfileModified",value:function(l){var p=this,a=l.payload,c=a.newGroupProfile,h=a.groupProfile.groupID,m=this._groupModule.getLocalGroupProfile(h);Object.keys(c).forEach(function(b){switch(b){case"ownerID":p._ownerChanged(m,c);break;case"groupName":m.name=c[b];break;default:m[b]=c[b]}});var y=!m.isSupportTopic;this._groupModule.emitGroupListUpdate(!0,y)}},{key:"_ownerChanged",value:function(l,p){var a=l.groupID,c=this._groupModule.getLocalGroupProfile(a),h=this._groupModule.getMyUserID();if(h===p.ownerID){c.updateGroup({selfInfo:{role:T.GRP_MBR_ROLE_OWNER}});var m=this._groupModule.getGroupMemberHandler(),y=m.getLocalGroupMemberInfo(a,h),b=this._groupModule.getLocalGroupProfile(a).ownerID,I=m.getLocalGroupMemberInfo(a,b);y&&y.updateRole(T.GRP_MBR_ROLE_OWNER),I&&I.updateRole(T.GRP_MBR_ROLE_MEMBER)}}},{key:"_onMemberInfoModified",value:function(l){var p=l.to,a=l.payload,c=a.groupProfile,h=a.memberList,m=c.groupID;oo(p)&&this._updateTopicMuteTime(l);var y=this._groupModule.getGroupMemberHandler();h.forEach(function(b){var I=y.getLocalGroupMemberInfo(m,b.userID);I&&un(b.muteTime)&&I.updateMuteUntil(b.muteTime)})}},{key:"_updateTopicMuteTime",value:function(l){var p=l.to,a=l.payload,c=a.groupProfile,h=a.memberList,m=h===void 0?[]:h,y=this._groupModule.getModule(ar),b=c.groupID,I=y.getLocalTopic(b,p);if(I){for(var E=!1,O=0;O<m.length;O++){var F=m[O];if(F.userID===this._groupModule.getMyUserID()&&F.muteTime>=0){I.updateSelfInfo({muteTime:F.muteTime}),E=!0;break}}E&&this._groupModule.emitOuterEvent(L.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(ar).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}(),M6=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(rr.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;y<b;y++)(a=l[y]).type===T.CONV_GROUP&&(c=a.conversationID.split(/^GROUP/)[1],(h=this._groupModule.getLocalGroupProfile(c))&&(h.lastMessage=r({},a.lastMessage),m=!0));U.l("".concat(p," groupUpdated:").concat(m)),m&&(this._groupModule.sortLocalGroupList(),this._groupModule.emitGroupListUpdate(!0,!1))}else this.tempConversationList=l}},{key:"onNewGroupMessage",value:function(l){U.d("".concat(this._n,".onNewGroupMessage count:").concat(l.dataList.length));var p=this._newGroupMessageStoredAndSummary(l),a=p.conversationOptionsList,c=p.messageList,h=p.AVChatRoomMessageList;h.length>0&&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(L.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={},O=this._groupModule.getFileDownloadProxy(),F=a.length;F>1&&a.sort(function(we,Ue){return we.sequence-Ue.sequence});for(var q=this._groupModule.getModule(ct),ee=this._groupModule.getModule(pr),ge=function(we){var Ue=Cd(a[we]),qe=Ue.groupProfile,nt=qe.groupID,mt=qe.communityType,xt=mt===void 0?0:mt,gn=qe.topicID,_n=gn===void 0?void 0:gn,Or=qe.invisible,lo=void 0,Ho=p._groupModule.isMessageFromTopic(xt,_n);if(Ho){lo=T.CONV_TOPIC,Ue.to=_n;var oi=p._groupModule.getModule(ar);oi.hasLocalTopic(nt,_n)||p._getTopicPendingMap.has(_n)||(p._getTopicPendingMap.set(_n,1),oi.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&&!Ho)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 qr(Ue)).setElement(Ue.elements,O),Or===1)return p._qualityStat(h,m),"continue";var es=a[we].isModified===1;if(q.isMessageSentByCurrentInstance(m)?m.isModified=es:es=!1,Ue.onlineOnlyFlag===1)m._onlineOnlyFlag=!0,q.isMessageSentByCurrentInstance(m)||b.push(m);else{if(p._groupModule.isMessageFromCommunityOfTopic(xt,_n))return b.push(m),"continue";if(m.from===p._groupModule.getMyUserID()){var Mi=q.getLatestMessageSentByMe(m.conversationID);if(Mi){var gs=Mi.nick,xs=Mi.avatar;gs===m.nick&&xs===m.avatar||(q.modifyMessageSentByMe({conversationID:kl,latestNick:m.nick,latestAvatar:m.avatar}),ee.mockOnNickAvatarModified(m.nick,m.avatar))}}if(!q.pushIntoMessageList(b,m,es))return"continue";p._qualityStat(h,m);var Od=m,kl=Od.conversationID,_1=Od.sequence,Rd=q.isRemoteRead({conversationID:kl,sequence:_1});if(Ge(E[kl])){var lm=0;m.flow==="in"&&(m._isExcludedFromUnreadCount||Rd||(lm=1)),E[kl]=y.push({conversationID:kl,unreadCount:lm,type:Ge(lo)?m.conversationType:lo,subType:m.conversationSubType,lastMessage:m._isExcludedFromLastMessage?"":m})-1}else{var Ui=E[kl];y[Ui].type=Ge(lo)?m.conversationType:lo,y[Ui].subType=m.conversationSubType,y[Ui].lastMessage=m._isExcludedFromLastMessage?"":m,m.flow==="in"&&(m._isExcludedFromUnreadCount||Rd||y[Ui].unreadCount++)}}},_e=0;_e<F;_e++)ge(_e);return{conversationOptionsList:y,messageList:b,AVChatRoomMessageList:I}}},{key:"_qualityStat",value:function(l,p){var a=this._groupModule.getModule(Bo);a.addMessageSequence({key:Ld,message:p}),l&&p.clientTime>0&&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 O={conversationID:I,to:b.topicID||"",sequence:b.sequence,time:b.time,revoker:E};p.isLastMessageRevoked(O)&&(a.push(O),h=!1)}})}),a.length!==0&&(p.onMessageRevoked(a),h===!0&&(U.l("".concat(this._n,".onGroupMessageRevoked count:").concat(a.length)),this._groupModule.emitOuterEvent(L.MESSAGE_REVOKED,a)))}},{key:"_groupListTreeShaking",value:function(l){for(var p=new Map(N(this._groupModule.getGroupMap())),a=0,c=l.length;a<c;a++)p.delete(l[a].groupID);this._groupModule.hasJoinedAVChatRoom()&&this._groupModule.getJoinedAVChatRoom().forEach(function(b){p.delete(b)}),this._groupModule.getGroupMap().forEach(function(b,I){b.isSupportTopic&&p.delete(I)});for(var h=N(p.keys()),m=0,y=h.length;m<y;m++)this._groupModule.deleteGroup(h[m])}},{key:"syncGroupList",value:function(){var l=this,p=arguments.length>0&&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=dp(l._pagingGetCostList),O=hs(l._pagingGetCostList);l._pagingGetCostList.length=0,l._pagingStatus=Tr.RESOLVED,l._groupListTreeShaking(m),l._groupModule.updateGroupMap(m);var F=l._groupModule.getLocalGroupList().length,q="count:".concat(F," sum:").concat(O," avg:").concat(E);return U.l("".concat(b," ok. ").concat(q)),I.setNetworkType(l._groupModule.getNetworkType()).setMessage(q).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(O){var F=A(O,2),q=F[0],ee=F[1];I.setError(E,q,ee).end()}),U.e("".concat(b," failed. error:"),E),be(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),be(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(O){var F=O.data,q=F.groups,ee=q===void 0?[]:q,ge=F.totalCount;I.push.apply(I,N(ee)),p._handleGroupAtInfoWithoutTopic(h,ee);var _e=y+m,we=!(ge>_e),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=_e,p._pagingGetGroupList({limit:m,offset:y,groupBaseInfoFilter:b,groupList:I,isCommunityRelay:!0})):ht({groupList:I}):(y=_e,p._pagingGetGroupList({limit:m,offset:y,groupBaseInfoFilter:b,groupList:I}))}).catch(function(O){return O.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?(O.code===11e3&&U.l("".concat(a," ok. community unavailable")),At({groupList:I})):be(O)})}},{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,O=E.groups,F=O===void 0?[]:O,q=E.totalCount;y.push.apply(y,N(F));var ee=h+c,ge=!(q>ee);if(U.l("".concat(a," ok. offset:").concat(h," limit:").concat(c," totalCount:").concat(q," 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 _e=p._groupModule.getLocalGroupList().filter(function(we){return we.isSupportTopic===!0});return ht({groupList:_e})}).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})):be(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}(),Pw=1,I6=2,xw=3,Uw=4,Fw=5,C6=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(rr.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 O=this._getLocalGroupAttributes(a).avChatRoomKey;this._getGroupAttributes({groupID:a,avChatRoomKey:O}).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,O=E.mainSequence,F=N(E.groupAttributeList);return F.forEach(function(q){q.value=c[q.key]}),p._groupAttributesCopy=p._getCachedAttributes({groupID:a}),p._refreshCachedGroupAttributes({groupID:a,remoteMainSequence:O,groupAttributeList:F,operationType:Pw}),p._emitGroupAttributesUpdated(a),b.setNetworkType(p._groupModule.getNetworkType()).end(),ht({groupAttributes:c})}).catch(function(I){return p._groupModule.probeNetwork().then(function(E){var O=A(E,2),F=O[0],q=O[1];b.setError(I,F,q).end()}),be(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 q=F.key;F.sequence=0,I.has(q)&&(F.sequence=I.get(q).sequence)});var O=new We("setGroupAttributes");return O.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 q=F.data,ee=q.mainSequence,ge=N(q.groupAttributeList);return ge.forEach(function(_e){_e.value=h[_e.key]}),p._groupAttributesCopy=p._getCachedAttributes({groupID:c}),p._refreshCachedGroupAttributes({groupID:c,remoteMainSequence:ee,groupAttributeList:ge,operationType:I6}),p._emitGroupAttributesUpdated(c),O.setNetworkType(p._groupModule.getNetworkType()).end(),ht({groupAttributes:h})}).catch(function(F){return p._groupModule.probeNetwork().then(function(q){var ee=A(q,2),ge=ee[0],_e=ee[1];O.setError(F,ge,_e).end()}),be(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=N(I.keys()),O=Vg,F=xw,q={groupID:a,avChatRoomKey:b,mainSequence:y},ee=[];h.length>0&&(E=[],O=qg,F=Uw,h.forEach(function(_e){var we=0;I.has(_e)&&(we=I.get(_e).sequence,E.push(_e)),ee.push({key:_e,sequence:we})}),q.groupAttributeList=ee);var ge=new We("deleteGroupAttributes");return ge.setMessage("groupID:".concat(a," mainSequence:").concat(y," keyList:").concat(h," protocolName:").concat(O)),this._groupModule.request({protocolName:O,requestData:q}).then(function(_e){U.l("".concat(p._n,".").concat("deleteGroupAttributes"," ok. groupID:").concat(a));var we=_e.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(_e){return p._groupModule.probeNetwork().then(function(we){var Ue=A(we,2),qe=Ue[0],nt=Ue[1];ge.setError(_e,qe,nt).end()}),be(_e)})}},{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||b<I)return this._getGroupAttributes({groupID:c,avChatRoomKey:m}).then(function(F){E.setMoreMessage("get attributes from remote. count:".concat(F.length)).setNetworkType(p._groupModule.getNetworkType()).end(),U.l("".concat(a," from remote. groupID:").concat(c));var q=p._getCachedAttributes(l);return ht({groupAttributes:q})}).catch(function(F){return p._groupModule.probeNetwork().then(function(q){var ee=A(q,2),ge=ee[0],_e=ee[1];E.setError(F,ge,_e).end()}),be(F)});E.setMoreMessage("get attributes from cache").setNetworkType(this._groupModule.getNetworkType()).end(),U.l("".concat(a," from cache. groupID:").concat(c));var O=this._getCachedAttributes(l);return At({groupAttributes:O})}},{key:"_getGroupAttributes",value:function(l){var p=this,a=0;return Ge(l.avChatRoomKey)||(a=1),this._groupModule.request({protocolName:zg,requestData:r(r({},l),{},{groupType:a})}).then(function(c){U.l("".concat(p._n,"._getGroupAttributes ok. groupID:").concat(l.groupID));var h=c.data,m=h.mainSequence,y=h.groupAttributeList,b=N(y);return Ge(m)||p._refreshCachedGroupAttributes({groupID:l.groupID,remoteMainSequence:m,groupAttributeList:b,operationType:Fw}),y}).catch(function(c){return be(c)})}},{key:"_refreshCachedGroupAttributes",value:function(l){var p=l.groupID,a=l.remoteMainSequence,c=l.groupAttributeList,h=l.operationType;if(this._hasLocalGroupAttributes(p)){var m=this._getLocalGroupAttributes(p),y=m.localMainSequence;if(h===Fw||a-y==1)m.remoteMainSequence=a,m.localMainSequence=a,m.lastUpdateTime=Date.now(),this._updateCachedAttributes({groupAttributes:m,groupAttributeList:c,operationType:h});else{if(y===a)return;m.remoteMainSequence=a}this._groupAttributesMap.set(p,m);var b="operationType:".concat(h," localMainSequence:").concat(y," remoteMainSequence:").concat(a);U.l("".concat(this._n,"._refreshCachedGroupAttributes. ").concat(b))}}},{key:"_getCachedAttributes",value:function(l){var p=l.groupID,a=l.keyList,c=a===void 0?[]:a,h={};if(this._hasLocalGroupAttributes(p)){var m=this._getLocalGroupAttributes(p).attributes;if(c.length>0)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!==xw?c!==Uw?(c===Pw&&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(L.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}(),T6="Set",w6="Increase",S6="Decrease",k6=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(rr.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(L.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(me.GRP_COUNTER))return be({code:Ae.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:T6}).then(function(E){return I.end(),U.l("".concat(a," ok.")),ht({counters:E})}).catch(function(E){return p._groupModule.probeNetwork().then(function(O){var F=A(O,2),q=F[0],ee=F[1];I.setError(E,q,ee).end()}),U.e("".concat(a," failed. error:"),E),be(E)})}},{key:"increaseGroupCounter",value:function(l){var p=this;if(!this._groupModule.canIUse(me.GRP_COUNTER))return be({code:Ae.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:w6}).then(function(O){return I.end(),U.l("".concat(a," ok.")),ht({counters:O})}).catch(function(O){return p._groupModule.probeNetwork().then(function(F){var q=A(F,2),ee=q[0],ge=q[1];I.setError(O,ee,ge).end()}),U.e("".concat(a," failed. error:"),O),be(O)})}},{key:"decreaseGroupCounter",value:function(l){var p=this;if(!this._groupModule.canIUse(me.GRP_COUNTER))return be({code:Ae.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:S6}).then(function(O){return I.end(),U.l("".concat(a," ok.")),ht({counters:O})}).catch(function(O){return p._groupModule.probeNetwork().then(function(F){var q=A(F,2),ee=q[0],ge=q[1];I.setError(O,ee,ge).end()}),U.e("".concat(a," failed. error:"),O),be(O)})}},{key:"getGroupCounters",value:function(l){var p=this;if(!this._groupModule.canIUse(me.GRP_COUNTER))return be({code:Ae.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 q=p._getLocalCounters(c,m);return ht({counters:q})}).catch(function(F){return p._groupModule.probeNetwork().then(function(q){var ee=A(q,2),ge=ee[0],_e=ee[1];E.setError(F,ge,_e).end()}),be(F)});E.setMoreMessage("from cache").end(),U.l("".concat(a," from cache. groupID:").concat(c));var O=this._getLocalCounters(c,m);return At({counters:O})}},{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 be(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,O=I.value;b[E]=O}),b}).catch(function(m){return be(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&&h<I)return;c.forEach(function(E){var O=E.key,F=E.value;y.set(O,F)}),this._groupCountersMap.set(p,{lastUpdateTime:Date.now(),groupCounterSeq:h,counters:y,avChatRoomKey:b})}}},{key:"_deleteLocalGroupCounters",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;c.forEach(function(I){y.delete(I.key)}),this._groupCountersMap.set(p,{lastUpdateTime:Date.now(),groupCounterSeq:h,counters:y,avChatRoomKey:b})}}},{key:"_getLocalCounters",value:function(l,p){var a={};if(!this._hasLocalGroupCounters(l))return a;var c=this._getLocalGroupCounters(l).counters;if(p.length>0)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}(),D6=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=Sw),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}(),Gw={3:!0,4:!0,5:!0,6:!0,17:!0},E6=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 c1(200),this.messageIDLinkedList=new c1(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?N(this._joinedGroupMap.keys()):[]}},{key:"_updateRequestData",value:function(l){var p=this._pollingRequestInfoMap.get(l);return l===N(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),O=new We("longPollingAVError"),F=E?"".concat(E.key,"-").concat(E.startSeq):"requestInfo is undefined";O.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(q){q.to=q.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(Bo),m=l.length;m>1&&l.sort(function(qe,nt){return qe.sequence-nt.sequence});for(var y=this._getModule(pn),b=0;b<m;b++){var I=this.restoreMessageFromSimplified(l[b]);if(Gw[I.event]){if(I.event===6&&(this._groupModule.isGroupAttributesUpdatedNotice(I)||this._groupModule.isGroupCountersNotice(I)))continue;this.receivedMessageCount+=1,p=this.packMessage(I,I.event);var E=I.isModified===1,O=I.isHistoryMessage===1;if((y.isUnlimitedAVChatRoom()||!this.sequencesLinkedList.has(p.sequence))&&!this.messageIDLinkedList.has(p.ID)){var F=p.conversationID;if(this.receivedMessageCount%50==0?this._getModule(mp).detectFirstRound(F,this.sequencesLinkedList.data()):this.receivedMessageCount%80==0&&this._getModule(mp).detectSecondRound(F,this.sequencesLinkedList.data()),this.sequencesLinkedList.tail()!==null){var q=this.sequencesLinkedList.tail().value,ee=p.sequence-q;ee>1&&ee<=20?this._getModule(mp).onMessageMaybeLost(F,q+1,ee-1):ee<-1&&ee>=-20&&this._getModule(mp).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),!O&&p.conversationType!==T.CONV_SYSTEM){var _e=p.conversationID.replace(T.CONV_GROUP,"");this._pollingInstanceMap.has(_e)?this._groupModule.isLoggedIn()&&h.addMessageSequence({key:Ep,message:p}):(p.type!==T.MSG_GRP_TIP&&p.clientTime>0&&h.addMessageDelay(p.clientTime),h.addMessageSequence({key:Dp,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(L.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,O=a.nick,F=O===void 0?"":O;l.operatorInfo={userID:b,avatar:E,nick:F};var q=m.map(function(ee){return{userID:ee}});return l.memberInfoList=l.memberInfoList||q,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 q=F.content,ee=q===void 0?{}:q;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 O=Object.keys(l.elements).filter(function(F){return F!=="operatorInfo"}).reduce(function(F,q){return r(r({},F),{},d({},q,l.elements[q]))},{});l.elements=O}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(N(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 qr(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;a<l.length;a++){var c=l[a],h=c.conversationID;if(p.has(h)){var m=p.get(h);m.lastMessage=c,c.flow==="in"&&m.unreadCount++}else p.set(h,{conversationID:c.conversationID,unreadCount:c.flow==="out"?0:1,type:c.conversationType,subType:c.conversationSubType,lastMessage:c})}return N(p.values())}},{key:"_updateMemberCountByGroupTips",value:function(l){var p=l.groupProfile.groupID,a=l.elements.onlineMemberInfo,c=a===void 0?void 0:a;if(!Ye(c)){var h=c.onlineMemberNum,m=h===void 0?0:h,y=c.expireTime,b=y===void 0?this.DEFAULT_EXPIRE_TIME:y,I=this._onlineMemberCountMap.get(p)||{},E=Date.now();Ye(I)?Object.assign(I,{lastReqTime:0,lastSyncTime:0,latestUpdateTime:E,memberCount:m,expireTime:b}):(I.latestUpdateTime=E,I.memberCount=m),U.d("".concat(this._n,"._updateMemberCountByGroupTips info:"),I),this._onlineMemberCountMap.set(p,I)}}},{key:"_onBroadcastMessage",value:function(l){if(!Ye(l)){for(var p=[],a=l.length,c=null,h=0;h<a;h++){var m=this.restoreMessageFromSimplified(l[h]);Gw[m.event]?((c=this.packMessage(m,m.event)).isBroadcastMessage=!0,this._broadcastMessageIDMap.has(c.ID)||(p.push(c),this._broadcastMessageIDMap.set(c.ID,1))):U.w("".concat(this._n,"._onBroadcastMessage unknown event:").concat(m.event))}p.length>0&&this._groupModule.emitOuterEvent(L.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 D6({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:Xi,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:Xi,group:c}):At({status:Xi})})}},{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:ww,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 O=E[1];h.setNetworkType(O).setMessage("groupID:".concat(a," longPollingKey:").concat(y)).end(!0)}),Ge(y))return be({code:Ae.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 Sl({groupID:a});return p.startRunLoop({group:b,longPollingKey:y}),ht({status:Xi})}).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)}),be(m)}).finally(function(){p._groupModule.getModule(M0).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 be(c)})):At({memberCount:p.memberCount})}},{key:"_getGroupOnlineMemberCount",value:function(l){var p=this,a="".concat(this._n,".").concat("_getGroupOnlineMemberCount");return this._groupModule.request({protocolName:I_,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 O=Date.now();return Ye(h)&&(h.lastReqTime=O),p._onlineMemberCountMap.set(l,Object.assign(h,{lastSyncTime:O,latestUpdateTime:O,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}(),A6=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&&xu(this.memberCustomField,l.memberCustomField),Ni(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&&xu(this.memberCustomField,l)}}]),k}(),L6=function(){function k(l){i(this,k),this._groupModule=l,this._n="GroupMemberHandler",this.groupMemberListMap=new Map,this._groupModule.getInnerEmitterInstance().on(rr.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;h<a.length;h++)c(h)}},{key:"deleteGroupMemberList",value:function(l){this.groupMemberListMap.delete(l)}},{key:"getGroupMemberList",value:function(l){var p=this,a=l.groupID,c=l.offset,h=c===void 0?0:c,m=l.count,y=m===void 0?15:m,b=l.filter,I=b===void 0?void 0:b,E="".concat(this._n,".").concat("getGroupMemberList"),O=this._groupModule.hasLocalGroup(a);if(U.l("".concat(E," groupID:").concat(a," offset:").concat(h," count:").concat(y," hasLocalGroup:").concat(O)),!O)return At({memberList:[],offset:0});if(this._groupModule.getLocalGroupProfile(a).type===T.GRP_AVCHATROOM){if(this._groupModule.canIUse(me.AVCHATROOM_MBR_LIST))return this._getAVChatRoomMemberList({groupID:a,offset:h,filter:I});this._groupModule.outputWarning("LiveOnlineMember")}var F=new We("getGroupMemberList"),q=0,ee={groupID:a,limit:y>100?100:y};go({groupID:a})?ee.next="".concat(h):(ee.offset=h,q=h+y);var ge=[];return this._groupModule.request({protocolName:w_,requestData:ee}).then(function(_e){var we=_e.data,Ue=we.members,qe=we.memberNum,nt=we.next,mt=nt===void 0?void 0:nt;return Ge(mt)||(q=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(xt){return xt.userID}),tagList:[Gt.NICK,Gt.AVATAR]})):(q=0,Promise.resolve([]))}).then(function(_e){var we=_e.data;if(!rt(we)||we.length===0)return At({memberList:[],offset:q});var Ue=we.map(function(qe){return{userID:qe.userID,nick:qe.nick,avatar:qe.avatar}});return p._updateLocalGroupMemberMap(a,Ue),ge.length<y&&(q=0),F.setNetworkType(p._groupModule.getNetworkType()).setMessage("groupID:".concat(a," offset:").concat(h," count:").concat(y)).end(),U.l("".concat(E," ok.")),ht({memberList:ge,offset:q})}).catch(function(_e){return p._groupModule.probeNetwork().then(function(we){var Ue=A(we,2),qe=Ue[0],nt=Ue[1];F.setError(_e,qe,nt).end()}),U.e("".concat(E," failed. error:"),_e),be(_e)})}},{key:"_getAVChatRoomMemberList",value:function(l){var p=this,a=l.groupID,c=l.offset,h=l.filter,m="".concat(this._n,".").concat("_getAVChatRoomMemberList"),y=new We("_getAVChatRoomMemberList");return y.setMessage("groupID:".concat(a," offset:").concat(c," filter:").concat(h)),this._groupModule.request({protocolName:Jg,requestData:{groupID:a,offset:c,filter:h}}).then(function(b){var I=b.data,E=I.memberList,O=E===void 0?[]:E,F=I.offset,q=F===void 0?0:F;y.setNetworkType(p._groupModule.getNetworkType()).end(),U.l("".concat(m," ok. member count:").concat(O.length,", next request timestamp:").concat(q));var ee=p._updateLocalGroupMemberMap(a,O);return ht({memberList:ee,offset:q})}).catch(function(b){return p._groupModule.probeNetwork().then(function(I){var E=A(I,2),O=E[0],F=E[1];y.setError(b,O,F).end()}),U.e("".concat(m," failed. error:"),b),be(b)})}},{key:"getGroupMemberProfile",value:function(l){var p=this,a="".concat(this._n,".").concat("getGroupMemberProfile"),c=new We("getGroupMemberProfile");c.setMessage(l.userIDList.length>5?"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)),$o(m)){var b=new Un({code:Ae.CANNOT_ADD_MEMBER_IN_AVCHATROOM});return y.setError(b,!0,this._groupModule.getNetworkType()).end(),be(b)}return l.userIDList=l.userIDList.map(function(I){return{userID:I}}),U.l("".concat(a," groupID:").concat(c)),this._groupModule.request({protocolName:k_,requestData:l}).then(function(I){var E=I.data.members;U.l("".concat(a," ok"));var O=E.filter(function(_e){return _e.result===1}).map(function(_e){return _e.userID}),F=E.filter(function(_e){return _e.result===0}).map(function(_e){return _e.userID}),q=E.filter(function(_e){return _e.result===2}).map(function(_e){return _e.userID}),ee=E.filter(function(_e){return _e.result===4}).map(function(_e){return _e.userID}),ge="groupID:".concat(l.groupID,", ")+"successUserIDList:".concat(O,", ")+"failureUserIDList:".concat(F,", ")+"existedUserIDList:".concat(q,", ")+"overLimitUserIDList:".concat(ee);return y.setNetworkType(p._groupModule.getNetworkType()).setMoreMessage(ge).end(),O.length===0?ht({successUserIDList:O,failureUserIDList:F,existedUserIDList:q,overLimitUserIDList:ee}):(h.memberCount+=O.length,p._updateConversationGroupProfile(h),ht({successUserIDList:O,failureUserIDList:F,existedUserIDList:q,overLimitUserIDList:ee,group:h}))}).catch(function(I){return p._groupModule.probeNetwork().then(function(E){var O=A(E,2),F=O[0],q=O[1];y.setError(I,F,q).end()}),U.e("".concat(a," failed. error:"),I),be(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 be({code:Ae.CANNOT_FIND_GRP});if($o(m.type))return this._groupModule.canIUse(me.AVCHATROOM_BAN_MBR)?this._banAVChatRoomMember(l):be({code:Ae.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:D_,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 O=A(E,2),F=O[0],q=O[1];y.setError(I,F,q).end()}),U.e("".concat(a," failed. error:"),I),be(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?be({code:Ae.BAN_DURATION_INVALID}):this._groupModule.request({protocolName:E_,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 O=A(E,2),F=O[0],q=O[1];y.setError(I,F,q).end()}),U.e("".concat(a," failed. error:"),I),be(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 be({code:Ae.CANNOT_MUTE_SELF});var b=this._groupModule.getLocalGroupProfile(a);if(b&&$o(b.type)){var I=Ae.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return be({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(O){E.setNetworkType(p._groupModule.getNetworkType()).end(),U.l("".concat(y," ok"));var F=p._groupModule.getLocalGroupProfile(a);return ht({group:F,member:O})}).catch(function(O){return p._groupModule.probeNetwork().then(function(F){var q=A(F,2),ee=q[0],ge=q[1];E.setError(O,ee,ge).end()}),U.e("".concat(y," failed. error:"),O),be(O)})}},{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 be({code:Ae.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM});if(y&&y.selfInfo.role!==T.GRP_MBR_ROLE_OWNER)return be({code:Ae.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 be({code:Ae.INVALID_MEMBER_ROLE});if(h===this._groupModule.getMyUserID())return be({code:Ae.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(O){var F=A(O,2),q=F[0],ee=F[1];I.setError(E,q,ee).end()}),U.e("".concat(a," failed. error:"),E),be(E)})}},{key:"_filterProfanity",value:function(l,p){var a=this._groupModule.getModule($a);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 be({code:Ae.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&&$o(I.type)){var E=Ae.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return be({code:E,message:this._groupModule.getErrorMessage(E,a)})}var O=new We(a);return O.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")),O.setNetworkType(p._groupModule.getNetworkType()).end();var q=p._groupModule.getLocalGroupProfile(h);return y===p._groupModule.getMyUserID()&&q&&q.setSelfNameCard(b),ht({group:q,member:F})}).catch(function(F){return p._groupModule.probeNetwork().then(function(q){var ee=A(q,2),ge=ee[0],_e=ee[1];O.setError(F,ge,_e).end()}),U.e("".concat(c," failed. error:"),F),be(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&&$o(I.type)){var E=Ae.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return be({code:E,message:this._groupModule.getErrorMessage(E,a)})}var O=new We(a);return O.setMessage("groupID:".concat(h," userID:").concat(y," memberCustomField:").concat(JSON.stringify(b))),this.modifyGroupMemberInfo({groupID:h,userID:y,memberCustomField:b}).then(function(F){O.setNetworkType(p._groupModule.getNetworkType()).end(),U.l("".concat(c," ok"));var q=p._groupModule.getLocalGroupProfile(h);return ht({group:q,member:F})}).catch(function(F){return p._groupModule.probeNetwork().then(function(q){var ee=A(q,2),ge=ee[0],_e=ee[1];O.setError(F,ge,_e).end()}),U.e("".concat(c," failed. error:"),F),be(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:A_,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,O=[];m===!0&&(E=1);var F=N(b);b.length>500&&(F=b.slice(0,500),U.w("".concat(a," ").concat(xa(500)))),F.forEach(function(ee){O.push({userID:ee,markType:[h]})}),F=null;var q=new We("markGroupMemberList");return q.setMessage("".concat(I)),this._groupModule.request({protocolName:L_,requestData:{groupID:c,operationType:E,memberList:O}}).then(function(ee){var ge=ee.data.memberList,_e=ge===void 0?[]:ge,we=[],Ue=[];_e.length===b.length?we.push.apply(we,N(b)):(_e.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 q.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 _e=A(ge,2),we=_e[0],Ue=_e[1];q.setError(ee,we,Ue).end()}),U.e("".concat(a," failed. error:"),ee),be(ee)})}},{key:"_getGroupMemberProfileAdvance",value:function(l){return this._groupModule.request({protocolName:S_,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 A6(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}(),O6=1,R6=15,N6=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(L.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;m<h;m++){var I=p[m],E=I.groupProfile,O=E.communityType,F=O===void 0?0:O,q=E.topicID,ee=q===void 0?void 0:q,ge=I.elements,_e=ge.topicIDList,we=_e===void 0?void 0:_e,Ue=ge.operationType;if(!(F!==2||Ye(ee)&&Ye(we))){if([17,18,20].includes(Ue)){this._handleTopicSystemNotice(I);continue}Ye(ee)||(I.to=ee)}I.elements.operationType!==R6&&(I.currentUser=this._groupModule.getMyUserID(),I.conversationType=T.CONV_SYSTEM,I.conversationID=T.CONV_SYSTEM,(c=new qr(I)).setElement({type:T.MSG_GRP_SYS_NOTICE,content:r(r({},I.elements),{},{groupProfile:r({},I.groupProfile)})}),c.isSystemMessage=!0,(c.sequence===1&&c.random===1||c.sequence===2&&c.random===2)&&(c.sequence=ei(),c.random=ei(),c.generateMessageID(),U.l("".concat(this._n,".newSystemNoticeStoredAndSummary sequence and random maybe duplicated, regenerate. ID:").concat(c.ID))),this._groupModule.getModule(ct).pushIntoNoticeResult(y,c)&&(a?b.unreadCount++:c.setIsRead(!0),b.subType=c.conversationSubType))}return b.lastMessage=y[y.length-1],{eventDataList:y.length>0?[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===O6){var E="".concat(y,"_").concat(I.groupID,"_").concat(I.to),O=l.pendencyMap.get(E);O&&un(O.handled)&&O.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:M_,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),be(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(O){return[].concat(N(E),N(O))}):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,N(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(ar);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}(),P6=["relayFlag"],x6=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="GroupModule",c._commonGroupHandler=new M6(w(c)),c._groupAttributesHandler=new C6(w(c)),c._groupCountersHandler=new k6(w(c)),c._AVChatRoomHandler=new E6(w(c)),c._groupTipsHandler=new b6(w(c)),c._groupSystemNoticeHandler=new N6(w(c)),c._groupMemberHandler=new L6(w(c)),c.groupMap=new Map,c._unjoinedAVChatRoomList=new Map,c._receiptDetailCompleteMap=new Map,c.getInnerEmitterInstance().on(rr.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=Ae.MSG_SEND_FAIL_NOT_IN_AVCHATROOM;return be(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(ar);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,O=E===void 0?void 0:E,F=b.lastMessageSeq;U.d("".concat(c._n,".onGroupMessageReadNotice groupID:").concat(I," lastMessageSeq:").concat(F));var q="".concat(T.CONV_GROUP).concat(I),ee=!0;Ye(O)||(q="".concat(T.CONV_GROUP).concat(O),ee=!1),y.updateIsReadAfterReadReport({conversationID:q,lastMessageSeq:F}),y.updateUnreadCount(q,ee),y.clearGroupAtInfoList(q,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 Sl(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(O){c=O.groupID,h.groupMap.has(c)?h.groupMap.get(c).updateGroup(O):(h.groupMap.set(c,new Sl(O)),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(O){I.e(O)}finally{I.f()}}},{key:"getGroupMap",value:function(){return this.groupMap}},{key:"getLocalGroupList",value:function(){return N(this.groupMap.values())}},{key:"getLocalGroupProfile",value:function(a){return this.groupMap.get(a)}},{key:"sortLocalGroupList",value:function(){var a=N(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(N(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(L.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 O,F=E.data,q=F.successGroupList,ee=F.failureGroupList;return U.l("".concat(h," ok")),ee.length>0?be(ee[0]):($o(q[0].type)&&!c.hasLocalGroup(y)?O=new Sl(q[0]):(c.updateGroupMap(q),O=c.getLocalGroupProfile(y)),O.isSupportTopic||c.getModule(ct).updateConversationGroupProfile([O]),m.setNetworkType(c.getNetworkType()).setMessage("groupID:".concat(y," type:").concat(O.type," muteAllMembers:").concat(O.muteAllMembers," ownerID:").concat(O.ownerID)).end(),ht({group:O}))}).catch(function(E){return c.probeNetwork().then(function(O){var F=A(O,2),q=F[0],ee=F[1];m.setError(E,q,ee).setMessage("groupID:".concat(a.groupID)).end()}),U.e("".concat(h," failed. error:"),E),be(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(O){go({groupID:O})?y.push(O):m.push(O)});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(O){var F=[],q=[];return O.forEach(function(ee){F.push.apply(F,N(ee.successGroupList)),q.push.apply(q,N(ee.failureGroupList))}),ht({successGroupList:F,failureGroupList:q})}).catch(function(O){return U.e("".concat(c," failed. error:"),O),be(O)})}},{key:"_getGroupProfileAdvance",value:function(a){var c=this,h=a.relayFlag,m=h!==void 0&&h,y=D(a,P6);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:[]}:be(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 be({code:Ae.PROFANITY_FOUND});if(a.introduction&&this._filterProfanity("introduction",a)===!1)return be({code:Ae.PROFANITY_FOUND});if(a.notification&&this._filterProfanity("notification",a)===!1)return be({code:Ae.PROFANITY_FOUND});if(!["Public","Private","ChatRoom","AVChatRoom","Community"].includes(m))return be({code:Ae.ILLEGAL_GRP_TYPE});if(!go({type:m})){if(!Ye(y)&&go({groupID:y}))return be({code:Ae.ILLEGAL_GRP_ID});a.isSupportTopic=void 0}if($o(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 be({code:Ae.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:s_,requestData:r(r({},a),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then(function(O){var F=O.data,q=F.groupID,ee=F.overLimitUserIDList,ge=ee===void 0?[]:ee;if(I=q,E=ge,b.setNetworkType(c.getNetworkType()).setMessage("groupType:".concat(a.type," groupID:").concat(q," overLimitUserIDList:").concat(ge)).end(),U.l("".concat(h," ok groupID:").concat(q," overLimitUserIDList:").concat(ge)),a.type===T.GRP_AVCHATROOM)return c.getGroupProfile({groupID:q});if(a.type===T.GRP_COMMUNITY&&a.isSupportTopic===1)return c.getGroupProfile({groupID:q});Ye(a.memberList)||Ye(ge)||(a.memberList=a.memberList.filter(function(mt){return ge.indexOf(mt.userID)===-1})),c.updateGroupMap([r(r({},a),{},{groupID:q})]);var _e=c.getModule(sr),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=_e.createCustomMessage({to:q,conversationType:T.CONV_GROUP,payload:{data:JSON.stringify({businessID:"group_create",content:we,cmd:Ue,opUser:qe||c.getMyUserID(),version:4})}});return _e.sendMessageInstance(nt),c.emitGroupListUpdate(),c.getGroupProfile({groupID:q})}).then(function(O){var F=O.data.group,q=F.selfInfo,ee=q.nameCard,ge=q.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(O){if(b.setMessage("groupType:".concat(a.type)),c.probeNetwork().then(function(q){var ee=A(q,2),ge=ee[0],_e=ee[1];b.setError(O,ge,_e).end()}),O.code===10010||O.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:"),O),be(O)})}},{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 be(new Un({code:Ae.CANNOT_DISMISS_WORK}));var m=new We("dismissGroup");return m.setMessage("groupID:".concat(a)),U.l("".concat(h," groupID:").concat(a)),this.request({protocolName:a_,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],O=I[1];m.setError(y,E,O).end()}),U.e("".concat(h," failed. error:"),y),be(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 be({code:Ae.PROFANITY_FOUND});if(a.introduction&&this._filterProfanity("introduction",a)===!1)return be({code:Ae.PROFANITY_FOUND});if(a.notification&&this._filterProfanity("notification",a)===!1)return be({code:Ae.PROFANITY_FOUND});var y=new We("updateGroupProfile");return y.setMessage(JSON.stringify(a)),U.l("".concat(h," groupID:").concat(a.groupID)),this.request({protocolName:l_,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),O=E[0],F=E[1];y.setError(b,O,F).end()}),U.l("".concat(h," failed. error:"),b),be(b)})}},{key:"_filterProfanity",value:function(a,c){var h=this.getModule($a);if(!h)return!0;var m=h.filterText(c[a],ue),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 be({code:Ae.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 be({code:Ae.PROFANITY_FOUND});var y=new We("applyJoinGroup"),b=r({},a),I=this.canIUse(me.AVCHATROOM_HISTORY_MSG);return I&&(b.historyMessageFlag=1),this.getModule(ct).deleteTopicRoamingMessageInfo(m),this.request({protocolName:xg,requestData:b}).then(function(E){var O=E.data,F=O.joinedStatus,q=O.longPollingKey,ee=O.startSeq,ge=O.avChatRoomFlag,_e=O.avChatRoomKey,we=O.messageList,Ue="groupID:".concat(m," joinedStatus:").concat(F," longPollingKey:").concat(q," 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 vd:return ht({status:vd});case Xi:return c.getGroupProfile({groupID:m}).then(function(nt){var mt=nt.data.group;return c._handleJoinResult({group:mt,avChatRoomFlag:ge,longPollingKey:q,startSeq:ee,avChatRoomKey:_e,messageList:we})}).catch(function(){var nt=new Sl({groupID:m});return c._handleJoinResult({group:nt,avChatRoomFlag:ge,longPollingKey:q,startSeq:ee,avChatRoomKey:_e,messageList:we})});default:var qe=new Un({code:Ae.JOIN_GRP_FAIL});return U.e("".concat(h," failed. error:"),qe),be(qe)}}).catch(function(E){return y.setMessage("groupID:".concat(m)),c.probeNetwork().then(function(O){var F=A(O,2),q=F[0],ee=F[1];y.setError(E,q,ee).end()}),U.e("".concat(h," failed. error:"),E),be(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,O=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(O)}),c):(this.emitGroupListUpdate(!0,!1),ht({status:Xi,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 be({code:Ae.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:u_,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),O=E[0],F=E[1];y.setError(b,O,F).end()}),U.e("".concat(h," failed. error:"),b),be(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:c_,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 Sl(I[0])})}).catch(function(b){return c.probeNetwork().then(function(I){var E=A(I,2),O=E[0],F=E[1];y.setError(b,O,F).end()}),U.w("".concat(h," failed. error:"),b),be(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 be({code:Ae.CANNOT_CHANGE_OWNER_IN_AVCHATROOM});if(a.newOwnerID===this.getMyUserID())return be({code:Ae.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:d_,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 O=I.get(b);Ge(O)||O.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],O=I[1];m.setError(y,E,O).end()}),U.e("".concat(h," failed. error:"),y),be(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"),O=a.handleAction,F=a.handleMessage,q=a.message,ee=a.application;q?(c=q.payload.operatorID,h=q.payload.groupProfile.groupID,m=q.payload.authentication,y=q.payload.messageKey):ee&&(c=ee.applicant,h=ee.groupID,m=ee.authentication,y=ee.messageKey);var ge=f_;ee&&ee.applicationType===2&&(ge=p_,b=ee.userID);var _e=new We("handleGroupApplication");return _e.setMessage("groupID:".concat(h)),U.l("".concat(E," groupID:").concat(h)),this.request({protocolName:ge,requestData:{handleAction:O,handleMessage:F,applicant:c,invitee:b,groupID:h,authentication:m,messageKey:y}}).then(function(){return _e.setNetworkType(I.getNetworkType()).end(),U.l("".concat(E," ok")),q&&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];_e.setError(we,nt,mt).end()}),U.e("".concat(E," failed. error"),we),be(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,O=a.handleAction,F=new We("handleGroupInvitation");return F.setMessage("groupID:".concat(y," inviter:").concat(E," handleAction:").concat(O)),U.l("".concat(h," groupID:").concat(y," inviter:").concat(E," handleAction:").concat(O)),this.request({protocolName:h_,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(q){return c.probeNetwork().then(function(ee){var ge=A(ee,2),_e=ge[0],we=ge[1];F.setError(q,_e,we).end()}),U.e("".concat(h," failed. error"),q),be(q)})}},{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(ar).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(me.MSG_TO_SPECIFIED_GRP_MBR))return be({code:Ae.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,O=b.excludedFromContentModeration;I===!0&&y.push("NoUnread"),E===!0&&y.push("NoLastMsg"),O===!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 q=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:q,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:q===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:Cp,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:g_,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:C_,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,O=c,F=void 0;oo(c)&&(O=Lr(c),F=c);var q=void 0;return Bu(y)&&(q=[]).push({type:y,content:m}),this.request({protocolName:$g,requestData:{groupID:O,topicID:F,sequence:h,version:I,elements:q,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,O=void 0;return oo(y)&&(y=Lr(O=y)),this._computeLastSequence({groupID:y,topicID:O,sequence:b}).then(function(F){return E=F,U.l("".concat(h," groupID:").concat(y," startSequence:").concat(E)),c.request({protocolName:Sp,requestData:{groupID:y,count:21,sequence:E,topicID:O}})}).then(function(F){var q=F.data,ee=q.messageList,ge=q.complete,_e=q.invisibleSequenceList,we=_e===void 0?[]:_e;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(O," 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(q){var ee=A(q,2),ge=ee[0],_e=ee[1];I.setError(F,ge,_e).setMessage("groupID:".concat(y," topicID:").concat(O," startSequence:").concat(E)).end()}),U.w("".concat(h," failed. error:"),F),be(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<h?m:h}},{key:"getReadReceiptList",value:function(a){var c=this,h="".concat(this._n,".").concat("getReadReceiptList"),m=this._getGroupIDOfMessage(a[0]),y=this.getMyUserID(),b=a.filter(function(E){return E.from===y&&E.needReadReceipt===!0}).map(function(E){return{sequence:E.sequence}});if(U.l("".concat(h," groupID:").concat(m," sequenceList:").concat(JSON.stringify(b))),b.length===0)return At({messageList:a});var I=new We("getReadReceiptList");return I.setMessage("groupID:".concat(m)),this.request({protocolName:v_,requestData:{groupID:m,sequenceList:b}}).then(function(E){I.end(),U.l("".concat(h," ok"));var O=E.data.readReceiptList;return rt(O)&&O.forEach(function(F){a.forEach(function(q){F.code===0&&F.sequence===q.sequence&&(q.readReceiptInfo.readCount=F.readCount,q.readReceiptInfo.unreadCount=F.unreadCount)})}),ht({messageList:a})}).catch(function(E){return c.probeNetwork().then(function(O){var F=A(O,2),q=F[0],ee=F[1];I.setError(E,q,ee).end()}),U.w("".concat(h," failed. error:"),E),be(E)})}},{key:"sendReadReceipt",value:function(a){var c=this,h="".concat(this._n,".").concat("sendReadReceipt"),m=this._getGroupIDOfMessage(a[0]),y=new We("sendReadReceipt");y.setMessage("groupID:".concat(m));var b=this.getMyUserID(),I=a.filter(function(E){return E.from!==b&&E.needReadReceipt===!0}).map(function(E){return{sequence:E.sequence}});return I.length===0?be({code:Ae.READ_RECEIPT_MSG_LIST_EMPTY}):(U.l("".concat(h,". sequenceList:").concat(JSON.stringify(I))),this.request({protocolName:y_,requestData:{groupID:m,sequenceList:I}}).then(function(E){return y.end(),U.l("".concat(h," ok")),ht()}).catch(function(E){return c.probeNetwork().then(function(O){var F=A(O,2),q=F[0],ee=F[1];y.setError(E,q,ee).end()}),U.w("".concat(h," failed. error:"),E),be(E)}))}},{key:"getReadReceiptDetail",value:function(a){var c=this,h=a.message,m=a.filter,y=a.cursor,b=a.count,I=this._getGroupIDOfMessage(h),E=h.ID,O=h.sequence,F="".concat(this._n,".").concat("getReadReceiptDetail"),q=this._receiptDetailCompleteMap.get(E)||!1,ee=m!==0&&m!==1?0:m,ge=Et(y)?y:"",_e=!un(b)||b<=0||b>=100?100:b,we="groupID:".concat(I," sequence:").concat(O," cursor:").concat(ge," filter:").concat(ee," completeFlag:").concat(q);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:b_,requestData:{groupID:I,sequence:O,flag:ee,cursor:ge,count:_e}}).then(function(nt){qe.end();var mt=nt.data,xt=mt.cursor,gn=mt.isCompleted,_n=mt.unreadUserIDList,Or=mt.readUserIDList;return Ue.cursor=xt,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 xt=A(mt,2),gn=xt[0],_n=xt[1];qe.setError(nt,gn,_n).end()}),U.w("".concat(F," failed. error:"),nt),be(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,O=I;E===1&&(O=I+b-1);var F=void 0;oo(y)&&(y=Lr(F=y));var q="".concat(F?"topicID:".concat(F):"groupID:".concat(y)," sequence:").concat(I," direction:").concat(E);return U.l("".concat(h," ").concat(q)),this.request({protocolName:Sp,requestData:{groupID:y,topicID:F,count:b,sequence:O}}).then(function(ee){var ge=ee.data,_e=ge.messageList,we=ge.complete,Ue="complete:".concat(we," count:").concat(_e?_e.length:0);if(U.l("".concat(h," ok. ").concat(Ue)),m.setNetworkType(c.getNetworkType()).setMessage("".concat(q," ").concat(Ue)).end(),we===2||Ye(_e)){var qe=c._computeResult();return ht(qe)}var nt="".concat(T.CONV_GROUP).concat(a.groupID),mt=c.getModule(ct).onRoamingMessage(_e,nt,!1),xt=c._computeResult({direction:E,sequence:I,remoteMessageList:_e,processedMessageList:mt});return ht(xt)}).catch(function(ee){return c.probeNetwork().then(function(ge){var _e=A(ge,2),we=_e[0],Ue=_e[1];m.setError(ee,we,Ue).setMessage("groupID:".concat(y," sequence:").concat(I," count:").concat(b)).end()}),U.w("".concat(h," failed. error:"),ee),be(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,O=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].sequence<m&&(c.isCompleted=!0,c.nextMessageSeq=""),c):(c.nextMessageSeq=b[O-1].sequence-1,c.messageList=N(E),c.nextMessageSeq===0&&(c.isCompleted=!0,c.nextMessageSeq=""),c)}},{key:"setMessageRead",value:function(a){var c=this,h=a.conversationID,m=a.lastMessageSeq,y="".concat(this._n,".setMessageRead");U.l("".concat(y," conversationID:").concat(h," lastMessageSeq:").concat(m)),un(m)||this.outputWarning("DoNotModifyLastSeq");var b=new We("setGroupMessageRead");b.setMessage("".concat(h,"-").concat(m));var I=h.replace(T.CONV_GROUP,""),E=void 0;return oo(I)&&(I=Lr(E=I)),this.request({protocolName:m_,requestData:{groupID:I,topicID:E,messageReadSeq:m}}).then(function(){b.setNetworkType(c.getNetworkType()).end(),U.l("".concat(y," ok."));var O=c.getModule(ct);O.updateIsReadAfterReadReport({conversationID:h,lastMessageSeq:m});var F=!0;if(!Ge(E)){F=!1;var q=c.getModule(ar).getLocalTopic(I,E);q&&q.updateSelfInfo({readedSequence:m})}return O.updateUnreadCount(h,F),ht()}).catch(function(O){return c.probeNetwork().then(function(F){var q=A(F,2),ee=q[0],ge=q[1];b.setError(O,ee,ge).end()}),U.l("".concat(y," failed. error:"),O),be(O)})}},{key:"_computeLastSequence",value:function(a){var c=a.groupID,h=a.topicID,m=h===void 0?void 0:h,y=a.sequence;return y>0?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 O="GROUP".concat(a),F=this.getModule(ct).getLocalConversation(O);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 q={groupIDList:[a],responseFilter:{groupBaseInfoFilter:["NextMsgSeq"]}};return this.getGroupProfileAdvance(q).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 _e=A(ge,2),we=_e[0],Ue=_e[1];m.setError(ee,we,Ue).setMessage("get lastSequence failed from getGroupProfileAdvance. groupID:".concat(a)).end()}),U.w("".concat(h," failed. error:"),ee),be(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="",O=this.getModule(ar);return O.hasLocalTopic(h,m)?(I=O.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)):O.getTopicList({groupID:h,topicIDList:[m]}).then(function(F){var q=F.data.successTopicList;return Ye(q)?U.l("".concat(y," successTopicList is empty. topicID:").concat(m)):(I=q[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(q){var ee=A(q,2),ge=ee[0],_e=ee[1];b.setError(F,ge,_e).setMessage("get lastSequence failed from getTopicList. topicID:".concat(m)).end()}),U.w("".concat(y," failed. error:"),F),be(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],O=I[1];h.setError(y,E,O).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;h<m;h++){var y=a[h],b=this.getLocalGroupProfile(y).type,I=this._getGroupLastRevokedTime(y),E=1e3*Mn(),O={notifyType:1,limit:20,type:go({type:b,groupID:y})?T.GRP_COMMUNITY:void 0,groupID:y,beginTime:I,endTime:E};c.push(O)}return c}},{key:"getGroupNotify",value:function(a){var c=this,h="".concat(this._n,".getGroupNotify"),m=a.filter(function(b){var I=c.getLocalGroupProfile(b),E=I.type,O=I.isSupportTopic;return c.hasLocalGroup(b)&&!$o(E)&&!O}),y="filteredGroupIDList.length:".concat(m.length);m.length<=10&&(y="filteredGroupIDList:".concat(JSON.stringify(m))),U.l("".concat(h," ").concat(y)),m.length!==0&&this.request({protocolName:T_,requestData:{notifyReqList:this._genNotifyReqList(a)}}).then(function(b){var I=b.data.notifyRspList,E=[];if(rt(I)){var O={dataList:[]};I.forEach(function(q){var ee=q.nextRevokedTime,ge=q.groupID;O.dataList.push({elements:{revokedInfos:c._genRevokedInfos(q)}}),ee!==0?(c._setGroupLastRevokedTime(ge,ee),E.push(ge)):c._setGroupLastRevokedTime(ge,1e3*Mn())}),c.onGroupMessageRevoked(O)}E.length>0&&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&&$o(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),U6=["topicID","topicName","avatar","introduction","notification","unreadCount","muteAllMembers","customData","groupAtInfoList","nextMessageSeq","selfInfo"],$w=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:$u(k.type,k.payload,l),nick:k.nick||"",version:k.version||0,cloudCustomData:k.cloudCustomData||"",isRevoked:k.isRevoked||!1,revoker:k.revoker||null}},F6=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=$w(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)U6.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=$w(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),Ni(this,l,["groupID","lastMessageTime","selfInfo","muteAllMembers","lastMsg"])}},{key:"updateSelfInfo",value:function(l){return Ni(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}(),G6=function(k){f(p,k);var l=R(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(rr.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(L.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(L.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(L.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(L.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(L.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(L.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),O=this.getLocalTopic(E,c);if(O){var F=O.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=$u(F.type,F.payload,this.isIntl()),F.cloudCustomData=b,F.version=I,F.lastSequence=m,F.lastTime=h,this.emitOuterEvent(L.TOPIC_UPDATED,{groupID:E,topic:O}))}}},{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(L.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(It).syncCommunityWithTopic()}},{key:"createTopicInCommunity",value:function(a){var c=this,h="".concat(this._n,".").concat("createTopicInCommunity"),m=a.topicID;if(!Ge(m)&&!oo(m))return be({code:Ae.ILLEGAL_TOPIC_ID});if(a.topicName&&this._filterProfanity("topicName",a)===!1)return be({code:Ae.PROFANITY_FOUND});if(a.introduction&&this._filterProfanity("introduction",a)===!1)return be({code:Ae.PROFANITY_FOUND});if(a.notification&&this._filterProfanity("notification",a)===!1)return be({code:Ae.PROFANITY_FOUND});var y=new We("createTopicInCommunity");return this.request({protocolName:q_,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),O=E[0],F=E[1];y.setError(b,O,F).end()}),U.e("".concat(h," failed. error:"),b),be(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:V_,requestData:{groupID:m,topicIDList:b}}).then(function(E){var O=E.data.resultList,F=[],q=[];(O===void 0?[]:O).forEach(function(ge){var _e=ge.topicID,we=ge.errorCode,Ue=ge.errorInfo;we===0?F.push({topicID:_e}):q.push({topicID:_e,code:we,message:Ue})});var ee="success count:".concat(F.length,", fail count:").concat(q.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:q})}).catch(function(E){return c.probeNetwork().then(function(O){var F=A(O,2),q=F[0],ee=F[1];I.setError(E,q,ee).end()}),U.e("".concat(h," failed. error:"),E),be(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 be({code:Ae.PROFANITY_FOUND});if(a.introduction&&this._filterProfanity("introduction",a)===!1)return be({code:Ae.PROFANITY_FOUND});if(a.notification&&this._filterProfanity("notification",a)===!1)return be({code:Ae.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:z_,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],O=I[1];m.setError(y,E,O).end()}),U.e("".concat(h," failed. error:"),y),be(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 O=this._getTopicTimeMap.get(m),F=O.isGetAll,q=O.time;if((F||!F&&!I)&&Date.now()-q<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 _e=ge.data.topicInfoList,we=[],Ue=[],qe=[];(_e===void 0?[]:_e).forEach(function(xt){var gn=xt.topic,_n=xt.selfInfo,Or=xt.errorCode,lo=xt.errorInfo,Ho=gn.topicID;Or===0?(we.push(r(r({},gn),{},{selfInfo:_n})),Ue.push(Ho)):qe.push({topicID:Ho,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(_e){var we=A(_e,2),Ue=we[0],qe=we[1];E.setError(ge,Ue,qe).end()}),U.e("".concat(h," failed. error:"),ge),be(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=N(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 F6(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)?N(this._getTopicTimeMap.keys()).forEach(function(h){c._getTopicTimeMap.set(h,0)}):this._getTopicTimeMap.set(a,0)}},{key:"getTopicListOnReconnected",value:function(){var a=this,c=N(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 O=E.lastMessage.lastTime,F=O===void 0?0:O;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),O=E[0],F=E[1];y.setError(b,O,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($a);if(!h)return!0;var m=h.filterText(c[a],ue),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(L.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),$6=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(xa(100))),c.length=100);for(var h,m=[],y=[],b=0,I=c.length;b<I;b++)h=c[b],this._userModule.isMyFriend(h)&&this._contains(h)?y.push(this._getProfileFromMap(h)):m.push(h);if(m.length===0)return At(y);l.toAccount=m;var E=l.bFromGetMyProfile||!1,O=[];l.toAccount.forEach(function(q){O.push({toAccount:q,standardSequence:0,customSequence:0})}),l.userItem=O;var F=new We("getUserProfile");return F.setMessage(c.length>5?"userIDList.length:".concat(c.length):"userIDList:".concat(c)),this._userModule.request({protocolName:D0,requestData:l}).then(function(q){F.setNetworkType(p._userModule.getNetworkType()).end(),U.i("".concat(a," ok"));var ee=p._handleResponse(q).concat(y);return ht(E?ee[0]:ee)}).catch(function(q){return p._userModule.probeNetwork().then(function(ee){var ge=A(ee,2),_e=ge[0],we=ge[1];F.setError(q,_e,we).end()}),U.e("".concat(a," failed. error:"),q),be(q)})}},{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<m;h++){var y=p[h],b=y.to,I=y.profileItem;if(b!=="@TLS#NOT_FOUND"&&b!==""){var E=this._update(b,this._getLatestProfileFromResponse(b,I)).latestProfile;a.push(E)}}return U.l("".concat(this._n,"._handleResponse cost ").concat(Date.now()-c," ms")),a}},{key:"_getLatestProfileFromResponse",value:function(l,p){var a={userID:l,profileCustomField:[]};if(!Ye(p))for(var c=0,h=p.length;c<h;c++)if(p[c].tag.indexOf("Tag_Profile_Custom")>-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 be({code:Ae.PROFANITY_FOUND});if(l.selfSignature&&this._userModule.filterProfanity("selfSignature",l)===!1)return be({code:Ae.PROFANITY_FOUND});var c=new We("updateMyProfile");c.setMessage(JSON.stringify(l));var h=new Ap().validate(l);if(!h.valid)return c.setCode(Ae.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("info:".concat(h.tips)).setNetworkType(this._userModule.getNetworkType()).end(),U.e("".concat(a," info:").concat(h.tips)),be({code:Ae.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:Ae.UPDATE_PROFILE_NO_KEY});return c.setError(b,!0,this._userModule.getNetworkType()).end(),U.e("".concat(a," failed. error:"),b),be(b)}var I=this._userModule.getMyAccount();return this._userModule.request({protocolName:E0,requestData:{fromAccount:I,profileItem:m}}).then(function(E){c.setNetworkType(p._userModule.getNetworkType()).end(),U.i("".concat(a," ok"));var O=p._update(I,l),F=O.isProfileUpdated,q=O.latestProfile;return F===!0&&p._userModule.emitOuterEvent(L.PROFILE_UPDATED,[q]),At(q)}).catch(function(E){return p._userModule.probeNetwork().then(function(O){var F=A(O,2),q=F[0],ee=F[1];c.setError(E,q,ee).end()}),U.e("".concat(a," failed. error:"),E),be(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;m<c;m++){a=p[m].userID;var y=this._update(a,this._getLatestProfileFromResponse(a,p[m].profileList)),b=y.isProfileUpdated,I=y.latestProfile;b===!0&&h.push(I)}h.length>0&&(this._userModule.emitInnerEvent(rr.PROFILE_UPDATED,h),this._userModule.emitOuterEvent(L.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;a<c;a++)p-l[a].lastUpdatedTime<this.expirationTime&&this.accountProfileMap.set(l[a].userID,l[a]);U.l("".concat(this._n,"._fill from cache, size:").concat(this.accountProfileMap.size))}}},{key:"_update",value:function(l,p){var a,c=!1,h=Date.now();return this._contains(l)?(a=this._getProfileFromMap(l),p.profileCustomField&&xu(a.profileCustomField,p.profileCustomField)===!0&&(a.lastUpdatedTime=h,c=!0),Ni(a,p,["profileCustomField"])>0&&(a.lastUpdatedTime=h,c=!0)):(a=new Ap(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=N(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;m<y;m++)a=(p=l[m]).userID,this._userModule.isMyFriend(a)&&(this._contains(a)?(c=this._getProfileFromMap(a),Ni(c,p)>0&&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}(),Bw=u(function k(l){i(this,k),Ye||(this.userID=l.userID||"",this.timeStamp=l.timeStamp||0)}),B6=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 N(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:A0,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(L.BLACKLIST_UPDATED,N(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),be(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=Ae.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),be(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:L0,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(N(p._blacklistMap.keys()))}).catch(function(I){return p._userModule.probeNetwork().then(function(E){var O=A(E,2),F=O[0],q=O[1];a.setError(I,F,q).end()}),U.e("".concat(c," failed. error:"),I),be(I)})}},{key:"_handleResponse",value:function(l,p){if(!Ye(l))for(var a,c,h,m=0,y=l.length;m<y;m++)c=l[m].to,h=l[m].resultCode,(Ge(h)||h===0)&&(p?((a=this._blacklistMap.has(c)?this._blacklistMap.get(c):new Bw).userID=c,!Ye(l[m].addBlackTimeStamp)&&(a.timeStamp=l[m].addBlackTimeStamp),this._blacklistMap.set(c,a)):this._blacklistMap.has(c)&&(a=this._blacklistMap.get(c),this._blacklistMap.delete(c)));U.l("".concat(this._n,"._handleResponse total:").concat(this._blacklistMap.size," bAdd:").concat(p))}},{key:"deleteBlacklist",value:function(l){var p=this,a="".concat(this._n,".deleteBlacklist"),c=new We("removeFromBlacklist");return l.fromAccount=this._userModule.getMyAccount(),l.toAccount=l.userIDList,this._userModule.request({protocolName:O0,requestData:l}).then(function(h){return c.setNetworkType(p._userModule.getNetworkType()).setMessage(l.userIDList.length>5?"userIDList.length:".concat(l.userIDList.length):"userIDList:".concat(l.userIDList)).end(),U.i("".concat(a," ok")),p._handleResponse(h.data.resultItem,!1),ht(N(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),be(h)})}},{key:"onAccountDeleted",value:function(l){for(var p,a=[],c=0,h=l.length;c<h;c++)p=l[c],this._blacklistMap.has(p)&&(this._blacklistMap.delete(p),a.push(p));a.length>0&&(U.l("".concat(this._n,".onAccountDeleted count:").concat(a.length," userIDList:"),a),this._userModule.emitOuterEvent(L.BLACKLIST_UPDATED,N(this._blacklistMap.keys())))}},{key:"onAccountAdded",value:function(l){for(var p,a=[],c=0,h=l.length;c<h;c++)p=l[c],this._blacklistMap.has(p)||(this._blacklistMap.set(p,new Bw({userID:p})),a.push(p));a.length>0&&(U.l("".concat(this._n,".onAccountAdded count:").concat(a.length," userIDList:"),a),this._userModule.emitOuterEvent(L.BLACKLIST_UPDATED,N(this._blacklistMap.keys())))}},{key:"reset",value:function(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),k}(),d1=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""}},H6=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(rr.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=d1(I);return y===a&&c.setCustomStatus(E),{userID:y,statusType:b,customStatus:E}});this._userModule.emitOuterEvent(L.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 be({code:Ae.PROFANITY_FOUND});var c=new We("setSelfStatus"),h=l.customStatus;return this._userModule.request({protocolName:j_,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),be(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=N(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(me.USER_STATUS))return be({code:Ae.CANNOT_USE_COMMERCIAL_ABILITY});y.length>this.MAX_QUERY_USER_COUNT&&(U.w("".concat(a," ").concat(xa(this.MAX_QUERY_USER_COUNT))),y=h.slice(0,this.MAX_QUERY_USER_COUNT));var O=new We("getUserStatus");return this._userModule.request({protocolName:em,requestData:{userIDList:y}}).then(function(F){var q=F.data,ee=q.successUserList,ge=ee===void 0?[]:ee,_e=q.failureUserList,we=_e===void 0?[]:_e,Ue=ge.map(function(mt){var xt=mt.userID,gn=mt.statusType,_n=mt.customStatus;return{userID:xt,statusType:gn,customStatus:d1(_n)}}),qe=we.map(function(mt){var xt=mt.userID,gn=mt.invalidUserID,_n=mt.errorCode,Or=mt.errorInfo;return{userID:Ye(gn)?xt: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 O.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(q){var ee=A(q,2),ge=ee[0],_e=ee[1];O.setMessage("userID count:".concat(h.length)).setError(F,ge,_e).end()}),U.e("".concat(a," failed. error:"),F),be(F)})}},{key:"subscribeUserStatus",value:function(l){var p=this;if(!this._userModule.canIUse(me.USER_STATUS))return be({code:Ae.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".").concat("subscribeUserStatus"),c=l.userIDList,h=c===void 0?[]:c,m=N(h);m.length>this.MAX_SUBSCRIBE_USER_COUNT&&(U.w("".concat(a," ").concat(xa(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,O=(E===void 0?[]:E).map(function(F){var q=F.userID,ee=F.invalidUserID,ge=F.errorCode,_e=F.errorInfo;return{userID:Ye(ee)?q:ee,code:ge,message:_e}});return y.setNetworkType(p._userModule.getNetworkType()).setMessage("".concat(b," fail count:").concat(O.length)).end(),U.l("".concat(a," ok. fail count:").concat(O.length,".")),ht({failureUserList:O})}).catch(function(I){return p._userModule.probeNetwork().then(function(E){var O=A(E,2),F=O[0],q=O[1];y.setMessage("".concat(b)).setError(I,F,q).end()}),U.e("".concat(a," failed. error:"),I),be(I)})}},{key:"unsubscribeUserStatus",value:function(l){var p=this;if(!this._userModule.canIUse(me.USER_STATUS))return be({code:Ae.CANNOT_USE_COMMERCIAL_ABILITY});var a="".concat(this._n,".unsubscribeUserStatus"),c=(l||{}).userIDList,h=c===void 0?[]:c,m=N(h);h.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(U.w("".concat(a," ").concat(xa(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 O=E.data.failureUserList,F=(O===void 0?[]:O).map(function(q){var ee=q.userID,ge=q.invalidUserID,_e=q.errorCode,we=q.errorInfo;return{userID:Ye(ge)?ee:ge,code:_e,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(O){var F=A(O,2),q=F[0],ee=F[1];y.setMessage("".concat(b)).setError(E,q,ee).end()}),U.e("".concat(a," failed. error:"),E),be(E)})}},{key:"reset",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),k}(),q6=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="UserModule",c._profileHandler=new $6(w(c)),c._blacklistHandler=new B6(w(c)),c._userStatusHandler=new H6(w(c)),c.getInnerEmitterInstance().on(rr.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,N(y.blackListDelAccount))}),h.length>0&&this._blacklistHandler.onAccountDeleted(h);var m=[];c.forEach(function(y){y.blackListAddAccount&&m.push.apply(m,N(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(ra)}},{key:"filterProfanity",value:function(a,c){var h=this.getModule($a);if(!h)return!0;var m=h.filterText(c[a],ie),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),V6=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 Zo?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<y;m++)if(h[m].toLowerCase().includes("uikit")){l=!0;break}if(h=null,je&&!Go(Fe.createGamePortal)&&Go(getApp)&&!Ge(getApp())){var b=getApp().globalData;yn(b)&&b.isTUIKit===!0&&(p=!0)}this._m.getModule(ra).getStorageSync("TIM_".concat(this._SDKAppID,"_isTUIKit"))===!0&&(a=!0);var I=null;if(Pe&&!He&&typeof uni>"u"&&__wxConfig&&(I=__wxConfig.pages),xe&&typeof uni>"u"&&__qqConfig&&(I=__qqConfig.pages),rt(I)&&I.length>0){for(var E=0,O=I.length;E<O;E++)if(I[E].toLowerCase().includes("tui")){c=!0;break}I=null}return l||p||a||c}},{key:"reset",value:function(){this._isLoggedIn=!1,this._userSig="",this._a2Key="",this._tinyID="",this._customStatus="",this._statusInstanceID=0}}]),k}(),z6={"k-vue2-pc":1,"k-vue2-h5":2,"k-vue2-h5-uni":3,"k-vue2-app-uni":4,"k-vue2-mp-uni":5,"k-vue2-pc-uni":6,"k-vue3-pc":7,"k-vue3-h5":8,"k-vue3-h5-uni":9,"k-vue3-app-uni":10,"k-vue3-mp-uni":11,"k-vue3-pc-uni":12},j6=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="SignModule",c._helloInterval=120,c._lastLoginTs=0,c._lastWsHelloTs=0,c._isWebUniapp=0,u1.mixin(w(c)),c}return u(p,[{key:"onCheckTimer",value:function(a){this.isLoggedIn()&&a%this._helloInterval==0&&this._hello()}},{key:"login",value:function(a){var c="";if(this.isLoggedIn()){var h=this.getMyUserID();return(c=this.getErrorMessage("RepeatLogin",h))&&U.w(c),At({actionStatus:"OK",errorCode:0,errorInfo:c,repeatLogin:!0})}if(Date.now()-this._lastLoginTs<=15e3)return this.outputWarning("LoggingIn",a.userID),be({code:Ae.REPEAT_LOGIN});U.l("".concat(this._n,".login userID:").concat(a.userID));var m=this._checkLoginInfo(a);if(m.code!==0)return be(m);var y=this.getModule(pn),b=a.userID,I=a.userSig;return y.setUserID(b),y.setUserSig(I),this.getModule(xi).updateProtocolConfig(),this._login()}},{key:"_login",value:function(){var a=this,c=this.getModule(pn),h=c.getScene(),m=0,y=h;h&&h.startsWith("k-")&&(y=z6[h],h="tuikit");var b=new We("login");b.setMessage("".concat(y)).setMoreMessage("identifier:".concat(this.getMyUserID()));var I=h==="tuikit";Be?I?y===3||y===4||y===5||y===6?b.setUIPlatform(31):y===9||y===10||y===11||y===12?b.setUIPlatform(32):b.setUIPlatform(4):b.setUIPlatform(3):je?h==="tuikit"?b.setUIPlatform(12):b.setUIPlatform(11):lt&&(Zo?h==="flutter_web_uikit"?b.setUIPlatform(21):b.setUIPlatform(20):this._isReactUIKit()?Cr?b.setUIPlatform(25):b.setUIPlatform(24):I?y===1||y===2?b.setUIPlatform(29):y===7||y===8?b.setUIPlatform(30):Cr?b.setUIPlatform(17):b.setUIPlatform(14):Cr?b.setUIPlatform(16):b.setUIPlatform(13));var E=this.getModule(bp);if(E.canIUseOfflinePush()){this._isWebUniapp=E.getUniAppPlatform();var O=this._getStatusInstanceID();c.setStatusInstanceID(O),this.getModule(xi).updateProtocolConfig(),m=E.getDeviceBrand()}var F="".concat(this._n,"._login");return this._lastLoginTs=Date.now(),this.request({protocolName:Mp,requestData:{deviceBrand:m,isWebUniapp:this._isWebUniapp}}).then(function(q){a._lastLoginTs=0;var ee=Date.now(),ge=null,_e=q.data,we=_e.a2Key,Ue=_e.tinyID,qe=_e.helloInterval,nt=_e.instanceID,mt=_e.timeStamp,xt=_e.customStatus,gn=xt===void 0?"":xt,_n=_e.purchaseBits;U.l("".concat(F," ok. scene:").concat(h," helloInterval:").concat(qe," instanceID:").concat(nt," timeStamp:").concat(mt));var Or=1e3*mt,lo=ee-b.getStartTs(),Ho=Or+parseInt(lo/2)-ee,oi=b.getStartTs()+Ho;if(b.start(oi),function(Mi,gs){wn=gs;var xs=new Date;xs.setTime(Mi),U.i("baseTime from server:".concat(xs," offset:").concat(wn))}(Or,Ho),!Ue)throw ge=new Un({code:Ae.NO_TINYID}),b.setError(ge,!0,a.getNetworkType()).end(),ge;if(!we)throw ge=new Un({code:Ae.NO_A2KEY}),b.setError(ge,!0,a.getNetworkType()).end(),ge;var vo=d1(gn);b.setNetworkType(a.getNetworkType()).setMoreMessage("helloInterval:".concat(qe," instanceID:").concat(nt," offset:").concat(Ho," customStatus:").concat(vo)).end(),c.setA2Key(we),c.setTinyID(Ue),c.setStatusInstanceID(nt),c.setCustomStatus(vo),_n&&a.getModule(_p).onPushedConfig({errorCode:0,expiredTime:0,purchaseBits:_n}),a.getModule(xi).updateProtocolConfig(),a.emitInnerEvent(rr.A2KEY_AND_TINYID_UPDATED),a._helloInterval=qe,a.triggerReady();var es=a.getModule(bp);return es.canIUseOfflinePush()&&(uni.setStorageSync("timUniAppInstanceID",nt),es.init()),a._fetchCloudControlConfig(),a.getModule($a).init(),q}).catch(function(q){return a.probeNetwork().then(function(ee){var ge=A(ee,2),_e=ge[0],we=ge[1];b.setError(q,_e,we).end(!0)}),a._m.setNotReadyReason(Ae.LOGIN_FAILED),U.e("".concat(F," failed. error:"),q),a._lastLoginTs=0,a._m.onLoginFailed(),be(q)})}},{key:"logout",value:function(){var a=this,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;if(!this.isLoggedIn())return be({code:Ae.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(Ae.LOGGED_OUT),this.request({protocolName:T0,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(vp).fetchConfig()}},{key:"_getStatusInstanceID",value:function(){return uni.getStorageSync("timUniAppInstanceID")}},{key:"_hello",value:function(){var a=this;this._lastWsHelloTs=Date.now(),this.request({protocolName:w0,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=Ae.NO_SDKAPPID:Ye(a.userID)?c=Ae.NO_IDENTIFIER:Ye(a.userSig)&&(c=Ae.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(L.KICKED_OUT,{type:T.KICKED_OUT_MULT_ACCOUNT}),c._m.setNotReadyReason(Ae.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(L.KICKED_OUT,{type:T.KICKED_OUT_MULT_DEVICE}),c._m.setNotReadyReason(Ae.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(L.KICKED_OUT,{type:T.KICKED_OUT_USERSIG_EXPIRED}),this._m.setNotReadyReason(Ae.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(L.KICKED_OUT,{type:T.KICKED_OUT_REST_API}),this._m.setNotReadyReason(Ae.KICKED_OUT_REST_API),this._m.reset(),this.getModule(Ps).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 W6=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?V?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?V?my.getStorageSync({key:l}).data:Fe.getStorageSync(l):this._canIUseCookies()?JSON.parse(localStorage.getItem(l)):{}}},{key:"_removeStorageSync",value:function(l){je?V?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}(),K6=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,N(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}(),Hw=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()}},Y6=function(k){f(p,k);var l=R(p);function p(a){var c;i(this,p),(c=l.call(this,a))._n="EventStatModule",c.TAG="im-ssolog-event",c._reportBody=new K6,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(rr.A2KEY_AND_TINYID_UPDATED,c._onLoginSuccess,w(c)),h.on(rr.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(ra),h=c.getItem(this.TAG,!1);!Ye(h)&&Go(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()<this._lastReportTime+this.WAITING_TIME||this._reportBody.isEmpty()||this._report()}},{key:"_filterLogs",value:function(a){var c=this,h=this.getModule(pn),m=h.getSDKAppID(),y=h.getTinyID();return Eg(this.REPORT_SDKAPPID_BLACKLIST,m)&&!cp(this.REPORT_TINYID_WHITELIST,y)?[]:a.filter(function(b){return c.REPORT_LEVEL.includes(b.level)})}},{key:"_report",value:function(){var a=this;if(!this._reportBody.isEmpty()){var c=this._reportBody.getLogsInMemory(),h=this._filterLogs(c);if(h.length!==0){var m={header:Hw(this),event:h};this.request({protocolName:kp,requestData:r({},m)}).then(function(){a._lastReportTime=Date.now()}).catch(function(y){U.w("".concat(a._n,".report failed. networkType:").concat(a.getNetworkType()," error:"),y),a._reportBody.backfill(c),a._reportBody.getLogsNumInMemory()>a.MAX_THRESHOLD&&a._flushAtOnce()})}else this._lastReportTime=Date.now()}}},{key:"_flushAtOnce",value:function(){var a=this.getModule(ra),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),Lp="none",f1="online",J6=[Ae.OVER_FREQUENCY_LIMIT,Ae.OPEN_SERVICE_OVERLOAD_ERROR],X6=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===Lp?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=f1,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:f1})}},{key:"_onWebOffline",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:Lp})}},{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(Ps).reConnect(!0))):this._networkType!==a&&(h=!0,U.w("".concat(c," no network, please check!")),this._m.getModule(Ps).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===Lp?(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===Lp?c([!1,Lp]):c([!0,f1])})}},{key:"getNetworkType",value:function(){return this._networkType}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),je?this._mpNetworkStatusCallback!==null&&(Fe.offNetworkStatusChange&&(ye||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}(),p1=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,O,F){if(typeof E!="function")throw new TypeError("The listener must be a function");var q=new c(E,O||b,F),ee=p?p+I:I;return b._events[ee]?b._events[ee].fn?b._events[ee]=[b._events[ee],q]:b._events[ee].push(q):(b._events[ee]=q,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 O=0,F=E.length,q=new Array(F);O<F;O++)q[O]=E[O].fn;return q},y.prototype.listenerCount=function(b){var I=p?p+b:b,E=this._events[I];return E?E.fn?1:E.length:0},y.prototype.emit=function(b,I,E,O,F,q){var ee=p?p+b:b;if(!this._events[ee])return!1;var ge,_e,we=this._events[ee],Ue=arguments.length;if(we.fn){switch(we.once&&this.removeListener(b,we.fn,void 0,!0),Ue){case 1:return we.fn.call(we.context),!0;case 2:return we.fn.call(we.context,I),!0;case 3:return we.fn.call(we.context,I,E),!0;case 4:return we.fn.call(we.context,I,E,O),!0;case 5:return we.fn.call(we.context,I,E,O,F),!0;case 6:return we.fn.call(we.context,I,E,O,F,q),!0}for(_e=1,ge=new Array(Ue-1);_e<Ue;_e++)ge[_e-1]=arguments[_e];we.fn.apply(we.context,ge)}else{var qe,nt=we.length;for(_e=0;_e<nt;_e++)switch(we[_e].once&&this.removeListener(b,we[_e].fn,void 0,!0),Ue){case 1:we[_e].fn.call(we[_e].context);break;case 2:we[_e].fn.call(we[_e].context,I);break;case 3:we[_e].fn.call(we[_e].context,I,E);break;case 4:we[_e].fn.call(we[_e].context,I,E,O);break;default:if(!ge)for(qe=1,ge=new Array(Ue-1);qe<Ue;qe++)ge[qe-1]=arguments[qe];we[_e].fn.apply(we[_e].context,ge)}}return!0},y.prototype.on=function(b,I,E){return h(this,b,I,E,!1)},y.prototype.once=function(b,I,E){return h(this,b,I,E,!0)},y.prototype.removeListener=function(b,I,E,O){var F=p?p+b:b;if(!this._events[F])return this;if(!I)return m(this,F),this;var q=this._events[F];if(q.fn)q.fn!==I||O&&!q.once||E&&q.context!==E||m(this,F);else{for(var ee=0,ge=[],_e=q.length;ee<_e;ee++)(q[ee].fn!==I||O&&!q[ee].once||E&&q[ee].context!==E)&&ge.push(q[ee]);ge.length?this._events[F]=ge.length===1?ge[0]:ge:m(this,F)}return this},y.prototype.removeAllListeners=function(b){var I;return b?(I=p?p+b:b,this._events[I]&&m(this,I)):(this._events=new a,this._eventsCount=0),this},y.prototype.off=y.prototype.removeListener,y.prototype.addListener=y.prototype.on,y.prefixed=p,y.EventEmitter=y,k.exports=y}),Z6=["requestSnapshotUrl"],Q6=function(k){f(p,k);var l=R(p);function p(a){var c;i(this,p),(c=l.call(this,a))._n="UploadModule",c.TIMUploadPlugin=null,c.timUploadPlugin=null,c.COSSDK=null,c._cosUploadMethod=null,c.expiredTimeLimit=600,c.appid=0,c.bucketName="",c.ciUrl="",c.directory="",c.downloadUrl="",c.uploadUrl="",c.region="ap-shanghai",c.cos=null,c.cosOptions={secretId:"",secretKey:"",sessionToken:"",expiredTime:0},c.uploadFileType="",c.duration=900,c.tryCount=0,c.UPLOAD_SIZE_LIMIT={A:20971520,F:104857600,I:20971520,V:104857600};var h=c.getInnerEmitterInstance();return h.on(rr.A2KEY_AND_TINYID_UPDATED,c._init,w(c)),h.on(rr.CLOUD_CONFIG_UPDATED,c._onCloudConfigUpdated,w(c)),c}return u(p,[{key:"_init",value:function(){var a=this.getModule(Ag);if(this.TIMUploadPlugin=a.getPlugin("tim-upload-plugin"),this.TIMUploadPlugin)this._initUploaderMethod();else{var c=je?"cos-wx-sdk":"cos-js-sdk";this.COSSDK=a.getPlugin(c),this.COSSDK?(this._getAuthorizationKey(),this.outputWarning("CosReplacement",c)):this.outputWarning("PluginUndetected")}}},{key:"_onCloudConfigUpdated",value:function(){var a="".concat(this._n,"._onCloudConfigUpdated"),c=this.getCloudConfig("upload_size_limit");if(U.l("".concat(a," uploadSizeLimit:").concat(c)),!Ge(c))try{var h=JSON.parse(c);this.UPLOAD_SIZE_LIMIT={A:h.a?1048576*parseInt(h.a):this.UPLOAD_SIZE_LIMIT.A,F:h.f?1048576*parseInt(h.f):this.UPLOAD_SIZE_LIMIT.F,I:h.i?1048576*parseInt(h.i):this.UPLOAD_SIZE_LIMIT.I,V:h.v?1048576*parseInt(h.v):this.UPLOAD_SIZE_LIMIT.V}}catch{U.e("".concat(a," JSON parse error. uploadSizeLimit:"),c)}}},{key:"_getAuthorizationKey",value:function(){var a=this,c="".concat(this._n,".").concat("_getAuthorizationKey"),h=new We("_getAuthorizationKey"),m=Math.ceil(Date.now()/1e3);this.request({protocolName:O_,requestData:{duration:this.expiredTimeLimit}}).then(function(y){var b=y.data;U.l("".concat(c," ok. data:"),b);var I=b.expiredTime-m;h.setMessage("requestId:".concat(b.requestId," requestTime:").concat(m," expiredTime:").concat(b.expiredTime," diff:").concat(I,"s")).setNetworkType(a.getNetworkType()).end(),!je&&b.region&&(a.region=b.region),a.appid=b.appid,a.bucketName=b.bucketName,a.ciUrl=b.ciUrl,a.directory=b.directory,a.downloadUrl=b.downloadUrl,a.uploadUrl=b.uploadUrl,a.cosOptions={secretId:b.secretId,secretKey:b.secretKey,sessionToken:b.sessionToken,expiredTime:b.expiredTime},U.l("".concat(c," ok. region:").concat(a.region," bucketName:").concat(a.bucketName)),a._initUploaderMethod()}).catch(function(y){a.probeNetwork().then(function(b){var I=A(b,2),E=I[0],O=I[1];h.setError(y,E,O).end()}),U.w("".concat(c," failed. error:"),y)})}},{key:"_getCosPreSigUrl",value:function(a){var c=this,h="".concat(this._n,".").concat("_getCosPreSigUrl"),m=Math.ceil(Date.now()/1e3),y=new We("_getCosPreSigUrl");return this.request({protocolName:R_,requestData:{fileType:a.fileType,fileName:a.fileName,uploadMethod:a.uploadMethod,duration:a.duration}}).then(function(b){c.tryCount=0;var I=b.data||{},E=I.expiredTime-m;return U.l("".concat(h," ok. data:"),I),y.setMessage("requestId:".concat(I.requestId," expiredTime:").concat(I.expiredTime," diff:").concat(E,"s")).setNetworkType(c.getNetworkType()).end(),I}).catch(function(b){return b.code===-1&&(b.code=Ae.COS_GET_SIG_FAIL),c.probeNetwork().then(function(I){var E=A(I,2),O=E[0],F=E[1];y.setError(b,O,F).end()}),U.w("".concat(h," failed. error:"),b),c.tryCount<1?(c.tryCount++,c._getCosPreSigUrl(a)):(c.tryCount=0,be({code:Ae.COS_GET_SIG_FAIL}))})}},{key:"_initUploaderMethod",value:function(){var a=this;if(this.TIMUploadPlugin)return this.timUploadPlugin=new this.TIMUploadPlugin,void(this._cosUploadMethod=function(c,h){a.timUploadPlugin.uploadFile(c,h)});this.appid&&(this.cos=je?new this.COSSDK({ForcePathStyle:!0,getAuthorization:this._getAuthorization.bind(this)}):new this.COSSDK({getAuthorization:this._getAuthorization.bind(this)}),this._cosUploadMethod=je?function(c,h){a.cos.postObject(c,h)}:function(c,h){a.cos.uploadFiles(c,h)})}},{key:"onCheckTimer",value:function(a){this.COSSDK&&(this.TIMUploadPlugin||this.isLoggedIn()&&a%60==0&&Math.ceil(Date.now()/1e3)>=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(Bo);switch(a.type){case T.MSG_IMAGE:return c.addTotalCount(bi),this._uploadImage(a);case T.MSG_FILE:return c.addTotalCount(bi),this._uploadFile(a);case T.MSG_AUDIO:return c.addTotalCount(bi),this._uploadAudio(a);case T.MSG_VIDEO:return c.addTotalCount(bi),this._uploadVideo(a);default:return Promise.resolve()}}},{key:"_uploadImage",value:function(a){var c=this,h=this.getModule(sr),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),Go(y.onProgress))try{y.onProgress(b)}catch{return be({code:Ae.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(b){var I,E,O=b.location,F=b.fileType,q=b.fileSize,ee=b.width,ge=b.height,_e=b.smallImageUrl,we=b.smallImageWidth,Ue=b.smallImageHeight,qe=b.largeImageUrl,nt=b.largeImageWidth,mt=b.largeImageHeight,xt=c.isPrivateNetWork()?O:wl(O);return m.updateImageFormat(F),_e&&qe?(I={url:_e,width:we,height:Ue},E={url:qe,width:nt,height:mt}):(I=wd({originUrl:xt,originWidth:ee,originHeight:ge,min:198}),E=wd({originUrl:xt,originWidth:ee,originHeight:ge,min:720})),m.updateImageInfoArray([{size:q,url:xt,width:ee,height:ge},r({},E),r({},I)]),a})}},{key:"_uploadFile",value:function(a){var c=this,h=this.getModule(sr),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),Go(y.onProgress))try{y.onProgress(b)}catch{return be({code:Ae.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(b){var I=b.location,E=c.isPrivateNetWork()?I:wl(I);return m.updateFileUrl(E),a})}},{key:"_uploadAudio",value:function(a){var c=this,h=this.getModule(sr),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),Go(y.onProgress))try{y.onProgress(b)}catch{return be({code:Ae.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(b){var I=b.location,E=c.isPrivateNetWork()?I:wl(I);return m.updateAudioUrl(E),a})}},{key:"_uploadVideo",value:function(a){var c=this,h=this.getModule(sr),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),Go(y.onProgress))try{y.onProgress(b)}catch{return be({code:Ae.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(b){var I=b.location,E=b.snapshotInfo,O=c.isPrivateNetWork()?I:wl(I);return m.updateVideoUrl(O),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"),be({code:Ae["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 be({code:Ae.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(d6),this.uploadByCOS(a).then(function(b){return y=b,c.isPrivateNetWork()?Fu(b.location):Fu("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),u6.indexOf(c.toLowerCase())>=0||be({code:Ae.MSG_I_TYPES_LIMIT})}},{key:"_checkImageSize",value:function(a){var c=0;return(c=je?a.size:a.files[0].size)===0?be({code:Ae.MSG_F_IS_EMPTY}):c<this.UPLOAD_SIZE_LIMIT.I||this._checkSizeError("I")}},{key:"doUploadFile",value:function(a){return!a.file||this._isEmptyFileList(a.file.files)?be({code:Ae.MSG_F_SELECT_F_FIRST}):a.file.files[0].size>this.UPLOAD_SIZE_LIMIT.F?this._checkSizeError("F"):a.file.files[0].size===0?be({code:Ae.MSG_F_IS_EMPTY}):(this._setUploadFileType(h6),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?be({code:Ae.MSG_F_IS_EMPTY}):c6.indexOf(a.file.videoFile.type)===-1?be({code:Ae.MSG_V_TYPES_LIMIT}):(this._setUploadFileType(f6),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:Ae.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?be({code:Ae.MSG_F_IS_EMPTY}):(this._setUploadFileType(p6),this.uploadByCOS(a)):be({code:Ae.MSG_A_UPLOAD_FAIL})}},{key:"uploadByCOS",value:function(a){var c=this;if(!Go(this._cosUploadMethod))return this.outputWarning("PluginUndetected"),be({code:Ae.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 O=je?c._createCosOptionsWXMiniApp(a):c._createCosOptionsWeb(a),F=c;c._cosUploadMethod(O,function(q,ee){var ge=Object.create(null);if(ee){if(q||rt(ee.files)&&ee.files[0].error){var _e=new Un({code:Ae.MSG_F_UPLOAD_FAIL});return h.setError(_e,!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(_e)}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(Bo);return mt.addCost(bi,we),mt.addFileSize(bi,b.size),void h.setNetworkType(c.getNetworkType()).setMessage(nt).end()}var xt=new Un({code:Ae.MSG_F_UPLOAD_FAIL});h.setError(xt,!0,F.getNetworkType()).end(),U.w("".concat(m," failed. error:"),q),q.statusCode===403&&(U.w("".concat(m," failed. cos AccessKeyId was invalid, regain auth key!")),c._getAuthorizationKey()),E(xt)})})}},{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"),O=y.requestSnapshotUrl,F=O===void 0?void 0:O,q=D(y,Z6),ee=Date.now();c._cosUploadMethod(q,function(ge,_e){if(ge||_e.statusCode===403)return E.setError(new Un(ge),!0,c.getNetworkType()).end(),U.l("".concat(h," failed, error:"),ge),void I(new Un({code:Ae.MSG_F_UPLOAD_FAIL}));var we=Object.create(null),Ue=_e.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),xt="size:".concat(nt,",time:").concat(qe,"ms,speed:").concat(mt," res:").concat(JSON.stringify(_e.data));U.l("".concat(h," success name:").concat(m.name,",").concat(xt)),E.setNetworkType(c.getNetworkType()).setMessage(xt).end();var gn=c.getModule(Bo);gn.addCost(bi,qe),gn.addFileSize(bi,m.size);var _n=[];if(q.thumbUrl&&q.largeUrl&&(_n=[c._getSmallImageInfoByUrl(q.thumbUrl,we),c._getLargeImageInfoByUrl(q.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)||bd(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?Qi(a/1024,1)+"KB/s":Qi(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(ei(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(ei(999999)).concat(E)),m=b,y=0}return this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:h,uploadMethod:y,duration:this.duration}).then(function(O){var F=O.uploadUrl,q=O.downloadUrl,ee=O.requestSnapshotUrl,ge=ee===void 0?void 0:ee,_e=O.thumbUrl,we=O.largeUrl,Ue=O.fileKey;return{url:c._getRawOrUploadProxyUrl(F),fileType:c.uploadFileType,fileName:h,resources:m,downloadUrl:q,requestSnapshotUrl:ge,thumbUrl:_e,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(Pa(),"-").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:N_,requestData:{platform:this.getPlatform(),coverName:this._genFileName(ei(99999)),requestSnapshotUrl:a}}).then(function(y){var b=(y.data||{}).snapshotUrl;return m.setMessage("snapshotUrl:".concat(b)).end(),Ye(b)?{}:Fu(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 Fu(a).then(function(h){c.smallImageUrl=a,c.smallImageWidth=h.width,c.smallImageHeight=h.height})}},{key:"_getLargeImageInfoByUrl",value:function(a,c){return Fu(a).then(function(h){c.largeImageUrl=a,c.largeImageWidth=h.width,c.largeImageHeight=h.height})}},{key:"_isEmptyFileList",value:function(a){return!(!bd(a)||a.length!==0)}},{key:"reset",value:function(){U.l("".concat(this._n,".reset"))}}]),p}(Sr),e8=["downloadKey","pbDownloadKey","messageList"],t8=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:x_,requestData:{messageList:h}}).then(function(b){U.d("".concat(c," ok. response:"),b.data);var I=b.data,E=I.pbDownloadKey,O=I.downloadKey,F={pbDownloadKey:E,downloadKey:O,messageNumber:m};return y.setNetworkType(a._messageModule.getNetworkType()).setMessage("".concat(m,"-").concat(p,"-").concat(O)).end(),F}).catch(function(b){throw U.w("".concat(c," failed. error:"),b),a._messageModule.probeNetwork().then(function(I){var E=A(I,2),O=E[0],F=E[1];y.setError(b,O,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:U_,requestData:{downloadKey:c}}).then(function(y){if(U.d("".concat(a," ok. response:"),y.data),Go(l.clearElement)){var b=l.payload;b.downloadKey,b.pbDownloadKey,b.messageList;var I=D(b,e8);l.clearElement(),l.setElement({type:l.type,content:r({messageList:y.data.messageList},I)},h)}else{var E=[];y.data.messageList.forEach(function(O){if(!Ye(O)){var F=new Rw(O,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],O=I[1];m.setError(y,E,O).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 O=a.pbDownloadKey,F=a.downloadKey,q=a.messageNumber,ee=l.payload,ge=ee.title,_e=ee.abstractList,we=ee.compatibleText,Ue=this._messageModule.getModule(ao),qe=Ue&&Ue.isOnlineMessage(l,p)?0:void 0;return{protocolName:Ip,tjgID:this._messageModule.generateTjgID(l),requestData:{fromAccount:this._messageModule.getMyUserID(),toAccount:l.to,msgBody:[{msgType:l.type,msgContent:{pbDownloadKey:O,downloadKey:F,title:ge,abstractList:_e,compatibleText:we,messageNumber:q}}],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 O=a.pbDownloadKey,F=a.downloadKey,q=a.messageNumber,ee=l.payload,ge=ee.title,_e=ee.abstractList,we=ee.compatibleText,Ue=this._messageModule.getModule(It),qe=Ue&&Ue.isOnlineMessage(l,p)?1:0;return{protocolName:Cp,tjgID:this._messageModule.generateTjgID(l),requestData:{fromAccount:this._messageModule.getMyUserID(),groupID:l.to,msgBody:[{msgType:l.type,msgContent:{pbDownloadKey:O,downloadKey:F,title:ge,abstractList:_e,compatibleText:we,messageNumber:q}}],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}(),n8={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},r8=[Ae.MSG_ONPROGRESS_FUNCTION_ERROR,Ae.MSG_I_SELECT_F_FIRST,Ae.MSG_I_TYPES_LIMIT,Ae.MSG_F_IS_EMPTY,Ae.MSG_I_SIZE_LIMIT,Ae.MSG_F_SELECT_F_FIRST,Ae.MSG_F_SIZE_LIMIT,Ae.MSG_V_SIZE_LIMIT,Ae.MSG_V_TYPES_LIMIT,Ae.MSG_A_UPLOAD_FAIL,Ae.MSG_A_SIZE_LIMIT,Ae.COS_UNDETECTED];function qw(k){var l=!1;return Object.values(n8).includes(k)&&(l=!0),(k>=120001&&k<=13e4||k>=10100&&k<=10200)&&(l=!0),l}var o8=["conversationID","timePosition","timePeriod"],i8=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="MessageModule",c._messageOptionsMap=new Map,c._mergerMessageHandler=new t8(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 qr(a),m=Et(a.payload)?a.payload:a.payload.text,y=new e1({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 qr(a);if(je){var m=a.payload.file;if(Br(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(Br(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 O=new t1({imageFormat:cs.UNKNOWN,uuid:this._generateUUID(a.payload.file),file:a.payload.file}),F=this._getNickAndAvatarByUserID(c);return h.setElement(O),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 qr(a),b=new r1({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(V)return void this.outputWarning("VideoUnsupportedInAlipay");if(Br(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(Br(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 qr(a),O=new s1({videoFormat:h.type,videoSecond:Qi(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(O),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 qr(a),m=new i1({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 qr(a),m=new n1(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 qr(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(),O=this._getNickAndAvatarByUserID(E);if(y.type===T.MSG_GRP_TIP)return be({code:Ae.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},q=new qr(F);return q.setElement(y.getElements()[0]),q.setNickAndAvatar(O),q.setNameCard(this._getNameCardByGroupID(y)),q.setRelayFlag(!0),q}},{key:"downloadMergerMessage",value:function(a){return this._mergerMessageHandler.downloadMergerMessage(a)}},{key:"createFileMessage",value:function(a){if(je){if(!Pe&&!xe&&!ye)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||ye){if(Br(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,O=r(r({},E[0]),{},{url:E[0].path});a.payload.file={files:[O]}}var F=this.getMyUserID();a.currentUser=F,a.senderTinyID=this.getMyTinyID();var q=new qr(a),ee=new o1({uuid:this._generateUUID(a.payload.file),file:a.payload.file}),ge=this._getNickAndAvatarByUserID(F);return q.setElement(ee),q.setNickAndAvatar(ge),q.setNameCard(this._getNameCardByGroupID(q)),this._messageOptionsMap.set(q.clientSequence,a),q}},{key:"createLocationMessage",value:function(a){var c=this.getMyUserID();a.currentUser=c,a.senderTinyID=this.getMyTinyID();var h=new qr(a),m=new a1(a.payload),y=this._getNickAndAvatarByUserID(c);return h.setElement(m),h.setNickAndAvatar(y),h.setNameCard(this._getNameCardByGroupID(h)),h}},{key:"_onCannotFindModule",value:function(){return be({code:Ae.CANNOT_FIND_MODULE})}},{key:"sendMessageInstance",value:function(a,c){var h=this;if(this.getModule($a).filterMessage(a,c)===!1)return this._onSendMessageFailed(a,new Un({code:Ae.PROFANITY_FOUND}));var m=null;if(a.conversationType===T.CONV_C2C)m=this.getModule(ao);else{if(a.conversationType!==T.CONV_GROUP)return be({code:Ae.MSG_INVALID_CONV_TYPE});m=this.getModule(It)}var y,b="".concat(this._n,".sendMessageInstance"),I=this.getModule(ct),E=m.isOnlineMessage(a,c);return this.getModule(vw).upload(a).then(function(){return h._getSendMessageSpecifiedKey(a)===zu&&h.getModule(Bo).addSuccessCount(bi),h._guardForGroup(a).then(function(){if(!a.isSendable())return be({code:Ae.MSG_F_URL_IS_EMPTY});h._addSendMessageTotalCount(a),y=Date.now();var O=function(F){var q="utf-8";lt&&document&&(q=document.charset.toLowerCase());var ee,ge,_e=0;if(ge=F.length,q==="utf-8"||q==="utf8")for(var we=0;we<ge;we++)(ee=F.codePointAt(we))<=127?_e+=1:ee<=2047?_e+=2:ee<=65535?_e+=3:(_e+=4,we++);else if(q==="utf-16"||q==="utf16")for(var Ue=0;Ue<ge;Ue++)(ee=F.codePointAt(Ue))<=65535?_e+=2:(_e+=4,Ue++);else _e=F.replace(/[^\x00-\xff]/g,"aa").length;return _e}(JSON.stringify(a));return a.type===T.MSG_MERGER&&O>11264?h._mergerMessageHandler.uploadMergerMessage(a,O).then(function(F){var q=h._mergerMessageHandler.createMergerMessagePack(a,c,F);return h.request(q)}):(I.setMessageRandom(a),m.sendMessage(a,c))}).then(function(O){var F=O.data,q=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 _e=I.findMessage(a.ID);_e&&(U.l("".concat(b," resend ok. ID:").concat(_e.ID)),I.deleteLocalMessage(_e))}a.status=so.SUCCESS,a.time=q;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 xt=a.conversationType;oo(a.to)&&(xt=T.CONV_TOPIC,h.getModule(ar).onMessageSent({groupID:Lr(a.to),topicID:a.to,lastMessage:mt})),I.onMessageSent({conversationOptionsList:[{conversationID:a.conversationID,unreadCount:0,type:xt,subType:a.conversationSubType,lastMessage:mt}]})}return a.getRelayFlag()||a.type!=="TIMImageElem"||Gu(a.payload.imageInfoArray),ht({message:a})})}).catch(function(O){return h._onSendMessageFailed(a,O,E)})}},{key:"_guardForGroup",value:function(a){if(a.conversationType!==T.CONV_GROUP)return Promise.resolve();var c=this.getModule(It);if(!c)return this._onCannotFindModule();if(go({groupID:a.to})){var h=c.getLocalGroupProfile(a.to);if(h&&h.isSupportTopic)return be({code:Ae.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 O=A(E,2),F=O[0],q=O[1];I.setError(c,F,q).end()}),U.e("".concat(m," error:"),c),be(new Un({code:c&&c.code?c.code:Ae.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 zu;if(a.conversationType===T.CONV_C2C)return Dd;if(a.conversationType===T.CONV_GROUP){var c=this.getModule(It);if(!c)return;var h=c.getLocalGroupProfile(a.to);if(!h)return;var m=h.type;return $o(m)?Ad:Ed}}},{key:"_addSendMessageTotalCount",value:function(a){var c=this._getSendMessageSpecifiedKey(a);c&&this.getModule(Bo).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(Bo);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(Bo),E=this._getSendMessageSpecifiedKey(a);E===zu&&(h=b,m=!1,r8.includes(h)&&(m=!0),m)?I.addFailedCountOfUserSide(bi):qw(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(It)),!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(),be(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 O=A(E,2),F=O[0],q=O[1];m.setError(b,F,q).end()});var I=new Un({code:b&&b.code?b.code:Ae.MSG_REVOKE_FAIL,message:b&&b.message?b.message:void 0,data:{message:a}});return U.w("".concat(y," failed. error:"),b),be(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(q){q&&q.status===so.SUCCESS&&q.conversationID===y&&(q._onlineOnlyFlag||I.push("".concat(q.sequence,"_").concat(q.random,"_").concat(q.time)),E.push(q))});else if(m.conversationType===T.CONV_GROUP)h=this.getModule(It),b=y.replace(T.CONV_GROUP,""),a.forEach(function(q){q&&q.status===so.SUCCESS&&q.conversationID===y&&(q._onlineOnlyFlag||I.push("".concat(q.sequence)),E.push(q))});else if(m.conversationType===T.CONV_SYSTEM)return be({code:Ae.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 O=new We("deleteMessage");O.setMessage("to:".concat(b," count:").concat(I.length));var F="".concat(this._n,".").concat("deleteMessage");return h.deleteMessage({to:b,keyList:I}).then(function(q){return O.end(),U.i("".concat(F," ok")),c._onMessageDeleted(E)}).catch(function(q){c.probeNetwork().then(function(ge){var _e=A(ge,2),we=_e[0],Ue=_e[1];O.setError(q,we,Ue).end()}),U.w("".concat(F," failed. error:"),q);var ee=new Un({code:q&&q.code?q.code:Ae.MSG_DELETE_FAIL,message:q&&q.message?q.message:void 0});return be(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:X_,requestData:{sourceTextList:h,source:m||"auto",target:y,from:this.getMyTinyID(),SDKAppID:this.getSDKAppID()}}).then(function(I){var E=I.data,O=E.error,F=E.requestID,q=E.translatedTextList;if(O.code===0)return b.end(),U.i("".concat(c," ok. requestID:").concat(F)),ht({translatedTextList:q});throw r(r({},O),{},{requestID:F})}).catch(function(I){return b.setCode(I.code).setMoreMessage(I.requestID).end(),U.w("".concat(c," failed. error:"),I),be({code:Ae.TRANSLATE_TEXT_FAIL})})}},{key:"modifyRemoteMessage",value:function(a){var c=this,h=null,m=a.conversationType,y=a.to,b=this.getModule(It);if(!b)return this._onCannotFindModule();if(b.isMessageFromOrToAVChatroom(y))return be({code:Ae.MSG_MODIFY_DISABLED_IN_AVCHATROOM,data:{message:a}});if(this.getModule($a).filterMessage(a)===!1)return be({code:Ae.PROFANITY_FOUND,data:{message:a}});m===T.CONV_C2C?h=this.getModule(ao):m===T.CONV_GROUP&&(h=this.getModule(It));var I=new We("modifyMessage");I.setMessage("to:".concat(y));var E="".concat(this._n,".modifyRemoteMessage");return h.modifyRemoteMessage(a).then(function(O){I.end(),U.i("".concat(E," ok"));var F=c._onModifyRemoteMessageResp(a,O.data);return ht({message:F})}).catch(function(O){if(I.setCode(O.code).setMoreMessage(O.message).end(),U.w("".concat(E," failed. error:"),O),O.code===20027){var F=c._onModifyRemoteMessageResp(a,O.data);return be({code:Ae.MSG_MODIFY_CONFLICT,data:{message:F}})}return be({code:O.code,message:O.message,data:{message:a}})})}},{key:"_generateSearchRequestData",value:function(a){var c=a.conversationID,h=a.timePosition,m=a.timePeriod,y=r(r({},D(a,o8)),{},{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 be({code:Ae.OPTIONS_IS_EMPTY,message:this.getErrorMessage(Ae.OPTIONS_IS_EMPTY,h)});var y=a.keywordList,b=a.keywordListMatchType,I=a.conversationID,E=a.cursor,O=rt(a.senderUserIDList)&&a.senderUserIDList.length>0,F=rt(a.messageTypeList)&&a.messageTypeList.length>0;if(!(y||O&&F))throw U.e("[".concat(h,'] Missing required params: "keywordList".')),new Error("Params validate failed.");var q=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(_e){var we=_e.data,Ue=we.errorCode,qe=we.errorInfo,nt=Date.now()-q;if(Ue!==0){if(Ue===Ae.ERR_SVR_COMM_INVALID_SERVICE||Ue===Ae.MSG_SEARCH_CURSOR_INVALID||Ue===Ae.MSG_SEARCH_CURSOR_EXPIRED)return be({code:Ue});throw new Un({code:Ue,message:qe})}var mt=_e.data,xt=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(xt," totalCount:").concat(gn," cost ").concat(nt," ms")),ht({searchResultList:Or,cursor:xt,totalCount:gn})}).catch(function(_e){return c.probeNetwork().then(function(we){var Ue=A(we,2),qe=Ue[0],nt=Ue[1];ee.setMessage(ge).setError(_e,qe,nt).end()}),be(_e)})}},{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,O=y?"".concat(T.CONV_GROUP).concat(y):"".concat(T.CONV_C2C).concat(b),F={conversationID:O,messageCount:I,messageList:[]};return c&&I>1||E&&E.length>0&&(F.messageList=h.onRoamingMessage(E,O,!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,O=c.elements,F=c.messageVersion,q=c.cloudCustomData,ee=q===void 0?"":q;return this.getModule(ct).onMessageModified({conversationType:h,from:m,to:y,time:E,random:b,sequence:I,elements:O,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+=Id[Math.floor(Math.random()*lp)];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(It);if(c)return c.getMyNameCardByGroupID(a.to)}return""}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._messageOptionsMap.clear()}}]),p}(Sr),s8=function(k){f(p,k);var l=R(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,O=m.clientTime,F=m.random,q="".concat(I,"-").concat(O,"-").concat(F),ee=[],ge=[];U.l("".concat(this._n,".onMessageExtensionNotify messageID:").concat(q," operateType:").concat(y," globalSequence:").concat(E)),this._updateGlobalSequence(q,E);var _e=!1,we=!1;b.forEach(function(Ue){var qe=Ue.extensions,nt=qe===void 0?[]:qe,mt=Ue.clearSequence;y===1?(_e=!0,nt.forEach(function(xt){ee.push({key:xt.key,value:xt.value})}),c._updateLocalExtension(q,nt)):y===2?(we=!0,nt.forEach(function(xt){ge.push(xt.key)}),c._updateLocalExtension(q,nt)):y===3&&(we=!0,c._hasLocalExtension(q)&&c._getLocalExtension(q).forEach(function(xt,gn){xt.seq<=mt&&!Ye(xt.value)&&ge.push(gn)}),c._clearLocalExtension(q,mt))}),_e&&this.emitOuterEvent(L.MESSAGE_EXTENSIONS_UPDATED,{messageID:q,extensions:ee}),we&&this.emitOuterEvent(L.MESSAGE_EXTENSIONS_DELETED,{messageID:q,keyList:ge})}},{key:"setMessageExtensions",value:function(a,c){var h=this;if(!this.canIUse(me.MSG_EXT))return be({code:Ae.CANNOT_USE_COMMERCIAL_ABILITY});var m="".concat(this._n,".").concat("setMessageExtensions"),y=a.ID,b=a.conversationID,I=a.sequence,E=a.time,O=N(c);c.length>20&&(O=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(O.length),q=new We("setMessageExtensions");return q.setMessage(F),U.l("".concat(m," ").concat(F)),this._modifyMessageExtensions(a,O).then(function(ee){var ge=ee.resultList,_e=ee.successCount,we=ee.failureCount,Ue="success count:".concat(_e," fail count:").concat(we);return q.setMoreMessage(Ue).end(),U.l("".concat(m," ok. ").concat(Ue)),ht({extensions:ge})}).catch(function(ee){return h.probeNetwork().then(function(ge){var _e=A(ge,2),we=_e[0],Ue=_e[1];q.setError(ee,we,Ue).end()}),U.e("".concat(m," failed. error:"),ee),be(ee)})}},{key:"getMessageExtensions",value:function(a){var c=this;if(!this.canIUse(me.MSG_EXT))return be({code:Ae.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),O=new We("getMessageExtensions");O.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(q){return O.end(),U.l("".concat(h," ok. total count:").concat(q.length)),Ge(F)&&q.length>0&&c.getMessageExtensionsMap.set(m,1),ht({extensions:q})}).catch(function(q){return c.probeNetwork().then(function(ee){var ge=A(ee,2),_e=ge[0],we=ge[1];O.setError(q,_e,we).end()}),U.e("".concat(h," failed. error:"),q),be(q)})}},{key:"deleteMessageExtensions",value:function(a,c){var h=this;if(!this.canIUse(me.MSG_EXT))return be({code:Ae.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,O=a.sequence,F=a.time,q="conversationID:".concat(E," messageID:").concat(I," sequence:").concat(O," time:").concat(F," operateType:").concat(b),ee=new We("deleteMessageExtensions");return ee.setMessage(q),U.l("".concat(m," ").concat(q)),this._modifyMessageExtensions(a,y,b).then(function(ge){var _e=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:_e})}).catch(function(ge){return h.probeNetwork().then(function(_e){var we=A(_e,2),Ue=we[0],qe=we[1];ee.setError(ge,Ue,qe).end()}),U.e("".concat(m," failed. error:"),ge),be(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(It);break;case T.CONV_TOPIC:I=this.getModule(ar);break;default:return be({code:Ae.CANNOT_FIND_MODULE})}return I.modifyMessageExtensions(a,b,m).then(function(E){var O=E.data,F=O.extensions,q=O.seq,ee=[],ge=0,_e=0,we=[];return(F=Ye(F)?[]:F).forEach(function(Ue){var qe=Ue.errorCode,nt=Ue.extension,mt=nt.key,xt=nt.value,gn=nt.seq;ee.push({code:qe,key:mt,value:xt}),qe===0?ge++:_e++,we.push({key:mt,value:xt,seq:gn})}),h._updateGlobalSequence(a.ID,q),we.length>0&&(h._updateLocalExtension(a.ID,we),we=null),{resultList:ee,successCount:ge,failureCount:_e}}).catch(function(E){return be(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(It);break;case T.CONV_TOPIC:I=this.getModule(ar);break;default:return be({code:Ae.CANNOT_FIND_MODULE})}return I.getMessageExtensions(a,c).then(function(E){var O=E.data,F=O.extensions,q=O.completeFlag,ee=O.globalSequence,ge=O.clearSequence;if(F=Ye(F)?[]:F,U.l("".concat(m," ok. completeFlag:").concat(q," globalSequence:").concat(ee," clearSequence:").concat(ge," count:").concat(F.length)),h._updateLocalExtension(y,F),h._clearLocalExtension(y,ge),h._updateGlobalSequence(y,ee),q!==1){var _e=F.slice(-1)[0].seq+1;return h._getMessageExtensions(a,_e)}return h._getLocalExtensions(y)}).catch(function(E){return be(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),a8=function(k){f(p,k);var l=R(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 be({code:Ae.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,O=b.readReceiptCode;un(O)&&O!==0&&(new We("sendMessageWithReceipt").setMessage("from:".concat(h.from," to:").concat(h.to," sequence:").concat(E," readReceiptCode:").concat(O)).end(),U.w("".concat(c._n,".sendMessage readReceiptCode:").concat(O," message:").concat(c.getErrorMessage(O)))),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 q=h;return h._isExcludedFromLastMessage===!0&&(q=""),F.onMessageSent({conversationOptionsList:[{conversationID:h.conversationID,unreadCount:0,type:h.conversationType,subType:h.conversationSubType,lastMessage:q}]}),ht({message:h})}).catch(function(y){return c._onSendMessageFailed(h,y)})}},{key:"_sendComboMessage",value:function(a,c){var h=this._m.getModule(xi),m="";return a.conversationType===T.CONV_C2C&&(m="".concat(K.NAME.OPEN_IM,".").concat(Ip)),a.conversationType===T.CONV_GROUP&&(m="".concat(K.NAME.GROUP,".").concat(Cp)),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=N(b),a.To_Account=N(b)}a.IsNeedReadReceipt!==1&&a.NeedReadReceipt!==1||(y.needReadReceipt=!0),a.SupportMessageExtension===1&&(y.isSupportExtension=!0),(h=new qr(y)).status=so.UNSEND,a.MsgClientTime=h.clientTime,h.conversationType===T.CONV_C2C&&(a.MsgSeq=h.sequence);for(var I,E=a.MsgBody.length,O=0;O<E;O++)(I=a.MsgBody[O]).MsgType==="TIMTextElem"?h.setTextElement(I.MsgContent.Text):I.MsgType==="TIMCustomElem"?h.setCustomElement({data:I.MsgContent.Data||"",description:I.MsgContent.Desc||"",extension:I.MsgContent.Ext||""}):I.MsgType==="TIMFaceElem"&&h.setFaceElement({index:I.MsgContent.Index,data:I.MsgContent.Data});var F=h.getElements();h.payload=F[0].content,h.type=F[0].type}catch(q){h=null,U.e("".concat(c," failed. error:"),q)}return h}},{key:"_onSendMessageFailed",value:function(a,c){a.status=so.FAIL,this.getModule(ct).deleteMessageRandom(a),this._addSendMessageFailCountOnUser(a,c);var h=new We("sendMessage");return h.setMessage("tjg_id:".concat(this.generateTjgID(a)," type:").concat(a.type," from:").concat(a.from," to:").concat(a.to)),this.probeNetwork().then(function(m){var y=A(m,2),b=y[0],I=y[1];h.setError(c,b,I).end()}),U.e("".concat(this._n,"._onSendMessageFailed error:"),c),be(new Un({code:c&&c.code?c.code:Ae.MSG_SEND_FAIL,message:c&&c.message?c.message:void 0,data:{message:a}}))}},{key:"_getSendMessageSpecifiedKey",value:function(a){if(a.conversationType===T.CONV_C2C)return Dd;if(a.conversationType===T.CONV_GROUP){var c=this.getModule(It).getLocalGroupProfile(a.to);if(!c)return;var h=c.type;return $o(h)?Ad:Ed}}},{key:"_addSendMessageTotalCount",value:function(a){var c=this._getSendMessageSpecifiedKey(a);c&&this.getModule(Bo).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(Bo);y.addSuccessCount(m),y.addCost(m,h)}}},{key:"_addSendMessageFailCountOnUser",value:function(a,c){var h=c.code,m=h===void 0?-1:h,y=this.getModule(Bo),b=this._getSendMessageSpecifiedKey(a);qw(m)&&b&&y.addFailedCountOfUserSide(b)}}]),p}(Sr),l8=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="PluginModule",c.plugins={},c}return u(p,[{key:"registerPlugin",value:function(a){var c=this;Object.keys(a).forEach(function(h){c.plugins[h]=a[h]}),new We("registerPlugin").setMessage("".concat(Object.keys(a))).end()}},{key:"getPlugin",value:function(a){return this.plugins[a]}},{key:"reset",value:function(){}}]),p}(Sr),u8=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="SyncUnreadMessageModule",c._cookie="",c._onlineSyncFlag=!1,c.getInnerEmitterInstance().on(rr.A2KEY_AND_TINYID_UPDATED,c._onLoginSuccess,w(c)),c}return u(p,[{key:"_onLoginSuccess",value:function(a){this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:0})}},{key:"_startSync",value:function(a){var c=this,h=a.cookie,m=a.syncFlag,y=a.isOnlineSync,b="".concat(this._n,"._startSync");U.l("".concat(b," cookie:").concat(h," syncFlag:").concat(m," isOnlineSync:").concat(y)),this.request({protocolName:k0,requestData:{cookie:h,syncFlag:m,isOnlineSync:y}}).then(function(I){var E=I.data,O=E.cookie,F=E.syncFlag;c._cookie=O,Ye(O)||(F===0||F===1?(c._dispatchUnreadMessage(r(r({},I.data),{},{isSyncingEnded:!1})),c._startSync({cookie:O,syncFlag:F,isOnlineSync:0})):F===2&&c._dispatchUnreadMessage(r(r({},I.data),{},{isSyncingEnded:!0})))}).catch(function(I){U.e("".concat(b," failed. error:"),I)})}},{key:"_dispatchUnreadMessage",value:function(a){a.eventArray&&this.getModule(xi).onMessage({head:{},body:{eventArray:a.eventArray,isInstantMessage:this._onlineSyncFlag,isSyncingEnded:a.isSyncingEnded}}),this.getModule(ao).onNewC2CMessage({dataList:a.messageList,isInstantMessage:!!a.isSyncingEnded&&this._onlineSyncFlag,C2CRemainingUnreadList:a.C2CRemainingUnreadList,C2CPairUnreadList:a.C2CPairUnreadList,isSyncingEnded:a.isSyncingEnded})}},{key:"startOnlineSync",value:function(){U.l("".concat(this._n,".startOnlineSync")),this._onlineSyncFlag=!0,this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:1})}},{key:"startSyncOnReconnected",value:function(){U.l("".concat(this._n,".startSyncOnReconnected.")),this._onlineSyncFlag=!0,this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:0})}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._onlineSyncFlag=!1,this._cookie=""}}]),p}(Sr),sm={request:{toAccount:"To_Account",fromAccount:"From_Account",to:"To_Account",from:"From_Account",groupID:"GroupId",groupAtUserID:"GroupAt_Account",extension:"Ext",data:"Data",description:"Desc",elements:"MsgBody",sizeType:"Type",downloadFlag:"Download_Flag",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",videoUrl:"",imageUrl:"URL",fileUrl:"Url",uuid:"UUID",priority:"MsgPriority",receiverUserID:"To_Account",receiverGroupID:"GroupId",messageSender:"SenderId",messageReceiver:"ReceiverId",nick:"From_AccountNick",avatar:"From_AccountHeadurl",messageNumber:"MsgNum",pbDownloadKey:"PbMsgKey",downloadKey:"JsonMsgKey",applicationType:"PendencyType",userIDList:"To_Account",groupNameList:"GroupName",userID:"To_Account",groupAttributeList:"GroupAttr",mainSequence:"AttrMainSeq",avChatRoomKey:"BytesKey",attributeControl:"AttrControl",sequence:"seq",messageControlInfo:"SendMsgControl",updateSequence:"UpdateSeq",clientTime:"MsgClientTime",sequenceList:"MsgSeqList",topicID:"TopicId",customData:"CustomString",isSupportTopic:"SupportTopic",isWebUniapp:"is_web_uniapp",isSupportExtension:"SupportMessageExtension",messageSequence:"MsgSeq",messageKey:"MsgKey",startSequence:"startSeq",simplifiedMessage:"DownsizeFlag"},response:{MsgPriority:"priority",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",Download_Flag:"downloadFlag",GroupId:"groupID",Member_Account:"userID",MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",MsgSeq:"sequence",MsgRandom:"random",MsgTime:"time",MsgTimeStamp:"time",MsgContent:"content",MsgBody:"elements",From_AccountNick:"nick",From_AccountHeadurl:"avatar",GroupWithdrawInfoArray:"revokedInfos",GroupReadInfoArray:"groupMessageReadNotice",LastReadMsgSeq:"lastMessageSeq",WithdrawC2cMsgNotify:"c2cMessageRevokedNotify",C2cWithdrawInfoArray:"revokedInfos",C2cReadedReceipt:"c2cMessageReadReceipt",ReadC2cMsgNotify:"c2cMessageReadNotice",LastReadTime:"peerReadTime",MsgRand:"random",MsgType:"type",MsgShow:"messageShow",NextMsgSeq:"nextMessageSeq",FaceUrl:"avatar",ProfileDataMod:"profileModify",Profile_Account:"userID",ValueBytes:"value",ValueNum:"value",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgFrom_AccountExtraInfo:"messageFromAccountExtraInformation",Operator_Account:"operatorID",OpType:"operationType",ReportType:"operationType",UserId:"userID",User_Account:"userID",List_Account:"userIDList",MsgOperatorMemberExtraInfo:"operatorInfo",MsgMemberExtraInfo:"memberInfoList",ImageUrl:"avatar",NickName:"nick",MsgGroupNewInfo:"newGroupProfile",MsgAppDefinedData:"groupCustomField",Owner_Account:"ownerID",GroupFaceUrl:"avatar",GroupIntroduction:"introduction",GroupNotification:"notification",GroupApplyJoinOption:"joinOption",MsgKey:"messageKey",GroupInfo:"groupProfile",ShutupTime:"muteTime",Desc:"description",Ext:"extension",GroupAt_Account:"groupAtUserID",MsgNum:"messageNumber",PbMsgKey:"pbDownloadKey",JsonMsgKey:"downloadKey",MsgModifiedFlag:"isModified",PendencyItem:"applicationItem",PendencyType:"applicationType",AddTime:"time",AddSource:"source",AddWording:"wording",ProfileImImage:"avatar",PendencyAdd:"friendApplicationAdded",FrienPencydDel_Account:"friendApplicationDeletedUserIDList",Peer_Account:"userID",GroupAttr:"groupAttributeList",GroupAttrAry:"groupAttributeList",AttrMainSeq:"mainSequence",seq:"sequence",GroupAttrOption:"groupAttributeOption",BytesChangedKeys:"changedKeyList",GroupAttrInfo:"groupAttributeList",GroupAttrSeq:"mainSequence",PushChangedAttrValFlag:"isWithChangedAttributeInfo",SubKeySeq:"sequence",Val:"value",MsgGroupFromCardName:"senderNameCard",MsgGroupFromNickName:"senderNick",C2cNick:"peerNick",C2cImage:"peerAvatar",SendMsgControl:"messageControlInfo",NoLastMsg:"excludedFromLastMessage",NoUnread:"excludedFromUnreadCount",UpdateSeq:"updateSequence",MuteNotifications:"muteFlag",MsgClientTime:"clientTime",TinyId:"tinyID",GroupMsgReceiptList:"readReceiptList",ReadNum:"readCount",UnreadNum:"unreadCount",TopicId:"topicID",MillionGroupFlag:"communityType",SupportTopic:"isSupportTopic",MsgTopicNewInfo:"newTopicInfo",ShutupAll:"muteAllMembers",CustomString:"customData",TopicFaceUrl:"avatar",TopicIntroduction:"introduction",TopicNotification:"notification",TopicIdArray:"topicIDList",MsgVersion:"messageVersion",C2cMsgModNotifys:"c2cMessageModified",GroupMsgModNotifys:"groupMessageModified",ApplyJoinOption:"joinOption",MsgFlag:"messageRemindType",AtInfoList:"groupAtInfoList",AtFlagList:"groupAtType",AtMsgSeq:"sequence",BanDuration:"duration",BanDescription:"reason",NotVisible:"invisible",BytesTag:"tag",BytesValue:"value",RptBytesValue:"value",LatestSeq:"globalSequence",ClearSeq:"clearSequence",SupportMessageExtension:"isSupportExtension",ExtensionList:"extensions",GroupCounter:"counterList",Revoker_Account:"revoker",MsgExtensionNotify:"messageExtensionNotify",ExtensionC2cMsgInfo:"messageInfo",ExtensionGroupMsgInfo:"messageInfo",MsgOptType:"operateType",SetKVInfo:"operateResultList",DeleteKVInfo:"operateResultList",ClearKVInfo:"operateResultList",MsgKeyValue:"extensions",ClearMsgSeq:"clearSequence",MsgLastSeq:"globalSequence",InviteJoinOption:"inviteOption",MemberList_Account:"inviteeList",MsgMemberExtraInfoList:"inviteeInfoList",E:"event",GInf:"groupProfile",MCT:"clientTime",MR:"random",MP:"priority",MTS:"time",GId:"groupID",MS:"sequence",CCD:"cloudCustomData",F_Account:"from",F_Hd:"avatar",F_NN:"nick",GN:"groupName",GT:"groupType",IsSys:"isSystemMessage",OpInf:"operatorInfo",Img:"avatar",NN:"nick",OnlineInf:"onlineMemberInfo",ET:"expireTime",Num:"onlineMemberNum",Opt:"operationType",O_Account:"operatorID",RT:"operationType",UDF:"userDefinedField",L_Account:"userIDList",IsPlaceMsg:"isPlaceMessage"},ignoreKeyWord:["C2C","ID","USP"]};function h1(k,l){if(typeof k!="string"&&!Array.isArray(k))throw new TypeError("Expected the input to be `string | string[]`");l=Object.assign({pascalCase:!1},l);var p;return(k=Array.isArray(k)?k.map(function(a){return a.trim()}).filter(function(a){return a.length}).join("-"):k.trim()).length===0?"":k.length===1?l.pascalCase?k.toUpperCase():k.toLowerCase():(k!==k.toLowerCase()&&(k=c8(k)),k=k.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,function(a,c){return c.toUpperCase()}).replace(/\d+(\w|$)/g,function(a){return a.toUpperCase()}),p=k,l.pascalCase?p.charAt(0).toUpperCase()+p.slice(1):p)}var c8=function(k){for(var l=!1,p=!1,a=!1,c=0;c<k.length;c++){var h=k[c];l&&/[a-zA-Z]/.test(h)&&h.toUpperCase()===h?(k=k.slice(0,c)+"-"+k.slice(c),l=!1,a=p,p=!0,c++):p&&a&&/[a-zA-Z]/.test(h)&&h.toLowerCase()===h?(k=k.slice(0,c-1)+"-"+k.slice(c-1),a=p,p=!1,l=!0):(l=h.toLowerCase()===h&&h.toUpperCase()!==h,a=p,p=h.toUpperCase()===h&&h.toLowerCase()!==h)}return k};function d8(k,l){var p=0;return function a(c,h){if(++p>100)return p--,c;if(rt(c)){var m=c.map(function(O){return Zi(O)?a(O,h):O});return p--,m}if(Zi(c)){var y=(b=c,I=function(O,F){if(!Md(F))return!1;if((ee=F)!==h1(ee))for(var q=0;q<sm.ignoreKeyWord.length&&!F.includes(sm.ignoreKeyWord[q]);q++);var ee;return Ge(h[F])?function(ge){return ge==="OPPOChannelID"?ge:ge[0].toUpperCase()+h1(ge).slice(1)}(F):h[F]},E=Object.create(null),Object.keys(b).forEach(function(O){var F=I(b[O],O);F&&(E[F]=b[O])}),E);return y=Uu(y,function(O,F){return rt(O)||Zi(O)?a(O,h):O}),p--,y}var b,I,E}(k,l)}function g1(k,l){if(rt(k))return k.map(function(m){return Zi(m)?g1(m,l):m});if(Zi(k)){var p=(a=k,c=function(m,y){return Ge(l[y])?h1(y):l[y]},h={},Object.keys(a).forEach(function(m){h[c(a[m],m)]=a[m]}),h);return p=Uu(p,function(m){return rt(m)||Zi(m)?g1(m,l):m})}var a,c,h}var m1=String.fromCharCode,f8=function(k){var l=0|k.charCodeAt(0);if(55296<=l)if(l<56320){var p=0|k.charCodeAt(1);if(56320<=p&&p<=57343){if((l=(l<<10)+p-56613888|0)>65535)return m1(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?m1(192|l>>>6,128|63&l):m1(224|l>>>12,128|l>>>6&63,128|63&l)},v1=function(k){for(var l=k===void 0?"":(""+k).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,f8),p=0|l.length,a=new Uint8Array(p),c=0;c<p;c=c+1|0)a[c]=0|l.charCodeAt(c);return a},p8=function(k){for(var l=new Uint8Array(k),p="",a=0,c=l.length;a<c;){var h=l[a],m=0,y=0;if(h<=127?(m=0,y=255&h):h<=223?(m=1,y=31&h):h<=239?(m=2,y=15&h):h<=244&&(m=3,y=7&h),c-a-m>0)for(var b=0;b<m;)y=y<<6|63&(h=l[a+b+1]),b+=1;else y=65533,m=c-a;p+=String.fromCodePoint(y),a+=m+1}return p},h8=function(){function k(l){i(this,k),this._handler=l;var p=l.getURL();if(this._socket=null,this._workerSocket=null,this._id=ei(),this._handler.getIsWorkerEnabled()){var a=URL.createObjectURL(new Blob([';let _socket = null;onmessage = function(event) { if (event.data.cmd === "start") { const url = event.data.url; _socket = new WebSocket(url); _socket.binaryType = "arraybuffer"; _socket.onopen = function() { postMessage({ callback: "onOpen" }); }; _socket.onclose = function(e) { postMessage({ callback: "onOpen", e: { code: e.code, reason: e.reason } }); }; _socket.onmessage = function(e) { postMessage({ callback: "onMessage", data: e.data }); }; _socket.onerror = function(e) { postMessage({ callback: "onError", e: { isTrusted: "true" } }); }; } else if (event.data.cmd === "sendMessage") { if (_socket !== null) { _socket.send(event.data.data); } } else if (event.data.cmd === "stop") { if (_socket !== null) { _socket.close(event.data.code); _socket = null; } }};'],{type:"application/javascript; charset=utf-8"}));this._workerSocket=new Worker(a);var c=this;this._workerSocket.onmessage=function(h){var m=h.data,y=m.callback,b=m.e;y==="onOpen"?c._onOpen():y==="onClose"?c._onClose(b):y==="onError"?c._onError(b):y==="onMessage"&&c._onMessage(h.data)},this._workerSocket.postMessage({cmd:"start",id:this._id,url:p})}else je?V?(Fe.connectSocket({url:p,header:{"content-type":"application/json"}}),Fe.onSocketClose(this._onClose.bind(this)),Fe.onSocketOpen(this._onOpen.bind(this)),Fe.onSocketMessage(this._onMessage.bind(this)),Fe.onSocketError(this._onError.bind(this))):(this._socket=Fe.connectSocket({url:p,header:{"content-type":"application/json"},complete:function(){}}),this._socket.onClose(this._onClose.bind(this)),this._socket.onOpen(this._onOpen.bind(this)),this._socket.onMessage(this._onMessage.bind(this)),this._socket.onError(this._onError.bind(this))):lt&&(this._socket=new WebSocket(p),this._socket.binaryType="arraybuffer",this._socket.onopen=this._onOpen.bind(this),this._socket.onmessage=this._onMessage.bind(this),this._socket.onclose=this._onClose.bind(this),this._socket.onerror=this._onError.bind(this));this._canIUseBinaryFrame=l.canIUseBinaryFrame()}return u(k,[{key:"getID",value:function(){return this._id}},{key:"_onOpen",value:function(){this._handler.onOpen({id:this._id})}},{key:"_onClose",value:function(l){this._handler.onClose({id:this._id,e:l})}},{key:"_onMessage",value:function(l){this._handler.onMessage({data:this._canIUseBinaryFrame?p8(l.data):l.data})}},{key:"_onError",value:function(l){this._handler.onError({id:this._id,e:l})}},{key:"setIsWorkerEnabled",value:function(l){this._isWorkerEnabled=!0}},{key:"close",value:function(l){if(this._workerSocket&&(this._workerSocket.postMessage({cmd:"stop",code:l}),this._workerSocket.terminate(),this._workerSocket=null),V)return Fe.offSocketClose(),Fe.offSocketMessage(),Fe.offSocketOpen(),Fe.offSocketError(),void Fe.closeSocket();this._socket&&(je?(this._socket.onClose(function(){}),this._socket.onOpen(function(){}),this._socket.onMessage(function(){}),this._socket.onError(function(){})):lt&&(this._socket.onopen=null,this._socket.onmessage=null,this._socket.onclose=null,this._socket.onerror=null),Te?this._socket.close({code:l}):this._socket.close(l),this._socket=null)}},{key:"send",value:function(l){if(this._workerSocket)this._workerSocket.postMessage({cmd:"sendMessage",data:this._canIUseBinaryFrame?v1(l.data).buffer:l.data});else{if(V)return void Fe.sendSocketMessage({data:l.data,fail:function(){l.fail&&l.requestID&&l.fail(l.requestID)}});this._socket&&(je?this._socket.send({data:this._canIUseBinaryFrame?v1(l.data).buffer:l.data,fail:function(){l.fail&&l.requestID&&l.fail(l.requestID)}}):lt&&this._socket.send(this._canIUseBinaryFrame?v1(l.data).buffer:l.data))}}}]),k}(),g8=4e3,Vw=4001,m8=["keyMap"],v8=["keyMap"],Op="connected",zw="connecting",am="disconnected",y8=function(){function k(l){i(this,k),this._channelModule=l,this._n="SocketHandler",this._promiseMap=new Map,this._readyState=am,this._simpleRequestMap=new Map,this.MAX_SIZE=100,this._startSequence=ei(),this._startTs=0,this._reConnectFlag=!1,this._nextPingTs=0,this._reConnectCount=0,this.MAX_RECONNECT_COUNT=3,this._socketID=-1,this._random=0,this._socket=null,this._url="",this._onOpenTs=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0,this._setWebsocketHost(),this._initConnection()}return u(k,[{key:"_setWebsocketHost",value:function(){var l=this._channelModule.getModule(pn),p=le;this._channelModule.isOversea()&&(p=ce),l.isSingaporeSite()?p=J:l.isKoreaSite()?p=re:l.isGermanySite()?p=de:l.isIndiaSite()?p=Oe:l.isJapanSite()?p=ve:l.isUSASite()&&(p=Me),K.HOST.setCurrent(p)}},{key:"_initConnection",value:function(){Ge(K.HOST.CURRENT.BACKUP)||this._url===""?this._url=K.HOST.CURRENT.DEFAULT:this._url===K.HOST.CURRENT.DEFAULT?this._url=K.HOST.CURRENT.BACKUP:this._url===K.HOST.CURRENT.BACKUP?this._url=this._canIUseAnyCast()?K.HOST.CURRENT.ANYCAST:K.HOST.CURRENT.DEFAULT:this._url===K.HOST.CURRENT.ANYCAST&&(K.HOST.CURRENT.ANYCAST="",this._url=K.HOST.CURRENT.DEFAULT);var l=this._channelModule.getModule(pn).getProxyServer();Ye(l)||(this._url=l),this._connect(),this._nextPingTs=0}},{key:"_canIUseAnyCast",value:function(){return lt&&K.HOST.CURRENT.ANYCAST}},{key:"onCheckTimer",value:function(l){l%1==0&&this._checkPromiseMap()}},{key:"_checkPromiseMap",value:function(){var l=this;this._promiseMap.size!==0&&this._promiseMap.forEach(function(p,a){var c=p.reject,h=p.timestamp,m=15e3;a.indexOf(Mp)!==-1&&(m=9e4),Date.now()-h>=m&&(U.l("".concat(l._n,"._checkPromiseMap request timeout, delete requestID:").concat(a)),l._promiseMap.delete(a),c(new Un({code:Ae.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=Op,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||Il(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=up(p.head);c=g1(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(C0).getCommandList(),a=!1,c=0;c<p.length;c++)if(l.startsWith(p[c])){a=!0;break}return a}},{key:"_calcRTT",value:function(l){var p=Date.now()-l;this._channelModule.getModule(Bo).addRTT(p)}},{key:"_connect",value:function(){this._startTs=Date.now(),this._onOpenTs=0,this._socket=new h8(this),this._socketID=this._socket.getID(),this._readyState=zw,U.l("".concat(this._n,"._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled()," socketID:").concat(this._socketID," url:").concat(this.getURL())),new We("wsConnect").setMessage("socketID:".concat(this._socketID," url:").concat(this.getURL())).end()}},{key:"getURL",value:function(){this._channelModule.isDevMode()&&(this._canIUseBinaryFrame=!1);var l=Rs();(V||Pe&&l==="windows"||ye)&&(this._canIUseBinaryFrame=!1);var p=-1;l==="ios"?p=ln||-1:l==="android"&&(p=Tn||-1);var a=this._channelModule.getModule(pn),c=this._channelModule.getPlatform(),h=a.getSDKAppID(),m=a.getInstanceID(),y="sdkappid=".concat(h,"&instanceid=").concat(m,"&random=").concat(this._getRandom(),"&platform=").concat(c,"&host=").concat(l,"&version=").concat(p,"&sdkversion=").concat("3.1.1");return this._canIUseBinaryFrame?"".concat(this._url,"/binfo?").concat(y):"".concat(this._url,"/info?").concat(y)}},{key:"_closeConnection",value:function(l){U.l("".concat(this._n,"._closeConnection socketID:").concat(this._socketID)),this._socket&&(this._socket.close(l),this._socketID=-1,this._socket=null,this._readyState=am)}},{key:"_resend",value:function(){var l=this;if(U.l("".concat(this._n,"._resend reConnectFlag:").concat(this._reConnectFlag),"promiseMap.size:".concat(this._promiseMap.size," simpleRequestMap.size:").concat(this._simpleRequestMap.size)),this._promiseMap.size>0&&this._promiseMap.forEach(function(y,b){var I=y.uplinkData,E=y.resolve,O=y.reject;l._promiseMap.set(b,{resolve:E,reject:O,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,m8),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!==Op?p._reConnect():(p._execute(c,h),p._channelModule.getModule(Bo).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,v8),a=this._getRequestIDFromHead(l.head),c=JSON.stringify(p);this._readyState!==Op?(this._simpleRequestMap.size<this.MAX_SIZE?this._simpleRequestMap.set(a,c):U.l("".concat(this._n,".simplySend. simpleRequestMap is full, drop request!")),this._reConnect()):this._execute(a,c)}},{key:"_execute",value:function(l,p){this._socket.send({data:p,fail:je?this._onSendFail.bind(this):void 0,requestID:l})}},{key:"_onSendFail",value:function(l){U.l("".concat(this._n,"._onSendFail requestID:").concat(l))}},{key:"_getSequence",value:function(){var l;if(this._startSequence<2415919103)return l=this._startSequence,this._startSequence+=1,this._startSequence===2415919103&&(this._startSequence=ei()),l}},{key:"_getRequestIDFromHead",value:function(l){return l.servcmd+l.seq}},{key:"_getResponseKeyMap",value:function(l){var p=this._channelModule.getKeyMap(l);return r(r({},sm.response),p.response)}},{key:"_reConnect",value:function(){this._readyState!==Op&&this._readyState!==zw&&this.forcedReconnect()}},{key:"forcedReconnect",value:function(){var l=this,p="".concat(this._n,".forcedReconnect");U.l("".concat(p," count:").concat(this._reConnectCount," readyState:").concat(this._readyState)),this._reConnectFlag=!0,this._resetRandom(),this._reConnectCount<this.MAX_RECONNECT_COUNT?(this._reConnectCount+=1,this._closeConnection(Vw),this._initConnection()):(this._reConnectCount=0,this._channelModule.probeNetwork().then(function(a){var c=A(a,2),h=c[0];c[1],h?(U.w("".concat(p," disconnected from wsserver but network is ok, continue...")),l._closeConnection(Vw),l._initConnection()):l._channelModule.onReconnectFailed()}))}},{key:"getReconnectFlag",value:function(){return this._reConnectFlag}},{key:"_setNextPingTs",value:function(){this._nextPingTs=Date.now()+1e4}},{key:"getNextPingTs",value:function(){return this._nextPingTs}},{key:"isConnected",value:function(){return this._readyState===Op}},{key:"canIUseBinaryFrame",value:function(){return this._canIUseBinaryFrame}},{key:"setIsWorkerEnabled",value:function(l){U.l("".concat(this._n,".setIsWorkerEnabled flag:").concat(l)),this._isWorkerEnabled=l}},{key:"getIsWorkerEnabled",value:function(){return this._isWorkerEnabled&&yr}},{key:"_getRandom",value:function(){return this._random===0&&(this._random=Math.random()),this._random}},{key:"_resetRandom",value:function(){this._random=0}},{key:"close",value:function(){U.l("".concat(this._n,".close")),this._closeConnection(g8),this._promiseMap.clear(),this._startSequence=ei(),this._readyState=am,this._simpleRequestMap.clear(),this._reConnectFlag=!1,this._reConnectCount=0,this._onOpenTs=0,this._url="",this._random=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0}}]),k}(),_8=function(k){f(p,k);var l=R(p);function p(a){var c;if(i(this,p),(c=l.call(this,a))._n="ChannelModule",c._socketHandler=new y8(w(c)),c._probing=!1,c._isAppShowing=!0,c._previousState=T.NET_STATE_CONNECTED,je&&typeof Fe.onAppShow=="function"&&typeof Fe.onAppHide=="function"){var h=c._onAppHide.bind(w(c)),m=c._onAppShow.bind(w(c));typeof Fe.offAppHide=="function"&&Fe.offAppHide(h),typeof Fe.offAppShow=="function"&&Fe.offAppShow(m),Fe.onAppHide(h),Fe.onAppShow(m)}return c._timerForNotLoggedIn=-1,c._timerForNotLoggedIn=setInterval(c.onCheckTimer.bind(w(c)),1e3),c._fatalErrorFlag=!1,c}return u(p,[{key:"onCheckTimer",value:function(a){this._socketHandler&&(this.isLoggedIn()?(this._timerForNotLoggedIn>0&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(a)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:"onErrorCodeNotZero",value:function(a){this.getModule(xi).onErrorCodeNotZero(a)}},{key:"onMessage",value:function(a){this.getModule(xi).onMessage(a)}},{key:"send",value:function(a){return this._socketHandler?this._previousState!==T.NET_STATE_CONNECTED&&a.head.servcmd.includes(kp)?(this.reConnect(),this._sendLogViaHTTP(a)):this._socketHandler.send(a):Promise.reject()}},{key:"_sendLogViaHTTP",value:function(a){var c=K.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:Ae.NETWORK_ERROR}))}});else{var E=new XMLHttpRequest,O=setTimeout(function(){E.abort(),m(new Un({code:Ae.NETWORK_TIMEOUT}))},3e3);E.onreadystatechange=function(){E.readyState===4&&(clearTimeout(O),E.status===200||E.status===304?h():m(new Un({code:Ae.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&&!ye&&this.outputWarning("DomainNameInMP"),this._emitNetStateChangeEvent(T.NET_STATE_DISCONNECTED)}},{key:"getKeyMap",value:function(a){return this.getModule(xi).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(xi).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(L.NET_STATE_CHANGE,{state:a}))}},{key:"_ping",value:function(){var a=this;if(this._probing!==!0){this._probing=!0;var c=this.getModule(xi).getProtocolData({protocolName:P_});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(Ga).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),b8=["a2","tinyid"],M8=["a2","tinyid"],I8=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(Mp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_STATUS,".").concat(Mp)}),body:{state:"Online",isWebUniapp:0,deviceBrand:0},keyMap:{request:{deviceBrand:"InstType"},response:{InstId:"instanceID",HelloInterval:"helloInterval"}}}}(l)),this._configMap.set(T0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_STATUS,".").concat(T0)}),body:{type:0},keyMap:{request:{type:"wslogout_type"}}}}(l)),this._configMap.set(w0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_STATUS,".").concat(w0)}),body:{isWebUniapp:0},keyMap:{response:{NewInstInfo:"newInstanceInfo"}}}}(l)),this._configMap.set(S0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.STAT_SERVICE,".").concat(S0)}),body:{}}}(l)),this._configMap.set(O_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_COS_SIGN,".").concat(O_)}),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(R_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.CUSTOM_UPLOAD,".").concat(R_)}),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(N_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.CUSTOM_UPLOAD,".").concat(N_)}),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($_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_CONFIG_MANAGER,".").concat($_)}),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(B_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_CONFIG_MANAGER,".").concat(B_)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(l)),this._configMap.set(F_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_CONFIG_MANAGER,".").concat(F_)}),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(G_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_CONFIG_MANAGER,".").concat(G_)}),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(H_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OVERLOAD_PUSH,".").concat(H_)}),body:{},keyMap:{response:{OverLoadServCmd:"overloadCommand",DelaySecs:"waitingTime"}}}}(l)),this._configMap.set(k0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(k0)}),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(J_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_MSG_AUDIT_MGR,".").concat(J_)}),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(Ip,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(Ip)}),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(Cp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(Cp)}),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(z0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(z0)}),body:{msgInfo:{fromAccount:"",toAccount:"",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{request:{msgInfo:"MsgInfo",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom"}}}}(l)),this._configMap.set(g_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(g_)}),body:{groupID:"",msgSeqList:void 0,topicID:""},keyMap:{request:{msgSeqList:"MsgSeqList",msgSeq:"MsgSeq"}}}}(l)),this._configMap.set(wp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(wp)}),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(K.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(Sp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(Sp)}),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(j0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(j0)}),body:{C2CMsgReaded:void 0},keyMap:{request:{lastMessageTime:"LastedMsgTime"}}}}(l)),this._configMap.set(W0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(W0)}),body:{userIDList:void 0,muteFlag:0},keyMap:{request:{userIDList:"Peer_Account",muteFlag:"Mute_Notifications"}}}}(l)),this._configMap.set(K0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(K0)}),body:{toAccount:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Peer_Account"},response:{MuteNotificationsList:"muteFlagList"}}}}(l)),this._configMap.set(m_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(m_)}),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(K.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(J0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(J0)}),body:{fromAccount:"",to:"",keyList:void 0},keyMap:{request:{keyList:"MsgKeyList"}}}}(l)),this._configMap.set(C_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(C_)}),body:{groupID:"",deleter:"",keyList:void 0,topicID:void 0},keyMap:{request:{deleter:"Deleter_Account",keyList:"Seqs"}}}}(l)),this._configMap.set(X_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_TRANSLATE,".").concat(X_)}),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(K.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(v_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(v_)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequence:"MsgSeq"}}}}(l)),this._configMap.set(__,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(__)}),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(y_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(y_)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequenceList:"MsgSeqList",sequence:"MsgSeq"}}}}(l)),this._configMap.set(b_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(b_)}),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(X0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM_MSG_EXT,".").concat(X0)}),body:{from:void 0,to:void 0,messageKey:void 0,operateType:void 0,extensionList:void 0}}}(l)),this._configMap.set(Z0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM_MSG_EXT,".").concat(Z0)}),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(K.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(K.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(K.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(Y0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(Y0)}),body:{userIDList:void 0},keyMap:{request:{userIDList:"To_Account"},response:{ReadTime:"peerReadTimeList"}}}}(l)),this._configMap.set(Q0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(Q0)}),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(e_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(e_)}),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(t_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(t_)}),body:{fromAccount:"",toAccount:void 0,type:1,toGroupID:void 0},keyMap:{request:{toGroupID:"ToGroupid"}}}}(l)),this._configMap.set(n_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(n_)}),body:{fromAccount:"",operationType:1,itemList:void 0},keyMap:{request:{itemList:"RecentContactItem"}}}}(l)),this._configMap.set(r_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(r_)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(l)),this._configMap.set(Mw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.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(K.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(Iw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(kd)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"GroupContactItem",groupID:"ToGroupId"},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType"}}}}(l)),this._configMap.set(o_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(o_)}),body:{fromAccount:"",groupName:void 0},keyMap:{request:{},response:{GroupId:"convGroupID"}}}}(l)),this._configMap.set(kd,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(kd)}),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(Cw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(kd)}),body:{fromAccount:"",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}},keyMap:{request:{},response:{}}}}(l)),this._configMap.set(Tw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(kd)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{},response:{}}}}(l)),this._configMap.set(i_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.RECENT_CONTACT,".").concat(i_)}),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(D0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.PROFILE,".").concat(D0)}),body:{fromAccount:"",userItem:[]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(l)),this._configMap.set(E0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.PROFILE,".").concat(E0)}),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(A0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(A0)}),body:{fromAccount:"",startIndex:0,maxLimited:30,lastSequence:0},keyMap:{response:{CurruentSequence:"currentSequence"}}}}(l)),this._configMap.set(L0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(L0)}),body:{fromAccount:"",toAccount:[]}}}(l)),this._configMap.set(O0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(O0)}),body:{fromAccount:"",toAccount:[]}}}(l)),this._configMap.set(j_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_STATUS,".").concat(j_)}),body:{customStatus:""},keyMap:{}}}(l)),this._configMap.set(em,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.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(K.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(K.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(R0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(R0)}),body:{fromAccount:"",startIndex:0,standardSequence:0,customSequence:0},keyMap:{response:{FriendNum:"friendCount",UserDataItem:"resultList",ValueItem:"tagValueList"}}}}(l)),this._configMap.set(U0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(U0)}),body:{fromAccount:"",addFriendItem:[],type:""},keyMap:{request:{source:"AddSource",wording:"AddWording",type:"AddType"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(F0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(F0)}),body:{fromAccount:"",updateItem:void 0},keyMap:{request:{snsItem:"SnsItem"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(x0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(x0)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{request:{type:"DeleteType"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(N0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(N0)}),body:{fromAccount:"",userIDList:void 0},keyMap:{response:{InfoItem:"resultList",SnsProfileItem:"tagValueList"}}}}(l)),this._configMap.set(P0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(P0)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{request:{type:"CheckType"},response:{InfoItem:"resultList"}}}}(l)),this._configMap.set(G0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(G0)}),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(K.NAME.FRIEND,".").concat(Lg)}),body:{fromAccount:"",responseFriendItem:[]},keyMap:{request:{tag:"TagName",action:"ResponseAction"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set($0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat($0)}),body:{fromAccount:"",type:"",userIDList:void 0},keyMap:{request:{type:"PendencyType",userIDList:"To_Account"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(B0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(B0)}),body:{fromAccount:"",latestTimeStamp:""},keyMap:{request:{latestTimeStamp:"LatestPendencyTimeStamp"}}}}(l)),this._configMap.set(q0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(q0)}),body:{fromAccount:"",groupName:void 0,userIDList:void 0},keyMap:{request:{groupName:"GroupName",userIDList:"To_Account"},response:{ResultItem:"resultList"}}}}(l)),this._configMap.set(V0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(V0)}),body:{fromAccount:"",nameList:void 0},keyMap:{request:{nameList:"GroupName"}}}}(l)),this._configMap.set(H0,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(H0)}),body:{fromAccount:"",lastSequence:0,needFriend:"Need_Friend_Type_Yes"},keyMap:{response:{ResultItem:"resultList",GroupName:"name",FriendNumber:"friendCount",To_Account:"userIDList"}}}}(l)),this._configMap.set(Tp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.FRIEND,".").concat(Tp)}),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(K.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(K.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(s_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(s_)}),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(a_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(a_)}),body:{groupID:void 0}}}(l)),this._configMap.set(l_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(l_)}),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(K.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(ww,function(c){return c.a2,c.tinyid,{head:r(r({},D(c,b8)),{},{servcmd:"".concat(K.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(u_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(u_)}),body:{groupID:void 0}}}(l)),this._configMap.set(c_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(c_)}),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(d_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(d_)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{request:{newOwnerID:"NewOwner_Account"}}}}(l)),this._configMap.set(f_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(f_)}),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(p_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(p_)}),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(h_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(h_)}),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(K.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(M_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.OPEN_IM,".").concat(M_)}),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(K.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(Sw,function(c){return c.a2,c.tinyid,{head:r(r({},D(c,M8)),{},{servcmd:"".concat(K.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(I_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(I_)}),body:{groupID:void 0}}}(l)),this._configMap.set(Bg,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.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(K.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(K.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(K.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(K.NAME.GROUP_ATTR,".").concat(zg)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{request:{avChatRoomKey:"Key",groupType:"GroupType"}}}}(l)),this._configMap.set(T_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(T_)}),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(K.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(K.NAME.GROUP,".").concat(Yg)}),body:{groupID:void 0,keyList:[],avChatRoomKey:void 0},keyMap:{request:{keyList:"GroupCounterKeys"}}}}(l)),this._configMap.set(q_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP_COMMUNITY,".").concat(q_)}),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(V_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP_COMMUNITY,".").concat(V_)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:"TopicIdList"},response:{DestroyResultItem:"resultList"}}}}(l)),this._configMap.set(z_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP_COMMUNITY,".").concat(z_)}),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(K.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(w_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(w_)}),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(K.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(S_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(S_)}),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(k_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(k_)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{request:{userID:"Member_Account",userIDList:"MemberList"},response:{MemberList:"members"}}}}(l)),this._configMap.set(D_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(D_)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{request:{userIDList:"MemberToDel_Account"}}}}(l)),this._configMap.set(E_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(E_)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:""},keyMap:{request:{userIDList:"Members_Account",duration:"Duration",reason:"Description"}}}}(l)),this._configMap.set(A_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP,".").concat(A_)}),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(L_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.GROUP_AVCHATROOM,".").concat(L_)}),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(kp,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_STAT,".").concat(kp)}),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(P_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.HEARTBEAT,".").concat(P_)}),body:{}}}(l)),this._configMap.set(kw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_PUSH,".").concat(kw)}),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(Dw,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_PUSH,".").concat(Dw)}),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(K.NAME.OPEN_IM,".").concat(Zg)}),body:{sessionData:void 0},keyMap:{request:{sessionData:"SessionData"}}}}(l)),this._configMap.set(Ew,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_STATUS,".").concat(Ew)}),body:{},keyMap:{response:{C2cNotifyMsgArray:"C2CNotifyMessageArray",NoticeSeq:"noticeSequence",KickoutMsgNotify:"kickoutMsgNotify",NewInstInfo:"newInstanceInfo"}}}}(l)),this._configMap.set(U_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_LONG_MESSAGE,".").concat(U_)}),body:{downloadKey:""},keyMap:{response:{Data:"data",Desc:"description",Ext:"extension",Download_Flag:"downloadFlag",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID"}}}}(l)),this._configMap.set(x_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_LONG_MESSAGE,".").concat(x_)}),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(Y_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_STATUS,".").concat(Y_)}),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(K_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_STATUS,".").concat(K_)}),body:{isWebUniapp:0}}}(l)),this._configMap.set(W_,function(c){return{head:r(r({},c),{},{servcmd:"".concat(K.NAME.IM_OPEN_STATUS,".").concat(W_)}),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=up(p.head),c=d8(p.body,this._getRequestKeyMap(a));return p.body=c,p}},{key:"_updateService",value:function(l,p){var a=up(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(K.NAME.GROUP_COMMUNITY,".").concat(a))}return p}},{key:"_isFromGroupRequest",value:function(l){return l.head.servcmd.includes(K.NAME.GROUP)||l.head.servcmd.includes(K.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)&&Md(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;h<m;h++)p=a[h],rt(l[p])?c[p]=Array.from(l[p]):Zi(l[p])?c[p]=this._simpleDeepCopy(l[p]):c[p]=l[p];return c}}]),k}(),C8=[Zg],T8=function(){function k(l){i(this,k),this._sessionModule=l,this._n="DownlinkHandler",this._eventHandlerMap=new Map,this._eventHandlerMap.set("C2CMessageArray",this._c2cMessageArrayHandler.bind(this)),this._eventHandlerMap.set("groupMessageArray",this._groupMessageArrayHandler.bind(this)),this._eventHandlerMap.set("groupTips",this._groupTipsHandler.bind(this)),this._eventHandlerMap.set("C2CNotifyMessageArray",this._C2CNotifyMessageArrayHandler.bind(this)),this._eventHandlerMap.set("C2CReadReceiptArray",this._C2CReadReceiptArrayHandler.bind(this)),this._eventHandlerMap.set("profileModify",this._profileHandler.bind(this)),this._eventHandlerMap.set("friendListMod",this._relationChainHandler.bind(this)),this._eventHandlerMap.set("recentContactMod",this._recentContactHandler.bind(this)),this._eventHandlerMap.set("readAllC2CMessage",this._allMessageReadHandler.bind(this)),this._eventHandlerMap.set("c2cMessageModified",this._c2cMessageModifiedHandler.bind(this)),this._eventHandlerMap.set("groupMessageModified",this._groupMessageModifiedHandler.bind(this)),this._eventHandlerMap.set("userStatusList",this._userStatusListHandler.bind(this)),this._eventHandlerMap.set("messageExtensionNotify",this._messageExtensionNotifyHandler.bind(this)),this._keys=N(this._eventHandlerMap.keys())}return u(k,[{key:"_c2cMessageArrayHandler",value:function(l){var p=this._sessionModule.getModule(ao);p&&(l.dataList.forEach(function(a){if(a.isSyncMessage===1){var c=a.from;a.from=a.to,a.to=c}}),l.needSync===1&&this._sessionModule.getModule(I0).startOnlineSync(),p.onNewC2CMessage({dataList:l.dataList,isInstantMessage:!0}))}},{key:"_c2cMessageModifiedHandler",value:function(l){var p=this._sessionModule.getModule(ao);p&&p.onC2CMessageModified(l)}},{key:"_groupMessageArrayHandler",value:function(l){var p=this._sessionModule.getModule(It);p&&p.onNewGroupMessage({event:l.event,dataList:l.dataList,isInstantMessage:!0})}},{key:"_groupMessageModifiedHandler",value:function(l){var p=this._sessionModule.getModule(It);p&&p.onGroupMessageModified(l)}},{key:"_groupTipsHandler",value:function(l){var p=this._sessionModule.getModule(It);if(p){var a=l.event,c=l.dataList,h=l.isInstantMessage,m=h===void 0||h,y=l.isSyncingEnded;switch(a){case 4:case 6:p.onNewGroupTips({event:a,dataList:c});break;case 5:for(var b=0;b<c.length;b++)if(rt(c[b].elements.revokedInfos))p.onGroupMessageRevoked({dataList:c});else if(rt(c[b].elements.groupMessageReadNotice))p.onGroupMessageReadNotice({dataList:c});else{if(!rt(c[b].elements.readReceiptList)){p.onNewGroupSystemNotice({dataList:c,isInstantMessage:m,isSyncingEnded:y});break}p.onReadReceiptList({dataList:c})}break;case 12:this._sessionModule.getModule(ct).onNewGroupAtTips({dataList:c});break;default:U.l("".concat(this._n,"._groupTipsHandler unknown event:").concat(a," dataList:"),c)}}}},{key:"_C2CNotifyMessageArrayHandler",value:function(l){var p=this,a=l.dataList;if(rt(a)){var c=this._sessionModule.getModule(ao);a.forEach(function(h){if(yn(h))if(h.hasOwnProperty("kickoutMsgNotify")){var m=h.kickoutMsgNotify,y=m.kickType,b=m.newInstanceInfo,I=b===void 0?{}:b;y===1?p._sessionModule.onMultipleAccountKickedOut(I):y===2?p._sessionModule.onMultipleDeviceKickedOut(I):y===3&&p._sessionModule.onRestApiKickedOut(I)}else h.hasOwnProperty("c2cMessageRevokedNotify")?c&&c.onC2CMessageRevoked({dataList:a}):h.hasOwnProperty("c2cMessageReadReceipt")?c&&c.onC2CMessageReadReceipt({dataList:a}):h.hasOwnProperty("c2cMessageReadNotice")?c&&c.onC2CMessageReadNotice({dataList:a}):h.hasOwnProperty("muteNotificationsSync")&&p._sessionModule.getModule(ct).onC2CMessageRemindTypeSynced({dataList:a})})}}},{key:"_C2CReadReceiptArrayHandler",value:function(l){this._sessionModule.getModule(ao).onReadReceiptList(l)}},{key:"_profileHandler",value:function(l){this._sessionModule.getModule(pr).onProfileModified({dataList:l.dataList});var p=this._sessionModule.getModule(hr);p&&p.onFriendProfileModified({dataList:l.dataList})}},{key:"_relationChainHandler",value:function(l){this._sessionModule.getModule(pr).onRelationChainModified({dataList:l.dataList});var p=this._sessionModule.getModule(hr);p&&p.onRelationChainModified({dataList:l.dataList})}},{key:"_recentContactHandler",value:function(l){var p=l.dataList;if(rt(p)){var a=this._sessionModule.getModule(ct);a&&p.forEach(function(c){var h=c.pushType;if(h===1){var m=c.recentContactDeleteItem;a.onConversationDeleted(m.recentContactList)}else if(h===2){var y=c.recentContactTopItem;a.onConversationPinned(y.recentContactList)}else if(h===3){var b=c.recentContactTopItem;a.onConversationUnpinned(b.recentContactList)}else if(h===4){var I=c.recentContactMarkContact;a.onConversationMarkUpdated(I.recentContactMarkContactItem)}else if(h===5){var E=c.recentContactCreateContactGroup;a.onConversationGroupCreated(E.msgContactGroupContactItem)}else if(h===6){var O=c.recentContactDelContactGroup;a.onConversationGroupDeleted(O.msgGroupItem)}else if(h===7){var F=c.recentContactUpdateContactGroup,q=F.updateType,ee=F.msgUpdateGroup,ge=F.msgUpdateContact;if(q===1){var _e=ee.updateGroupType;_e===1?a.onConversationGroupNameUpdated(ee):_e===2&&a.onConversationInGroupUpdated(ee)}else q===2&&a.onConversationAddedToOrDeletedFromGroup(ge)}})}}},{key:"_allMessageReadHandler",value:function(l){var p=l.dataList,a=this._sessionModule.getModule(ct);a&&a.onPushedAllMessageRead(p)}},{key:"_userStatusListHandler",value:function(l){this._sessionModule.getModule(pr).onUserStatusUpdated(l)}},{key:"_messageExtensionNotifyHandler",value:function(l){this._sessionModule.getModule(gp).onMessageExtensionNotify(l)}},{key:"onMessage",value:function(l){var p=this,a=l.body;if(this._filterMessageFromIMOpenPush(l)){var c=a.eventArray,h=a.isInstantMessage,m=a.isSyncingEnded,y=a.needSync;if(rt(c))for(var b=null,I=null,E=0,O=0,F=c.length;O<F;O++){E=(b=c[O]).event;var q=Object.keys(b).find(function(ee){return p._keys.indexOf(ee)!==-1});q?(I=E===14?{readAllC2CMessage:b[q],groupMessageReadInfoList:b.groupMessageReadNotice||[]}:E===16?{userID:b.userID,readReceiptList:b[q]}:b[q],this._eventHandlerMap.get(q)({event:E,dataList:I,isInstantMessage:h,isSyncingEnded:m,needSync:y})):U.l("".concat(this._n,".onMessage unknown eventItem:").concat(b))}}}},{key:"_filterMessageFromIMOpenPush",value:function(l){var p=l.head,a=l.body,c=p.servcmd,h=!1;if(Ge(c)||(h=c.includes(K.NAME.IM_CONFIG_MANAGER)||c.includes(K.NAME.OVERLOAD_PUSH)||c.includes(K.NAME.STAT_SERVICE)),!h)return!0;if(c.includes(G_))this._sessionModule.getModule(vp).onPushedCloudControlConfig(a);else if(c.includes(B_))this._sessionModule.getModule(_p).onPushedConfig(a);else if(c.includes(H_))this._sessionModule.onPushedServerOverload(a);else if(c.includes(S0)){var m=Date.now();this._sessionModule.reLoginOnKickOther();var y=new We("kickOther"),b=this._sessionModule.getModule(Fa).getLastWsHelloTs(),I=m-b;y.setMessage("last wshello time:".concat(b," diff:").concat(I,"ms")).setNetworkType(this._sessionModule.getNetworkType()).end()}return!1}}]),k}(),jw=[{cmd:Pg,interval:1,count:20},{cmd:Jg,interval:3,count:1},{cmd:Fg,interval:1,count:15},{cmd:Qg,interval:1,count:10},{cmd:Bg,interval:5,count:10},{cmd:Hg,interval:5,count:10},{cmd:qg,interval:5,count:10},{cmd:Vg,interval:5,count:10},{cmd:zg,interval:5,count:20},{cmd:Kg,interval:5,count:20},{cmd:Yg,interval:5,count:20},{cmd:Ug,interval:1,count:1},{cmd:em,interval:5,count:20},{cmd:tm,interval:5,count:20},{cmd:nm,interval:5,count:20},{cmd:Xg,interval:1,count:2}],w8=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="SessionModule",c._platform=c.getPlatform(),c._protocolHandler=new I8(w(c)),c._messageDispatcher=new T8(w(c)),c._commandFrequencyLimitMap=new Map,c._commandRequestInfoMap=new Map,c._serverOverloadInfoMap=new Map,c._init(),c.getInnerEmitterInstance().on(rr.CLOUD_CONFIG_UPDATED,c._onCloudConfigUpdated,w(c)),c}return u(p,[{key:"_init",value:function(){this._updateCommandFrequencyLimitMap(jw)}},{key:"_onCloudConfigUpdated",value:function(){var a=this.getCloudConfig("cmd_frequency_limit");Ge(a)||(a=JSON.parse(a),this._updateCommandFrequencyLimitMap(a))}},{key:"_updateCommandFrequencyLimitMap",value:function(a){var c=this;a.forEach(function(h){c._commandFrequencyLimitMap.set(h.cmd,{interval:h.interval,count:h.count})})}},{key:"updateProtocolConfig",value:function(){this._protocolHandler.update()}},{key:"request",value:function(a){U.d("".concat(this._n,".request options:"),a);var c=a.protocolName,h=a.tjgID;if(!this._protocolHandler.has(c))return U.w("".concat(this._n,".request unknown protocol:").concat(c)),be({code:Ae.CANNOT_FIND_PROTOCOL});var m=this.getProtocolData(a),y=m.head.servcmd;if(this._isFrequencyOverLimit(y))return be({code:Ae.OVER_FREQUENCY_LIMIT});if(this._isServerOverload(y))return be({code:Ae.OPEN_SERVICE_OVERLOAD_ERROR});Ye(h)||(m.head.tjgID=h);var b=this.getModule(Ps);return C8.includes(c)?b.simplySend(m):b.send(m)}},{key:"getKeyMap",value:function(a){return this._protocolHandler.getKeyMap(a)}},{key:"genCommonHead",value:function(){var a=this.getModule(pn);return{ver:"v4",platform:this._platform,websdkappid:fe,websdkversion:ae,a2:a.getA2Key()||void 0,tinyid:a.getTinyID()||void 0,status_instid:a.getStatusInstanceID(),sdkappid:a.getSDKAppID(),contenttype:a.getContentType(),reqtime:0,identifier:a.getA2Key()?void 0:a.getUserID(),usersig:a.getA2Key()?void 0:a.getUserSig(),sdkability:192371,tjgID:""}}},{key:"genCosSpecifiedHead",value:function(){var a=this.getModule(pn);return{ver:"v4",platform:this._platform,websdkappid:fe,websdkversion:ae,sdkappid:a.getSDKAppID(),contenttype:a.getContentType(),reqtime:0,identifier:a.getUserID(),usersig:a.getUserSig(),status_instid:a.getStatusInstanceID(),sdkability:192371}}},{key:"genSSOReportHead",value:function(){var a=this.getModule(pn);return{ver:"v4",platform:this._platform,websdkappid:fe,websdkversion:ae,sdkappid:a.getSDKAppID(),contenttype:"",reqtime:0,identifier:"",usersig:"",status_instid:a.getStatusInstanceID(),sdkability:192371}}},{key:"getProtocolData",value:function(a){return this._protocolHandler.getProtocolData(a)}},{key:"trans",value:function(a){var c=a.servcmd,h=a.data,m={head:r(r({},this.genCommonHead()),{},{servcmd:c}),body:h};return this.getModule(Ps).send(m)}},{key:"sendComboMessage",value:function(a){var c=a.servcmd,h=a.data,m={head:r(r({},this.genCommonHead()),{},{servcmd:c}),body:h};return this.getModule(Ps).send(m)}},{key:"onErrorCodeNotZero",value:function(a){var c=a.errorCode;if(c===Ae.HELLO_ANSWER_KICKED_OUT){var h=a.kickType,m=a.newInstanceInfo,y=m===void 0?{}:m;h===1?this.onMultipleAccountKickedOut(y):h===2?this.onMultipleDeviceKickedOut(y):h===3&&this.onRestApiKickedOut(y)}c!==Ae.MSG_A2KEY_EXPIRED&&c!==Ae.ACCOUNT_A2KEY_EXPIRED||(this._onUserSigExpired(),this.getModule(Ps).reConnect())}},{key:"onMessage",value:function(a){var c=a.body,h=c.needAck,m=h===void 0?0:h,y=c.sessionData;m===1&&this._sendACK(y),this._messageDispatcher.onMessage(a)}},{key:"onReconnected",value:function(){this._reLoginOnReconnected()}},{key:"reLoginOnKickOther",value:function(){U.l("".concat(this._n,".reLoginOnKickOther")),this._reLogin()}},{key:"_reLoginOnReconnected",value:function(){U.l("".concat(this._n,"._reLoginOnReconnected")),this._reLogin()}},{key:"_reLogin",value:function(){var a=this;if(this.isLoggedIn()){var c=0,h=this.getModule(bp);h.canIUseOfflinePush()&&(c=h.getUniAppPlatform()),this.request({protocolName:Mp,requestData:{isWebUniapp:c}}).then(function(m){var y=m.data.instanceID;a.getModule(pn).setStatusInstanceID(y),U.l("".concat(a._n,"._reLogin ok. instanceID:").concat(y)),a.getModule(ct).syncConversationList().then(function(){U.l("".concat(a._n,"._reLogin, sync conversation list ok.")),a.getModule(yw).start()});var b=a.getModule(It);b&&b.updateLocalMainSequenceOnReconnected();var I=a.getModule(ar);I.resetGetTopicTime(),I.getTopicListOnReconnected()})}}},{key:"onMultipleAccountKickedOut",value:function(a){this.getModule(Fa).onMultipleAccountKickedOut(a)}},{key:"onMultipleDeviceKickedOut",value:function(a){this.getModule(Fa).onMultipleDeviceKickedOut(a)}},{key:"_onUserSigExpired",value:function(){this.getModule(Fa).onUserSigExpired()}},{key:"onRestApiKickedOut",value:function(a){this.getModule(Fa).onRestApiKickedOut(a)}},{key:"_sendACK",value:function(a){this.request({protocolName:Zg,requestData:{sessionData:a}})}},{key:"_isFrequencyOverLimit",value:function(a){var c=a.split(".")[1];if(!this._commandFrequencyLimitMap.has(c))return!1;if(!this._commandRequestInfoMap.has(c))return this._commandRequestInfoMap.set(c,{startTime:Date.now(),requestCount:1}),!1;var h=this._commandFrequencyLimitMap.get(c),m=h.count,y=h.interval,b=this._commandRequestInfoMap.get(c),I=b.startTime,E=b.requestCount;if(Date.now()-I>1e3*y)return this._commandRequestInfoMap.set(c,{startTime:Date.now(),requestCount:1}),!1;E+=1,this._commandRequestInfoMap.set(c,{startTime:I,requestCount:E});var O=!1;return E>m&&(O=!0),O}},{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(jw),this._commandRequestInfoMap.clear(),this._serverOverloadInfoMap.clear()}}]),p}(Sr),S8=function(k){f(p,k);var l=R(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<h;y++)m.indexOf(c+y)===-1&&m.push(c+y)}},{key:"detectFirstRound",value:function(a,c){var h=this._maybeLostSequencesMap.get(a);if(!Ye(h)&&!Ye(c)){var m=h.filter(function(y){return c.indexOf(y)===-1});m.length===0?U.i("".concat(this._n,".detectFirstRound no message loss. conversationID:").concat(a)):this._firstRoundRet=this._firstRoundRet.concat(m),h.length=0}}},{key:"detectSecondRound",value:function(a,c){if(!Ye(this._firstRoundRet)&&!Ye(c)){var h=this._firstRoundRet.filter(function(b){return c.indexOf(b)===-1});this._firstRoundRet.length=0;var m,y=h.length;y!==0&&(y<=5?m=a+"-"+h.join("-"):(h.sort(function(b,I){return b-I}),m=a+" start:"+h[0]+" end:"+h[y-1]+" count:"+y),new We("messageLoss").setMessage(m).setNetworkType(this.getNetworkType()).setLevel("warning").end(),U.i("".concat(this._n,".detectSecondRound message loss detected. conversationID:").concat(a," lostSequences:").concat(h)))}}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._maybeLostSequencesMap.clear(),this._firstRoundRet.length=0}}]),p}(Sr),k8=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="CloudControlModule",c._cloudConfig=new Map,c._expiredTime=0,c._version=0,c._isFetching=!1,c}return u(p,[{key:"getCloudConfig",value:function(a){return Ge(a)?this._cloudConfig:this._cloudConfig.has(a)?this._cloudConfig.get(a):void 0}},{key:"_canFetchConfig",value:function(){return this.isLoggedIn()&&!this._isFetching&&Date.now()>=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:F_,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],O=I[1];h.setError(y,E,O).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 O=null;try{O=JSON.parse(b)}catch{this.isPrivateNetWork()||U.e("".concat(h," JSON parse error. cloudControlConfig:"),b)}O&&(this._cloudConfig.clear(),Object.keys(O).forEach(function(F){c._cloudConfig.set(F,O[F])}),this._version=I,this.emitInnerEvent(rr.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),D8=function(k){f(p,k);var l=R(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,O=[];m.forEach(function(F){var q=F.conversationID,ee=F.lastMessage;c=q.replace(T.CONV_GROUP,""),a=y.getLocalLastMessage(q),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}):O.push(c)):O.push(c)}),this._getGroupNotify(O)}},{key:"_recoverC2CChat",value:function(){var a,c=this,h=this._getLocalConversationList().filter(function(O){return O.type===T.CONV_C2C}),m=this.getModule(ct),y=0,b=0,I=0,E=[Promise.resolve()];h.forEach(function(O){var F=O.conversationID,q=O.lastMessage;a=m.getLocalLastMessage(F),q&&q.lastTime!==0&&a&&(b=q.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(I0).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,O=E.complete,F=E.messageList;if(!Ge(F)){var q=F[0].sequence,ee="groupID:".concat(m," pkgLastSequence:").concat(q," remoteLastSequence:").concat(b," complete:").concat(O," count:").concat(F.length);U.l("".concat(h," ").concat(ee)),q<b&&O!==2&&c._recoverGroupMessage({groupID:m,localLastMessageSequence:q,remoteLastMessageSequence:b}),new We("recoverMessage").setNetworkType(c.getNetworkType()).setMessage(ee).end();var ge=c.getModule(It);F.length>1&&F.sort(function(Ue,qe){return Ue.sequence-qe.sequence});for(var _e=0;_e<F.length;_e++){var we=F[_e];we.from!==T.CONV_SYSTEM?ge.onNewGroupMessage({dataList:[we],isInstantMessage:!1,updateUnreadCount:!1}):ge.onNewGroupTips({event:we.event,dataList:[we]})}c._getGroupNotify([m])}})}},{key:"_genMultiGroupIDList",value:function(a,c){var h=c&&c>1?c:1,m=a.length,y=[];if(m>0)for(var b=0;b<m;b+=h)y.push(a.slice(b,b+h));return y}},{key:"_getGroupNotify",value:function(a){var c=this._genMultiGroupIDList(a,10);if(c.length>0)for(var h=this.getModule(It),m=0,y=c.length;m<y;m++)h.getGroupNotify(c[m])}},{key:"_getGroupRoamingMessage",value:function(a){var c=a.groupID,h=a.sequence;return this.request({protocolName:Sp,requestData:{groupID:c,count:this.PULL_LIMIT_COUNT,sequence:h+this.PULL_LIMIT_COUNT-1}})}},{key:"_recoverC2CMessage",value:function(a){var c=this,h="".concat(this._n,"._recoverC2CMessage");U.l("".concat(h," options:"),a);var m=a.conversationID,y=a.localLastMessageTime,b=a.remoteLastMessageTime;return this._getC2CRoamingMessage({conversationID:m,time:y}).then(function(I){var E=I.data,O=E.complete,F=E.messageList;if(!Ge(F)){var q=F.length;c.getModule(ao).onNewC2CMessage({dataList:F,isInstantMessage:!0});var ee=F[q-1].time,ge=m.replace(T.CONV_C2C,""),_e="peerAccount:".concat(ge," pkgLastTime:").concat(ee," remoteLastTime:").concat(b," complete:").concat(O," count:").concat(q);if(U.l("".concat(h," ").concat(_e)),new We("recoverMessage").setNetworkType(c.getNetworkType()).setMessage(_e).end(),ee<b&&O!==1)return c._recoverC2CMessage({conversationID:m,localLastMessageTime:ee,remoteLastMessageTime:b})}})}},{key:"_getC2CRoamingMessage",value:function(a){var c=a.conversationID,h=a.time;return this.request({protocolName:wp,requestData:{peerAccount:c.replace(T.CONV_C2C,""),count:this.PULL_LIMIT_COUNT+1,lastMessageTime:h,direction:1}})}},{key:"reset",value:function(){U.l("".concat(this._n,".reset"))}}]),p}(Sr),E8=function(){function k(){i(this,k),this._n="AvgE2EDelay",this._e2eDelayArray=[]}return u(k,[{key:"addMessageDelay",value:function(l){var p=Kr()-l;p>=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}),Qi(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&&h<c}).length}},{key:"_calcPercent",value:function(l,p){var a=Qi(l/p*100,2);return a>100&&(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,N(a)),m=Math.max.apply(Math,N(a)),y=this._calcAvg(a,c),b=Qi(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=N(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}(),A8=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=Qi(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,N(this._rttArray))}},{key:"_calcMin",value:function(){return Math.min.apply(Math,N(this._rttArray))}},{key:"getStatResult",value:function(){var l=this._calcTotalCount(),p=N(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}(),L8=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=Qi(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=Qi(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===bi?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}(),O8=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]&&h<y[b]?(y.push(h),y.sort(),this._lastMap.get(p).set(m,y)):this._addCurrentMap(l)}else this._addCurrentMap(l);return!0}},{key:"_addCurrentMap",value:function(l){var p=l.key,a=l.message,c=a.conversationID,h=a.sequence,m=c.replace(T.CONV_GROUP,"");this._currentMap.get(p).has(m)||this._currentMap.get(p).set(m,[]),this._currentMap.get(p).get(m).push(h)}},{key:"_copyData",value:function(l){if(!Ge(l)){this._lastMap.set(l,new Map);var p,a=this._lastMap.get(l),c=G(this._currentMap.get(l));try{for(c.s();!(p=c.n()).done;){var h=A(p.value,2),m=h[0],y=h[1];a.set(m,y)}}catch(b){c.e(b)}finally{c.f()}a=null,this._currentMap.set(l,new Map)}}},{key:"getStatResult",value:function(l){if(Ge(this._currentMap.get(l))||Ge(this._lastMap.get(l)))return null;if(this._lastMap.get(l).size===0)return this._copyData(l),null;var p=0,a=0;if(this._lastMap.get(l).forEach(function(h,m){var y=N(h.values()),b=y.length,I=y[b-1]-y[0]+1;p+=I,a+=b}),p===0)return null;var c=Qi(a/p*100,2);return c>100&&(c=100),this._copyData(l),{totalCount:p,successCountOfMessageReceived:a,successRateOfMessageReceived:c}}},{key:"reset",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),k}(),R8=function(k){f(p,k);var l=R(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=[Z_,Q_,Dd,Ed,Ad,zu,bi,Ld,Dp,Ep],c._messageSentItems=[Dd,Ed,Ad,zu,bi],c._messageReceivedItems=[Ld,Dp,Ep],c.REPORT_INTERVAL=120,c.REPORT_SDKAPPID_BLACKLIST=[],c.REPORT_TINYID_WHITELIST=[],c._statInfoArr=[],c._avgRTT=new A8,c._avgE2EDelay=new E8,c._rateMessageSent=new L8,c._rateMessageReceived=new O8;var h=c.getInnerEmitterInstance();return h.on(rr.A2KEY_AND_TINYID_UPDATED,c._onLoginSuccess,w(c)),h.on(rr.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(ra),h=c.getItem(this.TAG,!1);!Ye(h)&&Go(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=Aw[this.getNetworkType()];Ge(h)&&(h=8);var m={qualityType:t6[a],timestamp:Mn(),networkType:h,extension:""};switch(a){case Z_:c=this._avgRTT.getStatResult();break;case Q_:c=this._avgE2EDelay.getStatResult();break;case Dd:case Ed:case Ad:case zu:case bi:c=this._rateMessageSent.getStatResult(a);break;case Ld:case Dp:case Ep: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)&&!cp(this.REPORT_TINYID_WHITELIST,I)&&(h=[]),h.length>0&&this._doReport(h)}},{key:"_doReport",value:function(a){var c=this,h={header:Hw(this),quality:a};this.request({protocolName:kp,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(ra),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),Ww=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||"")}),N8=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:N(this._friendApplicationMap.values()),unreadCount:this._unreadCount}}},{key:"_onFriendApplicationListUpdated",value:function(){this._snsModule.emitOuterEvent(L.FRIEND_APPLICATION_LIST_UPDATED,{friendApplicationList:N(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 Ww(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:G0,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(O){var F=O.userID,q=O.type,ee=new Ww(O);l._friendApplicationMap.set("".concat(F,"_").concat(q),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),be(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 be({code:Ae.FRIEND_APPLICATION_NOT_EXIST});var m=new We("deleteFriendApplication");return m.setMessage("userID:".concat(c," type:").concat(h)),this._snsModule.request({protocolName:$0,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:[c],type:h}}).then(function(y){var b=y.data.resultList,I=b[0],E=I.to,O=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)),O===0?ht():be({userID:E,code:O,message:F})}).catch(function(y){return p._snsModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],O=I[1];m.setError(y,E,O).end()}),U.w("".concat(a," failed. error:"),y),be(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],O=E.resultCode,F=E.resultInfo;if(O!==0)return be({code:O,message:F});U.i("".concat(a," ok. userID:").concat(c," type:").concat(y))}).catch(function(I){return p._snsModule.probeNetwork().then(function(E){var O=A(E,2),F=O[0],q=O[1];b.setError(I,F,q).end()}),U.w("".concat(a," failed. error:"),I),be(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 be({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),be(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:B0,requestData:{fromAccount:this._snsModule.getMyUserID(),latestTimeStamp:Qi(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),be(c)})}},{key:"reset",value:function(){this._startIndex=0,this._maxLimited=100,this._currentSequence=0,this._unreadCount=0,this._friendApplicationMap.clear()}}]),k}(),y1=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<b;y++)if(h=p[y].tag,m=p[y].value,h.indexOf("Tag_SNS_Custom")>-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 Qs:this.remark=m;break;case Ra:this.addTime=m;break;case _l:this.groupList=JSON.parse(JSON.stringify(m));break;case bl:this.source=m;break;case Ml:break;default:U.l("snsProfileItem unknown tag->",p[y].tag)}this.profile=new Ap(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;m<c;m++){if(h=l.profileCustomField[m],!Et(h.key)||h.key.indexOf("Tag_Profile_Custom")===-1)return{valid:!1,tips:"The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom"};if(!Et(h.value))return{valid:!1,tips:"The type of values of the custom profile key-value pairs (which is profileCustomField) must be String"}}for(var y in l)if(Object.prototype.hasOwnProperty.call(l,y)){if(y==="profileCustomField")continue;if(Ye(l[y])&&!Et(l[y])&&!un(l[y])){a="key:"+y+", invalid value:"+l[y],p=!1;continue}switch(y){case"nick":Et(l[y])||(a="nick must be a string",p=!1),Cl(l[y])>500&&(a="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(Cl(l[y])," bytes"),p=!1);break;case"gender":ta(Qo,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":ta(ds,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":ta(Na,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<m;h++)if(p=l[h].tag,a=l[h].value,p.indexOf("Tag_SNS_Custom")>-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 Qs:this.remark=a;break;case Ra:this.addTime=a;break;case _l:this.groupList=JSON.parse(JSON.stringify(a));break;case bl:this.source=a;break;case Ml: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}(),P8=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 N(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 y1(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(L.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.timestamp<p._expirationTime?m.push(E):y.push(I)}else h.push({userID:I,code:Ae.NOT_MY_FRIEND,message:p._snsModule.getErrorMessage(Ae.NOT_MY_FRIEND)})}),y.length===0)return U.i("".concat(a," newUserIDList is empty")),At({friendList:m,failureUserIDList:h});var b=new We("getFriendProfile");return b.setMessage("userIDList:".concat(y)),U.i("".concat(a," userIDList:").concat(y)),this._snsModule.request({protocolName:N0,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:y}}).then(function(I){return b.setNetworkType(p._snsModule.getNetworkType()).end(),U.i("".concat(a," ok")),I.data.resultList.forEach(function(E){var O,F=E.to,q=E.resultCode,ee=E.resultInfo,ge=E.tagValueList;Ge(q)||q===0?(p._friendMap.has(F)?(O=p._friendMap.get(F)).update(ge):(O=new y1(F,ge),p._friendMap.set(F,O)),m.push(O)):h.push({userID:F,code:q,message:ee})}),ht({friendList:m,failureUserIDList:h})}).catch(function(I){return p._snsModule.probeNetwork().then(function(E){var O=A(E,2),F=O[0],q=O[1];b.setError(I,F,q).end()}),U.w("".concat(a," failed. error:"),I),be(I)})}},{key:"isMyFriend",value:function(l){return this._friendMap.has(l)}},{key:"pagingGetFriendList",value:function(){var l=this,p="".concat(this._n,".").concat("getFriendList"),a=new We("getFriendList"),c=Date.now();this._snsModule.request({protocolName:R0,requestData:{fromAccount:this._snsModule.getMyUserID(),startIndex:this._startIndex,standardSequence:this._standardSequence,customSequence:this._customSequence}}).then(function(h){var m=h.data,y=m.friendCount,b=m.resultList,I=m.nextStartIndex,E=m.standardSequence,O=m.customSequence,F=m.completeFlag;l._startIndex=I,l._standardSequence=E,l._customSequence=O;var q=Date.now()-c,ee="friendCount:".concat(y," nextStartIndex:").concat(I," standardSequence:").concat(E," ")+"customSequence:".concat(O," completeFlag:").concat(F," cost ").concat(q," ms");a.setNetworkType(l._snsModule.getNetworkType()).setMessage(ee).end(),U.i("".concat(p," ok."),ee),Ye(b)||b.forEach(function(ge){var _e=ge.to,we=ge.tagValueList;l._friendMap.set(_e,new y1(_e,we))}),F===0?l.pagingGetFriendList():(l._snsModule.emitOuterEvent(L.FRIEND_LIST_UPDATED),l._pagingGetFriendProfile())}).catch(function(h){return l._snsModule.probeNetwork().then(function(m){var y=A(m,2),b=y[0],I=y[1];a.setError(h,b,I).end()}),U.w("".concat(p," failed. error:"),h),be(h)})}},{key:"_pagingGetFriendProfile",value:function(){var l=this,p=N(this._friendMap.keys()),a=this._snsModule.getModule(pr),c=p.length,h=c<=100?1:Math.ceil(c/100);U.l("".concat(this._n,"._pagingGetFriendProfile friendCount:").concat(c," pageCount:").concat(h));for(var m=0;m<h;m++)a.getUserProfile({userIDList:p.slice(100*m,100*(m+1))}).then(function(y){y.data.forEach(function(b){var I=l._friendMap.get(b.userID);I&&I.updateProfile(b)}),l._onFriendListUpdated()})}},{key:"addFriend",value:function(l){var p=this,a="".concat(this._n,".").concat("addFriend");if(this._friendMap.has(l.to))return be({code:Ae.ALREADY_MY_FRIEND});if(l.wording&&this._snsModule.filterProfanity("wording",l)===!1)return be({code:Ae.PROFANITY_FOUND});var c=l.to,h=l.source,m=l.type,y=l.wording,b=l.remark,I=l.groupName,E=m;(!E||E!==T.SNS_ADD_TYPE_SINGLE&&E!==T.SNS_ADD_TYPE_BOTH)&&(E=T.SNS_ADD_TYPE_BOTH);var O=new We("addFriend");return O.setMessage("to:".concat(c," source:").concat(h," type:").concat(E)),this._snsModule.request({protocolName:U0,requestData:{fromAccount:this._snsModule.getMyUserID(),addFriendItem:[{to:c,source:h,wording:y,remark:b,groupName:I}],type:E}}).then(function(F){var q=F.data.resultList;O.setNetworkType(p._snsModule.getNetworkType()).setMoreMessage("resultList:".concat(JSON.stringify(q))).end();var ee=q[0],ge=ee.to,_e=ee.resultCode,we=ee.resultInfo;return U.i("".concat(a," ok. to:").concat(ge," type:").concat(E," code:").concat(_e)),Ge(_e)||_e===0?ht({userID:ge,code:0}):_e===30539?ht({userID:ge,code:_e,message:p._snsModule.getErrorMessage(_e)}):be({userID:ge,code:_e,message:p._snsModule.getErrorMessage(_e)||we})}).catch(function(F){return p._snsModule.probeNetwork().then(function(q){var ee=A(q,2),ge=ee[0],_e=ee[1];O.setError(F,ge,_e).end()}),U.w("".concat(a," failed. error:"),F),be(F)})}},{key:"deleteFriend",value:function(l){var p=this,a="".concat(this._n,".").concat("deleteFriend"),c=l.userIDList,h=l.type;c.length>1e3&&(U.w("".concat(a," ").concat(xa(1e3))),c.length=1e3);var m=[],y=[],b=[];if(c.forEach(function(O){p._friendMap.has(O)?b.push(O):m.push({userID:O,code:Ae.NOT_MY_FRIEND,message:p._snsModule.getErrorMessage(Ae.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:x0,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:b,type:I}}).then(function(O){E.setNetworkType(p._snsModule.getNetworkType()).end(),U.i("".concat(a," ok"));var F=O.data.resultList;return Ye(F)||F.forEach(function(q){var ee=q.to,ge=q.resultCode,_e=q.resultInfo;Ge(ge)||ge===0?y.push({userID:ee}):m.push({userID:ee,code:ge,message:_e})}),ht({successUserIDList:y,failureUserIDList:m})}).catch(function(O){return p._snsModule.probeNetwork().then(function(F){var q=A(F,2),ee=q[0],ge=q[1];E.setError(O,ee,ge).end()}),U.w("".concat(a," error:"),O),be(O)})}},{key:"updateFriend",value:function(l){var p=this,a=l.userID,c=l.remark,h=l.friendCustomField;if(!this._friendMap.has(a))return be({code:Ae.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:Qs,value:c}),rt(h)&&h.length>0&&h.forEach(function(I){b.push({tag:I.key,value:I.value})}),this._snsModule.request({protocolName:F0,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],O=E.to,F=E.resultCode,q=E.resultInfo;if(Ge(F)||F===0){var ee=p._friendMap.get(O);return ee&&(Ge(c)||(ee.remark=c),rt(h)&&h.length>0&&xu(ee.friendCustomField,h),p._onFriendListUpdated()),ht(ee)}return be({code:F,message:q})}).catch(function(I){return p._snsModule.probeNetwork().then(function(E){var O=A(E,2),F=O[0],q=O[1];y.setError(I,F,q).end()}),U.w("".concat(m," failed. error:"),I),be(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:P0,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(O){var F=O.to,q=O.relation,ee=O.resultCode,ge=O.resultInfo;Ge(ee)||ee===0?b.push({userID:F,code:0,relation:q}):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],O=I[1];m.setError(y,E,O).end()}),U.w("".concat(a," failed. error:"),y),be(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}(),Kw=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}(),x8=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 N(this._friendGroupMap.values())}},{key:"_emitFriendGroupListUpdated",value:function(){var l=N(this._friendGroupMap.values());this._snsModule.emitOuterEvent(L.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:H0,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 Kw(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),be(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 be({code:Ae.FRIEND_GRP_EXISTED});var m=new We("createFriendGroup");return m.setMessage("name:".concat(c," userIDList:").concat(h)),this._snsModule.request({protocolName:q0,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 q=F.to,ee=F.resultCode,ge=F.resultInfo;if(Ge(ee)||ee===0)I.push(q);else{var _e={userID:F.to,code:ee,message:ge};E.push(_e)}});var O=new Kw({name:c,userIDList:I});return p._friendGroupMap.set(c,O),p._snsModule.updateWhenAddedToFriendGroup({name:c,userIDList:I}),p._emitFriendGroupListUpdated(),ht({friendGroup:O,failureUserIDList:E})}).catch(function(y){return p._snsModule.probeNetwork().then(function(b){var I=A(b,2),E=I[0],O=I[1];m.setError(y,E,O).end()}),U.w("".concat(a," failed. error:"),y),be(y)})}},{key:"deleteFriendGroup",value:function(l){var p=this,a="".concat(this._n,".").concat("deleteFriendGroup"),c=l.name;if(!this._friendGroupMap.has(c))return be({code:Ae.FRIEND_GRP_NOT_EXIST});var h=new We("deleteFriendGroup");return h.setMessage("name:".concat(c)),this._snsModule.request({protocolName:V0,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),be(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 be({code:Ae.FRIEND_GRP_NOT_EXIST});var m=new We("renameFriendGroup");return m.setMessage("oldName:".concat(c," newName:").concat(h)),this._snsModule.request({protocolName:Tp,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],O=I[1];m.setError(y,E,O).end()}),U.w("".concat(a," failed. error:"),y),be(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:Tp,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],O=I[1];m.setError(y,E,O).end()}),U.w("".concat(a," failed. error:"),y),be(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:Tp,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],O=I[1];m.setError(y,E,O).end()}),U.w("".concat(a," failed. error:"),y),be(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,O=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:O})}),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}(),U8=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="SnsModule",c._friendHandler=new P8(w(c)),c._friendApplicationHandler=new N8(w(c)),c._friendGroupHandler=new x8(w(c)),c.getInnerEmitterInstance().on(rr.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,O="";h.forEach(function(F){if(F.pushType!==3&&F.pushType!==4||!F.from||(O=F.from),F.friendAddAccount&&(m.push.apply(m,N(F.friendAddAccount)),I.push.apply(I,N(F.friendAddAccount))),F.friendDelAccount&&y.push.apply(y,N(F.friendDelAccount)),F.friendApplicationAdded&&b.push.apply(b,N(F.friendApplicationAdded)),F.friendApplicationDeletedUserIDList&&I.push.apply(I,N(F.friendApplicationDeletedUserIDList)),F.reportTime&&F.pushType===7&&(E=!0),F.friendUpInfo){var q={dataList:[]};F.friendUpInfo.forEach(function(ee){q.dataList.push({userID:ee.friendAccount,profileList:N(ee.sns)})}),c.onFriendProfileModified(q)}}),E&&this._friendApplicationHandler.onFriendApplicationRead(),this._friendApplicationHandler.onFriendApplicationAdded(b,O),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($a);if(!h)return!0;var m=h.filterText(c[a],Ie),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),F8=function(k){f(p,k);var l=R(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(rr.CLOUD_CONFIG_UPDATED,c._onCloudConfigUpdated,w(c)),c}return u(p,[{key:"isWorkerEnabled",value:function(){return this._isWorkerEnabled&&yr}},{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(yr){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&&yr&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&yr&&(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),G8=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 Y(0,Math.pow(2,c)).toString():new Y(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 Y(0,Math.pow(2,m)).toString():new Y(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}(),$8=function(){function k(l){i(this,k),this._m=l,this._n="CommercialConfigModule",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new G8}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(Ga),h=new We("fetchCommercialConfig");h.setNetworkType(c.getNetworkType());var m=this._getModule(pn).getSDKAppID(),y=this._getModule(xi);this._isFetching=!0,y.request({protocolName:$_,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),O=E[0],F=E[1];h.setError(b,O,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(Ga).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}(),B8=function(k){f(p,k);var l=R(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(ye){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,O=c.meizuAppKey,F=c.vivoBusinessID,q=c.oppoBusinessID,ee=c.oppoAppKey,ge=c.oppoAppSecret,_e=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=O,this._androidPushConfig.vivoPushBussinessId=F,this._androidPushConfig.oppoPushBussinessId=q,this._androidPushConfig.oppoPushAppKey=ee,this._androidPushConfig.oppoPushAppSecret=ge,this._androidPushConfig.honorPushBussinessId=_e,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(Go(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,O=E.deviceToken,F=E.deviceBrand,q=E.deviceType,ee=E.bussinessId;a._deviceToken=O,a._businessID=ee||a._iosBusinessID,h="deviceToken:".concat(O,", deviceBrand:").concat(F||q,", 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 ye&&!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")):Go(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)&&Go(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(),O=this.getDeviceBrand();E===X.IOS||E===X.IPAD||E===X.MAC?I=this._deviceToken:E===X.ANDROID&&(b=this._deviceToken);var F=new We("offlinePushSetToken");return a="deviceToken:".concat(I||b,", businessID:").concat(this._businessID,", ")+"deviceBrand:".concat(O,", isWebUniapp:").concat(this._isWebUniapp,", pushMsg:").concat(y,", platform:").concat(E),F.setMessage("".concat(a)),U.l("".concat(h," ").concat(a)),this.request({protocolName:Y_,requestData:{tokenID:b,pushMsg:y,sdkAppID:m.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:O,deviceToken:I,isWebUniapp:this._isWebUniapp}}).then(function(q){return F.end(),U.l("".concat(h," ok")),q}).catch(function(q){return c.probeNetwork().then(function(ee){var ge=A(ee,2),_e=ge[0],we=ge[1];F.setError(q,_e,we).end()}),U.e("".concat(h," failed. error:"),q),be(q)})}},{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:W_,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:K_,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"?X.IOS:a==="android"?X.ANDROID:c===1002?X.IPAD:c===1001?X.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),H8=function(k){f(p,k);var l=R(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:_d,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=ke:y===T.CONV_GROUP&&(b=W),!this._isConfigOn(b))return h;var E=this._plugin.filter(a.payload.text),O=E.type,F=E.modifiedText;O===1?h=!1:O===2&&(a.payload.text=F)}else if(m===T.MSG_CUSTOM){if(y===T.CONV_C2C?b=pe:y===T.CONV_GROUP&&(b=te),!this._isConfigOn(b))return h;var q=this._plugin.filter(a.payload.data),ee=this._plugin.filter(a.payload.description),ge=this._plugin.filter(a.payload.extension);q.type===1||ee.type===1||ge.type===1?h=!1:(q.type===2&&(a.payload.data=q.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:J_,requestData:{startIndex:this._startIndex,version:this._version}}).then(function(m){var y=m.data,b=y.errorInfo,I=y.filterConfig,E=y.lexicon,O=y.strToken,F=y.completeFlag,q=y.nextStartIndex,ee=y.version,ge=y.expiredTime,_e=b.errorCode,we=b.errorMessage;return _e!==0?(a._isFetching=!1,U.w("".concat(h," failed. error:"),b),void c.setCode(_e).setMessage(we).end()):(a._onFilterConfig(I),a._getToken(O),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=q,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<c-1;y+=2)h+=a[y+1],h+=a[y];h+=a[c-1]}this._plugin.onToken(h)}}},{key:"reset",value:function(){U.l("".concat(this._n,".reset")),this._plugin&&(this._plugin.reset(),this._plugin=null),this._filterConfigMap.clear(),this._startIndex=0,this._version=0,this._canIUseLexicon=!1,this._isFetching=!1,this._expiredTime=0}}]),p}(Sr),q8=function(){function k(l){i(this,k),this._m=l,this._n="TransCmdModule",this._TRTCCommandList=["tui_room_svr.*"],this._m.getInnerEmitterInstance().on(rr.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return u(k,[{key:"_onCloudConfigUpdated",value:function(){var l=this,p=this._m.getModule(vp).getCloudConfig("rtc_cmd");Ge(p)||(p=JSON.parse(p)).forEach(function(a){l._TRTCCommandList.includes(a)||l._TRTCCommandList.push(a)})}},{key:"sendTRTCCustomData",value:function(l){var p=l.serviceCommand,a=l.data,c="".concat(K.NAME.TUIROOM_SVR,".*");return Ge(p)||(c=p),this._TRTCCommandList.includes(c)?this._trans({servcmd:c,data:a}):be({code:Ae.INVALID_TRTC_CMD})}},{key:"_trans",value:function(l){U.d("".concat(this._n,"._trans. options:").concat(JSON.stringify(l)));var p=l.servcmd,a=l.data;return this._m.getModule(xi).trans({servcmd:p,data:Et(a)?JSON.parse(a):a})}},{key:"getCommandList",value:function(){return this._TRTCCommandList}},{key:"reset",value:function(){U.l("".concat(this._n,".reset"))}}]),k}(),V8=function(){function k(l){i(this,k),this._m=l,this._n="ErrorMessageModule",this.TIM_ERROR_ASSISTANCE="tim_error_assistance",this.STORAGE_EXPIRES_TIME=6048e5,this._map=new Map,this._init()}return u(k,[{key:"_init",value:function(){var l=this._getStorageModule().getItem(this.TIM_ERROR_ASSISTANCE,!1);if(l){var p;try{p=JSON.parse(l)}catch(a){this._getStorageModule().removeItem(this.TIM_ERROR_ASSISTANCE,!1),U.w("".concat(this._n,"._init error:"),a)}p&&(this._needToUpdate(p)?this._fetch():this._fillMap(p.message))}else this._fetch()}},{key:"_needToUpdate",value:function(l){var p=l.localSavedTime,a=l.localSavedVersion,c=p&&new Date().getTime()-p>=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(ra)}},{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;b<m;b++)if(p=h[b].indexOf(":"),a=h[b].slice(0,p),c=h[b].slice(p+1,h[b].length),!a.startsWith("//")){if(Ge(c))continue;this._map.set(a,c.replace(y,""))}}},{key:"get",value:function(l){var p=l.isIntl,a=l.key,c=l.replacement1,h=l.replacement2,m="".concat(a,p?"_en":"_cn");!this._map.has(m)&&this._map.has(a)&&(m=a);var y="";return this._map.has(m)&&(y=this._map.get(m),Ge(c)||(y=y.replace("$replacement1",c)),Ge(h)||(y=y.replace("$replacement2",h))),y}},{key:"reset",value:function(){U.l("".concat(this._n,".reset"))}}]),k}(),z8=function(){function k(l){i(this,k),this._n="RemoteSignalingHandler",this._signalingModule=l}return u(k,[{key:"onNewMessageList",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._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}(),j8=function(k){if(k<0||k>53)return NaN;var l=0|1073741824*Math.random();return k>30?l+1073741824*(0|Math.random()*(1<<k-30)):l>>>30-k},W8=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},K8=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=W8)((l=j8)(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(sr),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}(),Y8=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(N(m),N(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;a<l.length;a++){var c=l[a],h=c.type,m=c.unreadCount,y=c.lastMessage,b=this._isSignalingNotExpired(y,"lastTime");h!==T.CONV_SYSTEM&&m>0&&b&&p.push(l[a])}return p}},{key:"_createPromiseList",value:function(l){for(var p=[],a=0;a<l.length;a++){var c=l[a],h=c.conversationID,m=c.unreadCount,y=c.type===T.CONV_C2C?m:this.COUNT;this._signalingMap.set(h,{needMessageCount:y,signalingList:[]});var b=this._signalingModule.getModule(ct).getMessageList({conversationID:h});p.push(b)}return p}},{key:"_concurrentGetMessageList",value:function(l){var p=this,a=[];return Promise.all(l).then(function(c){for(var h=0;h<c.length;h++){var m=c[h],y=m.code,b=m.data;if(y===0&&b.messageList.length!==0){p._handleMessageList(b.messageList);var I=p._relayGetMessageList(b);I&&a.push(I)}}return a.length>0?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,O=I===0||c,F=this._isSignalingNotExpired(p[h-1],"time");return E||O||!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;I<l.length;I++){var E=l[I];this._isSignalingNotExpired(E,"time")&&b.push(E)}var O=this._signalingModule.filterMessageList(b);this._signalingMap.set(a,{needMessageCount:y,signalingList:m.concat(O)})}},{key:"_getSignalingRelatedToMeMap",value:function(l){for(var p=0;p<l.length;p++){var a=l[p];this._saveSignalingRelatedToMe(a)}return this._signalingRelatedToMeMap}},{key:"_saveSignalingRelatedToMe",value:function(l){var p=this._signalingModule.getRemoteSignalingHandler().getPayloadData(l)||{},a=p.actionType,c=a===void 0?"":a,h=p.inviteID,m=h===void 0?"":h,y=p.inviteeList,b=y===void 0?[]:y,I=this._signalingModule.getMyUserID();switch(c){case P.ACTION_TYPE_INVITE:b.includes(I)&&this._signalingRelatedToMeMap.set(m,r(r({},p),{},{messageList:[l]}));break;case P.ACTION_TYPE_REJECT_INVITE:case P.ACTION_TYPE_ACCEPT_INVITE:this.updateHistoryInviteInfo(l);break;case P.ACTION_TYPE_CANCEL_INVITE:this.deleteHistoryInviteInfo(m);break;case P.ACTION_TYPE_INVITE_TIMEOUT:this.updateHistoryInviteInfo(l)}}},{key:"deleteHistoryInviteInfo",value:function(l){this._signalingRelatedToMeMap.has(l)&&this._signalingRelatedToMeMap.delete(l)}},{key:"updateHistoryInviteInfo",value:function(l){var p=this._signalingModule.getRemoteSignalingHandler().getPayloadData(l)||{},a=p.inviteID,c=a===void 0?"":a,h=p.inviteeList,m=h===void 0?[]:h;if(this._signalingRelatedToMeMap.has(c)){for(var y=this._signalingRelatedToMeMap.get(c),b=y.inviteeList,I=y.messageList,E=0;E<m.length;E++){var O=m[E];b.includes(O)&&b.splice(b.indexOf(O),1)}b.length===0?this.deleteHistoryInviteInfo(c):I.push(l)}else this.deleteHistoryInviteInfo(c)}},{key:"_sortSignaling",value:function(l){var p=[];return l.forEach(function(a){p=[].concat(N(p),N(a.messageList))}),p.sort(function(a,c){return(a.time?a.time:0)-(c.time?c.time:0)})}},{key:"reset",value:function(){this._signalingMap.clear(),this._signalingRelatedToMeMap.clear()}}]),k}(),J8=u(function k(l,p){i(this,k),this.businessID=l.businessID||1,this.inviteID=l.inviteID,this.groupID=l.groupID||"",this.inviter=l.inviter||"",this.inviteeList=l.inviteeList||[],this.data=l.data||"",this.actionType=l.actionType||P.ACTION_TYPE_INVITE,this.timeout=l.timeout||0}),X8=["message"],Z8=["message"],Q8=function(k){f(p,k);var l=R(p);function p(a){var c;return i(this,p),(c=l.call(this,a))._n="SignalingModule",c._inviteInfoMap=new Map,c._outerEmitter=new p1,c._outerEmitter._emit=c._outerEmitter.emit,c._outerEmitter.emit=(function(){var h=arguments.length<=0?void 0:arguments[0],m=[h,{name:arguments.length<=0?void 0:arguments[0],data:arguments.length<=1?void 0:arguments[1]}];this._outerEmitter._emit.apply(this._outerEmitter,[].concat(m))}).bind(w(c)),c._canIUseSignaling=!1,c._isHandling=!1,c._remoteSignalingHandler=new z8(w(c)),c._localSignalingHandler=new K8(w(c)),c._historySignalingHandler=new Y8(w(c)),c._isC2CUnreadHandleCompleted=!1,c._isConvSyncCompleted=!1,c._isSyncCompleted=!1,c.getInnerEmitterInstance().on(rr.C2C_UNREAD_HANDLE_COMPLETED,c.onC2CUnreadHandleCompleted,w(c)),c.getInnerEmitterInstance().on(rr.CONV_SYNC_COMPLETED,c.onConvSyncCompleted,w(c)),c}return u(p,[{key:"onC2CUnreadHandleCompleted",value:function(){this._isC2CUnreadHandleCompleted=!0,this._isC2CUnreadHandleCompleted&&this._isConvSyncCompleted&&!this._isSyncCompleted&&this.onReady()}},{key:"onConvSyncCompleted",value:function(){this._isConvSyncCompleted=!0,this._isC2CUnreadHandleCompleted&&this._isConvSyncCompleted&&!this._isSyncCompleted&&this.onReady()}},{key:"onReady",value:function(){U.l("".concat(this._n,".onReady")),this._isSyncCompleted=!0,this._historySignalingHandler.getHistorySignaling()}},{key:"onNewMessageList",value:function(a){return this._remoteSignalingHandler.onNewMessageList(a)}},{key:"onMessageModified",value:function(a){return this._remoteSignalingHandler.onMessageModified(a)}},{key:"hasInviteInfo",value:function(a){return this._inviteInfoMap.has(a)}},{key:"getInviteInfo",value:function(a){return this._inviteInfoMap.get(a)}},{key:"setInviteInfo",value:function(a,c){var h=c.message,m=D(c,X8);U.l("".concat(this._n,".setInviteInfo inviteID:").concat(a," data:").concat(JSON.stringify(m))),this._inviteInfoMap.set(a,r(r({},m),{},{message:h}))}},{key:"deleteInviteInfo",value:function(a){this.hasInviteInfo(a)&&(U.l("".concat(this._n,".deleteInviteInfo inviteID:").concat(a,".")),this._inviteInfoMap.delete(a))}},{key:"updateInviteInfo",value:function(a){var c="".concat(this._n,".updateInviteInfo"),h=a.inviteID,m=a.inviter,y=a.inviteeList,b=a.groupID;if(U.l("".concat(c," inviteID:").concat(h," inviter:").concat(m," groupID:").concat(b)),b&&this.hasInviteInfo(h)){var I=y[0],E=this.getInviteInfo(h).inviteeList;E.includes(I)&&(E.splice(E.indexOf(I),1),U.l("".concat(c," remove ").concat(I,". localInviteeList.length:").concat(E.length))),E.length===0&&this.deleteInviteInfo(h)}else this.deleteInviteInfo(h)}},{key:"getLocalSignalingHandler",value:function(){return this._localSignalingHandler}},{key:"getRemoteSignalingHandler",value:function(){return this._remoteSignalingHandler}},{key:"canIUseSignaling",value:function(){return this._canIUseSignaling}},{key:"emitEvent",value:function(a,c){this._outerEmitter.emit(a,c)}},{key:"addSignalingListener",value:function(a,c,h){this._canIUseSignaling||(this._canIUseSignaling=!0),this._outerEmitter.on(a,c,h)}},{key:"removeSignalingListener",value:function(a,c,h){this._outerEmitter.off(a,c,h),this._outerEmitter.eventNames().length===0&&(this._canIUseSignaling=!1)}},{key:"invite",value:function(a){var c=this,h="".concat(this._n,".").concat("invite"),m=this._localSignalingHandler.createInviteInfo(a),y=m.message,b=m.customData,I=m.inviteID;return U.l("".concat(h," options:").concat(JSON.stringify(a)," inviteID:").concat(I)),this.sendSignaling(y,a).then(function(E){return E&&E.code===0?(c.setInviteInfo(I,r(r({},b),{},{message:y})),c.startTimer(r(r({},b),{},{inviteID:I})),r(r({},E),{},{inviteID:I})):E}).catch(function(E){return E})}},{key:"inviteSync",value:function(a,c,h){var m=this,y="".concat(this._n,".").concat("inviteSync"),b=this._localSignalingHandler.createInviteInfo(a),I=b.message,E=b.customData,O=b.inviteID;return U.l("".concat(y," options:").concat(JSON.stringify(a)," inviteID:").concat(O)),this.sendSignaling(I,a).then(function(F){if(F&&F.code===0)return m.setInviteInfo(O,r(r({},E),{},{message:I})),m.startTimer(r(r({},E),{},{inviteID:O})),c&&c({inviteID:O}),{inviteID:O};h&&h(F.code===0,F.message||"")}).catch(function(F){return h&&h(F.code,F.message),F}),O}},{key:"_handleImResponse",value:function(a,c,h){c&&c.code===0&&(this._isHandling=!1,h?this.deleteInviteInfo(a.inviteID):this.updateInviteInfo(a))}},{key:"cancel",value:function(a){var c=this,h="".concat(this._n,".").concat("cancel");if(U.l("".concat(h," options:").concat(JSON.stringify(a))),!this.hasInviteInfo(a.inviteID)||this._isHandling)return be({code:Ae.INVALID_CANCEL_MESSAGE});this._isHandling=!0;var m=this._localSignalingHandler.createCancelCustomData(a);if(!m)return this._isHandling=!1,be({code:Ae.SIGNALING_NO_PERMISSION});var y=m.groupID,b=m.inviteeList,I=y||b[0],E=this._localSignalingHandler.createSignalingMessage(m,I);return this.sendSignaling(E,a).then(function(O){return c._handleImResponse(m,O,!0),O.code===0?r(r({},O),{},{inviteID:a.inviteID}):O}).catch(function(O){return O})}},{key:"accept",value:function(a){var c=this,h="".concat(this._n,".").concat("accept");if(U.l("".concat(h," options:").concat(JSON.stringify(a))),!this.hasInviteInfo(a.inviteID)||this._isHandling)return be({code:Ae.SIGNALING_INVALID_INVITE_ID});this._isHandling=!0;var m=this._localSignalingHandler.createAcceptCustomData(a);if(!m)return this._isHandling=!1,be({code:Ae.SIGNALING_NO_PERMISSION});var y=this._localSignalingHandler.createSignalingMessage(m);return this.sendSignaling(y,a).then(function(b){return c._handleImResponse(m,b),b.code===0?r(r({},b),{},{inviteID:a.inviteID}):b}).catch(function(b){return b})}},{key:"reject",value:function(a){var c=this,h="".concat(this._n,".").concat("reject");if(U.l("".concat(h," options:").concat(JSON.stringify(a))),!this.hasInviteInfo(a.inviteID)||this._isHandling)return be({code:Ae.SIGNALING_INVALID_INVITE_ID});this._isHandling=!0;var m=this._localSignalingHandler.createRejectCustomData(a);if(!m)return this._isHandling=!1,be({code:Ae.SIGNALING_NO_PERMISSION});var y=this._localSignalingHandler.createSignalingMessage(m);return this.sendSignaling(y,a).then(function(b){return c._handleImResponse(m,b,!0),b.code===0?r(r({},b),{},{inviteID:a.inviteID}):b}).catch(function(b){return b})}},{key:"getSignalingInfo",value:function(a){var c="".concat(this._n,".getSignalingInfo"),h=this._filterSignalingMessage(a);if(U.l("".concat(c," isSignaling:").concat(h)),h){var m=this._remoteSignalingHandler.getPayloadData(a);return new J8(m)}return null}},{key:"modifyInvitation",value:function(a){var c=this,h=a.inviteID,m=a.data;if(!this.hasInviteInfo(a.inviteID)||this._isHandling)return be({code:Ae.SIGNALING_INVALID_INVITE_ID});this._isHandling=!0;var y=this.getInviteInfo(h),b=y.message,I=D(y,Z8),E=b.payload.data;return I.data=m,b.payload.data=JSON.stringify(I),this.getModule(sr).modifyRemoteMessage(b).then(function(O){return c.setInviteInfo(h,r(r({},I),{},{message:b})),c._isHandling=!1,O}).catch(function(O){return c._isHandling=!1,b.payload.data=E,O})}},{key:"_genMessageControlInfo",value:function(){var a=arguments.length>0&&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,O=!!y.match(/"excludeFromHistoryMessage"/),F={};return E&&(F=this.getInviteInfo(E).message),{onlineUserOnly:b||F._onlineUserOnly,messageControlInfo:r(r({},h),{},{excludedFromUnreadCount:O||h.excludedFromUnreadCount,excludedFromLastMessage:O||h.excludedFromLastMessage,excludedFromContentModeration:!0})}}},{key:"sendSignaling",value:function(a,c){var h=this;return this.getModule(sr).sendMessageInstance(a,this._genMessageControlInfo(c)).catch(function(m){return h._isHandling=!1,be({code:Ae.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/),O=b.match(/actionType/);c=I||E&&O}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 O=E?m+5:m,F=1,q=setInterval(function(){var ee=c._hasLocalInviteInfo(a,E);F<O&&ee?++F:(ee&&c._sendTimeoutNotice(y,E),U.l("".concat(h," end.")),clearInterval(q))},1e3)}},{key:"_hasLocalInviteInfo",value:function(a,c){var h=a.inviteID,m=a.groupID;if(!this.hasInviteInfo(h))return!1;var y="".concat(this._n,"._hasLocalInviteInfo"),b=this.getInviteInfo(h).inviteeList;return U.l("".concat(y," inviteID:").concat(h," groupID:").concat(m," inviteeList:").concat(b)),!m||(c?b.length>0: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 O=b.data,F=b.groupID,q=b.inviteeList,ee=b.inviter;h.emitEvent(P.INVITATION_TIMEOUT,{data:O,groupID:F,inviteID:a,inviteeList:q,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),ex=function(){function k(l){var p=this;i(this,k);var a,c=new We("sdkConstruct");this._n="ModuleManager",this._isReady=!1,this._reason=Ae.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 V6(this,l)),this._moduleMap.set(_p,new $8(this)),this._moduleMap.set(vp,new k8(this)),this._moduleMap.set(yp,new F8(this)),this._moduleMap.set(Bo,new R8(this)),this._moduleMap.set(Ps,new _8(this)),this._moduleMap.set(xi,new w8(this)),this._moduleMap.set(Fa,new j6(this)),this._moduleMap.set(sr,new i8(this)),this._moduleMap.set(gp,new s8(this)),this._moduleMap.set(_w,new a8(this)),this._moduleMap.set(pr,new q6(this)),this._moduleMap.set(ao,new a6(this)),this._moduleMap.set(ct,new _6(this)),this._moduleMap.set(It,new x6(this)),this._moduleMap.set(ar,new G6(this)),this._moduleMap.set(ra,new W6(this)),this._moduleMap.set(bw,new V8(this)),this._moduleMap.set(M0,new Y6(this)),this._moduleMap.set(Ga,new X6(this)),this._moduleMap.set(vw,new Q6(this)),this._moduleMap.set(Ag,new l8(this)),this._moduleMap.set(I0,new u8(this)),this._moduleMap.set(mp,new S8(this)),this._moduleMap.set(yw,new D8(this)),this._moduleMap.set(hr,new U8(this)),this._moduleMap.set(bp,new B8(this)),this._moduleMap.set($a,new H8(this)),this._moduleMap.set(C0,new q8(this)),this._moduleMap.set(ri,new Q8(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(It,new a(p)):I==="relationship-module"?p._moduleMap.set(hr,new a(p)):I==="signaling-module"&&p._moduleMap.set(ri,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(Rs()," isIntl:").concat(y," inBrowser:").concat(lt," inMiniApp:").concat(je)+" workerAvailable:".concat(yr," UserAgent:").concat(st);We.bindEventStatModule(this._moduleMap.get(M0)),c.setMessage("".concat(b," ").concat(function(){var I="";if(je)try{var E=Fe.getSystemInfoSync(),O=E.model,F=E.version,q=E.system,ee=E.platform,ge=E.SDKVersion;I="model:".concat(O," version:").concat(F," system:").concat(q," 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(yp),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(yp),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(Ps);l.setIsWorkerEnabled(!0),l.reConnect()}},{key:"_startMainThreadSocket",value:function(){U.l("".concat(this._n,"._startMainThreadSocket"));var l=this._moduleMap.get(Ps);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(Fa)],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(L.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(Ga).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(Ga).start(),this._ssoLogForReady=new We("sdkReady"),this._reason=Ae.LOGGING_IN)}},{key:"onLoginFailed",value:function(){this._startLoginTs=0}},{key:"getOuterEmitterInstance",value:function(){return this._outerEmitter===null&&(this._outerEmitter=new p1,s6(this._outerEmitter),this._outerEmitter._emit=this._outerEmitter.emit,this._outerEmitter.emit=(function(l,p){var a=this;if(this._canIUseSignaling()){if(l===L.MESSAGE_RECEIVED){var c=this.getModule(ri);c.onNewMessageList(p)}if(l===L.MESSAGE_MODIFIED){var h=this.getModule(ri);h.onMessageModified(p)}}if(l===L.CONVERSATION_LIST_UPDATED||l===L.FRIEND_LIST_UPDATED||l===L.GROUP_LIST_UPDATED||l===L.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(ri);return!!l&&l.canIUseSignaling()}},{key:"_getEventData",value:function(l){return l===L.CONVERSATION_LIST_UPDATED?this._moduleMap.get(ct).getLocalConversationList():l===L.FRIEND_LIST_UPDATED?this._moduleMap.get(hr).getLocalFriendList(!1):l===L.GROUP_LIST_UPDATED?this._moduleMap.get(It).getLocalGroupList():l===L.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED?this._moduleMap.get(ct).getTotalUnreadMessageCount():void 0}},{key:"getInnerEmitterInstance",value:function(){return this._innerEmitter===null&&(this._innerEmitter=new p1,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(bw).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(Ga).getNetworkType()).setLevel("error").end(),this.getOuterEmitterInstance().emit(L.ERROR,l)}},{key:"restartTimer",value:function(){U.l("".concat(this._n,".restartTimer")),this.stopTimer(),this._startTimer();var l=this.getModule(It);l&&l.restartPolling()}},{key:"getTimerID",value:function(){var l=this._moduleMap.get(yp);return l.isWorkerEnabled()?l.getTimerID():this._checkTimer}},{key:"getPollingTimerID",value:function(l){return this._moduleMap.get(It).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(L.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}(),tx=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(L).indexOf(l),m="CallbackError";if(h!==-1){var y=Object.keys(L)[h];c._m.outputWarning(m,y,I)}var b=new We(m);b.setMessage("eventName:".concat(l)).setMoreMessage(I.message).end()}}}}]),k}(),nx=function(){function k(l){i(this,k);var p={SDKAppID:l.SDKAppID,unlimitedAVChatRoom:l.unlimitedAVChatRoom||!1,scene:l.scene||"",oversea:l.oversea||!1,instanceID:Pa(),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 ex(p),this._vendorMap=new Map,this._safetyCallbackFactory=new tx(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(Fa).login(l)}},{key:"logout",value:function(){var l=this;return this._getModule(Fa).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(yp).terminate(),l._getModule(Ps).dealloc();var p=l._m.getOuterEmitterInstance(),a=l._getModule(pn);p.emit(L.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(bp).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&&(Hu()?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(sr).createTextMessage(l)}},{key:"createTextAtMessage",value:function(l){return this._getModule(sr).createTextMessage(l)}},{key:"createImageMessage",value:function(l){return this._getModule(sr).createImageMessage(l)}},{key:"createAudioMessage",value:function(l){return this._getModule(sr).createAudioMessage(l)}},{key:"createVideoMessage",value:function(l){return this._getModule(sr).createVideoMessage(l)}},{key:"createCustomMessage",value:function(l){return this._getModule(sr).createCustomMessage(l)}},{key:"createFaceMessage",value:function(l){return this._getModule(sr).createFaceMessage(l)}},{key:"createFileMessage",value:function(l){return this._getModule(sr).createFileMessage(l)}},{key:"createLocationMessage",value:function(l){return this._getModule(sr).createLocationMessage(l)}},{key:"createMergerMessage",value:function(l){return this._getModule(sr).createMergerMessage(l)}},{key:"downloadMergerMessage",value:function(l){return l.type!==T.MSG_MERGER?be({code:Ae.MSG_MERGER_TYPE_INVALID}):Ye(l.payload.downloadKey)?be({code:Ae.MSG_MERGER_KEY_INVALID}):this._getModule(sr).downloadMergerMessage(l).catch(function(p){return be({code:Ae.MSG_MERGER_DOWNLOAD_FAIL})})}},{key:"createForwardMessage",value:function(l){return this._getModule(sr).createForwardMessage(l)}},{key:"sendMessage",value:function(l,p){return l instanceof qr?this._getModule(sr).sendMessageInstance(l,p):be({code:Ae.MSG_INSTANCE_REQUIRED})}},{key:"searchCloudMessages",value:function(l){return this._getModule(sr).searchCloudMessages(l)}},{key:"callExperimentalAPI",value:function(l,p){return l==="sendComboMessage"?this._getModule(_w).sendMessage(p):l==="handleGroupInvitation"?this._getModule(It).handleGroupInvitation(p):l==="isCommercialAbilityEnabled"?this._getModule(_p).isFeatureEnabled(p):l==="isIntl"?this.isIntl():l==="sendTRTCCustomData"?this._getModule(C0).sendTRTCCustomData(p):l==="getTimerID"?this._m.getTimerID():l==="getPollingTimerID"?this._m.getPollingTimerID(p):be({code:Ae.INVALID_OPERATION})}},{key:"revokeMessage",value:function(l){return this._getModule(sr).revokeMessage(l)}},{key:"resendMessage",value:function(l,p){return l instanceof qr?this._getModule(sr).resendMessage(l,p):be({code:Ae.MSG_INSTANCE_REQUIRED})}},{key:"deleteMessage",value:function(l){return this._getModule(sr).deleteMessage(l)}},{key:"translateText",value:function(l){return this._getModule(sr).translateText(l)}},{key:"setMessageExtensions",value:function(l,p){return this._getModule(gp).setMessageExtensions(l,p)}},{key:"getMessageExtensions",value:function(l){return this._getModule(gp).getMessageExtensions(l)}},{key:"deleteMessageExtensions",value:function(l,p){return this._getModule(gp).deleteMessageExtensions(l,p)}},{key:"modifyMessage",value:function(l){return this._getModule(sr).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(It);return p?p.getReadReceiptDetail(l):be({code:Ae.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():be({code:Ae.CANNOT_FIND_MODULE})}},{key:"addFriend",value:function(l){var p=this._getModule(hr);return p?p.addFriend(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"deleteFriend",value:function(l){var p=this._getModule(hr);return p?p.deleteFriend(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"checkFriend",value:function(l){var p=this._getModule(hr);return p?p.checkFriend(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getFriendProfile",value:function(l){var p=this._getModule(hr);return p?p.getFriendProfile(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"updateFriend",value:function(l){var p=this._getModule(hr);return p?p.updateFriend(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getFriendApplicationList",value:function(){var l=this._getModule(hr);return l?l.getLocalFriendApplicationList():be({code:Ae.CANNOT_FIND_MODULE})}},{key:"acceptFriendApplication",value:function(l){var p=this._getModule(hr);return p?p.acceptFriendApplication(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"refuseFriendApplication",value:function(l){var p=this._getModule(hr);return p?p.refuseFriendApplication(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"deleteFriendApplication",value:function(l){var p=this._getModule(hr);return p?p.deleteFriendApplication(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"setFriendApplicationRead",value:function(){var l=this._getModule(hr);return l?l.setFriendApplicationRead():be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getFriendGroupList",value:function(){var l=this._getModule(hr);return l?l.getLocalFriendGroupList():be({code:Ae.CANNOT_FIND_MODULE})}},{key:"createFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.createFriendGroup(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"deleteFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.deleteFriendGroup(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"addToFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.addToFriendGroup(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"removeFromFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.removeFromFriendGroup(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"renameFriendGroup",value:function(l){var p=this._getModule(hr);return p?p.renameFriendGroup(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getGroupList",value:function(){var l=this._getModule(It);return l?l.getGroupList():be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getGroupProfile",value:function(l){var p=this._getModule(It);return p?p.getGroupProfile(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"createGroup",value:function(l){var p=this._getModule(It);return p?p.createGroup(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"dismissGroup",value:function(l){var p=this._getModule(It);return p?p.dismissGroup(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"updateGroupProfile",value:function(l){var p=this._getModule(It);return p?p.updateGroupProfile(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"joinGroup",value:function(l){var p=this._getModule(It);return p?p.joinGroup(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"quitGroup",value:function(l){var p=this._getModule(It);return p?p.quitGroup(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"searchGroupByID",value:function(l){var p=this._getModule(It);return p?p.searchGroupByID(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getGroupOnlineMemberCount",value:function(l){var p=this._getModule(It);return p?p.getGroupOnlineMemberCount(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"changeGroupOwner",value:function(l){var p=this._getModule(It);return p?p.changeGroupOwner(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getGroupApplicationList",value:function(){var l=this._getModule(It);return l?l.getGroupApplicationList():be({code:Ae.CANNOT_FIND_MODULE})}},{key:"handleGroupApplication",value:function(l){var p=this._getModule(It);return p?p.handleGroupApplication(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"initGroupAttributes",value:function(l){var p=this._getModule(It);return p?p.initGroupAttributes(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"setGroupAttributes",value:function(l){var p=this._getModule(It);return p?p.setGroupAttributes(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"deleteGroupAttributes",value:function(l){var p=this._getModule(It);return p?p.deleteGroupAttributes(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getGroupAttributes",value:function(l){var p=this._getModule(It);return p?p.getGroupAttributes(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"setGroupCounters",value:function(l){var p=this._getModule(It);return p?p.setGroupCounters(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"increaseGroupCounter",value:function(l){var p=this._getModule(It);return p?p.increaseGroupCounter(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"decreaseGroupCounter",value:function(l){var p=this._getModule(It);return p?p.decreaseGroupCounter(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getGroupCounters",value:function(l){var p=this._getModule(It);return p?p.getGroupCounters(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getGroupMemberList",value:function(l){var p=this._getModule(It);return p?p.getGroupMemberList(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getGroupMemberProfile",value:function(l){var p=this._getModule(It);return p?p.getGroupMemberProfile(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"addGroupMember",value:function(l){var p=this._getModule(It);return p?p.addGroupMember(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"deleteGroupMember",value:function(l){var p=this._getModule(It);return p?p.deleteGroupMember(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"setGroupMemberMuteTime",value:function(l){var p=this._getModule(It);return p?p.setGroupMemberMuteTime(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"setGroupMemberRole",value:function(l){var p=this._getModule(It);return p?p.setGroupMemberRole(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"setGroupMemberNameCard",value:function(l){var p=this._getModule(It);return p?p.setGroupMemberNameCard(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"setGroupMemberCustomField",value:function(l){var p=this._getModule(It);return p?p.setGroupMemberCustomField(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"markGroupMemberList",value:function(l){var p=this._getModule(It);return p?p.markGroupMemberList(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getJoinedCommunityList",value:function(){return this._getModule(ar).getJoinedCommunityList()}},{key:"createTopicInCommunity",value:function(l){return this._getModule(ar).createTopicInCommunity(l)}},{key:"deleteTopicFromCommunity",value:function(l){return this._getModule(ar).deleteTopicFromCommunity(l)}},{key:"updateTopicProfile",value:function(l){return this._getModule(ar).updateTopicProfile(l)}},{key:"getTopicList",value:function(l){return this._getModule(ar).getTopicList(l)}},{key:"addSignalingListener",value:function(l,p,a){var c=this._getModule(ri);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(ri);h&&(h.removeSignalingListener(l,c,a),this._safetyCallbackFactory.delete(l,p))}}},{key:"invite",value:function(l){var p=this._getModule(ri);return p?p.invite(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"inviteSync",value:function(l,p,a){var c=this._getModule(ri);return c?c.inviteSync(l,p,a):""}},{key:"inviteInGroup",value:function(l){var p=this._getModule(ri);return p?p.invite(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"inviteInGroupSync",value:function(l,p,a){var c=this._getModule(ri);return c?c.inviteSync(l,p,a):""}},{key:"cancel",value:function(l){var p=this._getModule(ri);return p?p.cancel(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"accept",value:function(l){var p=this._getModule(ri);return p?p.accept(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"reject",value:function(l){var p=this._getModule(ri);return p?p.reject(l):be({code:Ae.CANNOT_FIND_MODULE})}},{key:"getSignalingInfo",value:function(l){var p=this._getModule(ri);return p?p.getSignalingInfo(l):null}},{key:"modifyInvitation",value:function(l){var p=this._getModule(ri);return p?p.modifyInvitation(l):be({code:Ae.CANNOT_FIND_MODULE})}}]),k}(),rx={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 ox(k,l){if(k.isReady()||rx[l]===1)return!0;var p=k.getNotReadyReason(),a={code:p,message:"".concat(k.getErrorMessage(p)," | ").concat(l," | ").concat(k.getErrorMessage(Ae.SDK_IS_NOT_READY))};return k.onError(a),a}var Rp={},Wu={};return Wu.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&&Rp[p])return Rp[p];U.l("".concat(l));var c=new nx(r(r({},k),{},{SDKAppID:p}));c.on(L.SDK_DESTROY,function(m){Rp[m.data.SDKAppID]=null,delete Rp[m.data.SDKAppID]});var h=function(m){var y=Object.create(null);return Object.keys(e6).forEach(function(b){if(m[b]){var I=new Q;y[b]=function(){var E=Array.from(arguments);return I.use(function(O,F){var q=ox(m,b);return q===!0?F():be(q)}).use(function(O,F){if(fp(O,mw[b],b)===!0)return F()}).use(function(O,F){return m[b].apply(m,O)}),I.run(E)}}}),y}(c);return Rp[p]=h,mw.hookGetAPITips(c.getErrorMessage.bind(c)),U.l("".concat(l," ok")),h},Wu.TYPES=T,Wu.EVENT=L,Wu.TSignaling=P,Wu.VERSION="3.1.1",U.l("TencentCloudChat.VERSION:".concat(Wu.VERSION)),Wu})})(AO);var C$=AO.exports;const vt=Vf(C$),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 EC(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 Wh(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 LO(e){const{t}=window.TUIKitTUICore.config.i18n.useI18n(),n=[`[${t("TUIConversation.有人@我")}]`,`[${t("TUIConversation.@所有人")}]`,`[${t("TUIConversation.@所有人")}][${t("TUIConversation.有人@我")}]`];let r="";for(let o=0;o<e.groupAtInfoList.length;o++)e.groupAtInfoList[o].atTypeArray[0]&&e.unreadCount>0&&(r=n[e.groupAtInfoList[o].atTypeArray[0]-1]);return r}function T$(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:const{payload:r}=e;(r.data?nr(r.data):{}).businessID==="TC_GROUP_NOTICE"?t.referenceMessageForShow="[群公告]":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 w$(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=nr((u=n==null?void 0:n.payload)==null?void 0:u.data);if((d==null?void 0:d.businessID)===1)return i=AC(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 S$(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=k$(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(((_=nr((v=e==null?void 0:e.payload)==null?void 0:v.data))==null?void 0:_.businessID)==="group_create"){const C=nr((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=AC(e);return n}function k$(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 OO(e){return{text:EO(e.payload)}}function RO(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 D$(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 NO(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 PO(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 E$(e){return{progress:(e==null?void 0:e.status)==="unSend"&&e.progress,url:e.payload.url,message:e,second:e.payload.second}}function xO(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 A$(e){return{message:e,...e.payload}}function AC(e){var s,u;const{t}=window.TUIKitTUICore.config.i18n.useI18n();let n={},r={};try{n=nr((s=e==null?void 0:e.payload)==null?void 0:s.data)}catch{n={}}if(n.businessID!==1)return"";try{r=nr(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.通话时长")}:${_$(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 UO(e){var i,s;const{t}=window.TUIKitTUICore.config.i18n.useI18n(),n=nr((i=e==null?void 0:e.payload)==null?void 0:i.data);(n==null?void 0:n.businessID)===cn.typeEvaluate&&((n==null?void 0:n.score)>0||(n.score=1,e.payload.data=JSON.stringify(n)));let r={};try{r=nr((s=e==null?void 0:e.payload)==null?void 0:s.data)}catch{r={}}let o=AC(e)||`[${t("message.custom.自定义消息")}]`;return(r==null?void 0:r.businessID)==="TC_GROUP_NOTICE"&&(o="[群公告]"),{message:e,custom:o}}function L$(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 uk(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 O$(e){if(typeof e=="string")try{return!!JSON.parse(e)}catch{return!1}return!1}function nr(e){return!e||!O$(e)?e:JSON.parse(e)}function cf(e){var t;if(!e)return!1;try{const{businessID:n}=nr((t=e==null?void 0:e.payload)==null?void 0:t.data);if(n===cn.typeUserTyping)return!0}catch{return!1}return!1}function LC(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]=LC(i,t))}),n}const FO=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=nr((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=nr((d=e==null?void 0:e.payload)==null?void 0:d.data))==null?void 0:f.businessID)==="group_create"},OC=(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){Jt(this,"allowNotifications",!0);Jt(this,"showPreviews",!0);Jt(this,"notificationTitle","腾讯云 IM ");Jt(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||cf&&cf(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=nr((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=nr((o=t==null?void 0:t.payload)==null?void 0:o.data),s=nr(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()}};Jt(uo,"TUICore"),Jt(uo,"instance");let OM=uo;class ad{destroyed(){}updateStore(t,n){}}class GO extends ad{constructor(n){super();Jt(this,"TUICore");Jt(this,"store");Jt(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]),OM.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=nr(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=nr(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=nr(n==null?void 0:n.cloudCustomData),R=(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)===R))||this.findMessage(R)}const D=r!=null&&r.cloudCustomData?nr(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=nr(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(R=>(R==null?void 0:R.ID)===S))||this.findMessage(S)}const C=r!=null&&r.cloudCustomData?nr(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,R,A,N,H,z,x,B,j;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 L=n!=null&&n.cloudCustomData?nr(n==null?void 0:n.cloudCustomData):{messageReact:{}};if((D=L==null?void 0:L.messageReact)!=null&&D.reacts)if((w=L==null?void 0:L.messageReact)!=null&&w.reacts[r]){const P=(R=(S=L==null?void 0:L.messageReact)==null?void 0:S.reacts[r])==null?void 0:R.indexOf(G);P===-1?(N=(A=L==null?void 0:L.messageReact)==null?void 0:A.reacts[r])==null||N.push(G):((z=(H=L==null?void 0:L.messageReact)==null?void 0:H.reacts[r])==null||z.splice(P,1),((B=(x=L==null?void 0:L.messageReact)==null?void 0:x.reacts[r])==null?void 0:B.length)===0&&((j=L==null?void 0:L.messageReact)==null||delete j.reacts[r]))}else L.messageReact.reacts[r]=[G];else L.messageReact={reacts:{},version:1},L.messageReact.reacts[r]=[G];n.cloudCustomData=JSON.stringify(L);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 R$=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=jt({data:{}});return nn(()=>{n.data=e.data}),{...Kt(n)}}});const Wt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},N$={key:0,class:"text-box"},P$=["src"];function x$(e,t,n,r,o,i){return Z(!0),se(dt,null,Vt(e.data.text,(s,u)=>(Z(),se(dt,{key:u},[s.name==="text"?(Z(),se("span",N$,De(s.text),1)):s.name==="img"?(Z(),se("img",{key:1,class:"text-img",src:s.src},null,8,P$)):Ce("",!0)],64))),128)}const $O=Wt(R$,[["render",x$],["__scopeId","data-v-7f095d6a"]]),U$=ot({props:{data:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1}},emits:["uploading","previewImage"],setup(e,t){const n=jt({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&&Ir(()=>{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=OC(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{...Kt(n),toggleShow:i,skeleton:r,isWidth:o,downloadImage:s}}}),F$=""+new URL("close-image-15985c26.png",import.meta.url).href,G$=""+new URL("downaload-image-285429cc.png",import.meta.url).href;const BO=e=>(mr("data-v-9b3121bd"),e=e(),vr(),e),$$=["src","width","height"],B$={key:0,class:"progress"},H$=["value"],q$={key:0},V$=["src"],z$={key:0,class:"dialog-box-h5-footer"},j$=BO(()=>$("img",{src:F$},null,-1)),W$=[j$],K$=BO(()=>$("img",{src:G$},null,-1)),Y$=[K$];function J$(e,t,n,r,o,i){return Z(),se("div",{class:"message-image",onClick:t[6]||(t[6]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"])),ref:"skeleton"},[$("img",{class:"message-img",src:e.data.url,width:e.data.width,height:e.data.height,style:Ro(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,$$),e.data.progress?(Z(),se("div",B$,[$("progress",{value:e.data.progress,max:"1"},null,8,H$)])):Ce("",!0),e.show?(Z(),se("div",{key:1,class:"dialog",onClick:t[5]||(t[5]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"]))},[e.isH5?Ce("",!0):(Z(),se("header",q$,[$("i",{class:"icon icon-close",onClick:t[0]||(t[0]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["stop"]))})])),$("div",{class:it(["dialog-box",[e.isH5?"dialog-box-h5":""]]),onClick:t[4]||(t[4]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"]))},[$("img",{class:it([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,V$),e.isH5?(Z(),se("div",z$,[$("p",{onClick:t[2]||(t[2]=(...s)=>e.toggleShow&&e.toggleShow(...s))},W$),$("p",{onClick:t[3]||(t[3]=bn(s=>e.downloadImage(e.data.message),["stop"]))},Y$)])):Ce("",!0)],2)])):Ce("",!0)],512)}const X$=Wt(U$,[["render",J$],["__scopeId","data-v-9b3121bd"]]),Z$=ot({props:{data:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1}},setup(e,t){const n=jt({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,R;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&&((R=(S=g==null?void 0:g.message)==null?void 0:S.payload)==null?void 0:R.thumbUrl)||await d(g.url):""};return nn(async()=>{n.data=e.data,n.data&&(n.poster=await f(n.data),Ir(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:R=0,snapshotHeight:A=0,snapshotUrl:N}=n.data;if(R===0||A===0)return;N===s&&(R=n.posterWidth,A=n.posterHeight),_=OC(R,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")}),{...Kt(n),toggleShow:u,isWidth:i,getVideoBase64:d,handlePosterUrl:f,skeleton:r,video:o}}});const Q$={class:"message-video"},e9=["src"],t9=["src","poster"],n9=["src","poster"],r9={key:3,class:"progress"},o9=["value"],i9=["src"];function s9(e,t,n,r,o,i){return Z(),se("div",Q$,[$("div",{class:it(["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?(Z(),se("img",{key:0,class:it(["message-img",[e.isWidth?"isWidth":"isHeight"]]),src:e.poster},null,10,e9)):e.isH5?(Z(),se("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,t9)):!e.data.progress&&!e.isH5?(Z(),se("video",{key:2,class:"message-img video-web",src:e.data.url,controls:"",preload:"metadata",poster:e.poster,ref:"video"},null,8,n9)):Ce("",!0),e.data.progress?(Z(),se("div",r9,[$("progress",{value:e.data.progress,max:"1"},null,8,o9)])):Ce("",!0)],2),e.show&&e.isH5?(Z(),se("div",{key:0,class:"dialog-video",onClick:t[3]||(t[3]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"]))},[$("header",null,[$("i",{class:"icon icon-close",onClick:t[1]||(t[1]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["stop"]))})]),$("div",{class:it(["dialog-video-box",[e.isH5?"dialog-video-h5":""]]),onClick:t[2]||(t[2]=bn((...s)=>e.toggleShow&&e.toggleShow(...s),["self"]))},[$("video",{class:it([e.isWidth?"isWidth":"isHeight"]),src:e.data.url,controls:"",autoplay:""},null,10,i9)],2)])):Ce("",!0)])}const a9=Wt(Z$,[["render",s9],["__scopeId","data-v-f3ee63bb"]]),l9=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=jt({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{...Kt(n),audio:r,play:o,onStopAnimation:i}}});const u9=["src"];function c9(e,t,n,r,o,i){var s;return Z(),se("div",{class:it(["message-audio",[e.data.message.flow==="out"&&"reserve"]]),onClick:t[2]||(t[2]=bn((...u)=>e.play&&e.play(...u),["stop"])),style:Ro(`width: ${((s=e.data)==null?void 0:s.second)*10+40}Px`)},[$("i",{class:it(["icon icon-voice",[e.data.message.flow==="out"&&"icon-reserve",e.data.message.isPlay?"icon-voice-active":""]])},null,2),$("label",null,De(e.data.second?e.data.second:1)+"s",1),$("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,u9)],6)}const d9=Wt(l9,[["render",c9],["__scopeId","data-v-c66a067a"]]),f9=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=jt({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{...Kt(n),download:r}}});const p9=e=>(mr("data-v-1125cab4"),e=e(),vr(),e),h9={class:"message-file"},g9=["title"],m9=p9(()=>$("i",{class:"icon icon-files"},null,-1)),v9={class:"message-file-content"},y9=["value"];function _9(e,t,n,r,o,i){return Z(),se("div",h9,[$("div",{class:"box",onClick:t[0]||(t[0]=(...s)=>e.download&&e.download(...s)),title:e.$t("TUIChat.单击下载")},[m9,$("div",v9,[$("label",null,De(e.data.name),1),$("span",null,De(e.data.size),1)])],8,g9),e.data.progress?(Z(),se("progress",{key:0,value:e.data.progress,max:"1"},null,8,y9)):Ce("",!0)])}const b9=Wt(f9,[["render",_9],["__scopeId","data-v-1125cab4"]]),M9=ot({props:{data:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1}},setup(e,t){const n=jt({data:{}}),r=Ne();return nn(()=>{n.data=e.data,n.data&&Ir(()=>{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=OC(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`)})}),{...Kt(n),skeleton:r}}});const I9={class:"message-image",ref:"skeleton"},C9=["src"];function T9(e,t,n,r,o,i){return Z(),se("div",I9,[$("img",{class:"message-img",src:e.data.url,style:Ro(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,C9)],512)}const w9=Wt(M9,[["render",T9],["__scopeId","data-v-07d82c7d"]]),S9=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=jt({data:{}});return nn(()=>{n.data=e.data}),{...Kt(n)}}});const k9=["href"],D9={class:"el-icon-location-outline"},E9=["src"];function A9(e,t,n,r,o,i){return Z(),se("a",{class:"message-location",href:e.data.href,target:"_blank",title:"点击查看详情"},[$("span",D9,De(e.data.description),1),$("img",{src:e.data.url},null,8,E9)],8,k9)}const L9=Wt(S9,[["render",A9],["__scopeId","data-v-932323be"]]),O9=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=jt({data:{}});return nn(()=>{n.data=e.data}),{...Kt(n)}}});const R9={class:"message-merger"};function N9(e,t,n,r,o,i){return Z(),se("div",R9," 当前版本不支持查看此消息 ")}const P9=Wt(O9,[["render",N9],["__scopeId","data-v-2cd600de"]]);/*!
- * vuex v4.0.2
- * (c) 2021 Evan You
- * @license MIT
- */var RC="store";function Ei(e){return e===void 0&&(e=null),tn(e!==null?e:RC)}function x9(e,t){return e.filter(t)[0]}function RM(e,t){if(t===void 0&&(t=[]),e===null||typeof e!="object")return e;var n=x9(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]=RM(e[o],t)}),r}function zf(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}function HO(e){return e!==null&&typeof e=="object"}function U9(e){return e&&typeof e.then=="function"}function F9(e,t){return function(){return e(t)}}function qO(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 VO(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;By(e,n,[],e._modules.root,!0),NC(e,n,t)}function NC(e,t,n){var r=e._state;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,i={};zf(o,function(s,u){i[u]=F9(s,e),Object.defineProperty(e.getters,u,{get:function(){return i[u]()},enumerable:!0})}),e._state=jt({data:t}),e.strict&&q9(e),r&&n&&e._withCommit(function(){r.data=null})}function By(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=PC(t,n.slice(0,-1)),d=n[n.length-1];e._withCommit(function(){u[d]=r.state})}var f=r.context=G9(e,s,n);r.forEachMutation(function(g,v){var _=s+v;$9(e,_,g,f)}),r.forEachAction(function(g,v){var _=g.root?v:s+v,M=g.handler||g;B9(e,_,M,f)}),r.forEachGetter(function(g,v){var _=s+v;H9(e,_,g,f)}),r.forEachChild(function(g,v){By(e,t,n.concat(v),g,o)})}function G9(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 zO(e,t)}},state:{get:function(){return PC(e.state,n)}}}),o}function zO(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 $9(e,t,n,r){var o=e._mutations[t]||(e._mutations[t]=[]);o.push(function(s){n.call(e,r.state,s)})}function B9(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 U9(u)||(u=Promise.resolve(u)),e._devtoolHook?u.catch(function(d){throw e._devtoolHook.emit("vuex:error",d),d}):u})}function H9(e,t,n,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(i){return n(r.state,r.getters,i.state,i.getters)})}function q9(e){$t(function(){return e._state.data},function(){},{deep:!0,flush:"sync"})}function PC(e,t){return t.reduce(function(n,r){return n[r]},e)}function Dv(e,t,n){return HO(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}var V9="vuex bindings",ck="vuex:mutations",E1="vuex:actions",xd="vuex",z9=0;function j9(e,t){hG({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:[V9]},function(n){n.addTimelineLayer({id:ck,label:"Vuex Mutations",color:dk}),n.addTimelineLayer({id:E1,label:"Vuex Actions",color:dk}),n.addInspector({id:xd,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree(function(r){if(r.app===e&&r.inspectorId===xd)if(r.filter){var o=[];YO(o,t._modules.root,r.filter,""),r.rootNodes=o}else r.rootNodes=[KO(t._modules.root,"")]}),n.on.getInspectorState(function(r){if(r.app===e&&r.inspectorId===xd){var o=r.nodeId;zO(t,o),r.state=Y9(X9(t._modules,o),o==="root"?t.getters:t._makeLocalGettersCache,o)}}),n.on.editInspectorState(function(r){if(r.app===e&&r.inspectorId===xd){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(xd),n.sendInspectorState(xd),n.addTimelineEvent({layerId:ck,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=z9++,r._time=Date.now(),i.state=o,n.addTimelineEvent({layerId:E1,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:E1,event:{time:Date.now(),title:r.type,groupId:r._id,subtitle:"end",data:i}})}})})}var dk=8702998,W9=6710886,K9=16777215,jO={label:"namespaced",textColor:K9,backgroundColor:W9};function WO(e){return e&&e!=="root"?e.split("/").slice(-2,-1)[0]:"Root"}function KO(e,t){return{id:t||"root",label:WO(t),tags:e.namespaced?[jO]:[],children:Object.keys(e._children).map(function(n){return KO(e._children[n],t+n+"/")})}}function YO(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?[jO]:[]}),Object.keys(t._children).forEach(function(o){YO(e,t._children[o],n,r+o+"/")})}function Y9(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("/")?WO(s):s,editable:!1,value:NM(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]=NM(function(){return e[n]})}else t[n]=NM(function(){return e[n]})}),t}function X9(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 NM(e){try{return e()}catch(t){return t}}var Js=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)||{}},JO={namespaced:{configurable:!0}};JO.namespaced.get=function(){return!!this._rawModule.namespaced};Js.prototype.addChild=function(t,n){this._children[t]=n};Js.prototype.removeChild=function(t){delete this._children[t]};Js.prototype.getChild=function(t){return this._children[t]};Js.prototype.hasChild=function(t){return t in this._children};Js.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)};Js.prototype.forEachChild=function(t){zf(this._children,t)};Js.prototype.forEachGetter=function(t){this._rawModule.getters&&zf(this._rawModule.getters,t)};Js.prototype.forEachAction=function(t){this._rawModule.actions&&zf(this._rawModule.actions,t)};Js.prototype.forEachMutation=function(t){this._rawModule.mutations&&zf(this._rawModule.mutations,t)};Object.defineProperties(Js.prototype,JO);var ld=function(t){this.register([],t,!1)};ld.prototype.get=function(t){return t.reduce(function(n,r){return n.getChild(r)},this.root)};ld.prototype.getNamespace=function(t){var n=this.root;return t.reduce(function(r,o){return n=n.getChild(o),r+(n.namespaced?o+"/":"")},"")};ld.prototype.update=function(t){XO([],this.root,t)};ld.prototype.register=function(t,n,r){var o=this;r===void 0&&(r=!0);var i=new Js(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&&zf(n.modules,function(u,d){o.register(t.concat(d),u,r)})};ld.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)};ld.prototype.isRegistered=function(t){var n=this.get(t.slice(0,-1)),r=t[t.length-1];return n?n.hasChild(r):!1};function XO(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return;XO(e.concat(r),t.getChild(r),n.modules[r])}}function ZO(e){return new Ri(e)}var Ri=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 ld(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;By(this,g,[],this._modules.root),NC(this,g),r.forEach(function(v){return v(n)})},xC={state:{configurable:!0}};Ri.prototype.install=function(t,n){t.provide(n||RC,this),t.config.globalProperties.$store=this;var r=this._devtools!==void 0?this._devtools:!1;r&&j9(t,this)};xC.state.get=function(){return this._state.data};xC.state.set=function(e){};Ri.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)}))};Ri.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(_)})})}};Ri.prototype.subscribe=function(t,n){return qO(t,this._subscribers,n)};Ri.prototype.subscribeAction=function(t,n){var r=typeof t=="function"?{before:t}:t;return qO(r,this._actionSubscribers,n)};Ri.prototype.watch=function(t,n,r){var o=this;return $t(function(){return t(o.state,o.getters)},n,Object.assign({},r))};Ri.prototype.replaceState=function(t){var n=this;this._withCommit(function(){n._state.data=t})};Ri.prototype.registerModule=function(t,n,r){r===void 0&&(r={}),typeof t=="string"&&(t=[t]),this._modules.register(t,n),By(this,this.state,t,this._modules.get(t),r.preserveState),NC(this,this.state)};Ri.prototype.unregisterModule=function(t){var n=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var r=PC(n.state,t.slice(0,-1));delete r[t[t.length-1]]}),VO(this)};Ri.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)};Ri.prototype.hotUpdate=function(t){this._modules.update(t),VO(this,!0)};Ri.prototype._withCommit=function(t){var n=this._committing;this._committing=!0,t(),this._committing=n};Object.defineProperties(Ri.prototype,xC);var QO=qy(function(e,t){var n={};return Hy(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=Vy(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}),e5=qy(function(e,t){var n={};return Hy(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=Vy(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}),t5=qy(function(e,t){var n={};return Hy(t).forEach(function(r){var o=r.key,i=r.val;i=e+i,n[o]=function(){if(!(e&&!Vy(this.$store,"mapGetters",e)))return this.$store.getters[i]},n[o].vuex=!0}),n}),n5=qy(function(e,t){var n={};return Hy(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=Vy(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}),Z9=function(e){return{mapState:QO.bind(null,e),mapGetters:t5.bind(null,e),mapMutations:e5.bind(null,e),mapActions:n5.bind(null,e)}};function Hy(e){return Q9(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 Q9(e){return Array.isArray(e)||HO(e)}function qy(e){return function(t,n){return typeof t!="string"?(n=t,t=""):t.charAt(t.length-1)!=="/"&&(t+="/"),e(t,n)}}function Vy(e,t,n){var r=e._modulesNamespaceMap[n];return r}function eB(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=RM(g.state);typeof f>"u"||(u&&g.subscribe(function(_,M){var C=RM(M);if(n(_,v,C)){var D=hk(),w=o(_),S="mutation "+_.type+D;fk(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)),pk(f)}v=C}),d&&g.subscribeAction(function(_,M){if(i(_,M)){var C=hk(),D=s(_),w="action "+_.type+C;fk(f,w,t),f.log("%c action","color: #03A9F4; font-weight: bold",D),pk(f)}}))}}function fk(e,t,n){var r=n?e.groupCollapsed:e.group;try{r.call(e,t)}catch{e.log(t)}}function pk(e){try{e.groupEnd()}catch{e.log("—— log end ——")}}function hk(){var e=new Date;return" @ "+_m(e.getHours(),2)+":"+_m(e.getMinutes(),2)+":"+_m(e.getSeconds(),2)+"."+_m(e.getMilliseconds(),3)}function tB(e,t){return new Array(t+1).join(e)}function _m(e,t){return tB("0",t-e.toString().length)+e}var A1={version:"4.0.2",Store:Ri,storeKey:RC,createStore:ZO,useStore:Ei,mapState:QO,mapMutations:e5,mapGetters:t5,mapActions:n5,createNamespacedHelpers:Z9,createLogger:eB},r5={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);_<M;_++)C[_]=v[_].fn;return C},u.prototype.listenerCount=function(f){var g=n?n+f:f,v=this._events[g];return v?v.fn?1:v.length:0},u.prototype.emit=function(f,g,v,_,M,C){var D=n?n+f:f;if(!this._events[D])return!1;var w=this._events[D],S=arguments.length,R,A;if(w.fn){switch(w.once&&this.removeListener(f,w.fn,void 0,!0),S){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,g),!0;case 3:return w.fn.call(w.context,g,v),!0;case 4:return w.fn.call(w.context,g,v,_),!0;case 5:return w.fn.call(w.context,g,v,_,M),!0;case 6:return w.fn.call(w.context,g,v,_,M,C),!0}for(A=1,R=new Array(S-1);A<S;A++)R[A-1]=arguments[A];w.fn.apply(w.context,R)}else{var N=w.length,H;for(A=0;A<N;A++)switch(w[A].once&&this.removeListener(f,w[A].fn,void 0,!0),S){case 1:w[A].fn.call(w[A].context);break;case 2:w[A].fn.call(w[A].context,g);break;case 3:w[A].fn.call(w[A].context,g,v);break;case 4:w[A].fn.call(w[A].context,g,v,_);break;default:if(!R)for(H=1,R=new Array(S-1);H<S;H++)R[H-1]=arguments[H];w[A].fn.apply(w[A].context,R)}}return!0},u.prototype.on=function(f,g,v){return i(this,f,g,v,!1)},u.prototype.once=function(f,g,v){return i(this,f,g,v,!0)},u.prototype.removeListener=function(f,g,v,_){var M=n?n+f:f;if(!this._events[M])return this;if(!g)return s(this,M),this;var C=this._events[M];if(C.fn)C.fn===g&&(!_||C.once)&&(!v||C.context===v)&&s(this,M);else{for(var D=0,w=[],S=C.length;D<S;D++)(C[D].fn!==g||_&&!C[D].once||v&&C[D].context!==v)&&w.push(C[D]);w.length?this._events[M]=w.length===1?w[0]:w:s(this,M)}return this},u.prototype.removeAllListeners=function(f){var g;return f?(g=n?n+f:f,this._events[g]&&s(this,g)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(r5);var nB=r5.exports;const rB=Vf(nB),lu=new rB;var gk;const UC=typeof window<"u",oB=e=>typeof e=="string",L1=()=>{};UC&&((gk=window==null?void 0:window.navigator)!=null&&gk.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function iB(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=Le(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 FC(e){return eC()?(lL(e),!0):!1}function zy(e,t=200,n=!0,r=!0){return iB(sB(t,n,r),e)}function aB(e,t=!0){Yi()?On(e):t?e():Ir(e)}function lB(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)},Le(t))}return r&&(o.value=!0,UC&&d()),FC(u),{isPending:o,start:d,stop:u}}function rl(e){var t;const n=Le(e);return(t=n==null?void 0:n.$el)!=null?t:n}const GC=UC?window:void 0;function ol(...e){let t,n,r,o;if(oB(e[0])?([n,r,o]=e,t=GC):[t,n,r,o]=e,!t)return L1;let i=L1;const s=$t(()=>rl(t),d=>{i(),d&&(d.addEventListener(n,r,o),i=()=>{d.removeEventListener(n,r,o),i=L1})},{immediate:!0,flush:"post"}),u=()=>{s(),i()};return FC(u),u}function Xs(e,t,n={}){const{window:r=GC,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=rl(e),C=_.composedPath();!M||M===_.target||C.includes(M)||!u.value||o&&o.length>0&&o.some(D=>{const w=rl(D);return w&&(_.target===w||C.includes(w))})||t(_)},g=[ol(r,"click",f,{passive:!0,capture:i}),ol(r,"pointerdown",_=>{const M=rl(e);u.value=!!M&&!_.composedPath().includes(M)},{passive:!0}),ol(r,"pointerup",_=>{if(_.button===0){const M=_.composedPath();_.composedPath=()=>M,d=r.setTimeout(()=>f(_),50)}},{passive:!0}),s&&ol(r,"blur",_=>{var M;const C=rl(e);((M=document.activeElement)==null?void 0:M.tagName)==="IFRAME"&&!(C!=null&&C.contains(document.activeElement))&&t(_)})].filter(Boolean);return()=>g.forEach(_=>_())}const uB=500;function cB(e,t,n){var r,o;const i=Ve(()=>rl(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:uB))}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};ol(i,"pointerdown",d,f),ol(i,"pointerup",u,f),ol(i,"pointerleave",u,f)}const mk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vk="__vueuse_ssr_handlers__";mk[vk]=mk[vk]||{};var yk=Object.getOwnPropertySymbols,dB=Object.prototype.hasOwnProperty,fB=Object.prototype.propertyIsEnumerable,pB=(e,t)=>{var n={};for(var r in e)dB.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yk)for(var r of yk(e))t.indexOf(r)<0&&fB.call(e,r)&&(n[r]=e[r]);return n};function hB(e,t,n={}){const r=n,{window:o=GC}=r,i=pB(r,["window"]);let s;const u=o&&"ResizeObserver"in o,d=()=>{s&&(s.disconnect(),s=void 0)},f=$t(()=>rl(e),v=>{d(),u&&o&&v&&(s=new ResizeObserver(t),s.observe(v,i))},{immediate:!0,flush:"post"}),g=()=>{d(),f()};return FC(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=rl(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 hB(e,C),$t(()=>rl(e),D=>!D&&C()),o&&ol("scroll",C,{passive:!0}),r&&ol("resize",C,{passive:!0}),aB(()=>{i&&C()}),{height:s,bottom:u,left:d,right:f,top:g,width:v,x:_,y:M,update:C}}var _k;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(_k||(_k={}));const gB=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}=lB(()=>{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 mB={key:0},vB={key:1};function yB(e,t,n,r,o,i){return Z(),bt(bo,{name:"fade",onBeforeLeave:e.onClose,onAfterLeave:t[0]||(t[0]=s=>e.$emit("destroy"))},{default:Ot(()=>[$n($("div",{class:it(["message",[e.handleStyle(e.type),e.isH5&&"message-h5"]]),style:Ro(e.customStyle)},[e.isH5?Ce("",!0):(Z(),se("p",mB,De(e.message),1)),e.isH5?(Z(),se("span",vB,De(e.message),1)):Ce("",!0)],6),[[eo,e.visible]])]),_:1},8,["onBeforeLeave"])}const _B=Wt(gB,[["render",yB],["__scopeId","data-v-696e3ea3"]]),Ja=[];let bk=1;const bB=document.body,pi=function(e){const t=Ja.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;Ja.forEach(({vm:d})=>{var f;n+=(((f=d.el)==null?void 0:f.offsetHeight)||0)+20}),n+=20;const r=`message_${bk+=1}`,o=e.onClose,i={zIndex:20+bk,offset:n,id:r,...e,onClose:()=>{MB(r,o)}},s=Ct(_B,i),u=document.createElement("div");return s.props.onDestroy=()=>{xS(null,u)},xS(s,u),Ja.push({vm:s}),bB.appendChild(u.firstElementChild),{close:()=>s.component.proxy.visible=!1}};function MB(e,t){const n=Ja.findIndex(({vm:s})=>e===s.component.props.id);if(n===-1)return;const{vm:r}=Ja[n];if(!r)return;t==null||t(r);const o=r.el.offsetHeight;Ja.splice(n,1);const i=Ja.length;if(!(i<1))for(let s=n;s<i;s++){const u=Number.parseInt(Ja[s].vm.el.style.top,10)-o-16;Ja[s].vm.component.props.offset=u}}var IB=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},Mk=typeof Symbol<"u"&&Symbol,CB=IB,TB=function(){return typeof Mk!="function"||typeof Symbol!="function"||typeof Mk("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:CB()},Ik={foo:{}},wB=Object,SB=function(){return{__proto__:Ik}.foo===Ik.foo&&!({__proto__:null}instanceof wB)},kB="Function.prototype.bind called on incompatible ",O1=Array.prototype.slice,DB=Object.prototype.toString,EB="[object Function]",AB=function(t){var n=this;if(typeof n!="function"||DB.call(n)!==EB)throw new TypeError(kB+n);for(var r=O1.call(arguments,1),o,i=function(){if(this instanceof o){var g=n.apply(this,r.concat(O1.call(arguments)));return Object(g)===g?g:this}else return n.apply(t,r.concat(O1.call(arguments)))},s=Math.max(0,n.length-r.length),u=[],d=0;d<s;d++)u.push("$"+d);if(o=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(i),n.prototype){var f=function(){};f.prototype=n.prototype,o.prototype=new f,f.prototype=null}return o},LB=AB,$C=Function.prototype.bind||LB,OB=$C,RB=OB.call(Function.call,Object.prototype.hasOwnProperty),Sn,Sf=SyntaxError,o5=Function,df=TypeError,R1=function(e){try{return o5('"use strict"; return ('+e+").constructor;")()}catch{}},Fc=Object.getOwnPropertyDescriptor;if(Fc)try{Fc({},"")}catch{Fc=null}var N1=function(){throw new df},NB=Fc?function(){try{return arguments.callee,N1}catch{try{return Fc(arguments,"callee").get}catch{return N1}}}():N1,Ud=TB(),PB=SB(),ko=Object.getPrototypeOf||(PB?function(e){return e.__proto__}:null),zd={},xB=typeof Uint8Array>"u"||!ko?Sn:ko(Uint8Array),Gc={"%AggregateError%":typeof AggregateError>"u"?Sn:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Sn:ArrayBuffer,"%ArrayIteratorPrototype%":Ud&&ko?ko([][Symbol.iterator]()):Sn,"%AsyncFromSyncIteratorPrototype%":Sn,"%AsyncFunction%":zd,"%AsyncGenerator%":zd,"%AsyncGeneratorFunction%":zd,"%AsyncIteratorPrototype%":zd,"%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%":o5,"%GeneratorFunction%":zd,"%Int8Array%":typeof Int8Array>"u"?Sn:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Sn:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Sn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ud&&ko?ko(ko([][Symbol.iterator]())):Sn,"%JSON%":typeof JSON=="object"?JSON:Sn,"%Map%":typeof Map>"u"?Sn:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ud||!ko?Sn:ko(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"||!Ud||!ko?Sn:ko(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Sn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ud&&ko?ko(""[Symbol.iterator]()):Sn,"%Symbol%":Ud?Symbol:Sn,"%SyntaxError%":Sf,"%ThrowTypeError%":NB,"%TypedArray%":xB,"%TypeError%":df,"%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(ko)try{null.error}catch(e){var UB=ko(ko(e));Gc["%Error.prototype%"]=UB}var FB=function e(t){var n;if(t==="%AsyncFunction%")n=R1("async function () {}");else if(t==="%GeneratorFunction%")n=R1("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=R1("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&ko&&(n=ko(o.prototype))}return Gc[t]=n,n},Ck={"%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"]},gg=$C,Av=RB,GB=gg.call(Function.call,Array.prototype.concat),$B=gg.call(Function.apply,Array.prototype.splice),Tk=gg.call(Function.call,String.prototype.replace),Lv=gg.call(Function.call,String.prototype.slice),BB=gg.call(Function.call,RegExp.prototype.exec),HB=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,qB=/\\(\\)?/g,VB=function(t){var n=Lv(t,0,1),r=Lv(t,-1);if(n==="%"&&r!=="%")throw new Sf("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Sf("invalid intrinsic syntax, expected opening `%`");var o=[];return Tk(t,HB,function(i,s,u,d){o[o.length]=u?Tk(d,qB,"$1"):s||i}),o},zB=function(t,n){var r=t,o;if(Av(Ck,r)&&(o=Ck[r],r="%"+o[0]+"%"),Av(Gc,r)){var i=Gc[r];if(i===zd&&(i=FB(r)),typeof i>"u"&&!n)throw new df("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:r,value:i}}throw new Sf("intrinsic "+t+" does not exist!")},BC=function(t,n){if(typeof t!="string"||t.length===0)throw new df("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new df('"allowMissing" argument must be a boolean');if(BB(/^%?[^%]*%?$/,t)===null)throw new Sf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=VB(t),o=r.length>0?r[0]:"",i=zB("%"+o+"%",n),s=i.name,u=i.value,d=!1,f=i.alias;f&&(o=f[0],$B(r,GB([0,1],f)));for(var g=1,v=!0;g<r.length;g+=1){var _=r[g],M=Lv(_,0,1),C=Lv(_,-1);if((M==='"'||M==="'"||M==="`"||C==='"'||C==="'"||C==="`")&&M!==C)throw new Sf("property names with quotes must have matching quotes");if((_==="constructor"||!v)&&(d=!0),o+="."+_,s="%"+o+"%",Av(Gc,s))u=Gc[s];else if(u!=null){if(!(_ in u)){if(!n)throw new df("base intrinsic for "+t+" exists, but the property is not available.");return}if(Fc&&g+1>=r.length){var D=Fc(u,_);v=!!D,v&&"get"in D&&!("originalValue"in D.get)?u=D.get:u=u[_]}else v=Av(u,_),u=u[_];v&&!d&&(Gc[s]=u)}}return u},i5={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})(i5);var jB=i5.exports,s5=BC,a5=jB,WB=a5(s5("String.prototype.indexOf")),KB=function(t,n){var r=s5(t,!!n);return typeof r=="function"&&WB(t,".prototype.")>-1?a5(r):r};const YB={},JB=Object.freeze(Object.defineProperty({__proto__:null,default:YB},Symbol.toStringTag,{value:"Module"})),XB=I$(JB);var HC=typeof Map=="function"&&Map.prototype,P1=Object.getOwnPropertyDescriptor&&HC?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ov=HC&&P1&&typeof P1.get=="function"?P1.get:null,wk=HC&&Map.prototype.forEach,qC=typeof Set=="function"&&Set.prototype,x1=Object.getOwnPropertyDescriptor&&qC?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Rv=qC&&x1&&typeof x1.get=="function"?x1.get:null,Sk=qC&&Set.prototype.forEach,ZB=typeof WeakMap=="function"&&WeakMap.prototype,ch=ZB?WeakMap.prototype.has:null,QB=typeof WeakSet=="function"&&WeakSet.prototype,dh=QB?WeakSet.prototype.has:null,eH=typeof WeakRef=="function"&&WeakRef.prototype,kk=eH?WeakRef.prototype.deref:null,tH=Boolean.prototype.valueOf,nH=Object.prototype.toString,rH=Function.prototype.toString,oH=String.prototype.match,VC=String.prototype.slice,jl=String.prototype.replace,iH=String.prototype.toUpperCase,Dk=String.prototype.toLowerCase,l5=RegExp.prototype.test,Ek=Array.prototype.concat,fa=Array.prototype.join,sH=Array.prototype.slice,Ak=Math.floor,PM=typeof BigInt=="function"?BigInt.prototype.valueOf:null,U1=Object.getOwnPropertySymbols,xM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,kf=typeof Symbol=="function"&&typeof Symbol.iterator=="object",mi=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===kf||"symbol")?Symbol.toStringTag:null,u5=Object.prototype.propertyIsEnumerable,Lk=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Ok(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||l5.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Ak(-e):Ak(e);if(r!==e){var o=String(r),i=VC.call(t,o.length+1);return jl.call(o,n,"$&_")+"."+jl.call(jl.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return jl.call(t,n,"$&_")}var UM=XB,Rk=UM.custom,Nk=d5(Rk)?Rk:null,aH=function e(t,n,r,o){var i=n||{};if(Bl(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Bl(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=Bl(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(Bl(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(Bl(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 p5(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var d=String(t);return u?Ok(t,d):d}if(typeof t=="bigint"){var f=String(t)+"n";return u?Ok(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 FM(t)?"[Array]":"[Object]";var v=wH(i,r);if(typeof o>"u")o=[];else if(f5(o,t)>=0)return"[Circular]";function _(P,Q,Y){if(Q&&(o=sH.call(o),o.push(Q)),Y){var oe={depth:i.depth};return Bl(i,"quoteStyle")&&(oe.quoteStyle=i.quoteStyle),e(P,oe,r+1,o)}return e(P,i,r+1,o)}if(typeof t=="function"&&!Pk(t)){var M=mH(t),C=bm(t,_);return"[Function"+(M?": "+M:" (anonymous)")+"]"+(C.length>0?" { "+fa.call(C,", ")+" }":"")}if(d5(t)){var D=kf?jl.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):xM.call(t);return typeof t=="object"&&!kf?Up(D):D}if(IH(t)){for(var w="<"+Dk.call(String(t.nodeName)),S=t.attributes||[],R=0;R<S.length;R++)w+=" "+S[R].name+"="+c5(lH(S[R].value),"double",i);return w+=">",t.childNodes&&t.childNodes.length&&(w+="..."),w+="</"+Dk.call(String(t.nodeName))+">",w}if(FM(t)){if(t.length===0)return"[]";var A=bm(t,_);return v&&!TH(A)?"["+GM(A,v)+"]":"[ "+fa.call(A,", ")+" ]"}if(cH(t)){var N=bm(t,_);return!("cause"in Error.prototype)&&"cause"in t&&!u5.call(t,"cause")?"{ ["+String(t)+"] "+fa.call(Ek.call("[cause]: "+_(t.cause),N),", ")+" }":N.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+fa.call(N,", ")+" }"}if(typeof t=="object"&&s){if(Nk&&typeof t[Nk]=="function"&&UM)return UM(t,{depth:g-r});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(vH(t)){var H=[];return wk&&wk.call(t,function(P,Q){H.push(_(Q,t,!0)+" => "+_(P,t))}),xk("Map",Ov.call(t),H,v)}if(bH(t)){var z=[];return Sk&&Sk.call(t,function(P){z.push(_(P,t))}),xk("Set",Rv.call(t),z,v)}if(yH(t))return F1("WeakMap");if(MH(t))return F1("WeakSet");if(_H(t))return F1("WeakRef");if(fH(t))return Up(_(Number(t)));if(hH(t))return Up(_(PM.call(t)));if(pH(t))return Up(tH.call(t));if(dH(t))return Up(_(String(t)));if(!uH(t)&&!Pk(t)){var x=bm(t,_),B=Lk?Lk(t)===Object.prototype:t instanceof Object||t.constructor===Object,j=t instanceof Object?"":"null prototype",G=!B&&mi&&Object(t)===t&&mi in t?VC.call(ku(t),8,-1):j?"Object":"",L=B||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",T=L+(G||j?"["+fa.call(Ek.call([],G||[],j||[]),": ")+"] ":"");return x.length===0?T+"{}":v?T+"{"+GM(x,v)+"}":T+"{ "+fa.call(x,", ")+" }"}return String(t)};function c5(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function lH(e){return jl.call(String(e),/"/g,""")}function FM(e){return ku(e)==="[object Array]"&&(!mi||!(typeof e=="object"&&mi in e))}function uH(e){return ku(e)==="[object Date]"&&(!mi||!(typeof e=="object"&&mi in e))}function Pk(e){return ku(e)==="[object RegExp]"&&(!mi||!(typeof e=="object"&&mi in e))}function cH(e){return ku(e)==="[object Error]"&&(!mi||!(typeof e=="object"&&mi in e))}function dH(e){return ku(e)==="[object String]"&&(!mi||!(typeof e=="object"&&mi in e))}function fH(e){return ku(e)==="[object Number]"&&(!mi||!(typeof e=="object"&&mi in e))}function pH(e){return ku(e)==="[object Boolean]"&&(!mi||!(typeof e=="object"&&mi in e))}function d5(e){if(kf)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!xM)return!1;try{return xM.call(e),!0}catch{}return!1}function hH(e){if(!e||typeof e!="object"||!PM)return!1;try{return PM.call(e),!0}catch{}return!1}var gH=Object.prototype.hasOwnProperty||function(e){return e in this};function Bl(e,t){return gH.call(e,t)}function ku(e){return nH.call(e)}function mH(e){if(e.name)return e.name;var t=oH.call(rH.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function f5(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function vH(e){if(!Ov||!e||typeof e!="object")return!1;try{Ov.call(e);try{Rv.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function yH(e){if(!ch||!e||typeof e!="object")return!1;try{ch.call(e,ch);try{dh.call(e,dh)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function _H(e){if(!kk||!e||typeof e!="object")return!1;try{return kk.call(e),!0}catch{}return!1}function bH(e){if(!Rv||!e||typeof e!="object")return!1;try{Rv.call(e);try{Ov.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function MH(e){if(!dh||!e||typeof e!="object")return!1;try{dh.call(e,dh);try{ch.call(e,ch)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function IH(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function p5(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return p5(VC.call(e,0,t.maxStringLength),t)+r}var o=jl.call(jl.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,CH);return c5(o,"single",t)}function CH(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":"")+iH.call(t.toString(16))}function Up(e){return"Object("+e+")"}function F1(e){return e+" { ? }"}function xk(e,t,n,r){var o=r?GM(n,r):fa.call(n,", ");return e+" ("+t+") {"+o+"}"}function TH(e){for(var t=0;t<e.length;t++)if(f5(e[t],`
- `)>=0)return!1;return!0}function wH(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=fa.call(Array(e.indent+1)," ");else return null;return{base:n,prev:fa.call(Array(t+1),n)}}function GM(e,t){if(e.length===0)return"";var n=`
- `+t.prev+t.base;return n+fa.call(e,","+n)+`
- `+t.prev}function bm(e,t){var n=FM(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=Bl(e,o)?t(e[o],e):""}var i=typeof U1=="function"?U1(e):[],s;if(kf){s={};for(var u=0;u<i.length;u++)s["$"+i[u]]=i[u]}for(var d in e)Bl(e,d)&&(n&&String(Number(d))===d&&d<e.length||kf&&s["$"+d]instanceof Symbol||(l5.call(/[^\w$]/,d)?r.push(t(d,e)+": "+t(e[d],e)):r.push(d+": "+t(e[d],e))));if(typeof U1=="function")for(var f=0;f<i.length;f++)u5.call(e,i[f])&&r.push("["+t(i[f])+"]: "+t(e[i[f]],e));return r}var zC=BC,jf=KB,SH=aH,kH=zC("%TypeError%"),Mm=zC("%WeakMap%",!0),Im=zC("%Map%",!0),DH=jf("WeakMap.prototype.get",!0),EH=jf("WeakMap.prototype.set",!0),AH=jf("WeakMap.prototype.has",!0),LH=jf("Map.prototype.get",!0),OH=jf("Map.prototype.set",!0),RH=jf("Map.prototype.has",!0),jC=function(e,t){for(var n=e,r;(r=n.next)!==null;n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},NH=function(e,t){var n=jC(e,t);return n&&n.value},PH=function(e,t,n){var r=jC(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},xH=function(e,t){return!!jC(e,t)},UH=function(){var t,n,r,o={assert:function(i){if(!o.has(i))throw new kH("Side channel does not contain "+SH(i))},get:function(i){if(Mm&&i&&(typeof i=="object"||typeof i=="function")){if(t)return DH(t,i)}else if(Im){if(n)return LH(n,i)}else if(r)return NH(r,i)},has:function(i){if(Mm&&i&&(typeof i=="object"||typeof i=="function")){if(t)return AH(t,i)}else if(Im){if(n)return RH(n,i)}else if(r)return xH(r,i);return!1},set:function(i,s){Mm&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new Mm),EH(t,i,s)):Im?(n||(n=new Im),OH(n,i,s)):(r||(r={key:{},next:null}),PH(r,i,s))}};return o},FH=String.prototype.replace,GH=/%20/g,G1={RFC1738:"RFC1738",RFC3986:"RFC3986"},WC={default:G1.RFC3986,formatters:{RFC1738:function(e){return FH.call(e,GH,"+")},RFC3986:function(e){return String(e)}},RFC1738:G1.RFC1738,RFC3986:G1.RFC3986},$H=WC,$1=Object.prototype.hasOwnProperty,ac=Array.isArray,sa=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),BH=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(ac(r)){for(var o=[],i=0;i<r.length;++i)typeof r[i]<"u"&&o.push(r[i]);n.obj[n.prop]=o}}},h5=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},o=0;o<t.length;++o)typeof t[o]<"u"&&(r[o]=t[o]);return r},HH=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(ac(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!$1.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var o=t;return ac(t)&&!ac(n)&&(o=h5(t,r)),ac(t)&&ac(n)?(n.forEach(function(i,s){if($1.call(t,s)){var u=t[s];u&&typeof u=="object"&&i&&typeof i=="object"?t[s]=e(u,i,r):t.push(i)}else t[s]=i}),t):Object.keys(n).reduce(function(i,s){var u=n[s];return $1.call(i,s)?i[s]=e(i[s],u,r):i[s]=u,i},o)},qH=function(t,n){return Object.keys(n).reduce(function(r,o){return r[o]=n[o],r},t)},VH=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},zH=function(t,n,r,o,i){if(t.length===0)return t;var s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(g){return"%26%23"+parseInt(g.slice(2),16)+"%3B"});for(var u="",d=0;d<s.length;++d){var f=s.charCodeAt(d);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||i===$H.RFC1738&&(f===40||f===41)){u+=s.charAt(d);continue}if(f<128){u=u+sa[f];continue}if(f<2048){u=u+(sa[192|f>>6]+sa[128|f&63]);continue}if(f<55296||f>=57344){u=u+(sa[224|f>>12]+sa[128|f>>6&63]+sa[128|f&63]);continue}d+=1,f=65536+((f&1023)<<10|s.charCodeAt(d)&1023),u+=sa[240|f>>18]+sa[128|f>>12&63]+sa[128|f>>6&63]+sa[128|f&63]}return u},jH=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],o=0;o<n.length;++o)for(var i=n[o],s=i.obj[i.prop],u=Object.keys(s),d=0;d<u.length;++d){var f=u[d],g=s[f];typeof g=="object"&&g!==null&&r.indexOf(g)===-1&&(n.push({obj:s,prop:f}),r.push(g))}return BH(n),t},WH=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},KH=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},YH=function(t,n){return[].concat(t,n)},JH=function(t,n){if(ac(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(n(t[o]));return r}return n(t)},g5={arrayToObject:h5,assign:qH,combine:YH,compact:jH,decode:VH,encode:zH,isBuffer:KH,isRegExp:WH,maybeMap:JH,merge:HH},m5=UH,tv=g5,fh=WC,XH=Object.prototype.hasOwnProperty,Uk={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},Xa=Array.isArray,ZH=Array.prototype.push,v5=function(e,t){ZH.apply(e,Xa(t)?t:[t])},QH=Date.prototype.toISOString,Fk=fh.default,si={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:tv.encode,encodeValuesOnly:!1,format:Fk,formatter:fh.formatters[Fk],indices:!1,serializeDate:function(t){return QH.call(t)},skipNulls:!1,strictNullHandling:!1},eq=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},B1={},tq=function e(t,n,r,o,i,s,u,d,f,g,v,_,M,C,D,w){for(var S=t,R=w,A=0,N=!1;(R=R.get(B1))!==void 0&&!N;){var H=R.get(t);if(A+=1,typeof H<"u"){if(H===A)throw new RangeError("Cyclic object value");N=!0}typeof R.get(B1)>"u"&&(A=0)}if(typeof d=="function"?S=d(n,S):S instanceof Date?S=v(S):r==="comma"&&Xa(S)&&(S=tv.maybeMap(S,function(oe){return oe instanceof Date?v(oe):oe})),S===null){if(i)return u&&!C?u(n,si.encoder,D,"key",_):n;S=""}if(eq(S)||tv.isBuffer(S)){if(u){var z=C?n:u(n,si.encoder,D,"key",_);return[M(z)+"="+M(u(S,si.encoder,D,"value",_))]}return[M(n)+"="+M(String(S))]}var x=[];if(typeof S>"u")return x;var B;if(r==="comma"&&Xa(S))C&&u&&(S=tv.maybeMap(S,u)),B=[{value:S.length>0?S.join(",")||null:void 0}];else if(Xa(d))B=d;else{var j=Object.keys(S);B=f?j.sort(f):j}for(var G=o&&Xa(S)&&S.length===1?n+"[]":n,L=0;L<B.length;++L){var T=B[L],P=typeof T=="object"&&typeof T.value<"u"?T.value:S[T];if(!(s&&P===null)){var Q=Xa(S)?typeof r=="function"?r(G,T):G:G+(g?"."+T:"["+T+"]");w.set(t,A);var Y=m5();Y.set(B1,w),v5(x,e(P,Q,r,o,i,s,r==="comma"&&C&&Xa(S)?null:u,d,f,g,v,_,M,C,D,Y))}}return x},nq=function(t){if(!t)return si;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||si.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=fh.default;if(typeof t.format<"u"){if(!XH.call(fh.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=fh.formatters[r],i=si.filter;return(typeof t.filter=="function"||Xa(t.filter))&&(i=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:si.addQueryPrefix,allowDots:typeof t.allowDots>"u"?si.allowDots:!!t.allowDots,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:si.charsetSentinel,delimiter:typeof t.delimiter>"u"?si.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:si.encode,encoder:typeof t.encoder=="function"?t.encoder:si.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:si.encodeValuesOnly,filter:i,format:r,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:si.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:si.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:si.strictNullHandling}},rq=function(e,t){var n=e,r=nq(t),o,i;typeof r.filter=="function"?(i=r.filter,n=i("",n)):Xa(r.filter)&&(i=r.filter,o=i);var s=[];if(typeof n!="object"||n===null)return"";var u;t&&t.arrayFormat in Uk?u=t.arrayFormat:t&&"indices"in t?u=t.indices?"indices":"repeat":u="indices";var d=Uk[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=m5(),v=0;v<o.length;++v){var _=o[v];r.skipNulls&&n[_]===null||v5(s,tq(n[_],_,d,f,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,g))}var M=s.join(r.delimiter),C=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),M.length>0?C+M:""},Df=g5,$M=Object.prototype.hasOwnProperty,oq=Array.isArray,So={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Df.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},iq=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},y5=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},sq="utf8=%26%2310003%3B",aq="utf8=%E2%9C%93",lq=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<s.length;++d)s[d].indexOf("utf8=")===0&&(s[d]===aq?f="utf-8":s[d]===sq&&(f="iso-8859-1"),u=d,d=s.length);for(d=0;d<s.length;++d)if(d!==u){var g=s[d],v=g.indexOf("]="),_=v===-1?g.indexOf("="):v+1,M,C;_===-1?(M=n.decoder(g,So.decoder,f,"key"),C=n.strictNullHandling?null:""):(M=n.decoder(g.slice(0,_),So.decoder,f,"key"),C=Df.maybeMap(y5(g.slice(_+1),n),function(D){return n.decoder(D,So.decoder,f,"value")})),C&&n.interpretNumericEntities&&f==="iso-8859-1"&&(C=iq(C)),g.indexOf("[]=")>-1&&(C=oq(C)?[C]:C),$M.call(r,M)?r[M]=Df.combine(r[M],C):r[M]=C}return r},uq=function(e,t,n,r){for(var o=r?t:y5(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},cq=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&&$M.call(Object.prototype,f)&&!r.allowPrototypes)return;g.push(f)}for(var v=0;r.depth>0&&(d=u.exec(i))!==null&&v<r.depth;){if(v+=1,!r.plainObjects&&$M.call(Object.prototype,d[1].slice(1,-1))&&!r.allowPrototypes)return;g.push(d[1])}return d&&g.push("["+i.slice(d.index)+"]"),uq(g,n,r,o)}},dq=function(t){if(!t)return So;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");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 n=typeof t.charset>"u"?So.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?So.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:So.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:So.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:So.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:So.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:So.comma,decoder:typeof t.decoder=="function"?t.decoder:So.decoder,delimiter:typeof t.delimiter=="string"||Df.isRegExp(t.delimiter)?t.delimiter:So.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:So.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:So.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:So.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:So.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:So.strictNullHandling}},fq=function(e,t){var n=dq(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?lq(e,n):e,o=n.plainObjects?Object.create(null):{},i=Object.keys(r),s=0;s<i.length;++s){var u=i[s],d=cq(u,r[u],n,typeof e=="string");o=Df.merge(o,d,n)}return n.allowSparse===!0?o:Df.compact(o)},pq=rq,hq=fq,gq=WC,_5={formats:gq,parse:hq,stringify:pq},zo=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},wi={searchParams:"URLSearchParams"in zo,iterable:"Symbol"in zo&&"iterator"in Symbol,blob:"FileReader"in zo&&"Blob"in zo&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in zo,arrayBuffer:"ArrayBuffer"in zo};function mq(e){return e&&DataView.prototype.isPrototypeOf(e)}if(wi.arrayBuffer)var vq=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],yq=ArrayBuffer.isView||function(e){return e&&vq.indexOf(Object.prototype.toString.call(e))>-1};function Wf(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 wi.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=Wf(e),t=KC(t);var n=this.map[e];this.map[e]=n?n+", "+t:t};Io.prototype.delete=function(e){delete this.map[Wf(e)]};Io.prototype.get=function(e){return e=Wf(e),this.has(e)?this.map[e]:null};Io.prototype.has=function(e){return this.map.hasOwnProperty(Wf(e))};Io.prototype.set=function(e,t){this.map[Wf(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)};wi.iterable&&(Io.prototype[Symbol.iterator]=Io.prototype.entries);function H1(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function b5(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function _q(e){var t=new FileReader,n=b5(t);return t.readAsArrayBuffer(e),n}function bq(e){var t=new FileReader,n=b5(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=r?r[1]:"utf-8";return t.readAsText(e,o),n}function Mq(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function Gk(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function M5(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:wi.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:wi.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:wi.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():wi.arrayBuffer&&wi.blob&&mq(e)?(this._bodyArrayBuffer=Gk(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):wi.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||yq(e))?this._bodyArrayBuffer=Gk(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):wi.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},wi.blob&&(this.blob=function(){var e=H1(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=H1(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(wi.blob)return this.blob().then(_q);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=H1(this);if(e)return e;if(this._bodyBlob)return bq(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Mq(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},wi.formData&&(this.formData=function(){return this.text().then(Tq)}),this.json=function(){return this.text().then(JSON.parse)},this}var Iq=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Cq(e){var t=e.toUpperCase();return Iq.indexOf(t)>-1?t:e}function Qc(e,t){if(!(this instanceof Qc))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 Qc){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=Cq(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in zo){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()}}}Qc.prototype.clone=function(){return new Qc(this,{body:this._bodyInit})};function Tq(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 wq(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}M5.call(Qc.prototype);function Sa(e,t){if(!(this instanceof Sa))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)}M5.call(Sa.prototype);Sa.prototype.clone=function(){return new Sa(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Io(this.headers),url:this.url})};Sa.error=function(){var e=new Sa(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var Sq=[301,302,303,307,308];Sa.redirect=function(e,t){if(Sq.indexOf(t)===-1)throw new RangeError("Invalid status code");return new Sa(null,{status:t,headers:{location:e}})};var lc=zo.DOMException;try{new lc}catch{lc=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},lc.prototype=Object.create(Error.prototype),lc.prototype.constructor=lc}function I5(e,t){return new Promise(function(n,r){var o=new Qc(e,t);if(o.signal&&o.signal.aborted)return r(new lc("Aborted","AbortError"));var i=new XMLHttpRequest;function s(){i.abort()}i.onload=function(){var f={status:i.status,statusText:i.statusText,headers:wq(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 Sa(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 lc("Aborted","AbortError"))},0)};function u(f){try{return f===""&&zo.location.href?zo.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&&(wi.blob?i.responseType="blob":wi.arrayBuffer&&(i.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof Io||zo.Headers&&t.headers instanceof zo.Headers)){var d=[];Object.getOwnPropertyNames(t.headers).forEach(function(f){d.push(Wf(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)})}I5.polyfill=!0;zo.fetch||(zo.fetch=I5,zo.Headers=Io,zo.Request=Qc,zo.Response=Sa);self.fetch.bind(self);function $k(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 Vi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$k(Object(n),!0).forEach(function(r){kq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$k(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?uu=function(t){return typeof t}:uu=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uu(e)}function mg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function JC(e,t,n){return t&&Bk(e.prototype,t),n&&Bk(e,n),e}function kq(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C5(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}}),t&&Yh(e,t)}function Kh(e){return Kh=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Kh(e)}function Yh(e,t){return Yh=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},Yh(e,t)}function T5(){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 nv(e,t,n){return T5()?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 Dq(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||!Dq(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 Eq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Aq(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 Eq(e)}function w5(e){var t=T5();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 Aq(this,o)}}function ha(e){return Lq(e)||Oq(e)||Rq(e)||Nq()}function Lq(e){if(Array.isArray(e))return BM(e)}function Oq(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rq(e,t){if(e){if(typeof e=="string")return BM(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 BM(e,t)}}function BM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nq(){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 Pq(e){if(!Array.isArray(e))throw new TypeError("Middlewares must be an array!");for(var t=e.length,n=0;n<t;n++)if(typeof e[n]!="function")throw new TypeError("Middleware must be componsed of function");return function(o,i){var s=-1;function u(d){if(d<=s)return Promise.reject(new Error("next() should not be called multiple times in one middleware!"));s=d;var f=e[d]||i;if(!f)return Promise.resolve();try{return Promise.resolve(f(o,function(){return u(d+1)}))}catch(g){return Promise.reject(g)}}return u(0)}}var Ks=function(){function e(t){if(mg(this,e),!Array.isArray(t))throw new TypeError("Default middlewares must be an array!");this.defaultMiddlewares=ha(t),this.middlewares=[]}return JC(e,[{key:"use",value:function(n){var r=arguments.length>1&&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):uu(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=Pq([].concat(ha(this.middlewares),ha(this.defaultMiddlewares),ha(e.globalMiddlewares),ha(e.coreMiddlewares)));return r(n)}}]),e}();Ks.globalMiddlewares=[];Ks.defaultGlobalMiddlewaresLength=0;Ks.coreMiddlewares=[];Ks.defaultCoreMiddlewaresLength=0;var xq=function(){function e(t){mg(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=ha(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}(),S5=function(e){C5(n,e);var t=w5(n);function n(r,o){var i,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"RequestError";return mg(this,n),i=t.call(this,r),i.name="RequestError",i.request=o,i.type=s,i}return n}(Nv(Error)),Yp=function(e){C5(n,e);var t=w5(n);function n(r,o,i,s){var u,d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"ResponseError";return mg(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 Uq(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 Hk(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 Yp(n,"JSON.parse fail",e,r,"ParseError")}return e}function Fq(e,t,n){return new Promise(function(r,o){setTimeout(function(){o(new S5(t||"timeout of ".concat(e,"ms exceeded"),n,"Timeout"))},e)})}function qk(e){return new Promise(function(t,n){e.cancelToken&&e.cancelToken.promise.then(function(r){n(r)})})}var Gq=Object.prototype.toString;function k5(){var e;return typeof process<"u"&&Gq.call(process)==="[object process]"&&(e="NODE"),typeof XMLHttpRequest<"u"&&(e="BROWSER"),e}function HM(e){return uu(e)==="object"&&Object.prototype.toString.call(e)==="[object Array]"}function D5(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function $q(e){return uu(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Vk(e){return e!==null&&uu(e)==="object"}function zk(e,t){if(e)if(uu(e)!=="object"&&(e=[e]),HM(e))for(var n=0;n<e.length;n++)t.call(null,e[n],n,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}function jk(e){return D5(e)?_5.parse(e.toString(),{strictNullHandling:!0}):typeof e=="string"?[e]:e}function qM(e){return _5.stringify(e,{arrayFormat:"repeat",strictNullHandling:!0})}function E5(e,t){return Vi(Vi(Vi({},e),t),{},{headers:Vi(Vi({},e.headers),t.headers),params:Vi(Vi({},jk(e.params)),jk(t.params)),method:(t.method||e.method||"get").toLowerCase()})}var Bq=function(t){var n=arguments.length>1&&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 Hq(e,t){var n=t.method,r=n===void 0?"get":n;return r.toLowerCase()==="get"}function Vq(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,R=o.params,A=o.ttl,N=o.validateCache,H=N===void 0?Hq:N;if(M!=="normal")return process&&process.env,t();var z=fetch;if(!z)throw new Error("Global fetch not exist!");var x=k5()==="BROWSER",B=H(s,o)&&D&&x;if(B){var j=u.get({url:s,params:R,method:S});if(j)return j=j.clone(),j.useCache=!0,e.res=j,t()}var G;return g>0?G=Promise.race([qk(o),z(s,o),Fq(g,v,e.req)]):G=Promise.race([qk(o),z(s,o)]),d.forEach(function(L){G=G.then(function(T){var P=typeof T.clone=="function"?T.clone():T;return L(P,o)})}),G.then(function(L){if(B&&L.status===200){var T=L.clone();T.useCache=!0,u.set({url:s,params:R,method:S},T,A)}return e.res=L,t()})}function zq(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=k5()==="BROWSER"?o.clone():o,n.useCache=o.useCache||!1,_==="gbk")try{return o.blob().then(Uq).then(function(S){return Hk(S,!1,n,s)})}catch(S){throw new Yp(n,S.message,null,s,"ParseError")}else if(g==="json")return o.text().then(function(S){return Hk(S,C,n,s)});try{return o[g]()}catch{throw new Yp(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 Yp(n,"http error",r,i,"HttpError")}}}).catch(function(r){if(r instanceof S5||r instanceof Yp)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 jq(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=Vi({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},o.headers),o.body=JSON.stringify(f)):d==="form"&&(o.headers=Vi({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},o.headers),o.body=qM(f)):(o.headers=Vi({Accept:"application/json"},o.headers),o.body=f)}return e.req.options=o,t()}function Wq(e,t){var n,r;if(e)if(t)n=t(e);else if(D5(e))n=e.toString();else if(HM(e))r=[],zk(e,function(i){i===null||typeof i>"u"?r.push(i):r.push(Vk(i)?JSON.stringify(i):i)}),n=qM(r);else{r={},zk(e,function(i,s){var u=i;i===null||typeof i>"u"?r[s]=i:$q(i)?u=i.toISOString():HM(i)?u=i:Vk(i)&&(u=JSON.stringify(i)),r[s]=u});var o=qM(r);n=o}return n}function Kq(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=Wq(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 A5=[jq,Kq,zq],L5=[Vq];Ks.globalMiddlewares=A5;Ks.defaultGlobalMiddlewaresLength=A5.length;Ks.coreMiddlewares=L5;Ks.defaultCoreMiddlewaresLength=L5.length;var ph=function(){function e(t){mg(this,e),this.onion=new Ks([]),this.fetchIndex=0,this.mapCache=new xq(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=E5(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(ha(e.requestInterceptors),ha(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:Vi(Vi({},r),{},{url:n})},res:null,cache:this.mapCache,responseInterceptors:[].concat(ha(e.responseInterceptors),ha(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}();ph.requestInterceptors=[Bq];ph.responseInterceptors=[];function jy(e){this.message=e}jy.prototype.toString=function(){return this.message?"Cancel: ".concat(this.message):"Cancel"};jy.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 jy(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 Yq(e){return!!(e&&e.__CANCEL__)}var XC=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=new ph(t),r=function(s){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=E5(n.initOptions,u);return n.request(s,d)};r.use=n.use.bind(n),r.fetchIndex=n.fetchIndex,r.interceptors={request:{use:ph.requestUse.bind(n)},response:{use:ph.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,Vi(Vi({},u),{},{method:i}))}}),r.Cancel=jy,r.CancelToken=Pv,r.isCancel=Yq,r.extendOptions=n.extendOptions.bind(n),r.middlewares={instance:n.onion.middlewares,defaultInstance:n.onion.defaultMiddlewares,global:Ks.globalMiddlewares,core:Ks.coreMiddlewares},r},Jq=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 gi=="object"&&gi&&gi.Object===Object&&gi,D=typeof self=="object"&&self&&self.Object===Object&&self,w=C||D||Function("return this")(),S=t&&!t.nodeType&&t,R=S&&!0&&e&&!e.nodeType&&e,A=R&&R.exports===S;function N(Fe,st){return Fe==null?void 0:Fe[st]}function H(Fe){var st=!1;if(Fe!=null&&typeof Fe.toString!="function")try{st=!!(Fe+"")}catch{}return st}function z(Fe,st){return function(wt){return Fe(st(wt))}}var x=Function.prototype,B=Object.prototype,j=w["__core-js_shared__"],G=function(){var Fe=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||"");return Fe?"Symbol(src)_1."+Fe:""}(),L=x.toString,T=B.hasOwnProperty,P=B.toString,Q=RegExp("^"+L.call(T).replace(_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Y=A?w.Buffer:void 0,oe=B.propertyIsEnumerable,X=Y?Y.isBuffer:void 0,ae=z(Object.keys,Object),fe=W(w,"DataView"),le=W(w,"Map"),ce=W(w,"Promise"),J=W(w,"Set"),re=W(w,"WeakMap"),de=!oe.call({valueOf:1},"valueOf"),Oe=ue(fe),ve=ue(le),Me=ue(ce),K=ue(J),me=ue(re);function ke(Fe){return P.call(Fe)}function pe(Fe){if(!Be(Fe)||ie(Fe))return!1;var st=ne(Fe)||H(Fe)?Q:M;return st.test(ue(Fe))}function W(Fe,st){var wt=N(Fe,st);return pe(wt)?wt:void 0}var te=ke;(fe&&te(new fe(new ArrayBuffer(1)))!=v||le&&te(new le)!=s||ce&&te(ce.resolve())!=d||J&&te(new J)!=f||re&&te(new re)!=g)&&(te=function(Fe){var st=P.call(Fe),wt=st==u?Fe.constructor:void 0,mn=wt?ue(wt):void 0;if(mn)switch(mn){case Oe:return v;case ve:return s;case Me:return d;case K:return f;case me:return g}return st});function ie(Fe){return!!G&&G in Fe}function Ie(Fe){var st=Fe&&Fe.constructor,wt=typeof st=="function"&&st.prototype||B;return Fe===wt}function ue(Fe){if(Fe!=null){try{return L.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&&ye(Fe.length)&&!ne(Fe)}function He(Fe){return je(Fe)&&xe(Fe)}var Te=X||lt;function V(Fe){if(xe(Fe)&&(Pe(Fe)||typeof Fe=="string"||typeof Fe.splice=="function"||Te(Fe)||Se(Fe)))return!Fe.length;var st=te(Fe);if(st==s||st==f)return!Fe.size;if(de||Ie(Fe))return!ae(Fe).length;for(var wt in Fe)if(T.call(Fe,wt))return!1;return!0}function ne(Fe){var st=Be(Fe)?P.call(Fe):"";return st==o||st==i}function ye(Fe){return typeof Fe=="number"&&Fe>-1&&Fe%1==0&&Fe<=n}function Be(Fe){var st=typeof Fe;return!!Fe&&(st=="object"||st=="function")}function je(Fe){return!!Fe&&typeof Fe=="object"}function lt(){return!1}e.exports=V})(xv,xv.exports);var Xq=xv.exports,Zq="[object Object]";function Qq(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function eV(e,t){return function(n){return e(t(n))}}var tV=Function.prototype,O5=Object.prototype,R5=tV.toString,nV=O5.hasOwnProperty,rV=R5.call(Object),oV=O5.toString,iV=eV(Object.getPrototypeOf,Object);function sV(e){return!!e&&typeof e=="object"}function aV(e){if(!sV(e)||oV.call(e)!=Zq||Qq(e))return!1;var t=iV(e);if(t===null)return!0;var n=nV.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&R5.call(n)==rV}var lV=aV,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]",R="[object Object]",A="[object Promise]",N="[object RegExp]",H="[object Set]",z="[object String]",x="[object Symbol]",B="[object WeakMap]",j="[object ArrayBuffer]",G="[object DataView]",L="[object Float32Array]",T="[object Float64Array]",P="[object Int8Array]",Q="[object Int16Array]",Y="[object Int32Array]",oe="[object Uint8Array]",X="[object Uint8ClampedArray]",ae="[object Uint16Array]",fe="[object Uint32Array]",le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ce=/^\w*$/,J=/^\./,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,de=/[\\^$.*+?()[\]{}|]/g,Oe=/\\(\\)?/g,ve=/^\[object .+?Constructor\]$/,Me=/^(?:0|[1-9]\d*)$/,K={};K[L]=K[T]=K[P]=K[Q]=K[Y]=K[oe]=K[X]=K[ae]=K[fe]=!0,K[f]=K[g]=K[j]=K[v]=K[G]=K[_]=K[M]=K[C]=K[w]=K[S]=K[R]=K[N]=K[H]=K[z]=K[B]=!1;var me=typeof gi=="object"&&gi&&gi.Object===Object&&gi,ke=typeof self=="object"&&self&&self.Object===Object&&self,pe=me||ke||Function("return this")(),W=t&&!t.nodeType&&t,te=W&&!0&&e&&!e.nodeType&&e,ie=te&&te.exports===W,Ie=ie&&me.process,ue=function(){try{return Ie&&Ie.binding("util")}catch{}}(),Se=ue&&ue.isTypedArray;function Pe(he,Ee){for(var Ke=-1,ft=he?he.length:0;++Ke<ft&&Ee(he[Ke],Ke,he)!==!1;);return he}function xe(he,Ee){for(var Ke=-1,ft=he?he.length:0;++Ke<ft;)if(Ee(he[Ke],Ke,he))return!0;return!1}function He(he){return function(Ee){return Ee==null?void 0:Ee[he]}}function Te(he,Ee){for(var Ke=-1,ft=Array(he);++Ke<he;)ft[Ke]=Ee(Ke);return ft}function V(he){return function(Ee){return he(Ee)}}function ne(he,Ee){return he==null?void 0:he[Ee]}function ye(he){var Ee=!1;if(he!=null&&typeof he.toString!="function")try{Ee=!!(he+"")}catch{}return Ee}function Be(he){var Ee=-1,Ke=Array(he.size);return he.forEach(function(ft,rn){Ke[++Ee]=[rn,ft]}),Ke}function je(he,Ee){return function(Ke){return he(Ee(Ke))}}function lt(he){var Ee=-1,Ke=Array(he.size);return he.forEach(function(ft){Ke[++Ee]=ft}),Ke}var Fe=Array.prototype,st=Function.prototype,wt=Object.prototype,mn=pe["__core-js_shared__"],In=function(){var he=/[^.]+$/.exec(mn&&mn.keys&&mn.keys.IE_PROTO||"");return he?"Symbol(src)_1."+he:""}(),Cn=st.toString,En=wt.hasOwnProperty,vn=wt.toString,Qe=RegExp("^"+Cn.call(En).replace(de,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yt=pe.Symbol,Pt=pe.Uint8Array,ln=je(Object.getPrototypeOf,Object),en=Object.create,Tn=wt.propertyIsEnumerable,qn=Fe.splice,ze=je(Object.keys,Object),St=Pa(pe,"DataView"),_t=Pa(pe,"Map"),Ht=Pa(pe,"Promise"),Yt=Pa(pe,"Set"),yr=Pa(pe,"WeakMap"),Cr=Pa(Object,"create"),Zo=ps(St),ho=ps(_t),$e=ps(Ht),Ze=ps(Yt),qt=ps(yr),wn=yt?yt.prototype:void 0,Mn=wn?wn.valueOf:void 0,Pn=wn?wn.toString:void 0;function Kr(he){var Ee=-1,Ke=he?he.length:0;for(this.clear();++Ee<Ke;){var ft=he[Ee];this.set(ft[0],ft[1])}}function $r(){this.__data__=Cr?Cr(null):{}}function ro(he){return this.has(he)&&delete this.__data__[he]}function us(he){var Ee=this.__data__;if(Cr){var Ke=Ee[he];return Ke===o?void 0:Ke}return En.call(Ee,he)?Ee[he]:void 0}function U(he){var Ee=this.__data__;return Cr?Ee[he]!==void 0:En.call(Ee,he)}function cs(he,Ee){var Ke=this.__data__;return Ke[he]=Cr&&Ee===void 0?o:Ee,this}Kr.prototype.clear=$r,Kr.prototype.delete=ro,Kr.prototype.get=us,Kr.prototype.has=U,Kr.prototype.set=cs;function Gt(he){var Ee=-1,Ke=he?he.length:0;for(this.clear();++Ee<Ke;){var ft=he[Ee];this.set(ft[0],ft[1])}}function _l(){this.__data__=[]}function Qs(he){var Ee=this.__data__,Ke=fs(Ee,he);if(Ke<0)return!1;var ft=Ee.length-1;return Ke==ft?Ee.pop():qn.call(Ee,Ke,1),!0}function bl(he){var Ee=this.__data__,Ke=fs(Ee,he);return Ke<0?void 0:Ee[Ke][1]}function Ml(he){return fs(this.__data__,he)>-1}function Ra(he,Ee){var Ke=this.__data__,ft=fs(Ke,he);return ft<0?Ke.push([he,Ee]):Ke[ft][1]=Ee,this}Gt.prototype.clear=_l,Gt.prototype.delete=Qs,Gt.prototype.get=bl,Gt.prototype.has=Ml,Gt.prototype.set=Ra;function Qo(he){var Ee=-1,Ke=he?he.length:0;for(this.clear();++Ee<Ke;){var ft=he[Ee];this.set(ft[0],ft[1])}}function Na(){this.__data__={hash:new Kr,map:new(_t||Gt),string:new Kr}}function ds(he){return Uu(this,he).delete(he)}function Xi(he){return Uu(this,he).get(he)}function vd(he){return Uu(this,he).has(he)}function yd(he,Ee){return Uu(this,he).set(he,Ee),this}Qo.prototype.clear=Na,Qo.prototype.delete=ds,Qo.prototype.get=Xi,Qo.prototype.has=vd,Qo.prototype.set=yd;function ea(he){var Ee=-1,Ke=he?he.length:0;for(this.__data__=new Qo;++Ee<Ke;)this.add(he[Ee])}function sp(he){return this.__data__.set(he,o),this}function _d(he){return this.__data__.has(he)}ea.prototype.add=ea.prototype.push=sp,ea.prototype.has=_d;function Br(he){this.__data__=new Gt(he)}function un(){this.__data__=new Gt}function Et(he){return this.__data__.delete(he)}function Zi(he){return this.__data__.get(he)}function yn(he){return this.__data__.has(he)}function rt(he,Ee){var Ke=this.__data__;if(Ke instanceof Gt){var ft=Ke.__data__;if(!_t||ft.length<n-1)return ft.push([he,Ee]),this;Ke=this.__data__=new Qo(ft)}return Ke.set(he,Ee),this}Br.prototype.clear=un,Br.prototype.delete=Et,Br.prototype.get=Zi,Br.prototype.has=yn,Br.prototype.set=rt;function Ge(he,Ee){var Ke=hs(he)||Pi(he)?Te(he.length,String):[],ft=Ke.length,rn=!!ft;for(var Nt in he)(Ee||En.call(he,Nt))&&!(rn&&(Nt=="length"||wd(Nt,ft)))&&Ke.push(Nt);return Ke}function fs(he,Ee){for(var Ke=he.length;Ke--;)if(xa(he[Ke][0],Ee))return Ke;return-1}function Go(he){return Ua(he)?en(he):{}}var ap=oo();function bd(he,Ee){return he&&ap(he,Ee,Ns)}function Os(he,Ee){Ee=Gu(Ee,he)?[Ee]:go(Ee);for(var Ke=0,ft=Ee.length;he!=null&&Ke<ft;)he=he[Bu(Ee[Ke++])];return Ke&&Ke==ft?he:void 0}function Md(he){return vn.call(he)}function Ni(he,Ee){return he!=null&&Ee in Object(he)}function Il(he,Ee,Ke,ft,rn){return he===Ee?!0:he==null||Ee==null||!Ua(he)&&!ti(Ee)?he!==he&&Ee!==Ee:Cl(he,Ee,Il,Ke,ft,rn)}function Cl(he,Ee,Ke,ft,rn,Nt){var xn=hs(he),Vn=hs(Ee),An=g,Yr=g;xn||(An=Rs(he),An=An==f?R:An),Vn||(Yr=Rs(Ee),Yr=Yr==f?R:Yr);var Hr=An==R&&!ye(he),To=Yr==R&&!ye(Ee),wr=An==Yr;if(wr&&!Hr)return Nt||(Nt=new Br),xn||Tr(he)?mo(he,Ee,Ke,ft,rn,Nt):io(he,Ee,An,Ke,ft,rn,Nt);if(!(rn&s)){var ni=Hr&&En.call(he,"__wrapped__"),_i=To&&En.call(Ee,"__wrapped__");if(ni||_i){var at=ni?he.value():he,Xn=_i?Ee.value():Ee;return Nt||(Nt=new Br),Ke(at,Xn,ft,rn,Nt)}}return wr?(Nt||(Nt=new Br),Td(he,Ee,Ke,ft,rn,Nt)):!1}function ei(he,Ee,Ke,ft){var rn=Ke.length,Nt=rn,xn=!ft;if(he==null)return!Nt;for(he=Object(he);rn--;){var Vn=Ke[rn];if(xn&&Vn[2]?Vn[1]!==he[Vn[0]]:!(Vn[0]in he))return!1}for(;++rn<Nt;){Vn=Ke[rn];var An=Vn[0],Yr=he[An],Hr=Vn[1];if(xn&&Vn[2]){if(Yr===void 0&&!(An in he))return!1}else{var To=new Br;if(ft)var wr=ft(Yr,Hr,An,he,Ee,To);if(!(wr===void 0?Il(Hr,Yr,ft,i|s,To):wr))return!1}}return!0}function Id(he){if(!Ua(he)||Qi(he))return!1;var Ee=Ye(he)||ye(he)?Qe:ve;return Ee.test(ps(he))}function lp(he){return ti(he)&&fp(he.length)&&!!K[vn.call(he)]}function ta(he){return typeof he=="function"?he:he==null?pp:typeof he=="object"?hs(he)?Cd(he[0],he[1]):wl(he):hp(he)}function Tl(he){if(!Eg(he))return ze(he);var Ee=[];for(var Ke in Object(he))En.call(he,Ke)&&Ke!="constructor"&&Ee.push(Ke);return Ee}function wl(he){var Ee=Fu(he);return Ee.length==1&&Ee[0][2]?Lr(Ee[0][0],Ee[0][1]):function(Ke){return Ke===he||ei(Ke,he,Ee)}}function Cd(he,Ee){return Gu(he)&&cp(Ee)?Lr(Bu(he),Ee):function(Ke){var ft=Je(Ke,he);return ft===void 0&&ft===Ee?yi(Ke,he):Il(Ee,ft,void 0,i|s)}}function xu(he){return function(Ee){return Os(Ee,he)}}function $o(he){if(typeof he=="string")return he;if(so(he))return Pn?Pn.call(he):"";var Ee=he+"";return Ee=="0"&&1/he==-u?"-0":Ee}function go(he){return hs(he)?he:$u(he)}function oo(he){return function(Ee,Ke,ft){for(var rn=-1,Nt=Object(Ee),xn=ft(Ee),Vn=xn.length;Vn--;){var An=xn[he?Vn:++rn];if(Ke(Nt[An],An,Nt)===!1)break}return Ee}}function mo(he,Ee,Ke,ft,rn,Nt){var xn=rn&s,Vn=he.length,An=Ee.length;if(Vn!=An&&!(xn&&An>Vn))return!1;var Yr=Nt.get(he);if(Yr&&Nt.get(Ee))return Yr==Ee;var Hr=-1,To=!0,wr=rn&i?new ea:void 0;for(Nt.set(he,Ee),Nt.set(Ee,he);++Hr<Vn;){var ni=he[Hr],_i=Ee[Hr];if(ft)var at=xn?ft(_i,ni,Hr,Ee,he,Nt):ft(ni,_i,Hr,he,Ee,Nt);if(at!==void 0){if(at)continue;To=!1;break}if(wr){if(!xe(Ee,function(Xn,Zn){if(!wr.has(Zn)&&(ni===Xn||Ke(ni,Xn,ft,rn,Nt)))return wr.add(Zn)})){To=!1;break}}else if(!(ni===_i||Ke(ni,_i,ft,rn,Nt))){To=!1;break}}return Nt.delete(he),Nt.delete(Ee),To}function io(he,Ee,Ke,ft,rn,Nt,xn){switch(Ke){case G:if(he.byteLength!=Ee.byteLength||he.byteOffset!=Ee.byteOffset)return!1;he=he.buffer,Ee=Ee.buffer;case j:return!(he.byteLength!=Ee.byteLength||!ft(new Pt(he),new Pt(Ee)));case v:case _:case S:return xa(+he,+Ee);case M:return he.name==Ee.name&&he.message==Ee.message;case N:case z:return he==Ee+"";case w:var Vn=Be;case H:var An=Nt&s;if(Vn||(Vn=lt),he.size!=Ee.size&&!An)return!1;var Yr=xn.get(he);if(Yr)return Yr==Ee;Nt|=i,xn.set(he,Ee);var Hr=mo(Vn(he),Vn(Ee),ft,rn,Nt,xn);return xn.delete(he),Hr;case x:if(Mn)return Mn.call(he)==Mn.call(Ee)}return!1}function Td(he,Ee,Ke,ft,rn,Nt){var xn=rn&s,Vn=Ns(he),An=Vn.length,Yr=Ns(Ee),Hr=Yr.length;if(An!=Hr&&!xn)return!1;for(var To=An;To--;){var wr=Vn[To];if(!(xn?wr in Ee:En.call(Ee,wr)))return!1}var ni=Nt.get(he);if(ni&&Nt.get(Ee))return ni==Ee;var _i=!0;Nt.set(he,Ee),Nt.set(Ee,he);for(var at=xn;++To<An;){wr=Vn[To];var Xn=he[wr],Zn=Ee[wr];if(ft)var Sd=xn?ft(Zn,Xn,wr,Ee,he,Nt):ft(Xn,Zn,wr,he,Ee,Nt);if(!(Sd===void 0?Xn===Zn||Ke(Xn,Zn,ft,rn,Nt):Sd)){_i=!1;break}at||(at=wr=="constructor")}if(_i&&!at){var Vu=he.constructor,fn=Ee.constructor;Vu!=fn&&"constructor"in he&&"constructor"in Ee&&!(typeof Vu=="function"&&Vu instanceof Vu&&typeof fn=="function"&&fn instanceof fn)&&(_i=!1)}return Nt.delete(he),Nt.delete(Ee),_i}function Uu(he,Ee){var Ke=he.__data__;return up(Ee)?Ke[typeof Ee=="string"?"string":"hash"]:Ke.map}function Fu(he){for(var Ee=Ns(he),Ke=Ee.length;Ke--;){var ft=Ee[Ke],rn=he[ft];Ee[Ke]=[ft,rn,cp(rn)]}return Ee}function Pa(he,Ee){var Ke=ne(he,Ee);return Id(Ke)?Ke:void 0}var Rs=Md;(St&&Rs(new St(new ArrayBuffer(1)))!=G||_t&&Rs(new _t)!=w||Ht&&Rs(Ht.resolve())!=A||Yt&&Rs(new Yt)!=H||yr&&Rs(new yr)!=B)&&(Rs=function(he){var Ee=vn.call(he),Ke=Ee==R?he.constructor:void 0,ft=Ke?ps(Ke):void 0;if(ft)switch(ft){case Zo:return G;case ho:return w;case $e:return A;case Ze:return H;case qt:return B}return Ee});function Dg(he,Ee,Ke){Ee=Gu(Ee,he)?[Ee]:go(Ee);for(var ft,rn=-1,xn=Ee.length;++rn<xn;){var Nt=Bu(Ee[rn]);if(!(ft=he!=null&&Ke(he,Nt)))break;he=he[Nt]}if(ft)return ft;var xn=he?he.length:0;return!!xn&&fp(xn)&&wd(Nt,xn)&&(hs(he)||Pi(he))}function wd(he,Ee){return Ee=Ee??d,!!Ee&&(typeof he=="number"||Me.test(he))&&he>-1&&he%1==0&&he<Ee}function Gu(he,Ee){if(hs(he))return!1;var Ke=typeof he;return Ke=="number"||Ke=="symbol"||Ke=="boolean"||he==null||so(he)?!0:ce.test(he)||!le.test(he)||Ee!=null&&he in Object(Ee)}function up(he){var Ee=typeof he;return Ee=="string"||Ee=="number"||Ee=="symbol"||Ee=="boolean"?he!=="__proto__":he===null}function Qi(he){return!!In&&In in he}function Eg(he){var Ee=he&&he.constructor,Ke=typeof Ee=="function"&&Ee.prototype||wt;return he===Ke}function cp(he){return he===he&&!Ua(he)}function Lr(he,Ee){return function(Ke){return Ke==null?!1:Ke[he]===Ee&&(Ee!==void 0||he in Object(Ke))}}var $u=Hu(function(he){he=na(he);var Ee=[];return J.test(he)&&Ee.push(""),he.replace(re,function(Ke,ft,rn,Nt){Ee.push(rn?Nt.replace(Oe,"$1"):ft||Ke)}),Ee});function Bu(he){if(typeof he=="string"||so(he))return he;var Ee=he+"";return Ee=="0"&&1/he==-u?"-0":Ee}function ps(he){if(he!=null){try{return Cn.call(he)}catch{}try{return he+""}catch{}}return""}function Hu(he,Ee){if(typeof he!="function"||Ee&&typeof Ee!="function")throw new TypeError(r);var Ke=function(){var ft=arguments,rn=Ee?Ee.apply(this,ft):ft[0],Nt=Ke.cache;if(Nt.has(rn))return Nt.get(rn);var xn=he.apply(this,ft);return Ke.cache=Nt.set(rn,xn),xn};return Ke.cache=new(Hu.Cache||Qo),Ke}Hu.Cache=Qo;function xa(he,Ee){return he===Ee||he!==he&&Ee!==Ee}function Pi(he){return b0(he)&&En.call(he,"callee")&&(!Tn.call(he,"callee")||vn.call(he)==f)}var hs=Array.isArray;function dp(he){return he!=null&&fp(he.length)&&!Ye(he)}function b0(he){return ti(he)&&dp(he)}function Ye(he){var Ee=Ua(he)?vn.call(he):"";return Ee==C||Ee==D}function fp(he){return typeof he=="number"&&he>-1&&he%1==0&&he<=d}function Ua(he){var Ee=typeof he;return!!he&&(Ee=="object"||Ee=="function")}function ti(he){return!!he&&typeof he=="object"}function so(he){return typeof he=="symbol"||ti(he)&&vn.call(he)==x}var Tr=Se?V(Se):lp;function na(he){return he==null?"":$o(he)}function Je(he,Ee,Ke){var ft=he==null?void 0:Os(he,Ee);return ft===void 0?Ke:ft}function yi(he,Ee){return he!=null&&Dg(he,Ee,Ni)}function Ns(he){return dp(he)?Ge(he):Tl(he)}function qu(he,Ee,Ke){var ft=hs(he)||Tr(he);if(Ee=ta(Ee),Ke==null)if(ft||Ua(he)){var rn=he.constructor;ft?Ke=hs(he)?new rn:[]:Ke=Ye(rn)?Go(ln(he)):{}}else Ke={};return(ft?Pe:bd)(he,function(Nt,xn,Vn){return Ee(Ke,Nt,xn,Vn)}),Ke}function pp(he){return he}function hp(he){return Gu(he)?He(Bu(he)):xu(he)}e.exports=qu})(Uv,Uv.exports);var uV=Uv.exports;const cV=Xq,Wk=lV,dV=uV;var fV=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 dV(t,(g,v,_)=>{if(!n.includes(_)&&((Array.isArray(v)||Wk(v))&&(v=e(v,{NaNValues:u,cleanKeys:n,cleanValues:r,emptyArrays:o,emptyObjects:i,emptyStrings:s,nullValues:d,undefinedValues:f})),!r.includes(v)&&!(i&&Wk(v)&&cV(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 Kk=Vf(fV),Co=Jq({hideLoading:!0,timeout:2e4,timeoutMessage:"请求超时"});Co.interceptors.request.use((e,t)=>{const n=sessionStorage.getItem("Authorization")||"",r={};return n&&(r.Authorization=n),{url:e,options:{...t,params:Kk(t.params),data:Kk(t.data),headers:{...t.headers,...r}}}},{global:!1});Co.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 pV=sessionStorage.getItem("platform")||"classroom",Xo=pV=="classroom"?"/edu-app":"/api-backend",hV=e=>Co.post(Xo+"/imGroup/page",{data:e}),N5=e=>Co.post(Xo+"/imUserFriend/page",{data:e}),gV=e=>Co.post(Xo+"/imGroup/changeGroupOwner",{data:e}),mV=e=>Co.post(Xo+"/imGroupNotice/page",{data:e}),P5=e=>Co.post(Xo+"/imGroupNotice/save",{data:e}),x5=e=>Co.post(Xo+"/imGroupNotice/remove",{requestType:"form",data:e}),Fv=e=>Co.post(Xo+"/imGroupNotice/update",{data:e}),U5=e=>Co.get(Xo+"/imGroupNotice/detail/"+e),F5=e=>Co.get(Xo+"/imGroup/detail/"+e.id),Yk=e=>Co.post(Xo+"/imGroupMember/page",{data:e}),vV=e=>Co.post(Xo+"/imGroupMember/userDetail",{data:e}),yV=e=>Co.post(Xo+"/imGroup/quit/"+e.id,{data:e}),_V=e=>Co.post(Xo+"/imGroup/muteAll",{data:e}),bV=e=>Co.post(Xo+"/imGroupMember/groupMute",{data:e}),MV=e=>Co.post(Xo+"/imGroupMember/saveImAll",{data:e}),IV=e=>Co.post(Xo+"/imGroup/dismiss/"+e.id,{data:e}),CV=e=>Co.post(Xo+"/imUserFriend/batchFriend",{data:e}),TV=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){var d;const n=((d=window==null?void 0:window.TUIKitTUICore)==null?void 0:d.isOfficial)&&Ei&&Ei()||{},r=jt({data:{},extension:{},isCustom:"",constant:cn});nn(()=>{r.data=e.data;const{message:{payload:f}}=e.data;r.isCustom=f.data||" ",r.isCustom=nr(f.data),f.data===cn.typeService&&(r.extension=nr(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,R,A,N,H;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:z,to:x,from:B}=(S=r==null?void 0:r.data)==null?void 0:S.message;if(x===B)break;try{await((N=(A=(R=window==null?void 0:window.TUIKitTUICore)==null?void 0:R.TUIServer)==null?void 0:A.TUICallKit)==null?void 0:N.call({userID:z==="out"?x:B,type:f})),(H=window==null?void 0:window.TUIKitTUICore)!=null&&H.isOfficial&&(n!=null&&n.commit)&&(n==null||n.commit("handleTask",6))}catch(j){console.warn(j)}break;case window.TUIKitTUICore.TIM.TYPES.CONV_GROUP:break}},u=async()=>{var f,g,v;if((f=r.isCustom)!=null&&f.msgId)try{await U5((g=r.isCustom)==null?void 0:g.msgId),lu.emit("handleNotice",(v=r.isCustom)==null?void 0:v.msgId)}catch(_){pi({message:_.message,isH5:!1,type:"error"})}};return{...Kt(r),isUrl:ev,openLink:o,handleCallMessageIcon:i,handleNotice:u,handleCallAgain:s}}});const G5=e=>(mr("data-v-e5bee205"),e=e(),vr(),e),wV={class:"custom"},SV={key:0},kV=["href"],DV={key:0},EV=["href"],AV={key:1},LV={key:1,class:"evaluate"},OV=G5(()=>$("i",{class:"icon icon-star-light"},null,-1)),RV=[OV],NV=["src"],PV={key:3,class:"textLink"},xV=["href"],UV=G5(()=>$("div",{class:"notice-title"},[$("i",{class:"iconNotice"}),$("span",null,"群公告")],-1)),FV={class:"content"},GV={class:"content-title"},$V={class:"content-text"},BV=["innerHTML"];function HV(e,t,n,r,o,i){var s,u;return Z(),se("div",wV,[e.isCustom===e.constant.typeService?(Z(),se("div",SV,[$("h1",null,[$("label",null,De(e.extension.title),1),e.extension.hyperlinks_text?(Z(),se("a",{key:0,href:e.extension.hyperlinks_text.value,target:"view_window"},De(e.extension.hyperlinks_text.key),9,kV)):Ce("",!0)]),e.extension.item&&e.extension.item.length>0?(Z(),se("ul",DV,[(Z(!0),se(dt,null,Vt(e.extension.item,(d,f)=>(Z(),se("li",{key:f},[e.isUrl(d.value)?(Z(),se("a",{key:0,href:d.value,target:"view_window"},De(d.key),9,EV)):(Z(),se("p",AV,De(d.key),1))]))),128))])):Ce("",!0),$("article",null,De(e.extension.description),1)])):e.isCustom.businessID===e.constant.typeEvaluate?(Z(),se("div",LV,[$("h1",null,De(e.$t("message.custom.对本次服务评价")),1),$("ul",null,[(Z(!0),se(dt,null,Vt(~~e.isCustom.score,(d,f)=>(Z(),se("li",{class:"evaluate-list-item",key:f},RV))),128))]),$("article",null,De(e.isCustom.comment),1)])):e.isCustom.businessID===e.constant.typeOrder?(Z(),se("div",{key:2,class:"order",onClick:t[0]||(t[0]=d=>e.openLink(e.isCustom.link))},[$("img",{src:e.isCustom.imageUrl,alt:""},null,8,NV),$("main",null,[$("h1",null,De(e.isCustom.title),1),$("p",null,De(e.isCustom.description),1),$("span",null,De(e.isCustom.price),1)])])):e.isCustom.businessID===e.constant.typeTextLink?(Z(),se("div",PV,[$("p",null,De(e.isCustom.text),1),$("a",{href:e.isCustom.link,target:"view_window"},De(e.$t("message.custom.查看详情>>")),9,xV)])):e.isCustom.businessID===e.constant.TYPE_CALL_MESSAGE?(Z(),se("div",{key:4,class:it(["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))},[$("i",{class:it(["icon",e.handleCallMessageIcon()])},null,2),$("span",null,De(e.data.custom),1)],2)):e.isCustom.businessID===e.constant.TC_GROUP_NOTICE?(Z(),se("div",{key:5,class:"notice-message",onClick:t[2]||(t[2]=(...d)=>e.handleNotice&&e.handleNotice(...d))},[UV,$("div",FV,[$("div",GV,De(e.isCustom.msgTitle),1),$("div",$V,De(e.isCustom.msgContent),1)])])):(Z(),se("span",{key:6,innerHTML:e.data.custom},null,8,BV))])}const qV=Wt(TV,[["render",HV],["__scopeId","data-v-e5bee205"]]),VV=ot({props:{data:{type:Object,default:()=>({})}},setup(e,t){const n=jt({message:{}});return nn(()=>{n.message=e.data}),{...Kt(n)}}});const zV={class:"message-tip"};function jV(e,t,n,r,o,i){var s;return Z(),se("div",zV,[$("span",null,De((s=e.message)==null?void 0:s.text),1)])}const WV=Wt(VV,[["render",jV],["__scopeId","data-v-4c01e0ac"]]),KV={80001:"您发送的消息可能包含违规内容,请停止发送此类内容",80002:"您发送的消息超过最大长度限制(>8KB)"};function vg(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)?pi({message:`${e.type} : ${e.message}`||e,isH5:!!(t!=null&&t.isH5),type:"error"}):pi({message:KV[e.code]||e.message,isH5:!!(t!=null&&t.isH5),type:"error"}))}function YV(e,t){pi({message:e,isH5:!!(t!=null&&t.isH5),type:"success"})}function JV(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])===-1)return!1;return!0}const XV=ot({props:{message:{type:Object,default:{}},referenceMessage:{type:Object,default:()=>({})},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=jt({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}),$t(()=>e.referenceForShow,()=>{n.referenceForShow=e.referenceForShow},{deep:!0}),{...Kt(n),constant:cn}}});const ZV={class:"message-reference-user"},QV={class:"nick"},ez={class:"colon"},tz={key:0,class:"face-box"},nz={key:0,class:"text-box"},rz=["src"],oz={key:1},iz=["src"],sz={key:3,class:"message-video-cover"},az=["src"],lz=["src"],uz={key:5};function cz(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?(Z(),se("div",{key:0,class:it(`${e.type} ${e.message.flow==="in"&&e.type+"-reverse"}`)},[$("p",ZV,[$("span",QV,De(e.referenceForShow.nick||e.referenceForShow.from),1),$("span",ez,De(e.type==="reference"?":":""),1)]),e.referenceMessage.messageType===e.constant.typeText?(Z(),se("div",tz,[(Z(!0),se(dt,null,Vt(e.face,(C,D)=>(Z(),se("div",{key:D},[C.name==="text"?(Z(),se("span",nz,De(C.text),1)):C.name==="img"?(Z(),se("img",{key:1,class:"text-img",src:C.src},null,8,rz)):Ce("",!0)]))),128))])):Ce("",!0),e.referenceMessage.messageType===e.constant.typeCustom?(Z(),se("span",oz,De(e.referenceMessage.messageAbstract),1)):Ce("",!0),e.referenceMessage.messageType===e.constant.typeImage?(Z(),se("img",{key:2,class:"message-img",src:e.referenceForShow.payload.imageInfoArray[1].url},null,8,iz)):Ce("",!0),e.referenceMessage.messageType===e.constant.typeVideo?(Z(),se("div",sz,[$("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,az)])):Ce("",!0),e.referenceMessage.messageType===e.constant.typeFace?(Z(),se("img",{key:4,class:"message-img",src:e.url},null,8,lz)):Ce("",!0),e.referenceMessage.messageType===e.constant.typeFile||e.referenceMessage.messageType===e.constant.typeAudio?(Z(),se("span",uz,De((v=e.referenceMessage)==null?void 0:v.messageAbstract),1)):Ce("",!0)],2)):(Z(),se("div",{key:1,class:it(`${e.type} ${e.message.flow==="in"&&e.type+"-reverse"}`)},[$("p",null,De((_=e.referenceMessage)==null?void 0:_.messageSender),1),$("span",null,De((M=e.referenceMessage)==null?void 0:M.messageAbstract),1)],2))}const dz=Wt(XV,[["render",cz],["__scopeId","data-v-09aaa535"]]),fz=ot({props:{message:{type:Object,default:()=>({})},emojiList:{type:Array,default:()=>[]},type:{type:String,default:""}},emits:["handleCollapse"],setup(e,t){const{TUIServer:n}=_c,r=jt({message:{},emojiUrl:uh,emojiMap:uf,emojiName:DO,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=(_=nr(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,R,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:(R=_==null?void 0:_.selfInfo)==null?void 0:R.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)}),{...Kt(r),emojiCollapseList:i,emojiExpandList:s,select:u,handleEmojiReact:d,handleEmojiReactItem:f,container:o}}});const pz={class:"face-list collapse"},hz={class:"face-list-collapse"},gz=["onClick"],mz=["src"],vz={class:"face-list face-list-expand"},yz=["onClick"],_z=["src"],bz={key:1,class:"emoji-content"},Mz={class:"emoji-react",ref:"container"},Iz=["onClick"],Cz=["src"],Tz={class:"emoji-react-item-content"};function wz(e,t,n,r,o,i){var s;return Z(),se(dt,null,[e.type==="dropdown"?(Z(),se("div",{key:0,class:it(["dialog-emoji",(s=e.env)!=null&&s.isH5?"dialog-emoji-h5":""])},[$("div",pz,[$("ul",hz,[(Z(!0),se(dt,null,Vt(e.emojiCollapseList,(u,d)=>(Z(),se("li",{class:"face-list-item",key:d,onClick:bn(f=>e.select(u),["stop"])},[$("img",{src:e.emojiUrl+e.emojiMap[u]},null,8,mz)],8,gz))),128))]),$("div",{class:"face-list-button",onClick:t[0]||(t[0]=bn(u=>e.isCollapse=!e.isCollapse,["stop"]))},[$("i",{class:it(["icon",[e.isCollapse?"icon-expand":"icon-collapse"]])},null,2)])]),$n($("ul",vz,[(Z(!0),se(dt,null,Vt(e.emojiExpandList,(u,d)=>(Z(),se("li",{class:"face-list-item",key:d,onClick:bn(f=>e.select(u),["stop"])},[$("img",{src:e.emojiUrl+e.emojiMap[u]},null,8,_z)],8,yz))),128))],512),[[eo,!e.isCollapse]])],2)):Ce("",!0),e.type==="content"?(Z(),se("div",bz,[$("ul",Mz,[(Z(!0),se(dt,null,Vt(e.handleEmojiReact(e.message),(u,d)=>$n((Z(),se("li",{class:"emoji-react-item",key:d,onClick:bn(f=>e.select(d),["stop"])},[$("img",{src:e.emojiUrl+e.emojiMap[d]},null,8,Cz),$("div",Tz,[$("span",null,De(e.handleEmojiReactItem(u)),1)])],8,Iz)),[[eo,u&&(u==null?void 0:u.length)]])),128))],512)])):Ce("",!0)],64)}const ZC=Wt(fz,[["render",wz],["__scopeId","data-v-ec5b0600"]]),Sz=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:dz,MessageEmojiReact:ZC},setup(e,t){const{t:n}=window.TUIKitTUICore.config.i18n.useI18n(),{TUIServer:r}=_c,o=jt({env:jh(),message:{},messagesList:[],show:!1,type:{},referenceMessage:{},referenceForShow:{},allMessageID:"",needGroupReceipt:!1,needReplies:!0,replies:[],face:[],url:"",needEmojiReact:!1});nn(()=>{var A,N,H;if(o.type=cn,o.messagesList=e.messagesList,o.needEmojiReact=e.needEmojiReact,o.message=LC(((A=o.messagesList)==null?void 0:A.find(z=>{var x;return(z==null?void 0:z.ID)===((x=e.message)==null?void 0:x.ID)}))||e.data),o.needGroupReceipt=e.needGroupReceipt,o.needReplies=e.needReplies,o.message.cloudCustomData){const z=[],x=nr(o.message.cloudCustomData);o.replies=((N=x==null?void 0:x.messageReplies)==null?void 0:N.replies)||[],o.referenceMessage=x.messageReply?x.messageReply:"";for(let B=0;B<o.messagesList.length;B++)z.push(o.messagesList[B].ID),o.allMessageID=JSON.stringify(z),o.messagesList[B].ID===((H=o.referenceMessage)==null?void 0:H.messageID)&&(o.referenceForShow=o.messagesList[B],o.referenceMessage.messageType===cn.typeText&&(o.face=EO(o.referenceForShow.payload)),o.referenceMessage.messageType===cn.typeFace&&(o.url=`https://web.sdk.qcloud.com/im/assets/face-elem/${o.referenceForShow.payload.data}@2x.png`))}else o.replies=[]});const i=Ne(null),s=Ne(!1),u=Ne(null),d=A=>{s.value=!s.value,s.value&&(t.emit("dropDownOpen",u),Ir(()=>{var oe,X,ae,fe,le,ce,J,re,de,Oe,ve,Me,K,me,ke;const N=(oe=u==null?void 0:u.value)==null?void 0:oe.children[0],H=document.getElementsByClassName("dialog-item")[0],z=(X=u==null?void 0:u.value)==null?void 0:X.offsetParent,x=Ev(z),B=document.getElementById("messageEle"),j=Ev(B),G=(ae=j==null?void 0:j.left)==null?void 0:ae.value,L=((fe=j==null?void 0:j.left)==null?void 0:fe.value)+B.clientWidth-N.clientWidth+76,T=(le=j==null?void 0:j.top)==null?void 0:le.value,P=((ce=j==null?void 0:j.top)==null?void 0:ce.value)+B.clientHeight-N.clientHeight,{clientX:Q,clientY:Y}=A;if((J=o==null?void 0:o.env)!=null&&J.isH5){((re=x==null?void 0:x.top)==null?void 0:re.value)<=(H==null?void 0:H.clientHeight)?N.style.bottom=`-${H==null?void 0:H.clientHeight}Px`:((de=o==null?void 0:o.message)==null?void 0:de.flow)==="in"?N.style.top=`-${(H==null?void 0:H.clientHeight)-20}Px`:N.style.top=`-${H==null?void 0:H.clientHeight}Px`;const pe=((Oe=x==null?void 0:x.left)==null?void 0:Oe.value)+((ve=x==null?void 0:x.width)==null?void 0:ve.value)/2;pe>H.clientWidth/2&&pe<(B==null?void 0:B.clientWidth)-H.clientWidth/2?N.style.left="calc(50% - 135Px)":pe<=H.clientWidth/2?N.style.left="-20Px":N.style.left=`-${H.clientWidth/2+10}Px`;return}switch(!0){case(Q>G&&Q<L):N.style.left=`${Math.max(A.clientX-((Me=x==null?void 0:x.left)==null?void 0:Me.value)-76,-40)}Px`;break;case Q<=G:N.style.left="20Px";break;case Q>=L:N.style.right=`${Math.max(((K=x==null?void 0:x.left)==null?void 0:K.value)+(z==null?void 0:z.clientWidth)-A.clientX-256,-10)}Px`;break}switch(!0){case(Y>T&&Y<P):N.style.top=`${A.clientY-((me=x==null?void 0:x.top)==null?void 0:me.value)}Px`,N.style.cssText=N.style.cssText.replace("align-items:end;","");break;case Y<=T:N.style.top="0Px",N.style.cssText=N.style.cssText.replace("align-items:end;","");break;case Y>=P:N.style.bottom=`${((ke=x==null?void 0:x.top)==null?void 0:ke.value)+(z==null?void 0:z.clientHeight)-A.clientY}Px`,N.style.cssText+="align-items:end;";break}}))},f=A=>{var N,H;if((N=o.referenceMessage)!=null&&N.messageID&&o.allMessageID.includes((H=o.referenceMessage)==null?void 0:H.messageID))t.emit("jumpID",o.referenceMessage.messageID);else{const z=n("TUIChat.无法定位到原消息");xr(z,e)}};Xs(u,()=>{s.value=!1}),cB(i,A=>{var N;(N=o==null?void 0:o.env)!=null&&N.isH5&&d(A)});const v=A=>{t.emit("resendMessage",A)},_=A=>!!(A.flow==="out"&&A.status==="success"&&A.needReadReceipt),M=A=>{var N,H,z;return(N=A==null?void 0:A.readReceiptInfo)!=null&&N.isPeerRead||((H=A==null?void 0:A.readReceiptInfo)==null?void 0:H.isPeerRead)===void 0&&(A!=null&&A.isPeerRead)||((z=A==null?void 0:A.readReceiptInfo)==null?void 0:z.unreadCount)===0?"":"unRead"},C=A=>{var N,H;switch(A.conversationType){case r.TUICore.TIM.TYPES.CONV_C2C:return(N=A==null?void 0:A.readReceiptInfo)!=null&&N.isPeerRead||((H=A==null?void 0:A.readReceiptInfo)==null?void 0:H.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,N)=>{var H,z;if(N){t.emit("showRepliesDialog",A,"replies");return}if((H=o.referenceMessage)!=null&&H.messageRootID){const x=(z=o.messagesList)==null?void 0:z.find(B=>{var j;return B.ID===((j=o.referenceMessage)==null?void 0:j.messageRootID)});if(x){t.emit("showRepliesDialog",x,"replies");return}else{const B=n("TUIChat.无法定位到原消息");xr(B,e)}}},S=A=>{const N=["content"];return A&&(N.push(`content-${o.message.flow}`),o.message.type===vt.TYPES.MSG_IMAGE&&!R(A)&&N.push("content-image"),o.message.type===vt.TYPES.MSG_VIDEO&&!R(A)&&N.push("content-video")),N},R=A=>{var N,H;try{if(!(A!=null&&A.cloudCustomData))return;const z=(H=(N=nr(A==null?void 0:A.cloudCustomData))==null?void 0:N.messageReact)==null?void 0:H.reacts;return!(!z||Object.keys(z).length===0)}catch(z){return console.warn(z),!1}};return{...Kt(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:R,TIM:vt}}});const kz=e=>(mr("data-v-cf9e8945"),e=e(),vr(),e),Dz=["src"],Ez={class:"message-area"},Az={key:0,class:"name"},Lz={key:1,ref:"dropdownRef",class:"dropdown-inner"},Oz=kz(()=>$("i",{class:"icon icon-msg-replies"},null,-1));function Rz(e,t,n,r,o,i){var d,f,g,v,_,M,C,D;const s=Bt("MessageReference"),u=Bt("MessageEmojiReact");return Z(),se(dt,null,[$("div",{class:it(["message-bubble",[e.message.flow==="in"?"":"reverse"]]),ref:"htmlRefHook"},[$("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,Dz),$("main",Ez,[e.message.flow==="in"&&e.message.conversationType==="GROUP"?(Z(),se("label",Az,De(e.message.nameCard||e.message.nick||e.message.from),1)):Ce("",!0),$("div",{class:it(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)?(Z(),se("div",{key:0,class:it(["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))},[Ct(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?(Z(),se("div",Lz,[$("div",{class:it(["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)?(Z(),bt(u,{key:2,message:e.message,type:"content"},null,8,["message"])):Ce("",!0)],34)]),e.message.status==="fail"?(Z(),se("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)?(Z(),se("div",{key:0,class:it(["message-reference-area",[e.message.flow==="in"?"":"message-reference-area-reverse"]]),onClick:t[4]||(t[4]=w=>e.jumpToAim(e.referenceMessage))},[Ct(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?(Z(),se("label",{key:1,class:it(["message-replies",[e.message.flow==="in"?"":"message-replies-reverse"]]),onClick:t[5]||(t[5]=w=>e.showRepliesDialog(e.message,!0))},[Oz,$("span",null,De(((D=e.replies)==null?void 0:D.length)+e.$t("TUIChat.条回复")),1)],2)):Ce("",!0)],64)}const Nz=Wt(Sz,[["render",Rz],["__scopeId","data-v-cf9e8945"]]),Pz=ot({props:{data:{type:Object,default:()=>({})},isEdit:{type:Boolean,default:()=>!1}},setup(e,t){const n=jt({message:{},isEdit:!1});nn(()=>{n.message=e.data,n.isEdit=e.isEdit});const r=()=>{t.emit("edit",n.message)};return{...Kt(n),edit:r}}});const xz={class:"revoke"},Uz={key:0},Fz={key:1};function Gz(e,t,n,r,o,i){return Z(),se("div",xz,[e.message.flow==="in"?(Z(),se("label",Uz,De(e.message.nick||e.message.from),1)):(Z(),se("label",Fz,De(e.$t("TUIChat.您")),1)),$("span",null,De(e.$t("TUIChat.撤回了一条消息")),1),e.message.flow==="out"&&e.isEdit?(Z(),se("span",{key:2,class:"edit",onClick:t[0]||(t[0]=(...s)=>e.edit&&e.edit(...s))},De(e.$t("TUIChat.重新编辑")),1)):Ce("",!0)])}const $z=Wt(Pz,[["render",Gz],["__scopeId","data-v-0c5cbaa4"]]),Bz=ot({props:{data:{type:Array,default:()=>[]},types:{type:Object,default:()=>({})}},setup(e,t){const n=jt({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{...Kt(n),translateGroupSystemNotice:L$,handleApplication:r}}});const Hz=e=>(mr("data-v-fd617f16"),e=e(),vr(),e),qz={class:"message-system"},Vz={class:"list"},zz=Hz(()=>$("i",{class:"icon icon-system"},null,-1)),jz={key:0,class:"btn-box"},Wz=["onClick"],Kz=["onClick"];function Yz(e,t,n,r,o,i){return Z(),se("div",qz,[$("ul",Vz,[(Z(!0),se(dt,null,Vt(e.messageList,(s,u)=>{var d;return Z(),se("li",{key:u},[s.type===e.types.MSG_GRP_TIP||s.type===e.types.MSG_GRP_SYS_NOTICE?(Z(),se(dt,{key:0},[zz,$("span",null,De(e.translateGroupSystemNotice(s)),1),((d=s==null?void 0:s.payload)==null?void 0:d.operationType)===1?(Z(),se("div",jz,[$("button",{class:"btn btn-default",onClick:f=>e.handleApplication("Agree",s)}," 接受 ",8,Wz),$("button",{class:"btn btn-cancel",onClick:f=>e.handleApplication("Reject",s)}," 拒绝 ",8,Kz)])):Ce("",!0)],64)):Ce("",!0)])}),128))])])}const Jz=Wt(Bz,[["render",Yz],["__scopeId","data-v-fd617f16"]]);var $5={exports:{}};/*!
- * clipboard.js v2.0.11
- * https://clipboardjs.com/
- *
- * Licensed MIT © Zeno Rocha
- */(function(e,t){(function(r,o){e.exports=o()})(gi,function(){return function(){var n={686:function(i,s,u){u.d(s,{default:function(){return ce}});var d=u(279),f=u.n(d),g=u(370),v=u.n(g),_=u(817),M=u.n(_);function C(J){try{return document.execCommand(J)}catch{return!1}}var D=function(re){var de=M()(re);return C("cut"),de},w=D;function S(J){var re=document.documentElement.getAttribute("dir")==="rtl",de=document.createElement("textarea");de.style.fontSize="12pt",de.style.border="0",de.style.padding="0",de.style.margin="0",de.style.position="absolute",de.style[re?"right":"left"]="-9999px";var Oe=window.pageYOffset||document.documentElement.scrollTop;return de.style.top="".concat(Oe,"px"),de.setAttribute("readonly",""),de.value=J,de}var R=function(re,de){var Oe=S(re);de.container.appendChild(Oe);var ve=M()(Oe);return C("copy"),Oe.remove(),ve},A=function(re){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},Oe="";return typeof re=="string"?Oe=R(re,de):re instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(re==null?void 0:re.type)?Oe=R(re.value,de):(Oe=M()(re),C("copy")),Oe},N=A;function H(J){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?H=function(de){return typeof de}:H=function(de){return de&&typeof Symbol=="function"&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de},H(J)}var z=function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},de=re.action,Oe=de===void 0?"copy":de,ve=re.container,Me=re.target,K=re.text;if(Oe!=="copy"&&Oe!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(Me!==void 0)if(Me&&H(Me)==="object"&&Me.nodeType===1){if(Oe==="copy"&&Me.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(Oe==="cut"&&(Me.hasAttribute("readonly")||Me.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(K)return N(K,{container:ve});if(Me)return Oe==="cut"?w(Me):N(Me,{container:ve})},x=z;function B(J){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?B=function(de){return typeof de}:B=function(de){return de&&typeof Symbol=="function"&&de.constructor===Symbol&&de!==Symbol.prototype?"symbol":typeof de},B(J)}function j(J,re){if(!(J instanceof re))throw new TypeError("Cannot call a class as a function")}function G(J,re){for(var de=0;de<re.length;de++){var Oe=re[de];Oe.enumerable=Oe.enumerable||!1,Oe.configurable=!0,"value"in Oe&&(Oe.writable=!0),Object.defineProperty(J,Oe.key,Oe)}}function L(J,re,de){return re&&G(J.prototype,re),de&&G(J,de),J}function T(J,re){if(typeof re!="function"&&re!==null)throw new TypeError("Super expression must either be null or a function");J.prototype=Object.create(re&&re.prototype,{constructor:{value:J,writable:!0,configurable:!0}}),re&&P(J,re)}function P(J,re){return P=Object.setPrototypeOf||function(Oe,ve){return Oe.__proto__=ve,Oe},P(J,re)}function Q(J){var re=X();return function(){var Oe=ae(J),ve;if(re){var Me=ae(this).constructor;ve=Reflect.construct(Oe,arguments,Me)}else ve=Oe.apply(this,arguments);return Y(this,ve)}}function Y(J,re){return re&&(B(re)==="object"||typeof re=="function")?re:oe(J)}function oe(J){if(J===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return J}function X(){if(typeof Reflect>"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 ae(J){return ae=Object.setPrototypeOf?Object.getPrototypeOf:function(de){return de.__proto__||Object.getPrototypeOf(de)},ae(J)}function fe(J,re){var de="data-clipboard-".concat(J);if(re.hasAttribute(de))return re.getAttribute(de)}var le=function(J){T(de,J);var re=Q(de);function de(Oe,ve){var Me;return j(this,de),Me=re.call(this),Me.resolveOptions(ve),Me.listenClick(Oe),Me}return L(de,[{key:"resolveOptions",value:function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof ve.action=="function"?ve.action:this.defaultAction,this.target=typeof ve.target=="function"?ve.target:this.defaultTarget,this.text=typeof ve.text=="function"?ve.text:this.defaultText,this.container=B(ve.container)==="object"?ve.container:document.body}},{key:"listenClick",value:function(ve){var Me=this;this.listener=v()(ve,"click",function(K){return Me.onClick(K)})}},{key:"onClick",value:function(ve){var Me=ve.delegateTarget||ve.currentTarget,K=this.action(Me)||"copy",me=x({action:K,container:this.container,target:this.target(Me),text:this.text(Me)});this.emit(me?"success":"error",{action:K,text:me,trigger:Me,clearSelection:function(){Me&&Me.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(ve){return fe("action",ve)}},{key:"defaultTarget",value:function(ve){var Me=fe("target",ve);if(Me)return document.querySelector(Me)}},{key:"defaultText",value:function(ve){return fe("text",ve)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(ve){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return N(ve,Me)}},{key:"cut",value:function(ve){return w(ve)}},{key:"isSupported",value:function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],Me=typeof ve=="string"?[ve]:ve,K=!!document.queryCommandSupported;return Me.forEach(function(me){K=K&&!!document.queryCommandSupported(me)}),K}}]),de}(f()),ce=le},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<v;g++)f[g].fn.apply(f[g].ctx,d);return this},off:function(u,d){var f=this.e||(this.e={}),g=f[u],v=[];if(g&&d)for(var _=0,M=g.length;_<M;_++)g[_].fn!==d&&g[_].fn._!==d&&v.push(g[_]);return v.length?f[u]=v:delete f[u],this}},i.exports=s,i.exports.TinyEmitter=s}},r={};function o(i){if(r[i])return r[i].exports;var s=r[i]={exports:{}};return n[i](s,s.exports,o),s.exports}return function(){o.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(s,{a:s}),s}}(),function(){o.d=function(i,s){for(var u in s)o.o(s,u)&&!o.o(i,u)&&Object.defineProperty(i,u,{enumerable:!0,get:s[u]})}}(),function(){o.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)}}(),o(686)}().default})})($5);var Xz=$5.exports;const Zz=Vf(Xz),B5=e=>{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 Zz(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)})}}},Qz=ot({props:{message:{type:Object,default:()=>({})},needEmojiReact:{type:Boolean,default:!1}},components:{MessageEmojiReact:ZC},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)&&Ei&&Ei()||{},o=jt({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}=B5();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{...Kt(o),openMessage:i,handleMessage:s,constant:cn,handleCollapse:u}}});const ud=e=>(mr("data-v-48212351"),e=e(),vr(),e),ej=ud(()=>$("i",{class:"icon icon-msg-copy"},null,-1)),tj=ud(()=>$("i",{class:"icon icon-msg-copy"},null,-1)),nj=ud(()=>$("i",{class:"icon icon-msg-forward"},null,-1)),rj=ud(()=>$("i",{class:"icon icon-msg-quote"},null,-1)),oj=ud(()=>$("i",{class:"icon icon-msg-reply"},null,-1)),ij=ud(()=>$("i",{class:"icon icon-msg-revoke"},null,-1)),sj=ud(()=>$("i",{class:"icon icon-msg-del"},null,-1));function aj(e,t,n,r,o,i){var u,d,f;const s=Bt("MessageEmojiReact");return Z(),se("div",{class:it(["dialog-item",(u=e.env)!=null&&u.isH5?"dialog-item-h5":"dialog-item-web"])},[(d=e.env)!=null&&d.isH5&&e.needEmojiReact?(Z(),bt(s,{key:0,message:e.message,type:"dropdown",onHandleCollapse:e.handleCollapse},null,8,["message","onHandleCollapse"])):Ce("",!0),$n($("ul",{class:it(["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?(Z(),se("li",{key:0,onClick:t[0]||(t[0]=g=>e.openMessage(e.message))},[ej,$("span",null,De(e.$t("TUIChat.打开")),1)])):Ce("",!0),e.message.type===e.types.MSG_TEXT?(Z(),se("li",{key:1,onClick:t[1]||(t[1]=g=>e.handleMessage(e.message,e.constant.handleMessage.copy))},[tj,$("span",null,De(e.$t("TUIChat.复制")),1)])):Ce("",!0),e.message.status==="success"?(Z(),se("li",{key:2,onClick:t[2]||(t[2]=g=>e.handleMessage(e.message,e.constant.handleMessage.forward))},[nj,$("span",null,De(e.$t("TUIChat.转发")),1)])):Ce("",!0),e.message.status==="success"?(Z(),se("li",{key:3,onClick:t[3]||(t[3]=g=>e.handleMessage(e.message,e.constant.handleMessage.reference))},[rj,$("span",null,De(e.$t("TUIChat.引用")),1)])):Ce("",!0),e.message.status==="success"?(Z(),se("li",{key:4,onClick:t[4]||(t[4]=g=>e.handleMessage(e.message,e.constant.handleMessage.reply))},[oj,$("span",null,De(e.$t("TUIChat.回复")),1)])):Ce("",!0),e.message.flow==="out"&&e.message.status==="success"&&e.message.type!==e.types.MSG_CUSTOM?(Z(),se("li",{key:5,onClick:t[5]||(t[5]=g=>e.handleMessage(e.message,e.constant.handleMessage.revoke))},[ij,$("span",null,De(e.$t("TUIChat.撤回")),1)])):Ce("",!0),e.message.status==="success"?(Z(),se("li",{key:6,onClick:t[6]||(t[6]=g=>e.handleMessage(e.message,e.constant.handleMessage.delete))},[sj,$("span",null,De(e.$t("TUIChat.删除")),1)])):Ce("",!0)],2),[[eo,e.showToolList]])],2)}const lj=Wt(Qz,[["render",aj],["__scopeId","data-v-48212351"]]),uj=ot({props:{show:{type:Boolean,default:()=>!1}},setup(e,t){const n=jt({show:!1});nn(()=>{n.show=e.show});const r=()=>{n.show=!n.show,t.emit("update:show",n.show)};return{...Kt(n),toggleView:r}}});function cj(e,t,n,r,o,i){return e.show?(Z(),se("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 dj=Wt(uj,[["render",cj],["__scopeId","data-v-95460edc"]]),fj=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=jt({type:"",list:[],selectedList:[],isSearch:!0,isCustomItem:!1,title:""});nn(()=>{if(e.isCustomItem)for(let f=0;f<e.list.length;f++)e.list[f].conversationID.indexOf("@TIM#SYSTEM")>-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{...Kt(n),optional:r,handleInput:o,selected:i,selectedAll:s,submit:u,cancel:d}}}),cd=""+new URL("nomore-9da703ae.png",import.meta.url).href;const H5=e=>(mr("data-v-8cb1c9dc"),e=e(),vr(),e),pj={key:0,class:"transfer-h5-header"},hj={class:"title"},gj={class:"main"},mj={class:"left"},vj={key:0},yj=["placeholder"],_j={class:"list"},bj={class:"all"},Mj=["onClick"],Ij=["src"],Cj={class:"name"},Tj={key:0},wj={key:0,class:"theEmtpy",style:{height:"90%"}},Sj=H5(()=>$("img",{class:"emptyImg",src:cd},null,-1)),kj=H5(()=>$("p",null,"暂无数据",-1)),Dj=[Sj,kj],Ej={class:"right"},Aj={key:0},Lj={class:"list"},Oj={key:0},Rj=["src"],Nj={key:0},Pj=["onClick"];function xj(e,t,n,r,o,i){return Z(),se("div",{class:it(["transfer",[e.isH5?"transfer-h5":""]])},[e.isH5?(Z(),se("header",pj,[$("i",{class:"icon icon-back",onClick:t[0]||(t[0]=(...s)=>e.cancel&&e.cancel(...s))}),$("span",hj,De(e.title),1)])):Ce("",!0),$("main",gj,[$("div",mj,[e.isSearch?(Z(),se("header",vj,[$("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,yj)])):Ce("",!0),$("main",null,[$("ul",_j,[e.optional.length>1&&!e.isRadio?(Z(),se("li",{key:0,class:"list-item",onClick:t[2]||(t[2]=(...s)=>e.selectedAll&&e.selectedAll(...s))},[$("i",{class:it(["icon",[e.selectedList.length===e.optional.length?"icon-selected":"icon-unselected"]])},null,2),$("span",bj,De(e.$t("component.全选")),1)])):Ce("",!0),(Z(!0),se(dt,null,Vt(e.list,(s,u)=>(Z(),se("li",{class:"list-item",key:u,onClick:d=>e.selected(s)},[$("i",{class:it(["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):(Z(),se(dt,{key:0},[$("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,Ij),$("span",Cj,De((s==null?void 0:s.nick)||(s==null?void 0:s.userID)),1),s!=null&&s.isDisabled?(Z(),se("span",Tj,"("+De(e.$t("component.已在群聊中"))+")",1)):Ce("",!0)],64))],8,Mj))),128))]),e.optional.length<=0?(Z(),se("div",wj,Dj)):Ce("",!0)])]),$("div",Ej,[e.isH5?Ce("",!0):(Z(),se("header",Aj,De(e.title),1)),$n($("ul",Lj,[e.selectedList.length>0&&!e.isH5?(Z(),se("p",Oj,De(e.$t("component.已选中"))+De(e.selectedList.length)+De(e.$t("component.人")),1)):Ce("",!0),(Z(!0),se(dt,null,Vt(e.selectedList,(s,u)=>(Z(),se("li",{class:"list-item space-between",key:u},[$("aside",null,[e.isCustomItem?Ft(e.$slots,"right",{key:1,data:s},void 0,!0):(Z(),se(dt,{key:0},[$("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,Rj),e.isH5?Ce("",!0):(Z(),se("span",Nj,De(s.nick||s.userID),1))],64))]),e.isH5?Ce("",!0):(Z(),se("i",{key:0,class:"icon icon-cancel",onClick:d=>e.selected(s)},null,8,Pj))]))),128))],512),[[eo,e.resultShow]]),$("footer",null,[$("button",{class:"btn btn-cancel",onClick:t[3]||(t[3]=(...s)=>e.cancel&&e.cancel(...s))},De(e.$t("component.取消")),1),e.selectedList.length>0?(Z(),se("button",{key:0,class:"btn",onClick:t[4]||(t[4]=(...s)=>e.submit&&e.submit(...s))},De(e.$t("component.完成")),1)):(Z(),se("button",{key:1,class:"btn btn-no",onClick:t[5]||(t[5]=(...s)=>e.submit&&e.submit(...s))},De(e.$t("component.完成")),1))])])])],2)}const QC=Wt(fj,[["render",xj],["__scopeId","data-v-8cb1c9dc"]]),Uj=ot({props:{open:{type:Boolean,default:()=>!1}},setup(e,t){const n=jt({open:!1});nn(()=>{n.open=e.open});const r=()=>{n.open=!n.open,t.emit("change",n.open)};return{...Kt(n),toggle:r}}});const Fj=e=>(mr("data-v-5246dd4c"),e=e(),vr(),e),Gj=Fj(()=>$("span",{class:"slider-block"},null,-1)),$j=[Gj];function Bj(e,t,n,r,o,i){return Z(),se("div",{class:it(["slider-box",[e.open&&"slider-open"]]),onClick:t[0]||(t[0]=(...s)=>e.toggle&&e.toggle(...s))},$j,2)}const eT=Wt(Uj,[["render",Bj],["__scopeId","data-v-5246dd4c"]]),Hj=ot({props:{data:{type:Object,default:()=>({})},isAuth:{type:Boolean,default:!1},isH5:{type:Boolean,default:!1}},setup(e,t){const n=jt({groupProfile:{},input:"",isEdit:!1});nn(()=>{n.groupProfile=e.data});const r=Ne();Xs(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{...Kt(n),updateProfile:o,toggleEdit:i,dialog:r}}});const qj={class:"name"},Vj={key:0,class:"edit-h5-header"},zj={class:"left"},jj={class:"input-box"},Wj={key:1},Kj={key:1,class:"edit-h5-footer"},Yj=["disabled"],Jj={key:1};function Xj(e,t,n,r,o,i){return Z(),se("div",qj,[$("label",null,De(e.$t("TUIChat.manage.群名称")),1),e.isEdit?(Z(),se("div",{key:0,class:it([e.isH5?"edit-h5":""]),ref:"dialog"},[$("main",null,[e.isH5?(Z(),se("header",Vj,[$("aside",zj,[$("h1",null,De(e.$t("TUIChat.manage.修改群聊名称")),1),$("span",null,De(e.$t("TUIChat.manage.修改群聊名称后,将在群内通知其他成员")),1)]),$("span",{class:"close",onClick:t[0]||(t[0]=(...s)=>e.toggleEdit&&e.toggleEdit(...s))},De(e.$t("关闭")),1)])):Ce("",!0),$("div",jj,[e.isEdit?$n((Z(),se("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)),[[ll,e.input]]):Ce("",!0),e.isH5?(Z(),se("span",Wj,De(e.$t("TUIChat.manage.仅限中文、字母、数字和下划线,2-20个字")),1)):Ce("",!0)]),e.isH5?(Z(),se("footer",Kj,[$("button",{class:"btn",disabled:!e.input,onClick:t[3]||(t[3]=(...s)=>e.updateProfile&&e.updateProfile(...s))},De(e.$t("确认")),9,Yj)])):Ce("",!0)])],2)):Ce("",!0),!e.isEdit||e.isH5?(Z(),se("p",Jj,[$("span",null,De(e.groupProfile.name),1)])):Ce("",!0)])}const Zj=Wt(Hj,[["render",Xj],["__scopeId","data-v-3873bf46"]]),Qj=ot({components:{Slider:eT},props:{data:{type:Object,default:()=>({})},isAuth:{type:Boolean,default:!1}},setup(e,t){const n=jt({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 mV({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 Fv({groupId:n.groupProfile.groupID,topFlag:!v.topFlag,id:v.id}),n.page=1,n.groupList=[],o(),pi({message:v.topFlag?"取消置顶成功":"设为置顶成功",isH5:!1,type:"success"})):_==="delete"?(await x5({id:v.id}),n.page=1,n.groupList=[],pi({message:"删除成功",isH5:!1,type:"success"}),o()):_==="add"&&(n.isEdit=!0,n.title="",n.input="",n.topFlag=!0,n.id="",t.emit("changeStatus","add"))}catch(D){pi({message:D.message,isH5:!1,type:"error"})}(C=r.value[M])==null||C.setShow(!1)},d=async()=>{if(!(!n.title||!n.input))try{n.id?await Fv({groupId:n.groupProfile.groupID,topFlag:n.topFlag,title:n.title,content:n.input,id:n.id}):await P5({groupId:n.groupProfile.groupID,title:n.title,content:n.input,topFlag:n.topFlag}),pi({message:"发布成功",isH5:!1,type:"success"}),n.isEdit=!1,t.emit("changeStatus","submit"),n.page=1,n.groupList=[],o()}catch(v){pi({message:v.message,isH5:!1,type:"error"})}},f=v=>{console.log(v,"onTopFlag"),n.topFlag=v},g=()=>{n.isEdit=!1};return t.expose({onCloseEdit:g}),{...Kt(n),popoverRef:r,formatJobType:s,onMore:i,onTopFlag:f,onOperation:u,onSubmit:d}}});const Kf=e=>(mr("data-v-1c3921a9"),e=e(),vr(),e),eW={class:"section"},tW={class:"userInfo"},nW=["src"],rW={class:"username"},oW={class:"users"},iW={class:"name"},sW={class:"tag"},aW={class:"userTime"},lW={class:"time"},uW={key:0,class:"tag"},cW=Kf(()=>$("span",{class:"iconMore"},[$("i",{class:"iconMorePoint"})],-1)),dW={class:"p-list"},fW=["onClick"],pW=["onClick"],hW=["onClick"],gW={class:"section-content"},mW={class:"content"},vW={key:0,class:"theEmpty"},yW=Kf(()=>$("img",{class:"emptyImg",src:cd},null,-1)),_W=Kf(()=>$("p",null,"暂无群公告",-1)),bW={key:2,class:"edit-notification"},MW={class:"input-section"},IW=Kf(()=>$("div",{class:"input-title"},[$("i",{class:"iconNotifit1"}),$("span",null,"公告标题")],-1)),CW={class:"input-content"},TW={class:"input-section"},wW=Kf(()=>$("div",{class:"input-title"},[$("i",{class:"iconNotifit2"}),$("span",null,"公告内容")],-1)),SW={class:"input-content notice-content"},kW={class:"input-section"},DW={class:"input-title input-slider"},EW=Kf(()=>$("span",null,"设为置顶",-1));function AW(e,t,n,r,o,i){const s=Bt("n-popover"),u=Bt("n-button"),d=Bt("n-tooltip"),f=Bt("n-input"),g=Bt("Slider");return Z(),se("main",{class:it(["notification",e.isEdit?"overflowHidden":""])},[$("div",eW,[(Z(!0),se(dt,null,Vt(e.groupList,(v,_)=>(Z(),se("div",{class:"section-item",key:_},[$("div",tW,[$("img",{class:"img",src:v.avatar},null,8,nW),$("div",rW,[$("div",oW,[$("span",iW,De(v.username),1),$("span",sW,De(e.formatJobType(v.jobType)),1)]),$("div",aW,[$("span",lW,De(v.updateTime),1),v.topFlag?(Z(),se("span",uW,"置顶")):Ce("",!0)])]),e.isAuth?(Z(),bt(s,{key:0,trigger:"hover",ref_for:!0,ref:"popoverRef",to:!1,placement:"bottom-end",width:"160px","show-arrow":!1,class:"popoverContainer"},{trigger:Ot(()=>[cW]),default:Ot(()=>[$("div",dW,[$("div",{class:"p-item",onClick:M=>e.onOperation(v,"edit",_)}," 编辑公告 ",8,fW),$("div",{class:"p-item",onClick:M=>e.onOperation(v,"top",_)},De(v.topFlag?"取消置顶":"设为置顶"),9,pW),$("div",{class:"p-item p-red",onClick:M=>e.onOperation(v,"delete",_)}," 删除公告 ",8,hW)])]),_:2},1536)):Ce("",!0)]),$("div",gW,[$("h2",null,De(v.title),1),$("div",mW,De(v.content),1)])]))),128)),e.groupList.length<e.total?(Z(),se("div",{key:0,class:"list-item",onClick:t[0]||(t[0]=(...v)=>e.onMore&&e.onMore(...v))}," 查看更多 ")):Ce("",!0)]),!e.loading&&e.groupList.length<=0?(Z(),se("div",vW,[yW,_W,Ct(u,{round:"",type:"info",class:"notificationBtn",onClick:t[1]||(t[1]=v=>e.onOperation({},"add"))},{default:Ot(()=>[Fr("发布公告")]),_:1})])):Ce("",!0),e.groupList.length>0&&!e.isEdit?(Z(),bt(d,{key:1,trigger:"hover","show-arrow":!1,class:"toolsNotifi"},{trigger:Ot(()=>[$("div",{class:"iconNotifiAdd",onClick:t[2]||(t[2]=v=>e.onOperation({},"add"))})]),default:Ot(()=>[Fr(" 发布公告 ")]),_:1})):Ce("",!0),e.isEdit?(Z(),se("div",bW,[$("div",MW,[IW,$("div",CW,[Ct(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"])])]),$("div",TW,[wW,$("div",SW,[Ct(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"])])]),$("div",kW,[$("div",DW,[EW,Ct(g,{open:e.topFlag,onChange:e.onTopFlag},null,8,["open","onChange"])])]),$("div",{class:it(["submitBtn",!e.title||!e.input?"disabled":""]),onClick:t[5]||(t[5]=(...v)=>e.onSubmit&&e.onSubmit(...v))}," 发布 ",2)])):Ce("",!0)],2)}const LW=Wt(Qj,[["render",AW],["__scopeId","data-v-1c3921a9"]]),OW=ot({components:{Slider:eT},props:{data:{type:Object,default:()=>({})},isAuth:{type:Boolean,default:!1},noticeId:{type:String,default:""}},setup(e,t){const n=jt({groupProfile:{},id:"",title:"",input:"",topFlag:!0,loading:!1,groupDetail:{},isEdit:!1}),r=Ne(),o=async()=>{n.loading=!0;try{let v=await U5(n.id);n.groupDetail=v.data||{}}catch{}n.loading=!1},i=()=>{n.page=n.page+1,o()};nn(()=>{n.groupProfile=e.data,n.id=e.noticeId,console.log(e),o()});const s=v=>({TEACHER:"音乐老师",ADMIN:"管理员",HEADMASTER:"校长"})[v],u=async(v,_)=>{var M;try{_==="edit"?(t.emit("changeStatus","editDetail"),n.isEdit=!0,n.title=v.title,n.input=v.content,n.topFlag=v.topFlag,n.id=v.id):_==="top"?(await Fv({groupId:n.groupProfile.groupID,topFlag:!v.topFlag,id:v.id}),o(),pi({message:v.topFlag?"取消置顶成功":"设为置顶成功",isH5:!1,type:"success"})):_==="delete"?(await x5({id:v.id}),pi({message:"删除成功",isH5:!1,type:"success"}),t.emit("changeStatus","deleteDetail")):_==="add"&&(n.isEdit=!0,n.title="",n.input="",n.topFlag=!0,n.id="",t.emit("changeStatus","addDetail"))}catch(C){pi({message:C.message,isH5:!1,type:"error"})}(M=r.value)==null||M.setShow(!1)},d=async()=>{if(!(!n.title||!n.input))try{n.id?await Fv({groupId:n.groupProfile.groupID,topFlag:n.topFlag,title:n.title,content:n.input,id:n.id}):await P5({groupId:n.groupProfile.groupID,title:n.title,content:n.input,topFlag:n.topFlag}),pi({message:"发布成功",isH5:!1,type:"success"}),n.isEdit=!1,t.emit("changeStatus","submitDetail"),n.page=1,n.groupDetail=[],o()}catch(v){pi({message:v.message,isH5:!1,type:"error"})}},f=v=>{console.log(v,"onTopFlag"),n.topFlag=v},g=()=>{n.isEdit=!1};return t.expose({onCloseEdit:g}),{...Kt(n),popoverRef:r,formatJobType:s,onMore:i,onTopFlag:f,onOperation:u,onSubmit:d}}});const Wy=e=>(mr("data-v-41a2eae4"),e=e(),vr(),e),RW={key:0,class:"section"},NW={class:"section-item"},PW={class:"userInfo"},xW=["src"],UW={class:"username"},FW={class:"users"},GW={class:"name"},$W={class:"tag"},BW={class:"userTime"},HW={class:"time"},qW={key:0,class:"tag"},VW=Wy(()=>$("span",{class:"iconMore"},[$("i",{class:"iconMorePoint"})],-1)),zW={class:"p-list"},jW={class:"section-content"},WW={class:"content"},KW={key:2,class:"edit-notification"},YW={class:"input-section"},JW=Wy(()=>$("div",{class:"input-title"},[$("i",{class:"iconNotifit1"}),$("span",null,"公告标题")],-1)),XW={class:"input-content"},ZW={class:"input-section"},QW=Wy(()=>$("div",{class:"input-title"},[$("i",{class:"iconNotifit2"}),$("span",null,"公告内容")],-1)),eK={class:"input-content notice-content"},tK={class:"input-section"},nK={class:"input-title input-slider"},rK=Wy(()=>$("span",null,"设为置顶",-1));function oK(e,t,n,r,o,i){var g;const s=Bt("n-popover"),u=Bt("n-tooltip"),d=Bt("n-input"),f=Bt("Slider");return Z(),se("main",{class:it(["notification",e.isEdit?"overflowHidden":""])},[(g=e.groupDetail)!=null&&g.id?(Z(),se("div",RW,[$("div",NW,[$("div",PW,[$("img",{class:"img",src:e.groupDetail.avatar},null,8,xW),$("div",UW,[$("div",FW,[$("span",GW,De(e.groupDetail.username),1),$("span",$W,De(e.formatJobType(e.groupDetail.jobType)),1)]),$("div",BW,[$("span",HW,De(e.groupDetail.createTime),1),e.groupDetail.topFlag?(Z(),se("span",qW,"置顶")):Ce("",!0)])]),e.isAuth?(Z(),bt(s,{key:0,trigger:"hover",ref:"popoverRef",to:!1,placement:"bottom-end",width:"160px","show-arrow":!1,class:"popoverContainer"},{trigger:Ot(()=>[VW]),default:Ot(()=>[$("div",zW,[$("div",{class:"p-item",onClick:t[0]||(t[0]=v=>e.onOperation(e.groupDetail,"edit"))}," 编辑公告 "),$("div",{class:"p-item",onClick:t[1]||(t[1]=v=>e.onOperation(e.groupDetail,"top"))},De(e.groupDetail.topFlag?"取消置顶":"设为置顶"),1),$("div",{class:"p-item p-red",onClick:t[2]||(t[2]=v=>e.onOperation(e.groupDetail,"delete"))}," 删除公告 ")])]),_:1},512)):Ce("",!0)]),$("div",jW,[$("h2",null,De(e.groupDetail.title),1),$("div",WW,De(e.groupDetail.content),1)])])])):Ce("",!0),e.groupDetail.length>0&&!e.isEdit?(Z(),bt(u,{key:1,trigger:"hover","show-arrow":!1,class:"toolsNotifi"},{trigger:Ot(()=>[$("div",{class:"iconNotifiAdd",onClick:t[3]||(t[3]=v=>e.onOperation({},"add"))})]),default:Ot(()=>[Fr(" 发布公告 ")]),_:1})):Ce("",!0),e.isEdit?(Z(),se("div",KW,[$("div",YW,[JW,$("div",XW,[Ct(d,{value:e.title,"onUpdate:value":t[4]||(t[4]=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"])])]),$("div",ZW,[QW,$("div",eK,[Ct(d,{value:e.input,"onUpdate:value":t[5]||(t[5]=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"])])]),$("div",tK,[$("div",nK,[rK,Ct(f,{open:e.topFlag,onChange:e.onTopFlag},null,8,["open","onChange"])])]),$("div",{class:it(["submitBtn",!e.title||!e.input?"disabled":""]),onClick:t[6]||(t[6]=(...v)=>e.onSubmit&&e.onSubmit(...v))}," 发布 ",2)])):Ce("",!0)],2)}const iK=Wt(OW,[["render",oK],["__scopeId","data-v-41a2eae4"]]),sK=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=jt({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{...Kt(n),getMore:i,submit:s,handleRoleName:r,formatJobType:o,handleMemberProfileShow:u}}});const aK={class:"member"},lK={class:"list"},uK={class:"avatarSection"},cK=["src"],dK={key:0,class:"jobType"},fK={key:1,class:it(["jobType","Owner"])},pK={class:"name"},hK={key:0,class:"roleType"},gK={style:{color:"#777777"}},mK=["onClick"];function vK(e,t,n,r,o,i){return Z(),se("main",aK,[$("ul",lK,[(Z(!0),se(dt,null,Vt(e.list,(s,u)=>(Z(),se("li",{class:"list-item",key:u},[$("aside",null,[$("div",uK,[$("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,cK),(s==null?void 0:s.groupRoleType)==="Admin"?(Z(),se("span",dK,De((s==null?void 0:s.groupRoleType)==="Admin"?"管理员":""),1)):Ce("",!0),(s==null?void 0:s.groupRoleType)==="Owner"?(Z(),se("span",fK,De((s==null?void 0:s.groupRoleType)==="Owner"?"群主":""),1)):Ce("",!0)]),$("span",pK,[Fr(De((s==null?void 0:s.nickname)||(s==null?void 0:s.userID))+" ",1),s!=null&&s.teacherJobType?(Z(),se("span",hK,De(e.formatJobType(s.teacherJobType)),1)):Ce("",!0)]),$("span",gK,De(e.handleRoleName(s)),1)]),s.role!=="Owner"&&e.isShowDel?(Z(),se("i",{key:0,class:"icon icon-del",onClick:d=>e.submit(s)},null,8,mK)):Ce("",!0)]))),128)),e.list.length<e.total?(Z(),se("li",{key:0,class:"list-item",onClick:t[0]||(t[0]=(...s)=>e.getMore&&e.getMore(...s))},De(e.$t("TUIChat.manage.查看更多")),1)):Ce("",!0)])])}const yK=Wt(sK,[["render",vK],["__scopeId","data-v-74df3bfb"]]),_K=ot({props:{userInfo:{type:Object,default:()=>({})}},setup(e,t){const n=ul==null?void 0:ul.TUIServer,r=jt({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{...Kt(r),enter:o,showEnter:s}}});const bK=e=>(mr("data-v-25fa5b68"),e=e(),vr(),e),MK={class:"memeber-profile"},IK={class:"memeber-profile-main"},CK=["src"],TK={class:"list"},wK=bK(()=>$("label",null,"ID:",-1)),SK={class:"memeber-profile-footer"};function kK(e,t,n,r,o,i){var s,u,d,f,g;return Z(),se("div",MK,[$("div",IK,[$("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,CK),$("ul",TK,[$("h1",null,De(((u=e.userInfo)==null?void 0:u.nick)||((d=e.userInfo)==null?void 0:d.userID)),1),$("li",null,[wK,$("span",null,De((f=e.userInfo)==null?void 0:f.userID),1)]),$("li",null,[$("label",null,De(e.$t("TUIContact.个性签名"))+":",1),$("span",null,De((g=e.userInfo)==null?void 0:g.selfSignature),1)])])]),$("div",SK,[e.showEnter()?(Z(),se("div",{key:0,class:"button",onClick:t[0]||(t[0]=v=>{var _;return e.enter((_=e.userInfo)==null?void 0:_.userID,"C2C")})},De(e.$t("TUIContact.发送消息")),1)):Ce("",!0)])])}const DK=Wt(_K,[["render",kK],["__scopeId","data-v-25fa5b68"]]),EK=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=jt({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 bV({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=zy(M=>{g()},500),_=M=>{M.stopPropagation(),M.code==="Enter"&&v(n.keyword)};return{...Kt(n),submit:o,isSelect:s,debouncedRequest:v,onKeyup:_,onSearch:g,onSelectItem:i,onSelectAll:u,handleRoleName:r,handleMemberProfileShow:d}}});const Yf=e=>(mr("data-v-8f0a4ad6"),e=e(),vr(),e),AK={class:"member"},LK={class:"sectionSearch"},OK=Yf(()=>$("span",{class:"icon-search-input"},null,-1)),RK={class:"list"},NK=["onClick"],PK=["src"],xK={class:"name"},UK={key:0,class:"theEmpty",style:{height:"75%"}},FK=Yf(()=>$("img",{class:"emptyImg",src:cd},null,-1)),GK=Yf(()=>$("p",null,"暂无数据",-1)),$K=[FK,GK],BK={class:"footer"},HK={class:"userInfo"},qK=["src"],VK={key:0,class:"maskMute"},zK={class:"selectHeader"},jK={class:"title"},WK={class:"selectContainer"},KK=["onClick"],YK=["src"],JK={class:"name"},XK=Yf(()=>$("i",{class:"icon icon-remove"},null,-1)),ZK={key:0,class:"theEmpty",style:{"margin-top":"20px","margin-bottom":"0"}},QK=Yf(()=>$("img",{class:"emptyImg",src:cd},null,-1)),eY=Yf(()=>$("p",null,"暂无数据",-1)),tY=[QK,eY];function nY(e,t,n,r,o,i){const s=Bt("n-button"),u=Bt("n-input"),d=Bt("n-spin"),f=Bt("n-scrollbar");return Z(),bt(f,{class:"member-section"},{default:Ot(()=>[$("main",AK,[Ct(d,{show:e.muteLoading,stroke:"#198CFE"},{default:Ot(()=>[$("div",LK,[Ct(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:Ot(()=>[OK]),suffix:Ot(()=>[Ct(s,{onClick:t[0]||(t[0]=g=>e.debouncedRequest("")),round:"",color:"#198cfe"},{default:Ot(()=>[Fr("搜索")]),_:1})]),_:1},8,["value","onKeyup"])]),$("ul",RK,[(Z(!0),se(dt,null,Vt(e.list,(g,v)=>(Z(),se("li",{class:"list-item",key:v,onClick:_=>e.onSelectItem(g)},[$("aside",null,[$("i",{class:it(["icon",e.isSelect(g)?"icon-selected":"icon-unselected"])},null,2),$("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,PK),$("span",xK,De((g==null?void 0:g.nickname)||(g==null?void 0:g.userID)),1)])],8,NK))),128)),e.list.length<e.total&&e.total>0&&!e.muteLoading?(Z(),se("li",{key:0,class:"list-item",onClick:t[2]||(t[2]=(...g)=>e.getMore&&e.getMore(...g))},De(e.$t("TUIChat.manage.查看更多")),1)):Ce("",!0)]),!e.muteLoading&&e.list.length<=0?(Z(),se("div",UK,$K)):Ce("",!0)]),_:1},8,["show"])]),$("div",BK,[$("div",{class:"selectUser",onClick:t[3]||(t[3]=(...g)=>e.onSelectAll&&e.onSelectAll(...g))},[$("i",{class:it(["icon",e.isSelectAll?"icon-selected":"icon-unselected"])},null,2),$("span",null,"全选(已选择"+De(e.selectList.length||0)+"):",1)]),$("div",HK,[$("div",{class:"userList",onClick:t[4]||(t[4]=g=>e.showMore=!0)},[(Z(!0),se(dt,null,Vt(e.selectList,(g,v)=>(Z(),se("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,qK))),128))]),$("span",{class:it(["muteBtn",e.selectList.length<=0?"disabled":""]),onClick:t[5]||(t[5]=(...g)=>e.submit&&e.submit(...g))},De(e.currentModel==="not_mute"?"禁言":"解除禁言"),3)])]),e.showMore?(Z(),se("div",VK)):Ce("",!0),$("div",{class:it(["selectListSection",e.showMore?"show":""])},[$("div",zK,[$("i",{class:"icon-close",onClick:t[6]||(t[6]=g=>e.showMore=!1)}),$("span",jK,"已选择 ("+De(e.selectList.length||0)+")",1),$("span",{class:it(["sureBtn",e.selectList.length<=0?"disabled":""]),onClick:t[7]||(t[7]=g=>e.showMore=!1)},"确定",2)]),$("div",WK,[(Z(!0),se(dt,null,Vt(e.selectList,(g,v)=>(Z(),se("div",{class:"list-item",key:v,onClick:_=>e.onSelectItem(g)},[$("aside",null,[$("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,YK),$("span",JK,De((g==null?void 0:g.nickname)||(g==null?void 0:g.userID)),1)]),XK],8,KK))),128)),e.selectList.length<=0?(Z(),se("div",ZK,tY)):Ce("",!0)])],2)]),_:1})}const rY=Wt(EK,[["render",nY],["__scopeId","data-v-8f0a4ad6"]]),oY=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=jt({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{...Kt(n),toggleView:r,submit:o}}});const iY={key:0},sY={class:"dialog-main-content"},aY={key:1};function lY(e,t,n,r,o,i){return e.show?(Z(),se("div",{key:0,class:it(["dialog",[e.isH5?"dialog-h5":"",e.center?"center":""]]),onClick:t[3]||(t[3]=bn((...s)=>e.toggleView&&e.toggleView(...s),["self"]))},[$("main",{class:"dialog-main",style:Ro(!e.background&&{background:"none"})},[e.isHeaderShow?(Z(),se("header",iY,[$("h1",null,De(e.title),1),$("i",{class:"icon icon-close",onClick:t[0]||(t[0]=(...s)=>e.toggleView&&e.toggleView(...s))})])):Ce("",!0),$("div",sY,[Ft(e.$slots,"default",{},void 0,!0)]),e.isFooterShow?(Z(),se("footer",aY,[$("button",{class:"btn btn-cancel",onClick:t[1]||(t[1]=(...s)=>e.toggleView&&e.toggleView(...s))},De(e.$t("component.取消")),1),$("button",{class:"btn btn-default",onClick:t[2]||(t[2]=(...s)=>e.submit&&e.submit(...s))},De(e.$t("component.确定")),1)])):Ce("",!0)],4)],2)):Ce("",!0)}const Ky=Wt(oY,[["render",lY],["__scopeId","data-v-836ac6a7"]]),Fs=ot({components:{MaskTUI:dj,Transfer:QC,Slider:eT,ManageName:Zj,ManageNotification:LW,ManageNotificationDetail:iK,ManageMember:yK,MemeberProfile:DK,ManageMute:rY,DialogTUI:Ky},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 Me;const n=Fs.TUIServer.TUICore.TIM.TYPES,{GroupServer:r}=Fs,{t:o}=Fs.TUIServer.TUICore.config.i18n.useI18n(),i=jt({conversation:{},userInfo:{isGroup:!1,list:[],muteList:[]},isShowMuteTimeInput:!1,editLableName:"",mask:!1,currentTab:"",noticeId:"",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(),d=Ne();nn(()=>{i.conversation=e.conversation,i.userInfo=e.userInfo,i.show=e.show});const f=((Me=window==null?void 0:window.TUIKitTUICore)==null?void 0:Me.isOfficial)&&(A1==null?void 0:A1.useStore())||{},g=Ve(()=>{let K="";switch(i.currentTab){case"notification":K="群公告";break;case"notificationAdd":case"notificationAddDetail":K="新建群公告";break;case"notificationUpdate":case"notificationUpdateDetail":K="编辑群公告";break;case"notificationDetail":K="公告详情";break;case"member":K="群成员";break;case"profile":K="群成员";break;default:K="群管理";break}return K});$t(()=>i.userInfo.list,(K,me)=>{i.member={admin:[],member:[],muteMember:[]},K.map(pe=>{switch(pe==null?void 0:pe.groupRoleType){case"Admin":i.member.admin.push(pe);break;case"Member":i.member.member.push(pe);break}return pe});const ke=new Date().getTime();i.member.muteMember=K.filter(pe=>(pe==null?void 0:pe.muteUntil)*1e3-ke>0)},{deep:!0});const v=Ve(()=>{var te,ie;const{conversation:K}=i,me=(te=K==null?void 0:K.groupProfile)==null?void 0:te.selfInfo.role,ke=(ie=K==null?void 0:K.groupProfile)==null?void 0:ie.type,pe=me===n.GRP_MBR_ROLE_OWNER,W=ke===n.GRP_WORK;return pe&&!W}),_=Ve(()=>{var pe;const{conversation:K}=i;return((pe=K==null?void 0:K.groupProfile)==null?void 0:pe.type)===n.GRP_WORK}),M=Ve(()=>{let K=3;return _.value||(K+=1),i.conversation.groupProfile.selfInfo.role!=="Owner"&&(K+=1),K}),C=Ve(()=>{var W;const{conversation:K}=i,me=(W=K==null?void 0:K.groupProfile)==null?void 0:W.selfInfo.role,ke=me===n.GRP_MBR_ROLE_OWNER,pe=me===n.GRP_MBR_ROLE_ADMIN;return ke||pe}),D=Ve(()=>{var ie,Ie;const{conversation:K}=i,me=(ie=K==null?void 0:K.groupProfile)==null?void 0:ie.type,pe=((Ie=K==null?void 0:K.groupProfile)==null?void 0:Ie.selfInfo.role)===n.GRP_MBR_ROLE_OWNER,W=me===n.GRP_WORK,te=me===n.GRP_AVCHATROOM;return!!(!W&&!te&&pe)}),w=Ve(()=>{var pe;const{conversation:K}=i;return!(((pe=K==null?void 0:K.groupProfile)==null?void 0:pe.type)===n.GRP_WORK||!C.value)}),S=async K=>{var me;try{const{conversation:ke}=i,pe={groupId:(me=ke==null?void 0:ke.groupProfile)==null?void 0:me.groupID,rows:100,page:K&&K==="more"?i.page+1:i.page};await Yk(pe).then(W=>{const te=W.data.rows||[];te.forEach(ie=>{ie.nick=ie.nickname}),K&&K==="more"?i.userInfo.list=[...i.userInfo.list,...te]:i.userInfo.list=te})}catch{}},R=async K=>{var me;i.muteLoading=!0;try{const{conversation:ke}=i,pe={groupId:(me=ke==null?void 0:ke.groupProfile)==null?void 0:me.groupID,rows:100,groupMute:i.currentModel!=="not_mute",groupRoleTypes:["Member"],page:K&&K==="more"?i.mutePage+1:i.mutePage,keyword:i.muteSearch};await Yk(pe).then(W=>{const te=W.data.rows||[];te.forEach(ie=>{ie.nick=ie.nickname}),K&&K==="more"?i.userInfo.muteList=[...i.userInfo.list,...te]:i.userInfo.muteList=te,i.muteTotal=W.data.total||0})}catch{}i.muteLoading=!1},A=async K=>{const{conversation:me}=i,ke=[];K.forEach(pe=>{ke.push({groupId:me.groupProfile.groupID,imUserId:pe})});try{await MV(ke),ve(),S()}catch{}},N=K=>{const{conversation:me}=i,ke={groupID:me.groupProfile.groupID,userIDList:[K.userID]};r.deleteGroupMember(ke)},H=async K=>{console.log(i.conversation.groupProfile,K),await gV({oldOwner:i.conversation.groupProfile.ownerID,groupId:i.conversation.groupProfile.groupID,newOwner:K}),le(),i.conversation.groupProfile={},pi({message:"转交成功",isH5:!1,type:"success"})},z=async K=>{i.quitDialogShow=!0},x=async K=>{i.dimmisDialogShow=!0},B=async K=>{const{conversation:me}=i;let ke="";switch(K.role){case n.GRP_MBR_ROLE_ADMIN:ke=n.GRP_MBR_ROLE_MEMBER;break;case n.GRP_MBR_ROLE_MEMBER:ke=n.GRP_MBR_ROLE_ADMIN;break}const pe={groupID:me.groupProfile.groupID,userID:K.userID,role:ke};await r.setGroupMemberRole(pe),S()},j=async(K,me)=>{var W;const{conversation:ke}=i,pe={groupID:ke.groupProfile.groupID,userID:K,muteTime:me==="add"?60*60*24*30:0};await r.setGroupMemberMuteTime(pe),me==="add"&&(W=window==null?void 0:window.TUIKitTUICore)!=null&&W.isOfficial&&f!=null&&f.commit&&(f==null||f.commit("handleTask",4)),S()},G=async K=>{const{conversation:me}=i,ke={groupID:me.groupProfile.groupID,userIDList:K,reason:""};await r.deleteGroupMember(ke),S()},L=K=>{i.editLableName=K},T=K=>{K==="add"?i.currentTab="notificationAdd":K==="edit"?i.currentTab="notificationUpdate":K==="submit"?i.currentTab="notification":K==="addDetail"?i.currentTab="notificationAddDetail":K==="editDetail"?i.currentTab="notificationUpdateDetail":K==="submitDetail"?i.currentTab="notificationDetail":K==="deleteDetail"&&(i.currentTab="")},P=async K=>{const{key:me,value:ke}=K,pe={groupID:i.conversation.groupProfile.groupID,[me]:ke},W=await r.updateGroupProfile(pe),{conversation:te}=Fs.TUIServer.store;te.groupProfile=W.data.group,Fs.TUIServer.store.conversation={},Fs.TUIServer.store.conversation=te,i.editLableName=""},Q=K=>{var me,ke;if(i.currentTab==="notificationAdd"||i.currentTab==="notificationUpdate"){(me=u.value)==null||me.onCloseEdit(),i.currentTab="notification";return}if(i.currentTab==="notificationAddDetail"||i.currentTab==="notificationUpdateDetail"){(ke=d.value)==null||ke.onCloseEdit(),i.currentTab="notificationDetail";return}K==="onlyMute"&&R(),i.currentTab=K,i.editLableName="",i.currentTab==="member"&&(i.transferType="remove"),i.currentTab||(i.transferType="")},Y=async K=>{var W,te;let me={},ke={};const pe={groupID:i.conversation.groupProfile.groupID,userIDList:[K]};switch(i.transferType){case"add":try{ke=await r.getGroupMemberProfile(pe),i.transferList=i.transferList.filter(ie=>{var Ie;return ie.userID!==((Ie=me.data[0])==null?void 0:Ie.userID)}),i.transferList=[...i.transferList,...me.data],((W=ke==null?void 0:ke.data)==null?void 0:W.memberList.length)>0&&(i.transferList=i.transferList.map(ie=>{var Ie;return ie.userID===((Ie=ke==null?void 0:ke.data)==null?void 0:Ie.memberList[0].userID)&&(ie.isDisabled=!0),ie}))}catch{const Ie=o("TUIChat.manage.该用户不存在");xr(Ie,e)}break;case"remove":try{if(me=await r.getGroupMemberProfile(pe),me.data.memberList.length===0){const ie=o("TUIChat.manage.该用户不在群组内");return xr(ie,e)}i.transferList=i.transferList.filter(ie=>{var Ie,ue;return ie.userID!==((ue=(Ie=me==null?void 0:me.data)==null?void 0:Ie.memberList[0])==null?void 0:ue.userID)}),i.transferList=[...i.transferList,...(te=me==null?void 0:me.data)==null?void 0:te.memberList]}catch{const Ie=o("TUIChat.manage.该用户不存在");xr(Ie,e)}break}},oe=K=>{console.log(K,i.transferType," data.transferType"),!(K.length<=0)&&(i.transferType==="remove"?(i.userList=K,i.delDialogShow=!i.delDialogShow):J(K,i.transferType),i.mask=!1)},X=async()=>{const K=await N5({page:1,rows:999});console.log(K,"lits");const me=K.data.rows||[];return me.forEach(ke=>{ke.nick=ke.friendNickname}),me.filter(ke=>!i.userInfo.list.some(pe=>pe.imUserId===ke.imUserId))},ae=()=>{fe()},fe=async K=>{switch(i.selectedList=[],K){case"add":i.isRadio=!1,i.transferList=await X(),i.transferTitle="添加成员";break;case"remove":i.isRadio=!1,i.transferList=i.userInfo.list.filter(me=>{var ke,pe;return me.userID!==((pe=(ke=i.conversation)==null?void 0:ke.groupProfile)==null?void 0:pe.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(me=>me.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=K,i.mask=!i.mask};Xs(s,()=>{i.show=!1});const le=()=>{if(!r){const K=o("TUIChat.manage.请先注册 TUIGroup 模块");return xr(K,e)}i.show=!i.show,i.show||(i.currentTab=""),i.show&&S()},ce=async K=>{try{await _V({groupId:i.conversation.groupProfile.groupID,muteAll:K}),ve()}catch{}},J=(K,me)=>{const ke=[];switch(K.map(pe=>(ke.push(pe.imUserId),pe)),me){case"add":A(ke);break;case"remove":G(ke);break;case"addAdmin":B(K[0]);break;case"removeAdmin":B(K[0]);break;case"changeOwner":H(ke[0]);break;case"addMute":j(ke[0],"add");break;case"removeMute":j(ke[0],"remove");break;case"quit":yV({id:i.conversation.groupProfile.groupID}).then(()=>{lu.emit("removeGroup",i.conversation.groupProfile.groupID),Fs.TUIServer.deleteConversation(i.conversation.conversationID),Fs.TUIServer.store.conversation={},le()});break;case"dismiss":IV({id:i.conversation.groupProfile.groupID}).then(()=>{lu.emit("removeGroup",i.conversation.groupProfile.groupID),Fs.TUIServer.deleteConversation(i.conversation.conversationID),Fs.TUIServer.store.conversation={},le()}).catch(pe=>{pi({message:pe.message,isH5:!1,type:"error"})});break}},re=async()=>{var K,me;try{const{toClipboard:ke}=B5();await ke((me=(K=i==null?void 0:i.conversation)==null?void 0:K.groupProfile)==null?void 0:me.groupID)}catch(ke){xr(ke,i.env)}},de=K=>{i.currentMember=K,Q("profile")},Oe=async()=>{var K,me,ke,pe;try{const W=await vV({groupId:(me=(K=i==null?void 0:i.conversation)==null?void 0:K.groupProfile)==null?void 0:me.groupID,imUserId:(pe=(ke=i==null?void 0:i.conversation)==null?void 0:ke.groupProfile)==null?void 0:pe.selfInfo.userID});i.currentUserDetail=W.data}catch{}},ve=async()=>{var K,me;try{const pe=(await F5({id:(me=(K=i==null?void 0:i.conversation)==null?void 0:K.groupProfile)==null?void 0:me.groupID})).data;pe.configJson=pe.configJson?JSON.parse(pe.configJson):{},i.groupDetail=pe}catch{}};return $t(()=>i.show,()=>{if(i.show)try{ve(),Oe()}catch{}else i.currentTab=""}),On(()=>{lu.on("handleNotice",K=>{i.show=!i.show,i.noticeId=K,i.currentTab="notificationDetail",i.show&&S()});try{ve(),Oe()}catch{}}),{...Kt(i),isDismissGroupAuth:v,isShowAddMember:_,isSetMuteTime:w,isAdmin:D,isAuth:C,addMember:A,deleteMember:N,changeOwner:H,quit:z,dismiss:x,handleAdmin:B,setMemberMuteTime:j,kickedOut:G,edit:L,onNotificationChangeStatus:T,updateProfile:P,setTab:Q,TabName:g,getMember:S,getUserList:R,handleSearchMember:Y,submit:oe,cancel:ae,toggleMask:fe,toggleShow:le,setAllMuteTime:ce,handleManage:J,showUserNum:M,dialog:s,manageNotificationRef:u,manageNotificationDetailRef:d,handleGroupIDCopy:re,handleMemberProfileShow:de}}});const gl=e=>(mr("data-v-0bb02cc6"),e=e(),vr(),e),uY={class:"manage-header-left"},cY={key:1},dY={key:0},fY={key:1},pY={key:0,class:it(["main"]),style:{"background-color":"#f4f5f9",height:"100%"}},hY={class:"userInfo space-top",style:{"background-color":"#fff"}},gY=gl(()=>$("i",{class:"icon icon-right"},null,-1)),mY=["src"],vY={key:0},yY=gl(()=>$("i",{class:"icon icon-right end"},null,-1)),_Y={key:0,class:"admin-content space-top",style:{"background-color":"#fff","padding-top":"12px","border-top":"1Px solid #f4f5f9"}},bY=gl(()=>$("aside",null,[$("label",null,"学生禁言")],-1)),MY=gl(()=>$("aside",null,[$("label",null,"禁言名单")],-1)),IY=gl(()=>$("i",{class:"icon icon-right end"},null,-1)),CY=[MY,IY],TY=gl(()=>$("aside",null,[$("label",null,"移交群主")],-1)),wY=gl(()=>$("i",{class:"icon icon-right end"},null,-1)),SY=[TY,wY],kY={class:"footer space-top",style:{overflow:"hidden","background-color":"#f4f5f9"}},DY={key:5,class:"admin"},EY={key:0,class:"admin-list"},AY=["src"],LY={key:1,class:"admin-content space-top"},OY={key:2,class:"admin-list last"},RY=["src"],NY={key:0,class:"delDialog-title"},PY={key:1,class:"delDialog-title"},xY=gl(()=>$("p",{class:"delDialog-title"},"是否退出群聊?",-1)),UY=gl(()=>$("p",{class:"delDialog-title"},"是否解散群聊?",-1));function FY(e,t,n,r,o,i){var R,A,N;const s=Bt("n-tab-pane"),u=Bt("n-tabs"),d=Bt("ManageName"),f=Bt("Slider"),g=Bt("ManageMember"),v=Bt("MemeberProfile"),_=Bt("ManageNotification"),M=Bt("ManageNotificationDetail"),C=Bt("ManageMute"),D=Bt("Transfer"),w=Bt("MaskTUI"),S=Bt("DialogTUI");return Z(),se("div",null,[$("i",{class:"icon icon-chat-setting",onClick:t[0]||(t[0]=(...H)=>e.toggleShow&&e.toggleShow(...H))}),e.show?(Z(),se("div",{key:0,class:it(["manage",[e.isH5?"manage-h5":""]]),ref:"dialog"},[$("header",{class:it(["manage-header",e.currentTab==="onlyMute"?"currentModel":""])},[e.isH5&&!e.currentTab?(Z(),se("i",{key:0,class:"icon icon-back",onClick:t[1]||(t[1]=(...H)=>e.toggleShow&&e.toggleShow(...H))})):Ce("",!0),$("aside",uY,[e.currentTab?(Z(),se("i",{key:0,class:"icon icon-back",onClick:t[2]||(t[2]=()=>{e.currentModel="not_mute",e.setTab("")})})):Ce("",!0),e.currentTab!=="onlyMute"?(Z(),se("main",cY,[$("h1",null,[Fr(De(e.TabName),1),e.currentTab==="member"?(Z(),se("span",dY,"("+De(e.groupDetail.memberNum||0)+De(e.$t("TUIChat.manage.人"))+")",1)):Ce("",!0)])])):(Z(),bt(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]=H=>{e.currentModel=H,e.mutePage=1,e.muteSearch="",e.getUserList()})},{default:Ot(()=>[Ct(s,{name:"not_mute",tab:"未禁言"}),Ct(s,{name:"mute",tab:"已禁言"})]),_:1},8,["value"]))]),e.currentTab!=="onlyMute"?(Z(),se("span",fY,[e.isH5?Ce("",!0):(Z(),se("i",{key:0,class:"icon icon-close",onClick:t[4]||(t[4]=(...H)=>e.toggleShow&&e.toggleShow(...H))}))])):Ce("",!0)],2),e.currentTab?e.currentTab==="member"?(Z(),bt(g,{key:1,self:e.conversation.groupProfile.selfInfo,list:e.userInfo.list,total:~~e.conversation.groupProfile.memberCount,onMore:t[13]||(t[13]=H=>e.getMember("more")),onDel:e.submit,onHandleMemberProfileShow:e.handleMemberProfileShow},null,8,["self","list","total","onDel","onHandleMemberProfileShow"])):e.currentTab==="profile"?(Z(),bt(v,{key:2,userInfo:e.currentMember},null,8,["userInfo"])):e.currentTab==="notification"||e.currentTab==="notificationAdd"||e.currentTab==="notificationUpdate"?(Z(),bt(_,{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==="notificationDetail"||e.currentTab==="notificationAddDetail"||e.currentTab==="notificationUpdateDetail"?(Z(),bt(M,{key:4,ref:"manageNotificationDetailRef",noticeId:e.noticeId,isAuth:e.isAuth,data:e.conversation.groupProfile,onChangeStatus:e.onNotificationChangeStatus},null,8,["noticeId","isAuth","data","onChangeStatus"])):e.currentTab==="admin"?(Z(),se("main",DY,[e.isAdmin?(Z(),se("div",EY,[$("label",null,De(e.$t("TUIChat.manage.群管理员")),1),$("ol",null,[(Z(!0),se(dt,null,Vt(e.member.admin,(H,z)=>(Z(),se("dl",{key:z},[$("dt",null,[$("img",{class:"avatar",src:(H==null?void 0:H.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,AY)]),$("dd",null,De((H==null?void 0:H.nick)||(H==null?void 0:H.userID)),1)]))),128)),$("dl",null,[$("dt",{class:"avatar",onClick:t[14]||(t[14]=H=>e.toggleMask("addAdmin"))},"+")]),$("dl",null,[e.member.admin.length>0?(Z(),se("dt",{key:0,class:"avatar",onClick:t[15]||(t[15]=H=>e.toggleMask("removeAdmin"))},"-")):Ce("",!0)])])])):Ce("",!0),e.isSetMuteTime?(Z(),se("div",LY,[$("aside",null,[$("label",null,De(e.$t("TUIChat.manage.学生禁言")),1),$("p",null,De(e.$t("TUIChat.manage.学生禁言开启后,只允许群主和管理员发言。")),1)]),Ct(f,{open:e.conversation.groupProfile.muteAllMembers,onChange:e.setAllMuteTime},null,8,["open","onChange"])])):Ce("",!0),e.isSetMuteTime?(Z(),se("div",OY,[$("label",null,De(e.$t("TUIChat.manage.单独禁言人员")),1),$("ol",null,[(Z(!0),se(dt,null,Vt(e.member.muteMember,(H,z)=>(Z(),se("dl",{key:z},[$("dt",null,[$("img",{class:"avatar",src:(H==null?void 0:H.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)]),$("dd",null,De((H==null?void 0:H.nick)||(H==null?void 0:H.userID)),1)]))),128)),$("dl",null,[$("dt",{class:"avatar",onClick:t[16]||(t[16]=H=>e.toggleMask("addMute"))},"+")]),$("dl",null,[e.member.muteMember.length>0?(Z(),se("dt",{key:0,class:"avatar",onClick:t[17]||(t[17]=H=>e.toggleMask("removeMute"))},"-")):Ce("",!0)])])])):Ce("",!0)])):e.currentTab==="onlyMute"?(Z(),bt(C,{key:6,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]=H=>e.getUserList("more")),onDel:e.submit,onBack:t[19]||(t[19]=()=>{e.setTab(""),e.currentModel="not_mute"}),onSearch:t[20]||(t[20]=H=>{e.mutePage=1,e.muteSearch=H,e.userInfo.muteList=[],e.getUserList()}),onHandleMemberProfileShow:e.handleMemberProfileShow},null,8,["currentModel","total","self","list","conversation","muteLoading","onDel","onHandleMemberProfileShow"])):Ce("",!0):(Z(),se("main",pY,[Ct(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"]),$("div",hY,[$("header",{class:"userInfo-header",onClick:t[5]||(t[5]=H=>e.setTab("member"))},[$("label",null,De(e.$t("TUIChat.manage.群成员")),1),$("p",null,[$("span",null,De(e.groupDetail.memberNum||0)+De(e.$t("TUIChat.manage.人")),1),gY])]),$("ol",null,[(Z(!0),se(dt,null,Vt((A=(R=e.userInfo)==null?void 0:R.list)==null?void 0:A.slice(0,e.showUserNum),(H,z)=>(Z(),se("dl",{key:z},[$("dt",null,[$("img",{class:"avatar",src:(H==null?void 0:H.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png",onerror:"this.src='https://oss.dayaedu.com/news-info/07/1690787574969.png'"},null,8,mY)]),$("dd",null,De((H==null?void 0:H.nickname)||(H==null?void 0:H.userID)),1)]))),128)),e.currentUserDetail.groupRoleType==="Owner"?(Z(),se("dl",vY,[$("dt",{class:"avatar",onClick:t[6]||(t[6]=H=>e.toggleMask("add"))},"+")])):Ce("",!0)])]),$("ul",{class:"content space-top",onClick:t[8]||(t[8]=H=>e.editLableName=""),style:{"background-color":"#fff"}},[$("li",{onClick:t[7]||(t[7]=bn(H=>e.setTab("notification"),["stop"]))},[$("aside",null,[$("label",null,De(e.$t("TUIChat.manage.群公告")),1)]),yY])]),e.currentUserDetail.groupRoleType==="Owner"||e.currentUserDetail.groupRoleType==="Admin"?(Z(),se("div",_Y,[bY,Ct(f,{open:e.groupDetail.configJson.mute,onChange:e.setAllMuteTime},null,8,["open","onChange"])])):Ce("",!0),e.currentUserDetail.groupRoleType==="Owner"||e.currentUserDetail.groupRoleType==="Admin"?(Z(),se("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"]))},CY)):Ce("",!0),e.currentUserDetail.groupRoleType==="Owner"&&((N=e.userInfo)==null?void 0:N.list.length)>1?(Z(),se("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(H=>e.toggleMask("changeOwner"),["stop"]))},SY)):Ce("",!0),$("ul",kY,[e.currentUserDetail.groupRoleType==="Owner"?(Z(),se("li",{key:0,onClick:t[11]||(t[11]=bn(H=>e.dismiss(e.conversation.groupProfile),["stop"]))},"解散群聊")):(Z(),se("li",{key:1,onClick:t[12]||(t[12]=bn(H=>e.quit(e.conversation.groupProfile),["stop"]))},"退出群组"))])])),Ct(w,{show:e.mask,"onUpdate:show":t[21]||(t[21]=H=>e.mask=H)},{default:Ot(()=>[Ct(D,{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"]),Ct(S,{title:e.$t("TUIChat.manage.删除成员"),show:e.delDialogShow,isH5:e.isH5,center:!0,isHeaderShow:!e.isH5,onSubmit:t[22]||(t[22]=H=>e.handleManage(e.userList,"remove")),"onUpdate:show":t[23]||(t[23]=H=>e.delDialogShow=H)},{default:Ot(()=>[e.userList.length===1?(Z(),se("p",NY,De(e.$t("TUIChat.manage.确定从群聊中删除该成员?")),1)):Ce("",!0),e.userList.length>1?(Z(),se("p",PY,De(e.$t("TUIChat.manage.确定从群聊中删除所选成员?")),1)):Ce("",!0)]),_:1},8,["title","show","isH5","isHeaderShow"]),Ct(S,{title:"退出群聊",show:e.quitDialogShow,isH5:e.isH5,center:!0,isHeaderShow:!e.isH5,onSubmit:t[24]||(t[24]=H=>e.handleManage([],"quit")),"onUpdate:show":t[25]||(t[25]=H=>e.quitDialogShow=H)},{default:Ot(()=>[xY]),_:1},8,["show","isH5","isHeaderShow"]),Ct(S,{title:"解散群聊",show:e.dimmisDialogShow,isH5:e.isH5,center:!0,isHeaderShow:!e.isH5,onSubmit:t[26]||(t[26]=H=>e.handleManage([],"dismiss")),"onUpdate:show":t[27]||(t[27]=H=>e.dimmisDialogShow=H)},{default:Ot(()=>[UY]),_:1},8,["show","isH5","isHeaderShow"])],2)):Ce("",!0)])}const ul=Wt(Fs,[["render",FY],["__scopeId","data-v-0bb02cc6"]]),GY={class:"message-item"},$Y=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=ul==null?void 0:ul.TUIServer;Ne(!1),Ne([]);const{message:o,types:i,env:s,messageList:u,displayGroupMessageReadReceipt:d,displayEmojiReactions:f}=Kt(n);On(async()=>{var R,A,N,H,z,x,B,j,G,L,T,P,Q,Y,oe,X;if((A=(R=n.message)==null?void 0:R.payload)!=null&&A.operatorID&&((H=(N=n.message)==null?void 0:N.payload)==null?void 0:H.operatorID.indexOf("KT"))!=-1){const ae=await r.getUserProfile([(x=(z=n.message)==null?void 0:z.payload)==null?void 0:x.operatorID]);if(console.log(ae,"operatorInfo"),o.value.payload.operatorID=(B=ae.data[0])==null?void 0:B.nick,(L=(G=(j=n.message)==null?void 0:j.payload)==null?void 0:G.newGroupProfile)!=null&&L.ownerID){const fe=await r.getUserProfile([(Q=(P=(T=n.message)==null?void 0:T.payload)==null?void 0:P.newGroupProfile)==null?void 0:Q.ownerID]);o.value.payload.newGroupProfile.ownerID=(Y=fe.data[0])==null?void 0:Y.nick}}else((X=(oe=n.message)==null?void 0:oe.payload)==null?void 0:X.operatorID)==="mec_admin"&&(o.value.payload.operatorID="")});const g=R=>{t("handleEditor",R,"reedit")},v=(R,A)=>{if(!(!R||!A))switch(A){case cn.handleMessage.forward:t("showDialog",R,cn.handleMessage.forward);break;case cn.handleMessage.reference:t("handleEditor",R,cn.handleMessage.reference);break;case cn.handleMessage.reply:t("handleEditor",R,cn.handleMessage.reply);break}},_=R=>{R&&t("showDialog",R,"previewImage")},M=R=>{R&&t("showDialog",R,"receipt")},C=R=>{R&&t("showDialog",R,"replies")},D=R=>{R&&t("jumpID",R)},w=()=>{t("uploading")},S=R=>{R&&t("resendMessage",R)};return(R,A)=>(Z(),se("div",GY,[Le(FO)(Le(o))?(Z(),bt(WV,{key:0,data:Le(S$)(Le(o))},null,8,["data"])):Le(o).isRevoked?(Z(),bt($z,{key:2,isEdit:Le(o).type===Le(i).MSG_TEXT,data:Le(o),onEdit:A[0]||(A[0]=N=>g(Le(o)))},null,8,["isEdit","data"])):(Z(),bt(Nz,{key:1,data:Le(o),isH5:Le(s).isH5,messagesList:Le(u),needGroupReceipt:Le(d),needReplies:!0,needEmojiReact:Le(f),onJumpID:D,onResendMessage:S,onShowReadReceiptDialog:M,onShowRepliesDialog:C},{dialog:Ot(()=>[Ct(lj,{message:Le(o),needEmojiReact:Le(f),onHandleMessage:v},null,8,["message","needEmojiReact"])]),default:Ot(()=>[Le(o).type===Le(i).MSG_TEXT?(Z(),bt($O,{key:0,data:Le(OO)(Le(o))},null,8,["data"])):Ce("",!0),Le(o).type===Le(i).MSG_IMAGE?(Z(),bt(X$,{key:1,isH5:Le(s).isH5,data:Le(NO)(Le(o)),onUploading:w,onPreviewImage:_},null,8,["isH5","data"])):Ce("",!0),Le(o).type===Le(i).MSG_VIDEO?(Z(),bt(a9,{key:2,isH5:Le(s).isH5,data:Le(PO)(Le(o)),onUploading:w},null,8,["isH5","data"])):Ce("",!0),Le(o).type===Le(i).MSG_AUDIO?(Z(),bt(d9,{key:3,data:Le(E$)(Le(o))},null,8,["data"])):Ce("",!0),Le(o).type===Le(i).MSG_FILE?(Z(),bt(b9,{key:4,data:Le(xO)(Le(o))},null,8,["data"])):Ce("",!0),Le(o).type===Le(i).MSG_FACE?(Z(),bt(w9,{key:5,data:Le(RO)(Le(o)),isH5:Le(s).isH5},null,8,["data","isH5"])):Ce("",!0),Le(o).type===Le(i).MSG_LOCATION?(Z(),bt(L9,{key:6,data:Le(D$)(Le(o))},null,8,["data"])):Ce("",!0),Le(o).type===Le(i).MSG_CUSTOM?(Z(),bt(qV,{key:7,data:Le(UO)(Le(o))},null,8,["data"])):Ce("",!0),Le(o).type===Le(i).MSG_MERGER?(Z(),bt(P9,{key:8,data:Le(A$)(Le(o))},null,8,["data"])):Ce("",!0)]),_:1},8,["data","isH5","messagesList","needGroupReceipt","needEmojiReact"]))]))}});const BY=Wt($Y,[["__scopeId","data-v-022159b3"]]),HY=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}=Kt(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,R=M-D.getTime();function A(N){return N<10?"0"+N:N.toString()}if(R<=0)return`${A(D.getHours())}:${A(D.getMinutes())}`;if(R<=w)return`${n("time.昨天")} ${A(D.getHours())}:${A(D.getMinutes())}`;if(R<=S-w){const H=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][D.getDay()];return`${n("time."+H)} ${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((Z(),se("div",{class:"message-timestamp"},De(s.value),513)),[[eo,i.value]])}});const qY=Wt(HY,[["__scopeId","data-v-9b177b8a"]]),q5={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 Vo(e){this.content=e}Vo.prototype={constructor:Vo,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return o==-1?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new Vo(i)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Vo(n)},addToStart:function(e,t){return new Vo([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Vo(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(i==-1?o.length:i,0,t,n),new Vo(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Vo.from(e),e.size?new Vo(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Vo.from(e),e.size?new Vo(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Vo.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Vo.from=function(e){if(e instanceof Vo)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Vo(t)};function V5(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=V5(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function z5(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(;f<g&&s.text[s.text.length-f-1]==u.text[u.text.length-f-1];)f++,n--,r--;return{a:n,b:r}}if(s.content.size||u.content.size){let f=z5(s.content,u.content,n-1,r-1);if(f)return f}n-=d,r-=d}}class pt{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,o=0,i){for(let s=0,u=0;u<n;s++){let d=this.content[s],f=u+d.nodeSize;if(f>t&&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);i<t.content.length;i++)o.push(t.content[i]);return new pt(o,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],o=0;if(n>t)for(let i=0,s=0;s<n;i++){let u=this.content[i],d=s+u.nodeSize;d>t&&((s<t||d>n)&&(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;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];t(o,r,n),r+=o.nodeSize}}findDiffStart(t,n=0){return V5(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return z5(this,t,n,r)}findIndex(t,n=-1){if(t==0)return Cm(0,t);if(t==this.size)return Cm(this.content.length,t);if(t>this.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;o<t.length;o++){let i=t[o];r+=i.nodeSize,o&&i.isText&&t[o-1].sameMarkup(i)?(n||(n=t.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new pt(n||t,r)}static from(t){if(!t)return pt.empty;if(t instanceof pt)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new pt([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}pt.empty=new pt([],0);const q1={index:0,offset:0};function Cm(e,t){return q1.index=e,q1.offset=t,q1}function Gv(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Gv(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Gv(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let ur=class VM{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let o=0;o<t.length;o++){let i=t[o];if(this.eq(i))return t;if(this.type.excludes(i.type))n||(n=t.slice(0,o));else{if(i.type.excludes(this.type))return t;!r&&i.type.rank>this.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;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Gv(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return VM.none;if(t instanceof VM)return[t];let n=t.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};ur.none=[];class $v 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=W5(this.content,t+this.openStart,n);return r&&new Lt(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Lt(j5(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 j5(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(j5(i.content,t-o-1,n-o-1)))}function W5(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=W5(s.content,t-i-1,n);return u&&e.replaceChild(o,s.copy(u))}function VY(e,t,n){if(n.openStart>e.depth)throw new $v("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new $v("Inconsistent open depths");return K5(e,t,n,0)}function K5(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=K5(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,u=s.content;return Bc(s,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}else{let{start:s,end:u}=zY(n,e);return Bc(i,J5(e,s,u,t,r))}else return Bc(i,Bv(e,t,r))}function Y5(e,t){if(!t.type.compatibleContent(e.type))throw new $v("Cannot join "+t.type.name+" onto "+e.type.name)}function zM(e,t,n){let r=e.node(n);return Y5(r,t.node(n)),r}function $c(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function hh(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&&($c(e.nodeAfter,r),i++));for(let u=i;u<s;u++)$c(o.child(u),r);t&&t.depth==n&&t.textOffset&&$c(t.nodeBefore,r)}function Bc(e,t){return e.type.checkContent(t),e.copy(t)}function J5(e,t,n,r,o){let i=e.depth>o&&zM(e,t,o+1),s=r.depth>o&&zM(n,r,o+1),u=[];return hh(null,e,o,u),i&&s&&t.index(o)==n.index(o)?(Y5(i,s),$c(Bc(i,J5(e,t,n,r,o+1)),u)):(i&&$c(Bc(i,Bv(e,t,o+1)),u),hh(t,n,o,u),s&&$c(Bc(s,Bv(n,r,o+1)),u)),hh(r,null,o,u),new pt(u)}function Bv(e,t,n){let r=[];if(hh(null,e,n,r),e.depth>n){let o=zM(e,t,n+1);$c(Bc(o,Bv(e,t,n+1)),r)}return hh(t,null,n,r),new pt(r)}function zY(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;i<t;i++)o+=r.child(i).nodeSize;return o}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return ur.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),o=t.maybeChild(n);if(!r){let u=r;r=o,o=u}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=t.parent.maybeChild(t.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Hv(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<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=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;o<V1.length;o++){let i=V1[o];if(i.pos==n&&i.doc==t)return i}let r=V1[z1]=Jh.resolve(t,n);return z1=(z1+1)%jY,r}}let V1=[],z1=0,jY=12;class Hv{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const WY=Object.create(null);let Hc=class jM{constructor(t,n,r,o=ur.none){this.type=t,this.attrs=n,this.marks=o,this.content=r||pt.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,o=0){this.content.nodesBetween(t,n,r,o,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,o){return this.content.textBetween(t,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Gv(this.attrs,n||t.defaultAttrs||WY)&&ur.sameSet(this.marks,r||ur.none)}copy(t=null){return t==this.content?this:new jM(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new jM(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Lt.empty;let o=this.resolve(t),i=this.resolve(n),s=r?0:o.sharedDepth(n),u=o.start(s),f=o.node(s).content.cut(o.pos-u,i.pos-u);return new Lt(f,o.depth-s,i.depth-s)}replace(t,n,r){return VY(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(o==t||n.isText)return n;t-=o+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(t){return Jh.resolveCached(this,t)}resolveNoCache(t){return Jh.resolve(this,t)}rangeHasMark(t,n,r){let o=!1;return n>t&&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()+")"),X5(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;d<i;d++)if(!this.type.allowsMarks(r.child(d).marks))return!1;return!0}canReplaceWith(t,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(t).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=ur.none;for(let n=0;n<this.marks.length;n++)t=this.marks[n].addToSet(t);if(!ur.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.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)}};Hc.prototype.text=void 0;class qv extends Hc{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):X5(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 qv(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new qv(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 X5(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class ed{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new KY(t,n);if(r.next==null)return ed.empty;let o=Z5(r);r.next&&r.err("Unexpected trailing text");let i=tJ(eJ(o));return nJ(i,r),i}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(t.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let o=[this];function i(s,u){let d=s.matchFragment(t,r);if(d&&(!n||d.validEnd))return pt.from(u.map(f=>f.createAndFill()));for(let f=0;f<s.next.length;f++){let{type:g,next:v}=s.next[f];if(!(g.isText||g.hasRequiredAttrs())&&o.indexOf(v)==-1){o.push(v);let _=i(v,u.concat(g));if(_)return _}}return null}return i(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(t)){let s=[];for(let u=o;u.type;u=u.via)s.push(u.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:u,next:d}=i.next[s];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in n)&&(!o.type||d.validEnd)&&(r.push({match:u.contentMatch,type:u,via:o}),n[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=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<r.next.length;o++)t.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),t.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return i}).join(`
- `)}}ed.empty=new ed(!0);class KY{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 Z5(e){let t=[];do t.push(YY(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function YY(e){let t=[];do t.push(JY(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function JY(e){let t=QY(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=XY(e,t);else break;return t}function Jk(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function XY(e,t){let n=Jk(e),r=n;return e.eat(",")&&(e.next!="}"?r=Jk(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function ZY(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 QY(e){if(e.eat("(")){let t=Z5(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=ZY(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 eJ(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<s.min;f++){let g=n();o(i(s.expr,d),g),d=g}if(s.max==-1)o(i(s.expr,d),d);else for(let f=s.min;f<s.max;f++){let g=n();r(d,g),o(i(s.expr,d),g),d=g}return[r(d)]}else{if(s.type=="name")return[r(u,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Q5(e,t){return t-e}function Xk(e,t){let n=[];return r(t),n.sort(Q5);function r(o){let i=e[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:u,to:d}=i[s];!u&&n.indexOf(d)==-1&&r(d)}}}function tJ(e){let t=Object.create(null);return n(Xk(e,0));function n(r){let o=[];r.forEach(s=>{e[s].forEach(({term:u,to:d})=>{if(!u)return;let f;for(let g=0;g<o.length;g++)o[g][0]==u&&(f=o[g][1]);Xk(e,d).forEach(g=>{f||o.push([u,f=[]]),f.indexOf(g)==-1&&f.push(g)})})});let i=t[r.join(",")]=new ed(r.indexOf(e.length-1)>-1);for(let s=0;s<o.length;s++){let u=o[s][1].sort(Q5);i.next.push({type:o[s][0],next:t[u.join(",")]||n(u)})}return i}}function nJ(e,t){for(let n=0,r=[e];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let u=0;u<o.next.length;u++){let{type:d,next:f}=o.next[u];s.push(d.name),i&&!(d.isText||d.hasRequiredAttrs())&&(i=!1),r.indexOf(f)==-1&&r.push(f)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function eR(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function tR(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(o===void 0){let i=e[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function nR(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new rJ(e[n]);return t}let Zk=class rR{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=nR(r.attrs),this.defaultAttrs=eR(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ed.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:tR(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Hc(this,this.computeAttrs(t),pt.from(n),ur.setFrom(r))}createChecked(t=null,n,r){return n=pt.from(n),this.checkContent(n),new Hc(this,this.computeAttrs(t),n,ur.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=pt.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(pt.empty,!0);return i?new Hc(this,t,n.append(i),ur.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:ur.none:t}static compile(t,n){let r=Object.create(null);t.forEach((i,s)=>r[i]=new rR(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 rJ{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Yy{constructor(t,n,r,o){this.name=t,this.rank=n,this.schema=r,this.spec=o,this.attrs=nR(o.attrs),this.excluded=null;let i=eR(this.attrs);this.instance=i?new ur(this,i):null}create(t=null){return!t&&this.instance?this.instance:new ur(this,tR(this.attrs,t))}static compile(t,n){let r=Object.create(null),o=0;return t.forEach((i,s)=>r[i]=new Yy(i,o++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class oJ{constructor(t){this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=Vo.from(t.nodes),n.marks=Vo.from(t.marks||{}),this.nodes=Zk.compile(this.spec.nodes,this),this.marks=Yy.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]=ed.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=u=="_"?null:u?Qk(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==""?[]:Qk(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 Zk){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 qv(r,r.defaultAttrs,t,ur.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return Hc.fromJSON(this,t)}markFromJSON(t){return ur.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function Qk(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let u in e.marks){let d=e.marks[u];(o=="_"||d.spec.group&&d.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=d)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Ef{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 t2(this,n,!1);return r.addAll(t,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new t2(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;o<this.tags.length;o++){let i=this.tags[o];if(aJ(t,i.tag)&&(i.namespace===void 0||t.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(t);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(t,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],u=s.style;if(!(u.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||u.length>t.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<n.length;s++){let u=n[s];if((u.priority==null?50:u.priority)<i)break}n.splice(s,0,o)}for(let o in t.marks){let i=t.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=n2(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=n2(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Ef(t,Ef.schemaRules(t)))}}const oR={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},iJ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},iR={ol:!0,ul:!0},Vv=1,zv=2,gh=4;function e2(e,t,n){return t!=null?(t?Vv:0)|(t==="full"?zv:0):e&&e.whitespace=="pre"?Vv|zv:n&~gh}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=ur.none,this.stashMarks=[],this.match=s||(u&gh?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&Vv)){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;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):uJ(o.type,t))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!oR.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class t2{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=e2(null,n.preserveWhitespace,0)|(r?gh:0);o?i=new Tm(o.type,o.attrs,ur.none,ur.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Tm(null,null,ur.none,ur.none,!0,null,s):i=new Tm(t.schema.topNodeType,null,ur.none,ur.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){t.nodeType==3?this.addTextNode(t):t.nodeType==1&&this.addElement(t)}withStyleRules(t,n){let r=t.getAttribute("style");if(!r)return n();let o=this.readStyles(lJ(r));if(!o)return;let[i,s]=o,u=this.top;for(let d=0;d<s.length;d++)this.removePendingMark(s[d],u);for(let d=0;d<i.length;d++)this.addPendingMark(i[d]);n();for(let d=0;d<i.length;d++)this.removePendingMark(i[d],u);for(let d=0;d<s.length;d++)this.addPendingMark(s[d])}addTextNode(t){let n=t.nodeValue,r=this.top;if(r.options&zv||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Vv)r.options&zv?n=n.replace(/\r\n?/g,`
- `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],i=t.previousSibling;(!o||i&&i.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),o;iR.hasOwnProperty(r)&&this.parser.normalizeLists&&sJ(t);let i=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,n));if(i?i.ignore:iJ.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(t=i.skip);let s,u=this.top,d=this.needsBlock;if(oR.hasOwnProperty(r))u.content.length&&u.content[0].isInline&&this.open&&(this.open--,u=this.top),s=!0,u.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}i&&i.skip?this.addAll(t):this.withStyleRules(t,()=>this.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=ur.none,r=ur.none;for(let o=0;o<t.length;o+=2)for(let i=void 0;;){let s=this.parser.matchStyle(t[o],t[o+1],this,i);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(u=>{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;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let o=0;o<t.marks.length;o++)(!n.type||n.type.allowsMarkType(t.marks[o].type))&&(r=t.marks[o].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let o=this.findPlace(t.create(n));return o&&this.enterInner(t,n,!0,r),o}enterInner(t,n=null,r=!1,o){this.closeExtra();let i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t);let s=e2(t,o,i.options);i.options&gh&&i.content.length==0&&(s|=gh),this.nodes.push(new Tm(t,n,i.activeMarks,i.pendingMarks,r,null,s)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.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<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&t.nodeType==1&&t.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-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=cJ(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 sJ(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&iR.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function aJ(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function lJ(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 n2(e){let t={};for(let n in e)t[n]=e[n];return t}function uJ(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<u.edgeCount;d++){let{type:f,next:g}=u.edge(d);if(f==t||i.indexOf(g)<0&&s(g))return!0}};if(s(o.contentMatch))return!0}}function cJ(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}class Ma{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=j1(n).createDocumentFragment());let o=r,i=[];return t.forEach(s=>{if(i.length||s.marks.length){let u=0,d=0;for(;u<i.length&&d<s.marks.length;){let f=s.marks[d];if(!this.marks[f.type.name]){d++;continue}if(!f.eq(i[u][0])||f.type.spec.spanning===!1)break;u++,d++}for(;u<i.length;)o=i.pop()[1];for(;d<s.marks.length;){let f=s.marks[d++],g=this.serializeMark(f,s.isInline,n);g&&(i.push([f,o]),o.appendChild(g.dom),o=g.contentDOM||g.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:o}=Ma.renderSpec(j1(n),this.nodes[t.type.name](t));if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,o)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let o=t.marks.length-1;o>=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&&Ma.renderSpec(j1(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;g<n.length;g++){let v=n[g];if(v===0){if(g<n.length-1||g>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:_,contentDOM:M}=Ma.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 Ma(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=r2(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return r2(t.marks)}}function r2(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function j1(e){return e.document||window.document}const sR=65535,aR=Math.pow(2,16);function dJ(e,t){return e+t*aR}function o2(e){return e&sR}function fJ(e){return(e-(e&sR))/aR}const lR=1,uR=2,rv=4,cR=8;class WM{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&cR)>0}get deletedBefore(){return(this.delInfo&(lR|rv))>0}get deletedAfter(){return(this.delInfo&(uR|rv))>0}get deletedAcross(){return(this.delInfo&rv)>0}}class Ts{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Ts.empty)return Ts.empty}recover(t){let n=0,r=o2(t);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+fJ(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let d=this.ranges[u]-(this.inverted?o:0);if(d>t)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:dJ(u/3,t-d),D=t==d?uR:t==v?lR:rv;return(n<0?t!=d:t!=v)&&(D|=cR),new WM(M,D,C)}o+=g-f}return r?t+o:new WM(t+o,0,null)}touches(t,n){let r=0,o=o2(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let d=this.ranges[u]-(this.inverted?r:0);if(d>t)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<this.ranges.length;o+=3){let s=this.ranges[o],u=s-(this.inverted?i:0),d=s+(this.inverted?0:i),f=this.ranges[o+n],g=this.ranges[o+r];t(u,u+f,d,d+g),i+=g-f}}invert(){return new Ts(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Ts.empty:new Ts(t<0?[0,-t,0]:[0,0,t])}}Ts.empty=new Ts([]);class mh{constructor(t=[],n,r=0,o=t.length){this.maps=t,this.mirror=n,this.from=r,this.to=o}slice(t=0,n=this.maps.length){return new mh(this.maps,this.mirror,t,n)}copy(){return new mh(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,n){this.to=this.maps.push(t),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(t){for(let n=0,r=this.maps.length;n<t.maps.length;n++){let o=t.getMirror(n);this.appendMap(t.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this.maps.length+t.maps.length;n>=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 mh;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this.maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],u=s.mapResult(t,n);if(u.recover!=null){let d=this.getMirror(i);if(d!=null&&d>i&&d<this.to){i=d,t=this.maps[d].recover(u.recover);continue}}o|=u.delInfo,t=u.pos}return r?t:new WM(t,o,null)}}const W1=Object.create(null);class Ji{getMap(){return Ts.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=W1[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in W1)throw new RangeError("Duplicate use of step JSON ID "+t);return W1[t]=n,n.prototype.jsonID=t,n}}class _o{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new _o(t,null)}static fail(t){return new _o(null,t)}static fromReplace(t,n,r,o){try{return _o.ok(t.replace(n,r,o))}catch(i){if(i instanceof $v)return _o.fail(i.message);throw i}}}function tT(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(tT(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return pt.fromArray(r)}class Wl extends Ji{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=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new Lt(tT(n.content,(s,u)=>!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 Ia(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 Wl(n.pos,r.pos,this.mark)}merge(t){return t instanceof Wl&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Wl(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 Wl(n.from,n.to,t.markFromJSON(n.mark))}}Ji.jsonID("addMark",Wl);class Ia extends Ji{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(tT(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 Wl(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 Ia(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ia&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ia(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 Ia(n.from,n.to,t.markFromJSON(n.mark))}}Ji.jsonID("removeMark",Ia);class Kl extends Ji{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;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Kl(this.pos,n.marks[o]);return new Kl(this.pos,this.mark)}}return new Af(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Kl(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Kl(n.pos,t.markFromJSON(n.mark))}}Ji.jsonID("addNodeMark",Kl);class Af extends Ji{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.removeFromSet(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);return!n||!this.mark.isInSet(n.marks)?this:new Kl(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Af(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Af(n.pos,t.markFromJSON(n.mark))}}Ji.jsonID("removeNodeMark",Af);class jo extends Ji{constructor(t,n,r,o=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=o}apply(t){return this.structure&&KM(t,this.from,this.to)?_o.fail("Structure replace would overwrite content"):_o.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ts([this.from,this.to-this.from,this.slice.size])}invert(t){return new jo(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new jo(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof jo)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Lt.empty:new Lt(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new jo(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Lt.empty:new Lt(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new jo(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};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")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new jo(n.from,n.to,Lt.fromJSON(t,n.slice),!!n.structure)}}Ji.jsonID("replace",jo);class Uo extends Ji{constructor(t,n,r,o,i,s,u=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=u}apply(t){if(this.structure&&(KM(t,this.from,this.gapFrom)||KM(t,this.gapTo,this.to)))return _o.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return _o.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?_o.fromReplace(t,this.from,this.to,r):_o.fail("Content does not fit in gap")}getMap(){return new Ts([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Uo(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new Uo(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 Uo(n.from,n.to,n.gapFrom,n.gapTo,Lt.fromJSON(t,n.slice),n.insert,!!n.structure)}}Ji.jsonID("replaceAround",Uo);function KM(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 pJ(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;D<v.length;D++)v[D].isInSet(C)||(s&&s.to==_&&s.mark.eq(v[D])?s.to=M:o.push(s=new Ia(_,M,v[D])));u&&u.to==_?u.to=M:i.push(u=new Wl(_,M,r))}}),o.forEach(d=>e.step(d)),i.forEach(d=>e.step(d))}function hJ(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 Yy){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;g<d.length;g++){let v=d[g],_;for(let M=0;M<o.length;M++){let C=o[M];C.step==i-1&&v.eq(o[M].style)&&(_=C)}_?(_.to=f,_.step=i):o.push({style:v,from:Math.max(u,t),to:f,step:i})}}}),o.forEach(s=>e.step(new Ia(s.from,s.to,s.style)))}function gJ(e,t,n,r=n.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let u=0;u<o.childCount;u++){let d=o.child(u),f=s+d.nodeSize,g=r.matchType(d.type);if(!g)i.push(new jo(s,f,Lt.empty));else{r=g;for(let v=0;v<d.marks.length;v++)n.allowsMarkType(d.marks[v].type)||e.step(new Ia(s,f,d.marks[v]));if(d.isText&&!n.spec.code){let v,_=/\r?\n|\r/g,M;for(;v=_.exec(d.text);)M||(M=new Lt(pt.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),i.push(new jo(s+v.index,s+v.index+v[0].length,M))}}s=f}if(!r.validEnd){let u=r.fillBefore(pt.empty,!0);e.replace(s,s,new Lt(u,0,0))}for(let u=i.length-1;u>=0;u--)e.step(i[u])}function mJ(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Jf(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(r<e.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!mJ(o,i,s))break}return null}function vJ(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),u=o.after(i+1),d=s,f=u,g=pt.empty,v=0;for(let C=i,D=!1;C>n;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)<o.end(C)?(D=!0,_=pt.from(o.node(C).copy(_)),M++):f++;e.step(new Uo(d,f,s,u,new Lt(g.append(_),v,M),g.size-v,!0))}function dR(e,t,n=null,r=e){let o=yJ(e,t),i=o&&_J(r,t);return i?o.map(i2).concat({type:t,attrs:n}).concat(i.map(i2)):null}function i2(e){return{type:e,attrs:null}}function yJ(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}function _J(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let d=(s.length?s[s.length-1]:t).contentMatch;for(let f=r;d&&f<o;f++)d=d.matchType(n.child(f).type);return!d||!d.validEnd?null:s}function bJ(e,t,n){let r=pt.empty;for(let s=n.length-1;s>=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 Uo(o,i,o,i,new Lt(r,0,0),n.length,!0))}function MJ(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)&&IJ(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 Uo(f,g,f+1,g-1,new Lt(pt.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function IJ(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function CJ(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 Uo(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Lt(pt.from(s),0,0),1,!0))}function ff(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 TJ(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 jo(t,t,new Lt(i.append(s),n,n),!0))}function dd(e,t){let n=e.resolve(t),r=n.index();return fR(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function fR(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function pR(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&&fR(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 wJ(e,t,n){let r=new jo(t-n,t+n,Lt.empty,!0);e.step(r)}function SJ(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<r.node(o).childCount)return null}return null}function kJ(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=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 nT(e,t,n=t,r=Lt.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return hR(o,i,r)?new jo(t,n,r):new DJ(o,i,r).fit()}function hR(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class DJ{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 Uo(r.pos,t,this.$to.pos,this.$to.end(),d,n):d.size||r.pos!=this.$to.pos?new jo(r.pos,o.pos,d):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<t;r++){let i=n.firstChild;if(n.childCount>1&&(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=K1(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=K1(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=K1(t,n);if(o.childCount<=1&&n>0){let i=t.size-n<=n+o.size;this.unplaced=new Lt(Jp(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new Lt(Jp(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;D<i.length;D++)this.openFrontierNode(i[D]);let s=this.unplaced,u=r?r.content:s.content,d=s.openStart-t,f=0,g=[],{match:v,type:_}=this.frontier[n];if(o){for(let D=0;D<o.childCount;D++)g.push(o.child(D));v=v.matchFragment(o)}let M=u.size+t-(s.content.size-s.openEnd);for(;f<u.childCount;){let D=u.child(f),w=v.matchType(D.type);if(!w)break;f++,(f>1||d==0||D.content.size)&&(v=w,g.push(gR(D.mark(_.allowedMarks(D.marks)),f==1?d:0,f==u.childCount?M:-1)))}let C=f==u.childCount;C||(M=-1),this.placed=Xp(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;D<M;D++){let S=w.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),w=S.content}this.unplaced=C?t==0?Lt.empty:new Lt(Jp(s.content,t-1,1),t-1,M<0?s.openEnd:t-1):new Lt(Jp(s.content,t,f),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Y1(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&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<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=Y1(t,n,o,r,i);if(s){for(let u=n-1;u>=0;u--){let{match:d,type:f}=this.frontier[u],g=Y1(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=Xp(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=Xp(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=Xp(this.placed,this.frontier.length,n))}}function Jp(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Jp(e.firstChild.content,t-1,n)))}function Xp(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Xp(e.lastChild.content,t-1,n)))}function K1(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function gR(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,gR(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 Y1(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&&!EJ(n,i.content,s)?u:null}function EJ(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function AJ(e){return e.spec.defining||e.spec.definingForContent}function LJ(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(hR(o,i,r))return e.step(new jo(t,n,r));let s=vR(o,e.doc.resolve(n));s[s.length-1]==0&&s.pop();let u=-(o.depth+1);s.unshift(u);for(let _=o.depth,M=o.pos-1;_>0;_--,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=AJ(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<s.length;D++){let w=s[(D+d)%s.length],S=!0;w<0&&(S=!1,w=-w);let R=o.node(w-1),A=o.index(w-1);if(R.canReplaceWith(A,A,C.type,C.marks))return e.replace(o.before(w),S?i.after(w):n,new Lt(mR(r.content,0,r.openStart,M),M,r.openEnd))}}let v=e.steps.length;for(let _=s.length-1;_>=0&&(e.replace(t,n,r),!(e.steps.length>v));_--){let M=s[_];M<0||(t=o.before(M),n=i.after(M))}}function mR(e,t,n,r,o){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(mR(i.content,t+1,n,r,i)))}if(t>r){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(pt.empty,!0))}return e}function OJ(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=SJ(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=vR(r,o);for(let s=0;s<i.length;s++){let u=i[s],d=s==i.length-1;if(d&&u==0||r.node(u).type.contentMatch.validEnd)return e.delete(r.start(u),o.end(u));if(u>0&&(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 vR(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let i=e.start(o);if(i<e.pos-(e.depth-o)||t.end(o)>t.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 pf extends Ji{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 Ts.empty}invert(t){return new pf(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 pf(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 pf(n.pos,n.attr,n.value)}}Ji.jsonID("attr",pf);let Lf=class extends Error{};Lf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Lf.prototype=Object.create(Error.prototype);Lf.prototype.constructor=Lf;Lf.prototype.name="TransformError";class NJ{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new mh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Lf(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=nT(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 LJ(this,t,n,r),this}replaceRangeWith(t,n,r){return OJ(this,t,n,r),this}deleteRange(t,n){return RJ(this,t,n),this}lift(t,n){return vJ(this,t,n),this}join(t,n=1){return wJ(this,t,n),this}wrap(t,n){return bJ(this,t,n),this}setBlockType(t,n=t,r,o=null){return MJ(this,t,n,r,o),this}setNodeMarkup(t,n,r=null,o){return CJ(this,t,n,r,o),this}setNodeAttribute(t,n,r){return this.step(new pf(t,n,r)),this}addNodeMark(t,n){return this.step(new Kl(t,n)),this}removeNodeMark(t,n){if(!(n instanceof ur)){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 Af(t,n)),this}split(t,n=1,r){return TJ(this,t,n,r),this}addMark(t,n,r){return pJ(this,t,n,r),this}removeMark(t,n,r){return hJ(this,t,n,r),this}clearIncompatible(t,n,r){return gJ(this,t,n,r),this}}const J1=Object.create(null);class kn{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new PJ(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<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=Lt.empty){let r=n.content.lastChild,o=null;for(let u=0;u<n.openEnd;u++)o=r,r=r.lastChild;let i=t.steps.length,s=this.ranges;for(let u=0;u<s.length;u++){let{$from:d,$to:f}=s[u],g=t.mapping.slice(i);t.replaceRange(g.map(d.pos),g.map(f.pos),u?Lt.empty:n),u==0&&l2(t,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:u}=o[i],d=t.mapping.slice(r),f=d.map(s.pos),g=d.map(u.pos);i?t.deleteRange(f,g):(t.replaceRangeWith(f,g,n),l2(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let o=t.parent.inlineContent?new Bn(t):Wd(t.node(0),t.parent,t.pos,t.index(),n,r);if(o)return o;for(let i=t.depth-1;i>=0;i--){let s=n<0?Wd(t.node(0),t.node(i),t.before(i+1),t.index(i),n,r):Wd(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 js(t.node(0))}static atStart(t){return Wd(t,t,0,0,1)||new js(t)}static atEnd(t){return Wd(t,t,t.content.size,t.childCount,-1)||new js(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=J1[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 J1)throw new RangeError("Duplicate use of selection JSON ID "+t);return J1[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Bn.between(this.$anchor,this.$head).getBookmark()}}kn.prototype.visible=!0;class PJ{constructor(t,n){this.$from=t,this.$to=n}}let s2=!1;function a2(e){!s2&&!e.parent.inlineContent&&(s2=!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){a2(t),a2(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 Jy(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.pos<n.pos!=o<0&&(t=n))),new Bn(t,n)}}kn.jsonID("text",Bn);class Jy{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Jy(t.map(this.anchor),t.map(this.head))}resolve(t){return Bn.between(t.resolve(this.anchor),t.resolve(this.head))}}class sn extends kn{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=t.resolve(o);return r?kn.near(i):new sn(i)}content(){return new Lt(pt.from(this.node),0,0)}eq(t){return t instanceof sn&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new rT(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new sn(t.resolve(n.anchor))}static create(t,n){return new sn(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}sn.prototype.visible=!1;kn.jsonID("node",sn);class rT{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Jy(r,r):new rT(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&sn.isSelectable(r)?new sn(n):kn.near(n)}}class js extends kn{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Lt.empty){if(n==Lt.empty){t.delete(0,t.doc.content.size);let r=kn.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new js(t)}map(t){return new js(t)}eq(t){return t instanceof js}getBookmark(){return xJ}}kn.jsonID("all",js);const xJ={map(){return this},resolve(e){return new js(e)}};function Wd(e,t,n,r,o,i=!1){if(t.inlineContent)return Bn.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount: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=Wd(e,u,n+o,o<0?u.childCount:0,o,i);if(d)return d}n+=u.nodeSize*o}return null}function l2(e,t,n){let r=e.steps.length-1;if(r<t)return;let o=e.steps[r];if(!(o instanceof jo||o instanceof Uo))return;let i=e.mapping.maps[r],s;i.forEach((u,d,f,g)=>{s==null&&(s=g)}),e.setSelection(kn.near(e.doc.resolve(s),n))}const u2=1,wm=2,c2=4;class UJ extends NJ{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.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|u2)&~wm,this.storedMarks=null,this}get selectionSet(){return(this.updated&u2)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=wm,this}ensureMarks(t){return ur.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)||ur.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|=c2,this}get scrolledIntoView(){return(this.updated&c2)>0}}function d2(e,t){return!t||!e?e:e.bind(t)}class Zp{constructor(t,n,r){this.name=t,this.init=d2(n.init,r),this.apply=d2(n.apply,r)}}const FJ=[new Zp("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Zp("selection",{init(e,t){return e.selection||kn.atStart(t.doc)},apply(e){return e.selection}}),new Zp("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Zp("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class X1{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=FJ.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 Zp(r.key,r.spec.state,r))})}}class Zd{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;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let u=this.config.plugins[s];if(u.spec.appendTransaction){let d=o?o[s].n:0,f=o?o[s].state:this,g=d<n.length&&u.spec.appendTransaction.call(u,d?n.slice(d):n,f,r);if(g&&r.filterTransaction(g,s)){if(g.setMeta("appendedTransaction",t),!o){o=[];for(let v=0;v<this.config.plugins.length;v++)o.push(v<s?{state:r,n:n.length}:{state:this,n:0})}n.push(g),r=r.applyInner(g),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Zd(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new UJ(this)}static create(t){let n=new X1(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Zd(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(t,r);return r}reconfigure(t){let n=new X1(this.schema,t.plugins),r=n.fields,o=new Zd(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(t,o)}return o}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.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 X1(t.schema,t.plugins),i=new Zd(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Hc.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 yR(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):r=="handleDOMEvents"&&(o=yR(o,t,{})),n[r]=o}return n}class La{constructor(t){this.spec=t,this.props={},t.props&&yR(t.props,this,this.props),this.key=t.key?t.key.key:_R("plugin")}getState(t){return t[this.key]}}const Z1=Object.create(null);function _R(e){return e in Z1?e+"$"+ ++Z1[e]:(Z1[e]=0,e+"$")}class Du{constructor(t="key"){this.key=_R(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const ki=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 f2=null;const Ka=function(e,t,n){let r=f2||(f2=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},td=function(e,t,n,r){return n&&(p2(e,t,n,r,-1)||p2(e,t,n,r,1))},GJ=/^(img|br|input|textarea|hr)$/i;function p2(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:ga(e))){let i=e.parentNode;if(!i||i.nodeType!=1||oT(e)||GJ.test(e.nodeName)||e.contentEditable=="false")return!1;t=ki(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?ga(e):0}else return!1}}function ga(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function $J(e,t,n){for(let r=t==0,o=t==ga(e);r||o;){if(e==n)return!0;let i=ki(e);if(e=e.parentNode,!e)return!1;r=r&&i==0,o=o&&i==ga(e)}}function oT(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 Xy=function(e){return e.focusNode&&td(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function uc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function BJ(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function HJ(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 ka=typeof navigator<"u"?navigator:null,h2=typeof document<"u"?document:null,Eu=ka&&ka.userAgent||"",YM=/Edge\/(\d+)/.exec(Eu),bR=/MSIE \d/.exec(Eu),JM=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Eu),Wi=!!(bR||JM||YM),cu=bR?document.documentMode:JM?+JM[1]:YM?+YM[1]:0,Ys=!Wi&&/gecko\/(\d+)/i.test(Eu);Ys&&+(/Firefox\/(\d+)/.exec(Eu)||[0,0])[1];const XM=!Wi&&/Chrome\/(\d+)/.exec(Eu),hi=!!XM,qJ=XM?+XM[1]:0,Ai=!Wi&&!!ka&&/Apple Computer/.test(ka.vendor),Of=Ai&&(/Mobile\/\w+/.test(Eu)||!!ka&&ka.maxTouchPoints>2),Ms=Of||(ka?/Mac/.test(ka.platform):!1),VJ=ka?/Win/.test(ka.platform):!1,Bs=/Android \d/.test(Eu),Zy=!!h2&&"webkitFontSmoothing"in h2.documentElement.style,zJ=Zy?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function jJ(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ha(e,t){return typeof e=="number"?e:e[t]}function WJ(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 g2(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?jJ(i):WJ(u),g=0,v=0;if(t.top<f.top+Ha(r,"top")?v=-(f.top-t.top+Ha(o,"top")):t.bottom>f.bottom-Ha(r,"bottom")&&(v=t.bottom-t.top>f.bottom-f.top?t.top+Ha(o,"top")-f.top:t.bottom-f.bottom+Ha(o,"bottom")),t.left<f.left+Ha(r,"left")?g=-(f.left-t.left+Ha(o,"left")):t.right>f.right-Ha(r,"right")&&(g=t.right-f.right+Ha(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 KJ(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<Math.min(innerHeight,t.bottom);s+=5){let u=e.root.elementFromPoint(i,s);if(!u||u==e.dom||!e.dom.contains(u))continue;let d=u.getBoundingClientRect();if(d.top>=n-20){r=u,o=d.top;break}}return{refDOM:r,refTop:o,stack:MR(e.dom)}}function MR(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 YJ({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;IR(n,r==0?0:r-t)}function IR(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Fd=null;function JJ(e){if(e.setActive)return e.setActive();if(Fd)return e.focus(Fd);let t=MR(e);e.focus(Fd==null?{get preventScroll(){return Fd={preventScroll:!0},!0}}:void 0),Fd||(Fd=!1,IR(t,0))}function CR(e,t){let n,r=2e8,o,i=0,s=t.top,u=t.top,d,f;for(let g=e.firstChild,v=0;g;g=g.nextSibling,v++){let _;if(g.nodeType==1)_=g.getClientRects();else if(g.nodeType==3)_=Ka(g).getClientRects();else continue;for(let M=0;M<_.length;M++){let C=_[M];if(C.top<=s&&C.bottom>=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<t.left?t.left-C.right:0;if(D<r){n=g,r=D,o=D&&n.nodeType==3?{left:C.right<t.left?C.right:C.left,top:t.top}:t,g.nodeType==1&&D&&(i=v+(t.left>=(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?XJ(n,o):!n||r&&n.nodeType==1?{node:e,offset:i}:CR(n,o)}function XJ(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let i=Pl(r,1);if(i.top!=i.bottom&&iT(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function iT(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function ZJ(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function QJ(e,t,n){let{node:r,offset:o}=CR(t,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}function eX(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<r.left||d.bottom<r.top)&&(o=u.posAfter)),!u.contentDOM&&o<0&&!u.node.isText)return(u.node.isBlock?r.top<(d.top+d.bottom)/2:r.left<(d.left+d.right)/2)?u.posBefore:u.posAfter}i=u.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}function TR(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=e.childNodes[i];if(s.nodeType==1){let u=s.getClientRects();for(let d=0;d<u.length;d++){let f=u[d];if(iT(t,f))return TR(s,t,f)}}if((i=(i+1)%r)==o)break}return e}function tX(e,t){let n=e.dom.ownerDocument,r,o=0,i=HJ(n,t.left,t.top);i&&({node:r,offset:o}=i);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),u;if(!s||!e.dom.contains(s.nodeType!=1?s.parentNode:s)){let f=e.dom.getBoundingClientRect();if(!iT(t,f)||(s=TR(e.dom,t,f),!s))return null}if(Ai)for(let f=s;r&&f;f=Xh(f))f.draggable&&(r=void 0);if(s=ZJ(s,t),r){if(Ys&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let f=r.childNodes[o],g;f.nodeName=="IMG"&&(g=f.getBoundingClientRect()).right<=t.left&&g.bottom>t.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=eX(e,r,o,t))}u==null&&(u=QJ(e,s,t));let d=e.docView.nearestDesc(s,!0);return{pos:u,inside:d?d.posAtStart-d.border:-1}}function m2(e){return e.top<e.bottom||e.left<e.right}function Pl(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(m2(r))return r}return Array.prototype.find.call(n,m2)||e.getBoundingClientRect()}const nX=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function wR(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=Zy||Ys;if(r.nodeType==3)if(s&&(nX.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let d=Pl(Ka(r,o,o),n);if(Ys&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let f=Pl(Ka(r,o-1,o-1),-1);if(f.top==d.top){let g=Pl(Ka(r,o,o+1),-1);if(g.top!=d.top)return Fp(g,g.left<f.left)}}return d}else{let d=o,f=o,g=n<0?1:-1;return n<0&&!o?(f++,g=-1):n>=0&&o==r.nodeValue.length?(d--,g=1):n<0?d--:f++,Fp(Pl(Ka(r,d,f),g),g<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==ga(r))){let d=r.childNodes[o-1];if(d.nodeType==1)return Q1(d.getBoundingClientRect(),!1)}if(i==null&&o<ga(r)){let d=r.childNodes[o];if(d.nodeType==1)return Q1(d.getBoundingClientRect(),!0)}return Q1(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==ga(r))){let d=r.childNodes[o-1],f=d.nodeType==3?Ka(d,ga(d)-(s?0:1)):d.nodeType==1&&(d.nodeName!="BR"||!d.nextSibling)?d:null;if(f)return Fp(Pl(f,1),!1)}if(i==null&&o<ga(r)){let d=r.childNodes[o];for(;d.pmViewDesc&&d.pmViewDesc.ignoreForCoords;)d=d.nextSibling;let f=d?d.nodeType==3?Ka(d,0,s?0:1):d.nodeType==1?d:null:null;if(f)return Fp(Pl(f,-1),!0)}return Fp(Pl(r.nodeType==3?Ka(r):r,-n),n>=0)}function Fp(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 Q1(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 SR(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 rX(e,t,n){let r=t.selection,o=n=="up"?r.$from:r.$to;return SR(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=wR(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=Ka(u,0,u.nodeValue.length).getClientRects();else continue;for(let f=0;f<d.length;f++){let g=d[f];if(g.bottom>g.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 oX=/[\u0590-\u08ac]/;function iX(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!oX.test(r.parent.textContent)||!u.modify?n=="left"||n=="backward"?i:s:SR(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 v2=null,y2=null,_2=!1;function sX(e,t,n){return v2==t&&y2==n?_2:(v2=t,y2=n,_2=n=="up"||n=="down"?rX(e,t,n):iX(e,t,n))}const ks=0,b2=1,hc=2,Da=3;class yg{constructor(t,n,r,o){this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=ks,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;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==t)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let i,s;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(t==this.contentDOM)i=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(t==this.dom&&this.contentDOM)o=n>ki(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;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==t&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(t<i)return o.descAt(t-r-o.border);r=i}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],u=i+s.size;if(u>t||s instanceof DR){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 kR&&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?ki(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?ki(i.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,u=0;;u++){let d=this.children[u],f=s+d.size;if(o==-1&&t<=f){let g=s+d.border;if(t>=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=ki(_.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;g<this.children.length;g++){let v=this.children[g];if(v.size&&v.dom.parentNode==this.contentDOM&&!v.emptyChildAt(-1)){i=ki(v.dom);break}n+=v.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=f}return{node:this.contentDOM,from:t,to:n,fromOffset:o,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,o=!1){let i=Math.min(t,n),s=Math.max(t,n);for(let _=0,M=0;_<this.children.length;_++){let C=this.children[_],D=M+C.size;if(i>M&&s<D)return C.setSelection(t-M-C.border,n-M-C.border,r,o);M=D}let u=this.domFromPos(t,t?-1:1),d=n==t?u:this.domFromPos(n,n?-1:1),f=r.getSelection(),g=!1;if((Ys||Ai)&&t==n){let{node:_,offset:M}=u;if(_.nodeType==3){if(g=!!(M&&_.nodeValue[M-1]==`
- `),g&&M==_.nodeValue.length)for(let C=_,D;C;C=C.parentNode){if(D=C.nextSibling){D.nodeName=="BR"&&(u=d={node:D.parentNode,offset:ki(D)+1});break}let w=C.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let C=_.childNodes[M-1];g=C&&(C.nodeName=="BR"||C.contentEditable=="false")}}if(Ys&&f.focusNode&&f.focusNode!=d.node&&f.focusNode.nodeType==1){let _=f.focusNode.childNodes[f.focusOffset];_&&_.contentEditable=="false"&&(o=!0)}if(!(o||g&&Ai)&&td(u.node,u.offset,f.anchorNode,f.anchorOffset)&&td(d.node,d.offset,f.focusNode,f.focusOffset))return;let v=!1;if((f.extend||t==n)&&!g){f.collapse(u.node,u.offset);try{t!=n&&f.extend(d.node,d.offset),v=!0}catch{}}if(!v){if(t>n){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<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let u=r+i.border,d=s-i.border;if(t>=u&&n<=d){this.dirty=t==r||n==s?hc:b2,t==u&&n==d&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Da:i.markDirty(t-u,n-u);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?hc:Da}r=s}this.dirty=hc}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?hc:b2;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class kR extends yg{constructor(t,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{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==ks&&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 aX 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 nd 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=Ma.renderSpec(document,n.type.spec.toDOM(n,r))),new nd(t,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Da||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Da&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=ks){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=ks}}slice(t,n,r){let o=nd.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=eI(i,n,s,r)),t>0&&(i=eI(i,0,t,r));for(let u=0;u<i.length;u++)i[u].parent=o;return o.children=i,o}}class du extends yg{constructor(t,n,r,o,i,s,u,d,f){super(t,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=u}static create(t,n,r,o,i,s){let u=i.nodeViews[n.type.name],d,f=u&&u(n,i,()=>{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}=Ma.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=LR(g,r,n),f?d=new lX(t,n,r,o,g,v||null,_,f,i,s+1):n.isText?new Qy(t,n,r,o,g,_,i):new du(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==ks&&t.eq(this.node)&&QM(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 cX(this,s&&s.node,t);pX(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?ur.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<o+f.nodeSize&&(M=d.findIndexWithChild(i.node))>-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==hc)&&(s&&this.protectLocalComposition(t,s),ER(this.contentDOM,this.children,t),Of&&hX(this.dom))}localCompositionInfo(t,n){let{from:r,to:o}=t.state.selection;if(!(t.state.selection instanceof Bn)||r<n||o>n+this.node.content.size)return null;let i=t.domSelectionRange(),s=gX(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let u=s.nodeValue,d=mX(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 aX(this,i,n,o);t.input.compositionNodes.push(s),this.children=eI(this.children,r,r+o.length,t,s)}update(t,n,r,o){return this.dirty==Da||!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=ks}updateOuterDeco(t){if(QM(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=AR(this.dom,this.nodeDOM,ZM(this.outerDeco,this.node,n),ZM(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 M2(e,t,n,r,o){LR(r,t,e);let i=new du(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Qy extends du{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==Da||this.dirty!=ks&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ks||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=ks,!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 Qy(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=Da)}get domAtom(){return!1}}class DR extends yg{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==ks&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class lX extends du{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==Da)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 ER(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],u=s.dom;if(u.parentNode==e){for(;u!=r;)r=I2(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(u,r);if(s instanceof nd){let d=r?r.previousSibling:e.lastChild;ER(s.contentDOM,s.children,n),r=d?d.nextSibling:e.firstChild}}for(;r;)r=I2(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const vh=function(e){e&&(this.nodeName=e)};vh.prototype=Object.create(null);const gc=[new vh];function ZM(e,t,n){if(e.length==0)return gc;let r=n?gc[0]:new vh,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new vh(s.nodeName));for(let u in s){let d=s[u];d!=null&&(n&&o.length==1&&o.push(r=new vh(t.isInline?"span":"div")),u=="class"?r.class=(r.class?r.class+" ":"")+d:u=="style"?r.style=(r.style?r.style+";":"")+d:u!="nodeName"&&(r[u]=d))}}}return o}function AR(e,t,n,r){if(n==gc&&r==gc)return t;let o=t;for(let i=0;i<r.length;i++){let s=r[i],u=n[i];if(i){let d;u&&u.nodeName==s.nodeName&&o!=e&&(d=o.parentNode)&&d.nodeName.toLowerCase()==s.nodeName||(d=document.createElement(s.nodeName),d.pmIsDeco=!0,d.appendChild(o),u=gc[0]),o=d}uX(o,u||gc[0],s)}return o}function uX(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&e.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&e.classList.add(o[i]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(t.style);)e.style.removeProperty(o[1])}n.style&&(e.style.cssText+=n.style)}}function LR(e,t,n){return AR(e,e,gc,ZM(t,n,e.nodeType!=1))}function QM(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function I2(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class cX{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=dX(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,t.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=ks,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let u=-1;for(let d=this.index;d<Math.min(this.index+3,this.top.children.length);d++){let f=this.top.children[d];if(f.matchesMark(t[i])&&!this.isLocked(f.dom)){u=d;break}}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let d=nd.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);u<d;u++){let f=this.top.children[u];if(f.matchesNode(t,n,r)&&!this.preMatch.matched.has(f)){i=u;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,n,r,o,i){let s=this.top.children[o];return s.dirty==Da&&s.dom==s.contentDOM&&(s.dirty=hc),s.update(t,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}t=n}}updateNextNode(t,n,r,o,i,s){for(let u=this.index;u<this.top.children.length;u++){let d=this.top.children[u];if(d instanceof du){let f=this.preMatch.matched.get(d);if(f!=null&&f!=i)return!1;let g=d.dom,v,_=this.isLocked(g)&&!(t.isText&&d.node&&d.node.isText&&d.nodeDOM.nodeValue==t.text&&d.dirty!=Da&&QM(n,d.outerDeco));if(!_&&d.update(t,n,r,o))return this.destroyBetween(this.index,u),d.dom!=g&&(this.changed=!0),this.index++,!0;if(!_&&(v=this.recreateWrapper(d,t,n,r,o,s)))return this.top.children[this.index]=v,v.dirty=hc,v.updateChildren(o,s+1),v.dirty=ks,this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,o,i,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content))return null;let u=du.create(this.top,n,r,o,i,s);if(!u.contentDOM)return null;u.children=t.children,t.children=[],t.destroy();for(let d of u.children)d.parent=u;return u}addNode(t,n,r,o,i){let s=du.create(this.top,t,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(t)&&(t==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new kR(this.top,t,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof nd;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Qy)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Ai||hi)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new DR(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function dX(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let u;for(;;)if(r){let f=n.children[r-1];if(f instanceof nd)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 fX(e,t){return e.type.side-t.type.side}function pX(e,t,n,r){let o=t.locals(e),i=0;if(o.length==0){for(let f=0;f<e.childCount;f++){let g=e.child(f);r(g,o,t.forChild(i,g),f),i+=g.nodeSize}return}let s=0,u=[],d=null;for(let f=0;;){if(s<o.length&&o[s].to==i){let C=o[s++],D;for(;s<o.length&&o[s].to==i;)(D||(D=[C])).push(o[s++]);if(D){D.sort(fX);for(let w=0;w<D.length;w++)n(D[w],f,!!d)}else n(C,f,!!d)}let g,v;if(d)v=-1,g=d,d=null;else if(f<e.childCount)v=f,g=e.child(f++);else break;for(let C=0;C<u.length;C++)u[C].to<=i&&u.splice(C--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)u.push(o[s++]);let _=i+g.nodeSize;if(g.isText){let C=_;s<o.length&&o[s].from<C&&(C=o[s].from);for(let D=0;D<u.length;D++)u[D].to<C&&(C=u[D].to);C<_&&(d=g.cut(C-i),g=g.cut(0,C-i),_=C,v=-1)}let M=g.isInline&&!g.isLeaf?u.filter(C=>!C.inline):u.slice();r(g,M,t.forChild(i,g),v),i=_}}function hX(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 gX(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=ga(e)}else if(e.nodeType==1&&t<e.childNodes.length)e=e.childNodes[t],t=0;else return null}}function mX(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),u=i;if(i+=s.nodeSize,!s.isText)continue;let d=s.text;for(;o<e.childCount;){let f=e.child(o++);if(i+=f.nodeSize,!f.isText)break;d+=f.text}if(i>=n){let f=u<r?d.lastIndexOf(t,r-u-1):-1;if(f>=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 eI(e,t,n,r,o){let i=[];for(let s=0,u=0;s<e.length;s++){let d=e[s],f=u,g=u+=d.size;f>=n||g<=t?i.push(d):(f<t&&i.push(d.slice(0,t-f,r)),o&&(i.push(o),o=void 0),g>n&&i.push(d.slice(n-f,d.size,r)))}return i}function sT(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(Xy(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&&$J(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<u.pos&&!i?1:-1;f=aT(e,d,u,g)}return f}function OR(e){return e.editable?e.hasFocus():NR(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function cl(e,t=!1){let n=e.state.selection;if(RR(e,n),!!OR(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&hi){let r=e.domSelectionRange(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&td(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)yX(e);else{let{anchor:r,head:o}=n,i,s;C2&&!(n instanceof Bn)&&(n.$from.parent.inlineContent||(i=T2(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=T2(e,n.to))),e.docView.setSelection(r,o,e.root,t),C2&&(i&&w2(i),s&&w2(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&vX(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const C2=Ai||hi&&qJ<63;function T2(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Ai&&o&&o.contentEditable=="false")return eb(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return eb(o);if(i)return eb(i)}}function eb(e){return e.contentEditable="true",Ai&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function w2(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function vX(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!OR(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function yX(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,ki(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&Wi&&cu<=11&&(r.disabled=!0,r.disabled=!1)}function RR(e,t){if(t instanceof sn){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(S2(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else S2(e)}function S2(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function aT(e,t,n,r){return e.someProp("createSelectionBetween",o=>o(e,t,n))||Bn.between(t,n,r)}function k2(e){return e.editable&&!e.hasFocus()?!1:NR(e)}function NR(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 _X(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return td(t.node,t.offset,n.anchorNode,n.anchorOffset)}function tI(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 cc(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function D2(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=tI(e.state,t);return o&&o instanceof sn?cc(e,o):!1}else if(!(Ms&&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)?cc(e,new sn(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Zy?cc(e,new Bn(e.state.doc.resolve(t<0?u:u+i.nodeSize))):!1:!1}}else{if(r instanceof sn&&r.node.isInline)return cc(e,new Bn(t>0?r.$to:r.$from));{let o=tI(e.state,t);return o?cc(e,o):!1}}}function jv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function yh(e){if(e.contentEditable=="false")return!0;let t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function Gp(e,t){return t<0?bX(e):PR(e)}function bX(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(Ys&&n.nodeType==1&&r<jv(n)&&yh(n.childNodes[r])&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let u=n.childNodes[r-1];if(yh(u))o=n,i=--r;else if(u.nodeType==3)n=u,r=n.nodeValue.length;else break}}else{if(xR(n))break;{let u=n.previousSibling;for(;u&&yh(u);)o=n.parentNode,i=ki(u),u=u.previousSibling;if(u)n=u,r=jv(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?nI(e,n,r):o&&nI(e,o,i)}function PR(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o=jv(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let u=n.childNodes[r];if(yh(u))i=n,s=++r;else break}else{if(xR(n))break;{let u=n.nextSibling;for(;u&&yh(u);)i=u.parentNode,s=ki(u)+1,u=u.nextSibling;if(u)n=u,r=0,o=jv(n);else{if(n=n.parentNode,n==e.dom)break;r=o=0}}}i&&nI(e,i,s)}function xR(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function MX(e,t){for(;e&&t==e.childNodes.length&&!oT(e);)t=ki(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){if(e=e.childNodes[t],e.nodeType==3)return e;t=0}}function IX(e,t){for(;e&&!t&&!oT(e);)t=ki(e),e=e.parentNode;for(;e&&t;){if(e=e.childNodes[t-1],e.nodeType==3)return e;t=e.childNodes.length}}function nI(e,t,n){if(t.nodeType!=3){let i,s;(s=MX(t,n))?(t=s,n=0):(i=IX(t,n))&&(t=i,n=i.nodeValue.length)}let r=e.domSelection();if(Xy(r)){let i=document.createRange();i.setEnd(t,n),i.setStart(t,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&cl(e)},50)}function E2(e,t){let n=e.state.doc.resolve(t);if(!(hi||VJ)&&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&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(t<n.end()){let i=e.coordsAtPos(t+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function A2(e,t,n){let r=e.state.selection;if(r instanceof Bn&&!r.empty||n.indexOf("s")>-1||Ms&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=tI(e.state,t);if(s&&s instanceof sn)return cc(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,u=r instanceof js?kn.near(s,t):kn.findFrom(s,t);return u?cc(e,u):!1}return!1}function L2(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 O2(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function CX(e){if(!Ai||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;O2(e,r,"true"),setTimeout(()=>O2(e,r,"false"),20)}return!1}function TX(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function wX(e,t){let n=t.keyCode,r=TX(t);if(n==8||Ms&&n==72&&r=="c")return L2(e,-1)||Gp(e,-1);if(n==46&&!t.shiftKey||Ms&&n==68&&r=="c")return L2(e,1)||Gp(e,1);if(n==13||n==27)return!0;if(n==37||Ms&&n==66&&r=="c"){let o=n==37?E2(e,e.state.selection.from)=="ltr"?-1:1:-1;return D2(e,o,r)||Gp(e,o)}else if(n==39||Ms&&n==70&&r=="c"){let o=n==39?E2(e,e.state.selection.from)=="ltr"?1:-1:1;return D2(e,o,r)||Gp(e,o)}else{if(n==38||Ms&&n==80&&r=="c")return A2(e,-1,r)||Gp(e,-1);if(n==40||Ms&&n==78&&r=="c")return CX(e)||A2(e,1,r)||PR(e);if(r==(Ms?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function UR(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")||Ma.fromSchema(e.state.schema),u=qR(),d=u.createElement("div");d.appendChild(s.serializeFragment(r,{document:u}));let f=d.firstChild,g,v=0;for(;f&&f.nodeType==1&&(g=HR[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 FR(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=Ma.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=DX(n),Zy&&EX(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")||Ef.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(d||g),context:o,ruleFromNode(_){return _.nodeName=="BR"&&!_.nextSibling&&_.parentNode&&!SX.test(_.parentNode.nodeName)?{ignore:!0}:null}})),g)u=AX(R2(u,+g[1],+g[2]),g[4]);else if(u=Lt.maxOpen(kX(u.content,o),!0),u.openStart||u.openEnd){let v=0,_=0;for(let M=u.content.firstChild;v<u.openStart&&!M.type.spec.isolating;v++,M=M.firstChild);for(let M=u.content.lastChild;_<u.openEnd&&!M.type.spec.isolating;_++,M=M.lastChild);u=R2(u,v,_)}return e.someProp("transformPasted",v=>{u=v(u,e)}),u}const SX=/^(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 kX(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&&$R(d,i,u,s[s.length-1],0))s[s.length-1]=f;else{s.length&&(s[s.length-1]=BR(s[s.length-1],i.length));let g=GR(u,d);s.push(g),o=o.matchType(g.type),i=d}}),s)return pt.from(s)}return e}function GR(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,pt.from(e));return e}function $R(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=$R(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(pt.from(GR(n,e,o+1))))}}function BR(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,BR(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(pt.empty,!0);return e.copy(n.append(r))}function rI(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,u=s.content;return e.childCount>1&&(i=0),o<r-1&&(u=rI(u,t,n,r,o+1,i)),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 R2(e,t,n){return t<e.openStart&&(e=new Lt(rI(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Lt(rI(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const HR={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let N2=null;function qR(){return N2||(N2=document.implementation.createHTMLDocument("title"))}function DX(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=qR().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&HR[r[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=e,o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function EX(e){let t=e.querySelectorAll(hi?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function AX(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:o,openStart:i,openEnd:s}=e;for(let u=r.length-2;u>=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 Li={},Oi={},LX={touchstart:!0,touchmove:!0};class OX{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 Li){let n=Li[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{PX(e,r)&&!lT(e,r)&&(e.editable||!(r.type in Oi))&&n(e,r)},LX[t]?{passive:!0}:void 0)}Ai&&e.dom.addEventListener("input",()=>null),oI(e)}function Yl(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function NX(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 oI(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>lT(e,r))})}function lT(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function PX(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 xX(e,t){!lT(e,t)&&Li[t.type]&&(e.editable||!(t.type in Oi))&&Li[t.type](e,t)}Oi.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!zR(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Bs&&hi&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Of&&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,uc(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||wX(e,n)?n.preventDefault():Yl(e,"key")};Oi.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Oi.keypress=(e,t)=>{let n=t;if(zR(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ms&&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 e0(e){return{left:e.clientX,top:e.clientY}}function UX(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function uT(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 hf(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function FX(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&sn.isSelectable(r)?(hf(e,new sn(n),"pointer"),!0):!1}function GX(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?(hf(e,sn.create(e.state.doc,o),"pointer"),!0):!1}function $X(e,t,n,r,o){return uT(e,"handleClickOn",t,n,r)||e.someProp("handleClick",i=>i(e,t,r))||(o?GX(e,n):FX(e,n))}function BX(e,t,n,r){return uT(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",o=>o(e,t,r))}function HX(e,t,n,r){return uT(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",o=>o(e,t,r))||qX(e,n,r)}function qX(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(hf(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)hf(e,Bn.create(r,u+1,u+1+s.content.size),"pointer");else if(sn.isSelectable(s))hf(e,sn.create(r,u),"pointer");else continue;return!0}}function cT(e){return Wv(e)}const VR=Ms?"metaKey":"ctrlKey";Li.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=cT(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&UX(n,e.input.lastClick)&&!n[VR]&&(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(e0(n));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new VX(e,s,n,!!r)):(i=="doubleClick"?BX:HX)(e,s.pos,s.inside,n)?n.preventDefault():Yl(e,"pointer"))};class VX{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[VR],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&&Ys&&!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)),Yl(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(()=>cl(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(e0(t))),this.updateAllowDefault(t),this.allowDefault||!n?Yl(this.view,"pointer"):$X(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Ai&&this.mightDrag&&!this.mightDrag.node.isAtom||hi&&!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)?(hf(this.view,kn.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):Yl(this.view,"pointer")}move(t){this.updateAllowDefault(t),Yl(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)}}Li.touchstart=e=>{e.input.lastTouch=Date.now(),cT(e),Yl(e,"pointer")};Li.touchmove=e=>{e.input.lastTouch=Date.now(),Yl(e,"pointer")};Li.contextmenu=e=>cT(e);function zR(e,t){return e.composing?!0:Ai&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const zX=Bs?5e3:-1;Oi.compositionstart=Oi.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(),Wv(e,!0),e.markCursor=null;else if(Wv(e),Ys&&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}jR(e,zX)};Oi.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++,jR(e,20))};function jR(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Wv(e),t))}function WR(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=jX());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function jX(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Wv(e,t=!1){if(!(Bs&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),WR(e),t||e.docView&&e.docView.dirty){let n=sT(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}function WX(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 Rf=Wi&&cu<15||Of&&zJ<604;Li.copy=Oi.cut=(e,t)=>{let n=t,r=e.state.selection,o=n.type=="cut";if(r.empty)return;let i=Rf?null:n.clipboardData,s=r.content(),{dom:u,text:d}=UR(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",u.innerHTML),i.setData("text/plain",d)):WX(e,u),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function KX(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function YX(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=FR(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=KX(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}Oi.paste=(e,t)=>{let n=t;if(e.composing&&!Bs)return;let r=Rf?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():YX(e,n)};class JX{constructor(t,n){this.slice=t,this.move=n}}const KR=Ms?"altKey":"ctrlKey";Li.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(e0(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}=UR(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Rf?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Rf||n.dataTransfer.setData("text/plain",d),e.dragging=new JX(s,!n[KR])};Li.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Oi.dragover=Oi.dragenter=(e,t)=>t.preventDefault();Oi.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let o=e.posAtCoords(e0(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=FR(e,n.dataTransfer.getData(Rf?"Text":"text/plain"),Rf?null:n.dataTransfer.getData("text/html"),!1,i);let u=!!(r&&!n[KR]);if(e.someProp("handleDrop",C=>C(e,n,s||Lt.empty,u))){n.preventDefault();return}if(!s)return;n.preventDefault();let d=s?kJ(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,R)=>C=R),f.setSelection(aT(e,M,f.doc.resolve(C)))}e.focus(),e.dispatch(f.setMeta("uiEvent","drop"))};Li.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())&&cl(e)},20))};Li.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)};Li.beforeinput=(e,t)=>{if(hi&&Bs&&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,uc(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 Oi)Li[e]=Oi[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 dT{constructor(t,n){this.toDOM=t,this.spec=n||qc,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 ss(i-r,i-r,this)}valid(){return!0}eq(t){return this==t||t instanceof dT&&(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 fu{constructor(t,n){this.attrs=t,this.spec=n||qc}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 ss(i,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof fu&&Qh(this.attrs,t.attrs)&&Qh(this.spec,t.spec)}static is(t){return t.type instanceof fu}destroy(){}}class fT{constructor(t,n){this.attrs=t,this.spec=n||qc}map(t,n,r,o){let i=t.mapResult(n.from+o,1);if(i.deleted)return null;let s=t.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new ss(i.pos-r,s.pos-r,this)}valid(t,n){let{index:r,offset:o}=t.content.findIndex(n.from),i;return o==n.from&&!(i=t.child(r)).isText&&o+i.nodeSize==n.to}eq(t){return this==t||t instanceof fT&&Qh(this.attrs,t.attrs)&&Qh(this.spec,t.spec)}destroy(){}}class ss{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new ss(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new ss(t,t,new dT(n,r))}static inline(t,n,r,o){return new ss(t,n,new fu(r,o))}static node(t,n,r,o){return new ss(t,n,new fT(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof fu}}const Kd=[],qc={};class fo{constructor(t,n){this.local=t.length?t:Kd,this.children=n.length?n:Kd}static create(t,n){return n.length?Kv(n,t,0,qc):ai}find(t,n,r){let o=[];return this.findInner(t??0,n??1e9,o,0,r),o}findInner(t,n,r,o,i){for(let s=0;s<this.local.length;s++){let u=this.local[s];u.from<=n&&u.to>=t&&(!i||i(u.spec))&&r.push(u.copy(u.from+o,u.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){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==ai||t.maps.length==0?this:this.mapInner(t,n,0,0,r||qc)}mapInner(t,n,r,o,i){let s;for(let u=0;u<this.local.length;u++){let d=this.local[u].map(t,r,o);d&&d.type.valid(n,d)?(s||(s=[])).push(d):i.onRemove&&i.onRemove(this.local[u].spec)}return this.children.length?XX(this.children,s||[],t,n,r,o,i):s?new fo(s.sort(Vc),Kd):ai}add(t,n){return n.length?this==ai?fo.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let o,i=0;t.forEach((u,d)=>{let f=d+r,g;if(g=JR(n,u,f)){for(o||(o=this.children.slice());i<o.length&&o[i]<d;)i+=3;o[i]==d?o[i+2]=o[i+2].addInner(u,g,f+1):o.splice(i,0,d,d+u.nodeSize,Kv(g,u,f+1,qc)),i+=3}});let s=YR(i?XR(n):n,-r);for(let u=0;u<s.length;u++)s[u].type.valid(t,s[u])||s.splice(u--,1);return new fo(s.length?this.local.concat(s).sort(Vc):this.local,o||this.children)}remove(t){return t.length==0||this==ai?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,u=r[i]+n,d=r[i+1]+n;for(let g=0,v;g<t.length;g++)(v=t[g])&&v.from>u&&v.to<d&&(t[g]=null,(s||(s=[])).push(v));if(!s)continue;r==this.children&&(r=this.children.slice());let f=r[i+2].removeInner(s,u+1);f!=ai?r[i+2]=f:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<t.length;i++)if(s=t[i])for(let u=0;u<o.length;u++)o[u].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(u--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new fo(o,r):ai}forChild(t,n){if(this==ai)return this;if(n.isLeaf)return fo.empty;let r,o;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=t){this.children[u]==t&&(r=this.children[u+2]);break}let i=t+1,s=i+n.content.size;for(let u=0;u<this.local.length;u++){let d=this.local[u];if(d.from<s&&d.to>i&&d.type instanceof fu){let f=Math.max(i,d.from)-i,g=Math.min(s,d.to)-i;f<g&&(o||(o=[])).push(d.copy(f,g))}}if(o){let u=new fo(o.sort(Vc),Kd);return r?new Hl([u,r]):u}return r||ai}eq(t){if(this==t)return!0;if(!(t instanceof fo)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return pT(this.localsInner(t))}localsInner(t){if(this==ai)return Kd;if(t.inlineContent||!this.local.some(fu.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof fu||n.push(this.local[r]);return n}}fo.empty=new fo([],[]);fo.removeOverlap=pT;const ai=fo.empty;class Hl{constructor(t){this.members=t}map(t,n){const r=this.members.map(o=>o.map(t,n,qc));return Hl.from(r)}forChild(t,n){if(n.isLeaf)return fo.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(t,n);i!=ai&&(i instanceof Hl?r=r.concat(i.members):r.push(i))}return Hl.from(r)}eq(t){if(!(t instanceof Hl)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(t);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?pT(r?n:n.sort(Vc)):Kd}static from(t){switch(t.length){case 0:return ai;case 1:return t[0];default:return new Hl(t.every(n=>n instanceof fo)?t:t.reduce((n,r)=>n.concat(r instanceof fo?r:r.members),[]))}}}function XX(e,t,n,r,o,i,s){let u=e.slice();for(let f=0,g=i;f<n.maps.length;f++){let v=0;n.maps[f].forEach((_,M,C,D)=>{let w=D-C-(M-_);for(let S=0;S<u.length;S+=3){let R=u[S+1];if(R<0||_>R+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<u.length;f+=3)if(u[f+1]<0){if(u[f+1]==-2){d=!0,u[f+1]=-1;continue}let g=n.map(e[f]+i),v=g-o;if(v<0||v>=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!=ai?(u[f]=v,u[f+1]=M,u[f+2]=S):(u[f+1]=-2,d=!0)}else d=!0}if(d){let f=ZX(u,e,t,n,o,i,s),g=Kv(f,r,0,s);t=g.local;for(let v=0;v<u.length;v+=3)u[v+1]<0&&(u.splice(v,3),v-=3);for(let v=0,_=0;v<g.children.length;v+=3){let M=g.children[v];for(;_<u.length&&u[_]<M;)_+=3;u.splice(_,0,g.children[v],g.children[v+1],g.children[v+2])}}return new fo(t.sort(Vc),u)}function YR(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new ss(o.from+t,o.to+t,o.type))}return n}function ZX(e,t,n,r,o,i,s){function u(d,f){for(let g=0;g<d.local.length;g++){let v=d.local[g].map(r,o,f);v?n.push(v):s.onRemove&&s.onRemove(d.local[g].spec)}for(let g=0;g<d.children.length;g+=3)u(d.children[g+2],d.children[g]+f+1)}for(let d=0;d<e.length;d+=3)e[d+1]==-1&&u(e[d+2],t[d]+i+1);return n}function JR(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let i=0,s;i<e.length;i++)(s=e[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),e[i]=null);return o}function XR(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Kv(e,t,n,r){let o=[],i=!1;t.forEach((u,d)=>{let f=JR(e,u,d+n);if(f){i=!0;let g=Kv(f,u,n+d+1,r);g!=ai&&o.push(d,d+u.nodeSize,g)}});let s=YR(i?XR(e):e,-n).sort(Vc);for(let u=0;u<s.length;u++)s[u].type.valid(t,s[u])||(r.onRemove&&r.onRemove(s[u].spec),s.splice(u--,1));return s.length||o.length?new fo(s,o):ai}function Vc(e,t){return e.from-t.from||e.to-t.to}function pT(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from==r.from){i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),P2(t,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),P2(t,o,r.copy(i.from,r.to)));break}}}return t}function P2(e,t,n){for(;t<e.length&&Vc(n,e[t])>0;)t++;e.splice(t,0,n)}function tb(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=ai&&t.push(r)}),e.cursorWrapper&&t.push(fo.create(e.state.doc,[e.cursorWrapper.deco])),Hl.from(t)}const QX={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},eZ=Wi&&cu<=11;class tZ{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 nZ{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tZ,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Wi&&cu<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),eZ&&(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,QX)),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;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.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(k2(this.view)){if(this.suppressingSelectionUpdates)return cl(this.view);if(Wi&&cu<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&td(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)&&k2(t)&&!this.ignoreSelectionChange(r),i=-1,s=-1,u=!1,d=[];if(t.editable)for(let g=0;g<n.length;g++){let v=this.registerMutation(n[g],d);v&&(i=i<0?v.from:Math.min(v.from,i),s=s<0?v.to:Math.max(v.to,s),v.typeOver&&(u=!0))}if(Ys&&d.length>1){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)<Date.now()-300&&Xy(r)&&(f=sT(t))&&f.eq(kn.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,cl(t),this.currentSelection.set(r),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,s),rZ(t)),this.handleDOMChange(i,s,u,d),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||cl(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;g<t.addedNodes.length;g++)n.push(t.addedNodes[g]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let o=t.previousSibling,i=t.nextSibling;if(Wi&&cu<=11&&t.addedNodes.length)for(let g=0;g<t.addedNodes.length;g++){let{previousSibling:v,nextSibling:_}=t.addedNodes[g];(!v||Array.prototype.indexOf.call(t.addedNodes,v)<0)&&(o=v),(!_||Array.prototype.indexOf.call(t.addedNodes,_)<0)&&(i=_)}let s=o&&o.parentNode==t.target?ki(o)+1:0,u=r.localPosFromDOM(t.target,s,-1),d=i&&i.parentNode==t.target?ki(i):t.target.childNodes.length,f=r.localPosFromDOM(t.target,d,1);return{from:u,to:f}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}let x2=new WeakMap,U2=!1;function rZ(e){if(!x2.has(e)&&(x2.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ys,U2)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),U2=!0}}function oZ(e){let t;function n(d){d.preventDefault(),d.stopImmediatePropagation(),t=d.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,o=t.startOffset,i=t.endContainer,s=t.endOffset,u=e.domAtPos(e.state.selection.anchor);return td(u.node,u.offset,i,s)&&([r,o,i,s]=[i,s,r,o]),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}}function iZ(e,t,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:u}=e.docView.parseRange(t,n),d=e.domSelectionRange(),f,g=d.anchorNode;if(g&&e.dom.contains(g.nodeType==1?g:g.parentNode)&&(f=[{node:g,offset:d.anchorOffset}],Xy(d)||f.push({node:d.focusNode,offset:d.focusOffset})),hi&&e.input.lastKeyCode===8)for(let w=i;w>o;w--){let S=r.childNodes[w-1],R=S.pmViewDesc;if(S.nodeName=="BR"&&!R){i=w;break}if(!R||R.size)break}let v=e.state.doc,_=e.someProp("domParser")||Ef.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:sZ,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 sZ(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Ai&&/^(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||Ai&&/^(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 aZ=/^(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 lZ(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let j=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,G=sT(e,j);if(G&&!e.state.selection.eq(G)){if(hi&&Bs&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",T=>T(e,uc(13,"Enter"))))return;let L=e.state.tr.setSelection(G);j=="pointer"?L.setMeta("pointer",!0):j=="key"&&L.scrollIntoView(),i&&L.setMeta("composition",i),e.dispatch(L)}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=iZ(e,t,n),g=e.state.doc,v=g.slice(f.from,f.to),_,M;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(_=e.state.selection.to,M="end"):(_=e.state.selection.from,M="start"),e.input.lastKeyCode=null;let C=dZ(v.content,f.doc.content,f.from,_,M);if((Of&&e.input.lastIOSEnter>Date.now()-225||Bs)&&o.some(j=>j.nodeType==1&&!aZ.test(j.nodeName))&&(!C||C.endA>=C.endB)&&e.someProp("handleKeyDown",j=>j(e,uc(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 j=F2(e,e.state.doc,f.sel);if(j&&!j.eq(e.state.selection)){let G=e.state.tr.setSelection(j);i&&G.setMeta("composition",i),e.dispatch(G)}}return}if(hi&&e.cursorWrapper&&f.sel&&f.sel.anchor==e.cursorWrapper.deco.from&&f.sel.head==f.sel.anchor){let j=C.endB-C.start;f.sel={anchor:f.sel.anchor+j,head:f.sel.anchor+j}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&C.start==C.endB&&e.state.selection instanceof Bn&&(C.start>e.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&&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)),Wi&&cu<=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),R=D.sameParent(w)&&D.parent.inlineContent&&S.end()>=C.endA,A;if((Of&&e.input.lastIOSEnter>Date.now()-225&&(!R||o.some(j=>j.nodeName=="DIV"||j.nodeName=="P"))||!R&&D.pos<f.doc.content.size&&!D.sameParent(w)&&(A=kn.findFrom(f.doc.resolve(D.pos+1),1,!0))&&A.head==w.pos)&&e.someProp("handleKeyDown",j=>j(e,uc(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>C.start&&cZ(g,C.start,C.endA,D,w)&&e.someProp("handleKeyDown",j=>j(e,uc(8,"Backspace")))){Bs&&hi&&e.domObserver.suppressSelectionUpdates();return}hi&&Bs&&C.endB==C.start&&(e.input.lastAndroidDelete=Date.now()),Bs&&!R&&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(j){return j(e,uc(13,"Enter"))})},20));let N=C.start,H=C.endA,z,x,B;if(R){if(D.pos==w.pos)Wi&&cu<=11&&D.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>cl(e),20)),z=e.state.tr.delete(N,H),x=g.resolve(C.start).marksAcross(g.resolve(C.endA));else if(C.endA==C.endB&&(B=uZ(D.parent.content.cut(D.parentOffset,w.parentOffset),S.parent.content.cut(S.parentOffset,C.endA-S.start()))))z=e.state.tr,B.type=="add"?z.addMark(N,H,B.mark):z.removeMark(N,H,B.mark);else if(D.parent.child(D.index()).isText&&D.index()==w.index()-(w.textOffset?0:1)){let j=D.parent.textBetween(D.parentOffset,w.parentOffset);if(e.someProp("handleTextInput",G=>G(e,N,H,j)))return;z=e.state.tr.insertText(j,N,H)}}if(z||(z=e.state.tr.replace(N,H,f.doc.slice(C.start-f.from,C.endB-f.from))),f.sel){let j=F2(e,z.doc,f.sel);j&&!(hi&&Bs&&e.composing&&j.empty&&(C.start!=C.endB||e.input.lastAndroidDelete<Date.now()-100)&&(j.head==N||j.head==z.mapping.map(H)-1)||Wi&&j.empty&&j.head==N)&&z.setSelection(j)}x&&z.ensureMarks(x),i&&z.setMeta("composition",i),e.dispatch(z.scrollIntoView())}function F2(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:aT(e,t.resolve(n.anchor),t.resolve(n.head))}function uZ(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,s,u,d;for(let g=0;g<r.length;g++)o=r[g].removeFromSet(o);for(let g=0;g<n.length;g++)i=n[g].removeFromSet(i);if(o.length==1&&i.length==0)u=o[0],s="add",d=g=>g.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;g<t.childCount;g++)f.push(d(t.child(g)));if(pt.from(f).eq(e))return{mark:u,type:s}}function cZ(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||nb(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(nb(i,!0,!0));return!s.parent.isTextblock||s.pos>n||nb(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function nb(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>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 dZ(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<i&&e.size<t.size){let d=r<=i&&r>=s?i-r:0;i-=d,u=i+(u-s),s=i}else if(u<i){let d=r<=i&&r>=u?i-r:0;i-=d,s=i+(s-u),u=i}return{start:i,endA:s,endB:u}}class fZ{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 OX,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(q2),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=B2(this),$2(this),this.nodeViews=H2(this),this.docView=M2(this.state.doc,G2(this),tb(this),this.dom,this),this.domObserver=new nZ(this,(r,o,i,s)=>lZ(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&&oI(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(q2),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&&(WR(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 _=H2(this);hZ(_,this.nodeViews)&&(this.nodeViews=_,o=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&oI(this),this.editable=B2(this),$2(this);let u=tb(this),d=G2(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&&KJ(this);if(i){this.domObserver.stop();let _=g&&(Wi||hi)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&pZ(r.selection,t.selection);if(g){let M=hi?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,d,u,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=M2(t.doc,d,u,this.dom,this)),M&&!this.trackWrites&&(_=!0)}_||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&_X(this))?cl(this,_):(RR(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():v&&YJ(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&&g2(this,n.getBoundingClientRect(),t)}else g2(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;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}someProp(t,n){let r=this._props&&this._props[t],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let u=this.directPlugins[s].props[t];if(u!=null&&(o=n?n(u):u))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let u=i[s].props[t];if(u!=null&&(o=n?n(u):u))return o}}hasFocus(){if(Wi){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&JJ(this.dom),cl(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}posAtCoords(t){return tX(this,t)}coordsAtPos(t,n=1){return wR(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 sX(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&&(NX(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],tb(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 xX(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Ai&&this.root.nodeType===11&&BJ(this.dom.ownerDocument)==this.dom?oZ(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function G2(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"),[ss.node(0,e.state.doc.content.size,t)]}function $2(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:ss.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function B2(e){return!e.someProp("editable",t=>t(e.state)===!1)}function pZ(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 H2(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 hZ(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 q2(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 bu={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:"'"},Yv={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},gZ=typeof navigator<"u"&&/Mac/.test(navigator.platform),mZ=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Wo=0;Wo<10;Wo++)bu[48+Wo]=bu[96+Wo]=String(Wo);for(var Wo=1;Wo<=24;Wo++)bu[Wo+111]="F"+Wo;for(var Wo=65;Wo<=90;Wo++)bu[Wo]=String.fromCharCode(Wo+32),Yv[Wo]=String.fromCharCode(Wo);for(var rb in bu)Yv.hasOwnProperty(rb)||(Yv[rb]=bu[rb]);function vZ(e){var t=gZ&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||mZ&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Yv:bu)[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 yZ=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function _Z(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let u=0;u<t.length-1;u++){let d=t[u];if(/^(cmd|meta|m)$/i.test(d))s=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))i=!0;else if(/^mod$/i.test(d))yZ?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+d)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function bZ(e){let t=Object.create(null);for(let n in e)t[_Z(n)]=e[n];return t}function ob(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function MZ(e){return new La({props:{handleKeyDown:IZ(e)}})}function IZ(e){let t=bZ(e);return function(n,r){let o=vZ(r),i,s=t[ob(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let u=t[ob(o,r,!1)];if(u&&u(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=bu[r.keyCode])&&i!=o){let u=t[ob(i,r)];if(u&&u(n.state,n.dispatch,n))return!0}}return!1}}const CZ=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function TZ(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const wZ=(e,t,n)=>{let r=TZ(e,n);if(!r)return!1;let o=ZR(r);if(!o){let s=r.blockRange(),u=s&&Jf(s);return u==null?!1:(t&&t(e.tr.lift(s,u).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&tN(e,o,t))return!0;if(r.parent.content.size==0&&(Nf(i,"end")||sn.isSelectable(i))){let s=nT(e.doc,r.before(),r.after(),Lt.empty);if(s&&s.slice.size<s.to-s.from){if(t){let u=e.tr.step(s);u.setSelection(Nf(i,"end")?kn.findFrom(u.doc.resolve(u.mapping.map(o.pos,-1)),-1):sn.create(u.doc,o.pos-i.nodeSize)),t(u.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1};function Nf(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const SZ=(e,t,n)=>{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=ZR(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 ZR(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 kZ(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const DZ=(e,t,n)=>{let r=kZ(e,n);if(!r)return!1;let o=QR(r);if(!o)return!1;let i=o.nodeAfter;if(tN(e,o,t))return!0;if(r.parent.content.size==0&&(Nf(i,"start")||sn.isSelectable(i))){let s=nT(e.doc,r.before(),r.after(),Lt.empty);if(s&&s.slice.size<s.to-s.from){if(t){let u=e.tr.step(s);u.setSelection(Nf(i,"start")?kn.findFrom(u.doc.resolve(u.mapping.map(o.pos)),1):sn.create(u.doc,u.mapping.map(o.pos))),t(u.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},EZ=(e,t,n)=>{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<r.parent.content.size)return!1;i=QR(r)}let s=i&&i.nodeAfter;return!s||!sn.isSelectable(s)?!1:(t&&t(e.tr.setSelection(sn.create(e.doc,i.pos)).scrollIntoView()),!0)};function QR(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const AZ=(e,t)=>{let n=e.selection,r=n instanceof sn,o;if(r){if(n.node.isTextblock||!dd(e.doc,n.from))return!1;o=n.from}else if(o=pR(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},LZ=(e,t)=>{let n=e.selection,r;if(n instanceof sn){if(n.node.isTextblock||!dd(e.doc,n.to))return!1;r=n.to}else if(r=pR(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},OZ=(e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&Jf(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 eN(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const NZ=(e,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=eN(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},PZ=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof js||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=eN(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,u=e.tr.insert(s,i.createAndFill());u.setSelection(Bn.create(u.doc,s+1)),t(u.scrollIntoView())}return!0},xZ=(e,t)=>{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(ff(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Jf(r);return o==null?!1:(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)},UZ=(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 FZ(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||dd(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function tN(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(FZ(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 Uo(t.pos-1,v,t.pos,v,new Lt(_,1,0),i.length,!0)),C=v+2*i.length;dd(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&&Jf(f);if(g!=null&&g>=t.depth)return n&&n(e.tr.lift(f,g).scrollIntoView()),!0;if(u&&Nf(o,"start",!0)&&Nf(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 Uo(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 nN(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 GZ=nN(-1),$Z=nN(1);function BZ(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),u=s&&dR(s,e,t);return u?(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0):!1}}function V2(e,t=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:u}}=n.selection.ranges[i];n.doc.nodesBetween(s,u,(d,f)=>{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<n.selection.ranges.length;s++){let{$from:{pos:u},$to:{pos:d}}=n.selection.ranges[s];i.setBlockType(u,d,e,t)}r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function HZ(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),u=!1,d=s;if(!s)return!1;if(s.depth>=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 Hv(g,g,s.depth),s.endIndex<s.parent.childCount&&(s=new Hv(o,n.doc.resolve(i.end(s.depth)),s.depth)),u=!0}let f=dR(d,e,t,s);return f?(r&&r(qZ(n.tr,s,f,u,e).scrollIntoView()),!0):!1}}function qZ(e,t,n,r,o){let i=pt.empty;for(let g=n.length-1;g>=0;g--)i=pt.from(n[g].type.create(n[g].attrs,i));e.step(new Uo(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;g<n.length;g++)n[g].type==o&&(s=g+1);let u=n.length-s,d=t.start+n.length-(r?2:0),f=t.parent;for(let g=t.startIndex,v=t.endIndex,_=!0;g<v;g++,_=!1)!_&&ff(e.doc,d,u)&&(e.split(d,u),d+=2*u),d+=f.child(g).nodeSize;return e}function VZ(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==e);return i?n?r.node(i.depth-1).type==e?zZ(t,n,e,i):jZ(t,n,i):!0:!1}}function zZ(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Uo(i-1,s,i,s,new Lt(pt.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Hv(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const u=Jf(r);if(u==null)return!1;o.lift(r,u);let d=o.mapping.map(i,-1)-1;return dd(o.doc,d)&&o.join(d),t(o.scrollIntoView()),!0}function jZ(e,t,n){let r=e.tr,o=n.parent;for(let M=n.end,C=n.endIndex-1,D=n.startIndex;C>D;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 Uo(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 WZ(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 Uo(_-(f?3:1),M,_,M,v,1,!0)).scrollIntoView())}return!0}}function t0(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 n0{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:t0({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 KZ{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 r0(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 rN(e){const t=[],{nodeExtensions:n,markExtensions:r}=r0(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 Fo(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 iI(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 oN(e){return typeof e=="function"}function Ln(e,t=void 0,...n){return oN(e)?t?e.bind(t)(...n):e(...n):e}function YZ(e={}){return Object.keys(e).length===0&&e.constructor===Object}function JZ(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function z2(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):JZ(n.getAttribute(s.name));return u==null?i:{...i,[s.name]:u}},{});return{...r,...o}}}}function j2(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&YZ(n)?!1:n!=null))}function XZ(e,t){var n;const r=rN(e),{nodeExtensions:o,markExtensions:i}=r0(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,R)=>{const A=Ut(R,"extendNodeSchema",v);return{...S,...A?A(f):{}}},{}),M=j2({..._,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 R;return[S.name,{default:(R=S==null?void 0:S.attribute)===null||R===void 0?void 0:R.default}]}))}),C=Ln(Ut(f,"parseHTML",v));C&&(M.parseDOM=C.map(S=>z2(S,g)));const D=Ut(f,"renderHTML",v);D&&(M.toDOM=S=>D({node:S,HTMLAttributes:iI(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 R=Ut(S,"extendMarkSchema",v);return{...w,...R?R(f):{}}},{}),M=j2({..._,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=>z2(w,g)));const D=Ut(f,"renderHTML",v);return D&&(M.toDOM=w=>D({mark:w,HTMLAttributes:iI(w,g)})),[f.name,M]}));return new oJ({topNode:s,nodes:u,marks:d})}function ib(e,t){return t.nodes[e]||t.marks[e]||null}function W2(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}const ZZ=(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 hT(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class QZ{constructor(t){this.find=t.find,this.handler=t.handler}}const eQ=(e,t)=>{if(hT(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 sb(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=ZZ(f)+i;return s.forEach(_=>{if(g)return;const M=eQ(v,_.find);if(!M)return;const C=d.state.tr,D=t0({state:d.state,transaction:C}),w={from:r-(M[0].length-i.length),to:o},{commands:S,chain:R,can:A}=new n0({editor:n,state:D});_.handler({state:D,range:w,match:M,commands:S,chain:R,can:A})===null||!C.steps.length||(C.setMeta(u,{transform:C,from:r,to:o,text:i}),d.dispatch(C),g=!0)}),g}function tQ(e){const{editor:t,rules:n}=e,r=new La({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 sb({editor:t,from:i,to:s,text:u,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&sb({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?sb({editor:t,from:s.pos,to:s.pos,text:`
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function nQ(e){return typeof e=="number"}const rQ=(e,t)=>{if(hT(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 oQ(e){const{editor:t,state:n,from:r,to:o,rule:i}=e,{commands:s,chain:u,can:d}=new n0({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,"");rQ(D,i.find).forEach(S=>{if(S.index===void 0)return;const R=M+S.index+1,A=R+S[0].length,N={from:n.tr.mapping.map(R),to:n.tr.mapping.map(A)},H=i.handler({state:n,range:N,match:S,commands:s,chain:u,can:d});f.push(H)})}),f.every(v=>v!==null)}function iQ(e){const{editor:t,rules:n}=e;let r=null,o=!1,i=!1;return n.map(u=>new La({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(!nQ(C)||!D||C===D.b)return;const w=g.tr,S=t0({state:g,transaction:w});if(!(!oQ({editor:t,state:S,from:Math.max(C-1,0),to:D.b-1,rule:u})||!w.steps.length))return w}}))}function sQ(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return[...new Set(t)]}class Qd{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=Qd.resolve(t),this.schema=XZ(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:ib(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=Qd.sort(Qd.flatten(t)),r=sQ(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<s?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:ib(n.name,this.schema)},o=Ut(n,"addCommands",r);return o?{...t,...o()}:t},{})}get plugins(){const{editor:t}=this,n=Qd.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const u={name:s.name,options:s.options,storage:s.storage,editor:t,type:ib(s.name,this.schema)},d=[],f=Ut(s,"addKeyboardShortcuts",u);let g={};if(s.type==="mark"&&s.config.exitable&&(g.ArrowRight=()=>Zv.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=MZ(g);d.push(v);const _=Ut(s,"addInputRules",u);W2(s,t.options.enableInputRules)&&_&&r.push(..._());const M=Ut(s,"addPasteRules",u);W2(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[tQ({editor:t,rules:r}),...iQ({editor:t,rules:o}),...i]}get attributes(){return rN(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=r0(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:Fo(r.name,this.schema)},s=Ut(r,"addNodeView",i);if(!s)return[];const u=(d,f,g,v)=>{const _=iI(d,o);return s()({editor:t,node:d,getPos:g,decorations:v,HTMLAttributes:_,extension:r})};return[r.name,u]}))}}function aQ(e){return Object.prototype.toString.call(e).slice(8,-1)}function ab(e){return aQ(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function o0(e,t){const n={...e};return ab(e)&&ab(t)&&Object.keys(t).forEach(r=>{ab(t[r])?r in e?n[r]=o0(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}class Ea{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 Ea(t)}configure(t={}){const n=this.extend();return n.options=o0(this.options,t),n.storage=Ln(Ut(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Ea(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 iN(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 sN(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const lQ=Ea.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new La({key:new Du("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=sN(n);return iN(r,{from:s,to:u},{textSerializers:d})}}})]}}),uQ=()=>({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),cQ=(e=!1)=>({commands:t})=>t.setContent("",e),dQ=()=>({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=Jf(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},fQ=e=>t=>e(t),pQ=()=>({state:e,dispatch:t})=>PZ(e,t),hQ=()=>({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},gQ=e=>({tr:t,state:n,dispatch:r})=>{const o=Fo(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},mQ=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},vQ=()=>({state:e,dispatch:t})=>CZ(e,t),yQ=()=>({commands:e})=>e.keyboardShortcut("Enter"),_Q=()=>({state:e,dispatch:t})=>NZ(e,t);function Jv(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(o=>n.strict?t[o]===e[o]:hT(t[o])?t[o].test(e[o]):t[o]===e[o]):!0}function sI(e,t,n={}){return e.find(r=>r.type===t&&Jv(r.attrs,n))}function bQ(e,t,n={}){return!!sI(e,t,n)}function aN(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=sI([...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(sI([...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<e.parent.childCount&&bQ([...e.parent.child(u).marks],t,n);)d+=e.parent.child(u).nodeSize,u+=1;return{from:s,to:d}}function Au(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const MQ=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const i=Au(e,r.schema),{doc:s,selection:u}=n,{$from:d,from:f,to:g}=u;if(o){const v=aN(d,i,t);if(v&&v.from<=f&&v.to>=g){const _=Bn.create(s,v.from,v.to);n.setSelection(_)}}return!0},IQ=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function lN(e){return e instanceof Bn}function mc(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function uN(e,t=null){if(!t)return null;const n=kn.atStart(e),r=kn.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const o=n.from,i=r.to;return t==="all"?Bn.create(e,mc(0,o,i),mc(e.content.size,o,i)):Bn.create(e,mc(t,o,i),mc(t,o,i))}function gT(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const CQ=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{gT()&&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&&!lN(n.state.selection))return s(),!0;const u=uN(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},TQ=(e,t)=>n=>e.every((r,o)=>t(r,{...n,index:o})),wQ=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t);function K2(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function Xv(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),Xv("",t,n)}if(typeof e=="string"){const r=Ef.fromSchema(t);return n.slice?r.parseSlice(K2(e),n.parseOptions).content:r.parse(K2(e),n.parseOptions)}return Xv("",t,n)}function SQ(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof jo||o instanceof Uo))return;const i=e.mapping.maps[r];let s=0;i.forEach((u,d,f,g)=>{s===0&&(s=g)}),e.setSelection(kn.near(e.doc.resolve(s),n))}const kQ=e=>e.toString().startsWith("<"),DQ=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const s=Xv(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((kQ(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&&SQ(r,r.steps.length-1,-1)}return!0},EQ=()=>({state:e,dispatch:t})=>AZ(e,t),AQ=()=>({state:e,dispatch:t})=>LZ(e,t),LQ=()=>({state:e,dispatch:t})=>wZ(e,t),OQ=()=>({state:e,dispatch:t})=>DZ(e,t);function cN(){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<t.length-1;u+=1){const d=t[u];if(/^(cmd|meta|m)$/i.test(d))s=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))i=!0;else if(/^mod$/i.test(d))gT()||cN()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${d}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}const NQ=e=>({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?Fo(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=>Jv(v.node.attrs,n,{strict:!1}));return i?!!f.length:f.reduce((v,_)=>v+_.to-_.from,0)>=d}const PQ=(e,t={})=>({state:n,dispatch:r})=>{const o=Fo(e,n.schema);return eg(n,o,t)?OZ(n,r):!1},xQ=()=>({state:e,dispatch:t})=>xZ(e,t),UQ=e=>({state:t,dispatch:n})=>{const r=Fo(e,t.schema);return VZ(r)(t,n)},FQ=()=>({state:e,dispatch:t})=>RZ(e,t);function i0(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Y2(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 GQ=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const u=i0(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(i=Fo(e,r.schema)),u==="mark"&&(s=Au(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,Y2(f.attrs,t)),s&&f.marks.length&&f.marks.forEach(v=>{s===v.type&&n.addMark(g,g+f.nodeSize,s.create(Y2(v.attrs,t)))})})}),!0):!1},$Q=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),BQ=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),HQ=()=>({state:e,dispatch:t})=>SZ(e,t),qQ=()=>({state:e,dispatch:t})=>EZ(e,t),VQ=()=>({state:e,dispatch:t})=>UZ(e,t),zQ=()=>({state:e,dispatch:t})=>$Z(e,t),jQ=()=>({state:e,dispatch:t})=>GZ(e,t);function dN(e,t,n={}){return Xv(e,t,{slice:!1,parseOptions:n})}const WQ=(e,t=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,u=dN(e,o.schema,n);return i&&r.replaceWith(0,s.content.size,u).setMeta("preventUpdate",!t),!0};function KQ(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function YQ(e,t){for(let n=e.depth;n>0;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 mT(e){return t=>YQ(t.$from,e)}function JQ(e,t){const n=Ma.fromSchema(t).serializeFragment(e),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function XQ(e,t){const n={from:0,to:e.content.size};return iN(e,n,t)}function fN(e,t){const n=Au(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 ZQ(e,t){const n=Fo(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 QQ(e,t){const n=i0(typeof t=="string"?t:t.name,e.schema);return n==="node"?ZQ(e,t):n==="mark"?fN(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 aI(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Au(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(v=>i?i.name===v.type.name:!0).find(v=>Jv(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),R=Math.min(C,w+D.nodeSize),A=R-S;s+=A,u.push(...D.marks.map(N=>({mark:N,from:S,to:R})))})}),s===0)return!1;const d=u.filter(v=>i?i.name===v.mark.type.name:!0).filter(v=>Jv(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 eee(e,t,n={}){if(!t)return eg(e,null,n)||aI(e,null,n);const r=i0(t,e.schema);return r==="node"?eg(e,t,n):r==="mark"?aI(e,t,n):!1}function J2(e,t){const{nodeExtensions:n}=r0(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 tee(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 nee(e,t,n){var r;const{selection:o}=t;let i=null;if(lN(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 ree=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:u}=i,d=Au(e,r.schema);if(o)if(s){const f=fN(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 nee(r,n,d)},oee=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),iee=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=Fo(e,n.schema);return i.isTextblock?o().command(({commands:s})=>V2(i,t)(n)?!0:s.clearNodes()).command(({state:s})=>V2(i,t)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},see=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,o=mc(e,0,r.content.size),i=sn.create(r,o);t.setSelection(i)}return!0},aee=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=mc(o,s,u),f=mc(i,s,u),g=Bn.create(r,d,f);t.setSelection(g)}return!0},lee=e=>({state:t,dispatch:n})=>{const r=Fo(e,t.schema);return WZ(r)(t,n)};function X2(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 uee=({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||!ff(s,u.pos)?!1:(r&&(e&&X2(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:KQ(u.node(-1).contentMatchAt(u.indexAfter(-1)));let M=v&&_?[{type:_,attrs:g}]:void 0,C=ff(t.doc,t.mapping.map(u.pos),1,M);if(!M&&!C&&ff(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&&X2(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0},cee=e=>({tr:t,state:n,dispatch:r,editor:o})=>{var i;const s=Fo(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 R=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,A=ov(v,u.node().type.name,u.node().attrs),N=((i=s.contentMatch.defaultType)===null||i===void 0?void 0:i.createAndFill(A))||void 0;w=w.append(pt.from(s.createAndFill(null,N)||void 0));const H=u.before(u.depth-(S-1));t.replace(H,u.after(-R),new Lt(w,4-S,0));let z=-1;t.doc.nodesBetween(H,t.doc.content.size,(x,B)=>{if(z>-1)return!1;x.isTextblock&&x.content.size===0&&(z=B+1)}),z>-1&&t.setSelection(Bn.near(t.doc.resolve(z))),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(!ff(t.doc,u.pos,2))return!1;if(r){const{selection:w,storedMarks:S}=n,{splittableMarks:R}=o.extensionManager,A=S||w.$to.parentOffset&&w.$from.marks();if(t.split(u.pos,2,D).scrollIntoView(),!A||!r)return!0;const N=A.filter(H=>R.includes(H.type.name));t.ensureMarks(N)}return!0},lb=(e,t)=>{const n=mT(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)&&dd(e.doc,n.pos)&&e.join(n.pos),!0},ub=(e,t)=>{const n=mT(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)&&dd(e.doc,r)&&e.join(r),!0},dee=(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=Fo(e,s.schema),C=Fo(t,s.schema),{selection:D,storedMarks:w}=s,{$from:S,$to:R}=D,A=S.blockRange(R),N=w||D.$to.parentOffset&&D.$from.marks();if(!A)return!1;const H=mT(z=>J2(z.type.name,v))(D);if(A.depth>=1&&H&&A.depth-H.depth<=1){if(H.node.type===M)return f.liftListItem(C);if(J2(H.node.type.name,v)&&M.validContent(H.node.content)&&u)return d().command(()=>(i.setNodeMarkup(H.pos,M),!0)).command(()=>lb(i,M)).command(()=>ub(i,M)).run()}return!n||!N||!u?d().command(()=>g().wrapInList(M,r)?!0:f.clearNodes()).wrapInList(M,r).command(()=>lb(i,M)).command(()=>ub(i,M)).run():d().command(()=>{const z=g().wrapInList(M,r),x=N.filter(B=>_.includes(B.type.name));return i.ensureMarks(x),z?!0:f.clearNodes()}).wrapInList(M,r).command(()=>lb(i,M)).command(()=>ub(i,M)).run()},fee=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Au(e,r.schema);return aI(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},pee=(e,t,n={})=>({state:r,commands:o})=>{const i=Fo(e,r.schema),s=Fo(t,r.schema);return eg(r,i,n)?o.setNode(s):o.setNode(i,n)},hee=(e,t={})=>({state:n,commands:r})=>{const o=Fo(e,n.schema);return eg(n,o,t)?r.lift(o):r.wrapIn(o,t)},gee=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const s=e.tr,u=i.transform;for(let d=u.steps.length-1;d>=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},mee=()=>({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},vee=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:u}=n,d=Au(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=aN(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},yee=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const u=i0(typeof e=="string"?e:e.name,r.schema);return u?(u==="node"&&(i=Fo(e,r.schema)),u==="mark"&&(s=Au(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},_ee=(e,t={})=>({state:n,dispatch:r})=>{const o=Fo(e,n.schema);return BZ(o,t)(n,r)},bee=(e,t={})=>({state:n,dispatch:r})=>{const o=Fo(e,n.schema);return HZ(o,t)(n,r)};var Mee=Object.freeze({__proto__:null,blur:uQ,clearContent:cQ,clearNodes:dQ,command:fQ,createParagraphNear:pQ,deleteCurrentNode:hQ,deleteNode:gQ,deleteRange:mQ,deleteSelection:vQ,enter:yQ,exitCode:_Q,extendMarkRange:MQ,first:IQ,focus:CQ,forEach:TQ,insertContent:wQ,insertContentAt:DQ,joinUp:EQ,joinDown:AQ,joinBackward:LQ,joinForward:OQ,keyboardShortcut:NQ,lift:PQ,liftEmptyBlock:xQ,liftListItem:UQ,newlineInCode:FQ,resetAttributes:GQ,scrollIntoView:$Q,selectAll:BQ,selectNodeBackward:HQ,selectNodeForward:qQ,selectParentNode:VQ,selectTextblockEnd:zQ,selectTextblockStart:jQ,setContent:WQ,setMark:ree,setMeta:oee,setNode:iee,setNodeSelection:see,setTextSelection:aee,sinkListItem:lee,splitBlock:uee,splitListItem:cee,toggleList:dee,toggleMark:fee,toggleNode:pee,toggleWrap:hee,undoInputRule:gee,unsetAllMarks:mee,unsetMark:vee,updateAttributes:yee,wrapIn:_ee,wrapInList:bee});const Iee=Ea.create({name:"commands",addCommands(){return{...Mee}}}),Cee=Ea.create({name:"editable",addProseMirrorPlugins(){return[new La({key:new Du("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Tee=Ea.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new La({key:new Du("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}}}})]}}),wee=Ea.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 gT()||cN()?i:o},addProseMirrorPlugins(){return[new La({key:new Du("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,_=t0({state:n,transaction:v}),{commands:M}=new n0({editor:this.editor,state:_});if(M.clearNodes(),!!v.steps.length)return v}})]}}),See=Ea.create({name:"tabindex",addProseMirrorPlugins(){return[new La({key:new Du("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var kee=Object.freeze({__proto__:null,ClipboardTextSerializer:lQ,Commands:Iee,Editable:Cee,FocusEvents:Tee,Keymap:wee,Tabindex:See});const Dee=`.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 Eee(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 Aee=class extends KZ{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=Eee(Dee,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=oN(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(kee):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Qd(n,this)}createCommandManager(){this.commandManager=new n0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const t=dN(this.options.content,this.schema,this.options.parseOptions),n=uN(t,this.options.autofocus);this.view=new fZ(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Zd.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 QQ(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,o=typeof t=="string"?n:t;return eee(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return JQ(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
- `,textSerializers:r={}}=t||{};return XQ(this.state.doc,{blockSeparator:n,textSerializers:{...sN(this.schema),...r}})}get isEmpty(){return tee(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 Lee(e){return new QZ({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 Zv{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 Zv(t)}configure(t={}){const n=this.extend();return n.options=o0(this.options,t),n.storage=Ln(Ut(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Zv(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 Mu{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 Mu(t)}configure(t={}){const n=this.extend();return n.options=o0(this.options,t),n.storage=Ln(Ut(n,"addStorage",{name:n.name,options:n.options})),n}extend(t={}){const n=new Mu(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 Oee(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z2(e){return rU((t,n)=>({get(){return t(),e},set(r){e=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class Ree extends Aee{constructor(t={}){return super(t),this.vueRenderers=jt(new Map),this.contentComponent=null,this.reactiveState=Z2(this.view.state),this.reactiveExtensionStorage=Z2(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),aC(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 Nee=ot({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=Ne(),n=Yi();return nn(()=>{const r=e.editor;r&&r.options.element&&t.value&&Ir(()=>{if(!t.value||!r.options.element.firstChild)return;const o=Le(t.value);t.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:o}),r.createNodeViews()})}),vi(()=>{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(bC,{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)}}),Pee=(e={})=>{const t=bL();return On(()=>{t.value=new Ree(e)}),vi(()=>{var n;(n=t.value)===null||n===void 0||n.destroy()}),t},xee=Mu.create({name:"doc",topNode:!0,content:"block+"}),Uee=Mu.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()}}}),Fee=Ea.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new La({key:new Du("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 _=ss.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)}}})]}}),Gee=Mu.create({name:"text",group:"inline"});function $ee(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:o,startOfLine:i,$position:s}=e,u=Oee(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&&S>=s.pos?{range:{from:w,to:S},query:M[0].slice(n.length),text:M[0]}:null}const Bee=new Du("suggestion");function Hee({pluginKey:e=Bee,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 La({key:e,view(){return{update:async(D,w)=>{var S,R,A,N,H,z,x;const B=(S=this.key)===null||S===void 0?void 0:S.getState(w),j=(R=this.key)===null||R===void 0?void 0:R.getState(D.state),G=B.active&&j.active&&B.range.from!==j.range.from,L=!B.active&&j.active,T=B.active&&!j.active,P=!L&&!T&&B.query!==j.query,Q=L||G,Y=P&&!G,oe=T||G;if(!Q&&!Y&&!oe)return;const X=oe&&!Q?B:j,ae=D.dom.querySelector(`[data-decoration-id="${X.decorationId}"]`);_={editor:t,range:X.range,query:X.query,text:X.text,items:[],command:fe=>{d({editor:t,range:X.range,props:fe})},decorationNode:ae,clientRect:ae?()=>{var fe;const{decorationId:le}=(fe=this.key)===null||fe===void 0?void 0:fe.getState(t.state),ce=D.dom.querySelector(`[data-decoration-id="${le}"]`);return(ce==null?void 0:ce.getBoundingClientRect())||null}:null},Q&&((A=M==null?void 0:M.onBeforeStart)===null||A===void 0||A.call(M,_)),Y&&((N=M==null?void 0:M.onBeforeUpdate)===null||N===void 0||N.call(M,_)),(Y||Q)&&(_.items=await f({editor:t,query:X.query})),oe&&((H=M==null?void 0:M.onExit)===null||H===void 0||H.call(M,_)),Y&&((z=M==null?void 0:M.onUpdate)===null||z===void 0||z.call(M,_)),Q&&((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,R){const{isEditable:A}=t,{composing:N}=t.view,{selection:H}=D,{empty:z,from:x}=H,B={...w};if(B.composing=N,A&&(z||t.view.composing)){(x<w.range.from||x>w.range.to)&&!N&&!w.composing&&(B.active=!1);const j=$ee({char:n,allowSpaces:r,allowedPrefixes:o,startOfLine:i,$position:H.$from}),G=`id_${Math.floor(Math.random()*4294967295)}`;j&&v({editor:t,state:R,range:j.range})?(B.active=!0,B.decorationId=w.decorationId?w.decorationId:G,B.range=j.range,B.query=j.query,B.text=j.text):B.active=!1}else B.active=!1;return B.active||(B.decorationId=null,B.range={from:0,to:0},B.query=null,B.text=null),B}},props:{handleKeyDown(D,w){var S;const{active:R,range:A}=C.getState(D.state);return R&&((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:R}=C.getState(D);return w?fo.create(D.doc,[ss.inline(S.from,S.to,{nodeName:s,class:u,"data-decoration-id":R})]):null}}});return C}const qee=new Du("mention"),Vee=Mu.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:qee,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[Hee({editor:this.editor,...this.options.suggestion})]}}),zee=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Q2=Mu.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[Lee({find:zee,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),jee=Q2.extend({name:"custom-image",addAttributes(){return{...Q2.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)]}}),Wee=""+new URL("at-21d7cd83.svg",import.meta.url).href,ts=Ne(),vc=Ne(!1),Za=Ne(),lr=Ne(),yc=Ne({left:0,top:0}),lI=Ne(),pu=Ne(0),zc=Ne(),Qv=Ne(!1),Kee=()=>({allowedPrefixes:null,items:e=>{var n;const t=(n=Za==null?void 0:Za.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 lr.value=t!=null&&t.length?t:Za.value,lr.value},render:()=>({onStart:e=>{if(vc.value=!0,!(e!=null&&e.clientRect))return;const t=e==null?void 0:e.clientRect();t!=null&&t.left&&(t!=null&&t.top)&&!Qv.value&&(yc.value={left:t==null?void 0:t.left,top:t==null?void 0:t.top}),lI.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)&&!Qv.value&&(yc.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"?(vc.value=!1,lr.value=Za.value,!0):(e==null?void 0:e.event.key)==="ArrowUp"?(Yee(),!0):(e==null?void 0:e.event.key)==="ArrowDown"?(Jee(),!0):(e==null?void 0:e.event.key)==="Enter"?(Xee(),!0):!1},onExit(e){vc.value=!1,lr.value=Za.value,yc.value={left:0,top:0}}})}),Yee=()=>{var e,t,n,r;(e=lr==null?void 0:lr.value)!=null&&e.length&&(pu.value=(pu.value+((t=lr==null?void 0:lr.value)==null?void 0:t.length)-1)%((n=lr==null?void 0:lr.value)==null?void 0:n.length),(r=zc==null?void 0:zc.value[pu.value])==null||r.scrollIntoView(!1))},Jee=()=>{var e,t,n;(e=lr==null?void 0:lr.value)!=null&&e.length&&(pu.value=(pu.value+1)%((t=lr==null?void 0:lr.value)==null?void 0:t.length),(n=zc==null?void 0:zc.value[pu.value])==null||n.scrollIntoView(!1))},Xee=()=>{pN(pu.value)},pN=e=>{var n;if(!((n=lr==null?void 0:lr.value)!=null&&n.length))return;const t=lr==null?void 0:lr.value[e];t&&lI.value&&lI.value({id:t==null?void 0:t.userID,label:(t==null?void 0:t.nick)||(t==null?void 0:t.userID)})},Zee=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}=Kt(e),o={userID:vt.TYPES.MSG_AT_ALL,nick:"所有人",isAll:!0,avatar:Wee},i=Ne();nn(()=>{vc.value=vc.value&&n.value,Qv.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)});Za.value=u,lr.value=u},{deep:!0,immediate:!0}),$t(()=>[yc.value,ts==null?void 0:ts.value],()=>{var u;Qv.value||!(ts!=null&&ts.value)||!((u=ts==null?void 0:ts.value)!=null&&u.style)||(ts.value.style.left=yc.value.left+"Px",ts.value.style.top=yc.value.top-ts.value.clientHeight+"Px")},{deep:!0,immediate:!0});const s=()=>{vc.value=!1,lr.value=Za.value,yc.value={left:0,top:0}};return Xs(i,()=>{s()}),{selectedIndex:pu,selectItem:pN,showAtList:vc,closeAt:s,showMemberList:lr,allMemberList:Za,MessageInputAt:ts,memberListItems:zc,dialog:i}}});const Qee={class:"memberList",ref:"dialog"},ete={key:0,class:"memberList-title"},tte={class:"title"},nte={class:"memberList-box"},rte=["onClick"],ote=["src"];function ite(e,t,n,r,o,i){return e.showAtList?(Z(),se("div",{key:0,class:it(["message-input-at",[e.isH5&&"message-input-at-h5"]]),ref:"MessageInputAt"},[$("div",Qee,[e.isH5?(Z(),se("header",ete,[$("span",tte,De(e.$t("TUIChat.选择提醒的人")),1),$("i",{class:"icon icon-close close",onClick:t[0]||(t[0]=(...s)=>e.closeAt&&e.closeAt(...s))})])):Ce("",!0),$("ul",nte,[(Z(!0),se(dt,null,Vt(e.showMemberList,(s,u)=>(Z(),se("li",{class:it(["memberList-box-body",[u===e.selectedIndex&&"selected"]]),key:u,onClick:d=>e.selectItem(u),ref_for:!0,ref:"memberListItems"},[$("img",{src:(s==null?void 0:s.avatar)||"https://oss.dayaedu.com/news-info/07/1690787574969.png"},null,8,ote),$("span",null,De(s!=null&&s.nick?s==null?void 0:s.nick:s==null?void 0:s.userID),1)],10,rte))),128))])],512)],2)):Ce("",!0)}const ste=Wt(Zee,[["render",ite],["__scopeId","data-v-e8288dc1"]]),ate=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}=Kt(r),g=Ne(!0),v=Ne(!0),_=Pee({extensions:[xee,Uee,Gee,Fee.configure({emptyEditorClass:"is-editor-empty",placeholder:o.value}),Vee.configure({HTMLAttributes:{class:"mention"},suggestion:s.value&&Kee()}),jee.configure({inline:!0,allowBase64:!0,HTMLAttributes:{class:"custom-image"}})],autofocus:!0,editable:!0,injectCSS:!1,onUpdate({editor:L,transaction:T}){var P,Q;!f.value||d.value||(v.value=!L.isFocused,((Q=(P=T==null?void 0:T.doc)==null?void 0:P.content)==null?void 0:Q.size)>2?g.value=!1:g.value=!0,n("onTyping",g.value,v.value))},onFocus(){var L;if(i.value&&((L=document==null?void 0:document.getElementById("app"))!=null&&L.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 L;i.value&&((L=document==null?void 0:document.getElementById("app"))!=null&&L.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=L=>{var T,P;i!=null&&i.value||(L==null||L.preventDefault(),L==null||L.stopPropagation(),L.keyCode===13&&L.ctrlKey?(P=(T=_==null?void 0:_.value)==null?void 0:T.commands)==null||P.insertContent("<p></p>"):L.keyCode===13&&n("sendMessage"))},D=new Map,w=async(L,T)=>{var P,Q,Y,oe;if(L.preventDefault(),L.stopPropagation(),!i.value&&!(!(u!=null&&u.value)&&T==="drop")&&(T==="drop"&&L.dataTransfer||T==="paste"&&L.clipboardData)){const X=T==="drop"?(P=L==null?void 0:L.dataTransfer)==null?void 0:P.files:(Q=L==null?void 0:L.clipboardData)==null?void 0:Q.files;for(let ae=0;ae<X.length;ae++){const fe=X[ae],le=fe.type.startsWith("image/"),ce=le?URL.createObjectURL(fe):await A(fe);(oe=(Y=_==null?void 0:_.value)==null?void 0:Y.commands)==null||oe.insertContent({type:"custom-image",attrs:{src:ce,alt:fe==null?void 0:fe.name,title:fe==null?void 0:fe.name,class:le?"normal":"file"}}),D.set(ce,fe),ae===X.length-1&&setTimeout(()=>{var J,re,de,Oe;(re=(J=_==null?void 0:_.value)==null?void 0:J.commands)==null||re.focus("end"),(Oe=(de=_==null?void 0:_.value)==null?void 0:de.commands)==null||Oe.scrollIntoView()},10)}}},S=new Map,R=(L,T)=>new Promise((P,Q)=>{if(S.has(T))P(S.get(T));else{let Y=new Image;Y.crossOrigin="anonymous",Y.onload=()=>{S.set(T,Y),P(Y)},Y.onerror=Q,Y.src=L}}),A=async L=>{const{name:T,type:P}=L,Q=document.createElement("canvas");let Y=160,oe=50;Q.style.width=Y+"Px",Q.style.height=oe+"Px";let X=window.devicePixelRatio;Q.width=Math.floor(Y*X),Q.height=Math.floor(oe*X);const ae=Q.getContext("2d");if(!ae)return"";ae.scale(X,X);const{iconSrc:fe,iconType:le}=N(P),ce=await R(fe,le);ae==null||ae.drawImage(ce,10,10,30,30);const J=H(T);return ae.fillText(J,45,22),Q.toDataURL()},N=L=>{const T="https://web.sdk.qcloud.com/component/TUIKit/assets/file-",P=["image","pdf","text","ppt","presentation","sheet","zip","word","video","unknown"];let Q="",Y="";return P.forEach(oe=>{L.includes(oe)&&(Q=T+oe+".svg",Y=oe)}),{iconSrc:Q||T+"unknown.svg",iconType:Y||"unknown"}},H=L=>{if(!L)return L;let T="",P=0;for(let Q=0;Q<(L==null?void 0:L.length);Q++){if(P>16){T+="...";break}T+=L[Q],/[a-z]|[0-9]|[,;.!@#-+/\\$%^*()<>?:"'{}~]/i.test(L[Q])?P+=1:P+=2}return T},z=()=>x(),x=()=>{var Y,oe,X,ae,fe;const L=(Y=_==null?void 0:_.value)==null?void 0:Y.getJSON(),T=[],P=le=>{if(!(!le||!le.type))if(le.type!=="text"&&le.type!=="custom-image"&&le.type!=="mention"){le.type==="paragraph"&&Q(le),le.content&&le.content.length&&le.content.forEach(ce=>{P(ce)});return}else Q(le)},Q=le=>{var ce,J,re,de,Oe,ve,Me,K,me,ke,pe,W,te,ie,Ie,ue,Se,Pe;if(le.type==="paragraph")T.length>0&&T[T.length-1]&&((ce=T[T.length-1])==null?void 0:ce.type)==="text"&&(T[T.length-1].payload.text+=`
- `);else if(le.type==="text"||le.type==="custom-image"&&((J=le==null?void 0:le.attrs)==null?void 0:J.class)==="emoji"){const xe=le.type==="text"?le==null?void 0:le.text:(re=le==null?void 0:le.attrs)==null?void 0:re.alt;T.length>0&&T[T.length-1]&&((de=T[T.length-1])==null?void 0:de.type)==="text"?T[T.length-1].payload.text+=xe:T.push({type:"text",payload:{text:xe}})}else if(le.type==="custom-image"&&((Oe=le==null?void 0:le.attrs)==null?void 0:Oe.class)==="normal")T.push({type:"image",payload:{file:D==null?void 0:D.get((ve=le==null?void 0:le.attrs)==null?void 0:ve.src)}});else if(le.type==="custom-image"&&((Me=le==null?void 0:le.attrs)==null?void 0:Me.class)==="file"){const xe=D==null?void 0:D.get((K=le==null?void 0:le.attrs)==null?void 0:K.src);T.push({type:(me=xe==null?void 0:xe.type)!=null&&me.includes("video")?"video":"file",payload:{file:xe}})}else if(le.type==="mention"){const xe="@"+((ke=le==null?void 0:le.attrs)==null?void 0:ke.label)+" ";T.length>0&&T[T.length-1]&&((pe=T[T.length-1])==null?void 0:pe.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=(Ie=(ie=T[T.length-1])==null?void 0:ie.payload)==null?void 0:Ie.atUserList)==null||Se.push((ue=le==null?void 0:le.attrs)==null?void 0:ue.id):T[T.length-1].payload.atUserList=[(Pe=le==null?void 0:le.attrs)==null?void 0:Pe.id]}};if(P(L),T.length>0&&T[T.length-1]&&((oe=T[T.length-1])==null?void 0:oe.type)==="text"&&((fe=(ae=(X=T[T.length-1])==null?void 0:X.payload)==null?void 0:ae.text)!=null&&fe.endsWith(`
- `))){const le=T[T.length-1].payload.text;T[T.length-1].payload.text=le==null?void 0:le.substring(0,le.lastIndexOf(`
- `))}return T};return t({getEditorContent:z,addEmoji:L=>{var T,P,Q,Y,oe;(P=(T=_==null?void 0:_.value)==null?void 0:T.commands)==null||P.insertContent({type:"custom-image",attrs:{src:L==null?void 0:L.url,alt:L==null?void 0:L.name,title:L==null?void 0:L.name,class:"emoji"}}),(Q=_==null?void 0:_.value)==null||Q.commands.focus("end"),(oe=(Y=_==null?void 0:_.value)==null?void 0:Y.commands)==null||oe.scrollIntoView()},resetEditor:()=>{var L,T,P,Q;(T=(L=_==null?void 0:_.value)==null?void 0:L.commands)==null||T.clearContent(!0),D==null||D.clear(),(Q=(P=_==null?void 0:_.value)==null?void 0:P.commands)==null||Q.focus("end"),v.value=!0,g.value=!0},setEditorContent:L=>{var T,P;(P=(T=_==null?void 0:_.value)==null?void 0:T.commands)==null||P.insertContent(L)}}),(L,T)=>(Z(),se("div",{class:it(["message-input-container",Le(i)&&"message-input-container-h5"])},[$n($("div",{class:"message-input-mute"},De(L.$t(`TUIChat.${e.muteText}`)),513),[[eo,e.isMute]]),$n(Ct(Le(Nee),{editor:Le(_),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 lte=Wt(ate,[["__scopeId","data-v-1114d381"]]),ute={class:"message-input-button-hover"},cte=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}=Kt(n),o=()=>{t("sendMessage")};return(i,s)=>(Z(),se("div",{class:it(["message-input-button",e.isH5&&"message-input-button-h5"])},[Le(r)?(Z(),se("button",{key:0,class:"message-input-button-cont","data-type":"text",onClick:o,disabled:!1},[$("p",ute,De(i.$t("TUIChat.按Enter发送,Ctrl+Enter换行")),1),Fr(" "+De(i.$t("发送")),1)])):Ce("",!0)],2))}});const dte=Wt(cte,[["__scopeId","data-v-52846a98"]]),fte=e=>(mr("data-v-0ef798e8"),e=e(),vr(),e),pte={key:0,class:"reference"},hte={class:"reference-box"},gte={class:"reference-box-show"},mte={class:"reference-box-show-name"},vte={key:1,class:"reply"},yte={class:"reply-box"},_te=fte(()=>$("i",null,null,-1)),bte={class:"reply-box-show"},Mte=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}=Kt(n),i=()=>{t("resetReplyOrReference")};return(s,u)=>{var d,f,g,v,_,M,C,D,w,S,R,A,N,H,z,x,B,j,G,L,T;return(d=Le(r))!=null&&d.show?(Z(),se("div",{key:0,class:it([((f=Le(r))==null?void 0:f.show)==="reference"&&"message-input-reference",((g=Le(r))==null?void 0:g.show)==="reply"&&"message-input-reply",Le(o)&&((v=Le(r))==null?void 0:v.show)==="reference"&&"message-input-reference-h5",Le(o)&&((_=Le(r))==null?void 0:_.show)==="reply"&&"message-input-reply-h5"])},[((M=Le(r))==null?void 0:M.show)==="reference"?(Z(),se("div",pte,[$("div",hte,[$("div",gte,[$("span",mte,De((D=(C=Le(r))==null?void 0:C.message)!=null&&D.nick?(S=(w=Le(r))==null?void 0:w.message)==null?void 0:S.nick:(A=(R=Le(r))==null?void 0:R.message)==null?void 0:A.from)+": ",1),$("span",null,De((N=Le(r))==null?void 0:N.content),1)]),$("label",{class:"icon icon-cancel",onClick:i})])])):((H=Le(r))==null?void 0:H.show)==="reply"?(Z(),se("div",vte,[$("div",yte,[_te,$("div",bte,[$("span",null,De((x=(z=Le(r))==null?void 0:z.message)!=null&&x.nick?(j=(B=Le(r))==null?void 0:B.message)==null?void 0:j.nick:(L=(G=Le(r))==null?void 0:G.message)==null?void 0:L.from)+De(Le(o)?":":""),1),$("span",null,De((T=Le(r))==null?void 0:T.content),1)]),$("label",{class:"icon icon-cancel",onClick:i})])])):Ce("",!0)],2)):Ce("",!0)}}});const Ite=Wt(Mte,[["__scopeId","data-v-0ef798e8"]]),Cte=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 H;const r=e,{placeholder:o,isGroup:i,memberList:s,conversation:u,replyOrReference:d,env:f,enableTyping:g}=Kt(r),v=Ne(),_=Ne((H=r==null?void 0:r.env)==null?void 0:H.isH5),M=Ei&&Ei();$t(()=>u.value,(z,x)=>{var B;(z==null?void 0:z.conversationID)!==(x==null?void 0:x.conversationID)&&((B=v==null?void 0:v.value)==null||B.resetEditor())},{immediate:!0});const C=async()=>{var j,G,L,T;if(console.log(M.state.imConnent,"store.imConnent"),!M.state.imConnent){lu.emit("reConnectIm",!0);return}const z=(G=(j=window==null?void 0:window.TUIKitTUICore)==null?void 0:j.TUIServer)==null?void 0:G.TUIChat,x=(L=v==null?void 0:v.value)==null?void 0:L.getEditorContent(),B=d.value;await(x==null?void 0:x.forEach(async P=>{var Q,Y,oe,X,ae,fe,le,ce;try{let J,re;switch(J=w(J),P==null?void 0:P.type){case"text":J=S(J),(Q=P==null?void 0:P.payload)!=null&&Q.atUserList?re=await(z==null?void 0:z.sendTextAtMessage({text:JSON.parse(JSON.stringify((Y=P==null?void 0:P.payload)==null?void 0:Y.text)),atUserList:(oe=P==null?void 0:P.payload)==null?void 0:oe.atUserList},J)):re=await(z==null?void 0:z.sendTextMessage(JSON.parse(JSON.stringify((X=P==null?void 0:P.payload)==null?void 0:X.text)),J)),(B==null?void 0:B.show)==="reply"&&await z.replyMessage((ae=re==null?void 0:re.data)==null?void 0:ae.message);break;case"image":await(z==null?void 0:z.sendImageMessage((fe=P==null?void 0:P.payload)==null?void 0:fe.file));break;case"video":await(z==null?void 0:z.sendVideoMessage((le=P==null?void 0:P.payload)==null?void 0:le.file));break;case"file":await(z==null?void 0:z.sendFileMessage((ce=P==null?void 0:P.payload)==null?void 0:ce.file));break;default:break}n("sendMessage")}catch(J){xr(J,f.value)}})),(T=v==null?void 0:v.value)==null||T.resetEditor(),A()},D=(z,x)=>{n("onTyping",z,x)},w=z=>(g.value&&(z||(z={}),z.messageFeature={needTyping:1,version:1}),z),S=z=>{var x,B,j,G,L,T,P,Q,Y,oe,X,ae,fe,le,ce,J,re,de,Oe,ve;if(((x=d==null?void 0:d.value)==null?void 0:x.show)!=="reply"&&((B=d==null?void 0:d.value)==null?void 0:B.show)!=="reference")return z;if(z||(z={}),z.messageReply={messageAbstract:(j=d==null?void 0:d.value)==null?void 0:j.content,messageSender:((L=(G=d==null?void 0:d.value)==null?void 0:G.message)==null?void 0:L.nick)||((P=(T=d==null?void 0:d.value)==null?void 0:T.message)==null?void 0:P.from),messageID:(Y=(Q=d==null?void 0:d.value)==null?void 0:Q.message)==null?void 0:Y.ID,messageType:(oe=d==null?void 0:d.value)==null?void 0:oe.type,version:1},((X=d==null?void 0:d.value)==null?void 0:X.show)==="reply")try{if(z.messageReply.messageRootID=(fe=(ae=d==null?void 0:d.value)==null?void 0:ae.message)==null?void 0:fe.ID,(ce=(le=d==null?void 0:d.value)==null?void 0:le.message)!=null&&ce.cloudCustomData){const Me=nr((re=(J=d==null?void 0:d.value)==null?void 0:J.message)==null?void 0:re.cloudCustomData);z.messageReply.messageRootID=((de=Me==null?void 0:Me.messageReply)==null?void 0:de.messageRootID)||((ve=(Oe=d==null?void 0:d.value)==null?void 0:Oe.message)==null?void 0:ve.ID)}}catch(Me){console.warn(Me)}return z},R=z=>{var x;(x=v==null?void 0:v.value)==null||x.addEmoji(z)},A=()=>{n("resetReplyOrReference")};return t({addEmoji:R,reEdit:z=>{var x,B;(x=v==null?void 0:v.value)==null||x.resetEditor(),A(),(B=v==null?void 0:v.value)==null||B.setEditorContent(z)}}),(z,x)=>{var B,j;return Z(),se("div",{class:it(["message-input",_.value&&"message-input-h5"])},[Ct(lte,{ref_key:"editor",ref:v,isH5:_.value,placeholder:Le(o),isGroup:Le(i),isMute:e.isMute,muteText:e.muteText,enableInput:e.enableInput,enableAt:e.enableAt,enableTyping:Le(g),enableDragUpload:e.enableDragUpload,onSendMessage:C,onOnTyping:D},null,8,["isH5","placeholder","isGroup","isMute","muteText","enableInput","enableAt","enableTyping","enableDragUpload"]),e.isMute?Ce("",!0):(Z(),bt(dte,{key:0,isH5:_.value,onSendMessage:C},null,8,["isH5"])),e.enableAt?(Z(),bt(ste,{key:1,memberList:Le(s),isGroup:Le(i),selfInfo:(j=(B=Le(u))==null?void 0:B.groupProfile)==null?void 0:j.selfInfo,isH5:_.value},null,8,["memberList","isGroup","selfInfo","isH5"])):Ce("",!0),Ct(Ite,{replyOrReference:Le(d),isH5:_.value,onResetReplyOrReference:A},null,8,["replyOrReference","isH5"])],2)}}});const hN=Wt(Cte,[["__scopeId","data-v-6ccc76f6"]]),gN=ot({name:"TUIChat",components:{MessageSystem:Jz,MessageTimestamp:qY,Manage:ul,MessageInput:hN,MessageItem:BY},props:{isMsgNeedReadReceipt:{type:Boolean,default:!1},isNeedTyping:{type:Boolean,default:!0},isNeedEmojiReact:{type:Boolean,default:!0},currentModal:{type:String,default:"message"}},setup(e){var ue,Se,Pe,xe,He,Te;const{TUIServer:t}=gN;(Se=(ue=t==null?void 0:t.TUICore)==null?void 0:ue.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&&Ei&&Ei()||{},{t:r}=window.TUIKitTUICore.config.i18n.useI18n(),o=jt({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:eD("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 V=>{var ne,ye,Be;V&&await((Be=(ye=(ne=t==null?void 0:t.TUICore)==null?void 0:ne.TUIServer)==null?void 0:ye.TUIConversation)==null?void 0:Be.setMessageRead(V))},u=async V=>{var ye;const ne=V.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((ye=o==null?void 0:o.conversation)==null?void 0:ye.conversationID)},d=[];Object.keys(eD("send")).forEach(V=>{d.push(V)}),ul.TUIServer=t,ul.GroupServer=(Te=(He=t==null?void 0:t.TUICore)==null?void 0:He.TUIServer)==null?void 0:Te.TUIGroup;const f=Ne(),g=Ne(),v=Ne(),_=Ne(),M=Ne();t.bind(o);const C={list:[],handleAvatar:EC,handleName:Wh},D=Ne();Xs(D,()=>{o.showGroupMemberList=!1});const w=Ve(()=>{const{conversation:V}=o;return V!=null&&V.conversationID?(V==null?void 0:V.type)===t.TUICore.TIM.TYPES.CONV_SYSTEM?"system":"chat":""}),S=Ve(()=>{var ne,ye,Be;const{conversation:V}=o;if((V==null?void 0:V.type)===t.TUICore.TIM.TYPES.CONV_GROUP){if(((ne=V==null?void 0:V.groupProfile)==null?void 0:ne.selfInfo.role)===t.TUICore.TIM.TYPES.GRP_MBR_ROLE_MEMBER&&((ye=V==null?void 0:V.groupProfile)!=null&&ye.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 V;return(V=o==null?void 0:o.conversation)==null?void 0:V.conversationID},(V,ne)=>{V!==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,(V,ne)=>{var Be,je,lt;const{conversation:ye}=o;if(V&&(ye==null?void 0:ye.type)===t.TUICore.TIM.TYPES.CONV_GROUP){((Be=ye==null?void 0:ye.groupProfile)==null?void 0:Be.selfInfo.role)===t.TUICore.TIM.TYPES.GRP_MBR_ROLE_MEMBER&&((je=ye==null?void 0:ye.groupProfile)!=null&&je.muteAllMembers)&&(o.muteText="管理员开启学生禁言");const wt=new Date().getTime();((lt=o.selfInfo)==null?void 0:lt.muteUntil)*1e3-wt>0&&(o.muteText="您已被管理员禁言")}});const R=Ve(()=>{const{conversation:V}=o;return Wh(V)}),A=Ve(()=>o.messageList.filter(V=>!V.isDeleted&&!cf(V))),N=Ve(()=>{var V;return(V=A==null?void 0:A.value)==null?void 0:V.filter(ne=>!ne.isRevoked&&ne.type===o.types.MSG_IMAGE)}),H=Ve(()=>{const{conversation:V,needReadReceipt:ne}=o;return!!((V==null?void 0:V.type)===t.TUICore.TIM.TYPES.CONV_C2C||ne)});$t(A,(V,ne)=>{var ye,Be;if(Ir(()=>{var lt,Fe;const je=((lt=V[V.length-1])==null?void 0:lt.ID)===((Fe=ne[ne.length-1])==null?void 0:Fe.ID);V.length===0||je||de()}),o.currentMessage){const je=(ye=o.currentMessage)==null?void 0:ye.ID,lt=V.find(Fe=>Fe.ID===je);lt&&(o.currentMessage=LC(lt))}if(o.historyReference){for(let je=0;je<A.value.length;je++)((Be=A==null?void 0:A.value[je])==null?void 0:Be.ID)===(o==null?void 0:o.referenceID)&&(Oe("target",v.value[je]),v.value[je].getElementsByClassName("content")[0].classList.add("reference-content"));o.historyReference=!1}},{deep:!0}),$t(()=>o.scroll.scrollTop,V=>{setTimeout(()=>{var ne;V===((ne=f==null?void 0:f.value)==null?void 0:ne.scrollTop)&&(o.scroll.scrollTopMin!==1/0&&o.scroll.scrollTopMax!==0&&me("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",Me)},{deep:!0})});const z=V=>{var ne;(ne=M==null?void 0:M.value)==null||ne.addEmoji(V)},x=async V=>{o.isFirstSend&&(o.isFirstSend=!1),o.reference.show="",t.TUICore.isOfficial&&(n!=null&&n.commit)&&(n==null||n.commit("handleTask",0))},B=V=>{o.currentMessage=V,o.dialogID=V.ID},j=V=>{o.env.isH5?(o.showResend=!0,o.resendMessage=V):t.resendMessage(V).catch(ne=>{xr(ne,o.env)})},G=V=>{o.currentMessage=V,C.list=t.TUICore.getStore().TUIConversation.conversationList,o.forwardStatus=!0},L=(V,ne)=>{let ye=T$(V);o.reference={message:V,content:ye==null?void 0:ye.referenceMessageForShow,type:ye==null?void 0:ye.referenceMessageType,show:ne}},T=()=>{t.resendMessage(o.resendMessage).then(()=>{o.showResend=!1}).catch(V=>{xr(V,o.env),o.showResend=!1})},P=V=>{var ne,ye,Be;(ne=V==null?void 0:V.payload)!=null&&ne.text&&((Be=M==null?void 0:M.value)==null||Be.reEdit((ye=V==null?void 0:V.payload)==null?void 0:ye.text))},Q=V=>{t.handleGroupApplication(V)},Y=V=>{V.clipboardData.files[0]&&t.sendImageMessage(V.clipboardData.files[0])},oe=async()=>{await t.getHistoryMessageList().then(()=>{var V;Oe("target",(V=f==null?void 0:f.value)==null?void 0:V.firstElementChild)})},X=V=>{var ye,Be;o.referenceID=V;const ne=[];for(let je=0;je<A.value.length;je++)ne.push((ye=A==null?void 0:A.value[je])==null?void 0:ye.ID),ne.indexOf(V)!==-1&&((Be=A.value[je])==null?void 0:Be.ID)===V&&(Oe("target",v.value[je]),v.value[je].getElementsByClassName("content")[0].classList.remove("reference-content"),Ir(()=>{v.value[je].getElementsByClassName("content")[0].classList.add("reference-content")}));ne.indexOf(V)===-1&&t.getHistoryMessageList().then(()=>{o.historyReference=!0})},ae=()=>{o.showGroupMemberList=!o.showGroupMemberList},fe=()=>{t.TUICore.TUIServer.TUIConversation.handleCurrentConversation()},le=V=>{window.open(V.url)},ce=(V,ne)=>{var ye,Be,je;if(!(!V||!ne))switch(ne){case"reference":L(V,ne);break;case"reply":L(V,ne);break;case"reedit":(ye=V==null?void 0:V.payload)!=null&&ye.text&&((je=M==null?void 0:M.value)==null||je.reEdit((Be=V==null?void 0:V.payload)==null?void 0:Be.text));break}},J=async(V,ne)=>{var ye;if(!(!(V!=null&&V.ID)||!ne))switch(ne){case"receipt":if(V.conversationType!==t.TUICore.TIM.TYPES.CONV_GROUP||((ye=V.readReceiptInfo)==null?void 0:ye.unreadCount)===0)return;o.currentMessage=V,o.receiptDialogStatus=!0;break;case"replies":o.currentMessage=V,o.repliesDialogStatus=!0;break;case"forward":o.currentMessage=V,C.list=t.TUICore.getStore().TUIConversation.conversationList,o.forwardStatus=!0;break;case"previewImage":o.showImagePreview=!o.showImagePreview,o.currentImagePreview=V;break}},re=async V=>{if(V)switch(V){case"receipt":o.currentMessage={},o.receiptDialogStatus=!1;break;case"replies":o.currentMessage={},o.repliesDialogStatus=!1;break}},de=()=>{var V;if(o.isFirstRender){o.needToBottom=!1,Oe("bottom"),o.isFirstRender=!1;return}if(f.value){const{scrollHeight:ne,scrollTop:ye,clientHeight:Be}=f.value;ne-(ye+Be)<=Be||((V=A.value[A.value.length-1])==null?void 0:V.flow)==="out"?Oe("bottom"):K(!0)}},Oe=(V,ne)=>{var ye;switch((ye=f==null?void 0:f.value)==null||ye.removeEventListener("scroll",Me),o.isUserAction=!0,V){case cn.scrollType.toBottom:o.needToBottom=!1,Ir(()=>{var Be,je,lt;(Be=o==null?void 0:o.env)!=null&&Be.isH5?ve():(lt=(je=f==null?void 0:f.value)==null?void 0:je.lastElementChild)==null||lt.scrollIntoView(!1),uk(f==null?void 0:f.value,"message-img",async()=>{var Fe,st,wt;(Fe=o==null?void 0:o.env)!=null&&Fe.isH5?ve():(wt=(st=f==null?void 0:f.value)==null?void 0:st.lastElementChild)==null||wt.scrollIntoView(!1),f.value.addEventListener("scroll",Me),await me("page")})});break;case cn.scrollType.toTarget:Ir(()=>{ne==null||ne.scrollIntoView(!1),uk(f==null?void 0:f.value,"message-img",async()=>{ne==null||ne.scrollIntoView(!1),f.value.addEventListener("scroll",Me),await me("page")})});break}},ve=()=>{var V;(V=document==null?void 0:document.getElementById("app"))!=null&&V.style&&(document.getElementById("app").style.marginBottom="",document.getElementById("app").style.height="100%"),f.value.scrollTop=f.value.scrollHeight},Me=()=>{const{scrollHeight:V,scrollTop:ne,clientHeight:ye}=f.value;H.value&&(o.scroll.scrollHeight=V,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)),V-(ne+ye)>ye?K(!0):K(!1),o.isUserAction=!1},K=V=>{var ne,ye,Be;switch(V){case!0:o.needToBottom=!0,(ne=o==null?void 0:o.conversation)!=null&&ne.unreadCount&&((ye=o==null?void 0:o.conversation)==null?void 0:ye.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}},me=async V=>{var Be,je,lt,Fe;if(!H.value){s((Be=o==null?void 0:o.conversation)==null?void 0:Be.conversationID);return}o.messageInView.length&&(o.messageInView=[]);let ne=0,ye=0;switch(V){case cn.inViewType.page:ne=o.scroll.scrollTop,ye=o.scroll.scrollTop+((je=f==null?void 0:f.value)==null?void 0:je.clientHeight);break;case cn.inViewType.scroll:ne=o.scroll.scrollTopMin,ye=o.scroll.scrollTopMax+((lt=f==null?void 0:f.value)==null?void 0:lt.clientHeight);break}for(let st=0;st<((Fe=v==null?void 0:v.value)==null?void 0:Fe.length);st++)if(ke(V,v==null?void 0:v.value[st],ne,ye)){const wt=A.value[st];o.messageInView.push(wt)}await u(o.messageInView)},ke=(V,ne,ye,Be)=>{const je=f.value.getBoundingClientRect().top,lt=f.value.getBoundingClientRect().bottom,{top:Fe,bottom:st}=ne.getBoundingClientRect(),{offsetTop:wt,clientHeight:mn}=ne;switch(V){case cn.inViewType.page:return Math.round(Fe)>=Math.round(je)&&Math.round(st)<=Math.round(lt);case cn.inViewType.scroll:return Math.round(wt)>=Math.round(ye)&&Math.round(wt+mn)<=Math.round(Be);default:return!1}},pe=V=>{o.dropDownRef&&o.dropDownRef.removeChild(o.dropDownRef.children[0]),o.dropDownRef=V},W=()=>{Oe("bottom")},te=V=>{o.showImagePreview=!o.showImagePreview,o.currentImagePreview=V},ie=()=>{o.reference={message:{},content:"",type:0,show:""}},Ie=(V,ne)=>{var ye;(ye=o==null?void 0:o.typingRef)==null||ye.onTyping(V,ne)};return{...Kt(o),conversationType:w,messages:A,messageEle:f,inputEle:g,messageInput:M,messageAimID:v,conversationData:C,conversationName:R,constant:cn,reportMessageSend:x,handleTyping:Ie,handleItem:B,handleEdit:P,handleEditor:ce,getHistoryMessageList:oe,handleApplication:Q,pluginComponentList:d,handleSend:z,closeDialog:re,isMute:S,pasting:Y,setMessageRead:s,sendMessageReadReceipt:u,dialog:D,jumpID:X,back:fe,slotDefault:i,toggleshowGroupMemberList:ae,resendMessage:j,submit:T,Link:q5,openLink:le,readReceiptDialog:_,scrollToTarget:Oe,needGroupReceipt:H,handleDropDownOpen:pe,isMessageTip:FO,showDialog:J,forwardMessage:G,referOrReplyMessage:L,handleUploadingImageOrVideo:W,handleImagePreview:te,imageList:N,resetReplyOrReference:ie}}});const mN=e=>(mr("data-v-2ff60418"),e=e(),vr(),e),Tte={class:"TUIChat-header"},wte={class:"setting"},Ste={class:"TUIChat-main"},kte=["id"],Dte=mN(()=>$("i",{class:"icon icon-bottom-double"},null,-1)),Ete={class:"to-bottom-tip-cont"},Ate={key:0,class:"dialog dialog-conversation"},Lte=["src"],Ote={class:"name"},Rte=["src"],Nte={key:0,class:"name"},Pte={class:"dialog dialog-conversation"},xte={class:"func",id:"func"},Ute={class:"func-main"},Fte={class:"mask-main"},Gte=mN(()=>$("i",null,null,-1)),$te={key:1,class:"TUIChat"},Bte={class:"TUIChat-header"};function Hte(e,t,n,r,o,i){var D;const s=Bt("TypingHeader"),u=Bt("Manage"),d=Bt("Replies"),f=Bt("MessageTimestamp"),g=Bt("MessageItem"),v=Bt("ReadReceiptDialog"),_=Bt("imagePreviewer"),M=Bt("MessageInput"),C=Bt("MessageSystem");return e.conversationType==="chat"?(Z(),se("div",{key:0,class:it(["TUIChat",[e.env.isH5?"TUIChat-H5":""]])},[$("header",Tte,[e.env.isH5?(Z(),se("i",{key:0,class:"icon icon-back",onClick:t[0]||(t[0]=(...w)=>e.back&&e.back(...w))})):Ce("",!0),Ct(s,{needTyping:e.needTyping,conversation:e.conversation,messageList:e.messageList,ref:"typingRef"},null,8,["needTyping","conversation","messageList"]),$("aside",wte,[e.conversation.groupProfile?(Z(),bt(u,{key:0,conversation:e.conversation,userInfo:e.userInfo,isH5:e.env.isH5},null,8,["conversation","userInfo","isH5"])):Ce("",!0),Ct(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"])])]),$("div",Ste,[$("ul",{class:"TUI-message-list",onClick:t[3]||(t[3]=w=>e.dialogID=""),ref:"messageEle",id:"messageEle"},[e.isCompleted?Ce("",!0):(Z(),se("p",{key:0,class:"message-more",onClick:t[1]||(t[1]=(...w)=>e.getHistoryMessageList&&e.getHistoryMessageList(...w))},De(e.$t("TUIChat.查看更多")),1)),(Z(!0),se(dt,null,Vt(e.messages,(w,S)=>{var R;return Z(),se("li",{key:S,id:w==null?void 0:w.ID,ref_for:!0,ref:"messageAimID"},[Ct(f,{currTime:w==null?void 0:w.time,prevTime:S>0?(R=e.messages[S-1])==null?void 0:R.time:0},null,8,["currTime","prevTime"]),Ct(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,kte)}),128)),e.needToBottom?(Z(),se("div",{key:1,class:"to-bottom-tip",onClick:t[2]||(t[2]=w=>e.scrollToTarget("bottom"))},[Dte,$("div",Ete,[$("span",null,De(e.toBottomTipCont),1)])])):Ce("",!0)],512),e.forwardStatus&&e.messageComponents.Forward?(Z(),se("div",Ate,[(Z(),bt(lf("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:Ot(({data:w})=>[$("img",{class:"avatar",src:e.conversationData.handleAvatar(w)},null,8,Lte),$("label",Ote,De(e.conversationData.handleName(w)),1)]),right:Ot(({data:w})=>[$("img",{class:"avatar",src:e.conversationData.handleAvatar(w)},null,8,Rte),e.env.isH5?Ce("",!0):(Z(),se("label",Nte,De(e.conversationData.handleName(w)),1))]),_:1},40,["list","message","show","isH5"]))])):Ce("",!0),$("div",Pte,[Ct(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?(Z(),bt(_,{key:1,currentImage:e.currentImagePreview,imageList:e.imageList,onClose:t[5]||(t[5]=w=>e.showImagePreview=!1)},null,8,["currentImage","imageList"])):Ce("",!0)]),$("div",{class:it(["TUIChat-footer",[e.isMute&&"disabled",e.env.isH5&&"TUIChat-H5-footer"]])},[$("div",xte,[$("main",Ute,[(Z(!0),se(dt,null,Vt(e.pluginComponentList,(w,S)=>(Z(),bt(lf(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))])]),Ct(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($("div",{class:"mask",onClick:t[8]||(t[8]=w=>e.showResend=!1)},[$("div",Fte,[$("header",null,De(e.$t("TUIChat.确认重发该消息?")),1),$("footer",null,[$("p",{onClick:t[6]||(t[6]=w=>e.showResend=!1)},De(e.$t("TUIChat.取消")),1),Gte,$("p",{onClick:t[7]||(t[7]=(...w)=>e.submit&&e.submit(...w))},De(e.$t("TUIChat.确定")),1)])])],512),[[eo,e.showResend]])],2)):e.conversationType==="system"?(Z(),se("div",$te,[$("header",Bte,[$("h1",null,De(e.conversationName),1)]),Ct(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 _c=Wt(gN,[["render",Hte],["__scopeId","data-v-2ff60418"]]),vN=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=jt({emojiUrl:uh,emojiMap:uf,emojiName:DO,faceUrl:b$,bigEmojiList:((f=window==null?void 0:window.TUIKitTUICore)==null?void 0:f.isOfficial)&&M$||[],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))};Xs(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=uh+uf[g],_.template=`<img src="${uh+uf[g]}">`,e.isH5||o(),t.emit("send",_);try{await vN.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.bigEmojiList.length;v++)g.push(n.bigEmojiList[v].list);return g}),d=g=>{n.currentIndex=g};return{...Kt(n),toggleShow:o,select:s,selectFace:d,list:u,dialog:r}}});const qte=e=>(mr("data-v-66fdb436"),e=e(),vr(),e),Vte={class:"face",id:"face"},zte=["onClick"],jte=["src"],Wte=["src"],Kte={class:"face-tab"},Yte=qte(()=>$("i",{class:"icon icon-face"},null,-1)),Jte=[Yte],Xte=["onClick"],Zte=["src"];function Qte(e,t,n,r,o,i){return Z(),se("div",Vte,[$("i",{class:"icon icon-face",title:"表情",onClick:t[0]||(t[0]=(...s)=>e.toggleShow&&e.toggleShow(...s))}),$n($("main",{class:it(["face-main",[e.isH5&&"face-H5-main"]]),ref:"dialog"},[(Z(!0),se(dt,null,Vt(e.list,(s,u)=>$n((Z(),se("ul",{class:"face-list",key:u},[(Z(!0),se(dt,null,Vt(s,(d,f)=>(Z(),se("li",{class:"face-list-item",key:f,onClick:g=>e.select(d,f)},[u===0?(Z(),se("img",{key:0,src:e.emojiUrl+e.emojiMap[d]},null,8,jte)):(Z(),se("img",{key:1,class:"face-img",src:e.faceUrl+d+"@2x.png"},null,8,Wte))],8,zte))),128))])),[[eo,e.currentIndex===u]])),128)),$("ul",Kte,[$("li",{class:"face-tab-item",onClick:t[1]||(t[1]=s=>e.selectFace(0))},Jte),(Z(!0),se(dt,null,Vt(e.bigEmojiList,(s,u)=>(Z(),se("li",{class:"face-tab-item",key:u,onClick:d=>e.selectFace(u+1)},[$("img",{src:e.faceUrl+s.list[0]+"@2x.png"},null,8,Zte)],8,Xte))),128))])],2),[[eo,e.show]])])}const ene=Wt(vN,[["render",Qte],["__scopeId","data-v-66fdb436"]]),yN=ot({props:{show:{type:Boolean,default:()=>!1},isMute:{type:Boolean,default:()=>!1},isH5:{type:Boolean,default:()=>!1}},setup(e,t){const n=jt({isMute:!1});nn(()=>{n.isMute=e.isMute});const r=async o=>{if(o.target.files.length>0)try{await yN.TUIServer.sendImageMessage(o.target)}catch(i){xr(i,e)}o.target.value=""};return{...Kt(n),sendUploadMessage:r}}});const tne={class:"upload-btn icon icon-image"};function nne(e,t,n,r,o,i){return Z(),se("span",tne,[e.isMute?Ce("",!0):(Z(),se("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 rne=Wt(yN,[["render",nne],["__scopeId","data-v-5154d9d1"]]),_N=ot({props:{show:{type:Boolean,default:()=>!1},isMute:{type:Boolean,default:()=>!1},isH5:{type:Boolean,default:()=>!1}},setup(e,t){const n=jt({isMute:!1});nn(()=>{n.isMute=e.isMute});const r=async o=>{if(o.target.files.length>0)try{await _N.TUIServer.sendVideoMessage(o.target)}catch(i){xr(i,e)}o.target.value=""};return{...Kt(n),sendUploadMessage:r}}});const one={class:"upload-btn icon icon-video"};function ine(e,t,n,r,o,i){return Z(),se("span",one,[e.isMute?Ce("",!0):(Z(),se("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 sne=Wt(_N,[["render",ine],["__scopeId","data-v-b53ef5ce"]]),bN=ot({props:{show:{type:Boolean,default:()=>!1},isMute:{type:Boolean,default:()=>!1},isH5:{type:Boolean,default:()=>!1}},setup(e,t){const n=jt({isMute:!1});nn(()=>{n.isMute=e.isMute});const r=async o=>{if(o.target.files.length>0)try{await bN.TUIServer.sendFileMessage(o.target)}catch(i){xr(i,e)}o.target.value=""};return{...Kt(n),sendUploadMessage:r}}});const ane={class:"upload-btn icon icon-files"};function lne(e,t,n,r,o,i){return Z(),se("span",ane,[e.isMute?Ce("",!0):(Z(),se("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 une=Wt(bN,[["render",lne],["__scopeId","data-v-0ea80c3b"]]),MN=ot({components:{Transfer:QC},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=jt({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)};Xs(r,()=>{n.show=!1,t.emit("update:show",n.show),n.to=-1});const i=async s=>{s.map(async u=>{try{await MN.TUIServer.forwardMessage(e.message,u)}catch(d){xr(d,e)}}),o()};return{...Kt(n),toggleShow:o,handleForWordMessage:i,dialog:r}}});function cne(e,t,n,r,o,i){const s=Bt("Transfer");return Z(),se("div",null,[e.show?(Z(),se("div",{key:0,class:it(["forward",[e.isH5?"forward-h5":""]]),ref:"dialog"},[Ct(s,{title:"转发",list:e.list,isSearch:!1,isH5:e.isH5,isCustomItem:!0,resultShow:!0,onSubmit:e.handleForWordMessage,onCancel:e.toggleShow},{left:Ot(({data:u})=>[Ft(e.$slots,"left",{data:u},void 0,!0)]),right:Ot(({data:u})=>[Ft(e.$slots,"right",{data:u},void 0,!0)]),_:3},8,["list","isH5","onSubmit","onCancel"])],2)):Ce("",!0)])}const dne=Wt(MN,[["render",cne],["__scopeId","data-v-d1d04d9f"]]),IN=ot({props:{needTyping:{type:Boolean,default:!1},conversation:{type:Object,default:()=>({})},messageList:{type:Array,default:()=>[]}},setup(e,t){const n=jt({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 Wh(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)=>{Ir(()=>{var D,w;M.length===0||i.value!=="C2C"||(n.lastOtherMessageTime=g(M),((D=M[M.length-1])==null?void 0:D.flow)==="in"&&(cf(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}=nr((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:""},IN.TUIServer.sendTypingMessage(n.options)},g=M=>{if(!M)return 0;for(let C=M.length-1;C>=0;C--)if(!cf(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{...Kt(n),conversationID:r,conversationName:o,conversationType:i,title:s,isTypingMessage:cf,sendTypingMessage:f,handleTypingMessageStatus:d,getLastOtherMessageTime:g,debounce:v,waitTypingEnd:_,onTyping:u}}});function fne(e,t,n,r,o,i){return Z(),se("h1",null,De(e.title==="对方正在输入"?e.$t("TUIChat.对方正在输入"):e.title),1)}const pne=Wt(IN,[["render",fne],["__scopeId","data-v-8592c23b"]]),ys=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=jt({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:jh()}),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())};Xs(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 ys.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 R=S.data.readUserIDList,A=await d(R);r.readReceiptList[0].userList=C?[...r.readReceiptList[0].userList,...A]:A}catch(S){if(S&&(S==null?void 0:S.code)===10062){const R=n("TUIChat.您当前购买使用的套餐包暂未开通群消息已读回执功能");xr(R,r.env),console.warn(R)}}},u=async(C=!1)=>{var R;if(!r.isGroup||!r.message||Object.keys(r.message).length===0)return;const D=await ys.TUIServer.getGroupUnreadMemberList(r.message,C?r.readReceiptList[1].cursor:"");r.readReceiptList[1].isCompleted=D==null?void 0:D.data.isCompleted,r.readReceiptList[1].cursor=((R=D==null?void 0:D.data)==null?void 0:R.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 ys.TUIServer.getUserProfile(C)).data.forEach(R=>{D.push({nick:R==null?void 0:R.nick,avatar:R==null?void 0:R.avatar,userID:R==null?void 0:R.userID})}),D},f=()=>{var C;((C=r.message)==null?void 0:C.conversationType)===ys.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,R,A,N;if(!(!r.message||!r.isH5))switch(r.message.type){case ys.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 ys.TUIServer.TUICore.TIM.TYPES.MSG_CUSTOM:r.messageInfo.content=n("TUIChat.自定义"),r.messageInfo.isImg=!1;break;case ys.TUIServer.TUICore.TIM.TYPES.MSG_IMAGE:r.messageInfo.content=(w=NO(r.message))==null?void 0:w.url,r.messageInfo.isImg=!0;break;case ys.TUIServer.TUICore.TIM.TYPES.MSG_AUDIO:r.messageInfo.content=n("TUIChat.语音"),r.messageInfo.isImg=!1;break;case ys.TUIServer.TUICore.TIM.TYPES.MSG_VIDEO:r.messageInfo.content=(S=PO(r.message))==null?void 0:S.snapshotUrl,r.messageInfo.isImg=!0;break;case ys.TUIServer.TUICore.TIM.TYPES.MSG_FILE:r.messageInfo.content=n("TUIChat.文件")+((A=(R=r.message)==null?void 0:R.payload)==null?void 0:A.fileName),r.messageInfo.isImg=!1;break;case ys.TUIServer.TUICore.TIM.TYPES.MSG_FACE:r.messageInfo.content=(N=RO(r.message))==null?void 0:N.url,r.messageInfo.isImg=!0;break}},M=()=>{var C;r.isMenuOpen=!!((C=document==null?void 0:document.getElementsByClassName("home-menu"))!=null&&C.length)};return{...Kt(r),dialog:o,toggleShow:i,getReadList:s,getUnreadList:u,isGroup:f,handleAvatarAndName:d,close:v,getMoreList:g,showMessage:_,caculateTimeago:vg,handleDialogPosition:M}}});const hne={class:"header"},gne={class:"header-back"},mne={class:"header-title"},vne={class:"header-close"},yne={class:"body"},_ne={key:0,class:"body-message"},bne={class:"message"},Mne={class:"message-info"},Ine={class:"message-cont"},Cne=["src"],Tne={key:1},wne={class:"body-tab"},Sne=["onClick"],kne={class:"tab-item-title"},Dne={class:"tab-item-count"},Ene={class:"body-list"},Ane=["src"],Lne={class:"name"};function One(e,t,n,r,o,i){return e.show?(Z(),se("div",{key:0,class:it(["read-receipt",[e.isH5?"read-receipt-H5":"",e.isMenuOpen?"read-receipt-menu-open":""]]),ref:"dialog"},[$("div",hne,[$("div",gne,[e.isH5?(Z(),se("i",{key:0,class:"icon icon-back",onClick:t[0]||(t[0]=(...s)=>e.toggleShow&&e.toggleShow(...s))})):Ce("",!0)]),$("div",mne,[$("span",null,De(e.$t("TUIChat.消息详情")),1)]),$("div",vne,[e.isH5?Ce("",!0):(Z(),se("i",{key:0,class:"icon icon-close",onClick:t[1]||(t[1]=(...s)=>e.toggleShow&&e.toggleShow(...s))}))])]),$("div",yne,[e.isH5?(Z(),se("div",_ne,[$("div",bne,[$("div",Mne,[$("span",null,De(e.message.from),1),$("span",null,De(e.caculateTimeago(e.message.time*1e3)),1)]),$("div",Ine,[e.messageInfo.isImg?(Z(),se("img",{key:0,class:"message-cont-img",src:e.messageInfo.content},null,8,Cne)):(Z(),se("p",Tne,De(e.messageInfo.content),1))])])])):Ce("",!0),$("div",wne,[(Z(!0),se(dt,null,Vt(e.readReceiptList,(s,u)=>(Z(),se(dt,null,[s.show?(Z(),se("div",{class:it(["tab-item",u===e.showListNow&&"tab-item-now"]),key:u,onClick:d=>e.showListNow=u},[$("div",kne,De(s==null?void 0:s.label),1),$("div",Dne,De(s==null?void 0:s.count),1)],10,Sne)):Ce("",!0)],64))),256))]),$("div",Ene,[$("ul",null,[(Z(!0),se(dt,null,Vt(e.readReceiptList[e.showListNow].userList,(s,u)=>(Z(),se("li",{key:u,class:"body-list-item"},[$("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,Ane),$("div",Lne,De((s==null?void 0:s.nick)||(s==null?void 0:s.userID)),1)]))),128))]),e.readReceiptList[e.showListNow].isCompleted?Ce("",!0):(Z(),se("div",{key:0,class:"more",onClick:t[2]||(t[2]=(...s)=>e.getMoreList&&e.getMoreList(...s))},"查看更多"))])])],2)):Ce("",!0)}const Rne=Wt(ys,[["render",One],["__scopeId","data-v-feb5f684"]]),Nne=ot({props:{message:{type:Object,default:()=>({})},isH5:{type:Boolean,default:!1},isRoot:{type:Boolean,default:!1}},components:{MessageText:$O,MessageEmojiReact:ZC},setup(e,t){const n=jt({message:{},isCustom:{},isH5:!1,url:"",isRoot:!1,constant:cn,TIM:vt});nn(()=>{var i,s;n.message=e.message;const{payload:o}=e.message;n.isCustom=(o==null?void 0:o.data)||" ",n.isCustom=nr(o==null?void 0:o.data),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/${(s=(i=n.message)==null?void 0:i.payload)==null?void 0:s.data}@2x.png`),console.log(e.message,"----------------- ")});const r=async()=>{};return{...Kt(n),handleNotice:r,handleTextMessageShowContext:OO,handleCustomMessageShowContext:UO,handleFileMessageShowContext:xO,caculateTimeago:vg}}});const vT=e=>(mr("data-v-3178d8e3"),e=e(),vr(),e),Pne={class:"message-bubble",ref:"htmlRefHook"},xne=["src"],Une={class:"message-area"},Fne={class:"message-area-title"},Gne={class:"name"},$ne={class:"time"},Bne={class:"content content-in"},Hne={key:1},qne=vT(()=>$("div",{class:"notice-title"},[$("i",{class:"iconNotice"}),$("span",null,"群公告")],-1)),Vne={class:"content"},zne={class:"content-title"},jne={class:"content-text"},Wne={key:1},Kne=["src"],Yne=vT(()=>$("i",{class:"icon icon-voice"},null,-1)),Jne={key:4,class:"message-video-cover"},Xne=["src"],Zne=["src"],Qne={key:6,class:"message-file"},ere=vT(()=>$("i",{class:"icon icon-files"},null,-1)),tre={class:"message-file-content"};function nre(e,t,n,r,o,i){var d,f,g,v,_,M,C,D,w,S,R,A,N,H,z,x,B,j,G,L;const s=Bt("MessageText"),u=Bt("MessageEmojiReact");return Z(),se("div",{class:it(["replies-item",e.isRoot?"":"replies-item-normal"])},[$("div",Pne,[$("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,xne),$("main",Une,[$("div",Fne,[$("label",Gne,De(e.isRoot?e.message.nameCard||e.message.nick||e.message.from:e.message.messageSenderName||e.message.messageSender),1),$("label",$ne,De(e.caculateTimeago((e.isRoot?(f=e.message)==null?void 0:f.time:(g=e.message)==null?void 0:g.messageTime)*1e3)),1)]),$("div",Bne,[e.message.messageType===e.constant.typeText||e.message.type===e.TIM.TYPES.MSG_TEXT||!e.isRoot?(Z(),bt(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?(Z(),se("span",Hne,[e.isCustom.businessID===e.constant.TC_GROUP_NOTICE?(Z(),se("div",{key:0,class:"notice-message",onClick:t[0]||(t[0]=(...T)=>e.handleNotice&&e.handleNotice(...T))},[qne,$("div",Vne,[$("div",zne,De(e.isCustom.msgTitle),1),$("div",jne,De(e.isCustom.msgContent),1)])])):(Z(),se("span",Wne,De((_=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?(Z(),se("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,Kne)):Ce("",!0),e.message.messageType===e.constant.typeAudio||e.message.type===e.TIM.TYPES.MSG_AUDIO?(Z(),se("div",{key:3,class:"message-audio",style:Ro(`width: ${((w=(D=e.message)==null?void 0:D.payload)==null?void 0:w.second)*10+40}Px`)},[Yne,$("label",null,De((R=(S=e.message)==null?void 0:S.payload)==null?void 0:R.second)+"s",1)],4)):Ce("",!0),e.message.messageType===e.constant.typeVideo||e.message.type===e.TIM.TYPES.MSG_VIDEO?(Z(),se("div",Jne,[$("img",{class:"message-videoimg",src:((N=(A=e.message)==null?void 0:A.payload)==null?void 0:N.snapshotUrl)||((z=(H=e.message)==null?void 0:H.payload)==null?void 0:z.thumbUrl)},null,8,Xne)])):Ce("",!0),e.message.messageType===e.constant.typeFace||e.message.type===e.TIM.TYPES.MSG_FACE?(Z(),se("img",{key:5,class:"message-img",src:e.url},null,8,Zne)):Ce("",!0),e.message.messageType===e.constant.typeFile||e.message.type===e.TIM.TYPES.MSG_FILE?(Z(),se("div",Qne,[ere,$("div",tre,[$("label",null,De((B=(x=e.message)==null?void 0:x.payload)==null?void 0:B.fileName),1),$("span",null,De(((j=e.handleFileMessageShowContext(e.message))==null?void 0:j.size)||((L=(G=e.message)==null?void 0:G.payload)==null?void 0:L.fileSize)),1)])])):Ce("",!0),Ct(u,{message:e.message,type:"content"},null,8,["message"])])])],512)],2)}const rre=Wt(Nne,[["render",nre],["__scopeId","data-v-3178d8e3"]]),ore=ot({type:"custom",components:{RepliesItem:rre},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=jt({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())};Xs(r,()=>{n.show=!1,t.emit("closeDialog","replies"),s()});const i=async d=>{var f,g;try{const{cloudCustomData:v}=d;if(!v)return;const _=nr(v);n.replies=(f=_==null?void 0:_.messageReplies)==null?void 0:f.replies,(g=n==null?void 0:n.replies)==null||g.forEach(async M=>{var S,R,A;const{messageID:C,messageSender:D}=M,w=n.messageList.find(N=>N.ID===C||N.from===D);M.avatar=w?w==null?void 0:w.avatar:"";try{const N=await CV({imUserIds:[D]});M.messageSenderName=((S=N.data[0])==null?void 0:S.friendNickname)||((R=N.data[0])==null?void 0:R.imUserId),M.avatar=((A=N.data[0])==null?void 0:A.friendAvatar)||""}catch{}})}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{...Kt(n),dialog:r,toggleShow:o,close:s,caculateTimeago:vg,handleDialogPosition:u}}});const ire={class:"header"},sre={class:"header-back"},are={class:"header-title"},lre={class:"header-close"},ure={class:"body"},cre={class:"body-message"},dre={class:"body-list"};function fre(e,t,n,r,o,i){const s=Bt("RepliesItem");return e.show?(Z(),se("div",{key:0,class:it(["replies",[e.isH5?"replies-H5":"",e.isMenuOpen?"replies-menu-open":""]]),ref:"dialog"},[$("div",ire,[$("div",sre,[e.isH5?(Z(),se("i",{key:0,class:"icon icon-back",onClick:t[0]||(t[0]=(...u)=>e.toggleShow&&e.toggleShow(...u))})):Ce("",!0)]),$("div",are,[$("span",null,De(e.$t("TUIChat.回复详情")),1)]),$("div",lre,[e.isH5?Ce("",!0):(Z(),se("i",{key:0,class:"icon icon-close",onClick:t[1]||(t[1]=(...u)=>e.toggleShow&&e.toggleShow(...u))}))])]),$("div",ure,[$("div",cre,[Ct(s,{message:e.message,isH5:e.isH5,isRoot:!0},null,8,["message","isH5"])]),$("div",dre,[$("ul",null,[(Z(!0),se(dt,null,Vt(e.replies,(u,d)=>(Z(),se("li",{key:d,class:"body-list-item"},[Ct(s,{message:u,isH5:e.isH5,isRoot:!1},null,8,["message","isH5"])]))),128))])])])],2)):Ce("",!0)}const pre=Wt(ore,[["render",fre],["__scopeId","data-v-1c01111b"]]),CN=e=>(mr("data-v-76bd8c1c"),e=e(),vr(),e),hre=["src"],gre=CN(()=>$("i",{class:"icon icon-left-arrow"},null,-1)),mre=[gre],vre=CN(()=>$("i",{class:"icon icon-right-arrow"},null,-1)),yre=[vre],_re={class:"actions-bar"},bre={class:"image-counter"},Mre=ot({__name:"imagePreviewer",props:{imageList:{type:Array,default:()=>[]},currentImage:{type:Object,default:()=>({})}},emits:["close"],setup(e,{emit:t}){const n=e;function r(X){return typeof X=="number"&&isFinite(X)}const o=Ne(1),i=Ne(0),s=Ne(.1),u=Ne(0),d=Ne(),f=Ne(),{isH5:g}=jh();let v=0,_={},M=!1,C=!1,D=null;nn(()=>{u.value=n.imageList.findIndex(X=>X.ID===n.currentImage.ID)});const w=X=>{X.preventDefault(),H(X),z(X)},S=X=>{X.preventDefault(),M=!0,X.touches&&X.touches.length===2&&(C=!0,x(X))},R=X=>{var le;X.preventDefault();let ae=0,fe=0;if(C){D||(C=!1,delete _.pageX2,delete _.pageY2,D=setTimeout(()=>{D=null},200));return}if(D===null){switch(M){case!0:ae=(le=X==null?void 0:X.changedTouches[0])==null?void 0:le.pageX,fe=ae-v,fe>100?Y():fe<-100&&Q();break;case!1:L();break}D=setTimeout(()=>{D=null},200)}},A=X=>{C=!1,delete _.pageX1,delete _.pageY1},N=X=>{if(X.preventDefault(),Math.abs(X.deltaX)!==0&&Math.abs(X.deltaY)!==0)return;let ae=o.value;ae+=X.deltaY*(X.ctrlKey?-.01:.002),ae=Math.min(Math.max(.125,ae),4),o.value=ae},H=X=>{var ae;v=(ae=X==null?void 0:X.changedTouches[0])==null?void 0:ae.pageX,M=!1},z=X=>{let ae=X==null?void 0:X.touches[0],fe=X==null?void 0:X.touches[1];_.pageX1=ae==null?void 0:ae.pageX,_.pageY1=ae==null?void 0:ae.pageY,fe&&(_.pageX2=fe==null?void 0:fe.pageX,_.pageY2=fe==null?void 0:fe.pageY)},x=X=>{let ae=X==null?void 0:X.touches[0],fe=X==null?void 0:X.touches[1];fe&&(r(_.pageX2)||(_.pageX2=fe.pageX),r(_.pageY2)||(_.pageY2=fe.pageY));const le=(J,re,de,Oe)=>Math.hypot(de-J,Oe-re);if(!r(_.pageX1)||!r(_.pageY1)||!r(_.pageX2)||!r(_.pageY2))return;let ce=le(ae.pageX,ae.pageY,fe.pageX,fe.pageY)/le(_.pageX1,_.pageY1,_.pageX2,_.pageY2);o.value=Math.min(Math.max(.5,o.value*ce),4)};On(()=>{var X,ae,fe,le,ce;(X=d==null?void 0:d.value)==null||X.addEventListener("touchstart",w),(ae=d==null?void 0:d.value)==null||ae.addEventListener("touchmove",S),(fe=d==null?void 0:d.value)==null||fe.addEventListener("touchend",R),(le=d==null?void 0:d.value)==null||le.addEventListener("touchcancel;",A),(ce=d==null?void 0:d.value)==null||ce.addEventListener("wheel",N),document==null||document.addEventListener("keydown",B)});const B=X=>{X.preventDefault(),(X==null?void 0:X.keyCode)===27&&L()},j=()=>{o.value+=.1},G=()=>{o.value=o.value-.1>s.value?o.value-.1:s.value},L=()=>{t("close")},T=()=>{i.value-=90},P=()=>{i.value+=90},Q=()=>{f.value.style.transition="0.5s",u.value<n.imageList.length-1&&u.value++,oe()},Y=()=>{f.value.style.transition="0.5s",u.value>0&&u.value--,oe()},oe=()=>{o.value=1,i.value=0};return hl(()=>{var X,ae,fe,le,ce;(X=d==null?void 0:d.value)==null||X.removeEventListener("touchstart",w),(ae=d==null?void 0:d.value)==null||ae.removeEventListener("touchmove",S),(fe=d==null?void 0:d.value)==null||fe.removeEventListener("touchend",R),(le=d==null?void 0:d.value)==null||le.removeEventListener("touchcancel;",A),(ce=d==null?void 0:d.value)==null||ce.removeEventListener("wheel",N),document==null||document.removeEventListener("keydown",B)}),(X,ae)=>{var fe;return Z(),se("div",{class:it(["image-previewer",[Le(g)&&"image-previewer-h5"]])},[$("div",{class:"image-wrapper",ref_key:"image",ref:d},[$("ul",{class:"image-list",style:Ro({width:`${e.imageList.length*100}%`,transform:`translateX(-${u.value*100/e.imageList.length}%)`}),ref_key:"ul",ref:f},[(Z(!0),se(dt,null,Vt(e.imageList,(le,ce)=>{var J,re;return Z(),se("li",{class:"image-item",key:ce},[$("img",{class:"image-preview",style:Ro({transform:`scale(${o.value}) rotate(${i.value}deg)`}),src:(re=(J=le==null?void 0:le.payload)==null?void 0:J.imageInfoArray[0])==null?void 0:re.url},null,12,hre)])}),128))],4)],512),$n($("i",{class:"icon icon-close",onClick:L},null,512),[[eo,!Le(g)]]),$n($("div",{class:"image-button image-button-left",onClick:Y},mre,512),[[eo,!Le(g)&&u.value>0]]),$n($("div",{class:"image-button image-button-right",onClick:Q},yre,512),[[eo,!Le(g)&&u.value<((fe=e.imageList)==null?void 0:fe.length)-1]]),$("div",_re,[$("i",{class:"icon icon-zoom-in",onClick:j}),$("i",{class:"icon icon-zoom-out",onClick:G}),$("i",{class:"icon icon-refresh-left",onClick:T}),$("i",{class:"icon icon-refresh-right",onClick:P}),$("span",bre,De(u.value+1)+" / "+De(e.imageList.length),1)])],2)}}});const Ire=Wt(Mre,[["__scopeId","data-v-76bd8c1c"]]);let Pf={Face:ene,Image:rne,Video:sne,File:une};const yT={Forward:dne},_T={TypingHeader:pne,ReadReceiptDialog:Rne,Replies:pre,ImagePreviewer:Ire,MessageInput:hN};function eD(e){let t={};switch(e){case"send":t=Pf;break;case"message":t=yT;break;case"other":t=_T;break}return t}const Cre=e=>{const t={...Pf,...yT,..._T};Object.keys(t).forEach(n=>{t[n].TUIServer=il.server}),_c.TUIServer=il.server,_c.components={..._c.components,...t},e.component(il.name,_c)},Tre=e=>(il.server=new GO(e),e.component(il.name,il),il),wre=e=>{Pf={...Pf,...e}},Sre=e=>{e.map(t=>(delete Pf[t],t))},il={name:"TUIChat",component:_c,server:GO,sendComponents:Pf,messageComponents:yT,otherComponents:_T,install:Cre,plugin:Tre,setPluginComponents:wre,removePluginComponents:Sre};class TN extends ad{constructor(n){super();Jt(this,"TUICore");Jt(this,"store");Jt(this,"currentStore",{});Jt(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 kre=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=jt({conversation:{},currentID:"",currentConversation:{},toggle:!1,currentuserID:"",conversationType:"",loop:0,displayOnlineStatus:!1,userStatusList:new Map}),r=Ne(),o=Ne();Xs(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&&Ir(()=>{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{...Kt(n),handleListItem:i,handleItem:u,dialog:r,content:o,toggleDialog:s,showUserOnlineStatus:d}}}),wN=""+new URL("mute-81a6d6d5.svg",import.meta.url).href;const Dre=e=>(mr("data-v-ae130881"),e=e(),vr(),e),Ere=["id"],Are={class:"left"},Lre=["src"],Ore={key:1,class:"num"},Rre={key:2,class:"num-notify"},Nre={class:"content"},Pre={class:"content-header"},xre={class:"name"},Ure={class:"middle-box"},Fre={key:0,class:"middle-box-at"},Gre={class:"content-footer"},$re={class:"time"},Bre={key:0,class:"mute-icon",src:wN},Hre=Dre(()=>$("i",null,null,-1)),qre={key:0,class:"dialog dialog-item",ref:"dialog"};function Vre(e,t,n,r,o,i){var u,d,f,g,v,_,M,C,D;const s=EU("TUILongPress");return Z(),se("li",{ref:"content",class:it(["TUI-conversation-content",[e.currentID===e.conversation.conversationID&&"selected",e.conversation.isPinned&&"pinned",e.isH5?"list-item-h5":""]]),id:e.conversation.conversationID},[$n((Z(),se("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"]))},[$("aside",Are,[$("img",{class:"avatar",src:(u=e.handleConversation)==null?void 0:u.avator(e.conversation)},null,8,Lre),e.showUserOnlineStatus()?(Z(),se("div",{key:0,class:it(["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"?(Z(),se("span",Ore,De(e.conversation.unreadCount>99?"99+":e.conversation.unreadCount),1)):Ce("",!0),e.conversation.unreadCount>0&&e.conversation.messageRemindType==="AcceptNotNotify"?(Z(),se("span",Rre)):Ce("",!0)]),$("div",Nre,[$("div",Pre,[$("label",null,[$("p",xre,De((_=e.handleConversation)==null?void 0:_.name(e.conversation)),1)]),$("div",Ure,[e.conversation.type==="GROUP"&&e.conversation.groupAtInfoList.length>0?(Z(),se("span",Fre,De((M=e.handleConversation)==null?void 0:M.showAt(e.conversation)),1)):Ce("",!0),$("p",null,De((C=e.handleConversation)==null?void 0:C.showMessage(e.conversation)),1)])]),$("div",Gre,[$("span",$re,De((D=e.handleConversation)==null?void 0:D.time(e.conversation.lastMessage.lastTime)),1),e.conversation.messageRemindType==="AcceptNotNotify"?(Z(),se("img",Bre)):Ce("",!0),Hre])])],32)),[[s,e.toggleDialog,void 0,{self:!0}]]),e.toggle?(Z(),se("div",qre,[$("p",{class:"conversation-options",onClick:t[2]||(t[2]=bn(w=>e.handleItem("delete"),["stop"]))},De(e.$t("TUIConversation.删除会话")),1),e.conversation.isPinned?Ce("",!0):(Z(),se("p",{key:0,class:"conversation-options",onClick:t[3]||(t[3]=bn(w=>e.handleItem("ispinned"),["stop"]))},De(e.$t("TUIConversation.置顶会话")),1)),e.conversation.isPinned?(Z(),se("p",{key:1,class:"conversation-options",onClick:t[4]||(t[4]=bn(w=>e.handleItem("dispinned"),["stop"]))},De(e.$t("TUIConversation.取消置顶")),1)):Ce("",!0),e.conversation.messageRemindType===""||e.conversation.messageRemindType==="AcceptAndNotify"?(Z(),se("p",{key:2,class:"conversation-options",onClick:t[5]||(t[5]=bn(w=>e.handleItem("mute"),["stop"]))},De(e.$t("TUIConversation.消息免打扰")),1)):Ce("",!0),e.conversation.messageRemindType==="AcceptNotNotify"?(Z(),se("p",{key:3,class:"conversation-options",onClick:t[6]||(t[6]=bn(w=>e.handleItem("notMute"),["stop"]))},De(e.$t("TUIConversation.取消免打扰")),1)):Ce("",!0)],512)):Ce("",!0)],10,Ere)}const zre=Wt(kre,[["render",Vre],["__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:zre},setup(e,t){const n=iv==null?void 0:iv.TUIServer,r=jt({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{...Kt(r),handleListItem:i,handleItem:s,handleToggleListItem:g,list:o,scrollChange:v}}});function jre(e,t,n,r,o,i){const s=Bt("LiteItem");return Z(),se("ul",{class:it(["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))},[(Z(!0),se(dt,null,Vt(e.data.list,(u,d)=>(Z(),bt(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 tD=Wt(iv,[["render",jre],["__scopeId","data-v-b277067c"]]),sv=ot({name:"TUIConversation",components:{TUIConversationList:tD},props:{displayOnlineStatus:{type:Boolean,default:!1}},setup(e,t){const n=sv==null?void 0:sv.TUIServer,r=jt({currentConversationID:"",keyword:"",loading:!1,conversationData:{list:[],handleItemAvator:g=>EC(g),handleItemName:g=>Wh(g),handleShowAt:g=>LO(g),handleShowMessage:g=>w$(g),handleItemTime:g=>g>0?vg(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}tD.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)}),Hf(()=>{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=zy(g=>{e.loading||u(g)},500),f=g=>{g.stopPropagation(),g.code==="Enter"&&d(r.keyword)};return{...Kt(r),handleCurrentConversation:s,isNetwork:i,noSearch:u,onKeyup:f,debouncedRequest:d}}});const s0=e=>(mr("data-v-e0ac6afb"),e=e(),vr(),e),Wre={style:{height:"100%"}},Kre={class:"sectionSearch"},Yre=s0(()=>$("span",{class:"icon-search-input"},null,-1)),Jre={class:"TUI-conversation"},Xre={key:0,class:"network"},Zre=s0(()=>$("i",{class:"icon icon-error"},"!",-1)),Qre={class:"TUI-conversation-list"},eoe={key:1,class:"theEmtpy",style:{height:"90%"}},toe=s0(()=>$("img",{class:"emptyImg",src:cd},null,-1)),noe=s0(()=>$("p",null,"暂无数据",-1)),roe=[toe,noe];function ooe(e,t,n,r,o,i){const s=Bt("n-input"),u=Bt("TUIConversationList");return Z(),se("div",Wre,[$("div",Kre,[Ct(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:Ot(()=>[Yre]),_:1},8,["value","onKeyup"])]),$("div",Jre,[e.isNetwork?(Z(),se("div",Xre,[Zre,$("p",null,"️"+De(e.$t("TUIConversation.网络异常,请您检查网络设置")),1)])):Ce("",!0),$("main",Qre,[Ct(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?(Z(),se("div",eoe,roe)):Ce("",!0)])])}const uI=Wt(sv,[["render",ooe],["__scopeId","data-v-e0ac6afb"]]),ioe=e=>{uI.TUIServer=Jl.server,e.component(Jl.name,uI)},soe=e=>(Jl.server=new TN(e),e.component(Jl.name,Jl),Jl),Jl={name:"TUIConversation",component:uI,server:TN,install:ioe,plugin:soe},aoe={profile:{}};class SN extends ad{constructor(n){super();Jt(this,"TUICore");Jt(this,"store");Jt(this,"currentStore",{});this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIProfile",aoe,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 Es(e){"@babel/helpers - typeof";return Es=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},Es(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.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function an(e){Xt(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||Es(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 jc(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 dl(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 kN(e,t){if(Xt(2,arguments),!t||Es(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?dl(f,r+n*12):f,v=i||o?jc(g,i+o*7):g,_=u+s*60,M=d+_*60,C=M*1e3,D=new Date(v.getTime()+C);return D}function loe(e,t){Xt(2,arguments);var n=an(e).getTime(),r=on(t);return new Date(n+r)}var uoe={};function Lu(){return uoe}function bT(e,t){var n,r,o,i,s,u,d,f;Xt(1,arguments);var g=Lu(),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<v?7:0)+M-v;return _.setDate(_.getDate()-C),_.setHours(0,0,0,0),_}function ey(e){return Xt(1,arguments),bT(e,{weekStartsOn:1})}function coe(e){Xt(1,arguments);var t=an(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=ey(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=ey(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function doe(e){Xt(1,arguments);var t=coe(e),n=new Date(0);n.setFullYear(t,0,4),n.setHours(0,0,0,0);var r=ey(n);return r}function ty(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 nD(e){Xt(1,arguments);var t=an(e);return t.setHours(0,0,0,0),t}var foe=864e5;function poe(e,t){Xt(2,arguments);var n=nD(e),r=nD(t),o=n.getTime()-ty(n),i=r.getTime()-ty(r);return Math.round((o-i)/foe)}function DN(e,t){Xt(2,arguments);var n=on(t);return dl(e,n*12)}var hoe=6e4,goe=36e5,moe=1e3;function EN(e){return Xt(1,arguments),e instanceof Date||Es(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _h(e){if(Xt(1,arguments),!EN(e)&&typeof e!="number")return!1;var t=an(e);return!isNaN(Number(t))}function voe(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 yoe(e,t){var n,r,o,i,s,u,d,f;Xt(1,arguments);var g=Lu(),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<v?-7:0)+6-(M-v);return _.setDate(_.getDate()+C),_.setHours(23,59,59,999),_}function AN(e,t){Xt(2,arguments);var n=on(t);return loe(e,-n)}var _oe=864e5;function boe(e){Xt(1,arguments);var t=an(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/_oe)+1}function xf(e){Xt(1,arguments);var t=1,n=an(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function LN(e){Xt(1,arguments);var t=an(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=xf(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=xf(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Moe(e){Xt(1,arguments);var t=LN(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=xf(n);return r}var Ioe=6048e5;function ON(e){Xt(1,arguments);var t=an(e),n=xf(t).getTime()-Moe(t).getTime();return Math.round(n/Ioe)+1}function rd(e,t){var n,r,o,i,s,u,d,f;Xt(1,arguments);var g=Lu(),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<v?7:0)+M-v;return _.setUTCDate(_.getUTCDate()-C),_.setUTCHours(0,0,0,0),_}function MT(e,t){var n,r,o,i,s,u,d,f;Xt(1,arguments);var g=an(e),v=g.getUTCFullYear(),_=Lu(),M=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:_.firstWeekContainsDate)!==null&&r!==void 0?r:(d=_.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(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=rd(C,t),w=new Date(0);w.setUTCFullYear(v,0,M),w.setUTCHours(0,0,0,0);var S=rd(w,t);return g.getTime()>=D.getTime()?v+1:g.getTime()>=S.getTime()?v:v-1}function Coe(e,t){var n,r,o,i,s,u,d,f;Xt(1,arguments);var g=Lu(),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),_=MT(e,t),M=new Date(0);M.setUTCFullYear(_,0,v),M.setUTCHours(0,0,0,0);var C=rd(M,t);return C}var Toe=6048e5;function RN(e,t){Xt(1,arguments);var n=an(e),r=rd(n,t).getTime()-Coe(n,t).getTime();return Math.round(r/Toe)+1}function ir(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var woe={y:function(t,n){var r=t.getUTCFullYear(),o=r>0?r:1-r;return ir(n==="yy"?o%100:o,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):ir(r+1,2)},d:function(t,n){return ir(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 ir(t.getUTCHours()%12||12,n.length)},H:function(t,n){return ir(t.getUTCHours(),n.length)},m:function(t,n){return ir(t.getUTCMinutes(),n.length)},s:function(t,n){return ir(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 ir(i,n.length)}};const Ll=woe;var Gd={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Soe={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 Ll.y(t,n)},Y:function(t,n,r,o){var i=MT(t,o),s=i>0?i:1-i;if(n==="YY"){var u=s%100;return ir(u,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):ir(s,n.length)},R:function(t,n){var r=LN(t);return ir(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return ir(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 ir(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 ir(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 Ll.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 ir(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=RN(t,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):ir(i,n.length)},I:function(t,n,r){var o=ON(t);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):ir(o,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Ll.d(t,n)},D:function(t,n,r){var o=boe(t);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):ir(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 ir(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 ir(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 ir(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=Gd.noon:o===0?i=Gd.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=Gd.evening:o>=12?i=Gd.afternoon:o>=4?i=Gd.morning:i=Gd.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 Ll.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Ll.H(t,n)},K:function(t,n,r){var o=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):ir(o,n.length)},k:function(t,n,r){var o=t.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):ir(o,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Ll.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Ll.s(t,n)},S:function(t,n){return Ll.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 oD(s);case"XXXX":case"XX":return tc(s);case"XXXXX":case"XXX":default:return tc(s,":")}},x:function(t,n,r,o){var i=o._originalDate||t,s=i.getTimezoneOffset();switch(n){case"x":return oD(s);case"xxxx":case"xx":return tc(s);case"xxxxx":case"xxx":default:return tc(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"+rD(s,":");case"OOOO":default:return"GMT"+tc(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"+rD(s,":");case"zzzz":default:return"GMT"+tc(s,":")}},t:function(t,n,r,o){var i=o._originalDate||t,s=Math.floor(i.getTime()/1e3);return ir(s,n.length)},T:function(t,n,r,o){var i=o._originalDate||t,s=i.getTime();return ir(s,n.length)}};function rD(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+ir(i,2)}function oD(e,t){if(e%60===0){var n=e>0?"-":"+";return n+ir(Math.abs(e)/60,2)}return tc(e,t)}function tc(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e),i=ir(Math.floor(o/60),2),s=ir(o%60,2);return r+i+n+s}const koe=Soe;var iD=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"})}},NN=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"})}},Doe=function(t,n){var r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return iD(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}}",iD(o,n)).replace("{{time}}",NN(i,n))},Eoe={p:NN,P:Doe};const cI=Eoe;var Aoe=["D","DD"],Loe=["YY","YYYY"];function PN(e){return Aoe.indexOf(e)!==-1}function xN(e){return Loe.indexOf(e)!==-1}function ny(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 Ooe={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"}},Roe=function(t,n,r){var o,i=Ooe[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 Noe=Roe;function cb(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 Poe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xoe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Uoe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Foe={date:cb({formats:Poe,defaultWidth:"full"}),time:cb({formats:xoe,defaultWidth:"full"}),dateTime:cb({formats:Uoe,defaultWidth:"full"})};const Goe=Foe;var $oe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Boe=function(t,n,r,o){return $oe[t]};const Hoe=Boe;function $p(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 qoe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Voe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},zoe={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"]},joe={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"]},Woe={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"}},Koe={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"}},Yoe=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"},Joe={ordinalNumber:Yoe,era:$p({values:qoe,defaultWidth:"wide"}),quarter:$p({values:Voe,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:$p({values:zoe,defaultWidth:"wide"}),day:$p({values:joe,defaultWidth:"wide"}),dayPeriod:$p({values:Woe,defaultWidth:"wide",formattingValues:Koe,defaultFormattingWidth:"wide"})};const Xoe=Joe;function Bp(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)?Qoe(u,function(v){return v.test(s)}):Zoe(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 Zoe(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Qoe(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function eie(e){return function(t){var n=arguments.length>1&&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 tie=/^(\d+)(th|st|nd|rd)?/i,nie=/\d+/i,rie={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},oie={any:[/^b/i,/^(a|c)/i]},iie={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sie={any:[/1/i,/2/i,/3/i,/4/i]},aie={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},lie={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]},uie={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},cie={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]},die={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},fie={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}},pie={ordinalNumber:eie({matchPattern:tie,parsePattern:nie,valueCallback:function(t){return parseInt(t,10)}}),era:Bp({matchPatterns:rie,defaultMatchWidth:"wide",parsePatterns:oie,defaultParseWidth:"any"}),quarter:Bp({matchPatterns:iie,defaultMatchWidth:"wide",parsePatterns:sie,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Bp({matchPatterns:aie,defaultMatchWidth:"wide",parsePatterns:lie,defaultParseWidth:"any"}),day:Bp({matchPatterns:uie,defaultMatchWidth:"wide",parsePatterns:cie,defaultParseWidth:"any"}),dayPeriod:Bp({matchPatterns:die,defaultMatchWidth:"any",parsePatterns:fie,defaultParseWidth:"any"})};const hie=pie;var gie={code:"en-US",formatDistance:Noe,formatLong:Goe,formatRelative:Hoe,localize:Xoe,match:hie,options:{weekStartsOn:0,firstWeekContainsDate:1}};const IT=gie;var mie=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vie=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yie=/^'([^]*?)'?$/,_ie=/''/g,bie=/[a-zA-Z]/;function sD(e,t,n){var r,o,i,s,u,d,f,g,v,_,M,C,D,w,S,R,A,N;Xt(2,arguments);var H=String(t),z=Lu(),x=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:z.locale)!==null&&r!==void 0?r:IT,B=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:z.firstWeekContainsDate)!==null&&s!==void 0?s:(v=z.locale)===null||v===void 0||(_=v.options)===null||_===void 0?void 0:_.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(B>=1&&B<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var j=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||(R=S.options)===null||R===void 0?void 0:R.weekStartsOn)!==null&&D!==void 0?D:z.weekStartsOn)!==null&&C!==void 0?C:(A=z.locale)===null||A===void 0||(N=A.options)===null||N===void 0?void 0:N.weekStartsOn)!==null&&M!==void 0?M:0);if(!(j>=0&&j<=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(!_h(G))throw new RangeError("Invalid time value");var L=ty(G),T=AN(G,L),P={firstWeekContainsDate:B,weekStartsOn:j,locale:x,_originalDate:G},Q=H.match(vie).map(function(Y){var oe=Y[0];if(oe==="p"||oe==="P"){var X=cI[oe];return X(Y,x.formatLong)}return Y}).join("").match(mie).map(function(Y){if(Y==="''")return"'";var oe=Y[0];if(oe==="'")return Mie(Y);var X=koe[oe];if(X)return!(n!=null&&n.useAdditionalWeekYearTokens)&&xN(Y)&&ny(Y,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&PN(Y)&&ny(Y,t,String(e)),X(T,Y,x.localize,P);if(oe.match(bie))throw new RangeError("Format string contains an unescaped latin alphabet character `"+oe+"`");return Y}).join("");return Q}function Mie(e){var t=e.match(yie);return t?t[1].replace(_ie,"'"):e}function Iie(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 Cie(e){Xt(1,arguments);var t=an(e),n=t.getDay();return n}function Tie(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 Gs(e){Xt(1,arguments);var t=an(e),n=t.getHours();return n}var wie=6048e5;function Sie(e){Xt(1,arguments);var t=an(e),n=ey(t).getTime()-doe(t).getTime();return Math.round(n/wie)+1}function $s(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 Xl(e){Xt(1,arguments);var t=an(e),n=t.getSeconds();return n}function Vr(e){return Xt(1,arguments),an(e).getFullYear()}function UN(e,t){Xt(2,arguments);var n=an(e),r=an(t);return n.getTime()>r.getTime()}function FN(e,t){Xt(2,arguments);var n=an(e),r=an(t);return n.getTime()<r.getTime()}function kie(e,t){Xt(2,arguments);var n=an(e),r=an(t);return n.getTime()===r.getTime()}function aD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Die(e,t){if(e){if(typeof e=="string")return aD(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 aD(e,t)}}function lD(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Die(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=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 Rt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dI(e,t){return dI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},dI(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&&dI(e,t)}function ry(e){return ry=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ry(e)}function Eie(){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 Aie(e,t){if(t&&(Es(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rt(e)}function Yn(e){var t=Eie();return function(){var r=ry(e),o;if(t){var i=ry(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Aie(this,o)}}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lie(e,t){if(Es(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Es(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GN(e){var t=Lie(e,"string");return Es(t)==="symbol"?t:String(t)}function uD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GN(r.key),r)}}function Nn(e,t,n){return t&&uD(e.prototype,t),n&&uD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tt(e,t,n){return t=GN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oie=10,$N=function(){function e(){Rn(this,e),Tt(this,"priority",void 0),Tt(this,"subPriority",0)}return Nn(e,[{key:"validate",value:function(n,r){return!0}}]),e}(),Rie=function(e){Kn(n,e);var t=Yn(n);function n(r,o,i,s,u){var d;return Rn(this,n),d=t.call(this),d.value=r,d.validateValue=o,d.setValue=i,d.priority=s,u&&(d.subPriority=u),d}return Nn(n,[{key:"validate",value:function(o,i){return this.validateValue(o,this.value,i)}},{key:"set",value:function(o,i,s){return this.setValue(o,i,this.value,s)}}]),n}($N),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;s<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",Oie),Tt(Rt(r),"subPriority",-1),r}return Nn(n,[{key:"set",value:function(o,i){if(i.timestampIsSet)return o;var s=new Date(0);return s.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),s.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),s}}]),n}($N),er=function(){function e(){Rn(this,e),Tt(this,"incompatibleTokens",void 0),Tt(this,"priority",void 0),Tt(this,"subPriority",void 0)}return Nn(e,[{key:"run",value:function(n,r,o,i){var s=this.parse(n,r,o,i);return s?{setter:new Rie(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(n,r,o){return!0}}]),e}(),Pie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",140),Tt(Rt(r),"incompatibleTokens",["R","u","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(o,{width:"abbreviated"})||s.era(o,{width:"narrow"});case"GGGGG":return s.era(o,{width:"narrow"});case"GGGG":default:return s.era(o,{width:"wide"})||s.era(o,{width:"abbreviated"})||s.era(o,{width:"narrow"})}}},{key:"set",value:function(o,i,s){return i.era=s,o.setUTCFullYear(s,0,1),o.setUTCHours(0,0,0,0),o}}]),n}(er),Zr={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},ma={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Qr(e,t){return e&&{value:t(e.value),rest:e.rest}}function Ur(e,t){var n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function va(e,t){var n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};var r=n[1]==="+"?1:-1,o=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,s=n[5]?parseInt(n[5],10):0;return{value:r*(o*goe+i*hoe+s*moe),rest:t.slice(n[0].length)}}function BN(e){return Ur(Zr.anyDigitsSigned,e)}function Wr(e,t){switch(e){case 1:return Ur(Zr.singleDigit,t);case 2:return Ur(Zr.twoDigits,t);case 3:return Ur(Zr.threeDigits,t);case 4:return Ur(Zr.fourDigits,t);default:return Ur(new RegExp("^\\d{1,"+e+"}"),t)}}function oy(e,t){switch(e){case 1:return Ur(Zr.singleDigitSigned,t);case 2:return Ur(Zr.twoDigitsSigned,t);case 3:return Ur(Zr.threeDigitsSigned,t);case 4:return Ur(Zr.fourDigitsSigned,t);default:return Ur(new RegExp("^-?\\d{1,"+e+"}"),t)}}function CT(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function HN(e,t){var n=t>0,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 qN(e){return e%400===0||e%4===0&&e%100!==0}var xie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",130),Tt(Rt(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){var u=function(f){return{year:f,isTwoDigitYear:i==="yy"}};switch(i){case"y":return Qr(Wr(4,o),u);case"yo":return Qr(s.ordinalNumber(o,{unit:"year"}),u);default:return Qr(Wr(i.length,o),u)}}},{key:"validate",value:function(o,i){return i.isTwoDigitYear||i.year>0}},{key:"set",value:function(o,i,s){var u=o.getUTCFullYear();if(s.isTwoDigitYear){var d=HN(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),Uie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",130),Tt(Rt(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){var u=function(f){return{year:f,isTwoDigitYear:i==="YY"}};switch(i){case"Y":return Qr(Wr(4,o),u);case"Yo":return Qr(s.ordinalNumber(o,{unit:"year"}),u);default:return Qr(Wr(i.length,o),u)}}},{key:"validate",value:function(o,i){return i.isTwoDigitYear||i.year>0}},{key:"set",value:function(o,i,s,u){var d=MT(o,u);if(s.isTwoDigitYear){var f=HN(s.year,d);return o.setUTCFullYear(f,0,u.firstWeekContainsDate),o.setUTCHours(0,0,0,0),rd(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),rd(o,u)}}]),n}(er),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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",130),Tt(Rt(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i){return oy(i==="R"?4:i.length,o)}},{key:"set",value:function(o,i,s){var u=new Date(0);return u.setUTCFullYear(s,0,4),u.setUTCHours(0,0,0,0),xf(u)}}]),n}(er),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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",130),Tt(Rt(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i){return oy(i==="u"?4:i.length,o)}},{key:"set",value:function(o,i,s){return o.setUTCFullYear(s,0,1),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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",120),Tt(Rt(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"Q":case"QQ":return Wr(i.length,o);case"Qo":return s.ordinalNumber(o,{unit:"quarter"});case"QQQ":return s.quarter(o,{width:"abbreviated",context:"formatting"})||s.quarter(o,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(o,{width:"wide",context:"formatting"})||s.quarter(o,{width:"abbreviated",context:"formatting"})||s.quarter(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=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),Bie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",120),Tt(Rt(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"q":case"qq":return Wr(i.length,o);case"qo":return s.ordinalNumber(o,{unit:"quarter"});case"qqq":return s.quarter(o,{width:"abbreviated",context:"standalone"})||s.quarter(o,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(o,{width:"wide",context:"standalone"})||s.quarter(o,{width:"abbreviated",context:"standalone"})||s.quarter(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=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),Hie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),Tt(Rt(r),"priority",110),r}return Nn(n,[{key:"parse",value:function(o,i,s){var u=function(f){return f-1};switch(i){case"M":return Qr(Ur(Zr.month,o),u);case"MM":return Qr(Wr(2,o),u);case"Mo":return Qr(s.ordinalNumber(o,{unit:"month"}),u);case"MMM":return s.month(o,{width:"abbreviated",context:"formatting"})||s.month(o,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(o,{width:"wide",context:"formatting"})||s.month(o,{width:"abbreviated",context:"formatting"})||s.month(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,s){return o.setUTCMonth(s,1),o.setUTCHours(0,0,0,0),o}}]),n}(er),qie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",110),Tt(Rt(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){var u=function(f){return f-1};switch(i){case"L":return Qr(Ur(Zr.month,o),u);case"LL":return Qr(Wr(2,o),u);case"Lo":return Qr(s.ordinalNumber(o,{unit:"month"}),u);case"LLL":return s.month(o,{width:"abbreviated",context:"standalone"})||s.month(o,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(o,{width:"wide",context:"standalone"})||s.month(o,{width:"abbreviated",context:"standalone"})||s.month(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=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 Vie(e,t,n){Xt(2,arguments);var r=an(e),o=on(t),i=RN(r,n)-o;return r.setUTCDate(r.getUTCDate()-i*7),r}var zie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",100),Tt(Rt(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"w":return Ur(Zr.week,o);case"wo":return s.ordinalNumber(o,{unit:"week"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=53}},{key:"set",value:function(o,i,s,u){return rd(Vie(o,s,u),u)}}]),n}(er);function jie(e,t){Xt(2,arguments);var n=an(e),r=on(t),o=ON(n)-r;return n.setUTCDate(n.getUTCDate()-o*7),n}var Wie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",100),Tt(Rt(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"I":return Ur(Zr.week,o);case"Io":return s.ordinalNumber(o,{unit:"week"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=53}},{key:"set",value:function(o,i,s){return xf(jie(o,s))}}]),n}(er),Kie=[31,28,31,30,31,30,31,31,30,31,30,31],Yie=[31,29,31,30,31,30,31,31,30,31,30,31],Jie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",90),Tt(Rt(r),"subPriority",1),Tt(Rt(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"d":return Ur(Zr.date,o);case"do":return s.ordinalNumber(o,{unit:"date"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){var s=o.getUTCFullYear(),u=qN(s),d=o.getUTCMonth();return u?i>=1&&i<=Yie[d]:i>=1&&i<=Kie[d]}},{key:"set",value:function(o,i,s){return o.setUTCDate(s),o.setUTCHours(0,0,0,0),o}}]),n}(er),Xie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",90),Tt(Rt(r),"subpriority",1),Tt(Rt(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"D":case"DD":return Ur(Zr.dayOfYear,o);case"Do":return s.ordinalNumber(o,{unit:"date"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){var s=o.getUTCFullYear(),u=qN(s);return u?i>=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 TT(e,t,n){var r,o,i,s,u,d,f,g;Xt(2,arguments);var v=Lu(),_=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,R=(S<_?7:0)+C-D;return M.setUTCDate(M.getUTCDate()+R),M}var Zie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",90),Tt(Rt(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(o,{width:"abbreviated",context:"formatting"})||s.day(o,{width:"short",context:"formatting"})||s.day(o,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(o,{width:"short",context:"formatting"})||s.day(o,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(o,{width:"wide",context:"formatting"})||s.day(o,{width:"abbreviated",context:"formatting"})||s.day(o,{width:"short",context:"formatting"})||s.day(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,s,u){return o=TT(o,s,u),o.setUTCHours(0,0,0,0),o}}]),n}(er),Qie=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",90),Tt(Rt(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s,u){var d=function(g){var v=Math.floor((g-1)/7)*7;return(g+u.weekStartsOn+6)%7+v};switch(i){case"e":case"ee":return Qr(Wr(i.length,o),d);case"eo":return Qr(s.ordinalNumber(o,{unit:"day"}),d);case"eee":return s.day(o,{width:"abbreviated",context:"formatting"})||s.day(o,{width:"short",context:"formatting"})||s.day(o,{width:"narrow",context:"formatting"});case"eeeee":return s.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(o,{width:"short",context:"formatting"})||s.day(o,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(o,{width:"wide",context:"formatting"})||s.day(o,{width:"abbreviated",context:"formatting"})||s.day(o,{width:"short",context:"formatting"})||s.day(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,s,u){return o=TT(o,s,u),o.setUTCHours(0,0,0,0),o}}]),n}(er),ese=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",90),Tt(Rt(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s,u){var d=function(g){var v=Math.floor((g-1)/7)*7;return(g+u.weekStartsOn+6)%7+v};switch(i){case"c":case"cc":return Qr(Wr(i.length,o),d);case"co":return Qr(s.ordinalNumber(o,{unit:"day"}),d);case"ccc":return s.day(o,{width:"abbreviated",context:"standalone"})||s.day(o,{width:"short",context:"standalone"})||s.day(o,{width:"narrow",context:"standalone"});case"ccccc":return s.day(o,{width:"narrow",context:"standalone"});case"cccccc":return s.day(o,{width:"short",context:"standalone"})||s.day(o,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(o,{width:"wide",context:"standalone"})||s.day(o,{width:"abbreviated",context:"standalone"})||s.day(o,{width:"short",context:"standalone"})||s.day(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,s,u){return o=TT(o,s,u),o.setUTCHours(0,0,0,0),o}}]),n}(er);function tse(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<r?7:0)+n-i;return o.setUTCDate(o.getUTCDate()+d),o}var nse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",90),Tt(Rt(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){var u=function(f){return f===0?7:f};switch(i){case"i":case"ii":return Wr(i.length,o);case"io":return s.ordinalNumber(o,{unit:"day"});case"iii":return Qr(s.day(o,{width:"abbreviated",context:"formatting"})||s.day(o,{width:"short",context:"formatting"})||s.day(o,{width:"narrow",context:"formatting"}),u);case"iiiii":return Qr(s.day(o,{width:"narrow",context:"formatting"}),u);case"iiiiii":return Qr(s.day(o,{width:"short",context:"formatting"})||s.day(o,{width:"narrow",context:"formatting"}),u);case"iiii":default:return Qr(s.day(o,{width:"wide",context:"formatting"})||s.day(o,{width:"abbreviated",context:"formatting"})||s.day(o,{width:"short",context:"formatting"})||s.day(o,{width:"narrow",context:"formatting"}),u)}}},{key:"validate",value:function(o,i){return i>=1&&i<=7}},{key:"set",value:function(o,i,s){return o=tse(o,s),o.setUTCHours(0,0,0,0),o}}]),n}(er),rse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",80),Tt(Rt(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(o,{width:"abbreviated",context:"formatting"})||s.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(o,{width:"wide",context:"formatting"})||s.dayPeriod(o,{width:"abbreviated",context:"formatting"})||s.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,s){return o.setUTCHours(CT(s),0,0,0),o}}]),n}(er),ose=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",80),Tt(Rt(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(o,{width:"abbreviated",context:"formatting"})||s.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(o,{width:"wide",context:"formatting"})||s.dayPeriod(o,{width:"abbreviated",context:"formatting"})||s.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,s){return o.setUTCHours(CT(s),0,0,0),o}}]),n}(er),ise=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",80),Tt(Rt(r),"incompatibleTokens",["a","b","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(o,{width:"abbreviated",context:"formatting"})||s.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(o,{width:"wide",context:"formatting"})||s.dayPeriod(o,{width:"abbreviated",context:"formatting"})||s.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,s){return o.setUTCHours(CT(s),0,0,0),o}}]),n}(er),sse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",70),Tt(Rt(r),"incompatibleTokens",["H","K","k","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"h":return Ur(Zr.hour12h,o);case"ho":return s.ordinalNumber(o,{unit:"hour"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){return i>=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),ase=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",70),Tt(Rt(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"H":return Ur(Zr.hour23h,o);case"Ho":return s.ordinalNumber(o,{unit:"hour"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=23}},{key:"set",value:function(o,i,s){return o.setUTCHours(s,0,0,0),o}}]),n}(er),lse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",70),Tt(Rt(r),"incompatibleTokens",["h","H","k","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"K":return Ur(Zr.hour11h,o);case"Ko":return s.ordinalNumber(o,{unit:"hour"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){return i>=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),use=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",70),Tt(Rt(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"k":return Ur(Zr.hour24h,o);case"ko":return s.ordinalNumber(o,{unit:"hour"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){return i>=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),cse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",60),Tt(Rt(r),"incompatibleTokens",["t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"m":return Ur(Zr.minute,o);case"mo":return s.ordinalNumber(o,{unit:"minute"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=59}},{key:"set",value:function(o,i,s){return o.setUTCMinutes(s,0,0),o}}]),n}(er),dse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",50),Tt(Rt(r),"incompatibleTokens",["t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i,s){switch(i){case"s":return Ur(Zr.second,o);case"so":return s.ordinalNumber(o,{unit:"second"});default:return Wr(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=59}},{key:"set",value:function(o,i,s){return o.setUTCSeconds(s,0),o}}]),n}(er),fse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",30),Tt(Rt(r),"incompatibleTokens",["t","T"]),r}return Nn(n,[{key:"parse",value:function(o,i){var s=function(d){return Math.floor(d*Math.pow(10,-i.length+3))};return Qr(Wr(i.length,o),s)}},{key:"set",value:function(o,i,s){return o.setUTCMilliseconds(s),o}}]),n}(er),pse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",10),Tt(Rt(r),"incompatibleTokens",["t","T","x"]),r}return Nn(n,[{key:"parse",value:function(o,i){switch(i){case"X":return va(ma.basicOptionalMinutes,o);case"XX":return va(ma.basic,o);case"XXXX":return va(ma.basicOptionalSeconds,o);case"XXXXX":return va(ma.extendedOptionalSeconds,o);case"XXX":default:return va(ma.extended,o)}}},{key:"set",value:function(o,i,s){return i.timestampIsSet?o:new Date(o.getTime()-s)}}]),n}(er),hse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",10),Tt(Rt(r),"incompatibleTokens",["t","T","X"]),r}return Nn(n,[{key:"parse",value:function(o,i){switch(i){case"x":return va(ma.basicOptionalMinutes,o);case"xx":return va(ma.basic,o);case"xxxx":return va(ma.basicOptionalSeconds,o);case"xxxxx":return va(ma.extendedOptionalSeconds,o);case"xxx":default:return va(ma.extended,o)}}},{key:"set",value:function(o,i,s){return i.timestampIsSet?o:new Date(o.getTime()-s)}}]),n}(er),gse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",40),Tt(Rt(r),"incompatibleTokens","*"),r}return Nn(n,[{key:"parse",value:function(o){return BN(o)}},{key:"set",value:function(o,i,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),n}(er),mse=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<o;s++)i[s]=arguments[s];return r=t.call.apply(t,[this].concat(i)),Tt(Rt(r),"priority",20),Tt(Rt(r),"incompatibleTokens","*"),r}return Nn(n,[{key:"parse",value:function(o){return BN(o)}},{key:"set",value:function(o,i,s){return[new Date(s),{timestampIsSet:!0}]}}]),n}(er),vse={G:new Pie,y:new xie,Y:new Uie,R:new Fie,u:new Gie,Q:new $ie,q:new Bie,M:new Hie,L:new qie,w:new zie,I:new Wie,d:new Jie,D:new Xie,E:new Zie,e:new Qie,c:new ese,i:new nse,a:new rse,b:new ose,B:new ise,h:new sse,H:new ase,K:new lse,k:new use,m:new cse,s:new dse,S:new fse,X:new pse,x:new hse,t:new gse,T:new mse},yse=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_se=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bse=/^'([^]*?)'?$/,Mse=/''/g,Ise=/\S/,Cse=/[a-zA-Z]/;function Tse(e,t,n,r){var o,i,s,u,d,f,g,v,_,M,C,D,w,S,R,A,N,H;Xt(3,arguments);var z=String(e),x=String(t),B=Lu(),j=(o=(i=r==null?void 0:r.locale)!==null&&i!==void 0?i:B.locale)!==null&&o!==void 0?o:IT;if(!j.match)throw new RangeError("locale must contain match property");var G=on((s=(u=(d=(f=r==null?void 0:r.firstWeekContainsDate)!==null&&f!==void 0?f:r==null||(g=r.locale)===null||g===void 0||(v=g.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:B.firstWeekContainsDate)!==null&&u!==void 0?u:(_=B.locale)===null||_===void 0||(M=_.options)===null||M===void 0?void 0:M.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(G>=1&&G<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var L=on((C=(D=(w=(S=r==null?void 0:r.weekStartsOn)!==null&&S!==void 0?S:r==null||(R=r.locale)===null||R===void 0||(A=R.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&w!==void 0?w:B.weekStartsOn)!==null&&D!==void 0?D:(N=B.locale)===null||N===void 0||(H=N.options)===null||H===void 0?void 0:H.weekStartsOn)!==null&&C!==void 0?C:0);if(!(L>=0&&L<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(x==="")return z===""?an(n):new Date(NaN);var T={firstWeekContainsDate:G,weekStartsOn:L,locale:j},P=[new Nie],Q=x.match(_se).map(function(K){var me=K[0];if(me in cI){var ke=cI[me];return ke(K,j.formatLong)}return K}).join("").match(yse),Y=[],oe=lD(Q),X;try{var ae=function(){var me=X.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&xN(me)&&ny(me,x,e),!(r!=null&&r.useAdditionalDayOfYearTokens)&&PN(me)&&ny(me,x,e);var ke=me[0],pe=vse[ke];if(pe){var W=pe.incompatibleTokens;if(Array.isArray(W)){var te=Y.find(function(Ie){return W.includes(Ie.token)||Ie.token===ke});if(te)throw new RangeError("The format string mustn't contain `".concat(te.fullToken,"` and `").concat(me,"` at the same time"))}else if(pe.incompatibleTokens==="*"&&Y.length>0)throw new RangeError("The format string mustn't contain `".concat(me,"` and any other token at the same time"));Y.push({token:ke,fullToken:me});var ie=pe.run(z,me,j.match,T);if(!ie)return{v:new Date(NaN)};P.push(ie.setter),z=ie.rest}else{if(ke.match(Cse))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ke+"`");if(me==="''"?me="'":ke==="'"&&(me=wse(me)),z.indexOf(me)===0)z=z.slice(me.length);else return{v:new Date(NaN)}}};for(oe.s();!(X=oe.n()).done;){var fe=ae();if(Es(fe)==="object")return fe.v}}catch(K){oe.e(K)}finally{oe.f()}if(z.length>0&&Ise.test(z))return new Date(NaN);var le=P.map(function(K){return K.priority}).sort(function(K,me){return me-K}).filter(function(K,me,ke){return ke.indexOf(K)===me}).map(function(K){return P.filter(function(me){return me.priority===K}).sort(function(me,ke){return ke.subPriority-me.subPriority})}).map(function(K){return K[0]}),ce=an(n);if(isNaN(ce.getTime()))return new Date(NaN);var J=AN(ce,ty(ce)),re={},de=lD(le),Oe;try{for(de.s();!(Oe=de.n()).done;){var ve=Oe.value;if(!ve.validate(J,T))return new Date(NaN);var Me=ve.set(J,re,T);Array.isArray(Me)?(J=Me[0],Iie(re,Me[1])):J=Me}}catch(K){de.e(K)}finally{de.f()}return J}function wse(e){return e.match(bse)[1].replace(Mse,"'")}function Sse(e,t){Xt(2,arguments);var n=on(t);return jc(e,-n)}function bh(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=Tie(s);return n.setMonth(r,Math.min(i,u)),n}function ws(e,t){if(Xt(2,arguments),Es(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=bh(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 VN(e,t){Xt(2,arguments);var n=an(e),r=on(t);return n.setHours(r),n}function wT(e,t){Xt(2,arguments);var n=an(e),r=on(t);return n.setMilliseconds(r),n}function zN(e,t){Xt(2,arguments);var n=an(e),r=on(t);return n.setMinutes(r),n}function jN(e,t){Xt(2,arguments);var n=an(e),r=on(t);return n.setSeconds(r),n}function gf(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 dl(e,-n)}function kse(e,t){if(Xt(2,arguments),!t||Es(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=Sse(f,i+o*7),v=u+s*60,_=d+v*60,M=_*1e3,C=new Date(g.getTime()-M);return C}function Dse(e,t){Xt(2,arguments);var n=on(t);return DN(e,-n)}var Ese=Object.defineProperty,Ase=Object.defineProperties,Lse=Object.getOwnPropertyDescriptors,cD=Object.getOwnPropertySymbols,Ose=Object.prototype.hasOwnProperty,Rse=Object.prototype.propertyIsEnumerable,dD=(e,t,n)=>t in e?Ese(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dn=(e,t)=>{for(var n in t||(t={}))Ose.call(t,n)&&dD(e,n,t[n]);if(cD)for(var n of cD(t))Rse.call(t,n)&&dD(e,n,t[n]);return e},as=(e,t)=>Ase(e,Lse(t)),fd=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n};const Nse={},Pse={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},xse=$("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),Use=$("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),Fse=$("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),Gse=$("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),$se=[xse,Use,Fse,Gse];function Bse(e,t){return Z(),se("svg",Pse,$se)}var a0=fd(Nse,[["render",Bse]]);const Hse={},qse={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},Vse=$("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),zse=$("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),jse=[Vse,zse];function Wse(e,t){return Z(),se("svg",qse,jse)}var Kse=fd(Hse,[["render",Wse]]);const Yse={},Jse={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},Xse=$("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),Zse=[Xse];function Qse(e,t){return Z(),se("svg",Jse,Zse)}var fD=fd(Yse,[["render",Qse]]);const eae={},tae={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},nae=$("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),rae=[nae];function oae(e,t){return Z(),se("svg",tae,rae)}var pD=fd(eae,[["render",oae]]);const iae={},sae={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},aae=$("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),lae=$("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),uae=[aae,lae];function cae(e,t){return Z(),se("svg",sae,uae)}var WN=fd(iae,[["render",cae]]);const dae={},fae={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},pae=$("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),hae=[pae];function gae(e,t){return Z(),se("svg",fae,hae)}var KN=fd(dae,[["render",gae]]);const mae={},vae={version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon"},yae=$("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),_ae=[yae];function bae(e,t){return Z(),se("svg",vae,_ae)}var YN=fd(mae,[["render",bae]]);const db=(e,t)=>{const n=Tse(e,t.slice(0,e.length),new Date);return _h(n)&&EN(n)?n:null},Aa=e=>{let t=new Date(JSON.parse(JSON.stringify(e)));return t=VN(t,0),t=zN(t,0),t=jN(t,0),t=wT(t,0),t},fI=e=>Array.isArray(e)?_h(e[0])&&(e[1]?_h(e[1]):!0):e?_h(e):!1,Hi=(e,t,n,r)=>{let o=e?new Date(e):new Date;return(t||t===0)&&(o=VN(o,+t)),(n||n===0)&&(o=zN(o,+n)),(r||r===0)&&(o=jN(o,+r)),wT(o,0)},Mae=e=>{const t=dl(e,1);return{month:Jr(t),year:Vr(t)}},Wc=(e,t,n)=>{let r=e?new Date(e):new Date;return(t||t===0)&&(r=bh(r,t)),n&&(r=gf(r,n)),r},hD=(e,t)=>e?`HH:mm${t?":ss":""}`:`hh:mm${t?":ss":""} aa`,JN=(e,t,n,r,o,i,s,u)=>e||(r?"MM/yyyy":o?hD(t,n):i?"MM/dd/yyyy":s?"yyyy":u?`MM/dd/yyyy, ${hD(t,n)}`:"MM/dd/yyyy"),fb=e=>{const t=e||new Date;return{hours:Gs(t),minutes:$s(t),seconds:Xl(t)}},av=e=>({month:Jr(e),year:Vr(e)}),gD=e=>Array.isArray(e)?[av(e[0]),e[1]?av(e[1]):null]:av(e),pI=e=>Array.isArray(e)?[fb(e[0]),fb(e[1])]:fb(e),pb=(e,t,n)=>n?sD(e,t,{locale:n}):sD(e,t),iy=(e,t,n,r)=>Array.isArray(e)?`${pb(e[0],t,n)} ${r||"-"} ${e[1]?pb(e[1],t,n):""}`:pb(e,t,n),rs=(e,t)=>!e||!t?!1:UN(Aa(e),Aa(t)),ui=(e,t)=>!e||!t?!1:FN(Aa(e),Aa(t)),Nr=(e,t)=>!e||!t?!1:kie(Aa(e),Aa(t)),Iae=(e,t)=>kN(ws(new Date,e),t),Cae=(e,t)=>kse(ws(new Date,e),t),hb=e=>ws(new Date,{hours:Gs(e),minutes:$s(e),seconds:Xl(e)}),mD=e=>ws(new Date,{hours:+e.hours||0,minutes:+e.minutes||0,seconds:+e.seconds||0}),hI=(e,t,n)=>{let r=!0;if(!e)return!0;const o=Array.isArray(e)?[e[0]?hb(e[0]):null,e[1]?hb(e[1]):null]:hb(e);if(t){const i=mD(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=mD(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},Tae=(e,t,n)=>{let r=!0;return t&&n&&(r=rs(new Date(e),new Date(t))&&ui(new Date(e),new Date(n))),t&&(r=rs(new Date(e),new Date(t))),n&&(r=ui(new Date(e),new Date(n))),r},bs=e=>{const t=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return new Date(t).toISOString()},XN=(e,t,n)=>e&&e[0]&&e[1]?rs(n,e[0])&&ui(n,e[1]):e&&e[0]&&t?rs(n,e[0])&&ui(n,t)||ui(n,e[0])&&rs(n,t):!1,Sm=(e,t)=>{const n=bT(e,{weekStartsOn:t}),r=yoe(e,{weekStartsOn:t});return[n,r]},wae=(e,t,n,r,o,i,s,u)=>{const d=n?rs(bs(e),bs(new Date(n))):!1,f=t?ui(bs(e),bs(new Date(t))):!1,g=typeof r=="function"?r(e):r.some(w=>Nr(bs(new Date(w)),bs(e))),v=(i.months.length?i.months.map(w=>+w):[]).includes(Jr(e)),_=s.length?s.some(w=>+w===Cie(e)):!1,M=o.length?!o.some(w=>Nr(bs(new Date(w)),bs(e))):!1,C=Vr(e),D=C<+u[0]||C>+u[1];return!(d||f||g||v||D||_||M)},ZN=(e,t,n,r,o,i,s)=>({validate:u=>wae(u,e,t,n,r,o,i,s)}),Sae=(e,t,n)=>{const r=new Date(JSON.parse(JSON.stringify(e))),o=[];for(let i=0;i<7;i++){const s=jc(r,i),u=Jr(s)!==t;o.push({text:n&&u?"":s.getDate(),value:s,current:!u})}return o},kae=(e,t,n,r)=>{const o=[],i=new Date(t,e),s=new Date(t,e+1,0),u=bT(i,{weekStartsOn:n}),d=f=>{const g=Sae(f,e,r);if(o.push({days:g}),!o[o.length-1].days.some(v=>Nr(Aa(v.value),Aa(s)))){const v=jc(f,7);d(v)}};return d(u),o},Dae=(e,t=3)=>{const n=[];for(let r=0;r<e.length;r+=t)n.push([e[r],e[r+1],e[r+2]]);return n},Eae=(e,t)=>{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)},Aae=e=>{const t=[];for(let n=+e[0];n<=+e[1];n++)t.push({value:+n,text:`${n}`});return t},Lae=(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}))},Oae=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],Rae=()=>({enterSubmit:!0,tabSubmit:!0,openMenu:!0,rangeSeparator:" - "}),Nae=e=>Object.assign({months:[],years:[],times:{hours:[],minutes:[],seconds:[]}},e),Pae=e=>{function t(n){let r="";const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=o.length;for(let s=0;s<n;s++)r+=o.charAt(Math.floor(Math.random()*i));return r+e}return t(5)},No=e=>{var t;const n=Le(e);return(t=n==null?void 0:n.$el)!=null?t:n},xae=e=>Object.assign({type:"dot"},e),vD=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),Uae=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),Ou=Symbol(),l0=Symbol(),ST=Symbol(),QN=Symbol(),eP=Symbol(),Ru=Symbol(),kT={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}},DT={range:{type:Boolean,default:!1},uid:{type:String,default:null}},tP={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}},nP=as(Dn({},tP),{fixedStart:{type:Boolean,default:!1},fixedEnd:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1}}),rP={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}},oP={minTime:{type:Object,default:null},maxTime:{type:Object,default:null}},ET={minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null}},iP=Dn({selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:Boolean,default:!1}},oP),AT={monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1}},sP={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}},aP=as(Dn(Dn(Dn(Dn(Dn(Dn({},nP),iP),AT),ET),sP),DT),{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}}),Fae=as(Dn(Dn(Dn({},rP),kT),aP),{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:()=>({})}}),lP={range:{type:Boolean,default:!1},multiCalendars:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null}},uP=as(Dn(Dn({},AT),lP),{vertical:{type:Boolean,default:!1},month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:1}}),km=jt({menuFocused:!1,shiftKeyInMenu:!1}),LT=()=>({setMenuFocused:e=>{km.menuFocused=e},getStore:()=>km,setShiftKey:e=>{km.shiftKeyInMenu!==e&&(km.shiftKeyInMenu=e)}}),Gae=["aria-label","aria-disabled","aria-readonly"],$ae={key:1,class:"dp__input_wrap"},Bae=["id","name","placeholder","disabled","readonly","required","value","autocomplete","onKeydown"],Hae={key:4,class:"dp__clear_icon"},qae=ot({props:as(Dn(Dn(Dn({},rP),kT),DT),{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(Ou),d=pg(),{getStore:f}=LT(),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:N}=A.target,{format:H,rangeSeparator:z}=r.textInputOptions;if(N!==""){if(r.range){const[x,B]=N.split(`${z}`);if(x&&B){const j=db(x.trim(),H||r.pattern),G=db(B.trim(),H||r.pattern);o.value=j&&G?[j,G]:null}}else o.value=db(N,H||r.pattern);n("setInputDate",o.value)}else n("setInputDate",null),r.autoApply&&(n("setEmptyDate"),o.value=null);n("update:inputValue",N)},_=()=>{var A,N;(A=r.textInputOptions)!=null&&A.enterSubmit&&fI(o.value)&&r.inputValue!==""?(n("setInputDate",o.value,!0),o.value=null):(N=r.textInputOptions)!=null&&N.enterSubmit&&r.inputValue===""&&(o.value=null,n("clear"))},M=()=>{var A,N;(A=r.textInputOptions)!=null&&A.tabSubmit&&fI(o.value)&&r.inputValue!==""?(n("setInputDate",o.value,!0),o.value=null):(N=r.textInputOptions)!=null&&N.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&&(R(),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")},R=()=>{s.value=!1;const A=No(i);A&&A.blur()};return t({unFocus:R}),(A,N)=>(Z(),se("div",{onClick:D,"aria-label":Le(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)?(Z(),se("div",$ae,[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):(Z(),se("input",{key:1,ref_key:"inputRef",ref:i,id:A.uid?`dp-input-${A.uid}`:void 0,name:A.name,class:it(Le(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,Bae)),A.$slots["input-icon"]&&!A.hideInputIcon?(Z(),se("span",{key:2,class:"dp__input_icon",onClick:N[0]||(N[0]=H=>n("toggle"))},[Ft(A.$slots,"input-icon")])):Ce("",!0),!A.$slots["input-icon"]&&!A.hideInputIcon&&!A.$slots["dp-input"]?(Z(),bt(Le(a0),{key:3,class:"dp__input_icon dp__input_icons",onClick:N[1]||(N[1]=H=>n("toggle"))})):Ce("",!0),A.$slots["clear-icon"]&&e.inputValue&&A.clearable&&!A.disabled&&!A.readonly?(Z(),se("span",Hae,[Ft(A.$slots,"clear-icon",{clear:S})])):Ce("",!0),A.clearable&&!A.$slots["clear-icon"]&&e.inputValue&&!A.disabled&&!A.readonly?(Z(),bt(Le(Kse),{key:5,class:"dp__clear_icon dp__input_icons",onClick:bn(S,["stop","prevent"])},null,8,["onClick"])):Ce("",!0)])):Ce("",!0)],8,Gae))}}),kr=jt({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),gb=Ne(null),Dm=Ne(!1),mb=Ne(!1),vb=Ne(!1),yb=Ne(!1),Ii=Ne(0),qo=Ne(0),Nu=()=>{const e=Ve(()=>Dm.value?[...kr.selectionGrid,kr.actionRow].filter(v=>v.length):mb.value?[...kr.timePicker[0],...kr.timePicker[1],yb.value?[]:[gb.value],kr.actionRow].filter(v=>v.length):vb.value?[...kr.monthPicker,kr.actionRow]:[kr.monthYear,...kr.calendar,kr.time,kr.actionRow].filter(v=>v.length)),t=v=>{Ii.value=v?Ii.value+1:Ii.value-1;let _=null;e.value[qo.value]&&(_=e.value[qo.value][Ii.value]),_||(Ii.value=v?Ii.value-1:Ii.value+1)},n=v=>{qo.value===0&&!v||qo.value===e.value.length&&v||(qo.value=v?qo.value+1:qo.value-1,e.value[qo.value]?e.value[qo.value]&&!e.value[qo.value][Ii.value]&&Ii.value!==0&&(Ii.value=e.value[qo.value].length-1):qo.value=v?qo.value-1:qo.value+1)},r=v=>{let _=null;e.value[qo.value]&&(_=e.value[qo.value][Ii.value]),_?_.focus({preventScroll:!Dm.value}):Ii.value=v?Ii.value-1:Ii.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=()=>{Ii.value=0,qo.value=0};return{buildMatrix:d,buildMultiLevelMatrix:f,setTimePickerBackRef:v=>{gb.value=v},setSelectionGrid:v=>{Dm.value=v,g(),v||(kr.selectionGrid=[])},setTimePicker:(v,_=!1)=>{mb.value=v,yb.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,mb.value=!1,yb.value=!1,vb.value=!1,g(),gb.value=null},setMonthPicker:v=>{vb.value=v,g()}}},Vae=["aria-label"],zae={class:"dp__calendar_header",role:"row"},jae={key:0,class:"dp__calendar_header_item",role:"gridcell"},Wae=$("div",{class:"dp__calendar_header_separator"},null,-1),Kae=["aria-label"],Yae={key:0,role:"gridcell",class:"dp__calendar_item dp__week_num"},Jae={class:"dp__cell_inner"},Xae=["aria-selected","aria-disabled","onClick","onKeydown","onMouseover"],Zae=$("div",{class:"dp__arrow_bottom_tp"},null,-1),Qae=ot({props:as(Dn(Dn({},uP),sP),{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(l0),g=tn(Ou),v=tn(Ru),_=Ne(""),M=Ne({startX:0,endX:0,startY:0,endY:0}),C=Ve(()=>Eae(r.locale,+r.weekStart)),{buildMultiLevelMatrix:D}=Nu();On(()=>{n("mount",{cmp:"calendar",refs:s}),r.noSwipe||u.value&&(u.value.addEventListener("touchstart",B),u.value.addEventListener("touchend",j),u.value.addEventListener("touchmove",G))});const w=(P,Q)=>{if(f!=null&&f.value){const Y=Aa(Wc(new Date,r.month,r.year));_.value=rs(Aa(Wc(new Date,P,Q)),Y)?f.value[r.vertical?"vNext":"next"]:f.value[r.vertical?"vPrevious":"previous"],d.value=!1,Ir(()=>{d.value=!0})}},S=Ve(()=>({dp__calendar_wrap:!0,[r.calendarClassName]:!!r.calendarClassName})),R=Ve(()=>P=>{const Q=xae(P);return{dp__marker_dot:Q.type==="dot",dp__marker_line:Q.type==="line"}}),A=Ve(()=>P=>Nr(P,o.value)),N=Ve(()=>({dp__calendar:!0,dp__calendar_next:r.multiCalendars>0&&r.instance!==0})),H=Ve(()=>r.specificMode?{height:`${r.modeHeight}px`}:null),z=(P,Q,Y)=>{var oe,X;if(n("setHoverDate",P),(X=(oe=P.marker)==null?void 0:oe.tooltip)!=null&&X.length){const ae=No(s.value[Q][Y]);if(ae){const{width:fe,height:le}=ae.getBoundingClientRect();i.value={bottom:`${le}px`,left:`${fe/2}px`,transform:"translateX(-50%)"},o.value=P.value}}},x=()=>{o.value=null},B=P=>{M.value.startX=P.changedTouches[0].screenX,M.value.startY=P.changedTouches[0].screenY},j=P=>{M.value.endX=P.changedTouches[0].screenX,M.value.endY=P.changedTouches[0].screenY,L()},G=P=>{P.preventDefault()},L=()=>{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,Q,Y)=>{P&&(Array.isArray(s.value[Q])?s.value[Q][Y]=P:s.value[Q]=[P]),v!=null&&v.value&&D(s.value,"calendar")};return t({triggerTransition:w}),(P,Q)=>(Z(),se("div",{class:it(Le(N))},[$("div",{style:Ro(Le(H))},[e.specificMode?Ce("",!0):(Z(),se("div",{key:0,ref_key:"calendarWrapRef",ref:u,class:it(Le(S)),role:"grid","aria-label":Le(g).calendarWrap,onWheel:Q[1]||(Q[1]=bn(Y=>P.$emit("handleScroll",Y),["prevent"]))},[$("div",zae,[P.weekNumbers?(Z(),se("div",jae,De(P.weekNumName),1)):Ce("",!0),(Z(!0),se(dt,null,Vt(Le(C),(Y,oe)=>(Z(),se("div",{class:"dp__calendar_header_item",role:"gridcell",key:oe},[P.$slots["calendar-header"]?Ft(P.$slots,"calendar-header",{key:0,day:Y,index:oe}):Ce("",!0),P.$slots["calendar-header"]?Ce("",!0):(Z(),se(dt,{key:1},[Fr(De(Y),1)],64))]))),128))]),Wae,Ct(bo,{name:_.value,css:!!Le(f)},{default:Ot(()=>[d.value?(Z(),se("div",{key:0,class:"dp__calendar",role:"grid","aria-label":Le(g).calendarDays},[(Z(!0),se(dt,null,Vt(e.mappedDates,(Y,oe)=>(Z(),se("div",{class:"dp__calendar_row",role:"row",key:oe},[P.weekNumbers?(Z(),se("div",Yae,[$("div",Jae,De(e.getWeekNum(Y.days)),1)])):Ce("",!0),(Z(!0),se(dt,null,Vt(Y.days,(X,ae)=>(Z(),se("div",{role:"gridcell",class:"dp__calendar_item",ref_for:!0,ref:fe=>T(fe,oe,ae),key:ae+oe,"aria-selected":X.classData.dp__active_date||X.classData.dp__range_start||X.classData.dp__range_start,"aria-disabled":X.classData.dp__cell_disabled,tabindex:"0",onClick:bn(fe=>P.$emit("selectDate",X),["stop","prevent"]),onKeydown:fr(fe=>P.$emit("selectDate",X),["enter"]),onMouseover:fe=>z(X,oe,ae),onMouseleave:x},[$("div",{class:it(["dp__cell_inner",X.classData])},[P.$slots.day?Ft(P.$slots,"day",{key:0,day:+X.text,date:X.value}):Ce("",!0),P.$slots.day?Ce("",!0):(Z(),se(dt,{key:1},[Fr(De(X.text),1)],64)),X.marker?(Z(),se("div",{key:2,class:it(Le(R)(X.marker)),style:Ro(X.marker.color?{backgroundColor:X.marker.color}:{})},null,6)):Ce("",!0),Le(A)(X.value)?(Z(),se("div",{key:3,class:"dp__marker_tooltip",style:Ro(i.value)},[$("div",{class:"dp__tooltip_content",onClick:Q[0]||(Q[0]=bn(()=>{},["stop"]))},[(Z(!0),se(dt,null,Vt(X.marker.tooltip,(fe,le)=>(Z(),se("div",{key:le,class:"dp__tooltip_text"},[P.$slots["marker-tooltip"]?Ft(P.$slots,"marker-tooltip",{key:0,tooltop:fe,day:X.value}):Ce("",!0),P.$slots["marker-tooltip"]?Ce("",!0):(Z(),se(dt,{key:1},[$("div",{class:"dp__tooltip_mark",style:Ro(fe.color?{backgroundColor:fe.color}:{})},null,4),$("div",null,De(fe.text),1)],64))]))),128)),Zae])],4)):Ce("",!0)],2)],40,Xae))),128))]))),128))],8,Kae)):Ce("",!0)]),_:3},8,["name","css"])],42,Vae))],4)],2))}}),ele=e=>typeof e=="object",yD=(e,t)=>t,tle=e=>Array.isArray(e)&&e.length===2,nle=e=>Array.isArray(e),rle=e=>typeof e=="object",Qp=e=>Array.isArray(e),Us=e=>Array.isArray(e),lv=e=>Array.isArray(e)&&e.length===2,ole=(e,t)=>t?Array.isArray(e):lv(e),ile=e=>Array.isArray(e),sle=e=>typeof e=="string"||typeof e=="object",_D=e=>typeof e=="string",ale={class:"dp__selection_preview"},lle={class:"dp__action_buttons"},ule=["onKeydown"],cle=ot({props:as(Dn(Dn(Dn(Dn(Dn({},iP),ET),oP),AT),lP),{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}=Nu(),o=tn(eP),i=tn(Ru),s=Ne(null),u=Ne(null);On(()=>{i!=null&&i.value&&r([No(s),No(u)],"actionRow")});const d=Ve(()=>({dp__action:!0,dp__select:!0,dp__action_disabled:!f.value||!g.value})),f=Ve(()=>n.enableTimePicker?hI(n.internalModelValue,n.maxTime,n.minTime):!0),g=Ve(()=>n.monthPicker?Tae(n.internalModelValue,n.minDate,n.maxDate):!0),v=C=>iy(C,n.previewFormat,o==null?void 0:o.value),_=Ve(()=>!n.internalModelValue||!n.menuMount?"":typeof n.previewFormat=="string"?Qp(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])} -`:iy(n.internalModelValue,n.previewFormat,o==null?void 0:o.value):n.timePicker?n.previewFormat(pI(n.internalModelValue)):n.monthPicker?n.previewFormat(av(n.internalModelValue)):n.previewFormat(n.internalModelValue)),M=()=>{f.value&&g.value&&t("selectDate")};return(C,D)=>(Z(),se("div",{class:"dp__action_row",style:Ro(e.calendarWidth?{width:`${e.calendarWidth}px`}:{})},[$("div",ale,[C.$slots["action-preview"]?Ft(C.$slots,"action-preview",{key:0,value:C.internalModelValue}):Ce("",!0),C.$slots["action-preview"]?Ce("",!0):(Z(),se(dt,{key:1},[Array.isArray(Le(_))?Ce("",!0):(Z(),se(dt,{key:0},[Fr(De(Le(_)),1)],64)),Array.isArray(Le(_))?(Z(!0),se(dt,{key:1},Vt(Le(_),(w,S)=>(Z(),se("div",{key:S},De(w),1))),128)):Ce("",!0)],64))]),$("div",lle,[C.$slots["action-select"]?Ft(C.$slots,"action-select",{key:0,value:C.internalModelValue}):Ce("",!0),C.$slots["action-select"]?Ce("",!0):(Z(),se(dt,{key:1},[e.inline?Ce("",!0):(Z(),se("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"]))},De(C.cancelText),545)),$("span",{class:it(Le(d)),tabindex:"0",onKeydown:fr(M,["enter"]),onClick:M,ref_key:"selectButtonRef",ref:u},De(C.selectText),43,ule)],64))])],4))}}),dle={class:"dp__overlay_container",role:"grid"},fle={class:"dp__selection_grid_header"},ple=["aria-selected","aria-disabled","onClick","onKeydown","onMouseover"],hle=["aria-label","onKeydown"],Mh=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(ST,!1),f=tn(QN,Ne(!1)),g=tn(Ou),v=tn(Ru),_=Ne(),M=Ne(),{setSelectionGrid:C,buildMultiLevelMatrix:D,setMonthPicker:w}=Nu();xL(()=>{i.value=null}),On(()=>{Ir().then(()=>B()),R(),S(!0)}),hl(()=>S(!1));const S=P=>{var Q;v!=null&&v.value&&((Q=r.headerRefs)!=null&&Q.length?w(P):C(P))},R=()=>{const P=No(s);P&&(f.value||P.focus({preventScroll:!0}),o.value=P.clientHeight<P.scrollHeight)},A=Ve(()=>({dp__overlay:!0})),N=Ve(()=>({dp__overlay_col:!0})),H=Ve(()=>r.items.map(P=>P.filter(Q=>Q).map(Q=>{var Y,oe,X;const ae=r.disabledValues.some(le=>le===Q.value)||x(Q.value),fe=(Y=r.multiModelValue)!=null&&Y.length?(oe=r.multiModelValue)==null?void 0:oe.some(le=>Nr(le,gf(bh(new Date,Q.value),r.year))):r.skipActive?!1:Q.value===r.modelValue;return as(Dn({},Q),{className:{dp__overlay_cell_active:fe,dp__overlay_cell:!fe,dp__overlay_cell_disabled:ae,dp__overlay_cell_active_disabled:ae&&fe,dp__overlay_cell_pad:!0,dp__cell_in_between:(X=r.multiModelValue)!=null&&X.length?G(Q.value):!1}})}))),z=Ve(()=>({dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:o.value,dp__button_bottom:d})),x=P=>{const Q=r.maxValue?+P>+r.maxValue:!1,Y=r.minValue?+P<+r.minValue:!1;return Q||Y},B=()=>{const P=No(i);if(P){const Q=No(s);Q&&(Q.scrollTop=P.offsetTop-Q.offsetTop-(Q.getBoundingClientRect().height/2-P.getBoundingClientRect().height))}},j=P=>{!r.disabledValues.some(Q=>Q===P)&&(!r.minValue||+r.minValue<=P)&&(!r.maxValue||+r.maxValue>=P)&&(n("update:modelValue",P),n("selected"))},G=P=>XN(r.multiModelValue,gf(bh(new Date,_.value||0),r.year),gf(bh(new Date,P),r.year)),L=()=>{n("toggle"),n("reset-flow")},T=(P,Q,Y,oe)=>{var X,ae;if(P&&(Q.value===+r.modelValue&&!r.disabledValues.includes(Q.value)&&(i.value=P),v!=null&&v.value)){Array.isArray(u.value[Y])?u.value[Y][oe]=P:u.value[Y]=[P];const fe=(X=r.headerRefs)!=null&&X.length?[r.headerRefs].concat(u.value):u.value.concat([r.skipButtonRef?[]:[M.value]]);D(fe,(ae=r.headerRefs)!=null&&ae.length?"monthPicker":"selectionGrid")}};return t({focusGrid:R}),(P,Q)=>(Z(),se("div",{ref_key:"gridWrapRef",ref:s,class:it(Le(A)),role:"dialog",tabindex:"0"},[$("div",dle,[$("div",fle,[Ft(P.$slots,"header")]),(Z(!0),se(dt,null,Vt(Le(H),(Y,oe)=>(Z(),se("div",{class:"dp__overlay_row",key:Le(Pae)(oe),role:"row"},[(Z(!0),se(dt,null,Vt(Y,(X,ae)=>(Z(),se("div",{role:"gridcell",class:it(Le(N)),key:X.value,"aria-selected":X.value===e.modelValue&&!e.disabledValues.includes(X.value),"aria-disabled":X.className.dp__overlay_cell_disabled,ref_for:!0,ref:fe=>T(fe,X,oe,ae),tabindex:"0",onClick:fe=>j(X.value),onKeydown:fr(fe=>j(X.value),["enter"]),onMouseover:fe=>_.value=X.value},[$("div",{class:it(X.className)},[P.$slots.item?Ft(P.$slots,"item",{key:0,item:X}):Ce("",!0),P.$slots.item?Ce("",!0):(Z(),se(dt,{key:1},[Fr(De(X.text),1)],64))],2)],42,ple))),128))]))),128)),P.$slots["button-icon"]?(Z(),se("div",{key:0,role:"button","aria-label":Le(g).toggleOverlay,class:it(Le(z)),tabindex:"0",ref_key:"toggleButton",ref:M,onClick:L,onKeydown:fr(L,["enter"])},[Ft(P.$slots,"button-icon")],42,hle)):Ce("",!0)])],2))}}),u0=()=>{const e=tn(l0);return{transitionName:Ve(()=>t=>e!=null&&e.value?t?e.value.open:e.value.close:""),showTransition:!!(e!=null&&e.value)}},gle={key:0,class:"dp__time_input"},mle=Fr(" : "),vle=["aria-label","onKeydown","onClick"],yle=["aria-label","onKeydown","onClick"],_le=["aria-label","onKeydown","onClick"],ble={key:0},Mle=["aria-label","onKeydown"],Ile=ot({props:as(Dn({},tP),{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=jt({hours:!1,minutes:!1,seconds:!1}),i=Ne("AM"),s=Ne(null),u=tn(Ou),d=tn(Ru),f=Ne([]),{transitionName:g,showTransition:v}=u0(),{setTimePickerElements:_,setTimePickerBackRef:M}=Nu();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 L=[{type:"hours"},"separator",{type:"minutes"}];return r.enableSeconds?L.concat(["separator",{type:"seconds"}]):L}),w=Ve(()=>D.value.filter(L=>typeof L!="string")),S=Ve(()=>L=>{if(L==="hours"){const T=z(r.hours);return{text:T<10?`0${T}`:`${T}`,value:T}}return{text:r[L]<10?`0${r[L]}`:`${r[L]}`,value:r[L]}}),R=L=>{const T=L==="hours"?r.is24?24:12:60,P=+r[`${L}GridIncrement`],Q=[];for(let Y=0;Y<T;Y+=P)Q.push({value:Y,text:Y<10?`0${Y}`:`${Y}`});return Dae(Q)},A=L=>r[`no${L[0].toUpperCase()+L.slice(1)}Overlay`],N=L=>{A(L)||(o[L]=!o[L],o[L]||n("overlay-closed"))},H=(L,T=!0)=>{const P=L==="hours"?Gs:L==="minutes"?$s:Xl,Q=T?Iae:Cae;n(`update:${L}`,P(Q({[L]:+r[L]},{[L]:+r[`${L}Increment`]})))},z=L=>r.is24?L:(L>=12?i.value="PM":i.value="AM",Oae(L)),x=()=>{i.value==="PM"?(i.value="AM",n("update:hours",r.hours-12)):(i.value="PM",n("update:hours",r.hours+12))},B=L=>{o[L]=!0},j=(L,T,P)=>{if(L&&(d!=null&&d.value)){Array.isArray(f.value[T])?f.value[T][P]=L:f.value[T]=[L];let Q=f.value.reduce((Y,oe)=>oe.map((X,ae)=>[...Y[ae]||[],oe[ae]]),[]);M(r.closeTimePickerBtn),s.value&&(Q[1]=Q[1].concat(s.value)),_(Q,r.order)}},G=(L,T)=>L==="hours"&&!r.is24?n(`update:${L}`,i.value==="PM"?T+12:T):n(`update:${L}`,T);return t({openChildCmp:B}),(L,T)=>e.disabled?Ce("",!0):(Z(),se("div",gle,[(Z(!0),se(dt,null,Vt(Le(D),(P,Q)=>(Z(),se("div",{key:Q,class:it(Le(C))},[P==="separator"?(Z(),se(dt,{key:0},[mle],64)):(Z(),se(dt,{key:1},[$("div",{class:"dp__inc_dec_button",role:"button","aria-label":Le(u).incrementValue(P.type),tabindex:"0",onKeydown:fr(Y=>H(P.type),["enter"]),onClick:Y=>H(P.type),ref_for:!0,ref:Y=>j(Y,Q,0)},[L.$slots["arrow-up"]?Ft(L.$slots,"arrow-up",{key:0}):Ce("",!0),L.$slots["arrow-up"]?Ce("",!0):(Z(),bt(Le(KN),{key:1}))],40,vle),$("div",{role:"button","aria-label":Le(u).openTpOverlay(P.type),class:it(A(P.type)?"":"dp__time_display"),tabindex:"0",onKeydown:fr(Y=>N(P.type),["enter"]),onClick:Y=>N(P.type),ref_for:!0,ref:Y=>j(Y,Q,1)},[L.$slots[P.type]?Ft(L.$slots,P.type,{key:0,text:Le(S)(P.type).text,value:Le(S)(P.type).value}):Ce("",!0),L.$slots[P.type]?Ce("",!0):(Z(),se(dt,{key:1},[Fr(De(Le(S)(P.type).text),1)],64))],42,yle),$("div",{class:"dp__inc_dec_button",role:"button","aria-label":Le(u).decrementValue(P.type),tabindex:"0",onKeydown:fr(Y=>H(P.type,!1),["enter"]),onClick:Y=>H(P.type,!1),ref_for:!0,ref:Y=>j(Y,Q,2)},[L.$slots["arrow-down"]?Ft(L.$slots,"arrow-down",{key:0}):Ce("",!0),L.$slots["arrow-down"]?Ce("",!0):(Z(),bt(Le(YN),{key:1}))],40,_le)],64))],2))),128)),L.is24?Ce("",!0):(Z(),se("div",ble,[L.$slots["am-pm-button"]?Ft(L.$slots,"am-pm-button",{key:0,toggle:x,value:i.value}):Ce("",!0),L.$slots["am-pm-button"]?Ce("",!0):(Z(),se("button",{key:1,ref_key:"amPmButton",ref:s,type:"button",class:"dp__pm_am_button",role:"button","aria-label":Le(u).amPmButton,tabindex:"0",onClick:x,onKeydown:fr(bn(x,["prevent"]),["enter"])},De(i.value),41,Mle))])),(Z(!0),se(dt,null,Vt(Le(w),(P,Q)=>(Z(),bt(bo,{key:Q,name:Le(g)(Le(o)[P.type]),css:Le(v)},{default:Ot(()=>[Le(o)[P.type]?(Z(),bt(Mh,{key:0,items:R(P.type),"disabled-values":e.filters.times[P.type],"onUpdate:modelValue":Y=>G(P.type,Y),onSelected:Y=>N(P.type),onToggle:Y=>N(P.type),onResetFlow:T[0]||(T[0]=Y=>L.$emit("reset-flow"))},ji({"button-icon":Ot(()=>[L.$slots["clock-icon"]?Ft(L.$slots,"clock-icon",{key:0}):Ce("",!0),L.$slots["clock-icon"]?Ce("",!0):(Z(),bt(Le(WN),{key:1}))]),_:2},[L.$slots[`${P.type}-overlay`]?{name:"item",fn:Ot(({item:Y})=>[Ft(L.$slots,`${P.type}-overlay`,{text:Y.text,value:Y.value})])}:void 0]),1032,["items","disabled-values","onUpdate:modelValue","onSelected","onToggle"])):Ce("",!0)]),_:2},1032,["name","css"]))),128))]))}}),Hp=[{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"]}],Cle=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],Tle={all:()=>Hp,monthYear:()=>Hp.filter(e=>e.use.includes("month-year")),input:()=>Cle,timePicker:()=>Hp.filter(e=>e.use.includes("time")),action:()=>Hp.filter(e=>e.use.includes("action")),calendar:()=>Hp.filter(e=>e.use.includes("calendar"))},bc=(e,t)=>{const n=[];return Tle[t]().forEach(r=>{e[r.name]&&n.push(r.name)}),n},wle=["aria-label"],Sle={class:"dp__overlay_container"},kle={key:1,class:"dp__overlay_row"},Dle=["aria-label"],Ele=ot({props:as(Dn({},nP),{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(ST,!1),d=Ne([]),f=Ne(null),g=tn(Ou),v=tn(Ru),{transitionName:_,showTransition:M}=u0(),{buildMatrix:C,setTimePicker:D}=Nu();On(()=>{n("mount"),!r.timePicker&&(v!=null&&v.value)?C([No(i.value)],"time"):D(!0,r.timePicker)});const w=Ne(!1),S=L=>({hours:Array.isArray(r.hours)?r.hours[L]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[L]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[L]:r.seconds}),R=Ve(()=>{const L=[];if(r.range)for(let T=0;T<2;T++)L.push(S(T));else L.push(S(0));return L}),A=(L,T=!1,P="")=>{T||n("reset-flow"),w.value=L,v!=null&&v.value&&(D(L),L||n("overlay-closed")),Ir(()=>{P!==""&&d.value[0]&&d.value[0].openChildCmp(P)})},N=Ve(()=>({dp__button:!0,dp__button_bottom:u})),H=bc(o,"timePicker"),z=(L,T,P)=>r.range?T===0?[L,R.value[1][P]]:[R.value[0][P],L]:L,x=L=>{n("update:hours",L)},B=L=>{n("update:minutes",L)},j=L=>{n("update:seconds",L)},G=()=>{f.value&&(v!=null&&v.value)&&f.value.focus({preventScroll:!0})};return t({toggleTimePicker:A}),(L,T)=>(Z(),se("div",null,[L.timePicker?Ce("",!0):(Z(),se("div",{key:0,class:it(Le(N)),role:"button","aria-label":Le(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))},[L.$slots["clock-icon"]?Ft(L.$slots,"clock-icon",{key:0}):Ce("",!0),L.$slots["clock-icon"]?Ce("",!0):(Z(),bt(Le(WN),{key:1}))],42,wle)),Ct(bo,{name:Le(_)(w.value),css:Le(M)},{default:Ot(()=>[w.value||L.timePicker?(Z(),se("div",{key:0,class:"dp__overlay",ref_key:"overlayRef",ref:f,tabindex:"0"},[$("div",Sle,[L.$slots["time-picker-overlay"]?Ft(L.$slots,"time-picker-overlay",{key:0,range:e.range,hours:e.hours,minutes:e.minutes,seconds:e.seconds,setHours:x,setMinutes:B,setSeconds:j}):Ce("",!0),L.$slots["time-picker-overlay"]?Ce("",!0):(Z(),se("div",kle,[(Z(!0),se(dt,null,Vt(Le(R),(P,Q)=>(Z(),bt(Ile,Ao({key:Q,disabled:Q===0?L.fixedStart:L.fixedEnd,hours:P.hours,minutes:P.minutes,seconds:P.seconds,filters:e.filters,ref_for:!0,ref_key:"timeInputRefs",ref:d},{is24:L.is24,hoursGridIncrement:L.hoursGridIncrement,minutesGridIncrement:L.minutesGridIncrement,secondsGridIncrement:L.secondsGridIncrement,hoursIncrement:L.hoursIncrement,minutesIncrement:L.minutesIncrement,secondsIncrement:L.secondsIncrement,filters:e.filters,noHoursOverlay:L.noHoursOverlay,noMinutesOverlay:L.noMinutesOverlay,noSecondsOverlay:L.noSecondsOverlay,enableSeconds:L.enableSeconds,closeTimePickerBtn:s.value,order:Q},{"onUpdate:hours":Y=>x(z(Y,Q,"hours")),"onUpdate:minutes":Y=>B(z(Y,Q,"minutes")),"onUpdate:seconds":Y=>j(z(Y,Q,"seconds")),onMounted:G,onOverlayClosed:G}),ji({_:2},[Vt(Le(H),(Y,oe)=>({name:Y,fn:Ot(X=>[Ft(L.$slots,Y,Vl(zl(X)))])}))]),1040,["disabled","hours","minutes","seconds","filters","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"]))),128))])),L.timePicker?Ce("",!0):(Z(),se("div",{key:2,ref_key:"closeTimePickerBtn",ref:s,class:it(Le(N)),role:"button","aria-label":Le(g).closeTimePicker,tabindex:"0",onKeydown:T[2]||(T[2]=fr(P=>A(!1),["enter"])),onClick:T[3]||(T[3]=P=>A(!1))},[L.$slots["calendar-icon"]?Ft(L.$slots,"calendar-icon",{key:0}):Ce("",!0),L.$slots["calendar-icon"]?Ce("",!0):(Z(),bt(Le(a0),{key:1}))],42,Dle))])],512)):Ce("",!0)]),_:3},8,["name","css"])]))}}),Ale=["aria-label"],_b=ot({props:{ariaLabel:{type:String,default:""}},emits:["activate","setRef"],setup(e,{emit:t}){const n=Ne(null);return On(()=>t("setRef",n)),(r,o)=>(Z(),se("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},[$("div",{class:"dp__inner_nav",role:"button","aria-label":e.ariaLabel},[Ft(r.$slots,"default")],8,Ale)],544))}}),Lle=["aria-label"],bD=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}=u0(),o=Ne(null);return On(()=>t("setRef",o)),(i,s)=>(Z(),se(dt,null,[$("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,Lle),Ct(bo,{name:Le(n)(e.showSelectionGrid),css:Le(r)},{default:Ot(()=>[e.showSelectionGrid?(Z(),bt(Mh,Ao({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"))}),ji({"button-icon":Ot(()=>[i.$slots["calendar-icon"]?Ft(i.$slots,"calendar-icon",{key:0}):Ce("",!0),i.$slots["calendar-icon"]?Ce("",!0):(Z(),bt(Le(a0),{key:1}))]),_:2},[i.$slots[e.slotName]?{name:"item",fn:Ot(({item:u})=>[Ft(i.$slots,e.slotName,{item:u})])}:void 0]),1040)):Ce("",!0)]),_:3},8,["name","css"])],64))}}),sy=(e,t,n)=>[ws(new Date(e),{date:1}),ws(new Date,{month:t,year:n,date:1})],MD=(e,t,n)=>ui(...sy(e,t,n))||Nr(...sy(e,t,n)),ID=(e,t,n)=>rs(...sy(e,t,n))||Nr(...sy(e,t,n)),cP=(e,t,n,r,o,i)=>{let s=!1;return i?e&&t?(t&&o&&ID(t,n,r)&&(s=!0),e&&!o&&MD(e,n,r)&&(s=!0)):(e&&MD(e,n,r)||t&&ID(t,n,r))&&(s=!0):s=!0,s},Ole=(e,t)=>{const n=(s,u)=>{let d=s;return e.filters.months.includes(Jr(d))?(d=u?dl(s,1):tg(s,1),n(d,u)):d},r=(s,u)=>{let d=s;return e.filters.years.includes(Vr(d))?(d=u?DN(s,1):Dse(s,1),r(d,u)):d},o=s=>{const u=ws(new Date,{month:e.month,year:e.year});let d=s?dl(u,1):tg(u,1),f=Jr(d),g=Vr(d);e.filters.months.includes(f)&&(d=n(d,s),f=Jr(d),g=Vr(d)),e.filters.years.includes(g)&&(d=r(d,s),g=Vr(d)),cP(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}},Rle={class:"dp__month_year_row"},Nle={class:"dp__month_picker_header"},Ple=["aria-label"],xle=["aria-label","onKeydown"],Ule=["aria-label"],Fle=ot({props:as(Dn(Dn({},uP),ET),{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}=u0(),{buildMatrix:s}=Nu(),u=Ne(!1),d=Ne(!1),f=Ne([null,null,null,null]),g=Ne(null),v=Ne(null),_=Ne(null),M=tn(Ou),C=tn(Ru),{handleMonthYearChange:D}=Ole(r,n);On(()=>{n("mount")});const w=le=>({get:()=>r[le],set:ce=>{n(`update:${le}`,ce),n("monthYearSelect",le==="year"),le==="month"?Y(!0):oe(!0)}}),S=Ve(w("month")),R=Ve(w("year")),A=Ve(()=>le=>{const ce=le==="month";return{showSelectionGrid:(ce?u:d).value,items:(ce?L:T).value,disabledValues:r.filters[ce?"months":"years"],minValue:(ce?z:N).value,maxValue:(ce?x:H).value,headerRefs:ce&&r.monthPicker?[g.value,v.value,_.value]:[]}}),N=Ve(()=>r.minDate?Vr(new Date(r.minDate)):null),H=Ve(()=>r.maxDate?Vr(new Date(r.maxDate)):null),z=Ve(()=>{if(r.minDate&&N.value){if(N.value>r.year)return 12;if(N.value===r.year)return Jr(new Date(r.minDate))}return null}),x=Ve(()=>{if(r.maxDate&&H.value){if(H.value<r.year)return-1;if(H.value===r.year)return Jr(new Date(r.maxDate))}return null}),B=Ve(()=>r.range&&r.internalModelValue&&r.monthPicker?r.internalModelValue:[]),j=(le,ce=!1)=>{const J=[];for(let re=0;re<le.length;re+=3){const de=[le[re],le[re+1],le[re+2]];J.push(ce?de.reverse():de)}return ce?J.reverse():J},G=Ve(()=>r.months.find(ce=>ce.value===r.month)||{text:"",value:0}),L=Ve(()=>j(r.months)),T=Ve(()=>j(r.years,r.reverseYears)),P=Ve(()=>r.multiCalendars?r.multiCalendarsSolo?!0:r.instance===0:!0),Q=Ve(()=>r.multiCalendars?r.multiCalendarsSolo?!0:r.instance===r.multiCalendars-1:!0),Y=(le=!1)=>{X(le),u.value=!u.value,u.value||n("overlay-closed")},oe=(le=!1)=>{X(le),d.value=!d.value,d.value||n("overlay-closed")},X=le=>{le||n("reset-flow")},ae=(le=!1)=>{n("update:year",le?r.year+1:r.year-1)},fe=(le,ce)=>{C!=null&&C.value&&(f.value[ce]=No(le),s(f.value,"monthYear"))};return t({toggleMonthPicker:Y,toggleYearPicker:oe}),(le,ce)=>(Z(),se("div",Rle,[!le.monthPicker&&!e.yearPicker?(Z(),se(dt,{key:0},[Le(P)&&!le.vertical?(Z(),bt(_b,{key:0,"aria-label":Le(M).prevMonth,onActivate:ce[0]||(ce[0]=J=>Le(D)(!1)),onSetRef:ce[1]||(ce[1]=J=>fe(J,0))},{default:Ot(()=>[le.$slots["arrow-left"]?Ft(le.$slots,"arrow-left",{key:0}):Ce("",!0),le.$slots["arrow-left"]?Ce("",!0):(Z(),bt(Le(fD),{key:1}))]),_:3},8,["aria-label"])):Ce("",!0),Ct(bD,Ao({"aria-label":Le(M).openMonthsOverlay,"slot-name":"month-overlay",modelValue:Le(S),"onUpdate:modelValue":ce[2]||(ce[2]=J=>gr(S)?S.value=J:null)},Le(A)("month"),{onToggle:Y,onSetRef:ce[3]||(ce[3]=J=>fe(J,1))}),ji({default:Ot(()=>[le.$slots.month?Ft(le.$slots,"month",Vl(Ao({key:0},Le(G)))):Ce("",!0),le.$slots.month?Ce("",!0):(Z(),se(dt,{key:1},[Fr(De(Le(G).text),1)],64))]),_:2},[le.$slots["calendar-icon"]?{name:"calendar-icon",fn:Ot(()=>[Ft(le.$slots,"calendar-icon")])}:void 0,le.$slots["month-overlay"]?{name:"month-overlay",fn:Ot(({item:J})=>[Ft(le.$slots,"month-overlay",{text:J.text,value:J.value})])}:void 0]),1040,["aria-label","modelValue"]),Ct(bD,Ao({"aria-label":Le(M).openYearsOverlay,"slot-name":"year-overlay",modelValue:Le(R),"onUpdate:modelValue":ce[4]||(ce[4]=J=>gr(R)?R.value=J:null)},Le(A)("year"),{onToggle:oe,onSetRef:ce[5]||(ce[5]=J=>fe(J,2))}),ji({default:Ot(()=>[le.$slots.year?Ft(le.$slots,"year",{key:0,year:le.year}):Ce("",!0),le.$slots.year?Ce("",!0):(Z(),se(dt,{key:1},[Fr(De(le.year),1)],64))]),_:2},[le.$slots["calendar-icon"]?{name:"calendar-icon",fn:Ot(()=>[Ft(le.$slots,"calendar-icon")])}:void 0,le.$slots["year-overlay"]?{name:"year-overlay",fn:Ot(({item:J})=>[Ft(le.$slots,"year-overlay",{text:J.text,value:J.value})])}:void 0]),1040,["aria-label","modelValue"]),Le(P)&&le.vertical?(Z(),bt(_b,{key:1,"aria-label":Le(M).prevMonth,onActivate:ce[6]||(ce[6]=J=>Le(D)(!1))},{default:Ot(()=>[le.$slots["arrow-up"]?Ft(le.$slots,"arrow-up",{key:0}):Ce("",!0),le.$slots["arrow-up"]?Ce("",!0):(Z(),bt(Le(KN),{key:1}))]),_:3},8,["aria-label"])):Ce("",!0),Le(Q)?(Z(),bt(_b,{key:2,"arial-label":Le(M).nextMonth,onActivate:ce[7]||(ce[7]=J=>Le(D)(!0)),ref:"rightIcon",onSetRef:ce[8]||(ce[8]=J=>fe(J,3))},{default:Ot(()=>[le.$slots[le.vertical?"arrow-down":"arrow-right"]?Ft(le.$slots,le.vertical?"arrow-down":"arrow-right",{key:0}):Ce("",!0),le.$slots[le.vertical?"arrow-down":"arrow-right"]?Ce("",!0):(Z(),bt(lf(le.vertical?Le(YN):Le(pD)),{key:1}))]),_:3},8,["arial-label"])):Ce("",!0)],64)):Ce("",!0),le.monthPicker?(Z(),bt(Mh,Ao({key:1},Le(A)("month"),{"skip-active":r.range,year:le.year,"multi-model-value":Le(B),modelValue:Le(S),"onUpdate:modelValue":ce[15]||(ce[15]=J=>gr(S)?S.value=J:null),onToggle:Y,onSelected:ce[16]||(ce[16]=J=>le.$emit("overlay-closed"))}),ji({header:Ot(()=>[$("div",Nle,[$("div",{class:"dp__month_year_col_nav",tabindex:"0",ref_key:"mpPrevIconRef",ref:g,onClick:ce[9]||(ce[9]=J=>ae(!1)),onKeydown:ce[10]||(ce[10]=fr(J=>ae(!1),["enter"]))},[$("div",{class:"dp__inner_nav",role:"button","aria-label":Le(M).prevMonth},[le.$slots["arrow-left"]?Ft(le.$slots,"arrow-left",{key:0}):Ce("",!0),le.$slots["arrow-left"]?Ce("",!0):(Z(),bt(Le(fD),{key:1}))],8,Ple)],544),$("div",{class:"dp__pointer",role:"button",ref_key:"mpYearButtonRef",ref:v,"aria-label":Le(M).openYearsOverlay,tabindex:"0",onClick:oe,onKeydown:fr(oe,["enter"])},[le.$slots.year?Ft(le.$slots,"year",{key:0,year:le.year}):Ce("",!0),le.$slots.year?Ce("",!0):(Z(),se(dt,{key:1},[Fr(De(le.year),1)],64))],40,xle),$("div",{class:"dp__month_year_col_nav",tabindex:"0",ref_key:"mpNextIconRef",ref:_,onClick:ce[11]||(ce[11]=J=>ae(!0)),onKeydown:ce[12]||(ce[12]=fr(J=>ae(!0),["enter"]))},[$("div",{class:"dp__inner_nav",role:"button","aria-label":Le(M).nextMonth},[le.$slots["arrow-right"]?Ft(le.$slots,"arrow-right",{key:0}):Ce("",!0),le.$slots["arrow-right"]?Ce("",!0):(Z(),bt(Le(pD),{key:1}))],8,Ule)],544)]),Ct(bo,{name:Le(o)(d.value),css:Le(i)},{default:Ot(()=>[d.value?(Z(),bt(Mh,Ao({key:0},Le(A)("year"),{modelValue:Le(R),"onUpdate:modelValue":ce[13]||(ce[13]=J=>gr(R)?R.value=J:null),onToggle:oe,onSelected:ce[14]||(ce[14]=J=>le.$emit("overlay-closed"))}),ji({"button-icon":Ot(()=>[le.$slots["calendar-icon"]?Ft(le.$slots,"calendar-icon",{key:0}):Ce("",!0),le.$slots["calendar-icon"]?Ce("",!0):(Z(),bt(Le(a0),{key:1}))]),_:2},[le.$slots["year-overlay"]?{name:"item",fn:Ot(({item:J})=>[Ft(le.$slots,"year-overlay",{text:J.text,value:J.value})])}:void 0]),1040,["modelValue"])):Ce("",!0)]),_:3},8,["name","css"])]),_:2},[le.$slots["month-overlay"]?{name:"item",fn:Ot(({item:J})=>[Ft(le.$slots,"month-overlay",{text:J.text,value:J.value})])}:void 0]),1040,["skip-active","year","multi-model-value","modelValue"])):Ce("",!0),e.yearPicker?(Z(),bt(Mh,Ao({key:2},Le(A)("year"),{modelValue:Le(R),"onUpdate:modelValue":ce[17]||(ce[17]=J=>gr(R)?R.value=J:null),"skip-button-ref":"",onToggle:oe,onSelected:ce[18]||(ce[18]=J=>le.$emit("overlay-closed"))}),ji({_:2},[le.$slots["year-overlay"]?{name:"item",fn:Ot(({item:J})=>[Ft(le.$slots,"year-overlay",{text:J.text,value:J.value})])}:void 0]),1040,["modelValue"])):Ce("",!0)]))}}),Gle=(e,t,n,r)=>{const o=Ne(new Date),i=Ne(),s=Ne([{month:Jr(new Date),year:Vr(new Date)}]),u=Ne(e.range?[Gs(new Date),Gs(new Date)]:Gs(new Date)),d=Ne(e.range?[$s(new Date),$s(new Date)]:$s(new Date)),f=Ne(e.range?[0,0]:0);$t(s,()=>{setTimeout(()=>{e.openOnTop&&t("dpOpen")},0)},{deep:!0}),On(()=>{j(),S.value||(e.startDate&&(s.value[0].month=Jr(new Date(e.startDate)),s.value[0].year=Vr(new Date(e.startDate)),e.multiCalendars&&J(0)),e.startTime&&w())});const g=Ve(()=>V=>s.value[V]?s.value[V].month:0),v=Ve(()=>V=>s.value[V]?s.value[V].year:0),_=(V,ne,ye)=>{s.value[V].month=ne,s.value[V].year=ye},M=(V,ne)=>s.value[V].month=ne,C=(V,ne)=>s.value[V].year=ne,D=(V=!0)=>e.enableSeconds?Array.isArray(f.value)?V?f.value[0]:f.value[1]:f.value:0,w=()=>{e.startTime&&(ile(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:V=>{!e.readonly&&!e.disabled&&t("update:internalModelValue",V)}});$t(S,()=>j());const R=V=>{const{validate:ne}=ZN(e.minDate,e.maxDate,e.disabledDates,e.allowedDates,e.filters,e.disabledWeekDays,e.yearRange);return!ne(V)},A=V=>!S.value||e.hideOffsetDates&&!V.current||e.range?!1:e.multiDates&&Array.isArray(S.value)?S.value.some(ne=>Nr(ne,V.value)):Nr(V.value,S.value?S.value:o.value),N=V=>XN(S.value,i.value,V.value),H=V=>{if((!e.multiCalendars||!e.multiStatic)&&(M(0,Jr(V)),C(0,Vr(V))),e.multiCalendars)for(let ne=1;ne<=e.multiCalendars;ne++){const ye=ws(new Date,{month:g.value(ne-1),year:v.value(ne-1)}),Be=kN(ye,{months:1});s.value[ne]={month:Jr(Be),year:Vr(Be)}}},z=()=>{if(Array.isArray(S.value)&&S.value.length===2){const V=new Date(S.value[1]?S.value[1]:dl(S.value[0],1)),[ne,ye]=[Jr(S.value[0]),Vr(S.value[0])],[Be,je]=[Jr(S.value[1]),Vr(S.value[1])];(ne!==Be||ne===Be&&ye!==je)&&e.multiCalendarsSolo&&(M(1,Jr(V)),C(1,Vr(V)))}},x=V=>{H(V),u.value=Gs(V),d.value=$s(V),f.value=Xl(V)},B=()=>Array.isArray(S.value)&&S.value.length?S.value[S.value.length-1]:null,j=()=>{if(S.value)if(Qp(S.value)){if(S.value.length===2&&!e.multiDates)H(S.value[0]),u.value=[Gs(S.value[0]),S.value[1]?Gs(S.value[1]):Gs(new Date)],d.value=[$s(S.value[0]),S.value[1]?$s(S.value[1]):$s(new Date)],f.value=[Xl(S.value[0]),S.value[1]?Xl(S.value[1]):Xl(new Date)];else if(Qp(S.value)&&e.multiDates){const V=S.value[S.value.length-1];V&&x(V)}e.multiCalendars&&e.multiCalendarsSolo&&z()}else x(S.value);else e.timePicker?(w(),e.range?Us(u.value)&&Us(d.value)&&(S.value=[Hi(new Date,u.value[0],d.value[0],D()),Hi(new Date,u.value[1],d.value[1],D(!1))]):S.value=Hi(new Date,u.value,d.value,D())):e.monthPicker&&!e.range?S.value=Wc(new Date,g.value(0),v.value(0)):e.multiCalendars?H(new Date):e.yearPicker&&(S.value=new Date)},G=V=>{const ne=Jr(new Date(V)),ye=Vr(new Date(V));if(M(0,ne),C(0,ye),e.multiCalendars>0)for(let Be=1;Be<e.multiCalendars;Be++){const je=Mae(ws(new Date(V),{year:g.value(Be-1),month:v.value(Be-1)}));M(Be,je.month),C(Be,je.year)}},L=V=>{if(S.value&&Array.isArray(S.value))if(S.value.some(ne=>Nr(V,ne))){const ne=S.value.filter(ye=>!Nr(ye,V));S.value=ne.length?ne:null}else(e.multiDatesLimit&&+e.multiDatesLimit>S.value.length||!e.multiDatesLimit)&&S.value.push(V);else S.value=[V]},T=V=>{if(Array.isArray(S.value)&&S.value[0]){const ne=poe(V,S.value[0]),ye=Math.abs(ne<0?ne+1:ne-1);if(e.minRange&&e.maxRange)return ye>=+e.minRange&&ye<=+e.maxRange;if(e.minRange)return ye>=+e.minRange;if(e.maxRange)return ye<=+e.maxRange}return!0},P=V=>Array.isArray(S.value)&&S.value.length===2?e.fixedStart&&(rs(V,S.value[0])||Nr(V,S.value[0]))?[S.value[0],V]:e.fixedEnd&&(ui(V,S.value[1])||Nr(V,S.value[1]))?[V,S.value[1]]:S.value:[],Q=()=>{e.autoApply&&t("autoApply")},Y=V=>!voe({start:V[0],end:V[1]}).some(ne=>R(ne)),oe=(V,ne=!1)=>{if(!R(V.value)&&!(!V.current&&e.hideOffsetDates)){if(e.weekPicker)return S.value=Sm(new Date(V.value),+e.weekStart),Q();if(!e.range&&!Us(u.value)&&!Us(d.value)){const ye=Hi(new Date(V.value),u.value,d.value,D());e.multiDates?L(ye):S.value=ye,n(),Q()}else if(Us(u.value)&&Us(d.value)&&!e.multiDates){let ye=S.value?S.value.slice():[];if(ye.length===2&&!(e.fixedStart||e.fixedEnd)&&(ye=[]),e.autoRange){const Be=[new Date(V.value),jc(new Date(V.value),+e.autoRange)];Y(Be)&&(ne&&G(V.value),ye=Be)}else e.fixedStart||e.fixedEnd?ye=P(new Date(V.value)):ye[0]?T(new Date(V.value))&&(ui(new Date(V.value),new Date(ye[0]))?ye.unshift(new Date(V.value)):ye[1]=new Date(V.value)):ye[0]=new Date(V.value);ye.length&&(ye[0]&&!ye[1]?ye[0]=Hi(ye[0],u.value[0],d.value[0],D()):(ye[0]=Hi(ye[0],u.value[0],d.value[0],D()),ye[1]=Hi(ye[1],u.value[1],d.value[1],D(!1)),n()),S.value=ye,ye[0]&&ye[1]&&e.autoApply&&t("autoApply"))}}},X=V=>{const ne=V.find(ye=>ye.current);return ne?Sie(ne.value):""},ae=V=>{!V.current&&e.hideOffsetDates||(i.value=V.value)},fe=V=>{if(e.autoRange||e.weekPicker){if(i.value){if(e.hideOffsetDates&&!V.current)return!1;const ne=jc(i.value,+e.autoRange),ye=Sm(new Date(i.value),+e.weekStart);return e.weekPicker?Nr(ye[1],new Date(V.value)):Nr(ne,new Date(V.value))}return!1}return!1},le=V=>{if(e.autoRange||e.weekPicker){if(i.value){const ne=jc(i.value,+e.autoRange);if(e.hideOffsetDates&&!V.current)return!1;const ye=Sm(new Date(i.value),+e.weekStart);return e.weekPicker?rs(V.value,ye[0])&&ui(V.value,ye[1]):rs(V.value,i.value)&&ui(V.value,ne)}return!1}return!1},ce=V=>{if(e.autoRange||e.weekPicker){if(i.value){if(e.hideOffsetDates&&!V.current)return!1;const ne=Sm(new Date(i.value),+e.weekStart);return e.weekPicker?Nr(ne[0],V.value):Nr(i.value,V.value)}return!1}return!1},J=V=>{for(let ne=V-1;ne>=0;ne--){const ye=tg(ws(new Date,{month:g.value(ne+1),year:v.value(ne+1)}),1);_(ne,Jr(ye),Vr(ye))}for(let ne=V+1;ne<=e.multiCalendars-1;ne++){const ye=dl(ws(new Date,{month:g.value(ne-1),year:v.value(ne-1)}),1);_(ne,Jr(ye),Vr(ye))}},re=V=>Wc(new Date,g.value(V),v.value(V)),de=(V,ne,ye=!0)=>{if(ye?M(V,ne):C(V,ne),e.multiCalendars&&!e.multiCalendarsSolo&&J(V),e.monthPicker)if(e.range){if(ye){let Be=S.value?S.value.slice():[];Be.length===2&&Be[1]!==null&&(Be=[]),Be.length?ui(re(V),Be[0])?Be.unshift(re(V)):Be[1]=re(V):Be=[re(V)],S.value=Be}}else S.value=re(V);n(),t("updateMonthYear",{instance:V,value:ne,isMonth:ye}),Te(e.multiCalendarsSolo?V:void 0)},Oe=V=>Hi(V,u.value,d.value,D()),ve=V=>{Qp(V)&&Qp(S.value)&&Us(u.value)&&Us(d.value)?(V[0]&&S.value[0]&&(S.value[0]=Hi(V[0],u.value[0],d.value[0],D())),V[1]&&S.value[1]&&(S.value[1]=Hi(V[1],u.value[1],d.value[1],D(!1)))):e.multiDates&&Array.isArray(S.value)?S.value[S.value.length-1]=Oe(V):!e.range&&!lv(V)&&(S.value=Oe(V)),t("timeUpdate")},Me=(V,ne=!0,ye=!1)=>{const Be=ne?V:u.value,je=!ne&&!ye?V:d.value,lt=ye?V:f.value;if(e.range&&lv(S.value)&&Us(Be)&&Us(je)&&Us(lt)){const Fe=wt=>Hi(S.value[wt],Be[wt],je[wt],lt[wt]),st=wt=>wT(S.value[wt],0);if(Nr(S.value[0],S.value[1])&&(UN(Fe(0),st(1))||FN(Fe(1),st(0))))return}if(u.value=Be,d.value=je,f.value=lt,S.value)if(e.multiDates){const Fe=B();Fe&&ve(Fe)}else ve(S.value);else e.timePicker&&ve(e.range?[new Date,new Date]:new Date);n()},K=()=>{i.value=null},me=V=>yD(S.value,e.range)&&S.value[0]&&i.value?V?rs(i.value,S.value[0]):ui(i.value,S.value[0]):!0,ke=(V,ne=!0)=>(e.range||e.weekPicker)&&lv(S.value)?e.hideOffsetDates&&!V.current?!1:Nr(new Date(V.value),S.value[ne?0:1]):e.range?Nr(new Date(V.value),S.value&&Array.isArray(S.value)?ne?S.value[0]||null:S.value[1]:null)&&(ne?!ui(i.value||null,Array.isArray(S.value)?S.value[0]:null):!0)||Nr(V.value,Array.isArray(S.value)?S.value[0]:null)&&me(ne):!1,pe=(V,ne)=>Array.isArray(e.internalModelValue)&&e.internalModelValue.length||e.weekPicker?!1:!V&&!A(ne)&&!(!ne.current&&e.hideOffsetDates)&&(e.range?!ke(ne)&&!ke(ne,!1):!0),W=(V,ne,ye)=>Array.isArray(e.internalModelValue)&&e.internalModelValue[0]&&e.internalModelValue.length===1?V?!1:ye?rs(e.internalModelValue[0],ne.value):ui(e.internalModelValue[0],ne.value):!1,te=(V=!1)=>{V&&e.yearPicker&&(S.value=gf(new Date,s.value[0].year),e.autoApply&&t("autoApply")),e.autoApply&&e.monthPicker&&Ir().then(()=>{e.range?t("autoApply",V||!S.value||S.value.length===1):t("autoApply",V)})},ie=(V,ne)=>{const ye=ws(new Date,{month:g.value(ne),year:v.value(ne)}),Be=V<0?dl(ye,1):tg(ye,1);cP(e.minDate,e.maxDate,Jr(Be),Vr(Be),V<0,e.preventMinMaxNavigation)&&(_(ne,Jr(Be),Vr(Be)),e.multiCalendars&&!e.multiCalendarsSolo&&J(ne),Te())},Ie=(V,ne)=>{e.monthChangeOnScroll&&ie(e.monthChangeOnScroll!=="inverse"?-V.deltaY:V.deltaY,ne)},ue=(V,ne,ye=!1)=>{e.monthChangeOnArrows&&e.vertical===ye&&Se(V,ne)},Se=(V,ne)=>{ie(V==="right"?-1:1,ne)},Pe=V=>e.markers.find(ne=>Nr(bs(new Date(V.value)),bs(new Date(ne.date)))),xe=()=>{e.range?yD(S.value,e.range)&&(S.value&&S.value[0]?S.value=ui(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=V=>{V.length&&V.length<=2&&e.range&&(S.value=V.map(ne=>new Date(ne)),e.autoApply&&t("selectDate"))},Te=V=>{V||V===0?r.value[V].triggerTransition(g.value(V),v.value(V)):r.value.forEach((ne,ye)=>ne.triggerTransition(g.value(ye),v.value(ye)))};return{today:o,hours:u,minutes:d,seconds:f,month:g,year:v,monthYearSelect:te,isDisabled:R,updateTime:Me,setHoverDate:ae,getWeekNum:X,selectDate:oe,rangeActive:N,isActiveDate:A,updateMonthYear:de,isHoverRangeEnd:fe,isAutoRangeInBetween:le,isAutoRangeStart:ce,clearHoverDate:K,rangeActiveStartEnd:ke,handleScroll:Ie,getMarker:Pe,handleArrow:ue,handleSwipe:Se,selectCurrentDate:xe,isHoverDate:pe,isHoverDateStartEnd:W,presetDateRange:He}},$le=["id","aria-label","onKeydown"],Ble={key:0,class:"dp__preset_ranges"},Hle=["onClick"],qle={key:1,class:"dp__now_wrap"},Vle=ot({props:as(Dn(Dn(Dn({},aP),DT),kT),{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=jt({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(l0),C=tn(Ou),D=tn(Ru),{setMenuFocused:w,setShiftKey:S}=LT();On(()=>{var ze;v.value=!0,(ze=n.presetRanges)!=null&&ze.length||ye();const St=No(f);if(St&&!n.textInput&&!n.inline&&(w(!0),z()),St){const _t=Ht=>{Ht.stopImmediatePropagation(),Ht.stopPropagation()};St.addEventListener("pointerdown",_t),St.addEventListener("mousedown",_t)}document.addEventListener("resize",ye)}),hl(()=>{document.removeEventListener("resize",ye)});const{arrowRight:R,arrowLeft:A,arrowDown:N,arrowUp:H}=Nu(),z=()=>{const ze=No(f);ze&&ze.focus({preventScroll:!0})},x=()=>{var ze;(ze=n.flow)!=null&&ze.length&&_.value!==-1&&(_.value+=1,t("flow-step",_.value),en())},B=()=>{_.value=-1},{updateTime:j,updateMonthYear:G,today:L,month:T,year:P,hours:Q,minutes:Y,seconds:oe,isDisabled:X,isActiveDate:ae,selectDate:fe,getWeekNum:le,setHoverDate:ce,isHoverRangeEnd:J,isAutoRangeInBetween:re,isAutoRangeStart:de,rangeActive:Oe,clearHoverDate:ve,rangeActiveStartEnd:Me,monthYearSelect:K,handleScroll:me,handleArrow:ke,handleSwipe:pe,getMarker:W,selectCurrentDate:te,isHoverDateStartEnd:ie,isHoverDate:Ie,presetDateRange:ue}=Gle(n,t,x,u),Se=bc(r,"calendar"),Pe=bc(r,"action"),xe=bc(r,"timePicker"),He=bc(r,"monthYear"),Te=Ve(()=>n.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),V=Ve(()=>Aae(n.yearRange)),ne=Ve(()=>Lae(n.locale,n.monthNameFormat)),ye=()=>{const ze=No(o);ze&&(g.value=ze.getBoundingClientRect().width)},Be=Ve(()=>ze=>kae(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),st=Ve(()=>({dp__flex_display:n.multiCalendars>0})),wt=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:le,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,St)=>ze.value(St).map(_t=>as(Dn({},_t),{days:_t.days.map(Ht=>{const Yt=X(Ht.value),yr=Ie(Yt,Ht),Cr=(n.range||n.weekPicker)&&(!(n.multiCalendars>0)||Ht.current)&&!Yt&&!(!Ht.current&&n.hideOffsetDates)&&!ae(Ht)?Oe(Ht):!1;return Ht.marker=W(Ht),Ht.classData={dp__cell_offset:!Ht.current,dp__pointer:!Yt&&!(!Ht.current&&n.hideOffsetDates),dp__active_date:n.range?!1:ae(Ht),dp__date_hover:yr,dp__date_hover_start:ie(yr,Ht,!0),dp__date_hover_end:ie(yr,Ht,!1),dp__range_between:Cr&&!n.weekPicker,dp__range_between_week:Cr&&n.weekPicker,dp__today:!n.noToday&&Nr(Ht.value,L.value)&&Ht.current,dp__cell_disabled:Yt,dp__cell_auto_range:re(Ht),dp__cell_auto_range_start:de(Ht),dp__cell_auto_range_end:J(Ht),dp__range_start:n.multiCalendars>0?Ht.current&&Me(Ht):Me(Ht),dp__range_end:n.multiCalendars>0?Ht.current&&Me(Ht,!1):Me(Ht,!1),[n.calendarCellClassName]:!!n.calendarCellClassName},Ht})})),Qe=ze=>{ze.stopPropagation(),ze.preventDefault(),ze.stopImmediatePropagation()},yt=()=>{n.escClose&&t("closePicker")},Pt=ze=>{ze.stopImmediatePropagation(),ze.preventDefault(),n.spaceConfirm&&t("selectDate")},ln=ze=>{var St;(St=n.flow)!=null&&St.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 H();if(ze==="down")return N();if(ze==="left")return A();if(ze==="right")return R()}else ze==="left"||ze==="up"?ke("left",0,ze==="up"):ke("right",0,ze==="down")},qn=ze=>{S(ze.shiftKey)};return(ze,St)=>(Z(),bt(bo,{appear:"",name:Le(M).menuAppear,mode:"out-in",css:!!Le(M)},{default:Ot(()=>[$("div",{id:ze.uid?`dp-menu-${ze.uid}`:void 0,tabindex:"0",ref_key:"dpMenuRef",ref:f,role:"dialog","aria-label":Le(C).menu,class:it(Le(En)),onMouseleave:St[11]||(St[11]=(..._t)=>Le(ve)&&Le(ve)(..._t)),onClick:Qe,onKeydown:[fr(yt,["esc"]),fr(Pt,["space"]),St[12]||(St[12]=fr(bn(_t=>Tn("left"),["prevent"]),["left"])),St[13]||(St[13]=fr(bn(_t=>Tn("up"),["prevent"]),["up"])),St[14]||(St[14]=fr(bn(_t=>Tn("down"),["prevent"]),["down"])),St[15]||(St[15]=fr(bn(_t=>Tn("right"),["prevent"]),["right"])),qn]},[(ze.disabled||ze.readonly)&&ze.inline?(Z(),se("div",{key:0,class:it(Le(mn))},null,2)):Ce("",!0),ze.inline?Ce("",!0):(Z(),se("div",{key:1,class:it(Le(Te))},null,2)),$("div",{class:it(ze.presetRanges.length?"dp__menu_content_wrapper":null)},[ze.presetRanges.length?(Z(),se("div",Ble,[(Z(!0),se(dt,null,Vt(ze.presetRanges,(_t,Ht)=>(Z(),se("div",{key:Ht,class:"dp__preset_range",onClick:Yt=>Le(ue)(_t.range)},De(_t.label),9,Hle))),128))])):Ce("",!0),$("div",{class:"dp__instance_calendar",ref_key:"calendarWrapperRef",ref:o,role:"document"},[$("div",{class:it(Le(st))},[(Z(!0),se(dt,null,Vt(Le(je),(_t,Ht)=>(Z(),se("div",{key:_t,class:it(Le(wt))},[!ze.disableMonthYearSelect&&!ze.timePicker?(Z(),bt(lf(ze.monthYearComponent?ze.monthYearComponent:Fle),Ao({key:0,ref_for:!0,ref:Yt=>{Yt&&(s.value[Ht]=Yt)}},{months:Le(ne),years:Le(V),filters:ze.filters,monthPicker:ze.monthPicker,month:Le(T)(_t),year:Le(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:St[0]||(St[0]=Yt=>ln("monthYearInput")),onResetFlow:B,"onUpdate:month":Yt=>Le(G)(_t,Yt,!0),"onUpdate:year":Yt=>Le(G)(_t,Yt,!1),onMonthYearSelect:Le(K),onOverlayClosed:z}),ji({_:2},[Vt(Le(He),(Yt,yr)=>({name:Yt,fn:Ot(Cr=>[Ft(ze.$slots,Yt,Vl(zl(Cr)))])}))]),1040,["onUpdate:month","onUpdate:year","onMonthYearSelect"])):Ce("",!0),Ct(Qae,Ao({ref_for:!0,ref:Yt=>{Yt&&(u.value[Ht]=Yt)}},Le(Cn),{"flow-step":_.value,"onUpdate:flow-step":St[1]||(St[1]=Yt=>_.value=Yt),instance:_t,"mapped-dates":Le(In)(_t),month:Le(T)(_t),year:Le(P)(_t),onSelectDate:Yt=>Le(fe)(Yt,!Le(lt)(_t)),onSetHoverDate:St[2]||(St[2]=Yt=>Le(ce)(Yt)),onHandleScroll:Yt=>Le(me)(Yt,_t),onHandleSwipe:Yt=>Le(pe)(Yt,_t),onMount:St[3]||(St[3]=Yt=>ln("calendar")),onResetFlow:B}),ji({_:2},[Vt(Le(Se),(Yt,yr)=>({name:Yt,fn:Ot(Cr=>[Ft(ze.$slots,Yt,Vl(zl(Dn({},Cr))))])}))]),1040,["flow-step","instance","mapped-dates","month","year","onSelectDate","onHandleScroll","onHandleSwipe"])],2))),128))],2),$("div",null,[ze.enableTimePicker&&!ze.monthPicker&&!ze.weekPicker?(Z(),bt(lf(ze.timePickerComponent?ze.timePickerComponent:Ele),Ao({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:Le(Q),minutes:Le(Y),seconds:Le(oe),customProps:ze.customProps,enableSeconds:ze.enableSeconds,fixedStart:ze.fixedStart,fixedEnd:ze.fixedEnd},{onMount:St[4]||(St[4]=_t=>ln("timePicker")),"onUpdate:hours":St[5]||(St[5]=_t=>Le(j)(_t)),"onUpdate:minutes":St[6]||(St[6]=_t=>Le(j)(_t,!1)),"onUpdate:seconds":St[7]||(St[7]=_t=>Le(j)(_t,!1,!0)),onResetFlow:B,onOverlayClosed:z}),ji({_:2},[Vt(Le(xe),(_t,Ht)=>({name:_t,fn:Ot(Yt=>[Ft(ze.$slots,_t,Vl(zl(Yt)))])}))]),1040)):Ce("",!0)])],512),ze.showNowButton?(Z(),se("div",qle,[ze.$slots["now-button"]?Ft(ze.$slots,"now-button",{key:0,selectCurrentDate:Le(te)}):Ce("",!0),ze.$slots["now-button"]?Ce("",!0):(Z(),se("button",{key:1,type:"button",role:"button",class:"dp__now_button",onClick:St[8]||(St[8]=(..._t)=>Le(te)&&Le(te)(..._t))},De(ze.nowButtonLabel),1))])):Ce("",!0)],2),!ze.autoApply||ze.keepActionRow?(Z(),bt(lf(ze.actionRowComponent?ze.actionRowComponent:cle),Ao({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:St[9]||(St[9]=_t=>ze.$emit("closePicker")),onSelectDate:St[10]||(St[10]=_t=>ze.$emit("selectDate"))}),ji({_:2},[Vt(Le(Pe),(_t,Ht)=>({name:_t,fn:Ot(Yt=>[Ft(ze.$slots,_t,Vl(zl(Dn({},Yt))))])}))]),1040)):Ce("",!0)],42,$le)]),_:3},8,["name","css"]))}});var uv=(e=>(e.center="center",e.left="left",e.right="right",e))(uv||{});const zle=(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 N=A.getBoundingClientRect();return{left:N.left+window.scrollX,top:N.top+window.scrollY}},_=A=>{const N=A.getBoundingClientRect();let H=0,z=0;for(;A&&!isNaN(A.offsetLeft)&&!isNaN(A.offsetTop);)H+=A.offsetLeft-A.scrollLeft,z=N.top+A.scrollTop,A=A.offsetParent;return{top:z,left:H}},M=(A,N)=>{u.value.left=`${A+N}px`,u.value.transform="translateX(-100%)"},C=A=>{u.value.left=`${A}px`,u.value.transform="translateX(0)"},D=(A,N)=>{e===uv.left&&C(A),e===uv.right&&M(A,N),e===uv.center&&(u.value.left=`${A+N/2}px`,u.value.transform="translateX(-50%)")},w=()=>{const A=No(o);if(A){const N=window.innerHeight,{top:H}=t?_(A):v(A),{left:z,width:x,top:B,height:j}=A.getBoundingClientRect(),G=N-B-j;u.value.top=B>G?`${H-g}px`:`${H}px`,D(z,x)}},S=(A=!0)=>{if(!i){const N=No(o);if(t&&typeof t!="boolean")u.value=t(N);else if(N){const{left:H,width:z,height:x}=N.getBoundingClientRect(),{top:B}=t?_(N):v(N);u.value.top=`${x+B+f}px`,D(H,z),A&&n&&R()}}},R=()=>{const A=No(o);if(A&&n&&!i){const{height:N,top:H,left:z,width:x}=A.getBoundingClientRect(),{top:B}=t?_(A):v(A),j=window.innerHeight-H-N,G=No(r);if(G){const{height:L,left:T,right:P}=G.getBoundingClientRect(),Q=L+N;Q>H&&Q>j?H<j&&(S(!1),d.value=!1):Q>j?(u.value.top=`${B-L-f}px`,d.value=!0):(S(!1),d.value=!1),T<0?C(z):P>document.documentElement.clientWidth&&M(z,x)}}s("recalculatePosition")};return{openOnTop:d,menuPosition:u,setMenuPosition:S,setInitialPosition:w,recalculatePosition:R}},jle=(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 N=null;A?t?tle(A)&&"hours"in A[0]&&"minutes"in A[0]?N=[Hi(null,+A[0].hours,+A[0].minutes,+A[0].seconds),Hi(null,+A[1].hours,+A[1].minutes,+A[1].seconds)]:ele(A)&&(N=Hi(null,+A.hours,+A.minutes,+A.seconds)):n?nle(A)&&"month"in A[0]&&"year"in A[0]?(N=[Wc(null,+A[0].month,+A[0].year)],A[1]?N[1]=Wc(null,+A[1].month,+A[1].year):!A[1]&&o&&(N[1]=null)):rle(A)&&"month"in A&&"year"in A&&(N=Wc(null,+A.month,+A.year)):_?N=gf(new Date,A):f&&Array.isArray(A)?N=A.map(H=>new Date(H)):v&&Array.isArray(A)?N=[new Date(A[0]),new Date(A[1])]:r?ole(A,o)&&(N=[new Date(A[0]),A[1]?new Date(A[1]):null]):sle(A)&&(N=new Date(A)):N=null,fI(N)?(w.value=N,R()):(w.value=null,D.value="")},R=()=>{if(!w.value)D.value="";else if(!e||typeof e=="string"){const A=JN(e,i,u,n,t,v,_,s);Array.isArray(w.value)&&f?D.value=w.value.map(N=>iy(N,A,d==null?void 0:d.value)).join("; "):D.value=iy(w.value,A,d==null?void 0:d.value,M==null?void 0:M.rangeSeparator)}else t?D.value=e(pI(w.value)):n?D.value=e(gD(w.value)):D.value=e(w.value)};return{parseExternalModelValue:S,formatInputValue:R,internalModelValue:w,inputValue:D,emitModelValue:()=>{if(n)C("update:modelValue",gD(w.value));else if(t)C("update:modelValue",pI(w.value));else if(v)C("update:modelValue",w.value);else if(_)C("update:modelValue",Vr(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(N=>N&&bs(N)):bs(w.value):w.value;C("update:modelValue",A)}R()},checkBeforeEmit:()=>w.value?r?o?w.value.length>=1:w.value.length===2:!!w.value:!1}},Wle=typeof window<"u"?window:void 0,bb=()=>{},Kle=e=>eC()?(lL(e),!0):!1,Yle=(e,t,n,r)=>{if(!e)return bb;let o=bb;const i=$t(()=>Le(e),u=>{o(),u&&(u.addEventListener(t,n,r),o=()=>{u.removeEventListener(t,n,r),o=bb})},{immediate:!0,flush:"post"}),s=()=>{i(),o()};return Kle(s),s},Jle=(e,t,n,r={})=>{const{window:o=Wle,event:i="pointerdown"}=r;return o?Yle(o,i,s=>{const u=No(e),d=No(t);!u||!d||u===s.target||s.composedPath().includes(u)||s.composedPath().includes(d)||n(s)},{passive:!0}):void 0},Xle=ot({props:Dn({},Fae),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=dr(r,"modelValue"),u=Ne(null),d=Ne(null),f=Ne(null),g=Ne(null);ci(ST,r.autoApply);const v=Ve(()=>r.formatLocale);ci(eP,v),ci(QN,dr(r,"textInput")),ci(Ru,dr(r,"arrowNavigation")),On(()=>{H(r.modelValue),r.inline||(window.addEventListener("scroll",J),window.addEventListener("resize",re)),r.inline&&(i.value=!0)}),hl(()=>{r.inline||(window.removeEventListener("scroll",J),window.removeEventListener("resize",re))});const _=bc(o,"all"),M=bc(o,"input");$t(s,()=>{H(s.value)},{deep:!0});const{openOnTop:C,menuPosition:D,setMenuPosition:w,recalculatePosition:S,setInitialPosition:R}=zle(r.position,r.altPosition,r.autoPosition,u,d,r.inline,n),{internalModelValue:A,inputValue:N,parseExternalModelValue:H,emitModelValue:z,checkBeforeEmit:x,formatInputValue:B}=jle(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:j}=Nu(),{setMenuFocused:G,setShiftKey:L}=LT(),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(()=>_D(r.format)?r.format:JN(null,r.is24,r.enableSeconds,r.monthPicker,r.timePicker,r.weekPicker,r.yearPicker,r.enableTimePicker)),Q=Ve(()=>r.previewFormat?r.previewFormat:_D(P.value)?P.value:r.format),Y=Ve(()=>typeof r.transitions=="boolean"?r.transitions?vD({}):!1:vD(r.transitions));ci(l0,Y);const oe=Ve(()=>r.dark?"dp__theme_dark":"dp__theme_light"),X=Ve(()=>Object.assign(Rae(),r.textInputOptions)),ae=Ve(()=>Uae(r.ariaLabels));ci(Ou,ae);const fe=Ve(()=>Nae(r.filters)),le=Ve(()=>{const ue=Se=>{const Pe={hours:Gs(new Date),minutes:$s(new Date),seconds:Xl(new Date)};return Object.assign(Pe,Se)};return r.range?r.startTime&&Array.isArray(r.startTime)?[ue(r.startTime[0]),ue(r.startTime[1])]:null:r.startTime&&!Array.isArray(r.startTime)?ue(r.startTime):null}),ce=Ve(()=>r.multiCalendars===null?0:typeof r.multiCalendars=="boolean"?r.multiCalendars?2:0:+r.multiCalendars>=2?+r.multiCalendars:2),J=()=>{i.value&&(r.closeOnScroll?pe():r.autoPosition?w():window.removeEventListener("scroll",J))},re=()=>{i.value&&w()},de=()=>{!r.disabled&&!r.readonly&&(R(),i.value=!0,Ir().then(()=>{w(),i.value&&(n("open"),n("focus"))}),i.value||ke(),H(r.modelValue))},Oe=()=>{N.value="",ke(),n("update:modelValue",null),n("cleared"),pe()},ve=()=>{const{validate:ue}=ZN(r.minDate,r.maxDate,r.disabledDates,r.allowedDates,fe.value,r.disabledWeekDays,r.yearRange),Se=A.value;return!Array.isArray(Se)&&ue(Se)?!0:Array.isArray(Se)?Se.length===2&&ue(Se[0])&&ue(Se[1])?!0:!!ue(Se[0]):!1},Me=()=>{x()&&ve()&&(z(),pe())},K=ue=>{z(),r.closeOnAutoApply&&!ue&&pe()},me=(ue=!1)=>{r.autoApply&&(!r.enableTimePicker||r.monthPicker||r.yearPicker||hI(A.value,r.maxTime,r.minTime))&&ve()&&(r.range&&Array.isArray(A.value)?(r.partialRange||A.value.length===2)&&K(ue):K(ue))},ke=()=>{A.value=null},pe=()=>{r.inline||(i.value&&(i.value=!1,G(!1),L(!1),j(),n("closed"),n("blur"),R(),N.value&&H(s.value)),ke(),d.value&&d.value.unFocus(),ie())},W=(ue,Se)=>{if(!ue){A.value=null;return}A.value=ue,Se&&(Me(),n("textSubmit"))},te=()=>{r.autoApply&&hI(A.value,r.maxTime,r.minTime)&&z()},ie=()=>{f.value&&f.value.focus({preventScroll:!0})},Ie=()=>i.value?pe():de();return Jle(u,d,pe),t({closeMenu:pe,selectDate:Me,clearValue:Oe,openMenu:de,onScroll:J,formatInputValue:B}),(ue,Se)=>(Z(),se("div",{class:it(Le(T))},[$("span",{tabindex:"-1",ref_key:"focusRefBefore",ref:g},null,512),Ct(qae,Ao({ref_key:"inputRef",ref:d},{placeholder:ue.placeholder,hideInputIcon:ue.hideInputIcon,readonly:ue.readonly,disabled:ue.disabled,inputClassName:ue.inputClassName,clearable:ue.clearable,state:ue.state,inline:ue.inline,inlineWithInput:ue.inlineWithInput,textInput:ue.textInput,textInputOptions:Le(X),range:ue.range,isMenuOpen:i.value,pattern:Le(P),autoApply:ue.autoApply,uid:ue.uid,openMenuOnFocus:ue.openMenuOnFocus,required:ue.required,name:ue.name,autocomplete:ue.autocomplete},{"input-value":Le(N),"onUpdate:input-value":Se[0]||(Se[0]=Pe=>gr(N)?N.value=Pe:null),onClear:Oe,onOpen:de,onSetInputDate:W,onSetEmptyDate:Le(z),onSelectDate:Me,onToggle:Ie,onClose:pe,onFocusPrev:Se[1]||(Se[1]=Pe=>ue.$emit("focus-prev"))}),ji({_:2},[Vt(Le(M),(Pe,xe)=>({name:Pe,fn:Ot(He=>[Ft(ue.$slots,Pe,Vl(zl(He)))])}))]),1040,["input-value","onSetEmptyDate"]),$("span",{tabindex:"-1",ref_key:"focusRef",ref:f},null,512),i.value?(Z(),bt(bC,{key:0,to:ue.teleport,disabled:ue.inline},[i.value?(Z(),bt(Vle,Ao({key:0,ref_key:"dpMenuRef",ref:u,class:Le(oe),style:Le(D)},{weekNumbers:ue.weekNumbers,weekStart:ue.weekStart,disableMonthYearSelect:ue.disableMonthYearSelect,menuClassName:ue.menuClassName,calendarClassName:ue.calendarClassName,yearRange:ue.yearRange,range:ue.range,multiCalendars:Le(ce),multiCalendarsSolo:ue.multiCalendarsSolo,multiStatic:ue.multiStatic,calendarCellClassName:ue.calendarCellClassName,enableTimePicker:ue.enableTimePicker,is24:ue.is24,hoursIncrement:ue.hoursIncrement,minutesIncrement:ue.minutesIncrement,hoursGridIncrement:ue.hoursGridIncrement,minutesGridIncrement:ue.minutesGridIncrement,minDate:ue.minDate,maxDate:ue.maxDate,autoApply:ue.autoApply,selectText:ue.selectText,cancelText:ue.cancelText,previewFormat:Le(Q),locale:ue.locale,weekNumName:ue.weekNumName,disabledDates:ue.disabledDates,filters:Le(fe),minTime:ue.minTime,maxTime:ue.maxTime,inline:ue.inline,openOnTop:Le(C),monthPicker:ue.monthPicker,timePicker:ue.timePicker,monthNameFormat:ue.monthNameFormat,startDate:ue.startDate,startTime:Le(le),monthYearComponent:ue.monthYearComponent,timePickerComponent:ue.timePickerComponent,actionRowComponent:ue.actionRowComponent,customProps:ue.customProps,hideOffsetDates:ue.hideOffsetDates,autoRange:ue.autoRange,noToday:ue.noToday,noHoursOverlay:ue.noHoursOverlay,noMinutesOverlay:ue.noMinutesOverlay,disabledWeekDays:ue.disabledWeekDays,allowedDates:ue.allowedDates,showNowButton:ue.showNowButton,nowButtonLabel:ue.nowButtonLabel,monthChangeOnScroll:ue.monthChangeOnScroll,markers:ue.markers,uid:ue.uid,modeHeight:ue.modeHeight,enableSeconds:ue.enableSeconds,secondsIncrement:ue.secondsIncrement,secondsGridIncrement:ue.secondsGridIncrement,noSecondsOverlay:ue.noSecondsOverlay,escClose:ue.escClose,spaceConfirm:ue.spaceConfirm,monthChangeOnArrows:ue.monthChangeOnArrows,textInput:ue.textInput,disabled:ue.disabled,readonly:ue.readonly,multiDates:ue.multiDates,presetRanges:ue.presetRanges,flow:ue.flow,preventMinMaxNavigation:ue.preventMinMaxNavigation,minRange:ue.minRange,maxRange:ue.maxRange,fixedStart:ue.fixedStart,fixedEnd:ue.fixedEnd,multiDatesLimit:ue.multiDatesLimit,reverseYears:ue.reverseYears,keepActionRow:ue.keepActionRow,weekPicker:ue.weekPicker,noSwipe:ue.noSwipe,vertical:ue.vertical,arrowNavigation:ue.arrowNavigation,yearPicker:ue.yearPicker},{internalModelValue:Le(A),"onUpdate:internalModelValue":Se[2]||(Se[2]=Pe=>gr(A)?A.value=Pe:null),onClosePicker:pe,onSelectDate:Me,onDpOpen:Le(S),onAutoApply:me,onTimeUpdate:te,onFlowStep:Se[3]||(Se[3]=Pe=>ue.$emit("flow-step",Pe)),onUpdateMonthYear:Se[4]||(Se[4]=Pe=>ue.$emit("updateMonthYear",Pe))}),ji({_:2},[Vt(Le(_),(Pe,xe)=>({name:Pe,fn:Ot(He=>[Ft(ue.$slots,Pe,Vl(zl(Dn({},He))))])}))]),1040,["class","style","internalModelValue","onDpOpen"])):Ce("",!0)],8,["to","disabled"])):Ce("",!0)],2))}});var OT=(()=>{const e=Xle;return e.install=t=>{t.component("Vue3DatePicker",e)},e})(),Zle=Object.freeze(Object.defineProperty({__proto__:null,default:OT},Symbol.toStringTag,{value:"Module"}));Object.entries(Zle).forEach(([e,t])=>{e!=="default"&&(OT[e]=t)});const cv=ot({props:{userInfo:{type:Object,default:()=>({})},isH5:{type:Boolean,default:()=>!1}},components:{Datepicker:OT},setup(e,t){const n=cv==null?void 0:cv.TUIServer,r=jt({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),R=w.slice(4,6),A=w.slice(-2);return`${S}-${R}-${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{...Kt(r),showChooseGender:u,chooseAvatar:d,showBirthday:f,birthday:i,submit:g,cancel:v,setProfile:_,choose:M,closeMask:C,format:o}}});const Qle={class:"edit-header"},eue={class:"edit-header-title"},tue={class:"edit-list"},nue={class:"edit-list-item space-top"},rue={key:0},oue=["src"],iue={key:1,class:"avatar-list"},sue=["onClick"],aue=["src"],lue={key:0,class:"icon icon-right"},uue={class:"edit-list-item space-top"},cue={key:0},due={key:0,class:"icon icon-right"},fue={class:"edit-list-item"},pue={class:"edit-list-item-content"},hue={class:"edit-list-item space-top"},gue={key:0},mue={key:0,class:"icon icon-right"},vue={class:"edit-list-item"},yue={key:0},_ue={key:1,class:"gender-list"},bue=["onClick"],Mue={class:"name"},Iue={key:0,class:"icon icon-right"},Cue={class:"edit-list-item"},Tue={key:0},wue={key:0,class:"icon icon-right"},Sue={key:0,class:"edit-footer"},kue={class:"mask-main"},Due={class:"edit-h5-header"},Eue={class:"edit-h5-main"},Aue={key:0,class:"list"},Lue=["onClick"],Oue=["src"],Rue={key:1,class:"input"},Nue=["placeholder"],Pue=["type","placeholder"],xue={key:2},Uue={class:"edit-h5-footer"},Fue=["disabled"];function Gue(e,t,n,r,o,i){const s=Bt("Datepicker");return Z(),se("div",{class:it(["edit",[e.isH5?"edit-h5":""]])},[$("header",Qle,[e.isH5?(Z(),se("i",{key:0,class:"icon icon-back",onClick:t[0]||(t[0]=(...u)=>e.cancel&&e.cancel(...u))})):Ce("",!0),$("h1",eue,De(e.$t("TUIProfile.资料设置")),1)]),$("ul",tue,[$("li",nue,[$("main",{class:"edit-list-item-content",onClick:t[1]||(t[1]=u=>e.setProfile("avatar"))},[$("label",null,De(e.$t("TUIProfile.头像")),1),e.isH5?(Z(),se("span",rue,[$("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,oue)])):(Z(),se("ul",iue,[(Z(!0),se(dt,null,Vt(e.avatarList,(u,d)=>(Z(),se("li",{class:"avatar-list-item",key:d,onClick:f=>e.chooseAvatar(u)},[$("img",{class:it([e.profile.avatar===u.avatar&&"selected"]),src:u.avatar},null,10,aue)],8,sue))),128))]))]),e.isH5?(Z(),se("i",lue)):Ce("",!0)]),$("li",uue,[$("main",{class:"edit-list-item-content",onClick:t[3]||(t[3]=u=>e.setProfile("nick"))},[$("label",null,De(e.$t("TUIProfile.昵称")),1),e.isH5?(Z(),se("span",cue,De(e.profile.nick),1)):$n((Z(),se("input",{key:1,type:"text","onUpdate:modelValue":t[2]||(t[2]=u=>e.profile.nick=u)},null,512)),[[ll,e.profile.nick]])]),e.isH5?(Z(),se("i",due)):Ce("",!0)]),$("li",fue,[$("main",pue,[$("label",null,De(e.$t("TUIProfile.账号")),1),$("span",null,De(e.profile.userID),1)])]),$("li",hue,[$("main",{class:"edit-list-item-content",onClick:t[5]||(t[5]=u=>e.setProfile("selfSignature"))},[$("label",null,De(e.$t("TUIProfile.个性签名")),1),e.isH5?(Z(),se("span",gue,De(e.profile.selfSignature),1)):$n((Z(),se("input",{key:1,type:"text","onUpdate:modelValue":t[4]||(t[4]=u=>e.profile.selfSignature=u)},null,512)),[[ll,e.profile.selfSignature]])]),e.isH5?(Z(),se("i",mue)):Ce("",!0)]),$("li",vue,[$("main",{class:"edit-list-item-content",onClick:t[6]||(t[6]=u=>e.setProfile("gender"))},[$("label",null,De(e.$t("TUIProfile.性别")),1),e.isH5?(Z(),se("span",yue,De(e.profile.gender?e.$t(`TUIProfile.${e.genderLabel[e.profile.gender]}`):""),1)):(Z(),se("ul",_ue,[(Z(!0),se(dt,null,Vt(e.type,(u,d)=>(Z(),se("li",{class:"gender-list-item",key:d,onClick:f=>e.showChooseGender(u)},[$("i",{class:it(["gender",[e.profile.gender===u.type&&"gender-selected"]])},null,2),$("p",Mue,De(e.$t(`TUIProfile.${u.label}`)),1)],8,bue))),128))]))]),e.isH5?(Z(),se("i",Iue)):Ce("",!0)]),$("li",Cue,[$("main",{class:"edit-list-item-content",onClick:t[7]||(t[7]=u=>e.setProfile("birthday"))},[$("label",null,De(e.$t("TUIProfile.出生年月")),1),e.isH5?(Z(),se("span",Tue,De(e.profile.birthday),1)):(Z(),bt(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?(Z(),se("i",wue)):Ce("",!0)])]),e.isH5?Ce("",!0):(Z(),se("footer",Sue,[$("button",{class:"btn-default",onClick:t[8]||(t[8]=(...u)=>e.cancel&&e.cancel(...u))},De(e.$t("TUIProfile.取消")),1),$("button",{class:"btn-submit",onClick:t[9]||(t[9]=(...u)=>e.submit&&e.submit(...u))},De(e.$t("TUIProfile.保存")),1)])),e.setName&&e.isH5?(Z(),se("div",{key:1,class:"mask",onClick:t[14]||(t[14]=bn((...u)=>e.closeMask&&e.closeMask(...u),["self"]))},[$("div",kue,[$("header",Due,[$("h1",null,De(e.$t(`TUIProfile.${e.editConfig.title}`)),1),$("span",{class:"close",onClick:t[10]||(t[10]=(...u)=>e.closeMask&&e.closeMask(...u))},De(e.$t("关闭")),1)]),$("main",Eue,[e.editConfig.type==="select"?(Z(),se("ul",Aue,[(Z(!0),se(dt,null,Vt(e.editConfig.list,(u,d)=>(Z(),se("li",{class:"list-item",key:d,onClick:f=>e.choose(u)},[u!=null&&u.avatar?(Z(),se("img",{key:0,class:it([e.editConfig.value===u.avatar&&"selected"]),src:u.avatar},null,10,Oue)):(Z(),se("span",{key:1,class:it([e.editConfig.value===u.type&&"selected"])},De(e.$t(`TUIProfile.${u.label}`)),3))],8,Lue))),128))])):(Z(),se("div",Rue,[e.editConfig.type==="textarea"?$n((Z(),se("textarea",{key:0,placeholder:e.editConfig.placeholder,"onUpdate:modelValue":t[11]||(t[11]=u=>e.editConfig.value=u)},null,8,Nue)),[[ll,e.editConfig.value]]):e.editConfig.type==="date"?(Z(),bt(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((Z(),se("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,Pue)),[[U7,e.editConfig.value]])])),e.editConfig.subText?(Z(),se("sub",xue,De(e.$t(`TUIProfile.${e.editConfig.subText}`)),1)):Ce("",!0)]),$("footer",Uue,[$("button",{class:"btn btn-submit",disabled:!e.editConfig.value,onClick:t[13]||(t[13]=(...u)=>e.submit&&e.submit(...u))},De(e.$t("确定")),9,Fue)])])])):Ce("",!0)],2)}const CD=Wt(cv,[["render",Gue],["__scopeId","data-v-600eeaf7"]]),dv=ot({name:"TUIProfile",components:{TUIProfileEdit:CD},setup(e,t){var f;const n=dv==null?void 0:dv.TUIServer,r=jt({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});CD.TUIServer=n,n.bind(r);const o=((f=window==null?void 0:window.TUIKitTUICore)==null?void 0:f.isOfficial)&&Ei&&Ei()||{},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{...Kt(r),submit:i,cancel:s,changeStatus:u,toggleEdit:d}}});const $ue={class:"profile-header"},Bue={class:"profile-avatar"},Hue=["src"],que={class:"profile-main"},Vue={class:"profile-main-item"},zue={class:"profile-main-name"},jue={key:0,class:"gender"},Wue={class:"profile-main-item"},Kue={class:"profile-main-label"},Yue={key:0,class:"profile-main-item"},Jue={class:"profile-main-label"},Xue={key:0,class:"profile-main"},Zue={class:"profile-main-item"},Que={class:"profile-main-label"},ece={class:"profile-main-item"},tce={class:"profile-main-label"},nce={key:1,class:"icon icon-right"};function rce(e,t,n,r,o,i){const s=Bt("TUIProfileEdit");return Z(),se("div",{class:it(["TUI-profile",[e.env.isH5?"TUI-profile-h5":""]])},[e.isEdit?(Z(),bt(s,{key:1,userInfo:e.profile,isH5:e.env.isH5,onSubmit:e.submit,onCancel:e.cancel},null,8,["userInfo","isH5","onSubmit","onCancel"])):(Z(),se("div",{key:0,class:"profile",onClick:t[0]||(t[0]=(...u)=>e.toggleEdit&&e.toggleEdit(...u))},[$("header",$ue,[$("aside",Bue,[$("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,Hue)]),$("ul",que,[$("li",Vue,[$("h1",zue,De(e.profile.nick||"-"),1),e.env.isH5?Ce("",!0):(Z(),se("p",jue,De(e.profile.gender?e.$t(`TUIProfile.${e.genderLabel[e.profile.gender]}`):""),1))]),$("li",Wue,[$("label",Kue,De(e.$t("TUIProfile.用户ID"))+":",1),$("span",null,De(e.profile.userID),1)]),e.env.isH5?(Z(),se("li",Yue,[$("label",Jue,De(e.$t("TUIProfile.个性签名"))+":",1),$("span",null,De(e.profile.selfSignature||e.$t("TUIProfile.暂未设置")),1)])):Ce("",!0)])]),e.env.isH5?Ce("",!0):(Z(),se("ul",Xue,[$("li",Zue,[$("label",Que,De(e.$t("TUIProfile.个性签名")),1),$("span",null,De(e.profile.selfSignature||e.$t("TUIProfile.暂未设置")),1)]),$("li",ece,[$("label",tce,De(e.$t("TUIProfile.出生年月")),1),$("span",null,De(e.profile.birthday?e.profile.birthday:e.$t("TUIProfile.暂未设置")),1)])])),e.env.isH5?(Z(),se("i",nce)):Ce("",!0)]))],2)}const gI=Wt(dv,[["render",rce],["__scopeId","data-v-5741fe51"]]),oce=e=>{gI.TUIServer=Zl.server,e.component(Zl.name,gI)},ice=e=>(Zl.server=new SN(e),e.component(Zl.name,Zl),Zl),Zl={name:"TUIProfile",component:gI,server:SN,install:oce,plugin:ice},sce={};class dP extends ad{constructor(n){super();Jt(this,"TUICore");Jt(this,"store");Jt(this,"currentStore",{});Jt(this,"storeCallback");this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIGroup",sce,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 fP=ot({name:"TUIGroup",components:{DialogTUI:Ky},props:{displayOnlineStatus:{type:Boolean,default:!1}},setup(e){const t=fP.TUIServer,n=jt({loading:!0,page:1,rows:100,keyword:"",finshed:!1,groupList:[],searchGroup:[],searchID:"",currentGroup:null,netWork:"",userStatusList:new Map,dialogShow:!1,dialogItem:{}}),r=_=>_>0?vg(_*1e3):"",o=async _=>{var M;try{if((M=(await F5({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 hV({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(),lu.on("removeGroup",_=>{d(_)})}),hl(()=>{lu.off("removeGroup",d)});const f=_=>{console.log(_,"val"),n.page=1,n.keyword=_,n.groupList=[],u()},g=zy(_=>{f(_)},500),v=_=>{_.stopPropagation(),_.code==="Enter"&&g(n.keyword)};return{...Kt(n),handleListItem:o,handleManage:i,isNetwork:s,handleAvatar:EC,handleName:Wh,handleAt:LO,handleItemTime:r,noSearch:f,onKeyup:v,debouncedRequest:g}}});const Xf=e=>(mr("data-v-ec29dec3"),e=e(),vr(),e),ace={style:{height:"100%"}},lce={class:"sectionSearch"},uce=Xf(()=>$("span",{class:"icon-search-input"},null,-1)),cce={class:"TUI-group"},dce={class:"TUI-conversation-list"},fce={class:"TUI-contact-left"},pce={class:"TUI-contact-list"},hce=["onClick"],gce={class:"left"},mce=["src"],vce={class:"content-header"},yce={class:"name"},_ce={class:"middle-box"},bce={class:"content-footer"},Mce=Xf(()=>$("span",{class:"time"},null,-1)),Ice={key:0,class:"mute-icon",src:wN},Cce=Xf(()=>$("i",null,null,-1)),Tce={key:0,class:"theEmtpy",style:{height:"90%"}},wce=Xf(()=>$("img",{class:"emptyImg",src:cd},null,-1)),Sce=Xf(()=>$("p",null,"暂无数据",-1)),kce=[wce,Sce],Dce=Xf(()=>$("p",null,"该群已解散,是否删除?",-1));function Ece(e,t,n,r,o,i){const s=Bt("n-input"),u=Bt("DialogTUI");return Z(),se("div",ace,[$("div",lce,[Ct(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:Ot(()=>[uce]),_:1},8,["value","onKeyup"])]),$("div",cce,[$("main",dce,[$("aside",fce,[$("ul",pce,[(Z(!0),se(dt,null,Vt(e.groupList,(d,f)=>{var g;return Z(),se("li",{class:"TUI-contact-list-item",key:f,onClick:v=>e.handleListItem(d)},[$("aside",gce,[$("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,mce)]),$("div",vce,[$("label",null,[$("p",yce,De(d.name),1)]),$("div",_ce,[$("p",null,"共"+De(d.memberNum||0)+"人",1)])]),$("div",bce,[Mce,((g=d.selfInfo)==null?void 0:g.messageRemindType)==="AcceptNotNotify"?(Z(),se("img",Ice)):Ce("",!0),Cce])],8,hce)}),128))])])]),!e.loading&&e.groupList.length<=0?(Z(),se("div",Tce,kce)):Ce("",!0),Ct(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:Ot(()=>[Dce]),_:1},8,["show"])])])}const mI=Wt(fP,[["render",Ece],["__scopeId","data-v-ec29dec3"]]),Ace=e=>{mI.TUIServer=Ql.server,e.component(Ql.name,mI)},Lce=e=>(Ql.server=new dP(e),e.component(Ql.name,Ql),Ql),Ql={name:"TUIGroup",component:mI,server:dP,install:Ace,plugin:Lce},Oce={};class pP extends ad{constructor(n){super();Jt(this,"TUICore");Jt(this,"store");Jt(this,"currentStore",{});Jt(this,"storeCallback");this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIPerson",Oce,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 hP=ot({name:"TUIPerson",setup(e){const t=hP.TUIServer,n=jt({loading:!0,page:1,rows:100,keyword:"",finshed:!1,friendList:[],searchGroup:[],searchID:"",currentGroup:null}),r=async()=>{n.loading=!0;try{const d=await N5({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=zy(d=>{i(d)},500),u=d=>{d.stopPropagation(),d.code==="Enter"&&s(n.keyword)};return{...Kt(n),handleListItem:o,noSearch:i,onKeyup:u,debouncedRequest:s}}});const RT=e=>(mr("data-v-edb730d3"),e=e(),vr(),e),Rce={style:{height:"100%"}},Nce={class:"sectionSearch"},Pce=RT(()=>$("span",{class:"icon-search-input"},null,-1)),xce={class:"TUI-person"},Uce={class:"TUI-conversation-list"},Fce={class:"TUI-contact-left"},Gce={class:"TUI-contact-list"},$ce=["onClick"],Bce={class:"left"},Hce=["src"],qce={class:"content-header"},Vce={class:"name"},zce={class:"middle-box"},jce={key:0,class:"theEmtpy",style:{height:"90%"}},Wce=RT(()=>$("img",{class:"emptyImg",src:cd},null,-1)),Kce=RT(()=>$("p",null,"暂无数据",-1)),Yce=[Wce,Kce];function Jce(e,t,n,r,o,i){const s=Bt("n-input");return Z(),se("div",Rce,[$("div",Nce,[Ct(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:Ot(()=>[Pce]),_:1},8,["value","onKeyup"])]),$("div",xce,[$("main",Uce,[$("aside",Fce,[$("ul",Gce,[(Z(!0),se(dt,null,Vt(e.friendList,(u,d)=>(Z(),se("li",{class:"TUI-contact-list-item",key:d,onClick:f=>e.handleListItem(u)},[$("aside",Bce,[$("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,Hce)]),$("div",qce,[$("label",null,[$("p",Vce,De(u.friendNickname),1)]),$("div",zce,[$("p",null,De(u.subjectName),1)])])],8,$ce))),128))])])]),!e.loading&&e.friendList.length<=0?(Z(),se("div",jce,Yce)):Ce("",!0)])])}const vI=Wt(hP,[["render",Jce],["__scopeId","data-v-edb730d3"]]),Xce=e=>{vI.TUIServer=eu.server,e.component(eu.name,vI)},Zce=e=>(eu.server=new pP(e),e.component(eu.name,eu),eu),eu={name:"TUIPerson",component:vI,server:pP,install:Xce,plugin:Zce},Qce={};class gP extends ad{constructor(n){super();Jt(this,"TUICore");Jt(this,"store");Jt(this,"currentStore",{});Jt(this,"storeCallback");this.TUICore=n,this.bindTIMEvent(),this.store=n.setComponentStore("TUIContact",Qce,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 mP=ot({name:"TUIContact",components:{},props:{displayOnlineStatus:{type:Boolean,default:!1}},setup(e,t){const n=mP.TUIServer,{t:r}=n.TUICore.config.i18n.useI18n(),o=jt({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(R,A)=>{R!==A&&(o.displayOnlineStatus=R,n.handleUserStatus(o.displayOnlineStatus,o.userIDList))},{immediate:!0}),$t(()=>o.userIDList,(R,A)=>{JV(R,A)||n.handleUserStatus(o.displayOnlineStatus,o.userIDList)});const i=Ve(()=>{const R=o.currentGroup.selfInfo.userID,A=o.currentGroup.joinOption===n.TUICore.TIM.TYPES.JOIN_OPTIONS_NEED_PERMISSION;return!R&&A}),s=async R=>{switch(o.columnName){case"group":o.currentGroup=R;break;case"friend":o.currentFriend=R;break}o.isSearch&&(o.currentGroup=R)},u=async R=>{if(o.currentGroup=null,o.searchID.trim())try{await n.searchGroupByID(o.searchID.trim())}catch{const N=r("TUIContact.该群组不存在");xr(N,o.env)}},d=async R=>{const A={groupID:R.groupID,applyMessage:R.applyMessage||r("TUIContact.加群"),type:R==null?void 0:R.type};await n.joinGroup(A),o.currentGroup.apply=!0},f=async R=>{await n.quitGroup(R.groupID),o.currentGroup=null},g=async(R,A)=>{const N=`${A}${R}`;n.TUICore.TUIServer.TUIConversation.getConversationProfile(N).then(H=>{n.TUICore.TUIServer.TUIConversation.handleCurrentConversation(H.data.conversation),w()})},v=R=>{n.dismissGroup(R.groupID),o.currentGroup=null},_=async R=>{var A;o.columnName!=="system"&&R==="system"&&((A=o.systemConversation)!=null&&A.conversationID)&&(await n.getSystemMessageList(),await n.setMessageRead()),o.currentGroup={},o.columnName!=="group"&&R==="group"&&!o.env.isH5?o.currentGroup=o.groupList[0]:o.currentGroup={},o.searchID="",o.columnName=o.columnName===R?"":R},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=R=>{n.handleGroupApplication(R)},w=()=>{o.currentGroup={},o.currentFriend={},o.columnName=""},S=R=>{n.TUICore.getUserStatusList(R)};return{...Kt(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 vP=e=>(mr("data-v-4457e2c6"),e=e(),vr(),e),ede={class:"TUI-contact-left"},tde={key:0,class:"TUI-contact-column"},nde={class:"TUI-contact-column-item"},rde={key:0,class:"num"},ode={key:0,class:"TUI-contact-list"},ide={class:"TUI-contact-list-item selected not-aside"},sde={key:0,class:"num"},ade={class:"TUI-contact-column-item"},lde={class:"TUI-contact-list"},ude=["onClick"],cde={class:"left"},dde=["src"],fde={class:"content"},pde={class:"name"},hde={class:"ID"},gde=vP(()=>$("label",null,"ID:",-1)),mde={class:"type"},vde={class:"TUI-contact-column-item"},yde={class:"TUI-contact-list"},_de=["onClick"],bde={class:"left"},Mde=["src"],Ide={class:"content"},Cde={class:"name"},Tde={key:1,class:"TUI-contact-list"},wde={class:"left"},Sde=["src"],kde={class:"content"},Dde={class:"name"},Ede={class:"ID"},Ade=vP(()=>$("label",null,"ID:",-1)),Lde={class:"type"};function Ode(e,t,n,r,o,i){return Z(),bt(bo,{onBeforeLeave:e.init},{default:Ot(()=>{var s,u,d,f,g,v,_;return[$("div",{class:it(["TUI-contact",[e.env.isH5?"TUI-contact-H5":""]])},[$("aside",ede,[e.isSearch?(Z(),se("ul",Tde,[(s=e.searchGroup)!=null&&s.groupID?(Z(),se("li",{key:0,class:it(["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))},[$("aside",wde,[$("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,Sde)]),$("main",kde,[$("ul",null,[$("li",Dde,De((g=e.searchGroup)==null?void 0:g.name),1),$("li",Ede,[Ade,$("span",null,De((v=e.searchGroup)==null?void 0:v.groupID),1)])]),$("span",Lde,De((_=e.searchGroup)==null?void 0:_.type),1)])],2)):Ce("",!0)])):(Z(),se("ul",tde,[$("li",nde,[$("header",{onClick:t[0]||(t[0]=M=>e.select("system"))},[$("i",{class:it(["icon icon-right",[e.columnName==="system"&&"icon-down"]])},null,2),$("main",null,[$("label",null,De(e.$t("TUIContact.群聊通知")),1),e.systemConversation&&e.systemConversation.unreadCount>0?(Z(),se("span",rde,De(e.systemConversation.unreadCount),1)):Ce("",!0)])]),e.columnName==="system"?(Z(),se("ul",ode,[$("li",ide,[$("label",null,De(e.$t("TUIContact.系统通知")),1),e.systemConversation&&e.systemConversation.unreadCount>0?(Z(),se("span",sde,De(e.systemConversation.unreadCount),1)):Ce("",!0)])])):Ce("",!0)]),$("li",ade,[$("header",{onClick:t[1]||(t[1]=M=>e.select("group"))},[$("i",{class:it(["icon icon-right",[e.columnName==="group"&&"icon-down"]])},null,2),$("main",null,[$("label",null,De(e.$t("TUIContact.我的群聊")),1)])]),$n($("ul",lde,[(Z(!0),se(dt,null,Vt(e.groupList,(M,C)=>{var D;return Z(),se("li",{class:it(["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)},[$("aside",cde,[$("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,dde)]),$("main",fde,[$("ul",null,[$("li",pde,De(M==null?void 0:M.name),1),$("li",hde,[gde,$("span",null,De(M==null?void 0:M.groupID),1)])]),$("span",mde,De(M==null?void 0:M.type),1)])],10,ude)}),128))],512),[[eo,e.columnName==="group"]])]),$("li",vde,[$("header",{onClick:t[2]||(t[2]=M=>e.select("friend"))},[$("i",{class:it(["icon icon-right",[e.columnName==="friend"&&"icon-down"]])},null,2),$("main",null,[$("label",null,De(e.$t("TUIContact.我的好友")),1)])]),$n($("ul",yde,[(Z(!0),se(dt,null,Vt(e.friendList,(M,C)=>{var D,w,S,R;return Z(),se("li",{class:it(["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)},[$("aside",bde,[$("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,Mde),e.displayOnlineStatus?(Z(),se("div",{key:0,class:it(["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)]),$("main",Ide,[$("ul",null,[$("li",Cde,De(((R=M==null?void 0:M.profile)==null?void 0:R.nick)||(M==null?void 0:M.userID)),1)])])],10,_de)}),128))],512),[[eo,e.columnName==="friend"]])])]))])],2)]}),_:1},8,["onBeforeLeave"])}const yI=Wt(mP,[["render",Ode],["__scopeId","data-v-4457e2c6"]]),Rde=e=>{yI.TUIServer=tu.server,e.component(tu.name,yI)},Nde=e=>(tu.server=new gP(e),e.component(tu.name,tu),tu),tu={name:"TUIContact",component:yI,server:gP,install:Rde,plugin:Nde};class yP extends ad{constructor(n){super();Jt(this,"TUICore");Jt(this,"store");Jt(this,"currentStore",{});Jt(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 eh=ot({name:"group",props:{isH5:{type:Boolean,default:()=>!1}},setup(e,t){const n=jt({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:eh.TUIServer.TUICore.TIM.TYPES.GRP_PUBLIC,detail:"类似 QQ 群,创建后群主可以指定群管理员,用户搜索群 ID 发起加群申请后,需要群主或管理员审批通过才能入群。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/Meeting.svg",label:"临时会议群(Meeting)",type:eh.TUIServer.TUICore.TIM.TYPES.GRP_MEETING,detail:"创建后可以随意进出,且支持查看入群前消息;适合用于音视频会议场景、在线教育场景等与实时音视频产品结合的场景。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/Work.svg",label:"好友工作群(Work)",type:eh.TUIServer.TUICore.TIM.TYPES.GRP_WORK,detail:"类似普通微信群,创建后仅支持已在群内的好友邀请加群,且无需被邀请方同意或群主神奇。详见",src:"产品文档"},{icon:"https://web.sdk.qcloud.com/im/assets/images/AVChatroom.svg",label:"直播群(AVChatroom)",type:eh.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{...Kt(n),selected:o,submit:i,cancel:s,Link:q5,edit:u,selectedEdit:d,groupTypeDetail:r}}});const NT=e=>(mr("data-v-8d663893"),e=e(),vr(),e),Pde={class:"group-box"},xde={key:0},Ude={key:1},Fde={key:0,class:"group-list"},Gde={class:"group-list-item"},$de=["src"],Bde={class:"group-list-item"},Hde={class:"content"},qde=NT(()=>$("i",{class:"icon icon-right"},null,-1)),Vde={class:"group-list-item"},zde={class:"content"},jde=NT(()=>$("i",{class:"icon icon-right"},null,-1)),Wde={class:"group-list-introduction"},Kde={class:"group-list-item"},Yde={key:0,class:"select"},Jde=["onClick"],Xde={class:"select-item-header"},Zde={class:"left"},Qde=["src"],efe={class:"select-item-label"},tfe={key:0,class:"icon icon-selected"},nfe={class:"select-item-detail"},rfe=["href"],ofe={class:"content"},ife=NT(()=>$("i",{class:"icon icon-right"},null,-1)),sfe={key:0,class:"group-h5-list-item-introduction"},afe={class:"introduction-name"},lfe={class:"introduction-detail"},ufe=["href"],cfe={key:1,class:"group-list group-list-edit"},dfe=["placeholder"],ffe={key:1,class:"select"},pfe=["onClick"],hfe={class:"select-item-header"},gfe={class:"left"},mfe=["src"],vfe={class:"select-item-label"},yfe={key:0,class:"icon icon-selected"},_fe={class:"select-item-detail"},bfe=["href"],Mfe={class:"group-profile-footer"},Ife=["disabled"];function Cfe(e,t,n,r,o,i){return Z(),se("div",{class:it(["group",[e.isH5?"group-h5":""]])},[$("div",Pde,[$("header",null,[e.isEdit?(Z(),se("h1",Ude,De(e.$t(`TUISearch.${e.editConfig.title}`)),1)):(Z(),se("h1",xde,De(e.$t("TUISearch.发起群聊")),1)),$("i",{class:it(["icon",[e.isH5?"icon-back":"icon-close"]]),onClick:t[0]||(t[0]=(...s)=>e.cancel&&e.cancel(...s))},null,2)]),e.isEdit?(Z(),se("div",cfe,[e.editConfig.type==="input"?$n((Z(),se("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,dfe)),[[ll,e.editConfig.value]]):(Z(),se("ul",ffe,[(Z(!0),se(dt,null,Vt(e.type,(s,u)=>(Z(),se("li",{class:it(["select-item",[e.editConfig.value===s.type&&"selected"]]),key:u,onClick:d=>e.selectedEdit(s)},[$("main",null,[$("div",hfe,[$("aside",gfe,[$("img",{class:"icon",src:s.icon},null,8,mfe),$("span",vfe,De(s.label),1)]),e.editConfig.value===s.type?(Z(),se("i",yfe)):Ce("",!0)]),$("span",_fe,De(e.$t(`TUISearch.${s.detail}`)),1),$("a",{href:e.Link.product.url,target:"view_window"},De(e.$t(`TUISearch.${s.src}`)),9,bfe)])],10,pfe))),128))]))])):(Z(),se("ul",Fde,[$("li",Gde,[$("label",null,De(e.$t("TUISearch.群头像")),1),$("img",{class:"icon",src:e.profile.avatar},null,8,$de)]),$("ul",null,[$("li",Bde,[$("label",null,De(e.$t("TUISearch.群名称")),1),e.isH5?(Z(),se("span",{key:1,class:"group-h5-list-item-content",onClick:t[2]||(t[2]=s=>e.edit("name"))},[$("p",Hde,De(e.profile.name),1),qde])):$n((Z(),se("input",{key:0,type:"text","onUpdate:modelValue":t[1]||(t[1]=s=>e.profile.name=s),placeholder:"请输入群名称"},null,512)),[[ll,e.profile.name]])]),$("li",Vde,[$("label",null,[Fr(De(e.$t("TUISearch.群ID")),1),$("text",null,"("+De(e.$t("TUISearch.选填"))+")",1)]),e.isH5?(Z(),se("span",{key:1,class:"group-h5-list-item-content",onClick:t[4]||(t[4]=s=>e.edit("groupID"))},[$("p",zde,De(e.profile.groupID),1),jde])):$n((Z(),se("input",{key:0,type:"text","onUpdate:modelValue":t[3]||(t[3]=s=>e.profile.groupID=s)},null,512)),[[ll,e.profile.groupID]])]),$("li",Wde,[$("div",Kde,[$("label",null,De(e.$t("TUISearch.群类型")),1),e.isH5?(Z(),se("span",{key:1,class:"group-h5-list-item-content",onClick:t[5]||(t[5]=s=>e.edit("type"))},[$("p",ofe,De(e.groupTypeDetail.label),1),ife])):(Z(),se("ul",Yde,[(Z(!0),se(dt,null,Vt(e.type,(s,u)=>(Z(),se("li",{class:it(["select-item",[e.profile.type===s.type&&"selected"]]),key:u,onClick:d=>e.selected(s)},[$("main",null,[$("div",Xde,[$("aside",Zde,[$("img",{class:"icon",src:s.icon},null,8,Qde),$("span",efe,De(s.label),1)]),e.profile.type===s.type?(Z(),se("i",tfe)):Ce("",!0)]),$("span",nfe,De(e.$t(`TUISearch.${s.detail}`)),1),$("a",{href:e.Link.product.url,target:"view_window"},De(e.$t(`TUISearch.${s.src}`)),9,rfe)])],10,Jde))),128))]))]),e.isH5?(Z(),se("article",sfe,[$("label",afe,De(e.groupTypeDetail.label)+":",1),$("span",lfe,De(e.$t(`TUISearch.${e.groupTypeDetail.detail}`)),1),$("a",{href:e.Link.product.url,target:"view_window"},De(e.$t(`TUISearch.${e.groupTypeDetail.src}`)),9,ufe)])):Ce("",!0)])])])),$("footer",Mfe,[!e.isEdit&&!e.isH5?(Z(),se("button",{key:0,class:"btn-default",onClick:t[7]||(t[7]=(...s)=>e.cancel&&e.cancel(...s))},De(e.$t("TUISearch.取消")),1)):Ce("",!0),$("button",{class:"btn-submit",onClick:t[8]||(t[8]=s=>e.submit(e.profile)),disabled:e.profile.name===""&&!e.isEdit},De(e.$t("TUISearch.创建")),9,Ife)])])],2)}const Mb=Wt(eh,[["render",Cfe],["__scopeId","data-v-8d663893"]]),fv=ot({name:"TUISearch",components:{Transfer:QC,DialogTUI:Ky,CreateGroup:Mb},setup(e){var D,w,S;const t=fv==null?void 0:fv.TUIServer,{t:n}=t.TUICore.config.i18n.useI18n(),r=jt({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;Mb.TUIServer=t;const i=((S=window==null?void 0:window.TUIKitTUICore)==null?void 0:S.isOfficial)&&Ei&&Ei()||{},s=Ne();Xs(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=R=>{if(r.createConversationType===cn.typeC2C){const{userID:A}=R[0];v(A,"C2C"),d()}else{if(!Mb.TUIServer){const A=n("TUISearch.创建群聊,请注册 TUIGroup 模块");xr(A,r.env)}u(),r.group.memberList=R.map(A=>({userID:A.userID})),r.step=2}r.searchUserList=[...r.allUserList]},g=async R=>{var N;R.type===t.TUICore.TIM.TYPES.GRP_PUBLIC&&(r.group.joinOption=t.TUICore.TIM.TYPES.JOIN_OPTIONS_NEED_PERMISSION);const A={...r.group,...R};R.type===t.TUICore.TIM.TYPES.GRP_AVCHATROOM&&(delete A.memberList,delete A.joinOption);try{const H=await o.createGroup(A),z=n("TUISearch.创建成功");YV(z,r.env),(N=window==null?void 0:window.TUIKitTUICore)!=null&&N.isOfficial&&(i!=null&&i.commit)&&(i==null||i.commit("handleTask",3)),d(),R.type===t.TUICore.TIM.TYPES.GRP_AVCHATROOM&&o.joinGroup({groupID:H.data.group.groupID,applyMessage:"",type:H.data.group.type}),v(H.data.group.groupID,"GROUP")}catch(H){xr(H,r.env)}},v=(R,A)=>{const N=`${A}${R}`;t.getConversationProfile(N).then(H=>{t.TUICore.TUIServer.TUIConversation.handleCurrentConversation(H.data.conversation)})},_=R=>{switch(r.open=!0,r.searchUserList=[...r.allUserList],R){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 R=>{try{const A=await t.getUserProfile([R]);if(!A.data.length){xr(n("TUISearch.该用户不存在"),r.env),r.searchUserList=[...r.allUserList];return}r.searchUserList=A.data;const N=r.allUserList.filter(H=>H.userID===A.data[0].userID);r.allUserList=N.length?r.allUserList:[...r.allUserList,...r.searchUserList]}catch{xr(n("TUISearch.该用户不存在"),r.env),r.searchUserList=[...r.allUserList];return}};return{...Kt(r),toggleOpen:d,handleSearch:C,submit:f,create:g,showOpen:_,toggleOptionalShow:M,dialog:s}}});const _P=e=>(mr("data-v-f11d045f"),e=e(),vr(),e),Tfe=_P(()=>$("i",{class:"plus"},null,-1)),wfe={key:0},Sfe={key:0,class:"icon icon-c2c"},kfe=_P(()=>$("i",{class:"icon icon-group"},null,-1));function Dfe(e,t,n,r,o,i){const s=Bt("Transfer"),u=Bt("CreateGroup"),d=Bt("DialogTUI");return Z(),se("div",{class:it(["TUI-search",[e.env.isH5?"TUI-search-H5":""]]),ref:"dialog"},[$("header",{onClick:t[2]||(t[2]=(...f)=>e.toggleOptionalShow&&e.toggleOptionalShow(...f))},[Tfe,e.env.isH5?(Z(),se("h1",wfe,De(e.$t("TUISearch.发起会话")),1)):Ce("",!0),$n($("ul",null,[$("li",null,[e.env.isH5?(Z(),se("i",Sfe)):Ce("",!0),$("h1",{onClick:t[0]||(t[0]=f=>e.showOpen("isC2C"))},De(e.$t("TUISearch.发起单聊")),1)]),$("li",null,[kfe,$("h1",{onClick:t[1]||(t[1]=f=>e.showOpen("isGroup"))},De(e.$t("TUISearch.发起群聊")),1)])],512),[[eo,e.optionalShow]])]),Ct(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:Ot(()=>[e.step===1?(Z(),bt(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"])):(Z(),bt(u,{key:1,onSubmit:e.create,onCancel:e.toggleOpen,isH5:e.env.isH5},null,8,["onSubmit","onCancel","isH5"]))]),_:1},8,["show","isH5"])],2)}const _I=Wt(fv,[["render",Dfe],["__scopeId","data-v-f11d045f"]]),Efe=e=>{_I.TUIServer=nu.server,e.component(nu.name,_I)},Afe=e=>(nu.server=new yP(e),e.component(nu.name,nu),nu),nu={name:"TUISearch",component:_I,server:yP,install:Efe,plugin:Afe},bP=[il,Jl,Zl,Ql,eu,tu,nu],Lfe=e=>{bP.forEach(t=>{t.install(e)})},Ofe=e=>{bP.forEach(t=>{t.plugin(e)})},Rfe={name:"TUIComponents",version:"1.0.0",TUIChat:il,TUIConversation:Jl,TUIProfile:Zl,TUIGroup:Ql,TUIPerson:eu,TUIContact:tu,TUISearch:nu,install:Lfe,plugin:Ofe};var MP={exports:{}};(function(e,t){var n;n=function(){function r(G,L){var T=Object.keys(G);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(G);L&&(P=P.filter(function(Q){return Object.getOwnPropertyDescriptor(G,Q).enumerable})),T.push.apply(T,P)}return T}function o(G){for(var L=1;L<arguments.length;L++){var T=arguments[L]!=null?arguments[L]:{};L%2?r(Object(T),!0).forEach(function(P){f(G,P,T[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(G,Object.getOwnPropertyDescriptors(T)):r(Object(T)).forEach(function(P){Object.defineProperty(G,P,Object.getOwnPropertyDescriptor(T,P))})}return G}function i(G){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L})(G)}function s(G,L){if(!(G instanceof L))throw new TypeError("Cannot call a class as a function")}function u(G,L){for(var T=0;T<L.length;T++){var P=L[T];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(G,P.key,P)}}function d(G,L,T){return L&&u(G.prototype,L),T&&u(G,T),Object.defineProperty(G,"prototype",{writable:!1}),G}function f(G,L,T){return L in G?Object.defineProperty(G,L,{value:T,enumerable:!0,configurable:!0,writable:!0}):G[L]=T,G}function g(G,L){if(G==null)return{};var T,P,Q=function(oe,X){if(oe==null)return{};var ae,fe,le={},ce=Object.keys(oe);for(fe=0;fe<ce.length;fe++)ae=ce[fe],X.indexOf(ae)>=0||(le[ae]=oe[ae]);return le}(G,L);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(G);for(P=0;P<Y.length;P++)T=Y[P],L.indexOf(T)>=0||Object.prototype.propertyIsEnumerable.call(G,T)&&(Q[T]=G[T])}return Q}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",R=(w&&uni.getDeviceInfo().platform.toLocaleLowerCase(),v||_||M||C||D||w),A=_?qq:M?tt:C?swan:D?my:v?wx:w?uni:{},N=function(G){if(i(G)!=="object"||G===null)return!1;var L=Object.getPrototypeOf(G);if(L===null)return!0;for(var T=L;Object.getPrototypeOf(T)!==null;)T=Object.getPrototypeOf(T);return L===T};function H(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(N(G)){for(var L in G)if(Object.prototype.hasOwnProperty.call(G,L))return!1;return!0}return!1}var z=function(){function G(){s(this,G)}return d(G,[{key:"request",value:function(L,T){var P=this,Q=L.downloadUrl||"",Y=(L.method||"PUT").toUpperCase(),oe=L.url;if(L.qs){var X=function(ce){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"=";return H(ce)?"":N(ce)?Object.keys(ce).map(function(de){var Oe=encodeURIComponent(de)+re;return Array.isArray(ce[de])?ce[de].map(function(ve){return Oe+encodeURIComponent(ve)}).join(J):Oe+encodeURIComponent(ce[de])}).filter(Boolean).join(J):void 0}(L.qs);X&&(oe+="".concat(oe.indexOf("?")===-1?"?":"&").concat(X))}var ae=new XMLHttpRequest;ae.open(Y,oe,!0),ae.responseType=L.dataType||"text";var fe=L.headers||{};if(!H(fe))for(var le in fe)fe.hasOwnProperty(le)&&le.toLowerCase()!=="content-length"&&le.toLowerCase()!=="user-agent"&&le.toLowerCase()!=="origin"&&le.toLowerCase()!=="host"&&ae.setRequestHeader(le,fe[le]);return ae.onload=function(){if(ae.status===200)T(null,P._xhrRes(ae,P._xhrBody(ae,Q)));else{var ce={code:ae.status,message:JSON.stringify(ae.responseText)};T(ce,P._xhrRes(ae,P._xhrBody(ae)))}},ae.onerror=function(ce){var J=P._xhrBody(ae),re={code:ae.status,message:JSON.stringify(ae.responseText)};J||ae.statusText||ae.status!==0||(ce.message="CORS blocked or network error"),T(re,P._xhrRes(ae,J)),re=null},L.onProgress&&ae.upload&&(ae.upload.onprogress=function(ce){var J=ce.total,re=ce.loaded,de=Math.floor(100*re/J);L.onProgress({total:J,loaded:re,percent:(de>=100?100:de)/100})}),ae.send(L.resources),ae}},{key:"_xhrRes",value:function(L,T){var P={};return L.getAllResponseHeaders().trim().split(`
- `).forEach(function(Q){if(Q){var Y=Q.indexOf(":"),oe=Q.substr(0,Y).trim().toLowerCase(),X=Q.substr(Y+1).trim();P[oe]=X}}),{statusCode:L.status,statusMessage:L.statusText,headers:P,data:T}}},{key:"_xhrBody",value:function(L,T){return L.status===200&&T?{location:T}:{response:L.responseText}}}]),G}(),x=["unknown","image","video","audio","log"],B=["name"],j=function(){function G(){s(this,G)}return d(G,[{key:"request",value:function(L,T){var P=this,Q=L.resources,Y=Q===void 0?"":Q,oe=L.headers,X=oe===void 0?{}:oe,ae=L.url,fe=L.downloadUrl,le=fe===void 0?"":fe,ce=ae,J=null,re=le.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/),de=decodeURIComponent(re[3]),Oe=de.indexOf("?")>-1?de.split("?")[0]:de,ve={key:L.fileKey?L.fileKey:Oe,success_action_status:200,"Content-Type":""},Me={};if(S){var K=ae.split("?sign=");if(K.length>1){var me=K[1];ce="".concat(K[0],"?sign=").concat(encodeURIComponent("".concat(me))),Me.sign=decodeURIComponent(me),Me.signature=decodeURIComponent(me)}}var ke={url:ce,header:X,name:"file",filePath:Y,formData:o(o({},ve),Me),timeout:L.timeout||3e5};if(D){var pe=ke;pe.name,ke=o(o({},g(pe,B)),{},{fileName:"file",fileType:x[L.fileType]})}return(J=A.uploadFile(o(o({},ke),{},{success:function(W){P._handleResponse({response:W,downloadUrl:le,callback:T})},fail:function(W){P._handleResponse({response:W,downloadUrl:le,callback:T})}}))).onProgressUpdate&&J.onProgressUpdate(function(W){L.onProgress&&L.onProgress({total:W.totalBytesExpectedToSend,loaded:W.totalBytesSent,percent:Math.floor(W.progress)/100})}),J}},{key:"_handleResponse",value:function(L){var T=L.downloadUrl,P=L.response,Q=L.callback,Y=P.header,oe={};if(Y)for(var X in Y)Y.hasOwnProperty(X)&&(oe[X.toLowerCase()]=Y[X]);var ae=+P.statusCode;ae===200?Q(null,{statusCode:ae,headers:oe,data:o(o({},P.data),{},{location:T})}):Q({code:ae,message:JSON.stringify(P.data)},{statusCode:ae,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=R?new j:new z}return d(G,[{key:"uploadFile",value:function(L,T){var P=this;return this.httpRequest.request(L,function(Q,Y){Q&&P.tryCount<P.retry&&P.allowRetry(Q)?(P.tryCount++,P.uploadFile(L,T)):(P.tryCount=0,T(Q,Y))})}},{key:"allowRetry",value:function(L){var T=!1,P=!1;if(L){var Q=L.headers&&(L.headers.date||L.headers.Date)||L.error&&L.error.ServerTime;try{var Y=L.error&&L.error.Code,oe=L.error&&L.error.Message;(Y==="RequestTimeTooSkewed"||Y==="AccessDenied"&&oe==="Request has expired")&&(P=!0)}catch{}if(P&&Q){var X=Date.now(),ae=Date.parse(Q);Math.abs(X+this.systemClockOffset-ae)>=3e4&&(this.systemClockOffset=ae-X,T=!0)}else Math.floor(L.statusCode/100)===5&&(T=!0)}return T}}]),G}()},e.exports=n()})(MP);var Nfe=MP.exports;const Pfe=Vf(Nfe);var IP={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(gi,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;S<w.length;S++){var R=w[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(D,R.key,R)}}function o(D,w,S){return w&&r(D.prototype,w),S&&r(D,S),Object.defineProperty(D,"prototype",{writable:!1}),D}function i(D,w){return function(S){if(Array.isArray(S))return S}(D)||function(S,R){var A=S==null?null:typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(A!=null){var N,H,z=[],x=!0,B=!1;try{for(A=A.call(S);!(x=(N=A.next()).done)&&(z.push(N.value),!R||z.length!==R);x=!0);}catch(j){B=!0,H=j}finally{try{x||A.return==null||A.return()}finally{if(B)throw H}}return z}}(D,w)||u(D,w)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function s(D){return function(w){if(Array.isArray(w))return d(w)}(D)||function(w){if(typeof Symbol<"u"&&w[Symbol.iterator]!=null||w["@@iterator"]!=null)return Array.from(w)}(D)||u(D)||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 u(D,w){if(D){if(typeof D=="string")return d(D,w);var S=Object.prototype.toString.call(D).slice(8,-1);return S==="Object"&&D.constructor&&(S=D.constructor.name),S==="Map"||S==="Set"?Array.from(D):S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S)?d(D,w):void 0}}function d(D,w){(w==null||w>D.length)&&(w=D.length);for(var S=0,R=new Array(w);S<w;S++)R[S]=D[S];return R}function f(D,w){var S=typeof Symbol<"u"&&D[Symbol.iterator]||D["@@iterator"];if(!S){if(Array.isArray(D)||(S=u(D))||w&&D&&typeof D.length=="number"){S&&(D=S);var R=0,A=function(){};return{s:A,n:function(){return R>=D.length?{done:!0}:{done:!1,value:D[R++]}},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 N,H=!0,z=!1;return{s:function(){S=S.call(D)},n:function(){var x=S.next();return H=x.done,x},e:function(x){z=!0,N=x},f:function(){try{H||S.return==null||S.return()}finally{if(z)throw N}}}}var g=function(){for(var D=` \r
- ~!@#$%^&*()_+-=【】、{}|;':",。、《》?αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩①②③④⑤⑥⑦⑧⑨⑩⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇≈≡≠=≤≥<>≮≯∷±+-×÷/∫∮∝∞∧∨∑∏∪∩∈∵∴⊥∥∠⌒⊙≌∽√§№☆★○●◎◇◆□℃‰€■△▲※→←↑↓〓¤°#&@\︿_ ̄―♂♀┌┍┎┐┑┒┓─┄┈├┝┞┟┠┡┢┣│┆┊┬┭┮┯┰┱┲┳┼┽┾┿╀╁╂╃└┕┖┗┘┙┚┛━┅┉┤┥┦┧┨┩┪┫┃┇┋┴┵┶┷┸┹┺┻╋╊╉╈╇╆╅╄`,w=new Map,S=0,R=D.length;S<R;S++)w.set(D.charCodeAt(0),!0);return w}(),v=function(){function D(w){n(this,D);var S,R=w.input,A=w.isArray,N=w.isMap;this._trieTree={},A(R)?S=R:N(R)&&(S=s(R.keys()),this._map=R);for(var H=0,z=S.length;H<z;H++)if(S[H]){for(var x=this._trieTree,B=S[H],j=0,G=B.length;j<G;j++)x[B[j]]||(x[B[j]]={}),x=x[B[j]];x.isEnd=!0}}return o(D,[{key:"filter",value:function(w){var S=w.text,R=w.replacingEnabled;if(Object.keys(this._trieTree).length===0)return{isMatched:!1,modifiedText:S};for(var A=this._trieTree,N=S,H=!1,z=S.length,x=0;x<z;x++)if(g.get(S.charCodeAt(x))!==!0){for(var B=0,j="",G=!1,L=x;L<z;L++){if(!A[S[L]]){A=this._trieTree;break}if(j+=S[L],A[S[L]].isEnd){G=!0,B=L-x,A=this._trieTree;break}A=A[S[L]]}if(B>1&&(x+=B),G){if(H=!0,!R)break;var T=this._map.get(j)||"*";N=N.replace(new RegExp(j,"g"),T)}}return{isMatched:H,modifiedText:N}}},{key:"reset",value:function(){this._trieTree={},this._map=null}}]),D}(),_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof gi<"u"?gi:typeof self<"u"?self:{},M={},C=function(D,w){return D(w={exports:{}},w.exports),w.exports}(function(D,w){var S,R,A,N,H,z;D.exports=(z=z||function(x,B){var j;if(typeof window<"u"&&window.crypto&&(j=window.crypto),!j&&typeof window<"u"&&window.msCrypto&&(j=window.msCrypto),!j&&_!==void 0&&_.crypto&&(j=_.crypto),!j)try{j=M}catch{}var G=function(){if(j){if(typeof j.getRandomValues=="function")try{return j.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof j.randomBytes=="function")try{return j.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},L=Object.create||function(){function J(){}return function(re){var de;return J.prototype=re,de=new J,J.prototype=null,de}}(),T={},P=T.lib={},Q=P.Base={extend:function(J){var re=L(this);return J&&re.mixIn(J),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 J=this.extend();return J.init.apply(J,arguments),J},init:function(){},mixIn:function(J){for(var re in J)J.hasOwnProperty(re)&&(this[re]=J[re]);J.hasOwnProperty("toString")&&(this.toString=J.toString)},clone:function(){return this.init.prototype.extend(this)}},Y=P.WordArray=Q.extend({init:function(J,re){J=this.words=J||[],this.sigBytes=re??4*J.length},toString:function(J){return(J||X).stringify(this)},concat:function(J){var re=this.words,de=J.words,Oe=this.sigBytes,ve=J.sigBytes;if(this.clamp(),Oe%4)for(var Me=0;Me<ve;Me++){var K=de[Me>>>2]>>>24-Me%4*8&255;re[Oe+Me>>>2]|=K<<24-(Oe+Me)%4*8}else for(Me=0;Me<ve;Me+=4)re[Oe+Me>>>2]=de[Me>>>2];return this.sigBytes+=ve,this},clamp:function(){var J=this.words,re=this.sigBytes;J[re>>>2]&=4294967295<<32-re%4*8,J.length=x.ceil(re/4)},clone:function(){var J=Q.clone.call(this);return J.words=this.words.slice(0),J},random:function(J){for(var re=[],de=0;de<J;de+=4)re.push(G());return new Y.init(re,J)}}),oe=T.enc={},X=oe.Hex={stringify:function(J){for(var re=J.words,de=J.sigBytes,Oe=[],ve=0;ve<de;ve++){var Me=re[ve>>>2]>>>24-ve%4*8&255;Oe.push((Me>>>4).toString(16)),Oe.push((15&Me).toString(16))}return Oe.join("")},parse:function(J){for(var re=J.length,de=[],Oe=0;Oe<re;Oe+=2)de[Oe>>>3]|=parseInt(J.substr(Oe,2),16)<<24-Oe%8*4;return new Y.init(de,re/2)}},ae=oe.Latin1={stringify:function(J){for(var re=J.words,de=J.sigBytes,Oe=[],ve=0;ve<de;ve++){var Me=re[ve>>>2]>>>24-ve%4*8&255;Oe.push(String.fromCharCode(Me))}return Oe.join("")},parse:function(J){for(var re=J.length,de=[],Oe=0;Oe<re;Oe++)de[Oe>>>2]|=(255&J.charCodeAt(Oe))<<24-Oe%4*8;return new Y.init(de,re)}},fe=oe.Utf8={stringify:function(J){try{return decodeURIComponent(escape(ae.stringify(J)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(J){return ae.parse(unescape(encodeURIComponent(J)))}},le=P.BufferedBlockAlgorithm=Q.extend({reset:function(){this._data=new Y.init,this._nDataBytes=0},_append:function(J){typeof J=="string"&&(J=fe.parse(J)),this._data.concat(J),this._nDataBytes+=J.sigBytes},_process:function(J){var re,de=this._data,Oe=de.words,ve=de.sigBytes,Me=this.blockSize,K=ve/(4*Me),me=(K=J?x.ceil(K):x.max((0|K)-this._minBufferSize,0))*Me,ke=x.min(4*me,ve);if(me){for(var pe=0;pe<me;pe+=Me)this._doProcessBlock(Oe,pe);re=Oe.splice(0,me),de.sigBytes-=ke}return new Y.init(re,ke)},clone:function(){var J=Q.clone.call(this);return J._data=this._data.clone(),J},_minBufferSize:0}),ce=(P.Hasher=le.extend({cfg:Q.extend(),init:function(J){this.cfg=this.cfg.extend(J),this.reset()},reset:function(){le.reset.call(this),this._doReset()},update:function(J){return this._append(J),this._process(),this},finalize:function(J){return J&&this._append(J),this._doFinalize()},blockSize:16,_createHelper:function(J){return function(re,de){return new J.init(de).finalize(re)}},_createHmacHelper:function(J){return function(re,de){return new ce.HMAC.init(J,de).finalize(re)}}}),T.algo={});return T}(Math),H=(N=z).lib.WordArray,N.enc.Base64={stringify:function(x){var B=x.words,j=x.sigBytes,G=this._map;x.clamp();for(var L=[],T=0;T<j;T+=3)for(var P=(B[T>>>2]>>>24-T%4*8&255)<<16|(B[T+1>>>2]>>>24-(T+1)%4*8&255)<<8|B[T+2>>>2]>>>24-(T+2)%4*8&255,Q=0;Q<4&&T+.75*Q<j;Q++)L.push(G.charAt(P>>>6*(3-Q)&63));var Y=G.charAt(64);if(Y)for(;L.length%4;)L.push(Y);return L.join("")},parse:function(x){var B=x.length,j=this._map,G=this._reverseMap;if(!G){G=this._reverseMap=[];for(var L=0;L<j.length;L++)G[j.charCodeAt(L)]=L}var T=j.charAt(64);if(T){var P=x.indexOf(T);P!==-1&&(B=P)}return function(Q,Y,oe){for(var X=[],ae=0,fe=0;fe<Y;fe++)if(fe%4){var le=oe[Q.charCodeAt(fe-1)]<<fe%4*2,ce=oe[Q.charCodeAt(fe)]>>>6-fe%4*2,J=le|ce;X[ae>>>2]|=J<<24-ae%4*8,ae++}return H.create(X,ae)}(x,B,G)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(x){var B=z,j=B.lib,G=j.WordArray,L=j.Hasher,T=B.algo,P=[];(function(){for(var fe=0;fe<64;fe++)P[fe]=4294967296*x.abs(x.sin(fe+1))|0})();var Q=T.MD5=L.extend({_doReset:function(){this._hash=new G.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(fe,le){for(var ce=0;ce<16;ce++){var J=le+ce,re=fe[J];fe[J]=16711935&(re<<8|re>>>24)|4278255360&(re<<24|re>>>8)}var de=this._hash.words,Oe=fe[le+0],ve=fe[le+1],Me=fe[le+2],K=fe[le+3],me=fe[le+4],ke=fe[le+5],pe=fe[le+6],W=fe[le+7],te=fe[le+8],ie=fe[le+9],Ie=fe[le+10],ue=fe[le+11],Se=fe[le+12],Pe=fe[le+13],xe=fe[le+14],He=fe[le+15],Te=de[0],V=de[1],ne=de[2],ye=de[3];Te=Y(Te,V,ne,ye,Oe,7,P[0]),ye=Y(ye,Te,V,ne,ve,12,P[1]),ne=Y(ne,ye,Te,V,Me,17,P[2]),V=Y(V,ne,ye,Te,K,22,P[3]),Te=Y(Te,V,ne,ye,me,7,P[4]),ye=Y(ye,Te,V,ne,ke,12,P[5]),ne=Y(ne,ye,Te,V,pe,17,P[6]),V=Y(V,ne,ye,Te,W,22,P[7]),Te=Y(Te,V,ne,ye,te,7,P[8]),ye=Y(ye,Te,V,ne,ie,12,P[9]),ne=Y(ne,ye,Te,V,Ie,17,P[10]),V=Y(V,ne,ye,Te,ue,22,P[11]),Te=Y(Te,V,ne,ye,Se,7,P[12]),ye=Y(ye,Te,V,ne,Pe,12,P[13]),ne=Y(ne,ye,Te,V,xe,17,P[14]),Te=oe(Te,V=Y(V,ne,ye,Te,He,22,P[15]),ne,ye,ve,5,P[16]),ye=oe(ye,Te,V,ne,pe,9,P[17]),ne=oe(ne,ye,Te,V,ue,14,P[18]),V=oe(V,ne,ye,Te,Oe,20,P[19]),Te=oe(Te,V,ne,ye,ke,5,P[20]),ye=oe(ye,Te,V,ne,Ie,9,P[21]),ne=oe(ne,ye,Te,V,He,14,P[22]),V=oe(V,ne,ye,Te,me,20,P[23]),Te=oe(Te,V,ne,ye,ie,5,P[24]),ye=oe(ye,Te,V,ne,xe,9,P[25]),ne=oe(ne,ye,Te,V,K,14,P[26]),V=oe(V,ne,ye,Te,te,20,P[27]),Te=oe(Te,V,ne,ye,Pe,5,P[28]),ye=oe(ye,Te,V,ne,Me,9,P[29]),ne=oe(ne,ye,Te,V,W,14,P[30]),Te=X(Te,V=oe(V,ne,ye,Te,Se,20,P[31]),ne,ye,ke,4,P[32]),ye=X(ye,Te,V,ne,te,11,P[33]),ne=X(ne,ye,Te,V,ue,16,P[34]),V=X(V,ne,ye,Te,xe,23,P[35]),Te=X(Te,V,ne,ye,ve,4,P[36]),ye=X(ye,Te,V,ne,me,11,P[37]),ne=X(ne,ye,Te,V,W,16,P[38]),V=X(V,ne,ye,Te,Ie,23,P[39]),Te=X(Te,V,ne,ye,Pe,4,P[40]),ye=X(ye,Te,V,ne,Oe,11,P[41]),ne=X(ne,ye,Te,V,K,16,P[42]),V=X(V,ne,ye,Te,pe,23,P[43]),Te=X(Te,V,ne,ye,ie,4,P[44]),ye=X(ye,Te,V,ne,Se,11,P[45]),ne=X(ne,ye,Te,V,He,16,P[46]),Te=ae(Te,V=X(V,ne,ye,Te,Me,23,P[47]),ne,ye,Oe,6,P[48]),ye=ae(ye,Te,V,ne,W,10,P[49]),ne=ae(ne,ye,Te,V,xe,15,P[50]),V=ae(V,ne,ye,Te,ke,21,P[51]),Te=ae(Te,V,ne,ye,Se,6,P[52]),ye=ae(ye,Te,V,ne,K,10,P[53]),ne=ae(ne,ye,Te,V,Ie,15,P[54]),V=ae(V,ne,ye,Te,ve,21,P[55]),Te=ae(Te,V,ne,ye,te,6,P[56]),ye=ae(ye,Te,V,ne,He,10,P[57]),ne=ae(ne,ye,Te,V,pe,15,P[58]),V=ae(V,ne,ye,Te,Pe,21,P[59]),Te=ae(Te,V,ne,ye,me,6,P[60]),ye=ae(ye,Te,V,ne,ue,10,P[61]),ne=ae(ne,ye,Te,V,Me,15,P[62]),V=ae(V,ne,ye,Te,ie,21,P[63]),de[0]=de[0]+Te|0,de[1]=de[1]+V|0,de[2]=de[2]+ne|0,de[3]=de[3]+ye|0},_doFinalize:function(){var fe=this._data,le=fe.words,ce=8*this._nDataBytes,J=8*fe.sigBytes;le[J>>>5]|=128<<24-J%32;var re=x.floor(ce/4294967296),de=ce;le[15+(J+64>>>9<<4)]=16711935&(re<<8|re>>>24)|4278255360&(re<<24|re>>>8),le[14+(J+64>>>9<<4)]=16711935&(de<<8|de>>>24)|4278255360&(de<<24|de>>>8),fe.sigBytes=4*(le.length+1),this._process();for(var Oe=this._hash,ve=Oe.words,Me=0;Me<4;Me++){var K=ve[Me];ve[Me]=16711935&(K<<8|K>>>24)|4278255360&(K<<24|K>>>8)}return Oe},clone:function(){var fe=L.clone.call(this);return fe._hash=this._hash.clone(),fe}});function Y(fe,le,ce,J,re,de,Oe){var ve=fe+(le&ce|~le&J)+re+Oe;return(ve<<de|ve>>>32-de)+le}function oe(fe,le,ce,J,re,de,Oe){var ve=fe+(le&J|ce&~J)+re+Oe;return(ve<<de|ve>>>32-de)+le}function X(fe,le,ce,J,re,de,Oe){var ve=fe+(le^ce^J)+re+Oe;return(ve<<de|ve>>>32-de)+le}function ae(fe,le,ce,J,re,de,Oe){var ve=fe+(ce^(le|~J))+re+Oe;return(ve<<de|ve>>>32-de)+le}B.MD5=L._createHelper(Q),B.HmacMD5=L._createHmacHelper(Q)}(Math),function(){var x=z,B=x.lib,j=B.WordArray,G=B.Hasher,L=x.algo,T=[],P=L.SHA1=G.extend({_doReset:function(){this._hash=new j.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(Q,Y){for(var oe=this._hash.words,X=oe[0],ae=oe[1],fe=oe[2],le=oe[3],ce=oe[4],J=0;J<80;J++){if(J<16)T[J]=0|Q[Y+J];else{var re=T[J-3]^T[J-8]^T[J-14]^T[J-16];T[J]=re<<1|re>>>31}var de=(X<<5|X>>>27)+ce+T[J];de+=J<20?1518500249+(ae&fe|~ae&le):J<40?1859775393+(ae^fe^le):J<60?(ae&fe|ae&le|fe&le)-1894007588:(ae^fe^le)-899497514,ce=le,le=fe,fe=ae<<30|ae>>>2,ae=X,X=de}oe[0]=oe[0]+X|0,oe[1]=oe[1]+ae|0,oe[2]=oe[2]+fe|0,oe[3]=oe[3]+le|0,oe[4]=oe[4]+ce|0},_doFinalize:function(){var Q=this._data,Y=Q.words,oe=8*this._nDataBytes,X=8*Q.sigBytes;return Y[X>>>5]|=128<<24-X%32,Y[14+(X+64>>>9<<4)]=Math.floor(oe/4294967296),Y[15+(X+64>>>9<<4)]=oe,Q.sigBytes=4*Y.length,this._process(),this._hash},clone:function(){var Q=G.clone.call(this);return Q._hash=this._hash.clone(),Q}});x.SHA1=G._createHelper(P),x.HmacSHA1=G._createHmacHelper(P)}(),function(x){var B=z,j=B.lib,G=j.WordArray,L=j.Hasher,T=B.algo,P=[],Q=[];(function(){function X(ce){for(var J=x.sqrt(ce),re=2;re<=J;re++)if(!(ce%re))return!1;return!0}function ae(ce){return 4294967296*(ce-(0|ce))|0}for(var fe=2,le=0;le<64;)X(fe)&&(le<8&&(P[le]=ae(x.pow(fe,.5))),Q[le]=ae(x.pow(fe,1/3)),le++),fe++})();var Y=[],oe=T.SHA256=L.extend({_doReset:function(){this._hash=new G.init(P.slice(0))},_doProcessBlock:function(X,ae){for(var fe=this._hash.words,le=fe[0],ce=fe[1],J=fe[2],re=fe[3],de=fe[4],Oe=fe[5],ve=fe[6],Me=fe[7],K=0;K<64;K++){if(K<16)Y[K]=0|X[ae+K];else{var me=Y[K-15],ke=(me<<25|me>>>7)^(me<<14|me>>>18)^me>>>3,pe=Y[K-2],W=(pe<<15|pe>>>17)^(pe<<13|pe>>>19)^pe>>>10;Y[K]=ke+Y[K-7]+W+Y[K-16]}var te=le&ce^le&J^ce&J,ie=(le<<30|le>>>2)^(le<<19|le>>>13)^(le<<10|le>>>22),Ie=Me+((de<<26|de>>>6)^(de<<21|de>>>11)^(de<<7|de>>>25))+(de&Oe^~de&ve)+Q[K]+Y[K];Me=ve,ve=Oe,Oe=de,de=re+Ie|0,re=J,J=ce,ce=le,le=Ie+(ie+te)|0}fe[0]=fe[0]+le|0,fe[1]=fe[1]+ce|0,fe[2]=fe[2]+J|0,fe[3]=fe[3]+re|0,fe[4]=fe[4]+de|0,fe[5]=fe[5]+Oe|0,fe[6]=fe[6]+ve|0,fe[7]=fe[7]+Me|0},_doFinalize:function(){var X=this._data,ae=X.words,fe=8*this._nDataBytes,le=8*X.sigBytes;return ae[le>>>5]|=128<<24-le%32,ae[14+(le+64>>>9<<4)]=x.floor(fe/4294967296),ae[15+(le+64>>>9<<4)]=fe,X.sigBytes=4*ae.length,this._process(),this._hash},clone:function(){var X=L.clone.call(this);return X._hash=this._hash.clone(),X}});B.SHA256=L._createHelper(oe),B.HmacSHA256=L._createHmacHelper(oe)}(Math),function(){var x=z,B=x.lib.WordArray,j=x.enc;function G(L){return L<<8&4278255360|L>>>8&16711935}j.Utf16=j.Utf16BE={stringify:function(L){for(var T=L.words,P=L.sigBytes,Q=[],Y=0;Y<P;Y+=2){var oe=T[Y>>>2]>>>16-Y%4*8&65535;Q.push(String.fromCharCode(oe))}return Q.join("")},parse:function(L){for(var T=L.length,P=[],Q=0;Q<T;Q++)P[Q>>>1]|=L.charCodeAt(Q)<<16-Q%2*16;return B.create(P,2*T)}},j.Utf16LE={stringify:function(L){for(var T=L.words,P=L.sigBytes,Q=[],Y=0;Y<P;Y+=2){var oe=G(T[Y>>>2]>>>16-Y%4*8&65535);Q.push(String.fromCharCode(oe))}return Q.join("")},parse:function(L){for(var T=L.length,P=[],Q=0;Q<T;Q++)P[Q>>>1]|=G(L.charCodeAt(Q)<<16-Q%2*16);return B.create(P,2*T)}}}(),function(){if(typeof ArrayBuffer=="function"){var x=z.lib.WordArray,B=x.init;(x.init=function(j){if(j instanceof ArrayBuffer&&(j=new Uint8Array(j)),(j instanceof Int8Array||typeof Uint8ClampedArray<"u"&&j instanceof Uint8ClampedArray||j instanceof Int16Array||j instanceof Uint16Array||j instanceof Int32Array||j instanceof Uint32Array||j instanceof Float32Array||j instanceof Float64Array)&&(j=new Uint8Array(j.buffer,j.byteOffset,j.byteLength)),j instanceof Uint8Array){for(var G=j.byteLength,L=[],T=0;T<G;T++)L[T>>>2]|=j[T]<<24-T%4*8;B.call(this,L,G)}else B.apply(this,arguments)}).prototype=x}}(),function(x){var B=z,j=B.lib,G=j.WordArray,L=j.Hasher,T=B.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]),Q=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]),Y=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]),X=G.create([0,1518500249,1859775393,2400959708,2840853838]),ae=G.create([1352829926,1548603684,1836072691,2053994217,0]),fe=T.RIPEMD160=L.extend({_doReset:function(){this._hash=G.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(ve,Me){for(var K=0;K<16;K++){var me=Me+K,ke=ve[me];ve[me]=16711935&(ke<<8|ke>>>24)|4278255360&(ke<<24|ke>>>8)}var pe,W,te,ie,Ie,ue,Se,Pe,xe,He,Te,V=this._hash.words,ne=X.words,ye=ae.words,Be=P.words,je=Q.words,lt=Y.words,Fe=oe.words;for(ue=pe=V[0],Se=W=V[1],Pe=te=V[2],xe=ie=V[3],He=Ie=V[4],K=0;K<80;K+=1)Te=pe+ve[Me+Be[K]]|0,Te+=K<16?le(W,te,ie)+ne[0]:K<32?ce(W,te,ie)+ne[1]:K<48?J(W,te,ie)+ne[2]:K<64?re(W,te,ie)+ne[3]:de(W,te,ie)+ne[4],Te=(Te=Oe(Te|=0,lt[K]))+Ie|0,pe=Ie,Ie=ie,ie=Oe(te,10),te=W,W=Te,Te=ue+ve[Me+je[K]]|0,Te+=K<16?de(Se,Pe,xe)+ye[0]:K<32?re(Se,Pe,xe)+ye[1]:K<48?J(Se,Pe,xe)+ye[2]:K<64?ce(Se,Pe,xe)+ye[3]:le(Se,Pe,xe)+ye[4],Te=(Te=Oe(Te|=0,Fe[K]))+He|0,ue=He,He=xe,xe=Oe(Pe,10),Pe=Se,Se=Te;Te=V[1]+te+xe|0,V[1]=V[2]+ie+He|0,V[2]=V[3]+Ie+ue|0,V[3]=V[4]+pe+Se|0,V[4]=V[0]+W+Pe|0,V[0]=Te},_doFinalize:function(){var ve=this._data,Me=ve.words,K=8*this._nDataBytes,me=8*ve.sigBytes;Me[me>>>5]|=128<<24-me%32,Me[14+(me+64>>>9<<4)]=16711935&(K<<8|K>>>24)|4278255360&(K<<24|K>>>8),ve.sigBytes=4*(Me.length+1),this._process();for(var ke=this._hash,pe=ke.words,W=0;W<5;W++){var te=pe[W];pe[W]=16711935&(te<<8|te>>>24)|4278255360&(te<<24|te>>>8)}return ke},clone:function(){var ve=L.clone.call(this);return ve._hash=this._hash.clone(),ve}});function le(ve,Me,K){return ve^Me^K}function ce(ve,Me,K){return ve&Me|~ve&K}function J(ve,Me,K){return(ve|~Me)^K}function re(ve,Me,K){return ve&K|Me&~K}function de(ve,Me,K){return ve^(Me|~K)}function Oe(ve,Me){return ve<<Me|ve>>>32-Me}B.RIPEMD160=L._createHelper(fe),B.HmacRIPEMD160=L._createHmacHelper(fe)}(),function(){var x=z,B=x.lib.Base,j=x.enc.Utf8;x.algo.HMAC=B.extend({init:function(G,L){G=this._hasher=new G.init,typeof L=="string"&&(L=j.parse(L));var T=G.blockSize,P=4*T;L.sigBytes>P&&(L=G.finalize(L)),L.clamp();for(var Q=this._oKey=L.clone(),Y=this._iKey=L.clone(),oe=Q.words,X=Y.words,ae=0;ae<T;ae++)oe[ae]^=1549556828,X[ae]^=909522486;Q.sigBytes=Y.sigBytes=P,this.reset()},reset:function(){var G=this._hasher;G.reset(),G.update(this._iKey)},update:function(G){return this._hasher.update(G),this},finalize:function(G){var L=this._hasher,T=L.finalize(G);return L.reset(),L.finalize(this._oKey.clone().concat(T))}})}(),function(){var x=z,B=x.lib,j=B.Base,G=B.WordArray,L=x.algo,T=L.SHA1,P=L.HMAC,Q=L.PBKDF2=j.extend({cfg:j.extend({keySize:4,hasher:T,iterations:1}),init:function(Y){this.cfg=this.cfg.extend(Y)},compute:function(Y,oe){for(var X=this.cfg,ae=P.create(X.hasher,Y),fe=G.create(),le=G.create([1]),ce=fe.words,J=le.words,re=X.keySize,de=X.iterations;ce.length<re;){var Oe=ae.update(oe).finalize(le);ae.reset();for(var ve=Oe.words,Me=ve.length,K=Oe,me=1;me<de;me++){K=ae.finalize(K),ae.reset();for(var ke=K.words,pe=0;pe<Me;pe++)ve[pe]^=ke[pe]}fe.concat(Oe),J[0]++}return fe.sigBytes=4*re,fe}});x.PBKDF2=function(Y,oe,X){return Q.create(X).compute(Y,oe)}}(),function(){var x=z,B=x.lib,j=B.Base,G=B.WordArray,L=x.algo,T=L.MD5,P=L.EvpKDF=j.extend({cfg:j.extend({keySize:4,hasher:T,iterations:1}),init:function(Q){this.cfg=this.cfg.extend(Q)},compute:function(Q,Y){for(var oe,X=this.cfg,ae=X.hasher.create(),fe=G.create(),le=fe.words,ce=X.keySize,J=X.iterations;le.length<ce;){oe&&ae.update(oe),oe=ae.update(Q).finalize(Y),ae.reset();for(var re=1;re<J;re++)oe=ae.finalize(oe),ae.reset();fe.concat(oe)}return fe.sigBytes=4*ce,fe}});x.EvpKDF=function(Q,Y,oe){return P.create(oe).compute(Q,Y)}}(),function(){var x=z,B=x.lib.WordArray,j=x.algo,G=j.SHA256,L=j.SHA224=G.extend({_doReset:function(){this._hash=new B.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var T=G._doFinalize.call(this);return T.sigBytes-=4,T}});x.SHA224=G._createHelper(L),x.HmacSHA224=G._createHmacHelper(L)}(),function(x){var B=z,j=B.lib,G=j.Base,L=j.WordArray,T=B.x64={};T.Word=G.extend({init:function(P,Q){this.high=P,this.low=Q}}),T.WordArray=G.extend({init:function(P,Q){P=this.words=P||[],this.sigBytes=Q??8*P.length},toX32:function(){for(var P=this.words,Q=P.length,Y=[],oe=0;oe<Q;oe++){var X=P[oe];Y.push(X.high),Y.push(X.low)}return L.create(Y,this.sigBytes)},clone:function(){for(var P=G.clone.call(this),Q=P.words=this.words.slice(0),Y=Q.length,oe=0;oe<Y;oe++)Q[oe]=Q[oe].clone();return P}})}(),function(x){var B=z,j=B.lib,G=j.WordArray,L=j.Hasher,T=B.x64.Word,P=B.algo,Q=[],Y=[],oe=[];(function(){for(var fe=1,le=0,ce=0;ce<24;ce++){Q[fe+5*le]=(ce+1)*(ce+2)/2%64;var J=(2*fe+3*le)%5;fe=le%5,le=J}for(fe=0;fe<5;fe++)for(le=0;le<5;le++)Y[fe+5*le]=le+(2*fe+3*le)%5*5;for(var re=1,de=0;de<24;de++){for(var Oe=0,ve=0,Me=0;Me<7;Me++){if(1&re){var K=(1<<Me)-1;K<32?ve^=1<<K:Oe^=1<<K-32}128&re?re=re<<1^113:re<<=1}oe[de]=T.create(Oe,ve)}})();var X=[];(function(){for(var fe=0;fe<25;fe++)X[fe]=T.create()})();var ae=P.SHA3=L.extend({cfg:L.cfg.extend({outputLength:512}),_doReset:function(){for(var fe=this._state=[],le=0;le<25;le++)fe[le]=new T.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(fe,le){for(var ce=this._state,J=this.blockSize/2,re=0;re<J;re++){var de=fe[le+2*re],Oe=fe[le+2*re+1];de=16711935&(de<<8|de>>>24)|4278255360&(de<<24|de>>>8),Oe=16711935&(Oe<<8|Oe>>>24)|4278255360&(Oe<<24|Oe>>>8),(ne=ce[re]).high^=Oe,ne.low^=de}for(var ve=0;ve<24;ve++){for(var Me=0;Me<5;Me++){for(var K=0,me=0,ke=0;ke<5;ke++)K^=(ne=ce[Me+5*ke]).high,me^=ne.low;var pe=X[Me];pe.high=K,pe.low=me}for(Me=0;Me<5;Me++){var W=X[(Me+4)%5],te=X[(Me+1)%5],ie=te.high,Ie=te.low;for(K=W.high^(ie<<1|Ie>>>31),me=W.low^(Ie<<1|ie>>>31),ke=0;ke<5;ke++)(ne=ce[Me+5*ke]).high^=K,ne.low^=me}for(var ue=1;ue<25;ue++){var Se=(ne=ce[ue]).high,Pe=ne.low,xe=Q[ue];xe<32?(K=Se<<xe|Pe>>>32-xe,me=Pe<<xe|Se>>>32-xe):(K=Pe<<xe-32|Se>>>64-xe,me=Se<<xe-32|Pe>>>64-xe);var He=X[Y[ue]];He.high=K,He.low=me}var Te=X[0],V=ce[0];for(Te.high=V.high,Te.low=V.low,Me=0;Me<5;Me++)for(ke=0;ke<5;ke++){var ne=ce[ue=Me+5*ke],ye=X[ue],Be=X[(Me+1)%5+5*ke],je=X[(Me+2)%5+5*ke];ne.high=ye.high^~Be.high&je.high,ne.low=ye.low^~Be.low&je.low}ne=ce[0];var lt=oe[ve];ne.high^=lt.high,ne.low^=lt.low}},_doFinalize:function(){var fe=this._data,le=fe.words,ce=(this._nDataBytes,8*fe.sigBytes),J=32*this.blockSize;le[ce>>>5]|=1<<24-ce%32,le[(x.ceil((ce+1)/J)*J>>>5)-1]|=128,fe.sigBytes=4*le.length,this._process();for(var re=this._state,de=this.cfg.outputLength/8,Oe=de/8,ve=[],Me=0;Me<Oe;Me++){var K=re[Me],me=K.high,ke=K.low;me=16711935&(me<<8|me>>>24)|4278255360&(me<<24|me>>>8),ke=16711935&(ke<<8|ke>>>24)|4278255360&(ke<<24|ke>>>8),ve.push(ke),ve.push(me)}return new G.init(ve,de)},clone:function(){for(var fe=L.clone.call(this),le=fe._state=this._state.slice(0),ce=0;ce<25;ce++)le[ce]=le[ce].clone();return fe}});B.SHA3=L._createHelper(ae),B.HmacSHA3=L._createHmacHelper(ae)}(Math),function(){var x=z,B=x.lib.Hasher,j=x.x64,G=j.Word,L=j.WordArray,T=x.algo;function P(){return G.create.apply(G,arguments)}var Q=[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)],Y=[];(function(){for(var X=0;X<80;X++)Y[X]=P()})();var oe=T.SHA512=B.extend({_doReset:function(){this._hash=new L.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(X,ae){for(var fe=this._hash.words,le=fe[0],ce=fe[1],J=fe[2],re=fe[3],de=fe[4],Oe=fe[5],ve=fe[6],Me=fe[7],K=le.high,me=le.low,ke=ce.high,pe=ce.low,W=J.high,te=J.low,ie=re.high,Ie=re.low,ue=de.high,Se=de.low,Pe=Oe.high,xe=Oe.low,He=ve.high,Te=ve.low,V=Me.high,ne=Me.low,ye=K,Be=me,je=ke,lt=pe,Fe=W,st=te,wt=ie,mn=Ie,In=ue,Cn=Se,En=Pe,vn=xe,Qe=He,yt=Te,Pt=V,ln=ne,en=0;en<80;en++){var Tn,qn,ze=Y[en];if(en<16)qn=ze.high=0|X[ae+2*en],Tn=ze.low=0|X[ae+2*en+1];else{var St=Y[en-15],_t=St.high,Ht=St.low,Yt=(_t>>>1|Ht<<31)^(_t>>>8|Ht<<24)^_t>>>7,yr=(Ht>>>1|_t<<31)^(Ht>>>8|_t<<24)^(Ht>>>7|_t<<25),Cr=Y[en-2],Zo=Cr.high,ho=Cr.low,$e=(Zo>>>19|ho<<13)^(Zo<<3|ho>>>29)^Zo>>>6,Ze=(ho>>>19|Zo<<13)^(ho<<3|Zo>>>29)^(ho>>>6|Zo<<26),qt=Y[en-7],wn=qt.high,Mn=qt.low,Pn=Y[en-16],Kr=Pn.high,$r=Pn.low;qn=(qn=(qn=Yt+wn+((Tn=yr+Mn)>>>0<yr>>>0?1:0))+$e+((Tn+=Ze)>>>0<Ze>>>0?1:0))+Kr+((Tn+=$r)>>>0<$r>>>0?1:0),ze.high=qn,ze.low=Tn}var ro,us=In&En^~In&Qe,U=Cn&vn^~Cn&yt,cs=ye&je^ye&Fe^je&Fe,Gt=Be<^Be&st^lt&st,_l=(ye>>>28|Be<<4)^(ye<<30|Be>>>2)^(ye<<25|Be>>>7),Qs=(Be>>>28|ye<<4)^(Be<<30|ye>>>2)^(Be<<25|ye>>>7),bl=(In>>>14|Cn<<18)^(In>>>18|Cn<<14)^(In<<23|Cn>>>9),Ml=(Cn>>>14|In<<18)^(Cn>>>18|In<<14)^(Cn<<23|In>>>9),Ra=Q[en],Qo=Ra.high,Na=Ra.low,ds=Pt+bl+((ro=ln+Ml)>>>0<ln>>>0?1:0),Xi=Qs+Gt;Pt=Qe,ln=yt,Qe=En,yt=vn,En=In,vn=Cn,In=wt+(ds=(ds=(ds=ds+us+((ro+=U)>>>0<U>>>0?1:0))+Qo+((ro+=Na)>>>0<Na>>>0?1:0))+qn+((ro+=Tn)>>>0<Tn>>>0?1:0))+((Cn=mn+ro|0)>>>0<mn>>>0?1:0)|0,wt=Fe,mn=st,Fe=je,st=lt,je=ye,lt=Be,ye=ds+(_l+cs+(Xi>>>0<Qs>>>0?1:0))+((Be=ro+Xi|0)>>>0<ro>>>0?1:0)|0}me=le.low=me+Be,le.high=K+ye+(me>>>0<Be>>>0?1:0),pe=ce.low=pe+lt,ce.high=ke+je+(pe>>>0<lt>>>0?1:0),te=J.low=te+st,J.high=W+Fe+(te>>>0<st>>>0?1:0),Ie=re.low=Ie+mn,re.high=ie+wt+(Ie>>>0<mn>>>0?1:0),Se=de.low=Se+Cn,de.high=ue+In+(Se>>>0<Cn>>>0?1:0),xe=Oe.low=xe+vn,Oe.high=Pe+En+(xe>>>0<vn>>>0?1:0),Te=ve.low=Te+yt,ve.high=He+Qe+(Te>>>0<yt>>>0?1:0),ne=Me.low=ne+ln,Me.high=V+Pt+(ne>>>0<ln>>>0?1:0)},_doFinalize:function(){var X=this._data,ae=X.words,fe=8*this._nDataBytes,le=8*X.sigBytes;return ae[le>>>5]|=128<<24-le%32,ae[30+(le+128>>>10<<5)]=Math.floor(fe/4294967296),ae[31+(le+128>>>10<<5)]=fe,X.sigBytes=4*ae.length,this._process(),this._hash.toX32()},clone:function(){var X=B.clone.call(this);return X._hash=this._hash.clone(),X},blockSize:32});x.SHA512=B._createHelper(oe),x.HmacSHA512=B._createHmacHelper(oe)}(),function(){var x=z,B=x.x64,j=B.Word,G=B.WordArray,L=x.algo,T=L.SHA512,P=L.SHA384=T.extend({_doReset:function(){this._hash=new G.init([new j.init(3418070365,3238371032),new j.init(1654270250,914150663),new j.init(2438529370,812702999),new j.init(355462360,4144912697),new j.init(1731405415,4290775857),new j.init(2394180231,1750603025),new j.init(3675008525,1694076839),new j.init(1203062813,3204075428)])},_doFinalize:function(){var Q=T._doFinalize.call(this);return Q.sigBytes-=16,Q}});x.SHA384=T._createHelper(P),x.HmacSHA384=T._createHmacHelper(P)}(),z.lib.Cipher||function(x){var B=z,j=B.lib,G=j.Base,L=j.WordArray,T=j.BufferedBlockAlgorithm,P=B.enc,Q=(P.Utf8,P.Base64),Y=B.algo.EvpKDF,oe=j.Cipher=T.extend({cfg:G.extend(),createEncryptor:function(ve,Me){return this.create(this._ENC_XFORM_MODE,ve,Me)},createDecryptor:function(ve,Me){return this.create(this._DEC_XFORM_MODE,ve,Me)},init:function(ve,Me,K){this.cfg=this.cfg.extend(K),this._xformMode=ve,this._key=Me,this.reset()},reset:function(){T.reset.call(this),this._doReset()},process:function(ve){return this._append(ve),this._process()},finalize:function(ve){return ve&&this._append(ve),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function ve(Me){return typeof Me=="string"?Oe:re}return function(Me){return{encrypt:function(K,me,ke){return ve(me).encrypt(Me,K,me,ke)},decrypt:function(K,me,ke){return ve(me).decrypt(Me,K,me,ke)}}}}()}),X=(j.StreamCipher=oe.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),B.mode={}),ae=j.BlockCipherMode=G.extend({createEncryptor:function(ve,Me){return this.Encryptor.create(ve,Me)},createDecryptor:function(ve,Me){return this.Decryptor.create(ve,Me)},init:function(ve,Me){this._cipher=ve,this._iv=Me}}),fe=X.CBC=function(){var ve=ae.extend();function Me(K,me,ke){var pe,W=this._iv;W?(pe=W,this._iv=void 0):pe=this._prevBlock;for(var te=0;te<ke;te++)K[me+te]^=pe[te]}return ve.Encryptor=ve.extend({processBlock:function(K,me){var ke=this._cipher,pe=ke.blockSize;Me.call(this,K,me,pe),ke.encryptBlock(K,me),this._prevBlock=K.slice(me,me+pe)}}),ve.Decryptor=ve.extend({processBlock:function(K,me){var ke=this._cipher,pe=ke.blockSize,W=K.slice(me,me+pe);ke.decryptBlock(K,me),Me.call(this,K,me,pe),this._prevBlock=W}}),ve}(),le=(B.pad={}).Pkcs7={pad:function(ve,Me){for(var K=4*Me,me=K-ve.sigBytes%K,ke=me<<24|me<<16|me<<8|me,pe=[],W=0;W<me;W+=4)pe.push(ke);var te=L.create(pe,me);ve.concat(te)},unpad:function(ve){var Me=255&ve.words[ve.sigBytes-1>>>2];ve.sigBytes-=Me}},ce=(j.BlockCipher=oe.extend({cfg:oe.cfg.extend({mode:fe,padding:le}),reset:function(){var ve;oe.reset.call(this);var Me=this.cfg,K=Me.iv,me=Me.mode;this._xformMode==this._ENC_XFORM_MODE?ve=me.createEncryptor:(ve=me.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==ve?this._mode.init(this,K&&K.words):(this._mode=ve.call(me,this,K&&K.words),this._mode.__creator=ve)},_doProcessBlock:function(ve,Me){this._mode.processBlock(ve,Me)},_doFinalize:function(){var ve,Me=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(Me.pad(this._data,this.blockSize),ve=this._process(!0)):(ve=this._process(!0),Me.unpad(ve)),ve},blockSize:4}),j.CipherParams=G.extend({init:function(ve){this.mixIn(ve)},toString:function(ve){return(ve||this.formatter).stringify(this)}})),J=(B.format={}).OpenSSL={stringify:function(ve){var Me=ve.ciphertext,K=ve.salt;return(K?L.create([1398893684,1701076831]).concat(K).concat(Me):Me).toString(Q)},parse:function(ve){var Me,K=Q.parse(ve),me=K.words;return me[0]==1398893684&&me[1]==1701076831&&(Me=L.create(me.slice(2,4)),me.splice(0,4),K.sigBytes-=16),ce.create({ciphertext:K,salt:Me})}},re=j.SerializableCipher=G.extend({cfg:G.extend({format:J}),encrypt:function(ve,Me,K,me){me=this.cfg.extend(me);var ke=ve.createEncryptor(K,me),pe=ke.finalize(Me),W=ke.cfg;return ce.create({ciphertext:pe,key:K,iv:W.iv,algorithm:ve,mode:W.mode,padding:W.padding,blockSize:ve.blockSize,formatter:me.format})},decrypt:function(ve,Me,K,me){return me=this.cfg.extend(me),Me=this._parse(Me,me.format),ve.createDecryptor(K,me).finalize(Me.ciphertext)},_parse:function(ve,Me){return typeof ve=="string"?Me.parse(ve,this):ve}}),de=(B.kdf={}).OpenSSL={execute:function(ve,Me,K,me){me||(me=L.random(8));var ke=Y.create({keySize:Me+K}).compute(ve,me),pe=L.create(ke.words.slice(Me),4*K);return ke.sigBytes=4*Me,ce.create({key:ke,iv:pe,salt:me})}},Oe=j.PasswordBasedCipher=re.extend({cfg:re.cfg.extend({kdf:de}),encrypt:function(ve,Me,K,me){var ke=(me=this.cfg.extend(me)).kdf.execute(K,ve.keySize,ve.ivSize);me.iv=ke.iv;var pe=re.encrypt.call(this,ve,Me,ke.key,me);return pe.mixIn(ke),pe},decrypt:function(ve,Me,K,me){me=this.cfg.extend(me),Me=this._parse(Me,me.format);var ke=me.kdf.execute(K,ve.keySize,ve.ivSize,Me.salt);return me.iv=ke.iv,re.decrypt.call(this,ve,Me,ke.key,me)}})}(),z.mode.CFB=function(){var x=z.lib.BlockCipherMode.extend();function B(j,G,L,T){var P,Q=this._iv;Q?(P=Q.slice(0),this._iv=void 0):P=this._prevBlock,T.encryptBlock(P,0);for(var Y=0;Y<L;Y++)j[G+Y]^=P[Y]}return x.Encryptor=x.extend({processBlock:function(j,G){var L=this._cipher,T=L.blockSize;B.call(this,j,G,T,L),this._prevBlock=j.slice(G,G+T)}}),x.Decryptor=x.extend({processBlock:function(j,G){var L=this._cipher,T=L.blockSize,P=j.slice(G,G+T);B.call(this,j,G,T,L),this._prevBlock=P}}),x}(),z.mode.ECB=((A=z.lib.BlockCipherMode.extend()).Encryptor=A.extend({processBlock:function(x,B){this._cipher.encryptBlock(x,B)}}),A.Decryptor=A.extend({processBlock:function(x,B){this._cipher.decryptBlock(x,B)}}),A),z.pad.AnsiX923={pad:function(x,B){var j=x.sigBytes,G=4*B,L=G-j%G,T=j+L-1;x.clamp(),x.words[T>>>2]|=L<<24-T%4*8,x.sigBytes+=L},unpad:function(x){var B=255&x.words[x.sigBytes-1>>>2];x.sigBytes-=B}},z.pad.Iso10126={pad:function(x,B){var j=4*B,G=j-x.sigBytes%j;x.concat(z.lib.WordArray.random(G-1)).concat(z.lib.WordArray.create([G<<24],1))},unpad:function(x){var B=255&x.words[x.sigBytes-1>>>2];x.sigBytes-=B}},z.pad.Iso97971={pad:function(x,B){x.concat(z.lib.WordArray.create([2147483648],1)),z.pad.ZeroPadding.pad(x,B)},unpad:function(x){z.pad.ZeroPadding.unpad(x),x.sigBytes--}},z.mode.OFB=(S=z.lib.BlockCipherMode.extend(),R=S.Encryptor=S.extend({processBlock:function(x,B){var j=this._cipher,G=j.blockSize,L=this._iv,T=this._keystream;L&&(T=this._keystream=L.slice(0),this._iv=void 0),j.encryptBlock(T,0);for(var P=0;P<G;P++)x[B+P]^=T[P]}}),S.Decryptor=R,S),z.pad.NoPadding={pad:function(){},unpad:function(){}},function(x){var B=z,j=B.lib.CipherParams,G=B.enc.Hex;B.format.Hex={stringify:function(L){return L.ciphertext.toString(G)},parse:function(L){var T=G.parse(L);return j.create({ciphertext:T})}}}(),function(){var x=z,B=x.lib.BlockCipher,j=x.algo,G=[],L=[],T=[],P=[],Q=[],Y=[],oe=[],X=[],ae=[],fe=[];(function(){for(var J=[],re=0;re<256;re++)J[re]=re<128?re<<1:re<<1^283;var de=0,Oe=0;for(re=0;re<256;re++){var ve=Oe^Oe<<1^Oe<<2^Oe<<3^Oe<<4;ve=ve>>>8^255&ve^99,G[de]=ve,L[ve]=de;var Me=J[de],K=J[Me],me=J[K],ke=257*J[ve]^16843008*ve;T[de]=ke<<24|ke>>>8,P[de]=ke<<16|ke>>>16,Q[de]=ke<<8|ke>>>24,Y[de]=ke,ke=16843009*me^65537*K^257*Me^16843008*de,oe[ve]=ke<<24|ke>>>8,X[ve]=ke<<16|ke>>>16,ae[ve]=ke<<8|ke>>>24,fe[ve]=ke,de?(de=Me^J[J[J[me^Me]]],Oe^=J[J[Oe]]):de=Oe=1}})();var le=[0,1,2,4,8,16,32,64,128,27,54],ce=j.AES=B.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var J=this._keyPriorReset=this._key,re=J.words,de=J.sigBytes/4,Oe=4*((this._nRounds=de+6)+1),ve=this._keySchedule=[],Me=0;Me<Oe;Me++)Me<de?ve[Me]=re[Me]:(ke=ve[Me-1],Me%de?de>6&&Me%de==4&&(ke=G[ke>>>24]<<24|G[ke>>>16&255]<<16|G[ke>>>8&255]<<8|G[255&ke]):(ke=G[(ke=ke<<8|ke>>>24)>>>24]<<24|G[ke>>>16&255]<<16|G[ke>>>8&255]<<8|G[255&ke],ke^=le[Me/de|0]<<24),ve[Me]=ve[Me-de]^ke);for(var K=this._invKeySchedule=[],me=0;me<Oe;me++){if(Me=Oe-me,me%4)var ke=ve[Me];else ke=ve[Me-4];K[me]=me<4||Me<=4?ke:oe[G[ke>>>24]]^X[G[ke>>>16&255]]^ae[G[ke>>>8&255]]^fe[G[255&ke]]}}},encryptBlock:function(J,re){this._doCryptBlock(J,re,this._keySchedule,T,P,Q,Y,G)},decryptBlock:function(J,re){var de=J[re+1];J[re+1]=J[re+3],J[re+3]=de,this._doCryptBlock(J,re,this._invKeySchedule,oe,X,ae,fe,L),de=J[re+1],J[re+1]=J[re+3],J[re+3]=de},_doCryptBlock:function(J,re,de,Oe,ve,Me,K,me){for(var ke=this._nRounds,pe=J[re]^de[0],W=J[re+1]^de[1],te=J[re+2]^de[2],ie=J[re+3]^de[3],Ie=4,ue=1;ue<ke;ue++){var Se=Oe[pe>>>24]^ve[W>>>16&255]^Me[te>>>8&255]^K[255&ie]^de[Ie++],Pe=Oe[W>>>24]^ve[te>>>16&255]^Me[ie>>>8&255]^K[255&pe]^de[Ie++],xe=Oe[te>>>24]^ve[ie>>>16&255]^Me[pe>>>8&255]^K[255&W]^de[Ie++],He=Oe[ie>>>24]^ve[pe>>>16&255]^Me[W>>>8&255]^K[255&te]^de[Ie++];pe=Se,W=Pe,te=xe,ie=He}Se=(me[pe>>>24]<<24|me[W>>>16&255]<<16|me[te>>>8&255]<<8|me[255&ie])^de[Ie++],Pe=(me[W>>>24]<<24|me[te>>>16&255]<<16|me[ie>>>8&255]<<8|me[255&pe])^de[Ie++],xe=(me[te>>>24]<<24|me[ie>>>16&255]<<16|me[pe>>>8&255]<<8|me[255&W])^de[Ie++],He=(me[ie>>>24]<<24|me[pe>>>16&255]<<16|me[W>>>8&255]<<8|me[255&te])^de[Ie++],J[re]=Se,J[re+1]=Pe,J[re+2]=xe,J[re+3]=He},keySize:8});x.AES=B._createHelper(ce)}(),function(){var x=z,B=x.lib,j=B.WordArray,G=B.BlockCipher,L=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],Q=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],Y=[{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],X=L.DES=G.extend({_doReset:function(){for(var ce=this._key.words,J=[],re=0;re<56;re++){var de=T[re]-1;J[re]=ce[de>>>5]>>>31-de%32&1}for(var Oe=this._subKeys=[],ve=0;ve<16;ve++){var Me=Oe[ve]=[],K=Q[ve];for(re=0;re<24;re++)Me[re/6|0]|=J[(P[re]-1+K)%28]<<31-re%6,Me[4+(re/6|0)]|=J[28+(P[re+24]-1+K)%28]<<31-re%6;for(Me[0]=Me[0]<<1|Me[0]>>>31,re=1;re<7;re++)Me[re]=Me[re]>>>4*(re-1)+3;Me[7]=Me[7]<<5|Me[7]>>>27}var me=this._invSubKeys=[];for(re=0;re<16;re++)me[re]=Oe[15-re]},encryptBlock:function(ce,J){this._doCryptBlock(ce,J,this._subKeys)},decryptBlock:function(ce,J){this._doCryptBlock(ce,J,this._invSubKeys)},_doCryptBlock:function(ce,J,re){this._lBlock=ce[J],this._rBlock=ce[J+1],ae.call(this,4,252645135),ae.call(this,16,65535),fe.call(this,2,858993459),fe.call(this,8,16711935),ae.call(this,1,1431655765);for(var de=0;de<16;de++){for(var Oe=re[de],ve=this._lBlock,Me=this._rBlock,K=0,me=0;me<8;me++)K|=Y[me][((Me^Oe[me])&oe[me])>>>0];this._lBlock=Me,this._rBlock=ve^K}var ke=this._lBlock;this._lBlock=this._rBlock,this._rBlock=ke,ae.call(this,1,1431655765),fe.call(this,8,16711935),fe.call(this,2,858993459),ae.call(this,16,65535),ae.call(this,4,252645135),ce[J]=this._lBlock,ce[J+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function ae(ce,J){var re=(this._lBlock>>>ce^this._rBlock)&J;this._rBlock^=re,this._lBlock^=re<<ce}function fe(ce,J){var re=(this._rBlock>>>ce^this._lBlock)&J;this._lBlock^=re,this._rBlock^=re<<ce}x.DES=G._createHelper(X);var le=L.TripleDES=G.extend({_doReset:function(){var ce=this._key.words;if(ce.length!==2&&ce.length!==4&&ce.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var J=ce.slice(0,2),re=ce.length<4?ce.slice(0,2):ce.slice(2,4),de=ce.length<6?ce.slice(0,2):ce.slice(4,6);this._des1=X.createEncryptor(j.create(J)),this._des2=X.createEncryptor(j.create(re)),this._des3=X.createEncryptor(j.create(de))},encryptBlock:function(ce,J){this._des1.encryptBlock(ce,J),this._des2.decryptBlock(ce,J),this._des3.encryptBlock(ce,J)},decryptBlock:function(ce,J){this._des3.decryptBlock(ce,J),this._des2.encryptBlock(ce,J),this._des1.decryptBlock(ce,J)},keySize:6,ivSize:2,blockSize:2});x.TripleDES=G._createHelper(le)}(),function(){var x=z,B=x.lib.StreamCipher,j=x.algo,G=j.RC4=B.extend({_doReset:function(){for(var P=this._key,Q=P.words,Y=P.sigBytes,oe=this._S=[],X=0;X<256;X++)oe[X]=X;X=0;for(var ae=0;X<256;X++){var fe=X%Y,le=Q[fe>>>2]>>>24-fe%4*8&255;ae=(ae+oe[X]+le)%256;var ce=oe[X];oe[X]=oe[ae],oe[ae]=ce}this._i=this._j=0},_doProcessBlock:function(P,Q){P[Q]^=L.call(this)},keySize:8,ivSize:0});function L(){for(var P=this._S,Q=this._i,Y=this._j,oe=0,X=0;X<4;X++){Y=(Y+P[Q=(Q+1)%256])%256;var ae=P[Q];P[Q]=P[Y],P[Y]=ae,oe|=P[(P[Q]+P[Y])%256]<<24-8*X}return this._i=Q,this._j=Y,oe}x.RC4=B._createHelper(G);var T=j.RC4Drop=G.extend({cfg:G.cfg.extend({drop:192}),_doReset:function(){G._doReset.call(this);for(var P=this.cfg.drop;P>0;P--)L.call(this)}});x.RC4Drop=B._createHelper(T)}(),z.mode.CTRGladman=function(){var x=z.lib.BlockCipherMode.extend();function B(G){if((G>>24&255)==255){var L=G>>16&255,T=G>>8&255,P=255&G;L===255?(L=0,T===255?(T=0,P===255?P=0:++P):++T):++L,G=0,G+=L<<16,G+=T<<8,G+=P}else G+=1<<24;return G}var j=x.Encryptor=x.extend({processBlock:function(G,L){var T=this._cipher,P=T.blockSize,Q=this._iv,Y=this._counter;Q&&(Y=this._counter=Q.slice(0),this._iv=void 0),function(ae){(ae[0]=B(ae[0]))===0&&(ae[1]=B(ae[1]))}(Y);var oe=Y.slice(0);T.encryptBlock(oe,0);for(var X=0;X<P;X++)G[L+X]^=oe[X]}});return x.Decryptor=j,x}(),function(){var x=z,B=x.lib.StreamCipher,j=x.algo,G=[],L=[],T=[],P=j.Rabbit=B.extend({_doReset:function(){for(var Y=this._key.words,oe=this.cfg.iv,X=0;X<4;X++)Y[X]=16711935&(Y[X]<<8|Y[X]>>>24)|4278255360&(Y[X]<<24|Y[X]>>>8);var ae=this._X=[Y[0],Y[3]<<16|Y[2]>>>16,Y[1],Y[0]<<16|Y[3]>>>16,Y[2],Y[1]<<16|Y[0]>>>16,Y[3],Y[2]<<16|Y[1]>>>16],fe=this._C=[Y[2]<<16|Y[2]>>>16,4294901760&Y[0]|65535&Y[1],Y[3]<<16|Y[3]>>>16,4294901760&Y[1]|65535&Y[2],Y[0]<<16|Y[0]>>>16,4294901760&Y[2]|65535&Y[3],Y[1]<<16|Y[1]>>>16,4294901760&Y[3]|65535&Y[0]];for(this._b=0,X=0;X<4;X++)Q.call(this);for(X=0;X<8;X++)fe[X]^=ae[X+4&7];if(oe){var le=oe.words,ce=le[0],J=le[1],re=16711935&(ce<<8|ce>>>24)|4278255360&(ce<<24|ce>>>8),de=16711935&(J<<8|J>>>24)|4278255360&(J<<24|J>>>8),Oe=re>>>16|4294901760&de,ve=de<<16|65535&re;for(fe[0]^=re,fe[1]^=Oe,fe[2]^=de,fe[3]^=ve,fe[4]^=re,fe[5]^=Oe,fe[6]^=de,fe[7]^=ve,X=0;X<4;X++)Q.call(this)}},_doProcessBlock:function(Y,oe){var X=this._X;Q.call(this),G[0]=X[0]^X[5]>>>16^X[3]<<16,G[1]=X[2]^X[7]>>>16^X[5]<<16,G[2]=X[4]^X[1]>>>16^X[7]<<16,G[3]=X[6]^X[3]>>>16^X[1]<<16;for(var ae=0;ae<4;ae++)G[ae]=16711935&(G[ae]<<8|G[ae]>>>24)|4278255360&(G[ae]<<24|G[ae]>>>8),Y[oe+ae]^=G[ae]},blockSize:4,ivSize:2});function Q(){for(var Y=this._X,oe=this._C,X=0;X<8;X++)L[X]=oe[X];for(oe[0]=oe[0]+1295307597+this._b|0,oe[1]=oe[1]+3545052371+(oe[0]>>>0<L[0]>>>0?1:0)|0,oe[2]=oe[2]+886263092+(oe[1]>>>0<L[1]>>>0?1:0)|0,oe[3]=oe[3]+1295307597+(oe[2]>>>0<L[2]>>>0?1:0)|0,oe[4]=oe[4]+3545052371+(oe[3]>>>0<L[3]>>>0?1:0)|0,oe[5]=oe[5]+886263092+(oe[4]>>>0<L[4]>>>0?1:0)|0,oe[6]=oe[6]+1295307597+(oe[5]>>>0<L[5]>>>0?1:0)|0,oe[7]=oe[7]+3545052371+(oe[6]>>>0<L[6]>>>0?1:0)|0,this._b=oe[7]>>>0<L[7]>>>0?1:0,X=0;X<8;X++){var ae=Y[X]+oe[X],fe=65535&ae,le=ae>>>16,ce=((fe*fe>>>17)+fe*le>>>15)+le*le,J=((4294901760&ae)*ae|0)+((65535&ae)*ae|0);T[X]=ce^J}Y[0]=T[0]+(T[7]<<16|T[7]>>>16)+(T[6]<<16|T[6]>>>16)|0,Y[1]=T[1]+(T[0]<<8|T[0]>>>24)+T[7]|0,Y[2]=T[2]+(T[1]<<16|T[1]>>>16)+(T[0]<<16|T[0]>>>16)|0,Y[3]=T[3]+(T[2]<<8|T[2]>>>24)+T[1]|0,Y[4]=T[4]+(T[3]<<16|T[3]>>>16)+(T[2]<<16|T[2]>>>16)|0,Y[5]=T[5]+(T[4]<<8|T[4]>>>24)+T[3]|0,Y[6]=T[6]+(T[5]<<16|T[5]>>>16)+(T[4]<<16|T[4]>>>16)|0,Y[7]=T[7]+(T[6]<<8|T[6]>>>24)+T[5]|0}x.Rabbit=B._createHelper(P)}(),z.mode.CTR=function(){var x=z.lib.BlockCipherMode.extend(),B=x.Encryptor=x.extend({processBlock:function(j,G){var L=this._cipher,T=L.blockSize,P=this._iv,Q=this._counter;P&&(Q=this._counter=P.slice(0),this._iv=void 0);var Y=Q.slice(0);L.encryptBlock(Y,0),Q[T-1]=Q[T-1]+1|0;for(var oe=0;oe<T;oe++)j[G+oe]^=Y[oe]}});return x.Decryptor=B,x}(),function(){var x=z,B=x.lib.StreamCipher,j=x.algo,G=[],L=[],T=[],P=j.RabbitLegacy=B.extend({_doReset:function(){var Y=this._key.words,oe=this.cfg.iv,X=this._X=[Y[0],Y[3]<<16|Y[2]>>>16,Y[1],Y[0]<<16|Y[3]>>>16,Y[2],Y[1]<<16|Y[0]>>>16,Y[3],Y[2]<<16|Y[1]>>>16],ae=this._C=[Y[2]<<16|Y[2]>>>16,4294901760&Y[0]|65535&Y[1],Y[3]<<16|Y[3]>>>16,4294901760&Y[1]|65535&Y[2],Y[0]<<16|Y[0]>>>16,4294901760&Y[2]|65535&Y[3],Y[1]<<16|Y[1]>>>16,4294901760&Y[3]|65535&Y[0]];this._b=0;for(var fe=0;fe<4;fe++)Q.call(this);for(fe=0;fe<8;fe++)ae[fe]^=X[fe+4&7];if(oe){var le=oe.words,ce=le[0],J=le[1],re=16711935&(ce<<8|ce>>>24)|4278255360&(ce<<24|ce>>>8),de=16711935&(J<<8|J>>>24)|4278255360&(J<<24|J>>>8),Oe=re>>>16|4294901760&de,ve=de<<16|65535&re;for(ae[0]^=re,ae[1]^=Oe,ae[2]^=de,ae[3]^=ve,ae[4]^=re,ae[5]^=Oe,ae[6]^=de,ae[7]^=ve,fe=0;fe<4;fe++)Q.call(this)}},_doProcessBlock:function(Y,oe){var X=this._X;Q.call(this),G[0]=X[0]^X[5]>>>16^X[3]<<16,G[1]=X[2]^X[7]>>>16^X[5]<<16,G[2]=X[4]^X[1]>>>16^X[7]<<16,G[3]=X[6]^X[3]>>>16^X[1]<<16;for(var ae=0;ae<4;ae++)G[ae]=16711935&(G[ae]<<8|G[ae]>>>24)|4278255360&(G[ae]<<24|G[ae]>>>8),Y[oe+ae]^=G[ae]},blockSize:4,ivSize:2});function Q(){for(var Y=this._X,oe=this._C,X=0;X<8;X++)L[X]=oe[X];for(oe[0]=oe[0]+1295307597+this._b|0,oe[1]=oe[1]+3545052371+(oe[0]>>>0<L[0]>>>0?1:0)|0,oe[2]=oe[2]+886263092+(oe[1]>>>0<L[1]>>>0?1:0)|0,oe[3]=oe[3]+1295307597+(oe[2]>>>0<L[2]>>>0?1:0)|0,oe[4]=oe[4]+3545052371+(oe[3]>>>0<L[3]>>>0?1:0)|0,oe[5]=oe[5]+886263092+(oe[4]>>>0<L[4]>>>0?1:0)|0,oe[6]=oe[6]+1295307597+(oe[5]>>>0<L[5]>>>0?1:0)|0,oe[7]=oe[7]+3545052371+(oe[6]>>>0<L[6]>>>0?1:0)|0,this._b=oe[7]>>>0<L[7]>>>0?1:0,X=0;X<8;X++){var ae=Y[X]+oe[X],fe=65535&ae,le=ae>>>16,ce=((fe*fe>>>17)+fe*le>>>15)+le*le,J=((4294901760&ae)*ae|0)+((65535&ae)*ae|0);T[X]=ce^J}Y[0]=T[0]+(T[7]<<16|T[7]>>>16)+(T[6]<<16|T[6]>>>16)|0,Y[1]=T[1]+(T[0]<<8|T[0]>>>24)+T[7]|0,Y[2]=T[2]+(T[1]<<16|T[1]>>>16)+(T[0]<<16|T[0]>>>16)|0,Y[3]=T[3]+(T[2]<<8|T[2]>>>24)+T[1]|0,Y[4]=T[4]+(T[3]<<16|T[3]>>>16)+(T[2]<<16|T[2]>>>16)|0,Y[5]=T[5]+(T[4]<<8|T[4]>>>24)+T[3]|0,Y[6]=T[6]+(T[5]<<16|T[5]>>>16)+(T[4]<<16|T[4]>>>16)|0,Y[7]=T[7]+(T[6]<<8|T[6]>>>24)+T[5]|0}x.RabbitLegacy=B._createHelper(P)}(),z.pad.ZeroPadding={pad:function(x,B){var j=4*B;x.clamp(),x.sigBytes+=j-(x.sigBytes%j||j)},unpad:function(x){var B=x.words,j=x.sigBytes-1;for(j=x.sigBytes-1;j>=0;j--)if(B[j>>>2]>>>24-j%4*8&255){x.sigBytes=j+1;break}}},z)});return function(){function D(w){n(this,D);var S=w.logger,R=w.isArray,A=w.isMap,N=w.isDevMode;this._isArray=R,this._isMap=A,this._isDevMode=N,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,R,A,N=f(w);try{for(N.s();!(A=N.n()).done;){var H=A.value,z=H.filterType,x=H.profanityType,B=H.profanity,j=H.replacement;S=this._getDecryptedString(B),R=this._getDecryptedString(j),z===1?x===1?this._interceptProfanityList.push(S):x===2&&this._interceptRegExpList.push(S):z===2&&(x===1?this._replacingProfanityMap.set(S,R):x===2&&this._replacingRegExpMap.set(S,R))}}catch(G){N.e(G)}finally{N.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 R=!1,A=0,N=this._interceptRegExpList.length;A<N;A++)if(new RegExp(this._interceptRegExpList[A],"g").test(w)){R=!0;break}if(R)return S.type=1,S;var H=this._replacingFilter.filter({text:w,replacingEnabled:!0});H.isMatched===!0&&(S.type=2,S.modifiedText=H.modifiedText);var z,x=S.modifiedText,B=null,j=f(this._replacingRegExpMap);try{for(j.s();!(z=j.n()).done;){var G=i(z.value,2),L=G[0],T=G[1];B=new RegExp(L,"g"),x=x.replace(B,T)}}catch(P){j.e(P)}finally{j.f()}return x!==w&&(S.type=2,S.modifiedText=x),S}},{key:"reset",value:function(){this._isArray=null,this._isMap=null,this._interceptProfanityList.length=0,this._interceptRegExpList.length=0,this._replacingProfanityMap.clear(),this._replacingRegExpMap.clear(),this._key="",this._iv="",this._decryptOptions={},this._interceptFilter&&this._interceptFilter.reset(),this._replacingFilter&&this._replacingFilter.reset()}}]),D}()})})(IP);var xfe=IP.exports;const Ufe=Vf(xfe);class Ffe{static init(t){}install(t){}getInstance(){}login(t){return new Promise((n,r)=>{})}destroyed(){}component(t,n){}use(t,n){}setAwaitFunc(t,n){}setCommonStore(t){}setComponentStore(t,n,r){}getStore(){}storeCommonListener(t,n){}}class Gfe{setCommonStore(t){}setComponentStore(t,n,r){}storeCommonListener(t,n){}}class $fe extends Gfe{constructor(){super();Jt(this,"store");Jt(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 TD=e=>typeof e=="function",Rr=class Rr extends Ffe{constructor(n){super();Jt(this,"isOfficial",!1);Jt(this,"isIntl",!1);Jt(this,"tim");Jt(this,"TIM");Jt(this,"isSDKReady",!1);Jt(this,"store");Jt(this,"TUIEnv");Jt(this,"SDKAppID");Jt(this,"installedPlugins",new Set);Jt(this,"config",{});Jt(this,"TUIServer");Jt(this,"TUIComponents",new Set);Jt(this,"loginResolveRejectCache");this.loginResolveRejectCache=[],this.SDKAppID=n.SDKAppID,this.TUIServer={},this.store=new $fe,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":Pfe}),this.tim.registerPlugin({"tim-profanity-filter-plugin":Ufe}),this.bindTIMEvent(),this.TUIEnv=jh(),this.isOfficial=this.SDKAppID===1400187352||this.SDKAppID===1400188366}static init(n){return Rr.instance||(Rr.instance=new Rr(n)),jh(),window.TUIKitTUICore=Rr.instance,Rr.instance.use(K7),Rr.instance.use(LM),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)}),y$(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;o<r.length;o++){const i=(n==null?void 0:n.get(r[o]))||[];i.length>0&&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&&TD(n==null?void 0:n.plugin)?(this.installedPlugins.add(n),n==null||n.plugin(o,r)):TD(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)}};Jt(Rr,"instance"),Jt(Rr,"isLogin",!1),Jt(Rr,"TUIServerFunMap");let bI=Rr;var Uf=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},ya=[],_s=[],Bfe=typeof Uint8Array<"u"?Uint8Array:Array,PT=!1;function CP(){PT=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)ya[t]=e[t],_s[e.charCodeAt(t)]=t;_s["-".charCodeAt(0)]=62,_s["_".charCodeAt(0)]=63}function Hfe(e,t,n){for(var r,o,i=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],i.push(ya[(o=r)>>18&63]+ya[o>>12&63]+ya[o>>6&63]+ya[63&o]);return i.join("")}function wD(e){var t;PT||CP();for(var n=e.length,r=n%3,o="",i=[],s=0,u=n-r;s<u;s+=16383)i.push(Hfe(e,s,s+16383>u?u:s+16383));return r===1?(t=e[n-1],o+=ya[t>>2],o+=ya[t<<4&63],o+="=="):r===2&&(t=(e[n-2]<<8)+e[n-1],o+=ya[t>>10],o+=ya[t>>4&63],o+=ya[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<<u)-1,f=d>>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 TP(e,t,n,r,o,i){var s,u,d,f=8*i-o-1,g=(1<<f)-1,v=g>>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<<o|u,f+=o;f>0;e[n+M]=255&s,M+=C,s/=256,f-=8);e[n+M-C]|=128*D}var qfe={}.toString,wP=Array.isArray||function(e){return qfe.call(e)=="[object Array]"};function MI(){return Xe.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function sl(e,t){if(MI()<t)throw new RangeError("Invalid typed array length");return Xe.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Xe.prototype:(e===null&&(e=new Xe(t)),e.length=t),e}function Xe(e,t,n){if(!(Xe.TYPED_ARRAY_SUPPORT||this instanceof Xe))return new Xe(e,t,n);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return II(this,e)}return SP(this,e,t,n)}function SP(e,t,n,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?function(o,i,s,u){if(i.byteLength,s<0||i.byteLength<s)throw new RangeError("'offset' is out of bounds");if(i.byteLength<s+(u||0))throw new RangeError("'length' is out of bounds");return i=s===void 0&&u===void 0?new Uint8Array(i):u===void 0?new Uint8Array(i,s):new Uint8Array(i,s,u),Xe.TYPED_ARRAY_SUPPORT?(o=i).__proto__=Xe.prototype:o=Ib(o,i),o}(e,t,n,r):typeof t=="string"?function(o,i,s){if(typeof s=="string"&&s!==""||(s="utf8"),!Xe.isEncoding(s))throw new TypeError('"encoding" must be a valid string encoding');var u=0|DP(i,s),d=(o=sl(o,u)).write(i,s);return d!==u&&(o=o.slice(0,d)),o}(e,t,n):function(o,i){if(_a(i)){var s=0|xT(i.length);return(o=sl(o,s)).length===0||i.copy(o,0,0,s),o}if(i){if(typeof ArrayBuffer<"u"&&i.buffer instanceof ArrayBuffer||"length"in i)return typeof i.length!="number"||(u=i.length)!=u?sl(o,0):Ib(o,i);if(i.type==="Buffer"&&wP(i.data))return Ib(o,i.data)}var u;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function kP(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function II(e,t){if(kP(t),e=sl(e,t<0?0:0|xT(t)),!Xe.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Ib(e,t){var n=t.length<0?0:0|xT(t.length);e=sl(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function xT(e){if(e>=MI())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+MI().toString(16)+" bytes");return 0|e}function _a(e){return!(e==null||!e._isBuffer)}function DP(e,t){if(_a(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 ay(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return OP(e).length;default:if(r)return ay(e).length;t=(""+t).toLowerCase(),r=!0}}function Vfe(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 Qfe(this,t,n);case"utf8":case"utf-8":return AP(this,t,n);case"ascii":return Xfe(this,t,n);case"latin1":case"binary":return Zfe(this,t,n);case"base64":return Jfe(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return epe(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Xu(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function SD(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)),_a(t))return t.length===0?-1:kD(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):kD(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function kD(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;i<u;i++)if(f(e,i)===f(t,g===-1?0:i-g)){if(g===-1&&(g=i),i-g+1===d)return g*s}else g!==-1&&(i-=i-g),g=-1}else for(n+d>u&&(n=u-d),i=n;i>=0;i--){for(var v=!0,_=0;_<d;_++)if(f(e,i+_)!==f(t,_)){v=!1;break}if(v)return i}return-1}function zfe(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>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<r;++s){var u=parseInt(t.substr(2*s,2),16);if(isNaN(u))return s;e[n+s]=u}return s}function jfe(e,t,n,r){return c0(ay(t,e.length-n),e,n,r)}function EP(e,t,n,r){return c0(function(o){for(var i=[],s=0;s<o.length;++s)i.push(255&o.charCodeAt(s));return i}(t),e,n,r)}function Wfe(e,t,n,r){return EP(e,t,n,r)}function Kfe(e,t,n,r){return c0(OP(t),e,n,r)}function Yfe(e,t,n,r){return c0(function(o,i){for(var s,u,d,f=[],g=0;g<o.length&&!((i-=2)<0);++g)s=o.charCodeAt(g),u=s>>8,d=s%256,f.push(d),f.push(u);return f}(t,e.length-n),e,n,r)}function Jfe(e,t,n){return t===0&&n===e.length?wD(e):wD(e.slice(t,n))}function AP(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,s,u,d,f=e[o],g=null,v=f>239?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<=DD)return String.fromCharCode.apply(String,_);for(var C="",D=0;D<M;)C+=String.fromCharCode.apply(String,_.slice(D,D+=DD));return C}(r)}Xe.TYPED_ARRAY_SUPPORT=Uf.TYPED_ARRAY_SUPPORT===void 0||Uf.TYPED_ARRAY_SUPPORT,Xe.poolSize=8192,Xe._augment=function(e){return e.__proto__=Xe.prototype,e},Xe.from=function(e,t,n){return SP(null,e,t,n)},Xe.TYPED_ARRAY_SUPPORT&&(Xe.prototype.__proto__=Uint8Array.prototype,Xe.__proto__=Uint8Array),Xe.alloc=function(e,t,n){return function(r,o,i,s){return kP(o),o<=0?sl(r,o):i!==void 0?typeof s=="string"?sl(r,o).fill(i,s):sl(r,o).fill(i):sl(r,o)}(null,e,t,n)},Xe.allocUnsafe=function(e){return II(null,e)},Xe.allocUnsafeSlow=function(e){return II(null,e)},Xe.isBuffer=bg,Xe.compare=function(e,t){if(!_a(e)||!_a(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},Xe.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Xe.concat=function(e,t){if(!wP(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Xe.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Xe.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var i=e[n];if(!_a(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o),o+=i.length}return r},Xe.byteLength=DP,Xe.prototype._isBuffer=!0,Xe.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Xu(this,t,t+1);return this},Xe.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Xu(this,t,t+3),Xu(this,t+1,t+2);return this},Xe.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Xu(this,t,t+7),Xu(this,t+1,t+6),Xu(this,t+2,t+5),Xu(this,t+3,t+4);return this},Xe.prototype.toString=function(){var e=0|this.length;return e===0?"":arguments.length===0?AP(this,0,e):Vfe.apply(this,arguments)},Xe.prototype.equals=function(e){if(!_a(e))throw new TypeError("Argument must be a Buffer");return this===e||Xe.compare(this,e)===0},Xe.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Xe.prototype.compare=function(e,t,n,r,o){if(!_a(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;g<u;++g)if(d[g]!==f[g]){i=d[g],s=f[g];break}return i<s?-1:s<i?1:0},Xe.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},Xe.prototype.indexOf=function(e,t,n){return SD(this,e,t,n,!0)},Xe.prototype.lastIndexOf=function(e,t,n){return SD(this,e,t,n,!1)},Xe.prototype.write=function(e,t,n,r){if(t===void 0)r="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,r===void 0&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((n===void 0||n>o)&&(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 zfe(this,e,t,n);case"utf8":case"utf-8":return jfe(this,e,t,n);case"ascii":return EP(this,e,t,n);case"latin1":case"binary":return Wfe(this,e,t,n);case"base64":return Kfe(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yfe(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 DD=4096;function Xfe(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function Zfe(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function Qfe(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=npe(e[i]);return o}function epe(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function wo(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function Gi(e,t,n,r,o,i){if(!_a(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.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<i;++o)e[n+o]=(t&255<<8*(r?o:1-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<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function LP(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 ED(e,t,n,r,o){return o||LP(e,0,n,4),TP(e,t,n,r,23,4),n+4}function AD(e,t,n,r,o){return o||LP(e,0,n,8),TP(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),t<e&&(t=e),Xe.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Xe.prototype;else{var o=t-e;n=new Xe(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},Xe.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||wo(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},Xe.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||wo(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},Xe.prototype.readUInt8=function(e,t){return t||wo(e,1,this.length),this[e]},Xe.prototype.readUInt16LE=function(e,t){return t||wo(e,2,this.length),this[e]|this[e+1]<<8},Xe.prototype.readUInt16BE=function(e,t){return t||wo(e,2,this.length),this[e]<<8|this[e+1]},Xe.prototype.readUInt32LE=function(e,t){return t||wo(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||wo(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||wo(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},Xe.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||wo(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||wo(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Xe.prototype.readInt16LE=function(e,t){t||wo(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||wo(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||wo(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||wo(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||wo(e,4,this.length),Em(this,e,!0,23,4)},Xe.prototype.readFloatBE=function(e,t){return t||wo(e,4,this.length),Em(this,e,!1,23,4)},Xe.prototype.readDoubleLE=function(e,t){return t||wo(e,8,this.length),Em(this,e,!0,52,8)},Xe.prototype.readDoubleBE=function(e,t){return t||wo(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||Gi(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},Xe.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||Gi(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=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||Gi(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||Gi(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||Gi(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||Gi(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||Gi(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);Gi(this,e,t,n,o-1,-o)}var i=0,s=1,u=0;for(this[t]=255&e;++i<n&&(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.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);Gi(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||Gi(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||Gi(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||Gi(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||Gi(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||Gi(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 ED(this,e,t,!0,n)},Xe.prototype.writeFloatBE=function(e,t,n){return ED(this,e,t,!1,n)},Xe.prototype.writeDoubleLE=function(e,t,n){return AD(this,e,t,!0,n)},Xe.prototype.writeDoubleBE=function(e,t,n){return AD(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<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=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<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!Xe.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},Xe.prototype.fill=function(e,t,n,r){if(typeof e=="string"){if(typeof t=="string"?(r=t,t=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!Xe.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else typeof e=="number"&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=n===void 0?this.length:n>>>0,e||(e=0),typeof e=="number")for(i=t;i<n;++i)this[i]=e;else{var s=_a(e)?e:ay(new Xe(e,r).toString()),u=s.length;for(i=0;i<n-t;++i)this[i+t]=s[i%u]}return this};var tpe=/[^+\/0-9A-Za-z-_]/g;function npe(e){return e<16?"0"+e.toString(16):e.toString(16)}function ay(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&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 OP(e){return function(t){var n,r,o,i,s,u;PT||CP();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 Bfe(3*d/4-s),o=s>0?d-4:d;var f=0;for(n=0,r=0;n<o;n+=4,r+=3)i=_s[t.charCodeAt(n)]<<18|_s[t.charCodeAt(n+1)]<<12|_s[t.charCodeAt(n+2)]<<6|_s[t.charCodeAt(n+3)],u[f++]=i>>16&255,u[f++]=i>>8&255,u[f++]=255&i;return s===2?(i=_s[t.charCodeAt(n)]<<2|_s[t.charCodeAt(n+1)]>>4,u[f++]=255&i):s===1&&(i=_s[t.charCodeAt(n)]<<10|_s[t.charCodeAt(n+1)]<<4|_s[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(tpe,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(e))}function c0(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function bg(e){return e!=null&&(!!e._isBuffer||LD(e)||function(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&LD(t.slice(0,0))}(e))}function LD(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 R;return w.prototype=S,R=new w,w.prototype=null,R}}(),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,R=w.words,A=this.sigBytes,N=w.sigBytes;if(this.clamp(),A%4)for(var H=0;H<N;H++){var z=R[H>>>2]>>>24-H%4*8&255;S[A+H>>>2]|=z<<24-(A+H)%4*8}else for(var H=0;H<N;H+=4)S[A+H>>>2]=R[H>>>2];return this.sigBytes+=N,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,R=[],A=function(x){var x=x,B=987654321,j=4294967295;return function(){var G=((B=36969*(65535&B)+(B>>16)&j)<<16)+(x=18e3*(65535&x)+(x>>16)&j)&j;return G/=4294967296,(G+=.5)*(r.random()>.5?1:-1)}},N=0;N<w;N+=4){var H=A(4294967296*(S||r.random()));S=987654071*H(),R.push(4294967296*H()|0)}return new f.init(R,w)}}),g=s.enc={},v=g.Hex={stringify:function(w){for(var S=w.words,R=w.sigBytes,A=[],N=0;N<R;N++){var H=S[N>>>2]>>>24-N%4*8&255;A.push((H>>>4).toString(16)),A.push((15&H).toString(16))}return A.join("")},parse:function(w){for(var S=w.length,R=[],A=0;A<S;A+=2)R[A>>>3]|=parseInt(w.substr(A,2),16)<<24-A%8*4;return new f.init(R,S/2)}},_=g.Latin1={stringify:function(w){for(var S=w.words,R=w.sigBytes,A=[],N=0;N<R;N++){var H=S[N>>>2]>>>24-N%4*8&255;A.push(String.fromCharCode(H))}return A.join("")},parse:function(w){for(var S=w.length,R=[],A=0;A<S;A++)R[A>>>2]|=(255&w.charCodeAt(A))<<24-A%4*8;return new f.init(R,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,R=S.words,A=S.sigBytes,N=this.blockSize,H=4*N,z=A/H,x=(z=w?r.ceil(z):r.max((0|z)-this._minBufferSize,0))*N,B=r.min(4*x,A);if(x){for(var j=0;j<x;j+=N)this._doProcessBlock(R,j);var G=R.splice(0,x);S.sigBytes-=B}return new f.init(G,B)},clone:function(){var w=d.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0}),D=(u.Hasher=C.extend({cfg:d.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){C.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var S=this._doFinalize();return S},blockSize:16,_createHelper:function(w){return function(S,R){return new w.init(R).finalize(S)}},_createHmacHelper:function(w){return function(S,R){return new D.HMAC.init(w,R).finalize(S)}}}),s.algo={});return s}(Math),n)}),OD=(Fn(function(e,t){var n,r,o,i,s,u;e.exports=(o=(r=n=zn).lib,i=o.Base,s=o.WordArray,(u=r.x64={}).Word=i.extend({init:function(d,f){this.high=d,this.low=f}}),u.WordArray=i.extend({init:function(d,f){d=this.words=d||[],this.sigBytes=f??8*d.length},toX32:function(){for(var d=this.words,f=d.length,g=[],v=0;v<f;v++){var _=d[v];g.push(_.high),g.push(_.low)}return s.create(g,this.sigBytes)},clone:function(){for(var d=i.clone.call(this),f=d.words=this.words.slice(0),g=f.length,v=0;v<g;v++)f[v]=f[v].clone();return d}}),n)}),Fn(function(e,t){var n;e.exports=(n=zn,function(){if(typeof ArrayBuffer=="function"){var r=n.lib.WordArray,o=r.init;(r.init=function(i){if(i instanceof ArrayBuffer&&(i=new Uint8Array(i)),(i instanceof Int8Array||typeof Uint8ClampedArray<"u"&&i instanceof Uint8ClampedArray||i instanceof Int16Array||i instanceof Uint16Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Float32Array||i instanceof Float64Array)&&(i=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)),i instanceof Uint8Array){for(var s=i.byteLength,u=[],d=0;d<s;d++)u[d>>>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<f;v+=2){var _=d[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<d;g++)f[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<f;v+=2){var _=s(d[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<d;g++)f[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<u;g+=3)for(var v=(s[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*_<u;_++)f.push(d.charAt(v>>>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<u.length;f++)d[u.charCodeAt(f)]=f}var g=u.charAt(64);if(g){var v=i.indexOf(g);v!==-1&&(s=v)}return function(_,M,C){for(var D=[],w=0,S=0;S<M;S++)if(S%4){var R=C[_.charCodeAt(S-1)]<<S%4*2,A=C[_.charCodeAt(S)]>>>6-S%4*2;D[w>>>2]|=(R|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 R=w+S,A=D[R];D[R]=16711935&(A<<8|A>>>24)|4278255360&(A<<24|A>>>8)}var N=this._hash.words,H=D[w+0],z=D[w+1],x=D[w+2],B=D[w+3],j=D[w+4],G=D[w+5],L=D[w+6],T=D[w+7],P=D[w+8],Q=D[w+9],Y=D[w+10],oe=D[w+11],X=D[w+12],ae=D[w+13],fe=D[w+14],le=D[w+15],ce=N[0],J=N[1],re=N[2],de=N[3];ce=v(ce,J,re,de,H,7,f[0]),de=v(de,ce,J,re,z,12,f[1]),re=v(re,de,ce,J,x,17,f[2]),J=v(J,re,de,ce,B,22,f[3]),ce=v(ce,J,re,de,j,7,f[4]),de=v(de,ce,J,re,G,12,f[5]),re=v(re,de,ce,J,L,17,f[6]),J=v(J,re,de,ce,T,22,f[7]),ce=v(ce,J,re,de,P,7,f[8]),de=v(de,ce,J,re,Q,12,f[9]),re=v(re,de,ce,J,Y,17,f[10]),J=v(J,re,de,ce,oe,22,f[11]),ce=v(ce,J,re,de,X,7,f[12]),de=v(de,ce,J,re,ae,12,f[13]),re=v(re,de,ce,J,fe,17,f[14]),ce=_(ce,J=v(J,re,de,ce,le,22,f[15]),re,de,z,5,f[16]),de=_(de,ce,J,re,L,9,f[17]),re=_(re,de,ce,J,oe,14,f[18]),J=_(J,re,de,ce,H,20,f[19]),ce=_(ce,J,re,de,G,5,f[20]),de=_(de,ce,J,re,Y,9,f[21]),re=_(re,de,ce,J,le,14,f[22]),J=_(J,re,de,ce,j,20,f[23]),ce=_(ce,J,re,de,Q,5,f[24]),de=_(de,ce,J,re,fe,9,f[25]),re=_(re,de,ce,J,B,14,f[26]),J=_(J,re,de,ce,P,20,f[27]),ce=_(ce,J,re,de,ae,5,f[28]),de=_(de,ce,J,re,x,9,f[29]),re=_(re,de,ce,J,T,14,f[30]),ce=M(ce,J=_(J,re,de,ce,X,20,f[31]),re,de,G,4,f[32]),de=M(de,ce,J,re,P,11,f[33]),re=M(re,de,ce,J,oe,16,f[34]),J=M(J,re,de,ce,fe,23,f[35]),ce=M(ce,J,re,de,z,4,f[36]),de=M(de,ce,J,re,j,11,f[37]),re=M(re,de,ce,J,T,16,f[38]),J=M(J,re,de,ce,Y,23,f[39]),ce=M(ce,J,re,de,ae,4,f[40]),de=M(de,ce,J,re,H,11,f[41]),re=M(re,de,ce,J,B,16,f[42]),J=M(J,re,de,ce,L,23,f[43]),ce=M(ce,J,re,de,Q,4,f[44]),de=M(de,ce,J,re,X,11,f[45]),re=M(re,de,ce,J,le,16,f[46]),ce=C(ce,J=M(J,re,de,ce,x,23,f[47]),re,de,H,6,f[48]),de=C(de,ce,J,re,T,10,f[49]),re=C(re,de,ce,J,fe,15,f[50]),J=C(J,re,de,ce,G,21,f[51]),ce=C(ce,J,re,de,X,6,f[52]),de=C(de,ce,J,re,B,10,f[53]),re=C(re,de,ce,J,Y,15,f[54]),J=C(J,re,de,ce,z,21,f[55]),ce=C(ce,J,re,de,P,6,f[56]),de=C(de,ce,J,re,le,10,f[57]),re=C(re,de,ce,J,L,15,f[58]),J=C(J,re,de,ce,ae,21,f[59]),ce=C(ce,J,re,de,j,6,f[60]),de=C(de,ce,J,re,oe,10,f[61]),re=C(re,de,ce,J,x,15,f[62]),J=C(J,re,de,ce,Q,21,f[63]),N[0]=N[0]+ce|0,N[1]=N[1]+J|0,N[2]=N[2]+re|0,N[3]=N[3]+de|0},_doFinalize:function(){var D=this._data,w=D.words,S=8*this._nDataBytes,R=8*D.sigBytes;w[R>>>5]|=128<<24-R%32;var A=r.floor(S/4294967296),N=S;w[15+(R+64>>>9<<4)]=16711935&(A<<8|A>>>24)|4278255360&(A<<24|A>>>8),w[14+(R+64>>>9<<4)]=16711935&(N<<8|N>>>24)|4278255360&(N<<24|N>>>8),D.sigBytes=4*(w.length+1),this._process();for(var H=this._hash,z=H.words,x=0;x<4;x++){var B=z[x];z[x]=16711935&(B<<8|B>>>24)|4278255360&(B<<24|B>>>8)}return H},clone:function(){var D=u.clone.call(this);return D._hash=this._hash.clone(),D}});function v(D,w,S,R,A,N,H){var z=D+(w&S|~w&R)+A+H;return(z<<N|z>>>32-N)+w}function _(D,w,S,R,A,N,H){var z=D+(w&R|S&~R)+A+H;return(z<<N|z>>>32-N)+w}function M(D,w,S,R,A,N,H){var z=D+(w^S^R)+A+H;return(z<<N|z>>>32-N)+w}function C(D,w,S,R,A,N,H){var z=D+(S^(w|~R))+A+H;return(z<<N|z>>>32-N)+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],R=0;R<80;R++){if(R<16)d[R]=0|g[v+R];else{var A=d[R-3]^d[R-8]^d[R-14]^d[R-16];d[R]=A<<1|A>>>31}var N=(M<<5|M>>>27)+S+d[R];N+=R<20?1518500249+(C&D|~C&w):R<40?1859775393+(C^D^w):R<60?(C&D|C&w|D&w)-1894007588:(C^D^w)-899497514,S=w,w=D,D=C<<30|C>>>2,C=M,M=N}_[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 R=r.sqrt(S),A=2;A<=R;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],R=D[2],A=D[3],N=D[4],H=D[5],z=D[6],x=D[7],B=0;B<64;B++){if(B<16)v[B]=0|M[C+B];else{var j=v[B-15],G=(j<<25|j>>>7)^(j<<14|j>>>18)^j>>>3,L=v[B-2],T=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;v[B]=G+v[B-7]+T+v[B-16]}var P=w&S^w&R^S&R,Q=(w<<30|w>>>2)^(w<<19|w>>>13)^(w<<10|w>>>22),Y=x+((N<<26|N>>>6)^(N<<21|N>>>11)^(N<<7|N>>>25))+(N&H^~N&z)+g[B]+v[B];x=z,z=H,H=N,N=A+Y|0,A=R,R=S,S=w,w=Y+(Q+P)|0}D[0]=D[0]+w|0,D[1]=D[1]+S|0,D[2]=D[2]+R|0,D[3]=D[3]+A|0,D[4]=D[4]+N|0,D[5]=D[5]+H|0,D[6]=D[6]+z|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],R=D[2],A=D[3],N=D[4],H=D[5],z=D[6],x=D[7],B=w.high,j=w.low,G=S.high,L=S.low,T=R.high,P=R.low,Q=A.high,Y=A.low,oe=N.high,X=N.low,ae=H.high,fe=H.low,le=z.high,ce=z.low,J=x.high,re=x.low,de=B,Oe=j,ve=G,Me=L,K=T,me=P,ke=Q,pe=Y,W=oe,te=X,ie=ae,Ie=fe,ue=le,Se=ce,Pe=J,xe=re,He=0;He<80;He++){var Te=v[He];if(He<16)var V=Te.high=0|M[C+2*He],ne=Te.low=0|M[C+2*He+1];else{var ye=v[He-15],Be=ye.high,je=ye.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),st=v[He-2],wt=st.high,mn=st.low,In=(wt>>>19|mn<<13)^(wt<<3|mn>>>29)^wt>>>6,Cn=(mn>>>19|wt<<13)^(mn<<3|wt>>>29)^(mn>>>6|wt<<26),En=v[He-7],vn=En.high,Qe=En.low,yt=v[He-16],Pt=yt.high,ln=yt.low;V=(V=(V=lt+vn+((ne=Fe+Qe)>>>0<Fe>>>0?1:0))+In+((ne+=Cn)>>>0<Cn>>>0?1:0))+Pt+((ne+=ln)>>>0<ln>>>0?1:0),Te.high=V,Te.low=ne}var en,Tn=W&ie^~W&ue,qn=te&Ie^~te&Se,ze=de&ve^de&K^ve&K,St=Oe&Me^Oe&me^Me&me,_t=(de>>>28|Oe<<4)^(de<<30|Oe>>>2)^(de<<25|Oe>>>7),Ht=(Oe>>>28|de<<4)^(Oe<<30|de>>>2)^(Oe<<25|de>>>7),Yt=(W>>>14|te<<18)^(W>>>18|te<<14)^(W<<23|te>>>9),yr=(te>>>14|W<<18)^(te>>>18|W<<14)^(te<<23|W>>>9),Cr=g[He],Zo=Cr.high,ho=Cr.low,$e=Pe+Yt+((en=xe+yr)>>>0<xe>>>0?1:0),Ze=Ht+St;Pe=ue,xe=Se,ue=ie,Se=Ie,ie=W,Ie=te,W=ke+($e=($e=($e=$e+Tn+((en+=qn)>>>0<qn>>>0?1:0))+Zo+((en+=ho)>>>0<ho>>>0?1:0))+V+((en+=ne)>>>0<ne>>>0?1:0))+((te=pe+en|0)>>>0<pe>>>0?1:0)|0,ke=K,pe=me,K=ve,me=Me,ve=de,Me=Oe,de=$e+(_t+ze+(Ze>>>0<Ht>>>0?1:0))+((Oe=en+Ze|0)>>>0<en>>>0?1:0)|0}j=w.low=j+Oe,w.high=B+de+(j>>>0<Oe>>>0?1:0),L=S.low=L+Me,S.high=G+ve+(L>>>0<Me>>>0?1:0),P=R.low=P+me,R.high=T+K+(P>>>0<me>>>0?1:0),Y=A.low=Y+pe,A.high=Q+ke+(Y>>>0<pe>>>0?1:0),X=N.low=X+te,N.high=oe+W+(X>>>0<te>>>0?1:0),fe=H.low=fe+Ie,H.high=ae+ie+(fe>>>0<Ie>>>0?1:0),ce=z.low=ce+Se,z.high=le+ue+(ce>>>0<Se>>>0?1:0),re=x.low=re+xe,x.high=J+Pe+(re>>>0<xe>>>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 R=(2*D+3*w)%5;D=w%5,w=R}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,N=0;N<24;N++){for(var H=0,z=0,x=0;x<7;x++){if(1&A){var B=(1<<x)-1;B<32?z^=1<<B:H^=1<<B-32}128&A?A=A<<1^113:A<<=1}_[N]=d.create(H,z)}})();var M=[];(function(){for(var D=0;D<25;D++)M[D]=d.create()})();var C=f.SHA3=u.extend({cfg:u.cfg.extend({outputLength:512}),_doReset:function(){for(var D=this._state=[],w=0;w<25;w++)D[w]=new d.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(D,w){for(var S=this._state,R=this.blockSize/2,A=0;A<R;A++){var N=D[w+2*A],H=D[w+2*A+1];N=16711935&(N<<8|N>>>24)|4278255360&(N<<24|N>>>8),H=16711935&(H<<8|H>>>24)|4278255360&(H<<24|H>>>8),(re=S[A]).high^=H,re.low^=N}for(var z=0;z<24;z++){for(var x=0;x<5;x++){for(var B=0,j=0,G=0;G<5;G++)B^=(re=S[x+5*G]).high,j^=re.low;var L=M[x];L.high=B,L.low=j}for(x=0;x<5;x++){var T=M[(x+4)%5],P=M[(x+1)%5],Q=P.high,Y=P.low;for(B=T.high^(Q<<1|Y>>>31),j=T.low^(Y<<1|Q>>>31),G=0;G<5;G++)(re=S[x+5*G]).high^=B,re.low^=j}for(var oe=1;oe<25;oe++){var X=(re=S[oe]).high,ae=re.low,fe=g[oe];fe<32?(B=X<<fe|ae>>>32-fe,j=ae<<fe|X>>>32-fe):(B=ae<<fe-32|X>>>64-fe,j=X<<fe-32|ae>>>64-fe);var le=M[v[oe]];le.high=B,le.low=j}var ce=M[0],J=S[0];for(ce.high=J.high,ce.low=J.low,x=0;x<5;x++)for(G=0;G<5;G++){var re=S[oe=x+5*G],de=M[oe],Oe=M[(x+1)%5+5*G],ve=M[(x+2)%5+5*G];re.high=de.high^~Oe.high&ve.high,re.low=de.low^~Oe.low&ve.low}re=S[0];var Me=_[z];re.high^=Me.high,re.low^=Me.low}},_doFinalize:function(){var D=this._data,w=D.words,S=(this._nDataBytes,8*D.sigBytes),R=32*this.blockSize;w[S>>>5]|=1<<24-S%32,w[(r.ceil((S+1)/R)*R>>>5)-1]|=128,D.sigBytes=4*w.length,this._process();for(var A=this._state,N=this.cfg.outputLength/8,H=N/8,z=[],x=0;x<H;x++){var B=A[x],j=B.high,G=B.low;j=16711935&(j<<8|j>>>24)|4278255360&(j<<24|j>>>8),G=16711935&(G<<8|G>>>24)|4278255360&(G<<24|G>>>8),z.push(G),z.push(j)}return new s.init(z,N)},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(z,x){for(var B=0;B<16;B++){var j=x+B,G=z[j];z[j]=16711935&(G<<8|G>>>24)|4278255360&(G<<24|G>>>8)}var L,T,P,Q,Y,oe,X,ae,fe,le,ce,J=this._hash.words,re=M.words,de=C.words,Oe=f.words,ve=g.words,Me=v.words,K=_.words;for(oe=L=J[0],X=T=J[1],ae=P=J[2],fe=Q=J[3],le=Y=J[4],B=0;B<80;B+=1)ce=L+z[x+Oe[B]]|0,ce+=B<16?w(T,P,Q)+re[0]:B<32?S(T,P,Q)+re[1]:B<48?R(T,P,Q)+re[2]:B<64?A(T,P,Q)+re[3]:N(T,P,Q)+re[4],ce=(ce=H(ce|=0,Me[B]))+Y|0,L=Y,Y=Q,Q=H(P,10),P=T,T=ce,ce=oe+z[x+ve[B]]|0,ce+=B<16?N(X,ae,fe)+de[0]:B<32?A(X,ae,fe)+de[1]:B<48?R(X,ae,fe)+de[2]:B<64?S(X,ae,fe)+de[3]:w(X,ae,fe)+de[4],ce=(ce=H(ce|=0,K[B]))+le|0,oe=le,le=fe,fe=H(ae,10),ae=X,X=ce;ce=J[1]+P+fe|0,J[1]=J[2]+Q+le|0,J[2]=J[3]+Y+oe|0,J[3]=J[4]+L+X|0,J[4]=J[0]+T+ae|0,J[0]=ce},_doFinalize:function(){var z=this._data,x=z.words,B=8*this._nDataBytes,j=8*z.sigBytes;x[j>>>5]|=128<<24-j%32,x[14+(j+64>>>9<<4)]=16711935&(B<<8|B>>>24)|4278255360&(B<<24|B>>>8),z.sigBytes=4*(x.length+1),this._process();for(var G=this._hash,L=G.words,T=0;T<5;T++){var P=L[T];L[T]=16711935&(P<<8|P>>>24)|4278255360&(P<<24|P>>>8)}return G},clone:function(){var z=u.clone.call(this);return z._hash=this._hash.clone(),z}});function w(z,x,B){return z^x^B}function S(z,x,B){return z&x|~z&B}function R(z,x,B){return(z|~x)^B}function A(z,x,B){return z&B|x&~B}function N(z,x,B){return z^(x|~B)}function H(z,x){return z<<x|z>>>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<g;w++)C[w]^=1549556828,D[w]^=909522486;_.sigBytes=M.sigBytes=v,this.reset()},reset:function(){var d=this._hasher;d.reset(),d.update(this._iKey)},update:function(d){return this._hasher.update(d),this},finalize:function(d){var f=this._hasher,g=f.finalize(d);f.reset();var v=f.finalize(this._oKey.clone().concat(g));return v}})))}),Fn(function(e,t){var n,r,o,i,s,u,d,f,g;e.exports=(o=(r=n=zn).lib,i=o.Base,s=o.WordArray,u=r.algo,d=u.SHA1,f=u.HMAC,g=u.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:d,iterations:1}),init:function(v){this.cfg=this.cfg.extend(v)},compute:function(v,_){for(var M=this.cfg,C=f.create(M.hasher,v),D=s.create(),w=s.create([1]),S=D.words,R=w.words,A=M.keySize,N=M.iterations;S.length<A;){var H=C.update(_).finalize(w);C.reset();for(var z=H.words,x=z.length,B=H,j=1;j<N;j++){B=C.finalize(B),C.reset();for(var G=B.words,L=0;L<x;L++)z[L]^=G[L]}D.concat(H),R[0]++}return D.sigBytes=4*A,D}}),r.PBKDF2=function(v,_,M){return g.create(M).compute(v,_)},n.PBKDF2)}),Fn(function(e,t){var n,r,o,i,s,u,d,f;e.exports=(o=(r=n=zn).lib,i=o.Base,s=o.WordArray,u=r.algo,d=u.MD5,f=u.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:d,iterations:1}),init:function(g){this.cfg=this.cfg.extend(g)},compute:function(g,v){for(var _=this.cfg,M=_.hasher.create(),C=s.create(),D=C.words,w=_.keySize,S=_.iterations;D.length<w;){R&&M.update(R);var R=M.update(g).finalize(v);M.reset();for(var A=1;A<S;A++)R=M.finalize(R),M.reset();C.concat(R)}return C.sigBytes=4*w,C}}),r.EvpKDF=function(g,v,_){return f.create(_).compute(g,v)},n.EvpKDF)}),Fn(function(e,t){var n,r,o,i,s,u,d,f,g,v,_,M,C,D,w,S,R,A,N,H,z,x,B,j;e.exports=void((n=zn).lib.Cipher||(o=n,i=o.lib,s=i.Base,u=i.WordArray,d=i.BufferedBlockAlgorithm,f=o.enc,f.Utf8,g=f.Base64,v=o.algo,_=v.EvpKDF,M=i.Cipher=d.extend({cfg:s.extend(),createEncryptor:function(G,L){return this.create(this._ENC_XFORM_MODE,G,L)},createDecryptor:function(G,L){return this.create(this._DEC_XFORM_MODE,G,L)},init:function(G,L,T){this.cfg=this.cfg.extend(T),this._xformMode=G,this._key=L,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(G){return this._append(G),this._process()},finalize:function(G){G&&this._append(G);var L=this._doFinalize();return L},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function G(L){return typeof L=="string"?j:z}return function(L){return{encrypt:function(T,P,Q){return G(P).encrypt(L,T,P,Q)},decrypt:function(T,P,Q){return G(P).decrypt(L,T,P,Q)}}}}()}),i.StreamCipher=M.extend({_doFinalize:function(){var G=this._process(!0);return G},blockSize:1}),C=o.mode={},D=i.BlockCipherMode=s.extend({createEncryptor:function(G,L){return this.Encryptor.create(G,L)},createDecryptor:function(G,L){return this.Decryptor.create(G,L)},init:function(G,L){this._cipher=G,this._iv=L}}),w=C.CBC=function(){var G=D.extend();function L(T,P,Q){var Y=this._iv;if(Y){var oe=Y;this._iv=r}else var oe=this._prevBlock;for(var X=0;X<Q;X++)T[P+X]^=oe[X]}return G.Encryptor=G.extend({processBlock:function(T,P){var Q=this._cipher,Y=Q.blockSize;L.call(this,T,P,Y),Q.encryptBlock(T,P),this._prevBlock=T.slice(P,P+Y)}}),G.Decryptor=G.extend({processBlock:function(T,P){var Q=this._cipher,Y=Q.blockSize,oe=T.slice(P,P+Y);Q.decryptBlock(T,P),L.call(this,T,P,Y),this._prevBlock=oe}}),G}(),S=o.pad={},R=S.Pkcs7={pad:function(G,L){for(var T=4*L,P=T-G.sigBytes%T,Q=P<<24|P<<16|P<<8|P,Y=[],oe=0;oe<P;oe+=4)Y.push(Q);var X=u.create(Y,P);G.concat(X)},unpad:function(G){var L=255&G.words[G.sigBytes-1>>>2];G.sigBytes-=L}},i.BlockCipher=M.extend({cfg:M.cfg.extend({mode:w,padding:R}),reset:function(){M.reset.call(this);var G=this.cfg,L=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,L&&L.words):(this._mode=P.call(T,this,L&&L.words),this._mode.__creator=P)},_doProcessBlock:function(G,L){this._mode.processBlock(G,L)},_doFinalize:function(){var G=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){G.pad(this._data,this.blockSize);var L=this._process(!0)}else{var L=this._process(!0);G.unpad(L)}return L},blockSize:4}),A=i.CipherParams=s.extend({init:function(G){this.mixIn(G)},toString:function(G){return(G||this.formatter).stringify(this)}}),N=o.format={},H=N.OpenSSL={stringify:function(G){var L=G.ciphertext,T=G.salt;if(T)var P=u.create([1398893684,1701076831]).concat(T).concat(L);else var P=L;return P.toString(g)},parse:function(G){var L=g.parse(G),T=L.words;if(T[0]==1398893684&&T[1]==1701076831){var P=u.create(T.slice(2,4));T.splice(0,4),L.sigBytes-=16}return A.create({ciphertext:L,salt:P})}},z=i.SerializableCipher=s.extend({cfg:s.extend({format:H}),encrypt:function(G,L,T,P){P=this.cfg.extend(P);var Q=G.createEncryptor(T,P),Y=Q.finalize(L),oe=Q.cfg;return A.create({ciphertext:Y,key:T,iv:oe.iv,algorithm:G,mode:oe.mode,padding:oe.padding,blockSize:G.blockSize,formatter:P.format})},decrypt:function(G,L,T,P){P=this.cfg.extend(P),L=this._parse(L,P.format);var Q=G.createDecryptor(T,P).finalize(L.ciphertext);return Q},_parse:function(G,L){return typeof G=="string"?L.parse(G,this):G}}),x=o.kdf={},B=x.OpenSSL={execute:function(G,L,T,P){P||(P=u.random(8));var Q=_.create({keySize:L+T}).compute(G,P),Y=u.create(Q.words.slice(L),4*T);return Q.sigBytes=4*L,A.create({key:Q,iv:Y,salt:P})}},j=i.PasswordBasedCipher=z.extend({cfg:z.cfg.extend({kdf:B}),encrypt:function(G,L,T,P){var Q=(P=this.cfg.extend(P)).kdf.execute(T,G.keySize,G.ivSize);P.iv=Q.iv;var Y=z.encrypt.call(this,G,L,Q.key,P);return Y.mixIn(Q),Y},decrypt:function(G,L,T,P){P=this.cfg.extend(P),L=this._parse(L,P.format);var Q=P.kdf.execute(T,G.keySize,G.ivSize,L.salt);P.iv=Q.iv;var Y=z.decrypt.call(this,G,L,Q.key,P);return Y}})))}),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<u;v++)i[s+v]^=g[v]}return r.Encryptor=r.extend({processBlock:function(i,s){var u=this._cipher,d=u.blockSize;o.call(this,i,s,d,u),this._prevBlock=i.slice(s,s+d)}}),r.Decryptor=r.extend({processBlock:function(i,s){var u=this._cipher,d=u.blockSize,f=i.slice(s,s+d);o.call(this,i,s,d,u),this._prevBlock=f}}),r}(),n.mode.CFB)}),Fn(function(e,t){var n,r,o;e.exports=((n=zn).mode.CTR=(r=n.lib.BlockCipherMode.extend(),o=r.Encryptor=r.extend({processBlock:function(i,s){var u=this._cipher,d=u.blockSize,f=this._iv,g=this._counter;f&&(g=this._counter=f.slice(0),this._iv=void 0);var v=g.slice(0);u.encryptBlock(v,0),g[d-1]=g[d-1]+1|0;for(var _=0;_<d;_++)i[s+_]^=v[_]}}),r.Decryptor=o,r),n.mode.CTR)}),Fn(function(e,t){var n;e.exports=((n=zn).mode.CTRGladman=function(){var r=n.lib.BlockCipherMode.extend();function o(s){if((s>>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<f;M++)s[u+M]^=_[M]}});return r.Decryptor=i,r}(),n.mode.CTRGladman)}),Fn(function(e,t){var n,r,o;e.exports=((n=zn).mode.OFB=(r=n.lib.BlockCipherMode.extend(),o=r.Encryptor=r.extend({processBlock:function(i,s){var u=this._cipher,d=u.blockSize,f=this._iv,g=this._keystream;f&&(g=this._keystream=f.slice(0),this._iv=void 0),u.encryptBlock(g,0);for(var v=0;v<d;v++)i[s+v]^=g[v]}}),r.Decryptor=o,r),n.mode.OFB)}),Fn(function(e,t){var n,r;e.exports=((n=zn).mode.ECB=((r=n.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(o,i){this._cipher.encryptBlock(o,i)}}),r.Decryptor=r.extend({processBlock:function(o,i){this._cipher.decryptBlock(o,i)}}),r),n.mode.ECB)}),Fn(function(e,t){var n;e.exports=((n=zn).pad.AnsiX923={pad:function(r,o){var i=r.sigBytes,s=4*o,u=s-i%s,d=i+u-1;r.clamp(),r.words[d>>>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 R=[],A=0;A<256;A++)R[A]=A<128?A<<1:A<<1^283;var N=0,H=0;for(A=0;A<256;A++){var z=H^H<<1^H<<2^H<<3^H<<4;z=z>>>8^255&z^99,s[N]=z,u[z]=N;var x=R[N],B=R[x],j=R[B],G=257*R[z]^16843008*z;d[N]=G<<24|G>>>8,f[N]=G<<16|G>>>16,g[N]=G<<8|G>>>24,v[N]=G,G=16843009*j^65537*B^257*x^16843008*N,_[z]=G<<24|G>>>8,M[z]=G<<16|G>>>16,C[z]=G<<8|G>>>24,D[z]=G,N?(N=x^R[R[R[j^x]]],H^=R[R[H]]):N=H=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 R=this._keyPriorReset=this._key,A=R.words,N=R.sigBytes/4,H=4*((this._nRounds=N+6)+1),z=this._keySchedule=[],x=0;x<H;x++)if(x<N)z[x]=A[x];else{var B=z[x-1];x%N?N>6&&x%N==4&&(B=s[B>>>24]<<24|s[B>>>16&255]<<16|s[B>>>8&255]<<8|s[255&B]):(B=s[(B=B<<8|B>>>24)>>>24]<<24|s[B>>>16&255]<<16|s[B>>>8&255]<<8|s[255&B],B^=w[x/N|0]<<24),z[x]=z[x-N]^B}for(var j=this._invKeySchedule=[],G=0;G<H;G++)x=H-G,B=G%4?z[x]:z[x-4],j[G]=G<4||x<=4?B:_[s[B>>>24]]^M[s[B>>>16&255]]^C[s[B>>>8&255]]^D[s[255&B]]}},encryptBlock:function(R,A){this._doCryptBlock(R,A,this._keySchedule,d,f,g,v,s)},decryptBlock:function(R,A){var N=R[A+1];R[A+1]=R[A+3],R[A+3]=N,this._doCryptBlock(R,A,this._invKeySchedule,_,M,C,D,u),N=R[A+1],R[A+1]=R[A+3],R[A+3]=N},_doCryptBlock:function(R,A,N,H,z,x,B,j){for(var G=this._nRounds,L=R[A]^N[0],T=R[A+1]^N[1],P=R[A+2]^N[2],Q=R[A+3]^N[3],Y=4,oe=1;oe<G;oe++){var X=H[L>>>24]^z[T>>>16&255]^x[P>>>8&255]^B[255&Q]^N[Y++],ae=H[T>>>24]^z[P>>>16&255]^x[Q>>>8&255]^B[255&L]^N[Y++],fe=H[P>>>24]^z[Q>>>16&255]^x[L>>>8&255]^B[255&T]^N[Y++],le=H[Q>>>24]^z[L>>>16&255]^x[T>>>8&255]^B[255&P]^N[Y++];L=X,T=ae,P=fe,Q=le}X=(j[L>>>24]<<24|j[T>>>16&255]<<16|j[P>>>8&255]<<8|j[255&Q])^N[Y++],ae=(j[T>>>24]<<24|j[P>>>16&255]<<16|j[Q>>>8&255]<<8|j[255&L])^N[Y++],fe=(j[P>>>24]<<24|j[Q>>>16&255]<<16|j[L>>>8&255]<<8|j[255&T])^N[Y++],le=(j[Q>>>24]<<24|j[L>>>16&255]<<16|j[T>>>8&255]<<8|j[255&P])^N[Y++],R[A]=X,R[A+1]=ae,R[A+2]=fe,R[A+3]=le},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,R=[],A=0;A<56;A++){var N=d[A]-1;R[A]=S[N>>>5]>>>31-N%32&1}for(var H=this._subKeys=[],z=0;z<16;z++){var x=H[z]=[],B=g[z];for(A=0;A<24;A++)x[A/6|0]|=R[(f[A]-1+B)%28]<<31-A%6,x[4+(A/6|0)]|=R[28+(f[A+24]-1+B)%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 j=this._invSubKeys=[];for(A=0;A<16;A++)j[A]=H[15-A]},encryptBlock:function(S,R){this._doCryptBlock(S,R,this._subKeys)},decryptBlock:function(S,R){this._doCryptBlock(S,R,this._invSubKeys)},_doCryptBlock:function(S,R,A){this._lBlock=S[R],this._rBlock=S[R+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 N=0;N<16;N++){for(var H=A[N],z=this._lBlock,x=this._rBlock,B=0,j=0;j<8;j++)B|=v[j][((x^H[j])&_[j])>>>0];this._lBlock=x,this._rBlock=z^B}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[R]=this._lBlock,S[R+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function C(S,R){var A=(this._lBlock>>>S^this._rBlock)&R;this._rBlock^=A,this._lBlock^=A<<S}function D(S,R){var A=(this._rBlock>>>S^this._lBlock)&R;this._lBlock^=A,this._rBlock^=A<<S}r.DES=s._createHelper(M);var w=u.TripleDES=s.extend({_doReset:function(){var S=this._key.words;this._des1=M.createEncryptor(i.create(S.slice(0,2))),this._des2=M.createEncryptor(i.create(S.slice(2,4))),this._des3=M.createEncryptor(i.create(S.slice(4,6)))},encryptBlock:function(S,R){this._des1.encryptBlock(S,R),this._des2.decryptBlock(S,R),this._des3.encryptBlock(S,R)},decryptBlock:function(S,R){this._des3.decryptBlock(S,R),this._des2.encryptBlock(S,R),this._des1.decryptBlock(S,R)},keySize:6,ivSize:2,blockSize:2});r.TripleDES=s._createHelper(w)}(),n.TripleDES)}),Fn(function(e,t){var n;e.exports=(n=zn,function(){var r=n,o=r.lib.StreamCipher,i=r.algo,s=i.RC4=o.extend({_doReset:function(){for(var f=this._key,g=f.words,v=f.sigBytes,_=this._S=[],M=0;M<256;M++)_[M]=M;M=0;for(var C=0;M<256;M++){var D=M%v,w=g[D>>>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],R=w[1],A=16711935&(S<<8|S>>>24)|4278255360&(S<<24|S>>>8),N=16711935&(R<<8|R>>>24)|4278255360&(R<<24|R>>>8),H=A>>>16|4294901760&N,z=N<<16|65535&A;for(D[0]^=A,D[1]^=H,D[2]^=N,D[3]^=z,D[4]^=A,D[5]^=H,D[6]^=N,D[7]^=z,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<u[0]>>>0?1:0)|0,_[2]=_[2]+886263092+(_[1]>>>0<u[1]>>>0?1:0)|0,_[3]=_[3]+1295307597+(_[2]>>>0<u[2]>>>0?1:0)|0,_[4]=_[4]+3545052371+(_[3]>>>0<u[3]>>>0?1:0)|0,_[5]=_[5]+886263092+(_[4]>>>0<u[4]>>>0?1:0)|0,_[6]=_[6]+1295307597+(_[5]>>>0<u[5]>>>0?1:0)|0,_[7]=_[7]+3545052371+(_[6]>>>0<u[6]>>>0?1:0)|0,this._b=_[7]>>>0<u[7]>>>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,R=((4294901760&C)*C|0)+((65535&C)*C|0);d[M]=S^R}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],R=w[1],A=16711935&(S<<8|S>>>24)|4278255360&(S<<24|S>>>8),N=16711935&(R<<8|R>>>24)|4278255360&(R<<24|R>>>8),H=A>>>16|4294901760&N,z=N<<16|65535&A;for(C[0]^=A,C[1]^=H,C[2]^=N,C[3]^=z,C[4]^=A,C[5]^=H,C[6]^=N,C[7]^=z,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<u[0]>>>0?1:0)|0,_[2]=_[2]+886263092+(_[1]>>>0<u[1]>>>0?1:0)|0,_[3]=_[3]+1295307597+(_[2]>>>0<u[2]>>>0?1:0)|0,_[4]=_[4]+3545052371+(_[3]>>>0<u[3]>>>0?1:0)|0,_[5]=_[5]+886263092+(_[4]>>>0<u[4]>>>0?1:0)|0,_[6]=_[6]+1295307597+(_[5]>>>0<u[5]>>>0?1:0)|0,_[7]=_[7]+3545052371+(_[6]>>>0<u[6]>>>0?1:0)|0,this._b=_[7]>>>0<u[7]>>>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,R=((4294901760&C)*C|0)+((65535&C)*C|0);d[M]=S^R}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 RP(){throw new Error("setTimeout has not been defined")}function NP(){throw new Error("clearTimeout has not been defined")}var xl=RP,Ul=NP;function PP(e){if(xl===setTimeout)return setTimeout(e,0);if((xl===RP||!xl)&&setTimeout)return xl=setTimeout,setTimeout(e,0);try{return xl(e,0)}catch{try{return xl.call(null,e,0)}catch{return xl.call(this,e,0)}}}typeof Uf.setTimeout=="function"&&(xl=setTimeout),typeof Uf.clearTimeout=="function"&&(Ul=clearTimeout);var Mc,al=[],mf=!1,pv=-1;function rpe(){mf&&Mc&&(mf=!1,Mc.length?al=Mc.concat(al):pv=-1,al.length&&xP())}function xP(){if(!mf){var e=PP(rpe);mf=!0;for(var t=al.length;t;){for(Mc=al,al=[];++pv<t;)Mc&&Mc[pv].run();pv=-1,t=al.length}Mc=null,mf=!1,function(n){if(Ul===clearTimeout)return clearTimeout(n);if((Ul===NP||!Ul)&&clearTimeout)return Ul=clearTimeout,clearTimeout(n);try{Ul(n)}catch{try{return Ul.call(null,n)}catch{return Ul.call(this,n)}}}(e)}}function Ko(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];al.push(new UP(e,t)),al.length!==1||mf||PP(xP)}function UP(e,t){this.fun=e,this.array=t}UP.prototype.run=function(){this.fun.apply(null,this.array)};var qp=Uf.performance||{};qp.now||qp.mozNow||qp.msNow||qp.oNow||qp.webkitNow;function Fl(){}function Gn(){Gn.init.call(this)}function FP(e){return e._maxListeners===void 0?Gn.defaultMaxListeners:e._maxListeners}function ope(e,t,n){if(t)e.call(n);else for(var r=e.length,o=Mg(e,r),i=0;i<r;++i)o[i].call(n)}function ipe(e,t,n,r){if(t)e.call(n,r);else for(var o=e.length,i=Mg(e,o),s=0;s<o;++s)i[s].call(n,r)}function spe(e,t,n,r,o){if(t)e.call(n,r,o);else for(var i=e.length,s=Mg(e,i),u=0;u<i;++u)s[u].call(n,r,o)}function ape(e,t,n,r,o,i){if(t)e.call(n,r,o,i);else for(var s=e.length,u=Mg(e,s),d=0;d<s;++d)u[d].call(n,r,o,i)}function lpe(e,t,n,r){if(t)e.apply(n,r);else for(var o=e.length,i=Mg(e,o),s=0;s<o;++s)i[s].apply(n,r)}function RD(e,t,n,r){var o,i,s,u;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if((i=e._events)?(i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]):(i=e._events=new Fl,e._eventsCount=0),s){if(typeof s=="function"?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),!s.warned&&(o=FP(e))&&o>0&&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 ND(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 PD(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}Fl.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 Fl,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 FP(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:ope(n,g,this);break;case 2:ipe(n,g,this,arguments[1]);break;case 3:spe(n,g,this,arguments[1],arguments[2]);break;case 4:ape(n,g,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(r-1),i=1;i<r;i++)o[i-1]=arguments[i];lpe(n,g,this,o)}return!0},Gn.prototype.addListener=function(e,t){return RD(this,e,t,!1)},Gn.prototype.on=Gn.prototype.addListener,Gn.prototype.prependListener=function(e,t){return RD(this,e,t,!0)},Gn.prototype.once=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.on(e,ND(this,e,t)),this},Gn.prototype.prependOnceListener=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(e,ND(this,e,t)),this},Gn.prototype.removeListener=function(e,t){var n,r,o,i,s;if(typeof t!="function")throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)--this._eventsCount==0?this._events=new Fl:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(o=-1,i=n.length;i-- >0;)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 Fl,this;delete r[e]}else(function(u,d){for(var f=d,g=f+1,v=u.length;g<v;f+=1,g+=1)u[f]=u[g];u.pop()})(n,o);r.removeListener&&this.emit("removeListener",e,s||t)}return this},Gn.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return arguments.length===0?(this._events=new Fl,this._eventsCount=0):n[e]&&(--this._eventsCount==0?this._events=new Fl:delete n[e]),this;if(arguments.length===0){for(var r,o=Object.keys(n),i=0;i<o.length;++i)(r=o[i])!=="removeListener"&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new Fl,this._eventsCount=0,this}if(typeof(t=n[e])=="function")this.removeListener(e,t);else if(t)do this.removeListener(e,t[t.length-1]);while(t[0]);return this},Gn.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?typeof t=="function"?[t.listener||t]:function(r){for(var o=new Array(r.length),i=0;i<o.length;++i)o[i]=r[i].listener||r[i];return o}(t):[]},Gn.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):PD.call(e,t)},Gn.prototype.listenerCount=PD,Gn.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var qi=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},upe=/%[sdj%]/g;function cpe(e){if(!CI(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(hu(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,i=String(e).replace(upe,function(u){if(u==="%%")return"%";if(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<o;s=r[++n])UT(s)||!Ig(s)?i+=" "+s:i+=" "+hu(s);return i}function GP(e,t){if(ru(Uf.process))return function(){return GP(e,t).apply(this,arguments)};var n=!1;return function(){return n||(console.error(t),n=!0),e.apply(this,arguments)}}var Cb,Om={};function hu(e,t){var n={seen:[],stylize:fpe};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),$P(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),ru(n.showHidden)&&(n.showHidden=!1),ru(n.depth)&&(n.depth=2),ru(n.colors)&&(n.colors=!1),ru(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=dpe),ly(n,e,n.depth)}function dpe(e,t){var n=hu.styles[t];return n?"\x1B["+hu.colors[n][0]+"m"+e+"\x1B["+hu.colors[n][1]+"m":e}function fpe(e,t){return e}function ly(e,t,n){if(e.customInspect&&t&&Db(t.inspect)&&t.inspect!==hu&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return CI(r)||(r=ly(e,r,n)),r}var o=function(M,C){if(ru(C))return M.stylize("undefined","undefined");if(CI(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($P(C))return M.stylize(""+C,"boolean");if(UT(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)),kb(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return Tb(t);if(i.length===0){if(Db(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(Sb(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(xD(t))return e.stylize(Date.prototype.toString.call(t),"date");if(kb(t))return Tb(t)}var d,f,g="",v=!1,_=["{","}"];return d=t,Array.isArray(d)&&(v=!0,_=["[","]"]),Db(t)&&(g=" [Function"+(t.name?": "+t.name:"")+"]"),Sb(t)&&(g=" "+RegExp.prototype.toString.call(t)),xD(t)&&(g=" "+Date.prototype.toUTCString.call(t)),kb(t)&&(g=" "+Tb(t)),i.length!==0||v&&t.length!=0?n<0?Sb(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 R=[],A=0,N=C.length;A<N;++A)BP(C,String(A))?R.push(wb(M,C,D,w,String(A),!0)):R.push("");return S.forEach(function(H){H.match(/^\d+$/)||R.push(wb(M,C,D,w,H,!0))}),R}(e,t,n,s,i):i.map(function(M){return wb(e,t,n,s,M,v)}),e.seen.pop(),function(M,C,D){return M.reduce(function(w,S){return S.indexOf(`
- `),w+S.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?D[0]+(C===""?"":C+`
- `)+" "+M.join(`,
- `)+" "+D[1]:D[0]+C+" "+M.join(", ")+" "+D[1]}(f,g,_)):_[0]+g+_[1]}function Tb(e){return"["+Error.prototype.toString.call(e)+"]"}function wb(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")),BP(r,o)||(s="["+o+"]"),u||(e.seen.indexOf(d.value)<0?(u=UT(n)?ly(e,d.value,null):ly(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")),ru(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 $P(e){return typeof e=="boolean"}function UT(e){return e===null}function CI(e){return typeof e=="string"}function ru(e){return e===void 0}function Sb(e){return Ig(e)&&FT(e)==="[object RegExp]"}function Ig(e){return typeof e=="object"&&e!==null}function xD(e){return Ig(e)&&FT(e)==="[object Date]"}function kb(e){return Ig(e)&&(FT(e)==="[object Error]"||e instanceof Error)}function Db(e){return typeof e=="function"}function FT(e){return Object.prototype.toString.call(e)}function BP(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nc(){this.head=null,this.tail=null,this.length=0}hu.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]},hu.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},nc.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},nc.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},nc.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}},nc.prototype.clear=function(){this.head=this.tail=null,this.length=0},nc.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},nc.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 ppe=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 Ih(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!ppe(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=gpe;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=mpe;break;default:return void(this.write=hpe)}this.charBuffer=new Xe(6),this.charReceived=0,this.charLength=0}function hpe(e){return e.toString(this.encoding)}function gpe(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function mpe(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Ih.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<this.charLength)return"";if(e=e.slice(n,e.length),!((o=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=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},Ih.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},Ih.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},zr.ReadableState=HP;var or=function(e){return ru(Cb)&&(Cb=""),e=e.toUpperCase(),Om[e]||(new RegExp("\\b"+e+"\\b","i").test(Cb)?Om[e]=function(){var t=cpe.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:Om[e]=function(){}),Om[e]}("stream");function HP(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Ds&&(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 nc,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 Ih(e.encoding),this.encoding=e.encoding)}function zr(e){if(!(this instanceof zr))return new zr(e);this._readableState=new HP(e,this),this.readable=!0,e&&typeof e.read=="function"&&(this._read=e.read),Gn.call(this)}function UD(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,uy(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&&uy(e))),function(f,g){g.readingMore||(g.readingMore=!0,Ko(vpe,f,g))}(e,t)}else o||(t.reading=!1);return function(f){return!f.ended&&(f.needReadable||f.length<f.highWaterMark||f.length===0)}(t)}qi(zr,Gn),zr.prototype.push=function(e,t){var n=this._readableState;return n.objectMode||typeof e!="string"||(t=t||n.defaultEncoding)!==n.encoding&&(e=Xe.from(e,t),t=""),UD(this,n,e,t,!1)},zr.prototype.unshift=function(e){return UD(this,this._readableState,e,"",!0)},zr.prototype.isPaused=function(){return this._readableState.flowing===!1},zr.prototype.setEncoding=function(e){return this._readableState.decoder=new Ih(e),this._readableState.encoding=e,this};var FD=8388608;function GD(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(n){return n>=FD?n=FD:(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 uy(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(or("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Ko($D,e):$D(e))}function $D(e){or("emit readable"),e.emit("readable"),GT(e)}function vpe(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(or("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function ype(e){or("readable nexttick read 0"),e.read(0)}function _pe(e,t){t.reading||(or("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),GT(e),t.flowing&&!t.reading&&e.read(0)}function GT(e){var t=e._readableState;for(or("flow",t.flowing);t.flowing&&e.read()!==null;);}function BD(e,t){return t.length===0?null:(t.objectMode?n=t.buffer.shift():!e||e>=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<o.head.data.length?(s=o.head.data.slice(0,r),o.head.data=o.head.data.slice(r)):s=r===o.head.data.length?o.shift():i?function(u,d){var f=d.head,g=1,v=f.data;for(u-=v.length;f=f.next;){var _=f.data,M=u>_.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 Eb(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Ko(bpe,t,e))}function bpe(e,t){e.endEmitted||e.length!==0||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function HD(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Mpe(){}function Ipe(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function TI(e,t){Object.defineProperty(this,"buffer",{get:GP(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),e=e||{},this.objectMode=!!e.objectMode,t instanceof Ds&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,r=this.objectMode?16:16384;this.highWaterMark=n||n===0?n:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var o=e.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){(function(s,u){var d=s._writableState,f=d.sync,g=d.writecb;if(function(_){_.writing=!1,_.writecb=null,_.length-=_.writelen,_.writelen=0}(d),u)(function(_,M,C,D,w){--M.pendingcb,C?Ko(w,D):w(D),_._writableState.errorEmitted=!0,_.emit("error",D)})(s,d,f,u,g);else{var v=VP(d);v||d.corked||d.bufferProcessing||!d.bufferedRequest||qP(s,d),f?Ko(qD,s,d,v,g):qD(s,d,v,g)}})(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new jP(this)}function li(e){if(!(this instanceof li||this instanceof Ds))return new li(e);this._writableState=new TI(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev)),Gn.call(this)}function wI(e,t,n,r,o,i,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function qD(e,t,n,r){n||function(o,i){i.length===0&&i.needDrain&&(i.needDrain=!1,o.emit("drain"))}(e,t),t.pendingcb--,r(),zP(e,t)}function qP(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0;n;)o[s]=n,n=n.next,s+=1;wI(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new jP(t)}else{for(;n;){var u=n.chunk,d=n.encoding,f=n.callback;if(wI(e,t,!1,t.objectMode?1:u.length,u,d,f),n=n.next,t.writing)break}n===null&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function VP(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function VD(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function zP(e,t){var n=VP(t);return n&&(t.pendingcb===0?(VD(e,t),t.finished=!0,e.emit("finish")):VD(e,t)),n}function jP(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;for(t.entry=null;r;){var o=r.callback;e.pendingcb--,o(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}zr.prototype.read=function(e){or("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return or("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?Eb(this):uy(this),null;if((e=GD(e,t))===0&&t.ended)return t.length===0&&Eb(this),null;var r,o=t.needReadable;return or("need readable",o),(t.length===0||t.length-e<t.highWaterMark)&&or("length less than watermark",o=!0),t.ended||t.reading?or("reading or ended",o=!1):o&&(or("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=GD(n,t))),(r=e>0?BD(e,t):null)===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&Eb(this)),r!==null&&this.emit("data",r),r},zr.prototype._read=function(e){this.emit("error",new Error("not implemented"))},zr.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,or("pipe count=%d opts=%j",r.pipesCount,t);var o=!t||t.end!==!1?s:f;function i(w){or("onunpipe"),w===n&&f()}function s(){or("onend"),e.end()}r.endEmitted?Ko(o):n.once("end",o),e.on("unpipe",i);var u=function(w){return function(){var S=w._readableState;or("pipeOnDrain",S.awaitDrain),S.awaitDrain&&S.awaitDrain--,S.awaitDrain===0&&w.listeners("data").length&&(S.flowing=!0,GT(w))}}(n);e.on("drain",u);var d=!1;function f(){or("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){or("ondata"),g=!1,e.write(w)!==!1||g||((r.pipesCount===1&&r.pipes===e||r.pipesCount>1&&HD(r.pipes,e)!==-1)&&!d&&(or("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,g=!0),n.pause())}function _(w){var S;or("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(){or("onfinish"),e.removeListener("close",M),D()}function D(){or("unpipe"),n.unpipe(e)}return n.on("data",v),function(w,S,R){if(typeof w.prependListener=="function")return w.prependListener(S,R);w._events&&w._events[S]?Array.isArray(w._events[S])?w._events[S].unshift(R):w._events[S]=[R,w._events[S]]:w.on(S,R)}(e,"error",_),e.once("close",M),e.once("finish",C),e.emit("pipe",n),r.flowing||(or("pipe resume"),n.resume()),e},zr.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<r;o++)n[o].emit("unpipe",this);return this}var i=HD(t.pipes,e);return i===-1?this:(t.pipes.splice(i,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},zr.prototype.on=function(e,t){var n=Gn.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&uy(this):Ko(ype,this))}return n},zr.prototype.addListener=zr.prototype.on,zr.prototype.resume=function(){var e=this._readableState;return e.flowing||(or("resume"),e.flowing=!0,function(t,n){n.resumeScheduled||(n.resumeScheduled=!0,Ko(_pe,t,n))}(this,e)),this},zr.prototype.pause=function(){return or("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(or("pause"),this._readableState.flowing=!1,this.emit("pause")),this},zr.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;for(var o in e.on("end",function(){if(or("wrapped end"),t.decoder&&!t.ended){var i=t.decoder.end();i&&i.length&&r.push(i)}r.push(null)}),e.on("data",function(i){or("wrapped data"),t.decoder&&(i=t.decoder.write(i)),t.objectMode&&i==null||(t.objectMode||i&&i.length)&&(r.push(i)||(n=!0,e.pause()))}),e)this[o]===void 0&&typeof e[o]=="function"&&(this[o]=function(i){return function(){return e[i].apply(e,arguments)}}(o));return function(i,s){for(var u=0,d=i.length;u<d;u++)s(i[u],u)}(["error","close","destroy","pause","resume"],function(i){e.on(i,r.emit.bind(r,i))}),r._read=function(i){or("wrapped _read",i),n&&(n=!1,e.resume())},r},zr._fromList=BD,li.WritableState=TI,qi(li,Gn),TI.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},li.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},li.prototype.write=function(e,t,n){var r=this._writableState,o=!1;return typeof t=="function"&&(n=t,t=null),Xe.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),typeof n!="function"&&(n=Mpe),r.ended?function(i,s){var u=new Error("write after end");i.emit("error",u),Ko(s,u)}(this,n):function(i,s,u,d){var f=!0,g=!1;return u===null?g=new TypeError("May not write null values to stream"):Xe.isBuffer(u)||typeof u=="string"||u===void 0||s.objectMode||(g=new TypeError("Invalid non-string/buffer chunk")),g&&(i.emit("error",g),Ko(d,g),f=!1),f}(this,r,e,n)&&(r.pendingcb++,o=function(i,s,u,d,f){u=function(M,C,D){return M.objectMode||M.decodeStrings===!1||typeof C!="string"||(C=Xe.from(C,D)),C}(s,u,d),Xe.isBuffer(u)&&(d="buffer");var g=s.objectMode?1:u.length;s.length+=g;var v=s.length<s.highWaterMark;if(v||(s.needDrain=!0),s.writing||s.corked){var _=s.lastBufferedRequest;s.lastBufferedRequest=new Ipe(u,d,f),_?_.next=s.lastBufferedRequest:s.bufferedRequest=s.lastBufferedRequest,s.bufferedRequestCount+=1}else wI(i,s,!1,g,u,d,f);return v}(this,r,e,t,n)),o},li.prototype.cork=function(){this._writableState.corked++},li.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||qP(this,e))},li.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},li.prototype._write=function(e,t,n){n(new Error("not implemented"))},li.prototype._writev=null,li.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,zP(o,i),s&&(i.finished?Ko(s):o.once("finish",s)),i.ended=!0,o.writable=!1}(this,r,n)},qi(Ds,zr);for(var zD=Object.keys(li.prototype),Ab=0;Ab<zD.length;Ab++){var Lb=zD[Ab];Ds.prototype[Lb]||(Ds.prototype[Lb]=li.prototype[Lb])}function Ds(e){if(!(this instanceof Ds))return new Ds(e);zr.call(this,e),li.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",Cpe)}function Cpe(){this.allowHalfOpen||this._writableState.ended||Ko(Tpe,this)}function Tpe(e){e.end()}function wpe(e){this.afterTransform=function(t,n){return function(r,o,i){var s=r._transformState;s.transforming=!1;var u=s.writecb;if(!u)return r.emit("error",new Error("no writecb in Transform class"));s.writechunk=null,s.writecb=null,i!=null&&r.push(i),u(o);var d=r._readableState;d.reading=!1,(d.needReadable||d.length<d.highWaterMark)&&r._read(d.highWaterMark)}(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function Is(e){if(!(this instanceof Is))return new Is(e);Ds.call(this,e),this._transformState=new wpe(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.once("prefinish",function(){typeof this._flush=="function"?this._flush(function(n){jD(t,n)}):jD(t)})}function jD(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}function Ch(e){if(!(this instanceof Ch))return new Ch(e);Is.call(this,e)}function qa(){Gn.call(this)}qi(Is,Ds),Is.prototype.push=function(e,t){return this._transformState.needTransform=!1,Ds.prototype.push.call(this,e,t)},Is.prototype._transform=function(e,t,n){throw new Error("Not implemented")},Is.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},Is.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},qi(Ch,Is),Ch.prototype._transform=function(e,t,n){n(null,e)},qi(qa,Gn),qa.Readable=zr,qa.Writable=li,qa.Duplex=Ds,qa.Transform=Is,qa.PassThrough=Ch,qa.Stream=qa,qa.prototype.pipe=function(e,t){var n=this;function r(g){e.writable&&e.write(g)===!1&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",o),e._isStdio||t&&t.end===!1||(n.on("end",s),n.on("close",u));var i=!1;function s(){i||(i=!0,e.end())}function u(){i||(i=!0,typeof e.destroy=="function"&&e.destroy())}function d(g){if(f(),Gn.listenerCount(this,"error")===0)throw g}function f(){n.removeListener("data",r),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",d),e.removeListener("error",d),n.removeListener("end",f),n.removeListener("close",f),e.removeListener("close",f)}return n.on("error",d),e.on("error",d),n.on("end",f),n.on("close",f),e.on("close",f),e.emit("pipe",n),e};var WP={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};function Spe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function nl(e,t,n,r,o){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),o);else for(var i=0;i<r;i++)e[o+i]=t[n+i]}var cy=Uint8Array,Cs=Uint16Array,dy=Int32Array,kpe=4,WD=0,KD=1,Dpe=2;function Zf(e){for(var t=e.length;--t>=0;)e[t]=0}var Epe=0,KP=1,Ape=2,$T=29,Cg=256,ng=Cg+1+$T,vf=30,BT=19,YD=2*ng+1,Ic=15,Ob=16,Lpe=7,HT=256,YP=16,JP=17,XP=18,SI=[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],Ope=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],JD=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Qa=new Array(2*(ng+2));Zf(Qa);var Th=new Array(2*vf);Zf(Th);var rg=new Array(512);Zf(rg);var og=new Array(256);Zf(og);var qT=new Array($T);Zf(qT);var XD,ZD,QD,fy=new Array(vf);function Rb(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 Nb(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function ZP(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 zi(e,t,n){e.bi_valid>Ob-n?(e.bi_buf|=t<<e.bi_valid&65535,ig(e,e.bi_buf),e.bi_buf=t>>Ob-e.bi_valid,e.bi_valid+=n-Ob):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function ba(e,t,n){zi(e,n[2*t],n[2*t+1])}function QP(e,t){var n=0;do n|=1&e,e>>>=1,n<<=1;while(--t>0);return n>>>1}function e4(e,t,n){var r,o,i=new Array(Ic+1),s=0;for(r=1;r<=Ic;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]=QP(i[u]++,u))}}function t4(e){var t;for(t=0;t<ng;t++)e.dyn_ltree[2*t]=0;for(t=0;t<vf;t++)e.dyn_dtree[2*t]=0;for(t=0;t<BT;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*HT]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function n4(e){e.bi_valid>8?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 eE(e,t,n,r){var o=2*t,i=2*n;return e[o]<e[i]||e[o]===e[i]&&r[t]<=r[n]}function Pb(e,t,n){for(var r=e.heap[n],o=n<<1;o<=e.heap_len&&(o<e.heap_len&&eE(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!eE(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r}function tE(e,t,n){var r,o,i,s,u=0;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],o=e.pending_buf[e.l_buf+u],u++,r===0?ba(e,o,t):(ba(e,(i=og[o])+Cg+1,t),(s=SI[i])!==0&&zi(e,o-=qT[i],s),ba(e,i=ZP(--r),n),(s=hv[i])!==0&&zi(e,r-=fy[i],s));while(u<e.last_lit);ba(e,HT,t)}function xb(e,t){var n,r,o,i=t.dyn_tree,s=t.stat_desc.static_tree,u=t.stat_desc.has_stree,d=t.stat_desc.elems,f=-1;for(e.heap_len=0,e.heap_max=YD,n=0;n<d;n++)i[2*n]!==0?(e.heap[++e.heap_len]=f=n,e.depth[n]=0):i[2*n+1]=0;for(;e.heap_len<2;)i[2*(o=e.heap[++e.heap_len]=f<2?++f:0)]=1,e.depth[o]=0,e.opt_len--,u&&(e.static_len-=s[2*o+1]);for(t.max_code=f,n=e.heap_len>>1;n>=1;n--)Pb(e,i,n);o=d;do n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Pb(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++,Pb(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,R=v.dyn_tree,A=v.max_code,N=v.stat_desc.static_tree,H=v.stat_desc.has_stree,z=v.stat_desc.extra_bits,x=v.stat_desc.extra_base,B=v.stat_desc.max_length,j=0;for(D=0;D<=Ic;D++)g.bl_count[D]=0;for(R[2*g.heap[g.heap_max]+1]=0,_=g.heap_max+1;_<YD;_++)(D=R[2*R[2*(M=g.heap[_])+1]+1]+1)>B&&(D=B,j++),R[2*M+1]=D,M>A||(g.bl_count[D]++,w=0,M>=x&&(w=z[M-x]),S=R[2*M],g.opt_len+=S*(D+w),H&&(g.static_len+=S*(N[2*M+1]+w)));if(j!==0){do{for(D=B-1;g.bl_count[D]===0;)D--;g.bl_count[D]--,g.bl_count[D+1]+=2,g.bl_count[B]--,j-=2}while(j>0);for(D=B;D!==0;D--)for(M=g.bl_count[D];M!==0;)(C=g.heap[--_])>A||(R[2*C+1]!==D&&(g.opt_len+=(D-R[2*C+1])*R[2*C],R[2*C+1]=D),M--)}}(e,t),e4(i,f,e.bl_count)}function nE(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<d&&o===s||(u<f?e.bl_tree[2*o]+=u:o!==0?(o!==i&&e.bl_tree[2*o]++,e.bl_tree[2*YP]++):u<=10?e.bl_tree[2*JP]++:e.bl_tree[2*XP]++,u=0,i=o,s===0?(d=138,f=3):o===s?(d=6,f=3):(d=7,f=4))}function rE(e,t,n){var r,o,i=-1,s=t[1],u=0,d=7,f=4;for(s===0&&(d=138,f=3),r=0;r<=n;r++)if(o=s,s=t[2*(r+1)+1],!(++u<d&&o===s)){if(u<f)do ba(e,o,e.bl_tree);while(--u!=0);else o!==0?(o!==i&&(ba(e,o,e.bl_tree),u--),ba(e,YP,e.bl_tree),zi(e,u-3,2)):u<=10?(ba(e,JP,e.bl_tree),zi(e,u-3,3)):(ba(e,XP,e.bl_tree),zi(e,u-11,7));u=0,i=o,s===0?(d=138,f=3):o===s?(d=6,f=3):(d=7,f=4)}}Zf(fy);var oE=!1;function Rpe(e){oE||(function(){var t,n,r,o,i,s=new Array(Ic+1);for(r=0,o=0;o<$T-1;o++)for(qT[o]=r,t=0;t<1<<SI[o];t++)og[r++]=o;for(og[r-1]=o,i=0,o=0;o<16;o++)for(fy[o]=i,t=0;t<1<<hv[o];t++)rg[i++]=o;for(i>>=7;o<vf;o++)for(fy[o]=i<<7,t=0;t<1<<hv[o]-7;t++)rg[256+i++]=o;for(n=0;n<=Ic;n++)s[n]=0;for(t=0;t<=143;)Qa[2*t+1]=8,t++,s[8]++;for(;t<=255;)Qa[2*t+1]=9,t++,s[9]++;for(;t<=279;)Qa[2*t+1]=7,t++,s[7]++;for(;t<=287;)Qa[2*t+1]=8,t++,s[8]++;for(e4(Qa,ng+1,s),t=0;t<vf;t++)Th[2*t+1]=5,Th[2*t]=QP(t,5);XD=new Rb(Qa,SI,Cg+1,ng,Ic),ZD=new Rb(Th,hv,0,vf,Ic),QD=new Rb(new Array(0),Ope,0,BT,Lpe)}(),oE=!0),e.l_desc=new Nb(e.dyn_ltree,XD),e.d_desc=new Nb(e.dyn_dtree,ZD),e.bl_desc=new Nb(e.bl_tree,QD),e.bi_buf=0,e.bi_valid=0,t4(e)}function r4(e,t,n,r){zi(e,(Epe<<1)+(r?1:0),3),function(o,i,s,u){n4(o),u&&(ig(o,s),ig(o,~s)),nl(o.pending_buf,o.window,i,s,o.pending),o.pending+=s}(e,t,n,!0)}function Npe(e){zi(e,KP<<1,3),ba(e,HT,Qa),function(t){t.bi_valid===16?(ig(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(e)}function Ppe(e,t,n,r){var o,i,s=0;e.level>0?(e.strm.data_type===Dpe&&(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 WD;if(u.dyn_ltree[18]!==0||u.dyn_ltree[20]!==0||u.dyn_ltree[26]!==0)return KD;for(d=32;d<Cg;d++)if(u.dyn_ltree[2*d]!==0)return KD;return WD}(e)),xb(e,e.l_desc),xb(e,e.d_desc),s=function(u){var d;for(nE(u,u.dyn_ltree,u.l_desc.max_code),nE(u,u.dyn_dtree,u.d_desc.max_code),xb(u,u.bl_desc),d=BT-1;d>=3&&u.bl_tree[2*JD[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?r4(e,t,n,r):e.strategy===kpe||i===o?(zi(e,(KP<<1)+(r?1:0),3),tE(e,Qa,Th)):(zi(e,(Ape<<1)+(r?1:0),3),function(u,d,f,g){var v;for(zi(u,d-257,5),zi(u,f-1,5),zi(u,g-4,4),v=0;v<g;v++)zi(u,u.bl_tree[2*JD[v]+1],3);rE(u,u.dyn_ltree,d-1),rE(u,u.dyn_dtree,f-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),tE(e,e.dyn_ltree,e.dyn_dtree)),t4(e),r&&n4(e)}function gu(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>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*ZP(t)]++),e.last_lit===e.lit_bufsize-1}function kI(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 xpe=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 Do(e,t,n,r){var o=xpe,i=r+n;e^=-1;for(var s=r;s<i;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}var ef,Kc=0,Upe=1,Fpe=3,ql=4,iE=5,dc=0,sE=1,Yc=-2,Gpe=-3,Ub=-5,$pe=-1,Bpe=1,Rm=2,Hpe=3,qpe=4,Vpe=2,VT=8,zpe=9,DI=286,jpe=30,Wpe=19,Kpe=2*DI+1,Ype=15,tr=3,ou=258,Ws=ou+tr+1,Jpe=32,zT=42,EI=69,gv=73,mv=91,vv=103,Cc=113,th=666,Eo=1,wh=2,Tc=3,yf=4,Xpe=3;function iu(e,t){return e.msg=WP[t],t}function aE(e){return(e<<1)-(e>4?9:0)}function fc(e){for(var t=e.length;--t>=0;)e[t]=0}function Gl(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(nl(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 Yo(e,t){Ppe(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Gl(e.strm)}function Jn(e,t){e.pending_buf[e.pending++]=t}function Vp(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function o4(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-Ws?e.strstart-(e.w_size-Ws):0,f=e.window,g=e.w_mask,v=e.prev,_=e.strstart+ou,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=ou-(_-i),i=_-ou,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-Ws)){nl(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,nl(u,s.input,s.next_in,g,d),s.state.wrap===1?s.adler=kI(s.adler,u,g,d):s.state.wrap===2&&(s.adler=Do(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<<e.hash_shift^e.window[i+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+tr-1])&e.hash_mask,e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<tr)););}while(e.lookahead<Ws&&e.strm.avail_in!==0)}function Fb(e,t){for(var n,r;;){if(e.lookahead<Ws){if(sg(e),e.lookahead<Ws&&t===Kc)return Eo;if(e.lookahead===0)break}if(n=0,e.lookahead>=tr&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+tr-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Ws&&(e.match_length=o4(e,n)),e.match_length>=tr)if(r=gu(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<<e.hash_shift^e.window[e.strstart+tr-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=gu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Yo(e,!1),e.strm.avail_out===0))return Eo}return e.insert=e.strstart<tr-1?e.strstart:tr-1,t===ql?(Yo(e,!0),e.strm.avail_out===0?Tc:yf):e.last_lit&&(Yo(e,!1),e.strm.avail_out===0)?Eo:wh}function $d(e,t){for(var n,r,o;;){if(e.lookahead<Ws){if(sg(e),e.lookahead<Ws&&t===Kc)return Eo;if(e.lookahead===0)break}if(n=0,e.lookahead>=tr&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+tr-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=tr-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Ws&&(e.match_length=o4(e,n),e.match_length<=5&&(e.strategy===Bpe||e.match_length===tr&&e.strstart-e.match_start>4096)&&(e.match_length=tr-1)),e.prev_length>=tr&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-tr,r=gu(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<<e.hash_shift^e.window[e.strstart+tr-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=tr-1,e.strstart++,r&&(Yo(e,!1),e.strm.avail_out===0))return Eo}else if(e.match_available){if((r=gu(e,0,e.window[e.strstart-1]))&&Yo(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Eo}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=gu(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<tr-1?e.strstart:tr-1,t===ql?(Yo(e,!0),e.strm.avail_out===0?Tc:yf):e.last_lit&&(Yo(e,!1),e.strm.avail_out===0)?Eo:wh}function aa(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}function Zpe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=VT,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Cs(2*Kpe),this.dyn_dtree=new Cs(2*(2*jpe+1)),this.bl_tree=new Cs(2*(2*Wpe+1)),fc(this.dyn_ltree),fc(this.dyn_dtree),fc(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Cs(Ype+1),this.heap=new Cs(2*DI+1),fc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Cs(2*DI+1),fc(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function lE(e){var t,n=function(r){var o;return r&&r.state?(r.total_in=r.total_out=0,r.data_type=Vpe,(o=r.state).pending=0,o.pending_out=0,o.wrap<0&&(o.wrap=-o.wrap),o.status=o.wrap?zT:Cc,r.adler=o.wrap===2?0:1,o.last_flush=Kc,Rpe(o),dc):iu(r,Yc)}(e);return n===dc&&((t=e.state).window_size=2*t.w_size,fc(t.head),t.max_lazy_match=ef[t.level].max_lazy,t.good_match=ef[t.level].good_length,t.nice_match=ef[t.level].nice_length,t.max_chain_length=ef[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=tr-1,t.match_available=0,t.ins_h=0),n}function Qpe(e,t){var n,r,o,i;if(!e||!e.state||t>iE||t<0)return e?iu(e,Yc):Yc;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===th&&t!==ql)return iu(e,e.avail_out===0?Ub:Yc);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===zT)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=Do(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=EI):(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,Xpe),r.status=Cc);else{var s=VT+(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|=Jpe),s+=31-s%31,r.status=Cc,Vp(r,s),r.strstart!==0&&(Vp(r,e.adler>>>16),Vp(r,65535&e.adler)),e.adler=1}if(r.status===EI)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=Do(e.adler,r.pending_buf,r.pending-o,o)),Gl(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=Do(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=Do(e.adler,r.pending_buf,r.pending-o,o)),Gl(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Jn(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=Do(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=Do(e.adler,r.pending_buf,r.pending-o,o)),Gl(e),o=r.pending,r.pending===r.pending_buf_size)){i=1;break}i=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Jn(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>o&&(e.adler=Do(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&&Gl(e),r.pending+2<=r.pending_buf_size&&(Jn(r,255&e.adler),Jn(r,e.adler>>8&255),e.adler=0,r.status=Cc)):r.status=Cc),r.pending!==0){if(Gl(e),e.avail_out===0)return r.last_flush=-1,dc}else if(e.avail_in===0&&aE(t)<=aE(n)&&t!==ql)return iu(e,Ub);if(r.status===th&&e.avail_in!==0)return iu(e,Ub);if(e.avail_in!==0||r.lookahead!==0||t!==Kc&&r.status!==th){var u=r.strategy===Rm?function(d,f){for(var g;;){if(d.lookahead===0&&(sg(d),d.lookahead===0)){if(f===Kc)return Eo;break}if(d.match_length=0,g=gu(d,0,d.window[d.strstart]),d.lookahead--,d.strstart++,g&&(Yo(d,!1),d.strm.avail_out===0))return Eo}return d.insert=0,f===ql?(Yo(d,!0),d.strm.avail_out===0?Tc:yf):d.last_lit&&(Yo(d,!1),d.strm.avail_out===0)?Eo:wh}(r,t):r.strategy===Hpe?function(d,f){for(var g,v,_,M,C=d.window;;){if(d.lookahead<=ou){if(sg(d),d.lookahead<=ou&&f===Kc)return Eo;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+ou;do;while(v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&v===C[++_]&&_<M);d.match_length=ou-(M-_),d.match_length>d.lookahead&&(d.match_length=d.lookahead)}if(d.match_length>=tr?(g=gu(d,1,d.match_length-tr),d.lookahead-=d.match_length,d.strstart+=d.match_length,d.match_length=0):(g=gu(d,0,d.window[d.strstart]),d.lookahead--,d.strstart++),g&&(Yo(d,!1),d.strm.avail_out===0))return Eo}return d.insert=0,f===ql?(Yo(d,!0),d.strm.avail_out===0?Tc:yf):d.last_lit&&(Yo(d,!1),d.strm.avail_out===0)?Eo:wh}(r,t):ef[r.level].func(r,t);if(u!==Tc&&u!==yf||(r.status=th),u===Eo||u===Tc)return e.avail_out===0&&(r.last_flush=-1),dc;if(u===wh&&(t===Upe?Npe(r):t!==iE&&(r4(r,0,0,!1),t===Fpe&&(fc(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Gl(e),e.avail_out===0))return r.last_flush=-1,dc}return t!==ql?dc:r.wrap<=0?sE:(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)):(Vp(r,e.adler>>>16),Vp(r,65535&e.adler)),Gl(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?dc:sE)}ef=[new aa(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===Kc)return Eo;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,Yo(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Ws&&(Yo(e,!1),e.strm.avail_out===0))return Eo}return e.insert=0,t===ql?(Yo(e,!0),e.strm.avail_out===0?Tc:yf):(e.strstart>e.block_start&&(Yo(e,!1),e.strm.avail_out),Eo)}),new aa(4,4,8,4,Fb),new aa(4,5,16,8,Fb),new aa(4,6,32,32,Fb),new aa(4,4,16,16,$d),new aa(8,16,32,32,$d),new aa(8,16,128,128,$d),new aa(8,32,128,256,$d),new aa(32,128,258,1024,$d),new aa(32,258,258,4096,$d)];var Nm=30,ehe=12;function the(e,t){var n,r,o,i,s,u,d,f,g,v,_,M,C,D,w,S,R,A,N,H,z,x,B,j,G;n=e.state,r=e.next_in,j=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<<n.lenbits)-1,R=(1<<n.distbits)-1;e:do{C<15&&(M+=j[r++]<<C,C+=8,M+=j[r++]<<C,C+=8),A=D[M&S];t:for(;;){if(M>>>=N=A>>>24,C-=N,(N=A>>>16&255)===0)G[i++]=65535&A;else{if(!(16&N)){if(!(64&N)){A=D[(65535&A)+(M&(1<<N)-1)];continue t}if(32&N){n.mode=ehe;break e}e.msg="invalid literal/length code",n.mode=Nm;break e}H=65535&A,(N&=15)&&(C<N&&(M+=j[r++]<<C,C+=8),H+=M&(1<<N)-1,M>>>=N,C-=N),C<15&&(M+=j[r++]<<C,C+=8,M+=j[r++]<<C,C+=8),A=w[M&R];n:for(;;){if(M>>>=N=A>>>24,C-=N,!(16&(N=A>>>16&255))){if(!(64&N)){A=w[(65535&A)+(M&(1<<N)-1)];continue n}e.msg="invalid distance code",n.mode=Nm;break e}if(z=65535&A,C<(N&=15)&&(M+=j[r++]<<C,(C+=8)<N&&(M+=j[r++]<<C,C+=8)),(z+=M&(1<<N)-1)>d){e.msg="invalid distance too far back",n.mode=Nm;break e}if(M>>>=N,C-=N,z>(N=i-s)){if((N=z-N)>g&&n.sane){e.msg="invalid distance too far back",n.mode=Nm;break e}if(x=0,B=_,v===0){if(x+=f-N,N<H){H-=N;do G[i++]=_[x++];while(--N);x=i-z,B=G}}else if(v<N){if(x+=f+v-N,(N-=v)<H){H-=N;do G[i++]=_[x++];while(--N);if(x=0,v<H){H-=N=v;do G[i++]=_[x++];while(--N);x=i-z,B=G}}}else if(x+=v-N,N<H){H-=N;do G[i++]=_[x++];while(--N);x=i-z,B=G}for(;H>2;)G[i++]=B[x++],G[i++]=B[x++],G[i++]=B[x++],H-=3;H&&(G[i++]=B[x++],H>1&&(G[i++]=B[x++]))}else{x=i-z;do G[i++]=G[x++],G[i++]=G[x++],G[i++]=G[x++],H-=3;while(H>2);H&&(G[i++]=G[x++],H>1&&(G[i++]=G[x++]))}break}}break}}while(r<o&&i<u);r-=H=C>>3,M&=(1<<(C-=H<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r<o?o-r+5:5-(r-o),e.avail_out=i<u?u-i+257:257-(i-u),n.hold=M,n.bits=C}var Bd=15,uE=852,cE=592,dE=0,Gb=1,fE=2,nhe=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],rhe=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],ohe=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],ihe=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function Sh(e,t,n,r,o,i,s,u){var d,f,g,v,_,M,C,D,w,S=u.bits,R=0,A=0,N=0,H=0,z=0,x=0,B=0,j=0,G=0,L=0,T=null,P=0,Q=new Cs(Bd+1),Y=new Cs(Bd+1),oe=null,X=0;for(R=0;R<=Bd;R++)Q[R]=0;for(A=0;A<r;A++)Q[t[n+A]]++;for(z=S,H=Bd;H>=1&&Q[H]===0;H--);if(z>H&&(z=H),H===0)return o[i++]=20971520,o[i++]=20971520,u.bits=1,0;for(N=1;N<H&&Q[N]===0;N++);for(z<N&&(z=N),j=1,R=1;R<=Bd;R++)if(j<<=1,(j-=Q[R])<0)return-1;if(j>0&&(e===dE||H!==1))return-1;for(Y[1]=0,R=1;R<Bd;R++)Y[R+1]=Y[R]+Q[R];for(A=0;A<r;A++)t[n+A]!==0&&(s[Y[t[n+A]]++]=A);if(e===dE?(T=oe=s,M=19):e===Gb?(T=nhe,P-=257,oe=rhe,X-=257,M=256):(T=ohe,oe=ihe,M=-1),L=0,A=0,R=N,_=i,x=z,B=0,g=-1,v=(G=1<<z)-1,e===Gb&&G>uE||e===fE&&G>cE)return 1;for(;;){C=R-B,s[A]<M?(D=0,w=s[A]):s[A]>M?(D=oe[X+s[A]],w=T[P+s[A]]):(D=96,w=0),d=1<<R-B,N=f=1<<x;do o[_+(L>>B)+(f-=d)]=C<<24|D<<16|w|0;while(f!==0);for(d=1<<R-1;L&d;)d>>=1;if(d!==0?(L&=d-1,L+=d):L=0,A++,--Q[R]==0){if(R===H)break;R=t[n+s[A]]}if(R>z&&(L&v)!==g){for(B===0&&(B=z),_+=N,j=1<<(x=R-B);x+B<H&&!((j-=Q[x+B])<=0);)x++,j<<=1;if(G+=1<<x,e===Gb&&G>uE||e===fE&&G>cE)return 1;o[g=L&v]=z<<24|x<<16|_-i|0}}return L!==0&&(o[_+L]=R-B<<24|64<<16|0),u.bits=z,0}var she=0,i4=1,s4=2,pE=4,ahe=5,Pm=6,py=0,lhe=1,uhe=2,mu=-2,che=-3,dhe=-4,fhe=-5,hE=8,a4=1,gE=2,mE=3,vE=4,yE=5,_E=6,bE=7,ME=8,IE=9,CE=10,TE=11,Va=12,$b=13,wE=14,Bb=15,SE=16,kE=17,DE=18,EE=19,xm=20,Um=21,AE=22,LE=23,OE=24,RE=25,NE=26,Hb=27,PE=28,xE=29,Dr=30,phe=31,hhe=32,ghe=852,mhe=592;function UE(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function vhe(){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 Cs(320),this.work=new Cs(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l4(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=a4,r.last=0,r.havedict=0,r.dmax=32768,r.head=null,r.hold=0,r.bits=0,r.lencode=r.lendyn=new dy(ghe),r.distcode=r.distdyn=new dy(mhe),r.sane=1,r.back=-1,py):mu}(e)):mu}function yhe(e,t){var n,r;return e?(r=new vhe,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)?mu:(u.window!==null&&u.wbits!==i&&(u.window=null),u.wrap=s,u.wbits=i,l4(o))):mu}(e,t))!==py&&(e.state=null),n):mu}var qb,Vb,FE=!0;function _he(e){if(FE){var t;for(qb=new dy(512),Vb=new dy(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(Sh(i4,e.lens,0,288,qb,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Sh(s4,e.lens,0,32,Vb,0,e.work,{bits:5}),FE=!1}e.lencode=qb,e.lenbits=9,e.distcode=Vb,e.distbits=5}function bhe(e,t){var n,r,o,i,s,u,d,f,g,v,_,M,C,D,w,S,R,A,N,H,z,x,B,j,G=0,L=new cy(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 mu;(n=e.state).mode===Va&&(n.mode=$b),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=py;e:for(;;)switch(n.mode){case a4:if(n.wrap===0){n.mode=$b;break}for(;g<16;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if(2&n.wrap&&f===35615){n.check=0,L[0]=255&f,L[1]=f>>>8&255,n.check=Do(n.check,L,2,0),f=0,g=0,n.mode=gE;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)!==hE){e.msg="unknown compression method",n.mode=Dr;break}if(g-=4,z=8+(15&(f>>>=4)),n.wbits===0)n.wbits=z;else if(z>n.wbits){e.msg="invalid window size",n.mode=Dr;break}n.dmax=1<<z,e.adler=n.check=1,n.mode=512&f?CE:Va,f=0,g=0;break;case gE:for(;g<16;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if(n.flags=f,(255&n.flags)!==hE){e.msg="unknown compression method",n.mode=Dr;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Dr;break}n.head&&(n.head.text=f>>8&1),512&n.flags&&(L[0]=255&f,L[1]=f>>>8&255,n.check=Do(n.check,L,2,0)),f=0,g=0,n.mode=mE;case mE:for(;g<32;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}n.head&&(n.head.time=f),512&n.flags&&(L[0]=255&f,L[1]=f>>>8&255,L[2]=f>>>16&255,L[3]=f>>>24&255,n.check=Do(n.check,L,4,0)),f=0,g=0,n.mode=vE;case vE:for(;g<16;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}n.head&&(n.head.xflags=255&f,n.head.os=f>>8),512&n.flags&&(L[0]=255&f,L[1]=f>>>8&255,n.check=Do(n.check,L,2,0)),f=0,g=0,n.mode=yE;case yE:if(1024&n.flags){for(;g<16;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}n.length=f,n.head&&(n.head.extra_len=f),512&n.flags&&(L[0]=255&f,L[1]=f>>>8&255,n.check=Do(n.check,L,2,0)),f=0,g=0}else n.head&&(n.head.extra=null);n.mode=_E;case _E:if(1024&n.flags&&((M=n.length)>u&&(M=u),M&&(n.head&&(z=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),nl(n.head.extra,r,i,M,z)),512&n.flags&&(n.check=Do(n.check,r,M,i)),u-=M,i+=M,n.length-=M),n.length))break e;n.length=0,n.mode=bE;case bE:if(2048&n.flags){if(u===0)break e;M=0;do z=r[i+M++],n.head&&z&&n.length<65536&&(n.head.name+=String.fromCharCode(z));while(z&&M<u);if(512&n.flags&&(n.check=Do(n.check,r,M,i)),u-=M,i+=M,z)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=ME;case ME:if(4096&n.flags){if(u===0)break e;M=0;do z=r[i+M++],n.head&&z&&n.length<65536&&(n.head.comment+=String.fromCharCode(z));while(z&&M<u);if(512&n.flags&&(n.check=Do(n.check,r,M,i)),u-=M,i+=M,z)break e}else n.head&&(n.head.comment=null);n.mode=IE;case IE:if(512&n.flags){for(;g<16;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if(f!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Dr;break}f=0,g=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Va;break;case CE:for(;g<32;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}e.adler=n.check=UE(f),f=0,g=0,n.mode=TE;case TE:if(n.havedict===0)return e.next_out=s,e.avail_out=d,e.next_in=i,e.avail_in=u,n.hold=f,n.bits=g,uhe;e.adler=n.check=1,n.mode=Va;case Va:if(t===ahe||t===Pm)break e;case $b:if(n.last){f>>>=7&g,g-=7&g,n.mode=Hb;break}for(;g<3;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}switch(n.last=1&f,g-=1,3&(f>>>=1)){case 0:n.mode=wE;break;case 1:if(_he(n),n.mode=xm,t===Pm){f>>>=2,g-=2;break e}break;case 2:n.mode=kE;break;case 3:e.msg="invalid block type",n.mode=Dr}f>>>=2,g-=2;break;case wE:for(f>>>=7&g,g-=7&g;g<32;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if((65535&f)!=(f>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Dr;break}if(n.length=65535&f,f=0,g=0,n.mode=Bb,t===Pm)break e;case Bb:n.mode=SE;case SE:if(M=n.length){if(M>u&&(M=u),M>d&&(M=d),M===0)break e;nl(o,r,i,M,s),u-=M,i+=M,d-=M,s+=M,n.length-=M;break}n.mode=Va;break;case kE:for(;g<14;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if(n.nlen=257+(31&f),f>>>=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=DE;case DE:for(;n.have<n.ncode;){for(;g<3;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}n.lens[T[n.have++]]=7&f,f>>>=3,g-=3}for(;n.have<19;)n.lens[T[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,B={bits:n.lenbits},x=Sh(she,n.lens,0,19,n.lencode,0,n.work,B),n.lenbits=B.bits,x){e.msg="invalid code lengths set",n.mode=Dr;break}n.have=0,n.mode=EE;case EE:for(;n.have<n.nlen+n.ndist;){for(;S=(G=n.lencode[f&(1<<n.lenbits)-1])>>>16&255,R=65535&G,!((w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if(R<16)f>>>=w,g-=w,n.lens[n.have++]=R;else{if(R===16){for(j=w+2;g<j;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if(f>>>=w,g-=w,n.have===0){e.msg="invalid bit length repeat",n.mode=Dr;break}z=n.lens[n.have-1],M=3+(3&f),f>>>=2,g-=2}else if(R===17){for(j=w+3;g<j;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}g-=w,z=0,M=3+(7&(f>>>=w)),f>>>=3,g-=3}else{for(j=w+7;g<j;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}g-=w,z=0,M=11+(127&(f>>>=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++]=z}}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,B={bits:n.lenbits},x=Sh(i4,n.lens,0,n.nlen,n.lencode,0,n.work,B),n.lenbits=B.bits,x){e.msg="invalid literal/lengths set",n.mode=Dr;break}if(n.distbits=6,n.distcode=n.distdyn,B={bits:n.distbits},x=Sh(s4,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,B),n.distbits=B.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,the(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===Va&&(n.back=-1);break}for(n.back=0;S=(G=n.lencode[f&(1<<n.lenbits)-1])>>>16&255,R=65535&G,!((w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if(S&&!(240&S)){for(A=w,N=S,H=R;S=(G=n.lencode[H+((f&(1<<A+N)-1)>>A)])>>>16&255,R=65535&G,!(A+(w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}f>>>=A,g-=A,n.back+=A}if(f>>>=w,g-=w,n.back+=w,n.length=R,S===0){n.mode=NE;break}if(32&S){n.back=-1,n.mode=Va;break}if(64&S){e.msg="invalid literal/length code",n.mode=Dr;break}n.extra=15&S,n.mode=AE;case AE:if(n.extra){for(j=n.extra;g<j;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}n.length+=f&(1<<n.extra)-1,f>>>=n.extra,g-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=LE;case LE:for(;S=(G=n.distcode[f&(1<<n.distbits)-1])>>>16&255,R=65535&G,!((w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if(!(240&S)){for(A=w,N=S,H=R;S=(G=n.distcode[H+((f&(1<<A+N)-1)>>A)])>>>16&255,R=65535&G,!(A+(w=G>>>24)<=g);){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}f>>>=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=R,n.extra=15&S,n.mode=OE;case OE:if(n.extra){for(j=n.extra;g<j;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}n.offset+=f&(1<<n.extra)-1,f>>>=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=RE;case RE: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 NE:if(d===0)break e;o[s++]=n.length,d--,n.mode=Um;break;case Hb:if(n.wrap){for(;g<32;){if(u===0)break e;u--,f|=r[i++]<<g,g+=8}if(_-=d,e.total_out+=_,n.total+=_,_&&(e.adler=n.check=n.flags?Do(n.check,o,_,s-_):kI(n.check,o,_,s-_)),_=d,(n.flags?f:UE(f))!==n.check){e.msg="incorrect data check",n.mode=Dr;break}f=0,g=0}n.mode=PE;case PE:if(n.wrap&&n.flags){for(;g<32;){if(u===0)break e;u--,f+=r[i++]<<g,g+=8}if(f!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Dr;break}f=0,g=0}n.mode=xE;case xE:x=lhe;break e;case Dr:x=che;break e;case phe:return dhe;case hhe:default:return mu}return e.next_out=s,e.avail_out=d,e.next_in=i,e.avail_in=u,n.hold=f,n.bits=g,(n.wsize||_!==e.avail_out&&n.mode<Dr&&(n.mode<Hb||t!==pE))&&function(P,Q,Y,oe){var X,ae=P.state;ae.window===null&&(ae.wsize=1<<ae.wbits,ae.wnext=0,ae.whave=0,ae.window=new cy(ae.wsize)),oe>=ae.wsize?(nl(ae.window,Q,Y-ae.wsize,ae.wsize,0),ae.wnext=0,ae.whave=ae.wsize):((X=ae.wsize-ae.wnext)>oe&&(X=oe),nl(ae.window,Q,Y-oe,X,ae.wnext),(oe-=X)?(nl(ae.window,Q,Y-oe,oe,0),ae.wnext=oe,ae.whave=ae.wsize):(ae.wnext+=X,ae.wnext===ae.wsize&&(ae.wnext=0),ae.whave<ae.wsize&&(ae.whave+=X)))}(e,e.output,e.next_out,_-e.avail_out),v-=e.avail_in,_-=e.avail_out,e.total_in+=v,e.total_out+=_,n.total+=_,n.wrap&&_&&(e.adler=n.check=n.flags?Do(n.check,o,_,e.next_out-_):kI(n.check,o,_,e.next_out-_)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Va?128:0)+(n.mode===xm||n.mode===Bb?256:0),(v===0&&_===0||t===pE)&&x===py&&(x=fhe),x}var Fm,tf=1,kh=7;function ua(e){if(e<tf||e>kh)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 Mhe(e,t){for(var n=0;n<e.length;n++)this[t+n]=e[n]}ua.prototype.init=function(e,t,n,r,o){var i;switch(this.windowBits=e,this.level=t,this.memLevel=n,this.strategy=r,this.mode!==3&&this.mode!==4||(this.windowBits+=16),this.mode===kh&&(this.windowBits+=32),this.mode!==5&&this.mode!==6||(this.windowBits=-this.windowBits),this.strm=new Spe,this.mode){case tf:case 3:case 5:i=function(s,u,d,f,g,v){if(!s)return Yc;var _=1;if(u===$pe&&(u=6),f<0?(_=0,f=-f):f>15&&(_=2,f-=16),g<1||g>zpe||d!==VT||f<8||f>15||u<0||u>9||v<0||v>qpe)return iu(s,Yc);f===8&&(f=9);var M=new Zpe;return s.state=M,M.strm=s,M.wrap=_,M.gzhead=null,M.w_bits=f,M.w_size=1<<M.w_bits,M.w_mask=M.w_size-1,M.hash_bits=g+7,M.hash_size=1<<M.hash_bits,M.hash_mask=M.hash_size-1,M.hash_shift=~~((M.hash_bits+tr-1)/tr),M.window=new cy(2*M.w_size),M.head=new Cs(M.hash_size),M.prev=new Cs(M.w_size),M.lit_bufsize=1<<g+6,M.pending_buf_size=4*M.lit_bufsize,M.pending_buf=new cy(M.pending_buf_size),M.d_buf=1*M.lit_bufsize,M.l_buf=3*M.lit_bufsize,M.level=u,M.strategy=v,M.method=d,lE(s)}(this.strm,this.level,8,this.windowBits,this.memLevel,this.strategy);break;case 2:case 4:case 6:case kh:i=yhe(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}i===0?(this.write_in_progress=!1,this.init_done=!0):this._error(i)},ua.prototype.params=function(){throw new Error("deflateParams Not supported")},ua.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===0)throw new Error("already finalized");if(this.write_in_progress)throw new Error("write already in progress");if(this.pending_close)throw new Error("close is pending")},ua.prototype.write=function(e,t,n,r,o,i,s){this._writeCheck(),this.write_in_progress=!0;var u=this;return Ko(function(){u.write_in_progress=!1;var d=u._write(e,t,n,r,o,i,s);u.callback(d[0],d[1]),u.pending_close&&u.close()}),this},ua.prototype.writeSync=function(e,t,n,r,o,i,s){return this._writeCheck(),this._write(e,t,n,r,o,i,s)},ua.prototype._write=function(e,t,n,r,o,i,s){if(this.write_in_progress=!0,e!==0&&e!==1&&e!==2&&e!==3&&e!==4&&e!==5)throw new Error("Invalid flush value");t==null&&(t=new Xe(0),r=0,n=0),o._set?o.set=o._set:o.set=Mhe;var u,d=this.strm;switch(d.avail_in=r,d.input=t,d.next_in=n,d.avail_out=s,d.output=o,d.next_out=i,this.mode){case tf:case 3:case 5:u=Qpe(d,e);break;case kh:case 2:case 4:case 6:u=bhe(d,e);break;default:throw new Error("Unknown mode "+this.mode)}return u!==1&&u!==0&&this._error(u),this.write_in_progress=!1,[d.avail_in,d.avail_out]},ua.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,this.mode===tf||this.mode===3||this.mode===5?function(e){var t;e&&e.state&&((t=e.state.status)!==zT&&t!==EI&&t!==gv&&t!==mv&&t!==vv&&t!==Cc&&t!==th?iu(e,Yc):(e.state=null,t===Cc&&iu(e,Gpe)))}(this.strm):function(e){if(!e||!e.state)return mu;var t=e.state;t.window&&(t.window=null),e.state=null}(this.strm),this.mode=0)},ua.prototype.reset=function(){switch(this.mode){case tf:case 5:Fm=lE(this.strm);break;case 2:case 6:Fm=l4(this.strm)}Fm!==0&&this._error(Fm)},ua.prototype._error=function(e){this.onerror(WP[e]+": "+this.strm.msg,e),this.write_in_progress=!1,this.pending_close&&this.close()};var GE=Object.freeze({NONE:0,DEFLATE:tf,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:kh,Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8,Zlib:ua}),Dt={};Object.keys(GE).forEach(function(e){Dt[e]=GE[e]}),Dt.Z_MIN_WINDOWBITS=8,Dt.Z_MAX_WINDOWBITS=15,Dt.Z_DEFAULT_WINDOWBITS=15,Dt.Z_MIN_CHUNK=64,Dt.Z_MAX_CHUNK=1/0,Dt.Z_DEFAULT_CHUNK=16384,Dt.Z_MIN_MEMLEVEL=1,Dt.Z_MAX_MEMLEVEL=9,Dt.Z_DEFAULT_MEMLEVEL=8,Dt.Z_MIN_LEVEL=-1,Dt.Z_MAX_LEVEL=9,Dt.Z_DEFAULT_LEVEL=Dt.Z_DEFAULT_COMPRESSION;var yv={Z_OK:Dt.Z_OK,Z_STREAM_END:Dt.Z_STREAM_END,Z_NEED_DICT:Dt.Z_NEED_DICT,Z_ERRNO:Dt.Z_ERRNO,Z_STREAM_ERROR:Dt.Z_STREAM_ERROR,Z_DATA_ERROR:Dt.Z_DATA_ERROR,Z_MEM_ERROR:Dt.Z_MEM_ERROR,Z_BUF_ERROR:Dt.Z_BUF_ERROR,Z_VERSION_ERROR:Dt.Z_VERSION_ERROR};function Zu(e,t,n){var r=[],o=0;function i(){for(var u;(u=e.read())!==null;)r.push(u),o+=u.length;e.once("readable",i)}function s(){var u=Xe.concat(r,o);r=[],n(null,u),e.close()}e.on("error",function(u){e.removeListener("end",s),e.removeListener("readable",i),n(u)}),e.on("end",s),e.end(t),i()}function Qu(e,t){if(typeof t=="string"&&(t=new Xe(t)),!bg(t))throw new TypeError("Not a string or buffer");var n=Dt.Z_FINISH;return e._processChunk(t,n)}function wc(e){if(!(this instanceof wc))return new wc(e);Pr.call(this,e,Dt.DEFLATE)}function Sc(e){if(!(this instanceof Sc))return new Sc(e);Pr.call(this,e,Dt.INFLATE)}function kc(e){if(!(this instanceof kc))return new kc(e);Pr.call(this,e,Dt.GZIP)}function Dc(e){if(!(this instanceof Dc))return new Dc(e);Pr.call(this,e,Dt.GUNZIP)}function Ec(e){if(!(this instanceof Ec))return new Ec(e);Pr.call(this,e,Dt.DEFLATERAW)}function Ac(e){if(!(this instanceof Ac))return new Ac(e);Pr.call(this,e,Dt.INFLATERAW)}function Lc(e){if(!(this instanceof Lc))return new Lc(e);Pr.call(this,e,Dt.UNZIP)}function Pr(e,t){if(this._opts=e=e||{},this._chunkSize=e.chunkSize||Dt.Z_DEFAULT_CHUNK,Is.call(this,e),e.flush&&e.flush!==Dt.Z_NO_FLUSH&&e.flush!==Dt.Z_PARTIAL_FLUSH&&e.flush!==Dt.Z_SYNC_FLUSH&&e.flush!==Dt.Z_FULL_FLUSH&&e.flush!==Dt.Z_FINISH&&e.flush!==Dt.Z_BLOCK)throw new Error("Invalid flush flag: "+e.flush);if(this._flushFlag=e.flush||Dt.Z_NO_FLUSH,e.chunkSize&&(e.chunkSize<Dt.Z_MIN_CHUNK||e.chunkSize>Dt.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<Dt.Z_MIN_WINDOWBITS||e.windowBits>Dt.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<Dt.Z_MIN_LEVEL||e.level>Dt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<Dt.Z_MIN_MEMLEVEL||e.memLevel>Dt.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}),qi(Pr,Is),Pr.prototype.params=function(e,t,n){if(e<Dt.Z_MIN_LEVEL||e>Dt.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 Ko(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&&Ko(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&&Ko(e),!this._closed){this._closed=!0,this._binding.close();var t=this;Ko(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(N,H){if(!N)throw new Error(H)}(S>=0,"have should not go down"),S>0){var R=s._buffer.slice(s._offset,s._offset+S);s._offset+=S,u?s.push(R):(f.push(R),g+=R.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},qi(wc,Pr),qi(Sc,Pr),qi(kc,Pr),qi(Dc,Pr),qi(Ec,Pr),qi(Ac,Pr),qi(Lc,Pr);var $E={codes:yv,createDeflate:function(e){return new wc(e)},createInflate:function(e){return new Sc(e)},createDeflateRaw:function(e){return new Ec(e)},createInflateRaw:function(e){return new Ac(e)},createGzip:function(e){return new kc(e)},createGunzip:function(e){return new Dc(e)},createUnzip:function(e){return new Lc(e)},deflate:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Zu(new wc(t),e,n)},deflateSync:function(e,t){return Qu(new wc(t),e)},gzip:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Zu(new kc(t),e,n)},gzipSync:function(e,t){return Qu(new kc(t),e)},deflateRaw:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Zu(new Ec(t),e,n)},deflateRawSync:function(e,t){return Qu(new Ec(t),e)},unzip:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Zu(new Lc(t),e,n)},unzipSync:function(e,t){return Qu(new Lc(t),e)},inflate:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Zu(new Sc(t),e,n)},inflateSync:function(e,t){return Qu(new Sc(t),e)},gunzip:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Zu(new Dc(t),e,n)},gunzipSync:function(e,t){return Qu(new Dc(t),e)},inflateRaw:function(e,t,n){return typeof t=="function"&&(n=t,t={}),Zu(new Ac(t),e,n)},inflateRawSync:function(e,t){return Qu(new Ac(t),e)},Deflate:wc,Inflate:Sc,Gzip:kc,Gunzip:Dc,DeflateRaw:Ec,InflateRaw:Ac,Unzip:Lc,Zlib:Pr};class Ihe{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=OD.HmacSHA256(i,this.PRIVATEKEY);return OD.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=$E.deflateSync(this.newBuffer(u)).toString("base64"),f=this.escape(d);return console.log("ret="+f),f}validate(t){let n=this.decode(t),r=$E.inflateSync(n);console.log("validate ret="+r)}}const Che=604800;function u4(e){const{SDKAppID:t,secretKey:n,userID:r}=e,i=new Ihe(t,n,Che).genTestUserSig(r);return{SDKAppID:t,userSig:i}}const The=ot({components:{DialogTUI:Ky},setup(e,t){const n=Yi(),r=n==null?void 0:n.appContext.config.globalProperties.$TUIKit,o=Ei&&Ei(),i=Ve(()=>JSON.parse(o.state.isMsgNeedReadReceipt)),s=Ve(()=>JSON.parse(o.state.displayOnlineStatus)),u=jt({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",Rh),r.login({userID:Rh,userSig:u4({SDKAppID:hw,secretKey:Q3,userID:Rh}).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()),lu.on("reConnectIm",_=>{_&&(u.dialogShow=!0,u.disconnectStatus=!0,o==null||o.commit("setImConnent",!1))})}),hl(()=>{r.tim.off(r.TIM.EVENT.KICKED_OUT,g)}),{...Kt(u),handleCurrentConversation:f,isMsgNeedReadReceipt:i,displayOnlineStatus:s,onClose:d,handleManage:v}}}),whe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAqCAYAAADBNhlmAAAAAXNSR0IArs4c6QAAAuFJREFUWEfdmL+LE1EQx2febkI2jYjdgXggov4BXuzubMwPEbMRUa+xsRGsPFELSwsVtRJsbGxODzEbEZOsjbnO0z9A5RBOhOtEbG5Dsnkjb2Pi5tf+Fp6mCtk3M5/M7HzfvIcg+Qcl54P/H9AqVfYB0TwRzQGxOaciyLcRcRsQt7R69WucKkXKYKd0Osd7XCeAU0R0yAsAET8hwEumMCNdf7ERFjYUYCdfXugR3iWgxbCBnMQCritI19Jm7X1Q+0CAdGJ5d9veeUQEZ4M69s4qrGXU7CV8vfrDz58vYLtw5iBx+xUBHfBzFuY5Am4iU09mms8/e/4Zr4dWvnIMiAwC2hUmeNC1CPgTEHXNrL6dZTMzg78zt/G34AZAAhKZmpuVyamAzjvXtQRcomWdnSXczKS03LR3ciqglS8/S6ohApcbYU0za+fG108ACimxCcLrFcI3ALzZD0C3iGBvULjBOhUhNy5BE4DWcb0VReeYAqVMo9YQwdrFcpH3oB4WUOik9sZYctuNAIodwrZ778I6FutVxhbSzeoH8b1TqByxOQ8sxu54qqocde84I4DtvH6bE12PAogILUilLji23e4TIhjJRFCfDPFOxjRu/Olyl6WV1z/67a1BA0VdJ/ZuzTQOTwCKqYRsvhXVcZJ2qLL5wRQ0LLFV1BepR63ogfA7Mnzo9DCnywC0J6ovVHBJaxjrwn4IuFMonwcOq5GdujowqhIMYzNYzjZrT0cB85UVIH5PCkBkV7Nm9f5YBvUrwMn5McrHrWHxM4gr2abx4N8qcdwmSTKDU5skrswkCjhNZkS94wh1UoAzhVoAxtrqEpIZz60uzrCQVAY9hwWnzBHHrSQAfcctZ1SKPLDiF0DloqOh1HtMRPvD6mmggbXfLBKP/E4CZD80OR3dP7DLeewcvDtSH9wHkFJffQwgpb48ckuFtNdv43om7QXmNOGV8go47A4RZ73vBWYc50nYSg/4C8nCuzoKBPvlAAAAAElFTkSuQmCC";const jT=e=>(mr("data-v-64331a26"),e=e(),vr(),e),She={class:it(["home"]),id:"preloadedImages"},khe={class:"home-main"},Dhe={class:"home-main-box"},Ehe={class:"home-TUIKit"},Ahe={class:"home-TUIKit-main"},Lhe={class:"conversation"},Ohe={key:2,class:"imDisconnent"},Rhe=jT(()=>$("img",{src:whe,class:"iconTips"},null,-1)),Nhe={class:"chat"},Phe=jT(()=>$("div",{class:"chat-default"},null,-1)),xhe=jT(()=>$("p",null,"聊天功能已断开,是否重新连接?",-1));function Uhe(e,t,n,r,o,i){const s=Bt("n-tab-pane"),u=Bt("n-tabs"),d=Bt("TUIConversation"),f=Bt("TUIGroup"),g=Bt("TUIPerson"),v=Bt("TUIChat"),_=Bt("DialogTUI");return Z(),se("div",She,[$("main",khe,[$("div",Dhe,[$("div",Ehe,[$("div",Ahe,[$("div",Lhe,[Ct(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:Ot(()=>[Ct(s,{name:"message",tab:"聊天"}),e.platform!="orchestra"?(Z(),bt(s,{key:0,name:"group",tab:"群聊"})):Ce("",!0),e.platform!="orchestra"?(Z(),bt(s,{key:1,name:"contact",tab:"联系人"})):Ce("",!0)]),_:1},8,["value"]),$n(Ct(d,{onCurrent:e.handleCurrentConversation,displayOnlineStatus:e.displayOnlineStatus},null,8,["onCurrent","displayOnlineStatus"]),[[eo,e.currentModel==="message"]]),e.platform!="orchestra"&&e.currentModel==="group"?(Z(),bt(f,{key:0,onCurrent:e.handleCurrentConversation,displayOnlineStatus:e.displayOnlineStatus},null,8,["onCurrent","displayOnlineStatus"])):Ce("",!0),e.platform!="orchestra"&&e.currentModel==="contact"?(Z(),bt(g,{key:1,onCurrent:e.handleCurrentConversation,displayOnlineStatus:e.displayOnlineStatus},null,8,["onCurrent","displayOnlineStatus"])):Ce("",!0),e.disconnectStatus?(Z(),se("div",Ohe,[$("p",null,[Rhe,Fr(" "+De(e.disconnentContent),1)]),$("span",{class:"btnConnent",onClick:t[1]||(t[1]=M=>e.dialogShow=!0)},De(e.disconnectBtnText),1)])):Ce("",!0)]),$("div",Nhe,[Ct(v,{isMsgNeedReadReceipt:e.isMsgNeedReadReceipt,isNeedTyping:!0,isNeedEmojiReact:!0},{default:Ot(()=>[Phe]),_:1},8,["isMsgNeedReadReceipt"])])])])])]),$("i",{class:"closeModal",onClick:t[2]||(t[2]=(...M)=>e.onClose&&e.onClose(...M))}),Ct(_,{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:Ot(()=>[xhe]),_:1},8,["show"])])}const Fhe=Wt(The,[["render",Uhe],["__scopeId","data-v-64331a26"]]),Ghe=[{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}],ls={taskList:Ghe,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{ls.userInfo=JSON.parse(e)}catch{ls.userInfo={}}}if(sessionStorage.getItem("isMsgNeedReadReceipt")){const e=sessionStorage.getItem("isMsgNeedReadReceipt")||"";try{ls.isMsgNeedReadReceipt=JSON.parse(e)}catch{ls.isMsgNeedReadReceipt=!1}}if(sessionStorage.getItem("displayOnlineStatus")){const e=sessionStorage.getItem("displayOnlineStatus")||"";try{ls.displayOnlineStatus=JSON.parse(e)}catch{ls.displayOnlineStatus=!1}}if(sessionStorage.getItem("allowNotification")){const e=sessionStorage.getItem("allowNotification")||"";try{ls.allowNotification=JSON.parse(e)}catch{ls.allowNotification=!1}}if(sessionStorage.getItem("platform")){const e=sessionStorage.getItem("platform")||"";try{ls.platform=JSON.parse(e)}catch{ls.platform=!1}}if(sessionStorage.getItem("token")){const e=sessionStorage.getItem("token")||"";try{ls.token=JSON.parse(e)}catch{ls.token=!1}}const $he=ZO({state:ls,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 hy=[];const c4=new WeakMap;function Bhe(){hy.forEach(e=>e(...c4.get(e))),hy=[]}function d4(e,...t){c4.set(e,t),!hy.includes(e)&&hy.push(e)===1&&requestAnimationFrame(Bhe)}function gy(e){return e.composedPath()[0]||null}function Hhe(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function nh(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 BE={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"},Qf="^\\s*",ep="\\s*$",Oc="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Rc="([0-9A-Fa-f])",Nc="([0-9A-Fa-f]{2})",qhe=new RegExp(`${Qf}rgb\\s*\\(${Oc},${Oc},${Oc}\\)${ep}`),Vhe=new RegExp(`${Qf}rgba\\s*\\(${Oc},${Oc},${Oc},${Oc}\\)${ep}`),zhe=new RegExp(`${Qf}#${Rc}${Rc}${Rc}${ep}`),jhe=new RegExp(`${Qf}#${Nc}${Nc}${Nc}${ep}`),Whe=new RegExp(`${Qf}#${Rc}${Rc}${Rc}${Rc}${ep}`),Khe=new RegExp(`${Qf}#${Nc}${Nc}${Nc}${Nc}${ep}`);function $i(e){return parseInt(e,16)}function od(e){try{let t;if(t=jhe.exec(e))return[$i(t[1]),$i(t[2]),$i(t[3]),1];if(t=qhe.exec(e))return[di(t[1]),di(t[5]),di(t[9]),1];if(t=Vhe.exec(e))return[di(t[1]),di(t[5]),di(t[9]),Dh(t[13])];if(t=zhe.exec(e))return[$i(t[1]+t[1]),$i(t[2]+t[2]),$i(t[3]+t[3]),1];if(t=Khe.exec(e))return[$i(t[1]),$i(t[2]),$i(t[3]),Dh($i(t[4])/255)];if(t=Whe.exec(e))return[$i(t[1]+t[1]),$i(t[2]+t[2]),$i(t[3]+t[3]),Dh($i(t[4]+t[4])/255)];if(e in BE)return od(BE[e]);throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function Yhe(e){return e>1?1:e<0?0:e}function AI(e,t,n,r){return`rgba(${di(e)}, ${di(t)}, ${di(n)}, ${Yhe(r)})`}function zb(e,t,n,r,o){return di((e*t*(1-r)+n*r)/o)}function d0(e,t){Array.isArray(e)||(e=od(e)),Array.isArray(t)||(t=od(t));const n=e[3],r=t[3],o=Dh(n+r-n*r);return AI(zb(e[0],n,t[0],r,o),zb(e[1],n,t[1],r,o),zb(e[2],n,t[2],r,o),o)}function Pc(e,t){const[n,r,o,i=1]=Array.isArray(e)?e:od(e);return t.alpha?AI(n,r,o,t.alpha):AI(n,r,o,i)}function Gm(e,t){const[n,r,o,i=1]=Array.isArray(e)?e:od(e),{lightness:s=1,alpha:u=1}=t;return Jhe([n*s,r*s,o*s,i*u])}function Dh(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function di(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function Jhe(e){const[t,n,r]=e;return 3 in e?`rgba(${di(t)}, ${di(n)}, ${di(r)}, ${Dh(e[3])})`:`rgba(${di(t)}, ${di(n)}, ${di(r)}, 1)`}function Xhe(e=8){return Math.random().toString(16).slice(2,2+e)}function Zhe(e,t=[],n){const r={};return t.forEach(o=>{r[o]=e[o]}),Object.assign(r,n)}function Qhe(e,t=[],n){const r={};return Object.getOwnPropertyNames(e).forEach(i=>{t.includes(i)||(r[i]=e[i])}),Object.assign(r,n)}function _f(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(Fr(String(r)));return}if(Array.isArray(r)){_f(r,t,n);return}if(r.type===dt){if(r.children===null)return;Array.isArray(r.children)&&_f(r.children,t,n)}else r.type!==Di&&n.push(r)}}),n}function Er(e,...t){if(Array.isArray(e))e.forEach(n=>Er(n,...t));else return e(...t)}const ege=(e,...t)=>typeof e=="function"?e(...t):typeof e=="string"?Fr(e):typeof e=="number"?Fr(String(e)):null;function HE(e,t){console.error(`[naive/${e}]: ${t}`)}function f4(e,t){throw new Error(`[naive/${e}]: ${t}`)}function qE(e,t="default",n=void 0){const r=e[t];if(!r)return HE("getFirstSlotVNode",`slot[${t}] is empty`),null;const o=_f(r(n));return o.length===1?o[0]:(HE("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function Tg(e){return e.some(t=>qh(t)?!(t.type===Di||t.type===dt&&!Tg(t.children)):!0)?e:null}function Eh(e,t){return e&&Tg(e())||t()}function tge(e,t,n){return e&&Tg(e(t))||n(t)}function Vs(e,t){const n=e&&Tg(e());return t(n||null)}function LI(e){return!(e&&Tg(e()))}const VE=ot({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),nge=/^(\d|\.)+$/,zE=/(\d|\.)+/;function jb(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(nge.test(e)){const o=(Number(e)+n)*t;return r?o===0?"0":`${o}px`:`${o}`}else{const o=zE.exec(e);return o?e.replace(zE,String((Number(o[0])+n)*t)):e}return e}function jE(e){return e.replace(/#|\(|\)|,|\s/g,"_")}function rge(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const p4=/\s*,(?![^(]*\))\s*/g,oge=/\s+/g;function ige(e,t){const n=[];return t.split(p4).forEach(r=>{let o=rge(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 sge(e,t){const n=[];return t.split(p4).forEach(r=>{e.forEach(o=>{n.push((o&&o+" ")+r)})}),n}function age(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=ige(t,n):t=sge(t,n))}),t.join(", ").replace(oge," ")}function WE(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function f0(e){return document.querySelector(`style[cssr-id="${e}"]`)}function lge(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 uge=/[A-Z]/g;function h4(e){return e.replace(uge,t=>"-"+t.toLowerCase())}function cge(e,t=" "){return typeof e=="object"&&e!==null?` {
- `+Object.entries(e).map(n=>t+` ${h4(n[0])}: ${n[1]};`).join(`
- `)+`
- `+t+"}":`: ${e};`}function dge(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function KE(e,t,n,r){if(!t)return"";const o=dge(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=h4(u),d!=null&&s.push(` ${u}${cge(d)}`)}),e&&s.push("}"),s.join(`
- `)}function OI(e,t,n){e&&e.forEach(r=>{if(Array.isArray(r))OI(r,t,n);else if(typeof r=="function"){const o=r(t);Array.isArray(o)?OI(o,t,n):o&&n(o)}else r&&n(r)})}function g4(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=age(t),f=KE(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&&OI(e.children,{context:r.context,props:o},g=>{if(typeof g=="string"){const v=KE(d,{raw:g},r,o);i?i.insertRule(v):n.push(v)}else g4(g,t,n,r,o,i)}),t.pop(),u&&n.push("}"),s&&s.after&&s.after(r.context)}function m4(e,t,n,r=!1){const o=[];return g4(e,[],o,t,n,r?e.instance.__styleSheet:void 0),r?"":o.join(`
- `)}function RI(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 fge(e,t,n){const{els:r}=t;if(n===void 0)r.forEach(WE),t.els=[];else{const o=f0(n);o&&r.includes(o)&&(WE(o),t.els=r.filter(i=>i!==o))}}function YE(e,t){e.push(t)}function pge(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,m4(t,e,r,i));return}let f;if(n===void 0&&(f=t.render(r),n=RI(f)),d){d.adapter(n,f??t.render(r));return}const g=f0(n);if(g!==null&&!s)return g;const v=g??lge(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,_),YE(t.els,v),v}return o?document.head.insertBefore(v,document.head.querySelector("style, link")):document.head.appendChild(v),YE(t.els,v),v}function hge(e){return m4(this,this.instance,e)}function gge(e={}){const{id:t,ssr:n,props:r,head:o=!1,silent:i=!1,force:s=!1,anchorMetaName:u}=e;return pge(this.instance,this,t,r,o,i,s,u,n)}function mge(e={}){const{id:t}=e;fge(this.instance,this,t)}const Bm=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:hge,mount:gge,unmount:mge}},vge=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 v4(e={}){let t=null;const n={c:(...r)=>vge(n,...r),use:(r,...o)=>r.install(n,...o),find:f0,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 yge(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return f0(e)!==null}function _ge(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:R}){return C=typeof C=="string"?C:C({context:S,props:R}),S.bem.b=C,`${(R==null?void 0:R.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(R=>R.trim()),w.bem.els.map(R=>`${(S==null?void 0:S.bPrefix)||t}${w.bem.b}${n}${R}`).join(", ")}}}function d(C){return{$({context:D,props:w}){C=typeof C=="string"?C:C({context:D,props:w});const S=C.split(",").map(N=>N.trim());function R(N){return S.map(H=>`&${(w==null?void 0:w.bPrefix)||t}${D.bem.b}${N!==void 0?`${n}${N}`:""}${r}${H}`).join(", ")}const A=D.bem.els;return A!==null?R(A[0]):R()}}}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 bge="n",Mge=`.${bge}-`,Ige="__",Cge="--",y4=v4(),_4=_ge({blockPrefix:Mge,elementPrefix:Ige,modifierPrefix:Cge});y4.use(_4);const{c:ut,find:rCe}=y4,{cB:et,cE:gt,cM:Mt,cNotM:is}=_4,Tge=(...e)=>ut(">",[et(...e)]);let Wb;function wge(){return Wb===void 0&&(Wb=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Wb}const wg=typeof document<"u"&&typeof window<"u";function Sge(e){const t=Ne(!!e.value);if(t.value)return xh(t);const n=$t(e,r=>{r&&(t.value=!0,n())});return xh(t)}function Iu(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 kge=typeof window<"u";let bf,Ah;const Dge=()=>{var e,t;bf=kge?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,Ah=!1,bf!==void 0?bf.then(()=>{Ah=!0}):Ah=!0};Dge();function b4(e){if(Ah)return;let t=!1;On(()=>{Ah||bf==null||bf.then(()=>{t||e()})}),vi(()=>{t=!0})}function _v(e){return e.composedPath()[0]}const Ege={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Age(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 M4(e,t,n){const r=Ege[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=Age(e,t,n)),i}function Lge(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const o=M4(e,t,n);return Object.keys(o).forEach(i=>{po(i,document,o[i],r)}),!0}return!1}function Oge(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const o=M4(e,t,n);return Object.keys(o).forEach(i=>{Mr(i,document,o[i],r)}),!0}return!1}function Rge(){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,B,j){const G=x[B];return x[B]=function(){return j.apply(x,arguments),G.apply(x,arguments)},x}function i(x,B){x[B]=Event.prototype[B]}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,B){u!==void 0&&Object.defineProperty(x,"currentTarget",{configurable:!0,enumerable:!0,get:B??u.get})}const g={bubble:{},capture:{}},v={};function _(){const x=function(B){const{type:j,eventPhase:G,bubbles:L}=B,T=_v(B);if(G===2)return;const P=G===1?"capture":"bubble";let Q=T;const Y=[];for(;Q===null&&(Q=window),Y.push(Q),Q!==window;)Q=Q.parentNode||null;const oe=g.capture[j],X=g.bubble[j];if(o(B,"stopPropagation",n),o(B,"stopImmediatePropagation",r),f(B,d),P==="capture"){if(oe===void 0)return;for(let ae=Y.length-1;ae>=0&&!e.has(B);--ae){const fe=Y[ae],le=oe.get(fe);if(le!==void 0){s.set(B,fe);for(const ce of le){if(t.has(B))break;ce(B)}}if(ae===0&&!L&&X!==void 0){const ce=X.get(fe);if(ce!==void 0)for(const J of ce){if(t.has(B))break;J(B)}}}}else if(P==="bubble"){if(X===void 0)return;for(let ae=0;ae<Y.length&&!e.has(B);++ae){const fe=Y[ae],le=X.get(fe);if(le!==void 0){s.set(B,fe);for(const ce of le){if(t.has(B))break;ce(B)}}}}i(B,"stopPropagation"),i(B,"stopImmediatePropagation"),f(B)};return x.displayName="evtdUnifiedHandler",x}function M(){const x=function(B){const{type:j,eventPhase:G}=B;if(G!==2)return;const L=v[j];L!==void 0&&L.forEach(T=>T(B))};return x.displayName="evtdUnifiedWindowEventHandler",x}const C=_(),D=M();function w(x,B){const j=g[x];return j[B]===void 0&&(j[B]=new Map,window.addEventListener(B,C,x==="capture")),j[B]}function S(x){return v[x]===void 0&&(v[x]=new Set,window.addEventListener(x,D)),v[x]}function R(x,B){let j=x.get(B);return j===void 0&&x.set(B,j=new Set),j}function A(x,B,j,G){const L=g[B][j];if(L!==void 0){const T=L.get(x);if(T!==void 0&&T.has(G))return!0}return!1}function N(x,B){const j=v[x];return!!(j!==void 0&&j.has(B))}function H(x,B,j,G){let L;if(typeof G=="object"&&G.once===!0?L=oe=>{z(x,B,L,G),j(oe)}:L=j,Lge(x,B,L,G))return;const P=G===!0||typeof G=="object"&&G.capture===!0?"capture":"bubble",Q=w(P,x),Y=R(Q,B);if(Y.has(L)||Y.add(L),B===window){const oe=S(x);oe.has(L)||oe.add(L)}}function z(x,B,j,G){if(Oge(x,B,j,G))return;const T=G===!0||typeof G=="object"&&G.capture===!0,P=T?"capture":"bubble",Q=w(P,x),Y=R(Q,B);if(B===window&&!A(B,T?"bubble":"capture",x,j)&&N(x,j)){const X=v[x];X.delete(j),X.size===0&&(window.removeEventListener(x,D),v[x]=void 0)}Y.has(j)&&Y.delete(j),Y.size===0&&Q.delete(B),Q.size===0&&(window.removeEventListener(x,C,P==="capture"),g[P][x]=void 0)}return{on:H,off:z}}const{on:po,off:Mr}=Rge();function WT(e,t){return $t(e,n=>{n!==void 0&&(t.value=n)}),Ve(()=>e.value===void 0?t.value:e.value)}function p0(){const e=Ne(!1);return On(()=>{e.value=!0}),xh(e)}function vy(e,t){return Ve(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const Nge=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Pge(){return Nge}const xge="n-internal-select-menu-body",I4="n-modal-body",C4="n-drawer-body",T4="n-popover-body",w4="__disabled__";function Ff(e){const t=tn(I4,null),n=tn(C4,null),r=tn(T4,null),o=tn(xge,null),i=Ne();if(typeof document<"u"){i.value=document.fullscreenElement;const s=()=>{i.value=document.fullscreenElement};On(()=>{po("fullscreenchange",document,s)}),vi(()=>{Mr("fullscreenchange",document,s)})}return Iu(()=>{var s;const{to:u}=e;return u!==void 0?u===!1?w4: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")})}Ff.tdkey=w4;Ff.propTo={type:[String,Object,Boolean],default:void 0};function NI(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function PI(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(Fr(String(r)));return}if(Array.isArray(r)){PI(r,t,n);return}if(r.type===dt){if(r.children===null)return;Array.isArray(r.children)&&PI(r.children,t,n)}else r.type!==Di&&n.push(r)}}),n}function JE(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const o=PI(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Ol=null;function S4(){if(Ol===null&&(Ol=document.getElementById("v-binder-view-measurer"),Ol===null)){Ol=document.createElement("div"),Ol.id="v-binder-view-measurer";const{style:e}=Ol;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Ol)}return Ol.getBoundingClientRect()}function Uge(e,t){const n=S4();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function Kb(e){const t=e.getBoundingClientRect(),n=S4();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 Fge(e){return e.nodeType===9?null:e.parentNode}function k4(e){if(e===null)return null;const t=Fge(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 k4(t)}const Gge=ot({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;ci("VBinder",(t=Yi())===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=k4(S),S!==null;)i.push(S);for(const R of i)po("scroll",R,v,!0)},u=()=>{for(const S of i)Mr("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=()=>{d4(_)},_=()=>{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&&Mr("resize",window,w)},w=()=>{M.forEach(S=>S())};return vi(()=>{Mr("resize",window,w),u()}),{targetRef:r,setTargetRef:o,addScrollListener:f,removeScrollListener:g,addResizeListener:C,removeResizeListener:D}},render(){return NI("binder",this.$slots)}}),$ge=Gge,Bge=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(JE("follower",this.$slots),[[t]]):JE("follower",this.$slots)}}),Hd="@@mmoContext",Hge={mounted(e,{value:t}){e[Hd]={handler:void 0},typeof t=="function"&&(e[Hd].handler=t,po("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Hd];typeof t=="function"?n.handler?n.handler!==t&&(Mr("mousemoveoutside",e,n.handler),n.handler=t,po("mousemoveoutside",e,t)):(e[Hd].handler=t,po("mousemoveoutside",e,t)):n.handler&&(Mr("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Hd];t&&Mr("mousemoveoutside",e,t),e[Hd].handler=void 0}},qge=Hge,qd="@@coContext",Vge={mounted(e,{value:t,modifiers:n}){e[qd]={handler:void 0},typeof t=="function"&&(e[qd].handler=t,po("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[qd];typeof t=="function"?r.handler?r.handler!==t&&(Mr("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,po("clickoutside",e,t,{capture:n.capture})):(e[qd].handler=t,po("clickoutside",e,t,{capture:n.capture})):r.handler&&(Mr("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[qd];n&&Mr("clickoutside",e,n,{capture:t.capture}),e[qd].handler=void 0}},XE=Vge;function zge(e,t){console.error(`[vdirs/${e}]: ${t}`)}class jge{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&&zge("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 Yb=new jge,Vd="@@ziContext",Wge={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:o}=n;e[Vd]={enabled:!!o,initialized:!1},o&&(Yb.ensureZIndex(e,r),e[Vd].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:o}=n,i=e[Vd].enabled;o&&!i&&(Yb.ensureZIndex(e,r),e[Vd].initialized=!0),e[Vd].enabled=!!o},unmounted(e,t){if(!e[Vd].initialized)return;const{value:n={}}=t,{zIndex:r}=n;Yb.unregister(e,r)}},KT=Wge,D4=Symbol("@css-render/vue3-ssr");function Kge(e,t){return`<style cssr-id="${e}">
- ${t}
- </style>`}function Yge(e,t){const n=tn(D4,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(Kge(e,t)))}const Jge=typeof document<"u";function tp(){if(Jge)return;const e=tn(D4,null);if(e!==null)return{adapter:Yge,context:e}}function ZE(e,t){console.error(`[vueuc/${e}]: ${t}`)}const{c:nf}=v4(),E4="vueuc-style";function QE(e){return typeof e=="string"?document.querySelector(e):e()}const A4=ot({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:Sge(dr(e,"show")),mergedTo:Ve(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?NI("lazy-teleport",this.$slots):Re(bC,{disabled:this.disabled,to:this.mergedTo},NI("lazy-teleport",this.$slots)):null}}),Hm={top:"bottom",bottom:"top",left:"right",right:"left"},eA={start:"end",center:"center",end:"start"},Jb={top:"height",bottom:"height",left:"width",right:"width"},Xge={"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"},Zge={"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"},Qge={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},tA={top:!0,bottom:!1,left:!0,right:!1},nA={top:"end",bottom:"start",left:"end",right:"start"};function eme(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 R=n[M]-t[C]-t[M];return R>0&&r&&(D?S=tA[C]?R:-R:w=tA[C]?R:-R),{left:w,top:S}},v=s==="left"||s==="right";if(d!=="center"){const M=Qge[e],C=Hm[M],D=Jb[M];if(n[D]>t[D]){if(t[M]+t[D]<n[D]){const w=(n[D]-t[D])/2;t[M]<w||t[C]<w?t[M]<t[C]?(d=eA[u],f=g(D,C,v)):f=g(D,M,v):d="center"}}else n[D]<t[D]&&t[C]<0&&t[M]>t[C]&&(d=eA[u])}else{const M=s==="bottom"||s==="top"?"left":"top",C=Hm[M],D=Jb[M],w=(n[D]-t[D])/2;(t[M]<w||t[C]<w)&&(t[M]>t[C]?(d=nA[M],f=g(D,M,v)):(d=nA[C],f=g(D,C,v)))}let _=s;return t[s]<n[Jb[s]]&&t[s]<t[Hm[s]]&&(_=Hm[s]),{placement:d!=="center"?`${_}-${d}`:_,left:f.left,top:f.top}}function tme(e,t){return t?Zge[e]:Xge[e]}function nme(e,t,n,r,o,i){if(i)switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+o)}px`,transform:"translateX(-50%)"}}}const rme=nf([nf(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),nf(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[nf("> *",{pointerEvents:"all"})])]),ome=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=Iu(()=>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=tp();rme.mount({id:"vueuc/binder",head:!0,anchorMetaName:E4,ssr:u}),vi(()=>{s()}),b4(()=>{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?Uge(C,D):Kb(M);_.style.setProperty("--v-target-width",`${Math.round(S.width)}px`),_.style.setProperty("--v-target-height",`${Math.round(S.height)}px`);const{width:R,minWidth:A,placement:N,internalShift:H,flip:z}=e;_.setAttribute("v-placement",N),w?_.setAttribute("v-overlap",""):_.removeAttribute("v-overlap");const{style:x}=_;R==="target"?x.width=`${S.width}px`:R!==void 0?x.width=R:x.width="",A==="target"?x.minWidth=`${S.width}px`:A!==void 0?x.minWidth=A:x.minWidth="";const B=Kb(_),j=Kb(o.value),{left:G,top:L,placement:T}=eme(N,S,B,H,z,w),P=tme(T,w),{left:Q,top:Y,transform:oe}=nme(T,j,S,L,G,w);_.setAttribute("v-placement",T),_.style.setProperty("--v-offset-left",`${Math.round(G)}px`),_.style.setProperty("--v-offset-top",`${Math.round(L)}px`),_.style.transform=`translateX(${Q}) translateY(${Y}) ${oe}`,_.style.setProperty("--v-transform-origin",P),_.style.transformOrigin=P};$t(n,_=>{_?(i(),f()):s()});const f=()=>{Ir().then(d).catch(_=>console.error(_))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(_=>{$t(dr(e,_),d)}),["teleportDisabled"].forEach(_=>{$t(dr(e,_),f)}),$t(dr(e,"syncTrigger"),_=>{_.includes("resize")?t.addResizeListener(d):t.removeResizeListener(d),_.includes("scroll")?t.addScrollListener(d):t.removeScrollListener(d)});const g=p0(),v=Iu(()=>{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(A4,{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,[[KT,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var Jc=[],ime=function(){return Jc.some(function(e){return e.activeTargets.length>0})},sme=function(){return Jc.some(function(e){return e.skippedTargets.length>0})},rA="ResizeObserver loop completed with undelivered notifications.",ame=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:rA}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=rA),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 Xc=function(e){return Object.freeze(e)},lme=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,Xc(this)}return e}(),L4=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,Xc(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}(),YT=function(e){return e instanceof SVGElement&&"getBBox"in e},O4=function(e){if(YT(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)},oA=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)},ume=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},Lh=typeof window<"u"?window:{},qm=new WeakMap,iA=/auto|scroll/,cme=/^tb|vertical/,dme=/msie|trident/i.test(Lh.navigator&&Lh.navigator.userAgent),la=function(e){return parseFloat(e||"0")},Mf=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new lme((n?t:e)||0,(n?e:t)||0)},sA=Xc({devicePixelContentBoxSize:Mf(),borderBoxSize:Mf(),contentBoxSize:Mf(),contentRect:new L4(0,0,0,0)}),R4=function(e,t){if(t===void 0&&(t=!1),qm.has(e)&&!t)return qm.get(e);if(O4(e))return qm.set(e,sA),sA;var n=getComputedStyle(e),r=YT(e)&&e.ownerSVGElement&&e.getBBox(),o=!dme&&n.boxSizing==="border-box",i=cme.test(n.writingMode||""),s=!r&&iA.test(n.overflowY||""),u=!r&&iA.test(n.overflowX||""),d=r?0:la(n.paddingTop),f=r?0:la(n.paddingRight),g=r?0:la(n.paddingBottom),v=r?0:la(n.paddingLeft),_=r?0:la(n.borderTopWidth),M=r?0:la(n.borderRightWidth),C=r?0:la(n.borderBottomWidth),D=r?0:la(n.borderLeftWidth),w=v+f,S=d+g,R=D+M,A=_+C,N=u?e.offsetHeight-A-e.clientHeight:0,H=s?e.offsetWidth-R-e.clientWidth:0,z=o?w+R:0,x=o?S+A:0,B=r?r.width:la(n.width)-z-H,j=r?r.height:la(n.height)-x-N,G=B+w+H+R,L=j+S+N+A,T=Xc({devicePixelContentBoxSize:Mf(Math.round(B*devicePixelRatio),Math.round(j*devicePixelRatio),i),borderBoxSize:Mf(G,L,i),contentBoxSize:Mf(B,j,i),contentRect:new L4(v,d,B,j)});return qm.set(e,T),T},N4=function(e,t,n){var r=R4(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}},fme=function(){function e(t){var n=R4(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=Xc([n.borderBoxSize]),this.contentBoxSize=Xc([n.contentBoxSize]),this.devicePixelContentBoxSize=Xc([n.devicePixelContentBoxSize])}return e}(),P4=function(e){if(O4(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},pme=function(){var e=1/0,t=[];Jc.forEach(function(s){if(s.activeTargets.length!==0){var u=[];s.activeTargets.forEach(function(f){var g=new fme(f.target),v=P4(f.target);u.push(g),f.lastReportedSize=N4(f.target,f.observedBox),v<e&&(e=v)}),t.push(function(){s.callback.call(s.observer,u,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var o=r[n];o()}return e},aA=function(e){Jc.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(P4(o.target)>e?n.activeTargets.push(o):n.skippedTargets.push(o))})})},hme=function(){var e=0;for(aA(e);ime();)e=pme(),aA(e);return sme()&&ame(),e>0},Xb,x4=[],gme=function(){return x4.splice(0).forEach(function(e){return e()})},mme=function(e){if(!Xb){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return gme()}).observe(n,r),Xb=function(){n.textContent="".concat(t?t--:t++)}}x4.push(e),Xb()},vme=function(e){mme(function(){requestAnimationFrame(e)})},bv=0,yme=function(){return!!bv},_me=250,bme={attributes:!0,characterData:!0,childList:!0,subtree:!0},lA=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],uA=function(e){return e===void 0&&(e=0),Date.now()+e},Zb=!1,Mme=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=_me),!Zb){Zb=!0;var r=uA(t);vme(function(){var o=!1;try{o=hme()}finally{if(Zb=!1,t=r-uA(),!yme())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,bme)};document.body?n():Lh.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),lA.forEach(function(n){return Lh.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),lA.forEach(function(n){return Lh.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),xI=new Mme,cA=function(e){!bv&&e>0&&xI.start(),bv+=e,!bv&&xI.stop()},Ime=function(e){return!YT(e)&&!ume(e)&&getComputedStyle(e).display==="inline"},Cme=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=N4(this.target,this.observedBox,!0);return Ime(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Tme=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),Vm=new WeakMap,dA=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},zm=function(){function e(){}return e.connect=function(t,n){var r=new Tme(t,n);Vm.set(t,r)},e.observe=function(t,n,r){var o=Vm.get(t),i=o.observationTargets.length===0;dA(o.observationTargets,n)<0&&(i&&Jc.push(o),o.observationTargets.push(new Cme(n,r&&r.box)),cA(1),xI.schedule())},e.unobserve=function(t,n){var r=Vm.get(t),o=dA(r.observationTargets,n),i=r.observationTargets.length===1;o>=0&&(i&&Jc.splice(Jc.indexOf(r),1),r.observationTargets.splice(o,1),cA(-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}(),wme=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(!oA(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(!oA(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 Sme{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||wme)(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 fA=new Sme,lg=ot({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const n=Yi().proxy;function r(o){const{onResize:i}=e;i!==void 0&&i(o)}On(()=>{const o=n.$el;if(o===void 0){ZE("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){ZE("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(fA.registerHandler(o.nextElementSibling,r),t=!0)}),vi(()=>{t&&fA.unregisterHandler(n.$el.nextElementSibling)})},render(){return Ft(this.$slots,"default")}}),kme=nf(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[nf("&::-webkit-scrollbar",{width:0,height:0})]),Dme=ot({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const e=Ne(null);function t(o){!(o.currentTarget.offsetWidth<o.currentTarget.scrollWidth)||o.deltaY===0||(o.currentTarget.scrollLeft+=o.deltaY+o.deltaX,o.preventDefault())}const n=tp();return kme.mount({id:"vueuc/x-scroll",head:!0,anchorMetaName:E4,ssr:n}),Object.assign({selfRef:e,handleWheel:t},{scrollTo(...o){var i;(i=e.value)===null||i===void 0||i.scrollTo(...o)}})},render(){return Re("div",{ref:"selfRef",onScroll:this.onScroll,onWheel:this.disabled?void 0:this.handleWheel,class:"v-x-scroll"},this.$slots)}});function U4(e){return e instanceof HTMLElement}function F4(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(U4(n)&&($4(n)||F4(n)))return!0}return!1}function G4(e){for(let t=e.childNodes.length-1;t>=0;t--){const n=e.childNodes[t];if(U4(n)&&($4(n)||G4(n)))return!0}return!1}function $4(e){if(!Eme(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Eme(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 zp=[];const Ame=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=Xhe(),n=Ne(null),r=Ne(null);let o=!1,i=!1;const s=typeof document>"u"?null:document.activeElement;function u(){return zp[zp.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)):(Mr("keydown",document,d),o&&_())},{immediate:!0})}),vi(()=>{Mr("keydown",document,d),o&&_()});function f(w){if(!i&&u()){const S=g();if(S===null||S.contains(gy(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(zp.push(t),e.autoFocus){const{initialFocusTo:S}=e;S===void 0?M("first"):(w=QE(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),zp=zp.filter(R=>R!==t),u()))return;const{finalFocusTo:S}=e;S!==void 0?(w=QE(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,R=r.value;if(S!==null&&R!==null){const A=g();if(A==null||A===R){i=!0,S.focus({preventScroll:!0}),i=!1;return}i=!0;const N=w==="first"?F4(A):G4(A);i=!1,N||(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 Lme(e){const t={isDeactivated:!1};let n=!1;return RL(()=>{if(t.isDeactivated=!1,!n){n=!0;return}e()}),NL(()=>{t.isDeactivated=!0,n||(n=!0)}),t}const pA="n-form-item";function B4(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const o=tn(pA,null);ci(pA,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 vi(()=>{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 Ome=typeof global=="object"&&global&&global.Object===Object&&global;const H4=Ome;var Rme=typeof self=="object"&&self&&self.Object===Object&&self,Nme=H4||Rme||Function("return this")();const Zs=Nme;var Pme=Zs.Symbol;const Cu=Pme;var q4=Object.prototype,xme=q4.hasOwnProperty,Ume=q4.toString,jp=Cu?Cu.toStringTag:void 0;function Fme(e){var t=xme.call(e,jp),n=e[jp];try{e[jp]=void 0;var r=!0}catch{}var o=Ume.call(e);return r&&(t?e[jp]=n:delete e[jp]),o}var Gme=Object.prototype,$me=Gme.toString;function Bme(e){return $me.call(e)}var Hme="[object Null]",qme="[object Undefined]",hA=Cu?Cu.toStringTag:void 0;function pd(e){return e==null?e===void 0?qme:Hme:hA&&hA in Object(e)?Fme(e):Bme(e)}function Tu(e){return e!=null&&typeof e=="object"}var Vme="[object Symbol]";function h0(e){return typeof e=="symbol"||Tu(e)&&pd(e)==Vme}function V4(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var zme=Array.isArray;const As=zme;var jme=1/0,gA=Cu?Cu.prototype:void 0,mA=gA?gA.toString:void 0;function z4(e){if(typeof e=="string")return e;if(As(e))return V4(e,z4)+"";if(h0(e))return mA?mA.call(e):"";var t=e+"";return t=="0"&&1/e==-jme?"-0":t}var Wme=/\s/;function Kme(e){for(var t=e.length;t--&&Wme.test(e.charAt(t)););return t}var Yme=/^\s+/;function Jme(e){return e&&e.slice(0,Kme(e)+1).replace(Yme,"")}function Ls(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var vA=0/0,Xme=/^[-+]0x[0-9a-f]+$/i,Zme=/^0b[01]+$/i,Qme=/^0o[0-7]+$/i,eve=parseInt;function yA(e){if(typeof e=="number")return e;if(h0(e))return vA;if(Ls(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ls(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Jme(e);var n=Zme.test(e);return n||Qme.test(e)?eve(e.slice(2),n?2:8):Xme.test(e)?vA:+e}function JT(e){return e}var tve="[object AsyncFunction]",nve="[object Function]",rve="[object GeneratorFunction]",ove="[object Proxy]";function XT(e){if(!Ls(e))return!1;var t=pd(e);return t==nve||t==rve||t==tve||t==ove}var ive=Zs["__core-js_shared__"];const Qb=ive;var _A=function(){var e=/[^.]+$/.exec(Qb&&Qb.keys&&Qb.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sve(e){return!!_A&&_A in e}var ave=Function.prototype,lve=ave.toString;function hd(e){if(e!=null){try{return lve.call(e)}catch{}try{return e+""}catch{}}return""}var uve=/[\\^$.*+?()[\]{}|]/g,cve=/^\[object .+?Constructor\]$/,dve=Function.prototype,fve=Object.prototype,pve=dve.toString,hve=fve.hasOwnProperty,gve=RegExp("^"+pve.call(hve).replace(uve,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mve(e){if(!Ls(e)||sve(e))return!1;var t=XT(e)?gve:cve;return t.test(hd(e))}function vve(e,t){return e==null?void 0:e[t]}function gd(e,t){var n=vve(e,t);return mve(n)?n:void 0}var yve=gd(Zs,"WeakMap");const UI=yve;var bA=Object.create,_ve=function(){function e(){}return function(t){if(!Ls(t))return{};if(bA)return bA(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const bve=_ve;function Mve(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ive(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Cve=800,Tve=16,wve=Date.now;function Sve(e){var t=0,n=0;return function(){var r=wve(),o=Tve-(r-n);if(n=r,o>0){if(++t>=Cve)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function kve(e){return function(){return e}}var Dve=function(){try{var e=gd(Object,"defineProperty");return e({},"",{}),e}catch{}}();const yy=Dve;var Eve=yy?function(e,t){return yy(e,"toString",{configurable:!0,enumerable:!1,value:kve(t),writable:!0})}:JT;const Ave=Eve;var Lve=Sve(Ave);const Ove=Lve;var Rve=9007199254740991,Nve=/^(?:0|[1-9]\d*)$/;function ZT(e,t){var n=typeof e;return t=t??Rve,!!t&&(n=="number"||n!="symbol"&&Nve.test(e))&&e>-1&&e%1==0&&e<t}function QT(e,t,n){t=="__proto__"&&yy?yy(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Sg(e,t){return e===t||e!==e&&t!==t}var Pve=Object.prototype,xve=Pve.hasOwnProperty;function Uve(e,t,n){var r=e[t];(!(xve.call(e,t)&&Sg(r,n))||n===void 0&&!(t in e))&&QT(e,t,n)}function Fve(e,t,n,r){var o=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var u=t[i],d=r?r(n[u],e[u],u,n,e):void 0;d===void 0&&(d=e[u]),o?QT(n,u,d):Uve(n,u,d)}return n}var MA=Math.max;function Gve(e,t,n){return t=MA(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=MA(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=r[o];return u[t]=n(s),Mve(e,this,u)}}function $ve(e,t){return Ove(Gve(e,t,JT),e+"")}var Bve=9007199254740991;function ew(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Bve}function np(e){return e!=null&&ew(e.length)&&!XT(e)}function Hve(e,t,n){if(!Ls(n))return!1;var r=typeof t;return(r=="number"?np(n)&&ZT(t,n.length):r=="string"&&t in n)?Sg(n[t],e):!1}function qve(e){return $ve(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&&Hve(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var u=n[r];u&&e(t,u,r,i)}return t})}var Vve=Object.prototype;function tw(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Vve;return e===n}function zve(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var jve="[object Arguments]";function IA(e){return Tu(e)&&pd(e)==jve}var j4=Object.prototype,Wve=j4.hasOwnProperty,Kve=j4.propertyIsEnumerable,Yve=IA(function(){return arguments}())?IA:function(e){return Tu(e)&&Wve.call(e,"callee")&&!Kve.call(e,"callee")};const _y=Yve;function Jve(){return!1}var W4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,CA=W4&&typeof module=="object"&&module&&!module.nodeType&&module,Xve=CA&&CA.exports===W4,TA=Xve?Zs.Buffer:void 0,Zve=TA?TA.isBuffer:void 0,Qve=Zve||Jve;const by=Qve;var eye="[object Arguments]",tye="[object Array]",nye="[object Boolean]",rye="[object Date]",oye="[object Error]",iye="[object Function]",sye="[object Map]",aye="[object Number]",lye="[object Object]",uye="[object RegExp]",cye="[object Set]",dye="[object String]",fye="[object WeakMap]",pye="[object ArrayBuffer]",hye="[object DataView]",gye="[object Float32Array]",mye="[object Float64Array]",vye="[object Int8Array]",yye="[object Int16Array]",_ye="[object Int32Array]",bye="[object Uint8Array]",Mye="[object Uint8ClampedArray]",Iye="[object Uint16Array]",Cye="[object Uint32Array]",_r={};_r[gye]=_r[mye]=_r[vye]=_r[yye]=_r[_ye]=_r[bye]=_r[Mye]=_r[Iye]=_r[Cye]=!0;_r[eye]=_r[tye]=_r[pye]=_r[nye]=_r[hye]=_r[rye]=_r[oye]=_r[iye]=_r[sye]=_r[aye]=_r[lye]=_r[uye]=_r[cye]=_r[dye]=_r[fye]=!1;function Tye(e){return Tu(e)&&ew(e.length)&&!!_r[pd(e)]}function wye(e){return function(t){return e(t)}}var K4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Oh=K4&&typeof module=="object"&&module&&!module.nodeType&&module,Sye=Oh&&Oh.exports===K4,eM=Sye&&H4.process,kye=function(){try{var e=Oh&&Oh.require&&Oh.require("util").types;return e||eM&&eM.binding&&eM.binding("util")}catch{}}();const wA=kye;var SA=wA&&wA.isTypedArray,Dye=SA?wye(SA):Tye;const nw=Dye;var Eye=Object.prototype,Aye=Eye.hasOwnProperty;function Y4(e,t){var n=As(e),r=!n&&_y(e),o=!n&&!r&&by(e),i=!n&&!r&&!o&&nw(e),s=n||r||o||i,u=s?zve(e.length,String):[],d=u.length;for(var f in e)(t||Aye.call(e,f))&&!(s&&(f=="length"||o&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ZT(f,d)))&&u.push(f);return u}function J4(e,t){return function(n){return e(t(n))}}var Lye=J4(Object.keys,Object);const Oye=Lye;var Rye=Object.prototype,Nye=Rye.hasOwnProperty;function Pye(e){if(!tw(e))return Oye(e);var t=[];for(var n in Object(e))Nye.call(e,n)&&n!="constructor"&&t.push(n);return t}function rw(e){return np(e)?Y4(e):Pye(e)}function xye(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Uye=Object.prototype,Fye=Uye.hasOwnProperty;function Gye(e){if(!Ls(e))return xye(e);var t=tw(e),n=[];for(var r in e)r=="constructor"&&(t||!Fye.call(e,r))||n.push(r);return n}function X4(e){return np(e)?Y4(e,!0):Gye(e)}var $ye=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bye=/^\w*$/;function ow(e,t){if(As(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||h0(e)?!0:Bye.test(e)||!$ye.test(e)||t!=null&&e in Object(t)}var Hye=gd(Object,"create");const ug=Hye;function qye(){this.__data__=ug?ug(null):{},this.size=0}function Vye(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zye="__lodash_hash_undefined__",jye=Object.prototype,Wye=jye.hasOwnProperty;function Kye(e){var t=this.__data__;if(ug){var n=t[e];return n===zye?void 0:n}return Wye.call(t,e)?t[e]:void 0}var Yye=Object.prototype,Jye=Yye.hasOwnProperty;function Xye(e){var t=this.__data__;return ug?t[e]!==void 0:Jye.call(t,e)}var Zye="__lodash_hash_undefined__";function Qye(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ug&&t===void 0?Zye:t,this}function id(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}id.prototype.clear=qye;id.prototype.delete=Vye;id.prototype.get=Kye;id.prototype.has=Xye;id.prototype.set=Qye;function e0e(){this.__data__=[],this.size=0}function g0(e,t){for(var n=e.length;n--;)if(Sg(e[n][0],t))return n;return-1}var t0e=Array.prototype,n0e=t0e.splice;function r0e(e){var t=this.__data__,n=g0(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():n0e.call(t,n,1),--this.size,!0}function o0e(e){var t=this.__data__,n=g0(t,e);return n<0?void 0:t[n][1]}function i0e(e){return g0(this.__data__,e)>-1}function s0e(e,t){var n=this.__data__,r=g0(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ml(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ml.prototype.clear=e0e;ml.prototype.delete=r0e;ml.prototype.get=o0e;ml.prototype.has=i0e;ml.prototype.set=s0e;var a0e=gd(Zs,"Map");const cg=a0e;function l0e(){this.size=0,this.__data__={hash:new id,map:new(cg||ml),string:new id}}function u0e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function m0(e,t){var n=e.__data__;return u0e(t)?n[typeof t=="string"?"string":"hash"]:n.map}function c0e(e){var t=m0(this,e).delete(e);return this.size-=t?1:0,t}function d0e(e){return m0(this,e).get(e)}function f0e(e){return m0(this,e).has(e)}function p0e(e,t){var n=m0(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function vl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vl.prototype.clear=l0e;vl.prototype.delete=c0e;vl.prototype.get=d0e;vl.prototype.has=f0e;vl.prototype.set=p0e;var h0e="Expected a function";function iw(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(h0e);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(iw.Cache||vl),n}iw.Cache=vl;var g0e=500;function m0e(e){var t=iw(e,function(r){return n.size===g0e&&n.clear(),r}),n=t.cache;return t}var v0e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,y0e=/\\(\\)?/g,_0e=m0e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(v0e,function(n,r,o,i){t.push(o?i.replace(y0e,"$1"):r||n)}),t});const b0e=_0e;function v0(e){return e==null?"":z4(e)}function Z4(e,t){return As(e)?e:ow(e,t)?[e]:b0e(v0(e))}var M0e=1/0;function y0(e){if(typeof e=="string"||h0(e))return e;var t=e+"";return t=="0"&&1/e==-M0e?"-0":t}function Q4(e,t){t=Z4(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[y0(t[n++])];return n&&n==r?e:void 0}function I0e(e,t,n){var r=e==null?void 0:Q4(e,t);return r===void 0?n:r}function C0e(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var T0e=J4(Object.getPrototypeOf,Object);const e3=T0e;var w0e="[object Object]",S0e=Function.prototype,k0e=Object.prototype,t3=S0e.toString,D0e=k0e.hasOwnProperty,E0e=t3.call(Object);function A0e(e){if(!Tu(e)||pd(e)!=w0e)return!1;var t=e3(e);if(t===null)return!0;var n=D0e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&t3.call(n)==E0e}function L0e(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?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<o;)i[r]=e[r+t];return i}function O0e(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:L0e(e,t,n)}var R0e="\\ud800-\\udfff",N0e="\\u0300-\\u036f",P0e="\\ufe20-\\ufe2f",x0e="\\u20d0-\\u20ff",U0e=N0e+P0e+x0e,F0e="\\ufe0e\\ufe0f",G0e="\\u200d",$0e=RegExp("["+G0e+R0e+U0e+F0e+"]");function n3(e){return $0e.test(e)}function B0e(e){return e.split("")}var r3="\\ud800-\\udfff",H0e="\\u0300-\\u036f",q0e="\\ufe20-\\ufe2f",V0e="\\u20d0-\\u20ff",z0e=H0e+q0e+V0e,j0e="\\ufe0e\\ufe0f",W0e="["+r3+"]",FI="["+z0e+"]",GI="\\ud83c[\\udffb-\\udfff]",K0e="(?:"+FI+"|"+GI+")",o3="[^"+r3+"]",i3="(?:\\ud83c[\\udde6-\\uddff]){2}",s3="[\\ud800-\\udbff][\\udc00-\\udfff]",Y0e="\\u200d",a3=K0e+"?",l3="["+j0e+"]?",J0e="(?:"+Y0e+"(?:"+[o3,i3,s3].join("|")+")"+l3+a3+")*",X0e=l3+a3+J0e,Z0e="(?:"+[o3+FI+"?",FI,i3,s3,W0e].join("|")+")",Q0e=RegExp(GI+"(?="+GI+")|"+Z0e+X0e,"g");function e_e(e){return e.match(Q0e)||[]}function t_e(e){return n3(e)?e_e(e):B0e(e)}function n_e(e){return function(t){t=v0(t);var n=n3(t)?t_e(t):void 0,r=n?n[0]:t.charAt(0),o=n?O0e(n,1).join(""):t.slice(1);return r[e]()+o}}var r_e=n_e("toUpperCase");const o_e=r_e;function i_e(e,t,n,r){var o=-1,i=e==null?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function s_e(e){return function(t){return e==null?void 0:e[t]}}var a_e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},l_e=s_e(a_e);const u_e=l_e;var c_e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,d_e="\\u0300-\\u036f",f_e="\\ufe20-\\ufe2f",p_e="\\u20d0-\\u20ff",h_e=d_e+f_e+p_e,g_e="["+h_e+"]",m_e=RegExp(g_e,"g");function v_e(e){return e=v0(e),e&&e.replace(c_e,u_e).replace(m_e,"")}var y_e=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function __e(e){return e.match(y_e)||[]}var b_e=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function M_e(e){return b_e.test(e)}var u3="\\ud800-\\udfff",I_e="\\u0300-\\u036f",C_e="\\ufe20-\\ufe2f",T_e="\\u20d0-\\u20ff",w_e=I_e+C_e+T_e,c3="\\u2700-\\u27bf",d3="a-z\\xdf-\\xf6\\xf8-\\xff",S_e="\\xac\\xb1\\xd7\\xf7",k_e="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",D_e="\\u2000-\\u206f",E_e=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",f3="A-Z\\xc0-\\xd6\\xd8-\\xde",A_e="\\ufe0e\\ufe0f",p3=S_e+k_e+D_e+E_e,h3="['’]",kA="["+p3+"]",L_e="["+w_e+"]",g3="\\d+",O_e="["+c3+"]",m3="["+d3+"]",v3="[^"+u3+p3+g3+c3+d3+f3+"]",R_e="\\ud83c[\\udffb-\\udfff]",N_e="(?:"+L_e+"|"+R_e+")",P_e="[^"+u3+"]",y3="(?:\\ud83c[\\udde6-\\uddff]){2}",_3="[\\ud800-\\udbff][\\udc00-\\udfff]",Yd="["+f3+"]",x_e="\\u200d",DA="(?:"+m3+"|"+v3+")",U_e="(?:"+Yd+"|"+v3+")",EA="(?:"+h3+"(?:d|ll|m|re|s|t|ve))?",AA="(?:"+h3+"(?:D|LL|M|RE|S|T|VE))?",b3=N_e+"?",M3="["+A_e+"]?",F_e="(?:"+x_e+"(?:"+[P_e,y3,_3].join("|")+")"+M3+b3+")*",G_e="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$_e="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",B_e=M3+b3+F_e,H_e="(?:"+[O_e,y3,_3].join("|")+")"+B_e,q_e=RegExp([Yd+"?"+m3+"+"+EA+"(?="+[kA,Yd,"$"].join("|")+")",U_e+"+"+AA+"(?="+[kA,Yd+DA,"$"].join("|")+")",Yd+"?"+DA+"+"+EA,Yd+"+"+AA,$_e,G_e,g3,H_e].join("|"),"g");function V_e(e){return e.match(q_e)||[]}function z_e(e,t,n){return e=v0(e),t=n?void 0:t,t===void 0?M_e(e)?V_e(e):__e(e):e.match(t)||[]}var j_e="['’]",W_e=RegExp(j_e,"g");function K_e(e){return function(t){return i_e(z_e(v_e(t).replace(W_e,"")),e,"")}}function Y_e(){this.__data__=new ml,this.size=0}function J_e(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function X_e(e){return this.__data__.get(e)}function Z_e(e){return this.__data__.has(e)}var Q_e=200;function e1e(e,t){var n=this.__data__;if(n instanceof ml){var r=n.__data__;if(!cg||r.length<Q_e-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new vl(r)}return n.set(e,t),this.size=n.size,this}function Ca(e){var t=this.__data__=new ml(e);this.size=t.size}Ca.prototype.clear=Y_e;Ca.prototype.delete=J_e;Ca.prototype.get=X_e;Ca.prototype.has=Z_e;Ca.prototype.set=e1e;var I3=typeof exports=="object"&&exports&&!exports.nodeType&&exports,LA=I3&&typeof module=="object"&&module&&!module.nodeType&&module,t1e=LA&&LA.exports===I3,OA=t1e?Zs.Buffer:void 0,RA=OA?OA.allocUnsafe:void 0;function n1e(e,t){if(t)return e.slice();var n=e.length,r=RA?RA(n):new e.constructor(n);return e.copy(r),r}function r1e(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}function o1e(){return[]}var i1e=Object.prototype,s1e=i1e.propertyIsEnumerable,NA=Object.getOwnPropertySymbols,a1e=NA?function(e){return e==null?[]:(e=Object(e),r1e(NA(e),function(t){return s1e.call(e,t)}))}:o1e;const l1e=a1e;function u1e(e,t,n){var r=t(e);return As(e)?r:C0e(r,n(e))}function PA(e){return u1e(e,rw,l1e)}var c1e=gd(Zs,"DataView");const $I=c1e;var d1e=gd(Zs,"Promise");const BI=d1e;var f1e=gd(Zs,"Set");const HI=f1e;var xA="[object Map]",p1e="[object Object]",UA="[object Promise]",FA="[object Set]",GA="[object WeakMap]",$A="[object DataView]",h1e=hd($I),g1e=hd(cg),m1e=hd(BI),v1e=hd(HI),y1e=hd(UI),rc=pd;($I&&rc(new $I(new ArrayBuffer(1)))!=$A||cg&&rc(new cg)!=xA||BI&&rc(BI.resolve())!=UA||HI&&rc(new HI)!=FA||UI&&rc(new UI)!=GA)&&(rc=function(e){var t=pd(e),n=t==p1e?e.constructor:void 0,r=n?hd(n):"";if(r)switch(r){case h1e:return $A;case g1e:return xA;case m1e:return UA;case v1e:return FA;case y1e:return GA}return t});const BA=rc;var _1e=Zs.Uint8Array;const My=_1e;function b1e(e){var t=new e.constructor(e.byteLength);return new My(t).set(new My(e)),t}function M1e(e,t){var n=t?b1e(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function I1e(e){return typeof e.constructor=="function"&&!tw(e)?bve(e3(e)):{}}var C1e="__lodash_hash_undefined__";function T1e(e){return this.__data__.set(e,C1e),this}function w1e(e){return this.__data__.has(e)}function Iy(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new vl;++t<n;)this.add(e[t])}Iy.prototype.add=Iy.prototype.push=T1e;Iy.prototype.has=w1e;function S1e(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function k1e(e,t){return e.has(t)}var D1e=1,E1e=2;function C3(e,t,n,r,o,i){var s=n&D1e,u=e.length,d=t.length;if(u!=d&&!(s&&d>u))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&E1e?new Iy:void 0;for(i.set(e,t),i.set(t,e);++v<u;){var C=e[v],D=t[v];if(r)var w=s?r(D,C,v,t,e,i):r(C,D,v,e,t,i);if(w!==void 0){if(w)continue;_=!1;break}if(M){if(!S1e(t,function(S,R){if(!k1e(M,R)&&(C===S||o(C,S,n,r,i)))return M.push(R)})){_=!1;break}}else if(!(C===D||o(C,D,n,r,i))){_=!1;break}}return i.delete(e),i.delete(t),_}function A1e(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function L1e(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var O1e=1,R1e=2,N1e="[object Boolean]",P1e="[object Date]",x1e="[object Error]",U1e="[object Map]",F1e="[object Number]",G1e="[object RegExp]",$1e="[object Set]",B1e="[object String]",H1e="[object Symbol]",q1e="[object ArrayBuffer]",V1e="[object DataView]",HA=Cu?Cu.prototype:void 0,tM=HA?HA.valueOf:void 0;function z1e(e,t,n,r,o,i,s){switch(n){case V1e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case q1e:return!(e.byteLength!=t.byteLength||!i(new My(e),new My(t)));case N1e:case P1e:case F1e:return Sg(+e,+t);case x1e:return e.name==t.name&&e.message==t.message;case G1e:case B1e:return e==t+"";case U1e:var u=A1e;case $1e:var d=r&O1e;if(u||(u=L1e),e.size!=t.size&&!d)return!1;var f=s.get(e);if(f)return f==t;r|=R1e,s.set(e,t);var g=C3(u(e),u(t),r,o,i,s);return s.delete(e),g;case H1e:if(tM)return tM.call(e)==tM.call(t)}return!1}var j1e=1,W1e=Object.prototype,K1e=W1e.hasOwnProperty;function Y1e(e,t,n,r,o,i){var s=n&j1e,u=PA(e),d=u.length,f=PA(t),g=f.length;if(d!=g&&!s)return!1;for(var v=d;v--;){var _=u[v];if(!(s?_ in t:K1e.call(t,_)))return!1}var M=i.get(e),C=i.get(t);if(M&&C)return M==t&&C==e;var D=!0;i.set(e,t),i.set(t,e);for(var w=s;++v<d;){_=u[v];var S=e[_],R=t[_];if(r)var A=s?r(R,S,_,t,e,i):r(S,R,_,e,t,i);if(!(A===void 0?S===R||o(S,R,n,r,i):A)){D=!1;break}w||(w=_=="constructor")}if(D&&!w){var N=e.constructor,H=t.constructor;N!=H&&"constructor"in e&&"constructor"in t&&!(typeof N=="function"&&N instanceof N&&typeof H=="function"&&H instanceof H)&&(D=!1)}return i.delete(e),i.delete(t),D}var J1e=1,qA="[object Arguments]",VA="[object Array]",jm="[object Object]",X1e=Object.prototype,zA=X1e.hasOwnProperty;function Z1e(e,t,n,r,o,i){var s=As(e),u=As(t),d=s?VA:BA(e),f=u?VA:BA(t);d=d==qA?jm:d,f=f==qA?jm:f;var g=d==jm,v=f==jm,_=d==f;if(_&&by(e)){if(!by(t))return!1;s=!0,g=!1}if(_&&!g)return i||(i=new Ca),s||nw(e)?C3(e,t,n,r,o,i):z1e(e,t,d,n,r,o,i);if(!(n&J1e)){var M=g&&zA.call(e,"__wrapped__"),C=v&&zA.call(t,"__wrapped__");if(M||C){var D=M?e.value():e,w=C?t.value():t;return i||(i=new Ca),o(D,w,n,r,i)}}return _?(i||(i=new Ca),Y1e(e,t,n,r,o,i)):!1}function sw(e,t,n,r,o){return e===t?!0:e==null||t==null||!Tu(e)&&!Tu(t)?e!==e&&t!==t:Z1e(e,t,n,r,sw,o)}var Q1e=1,ebe=2;function tbe(e,t,n,r){var o=n.length,i=o,s=!r;if(e==null)return!i;for(e=Object(e);o--;){var u=n[o];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){u=n[o];var d=u[0],f=e[d],g=u[1];if(s&&u[2]){if(f===void 0&&!(d in e))return!1}else{var v=new Ca;if(r)var _=r(f,g,d,e,t,v);if(!(_===void 0?sw(g,f,Q1e|ebe,r,v):_))return!1}}return!0}function T3(e){return e===e&&!Ls(e)}function nbe(e){for(var t=rw(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,T3(o)]}return t}function w3(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function rbe(e){var t=nbe(e);return t.length==1&&t[0][2]?w3(t[0][0],t[0][1]):function(n){return n===e||tbe(n,e,t)}}function obe(e,t){return e!=null&&t in Object(e)}function ibe(e,t,n){t=Z4(t,e);for(var r=-1,o=t.length,i=!1;++r<o;){var s=y0(t[r]);if(!(i=e!=null&&n(e,s)))break;e=e[s]}return i||++r!=o?i:(o=e==null?0:e.length,!!o&&ew(o)&&ZT(s,o)&&(As(e)||_y(e)))}function sbe(e,t){return e!=null&&ibe(e,t,obe)}var abe=1,lbe=2;function ube(e,t){return ow(e)&&T3(t)?w3(y0(e),t):function(n){var r=I0e(n,e);return r===void 0&&r===t?sbe(n,e):sw(t,r,abe|lbe)}}function cbe(e){return function(t){return t==null?void 0:t[e]}}function dbe(e){return function(t){return Q4(t,e)}}function fbe(e){return ow(e)?cbe(y0(e)):dbe(e)}function pbe(e){return typeof e=="function"?e:e==null?JT:typeof e=="object"?As(e)?ube(e[0],e[1]):rbe(e):fbe(e)}function hbe(e){return function(t,n,r){for(var o=-1,i=Object(t),s=r(t),u=s.length;u--;){var d=s[e?u:++o];if(n(i[d],d,i)===!1)break}return t}}var gbe=hbe();const S3=gbe;function mbe(e,t){return e&&S3(e,t,rw)}function vbe(e,t){return function(n,r){if(n==null)return n;if(!np(n))return e(n,r);for(var o=n.length,i=t?o:-1,s=Object(n);(t?i--:++i<o)&&r(s[i],i,s)!==!1;);return n}}var ybe=vbe(mbe);const _be=ybe;var bbe=function(){return Zs.Date.now()};const nM=bbe;var Mbe="Expected a function",Ibe=Math.max,Cbe=Math.min;function Tbe(e,t,n){var r,o,i,s,u,d,f=0,g=!1,v=!1,_=!0;if(typeof e!="function")throw new TypeError(Mbe);t=yA(t)||0,Ls(n)&&(g=!!n.leading,v="maxWait"in n,i=v?Ibe(yA(n.maxWait)||0,t):i,_="trailing"in n?!!n.trailing:_);function M(z){var x=r,B=o;return r=o=void 0,f=z,s=e.apply(B,x),s}function C(z){return f=z,u=setTimeout(S,t),g?M(z):s}function D(z){var x=z-d,B=z-f,j=t-x;return v?Cbe(j,i-B):j}function w(z){var x=z-d,B=z-f;return d===void 0||x>=t||x<0||v&&B>=i}function S(){var z=nM();if(w(z))return R(z);u=setTimeout(S,D(z))}function R(z){return u=void 0,_&&r?M(z):(r=o=void 0,s)}function A(){u!==void 0&&clearTimeout(u),f=0,r=d=o=u=void 0}function N(){return u===void 0?s:R(nM())}function H(){var z=nM(),x=w(z);if(r=arguments,o=this,d=z,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 H.cancel=A,H.flush=N,H}function qI(e,t,n){(n!==void 0&&!Sg(e[t],n)||n===void 0&&!(t in e))&&QT(e,t,n)}function wbe(e){return Tu(e)&&np(e)}function VI(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Sbe(e){return Fve(e,X4(e))}function kbe(e,t,n,r,o,i,s){var u=VI(e,n),d=VI(t,n),f=s.get(d);if(f){qI(e,n,f);return}var g=i?i(u,d,n+"",e,t,s):void 0,v=g===void 0;if(v){var _=As(d),M=!_&&by(d),C=!_&&!M&&nw(d);g=d,_||M||C?As(u)?g=u:wbe(u)?g=Ive(u):M?(v=!1,g=n1e(d,!0)):C?(v=!1,g=M1e(d,!0)):g=[]:A0e(d)||_y(d)?(g=u,_y(u)?g=Sbe(u):(!Ls(u)||XT(u))&&(g=I1e(d))):v=!1}v&&(s.set(d,g),o(g,d,r,i,s),s.delete(d)),qI(e,n,g)}function k3(e,t,n,r,o){e!==t&&S3(t,function(i,s){if(o||(o=new Ca),Ls(i))kbe(e,t,s,n,k3,r,o);else{var u=r?r(VI(e,s),i,s+"",e,t,o):void 0;u===void 0&&(u=i),qI(e,s,u)}},X4)}function Dbe(e,t){var n=-1,r=np(e)?Array(e.length):[];return _be(e,function(o,i,s){r[++n]=t(o,i,s)}),r}function Ebe(e,t){var n=As(e)?V4:Dbe;return n(e,pbe(t))}var Abe=K_e(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Lbe=Abe;var Obe=qve(function(e,t,n){k3(e,t,n)});const Wm=Obe;var Rbe="Expected a function";function rM(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(Rbe);return Ls(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Tbe(e,t,{leading:r,maxWait:t,trailing:o})}const rp={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:Nbe,fontFamily:Pbe,lineHeight:xbe}=rp,D3=ut("body",`
- margin: 0;
- font-size: ${Nbe};
- font-family: ${Pbe};
- line-height: ${xbe};
- -webkit-text-size-adjust: 100%;
- -webkit-tap-highlight-color: transparent;
- `,[ut("input",`
- font-family: inherit;
- font-size: inherit;
- `)]),md="n-config-provider",dg="naive-ui-style";function no(e,t,n,r,o,i){const s=tp(),u=tn(md,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||D3.mount({id:"n-global",head:!0,anchorMetaName:dg,ssr:s})};s?f():Hf(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:R=void 0,self:A=void 0,peers:N={}}={}}=(u==null?void 0:u.mergedThemeRef.value)||{},{common:H=void 0,[e]:z={}}=(u==null?void 0:u.mergedThemeOverridesRef.value)||{},{common:x,peers:B={}}=z,j=Wm({},g||R||S||r.common,H,x,D),G=Wm((f=v||A||r.self)===null||f===void 0?void 0:f(j),C,z,M);return{common:j,self:G,peers:Wm({},r.peers,N,_),peerOverrides:Wm({},C.peers,B,w)}})}no.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const Ube="n";function Oa(e={},t={defaultBordered:!0}){const n=tn(md,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)||Ube),namespaceRef:Ve(()=>n==null?void 0:n.mergedNamespaceRef.value)}}const Fbe={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"}},Gbe=Fbe,$be={name:"en-US",locale:IT},Bbe=$be;function aw(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=tn(md,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:Gbe[e]});return{dateLocaleRef:Ve(()=>{var i;return(i=n==null?void 0:n.value)!==null&&i!==void 0?i:Bbe}),localeRef:r}}function op(e,t,n){if(!t)return;const r=tp(),o=tn(md,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||D3.mount({id:"n-global",head:!0,anchorMetaName:dg,ssr:r})};r?i():Hf(i)}function Pu(e,t,n,r){var o;n||f4("useThemeClass","cssVarsRef is not passed");const i=(o=tn(md,null))===null||o===void 0?void 0:o.mergedThemeHashRef,s=Ne(""),u=tp();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+="-"+RI(JSON.stringify(C))),D&&(v+="-"+RI(JSON.stringify(D))),s.value=v,d=()=>{const w=n.value;let S="";for(const R in w)S+=`${R}: ${w[R]};`;ut(`.${v}`,S).mount({id:v,ssr:u}),d=void 0}};return nn(()=>{g()}),{themeClass:s,onRender:()=>{d==null||d()}}}function lw(e,t,n){if(!t)return;const r=tp(),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(yge(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():Hf(i),o}const Hbe=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 ip(e,t){return ot({name:o_e(e),setup(){var n;const r=(n=tn(md,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 qbe=ip("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"}))))),Vbe=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"}))}}),zbe=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"}))}}),jbe=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"}))}}),Wbe=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"}))}}),Kbe=ip("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"}))))),Ybe=ip("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"}))),Jbe=ip("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"}))),Xbe=ip("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"}))),Zbe=ip("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"}))),Qbe=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"})))}}),uw=ot({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const n=p0();return()=>Re(bo,{name:"icon-switch-transition",appear:n.value},t)}}),eMe=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?sO: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)}}}),tMe=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;
- `)]),Si=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){op("-base-icon",tMe,dr(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)}}),nMe=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;
- `,[Mt("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;
- `),is("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);
- `)]),Mt("disabled",`
- cursor: not-allowed;
- color: var(--n-close-icon-color-disabled);
- background-color: transparent;
- `),Mt("round",[ut("&::before",`
- border-radius: 50%;
- `)])]),rMe=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 op("-base-close",nMe,dr(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(Si,{clsPrefix:t},{default:()=>Re(qbe,null)}))}}}),{cubicBezierEaseInOut:oMe}=rp;function Cy({originalTransform:e="",left:t=0,top:n=0,transition:r=`all .3s ${oMe} !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 iMe=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%;
- `,[Cy()]),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%);
- `,[Cy({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})])])]),sMe={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},cw=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}},sMe),setup(e){op("-base-loading",iMe,dr(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(uw,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"},aMe=od(Zt.neutralBase),E3=od(Zt.neutralInvertBase),lMe="rgba("+E3.slice(0,3).join(", ")+", ";function jA(e){return lMe+String(e)+")"}function ii(e){const t=Array.from(E3);return t[3]=Number(e),d0(aMe,t)}const uMe=Object.assign(Object.assign({name:"common"},rp),{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:ii(Zt.alpha4),placeholderColor:ii(Zt.alpha4),placeholderColorDisabled:ii(Zt.alpha5),iconColor:ii(Zt.alpha4),iconColorHover:Gm(ii(Zt.alpha4),{lightness:.75}),iconColorPressed:Gm(ii(Zt.alpha4),{lightness:.9}),iconColorDisabled:ii(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:ii(Number(Zt.alphaClose)),closeIconColorHover:ii(Number(Zt.alphaClose)),closeIconColorPressed:ii(Number(Zt.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:ii(Zt.alpha4),clearColorHover:Gm(ii(Zt.alpha4),{lightness:.75}),clearColorPressed:Gm(ii(Zt.alpha4),{lightness:.9}),scrollbarColor:jA(Zt.alphaScrollbar),scrollbarColorHover:jA(Zt.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ii(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:ii(Zt.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:ii(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)"}),yl=uMe,cMe={iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"},dMe=e=>{const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeSmall:o,fontSizeMedium:i,fontSizeLarge:s,fontSizeHuge:u}=e;return Object.assign(Object.assign({},cMe),{fontSizeSmall:o,fontSizeMedium:i,fontSizeLarge:s,fontSizeHuge:u,textColor:t,iconColor:n,extraTextColor:r})},fMe={name:"Empty",common:yl,self:dMe},pMe=fMe,hMe=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);
- `)]),gMe=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}),mMe=ot({name:"Empty",props:gMe,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=Oa(e),r=no("Empty","-empty",hMe,pMe,e,t),{localeRef:o}=aw("Empty"),i=tn(md,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(jbe,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?Pu("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(Si,{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)}}),vMe=e=>{const{scrollbarColor:t,scrollbarColorHover:n}=e;return{color:t,colorHover:n}},yMe={name:"Scrollbar",common:yl,self:vMe},_Me=yMe,{cubicBezierEaseInOut:WA}=rp;function Ty({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=WA,leaveCubicBezier:o=WA}={}){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 bMe=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;
- `,[Mt("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;
- `)])]),Mt("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;
- `)])]),Mt("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);
- `,[Ty(),ut("&:hover",{backgroundColor:"var(--n-scrollbar-color-hover)"})])])])])]),MMe=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}),A3=ot({name:"Scrollbar",props:MMe,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=Oa(e),o=lw("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),R=Ne(!1),A=Ne(!1);let N=!1,H=!1,z,x,B=0,j=0,G=0,L=0;const T=Pge(),P=Ve(()=>{const{value:Qe}=_,{value:yt}=g,{value:Pt}=C;return Qe===null||yt===null||Pt===null?0:Math.min(Qe,Pt*Qe/yt+e.size*1.5)}),Q=Ve(()=>`${P.value}px`),Y=Ve(()=>{const{value:Qe}=M,{value:yt}=v,{value:Pt}=D;return Qe===null||yt===null||Pt===null?0:Pt*Qe/yt+e.size*1.5}),oe=Ve(()=>`${Y.value}px`),X=Ve(()=>{const{value:Qe}=_,{value:yt}=w,{value:Pt}=g,{value:ln}=C;if(Qe===null||Pt===null||ln===null)return 0;{const en=Pt-Qe;return en?yt/en*(ln-P.value):0}}),ae=Ve(()=>`${X.value}px`),fe=Ve(()=>{const{value:Qe}=M,{value:yt}=S,{value:Pt}=v,{value:ln}=D;if(Qe===null||Pt===null||ln===null)return 0;{const en=Pt-Qe;return en?yt/en*(ln-Y.value):0}}),le=Ve(()=>`${fe.value}px`),ce=Ve(()=>{const{value:Qe}=_,{value:yt}=g;return Qe!==null&&yt!==null&&yt>Qe}),J=Ve(()=>{const{value:Qe}=M,{value:yt}=v;return Qe!==null&&yt!==null&&yt>Qe}),re=Ve(()=>{const{trigger:Qe}=e;return Qe==="none"||R.value}),de=Ve(()=>{const{trigger:Qe}=e;return Qe==="none"||A.value}),Oe=Ve(()=>{const{container:Qe}=e;return Qe?Qe():s.value}),ve=Ve(()=>{const{content:Qe}=e;return Qe?Qe():u.value}),Me=Lme(()=>{e.container||ke({top:w.value,left:S.value})}),K=()=>{Me.isDeactivated||ye()},me=Qe=>{if(Me.isDeactivated)return;const{onResize:yt}=e;yt&&yt(Qe),ye()},ke=(Qe,yt)=>{if(!e.scrollable)return;if(typeof Qe=="number"){W(yt??0,Qe,0,!1,"auto");return}const{left:Pt,top:ln,index:en,elSize:Tn,position:qn,behavior:ze,el:St,debounce:_t=!0}=Qe;(Pt!==void 0||ln!==void 0)&&W(Pt??0,ln??0,0,!1,ze),St!==void 0?W(0,St.offsetTop,St.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)},pe=(Qe,yt)=>{if(!e.scrollable)return;const{value:Pt}=Oe;Pt&&(typeof Qe=="object"?Pt.scrollBy(Qe):Pt.scrollBy(Qe,yt||0))};function W(Qe,yt,Pt,ln,en){const{value:Tn}=Oe;if(Tn){if(ln){const{scrollTop:qn,offsetHeight:ze}=Tn;if(yt>qn){yt+Pt<=qn+ze||Tn.scrollTo({left:Qe,top:yt+Pt-ze,behavior:en});return}}Tn.scrollTo({left:Qe,top:yt,behavior:en})}}function te(){Pe(),xe(),ye()}function ie(){Ie()}function Ie(){ue(),Se()}function ue(){x!==void 0&&window.clearTimeout(x),x=window.setTimeout(()=>{A.value=!1},e.duration)}function Se(){z!==void 0&&window.clearTimeout(z),z=window.setTimeout(()=>{R.value=!1},e.duration)}function Pe(){z!==void 0&&window.clearTimeout(z),R.value=!0}function xe(){x!==void 0&&window.clearTimeout(x),A.value=!0}function He(Qe){const{onScroll:yt}=e;yt&&yt(Qe),Te()}function Te(){const{value:Qe}=Oe;Qe&&(w.value=Qe.scrollTop,S.value=Qe.scrollLeft*(o!=null&&o.value?-1:1))}function V(){const{value:Qe}=ve;Qe&&(g.value=Qe.offsetHeight,v.value=Qe.offsetWidth);const{value:yt}=Oe;yt&&(_.value=yt.offsetHeight,M.value=yt.offsetWidth);const{value:Pt}=f,{value:ln}=d;Pt&&(D.value=Pt.offsetWidth),ln&&(C.value=ln.offsetHeight)}function ne(){const{value:Qe}=Oe;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:Pt}=d;yt&&(D.value=yt.offsetWidth),Pt&&(C.value=Pt.offsetHeight)}function ye(){e.scrollable&&(e.useUnifiedContainer?ne():(V(),Te()))}function Be(Qe){var yt;return!(!((yt=i.value)===null||yt===void 0)&&yt.contains(gy(Qe)))}function je(Qe){Qe.preventDefault(),Qe.stopPropagation(),H=!0,po("mousemove",window,lt,!0),po("mouseup",window,Fe,!0),j=S.value,G=o!=null&&o.value?window.innerWidth-Qe.clientX:Qe.clientX}function lt(Qe){if(!H)return;z!==void 0&&window.clearTimeout(z),x!==void 0&&window.clearTimeout(x);const{value:yt}=M,{value:Pt}=v,{value:ln}=Y;if(yt===null||Pt===null)return;const Tn=(o!=null&&o.value?window.innerWidth-Qe.clientX-G:Qe.clientX-G)*(Pt-yt)/(yt-ln),qn=Pt-yt;let ze=j+Tn;ze=Math.min(qn,ze),ze=Math.max(ze,0);const{value:St}=Oe;if(St){St.scrollLeft=ze*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:_t}=e;_t&&_t(ze)}}function Fe(Qe){Qe.preventDefault(),Qe.stopPropagation(),Mr("mousemove",window,lt,!0),Mr("mouseup",window,Fe,!0),H=!1,ye(),Be(Qe)&&Ie()}function st(Qe){Qe.preventDefault(),Qe.stopPropagation(),N=!0,po("mousemove",window,wt,!0),po("mouseup",window,mn,!0),B=w.value,L=Qe.clientY}function wt(Qe){if(!N)return;z!==void 0&&window.clearTimeout(z),x!==void 0&&window.clearTimeout(x);const{value:yt}=_,{value:Pt}=g,{value:ln}=P;if(yt===null||Pt===null)return;const Tn=(Qe.clientY-L)*(Pt-yt)/(yt-ln),qn=Pt-yt;let ze=B+Tn;ze=Math.min(qn,ze),ze=Math.max(ze,0);const{value:St}=Oe;St&&(St.scrollTop=ze)}function mn(Qe){Qe.preventDefault(),Qe.stopPropagation(),Mr("mousemove",window,wt,!0),Mr("mouseup",window,mn,!0),N=!1,ye(),Be(Qe)&&Ie()}nn(()=>{const{value:Qe}=J,{value:yt}=ce,{value:Pt}=t,{value:ln}=f,{value:en}=d;ln&&(Qe?ln.classList.remove(`${Pt}-scrollbar-rail--disabled`):ln.classList.add(`${Pt}-scrollbar-rail--disabled`)),en&&(yt?en.classList.remove(`${Pt}-scrollbar-rail--disabled`):en.classList.add(`${Pt}-scrollbar-rail--disabled`))}),On(()=>{e.container||ye()}),vi(()=>{z!==void 0&&window.clearTimeout(z),x!==void 0&&window.clearTimeout(x),Mr("mousemove",window,wt,!0),Mr("mouseup",window,mn,!0)});const In=no("Scrollbar","-scrollbar",bMe,_Me,e,t),Cn=Ve(()=>{const{common:{cubicBezierEaseInOut:Qe,scrollbarBorderRadius:yt,scrollbarHeight:Pt,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":Pt}}),En=n?Pu("scrollbar",void 0,Cn,e):void 0;return Object.assign(Object.assign({},{scrollTo:ke,scrollBy:pe,sync:ye,syncUnifiedContainer:ne,handleMouseEnterWrapper:te,handleMouseLeaveWrapper:ie}),{mergedClsPrefix:t,rtlEnabled:o,containerScrollTop:w,wrapperRef:i,containerRef:s,contentRef:u,yRailRef:d,xRailRef:f,needYBar:ce,needXBar:J,yBarSizePx:Q,xBarSizePx:oe,yBarTopPx:ae,xBarLeftPx:le,isShowXBar:re,isShowYBar:de,isIos:T,handleScroll:He,handleContentResize:K,handleContainerResize:me,handleYScrollMouseDown:st,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?VE: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",Ao(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?VE: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}}),L3=A3,IMe=A3,{cubicBezierEaseIn:KA,cubicBezierEaseOut:YA}=rp;function CMe({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} ${KA}, transform ${t} ${KA} ${o&&","+o}`}),ut("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${YA}, transform ${t} ${YA} ${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 TMe=et("base-wave",`
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- border-radius: inherit;
- `),wMe=ot({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){op("-base-wave",TMe,dr(e,"clsPrefix"));const t=Ne(null),n=Ne(!1);let r=null;return vi(()=>{r!==null&&window.clearTimeout(r)}),{active:n,selfRef:t,play(){r!==null&&(window.clearTimeout(r),n.value=!1,r=null),Ir(()=>{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`]})}}),SMe={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"},kMe=e=>{const{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:o,fontSize:i,dividerColor:s}=e;return Object.assign(Object.assign({},SMe),{fontSize:i,borderRadius:o,color:n,dividerColor:s,textColor:r,boxShadow:t})},DMe={name:"Popover",common:yl,self:kMe},O3=DMe,oM={top:"bottom",bottom:"top",left:"right",right:"left"},yo="var(--n-arrow-height) * 1.414",EMe=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;
- `)]),is("raw",`
- background-color: var(--n-color);
- border-radius: var(--n-border-radius);
- `,[is("scrollable",[is("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);
- `),Mt("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);
- `)]),vs("top-start",`
- top: calc(${yo} / -2);
- left: calc(${za("top-start")} - var(--v-offset-left));
- `),vs("top",`
- top: calc(${yo} / -2);
- transform: translateX(calc(${yo} / -2)) rotate(45deg);
- left: 50%;
- `),vs("top-end",`
- top: calc(${yo} / -2);
- right: calc(${za("top-end")} + var(--v-offset-left));
- `),vs("bottom-start",`
- bottom: calc(${yo} / -2);
- left: calc(${za("bottom-start")} - var(--v-offset-left));
- `),vs("bottom",`
- bottom: calc(${yo} / -2);
- transform: translateX(calc(${yo} / -2)) rotate(45deg);
- left: 50%;
- `),vs("bottom-end",`
- bottom: calc(${yo} / -2);
- right: calc(${za("bottom-end")} + var(--v-offset-left));
- `),vs("left-start",`
- left: calc(${yo} / -2);
- top: calc(${za("left-start")} - var(--v-offset-top));
- `),vs("left",`
- left: calc(${yo} / -2);
- transform: translateY(calc(${yo} / -2)) rotate(45deg);
- top: 50%;
- `),vs("left-end",`
- left: calc(${yo} / -2);
- bottom: calc(${za("left-end")} + var(--v-offset-top));
- `),vs("right-start",`
- right: calc(${yo} / -2);
- top: calc(${za("right-start")} - var(--v-offset-top));
- `),vs("right",`
- right: calc(${yo} / -2);
- transform: translateY(calc(${yo} / -2)) rotate(45deg);
- top: 50%;
- `),vs("right-end",`
- right: calc(${yo} / -2);
- bottom: calc(${za("right-end")} + var(--v-offset-top));
- `),...Ebe({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=za(o);return ut(`[v-placement="${o}"] >`,[et("popover-shared",[Mt("center-arrow",[et("popover-arrow",`${t}: calc(max(${u}, ${d}) ${i?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function za(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function vs(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-${oM[n]}: var(--n-space);
- `,[Mt("show-arrow",`
- margin-${oM[n]}: var(--n-space-arrow);
- `),Mt("overlap",`
- margin: 0;
- `),Tge("popover-arrow-wrapper",`
- right: 0;
- left: 0;
- top: 0;
- bottom: 0;
- ${n}: 100%;
- ${oM[n]}: auto;
- ${r}
- `,[et("popover-arrow",t)])])])}const R3=Object.assign(Object.assign({},no.props),{to:Ff.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}),AMe=({arrowStyle:e,clsPrefix:t})=>Re("div",{key:"__popover-arrow__",class:`${t}-popover-arrow-wrapper`},Re("div",{class:`${t}-popover-arrow`,style:e})),LMe=ot({name:"PopoverBody",inheritAttrs:!1,props:R3,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:i}=Oa(e),s=no("Popover","-popover",EMe,O3,e,o),u=Ne(null),d=tn("NPopover"),f=Ne(null),g=Ne(e.show),v=Ne(!1);nn(()=>{const{show:x}=e;x&&!wge()&&!e.internalDeactivateImmediately&&(v.value=!0)});const _=Ve(()=>{const{trigger:x,onClickoutside:B}=e,j=[],{positionManuallyRef:{value:G}}=d;return G||(x==="click"&&!B&&j.push([XE,N,void 0,{capture:!0}]),x==="hover"&&j.push([qge,A])),B&&j.push([XE,N,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&v.value)&&j.push([eo,e.show]),j}),M=Ve(()=>{const x=e.width==="trigger"?void 0:jb(e.width),B=[];x&&B.push({width:x});const{maxWidth:j,minWidth:G}=e;return j&&B.push({maxWidth:jb(j)}),G&&B.push({maxWidth:jb(G)}),i||B.push(C.value),B}),C=Ve(()=>{const{common:{cubicBezierEaseInOut:x,cubicBezierEaseIn:B,cubicBezierEaseOut:j},self:{space:G,spaceArrow:L,padding:T,fontSize:P,textColor:Q,dividerColor:Y,color:oe,boxShadow:X,borderRadius:ae,arrowHeight:fe,arrowOffset:le,arrowOffsetVertical:ce}}=s.value;return{"--n-box-shadow":X,"--n-bezier":x,"--n-bezier-ease-in":B,"--n-bezier-ease-out":j,"--n-font-size":P,"--n-text-color":Q,"--n-color":oe,"--n-divider-color":Y,"--n-border-radius":ae,"--n-arrow-height":fe,"--n-arrow-offset":le,"--n-arrow-offset-vertical":ce,"--n-padding":T,"--n-space":G,"--n-space-arrow":L}}),D=i?Pu("popover",void 0,C,e):void 0;d.setBodyInstance({syncPosition:w}),vi(()=>{d.setBodyInstance(null)}),$t(dr(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 R(x){e.trigger==="hover"&&e.keepAliveOnHover&&d.handleMouseLeave(x)}function A(x){e.trigger==="hover"&&!H().contains(gy(x))&&d.handleMouseMoveOutside(x)}function N(x){(e.trigger==="click"&&!H().contains(gy(x))||e.onClickoutside)&&d.handleClickOutside(x)}function H(){return d.getTriggerElement()}ci(T4,f),ci(C4,null),ci(I4,null);function z(){if(D==null||D.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&v.value))return null;let B;const j=d.internalRenderBodyRef.value,{value:G}=o;if(j)B=j([`${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,R);else{const{value:L}=d.extraClassRef,{internalTrapFocus:T}=e,P=!LI(t.header)||!LI(t.footer),Q=()=>{var Y;const oe=P?Re(dt,null,Vs(t.header,fe=>fe?Re("div",{class:`${G}-popover__header`,style:e.headerStyle},fe):null),Vs(t.default,fe=>fe?Re("div",{class:`${G}-popover__content`,style:e.contentStyle},t):null),Vs(t.footer,fe=>fe?Re("div",{class:`${G}-popover__footer`,style:e.footerStyle},fe):null)):e.scrollable?(Y=t.default)===null||Y===void 0?void 0:Y.call(t):Re("div",{class:`${G}-popover__content`,style:e.contentStyle},t),X=e.scrollable?Re(IMe,{contentClass:P?void 0:`${G}-popover__content`,contentStyle:P?void 0:e.contentStyle},{default:()=>oe}):oe,ae=e.showArrow?AMe({arrowStyle:e.arrowStyle,clsPrefix:G}):null;return[X,ae]};B=Re("div",Ao({class:[`${G}-popover`,`${G}-popover-shared`,D==null?void 0:D.themeClass.value,L.map(Y=>`${G}-${Y}`),{[`${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:R},n),T?Re(Ame,{active:e.show,autoFocus:!0},{default:Q}):Q())}return $n(B,_.value)}return{displayed:v,namespace:r,isMounted:d.isMountedRef,zIndex:d.zIndexRef,followerRef:u,adjustedTo:Ff(e),followerEnabled:g,renderContentNode:z}},render(){return Re(ome,{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===Ff.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()})}}),OMe=Object.keys(R3),RMe={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function NMe(e,t,n){RMe[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 N3={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:Ff.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},PMe=Object.assign(Object.assign(Object.assign({},no.props),N3),{internalOnAfterLeave:Function,internalRenderBody:Function}),P3=ot({name:"Popover",inheritAttrs:!1,props:PMe,__popover__:!0,setup(e){const t=p0(),n=Ne(null),r=Ve(()=>e.show),o=Ne(e.defaultShow),i=WT(r,o),s=Iu(()=>e.disabled?!1:i.value),u=()=>{if(e.disabled)return!0;const{getDisabled:Q}=e;return!!(Q!=null&&Q())},d=()=>u()?!1:i.value,f=vy(e,["arrow","showArrow"]),g=Ve(()=>e.overlap?!1:f.value);let v=null;const _=Ne(null),M=Ne(null),C=Iu(()=>e.x!==void 0&&e.y!==void 0);function D(Q){const{"onUpdate:show":Y,onUpdateShow:oe,onShow:X,onHide:ae}=e;o.value=Q,Y&&Er(Y,Q),oe&&Er(oe,Q),Q&&X&&Er(X,!0),Q&&ae&&Er(ae,!1)}function w(){v&&v.syncPosition()}function S(){const{value:Q}=_;Q&&(window.clearTimeout(Q),_.value=null)}function R(){const{value:Q}=M;Q&&(window.clearTimeout(Q),M.value=null)}function A(){const Q=u();if(e.trigger==="focus"&&!Q){if(d())return;D(!0)}}function N(){const Q=u();if(e.trigger==="focus"&&!Q){if(!d())return;D(!1)}}function H(){const Q=u();if(e.trigger==="hover"&&!Q){if(R(),_.value!==null||d())return;const Y=()=>{D(!0),_.value=null},{delay:oe}=e;oe===0?Y():_.value=window.setTimeout(Y,oe)}}function z(){const Q=u();if(e.trigger==="hover"&&!Q){if(S(),M.value!==null||!d())return;const Y=()=>{D(!1),M.value=null},{duration:oe}=e;oe===0?Y():M.value=window.setTimeout(Y,oe)}}function x(){z()}function B(Q){var Y;d()&&(e.trigger==="click"&&(S(),R(),D(!1)),(Y=e.onClickoutside)===null||Y===void 0||Y.call(e,Q))}function j(){if(e.trigger==="click"&&!u()){S(),R();const Q=!d();D(Q)}}function G(Q){e.internalTrapFocus&&Q.key==="Escape"&&(S(),R(),D(!1))}function L(Q){o.value=Q}function T(){var Q;return(Q=n.value)===null||Q===void 0?void 0:Q.targetRef}function P(Q){v=Q}return ci("NPopover",{getTriggerElement:T,handleKeydown:G,handleMouseEnter:H,handleMouseLeave:z,handleClickOutside:B,handleMouseMoveOutside:x,setBodyInstance:P,positionManuallyRef:C,isMountedRef:t,zIndexRef:dr(e,"zIndex"),extraClassRef:dr(e,"internalExtraClass"),internalRenderBodyRef:dr(e,"internalRenderBody")}),nn(()=>{i.value&&u()&&D(!1)}),{binderInstRef:n,positionManually:C,mergedShowConsideringDisabledProp:s,uncontrolledShow:o,mergedShowArrow:g,getMergedShow:d,setShow:L,handleClick:j,handleMouseEnter:H,handleMouseLeave:z,handleFocus:A,handleBlur:N,syncPosition:w}},render(){var e;const{positionManually:t,$slots:n}=this;let r,o=!1;if(!t&&(n.activator?r=qE(n,"activator"):r=qE(n,"trigger"),r)){r=wa(r),r=r.type===qf?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)})}};NMe(r,s?"nested":t?"manual":this.trigger,d)}}return Re($ge,{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}}),[[KT,{enabled:i,zIndex:this.zIndex}]]):null,t?null:Re(Bge,null,{default:()=>r}),Re(LMe,Zhe(this.$props,OMe,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)}})]}})}}),xMe=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%);
- `,[Cy({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),zI=ot({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return op("-base-clear",xMe,dr(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return Re("div",{class:`${e}-base-clear`},Re(uw,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},Eh(this.$slots.icon,()=>[Re(Si,{clsPrefix:e},{default:()=>Re(Kbe,null)})])):Re("div",{key:"icon",class:`${e}-base-clear__placeholder`},(n=(t=this.$slots).placeholder)===null||n===void 0?void 0:n.call(t))}}))}}),UMe=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(cw,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?Re(zI,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>Re(Si,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Eh(t.default,()=>[Re(Wbe,null)])})}):null})}}}),{cubicBezierEaseInOut:Rl}=rp;function FMe({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} ${Rl},
- max-width ${e} ${Rl} ${t},
- margin-left ${e} ${Rl} ${t},
- margin-right ${e} ${Rl} ${t};
- `),ut("&.fade-in-width-expand-transition-enter-active",`
- overflow: hidden;
- transition:
- opacity ${e} ${Rl} ${t},
- max-width ${e} ${Rl},
- margin-left ${e} ${Rl},
- margin-right ${e} ${Rl};
- `)]}const GMe=wg&&"chrome"in window;wg&&navigator.userAgent.includes("Firefox");const x3=wg&&navigator.userAgent.includes("Safari")&&!GMe,$Me={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},BMe=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:R,heightTiny:A,heightSmall:N,heightMedium:H,heightLarge:z,actionColor:x,clearColor:B,clearColorHover:j,clearColorPressed:G,placeholderColor:L,placeholderColorDisabled:T,iconColor:P,iconColorDisabled:Q,iconColorHover:Y,iconColorPressed:oe}=e;return Object.assign(Object.assign({},$Me),{countTextColorDisabled:r,countTextColor:n,heightTiny:A,heightSmall:N,heightMedium:H,heightLarge:z,fontSizeTiny:D,fontSizeSmall:w,fontSizeMedium:S,fontSizeLarge:R,lineHeight:C,lineHeightTextarea:C,borderRadius:M,iconSize:"16px",groupLabelColor:x,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:o,placeholderColor:L,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 ${Pc(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 ${Pc(f,{alpha:.2})}`,caretColorWarning:f,loadingColorError:v,borderError:`1px solid ${v}`,borderHoverError:`1px solid ${_}`,colorFocusError:s,borderFocusError:`1px solid ${_}`,boxShadowFocusError:`0 0 0 2px ${Pc(v,{alpha:.2})}`,caretColorError:v,clearColor:B,clearColorHover:j,clearColorPressed:G,iconColor:P,iconColorDisabled:Q,iconColorHover:Y,iconColorPressed:oe,suffixTextColor:t})},HMe={name:"Input",common:yl,self:BMe},qMe=HMe,U3="n-input";function VMe(e){let t=0;for(const n of e)t++;return t}function Km(e){return e===""||e==null}function zMe(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 JA=ot({name:"InputWordCount",setup(e,{slots:t}){const{mergedValueRef:n,maxlengthRef:r,mergedClsPrefixRef:o,countGraphemesRef:i}=tn(U3),s=Ve(()=>{const{value:u}=n;return u===null||Array.isArray(u)?0:(i.value||VMe)(u)});return()=>{const{value:u}=r,{value:d}=n;return Re("span",{class:`${o.value}-input-word-count`},tge(t.default,{value:d===null||Array.isArray(d)?"":d},()=>[u===void 0?s.value:`${s.value} / ${u}`]))}}}),jMe=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;")])]),Mt("round",[is("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;
- `)]),Mt("textarea",[gt("placeholder","overflow: visible;")]),is("autosize","width: 100%;"),Mt("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;
- `)])]),is("textarea",[gt("placeholder","white-space: nowrap;")]),gt("eye",`
- display: flex;
- align-items: center;
- justify-content: center;
- transition: color .3s var(--n-bezier);
- `),Mt("textarea","width: 100%;",[et("input-word-count",`
- position: absolute;
- right: var(--n-padding-right);
- bottom: var(--n-padding-vertical);
- `),Mt("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;
- `)]),Mt("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);
- `)])]),Mt("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);
- `)])]),is("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);")]),Mt("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=>Mt(`${e}-status`,[is("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});
- `)]),Mt("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});
- `)])])]))]),WMe=et("input",[Mt("disabled",[gt("input-el, textarea-el",`
- -webkit-text-fill-color: var(--n-text-color-disabled);
- `)])]),KMe=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}),YMe=ot({name:"Input",props:KMe,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,inlineThemeDisabled:r,mergedRtlRef:o}=Oa(e),i=no("Input","-input",jMe,qMe,e,t);x3&&op("-input-safari",WMe,t);const s=Ne(null),u=Ne(null),d=Ne(null),f=Ne(null),g=Ne(null),v=Ne(null),_=Ne(null),M=zMe(_),C=Ne(null),{localeRef:D}=aw("Input"),w=Ne(e.defaultValue),S=dr(e,"value"),R=WT(S,w),A=B4(e),{mergedSizeRef:N,mergedDisabledRef:H,mergedStatusRef:z}=A,x=Ne(!1),B=Ne(!1),j=Ne(!1),G=Ne(!1);let L=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}=j,{value:Ze}=R,{value:qt}=T;return!$e&&(Km(Ze)||Array.isArray(Ze)&&Km(Ze[0]))&&qt[0]}),Q=Ve(()=>{const{value:$e}=j,{value:Ze}=R,{value:qt}=T;return!$e&&qt[1]&&(Km(Ze)||Array.isArray(Ze)&&Km(Ze[1]))}),Y=Iu(()=>e.internalForceFocus||x.value),oe=Iu(()=>{if(H.value||e.readonly||!e.clearable||!Y.value&&!B.value)return!1;const{value:$e}=R,{value:Ze}=Y;return e.pair?!!(Array.isArray($e)&&($e[0]||$e[1]))&&(B.value||Ze):!!$e&&(B.value||Ze)}),X=Ve(()=>{const{showPasswordOn:$e}=e;if($e)return $e;if(e.showPasswordToggle)return"click"}),ae=Ne(!1),fe=Ve(()=>{const{textDecoration:$e}=e;return $e?Array.isArray($e)?$e.map(Ze=>({textDecoration:Ze})):[{textDecoration:$e}]:["",""]}),le=Ne(void 0),ce=()=>{var $e,Ze;if(e.type==="textarea"){const{autosize:qt}=e;if(qt&&(le.value=(Ze=($e=C.value)===null||$e===void 0?void 0:$e.$el)===null||Ze===void 0?void 0:Ze.offsetWidth),!u.value||typeof qt=="boolean")return;const{paddingTop:wn,paddingBottom:Mn,lineHeight:Pn}=window.getComputedStyle(u.value),Kr=Number(wn.slice(0,-2)),$r=Number(Mn.slice(0,-2)),ro=Number(Pn.slice(0,-2)),{value:us}=d;if(!us)return;if(qt.minRows){const U=Math.max(qt.minRows,1),cs=`${Kr+$r+ro*U}px`;us.style.minHeight=cs}if(qt.maxRows){const U=`${Kr+$r+ro*qt.maxRows}px`;us.style.maxHeight=U}}},J=Ve(()=>{const{maxlength:$e}=e;return $e===void 0?void 0:Number($e)});On(()=>{const{value:$e}=R;Array.isArray($e)||qn($e)});const re=Yi().proxy;function de($e){const{onUpdateValue:Ze,"onUpdate:value":qt,onInput:wn}=e,{nTriggerFormInput:Mn}=A;Ze&&Er(Ze,$e),qt&&Er(qt,$e),wn&&Er(wn,$e),w.value=$e,Mn()}function Oe($e){const{onChange:Ze}=e,{nTriggerFormChange:qt}=A;Ze&&Er(Ze,$e),w.value=$e,qt()}function ve($e){const{onBlur:Ze}=e,{nTriggerFormBlur:qt}=A;Ze&&Er(Ze,$e),qt()}function Me($e){const{onFocus:Ze}=e,{nTriggerFormFocus:qt}=A;Ze&&Er(Ze,$e),qt()}function K($e){const{onClear:Ze}=e;Ze&&Er(Ze,$e)}function me($e){const{onInputBlur:Ze}=e;Ze&&Er(Ze,$e)}function ke($e){const{onInputFocus:Ze}=e;Ze&&Er(Ze,$e)}function pe(){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 ie($e){const{onWrapperFocus:Ze}=e;Ze&&Er(Ze,$e)}function Ie($e){const{onWrapperBlur:Ze}=e;Ze&&Er(Ze,$e)}function ue(){j.value=!0}function Se($e){j.value=!1,$e.target===v.value?Pe($e,1):Pe($e,0)}function Pe($e,Ze=0,qt="input"){const wn=$e.target.value;if(qn(wn),$e instanceof InputEvent&&!$e.isComposing&&(j.value=!1),e.type==="textarea"){const{value:Pn}=C;Pn&&Pn.syncUnifiedContainer()}if(L=wn,j.value)return;M.recordCursor();const Mn=xe(wn);if(Mn)if(!e.pair)qt==="input"?de(wn):Oe(wn);else{let{value:Pn}=R;Array.isArray(Pn)?Pn=[Pn[0],Pn[1]]:Pn=["",""],Pn[Ze]=wn,qt==="input"?de(Pn):Oe(Pn)}re.$forceUpdate(),Mn||Ir(M.restoreCursor)}function xe($e){const{countGraphemes:Ze,maxlength:qt,minlength:wn}=e;if(Ze){let Pn;if(qt!==void 0&&(Pn===void 0&&(Pn=Ze($e)),Pn>Number(qt))||wn!==void 0&&(Pn===void 0&&(Pn=Ze($e)),Pn<Number(qt)))return!1}const{allowInput:Mn}=e;return typeof Mn=="function"?Mn($e):!0}function He($e){me($e),$e.relatedTarget===s.value&&pe(),$e.relatedTarget!==null&&($e.relatedTarget===g.value||$e.relatedTarget===v.value||$e.relatedTarget===u.value)||(G.value=!1),ye($e,"blur"),_.value=null}function Te($e,Ze){ke($e),x.value=!0,G.value=!0,W(),ye($e,"focus"),Ze===0?_.value=g.value:Ze===1?_.value=v.value:Ze===2&&(_.value=u.value)}function V($e){e.passivelyActivated&&(Ie($e),ye($e,"blur"))}function ne($e){e.passivelyActivated&&(x.value=!0,ie($e),ye($e,"focus"))}function ye($e,Ze){$e.relatedTarget!==null&&($e.relatedTarget===g.value||$e.relatedTarget===v.value||$e.relatedTarget===u.value||$e.relatedTarget===s.value)||(Ze==="focus"?(Me($e),x.value=!0):Ze==="blur"&&(ve($e),x.value=!1))}function Be($e,Ze){Pe($e,Ze,"change")}function je($e){te($e)}function lt($e){K($e),e.pair?(de(["",""]),Oe(["",""])):(de(""),Oe(""))}function Fe($e){const{onMousedown:Ze}=e;Ze&&Ze($e);const{tagName:qt}=$e.target;if(qt!=="INPUT"&&qt!=="TEXTAREA"){if(e.resizable){const{value:wn}=s;if(wn){const{left:Mn,top:Pn,width:Kr,height:$r}=wn.getBoundingClientRect(),ro=14;if(Mn+Kr-ro<$e.clientX&&$e.clientX<Mn+Kr&&Pn+$r-ro<$e.clientY&&$e.clientY<Pn+$r)return}}$e.preventDefault(),x.value||Qe()}}function st(){var $e;B.value=!0,e.type==="textarea"&&(($e=C.value)===null||$e===void 0||$e.handleMouseEnterWrapper())}function wt(){var $e;B.value=!1,e.type==="textarea"&&(($e=C.value)===null||$e===void 0||$e.handleMouseLeaveWrapper())}function mn(){H.value||X.value==="click"&&(ae.value=!ae.value)}function In($e){if(H.value)return;$e.preventDefault();const Ze=wn=>{wn.preventDefault(),Mr("mouseup",document,Ze)};if(po("mouseup",document,Ze),X.value!=="mousedown")return;ae.value=!0;const qt=()=>{ae.value=!1,Mr("mouseup",document,qt)};po("mouseup",document,qt)}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,qt;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():(qt=g.value)===null||qt===void 0||qt.focus()}}function vn(){e.passivelyActivated&&(G.value=!1,Ir(()=>{var $e;($e=s.value)===null||$e===void 0||$e.focus()}))}function Qe(){var $e,Ze,qt;H.value||(e.passivelyActivated?($e=s.value)===null||$e===void 0||$e.focus():((Ze=u.value)===null||Ze===void 0||Ze.focus(),(qt=g.value)===null||qt===void 0||qt.focus()))}function yt(){var $e;!(($e=s.value)===null||$e===void 0)&&$e.contains(document.activeElement)&&document.activeElement.blur()}function Pt(){var $e,Ze;($e=u.value)===null||$e===void 0||$e.select(),(Ze=g.value)===null||Ze===void 0||Ze.select()}function ln(){H.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:qt,autosize:wn}=e;if(!qt&&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(){ce()}const St=Ne({top:"0"});function _t($e){var Ze;const{scrollTop:qt}=$e.target;St.value.top=`${-qt}px`,(Ze=C.value)===null||Ze===void 0||Ze.syncUnifiedContainer()}let Ht=null;nn(()=>{const{autosize:$e,type:Ze}=e;$e&&Ze==="textarea"?Ht=$t(R,qt=>{!Array.isArray(qt)&&qt!==L&&qn(qt)}):Ht==null||Ht()});let Yt=null;nn(()=>{e.type==="textarea"?Yt=$t(R,$e=>{var Ze;!Array.isArray($e)&&$e!==L&&((Ze=C.value)===null||Ze===void 0||Ze.syncUnifiedContainer())}):Yt==null||Yt()}),ci(U3,{mergedValueRef:R,maxlengthRef:J,mergedClsPrefixRef:t,countGraphemesRef:dr(e,"countGraphemes")});const yr={wrapperElRef:s,inputElRef:g,textareaElRef:u,isCompositing:j,focus:Qe,blur:yt,select:Pt,deactivate:en,activate:ln,scrollTo:Tn},Cr=lw("Input",o,t),Zo=Ve(()=>{const{value:$e}=N,{common:{cubicBezierEaseInOut:Ze},self:{color:qt,borderRadius:wn,textColor:Mn,caretColor:Pn,caretColorError:Kr,caretColorWarning:$r,textDecorationColor:ro,border:us,borderDisabled:U,borderHover:cs,borderFocus:Gt,placeholderColor:_l,placeholderColorDisabled:Qs,lineHeightTextarea:bl,colorDisabled:Ml,colorFocus:Ra,textColorDisabled:Qo,boxShadowFocus:Na,iconSize:ds,colorFocusWarning:Xi,boxShadowFocusWarning:vd,borderWarning:yd,borderFocusWarning:ea,borderHoverWarning:sp,colorFocusError:_d,boxShadowFocusError:Br,borderError:un,borderFocusError:Et,borderHoverError:Zi,clearSize:yn,clearColor:rt,clearColorHover:Ge,clearColorPressed:fs,iconColor:Go,iconColorDisabled:ap,suffixTextColor:bd,countTextColor:Os,countTextColorDisabled:Md,iconColorHover:Ni,iconColorPressed:Il,loadingColor:Cl,loadingColorError:ei,loadingColorWarning:Id,[Qt("padding",$e)]:lp,[Qt("fontSize",$e)]:ta,[Qt("height",$e)]:Tl}}=i.value,{left:wl,right:Cd}=nh(lp);return{"--n-bezier":Ze,"--n-count-text-color":Os,"--n-count-text-color-disabled":Md,"--n-color":qt,"--n-font-size":ta,"--n-border-radius":wn,"--n-height":Tl,"--n-padding-left":wl,"--n-padding-right":Cd,"--n-text-color":Mn,"--n-caret-color":Pn,"--n-text-decoration-color":ro,"--n-border":us,"--n-border-disabled":U,"--n-border-hover":cs,"--n-border-focus":Gt,"--n-placeholder-color":_l,"--n-placeholder-color-disabled":Qs,"--n-icon-size":ds,"--n-line-height-textarea":bl,"--n-color-disabled":Ml,"--n-color-focus":Ra,"--n-text-color-disabled":Qo,"--n-box-shadow-focus":Na,"--n-loading-color":Cl,"--n-caret-color-warning":$r,"--n-color-focus-warning":Xi,"--n-box-shadow-focus-warning":vd,"--n-border-warning":yd,"--n-border-focus-warning":ea,"--n-border-hover-warning":sp,"--n-loading-color-warning":Id,"--n-caret-color-error":Kr,"--n-color-focus-error":_d,"--n-box-shadow-focus-error":Br,"--n-border-error":un,"--n-border-focus-error":Et,"--n-border-hover-error":Zi,"--n-loading-color-error":ei,"--n-clear-color":rt,"--n-clear-size":yn,"--n-clear-color-hover":Ge,"--n-clear-color-pressed":fs,"--n-icon-color":Go,"--n-icon-color-hover":Ni,"--n-icon-color-pressed":Il,"--n-icon-color-disabled":ap,"--n-suffix-text-color":bd}}),ho=r?Pu("input",Ve(()=>{const{value:$e}=N;return $e[0]}),Zo,e):void 0;return Object.assign(Object.assign({},yr),{wrapperElRef:s,inputElRef:g,inputMirrorElRef:f,inputEl2Ref:v,textareaElRef:u,textareaMirrorElRef:d,textareaScrollbarInstRef:C,rtlEnabled:Cr,uncontrolledValue:w,mergedValue:R,passwordVisible:ae,mergedPlaceholder:T,showPlaceholder1:P,showPlaceholder2:Q,mergedFocus:Y,isComposing:j,activated:G,showClearButton:oe,mergedSize:N,mergedDisabled:H,textDecorationStyle:fe,mergedClsPrefix:t,mergedBordered:n,mergedShowPasswordOn:X,placeholderStyle:St,mergedStatus:z,textAreaScrollContainerWidth:le,handleTextAreaScroll:_t,handleCompositionStart:ue,handleCompositionEnd:Se,handleInput:Pe,handleInputBlur:He,handleInputFocus:Te,handleWrapperBlur:V,handleWrapperFocus:ne,handleMouseEnter:st,handleMouseLeave:wt,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:Zo,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`},Vs(d.prefix,f=>f&&Re("div",{class:`${n}-input__prefix`},f)),i==="textarea"?Re(L3,{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&&Vs(d.suffix,f=>f||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?Re("div",{class:`${n}-input__suffix`},[Vs(d["clear-icon-placeholder"],g=>(this.clearable||g)&&Re(zI,{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(UMe,{clsPrefix:n,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?f:null,this.showCount&&this.type!=="textarea"?Re(JA,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?Eh(d["password-visible-icon"],()=>[Re(Si,{clsPrefix:n},{default:()=>Re(Vbe,null)})]):Eh(d["password-invisible-icon"],()=>[Re(Si,{clsPrefix:n},{default:()=>Re(zbe,null)})])):null]):null)),this.pair?Re("span",{class:`${n}-input__separator`},Eh(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),Vs(d.suffix,f=>(this.clearable||f)&&Re("div",{class:`${n}-input__suffix`},[this.clearable&&Re(zI,{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(JA,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)}}),JMe=wg&&"loading"in document.createElement("img"),XMe=(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})}},iM=new WeakMap,sM=new WeakMap,aM=new WeakMap,ZMe=(e,t,n)=>{if(!e)return()=>{};const r=XMe(t),{root:o}=r.options;let i;const s=iM.get(o);s?i=s:(i=new Map,iM.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=sM.get(_.target),C=aM.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||(sM.delete(e),aM.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||iM.delete(o))};return sM.set(e,g),aM.set(e,n),g};function ec(e){return d0(e,[255,255,255,.16])}function Ym(e){return d0(e,[0,0,0,.12])}const QMe="n-button-group",eIe={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"},tIe=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:R,infoColorHover:A,infoColorPressed:N,successColor:H,successColorHover:z,successColorPressed:x,warningColor:B,warningColorHover:j,warningColorPressed:G,errorColor:L,errorColorHover:T,errorColorPressed:P,fontWeight:Q,buttonColor2:Y,buttonColor2Hover:oe,buttonColor2Pressed:X,fontWeightStrong:ae}=e;return Object.assign(Object.assign({},eIe),{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:Y,colorSecondaryHover:oe,colorSecondaryPressed:X,colorTertiary:Y,colorTertiaryHover:oe,colorTertiaryPressed:X,colorQuaternary:"#0000",colorQuaternaryHover:oe,colorQuaternaryPressed:X,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:R,colorHoverInfo:A,colorPressedInfo:N,colorFocusInfo:A,colorDisabledInfo:R,textColorInfo:S,textColorHoverInfo:S,textColorPressedInfo:S,textColorFocusInfo:S,textColorDisabledInfo:S,textColorTextInfo:R,textColorTextHoverInfo:A,textColorTextPressedInfo:N,textColorTextFocusInfo:A,textColorTextDisabledInfo:v,textColorGhostInfo:R,textColorGhostHoverInfo:A,textColorGhostPressedInfo:N,textColorGhostFocusInfo:A,textColorGhostDisabledInfo:R,borderInfo:`1px solid ${R}`,borderHoverInfo:`1px solid ${A}`,borderPressedInfo:`1px solid ${N}`,borderFocusInfo:`1px solid ${A}`,borderDisabledInfo:`1px solid ${R}`,rippleColorInfo:R,colorSuccess:H,colorHoverSuccess:z,colorPressedSuccess:x,colorFocusSuccess:z,colorDisabledSuccess:H,textColorSuccess:S,textColorHoverSuccess:S,textColorPressedSuccess:S,textColorFocusSuccess:S,textColorDisabledSuccess:S,textColorTextSuccess:H,textColorTextHoverSuccess:z,textColorTextPressedSuccess:x,textColorTextFocusSuccess:z,textColorTextDisabledSuccess:v,textColorGhostSuccess:H,textColorGhostHoverSuccess:z,textColorGhostPressedSuccess:x,textColorGhostFocusSuccess:z,textColorGhostDisabledSuccess:H,borderSuccess:`1px solid ${H}`,borderHoverSuccess:`1px solid ${z}`,borderPressedSuccess:`1px solid ${x}`,borderFocusSuccess:`1px solid ${z}`,borderDisabledSuccess:`1px solid ${H}`,rippleColorSuccess:H,colorWarning:B,colorHoverWarning:j,colorPressedWarning:G,colorFocusWarning:j,colorDisabledWarning:B,textColorWarning:S,textColorHoverWarning:S,textColorPressedWarning:S,textColorFocusWarning:S,textColorDisabledWarning:S,textColorTextWarning:B,textColorTextHoverWarning:j,textColorTextPressedWarning:G,textColorTextFocusWarning:j,textColorTextDisabledWarning:v,textColorGhostWarning:B,textColorGhostHoverWarning:j,textColorGhostPressedWarning:G,textColorGhostFocusWarning:j,textColorGhostDisabledWarning:B,borderWarning:`1px solid ${B}`,borderHoverWarning:`1px solid ${j}`,borderPressedWarning:`1px solid ${G}`,borderFocusWarning:`1px solid ${j}`,borderDisabledWarning:`1px solid ${B}`,rippleColorWarning:B,colorError:L,colorHoverError:T,colorPressedError:P,colorFocusError:T,colorDisabledError:L,textColorError:S,textColorHoverError:S,textColorPressedError:S,textColorFocusError:S,textColorDisabledError:S,textColorTextError:L,textColorTextHoverError:T,textColorTextPressedError:P,textColorTextFocusError:T,textColorTextDisabledError:v,textColorGhostError:L,textColorGhostHoverError:T,textColorGhostPressedError:P,textColorGhostFocusError:T,textColorGhostDisabledError:L,borderError:`1px solid ${L}`,borderHoverError:`1px solid ${T}`,borderPressedError:`1px solid ${P}`,borderFocusError:`1px solid ${T}`,borderDisabledError:`1px solid ${L}`,rippleColorError:L,waveOpacity:"0.6",fontWeight:Q,fontWeightStrong:ae})},nIe={name:"Button",common:yl,self:tIe},rIe=nIe,oIe=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);
- `,[Mt("color",[gt("border",{borderColor:"var(--n-border-color)"}),Mt("disabled",[gt("border",{borderColor:"var(--n-border-color-disabled)"})]),is("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)"})]),Mt("pressed",[gt("state-border",{borderColor:"var(--n-border-color-pressed)"})])])]),Mt("disabled",{backgroundColor:"var(--n-color-disabled)",color:"var(--n-text-color-disabled)"},[gt("border",{border:"var(--n-border-disabled)"})]),is("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)"})]),Mt("pressed",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[gt("state-border",{border:"var(--n-border-pressed)"})])]),Mt("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);
- `,[Mt("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;
- `,[Cy({top:"50%",originalTransform:"translateY(-50%)"})]),FMe()]),gt("content",`
- display: flex;
- align-items: center;
- flex-wrap: nowrap;
- min-width: 0;
- `,[ut("~",[gt("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),Mt("block",`
- display: flex;
- width: 100%;
- `),Mt("dashed",[gt("border, state-border",{borderStyle:"dashed !important"})]),Mt("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}})]),iIe=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:!x3}}),sIe=ot({name:"Button",props:iIe,setup(e){const t=Ne(null),n=Ne(null),r=Ne(!1),o=Iu(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),i=tn(QMe,{}),{mergedSizeRef:s}=B4({},{defaultSize:"medium",mergedSize:N=>{const{size:H}=e;if(H)return H;const{size:z}=i;if(z)return z;const{mergedSize:x}=N||{};return x?x.value:"medium"}}),u=Ve(()=>e.focusable&&!e.disabled),d=N=>{var H;u.value||N.preventDefault(),!e.nativeFocusBehavior&&(N.preventDefault(),!e.disabled&&u.value&&((H=t.value)===null||H===void 0||H.focus({preventScroll:!0})))},f=N=>{var H;if(!e.disabled&&!e.loading){const{onClick:z}=e;z&&Er(z,N),e.text||(H=n.value)===null||H===void 0||H.play()}},g=N=>{switch(N.key){case"Enter":if(!e.keyboard)return;r.value=!1}},v=N=>{switch(N.key){case"Enter":if(!e.keyboard||e.loading){N.preventDefault();return}r.value=!0}},_=()=>{r.value=!1},{inlineThemeDisabled:M,mergedClsPrefixRef:C,mergedRtlRef:D}=Oa(e),w=no("Button","-button",oIe,rIe,e,C),S=lw("Button",D,C),R=Ve(()=>{const N=w.value,{common:{cubicBezierEaseInOut:H,cubicBezierEaseOut:z},self:x}=N,{rippleDuration:B,opacityDisabled:j,fontWeight:G,fontWeightStrong:L}=x,T=s.value,{dashed:P,type:Q,ghost:Y,text:oe,color:X,round:ae,circle:fe,textColor:le,secondary:ce,tertiary:J,quaternary:re,strong:de}=e,Oe={"font-weight":de?L:G};let ve={"--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 Me=Q==="tertiary",K=Q==="default",me=Me?"default":Q;if(oe){const He=le||X;ve={"--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",me)],"--n-text-color-hover":He?ec(He):x[Qt("textColorTextHover",me)],"--n-text-color-pressed":He?Ym(He):x[Qt("textColorTextPressed",me)],"--n-text-color-focus":He?ec(He):x[Qt("textColorTextHover",me)],"--n-text-color-disabled":He||x[Qt("textColorTextDisabled",me)]}}else if(Y||P){const He=le||X;ve={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":X||x[Qt("rippleColor",me)],"--n-text-color":He||x[Qt("textColorGhost",me)],"--n-text-color-hover":He?ec(He):x[Qt("textColorGhostHover",me)],"--n-text-color-pressed":He?Ym(He):x[Qt("textColorGhostPressed",me)],"--n-text-color-focus":He?ec(He):x[Qt("textColorGhostHover",me)],"--n-text-color-disabled":He||x[Qt("textColorGhostDisabled",me)]}}else if(ce){const He=K?x.textColor:Me?x.textColorTertiary:x[Qt("color",me)],Te=X||He,V=Q!=="default"&&Q!=="tertiary";ve={"--n-color":V?Pc(Te,{alpha:Number(x.colorOpacitySecondary)}):x.colorSecondary,"--n-color-hover":V?Pc(Te,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-pressed":V?Pc(Te,{alpha:Number(x.colorOpacitySecondaryPressed)}):x.colorSecondaryPressed,"--n-color-focus":V?Pc(Te,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-disabled":x.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":Te,"--n-text-color-hover":Te,"--n-text-color-pressed":Te,"--n-text-color-focus":Te,"--n-text-color-disabled":Te}}else if(J||re){const He=K?x.textColor:Me?x.textColorTertiary:x[Qt("color",me)],Te=X||He;J?(ve["--n-color"]=x.colorTertiary,ve["--n-color-hover"]=x.colorTertiaryHover,ve["--n-color-pressed"]=x.colorTertiaryPressed,ve["--n-color-focus"]=x.colorSecondaryHover,ve["--n-color-disabled"]=x.colorTertiary):(ve["--n-color"]=x.colorQuaternary,ve["--n-color-hover"]=x.colorQuaternaryHover,ve["--n-color-pressed"]=x.colorQuaternaryPressed,ve["--n-color-focus"]=x.colorQuaternaryHover,ve["--n-color-disabled"]=x.colorQuaternary),ve["--n-ripple-color"]="#0000",ve["--n-text-color"]=Te,ve["--n-text-color-hover"]=Te,ve["--n-text-color-pressed"]=Te,ve["--n-text-color-focus"]=Te,ve["--n-text-color-disabled"]=Te}else ve={"--n-color":X||x[Qt("color",me)],"--n-color-hover":X?ec(X):x[Qt("colorHover",me)],"--n-color-pressed":X?Ym(X):x[Qt("colorPressed",me)],"--n-color-focus":X?ec(X):x[Qt("colorFocus",me)],"--n-color-disabled":X||x[Qt("colorDisabled",me)],"--n-ripple-color":X||x[Qt("rippleColor",me)],"--n-text-color":le||(X?x.textColorPrimary:Me?x.textColorTertiary:x[Qt("textColor",me)]),"--n-text-color-hover":le||(X?x.textColorHoverPrimary:x[Qt("textColorHover",me)]),"--n-text-color-pressed":le||(X?x.textColorPressedPrimary:x[Qt("textColorPressed",me)]),"--n-text-color-focus":le||(X?x.textColorFocusPrimary:x[Qt("textColorFocus",me)]),"--n-text-color-disabled":le||(X?x.textColorDisabledPrimary:x[Qt("textColorDisabled",me)])};let ke={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};oe?ke={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:ke={"--n-border":x[Qt("border",me)],"--n-border-hover":x[Qt("borderHover",me)],"--n-border-pressed":x[Qt("borderPressed",me)],"--n-border-focus":x[Qt("borderFocus",me)],"--n-border-disabled":x[Qt("borderDisabled",me)]};const{[Qt("height",T)]:pe,[Qt("fontSize",T)]:W,[Qt("padding",T)]:te,[Qt("paddingRound",T)]:ie,[Qt("iconSize",T)]:Ie,[Qt("borderRadius",T)]:ue,[Qt("iconMargin",T)]:Se,waveOpacity:Pe}=x,xe={"--n-width":fe&&!oe?pe:"initial","--n-height":oe?"initial":pe,"--n-font-size":W,"--n-padding":fe||oe?"initial":ae?ie:te,"--n-icon-size":Ie,"--n-icon-margin":Se,"--n-border-radius":oe?"initial":fe||ae?pe:ue};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":H,"--n-bezier-ease-out":z,"--n-ripple-duration":B,"--n-opacity-disabled":j,"--n-wave-opacity":Pe},Oe),ve),ke),xe)}),A=M?Pu("button",Ve(()=>{let N="";const{dashed:H,type:z,ghost:x,text:B,color:j,round:G,circle:L,textColor:T,secondary:P,tertiary:Q,quaternary:Y,strong:oe}=e;H&&(N+="a"),x&&(N+="b"),B&&(N+="c"),G&&(N+="d"),L&&(N+="e"),P&&(N+="f"),Q&&(N+="g"),Y&&(N+="h"),oe&&(N+="i"),j&&(N+="j"+jE(j)),T&&(N+="k"+jE(T));const{value:X}=s;return N+="l"+X[0],N+="m"+z[0],N}),R,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:N}=e;if(!N)return null;const H=ec(N);return{"--n-border-color":N,"--n-border-color-hover":H,"--n-border-color-pressed":Ym(N),"--n-border-color-focus":H,"--n-border-color-disabled":N}}),cssVars:M?void 0:R,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=Vs(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(eMe,{width:!0},{default:()=>Vs(this.$slots.icon,o=>(this.loading||this.renderIcon||o)&&Re("span",{class:`${e}-button__icon`,style:{margin:LI(this.$slots.default)?"0":""}},Re(uw,null,{default:()=>this.loading?Re(cw,{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(wMe,{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)}}),aIe=sIe,lIe={padding:"8px 14px"},uIe=e=>{const{borderRadius:t,boxShadow2:n,baseColor:r}=e;return Object.assign(Object.assign({},lIe),{borderRadius:t,boxShadow:n,color:d0(r,"rgba(0, 0, 0, .85)"),textColor:r})},cIe={name:"Tooltip",common:yl,peers:{Popover:O3},self:uIe},F3=cIe,dIe=Object.assign(Object.assign({},N3),no.props),G3=ot({name:"Tooltip",props:dIe,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=Oa(e),n=no("Tooltip","-tooltip",void 0,F3,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(P3,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)}}),$3=Object.assign(Object.assign({},no.props),{showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean}),B3="n-image";function fIe(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}const pIe={name:"Image",common:yl,peers:{Tooltip:F3},self:fIe},hIe=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}},gIe={name:"Spin",common:yl,self:hIe},mIe=gIe,vIe={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"},yIe=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({},vIe),{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})},_Ie={name:"Tabs",common:yl,self:yIe},bIe=_Ie,MIe=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"})),IIe=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"})),CIe=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"})),TIe=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);
- `,[Ty()]),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;
- `),Ty()]),et("image-preview-wrapper",`
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- display: flex;
- pointer-events: none;
- `,[CMe()]),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%;
- `,[is("preview-disabled",`
- cursor: pointer;
- `),ut("img",`
- border-radius: inherit;
- `)])]),Jm=32,wIe=ot({name:"ImagePreview",props:Object.assign(Object.assign({},$3),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const t=no("Image","-image",TIe,pIe,e,dr(e,"clsPrefix"));let n=null;const r=Ne(null),o=Ne(null),i=Ne(void 0),s=Ne(!1),u=Ne(!1),{localeRef:d}=aw("Image");function f(){const{value:W}=o;if(!n||!W)return;const{style:te}=W,ie=n.getBoundingClientRect(),Ie=ie.left+ie.width/2,ue=ie.top+ie.height/2;te.transformOrigin=`${Ie}px ${ue}px`}function g(W){var te,ie;switch(W.key){case" ":W.preventDefault();break;case"ArrowLeft":(te=e.onPrev)===null||te===void 0||te.call(e);break;case"ArrowRight":(ie=e.onNext)===null||ie===void 0||ie.call(e);break;case"Escape":Oe();break}}$t(s,W=>{W?po("keydown",document,g):Mr("keydown",document,g)}),vi(()=>{Mr("keydown",document,g)});let v=0,_=0,M=0,C=0,D=0,w=0,S=0,R=0,A=!1;function N(W){const{clientX:te,clientY:ie}=W;M=te-v,C=ie-_,d4(de)}function H(W){const{mouseUpClientX:te,mouseUpClientY:ie,mouseDownClientX:Ie,mouseDownClientY:ue}=W,Se=Ie-te,Pe=ue-ie,xe=`vertical${Pe>0?"Top":"Bottom"}`,He=`horizontal${Se>0?"Left":"Right"}`;return{moveVerticalDirection:xe,moveHorizontalDirection:He,deltaHorizontal:Se,deltaVertical:Pe}}function z(W){const{value:te}=r;if(!te)return{offsetX:0,offsetY:0};const ie=te.getBoundingClientRect(),{moveVerticalDirection:Ie,moveHorizontalDirection:ue,deltaHorizontal:Se,deltaVertical:Pe}=W||{};let xe=0,He=0;return ie.width<=window.innerWidth?xe=0:ie.left>0?xe=(ie.width-window.innerWidth)/2:ie.right<window.innerWidth?xe=-(ie.width-window.innerWidth)/2:ue==="horizontalRight"?xe=Math.min((ie.width-window.innerWidth)/2,D-(Se??0)):xe=Math.max(-((ie.width-window.innerWidth)/2),D-(Se??0)),ie.height<=window.innerHeight?He=0:ie.top>0?He=(ie.height-window.innerHeight)/2:ie.bottom<window.innerHeight?He=-(ie.height-window.innerHeight)/2:Ie==="verticalBottom"?He=Math.min((ie.height-window.innerHeight)/2,w-(Pe??0)):He=Math.max(-((ie.height-window.innerHeight)/2),w-(Pe??0)),{offsetX:xe,offsetY:He}}function x(W){Mr("mousemove",document,N),Mr("mouseup",document,x);const{clientX:te,clientY:ie}=W;A=!1;const Ie=H({mouseUpClientX:te,mouseUpClientY:ie,mouseDownClientX:S,mouseDownClientY:R}),ue=z(Ie);M=ue.offsetX,C=ue.offsetY,de()}const B=tn(B3,null);function j(W){var te,ie;if((ie=(te=B==null?void 0:B.previewedImgPropsRef.value)===null||te===void 0?void 0:te.onMousedown)===null||ie===void 0||ie.call(te,W),W.button!==0)return;const{clientX:Ie,clientY:ue}=W;A=!0,v=Ie-M,_=ue-C,D=M,w=C,S=Ie,R=ue,de(),po("mousemove",document,N),po("mouseup",document,x)}function G(W){var te,ie;(ie=(te=B==null?void 0:B.previewedImgPropsRef.value)===null||te===void 0?void 0:te.onDblclick)===null||ie===void 0||ie.call(te,W);const Ie=ce();P=P===Ie?1:Ie,de()}const L=1.5;let T=0,P=1,Q=0;function Y(){P=1,T=0}function oe(){var W;Y(),Q=0,(W=e.onPrev)===null||W===void 0||W.call(e)}function X(){var W;Y(),Q=0,(W=e.onNext)===null||W===void 0||W.call(e)}function ae(){Q-=90,de()}function fe(){Q+=90,de()}function le(){const{value:W}=r;if(!W)return 1;const{innerWidth:te,innerHeight:ie}=window,Ie=Math.max(1,W.naturalHeight/(ie-Jm)),ue=Math.max(1,W.naturalWidth/(te-Jm));return Math.max(3,Ie*2,ue*2)}function ce(){const{value:W}=r;if(!W)return 1;const{innerWidth:te,innerHeight:ie}=window,Ie=W.naturalHeight/(ie-Jm),ue=W.naturalWidth/(te-Jm);return Ie<1&&ue<1?1:Math.max(Ie,ue)}function J(){const W=le();P<W&&(T+=1,P=Math.min(W,Math.pow(L,T)),de())}function re(){if(P>.5){const W=P;T-=1,P=Math.max(.5,Math.pow(L,T));const te=W-P;de(!1);const ie=z();P+=te,de(!1),P-=te,M=ie.offsetX,C=ie.offsetY,de()}}function de(W=!0){var te;const{value:ie}=r;if(!ie)return;const{style:Ie}=ie,ue=Ro((te=B==null?void 0:B.previewedImgPropsRef.value)===null||te===void 0?void 0:te.style);let Se="";if(typeof ue=="string")Se=ue+";";else for(const xe in ue)Se+=`${Lbe(xe)}: ${ue[xe]};`;const Pe=`transform-origin: center; transform: translateX(${M}px) translateY(${C}px) rotate(${Q}deg) scale(${P});`;A?Ie.cssText=Se+"cursor: grabbing; transition: none;"+Pe:Ie.cssText=Se+"cursor: grab;"+Pe+(W?"":"transition: none;"),W||ie.offsetHeight}function Oe(){s.value=!s.value,u.value=!0}function ve(){P=ce(),T=Math.ceil(Math.log(P)/Math.log(L)),M=0,C=0,de()}const Me={setPreviewSrc:W=>{i.value=W},setThumbnailEl:W=>{n=W},toggleShow:Oe};function K(W,te){if(e.showToolbarTooltip){const{value:ie}=t;return Re(G3,{to:!1,theme:ie.peers.Tooltip,themeOverrides:ie.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>d.value[te],trigger:()=>W})}else return W}const me=Ve(()=>{const{common:{cubicBezierEaseInOut:W},self:{toolbarIconColor:te,toolbarBorderRadius:ie,toolbarBoxShadow:Ie,toolbarColor:ue}}=t.value;return{"--n-bezier":W,"--n-toolbar-icon-color":te,"--n-toolbar-color":ue,"--n-toolbar-border-radius":ie,"--n-toolbar-box-shadow":Ie}}),{inlineThemeDisabled:ke}=Oa(),pe=ke?Pu("image-preview",void 0,me,e):void 0;return Object.assign({previewRef:r,previewWrapperRef:o,previewSrc:i,show:s,appear:p0(),displayed:u,previewedImgProps:B==null?void 0:B.previewedImgPropsRef,handleWheel(W){W.preventDefault()},handlePreviewMousedown:j,handlePreviewDblclick:G,syncTransformOrigin:f,handleAfterLeave:()=>{Y(),Q=0,u.value=!1},handleDragStart:W=>{var te,ie;(ie=(te=B==null?void 0:B.previewedImgPropsRef.value)===null||te===void 0?void 0:te.onDragstart)===null||ie===void 0||ie.call(te,W),W.preventDefault()},zoomIn:J,zoomOut:re,rotateCounterclockwise:ae,rotateClockwise:fe,handleSwitchPrev:oe,handleSwitchNext:X,withTooltip:K,resizeToOrignalImageSize:ve,cssVars:ke?void 0:me,themeClass:pe==null?void 0:pe.themeClass,onRender:pe==null?void 0:pe.onRender},Me)},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(A4,{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(Si,{clsPrefix:n,onClick:this.handleSwitchPrev},{default:()=>MIe}),"tipPrevious"),o(Re(Si,{clsPrefix:n,onClick:this.handleSwitchNext},{default:()=>IIe}),"tipNext")):null,o(Re(Si,{clsPrefix:n,onClick:this.rotateCounterclockwise},{default:()=>Re(Jbe,null)}),"tipCounterclockwise"),o(Re(Si,{clsPrefix:n,onClick:this.rotateClockwise},{default:()=>Re(Ybe,null)}),"tipClockwise"),o(Re(Si,{clsPrefix:n,onClick:this.resizeToOrignalImageSize},{default:()=>Re(Qbe,null)}),"tipOriginalSize"),o(Re(Si,{clsPrefix:n,onClick:this.zoomOut},{default:()=>Re(Zbe,null)}),"tipZoomOut"),o(Re(Si,{clsPrefix:n,onClick:this.zoomIn},{default:()=>Re(Xbe,null)}),"tipZoomIn"),o(Re(Si,{clsPrefix:n,onClick:this.toggleShow},{default:()=>CIe}),"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]])}})),[[KT,{enabled:this.show}]])):null}}))}}),SIe="n-image-group",kIe=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},$3),DIe=ot({name:"Image",props:kIe,inheritAttrs:!1,setup(e){const t=Ne(null),n=Ne(!1),r=Ne(null),o=tn(SIe,null),{mergedClsPrefixRef:i}=o||Oa(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=ZMe(t.value,e.intersectionObserverOptions,u)});vi(()=>{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 ci(B3,{previewedImgPropsRef:dr(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:JMe&&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(wIe,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:n,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},{default:()=>f}),!o&&u)}}),EIe=Object.assign(Object.assign({},no.props),{trigger:String,xScrollable:Boolean,onScroll:Function,size:Number}),AIe=ot({name:"Scrollbar",props:EIe,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(L3,Object.assign({ref:"scrollbarInstRef"},this.$props),this.$slots)}}),LIe=AIe,OIe=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%);
- `,[Ty()])]),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);
- `,[Mt("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;
- `,[Mt("spinning",`
- user-select: none;
- -webkit-user-select: none;
- pointer-events: none;
- opacity: var(--n-opacity-spinning);
- `)])]),RIe={small:20,medium:18,large:16},NIe=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}}),PIe=ot({name:"Spin",props:NIe,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=Oa(e),r=no("Spin","-spin",OIe,mIe,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"?Hhe(s):d[Qt("size",s)];return{"--n-bezier":u,"--n-opacity-spinning":f,"--n-size":_,"--n-color":g,"--n-text-color":v}}),i=n?Pu("spin",Ve(()=>{const{size:s}=e;return typeof s=="number"?String(s):s[0]}),o,e):void 0;return{mergedClsPrefix:t,compitableShow:vy(e,["spinning","show"]),mergedStrokeWidth:Ve(()=>{const{strokeWidth:s}=e;if(s!==void 0)return s;const{size:u}=e;return RIe[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(cw,{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}}),dw="n-tabs",H3={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]},xIe=ot({__TAB_PANE__:!0,name:"TabPane",alias:["TabPanel"],props:H3,setup(e){const t=tn(dw,null);return t||f4("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)}}),UIe=Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},Qhe(H3,["displayDirective"])),jI=ot({__TAB__:!0,inheritAttrs:!1,name:"Tab",props:UIe,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(dw);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},Ao({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(Si,{clsPrefix:t},{default:()=>Re(Hbe,null)})):g?g():typeof v=="object"?v:ege(v??n)),u&&this.type==="card"?Re(rMe,{clsPrefix:t,class:`${t}-tabs-tab__close`,onClick:this.handleClose,disabled:r}):null))}}),FIe=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);
- `,[Mt("segment-type",[et("tabs-rail",[ut("&.transition-disabled","color: red;",[et("tabs-tab",`
- transition: none;
- `)])])]),Mt("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);
- `)]),Mt("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);
- `)]),Mt("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);
- `)]),Mt("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;
- `)]),Mt("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;
- `,[Mt("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);
- `)])])]),Mt("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;")]),Mt("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;
- `),Mt("shadow-start",[ut("&::before",`
- box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12);
- `)]),Mt("shadow-end",[ut("&::after",`
- box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12);
- `)])])]),Mt("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;
- `),Mt("shadow-start",[ut("&::before",`
- box-shadow: inset 0 10px 8px -8px rgba(0, 0, 0, .12);
- `)]),Mt("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);
- `,[Mt("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;
- `),Mt("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;
- `),Mt("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)"}),Mt("active",`
- color: var(--n-tab-text-color-active);
- font-weight: var(--n-tab-font-weight-active);
- `),Mt("disabled",{color:"var(--n-tab-text-color-disabled)"})])]),et("tabs-nav",[Mt("line-type",[Mt("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;
- `)]),Mt("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;
- `)]),Mt("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;
- `)]),Mt("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;
- `)]),Mt("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);
- `,[Mt("addable",`
- padding-left: 8px;
- padding-right: 8px;
- font-size: 16px;
- `,[gt("height-placeholder",`
- width: 0;
- font-size: var(--n-tab-font-size);
- `),is("disabled",[ut("&:hover",`
- color: var(--n-tab-text-color-hover);
- `)])]),Mt("closable","padding-right: 8px;"),Mt("active",`
- background-color: #0000;
- font-weight: var(--n-tab-font-weight-active);
- color: var(--n-tab-text-color-active);
- `),Mt("disabled","color: var(--n-tab-text-color-disabled);")]),et("tabs-scroll-padding","border-bottom: 1px solid var(--n-tab-border-color);")]),Mt("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%;
- `)])])]),Mt("top",[Mt("card-type",[et("tabs-tab",`
- border-top-left-radius: var(--n-tab-border-radius);
- border-top-right-radius: var(--n-tab-border-radius);
- `,[Mt("active",`
- border-bottom: 1px solid #0000;
- `)]),et("tabs-tab-pad",`
- border-bottom: 1px solid var(--n-tab-border-color);
- `)])]),Mt("left",[Mt("card-type",[et("tabs-tab",`
- border-top-left-radius: var(--n-tab-border-radius);
- border-bottom-left-radius: var(--n-tab-border-radius);
- `,[Mt("active",`
- border-right: 1px solid #0000;
- `)]),et("tabs-tab-pad",`
- border-right: 1px solid var(--n-tab-border-color);
- `)])]),Mt("right",[Mt("card-type",[et("tabs-tab",`
- border-top-right-radius: var(--n-tab-border-radius);
- border-bottom-right-radius: var(--n-tab-border-radius);
- `,[Mt("active",`
- border-left: 1px solid #0000;
- `)]),et("tabs-tab-pad",`
- border-left: 1px solid var(--n-tab-border-color);
- `)])]),Mt("bottom",[Mt("card-type",[et("tabs-tab",`
- border-bottom-left-radius: var(--n-tab-border-radius);
- border-bottom-right-radius: var(--n-tab-border-radius);
- `,[Mt("active",`
- border-top: 1px solid #0000;
- `)]),et("tabs-tab-pad",`
- border-top: 1px solid var(--n-tab-border-color);
- `)])])])]),GIe=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]}),$Ie=ot({name:"Tabs",props:GIe,setup(e,{slots:t}){var n,r,o,i;const{mergedClsPrefixRef:s,inlineThemeDisabled:u}=Oa(e),d=no("Tabs","-tabs",FIe,bIe,e,s),f=Ne(null),g=Ne(null),v=Ne(null),_=Ne(null),M=Ne(null),C=Ne(!0),D=Ne(!0),w=vy(e,["labelSize","size"]),S=vy(e,["activeName","value"]),R=Ne((r=(n=S.value)!==null&&n!==void 0?n:e.defaultValue)!==null&&r!==void 0?r:t.default?(i=(o=_f(t.default())[0])===null||o===void 0?void 0:o.props)===null||i===void 0?void 0:i.name:null),A=WT(S,R),N={id:0},H=Ve(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});$t(A,()=>{N.id=0,j(),G()});function z(){var ue;const{value:Se}=A;return Se===null?null:(ue=f.value)===null||ue===void 0?void 0:ue.querySelector(`[data-name="${Se}"]`)}function x(ue){if(e.type==="card")return;const{value:Se}=g;if(Se&&ue){const Pe=`${s.value}-tabs-bar--disabled`,{barWidth:xe,placement:He}=e;if(ue.dataset.disabled==="true"?Se.classList.add(Pe):Se.classList.remove(Pe),["top","bottom"].includes(He)){if(B(["top","maxHeight","height"]),typeof xe=="number"&&ue.offsetWidth>=xe){const Te=Math.floor((ue.offsetWidth-xe)/2)+ue.offsetLeft;Se.style.left=`${Te}px`,Se.style.maxWidth=`${xe}px`}else Se.style.left=`${ue.offsetLeft}px`,Se.style.maxWidth=`${ue.offsetWidth}px`;Se.style.width="8192px",Se.offsetWidth}else{if(B(["left","maxWidth","width"]),typeof xe=="number"&&ue.offsetHeight>=xe){const Te=Math.floor((ue.offsetHeight-xe)/2)+ue.offsetTop;Se.style.top=`${Te}px`,Se.style.maxHeight=`${xe}px`}else Se.style.top=`${ue.offsetTop}px`,Se.style.maxHeight=`${ue.offsetHeight}px`;Se.style.height="8192px",Se.offsetHeight}}}function B(ue){const{value:Se}=g;if(Se)for(const Pe of ue)Se.style[Pe]=""}function j(){if(e.type==="card")return;const ue=z();ue&&x(ue)}function G(ue){var Se;const Pe=(Se=M.value)===null||Se===void 0?void 0:Se.$el;if(!Pe)return;const xe=z();if(!xe)return;const{scrollLeft:He,offsetWidth:Te}=Pe,{offsetLeft:V,offsetWidth:ne}=xe;He>V?Pe.scrollTo({top:0,left:V,behavior:"smooth"}):V+ne>He+Te&&Pe.scrollTo({top:0,left:V+ne-Te,behavior:"smooth"})}const L=Ne(null);let T=0,P=null;function Q(ue){const Se=L.value;if(Se){T=ue.getBoundingClientRect().height;const Pe=`${T}px`,xe=()=>{Se.style.height=Pe,Se.style.maxHeight=Pe};P?(xe(),P(),P=null):P=xe}}function Y(ue){const Se=L.value;if(Se){const Pe=ue.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 ue=L.value;ue&&(ue.style.maxHeight="",ue.style.height="")}const X={value:[]},ae=Ne("next");function fe(ue){const Se=A.value;let Pe="next";for(const xe of X.value){if(xe===Se)break;if(xe===ue){Pe="prev";break}}ae.value=Pe,le(ue)}function le(ue){const{onActiveNameChange:Se,onUpdateValue:Pe,"onUpdate:value":xe}=e;Se&&Er(Se,ue),Pe&&Er(Pe,ue),xe&&Er(xe,ue),R.value=ue}function ce(ue){const{onClose:Se}=e;Se&&Er(Se,ue)}function J(){const{value:ue}=g;if(!ue)return;const Se="transition-disabled";ue.classList.add(Se),j(),ue.classList.remove(Se)}let re=0;function de(ue){var Se;if(ue.contentRect.width===0&&ue.contentRect.height===0||re===ue.contentRect.width)return;re=ue.contentRect.width;const{type:Pe}=e;(Pe==="line"||Pe==="bar")&&J(),Pe!=="segment"&&ke((Se=M.value)===null||Se===void 0?void 0:Se.$el)}const Oe=rM(de,64);$t([()=>e.justifyContent,()=>e.size],()=>{Ir(()=>{const{type:ue}=e;(ue==="line"||ue==="bar")&&J()})});const ve=Ne(!1);function Me(ue){var Se;const{target:Pe,contentRect:{width:xe}}=ue,He=Pe.parentElement.offsetWidth;if(!ve.value)He<xe&&(ve.value=!0);else{const{value:Te}=_;if(!Te)return;He-xe>Te.$el.offsetWidth&&(ve.value=!1)}ke((Se=M.value)===null||Se===void 0?void 0:Se.$el)}const K=rM(Me,64);function me(){const{onAdd:ue}=e;ue&&ue(),Ir(()=>{const Se=z(),{value:Pe}=M;!Se||!Pe||Pe.scrollTo({left:Se.offsetLeft,top:0,behavior:"smooth"})})}function ke(ue){if(!ue)return;const{placement:Se}=e;if(Se==="top"||Se==="bottom"){const{scrollLeft:Pe,scrollWidth:xe,offsetWidth:He}=ue;C.value=Pe<=0,D.value=Pe+He>=xe}else{const{scrollTop:Pe,scrollHeight:xe,offsetHeight:He}=ue;C.value=Pe<=0,D.value=Pe+He>=xe}}const pe=rM(ue=>{ke(ue.target)},64);ci(dw,{triggerRef:dr(e,"trigger"),tabStyleRef:dr(e,"tabStyle"),paneClassRef:dr(e,"paneClass"),paneStyleRef:dr(e,"paneStyle"),mergedClsPrefixRef:s,typeRef:dr(e,"type"),closableRef:dr(e,"closable"),valueRef:A,tabChangeIdRef:N,onBeforeLeaveRef:dr(e,"onBeforeLeave"),activateTab:fe,handleClose:ce,handleAdd:me}),b4(()=>{j(),G()}),nn(()=>{const{value:ue}=v;if(!ue)return;const{value:Se}=s,Pe=`${Se}-tabs-nav-scroll-wrapper--shadow-start`,xe=`${Se}-tabs-nav-scroll-wrapper--shadow-end`;C.value?ue.classList.remove(Pe):ue.classList.add(Pe),D.value?ue.classList.remove(xe):ue.classList.add(xe)});const W=Ne(null);$t(A,()=>{if(e.type==="segment"){const ue=W.value;ue&&Ir(()=>{ue.classList.add("transition-disabled"),ue.offsetWidth,ue.classList.remove("transition-disabled")})}});const te={syncBarPosition:()=>{j()}},ie=Ve(()=>{const{value:ue}=w,{type:Se}=e,Pe={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[Se],xe=`${ue}${Pe}`,{self:{barColor:He,closeIconColor:Te,closeIconColorHover:V,closeIconColorPressed:ne,tabColor:ye,tabBorderColor:Be,paneTextColor:je,tabFontWeight:lt,tabBorderRadius:Fe,tabFontWeightActive:st,colorSegment:wt,fontWeightStrong:mn,tabColorSegment:In,closeSize:Cn,closeIconSize:En,closeColorHover:vn,closeColorPressed:Qe,closeBorderRadius:yt,[Qt("panePadding",ue)]:Pt,[Qt("tabPadding",xe)]:ln,[Qt("tabPaddingVertical",xe)]:en,[Qt("tabGap",xe)]:Tn,[Qt("tabGap",`${xe}Vertical`)]:qn,[Qt("tabTextColor",Se)]:ze,[Qt("tabTextColorActive",Se)]:St,[Qt("tabTextColorHover",Se)]:_t,[Qt("tabTextColorDisabled",Se)]:Ht,[Qt("tabFontSize",ue)]:Yt},common:{cubicBezierEaseInOut:yr}}=d.value;return{"--n-bezier":yr,"--n-color-segment":wt,"--n-bar-color":He,"--n-tab-font-size":Yt,"--n-tab-text-color":ze,"--n-tab-text-color-active":St,"--n-tab-text-color-disabled":Ht,"--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":Te,"--n-close-icon-color-hover":V,"--n-close-icon-color-pressed":ne,"--n-tab-color":ye,"--n-tab-font-weight":lt,"--n-tab-font-weight-active":st,"--n-tab-padding":ln,"--n-tab-padding-vertical":en,"--n-tab-gap":Tn,"--n-tab-gap-vertical":qn,"--n-pane-padding-left":nh(Pt,"left"),"--n-pane-padding-right":nh(Pt,"right"),"--n-pane-padding-top":nh(Pt,"top"),"--n-pane-padding-bottom":nh(Pt,"bottom"),"--n-font-weight-strong":mn,"--n-tab-color-segment":In}}),Ie=u?Pu("tabs",Ve(()=>`${w.value[0]}${e.type[0]}`),ie,e):void 0;return Object.assign({mergedClsPrefix:s,mergedValue:A,renderedNames:new Set,tabsRailElRef:W,tabsPaneWrapperRef:L,tabsElRef:f,barElRef:g,addTabInstRef:_,xScrollInstRef:M,scrollWrapperElRef:v,addTabFixed:ve,tabWrapperStyle:H,handleNavResize:Oe,mergedSize:w,handleScroll:pe,handleTabsResize:K,cssVars:u?void 0:ie,themeClass:Ie==null?void 0:Ie.themeClass,animationDirection:ae,renderNameListRef:X,onAnimationBeforeLeave:Q,onAnimationEnter:Y,onAnimationAfterEnter:oe,onRender:Ie==null?void 0:Ie.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?_f(g()).filter(H=>H.type.__TAB_PANE__===!0):[],C=g?_f(g()).filter(H=>H.type.__TAB__===!0):[],D=!C.length,w=t==="card",S=t==="segment",R=!w&&!S&&this.justifyContent;s.value=[];const A=()=>{const H=Re("div",{style:this.tabWrapperStyle,class:[`${e}-tabs-wrapper`]},R?null:Re("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}),D?M.map((z,x)=>(s.value.push(z.props.name),lM(Re(jI,Object.assign({},z.props,{internalCreatedByPane:!0,internalLeftPadded:x!==0&&(!R||R==="center"||R==="start"||R==="end")}),z.children?{default:z.children.tab}:void 0)))):C.map((z,x)=>(s.value.push(z.props.name),lM(x!==0&&!R?QA(z):z))),!r&&o&&w?ZA(o,(D?M.length:C.length)!==0):null,R?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:()=>H}):H,w?Re("div",{class:`${e}-tabs-pad`}):null,w?null:Re("div",{ref:"barElRef",class:`${e}-tabs-bar`}))},N=S?"top":n;return Re("div",{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${t}-type`,`${e}-tabs--${i}-size`,R&&`${e}-tabs--flex`,`${e}-tabs--${N}`],style:this.cssVars},Re("div",{class:[`${e}-tabs-nav--${t}-type`,`${e}-tabs-nav--${N}`,`${e}-tabs-nav`]},Vs(v,H=>H&&Re("div",{class:`${e}-tabs-nav__prefix`},H)),S?Re("div",{class:`${e}-tabs-rail`,ref:"tabsRailElRef"},D?M.map((H,z)=>(s.value.push(H.props.name),Re(jI,Object.assign({},H.props,{internalCreatedByPane:!0,internalLeftPadded:z!==0}),H.children?{default:H.children.tab}:void 0))):C.map((H,z)=>(s.value.push(H.props.name),z===0?H:QA(H)))):Re(lg,{onResize:this.handleNavResize},{default:()=>Re("div",{class:`${e}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},["top","bottom"].includes(N)?Re(Dme,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:A}):Re("div",{class:`${e}-tabs-nav-y-scroll`,onScroll:this.handleScroll},A()))}),r&&o&&w?ZA(o,!0):null,Vs(_,H=>H&&Re("div",{class:`${e}-tabs-nav__suffix`},H))),D&&(this.animated&&(N==="top"||N==="bottom")?Re("div",{ref:"tabsPaneWrapperRef",style:f,class:[`${e}-tabs-pane-wrapper`,d]},XA(M,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):XA(M,this.mergedValue,this.renderedNames)))}});function XA(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(sO,{name:`${s}-transition`,onBeforeLeave:r,onEnter:o,onAfterEnter:i},{default:()=>u}):u}function ZA(e,t){return Re(jI,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:t,disabled:typeof e=="object"&&e.disabled})}function QA(e){const t=wa(e);return t.props?t.props.internalLeftPadded=!0:t.props={internalLeftPadded:!0},t}function lM(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes("internalLeftPadded")||e.dynamicProps.push("internalLeftPadded"):e.dynamicProps=["internalLeftPadded"],e}const BIe="2.34.4";function HIe({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:BIe,componentPrefix:e,install:o}}const q3="%[a-f0-9]{2}",eL=new RegExp("("+q3+")|([^%]+?)","gi"),tL=new RegExp("("+q3+")+","gi");function WI(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([],WI(n),WI(r))}function qIe(e){try{return decodeURIComponent(e)}catch{let t=e.match(eL)||[];for(let n=1;n<t.length;n++)e=WI(t,n).join(""),t=e.match(eL)||[];return e}}function VIe(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=tL.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const o=qIe(n[0]);o!==n[0]&&(t[n[0]]=o)}n=tL.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const o of r)e=e.replace(new RegExp(o,"g"),t[o]);return e}function zIe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return VIe(e)}}function V3(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}function jIe(e,t){const n={};if(Array.isArray(t))for(const r of t){const o=Object.getOwnPropertyDescriptor(e,r);o!=null&&o.enumerable&&Object.defineProperty(n,r,o)}else for(const r of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,r);if(o.enumerable){const i=e[r];t(r,i,e)&&Object.defineProperty(n,r,o)}}return n}const WIe=e=>e==null,KIe=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),KI=Symbol("encodeFragmentIdentifier");function YIe(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 JIe(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&&el(r,e).includes(e.arrayFormatSeparator);r=s?el(r,e):r;const u=i||s?r.split(e.arrayFormatSeparator).map(d=>el(d,e)):r===null?r:el(r,e);o[n]=u};case"bracket-separator":return(n,r,o)=>{const i=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!i){o[n]=r&&el(r,e);return}const s=r===null?[]:r.split(e.arrayFormatSeparator).map(u=>el(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 z3(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?KIe(e):encodeURIComponent(e):e}function el(e,t){return t.decode?zIe(e):e}function j3(e){return Array.isArray(e)?e.sort():typeof e=="object"?j3(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function W3(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function XIe(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function nL(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 fw(e){e=W3(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function pw(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},z3(t.arrayFormatSeparator);const n=JIe(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]=V3(i,"=");s===void 0&&(s=i),u=u===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?u:el(u,t),n(el(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]=nL(u,t);else r[o]=nL(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]=j3(s):o[i]=s,o},Object.create(null))}function K3(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},z3(t.arrayFormatSeparator);const n=s=>t.skipNull&&WIe(e[s])||t.skipEmptyString&&e[s]==="",r=YIe(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 Y3(e,t){var o;t={decode:!0,...t};let[n,r]=V3(e,"#");return n===void 0&&(n=e),{url:((o=n==null?void 0:n.split("?"))==null?void 0:o[0])??"",query:pw(fw(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:el(r,t)}:{}}}function J3(e,t){t={encode:!0,strict:!0,[KI]:!0,...t};const n=W3(e.url).split("?")[0]||"",r=fw(e.url),o={...pw(r,{sort:!1}),...e.query};let i=K3(o,t);i&&(i=`?${i}`);let s=XIe(e.url);if(e.fragmentIdentifier){const u=new URL(n);u.hash=e.fragmentIdentifier,s=t[KI]?u.hash:`#${e.fragmentIdentifier}`}return`${n}${i}${s}`}function X3(e,t,n){n={parseFragmentIdentifier:!0,[KI]:!1,...n};const{url:r,query:o,fragmentIdentifier:i}=Y3(e,n);return J3({url:r,query:jIe(o,t),fragmentIdentifier:i},n)}function ZIe(e,t,n){const r=Array.isArray(t)?o=>!t.includes(o):(o,i)=>!t(o,i);return X3(e,r,n)}const Z3=Object.freeze(Object.defineProperty({__proto__:null,exclude:ZIe,extract:fw,parse:pw,parseUrl:Y3,pick:X3,stringify:K3,stringifyUrl:J3},Symbol.toStringTag,{value:"Module"})),QIe=HIe({components:[aIe,$Ie,xIe,YMe,mMe,DIe,PIe,LIe,P3,G3]}),kg=Z3.parse(location.search),_0=Z3.parse(location.hash.split("?")[1]),eCe=kg.Authorization||_0.Authorization||"";sessionStorage.setItem("Authorization",eCe);sessionStorage.setItem("platform",kg.platform||_0.platform||"");console.log(!1,"false");const hw=kg.appId||_0.appId||1400805079,Q3=kg.secretKey||_0.secretKey||"c5f4ea6140128a36c842990446a2c89249ab886b5e1ea6893555aa635a0b3c30",Rh=kg.userID,gw=bI.init({SDKAppID:hw});gw.use(Rfe);gw.login({userID:Rh,userSig:u4({SDKAppID:hw,secretKey:Q3,userID:Rh}).userSig});q7(Fhe).use(QIe).use($he).use(gw).mount("#app");
|