vendor.07edc0c2.js 910 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  1. var mR=Object.defineProperty,vR=Object.defineProperties;var yR=Object.getOwnPropertyDescriptors;var Dg=Object.getOwnPropertySymbols;var _R=Object.prototype.hasOwnProperty,ER=Object.prototype.propertyIsEnumerable;var Ug=(e,t,n)=>t in e?mR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qe=(e,t)=>{for(var n in t||(t={}))_R.call(t,n)&&Ug(e,n,t[n]);if(Dg)for(var n of Dg(t))ER.call(t,n)&&Ug(e,n,t[n]);return e},St=(e,t)=>vR(e,yR(t));function lh(e,t){const n=Object.create(null),r=e.split(",");for(let i=0;i<r.length;i++)n[r[i]]=!0;return t?i=>!!n[i.toLowerCase()]:i=>!!n[i]}const CR="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",TR=lh(CR);function f_(e){return!!e||e===""}function Nt(e){if(Fe(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=lt(r)?bR(r):Nt(r);if(i)for(const o in i)t[o]=i[o]}return t}else{if(lt(e))return e;if(pt(e))return e}}const SR=/;(?![^(]*\))/g,RR=/:(.+)/;function bR(e){const t={};return e.split(SR).forEach(n=>{if(n){const r=n.split(RR);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ue(e){let t="";if(lt(e))t=e;else if(Fe(e))for(let n=0;n<e.length;n++){const r=ue(e[n]);r&&(t+=r+" ")}else if(pt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function IR(e){if(!e)return null;let{class:t,style:n}=e;return t&&!lt(t)&&(e.class=ue(t)),n&&(e.style=Nt(n)),e}function wR(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=es(e[r],t[r]);return n}function es(e,t){if(e===t)return!0;let n=$g(e),r=$g(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Fe(e),r=Fe(t),n||r)return n&&r?wR(e,t):!1;if(n=pt(e),r=pt(t),n||r){if(!n||!r)return!1;const i=Object.keys(e).length,o=Object.keys(t).length;if(i!==o)return!1;for(const s in e){const a=e.hasOwnProperty(s),u=t.hasOwnProperty(s);if(a&&!u||!a&&u||!es(e[s],t[s]))return!1}}return String(e)===String(t)}function h_(e,t){return e.findIndex(n=>es(n,t))}const Mt=e=>lt(e)?e:e==null?"":Fe(e)||pt(e)&&(e.toString===g_||!ze(e.toString))?JSON.stringify(e,p_,2):String(e),p_=(e,t)=>t&&t.__v_isRef?p_(e,t.value):qo(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i])=>(n[`${r} =>`]=i,n),{})}:Qu(t)?{[`Set(${t.size})`]:[...t.values()]}:pt(t)&&!Fe(t)&&!m_(t)?String(t):t,vt={},Ho=[],Ut=()=>{},OR=()=>!1,NR=/^on[^a-z]/,Ju=e=>NR.test(e),dh=e=>e.startsWith("onUpdate:"),tn=Object.assign,fh=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},AR=Object.prototype.hasOwnProperty,et=(e,t)=>AR.call(e,t),Fe=Array.isArray,qo=e=>Ka(e)==="[object Map]",Qu=e=>Ka(e)==="[object Set]",$g=e=>e instanceof Date,ze=e=>typeof e=="function",lt=e=>typeof e=="string",hh=e=>typeof e=="symbol",pt=e=>e!==null&&typeof e=="object",ph=e=>pt(e)&&ze(e.then)&&ze(e.catch),g_=Object.prototype.toString,Ka=e=>g_.call(e),PR=e=>Ka(e).slice(8,-1),m_=e=>Ka(e)==="[object Object]",gh=e=>lt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,zc=lh(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Xu=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},MR=/-(\w)/g,pr=Xu(e=>e.replace(MR,(t,n)=>n?n.toUpperCase():"")),LR=/\B([A-Z])/g,Mi=Xu(e=>e.replace(LR,"-$1").toLowerCase()),ur=Xu(e=>e.charAt(0).toUpperCase()+e.slice(1)),Bl=Xu(e=>e?`on${ur(e)}`:""),_a=(e,t)=>!Object.is(e,t),Yc=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},su=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},v_=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let xg;const kR=()=>xg||(xg=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let Wn;class DR{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&Wn&&(this.parent=Wn,this.index=(Wn.scopes||(Wn.scopes=[])).push(this)-1)}run(t){if(this.active)try{return Wn=this,t()}finally{Wn=this.parent}}on(){Wn=this}off(){Wn=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.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.active=!1}}}function UR(e,t=Wn){t&&t.active&&t.effects.push(e)}function $R(){return Wn}function y_(e){Wn&&Wn.cleanups.push(e)}const mh=e=>{const t=new Set(e);return t.w=0,t.n=0,t},__=e=>(e.w&Ni)>0,E_=e=>(e.n&Ni)>0,xR=({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=Ni},BR=e=>{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r<t.length;r++){const i=t[r];__(i)&&!E_(i)?i.delete(e):t[n++]=i,i.w&=~Ni,i.n&=~Ni}t.length=n}},kd=new WeakMap;let zs=0,Ni=1;const Dd=30;let Ir;const so=Symbol(""),Ud=Symbol("");class vh{constructor(t,n=null,r){this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,UR(this,r)}run(){if(!this.active)return this.fn();let t=Ir,n=bi;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Ir,Ir=this,bi=!0,Ni=1<<++zs,zs<=Dd?xR(this):Bg(this),this.fn()}finally{zs<=Dd&&BR(this),Ni=1<<--zs,Ir=this.parent,bi=n,this.parent=void 0}}stop(){this.active&&(Bg(this),this.onStop&&this.onStop(),this.active=!1)}}function Bg(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let bi=!0;const C_=[];function Eo(){C_.push(bi),bi=!1}function Co(){const e=C_.pop();bi=e===void 0?!0:e}function Fn(e,t,n){if(bi&&Ir){let r=kd.get(e);r||kd.set(e,r=new Map);let i=r.get(n);i||r.set(n,i=mh()),T_(i)}}function T_(e,t){let n=!1;zs<=Dd?E_(e)||(e.n|=Ni,n=!__(e)):n=!e.has(Ir),n&&(e.add(Ir),Ir.deps.push(e))}function Wr(e,t,n,r,i,o){const s=kd.get(e);if(!s)return;let a=[];if(t==="clear")a=[...s.values()];else if(n==="length"&&Fe(e))s.forEach((u,d)=>{(d==="length"||d>=r)&&a.push(u)});else switch(n!==void 0&&a.push(s.get(n)),t){case"add":Fe(e)?gh(n)&&a.push(s.get("length")):(a.push(s.get(so)),qo(e)&&a.push(s.get(Ud)));break;case"delete":Fe(e)||(a.push(s.get(so)),qo(e)&&a.push(s.get(Ud)));break;case"set":qo(e)&&a.push(s.get(so));break}if(a.length===1)a[0]&&$d(a[0]);else{const u=[];for(const d of a)d&&u.push(...d);$d(mh(u))}}function $d(e,t){for(const n of Fe(e)?e:[...e])(n!==Ir||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const FR=lh("__proto__,__v_isRef,__isVue"),S_=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(hh)),VR=yh(),jR=yh(!1,!0),HR=yh(!0),Fg=qR();function qR(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=at(this);for(let o=0,s=this.length;o<s;o++)Fn(r,"get",o+"");const i=r[t](...n);return i===-1||i===!1?r[t](...n.map(at)):i}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){Eo();const r=at(this)[t].apply(this,n);return Co(),r}}),e}function yh(e=!1,t=!1){return function(r,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_isShallow")return t;if(i==="__v_raw"&&o===(e?t?sb:O_:t?w_:I_).get(r))return r;const s=Fe(r);if(!e&&s&&et(Fg,i))return Reflect.get(Fg,i,o);const a=Reflect.get(r,i,o);return(hh(i)?S_.has(i):FR(i))||(e||Fn(r,"get",i),t)?a:wt(a)?!s||!gh(i)?a.value:a:pt(a)?e?Ga(a):Hn(a):a}}const KR=R_(),GR=R_(!0);function R_(e=!1){return function(n,r,i,o){let s=n[r];if(Ea(s)&&wt(s)&&!wt(i))return!1;if(!e&&!Ea(i)&&(N_(i)||(i=at(i),s=at(s)),!Fe(n)&&wt(s)&&!wt(i)))return s.value=i,!0;const a=Fe(n)&&gh(r)?Number(r)<n.length:et(n,r),u=Reflect.set(n,r,i,o);return n===at(o)&&(a?_a(i,s)&&Wr(n,"set",r,i):Wr(n,"add",r,i)),u}}function zR(e,t){const n=et(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&n&&Wr(e,"delete",t,void 0),r}function YR(e,t){const n=Reflect.has(e,t);return(!hh(t)||!S_.has(t))&&Fn(e,"has",t),n}function WR(e){return Fn(e,"iterate",Fe(e)?"length":so),Reflect.ownKeys(e)}const b_={get:VR,set:KR,deleteProperty:zR,has:YR,ownKeys:WR},JR={get:HR,set(e,t){return!0},deleteProperty(e,t){return!0}},QR=tn({},b_,{get:jR,set:GR}),_h=e=>e,Zu=e=>Reflect.getPrototypeOf(e);function yc(e,t,n=!1,r=!1){e=e.__v_raw;const i=at(e),o=at(t);t!==o&&!n&&Fn(i,"get",t),!n&&Fn(i,"get",o);const{has:s}=Zu(i),a=r?_h:n?Sh:Ca;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function _c(e,t=!1){const n=this.__v_raw,r=at(n),i=at(e);return e!==i&&!t&&Fn(r,"has",e),!t&&Fn(r,"has",i),e===i?n.has(e):n.has(e)||n.has(i)}function Ec(e,t=!1){return e=e.__v_raw,!t&&Fn(at(e),"iterate",so),Reflect.get(e,"size",e)}function Vg(e){e=at(e);const t=at(this);return Zu(t).has.call(t,e)||(t.add(e),Wr(t,"add",e,e)),this}function jg(e,t){t=at(t);const n=at(this),{has:r,get:i}=Zu(n);let o=r.call(n,e);o||(e=at(e),o=r.call(n,e));const s=i.call(n,e);return n.set(e,t),o?_a(t,s)&&Wr(n,"set",e,t):Wr(n,"add",e,t),this}function Hg(e){const t=at(this),{has:n,get:r}=Zu(t);let i=n.call(t,e);i||(e=at(e),i=n.call(t,e)),r&&r.call(t,e);const o=t.delete(e);return i&&Wr(t,"delete",e,void 0),o}function qg(){const e=at(this),t=e.size!==0,n=e.clear();return t&&Wr(e,"clear",void 0,void 0),n}function Cc(e,t){return function(r,i){const o=this,s=o.__v_raw,a=at(s),u=t?_h:e?Sh:Ca;return!e&&Fn(a,"iterate",so),s.forEach((d,f)=>r.call(i,u(d),u(f),o))}}function Tc(e,t,n){return function(...r){const i=this.__v_raw,o=at(i),s=qo(o),a=e==="entries"||e===Symbol.iterator&&s,u=e==="keys"&&s,d=i[e](...r),f=n?_h:t?Sh:Ca;return!t&&Fn(o,"iterate",u?Ud:so),{next(){const{value:c,done:l}=d.next();return l?{value:c,done:l}:{value:a?[f(c[0]),f(c[1])]:f(c),done:l}},[Symbol.iterator](){return this}}}}function ii(e){return function(...t){return e==="delete"?!1:this}}function XR(){const e={get(o){return yc(this,o)},get size(){return Ec(this)},has:_c,add:Vg,set:jg,delete:Hg,clear:qg,forEach:Cc(!1,!1)},t={get(o){return yc(this,o,!1,!0)},get size(){return Ec(this)},has:_c,add:Vg,set:jg,delete:Hg,clear:qg,forEach:Cc(!1,!0)},n={get(o){return yc(this,o,!0)},get size(){return Ec(this,!0)},has(o){return _c.call(this,o,!0)},add:ii("add"),set:ii("set"),delete:ii("delete"),clear:ii("clear"),forEach:Cc(!0,!1)},r={get(o){return yc(this,o,!0,!0)},get size(){return Ec(this,!0)},has(o){return _c.call(this,o,!0)},add:ii("add"),set:ii("set"),delete:ii("delete"),clear:ii("clear"),forEach:Cc(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=Tc(o,!1,!1),n[o]=Tc(o,!0,!1),t[o]=Tc(o,!1,!0),r[o]=Tc(o,!0,!0)}),[e,n,t,r]}const[ZR,eb,tb,nb]=XR();function Eh(e,t){const n=t?e?nb:tb:e?eb:ZR;return(r,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(et(n,i)&&i in r?n:r,i,o)}const rb={get:Eh(!1,!1)},ib={get:Eh(!1,!0)},ob={get:Eh(!0,!1)},I_=new WeakMap,w_=new WeakMap,O_=new WeakMap,sb=new WeakMap;function ab(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function cb(e){return e.__v_skip||!Object.isExtensible(e)?0:ab(PR(e))}function Hn(e){return Ea(e)?e:Ch(e,!1,b_,rb,I_)}function ub(e){return Ch(e,!1,QR,ib,w_)}function Ga(e){return Ch(e,!0,JR,ob,O_)}function Ch(e,t,n,r,i){if(!pt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=i.get(e);if(o)return o;const s=cb(e);if(s===0)return e;const a=new Proxy(e,s===2?r:n);return i.set(e,a),a}function Ko(e){return Ea(e)?Ko(e.__v_raw):!!(e&&e.__v_isReactive)}function Ea(e){return!!(e&&e.__v_isReadonly)}function N_(e){return!!(e&&e.__v_isShallow)}function A_(e){return Ko(e)||Ea(e)}function at(e){const t=e&&e.__v_raw;return t?at(t):e}function Th(e){return su(e,"__v_skip",!0),e}const Ca=e=>pt(e)?Hn(e):e,Sh=e=>pt(e)?Ga(e):e;function P_(e){bi&&Ir&&(e=at(e),T_(e.dep||(e.dep=mh())))}function M_(e,t){e=at(e),e.dep&&$d(e.dep)}function wt(e){return!!(e&&e.__v_isRef===!0)}function re(e){return L_(e,!1)}function Rh(e){return L_(e,!0)}function L_(e,t){return wt(e)?e:new lb(e,t)}class lb{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:at(t),this._value=n?t:Ca(t)}get value(){return P_(this),this._value}set value(t){t=this.__v_isShallow?t:at(t),_a(t,this._rawValue)&&(this._rawValue=t,this._value=this.__v_isShallow?t:Ca(t),M_(this))}}function he(e){return wt(e)?e.value:e}const db={get:(e,t,n)=>he(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return wt(i)&&!wt(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function k_(e){return Ko(e)?e:new Proxy(e,db)}function gs(e){const t=Fe(e)?new Array(e.length):{};for(const n in e)t[n]=xn(e,n);return t}class fb{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}}function xn(e,t,n){const r=e[t];return wt(r)?r:new fb(e,t,n)}class hb{constructor(t,n,r,i){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new vh(t,()=>{this._dirty||(this._dirty=!0,M_(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}get value(){const t=at(this);return P_(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function pb(e,t,n=!1){let r,i;const o=ze(e);return o?(r=e,i=Ut):(r=e.get,i=e.set),new hb(r,i,o||!i,n)}Promise.resolve();const Zs=[];function gb(e,...t){Eo();const n=Zs.length?Zs[Zs.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=mb();if(r)Gr(r,n,11,[e+t.join(""),n&&n.proxy,i.map(({vnode:o})=>`at <${v0(n,o.type)}>`).join(`
  2. `),i]);else{const o=[`[Vue warn]: ${e}`,...t];i.length&&o.push(`
  3. `,...vb(i)),console.warn(...o)}Co()}function mb(){let e=Zs[Zs.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}function vb(e){const t=[];return e.forEach((n,r)=>{t.push(...r===0?[]:[`
  4. `],...yb(n))}),t}function yb({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=e.component?e.component.parent==null:!1,i=` at <${v0(e.component,e.type,r)}`,o=">"+n;return e.props?[i,..._b(e.props),o]:[i+o]}function _b(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(r=>{t.push(...D_(r,e[r]))}),n.length>3&&t.push(" ..."),t}function D_(e,t,n){return lt(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:wt(t)?(t=D_(e,at(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):ze(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=at(t),n?t:[`${e}=`,t])}function Gr(e,t,n,r){let i;try{i=r?e(...r):e()}catch(o){el(o,t,n)}return i}function er(e,t,n,r){if(ze(e)){const o=Gr(e,t,n,r);return o&&ph(o)&&o.catch(s=>{el(s,t,n)}),o}const i=[];for(let o=0;o<e.length;o++)i.push(er(e[o],t,n,r));return i}function el(e,t,n,r=!0){const i=t?t.vnode:null;if(t){let o=t.parent;const s=t.proxy,a=n;for(;o;){const d=o.ec;if(d){for(let f=0;f<d.length;f++)if(d[f](e,s,a)===!1)return}o=o.parent}const u=t.appContext.config.errorHandler;if(u){Gr(u,null,10,[e,s,a]);return}}Eb(e,n,i,r)}function Eb(e,t,n,r=!0){console.error(e)}let au=!1,xd=!1;const kn=[];let Hr=0;const ea=[];let Ys=null,ko=0;const ta=[];let ui=null,Do=0;const U_=Promise.resolve();let bh=null,Bd=null;function yt(e){const t=bh||U_;return e?t.then(this?e.bind(this):e):t}function Cb(e){let t=Hr+1,n=kn.length;for(;t<n;){const r=t+n>>>1;Ta(kn[r])<e?t=r+1:n=r}return t}function $_(e){(!kn.length||!kn.includes(e,au&&e.allowRecurse?Hr+1:Hr))&&e!==Bd&&(e.id==null?kn.push(e):kn.splice(Cb(e.id),0,e),x_())}function x_(){!au&&!xd&&(xd=!0,bh=U_.then(V_))}function Tb(e){const t=kn.indexOf(e);t>Hr&&kn.splice(t,1)}function B_(e,t,n,r){Fe(e)?n.push(...e):(!t||!t.includes(e,e.allowRecurse?r+1:r))&&n.push(e),x_()}function Sb(e){B_(e,Ys,ea,ko)}function Rb(e){B_(e,ui,ta,Do)}function Ih(e,t=null){if(ea.length){for(Bd=t,Ys=[...new Set(ea)],ea.length=0,ko=0;ko<Ys.length;ko++)Ys[ko]();Ys=null,ko=0,Bd=null,Ih(e,t)}}function F_(e){if(ta.length){const t=[...new Set(ta)];if(ta.length=0,ui){ui.push(...t);return}for(ui=t,ui.sort((n,r)=>Ta(n)-Ta(r)),Do=0;Do<ui.length;Do++)ui[Do]();ui=null,Do=0}}const Ta=e=>e.id==null?1/0:e.id;function V_(e){xd=!1,au=!0,Ih(e),kn.sort((n,r)=>Ta(n)-Ta(r));const t=Ut;try{for(Hr=0;Hr<kn.length;Hr++){const n=kn[Hr];n&&n.active!==!1&&Gr(n,null,14)}}finally{Hr=0,kn.length=0,F_(),au=!1,bh=null,(kn.length||ea.length||ta.length)&&V_(e)}}function bb(e,t,...n){const r=e.vnode.props||vt;let i=n;const o=t.startsWith("update:"),s=o&&t.slice(7);if(s&&s in r){const f=`${s==="modelValue"?"model":s}Modifiers`,{number:c,trim:l}=r[f]||vt;l?i=n.map(h=>h.trim()):c&&(i=n.map(v_))}let a,u=r[a=Bl(t)]||r[a=Bl(pr(t))];!u&&o&&(u=r[a=Bl(Mi(t))]),u&&er(u,e,6,i);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,er(d,e,6,i)}}function j_(e,t,n=!1){const r=t.emitsCache,i=r.get(e);if(i!==void 0)return i;const o=e.emits;let s={},a=!1;if(!ze(e)){const u=d=>{const f=j_(d,t,!0);f&&(a=!0,tn(s,f))};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!o&&!a?(r.set(e,null),null):(Fe(o)?o.forEach(u=>s[u]=null):tn(s,o),r.set(e,s),s)}function wh(e,t){return!e||!Ju(t)?!1:(t=t.slice(2).replace(/Once$/,""),et(e,t[0].toLowerCase()+t.slice(1))||et(e,Mi(t))||et(e,t))}let Dn=null,H_=null;function cu(e){const t=Dn;return Dn=e,H_=e&&e.type.__scopeId||null,t}function Le(e,t=Dn,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&nm(-1);const o=cu(t),s=e(...i);return cu(o),r._d&&nm(1),s};return r._n=!0,r._c=!0,r._d=!0,r}function Fl(e){const{type:t,vnode:n,proxy:r,withProxy:i,props:o,propsOptions:[s],slots:a,attrs:u,emit:d,render:f,renderCache:c,data:l,setupState:h,ctx:p,inheritAttrs:m}=e;let v,_;const y=cu(e);try{if(n.shapeFlag&4){const S=i||r;v=Sr(f.call(S,S,c,o,h,l,p)),_=u}else{const S=t;v=Sr(S.length>1?S(o,{attrs:u,slots:a,emit:d}):S(o,null)),_=t.props?u:Ib(u)}}catch(S){ra.length=0,el(S,e,1),v=Be(nr)}let E=v;if(_&&m!==!1){const S=Object.keys(_),{shapeFlag:T}=E;S.length&&T&7&&(s&&S.some(dh)&&(_=wb(_,s)),E=po(E,_))}return n.dirs&&(E.dirs=E.dirs?E.dirs.concat(n.dirs):n.dirs),n.transition&&(E.transition=n.transition),v=E,cu(y),v}const Ib=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ju(n))&&((t||(t={}))[n]=e[n]);return t},wb=(e,t)=>{const n={};for(const r in e)(!dh(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ob(e,t,n){const{props:r,children:i,component:o}=e,{props:s,children:a,patchFlag:u}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return r?Kg(r,s,d):!!s;if(u&8){const f=t.dynamicProps;for(let c=0;c<f.length;c++){const l=f[c];if(s[l]!==r[l]&&!wh(d,l))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===s?!1:r?s?Kg(r,s,d):!0:!!s;return!1}function Kg(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const o=r[i];if(t[o]!==e[o]&&!wh(n,o))return!0}return!1}function Nb({vnode:e,parent:t},n){for(;t&&t.subTree===e;)(e=t.vnode).el=n,t=t.parent}const Ab=e=>e.__isSuspense;function Pb(e,t){t&&t.pendingBranch?Fe(e)?t.effects.push(...e):t.effects.push(e):Rb(e)}function Ot(e,t){if(Wt){let n=Wt.provides;const r=Wt.parent&&Wt.parent.provides;r===n&&(n=Wt.provides=Object.create(r)),n[e]=t}}function He(e,t,n=!1){const r=Wt||Dn;if(r){const i=r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides;if(i&&e in i)return i[e];if(arguments.length>1)return n&&ze(t)?t.call(r.proxy):t}}function q_(e,t){return Oh(e,null,t)}const Gg={};function je(e,t,n){return Oh(e,t,n)}function Oh(e,t,{immediate:n,deep:r,flush:i,onTrack:o,onTrigger:s}=vt){const a=Wt;let u,d=!1,f=!1;if(wt(e)?(u=()=>e.value,d=N_(e)):Ko(e)?(u=()=>e,r=!0):Fe(e)?(f=!0,d=e.some(Ko),u=()=>e.map(_=>{if(wt(_))return _.value;if(Ko(_))return Zi(_);if(ze(_))return Gr(_,a,2)})):ze(e)?t?u=()=>Gr(e,a,2):u=()=>{if(!(a&&a.isUnmounted))return c&&c(),er(e,a,3,[l])}:u=Ut,t&&r){const _=u;u=()=>Zi(_())}let c,l=_=>{c=v.onStop=()=>{Gr(_,a,4)}};if(Sa)return l=Ut,t?n&&er(t,a,3,[u(),f?[]:void 0,l]):u(),Ut;let h=f?[]:Gg;const p=()=>{if(!!v.active)if(t){const _=v.run();(r||d||(f?_.some((y,E)=>_a(y,h[E])):_a(_,h)))&&(c&&c(),er(t,a,3,[_,h===Gg?void 0:h,l]),h=_)}else v.run()};p.allowRecurse=!!t;let m;i==="sync"?m=p:i==="post"?m=()=>Tn(p,a&&a.suspense):m=()=>{!a||a.isMounted?Sb(p):p()};const v=new vh(u,m);return t?n?p():h=v.run():i==="post"?Tn(v.run.bind(v),a&&a.suspense):v.run(),()=>{v.stop(),a&&a.scope&&fh(a.scope.effects,v)}}function Mb(e,t,n){const r=this.proxy,i=lt(e)?e.includes(".")?K_(r,e):()=>r[e]:e.bind(r,r);let o;ze(t)?o=t:(o=t.handler,n=t);const s=Wt;ts(this);const a=Oh(i,o.bind(r),n);return s?ts(s):co(),a}function K_(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}function Zi(e,t){if(!pt(e)||e.__v_skip||(t=t||new Set,t.has(e)))return e;if(t.add(e),wt(e))Zi(e.value,t);else if(Fe(e))for(let n=0;n<e.length;n++)Zi(e[n],t);else if(Qu(e)||qo(e))e.forEach(n=>{Zi(n,t)});else if(m_(e))for(const n in e)Zi(e[n],t);return e}function Lb(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return $t(()=>{e.isMounted=!0}),or(()=>{e.isUnmounting=!0}),e}const zn=[Function,Array],kb={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:zn,onEnter:zn,onAfterEnter:zn,onEnterCancelled:zn,onBeforeLeave:zn,onLeave:zn,onAfterLeave:zn,onLeaveCancelled:zn,onBeforeAppear:zn,onAppear:zn,onAfterAppear:zn,onAppearCancelled:zn},setup(e,{slots:t}){const n=cn(),r=Lb();let i;return()=>{const o=t.default&&Y_(t.default(),!0);if(!o||!o.length)return;const s=at(e),{mode:a}=s,u=o[0];if(r.isLeaving)return Vl(u);const d=zg(u);if(!d)return Vl(u);const f=Fd(d,s,r,n);Vd(d,f);const c=n.subTree,l=c&&zg(c);let h=!1;const{getTransitionKey:p}=d.type;if(p){const m=p();i===void 0?i=m:m!==i&&(i=m,h=!0)}if(l&&l.type!==nr&&(!zi(d,l)||h)){const m=Fd(l,s,r,n);if(Vd(l,m),a==="out-in")return r.isLeaving=!0,m.afterLeave=()=>{r.isLeaving=!1,n.update()},Vl(u);a==="in-out"&&d.type!==nr&&(m.delayLeave=(v,_,y)=>{const E=z_(r,l);E[String(l.key)]=l,v._leaveCb=()=>{_(),v._leaveCb=void 0,delete f.delayedLeave},f.delayedLeave=y})}return u}}},G_=kb;function z_(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 Fd(e,t,n,r){const{appear:i,mode:o,persisted:s=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:d,onEnterCancelled:f,onBeforeLeave:c,onLeave:l,onAfterLeave:h,onLeaveCancelled:p,onBeforeAppear:m,onAppear:v,onAfterAppear:_,onAppearCancelled:y}=t,E=String(e.key),S=z_(n,e),T=(C,w)=>{C&&er(C,r,9,w)},R={mode:o,persisted:s,beforeEnter(C){let w=a;if(!n.isMounted)if(i)w=m||a;else return;C._leaveCb&&C._leaveCb(!0);const L=S[E];L&&zi(e,L)&&L.el._leaveCb&&L.el._leaveCb(),T(w,[C])},enter(C){let w=u,L=d,V=f;if(!n.isMounted)if(i)w=v||u,L=_||d,V=y||f;else return;let b=!1;const I=C._enterCb=N=>{b||(b=!0,N?T(V,[C]):T(L,[C]),R.delayedLeave&&R.delayedLeave(),C._enterCb=void 0)};w?(w(C,I),w.length<=1&&I()):I()},leave(C,w){const L=String(e.key);if(C._enterCb&&C._enterCb(!0),n.isUnmounting)return w();T(c,[C]);let V=!1;const b=C._leaveCb=I=>{V||(V=!0,w(),I?T(p,[C]):T(h,[C]),C._leaveCb=void 0,S[L]===e&&delete S[L])};S[L]=e,l?(l(C,b),l.length<=1&&b()):b()},clone(C){return Fd(C,t,n,r)}};return R}function Vl(e){if(tl(e))return e=po(e),e.children=null,e}function zg(e){return tl(e)?e.children?e.children[0]:void 0:e}function Vd(e,t){e.shapeFlag&6&&e.component?Vd(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 Y_(e,t=!1){let n=[],r=0;for(let i=0;i<e.length;i++){const o=e[i];o.type===It?(o.patchFlag&128&&r++,n=n.concat(Y_(o.children,t))):(t||o.type!==nr)&&n.push(o)}if(r>1)for(let i=0;i<n.length;i++)n[i].patchFlag=-2;return n}function Oe(e){return ze(e)?{setup:e,name:e.name}:e}const jd=e=>!!e.type.__asyncLoader,tl=e=>e.type.__isKeepAlive;function Db(e,t){W_(e,"a",t)}function Ub(e,t){W_(e,"da",t)}function W_(e,t,n=Wt){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(nl(t,r,n),n){let i=n.parent;for(;i&&i.parent;)tl(i.parent.vnode)&&$b(r,t,n,i),i=i.parent}}function $b(e,t,n,r){const i=nl(t,e,r,!0);Q_(()=>{fh(r[t],i)},n)}function nl(e,t,n=Wt,r=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{if(n.isUnmounted)return;Eo(),ts(n);const a=er(t,n,e,s);return co(),Co(),a});return r?i.unshift(o):i.push(o),o}}const ei=e=>(t,n=Wt)=>(!Sa||e==="sp")&&nl(e,t,n),J_=ei("bm"),$t=ei("m"),xb=ei("bu"),za=ei("u"),or=ei("bum"),Q_=ei("um"),Bb=ei("sp"),Fb=ei("rtg"),Vb=ei("rtc");function jb(e,t=Wt){nl("ec",e,t)}let Hd=!0;function Hb(e){const t=Z_(e),n=e.proxy,r=e.ctx;Hd=!1,t.beforeCreate&&Yg(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:s,watch:a,provide:u,inject:d,created:f,beforeMount:c,mounted:l,beforeUpdate:h,updated:p,activated:m,deactivated:v,beforeDestroy:_,beforeUnmount:y,destroyed:E,unmounted:S,render:T,renderTracked:R,renderTriggered:C,errorCaptured:w,serverPrefetch:L,expose:V,inheritAttrs:b,components:I,directives:N,filters:A}=t;if(d&&qb(d,r,null,e.appContext.config.unwrapInjectedRef),s)for(const x in s){const q=s[x];ze(q)&&(r[x]=q.bind(n))}if(i){const x=i.call(n,n);pt(x)&&(e.data=Hn(x))}if(Hd=!0,o)for(const x in o){const q=o[x],Z=ze(q)?q.bind(n,n):ze(q.get)?q.get.bind(n,n):Ut,le=!ze(q)&&ze(q.set)?q.set.bind(n):Ut,Te=ne({get:Z,set:le});Object.defineProperty(r,x,{enumerable:!0,configurable:!0,get:()=>Te.value,set:Ee=>Te.value=Ee})}if(a)for(const x in a)X_(a[x],r,n,x);if(u){const x=ze(u)?u.call(n):u;Reflect.ownKeys(x).forEach(q=>{Ot(q,x[q])})}f&&Yg(f,e,"c");function $(x,q){Fe(q)?q.forEach(Z=>x(Z.bind(n))):q&&x(q.bind(n))}if($(J_,c),$($t,l),$(xb,h),$(za,p),$(Db,m),$(Ub,v),$(jb,w),$(Vb,R),$(Fb,C),$(or,y),$(Q_,S),$(Bb,L),Fe(V))if(V.length){const x=e.exposed||(e.exposed={});V.forEach(q=>{Object.defineProperty(x,q,{get:()=>n[q],set:Z=>n[q]=Z})})}else e.exposed||(e.exposed={});T&&e.render===Ut&&(e.render=T),b!=null&&(e.inheritAttrs=b),I&&(e.components=I),N&&(e.directives=N)}function qb(e,t,n=Ut,r=!1){Fe(e)&&(e=qd(e));for(const i in e){const o=e[i];let s;pt(o)?"default"in o?s=He(o.from||i,o.default,!0):s=He(o.from||i):s=He(o),wt(s)&&r?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:a=>s.value=a}):t[i]=s}}function Yg(e,t,n){er(Fe(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function X_(e,t,n,r){const i=r.includes(".")?K_(n,r):()=>n[r];if(lt(e)){const o=t[e];ze(o)&&je(i,o)}else if(ze(e))je(i,e.bind(n));else if(pt(e))if(Fe(e))e.forEach(o=>X_(o,t,n,r));else{const o=ze(e.handler)?e.handler.bind(n):t[e.handler];ze(o)&&je(i,o,e)}}function Z_(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,a=o.get(t);let u;return a?u=a:!i.length&&!n&&!r?u=t:(u={},i.length&&i.forEach(d=>uu(u,d,s,!0)),uu(u,t,s)),o.set(t,u),u}function uu(e,t,n,r=!1){const{mixins:i,extends:o}=t;o&&uu(e,o,n,!0),i&&i.forEach(s=>uu(e,s,n,!0));for(const s in t)if(!(r&&s==="expose")){const a=Kb[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const Kb={data:Wg,props:qi,emits:qi,methods:qi,computed:qi,beforeCreate:hn,created:hn,beforeMount:hn,mounted:hn,beforeUpdate:hn,updated:hn,beforeDestroy:hn,beforeUnmount:hn,destroyed:hn,unmounted:hn,activated:hn,deactivated:hn,errorCaptured:hn,serverPrefetch:hn,components:qi,directives:qi,watch:zb,provide:Wg,inject:Gb};function Wg(e,t){return t?e?function(){return tn(ze(e)?e.call(this,this):e,ze(t)?t.call(this,this):t)}:t:e}function Gb(e,t){return qi(qd(e),qd(t))}function qd(e){if(Fe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function hn(e,t){return e?[...new Set([].concat(e,t))]:t}function qi(e,t){return e?tn(tn(Object.create(null),e),t):t}function zb(e,t){if(!e)return t;if(!t)return e;const n=tn(Object.create(null),e);for(const r in t)n[r]=hn(e[r],t[r]);return n}function Yb(e,t,n,r=!1){const i={},o={};su(o,rl,1),e.propsDefaults=Object.create(null),e0(e,t,i,o);for(const s in e.propsOptions[0])s in i||(i[s]=void 0);n?e.props=r?i:ub(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function Wb(e,t,n,r){const{props:i,attrs:o,vnode:{patchFlag:s}}=e,a=at(i),[u]=e.propsOptions;let d=!1;if((r||s>0)&&!(s&16)){if(s&8){const f=e.vnode.dynamicProps;for(let c=0;c<f.length;c++){let l=f[c];const h=t[l];if(u)if(et(o,l))h!==o[l]&&(o[l]=h,d=!0);else{const p=pr(l);i[p]=Kd(u,a,p,h,e,!1)}else h!==o[l]&&(o[l]=h,d=!0)}}}else{e0(e,t,i,o)&&(d=!0);let f;for(const c in a)(!t||!et(t,c)&&((f=Mi(c))===c||!et(t,f)))&&(u?n&&(n[c]!==void 0||n[f]!==void 0)&&(i[c]=Kd(u,a,c,void 0,e,!0)):delete i[c]);if(o!==a)for(const c in o)(!t||!et(t,c)&&!0)&&(delete o[c],d=!0)}d&&Wr(e,"set","$attrs")}function e0(e,t,n,r){const[i,o]=e.propsOptions;let s=!1,a;if(t)for(let u in t){if(zc(u))continue;const d=t[u];let f;i&&et(i,f=pr(u))?!o||!o.includes(f)?n[f]=d:(a||(a={}))[f]=d:wh(e.emitsOptions,u)||(!(u in r)||d!==r[u])&&(r[u]=d,s=!0)}if(o){const u=at(n),d=a||vt;for(let f=0;f<o.length;f++){const c=o[f];n[c]=Kd(i,u,c,d[c],e,!et(d,c))}}return s}function Kd(e,t,n,r,i,o){const s=e[n];if(s!=null){const a=et(s,"default");if(a&&r===void 0){const u=s.default;if(s.type!==Function&&ze(u)){const{propsDefaults:d}=i;n in d?r=d[n]:(ts(i),r=d[n]=u.call(null,t),co())}else r=u}s[0]&&(o&&!a?r=!1:s[1]&&(r===""||r===Mi(n))&&(r=!0))}return r}function t0(e,t,n=!1){const r=t.propsCache,i=r.get(e);if(i)return i;const o=e.props,s={},a=[];let u=!1;if(!ze(e)){const f=c=>{u=!0;const[l,h]=t0(c,t,!0);tn(s,l),h&&a.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!o&&!u)return r.set(e,Ho),Ho;if(Fe(o))for(let f=0;f<o.length;f++){const c=pr(o[f]);Jg(c)&&(s[c]=vt)}else if(o)for(const f in o){const c=pr(f);if(Jg(c)){const l=o[f],h=s[c]=Fe(l)||ze(l)?{type:l}:l;if(h){const p=Zg(Boolean,h.type),m=Zg(String,h.type);h[0]=p>-1,h[1]=m<0||p<m,(p>-1||et(h,"default"))&&a.push(c)}}}const d=[s,a];return r.set(e,d),d}function Jg(e){return e[0]!=="$"}function Qg(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:e===null?"null":""}function Xg(e,t){return Qg(e)===Qg(t)}function Zg(e,t){return Fe(t)?t.findIndex(n=>Xg(n,e)):ze(t)&&Xg(t,e)?0:-1}const n0=e=>e[0]==="_"||e==="$stable",Nh=e=>Fe(e)?e.map(Sr):[Sr(e)],Jb=(e,t,n)=>{const r=Le((...i)=>Nh(t(...i)),n);return r._c=!1,r},r0=(e,t,n)=>{const r=e._ctx;for(const i in e){if(n0(i))continue;const o=e[i];if(ze(o))t[i]=Jb(i,o,r);else if(o!=null){const s=Nh(o);t[i]=()=>s}}},i0=(e,t)=>{const n=Nh(t);e.slots.default=()=>n},Qb=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=at(t),su(t,"_",n)):r0(t,e.slots={})}else e.slots={},t&&i0(e,t);su(e.slots,rl,1)},Xb=(e,t,n)=>{const{vnode:r,slots:i}=e;let o=!0,s=vt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:(tn(i,t),!n&&a===1&&delete i._):(o=!t.$stable,r0(t,i)),s=t}else t&&(i0(e,t),s={default:1});if(o)for(const a in i)!n0(a)&&!(a in s)&&delete i[a]};function Dt(e,t){const n=Dn;if(n===null)return e;const r=n.proxy,i=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,a,u,d=vt]=t[o];ze(s)&&(s={mounted:s,updated:s}),s.deep&&Zi(a),i.push({dir:s,instance:r,value:a,oldValue:void 0,arg:u,modifiers:d})}return e}function xi(e,t,n,r){const i=e.dirs,o=t&&t.dirs;for(let s=0;s<i.length;s++){const a=i[s];o&&(a.oldValue=o[s].value);let u=a.dir[r];u&&(Eo(),er(u,n,8,[e.el,a,e,t]),Co())}}function o0(){return{app:null,config:{isNativeTag:OR,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 Zb=0;function eI(e,t){return function(r,i=null){i!=null&&!pt(i)&&(i=null);const o=o0(),s=new Set;let a=!1;const u=o.app={_uid:Zb++,_component:r,_props:i,_container:null,_context:o,_instance:null,version:SI,get config(){return o.config},set config(d){},use(d,...f){return s.has(d)||(d&&ze(d.install)?(s.add(d),d.install(u,...f)):ze(d)&&(s.add(d),d(u,...f))),u},mixin(d){return o.mixins.includes(d)||o.mixins.push(d),u},component(d,f){return f?(o.components[d]=f,u):o.components[d]},directive(d,f){return f?(o.directives[d]=f,u):o.directives[d]},mount(d,f,c){if(!a){const l=Be(r,i);return l.appContext=o,f&&t?t(l,d):e(l,d,c),a=!0,u._container=d,d.__vue_app__=u,kh(l.component)||l.component.proxy}},unmount(){a&&(e(null,u._container),delete u._container.__vue_app__)},provide(d,f){return o.provides[d]=f,u}};return u}}function Gd(e,t,n,r,i=!1){if(Fe(e)){e.forEach((l,h)=>Gd(l,t&&(Fe(t)?t[h]:t),n,r,i));return}if(jd(r)&&!i)return;const o=r.shapeFlag&4?kh(r.component)||r.component.proxy:r.el,s=i?null:o,{i:a,r:u}=e,d=t&&t.r,f=a.refs===vt?a.refs={}:a.refs,c=a.setupState;if(d!=null&&d!==u&&(lt(d)?(f[d]=null,et(c,d)&&(c[d]=null)):wt(d)&&(d.value=null)),ze(u))Gr(u,a,12,[s,f]);else{const l=lt(u),h=wt(u);if(l||h){const p=()=>{if(e.f){const m=l?f[u]:u.value;i?Fe(m)&&fh(m,o):Fe(m)?m.includes(o)||m.push(o):l?f[u]=[o]:(u.value=[o],e.k&&(f[e.k]=u.value))}else l?(f[u]=s,et(c,u)&&(c[u]=s)):wt(u)&&(u.value=s,e.k&&(f[e.k]=s))};s?(p.id=-1,Tn(p,n)):p()}}}const Tn=Pb;function tI(e){return nI(e)}function nI(e,t){const n=kR();n.__VUE__=!0;const{insert:r,remove:i,patchProp:o,createElement:s,createText:a,createComment:u,setText:d,setElementText:f,parentNode:c,nextSibling:l,setScopeId:h=Ut,cloneNode:p,insertStaticContent:m}=e,v=(k,j,H,W=null,te=null,ce=null,_e=!1,ae=null,ge=!!j.dynamicChildren)=>{if(k===j)return;k&&!zi(k,j)&&(W=K(k),ve(k,te,ce,!0),k=null),j.patchFlag===-2&&(ge=!1,j.dynamicChildren=null);const{type:se,ref:Ne,shapeFlag:Re}=j;switch(se){case Ya:_(k,j,H,W);break;case nr:y(k,j,H,W);break;case jl:k==null&&E(j,H,W,_e);break;case It:N(k,j,H,W,te,ce,_e,ae,ge);break;default:Re&1?R(k,j,H,W,te,ce,_e,ae,ge):Re&6?A(k,j,H,W,te,ce,_e,ae,ge):(Re&64||Re&128)&&se.process(k,j,H,W,te,ce,_e,ae,ge,be)}Ne!=null&&te&&Gd(Ne,k&&k.ref,ce,j||k,!j)},_=(k,j,H,W)=>{if(k==null)r(j.el=a(j.children),H,W);else{const te=j.el=k.el;j.children!==k.children&&d(te,j.children)}},y=(k,j,H,W)=>{k==null?r(j.el=u(j.children||""),H,W):j.el=k.el},E=(k,j,H,W)=>{[k.el,k.anchor]=m(k.children,j,H,W,k.el,k.anchor)},S=({el:k,anchor:j},H,W)=>{let te;for(;k&&k!==j;)te=l(k),r(k,H,W),k=te;r(j,H,W)},T=({el:k,anchor:j})=>{let H;for(;k&&k!==j;)H=l(k),i(k),k=H;i(j)},R=(k,j,H,W,te,ce,_e,ae,ge)=>{_e=_e||j.type==="svg",k==null?C(j,H,W,te,ce,_e,ae,ge):V(k,j,te,ce,_e,ae,ge)},C=(k,j,H,W,te,ce,_e,ae)=>{let ge,se;const{type:Ne,props:Re,shapeFlag:Ae,transition:xe,patchFlag:Xe,dirs:oe}=k;if(k.el&&p!==void 0&&Xe===-1)ge=k.el=p(k.el);else{if(ge=k.el=s(k.type,ce,Re&&Re.is,Re),Ae&8?f(ge,k.children):Ae&16&&L(k.children,ge,null,W,te,ce&&Ne!=="foreignObject",_e,ae),oe&&xi(k,null,W,"created"),Re){for(const We in Re)We!=="value"&&!zc(We)&&o(ge,We,null,Re[We],ce,k.children,W,te,G);"value"in Re&&o(ge,"value",null,Re.value),(se=Re.onVnodeBeforeMount)&&Cr(se,W,k)}w(ge,k,k.scopeId,_e,W)}oe&&xi(k,null,W,"beforeMount");const Me=(!te||te&&!te.pendingBranch)&&xe&&!xe.persisted;Me&&xe.beforeEnter(ge),r(ge,j,H),((se=Re&&Re.onVnodeMounted)||Me||oe)&&Tn(()=>{se&&Cr(se,W,k),Me&&xe.enter(ge),oe&&xi(k,null,W,"mounted")},te)},w=(k,j,H,W,te)=>{if(H&&h(k,H),W)for(let ce=0;ce<W.length;ce++)h(k,W[ce]);if(te){let ce=te.subTree;if(j===ce){const _e=te.vnode;w(k,_e,_e.scopeId,_e.slotScopeIds,te.parent)}}},L=(k,j,H,W,te,ce,_e,ae,ge=0)=>{for(let se=ge;se<k.length;se++){const Ne=k[se]=ae?li(k[se]):Sr(k[se]);v(null,Ne,j,H,W,te,ce,_e,ae)}},V=(k,j,H,W,te,ce,_e)=>{const ae=j.el=k.el;let{patchFlag:ge,dynamicChildren:se,dirs:Ne}=j;ge|=k.patchFlag&16;const Re=k.props||vt,Ae=j.props||vt;let xe;H&&Bi(H,!1),(xe=Ae.onVnodeBeforeUpdate)&&Cr(xe,H,j,k),Ne&&xi(j,k,H,"beforeUpdate"),H&&Bi(H,!0);const Xe=te&&j.type!=="foreignObject";if(se?b(k.dynamicChildren,se,ae,H,W,Xe,ce):_e||Z(k,j,ae,null,H,W,Xe,ce,!1),ge>0){if(ge&16)I(ae,j,Re,Ae,H,W,te);else if(ge&2&&Re.class!==Ae.class&&o(ae,"class",null,Ae.class,te),ge&4&&o(ae,"style",Re.style,Ae.style,te),ge&8){const oe=j.dynamicProps;for(let Me=0;Me<oe.length;Me++){const We=oe[Me],qt=Re[We],Lr=Ae[We];(Lr!==qt||We==="value")&&o(ae,We,qt,Lr,te,k.children,H,W,G)}}ge&1&&k.children!==j.children&&f(ae,j.children)}else!_e&&se==null&&I(ae,j,Re,Ae,H,W,te);((xe=Ae.onVnodeUpdated)||Ne)&&Tn(()=>{xe&&Cr(xe,H,j,k),Ne&&xi(j,k,H,"updated")},W)},b=(k,j,H,W,te,ce,_e)=>{for(let ae=0;ae<j.length;ae++){const ge=k[ae],se=j[ae],Ne=ge.el&&(ge.type===It||!zi(ge,se)||ge.shapeFlag&70)?c(ge.el):H;v(ge,se,Ne,null,W,te,ce,_e,!0)}},I=(k,j,H,W,te,ce,_e)=>{if(H!==W){for(const ae in W){if(zc(ae))continue;const ge=W[ae],se=H[ae];ge!==se&&ae!=="value"&&o(k,ae,se,ge,_e,j.children,te,ce,G)}if(H!==vt)for(const ae in H)!zc(ae)&&!(ae in W)&&o(k,ae,H[ae],null,_e,j.children,te,ce,G);"value"in W&&o(k,"value",H.value,W.value)}},N=(k,j,H,W,te,ce,_e,ae,ge)=>{const se=j.el=k?k.el:a(""),Ne=j.anchor=k?k.anchor:a("");let{patchFlag:Re,dynamicChildren:Ae,slotScopeIds:xe}=j;xe&&(ae=ae?ae.concat(xe):xe),k==null?(r(se,H,W),r(Ne,H,W),L(j.children,H,Ne,te,ce,_e,ae,ge)):Re>0&&Re&64&&Ae&&k.dynamicChildren?(b(k.dynamicChildren,Ae,H,te,ce,_e,ae),(j.key!=null||te&&j===te.subTree)&&Ah(k,j,!0)):Z(k,j,H,Ne,te,ce,_e,ae,ge)},A=(k,j,H,W,te,ce,_e,ae,ge)=>{j.slotScopeIds=ae,k==null?j.shapeFlag&512?te.ctx.activate(j,H,W,_e,ge):M(j,H,W,te,ce,_e,ge):$(k,j,ge)},M=(k,j,H,W,te,ce,_e)=>{const ae=k.component=pI(k,W,te);if(tl(k)&&(ae.ctx.renderer=be),gI(ae),ae.asyncDep){if(te&&te.registerDep(ae,x),!k.el){const ge=ae.subTree=Be(nr);y(null,ge,j,H)}return}x(ae,k,j,H,te,ce,_e)},$=(k,j,H)=>{const W=j.component=k.component;if(Ob(k,j,H))if(W.asyncDep&&!W.asyncResolved){q(W,j,H);return}else W.next=j,Tb(W.update),W.update();else j.component=k.component,j.el=k.el,W.vnode=j},x=(k,j,H,W,te,ce,_e)=>{const ae=()=>{if(k.isMounted){let{next:Ne,bu:Re,u:Ae,parent:xe,vnode:Xe}=k,oe=Ne,Me;Bi(k,!1),Ne?(Ne.el=Xe.el,q(k,Ne,_e)):Ne=Xe,Re&&Yc(Re),(Me=Ne.props&&Ne.props.onVnodeBeforeUpdate)&&Cr(Me,xe,Ne,Xe),Bi(k,!0);const We=Fl(k),qt=k.subTree;k.subTree=We,v(qt,We,c(qt.el),K(qt),k,te,ce),Ne.el=We.el,oe===null&&Nb(k,We.el),Ae&&Tn(Ae,te),(Me=Ne.props&&Ne.props.onVnodeUpdated)&&Tn(()=>Cr(Me,xe,Ne,Xe),te)}else{let Ne;const{el:Re,props:Ae}=j,{bm:xe,m:Xe,parent:oe}=k,Me=jd(j);if(Bi(k,!1),xe&&Yc(xe),!Me&&(Ne=Ae&&Ae.onVnodeBeforeMount)&&Cr(Ne,oe,j),Bi(k,!0),Re&&we){const We=()=>{k.subTree=Fl(k),we(Re,k.subTree,k,te,null)};Me?j.type.__asyncLoader().then(()=>!k.isUnmounted&&We()):We()}else{const We=k.subTree=Fl(k);v(null,We,H,W,k,te,ce),j.el=We.el}if(Xe&&Tn(Xe,te),!Me&&(Ne=Ae&&Ae.onVnodeMounted)){const We=j;Tn(()=>Cr(Ne,oe,We),te)}j.shapeFlag&256&&k.a&&Tn(k.a,te),k.isMounted=!0,j=H=W=null}},ge=k.effect=new vh(ae,()=>$_(k.update),k.scope),se=k.update=ge.run.bind(ge);se.id=k.uid,Bi(k,!0),se()},q=(k,j,H)=>{j.component=k;const W=k.vnode.props;k.vnode=j,k.next=null,Wb(k,j.props,W,H),Xb(k,j.children,H),Eo(),Ih(void 0,k.update),Co()},Z=(k,j,H,W,te,ce,_e,ae,ge=!1)=>{const se=k&&k.children,Ne=k?k.shapeFlag:0,Re=j.children,{patchFlag:Ae,shapeFlag:xe}=j;if(Ae>0){if(Ae&128){Te(se,Re,H,W,te,ce,_e,ae,ge);return}else if(Ae&256){le(se,Re,H,W,te,ce,_e,ae,ge);return}}xe&8?(Ne&16&&G(se,te,ce),Re!==se&&f(H,Re)):Ne&16?xe&16?Te(se,Re,H,W,te,ce,_e,ae,ge):G(se,te,ce,!0):(Ne&8&&f(H,""),xe&16&&L(Re,H,W,te,ce,_e,ae,ge))},le=(k,j,H,W,te,ce,_e,ae,ge)=>{k=k||Ho,j=j||Ho;const se=k.length,Ne=j.length,Re=Math.min(se,Ne);let Ae;for(Ae=0;Ae<Re;Ae++){const xe=j[Ae]=ge?li(j[Ae]):Sr(j[Ae]);v(k[Ae],xe,H,null,te,ce,_e,ae,ge)}se>Ne?G(k,te,ce,!0,!1,Re):L(j,H,W,te,ce,_e,ae,ge,Re)},Te=(k,j,H,W,te,ce,_e,ae,ge)=>{let se=0;const Ne=j.length;let Re=k.length-1,Ae=Ne-1;for(;se<=Re&&se<=Ae;){const xe=k[se],Xe=j[se]=ge?li(j[se]):Sr(j[se]);if(zi(xe,Xe))v(xe,Xe,H,null,te,ce,_e,ae,ge);else break;se++}for(;se<=Re&&se<=Ae;){const xe=k[Re],Xe=j[Ae]=ge?li(j[Ae]):Sr(j[Ae]);if(zi(xe,Xe))v(xe,Xe,H,null,te,ce,_e,ae,ge);else break;Re--,Ae--}if(se>Re){if(se<=Ae){const xe=Ae+1,Xe=xe<Ne?j[xe].el:W;for(;se<=Ae;)v(null,j[se]=ge?li(j[se]):Sr(j[se]),H,Xe,te,ce,_e,ae,ge),se++}}else if(se>Ae)for(;se<=Re;)ve(k[se],te,ce,!0),se++;else{const xe=se,Xe=se,oe=new Map;for(se=Xe;se<=Ae;se++){const dn=j[se]=ge?li(j[se]):Sr(j[se]);dn.key!=null&&oe.set(dn.key,se)}let Me,We=0;const qt=Ae-Xe+1;let Lr=!1,Is=0;const ln=new Array(qt);for(se=0;se<qt;se++)ln[se]=0;for(se=xe;se<=Re;se++){const dn=k[se];if(We>=qt){ve(dn,te,ce,!0);continue}let Nn;if(dn.key!=null)Nn=oe.get(dn.key);else for(Me=Xe;Me<=Ae;Me++)if(ln[Me-Xe]===0&&zi(dn,j[Me])){Nn=Me;break}Nn===void 0?ve(dn,te,ce,!0):(ln[Nn-Xe]=se+1,Nn>=Is?Is=Nn:Lr=!0,v(dn,j[Nn],H,null,te,ce,_e,ae,ge),We++)}const kr=Lr?rI(ln):Ho;for(Me=kr.length-1,se=qt-1;se>=0;se--){const dn=Xe+se,Nn=j[dn],ws=dn+1<Ne?j[dn+1].el:W;ln[se]===0?v(null,Nn,H,ws,te,ce,_e,ae,ge):Lr&&(Me<0||se!==kr[Me]?Ee(Nn,H,ws,2):Me--)}}},Ee=(k,j,H,W,te=null)=>{const{el:ce,type:_e,transition:ae,children:ge,shapeFlag:se}=k;if(se&6){Ee(k.component.subTree,j,H,W);return}if(se&128){k.suspense.move(j,H,W);return}if(se&64){_e.move(k,j,H,be);return}if(_e===It){r(ce,j,H);for(let Re=0;Re<ge.length;Re++)Ee(ge[Re],j,H,W);r(k.anchor,j,H);return}if(_e===jl){S(k,j,H);return}if(W!==2&&se&1&&ae)if(W===0)ae.beforeEnter(ce),r(ce,j,H),Tn(()=>ae.enter(ce),te);else{const{leave:Re,delayLeave:Ae,afterLeave:xe}=ae,Xe=()=>r(ce,j,H),oe=()=>{Re(ce,()=>{Xe(),xe&&xe()})};Ae?Ae(ce,Xe,oe):oe()}else r(ce,j,H)},ve=(k,j,H,W=!1,te=!1)=>{const{type:ce,props:_e,ref:ae,children:ge,dynamicChildren:se,shapeFlag:Ne,patchFlag:Re,dirs:Ae}=k;if(ae!=null&&Gd(ae,null,H,k,!0),Ne&256){j.ctx.deactivate(k);return}const xe=Ne&1&&Ae,Xe=!jd(k);let oe;if(Xe&&(oe=_e&&_e.onVnodeBeforeUnmount)&&Cr(oe,j,k),Ne&6)z(k.component,H,W);else{if(Ne&128){k.suspense.unmount(H,W);return}xe&&xi(k,null,j,"beforeUnmount"),Ne&64?k.type.remove(k,j,H,te,be,W):se&&(ce!==It||Re>0&&Re&64)?G(se,j,H,!1,!0):(ce===It&&Re&384||!te&&Ne&16)&&G(ge,j,H),W&&Se(k)}(Xe&&(oe=_e&&_e.onVnodeUnmounted)||xe)&&Tn(()=>{oe&&Cr(oe,j,k),xe&&xi(k,null,j,"unmounted")},H)},Se=k=>{const{type:j,el:H,anchor:W,transition:te}=k;if(j===It){P(H,W);return}if(j===jl){T(k);return}const ce=()=>{i(H),te&&!te.persisted&&te.afterLeave&&te.afterLeave()};if(k.shapeFlag&1&&te&&!te.persisted){const{leave:_e,delayLeave:ae}=te,ge=()=>_e(H,ce);ae?ae(k.el,ce,ge):ge()}else ce()},P=(k,j)=>{let H;for(;k!==j;)H=l(k),i(k),k=H;i(j)},z=(k,j,H)=>{const{bum:W,scope:te,update:ce,subTree:_e,um:ae}=k;W&&Yc(W),te.stop(),ce&&(ce.active=!1,ve(_e,k,j,H)),ae&&Tn(ae,j),Tn(()=>{k.isUnmounted=!0},j),j&&j.pendingBranch&&!j.isUnmounted&&k.asyncDep&&!k.asyncResolved&&k.suspenseId===j.pendingId&&(j.deps--,j.deps===0&&j.resolve())},G=(k,j,H,W=!1,te=!1,ce=0)=>{for(let _e=ce;_e<k.length;_e++)ve(k[_e],j,H,W,te)},K=k=>k.shapeFlag&6?K(k.component.subTree):k.shapeFlag&128?k.suspense.next():l(k.anchor||k.el),pe=(k,j,H)=>{k==null?j._vnode&&ve(j._vnode,null,null,!0):v(j._vnode||null,k,j,null,null,null,H),F_(),j._vnode=k},be={p:v,um:ve,m:Ee,r:Se,mt:M,mc:L,pc:Z,pbc:b,n:K,o:e};let Ie,we;return t&&([Ie,we]=t(be)),{render:pe,hydrate:Ie,createApp:eI(pe,Ie)}}function Bi({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Ah(e,t,n=!1){const r=e.children,i=t.children;if(Fe(r)&&Fe(i))for(let o=0;o<r.length;o++){const s=r[o];let a=i[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[o]=li(i[o]),a.el=s.el),n||Ah(s,a))}}function rI(e){const t=e.slice(),n=[0];let r,i,o,s,a;const u=e.length;for(r=0;r<u;r++){const d=e[r];if(d!==0){if(i=n[n.length-1],e[i]<d){t[r]=i,n.push(r);continue}for(o=0,s=n.length-1;o<s;)a=o+s>>1,e[n[a]]<d?o=a+1:s=a;d<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,s=n[o-1];o-- >0;)n[o]=s,s=t[s];return n}const iI=e=>e.__isTeleport,na=e=>e&&(e.disabled||e.disabled===""),em=e=>typeof SVGElement!="undefined"&&e instanceof SVGElement,zd=(e,t)=>{const n=e&&e.to;return lt(n)?t?t(n):null:n},oI={__isTeleport:!0,process(e,t,n,r,i,o,s,a,u,d){const{mc:f,pc:c,pbc:l,o:{insert:h,querySelector:p,createText:m,createComment:v}}=d,_=na(t.props);let{shapeFlag:y,children:E,dynamicChildren:S}=t;if(e==null){const T=t.el=m(""),R=t.anchor=m("");h(T,n,r),h(R,n,r);const C=t.target=zd(t.props,p),w=t.targetAnchor=m("");C&&(h(w,C),s=s||em(C));const L=(V,b)=>{y&16&&f(E,V,b,i,o,s,a,u)};_?L(n,R):C&&L(C,w)}else{t.el=e.el;const T=t.anchor=e.anchor,R=t.target=e.target,C=t.targetAnchor=e.targetAnchor,w=na(e.props),L=w?n:R,V=w?T:C;if(s=s||em(R),S?(l(e.dynamicChildren,S,L,i,o,s,a),Ah(e,t,!0)):u||c(e,t,L,V,i,o,s,a,!1),_)w||Sc(t,n,T,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const b=t.target=zd(t.props,p);b&&Sc(t,b,null,d,0)}else w&&Sc(t,R,C,d,1)}},remove(e,t,n,r,{um:i,o:{remove:o}},s){const{shapeFlag:a,children:u,anchor:d,targetAnchor:f,target:c,props:l}=e;if(c&&o(f),(s||!na(l))&&(o(d),a&16))for(let h=0;h<u.length;h++){const p=u[h];i(p,t,n,!0,!!p.dynamicChildren)}},move:Sc,hydrate:sI};function Sc(e,t,n,{o:{insert:r},m:i},o=2){o===0&&r(e.targetAnchor,t,n);const{el:s,anchor:a,shapeFlag:u,children:d,props:f}=e,c=o===2;if(c&&r(s,t,n),(!c||na(f))&&u&16)for(let l=0;l<d.length;l++)i(d[l],t,n,2);c&&r(a,t,n)}function sI(e,t,n,r,i,o,{o:{nextSibling:s,parentNode:a,querySelector:u}},d){const f=t.target=zd(t.props,u);if(f){const c=f._lpa||f.firstChild;t.shapeFlag&16&&(na(t.props)?(t.anchor=d(s(e),t,a(e),n,r,i,o),t.targetAnchor=c):(t.anchor=s(e),t.targetAnchor=d(c,t,f,n,r,i,o)),f._lpa=t.targetAnchor&&s(t.targetAnchor))}return t.anchor&&s(t.anchor)}const s0=oI,Ph="components",aI="directives";function Je(e,t){return Mh(Ph,e,!0,t)||e}const a0=Symbol();function dr(e){return lt(e)?Mh(Ph,e,!1)||e:e||a0}function c0(e){return Mh(aI,e)}function Mh(e,t,n=!0,r=!1){const i=Dn||Wt;if(i){const o=i.type;if(e===Ph){const a=m0(o);if(a&&(a===t||a===pr(t)||a===ur(pr(t))))return o}const s=tm(i[e]||o[e],t)||tm(i.appContext[e],t);return!s&&r?o:s}}function tm(e,t){return e&&(e[t]||e[pr(t)]||e[ur(pr(t))])}const It=Symbol(void 0),Ya=Symbol(void 0),nr=Symbol(void 0),jl=Symbol(void 0),ra=[];let ao=null;function ee(e=!1){ra.push(ao=e?null:[])}function cI(){ra.pop(),ao=ra[ra.length-1]||null}let lu=1;function nm(e){lu+=e}function u0(e){return e.dynamicChildren=lu>0?ao||Ho:null,cI(),lu>0&&ao&&ao.push(e),e}function Ce(e,t,n,r,i,o){return u0(ye(e,t,n,r,i,o,!0))}function Ge(e,t,n,r,i){return u0(Be(e,t,n,r,i,!0))}function Un(e){return e?e.__v_isVNode===!0:!1}function zi(e,t){return e.type===t.type&&e.key===t.key}const rl="__vInternal",l0=({key:e})=>e!=null?e:null,Wc=({ref:e,ref_key:t,ref_for:n})=>e!=null?lt(e)||wt(e)||ze(e)?{i:Dn,r:e,k:t,f:!!n}:e:null;function ye(e,t=null,n=null,r=0,i=null,o=e===It?0:1,s=!1,a=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&l0(t),ref:t&&Wc(t),scopeId:H_,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:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null};return a?(Lh(u,n),o&128&&e.normalize(u)):n&&(u.shapeFlag|=lt(n)?8:16),lu>0&&!s&&ao&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&ao.push(u),u}const Be=uI;function uI(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===a0)&&(e=nr),Un(e)){const a=po(e,t,!0);return n&&Lh(a,n),a}if(EI(e)&&(e=e.__vccOpts),t){t=d0(t);let{class:a,style:u}=t;a&&!lt(a)&&(t.class=ue(a)),pt(u)&&(A_(u)&&!Fe(u)&&(u=tn({},u)),t.style=Nt(u))}const s=lt(e)?1:Ab(e)?128:iI(e)?64:pt(e)?4:ze(e)?2:0;return ye(e,t,n,r,i,s,o,!0)}function d0(e){return e?A_(e)||rl in e?tn({},e):e:null}function po(e,t,n=!1){const{props:r,ref:i,patchFlag:o,children:s}=e,a=t?Ar(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:a,key:a&&l0(a),ref:t&&t.ref?n&&i?Fe(i)?i.concat(Wc(t)):[i,Wc(t)]:Wc(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==It?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&po(e.ssContent),ssFallback:e.ssFallback&&po(e.ssFallback),el:e.el,anchor:e.anchor}}function Jr(e=" ",t=0){return Be(Ya,null,e,t)}function Ve(e="",t=!1){return t?(ee(),Ge(nr,null,e)):Be(nr,null,e)}function Sr(e){return e==null||typeof e=="boolean"?Be(nr):Fe(e)?Be(It,null,e.slice()):typeof e=="object"?li(e):Be(Ya,null,String(e))}function li(e){return e.el===null||e.memo?e:po(e)}function Lh(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Fe(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Lh(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!(rl in t)?t._ctx=Dn:i===3&&Dn&&(Dn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ze(t)?(t={default:t,_ctx:Dn},n=32):(t=String(t),r&64?(n=16,t=[Jr(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ar(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=ue([t.class,r.class]));else if(i==="style")t.style=Nt([t.style,r.style]);else if(Ju(i)){const o=t[i],s=r[i];s&&o!==s&&!(Fe(o)&&o.includes(s))&&(t[i]=o?[].concat(o,s):s)}else i!==""&&(t[i]=r[i])}return t}function Cr(e,t,n,r=null){er(e,t,7,[n,r])}function lI(e,t){for(let n=0;n<t.length;n++){const r=t[n];if(Fe(r))for(let i=0;i<r.length;i++)e[r[i].name]=r[i].fn;else r&&(e[r.name]=r.fn)}return e}function ke(e,t,n={},r,i){if(Dn.isCE)return Be("slot",t==="default"?null:{name:t},r&&r());let o=e[t];o&&o._c&&(o._d=!1),ee();const s=o&&f0(o(n)),a=Ge(It,{key:n.key||`_${t}`},s||(r?r():[]),s&&e._===1?64:-2);return!i&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),o&&o._c&&(o._d=!0),a}function f0(e){return e.some(t=>Un(t)?!(t.type===nr||t.type===It&&!f0(t.children)):!0)?e:null}const Yd=e=>e?h0(e)?kh(e)||e.proxy:Yd(e.parent):null,du=tn(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=>Yd(e.parent),$root:e=>Yd(e.root),$emit:e=>e.emit,$options:e=>Z_(e),$forceUpdate:e=>()=>$_(e.update),$nextTick:e=>yt.bind(e.proxy),$watch:e=>Mb.bind(e)}),dI={get({_:e},t){const{ctx:n,setupState:r,data:i,props:o,accessCache:s,type:a,appContext:u}=e;let d;if(t[0]!=="$"){const h=s[t];if(h!==void 0)switch(h){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return o[t]}else{if(r!==vt&&et(r,t))return s[t]=1,r[t];if(i!==vt&&et(i,t))return s[t]=2,i[t];if((d=e.propsOptions[0])&&et(d,t))return s[t]=3,o[t];if(n!==vt&&et(n,t))return s[t]=4,n[t];Hd&&(s[t]=0)}}const f=du[t];let c,l;if(f)return t==="$attrs"&&Fn(e,"get",t),f(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==vt&&et(n,t))return s[t]=4,n[t];if(l=u.config.globalProperties,et(l,t))return l[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:o}=e;return i!==vt&&et(i,t)?(i[t]=n,!0):r!==vt&&et(r,t)?(r[t]=n,!0):et(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:o}},s){let a;return!!n[s]||e!==vt&&et(e,s)||t!==vt&&et(t,s)||(a=o[0])&&et(a,s)||et(r,s)||et(du,s)||et(i.config.globalProperties,s)},defineProperty(e,t,n){return n.get!=null?this.set(e,t,n.get(),null):n.value!=null&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},fI=o0();let hI=0;function pI(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||fI,o={uid:hI++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new DR(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:t0(r,i),emitsOptions:j_(r,i),emit:null,emitted:null,propsDefaults:vt,inheritAttrs:r.inheritAttrs,ctx:vt,data:vt,props:vt,attrs:vt,slots:vt,refs:vt,setupState:vt,setupContext: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 o.ctx={_:o},o.root=t?t.root:o,o.emit=bb.bind(null,o),e.ce&&e.ce(o),o}let Wt=null;const cn=()=>Wt||Dn,ts=e=>{Wt=e,e.scope.on()},co=()=>{Wt&&Wt.scope.off(),Wt=null};function h0(e){return e.vnode.shapeFlag&4}let Sa=!1;function gI(e,t=!1){Sa=t;const{props:n,children:r}=e.vnode,i=h0(e);Yb(e,n,i,t),Qb(e,r);const o=i?mI(e,t):void 0;return Sa=!1,o}function mI(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Th(new Proxy(e.ctx,dI));const{setup:r}=n;if(r){const i=e.setupContext=r.length>1?g0(e):null;ts(e),Eo();const o=Gr(r,e,0,[e.props,i]);if(Co(),co(),ph(o)){if(o.then(co,co),t)return o.then(s=>{rm(e,s,t)}).catch(s=>{el(s,e,0)});e.asyncDep=o}else rm(e,o,t)}else p0(e,t)}function rm(e,t,n){ze(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:pt(t)&&(e.setupState=k_(t)),p0(e,n)}let im;function p0(e,t,n){const r=e.type;if(!e.render){if(!t&&im&&!r.render){const i=r.template;if(i){const{isCustomElement:o,compilerOptions:s}=e.appContext.config,{delimiters:a,compilerOptions:u}=r,d=tn(tn({isCustomElement:o,delimiters:a},s),u);r.render=im(i,d)}}e.render=r.render||Ut}ts(e),Eo(),Hb(e),Co(),co()}function vI(e){return new Proxy(e.attrs,{get(t,n){return Fn(e,"get","$attrs"),t[n]}})}function g0(e){const t=r=>{e.exposed=r||{}};let n;return{get attrs(){return n||(n=vI(e))},slots:e.slots,emit:e.emit,expose:t}}function kh(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(k_(Th(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in du)return du[n](e)}}))}const yI=/(?:^|[-_])(\w)/g,_I=e=>e.replace(yI,t=>t.toUpperCase()).replace(/[-_]/g,"");function m0(e){return ze(e)&&e.displayName||e.name}function v0(e,t,n=!1){let r=m0(t);if(!r&&t.__file){const i=t.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&e&&e.parent){const i=o=>{for(const s in o)if(o[s]===t)return s};r=i(e.components||e.parent.type.components)||i(e.appContext.components)}return r?_I(r):n?"App":"Anonymous"}function EI(e){return ze(e)&&"__vccOpts"in e}const ne=(e,t)=>pb(e,t,Sa);function CI(){return TI().slots}function TI(){const e=cn();return e.setupContext||(e.setupContext=g0(e))}function ot(e,t,n){const r=arguments.length;return r===2?pt(t)&&!Fe(t)?Un(t)?Be(e,null,[t]):Be(e,t):Be(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Un(n)&&(n=[n]),Be(e,t,n))}const SI="3.2.31",RI="http://www.w3.org/2000/svg",Yi=typeof document!="undefined"?document:null,om=Yi&&Yi.createElement("template"),bI={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 i=t?Yi.createElementNS(RI,e):Yi.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>Yi.createTextNode(e),createComment:e=>Yi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Yi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,r,i,o){const s=n?n.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===o||!(i=i.nextSibling)););else{om.innerHTML=r?`<svg>${e}</svg>`:e;const a=om.content;if(r){const u=a.firstChild;for(;u.firstChild;)a.appendChild(u.firstChild);a.removeChild(u)}t.insertBefore(a,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function II(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 wI(e,t,n){const r=e.style,i=lt(n);if(n&&!i){for(const o in n)Wd(r,o,n[o]);if(t&&!lt(t))for(const o in t)n[o]==null&&Wd(r,o,"")}else{const o=r.display;i?t!==n&&(r.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(r.display=o)}}const sm=/\s*!important$/;function Wd(e,t,n){if(Fe(n))n.forEach(r=>Wd(e,t,r));else if(t.startsWith("--"))e.setProperty(t,n);else{const r=OI(e,t);sm.test(n)?e.setProperty(Mi(r),n.replace(sm,""),"important"):e[r]=n}}const am=["Webkit","Moz","ms"],Hl={};function OI(e,t){const n=Hl[t];if(n)return n;let r=pr(t);if(r!=="filter"&&r in e)return Hl[t]=r;r=ur(r);for(let i=0;i<am.length;i++){const o=am[i]+r;if(o in e)return Hl[t]=o}return t}const cm="http://www.w3.org/1999/xlink";function NI(e,t,n,r,i){if(r&&t.startsWith("xlink:"))n==null?e.removeAttributeNS(cm,t.slice(6,t.length)):e.setAttributeNS(cm,t,n);else{const o=TR(t);n==null||o&&!f_(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}function AI(e,t,n,r,i,o,s){if(t==="innerHTML"||t==="textContent"){r&&s(r,i,o),e[t]=n==null?"":n;return}if(t==="value"&&e.tagName!=="PROGRESS"&&!e.tagName.includes("-")){e._value=n;const a=n==null?"":n;(e.value!==a||e.tagName==="OPTION")&&(e.value=a),n==null&&e.removeAttribute(t);return}if(n===""||n==null){const a=typeof e[t];if(a==="boolean"){e[t]=f_(n);return}else if(n==null&&a==="string"){e[t]="",e.removeAttribute(t);return}else if(a==="number"){try{e[t]=0}catch{}e.removeAttribute(t);return}}try{e[t]=n}catch{}}let fu=Date.now,y0=!1;if(typeof window!="undefined"){fu()>document.createEvent("Event").timeStamp&&(fu=()=>performance.now());const e=navigator.userAgent.match(/firefox\/(\d+)/i);y0=!!(e&&Number(e[1])<=53)}let Jd=0;const PI=Promise.resolve(),MI=()=>{Jd=0},LI=()=>Jd||(PI.then(MI),Jd=fu());function Dh(e,t,n,r){e.addEventListener(t,n,r)}function kI(e,t,n,r){e.removeEventListener(t,n,r)}function DI(e,t,n,r,i=null){const o=e._vei||(e._vei={}),s=o[t];if(r&&s)s.value=r;else{const[a,u]=UI(t);if(r){const d=o[t]=$I(r,i);Dh(e,a,d,u)}else s&&(kI(e,a,s,u),o[t]=void 0)}}const um=/(?:Once|Passive|Capture)$/;function UI(e){let t;if(um.test(e)){t={};let n;for(;n=e.match(um);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[Mi(e.slice(2)),t]}function $I(e,t){const n=r=>{const i=r.timeStamp||fu();(y0||i>=n.attached-1)&&er(xI(r,n.value),t,5,[r])};return n.value=e,n.attached=LI(),n}function xI(e,t){if(Fe(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>i=>!i._stopped&&r&&r(i))}else return t}const lm=/^on[a-z]/,BI=(e,t,n,r,i=!1,o,s,a,u)=>{t==="class"?II(e,r,i):t==="style"?wI(e,n,r):Ju(t)?dh(t)||DI(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):FI(e,t,r,i))?AI(e,t,r,o,s,a,u):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),NI(e,t,r,i))};function FI(e,t,n,r){return r?!!(t==="innerHTML"||t==="textContent"||t in e&&lm.test(t)&&ze(n)):t==="spellcheck"||t==="draggable"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||lm.test(t)&&lt(n)?!1:t in e}const oi="transition",As="animation",_r=(e,{slots:t})=>ot(G_,VI(e),t);_r.displayName="Transition";const _0={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};_r.props=tn({},G_.props,_0);const Fi=(e,t=[])=>{Fe(e)?e.forEach(n=>n(...t)):e&&e(...t)},dm=e=>e?Fe(e)?e.some(t=>t.length>1):e.length>1:!1;function VI(e){const t={};for(const I in e)I in _0||(t[I]=e[I]);if(e.css===!1)return t;const{name:n="v",type:r,duration:i,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:u=o,appearActiveClass:d=s,appearToClass:f=a,leaveFromClass:c=`${n}-leave-from`,leaveActiveClass:l=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=jI(i),m=p&&p[0],v=p&&p[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:E,onLeave:S,onLeaveCancelled:T,onBeforeAppear:R=_,onAppear:C=y,onAppearCancelled:w=E}=t,L=(I,N,A)=>{Io(I,N?f:a),Io(I,N?d:s),A&&A()},V=(I,N)=>{Io(I,h),Io(I,l),N&&N()},b=I=>(N,A)=>{const M=I?C:y,$=()=>L(N,I,A);Fi(M,[N,$]),fm(()=>{Io(N,I?u:o),si(N,I?f:a),dm(M)||hm(N,r,m,$)})};return tn(t,{onBeforeEnter(I){Fi(_,[I]),si(I,o),si(I,s)},onBeforeAppear(I){Fi(R,[I]),si(I,u),si(I,d)},onEnter:b(!1),onAppear:b(!0),onLeave(I,N){const A=()=>V(I,N);si(I,c),KI(),si(I,l),fm(()=>{Io(I,c),si(I,h),dm(S)||hm(I,r,v,A)}),Fi(S,[I,A])},onEnterCancelled(I){L(I,!1),Fi(E,[I])},onAppearCancelled(I){L(I,!0),Fi(w,[I])},onLeaveCancelled(I){V(I),Fi(T,[I])}})}function jI(e){if(e==null)return null;if(pt(e))return[ql(e.enter),ql(e.leave)];{const t=ql(e);return[t,t]}}function ql(e){return v_(e)}function si(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function Io(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 fm(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let HI=0;function hm(e,t,n,r){const i=e._endId=++HI,o=()=>{i===e._endId&&r()};if(n)return setTimeout(o,n);const{type:s,timeout:a,propCount:u}=qI(e,t);if(!s)return r();const d=s+"end";let f=0;const c=()=>{e.removeEventListener(d,l),o()},l=h=>{h.target===e&&++f>=u&&c()};setTimeout(()=>{f<u&&c()},a+1),e.addEventListener(d,l)}function qI(e,t){const n=window.getComputedStyle(e),r=p=>(n[p]||"").split(", "),i=r(oi+"Delay"),o=r(oi+"Duration"),s=pm(i,o),a=r(As+"Delay"),u=r(As+"Duration"),d=pm(a,u);let f=null,c=0,l=0;t===oi?s>0&&(f=oi,c=s,l=o.length):t===As?d>0&&(f=As,c=d,l=u.length):(c=Math.max(s,d),f=c>0?s>d?oi:As:null,l=f?f===oi?o.length:u.length:0);const h=f===oi&&/\b(transform|all)(,|$)/.test(n[oi+"Property"]);return{type:f,timeout:c,propCount:l,hasTransform:h}}function pm(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>gm(n)+gm(e[r])))}function gm(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function KI(){return document.body.offsetHeight}const hu=e=>{const t=e.props["onUpdate:modelValue"];return Fe(t)?n=>Yc(t,n):t},pu={deep:!0,created(e,t,n){e._assign=hu(n),Dh(e,"change",()=>{const r=e._modelValue,i=C0(e),o=e.checked,s=e._assign;if(Fe(r)){const a=h_(r,i),u=a!==-1;if(o&&!u)s(r.concat(i));else if(!o&&u){const d=[...r];d.splice(a,1),s(d)}}else if(Qu(r)){const a=new Set(r);o?a.add(i):a.delete(i),s(a)}else s(T0(e,o))})},mounted:mm,beforeUpdate(e,t,n){e._assign=hu(n),mm(e,t,n)}};function mm(e,{value:t,oldValue:n},r){e._modelValue=t,Fe(t)?e.checked=h_(t,r.props.value)>-1:Qu(t)?e.checked=t.has(r.props.value):t!==n&&(e.checked=es(t,T0(e,!0)))}const E0={created(e,{value:t},n){e.checked=es(t,n.props.value),e._assign=hu(n),Dh(e,"change",()=>{e._assign(C0(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e._assign=hu(r),t!==n&&(e.checked=es(t,r.props.value))}};function C0(e){return"_value"in e?e._value:e.value}function T0(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const GI=["ctrl","shift","alt","meta"],zI={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)=>GI.some(n=>e[`${n}Key`]&&!t.includes(n))},Xn=(e,t)=>(n,...r)=>{for(let i=0;i<t.length;i++){const o=zI[t[i]];if(o&&o(n,t))return}return e(n,...r)},YI={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Bo=(e,t)=>n=>{if(!("key"in n))return;const r=Mi(n.key);if(t.some(i=>i===r||YI[i]===r))return e(n)},fr={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Ps(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),Ps(e,!0),r.enter(e)):r.leave(e,()=>{Ps(e,!1)}):Ps(e,t))},beforeUnmount(e,{value:t}){Ps(e,t)}};function Ps(e,t){e.style.display=t?e._vod:"none"}const WI=tn({patchProp:BI},bI);let vm;function S0(){return vm||(vm=tI(WI))}const gu=(...e)=>{S0().render(...e)},JI=(...e)=>{const t=S0().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=QI(r);if(!i)return;const o=t._component;!ze(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.innerHTML="";const s=n(i,!1,i instanceof SVGElement);return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t};function QI(e){return lt(e)?document.querySelector(e):e}var XI=typeof global=="object"&&global&&global.Object===Object&&global,ZI=XI,e1=typeof self=="object"&&self&&self.Object===Object&&self,t1=ZI||e1||Function("return this")(),Uh=t1,n1=Uh.Symbol,ns=n1,R0=Object.prototype,r1=R0.hasOwnProperty,i1=R0.toString,Ms=ns?ns.toStringTag:void 0;function o1(e){var t=r1.call(e,Ms),n=e[Ms];try{e[Ms]=void 0;var r=!0}catch{}var i=i1.call(e);return r&&(t?e[Ms]=n:delete e[Ms]),i}var s1=Object.prototype,a1=s1.toString;function c1(e){return a1.call(e)}var u1="[object Null]",l1="[object Undefined]",ym=ns?ns.toStringTag:void 0;function b0(e){return e==null?e===void 0?l1:u1:ym&&ym in Object(e)?o1(e):c1(e)}function d1(e){return e!=null&&typeof e=="object"}var f1="[object Symbol]";function $h(e){return typeof e=="symbol"||d1(e)&&b0(e)==f1}function h1(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var p1=Array.isArray,xh=p1,g1=1/0,_m=ns?ns.prototype:void 0,Em=_m?_m.toString:void 0;function I0(e){if(typeof e=="string")return e;if(xh(e))return h1(e,I0)+"";if($h(e))return Em?Em.call(e):"";var t=e+"";return t=="0"&&1/e==-g1?"-0":t}function w0(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var m1="[object AsyncFunction]",v1="[object Function]",y1="[object GeneratorFunction]",_1="[object Proxy]";function E1(e){if(!w0(e))return!1;var t=b0(e);return t==v1||t==y1||t==m1||t==_1}var C1=Uh["__core-js_shared__"],Kl=C1,Cm=function(){var e=/[^.]+$/.exec(Kl&&Kl.keys&&Kl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function T1(e){return!!Cm&&Cm in e}var S1=Function.prototype,R1=S1.toString;function b1(e){if(e!=null){try{return R1.call(e)}catch{}try{return e+""}catch{}}return""}var I1=/[\\^$.*+?()[\]{}|]/g,w1=/^\[object .+?Constructor\]$/,O1=Function.prototype,N1=Object.prototype,A1=O1.toString,P1=N1.hasOwnProperty,M1=RegExp("^"+A1.call(P1).replace(I1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function L1(e){if(!w0(e)||T1(e))return!1;var t=E1(e)?M1:w1;return t.test(b1(e))}function k1(e,t){return e==null?void 0:e[t]}function O0(e,t){var n=k1(e,t);return L1(n)?n:void 0}function D1(e,t){return e===t||e!==e&&t!==t}var U1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$1=/^\w*$/;function x1(e,t){if(xh(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||$h(e)?!0:$1.test(e)||!U1.test(e)||t!=null&&e in Object(t)}var B1=O0(Object,"create"),Ra=B1;function F1(){this.__data__=Ra?Ra(null):{},this.size=0}function V1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var j1="__lodash_hash_undefined__",H1=Object.prototype,q1=H1.hasOwnProperty;function K1(e){var t=this.__data__;if(Ra){var n=t[e];return n===j1?void 0:n}return q1.call(t,e)?t[e]:void 0}var G1=Object.prototype,z1=G1.hasOwnProperty;function Y1(e){var t=this.__data__;return Ra?t[e]!==void 0:z1.call(t,e)}var W1="__lodash_hash_undefined__";function J1(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ra&&t===void 0?W1:t,this}function go(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])}}go.prototype.clear=F1;go.prototype.delete=V1;go.prototype.get=K1;go.prototype.has=Y1;go.prototype.set=J1;function Q1(){this.__data__=[],this.size=0}function il(e,t){for(var n=e.length;n--;)if(D1(e[n][0],t))return n;return-1}var X1=Array.prototype,Z1=X1.splice;function ew(e){var t=this.__data__,n=il(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Z1.call(t,n,1),--this.size,!0}function tw(e){var t=this.__data__,n=il(t,e);return n<0?void 0:t[n][1]}function nw(e){return il(this.__data__,e)>-1}function rw(e,t){var n=this.__data__,r=il(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ms(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])}}ms.prototype.clear=Q1;ms.prototype.delete=ew;ms.prototype.get=tw;ms.prototype.has=nw;ms.prototype.set=rw;var iw=O0(Uh,"Map"),ow=iw;function sw(){this.size=0,this.__data__={hash:new go,map:new(ow||ms),string:new go}}function aw(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ol(e,t){var n=e.__data__;return aw(t)?n[typeof t=="string"?"string":"hash"]:n.map}function cw(e){var t=ol(this,e).delete(e);return this.size-=t?1:0,t}function uw(e){return ol(this,e).get(e)}function lw(e){return ol(this,e).has(e)}function dw(e,t){var n=ol(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function To(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])}}To.prototype.clear=sw;To.prototype.delete=cw;To.prototype.get=uw;To.prototype.has=lw;To.prototype.set=dw;var fw="Expected a function";function Bh(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(fw);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Bh.Cache||To),n}Bh.Cache=To;var hw=500;function pw(e){var t=Bh(e,function(r){return n.size===hw&&n.clear(),r}),n=t.cache;return t}var gw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mw=/\\(\\)?/g,vw=pw(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(gw,function(n,r,i,o){t.push(i?o.replace(mw,"$1"):r||n)}),t}),yw=vw;function _w(e){return e==null?"":I0(e)}function Ew(e,t){return xh(e)?e:x1(e,t)?[e]:yw(_w(e))}var Cw=1/0;function Tw(e){if(typeof e=="string"||$h(e))return e;var t=e+"";return t=="0"&&1/e==-Cw?"-0":t}function Sw(e,t){t=Ew(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Tw(t[n++])];return n&&n==r?e:void 0}function Rw(e,t,n){var r=e==null?void 0:Sw(e,t);return r===void 0?n:r}function N0(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}const bw='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',Iw=e=>getComputedStyle(e).position==="fixed"?!1:e.offsetParent!==null,Tm=e=>Array.from(e.querySelectorAll(bw)).filter(t=>ww(t)&&Iw(t)),ww=e=>{if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.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}},gi=(e,t,n,r=!1)=>{e&&t&&n&&(e==null||e.addEventListener(t,n,r))},mi=(e,t,n,r=!1)=>{e&&t&&n&&(e==null||e.removeEventListener(t,n,r))},kt=(e,t,{checkForDefaultPrevented:n=!0}={})=>i=>{const o=e==null?void 0:e(i);if(n===!1||!o)return t==null?void 0:t(i)},Sm=e=>t=>t.pointerType==="mouse"?e(t):void 0;function sl(e){return $R()?(y_(e),!0):!1}const Vt=typeof window!="undefined",ba=e=>typeof e=="boolean",gr=e=>typeof e=="number",Ow=e=>typeof e=="string",Gl=()=>{};var Nw=Object.defineProperty,Aw=Object.defineProperties,Pw=Object.getOwnPropertyDescriptors,Rm=Object.getOwnPropertySymbols,Mw=Object.prototype.hasOwnProperty,Lw=Object.prototype.propertyIsEnumerable,bm=(e,t,n)=>t in e?Nw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kw=(e,t)=>{for(var n in t||(t={}))Mw.call(t,n)&&bm(e,n,t[n]);if(Rm)for(var n of Rm(t))Lw.call(t,n)&&bm(e,n,t[n]);return e},Dw=(e,t)=>Aw(e,Pw(t));function Im(e,t){var n;const r=Rh();return q_(()=>{r.value=e()},Dw(kw({},t),{flush:(n=t==null?void 0:t.flush)!=null?n:"sync"})),Ga(r)}function Qd(e,t,n={}){const{immediate:r=!0}=n,i=re(!1);let o=null;function s(){o&&(clearTimeout(o),o=null)}function a(){i.value=!1,s()}function u(...d){s(),i.value=!0,o=setTimeout(()=>{i.value=!1,o=null,e(...d)},he(t))}return r&&(i.value=!0,Vt&&u()),sl(a),{isPending:i,start:u,stop:a}}function ia(e){var t;const n=he(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Wa=Vt?window:void 0,Uw=Vt?window.document:void 0;function mr(...e){let t,n,r,i;if(Ow(e[0])?([n,r,i]=e,t=Wa):[t,n,r,i]=e,!t)return Gl;let o=Gl;const s=je(()=>he(t),u=>{o(),!!u&&(u.addEventListener(n,r,i),o=()=>{u.removeEventListener(n,r,i),o=Gl})},{immediate:!0,flush:"post"}),a=()=>{s(),o()};return sl(a),a}function $w(e,t,n={}){const{window:r=Wa,ignore:i}=n;if(!r)return;const o=re(!0),a=[mr(r,"click",d=>{const f=ia(e),c=d.composedPath();!f||f===d.target||c.includes(f)||!o.value||i&&i.length>0&&i.some(l=>{const h=ia(l);return h&&(d.target===h||c.includes(h))})||t(d)},{passive:!0,capture:!0}),mr(r,"pointerdown",d=>{const f=ia(e);o.value=!!f&&!d.composedPath().includes(f)},{passive:!0})];return()=>a.forEach(d=>d())}const Xd=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Zd="__vueuse_ssr_handlers__";Xd[Zd]=Xd[Zd]||{};Xd[Zd];function xw(e,t,{window:n=Wa}={}){const r=re(""),i=ne(()=>{var o;return ia(t)||((o=n==null?void 0:n.document)==null?void 0:o.documentElement)});return je([i,()=>he(e)],([o,s])=>{o&&n&&(r.value=n.getComputedStyle(o).getPropertyValue(s))},{immediate:!0}),je(r,o=>{var s;((s=i.value)==null?void 0:s.style)&&i.value.style.setProperty(he(e),o)}),r}function Bw({document:e=Uw}={}){if(!e)return re("visible");const t=re(e.visibilityState);return mr(e,"visibilitychange",()=>{t.value=e.visibilityState}),t}var wm=Object.getOwnPropertySymbols,Fw=Object.prototype.hasOwnProperty,Vw=Object.prototype.propertyIsEnumerable,jw=(e,t)=>{var n={};for(var r in e)Fw.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wm)for(var r of wm(e))t.indexOf(r)<0&&Vw.call(e,r)&&(n[r]=e[r]);return n};function Fh(e,t,n={}){const r=n,{window:i=Wa}=r,o=jw(r,["window"]);let s;const a=i&&"ResizeObserver"in i,u=()=>{s&&(s.disconnect(),s=void 0)},d=je(()=>ia(e),c=>{u(),a&&i&&c&&(s=new i.ResizeObserver(t),s.observe(c,o))},{immediate:!0,flush:"post"}),f=()=>{u(),d()};return sl(f),{isSupported:a,stop:f}}var Om,Nm;Vt&&(window==null?void 0:window.navigator)&&((Om=window==null?void 0:window.navigator)==null?void 0:Om.platform)&&/iP(ad|hone|od)/.test((Nm=window==null?void 0:window.navigator)==null?void 0:Nm.platform);var Hw=Object.defineProperty,Am=Object.getOwnPropertySymbols,qw=Object.prototype.hasOwnProperty,Kw=Object.prototype.propertyIsEnumerable,Pm=(e,t,n)=>t in e?Hw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gw=(e,t)=>{for(var n in t||(t={}))qw.call(t,n)&&Pm(e,n,t[n]);if(Am)for(var n of Am(t))Kw.call(t,n)&&Pm(e,n,t[n]);return e};const zw={top:0,left:0,bottom:0,right:0,height:0,width:0};Gw({text:""},zw);function Yw({window:e=Wa}={}){if(!e)return re(!1);const t=re(e.document.hasFocus());return mr(e,"blur",()=>{t.value=!1}),mr(e,"focus",()=>{t.value=!0}),t}const Ww=function(e){for(const t of e){const n=t.target.__resizeListeners__||[];n.length&&n.forEach(r=>{r()})}},Jw=function(e,t){!Vt||!e||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new ResizeObserver(Ww),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},Qw=function(e,t){var n;!e||!e.__resizeListeners__||(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(n=e.__ro__)==null||n.disconnect())},ef=e=>e===void 0;class Xw extends Error{constructor(t){super(t);this.name="ElementPlusError"}}function vs(e,t){throw new Xw(`[${e}] ${t}`)}const Zw="UtilV2/objects",Mm=e=>Object.keys(e);function zl(e,t,n){let r=e,i,o;if(e&&et(e,t))i=t,o=r==null?void 0:r[t];else{t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");const s=t.split(".");let a=0;for(a;a<s.length-1&&!(!r&&!n);a++){const u=s[a];if(u in r)r=r[u];else{n&&vs(Zw,"Please transfer a valid prop path to form item!");break}}i=s[a],o=r==null?void 0:r[s[a]]}return{o:r,k:i,v:o}}const A0=(e="")=>e.split(" ").filter(t=>!!t.trim()),Lm=(e,t)=>{if(!e||!t)return!1;if(t.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},tf=(e,t)=>{!e||!t.trim()||e.classList.add(...A0(t))},Ia=(e,t)=>{!e||!t.trim()||e.classList.remove(...A0(t))},Wi=(e,t)=>{var n;if(!Vt||!e||!t)return"";pr(t);try{const r=e.style[t];if(r)return r;const i=(n=document.defaultView)==null?void 0:n.getComputedStyle(e,"");return i?i[t]:""}catch{return e.style[t]}};let Rc;const eO=()=>{var e;if(!Vt)return 0;if(Rc!==void 0)return Rc;const t=document.createElement("div");t.className="el-scrollbar__wrap",t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const n=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const i=r.offsetWidth;return(e=t.parentNode)==null||e.removeChild(t),Rc=n-i,Rc};var qn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n};const tO=Oe({name:"ArrowDown"}),nO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},rO=ye("path",{fill:"currentColor",d:"M831.872 340.864L512 652.672 192.128 340.864a30.592 30.592 0 00-42.752 0 29.12 29.12 0 000 41.6L489.664 714.24a32 32 0 0044.672 0l340.288-331.712a29.12 29.12 0 000-41.728 30.592 30.592 0 00-42.752 0z"},null,-1),iO=[rO];function oO(e,t,n,r,i,o){return ee(),Ce("svg",nO,iO)}var sO=qn(tO,[["render",oO]]);const aO=Oe({name:"ArrowLeft"}),cO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},uO=ye("path",{fill:"currentColor",d:"M609.408 149.376L277.76 489.6a32 32 0 000 44.672l331.648 340.352a29.12 29.12 0 0041.728 0 30.592 30.592 0 000-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 000-42.688 29.12 29.12 0 00-41.728 0z"},null,-1),lO=[uO];function dO(e,t,n,r,i,o){return ee(),Ce("svg",cO,lO)}var fO=qn(aO,[["render",dO]]);const hO=Oe({name:"ArrowRight"}),pO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},gO=ye("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 000 42.752L652.736 512 340.864 831.872a30.592 30.592 0 000 42.752 29.12 29.12 0 0041.728 0L714.24 534.336a32 32 0 000-44.672L382.592 149.376a29.12 29.12 0 00-41.728 0z"},null,-1),mO=[gO];function vO(e,t,n,r,i,o){return ee(),Ce("svg",pO,mO)}var yO=qn(hO,[["render",vO]]);const _O=Oe({name:"CircleCheck"}),EO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},CO=ye("path",{fill:"currentColor",d:"M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"},null,-1),TO=ye("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0145.312 45.312l-288 288a32 32 0 01-45.312 0l-160-160a32 32 0 1145.312-45.312L480 626.752l265.344-265.408z"},null,-1),SO=[CO,TO];function RO(e,t,n,r,i,o){return ee(),Ce("svg",EO,SO)}var bO=qn(_O,[["render",RO]]);const IO=Oe({name:"CircleCloseFilled"}),wO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},OO=ye("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm0 393.664L407.936 353.6a38.4 38.4 0 10-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1054.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1054.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 10-54.336-54.336L512 457.664z"},null,-1),NO=[OO];function AO(e,t,n,r,i,o){return ee(),Ce("svg",wO,NO)}var P0=qn(IO,[["render",AO]]);const PO=Oe({name:"CircleClose"}),MO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},LO=ye("path",{fill:"currentColor",d:"M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"},null,-1),kO=ye("path",{fill:"currentColor",d:"M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"},null,-1),DO=[LO,kO];function UO(e,t,n,r,i,o){return ee(),Ce("svg",MO,DO)}var M0=qn(PO,[["render",UO]]);const $O=Oe({name:"Close"}),xO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},BO=ye("path",{fill:"currentColor",d:"M764.288 214.592L512 466.88 259.712 214.592a31.936 31.936 0 00-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1045.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0045.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 10-45.12-45.184z"},null,-1),FO=[BO];function VO(e,t,n,r,i,o){return ee(),Ce("svg",xO,FO)}var al=qn($O,[["render",VO]]);const jO=Oe({name:"InfoFilled"}),HO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},qO=ye("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896.064A448 448 0 01512 64zm67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344zM590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 01-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 017.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"},null,-1),KO=[qO];function GO(e,t,n,r,i,o){return ee(),Ce("svg",HO,KO)}var L0=qn(jO,[["render",GO]]);const zO=Oe({name:"Loading"}),YO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},WO=ye("path",{fill:"currentColor",d:"M512 64a32 32 0 0132 32v192a32 32 0 01-64 0V96a32 32 0 0132-32zm0 640a32 32 0 0132 32v192a32 32 0 11-64 0V736a32 32 0 0132-32zm448-192a32 32 0 01-32 32H736a32 32 0 110-64h192a32 32 0 0132 32zm-640 0a32 32 0 01-32 32H96a32 32 0 010-64h192a32 32 0 0132 32zM195.2 195.2a32 32 0 0145.248 0L376.32 331.008a32 32 0 01-45.248 45.248L195.2 240.448a32 32 0 010-45.248zm452.544 452.544a32 32 0 0145.248 0L828.8 783.552a32 32 0 01-45.248 45.248L647.744 692.992a32 32 0 010-45.248zM828.8 195.264a32 32 0 010 45.184L692.992 376.32a32 32 0 01-45.248-45.248l135.808-135.808a32 32 0 0145.248 0zm-452.544 452.48a32 32 0 010 45.248L240.448 828.8a32 32 0 01-45.248-45.248l135.808-135.808a32 32 0 0145.248 0z"},null,-1),JO=[WO];function QO(e,t,n,r,i,o){return ee(),Ce("svg",YO,JO)}var k0=qn(zO,[["render",QO]]);const XO=Oe({name:"Plus"}),ZO={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},eN=ye("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0164 0v352h352a32 32 0 110 64H544v352a32 32 0 11-64 0V544H128a32 32 0 010-64h352z"},null,-1),tN=[eN];function nN(e,t,n,r,i,o){return ee(),Ce("svg",ZO,tN)}var rN=qn(XO,[["render",nN]]);const iN=Oe({name:"SuccessFilled"}),oN={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},sN=ye("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm-55.808 536.384l-99.52-99.584a38.4 38.4 0 10-54.336 54.336l126.72 126.72a38.272 38.272 0 0054.336 0l262.4-262.464a38.4 38.4 0 10-54.272-54.336L456.192 600.384z"},null,-1),aN=[sN];function cN(e,t,n,r,i,o){return ee(),Ce("svg",oN,aN)}var D0=qn(iN,[["render",cN]]);const uN=Oe({name:"View"}),lN={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},dN=ye("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1),fN=[dN];function hN(e,t,n,r,i,o){return ee(),Ce("svg",lN,fN)}var pN=qn(uN,[["render",hN]]);const gN=Oe({name:"WarningFilled"}),mN={class:"icon",width:"200",height:"200",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},vN=ye("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm0 192a58.432 58.432 0 00-58.24 63.744l23.36 256.384a35.072 35.072 0 0069.76 0l23.296-256.384A58.432 58.432 0 00512 256zm0 512a51.2 51.2 0 100-102.4 51.2 51.2 0 000 102.4z"},null,-1),yN=[vN];function _N(e,t,n,r,i,o){return ee(),Ce("svg",mN,yN)}var U0=qn(gN,[["render",_N]]);const nf=Symbol(),km="__elPropsReservedKey";function mu(e,t){if(!pt(e)||!!e[km])return e;const{values:n,required:r,default:i,type:o,validator:s}=e,a=n||s?d=>{let f=!1,c=[];if(n&&(c=Array.from(n),et(e,"default")&&c.push(i),f||(f=c.includes(d))),s&&(f||(f=s(d))),!f&&c.length>0){const l=[...new Set(c)].map(h=>JSON.stringify(h)).join(", ");gb(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${l}], got value ${JSON.stringify(d)}.`)}return f}:void 0,u={type:pt(o)&&Object.getOwnPropertySymbols(o).includes(nf)?o[nf]:o,required:!!r,validator:a,[km]:!0};return et(e,"default")&&(u.default=i),u}const ct=e=>N0(Object.entries(e).map(([t,n])=>[t,mu(n,t)])),Qe=e=>({[nf]:e}),mo=Qe([String,Object,Function]),EN={Close:al},$0={Close:al,SuccessFilled:D0,InfoFilled:L0,WarningFilled:U0,CircleCloseFilled:P0},vu={success:D0,warning:U0,error:P0,info:L0},CN={validating:k0,success:bO,error:M0},un=(e,t)=>{if(e.install=n=>{for(const r of[e,...Object.values(t!=null?t:{})])n.component(r.name,r)},t)for(const[n,r]of Object.entries(t))e[n]=r;return e},TN=(e,t)=>(e.install=n=>{n.config.globalProperties[t]=e},e),ti=e=>(e.install=Ut,e),x0=(...e)=>t=>{e.forEach(n=>{n.value=t})};function Ai(e,t="px"){if(!e)return"";if(lt(e))return e;if(gr(e))return`${e}${t}`}const st={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},En="update:modelValue",B0="input",F0=["default","small","large"],cl=e=>["",...F0].includes(e);var Jc=(e=>(e[e.TEXT=1]="TEXT",e[e.CLASS=2]="CLASS",e[e.STYLE=4]="STYLE",e[e.PROPS=8]="PROPS",e[e.FULL_PROPS=16]="FULL_PROPS",e[e.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",e[e.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",e[e.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",e[e.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",e[e.NEED_PATCH=512]="NEED_PATCH",e[e.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",e[e.HOISTED=-1]="HOISTED",e[e.BAIL=-2]="BAIL",e))(Jc||{});const SN=e=>/([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi.test(e),RN=()=>Math.floor(Math.random()*1e4),Vh=e=>e,bN=["class","style"],IN=/^on[A-Z]/,wN=(e={})=>{const{excludeListeners:t=!1,excludeKeys:n=[]}=e,r=n.concat(bN),i=cn();return ne(i?()=>{var o;return N0(Object.entries((o=i.proxy)==null?void 0:o.$attrs).filter(([s])=>!r.includes(s)&&!(t&&IN.test(s))))}:()=>({}))},So=Symbol("elForm"),Ja=Symbol("elFormItem"),V0=Symbol("buttonGroupContextKey"),j0=Symbol(),H0=Symbol("radioGroupKey"),ul=Symbol("tabsRootContextKey"),q0=Symbol("scrollbarContextKey"),K0=e=>{const t=cn();return ne(()=>{var n,r;return(r=(n=t.proxy)==null?void 0:n.$props[e])!=null?r:void 0})},yu=re();function ys(e,t=void 0){const n=cn()?He(j0,yu):yu;return e?ne(()=>{var r,i;return(i=(r=n.value)==null?void 0:r[e])!=null?i:t}):n}const ON=(e,t,n=!1)=>{var r;const i=!!cn(),o=i?ys():void 0,s=(r=t==null?void 0:t.provide)!=null?r:i?Ot:void 0;if(!s)return;const a=ne(()=>{const u=he(e);return(o==null?void 0:o.value)?NN(o.value,u):u});return s(j0,a),(n||!yu.value)&&(yu.value=a.value),a},NN=(e,t)=>{var n;const r=[...new Set([...Mm(e),...Mm(t)])],i={};for(const o of r)i[o]=(n=t[o])!=null?n:e[o];return i},ll=mu({type:String,values:F0,required:!1}),vr=(e,t={})=>{const n=re(void 0),r=t.prop?n:K0("size"),i=t.global?n:ys("size"),o=t.form?{size:void 0}:He(So,void 0),s=t.formItem?{size:void 0}:He(Ja,void 0);return ne(()=>r.value||he(e)||(s==null?void 0:s.size)||(o==null?void 0:o.size)||i.value||"default")},jh=e=>{const t=K0("disabled"),n=He(So,void 0);return ne(()=>t.value||he(e)||(n==null?void 0:n.disabled)||!1)},G0=(e,t,n)=>{let r={offsetX:0,offsetY:0};const i=a=>{const u=a.clientX,d=a.clientY,{offsetX:f,offsetY:c}=r,l=e.value.getBoundingClientRect(),h=l.left,p=l.top,m=l.width,v=l.height,_=document.documentElement.clientWidth,y=document.documentElement.clientHeight,E=-h+f,S=-p+c,T=_-h-m+f,R=y-p-v+c,C=L=>{const V=Math.min(Math.max(f+L.clientX-u,E),T),b=Math.min(Math.max(c+L.clientY-d,S),R);r={offsetX:V,offsetY:b},e.value.style.transform=`translate(${Ai(V)}, ${Ai(b)})`},w=()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",w)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",w)},o=()=>{t.value&&e.value&&t.value.addEventListener("mousedown",i)},s=()=>{t.value&&e.value&&t.value.removeEventListener("mousedown",i)};$t(()=>{q_(()=>{n.value?o():s()})}),or(()=>{s()})},Hh=()=>{const e=He(So,void 0),t=He(Ja,void 0);return{form:e,formItem:t}};var AN={name:"en",el:{colorpicker:{confirm:"OK",clear:"Clear"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"}}};const PN=e=>(t,n)=>MN(t,n,he(e)),MN=(e,t,n)=>Rw(n,e,e).replace(/\{(\w+)\}/g,(r,i)=>{var o;return`${(o=t==null?void 0:t[i])!=null?o:`{${i}}`}`}),LN=e=>{const t=ne(()=>he(e).name),n=wt(e)?e:re(e);return{lang:t,locale:n,t:PN(e)}},z0=()=>{const e=ys("locale");return LN(ne(()=>e.value||AN))},Y0=e=>{if(wt(e)||vs("[useLockscreen]","You need to pass a ref param to this function"),!Vt||Lm(document.body,"el-popup-parent--hidden"))return;let t=0,n=!1,r="0",i=0;const o=()=>{Ia(document.body,"el-popup-parent--hidden"),n&&(document.body.style.paddingRight=r)};je(e,s=>{if(!s){o();return}n=!Lm(document.body,"el-popup-parent--hidden"),n&&(r=document.body.style.paddingRight,i=parseInt(Wi(document.body,"paddingRight"),10)),t=eO();const a=document.documentElement.clientHeight<document.body.scrollHeight,u=Wi(document.body,"overflowY");t>0&&(a||u==="scroll")&&n&&(document.body.style.paddingRight=`${i+t}px`),tf(document.body,"el-popup-parent--hidden")}),y_(()=>o())},Go=[],kN=e=>{Go.length!==0&&e.code===st.esc&&(e.stopPropagation(),Go[Go.length-1].handleClose())},W0=(e,t)=>{je(t,n=>{n?Go.push(e):Go.splice(Go.findIndex(r=>r===e),1)})};Vt&&mr(document,"keydown",kN);const J0=e=>{const t={[e]:mu({type:Qe(Boolean),default:null}),[`onUpdate:${e}`]:mu({type:Qe(Function)})},n=[`update:${e}`];return{useModelToggle:({indicator:i,shouldHideWhenRouteChanges:o,shouldProceed:s,onShow:a,onHide:u})=>{const d=cn(),f=d.props,{emit:c}=d,l=`update:${e}`,h=ne(()=>ze(f[`onUpdate:${e}`])),p=ne(()=>f[e]===null),m=()=>{i.value!==!0&&(i.value=!0,ze(a)&&a())},v=()=>{i.value!==!1&&(i.value=!1,ze(u)&&u())},_=()=>{if(f.disabled===!0||ze(s)&&!s())return;const T=h.value&&Vt;T&&c(l,!0),(p.value||!T)&&m()},y=()=>{if(f.disabled===!0||!Vt)return;const T=h.value&&Vt;T&&c(l,!1),(p.value||!T)&&v()},E=T=>{!ba(T)||(f.disabled&&T?h.value&&c(l,!1):i.value!==T&&(T?m():v()))},S=()=>{i.value?y():_()};return je(()=>f[e],E),o&&d.appContext.config.globalProperties.$route!==void 0&&je(()=>qe({},d.proxy.$route),()=>{o.value&&i.value&&y()}),$t(()=>{E(f[e])}),{hide:y,show:_,toggle:S}},useModelToggleProps:t,useModelToggleEmits:n}};J0("modelValue");const DN=(e,t,n)=>{const r=o=>{n(o)&&o.stopImmediatePropagation()};let i;je(()=>e.value,o=>{o?i=mr(document,t,r,!0):i==null||i()},{immediate:!0})},Q0=(e,t)=>{let n;je(()=>e.value,r=>{var i,o;r?(n=document.activeElement,wt(t)&&((o=(i=t.value).focus)==null||o.call(i))):n.focus()})},qh=e=>{if(!e)return{onClick:Ut,onMousedown:Ut,onMouseup:Ut};let t=!1,n=!1;return{onClick:s=>{t&&n&&e(s),t=n=!1},onMousedown:s=>{t=s.target===s.currentTarget},onMouseup:s=>{n=s.target===s.currentTarget}}};function UN(){let e;const t=(r,i)=>{n(),e=window.setTimeout(r,i)},n=()=>window.clearTimeout(e);return sl(()=>n()),{registerTimeout:t,cancelTimeout:n}}const $N={prefix:Math.floor(Math.random()*1e4),current:0},xN=Symbol("elIdInjection"),X0=e=>{const t=He(xN,$N);return ne(()=>he(e)||`el-id-${t.prefix}-${t.current++}`)},BN=e=>{const t=n=>{const r=n;r.key===st.esc&&(e==null||e(r))};$t(()=>{gi(document,"keydown",t)}),or(()=>{mi(document,"keydown",t)})};let Dm;const Z0=`el-popper-container-${RN()}`,FN=`#${Z0}`,VN=()=>{J_(()=>{if(!!Vt&&!Dm){const e=document.createElement("div");e.id=Z0,document.body.appendChild(e),Dm=e}})},jN=ct({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200}}),HN=({showAfter:e,hideAfter:t,open:n,close:r})=>{const{registerTimeout:i}=UN();return{onOpen:()=>{i(()=>{n()},he(e))},onClose:()=>{i(()=>{r()},he(t))}}},eE=Symbol("elForwardRef"),qN=e=>{Ot(eE,{setForwardRef:n=>{e.value=n}})},KN=e=>({mounted(t){e(t)},updated(t){e(t)},unmounted(){e(null)}}),GN="el",zN="is-",Vi=(e,t,n,r,i)=>{let o=`${e}-${t}`;return n&&(o+=`-${n}`),r&&(o+=`__${r}`),i&&(o+=`--${i}`),o},Ct=e=>{const t=ys("namespace"),n=ne(()=>t.value||GN);return{namespace:n,b:(c="")=>Vi(he(n),e,c,"",""),e:c=>c?Vi(he(n),e,"",c,""):"",m:c=>c?Vi(he(n),e,"","",c):"",be:(c,l)=>c&&l?Vi(he(n),e,c,l,""):"",em:(c,l)=>c&&l?Vi(he(n),e,"",c,l):"",bm:(c,l)=>c&&l?Vi(he(n),e,c,"",l):"",bem:(c,l,h)=>c&&l&&h?Vi(he(n),e,c,l,h):"",is:(c,...l)=>{const h=l.length>=1?l[0]:!0;return c&&h?`${zN}${c}`:""}}},Um=re(0),Qa=()=>{const e=ys("zIndex",2e3),t=ne(()=>e.value+Um.value);return{initialZIndex:e,currentZIndex:t,nextZIndex:()=>(Um.value++,t.value)}};var Ze=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n};const YN=ct({size:{type:Qe([Number,String])},color:{type:String}}),WN={name:"ElIcon",inheritAttrs:!1},JN=Oe(St(qe({},WN),{props:YN,setup(e){const t=e,n=Ct("icon"),r=ne(()=>!t.size&&!t.color?{}:{fontSize:ef(t.size)?void 0:Ai(t.size),"--color":t.color});return(i,o)=>(ee(),Ce("i",Ar({class:he(n).b(),style:he(r)},i.$attrs),[ke(i.$slots,"default")],16))}})),Bn=un(JN),rf="_trap-focus-children",eo=[],$m=e=>{if(eo.length===0)return;const t=eo[eo.length-1][rf];if(t.length>0&&e.code===st.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const n=e.shiftKey,r=e.target===t[0],i=e.target===t[t.length-1];r&&n&&(e.preventDefault(),t[t.length-1].focus()),i&&!n&&(e.preventDefault(),t[0].focus())}},tE={beforeMount(e){e[rf]=Tm(e),eo.push(e),eo.length<=1&&gi(document,"keydown",$m)},updated(e){yt(()=>{e[rf]=Tm(e)})},unmounted(){eo.shift(),eo.length===0&&mi(document,"keydown",$m)}};let ar;const QN=`
  5. height:0 !important;
  6. visibility:hidden !important;
  7. overflow:hidden !important;
  8. position:absolute !important;
  9. z-index:-1000 !important;
  10. top:0 !important;
  11. right:0 !important;
  12. `,XN=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function ZN(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),r=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),i=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:XN.map(s=>`${s}:${t.getPropertyValue(s)}`).join(";"),paddingSize:r,borderSize:i,boxSizing:n}}function xm(e,t=1,n){var r;ar||(ar=document.createElement("textarea"),document.body.appendChild(ar));const{paddingSize:i,borderSize:o,boxSizing:s,contextStyle:a}=ZN(e);ar.setAttribute("style",`${a};${QN}`),ar.value=e.value||e.placeholder||"";let u=ar.scrollHeight;const d={};s==="border-box"?u=u+o:s==="content-box"&&(u=u-i),ar.value="";const f=ar.scrollHeight-i;if(gr(t)){let c=f*t;s==="border-box"&&(c=c+i+o),u=Math.max(c,u),d.minHeight=`${c}px`}if(gr(n)){let c=f*n;s==="border-box"&&(c=c+i+o),u=Math.min(c,u)}return d.height=`${u}px`,(r=ar.parentNode)==null||r.removeChild(ar),ar=void 0,d}const eA=ct({size:ll,disabled:Boolean,modelValue:{type:Qe(void 0),default:""},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Qe([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},placeholder:{type:String},form:{type:String,default:""},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:mo,default:""},prefixIcon:{type:mo,default:""},label:{type:String},tabindex:{type:[Number,String]},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Qe([Object,Array,String]),default:()=>Vh({})}}),tA={[En]:e=>lt(e),input:e=>lt(e),change:e=>lt(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof KeyboardEvent,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},nA={suffix:"append",prefix:"prepend"},rA=Oe({name:"ElInput",components:{ElIcon:Bn,CircleClose:M0,IconView:pN},inheritAttrs:!1,props:eA,emits:tA,setup(e,{slots:t,emit:n,attrs:r}){const i=cn(),o=wN(),{form:s,formItem:a}=Hh(),u=vr(),d=jh(),f=Ct("input"),c=Ct("textarea"),l=re(),h=re(),p=re(!1),m=re(!1),v=re(!1),_=re(!1),y=Rh(e.inputStyle),E=ne(()=>l.value||h.value),S=ne(()=>{var H;return(H=s==null?void 0:s.statusIcon)!=null?H:!1}),T=ne(()=>(a==null?void 0:a.validateState)||""),R=ne(()=>CN[T.value]),C=ne(()=>r.style),w=ne(()=>[e.inputStyle,y.value,{resize:e.resize}]),L=ne(()=>e.modelValue===null||e.modelValue===void 0?"":String(e.modelValue)),V=ne(()=>e.clearable&&!d.value&&!e.readonly&&!!L.value&&(p.value||m.value)),b=ne(()=>e.showPassword&&!d.value&&!e.readonly&&(!!L.value||p.value)),I=ne(()=>e.showWordLimit&&!!o.value.maxlength&&(e.type==="text"||e.type==="textarea")&&!d.value&&!e.readonly&&!e.showPassword),N=ne(()=>Array.from(L.value).length),A=ne(()=>!!I.value&&N.value>Number(o.value.maxlength)),M=()=>{const{type:H,autosize:W}=e;if(!(!Vt||H!=="textarea"))if(W){const te=pt(W)?W.minRows:void 0,ce=pt(W)?W.maxRows:void 0;y.value=qe({},xm(h.value,te,ce))}else y.value={minHeight:xm(h.value).minHeight}},$=()=>{const H=E.value;!H||H.value===L.value||(H.value=L.value)},x=H=>{const{el:W}=i.vnode;if(!W)return;const ce=Array.from(W.querySelectorAll(`.${f.e(H)}`)).find(ae=>ae.parentNode===W);if(!ce)return;const _e=nA[H];t[_e]?ce.style.transform=`translateX(${H==="suffix"?"-":""}${W.querySelector(`.${f.be("group",_e)}`).offsetWidth}px)`:ce.removeAttribute("style")},q=()=>{x("prefix"),x("suffix")},Z=H=>{const{value:W}=H.target;v.value||W!==L.value&&(n(En,W),n("input",W),yt($))},le=H=>{n("change",H.target.value)},Te=()=>{yt(()=>{var H;(H=E.value)==null||H.focus()})},Ee=()=>{var H;(H=E.value)==null||H.blur()},ve=H=>{p.value=!0,n("focus",H)},Se=H=>{var W;p.value=!1,n("blur",H),e.validateEvent&&((W=a==null?void 0:a.validate)==null||W.call(a,"blur"))},P=()=>{var H;(H=E.value)==null||H.select()},z=H=>{n("compositionstart",H),v.value=!0},G=H=>{var W;n("compositionupdate",H);const te=(W=H.target)==null?void 0:W.value,ce=te[te.length-1]||"";v.value=!SN(ce)},K=H=>{n("compositionend",H),v.value&&(v.value=!1,Z(H))},pe=()=>{n(En,""),n("change",""),n("clear"),n("input","")},be=()=>{_.value=!_.value,Te()},Ie=ne(()=>!!t.suffix||!!e.suffixIcon||V.value||e.showPassword||I.value||!!T.value&&S.value);return je(()=>e.modelValue,()=>{var H;yt(M),e.validateEvent&&((H=a==null?void 0:a.validate)==null||H.call(a,"change"))}),je(L,()=>$()),je(()=>e.type,()=>{yt(()=>{$(),M(),q()})}),$t(()=>{$(),q(),yt(M)}),za(()=>{yt(q)}),{input:l,textarea:h,attrs:o,inputSize:u,validateState:T,validateIcon:R,containerStyle:C,computedTextareaStyle:w,inputDisabled:d,showClear:V,showPwdVisible:b,isWordLimitVisible:I,textLength:N,hovering:m,inputExceed:A,passwordVisible:_,inputOrTextarea:E,suffixVisible:Ie,needStatusIcon:S,resizeTextarea:M,handleInput:Z,handleChange:le,handleFocus:ve,handleBlur:Se,handleCompositionStart:z,handleCompositionUpdate:G,handleCompositionEnd:K,handlePasswordVisible:be,clear:pe,select:P,focus:Te,blur:Ee,onMouseLeave:H=>{m.value=!1,n("mouseleave",H)},onMouseEnter:H=>{m.value=!0,n("mouseenter",H)},handleKeydown:H=>{n("keydown",H)},nsInput:f,nsTextarea:c}}}),iA=["type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder"],oA=["tabindex","disabled","readonly","autocomplete","aria-label","placeholder"];function sA(e,t,n,r,i,o){const s=Je("el-icon"),a=Je("circle-close"),u=Je("icon-view");return Dt((ee(),Ce("div",{class:ue([e.type==="textarea"?e.nsTextarea.b():e.nsInput.b(),e.nsInput.m(e.inputSize),e.nsInput.is("disabled",e.inputDisabled),e.nsInput.is("exceed",e.inputExceed),{[e.nsInput.b("group")]:e.$slots.prepend||e.$slots.append,[e.nsInput.bm("group","append")]:e.$slots.append,[e.nsInput.bm("group","prepend")]:e.$slots.prepend,[e.nsInput.m("prefix")]:e.$slots.prefix||e.prefixIcon,[e.nsInput.m("suffix")]:e.$slots.suffix||e.suffixIcon||e.clearable||e.showPassword,[e.nsInput.m("suffix--password-clear")]:e.clearable&&e.showPassword},e.$attrs.class]),style:Nt(e.containerStyle),onMouseenter:t[17]||(t[17]=(...d)=>e.onMouseEnter&&e.onMouseEnter(...d)),onMouseleave:t[18]||(t[18]=(...d)=>e.onMouseLeave&&e.onMouseLeave(...d))},[Ve(" input "),e.type!=="textarea"?(ee(),Ce(It,{key:0},[Ve(" prepend slot "),e.$slots.prepend?(ee(),Ce("div",{key:0,class:ue(e.nsInput.be("group","prepend"))},[ke(e.$slots,"prepend")],2)):Ve("v-if",!0),ye("input",Ar({ref:"input",class:e.nsInput.e("inner")},e.attrs,{type:e.showPassword?e.passwordVisible?"text":"password":e.type,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.label,placeholder:e.placeholder,style:e.inputStyle,onCompositionstart:t[0]||(t[0]=(...d)=>e.handleCompositionStart&&e.handleCompositionStart(...d)),onCompositionupdate:t[1]||(t[1]=(...d)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...d)),onCompositionend:t[2]||(t[2]=(...d)=>e.handleCompositionEnd&&e.handleCompositionEnd(...d)),onInput:t[3]||(t[3]=(...d)=>e.handleInput&&e.handleInput(...d)),onFocus:t[4]||(t[4]=(...d)=>e.handleFocus&&e.handleFocus(...d)),onBlur:t[5]||(t[5]=(...d)=>e.handleBlur&&e.handleBlur(...d)),onChange:t[6]||(t[6]=(...d)=>e.handleChange&&e.handleChange(...d)),onKeydown:t[7]||(t[7]=(...d)=>e.handleKeydown&&e.handleKeydown(...d))}),null,16,iA),Ve(" prefix slot "),e.$slots.prefix||e.prefixIcon?(ee(),Ce("span",{key:1,class:ue(e.nsInput.e("prefix"))},[ye("span",{class:ue(e.nsInput.e("prefix-inner"))},[ke(e.$slots,"prefix"),e.prefixIcon?(ee(),Ge(s,{key:0,class:ue(e.nsInput.e("icon"))},{default:Le(()=>[(ee(),Ge(dr(e.prefixIcon)))]),_:1},8,["class"])):Ve("v-if",!0)],2)],2)):Ve("v-if",!0),Ve(" suffix slot "),e.suffixVisible?(ee(),Ce("span",{key:2,class:ue(e.nsInput.e("suffix"))},[ye("span",{class:ue(e.nsInput.e("suffix-inner"))},[!e.showClear||!e.showPwdVisible||!e.isWordLimitVisible?(ee(),Ce(It,{key:0},[ke(e.$slots,"suffix"),e.suffixIcon?(ee(),Ge(s,{key:0,class:ue(e.nsInput.e("icon"))},{default:Le(()=>[(ee(),Ge(dr(e.suffixIcon)))]),_:1},8,["class"])):Ve("v-if",!0)],64)):Ve("v-if",!0),e.showClear?(ee(),Ge(s,{key:1,class:ue([e.nsInput.e("icon"),e.nsInput.e("clear")]),onMousedown:t[8]||(t[8]=Xn(()=>{},["prevent"])),onClick:e.clear},{default:Le(()=>[Be(a)]),_:1},8,["class","onClick"])):Ve("v-if",!0),e.showPwdVisible?(ee(),Ge(s,{key:2,class:ue([e.nsInput.e("icon"),e.nsInput.e("clear")]),onClick:e.handlePasswordVisible},{default:Le(()=>[Be(u)]),_:1},8,["class","onClick"])):Ve("v-if",!0),e.isWordLimitVisible?(ee(),Ce("span",{key:3,class:ue(e.nsInput.e("count"))},[ye("span",{class:ue(e.nsInput.e("count-inner"))},Mt(e.textLength)+" / "+Mt(e.attrs.maxlength),3)],2)):Ve("v-if",!0)],2),e.validateState&&e.validateIcon&&e.needStatusIcon?(ee(),Ge(s,{key:0,class:ue([e.nsInput.e("icon"),e.nsInput.e("validateIcon")])},{default:Le(()=>[(ee(),Ge(dr(e.validateIcon)))]),_:1},8,["class"])):Ve("v-if",!0)],2)):Ve("v-if",!0),Ve(" append slot "),e.$slots.append?(ee(),Ce("div",{key:3,class:ue(e.nsInput.be("group","append"))},[ke(e.$slots,"append")],2)):Ve("v-if",!0)],64)):(ee(),Ce(It,{key:1},[Ve(" textarea "),ye("textarea",Ar({ref:"textarea",class:e.nsTextarea.e("inner")},e.attrs,{tabindex:e.tabindex,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autocomplete,style:e.computedTextareaStyle,"aria-label":e.label,placeholder:e.placeholder,onCompositionstart:t[9]||(t[9]=(...d)=>e.handleCompositionStart&&e.handleCompositionStart(...d)),onCompositionupdate:t[10]||(t[10]=(...d)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...d)),onCompositionend:t[11]||(t[11]=(...d)=>e.handleCompositionEnd&&e.handleCompositionEnd(...d)),onInput:t[12]||(t[12]=(...d)=>e.handleInput&&e.handleInput(...d)),onFocus:t[13]||(t[13]=(...d)=>e.handleFocus&&e.handleFocus(...d)),onBlur:t[14]||(t[14]=(...d)=>e.handleBlur&&e.handleBlur(...d)),onChange:t[15]||(t[15]=(...d)=>e.handleChange&&e.handleChange(...d)),onKeydown:t[16]||(t[16]=(...d)=>e.handleKeydown&&e.handleKeydown(...d))}),null,16,oA),e.isWordLimitVisible?(ee(),Ce("span",{key:0,class:ue(e.nsInput.e("count"))},Mt(e.textLength)+" / "+Mt(e.attrs.maxlength),3)):Ve("v-if",!0)],64))],38)),[[fr,e.type!=="hidden"]])}var aA=Ze(rA,[["render",sA]]);const cA=un(aA),uA={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},lA=({move:e,size:t,bar:n})=>({[n.size]:t,transform:`translate${n.axis}(${e}%)`}),dA=ct({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),Bm="Thumb",fA=Oe({name:Bm,props:dA,setup(e){const t=He(q0),n=Ct("scrollbar");t||vs(Bm,"can not inject scrollbar context");const r=re(),i=re(),o=re({}),s=re(!1);let a=!1,u=!1,d=Vt?document.onselectstart:null;const f=ne(()=>uA[e.vertical?"vertical":"horizontal"]),c=ne(()=>lA({size:e.size,move:e.move,bar:f.value})),l=ne(()=>r.value[f.value.offset]**2/t.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),h=T=>{var R;if(T.stopPropagation(),T.ctrlKey||[1,2].includes(T.button))return;(R=window.getSelection())==null||R.removeAllRanges(),m(T);const C=T.currentTarget;!C||(o.value[f.value.axis]=C[f.value.offset]-(T[f.value.client]-C.getBoundingClientRect()[f.value.direction]))},p=T=>{if(!i.value||!r.value||!t.wrapElement)return;const R=Math.abs(T.target.getBoundingClientRect()[f.value.direction]-T[f.value.client]),C=i.value[f.value.offset]/2,w=(R-C)*100*l.value/r.value[f.value.offset];t.wrapElement[f.value.scroll]=w*t.wrapElement[f.value.scrollSize]/100},m=T=>{T.stopImmediatePropagation(),a=!0,document.addEventListener("mousemove",v),document.addEventListener("mouseup",_),d=document.onselectstart,document.onselectstart=()=>!1},v=T=>{if(!r.value||!i.value||a===!1)return;const R=o.value[f.value.axis];if(!R)return;const C=(r.value.getBoundingClientRect()[f.value.direction]-T[f.value.client])*-1,w=i.value[f.value.offset]-R,L=(C-w)*100*l.value/r.value[f.value.offset];t.wrapElement[f.value.scroll]=L*t.wrapElement[f.value.scrollSize]/100},_=()=>{a=!1,o.value[f.value.axis]=0,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",_),S(),u&&(s.value=!1)},y=()=>{u=!1,s.value=!!e.size},E=()=>{u=!0,s.value=a};or(()=>{S(),document.removeEventListener("mouseup",_)});const S=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return mr(xn(t,"scrollbarElement"),"mousemove",y),mr(xn(t,"scrollbarElement"),"mouseleave",E),{ns:n,instance:r,thumb:i,bar:f,thumbStyle:c,visible:s,clickTrackHandler:p,clickThumbHandler:h}}});function hA(e,t,n,r,i,o){return ee(),Ge(_r,{name:e.ns.b("fade")},{default:Le(()=>[Dt(ye("div",{ref:"instance",class:ue([e.ns.e("bar"),e.ns.is(e.bar.key)]),onMousedown:t[1]||(t[1]=(...s)=>e.clickTrackHandler&&e.clickTrackHandler(...s))},[ye("div",{ref:"thumb",class:ue(e.ns.e("thumb")),style:Nt(e.thumbStyle),onMousedown:t[0]||(t[0]=(...s)=>e.clickThumbHandler&&e.clickThumbHandler(...s))},null,38)],34),[[fr,e.always||e.visible]])]),_:1},8,["name"])}var pA=Ze(fA,[["render",hA]]);const gA=ct({always:{type:Boolean,default:!0},width:{type:String,default:""},height:{type:String,default:""},ratioX:{type:Number,default:1},ratioY:{type:Number,default:1}}),mA=Oe({components:{Thumb:pA},props:gA,setup(e){const t=re(0),n=re(0),r=4;return{handleScroll:o=>{if(o){const s=o.offsetHeight-r,a=o.offsetWidth-r;n.value=o.scrollTop*100/s*e.ratioY,t.value=o.scrollLeft*100/a*e.ratioX}},moveX:t,moveY:n}}});function vA(e,t,n,r,i,o){const s=Je("thumb");return ee(),Ce(It,null,[Be(s,{move:e.moveX,ratio:e.ratioX,size:e.width,always:e.always},null,8,["move","ratio","size","always"]),Be(s,{move:e.moveY,ratio:e.ratioY,size:e.height,vertical:"",always:e.always},null,8,["move","ratio","size","always"])],64)}var yA=Ze(mA,[["render",vA]]);const _A=ct({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Qe([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:{type:Boolean,default:!1},minSize:{type:Number,default:20}}),EA={scroll:({scrollTop:e,scrollLeft:t})=>gr(e)&&gr(t)},CA=Oe({name:"ElScrollbar",components:{Bar:yA},props:_A,emits:EA,setup(e,{emit:t}){const n=Ct("scrollbar");let r,i;const o=re(),s=re(),a=re(),u=re("0"),d=re("0"),f=re(),c=re(0),l=re(0),h=re(1),p=re(1),m=4,v=ne(()=>{const T={};return e.height&&(T.height=Ai(e.height)),e.maxHeight&&(T.maxHeight=Ai(e.maxHeight)),[e.wrapStyle,T]}),_=()=>{var T;s.value&&((T=f.value)==null||T.handleScroll(s.value),t("scroll",{scrollTop:s.value.scrollTop,scrollLeft:s.value.scrollLeft}))},y=T=>{!gr(T)||(s.value.scrollTop=T)},E=T=>{!gr(T)||(s.value.scrollLeft=T)},S=()=>{if(!s.value)return;const T=s.value.offsetHeight-m,R=s.value.offsetWidth-m,C=T**2/s.value.scrollHeight,w=R**2/s.value.scrollWidth,L=Math.max(C,e.minSize),V=Math.max(w,e.minSize);h.value=C/(T-C)/(L/(T-L)),p.value=w/(R-w)/(V/(R-V)),d.value=L+m<T?`${L}px`:"",u.value=V+m<R?`${V}px`:""};return je(()=>e.noresize,T=>{T?(r==null||r(),i==null||i()):({stop:r}=Fh(a,S),i=mr("resize",S))},{immediate:!0}),je(()=>[e.maxHeight,e.height],()=>{e.native||yt(()=>{var T;S(),s.value&&((T=f.value)==null||T.handleScroll(s.value))})}),Ot(q0,Hn({scrollbarElement:o,wrapElement:s})),$t(()=>{e.native||yt(()=>S())}),{ns:n,scrollbar$:o,wrap$:s,resize$:a,barRef:f,moveX:c,moveY:l,ratioX:p,ratioY:h,sizeWidth:u,sizeHeight:d,style:v,update:S,handleScroll:_,setScrollTop:y,setScrollLeft:E}}});function TA(e,t,n,r,i,o){const s=Je("bar");return ee(),Ce("div",{ref:"scrollbar$",class:ue(e.ns.b())},[ye("div",{ref:"wrap$",class:ue([e.wrapClass,e.ns.e("wrap"),{[e.ns.em("wrap","hidden-default")]:!e.native}]),style:Nt(e.style),onScroll:t[0]||(t[0]=(...a)=>e.handleScroll&&e.handleScroll(...a))},[(ee(),Ge(dr(e.tag),{ref:"resize$",class:ue([e.ns.e("view"),e.viewClass]),style:Nt(e.viewStyle)},{default:Le(()=>[ke(e.$slots,"default")]),_:3},8,["class","style"]))],38),e.native?Ve("v-if",!0):(ee(),Ge(s,{key:0,ref:"barRef",height:e.sizeHeight,width:e.sizeWidth,always:e.always,"ratio-x":e.ratioX,"ratio-y":e.ratioY},null,8,["height","width","always","ratio-x","ratio-y"]))],2)}var SA=Ze(CA,[["render",TA]]);const RA=un(SA),Kh=Symbol("elPopper"),nE=Symbol("elPopperContent"),bA=Oe({name:"ElPopperProvider",inheritAttrs:!1,setup(){const e={triggerRef:re(null),popperInstanceRef:re(null),contentRef:re(null)};return Ot(Kh,e),e}});function IA(e,t,n,r,i,o){return ke(e.$slots,"default")}var wA=Ze(bA,[["render",IA]]),wn="top",rr="bottom",ir="right",On="left",Gh="auto",Xa=[wn,rr,ir,On],rs="start",wa="end",OA="clippingParents",rE="viewport",Ls="popper",NA="reference",Fm=Xa.reduce(function(e,t){return e.concat([t+"-"+rs,t+"-"+wa])},[]),zh=[].concat(Xa,[Gh]).reduce(function(e,t){return e.concat([t,t+"-"+rs,t+"-"+wa])},[]),AA="beforeRead",PA="read",MA="afterRead",LA="beforeMain",kA="main",DA="afterMain",UA="beforeWrite",$A="write",xA="afterWrite",BA=[AA,PA,MA,LA,kA,DA,UA,$A,xA];function Pr(e){return e?(e.nodeName||"").toLowerCase():null}function Er(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function is(e){var t=Er(e).Element;return e instanceof t||e instanceof Element}function tr(e){var t=Er(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function iE(e){if(typeof ShadowRoot=="undefined")return!1;var t=Er(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function FA(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!tr(o)||!Pr(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function VA(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(u,d){return u[d]="",u},{});!tr(i)||!Pr(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}var jA={name:"applyStyles",enabled:!0,phase:"write",fn:FA,effect:VA,requires:["computeStyles"]};function Or(e){return e.split("-")[0]}var uo=Math.max,_u=Math.min,os=Math.round;function ss(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(tr(e)&&t){var o=e.offsetHeight,s=e.offsetWidth;s>0&&(r=os(n.width)/s||1),o>0&&(i=os(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function Yh(e){var t=ss(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function oE(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&iE(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Qr(e){return Er(e).getComputedStyle(e)}function HA(e){return["table","td","th"].indexOf(Pr(e))>=0}function Li(e){return((is(e)?e.ownerDocument:e.document)||window.document).documentElement}function dl(e){return Pr(e)==="html"?e:e.assignedSlot||e.parentNode||(iE(e)?e.host:null)||Li(e)}function Vm(e){return!tr(e)||Qr(e).position==="fixed"?null:e.offsetParent}function qA(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&tr(e)){var r=Qr(e);if(r.position==="fixed")return null}for(var i=dl(e);tr(i)&&["html","body"].indexOf(Pr(i))<0;){var o=Qr(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Za(e){for(var t=Er(e),n=Vm(e);n&&HA(n)&&Qr(n).position==="static";)n=Vm(n);return n&&(Pr(n)==="html"||Pr(n)==="body"&&Qr(n).position==="static")?t:n||qA(e)||t}function Wh(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function oa(e,t,n){return uo(e,_u(t,n))}function KA(e,t,n){var r=oa(e,t,n);return r>n?n:r}function sE(){return{top:0,right:0,bottom:0,left:0}}function aE(e){return Object.assign({},sE(),e)}function cE(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var GA=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,aE(typeof t!="number"?t:cE(t,Xa))};function zA(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Or(n.placement),u=Wh(a),d=[On,ir].indexOf(a)>=0,f=d?"height":"width";if(!(!o||!s)){var c=GA(i.padding,n),l=Yh(o),h=u==="y"?wn:On,p=u==="y"?rr:ir,m=n.rects.reference[f]+n.rects.reference[u]-s[u]-n.rects.popper[f],v=s[u]-n.rects.reference[u],_=Za(o),y=_?u==="y"?_.clientHeight||0:_.clientWidth||0:0,E=m/2-v/2,S=c[h],T=y-l[f]-c[p],R=y/2-l[f]/2+E,C=oa(S,R,T),w=u;n.modifiersData[r]=(t={},t[w]=C,t.centerOffset=C-R,t)}}function YA(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||!oE(t.elements.popper,i)||(t.elements.arrow=i))}var WA={name:"arrow",enabled:!0,phase:"main",fn:zA,effect:YA,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function as(e){return e.split("-")[1]}var JA={top:"auto",right:"auto",bottom:"auto",left:"auto"};function QA(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:os(t*i)/i||0,y:os(n*i)/i||0}}function jm(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,u=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,c=e.isFixed,l=s.x,h=l===void 0?0:l,p=s.y,m=p===void 0?0:p,v=typeof f=="function"?f({x:h,y:m}):{x:h,y:m};h=v.x,m=v.y;var _=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),E=On,S=wn,T=window;if(d){var R=Za(n),C="clientHeight",w="clientWidth";if(R===Er(n)&&(R=Li(n),Qr(R).position!=="static"&&a==="absolute"&&(C="scrollHeight",w="scrollWidth")),R=R,i===wn||(i===On||i===ir)&&o===wa){S=rr;var L=c&&T.visualViewport?T.visualViewport.height:R[C];m-=L-r.height,m*=u?1:-1}if(i===On||(i===wn||i===rr)&&o===wa){E=ir;var V=c&&T.visualViewport?T.visualViewport.width:R[w];h-=V-r.width,h*=u?1:-1}}var b=Object.assign({position:a},d&&JA),I=f===!0?QA({x:h,y:m}):{x:h,y:m};if(h=I.x,m=I.y,u){var N;return Object.assign({},b,(N={},N[S]=y?"0":"",N[E]=_?"0":"",N.transform=(T.devicePixelRatio||1)<=1?"translate("+h+"px, "+m+"px)":"translate3d("+h+"px, "+m+"px, 0)",N))}return Object.assign({},b,(t={},t[S]=y?m+"px":"",t[E]=_?h+"px":"",t.transform="",t))}function XA(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,u=a===void 0?!0:a,d={placement:Or(t.placement),variation:as(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,jm(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,jm(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var ZA={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:XA,data:{}},bc={passive:!0};function eP(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,u=Er(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,bc)}),a&&u.addEventListener("resize",n.update,bc),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,bc)}),a&&u.removeEventListener("resize",n.update,bc)}}var tP={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:eP,data:{}},nP={left:"right",right:"left",bottom:"top",top:"bottom"};function Qc(e){return e.replace(/left|right|bottom|top/g,function(t){return nP[t]})}var rP={start:"end",end:"start"};function Hm(e){return e.replace(/start|end/g,function(t){return rP[t]})}function Jh(e){var t=Er(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Qh(e){return ss(Li(e)).left+Jh(e).scrollLeft}function iP(e){var t=Er(e),n=Li(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,s=0,a=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:i,height:o,x:s+Qh(e),y:a}}function oP(e){var t,n=Li(e),r=Jh(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=uo(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=uo(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Qh(e),u=-r.scrollTop;return Qr(i||n).direction==="rtl"&&(a+=uo(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:u}}function Xh(e){var t=Qr(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function uE(e){return["html","body","#document"].indexOf(Pr(e))>=0?e.ownerDocument.body:tr(e)&&Xh(e)?e:uE(dl(e))}function sa(e,t){var n;t===void 0&&(t=[]);var r=uE(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Er(r),s=i?[o].concat(o.visualViewport||[],Xh(r)?r:[]):r,a=t.concat(s);return i?a:a.concat(sa(dl(s)))}function of(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function sP(e){var t=ss(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function qm(e,t){return t===rE?of(iP(e)):is(t)?sP(t):of(oP(Li(e)))}function aP(e){var t=sa(dl(e)),n=["absolute","fixed"].indexOf(Qr(e).position)>=0,r=n&&tr(e)?Za(e):e;return is(r)?t.filter(function(i){return is(i)&&oE(i,r)&&Pr(i)!=="body"}):[]}function cP(e,t,n){var r=t==="clippingParents"?aP(e):[].concat(t),i=[].concat(r,[n]),o=i[0],s=i.reduce(function(a,u){var d=qm(e,u);return a.top=uo(d.top,a.top),a.right=_u(d.right,a.right),a.bottom=_u(d.bottom,a.bottom),a.left=uo(d.left,a.left),a},qm(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function lE(e){var t=e.reference,n=e.element,r=e.placement,i=r?Or(r):null,o=r?as(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,u;switch(i){case wn:u={x:s,y:t.y-n.height};break;case rr:u={x:s,y:t.y+t.height};break;case ir:u={x:t.x+t.width,y:a};break;case On:u={x:t.x-n.width,y:a};break;default:u={x:t.x,y:t.y}}var d=i?Wh(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case rs:u[d]=u[d]-(t[f]/2-n[f]/2);break;case wa:u[d]=u[d]+(t[f]/2-n[f]/2);break}}return u}function Oa(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.boundary,s=o===void 0?OA:o,a=n.rootBoundary,u=a===void 0?rE:a,d=n.elementContext,f=d===void 0?Ls:d,c=n.altBoundary,l=c===void 0?!1:c,h=n.padding,p=h===void 0?0:h,m=aE(typeof p!="number"?p:cE(p,Xa)),v=f===Ls?NA:Ls,_=e.rects.popper,y=e.elements[l?v:f],E=cP(is(y)?y:y.contextElement||Li(e.elements.popper),s,u),S=ss(e.elements.reference),T=lE({reference:S,element:_,strategy:"absolute",placement:i}),R=of(Object.assign({},_,T)),C=f===Ls?R:S,w={top:E.top-C.top+m.top,bottom:C.bottom-E.bottom+m.bottom,left:E.left-C.left+m.left,right:C.right-E.right+m.right},L=e.modifiersData.offset;if(f===Ls&&L){var V=L[i];Object.keys(w).forEach(function(b){var I=[ir,rr].indexOf(b)>=0?1:-1,N=[wn,rr].indexOf(b)>=0?"y":"x";w[b]+=V[N]*I})}return w}function uP(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?zh:u,f=as(r),c=f?a?Fm:Fm.filter(function(p){return as(p)===f}):Xa,l=c.filter(function(p){return d.indexOf(p)>=0});l.length===0&&(l=c);var h=l.reduce(function(p,m){return p[m]=Oa(e,{placement:m,boundary:i,rootBoundary:o,padding:s})[Or(m)],p},{});return Object.keys(h).sort(function(p,m){return h[p]-h[m]})}function lP(e){if(Or(e)===Gh)return[];var t=Qc(e);return[Hm(e),t,Hm(t)]}function dP(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,u=n.fallbackPlacements,d=n.padding,f=n.boundary,c=n.rootBoundary,l=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,m=n.allowedAutoPlacements,v=t.options.placement,_=Or(v),y=_===v,E=u||(y||!p?[Qc(v)]:lP(v)),S=[v].concat(E).reduce(function(Se,P){return Se.concat(Or(P)===Gh?uP(t,{placement:P,boundary:f,rootBoundary:c,padding:d,flipVariations:p,allowedAutoPlacements:m}):P)},[]),T=t.rects.reference,R=t.rects.popper,C=new Map,w=!0,L=S[0],V=0;V<S.length;V++){var b=S[V],I=Or(b),N=as(b)===rs,A=[wn,rr].indexOf(I)>=0,M=A?"width":"height",$=Oa(t,{placement:b,boundary:f,rootBoundary:c,altBoundary:l,padding:d}),x=A?N?ir:On:N?rr:wn;T[M]>R[M]&&(x=Qc(x));var q=Qc(x),Z=[];if(o&&Z.push($[I]<=0),a&&Z.push($[x]<=0,$[q]<=0),Z.every(function(Se){return Se})){L=b,w=!1;break}C.set(b,Z)}if(w)for(var le=p?3:1,Te=function(P){var z=S.find(function(G){var K=C.get(G);if(K)return K.slice(0,P).every(function(pe){return pe})});if(z)return L=z,"break"},Ee=le;Ee>0;Ee--){var ve=Te(Ee);if(ve==="break")break}t.placement!==L&&(t.modifiersData[r]._skip=!0,t.placement=L,t.reset=!0)}}var fP={name:"flip",enabled:!0,phase:"main",fn:dP,requiresIfExists:["offset"],data:{_skip:!1}};function Km(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Gm(e){return[wn,ir,rr,On].some(function(t){return e[t]>=0})}function hP(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=Oa(t,{elementContext:"reference"}),a=Oa(t,{altBoundary:!0}),u=Km(s,r),d=Km(a,i,o),f=Gm(u),c=Gm(d);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:c},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":c})}var pP={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hP};function gP(e,t,n){var r=Or(e),i=[On,wn].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[On,ir].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function mP(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=zh.reduce(function(f,c){return f[c]=gP(c,t.rects,o),f},{}),a=s[t.placement],u=a.x,d=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=s}var vP={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:mP};function yP(e){var t=e.state,n=e.name;t.modifiersData[n]=lE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var _P={name:"popperOffsets",enabled:!0,phase:"read",fn:yP,data:{}};function EP(e){return e==="x"?"y":"x"}function CP(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,c=n.padding,l=n.tether,h=l===void 0?!0:l,p=n.tetherOffset,m=p===void 0?0:p,v=Oa(t,{boundary:u,rootBoundary:d,padding:c,altBoundary:f}),_=Or(t.placement),y=as(t.placement),E=!y,S=Wh(_),T=EP(S),R=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,L=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,V=typeof L=="number"?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),b=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(!!R){if(o){var N,A=S==="y"?wn:On,M=S==="y"?rr:ir,$=S==="y"?"height":"width",x=R[S],q=x+v[A],Z=x-v[M],le=h?-w[$]/2:0,Te=y===rs?C[$]:w[$],Ee=y===rs?-w[$]:-C[$],ve=t.elements.arrow,Se=h&&ve?Yh(ve):{width:0,height:0},P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:sE(),z=P[A],G=P[M],K=oa(0,C[$],Se[$]),pe=E?C[$]/2-le-K-z-V.mainAxis:Te-K-z-V.mainAxis,be=E?-C[$]/2+le+K+G+V.mainAxis:Ee+K+G+V.mainAxis,Ie=t.elements.arrow&&Za(t.elements.arrow),we=Ie?S==="y"?Ie.clientTop||0:Ie.clientLeft||0:0,k=(N=b==null?void 0:b[S])!=null?N:0,j=x+pe-k-we,H=x+be-k,W=oa(h?_u(q,j):q,x,h?uo(Z,H):Z);R[S]=W,I[S]=W-x}if(a){var te,ce=S==="x"?wn:On,_e=S==="x"?rr:ir,ae=R[T],ge=T==="y"?"height":"width",se=ae+v[ce],Ne=ae-v[_e],Re=[wn,On].indexOf(_)!==-1,Ae=(te=b==null?void 0:b[T])!=null?te:0,xe=Re?se:ae-C[ge]-w[ge]-Ae+V.altAxis,Xe=Re?ae+C[ge]+w[ge]-Ae-V.altAxis:Ne,oe=h&&Re?KA(xe,ae,Xe):oa(h?xe:se,ae,h?Xe:Ne);R[T]=oe,I[T]=oe-ae}t.modifiersData[r]=I}}var TP={name:"preventOverflow",enabled:!0,phase:"main",fn:CP,requiresIfExists:["offset"]};function SP(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function RP(e){return e===Er(e)||!tr(e)?Jh(e):SP(e)}function bP(e){var t=e.getBoundingClientRect(),n=os(t.width)/e.offsetWidth||1,r=os(t.height)/e.offsetHeight||1;return n!==1||r!==1}function IP(e,t,n){n===void 0&&(n=!1);var r=tr(t),i=tr(t)&&bP(t),o=Li(t),s=ss(e,i),a={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Pr(t)!=="body"||Xh(o))&&(a=RP(t)),tr(t)?(u=ss(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):o&&(u.x=Qh(o))),{x:s.left+a.scrollLeft-u.x,y:s.top+a.scrollTop-u.y,width:s.width,height:s.height}}function wP(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var u=t.get(a);u&&i(u)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function OP(e){var t=wP(e);return BA.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function NP(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function AP(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var zm={placement:"bottom",modifiers:[],strategy:"absolute"};function Ym(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function PP(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?zm:i;return function(a,u,d){d===void 0&&(d=o);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},zm,o),modifiersData:{},elements:{reference:a,popper:u},attributes:{},styles:{}},c=[],l=!1,h={state:f,setOptions:function(_){var y=typeof _=="function"?_(f.options):_;m(),f.options=Object.assign({},o,f.options,y),f.scrollParents={reference:is(a)?sa(a):a.contextElement?sa(a.contextElement):[],popper:sa(u)};var E=OP(AP([].concat(r,f.options.modifiers)));return f.orderedModifiers=E.filter(function(S){return S.enabled}),p(),h.update()},forceUpdate:function(){if(!l){var _=f.elements,y=_.reference,E=_.popper;if(!!Ym(y,E)){f.rects={reference:IP(y,Za(E),f.options.strategy==="fixed"),popper:Yh(E)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(V){return f.modifiersData[V.name]=Object.assign({},V.data)});for(var S=0;S<f.orderedModifiers.length;S++){if(f.reset===!0){f.reset=!1,S=-1;continue}var T=f.orderedModifiers[S],R=T.fn,C=T.options,w=C===void 0?{}:C,L=T.name;typeof R=="function"&&(f=R({state:f,options:w,name:L,instance:h})||f)}}}},update:NP(function(){return new Promise(function(v){h.forceUpdate(),v(f)})}),destroy:function(){m(),l=!0}};if(!Ym(a,u))return h;h.setOptions(d).then(function(v){!l&&d.onFirstUpdate&&d.onFirstUpdate(v)});function p(){f.orderedModifiers.forEach(function(v){var _=v.name,y=v.options,E=y===void 0?{}:y,S=v.effect;if(typeof S=="function"){var T=S({state:f,name:_,instance:h,options:E}),R=function(){};c.push(T||R)}})}function m(){c.forEach(function(v){return v()}),c=[]}return h}}var MP=[tP,_P,ZA,jA,vP,fP,TP,WA,pP],LP=PP({defaultModifiers:MP});const dE=ct({arrowOffset:{type:Number,default:5}}),kP=ct({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Qe(Array),default:()=>[]},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:zh,default:"bottom"},popperOptions:{type:Qe(Object),default:()=>({})},strategy:{type:String,values:["fixed","absolute"],default:"absolute"}});ct({autoClose:{type:Number,default:0},cutoff:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}});const fE=ct(St(qe({},kP),{style:{type:Qe([String,Array,Object])},className:{type:Qe([String,Array,Object])},effect:{type:String,default:"dark"},enterable:{type:Boolean,default:!0},pure:{type:Boolean},popperClass:{type:Qe([String,Array,Object])},popperStyle:{type:Qe([String,Array,Object])},referenceEl:{type:Qe(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},zIndex:Number})),hE=ct({virtualRef:{type:Qe(Object)},virtualTriggering:{type:Boolean}}),DP=Oe({name:"ElPopperArrow",props:dE,setup(e){const t=Ct("popper"),n=re(null),r=He(nE,void 0);return je(()=>e.arrowOffset,i=>{r.arrowOffset.value=i}),$t(()=>{r.arrowRef.value=he(n)}),or(()=>{r.arrowRef.value=null}),{ns:t,arrowRef:n}}});function UP(e,t,n,r,i,o){return ee(),Ce("span",{ref:"arrowRef",class:ue(e.ns.e("arrow")),"data-popper-arrow":""},null,2)}var $P=Ze(DP,[["render",UP]]);const xP="ElOnlyChild",BP=Oe({name:xP,setup(e,{slots:t,attrs:n}){var r;const i=He(eE,void 0),o=KN((r=i.setForwardRef)!=null?r:Ut);return()=>{var s;const a=(s=t.default)==null?void 0:s.call(t,n);if(!a||a.length>1)return null;const u=pE(a);return u?Dt(po(u,n),[[o]]):null}}});function pE(e){if(!e)return null;const t=e;for(let n=0;n<t.length;n++){const r=t[n];if(pt(r))switch(r.type){case nr:continue;case Ya:return Wm(r);case It:return pE(r.children);default:return r}return Wm(r)}return null}function Wm(e){return ot("span",{class:"el-only-child__content"},[e])}const Jm=(e,t)=>{const{placement:n,strategy:r,popperOptions:i}=e,o=St(qe({placement:n,strategy:r},i),{modifiers:FP(e)});return VP(o,t),jP(o,i==null?void 0:i.modifiers),o},gE=e=>{let t=null;return e?("getBoundingClientRect"in e||e instanceof HTMLElement?t=e:t=e.$el,t):null};function FP(e){const{offset:t,gpuAcceleration:n,fallbackPlacements:r}=e;return[{name:"offset",options:{offset:[0,t!=null?t:12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:r!=null?r:[]}},{name:"computeStyles",options:{gpuAcceleration:n,adaptive:n}}]}function VP(e,{arrowEl:t,arrowOffset:n}){e.modifiers.push({name:"arrow",options:{element:t,padding:n!=null?n:5}})}function jP(e,t){t&&(e.modifiers=[...e.modifiers,...t!=null?t:[]])}const HP=Oe({name:"ElPopperTrigger",components:{ElOnlyChild:BP},inheritAttrs:!1,props:St(qe({},hE),{onMouseenter:Function,onMouseleave:Function,onClick:Function,onKeydown:Function,onFocus:Function,onBlur:Function,onContextmenu:Function,id:String,open:Boolean}),setup(e){const{triggerRef:t}=He(Kh,void 0);return qN(t),je(()=>e.virtualRef,n=>{n&&(t.value=gE(n))},{immediate:!0}),je(()=>t.value,(n,r)=>{n&&n instanceof HTMLElement&&["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"].forEach(i=>{const o=e[i];o&&(n.addEventListener(i.slice(2).toLowerCase(),o),r==null||r.removeEventListener(i.slice(2).toLowerCase(),o))})},{immediate:!0}),{triggerRef:t}}});function qP(e,t,n,r,i,o){const s=Je("el-only-child");return e.virtualTriggering?Ve("v-if",!0):(ee(),Ge(s,Ar({key:0},e.$attrs,{"aria-describedby":e.open?e.id:void 0}),{default:Le(()=>[ke(e.$slots,"default")]),_:3},16,["aria-describedby"]))}var KP=Ze(HP,[["render",qP]]);const GP=Oe({name:"ElPopperContent",props:fE,emits:["mouseenter","mouseleave"],setup(e){const{triggerRef:t,popperInstanceRef:n,contentRef:r}=He(Kh,void 0),{nextZIndex:i}=Qa(),o=Ct("popper"),s=re(null),a=re(null),u=re();Ot(nE,{arrowRef:a,arrowOffset:u});const d=re(e.zIndex||i()),f=ne(()=>[{zIndex:he(d)},e.popperStyle]),c=ne(()=>[o.b(),o.is("pure",e.pure),o.is(e.effect),e.popperClass]),l=({referenceEl:p,popperContentEl:m,arrowEl:v})=>{const _=Jm(e,{arrowEl:v,arrowOffset:he(u)});return LP(p,m,_)},h=()=>{var p;(p=he(n))==null||p.update(),d.value=e.zIndex||i()};return $t(()=>{let p;je(()=>gE(e.referenceEl)||he(t),m=>{var v;if(p==null||p(),m){(v=n.value)==null||v.destroy();const _=he(s);r.value=_;const y=he(a),E=l({referenceEl:m,popperContentEl:he(s),arrowEl:y});n.value=E,p=je(()=>m.getBoundingClientRect(),()=>{h()},{immediate:!0})}else n.value=null},{immediate:!0}),je(()=>Jm(e,{arrowEl:he(a),arrowOffset:he(u)}),m=>{var v;return(v=n.value)==null?void 0:v.setOptions(m)})}),{ns:o,popperContentRef:s,popperInstanceRef:n,contentStyle:f,contentClass:c,updatePopper:h}}});function zP(e,t,n,r,i,o){return ee(),Ce("div",{ref:"popperContentRef",style:Nt(e.contentStyle),class:ue(e.contentClass),role:"tooltip",onMouseenter:t[0]||(t[0]=s=>e.$emit("mouseenter",s)),onMouseleave:t[1]||(t[1]=s=>e.$emit("mouseleave",s))},[ke(e.$slots,"default")],38)}var YP=Ze(GP,[["render",zP]]);const WP=un(wA),JP=Oe({name:"ElVisuallyHidden",props:{style:{type:[String,Object,Array]}},setup(e){return{computedStyle:ne(()=>[e.style,{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}])}}});function QP(e,t,n,r,i,o){return ee(),Ce("span",Ar(e.$attrs,{style:e.computedStyle}),null,16)}var XP=Ze(JP,[["render",QP]]);const Zh=ct(St(qe(qe({},jN),fE),{appendTo:{type:Qe([String,Object]),default:FN},content:{type:String,default:""},rawContent:{type:Boolean,default:!1},persistent:Boolean,ariaLabel:String,visible:{type:Qe(Boolean),default:null},transition:{type:String,default:"el-fade-in-linear"},teleported:{type:Boolean,default:!0},disabled:{type:Boolean}})),ep=ct(St(qe({},hE),{disabled:Boolean,trigger:{type:Qe([String,Array]),default:"hover"}})),ZP=ct({openDelay:{type:Number},visibleArrow:{type:Boolean,default:void 0},hideAfter:{type:Number,default:200},showArrow:{type:Boolean,default:!0}}),tp=Symbol("elTooltip"),eM=Oe({name:"ElTooltipContent",components:{ElPopperContent:YP,ElVisuallyHidden:XP},inheritAttrs:!1,props:Zh,setup(e){const t=re(null),n=re(!1),r=re(!1),i=re(!1),{controlled:o,id:s,open:a,trigger:u,onClose:d,onOpen:f,onShow:c,onHide:l}=He(tp,void 0),h=ne(()=>e.persistent),p=ne(()=>he(h)?!0:he(a)),m=ne(()=>e.disabled?!1:he(a)),v=ne(()=>{var L;return(L=e.style)!=null?L:{}}),_=ne(()=>!he(a));BN(d);const y=()=>{l()},E=()=>{if(he(o))return!0},S=kt(E,()=>{e.enterable&&he(u)==="hover"&&f()}),T=kt(E,()=>{he(u)==="hover"&&d()}),R=()=>{var L,V;(V=(L=t.value)==null?void 0:L.updatePopper)==null||V.call(L)},C=()=>{c()};let w;return je(()=>he(a),L=>{L?w=$w(ne(()=>{var V;return(V=t.value)==null?void 0:V.popperContentRef}),()=>{if(he(o))return;he(u)!=="hover"&&d()}):w==null||w()},{flush:"post"}),{ariaHidden:_,entering:r,leaving:i,id:s,intermediateOpen:n,contentStyle:v,contentRef:t,shouldRender:p,shouldShow:m,open:a,onAfterShow:C,onBeforeEnter:R,onContentEnter:S,onContentLeave:T,onTransitionLeave:y}}});function tM(e,t,n,r,i,o){const s=Je("el-visually-hidden"),a=Je("el-popper-content");return ee(),Ge(s0,{disabled:!e.teleported,to:e.appendTo},[Be(_r,{name:e.transition,onAfterLeave:e.onTransitionLeave,onBeforeEnter:e.onBeforeEnter,onAfterEnter:e.onAfterShow},{default:Le(()=>[e.shouldRender?Dt((ee(),Ge(a,Ar({key:0,ref:"contentRef"},e.$attrs,{"aria-hidden":e.ariaHidden,"boundaries-padding":e.boundariesPadding,"fallback-placements":e.fallbackPlacements,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,placement:e.placement,"popper-options":e.popperOptions,strategy:e.strategy,effect:e.effect,enterable:e.enterable,pure:e.pure,"popper-class":e.popperClass,"popper-style":[e.popperStyle,e.contentStyle],"reference-el":e.referenceEl,"z-index":e.zIndex,onMouseenter:e.onContentEnter,onMouseleave:e.onContentLeave}),{default:Le(()=>[ke(e.$slots,"default"),Be(s,{id:e.id,role:"tooltip"},{default:Le(()=>[Jr(Mt(e.ariaLabel),1)]),_:1},8,["id"])]),_:3},16,["aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","z-index","onMouseenter","onMouseleave"])),[[fr,e.shouldShow]]):Ve("v-if",!0)]),_:3},8,["name","onAfterLeave","onBeforeEnter","onAfterEnter"])],8,["disabled","to"])}var nM=Ze(eM,[["render",tM]]);const rM=(e,t)=>Fe(e)?e.includes(t):e===t,wo=(e,t,n)=>r=>{rM(he(e),t)&&n(r)},iM=Oe({name:"ElTooltipTrigger",components:{ElPopperTrigger:KP},props:ep,setup(e){const t=Ct("tooltip"),{controlled:n,id:r,open:i,onOpen:o,onClose:s,onToggle:a}=He(tp,void 0),u=re(null),d=()=>{if(he(n)||e.disabled)return!0},f=xn(e,"trigger"),c=kt(d,wo(f,"hover",o)),l=kt(d,wo(f,"hover",s)),h=kt(d,wo(f,"click",y=>{y.button===0&&a(y)})),p=kt(d,wo(f,"focus",o)),m=kt(d,wo(f,"focus",s)),v=kt(d,wo(f,"contextmenu",y=>{y.preventDefault(),a(y)})),_=kt(d,y=>{const{code:E}=y;(E===st.enter||E===st.space)&&a(y)});return{onBlur:m,onContextMenu:v,onFocus:p,onMouseenter:c,onMouseleave:l,onClick:h,onKeydown:_,open:i,id:r,triggerRef:u,ns:t}}});function oM(e,t,n,r,i,o){const s=Je("el-popper-trigger");return ee(),Ge(s,{id:e.id,"virtual-ref":e.virtualRef,open:e.open,"virtual-triggering":e.virtualTriggering,class:ue(e.ns.e("trigger")),onBlur:e.onBlur,onClick:e.onClick,onContextmenu:e.onContextMenu,onFocus:e.onFocus,onMouseenter:e.onMouseenter,onMouseleave:e.onMouseleave,onKeydown:e.onKeydown},{default:Le(()=>[ke(e.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"])}var sM=Ze(iM,[["render",oM]]);const{useModelToggleProps:aM,useModelToggle:cM,useModelToggleEmits:uM}=J0("visible"),lM=Oe({name:"ElTooltip",components:{ElPopper:WP,ElPopperArrow:$P,ElTooltipContent:nM,ElTooltipTrigger:sM},props:qe(qe(qe(qe(qe({},aM),Zh),ep),dE),ZP),emits:[...uM,"show","hide"],setup(e,{emit:t}){VN();const n=ne(()=>(!ef(e.openDelay),e.openDelay||e.showAfter)),r=ne(()=>(!ef(e.visibleArrow),ba(e.visibleArrow)?e.visibleArrow:e.showArrow)),i=X0(),o=re(null),s=()=>{var h;const p=he(o);p&&((h=p.popperInstanceRef)==null||h.update())},a=re(!1),{show:u,hide:d}=cM({indicator:a}),{onOpen:f,onClose:c}=HN({showAfter:n,hideAfter:xn(e,"hideAfter"),open:u,close:d}),l=ne(()=>ba(e.visible));return Ot(tp,{controlled:l,id:i,open:Ga(a),trigger:xn(e,"trigger"),onOpen:f,onClose:c,onToggle:()=>{he(a)?c():f()},onShow:()=>{t("show")},onHide:()=>{t("hide")},updatePopper:s}),{compatShowAfter:n,compatShowArrow:r,popperRef:o,open:a,hide:d,updatePopper:s,onOpen:f,onClose:c}}}),dM=["innerHTML"],fM={key:1};function hM(e,t,n,r,i,o){const s=Je("el-tooltip-trigger"),a=Je("el-popper-arrow"),u=Je("el-tooltip-content"),d=Je("el-popper");return ee(),Ge(d,{ref:"popperRef"},{default:Le(()=>[Be(s,{disabled:e.disabled,trigger:e.trigger,"virtual-ref":e.virtualRef,"virtual-triggering":e.virtualTriggering},{default:Le(()=>[e.$slots.default?ke(e.$slots,"default",{key:0}):Ve("v-if",!0)]),_:3},8,["disabled","trigger","virtual-ref","virtual-triggering"]),Be(u,{"aria-label":e.ariaLabel,"boundaries-padding":e.boundariesPadding,content:e.content,disabled:e.disabled,effect:e.effect,enterable:e.enterable,"fallback-placements":e.fallbackPlacements,"hide-after":e.hideAfter,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,persistent:e.persistent,"popper-class":e.popperClass,"popper-style":e.popperStyle,placement:e.placement,"popper-options":e.popperOptions,pure:e.pure,"raw-content":e.rawContent,"reference-el":e.referenceEl,"show-after":e.compatShowAfter,strategy:e.strategy,teleported:e.teleported,transition:e.transition,"z-index":e.zIndex},{default:Le(()=>[ke(e.$slots,"content",{},()=>[e.rawContent?(ee(),Ce("span",{key:0,innerHTML:e.content},null,8,dM)):(ee(),Ce("span",fM,Mt(e.content),1))]),e.compatShowArrow?(ee(),Ge(a,{key:0,"arrow-offset":e.arrowOffset},null,8,["arrow-offset"])):Ve("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","show-after","strategy","teleported","transition","z-index"])]),_:3},512)}var pM=Ze(lM,[["render",hM]]);const gM=un(pM),mM=ct({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"}}),vM=Oe({name:"ElBadge",props:mM,setup(e){const t=Ct("badge"),n=ne(()=>e.isDot?"":typeof e.value=="number"&&typeof e.max=="number"?e.max<e.value?`${e.max}+`:`${e.value}`:`${e.value}`);return{ns:t,content:n}}}),yM=["textContent"];function _M(e,t,n,r,i,o){return ee(),Ce("div",{class:ue(e.ns.b())},[ke(e.$slots,"default"),Be(_r,{name:`${e.ns.namespace.value}-zoom-in-center`},{default:Le(()=>[Dt(ye("sup",{class:ue([e.ns.e("content"),e.ns.em("content",e.type),e.ns.is("fixed",!!e.$slots.default),e.ns.is("dot",e.isDot)]),textContent:Mt(e.content)},null,10,yM),[[fr,!e.hidden&&(e.content||e.content==="0"||e.isDot)]])]),_:1},8,["name"])],2)}var EM=Ze(vM,[["render",_M]]);const CM=un(EM);function en(e,t){TM(e)&&(e="100%");var n=SM(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Ic(e){return Math.min(1,Math.max(0,e))}function TM(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function SM(e){return typeof e=="string"&&e.indexOf("%")!==-1}function mE(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function wc(e){return e<=1?Number(e)*100+"%":e}function to(e){return e.length===1?"0"+e:String(e)}function RM(e,t,n){return{r:en(e,255)*255,g:en(t,255)*255,b:en(n,255)*255}}function Qm(e,t,n){e=en(e,255),t=en(t,255),n=en(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,s=0,a=(r+i)/2;if(r===i)s=0,o=0;else{var u=r-i;switch(s=a>.5?u/(2-r-i):u/(r+i),r){case e:o=(t-n)/u+(t<n?6:0);break;case t:o=(n-e)/u+2;break;case n:o=(e-t)/u+4;break}o/=6}return{h:o,s,l:a}}function Yl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function bM(e,t,n){var r,i,o;if(e=en(e,360),t=en(t,100),n=en(n,100),t===0)i=n,o=n,r=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;r=Yl(a,s,e+1/3),i=Yl(a,s,e),o=Yl(a,s,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function Xm(e,t,n){e=en(e,255),t=en(t,255),n=en(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,s=r,a=r-i,u=r===0?0:a/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/a+(t<n?6:0);break;case t:o=(n-e)/a+2;break;case n:o=(e-t)/a+4;break}o/=6}return{h:o,s:u,v:s}}function IM(e,t,n){e=en(e,360)*6,t=en(t,100),n=en(n,100);var r=Math.floor(e),i=e-r,o=n*(1-t),s=n*(1-i*t),a=n*(1-(1-i)*t),u=r%6,d=[n,s,o,o,a,n][u],f=[a,n,n,s,o,o][u],c=[o,o,a,n,n,s][u];return{r:d*255,g:f*255,b:c*255}}function Zm(e,t,n,r){var i=[to(Math.round(e).toString(16)),to(Math.round(t).toString(16)),to(Math.round(n).toString(16))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function wM(e,t,n,r,i){var o=[to(Math.round(e).toString(16)),to(Math.round(t).toString(16)),to(Math.round(n).toString(16)),to(OM(r))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function OM(e){return Math.round(parseFloat(e)*255).toString(16)}function ev(e){return An(e)/255}function An(e){return parseInt(e,16)}function NM(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var sf={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function AM(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,s=!1,a=!1;return typeof e=="string"&&(e=LM(e)),typeof e=="object"&&(Fr(e.r)&&Fr(e.g)&&Fr(e.b)?(t=RM(e.r,e.g,e.b),s=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Fr(e.h)&&Fr(e.s)&&Fr(e.v)?(r=wc(e.s),i=wc(e.v),t=IM(e.h,r,i),s=!0,a="hsv"):Fr(e.h)&&Fr(e.s)&&Fr(e.l)&&(r=wc(e.s),o=wc(e.l),t=bM(e.h,r,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=mE(n),{ok:s,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var PM="[-\\+]?\\d+%?",MM="[-\\+]?\\d*\\.\\d+%?",vi="(?:"+MM+")|(?:"+PM+")",Wl="[\\s|\\(]+("+vi+")[,|\\s]+("+vi+")[,|\\s]+("+vi+")\\s*\\)?",Jl="[\\s|\\(]+("+vi+")[,|\\s]+("+vi+")[,|\\s]+("+vi+")[,|\\s]+("+vi+")\\s*\\)?",cr={CSS_UNIT:new RegExp(vi),rgb:new RegExp("rgb"+Wl),rgba:new RegExp("rgba"+Jl),hsl:new RegExp("hsl"+Wl),hsla:new RegExp("hsla"+Jl),hsv:new RegExp("hsv"+Wl),hsva:new RegExp("hsva"+Jl),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function LM(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(sf[e])e=sf[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=cr.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=cr.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=cr.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=cr.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=cr.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=cr.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=cr.hex8.exec(e),n?{r:An(n[1]),g:An(n[2]),b:An(n[3]),a:ev(n[4]),format:t?"name":"hex8"}:(n=cr.hex6.exec(e),n?{r:An(n[1]),g:An(n[2]),b:An(n[3]),format:t?"name":"hex"}:(n=cr.hex4.exec(e),n?{r:An(n[1]+n[1]),g:An(n[2]+n[2]),b:An(n[3]+n[3]),a:ev(n[4]+n[4]),format:t?"name":"hex8"}:(n=cr.hex3.exec(e),n?{r:An(n[1]+n[1]),g:An(n[2]+n[2]),b:An(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function Fr(e){return Boolean(cr.CSS_UNIT.exec(String(e)))}var kM=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=NM(t)),this.originalInput=t;var i=AM(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,s=t.g/255,a=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?r=s/12.92:r=Math.pow((s+.055)/1.055,2.4),a<=.03928?i=a/12.92:i=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=mE(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=Xm(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Xm(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv("+n+", "+r+"%, "+i+"%)":"hsva("+n+", "+r+"%, "+i+"%, "+this.roundA+")"},e.prototype.toHsl=function(){var t=Qm(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Qm(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl("+n+", "+r+"%, "+i+"%)":"hsla("+n+", "+r+"%, "+i+"%, "+this.roundA+")"},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Zm(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),wM(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb("+t+", "+n+", "+r+")":"rgba("+t+", "+n+", "+r+", "+this.roundA+")"},e.prototype.toPercentageRgb=function(){var t=function(n){return Math.round(en(n,255)*100)+"%"};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(en(n,255)*100)};return this.a===1?"rgb("+t(this.r)+"%, "+t(this.g)+"%, "+t(this.b)+"%)":"rgba("+t(this.r)+"%, "+t(this.g)+"%, "+t(this.b)+"%, "+this.roundA+")"},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Zm(this.r,this.g,this.b,!1),n=0,r=Object.entries(sf);n<r.length;n++){var i=r[n],o=i[0],s=i[1];if(t===s)return o}return!1},e.prototype.toString=function(t){var n=Boolean(t);t=t!=null?t:this.format;var r=!1,i=this.a<1&&this.a>=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=Ic(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=Ic(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=Ic(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=Ic(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,s={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/t;t--;)s.push(new e({h:r,s:i,v:o})),o=(o+a)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,s=1;s<t;s++)i.push(new e({h:(r+s*o)%360,s:n.s,l:n.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const DM=["default","primary","success","warning","info","danger","text",""],UM=["button","submit","reset"],af=ct({size:ll,disabled:Boolean,type:{type:String,values:DM,default:""},icon:{type:mo,default:""},nativeType:{type:String,values:UM,default:"button"},loading:Boolean,loadingIcon:{type:mo,default:()=>k0},plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,autoInsertSpace:{type:Boolean,default:void 0}}),$M={click:e=>e instanceof MouseEvent},xM=["disabled","autofocus","type"],BM={name:"ElButton"},FM=Oe(St(qe({},BM),{props:af,emits:$M,setup(e,{expose:t,emit:n}){const r=e,i=CI(),o=He(V0,void 0),s=ys("button"),a=Ct("button"),{form:u}=Hh(),d=vr(ne(()=>o==null?void 0:o.size)),f=jh(),c=re(),l=ne(()=>r.type||(o==null?void 0:o.type)||""),h=ne(()=>{var y,E,S;return(S=(E=r.autoInsertSpace)!=null?E:(y=s.value)==null?void 0:y.autoInsertSpace)!=null?S:!1}),p=ne(()=>{var y;const E=(y=i.default)==null?void 0:y.call(i);if(h.value&&(E==null?void 0:E.length)===1){const S=E[0];if((S==null?void 0:S.type)===Ya){const T=S.children;return/^\p{Unified_Ideograph}{2}$/u.test(T)}}return!1}),m=ne(()=>xw(`--el-color-${r.type}`).value),v=ne(()=>{let y={};const E=r.color||m.value;if(E){const S=new kM(E),T=S.shade(10).toString();if(r.plain)y={"--el-button-bg-color":S.tint(90).toString(),"--el-button-text-color":E,"--el-button-hover-text-color":"var(--el-color-white)","--el-button-hover-bg-color":E,"--el-button-hover-border-color":E,"--el-button-active-bg-color":T,"--el-button-active-text-color":"var(--el-color-white)","--el-button-active-border-color":T};else{const R=S.tint(20).toString();y={"--el-button-bg-color":E,"--el-button-border-color":E,"--el-button-hover-bg-color":R,"--el-button-hover-border-color":R,"--el-button-active-bg-color":T,"--el-button-active-border-color":T}}if(f.value){const R=S.tint(50).toString();y["--el-button-disabled-bg-color"]=R,y["--el-button-disabled-border-color"]=R}}return y}),_=y=>{r.nativeType==="reset"&&(u==null||u.resetFields()),n("click",y)};return t({ref:c,size:d,type:l,disabled:f,shouldAddSpace:p}),(y,E)=>(ee(),Ce("button",{ref_key:"_ref",ref:c,class:ue([he(a).b(),he(a).m(he(l)),he(a).m(he(d)),he(a).is("disabled",he(f)),he(a).is("loading",y.loading),he(a).is("plain",y.plain),he(a).is("round",y.round),he(a).is("circle",y.circle)]),disabled:he(f)||y.loading,autofocus:y.autofocus,type:y.nativeType,style:Nt(he(v)),onClick:_},[y.loading?(ee(),Ce(It,{key:0},[y.$slots.loading?ke(y.$slots,"loading",{key:0}):(ee(),Ge(he(Bn),{key:1,class:ue(he(a).is("loading"))},{default:Le(()=>[(ee(),Ge(dr(y.loadingIcon)))]),_:1},8,["class"]))],2112)):y.icon?(ee(),Ge(he(Bn),{key:1},{default:Le(()=>[(ee(),Ge(dr(y.icon)))]),_:1})):Ve("v-if",!0),y.$slots.default?(ee(),Ce("span",{key:2,class:ue({[he(a).em("text","expand")]:he(p)})},[ke(y.$slots,"default")],2)):Ve("v-if",!0)],14,xM))}})),VM={size:af.size,type:af.type},jM=Oe({name:"ElButtonGroup",props:VM,setup(e){return Ot(V0,Hn({size:xn(e,"size"),type:xn(e,"type")})),{ns:Ct("button")}}});function HM(e,t,n,r,i,o){return ee(),Ce("div",{class:ue(`${e.ns.b("group")}`)},[ke(e.$slots,"default")],2)}var vE=Ze(jM,[["render",HM]]);const np=un(FM,{ButtonGroup:vE});ti(vE);var qr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function qM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function KM(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),t}var yE={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(qr,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",u="hour",d="day",f="week",c="month",l="quarter",h="year",p="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},E=function(N,A,M){var $=String(N);return!$||$.length>=A?N:""+Array(A+1-$.length).join(M)+N},S={s:E,z:function(N){var A=-N.utcOffset(),M=Math.abs(A),$=Math.floor(M/60),x=M%60;return(A<=0?"+":"-")+E($,2,"0")+":"+E(x,2,"0")},m:function N(A,M){if(A.date()<M.date())return-N(M,A);var $=12*(M.year()-A.year())+(M.month()-A.month()),x=A.clone().add($,c),q=M-x<0,Z=A.clone().add($+(q?-1:1),c);return+(-($+(M-x)/(q?x-Z:Z-x))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:c,y:h,w:f,d,D:p,h:u,m:a,s,ms:o,Q:l}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},T="en",R={};R[T]=y;var C=function(N){return N instanceof b},w=function(N,A,M){var $;if(!N)return T;if(typeof N=="string")R[N]&&($=N),A&&(R[N]=A,$=N);else{var x=N.name;R[x]=N,$=x}return!M&&$&&(T=$),$||!M&&T},L=function(N,A){if(C(N))return N.clone();var M=typeof A=="object"?A:{};return M.date=N,M.args=arguments,new b(M)},V=S;V.l=w,V.i=C,V.w=function(N,A){return L(N,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var b=function(){function N(M){this.$L=w(M.locale,null,!0),this.parse(M)}var A=N.prototype;return A.parse=function(M){this.$d=function($){var x=$.date,q=$.utc;if(x===null)return new Date(NaN);if(V.u(x))return new Date;if(x instanceof Date)return new Date(x);if(typeof x=="string"&&!/Z$/i.test(x)){var Z=x.match(v);if(Z){var le=Z[2]-1||0,Te=(Z[7]||"0").substring(0,3);return q?new Date(Date.UTC(Z[1],le,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,Te)):new Date(Z[1],le,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,Te)}}return new Date(x)}(M),this.$x=M.x||{},this.init()},A.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},A.$utils=function(){return V},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function(M,$){var x=L(M);return this.startOf($)<=x&&x<=this.endOf($)},A.isAfter=function(M,$){return L(M)<this.startOf($)},A.isBefore=function(M,$){return this.endOf($)<L(M)},A.$g=function(M,$,x){return V.u(M)?this[$]:this.set(x,M)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(M,$){var x=this,q=!!V.u($)||$,Z=V.p(M),le=function(K,pe){var be=V.w(x.$u?Date.UTC(x.$y,pe,K):new Date(x.$y,pe,K),x);return q?be:be.endOf(d)},Te=function(K,pe){return V.w(x.toDate()[K].apply(x.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(pe)),x)},Ee=this.$W,ve=this.$M,Se=this.$D,P="set"+(this.$u?"UTC":"");switch(Z){case h:return q?le(1,0):le(31,11);case c:return q?le(1,ve):le(0,ve+1);case f:var z=this.$locale().weekStart||0,G=(Ee<z?Ee+7:Ee)-z;return le(q?Se-G:Se+(6-G),ve);case d:case p:return Te(P+"Hours",0);case u:return Te(P+"Minutes",1);case a:return Te(P+"Seconds",2);case s:return Te(P+"Milliseconds",3);default:return this.clone()}},A.endOf=function(M){return this.startOf(M,!1)},A.$set=function(M,$){var x,q=V.p(M),Z="set"+(this.$u?"UTC":""),le=(x={},x[d]=Z+"Date",x[p]=Z+"Date",x[c]=Z+"Month",x[h]=Z+"FullYear",x[u]=Z+"Hours",x[a]=Z+"Minutes",x[s]=Z+"Seconds",x[o]=Z+"Milliseconds",x)[q],Te=q===d?this.$D+($-this.$W):$;if(q===c||q===h){var Ee=this.clone().set(p,1);Ee.$d[le](Te),Ee.init(),this.$d=Ee.set(p,Math.min(this.$D,Ee.daysInMonth())).$d}else le&&this.$d[le](Te);return this.init(),this},A.set=function(M,$){return this.clone().$set(M,$)},A.get=function(M){return this[V.p(M)]()},A.add=function(M,$){var x,q=this;M=Number(M);var Z=V.p($),le=function(ve){var Se=L(q);return V.w(Se.date(Se.date()+Math.round(ve*M)),q)};if(Z===c)return this.set(c,this.$M+M);if(Z===h)return this.set(h,this.$y+M);if(Z===d)return le(1);if(Z===f)return le(7);var Te=(x={},x[a]=r,x[u]=i,x[s]=n,x)[Z]||1,Ee=this.$d.getTime()+M*Te;return V.w(Ee,this)},A.subtract=function(M,$){return this.add(-1*M,$)},A.format=function(M){var $=this,x=this.$locale();if(!this.isValid())return x.invalidDate||m;var q=M||"YYYY-MM-DDTHH:mm:ssZ",Z=V.z(this),le=this.$H,Te=this.$m,Ee=this.$M,ve=x.weekdays,Se=x.months,P=function(pe,be,Ie,we){return pe&&(pe[be]||pe($,q))||Ie[be].substr(0,we)},z=function(pe){return V.s(le%12||12,pe,"0")},G=x.meridiem||function(pe,be,Ie){var we=pe<12?"AM":"PM";return Ie?we.toLowerCase():we},K={YY:String(this.$y).slice(-2),YYYY:this.$y,M:Ee+1,MM:V.s(Ee+1,2,"0"),MMM:P(x.monthsShort,Ee,Se,3),MMMM:P(Se,Ee),D:this.$D,DD:V.s(this.$D,2,"0"),d:String(this.$W),dd:P(x.weekdaysMin,this.$W,ve,2),ddd:P(x.weekdaysShort,this.$W,ve,3),dddd:ve[this.$W],H:String(le),HH:V.s(le,2,"0"),h:z(1),hh:z(2),a:G(le,Te,!0),A:G(le,Te,!1),m:String(Te),mm:V.s(Te,2,"0"),s:String(this.$s),ss:V.s(this.$s,2,"0"),SSS:V.s(this.$ms,3,"0"),Z};return q.replace(_,function(pe,be){return be||K[pe]||Z.replace(":","")})},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(M,$,x){var q,Z=V.p($),le=L(M),Te=(le.utcOffset()-this.utcOffset())*r,Ee=this-le,ve=V.m(this,le);return ve=(q={},q[h]=ve/12,q[c]=ve,q[l]=ve/3,q[f]=(Ee-Te)/6048e5,q[d]=(Ee-Te)/864e5,q[u]=Ee/i,q[a]=Ee/r,q[s]=Ee/n,q)[Z]||Ee,x?ve:V.a(ve)},A.daysInMonth=function(){return this.endOf(c).$D},A.$locale=function(){return R[this.$L]},A.locale=function(M,$){if(!M)return this.$L;var x=this.clone(),q=w(M,$,!0);return q&&(x.$L=q),x},A.clone=function(){return V.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},N}(),I=b.prototype;return L.prototype=I,[["$ms",o],["$s",s],["$m",a],["$H",u],["$W",d],["$M",c],["$y",h],["$D",p]].forEach(function(N){I[N[1]]=function(A){return this.$g(A,N[0],N[1])}}),L.extend=function(N,A){return N.$i||(N(A,b,L),N.$i=!0),L},L.locale=w,L.isDayjs=C,L.unix=function(N){return L(1e3*N)},L.en=R[T],L.Ls=R,L.p={},L})})(yE);var QB=yE.exports;const GM={modelValue:{type:[Boolean,Number,String],default:()=>{}},label:{type:[String,Boolean,Number,Object]},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},tabindex:[String,Number],size:String},_s=()=>{const e=He(So,{}),t=He(Ja,{}),n=He("CheckboxGroup",{}),r=ne(()=>n&&(n==null?void 0:n.name)==="ElCheckboxGroup"),i=ne(()=>t.size);return{isGroup:r,checkboxGroup:n,elForm:e,elFormItemSize:i,elFormItem:t}},zM=e=>{const t=re(!1),{emit:n}=cn(),{isGroup:r,checkboxGroup:i}=_s(),o=re(!1);return{model:ne({get(){var a,u;return r.value?(a=i.modelValue)==null?void 0:a.value:(u=e.modelValue)!=null?u:t.value},set(a){var u;r.value&&Array.isArray(a)?(o.value=i.max!==void 0&&a.length>i.max.value,o.value===!1&&((u=i==null?void 0:i.changeEvent)==null||u.call(i,a))):(n(En,a),t.value=a)}}),isLimitExceeded:o}},YM=(e,{model:t})=>{const{isGroup:n,checkboxGroup:r}=_s(),i=re(!1),o=vr(r==null?void 0:r.checkboxGroupSize,{prop:!0}),s=ne(()=>{const u=t.value;return Ka(u)==="[object Boolean]"?u:Array.isArray(u)?u.includes(e.label):u!=null?u===e.trueLabel:!!u}),a=vr(ne(()=>{var u;return n.value?(u=r==null?void 0:r.checkboxGroupSize)==null?void 0:u.value:void 0}));return{isChecked:s,focus:i,size:o,checkboxSize:a}},WM=(e,{model:t,isChecked:n})=>{const{elForm:r,isGroup:i,checkboxGroup:o}=_s(),s=ne(()=>{var u,d;const f=(u=o.max)==null?void 0:u.value,c=(d=o.min)==null?void 0:d.value;return!!(f||c)&&t.value.length>=f&&!n.value||t.value.length<=c&&n.value});return{isDisabled:ne(()=>{var u,d;const f=e.disabled||r.disabled;return(d=i.value?((u=o.disabled)==null?void 0:u.value)||f||s.value:e.disabled||r.disabled)!=null?d:!1}),isLimitDisabled:s}},JM=(e,{model:t})=>{function n(){Array.isArray(t.value)&&!t.value.includes(e.label)?t.value.push(e.label):t.value=e.trueLabel||!0}e.checked&&n()},QM=(e,{isLimitExceeded:t})=>{const{elFormItem:n}=_s(),{emit:r}=cn();function i(o){var s,a;if(t.value)return;const d=o.target.checked?(s=e.trueLabel)!=null?s:!0:(a=e.falseLabel)!=null?a:!1;r("change",d,o)}return je(()=>e.modelValue,()=>{var o;(o=n.validate)==null||o.call(n,"change")}),{handleChange:i}},_E=e=>{const{model:t,isLimitExceeded:n}=zM(e),{focus:r,size:i,isChecked:o,checkboxSize:s}=YM(e,{model:t}),{isDisabled:a}=WM(e,{model:t,isChecked:o}),{handleChange:u}=QM(e,{isLimitExceeded:n});return JM(e,{model:t}),{isChecked:o,isDisabled:a,checkboxSize:s,model:t,handleChange:u,focus:r,size:i}},XM=Oe({name:"ElCheckbox",props:{modelValue:{type:[Boolean,Number,String],default:()=>{}},label:{type:[String,Boolean,Number,Object]},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},controls:{type:String,default:void 0},border:Boolean,size:{type:String,validator:cl},tabindex:[String,Number]},emits:[En,"change"],setup(e){const t=Ct("checkbox");return qe({ns:t},_E(e))}}),ZM=["id","aria-controls"],e2=["tabindex","role","aria-checked"],t2=["aria-hidden","name","tabindex","disabled","true-value","false-value"],n2=["aria-hidden","disabled","value","name","tabindex"];function r2(e,t,n,r,i,o){return ee(),Ce("label",{id:e.id,class:ue([e.ns.b(),e.ns.m(e.checkboxSize),e.ns.is("disabled",e.isDisabled),e.ns.is("bordered",e.border),e.ns.is("checked",e.isChecked)]),"aria-controls":e.indeterminate?e.controls:null},[ye("span",{class:ue([e.ns.e("input"),e.ns.is("disabled",e.isDisabled),e.ns.is("checked",e.isChecked),e.ns.is("indeterminate",e.indeterminate),e.ns.is("focus",e.focus)]),tabindex:e.indeterminate?0:void 0,role:e.indeterminate?"checkbox":void 0,"aria-checked":e.indeterminate?"mixed":!1},[ye("span",{class:ue(e.ns.e("inner"))},null,2),e.trueLabel||e.falseLabel?Dt((ee(),Ce("input",{key:0,"onUpdate:modelValue":t[0]||(t[0]=s=>e.model=s),class:ue(e.ns.e("original")),type:"checkbox","aria-hidden":e.indeterminate?"true":"false",name:e.name,tabindex:e.tabindex,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel,onChange:t[1]||(t[1]=(...s)=>e.handleChange&&e.handleChange(...s)),onFocus:t[2]||(t[2]=s=>e.focus=!0),onBlur:t[3]||(t[3]=s=>e.focus=!1)},null,42,t2)),[[pu,e.model]]):Dt((ee(),Ce("input",{key:1,"onUpdate:modelValue":t[4]||(t[4]=s=>e.model=s),class:ue(e.ns.e("original")),type:"checkbox","aria-hidden":e.indeterminate?"true":"false",disabled:e.isDisabled,value:e.label,name:e.name,tabindex:e.tabindex,onChange:t[5]||(t[5]=(...s)=>e.handleChange&&e.handleChange(...s)),onFocus:t[6]||(t[6]=s=>e.focus=!0),onBlur:t[7]||(t[7]=s=>e.focus=!1)},null,42,n2)),[[pu,e.model]])],10,e2),e.$slots.default||e.label?(ee(),Ce("span",{key:0,class:ue(e.ns.e("label"))},[ke(e.$slots,"default"),e.$slots.default?Ve("v-if",!0):(ee(),Ce(It,{key:0},[Jr(Mt(e.label),1)],2112))],2)):Ve("v-if",!0)],10,ZM)}var i2=Ze(XM,[["render",r2]]);const o2=Oe({name:"ElCheckboxButton",props:GM,emits:[En,"change"],setup(e){const{focus:t,isChecked:n,isDisabled:r,size:i,model:o,handleChange:s}=_E(e),{checkboxGroup:a}=_s(),u=Ct("checkbox"),d=ne(()=>{var f,c,l,h;const p=(c=(f=a==null?void 0:a.fill)==null?void 0:f.value)!=null?c:"";return{backgroundColor:p,borderColor:p,color:(h=(l=a==null?void 0:a.textColor)==null?void 0:l.value)!=null?h:"",boxShadow:p?`-1px 0 0 0 ${p}`:null}});return{focus:t,isChecked:n,isDisabled:r,model:o,handleChange:s,activeStyle:d,size:i,ns:u}}}),s2=["aria-checked","aria-disabled"],a2=["name","tabindex","disabled","true-value","false-value"],c2=["name","tabindex","disabled","value"];function u2(e,t,n,r,i,o){return ee(),Ce("label",{class:ue([e.ns.b("button"),e.ns.bm("button",e.size),e.ns.is("disabled",e.isDisabled),e.ns.is("checked",e.isChecked),e.ns.is("focus",e.focus)]),role:"checkbox","aria-checked":e.isChecked,"aria-disabled":e.isDisabled},[e.trueLabel||e.falseLabel?Dt((ee(),Ce("input",{key:0,"onUpdate:modelValue":t[0]||(t[0]=s=>e.model=s),class:ue(e.ns.be("button","original")),type:"checkbox",name:e.name,tabindex:e.tabindex,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel,onChange:t[1]||(t[1]=(...s)=>e.handleChange&&e.handleChange(...s)),onFocus:t[2]||(t[2]=s=>e.focus=!0),onBlur:t[3]||(t[3]=s=>e.focus=!1)},null,42,a2)),[[pu,e.model]]):Dt((ee(),Ce("input",{key:1,"onUpdate:modelValue":t[4]||(t[4]=s=>e.model=s),class:ue(e.ns.be("button","original")),type:"checkbox",name:e.name,tabindex:e.tabindex,disabled:e.isDisabled,value:e.label,onChange:t[5]||(t[5]=(...s)=>e.handleChange&&e.handleChange(...s)),onFocus:t[6]||(t[6]=s=>e.focus=!0),onBlur:t[7]||(t[7]=s=>e.focus=!1)},null,42,c2)),[[pu,e.model]]),e.$slots.default||e.label?(ee(),Ce("span",{key:2,class:ue(e.ns.be("button","inner")),style:Nt(e.isChecked?e.activeStyle:null)},[ke(e.$slots,"default",{},()=>[Jr(Mt(e.label),1)])],6)):Ve("v-if",!0)],10,s2)}var EE=Ze(o2,[["render",u2]]);const CE=Oe({name:"ElCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},disabled:Boolean,min:{type:Number,default:void 0},max:{type:Number,default:void 0},size:{type:String,validator:cl},fill:{type:String,default:void 0},textColor:{type:String,default:void 0},tag:{type:String,default:"div"}},emits:[En,"change"],setup(e,{emit:t,slots:n}){const{elFormItem:r}=_s(),i=vr(),o=Ct("checkbox"),s=u=>{t(En,u),yt(()=>{t("change",u)})},a=ne({get(){return e.modelValue},set(u){s(u)}});return Ot("CheckboxGroup",St(qe({name:"ElCheckboxGroup",modelValue:a},gs(e)),{checkboxGroupSize:i,changeEvent:s})),je(()=>e.modelValue,()=>{var u;(u=r.validate)==null||u.call(r,"change")}),()=>ot(e.tag,{class:o.b("group"),role:"group","aria-label":"checkbox-group"},[ke(n,"default")])}}),XB=un(i2,{CheckboxButton:EE,CheckboxGroup:CE});ti(EE);const ZB=ti(CE),TE=ct({size:ll,disabled:Boolean,label:{type:[String,Number,Boolean],default:""}}),l2=ct(St(qe({},TE),{modelValue:{type:[String,Number,Boolean],default:""},name:{type:String,default:""},border:Boolean})),SE={[En]:e=>lt(e)||gr(e)||ba(e),change:e=>lt(e)||gr(e)||ba(e)},RE=(e,t)=>{const n=re(),r=He(H0,void 0),i=ne(()=>!!r),o=ne({get(){return i.value?r.modelValue:e.modelValue},set(f){i.value?r.changeEvent(f):t(En,f),n.value.checked=e.modelValue===e.label}}),s=vr(ne(()=>r==null?void 0:r.size)),a=jh(ne(()=>r==null?void 0:r.disabled)),u=re(!1),d=ne(()=>a.value||i.value&&o.value!==e.label?-1:0);return{radioRef:n,isGroup:i,radioGroup:r,focus:u,size:s,disabled:a,tabIndex:d,modelValue:o}},d2=Oe({name:"ElRadio",props:l2,emits:SE,setup(e,{emit:t}){const n=Ct("radio"),{radioRef:r,isGroup:i,focus:o,size:s,disabled:a,tabIndex:u,modelValue:d}=RE(e,t);function f(){yt(()=>t("change",d.value))}return{ns:n,focus:o,isGroup:i,modelValue:d,tabIndex:u,size:s,disabled:a,radioRef:r,handleChange:f}}}),f2=["aria-checked","aria-disabled","tabindex"],h2=["value","name","disabled"];function p2(e,t,n,r,i,o){return ee(),Ce("label",{class:ue([e.ns.b(),e.ns.is("disabled",e.disabled),e.ns.is("focus",e.focus),e.ns.is("bordered",e.border),e.ns.is("checked",e.modelValue===e.label),e.ns.m(e.size)]),role:"radio","aria-checked":e.modelValue===e.label,"aria-disabled":e.disabled,tabindex:e.tabIndex,onKeydown:t[5]||(t[5]=Bo(Xn(s=>e.modelValue=e.disabled?e.modelValue:e.label,["stop","prevent"]),["space"]))},[ye("span",{class:ue([e.ns.e("input"),e.ns.is("disabled",e.disabled),e.ns.is("checked",e.modelValue===e.label)])},[ye("span",{class:ue(e.ns.e("inner"))},null,2),Dt(ye("input",{ref:"radioRef","onUpdate:modelValue":t[0]||(t[0]=s=>e.modelValue=s),class:ue(e.ns.e("original")),value:e.label,type:"radio","aria-hidden":"true",name:e.name,disabled:e.disabled,tabindex:"-1",onFocus:t[1]||(t[1]=s=>e.focus=!0),onBlur:t[2]||(t[2]=s=>e.focus=!1),onChange:t[3]||(t[3]=(...s)=>e.handleChange&&e.handleChange(...s))},null,42,h2),[[E0,e.modelValue]])],2),ye("span",{class:ue(e.ns.e("label")),onKeydown:t[4]||(t[4]=Xn(()=>{},["stop"]))},[ke(e.$slots,"default",{},()=>[Jr(Mt(e.label),1)])],34)],42,f2)}var g2=Ze(d2,[["render",p2]]);const m2=ct(St(qe({},TE),{name:{type:String,default:""}})),v2=Oe({name:"ElRadioButton",props:m2,setup(e,{emit:t}){const n=Ct("radio"),{radioRef:r,isGroup:i,focus:o,size:s,disabled:a,tabIndex:u,modelValue:d,radioGroup:f}=RE(e,t),c=ne(()=>({backgroundColor:(f==null?void 0:f.fill)||"",borderColor:(f==null?void 0:f.fill)||"",boxShadow:(f==null?void 0:f.fill)?`-1px 0 0 0 ${f.fill}`:"",color:(f==null?void 0:f.textColor)||""}));return{ns:n,isGroup:i,size:s,disabled:a,tabIndex:u,modelValue:d,focus:o,activeStyle:c,radioRef:r}}}),y2=["aria-checked","aria-disabled","tabindex"],_2=["value","name","disabled"];function E2(e,t,n,r,i,o){return ee(),Ce("label",{class:ue([e.ns.b("button"),e.ns.is("active",e.modelValue===e.label),e.ns.is("disabled",e.disabled),e.ns.is("focus",e.focus),e.ns.bm("button",e.size)]),role:"radio","aria-checked":e.modelValue===e.label,"aria-disabled":e.disabled,tabindex:e.tabIndex,onKeydown:t[4]||(t[4]=Bo(Xn(s=>e.modelValue=e.disabled?e.modelValue:e.label,["stop","prevent"]),["space"]))},[Dt(ye("input",{ref:"radioRef","onUpdate:modelValue":t[0]||(t[0]=s=>e.modelValue=s),class:ue(e.ns.be("button","original-radio")),value:e.label,type:"radio",name:e.name,disabled:e.disabled,tabindex:"-1",onFocus:t[1]||(t[1]=s=>e.focus=!0),onBlur:t[2]||(t[2]=s=>e.focus=!1)},null,42,_2),[[E0,e.modelValue]]),ye("span",{class:ue(e.ns.be("button","inner")),style:Nt(e.modelValue===e.label?e.activeStyle:{}),onKeydown:t[3]||(t[3]=Xn(()=>{},["stop"]))},[ke(e.$slots,"default",{},()=>[Jr(Mt(e.label),1)])],38)],42,y2)}var bE=Ze(v2,[["render",E2]]);const C2=ct({size:ll,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:""},fill:{type:String,default:""},textColor:{type:String,default:""}}),T2=SE,S2=Oe({name:"ElRadioGroup",props:C2,emits:T2,setup(e,t){const n=Ct("radio"),r=re(),{formItem:i}=Hh(),o=a=>{t.emit(En,a),yt(()=>t.emit("change",a))},s=a=>{if(!r.value)return;const u=a.target,d=u.nodeName==="INPUT"?"[type=radio]":"[role=radio]",f=r.value.querySelectorAll(d),c=f.length,l=Array.from(f).indexOf(u),h=r.value.querySelectorAll("[role=radio]");let p=null;switch(a.code){case st.left:case st.up:a.stopPropagation(),a.preventDefault(),p=l===0?c-1:l-1;break;case st.right:case st.down:a.stopPropagation(),a.preventDefault(),p=l===c-1?0:l+1;break}p!==null&&(h[p].click(),h[p].focus())};return $t(()=>{const a=r.value.querySelectorAll("[type=radio]"),u=a[0];!Array.from(a).some(d=>d.checked)&&u&&(u.tabIndex=0)}),Ot(H0,Hn(St(qe({},gs(e)),{changeEvent:o}))),je(()=>e.modelValue,()=>i==null?void 0:i.validate("change")),{ns:n,radioGroupRef:r,handleKeydown:s}}});function R2(e,t,n,r,i,o){return ee(),Ce("div",{ref:"radioGroupRef",class:ue(e.ns.b("group")),role:"radiogroup",onKeydown:t[0]||(t[0]=(...s)=>e.handleKeydown&&e.handleKeydown(...s))},[ke(e.$slots,"default")],34)}var IE=Ze(S2,[["render",R2]]);const eF=un(g2,{RadioButton:bE,RadioGroup:IE});ti(IE);ti(bE);const b2=ct({closable:Boolean,type:{type:String,values:["success","info","warning","danger",""],default:""},hit:Boolean,disableTransitions:Boolean,color:{type:String,default:""},size:{type:String,values:["large","default","small"]},effect:{type:String,values:["dark","light","plain"],default:"light"}}),I2={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},w2=Oe({name:"ElTag",components:{ElIcon:Bn,Close:al},props:b2,emits:I2,setup(e,{emit:t}){const n=vr(),r=Ct("tag"),i=ne(()=>{const{type:a,hit:u,effect:d,closable:f}=e;return[r.b(),r.is("closable",f),r.m(a),r.m(n.value),r.m(d),r.is("hit",u)]});return{ns:r,classes:i,handleClose:a=>{a.stopPropagation(),t("close",a)},handleClick:a=>{t("click",a)}}}});function O2(e,t,n,r,i,o){const s=Je("close"),a=Je("el-icon");return e.disableTransitions?(ee(),Ge(_r,{key:1,name:`${e.ns.namespace.value}-zoom-in-center`},{default:Le(()=>[ye("span",{class:ue(e.classes),style:Nt({backgroundColor:e.color}),onClick:t[1]||(t[1]=(...u)=>e.handleClick&&e.handleClick(...u))},[ye("span",{class:ue(e.ns.e("content"))},[ke(e.$slots,"default")],2),e.closable?(ee(),Ge(a,{key:0,class:ue(e.ns.e("close")),onClick:e.handleClose},{default:Le(()=>[Be(s)]),_:1},8,["class","onClick"])):Ve("v-if",!0)],6)]),_:3},8,["name"])):(ee(),Ce("span",{key:0,class:ue(e.classes),style:Nt({backgroundColor:e.color}),onClick:t[0]||(t[0]=(...u)=>e.handleClick&&e.handleClick(...u))},[ye("span",{class:ue(e.ns.e("content"))},[ke(e.$slots,"default")],2),e.closable?(ee(),Ge(a,{key:0,class:ue(e.ns.e("close")),onClick:e.handleClose},{default:Le(()=>[Be(s)]),_:1},8,["class","onClick"])):Ve("v-if",!0)],6))}var N2=Ze(w2,[["render",O2]]);const tF=un(N2),cf={},A2=ct({locale:{type:Qe(Object)},size:{type:String,values:["large","default","small"]},button:{type:Qe(Object)},message:{type:Qe(Object)},zIndex:{type:Number},namespace:{type:String,default:"el"}});var P2=Oe({name:"ElConfigProvider",props:A2,setup(e,{slots:t}){je(()=>e.message,r=>{Object.assign(cf,r!=null?r:{})},{immediate:!0,deep:!0});const n=ON(e);return()=>ke(t,"default",{config:n==null?void 0:n.value})}});const nF=un(P2),M2=ct({mask:{type:Boolean,default:!0},customMaskEvent:{type:Boolean,default:!1},overlayClass:{type:Qe([String,Array,Object])},zIndex:{type:Qe([String,Number])}}),L2={click:e=>e instanceof MouseEvent};var k2=Oe({name:"ElOverlay",props:M2,emits:L2,setup(e,{slots:t,emit:n}){const r=Ct("overlay"),i=u=>{n("click",u)},{onClick:o,onMousedown:s,onMouseup:a}=qh(e.customMaskEvent?void 0:i);return()=>e.mask?Be("div",{class:[r.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:o,onMousedown:s,onMouseup:a},[ke(t,"default")],Jc.STYLE|Jc.CLASS|Jc.PROPS,["onClick","onMouseup","onMousedown"]):ot("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[ke(t,"default")])}});const wE=k2,D2=ct({appendToBody:{type:Boolean,default:!1},beforeClose:{type:Qe(Function)},destroyOnClose:{type:Boolean,default:!1},center:{type:Boolean,default:!1},customClass:{type:String,default:""},closeIcon:{type:mo,default:""},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},title:{type:String,default:""},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:{type:Boolean,required:!0},modalClass:String,width:{type:[String,Number]},zIndex:{type:Number}}),U2={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[En]:e=>typeof e=="boolean"},$2=(e,{emit:t},n)=>{let r="";const i=re(!1),o=re(!1),s=re(!1),{nextZIndex:a}=Qa(),u=re(e.zIndex||a());let d,f;const c=ne(()=>gr(e.width)?`${e.width}px`:e.width),l=ne(()=>{const C={},w="--el-dialog";return e.fullscreen||(e.top&&(C[`${w}-margin-top`]=e.top),e.width&&(C[`${w}-width`]=c.value)),C});function h(){t("opened")}function p(){t("closed"),t(En,!1),e.destroyOnClose&&(s.value=!1)}function m(){t("close")}function v(){f==null||f(),d==null||d(),e.openDelay&&e.openDelay>0?{stop:d}=Qd(()=>T(),e.openDelay):T()}function _(){d==null||d(),f==null||f(),e.closeDelay&&e.closeDelay>0?{stop:f}=Qd(()=>R(),e.closeDelay):R()}function y(C){C||(o.value=!0,i.value=!1)}function E(){e.beforeClose?e.beforeClose(y):_()}function S(){e.closeOnClickModal&&E()}function T(){!Vt||(i.value=!0)}function R(){i.value=!1}return e.lockScroll&&Y0(i),e.closeOnPressEscape&&W0({handleClose:E},i),Q0(i),je(()=>e.modelValue,C=>{C?(o.value=!1,v(),s.value=!0,t("open"),u.value=e.zIndex?u.value++:a(),yt(()=>{n.value&&(n.value.scrollTop=0)})):i.value&&_()}),je(()=>e.fullscreen,C=>{!n.value||(C?(r=n.value.style.transform,n.value.style.transform=""):n.value.style.transform=r)}),$t(()=>{e.modelValue&&(i.value=!0,s.value=!0,v())}),{afterEnter:h,afterLeave:p,beforeLeave:m,handleClose:E,onModalClick:S,close:_,doClose:R,closed:o,style:l,rendered:s,visible:i,zIndex:u}},x2=Oe({name:"ElDialog",components:qe({ElOverlay:wE,ElIcon:Bn},EN),directives:{TrapFocus:tE},props:D2,emits:U2,setup(e,t){const n=Ct("dialog"),r=re(),i=re(),o=$2(e,t,r),s=qh(o.onModalClick),a=ne(()=>e.draggable&&!e.fullscreen);return G0(r,i,a),qe({ns:n,dialogRef:r,headerRef:i,overlayEvent:s},o)}}),B2=["aria-label"];function F2(e,t,n,r,i,o){const s=Je("el-icon"),a=Je("el-overlay"),u=c0("trap-focus");return ee(),Ge(s0,{to:"body",disabled:!e.appendToBody},[Be(_r,{name:"dialog-fade",onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave,onBeforeLeave:e.beforeLeave},{default:Le(()=>[Dt(Be(a,{"custom-mask-event":"",mask:e.modal,"overlay-class":e.modalClass,"z-index":e.zIndex},{default:Le(()=>[ye("div",{class:ue(`${e.ns.namespace.value}-overlay-dialog`),onClick:t[2]||(t[2]=(...d)=>e.overlayEvent.onClick&&e.overlayEvent.onClick(...d)),onMousedown:t[3]||(t[3]=(...d)=>e.overlayEvent.onMousedown&&e.overlayEvent.onMousedown(...d)),onMouseup:t[4]||(t[4]=(...d)=>e.overlayEvent.onMouseup&&e.overlayEvent.onMouseup(...d))},[Dt((ee(),Ce("div",{ref:"dialogRef",class:ue([e.ns.b(),e.ns.is("fullscreen",e.fullscreen),e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center},e.customClass]),"aria-modal":"true",role:"dialog","aria-label":e.title||"dialog",style:Nt(e.style),onClick:t[1]||(t[1]=Xn(()=>{},["stop"]))},[ye("div",{ref:"headerRef",class:ue(e.ns.e("header"))},[ke(e.$slots,"title",{},()=>[ye("span",{class:ue(e.ns.e("title"))},Mt(e.title),3)]),e.showClose?(ee(),Ce("button",{key:0,"aria-label":"close",class:ue(e.ns.e("headerbtn")),type:"button",onClick:t[0]||(t[0]=(...d)=>e.handleClose&&e.handleClose(...d))},[Be(s,{class:ue(e.ns.e("close"))},{default:Le(()=>[(ee(),Ge(dr(e.closeIcon||"close")))]),_:1},8,["class"])],2)):Ve("v-if",!0)],2),e.rendered?(ee(),Ce("div",{key:0,class:ue(e.ns.e("body"))},[ke(e.$slots,"default")],2)):Ve("v-if",!0),e.$slots.footer?(ee(),Ce("div",{key:1,class:ue(e.ns.e("footer"))},[ke(e.$slots,"footer")],2)):Ve("v-if",!0)],14,B2)),[[u]])],34)]),_:3},8,["mask","overlay-class","z-index"]),[[fr,e.visible]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"])}var V2=Ze(x2,[["render",F2]]);const rF=un(V2),OE=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},tv=(e,t)=>{for(const n of e)if(!j2(n,t))return n},j2=(e,t)=>{if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},H2=e=>{const t=OE(e),n=tv(t,e),r=tv(t.reverse(),e);return[n,r]},q2=e=>e instanceof HTMLInputElement&&"select"in e,Ki=(e,t)=>{if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&q2(e)&&t&&e.select()}};function nv(e,t){const n=[...e],r=e.indexOf(t);return r!==-1&&n.splice(r,1),n}const K2=()=>{let e=[];return{push:r=>{const i=e[0];i&&r!==i&&i.pause(),e=nv(e,r),e.unshift(r)},remove:r=>{var i,o;e=nv(e,r),(o=(i=e[0])==null?void 0:i.resume)==null||o.call(i)}}},G2=(e,t=!1)=>{const n=document.activeElement;for(const r of e)if(Ki(r,t),document.activeElement!==n)return},rv=K2(),Ql="focus-trap.focus-on-mount",Xl="focus-trap.focus-on-unmount",iv={cancelable:!0,bubbles:!1},ov="mountOnFocus",sv="unmountOnFocus",NE=Symbol("elFocusTrap"),z2=Oe({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean},emits:[ov,sv],setup(e,{emit:t}){const n=re(),r=re(null);let i,o;const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=l=>{if(!e.loop&&!e.trapped||s.paused)return;const{key:h,altKey:p,ctrlKey:m,metaKey:v,currentTarget:_,shiftKey:y}=l,{loop:E}=e,S=h===st.tab&&!p&&!m&&!v,T=document.activeElement;if(S&&T){const R=_,[C,w]=H2(R);C&&w?!y&&T===w?(l.preventDefault(),E&&Ki(C,!0)):y&&T===C&&(l.preventDefault(),E&&Ki(w,!0)):T===R&&l.preventDefault()}};Ot(NE,{focusTrapRef:r,onKeydown:a});const u=l=>{t(ov,l)},d=l=>t(sv,l),f=l=>{const h=he(r);if(s.paused||!h)return;const p=l.target;p&&h.contains(p)?o=p:Ki(o,!0)},c=l=>{const h=he(r);s.paused||!h||h.contains(l.relatedTarget)||Ki(o,!0)};return $t(()=>{const l=he(r);if(l){rv.push(s);const h=document.activeElement;if(i=h,!l.contains(h)){const m=new Event(Ql,iv);gi(l,Ql,u),l.dispatchEvent(m),m.defaultPrevented||(G2(OE(l),!0),document.activeElement===h&&Ki(l))}}je(()=>e.trapped,h=>{h?(gi(document,"focusin",f),gi(document,"focusout",c)):(mi(document,"focusin",f),mi(document,"focusout",c))},{immediate:!0})}),or(()=>{const l=he(r);if(l){mi(l,Ql,u);const h=new Event(Xl,iv);gi(l,Xl,d),l.dispatchEvent(h),h.defaultPrevented||Ki(i!=null?i:document.body,!0),mi(l,Xl,d),rv.remove(s)}}),{focusTrapRef:n,forwardRef:r,onKeydown:a}}});function Y2(e,t,n,r,i,o){return ke(e.$slots,"default")}var W2=Ze(z2,[["render",Y2]]);const J2=Oe({inheritAttrs:!1});function Q2(e,t,n,r,i,o){return ke(e.$slots,"default")}var X2=Ze(J2,[["render",Q2]]);const Z2=Oe({name:"ElCollectionItem",inheritAttrs:!1});function eL(e,t,n,r,i,o){return ke(e.$slots,"default")}var tL=Ze(Z2,[["render",eL]]);const AE="data-el-collection-item",PE=e=>{const t=`El${e}Collection`,n=`${t}Item`,r=Symbol(t),i=Symbol(n),o=St(qe({},X2),{name:t,setup(){const a=re(null),u=new Map;Ot(r,{itemMap:u,getItems:()=>{const f=he(a);if(!f)return[];const c=Array.from(f.querySelectorAll(`[${AE}]`));return[...u.values()].sort((p,m)=>c.indexOf(p.ref)-c.indexOf(m.ref))},collectionRef:a})}}),s=St(qe({},tL),{name:n,setup(a,{attrs:u}){const d=re(null),f=He(r,void 0);Ot(i,{collectionItemRef:d}),$t(()=>{const c=he(d);c&&f.itemMap.set(c,qe({ref:c},u))}),or(()=>{const c=he(d);f.itemMap.delete(c)})}});return{COLLECTION_INJECTION_KEY:r,COLLECTION_ITEM_INJECTION_KEY:i,ElCollection:o,ElCollectionItem:s}},nL=ct({style:{type:Qe([String,Array,Object])},currentTabId:{type:Qe(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:Qe(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:rL,ElCollectionItem:iL,COLLECTION_INJECTION_KEY:rp,COLLECTION_ITEM_INJECTION_KEY:oL}=PE("RovingFocusGroup"),ip=Symbol("elRovingFocusGroup"),ME=Symbol("elRovingFocusGroupItem"),sL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},aL=(e,t)=>{if(t!=="rtl")return e;switch(e){case st.right:return st.left;case st.left:return st.right;default:return e}},cL=(e,t,n)=>{const r=aL(e.key,n);if(!(t==="vertical"&&[st.left,st.right].includes(r))&&!(t==="horizontal"&&[st.up,st.down].includes(r)))return sL[r]},uL=(e,t)=>e.map((n,r)=>e[(r+t)%e.length]),op=e=>{const{activeElement:t}=document;for(const n of e)if(n===t||(n.focus(),t!==document.activeElement))return},av="currentTabIdChange",Zl="rovingFocusGroup.entryFocus",lL={bubbles:!1,cancelable:!0},dL=Oe({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:nL,emits:[av,"entryFocus"],setup(e,{emit:t}){var n;const r=re((n=e.currentTabId||e.defaultCurrentTabId)!=null?n:null),i=re(!1),o=re(!1),s=re(null),{getItems:a}=He(rp,void 0),u=ne(()=>[{outline:"none"},e.style]),d=m=>{t(av,m)},f=()=>{i.value=!0},c=kt(m=>{var v;(v=e.onMousedown)==null||v.call(e,m)},()=>{o.value=!0}),l=kt(m=>{var v;(v=e.onFocus)==null||v.call(e,m)},m=>{const v=!he(o),{target:_,currentTarget:y}=m;if(_===y&&v&&!he(i)){const E=new Event(Zl,lL);if(y==null||y.dispatchEvent(E),!E.defaultPrevented){const S=a().filter(L=>L.focusable),T=S.find(L=>L.active),R=S.find(L=>L.id===he(r)),w=[T,R,...S].filter(Boolean).map(L=>L.ref);op(w)}}o.value=!1}),h=kt(m=>{var v;(v=e.onBlur)==null||v.call(e,m)},()=>{i.value=!1}),p=(...m)=>{t("entryFocus",...m)};Ot(ip,{currentTabbedId:Ga(r),loop:xn(e,"loop"),tabIndex:ne(()=>he(i)?-1:0),rovingFocusGroupRef:s,rovingFocusGroupRootStyle:u,orientation:xn(e,"orientation"),dir:xn(e,"dir"),onItemFocus:d,onItemShiftTab:f,onBlur:h,onFocus:l,onMousedown:c}),je(()=>e.currentTabId,m=>{r.value=m!=null?m:null}),$t(()=>{const m=he(s);gi(m,Zl,p)}),or(()=>{const m=he(s);mi(m,Zl,p)})}});function fL(e,t,n,r,i,o){return ke(e.$slots,"default")}var hL=Ze(dL,[["render",fL]]);const pL=Oe({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:rL,ElRovingFocusGroupImpl:hL}});function gL(e,t,n,r,i,o){const s=Je("el-roving-focus-group-impl"),a=Je("el-focus-group-collection");return ee(),Ge(a,null,{default:Le(()=>[Be(s,IR(d0(e.$attrs)),{default:Le(()=>[ke(e.$slots,"default")]),_:3},16)]),_:3})}var mL=Ze(pL,[["render",gL]]);const vL=Oe({components:{ElRovingFocusCollectionItem:iL},props:{focusable:{type:Boolean,default:!0},active:{type:Boolean,default:!1}},emits:["mousedown","focus","keydown"],setup(e,{emit:t}){const{currentTabbedId:n,loop:r,onItemFocus:i,onItemShiftTab:o}=He(ip,void 0),{getItems:s}=He(rp,void 0),a=X0(),u=re(null),d=kt(h=>{t("mousedown",h)},h=>{e.focusable?i(he(a)):h.preventDefault()}),f=kt(h=>{t("focus",h)},()=>{i(he(a))}),c=kt(h=>{t("keydown",h)},h=>{const{key:p,shiftKey:m,target:v,currentTarget:_}=h;if(p===st.tab&&m){o();return}if(v!==_)return;const y=cL(h);if(y){h.preventDefault();let S=s().filter(T=>T.focusable).map(T=>T.ref);switch(y){case"last":{S.reverse();break}case"prev":case"next":{y==="prev"&&S.reverse();const T=S.indexOf(_);S=r.value?uL(S,T+1):S.slice(T+1);break}}yt(()=>{op(S)})}}),l=ne(()=>n.value===he(a));return Ot(ME,{rovingFocusGroupItemRef:u,tabIndex:ne(()=>he(l)?0:-1),handleMousedown:d,handleFocus:f,handleKeydown:c}),{id:a,handleKeydown:c,handleFocus:f,handleMousedown:d}}});function yL(e,t,n,r,i,o){const s=Je("el-roving-focus-collection-item");return ee(),Ge(s,{id:e.id,focusable:e.focusable,active:e.active},{default:Le(()=>[ke(e.$slots,"default")]),_:3},8,["id","focusable","active"])}var _L=Ze(vL,[["render",yL]]);const EL=ct({trigger:ep.trigger,effect:St(qe({},Zh.effect),{default:"light"}),type:{type:Qe(String)},placement:{type:Qe(String),default:"bottom"},popperOptions:{type:Qe(Object),default:()=>({})},size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Qe([Number,String]),default:0},maxHeight:{type:Qe([Number,String]),default:""},popperClass:{type:String,default:""}}),LE=ct({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:mo}}),CL=ct({onKeydown:{type:Qe(Function)}}),TL=[st.down,st.pageDown,st.home],kE=[st.up,st.pageUp,st.end],SL=[...TL,...kE],{ElCollection:RL,ElCollectionItem:bL,COLLECTION_INJECTION_KEY:IL,COLLECTION_ITEM_INJECTION_KEY:wL}=PE("Dropdown"),sp=Symbol("elDropdown"),{ButtonGroup:OL}=np,NL=Oe({name:"ElDropdown",components:{ElButton:np,ElFocusTrap:W2,ElButtonGroup:OL,ElScrollbar:RA,ElDropdownCollection:RL,ElTooltip:gM,ElRovingFocusGroup:mL,ElIcon:Bn,ArrowDown:sO},props:EL,emits:["visible-change","click","command"],setup(e,{emit:t}){const n=cn(),r=Ct("dropdown"),i=re(),o=re(),s=re(null),a=re(null),u=re(null),d=re(null),f=re(!1),c=ne(()=>({maxHeight:Ai(e.maxHeight)})),l=ne(()=>[r.m(v.value)]);function h(){p()}function p(){var w;(w=s.value)==null||w.onClose()}function m(){var w;(w=s.value)==null||w.onOpen()}const v=vr();function _(...w){t("command",...w)}function y(){}function E(){const w=he(a);w==null||w.focus(),d.value=null}function S(w){d.value=w}function T(w){f.value||(w.preventDefault(),w.stopImmediatePropagation())}return Ot(sp,{contentRef:a,isUsingKeyboard:f,onItemEnter:y,onItemLeave:E}),Ot("elDropdown",{instance:n,dropdownSize:v,handleClick:h,commandHandler:_,trigger:xn(e,"trigger"),hideOnClick:xn(e,"hideOnClick")}),{ns:r,scrollbar:u,wrapStyle:c,dropdownTriggerKls:l,dropdownSize:v,currentTabId:d,handleCurrentTabIdChange:S,handlerMainButtonClick:w=>{t("click",w)},handleEntryFocus:T,handleClose:p,handleOpen:m,onMountOnFocus:w=>{var L,V;w.preventDefault(),(V=(L=a.value)==null?void 0:L.focus)==null||V.call(L,{preventScroll:!0})},popperRef:s,triggeringElementRef:i,referenceElementRef:o}}});function AL(e,t,n,r,i,o){var s;const a=Je("el-dropdown-collection"),u=Je("el-roving-focus-group"),d=Je("el-focus-trap"),f=Je("el-scrollbar"),c=Je("el-tooltip"),l=Je("el-button"),h=Je("arrow-down"),p=Je("el-icon"),m=Je("el-button-group");return ee(),Ce("div",{class:ue(e.ns.b())},[Be(c,{ref:"popperRef",effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"hide-after":e.hideTimeout,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":(s=e.referenceElementRef)==null?void 0:s.$el,trigger:e.trigger,"show-after":e.showTimeout,"stop-popper-mouse-event":!1,"virtual-ref":e.triggeringElementRef,"virtual-triggering":e.splitButton,"append-to-body":"",pure:"",transition:`${e.ns.namespace.value}-zoom-in-top`,persistent:"",onShow:t[0]||(t[0]=v=>e.$emit("visible-change",!0)),onHide:t[1]||(t[1]=v=>e.$emit("visible-change",!1))},lI({content:Le(()=>[Be(f,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"ul","view-class":e.ns.e("list")},{default:Le(()=>[Be(d,{trapped:"",onMountOnFocus:e.onMountOnFocus},{default:Le(()=>[Be(u,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:Le(()=>[Be(a,null,{default:Le(()=>[ke(e.$slots,"dropdown")]),_:3})]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])]),_:3},8,["onMountOnFocus"])]),_:3},8,["wrap-style","view-class"])]),_:2},[e.splitButton?void 0:{name:"default",fn:Le(()=>[ye("div",{class:ue(e.dropdownTriggerKls)},[ke(e.$slots,"default")],2)])}]),1032,["effect","popper-options","hide-after","placement","popper-class","reference-element","trigger","show-after","virtual-ref","virtual-triggering","transition"]),e.splitButton?(ee(),Ge(m,{key:0},{default:Le(()=>[Be(l,{ref:"referenceElementRef",size:e.dropdownSize,type:e.type,onClick:e.handlerMainButtonClick},{default:Le(()=>[ke(e.$slots,"default")]),_:3},8,["size","type","onClick"]),Be(l,{ref:"triggeringElementRef",size:e.dropdownSize,type:e.type,class:ue(e.ns.e("caret-button"))},{default:Le(()=>[Be(p,{class:ue(e.ns.e("icon"))},{default:Le(()=>[Be(h)]),_:1},8,["class"])]),_:1},8,["size","type","class"])]),_:3})):Ve("v-if",!0)],2)}var PL=Ze(NL,[["render",AL]]);const ML=Oe({name:"DropdownItemImpl",components:{ElIcon:Bn},props:LE,emits:["pointermove","pointerleave","click"],setup(e,{emit:t}){const n=Ct("dropdown"),{collectionItemRef:r}=He(wL,void 0),{collectionItemRef:i}=He(oL,void 0),{rovingFocusGroupItemRef:o,tabIndex:s,handleFocus:a,handleKeydown:u,handleMousedown:d}=He(ME,void 0),f=x0(r,i,o),c=kt(l=>{const{code:h}=l;if(h===st.enter||h===st.space)return l.preventDefault(),l.stopImmediatePropagation(),t("click",l),!0},u);return{ns:n,itemRef:f,dataset:{[AE]:""},tabIndex:s,handleFocus:a,handleKeydown:c,handleMousedown:d}}}),LL=["aria-disabled","tabindex"];function kL(e,t,n,r,i,o){const s=Je("el-icon");return ee(),Ce(It,null,[e.divided?(ee(),Ce("div",Ar({key:0,class:e.ns.bem("menu","item","divided")},e.$attrs),null,16)):Ve("v-if",!0),ye("div",Ar({ref:e.itemRef},qe(qe({},e.dataset),e.$attrs),{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:"menuitem",onClick:t[0]||(t[0]=a=>e.$emit("click",a)),onFocus:t[1]||(t[1]=(...a)=>e.handleFocus&&e.handleFocus(...a)),onKeydown:t[2]||(t[2]=(...a)=>e.handleKeydown&&e.handleKeydown(...a)),onMousedown:t[3]||(t[3]=(...a)=>e.handleMousedown&&e.handleMousedown(...a)),onPointermove:t[4]||(t[4]=a=>e.$emit("pointermove",a)),onPointerleave:t[5]||(t[5]=a=>e.$emit("pointerleave",a))}),[e.icon?(ee(),Ge(s,{key:0},{default:Le(()=>[(ee(),Ge(dr(e.icon)))]),_:1})):Ve("v-if",!0),ke(e.$slots,"default")],16,LL)],64)}var DL=Ze(ML,[["render",kL]]);const DE=()=>{const e=He("elDropdown",{}),t=ne(()=>e==null?void 0:e.dropdownSize);return{elDropdown:e,_elDropdownSize:t}},UL=Oe({name:"ElDropdownItem",components:{ElDropdownCollectionItem:bL,ElRovingFocusItem:_L,ElDropdownItemImpl:DL},inheritAttrs:!1,props:LE,emits:["pointermove","pointerleave","click"],setup(e,{emit:t,attrs:n}){const{elDropdown:r}=DE(),i=cn(),o=re(null),s=ne(()=>{var h,p;return(p=(h=he(o))==null?void 0:h.textContent)!=null?p:""}),{onItemEnter:a,onItemLeave:u}=He(sp,void 0),d=kt(h=>(t("pointermove",h),h.defaultPrevented),Sm(h=>{var p;e.disabled?u(h):(a(h),h.defaultPrevented||(p=h.currentTarget)==null||p.focus())})),f=kt(h=>(t("pointerleave",h),h.defaultPrevented),Sm(h=>{u(h)})),c=kt(h=>(t("click",h),h.defaultPrevented),h=>{var p,m,v;if(e.disabled){h.stopImmediatePropagation();return}((p=r==null?void 0:r.hideOnClick)==null?void 0:p.value)&&((m=r.handleClick)==null||m.call(r)),(v=r.commandHandler)==null||v.call(r,e.command,i,h)}),l=ne(()=>qe(qe({},e),n));return{handleClick:c,handlePointerMove:d,handlePointerLeave:f,textContent:s,propsAndAttrs:l}}});function $L(e,t,n,r,i,o){var s;const a=Je("el-dropdown-item-impl"),u=Je("el-roving-focus-item"),d=Je("el-dropdown-collection-item");return ee(),Ge(d,{disabled:e.disabled,"text-value":(s=e.textValue)!=null?s:e.textContent},{default:Le(()=>[Be(u,{focusable:!e.disabled},{default:Le(()=>[Be(a,Ar(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClick:e.handleClick}),{default:Le(()=>[ke(e.$slots,"default")]),_:3},16,["onPointerleave","onPointermove","onClick"])]),_:3},8,["focusable"])]),_:3},8,["disabled","text-value"])}var UE=Ze(UL,[["render",$L]]);const xL=Oe({name:"ElDropdownMenu",props:CL,setup(e){const t=Ct("dropdown"),{_elDropdownSize:n}=DE(),r=n.value,{focusTrapRef:i,onKeydown:o}=He(NE,void 0),{contentRef:s}=He(sp,void 0),{collectionRef:a,getItems:u}=He(IL,void 0),{rovingFocusGroupRef:d,rovingFocusGroupRootStyle:f,tabIndex:c,onBlur:l,onFocus:h,onMousedown:p}=He(ip,void 0),{collectionRef:m}=He(rp,void 0),v=ne(()=>[t.b("menu"),t.bm("menu",r==null?void 0:r.value)]),_=x0(s,a,i,d,m),y=kt(S=>{var T;(T=e.onKeydown)==null||T.call(e,S)},S=>{const{currentTarget:T,code:R,target:C}=S;if(T.contains(C),st.tab===R&&S.stopImmediatePropagation(),S.preventDefault(),C!==he(s)||!SL.includes(R))return;const L=u().filter(V=>!V.disabled).map(V=>V.ref);kE.includes(R)&&L.reverse(),op(L)});return{size:r,rovingFocusGroupRootStyle:f,tabIndex:c,dropdownKls:v,dropdownListWrapperRef:_,handleKeydown:S=>{y(S),o(S)},onBlur:l,onFocus:h,onMousedown:p}}});function BL(e,t,n,r,i,o){return ee(),Ce("ul",{ref:e.dropdownListWrapperRef,class:ue(e.dropdownKls),style:Nt(e.rovingFocusGroupRootStyle),tabindex:-1,role:"menu",onBlur:t[0]||(t[0]=(...s)=>e.onBlur&&e.onBlur(...s)),onFocus:t[1]||(t[1]=(...s)=>e.onFocus&&e.onFocus(...s)),onKeydown:t[2]||(t[2]=(...s)=>e.handleKeydown&&e.handleKeydown(...s)),onMousedown:t[3]||(t[3]=(...s)=>e.onMousedown&&e.onMousedown(...s))},[ke(e.$slots,"default")],38)}var $E=Ze(xL,[["render",BL]]);const iF=un(PL,{DropdownItem:UE,DropdownMenu:$E}),oF=ti(UE),sF=ti($E);let FL=0;const VL=Oe({name:"ImgEmpty",setup(){return{id:++FL}}}),jL={viewBox:"0 0 79 86",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},HL=["id"],qL=ye("stop",{"stop-color":"var(--el-empty-fill-color-1)",offset:"0%"},null,-1),KL=ye("stop",{"stop-color":"var(--el-empty-fill-color-4)",offset:"100%"},null,-1),GL=[qL,KL],zL=["id"],YL=ye("stop",{"stop-color":"var(--el-empty-fill-color-1)",offset:"0%"},null,-1),WL=ye("stop",{"stop-color":"var(--el-empty-fill-color-6)",offset:"100%"},null,-1),JL=[YL,WL],QL=["id"],XL={id:"Illustrations",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},ZL={id:"B-type",transform:"translate(-1268.000000, -535.000000)"},ek={id:"Group-2",transform:"translate(1268.000000, 535.000000)"},tk=ye("path",{id:"Oval-Copy-2",d:"M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",fill:"var(--el-empty-fill-color-3)"},null,-1),nk=ye("polygon",{id:"Rectangle-Copy-14",fill:"var(--el-empty-fill-color-7)",transform:"translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",points:"13 58 53 58 42 45 2 45"},null,-1),rk={id:"Group-Copy",transform:"translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"},ik=ye("polygon",{id:"Rectangle-Copy-10",fill:"var(--el-empty-fill-color-7)",transform:"translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",points:"2.84078316e-14 3 18 3 23 7 5 7"},null,-1),ok=ye("polygon",{id:"Rectangle-Copy-11",fill:"var(--el-empty-fill-color-5)",points:"-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"},null,-1),sk=["fill"],ak=ye("polygon",{id:"Rectangle-Copy-13",fill:"var(--el-empty-fill-color-2)",transform:"translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",points:"24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"},null,-1),ck=["fill"],uk={id:"Rectangle-Copy-17",transform:"translate(53.000000, 45.000000)"},lk=["id"],dk=["xlink:href"],fk=["xlink:href"],hk=["mask"],pk=ye("polygon",{id:"Rectangle-Copy-18",fill:"var(--el-empty-fill-color-2)",transform:"translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",points:"62 45 79 45 70 58 53 58"},null,-1);function gk(e,t,n,r,i,o){return ee(),Ce("svg",jL,[ye("defs",null,[ye("linearGradient",{id:`linearGradient-1-${e.id}`,x1:"38.8503086%",y1:"0%",x2:"61.1496914%",y2:"100%"},GL,8,HL),ye("linearGradient",{id:`linearGradient-2-${e.id}`,x1:"0%",y1:"9.5%",x2:"100%",y2:"90.5%"},JL,8,zL),ye("rect",{id:`path-3-${e.id}`,x:"0",y:"0",width:"17",height:"36"},null,8,QL)]),ye("g",XL,[ye("g",ZL,[ye("g",ek,[tk,nk,ye("g",rk,[ik,ok,ye("rect",{id:"Rectangle-Copy-12",fill:`url(#linearGradient-1-${e.id})`,transform:"translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",x:"38",y:"7",width:"17",height:"36"},null,8,sk),ak]),ye("rect",{id:"Rectangle-Copy-15",fill:`url(#linearGradient-2-${e.id})`,x:"13",y:"45",width:"40",height:"36"},null,8,ck),ye("g",uk,[ye("mask",{id:`mask-4-${e.id}`,fill:"var(--el-empty-fill-color-0)"},[ye("use",{"xlink:href":`#path-3-${e.id}`},null,8,dk)],8,lk),ye("use",{id:"Mask",fill:"var(--el-empty-fill-color-8)",transform:"translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ","xlink:href":`#path-3-${e.id}`},null,8,fk),ye("polygon",{id:"Rectangle-Copy",fill:"var(--el-empty-fill-color-9)",mask:`url(#mask-4-${e.id})`,transform:"translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",points:"7 0 24 0 20 18 -1.70530257e-13 16"},null,8,hk)]),pk])])])])}var mk=Ze(VL,[["render",gk]]);const vk={image:{type:String,default:""},imageSize:Number,description:{type:String,default:""}},yk=Oe({name:"ElEmpty",components:{ImgEmpty:mk},props:vk,setup(e){const{t}=z0(),n=Ct("empty"),r=ne(()=>e.description||t("el.table.emptyText")),i=ne(()=>({width:e.imageSize?`${e.imageSize}px`:""}));return{ns:n,emptyDescription:r,imageStyle:i}}}),_k=["src"],Ek={key:1};function Ck(e,t,n,r,i,o){const s=Je("img-empty");return ee(),Ce("div",{class:ue(e.ns.b())},[ye("div",{class:ue(e.ns.e("image")),style:Nt(e.imageStyle)},[e.image?(ee(),Ce("img",{key:0,src:e.image,ondragstart:"return false"},null,8,_k)):ke(e.$slots,"image",{key:1},()=>[Be(s)])],6),ye("div",{class:ue(e.ns.e("description"))},[e.$slots.description?ke(e.$slots,"description",{key:0}):(ee(),Ce("p",Ek,Mt(e.emptyDescription),1))],2),e.$slots.default?(ee(),Ce("div",{key:0,class:ue(e.ns.e("bottom"))},[ke(e.$slots,"default")],2)):Ve("v-if",!0)],2)}var Tk=Ze(yk,[["render",Ck]]);const aF=un(Tk);function Sk(){const e=re([]),t=ne(()=>{if(!e.value.length)return"0";const o=Math.max(...e.value);return o?`${o}px`:""});function n(o){return e.value.indexOf(o)}function r(o,s){if(o&&s){const a=n(s);e.value.splice(a,1,o)}else o&&e.value.push(o)}function i(o){const s=n(o);s>-1&&e.value.splice(s,1)}return{autoLabelWidth:t,registerLabelWidth:r,deregisterLabelWidth:i}}const Rk=Oe({name:"ElForm",props:{model:Object,rules:Object,labelPosition:String,labelWidth:{type:[String,Number],default:""},labelSuffix:{type:String,default:""},inline:Boolean,inlineMessage:Boolean,statusIcon:Boolean,showMessage:{type:Boolean,default:!0},size:String,disabled:Boolean,validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1},scrollToError:Boolean},emits:["validate"],setup(e,{emit:t}){const n=[];je(()=>e.rules,()=>{n.forEach(p=>{p.evaluateValidationEnabled()}),e.validateOnRuleChange&&f(()=>({}))});const r=vr(),i="el-form",o=ne(()=>{const{labelPosition:p,inline:m}=e;return[i,`${i}--${r.value}`,p?`${i}--label-${p}`:"",m?`${i}--inline`:""]}),s=p=>{p&&n.push(p)},a=p=>{p.prop&&n.splice(n.indexOf(p),1)},u=()=>{!e.model||n.forEach(p=>{p.resetField()})},d=(p=[])=>{(p.length?typeof p=="string"?n.filter(v=>p===v.prop):n.filter(v=>p.indexOf(v.prop)>-1):n).forEach(v=>{v.clearValidate()})},f=p=>{if(!e.model)return;let m;typeof p!="function"&&(m=new Promise((S,T)=>{p=function(R,C){R?S(!0):T(C)}})),n.length===0&&p(!0);let v=!0,_=0,y={},E;for(const S of n)S.validate("",(T,R)=>{T&&(v=!1,E||(E=R)),y=qe(qe({},y),R),++_===n.length&&p(v,y)});return!v&&e.scrollToError&&l(Object.keys(E)[0]),m},c=(p,m)=>{p=[].concat(p);const v=n.filter(_=>p.indexOf(_.prop)!==-1);!n.length||v.forEach(_=>{_.validate("",m)})},l=p=>{n.forEach(m=>{var v,_;m.prop===p&&((_=(v=m.$el).scrollIntoView)==null||_.call(v))})},h=Hn(qe(St(qe({},gs(e)),{resetFields:u,clearValidate:d,validateField:c,emit:t,addField:s,removeField:a}),Sk()));return Ot(So,h),{formKls:o,validate:f,resetFields:u,clearValidate:d,validateField:c,scrollToField:l}}});function bk(e,t,n,r,i,o){return ee(),Ce("form",{class:ue(e.formKls)},[ke(e.$slots,"default")],2)}var Ik=Ze(Rk,[["render",bk]]);function no(){return no=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},no.apply(this,arguments)}function wk(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Na(e,t)}function uf(e){return uf=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},uf(e)}function Na(e,t){return Na=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Na(e,t)}function Ok(){if(typeof Reflect=="undefined"||!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 Xc(e,t,n){return Ok()?Xc=Reflect.construct:Xc=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),d=new u;return s&&Na(d,s.prototype),d},Xc.apply(null,arguments)}function Nk(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function lf(e){var t=typeof Map=="function"?new Map:void 0;return lf=function(r){if(r===null||!Nk(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return Xc(r,arguments,uf(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Na(i,r)},lf(e)}var Ak=/%[sdj%]/g,Pk=function(){};typeof process!="undefined"&&process.env;function df(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function $n(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=0,o=n.length;if(typeof e=="function")return e.apply(null,n);if(typeof e=="string"){var s=e.replace(Ak,function(a){if(a==="%%")return"%";if(i>=o)return a;switch(a){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return a}});return s}return e}function Mk(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function jt(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Mk(t)&&typeof e=="string"&&!e)}function Lk(e,t,n){var r=[],i=0,o=e.length;function s(a){r.push.apply(r,a||[]),i++,i===o&&n(r)}e.forEach(function(a){t(a,s)})}function cv(e,t,n){var r=0,i=e.length;function o(s){if(s&&s.length){n(s);return}var a=r;r=r+1,a<i?t(e[a],o):n([])}o([])}function kk(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,e[n]||[])}),t}var uv=function(e){wk(t,e);function t(n,r){var i;return i=e.call(this,"Async Validation Error")||this,i.errors=n,i.fields=r,i}return t}(lf(Error));function Dk(e,t,n,r,i){if(t.first){var o=new Promise(function(l,h){var p=function(_){return r(_),_.length?h(new uv(_,df(_))):l(i)},m=kk(e);cv(m,n,p)});return o.catch(function(l){return l}),o}var s=t.firstFields===!0?Object.keys(e):t.firstFields||[],a=Object.keys(e),u=a.length,d=0,f=[],c=new Promise(function(l,h){var p=function(v){if(f.push.apply(f,v),d++,d===u)return r(f),f.length?h(new uv(f,df(f))):l(i)};a.length||(r(f),l(i)),a.forEach(function(m){var v=e[m];s.indexOf(m)!==-1?cv(v,n,p):Lk(v,n,p)})});return c.catch(function(l){return l}),c}function Uk(e){return!!(e&&e.message!==void 0)}function $k(e,t){for(var n=e,r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function lv(e,t){return function(n){var r;return e.fullFields?r=$k(t,e.fullFields):r=t[n.field||e.fullField],Uk(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function dv(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];typeof r=="object"&&typeof e[n]=="object"?e[n]=no({},e[n],r):e[n]=r}}return e}var xE=function(t,n,r,i,o,s){t.required&&(!r.hasOwnProperty(t.field)||jt(n,s||t.type))&&i.push($n(o.messages.required,t.fullField))},xk=function(t,n,r,i,o){(/^\s+$/.test(n)||n==="")&&i.push($n(o.messages.whitespace,t.fullField))},ed={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Ws={integer:function(t){return Ws.number(t)&&parseInt(t,10)===t},float:function(t){return Ws.number(t)&&!Ws.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Ws.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(ed.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(ed.url)},hex:function(t){return typeof t=="string"&&!!t.match(ed.hex)}},Bk=function(t,n,r,i,o){if(t.required&&n===void 0){xE(t,n,r,i,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=t.type;s.indexOf(a)>-1?Ws[a](n)||i.push($n(o.messages.types[a],t.fullField,t.type)):a&&typeof n!==t.type&&i.push($n(o.messages.types[a],t.fullField,t.type))},Fk=function(t,n,r,i,o){var s=typeof t.len=="number",a=typeof t.min=="number",u=typeof t.max=="number",d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=n,c=null,l=typeof n=="number",h=typeof n=="string",p=Array.isArray(n);if(l?c="number":h?c="string":p&&(c="array"),!c)return!1;p&&(f=n.length),h&&(f=n.replace(d,"_").length),s?f!==t.len&&i.push($n(o.messages[c].len,t.fullField,t.len)):a&&!u&&f<t.min?i.push($n(o.messages[c].min,t.fullField,t.min)):u&&!a&&f>t.max?i.push($n(o.messages[c].max,t.fullField,t.max)):a&&u&&(f<t.min||f>t.max)&&i.push($n(o.messages[c].range,t.fullField,t.min,t.max))},Oo="enum",Vk=function(t,n,r,i,o){t[Oo]=Array.isArray(t[Oo])?t[Oo]:[],t[Oo].indexOf(n)===-1&&i.push($n(o.messages[Oo],t.fullField,t[Oo].join(", ")))},jk=function(t,n,r,i,o){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push($n(o.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var s=new RegExp(t.pattern);s.test(n)||i.push($n(o.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},rt={required:xE,whitespace:xk,type:Bk,range:Fk,enum:Vk,pattern:jk},Hk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n,"string")&&!t.required)return r();rt.required(t,n,i,s,o,"string"),jt(n,"string")||(rt.type(t,n,i,s,o),rt.range(t,n,i,s,o),rt.pattern(t,n,i,s,o),t.whitespace===!0&&rt.whitespace(t,n,i,s,o))}r(s)},qk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n)&&!t.required)return r();rt.required(t,n,i,s,o),n!==void 0&&rt.type(t,n,i,s,o)}r(s)},Kk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(n===""&&(n=void 0),jt(n)&&!t.required)return r();rt.required(t,n,i,s,o),n!==void 0&&(rt.type(t,n,i,s,o),rt.range(t,n,i,s,o))}r(s)},Gk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n)&&!t.required)return r();rt.required(t,n,i,s,o),n!==void 0&&rt.type(t,n,i,s,o)}r(s)},zk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n)&&!t.required)return r();rt.required(t,n,i,s,o),jt(n)||rt.type(t,n,i,s,o)}r(s)},Yk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n)&&!t.required)return r();rt.required(t,n,i,s,o),n!==void 0&&(rt.type(t,n,i,s,o),rt.range(t,n,i,s,o))}r(s)},Wk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n)&&!t.required)return r();rt.required(t,n,i,s,o),n!==void 0&&(rt.type(t,n,i,s,o),rt.range(t,n,i,s,o))}r(s)},Jk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(n==null&&!t.required)return r();rt.required(t,n,i,s,o,"array"),n!=null&&(rt.type(t,n,i,s,o),rt.range(t,n,i,s,o))}r(s)},Qk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n)&&!t.required)return r();rt.required(t,n,i,s,o),n!==void 0&&rt.type(t,n,i,s,o)}r(s)},Xk="enum",Zk=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n)&&!t.required)return r();rt.required(t,n,i,s,o),n!==void 0&&rt[Xk](t,n,i,s,o)}r(s)},eD=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n,"string")&&!t.required)return r();rt.required(t,n,i,s,o),jt(n,"string")||rt.pattern(t,n,i,s,o)}r(s)},tD=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n,"date")&&!t.required)return r();if(rt.required(t,n,i,s,o),!jt(n,"date")){var u;n instanceof Date?u=n:u=new Date(n),rt.type(t,u,i,s,o),u&&rt.range(t,u.getTime(),i,s,o)}}r(s)},nD=function(t,n,r,i,o){var s=[],a=Array.isArray(n)?"array":typeof n;rt.required(t,n,i,s,o,a),r(s)},td=function(t,n,r,i,o){var s=t.type,a=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(jt(n,s)&&!t.required)return r();rt.required(t,n,i,a,o,s),jt(n,s)||rt.type(t,n,i,a,o)}r(a)},rD=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(jt(n)&&!t.required)return r();rt.required(t,n,i,s,o)}r(s)},aa={string:Hk,method:qk,number:Kk,boolean:Gk,regexp:zk,integer:Yk,float:Wk,array:Jk,object:Qk,enum:Zk,pattern:eD,date:tD,url:td,hex:td,email:td,required:nD,any:rD};function ff(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var hf=ff(),ec=function(){function e(n){this.rules=null,this._messages=hf,this.define(n)}var t=e.prototype;return t.define=function(r){var i=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(o){var s=r[o];i.rules[o]=Array.isArray(s)?s:[s]})},t.messages=function(r){return r&&(this._messages=dv(ff(),r)),this._messages},t.validate=function(r,i,o){var s=this;i===void 0&&(i={}),o===void 0&&(o=function(){});var a=r,u=i,d=o;if(typeof u=="function"&&(d=u,u={}),!this.rules||Object.keys(this.rules).length===0)return d&&d(null,a),Promise.resolve(a);function f(m){var v=[],_={};function y(S){if(Array.isArray(S)){var T;v=(T=v).concat.apply(T,S)}else v.push(S)}for(var E=0;E<m.length;E++)y(m[E]);v.length?(_=df(v),d(v,_)):d(null,a)}if(u.messages){var c=this.messages();c===hf&&(c=ff()),dv(c,u.messages),u.messages=c}else u.messages=this.messages();var l={},h=u.keys||Object.keys(this.rules);h.forEach(function(m){var v=s.rules[m],_=a[m];v.forEach(function(y){var E=y;typeof E.transform=="function"&&(a===r&&(a=no({},a)),_=a[m]=E.transform(_)),typeof E=="function"?E={validator:E}:E=no({},E),E.validator=s.getValidationMethod(E),!!E.validator&&(E.field=m,E.fullField=E.fullField||m,E.type=s.getType(E),l[m]=l[m]||[],l[m].push({rule:E,value:_,source:a,field:m}))})});var p={};return Dk(l,u,function(m,v){var _=m.rule,y=(_.type==="object"||_.type==="array")&&(typeof _.fields=="object"||typeof _.defaultField=="object");y=y&&(_.required||!_.required&&m.value),_.field=m.field;function E(R,C){return no({},C,{fullField:_.fullField+"."+R,fullFields:_.fullFields?[].concat(_.fullFields,[R]):[R]})}function S(R){R===void 0&&(R=[]);var C=Array.isArray(R)?R:[R];!u.suppressWarning&&C.length&&e.warning("async-validator:",C),C.length&&_.message!==void 0&&(C=[].concat(_.message));var w=C.map(lv(_,a));if(u.first&&w.length)return p[_.field]=1,v(w);if(!y)v(w);else{if(_.required&&!m.value)return _.message!==void 0?w=[].concat(_.message).map(lv(_,a)):u.error&&(w=[u.error(_,$n(u.messages.required,_.field))]),v(w);var L={};_.defaultField&&Object.keys(m.value).map(function(I){L[I]=_.defaultField}),L=no({},L,m.rule.fields);var V={};Object.keys(L).forEach(function(I){var N=L[I],A=Array.isArray(N)?N:[N];V[I]=A.map(E.bind(null,I))});var b=new e(V);b.messages(u.messages),m.rule.options&&(m.rule.options.messages=u.messages,m.rule.options.error=u.error),b.validate(m.value,m.rule.options||u,function(I){var N=[];w&&w.length&&N.push.apply(N,w),I&&I.length&&N.push.apply(N,I),v(N.length?N:null)})}}var T;_.asyncValidator?T=_.asyncValidator(_,m.value,S,m.source,u):_.validator&&(T=_.validator(_,m.value,S,m.source,u),T===!0?S():T===!1?S(typeof _.message=="function"?_.message(_.fullField||_.field):_.message||(_.fullField||_.field)+" fails"):T instanceof Array?S(T):T instanceof Error&&S(T.message)),T&&T.then&&T.then(function(){return S()},function(R){return S(R)})},function(m){f(m)},a)},t.getType=function(r){if(r.type===void 0&&r.pattern instanceof RegExp&&(r.type="pattern"),typeof r.validator!="function"&&r.type&&!aa.hasOwnProperty(r.type))throw new Error($n("Unknown rule type %s",r.type));return r.type||"string"},t.getValidationMethod=function(r){if(typeof r.validator=="function")return r.validator;var i=Object.keys(r),o=i.indexOf("message");return o!==-1&&i.splice(o,1),i.length===1&&i[0]==="required"?aa.required:aa[this.getType(r)]||void 0},e}();ec.register=function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");aa[t]=n};ec.warning=Pk;ec.messages=hf;ec.validators=aa;var iD=Oe({name:"ElLabelWrap",props:{isAutoWidth:Boolean,updateAll:Boolean},setup(e,{slots:t}){const n=re(null),r=He(So),i=He(Ja),o=re(0);je(o,(f,c)=>{e.updateAll&&(r.registerLabelWidth(f,c),i.updateComputedLabelWidth(f))});const s=()=>{var f;if((f=n.value)==null?void 0:f.firstElementChild){const c=window.getComputedStyle(n.value.firstElementChild).width;return Math.ceil(parseFloat(c))}else return 0},a=(f="update")=>{yt(()=>{t.default&&e.isAutoWidth&&(f==="update"?o.value=s():f==="remove"&&r.deregisterLabelWidth(o.value))})},u=()=>a("update");$t(()=>{Jw(n.value.firstElementChild,u),u()}),za(u),or(()=>{var f;a("remove"),Qw((f=n.value)==null?void 0:f.firstElementChild,u)});function d(){var f,c;if(!t)return null;if(e.isAutoWidth){const l=r.autoLabelWidth,h={};if(l&&l!=="auto"){const p=Math.max(0,parseInt(l,10)-o.value),m=r.labelPosition==="left"?"marginRight":"marginLeft";p&&(h[m]=`${p}px`)}return ot("div",{ref:n,class:["el-form-item__label-wrap"],style:h},(f=t.default)==null?void 0:f.call(t))}else return ot(It,{ref:n},(c=t.default)==null?void 0:c.call(t))}return d}});const oD=Oe({name:"ElFormItem",componentName:"ElFormItem",components:{LabelWrap:iD},props:{label:String,labelWidth:{type:[String,Number],default:""},prop:String,required:{type:Boolean,default:void 0},rules:[Object,Array],error:String,validateStatus:String,for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:{type:String,validator:cl}},setup(e,{slots:t}){const n=He(So,{}),r=re(""),i=re(""),o=re(!1),s=re(""),a=re(),u=cn(),d=ne(()=>{let I=u.parent;for(;I&&I.type.name!=="ElForm";){if(I.type.name==="ElFormItem")return!0;I=I.parent}return!1});let f;je(()=>e.error,I=>{i.value=I,r.value=I?"error":""},{immediate:!0}),je(()=>e.validateStatus,I=>{r.value=I});const c=ne(()=>e.for||e.prop),l=ne(()=>{const I={};if(n.labelPosition==="top")return I;const N=Ai(e.labelWidth||n.labelWidth);return N&&(I.width=N),I}),h=ne(()=>{const I={};if(n.labelPosition==="top"||n.inline||!e.label&&!e.labelWidth&&d.value)return I;const N=Ai(e.labelWidth||n.labelWidth);return!e.label&&!t.label&&(I.marginLeft=N),I}),p=ne(()=>{const I=n.model;if(!I||!e.prop)return;let N=e.prop;return N.indexOf(":")!==-1&&(N=N.replace(/:/,".")),zl(I,N,!0).v}),m=ne(()=>{const I=S();let N=!1;return I&&I.length&&I.every(A=>A.required?(N=!0,!1):!0),N}),v=vr(void 0,{formItem:!1}),_=(I,N=Ut)=>{if(!o.value){N();return}const A=T(I);if((!A||A.length===0)&&e.required===void 0){N();return}r.value="validating";const M={};A&&A.length>0&&A.forEach(q=>{delete q.trigger}),M[e.prop]=A;const $=new ec(M),x={};x[e.prop]=p.value,$.validate(x,{firstFields:!0},(q,Z)=>{var le;r.value=q?"error":"success",i.value=q?q[0].message||`${e.prop} is required`:"",N(i.value,q?Z:{}),(le=n.emit)==null||le.call(n,"validate",e.prop,!q,i.value||null)})},y=()=>{r.value="",i.value=""},E=()=>{const I=n.model,N=p.value;let A=e.prop;A.indexOf(":")!==-1&&(A=A.replace(/:/,"."));const M=zl(I,A,!0);Array.isArray(N)?M.o[M.k]=[].concat(f):M.o[M.k]=f,yt(()=>{y()})},S=()=>{const I=n.rules,N=e.rules,A=e.required!==void 0?{required:!!e.required}:[],M=zl(I,e.prop||"",!1),$=I?M.o[e.prop||""]||M.v:[];return[].concat(N||$||[]).concat(A)},T=I=>S().filter(A=>!A.trigger||I===""?!0:Array.isArray(A.trigger)?A.trigger.indexOf(I)>-1:A.trigger===I).map(A=>qe({},A)),R=()=>{var I;o.value=!!((I=S())==null?void 0:I.length)},C=I=>{s.value=I?`${I}px`:""},w=Hn(St(qe({},gs(e)),{size:v,validateState:r,$el:a,evaluateValidationEnabled:R,resetField:E,clearValidate:y,validate:_,updateComputedLabelWidth:C}));$t(()=>{if(e.prop){n==null||n.addField(w);const I=p.value;f=Array.isArray(I)?[...I]:I,R()}}),or(()=>{n==null||n.removeField(w)}),Ot(Ja,w);const L=ne(()=>[{"el-form-item--feedback":n.statusIcon,"is-error":r.value==="error","is-validating":r.value==="validating","is-success":r.value==="success","is-required":m.value||e.required,"is-no-asterisk":n.hideRequiredAsterisk},v.value?`el-form-item--${v.value}`:""]),V=ne(()=>r.value==="error"&&e.showMessage&&n.showMessage),b=ne(()=>(e.label||"")+(n.labelSuffix||""));return{formItemRef:a,formItemClass:L,shouldShowError:V,elForm:n,labelStyle:l,contentStyle:h,validateMessage:i,labelFor:c,resetField:E,clearValidate:y,currentLabel:b}}}),sD=["for"];function aD(e,t,n,r,i,o){const s=Je("LabelWrap");return ee(),Ce("div",{ref:"formItemRef",class:ue(["el-form-item",e.formItemClass])},[Be(s,{"is-auto-width":e.labelStyle.width==="auto","update-all":e.elForm.labelWidth==="auto"},{default:Le(()=>[e.label||e.$slots.label?(ee(),Ce("label",{key:0,for:e.labelFor,class:"el-form-item__label",style:Nt(e.labelStyle)},[ke(e.$slots,"label",{label:e.currentLabel},()=>[Jr(Mt(e.currentLabel),1)])],12,sD)):Ve("v-if",!0)]),_:3},8,["is-auto-width","update-all"]),ye("div",{class:"el-form-item__content",style:Nt(e.contentStyle)},[ke(e.$slots,"default"),Be(_r,{name:"el-zoom-in-top"},{default:Le(()=>[e.shouldShowError?ke(e.$slots,"error",{key:0,error:e.validateMessage},()=>[ye("div",{class:ue(["el-form-item__error",{"el-form-item__error--inline":typeof e.inlineMessage=="boolean"?e.inlineMessage:e.elForm.inlineMessage||!1}])},Mt(e.validateMessage),3)]):Ve("v-if",!0)]),_:3})],4)],2)}var BE=Ze(oD,[["render",aD]]);const cF=un(Ik,{FormItem:BE}),uF=ti(BE),cD=ct({tabs:{type:Qe(Array),default:()=>Vh([])}}),fv="ElTabBar",uD=Oe({name:fv,props:cD,setup(e){const t=cn(),n=He(ul);n||vs(fv,"must use with ElTabs");const r=re(),i=re(),o=()=>{let a=0,u=0;const d=["top","bottom"].includes(n.props.tabPosition)?"width":"height",f=d==="width"?"x":"y";return e.tabs.every(c=>{var l,h,p,m;const v=(h=(l=t.parent)==null?void 0:l.refs)==null?void 0:h[`tab-${c.paneName}`];if(!v)return!1;if(!c.active)return!0;u=v[`client${ur(d)}`];const _=f==="x"?"left":"top";a=v.getBoundingClientRect()[_]-((m=(p=v.parentElement)==null?void 0:p.getBoundingClientRect()[_])!=null?m:0);const y=window.getComputedStyle(v);return d==="width"&&(e.tabs.length>1&&(u-=parseFloat(y.paddingLeft)+parseFloat(y.paddingRight)),a+=parseFloat(y.paddingLeft)),!1}),{[d]:`${u}px`,transform:`translate${ur(f)}(${a}px)`}},s=()=>i.value=o();return je(()=>e.tabs,async()=>{await yt(),s()},{immediate:!0}),Fh(r,()=>s()),{bar$:r,rootTabs:n,barStyle:i,update:s}}});function lD(e,t,n,r,i,o){return ee(),Ce("div",{ref:"bar$",class:ue(["el-tabs__active-bar",`is-${e.rootTabs.props.tabPosition}`]),style:Nt(e.barStyle)},null,6)}var dD=Ze(uD,[["render",lD]]);const fD=ct({panes:{type:Qe(Array),default:()=>Vh([])},currentName:{type:[String,Number],default:""},editable:Boolean,onTabClick:{type:Qe(Function),default:Ut},onTabRemove:{type:Qe(Function),default:Ut},type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),hv="ElTabNav";var hD=Oe({name:hv,props:fD,setup(e,{expose:t}){const n=Bw(),r=Yw(),i=He(ul);i||vs(hv,"ElTabNav must be nested inside ElTabs");const o=re(!1),s=re(0),a=re(!1),u=re(!0),d=re(),f=re(),c=re(),l=ne(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),h=ne(()=>({transform:`translate${l.value==="width"?"X":"Y"}(-${s.value}px)`})),p=()=>{if(!d.value)return;const T=d.value[`offset${ur(l.value)}`],R=s.value;if(!R)return;const C=R>T?R-T:0;s.value=C},m=()=>{if(!d.value||!f.value)return;const T=f.value[`offset${ur(l.value)}`],R=d.value[`offset${ur(l.value)}`],C=s.value;if(T-C<=R)return;const w=T-C>R*2?C+R:T-R;s.value=w},v=()=>{const T=f.value;if(!o.value||!c.value||!d.value||!T)return;const R=c.value.querySelector(".is-active");if(!R)return;const C=d.value,w=["top","bottom"].includes(i.props.tabPosition),L=R.getBoundingClientRect(),V=C.getBoundingClientRect(),b=w?T.offsetWidth-V.width:T.offsetHeight-V.height,I=s.value;let N=I;w?(L.left<V.left&&(N=I-(V.left-L.left)),L.right>V.right&&(N=I+L.right-V.right)):(L.top<V.top&&(N=I-(V.top-L.top)),L.bottom>V.bottom&&(N=I+(L.bottom-V.bottom))),N=Math.max(N,0),s.value=Math.min(N,b)},_=()=>{if(!f.value||!d.value)return;const T=f.value[`offset${ur(l.value)}`],R=d.value[`offset${ur(l.value)}`],C=s.value;if(R<T){const w=s.value;o.value=o.value||{},o.value.prev=w,o.value.next=w+R<T,T-w<R&&(s.value=T-R)}else o.value=!1,C>0&&(s.value=0)},y=T=>{const R=T.code,{up:C,down:w,left:L,right:V}=st;if(![C,w,L,V].includes(R))return;const b=Array.from(T.currentTarget.querySelectorAll("[role=tab]")),I=b.indexOf(T.target);let N;R===L||R===C?I===0?N=b.length-1:N=I-1:I<b.length-1?N=I+1:N=0,b[N].focus(),b[N].click(),E()},E=()=>{u.value&&(a.value=!0)},S=()=>a.value=!1;return je(n,T=>{T==="hidden"?u.value=!1:T==="visible"&&setTimeout(()=>u.value=!0,50)}),je(r,T=>{T?setTimeout(()=>u.value=!0,50):u.value=!1}),Fh(c,_),$t(()=>setTimeout(()=>v(),0)),za(()=>_()),t({scrollToActiveTab:v,removeFocus:S}),()=>{const T=o.value?[ot("span",{class:["el-tabs__nav-prev",o.value.prev?"":"is-disabled"],onClick:p},[ot(Bn,{},{default:()=>ot(fO)})]),ot("span",{class:["el-tabs__nav-next",o.value.next?"":"is-disabled"],onClick:m},[ot(Bn,{},{default:()=>ot(yO)})])]:null,R=e.panes.map((C,w)=>{var L,V;const b=C.props.name||C.index||`${w}`,I=C.isClosable||e.editable;C.index=`${w}`;const N=I?ot(Bn,{class:"is-icon-close",onClick:$=>e.onTabRemove(C,$)},{default:()=>ot(al)}):null,A=((V=(L=C.instance.slots).label)==null?void 0:V.call(L))||C.props.label,M=C.active?0:-1;return ot("div",{class:{"el-tabs__item":!0,[`is-${i.props.tabPosition}`]:!0,"is-active":C.active,"is-disabled":C.props.disabled,"is-closable":I,"is-focus":a},id:`tab-${b}`,key:`tab-${b}`,"aria-controls":`pane-${b}`,role:"tab","aria-selected":C.active,ref:`tab-${b}`,tabindex:M,onFocus:()=>E(),onBlur:()=>S(),onClick:$=>{S(),e.onTabClick(C,b,$)},onKeydown:$=>{I&&($.code===st.delete||$.code===st.backspace)&&e.onTabRemove(C,$)}},[A,N])});return ot("div",{ref:c,class:["el-tabs__nav-wrap",o.value?"is-scrollable":"",`is-${i.props.tabPosition}`]},[T,ot("div",{class:"el-tabs__nav-scroll",ref:d},[ot("div",{class:["el-tabs__nav",`is-${i.props.tabPosition}`,e.stretch&&["top","bottom"].includes(i.props.tabPosition)?"is-stretch":""],ref:f,style:h.value,role:"tablist",onKeydown:y},[e.type?null:ot(dD,{tabs:[...e.panes]}),R])])])}}});const pD=ct({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:String,default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number],default:""},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Qe(Function),default:()=>!0},stretch:Boolean}),gD={[En]:e=>typeof e=="string"||typeof e=="number",[B0]:e=>typeof e=="string"||typeof e=="number","tab-click":(e,t)=>t instanceof Event,edit:(e,t)=>t==="remove"||t==="add","tab-remove":e=>typeof e=="string"||typeof e=="number","tab-add":()=>!0},FE=(e,t=[])=>{const n=e.children||[];return Array.from(n).forEach(r=>{let i=r.type;i=i.name||i,i==="ElTabPane"&&r.component?t.push(r.component):(i===It||i==="template")&&FE(r,t)}),t};var mD=Oe({name:"ElTabs",props:pD,emits:gD,setup(e,{emit:t,slots:n,expose:r}){const i=cn(),o=re(),s=re([]),a=re(e.modelValue||e.activeName||"0"),u={},d=(m=!1)=>{if(n.default){const v=i.subTree.children,_=Array.from(v).find(({props:S})=>(S==null?void 0:S.class)==="el-tabs__content");if(!_)return;const y=FE(_).map(S=>u[S.uid]),E=!(y.length===s.value.length&&y.every((S,T)=>S.uid===s.value[T].uid));(m||E)&&(s.value=y)}else s.value.length!==0&&(s.value=[])},f=m=>{a.value=m,t(B0,m),t(En,m)},c=m=>{var v;if(a.value===m)return;const _=(v=e.beforeLeave)==null?void 0:v.call(e,m,a.value);ph(_)?_.then(()=>{var y,E;f(m),(E=(y=o.value)==null?void 0:y.removeFocus)==null||E.call(y)},Ut):_!==!1&&f(m)},l=(m,v,_)=>{m.props.disabled||(c(v),t("tab-click",m,_))},h=(m,v)=>{m.props.disabled||(v.stopPropagation(),t("edit",m.props.name,"remove"),t("tab-remove",m.props.name))},p=()=>{t("edit",null,"add"),t("tab-add")};return za(()=>d()),$t(()=>d()),je(()=>e.activeName,m=>c(m)),je(()=>e.modelValue,m=>c(m)),je(a,async()=>{var m,v;d(!0),await yt(),await((m=o.value)==null?void 0:m.$nextTick()),(v=o.value)==null||v.scrollToActiveTab()}),Ot(ul,{props:e,currentName:a,updatePaneState:m=>u[m.uid]=m}),r({currentName:a}),()=>{const m=e.editable||e.addable?ot("span",{class:"el-tabs__new-tab",tabindex:"0",onClick:p,onKeydown:y=>{y.code===st.enter&&p()}},[ot(Bn,{class:"is-icon-plus"},{default:()=>ot(rN)})]):null,v=ot("div",{class:["el-tabs__header",`is-${e.tabPosition}`]},[m,ot(hD,{currentName:a.value,editable:e.editable,type:e.type,panes:s.value,stretch:e.stretch,ref:o,onTabClick:l,onTabRemove:h})]),_=ot("div",{class:"el-tabs__content"},[ke(n,"default")]);return ot("div",{class:{"el-tabs":!0,"el-tabs--card":e.type==="card",[`el-tabs--${e.tabPosition}`]:!0,"el-tabs--border-card":e.type==="border-card"}},e.tabPosition!=="bottom"?[v,_]:[_,v])}}});const vD=ct({label:{type:String,default:""},name:{type:[String,Number],default:""},closable:Boolean,disabled:Boolean,lazy:Boolean}),pv="ElTabPane",yD=Oe({name:pv,props:vD,setup(e){const t=cn(),n=He(ul);n||vs(pv,"must use with ElTabs");const r=re(),i=re(!1),o=ne(()=>e.closable||n.props.closable),s=Im(()=>n.currentName.value===(e.name||r.value)),a=ne(()=>e.name||r.value),u=Im(()=>!e.lazy||i.value||s.value);return je(s,d=>{d&&(i.value=!0)}),n.updatePaneState(Hn({uid:t.uid,instance:Th(t),props:e,paneName:a,active:s,index:r,isClosable:o})),{active:s,paneName:a,shouldBeRender:u}}}),_D=["id","aria-hidden","aria-labelledby"];function ED(e,t,n,r,i,o){return e.shouldBeRender?Dt((ee(),Ce("div",{key:0,id:`pane-${e.paneName}`,class:"el-tab-pane",role:"tabpanel","aria-hidden":!e.active,"aria-labelledby":`tab-${e.paneName}`},[ke(e.$slots,"default")],8,_D)),[[fr,e.active]]):Ve("v-if",!0)}var VE=Ze(yD,[["render",ED]]);const lF=un(mD,{TabPane:VE}),dF=ti(VE);function CD(e){let t;const n=re(!1),r=Hn(St(qe({},e),{originalPosition:"",originalOverflow:"",visible:!1}));function i(c){r.text=c}function o(){const c=r.parent;if(!c.vLoadingAddClassList){let l=c.getAttribute("loading-number");l=Number.parseInt(l)-1,l?c.setAttribute("loading-number",l.toString()):(Ia(c,"el-loading-parent--relative"),c.removeAttribute("loading-number")),Ia(c,"el-loading-parent--hidden")}s()}function s(){var c,l;(l=(c=f.$el)==null?void 0:c.parentNode)==null||l.removeChild(f.$el)}function a(){var c;if(e.beforeClose&&!e.beforeClose())return;const l=r.parent;l.vLoadingAddClassList=void 0,n.value=!0,clearTimeout(t),t=window.setTimeout(()=>{n.value&&(n.value=!1,o())},400),r.visible=!1,(c=e.closed)==null||c.call(e)}function u(){!n.value||(n.value=!1,o())}const f=JI({name:"ElLoading",setup(){return()=>{const c=r.spinner||r.svg,l=ot("svg",qe({class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"25 25 50 50"},c?{innerHTML:c}:{}),[ot("circle",{class:"path",cx:"50",cy:"50",r:"20",fill:"none"})]),h=r.text?ot("p",{class:"el-loading-text"},[r.text]):void 0;return ot(_r,{name:"el-loading-fade",onAfterLeave:u},{default:Le(()=>[Dt(Be("div",{style:{backgroundColor:r.background||""},class:["el-loading-mask",r.customClass,r.fullscreen?"is-fullscreen":""]},[ot("div",{class:"el-loading-spinner"},[l,h])]),[[fr,r.visible]])])})}}}).mount(document.createElement("div"));return St(qe({},gs(r)),{setText:i,remvoeElLoadingChild:s,close:a,handleAfterLeave:u,vm:f,get $el(){return f.$el}})}let ks;const pf=function(e={}){if(!Vt)return;const t=TD(e);t.fullscreen&&ks&&(ks.remvoeElLoadingChild(),ks.close());const n=CD(St(qe({},t),{closed:()=>{var i;(i=t.closed)==null||i.call(t),t.fullscreen&&(ks=void 0)}}));SD(t,t.parent,n),gv(t,t.parent,n),t.parent.vLoadingAddClassList=()=>gv(t,t.parent,n);let r=t.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",t.parent.setAttribute("loading-number",r),t.parent.appendChild(n.$el),yt(()=>n.visible.value=t.visible),t.fullscreen&&(ks=n),n},TD=e=>{var t,n,r,i;let o;return lt(e.target)?o=(t=document.querySelector(e.target))!=null?t:document.body:o=e.target||document.body,{parent:o===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(r=e.lock)!=null?r:!1,customClass:e.customClass||"",visible:(i=e.visible)!=null?i:!0,target:o}},SD=async(e,t,n)=>{const{nextZIndex:r}=Qa(),i={};if(e.fullscreen)n.originalPosition.value=Wi(document.body,"position"),n.originalOverflow.value=Wi(document.body,"overflow"),i.zIndex=r();else if(e.parent===document.body){n.originalPosition.value=Wi(document.body,"position"),await yt();for(const o of["top","left"]){const s=o==="top"?"scrollTop":"scrollLeft";i[o]=`${e.target.getBoundingClientRect()[o]+document.body[s]+document.documentElement[s]-parseInt(Wi(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])i[o]=`${e.target.getBoundingClientRect()[o]}px`}else n.originalPosition.value=Wi(t,"position");for(const[o,s]of Object.entries(i))n.$el.style[o]=s},gv=(e,t,n)=>{n.originalPosition.value!=="absolute"&&n.originalPosition.value!=="fixed"?tf(t,"el-loading-parent--relative"):Ia(t,"el-loading-parent--relative"),e.fullscreen&&e.lock?tf(t,"el-loading-parent--hidden"):Ia(t,"el-loading-parent--hidden")},gf=Symbol("ElLoading"),mv=(e,t)=>{var n,r,i,o;const s=t.instance,a=l=>pt(t.value)?t.value[l]:void 0,u=l=>{const h=lt(l)&&(s==null?void 0:s[l])||l;return h&&re(h)},d=l=>u(a(l)||e.getAttribute(`element-loading-${Mi(l)}`)),f=(n=a("fullscreen"))!=null?n:t.modifiers.fullscreen,c={text:d("text"),svg:d("svg"),svgViewBox:d("svgViewBox"),spinner:d("spinner"),background:d("background"),customClass:d("customClass"),fullscreen:f,target:(r=a("target"))!=null?r:f?void 0:e,body:(i=a("body"))!=null?i:t.modifiers.body,lock:(o=a("lock"))!=null?o:t.modifiers.lock};e[gf]={options:c,instance:pf(c)}},RD=(e,t)=>{for(const n of Object.keys(t))wt(t[n])&&(t[n].value=e[n])},vv={mounted(e,t){t.value&&mv(e,t)},updated(e,t){const n=e[gf];t.oldValue!==t.value&&(t.value&&!t.oldValue?mv(e,t):t.value&&t.oldValue?pt(t.value)&&RD(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[gf])==null||t.instance.close()}},fF={install(e){e.directive("loading",vv),e.config.globalProperties.$loading=pf},directive:vv,service:pf},jE=["success","info","warning","error"],bD=ct({customClass:{type:String,default:""},center:{type:Boolean,default:!1},dangerouslyUseHTMLString:{type:Boolean,default:!1},duration:{type:Number,default:3e3},icon:{type:mo,default:""},id:{type:String,default:""},message:{type:Qe([String,Object]),default:""},onClose:{type:Qe(Function),required:!1},showClose:{type:Boolean,default:!1},type:{type:String,values:jE,default:"info"},offset:{type:Number,default:20},zIndex:{type:Number,default:0},grouping:{type:Boolean,default:!1},repeatNum:{type:Number,default:1}}),ID={destroy:()=>!0},wD=Oe({name:"ElMessage",components:qe({ElBadge:CM,ElIcon:Bn},$0),props:bD,emits:ID,setup(e){const t=Ct("message"),n=re(!1),r=re(e.type?e.type==="error"?"danger":e.type:"info");let i;const o=ne(()=>{const l=e.type;return{[t.bm("icon",l)]:l&&vu[l]}}),s=ne(()=>e.icon||vu[e.type]||""),a=ne(()=>({top:`${e.offset}px`,zIndex:e.zIndex}));function u(){e.duration>0&&({stop:i}=Qd(()=>{n.value&&f()},e.duration))}function d(){i==null||i()}function f(){n.value=!1}function c({code:l}){l===st.esc?n.value&&f():u()}return $t(()=>{u(),n.value=!0}),je(()=>e.repeatNum,()=>{d(),u()}),mr(document,"keydown",c),{ns:t,typeClass:o,iconComponent:s,customStyle:a,visible:n,badgeType:r,close:f,clearTimer:d,startTimer:u}}}),OD=["id"],ND=["innerHTML"];function AD(e,t,n,r,i,o){const s=Je("el-badge"),a=Je("el-icon"),u=Je("close");return ee(),Ge(_r,{name:e.ns.b("fade"),onBeforeLeave:e.onClose,onAfterLeave:t[2]||(t[2]=d=>e.$emit("destroy"))},{default:Le(()=>[Dt(ye("div",{id:e.id,class:ue([e.ns.b(),{[e.ns.m(e.type)]:e.type&&!e.icon},e.ns.is("center",e.center),e.ns.is("closable",e.showClose),e.customClass]),style:Nt(e.customStyle),role:"alert",onMouseenter:t[0]||(t[0]=(...d)=>e.clearTimer&&e.clearTimer(...d)),onMouseleave:t[1]||(t[1]=(...d)=>e.startTimer&&e.startTimer(...d))},[e.repeatNum>1?(ee(),Ge(s,{key:0,value:e.repeatNum,type:e.badgeType,class:ue(e.ns.e("badge"))},null,8,["value","type","class"])):Ve("v-if",!0),e.iconComponent?(ee(),Ge(a,{key:1,class:ue([e.ns.e("icon"),e.typeClass])},{default:Le(()=>[(ee(),Ge(dr(e.iconComponent)))]),_:1},8,["class"])):Ve("v-if",!0),ke(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(ee(),Ce(It,{key:1},[Ve(" Caution here, message could've been compromised, never use user's input as message "),ye("p",{class:ue(e.ns.e("content")),innerHTML:e.message},null,10,ND)],2112)):(ee(),Ce("p",{key:0,class:ue(e.ns.e("content"))},Mt(e.message),3))]),e.showClose?(ee(),Ge(a,{key:2,class:ue(e.ns.e("closeBtn")),onClick:Xn(e.close,["stop"])},{default:Le(()=>[Be(u)]),_:1},8,["class","onClick"])):Ve("v-if",!0)],46,OD),[[fr,e.visible]])]),_:3},8,["name","onBeforeLeave"])}var PD=Ze(wD,[["render",AD]]);const Ln=[];let MD=1;const Eu=function(e={}){if(!Vt)return{close:()=>{}};if(gr(cf.max)&&Ln.length>=cf.max)return{close:()=>{}};if(!Un(e)&&typeof e=="object"&&e.grouping&&!Un(e.message)&&Ln.length){const f=Ln.find(c=>{var l,h,p;return`${(h=(l=c.vm.props)==null?void 0:l.message)!=null?h:""}`==`${(p=e.message)!=null?p:""}`});if(f)return f.vm.component.props.repeatNum+=1,f.vm.component.props.type=e==null?void 0:e.type,{close:()=>d.component.proxy.visible=!1}}(typeof e=="string"||Un(e))&&(e={message:e});let t=e.offset||20;Ln.forEach(({vm:f})=>{var c;t+=(((c=f.el)==null?void 0:c.offsetHeight)||0)+16}),t+=16;const{nextZIndex:n}=Qa(),r=`message_${MD++}`,i=e.onClose,o=St(qe({zIndex:n(),offset:t},e),{id:r,onClose:()=>{LD(r,i)}});let s=document.body;e.appendTo instanceof HTMLElement?s=e.appendTo:typeof e.appendTo=="string"&&(s=document.querySelector(e.appendTo)),s instanceof HTMLElement||(s=document.body);const a=document.createElement("div");a.className=`container_${r}`;const u=o.message,d=Be(PD,o,Un(o.message)?{default:()=>u}:null);return d.props.onDestroy=()=>{gu(null,a)},gu(d,a),Ln.push({vm:d}),s.appendChild(a.firstElementChild),{close:()=>d.component.proxy.visible=!1}};jE.forEach(e=>{Eu[e]=(t={})=>((typeof t=="string"||Un(t))&&(t={message:t}),Eu(St(qe({},t),{type:e})))});function LD(e,t){const n=Ln.findIndex(({vm:s})=>e===s.component.props.id);if(n===-1)return;const{vm:r}=Ln[n];if(!r)return;t==null||t(r);const i=r.el.offsetHeight;Ln.splice(n,1);const o=Ln.length;if(!(o<1))for(let s=n;s<o;s++){const a=parseInt(Ln[s].vm.el.style.top,10)-i-16;Ln[s].vm.component.props.offset=a}}function kD(){var e;for(let t=Ln.length-1;t>=0;t--){const n=Ln[t].vm.component;(e=n==null?void 0:n.proxy)==null||e.close()}}Eu.closeAll=kD;const hF=TN(Eu,"$message"),DD=Oe({name:"ElMessageBox",directives:{TrapFocus:tE},components:qe({ElButton:np,ElInput:cA,ElOverlay:wE,ElIcon:Bn},$0),inheritAttrs:!1,props:{buttonSize:{type:String,validator:cl},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{t:n}=z0(),r=re(!1),{nextZIndex:i}=Qa(),o=Hn({beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:i()}),s=ne(()=>{const w=o.type;return w&&vu[w]?`el-message-box-icon--${w}`:""}),a=vr(ne(()=>e.buttonSize),{prop:!0,form:!0,formItem:!0}),u=ne(()=>o.icon||vu[o.type]||""),d=ne(()=>!!o.message),f=re(),c=re(),l=re(),h=re(),p=ne(()=>o.confirmButtonClass);je(()=>o.inputValue,async w=>{await yt(),e.boxType==="prompt"&&w!==null&&T()},{immediate:!0}),je(()=>r.value,w=>{w&&((e.boxType==="alert"||e.boxType==="confirm")&&yt().then(()=>{var L,V,b;(b=(V=(L=h.value)==null?void 0:L.$el)==null?void 0:V.focus)==null||b.call(V)}),o.zIndex=i()),e.boxType==="prompt"&&(w?yt().then(()=>{l.value&&l.value.$el&&R().focus()}):(o.editorErrorMessage="",o.validateError=!1))});const m=ne(()=>e.draggable);G0(f,c,m),$t(async()=>{await yt(),e.closeOnHashChange&&gi(window,"hashchange",v)}),or(()=>{e.closeOnHashChange&&mi(window,"hashchange",v)});function v(){!r.value||(r.value=!1,yt(()=>{o.action&&t("action",o.action)}))}const _=()=>{e.closeOnClickModal&&S(o.distinguishCancelAndClose?"close":"cancel")},y=qh(_),E=()=>{if(o.inputType!=="textarea")return S("confirm")},S=w=>{var L;e.boxType==="prompt"&&w==="confirm"&&!T()||(o.action=w,o.beforeClose?(L=o.beforeClose)==null||L.call(o,w,o,v):v())},T=()=>{if(e.boxType==="prompt"){const w=o.inputPattern;if(w&&!w.test(o.inputValue||""))return o.editorErrorMessage=o.inputErrorMessage||n("el.messagebox.error"),o.validateError=!0,!1;const L=o.inputValidator;if(typeof L=="function"){const V=L(o.inputValue);if(V===!1)return o.editorErrorMessage=o.inputErrorMessage||n("el.messagebox.error"),o.validateError=!0,!1;if(typeof V=="string")return o.editorErrorMessage=V,o.validateError=!0,!1}}return o.editorErrorMessage="",o.validateError=!1,!0},R=()=>{const w=l.value.$refs;return w.input||w.textarea},C=()=>{S("close")};return e.closeOnPressEscape?W0({handleClose:C},r):DN(r,"keydown",w=>w.code===st.esc),e.lockScroll&&Y0(r),Q0(r),St(qe({},gs(o)),{overlayEvent:y,visible:r,hasMessage:d,typeClass:s,btnSize:a,iconComponent:u,confirmButtonClasses:p,rootRef:f,headerRef:c,inputRef:l,confirmRef:h,doClose:v,handleClose:C,handleWrapperClick:_,handleInputEnter:E,handleAction:S,t:n})}}),UD=["aria-label"],$D={key:0,ref:"headerRef",class:"el-message-box__header"},xD={class:"el-message-box__title"},BD={class:"el-message-box__content"},FD={class:"el-message-box__container"},VD={key:1,class:"el-message-box__message"},jD={key:0},HD=["innerHTML"],qD={class:"el-message-box__input"},KD={class:"el-message-box__btns"};function GD(e,t,n,r,i,o){const s=Je("el-icon"),a=Je("close"),u=Je("el-input"),d=Je("el-button"),f=Je("el-overlay"),c=c0("trap-focus");return ee(),Ge(_r,{name:"fade-in-linear",onAfterLeave:t[11]||(t[11]=l=>e.$emit("vanish"))},{default:Le(()=>[Dt(Be(f,{"z-index":e.zIndex,"overlay-class":["is-message-box",e.modalClass],mask:e.modal},{default:Le(()=>[ye("div",{class:"el-overlay-message-box",onClick:t[8]||(t[8]=(...l)=>e.overlayEvent.onClick&&e.overlayEvent.onClick(...l)),onMousedown:t[9]||(t[9]=(...l)=>e.overlayEvent.onMousedown&&e.overlayEvent.onMousedown(...l)),onMouseup:t[10]||(t[10]=(...l)=>e.overlayEvent.onMouseup&&e.overlayEvent.onMouseup(...l))},[Dt((ee(),Ce("div",{ref:"rootRef",role:"dialog","aria-label":e.title||"dialog","aria-modal":"true",class:ue(["el-message-box",e.customClass,{"el-message-box--center":e.center,"is-draggable":e.draggable}]),style:Nt(e.customStyle),onClick:t[7]||(t[7]=Xn(()=>{},["stop"]))},[e.title!==null&&e.title!==void 0?(ee(),Ce("div",$D,[ye("div",xD,[e.iconComponent&&e.center?(ee(),Ge(s,{key:0,class:ue(["el-message-box__status",e.typeClass])},{default:Le(()=>[(ee(),Ge(dr(e.iconComponent)))]),_:1},8,["class"])):Ve("v-if",!0),ye("span",null,Mt(e.title),1)]),e.showClose?(ee(),Ce("button",{key:0,type:"button",class:"el-message-box__headerbtn","aria-label":"Close",onClick:t[0]||(t[0]=l=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel")),onKeydown:t[1]||(t[1]=Bo(Xn(l=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[Be(s,{class:"el-message-box__close"},{default:Le(()=>[Be(a)]),_:1})],32)):Ve("v-if",!0)],512)):Ve("v-if",!0),ye("div",BD,[ye("div",FD,[e.iconComponent&&!e.center&&e.hasMessage?(ee(),Ge(s,{key:0,class:ue(["el-message-box__status",e.typeClass])},{default:Le(()=>[(ee(),Ge(dr(e.iconComponent)))]),_:1},8,["class"])):Ve("v-if",!0),e.hasMessage?(ee(),Ce("div",VD,[ke(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(ee(),Ce("p",{key:1,innerHTML:e.message},null,8,HD)):(ee(),Ce("p",jD,Mt(e.message),1))])])):Ve("v-if",!0)]),Dt(ye("div",qD,[Be(u,{ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":t[2]||(t[2]=l=>e.inputValue=l),type:e.inputType,placeholder:e.inputPlaceholder,class:ue({invalid:e.validateError}),onKeydown:Bo(Xn(e.handleInputEnter,["prevent"]),["enter"])},null,8,["modelValue","type","placeholder","class","onKeydown"]),ye("div",{class:"el-message-box__errormsg",style:Nt({visibility:e.editorErrorMessage?"visible":"hidden"})},Mt(e.editorErrorMessage),5)],512),[[fr,e.showInput]])]),ye("div",KD,[e.showCancelButton?(ee(),Ge(d,{key:0,loading:e.cancelButtonLoading,class:ue([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:t[3]||(t[3]=l=>e.handleAction("cancel")),onKeydown:t[4]||(t[4]=Bo(Xn(l=>e.handleAction("cancel"),["prevent"]),["enter"]))},{default:Le(()=>[Jr(Mt(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):Ve("v-if",!0),Dt(Be(d,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,class:ue([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:t[5]||(t[5]=l=>e.handleAction("confirm")),onKeydown:t[6]||(t[6]=Bo(Xn(l=>e.handleAction("confirm"),["prevent"]),["enter"]))},{default:Le(()=>[Jr(Mt(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[fr,e.showConfirmButton]])])],14,UD)),[[c]])],32)]),_:3},8,["z-index","overlay-class","mask"]),[[fr,e.visible]])]),_:3})}var zD=Ze(DD,[["render",GD]]);const Aa=new Map,YD=(e,t)=>{const n=ot(zD,e);return gu(n,t),document.body.appendChild(t.firstElementChild),n.component},WD=()=>document.createElement("div"),JD=e=>{const t=WD();e.onVanish=()=>{gu(null,t),Aa.delete(r)},e.onAction=i=>{const o=Aa.get(r);let s;e.showInput?s={value:r.inputValue,action:i}:s=i,e.callback?e.callback(s,n.proxy):i==="cancel"||i==="close"?e.distinguishCancelAndClose&&i!=="cancel"?o.reject("close"):o.reject("cancel"):o.resolve(s)};const n=YD(e,t),r=n.proxy;for(const i in e)et(e,i)&&!et(r.$props,i)&&(r[i]=e[i]);return je(()=>r.message,(i,o)=>{Un(i)?n.slots.default=()=>[i]:Un(o)&&!Un(i)&&delete n.slots.default},{immediate:!0}),r.visible=!0,r};function Pi(e){if(!Vt)return;let t;return lt(e)||Un(e)?e={message:e}:t=e.callback,new Promise((n,r)=>{const i=JD(e);Aa.set(i,{options:e,callback:t,resolve:n,reject:r})})}Pi.alert=(e,t,n)=>(typeof t=="object"?(n=t,t=""):t===void 0&&(t=""),Pi(Object.assign({title:t,message:e,type:"",closeOnPressEscape:!1,closeOnClickModal:!1},n,{boxType:"alert"})));Pi.confirm=(e,t,n)=>(typeof t=="object"?(n=t,t=""):t===void 0&&(t=""),Pi(Object.assign({title:t,message:e,type:"",showCancelButton:!0},n,{boxType:"confirm"})));Pi.prompt=(e,t,n)=>(typeof t=="object"?(n=t,t=""):t===void 0&&(t=""),Pi(Object.assign({title:t,message:e,showCancelButton:!0,showInput:!0,type:""},n,{boxType:"prompt"})));Pi.close=()=>{Aa.forEach((e,t)=>{t.doClose()}),Aa.clear()};const Gi=Pi;Gi.install=e=>{e.config.globalProperties.$msgbox=Gi,e.config.globalProperties.$messageBox=Gi,e.config.globalProperties.$alert=Gi.alert,e.config.globalProperties.$confirm=Gi.confirm,e.config.globalProperties.$prompt=Gi.prompt};const pF=Gi;var HE={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t={name:"zh-cn",el:{colorpicker:{confirm:"\u786E\u5B9A",clear:"\u6E05\u7A7A"},datepicker:{now:"\u6B64\u523B",today:"\u4ECA\u5929",cancel:"\u53D6\u6D88",clear:"\u6E05\u7A7A",confirm:"\u786E\u5B9A",selectDate:"\u9009\u62E9\u65E5\u671F",selectTime:"\u9009\u62E9\u65F6\u95F4",startDate:"\u5F00\u59CB\u65E5\u671F",startTime:"\u5F00\u59CB\u65F6\u95F4",endDate:"\u7ED3\u675F\u65E5\u671F",endTime:"\u7ED3\u675F\u65F6\u95F4",prevYear:"\u524D\u4E00\u5E74",nextYear:"\u540E\u4E00\u5E74",prevMonth:"\u4E0A\u4E2A\u6708",nextMonth:"\u4E0B\u4E2A\u6708",year:"\u5E74",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{jan:"\u4E00\u6708",feb:"\u4E8C\u6708",mar:"\u4E09\u6708",apr:"\u56DB\u6708",may:"\u4E94\u6708",jun:"\u516D\u6708",jul:"\u4E03\u6708",aug:"\u516B\u6708",sep:"\u4E5D\u6708",oct:"\u5341\u6708",nov:"\u5341\u4E00\u6708",dec:"\u5341\u4E8C\u6708"}},select:{loading:"\u52A0\u8F7D\u4E2D",noMatch:"\u65E0\u5339\u914D\u6570\u636E",noData:"\u65E0\u6570\u636E",placeholder:"\u8BF7\u9009\u62E9"},cascader:{noMatch:"\u65E0\u5339\u914D\u6570\u636E",loading:"\u52A0\u8F7D\u4E2D",placeholder:"\u8BF7\u9009\u62E9",noData:"\u6682\u65E0\u6570\u636E"},pagination:{goto:"\u524D\u5F80",pagesize:"\u6761/\u9875",total:"\u5171 {total} \u6761",pageClassifier:"\u9875",deprecationWarning:"\u4F60\u4F7F\u7528\u4E86\u4E00\u4E9B\u5DF2\u88AB\u5E9F\u5F03\u7684\u7528\u6CD5\uFF0C\u8BF7\u53C2\u8003 el-pagination \u7684\u5B98\u65B9\u6587\u6863"},messagebox:{title:"\u63D0\u793A",confirm:"\u786E\u5B9A",cancel:"\u53D6\u6D88",error:"\u8F93\u5165\u7684\u6570\u636E\u4E0D\u5408\u6CD5!"},upload:{deleteTip:"\u6309 delete \u952E\u53EF\u5220\u9664",delete:"\u5220\u9664",preview:"\u67E5\u770B\u56FE\u7247",continue:"\u7EE7\u7EED\u4E0A\u4F20"},table:{emptyText:"\u6682\u65E0\u6570\u636E",confirmFilter:"\u7B5B\u9009",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8BA1"},tree:{emptyText:"\u6682\u65E0\u6570\u636E"},transfer:{noMatch:"\u65E0\u5339\u914D\u6570\u636E",noData:"\u65E0\u6570\u636E",titles:["\u5217\u8868 1","\u5217\u8868 2"],filterPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",noCheckedFormat:"\u5171 {total} \u9879",hasCheckedFormat:"\u5DF2\u9009 {checked}/{total} \u9879"},image:{error:"\u52A0\u8F7D\u5931\u8D25"},pageHeader:{title:"\u8FD4\u56DE"},popconfirm:{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88"}}};e.default=t})(HE);var gF=qM(HE),QD={},XD=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),qE="%[a-f0-9]{2}",yv=new RegExp(qE,"gi"),_v=new RegExp("("+qE+")+","gi");function mf(e,t){try{return decodeURIComponent(e.join(""))}catch{}if(e.length===1)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],mf(n),mf(r))}function ZD(e){try{return decodeURIComponent(e)}catch{for(var t=e.match(yv),n=1;n<t.length;n++)e=mf(t,n).join(""),t=e.match(yv);return e}}function eU(e){for(var t={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},n=_v.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{var r=ZD(n[0]);r!==n[0]&&(t[n[0]]=r)}n=_v.exec(e)}t["%C2"]="\uFFFD";for(var i=Object.keys(t),o=0;o<i.length;o++){var s=i[o];e=e.replace(new RegExp(s,"g"),t[s])}return e}var tU=function(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch{return eU(e)}},nU=(e,t)=>{if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(t==="")return[e];const n=e.indexOf(t);return n===-1?[e]:[e.slice(0,n),e.slice(n+t.length)]},rU=function(e,t){for(var n={},r=Object.keys(e),i=Array.isArray(t),o=0;o<r.length;o++){var s=r[o],a=e[s];(i?t.indexOf(s)!==-1:t(s,a,e))&&(n[s]=a)}return n};(function(e){const t=XD,n=tU,r=nU,i=rU,o=y=>y==null,s=Symbol("encodeFragmentIdentifier");function a(y){switch(y.arrayFormat){case"index":return E=>(S,T)=>{const R=S.length;return T===void 0||y.skipNull&&T===null||y.skipEmptyString&&T===""?S:T===null?[...S,[f(E,y),"[",R,"]"].join("")]:[...S,[f(E,y),"[",f(R,y),"]=",f(T,y)].join("")]};case"bracket":return E=>(S,T)=>T===void 0||y.skipNull&&T===null||y.skipEmptyString&&T===""?S:T===null?[...S,[f(E,y),"[]"].join("")]:[...S,[f(E,y),"[]=",f(T,y)].join("")];case"colon-list-separator":return E=>(S,T)=>T===void 0||y.skipNull&&T===null||y.skipEmptyString&&T===""?S:T===null?[...S,[f(E,y),":list="].join("")]:[...S,[f(E,y),":list=",f(T,y)].join("")];case"comma":case"separator":case"bracket-separator":{const E=y.arrayFormat==="bracket-separator"?"[]=":"=";return S=>(T,R)=>R===void 0||y.skipNull&&R===null||y.skipEmptyString&&R===""?T:(R=R===null?"":R,T.length===0?[[f(S,y),E,f(R,y)].join("")]:[[T,f(R,y)].join(y.arrayFormatSeparator)])}default:return E=>(S,T)=>T===void 0||y.skipNull&&T===null||y.skipEmptyString&&T===""?S:T===null?[...S,f(E,y)]:[...S,[f(E,y),"=",f(T,y)].join("")]}}function u(y){let E;switch(y.arrayFormat){case"index":return(S,T,R)=>{if(E=/\[(\d*)\]$/.exec(S),S=S.replace(/\[\d*\]$/,""),!E){R[S]=T;return}R[S]===void 0&&(R[S]={}),R[S][E[1]]=T};case"bracket":return(S,T,R)=>{if(E=/(\[\])$/.exec(S),S=S.replace(/\[\]$/,""),!E){R[S]=T;return}if(R[S]===void 0){R[S]=[T];return}R[S]=[].concat(R[S],T)};case"colon-list-separator":return(S,T,R)=>{if(E=/(:list)$/.exec(S),S=S.replace(/:list$/,""),!E){R[S]=T;return}if(R[S]===void 0){R[S]=[T];return}R[S]=[].concat(R[S],T)};case"comma":case"separator":return(S,T,R)=>{const C=typeof T=="string"&&T.includes(y.arrayFormatSeparator),w=typeof T=="string"&&!C&&c(T,y).includes(y.arrayFormatSeparator);T=w?c(T,y):T;const L=C||w?T.split(y.arrayFormatSeparator).map(V=>c(V,y)):T===null?T:c(T,y);R[S]=L};case"bracket-separator":return(S,T,R)=>{const C=/(\[\])$/.test(S);if(S=S.replace(/\[\]$/,""),!C){R[S]=T&&c(T,y);return}const w=T===null?[]:T.split(y.arrayFormatSeparator).map(L=>c(L,y));if(R[S]===void 0){R[S]=w;return}R[S]=[].concat(R[S],w)};default:return(S,T,R)=>{if(R[S]===void 0){R[S]=T;return}R[S]=[].concat(R[S],T)}}}function d(y){if(typeof y!="string"||y.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function f(y,E){return E.encode?E.strict?t(y):encodeURIComponent(y):y}function c(y,E){return E.decode?n(y):y}function l(y){return Array.isArray(y)?y.sort():typeof y=="object"?l(Object.keys(y)).sort((E,S)=>Number(E)-Number(S)).map(E=>y[E]):y}function h(y){const E=y.indexOf("#");return E!==-1&&(y=y.slice(0,E)),y}function p(y){let E="";const S=y.indexOf("#");return S!==-1&&(E=y.slice(S)),E}function m(y){y=h(y);const E=y.indexOf("?");return E===-1?"":y.slice(E+1)}function v(y,E){return E.parseNumbers&&!Number.isNaN(Number(y))&&typeof y=="string"&&y.trim()!==""?y=Number(y):E.parseBooleans&&y!==null&&(y.toLowerCase()==="true"||y.toLowerCase()==="false")&&(y=y.toLowerCase()==="true"),y}function _(y,E){E=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},E),d(E.arrayFormatSeparator);const S=u(E),T=Object.create(null);if(typeof y!="string"||(y=y.trim().replace(/^[?#&]/,""),!y))return T;for(const R of y.split("&")){if(R==="")continue;let[C,w]=r(E.decode?R.replace(/\+/g," "):R,"=");w=w===void 0?null:["comma","separator","bracket-separator"].includes(E.arrayFormat)?w:c(w,E),S(c(C,E),w,T)}for(const R of Object.keys(T)){const C=T[R];if(typeof C=="object"&&C!==null)for(const w of Object.keys(C))C[w]=v(C[w],E);else T[R]=v(C,E)}return E.sort===!1?T:(E.sort===!0?Object.keys(T).sort():Object.keys(T).sort(E.sort)).reduce((R,C)=>{const w=T[C];return Boolean(w)&&typeof w=="object"&&!Array.isArray(w)?R[C]=l(w):R[C]=w,R},Object.create(null))}e.extract=m,e.parse=_,e.stringify=(y,E)=>{if(!y)return"";E=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},E),d(E.arrayFormatSeparator);const S=w=>E.skipNull&&o(y[w])||E.skipEmptyString&&y[w]==="",T=a(E),R={};for(const w of Object.keys(y))S(w)||(R[w]=y[w]);const C=Object.keys(R);return E.sort!==!1&&C.sort(E.sort),C.map(w=>{const L=y[w];return L===void 0?"":L===null?f(w,E):Array.isArray(L)?L.length===0&&E.arrayFormat==="bracket-separator"?f(w,E)+"[]":L.reduce(T(w),[]).join("&"):f(w,E)+"="+f(L,E)}).filter(w=>w.length>0).join("&")},e.parseUrl=(y,E)=>{E=Object.assign({decode:!0},E);const[S,T]=r(y,"#");return Object.assign({url:S.split("?")[0]||"",query:_(m(y),E)},E&&E.parseFragmentIdentifier&&T?{fragmentIdentifier:c(T,E)}:{})},e.stringifyUrl=(y,E)=>{E=Object.assign({encode:!0,strict:!0,[s]:!0},E);const S=h(y.url).split("?")[0]||"",T=e.extract(y.url),R=e.parse(T,{sort:!1}),C=Object.assign(R,y.query);let w=e.stringify(C,E);w&&(w=`?${w}`);let L=p(y.url);return y.fragmentIdentifier&&(L=`#${E[s]?f(y.fragmentIdentifier,E):y.fragmentIdentifier}`),`${S}${w}${L}`},e.pick=(y,E,S)=>{S=Object.assign({parseFragmentIdentifier:!0,[s]:!1},S);const{url:T,query:R,fragmentIdentifier:C}=e.parseUrl(y,S);return e.stringifyUrl({url:T,query:i(R,E),fragmentIdentifier:C},S)},e.exclude=(y,E,S)=>{const T=Array.isArray(E)?R=>!E.includes(R):(R,C)=>!E(R,C);return e.pick(y,T,S)}})(QD);/*!
  13. * vue-router v4.0.12
  14. * (c) 2021 Eduardo San Martin Morote
  15. * @license MIT
  16. */const KE=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",Es=e=>KE?Symbol(e):"_vr_"+e,iU=Es("rvlm"),Ev=Es("rvd"),ap=Es("r"),GE=Es("rl"),vf=Es("rvl"),Uo=typeof window!="undefined";function oU(e){return e.__esModule||KE&&e[Symbol.toStringTag]==="Module"}const gt=Object.assign;function nd(e,t){const n={};for(const r in t){const i=t[r];n[r]=Array.isArray(i)?i.map(e):e(i)}return n}const ca=()=>{},sU=/\/$/,aU=e=>e.replace(sU,"");function rd(e,t,n="/"){let r,i={},o="",s="";const a=t.indexOf("?"),u=t.indexOf("#",a>-1?a:0);return a>-1&&(r=t.slice(0,a),o=t.slice(a+1,u>-1?u:t.length),i=e(o)),u>-1&&(r=r||t.slice(0,u),s=t.slice(u,t.length)),r=dU(r!=null?r:t,n),{fullPath:r+(o&&"?")+o+s,path:r,query:i,hash:s}}function cU(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Cv(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function uU(e,t,n){const r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&cs(t.matched[r],n.matched[i])&&zE(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function cs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function zE(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!lU(e[n],t[n]))return!1;return!0}function lU(e,t){return Array.isArray(e)?Tv(e,t):Array.isArray(t)?Tv(t,e):e===t}function Tv(e,t){return Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function dU(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let i=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],!(i===1||s==="."))if(s==="..")i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}var Pa;(function(e){e.pop="pop",e.push="push"})(Pa||(Pa={}));var ua;(function(e){e.back="back",e.forward="forward",e.unknown=""})(ua||(ua={}));function fU(e){if(!e)if(Uo){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),aU(e)}const hU=/^[^#]+#/;function pU(e,t){return e.replace(hU,"#")+t}function gU(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const fl=()=>({left:window.pageXOffset,top:window.pageYOffset});function mU(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=gU(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Sv(e,t){return(history.state?history.state.position-t:-1)+e}const yf=new Map;function vU(e,t){yf.set(e,t)}function yU(e){const t=yf.get(e);return yf.delete(e),t}let _U=()=>location.protocol+"//"+location.host;function YE(e,t){const{pathname:n,search:r,hash:i}=t,o=e.indexOf("#");if(o>-1){let a=i.includes(e.slice(o))?e.slice(o).length:1,u=i.slice(a);return u[0]!=="/"&&(u="/"+u),Cv(u,"")}return Cv(n,e)+r+i}function EU(e,t,n,r){let i=[],o=[],s=null;const a=({state:l})=>{const h=YE(e,location),p=n.value,m=t.value;let v=0;if(l){if(n.value=h,t.value=l,s&&s===p){s=null;return}v=m?l.position-m.position:0}else r(h);i.forEach(_=>{_(n.value,p,{delta:v,type:Pa.pop,direction:v?v>0?ua.forward:ua.back:ua.unknown})})};function u(){s=n.value}function d(l){i.push(l);const h=()=>{const p=i.indexOf(l);p>-1&&i.splice(p,1)};return o.push(h),h}function f(){const{history:l}=window;!l.state||l.replaceState(gt({},l.state,{scroll:fl()}),"")}function c(){for(const l of o)l();o=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",f)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",f),{pauseListeners:u,listen:d,destroy:c}}function Rv(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?fl():null}}function CU(e){const{history:t,location:n}=window,r={value:YE(e,n)},i={value:t.state};i.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(u,d,f){const c=e.indexOf("#"),l=c>-1?(n.host&&document.querySelector("base")?e:e.slice(c))+u:_U()+e+u;try{t[f?"replaceState":"pushState"](d,"",l),i.value=d}catch(h){console.error(h),n[f?"replace":"assign"](l)}}function s(u,d){const f=gt({},t.state,Rv(i.value.back,u,i.value.forward,!0),d,{position:i.value.position});o(u,f,!0),r.value=u}function a(u,d){const f=gt({},i.value,t.state,{forward:u,scroll:fl()});o(f.current,f,!0);const c=gt({},Rv(r.value,u,null),{position:f.position+1},d);o(u,c,!1),r.value=u}return{location:r,state:i,push:a,replace:s}}function TU(e){e=fU(e);const t=CU(e),n=EU(e,t.state,t.location,t.replace);function r(o,s=!0){s||n.pauseListeners(),history.go(o)}const i=gt({location:"",base:e,go:r,createHref:pU.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}function mF(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),TU(e)}function SU(e){return typeof e=="string"||e&&typeof e=="object"}function WE(e){return typeof e=="string"||typeof e=="symbol"}const ai={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},JE=Es("nf");var bv;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(bv||(bv={}));function us(e,t){return gt(new Error,{type:e,[JE]:!0},t)}function ji(e,t){return e instanceof Error&&JE in e&&(t==null||!!(e.type&t))}const Iv="[^/]+?",RU={sensitive:!1,strict:!1,start:!0,end:!0},bU=/[.+*?^${}()[\]/\\]/g;function IU(e,t){const n=gt({},RU,t),r=[];let i=n.start?"^":"";const o=[];for(const d of e){const f=d.length?[]:[90];n.strict&&!d.length&&(i+="/");for(let c=0;c<d.length;c++){const l=d[c];let h=40+(n.sensitive?.25:0);if(l.type===0)c||(i+="/"),i+=l.value.replace(bU,"\\$&"),h+=40;else if(l.type===1){const{value:p,repeatable:m,optional:v,regexp:_}=l;o.push({name:p,repeatable:m,optional:v});const y=_||Iv;if(y!==Iv){h+=10;try{new RegExp(`(${y})`)}catch(S){throw new Error(`Invalid custom RegExp for param "${p}" (${y}): `+S.message)}}let E=m?`((?:${y})(?:/(?:${y}))*)`:`(${y})`;c||(E=v&&d.length<2?`(?:/${E})`:"/"+E),v&&(E+="?"),i+=E,h+=20,v&&(h+=-8),m&&(h+=-20),y===".*"&&(h+=-50)}f.push(h)}r.push(f)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=.7000000000000001}n.strict||(i+="/?"),n.end?i+="$":n.strict&&(i+="(?:/|$)");const s=new RegExp(i,n.sensitive?"":"i");function a(d){const f=d.match(s),c={};if(!f)return null;for(let l=1;l<f.length;l++){const h=f[l]||"",p=o[l-1];c[p.name]=h&&p.repeatable?h.split("/"):h}return c}function u(d){let f="",c=!1;for(const l of e){(!c||!f.endsWith("/"))&&(f+="/"),c=!1;for(const h of l)if(h.type===0)f+=h.value;else if(h.type===1){const{value:p,repeatable:m,optional:v}=h,_=p in d?d[p]:"";if(Array.isArray(_)&&!m)throw new Error(`Provided param "${p}" is an array but it is not repeatable (* or + modifiers)`);const y=Array.isArray(_)?_.join("/"):_;if(!y)if(v)l.length<2&&(f.endsWith("/")?f=f.slice(0,-1):c=!0);else throw new Error(`Missing required param "${p}"`);f+=y}}return f}return{re:s,score:r,keys:o,parse:a,stringify:u}}function wU(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===40+40?-1:1:e.length>t.length?t.length===1&&t[0]===40+40?1:-1:0}function OU(e,t){let n=0;const r=e.score,i=t.score;for(;n<r.length&&n<i.length;){const o=wU(r[n],i[n]);if(o)return o;n++}return i.length-r.length}const NU={type:0,value:""},AU=/[a-zA-Z0-9_]/;function PU(e){if(!e)return[[]];if(e==="/")return[[NU]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${d}": ${h}`)}let n=0,r=n;const i=[];let o;function s(){o&&i.push(o),o=[]}let a=0,u,d="",f="";function c(){!d||(n===0?o.push({type:0,value:d}):n===1||n===2||n===3?(o.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:d,regexp:f,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),d="")}function l(){d+=u}for(;a<e.length;){if(u=e[a++],u==="\\"&&n!==2){r=n,n=4;continue}switch(n){case 0:u==="/"?(d&&c(),s()):u===":"?(c(),n=1):l();break;case 4:l(),n=r;break;case 1:u==="("?n=2:AU.test(u)?l():(c(),n=0,u!=="*"&&u!=="?"&&u!=="+"&&a--);break;case 2:u===")"?f[f.length-1]=="\\"?f=f.slice(0,-1)+u:n=3:f+=u;break;case 3:c(),n=0,u!=="*"&&u!=="?"&&u!=="+"&&a--,f="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${d}"`),c(),s(),i}function MU(e,t,n){const r=IU(PU(e.path),n),i=gt(r,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function LU(e,t){const n=[],r=new Map;t=Ov({strict:!1,end:!0,sensitive:!1},t);function i(f){return r.get(f)}function o(f,c,l){const h=!l,p=DU(f);p.aliasOf=l&&l.record;const m=Ov(t,f),v=[p];if("alias"in f){const E=typeof f.alias=="string"?[f.alias]:f.alias;for(const S of E)v.push(gt({},p,{components:l?l.record.components:p.components,path:S,aliasOf:l?l.record:p}))}let _,y;for(const E of v){const{path:S}=E;if(c&&S[0]!=="/"){const T=c.record.path,R=T[T.length-1]==="/"?"":"/";E.path=c.record.path+(S&&R+S)}if(_=MU(E,c,m),l?l.alias.push(_):(y=y||_,y!==_&&y.alias.push(_),h&&f.name&&!wv(_)&&s(f.name)),"children"in p){const T=p.children;for(let R=0;R<T.length;R++)o(T[R],_,l&&l.children[R])}l=l||_,u(_)}return y?()=>{s(y)}:ca}function s(f){if(WE(f)){const c=r.get(f);c&&(r.delete(f),n.splice(n.indexOf(c),1),c.children.forEach(s),c.alias.forEach(s))}else{const c=n.indexOf(f);c>-1&&(n.splice(c,1),f.record.name&&r.delete(f.record.name),f.children.forEach(s),f.alias.forEach(s))}}function a(){return n}function u(f){let c=0;for(;c<n.length&&OU(f,n[c])>=0;)c++;n.splice(c,0,f),f.record.name&&!wv(f)&&r.set(f.record.name,f)}function d(f,c){let l,h={},p,m;if("name"in f&&f.name){if(l=r.get(f.name),!l)throw us(1,{location:f});m=l.record.name,h=gt(kU(c.params,l.keys.filter(y=>!y.optional).map(y=>y.name)),f.params),p=l.stringify(h)}else if("path"in f)p=f.path,l=n.find(y=>y.re.test(p)),l&&(h=l.parse(p),m=l.record.name);else{if(l=c.name?r.get(c.name):n.find(y=>y.re.test(c.path)),!l)throw us(1,{location:f,currentLocation:c});m=l.record.name,h=gt({},c.params,f.params),p=l.stringify(h)}const v=[];let _=l;for(;_;)v.unshift(_.record),_=_.parent;return{name:m,path:p,params:h,matched:v,meta:$U(v)}}return e.forEach(f=>o(f)),{addRoute:o,resolve:d,removeRoute:s,getRoutes:a,getRecordMatcher:i}}function kU(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function DU(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:UU(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||{}:{default:e.component}}}function UU(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="boolean"?n:n[r];return t}function wv(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function $U(e){return e.reduce((t,n)=>gt(t,n.meta),{})}function Ov(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const QE=/#/g,xU=/&/g,BU=/\//g,FU=/=/g,VU=/\?/g,XE=/\+/g,jU=/%5B/g,HU=/%5D/g,ZE=/%5E/g,qU=/%60/g,eC=/%7B/g,KU=/%7C/g,tC=/%7D/g,GU=/%20/g;function cp(e){return encodeURI(""+e).replace(KU,"|").replace(jU,"[").replace(HU,"]")}function zU(e){return cp(e).replace(eC,"{").replace(tC,"}").replace(ZE,"^")}function _f(e){return cp(e).replace(XE,"%2B").replace(GU,"+").replace(QE,"%23").replace(xU,"%26").replace(qU,"`").replace(eC,"{").replace(tC,"}").replace(ZE,"^")}function YU(e){return _f(e).replace(FU,"%3D")}function WU(e){return cp(e).replace(QE,"%23").replace(VU,"%3F")}function JU(e){return e==null?"":WU(e).replace(BU,"%2F")}function Cu(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function QU(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let i=0;i<r.length;++i){const o=r[i].replace(XE," "),s=o.indexOf("="),a=Cu(s<0?o:o.slice(0,s)),u=s<0?null:Cu(o.slice(s+1));if(a in t){let d=t[a];Array.isArray(d)||(d=t[a]=[d]),d.push(u)}else t[a]=u}return t}function Nv(e){let t="";for(let n in e){const r=e[n];if(n=YU(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Array.isArray(r)?r.map(o=>o&&_f(o)):[r&&_f(r)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function XU(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Array.isArray(r)?r.map(i=>i==null?null:""+i):r==null?r:""+r)}return t}function Ds(){let e=[];function t(r){return e.push(r),()=>{const i=e.indexOf(r);i>-1&&e.splice(i,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function di(e,t,n,r,i){const o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,a)=>{const u=c=>{c===!1?a(us(4,{from:n,to:t})):c instanceof Error?a(c):SU(c)?a(us(2,{from:t,to:c})):(o&&r.enterCallbacks[i]===o&&typeof c=="function"&&o.push(c),s())},d=e.call(r&&r.instances[i],t,n,u);let f=Promise.resolve(d);e.length<3&&(f=f.then(u)),f.catch(c=>a(c))})}function id(e,t,n,r){const i=[];for(const o of e)for(const s in o.components){let a=o.components[s];if(!(t!=="beforeRouteEnter"&&!o.instances[s]))if(ZU(a)){const d=(a.__vccOpts||a)[t];d&&i.push(di(d,n,r,o,s))}else{let u=a();i.push(()=>u.then(d=>{if(!d)return Promise.reject(new Error(`Couldn't resolve component "${s}" at "${o.path}"`));const f=oU(d)?d.default:d;o.components[s]=f;const l=(f.__vccOpts||f)[t];return l&&di(l,n,r,o,s)()}))}}return i}function ZU(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Av(e){const t=He(ap),n=He(GE),r=ne(()=>t.resolve(he(e.to))),i=ne(()=>{const{matched:u}=r.value,{length:d}=u,f=u[d-1],c=n.matched;if(!f||!c.length)return-1;const l=c.findIndex(cs.bind(null,f));if(l>-1)return l;const h=Pv(u[d-2]);return d>1&&Pv(f)===h&&c[c.length-1].path!==h?c.findIndex(cs.bind(null,u[d-2])):l}),o=ne(()=>i.value>-1&&r$(n.params,r.value.params)),s=ne(()=>i.value>-1&&i.value===n.matched.length-1&&zE(n.params,r.value.params));function a(u={}){return n$(u)?t[he(e.replace)?"replace":"push"](he(e.to)).catch(ca):Promise.resolve()}return{route:r,href:ne(()=>r.value.href),isActive:o,isExactActive:s,navigate:a}}const e$=Oe({name:"RouterLink",props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Av,setup(e,{slots:t}){const n=Hn(Av(e)),{options:r}=He(ap),i=ne(()=>({[Mv(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Mv(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&t.default(n);return e.custom?o:ot("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},o)}}}),t$=e$;function n$(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function r$(e,t){for(const n in t){const r=t[n],i=e[n];if(typeof r=="string"){if(r!==i)return!1}else if(!Array.isArray(i)||i.length!==r.length||r.some((o,s)=>o!==i[s]))return!1}return!0}function Pv(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Mv=(e,t,n)=>e!=null?e:t!=null?t:n,i$=Oe({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},setup(e,{attrs:t,slots:n}){const r=He(vf),i=ne(()=>e.route||r.value),o=He(Ev,0),s=ne(()=>i.value.matched[o]);Ot(Ev,o+1),Ot(iU,s),Ot(vf,i);const a=re();return je(()=>[a.value,s.value,e.name],([u,d,f],[c,l,h])=>{d&&(d.instances[f]=u,l&&l!==d&&u&&u===c&&(d.leaveGuards.size||(d.leaveGuards=l.leaveGuards),d.updateGuards.size||(d.updateGuards=l.updateGuards))),u&&d&&(!l||!cs(d,l)||!c)&&(d.enterCallbacks[f]||[]).forEach(p=>p(u))},{flush:"post"}),()=>{const u=i.value,d=s.value,f=d&&d.components[e.name],c=e.name;if(!f)return Lv(n.default,{Component:f,route:u});const l=d.props[e.name],h=l?l===!0?u.params:typeof l=="function"?l(u):l:null,m=ot(f,gt({},h,t,{onVnodeUnmounted:v=>{v.component.isUnmounted&&(d.instances[c]=null)},ref:a}));return Lv(n.default,{Component:m,route:u})||m}}});function Lv(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const o$=i$;function vF(e){const t=LU(e.routes,e),n=e.parseQuery||QU,r=e.stringifyQuery||Nv,i=e.history,o=Ds(),s=Ds(),a=Ds(),u=Rh(ai);let d=ai;Uo&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const f=nd.bind(null,P=>""+P),c=nd.bind(null,JU),l=nd.bind(null,Cu);function h(P,z){let G,K;return WE(P)?(G=t.getRecordMatcher(P),K=z):K=P,t.addRoute(K,G)}function p(P){const z=t.getRecordMatcher(P);z&&t.removeRoute(z)}function m(){return t.getRoutes().map(P=>P.record)}function v(P){return!!t.getRecordMatcher(P)}function _(P,z){if(z=gt({},z||u.value),typeof P=="string"){const we=rd(n,P,z.path),k=t.resolve({path:we.path},z),j=i.createHref(we.fullPath);return gt(we,k,{params:l(k.params),hash:Cu(we.hash),redirectedFrom:void 0,href:j})}let G;if("path"in P)G=gt({},P,{path:rd(n,P.path,z.path).path});else{const we=gt({},P.params);for(const k in we)we[k]==null&&delete we[k];G=gt({},P,{params:c(P.params)}),z.params=c(z.params)}const K=t.resolve(G,z),pe=P.hash||"";K.params=f(l(K.params));const be=cU(r,gt({},P,{hash:zU(pe),path:K.path})),Ie=i.createHref(be);return gt({fullPath:be,hash:pe,query:r===Nv?XU(P.query):P.query||{}},K,{redirectedFrom:void 0,href:Ie})}function y(P){return typeof P=="string"?rd(n,P,u.value.path):gt({},P)}function E(P,z){if(d!==P)return us(8,{from:z,to:P})}function S(P){return C(P)}function T(P){return S(gt(y(P),{replace:!0}))}function R(P){const z=P.matched[P.matched.length-1];if(z&&z.redirect){const{redirect:G}=z;let K=typeof G=="function"?G(P):G;return typeof K=="string"&&(K=K.includes("?")||K.includes("#")?K=y(K):{path:K},K.params={}),gt({query:P.query,hash:P.hash,params:P.params},K)}}function C(P,z){const G=d=_(P),K=u.value,pe=P.state,be=P.force,Ie=P.replace===!0,we=R(G);if(we)return C(gt(y(we),{state:pe,force:be,replace:Ie}),z||G);const k=G;k.redirectedFrom=z;let j;return!be&&uU(r,K,G)&&(j=us(16,{to:k,from:K}),le(K,K,!0,!1)),(j?Promise.resolve(j):L(k,K)).catch(H=>ji(H)?H:x(H,k,K)).then(H=>{if(H){if(ji(H,2))return C(gt(y(H.to),{state:pe,force:be,replace:Ie}),z||k)}else H=b(k,K,!0,Ie,pe);return V(k,K,H),H})}function w(P,z){const G=E(P,z);return G?Promise.reject(G):Promise.resolve()}function L(P,z){let G;const[K,pe,be]=s$(P,z);G=id(K.reverse(),"beforeRouteLeave",P,z);for(const we of K)we.leaveGuards.forEach(k=>{G.push(di(k,P,z))});const Ie=w.bind(null,P,z);return G.push(Ie),No(G).then(()=>{G=[];for(const we of o.list())G.push(di(we,P,z));return G.push(Ie),No(G)}).then(()=>{G=id(pe,"beforeRouteUpdate",P,z);for(const we of pe)we.updateGuards.forEach(k=>{G.push(di(k,P,z))});return G.push(Ie),No(G)}).then(()=>{G=[];for(const we of P.matched)if(we.beforeEnter&&!z.matched.includes(we))if(Array.isArray(we.beforeEnter))for(const k of we.beforeEnter)G.push(di(k,P,z));else G.push(di(we.beforeEnter,P,z));return G.push(Ie),No(G)}).then(()=>(P.matched.forEach(we=>we.enterCallbacks={}),G=id(be,"beforeRouteEnter",P,z),G.push(Ie),No(G))).then(()=>{G=[];for(const we of s.list())G.push(di(we,P,z));return G.push(Ie),No(G)}).catch(we=>ji(we,8)?we:Promise.reject(we))}function V(P,z,G){for(const K of a.list())K(P,z,G)}function b(P,z,G,K,pe){const be=E(P,z);if(be)return be;const Ie=z===ai,we=Uo?history.state:{};G&&(K||Ie?i.replace(P.fullPath,gt({scroll:Ie&&we&&we.scroll},pe)):i.push(P.fullPath,pe)),u.value=P,le(P,z,G,Ie),Z()}let I;function N(){I=i.listen((P,z,G)=>{const K=_(P),pe=R(K);if(pe){C(gt(pe,{replace:!0}),K).catch(ca);return}d=K;const be=u.value;Uo&&vU(Sv(be.fullPath,G.delta),fl()),L(K,be).catch(Ie=>ji(Ie,12)?Ie:ji(Ie,2)?(C(Ie.to,K).then(we=>{ji(we,20)&&!G.delta&&G.type===Pa.pop&&i.go(-1,!1)}).catch(ca),Promise.reject()):(G.delta&&i.go(-G.delta,!1),x(Ie,K,be))).then(Ie=>{Ie=Ie||b(K,be,!1),Ie&&(G.delta?i.go(-G.delta,!1):G.type===Pa.pop&&ji(Ie,20)&&i.go(-1,!1)),V(K,be,Ie)}).catch(ca)})}let A=Ds(),M=Ds(),$;function x(P,z,G){Z(P);const K=M.list();return K.length?K.forEach(pe=>pe(P,z,G)):console.error(P),Promise.reject(P)}function q(){return $&&u.value!==ai?Promise.resolve():new Promise((P,z)=>{A.add([P,z])})}function Z(P){$||($=!0,N(),A.list().forEach(([z,G])=>P?G(P):z()),A.reset())}function le(P,z,G,K){const{scrollBehavior:pe}=e;if(!Uo||!pe)return Promise.resolve();const be=!G&&yU(Sv(P.fullPath,0))||(K||!G)&&history.state&&history.state.scroll||null;return yt().then(()=>pe(P,z,be)).then(Ie=>Ie&&mU(Ie)).catch(Ie=>x(Ie,P,z))}const Te=P=>i.go(P);let Ee;const ve=new Set;return{currentRoute:u,addRoute:h,removeRoute:p,hasRoute:v,getRoutes:m,resolve:_,options:e,push:S,replace:T,go:Te,back:()=>Te(-1),forward:()=>Te(1),beforeEach:o.add,beforeResolve:s.add,afterEach:a.add,onError:M.add,isReady:q,install(P){const z=this;P.component("RouterLink",t$),P.component("RouterView",o$),P.config.globalProperties.$router=z,Object.defineProperty(P.config.globalProperties,"$route",{enumerable:!0,get:()=>he(u)}),Uo&&!Ee&&u.value===ai&&(Ee=!0,S(i.location).catch(pe=>{}));const G={};for(const pe in ai)G[pe]=ne(()=>u.value[pe]);P.provide(ap,z),P.provide(GE,Hn(G)),P.provide(vf,u);const K=P.unmount;ve.add(P),P.unmount=function(){ve.delete(P),ve.size<1&&(d=ai,I&&I(),u.value=ai,Ee=!1,$=!1),K()}}}}function No(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function s$(e,t){const n=[],r=[],i=[],o=Math.max(t.matched.length,e.matched.length);for(let s=0;s<o;s++){const a=t.matched[s];a&&(e.matched.find(d=>cs(d,a))?r.push(a):n.push(a));const u=e.matched[s];u&&(t.matched.find(d=>cs(d,u))||i.push(u))}return[n,r,i]}var a$=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 i=42;t[n]=i;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 o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},kv=typeof Symbol!="undefined"&&Symbol,c$=a$,u$=function(){return typeof kv!="function"||typeof Symbol!="function"||typeof kv("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:c$()},l$="Function.prototype.bind called on incompatible ",od=Array.prototype.slice,d$=Object.prototype.toString,f$="[object Function]",h$=function(t){var n=this;if(typeof n!="function"||d$.call(n)!==f$)throw new TypeError(l$+n);for(var r=od.call(arguments,1),i,o=function(){if(this instanceof i){var f=n.apply(this,r.concat(od.call(arguments)));return Object(f)===f?f:this}else return n.apply(t,r.concat(od.call(arguments)))},s=Math.max(0,n.length-r.length),a=[],u=0;u<s;u++)a.push("$"+u);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var d=function(){};d.prototype=n.prototype,i.prototype=new d,d.prototype=null}return i},p$=h$,up=Function.prototype.bind||p$,g$=up,m$=g$.call(Function.call,Object.prototype.hasOwnProperty),it,Ma=SyntaxError,nC=Function,zo=TypeError,sd=function(e){try{return nC('"use strict"; return ('+e+").constructor;")()}catch{}},lo=Object.getOwnPropertyDescriptor;if(lo)try{lo({},"")}catch{lo=null}var ad=function(){throw new zo},v$=lo?function(){try{return arguments.callee,ad}catch{try{return lo(arguments,"callee").get}catch{return ad}}}():ad,Ao=u$(),fi=Object.getPrototypeOf||function(e){return e.__proto__},$o={},y$=typeof Uint8Array=="undefined"?it:fi(Uint8Array),Yo={"%AggregateError%":typeof AggregateError=="undefined"?it:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?it:ArrayBuffer,"%ArrayIteratorPrototype%":Ao?fi([][Symbol.iterator]()):it,"%AsyncFromSyncIteratorPrototype%":it,"%AsyncFunction%":$o,"%AsyncGenerator%":$o,"%AsyncGeneratorFunction%":$o,"%AsyncIteratorPrototype%":$o,"%Atomics%":typeof Atomics=="undefined"?it:Atomics,"%BigInt%":typeof BigInt=="undefined"?it:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?it:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?it:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?it:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?it:FinalizationRegistry,"%Function%":nC,"%GeneratorFunction%":$o,"%Int8Array%":typeof Int8Array=="undefined"?it:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?it:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?it:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ao?fi(fi([][Symbol.iterator]())):it,"%JSON%":typeof JSON=="object"?JSON:it,"%Map%":typeof Map=="undefined"?it:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Ao?it:fi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?it:Promise,"%Proxy%":typeof Proxy=="undefined"?it:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?it:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?it:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Ao?it:fi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?it:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ao?fi(""[Symbol.iterator]()):it,"%Symbol%":Ao?Symbol:it,"%SyntaxError%":Ma,"%ThrowTypeError%":v$,"%TypedArray%":y$,"%TypeError%":zo,"%Uint8Array%":typeof Uint8Array=="undefined"?it:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?it:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?it:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?it:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?it:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?it:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?it:WeakSet},_$=function e(t){var n;if(t==="%AsyncFunction%")n=sd("async function () {}");else if(t==="%GeneratorFunction%")n=sd("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=sd("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&(n=fi(i.prototype))}return Yo[t]=n,n},Dv={"%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"]},hl=up,Tu=m$,E$=hl.call(Function.call,Array.prototype.concat),C$=hl.call(Function.apply,Array.prototype.splice),Uv=hl.call(Function.call,String.prototype.replace),Su=hl.call(Function.call,String.prototype.slice),T$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S$=/\\(\\)?/g,R$=function(t){var n=Su(t,0,1),r=Su(t,-1);if(n==="%"&&r!=="%")throw new Ma("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Ma("invalid intrinsic syntax, expected opening `%`");var i=[];return Uv(t,T$,function(o,s,a,u){i[i.length]=a?Uv(u,S$,"$1"):s||o}),i},b$=function(t,n){var r=t,i;if(Tu(Dv,r)&&(i=Dv[r],r="%"+i[0]+"%"),Tu(Yo,r)){var o=Yo[r];if(o===$o&&(o=_$(r)),typeof o=="undefined"&&!n)throw new zo("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new Ma("intrinsic "+t+" does not exist!")},lp=function(t,n){if(typeof t!="string"||t.length===0)throw new zo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new zo('"allowMissing" argument must be a boolean');var r=R$(t),i=r.length>0?r[0]:"",o=b$("%"+i+"%",n),s=o.name,a=o.value,u=!1,d=o.alias;d&&(i=d[0],C$(r,E$([0,1],d)));for(var f=1,c=!0;f<r.length;f+=1){var l=r[f],h=Su(l,0,1),p=Su(l,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new Ma("property names with quotes must have matching quotes");if((l==="constructor"||!c)&&(u=!0),i+="."+l,s="%"+i+"%",Tu(Yo,s))a=Yo[s];else if(a!=null){if(!(l in a)){if(!n)throw new zo("base intrinsic for "+t+" exists, but the property is not available.");return}if(lo&&f+1>=r.length){var m=lo(a,l);c=!!m,c&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[l]}else c=Tu(a,l),a=a[l];c&&!u&&(Yo[s]=a)}}return a},rC={exports:{}};(function(e){var t=up,n=lp,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||t.call(i,r),s=n("%Object.getOwnPropertyDescriptor%",!0),a=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}e.exports=function(c){var l=o(t,i,arguments);if(s&&a){var h=s(l,"length");h.configurable&&a(l,"length",{value:1+u(0,c.length-(arguments.length-1))})}return l};var d=function(){return o(t,r,arguments)};a?a(e.exports,"apply",{value:d}):e.exports.apply=d})(rC);var iC=lp,oC=rC.exports,I$=oC(iC("String.prototype.indexOf")),w$=function(t,n){var r=iC(t,!!n);return typeof r=="function"&&I$(t,".prototype.")>-1?oC(r):r},O$={},N$=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:O$}),A$=KM(N$),dp=typeof Map=="function"&&Map.prototype,cd=Object.getOwnPropertyDescriptor&&dp?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ru=dp&&cd&&typeof cd.get=="function"?cd.get:null,P$=dp&&Map.prototype.forEach,fp=typeof Set=="function"&&Set.prototype,ud=Object.getOwnPropertyDescriptor&&fp?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,bu=fp&&ud&&typeof ud.get=="function"?ud.get:null,M$=fp&&Set.prototype.forEach,L$=typeof WeakMap=="function"&&WeakMap.prototype,la=L$?WeakMap.prototype.has:null,k$=typeof WeakSet=="function"&&WeakSet.prototype,da=k$?WeakSet.prototype.has:null,D$=typeof WeakRef=="function"&&WeakRef.prototype,$v=D$?WeakRef.prototype.deref:null,U$=Boolean.prototype.valueOf,$$=Object.prototype.toString,x$=Function.prototype.toString,B$=String.prototype.match,hp=String.prototype.slice,yi=String.prototype.replace,F$=String.prototype.toUpperCase,xv=String.prototype.toLowerCase,sC=RegExp.prototype.test,Bv=Array.prototype.concat,Rr=Array.prototype.join,V$=Array.prototype.slice,Fv=Math.floor,Ef=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ld=Object.getOwnPropertySymbols,Cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ls=typeof Symbol=="function"&&typeof Symbol.iterator=="object",an=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ls?"object":"symbol")?Symbol.toStringTag:null,aC=Object.prototype.propertyIsEnumerable,Vv=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function jv(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||sC.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Fv(-e):Fv(e);if(r!==e){var i=String(r),o=hp.call(t,i.length+1);return yi.call(i,n,"$&_")+"."+yi.call(yi.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yi.call(t,n,"$&_")}var dd=A$.custom,fd=dd&&uC(dd)?dd:null,j$=function e(t,n,r,i){var o=n||{};if(hi(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(hi(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=hi(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(hi(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(hi(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t=="undefined")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return dC(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var u=String(t);return a?jv(t,u):u}if(typeof t=="bigint"){var d=String(t)+"n";return a?jv(t,d):d}var f=typeof o.depth=="undefined"?5:o.depth;if(typeof r=="undefined"&&(r=0),r>=f&&f>0&&typeof t=="object")return Tf(t)?"[Array]":"[Object]";var c=ax(o,r);if(typeof i=="undefined")i=[];else if(lC(i,t)>=0)return"[Circular]";function l(N,A,M){if(A&&(i=V$.call(i),i.push(A)),M){var $={depth:o.depth};return hi(o,"quoteStyle")&&($.quoteStyle=o.quoteStyle),e(N,$,r+1,i)}return e(N,o,r+1,i)}if(typeof t=="function"){var h=X$(t),p=Oc(t,l);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(p.length>0?" { "+Rr.call(p,", ")+" }":"")}if(uC(t)){var m=ls?yi.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Cf.call(t);return typeof t=="object"&&!ls?Us(m):m}if(ix(t)){for(var v="<"+xv.call(String(t.nodeName)),_=t.attributes||[],y=0;y<_.length;y++)v+=" "+_[y].name+"="+cC(H$(_[y].value),"double",o);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+xv.call(String(t.nodeName))+">",v}if(Tf(t)){if(t.length===0)return"[]";var E=Oc(t,l);return c&&!sx(E)?"["+Sf(E,c)+"]":"[ "+Rr.call(E,", ")+" ]"}if(G$(t)){var S=Oc(t,l);return"cause"in t&&!aC.call(t,"cause")?"{ ["+String(t)+"] "+Rr.call(Bv.call("[cause]: "+l(t.cause),S),", ")+" }":S.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Rr.call(S,", ")+" }"}if(typeof t=="object"&&s){if(fd&&typeof t[fd]=="function")return t[fd]();if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Z$(t)){var T=[];return P$.call(t,function(N,A){T.push(l(A,t,!0)+" => "+l(N,t))}),Hv("Map",Ru.call(t),T,c)}if(nx(t)){var R=[];return M$.call(t,function(N){R.push(l(N,t))}),Hv("Set",bu.call(t),R,c)}if(ex(t))return hd("WeakMap");if(rx(t))return hd("WeakSet");if(tx(t))return hd("WeakRef");if(Y$(t))return Us(l(Number(t)));if(J$(t))return Us(l(Ef.call(t)));if(W$(t))return Us(U$.call(t));if(z$(t))return Us(l(String(t)));if(!q$(t)&&!K$(t)){var C=Oc(t,l),w=Vv?Vv(t)===Object.prototype:t instanceof Object||t.constructor===Object,L=t instanceof Object?"":"null prototype",V=!w&&an&&Object(t)===t&&an in t?hp.call(ki(t),8,-1):L?"Object":"",b=w||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",I=b+(V||L?"["+Rr.call(Bv.call([],V||[],L||[]),": ")+"] ":"");return C.length===0?I+"{}":c?I+"{"+Sf(C,c)+"}":I+"{ "+Rr.call(C,", ")+" }"}return String(t)};function cC(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function H$(e){return yi.call(String(e),/"/g,"&quot;")}function Tf(e){return ki(e)==="[object Array]"&&(!an||!(typeof e=="object"&&an in e))}function q$(e){return ki(e)==="[object Date]"&&(!an||!(typeof e=="object"&&an in e))}function K$(e){return ki(e)==="[object RegExp]"&&(!an||!(typeof e=="object"&&an in e))}function G$(e){return ki(e)==="[object Error]"&&(!an||!(typeof e=="object"&&an in e))}function z$(e){return ki(e)==="[object String]"&&(!an||!(typeof e=="object"&&an in e))}function Y$(e){return ki(e)==="[object Number]"&&(!an||!(typeof e=="object"&&an in e))}function W$(e){return ki(e)==="[object Boolean]"&&(!an||!(typeof e=="object"&&an in e))}function uC(e){if(ls)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Cf)return!1;try{return Cf.call(e),!0}catch{}return!1}function J$(e){if(!e||typeof e!="object"||!Ef)return!1;try{return Ef.call(e),!0}catch{}return!1}var Q$=Object.prototype.hasOwnProperty||function(e){return e in this};function hi(e,t){return Q$.call(e,t)}function ki(e){return $$.call(e)}function X$(e){if(e.name)return e.name;var t=B$.call(x$.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function lC(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 Z$(e){if(!Ru||!e||typeof e!="object")return!1;try{Ru.call(e);try{bu.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function ex(e){if(!la||!e||typeof e!="object")return!1;try{la.call(e,la);try{da.call(e,da)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function tx(e){if(!$v||!e||typeof e!="object")return!1;try{return $v.call(e),!0}catch{}return!1}function nx(e){if(!bu||!e||typeof e!="object")return!1;try{bu.call(e);try{Ru.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function rx(e){if(!da||!e||typeof e!="object")return!1;try{da.call(e,da);try{la.call(e,la)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function ix(e){return!e||typeof e!="object"?!1:typeof HTMLElement!="undefined"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function dC(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return dC(hp.call(e,0,t.maxStringLength),t)+r}var i=yi.call(yi.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ox);return cC(i,"single",t)}function ox(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":"")+F$.call(t.toString(16))}function Us(e){return"Object("+e+")"}function hd(e){return e+" { ? }"}function Hv(e,t,n,r){var i=r?Sf(n,r):Rr.call(n,", ");return e+" ("+t+") {"+i+"}"}function sx(e){for(var t=0;t<e.length;t++)if(lC(e[t],`
  17. `)>=0)return!1;return!0}function ax(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=Rr.call(Array(e.indent+1)," ");else return null;return{base:n,prev:Rr.call(Array(t+1),n)}}function Sf(e,t){if(e.length===0)return"";var n=`
  18. `+t.prev+t.base;return n+Rr.call(e,","+n)+`
  19. `+t.prev}function Oc(e,t){var n=Tf(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=hi(e,i)?t(e[i],e):""}var o=typeof ld=="function"?ld(e):[],s;if(ls){s={};for(var a=0;a<o.length;a++)s["$"+o[a]]=o[a]}for(var u in e)!hi(e,u)||n&&String(Number(u))===u&&u<e.length||ls&&s["$"+u]instanceof Symbol||(sC.call(/[^\w$]/,u)?r.push(t(u,e)+": "+t(e[u],e)):r.push(u+": "+t(e[u],e)));if(typeof ld=="function")for(var d=0;d<o.length;d++)aC.call(e,o[d])&&r.push("["+t(o[d])+"]: "+t(e[o[d]],e));return r}var pp=lp,Cs=w$,cx=j$,ux=pp("%TypeError%"),Nc=pp("%WeakMap%",!0),Ac=pp("%Map%",!0),lx=Cs("WeakMap.prototype.get",!0),dx=Cs("WeakMap.prototype.set",!0),fx=Cs("WeakMap.prototype.has",!0),hx=Cs("Map.prototype.get",!0),px=Cs("Map.prototype.set",!0),gx=Cs("Map.prototype.has",!0),gp=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},mx=function(e,t){var n=gp(e,t);return n&&n.value},vx=function(e,t,n){var r=gp(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},yx=function(e,t){return!!gp(e,t)},_x=function(){var t,n,r,i={assert:function(o){if(!i.has(o))throw new ux("Side channel does not contain "+cx(o))},get:function(o){if(Nc&&o&&(typeof o=="object"||typeof o=="function")){if(t)return lx(t,o)}else if(Ac){if(n)return hx(n,o)}else if(r)return mx(r,o)},has:function(o){if(Nc&&o&&(typeof o=="object"||typeof o=="function")){if(t)return fx(t,o)}else if(Ac){if(n)return gx(n,o)}else if(r)return yx(r,o);return!1},set:function(o,s){Nc&&o&&(typeof o=="object"||typeof o=="function")?(t||(t=new Nc),dx(t,o,s)):Ac?(n||(n=new Ac),px(n,o,s)):(r||(r={key:{},next:null}),vx(r,o,s))}};return i},Ex=String.prototype.replace,Cx=/%20/g,pd={RFC1738:"RFC1738",RFC3986:"RFC3986"},mp={default:pd.RFC3986,formatters:{RFC1738:function(e){return Ex.call(e,Cx,"+")},RFC3986:function(e){return String(e)}},RFC1738:pd.RFC1738,RFC3986:pd.RFC3986},Tx=mp,gd=Object.prototype.hasOwnProperty,Ji=Array.isArray,Tr=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Sx=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(Ji(r)){for(var i=[],o=0;o<r.length;++o)typeof r[o]!="undefined"&&i.push(r[o]);n.obj[n.prop]=i}}},fC=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]!="undefined"&&(r[i]=t[i]);return r},Rx=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(Ji(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!gd.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var i=t;return Ji(t)&&!Ji(n)&&(i=fC(t,r)),Ji(t)&&Ji(n)?(n.forEach(function(o,s){if(gd.call(t,s)){var a=t[s];a&&typeof a=="object"&&o&&typeof o=="object"?t[s]=e(a,o,r):t.push(o)}else t[s]=o}),t):Object.keys(n).reduce(function(o,s){var a=n[s];return gd.call(o,s)?o[s]=e(o[s],a,r):o[s]=a,o},i)},bx=function(t,n){return Object.keys(n).reduce(function(r,i){return r[i]=n[i],r},t)},Ix=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}},Ox=function(t,n,r,i,o){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(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var a="",u=0;u<s.length;++u){var d=s.charCodeAt(u);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===Tx.RFC1738&&(d===40||d===41)){a+=s.charAt(u);continue}if(d<128){a=a+Tr[d];continue}if(d<2048){a=a+(Tr[192|d>>6]+Tr[128|d&63]);continue}if(d<55296||d>=57344){a=a+(Tr[224|d>>12]+Tr[128|d>>6&63]+Tr[128|d&63]);continue}u+=1,d=65536+((d&1023)<<10|s.charCodeAt(u)&1023),a+=Tr[240|d>>18]+Tr[128|d>>12&63]+Tr[128|d>>6&63]+Tr[128|d&63]}return a},Nx=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],i=0;i<n.length;++i)for(var o=n[i],s=o.obj[o.prop],a=Object.keys(s),u=0;u<a.length;++u){var d=a[u],f=s[d];typeof f=="object"&&f!==null&&r.indexOf(f)===-1&&(n.push({obj:s,prop:d}),r.push(f))}return Sx(n),t},Ax=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},Px=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},Mx=function(t,n){return[].concat(t,n)},Lx=function(t,n){if(Ji(t)){for(var r=[],i=0;i<t.length;i+=1)r.push(n(t[i]));return r}return n(t)},hC={arrayToObject:fC,assign:bx,combine:Mx,compact:Nx,decode:Ix,encode:Ox,isBuffer:Px,isRegExp:Ax,maybeMap:Lx,merge:Rx},pC=_x,Rf=hC,fa=mp,kx=Object.prototype.hasOwnProperty,qv={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},ro=Array.isArray,Dx=String.prototype.split,Ux=Array.prototype.push,gC=function(e,t){Ux.apply(e,ro(t)?t:[t])},$x=Date.prototype.toISOString,Kv=fa.default,Jt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Rf.encode,encodeValuesOnly:!1,format:Kv,formatter:fa.formatters[Kv],indices:!1,serializeDate:function(t){return $x.call(t)},skipNulls:!1,strictNullHandling:!1},xx=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},md={},Bx=function e(t,n,r,i,o,s,a,u,d,f,c,l,h,p,m){for(var v=t,_=m,y=0,E=!1;(_=_.get(md))!==void 0&&!E;){var S=_.get(t);if(y+=1,typeof S!="undefined"){if(S===y)throw new RangeError("Cyclic object value");E=!0}typeof _.get(md)=="undefined"&&(y=0)}if(typeof a=="function"?v=a(n,v):v instanceof Date?v=f(v):r==="comma"&&ro(v)&&(v=Rf.maybeMap(v,function(x){return x instanceof Date?f(x):x})),v===null){if(i)return s&&!h?s(n,Jt.encoder,p,"key",c):n;v=""}if(xx(v)||Rf.isBuffer(v)){if(s){var T=h?n:s(n,Jt.encoder,p,"key",c);if(r==="comma"&&h){for(var R=Dx.call(String(v),","),C="",w=0;w<R.length;++w)C+=(w===0?"":",")+l(s(R[w],Jt.encoder,p,"value",c));return[l(T)+"="+C]}return[l(T)+"="+l(s(v,Jt.encoder,p,"value",c))]}return[l(n)+"="+l(String(v))]}var L=[];if(typeof v=="undefined")return L;var V;if(r==="comma"&&ro(v))V=[{value:v.length>0?v.join(",")||null:void 0}];else if(ro(a))V=a;else{var b=Object.keys(v);V=u?b.sort(u):b}for(var I=0;I<V.length;++I){var N=V[I],A=typeof N=="object"&&typeof N.value!="undefined"?N.value:v[N];if(!(o&&A===null)){var M=ro(v)?typeof r=="function"?r(n,N):n:n+(d?"."+N:"["+N+"]");m.set(t,y);var $=pC();$.set(md,m),gC(L,e(A,M,r,i,o,s,a,u,d,f,c,l,h,p,$))}}return L},Fx=function(t){if(!t)return Jt;if(t.encoder!==null&&typeof t.encoder!="undefined"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||Jt.charset;if(typeof t.charset!="undefined"&&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=fa.default;if(typeof t.format!="undefined"){if(!kx.call(fa.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var i=fa.formatters[r],o=Jt.filter;return(typeof t.filter=="function"||ro(t.filter))&&(o=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Jt.addQueryPrefix,allowDots:typeof t.allowDots=="undefined"?Jt.allowDots:!!t.allowDots,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Jt.charsetSentinel,delimiter:typeof t.delimiter=="undefined"?Jt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Jt.encode,encoder:typeof t.encoder=="function"?t.encoder:Jt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Jt.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Jt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Jt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Jt.strictNullHandling}},Vx=function(e,t){var n=e,r=Fx(t),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):ro(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var a;t&&t.arrayFormat in qv?a=t.arrayFormat:t&&"indices"in t?a=t.indices?"indices":"repeat":a="indices";var u=qv[a];i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var d=pC(),f=0;f<i.length;++f){var c=i[f];r.skipNulls&&n[c]===null||gC(s,Bx(n[c],c,u,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,d))}var l=s.join(r.delimiter),h=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),l.length>0?h+l:""},ds=hC,bf=Object.prototype.hasOwnProperty,jx=Array.isArray,Yt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ds.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Hx=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},mC=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},qx="utf8=%26%2310003%3B",Kx="utf8=%E2%9C%93",Gx=function(t,n){var r={},i=n.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),a=-1,u,d=n.charset;if(n.charsetSentinel)for(u=0;u<s.length;++u)s[u].indexOf("utf8=")===0&&(s[u]===Kx?d="utf-8":s[u]===qx&&(d="iso-8859-1"),a=u,u=s.length);for(u=0;u<s.length;++u)if(u!==a){var f=s[u],c=f.indexOf("]="),l=c===-1?f.indexOf("="):c+1,h,p;l===-1?(h=n.decoder(f,Yt.decoder,d,"key"),p=n.strictNullHandling?null:""):(h=n.decoder(f.slice(0,l),Yt.decoder,d,"key"),p=ds.maybeMap(mC(f.slice(l+1),n),function(m){return n.decoder(m,Yt.decoder,d,"value")})),p&&n.interpretNumericEntities&&d==="iso-8859-1"&&(p=Hx(p)),f.indexOf("[]=")>-1&&(p=jx(p)?[p]:p),bf.call(r,h)?r[h]=ds.combine(r[h],p):r[h]=p}return r},zx=function(e,t,n,r){for(var i=r?t:mC(t,n),o=e.length-1;o>=0;--o){var s,a=e[o];if(a==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var u=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,d=parseInt(u,10);!n.parseArrays&&u===""?s={0:i}:!isNaN(d)&&a!==u&&String(d)===u&&d>=0&&n.parseArrays&&d<=n.arrayLimit?(s=[],s[d]=i):u!=="__proto__"&&(s[u]=i)}i=s}return i},Yx=function(t,n,r,i){if(!!t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=r.depth>0&&s.exec(o),d=u?o.slice(0,u.index):o,f=[];if(d){if(!r.plainObjects&&bf.call(Object.prototype,d)&&!r.allowPrototypes)return;f.push(d)}for(var c=0;r.depth>0&&(u=a.exec(o))!==null&&c<r.depth;){if(c+=1,!r.plainObjects&&bf.call(Object.prototype,u[1].slice(1,-1))&&!r.allowPrototypes)return;f.push(u[1])}return u&&f.push("["+o.slice(u.index)+"]"),zx(f,n,r,i)}},Wx=function(t){if(!t)return Yt;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!="undefined"&&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=="undefined"?Yt.charset:t.charset;return{allowDots:typeof t.allowDots=="undefined"?Yt.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Yt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Yt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Yt.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Yt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Yt.comma,decoder:typeof t.decoder=="function"?t.decoder:Yt.decoder,delimiter:typeof t.delimiter=="string"||ds.isRegExp(t.delimiter)?t.delimiter:Yt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Yt.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Yt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Yt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Yt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Yt.strictNullHandling}},Jx=function(e,t){var n=Wx(t);if(e===""||e===null||typeof e=="undefined")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?Gx(e,n):e,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s<o.length;++s){var a=o[s],u=Yx(a,r[a],n,typeof e=="string");i=ds.merge(i,u,n)}return n.allowSparse===!0?i:ds.compact(i)},Qx=Vx,Xx=Jx,Zx=mp,vC={formats:Zx,parse:Xx,stringify:Qx},on=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof on!="undefined"&&on,Sn={searchParams:"URLSearchParams"in on,iterable:"Symbol"in on&&"iterator"in Symbol,blob:"FileReader"in on&&"Blob"in on&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in on,arrayBuffer:"ArrayBuffer"in on};function e3(e){return e&&DataView.prototype.isPrototypeOf(e)}if(Sn.arrayBuffer)var t3=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n3=ArrayBuffer.isView||function(e){return e&&t3.indexOf(Object.prototype.toString.call(e))>-1};function tc(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 vp(e){return typeof e!="string"&&(e=String(e)),e}function yp(e){var t={next:function(){var n=e.shift();return{done:n===void 0,value:n}}};return Sn.iterable&&(t[Symbol.iterator]=function(){return t}),t}function Ht(e){this.map={},e instanceof Ht?e.forEach(function(t,n){this.append(n,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}Ht.prototype.append=function(e,t){e=tc(e),t=vp(t);var n=this.map[e];this.map[e]=n?n+", "+t:t};Ht.prototype.delete=function(e){delete this.map[tc(e)]};Ht.prototype.get=function(e){return e=tc(e),this.has(e)?this.map[e]:null};Ht.prototype.has=function(e){return this.map.hasOwnProperty(tc(e))};Ht.prototype.set=function(e,t){this.map[tc(e)]=vp(t)};Ht.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)};Ht.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),yp(e)};Ht.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),yp(e)};Ht.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),yp(e)};Sn.iterable&&(Ht.prototype[Symbol.iterator]=Ht.prototype.entries);function vd(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function yC(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function r3(e){var t=new FileReader,n=yC(t);return t.readAsArrayBuffer(e),n}function i3(e){var t=new FileReader,n=yC(t);return t.readAsText(e),n}function o3(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 Gv(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function _C(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Sn.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Sn.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Sn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Sn.arrayBuffer&&Sn.blob&&e3(e)?(this._bodyArrayBuffer=Gv(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Sn.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||n3(e))?this._bodyArrayBuffer=Gv(e):this._bodyText=e=Object.prototype.toString.call(e):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):Sn.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Sn.blob&&(this.blob=function(){var e=vd(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=vd(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 return this.blob().then(r3)}),this.text=function(){var e=vd(this);if(e)return e;if(this._bodyBlob)return i3(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(o3(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Sn.formData&&(this.formData=function(){return this.text().then(c3)}),this.json=function(){return this.text().then(JSON.parse)},this}var s3=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function a3(e){var t=e.toUpperCase();return s3.indexOf(t)>-1?t:e}function vo(e,t){if(!(this instanceof vo))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 vo){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Ht(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 Ht(t.headers)),this.method=a3(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.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 i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}vo.prototype.clone=function(){return new vo(this,{body:this._bodyInit})};function c3(e){var t=new FormData;return e.trim().split("&").forEach(function(n){if(n){var r=n.split("="),i=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function u3(e){var t=new Ht,n=e.replace(/\r?\n[\t ]+/g," ");return n.split("\r").map(function(r){return r.indexOf(`
  20. `)===0?r.substr(1,r.length):r}).forEach(function(r){var i=r.split(":"),o=i.shift().trim();if(o){var s=i.join(":").trim();t.append(o,s)}}),t}_C.call(vo.prototype);function Mr(e,t){if(!(this instanceof Mr))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new Ht(t.headers),this.url=t.url||"",this._initBody(e)}_C.call(Mr.prototype);Mr.prototype.clone=function(){return new Mr(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Ht(this.headers),url:this.url})};Mr.error=function(){var e=new Mr(null,{status:0,statusText:""});return e.type="error",e};var l3=[301,302,303,307,308];Mr.redirect=function(e,t){if(l3.indexOf(t)===-1)throw new RangeError("Invalid status code");return new Mr(null,{status:t,headers:{location:e}})};var Qi=on.DOMException;try{new Qi}catch{Qi=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},Qi.prototype=Object.create(Error.prototype),Qi.prototype.constructor=Qi}function EC(e,t){return new Promise(function(n,r){var i=new vo(e,t);if(i.signal&&i.signal.aborted)return r(new Qi("Aborted","AbortError"));var o=new XMLHttpRequest;function s(){o.abort()}o.onload=function(){var u={status:o.status,statusText:o.statusText,headers:u3(o.getAllResponseHeaders()||"")};u.url="responseURL"in o?o.responseURL:u.headers.get("X-Request-URL");var d="response"in o?o.response:o.responseText;setTimeout(function(){n(new Mr(d,u))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){r(new Qi("Aborted","AbortError"))},0)};function a(u){try{return u===""&&on.location.href?on.location.href:u}catch{return u}}o.open(i.method,a(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(Sn.blob?o.responseType="blob":Sn.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof Ht)?Object.getOwnPropertyNames(t.headers).forEach(function(u){o.setRequestHeader(u,vp(t.headers[u]))}):i.headers.forEach(function(u,d){o.setRequestHeader(d,u)}),i.signal&&(i.signal.addEventListener("abort",s),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",s)}),o.send(typeof i._bodyInit=="undefined"?null:i._bodyInit)})}EC.polyfill=!0;on.fetch||(on.fetch=EC,on.Headers=Ht,on.Request=vo,on.Response=Mr);self.fetch.bind(self);function zv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zv(Object(n),!0).forEach(function(r){d3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zv(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ii(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ii=function(t){return typeof t}:Ii=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(e)}function nc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yv(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 _p(e,t,n){return t&&Yv(e.prototype,t),n&&Yv(e,n),e}function d3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CC(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&&ka(e,t)}function La(e){return La=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},La(e)}function ka(e,t){return ka=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},ka(e,t)}function TC(){if(typeof Reflect=="undefined"||!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 Zc(e,t,n){return TC()?Zc=Reflect.construct:Zc=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),d=new u;return s&&ka(d,s.prototype),d},Zc.apply(null,arguments)}function f3(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Iu(e){var t=typeof Map=="function"?new Map:void 0;return Iu=function(r){if(r===null||!f3(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return Zc(r,arguments,La(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ka(i,r)},Iu(e)}function h3(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p3(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 h3(e)}function SC(e){var t=TC();return function(){var r=La(e),i;if(t){var o=La(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return p3(this,i)}}function br(e){return g3(e)||m3(e)||v3(e)||y3()}function g3(e){if(Array.isArray(e))return If(e)}function m3(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function v3(e,t){if(!!e){if(typeof e=="string")return If(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 If(e,t)}}function If(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 y3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
  21. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _3(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(i,o){var s=-1;function a(u){if(u<=s)return Promise.reject(new Error("next() should not be called multiple times in one middleware!"));s=u;var d=e[u]||o;if(!d)return Promise.resolve();try{return Promise.resolve(d(i,function(){return a(u+1)}))}catch(f){return Promise.reject(f)}}return a(0)}}var yr=function(){function e(t){if(nc(this,e),!Array.isArray(t))throw new TypeError("Default middlewares must be an array!");this.defaultMiddlewares=br(t),this.middlewares=[]}return _p(e,[{key:"use",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1,defaultInstance:!1},i=!1,o=!1,s=!1;if(typeof r=="number"?(process&&process.env,i=!0,o=!1):Ii(r)==="object"&&r&&(o=r.global||!1,i=r.core||!1,s=r.defaultInstance||!1),o){e.globalMiddlewares.splice(e.globalMiddlewares.length-e.defaultGlobalMiddlewaresLength,0,n);return}if(i){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=_3([].concat(br(this.middlewares),br(this.defaultMiddlewares),br(e.globalMiddlewares),br(e.coreMiddlewares)));return r(n)}}]),e}();yr.globalMiddlewares=[];yr.defaultGlobalMiddlewaresLength=0;yr.coreMiddlewares=[];yr.defaultCoreMiddlewaresLength=0;var E3=function(){function e(t){nc(this,e),this.cache=new Map,this.timer={},this.extendOptions(t)}return _p(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 i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6e4;if(this.maxCache>0&&this.cache.size>=this.maxCache){var s=br(this.cache.keys())[0];this.cache.delete(s),this.timer[s]&&clearTimeout(this.timer[s])}var a=JSON.stringify(n);this.cache.set(a,r),o>0&&(this.timer[a]=setTimeout(function(){i.cache.delete(a),delete i.timer[a]},o))}},{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}(),RC=function(e){CC(n,e);var t=SC(n);function n(r,i){var o,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"RequestError";return nc(this,n),o=t.call(this,r),o.name="RequestError",o.request=i,o.type=s,o}return n}(Iu(Error)),Js=function(e){CC(n,e);var t=SC(n);function n(r,i,o,s){var a,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"ResponseError";return nc(this,n),a=t.call(this,i||r.statusText),a.name="ResponseError",a.data=o,a.response=r,a.request=s,a.type=u,a}return n}(Iu(Error));function C3(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 Wv(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 Js(n,"JSON.parse fail",e,r,"ParseError")}return e}function T3(e,t,n){return new Promise(function(r,i){setTimeout(function(){i(new RC(t||"timeout of ".concat(e,"ms exceeded"),n,"Timeout"))},e)})}function Jv(e){return new Promise(function(t,n){e.cancelToken&&e.cancelToken.promise.then(function(r){n(r)})})}var S3=Object.prototype.toString;function bC(){var e;return typeof process!="undefined"&&S3.call(process)==="[object process]"&&(e="NODE"),typeof XMLHttpRequest!="undefined"&&(e="BROWSER"),e}function wf(e){return Ii(e)==="object"&&Object.prototype.toString.call(e)==="[object Array]"}function IC(e){return typeof URLSearchParams!="undefined"&&e instanceof URLSearchParams}function R3(e){return Ii(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Qv(e){return e!==null&&Ii(e)==="object"}function Xv(e,t){if(!!e)if(Ii(e)!=="object"&&(e=[e]),wf(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 Zv(e){return IC(e)?vC.parse(e.toString(),{strictNullHandling:!0}):typeof e=="string"?[e]:e}function Of(e){return vC.stringify(e,{arrayFormat:"repeat",strictNullHandling:!0})}function wC(e,t){return bn(bn(bn({},e),t),{},{headers:bn(bn({},e.headers),t.headers),params:bn(bn({},Zv(e.params)),Zv(t.params)),method:(t.method||e.method||"get").toLowerCase()})}var b3=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.prefix,i=n.suffix;return r&&(t="".concat(r).concat(t)),i&&(t="".concat(t).concat(i)),{url:t,options:n}};function I3(e,t){var n=t.method,r=n===void 0?"get":n;return r.toLowerCase()==="get"}function w3(e,t){if(!e)return t();var n=e.req;n=n===void 0?{}:n;var r=n.options,i=r===void 0?{}:r,o=n.url,s=o===void 0?"":o,a=e.cache,u=e.responseInterceptors,d=i.timeout,f=d===void 0?0:d,c=i.timeoutMessage,l=i.__umiRequestCoreType__,h=l===void 0?"normal":l,p=i.useCache,m=p===void 0?!1:p,v=i.method,_=v===void 0?"get":v,y=i.params,E=i.ttl,S=i.validateCache,T=S===void 0?I3:S;if(h!=="normal")return process&&process.env,t();var R=fetch;if(!R)throw new Error("Global fetch not exist!");var C=bC()==="BROWSER",w=T(s,i)&&m&&C;if(w){var L=a.get({url:s,params:y,method:_});if(L)return L=L.clone(),L.useCache=!0,e.res=L,t()}var V;return f>0?V=Promise.race([Jv(i),R(s,i),T3(f,c,e.req)]):V=Promise.race([Jv(i),R(s,i)]),u.forEach(function(b){V=V.then(function(I){var N=typeof I.clone=="function"?I.clone():I;return b(N,i)})}),V.then(function(b){if(w&&b.status===200){var I=b.clone();I.useCache=!0,a.set({url:s,params:y,method:_},I,E)}return e.res=b,t()})}function O3(e,t){var n;return t().then(function(){if(!!e){var r=e.res,i=r===void 0?{}:r,o=e.req,s=o===void 0?{}:o,a=s||{},u=a.options;u=u===void 0?{}:u;var d=u.responseType,f=d===void 0?"json":d,c=u.charset,l=c===void 0?"utf8":c;u.getResponse;var h=u.throwErrIfParseFail,p=h===void 0?!1:h,m=u.parseResponse,v=m===void 0?!0:m;if(!!v&&!(!i||!i.clone)){if(n=bC()==="BROWSER"?i.clone():i,n.useCache=i.useCache||!1,l==="gbk")try{return i.blob().then(C3).then(function(_){return Wv(_,!1,n,s)})}catch(_){throw new Js(n,_.message,null,s,"ParseError")}else if(f==="json")return i.text().then(function(_){return Wv(_,p,n,s)});try{return i[f]()}catch{throw new Js(n,"responseType not support",null,s,"ParseError")}}}}).then(function(r){if(!!e){e.res;var i=e.req,o=i===void 0?{}:i,s=o||{},a=s.options;a=a===void 0?{}:a;var u=a.getResponse,d=u===void 0?!1:u;if(!!n){if(n.status>=200&&n.status<300){if(d){e.res={data:r,response:n};return}e.res=r;return}throw new Js(n,"http error",r,o,"HttpError")}}}).catch(function(r){if(r instanceof RC||r instanceof Js)throw r;var i=e.req,o=e.res;throw r.request=r.request||i,r.response=r.response||o,r.type=r.type||r.name,r.data=r.data||void 0,r})}function N3(e,t){if(!e)return t();var n=e.req;n=n===void 0?{}:n;var r=n.options,i=r===void 0?{}:r,o=i.method,s=o===void 0?"get":o;if(["post","put","patch","delete"].indexOf(s.toLowerCase())===-1)return t();var a=i.requestType,u=a===void 0?"json":a,d=i.data;if(d){var f=Object.prototype.toString.call(d);f==="[object Object]"||f==="[object Array]"?u==="json"?(i.headers=bn({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},i.headers),i.body=JSON.stringify(d)):u==="form"&&(i.headers=bn({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},i.headers),i.body=Of(d)):(i.headers=bn({Accept:"application/json"},i.headers),i.body=d)}return e.req.options=i,t()}function A3(e,t){var n,r;if(e)if(t)n=t(e);else if(IC(e))n=e.toString();else if(wf(e))r=[],Xv(e,function(o){o===null||typeof o=="undefined"?r.push(o):r.push(Qv(o)?JSON.stringify(o):o)}),n=Of(r);else{r={},Xv(e,function(o,s){var a=o;o===null||typeof o=="undefined"?r[s]=o:R3(o)?a=o.toISOString():wf(o)?a=o:Qv(o)&&(a=JSON.stringify(o)),r[s]=a});var i=Of(r);n=i}return n}function P3(e,t){if(!e)return t();var n=e.req;n=n===void 0?{}:n;var r=n.options,i=r===void 0?{}:r,o=i.paramsSerializer,s=i.params,a=e.req;a=a===void 0?{}:a;var u=a.url,d=u===void 0?"":u;i.method=i.method?i.method.toUpperCase():"GET",i.credentials=i.credentials||"same-origin";var f=A3(s,o);if(e.req.originUrl=d,f){var c=d.indexOf("?")!==-1?"&":"?";e.req.url="".concat(d).concat(c).concat(f)}return e.req.options=i,t()}var OC=[N3,P3,O3],NC=[w3];yr.globalMiddlewares=OC;yr.defaultGlobalMiddlewaresLength=OC.length;yr.coreMiddlewares=NC;yr.defaultCoreMiddlewaresLength=NC.length;var ha=function(){function e(t){nc(this,e),this.onion=new yr([]),this.fetchIndex=0,this.mapCache=new E3(t),this.initOptions=t,this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[]}return _p(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=wC(this.initOptions,n),this.mapCache.extendOptions(n)}},{key:"dealRequestInterceptors",value:function(n){var r=function(s,a){return s.then(function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n.req.url=u.url||n.req.url,n.req.options=u.options||n.req.options,a(n.req.url,n.req.options)})},i=[].concat(br(e.requestInterceptors),br(this.instanceRequestInterceptors));return i.reduce(r,Promise.resolve()).then(function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return n.req.url=o.url||n.req.url,n.req.options=o.options||n.req.options,Promise.resolve()})}},{key:"request",value:function(n,r){var i=this,o=this.onion,s={req:{url:n,options:bn(bn({},r),{},{url:n})},res:null,cache:this.mapCache,responseInterceptors:[].concat(br(e.responseInterceptors),br(this.instanceResponseInterceptors))};if(typeof n!="string")throw new Error("url MUST be a string");return new Promise(function(a,u){i.dealRequestInterceptors(s).then(function(){return o.execute(s)}).then(function(){a(s.res)}).catch(function(d){var f=s.req.options.errorHandler;if(f)try{var c=f(d);a(c)}catch(l){u(l)}else u(d)})})}}],[{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}();ha.requestInterceptors=[b3];ha.responseInterceptors=[];function pl(e){this.message=e}pl.prototype.toString=function(){return this.message?"Cancel: ".concat(this.message):"Cancel"};pl.prototype.__CANCEL__=!0;function wu(e){if(typeof e!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(i){t=i});var n=this;e(function(i){n.reason||(n.reason=new pl(i),t(n.reason))})}wu.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};wu.source=function(){var t,n=new wu(function(i){t=i});return{token:n,cancel:t}};function M3(e){return!!(e&&e.__CANCEL__)}var Ep=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=new ha(t),r=function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=wC(n.initOptions,a);return n.request(s,u)};r.use=n.use.bind(n),r.fetchIndex=n.fetchIndex,r.interceptors={request:{use:ha.requestUse.bind(n)},response:{use:ha.responseUse.bind(n)}};var i=["get","post","delete","put","patch","head","options","rpc"];return i.forEach(function(o){r[o]=function(s,a){return r(s,bn(bn({},a),{},{method:o}))}}),r.Cancel=pl,r.CancelToken=wu,r.isCancel=M3,r.extendOptions=n.extendOptions.bind(n),r.middlewares={instance:n.onion.middlewares,defaultInstance:n.onion.defaultMiddlewares,global:yr.globalMiddlewares,core:yr.coreMiddlewares},r},yF=function(t){return Ep(t)};Ep({parseResponse:!1});Ep({});var Nf={exports:{}};(function(e,t){var n=9007199254740991,r="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",s="[object Map]",a="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",c="[object DataView]",l=/[\\^$.*+?()[\]{}|]/g,h=/^\[object .+?Constructor\]$/,p=typeof qr=="object"&&qr&&qr.Object===Object&&qr,m=typeof self=="object"&&self&&self.Object===Object&&self,v=p||m||Function("return this")(),_=t&&!t.nodeType&&t,y=_&&!0&&e&&!e.nodeType&&e,E=y&&y.exports===_;function S(oe,Me){return oe==null?void 0:oe[Me]}function T(oe){var Me=!1;if(oe!=null&&typeof oe.toString!="function")try{Me=!!(oe+"")}catch{}return Me}function R(oe,Me){return function(We){return oe(Me(We))}}var C=Function.prototype,w=Object.prototype,L=v["__core-js_shared__"],V=function(){var oe=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||"");return oe?"Symbol(src)_1."+oe:""}(),b=C.toString,I=w.hasOwnProperty,N=w.toString,A=RegExp("^"+b.call(I).replace(l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=E?v.Buffer:void 0,$=w.propertyIsEnumerable,x=M?M.isBuffer:void 0,q=R(Object.keys,Object),Z=we(v,"DataView"),le=we(v,"Map"),Te=we(v,"Promise"),Ee=we(v,"Set"),ve=we(v,"WeakMap"),Se=!$.call({valueOf:1},"valueOf"),P=W(Z),z=W(le),G=W(Te),K=W(Ee),pe=W(ve);function be(oe){return N.call(oe)}function Ie(oe){if(!Ae(oe)||j(oe))return!1;var Me=Ne(oe)||T(oe)?A:h;return Me.test(W(oe))}function we(oe,Me){var We=S(oe,Me);return Ie(We)?We:void 0}var k=be;(Z&&k(new Z(new ArrayBuffer(1)))!=c||le&&k(new le)!=s||Te&&k(Te.resolve())!=u||Ee&&k(new Ee)!=d||ve&&k(new ve)!=f)&&(k=function(oe){var Me=N.call(oe),We=Me==a?oe.constructor:void 0,qt=We?W(We):void 0;if(qt)switch(qt){case P:return c;case z:return s;case G:return u;case K:return d;case pe:return f}return Me});function j(oe){return!!V&&V in oe}function H(oe){var Me=oe&&oe.constructor,We=typeof Me=="function"&&Me.prototype||w;return oe===We}function W(oe){if(oe!=null){try{return b.call(oe)}catch{}try{return oe+""}catch{}}return""}function te(oe){return ae(oe)&&I.call(oe,"callee")&&(!$.call(oe,"callee")||N.call(oe)==r)}var ce=Array.isArray;function _e(oe){return oe!=null&&Re(oe.length)&&!Ne(oe)}function ae(oe){return xe(oe)&&_e(oe)}var ge=x||Xe;function se(oe){if(_e(oe)&&(ce(oe)||typeof oe=="string"||typeof oe.splice=="function"||ge(oe)||te(oe)))return!oe.length;var Me=k(oe);if(Me==s||Me==d)return!oe.size;if(Se||H(oe))return!q(oe).length;for(var We in oe)if(I.call(oe,We))return!1;return!0}function Ne(oe){var Me=Ae(oe)?N.call(oe):"";return Me==i||Me==o}function Re(oe){return typeof oe=="number"&&oe>-1&&oe%1==0&&oe<=n}function Ae(oe){var Me=typeof oe;return!!oe&&(Me=="object"||Me=="function")}function xe(oe){return!!oe&&typeof oe=="object"}function Xe(){return!1}e.exports=se})(Nf,Nf.exports);var L3="[object Object]";function k3(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function D3(e,t){return function(n){return e(t(n))}}var U3=Function.prototype,AC=Object.prototype,PC=U3.toString,$3=AC.hasOwnProperty,x3=PC.call(Object),B3=AC.toString,F3=D3(Object.getPrototypeOf,Object);function V3(e){return!!e&&typeof e=="object"}function j3(e){if(!V3(e)||B3.call(e)!=L3||k3(e))return!1;var t=F3(e);if(t===null)return!0;var n=$3.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&PC.call(n)==x3}var H3=j3,Af={exports:{}};(function(e,t){var n=200,r="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,a=1/0,u=9007199254740991,d="[object Arguments]",f="[object Array]",c="[object Boolean]",l="[object Date]",h="[object Error]",p="[object Function]",m="[object GeneratorFunction]",v="[object Map]",_="[object Number]",y="[object Object]",E="[object Promise]",S="[object RegExp]",T="[object Set]",R="[object String]",C="[object Symbol]",w="[object WeakMap]",L="[object ArrayBuffer]",V="[object DataView]",b="[object Float32Array]",I="[object Float64Array]",N="[object Int8Array]",A="[object Int16Array]",M="[object Int32Array]",$="[object Uint8Array]",x="[object Uint8ClampedArray]",q="[object Uint16Array]",Z="[object Uint32Array]",le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Te=/^\w*$/,Ee=/^\./,ve=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Se=/[\\^$.*+?()[\]{}|]/g,P=/\\(\\)?/g,z=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,K={};K[b]=K[I]=K[N]=K[A]=K[M]=K[$]=K[x]=K[q]=K[Z]=!0,K[d]=K[f]=K[L]=K[c]=K[V]=K[l]=K[h]=K[p]=K[v]=K[_]=K[y]=K[S]=K[T]=K[R]=K[w]=!1;var pe=typeof qr=="object"&&qr&&qr.Object===Object&&qr,be=typeof self=="object"&&self&&self.Object===Object&&self,Ie=pe||be||Function("return this")(),we=t&&!t.nodeType&&t,k=we&&!0&&e&&!e.nodeType&&e,j=k&&k.exports===we,H=j&&pe.process,W=function(){try{return H&&H.binding("util")}catch{}}(),te=W&&W.isTypedArray;function ce(O,U){for(var X=-1,fe=O?O.length:0;++X<fe&&U(O[X],X,O)!==!1;);return O}function _e(O,U){for(var X=-1,fe=O?O.length:0;++X<fe;)if(U(O[X],X,O))return!0;return!1}function ae(O){return function(U){return U==null?void 0:U[O]}}function ge(O,U){for(var X=-1,fe=Array(O);++X<O;)fe[X]=U(X);return fe}function se(O){return function(U){return O(U)}}function Ne(O,U){return O==null?void 0:O[U]}function Re(O){var U=!1;if(O!=null&&typeof O.toString!="function")try{U=!!(O+"")}catch{}return U}function Ae(O){var U=-1,X=Array(O.size);return O.forEach(function(fe,Ye){X[++U]=[Ye,fe]}),X}function xe(O,U){return function(X){return O(U(X))}}function Xe(O){var U=-1,X=Array(O.size);return O.forEach(function(fe){X[++U]=fe}),X}var oe=Array.prototype,Me=Function.prototype,We=Object.prototype,qt=Ie["__core-js_shared__"],Lr=function(){var O=/[^.]+$/.exec(qt&&qt.keys&&qt.keys.IE_PROTO||"");return O?"Symbol(src)_1."+O:""}(),Is=Me.toString,ln=We.hasOwnProperty,kr=We.toString,dn=RegExp("^"+Is.call(ln).replace(Se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Nn=Ie.Symbol,ws=Ie.Uint8Array,sS=xe(Object.getPrototypeOf,Object),aS=Object.create,cS=We.propertyIsEnumerable,uS=oe.splice,lS=xe(Object.keys,Object),Nl=Ro(Ie,"DataView"),Os=Ro(Ie,"Map"),Al=Ro(Ie,"Promise"),Pl=Ro(Ie,"Set"),Ml=Ro(Ie,"WeakMap"),Ns=Ro(Object,"create"),dS=Ui(Nl),fS=Ui(Os),hS=Ui(Al),pS=Ui(Pl),gS=Ui(Ml),cc=Nn?Nn.prototype:void 0,Ll=cc?cc.valueOf:void 0,Sg=cc?cc.toString:void 0;function Di(O){var U=-1,X=O?O.length:0;for(this.clear();++U<X;){var fe=O[U];this.set(fe[0],fe[1])}}function mS(){this.__data__=Ns?Ns(null):{}}function vS(O){return this.has(O)&&delete this.__data__[O]}function yS(O){var U=this.__data__;if(Ns){var X=U[O];return X===i?void 0:X}return ln.call(U,O)?U[O]:void 0}function _S(O){var U=this.__data__;return Ns?U[O]!==void 0:ln.call(U,O)}function ES(O,U){var X=this.__data__;return X[O]=Ns&&U===void 0?i:U,this}Di.prototype.clear=mS,Di.prototype.delete=vS,Di.prototype.get=yS,Di.prototype.has=_S,Di.prototype.set=ES;function Dr(O){var U=-1,X=O?O.length:0;for(this.clear();++U<X;){var fe=O[U];this.set(fe[0],fe[1])}}function CS(){this.__data__=[]}function TS(O){var U=this.__data__,X=lc(U,O);if(X<0)return!1;var fe=U.length-1;return X==fe?U.pop():uS.call(U,X,1),!0}function SS(O){var U=this.__data__,X=lc(U,O);return X<0?void 0:U[X][1]}function RS(O){return lc(this.__data__,O)>-1}function bS(O,U){var X=this.__data__,fe=lc(X,O);return fe<0?X.push([O,U]):X[fe][1]=U,this}Dr.prototype.clear=CS,Dr.prototype.delete=TS,Dr.prototype.get=SS,Dr.prototype.has=RS,Dr.prototype.set=bS;function Ur(O){var U=-1,X=O?O.length:0;for(this.clear();++U<X;){var fe=O[U];this.set(fe[0],fe[1])}}function IS(){this.__data__={hash:new Di,map:new(Os||Dr),string:new Di}}function wS(O){return dc(this,O).delete(O)}function OS(O){return dc(this,O).get(O)}function NS(O){return dc(this,O).has(O)}function AS(O,U){return dc(this,O).set(O,U),this}Ur.prototype.clear=IS,Ur.prototype.delete=wS,Ur.prototype.get=OS,Ur.prototype.has=NS,Ur.prototype.set=AS;function uc(O){var U=-1,X=O?O.length:0;for(this.__data__=new Ur;++U<X;)this.add(O[U])}function PS(O){return this.__data__.set(O,i),this}function MS(O){return this.__data__.has(O)}uc.prototype.add=uc.prototype.push=PS,uc.prototype.has=MS;function $r(O){this.__data__=new Dr(O)}function LS(){this.__data__=new Dr}function kS(O){return this.__data__.delete(O)}function DS(O){return this.__data__.get(O)}function US(O){return this.__data__.has(O)}function $S(O,U){var X=this.__data__;if(X instanceof Dr){var fe=X.__data__;if(!Os||fe.length<n-1)return fe.push([O,U]),this;X=this.__data__=new Ur(fe)}return X.set(O,U),this}$r.prototype.clear=LS,$r.prototype.delete=kS,$r.prototype.get=DS,$r.prototype.has=US,$r.prototype.set=$S;function xS(O,U){var X=xr(O)||Pg(O)?ge(O.length,String):[],fe=X.length,Ye=!!fe;for(var Pe in O)(U||ln.call(O,Pe))&&!(Ye&&(Pe=="length"||wg(Pe,fe)))&&X.push(Pe);return X}function lc(O,U){for(var X=O.length;X--;)if(Ag(O[X][0],U))return X;return-1}function BS(O){return bo(O)?aS(O):{}}var FS=eR();function VS(O,U){return O&&FS(O,U,gc)}function Rg(O,U){U=fc(U,O)?[U]:bg(U);for(var X=0,fe=U.length;O!=null&&X<fe;)O=O[hc(U[X++])];return X&&X==fe?O:void 0}function jS(O){return kr.call(O)}function HS(O,U){return O!=null&&U in Object(O)}function kl(O,U,X,fe,Ye){return O===U?!0:O==null||U==null||!bo(O)&&!pc(U)?O!==O&&U!==U:qS(O,U,kl,X,fe,Ye)}function qS(O,U,X,fe,Ye,Pe){var ut=xr(O),ft=xr(U),Tt=f,Kt=f;ut||(Tt=ni(O),Tt=Tt==d?y:Tt),ft||(Kt=ni(U),Kt=Kt==d?y:Kt);var fn=Tt==y&&!Re(O),Cn=Kt==y&&!Re(U),Gt=Tt==Kt;if(Gt&&!fn)return Pe||(Pe=new $r),ut||Lg(O)?Ig(O,U,X,fe,Ye,Pe):tR(O,U,Tt,X,fe,Ye,Pe);if(!(Ye&s)){var Kn=fn&&ln.call(O,"__wrapped__"),Gn=Cn&&ln.call(U,"__wrapped__");if(Kn||Gn){var ri=Kn?O.value():O,Br=Gn?U.value():U;return Pe||(Pe=new $r),X(ri,Br,fe,Ye,Pe)}}return Gt?(Pe||(Pe=new $r),nR(O,U,X,fe,Ye,Pe)):!1}function KS(O,U,X,fe){var Ye=X.length,Pe=Ye,ut=!fe;if(O==null)return!Pe;for(O=Object(O);Ye--;){var ft=X[Ye];if(ut&&ft[2]?ft[1]!==O[ft[0]]:!(ft[0]in O))return!1}for(;++Ye<Pe;){ft=X[Ye];var Tt=ft[0],Kt=O[Tt],fn=ft[1];if(ut&&ft[2]){if(Kt===void 0&&!(Tt in O))return!1}else{var Cn=new $r;if(fe)var Gt=fe(Kt,fn,Tt,O,U,Cn);if(!(Gt===void 0?kl(fn,Kt,fe,o|s,Cn):Gt))return!1}}return!0}function GS(O){if(!bo(O)||sR(O))return!1;var U=Ul(O)||Re(O)?dn:z;return U.test(Ui(O))}function zS(O){return pc(O)&&$l(O.length)&&!!K[kr.call(O)]}function YS(O){return typeof O=="function"?O:O==null?pR:typeof O=="object"?xr(O)?QS(O[0],O[1]):JS(O):gR(O)}function WS(O){if(!aR(O))return lS(O);var U=[];for(var X in Object(O))ln.call(O,X)&&X!="constructor"&&U.push(X);return U}function JS(O){var U=rR(O);return U.length==1&&U[0][2]?Ng(U[0][0],U[0][1]):function(X){return X===O||KS(X,O,U)}}function QS(O,U){return fc(O)&&Og(U)?Ng(hc(O),U):function(X){var fe=dR(X,O);return fe===void 0&&fe===U?fR(X,O):kl(U,fe,void 0,o|s)}}function XS(O){return function(U){return Rg(U,O)}}function ZS(O){if(typeof O=="string")return O;if(xl(O))return Sg?Sg.call(O):"";var U=O+"";return U=="0"&&1/O==-a?"-0":U}function bg(O){return xr(O)?O:cR(O)}function eR(O){return function(U,X,fe){for(var Ye=-1,Pe=Object(U),ut=fe(U),ft=ut.length;ft--;){var Tt=ut[O?ft:++Ye];if(X(Pe[Tt],Tt,Pe)===!1)break}return U}}function Ig(O,U,X,fe,Ye,Pe){var ut=Ye&s,ft=O.length,Tt=U.length;if(ft!=Tt&&!(ut&&Tt>ft))return!1;var Kt=Pe.get(O);if(Kt&&Pe.get(U))return Kt==U;var fn=-1,Cn=!0,Gt=Ye&o?new uc:void 0;for(Pe.set(O,U),Pe.set(U,O);++fn<ft;){var Kn=O[fn],Gn=U[fn];if(fe)var ri=ut?fe(Gn,Kn,fn,U,O,Pe):fe(Kn,Gn,fn,O,U,Pe);if(ri!==void 0){if(ri)continue;Cn=!1;break}if(Gt){if(!_e(U,function(Br,$i){if(!Gt.has($i)&&(Kn===Br||X(Kn,Br,fe,Ye,Pe)))return Gt.add($i)})){Cn=!1;break}}else if(!(Kn===Gn||X(Kn,Gn,fe,Ye,Pe))){Cn=!1;break}}return Pe.delete(O),Pe.delete(U),Cn}function tR(O,U,X,fe,Ye,Pe,ut){switch(X){case V:if(O.byteLength!=U.byteLength||O.byteOffset!=U.byteOffset)return!1;O=O.buffer,U=U.buffer;case L:return!(O.byteLength!=U.byteLength||!fe(new ws(O),new ws(U)));case c:case l:case _:return Ag(+O,+U);case h:return O.name==U.name&&O.message==U.message;case S:case R:return O==U+"";case v:var ft=Ae;case T:var Tt=Pe&s;if(ft||(ft=Xe),O.size!=U.size&&!Tt)return!1;var Kt=ut.get(O);if(Kt)return Kt==U;Pe|=o,ut.set(O,U);var fn=Ig(ft(O),ft(U),fe,Ye,Pe,ut);return ut.delete(O),fn;case C:if(Ll)return Ll.call(O)==Ll.call(U)}return!1}function nR(O,U,X,fe,Ye,Pe){var ut=Ye&s,ft=gc(O),Tt=ft.length,Kt=gc(U),fn=Kt.length;if(Tt!=fn&&!ut)return!1;for(var Cn=Tt;Cn--;){var Gt=ft[Cn];if(!(ut?Gt in U:ln.call(U,Gt)))return!1}var Kn=Pe.get(O);if(Kn&&Pe.get(U))return Kn==U;var Gn=!0;Pe.set(O,U),Pe.set(U,O);for(var ri=ut;++Cn<Tt;){Gt=ft[Cn];var Br=O[Gt],$i=U[Gt];if(fe)var kg=ut?fe($i,Br,Gt,U,O,Pe):fe(Br,$i,Gt,O,U,Pe);if(!(kg===void 0?Br===$i||X(Br,$i,fe,Ye,Pe):kg)){Gn=!1;break}ri||(ri=Gt=="constructor")}if(Gn&&!ri){var mc=O.constructor,vc=U.constructor;mc!=vc&&"constructor"in O&&"constructor"in U&&!(typeof mc=="function"&&mc instanceof mc&&typeof vc=="function"&&vc instanceof vc)&&(Gn=!1)}return Pe.delete(O),Pe.delete(U),Gn}function dc(O,U){var X=O.__data__;return oR(U)?X[typeof U=="string"?"string":"hash"]:X.map}function rR(O){for(var U=gc(O),X=U.length;X--;){var fe=U[X],Ye=O[fe];U[X]=[fe,Ye,Og(Ye)]}return U}function Ro(O,U){var X=Ne(O,U);return GS(X)?X:void 0}var ni=jS;(Nl&&ni(new Nl(new ArrayBuffer(1)))!=V||Os&&ni(new Os)!=v||Al&&ni(Al.resolve())!=E||Pl&&ni(new Pl)!=T||Ml&&ni(new Ml)!=w)&&(ni=function(O){var U=kr.call(O),X=U==y?O.constructor:void 0,fe=X?Ui(X):void 0;if(fe)switch(fe){case dS:return V;case fS:return v;case hS:return E;case pS:return T;case gS:return w}return U});function iR(O,U,X){U=fc(U,O)?[U]:bg(U);for(var fe,Ye=-1,ut=U.length;++Ye<ut;){var Pe=hc(U[Ye]);if(!(fe=O!=null&&X(O,Pe)))break;O=O[Pe]}if(fe)return fe;var ut=O?O.length:0;return!!ut&&$l(ut)&&wg(Pe,ut)&&(xr(O)||Pg(O))}function wg(O,U){return U=U==null?u:U,!!U&&(typeof O=="number"||G.test(O))&&O>-1&&O%1==0&&O<U}function fc(O,U){if(xr(O))return!1;var X=typeof O;return X=="number"||X=="symbol"||X=="boolean"||O==null||xl(O)?!0:Te.test(O)||!le.test(O)||U!=null&&O in Object(U)}function oR(O){var U=typeof O;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?O!=="__proto__":O===null}function sR(O){return!!Lr&&Lr in O}function aR(O){var U=O&&O.constructor,X=typeof U=="function"&&U.prototype||We;return O===X}function Og(O){return O===O&&!bo(O)}function Ng(O,U){return function(X){return X==null?!1:X[O]===U&&(U!==void 0||O in Object(X))}}var cR=Dl(function(O){O=lR(O);var U=[];return Ee.test(O)&&U.push(""),O.replace(ve,function(X,fe,Ye,Pe){U.push(Ye?Pe.replace(P,"$1"):fe||X)}),U});function hc(O){if(typeof O=="string"||xl(O))return O;var U=O+"";return U=="0"&&1/O==-a?"-0":U}function Ui(O){if(O!=null){try{return Is.call(O)}catch{}try{return O+""}catch{}}return""}function Dl(O,U){if(typeof O!="function"||U&&typeof U!="function")throw new TypeError(r);var X=function(){var fe=arguments,Ye=U?U.apply(this,fe):fe[0],Pe=X.cache;if(Pe.has(Ye))return Pe.get(Ye);var ut=O.apply(this,fe);return X.cache=Pe.set(Ye,ut),ut};return X.cache=new(Dl.Cache||Ur),X}Dl.Cache=Ur;function Ag(O,U){return O===U||O!==O&&U!==U}function Pg(O){return uR(O)&&ln.call(O,"callee")&&(!cS.call(O,"callee")||kr.call(O)==d)}var xr=Array.isArray;function Mg(O){return O!=null&&$l(O.length)&&!Ul(O)}function uR(O){return pc(O)&&Mg(O)}function Ul(O){var U=bo(O)?kr.call(O):"";return U==p||U==m}function $l(O){return typeof O=="number"&&O>-1&&O%1==0&&O<=u}function bo(O){var U=typeof O;return!!O&&(U=="object"||U=="function")}function pc(O){return!!O&&typeof O=="object"}function xl(O){return typeof O=="symbol"||pc(O)&&kr.call(O)==C}var Lg=te?se(te):zS;function lR(O){return O==null?"":ZS(O)}function dR(O,U,X){var fe=O==null?void 0:Rg(O,U);return fe===void 0?X:fe}function fR(O,U){return O!=null&&iR(O,U,HS)}function gc(O){return Mg(O)?xS(O):WS(O)}function hR(O,U,X){var fe=xr(O)||Lg(O);if(U=YS(U),X==null)if(fe||bo(O)){var Ye=O.constructor;fe?X=xr(O)?new Ye:[]:X=Ul(Ye)?BS(sS(O)):{}}else X={};return(fe?ce:VS)(O,function(Pe,ut,ft){return U(X,Pe,ut,ft)}),X}function pR(O){return O}function gR(O){return fc(O)?ae(hc(O)):XS(O)}e.exports=hR})(Af,Af.exports);const q3=Nf.exports,ey=H3,K3=Af.exports;var _F=function e(t,{cleanKeys:n=[],cleanValues:r=[],emptyArrays:i=!0,emptyObjects:o=!0,emptyStrings:s=!0,NaNValues:a=!1,nullValues:u=!0,undefinedValues:d=!0}={}){return K3(t,(f,c,l)=>{if(!n.includes(l)&&((Array.isArray(c)||ey(c))&&(c=e(c,{NaNValues:a,cleanKeys:n,cleanValues:r,emptyArrays:i,emptyObjects:o,emptyStrings:s,nullValues:u,undefinedValues:d})),!r.includes(c)&&!(o&&ey(c)&&q3(c))&&!(i&&Array.isArray(c)&&!c.length)&&!(s&&c==="")&&!(a&&Number.isNaN(c))&&!(u&&c===null)&&!(d&&c===void 0))){if(Array.isArray(f))return f.push(c);f[l]=c}})},Pf;(function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"})(Pf||(Pf={}));var pi,yd,Da=Pf,G3=["https://nav.cn.ronghub.com","https://nav2-cn.ronghub.com"],z3=["wsproxy.cn.ronghub.com","wsap-cn.ronghub.com"],Y3=["cometproxy-cn.ronghub.com","mini-cn.ronghub.com"],ty={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0},"RC:FileMsg":{isCounted:!0,isPersited:!0},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcCmd":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RRReqMsg":{isCounted:!1,isPersited:!1},"RC:RRRspMsg":{isCounted:!1,isPersited:!1},"RC:CsChaR":{isCounted:!1,isPersited:!1},"RC:CSCha":{isCounted:!1,isPersited:!1},"RC:CsEva":{isCounted:!1,isPersited:!1},"RC:CsContact":{isCounted:!1,isPersited:!1},"RC:CsHs":{isCounted:!1,isPersited:!1},"RC:CsHsR":{isCounted:!1,isPersited:!1},"RC:CsSp":{isCounted:!1,isPersited:!1},"RC:CsEnd":{isCounted:!1,isPersited:!1},"RC:CsUpdate":{isCounted:!1,isPersited:!1},"RC:ReadNtf":{isCounted:!1,isPersited:!1},"RC:chrmKVNotiMsg":{isCounted:!1,isPersited:!1},"RC:VCAccept":{isCounted:!1,isPersited:!1},"RC:VCRinging":{isCounted:!1,isPersited:!1},"RC:VCSummary":{isCounted:!1,isPersited:!1},"RC:VCHangup":{isCounted:!1,isPersited:!1},"RC:VCInvite":{isCounted:!1,isPersited:!1},"RC:VCModifyMedia":{isCounted:!1,isPersited:!1},"RC:VCModifyMem":{isCounted:!1,isPersited:!1},"RC:MsgExMsg":{isCounted:!1,isPersited:!1},"RC:RRMsg":{isCounted:!1,isPersited:!1},"RC:LogCmdMsg":{isCounted:!1,isPersited:!1},"RC:InterceptMsg":{isCounted:!1,isPersited:!1}},W3=["RC:TypSts","RC:InterceptMsg"];(function(e){e.WEBSOCKET="websocket",e.COMET="comet"})(pi||(pi={}));var gl=function(e){return yd||(yd={set:function(t,n){e.localStorage.setItem(t,JSON.stringify(n))},get:function(t){var n;try{n=JSON.parse(e.localStorage.getItem(t))}catch{n=null}return n},remove:function(t){return e.localStorage.removeItem(t)},getKeys:function(){var t=[];for(var n in e.localStorage)t.push(n);return t}}),yd},J3=function(){function e(t){this._caches={},t&&(this._caches=t)}return e.prototype.set=function(t,n){this._caches[t]=n},e.prototype.remove=function(t){var n=this.get(t);return delete this._caches[t],n},e.prototype.get=function(t){return this._caches[t]},e.prototype.getKeys=function(){var t=[];for(var n in this._caches)t.push(n);return t},e}(),ny=function(){function e(t,n){var r,i=n?"RCV4-"+n:"RCV4-";this._rootStorage=gl(t);var o=this._rootStorage.get(i)||{};this._cache=new J3(((r={})[i]=o,r)),this._storageKey=i}return e.prototype._get=function(){var t=this._storageKey;return this._cache.get(t)||{}},e.prototype._set=function(t){var n=this._storageKey;t=t||{},this._cache.set(n,t),this._rootStorage.set(n,t)},e.prototype.set=function(t,n){var r=this._get();r[t]=n,this._set(r)},e.prototype.remove=function(t){var n=this._get();delete n[t],this._set(n)},e.prototype.clear=function(){var t=this._storageKey;this._rootStorage.remove(t),this._cache.remove(t)},e.prototype.get=function(t){return this._get()[t]},e.prototype.getKeys=function(){var t=this._get(),n=[];for(var r in t)n.push(r);return n},e.prototype.getValues=function(){return this._get()||{}},e}(),MC=function(e,t){return(MC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])})(e,t)};function xt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}MC(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rt=function(){return(Rt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function J(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(d){try{u(r.next(d))}catch(f){o(f)}}function a(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){var f;d.done?i(d.value):(f=d.value,f instanceof n?f:new n(function(c){c(f)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}function Q(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return function(f){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&f[0]?r.return:f[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,f[1])).done)return i;switch(r=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return s.label++,{value:f[1],done:!1};case 5:s.label++,r=f[1],f=[0];continue;case 7:f=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||f[0]!==6&&f[0]!==2)){s=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){s.label=f[1];break}if(f[0]===6&&s.label<i[1]){s.label=i[1],i=f;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(f);break}i[2]&&s.ops.pop(),s.trys.pop();continue}f=t.call(e,s)}catch(c){f=[6,c],r=0}finally{n=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([u,d])}}}function fo(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e}var Qt,Ou;(function(e){function t(n){return e.call(this,"TODO => "+n)||this}return xt(t,e),t})(Error);var ry=function(e,t,n){if(t===void 0||n===void 0)return e.toUpperCase();var r=e.slice(t,n);return e=e.replace(r,function(i){return i.toUpperCase()})},LC=function(e,t){t===void 0&&(t="utf-8");var n,r=0;if(t==="utf-16")for(var i=0,o=e.length;i<o;i++)r+=(n=e.charCodeAt(i))<=65535?2:4;else for(i=0,o=e.length;i<o;i++)r+=(n=e.charCodeAt(i))<127?1:n<=2047?2:n<=65535?3:4;return r},ml=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map(function(r){return r+"="+t[r]}).filter(function(r){return!!r});return n.length?[e,n.join("&")].join("?"):e},Cp=function(e){return e.match(/\d+(\.\d+){2}/)[0]};(function(e){e[e.LOG=0]="LOG",e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL",e[e.NONE=1e3]="NONE"})(Qt||(Qt={})),function(e){e.IM="IM",e.RTC="RTC"}(Ou||(Ou={}));var Wo="RC_Logs";function Q3(e){var t=e.target.result;e.oldVersion===1&&t.deleteObjectStore(Wo),function(n,r,i){var o;if(!n.objectStoreNames.contains(r)){var s=Rt({},i.objectStoreParams);o=n.createObjectStore(r,s),i.indexs&&i.indexs.length>0&&i.indexs.forEach(function(a){o.createIndex(a.indexName,a.key,{unique:a.unique})})}}(t,Wo,{indexs:[{indexName:"time",key:"time",unique:!1}],objectStoreParams:{autoIncrement:!0}})}var Mf,Tp=function(){function e(){}return e.init=function(){if(typeof window!="undefined"&&window&&window.indexedDB){var t=window.indexedDB.open("RC_ENGINE_DB",2);t.onerror=function(n){console.warn("open indexDB request failed "+n.target.error)},t.onsuccess=function(n){e._db=n.target.result,e._db&&(e._db.onclose=function(r){var i;console.warn("The database "+((i=e._db)===null||i===void 0?void 0:i.name)+" has unexpectedly closed.",r),e._db=null,e._instance=null},e._db.onerror=function(r){var i;console.warn("The database "+((i=e._db)===null||i===void 0?void 0:i.name)+" has opening error.",r),e._db=null,e._instance=null},e._db.onabort=function(r){var i;console.warn("The database "+((i=e._db)===null||i===void 0?void 0:i.name)+" has opening aborted.",r),e._db=null,e._instance=null}),e._instance=new e},t.onupgradeneeded=function(n){e._db=n.target.result,Q3(n)}}else console.debug("IndexDB is not currently supported in the environment!")},e.getInstance=function(){return e._instance},e.prototype.addList=function(t,n){return new Promise(function(r){if(e._db){var i=e._db.transaction([t],"readwrite"),o=i.objectStore(t);n.forEach(function(s){o==null||o.add(s)}),i.oncomplete=function(s){r(!0)},i.onerror=function(s){r(!1)}}else r(!1)})},e.prototype.getRangeData=function(t,n,r,i){return new Promise(function(o){if(e._db){var s=e._db.transaction([t],"readwrite").objectStore(t),a=IDBKeyRange.bound(r,i),u=s.index(n),d=[],f=u.openCursor(a);f.onsuccess=function(c){var l=c.target.result;l?(d.push(l.value),l.continue()):o(d)},f.onerror=function(c){console.error(c),o([])}}else o([])})},e.prototype.getCount=function(t,n){return new Promise(function(r){if(e._db){var i=e._db.transaction([t],"readonly").objectStore(t).count();i.onsuccess=function(){r(i.result)},i.onerror=function(o){console.error(o),r(0)}}else r(0)})},e.prototype.removeFirstData=function(t,n,r){return new Promise(function(i){if(e._db){var o=e._db.transaction([t],"readwrite").objectStore(t),s=o.getAllKeys(IDBKeyRange.lowerBound(0),r);s.onsuccess=function(){var a=s.result;a.length>0&&(o.delete(IDBKeyRange.bound(a[0],a[a.length-1])).onsuccess=function(){i(!0)})}}else i(!1)})},e._db=null,e}(),kC=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return(e==="x"?t:3&t|8).toString(16)})},DC=function(){var e=kC();if(e=e.replace(/-/g,"")+"a",(e=function(r){var i="0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0".split(""),o=i.length+1,s=+r,a=[];do{var u=s%o;s=(s-u)/o,a.unshift(i[u])}while(s);return a.join("")}(e=parseInt(e,16))).length>22&&(e=e.slice(0,22)),e.length<22)for(var t=22-e.length,n=0;n<t;n++)e+="0";return e};(function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.RTC_ROOM=12]="RTC_ROOM"})(Mf||(Mf={}));var Lf,$e=Mf;(function(e){e[e.IMAGE=1]="IMAGE",e[e.AUDIO=2]="AUDIO",e[e.VIDEO=3]="VIDEO",e[e.FILE=4]="FILE",e[e.SIGHT=5]="SIGHT",e[e.COMBINE_HTML=6]="COMBINE_HTML"})(Lf||(Lf={}));var Po,kf,Xt=Lf,Vn=function(e){return typeof e=="string"},Nu=function(e){return typeof e=="boolean"},Pt=function(e){return typeof e=="number"&&!isNaN(e)},In=function(e){return Object.prototype.toString.call(e).indexOf("Array")!==-1},UC=function(e){return Object.prototype.toString.call(e)==="[object ArrayBuffer]"},Mn=function(e){return Vn(e)&&e.length>0},sn=function(e){return Object.prototype.toString.call(e)==="[object Object]"},Au=function(e){return Object.prototype.toString.call(e)==="[object Function]"},mt=function(e){return e===void 0||Object.prototype.toString.call(e)==="[object Undefined]"},iy=function(e){return Object.prototype.toString.call(e)==="[object Null]"},Ua=function(e){return Vn(e)&&/https?:\/\//.test(e)},pa=function(e){for(var t in e)return!0;return!1},X3=function(e){return Pt(e)&&Object.prototype.hasOwnProperty.call(Xt,e)},oy=((Po={})[Qt.DEBUG]=console.debug.bind(console),Po[Qt.INFO]=console.info.bind(console),Po[Qt.WARN]=console.warn.bind(console),Po[Qt.ERROR]=console.error.bind(console),Po[Qt.FATAL]=console.log.bind(console),Po),sy=function(e){return Vn(e)||Pt(e)||mt(e)||Nu(e)?e:e instanceof Error?JSON.stringify({name:e.name,message:e.message,stack:e.stack}):JSON.stringify(e)},wi=function(){function e(t,n,r){this.tag=t,this.type=n,this.initiator=r,this._outLevel=Qt.WARN,this.debug=this.log.bind(this,Qt.DEBUG),this.info=this.log.bind(this,Qt.INFO),this.warn=this.log.bind(this,Qt.WARN),this.error=this.log.bind(this,Qt.ERROR),this.fatal=this.log.bind(this,Qt.FATAL)}return e.init=function(t){e.userId=t},e.reset=function(){e.userId=""},e.prototype._defaultStdout=function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];oy[t].apply(oy,fo([n+":"],r))},e.prototype.__pushLocalLog=function(t,n,r){var i;i=this.type?this.type:["RCRTCLog","RCCall","RCRTC","RTC-A"].includes(this.tag)?Ou.RTC:Ou.IM;var o=Date.now();LC(n)>=1e3&&(n=function(d,f,c){if(c===void 0&&(c="utf-8"),!d||!f)return"";var l=c==="utf-8"?3:2,h=0,p=0,m="";for(p=0;p<d.length;p++){if(d.charCodeAt(p)>255?h+=l:h++,h>f)return m;m+=d.charAt(p)}return d}(n,1e3));var s=JSON.stringify({message:n,userId:e.userId}).replace(/"/g,'""'),a=/^[\w]+-[\w]+-[\w]+?/.test(r)?r:(this.initiator||"L")+"-"+r+"-O",u={sessionId:e.sessionId,time:o,level:4-t,content:e.sessionId+","+Date.now()+","+i+","+(4-t)+","+a+',"'+s+`"
  22. `,userId:e.userId};e.databaseLogList.push(u),(e.databaseLogList.length>=100||t===Qt.FATAL)&&this.__insertLogIntoDatabase()},e.prototype.__insertLogIntoDatabase=function(){return J(this,void 0,void 0,function(){var t,n,r;return Q(this,function(i){switch(i.label){case 0:return t=fo([],e.databaseLogList),e.databaseLogList=[],(n=Tp.getInstance())?[4,n.addList(Wo,t)]:[3,3];case 1:return r=i.sent(),[4,n.getCount(Wo,"time")];case 2:return i.sent()>1e5&&n.removeFirstData(Wo,"time",2e3),[2,r];case 3:return[2,!1]}})})},e.prototype.setLogLevel=function(t){this._outLevel=typeof t!="number"?Qt.WARN:t},e.prototype.setLogStdout=function(t){this._logStdout=t},e.prototype.log=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(t>Qt.DEBUG&&this.__pushLocalLog(t,n.map(sy).join(" "),this.tag),!(t<this._outLevel)){var i=new Date().toISOString()+"["+this.tag+"]["+Qt[t]+"]",o=i+" - "+n.map(sy).join(" ");this._logStdout?this._logStdout(t,o):this._stdout?this._stdout(t,o):this._defaultStdout.apply(this,fo([t,i],n))}},e.prototype.reportLog=function(t,n,r){this.__pushLocalLog(4-t,r,n);var i=JSON.stringify({message:r}).replace(/"/g,'""');i='"'+i+'"';var o={level:t,content:[e.sessionId,Date.now(),this.type,t,n,i].join()+`
  23. `};e.realTimeLogList.push(o),e.realTimeLogList.length>=600&&(e.realTimeLogList=e.realTimeLogList.slice(-500))},e.prototype.set=function(t,n){this.warn("logger.set has being deprecated!")},e.prototype.setStdout=function(t){this._stdout=t},e.prototype.__clearRealTimeLog=function(){e.realTimeLogList=[]},e.databaseLogList=[],e.realTimeLogList=[],e.sessionId=DC(),e.userId="",e}(),de=new wi("RCLog"),rc=function(){function e(){this._map={}}return e.prototype.on=function(t,n,r){var i=this._map[t]||(this._map[t]=[]);i.some(function(o){return o.listener===n&&o.target===r})||i.push({listener:n,target:r})},e.prototype.once=function(t,n,r){var i=this._map[t]||(this._map[t]=[]);i.some(function(o){return o.listener===n&&o.target===r})||i.push({listener:n,target:r,once:!0})},e.prototype.off=function(t,n,r){var i=this._map[t];i&&((i=i.filter(function(o){return o.listener!==n||o.target!==r})).length?this._map[t]=i:delete this._map[t])},e.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._map[t];if(i)for(var o=i.length-1;o>=0;o-=1){var s=i[o],a=s.target,u=s.once,d=s.listener;u&&i.splice(o,1);try{d.call.apply(d,fo([a],n))}catch(f){de.error(f)}}},e.prototype.removeAll=function(t){delete this._map[t]},e.prototype.clear=function(){Object.keys(this._map).forEach(this.removeAll,this)},e}();(function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"})(kf||(kf={}));var Df,Qn=kf;(function(e){e[e.TIMEOUT=-1]="TIMEOUT",e[e.UNKNOWN=-2]="UNKNOWN",e[e.PARAMETER_ERROR=-3]="PARAMETER_ERROR",e[e.EXTRA_METHOD_UNDEFINED=-4]="EXTRA_METHOD_UNDEFINED",e[e.MAIN_PROCESS_ERROR=-5]="MAIN_PROCESS_ERROR",e[e.PARAMETER_CHANGED=-6]="PARAMETER_CHANGED",e[e.SUCCESS=0]="SUCCESS",e[e.RC_MSG_UNAUTHORIZED=20406]="RC_MSG_UNAUTHORIZED",e[e.RC_DISCUSSION_GROUP_ID_INVALID=20407]="RC_DISCUSSION_GROUP_ID_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.JOIN_IN_DISCUSSION=21407]="JOIN_IN_DISCUSSION",e[e.CREATE_DISCUSSION=21408]="CREATE_DISCUSSION",e[e.INVITE_DICUSSION=21409]="INVITE_DICUSSION",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_TIMEOUT=30005]="RC_HTTP_REQ_TIMEOUT",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_RESOURCE_ERROR=30007]="RC_NAVI_RESOURCE_ERROR",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_SEND_FAIL=30012]="RC_PING_SEND_FAIL",e[e.RC_PONG_RECV_FAIL=30013]="RC_PONG_RECV_FAIL",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_ID_REJECT=31002]="RC_CONN_ID_REJECT",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.CONVER_REMOVE_ERROR=34001]="CONVER_REMOVE_ERROR",e[e.CONVER_GETLIST_ERROR=34002]="CONVER_GETLIST_ERROR",e[e.CONVER_SETOP_ERROR=34003]="CONVER_SETOP_ERROR",e[e.CONVER_TOTAL_UNREAD_ERROR=34004]="CONVER_TOTAL_UNREAD_ERROR",e[e.CONVER_TYPE_UNREAD_ERROR=34005]="CONVER_TYPE_UNREAD_ERROR",e[e.CONVER_ID_TYPE_UNREAD_ERROR=34006]="CONVER_ID_TYPE_UNREAD_ERROR",e[e.CONVER_CLEAR_ERROR=34007]="CONVER_CLEAR_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.CLEAR_HIS_TIME_ERROR=34011]="CLEAR_HIS_TIME_ERROR",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.READ_RECEIPT_ERROR=35003]="READ_RECEIPT_ERROR",e[e.PACKAGE_ENVIRONMENT_ERROR=35006]="PACKAGE_ENVIRONMENT_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.UPLOAD_FILE_FAILED=35020]="UPLOAD_FILE_FAILED",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.DRAF_SAVE_ERROR=38002]="DRAF_SAVE_ERROR",e[e.DRAF_REMOVE_ERROR=38003]="DRAF_REMOVE_ERROR",e[e.SUBSCRIBE_ERROR=39001]="SUBSCRIBE_ERROR",e[e.NOT_SUPPORT=39002]="NOT_SUPPORT",e[e.QNTKN_FILETYPE_ERROR=41001]="QNTKN_FILETYPE_ERROR",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.COOKIE_ENABLE=51001]="COOKIE_ENABLE",e[e.GET_MESSAGE_BY_ID_ERROR=61001]="GET_MESSAGE_BY_ID_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.VOIPISNULL=24013]="VOIPISNULL",e[e.NOENGINETYPE=24010]="NOENGINETYPE",e[e.NULLCHANNELNAME=24011]="NULLCHANNELNAME",e[e.VOIPDYANMICERROR=24012]="VOIPDYANMICERROR",e[e.NOVOIP=24014]="NOVOIP",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.VOIPCLOSE=24016]="VOIPCLOSE",e[e.CLOSE_BEFORE_OPEN=51001]="CLOSE_BEFORE_OPEN",e[e.ALREADY_IN_USE=51002]="ALREADY_IN_USE",e[e.INVALID_CHANNEL_NAME=51003]="INVALID_CHANNEL_NAME",e[e.VIDEO_CONTAINER_IS_NULL=51004]="VIDEO_CONTAINER_IS_NULL",e[e.DELETE_MESSAGE_ID_IS_NULL=61001]="DELETE_MESSAGE_ID_IS_NULL",e[e.CANCEL=1]="CANCEL",e[e.REJECT=2]="REJECT",e[e.HANGUP=3]="HANGUP",e[e.BUSYLINE=4]="BUSYLINE",e[e.NO_RESPONSE=5]="NO_RESPONSE",e[e.ENGINE_UN_SUPPORTED=6]="ENGINE_UN_SUPPORTED",e[e.NETWORK_ERROR=7]="NETWORK_ERROR",e[e.REMOTE_CANCEL=11]="REMOTE_CANCEL",e[e.REMOTE_REJECT=12]="REMOTE_REJECT",e[e.REMOTE_HANGUP=13]="REMOTE_HANGUP",e[e.REMOTE_BUSYLINE=14]="REMOTE_BUSYLINE",e[e.REMOTE_NO_RESPONSE=15]="REMOTE_NO_RESPONSE",e[e.REMOTE_ENGINE_UN_SUPPORTED=16]="REMOTE_ENGINE_UN_SUPPORTED",e[e.REMOTE_NETWORK_ERROR=17]="REMOTE_NETWORK_ERROR",e[e.VOIP_NOT_AVALIABLE=18]="VOIP_NOT_AVALIABLE",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT"})(Df||(Df={}));var Uf,D=Df;(function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT"})(Uf||(Uf={}));var $f,Ke=Uf,pn={ACCEPTED:0,UNACCEPTABLE_PROTOCOL_VERSION:1,IDENTIFIER_REJECTED:2,SERVER_UNAVAILABLE:3,TOKEN_INCORRECT:4,NOT_AUTHORIZED:5,REDIRECT:6,PACKAGE_ERROR:7,APP_BLOCK_OR_DELETE:8,BLOCK:9,TOKEN_EXPIRE:10,DEVICE_ERROR:11,HOSTNAME_ERROR:12,HASOHTERSAMECLIENTONLINE:13,IN_OTHER_CLUSTER:15,APP_AUTH_NOT_PASS:16,OTP_USED:17,PLATFORM_ERROR:18};(function(e){e.TextMessage="RC:TxtMsg",e.VOICE="RC:VcMsg",e.HQ_VOICE="RC:HQVCMsg",e.IMAGE="RC:ImgMsg",e.GIF="RC:GIFMsg",e.RICH_CONTENT="RC:ImgTextMsg",e.LOCATION="RC:LBSMsg",e.FILE="RC:FileMsg",e.SIGHT="RC:SightMsg",e.COMBINE="RC:CombineMsg",e.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",e.LOG_COMMAND="RC:LogCmdMsg",e.EXPANSION_NOTIFY="RC:MsgExMsg",e.REFERENCE="RC:ReferenceMsg",e.RECALL="RC:RcCmd",e.READ_RECEIPT="RC:ReadNtf",e.READ_RECEIPT_REQUEST="RC:RRReqMsg",e.READ_RECEIPT_RESPONSE="RC:RRRspMsg",e.SYNC_READ_STATUS="RC:SRSMsg",e.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",e.CHATROOM_JOIN="RC:ChrmJoinNtf",e.CHATROOM_LEFT="RC:ChrmQuitNtf",e.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",e.TYPING_STATUS="RC:TypSts",e.INTERCEPT="RC:InterceptMsg"})($f||($f={}));var xf,mn=$f;(function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"})(xf||(xf={}));var Bf,Fo=xf;(function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"})(Bf||(Bf={}));var Ff,Sp=Bf;(function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC"})(Ff||(Ff={}));var Vf,Rn=Ff;(function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"})(Vf||(Vf={}));var jf,Pn=Vf;(function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"})(jf||(jf={}));var ay,cy=jf;(function(e){/*!
  24. 全局敏感词:命中了融云内置的全局敏感词
  25. */e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"})(ay||(ay={}));var yn,uy,ly;(function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE"})(yn||(yn={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(uy||(uy={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(ly||(ly={}));var jr,Pu,Hf,Z3={"RC:VCAccept":"RC:VCAccept","RC:VCRinging":"RC:VCRinging","RC:VCSummary":"RC:VCSummary","RC:VCHangup":"RC:VCHangup","RC:VCInvite":"RC:VCInvite","RC:VCModifyMedia":"RC:VCModifyMedia","RC:VCModifyMem":"RC:VCModifyMem"};(function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"})(jr||(jr={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Pu||(Pu={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Hf||(Hf={}));var Vr,Ft,_d={engine:"5.1.1"},ho=function(){function e(){}return e.add=function(t,n){_d[t]=n},e.validEngine=function(t){var n=t.match(/\d+\.\d+\.\d+/);if(!n)return de.warn("The validation engine version '"+t+"' is invalid!"),!1;var r=n[0].split(".").map(function(i){return i.padStart(3,"0")}).join("");return _d.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map(function(i){return i.padStart(3,"0")}).join("")>=r},e.getInfo=function(){return _d},e}();(function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID"})(Ft||(Ft={}));var Xr,gn,jn,yo,io,e4=((Vr={})[Ft.STRING]=Mn,Vr[Ft.ONLY_STRING]=Vn,Vr[Ft.NUMBER]=Pt,Vr[Ft.BOOLEAN]=function(e){return typeof e=="boolean"},Vr[Ft.OBJECT]=sn,Vr[Ft.ARRAY]=In,Vr[Ft.CALLBACK]=function(e){var t=!0;return sn(e)||(t=!1),(e=e||{}).onSuccess&&!Au(e.onSuccess)&&(t=!1),e.onError&&!Au(e.onError)&&(t=!1),t},Vr[Ft.CHANNEL_ID]=function(e){var t=!1;return Vn(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Vr),t4=function(e){function t(n){var r=e.call(this,n)||this;return r.name="RCAssertError",r}return xt(t,e),t}(Error),Zt=function(e,t,n,r){if(r===void 0&&(r=!1),!bt(e,t,n,r))throw new t4("'"+e+"' is invalid: "+JSON.stringify(t))},bt=function(e,t,n,r){r===void 0&&(r=!1),n=e4[n]||n;var i=r&&!n(t)||!r&&!(mt(t)||t===null||n(t));return i&&de.error("'"+e+"' is invalid: "+JSON.stringify(t)),!i},Yn=function(e){if(!sn(e)||e.low===void 0||e.high===void 0)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{"+t.length+"}$"),t),16)},n4=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=kC(),i=function(u){u=u||"-";var d=new Date;return""+d.getFullYear()+u+(d.getMonth()+1)+u+d.getDate()}(),o=new Date().getTime(),s="";if(t){var a=t.split(".");s="."+a[a.length-1]}return e+"__RC-"+i+"_"+n+"_"+o+r+s},r4=function(e,t){e===void 0&&(e={}),t===void 0&&(t={});var n=e.threadId,r=e.apnsCollapseId,i=e.category,o=e.richMediaUri,s=t.channelIdMi,a=t.channelIdHW,u=t.channelIdOPPO,d=t.typeVivo,f=t.googleConfig,c={};c["thread-id"]=n||"",c["apns-collapse-id"]=r||"",c.category=i||"",c.richMediaUri=o||"";var l={};l.collapse_key=f==null?void 0:f.collapseKey,l.imageUrl=f==null?void 0:f.imageUrl;var h=f==null?void 0:f.priority;h&&!["high","normal"].includes(h)&&(h="normal"),l.priority=h;var p=[{HW:{channelId:a||""}},{MI:{channelId:s||""}},{OPPO:{channelId:u||""}},{VIVO:{classification:d||""}},{APNS:c},{FCM:l}];return JSON.stringify(p)},dy=function(e,t){var n={},r={notificationId:t||""};if(!e)return{iOSConfig:n,androidConfig:r};try{var i=JSON.parse(e);i==null||i.forEach(function(o){var s,a,u,d,f=Object.keys(o);if(f.length!==0){var c=f[0];switch(c){case"HW":return void(r.channelIdHW=(s=o[c])===null||s===void 0?void 0:s.channelId);case"MI":return void(r.channelIdMi=(a=o[c])===null||a===void 0?void 0:a.channelId);case"OPPO":return void(r.channelIdOPPO=(u=o[c])===null||u===void 0?void 0:u.channelId);case"VIVO":return void(r.typeVivo=(d=o[c])===null||d===void 0?void 0:d.classification);case"APNS":return n.threadId=o[c]["thread-id"],n.apnsCollapseId=o[c]["apns-collapse-id"],n.category=o[c].category,void(n.richMediaUri=o[c].richMediaUri);case"FCM":r.googleConfig={collapseKey:o[c].collapse_key||"",imageUrl:o[c].imageUrl||"",priority:o[c].priority||""}}}})}catch{de.error("Wrong format for pushConfigs field! content: "+e)}return{iOSConfig:n,androidConfig:r}},Mo=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&n<=128&&n>=1},Ed=function(e){var t=e.length;return t<=4096&&t>=1},Bt=function(e,t,n){t=t||function(){};var r=(n=n||{}).isReverse;sn(e)&&function(){for(var i in e)t(e[i],i,e)}(),(In(e)||Vn(e))&&function(){if(r)for(var i=e.length-1;i>=0;i--)t(e[i],i);else for(var o=0,s=e.length;o<s;o++)t(e[o],o)}()},Pc=function(e,t){return Bt(e,function(n,r){e[r]=t(n,r)}),e},i4=function(e,t){if(e.indexOf)return e.indexOf(t);var n=-1;return Bt(e,function(r,i){t===r&&(n=i)}),n},o4=function(e,t){var n=[];return Bt(e,function(r){n.push(r)}),i4(n,t)!==-1},eu=function(e){return JSON.parse(JSON.stringify(e))},fy=function(){return typeof RCCppEngine!="undefined"},s4=function(e){if(e.tag!=="browser")return{type:e.tag,version:"UnKonw"};var t,n,r=navigator.userAgent,i={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var o in i)if(i.hasOwnProperty(o)){var s=r.match(i[o]);if(s){n=o,t=s[1]||s[2];break}}return{type:n||"UnKonw",version:t||"UnKonw"}},$C=function(e){switch(e){case pn.SERVER_UNAVAILABLE:return D.SERVER_UNAVAILABLE;case pn.TOKEN_INCORRECT:return D.RC_CONN_USER_OR_PASSWD_ERROR;case pn.REDIRECT:return D.RC_CONN_REDIRECTED;case pn.APP_BLOCK_OR_DELETE:return D.RC_CONN_APP_BLOCKED_OR_DELETED;case pn.BLOCK:return D.RC_CONN_USER_BLOCKED;case pn.TOKEN_EXPIRE:return D.RC_CONN_USER_OR_PASSWD_ERROR;case pn.HOSTNAME_ERROR:return D.HOSTNAME_ERROR;case pn.HASOHTERSAMECLIENTONLINE:return D.HAS_OHTER_SAME_CLIENT_ON_LINE;case pn.APP_AUTH_NOT_PASS:return D.RC_APP_AUTH_NOT_PASS;case pn.OTP_USED:return D.RC_OTP_USED;case pn.PLATFORM_ERROR:return D.RC_PLATFORM_ERROR;default:return D.RC_NET_UNAVAILABLE}},hy=function(e){var t={},n=JSON.parse(e);return Bt(n,function(r,i){t[i]=r.v}),t},Vo={_delayTime:0,setTime:function(e){var t=new Date().getTime();Vo._delayTime=t-e},getTime:function(){var e=Vo._delayTime;return new Date().getTime()-e}},py=function(e,t){var n=0;return e.isAutoDelete&&(n|=1),e.isOverwrite&&(n|=2),t===2&&(n|=4),n};(function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"})(Xr||(Xr={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.SUBSCRIBE=8]="SUBSCRIBE",e[e.SUB_ACK=9]="SUB_ACK",e[e.UNSUBSCRIBE=10]="UNSUBSCRIBE",e[e.UNSUB_ACK=11]="UNSUB_ACK",e[e.PING_REQ=12]="PING_REQ",e[e.PING_RESP=13]="PING_RESP",e[e.DISCONNECT=14]="DISCONNECT",e[e.RESERVER2=15]="RESERVER2"}(gn||(gn={})),function(e){e.CONN_ACK="ConnAckMessage",e.DISCONNECT="DisconnectMessage",e.PING_REQ="PingReqMessage",e.PING_RESP="PingRespMessage",e.PUBLISH="PublishMessage",e.PUB_ACK="PubAckMessage",e.QUERY="QueryMessage",e.QUERY_CON="QueryConMessage",e.QUERY_ACK="QueryAckMessage"}(jn||(jn={})),function(e){e.PUB="pub",e.QUERY="qry"}(yo||(yo={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(io||(io={}));var me,Rp=function(){function e(t,n,r,i){n===void 0&&(n=!1),r===void 0&&(r=Xr.AT_LEAST_ONCE),i===void 0&&(i=!1),this._retain=!1,this.qos=Xr.AT_LEAST_ONCE,this._dup=!1,this.syncMsg=!1;var o=t>0;t&&o&&arguments.length===1?(this._retain=(1&t)>0,this.qos=(6&t)>>1,this._dup=(8&t)>0,this.type=t>>4&15,this.syncMsg=(8&t)==8):(this.type=t,this._retain=n,this.qos=r,this._dup=i)}return e.prototype.encode=function(){var t=this.type<<4;return t|=this._retain?1:0,t|=this.qos<<1,t|=this._dup?8:0},e}(),ic=function(){function e(){}return e.writeUTF=function(t,n){var r=[],i=0;if(Vn(t))for(var o=0,s=t.length;o<s;o++){var a=t.charCodeAt(o);a>=0&&a<=127?(i+=1,r.push(a)):a>=128&&a<=2047?(i+=2,r.push(192|31&a>>6),r.push(128|63&a)):a>=2048&&a<=65535&&(i+=3,r.push(224|15&a>>12),r.push(128|63&a>>6),r.push(128|63&a))}for(o=0,s=r.length;o<s;o++)r[o]>255&&(r[o]&=255);return n?r:i<=255?[0,i].concat(r):[i>>8,255&i].concat(r)},e.readUTF=function(t){for(var n,r,i=[],o=-1,s=t,a="";++o<s.length;){var u=Number(s[o]);if(u===(127&u)||((240&u)==240?u=(u=(u=(u^=240)<<6|128^s[++o])<<6|128^s[++o])<<6|128^s[++o]:(224&u)==224?u=(u=(u^=224)<<6|128^s[++o])<<6|128^s[++o]:(192&u)==192&&(u=(u^=192)<<6|128^s[++o])),!isFinite(u)||u<0||u>1114111||Math.floor(u)!==u)throw RangeError("Invalid code point: "+u);u<=65535?i.push(u):(n=(u-=65536)>>10|55296,r=u%1024|56320,i.push(n,r)),(o+1===s.length||i.length>16384)&&(a+=String.fromCharCode.apply(null,i),i.length=0)}return a},e}(),a4=function(){function e(t){this._position=0,this._poolLen=0,this._pool=t,this._poolLen=t.length}return e.prototype.check=function(){return this._position>=this._pool.length},e.prototype.read2Byte=function(){var t=this;if(t.check())return-1;for(var n="",r=0;r<2;r++){var i=t._pool[t._position++].toString(16);i.length===1&&(i="0"+i),n+=i.toString()}return parseInt(n,16)},e.prototype.readInt=function(){var t=this;if(t.check())return-1;for(var n="",r=0;r<4;r++){var i=t._pool[t._position++].toString(16);i.length===1&&(i="0"+i),n+=i.toString()}return parseInt(n,16)},e.prototype.readLong=function(){var t=this;if(t.check())return-1;for(var n="",r=0;r<8;r++){var i=t._pool[t._position++].toString(16);i.length===1&&(i="0"+i),n+=i}return parseInt(n,16)},e.prototype.readByte=function(){if(this.check())return-1;var t=this._pool[this._position++];return t>255&&(t&=255),t},e.prototype.readUTF=function(){if(this.check())return"";var t=this.readByte()<<8|this.readByte(),n=this._pool.subarray(this._position,this._position+=t);return ic.readUTF(n)},e.prototype.readAll=function(){return this._pool.subarray(this._position,this._poolLen)},e}(),c4=function(){function e(){this._pool=[],this._position=0,this._writen=0}return e.prototype.write=function(t){return Object.prototype.toString.call(t).indexOf("Array")!==-1?this._pool=this._pool.concat(t):t>=0&&(t>255&&(t&=255),this._pool.push(t),this._writen++),t},e.prototype.writeArr=function(t){return this._pool=this._pool.concat(t),t},e.prototype.writeUTF=function(t){var n=ic.writeUTF(t);this._pool=this._pool.concat(n),this._writen+=n.length},e.prototype.getBytesArray=function(){return this._pool},e}(),$a="UpStreamMessage",bp="PushExtra",vl="DownStreamMessage",xa="DownStreamMessages",Ip="SessionsAttQryInput",xC="SessionsAttOutput",wp="SyncRequestMsg",Op="ChrmPullMsg",Mu="NotifyMsg",Np="HistoryMsgInput",Ba="HistoryMsgOuput",Lu="RelationQryInput",Fa="RelationsOutput",Ap="DeleteSessionsInput",Pp="SessionInfo",BC="DeleteSessionsOutput",Mp="RelationsInput",Lp="DeleteMsgInput",kp="CleanHisMsgInput",Dp="SessionMsgReadInput",Up="ChrmInput",$p="ChrmOutput",xp="QueryChatRoomInfoInput",yl="QueryChatRoomInfoOutput",ku="RtcInput",oo="RtcUserListOutput",Bp="SetUserStatusInput",Fp="RtcSetDataInput",Du="RtcUserSetDataInput",Uu="RtcDataInput",Vp="RtcSetOutDataInput",jp="MCFollowInput",_l="RtcTokenOutput",El="RtcQryOutput",Hp="RtcQryUserOutDataInput",FC="RtcUserOutDataOutput",qp="RtcQueryListInput",VC="RtcRoomInfoOutput",Jn="RtcValueInfo",Kp="RtcKeyDeleteInput",Gp="GetQNupTokenInput",zp="GetQNupTokenOutput",Yp="GetQNdownloadUrlInput",Wp="GetDownloadUrlInput",Jp="GetQNdownloadUrlOutput",Qp="GetDownloadUrlOutput",Xp="SetChrmKV",Zp="SetChrmKVS",jC="DeleteChrmKVS",Jo="ChrmKVOutput",eg="ChrmKVSOutput",HC="ChrmKVSOutputEntity",tg="QueryChrmKV",qC="SetUserSettingInput",Qo="SetUserSettingOutput",ng="PullUserSettingInput",Cl="PullUserSettingOutput",Tl="UserSettingNotification",rg="SessionReq",Sl="SessionStates",$u="SessionState",xu="SessionStateItem",Bu="SessionStateModifyReq",ig="SessionStateModifyResp",Fu="GrpReadReceiptMsg",KC="GrpReadReceiptQryReq",Rl="GrpReadReceiptQryResp",GC="GrpMsgReadUser",og="SessionTagAddInput",ga="SessionTagItem",sg="SessionTagDelInput",ag="SessionDisTagReq",cg="ReportSDKInput",zC="ReportSDKOutput",ug="RtcNotifyMsg",lg="RtcPullKV",bl="RtcKVOutput",dg="RtcQueryUserJoinedInput",Il="RtcQueryUserJoinedOutput",YC="RtcViewerJoinedOutput",fg="RtcInviteInput",hg="RtcCancelInviteInput",pg="RtcInviteAnswerInput",gg="RtcEndInviteInput",WC=((me={})[$a]=["sessionId","classname","content","pushText","userId","configFlag","appData","extraContent","pushExt","busChannel"],me[xa]=["list","syncTime","finished"],me[vl]=["fromUserId","type","groupId","classname","content","dataTime","status","msgId","extraContent","pushContent","configFlag","pushExt","busChannel"],me[bp]=["title","templateIdNoUse","pushId","pushConfigs","templateId"],me[Ip]=["nothing"],me[xC]=["inboxTime","sendboxTime","totalUnreadCount"],me[wp]=["syncTime","ispolling","isweb","isPullSend","isKeeping","sendBoxSyncTime"],me[Op]=["syncTime","count"],me[Mu]=["type","time","chrmId"],me[Np]=["targetId","time","count","order","busChannel"],me[Ba]=["list","syncTime","hasMsg"],me[Lu]=["type","count","startTime","order"],me[Fa]=["info"],me[Ap]=["sessions"],me[Pp]=["type","channelId","busChannel"],me[BC]=["nothing"],me[Mp]=["type","msg","count","busChannel","startTime","endTime"],me[Lp]=["type","conversationId","msgs","busChannel"],me[kp]=["targetId","dataTime","conversationType","busChannel"],me[Dp]=["type","msgTime","channelId"],me[Up]=["nothing"],me[$p]=["nothing","sessionId","joinTime"],me[xp]=["count","order"],me[yl]=["userTotalNums","userInfos"],me[Gp]=["type","key","httpMethod","queryString"],me[Yp]=["type","key","fileName"],me[Wp]=["type","key","fileName"],me[zp]=["deadline","token","bosToken","bosDate","path","osskeyId","ossPolicy","ossSign","ossBucketName"],me[Jp]=["downloadUrl"],me[Qp]=["downloadUrl"],me[Xp]=["entry","bNotify","notification","type"],me[Zp]=["entry","bNotify","notification","type"],me[jC]=["entry","bNotify","notification","type"],me[Jo]=["entries","bFullUpdate","syncTime"],me[eg]=["timestamp","errorKeys"],me[HC]=["key","errorCode"],me[tg]=["timestamp"],me[qC]=["version","value"],me[Qo]=["version","reserve"],me[ng]=["version","reserve"],me[Cl]=["items","version"],me.UserSettingItem=["targetId","type","key","value","version","status","tags"],me[rg]=["time"],me[Sl]=["version","state"],me[$u]=["type","channelId","time","stateItem","busChannel"],me[xu]=["sessionStateType","value","tags"],me[Bu]=["version","state"],me[ig]=["version"],me[Fu]=["msgId","busChannel"],me[KC]=["msgId","busChannel"],me[Rl]=["totalMemberNum","list"],me[GC]=["readTime","userId"],me[og]=["version","tags"],me[ga]=["tagId","name","createdTime","isTop"],me[sg]=["version","tags"],me[ag]=["tagId"],me[Tl]=["version","reserve"],me[cg]=["sdkInfo"],me[zC]=["nothing"],me[ku]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType"],me[oo]=["users","token","sessionId","roomInfo"],me[Bp]=["status"],me[Fp]=["interior","target","key","value","objectName","content"],me[Du]=["valueInfo","objectName","content"],me[Uu]=["interior","target","key","objectName","content"],me[Vp]=["target","valueInfo","objectName","content"],me[jp]=["state"],me[_l]=["rtcToken"],me[El]=["outInfo"],me[Hp]=["userId"],me[FC]=["user"],me[qp]=["order"],me[VC]=["roomId","roomData","userCount","list"],me[Jn]=["key","value"],me[Kp]=["key"],me[ug]=["type","time","roomId"],me[lg]=["timestamp","roomId"],me[bl]=["entries","bFullUpdate","syncTime"],me[dg]=["userId"],me[Il]=["info"],me[fg]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],me[hg]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],me[pg]=["inviteUserID","answerCode","inviteRoomId","inviteSessionId","content","key","value"],me[gg]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],me),Va={},u4=function(e){var t=WC[e];Va[e]=function(){for(var n={},r={getArrayData:function(){return n}},i=function(s){var a=t[s],u="set"+ry(a,0,1);r[u]=function(d){n[a]=d}},o=0;o<t.length;o++)i(o);return r},Va[e].decode=function(n){var r={};Vn(n)&&(n=JSON.parse(n));var i=function(s){var a="get"+ry(s,0,1);r[s]=n[s],r[a]=function(){return n[s]}};for(var o in n)i(o);return r}};for(var l4 in WC)u4(l4);Va.getModule=function(e){return Va[e]()};var d4=`
  26. package Modules;
  27. message probuf {
  28. message `+Bp+`
  29. {
  30. optional int32 status=1;
  31. }
  32. message SetUserStatusOutput
  33. {
  34. optional int32 nothing=1;
  35. }
  36. message GetUserStatusInput
  37. {
  38. optional int32 nothing=1;
  39. }
  40. message GetUserStatusOutput
  41. {
  42. optional string status=1;
  43. optional string subUserId=2;
  44. }
  45. message SubUserStatusInput
  46. {
  47. repeated string userid =1;
  48. }
  49. message SubUserStatusOutput
  50. {
  51. optional int32 nothing=1;
  52. }
  53. message VoipDynamicInput
  54. {
  55. required int32 engineType = 1;
  56. required string channelName = 2;
  57. optional string channelExtra = 3;
  58. }
  59. message VoipDynamicOutput
  60. {
  61. required string dynamicKey=1;
  62. }
  63. message `+Mu+` {
  64. required int32 type = 1;
  65. optional int64 time = 2;
  66. optional string chrmId=3;
  67. }
  68. message `+wp+` {
  69. required int64 syncTime = 1;
  70. required bool ispolling = 2;
  71. optional bool isweb=3;
  72. optional bool isPullSend=4;
  73. optional bool isKeeping=5;
  74. optional int64 sendBoxSyncTime=6;
  75. }
  76. message `+$a+` {
  77. required int32 sessionId = 1;
  78. required string classname = 2;
  79. required bytes content = 3;
  80. optional string pushText = 4;
  81. optional string appData = 5;
  82. repeated string userId = 6;
  83. optional int64 delMsgTime = 7;
  84. optional string delMsgId = 8;
  85. optional int32 configFlag = 9;
  86. optional int64 clientUniqueId = 10;
  87. optional string extraContent = 11;
  88. optional PushExtra pushExt = 12;
  89. optional string busChannel = 13; // \u8BE5\u6D88\u606F\u6240\u5C5E\u4F1A\u8BDD\u7684\u4E1A\u52A1\u6807\u8BC6
  90. }
  91. message `+bp+` {
  92. optional string title = 1;
  93. optional int32 templateIdNoUse= 2;
  94. optional string pushId = 3;
  95. optional string pushConfigs = 4;
  96. optional string templateId = 5;
  97. }
  98. message `+xa+` {
  99. repeated DownStreamMessage list = 1;
  100. required int64 syncTime = 2;
  101. optional bool finished = 3;
  102. }
  103. message `+vl+` {
  104. required string fromUserId = 1;
  105. required ChannelType type = 2;
  106. optional string groupId = 3;
  107. required string classname = 4;
  108. required bytes content = 5;
  109. required int64 dataTime = 6;
  110. required int64 status = 7;
  111. optional int64 extra = 8;
  112. optional string msgId = 9;
  113. optional int32 direction = 10;
  114. optional int32 plantform =11;
  115. optional int32 isRemoved = 12;
  116. optional string source = 13;
  117. optional int64 clientUniqueId = 14;
  118. optional string extraContent = 15;
  119. optional string pushContent = 16;
  120. optional int32 configFlag = 17;
  121. optional PushExtra pushExt = 18;
  122. optional string busChannel = 19; // \u8BE5\u6D88\u606F\u6240\u5C5E\u4F1A\u8BDD\u7684\u4E1A\u52A1\u6807\u8BC6\uFF0C\u9650\u523620\u5B57\u7B26\u4EE5\u5185
  123. }
  124. enum ChannelType {
  125. PERSON = 1;
  126. PERSONS = 2;
  127. GROUP = 3;
  128. TEMPGROUP = 4;
  129. CUSTOMERSERVICE = 5;
  130. NOTIFY = 6;
  131. MC=7;
  132. MP=8;
  133. }
  134. message CreateDiscussionInput {
  135. optional string name = 1;
  136. }
  137. message CreateDiscussionOutput {
  138. required string id = 1;
  139. }
  140. message ChannelInvitationInput {
  141. repeated string users = 1;
  142. }
  143. message LeaveChannelInput {
  144. required int32 nothing = 1;
  145. }
  146. message ChannelEvictionInput {
  147. required string user = 1;
  148. }
  149. message RenameChannelInput {
  150. required string name = 1;
  151. }
  152. message ChannelInfoInput {
  153. required int32 nothing = 1;
  154. }
  155. message ChannelInfoOutput {
  156. required ChannelType type = 1;
  157. required string channelId = 2;
  158. required string channelName = 3;
  159. required string adminUserId = 4;
  160. repeated string firstTenUserIds = 5;
  161. required int32 openStatus = 6;
  162. }
  163. message ChannelInfosInput {
  164. required int32 page = 1;
  165. optional int32 number = 2;
  166. }
  167. message ChannelInfosOutput {
  168. repeated ChannelInfoOutput channels = 1;
  169. required int32 total = 2;
  170. }
  171. message MemberInfo {
  172. required string userId = 1;
  173. required string userName = 2;
  174. required string userPortrait = 3;
  175. required string extension = 4;
  176. }
  177. message GroupMembersInput {
  178. required int32 page = 1;
  179. optional int32 number = 2;
  180. }
  181. message GroupMembersOutput {
  182. repeated MemberInfo members = 1;
  183. required int32 total = 2;
  184. }
  185. message GetUserInfoInput {
  186. required int32 nothing = 1;
  187. }
  188. message GetUserInfoOutput {
  189. required string userId = 1;
  190. required string userName = 2;
  191. required string userPortrait = 3;
  192. }
  193. message GetSessionIdInput {
  194. required int32 nothing = 1;
  195. }
  196. message GetSessionIdOutput {
  197. required int32 sessionId = 1;
  198. }
  199. enum FileType {
  200. image = `+Xt.IMAGE+`;
  201. audio = `+Xt.AUDIO+`;
  202. video = `+Xt.VIDEO+`;
  203. file = `+Xt.FILE+`;
  204. }
  205. message `+Gp+` {
  206. required FileType type = 1;
  207. optional string key = 2;
  208. optional string httpMethod = 3;
  209. optional string queryString = 4;
  210. }
  211. message `+Yp+` {
  212. required FileType type = 1;
  213. required string key = 2;
  214. optional string fileName = 3;
  215. }
  216. message `+Wp+` {
  217. required FileType type = 1;
  218. required string key = 2;
  219. optional string fileName = 3;
  220. }
  221. message `+zp+` {
  222. required int64 deadline = 1;
  223. required string token = 2;
  224. optional string bosToken = 3;
  225. optional string bosDate = 4;
  226. optional string path = 5;
  227. optional string osskeyId = 6;
  228. optional string ossPolicy = 7;
  229. optional string ossSign = 8;
  230. optional string ossBucketName = 9;
  231. optional string s3Credential = 10;
  232. optional string s3Algorithm = 11;
  233. optional string s3Date = 12;
  234. optional string s3Policy = 13;
  235. optional string s3Signature = 14;
  236. optional string s3BucketName = 15;
  237. optional string stcAuthorization = 16;
  238. optional string stcContentSha256 = 17;
  239. optional string stcDate = 18;
  240. optional string stcBucketName = 19;
  241. }
  242. message `+Jp+` {
  243. required string downloadUrl = 1;
  244. }
  245. message `+Qp+` {
  246. required string downloadUrl = 1;
  247. }
  248. message Add2BlackListInput {
  249. required string userId = 1;
  250. }
  251. message RemoveFromBlackListInput {
  252. required string userId = 1;
  253. }
  254. message QueryBlackListInput {
  255. required int32 nothing = 1;
  256. }
  257. message QueryBlackListOutput {
  258. repeated string userIds = 1;
  259. }
  260. message BlackListStatusInput {
  261. required string userId = 1;
  262. }
  263. message BlockPushInput {
  264. required string blockeeId = 1;
  265. }
  266. message ModifyPermissionInput {
  267. required int32 openStatus = 1;
  268. }
  269. message GroupInput {
  270. repeated GroupInfo groupInfo = 1;
  271. }
  272. message GroupOutput {
  273. required int32 nothing = 1;
  274. }
  275. message GroupInfo {
  276. required string id = 1;
  277. required string name = 2;
  278. }
  279. message GroupHashInput {
  280. required string userId = 1;
  281. required string groupHashCode = 2;
  282. }
  283. message GroupHashOutput {
  284. required GroupHashType result = 1;
  285. }
  286. enum GroupHashType {
  287. group_success = 0x00;
  288. group_failure = 0x01;
  289. }
  290. message `+Up+` {
  291. required int32 nothing = 1;
  292. }
  293. message `+$p+` {
  294. required int32 nothing = 1;
  295. optional string sessionId = 2;
  296. optional int64 joinTime = 3;
  297. }
  298. message `+Op+` {
  299. required int64 syncTime = 1;
  300. required int32 count = 2;
  301. }
  302. message ChrmPullMsgNew
  303. {
  304. required int32 count = 1;
  305. required int64 syncTime = 2;
  306. optional string chrmId=3;
  307. }
  308. message `+Lu+`
  309. {
  310. optional ChannelType type = 1;
  311. optional int32 count = 2;
  312. optional int64 startTime = 3;
  313. optional int32 order = 4;
  314. }
  315. message `+Mp+`
  316. {
  317. required ChannelType type = 1;
  318. optional DownStreamMessage msg =2;
  319. optional int32 count = 3;
  320. optional string busChannel = 4;
  321. optional int64 startTime = 5;
  322. optional int64 endTime = 6;
  323. }
  324. message `+Fa+`
  325. {
  326. repeated RelationInfo info = 1;
  327. }
  328. message RelationInfo
  329. {
  330. required ChannelType type = 1;
  331. required string userId = 2;
  332. optional DownStreamMessage msg =3;
  333. optional int64 readMsgTime= 4;
  334. optional int64 unreadCount= 5;
  335. optional string busChannel = 6;//\u8BE5\u6D88\u606F\u6240\u5C5E\u4F1A\u8BDD\u7684\u4E1A\u52A1\u6807\u8BC6
  336. }
  337. message RelationInfoReadTime
  338. {
  339. required ChannelType type = 1;
  340. required int64 readMsgTime= 2;
  341. required string targetId = 3;
  342. }
  343. message `+kp+`
  344. {
  345. required string targetId = 1;
  346. required int64 dataTime = 2;
  347. optional int32 conversationType= 3;
  348. optional string busChannel = 4; //\u8BE5\u6D88\u606F\u6240\u5C5E\u4F1A\u8BDD\u7684\u4E1A\u52A1\u6807\u8BC6\uFF0C\u9650\u523620\u5B57\u7B26\u4EE5\u5185
  349. }
  350. message HistoryMessageInput
  351. {
  352. required string targetId = 1;
  353. required int64 dataTime =2;
  354. required int32 size = 3;
  355. }
  356. message HistoryMessagesOuput
  357. {
  358. repeated DownStreamMessage list = 1;
  359. required int64 syncTime = 2;
  360. required int32 hasMsg = 3;
  361. }
  362. message `+xp+`
  363. {
  364. required int32 count= 1;
  365. optional int32 order= 2;
  366. }
  367. message `+yl+`
  368. {
  369. optional int32 userTotalNums = 1;
  370. repeated ChrmMember userInfos = 2;
  371. }
  372. message ChrmMember
  373. {
  374. required int64 time = 1;
  375. required string id = 2;
  376. }
  377. message MPFollowInput
  378. {
  379. required string id = 1;
  380. }
  381. message MPFollowOutput
  382. {
  383. required int32 nothing = 1;
  384. optional MpInfo info =2;
  385. }
  386. message `+jp+`
  387. {
  388. required string state = 1;
  389. }
  390. message MCFollowOutput
  391. {
  392. required int32 nothing = 1;
  393. optional MpInfo info =2;
  394. }
  395. message MpInfo
  396. {
  397. required string mpid=1;
  398. required string name = 2;
  399. required string type = 3;
  400. required int64 time=4;
  401. optional string portraitUrl=5;
  402. optional string extra =6;
  403. }
  404. message SearchMpInput
  405. {
  406. required int32 type=1;
  407. required string id=2;
  408. }
  409. message SearchMpOutput
  410. {
  411. required int32 nothing=1;
  412. repeated MpInfo info = 2;
  413. }
  414. message PullMpInput
  415. {
  416. required int64 time=1;
  417. required string mpid=2;
  418. }
  419. message PullMpOutput
  420. {
  421. required int32 status=1;
  422. repeated MpInfo info = 2;
  423. }
  424. message `+Np+`
  425. {
  426. optional string targetId = 1;
  427. optional int64 time = 2;
  428. optional int32 count = 3;
  429. optional int32 order = 4;
  430. optional string busChannel = 5; //\u8BE5\u6D88\u606F\u6240\u5C5E\u4F1A\u8BDD\u7684\u4E1A\u52A1\u6807\u8BC6\uFF0C\u9650\u523620\u5B57\u7B26\u4EE5\u5185
  431. }
  432. message `+Ba+`
  433. {
  434. repeated DownStreamMessage list=1;
  435. required int64 syncTime=2;
  436. required int32 hasMsg=3;
  437. }
  438. message `+qp+`{
  439. optional int32 order=1;
  440. }
  441. message `+Kp+`{
  442. repeated string key=1;
  443. }
  444. message `+Jn+`{
  445. required string key=1;
  446. required string value=2;
  447. }
  448. message RtcUserInfo{
  449. required string userId=1;
  450. repeated `+Jn+` userData=2; //\u7528\u6237\u8D44\u6E90\u4FE1\u606F
  451. }
  452. message `+oo+`{
  453. repeated RtcUserInfo users=1;
  454. optional string token=2;
  455. optional string sessionId=3;
  456. repeated RtcValueInfo roomInfo = 4; //\u623F\u95F4key value
  457. repeated RtcKVEntity entries = 5;//\u76F4\u64ADKV\u5C5E\u6027\u5BF9\u8C61\u96C6\u5408
  458. optional int64 syncTime = 6;//\u6240\u6709\u5C5E\u6027\u7684\u6700\u5927\u65F6\u95F4\u6233\uFF08\u4E0B\u6B21\u62C9\u53D6KV\u65F6\u7528\uFF09\u3002
  459. optional int32 offlineKickTime = 7;//server\u8D85\u65F6\u8E22\u4EBA\u65F6\u95F4\uFF0C\u9ED8\u8BA460s
  460. }
  461. message RtcRoomInfoOutput{
  462. optional string roomId = 1;
  463. repeated `+Jn+` roomData = 2;
  464. optional int32 userCount = 3;
  465. repeated RtcUserInfo list=4;
  466. }
  467. message `+ku+`{
  468. required int32 roomType=1;
  469. optional int32 broadcastType=2;
  470. optional RtcValueInfo extraInnerData = 3;
  471. optional bool needSysChatroom = 4; //\u662F\u5426\u9700\u8981\u540C\u6B65\u804A\u5929\u5BA4
  472. optional IdentityChangeType identityChangeType = 5; //\u8EAB\u4EFD\u53D8\u66F4\u7C7B\u578B
  473. optional JoinType joinType = 6; // \u52A0\u5165\u623F\u95F4\u7C7B\u578B
  474. }
  475. enum JoinType {
  476. KICK = 0; //\u8E22\u524D\u4E00\u4E2A\u8BBE\u5907
  477. REFUSE = 1; //\u5F53\u524D\u52A0\u5165\u62D2\u7EDD
  478. COEXIST = 2; //\u4E24\u4E2A\u8BBE\u5907\u5171\u5B58
  479. }
  480. message RtcQryInput{
  481. required bool isInterior=1;
  482. required targetType target=2;
  483. repeated string key=3;
  484. }
  485. message `+El+`{
  486. repeated `+Jn+` outInfo=1;
  487. }
  488. message RtcDelDataInput{
  489. repeated string key=1;
  490. required bool isInterior=2;
  491. required targetType target=3;
  492. }
  493. message `+Uu+`{
  494. required bool interior=1;
  495. required targetType target=2;
  496. repeated string key=3;
  497. optional string objectName=4;
  498. optional string content=5;
  499. }
  500. message `+Fp+`{
  501. required bool interior=1;
  502. required targetType target=2;
  503. required string key=3;
  504. required string value=4;
  505. optional string objectName=5;
  506. optional string content=6;
  507. }
  508. message `+Du+` {
  509. repeated `+Jn+` valueInfo = 1;
  510. required string objectName = 2;
  511. repeated `+Jn+` content = 3;
  512. }
  513. message RtcOutput
  514. {
  515. optional int32 nothing=1;
  516. }
  517. message `+_l+`{
  518. required string rtcToken=1;
  519. }
  520. enum targetType {
  521. ROOM =1 ;
  522. PERSON = 2;
  523. }
  524. message `+Vp+`{
  525. required targetType target=1;
  526. repeated `+Jn+` valueInfo=2;
  527. optional string objectName=3;
  528. optional string content=4;
  529. }
  530. message `+Hp+`{
  531. repeated string userId = 1;
  532. }
  533. message `+FC+`{
  534. repeated RtcUserInfo user = 1;
  535. }
  536. message `+Ip+`{
  537. required int32 nothing = 1;
  538. }
  539. message `+xC+`{
  540. required int64 inboxTime = 1;
  541. required int64 sendboxTime = 2;
  542. required int64 totalUnreadCount = 3;
  543. }
  544. message `+Dp+`
  545. {
  546. required ChannelType type = 1;
  547. required int64 msgTime = 2;
  548. required string channelId = 3;
  549. }
  550. message SessionMsgReadOutput
  551. {
  552. optional int32 nothing=1;
  553. }
  554. message `+Ap+`
  555. {
  556. repeated SessionInfo sessions = 1;
  557. }
  558. message `+Pp+`
  559. {
  560. required ChannelType type = 1;
  561. required string channelId = 2;
  562. optional string busChannel = 3;//\u6240\u5C5E\u4F1A\u8BDD\u4E1A\u52A1\u6807\u8BC6
  563. }
  564. message `+BC+`
  565. {
  566. optional int32 nothing=1;
  567. }
  568. message `+Lp+`
  569. {
  570. optional ChannelType type = 1;
  571. optional string conversationId = 2;
  572. repeated DeleteMsg msgs = 3;
  573. optional string busChannel = 4; //\u8BE5\u6D88\u606F\u6240\u5C5E\u4F1A\u8BDD\u7684\u4E1A\u52A1\u6807\u8BC6\uFF0C\u9650\u523620\u5B57\u7B26\u4EE5\u5185
  574. }
  575. message DeleteMsg
  576. {
  577. optional string msgId = 1;
  578. optional int64 msgDataTime = 2;
  579. optional int32 direct = 3;
  580. }
  581. message ChrmKVEntity {
  582. required string key = 1;
  583. required string value = 2;
  584. optional int32 status = 3;
  585. optional int64 timestamp = 4;
  586. optional string uid = 5;
  587. }
  588. message `+Xp+` {
  589. required ChrmKVEntity entry = 1;
  590. optional bool bNotify = 2;
  591. optional UpStreamMessage notification = 3;
  592. optional ChannelType type = 4;
  593. }
  594. message `+Zp+` {
  595. repeated ChrmKVEntity entry = 1;
  596. optional bool bNotify = 2;
  597. optional UpStreamMessage notification = 3;
  598. optional ChannelType type = 4;
  599. }
  600. message `+jC+` {
  601. repeated ChrmKVEntity entry = 1;
  602. optional bool bNotify = 2;
  603. optional UpStreamMessage notification = 3;
  604. optional ChannelType type = 4;
  605. }
  606. message `+Jo+` {
  607. repeated ChrmKVEntity entries = 1;
  608. optional bool bFullUpdate = 2;
  609. optional int64 syncTime = 3;
  610. }
  611. message `+eg+` {
  612. repeated ChrmKVSOutputEntity errorKeys = 1;
  613. }
  614. message `+HC+`
  615. {
  616. optional string key = 1;
  617. optional int32 errorCode = 2;
  618. }
  619. message `+tg+` {
  620. required int64 timestamp = 1;
  621. }
  622. message `+qC+` {
  623. required int64 version=1;
  624. required string value=2;
  625. }
  626. message `+Qo+` {
  627. required int64 version=1;
  628. required bool reserve=2;
  629. }
  630. message `+ng+` {
  631. required int64 version=1;
  632. optional bool reserve=2;
  633. }
  634. message `+Cl+` {
  635. repeated UserSettingItem items = 1;
  636. required int64 version=2;
  637. }
  638. message UserSettingItem {
  639. required string targetId= 1;
  640. required ChannelType type = 2;
  641. required string key = 4;
  642. required bytes value = 5;
  643. required int64 version=6;
  644. required int32 status=7;
  645. repeated SessionTagItem tags= 8;
  646. }
  647. message `+rg+` {
  648. required int64 time = 1;
  649. }
  650. message `+Sl+` {
  651. required int64 version=1;
  652. repeated SessionState state= 2;
  653. }
  654. message `+$u+` {
  655. required ChannelType type = 1;
  656. required string channelId = 2;
  657. optional int64 time = 3;
  658. repeated SessionStateItem stateItem = 4;
  659. optional string busChannel = 5;//\u8BE5\u6D88\u606F\u6240\u5C5E\u4F1A\u8BDD\u7684\u4E1A\u52A1\u6807\u8BC6
  660. }
  661. message `+xu+` {
  662. required SessionStateType sessionStateType = 1;
  663. required string value = 2;
  664. repeated SessionTagItem tags = 3;
  665. }
  666. enum SessionStateType {
  667. IsSilent = 1;
  668. IsTop = 2;
  669. Tags = 3;
  670. }
  671. message `+Bu+` {
  672. required int64 version=1;
  673. repeated SessionState state= 2;
  674. }
  675. message `+ig+` {
  676. required int64 version=1;
  677. }
  678. message `+Fu+` {
  679. repeated string msgId=1; //\u5DF2\u8BFB\u6D88\u606FID
  680. optional string channelId = 2; // \u8BE5\u6D88\u606F\u6240\u5C5E\u4F1A\u8BDD\u7684\u4E1A\u52A1\u6807\u8BC6
  681. }
  682. message `+KC+` {
  683. repeated string msgId=1; //\u5DF2\u8BFB\u6D88\u606FID
  684. optional string channelId = 2; // \u8BE5\u6D88\u606F\u6240\u5C5E\u4F1A\u8BDD\u7684\u4E1A\u52A1\u6807\u8BC6
  685. }
  686. message `+Rl+` {
  687. required int32 totalMemberNum = 1;//\u7FA4\u5185\u603B\u4EBA\u6570
  688. repeated GrpMsgReadUser list = 2;//\u5DF2\u8BFB\u7528\u6237\u5217\u8868\uFF08list\u590D\u7C7B\u578B\uFF09
  689. }
  690. message `+GC+` {
  691. required int64 readTime = 1;//\u5DF2\u8BFB\u65F6\u95F4
  692. required string userId = 2;//\u5DF2\u8BFB\u7528\u6237id
  693. }
  694. message `+og+` {
  695. required int64 version=1;
  696. repeated SessionTagItem tags=2;
  697. }
  698. message `+ga+` {
  699. required string tagId=1;
  700. optional string name=2;
  701. optional int64 createdTime=3;
  702. optional bool isTop=4;
  703. }
  704. message `+sg+` {
  705. required int64 version=1;
  706. repeated SessionTagItem tags=2;
  707. }
  708. message `+ag+` {
  709. repeated string tagId=1;
  710. }
  711. message `+Tl+` {
  712. required int64 version=1;
  713. required bool reserve=2;
  714. }
  715. message `+cg+` {
  716. required string sdkInfo=1; // \u7528\u6237\u96C6\u6210\u7684 sdk \u4FE1\u606F,json \u683C\u5F0F {"web-rtc": "4.0.3.7"}
  717. }
  718. message `+zC+`
  719. {
  720. optional int32 nothing=1; //\u5360\u4F4D
  721. }
  722. message `+ug+`
  723. {
  724. required int32 type= 1; //(\u901A\u77E5\u7C7B\u578B 1:rtc\u623F\u95F4\u72B6\u6001KV\u53D8\u66F4\u901A\u77E5)
  725. optional int64 time= 2; //\u6D88\u606F\u4EA7\u751F\u65F6\u95F4
  726. optional string roomId=3; //\u4E3B\u64AD\u623F\u95F4id
  727. }
  728. message `+lg+`
  729. {
  730. required int64 timestamp = 1;
  731. required string roomId = 2;
  732. }
  733. message `+bl+`
  734. {
  735. repeated RtcKVEntity entries = 1;
  736. optional bool bFullUpdate = 2;
  737. optional int64 syncTime = 3;
  738. }
  739. message RtcKVEntity
  740. {
  741. required string key = 1;
  742. required string value = 2;
  743. optional int32 status = 3;
  744. optional int64 timestamp = 4;
  745. optional string uid = 5;
  746. }
  747. enum IdentityChangeType
  748. {
  749. AnchorToViewer = 1; //1\u4E3A\u4E3B\u64AD\u53D8\u89C2\u4F17
  750. ViewerToAnchor = 2; //2\u4E3A\u89C2\u4F17\u53D8\u4E3B\u64AD
  751. }
  752. message `+dg+`
  753. {
  754. required string userId = 1;
  755. }
  756. message `+Il+`
  757. {
  758. repeated RtcJoinedInfo info = 1;
  759. }
  760. message RtcJoinedInfo
  761. {
  762. required string deviceId = 1; //\u8BBE\u5907ID
  763. required string roomId = 2; //\u52A0\u5165\u7684\u623F\u95F4ID
  764. optional int64 joinTime = 3; //\u52A0\u5165\u7684\u65F6\u95F4
  765. }
  766. message `+YC+`
  767. {
  768. required string rtcToken=1;
  769. repeated RtcKVEntity entries = 2;//KV\u5C5E\u6027\u5BF9\u8C61\u96C6\u5408
  770. optional int64 syncTime = 3;//\u6240\u6709\u5C5E\u6027\u7684\u6700\u5927\u65F6\u95F4\u6233\uFF08\u4E0B\u6B21\u62C9\u53D6KV\u65F6\u7528\uFF09\u3002
  771. }
  772. message `+fg+`
  773. {
  774. required string invitedUserId=1; //\u88AB\u9080\u8BF7\u7684\u4EBA\u7684uid
  775. optional int32 timeoutTime=2; //\u9080\u8BF7\u8D85\u65F6\u65F6\u95F4(\u79D2),\u9ED8\u8BA4\u4E09\u5341\u79D2
  776. required string invitedRoomId=3; //\u88AB\u9080\u8BF7\u7684\u623F\u95F4
  777. required string inviteInfo=4; //\u9080\u8BF7\u7684\u4FE1\u606F(\u5305\u542B\u9080\u8BF7\u4EBA,\u88AB\u9080\u8BF7\u4EBA,\u5404\u81EAuserid)\u5BA2\u6237\u7AEF\u5B9A\u4E49\u597D.\u534F\u8BAE\u6808\u548Cserver\u900F\u4F20
  778. required string inviteSessionId= 5; //\u5BA2\u6237\u7AEF\u4FDD\u8BC1\u552F\u4E00\u6027(\u5EFA\u8BAEroomid_userid_\u65F6\u95F4\u6233_\u968F\u673A\u6570)
  779. }
  780. message `+hg+`
  781. {
  782. required string invitedUserId=1; //\u88AB\u9080\u8BF7\u7684\u4EBA\u7684uid
  783. required string invitedRoomId=2; //\u88AB\u9080\u8BF7\u7684\u623F\u95F4
  784. required string inviteInfo=3; //\u53D6\u6D88\u9080\u8BF7\u7684\u4FE1\u606F(\u5305\u542B\u9080\u8BF7\u4EBA,\u88AB\u9080\u8BF7\u4EBA,\u5404\u81EAuserid)\u5BA2\u6237\u7AEF\u5B9A\u4E49\u597D.\u534F\u8BAE\u6808\u548Cserver\u900F\u4F20
  785. required string inviteSessionId=4; //\u9080\u8BF7\u7684sessionId,\u5BA2\u6237\u7AEF\u53D1\u8D77\u9080\u8BF7\u65F6\u4EA7\u751F
  786. }
  787. message `+pg+`
  788. {
  789. required string inviteUserId=1; //\u9080\u8BF7\u7684\u4EBA\u7684uid
  790. required int32 answerCode=2; //\u662F\u5426\u63A5\u53D7\u8FDE\u9EA6\u9080\u8BF7.0\u4E3A\u62D2\u7EDD,1\u4E3A\u63A5\u53D7
  791. required string inviteRoomId=3; //\u9080\u8BF7\u7684\u623F\u95F4
  792. required string inviteSessionId=4; //\u9080\u8BF7\u7684sessionId
  793. required string content=5; //\u9700\u8981\u8F6C\u53D1\u7684content
  794. optional string key=6; //\u5982\u679C\u63A5\u53D7\u7684\u8BDD,\u9700\u8981\u52A0\u8FD9\u4E2A\u5B57\u6BB5,\u653E\u5728room\u7EA7\u522B\u7684k\u548Cv,\u65B0\u52A0\u5165\u623F\u95F4\u7684\u80FD\u62C9\u53D6\u5230
  795. optional string value=7; //\u5982\u679C\u63A5\u53D7\u7684\u8BDD,\u9700\u8981\u52A0\u8FD9\u4E2A\u5B57\u6BB5,\u653E\u5728room\u7EA7\u522B\u7684k\u548Cv,\u65B0\u52A0\u5165\u623F\u95F4\u7684\u80FD\u62C9\u53D6\u5230
  796. }
  797. message `+gg+`
  798. {
  799. required string inviteRoomId=1; //\u9080\u8BF7\u7684\u623F\u95F4
  800. required string inviteSessionId=2; //\u9080\u8BF7\u7684sessionId
  801. required string inviteContent=3; //\u7ED3\u675F\u8FDE\u9EA6\u7684\u4FE1\u606F(\u9700\u8981\u900F\u4F20\u7ED9\u623F\u95F4\u5185\u5176\u4ED6\u4EBA)
  802. repeated string inviteRoomKeys=4; //\u9700\u8981\u5220\u9664\u8FDE\u9EA6\u7684\u4FE1\u606F\u7684key
  803. }
  804. }
  805. `,gy,vy,$s,Lo,xs,qf=(gy=d4,function(e,t){var n,r,i={};return i.ByteBuffer=e,i.c=e,n=e,i.Long=t||null,i.VERSION="5.0.1",i.WIRE_TYPES={},i.WIRE_TYPES.VARINT=0,i.WIRE_TYPES.BITS64=1,i.WIRE_TYPES.LDELIM=2,i.WIRE_TYPES.STARTGROUP=3,i.WIRE_TYPES.ENDGROUP=4,i.WIRE_TYPES.BITS32=5,i.PACKABLE_WIRE_TYPES=[i.WIRE_TYPES.VARINT,i.WIRE_TYPES.BITS64,i.WIRE_TYPES.BITS32],i.TYPES={int32:{name:"int32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},uint64:{name:"uint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.UZERO:void 0},sint64:{name:"sint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},bool:{name:"bool",wireType:i.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:i.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:i.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.ZERO:void 0},float:{name:"float",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:i.WIRE_TYPES.STARTGROUP,defaultValue:null}},i.MAP_KEY_TYPES=[i.TYPES.int32,i.TYPES.sint32,i.TYPES.sfixed32,i.TYPES.uint32,i.TYPES.fixed32,i.TYPES.int64,i.TYPES.sint64,i.TYPES.sfixed64,i.TYPES.uint64,i.TYPES.fixed64,i.TYPES.bool,i.TYPES.string,i.TYPES.bytes],i.ID_MIN=1,i.ID_MAX=536870911,i.convertFieldsToCamelCase=!1,i.populateAccessors=!0,i.populateDefaults=!0,i.Util=function(){var o={};return o.IS_NODE=!(typeof process!="object"||process+""!="[object process]"||process.browser),o.XHR=function(){var s,a=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],u=null;for(s=0;s<a.length;s++){try{u=a[s]()}catch{continue}break}if(!u)throw Error("XMLHttpRequest is not supported");return u},o.fetch=function(s,a){if(a&&typeof a!="function"&&(a=null),o.IS_NODE)if(a)g.readFile(s,function(d,f){a(d?null:""+f)});else try{return g.readFileSync(s)}catch{return null}else{var u=o.XHR();if(u.open("GET",s,!!a),u.setRequestHeader("Accept","text/plain"),typeof u.overrideMimeType=="function"&&u.overrideMimeType("text/plain"),!a)return u.send(null),u.status==200||u.status==0&&typeof u.responseText=="string"?u.responseText:null;if(u.onreadystatechange=function(){u.readyState==4&&(u.status==200||u.status==0&&typeof u.responseText=="string"?a(u.responseText):a(null))},u.readyState==4)return;u.send(null)}},o.toCamelCase=function(s){return s.replace(/_([a-zA-Z])/g,function(a,u){return u.toUpperCase()})},o}(),i.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},i.DotProto=function(o,s){function a(m,v){var _=-1,y=1;if(m.charAt(0)=="-"&&(y=-1,m=m.substring(1)),s.NUMBER_DEC.test(m))_=parseInt(m);else if(s.NUMBER_HEX.test(m))_=parseInt(m.substring(2),16);else{if(!s.NUMBER_OCT.test(m))throw Error("illegal id value: "+(y<0?"-":"")+m);_=parseInt(m.substring(1),8)}if(_=0|y*_,!v&&_<0)throw Error("illegal id value: "+(y<0?"-":"")+m);return _}function u(m){var v=1;if(m.charAt(0)=="-"&&(v=-1,m=m.substring(1)),s.NUMBER_DEC.test(m))return v*parseInt(m,10);if(s.NUMBER_HEX.test(m))return v*parseInt(m.substring(2),16);if(s.NUMBER_OCT.test(m))return v*parseInt(m.substring(1),8);if(m==="inf")return 1/0*v;if(m==="nan")return NaN;if(s.NUMBER_FLT.test(m))return v*parseFloat(m);throw Error("illegal number value: "+(v<0?"-":"")+m)}function d(m,v,_){m[v]===void 0?m[v]=_:(Array.isArray(m[v])||(m[v]=[m[v]]),m[v].push(_))}var f,c,l={},h=function(m){this.source=m+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},p=h.prototype;return p._readString=function(){var m,v=this._stringOpen==='"'?s.STRING_DQ:s.STRING_SQ;if(v.lastIndex=this.index-1,!(m=v.exec(this.source)))throw Error("unterminated string");return this.index=v.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,m[1]},p.next=function(){var m,v,_,y,E;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(this._stringOpen!==null)return this._readString();do{for(m=!1;s.WHITESPACE.test(_=this.source.charAt(this.index));)if(_===`
  806. `&&++this.line,++this.index===this.source.length)return null;if(this.source.charAt(this.index)==="/")if(++this.index,this.source.charAt(this.index)==="/"){for(;this.source.charAt(++this.index)!==`
  807. `;)if(this.index==this.source.length)return null;++this.index,++this.line,m=!0}else{if((_=this.source.charAt(this.index))!=="*")return"/";do{if(_===`
  808. `&&++this.line,++this.index===this.source.length)return null;v=_,_=this.source.charAt(this.index)}while(v!=="*"||_!=="/");++this.index,m=!0}}while(m);if(this.index===this.source.length)return null;if(y=this.index,s.DELIM.lastIndex=0,!s.DELIM.test(this.source.charAt(y++)))for(;y<this.source.length&&!s.DELIM.test(this.source.charAt(y));)++y;return((E=this.source.substring(this.index,this.index=y))==='"'||E==="'")&&(this._stringOpen=E),E},p.peek=function(){if(this.stack.length===0){var m=this.next();if(m===null)return null;this.stack.push(m)}return this.stack[0]},p.skip=function(m){var v=this.next();if(v!==m)throw Error("illegal '"+v+"', '"+m+"' expected")},p.omit=function(m){return this.peek()===m&&(this.next(),!0)},p.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},l.Tokenizer=h,(c=(f=function(m){this.tn=new h(m),this.proto3=!1}).prototype).parse=function(){var m,v={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},_=!0;try{for(;m=this.tn.next();)switch(m){case"package":if(!_||v.package!==null)throw Error("unexpected 'package'");if(m=this.tn.next(),!s.TYPEREF.test(m))throw Error("illegal package name: "+m);this.tn.skip(";"),v.package=m;break;case"import":if(!_)throw Error("unexpected 'import'");(m=this.tn.peek())==="public"&&this.tn.next(),m=this._readString(),this.tn.skip(";"),v.imports.push(m);break;case"syntax":if(!_)throw Error("unexpected 'syntax'");this.tn.skip("="),(v.syntax=this._readString())==="proto3"&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(v,null),_=!1;break;case"enum":this._parseEnum(v),_=!1;break;case"option":this._parseOption(v);break;case"service":this._parseService(v);break;case"extend":this._parseExtend(v);break;default:throw Error("unexpected '"+m+"'")}}catch(y){throw y.message="Parse error at line "+this.tn.line+": "+y.message,y}return delete v.name,v},f.parse=function(m){return new f(m).parse()},c._readString=function(){var m,v,_="";do{if((v=this.tn.next())!=="'"&&v!=='"')throw Error("illegal string delimiter: "+v);_+=this.tn.next(),this.tn.skip(v),m=this.tn.peek()}while(m==='"'||m==='"');return _},c._readValue=function(m){var v=this.tn.peek();if(v==='"'||v==="'")return this._readString();if(this.tn.next(),s.NUMBER.test(v))return u(v);if(s.BOOL.test(v))return v.toLowerCase()==="true";if(m&&s.TYPEREF.test(v))return v;throw Error("illegal value: "+v)},c._parseOption=function(m,v){var _,y=this.tn.next(),E=!1;if(y==="("&&(E=!0,y=this.tn.next()),!s.TYPEREF.test(y))throw Error("illegal option name: "+y);_=y,E&&(this.tn.skip(")"),_="("+_+")",y=this.tn.peek(),s.FQTYPEREF.test(y)&&(_+=y,this.tn.next())),this.tn.skip("="),this._parseOptionValue(m,_),v||this.tn.skip(";")},c._parseOptionValue=function(m,v){var _=this.tn.peek();if(_!=="{")d(m.options,v,this._readValue(!0));else for(this.tn.skip("{");(_=this.tn.next())!=="}";){if(!s.NAME.test(_))throw Error("illegal option name: "+v+"."+_);this.tn.omit(":")?d(m.options,v+"."+_,this._readValue(!0)):this._parseOptionValue(m,v+"."+_)}},c._parseService=function(m){var v,_=this.tn.next();if(!s.NAME.test(_))throw Error("illegal service name at line "+this.tn.line+": "+_);for(v={name:_,rpc:{},options:{}},this.tn.skip("{");(_=this.tn.next())!=="}";)if(_==="option")this._parseOption(v);else{if(_!=="rpc")throw Error("illegal service token: "+_);this._parseServiceRPC(v)}this.tn.omit(";"),m.services.push(v)},c._parseServiceRPC=function(m){var v,_,y="rpc",E=this.tn.next();if(!s.NAME.test(E))throw Error("illegal rpc service method name: "+E);if(v=E,_={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),(E=this.tn.next()).toLowerCase()==="stream"&&(_.request_stream=!0,E=this.tn.next()),!s.TYPEREF.test(E))throw Error("illegal rpc service request type: "+E);if(_.request=E,this.tn.skip(")"),(E=this.tn.next()).toLowerCase()!=="returns")throw Error("illegal rpc service request type delimiter: "+E);if(this.tn.skip("("),(E=this.tn.next()).toLowerCase()==="stream"&&(_.response_stream=!0,E=this.tn.next()),_.response=E,this.tn.skip(")"),(E=this.tn.peek())==="{"){for(this.tn.next();(E=this.tn.next())!=="}";){if(E!=="option")throw Error("illegal rpc service token: "+E);this._parseOption(_)}this.tn.omit(";")}else this.tn.skip(";");m[y]===void 0&&(m[y]={}),m[y][v]=_},c._parseMessage=function(m,v){var _=!!v,y=this.tn.next(),E={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!s.NAME.test(y))throw Error("illegal "+(_?"group":"message")+" name: "+y);for(E.name=y,_&&(this.tn.skip("="),v.id=a(this.tn.next()),E.isGroup=!0),(y=this.tn.peek())==="["&&v&&this._parseFieldOptions(v),this.tn.skip("{");(y=this.tn.next())!=="}";)if(s.RULE.test(y))this._parseMessageField(E,y);else if(y==="oneof")this._parseMessageOneOf(E);else if(y==="enum")this._parseEnum(E);else if(y==="message")this._parseMessage(E);else if(y==="option")this._parseOption(E);else if(y==="service")this._parseService(E);else if(y==="extensions")E.extensions=this._parseExtensionRanges();else if(y==="reserved")this._parseIgnored();else if(y==="extend")this._parseExtend(E);else{if(!s.TYPEREF.test(y))throw Error("illegal message token: "+y);if(!this.proto3)throw Error("illegal field rule: "+y);this._parseMessageField(E,"optional",y)}return this.tn.omit(";"),m.messages.push(E),E},c._parseIgnored=function(){for(;this.tn.peek()!==";";)this.tn.next();this.tn.skip(";")},c._parseMessageField=function(m,v,_){var y,E,S;if(!s.RULE.test(v))throw Error("illegal message field rule: "+v);if(y={rule:v,type:"",name:"",options:{},id:0},v==="map"){if(_)throw Error("illegal type: "+_);if(this.tn.skip("<"),E=this.tn.next(),!s.TYPE.test(E)&&!s.TYPEREF.test(E))throw Error("illegal message field type: "+E);if(y.keytype=E,this.tn.skip(","),E=this.tn.next(),!s.TYPE.test(E)&&!s.TYPEREF.test(E))throw Error("illegal message field: "+E);if(y.type=E,this.tn.skip(">"),E=this.tn.next(),!s.NAME.test(E))throw Error("illegal message field name: "+E);y.name=E,this.tn.skip("="),y.id=a(this.tn.next()),(E=this.tn.peek())==="["&&this._parseFieldOptions(y),this.tn.skip(";")}else if((_=_!==void 0?_:this.tn.next())==="group"){if(S=this._parseMessage(m,y),!/^[A-Z]/.test(S.name))throw Error("illegal group name: "+S.name);y.type=S.name,y.name=S.name.toLowerCase(),this.tn.omit(";")}else{if(!s.TYPE.test(_)&&!s.TYPEREF.test(_))throw Error("illegal message field type: "+_);if(y.type=_,E=this.tn.next(),!s.NAME.test(E))throw Error("illegal message field name: "+E);y.name=E,this.tn.skip("="),y.id=a(this.tn.next()),(E=this.tn.peek())==="["&&this._parseFieldOptions(y),this.tn.skip(";")}return m.fields.push(y),y},c._parseMessageOneOf=function(m){var v,_,y,E=this.tn.next();if(!s.NAME.test(E))throw Error("illegal oneof name: "+E);for(_=E,y=[],this.tn.skip("{");(E=this.tn.next())!=="}";)(v=this._parseMessageField(m,"optional",E)).oneof=_,y.push(v.id);this.tn.omit(";"),m.oneofs[_]=y},c._parseFieldOptions=function(m){this.tn.skip("[");for(var v=!0;this.tn.peek()!=="]";)v||this.tn.skip(","),this._parseOption(m,!0),v=!1;this.tn.next()},c._parseEnum=function(m){var v,_={name:"",values:[],options:{}},y=this.tn.next();if(!s.NAME.test(y))throw Error("illegal name: "+y);for(_.name=y,this.tn.skip("{");(y=this.tn.next())!=="}";)if(y==="option")this._parseOption(_);else{if(!s.NAME.test(y))throw Error("illegal name: "+y);this.tn.skip("="),v={name:y,id:a(this.tn.next(),!0)},(y=this.tn.peek())==="["&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),_.values.push(v)}this.tn.omit(";"),m.enums.push(_)},c._parseExtensionRanges=function(){var m,v,_,y=[];do{for(v=[];;){switch(m=this.tn.next()){case"min":_=o.ID_MIN;break;case"max":_=o.ID_MAX;break;default:_=u(m)}if(v.push(_),v.length===2)break;if(this.tn.peek()!=="to"){v.push(_);break}this.tn.next()}y.push(v)}while(this.tn.omit(","));return this.tn.skip(";"),y},c._parseExtend=function(m){var v,_=this.tn.next();if(!s.TYPEREF.test(_))throw Error("illegal extend reference: "+_);for(v={ref:_,fields:[]},this.tn.skip("{");(_=this.tn.next())!=="}";)if(s.RULE.test(_))this._parseMessageField(v,_);else{if(!s.TYPEREF.test(_))throw Error("illegal extend token: "+_);if(!this.proto3)throw Error("illegal field rule: "+_);this._parseMessageField(v,"optional",_)}return this.tn.omit(";"),m.messages.push(v),v},c.toString=function(){return"Parser at line "+this.tn.line},l.Parser=f,l}(i,i.Lang),i.Reflect=function(o){function s(b,I){if(b&&typeof b.low=="number"&&typeof b.high=="number"&&typeof b.unsigned=="boolean"&&b.low==b.low&&b.high==b.high)return new o.Long(b.low,b.high,I===void 0?b.unsigned:I);if(typeof b=="string")return o.Long.fromString(b,I||!1,10);if(typeof b=="number")return o.Long.fromNumber(b,I||!1);throw Error("not convertible to Long")}function a(b,I){var N=I.readVarint32(),A=7&N,M=N>>>3;switch(A){case o.WIRE_TYPES.VARINT:do N=I.readUint8();while((128&N)==128);break;case o.WIRE_TYPES.BITS64:I.offset+=8;break;case o.WIRE_TYPES.LDELIM:N=I.readVarint32(),I.offset+=N;break;case o.WIRE_TYPES.STARTGROUP:a(M,I);break;case o.WIRE_TYPES.ENDGROUP:if(M===b)return!1;throw Error("Illegal GROUPEND after unknown group: "+M+" ("+b+" expected)");case o.WIRE_TYPES.BITS32:I.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+b+": "+A)}return!0}var u,d,f,c,l,h,p,m,v,_,y,E,S,T,R,C,w={},L=function(b,I,N){this.builder=b,this.parent=I,this.name=N,this.className},V=L.prototype;return V.fqn=function(){for(var b=this.name,I=this;(I=I.parent)!=null;)b=I.name+"."+b;return b},V.toString=function(b){return(b?this.className+" ":"")+this.fqn()},V.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},w.T=L,(d=(u=function(b,I,N,A,M){L.call(this,b,I,N),this.className="Namespace",this.children=[],this.options=A||{},this.syntax=M||"proto2"}).prototype=Object.create(L.prototype)).getChildren=function(b){var I,N,A;if((b=b||null)==null)return this.children.slice();for(I=[],N=0,A=this.children.length;A>N;++N)this.children[N]instanceof b&&I.push(this.children[N]);return I},d.addChild=function(b){var I;if(I=this.getChild(b.name))if(I instanceof l.Field&&I.name!==I.originalName&&this.getChild(I.originalName)===null)I.name=I.originalName;else{if(!(b instanceof l.Field&&b.name!==b.originalName&&this.getChild(b.originalName)===null))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+b.name);b.name=b.originalName}this.children.push(b)},d.getChild=function(b){var I,N,A=typeof b=="number"?"id":"name";for(I=0,N=this.children.length;N>I;++I)if(this.children[I][A]===b)return this.children[I];return null},d.resolve=function(b,I){var N,A=typeof b=="string"?b.split("."):b,M=this,$=0;if(A[$]===""){for(;M.parent!==null;)M=M.parent;$++}do{do{if(!(M instanceof w.Namespace)){M=null;break}if(!((N=M.getChild(A[$]))&&N instanceof w.T&&(!I||N instanceof w.Namespace))){M=null;break}M=N,$++}while($<A.length);if(M!=null)break;if(this.parent!==null)return this.parent.resolve(b,I)}while(M!=null);return M},d.qn=function(b){var I,N,A=[],M=b;do A.unshift(M.name),M=M.parent;while(M!==null);for(I=1;I<=A.length;I++)if(N=A.slice(A.length-I),b===this.resolve(N,b instanceof w.Namespace))return N.join(".");return b.fqn()},d.build=function(){var b,I,N,A={},M=this.children;for(I=0,N=M.length;N>I;++I)(b=M[I])instanceof u&&(A[b.name]=b.build());return Object.defineProperty&&Object.defineProperty(A,"$options",{value:this.buildOpt()}),A},d.buildOpt=function(){var b,I,N,A,M={},$=Object.keys(this.options);for(b=0,I=$.length;I>b;++b)N=$[b],A=this.options[$[b]],M[N]=A;return M},d.getOption=function(b){return b===void 0?this.options:this.options[b]!==void 0?this.options[b]:null},w.Namespace=u,c=(f=function(b,I,N,A){if(this.type=b,this.resolvedType=I,this.isMapKey=N,this.syntax=A,N&&o.MAP_KEY_TYPES.indexOf(b)<0)throw Error("Invalid map key type: "+b.name)}).prototype,f.defaultFieldValue=function(b){if(typeof b=="string"&&(b=o.TYPES[b]),b.defaultValue===void 0)throw Error("default value for type "+b.name+" is not supported");return b==o.TYPES.bytes?new n(0):b.defaultValue},c.verifyValue=function(b){var I,N,A,M=function($,x){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+$+" ("+x+")")}.bind(this);switch(this.type){case o.TYPES.int32:case o.TYPES.sint32:case o.TYPES.sfixed32:return(typeof b!="number"||b==b&&b%1!=0)&&M(typeof b,"not an integer"),b>4294967295?0|b:b;case o.TYPES.uint32:case o.TYPES.fixed32:return(typeof b!="number"||b==b&&b%1!=0)&&M(typeof b,"not an integer"),b<0?b>>>0:b;case o.TYPES.int64:case o.TYPES.sint64:case o.TYPES.sfixed64:if(o.Long)try{return s(b,!1)}catch($){M(typeof b,$.message)}else M(typeof b,"requires Long.js");case o.TYPES.uint64:case o.TYPES.fixed64:if(o.Long)try{return s(b,!0)}catch($){M(typeof b,$.message)}else M(typeof b,"requires Long.js");case o.TYPES.bool:return typeof b!="boolean"&&M(typeof b,"not a boolean"),b;case o.TYPES.float:case o.TYPES.double:return typeof b!="number"&&M(typeof b,"not a number"),b;case o.TYPES.string:return typeof b=="string"||b&&b instanceof String||M(typeof b,"not a string"),""+b;case o.TYPES.bytes:return e.isByteBuffer(b)?b:e.wrap(b);case o.TYPES.enum:for(I=this.resolvedType.getChildren(o.Reflect.Enum.Value),A=0;A<I.length;A++)if(I[A].name==b||I[A].id==b)return I[A].id;if(this.syntax==="proto3")return(typeof b!="number"||b==b&&b%1!=0)&&M(typeof b,"not an integer"),(b>4294967295||b<0)&&M(typeof b,"not in range for uint32"),b;M(b,"not a valid enum value");case o.TYPES.group:case o.TYPES.message:if(b&&typeof b=="object"||M(typeof b,"object expected"),b instanceof this.resolvedType.clazz)return b;if(b instanceof o.Builder.Message){for(A in N={},b)b.hasOwnProperty(A)&&(N[A]=b[A]);b=N}return new this.resolvedType.clazz(b)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+b+" (undefined type "+this.type+")")},c.calculateLength=function(b,I){if(I===null)return 0;var N;switch(this.type){case o.TYPES.int32:return I<0?n.calculateVarint64(I):n.calculateVarint32(I);case o.TYPES.uint32:return n.calculateVarint32(I);case o.TYPES.sint32:return n.calculateVarint32(n.zigZagEncode32(I));case o.TYPES.fixed32:case o.TYPES.sfixed32:case o.TYPES.float:return 4;case o.TYPES.int64:case o.TYPES.uint64:return n.calculateVarint64(I);case o.TYPES.sint64:return n.calculateVarint64(n.zigZagEncode64(I));case o.TYPES.fixed64:case o.TYPES.sfixed64:return 8;case o.TYPES.bool:return 1;case o.TYPES.enum:return n.calculateVarint32(I);case o.TYPES.double:return 8;case o.TYPES.string:return N=n.calculateUTF8Bytes(I),n.calculateVarint32(N)+N;case o.TYPES.bytes:if(I.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+I.remaining()+" bytes remaining");return n.calculateVarint32(I.remaining())+I.remaining();case o.TYPES.message:return N=this.resolvedType.calculate(I),n.calculateVarint32(N)+N;case o.TYPES.group:return(N=this.resolvedType.calculate(I))+n.calculateVarint32(b<<3|o.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+I+" (unknown type)")},c.encodeValue=function(b,I,N){var A,M;if(I===null)return N;switch(this.type){case o.TYPES.int32:I<0?N.writeVarint64(I):N.writeVarint32(I);break;case o.TYPES.uint32:N.writeVarint32(I);break;case o.TYPES.sint32:N.writeVarint32ZigZag(I);break;case o.TYPES.fixed32:N.writeUint32(I);break;case o.TYPES.sfixed32:N.writeInt32(I);break;case o.TYPES.int64:case o.TYPES.uint64:N.writeVarint64(I);break;case o.TYPES.sint64:N.writeVarint64ZigZag(I);break;case o.TYPES.fixed64:N.writeUint64(I);break;case o.TYPES.sfixed64:N.writeInt64(I);break;case o.TYPES.bool:typeof I=="string"?N.writeVarint32(I.toLowerCase()==="false"?0:!!I):N.writeVarint32(I?1:0);break;case o.TYPES.enum:N.writeVarint32(I);break;case o.TYPES.float:N.writeFloat32(I);break;case o.TYPES.double:N.writeFloat64(I);break;case o.TYPES.string:N.writeVString(I);break;case o.TYPES.bytes:if(I.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+I.remaining()+" bytes remaining");A=I.offset,N.writeVarint32(I.remaining()),N.append(I),I.offset=A;break;case o.TYPES.message:M=new n().LE(),this.resolvedType.encode(I,M),N.writeVarint32(M.offset),N.append(M.flip());break;case o.TYPES.group:this.resolvedType.encode(I,N),N.writeVarint32(b<<3|o.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+I+" (unknown type)")}return N},c.decode=function(b,I,N){if(I!=this.type.wireType)throw Error("Unexpected wire type for element");var A,M;switch(this.type){case o.TYPES.int32:return 0|b.readVarint32();case o.TYPES.uint32:return b.readVarint32()>>>0;case o.TYPES.sint32:return 0|b.readVarint32ZigZag();case o.TYPES.fixed32:return b.readUint32()>>>0;case o.TYPES.sfixed32:return 0|b.readInt32();case o.TYPES.int64:return b.readVarint64();case o.TYPES.uint64:return b.readVarint64().toUnsigned();case o.TYPES.sint64:return b.readVarint64ZigZag();case o.TYPES.fixed64:return b.readUint64();case o.TYPES.sfixed64:return b.readInt64();case o.TYPES.bool:return!!b.readVarint32();case o.TYPES.enum:return b.readVarint32();case o.TYPES.float:return b.readFloat();case o.TYPES.double:return b.readDouble();case o.TYPES.string:return b.readVString();case o.TYPES.bytes:if(M=b.readVarint32(),b.remaining()<M)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+M+" required but got only "+b.remaining());return(A=b.clone()).limit=A.offset+M,b.offset+=M,A;case o.TYPES.message:return M=b.readVarint32(),this.resolvedType.decode(b,M);case o.TYPES.group:return this.resolvedType.decode(b,-1,N)}throw Error("[INTERNAL] Illegal decode type")},c.valueFromString=function(b){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case o.TYPES.int32:case o.TYPES.sint32:case o.TYPES.sfixed32:case o.TYPES.uint32:case o.TYPES.fixed32:return this.verifyValue(parseInt(b));case o.TYPES.int64:case o.TYPES.sint64:case o.TYPES.sfixed64:case o.TYPES.uint64:case o.TYPES.fixed64:return this.verifyValue(b);case o.TYPES.bool:return b==="true";case o.TYPES.string:return this.verifyValue(b);case o.TYPES.bytes:return n.fromBinary(b)}},c.valueToString=function(b){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===o.TYPES.bytes?b.toString("binary"):b.toString()},w.Element=f,(h=(l=function(b,I,N,A,M,$){u.call(this,b,I,N,A,$),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!M,this._fields=null,this._fieldsById=null,this._fieldsByName=null}).prototype=Object.create(u.prototype)).build=function(b){var I,N,A,M;if(this.clazz&&!b)return this.clazz;for(I=function($,x){function q(P,z,G,K){var pe,be,Ie,we,k,j,H;if(P===null||typeof P!="object")return K&&K instanceof $.Reflect.Enum&&(pe=$.Reflect.Enum.getName(K.object,P))!==null?pe:P;if(n.isByteBuffer(P))return z?P.toBase64():P.toBuffer();if($.Long.isLong(P))return G?P.toString():$.Long.fromValue(P);if(Array.isArray(P))return be=[],P.forEach(function(W,te){be[te]=q(W,z,G,K)}),be;if(be={},P instanceof $.Map){for(we=(Ie=P.entries()).next();!we.done;we=Ie.next())be[P.keyElem.valueToString(we.value[0])]=q(we.value[1],z,G,P.valueElem.resolvedType);return be}for(H in k=P.$type,j=void 0,P)P.hasOwnProperty(H)&&(be[H]=k&&(j=k.getChild(H))?q(P[H],z,G,j.resolvedType):q(P[H],z,G));return be}var Z,le,Te=x.getChildren($.Reflect.Message.Field),Ee=x.getChildren($.Reflect.Message.OneOf),ve=function(P){var z,G,K,pe;for($.Builder.Message.call(this),z=0,G=Ee.length;G>z;++z)this[Ee[z].name]=null;for(z=0,G=Te.length;G>z;++z)this[(K=Te[z]).name]=K.repeated?[]:K.map?new $.Map(K):null,!K.required&&x.syntax!=="proto3"||K.defaultValue===null||(this[K.name]=K.defaultValue);if(arguments.length>0)if(arguments.length!==1||P===null||typeof P!="object"||!(typeof P.encode!="function"||P instanceof ve)||Array.isArray(P)||P instanceof $.Map||n.isByteBuffer(P)||P instanceof ArrayBuffer||$.Long&&P instanceof $.Long)for(z=0,G=arguments.length;G>z;++z)(pe=arguments[z])!==void 0&&this.$set(Te[z].name,pe);else this.$set(P)},Se=ve.prototype=Object.create($.Builder.Message.prototype);for(Se.add=function(P,z,G){var K=x._fieldsByName[P];if(!G){if(!K)throw Error(this+"#"+P+" is undefined");if(!(K instanceof $.Reflect.Message.Field))throw Error(this+"#"+P+" is not a field: "+K.toString(!0));if(!K.repeated)throw Error(this+"#"+P+" is not a repeated field");z=K.verifyValue(z,!0)}return this[P]===null&&(this[P]=[]),this[P].push(z),this},Se.$add=Se.add,Se.set=function(P,z,G){var K,pe,be;if(P&&typeof P=="object"){for(K in G=z,P)P.hasOwnProperty(K)&&(z=P[K])!==void 0&&this.$set(K,z,G);return this}if(pe=x._fieldsByName[P],G)this[P]=z;else{if(!pe)throw Error(this+"#"+P+" is not a field: undefined");if(!(pe instanceof $.Reflect.Message.Field))throw Error(this+"#"+P+" is not a field: "+pe.toString(!0));this[pe.name]=z=pe.verifyValue(z)}return pe&&pe.oneof&&(be=this[pe.oneof.name],z!==null?(be!==null&&be!==pe.name&&(this[be]=null),this[pe.oneof.name]=pe.name):be===P&&(this[pe.oneof.name]=null)),this},Se.$set=Se.set,Se.get=function(P,z){if(z)return this[P];var G=x._fieldsByName[P];if(!(G&&G instanceof $.Reflect.Message.Field))throw Error(this+"#"+P+" is not a field: undefined");if(!(G instanceof $.Reflect.Message.Field))throw Error(this+"#"+P+" is not a field: "+G.toString(!0));return this[G.name]},Se.$get=Se.get,Z=0;Z<Te.length;Z++)(le=Te[Z])instanceof $.Reflect.Message.ExtensionField||x.builder.options.populateAccessors&&function(P){var z,G,K,pe=P.originalName.replace(/(_[a-zA-Z])/g,function(be){return be.toUpperCase().replace("_","")});pe=pe.substring(0,1).toUpperCase()+pe.substring(1),z=P.originalName.replace(/([A-Z])/g,function(be){return"_"+be}),G=function(be,Ie){return this[P.name]=Ie?be:P.verifyValue(be),this},K=function(){return this[P.name]},x.getChild("set"+pe)===null&&(Se["set"+pe]=G),x.getChild("set_"+z)===null&&(Se["set_"+z]=G),x.getChild("get"+pe)===null&&(Se["get"+pe]=K),x.getChild("get_"+z)===null&&(Se["get_"+z]=K)}(le);return Se.encode=function(P,z){var G,K;typeof P=="boolean"&&(z=P,P=void 0),G=!1,P||(P=new e,G=!0),K=P.littleEndian;try{return x.encode(this,P.LE(),z),(G?P.flip():P).LE(K)}catch(pe){throw P.LE(K),pe}},ve.encode=function(P,z,G){return new ve(P).encode(z,G)},Se.calculate=function(){return x.calculate(this)},Se.encodeDelimited=function(P){var z,G=!1;return P||(P=new n,G=!0),z=new n().LE(),x.encode(this,z).flip(),P.writeVarint32(z.remaining()),P.append(z),G?P.flip():P},Se.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(P){throw P.encoded&&(P.encoded=P.encoded.toArrayBuffer()),P}},Se.toArrayBuffer=Se.encodeAB,Se.encodeNB=function(){try{return this.encode().toBuffer()}catch(P){throw P.encoded&&(P.encoded=P.encoded.toBuffer()),P}},Se.toBuffer=Se.encodeNB,Se.encode64=function(){try{return this.encode().toBase64()}catch(P){throw P.encoded&&(P.encoded=P.encoded.toBase64()),P}},Se.toBase64=Se.encode64,Se.encodeHex=function(){try{return this.encode().toHex()}catch(P){throw P.encoded&&(P.encoded=P.encoded.toHex()),P}},Se.toHex=Se.encodeHex,Se.toRaw=function(P,z){return q(this,!!P,!!z,this.$type)},Se.encodeJSON=function(){return JSON.stringify(q(this,!0,!0,this.$type))},ve.decode=function(P,z){var G,K;typeof P=="string"&&(P=n.wrap(P,z||"base64")),G=(P=n.isByteBuffer(P)?P:n.wrap(P)).littleEndian;try{return K=x.decode(P.LE()),P.LE(G),K}catch(pe){throw P.LE(G),pe}},ve.decodeDelimited=function(P,z){var G,K,pe;if(typeof P=="string"&&(P=n.wrap(P,z||"base64")),(P=n.isByteBuffer(P)?P:n.wrap(P)).remaining()<1)return null;if(G=P.offset,K=P.readVarint32(),P.remaining()<K)return P.offset=G,null;try{return pe=x.decode(P.slice(P.offset,P.offset+K).LE()),P.offset+=K,pe}catch(be){throw P.offset+=K,be}},ve.decode64=function(P){return ve.decode(P,"base64")},ve.decodeHex=function(P){return ve.decode(P,"hex")},ve.decodeJSON=function(P){return new ve(JSON.parse(P))},Se.toString=function(){return x.toString()},Object.defineProperty&&(Object.defineProperty(ve,"$options",{value:x.buildOpt()}),Object.defineProperty(Se,"$options",{value:ve.$options}),Object.defineProperty(ve,"$type",{value:x}),Object.defineProperty(Se,"$type",{value:x})),ve}(o,this),this._fields=[],this._fieldsById={},this._fieldsByName={},A=0,M=this.children.length;M>A;A++)if((N=this.children[A])instanceof y||N instanceof l||N instanceof T){if(I.hasOwnProperty(N.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+N.toString(!0)+" cannot override static property '"+N.name+"'");I[N.name]=N.build()}else if(N instanceof l.Field)N.build(),this._fields.push(N),this._fieldsById[N.id]=N,this._fieldsByName[N.name]=N;else if(!(N instanceof l.OneOf||N instanceof S))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[A].toString(!0));return this.clazz=I},h.encode=function(b,I,N){var A,M,$,x,q,Z=null;for($=0,x=this._fields.length;x>$;++$)M=b[(A=this._fields[$]).name],A.required&&M===null?Z===null&&(Z=A):A.encode(N?M:A.verifyValue(M),I,b);if(Z!==null)throw(q=Error("Missing at least one required field for "+this.toString(!0)+": "+Z)).encoded=I,q;return I},h.calculate=function(b){for(var I,N,A=0,M=0,$=this._fields.length;$>M;++M){if(N=b[(I=this._fields[M]).name],I.required&&N===null)throw Error("Missing at least one required field for "+this.toString(!0)+": "+I);A+=I.calculate(N,b)}return A},h.decode=function(b,I,N){var A,M,$,x,q,Z,le,Te,Ee,ve,Se,P;for(I=typeof I=="number"?I:-1,q=b.offset,Z=new this.clazz;b.offset<q+I||I===-1&&b.remaining()>0;){if($=(A=b.readVarint32())>>>3,(M=7&A)===o.WIRE_TYPES.ENDGROUP){if($!==N)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+$+" ("+(N?N+" expected":"not a group")+")");break}if(x=this._fieldsById[$])x.repeated&&!x.options.packed?Z[x.name].push(x.decode(M,b)):x.map?(Te=x.decode(M,b),Z[x.name].set(Te[0],Te[1])):(Z[x.name]=x.decode(M,b),x.oneof&&((Ee=Z[x.oneof.name])!==null&&Ee!==x.name&&(Z[Ee]=null),Z[x.oneof.name]=x.name));else switch(M){case o.WIRE_TYPES.VARINT:b.readVarint32();break;case o.WIRE_TYPES.BITS32:b.offset+=4;break;case o.WIRE_TYPES.BITS64:b.offset+=8;break;case o.WIRE_TYPES.LDELIM:le=b.readVarint32(),b.offset+=le;break;case o.WIRE_TYPES.STARTGROUP:for(;a($,b););break;default:throw Error("Illegal wire type for unknown field "+$+" in "+this.toString(!0)+"#decode: "+M)}}for(ve=0,Se=this._fields.length;Se>ve;++ve)if(Z[(x=this._fields[ve]).name]===null)if(this.syntax==="proto3")Z[x.name]=x.defaultValue;else{if(x.required)throw(P=Error("Missing at least one required field for "+this.toString(!0)+": "+x.name)).decoded=Z,P;o.populateDefaults&&x.defaultValue!==null&&(Z[x.name]=x.defaultValue)}return Z},w.Message=l,(m=(p=function(b,I,N,A,M,$,x,q,Z,le){L.call(this,b,I,$),this.className="Message.Field",this.required=N==="required",this.repeated=N==="repeated",this.map=N==="map",this.keyType=A||null,this.type=M,this.resolvedType=null,this.id=x,this.options=q||{},this.defaultValue=null,this.oneof=Z||null,this.syntax=le||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof l.ExtensionField||(this.name=o.Util.toCamelCase(this.name))}).prototype=Object.create(L.prototype)).build=function(){this.element=new f(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new f(this.keyType,void 0,!0,this.syntax)),this.syntax!=="proto3"||this.repeated||this.map?this.options.default!==void 0&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=f.defaultFieldValue(this.type)},m.verifyValue=function(b,I){var N,A,M;if(I=I||!1,N=function($,x){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+$+" ("+x+")")}.bind(this),b===null)return this.required&&N(typeof b,"required"),this.syntax==="proto3"&&this.type!==o.TYPES.message&&N(typeof b,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!I){for(Array.isArray(b)||(b=[b]),M=[],A=0;A<b.length;A++)M.push(this.element.verifyValue(b[A]));return M}return this.map&&!I?b instanceof o.Map?b:(b instanceof Object||N(typeof b,"expected ProtoBuf.Map or raw object for map field"),new o.Map(this,b)):(!this.repeated&&Array.isArray(b)&&N(typeof b,"no array expected"),this.element.verifyValue(b))},m.hasWirePresence=function(b,I){if(this.syntax!=="proto3")return b!==null;if(this.oneof&&I[this.oneof.name]===this.name)return!0;switch(this.type){case o.TYPES.int32:case o.TYPES.sint32:case o.TYPES.sfixed32:case o.TYPES.uint32:case o.TYPES.fixed32:return b!==0;case o.TYPES.int64:case o.TYPES.sint64:case o.TYPES.sfixed64:case o.TYPES.uint64:case o.TYPES.fixed64:return b.low!==0||b.high!==0;case o.TYPES.bool:return b;case o.TYPES.float:case o.TYPES.double:return b!==0;case o.TYPES.string:return b.length>0;case o.TYPES.bytes:return b.remaining()>0;case o.TYPES.enum:return b!==0;case o.TYPES.message:return b!==null;default:return!0}},m.encode=function(b,I,N){var A,M,$,x,q;if(this.type===null||typeof this.type!="object")throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(b===null||this.repeated&&b.length==0)return I;try{if(this.repeated)if(this.options.packed&&o.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(I.writeVarint32(this.id<<3|o.WIRE_TYPES.LDELIM),I.ensureCapacity(I.offset+=1),M=I.offset,A=0;A<b.length;A++)this.element.encodeValue(this.id,b[A],I);$=I.offset-M,(x=n.calculateVarint32($))>1&&(q=I.slice(M,I.offset),M+=x-1,I.offset=M,I.append(q)),I.writeVarint32($,M-x)}else for(A=0;A<b.length;A++)I.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b[A],I);else this.map?b.forEach(function(Z,le){var Te=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,le)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,Z);I.writeVarint32(this.id<<3|o.WIRE_TYPES.LDELIM),I.writeVarint32(Te),I.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,le,I),I.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,Z,I)},this):this.hasWirePresence(b,N)&&(I.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,b,I))}catch(Z){throw Error("Illegal value for "+this.toString(!0)+": "+b+" ("+Z+")")}return I},m.calculate=function(b,I){var N,A,M;if(b=this.verifyValue(b),this.type===null||typeof this.type!="object")throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(b===null||this.repeated&&b.length==0)return 0;N=0;try{if(this.repeated)if(this.options.packed&&o.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(N+=n.calculateVarint32(this.id<<3|o.WIRE_TYPES.LDELIM),M=0,A=0;A<b.length;A++)M+=this.element.calculateLength(this.id,b[A]);N+=n.calculateVarint32(M),N+=M}else for(A=0;A<b.length;A++)N+=n.calculateVarint32(this.id<<3|this.type.wireType),N+=this.element.calculateLength(this.id,b[A]);else this.map?b.forEach(function($,x){var q=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,x)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,$);N+=n.calculateVarint32(this.id<<3|o.WIRE_TYPES.LDELIM),N+=n.calculateVarint32(q),N+=q},this):this.hasWirePresence(b,I)&&(N+=n.calculateVarint32(this.id<<3|this.type.wireType),N+=this.element.calculateLength(this.id,b))}catch($){throw Error("Illegal value for "+this.toString(!0)+": "+b+" ("+$+")")}return N},m.decode=function(b,I,N){var A,M,$,x,q,Z,le;if(!(!this.map&&b==this.type.wireType||!N&&this.repeated&&this.options.packed&&b==o.WIRE_TYPES.LDELIM||this.map&&b==o.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+b+" ("+this.type.wireType+" expected)");if(b==o.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&o.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!N){for(M=I.readVarint32(),M=I.offset+M,$=[];I.offset<M;)$.push(this.decode(this.type.wireType,I,!0));return $}if(this.map){if(x=f.defaultFieldValue(this.keyType),A=f.defaultFieldValue(this.type),M=I.readVarint32(),I.remaining()<M)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+M+" required but got only "+I.remaining());for((q=I.clone()).limit=q.offset+M,I.offset+=M;q.remaining()>0;)if(b=7&(Z=q.readVarint32()),(le=Z>>>3)==1)x=this.keyElement.decode(q,b,le);else{if(le!==2)throw Error("Unexpected tag in map field key/value submessage");A=this.element.decode(q,b,le)}return[x,A]}return this.element.decode(I,b,this.id)},w.Message.Field=p,(v=function(b,I,N,A,M,$,x){p.call(this,b,I,N,null,A,M,$,x),this.extension}).prototype=Object.create(p.prototype),w.Message.ExtensionField=v,_=function(b,I,N){L.call(this,b,I,N),this.fields=[]},w.Message.OneOf=_,(y=function(b,I,N,A,M){u.call(this,b,I,N,A,M),this.className="Enum",this.object=null}).getName=function(b,I){var N,A,M=Object.keys(b);for(A=0;A<M.length;++A)if(b[N=M[A]]===I)return N;return null},(y.prototype=Object.create(u.prototype)).build=function(b){var I,N,A,M;if(this.object&&!b)return this.object;for(I=new o.Builder.Enum,A=0,M=(N=this.getChildren(y.Value)).length;M>A;++A)I[N[A].name]=N[A].id;return Object.defineProperty&&Object.defineProperty(I,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=I},w.Enum=y,(E=function(b,I,N,A){L.call(this,b,I,N),this.className="Enum.Value",this.id=A}).prototype=Object.create(L.prototype),w.Enum.Value=E,(S=function(b,I,N,A){L.call(this,b,I,N),this.field=A}).prototype=Object.create(L.prototype),w.Extension=S,((T=function(b,I,N,A){u.call(this,b,I,N,A),this.className="Service",this.clazz=null}).prototype=Object.create(u.prototype)).build=function(b){return this.clazz&&!b?this.clazz:this.clazz=function(I,N){var A,M=function(q){I.Builder.Service.call(this),this.rpcImpl=q||function(Z,le,Te){setTimeout(Te.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},$=M.prototype=Object.create(I.Builder.Service.prototype),x=N.getChildren(I.Reflect.Service.RPCMethod);for(A=0;A<x.length;A++)(function(q){$[q.name]=function(Z,le){try{try{Z=q.resolvedRequestType.clazz.decode(n.wrap(Z))}catch(Te){if(!(Te instanceof TypeError))throw Te}if(Z===null||typeof Z!="object")throw Error("Illegal arguments");Z instanceof q.resolvedRequestType.clazz||(Z=new q.resolvedRequestType.clazz(Z)),this.rpcImpl(q.fqn(),Z,function(Te,Ee){if(!Te){try{Ee=q.resolvedResponseType.clazz.decode(Ee)}catch{}return Ee&&Ee instanceof q.resolvedResponseType.clazz?void le(null,Ee):void le(Error("Illegal response type received in service method "+N.name+"#"+q.name))}le(Te)})}catch(Te){setTimeout(le.bind(this,Te),0)}},M[q.name]=function(Z,le,Te){new M(Z)[q.name](le,Te)},Object.defineProperty&&(Object.defineProperty(M[q.name],"$options",{value:q.buildOpt()}),Object.defineProperty($[q.name],"$options",{value:M[q.name].$options}))})(x[A]);return Object.defineProperty&&(Object.defineProperty(M,"$options",{value:N.buildOpt()}),Object.defineProperty($,"$options",{value:M.$options}),Object.defineProperty(M,"$type",{value:N}),Object.defineProperty($,"$type",{value:N})),M}(o,this)},w.Service=T,((R=function(b,I,N,A){L.call(this,b,I,N),this.className="Service.Method",this.options=A||{}}).prototype=Object.create(L.prototype)).buildOpt=d.buildOpt,w.Service.Method=R,(C=function(b,I,N,A,M,$,x,q){R.call(this,b,I,N,q),this.className="Service.RPCMethod",this.requestName=A,this.responseName=M,this.requestStream=$,this.responseStream=x,this.resolvedRequestType=null,this.resolvedResponseType=null}).prototype=Object.create(R.prototype),w.Service.RPCMethod=C,w}(i),i.Builder=function(o,s,a){function u(c){c.messages&&c.messages.forEach(function(l){l.syntax=c.syntax,u(l)}),c.enums&&c.enums.forEach(function(l){l.syntax=c.syntax})}var d=function(c){this.ns=new a.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=c||{}},f=d.prototype;return d.isMessage=function(c){return typeof c.name=="string"&&c.values===void 0&&c.rpc===void 0},d.isMessageField=function(c){return typeof c.rule=="string"&&typeof c.name=="string"&&typeof c.type=="string"&&c.id!==void 0},d.isEnum=function(c){return typeof c.name=="string"&&!(c.values===void 0||!Array.isArray(c.values)||c.values.length===0)},d.isService=function(c){return!(typeof c.name!="string"||typeof c.rpc!="object"||!c.rpc)},d.isExtend=function(c){return typeof c.ref=="string"},f.reset=function(){return this.ptr=this.ns,this},f.define=function(c){if(typeof c!="string"||!s.TYPEREF.test(c))throw Error("illegal namespace: "+c);return c.split(".").forEach(function(l){var h=this.ptr.getChild(l);h===null&&this.ptr.addChild(h=new a.Namespace(this,this.ptr,l)),this.ptr=h},this),this},f.create=function(c){var l,h,p,m,v;if(!c)return this;if(Array.isArray(c)){if(c.length===0)return this;c=c.slice()}else c=[c];for(l=[c];l.length>0;){if(c=l.pop(),!Array.isArray(c))throw Error("not a valid namespace: "+JSON.stringify(c));for(;c.length>0;){if(h=c.shift(),d.isMessage(h)){if(p=new a.Message(this,this.ptr,h.name,h.options,h.isGroup,h.syntax),m={},h.oneofs&&Object.keys(h.oneofs).forEach(function(_){p.addChild(m[_]=new a.Message.OneOf(this,p,_))},this),h.fields&&h.fields.forEach(function(_){if(p.getChild(0|_.id)!==null)throw Error("duplicate or invalid field id in "+p.name+": "+_.id);if(_.options&&typeof _.options!="object")throw Error("illegal field options in "+p.name+"#"+_.name);var y=null;if(typeof _.oneof=="string"&&!(y=m[_.oneof]))throw Error("illegal oneof in "+p.name+"#"+_.name+": "+_.oneof);_=new a.Message.Field(this,p,_.rule,_.keytype,_.type,_.name,_.id,_.options,y,h.syntax),y&&y.fields.push(_),p.addChild(_)},this),v=[],h.enums&&h.enums.forEach(function(_){v.push(_)}),h.messages&&h.messages.forEach(function(_){v.push(_)}),h.services&&h.services.forEach(function(_){v.push(_)}),h.extensions&&(p.extensions=typeof h.extensions[0]=="number"?[h.extensions]:h.extensions),this.ptr.addChild(p),v.length>0){l.push(c),c=v,v=null,this.ptr=p,p=null;continue}v=null}else if(d.isEnum(h))p=new a.Enum(this,this.ptr,h.name,h.options,h.syntax),h.values.forEach(function(_){p.addChild(new a.Enum.Value(this,p,_.name,_.id))},this),this.ptr.addChild(p);else if(d.isService(h))p=new a.Service(this,this.ptr,h.name,h.options),Object.keys(h.rpc).forEach(function(_){var y=h.rpc[_];p.addChild(new a.Service.RPCMethod(this,p,_,y.request,y.response,!!y.request_stream,!!y.response_stream,y.options))},this),this.ptr.addChild(p);else{if(!d.isExtend(h))throw Error("not a valid definition: "+JSON.stringify(h));if(p=this.ptr.resolve(h.ref,!0))h.fields.forEach(function(_){var y,E,S,T;if(p.getChild(0|_.id)!==null)throw Error("duplicate extended field id in "+p.name+": "+_.id);if(p.extensions&&(y=!1,p.extensions.forEach(function(R){_.id>=R[0]&&_.id<=R[1]&&(y=!0)}),!y))throw Error("illegal extended field id in "+p.name+": "+_.id+" (not within valid ranges)");E=_.name,this.options.convertFieldsToCamelCase&&(E=o.Util.toCamelCase(E)),S=new a.Message.ExtensionField(this,p,_.rule,_.type,this.ptr.fqn()+"."+E,_.id,_.options),T=new a.Extension(this,this.ptr,_.name,S),S.extension=T,this.ptr.addChild(T),p.addChild(S)},this);else if(!/\.?google\.protobuf\./.test(h.ref))throw Error("extended message "+h.ref+" is not defined")}h=null,p=null}c=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},f.import=function(c,l){var h,p,m,v,_,y,E,S,T="/";if(typeof l=="string"){if(o.Util.IS_NODE,this.files[l]===!0)return this.reset();this.files[l]=!0}else if(typeof l=="object"){if(h=l.root,o.Util.IS_NODE,(h.indexOf("\\")>=0||l.file.indexOf("\\")>=0)&&(T="\\"),p=h+T+l.file,this.files[p]===!0)return this.reset();this.files[p]=!0}if(c.imports&&c.imports.length>0){for(v=!1,typeof l=="object"?(this.importRoot=l.root,v=!0,m=this.importRoot,l=l.file,(m.indexOf("\\")>=0||l.indexOf("\\")>=0)&&(T="\\")):typeof l=="string"?this.importRoot?m=this.importRoot:l.indexOf("/")>=0?(m=l.replace(/\/[^\/]*$/,""))===""&&(m="/"):l.indexOf("\\")>=0?(m=l.replace(/\\[^\\]*$/,""),T="\\"):m=".":m=null,_=0;_<c.imports.length;_++)if(typeof c.imports[_]=="string"){if(!m)throw Error("cannot determine import root");if((y=c.imports[_])==="google/protobuf/descriptor.proto"||(y=m+T+y,this.files[y]===!0))continue;if(/\.proto$/i.test(y)&&!o.DotProto&&(y=y.replace(/\.proto$/,".json")),(E=o.Util.fetch(y))===null)throw Error("failed to import '"+y+"' in '"+l+"': file not found");/\.json$/i.test(y)?this.import(JSON.parse(E+""),y):this.import(o.DotProto.Parser.parse(E),y)}else l?/\.(\w+)$/.test(l)?this.import(c.imports[_],l.replace(/^(.+)\.(\w+)$/,function(R,C,w){return C+"_import"+_+"."+w})):this.import(c.imports[_],l+"_import"+_):this.import(c.imports[_]);v&&(this.importRoot=null)}return c.package&&this.define(c.package),c.syntax&&u(c),S=this.ptr,c.options&&Object.keys(c.options).forEach(function(R){S.options[R]=c.options[R]}),c.messages&&(this.create(c.messages),this.ptr=S),c.enums&&(this.create(c.enums),this.ptr=S),c.services&&(this.create(c.services),this.ptr=S),c.extends&&this.create(c.extends),this.reset()},f.resolveAll=function(){var c;if(this.ptr==null||typeof this.ptr.type=="object")return this;if(this.ptr instanceof a.Namespace)this.ptr.children.forEach(function(l){this.ptr=l,this.resolveAll()},this);else if(this.ptr instanceof a.Message.Field){if(s.TYPE.test(this.ptr.type))this.ptr.type=o.TYPES[this.ptr.type];else{if(!s.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(c=(this.ptr instanceof a.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=c,c instanceof a.Enum){if(this.ptr.type=o.TYPES.enum,this.ptr.syntax==="proto3"&&c.syntax!=="proto3")throw Error("proto3 message cannot reference proto2 enum")}else{if(!(c instanceof a.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=c.isGroup?o.TYPES.group:o.TYPES.message}}if(this.ptr.map){if(!s.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=o.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof o.Reflect.Service.Method){if(!(this.ptr instanceof o.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((c=this.ptr.parent.resolve(this.ptr.requestName,!0))&&c instanceof o.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=c,!((c=this.ptr.parent.resolve(this.ptr.responseName,!0))&&c instanceof o.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=c}else if(!(this.ptr instanceof o.Reflect.Message.OneOf||this.ptr instanceof o.Reflect.Extension||this.ptr instanceof o.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},f.build=function(c){var l,h,p;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),this.result===null&&(this.result=this.ns.build()),!c)return this.result;for(l=typeof c=="string"?c.split("."):c,h=this.result,p=0;p<l.length;p++){if(!h[l[p]]){h=null;break}h=h[l[p]]}return h},f.lookup=function(c,l){return c?this.ns.resolve(c,l):this.ns},f.toString=function(){return"Builder"},d.Message=function(){},d.Enum=function(){},d.Service=function(){},d}(i,i.Lang,i.Reflect),i.Map=function(o,s){function a(f){var c=0;return{next:function(){return c<f.length?{done:!1,value:f[c++]}:{done:!0}}}}var u=function(f,c){var l,h,p,m;if(!f.map)throw Error("field is not a map");if(this.field=f,this.keyElem=new s.Element(f.keyType,null,!0,f.syntax),this.valueElem=new s.Element(f.type,f.resolvedType,!1,f.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),c)for(l=Object.keys(c),h=0;h<l.length;h++)p=this.keyElem.valueFromString(l[h]),m=this.valueElem.verifyValue(c[l[h]]),this.map[this.keyElem.valueToString(p)]={key:p,value:m}},d=u.prototype;return d.clear=function(){this.map={}},d.delete=function(f){var c=this.keyElem.valueToString(this.keyElem.verifyValue(f)),l=c in this.map;return delete this.map[c],l},d.entries=function(){var f,c,l=[],h=Object.keys(this.map);for(c=0;c<h.length;c++)l.push([(f=this.map[h[c]]).key,f.value]);return a(l)},d.keys=function(){var f,c=[],l=Object.keys(this.map);for(f=0;f<l.length;f++)c.push(this.map[l[f]].key);return a(c)},d.values=function(){var f,c=[],l=Object.keys(this.map);for(f=0;f<l.length;f++)c.push(this.map[l[f]].value);return a(c)},d.forEach=function(f,c){var l,h,p=Object.keys(this.map);for(h=0;h<p.length;h++)f.call(c,(l=this.map[p[h]]).value,l.key,this)},d.set=function(f,c){var l=this.keyElem.verifyValue(f),h=this.valueElem.verifyValue(c);return this.map[this.keyElem.valueToString(l)]={key:l,value:h},this},d.get=function(f){var c=this.keyElem.valueToString(this.keyElem.verifyValue(f));return c in this.map?this.map[c].value:void 0},d.has=function(f){return this.keyElem.valueToString(this.keyElem.verifyValue(f))in this.map},u}(0,i.Reflect),i.loadProto=function(o,s,a){return(typeof s=="string"||s&&typeof s.file=="string"&&typeof s.root=="string")&&(a=s,s=void 0),i.loadJson(i.DotProto.Parser.parse(o),s,a)},i.protoFromString=i.loadProto,i.loadProtoFile=function(o,s,a){if(s&&typeof s=="object"?(a=s,s=null):s&&typeof s=="function"||(s=null),s)return i.Util.fetch(typeof o=="string"?o:o.root+"/"+o.file,function(d){if(d!==null)try{s(null,i.loadProto(d,a,o))}catch(f){s(f)}else s(Error("Failed to fetch file"))});var u=i.Util.fetch(typeof o=="object"?o.root+"/"+o.file:o);return u===null?null:i.loadProto(u,a,o)},i.protoFromFile=i.loadProtoFile,i.newBuilder=function(o){return(o=o||{}).convertFieldsToCamelCase===void 0&&(o.convertFieldsToCamelCase=i.convertFieldsToCamelCase),o.populateAccessors===void 0&&(o.populateAccessors=i.populateAccessors),new i.Builder(o)},i.loadJson=function(o,s,a){return(typeof s=="string"||s&&typeof s.file=="string"&&typeof s.root=="string")&&(a=s,s=null),s&&typeof s=="object"||(s=i.newBuilder()),typeof o=="string"&&(o=JSON.parse(o)),s.import(o,a),s.resolveAll(),s},i.loadJsonFile=function(o,s,a){if(s&&typeof s=="object"?(a=s,s=null):s&&typeof s=="function"||(s=null),s)return i.Util.fetch(typeof o=="string"?o:o.root+"/"+o.file,function(d){if(d!==null)try{s(null,i.loadJson(JSON.parse(d),a,o))}catch(f){s(f)}else s(Error("Failed to fetch file"))});var u=i.Util.fetch(typeof o=="object"?o.root+"/"+o.file:o);return u===null?null:i.loadJson(JSON.parse(u),a,o)},r=gy,i.loadProto(r,void 0,"").build("Modules").probuf}(function(e){function t(c){var l=0;return function(){return l<c.length?c.charCodeAt(l++):null}}function n(){var c=[],l=[];return function(){return arguments.length===0?l.join("")+a.apply(String,c):(c.length+arguments.length>1024&&(l.push(a.apply(String,c)),c.length=0),void Array.prototype.push.apply(c,arguments))}}function r(c,l,h,p,m){var v,_,y=8*m-p-1,E=(1<<y)-1,S=E>>1,T=-7,R=h?m-1:0,C=h?-1:1,w=c[l+R];for(R+=C,v=w&(1<<-T)-1,w>>=-T,T+=y;T>0;v=256*v+c[l+R],R+=C,T-=8);for(_=v&(1<<-T)-1,v>>=-T,T+=p;T>0;_=256*_+c[l+R],R+=C,T-=8);if(v===0)v=1-S;else{if(v===E)return _?NaN:1/0*(w?-1:1);_+=Math.pow(2,p),v-=S}return(w?-1:1)*_*Math.pow(2,v-p)}function i(c,l,h,p,m,v){var _,y,E,S=8*v-m-1,T=(1<<S)-1,R=T>>1,C=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=p?0:v-1,L=p?1:-1,V=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||1/0===l?(y=isNaN(l)?1:0,_=T):(_=Math.floor(Math.log(l)/Math.LN2),l*(E=Math.pow(2,-_))<1&&(_--,E*=2),(l+=_+R>=1?C/E:C*Math.pow(2,1-R))*E>=2&&(_++,E/=2),_+R>=T?(y=0,_=T):_+R>=1?(y=(l*E-1)*Math.pow(2,m),_+=R):(y=l*Math.pow(2,R-1)*Math.pow(2,m),_=0));m>=8;c[h+w]=255&y,w+=L,y/=256,m-=8);for(_=_<<m|y,S+=m;S>0;c[h+w]=255&_,w+=L,_/=256,S-=8);c[h+w-L]|=128*V}var o,s,a,u,d,f=function(c,l,h){if(c===void 0&&(c=f.DEFAULT_CAPACITY),l===void 0&&(l=f.DEFAULT_ENDIAN),h===void 0&&(h=f.DEFAULT_NOASSERT),!h){if((c|=0)<0)throw RangeError("Illegal capacity");l=!!l,h=!!h}this.buffer=c===0?s:new ArrayBuffer(c),this.view=c===0?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=c,this.littleEndian=l,this.noAssert=h};return f.VERSION="5.0.1",f.LITTLE_ENDIAN=!0,f.BIG_ENDIAN=!1,f.DEFAULT_CAPACITY=16,f.DEFAULT_ENDIAN=f.BIG_ENDIAN,f.DEFAULT_NOASSERT=!1,f.Long=e||null,(o=f.prototype).__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),s=new ArrayBuffer(0),a=String.fromCharCode,f.accessor=function(){return Uint8Array},f.allocate=function(c,l,h){return new f(c,l,h)},f.concat=function(c,l,h,p){var m,v,_,y,E,S;for((typeof l=="boolean"||typeof l!="string")&&(p=h,h=l,l=void 0),m=0,_=0,y=c.length;y>_;++_)f.isByteBuffer(c[_])||(c[_]=f.wrap(c[_],l)),(v=c[_].limit-c[_].offset)>0&&(m+=v);if(m===0)return new f(0,h,p);for(S=new f(m,h,p),_=0;y>_;)(v=(E=c[_++]).limit-E.offset)<=0||(S.view.set(E.view.subarray(E.offset,E.limit),S.offset),S.offset+=v);return S.limit=S.offset,S.offset=0,S},f.isByteBuffer=function(c){return(c&&c.__isByteBuffer__)===!0},f.type=function(){return ArrayBuffer},f.wrap=function(c,l,h,p){var m,v;if(typeof l!="string"&&(p=h,h=l,l=void 0),typeof c=="string")switch(l===void 0&&(l="utf8"),l){case"base64":return f.fromBase64(c,h);case"hex":return f.fromHex(c,h);case"binary":return f.fromBinary(c,h);case"utf8":return f.fromUTF8(c,h);case"debug":return f.fromDebug(c,h);default:throw Error("Unsupported encoding: "+l)}if(c===null||typeof c!="object")throw TypeError("Illegal buffer");if(f.isByteBuffer(c))return(m=o.clone.call(c)).markedOffset=-1,m;if(c instanceof Uint8Array)m=new f(0,h,p),c.length>0&&(m.buffer=c.buffer,m.offset=c.byteOffset,m.limit=c.byteOffset+c.byteLength,m.view=new Uint8Array(c.buffer));else if(c instanceof ArrayBuffer)m=new f(0,h,p),c.byteLength>0&&(m.buffer=c,m.offset=0,m.limit=c.byteLength,m.view=c.byteLength>0?new Uint8Array(c):null);else{if(Object.prototype.toString.call(c)!=="[object Array]")throw TypeError("Illegal buffer");for((m=new f(c.length,h,p)).limit=c.length,v=0;v<c.length;++v)m.view[v]=c[v]}return m},o.writeBitSet=function(c,l){var h,p,m,v,_,y,E=l===void 0;if(E&&(l=this.offset),!this.noAssert){if(!(c instanceof Array))throw TypeError("Illegal BitSet: Not an array");if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}for(p=l,v=(m=c.length)>>3,_=0,l+=this.writeVarint32(m,l);v--;)h=1&!!c[_++]|(1&!!c[_++])<<1|(1&!!c[_++])<<2|(1&!!c[_++])<<3|(1&!!c[_++])<<4|(1&!!c[_++])<<5|(1&!!c[_++])<<6|(1&!!c[_++])<<7,this.writeByte(h,l++);if(m>_){for(y=0,h=0;m>_;)h|=(1&!!c[_++])<<y++;this.writeByte(h,l++)}return E?(this.offset=l,this):l-p},o.readBitSet=function(c){var l,h,p,m,v,_,y,E=c===void 0;for(E&&(c=this.offset),m=(p=(h=this.readVarint32(c)).value)>>3,v=0,_=[],c+=h.length;m--;)l=this.readByte(c++),_[v++]=!!(1&l),_[v++]=!!(2&l),_[v++]=!!(4&l),_[v++]=!!(8&l),_[v++]=!!(16&l),_[v++]=!!(32&l),_[v++]=!!(64&l),_[v++]=!!(128&l);if(p>v)for(y=0,l=this.readByte(c++);p>v;)_[v++]=!!(1&l>>y++);return E&&(this.offset=c),_},o.readBytes=function(c,l){var h,p=l===void 0;if(p&&(l=this.offset),!this.noAssert){if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+c>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+"+c+") <= "+this.buffer.byteLength)}return h=this.slice(l,l+c),p&&(this.offset+=c),h},o.writeBytes=o.append,o.writeInt8=function(c,l){var h,p=l===void 0;if(p&&(l=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal value: "+c+" (not an integer)");if(c|=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return(l+=1)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=1,this.view[l]=c,p&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(c){var l,h=c===void 0;if(h&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+1) <= "+this.buffer.byteLength)}return(128&(l=this.view[c]))==128&&(l=-(255-l+1)),h&&(this.offset+=1),l},o.readByte=o.readInt8,o.writeUint8=function(c,l){var h,p=l===void 0;if(p&&(l=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal value: "+c+" (not an integer)");if(c>>>=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return(l+=1)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=1,this.view[l]=c,p&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(c){var l,h=c===void 0;if(h&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+1) <= "+this.buffer.byteLength)}return l=this.view[c],h&&(this.offset+=1),l},o.readUInt8=o.readUint8,o.writeInt16=function(c,l){var h,p=l===void 0;if(p&&(l=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal value: "+c+" (not an integer)");if(c|=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return(l+=2)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=2,this.littleEndian?(this.view[l+1]=(65280&c)>>>8,this.view[l]=255&c):(this.view[l]=(65280&c)>>>8,this.view[l+1]=255&c),p&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(c){var l,h=c===void 0;if(h&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+2) <= "+this.buffer.byteLength)}return l=0,this.littleEndian?(l=this.view[c],l|=this.view[c+1]<<8):(l=this.view[c]<<8,l|=this.view[c+1]),(32768&l)==32768&&(l=-(65535-l+1)),h&&(this.offset+=2),l},o.readShort=o.readInt16,o.writeUint16=function(c,l){var h,p=l===void 0;if(p&&(l=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal value: "+c+" (not an integer)");if(c>>>=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return(l+=2)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=2,this.littleEndian?(this.view[l+1]=(65280&c)>>>8,this.view[l]=255&c):(this.view[l]=(65280&c)>>>8,this.view[l+1]=255&c),p&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(c){var l,h=c===void 0;if(h&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+2) <= "+this.buffer.byteLength)}return l=0,this.littleEndian?(l=this.view[c],l|=this.view[c+1]<<8):(l=this.view[c]<<8,l|=this.view[c+1]),h&&(this.offset+=2),l},o.readUInt16=o.readUint16,o.writeInt32=function(c,l){var h,p=l===void 0;if(p&&(l=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal value: "+c+" (not an integer)");if(c|=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return(l+=4)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=4,this.littleEndian?(this.view[l+3]=255&c>>>24,this.view[l+2]=255&c>>>16,this.view[l+1]=255&c>>>8,this.view[l]=255&c):(this.view[l]=255&c>>>24,this.view[l+1]=255&c>>>16,this.view[l+2]=255&c>>>8,this.view[l+3]=255&c),p&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(c){var l,h=c===void 0;if(h&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+4) <= "+this.buffer.byteLength)}return l=0,this.littleEndian?(l=this.view[c+2]<<16,l|=this.view[c+1]<<8,l|=this.view[c],l+=this.view[c+3]<<24>>>0):(l=this.view[c+1]<<16,l|=this.view[c+2]<<8,l|=this.view[c+3],l+=this.view[c]<<24>>>0),l|=0,h&&(this.offset+=4),l},o.readInt=o.readInt32,o.writeUint32=function(c,l){var h,p=l===void 0;if(p&&(l=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal value: "+c+" (not an integer)");if(c>>>=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return(l+=4)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=4,this.littleEndian?(this.view[l+3]=255&c>>>24,this.view[l+2]=255&c>>>16,this.view[l+1]=255&c>>>8,this.view[l]=255&c):(this.view[l]=255&c>>>24,this.view[l+1]=255&c>>>16,this.view[l+2]=255&c>>>8,this.view[l+3]=255&c),p&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(c){var l,h=c===void 0;if(h&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+4) <= "+this.buffer.byteLength)}return l=0,this.littleEndian?(l=this.view[c+2]<<16,l|=this.view[c+1]<<8,l|=this.view[c],l+=this.view[c+3]<<24>>>0):(l=this.view[c+1]<<16,l|=this.view[c+2]<<8,l|=this.view[c+3],l+=this.view[c]<<24>>>0),h&&(this.offset+=4),l},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(c,l){var h,p,m,v=l===void 0;if(v&&(l=this.offset),!this.noAssert){if(typeof c=="number")c=e.fromNumber(c);else if(typeof c=="string")c=e.fromString(c);else if(!(c&&c instanceof e))throw TypeError("Illegal value: "+c+" (not an integer or Long)");if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return typeof c=="number"?c=e.fromNumber(c):typeof c=="string"&&(c=e.fromString(c)),(l+=8)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=8,p=c.low,m=c.high,this.littleEndian?(this.view[l+3]=255&p>>>24,this.view[l+2]=255&p>>>16,this.view[l+1]=255&p>>>8,this.view[l]=255&p,l+=4,this.view[l+3]=255&m>>>24,this.view[l+2]=255&m>>>16,this.view[l+1]=255&m>>>8,this.view[l]=255&m):(this.view[l]=255&m>>>24,this.view[l+1]=255&m>>>16,this.view[l+2]=255&m>>>8,this.view[l+3]=255&m,l+=4,this.view[l]=255&p>>>24,this.view[l+1]=255&p>>>16,this.view[l+2]=255&p>>>8,this.view[l+3]=255&p),v&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(c){var l,h,p,m=c===void 0;if(m&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+8) <= "+this.buffer.byteLength)}return l=0,h=0,this.littleEndian?(l=this.view[c+2]<<16,l|=this.view[c+1]<<8,l|=this.view[c],l+=this.view[c+3]<<24>>>0,c+=4,h=this.view[c+2]<<16,h|=this.view[c+1]<<8,h|=this.view[c],h+=this.view[c+3]<<24>>>0):(h=this.view[c+1]<<16,h|=this.view[c+2]<<8,h|=this.view[c+3],h+=this.view[c]<<24>>>0,c+=4,l=this.view[c+1]<<16,l|=this.view[c+2]<<8,l|=this.view[c+3],l+=this.view[c]<<24>>>0),p=new e(l,h,!1),m&&(this.offset+=8),p},o.readLong=o.readInt64,o.writeUint64=function(c,l){var h,p,m,v=l===void 0;if(v&&(l=this.offset),!this.noAssert){if(typeof c=="number")c=e.fromNumber(c);else if(typeof c=="string")c=e.fromString(c);else if(!(c&&c instanceof e))throw TypeError("Illegal value: "+c+" (not an integer or Long)");if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return typeof c=="number"?c=e.fromNumber(c):typeof c=="string"&&(c=e.fromString(c)),(l+=8)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=8,p=c.low,m=c.high,this.littleEndian?(this.view[l+3]=255&p>>>24,this.view[l+2]=255&p>>>16,this.view[l+1]=255&p>>>8,this.view[l]=255&p,l+=4,this.view[l+3]=255&m>>>24,this.view[l+2]=255&m>>>16,this.view[l+1]=255&m>>>8,this.view[l]=255&m):(this.view[l]=255&m>>>24,this.view[l+1]=255&m>>>16,this.view[l+2]=255&m>>>8,this.view[l+3]=255&m,l+=4,this.view[l]=255&p>>>24,this.view[l+1]=255&p>>>16,this.view[l+2]=255&p>>>8,this.view[l+3]=255&p),v&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(c){var l,h,p,m=c===void 0;if(m&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+8) <= "+this.buffer.byteLength)}return l=0,h=0,this.littleEndian?(l=this.view[c+2]<<16,l|=this.view[c+1]<<8,l|=this.view[c],l+=this.view[c+3]<<24>>>0,c+=4,h=this.view[c+2]<<16,h|=this.view[c+1]<<8,h|=this.view[c],h+=this.view[c+3]<<24>>>0):(h=this.view[c+1]<<16,h|=this.view[c+2]<<8,h|=this.view[c+3],h+=this.view[c]<<24>>>0,c+=4,l=this.view[c+1]<<16,l|=this.view[c+2]<<8,l|=this.view[c+3],l+=this.view[c]<<24>>>0),p=new e(l,h,!0),m&&(this.offset+=8),p},o.readUInt64=o.readUint64),o.writeFloat32=function(c,l){var h,p=l===void 0;if(p&&(l=this.offset),!this.noAssert){if(typeof c!="number")throw TypeError("Illegal value: "+c+" (not a number)");if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return(l+=4)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=4,i(this.view,c,l,this.littleEndian,23,4),p&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(c){var l,h=c===void 0;if(h&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+4) <= "+this.buffer.byteLength)}return l=r(this.view,c,this.littleEndian,23,4),h&&(this.offset+=4),l},o.readFloat=o.readFloat32,o.writeFloat64=function(c,l){var h,p=l===void 0;if(p&&(l=this.offset),!this.noAssert){if(typeof c!="number")throw TypeError("Illegal value: "+c+" (not a number)");if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return(l+=8)>(h=this.buffer.byteLength)&&this.resize((h*=2)>l?h:l),l-=8,i(this.view,c,l,this.littleEndian,52,8),p&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(c){var l,h=c===void 0;if(h&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+8) <= "+this.buffer.byteLength)}return l=r(this.view,c,this.littleEndian,52,8),h&&(this.offset+=8),l},o.readDouble=o.readFloat64,f.MAX_VARINT32_BYTES=5,f.calculateVarint32=function(c){return(c>>>=0)<128?1:c<16384?2:1<<21>c?3:1<<28>c?4:5},f.zigZagEncode32=function(c){return((c|=0)<<1^c>>31)>>>0},f.zigZagDecode32=function(c){return 0|c>>>1^-(1&c)},o.writeVarint32=function(c,l){var h,p,m,v=l===void 0;if(v&&(l=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal value: "+c+" (not an integer)");if(c|=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}for((l+=p=f.calculateVarint32(c))>(m=this.buffer.byteLength)&&this.resize((m*=2)>l?m:l),l-=p,c>>>=0;c>=128;)h=128|127&c,this.view[l++]=h,c>>>=7;return this.view[l++]=c,v?(this.offset=l,this):p},o.writeVarint32ZigZag=function(c,l){return this.writeVarint32(f.zigZagEncode32(c),l)},o.readVarint32=function(c){var l,h,p,m,v=c===void 0;if(v&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+1) <= "+this.buffer.byteLength)}h=0,p=0;do{if(!this.noAssert&&c>this.limit)throw(m=Error("Truncated")).truncated=!0,m;l=this.view[c++],h<5&&(p|=(127&l)<<7*h),++h}while((128&l)!=0);return p|=0,v?(this.offset=c,p):{value:p,length:h}},o.readVarint32ZigZag=function(c){var l=this.readVarint32(c);return typeof l=="object"?l.value=f.zigZagDecode32(l.value):l=f.zigZagDecode32(l),l},e&&(f.MAX_VARINT64_BYTES=10,f.calculateVarint64=function(c){typeof c=="number"?c=e.fromNumber(c):typeof c=="string"&&(c=e.fromString(c));var l=c.toInt()>>>0,h=c.shiftRightUnsigned(28).toInt()>>>0,p=c.shiftRightUnsigned(56).toInt()>>>0;return p==0?h==0?l<16384?l<128?1:2:1<<21>l?3:4:h<16384?h<128?5:6:1<<21>h?7:8:p<128?9:10},f.zigZagEncode64=function(c){return typeof c=="number"?c=e.fromNumber(c,!1):typeof c=="string"?c=e.fromString(c,!1):c.unsigned!==!1&&(c=c.toSigned()),c.shiftLeft(1).xor(c.shiftRight(63)).toUnsigned()},f.zigZagDecode64=function(c){return typeof c=="number"?c=e.fromNumber(c,!1):typeof c=="string"?c=e.fromString(c,!1):c.unsigned!==!1&&(c=c.toSigned()),c.shiftRightUnsigned(1).xor(c.and(e.ONE).toSigned().negate()).toSigned()},o.writeVarint64=function(c,l){var h,p,m,v,_,y=l===void 0;if(y&&(l=this.offset),!this.noAssert){if(typeof c=="number")c=e.fromNumber(c);else if(typeof c=="string")c=e.fromString(c);else if(!(c&&c instanceof e))throw TypeError("Illegal value: "+c+" (not an integer or Long)");if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}switch(typeof c=="number"?c=e.fromNumber(c,!1):typeof c=="string"?c=e.fromString(c,!1):c.unsigned!==!1&&(c=c.toSigned()),h=f.calculateVarint64(c),p=c.toInt()>>>0,m=c.shiftRightUnsigned(28).toInt()>>>0,v=c.shiftRightUnsigned(56).toInt()>>>0,(l+=h)>(_=this.buffer.byteLength)&&this.resize((_*=2)>l?_:l),l-=h,h){case 10:this.view[l+9]=1&v>>>7;case 9:this.view[l+8]=h!==9?128|v:127&v;case 8:this.view[l+7]=h!==8?128|m>>>21:127&m>>>21;case 7:this.view[l+6]=h!==7?128|m>>>14:127&m>>>14;case 6:this.view[l+5]=h!==6?128|m>>>7:127&m>>>7;case 5:this.view[l+4]=h!==5?128|m:127&m;case 4:this.view[l+3]=h!==4?128|p>>>21:127&p>>>21;case 3:this.view[l+2]=h!==3?128|p>>>14:127&p>>>14;case 2:this.view[l+1]=h!==2?128|p>>>7:127&p>>>7;case 1:this.view[l]=h!==1?128|p:127&p}return y?(this.offset+=h,this):h},o.writeVarint64ZigZag=function(c,l){return this.writeVarint64(f.zigZagEncode64(c),l)},o.readVarint64=function(c){var l,h,p,m,v,_,y=c===void 0;if(y&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+1) <= "+this.buffer.byteLength)}if(l=c,h=0,p=0,m=0,v=0,h=127&(v=this.view[c++]),128&v&&(h|=(127&(v=this.view[c++]))<<7,(128&v||this.noAssert&&v===void 0)&&(h|=(127&(v=this.view[c++]))<<14,(128&v||this.noAssert&&v===void 0)&&(h|=(127&(v=this.view[c++]))<<21,(128&v||this.noAssert&&v===void 0)&&(p=127&(v=this.view[c++]),(128&v||this.noAssert&&v===void 0)&&(p|=(127&(v=this.view[c++]))<<7,(128&v||this.noAssert&&v===void 0)&&(p|=(127&(v=this.view[c++]))<<14,(128&v||this.noAssert&&v===void 0)&&(p|=(127&(v=this.view[c++]))<<21,(128&v||this.noAssert&&v===void 0)&&(m=127&(v=this.view[c++]),(128&v||this.noAssert&&v===void 0)&&(m|=(127&(v=this.view[c++]))<<7,128&v||this.noAssert&&v===void 0))))))))))throw Error("Buffer overrun");return _=e.fromBits(h|p<<28,p>>>4|m<<24,!1),y?(this.offset=c,_):{value:_,length:c-l}},o.readVarint64ZigZag=function(c){var l=this.readVarint64(c);return l&&l.value instanceof e?l.value=f.zigZagDecode64(l.value):l=f.zigZagDecode64(l),l}),o.writeCString=function(c,l){var h,p,m,v=l===void 0;if(v&&(l=this.offset),p=c.length,!this.noAssert){if(typeof c!="string")throw TypeError("Illegal str: Not a string");for(h=0;p>h;++h)if(c.charCodeAt(h)===0)throw RangeError("Illegal str: Contains NULL-characters");if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return p=d.calculateUTF16asUTF8(t(c))[1],l+=p+1,m=this.buffer.byteLength,l>m&&this.resize((m*=2)>l?m:l),l-=p+1,d.encodeUTF16toUTF8(t(c),function(_){this.view[l++]=_}.bind(this)),this.view[l++]=0,v?(this.offset=l,this):p},o.readCString=function(c){var l,h,p,m=c===void 0;if(m&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+1) <= "+this.buffer.byteLength)}return l=c,p=-1,d.decodeUTF8toUTF16(function(){if(p===0)return null;if(c>=this.limit)throw RangeError("Illegal range: Truncated data, "+c+" < "+this.limit);return(p=this.view[c++])===0?null:p}.bind(this),h=n(),!0),m?(this.offset=c,h()):{string:h(),length:c-l}},o.writeIString=function(c,l){var h,p,m,v=l===void 0;if(v&&(l=this.offset),!this.noAssert){if(typeof c!="string")throw TypeError("Illegal str: Not a string");if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}if(p=l,h=d.calculateUTF16asUTF8(t(c),this.noAssert)[1],l+=4+h,m=this.buffer.byteLength,l>m&&this.resize((m*=2)>l?m:l),l-=4+h,this.littleEndian?(this.view[l+3]=255&h>>>24,this.view[l+2]=255&h>>>16,this.view[l+1]=255&h>>>8,this.view[l]=255&h):(this.view[l]=255&h>>>24,this.view[l+1]=255&h>>>16,this.view[l+2]=255&h>>>8,this.view[l+3]=255&h),l+=4,d.encodeUTF16toUTF8(t(c),function(_){this.view[l++]=_}.bind(this)),l!==p+4+h)throw RangeError("Illegal range: Truncated data, "+l+" == "+(l+4+h));return v?(this.offset=l,this):l-p},o.readIString=function(c){var l,h,p,m=c===void 0;if(m&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+4) <= "+this.buffer.byteLength)}return l=c,h=this.readUint32(c),p=this.readUTF8String(h,f.METRICS_BYTES,c+=4),c+=p.length,m?(this.offset=c,p.string):{string:p.string,length:c-l}},f.METRICS_CHARS="c",f.METRICS_BYTES="b",o.writeUTF8String=function(c,l){var h,p,m,v=l===void 0;if(v&&(l=this.offset),!this.noAssert){if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}return p=l,h=d.calculateUTF16asUTF8(t(c))[1],l+=h,m=this.buffer.byteLength,l>m&&this.resize((m*=2)>l?m:l),l-=h,d.encodeUTF16toUTF8(t(c),function(_){this.view[l++]=_}.bind(this)),v?(this.offset=l,this):l-p},o.writeString=o.writeUTF8String,f.calculateUTF8Chars=function(c){return d.calculateUTF16asUTF8(t(c))[0]},f.calculateUTF8Bytes=function(c){return d.calculateUTF16asUTF8(t(c))[1]},f.calculateString=f.calculateUTF8Bytes,o.readUTF8String=function(c,l,h){var p,m,v,_,y;if(typeof l=="number"&&(h=l,l=void 0),(p=h===void 0)&&(h=this.offset),l===void 0&&(l=f.METRICS_CHARS),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal length: "+c+" (not an integer)");if(c|=0,typeof h!="number"||h%1!=0)throw TypeError("Illegal offset: "+h+" (not an integer)");if((h>>>=0)<0||h+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+h+" (+0) <= "+this.buffer.byteLength)}if(v=0,_=h,l===f.METRICS_CHARS){if(m=n(),d.decodeUTF8(function(){return c>v&&h<this.limit?this.view[h++]:null}.bind(this),function(E){++v,d.UTF8toUTF16(E,m)}),v!==c)throw RangeError("Illegal range: Truncated data, "+v+" == "+c);return p?(this.offset=h,m()):{string:m(),length:h-_}}if(l===f.METRICS_BYTES){if(!this.noAssert){if(typeof h!="number"||h%1!=0)throw TypeError("Illegal offset: "+h+" (not an integer)");if((h>>>=0)<0||h+c>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+h+" (+"+c+") <= "+this.buffer.byteLength)}if(y=h+c,d.decodeUTF8toUTF16(function(){return y>h?this.view[h++]:null}.bind(this),m=n(),this.noAssert),h!==y)throw RangeError("Illegal range: Truncated data, "+h+" == "+y);return p?(this.offset=h,m()):{string:m(),length:h-_}}throw TypeError("Unsupported metrics: "+l)},o.readString=o.readUTF8String,o.writeVString=function(c,l){var h,p,m,v,_=l===void 0;if(_&&(l=this.offset),!this.noAssert){if(typeof c!="string")throw TypeError("Illegal str: Not a string");if(typeof l!="number"||l%1!=0)throw TypeError("Illegal offset: "+l+" (not an integer)");if((l>>>=0)<0||l+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+l+" (+0) <= "+this.buffer.byteLength)}if(m=l,h=d.calculateUTF16asUTF8(t(c),this.noAssert)[1],p=f.calculateVarint32(h),l+=p+h,v=this.buffer.byteLength,l>v&&this.resize((v*=2)>l?v:l),l-=p+h,l+=this.writeVarint32(h,l),d.encodeUTF16toUTF8(t(c),function(y){this.view[l++]=y}.bind(this)),l!==m+h+p)throw RangeError("Illegal range: Truncated data, "+l+" == "+(l+h+p));return _?(this.offset=l,this):l-m},o.readVString=function(c){var l,h,p,m=c===void 0;if(m&&(c=this.offset),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+1) <= "+this.buffer.byteLength)}return l=c,h=this.readVarint32(c),p=this.readUTF8String(h.value,f.METRICS_BYTES,c+=h.length),c+=p.length,m?(this.offset=c,p.string):{string:p.string,length:c-l}},o.append=function(c,l,h){var p,m,v;if((typeof l=="number"||typeof l!="string")&&(h=l,l=void 0),(p=h===void 0)&&(h=this.offset),!this.noAssert){if(typeof h!="number"||h%1!=0)throw TypeError("Illegal offset: "+h+" (not an integer)");if((h>>>=0)<0||h+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+h+" (+0) <= "+this.buffer.byteLength)}return c instanceof f||(c=f.wrap(c,l)),(m=c.limit-c.offset)<=0||((h+=m)>(v=this.buffer.byteLength)&&this.resize((v*=2)>h?v:h),h-=m,this.view.set(c.view.subarray(c.offset,c.limit),h),c.offset+=m,p&&(this.offset+=m)),this},o.appendTo=function(c,l){return c.append(this,l),this},o.assert=function(c){return this.noAssert=!c,this},o.capacity=function(){return this.buffer.byteLength},o.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},o.clone=function(c){var l=new f(0,this.littleEndian,this.noAssert);return c?(l.buffer=new ArrayBuffer(this.buffer.byteLength),l.view=new Uint8Array(l.buffer)):(l.buffer=this.buffer,l.view=this.view),l.offset=this.offset,l.markedOffset=this.markedOffset,l.limit=this.limit,l},o.compact=function(c,l){var h,p,m;if(c===void 0&&(c=this.offset),l===void 0&&(l=this.limit),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal begin: Not an integer");if(c>>>=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal end: Not an integer");if(l>>>=0,c<0||c>l||l>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+c+" <= "+l+" <= "+this.buffer.byteLength)}return c===0&&l===this.buffer.byteLength?this:(h=l-c)==0?(this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=c),this.offset=0,this.limit=0,this):(p=new ArrayBuffer(h),(m=new Uint8Array(p)).set(this.view.subarray(c,l)),this.buffer=p,this.view=m,this.markedOffset>=0&&(this.markedOffset-=c),this.offset=0,this.limit=h,this)},o.copy=function(c,l){if(c===void 0&&(c=this.offset),l===void 0&&(l=this.limit),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal begin: Not an integer");if(c>>>=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal end: Not an integer");if(l>>>=0,c<0||c>l||l>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+c+" <= "+l+" <= "+this.buffer.byteLength)}if(c===l)return new f(0,this.littleEndian,this.noAssert);var h=l-c,p=new f(h,this.littleEndian,this.noAssert);return p.offset=0,p.limit=h,p.markedOffset>=0&&(p.markedOffset-=c),this.copyTo(p,0,c,l),p},o.copyTo=function(c,l,h,p){var m,v,_;if(!this.noAssert&&!f.isByteBuffer(c))throw TypeError("Illegal target: Not a ByteBuffer");if(l=(v=l===void 0)?c.offset:0|l,h=(m=h===void 0)?this.offset:0|h,p=p===void 0?this.limit:0|p,l<0||l>c.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+l+" <= "+c.buffer.byteLength);if(h<0||p>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+h+" <= "+this.buffer.byteLength);return(_=p-h)==0?c:(c.ensureCapacity(l+_),c.view.set(this.view.subarray(h,p),l),m&&(this.offset+=_),v&&(c.offset+=_),this)},o.ensureCapacity=function(c){var l=this.buffer.byteLength;return c>l?this.resize((l*=2)>c?l:c):this},o.fill=function(c,l,h){var p=l===void 0;if(p&&(l=this.offset),typeof c=="string"&&c.length>0&&(c=c.charCodeAt(0)),l===void 0&&(l=this.offset),h===void 0&&(h=this.limit),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal value: "+c+" (not an integer)");if(c|=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal begin: Not an integer");if(l>>>=0,typeof h!="number"||h%1!=0)throw TypeError("Illegal end: Not an integer");if(h>>>=0,l<0||l>h||h>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+l+" <= "+h+" <= "+this.buffer.byteLength)}if(l>=h)return this;for(;h>l;)this.view[l++]=c;return p&&(this.offset=l),this},o.flip=function(){return this.limit=this.offset,this.offset=0,this},o.mark=function(c){if(c=c===void 0?this.offset:c,!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal offset: "+c+" (not an integer)");if((c>>>=0)<0||c+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+c+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=c,this},o.order=function(c){if(!this.noAssert&&typeof c!="boolean")throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!c,this},o.LE=function(c){return this.littleEndian=c===void 0||!!c,this},o.BE=function(c){return this.littleEndian=c!==void 0&&!c,this},o.prepend=function(c,l,h){var p,m,v,_,y;if((typeof l=="number"||typeof l!="string")&&(h=l,l=void 0),(p=h===void 0)&&(h=this.offset),!this.noAssert){if(typeof h!="number"||h%1!=0)throw TypeError("Illegal offset: "+h+" (not an integer)");if((h>>>=0)<0||h+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+h+" (+0) <= "+this.buffer.byteLength)}return c instanceof f||(c=f.wrap(c,l)),(m=c.limit-c.offset)<=0||((v=m-h)>0?(_=new ArrayBuffer(this.buffer.byteLength+v),(y=new Uint8Array(_)).set(this.view.subarray(h,this.buffer.byteLength),m),this.buffer=_,this.view=y,this.offset+=v,this.markedOffset>=0&&(this.markedOffset+=v),this.limit+=v,h+=v):new Uint8Array(this.buffer),this.view.set(c.view.subarray(c.offset,c.limit),h-m),c.offset=c.limit,p&&(this.offset-=m)),this},o.prependTo=function(c,l){return c.prepend(this,l),this},o.printDebug=function(c){typeof c!="function"&&(c=console.log.bind(console)),c(this.toString()+`
  809. -------------------------------------------------------------------
  810. `+this.toDebug(!0))},o.remaining=function(){return this.limit-this.offset},o.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},o.resize=function(c){var l,h;if(!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal capacity: "+c+" (not an integer)");if((c|=0)<0)throw RangeError("Illegal capacity: 0 <= "+c)}return this.buffer.byteLength<c&&(l=new ArrayBuffer(c),(h=new Uint8Array(l)).set(this.view),this.buffer=l,this.view=h),this},o.reverse=function(c,l){if(c===void 0&&(c=this.offset),l===void 0&&(l=this.limit),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal begin: Not an integer");if(c>>>=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal end: Not an integer");if(l>>>=0,c<0||c>l||l>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+c+" <= "+l+" <= "+this.buffer.byteLength)}return c===l||Array.prototype.reverse.call(this.view.subarray(c,l)),this},o.skip=function(c){if(!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal length: "+c+" (not an integer)");c|=0}var l=this.offset+c;if(!this.noAssert&&(l<0||l>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+c+" <= "+this.buffer.byteLength);return this.offset=l,this},o.slice=function(c,l){if(c===void 0&&(c=this.offset),l===void 0&&(l=this.limit),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal begin: Not an integer");if(c>>>=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal end: Not an integer");if(l>>>=0,c<0||c>l||l>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+c+" <= "+l+" <= "+this.buffer.byteLength)}var h=this.clone();return h.offset=c,h.limit=l,h},o.toBuffer=function(c){var l,h=this.offset,p=this.limit;if(!this.noAssert){if(typeof h!="number"||h%1!=0)throw TypeError("Illegal offset: Not an integer");if(h>>>=0,typeof p!="number"||p%1!=0)throw TypeError("Illegal limit: Not an integer");if(p>>>=0,h<0||h>p||p>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+h+" <= "+p+" <= "+this.buffer.byteLength)}return c||h!==0||p!==this.buffer.byteLength?h===p?s:(l=new ArrayBuffer(p-h),new Uint8Array(l).set(new Uint8Array(this.buffer).subarray(h,p),0),l):this.buffer},o.toArrayBuffer=o.toBuffer,o.toString=function(c,l,h){if(c===void 0)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch(typeof c=="number"&&(h=l=c="utf8"),c){case"utf8":return this.toUTF8(l,h);case"base64":return this.toBase64(l,h);case"hex":return this.toHex(l,h);case"binary":return this.toBinary(l,h);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+c)}},u=function(){var c,l,h={},p=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],m=[];for(c=0,l=p.length;l>c;++c)m[p[c]]=c;return h.encode=function(v,_){for(var y,E;(y=v())!==null;)_(p[63&y>>2]),E=(3&y)<<4,(y=v())!==null?(_(p[63&((E|=15&y>>4)|15&y>>4)]),E=(15&y)<<2,(y=v())!==null?(_(p[63&(E|3&y>>6)]),_(p[63&y])):(_(p[63&E]),_(61))):(_(p[63&E]),_(61),_(61))},h.decode=function(v,_){function y(R){throw Error("Illegal character code: "+R)}for(var E,S,T;(E=v())!==null;)if((S=m[E])===void 0&&y(E),(E=v())!==null&&((T=m[E])===void 0&&y(E),_(S<<2>>>0|(48&T)>>4),(E=v())!==null)){if((S=m[E])===void 0){if(E===61)break;y(E)}if(_((15&T)<<4>>>0|(60&S)>>2),(E=v())!==null){if((T=m[E])===void 0){if(E===61)break;y(E)}_((3&S)<<6>>>0|T)}}},h.test=function(v){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(v)},h}(),o.toBase64=function(c,l){if(c===void 0&&(c=this.offset),l===void 0&&(l=this.limit),l|=0,(c|=0)<0||l>this.capacity||c>l)throw RangeError("begin, end");var h;return u.encode(function(){return l>c?this.view[c++]:null}.bind(this),h=n()),h()},f.fromBase64=function(c,l){if(typeof c!="string")throw TypeError("str");var h=new f(c.length/4*3,l),p=0;return u.decode(t(c),function(m){h.view[p++]=m}),h.limit=p,h},f.btoa=function(c){return f.fromBinary(c).toBase64()},f.atob=function(c){return f.fromBase64(c).toBinary()},o.toBinary=function(c,l){if(c===void 0&&(c=this.offset),l===void 0&&(l=this.limit),l|=0,(c|=0)<0||l>this.capacity()||c>l)throw RangeError("begin, end");if(c===l)return"";for(var h=[],p=[];l>c;)h.push(this.view[c++]),h.length>=1024&&(p.push(String.fromCharCode.apply(String,h)),h=[]);return p.join("")+String.fromCharCode.apply(String,h)},f.fromBinary=function(c,l){if(typeof c!="string")throw TypeError("str");for(var h,p=0,m=c.length,v=new f(m,l);m>p;){if((h=c.charCodeAt(p))>255)throw RangeError("illegal char code: "+h);v.view[p++]=h}return v.limit=m,v},o.toDebug=function(c){for(var l,h=-1,p=this.buffer.byteLength,m="",v="",_="";p>h;){if(h!==-1&&(m+=(l=this.view[h])<16?"0"+l.toString(16).toUpperCase():l.toString(16).toUpperCase(),c&&(v+=l>32&&l<127?String.fromCharCode(l):".")),++h,c&&h>0&&h%16==0&&h!==p){for(;m.length<51;)m+=" ";_+=m+v+`
  811. `,m=v=""}m+=h===this.offset&&h===this.limit?h===this.markedOffset?"!":"|":h===this.offset?h===this.markedOffset?"[":"<":h===this.limit?h===this.markedOffset?"]":">":h===this.markedOffset?"'":c||h!==0&&h!==p?" ":""}if(c&&m!==" "){for(;m.length<51;)m+=" ";_+=m+v+`
  812. `}return c?_:m},f.fromDebug=function(c,l,h){for(var p,m,v=c.length,_=new f(0|(v+1)/3,l,h),y=0,E=0,S=!1,T=!1,R=!1,C=!1,w=!1;v>y;){switch(p=c.charAt(y++)){case"!":if(!h){if(T||R||C){w=!0;break}T=R=C=!0}_.offset=_.markedOffset=_.limit=E,S=!1;break;case"|":if(!h){if(T||C){w=!0;break}T=C=!0}_.offset=_.limit=E,S=!1;break;case"[":if(!h){if(T||R){w=!0;break}T=R=!0}_.offset=_.markedOffset=E,S=!1;break;case"<":if(!h){if(T){w=!0;break}T=!0}_.offset=E,S=!1;break;case"]":if(!h){if(C||R){w=!0;break}C=R=!0}_.limit=_.markedOffset=E,S=!1;break;case">":if(!h){if(C){w=!0;break}C=!0}_.limit=E,S=!1;break;case"'":if(!h){if(R){w=!0;break}R=!0}_.markedOffset=E,S=!1;break;case" ":S=!1;break;default:if(!h&&S){w=!0;break}if(m=parseInt(p+c.charAt(y++),16),!h&&(isNaN(m)||m<0||m>255))throw TypeError("Illegal str: Not a debug encoded string");_.view[E++]=m,S=!0}if(w)throw TypeError("Illegal str: Invalid symbol at "+y)}if(!h){if(!T||!C)throw TypeError("Illegal str: Missing offset or limit");if(E<_.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+E+" < "+v)}return _},o.toHex=function(c,l){if(c=c===void 0?this.offset:c,l=l===void 0?this.limit:l,!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal begin: Not an integer");if(c>>>=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal end: Not an integer");if(l>>>=0,c<0||c>l||l>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+c+" <= "+l+" <= "+this.buffer.byteLength)}for(var h,p=new Array(l-c);l>c;)(h=this.view[c++])<16?p.push("0",h.toString(16)):p.push(h.toString(16));return p.join("")},f.fromHex=function(c,l,h){var p,m,v,_,y;if(!h){if(typeof c!="string")throw TypeError("Illegal str: Not a string");if(c.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(m=c.length,v=new f(0|m/2,l),_=0,y=0;m>_;_+=2){if(p=parseInt(c.substring(_,_+2),16),!h&&(!isFinite(p)||p<0||p>255))throw TypeError("Illegal str: Contains non-hex characters");v.view[y++]=p}return v.limit=y,v},d=function(){var c={MAX_CODEPOINT:1114111,encodeUTF8:function(l,h){var p=null;for(typeof l=="number"&&(p=l,l=function(){return null});p!==null||(p=l())!==null;)p<128?h(127&p):p<2048?(h(192|31&p>>6),h(128|63&p)):p<65536?(h(224|15&p>>12),h(128|63&p>>6),h(128|63&p)):(h(240|7&p>>18),h(128|63&p>>12),h(128|63&p>>6),h(128|63&p)),p=null},decodeUTF8:function(l,h){for(var p,m,v,_,y=function(E){E=E.slice(0,E.indexOf(null));var S=Error(E.toString());throw S.name="TruncatedError",S.bytes=E,S};(p=l())!==null;)if((128&p)==0)h(p);else if((224&p)==192)(m=l())===null&&y([p,m]),h((31&p)<<6|63&m);else if((240&p)==224)((m=l())===null||(v=l())===null)&&y([p,m,v]),h((15&p)<<12|(63&m)<<6|63&v);else{if((248&p)!=240)throw RangeError("Illegal starting byte: "+p);((m=l())===null||(v=l())===null||(_=l())===null)&&y([p,m,v,_]),h((7&p)<<18|(63&m)<<12|(63&v)<<6|63&_)}},UTF16toUTF8:function(l,h){for(var p,m=null;(p=m!==null?m:l())!==null;)p>=55296&&p<=57343&&(m=l())!==null&&m>=56320&&m<=57343?(h(1024*(p-55296)+m-56320+65536),m=null):h(p);m!==null&&h(m)},UTF8toUTF16:function(l,h){var p=null;for(typeof l=="number"&&(p=l,l=function(){return null});p!==null||(p=l())!==null;)p<=65535?h(p):(h(55296+((p-=65536)>>10)),h(p%1024+56320)),p=null},encodeUTF16toUTF8:function(l,h){c.UTF16toUTF8(l,function(p){c.encodeUTF8(p,h)})},decodeUTF8toUTF16:function(l,h){c.decodeUTF8(l,function(p){c.UTF8toUTF16(p,h)})},calculateCodePoint:function(l){return l<128?1:l<2048?2:l<65536?3:4},calculateUTF8:function(l){for(var h,p=0;(h=l())!==null;)p+=h<128?1:h<2048?2:h<65536?3:4;return p},calculateUTF16asUTF8:function(l){var h=0,p=0;return c.UTF16toUTF8(l,function(m){++h,p+=m<128?1:m<2048?2:m<65536?3:4}),[h,p]}};return c}(),o.toUTF8=function(c,l){if(c===void 0&&(c=this.offset),l===void 0&&(l=this.limit),!this.noAssert){if(typeof c!="number"||c%1!=0)throw TypeError("Illegal begin: Not an integer");if(c>>>=0,typeof l!="number"||l%1!=0)throw TypeError("Illegal end: Not an integer");if(l>>>=0,c<0||c>l||l>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+c+" <= "+l+" <= "+this.buffer.byteLength)}var h;try{d.decodeUTF8toUTF16(function(){return l>c?this.view[c++]:null}.bind(this),h=n())}catch{if(c!==l)throw RangeError("Illegal range: Truncated data, "+c+" != "+l)}return h()},f.fromUTF8=function(c,l,h){if(!h&&typeof c!="string")throw TypeError("Illegal str: Not a string");var p=new f(d.calculateUTF16asUTF8(t(c),!0)[1],l,h),m=0;return d.encodeUTF16toUTF8(t(c),function(v){p.view[m++]=v}),p.limit=m,p},f}(vy=function(){function e(C,w,L){this.low=0|C,this.high=0|w,this.unsigned=!!L}function t(C){return(C&&C.__isLong__)===!0}function n(C,w){var L,V,b;return w?(b=(C>>>=0)>=0&&C<256)&&(V=u[C])?V:(L=i(C,(0|C)<0?-1:0,!0),b&&(u[C]=L),L):(b=(C|=0)>=-128&&C<128)&&(V=a[C])?V:(L=i(C,C<0?-1:0,!1),b&&(a[C]=L),L)}function r(C,w){if(isNaN(C)||!isFinite(C))return w?m:p;if(w){if(C<0)return m;if(C>=c)return S}else{if(-l>=C)return T;if(C+1>=l)return E}return C<0?r(-C,w).neg():i(0|C%f,0|C/f,w)}function i(C,w,L){return new e(C,w,L)}function o(C,w,L){var V,b,I,N,A,M,$;if(C.length===0)throw Error("empty string");if(C==="NaN"||C==="Infinity"||C==="+Infinity"||C==="-Infinity")return p;if(typeof w=="number"?(L=w,w=!1):w=!!w,(L=L||10)<2||L>36)throw RangeError("radix");if((V=C.indexOf("-"))>0)throw Error("interior hyphen");if(V===0)return o(C.substring(1),w,L).neg();for(b=r(d(L,8)),I=p,N=0;N<C.length;N+=8)A=Math.min(8,C.length-N),M=parseInt(C.substring(N,N+A),L),A<8?($=r(d(L,A)),I=I.mul($).add(r(M))):I=(I=I.mul(b)).add(r(M));return I.unsigned=w,I}function s(C){return C instanceof e?C:typeof C=="number"?r(C):typeof C=="string"?o(C):i(C.low,C.high,C.unsigned)}var a,u,d,f,c,l,h,p,m,v,_,y,E,S,T,R;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,a={},u={},e.fromInt=n,e.fromNumber=r,e.fromBits=i,d=Math.pow,e.fromString=o,e.fromValue=s,l=(c=(f=4294967296)*f)/2,h=n(16777216),p=n(0),e.ZERO=p,m=n(0,!0),e.UZERO=m,v=n(1),e.ONE=v,_=n(1,!0),e.UONE=_,y=n(-1),e.NEG_ONE=y,E=i(-1,2147483647,!1),e.MAX_VALUE=E,S=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=S,T=i(0,-2147483648,!1),e.MIN_VALUE=T,(R=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},R.toString=function(C){var w,L,V,b,I,N,A,M;if((C=C||10)<2||C>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(T)?(w=r(C),V=(L=this.div(w)).mul(w).sub(this),L.toString(C)+V.toInt().toString(C)):"-"+this.neg().toString(C);for(b=r(d(C,6),this.unsigned),I=this,N="";;){if(A=I.div(b),M=(I.sub(A.mul(b)).toInt()>>>0).toString(C),(I=A).isZero())return M+N;for(;M.length<6;)M="0"+M;N=""+M+N}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){var C,w;if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(C=this.high!=0?this.high:this.low,w=31;w>0&&(C&1<<w)==0;w--);return this.high!=0?w+33:w+1},R.isZero=function(){return this.high===0&&this.low===0},R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return(1&this.low)==1},R.isEven=function(){return(1&this.low)==0},R.equals=function(C){return t(C)||(C=s(C)),(this.unsigned===C.unsigned||this.high>>>31!=1||C.high>>>31!=1)&&this.high===C.high&&this.low===C.low},R.eq=R.equals,R.notEquals=function(C){return!this.eq(C)},R.neq=R.notEquals,R.lessThan=function(C){return this.comp(C)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(C){return this.comp(C)<=0},R.lte=R.lessThanOrEqual,R.greaterThan=function(C){return this.comp(C)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(C){return this.comp(C)>=0},R.gte=R.greaterThanOrEqual,R.compare=function(C){if(t(C)||(C=s(C)),this.eq(C))return 0;var w=this.isNegative(),L=C.isNegative();return w&&!L?-1:!w&&L?1:this.unsigned?C.high>>>0>this.high>>>0||C.high===this.high&&C.low>>>0>this.low>>>0?-1:1:this.sub(C).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(v)},R.neg=R.negate,R.add=function(C){var w,L,V,b,I,N,A,M,$,x,q;return t(C)||(C=s(C)),w=this.high>>>16,L=65535&this.high,V=this.low>>>16,b=65535&this.low,I=C.high>>>16,N=65535&C.high,A=C.low>>>16,M=0,$=0,x=0,q=0,x+=(q+=b+(65535&C.low))>>>16,$+=(x+=V+A)>>>16,M+=($+=L+N)>>>16,M+=w+I,i((x&=65535)<<16|(q&=65535),(M&=65535)<<16|($&=65535),this.unsigned)},R.subtract=function(C){return t(C)||(C=s(C)),this.add(C.neg())},R.sub=R.subtract,R.multiply=function(C){var w,L,V,b,I,N,A,M,$,x,q,Z;return this.isZero()?p:(t(C)||(C=s(C)),C.isZero()?p:this.eq(T)?C.isOdd()?T:p:C.eq(T)?this.isOdd()?T:p:this.isNegative()?C.isNegative()?this.neg().mul(C.neg()):this.neg().mul(C).neg():C.isNegative()?this.mul(C.neg()).neg():this.lt(h)&&C.lt(h)?r(this.toNumber()*C.toNumber(),this.unsigned):(w=this.high>>>16,L=65535&this.high,V=this.low>>>16,b=65535&this.low,I=C.high>>>16,N=65535&C.high,A=C.low>>>16,$=0,x=0,q=0,Z=0,q+=(Z+=b*(M=65535&C.low))>>>16,x+=(q+=V*M)>>>16,q&=65535,x+=(q+=b*A)>>>16,$+=(x+=L*M)>>>16,x&=65535,$+=(x+=V*A)>>>16,x&=65535,$+=(x+=b*N)>>>16,$+=w*M+L*A+V*N+b*I,i((q&=65535)<<16|(Z&=65535),($&=65535)<<16|(x&=65535),this.unsigned)))},R.mul=R.multiply,R.divide=function(C){var w,L,V,b,I,N,A;if(t(C)||(C=s(C)),C.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:p;if(this.unsigned){if(C.unsigned||(C=C.toUnsigned()),C.gt(this))return m;if(C.gt(this.shru(1)))return _;V=m}else{if(this.eq(T))return C.eq(v)||C.eq(y)?T:C.eq(T)?v:(w=this.shr(1).div(C).shl(1)).eq(p)?C.isNegative()?v:y:(L=this.sub(C.mul(w)),V=w.add(L.div(C)));if(C.eq(T))return this.unsigned?m:p;if(this.isNegative())return C.isNegative()?this.neg().div(C.neg()):this.neg().div(C).neg();if(C.isNegative())return this.div(C.neg()).neg();V=p}for(L=this;L.gte(C);){for(w=Math.max(1,Math.floor(L.toNumber()/C.toNumber())),I=(b=Math.ceil(Math.log(w)/Math.LN2))<=48?1:d(2,b-48),A=(N=r(w)).mul(C);A.isNegative()||A.gt(L);)A=(N=r(w-=I,this.unsigned)).mul(C);N.isZero()&&(N=v),V=V.add(N),L=L.sub(A)}return V},R.div=R.divide,R.modulo=function(C){return t(C)||(C=s(C)),this.sub(this.div(C).mul(C))},R.mod=R.modulo,R.not=function(){return i(~this.low,~this.high,this.unsigned)},R.and=function(C){return t(C)||(C=s(C)),i(this.low&C.low,this.high&C.high,this.unsigned)},R.or=function(C){return t(C)||(C=s(C)),i(this.low|C.low,this.high|C.high,this.unsigned)},R.xor=function(C){return t(C)||(C=s(C)),i(this.low^C.low,this.high^C.high,this.unsigned)},R.shiftLeft=function(C){return t(C)&&(C=C.toInt()),(C&=63)==0?this:C<32?i(this.low<<C,this.high<<C|this.low>>>32-C,this.unsigned):i(0,this.low<<C-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(C){return t(C)&&(C=C.toInt()),(C&=63)==0?this:C<32?i(this.low>>>C|this.high<<32-C,this.high>>C,this.unsigned):i(this.high>>C-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(C){var w;return t(C)&&(C=C.toInt()),(C&=63)==0?this:(w=this.high,C<32?i(this.low>>>C|w<<32-C,w>>>C,this.unsigned):i(C===32?w:w>>>C-32,0,this.unsigned))},R.shru=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},R.toBytes=function(C){return C?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var C=this.high,w=this.low;return[255&w,255&w>>>8,255&w>>>16,255&w>>>24,255&C,255&C>>>8,255&C>>>16,255&C>>>24]},R.toBytesBE=function(){var C=this.high,w=this.low;return[255&C>>>24,255&C>>>16,255&C>>>8,255&C,255&w>>>24,255&w>>>16,255&w>>>8,255&w]},e}()),vy));qf.getModule=function(e){var t=new qf[e];return t.getArrayData=function(){var n=t.toArrayBuffer();return n=UC(n)?[].slice.call(new Int8Array(n)):n},t};var Kf,f4="pgMsgP",h4="chatMsg",p4="pcMsgP",g4={PRIVATE:"ppMsgS",GROUP:"pgMsgS",CHATROOM:"chatMsgS"},m4="delMsg",v4="joinChrm",y4="joinChrmR",_4="exitChrm",E4="setKV",C4="delKV",T4="setKVS",S4="delKVS",yy="qryRelationR",R4="delRelation",b4="setSeAtt",Mc={PRIVATE:"cleanPMsg",GROUP:"cleanGMsg",CUSTOMER_SERVICE:"cleanCMsg",SYSTEM:"cleanSMsg"},JC="qryPMsg",I4="qryGMsg",QC="qryCHMsg",w4="qryCMsg",O4="qrySMsg",N4=(($s={}).ppMsgP=$e.PRIVATE,$s[f4]=$e.GROUP,$s[h4]=$e.CHATROOM,$s[p4]=$e.CUSTOMER_SERVICE,$s),A4=((Lo={})[$e.PRIVATE]=JC,Lo[$e.GROUP]=I4,Lo[$e.CHATROOM]=QC,Lo[$e.CUSTOMER_SERVICE]=w4,Lo[$e.SYSTEM]=O4,Lo),P4=((xs={})[$e.PRIVATE]=Mc.PRIVATE,xs[$e.GROUP]=Mc.GROUP,xs[$e.CUSTOMER_SERVICE]=Mc.CUSTOMER_SERVICE,xs[$e.SYSTEM]=Mc.SYSTEM,xs),Cd="1",M4="0",_y=1,Ey=2,Cy=3,L4=function(){function e(t){this._codec=t==="websocket"?qf:Va,this._connectType=t}return e.prototype.decodeByPBName=function(t,n,r){var i,o=this,s=t,a=((i={})[xa]=o._formatSyncMessages,i[vl]=o._formatReceivedMessage,i[$a]=o._formatSentMessage,i[Ba]=o._formatHistoryMessages,i[Fa]=o._formatConversationList,i[yl]=o._formatChatRoomInfos,i[oo]=o._formatRTCUserList,i[El]=o._formatRTCData,i[Jo]=o._formatChatRoomKVList,i[Cl]=o._formatUserSetting,i[Sl]=o._formatConversationStatus,i[Rl]=o._formatGrpReadReceiptQryResp,i[Qo]=o._formatSetUserSettingOutput,i[Tl]=o._formatUserSettingNotification,i[bl]=o._formatRTCRoomKVList,i[_l]=o._formatRTCAuidenceJoinRoomData,i[Il]=o._formatRTCJoinedUserInfo,i)[n];try{s=t.length>0&&o._codec[n].decode(t),sn(s)&&(s=function(u){for(var d in u)sn(u[d])&&(u[d]=Yn(u[d]));return u}(s)),Au(a)&&(s=a.call(this,s,r))}catch(u){de.error(`PB parse error
  813. `,u,t,n)}return s},e.prototype._readBytes=function(t){var n=t.offset,r=t.buffer,i=t.limit;if(n)try{var o=UC(r)?new Uint8Array(r):r;return ic.readUTF(o.subarray(n,i))}catch(s){de.info(`readBytes error
  814. `,s)}return t},e.prototype._formatBytes=function(t){var n=this._readBytes(t);try{n=JSON.parse(n)}catch(r){de.info(`formatBytes error
  815. `,r)}return n||t},e.prototype._formatSyncMessages=function(t,n){n=n||{};var r=this,i=t.list,o=t.syncTime,s=t.finished;return(mt(s)||s===null)&&(t.finished=!0),t.syncTime=Yn(o),t.list=Pc(i,function(a){return r._formatReceivedMessage(a,n)}),t},e.prototype._formatReceivedMessage=function(t,n){var r=(n=n||{}).currentUserId,i=n.connectedTime,o=t.content,s=t.fromUserId,a=t.type,u=t.groupId,d=t.status,f=t.dataTime,c=t.classname,l=t.msgId,h=t.extraContent,p=t.pushContent,m=t.pushExt,v=t.configFlag,_=(t.direction||Qn.RECEIVE)===Qn.SEND,y=function(ve){var Se=Da.READ;return{isPersited:!!(16&ve),isCounted:!!(32&ve),isMentioned:!!(64&ve),disableNotification:!!(512&ve),receivedStatus:Se=2&ve?Da.RETRIEVED:Se,canIncludeExpansion:!!(1024&ve)}}(d),E=y.isPersited,S=y.isCounted,T=y.isMentioned,R=y.disableNotification,C=y.receivedStatus,w=y.canIncludeExpansion,L=[$e.GROUP,$e.CHATROOM,$e.RTC_ROOM].indexOf(a)>-1?u:s,V=_?r:s,b=Yn(f),I=b<i,N=a===$e.CHATROOM,A=this._formatBytes(o),M={};if(m&&(M=dy(m.pushConfigs,m.pushId)),A.user){var $=A.user,x=$.portrait,q=$.portraitUri,Z=x||q;Z&&(A.user.portrait=A.user.portraitUri=Z)}var le,Te=Rt(Rt({},M),{pushTitle:m==null?void 0:m.title,pushContent:p,pushData:p,disablePushTitle:!!v&&Boolean(4&v),forceShowDetailContent:!!v&&Boolean(8&v),templateId:m==null?void 0:m.templateId}),Ee=_?Qn.SEND:Qn.RECEIVE;return N&&s===r&&(Ee=Qn.SEND),h&&(le={},le=hy(h)),{conversationType:a,targetId:L,senderUserId:V,messageType:c,messageUId:l,isPersited:E,isCounted:S,isMentioned:T,sentTime:b,isOffLineMessage:I,messageDirection:Ee,receivedTime:Vo.getTime(),disableNotification:R,receivedStatus:C,canIncludeExpansion:w,content:A,expansion:le,configFlag:v,pushConfig:Te,channelId:t.busChannel||""}},e.prototype._formatSentMessage=function(t,n){var r,i=t.content,o=t.classname,s=t.sessionId,a=t.msgId,u=t.extraContent,d=t.pushExt,f=t.pushContent,c=t.configFlag,l=n.signal,h=n.currentUserId,p=l.date,m=l.topic,v=l.targetId,_=function(I){return{isPersited:!!(1&I),isCounted:!!(2&I),disableNotification:!!(32&I),canIncludeExpansion:!!(64&I)}}(s),y=_.isPersited,E=_.isCounted,S=_.disableNotification,T=_.canIncludeExpansion,R=N4[m]||$e.PRIVATE,C=o4(g4,m),w=this._formatBytes(i),L=v;o===mn.RECALL&&(R=w.conversationType||R,L=w.targetId||v),u&&(r={},r=hy(u));var V={};d&&(V=dy(d.pushConfigs,d.pushId));var b=Rt(Rt({},V),{pushTitle:d==null?void 0:d.title,pushContent:f,pushData:f,disablePushTitle:!!c&&Boolean(4&c),forceShowDetailContent:!!c&&Boolean(8&c),templateId:d==null?void 0:d.templateId});return{conversationType:R,targetId:L,messageType:o,messageUId:a,isPersited:y,isCounted:E,isStatusMessage:C,senderUserId:h,content:this._formatBytes(i),sentTime:1e3*p,receivedTime:Vo.getTime(),messageDirection:Qn.SEND,isOffLineMessage:!1,disableNotification:S,canIncludeExpansion:T,expansion:r,pushConfig:b,channelId:t.busChannel||""}},e.prototype._formatHistoryMessages=function(t,n){var r=this,i=n.conversation||{},o=t.list,s=t.hasMsg,a=i.targetId,u=Yn(t.syncTime),d=[];return Bt(o,function(f){var c=r._formatReceivedMessage(f,n);c.targetId=a,d.push(c)},{isReverse:!0}),{syncTime:u,list:d,hasMore:!!s}},e.prototype._formatConversationList=function(t,n){var r=this,i=t.info,o=n.afterDecode||function(){};return(i=Pc(i,function(s){var a=s.msg,u=s.userId,d=s.type,f=s.unreadCount,c=s.busChannel,l=null;a&&((l=r._formatReceivedMessage(a,n)).targetId=u);var h={targetId:u,conversationType:d,unreadMessageCount:f,latestMessage:l,channelId:c||""};return o(h)||h}))||[]},e.prototype._formatSetUserSettingOutput=function(t){return t},e.prototype._formatChatRoomInfos=function(t){var n=t.userTotalNums,r=t.userInfos;return{userCount:n,userInfos:Pc(r,function(i){var o=i.id,s=i.time;return{id:o,time:Yn(s)}})}},e.prototype._formatChatRoomKVList=function(t){var n=t.entries,r=t.bFullUpdate,i=t.syncTime;return{kvEntries:n=Pc(n=n||[],function(o){var s=o.key,a=o.value,u=o.status,d=o.timestamp,f=o.uid,c=function(l){return{isAutoDelete:!!(1&l),isOverwrite:!!(2&l),type:4&l?Pn.DELETE:Pn.UPDATE}}(u);return{key:s,value:a,isAutoDelete:c.isAutoDelete,isOverwrite:c.isOverwrite,type:c.type,userId:f,timestamp:Yn(d)}}),isFullUpdate:r,syncTime:i}},e.prototype._formatUserSetting=function(t){var n=this,r=t.items,i=t.version,o={};return Bt(r||[],function(s){var a=s.key,u=s.version,d=s.value;s.version=Yn(u),s.value=n._readBytes(d),a==="Tag"&&s.tags.forEach(function(f){f.createdTime=Yn(f.createdTime),f.tagName=f.name}),o[a]=s}),{settings:o,version:i}},e.prototype._formatConversationStatus=function(t){var n=t.state,r=[];return Bt(n,function(i){var o=i.type,s=i.channelId,a=i.time,u=i.stateItem,d=i.busChannel,f=Fo.CLOSE,c=!1,l=[];Bt(u,function(h){var p=h.sessionStateType,m=h.value,v=h.tags;switch(p){case _y:f=m===Cd?Fo.OPEN:Fo.CLOSE;break;case Ey:c=m===Cd;break;case Cy:l=v}}),r.push({conversationType:o,type:o,targetId:s,notificationStatus:f,isTop:c,updatedTime:Yn(a),tags:l,channelId:d||""})}),r},e.prototype._formatRTCUserList=function(t){var n=t.users,r=t.token,i=t.sessionId,o=t.roomInfo,s=t.entries,a={};return Bt(n,function(u){var d=u.userId,f=u.userData,c={};Bt(f,function(l){var h=l.key,p=l.value;c[h]=p}),a[d]=c}),{users:a,token:r,sessionId:i,roomInfo:o,kvEntries:s}},e.prototype._formatRTCData=function(t){var n=t.outInfo,r={};return Bt(n,function(i){r[i.key]=i.value}),r},e.prototype._formatRTCRoomInfo=function(t){var n=t.roomId,r=t.userCount,i=t.roomData,o={id:n,total:r};return Bt(i,function(s){o[s.key]=s.value}),o},e.prototype._formatGrpReadReceiptQryResp=function(t){var n=t.totalMemberNum,r=t.list;return r.forEach(function(i){i.readTime=Yn(i.readTime)}),{totalMemberCount:n,list:r}},e.prototype._formatUserSettingNotification=function(t){return t},e.prototype._formatRTCRoomKVList=function(t){var n=t.entries,r=t.bFullUpdate,i=t.syncTime;return{kvEntries:n=(n=n||[]).map(function(o){var s=o.timestamp;return Object.assign(o,{timestamp:Yn(s)})}),isFullUpdate:r,syncTime:i}},e.prototype._formatRTCAuidenceJoinRoomData=function(t){return t},e.prototype._formatRTCJoinedUserInfo=function(t){return(t.info||[]).map(function(n){return{deviceId:n.deviceId,roomId:n.roomId,joinTime:Yn(n.joinTime)}})},e.prototype.encodeServerConfParams=function(){var t=this._codec.getModule(Ip);return t.setNothing(1),t.getArrayData()},e.prototype._getUpMsgModule=function(t,n){var r,i,o,s=this._connectType==="comet",a=(t.conversationType,n.messageType),u=n.isMentioned,d=n.mentionedType,f=n.mentionedUserIdList,c=n.content,l=n.pushContent,h=n.pushData,p=n.directionalUserIdList,m=n.isFilerWhiteBlacklist,v=n.isVoipPush,_=n.canIncludeExpansion,y=n.expansion,E=n.pushConfig,S=n.channelId;$e.GROUP;var T=this._codec.getModule($a),R=function(Ee){var ve=Ee.isStatusMessage,Se=Ee.isPersited,P=Ee.isCounted;ve&&(Se=P=!1);var z=0;return Se&&(z|=1),P&&(z|=2),Ee.isMentioned&&(z|=4),Ee.disableNotification&&(z|=32),Ee.canIncludeExpansion&&(z|=64),z}(n),C=E||{},w=C.pushTitle,L=C.pushContent,V=C.pushData,b=C.iOSConfig,I=C.androidConfig,N=C.templateId,A=C.disablePushTitle,M=C.forceShowDetailContent,$=0;T.setSessionId(R),u&&c&&(c.mentionedInfo={userIdList:((r=c.mentionedInfo)===null||r===void 0?void 0:r.userIdList)||f||[],type:((i=c.mentionedInfo)===null||i===void 0?void 0:i.type)||d||Sp.ALL,mentionedContent:((o=c.mentionedInfo)===null||o===void 0?void 0:o.mentionedContent)||""});var x=L||l||"",q=V||h||"";if(x&&T.setPushText(x),q&&T.setAppData(q),p&&T.setUserId(p),$|=v?1:0,$|=m?2:0,$|=A?4:0,$|=M?8:0,T.setConfigFlag($),T.setClassname(a),c.user&&c.user.portraitUri&&(c.user.portrait=c.user.portraitUri),T.setContent(JSON.stringify(c)),_&&y){var Z={};Bt(y,function(Ee,ve){Z[ve]={v:Ee}}),T.setExtraContent(JSON.stringify(Z))}if(E){var le=this._codec.getModule(bp);if(w&&le.setTitle(w),b&&I){var Te=r4(b,I);le.setPushConfigs(Te)}(I==null?void 0:I.notificationId)&&le.setPushId(I==null?void 0:I.notificationId),le.setTemplateId(N||""),T.setPushExt(s?le.getArrayData():le)}return mt(S)||T.setBusChannel(S),T},e.prototype.encodeUpMsg=function(t,n){return this._getUpMsgModule(t,n).getArrayData()},e.prototype.encodeSyncMsg=function(t){var n=t.sendboxTime,r=t.inboxTime,i=this._codec.getModule(wp);return i.setIspolling(!1),i.setIsPullSend(!0),i.setSendBoxSyncTime(n),i.setSyncTime(r),i.getArrayData()},e.prototype.encodeChrmSyncMsg=function(t,n){t=t||0,n=n||0;var r=this._codec.getModule(Op);return r.setCount(n),r.setSyncTime(t),r.getArrayData()},e.prototype.encodeGetHistoryMsg=function(t,n){var r=n.count,i=n.order,o=n.timestamp,s=n.channelId,a=this._codec.getModule(Np);return a.setTargetId(t),a.setTime(o),a.setCount(r),a.setOrder(i),a.setBusChannel(s||""),a.getArrayData()},e.prototype.encodeGetConversationList=function(t){var n=(t=t||{}).count,r=t.startTime,i=this._codec.getModule(Lu);return i.setType(1),i.setCount(n),i.setStartTime(r),i.getArrayData()},e.prototype.encodeOldConversationList=function(t){var n=(t=t||{}).count,r=t.type,i=t.startTime,o=t.order;n=n||0,i=i||0,o=o||0;var s=this._codec.getModule(Lu);return s.setType(r),s.setCount(n),s.setStartTime(i),s.setOrder(o),s.getArrayData()},e.prototype.encodeRemoveOldConversationList=function(t){var n=(t=t||{}).conversationType,r=t.channelId,i=this._codec.getModule(Mp);return i.setType(n),i.setBusChannel(r),i.getArrayData()},e.prototype.encodeRemoveConversationList=function(t){var n=this,r=this._codec.getModule(Ap),i=[];return Bt(t,function(o){var s=o.conversationType,a=o.targetId,u=n._codec.getModule(Pp);u.setType(s),u.setChannelId(a),i.push(u)}),r.setSessions(i),r.getArrayData()},e.prototype.encodeDeleteMessages=function(t,n,r,i){var o=this._codec.getModule(Lp),s=[];return Bt(r,function(a){s.push({msgId:a.messageUId,msgDataTime:a.sentTime,direct:a.messageDirection})}),o.setType(t),o.setConversationId(n),o.setMsgs(s),o.setBusChannel(i),o.getArrayData()},e.prototype.encodeClearMessages=function(t,n,r){var i=this._codec.getModule(kp);return n=n||new Date().getTime(),i.setDataTime(n),i.setTargetId(t),i.setBusChannel(r),i.getArrayData()},e.prototype.encodeClearUnreadCount=function(t,n){var r=t.conversationType,i=t.targetId,o=n.timestamp,s=this._codec.getModule(Dp);return o=o||+new Date,s.setType(r),s.setChannelId(i),s.setMsgTime(o),s.getArrayData()},e.prototype.encodeJoinOrQuitChatRoom=function(){var t=this._codec.getModule(Up);return t.setNothing(1),t.getArrayData()},e.prototype.encodeGetChatRoomInfo=function(t,n){var r=this._codec.getModule(xp);return r.setCount(t),r.setOrder(n),r.getArrayData()},e.prototype.encodeGetFileToken=function(t,n,r,i){var o=this._codec.getModule(Gp);return o.setType(t),o.setKey(n),o.setHttpMethod(r),o.setQueryString(i),o.getArrayData()},e.prototype.encodeGetFileUrl=function(t,n,r,i){var o=this._codec.getModule(t);return o.setType(n),o.setKey(r),i&&o.setFileName(i),o.getArrayData()},e.prototype.encodeModifyChatRoomKV=function(t,n,r){var i=this._connectType==="comet",o=this._codec.getModule(Xp),s=n.key,a=n.value,u=n.notificationExtra,d=n.isSendNotification,f=n.type||Pn.UPDATE,c=py(n,f),l={key:s,value:a||"",uid:r};if(mt(c)||(l.status=c),o.setEntry(l),d){var h={conversationType:$e.CHATROOM,targetId:t},p={key:s,value:a,extra:u,type:f},m=this._getUpMsgModule(h,{messageType:mn.CHRM_KV_NOTIFY,content:p,isPersited:!1,isCounted:!1});i?o.setNotification(m.getArrayData()):o.setNotification(m),o.setBNotify(!0),o.setType($e.CHATROOM)}return o.getArrayData()},e.prototype.encodeModifyChatRoomKVS=function(t,n,r){this._connectType;var i=this._codec.getModule(Zp),o=n.entries,s=n.type||Pn.UPDATE,a=py(n,s),u=[];return o.forEach(function(d){var f={key:d.key,value:d.value||"",uid:r};mt(a)||(f.status=a),u.push(f)}),i.setEntry(u),i.getArrayData()},e.prototype.encodePullChatRoomKV=function(t){var n=this._codec.getModule(tg);return n.setTimestamp(t),n.getArrayData()},e.prototype.encodePullUserSetting=function(t){var n=this._codec.getModule(ng);return n.setVersion(t),n.getArrayData()},e.prototype.encodeGetConversationStatus=function(t){var n=this._codec.getModule(rg);return n.setTime(t),n.getArrayData()},e.prototype.encodeSetConversationStatus=function(t){var n=this,r=this._connectType==="comet",i=this._codec.getModule(Bu),o=Vo.getTime(),s=[];return Bt(t,function(a){var u=n._codec.getModule($u),d=a.conversationType,f=a.targetId,c=a.notificationStatus,l=a.isTop,h=a.channelId,p=[];u.setType(d),u.setChannelId(f),u.setTime(o),u.setBusChannel(h);var m=c===Fo.OPEN,v={};mt(c)||(v[_y]=m),mt(l)||(v[Ey]=l),Bt(v,function(y,E){if(!mt(y)){var S=n._codec.getModule(xu);y=y?Cd:M4,S.setSessionStateType(Number(E)),S.setValue(y);var T=r?S.getArrayData():S;p.push(T)}}),u.setStateItem(p);var _=r?u.getArrayData():u;s.push(_)}),i.setVersion(o),i.setState(s),i.getArrayData()},e.prototype.encodeReadReceipt=function(t,n){var r=this._codec.getModule(Fu);return r.setMsgId(t),n&&r.setChannelId(n),r.getArrayData()},e.prototype.encodeCreateTag=function(t,n){var r=this,i=this._connectType==="comet",o=this._codec.getModule(og),s=[];return t.forEach(function(a){var u=r._codec.getModule(ga);u.setTagId(a.tagId),u.setName(a.tagName),s.push(i?u.getArrayData():u)}),o.setTags(s),o.setVersion(n),o.getArrayData()},e.prototype.encodeMessageReader=function(t,n){var r=this._codec.getModule(Fu);return r.setMsgId(t),n&&r.setChannelId(n),r.getArrayData()},e.prototype.encodeRemoveTag=function(t,n){var r=this,i=this._connectType==="comet",o=this._codec.getModule(sg),s=[];return t.forEach(function(a){var u=r._codec.getModule(ga);u.setTagId(a),s.push(i?u.getArrayData():u)}),o.setTags(s),o.setVersion(n),o.getArrayData()},e.prototype.encodeDisConversationTag=function(t){var n=this._codec.getModule(ag);return n.setTagId(t),n.getArrayData()},e.prototype.encodeUpdateConversationTag=function(t,n){var r=this,i=this._connectType==="comet",o=this._codec.getModule(Bu),s=[];return n.forEach(function(a){var u=r._codec.getModule($u),d=r._codec.getModule(xu),f=[];t.forEach(function(c){var l=r._codec.getModule(ga);l.setTagId(c.tagId),mt(c.isTop)||l.setIsTop(c.isTop),f.push(i?l.getArrayData():l)}),d.setSessionStateType(Cy),d.setValue(JSON.stringify(f)),d.setTags(f),u.setType(a.conversationType),u.setChannelId(a.targetId),u.setTime(Date.now()),u.setStateItem([i?d.getArrayData():d]),s.push(i?u.getArrayData():u)}),o.setState(s),o.setVersion(Vo.getTime()),o.getArrayData()},e.prototype.encodeReportSDKInfo=function(t){var n=this._codec.getModule(cg);return n.setSdkInfo(t),n.getArrayData()},e.prototype.encodeJoinRTCRoom=function(t,n,r){var i=this._codec.getModule(ku);return t=t||0,i.setRoomType(t),mt(n)||i.setBroadcastType(n),mt(r)||i.setJoinType(r),i.getArrayData()},e.prototype.encodeQuitRTCRoom=function(){return this._codec.getModule(Bp).getArrayData()},e.prototype.encodeSetRTCData=function(t,n,r,i,o){var s=this._codec.getModule(Fp);if(s.setInterior(r),s.setTarget(i),s.setKey(t),s.setValue(n),o){o.name&&s.setObjectName(o.name);var a=o.content;a&&(sn(a)&&(a=JSON.stringify(a)),s.setContent(a))}return s.getArrayData()},e.prototype.encodeUserSetRTCData=function(t,n,r,i){var o=this,s=this._connectType==="comet",a=this._codec.getModule(Du);a.setObjectName(r);var u=this._codec.getModule(Jn);u.setKey(t.name),u.setValue(t.content),s?a.setContent([u.getArrayData()]):a.setContent(u);var d=[];return["uris","mcu_uris"].forEach(function(f){var c=o._codec.getModule(Jn);c.setKey(f);var l=f==="uris"?n:i;c.setValue(l),s?d.push(c.getArrayData()):d.push(c)}),a.setValueInfo(d),a.getArrayData()},e.prototype.encodeUserSetRTCCDNUris=function(t,n){this._connectType;var r=this._codec.getModule(Du);r.setObjectName(t);var i=this._codec.getModule(Jn);return i.setKey("cdn_uris"),i.setValue(n),r.setValueInfo(i),r.getArrayData()},e.prototype.encodeGetRTCData=function(t,n,r){var i=this._codec.getModule(Uu);return i.setInterior(n),i.setTarget(r),i.setKey(t),i.getArrayData()},e.prototype.encodeRemoveRTCData=function(t,n,r,i){var o=this._codec.getModule(Uu);o.setInterior(n),o.setTarget(r),o.setKey(t);var s=(i=i||{}).name,a=i.content;return!mt(s)&&o.setObjectName(s),mt(a)||(sn(a)&&(a=JSON.stringify(a)),o.setContent(a)),o.getArrayData()},e.prototype.encodeSetRTCOutData=function(t,n,r){var i=this._codec.getModule(Vp);i.setTarget(n),In(t)||(t=[t]),Bt(t,function(a,u){a.key=a.key?a.key.toString():a.key,a.value=a.value?a.value.toString():a.value,t[u]=a}),i.setValueInfo(t);var o=(r=r||{}).name,s=r.content;return!mt(o)&&i.setObjectName(o),mt(s)||(sn(s)&&(s=JSON.stringify(s)),i.setContent(s)),i.getArrayData()},e.prototype.ecnodeGetRTCOutData=function(t){var n=this._codec.getModule(Hp);return n.setUserId(t),n.getArrayData()},e.prototype.encodeSetRTCState=function(t){var n=this._codec.getModule(jp);return n.setState(t),n.getArrayData()},e.prototype.encodeGetRTCRoomInfo=function(){var t=this._codec.getModule(qp);return t.setOrder(2),t.getArrayData()},e.prototype.encodeSetRTCUserInfo=function(t,n){var r=this._codec.getModule(Jn);return r.setKey(t),r.setValue(n),r.getArrayData()},e.prototype.encodeRemoveRTCUserInfo=function(t){var n=this._codec.getModule(Kp);return n.setKey(t),n.getArrayData()},e.prototype.encodeIdentityChangeInfo=function(t,n,r){r===void 0&&(r=!1);var i=this._codec.getModule(ku);return i.setRoomType(yn.LIVE),n&&i.setBroadcastType(n),i.setIdentityChangeType(t),i.setNeedSysChatroom(r),i.getArrayData()},e.prototype.encodePullRTCRoomKV=function(t,n){var r=this._codec.getModule(lg);return r.setTimestamp(n),r.setRoomId(t),r.getArrayData()},e.prototype.encodeQueryUserJoinedInfo=function(t){var n=this._codec.getModule(dg);return n.setUserId(t),n.getArrayData()},e.prototype.encodeRequestRoomPK=function(t){var n=t.invitedRoomId,r=t.invitedUserId,i=t.inviteSessionId,o=t.inviteTimeout,s=t.inviteInfo,a=this._codec.getModule(fg);return a.setInvitedRoomId(n),a.setInvitedUserId(r),a.setInviteSessionId(i),a.setTimeoutTime(o),a.setInviteInfo(s),a.getArrayData()},e.prototype.encodeCancelRoomPK=function(t){var n=t.invitedRoomId,r=t.invitedUserId,i=t.inviteSessionId,o=t.inviteInfo,s=this._codec.getModule(hg);return s.setInvitedRoomId(n),s.setInvitedUserId(r),s.setInviteSessionId(i),s.setInviteInfo(o),s.getArrayData()},e.prototype.encodeResponseRoomPK=function(t){var n=t.inviteUserId,r=t.inviteRoomId,i=t.inviteSessionId,o=t.content,s=t.key,a=t.value,u=t.agree?1:0,d=this._codec.getModule(pg);return d.setInviteUserId(n),d.setInviteRoomId(r),d.setInviteSessionId(i),d.setContent(o),d.setKey(s),d.setValue(a),d.setAnswerCode(u),d.getArrayData()},e.prototype.encodeEndRoomPK=function(t){var n=t.endRoomId,r=t.sessionId,i=t.content,o=t.keys,s=this._codec.getModule(gg);return s.setInviteRoomId(n),s.setInviteSessionId(r),s.setInviteContent(i),s.setInviteRoomKeys(o),s.getArrayData()},e}(),XC=function(e,t){this._watcher=t,this.codec=new L4(e)},ZC=function(e,t){return e&&t?t+"_"+e:e||Date.now()},oc=function(){function e(t){this.header=t,this._name=null,this.lengthSize=0,this.messageId=0,this.timestamp=0,this.syncMsg=!1,this.identifier=""}return e.prototype.getIdentifier=function(){var t=this.messageId,n=this.identifier;return ZC(t,n)},e.prototype.read=function(t,n,r){this.readMessage(t,n,r)},e.prototype.readMessage=function(t,n,r){return{stream:t,length:n}},e}(),eT=function(){function e(t){this.lengthSize=0,this.messageId=0,this.topic="",this.targetId="",this.identifier="",this._header=new Rp(t,!1,Xr.AT_MOST_ONCE,!1)}return e.prototype.getIdentifier=function(){var t=this.messageId,n=this.identifier;return ZC(t,n)},e.prototype.write=function(t){var n=this.getHeaderFlag();t.write(n),this.writeMessage(t)},e.prototype.setHeaderQos=function(t){this._header.qos=t},e.prototype.getHeaderFlag=function(){return this._header.encode()},e.prototype.getLengthSize=function(){return this.lengthSize},e.prototype.getBufferData=function(){var t=new c4;this.write(t);var n=t.getBytesArray();return new Int8Array(n)},e.prototype.getCometData=function(){var t=this.data||{};return JSON.stringify(t)},e}(),tT=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._name=jn.CONN_ACK,n.status=null,n.userId=null,n.timestamp=0,n}return xt(t,e),t.prototype.readMessage=function(n,r,i){if(n.readByte(),this.status=+n.readByte(),r<=t.MESSAGE_LENGTH)return{stream:n,length:r};if(i===io.V4){var o=n.readByte();1&o&&(this.userId=n.readUTF()),2&o&&n.readUTF(),4&o&&(this.timestamp=n.readLong()),8&o&&(this.messageId=n.read2Byte())}else{this.userId=n.readUTF();var s=n.readUTF();de.debug("server sessionId -> "+s),this.timestamp=n.readLong()}return{stream:n,length:r}},t.MESSAGE_LENGTH=2,t}(oc),mg=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._name=jn.DISCONNECT,n.status=0,n}return xt(t,e),t.prototype.readMessage=function(n,r){return n.readByte(),this.status=+n.readByte(),{stream:n,length:r}},t.MESSAGE_LENGTH=2,t}(oc),k4=function(e){function t(){var n=e.call(this,gn.PING_REQ)||this;return n._name=jn.PING_REQ,n}return xt(t,e),t.prototype.writeMessage=function(n){},t}(eT),nT=function(e){function t(n){var r=e.call(this,n)||this;return r._name=jn.PING_RESP,r}return xt(t,e),t}(oc),vg=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.messageId=0,n}return xt(t,e),t.prototype.readMessage=function(n,r){var i=256*n.readByte()+n.readByte();return this.messageId=parseInt(i.toString(),10),{stream:n,length:r}},t}(oc),wl=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.messageId=0,n}return xt(t,e),t.prototype.writeMessage=function(n){var r=this.messageId,i=255&r,o=(65280&r)>>8;n.write(o),n.write(i)},t}(eT),ja=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._name=jn.PUBLISH,n.topic="",n.targetId="",n.syncMsg=!1,n.identifier=yo.PUB,n}return xt(t,e),t.prototype.readMessage=function(n,r){return this.date=n.readInt(),this.topic=n.readUTF(),this.targetId=n.readUTF(),e.prototype.readMessage.call(this,n,r),this.data=n.readAll(),{stream:n,length:r}},t}(vg),Bs=function(e){function t(n,r,i){var o=e.call(this,gn.PUBLISH)||this;return o._name=jn.PUBLISH,o.syncMsg=!1,o.identifier=yo.PUB,o.topic=n,o.data=Vn(r)?ic.writeUTF(r):r,o.targetId=i,o}return xt(t,e),t.prototype.writeMessage=function(n){n.writeUTF(this.topic),n.writeUTF(this.targetId),e.prototype.writeMessage.call(this,n),n.write(this.data)},t}(wl),Gf=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._name=jn.PUB_ACK,n.status=0,n.date=0,n.millisecond=0,n.messageUId="",n.timestamp=0,n.identifier=yo.PUB,n.topic="",n.targetId="",n}return xt(t,e),t.prototype.readMessage=function(n,r){return e.prototype.readMessage.call(this,n,r),this.date=n.readInt(),this.status=256*n.readByte()+n.readByte(),this.millisecond=256*n.readByte()+n.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=n.readUTF(),{stream:n,length:r}},t}(vg),rT=function(e){function t(n){var r=e.call(this,gn.PUB_ACK)||this;return r._name=jn.PUB_ACK,r.status=0,r.date=0,r.millisecond=0,r.messageUId="",r.timestamp=0,r.messageId=n,r}return xt(t,e),t.prototype.writeMessage=function(n){e.prototype.writeMessage.call(this,n)},t}(wl),De=function(e){function t(n,r,i){var o=e.call(this,gn.QUERY)||this;return o.name=jn.QUERY,o.identifier=yo.QUERY,o.topic=n,o.data=Vn(r)?ic.writeUTF(r):r,o.targetId=i,o}return xt(t,e),t.prototype.writeMessage=function(n){n.writeUTF(this.topic),n.writeUTF(this.targetId),e.prototype.writeMessage.call(this,n),n.write(this.data)},t}(wl),iT=function(e){function t(n){var r=e.call(this,gn.QUERY_CONFIRM)||this;return r._name=jn.QUERY_CON,r.messageId=n,r}return xt(t,e),t}(wl),ma=function(e){function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._name=jn.QUERY_ACK,n.status=0,n.identifier=yo.QUERY,n.topic="",n.targetId="",n}return xt(t,e),t.prototype.readMessage=function(n,r){return e.prototype.readMessage.call(this,n,r),this.date=n.readInt(),this.status=256*n.readByte()+n.readByte(),this.data=n.readAll(),{stream:n,length:r}},t}(vg),oT=function(e){var t,n=e.type;switch(n){case gn.CONN_ACK:t=new tT(e);break;case gn.PUBLISH:(t=new ja(e)).syncMsg=e.syncMsg;break;case gn.PUB_ACK:t=new Gf(e);break;case gn.QUERY_ACK:t=new ma(e);break;case gn.SUB_ACK:case gn.UNSUB_ACK:case gn.PING_RESP:t=new nT(e);break;case gn.DISCONNECT:t=new mg(e);break;default:t=new oc(e),de.error("No support for deserializing "+n+" messages")}return t};(function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgN=2]="ppMsgN",e[e.ppMsgS=3]="ppMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.qryPMsg=7]="qryPMsg",e[e.qryGMsg=8]="qryGMsg",e[e.qryCHMsg=9]="qryCHMsg",e[e.qryCMsg=10]="qryCMsg",e[e.qrySMsg=11]="qrySMsg",e[e.recallMsg=12]="recallMsg",e[e.prMsgS=13]="prMsgS",e[e.rrMsg=14]="rrMsg",e[e.rrList=15]="rrList",e[e.s_ntf=16]="s_ntf",e[e.s_msg=17]="s_msg",e[e.s_stat=18]="s_stat",e[e.s_cmd=19]="s_cmd",e[e.s_us=20]="s_us",e[e.pullUS=21]="pullUS",e[e.pgMsgS=22]="pgMsgS",e[e.chatMsgS=23]="chatMsgS",e[e.qrySessionsAtt=24]="qrySessionsAtt",e[e.pullMsg=25]="pullMsg",e[e.qrySessions=26]="qrySessions",e[e.delSessions=27]="delSessions",e[e.delMsg=28]="delMsg",e[e.updRRTime=29]="updRRTime",e[e.chrmPull=30]="chrmPull",e[e.joinChrm=31]="joinChrm",e[e.joinChrmR=32]="joinChrmR",e[e.exitChrm=33]="exitChrm",e[e.queryChrmI=34]="queryChrmI",e[e.setKV=35]="setKV",e[e.delKV=36]="delKV",e[e.pullKV=37]="pullKV",e[e.qryRelation=38]="qryRelation",e[e.delRelation=39]="delRelation",e[e.pullSeAtts=40]="pullSeAtts",e[e.setSeAtt=41]="setSeAtt",e[e.qnTkn=42]="qnTkn",e[e.qnUrl=43]="qnUrl",e[e.aliUrl=44]="aliUrl",e[e.s3Url=45]="s3Url",e[e.stcUrl=46]="stcUrl",e[e.cleanPMsg=47]="cleanPMsg",e[e.cleanGMsg=48]="cleanGMsg",e[e.cleanCMsg=49]="cleanCMsg",e[e.cleanSMsg=50]="cleanSMsg",e[e.rtcRJoin_data=51]="rtcRJoin_data",e[e.rtcRExit=52]="rtcRExit",e[e.rtcPing=53]="rtcPing",e[e.rtcSetData=54]="rtcSetData",e[e.rtc_ntf=55]="rtc_ntf",e[e.viewerJoinR=56]="viewerJoinR",e[e.viewerExitR=57]="viewerExitR",e[e.rtcPullKv=58]="rtcPullKv",e[e.rtcIdentityChange=59]="rtcIdentityChange",e[e.userSetData=60]="userSetData",e[e.rtcQryData=61]="rtcQryData",e[e.rtcDelData=62]="rtcDelData",e[e.rtcSetOutData=63]="rtcSetOutData",e[e.rtcQryUserOutData=64]="rtcQryUserOutData",e[e.rtcToken=65]="rtcToken",e[e.rtcUserState=66]="rtcUserState",e[e.rtcRInfo=67]="rtcRInfo",e[e.rtcUData=68]="rtcUData",e[e.rtcUPut=69]="rtcUPut",e[e.rtcUDel=70]="rtcUDel",e[e.rtcUList=71]="rtcUList",e[e.rtcQueryJoined=72]="rtcQueryJoined",e[e.addSeTag=73]="addSeTag",e[e.delSeTag=74]="delSeTag",e[e.addTag=75]="addTag",e[e.delTag=76]="delTag",e[e.disTag=77]="disTag",e[e.reportsdk=78]="reportsdk",e[e.rtcInvite=79]="rtcInvite",e[e.rtcCancelInvite=80]="rtcCancelInvite",e[e.rtcInviteAnswer=81]="rtcInviteAnswer",e[e.rtcEndInvite=82]="rtcEndInvite"})(Kf||(Kf={}));var wr,Y=Kf,sT=function(e,t,n,r){return J(void 0,void 0,void 0,function(){var i;return Q(this,function(o){return i=0,e.forEach(function(s){return J(void 0,void 0,void 0,function(){var a,u;return Q(this,function(d){switch(d.label){case 0:return a=t+"://"+s+"/ping?r="+(c=9999,(f=1e3)+Math.floor(Math.random()*(c-f))),de.debug("start ping",a),[4,n.httpReq({url:a,timeout:5e3})];case 1:return u=d.sent(),de.debug("end ping",i,a,u.status),i++,r({finished:i===e.length,code:u.status,host:s}),[2]}var f,c})})}),[2]})})},aT=function(e,t,n,r,i,o,s,a){return e+"://"+t+"/websocket?appId="+n+"&token="+encodeURIComponent(r)+"&sdkVer="+o+"&pid="+s+"&apiVer="+(i.isFromUniapp?"uniapp":"normal")+(i.connectPlatform?"&platform="+i.connectPlatform:"")+(a?"&protocolVer="+a:"")},cT=function(e){return[Y.ppMsgS,Y.pgMsgS,Y.chatMsgS].map(function(t){return Y[t]}).indexOf(e)>=0};(function(e){e[e.REDIRECT=0]="REDIRECT",e[e.OTHER_DEVICE_LOGIN=1]="OTHER_DEVICE_LOGIN",e[e.BLOCK=2]="BLOCK",e[e.REMOTE_CLOSE=3]="REMOTE_CLOSE",e[e.LOGOUT=4]="LOGOUT",e[e.BLOCK_NEW=5]="BLOCK_NEW",e[e.REDIRECT_NEW=6]="REDIRECT_NEW"})(wr||(wr={}));var Nr,Ty=function(e,t){de.info("websocket send -> messageId: "+e.messageId);var n=e.getBufferData();t.send(n.buffer)},Ts=function(e){function t(n,r){var i=e.call(this,"websocket",r)||this;return i._runtime=n,i._socket=null,i._messageIds={},i._syncMessageIds={},i._failedCount=0,i.ALLOW_FAILED_TIMES=2,i._timer=null,i._idCount=0,i._generateMessageId=function(){return i._idCount>=65535&&(i._idCount=0),++i._idCount},i}return xt(t,e),t.prototype.connect=function(n,r,i,o,s,a){return J(this,void 0,void 0,function(){var u=this;return Q(this,function(d){return[2,new Promise(function(f){var c=[],l=0,h=!1,p=!1,m=function(){return J(u,void 0,void 0,function(){var v;return Q(this,function(_){switch(_.label){case 0:return c.length===0||h?[2]:(h=!0,[4,this._connect(n,r,c.shift(),o,s,a)]);case 1:if((v=_.sent())===D.SUCCESS)this._checkAlive(),f(v);else if(v===pn.REDIRECT)f(v);else{if(p&&c.length===0)return f($C(v)),[2];h=!1,m()}return[2]}})})};s=Cp(s),u._watcher.status(Ke.CONNECTING),sT(i,o,u._runtime,function(v){var _=v.code,y=v.finished,E=v.host;p=y,_===200&&(c.push(E),l++,m()),y&&l===0&&(de.error("No valid websocket server hosts!"),f(D.RC_SOCKET_NOT_CREATED))})})]})})},t.prototype._connect=function(n,r,i,o,s,a){return J(this,void 0,void 0,function(){var u,d,f,c,l,h=this;return Q(this,function(p){switch(p.label){case 0:return u=o.replace("http","ws"),d=aT(u,i,n,r,this._runtime,s,"",a),de.debug("conenct start -> "+d),this.sendConnectTime=Date.now(),f=this._runtime.createWebSocket(d),c=function(m){h._timer&&(clearTimeout(h._timer),h._timer=null),h._socket===f&&(h._socket=null,h._watcher.status(m))},[4,new Promise(function(m){f.onMessage(function(v){if(Object.prototype.toString.call(v)==="[object ArrayBuffer]"){var _=function(E,S){var T=new Uint8Array(E),R=new a4(T),C=R.readByte(),w=new Rp(C),L=oT(w);return L.read(R,T.length-1,S),L}(v,a);if(_ instanceof nT&&h._pingResolve)return h._pingResolve(D.SUCCESS),void(h._pingResolve=void 0);if(_ instanceof tT)return de.debug("recv connect ack -> "+_.status),_.status!==pn.ACCEPTED?(de.warn("connect failed: "+_.status),void m(_.status)):(de.info("connect success -> "+d),h.connectedTime=_.timestamp,h.userId=_.userId||"",h._idCount=_.messageId,void m(D.SUCCESS));if(_ instanceof mg){var y=_.status;switch(de.warn("recv disconnect signal -> status: "+y),y){case wr.BLOCK:h._watcher.status(Ke.BLOCKED);break;case wr.OTHER_DEVICE_LOGIN:h._watcher.status(Ke.KICKED_OFFLINE_BY_OTHER_CLIENT);break;case wr.REDIRECT_NEW:case wr.REDIRECT:h._watcher.status(Ke.REDIRECT);break;default:h._watcher.status(Ke.DISCONNECT_BY_SERVER)}}else h._onReceiveSignal(_)}else de.error("Socket received invalid data:",v)}),f.onClose(function(v,_){for(var y in de.warn("websocket closed! code:",v,"reason:",_),c(Ke.CONNECTION_CLOSED),h._messageIds){var E=h._messageIds[y];delete h._messageIds[y],E(D.RC_NET_CHANNEL_INVALID)}m(v)}),f.onError(function(v){var _;for(var y in de.error("websocket error!",(_=v)===null||_===void 0?void 0:_.stack),c(Ke.WEBSOCKET_ERROR),h._messageIds){var E=h._messageIds[y];delete h._messageIds[y],E(D.RC_NET_CHANNEL_INVALID)}m(D.NETWORK_ERROR)}),f.onOpen(function(){return de.debug("websocket open =>",d)}),setTimeout(function(){m(D.TIMEOUT)},5e3)})];case 1:return(l=p.sent())===D.SUCCESS?this._socket=f:(de.warn("connect result -> code: "+l+", url: "+d),f.close()),[2,l]}})})},t.prototype._checkAlive=function(){var n;return J(this,void 0,void 0,function(){var r,i=this;return Q(this,function(o){switch(o.label){case 0:return this._socket?(de.debug("send ping ->"),this.sendOnly(new k4),[4,new Promise(function(s){i._pingResolve=s,i._timer&&clearTimeout(i._timer),i._timer=setTimeout(function(){i._pingResolve=void 0,s(D.TIMEOUT)},15e3)})]):[2];case 1:return(r=o.sent())!==D.SUCCESS?(this._failedCount+=1,de.warn("ping failed count: "+this._failedCount+", code: "+r),this._failedCount>=this.ALLOW_FAILED_TIMES?(this._failedCount=0,de.warn("ping timeout, close current websocket to reconnect!"),(n=this._socket)===null||n===void 0||n.close(),this._watcher.status(Ke.NETWORK_UNAVAILABLE)):this._checkAlive(),[2]):(de.debug("recv pong <-"),this._failedCount=0,setTimeout(function(){return i._checkAlive()},15e3),[2])}})})},t.prototype._onReceiveSignal=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a,u,d=this;return Q(this,function(f){switch(f.label){case 0:return r=n.messageId,n.header&&n.header.qos!==Xr.AT_MOST_ONCE&&(n instanceof ja&&!n.syncMsg&&(de.debug("send pubAck -> "+r),this.sendOnly(new rT(r))),n instanceof ma&&(de.debug("send queryCon -> "+r),this.sendOnly(new iT(r)))),r>0&&(n instanceof Gf||n instanceof ma)&&(de.debug("recv ack -> messageId: "+r),(i=this._messageIds[r])&&(i(n),delete this._messageIds[r]),(o=this._syncMessageIds[r])&&(delete this._syncMessageIds[r],o(n))),n instanceof ja?(s=n.syncMsg,(a=n.topic)===Y[Y.userSetData]?[2]:!s||cT(a)?(this._watcher.signal(n),[2]):[4,new Promise(function(c){d._syncMessageIds[r]=c})]):[3,2];case 1:u=f.sent(),delete this._syncMessageIds[r],this._watcher.signal(n,u),f.label=2;case 2:return[2]}})})},t.prototype.sendOnly=function(n){this._socket&&Ty(n,this._socket)},t.prototype.send=function(n,r,i,o){return o===void 0&&(o=3e4),J(this,void 0,void 0,function(){var s,a,u,d=this;return Q(this,function(f){switch(f.label){case 0:return this._socket?(s=this._generateMessageId(),n.messageId=s,Ty(n,this._socket),[4,new Promise(function(c){d._messageIds[s]=c,setTimeout(function(){d._messageIds[s]&&delete d._messageIds[s],c()},o)})]):[3,2];case 1:return(a=f.sent())?a instanceof ma||a instanceof Gf?(u=r&&a.data?this.codec.decodeByPBName(a.data,r,i):a,a.status!==0?(de.warn("send failed -> message: "+s+", respPBName: "+r+", status: "+a.status),[2,{code:a.status,data:r&&a.data?u:null}]):[2,{code:D.SUCCESS,data:u}]):[2,{code:a}]:(de.warn("send timeout -> message: "+s+", respPBName: "+r+", timeout: "+o),[2,{code:D.TIMEOUT}]);case 2:return[2,{code:D.RC_NET_CHANNEL_INVALID}]}})})},t.prototype.close=function(){this._socket&&(this._socket.close(),this._socket=null,this._watcher.status(Ke.DISCONNECTED))},t}(XC);(function(e){e.GET="GET",e.POST="POST"})(Nr||(Nr={}));var Ss=function(e){function t(n,r){var i=e.call(this,"comet",r)||this;return i._runtime=n,i._messageIds={},i._syncMessageIds={},i._idCount=0,i._generateMessageId=function(){return++i._idCount},i._pid=encodeURIComponent(new Date().getTime()+Math.random()+""),i}return xt(t,e),t.prototype.handleCometRes=function(n){var r=this;if(n.status!==200&&n.status!==202)return!1;var i=Vn(n.data)?JSON.parse(n.data):n.data;return i?!In(i)||(Bt(i,function(o){return J(r,void 0,void 0,function(){var s,a,u,d,f,c,l,h,p,m,v,_=this;return Q(this,function(y){switch(y.label){case 0:if((s=o.sessionid)&&(this._sessionid=s),a=function(E){var S=E.headerCode,T=new Rp(S),R=oT(T);for(var C in E)R[C]=E[C];return R}(o),u=a.messageId,d=a._header,f=a.status,a.identifier,c=d&&d.qos!==Xr.AT_MOST_ONCE,u&&a.getIdentifier&&((l=this._messageIds[u])&&l(a),this._syncMessageIds[u]&&this._syncMessageIds[u](a)),c&&(a instanceof ja&&!a.syncMsg&&(h=new rT(u),this.sendOnly(h)),a instanceof ma&&(h=new iT(u),this.sendOnly(h))),a instanceof mg){switch(f){case wr.OTHER_DEVICE_LOGIN:this._watcher.status(Ke.KICKED_OFFLINE_BY_OTHER_CLIENT);break;case wr.BLOCK:this._watcher.status(Ke.BLOCKED);break;case wr.REDIRECT_NEW:case wr.REDIRECT:this._watcher.status(Ke.REDIRECT);break;default:this._watcher.status(Ke.DISCONNECT_BY_SERVER)}return[2]}return a instanceof ja?(p=a.syncMsg,m=a.topic,!p||cT(m)?(this._watcher.signal(a),[2,!1]):[4,new Promise(function(E){_._syncMessageIds[u]=E})]):[3,2];case 1:v=y.sent(),delete this._syncMessageIds[u],this._watcher.signal(a,v),y.label=2;case 2:return[2]}})})}),!0):(de.error("received data is not a validJson",i),!1)},t.prototype._startPullSignal=function(n){return J(this,void 0,void 0,function(){var r,i,o,s;return Q(this,function(a){switch(a.label){case 0:return r=new Date().getTime(),i=n+"://"+this._domain+"/pullmsg.js?sessionid="+this._sessionid+"&timestrap="+r+"&pid="+this._pid,[4,this._runtime.httpReq({url:i,body:{pid:this._pid},timeout:45e3})];case 1:return o=a.sent(),s=this.handleCometRes(o),this._isDisconnected||(s?this._startPullSignal(n):(this._isDisconnected=!0,this._watcher.status(Ke.NETWORK_UNAVAILABLE))),[2]}})})},t.prototype.connect=function(n,r,i,o,s,a){return J(this,void 0,void 0,function(){var u,d,f,c,l=this;return Q(this,function(h){return s=Cp(s),this._protocol=o,this._isDisconnected=!1,this._watcher.status(Ke.CONNECTING),u=[],d=0,f=!1,c=!1,[2,new Promise(function(p){var m=function(){return J(l,void 0,void 0,function(){var v;return Q(this,function(_){switch(_.label){case 0:return u.length===0||f?[2]:(f=!0,[4,this._connect(n,r,u.shift(),o,s)]);case 1:if((v=_.sent())===D.SUCCESS)this._startPullSignal(o),p(v);else if(v===pn.REDIRECT)p(v);else{if(c&&u.length===0)return p($C(v)),[2];f=!1,m()}return[2]}})})};l._watcher.status(Ke.CONNECTING),sT(i,o,l._runtime,function(v){var _=v.code,y=v.finished,E=v.host;c=y,_===200&&(u.push(E),d++,m()),y&&d===0&&(de.error("No valid websocket server hosts!"),p(D.RC_SOCKET_NOT_CREATED))})})]})})},t.prototype._connect=function(n,r,i,o,s){return J(this,void 0,void 0,function(){var a,u,d,f;return Q(this,function(c){switch(c.label){case 0:return a=function(l){return l.status!==200&&l.status!==202?(de.error("handle comet res -> res: "+JSON.stringify(l||{})),!1):!!l.data&&(function(h){if(sn(h))return!0;var p=!1;try{var m=JSON.parse(h);p=JSON.stringify(m)===h}catch{p=!1}return p}(l.data)?sn(l.data)?l.data:JSON.parse(l.data):(de.error("received data is not a validJson",l.data),!1))},u=aT(o,i,n,r,this._runtime,s,this._pid),this.sendConnectTime=Date.now(),de.debug("conenct start -> "+u),[4,this._runtime.httpReq({url:u,body:{pid:this._pid},timeout:5e3})];case 1:return d=c.sent(),f=a(d),this._domain=i,f&&f.status===0?(this._sessionid=f.sessionid,this.userId=f.userId,this.connectedTime=f.timestamp):de.warn("connect result -> code: "+(f==null?void 0:f.status)+", url: "+u),[2,f==null?void 0:f.status]}})})},t.prototype.sendCometData=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a,u,d,f,c,l,h;return Q(this,function(p){switch(p.label){case 0:return o=(i=this)._domain,s=i._sessionid,a=i._pid,u=n.messageId,d=n.topic,f=n.targetId,n.identifier,c=n.getHeaderFlag(),l=d?this._protocol+"://"+o+"/websocket?messageid="+u+"&header="+c+"&sessionid="+s+"&topic="+d+"&targetid="+f+"&pid="+a:this._protocol+"://"+o+"/websocket?messageid="+u+"&header="+c+"&sessionid="+s+"&pid="+a,[4,this._runtime.httpReq({url:l,method:Nr.POST,body:n.getCometData()})];case 1:return h=p.sent(),this.handleCometRes(h),[2]}})})},t.prototype.sendOnly=function(n){this.sendCometData(n)},t.prototype.send=function(n,r,i,o){return o===void 0&&(o=3e4),J(this,void 0,void 0,function(){var s,a,u,d=this;return Q(this,function(f){switch(f.label){case 0:return s=this._generateMessageId(),n.messageId=s,this.sendCometData(n),[4,new Promise(function(c){d._messageIds[s]=c,setTimeout(function(){delete d._messageIds[s],c()},o)})];case 1:return(a=f.sent())?(u=r&&a.data?this.codec.decodeByPBName(a.data,r,i):a,a.status!==0?[2,{code:a.status,data:r&&a.data?u:null}]:[2,{code:D.SUCCESS,data:u}]):[2,{code:D.TIMEOUT}]}})})},t.prototype.close=function(){this._isDisconnected=!0,this._watcher.status(Ke.DISCONNECTED)},t}(XC),D4=function(e,t,n){this.runtime=e,this._watcher=t,this._options=n,this.currentUserId="",this._appkey=this._options.appkey,this._apiVer=this._options.apiVersion,this.navi=this._createNavi()},Td=function(e){return["navi",e].join("_")},U4=function(){function e(t,n){this._runtime=t,this._options=n,this._naviInfo=null,this._appkey=this._options.appkey,this._apiVersion=Cp(this._options.apiVersion)}return e.prototype.getInfo=function(t,n,r,i){return J(this,void 0,void 0,function(){var o,s;return Q(this,function(a){switch(a.label){case 0:return r&&this._clear(t),(o=function(u,d,f){var c,l,h=Td(u);try{var p=f.getItem(h);l=p?JSON.parse(p):[]}catch{l=[]}var m=Date.now();return l.length>0&&(l=l.filter(function(v){return m-v.timestamp<72e5})),l.length===0?f.removeItem(h):f.setItem(h,JSON.stringify(l)),((c=l.find(function(v){return v.token===d}))===null||c===void 0?void 0:c.naviInfo)||null}(this._appkey,t,this._runtime.localStorage))?(this._naviInfo=o,[2,o]):(s=this._options.navigators.slice(),n.length&&n.forEach(function(u){s.indexOf(u)<0&&s.unshift(u)}),[4,this._reqNavi(s,this._appkey,t,i)]);case 1:return(o=a.sent())?(this._naviInfo=o,this.setNaviInfo2Cache(t,o),[2,o]):[2,o]}})})},e.prototype.setNaviInfo2Cache=function(t,n){this._naviInfo=n,function(r,i,o,s){var a,u=Td(r);try{var d=s.getItem(u);a=d?JSON.parse(d):[]}catch{a=[]}var f=Date.now();a.length>0&&(a=a.filter(function(c){return f-c.timestamp<72e5&&i!==c.token})),a.push({timestamp:f,naviInfo:o,token:i}),s.setItem(u,JSON.stringify(a))}(this._appkey,t,n,this._runtime.localStorage)},e.prototype.getInfoFromCache=function(t){return this._naviInfo},e.prototype._clear=function(t){(function(n,r,i){var o,s=Td(n);try{var a=i.getItem(s);o=a?JSON.parse(a):[]}catch{o=[]}var u=Date.now();o.length>0&&(o=o.filter(function(d){return u-d.timestamp<72e5&&r!==d.token})),o.length===0?i.removeItem(s):i.setItem(s,JSON.stringify(o))})(this._appkey,t,this._runtime.localStorage)},e}(),Lc=function(e,t,n){return[e,t,n].join("_")},$4=function(){function e(t,n){this._runtime=t,this._appkey=n,this._users={}}return e.prototype._getMemData=function(t){return this._users[t]||(this._users[t]={inboxTime:0,outboxTime:0})},e.prototype.setInboxTime=function(t,n){var r=this._getMemData(n);if(!(r.inboxTime>t)){r.inboxTime=t;var i=Lc("inbox",this._appkey,n);this._runtime.localStorage.setItem(i,t.toString())}},e.prototype.getInboxTime=function(t){var n=this._getMemData(t);if(n.inboxTime===0){var r=Lc("inbox",this._appkey,t);n.inboxTime=parseInt(this._runtime.localStorage.getItem(r))||0}return n.inboxTime},e.prototype.setOutboxTime=function(t,n){var r=this._getMemData(n);if(!(r.outboxTime>=t)){r.outboxTime=t;var i=Lc("outbox",this._appkey,n);this._runtime.localStorage.setItem(i,t.toString())}},e.prototype.getOutboxTime=function(t){var n=this._getMemData(t);if(n.outboxTime===0){var r=Lc("outbox",this._appkey,t);n.outboxTime=parseInt(this._runtime.localStorage.getItem(r))||0}return n.outboxTime},e}(),Sd={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},x4=function(){function e(t,n){this._kvCaches={},this._chatroomId=t,this._currentUserId=n}return e.prototype._add=function(t){var n=t.key;t.isDeleted=!1,this._kvCaches[n]=t},e.prototype._remove=function(t){var n=t.key,r=this._kvCaches[n];r&&(r.isDeleted=!0,this._kvCaches[n]=r)},e.prototype._setEntry=function(t,n){var r=t.key,i=t.type,o=t.isOverwrite,s=t.userId,a=this._getSetUserId(r),u=i===Pn.DELETE,d=a===s,f=!this._isExisted(r),c=u?this._remove:this._add;(n||o||d||f)&&c.call(this,t)},e.prototype.getValue=function(t){var n=this._kvCaches[t]||{};return n.isDeleted?null:n.value},e.prototype.getAllValue=function(){var t={};for(var n in this._kvCaches)this._kvCaches[n].isDeleted||(t[n]=this._kvCaches[n].value);return t},e.prototype._getSetUserId=function(t){return(this._kvCaches[t]||{}).userId},e.prototype._isExisted=function(t){var n=this._kvCaches[t]||{},r=n.value,i=n.isDeleted;return r&&!i},e.prototype.setEntries=function(t){var n=this,r=t.kvEntries,i=t.isFullUpdate;r=r||[],(i=i||!1)&&this.clear(),r.forEach(function(o){n._setEntry(o,i)}),de.debug("end setEntries")},e.prototype.clear=function(){this._kvCaches={}},e}(),B4=function(){function e(t){this._pullQueue=[],this._isPulling=!1,this._storeCaches={},this._engine=t}return e.prototype._startPull=function(){return J(this,void 0,void 0,function(){var t,n,r,i,o,s,a;return Q(this,function(u){switch(u.label){case 0:return this._isPulling||this._pullQueue.length===0?[2]:(this._isPulling=!0,t=this._pullQueue.splice(0,1)[0],n=t.chrmId,r=t.timestamp,(i=Sd.get(n))>r?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(n,i)]);case 1:return o=u.sent(),s=o.code,a=o.data,this._isPulling=!1,s===D.SUCCESS?(Sd.set(n,a.syncTime||0),this._startPull()):this._startPull(),[2]}})})},e.prototype.reset=function(t){Sd.clear(t);var n=this._storeCaches[t];n&&n.clear()},e.prototype.pullEntry=function(t,n){this._pullQueue.push({chrmId:t,timestamp:n}),this._startPull()},e.prototype.setLocal=function(t,n,r){var i=this._storeCaches[t];pa(i)||(i=new x4(t,r)),i.setEntries(n),this._storeCaches[t]=i},e.prototype.getValue=function(t,n){var r=this._storeCaches[t];return r?r.getValue(n):null},e.prototype.getAll=function(t){var n=this._storeCaches[t],r={};return n&&(r=n.getAllValue()),r},e}(),F4=function(){function e(t,n,r,i){this._runtime=t,this._appkey=n,this._userId=r,this._canJoinMulipleChrm=i,this._sessionKey="",this._joinedChrmsInfo={},this._sessionKey="sync-chrm-"+this._appkey+"-"+this._userId}return e.prototype.set=function(t,n){n===void 0&&(n=10),!this._canJoinMulipleChrm&&(this._joinedChrmsInfo={}),this._joinedChrmsInfo[t]=n,this._runtime.sessionStorage.setItem(this._sessionKey,JSON.stringify(this._joinedChrmsInfo))},e.prototype.get=function(){var t,n;try{n=this._runtime.sessionStorage.getItem(this._sessionKey),t=JSON.parse(n||"{}")}catch{de.error("parse rejoined chrm infos error -> "+n),t={}}return t},e.prototype.remove=function(t){delete this._joinedChrmsInfo[t],pa(this._joinedChrmsInfo)?this._runtime.sessionStorage.setItem(this._sessionKey,JSON.stringify(this._joinedChrmsInfo)):this.clear()},e.prototype.clear=function(){this._joinedChrmsInfo={},this._runtime.sessionStorage.removeItem(this._sessionKey)},e}(),Rd="converStatusChanged",V4=function(){function e(t,n,r){this._eventEmitter=new rc,this._pullQueue=[],this._isPulling=!1,this._storage=gl(t.runtime),this._appkey=n,this._currentUserId=r,this._engine=t,this._storagePullTimeKey="con-s-"+n+"-"+r}return e.prototype._set=function(t){var n=this;if(!mt(t)&&Array.isArray(t)){var r=this._storage.get(this._storagePullTimeKey)||0,i=t.length;t.forEach(function(o,s){var a=o.updatedTime||0;r=a>r?a:r,o.conversationType=o.type,n._eventEmitter.emit(Rd,{statusItem:o,isLastPull:s===i-1})}),this._storage.set(this._storagePullTimeKey,r)}},e.prototype._startPull=function(){return J(this,void 0,void 0,function(){var t,n,r,i;return Q(this,function(o){switch(o.label){case 0:return this._isPulling||this._pullQueue.length===0?[2]:(this._isPulling=!0,t=this._pullQueue.splice(0,1)[0],[4,this._engine.pullConversationStatus(t)]);case 1:return n=o.sent(),r=n.code,i=n.data,r===D.SUCCESS?(this._isPulling=!1,this._set(i),this._startPull()):this._startPull(),[2]}})})},e.prototype.pull=function(t){var n=this._storage.get(this._storagePullTimeKey)||0;(t>n||t===0)&&(this._pullQueue.push(n),this._startPull())},e.prototype.watch=function(t){this._eventEmitter.on(Rd,function(n){t(n)})},e.prototype.unwatch=function(){this._eventEmitter.off(Rd,function(t){})},e}(),Xi={c:{keyName:"unreadMessageCount",defaultVal:0},hm:{keyName:"hasMentioned",defaultVal:!1},m:{keyName:"mentionedInfo",defaultVal:null},t:{keyName:"lastUnreadTime",defaultVal:0},nc:{keyName:"notificationStatus",defaultVal:2},to:{keyName:"isTop",defaultVal:!1},tg:{keyName:"tags",defaultVal:{}},mc:{keyName:"unreadMentionedCount",defaultVal:0}},tu={};for(var Sy in Xi){var j4=Xi[Sy].keyName;tu[j4]=Sy}var Fs,H4=function(){function e(t,n,r){this._appkey=n,this._currentUserId=r;var i="con-"+n+"-"+r;this.storage=new ny(t,i),this._localStore=new ny(t,"CONVER-"+n+"-"+r)}return e.prototype._getStoreKey=function(t,n,r){return r+"_"+t+"_"+n},e.prototype._getConOptionByKey=function(t){var n=(t=t||"").split("_");if(n.length>=2){var r=n.shift(),i=n.shift(),o=n.join("_");return{conversationType:Number(i),targetId:o,channelId:r}}return{conversationType:$e.PRIVATE,targetId:"",channelId:""}},e.prototype.updateMentionedData=function(t){var n=this,r=t.conversationType,i=t.targetId,o=t.messageType,s=t.isMentioned,a=t.content,u=t.senderUserId,d=t.channelId,f=this._getStoreKey(r,i,d),c=this._localStore.get(f)||{},l=tu.mentionedInfo,h=tu.hasMentioned,p=c[l]||{},m=p.userIdList||[],v=a.mentionedInfo;if(v){if(s&&r===$e.GROUP&&((v.userIdList||[]).forEach(function(y){y===n._currentUserId&&m.indexOf(u)<0&&m.push(u)}),v.type===Sp.ALL&&m.indexOf(u)<0&&m.push(u)),o===mn.RECALL&&r===$e.GROUP){var _=m.indexOf(u);_>=0&&m.splice(_,1)}v={userIdList:m,type:(v==null?void 0:v.type)||p.type},m.length!==0?(c[l]=v,c[h]=!0):(delete c[l],delete c[h]),pa(c)?this._localStore.set(f,c):this._localStore.remove(f)}},e.prototype.set=function(t,n,r,i){var o=this._getStoreKey(t,n,i),s=this._localStore.get(o)||{};for(var a in r){var u=tu[a],d=r[a];if(!mt(u)&&!mt(d)&&a!=="hasMentioned"&&a!=="MentionedInfo"){if(d===Xi[u].defaultVal||a==="tags"&&!pa(d))delete s[u];else if(a==="tags"){var f=d;for(var c in f)f[c].isTop||delete f[c].isTop;s[u]=d}else s[u]=d;s.c||(delete s.t,delete s.hm,delete s.m,delete s.mc)}}pa(s)?this._localStore.set(o,s):this._localStore.remove(o)},e.prototype.get=function(t,n,r){r===void 0&&(r="");var i=this._getStoreKey(t,n,r),o=this._localStore.get(i)||{},s={};for(var a in Xi){var u=Xi[a],d=u.keyName,f=u.defaultVal;s[d]=o[a]||eu(f)}return s},e.prototype.getValue=function(t){var n=this._localStore.getValues()||{},r=[];for(var i in n){var o=this._getConOptionByKey(i),s={conversationType:o.conversationType,targetId:o.targetId,channelId:o.channelId},a=n[i];for(var u in a){var d=Xi[u],f=d.keyName,c=d.defaultVal;s[f]=a[u]||eu(c)}s=t?t(s):s,r.push(s)}return r},e.prototype.getValueForTag=function(){var t=this._localStore.getValues()||{},n={};for(var r in t){var i=this._getConOptionByKey(r),o=i.conversationType,s=i.targetId,a={},u=t[r];for(var d in u){var f=Xi[d],c=f.keyName,l=f.defaultVal;a[c]=u[d]||eu(l)}for(var h in a.tags){mt(n[h])&&(n[h]=[]);var p=Object.assign({},a,{conversationType:o,targetId:s});delete p.tags,n[h].push(p)}}return n},e.prototype.adaptOldStore=function(){try{var t=this.storage.getValues();if(Object.keys(t).length===0)return;for(var n in t){var r="_"+n;this._localStore.set(r,t[n])}}catch(i){de.error("adaptOldStore error: "+i.message)}},e}(),q4=[$e.PRIVATE,$e.GROUP,$e.SYSTEM,$e.PUBLIC_SERVICE,$e.APP_PUBLIC_SERVICE],Ry="conversationChanged",by="conTagStatusChanged",K4=function(){function e(t,n,r,i,o){var s=this;this._updatedConversations={},this._conTagStatusChanged=!1,this._eventEmitter=new rc,this._draftMap={},this._appkey=n,this._loginUserId=r,this._store=new H4(t.runtime,n,r),this._statusManager=new V4(t,n,r),this._statusManager.watch(function(a){var u=a.statusItem,d=a.isLastPull;s.addStatus(u,d)}),this._eventEmitter.on(Ry,function(a){i(a)}),this._eventEmitter.on(by,function(){o()})}return e.prototype._calcUnreadCount=function(t,n){var r=t.content,i=t.messageType,o=t.sentTime,s=t.isCounted,a=t.messageDirection,u=t.senderUserId,d=a===Qn.SEND&&u===this._loginUserId,f=i===mn.RECALL,c=sn(r),l=!1,h={},p=n.lastUnreadTime||0,m=n.unreadMessageCount||0;return p>o||d?{hasChanged:l,localConversation:n,updateItems:h}:(s&&(n.unreadMessageCount=m+1,n.lastUnreadTime=o,l=!0),f&&c&&p>=r.sentTime&&m&&(n.unreadMessageCount=m-1,l=!0),l&&(h.unreadMessageCount={val:n.unreadMessageCount,time:o}),{hasChanged:l,localConversation:n,updateItems:h})},e.prototype._calcMentionedInfo=function(t,n){var r=t.content,i=(t.messageDirection,t.isMentioned),o=t.sentTime;Qn.SEND;var s=sn(r),a=!1,u={};return i&&s&&r.mentionedInfo&&(n.hasMentioned=!0,a=!0,u.hasMentioned={val:!0,time:o},u.mentionedInfo={val:r.mentionedInfo,time:o}),{hasChanged:a,localConversation:n,updateItems:u}},e.prototype._calcMentionedCount=function(t,n){var r=t.content,i=t.messageDirection,o=!1;if(t.isMentioned&&i===Qn.RECEIVE&&(r==null?void 0:r.mentionedInfo)){var s=r.mentionedInfo,a=s.type,u=s.userIdList;if(a===Sp.ALL||(u||[]).includes(this._loginUserId)){o=!0;var d=n.unreadMentionedCount||0;n.unreadMentionedCount=d+1}}return{hasChanged:o,localConversation:n}},e.prototype._setUpdatedConversation=function(t){if(sn(t)){var n=t.conversationType,r=t.targetId,i=t.channelId,o=n+"_"+r,s=this._store.get(n,r,i)||{};this._updatedConversations[o]=Object.assign(s,t)}},e.prototype._setConTagStatusChanged=function(t,n,r,i){var o=(this._store.get(t,n,i)||{}).tags||{};if(Object.keys(o).length===Object.keys(r).length){for(var s in o)if(!r[s]||o[s].isTop!==r[s].isTop)return void(this._conTagStatusChanged=!0)}else this._conTagStatusChanged=!0},e.prototype.addStatus=function(t,n){var r=t.conversationType,i=t.targetId,o=t.updatedTime,s=t.notificationStatus,a=t.isTop,u=t.tags,d=t.channelId,f={},c={};mt(s)||(c.notificationStatus={time:o,val:s}),mt(a)||(c.isTop={time:o,val:a}),mt(u)||(c.tags={time:o,val:u},u==null||u.forEach(function(l){f[l.tagId]={isTop:l.isTop}})),this._setConTagStatusChanged(r,i,f,d),this._store.set(r,i,{notificationStatus:s,isTop:a,tags:f},d),this._setUpdatedConversation({conversationType:r,targetId:i,updatedItems:c,channelId:d}),n&&this._notifyConversationChanged()},e.prototype._notifyConversationChanged=function(){var t=[];for(var n in this._updatedConversations)t.push(this._updatedConversations[n]);t.length!==0&&(this._eventEmitter.emit(Ry,t),this._updatedConversations={},this._conTagStatusChanged&&(this._eventEmitter.emit(by),this._conTagStatusChanged=!1))},e.prototype.setConversationCacheByMessage=function(t,n){var r=this,i=t.conversationType,o=t.isPersited,s=t.targetId,a=t.channelId;if(q4.indexOf(i)>=0){var u=!1,d=this._store.get(i,s,a),f={};if([this._calcUnreadCount,this._calcMentionedInfo,this._calcMentionedCount].forEach(function(h){var p=h.call(r,t,d),m=p.hasChanged,v=p.localConversation,_=p.updateItems;u=u||m,f=Rt(Rt({},f),_),d=eu(v)}),u&&this._store.set(i,s,d,a),this._store.updateMentionedData(t),o){var c=this._store.get(i,s,a);c.updatedItems=Rt({latestMessage:{time:t.sentTime,val:t}},f),c.latestMessage=t;var l=Object.assign(c,{conversationType:i,targetId:s,channelId:a});this._setUpdatedConversation(l)}(u||o)&&this._notifyConversationChanged()}},e.prototype.get=function(t,n,r){return r===void 0&&(r=""),this._store.get(t,n,r)},e.prototype.getAllUnreadCount=function(t,n,r){var i=this._store.getValue(),o=0;return i.forEach(function(s){var a=s.unreadMessageCount,u=s.notificationStatus,d=s.conversationType;a=a||0,(r||u!==1)&&(n.length>0?n.includes(Number(d))&&(o+=Number(a)):o+=Number(a))}),o},e.prototype.getUnreadCountByTag=function(t,n){var r=this._store.getValueForTag()[t]||[],i=0;return r.forEach(function(o){var s=o.unreadMessageCount,a=o.notificationStatus;(n||a!==1)&&(s=s||0,i+=Number(s))}),i},e.prototype.getUnreadCount=function(t,n,r){return this._store.get(t,n,r).unreadMessageCount||0},e.prototype.clearUnreadCount=function(t,n,r,i){i===void 0&&(i=!0);var o=this._store.get(t,n,r),s=o.unreadMessageCount,a=o.hasMentioned,u={};if(s&&(o.unreadMessageCount=0,u.unreadMessageCount={val:0,time:Date.now()}),a&&(o.hasMentioned=!1,o.unreadMentionedCount=0,o.mentionedInfo=void 0,u.hasMentioned={val:!1,time:Date.now()},u.mentionedInfo={val:void 0,time:Date.now()}),this._store.set(t,n,o,r),i&&Object.keys(u).length!==0){var d=Object.assign(o,{conversationType:t,targetId:n,channelId:r,updatedItems:u});this._setUpdatedConversation(d),this._notifyConversationChanged()}},e.prototype.clearAllUnreadCount=function(){var t=this;this._store.getValue().forEach(function(n){n.unreadMessageCount&&(n.unreadMessageCount=0,t._store.set(n.conversationType,n.targetId,n,n.channelId))})},e.prototype.startPullConversationStatus=function(t){this._statusManager.pull(t)},e.prototype.setDraft=function(t,n,r,i){var o=t+"_"+n+"_"+i;this._draftMap[o]=r},e.prototype.getDraft=function(t,n,r){var i=t+"_"+n+"_"+r;return this._draftMap[i]},e.prototype.clearDraft=function(t,n,r){var i=t+"_"+n+"_"+r;delete this._draftMap[i]},e.prototype.addTagStatus=function(t,n,r,i){i===void 0&&(i="");var o=this._store.get(t,n,i).tags;o=Object.assign(o,r),this._store.set(t,n,{tags:o},i)},e.prototype.deleteTagStatus=function(t,n,r,i){i===void 0&&(i="");var o=this._store.get(t,n,i).tags;r.forEach(function(s){delete o[s]}),this._store.set(t,n,{tags:o},i)},e.prototype.getConversationListForTag=function(){return this._store.getValueForTag()},e.prototype.getBlockConversationList=function(){return this._store.getValue().filter(function(t){return t.notificationStatus===Fo.OPEN}).map(function(t){return{conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}})},e.prototype.getTopConversationList=function(){return(this._store.getValue()||{}).filter(function(t){return t.isTop}).map(function(t){return{conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}})},e.prototype.adaptOldStore=function(){this._store.adaptOldStore()},e.prototype.getUnreadMentionedCount=function(t,n,r){return t===void 0&&(t=""),this.get(n,r,t).unreadMentionedCount||0},e.prototype.getAllUnreadMentionedCount=function(){var t=this._store.getValue(),n=0;return t.forEach(function(r){var i=r.unreadMentionedCount;i=i||0,n+=Number(i)}),n},e}(),G4=function(){function e(t,n,r,i){this._pullQueue=[],this._isPulling=!1,this._storageTagKey="tag-"+n+"-"+r,this._storagePullTimeKey="us-s-"+n+"-"+r,this._storage=gl(t.runtime),this._engine=t,this._tagWatcherFunc=i}return e.prototype._updateTag=function(t){var n=t.tags,r={};n.forEach(function(i){r[i.tagId]={tagName:i.tagName,createdTime:i.createdTime}}),this._storage.set(this._storageTagKey,r),this._tagWatcherFunc()},e.prototype.addTag=function(t,n){var r=this._storage.get(this._storageTagKey)||{};t.forEach(function(i){var o,s=((o=r[i.tagId])===null||o===void 0?void 0:o.createdTime)||i.createdTime||0;r[i.tagId]={tagName:i.tagName,createdTime:s}}),this._storage.set(this._storageTagKey,r),this._storage.set(this._storagePullTimeKey,n)},e.prototype.deleteTag=function(t,n){var r=this._storage.get(this._storageTagKey)||{};t.forEach(function(i){delete r[i]}),this._storage.set(this._storageTagKey,r),this._storage.set(this._storagePullTimeKey,n)},e.prototype.getTagsInfo=function(){return this._storage.get(this._storageTagKey)||{}},e.prototype.getTags=function(){var t=this._storage.get(this._storageTagKey)||{},n=[];for(var r in t)n.push({tagId:r,tagName:t[r].tagName,createdTime:t[r].createdTime,conversationCount:0});return n.sort(function(i,o){return(i.createdTime||0)-(o.createdTime||0)})},e.prototype.getTagById=function(t){var n=this._storage.get(this._storageTagKey)||{};return n[t]?{tagId:t,tagName:n[t].tagName,createdTime:n[t].createdTime,conversationCount:0}:null},e.prototype._startPull=function(){return J(this,void 0,void 0,function(){var t,n,r,i,o,s,a,u;return Q(this,function(d){switch(d.label){case 0:return this._isPulling||this._pullQueue.length===0?[2]:(this._isPulling=!0,t=this._pullQueue.splice(0,1)[0],[4,this._engine.pullUserSettings(t)]);case 1:return n=d.sent(),r=n.code,i=n.data,r!==D.SUCCESS||mt(i)?(this._isPulling=!1,this._startPull()):(s=(o=i).settings,a=o.version,u=s.Tag,mt(u)||this._updateTag(u),this._storage.set(this._storagePullTimeKey,a),this._isPulling=!1,this._startPull()),[2]}})})},e.prototype.pullUserSettings=function(t){var n=this._storage.get(this._storagePullTimeKey)||0;(t>n||t===0)&&(this._pullQueue.push(n),this._startPull())},e.prototype.getVersion=function(){return this._storage.get(this._storagePullTimeKey)||0},e}(),z4=function(e){function t(n,r){var i=e.call(this,n,r)||this;return i._miniConnectUrl="",i._connectType=r.connectionType,i}return xt(t,e),t.prototype._formatJSONPUrl=function(n,r,i,o){return n+"/"+(this._runtime.isSupportSocket()&&this._connectType==="websocket"?"navi":"cometnavi")+".js?appId="+i+"&token="+encodeURIComponent(r)+"&callBack="+o+"&v="+this._apiVersion+"&r="+Date.now()},t.prototype.getInfo=function(n,r,i){var o;return J(this,void 0,void 0,function(){var s;return Q(this,function(a){return this._runtime.useNavi||(s=void 0,s=this._runtime.isSupportSocket()&&this._connectType==="websocket"?z3.join(","):Y3.join(","),this._miniConnectUrl=((o=this._options.miniCMPProxy)===null||o===void 0?void 0:o.length)?this._options.miniCMPProxy.join(","):s||"",r=[]),[2,e.prototype.getInfo.call(this,n,r,i)]})})},t.prototype._reqNavi=function(n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d,f,c,l,h;return Q(this,function(p){switch(p.label){case 0:o="getServerEndpoint",s=0,a=n.length,p.label=1;case 1:return s<a?(u=this._formatJSONPUrl(n[s],i,r,o),de.debug("req navi => "+u),[4,this._runtime.httpReq({url:u,timeout:1e4,dataType:"text"})]):[3,4];case 2:if((d=p.sent()).status!==200)return d.status===403?de.error("request navi error: "+D.RC_CONN_USER_OR_PASSWD_ERROR):d.status===401&&de.error("request navi error: "+D.RC_CONN_APP_BLOCKED_OR_DELETED),[3,3];try{return f=d.data.match(/{[\d\D]+}/),(c=f&&f[0]?f[0]:"").indexOf('{\\"code\\":')===0&&(c=JSON.parse('"'+c+'"')),h=JSON.parse(c),l=/^https/.test(u)?"https":"http",h.protocol=l,this._runtime.useNavi||(h.server="",h.backupServer=this._miniConnectUrl,h.logSwitch=0),[2,h]}catch(m){de.error("parse navi err =>",m)}p.label=3;case 3:return s+=1,[3,1];case 4:return this._runtime.useNavi?[2,null]:[2,h={code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,uploadServer:"https://upload.qiniup.com",bosAddr:"https://gz.bcebos.com",location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:0,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:this._miniConnectUrl}]}})})},t}(U4),Y4=function(){function e(t){this._pullQueue=[],this._isPulling=!1,this._pullTime=0,this._engine=t}return e.prototype._startPull=function(){return J(this,void 0,void 0,function(){var t,n,r,i,o,s,a;return Q(this,function(u){switch(u.label){case 0:return this._isPulling||this._pullQueue.length===0?[2]:(this._isPulling=!0,t=this._pullQueue.splice(0,1)[0],n=t.roomId,r=t.timestamp,(i=this._pullTime)>r?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(n,i)]);case 1:return o=u.sent(),s=o.code,a=o.data,s===D.SUCCESS?(this._isPulling=!1,this._pullTime=a.syncTime||0,this._startPull()):this._startPull(),[2]}})})},e.prototype.pullEntry=function(t,n){this._pullQueue.push({roomId:t,timestamp:n}),this._startPull()},e.prototype.reset=function(){this._pullTime=0,this._isPulling=!1},e}(),bd=function(e,t){return["send_msg",e,t].join("_")},W4=function(){function e(t,n){this._runtime=t,this._appkey=n,this._sendMessageMap={},this._userId=""}return e.prototype.init=function(t){this._userId=t;var n=bd(this._appkey,t);this._sendMessageMap=this._getLocalInfo(n)},e.prototype._getLocalInfo=function(t){var n=this._runtime.localStorage.getItem(t);try{return n?JSON.parse(n):{}}catch{return{}}},e.prototype.setMessage=function(t,n){this._sendMessageMap[t]=n;var r=bd(this._appkey,this._userId),i=this._getLocalInfo(r);i[t]=n,this._runtime.localStorage.setItem(r,JSON.stringify(i))},e.prototype.getSendMessageMap=function(){return this._sendMessageMap},e.prototype.removeByUID=function(t){delete this._sendMessageMap[t]},e.prototype.removeByTimestamp=function(t){var n=bd(this._appkey,this._userId),r=this._getLocalInfo(n);Object.keys(r).forEach(function(i){r[i]<t&&delete r[i]}),this._runtime.localStorage.setItem(n,JSON.stringify(r))},e}(),uT=function(e){var t="RCDeviceId",n=gl(e),r="",i=n.get(t);return i?r=i:(r=DC(),n.set(t,r)),r};(Fs={})[$e.PRIVATE]=Y.qryPMsg,Fs[$e.GROUP]=Y.qryGMsg,Fs[$e.CHATROOM]=Y.qryCHMsg,Fs[$e.CUSTOMER_SERVICE]=Y.qryCMsg,Fs[$e.SYSTEM]=Y.qrySMsg;var J4=[Y[Y.recallMsg],Y[Y.ppMsgS],Y[Y.pgMsgS],Y[Y.ppMsgP],Y[Y.pgMsgP],Y[Y.chatMsg],Y[Y.pcMsgP],Y[Y.prMsgS]],Id=function(e,t,n,r,i,o){return{conversationType:e,targetId:t,senderUserId:o,messageDirection:Qn.SEND,isCounted:!!n.isCounted,isMentioned:!!n.isMentioned,content:n.content,messageType:n.messageType,isOffLineMessage:!1,isPersited:!!n.isPersited,messageUId:r,sentTime:i,receivedTime:0,disableNotification:!!n.disableNotification,isStatusMessage:!!n.isStatusMessage,canIncludeExpansion:!!n.canIncludeExpansion,expansion:n.canIncludeExpansion?n.expansion:null,receivedStatus:Da.UNREAD,pushConfig:n.pushConfig,channelId:n.channelId}},Q4=function(e){function t(n,r,i){var o=e.call(this,n,r,i)||this;return o._customMessageType={},o._reconnectTimer=-1,o._pullOfflineFinished=!1,o._connectedTime=0,o._localConnectedTime=0,o._pullingMsg=!1,o._pullQueue=[],o._chrmsQueue={},o._latestSyncTimestamp=0,o._intervalTimer=-1,o._letterbox=new $4(n,i.appkey),o._sendMessageStore=new W4(n,i.appkey),o._chrmEntryHandler=new B4(o),o}return xt(t,e),t.prototype._createNavi=function(){return new z4(this.runtime,this._options)},t.prototype.getConnectedTime=function(){return this._connectedTime},t.prototype.connect=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a,u,d=this;return Q(this,function(f){switch(f.label){case 0:return i=[],this._naviInfo=r,r.server?i.push(r.server):de.warn("navi.server is invalid"),(o=r.backupServer)&&o.split(",").forEach(function(c){i.indexOf(c)<0&&i.push(c)}),i.length===0?(de.error("navi invaild.",i),[2,D.UNKNOWN]):(s=this.runtime.createDataChannel({status:function(c){d._connectionStatusHandler(c,n,i,r.protocol)},signal:this._signalHandler.bind(this)},this._options.connectionType),a=io.V3,r.openAnti===1&&(a=io.V4),[4,s.connect(this._appkey,n,i,r.protocol,this._apiVer,a)]);case 1:return(u=f.sent())===D.SUCCESS?(this._channel=s,this.currentUserId=s.userId,this._connectedTime=s.connectedTime,this._localConnectedTime=Math.floor((Date.now()+s.sendConnectTime)/2),this._watcher.status(Ke.CONNECTED),this._pullOfflineFinished=!1,this._conversationManager=new K4(this,this._appkey,this.currentUserId,this._watcher.conversation,this._watcher.conversationTag),this._conversationManager.startPullConversationStatus(0),this._userSettingManager=new G4(this,this._appkey,this.currentUserId,this._watcher.tag),this._userSettingManager.pullUserSettings(0),this._sendMessageStore.init(this.currentUserId),this._conversationManager.adaptOldStore(),this._rtcKVManager=new Y4(this),this._joinedChrmManager=new F4(this.runtime,this._appkey,this.currentUserId,r.joinMChrm),this._startSyncInterval()):s.close(),[2,u]}})})},t.prototype._connectionStatusHandler=function(n,r,i,o){if(de.warn("connection status changed:",n),n!==Ke.CONNECTING)if(n!==Ke.CONNECTED){if(this._channel&&n!==Ke.DISCONNECTED)return n===Ke.BLOCKED||n===Ke.KICKED_OFFLINE_BY_OTHER_CLIENT||n===Ke.DISCONNECT_BY_SERVER?(this.disconnect(),void this._watcher.status(n)):void(n!==Ke.REDIRECT?(this._watcher.status(n),this._try2Reconnect(r,i,o)):this._watcher.status(n));this._watcher.status(n)}else this._watcher.status(n);else this._watcher.status(n)},t.prototype._try2Reconnect=function(n,r,i){return J(this,void 0,void 0,function(){var o,s=this;return Q(this,function(a){switch(a.label){case 0:return this._channel?(o=io.V3,this._naviInfo.openAnti===1&&(o=io.V4),[4,this._channel.connect(this._appkey,n,r,i,this._apiVer,o)]):[2];case 1:return a.sent()===D.SUCCESS?(this._pullOfflineFinished=!1,this._startSyncInterval(),this._watcher.status(Ke.CONNECTED),this._rejoinChrm(),de.__insertLogIntoDatabase(),[2]):(this._watcher.status(Ke.WEBSOCKET_UNAVAILABLE),this._reconnectTimer=setTimeout(function(){s._reconnectTimer=-1,s._try2Reconnect(n,r,i)},5e3),[2])}})})},t.prototype._signalHandler=function(n,r){var i=n.syncMsg,o=n.topic;if(i)this._receiveSyncMsg(n,r);else{var s=Y[o];if(s)switch(s){case Y.s_ntf:de.info("recv s_ntf -> signal.messageId: "+n.messageId),this._pullMsg(n);break;case Y.s_msg:this._receiveMsg(n);break;case Y.s_cmd:this._receiveStateNotify(n);break;case Y.s_us:this._receiveSettingNotify(n);break;case Y.rtc_ntf:this._receiveRtcKv(n)}else de.error("unknown topic:",o)}},t.prototype._receiveStateNotify=function(n){var r,i=(r=this._channel)===null||r===void 0?void 0:r.codec.decodeByPBName(n.data,Mu),o=i.time,s=i.type,a=i.chrmId;switch(s){case 2:this._chrmEntryHandler.pullEntry(a,o);break;case 3:this._conversationManager.startPullConversationStatus(o);break;case 4:this._chrmEntryHandler.reset(a),this._watcher.chatroom({chatroomDestroyed:n.targetId})}},t.prototype._receiveSettingNotify=function(n){var r,i=((r=this._channel)===null||r===void 0?void 0:r.codec.decodeByPBName(n.data,Tl)).version;this._userSettingManager.pullUserSettings(i)},t.prototype._receiveRtcKv=function(n){var r,i=(r=this._channel)===null||r===void 0?void 0:r.codec.decodeByPBName(n.data,ug),o=i.time,s=i.type,a=i.roomId;switch(s){case 1:this._rtcKVManager.pullEntry(a,o)}},t.prototype._receiveMessageExpansion=function(n){var r=n.content,i=r.put,o=r.del,s=r.mid;i&&this._watcher.expansion({updatedExpansion:{messageUId:s,expansion:i}}),o&&this._watcher.expansion({deletedExpansion:{messageUId:s,deletedKeys:o}})},t.prototype._receiveSyncMsg=function(n,r){var i;if(J4.includes(n.topic)){var o=(i=this._channel)===null||i===void 0?void 0:i.codec.decodeByPBName(n.data,$a,{currentUserId:this.currentUserId,signal:n});o=this._handleMsgProperties(o),r&&(o.sentTime=r.timestamp,o.messageUId=r.messageUId),this._pullingMsg?this._pullQueue.push((r==null?void 0:r.timestamp)||o.sentTime):(r&&this._sendMessageStore.setMessage(r.messageUId,r.timestamp),o.messageType!==mn.EXPANSION_NOTIFY?(o.messageType===mn.SYNC_READ_STATUS&&this._conversationManager.clearUnreadCount(o.conversationType,o.targetId,o.channelId),this._conversationManager.setConversationCacheByMessage(o,!0),this._watcher.batchMessage([o])):this._receiveMessageExpansion(o))}},t.prototype._pullMsg=function(n){if(this._channel){var r=this._channel.codec.decodeByPBName(n.data,Mu),i=r.type,o=r.chrmId,s=r.time;if(de.info("s_ntf -> type: "+i+", chrmId: "+o+", time: "+s),i===2){var a=this._chrmsQueue[o];if(!a)return;a.queue.push(s),this._pullChrmMsg(o)}else this._pullQueue.push(s),this._syncMsg()}},t.prototype._startSyncInterval=function(){var n=this;this._stopSyncInterval(),this._intervalTimer=setInterval(function(){Date.now()-n._latestSyncTimestamp>=18e4&&n._syncMsg()},3e4),this._latestSyncTimestamp=Date.now(),this._syncMsg()},t.prototype._stopSyncInterval=function(){this._intervalTimer!==-1&&(clearInterval(this._intervalTimer),this._intervalTimer=-1)},t.prototype._syncMsg=function(){return J(this,void 0,void 0,function(){var n,r,i,o,s,a,u,d,f,c,l,h,p,m,v=this;return Q(this,function(_){switch(_.label){case 0:return this._pullingMsg?[2]:this._channel?(this._pullingMsg=!0,n=this._letterbox.getOutboxTime(this.currentUserId),r=this._letterbox.getInboxTime(this.currentUserId),de.info("pullMsg -> sendboxTime: "+n+", inboxTime: "+r),i=this._channel.codec.encodeSyncMsg({sendboxTime:n,inboxTime:r}),o=new De(Y[Y.pullMsg],i,this.currentUserId),[4,this._channel.send(o,xa,{connectedTime:this._channel.connectedTime,currentUserId:this.currentUserId})]):(this._pullingMsg=!1,[2]);case 1:return s=_.sent(),a=s.code,u=s.data,this._latestSyncTimestamp=Date.now(),a===D.SUCCESS&&u?(d=u.list,f=u.finished,c=u.syncTime,de.info("pullMsg success -> syncTime: "+c+", finished: "+f),l=0,h=[],d.forEach(function(y){if(y.messageDirection===Qn.SEND&&(l=Math.max(y.sentTime,l),v._sendMessageStore.getSendMessageMap()[y.messageUId]))return void v._sendMessageStore.removeByUID(y.messageUId);if(y.messageType!==mn.EXPANSION_NOTIFY){if(y.messageType===mn.SYNC_READ_STATUS){if(y.senderUserId!==v.currentUserId)return;v._conversationManager.clearUnreadCount(y.conversationType,y.targetId,y.channelId)}var E=v._handleMsgProperties(y);v._conversationManager.setConversationCacheByMessage(E,!0),h.push(E)}else v._receiveMessageExpansion(y)}),this._watcher.batchMessage(h),this._letterbox.setInboxTime(c,this.currentUserId),this._letterbox.setOutboxTime(l,this.currentUserId),this._sendMessageStore.removeByTimestamp(l),this._pullingMsg=!1,p=this._pullQueue.filter(function(y){return y>c}),this._pullQueue.length=0,(m=this._pullQueue).push.apply(m,p),f&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this._watcher.pullFinished()),(!f||p.length>0)&&this._syncMsg(),[2]):(de.warn("pullMsg failed -> code:",a,", data: ",u),this._pullingMsg=!1,[2])}})})},t.prototype._receiveMsg=function(n){if(this._channel&&!this._pullingMsg)if(this._pullQueue.length>0)this._syncMsg();else{var r=this._channel.codec.decodeByPBName(n.data,vl,{currentUserId:this.currentUserId,connectedTime:this._channel.connectedTime});(r=this._handleMsgProperties(r)).senderUserId===this.currentUserId&&this._sendMessageStore.setMessage(r.messageUId,r.sentTime),r.isStatusMessage||r.senderUserId===this.currentUserId||this._letterbox.setInboxTime(r.sentTime,this.currentUserId),r.messageType!==mn.EXPANSION_NOTIFY?r.messageType===mn.SYNC_READ_STATUS&&r.senderUserId!==this.currentUserId||(this._conversationManager.setConversationCacheByMessage(r,!0),this._watcher.batchMessage([r])):this._receiveMessageExpansion(r)}},t.prototype._handleMsgProperties=function(n,r){r===void 0&&(r=!1);var i,o=n.messageType,s=n.isCounted,a=n.isPersited,u=n.isStatusMessage,d=o in ty,f=o in this._customMessageType;if(i=d?ty[o]:f?this._customMessageType[o]:{isCounted:!iy(s)&&s,isPersited:!iy(a)&&a},Object.assign(n,{isCounted:i.isCounted,isPersited:i.isPersited,isStatusMessage:W3.includes(o)}),r&&(n.isStatusMessage=u),!r){var c=n.content.user;if(c){var l=c.portrait,h=c.portraitUri,p=l||h;p&&(c.portrait=c.portraitUri=p)}}return n},t.prototype.getHistoryMessage=function(n,r,i,o,s,a){return a===void 0&&(a=""),J(this,void 0,void 0,function(){var u,d,f,c,l,h,p,m,v;return Q(this,function(_){switch(_.label){case 0:return d=(u=this).currentUserId,f=u._channel,c=A4[n]||JC,l=o===1&&i===0,f?(h=f.codec.encodeGetHistoryMsg(r,{timestamp:i,count:l?2:o,order:s,channelId:a}),[4,f.send(new De(c,h,d),Ba,{currentUserId:d,connectedTime:f.connectedTime,conversation:{targetId:r}})]):[3,2];case 1:return p=_.sent(),(m=p.code)!==D.SUCCESS?[2,{code:m}]:(v=p.data,l&&v.list.length===2&&(v.hasMore=!0,s===0?v.list.shift():v.list.pop()),[2,{code:m,data:{list:v.list,hasMore:v.hasMore}}]);case 2:return[2,{code:D.RC_NET_CHANNEL_INVALID}]}})})},t.prototype.reportSDKInfo=function(n){var r=this.currentUserId,i=this._channel;if(i){de.debug("reportSDKInfo ->",n);var o=i.codec.encodeReportSDKInfo(JSON.stringify(n)),s=new De(Y[Y.reportsdk],o,r);i.send(s).then(function(a){var u=a.code;u!==D.SUCCESS&&de.warn("reportSDKInfo failed -> code: "+u)})}},t.prototype.deleteRemoteMessage=function(n,r,i,o){return J(this,void 0,void 0,function(){var s,a,u,d,f,c,l;return Q(this,function(h){switch(h.label){case 0:return a=(s=this).currentUserId,(u=s._channel)?(d=u.codec.encodeDeleteMessages(n,r,i,o),f=new De(m4,d,a),[4,u.send(f)]):[3,2];case 1:return c=h.sent(),l=c.code,D.SUCCESS,[2,l];case 2:return[2,D.RC_NET_CHANNEL_INVALID]}})})},t.prototype.deleteRemoteMessageByTimestamp=function(n,r,i,o){return J(this,void 0,void 0,function(){var s,a,u,d,f,c,l,h;return Q(this,function(p){switch(p.label){case 0:return a=(s=this).currentUserId,(u=s._channel)?(d=u.codec.encodeClearMessages(r,i,o),f=P4[n],c=new De(f,d,a),[4,u.send(c)]):[3,2];case 1:return l=p.sent(),h=l.code,D.SUCCESS,[2,h];case 2:return[2,D.RC_NET_CHANNEL_INVALID]}})})},t.prototype.getConversationList=function(n,r,i,o,s){return n===void 0&&(n=300),J(this,void 0,void 0,function(){var a,u,d,f,c,l,h,p,m=this;return Q(this,function(v){switch(v.label){case 0:return u=(a=this).currentUserId,d=a._channel,r=r||$e.PRIVATE,d?(f=d.codec.encodeOldConversationList({count:n,type:r,startTime:i,order:o}),c=new De(yy,f,u),[4,d.send(c,Fa,{currentUserId:u,connectedTime:d.connectedTime,afterDecode:function(_){var y=_.conversationType,E=_.targetId,S=_.channelId,T=m._conversationManager.get(y,E,S);return Object.assign(_,T),_}})]):[3,2];case 1:return l=v.sent(),h=l.code,p=l.data,h!==D.SUCCESS?[2,{code:h}]:[2,{code:h,data:p}];case 2:return[2,{code:D.RC_NET_CHANNEL_INVALID}]}})})},t.prototype.removeConversation=function(n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d;return Q(this,function(f){switch(f.label){case 0:return(o=this._channel)?(s=o.codec.encodeRemoveOldConversationList({conversationType:n,channelId:i,targetId:r}),a=new De(R4,s,r),[4,o.send(a)]):[3,2];case 1:return u=f.sent(),de.info("RemoveConversation =>",u),d=u.code,D.SUCCESS,[2,d];case 2:return[2,D.RC_NET_CHANNEL_INVALID]}})})},t.prototype.getConversation=function(n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d,f;return Q(this,function(c){switch(c.label){case 0:return(o=this._conversationManager.get(n,r,i))?[4,this.getHistoryMessage(n,r,0,1,0)]:[2,{code:D.CONVER_GET_ERROR}];case 1:return s=c.sent(),a=s.code,u=s.data,a!==D.SUCCESS?[2,{code:D.CONVER_GET_ERROR}]:(d=(u==null?void 0:u.list[0])||null,f={conversationType:n,targetId:r,channelId:i,unreadMessageCount:o.unreadMessageCount||0,latestMessage:d,notificationStatus:o.notificationStatus||Fo.CLOSE,isTop:o.isTop||!1,lastUnreadTime:o.lastUnreadTime||0,unreadMentionedCount:o.unreadMentionedCount||0},[2,{code:D.SUCCESS,data:f}])}})})},t.prototype.getAllConversationUnreadCount=function(n,r,i){var o=this._conversationManager.getAllUnreadCount(n,r,i);return Promise.resolve({code:D.SUCCESS,data:o})},t.prototype.getConversationUnreadCount=function(n,r,i){var o=this._conversationManager.getUnreadCount(n,r,i);return Promise.resolve({code:D.SUCCESS,data:o})},t.prototype.clearConversationUnreadCount=function(n,r,i){return this._conversationManager.clearUnreadCount(n,r,i,!1),Promise.resolve(D.SUCCESS)},t.prototype.clearAllUnreadCount=function(){return this._conversationManager.clearAllUnreadCount(),Promise.resolve(D.SUCCESS)},t.prototype.getFirstUnreadMessage=function(n,r){throw new Error("Method not implemented.")},t.prototype.saveConversationMessageDraft=function(n,r,i,o){return this._conversationManager.setDraft(n,r,i,o),Promise.resolve(D.SUCCESS)},t.prototype.getConversationMessageDraft=function(n,r,i){var o=this._conversationManager.getDraft(n,r,i);return Promise.resolve({code:D.SUCCESS,data:o})},t.prototype.clearConversationMessageDraft=function(n,r,i){return this._conversationManager.clearDraft(n,r,i),Promise.resolve(D.SUCCESS)},t.prototype.pullConversationStatus=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a,u,d,f;return Q(this,function(c){switch(c.label){case 0:return i=(r=this)._channel,o=r.currentUserId,i?(s=i.codec.encodeGetConversationStatus(n),a=new De(Y[Y.pullSeAtts],s,o),[4,i.send(a,Sl)]):[3,2];case 1:return u=c.sent(),d=u.code,f=u.data,d!==D.SUCCESS?[2,{code:d}]:[2,{code:d,data:f}];case 2:return[2,{code:D.RC_NET_CHANNEL_INVALID}]}})})},t.prototype.batchSetConversationStatus=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a,u,d,f,c,l=this;return Q(this,function(h){switch(h.label){case 0:return i=(r=this).currentUserId,(o=r._channel)?(s=o.codec.encodeSetConversationStatus(n),a=new De(b4,s,i),[4,o.send(a,ig)]):[3,2];case 1:return u=h.sent(),d=u.code,f=u.data,d===D.SUCCESS?(c=f,n.forEach(function(p){l._conversationManager.addStatus(Rt(Rt({},p),{updatedTime:c.version}),!0)}),[2,d]):[2,d];case 2:return[2,D.RC_NET_CHANNEL_INVALID]}})})},t.prototype._joinChrm=function(n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d,f,c;return Q(this,function(l){switch(l.label){case 0:return(o=this._channel)?(s=o.codec.encodeJoinOrQuitChatRoom(),a=new De(i?y4:v4,s,n),[4,o.send(a,$p)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return u=l.sent(),d=u.code,f=u.data,d===D.SUCCESS&&(c=f.joinTime,this._chrmsQueue[n]||(this._chrmsQueue[n]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(n,r,c),this._naviInfo.kvStorage&&this._chrmEntryHandler.pullEntry(n,0),this._joinedChrmManager.set(n,r)),[2,d]}})})},t.prototype._rejoinChrm=function(){return J(this,void 0,void 0,function(){var n,r,i,o,s,a;return Q(this,function(u){switch(u.label){case 0:for(i in n=this._joinedChrmManager.get(),r=[],n)r.push(i);o=0,u.label=1;case 1:return o<r.length?(s=r[o],[4,this._joinChrm(s,n[s]||10,!0)]):[3,4];case 2:(a=u.sent())===D.SUCCESS?this._watcher.chatroom({rejoinedRoom:{chatroomId:s,count:n[s]}}):this._watcher.chatroom({rejoinedRoom:{chatroomId:s,errorCode:a}}),u.label=3;case 3:return o++,[3,1];case 4:return[2]}})})},t.prototype._pullChrmMsg=function(n,r,i){return r===void 0&&(r=10),i===void 0&&(i=0),J(this,void 0,void 0,function(){var o,s,a,u,d,f,c,l,h,p,m,v;return Q(this,function(_){switch(_.label){case 0:return this._channel?(o=this._chrmsQueue[n],s=o.pulling,a=o.timestamp,s?[2]:(o.pulling=!0,u=this._channel.codec.encodeChrmSyncMsg(a,r),d=new De(Y[Y.chrmPull],u,n),[4,this._channel.send(d,xa,{connectedTime:this._channel.connectedTime,currentUserId:this.currentUserId})])):[2];case 1:return f=_.sent(),c=f.code,l=f.data,o.pulling=!1,c===D.SUCCESS&&l?(h=l.list,p=l.syncTime,m=l.finished,o.timestamp=i?Math.max(p,i):p,o.queue=o.queue.filter(function(y){return y>p}),v=[],h.forEach(function(y){y.sentTime<a||v.push(y)}),this._watcher.batchMessage(v),(!m||o.queue.length>0)&&this._pullChrmMsg(n),[2]):(de.warn("pull chatroom msg failed, code:",c,", data:",l),[2])}})})},t.prototype.joinChatroom=function(n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return[2,this._joinChrm(n,r,!1)]})})},t.prototype.joinExistChatroom=function(n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return[2,this._joinChrm(n,r,!0)]})})},t.prototype.quitChatroom=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a;return Q(this,function(u){switch(u.label){case 0:return(r=this._channel)?(i=r.codec.encodeJoinOrQuitChatRoom(),o=new De(_4,i,n),[4,r.send(o)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return s=u.sent(),(a=s.code)===D.SUCCESS&&(delete this._chrmsQueue[n],this._chrmEntryHandler.reset(n),this._joinedChrmManager.remove(n)),[2,a]}})})},t.prototype.getChatroomInfo=function(n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d,f;return Q(this,function(c){switch(c.label){case 0:return(o=this._channel)?(s=o.codec.encodeGetChatRoomInfo(r,i),a=new De(Y[Y.queryChrmI],s,n),[4,o.send(a,yl)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return u=c.sent(),d=u.code,f=u.data,d!==D.SUCCESS?[2,{code:d}]:[2,{code:d,data:f}]}})})},t.prototype.getChatroomHistoryMessages=function(n,r,i,o){return J(this,void 0,void 0,function(){var s,a,u,d,f,c;return Q(this,function(l){switch(l.label){case 0:return(s=this._channel)?(a=s.codec.encodeGetHistoryMsg(n,{timestamp:r,count:i,order:o}),u=new De(QC,a,n),[4,s.send(u,Ba,{conversation:{targetId:n}})]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return d=l.sent(),f=d.code,c=d.data,f!==D.SUCCESS?[2,{code:f}]:[2,{code:f,data:{list:c.list,hasMore:c.hasMore}}]}})})},t.prototype._modifyChatroomKV=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a,u,d,f,c;return Q(this,function(l){switch(l.label){case 0:return o=(i=this)._channel,s=i.currentUserId,o?(a=o.codec.encodeModifyChatRoomKV(n,r,s),u=r.type===Pn.UPDATE?E4:C4,d=new De(u,a,n),[4,o.send(d)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return f=l.sent(),(c=f.code)===D.SUCCESS?(this._chrmEntryHandler.setLocal(n,{kvEntries:[r],syncTime:new Date().getTime()},s),[2,c]):[2,c]}})})},t.prototype._modifyChatroomKVS=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a,u,d,f,c,l,h,p,m;return Q(this,function(v){switch(v.label){case 0:return o=(i=this)._channel,s=i.currentUserId,o?(a=o.codec.encodeModifyChatRoomKVS(n,r,s),u=r.type===Pn.UPDATE?T4:S4,d=new De(u,a,n),[4,o.send(d,eg)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return f=v.sent(),c=f.code,[D.SUCCESS,D.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(c)!==-1&&(h=[],delete(p=Object.assign({},r)).entries,r.entries.forEach(function(_){h.push(Object.assign({},_,p))}),c===D.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(m=f.data,de.warn("\u8BBE\u7F6E\u5931\u8D25\u7684\u5C5E\u6027\uFF1A",m.errorKeys),l=m.errorKeys,m&&Array.isArray(m.errorKeys)&&m.errorKeys.forEach(function(_){var y=h.findIndex(function(E){return _.key===E.key});y!==-1&&h.splice(y,1)})),de.warn("\u8BBE\u7F6E\u6210\u529F\u7684\u5C5E\u6027\uFF1A",h),this._chrmEntryHandler.setLocal(n,{kvEntries:h,syncTime:new Date().getTime()},s)),[2,{code:c,data:l}]}})})},t.prototype.setChatroomEntry=function(n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return r.type=Pn.UPDATE,r.userId=r.userId||this.currentUserId,[2,this._modifyChatroomKV(n,r)]})})},t.prototype.setChatroomEntries=function(n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return r.type=Pn.UPDATE,r.userId=r.userId||this.currentUserId,[2,this._modifyChatroomKVS(n,r)]})})},t.prototype.forceSetChatroomEntry=function(n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return r.type=Pn.UPDATE,r.isOverwrite=!0,r.userId=r.userId||this.currentUserId,[2,this._modifyChatroomKV(n,r)]})})},t.prototype.removeChatroomEntry=function(n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return r.type=Pn.DELETE,r.userId=r.userId||this.currentUserId,[2,this._modifyChatroomKV(n,r)]})})},t.prototype.removeChatroomEntries=function(n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return r.type=Pn.DELETE,r.userId=r.userId||this.currentUserId,[2,this._modifyChatroomKVS(n,r)]})})},t.prototype.forceRemoveChatroomEntry=function(n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return r.type=Pn.DELETE,r.isOverwrite=!0,r.userId=r.userId||this.currentUserId,[2,this._modifyChatroomKV(n,r)]})})},t.prototype.getChatroomEntry=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a,u,d,f;return Q(this,function(c){switch(c.label){case 0:return(i=this._chrmEntryHandler.getValue(n,r))?[2,Promise.resolve({code:D.SUCCESS,data:i})]:[3,1];case 1:return(o=this._channel)?(s=o.codec.encodePullChatRoomKV(0),a=new De(Y[Y.pullKV],s,n),[4,o.send(a,Jo)]):[2,Promise.reject({code:D.RC_NET_CHANNEL_INVALID})];case 2:return u=c.sent(),(d=u.data||{})&&d.kvEntries&&d.kvEntries.length&&(f=d.kvEntries.find(function(l){return l.key===r}))!==void 0?[2,Promise.resolve({code:D.SUCCESS,data:f==null?void 0:f.value})]:[2,Promise.resolve({code:D.CHATROOM_KEY_NOT_EXIST})]}})})},t.prototype.getAllChatroomEntry=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a,u,d;return Q(this,function(f){switch(f.label){case 0:return(r=this._chrmEntryHandler.getAll(n))&&Object.keys(r).length?[2,Promise.resolve({code:D.SUCCESS,data:r})]:[3,1];case 1:return(i=this._channel)?(o={},s=i.codec.encodePullChatRoomKV(0),a=new De(Y[Y.pullKV],s,n),[4,i.send(a,Jo)]):[2,Promise.reject({code:D.RC_NET_CHANNEL_INVALID})];case 2:return u=f.sent(),(d=u.data||{})&&d.kvEntries&&d.kvEntries.length&&d.kvEntries.forEach(function(c){c.key&&(o[c.key]=c.value||"")}),[2,Promise.resolve({code:D.SUCCESS,data:o})]}})})},t.prototype.pullChatroomEntry=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a,u,d,f,c,l,h;return Q(this,function(p){switch(p.label){case 0:return o=(i=this)._channel,s=i.currentUserId,o?(a=o.codec.encodePullChatRoomKV(r),u=new De(Y[Y.pullKV],a,n),[4,o.send(u,Jo)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return d=p.sent(),f=d.code,c=d.data,f===D.SUCCESS?(de.info("Pull success ChrmKV, "+JSON.stringify(d)),this._chrmEntryHandler.setLocal(n,c,s),de.info("Save into cache success!"),l=c.kvEntries,h=[],l.length>0&&(l.forEach(function(m){var v=m.key,_=m.value,y=m.type,E=m.timestamp;h.push({key:v,value:_,type:y,timestamp:E,chatroomId:n})}),this._watcher.chatroom({updatedEntries:h})),[2,{code:f,data:c}]):[2,{code:f}]}})})},t.prototype.sendMessage=function(n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d,f,c,l,h,p;return Q(this,function(m){switch(m.label){case 0:return this._channel?(i=function(v,_){return v.messageType==="RC:SRSMsg"&&Object.assign(v,{directionalUserIdList:[_]}),v}(i,this.currentUserId),i=this._handleMsgProperties(i,!0),o=!![$e.PRIVATE,$e.GROUP].includes(n)&&i.isStatusMessage,s=o?function(v){var _;return(_={},_[$e.PRIVATE]=Y.ppMsgS,_[$e.GROUP]=Y.pgMsgS,_)[v]}(n):function(v){var _;return(_={},_[$e.PRIVATE]=Y.ppMsgP,_[$e.GROUP]=Y.pgMsgP,_[$e.CHATROOM]=Y.chatMsg,_[$e.CUSTOMER_SERVICE]=Y.pcMsgP,_[$e.RTC_ROOM]=Y.prMsgS,_)[v]}(n)||Y.ppMsgP,o&&(i.isPersited=!1,i.isCounted=!1),a=this._channel.codec.encodeUpMsg({conversationType:n,targetId:r},i),(u=new Bs(Y[s],a,r)).setHeaderQos(Xr.AT_LEAST_ONCE),o?(this._channel.sendOnly(u),[2,{code:D.SUCCESS,data:Id(n,r,Rt({},i),"",0,this.currentUserId)}]):(d=Date.now()-this._localConnectedTime+this._connectedTime,f=Id(n,r,Rt({},i),"",d,this.currentUserId),[4,this._channel.send(u)])):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return c=m.sent(),l=c.code,h=c.data,l!==D.SUCCESS?[2,{code:l,data:f}]:(p=h,this._sendMessageStore.setMessage(p.messageUId,p.timestamp),f.sentTime=p.timestamp,f.messageUId=p.messageUId,this._conversationManager.setConversationCacheByMessage(f,!0),[2,{code:D.SUCCESS,data:f}])}})})},t.prototype.recallMsg=function(n,r,i,o,s){var a;return J(this,void 0,void 0,function(){var u,d,f,c,l,h,p,m,v,_;return Q(this,function(y){switch(y.label){case 0:return this._channel?(u=s.user,d={content:{conversationType:n,targetId:r,messageUId:i,sentTime:o,user:u},messageType:"RC:RcCmd",disableNotification:s==null?void 0:s.disableNotification,pushConfig:s==null?void 0:s.pushConfig,pushContent:((a=s.pushConfig)===null||a===void 0?void 0:a.pushContent)||s.pushContent||"",channelId:s.channelId},f=Y[Y.recallMsg],c=this._channel.codec.encodeUpMsg({conversationType:n,targetId:r},d),(l=new Bs(f,c,this.currentUserId)).setHeaderQos(Xr.AT_LEAST_ONCE),[4,this._channel.send(l)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return h=y.sent(),p=h.code,m=h.data,p!==D.SUCCESS?[2,{code:p}]:(v=m,this._sendMessageStore.setMessage(v.messageUId,v.timestamp),_=Id(n,r,Rt(Rt({},d),{isPersited:!0}),v.messageUId,v.timestamp,this.currentUserId),this._conversationManager.setConversationCacheByMessage(_,!0),[2,{code:D.SUCCESS,data:_}])}})})},t.prototype.sendReadReceiptMessage=function(n,r,i){return J(this,void 0,void 0,function(){var o,s;return Q(this,function(a){switch(a.label){case 0:return this._channel?(o=this._channel.codec.encodeReadReceipt(r,i),s=new De(Y[Y.rrMsg],o,n),[4,this._channel.send(s)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return[2,a.sent()]}})})},t.prototype.getMessageReader=function(n,r,i){return J(this,void 0,void 0,function(){var o,s;return Q(this,function(a){switch(a.label){case 0:return this._channel?(o=this._channel.codec.encodeMessageReader(r,i),s=new De(Y[Y.rrList],o,n),[4,this._channel.send(s,Rl)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return[2,a.sent()]}})})},t.prototype.pullUserSettings=function(n){return J(this,void 0,void 0,function(){var r,i;return Q(this,function(o){return this._channel?(r=this._channel.codec.encodePullUserSetting(n),i=new De(Y[Y.pullUS],r,this.currentUserId),[2,this._channel.send(i,Cl)]):[2,{code:D.RC_NET_CHANNEL_INVALID}]})})},t.prototype.getFileToken=function(n,r,i,o){return J(this,void 0,void 0,function(){var s,a,u,d,f,c;return Q(this,function(l){switch(l.label){case 0:return this._channel?(s=o&&o!=="uploads"?r||"":n4(n,r),a=this._channel.codec.encodeGetFileToken(n,s,i||"",o||""),u=new De(Y[Y.qnTkn],a,this.currentUserId),[4,this._channel.send(u,zp)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return d=l.sent(),f=d.code,c=d.data,c=Object.assign(c,{fileName:s}),f===D.SUCCESS?[2,{code:f,data:c}]:[2,{code:f}]}})})},t.prototype.getFileUrl=function(n,r,i,o){return J(this,void 0,void 0,function(){var s,a,u,d,f,c,l,h,p;return Q(this,function(m){switch(m.label){case 0:return this._channel?(s="",a="",u="",r===Rn.QINIU?(a=Yp,u=Jp):(a=Wp,u=Qp),s=r===Rn.QINIU?Y[Y.qnUrl]:r===Rn.AWS?Y[Y.s3Url]:r===Rn.STC?Y[Y.stcUrl]:Y[Y.aliUrl],d=this._channel.codec.encodeGetFileUrl(a,n,i,o),f=new De(s,d,this.currentUserId),[4,this._channel.send(f,u)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return c=m.sent(),l=c.code,h=c.data,p=h,l===D.SUCCESS?[2,{code:l,data:p}]:[2,{code:l}]}})})},t.prototype.disconnect=function(){this._reconnectTimer!==-1&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._channel&&(this._channel.close(),this._channel=void 0),this._pullQueue.length=0,this._stopSyncInterval()},t.prototype.destroy=function(){throw new Error("JSEngine's method not implemented.")},t.prototype.registerMessageType=function(n,r,i,o){this._customMessageType[n]={isPersited:r,isCounted:i}},t.prototype.getServerTime=function(){return Date.now()-this._localConnectedTime+this._connectedTime},t.prototype.getCurrentUserId=function(){return this.currentUserId},t.prototype.createTag=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a,u,d;return Q(this,function(f){switch(f.label){case 0:return this._channel?(r=this._userSettingManager.getVersion(),i=this._channel.codec.encodeCreateTag([n],r),o=new De(Y[Y.addSeTag],i,this.currentUserId),[4,this._channel.send(o,Qo)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return s=f.sent(),a=s.code,u=s.data,a!==D.SUCCESS?[2,{code:a}]:(d=u.version,this._userSettingManager.addTag([Rt(Rt({},n),{createdTime:d})],d),[2,{code:D.SUCCESS,data:u}])}})})},t.prototype.removeTag=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a,u,d;return Q(this,function(f){switch(f.label){case 0:return this._channel?(r=this._userSettingManager.getVersion(),i=this._channel.codec.encodeRemoveTag([n],r),o=new De(Y[Y.delSeTag],i,this.currentUserId),[4,this._channel.send(o,Qo)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return s=f.sent(),a=s.code,u=s.data,a!==D.SUCCESS?[2,{code:a}]:(d=u.version,this._userSettingManager.deleteTag([n],d),[2,{code:D.SUCCESS}])}})})},t.prototype.updateTag=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a,u,d;return Q(this,function(f){switch(f.label){case 0:return this._channel?(r=this._userSettingManager.getVersion(),i=this._channel.codec.encodeCreateTag([n],r),o=new De(Y[Y.addSeTag],i,this.currentUserId),[4,this._channel.send(o,Qo)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return s=f.sent(),a=s.code,u=s.data,a!==D.SUCCESS?[2,{code:a}]:(d=u.version,this._userSettingManager.addTag([n],d),[2,{code:D.SUCCESS,data:u}])}})})},t.prototype.getTagList=function(){return J(this,void 0,void 0,function(){var n,r;return Q(this,function(i){return n=this._userSettingManager.getTags(),r=this._conversationManager.getConversationListForTag(),n.forEach(function(o){o.conversationCount=r[o.tagId]?r[o.tagId].length:0}),[2,{code:D.SUCCESS,data:n}]})})},t.prototype.addTagForConversations=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a,u=this;return Q(this,function(d){switch(d.label){case 0:return this._channel?this._userSettingManager.getTagById(n)?(i=this._channel.codec.encodeUpdateConversationTag([{tagId:n}],r),o=new De(Y[Y.addTag],i,this.currentUserId),[4,this._channel.send(o)]):[2,{code:D.TAG_NOT_EXIST}]:[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return(s=d.sent().code)!==D.SUCCESS?[2,{code:s}]:((a={})[n]={},r.forEach(function(f){u._conversationManager.addTagStatus(f.conversationType,f.targetId,a,f.channelId)}),[2,{code:D.SUCCESS}])}})})},t.prototype.removeTagForConversations=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a=this;return Q(this,function(u){switch(u.label){case 0:return this._channel?(i=this._channel.codec.encodeUpdateConversationTag([{tagId:n}],r),o=new De(Y[Y.delTag],i,this.currentUserId),[4,this._channel.send(o)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return(s=u.sent().code)!==D.SUCCESS?[2,{code:s}]:(r.forEach(function(d){a._conversationManager.deleteTagStatus(d.conversationType,d.targetId,[n],d.channelId)}),[2,{code:D.SUCCESS}])}})})},t.prototype.removeTagsForConversation=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a,u,d,f;return Q(this,function(c){switch(c.label){case 0:return this._channel?(i=n.conversationType,o=n.targetId,s=n.channelId,a=r.map(function(l){return{tagId:l}}),u=this._channel.codec.encodeUpdateConversationTag(a,[n]),d=new De(Y[Y.delTag],u,this.currentUserId),[4,this._channel.send(d)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return(f=c.sent().code)!==D.SUCCESS?[2,{code:f}]:(this._conversationManager.deleteTagStatus(i,o,r,s),[2,{code:D.SUCCESS}])}})})},t.prototype.getConversationListByTag=function(n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d,f,c,l,h;return Q(this,function(p){switch(p.label){case 0:return s=(o=this).currentUserId,(a=o._channel)?(u=a.codec.encodeOldConversationList({count:i,type:$e.PRIVATE,startTime:r}),d=new De(yy,u,s),[4,a.send(d,Fa,{currentUserId:s,connectedTime:a.connectedTime})]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return f=p.sent(),c=f.code,l=f.data,h=this._conversationHasTagFilter(n,l),de.info("GetConversationListByTag",h),c!==D.SUCCESS?[2,{code:c}]:[2,{code:c,data:h}]}})})},t.prototype._conversationHasTagFilter=function(n,r){var i=this,o=[],s=[];function a(u,d){return u.latestMessage&&d.latestMessage?u.latestMessage.sentTime-d.latestMessage.sentTime:0}return r.forEach(function(u){var d=u.conversationType,f=u.targetId,c=u.channelId,l=i._conversationManager.get(d,f,c),h=l.hasMentioned,p=l.mentionedInfo,m=l.lastUnreadTime,v=l.notificationStatus,_=l.isTop,y=l.tags,E=l.unreadMessageCount,S=y&&y[n];if(S){var T=Rt(Rt({},u),{hasMentioned:h,mentionedInfo:p,lastUnreadTime:m,notificationStatus:v,isTop:_,unreadMessageCount:E});S.isTop?o.push(Rt(Rt({},T),{isTopInTag:!0})):s.push(Rt(Rt({},T),{isTopInTag:!1}))}}),fo(fo([],o.sort(a)),s.sort(a))},t.prototype.getUnreadCountByTag=function(n,r){return J(this,void 0,void 0,function(){var i;return Q(this,function(o){return this._channel?(i=this._conversationManager.getUnreadCountByTag(n,r),[2,{code:D.SUCCESS,data:i}]):[2,{code:D.RC_NET_CHANNEL_INVALID}]})})},t.prototype.setConversationStatusInTag=function(n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d,f,c,l,h,p;return Q(this,function(m){switch(m.label){case 0:return this._channel?(o=r.targetId,s=r.conversationType,a=r.channelId,u=i.isTop,d=[{tagId:n,isTop:u}],(f=this._conversationManager.get(s,o,a)).tags&&Object.hasOwnProperty.call(f.tags,n)?(c=this._channel.codec.encodeUpdateConversationTag(d,[r]),l=new De(Y[Y.addTag],c,this.currentUserId),[4,this._channel.send(l)]):[2,{code:D.NO_TAG_IN_CONVER}]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return(h=m.sent().code)!==D.SUCCESS?[2,{code:h}]:((p={})[n]={},u&&(p[n].isTop=!0),this._conversationManager.addTagStatus(s,o,p,a),[2,{code:D.SUCCESS}])}})})},t.prototype.getTagsForConversation=function(n){var r;return J(this,void 0,void 0,function(){var i,o,s,a;return Q(this,function(u){if(!this._channel)return[2,{code:D.RC_NET_CHANNEL_INVALID}];if(i=this._conversationManager.get(n.conversationType,n.targetId,n.channelId),o=this._userSettingManager.getTagsInfo(),s=[],i.tags)for(a in i.tags)s.push({tagId:a,tagName:(r=o[a])===null||r===void 0?void 0:r.tagName});return[2,{code:D.SUCCESS,data:s}]})})},t.prototype.getBlockConversationList=function(){var n=this._conversationManager.getBlockConversationList();return Promise.resolve({code:D.SUCCESS,data:n})},t.prototype.getTopConversationList=function(){var n=this._conversationManager.getTopConversationList();return Promise.resolve({code:D.SUCCESS,data:n})},t.prototype.getUnreadMentionedCount=function(n){var r=this._conversationManager.getUnreadMentionedCount(n.channelId,n.conversationType,n.targetId);return Promise.resolve({code:D.SUCCESS,data:r})},t.prototype.getAllUnreadMentionedCount=function(){var n=this._conversationManager.getAllUnreadMentionedCount();return Promise.resolve({code:D.SUCCESS,data:n})},t.prototype.joinRTCRoom=function(n,r,i,o){return J(this,void 0,void 0,function(){var s,a;return Q(this,function(u){return this._channel?(s=this._channel.codec.encodeJoinRTCRoom(r,i,o),a=new De(Y[Y.rtcRJoin_data],s,n),[2,this._channel.send(a,oo)]):[2,{code:D.RC_NET_CHANNEL_INVALID}]})})},t.prototype.quitRTCRoom=function(n){return J(this,void 0,void 0,function(){var r,i;return Q(this,function(o){switch(o.label){case 0:return this._channel?(r=this._channel.codec.encodeQuitRTCRoom(),i=new De(Y[Y.rtcRExit],r,n),[4,this._channel.send(i)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return[2,o.sent().code]}})})},t.prototype.rtcPing=function(n,r,i){return J(this,void 0,void 0,function(){var o,s;return Q(this,function(a){switch(a.label){case 0:return this._channel?(o=this._channel.codec.encodeJoinRTCRoom(r,i),s=new De(Y[Y.rtcPing],o,n),[4,this._channel.send(s)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return[2,a.sent().code]}})})},t.prototype.getRTCRoomInfo=function(n){return J(this,void 0,void 0,function(){var r,i;return Q(this,function(o){return this._channel?(r=this._channel.codec.encodeGetRTCRoomInfo(),i=new De(Y[Y.rtcRInfo],r,n),[2,this._channel.send(i,VC)]):[2,{code:D.RC_NET_CHANNEL_INVALID}]})})},t.prototype.getRTCUserInfoList=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a;return Q(this,function(u){switch(u.label){case 0:return this._channel?(r=this._channel.codec.encodeGetRTCRoomInfo(),i=new De(Y[Y.rtcUData],r,n),[4,this._channel.send(i,oo)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return o=u.sent(),s=o.code,a=o.data,[2,{code:s,data:a&&{users:a.users}}]}})})},t.prototype.setRTCUserInfo=function(n,r,i){return J(this,void 0,void 0,function(){var o,s;return Q(this,function(a){switch(a.label){case 0:return this._channel?(o=this._channel.codec.encodeSetRTCUserInfo(r,i),s=new De(Y[Y.rtcUPut],o,n),[4,this._channel.send(s)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return[2,a.sent().code]}})})},t.prototype.removeRTCUserInfo=function(n,r){return J(this,void 0,void 0,function(){var i,o;return Q(this,function(s){switch(s.label){case 0:return this._channel?(i=this._channel.codec.encodeRemoveRTCUserInfo(r),o=new Bs(Y[Y.rtcUDel],i,n),[4,this._channel.send(o)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return[2,s.sent().code]}})})},t.prototype.setRTCData=function(n,r,i,o,s,a){return J(this,void 0,void 0,function(){var u,d;return Q(this,function(f){switch(f.label){case 0:return this._channel?(u=this._channel.codec.encodeSetRTCData(r,i,o,s,a),d=new Bs(Y[Y.rtcSetData],u,n),[4,this._channel.send(d)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return[2,f.sent().code]}})})},t.prototype.setRTCTotalRes=function(n,r,i,o,s){return J(this,void 0,void 0,function(){var a,u;return Q(this,function(d){switch(d.label){case 0:return this._channel?(a=this._channel.codec.encodeUserSetRTCData(r,i,o,s),u=new De(Y[Y.userSetData],a,n),[4,this._channel.send(u)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return[2,d.sent().code]}})})},t.prototype.setRTCCDNUris=function(n,r,i){return J(this,void 0,void 0,function(){var o,s;return Q(this,function(a){switch(a.label){case 0:return this._channel?(o=this._channel.codec.encodeUserSetRTCCDNUris(r,i),s=new De(Y[Y.userSetData],o,n),[4,this._channel.send(s)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return[2,a.sent().code]}})})},t.prototype.getRTCData=function(n,r,i,o){if(!this._channel)return Promise.resolve({code:D.RC_NET_CHANNEL_INVALID});var s=this._channel.codec.encodeGetRTCData(r,i,o),a=new De(Y[Y.rtcQryData],s,n);return this._channel.send(a,El)},t.prototype.removeRTCData=function(n,r,i,o,s){return J(this,void 0,void 0,function(){var a,u;return Q(this,function(d){switch(d.label){case 0:return this._channel?(a=this._channel.codec.encodeRemoveRTCData(r,i,o,s),u=new Bs(Y[Y.rtcDelData],a,n),[4,this._channel.send(u)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return[2,d.sent().code]}})})},t.prototype.setRTCOutData=function(n,r,i,o){throw new Error("JSEngine's method not implemented.")},t.prototype.getRTCOutData=function(n,r){throw new Error("JSEngine's method not implemented.")},t.prototype.getRTCToken=function(n,r,i){return J(this,void 0,void 0,function(){var o,s;return Q(this,function(a){return this._channel?(o=this._channel.codec.encodeJoinRTCRoom(r,i),s=new De(Y[Y.rtcToken],o,n),[2,this._channel.send(s,_l)]):[2,{code:D.RC_NET_CHANNEL_INVALID}]})})},t.prototype.setRTCState=function(n,r){return J(this,void 0,void 0,function(){var i,o;return Q(this,function(s){switch(s.label){case 0:return this._channel?(i=this._channel.codec.encodeSetRTCState(r),o=new De(Y[Y.rtcUserState],i,n),[4,this._channel.send(o)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return[2,s.sent().code]}})})},t.prototype.getRTCUserInfo=function(n){return J(this,void 0,void 0,function(){return Q(this,function(r){throw new Error("Method not implemented.")})})},t.prototype.getRTCUserList=function(n){if(!this._channel)return Promise.resolve({code:D.RC_NET_CHANNEL_INVALID});var r=this._channel.codec.encodeGetRTCRoomInfo(),i=new De(Y[Y.rtcUList],r,n);return this._channel.send(i,oo)},t.prototype.joinLivingRoomAsAudience=function(n,r,i){return r===void 0&&(r=yn.LIVE),J(this,void 0,void 0,function(){var o,s,a,u,d,f,c,l;return Q(this,function(h){switch(h.label){case 0:return this._channel?(o=this._channel.codec.encodeJoinRTCRoom(r,i),s=new De(Y[Y.viewerJoinR],o,n),[4,this._channel.send(s,YC)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return a=h.sent(),u=a.code,d=a.data,u!==D.SUCCESS?[2,{code:u}]:(c=(f=d).rtcToken,l=f.entries,[2,{code:u,data:{token:c,kvEntries:l}}])}})})},t.prototype.quitLivingRoomAsAudience=function(n){return J(this,void 0,void 0,function(){var r,i,o;return Q(this,function(s){switch(s.label){case 0:return this._channel?(r=this._channel.codec.encodeQuitRTCRoom(),i=new De(Y[Y.viewerExitR],r,n),[4,this._channel.send(i)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return o=s.sent().code,this._rtcKVManager.reset(),[2,o]}})})},t.prototype.rtcIdentityChange=function(n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d;return Q(this,function(f){switch(f.label){case 0:return this._channel?(o=this._channel.codec.encodeIdentityChangeInfo(r,i),s=new De(Y[Y.rtcIdentityChange],o,n),[4,this._channel.send(s,oo)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return a=f.sent(),u=a.code,d=a.data,u!==D.SUCCESS?[2,{code:u}]:[2,{code:u,data:d}]}})})},t.prototype.pullRTCRoomEntry=function(n,r){return J(this,void 0,void 0,function(){var i,o,s,a,u,d,f,c,l;return Q(this,function(h){switch(h.label){case 0:return o=(i=this)._channel,s=i.currentUserId,o?(de.info("audience in room start pull KV"),a=o.codec.encodePullRTCRoomKV(n,0),u=new De(Y[Y.rtcPullKv],a,s),[4,o.send(u,bl)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return d=h.sent(),f=d.code,c=d.data,de.info("audience in room end pull KV, code: "+f+", data: "+JSON.stringify(c||{})),f===D.SUCCESS?(l=c.kvEntries,this._watcher.onRTCDataChange(l,n),[2,{code:f,data:c}]):[2,{code:f}]}})})},t.prototype.getRTCJoinedUserInfo=function(n){return J(this,void 0,void 0,function(){var r,i,o,s,a,u,d,f;return Q(this,function(c){switch(c.label){case 0:return i=(r=this)._channel,o=r.currentUserId,i?(s=i.codec.encodeQueryUserJoinedInfo(n),a=new De(Y[Y.rtcQueryJoined],s,o),[4,i.send(a,Il)]):[2,{code:D.RC_NET_CHANNEL_INVALID}];case 1:return u=c.sent(),d=u.code,f=u.data,d===D.SUCCESS?[2,{code:d,data:f}]:[2,{code:d}]}})})},t.prototype.getDeviceId=function(){return uT(this.runtime)},t.prototype.requestRoomPK=function(n){return J(this,void 0,void 0,function(){var r,i,o;return Q(this,function(s){switch(s.label){case 0:return this._channel?(r=this._channel.codec.encodeRequestRoomPK(n),i=new De(Y[Y.rtcInvite],r,n.roomId),[4,this._channel.send(i)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return o=s.sent().code,this._rtcKVManager.reset(),[2,o]}})})},t.prototype.cancelRoomPK=function(n){return J(this,void 0,void 0,function(){var r,i,o;return Q(this,function(s){switch(s.label){case 0:return this._channel?(r=this._channel.codec.encodeCancelRoomPK(n),i=new De(Y[Y.rtcCancelInvite],r,n.roomId),[4,this._channel.send(i)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return o=s.sent().code,this._rtcKVManager.reset(),[2,o]}})})},t.prototype.responseRoomPK=function(n){return J(this,void 0,void 0,function(){var r,i,o;return Q(this,function(s){switch(s.label){case 0:return this._channel?(r=this._channel.codec.encodeResponseRoomPK(n),i=new De(Y[Y.rtcInviteAnswer],r,n.roomId),[4,this._channel.send(i)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return o=s.sent().code,this._rtcKVManager.reset(),[2,o]}})})},t.prototype.endRoomPK=function(n){return J(this,void 0,void 0,function(){var r,i,o;return Q(this,function(s){switch(s.label){case 0:return this._channel?(r=this._channel.codec.encodeEndRoomPK(n),i=new De(Y[Y.rtcEndInvite],r,n.roomId),[4,this._channel.send(i)]):[2,D.RC_NET_CHANNEL_INVALID];case 1:return o=s.sent().code,this._rtcKVManager.reset(),[2,o]}})})},t.prototype.callExtra=function(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return Promise.resolve({code:D.EXTRA_METHOD_UNDEFINED})},t.prototype.getConversationListWithAllChannel=function(){throw new Error("Method not implemented.")},t.prototype.getConversationListWithAllChannelByPage=function(n,r){throw new Error("Method not implemented.")},t.prototype.clearConversations=function(){throw new Error("Method not implemented.")},t.prototype.setUserStatusListener=function(n,r){throw new Error("Method not implemented.")},t.prototype.setUserStatus=function(n){throw new Error("Method not implemented.")},t.prototype.subscribeUserStatus=function(n){throw new Error("Method not implemented.")},t.prototype.getUserStatus=function(n){throw new Error("Method not implemented.")},t.prototype.addToBlacklist=function(n){throw new Error("Method not implemented.")},t.prototype.removeFromBlacklist=function(n){throw new Error("Method not implemented.")},t.prototype.getBlacklist=function(){throw new Error("Method not implemented.")},t.prototype.getBlacklistStatus=function(n){throw new Error("Method not implemented.")},t.prototype.insertMessage=function(n,r,i){throw new Error("Method not implemented.")},t.prototype.deleteMessages=function(n){throw new Error("Method not implemented.")},t.prototype.deleteMessagesByTimestamp=function(n,r,i,o,s){throw new Error("Method not implemented.")},t.prototype.clearMessages=function(n,r,i){throw new Error("Method not implemented.")},t.prototype.getMessage=function(n){throw new Error("Method not implemented.")},t.prototype.setMessageContent=function(n,r,i){throw new Error("Method not implemented.")},t.prototype.setMessageSearchField=function(n,r,i){throw new Error("Method not implemented.")},t.prototype.searchConversationByContent=function(n,r,i,o){throw new Error("Method not implemented.")},t.prototype.searchMessageByContent=function(n,r,i,o,s,a){throw new Error("Method not implemented.")},t.prototype.getUnreadMentionedMessages=function(n,r){throw new Error("Method not implemented.")},t.prototype.setMessageSentStatus=function(n,r){throw new Error("Method not implemented.")},t.prototype.setMessageReceivedStatus=function(n,r){throw new Error("Method not implemented.")},t.prototype.clearUnreadCountByTimestamp=function(n,r,i,o){throw new Error("Method not implemented.")},t.prototype.getConversationNotificationStatus=function(n,r,i){var o=this._conversationManager.get(n,r,i);return o?Promise.resolve({code:D.SUCCESS,data:o.notificationStatus}):Promise.resolve({code:D.CONVER_GET_ERROR})},t.prototype.getRemoteHistoryMessages=function(n,r,i,o,s,a){return this.getHistoryMessage(n,r,i,o,s,a)},t}(D4),lT=function(){function e(t){this._context=t}return e.prototype.getCoreVersion=function(){return this._context.coreVersion},e.prototype.getAPIVersion=function(){return this._context.apiVersion},e.prototype.getAppkey=function(){return this._context.appkey},e.prototype.getCurrentId=function(){return this._context.getCurrentUserId()},e.prototype.getConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.sendMessage=function(t,n,r){return this._context.sendMessage(t,n,r)},e.prototype.registerMessageType=function(t,n,r,i){i===void 0&&(i=[]),this._context.registerMessageType(t,n,r,i)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getRTCJoinedUserInfo=function(t){return this._context.getRTCJoinedUserInfo(t)},e}(),X4=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return xt(t,e),t.prototype.getNaviInfo=function(){return this._context.getInfoFromCache()},t.prototype.joinRTCRoom=function(n,r,i,o){return this._context.joinRTCRoom(n,r,i,o)},t.prototype.quitRTCRoom=function(n){return this._context.quitRTCRoom(n)},t.prototype.rtcPing=function(n,r,i){return this._context.rtcPing(n,r,i)},t.prototype.getRTCRoomInfo=function(n){return this._context.getRTCRoomInfo(n)},t.prototype.getRTCUserInfoList=function(n){return this._context.getRTCUserInfoList(n)},t.prototype.getRTCUserInfo=function(n){return this._context.getRTCUserInfo(n)},t.prototype.setRTCUserInfo=function(n,r,i){return this._context.setRTCUserInfo(n,r,i)},t.prototype.removeRTCUserInfo=function(n,r){return this._context.removeRTCUserInfo(n,r)},t.prototype.setRTCData=function(n,r,i,o,s,a){return this._context.setRTCData(n,r,i,o,s,a)},t.prototype.setRTCTotalRes=function(n,r,i,o,s){return this._context.setRTCTotalRes(n,r,i,o,s)},t.prototype.setRTCCDNUris=function(n,r,i){return this._context.setRTCCDNUris(n,r,i)},t.prototype.getRTCData=function(n,r,i,o){return this._context.getRTCData(n,r,i,o)},t.prototype.removeRTCData=function(n,r,i,o,s){return this._context.removeRTCData(n,r,i,o,s)},t.prototype.setRTCOutData=function(n,r,i,o){return this._context.setRTCOutData(n,r,i,o)},t.prototype.getRTCOutData=function(n,r){return this._context.getRTCOutData(n,r)},t.prototype.getRTCToken=function(n,r,i){return this._context.getRTCToken(n,r,i)},t.prototype.setRTCState=function(n,r){return this._context.setRTCState(n,r)},t.prototype.getRTCUserList=function(n){return this._context.getRTCUserList(n)},t.prototype.joinLivingRoomAsAudience=function(n,r,i){return this._context.joinLivingRoomAsAudience(n,r,i)},t.prototype.quitLivingRoomAsAudience=function(n){return this._context.quitLivingRoomAsAudience(n)},t.prototype.rtcIdentityChange=function(n,r,i){return this._context.rtcIdentityChange(n,r,i)},t.prototype.requestRoomPK=function(n){return this._context.requestRoomPK(n)},t.prototype.cancelRoomPK=function(n){return this._context.cancelRoomPK(n)},t.prototype.responseRoomPK=function(n){return this._context.responseRoomPK(n)},t.prototype.endRoomPK=function(n){return this._context.endRoomPK(n)},t}(lT),Iy=function(){function e(){}return e.compress=function(t){for(var n=this,r={},i=0;i<t.length-1;i++){var o=t.charAt(i)+t.charAt(i+1);r.hasOwnProperty(o)?r[o].push(i):r[o]=[i]}for(var s=[],a=[],u=function(){if(a.length>0){var v=a.join("");if(a=[],v.length>26){var _=n.numberEncode(v.length),y=String.fromCharCode(n.dataType.NormalExt|_.length);s.push(y+_)}else{var E=String.fromCharCode(n.dataType.Normal|v.length);s.push(E)}s.push(v)}},d=0;d<t.length;){var f=n.indexOf(r,t,d);if(f.length<2)a.push(t.charAt(d++));else if(f.length<4)a.push(t.substr(d,f.length)),d+=f.length;else{var c=n.numberEncode(d-f.offset),l=n.numberEncode(f.length);if(c.length+l.length>=f.length)a.push(t.substr(d,f.length)),d+=f.length;else{u();var h=String.fromCharCode(n.dataType.Compressed|c.length<<2|l.length);s.push(h+c+l),d+=f.length}}}u();var p=n.numberEncode(t.length),m=String.fromCharCode(n.dataType.Tail|p.length);return s.push(m+p),s.join("")},e.uncompress=function(t){var n=this,r=0,i="";e:do{var o=t.charCodeAt(r++),s=o&n.dataType.Mark,a=15&o,u=void 0;switch(s){case n.dataType.Compressed:var d=a>>2,f=3&a;if(d===0||f===0)throw new Error("Data parsing error,at "+r);var c=n.numberDecode(t.substr(r,d)),l=n.numberDecode(t.substr(r+=d,f));if((c=i.length-c)+l>i.length)throw new Error("Data parsing error,at "+r);r+=f,i+=i.substr(c,l);break;case n.dataType.Tail:if((u=n.numberDecode(t.substr(r,a)))!==i.length)throw console.log(i.length),console.log(u),new Error("Data parsing error,at "+r);r+=a;break e;case n.dataType.NormalExt:u=n.numberDecode(t.substr(r,a)),i+=t.substr(r+=a,u),r+=u;break;case n.dataType.Normal:i+=t.substr(r,a),r+=a;break;case n.dataType.Mark:if(a>10)throw new Error("Data parsing error,at "+r);i+=t.substr(r,16+a),r+=16+a;break;default:throw new Error("Data parsing error,at "+r+" header:"+s)}}while(r<t.length);return i},e.indexOf=function(t,n,r){var i={length:0,offset:-1};if(n.length,r>=n.length-1)return i;var o=t[n.charAt(r)+n.charAt(r+1)];if(o[0]===r)return i;for(var s=n.length-r,a=0,u=o.length;a<u;a++){var d=o[a],f=r-d;if(!(f>this.max)){var c=Math.min(s,f);if(c<=i.length)break;if(!(i.length>2&&n.charAt(d+i.length-1)!==n.charAt(r+i.length-1))){for(var l=2,h=l;h<c&&n.charAt(d+h)===n.charAt(r+h);h++)l++;l>=i.length&&(i.length=l,i.offset=d)}}}return i},e.numberEncode=function(t){var n=this,r=[],i=0;do i=t%n.scale,r.push(n.chars.charAt(i)),t=(t-i)/n.scale;while(t>0);return r.join("")},e.numberDecode=function(t){for(var n=0,r=0,i=t.length-1;i>=0;i--){if((r=this.chars.indexOf(t.charAt(i)))===-1)throw new Error('decode number error, data is "'+t+'"');n=n*this.scale+r}return n},e.dataType={Tail:48,Compressed:64,NormalExt:80,Normal:96,Mark:112},e.chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",e.scale=e.chars.length,e.max=238327,e}(),Vs=1,js=!1,wy=typeof location!="undefined"&&location.protocol==="https://"?"https://":"http://",kc=function(){function e(t){this.info=t,this.logUrl="logcollection.ronghub.com",this.level=1,this.itv=30,this.times=5,this.deviceId="",this.deviceInfo="",this.logSwitch=0,this.logUrl=t.logPolicy.url||this.logUrl,this.level=t.logPolicy.level||this.level,this.itv=t.logPolicy.itv||this.itv,this.times=t.logPolicy.times||this.times,this.deviceId=uT(t.runtime),this.logSwitch=t.logSwitch;var n=s4(t.runtime);this.deviceInfo=n.type+"|"+n.version+"|"+wi.sessionId,this.startReport()}return e.init=function(t){return js=!0,e._instance||(e._instance=new e(t)),e._instance},e.getInstance=function(){return e._instance},e.prototype.startReport=function(){var t=this;if(this.logSwitch&&js){var n=this.itv*Math.pow(2,Vs-1);Vs<this.times&&Vs++,setTimeout(function(){t.reportRealtimeLog()},1e3*n)}},e.prototype.reportRealtimeLog=function(){var t=this,n=wi.realTimeLogList.filter(function(o){return o.level<=t.level});if(n.length!==0){var r=Iy.compress(n.map(function(o){return o.content}).join("")),i=""+wy+this.logUrl+"?version="+this.info.version+"&appkey="+this.info.appkey+"&userId="+this.info.userId+"&deviceId="+this.deviceId+"&deviceInfo="+this.deviceInfo+"&platform=Web";this.info.runtime.httpReq({method:"POST",url:i,body:r}).then(function(o){de.__clearRealTimeLog(),de.debug("report real-time log success");var s=o.data;s&&(s=JSON.parse(s),t.itv=s.nextTime,t.level=s.level,t.logSwitch=s.logSwitch,Vs=1),t.startReport()}).catch(function(o){de.debug("report real-time log error -> "+o),t.startReport()})}else this.startReport()},e.prototype.reportFullLog=function(t){return J(this,void 0,void 0,function(){var n,r,i,o,s,a,u,d,f,c,l=this;return Q(this,function(h){switch(h.label){case 0:return n=t.startTime,r=t.endTime,i=t.platform,o=t.logId,s=t.uri,a=Tp.getInstance(),de.debug("received report log msg, "+i.toLowerCase(),a),i.toLowerCase()==="web"&&a?n>r?(de.warn("report error: The start time("+n+") cannot be greater than the end time("+n+")"),[2]):[4,de.__insertLogIntoDatabase()]:[2];case 1:return h.sent(),[4,a.getRangeData(Wo,"time",n,r)];case 2:return u=(u=h.sent()).filter(function(p){return!p.userId||p.userId===l.info.userId}),d=Iy.compress(u.map(function(p){return p.content}).join("")||"no data"),f=1,(c=function(){if(!(f>3)&&js){var p=s||l.logUrl,m=""+wy+p+"?version="+l.info.version+"&appkey="+l.info.appkey+"&userId="+l.info.userId+"&logId="+o+"&deviceId="+l.deviceId+"&deviceInfo="+l.deviceInfo+"&platform=Web",v=5e3*(f-1);f++,setTimeout(function(){js&&l.info.runtime.httpReq({url:m,method:"POST",body:d}).then(function(){de.debug("report full log success!")}).catch(function(_){c(),de.warn("report full log error -> "+_)})},v)}})(),[2]}})})},e.prototype.distroy=function(){Vs=1,js=!1},e}();function Dc(e){return Object.assign({},e)}var Oy,Z4=function(){function e(t,n){var r;this._runtime=t,this._token="",this._pluginContextQueue=[],this._pluginInstanseMap={},this.coreVersion="5.1.1",this._versionInfo={},this._typingInfo={},this._isInternalConnected=!1,this._connectionStatus=Ke.DISCONNECTED,this._canRedirectConnect=!1,this._watcher={message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connectionState:void 0,rtcInnerWatcher:void 0,expansion:void 0,tag:void 0,conversationTagChanged:void 0,pullFinished:void 0,onConnecting:void 0,onConnected:void 0,onDisconnect:void 0,onSuspend:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0},this._typingInternalTimer=-1,this._typingExpireTime=2e3,this._typingChangedList=[],this.getChatRoomHistoryMessages=this.getChatroomHistoryMessages,this._options=Object.assign({},n),this.appkey=this._options.appkey,this.apiVersion=this._options.apiVersion,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.filter(function(o){return/^https?:\/\//.test(o)}),this._options.navigators=this._options.navigators.map(function(o){return o.replace(/\/$/g,"")}),this._options.navigators.length===0&&(r=this._options.navigators).push.apply(r,G3);var i={status:this._connectionStatusListener.bind(this),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),conversationTag:this._conversationTagListener.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this)};this._engine=fy()?new RCCppEngine(t,i,this._options):new Q4(t,i,this._options)}return e.init=function(t,n){return de.setLogLevel(n.logLevel),de.setLogStdout(n.logStdout),(n.indexDBSwitch||mt(n.indexDBSwitch))&&Tp.init(),de.debug("APIContext.init =>",n.appkey,n.navigators),this._context?(de.error("Repeat initialize!"),this._context):(de.warn("RCEngine Commit:","41dbe38d1b376ca0a791b23ed94be291e3f92e81"),this._context=new e(t,n),de.__insertLogIntoDatabase(),this._context)},e.destroy=function(){this._context&&(this._context._destroy(),this._context=void 0)},e.prototype.install=function(t,n){if(this._pluginInstanseMap[t.tag])return de.warn("Repeat install plugin: "+t.tag),this._pluginInstanseMap[t.tag];var r=t.tag==="RCRTC"?new X4(this):new lT(this),i=null;try{if(!t.verify(this._runtime))return null;i=t.setup(r,this._runtime,n)}catch(o){de.error(`install plugin error!
  816. `,o)}return["RCRTC","RCCall"].includes(t.tag)&&t.version&&t.name&&(this._versionInfo[t.name]=t.version),i&&this._pluginContextQueue.push(r),i&&(this._pluginInstanseMap[t.tag]=i),i},e.prototype._handleRedirect=function(){return J(this,void 0,void 0,function(){var t=this;return Q(this,function(n){switch(n.label){case 0:return de.debug("_handleRedirct",this._token),[4,this.connect(this._token,!0)];case 1:return n.sent().code!==D.SUCCESS&&this._canRedirectConnect&&(this._handleSuspend(),setTimeout(function(){t._handleRedirect()},5e3)),[2]}})})},e.prototype._connectionStatusListener=function(t){var n;return J(this,void 0,void 0,function(){return Q(this,function(r){return t===Ke.REDIRECT?(this._canRedirectConnect=!0,this._handleSuspend(),this._handleRedirect()):t===Ke.BLOCKED||t===Ke.KICKED_OFFLINE_BY_OTHER_CLIENT||t===Ke.DISCONNECT_BY_SERVER?(this._canRedirectConnect=!1,this._handleDisconnect()):t===Ke.CONNECTING?this._handleConnecting():t===Ke.CONNECTED?this._handleConnected():t===Ke.DISCONNECTED?this._handleDisconnect():t===Ke.NETWORK_UNAVAILABLE&&this._handleSuspend(),this._connectionStatus=t,((n=this._watcher.rtcInnerWatcher)===null||n===void 0?void 0:n.status)&&this._watcher.rtcInnerWatcher.status(t),this._pluginContextQueue.forEach(function(i){i.onconnectionstatechange&&i.onconnectionstatechange(t)}),this._watcher.connectionState&&this._watcher.connectionState(t),[2]})})},e.prototype._handleConnecting=function(){this._watcher.onConnecting&&this._watcher.onConnecting()},e.prototype._handleConnected=function(){this._watcher.onConnected&&this._watcher.onConnected()},e.prototype._handleDisconnect=function(){this._watcher.onDisconnect&&this._watcher.onDisconnect()},e.prototype._handleSuspend=function(){this._watcher.onSuspend&&this._watcher.onSuspend()},e.prototype._messageReceiver=function(t,n,r){var i,o,s;if((t.conversationType===$e.RTC_ROOM||Object.prototype.hasOwnProperty.call(Z3,t.messageType))&&this._watcher.rtcInnerWatcher&&this._watcher.rtcInnerWatcher.message)this._watcher.rtcInnerWatcher.message(Dc(t));else if(["RC:ChrmJoinNtf","RC:ChrmQuitNtf"].indexOf(t.messageType)===-1||typeof this._watcher.chatroomState!="function"){if(t.messageType!=="RC:ChrmMemChange"){if(t.messageType!==mn.TYPING_STATUS||(this._addTypingInfo(Dc(t)),!this._watcher.typingState))if(t.messageType!==mn.LOG_COMMAND||t.senderUserId!=="rongcloudsystem")if(t.messageType!==mn.INTERCEPT){if(!this._pluginContextQueue.some(function(_){if(!_.onmessage)return!1;try{return _.onmessage(Dc(t))}catch(y){return de.error("plugin error =>",y),!1}}))if(t.messageType!=="RC:ReadNtf")if(t.messageType!=="RC:RRReqMsg"){if(t.messageType!=="RC:RRRspMsg")return this._watcher.message&&this._watcher.message(Dc(t),n,r),t;var a=(s=t.content)===null||s===void 0?void 0:s.receiptMessageDic;a&&Array.isArray(a[this._engine.currentUserId])&&typeof this._watcher.messageReceiptResponse=="function"&&this._watcher.messageReceiptResponse({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId},t.senderUserId,a[this._engine.currentUserId])}else typeof this._watcher.messageReceiptRequest=="function"&&this._watcher.messageReceiptRequest({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId},t.content.messageUId,t.senderUserId);else typeof this._watcher.readReceiptReceived=="function"&&this._watcher.readReceiptReceived({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId},t.content.messageUId,t.content.lastMessageSendTime)}else this._MessageBlockedListener({conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId||"",blockType:t.content.interceptType,blockedMessageUId:t.content.msgUId});else{var u=t.content,d=u.startTime,f=u.endTime,c=u.platform,l=u.logId,h=u.uri,p=u.packageName,m={startTime:parseInt(d),endTime:parseInt(f),platform:c,logId:l,uri:h,packageName:p};(o=kc.getInstance())===null||o===void 0||o.reportFullLog(m)}}else if(typeof this._watcher.chatroomState=="function"){var v={};Array.isArray(t.content.userList)&&t.content.userList.forEach(function(_){v[_.userId]=_.status}),this._watcher.chatroomState({userChange:{users:v,chatroomId:t.targetId}})}}else this._watcher.chatroomState({userChange:{users:(i={},i[t.senderUserId]=t.messageType==="RC:ChrmQuitNtf"?cy.QUIT:cy.JOIN,i),chatroomId:t.targetId}})},e.prototype._batchMessageReceiver=function(t,n,r){var i=this,o=[];t.forEach(function(s){var a=i._messageReceiver(s,n,r);a&&o.push(a)}),o.length&&this._watcher.batchMessage&&this._watcher.batchMessage(o)},e.prototype._chatroomInfoListener=function(t){this._watcher.chatroomState&&this._watcher.chatroomState(t)},e.prototype._conversationInfoListener=function(t){this._watcher.conversationState&&this._watcher.conversationState(t)},e.prototype._expansionInfoListener=function(t){this._watcher.expansion&&this._watcher.expansion(t)},e.prototype._tagListener=function(){this._watcher.tag&&this._watcher.tag()},e.prototype._conversationTagListener=function(){this._watcher.conversationTagChanged&&this._watcher.conversationTagChanged()},e.prototype._typingStatusListener=function(t){this._watcher.typingState&&this._watcher.typingState(t)},e.prototype._pullFinishedListener=function(){this._watcher.pullFinished&&this._watcher.pullFinished()},e.prototype._MessageBlockedListener=function(t){this._watcher.messageBlocked&&this._watcher.messageBlocked(t)},e.prototype._rtcDataChange=function(t,n){this._pluginContextQueue.forEach(function(r){r.onrtcdatachange&&r.onrtcdatachange(t,n)})},e.prototype.assignWatcher=function(t){var n=this;Object.keys(this._watcher).forEach(function(r){if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];n._watcher[r]=Au(i)||sn(i)?i:void 0}})},e.prototype.resetWatcher=function(){var t=this;Object.keys(this._watcher).forEach(function(n){t._watcher[n]=void 0})},e.prototype._addTypingInfo=function(t){var n=t.senderUserId,r=t.conversationType,i=t.targetId,o=t.content,s=t.channelId,a=o.typingContentType,u=r+"#"+i+"#"+(s||"");this._typingInfo[u]||(this._typingInfo[u]=[]);var d=this._typingInfo[u].findIndex(function(f){return f.userId===n});d>=0&&this._typingInfo[u][d].messageType===a?this._typingInfo[u][d].timestamp=Date.now():(d>=0&&this._typingInfo[u].splice(d,1),this._typingInfo[u].push({userId:n,messageType:a,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())},e.prototype._startCheckTypingInfo=function(){var t=this;this._typingInternalTimer===-1&&Object.keys(this._typingInfo).length!==0&&(this._typingInternalTimer=setInterval(function(){for(var n in t._typingInfo){var r=t._typingInfo[n].length;t._typingInfo[n]=t._typingInfo[n].filter(function(o){return Date.now()-o.timestamp<t._typingExpireTime}),t._typingInfo[n].length===r||t._typingChangedList.includes(n)||t._typingChangedList.push(n),t._typingInfo[n].length===0&&delete t._typingInfo[n]}if(t._typingChangedList.length>0){var i=t._typingChangedList.map(function(o){return{conversationType:Number(o.split("#")[0]),targetId:o.split("#")[1],channelId:o.split("#")[2],list:t._typingInfo[o]||[]}});t._typingStatusListener(i),t._typingChangedList=[]}Object.keys(t._typingInfo).length===0&&(clearInterval(t._typingInternalTimer),t._typingInternalTimer=-1)},500))},e.prototype.getConnectedTime=function(){return this._engine.getConnectedTime()},e.prototype.getServerTime=function(){return this._engine.getServerTime()},e.prototype.getDeviceId=function(){return this._engine.getDeviceId()},e.prototype.getCurrentUserId=function(){return this._engine.currentUserId},e.prototype.getConnectionStatus=function(){return this._connectionStatus},Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),e.prototype.connect=function(t,n){return n===void 0&&(n=!1),J(this,void 0,void 0,function(){var r,i,o,s,a,u;return Q(this,function(d){switch(d.label){case 0:return this._connectionStatus===Ke.CONNECTED?[2,{code:D.SUCCESS,userId:this._engine.currentUserId}]:this._connectionStatus===Ke.CONNECTING?[2,{code:D.BIZ_ERROR_CONNECTING}]:typeof t!="string"||t.length===0?[2,{code:D.RC_CONN_USER_OR_PASSWD_ERROR}]:(this._token=t,r=t.split("@"),i=r[1],o=i?i.split(";").map(function(f){return/^https?:/.test(f)?f:"https://"+f}):[],[4,this._engine.navi.getInfo(this._getTokenWithoutNavi(),o,n,this._options.checkCA)]);case 1:return(s=d.sent())?(s==null?void 0:s.type)===1?[2,{code:D.PACKAGE_ENVIRONMENT_ERROR}]:(a=ho.getInfo(),[4,this._engine.connect(this._getTokenWithoutNavi(),s)]):[2,{code:D.RC_NAVI_RESOURCE_ERROR}];case 2:return u=d.sent(),de.__insertLogIntoDatabase(),u!==pn.REDIRECT?[3,4]:(this._connectionStatus=Ke.REDIRECT,[4,this.connect(t,!0)]);case 3:return[2,d.sent()];case 4:return u===D.SUCCESS&&(de.info("connect success, userId: "+this._engine.currentUserId),(s==null?void 0:s.type)!==1&&this._engine.reportSDKInfo&&this._engine.reportSDKInfo(a),kc.init({runtime:this._runtime,logSwitch:(s==null?void 0:s.logSwitch)||0,logPolicy:JSON.parse((s==null?void 0:s.logPolicy)||"{}"),appkey:this.appkey,version:this.apiVersion,userId:this._engine.currentUserId}),wi.init(this._engine.currentUserId),this._isInternalConnected=!0),u!==D.SUCCESS||fy()||s.openUS===1&&this._pullUserSettings(),u!==D.SUCCESS&&(this._connectionStatus=Ke.CONNECTION_CLOSED),[2,{code:u,userId:this._engine.currentUserId}]}})})},e.prototype._pullUserSettings=function(){return J(this,void 0,void 0,function(){return Q(this,function(t){return[2]})})},e.prototype.disconnect=function(){var t;return this._isInternalConnected=!1,clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,(t=kc.getInstance())===null||t===void 0||t.distroy(),de.__insertLogIntoDatabase(),wi.reset(),this._engine.disconnect(),this._pluginContextQueue.forEach(function(n){if(n.ondisconnect)try{n.ondisconnect()}catch(r){de.error("plugin error =>",r)}}),Promise.resolve()},e.prototype.reconnect=function(){return this._isInternalConnected?Promise.resolve({code:D.CAN_NOT_RECONNECT}):this.connect(this._getTokenWithoutNavi())},e.prototype._getTokenWithoutNavi=function(){return this._token.replace(/@.+$/,"@")},e.prototype.getInfoFromCache=function(){return this._engine.navi.getInfoFromCache(this._getTokenWithoutNavi())},e.prototype.registerMessageType=function(t,n,r,i){i===void 0&&(i=[]),this._engine.registerMessageType(t,n,r,i)},e.prototype.sendMessage=function(t,n,r,i){var o=this.getInfoFromCache();if(((o==null?void 0:o.grpRRVer)||0)===1&&r.messageType===mn.READ_RECEIPT_RESPONSE)return Promise.resolve({code:D.READ_RECEIPT_ERROR});var s=JSON.stringify(r.content);return LC(s)>131072?Promise.resolve({code:D.RC_MSG_CONTENT_EXCEED_LIMIT}):this._engine.sendMessage(t,n,r,i)},e.prototype.sendExpansionMessage=function(t){return J(this,void 0,void 0,function(){var n,r,i,o,s,a,u,d,f,c,l,h,p,m;return Q(this,function(v){switch(v.label){case 0:if(n=t.channelId,r=t.conversationType,i=t.targetId,o=t.messageUId,s=t.keys,a=t.expansion,u=t.removeAll,!t.canIncludeExpansion)return[2,{code:D.MESSAGE_KV_NOT_SUPPORT}];if(d=!1,f=!1,c=!1,sn(a)){for(h in l=Object.keys(a).length,d=l>20,a)if(p=a[h],f=Vn(h)&&!/^[A-Za-z0-9_=+-]+$/.test(h),(c=h.length>32||p.length>64)||f)break}return d||c?[2,{code:D.EXPANSION_LIMIT_EXCEET}]:f?[2,{code:D.BIZ_ERROR_INVALID_PARAMETER}]:(m={mid:o},a&&(m.put=a),s&&(m.del=s),u&&(m.removeAll=1),[4,this._engine.sendMessage(r,i,{content:m,messageType:mn.EXPANSION_NOTIFY,channelId:n})]);case 1:return[2,{code:v.sent().code}]}})})},e.prototype.sendReadReceiptMessage=function(t,n,r){return J(this,void 0,void 0,function(){var i;return Q(this,function(o){return i=this.getInfoFromCache(),((i==null?void 0:i.grpRRVer)||0)===0?[2,{code:D.READ_RECEIPT_ERROR,data:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(t,n,r)]})})},e.prototype.getMessageReader=function(t,n,r){return J(this,void 0,void 0,function(){var i;return Q(this,function(o){return i=this.getInfoFromCache(),((i==null?void 0:i.grpRRVer)||0)===0?[2,{code:D.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(t,n,r)]})})},e.prototype._destroy=function(){var t;this._isInternalConnected=!1,this._watcher={batchMessage:void 0,message:void 0,conversationState:void 0,chatroomState:void 0,connectionState:void 0,rtcInnerWatcher:void 0,expansion:void 0,tag:void 0,conversationTagChanged:void 0,typingState:void 0,pullFinished:void 0,onConnecting:void 0,onConnected:void 0,onDisconnect:void 0,onSuspend:void 0},this._engine.disconnect(),this._pluginContextQueue.forEach(function(n){if(n.ondestroy)try{n.ondestroy()}catch(r){de.error("plugin error =>",r)}}),this._pluginContextQueue.length=0,this._pluginInstanseMap={},(t=kc.getInstance())===null||t===void 0||t.distroy(),wi.reset()},e.prototype.getHistoryMessage=function(t,n,r,i,o,s,a){return r===void 0&&(r=0),i===void 0&&(i=20),o===void 0&&(o=0),s===void 0&&(s=""),a===void 0&&(a=""),this._engine.getHistoryMessage(t,n,r,i,o,s,a||"")},e.prototype.getConversationList=function(t,n,r,i,o){return t===void 0&&(t=300),o===void 0&&(o=""),this._engine.getConversationList(t,n,r,i,o)},e.prototype.getConversation=function(t,n,r){return this._engine.getConversation(t,n,r)},e.prototype.removeConversation=function(t,n,r){return r===void 0&&(r=""),this._engine.removeConversation(t,n,r)},e.prototype.clearUnreadCount=function(t,n,r){return r===void 0&&(r=""),this._engine.clearConversationUnreadCount(t,n,r)},e.prototype.clearAllUnreadCount=function(){return this._engine.clearAllUnreadCount()},e.prototype.getUnreadCount=function(t,n,r){return r===void 0&&(r=""),this._engine.getConversationUnreadCount(t,n,r)},e.prototype.getTotalUnreadCount=function(t,n,r){return this._engine.getAllConversationUnreadCount(t,n&&n.length>0?n:[$e.PRIVATE,$e.GROUP,$e.SYSTEM,$e.PUBLIC_SERVICE],!!r)},e.prototype.getFirstUnreadMessage=function(t,n,r){return r===void 0&&(r=""),this._engine.getFirstUnreadMessage(t,n,r)},e.prototype.setConversationStatus=function(t,n,r,i,o){o===void 0&&(o="");var s=[{conversationType:t,targetId:n,isTop:r,notificationStatus:i,channelId:o}];return this._engine.batchSetConversationStatus(s)},e.prototype.saveConversationMessageDraft=function(t,n,r,i){return i===void 0&&(i=""),this._engine.saveConversationMessageDraft(t,n,r,i)},e.prototype.getConversationMessageDraft=function(t,n,r){return r===void 0&&(r=""),this._engine.getConversationMessageDraft(t,n,r)},e.prototype.clearConversationMessageDraft=function(t,n,r){return r===void 0&&(r=""),this._engine.clearConversationMessageDraft(t,n,r)},e.prototype.recallMessage=function(t,n,r,i,o){return this._engine.recallMsg(t,n,r,i,o)},e.prototype.deleteRemoteMessage=function(t,n,r,i){return i===void 0&&(i=""),this._engine.deleteRemoteMessage(t,n,r,i)},e.prototype.deleteRemoteMessageByTimestamp=function(t,n,r,i){return i===void 0&&(i=""),this._engine.deleteRemoteMessageByTimestamp(t,n,r,i)},e.prototype.joinChatroom=function(t,n){return n===void 0&&(n=10),this._engine.joinChatroom(t,n)},e.prototype.joinExistChatroom=function(t,n){return n===void 0&&(n=10),this._engine.joinExistChatroom(t,n)},e.prototype.quitChatroom=function(t){return this._engine.quitChatroom(t)},e.prototype.getChatroomInfo=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),this._engine.getChatroomInfo(t,n,r)},e.prototype.setChatroomEntry=function(t,n){var r=n.key,i=n.value;return Mo(r)&&Ed(i)?this._engine.setChatroomEntry(t,n):Promise.resolve(D.BIZ_ERROR_INVALID_PARAMETER)},e.prototype.setChatroomEntries=function(t,n){for(var r=0;r<n.entries.length;r++){var i=n.entries[r],o=i.key,s=i.value;if(!Mo(o)||!Ed(s))return Promise.resolve({code:D.BIZ_ERROR_INVALID_PARAMETER})}return this._engine.setChatroomEntries(t,n)},e.prototype.forceSetChatroomEntry=function(t,n){var r=n.key,i=n.value;return Mo(r)&&Ed(i)?this._engine.forceSetChatroomEntry(t,n):Promise.resolve(D.BIZ_ERROR_INVALID_PARAMETER)},e.prototype.removeChatroomEntry=function(t,n){var r=n.key;return Mo(r)?this._engine.removeChatroomEntry(t,n):Promise.resolve(D.BIZ_ERROR_INVALID_PARAMETER)},e.prototype.removeChatroomEntries=function(t,n){for(var r=0;r<n.entries.length;r++){var i=n.entries[r].key;if(!Mo(i))return Promise.resolve({code:D.BIZ_ERROR_INVALID_PARAMETER})}return this._engine.removeChatroomEntries(t,n)},e.prototype.forceRemoveChatroomEntry=function(t,n){var r=n.key;return Mo(r)?this._engine.forceRemoveChatroomEntry(t,n):Promise.resolve(D.BIZ_ERROR_INVALID_PARAMETER)},e.prototype.getChatroomEntry=function(t,n){return this._engine.getChatroomEntry(t,n)},e.prototype.getAllChatroomEntries=function(t){return this._engine.getAllChatroomEntry(t)},e.prototype.getChatroomHistoryMessages=function(t,n,r,i){return n===void 0&&(n=20),r===void 0&&(r=0),i===void 0&&(i=0),this._engine.getChatroomHistoryMessages(t,i,n,r)},e.prototype.getFileToken=function(t,n,r,i){return J(this,void 0,void 0,function(){var o,s,a,u,d,f,c;return Q(this,function(l){switch(l.label){case 0:return o=this.getInfoFromCache(),s=(o==null?void 0:o.bosAddr)||"",a=(o==null?void 0:o.uploadServer)||"",u=(o==null?void 0:o.ossConfig)||"",[4,this._engine.getFileToken(t,n,r,i)];case 1:return d=l.sent(),f=d.code,c=d.data,f===D.SUCCESS?[2,Promise.resolve(Object.assign(c,{bos:s,qiniu:a,ossConfig:u}))]:[2,Promise.reject(f)]}})})},e.prototype.getFileUrl=function(t,n,r,i,o){return o===void 0&&(o=Rn.QINIU),J(this,void 0,void 0,function(){var s,a,u;return Q(this,function(d){switch(d.label){case 0:return(i==null?void 0:i.isBosRes)?[2,Promise.resolve(i)]:[4,this._engine.getFileUrl(t,o,n,r)];case 1:return s=d.sent(),a=s.code,u=s.data,a===D.SUCCESS?[2,Promise.resolve(u)]:[2,Promise.reject(a)]}})})},e.prototype.createTag=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.createTag(t)]})})},e.prototype.removeTag=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.removeTag(t)]})})},e.prototype.updateTag=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.updateTag(t)]})})},e.prototype.getTagList=function(){return J(this,void 0,void 0,function(){return Q(this,function(t){return[2,this._engine.getTagList()]})})},e.prototype.addTagForConversations=function(t,n){return J(this,void 0,void 0,function(){return Q(this,function(r){return n.length>1e3?[2,Promise.reject(D.CONVER_OUT_LIMIT_ERROR)]:[2,this._engine.addTagForConversations(t,n)]})})},e.prototype.removeTagForConversations=function(t,n){return J(this,void 0,void 0,function(){return Q(this,function(r){return[2,this._engine.removeTagForConversations(t,n)]})})},e.prototype.removeTagsForConversation=function(t,n){return J(this,void 0,void 0,function(){return Q(this,function(r){return[2,this._engine.removeTagsForConversation(t,n)]})})},e.prototype.getConversationListByTag=function(t,n,r,i){return J(this,void 0,void 0,function(){return Q(this,function(o){return[2,this._engine.getConversationListByTag(t,n,r,i)]})})},e.prototype.getUnreadCountByTag=function(t,n){return J(this,void 0,void 0,function(){return Q(this,function(r){return[2,this._engine.getUnreadCountByTag(t,n)]})})},e.prototype.setConversationStatusInTag=function(t,n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return[2,this._engine.setConversationStatusInTag(t,n,r)]})})},e.prototype.getTagsForConversation=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.getTagsForConversation(t)]})})},e.prototype.getBlockConversationList=function(){return this._engine.getBlockConversationList()},e.prototype.getTopConversationList=function(){return this._engine.getTopConversationList()},e.prototype.getUnreadMentionedCount=function(t){return this._engine.getUnreadMentionedCount(t)},e.prototype.getAllUnreadMentionedCount=function(){return this._engine.getAllUnreadMentionedCount()},e.prototype.callExtra=function(t){for(var n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(n=this._engine).callExtra.apply(n,fo([t],r))},e.prototype.clearConversations=function(t,n){return J(this,void 0,void 0,function(){return Q(this,function(r){switch(r.label){case 0:return[4,this._engine.clearConversations(t,n)];case 1:return[2,r.sent()]}})})},e.prototype.setUserStatusListener=function(t,n){return this._engine.setUserStatusListener(t,function(r){try{n(r)}catch(i){de.error(i)}})},e.prototype.addToBlacklist=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.addToBlacklist(t)]})})},e.prototype.removeFromBlacklist=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.removeFromBlacklist(t)]})})},e.prototype.getBlacklist=function(){return J(this,void 0,void 0,function(){return Q(this,function(t){return[2,this._engine.getBlacklist()]})})},e.prototype.getBlacklistStatus=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.getBlacklistStatus(t)]})})},e.prototype.insertMessage=function(t,n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return[2,this._engine.insertMessage(t,n,r)]})})},e.prototype.deleteMessages=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.deleteMessages(t)]})})},e.prototype.deleteMessagesByTimestamp=function(t,n,r,i,o){return o===void 0&&(o=""),J(this,void 0,void 0,function(){return Q(this,function(s){return[2,this._engine.deleteMessagesByTimestamp(t,n,r,i,o)]})})},e.prototype.clearMessages=function(t,n,r){return r===void 0&&(r=""),J(this,void 0,void 0,function(){return Q(this,function(i){return[2,this._engine.clearMessages(t,n,r)]})})},e.prototype.getMessage=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.getMessage(t)]})})},e.prototype.setMessageContent=function(t,n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return[2,this._engine.setMessageContent(t,n,r)]})})},e.prototype.setMessageSearchField=function(t,n,r){return J(this,void 0,void 0,function(){return Q(this,function(i){return[2,this._engine.setMessageSearchField(t,n,r)]})})},e.prototype.setMessageSentStatus=function(t,n){return J(this,void 0,void 0,function(){return Q(this,function(r){return[2,this._engine.setMessageSentStatus(t,n)]})})},e.prototype.setMessageReceivedStatus=function(t,n){return J(this,void 0,void 0,function(){return Q(this,function(r){return[2,this._engine.setMessageReceivedStatus(t,n)]})})},e.prototype.setUserStatus=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.setUserStatus(t)]})})},e.prototype.subscribeUserStatus=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.subscribeUserStatus(t)]})})},e.prototype.getUserStatus=function(t){return J(this,void 0,void 0,function(){return Q(this,function(n){return[2,this._engine.getUserStatus(t)]})})},e.prototype.searchConversationByContent=function(t,n,r,i){return n===void 0&&(n=[]),r===void 0&&(r=""),J(this,void 0,void 0,function(){return Q(this,function(o){return[2,this._engine.searchConversationByContent(t,n,r,i)]})})},e.prototype.searchMessageByContent=function(t,n,r,i,o,s,a){return a===void 0&&(a=""),J(this,void 0,void 0,function(){return Q(this,function(u){return[2,this._engine.searchMessageByContent(t,n,r,i,o,s,a)]})})},e.prototype.getUnreadMentionedMessages=function(t,n,r){return r===void 0&&(r=""),this._engine.getUnreadMentionedMessages(t,n,r)},e.prototype.clearUnreadCountByTimestamp=function(t,n,r,i){return i===void 0&&(i=""),this._engine.clearUnreadCountByTimestamp(t,n,r,i)},e.prototype.getConversationNotificationStatus=function(t,n,r){return r===void 0&&(r=""),this._engine.getConversationNotificationStatus(t,n,r)},e.prototype.getRemoteHistoryMessages=function(t,n,r,i,o,s){return this._engine.getRemoteHistoryMessages(t,n,r,i,o,s)},e.prototype.getConversationListWithAllChannel=function(){return this._engine.getConversationListWithAllChannel()},e.prototype.getConversationListWithAllChannelByPage=function(t,n){return this._engine.getConversationListWithAllChannelByPage(t,n)},e.prototype.joinRTCRoom=function(t,n,r,i){return this._engine.joinRTCRoom(t,n,r,i)},e.prototype.quitRTCRoom=function(t){return this._engine.quitRTCRoom(t)},e.prototype.rtcPing=function(t,n,r){return this._engine.rtcPing(t,n,r)},e.prototype.getRTCRoomInfo=function(t){return this._engine.getRTCRoomInfo(t)},e.prototype.getRTCUserInfoList=function(t){return this._engine.getRTCUserInfoList(t)},e.prototype.getRTCUserInfo=function(t){return this._engine.getRTCUserInfo(t)},e.prototype.setRTCUserInfo=function(t,n,r){return this._engine.setRTCUserInfo(t,n,r)},e.prototype.removeRTCUserInfo=function(t,n){return this._engine.removeRTCUserInfo(t,n)},e.prototype.setRTCData=function(t,n,r,i,o,s){return this._engine.setRTCData(t,n,r,i,o,s)},e.prototype.setRTCTotalRes=function(t,n,r,i,o){return o===void 0&&(o=""),this._engine.setRTCTotalRes(t,n,r,i,o)},e.prototype.setRTCCDNUris=function(t,n,r){return this._engine.setRTCCDNUris(t,n,r)},e.prototype.getRTCData=function(t,n,r,i){return this._engine.getRTCData(t,n,r,i)},e.prototype.removeRTCData=function(t,n,r,i,o){return this._engine.removeRTCData(t,n,r,i,o)},e.prototype.setRTCOutData=function(t,n,r,i){return this._engine.setRTCOutData(t,n,r,i)},e.prototype.getRTCOutData=function(t,n){return this._engine.getRTCOutData(t,n)},e.prototype.getRTCToken=function(t,n,r){return this._engine.getRTCToken(t,n,r)},e.prototype.setRTCState=function(t,n){return this._engine.setRTCState(t,n)},e.prototype.getRTCUserList=function(t){return this._engine.getRTCUserList(t)},e.prototype.joinLivingRoomAsAudience=function(t,n,r){return this._engine.joinLivingRoomAsAudience(t,n,r)},e.prototype.quitLivingRoomAsAudience=function(t){return this._engine.quitLivingRoomAsAudience(t)},e.prototype.rtcIdentityChange=function(t,n,r){return this._engine.rtcIdentityChange(t,n,r)},e.prototype.getRTCJoinedUserInfo=function(t){return this._engine.getRTCJoinedUserInfo(t)},e.prototype.requestRoomPK=function(t){return this._engine.requestRoomPK(t)},e.prototype.cancelRoomPK=function(t){return this._engine.cancelRoomPK(t)},e.prototype.responseRoomPK=function(t){return this._engine.responseRoomPK(t)},e.prototype.endRoomPK=function(t){return this._engine.endRoomPK(t)},e}();(function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"})(Oy||(Oy={}));/*! *****************************************************************************
  817. Copyright (c) Microsoft Corporation.
  818. Permission to use, copy, modify, and/or distribute this software for any
  819. purpose with or without fee is hereby granted.
  820. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  821. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  822. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  823. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  824. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  825. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  826. PERFORMANCE OF THIS SOFTWARE.
  827. ***************************************************************************** */var zf=function(e,t){return zf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},zf(e,t)},Yf=function(){return Yf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Yf.apply(this,arguments)};function Ha(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(d){try{u(r.next(d))}catch(f){o(f)}}function a(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){var f;d.done?i(d.value):(f=d.value,f instanceof n?f:new n(function(c){c(f)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}function qa(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(d){return function(f){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&f[0]?r.return:f[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,f[1])).done)return i;switch(r=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return s.label++,{value:f[1],done:!1};case 5:s.label++,r=f[1],f=[0];continue;case 7:f=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||f[0]!==6&&f[0]!==2)){s=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){s.label=f[1];break}if(f[0]===6&&s.label<i[1]){s.label=i[1],i=f;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(f);break}i[2]&&s.ops.pop(),s.trys.pop();continue}f=t.call(e,s)}catch(c){f=[6,c],r=0}finally{n=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([u,d])}}}var _n=new wi("RCIM"),sc=function(){return!(typeof uni=="undefined"||!function(e){for(var t=["canIUse","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},eB=sc(),zt,Ny={tag:"browser",httpReq:function(e){var t=e.method||Nr.GET,n=e.timeout||6e4,r=e.headers,i=e.query,o=e.body,s=ml(e.url,i);return new Promise(function(a){var u,d=(u=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest,typeof XMLHttpRequest!="undefined"&&u?new XMLHttpRequest:typeof XDomainRequest!="undefined"?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),f=Object.prototype.toString.call(d)==="[object XDomainRequest]";if(d.open(t,s),r&&d.setRequestHeader)for(var c in r)d.setRequestHeader(c,r[c]);if(f){d.timeout=n,d.onload=function(){a({data:d.responseText,status:d.status||200})},d.onerror=function(){a({status:d.status||0})},d.ontimeout=function(){a({status:d.status||0})};var l=typeof o=="object"?JSON.stringify(o):o;d.send(l)}else d.onreadystatechange=function(){d.readyState===4&&a({data:d.responseText,status:d.status})},d.onerror=function(){a({status:d.status||0})},setTimeout(function(){return a({status:d.status||0})},n),d.send(o)})},localStorage:window==null?void 0:window.localStorage,sessionStorage:window==null?void 0:window.sessionStorage,isSupportSocket:function(){var e=typeof WebSocket!="undefined";return e||_n.warn("websocket not support"),e},useNavi:!0,connectPlatform:"",isFromUniapp:eB,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(r){n.onclose=function(i){var o=i.code,s=i.reason;r(o,s)}},onError:function(r){n.onerror=r},onMessage:function(r){n.onmessage=function(i){r(i.data)}},onOpen:function(r){n.onopen=r},send:function(r){n.send(r)},close:function(r,i){n.close(r,i)}}},createDataChannel:function(e,t){return this.isSupportSocket()&&t==="websocket"?new Ts(this,e):new Ss(this,e)}},tB=sc(),Uc=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(r){_n.error(r)}}},Ay={setItem:Uc("setStorageSync"),getItem:Uc("getStorageSync"),removeItem:Uc("removeStorageSync"),clear:Uc("clearStorageSync")},Py={tag:"wechat",httpReq:function(e){var t=e.method||Nr.GET,n=e.timeout||6e4,r=e.headers,i=e.query,o=e.body,s=ml(e.url,i);return new Promise(function(a){wx.request({url:s,method:t,headers:r,timeout:n,data:o,success:function(u){a({data:u.data,status:u.statusCode})},fail:function(){a({status:D.RC_HTTP_REQ_TIMEOUT})}})})},localStorage:Ay,sessionStorage:Ay,isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:tB,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(r){n.onClose(function(i){r(i.code,i.reason)})},onError:function(r){n.onError(function(i){r(i.errMsg)})},onMessage:function(r){n.onMessage(function(i){r(i.data)})},onOpen:function(r){n.onOpen(r)},send:function(r){n.send({data:r})},close:function(r,i){n.close({code:r,reason:i})}}},createDataChannel:function(e,t){return t==="websocket"?new Ts(this,e):new Ss(this,e)}},nB=sc(),$c=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return my[e].apply(my,t)}catch(r){_n.error(r)}}},My={setItem:$c("setStorageSync"),getItem:$c("getStorageSync"),removeItem:$c("removeStorageSync"),clear:$c("clearStorageSync")},Ly={tag:"alipay",httpReq:function(e){var t=e.method||Nr.GET,n=e.timeout||6e4,r=e.headers,i=e.query,o=e.body,s=ml(e.url,i),a=e.dataType||"json";return new Promise(function(u){my.request({url:s,method:t,headers:r,timeout:n,data:o,dataType:a,success:function(d){u({data:d.data,status:d.status})},fail:function(){u({status:D.RC_HTTP_REQ_TIMEOUT})}})})},localStorage:My,sessionStorage:My,isSupportSocket:function(){return!1},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:nB,createDataChannel:function(e,t){return t==="websocket"?new Ts(this,e):new Ss(this,e)}},rB=sc(),xc=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return console.log("tt",tt),tt[e].apply(tt,t)}catch(r){_n.error(r)}}},ky={setItem:xc("setStorageSync"),getItem:xc("getStorageSync"),removeItem:xc("removeStorageSync"),clear:xc("clearStorageSync")},Dy={tag:"toutiao",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:rB,localStorage:ky,sessionStorage:ky,httpReq:function(e){return new Promise(function(t,n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(r){console.log("\u8C03\u7528\u6210\u529F",r.data);var i=(r==null?void 0:r.data)||{},o={data:JSON.stringify(i),status:r.statusCode};t(o)},fail:function(r){console.log("\u8C03\u7528\u5931\u8D25",r.errMsg),n({data:r.errMsg})}})})},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{onOpen:function(r){n.onOpen(r)},onClose:function(r){n.onClose(function(i){return r(i.code,i.reason)})},onError:function(r){n.onError(function(i){return r(i.errMsg)})},onMessage:function(r){n.onMessage(function(i){return r(i.data)})},send:function(r){n.send({data:r})},close:function(r,i){n.close({code:r,reason:i})}}},createDataChannel:function(e,t){return t==="websocket"?new Ts(this,e):new Ss(this,e)}},iB=sc(),Bc=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return console.log("swan",swan),swan[e].apply(swan,t)}catch(r){_n.error(r)}}},Uy={setItem:Bc("setStorageSync"),getItem:Bc("getStorageSync"),removeItem:Bc("removeStorageSync"),clear:Bc("clearStorageSync")},$y={tag:"baidu",isSupportSocket:function(){return!0},useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:iB,localStorage:Uy,sessionStorage:Uy,httpReq:function(e){return new Promise(function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(r){console.log("\u8C03\u7528\u6210\u529F",r.data);var i=(r==null?void 0:r.data)||{},o={data:JSON.stringify(i),status:r.statusCode};t(o)},fail:function(r){console.log("\u8C03\u7528\u5931\u8D25",r.errorCode),n({data:r.errorCode})}})})},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{onOpen:function(r){n.onOpen(r)},onClose:function(r){n.onClose(function(i){return r(i.code,i.reason)})},onError:function(r){n.onError(function(i){return r(i.errMsg)})},onMessage:function(r){n.onMessage(function(i){return r(i.data)})},send:function(r){n.send({data:r})},close:function(r,i){n.close({code:r,reason:i})}}},createDataChannel:function(e,t){return t==="websocket"?new Ts(this,e):new Ss(this,e)}},Fc=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(r){_n.error(r)}}},xy={setItem:Fc("setStorageSync"),getItem:Fc("getStorageSync"),removeItem:Fc("removeStorageSync"),clear:Fc("clearStorageSync")},oB={tag:"uniapp",httpReq:function(e){var t=e.method||Nr.GET,n=e.timeout||6e4,r=e.headers,i=e.query,o=e.body,s=ml(e.url,i);return new Promise(function(a){uni.request({url:s,method:t,headers:r,timeout:n,data:o,success:function(u){a({data:u.data,status:u.statusCode})},fail:function(){a({status:D.RC_HTTP_REQ_TIMEOUT})}})})},localStorage:xy,sessionStorage:xy,isSupportSocket:function(){return!0},useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},r=uni.connectSocket(n);return{onClose:function(i){r.onClose(function(o){i(o.code,o.reason)})},onError:function(i){r.onError(function(o){i(o.errMsg)})},onMessage:function(i){r.onMessage(function(o){i(o.data)})},onOpen:function(i){r.onOpen(i)},send:function(i){r.send({data:i})},close:function(i,o){r.close({code:i,reason:o})}}},createDataChannel:function(e,t){return t==="websocket"?new Ts(this,e):new Ss(this,e)}},Hs=function(e){return e&&e.canIUse&&e.getSystemInfo},sB=typeof uni!="undefined"&&Hs(uni)?function(){switch({}.VUE_APP_PLATFORM){case"app-plus":return oB;case"mp-baidu":return $y;case"mp-toutiao":return Dy;case"mp-alipay":return Ly;case"mp-weixin":return Py;default:return Ny}}():typeof wx!="undefined"&&Hs(wx)?Py:typeof my!="undefined"&&Hs(my)?Ly:typeof tt!="undefined"&&Hs(tt)?Dy:typeof swan!="undefined"&&Hs(swan)?$y:Ny;function Vu(e){var t=e.conversationType,n=e.channelId,r=e.messageType,i=e.content,o=e.senderUserId,s=e.targetId,a=e.sentTime,u=e.receivedTime,d=e.messageUId,f=e.messageDirection,c=e.isPersited,l=e.isCounted,h=e.isOffLineMessage,p=e.canIncludeExpansion,m=e.expansion,v=e.receivedStatus,_=e.disableNotification,y=e.isMentioned,E=e.isStatusMessage,S=e.readReceiptInfo,T=e.pushConfig,R=e.messageId;return v||(v=Da.UNREAD),{messageType:r,channelId:n||"",content:i,senderUserId:o,targetId:s,conversationType:t,sentTime:a,receivedTime:u,messageUId:d,messageDirection:f,isPersited:c,isCounted:l,isOffLineMessage:h,isMentioned:y,disableNotification:_,isStatusMessage:E,canIncludeExpansion:p,expansion:m,receivedStatus:v,readReceiptInfo:S,pushConfig:T,messageId:R}}(function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED"})(zt||(zt={}));var _o,hr=function(e){function t(n){var r=e.call(this)||this;if(t.imClient)return _n.error("Please do not repeatedly perform the init method"),t.imClient;Zt("options.navigators",n.navigators,function(o){return In(o)&&(o.length===0||o.every(Ua))});var i=n==null?void 0:n.connectType;return i?pi.WEBSOCKET!==i&&pi.COMET!==i&&(_n.warn("RongIMLib connectionType must be "+pi.WEBSOCKET+" or "+pi.COMET),i=pi.WEBSOCKET):i=pi.WEBSOCKET,r._context=Z4.init(sB,{appkey:n.appkey,apiVersion:"5.1.1",navigators:n.navigators||[],miniCMPProxy:n.customCMP||[],connectionType:i,logLevel:n.logLevel,logStdout:n.logStdout,indexDBSwitch:n.indexDBSwitch,checkCA:n.checkCA}),r.watch(),t.imClient=r,r}return function(n,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=n}zf(n,r),n.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}(t,e),Object.defineProperty(t.prototype,"context",{get:function(){if(!this._context)throw new Error("Please perform the init method!");return this._context},enumerable:!1,configurable:!0}),t.prototype.watch=function(){var n=this,r={onConnecting:function(){n.emit(zt.CONNECTING)},onConnected:function(){n.emit(zt.CONNECTED)},onDisconnect:function(){n.emit(zt.DISCONNECT)},onSuspend:function(){n.emit(zt.SUSPEND)},batchMessage:function(i){n.emit(zt.MESSAGES,{messages:i.map(function(o){return Vu(o)})})},typingState:function(i){n.emit(zt.TYPING_STATUS,{status:i})},readReceiptReceived:function(i,o,s){n.emit(zt.READ_RECEIPT_RECEIVED,{conversation:i,messageUId:o,sentTime:s})},messageReceiptRequest:function(i,o,s){n.emit(zt.MESSAGE_RECEIPT_REQUEST,{conversation:i,messageUId:o,senderUserId:s})},messageReceiptResponse:function(i,o,s){n.emit(zt.MESSAGE_RECEIPT_RESPONSE,{conversation:i,receivedUserId:o,messageUIdList:s})},conversationState:function(i){var o=i.map(function(s){return{conversation:{conversationType:s.conversationType,latestMessage:s.latestMessage?Vu(s.latestMessage):null,targetId:s.targetId,unreadMessageCount:s.unreadMessageCount,hasMentioned:s.hasMentioned,mentionedInfo:s.mentionedInfo,lastUnreadTime:s.lastUnreadTime,notificationStatus:s.notificationStatus,isTop:s.isTop,channelId:s.channelId,unreadMentionedCount:s.unreadMentionedCount},updatedItems:s.updatedItems}});n.emit(zt.CONVERSATION,{conversationList:o})},chatroomState:function(i){n.emit(zt.CHATROOM,i)},expansion:function(i){n.emit(zt.EXPANSION,i)},pullFinished:function(){n.emit(zt.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){n.emit(zt.TAG)},conversationTagChanged:function(){n.emit(zt.CONVERSATION_TAG)},messageBlocked:function(i){n.emit(zt.MESSAGE_BLOCKED,i)}};this.context.assignWatcher(r)},t}(rc),ju={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:D.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},fs={},aB={};for(var By in ju){var Fy=ju[By],Vy=Fy.code;fs[Vy]=By,aB[Vy]=Fy}ju.ROAMING_SERVICE_UNAVAILABLE.code;var EF=function(e){_o=_o||new hr(e)};function CF(e,t){return _o==null?void 0:_o.context.install(e,t)}function TF(e){return Ha(this,void 0,void 0,function(){var t;return qa(this,function(n){switch(n.label){case 0:return Zt("token",e,Ft.STRING,!0),_n.warn("RongIMLib Version: 5.1.1, Commit: 756868a83166be55e30e49e5685b1644456ea30f"),[4,_o.context.connect(e,!0)];case 1:return(t=n.sent()).code===D.SUCCESS?[2,{code:t.code,data:{userId:t.userId}}]:[2,{code:t.code,msg:fs[t.code]}]}})})}function SF(){return _o.context.disconnect()}function RF(e,t,n){_o.on(e,t,n)}function bF(e,t){return Ha(this,void 0,void 0,function(){var n,r;return qa(this,function(i){switch(i.label){case 0:return Zt("options.count",t.count,Ft.NUMBER,!0),n="id:"+e,_n.debug("join chatroom ->"+n),[4,hr.imClient.context.joinChatroom(e,t.count)];case 1:return(r=i.sent())!==D.SUCCESS?(_n.warn("join chatroom fail ->code+:"+fs[r]+","+n),[2,{code:r,msg:fs[r]}]):[2,{code:r}]}})})}var dT=function(e,t,n,r){n===void 0&&(n=!0),r===void 0&&(r=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=r};function sr(e,t,n){return t===void 0&&(t=!0),n===void 0&&(n=!0),function(r){return new dT(e,r,t,n)}}var fT,Wf,cB=sr("RC:ImgMsg"),uB=sr("RC:HQVCMsg"),lB=sr("RC:SightMsg"),IF=sr("RC:TxtMsg"),dB=sr("RC:CombineMsg"),fB=sr("RC:FileMsg");sr("RC:GIFMsg");sr("RC:VcMsg");sr("RC:LBSMsg");sr("RC:ReferenceMsg");sr("RC:ImgTextMsg");var xo={qiniu:function(e,t,n,r){var i,o="https://"+t.uploadHost.qiniu;i=qs()+Et[0][1]||o,Et.shift();var s=new XMLHttpRequest;s.upload&&t.support_options&&(s.upload.onprogress=function(a){n.onProgress(a.loaded,a.total)}),s.onreadystatechange=function(){if(s.readyState===4){var a=s.responseText||"{}";(a=JSON.parse(a)).filename=t.uniqueValue,a.uploadMethod=Rn?Rn.QINIU:"",s.status===200?n.onCompleted(a):Et.length?xo[Et[0][0]](e,t,n,r):n.onError("upload fail")}},t.isChunk&&(i=function(a,u){var d="";return Hy(u,function(f,c){f!=="token"&&(d+=(d?"&":"")+encodeURIComponent(f)+"="+encodeURIComponent(c))}),d&&(a+=(a.indexOf("?")>0?"&":"?")+d),a}(i+="/mkblk/"+e.size,t.multi_parmas)),s.open(t.method,i,!0),n.onOpen(s),t.stream&&s.setRequestHeader("authorization","UpToken "+t.multi_parmas.token),Hy(t.headers,function(a,u){s.setRequestHeader(a,u)}),s.send(e)},baidu:function(e,t,n,r){if(console.log(r,t),r.size>jy)throw new Error("the file size is over 5GB!");var i=t||{};t=t||Wf;var o=new XMLHttpRequest,s=qs();if(!(!i.uploadHost.bos&&!i.bosUploadPath)){var a=s+Et[0][1]+i.bosUploadPath;Et.shift();var u=i.bosHeader||{},d={filename:t.uniqueValue||r.uniqueName,name:r.name,downloadUrl:a,isBosRes:!0};o.upload&&t.support_options&&(o.upload.onprogress=function(f){n.onProgress(f.loaded,f.total,!0)}),o.onreadystatechange=function(){if(o.readyState===4){var f=o.responseText||"{}";(f=JSON.parse(f)).filename=t.uniqueValue,o.status===200?n.onCompleted(d,!0):Et.length?xo[Et[0][0]](e,t,n,r):n.onError("upload fail")}},o.open(t.method,a,!0),o.setRequestHeader("authorization",u.bosToken),o.setRequestHeader("x-bce-date",u.bosDate),o.send(r)}},aliyun:function(e,t,n,r){if(r.size>jy)throw new Error("the file size is over 5GB!");const i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token"));const o=Et[0][1];Et.shift(),e=e||fT,t=(t=t||{})||Wf;var s=new XMLHttpRequest,a=qs()+t.ossBucketName+"."+o;s.upload&&t.support_options&&(s.upload.onprogress=function(d){n.onProgress(d.loaded,d.total)}),s.onreadystatechange=function(){if(s.readyState===4){var d=s.responseText||"{}";(d=JSON.parse(d)).name=t.uniqueValue,d.filename=t.uploadFileName,d.uploadMethod=Rn?Rn.ALI:"",s.status===200?n.onCompleted(d):Et.length?xo[Et[0][0]](i,t,n,r):n.onError("upload fail")}},s.open(t.method,a,!0),console.log("ali:url",a);var u=t.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",r),s.send(e)},s3:function(e,t,n,r){var i=new FormData,o=new XMLHttpRequest,s=qs();const a=Et[0][1];var u=s+t.s3BucketName+"."+a;console.log("uploadS3:url",u),Et.shift(),o.upload&&t.support_options&&(o.upload.onprogress=function(c){n.onProgress(c.loaded,c.total)}),o.onreadystatechange=function(){if(o.readyState===4){var c=o.responseText||"{}";if((c=JSON.parse(c)).name=t.uniqueValue,c.filename=t.uploadFileName,c.uploadMethod=Rn.AWS,console.log("UploadMethod:",Rn),o.status===200||o.status===204)n.onCompleted(c);else if(Et.length){const l=new FormData;l.set("file",e.get("file")),l.set("key",e.get("key")),l.set("token",e.get("token")),xo[Et[0][0]](l,t,n,r)}else n.onError("upload fail")}},o.open(t.method,u,!0);var d=t?t.s3Header:{},f=r&&r.type;f==="text/html"?i.set("Content-Disposition","inline;"):i.set("Content-Disposition","attachment;"),i.set("Content-Type",f),i.set("x-amz-credential",d.s3Credential),i.set("x-amz-algorithm",d.s3Algorithm),i.set("x-amz-date",d.s3Date),i.set("policy",d.s3Policy),i.set("x-amz-signature",d.s3Signature),i.set("key",t.uploadFileName),i.set("file",r),o.send(i)},stc:function(e,t,n,r){new FormData;var i=new XMLHttpRequest;qs();var o="https://"+Et[0][1]+"/"+t.stcBucketName+"/"+t.uploadFileName;Et.shift(),i.upload&&t.support_options&&(i.upload.onprogress=function(a){n.onProgress(a.loaded,a.total)}),i.onreadystatechange=function(){if(i.readyState===4){var a=i.responseText||"{}";if((a=JSON.parse(a)).name=t.uniqueValue,a.filename=t.uploadFileName,a.uploadMethod=Rn?Rn.STC:"",i.status===200||i.status===204)n.onCompleted(a);else if(Et.length){const u=new FormData;u.set("file",e.get("file")),u.set("key",e.get("key")),u.set("token",e.get("token")),xo[Et[0][0]](u,t,n,r)}else n.onError("upload fail")}},i.open("PUT",o,!0);var s=t?t.stcHeader:{};i.setRequestHeader("Content-Type",r.type),r.type==="text/html"?i.setRequestHeader("Content-Disposition","inline;"):i.setRequestHeader("Content-Disposition","attachment;"),i.setRequestHeader("Authorization",s.stcAuthorization),i.setRequestHeader("x-amz-content-sha256",s.stcContentSha256),i.setRequestHeader("x-amz-date",s.stcDate),i.send(r)}},Et=[],jy=5368709120;function Hy(e,t){for(var n in e)t(n,e[n])}function qs(){var e="https://";return location.protocol!=="http:"&&location.protocol!=="file:"||(e="http://"),e}function hB(e,t,n){var r,i,o=e&&e.type||"text/plain",s=o.indexOf("image")>-1?1:4,a=Math.ceil(e.size/t.stc_chunk_size),u=t&&JSON.parse(t.ossConfig?t.ossConfig:"");Array.isArray(u)||(u=[]);var d=u.find(m=>Object.keys(m).includes("stc")),f="uploads";hr.imClient.getFileToken(s,r,"POST",f).then(function(m){r=m.fileName,i="https://"+d.stc+"/"+t.stcBucketName+"/"+r,console.log("uploadStcMultipart:url",i);var v=new XMLHttpRequest;v.open("POST",i+"?"+f,!0),o==="text/html"?v.setRequestHeader("Content-Disposition","inline;"):v.setRequestHeader("Content-Disposition","attacshment;"),v.setRequestHeader("Authorization",m&&m.stcAuthorization),v.setRequestHeader("x-amz-content-sha256",m&&m.stcContentSha256),v.setRequestHeader("x-amz-date",m&&m.stcDate),v.setRequestHeader("Content-Type",o),v.send(),v.onreadystatechange=function(_){if(v.readyState===4){var y=v.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",y),v.status===200||v.status===204?function(E){for(var S=[],T=1;T<=a;T++)S.push(p(E,T));h(E,S)}(Array.isArray(y)&&y[1]):n.onError("uploadStcMultipart:did not get uploadId")}}},function(m){n.onError("uploadStcMultipart:"+m)});var c=[],l=new Map;function h(m,v){v&&Array.isArray(v)&&v.length!==0&&Promise.all(v).then(()=>{var _="uploadId="+m;if(l.size===a)hr.imClient.context.getFileToken(s,r,"POST",_).then(function(S){console.log("onSuccess",S),console.log("onSuccess:uploadId",m);var T=new XMLHttpRequest;T.open("POST",i+"?"+_,!0),T.setRequestHeader("Authorization",S&&S.stcAuthorization),T.setRequestHeader("x-amz-content-sha256",S&&S.stcContentSha256),T.setRequestHeader("x-amz-date",S&&S.stcDate),T.setRequestHeader("Content-Type",o);var R="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",C=Array.from(l.keys()||[]).sort((w,L)=>w-L);console.log("keys",C),C.map(w=>{R+=`<Part><ETag>${l.get(w)}</ETag><PartNumber>${w}</PartNumber></Part>`}),R+="</CompleteMultipartUpload>",T.send(R),console.log("xml",R),T.onreadystatechange=function(){if(T.readyState===4)if(T.status===200||T.status===204){var w={};w.name=e.name,w.filename=t.uploadFileName,w.uploadMethod=Rn.STC,n.onCompleted(w)}else n.onError("uploadStcMultipart:upload does not end")}},function(S){n.onError("uploadStcMultipart:"+S)});else{var y=[];for(var E of c)y.push(p(m,E));h(m,y)}},_=>{console.error(_),n.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");var y=[];for(var E of c)y.push(p(m,E));h(m,y)})}function p(m,v){return new Promise((_,y)=>{var E="partNumber="+v+"&uploadId="+m;hr.imClient.context.getFileToken(s,r,"PUT",E).then(function(S){console.log("signature "+v+" onSuccess",S);var T=e&&e.slice((v-1)*t.stc_chunk_size,v*t.stc_chunk_size);console.log("fileChunk:size",T.size);var R=new XMLHttpRequest;R.open("PUT",i+"?"+E,!0),R.setRequestHeader("Authorization",S&&S.stcAuthorization),R.setRequestHeader("x-amz-content-sha256",S&&S.stcContentSha256),R.setRequestHeader("x-amz-date",S&&S.stcDate),R.setRequestHeader("Content-Type",o),R.send(T),R.onreadystatechange=function(){if(R.readyState===4)if(R.status===200||R.status===204){var C=R.getResponseHeader("etag");console.log("etag:"+v,C),l.set(v,C),_(C)}else c.includes(v)||c.push(v),y(v)}},function(S){console.log("getETags:\u7B7E\u540D\u9A8C\u8BC1\u5931\u8D25"),c.includes(v)||c.push(v),y(v)})})}}var hT={form:function(e,t){var n=new FormData;if(t.unique_key){var r=e.name.substr(e.name.lastIndexOf(".")),i=Jf()+r;n.append(t.unique_key,i),t.uniqueValue=i}return n.append(t.file_data_name,e),Qf(t.multi_parmas,function(o,s){n.append(o,s)}),n},json:function(e,t){var n={};if(t.unique_key){var r=e.name.substr(e.name.lastIndexOf(".")),i=Jf()+r;n[t.unique_key]=i,t.uniqueValue=i}return n[t.file_data_name]=e,Qf(t.multi_parmas,function(o,s){n[o]=s}),JSON.stringify(n)},data:function(e,t){return e}};function Jf(){var e=new Date().getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==="x"?n:3&n|8).toString(16)})}function Qf(e,t){for(var n in e)t(n,e[n])}var Vc,wd=0;function pB(e){this.options=function(t){var n={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:hT.form,genUId:Jf};if(!t||!t.domain)throw new Error("domain is null");for(var r in t)n[r]=t[r];return n}(e),this.setOptions=function(t){var n=this;Qf(t,function(r,i){n.options[r]=i})},console.log("options",e),this.upload=function(t,n){if(t){var r=this;(function(i,o,s){if(fT=i,Wf=o,Et=[],o.ossConfig){const f=JSON.parse(o.ossConfig);let c,l,h="";const p=[];f.forEach(m=>{const v=Number(m.p)-1;for(const _ in m)_==="aliyun"&&(h=m[_]),_==="s3"&&(c=m[_]),_==="stc"&&(l=m[_]),_!=="p"&&(p[v]=[_,m[_]])}),p.forEach(function(m){m&&Et.push(m)}),f.length!==Et.length&&(Et=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",h],["s3",c],["stc",l]])}else Et=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];var a;if(o.ossConfig){var u=o&&JSON.parse(o.ossConfig);Array.isArray(u)||(u=[]),a=u.find(f=>Object.keys(f).includes("stc"))}if(a&&parseInt(a.p)===1&&i.size>=4194304)hB(i,o,s);else{var d=o.data(i,o);xo[Et[0][0]](d,o,s,i)}})(t,this.options,{onProgress:function(i,o,s){Vc=i,s?Vc=wd+i/o*(o-wd):wd=Vc,n.onProgress(Vc,o)},onCompleted:function(i){n.onCompleted(i)},onError:function(i){n.onError(i)},onOpen:function(i){r.xhr=i}})}else n.onError("upload file is null.")},this.cancel=function(){this.xhr&&this.xhr.abort()}}var qy={init:function(e){return new pB(e)},dataType:hT,resize:function(e,t,n){e.type;var r=document.createElement("canvas"),i=new FileReader;i.readAsDataURL(e),i.onload=function(o){var s=o.target.result,a=new Image;a.src=s;var u=a.width,d=a.height,f=function(l,h){var p=1,m=l.width,v=h.maxWidth||0;v>0&&m>v&&(p=v/m);var _=l.height,y=h.maxHeight||0;if(y>0&&_>y){var E=y/_;p=Math.min(p,E)}var S=h.maxSize||0,T=Math.ceil(l.size/1e3);if(T>S){var R=S/T;p=Math.min(p,R)}return p}({width:u,height:d,size:o.total},t),c=s;f<1&&(c=function(l,h,p){r.width=h,r.height=p,r.getContext("2d").drawImage(l,0,0,h,p);var m="image/jpg";return r.toDataURL(m)}(a,u*f,d*f)),n(c)}}};const gB=function(e,t,n){var r=document.createElement("canvas"),i=r.getContext("2d"),o=new Image;o.onload=function(){var s=function(d,f,c){var l,h,p,m=d<f,v=0,_=0;return(m?f/d:d/f)>c.scale?(m?(h=100,_=((p=f/(l=d/100))-c.maxHeight)/2):(p=100,v=((h=d/(l=f/100))-c.maxWidth)/2),{w:h,h:p,x:-v,y:-_}):(m?(l=f/c.maxHeight,p=c.maxHeight,h=d/l):(l=d/c.maxWidth,h=c.maxWidth,p=f/l),{w:h,h:p,x:-v,y:-_})}(o.width,o.height,t);r.width=s.w>t.maxWidth?t.maxWidth:s.w,r.height=s.h>t.maxHeight?t.maxHeight:s.h,i.drawImage(o,s.x,s.y,s.w,s.h);try{var a=r.toDataURL(e.type,t.quality),u=new RegExp("^data:image/[^;]+;base64,");a=a.replace(u,""),n(a)}catch(d){throw new Error(d)}},o.src=typeof e=="string"?"data:image/jpg;base64,"+e:function(s){var a=window.URL||window.webkitURL;return a?a.createObjectURL(s):""}(e)},mB=function(e,t){var n=e.file,r=e.compress;gB(n,r,t)},pT=function(e,t){if(e.getToken)e.getToken(function(r,i){i=i||{},e.multi_parmas||(e.multi_parmas={}),e.multi_parmas.token=r,e.uploadHost||(e.uploadHost={}),e.uploadHost.bos=i.bos,e.ossConfig=i.ossConfig,e.bosHeader||(e.bosHeader={}),e.bosHeader.bosDate=i.bosDate,e.bosHeader.bosToken=i.bosToken,e.bosUploadPath=i.path,e.aliHeader={},e.aliHeader.osskeyId=i.osskeyId,e.aliHeader.ossPolicy=i.ossPolicy,e.aliHeader.ossSign=i.ossSign,e.ossBucketName=i.ossBucketName,e.uploadFileName=i.fileName,e.s3Header={},e.s3Header.s3Credential=i.s3Credential,e.s3Header.s3Algorithm=i.s3Algorithm,e.s3Header.s3Date=i.s3Date,e.s3Header.s3Policy=i.s3Policy,e.s3Header.s3Signature=i.s3Signature,e.s3BucketName=i.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=i.stcAuthorization,e.stcHeader.stcContentSha256=i.stcContentSha256,e.stcHeader.stcDate=i.stcDate,e.stcBucketName=i.stcBucketName,e.headers||(e.headers={}),e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken "+r),console.log("data",i);var o=qy.init(e);t(o)});else{e.headers||(e.headers={}),e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=qy.init(e);t(n)}};var Od,jc,gT=function(e,t,n){t.upload(e.file,{onError:function(r){n.onError(r)},onProgress:function(r,i){n.onProgress(r,i)},onCompleted:function(r){r.filename||(r.filename=r.hash);var i=e.compressThumbnail||mB;e.compress?i(e,function(o){r.thumbnail=o,n.onCompleted(r)}):n.onCompleted(r)}})},vB=function(e){var t=this;this.instance=e,this.upload=function(n,r){gT({file:n},t.instance,r)},this.cancel=function(){t.instance.cancel()}},yB=function(e,t){var n=this;this.cfg=t,this.instance=e,this.upload=function(r,i){var o={file:r,compress:n.cfg};gT(o,n.instance,i)},this.cancel=function(){n.instance.cancel()}},_B=function(e,t){pT(e,function(n){var r={maxHeight:e.maxHeight||160,maxWidth:e.maxWidth||160,quality:e.quality||.5,scale:e.scale||2.4},i=new yB(n,r);t(i)})},EB=function(e,t){pT(e,function(n){var r=new vB(n);t(r)})},CB=_B;function Ky(e){return Od=Od||new AudioContext,new Promise(function(t,n){Od.decodeAudioData(e,function(r){t({duration:r.duration,length:r.length})},n)})}function TB(e,t,n,r,i){return Zt("fileType",e,X3,!0),Zt("filename",t,Ft.STRING),Zt("saveName",n,Ft.STRING),Zt("serverType",i,Ft.NUMBER),new Promise(function(o){hr.imClient.context.getFileUrl(e,t,n,r,i).then(function(s){o({code:D.SUCCESS,data:s})}).catch(function(s){o({code:s})})})}function SB(e,t,n){return Ha(this,void 0,void 0,function(){var r,i,o,s,a,u,d,f,c;return qa(this,function(l){switch(l.label){case 0:return n=n||{},t instanceof dT?(Zt("conversation.channelId",e==null?void 0:e.channelId,Ft.CHANNEL_ID),r=e.conversationType,i=e.targetId,o=e.channelId,s="conversationType:"+r+",targetId:"+i,_n.debug("send message ->"+s),(a=Object.assign(n,t)).channelId=o||"",[4,hr.imClient.context.sendMessage(r,i,a)]):(_n.warn("send message fail -> message parameter is not an instance of BaseMessage"),[2,ju.ILLGAL_PARAMS]);case 1:return u=l.sent(),d=u.code,f=u.data,d===D.SUCCESS?(c=Vu(f),[2,{code:d,data:c}]):(_n.warn("send message fail ->"+d+":"+fs[d]+","+s),[2,{code:d,msg:fs[d],data:Vu({isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:t.isPersited||!1,isCounted:t.isCounted||!1,disableNotification:!!(n==null?void 0:n.disableNotification),canIncludeExpansion:!!(n==null?void 0:n.canIncludeExpansion),expansion:(n==null?void 0:n.expansion)||null,conversationType:r,targetId:i,channelId:o||"",senderUserId:hr.imClient.context.getCurrentUserId(),messageUId:"",messageDirection:Qn.SEND,isOffLineMessage:!1,sentTime:(f==null?void 0:f.sentTime)||0,receivedTime:0,isStatusMessage:n.isStatusMessage||!1,receivedStatus:Da.UNREAD})}])}})})}function ac(e,t){return function(n,r,i,o){return new Promise(function(s){var a;(function(u,d,f,c){var l,h=this;if(d===void 0&&(d=Xt.FILE),l=d===Xt.IMAGE?Xt.IMAGE:Xt.FILE,!jc){jc="upload.qiniup.com";var p=hr.imClient.context.getInfoFromCache();if(p&&p.ossConfig)try{var m=JSON.parse(p.ossConfig).find(function(_){return _.qiniu!==void 0});m&&(jc=m.qiniu)}catch{}}var v=Yf({domain:jc,getToken:function(_){hr.imClient.context.getFileToken(l).then(function(y){_(y.token,y)}).catch(function(y){f.onFail(y)})}},c);(l===Xt.IMAGE?CB:EB)(v,function(_){_.upload(u,{onProgress:function(y,E){var S,T=Math.floor(y/E*100);(S=f.onProgress)===null||S===void 0||S.call(f,T)},onCompleted:function(y){return Ha(h,void 0,void 0,function(){var E=this;return qa(this,function(S){return TB(l,y.filename,y.name,y,y.uploadMethod).then(function(T){return Ha(E,void 0,void 0,function(){var R,C;return qa(this,function(w){return T.code!==0?(f.onFail(T),[2]):((R=T.data).type=u.type,R.name=y.name||y.filename,d===Xt.AUDIO?(typeof u.arrayBuffer=="function"?u.arrayBuffer().then(Ky).then(function(L){Object.assign(R,L),f.onSuccess(R)},function(){f.onSuccess(R)}):((C=new FileReader).onload=function(){C.result?Ky(C.result).then(function(L){Object.assign(R,L),f.onSuccess(R)},function(){f.onSuccess(R)}):f.onSuccess(R)},C.onerror=function(){R.duration=0,f.onSuccess(R)},C.readAsArrayBuffer(u)),[2]):(l===Xt.IMAGE&&(R.thumbnail=y.thumbnail),f.onSuccess(R),[2]))})})}).catch(function(T){f.onFail(T)}),[2]})})},onError:function(y){f.onFail(y)}})})})(r.file,e,{onProgress:i==null?void 0:i.onProgress,onSuccess:function(u){var d,f=((d=i==null?void 0:i.onComplete)===null||d===void 0?void 0:d.call(i,{url:u.downloadUrl}))||t(u,r);SB(n,f,o).then(s)},onFail:function(u){s({code:D.UPLOAD_FILE_FAILED,msg:u||D[D.UPLOAD_FILE_FAILED]})}},((a=o)===null||a===void 0?void 0:a.thumbnailConfig)||{})})}}ac(Xt.FILE,function(e,t){return new fB({name:e.name,size:t.file.size,type:t.file.type,fileUrl:e.downloadUrl,user:t.user,extra:t.extra})});ac(Xt.IMAGE,function(e,t){return new cB({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})});ac(Xt.AUDIO,function(e,t){return new uB({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})});ac(Xt.SIGHT,function(e,t){return new lB({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})});function wF(e,t,n,r){return Zt("messageType",e,Ft.STRING,!0),Zt("isPersited",t,Ft.BOOLEAN,!0),Zt("isCounted",n,Ft.BOOLEAN,!0),hr.imClient.context.registerMessageType(e,t,n,r),sr(e,t,n)}ac(Xt.COMBINE_HTML,function(e,t){return new dB({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})});ho.add("imlib","5.1.1"),ho.validEngine("~5.1.1")||_n.error("The current engine version '"+ho.getInfo().engine+"' error\uFF0Cimlib required engine version at least '~5.1.1'.");/*! *****************************************************************************
  828. Copyright (c) Microsoft Corporation.
  829. Permission to use, copy, modify, and/or distribute this software for any
  830. purpose with or without fee is hereby granted.
  831. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  832. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  833. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  834. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  835. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  836. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  837. PERFORMANCE OF THIS SOFTWARE.
  838. ***************************************************************************** */function ie(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(d){try{u(r.next(d))}catch(f){o(f)}}function a(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){var f;d.done?i(d.value):(f=d.value,f instanceof n?f:new n(function(c){c(f)})).then(s,a)}u((r=r.apply(e,t||[])).next())})}const F=new wi("RCRTC");var B,Xf;(function(e){e[e.SUCCESS=1e4]="SUCCESS",e[e.SIGNAL_DISCONNECTED=5e4]="SIGNAL_DISCONNECTED",e[e.PARAMS_ERROR=50001]="PARAMS_ERROR",e[e.REPERT_JOIN_ROOM=50002]="REPERT_JOIN_ROOM",e[e.NOT_IN_ROOM=50003]="NOT_IN_ROOM",e[e.SERVICE_INVALID=50004]="SERVICE_INVALID",e[e.RTC_TOKEN_INVALID=50006]="RTC_TOKEN_INVALID",e[e.SIGNAL_ERROR=53001]="SIGNAL_ERROR",e[e.CREATE_OFFER_FAILED=53003]="CREATE_OFFER_FAILED",e[e.REQUEST_FAILED=53004]="REQUEST_FAILED",e[e.MCU_SERVER_NOT_FOUND=53005]="MCU_SERVER_NOT_FOUND",e[e.BROADCAST_SUB_LIST_NOT_EMPTY=53007]="BROADCAST_SUB_LIST_NOT_EMPTY",e[e.ROOM_HAS_BEEN_DESTROYED=53008]="ROOM_HAS_BEEN_DESTROYED",e[e.NOT_OPEN_VIDEO_AUDIO_SERVER=53009]="NOT_OPEN_VIDEO_AUDIO_SERVER",e[e.GET_USER_MEDIA_FAILED=53010]="GET_USER_MEDIA_FAILED",e[e.GET_DISPLAY_MEDIA_FAILED=53011]="GET_DISPLAY_MEDIA_FAILED",e[e.PERMISSION_DENIED=53012]="PERMISSION_DENIED",e[e.CREATE_CUSTOM_TRACK_FAILED=53013]="CREATE_CUSTOM_TRACK_FAILED",e[e.INVALID_TAGS=53014]="INVALID_TAGS",e[e.INVALID_USER_ID=53015]="INVALID_USER_ID",e[e.CREATE_FILE_TRACK_FAILED=53016]="CREATE_FILE_TRACK_FAILED",e[e.INVALID_FILE_INSTANCE=53017]="INVALID_FILE_INSTANCE",e[e.SET_REMOTE_DESCRIPTION_FAILED=53018]="SET_REMOTE_DESCRIPTION_FAILED",e[e.BROWSER_NOT_SUPPORT=53019]="BROWSER_NOT_SUPPORT",e[e.TRACK_NOT_READY=53020]="TRACK_NOT_READY",e[e.VIDEO_TRACK_MISS_MEDIA_ELEMENT=53021]="VIDEO_TRACK_MISS_MEDIA_ELEMENT",e[e.TRACK_PLAY_ERROR=53022]="TRACK_PLAY_ERROR",e[e.SIGNAL_AUDIENCE_JOIN_ROOM_FAILED=53023]="SIGNAL_AUDIENCE_JOIN_ROOM_FAILED",e[e.SIGNAL_ROOM_CHANGE_IDENTITY_FAILED=53024]="SIGNAL_ROOM_CHANGE_IDENTITY_FAILED",e[e.PACKAGE_ENVIRONMENT_ERROR=53025]="PACKAGE_ENVIRONMENT_ERROR",e[e.PUBLISH_TRACK_LIMIT_EXCEEDED=53026]="PUBLISH_TRACK_LIMIT_EXCEEDED",e[e.CDN_RESOURCE_IS_EMPTY=53027]="CDN_RESOURCE_IS_EMPTY",e[e.SIGNAL_JOIN_RTC_ROOM_REFUSED=53028]="SIGNAL_JOIN_RTC_ROOM_REFUSED",e[e.NO_PERMISSION_TO_USE_REQUESTED_DEVICE=53029]="NO_PERMISSION_TO_USE_REQUESTED_DEVICE",e[e.THE_FUNCTION_IS_DISABLED_IN_PKROOM=53030]="THE_FUNCTION_IS_DISABLED_IN_PKROOM"})(B||(B={})),function(e){e[e.JOIN_REFUSED=40032]="JOIN_REFUSED"}(Xf||(Xf={}));class mT{constructor(){this.queue=[],this.locked=!1}checkToStart(){return ie(this,void 0,void 0,function*(){if(this.queue.length===0||this.locked)return;this.locked=!0;const{resolve:t,task:n,reject:r}=this.queue.shift();let i;try{i=yield n(),t(i)}catch(o){r(o)}this.locked=!1,this.checkToStart()})}push(t){const n=new Promise((r,i)=>{this.queue.push({resolve:r,task:t,reject:i})});return this.checkToStart(),n}}const RB=new mT,Lt=e=>RB.push(e);let vT=!0,yT=!0;function Ks(e,t,n){const r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function Rs(e,t,n){if(!e.RTCPeerConnection)return;const r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(s,a){if(s!==t)return i.apply(this,arguments);const u=d=>{const f=n(d);f&&(a.handleEvent?a.handleEvent(f):a(f))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(a,u),i.apply(this,[s,u])};const o=r.removeEventListener;r.removeEventListener=function(s,a){if(s!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(a))return o.apply(this,arguments);const u=this._eventMap[t].get(a);return this._eventMap[t].delete(a),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,o.apply(this,[s,u])},Object.defineProperty(r,"on"+t,{get(){return this["_on"+t]},set(s){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),s&&this.addEventListener(t,this["_on"+t]=s)},enumerable:!0,configurable:!0})}function bB(e){return typeof e!="boolean"?new Error("Argument type: "+typeof e+". Please use a boolean."):(vT=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function IB(e){return typeof e!="boolean"?new Error("Argument type: "+typeof e+". Please use a boolean."):(yT=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function yg(){if(typeof window=="object"){if(vT)return;typeof console!="undefined"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Ol(e,t){yT&&console.warn(e+" is deprecated, please use "+t+" instead.")}function Gy(e){return Object.prototype.toString.call(e)==="[object Object]"}function _T(e){return Gy(e)?Object.keys(e).reduce(function(t,n){const r=Gy(e[n]),i=r?_T(e[n]):e[n],o=r&&!Object.keys(i).length;return i===void 0||o?t:Object.assign(t,{[n]:i})},{}):e}function Zf(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach(r=>{r.endsWith("Id")?Zf(e,e.get(t[r]),n):r.endsWith("Ids")&&t[r].forEach(i=>{Zf(e,e.get(i),n)})}))}function zy(e,t,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(t===null)return i;const o=[];return e.forEach(s=>{s.type==="track"&&s.trackIdentifier===t.id&&o.push(s)}),o.forEach(s=>{e.forEach(a=>{a.type===r&&a.trackId===s.id&&Zf(e,a,i)})}),i}const Yy=yg;function ET(e,t){const n=e&&e.navigator;if(!n.mediaDevices)return;const r=function(s){if(typeof s!="object"||s.mandatory||s.optional)return s;const a={};return Object.keys(s).forEach(u=>{if(u==="require"||u==="advanced"||u==="mediaSource")return;const d=typeof s[u]=="object"?s[u]:{ideal:s[u]};d.exact!==void 0&&typeof d.exact=="number"&&(d.min=d.max=d.exact);const f=function(c,l){return c?c+l.charAt(0).toUpperCase()+l.slice(1):l==="deviceId"?"sourceId":l};if(d.ideal!==void 0){a.optional=a.optional||[];let c={};typeof d.ideal=="number"?(c[f("min",u)]=d.ideal,a.optional.push(c),c={},c[f("max",u)]=d.ideal,a.optional.push(c)):(c[f("",u)]=d.ideal,a.optional.push(c))}d.exact!==void 0&&typeof d.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[f("",u)]=d.exact):["min","max"].forEach(c=>{d[c]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[f(c,u)]=d[c])})}),s.advanced&&(a.optional=(a.optional||[]).concat(s.advanced)),a},i=function(s,a){if(t.version>=61)return a(s);if((s=JSON.parse(JSON.stringify(s)))&&typeof s.audio=="object"){const u=function(d,f,c){f in d&&!(c in d)&&(d[c]=d[f],delete d[f])};u((s=JSON.parse(JSON.stringify(s))).audio,"autoGainControl","googAutoGainControl"),u(s.audio,"noiseSuppression","googNoiseSuppression"),s.audio=r(s.audio)}if(s&&typeof s.video=="object"){let u=s.video.facingMode;u=u&&(typeof u=="object"?u:{ideal:u});const d=t.version<66;if(u&&(u.exact==="user"||u.exact==="environment"||u.ideal==="user"||u.ideal==="environment")&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||d)){let f;if(delete s.video.facingMode,u.exact==="environment"||u.ideal==="environment"?f=["back","rear"]:u.exact!=="user"&&u.ideal!=="user"||(f=["front"]),f)return n.mediaDevices.enumerateDevices().then(c=>{let l=(c=c.filter(h=>h.kind==="videoinput")).find(h=>f.some(p=>h.label.toLowerCase().includes(p)));return!l&&c.length&&f.includes("back")&&(l=c[c.length-1]),l&&(s.video.deviceId=u.exact?{exact:l.deviceId}:{ideal:l.deviceId}),s.video=r(s.video),Yy("chrome: "+JSON.stringify(s)),a(s)})}s.video=r(s.video)}return Yy("chrome: "+JSON.stringify(s)),a(s)},o=function(s){return t.version>=64?s:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[s.name]||s.name,message:s.message,constraint:s.constraint||s.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(s,a,u){i(s,d=>{n.webkitGetUserMedia(d,a,f=>{u&&u(o(f))})})}.bind(n),n.mediaDevices.getUserMedia){const s=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(a){return i(a,u=>s(u).then(d=>{if(u.audio&&!d.getAudioTracks().length||u.video&&!d.getVideoTracks().length)throw d.getTracks().forEach(f=>{f.stop()}),new DOMException("","NotFoundError");return d},d=>Promise.reject(o(d))))}}}function CT(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function TT(e){if(typeof e=="object"&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=n=>{n.stream.addEventListener("addtrack",r=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(s=>s.track&&s.track.id===r.track.id):{track:r.track};const o=new Event("track");o.track=r.track,o.receiver=i,o.transceiver={receiver:i},o.streams=[n.stream],this.dispatchEvent(o)}),n.stream.getTracks().forEach(r=>{let i;i=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(s=>s.track&&s.track.id===r.id):{track:r};const o=new Event("track");o.track=r,o.receiver=i,o.transceiver={receiver:i},o.streams=[n.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Rs(e,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t))}function ST(e){if(typeof e=="object"&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){const t=function(i,o){return{track:o,get dtmf(){return this._dtmf===void 0&&(o.kind==="audio"?this._dtmf=i.createDTMFSender(o):this._dtmf=null),this._dtmf},_pc:i}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(s,a){let u=i.apply(this,arguments);return u||(u=t(this,s),this._senders.push(u)),u};const o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(s){o.apply(this,arguments);const a=this._senders.indexOf(s);a!==-1&&this._senders.splice(a,1)}}const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(i){this._senders=this._senders||[],n.apply(this,[i]),i.getTracks().forEach(o=>{this._senders.push(t(this,o))})};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(i){this._senders=this._senders||[],r.apply(this,[i]),i.getTracks().forEach(o=>{const s=this._senders.find(a=>a.track===o);s&&this._senders.splice(this._senders.indexOf(s),1)})}}else if(typeof e=="object"&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){const t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){const n=t.apply(this,[]);return n.forEach(r=>r._pc=this),n},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function RT(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[n,r,i]=arguments;if(arguments.length>0&&typeof n=="function")return t.apply(this,arguments);if(t.length===0&&(arguments.length===0||typeof n!="function"))return t.apply(this,[]);const o=function(a){const u={};return a.result().forEach(d=>{const f={id:d.id,timestamp:d.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[d.type]||d.type};d.names().forEach(c=>{f[c]=d.stat(c)}),u[f.id]=f}),u},s=function(a){return new Map(Object.keys(a).map(u=>[u,a[u]]))};if(arguments.length>=2){const a=function(u){r(s(o(u)))};return t.apply(this,[a,n])}return new Promise((a,u)=>{t.apply(this,[function(d){a(s(o(d)))},u])}).then(r,i)}}function bT(e){if(!(typeof e=="object"&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!("getStats"in e.RTCRtpSender.prototype)){const n=e.RTCPeerConnection.prototype.getSenders;n&&(e.RTCPeerConnection.prototype.getSenders=function(){const i=n.apply(this,[]);return i.forEach(o=>o._pc=this),i});const r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){const i=r.apply(this,arguments);return i._pc=this,i}),e.RTCRtpSender.prototype.getStats=function(){const i=this;return this._pc.getStats().then(o=>zy(o,i.track,!0))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){const n=e.RTCPeerConnection.prototype.getReceivers;n&&(e.RTCPeerConnection.prototype.getReceivers=function(){const r=n.apply(this,[]);return r.forEach(i=>i._pc=this),r}),Rs(e,"track",r=>(r.receiver._pc=r.srcElement,r)),e.RTCRtpReceiver.prototype.getStats=function(){const r=this;return this._pc.getStats().then(i=>zy(i,r.track,!1))}}if(!("getStats"in e.RTCRtpSender.prototype)||!("getStats"in e.RTCRtpReceiver.prototype))return;const t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){const n=arguments[0];let r,i,o;return this.getSenders().forEach(s=>{s.track===n&&(r?o=!0:r=s)}),this.getReceivers().forEach(s=>(s.track===n&&(i?o=!0:i=s),s.track===n)),o||r&&i?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):r?r.getStats():i?i.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function IT(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(o=>this._shimmedLocalStreams[o][0])};const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(o,s){if(!s)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=t.apply(this,arguments);return this._shimmedLocalStreams[s.id]?this._shimmedLocalStreams[s.id].indexOf(a)===-1&&this._shimmedLocalStreams[s.id].push(a):this._shimmedLocalStreams[s.id]=[s,a],a};const n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(o){this._shimmedLocalStreams=this._shimmedLocalStreams||{},o.getTracks().forEach(u=>{if(this.getSenders().find(d=>d.track===u))throw new DOMException("Track already exists.","InvalidAccessError")});const s=this.getSenders();n.apply(this,arguments);const a=this.getSenders().filter(u=>s.indexOf(u)===-1);this._shimmedLocalStreams[o.id]=[o].concat(a)};const r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[o.id],r.apply(this,arguments)};const i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},o&&Object.keys(this._shimmedLocalStreams).forEach(s=>{const a=this._shimmedLocalStreams[s].indexOf(o);a!==-1&&this._shimmedLocalStreams[s].splice(a,1),this._shimmedLocalStreams[s].length===1&&delete this._shimmedLocalStreams[s]}),i.apply(this,arguments)}}function wT(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return IT(e);const n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){const d=n.apply(this);return this._reverseStreams=this._reverseStreams||{},d.map(f=>this._reverseStreams[f.id])};const r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(d){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},d.getTracks().forEach(f=>{if(this.getSenders().find(c=>c.track===f))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[d.id]){const f=new e.MediaStream(d.getTracks());this._streams[d.id]=f,this._reverseStreams[f.id]=d,d=f}r.apply(this,[d])};const i=e.RTCPeerConnection.prototype.removeStream;function o(d,f){let c=f.sdp;return Object.keys(d._reverseStreams||[]).forEach(l=>{const h=d._reverseStreams[l],p=d._streams[h.id];c=c.replace(new RegExp(p.id,"g"),h.id)}),new RTCSessionDescription({type:f.type,sdp:c})}function s(d,f){let c=f.sdp;return Object.keys(d._reverseStreams||[]).forEach(l=>{const h=d._reverseStreams[l],p=d._streams[h.id];c=c.replace(new RegExp(h.id,"g"),p.id)}),new RTCSessionDescription({type:f.type,sdp:c})}e.RTCPeerConnection.prototype.removeStream=function(d){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[d.id]||d]),delete this._reverseStreams[this._streams[d.id]?this._streams[d.id].id:d.id],delete this._streams[d.id]},e.RTCPeerConnection.prototype.addTrack=function(d,f){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const c=[].slice.call(arguments,1);if(c.length!==1||!c[0].getTracks().find(p=>p===d))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(p=>p.track===d))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const h=this._streams[f.id];if(h)h.addTrack(d),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const p=new e.MediaStream([d]);this._streams[f.id]=p,this._reverseStreams[p.id]=f,this.addStream(p)}return this.getSenders().find(p=>p.track===d)},["createOffer","createAnswer"].forEach(function(d){const f=e.RTCPeerConnection.prototype[d],c={[d](){const l=arguments;return arguments.length&&typeof arguments[0]=="function"?f.apply(this,[h=>{const p=o(this,h);l[0].apply(null,[p])},h=>{l[1]&&l[1].apply(null,h)},arguments[2]]):f.apply(this,arguments).then(h=>o(this,h))}};e.RTCPeerConnection.prototype[d]=c[d]});const a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=s(this,arguments[0]),a.apply(this,arguments)):a.apply(this,arguments)};const u=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get(){const d=u.get.apply(this);return d.type===""?d:o(this,d)}}),e.RTCPeerConnection.prototype.removeTrack=function(d){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!d._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(d._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let f;this._streams=this._streams||{},Object.keys(this._streams).forEach(c=>{this._streams[c].getTracks().find(l=>d.track===l)&&(f=this._streams[c])}),f&&(f.getTracks().length===1?this.removeStream(this._reverseStreams[f.id]):f.removeTrack(d.track),this.dispatchEvent(new Event("negotiationneeded")))}}function eh(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const r=e.RTCPeerConnection.prototype[n],i={[n](){return arguments[0]=new(n==="addIceCandidate"?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};e.RTCPeerConnection.prototype[n]=i[n]})}function OT(e,t){Rs(e,"negotiationneeded",n=>{const r=n.target;if(!(t.version<72||r.getConfiguration&&r.getConfiguration().sdpSemantics==="plan-b")||r.signalingState==="stable")return n})}var Wy=Object.freeze({__proto__:null,shimMediaStream:CT,shimOnTrack:TT,shimGetSendersWithDtmf:ST,shimGetStats:RT,shimSenderReceiverGetStats:bT,shimAddTrackRemoveTrackWithNative:IT,shimAddTrackRemoveTrack:wT,shimPeerConnection:eh,fixNegotiationNeeded:OT,shimGetUserMedia:ET,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(typeof t=="function"?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then(r=>{const i=n.video&&n.video.width,o=n.video&&n.video.height,s=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:r,maxFrameRate:s||3}},i&&(n.video.mandatory.maxWidth=i),o&&(n.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}}),Jy,Nd,Ue=(Jy=function(e){var t={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};t.localCName=t.generateIdentifier(),t.splitLines=function(n){return n.trim().split(`
  839. `).map(function(r){return r.trim()})},t.splitSections=function(n){return n.split(`
  840. m=`).map(function(r,i){return(i>0?"m="+r:r).trim()+`\r
  841. `})},t.getDescription=function(n){var r=t.splitSections(n);return r&&r[0]},t.getMediaSections=function(n){var r=t.splitSections(n);return r.shift(),r},t.matchPrefix=function(n,r){return t.splitLines(n).filter(function(i){return i.indexOf(r)===0})},t.parseCandidate=function(n){for(var r,i={foundation:(r=n.indexOf("a=candidate:")===0?n.substring(12).split(" "):n.substring(10).split(" "))[0],component:parseInt(r[1],10),protocol:r[2].toLowerCase(),priority:parseInt(r[3],10),ip:r[4],address:r[4],port:parseInt(r[5],10),type:r[7]},o=8;o<r.length;o+=2)switch(r[o]){case"raddr":i.relatedAddress=r[o+1];break;case"rport":i.relatedPort=parseInt(r[o+1],10);break;case"tcptype":i.tcpType=r[o+1];break;case"ufrag":i.ufrag=r[o+1],i.usernameFragment=r[o+1];break;default:i[r[o]]=r[o+1]}return i},t.writeCandidate=function(n){var r=[];r.push(n.foundation),r.push(n.component),r.push(n.protocol.toUpperCase()),r.push(n.priority),r.push(n.address||n.ip),r.push(n.port);var i=n.type;return r.push("typ"),r.push(i),i!=="host"&&n.relatedAddress&&n.relatedPort&&(r.push("raddr"),r.push(n.relatedAddress),r.push("rport"),r.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(r.push("tcptype"),r.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(r.push("ufrag"),r.push(n.usernameFragment||n.ufrag)),"candidate:"+r.join(" ")},t.parseIceOptions=function(n){return n.substr(14).split(" ")},t.parseRtpMap=function(n){var r=n.substr(9).split(" "),i={payloadType:parseInt(r.shift(),10)};return r=r[0].split("/"),i.name=r[0],i.clockRate=parseInt(r[1],10),i.channels=r.length===3?parseInt(r[2],10):1,i.numChannels=i.channels,i},t.writeRtpMap=function(n){var r=n.payloadType;n.preferredPayloadType!==void 0&&(r=n.preferredPayloadType);var i=n.channels||n.numChannels||1;return"a=rtpmap:"+r+" "+n.name+"/"+n.clockRate+(i!==1?"/"+i:"")+`\r
  842. `},t.parseExtmap=function(n){var r=n.substr(9).split(" ");return{id:parseInt(r[0],10),direction:r[0].indexOf("/")>0?r[0].split("/")[1]:"sendrecv",uri:r[1]}},t.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+`\r
  843. `},t.parseFmtp=function(n){for(var r,i={},o=n.substr(n.indexOf(" ")+1).split(";"),s=0;s<o.length;s++)i[(r=o[s].trim().split("="))[0].trim()]=r[1];return i},t.writeFmtp=function(n){var r="",i=n.payloadType;if(n.preferredPayloadType!==void 0&&(i=n.preferredPayloadType),n.parameters&&Object.keys(n.parameters).length){var o=[];Object.keys(n.parameters).forEach(function(s){n.parameters[s]?o.push(s+"="+n.parameters[s]):o.push(s)}),r+="a=fmtp:"+i+" "+o.join(";")+`\r
  844. `}return r},t.parseRtcpFb=function(n){var r=n.substr(n.indexOf(" ")+1).split(" ");return{type:r.shift(),parameter:r.join(" ")}},t.writeRtcpFb=function(n){var r="",i=n.payloadType;return n.preferredPayloadType!==void 0&&(i=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(function(o){r+="a=rtcp-fb:"+i+" "+o.type+(o.parameter&&o.parameter.length?" "+o.parameter:"")+`\r
  845. `}),r},t.parseSsrcMedia=function(n){var r=n.indexOf(" "),i={ssrc:parseInt(n.substr(7,r-7),10)},o=n.indexOf(":",r);return o>-1?(i.attribute=n.substr(r+1,o-r-1),i.value=n.substr(o+1)):i.attribute=n.substr(r+1),i},t.parseSsrcGroup=function(n){var r=n.substr(13).split(" ");return{semantics:r.shift(),ssrcs:r.map(function(i){return parseInt(i,10)})}},t.getMid=function(n){var r=t.matchPrefix(n,"a=mid:")[0];if(r)return r.substr(6)},t.parseFingerprint=function(n){var r=n.substr(14).split(" ");return{algorithm:r[0].toLowerCase(),value:r[1]}},t.getDtlsParameters=function(n,r){return{role:"auto",fingerprints:t.matchPrefix(n+r,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(n,r){var i="a=setup:"+r+`\r
  846. `;return n.fingerprints.forEach(function(o){i+="a=fingerprint:"+o.algorithm+" "+o.value+`\r
  847. `}),i},t.parseCryptoLine=function(n){var r=n.substr(9).split(" ");return{tag:parseInt(r[0],10),cryptoSuite:r[1],keyParams:r[2],sessionParams:r.slice(3)}},t.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?t.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+`\r
  848. `},t.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;var r=n.substr(7).split("|");return{keyMethod:"inline",keySalt:r[0],lifeTime:r[1],mkiValue:r[2]?r[2].split(":")[0]:void 0,mkiLength:r[2]?r[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},t.getCryptoParameters=function(n,r){return t.matchPrefix(n+r,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(n,r){var i=t.matchPrefix(n+r,"a=ice-ufrag:")[0],o=t.matchPrefix(n+r,"a=ice-pwd:")[0];return i&&o?{usernameFragment:i.substr(12),password:o.substr(10)}:null},t.writeIceParameters=function(n){return"a=ice-ufrag:"+n.usernameFragment+`\r
  849. a=ice-pwd:`+n.password+`\r
  850. `},t.parseRtpParameters=function(n){for(var r={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=t.splitLines(n)[0].split(" "),o=3;o<i.length;o++){var s=i[o],a=t.matchPrefix(n,"a=rtpmap:"+s+" ")[0];if(a){var u=t.parseRtpMap(a),d=t.matchPrefix(n,"a=fmtp:"+s+" ");switch(u.parameters=d.length?t.parseFmtp(d[0]):{},u.rtcpFeedback=t.matchPrefix(n,"a=rtcp-fb:"+s+" ").map(t.parseRtcpFb),r.codecs.push(u),u.name.toUpperCase()){case"RED":case"ULPFEC":r.fecMechanisms.push(u.name.toUpperCase())}}}return t.matchPrefix(n,"a=extmap:").forEach(function(f){r.headerExtensions.push(t.parseExtmap(f))}),r},t.writeRtpDescription=function(n,r){var i="";i+="m="+n+" ",i+=r.codecs.length>0?"9":"0",i+=" UDP/TLS/RTP/SAVPF ",i+=r.codecs.map(function(s){return s.preferredPayloadType!==void 0?s.preferredPayloadType:s.payloadType}).join(" ")+`\r
  851. `,i+=`c=IN IP4 0.0.0.0\r
  852. `,i+=`a=rtcp:9 IN IP4 0.0.0.0\r
  853. `,r.codecs.forEach(function(s){i+=t.writeRtpMap(s),i+=t.writeFmtp(s),i+=t.writeRtcpFb(s)});var o=0;return r.codecs.forEach(function(s){s.maxptime>o&&(o=s.maxptime)}),o>0&&(i+="a=maxptime:"+o+`\r
  854. `),i+=`a=rtcp-mux\r
  855. `,r.headerExtensions&&r.headerExtensions.forEach(function(s){i+=t.writeExtmap(s)}),i},t.parseRtpEncodingParameters=function(n){var r,i=[],o=t.parseRtpParameters(n),s=o.fecMechanisms.indexOf("RED")!==-1,a=o.fecMechanisms.indexOf("ULPFEC")!==-1,u=t.matchPrefix(n,"a=ssrc:").map(function(l){return t.parseSsrcMedia(l)}).filter(function(l){return l.attribute==="cname"}),d=u.length>0&&u[0].ssrc,f=t.matchPrefix(n,"a=ssrc-group:FID").map(function(l){return l.substr(17).split(" ").map(function(h){return parseInt(h,10)})});f.length>0&&f[0].length>1&&f[0][0]===d&&(r=f[0][1]),o.codecs.forEach(function(l){if(l.name.toUpperCase()==="RTX"&&l.parameters.apt){var h={ssrc:d,codecPayloadType:parseInt(l.parameters.apt,10)};d&&r&&(h.rtx={ssrc:r}),i.push(h),s&&((h=JSON.parse(JSON.stringify(h))).fec={ssrc:d,mechanism:a?"red+ulpfec":"red"},i.push(h))}}),i.length===0&&d&&i.push({ssrc:d});var c=t.matchPrefix(n,"b=");return c.length&&(c=c[0].indexOf("b=TIAS:")===0?parseInt(c[0].substr(7),10):c[0].indexOf("b=AS:")===0?1e3*parseInt(c[0].substr(5),10)*.95-16e3:void 0,i.forEach(function(l){l.maxBitrate=c})),i},t.parseRtcpParameters=function(n){var r={},i=t.matchPrefix(n,"a=ssrc:").map(function(a){return t.parseSsrcMedia(a)}).filter(function(a){return a.attribute==="cname"})[0];i&&(r.cname=i.value,r.ssrc=i.ssrc);var o=t.matchPrefix(n,"a=rtcp-rsize");r.reducedSize=o.length>0,r.compound=o.length===0;var s=t.matchPrefix(n,"a=rtcp-mux");return r.mux=s.length>0,r},t.parseMsid=function(n){var r,i=t.matchPrefix(n,"a=msid:");if(i.length===1)return{stream:(r=i[0].substr(7).split(" "))[0],track:r[1]};var o=t.matchPrefix(n,"a=ssrc:").map(function(s){return t.parseSsrcMedia(s)}).filter(function(s){return s.attribute==="msid"});return o.length>0?{stream:(r=o[0].value.split(" "))[0],track:r[1]}:void 0},t.parseSctpDescription=function(n){var r,i=t.parseMLine(n),o=t.matchPrefix(n,"a=max-message-size:");o.length>0&&(r=parseInt(o[0].substr(19),10)),isNaN(r)&&(r=65536);var s=t.matchPrefix(n,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substr(12),10),protocol:i.fmt,maxMessageSize:r};if(t.matchPrefix(n,"a=sctpmap:").length>0){var a=t.matchPrefix(n,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:r}}},t.writeSctpDescription=function(n,r){var i=[];return i=n.protocol!=="DTLS/SCTP"?["m="+n.kind+" 9 "+n.protocol+" "+r.protocol+`\r
  856. `,`c=IN IP4 0.0.0.0\r
  857. `,"a=sctp-port:"+r.port+`\r
  858. `]:["m="+n.kind+" 9 "+n.protocol+" "+r.port+`\r
  859. `,`c=IN IP4 0.0.0.0\r
  860. `,"a=sctpmap:"+r.port+" "+r.protocol+` 65535\r
  861. `],r.maxMessageSize!==void 0&&i.push("a=max-message-size:"+r.maxMessageSize+`\r
  862. `),i.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,21)},t.writeSessionBoilerplate=function(n,r,i){var o=r!==void 0?r:2;return`v=0\r
  863. o=`+(i||"thisisadapterortc")+" "+(n||t.generateSessionId())+" "+o+` IN IP4 127.0.0.1\r
  864. s=-\r
  865. t=0 0\r
  866. `},t.writeMediaSection=function(n,r,i,o){var s=t.writeRtpDescription(n.kind,r);if(s+=t.writeIceParameters(n.iceGatherer.getLocalParameters()),s+=t.writeDtlsParameters(n.dtlsTransport.getLocalParameters(),i==="offer"?"actpass":"active"),s+="a=mid:"+n.mid+`\r
  867. `,n.direction?s+="a="+n.direction+`\r
  868. `:n.rtpSender&&n.rtpReceiver?s+=`a=sendrecv\r
  869. `:n.rtpSender?s+=`a=sendonly\r
  870. `:n.rtpReceiver?s+=`a=recvonly\r
  871. `:s+=`a=inactive\r
  872. `,n.rtpSender){var a="msid:"+o.id+" "+n.rtpSender.track.id+`\r
  873. `;s+="a="+a,s+="a=ssrc:"+n.sendEncodingParameters[0].ssrc+" "+a,n.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+n.sendEncodingParameters[0].rtx.ssrc+" "+a,s+="a=ssrc-group:FID "+n.sendEncodingParameters[0].ssrc+" "+n.sendEncodingParameters[0].rtx.ssrc+`\r
  874. `)}return s+="a=ssrc:"+n.sendEncodingParameters[0].ssrc+" cname:"+t.localCName+`\r
  875. `,n.rtpSender&&n.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+n.sendEncodingParameters[0].rtx.ssrc+" cname:"+t.localCName+`\r
  876. `),s},t.getDirection=function(n,r){for(var i=t.splitLines(n),o=0;o<i.length;o++)switch(i[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[o].substr(2)}return r?t.getDirection(r):"sendrecv"},t.getKind=function(n){return t.splitLines(n)[0].split(" ")[0].substr(2)},t.isRejected=function(n){return n.split(" ",2)[1]==="0"},t.parseMLine=function(n){var r=t.splitLines(n)[0].substr(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},t.parseOLine=function(n){var r=t.matchPrefix(n,"o=")[0].substr(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},t.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;for(var r=t.splitLines(n),i=0;i<r.length;i++)if(r[i].length<2||r[i].charAt(1)!=="=")return!1;return!0},e.exports=t},Jy(Nd={exports:{}},Nd.exports),Nd.exports);function Qy(e,t,n,r,i){var o=Ue.writeRtpDescription(e.kind,t);if(o+=Ue.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=Ue.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),n==="offer"?"actpass":i||"active"),o+="a=mid:"+e.mid+`\r
  877. `,e.rtpSender&&e.rtpReceiver?o+=`a=sendrecv\r
  878. `:e.rtpSender?o+=`a=sendonly\r
  879. `:e.rtpReceiver?o+=`a=recvonly\r
  880. `:o+=`a=inactive\r
  881. `,e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var a="msid:"+(r?r.id:"-")+" "+s+`\r
  882. `;o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+`\r
  883. `)}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+Ue.localCName+`\r
  884. `,e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+Ue.localCName+`\r
  885. `),o}function Hc(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(o,s){o=parseInt(o,10);for(var a=0;a<s.length;a++)if(s[a].payloadType===o||s[a].preferredPayloadType===o)return s[a]},i=function(o,s,a,u){var d=r(o.parameters.apt,a),f=r(s.parameters.apt,u);return d&&f&&d.name.toLowerCase()===f.name.toLowerCase()};return e.codecs.forEach(function(o){for(var s=0;s<t.codecs.length;s++){var a=t.codecs[s];if(o.name.toLowerCase()===a.name.toLowerCase()&&o.clockRate===a.clockRate){if(o.name.toLowerCase()==="rtx"&&o.parameters&&a.parameters.apt&&!i(o,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(o.numChannels,a.numChannels),n.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter(function(u){for(var d=0;d<o.rtcpFeedback.length;d++)if(o.rtcpFeedback[d].type===u.type&&o.rtcpFeedback[d].parameter===u.parameter)return!0;return!1});break}}}),e.headerExtensions.forEach(function(o){for(var s=0;s<t.headerExtensions.length;s++){var a=t.headerExtensions[s];if(o.uri===a.uri){n.headerExtensions.push(a);break}}}),n}function Xy(e,t,n){return{offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)!==-1}function Ad(e,t){var n=e.getRemoteCandidates().find(function(r){return t.foundation===r.foundation&&t.ip===r.ip&&t.port===r.port&&t.priority===r.priority&&t.protocol===r.protocol&&t.type===r.type});return n||e.addRemoteCandidate(t),!n}function nn(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}var wB=function(e,t){function n(s,a){a.addTrack(s),a.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:s}))}function r(s,a,u,d){var f=new Event("track");f.track=a,f.receiver=u,f.transceiver={receiver:u},f.streams=d,e.setTimeout(function(){s._dispatchEvent("track",f)})}var i=function(s){var a=this,u=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(f){a[f]=u[f].bind(u)}),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",s=JSON.parse(JSON.stringify(s||{})),this.usingBundle=s.bundlePolicy==="max-bundle",s.rtcpMuxPolicy==="negotiate")throw nn("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(s.rtcpMuxPolicy||(s.rtcpMuxPolicy="require"),s.iceTransportPolicy){case"all":case"relay":break;default:s.iceTransportPolicy="all"}switch(s.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:s.bundlePolicy="balanced"}if(s.iceServers=function(f,c){var l=!1;return(f=JSON.parse(JSON.stringify(f))).filter(function(h){if(h&&(h.urls||h.url)){var p=h.urls||h.url;h.url&&!h.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var m=typeof p=="string";return m&&(p=[p]),p=p.filter(function(v){return v.indexOf("turn:")!==0||v.indexOf("transport=udp")===-1||v.indexOf("turn:[")!==-1||l?v.indexOf("stun:")===0&&c>=14393&&v.indexOf("?transport=udp")===-1:(l=!0,!0)}),delete h.url,h.urls=m?p[0]:p,!!p.length}})}(s.iceServers||[],t),this._iceGatherers=[],s.iceCandidatePoolSize)for(var d=s.iceCandidatePoolSize;d>0;d--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:s.iceServers,gatherPolicy:s.iceTransportPolicy}));else s.iceCandidatePoolSize=0;this._config=s,this.transceivers=[],this._sdpSessionId=Ue.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(i.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(i.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),i.prototype.onicecandidate=null,i.prototype.onaddstream=null,i.prototype.ontrack=null,i.prototype.onremovestream=null,i.prototype.onsignalingstatechange=null,i.prototype.oniceconnectionstatechange=null,i.prototype.onconnectionstatechange=null,i.prototype.onicegatheringstatechange=null,i.prototype.onnegotiationneeded=null,i.prototype.ondatachannel=null,i.prototype._dispatchEvent=function(s,a){this._isClosed||(this.dispatchEvent(a),typeof this["on"+s]=="function"&&this["on"+s](a))},i.prototype._emitGatheringStateChange=function(){var s=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",s)},i.prototype.getConfiguration=function(){return this._config},i.prototype.getLocalStreams=function(){return this.localStreams},i.prototype.getRemoteStreams=function(){return this.remoteStreams},i.prototype._createTransceiver=function(s,a){var u=this.transceivers.length>0,d={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:s,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&u)d.iceTransport=this.transceivers[0].iceTransport,d.dtlsTransport=this.transceivers[0].dtlsTransport;else{var f=this._createIceAndDtlsTransports();d.iceTransport=f.iceTransport,d.dtlsTransport=f.dtlsTransport}return a||this.transceivers.push(d),d},i.prototype.addTrack=function(s,a){if(this._isClosed)throw nn("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var u;if(this.transceivers.find(function(f){return f.track===s}))throw nn("InvalidAccessError","Track already exists.");for(var d=0;d<this.transceivers.length;d++)this.transceivers[d].track||this.transceivers[d].kind!==s.kind||(u=this.transceivers[d]);return u||(u=this._createTransceiver(s.kind)),this._maybeFireNegotiationNeeded(),this.localStreams.indexOf(a)===-1&&this.localStreams.push(a),u.track=s,u.stream=a,u.rtpSender=new e.RTCRtpSender(s,u.dtlsTransport),u.rtpSender},i.prototype.addStream=function(s){var a=this;if(t>=15025)s.getTracks().forEach(function(d){a.addTrack(d,s)});else{var u=s.clone();s.getTracks().forEach(function(d,f){var c=u.getTracks()[f];d.addEventListener("enabled",function(l){c.enabled=l.enabled})}),u.getTracks().forEach(function(d){a.addTrack(d,u)})}},i.prototype.removeTrack=function(s){if(this._isClosed)throw nn("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(s instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var a=this.transceivers.find(function(d){return d.rtpSender===s});if(!a)throw nn("InvalidAccessError","Sender was not created by this connection.");var u=a.stream;a.rtpSender.stop(),a.rtpSender=null,a.track=null,a.stream=null,this.transceivers.map(function(d){return d.stream}).indexOf(u)===-1&&this.localStreams.indexOf(u)>-1&&this.localStreams.splice(this.localStreams.indexOf(u),1),this._maybeFireNegotiationNeeded()},i.prototype.removeStream=function(s){var a=this;s.getTracks().forEach(function(u){var d=a.getSenders().find(function(f){return f.track===u});d&&a.removeTrack(d)})},i.prototype.getSenders=function(){return this.transceivers.filter(function(s){return!!s.rtpSender}).map(function(s){return s.rtpSender})},i.prototype.getReceivers=function(){return this.transceivers.filter(function(s){return!!s.rtpReceiver}).map(function(s){return s.rtpReceiver})},i.prototype._createIceGatherer=function(s,a){var u=this;if(a&&s>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var d=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(d,"state",{value:"new",writable:!0}),this.transceivers[s].bufferedCandidateEvents=[],this.transceivers[s].bufferCandidates=function(f){var c=!f.candidate||Object.keys(f.candidate).length===0;d.state=c?"completed":"gathering",u.transceivers[s].bufferedCandidateEvents!==null&&u.transceivers[s].bufferedCandidateEvents.push(f)},d.addEventListener("localcandidate",this.transceivers[s].bufferCandidates),d},i.prototype._gather=function(s,a){var u=this,d=this.transceivers[a].iceGatherer;if(!d.onlocalcandidate){var f=this.transceivers[a].bufferedCandidateEvents;this.transceivers[a].bufferedCandidateEvents=null,d.removeEventListener("localcandidate",this.transceivers[a].bufferCandidates),d.onlocalcandidate=function(c){if(!(u.usingBundle&&a>0)){var l=new Event("icecandidate");l.candidate={sdpMid:s,sdpMLineIndex:a};var h=c.candidate,p=!h||Object.keys(h).length===0;if(p)d.state!=="new"&&d.state!=="gathering"||(d.state="completed");else{d.state==="new"&&(d.state="gathering"),h.component=1,h.ufrag=d.getLocalParameters().usernameFragment;var m=Ue.writeCandidate(h);l.candidate=Object.assign(l.candidate,Ue.parseCandidate(m)),l.candidate.candidate=m,l.candidate.toJSON=function(){return{candidate:l.candidate.candidate,sdpMid:l.candidate.sdpMid,sdpMLineIndex:l.candidate.sdpMLineIndex,usernameFragment:l.candidate.usernameFragment}}}var v=Ue.getMediaSections(u._localDescription.sdp);v[l.candidate.sdpMLineIndex]+=p?`a=end-of-candidates\r
  886. `:"a="+l.candidate.candidate+`\r
  887. `,u._localDescription.sdp=Ue.getDescription(u._localDescription.sdp)+v.join("");var _=u.transceivers.every(function(y){return y.iceGatherer&&y.iceGatherer.state==="completed"});u.iceGatheringState!=="gathering"&&(u.iceGatheringState="gathering",u._emitGatheringStateChange()),p||u._dispatchEvent("icecandidate",l),_&&(u._dispatchEvent("icecandidate",new Event("icecandidate")),u.iceGatheringState="complete",u._emitGatheringStateChange())}},e.setTimeout(function(){f.forEach(function(c){d.onlocalcandidate(c)})},0)}},i.prototype._createIceAndDtlsTransports=function(){var s=this,a=new e.RTCIceTransport(null);a.onicestatechange=function(){s._updateIceConnectionState(),s._updateConnectionState()};var u=new e.RTCDtlsTransport(a);return u.ondtlsstatechange=function(){s._updateConnectionState()},u.onerror=function(){Object.defineProperty(u,"state",{value:"failed",writable:!0}),s._updateConnectionState()},{iceTransport:a,dtlsTransport:u}},i.prototype._disposeIceAndDtlsTransports=function(s){var a=this.transceivers[s].iceGatherer;a&&(delete a.onlocalcandidate,delete this.transceivers[s].iceGatherer);var u=this.transceivers[s].iceTransport;u&&(delete u.onicestatechange,delete this.transceivers[s].iceTransport);var d=this.transceivers[s].dtlsTransport;d&&(delete d.ondtlsstatechange,delete d.onerror,delete this.transceivers[s].dtlsTransport)},i.prototype._transceive=function(s,a,u){var d=Hc(s.localCapabilities,s.remoteCapabilities);a&&s.rtpSender&&(d.encodings=s.sendEncodingParameters,d.rtcp={cname:Ue.localCName,compound:s.rtcpParameters.compound},s.recvEncodingParameters.length&&(d.rtcp.ssrc=s.recvEncodingParameters[0].ssrc),s.rtpSender.send(d)),u&&s.rtpReceiver&&d.codecs.length>0&&(s.kind==="video"&&s.recvEncodingParameters&&t<15019&&s.recvEncodingParameters.forEach(function(f){delete f.rtx}),s.recvEncodingParameters.length?d.encodings=s.recvEncodingParameters:d.encodings=[{}],d.rtcp={compound:s.rtcpParameters.compound},s.rtcpParameters.cname&&(d.rtcp.cname=s.rtcpParameters.cname),s.sendEncodingParameters.length&&(d.rtcp.ssrc=s.sendEncodingParameters[0].ssrc),s.rtpReceiver.receive(d))},i.prototype.setLocalDescription=function(s){var a,u,d=this;if(["offer","answer"].indexOf(s.type)===-1)return Promise.reject(nn("TypeError",'Unsupported type "'+s.type+'"'));if(!Xy("setLocalDescription",s.type,d.signalingState)||d._isClosed)return Promise.reject(nn("InvalidStateError","Can not set local "+s.type+" in state "+d.signalingState));if(s.type==="offer")a=Ue.splitSections(s.sdp),u=a.shift(),a.forEach(function(c,l){var h=Ue.parseRtpParameters(c);d.transceivers[l].localCapabilities=h}),d.transceivers.forEach(function(c,l){d._gather(c.mid,l)});else if(s.type==="answer"){a=Ue.splitSections(d._remoteDescription.sdp),u=a.shift();var f=Ue.matchPrefix(u,"a=ice-lite").length>0;a.forEach(function(c,l){var h=d.transceivers[l],p=h.iceGatherer,m=h.iceTransport,v=h.dtlsTransport,_=h.localCapabilities,y=h.remoteCapabilities;if(!(Ue.isRejected(c)&&Ue.matchPrefix(c,"a=bundle-only").length===0)&&!h.rejected){var E=Ue.getIceParameters(c,u),S=Ue.getDtlsParameters(c,u);f&&(S.role="server"),d.usingBundle&&l!==0||(d._gather(h.mid,l),m.state==="new"&&m.start(p,E,f?"controlling":"controlled"),v.state==="new"&&v.start(S));var T=Hc(_,y);d._transceive(h,T.codecs.length>0,!1)}})}return d._localDescription={type:s.type,sdp:s.sdp},s.type==="offer"?d._updateSignalingState("have-local-offer"):d._updateSignalingState("stable"),Promise.resolve()},i.prototype.setRemoteDescription=function(s){var a=this;if(["offer","answer"].indexOf(s.type)===-1)return Promise.reject(nn("TypeError",'Unsupported type "'+s.type+'"'));if(!Xy("setRemoteDescription",s.type,a.signalingState)||a._isClosed)return Promise.reject(nn("InvalidStateError","Can not set remote "+s.type+" in state "+a.signalingState));var u={};a.remoteStreams.forEach(function(m){u[m.id]=m});var d=[],f=Ue.splitSections(s.sdp),c=f.shift(),l=Ue.matchPrefix(c,"a=ice-lite").length>0,h=Ue.matchPrefix(c,"a=group:BUNDLE ").length>0;a.usingBundle=h;var p=Ue.matchPrefix(c,"a=ice-options:")[0];return a.canTrickleIceCandidates=!!p&&p.substr(14).split(" ").indexOf("trickle")>=0,f.forEach(function(m,v){var _=Ue.splitLines(m),y=Ue.getKind(m),E=Ue.isRejected(m)&&Ue.matchPrefix(m,"a=bundle-only").length===0,S=_[0].substr(2).split(" ")[2],T=Ue.getDirection(m,c),R=Ue.parseMsid(m),C=Ue.getMid(m)||Ue.generateIdentifier();if(E||y==="application"&&(S==="DTLS/SCTP"||S==="UDP/DTLS/SCTP"))a.transceivers[v]={mid:C,kind:y,protocol:S,rejected:!0};else{var w,L,V,b,I,N,A,M,$;!E&&a.transceivers[v]&&a.transceivers[v].rejected&&(a.transceivers[v]=a._createTransceiver(y,!0));var x,q,Z=Ue.parseRtpParameters(m);E||(x=Ue.getIceParameters(m,c),(q=Ue.getDtlsParameters(m,c)).role="client"),A=Ue.parseRtpEncodingParameters(m);var le=Ue.parseRtcpParameters(m),Te=Ue.matchPrefix(m,"a=end-of-candidates",c).length>0,Ee=Ue.matchPrefix(m,"a=candidate:").map(function(P){return Ue.parseCandidate(P)}).filter(function(P){return P.component===1});if((s.type==="offer"||s.type==="answer")&&!E&&h&&v>0&&a.transceivers[v]&&(a._disposeIceAndDtlsTransports(v),a.transceivers[v].iceGatherer=a.transceivers[0].iceGatherer,a.transceivers[v].iceTransport=a.transceivers[0].iceTransport,a.transceivers[v].dtlsTransport=a.transceivers[0].dtlsTransport,a.transceivers[v].rtpSender&&a.transceivers[v].rtpSender.setTransport(a.transceivers[0].dtlsTransport),a.transceivers[v].rtpReceiver&&a.transceivers[v].rtpReceiver.setTransport(a.transceivers[0].dtlsTransport)),s.type!=="offer"||E)s.type==="answer"&&!E&&(L=(w=a.transceivers[v]).iceGatherer,V=w.iceTransport,b=w.dtlsTransport,I=w.rtpReceiver,N=w.sendEncodingParameters,M=w.localCapabilities,a.transceivers[v].recvEncodingParameters=A,a.transceivers[v].remoteCapabilities=Z,a.transceivers[v].rtcpParameters=le,Ee.length&&V.state==="new"&&(!l&&!Te||h&&v!==0?Ee.forEach(function(P){Ad(w.iceTransport,P)}):V.setRemoteCandidates(Ee)),h&&v!==0||(V.state==="new"&&V.start(L,x,"controlling"),b.state==="new"&&b.start(q)),!Hc(w.localCapabilities,w.remoteCapabilities).codecs.filter(function(P){return P.name.toLowerCase()==="rtx"}).length&&w.sendEncodingParameters[0].rtx&&delete w.sendEncodingParameters[0].rtx,a._transceive(w,T==="sendrecv"||T==="recvonly",T==="sendrecv"||T==="sendonly"),!I||T!=="sendrecv"&&T!=="sendonly"?delete w.rtpReceiver:($=I.track,R?(u[R.stream]||(u[R.stream]=new e.MediaStream),n($,u[R.stream]),d.push([$,I,u[R.stream]])):(u.default||(u.default=new e.MediaStream),n($,u.default),d.push([$,I,u.default]))));else{(w=a.transceivers[v]||a._createTransceiver(y)).mid=C,w.iceGatherer||(w.iceGatherer=a._createIceGatherer(v,h)),Ee.length&&w.iceTransport.state==="new"&&(!Te||h&&v!==0?Ee.forEach(function(P){Ad(w.iceTransport,P)}):w.iceTransport.setRemoteCandidates(Ee)),M=e.RTCRtpReceiver.getCapabilities(y),t<15019&&(M.codecs=M.codecs.filter(function(P){return P.name!=="rtx"})),N=w.sendEncodingParameters||[{ssrc:1001*(2*v+2)}];var ve,Se=!1;T==="sendrecv"||T==="sendonly"?(Se=!w.rtpReceiver,I=w.rtpReceiver||new e.RTCRtpReceiver(w.dtlsTransport,y),Se&&($=I.track,R&&R.stream==="-"||(R?(u[R.stream]||(u[R.stream]=new e.MediaStream,Object.defineProperty(u[R.stream],"id",{get:function(){return R.stream}})),Object.defineProperty($,"id",{get:function(){return R.track}}),ve=u[R.stream]):(u.default||(u.default=new e.MediaStream),ve=u.default)),ve&&(n($,ve),w.associatedRemoteMediaStreams.push(ve)),d.push([$,I,ve]))):w.rtpReceiver&&w.rtpReceiver.track&&(w.associatedRemoteMediaStreams.forEach(function(P){var z=P.getTracks().find(function(G){return G.id===w.rtpReceiver.track.id});z&&function(G,K){K.removeTrack(G),K.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:G}))}(z,P)}),w.associatedRemoteMediaStreams=[]),w.localCapabilities=M,w.remoteCapabilities=Z,w.rtpReceiver=I,w.rtcpParameters=le,w.sendEncodingParameters=N,w.recvEncodingParameters=A,a._transceive(a.transceivers[v],!1,Se)}}}),a._dtlsRole===void 0&&(a._dtlsRole=s.type==="offer"?"active":"passive"),a._remoteDescription={type:s.type,sdp:s.sdp},s.type==="offer"?a._updateSignalingState("have-remote-offer"):a._updateSignalingState("stable"),Object.keys(u).forEach(function(m){var v=u[m];if(v.getTracks().length){if(a.remoteStreams.indexOf(v)===-1){a.remoteStreams.push(v);var _=new Event("addstream");_.stream=v,e.setTimeout(function(){a._dispatchEvent("addstream",_)})}d.forEach(function(y){var E=y[0],S=y[1];v.id===y[2].id&&r(a,E,S,[v])})}}),d.forEach(function(m){m[2]||r(a,m[0],m[1],[])}),e.setTimeout(function(){a&&a.transceivers&&a.transceivers.forEach(function(m){m.iceTransport&&m.iceTransport.state==="new"&&m.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),m.iceTransport.addRemoteCandidate({}))})},4e3),Promise.resolve()},i.prototype.close=function(){this.transceivers.forEach(function(s){s.iceTransport&&s.iceTransport.stop(),s.dtlsTransport&&s.dtlsTransport.stop(),s.rtpSender&&s.rtpSender.stop(),s.rtpReceiver&&s.rtpReceiver.stop()}),this._isClosed=!0,this._updateSignalingState("closed")},i.prototype._updateSignalingState=function(s){this.signalingState=s;var a=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",a)},i.prototype._maybeFireNegotiationNeeded=function(){var s=this;this.signalingState==="stable"&&this.needNegotiation!==!0&&(this.needNegotiation=!0,e.setTimeout(function(){if(s.needNegotiation){s.needNegotiation=!1;var a=new Event("negotiationneeded");s._dispatchEvent("negotiationneeded",a)}},0))},i.prototype._updateIceConnectionState=function(){var s,a={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(d){d.iceTransport&&!d.rejected&&a[d.iceTransport.state]++}),s="new",a.failed>0?s="failed":a.checking>0?s="checking":a.disconnected>0?s="disconnected":a.new>0?s="new":a.connected>0?s="connected":a.completed>0&&(s="completed"),s!==this.iceConnectionState){this.iceConnectionState=s;var u=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",u)}},i.prototype._updateConnectionState=function(){var s,a={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(d){d.iceTransport&&d.dtlsTransport&&!d.rejected&&(a[d.iceTransport.state]++,a[d.dtlsTransport.state]++)}),a.connected+=a.completed,s="new",a.failed>0?s="failed":a.connecting>0?s="connecting":a.disconnected>0?s="disconnected":a.new>0?s="new":a.connected>0&&(s="connected"),s!==this.connectionState){this.connectionState=s;var u=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",u)}},i.prototype.createOffer=function(){var s=this;if(s._isClosed)return Promise.reject(nn("InvalidStateError","Can not call createOffer after close"));var a=s.transceivers.filter(function(l){return l.kind==="audio"}).length,u=s.transceivers.filter(function(l){return l.kind==="video"}).length,d=arguments[0];if(d){if(d.mandatory||d.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");d.offerToReceiveAudio!==void 0&&(a=d.offerToReceiveAudio===!0?1:d.offerToReceiveAudio===!1?0:d.offerToReceiveAudio),d.offerToReceiveVideo!==void 0&&(u=d.offerToReceiveVideo===!0?1:d.offerToReceiveVideo===!1?0:d.offerToReceiveVideo)}for(s.transceivers.forEach(function(l){l.kind==="audio"?--a<0&&(l.wantReceive=!1):l.kind==="video"&&--u<0&&(l.wantReceive=!1)});a>0||u>0;)a>0&&(s._createTransceiver("audio"),a--),u>0&&(s._createTransceiver("video"),u--);var f=Ue.writeSessionBoilerplate(s._sdpSessionId,s._sdpSessionVersion++);s.transceivers.forEach(function(l,h){var p=l.track,m=l.kind,v=l.mid||Ue.generateIdentifier();l.mid=v,l.iceGatherer||(l.iceGatherer=s._createIceGatherer(h,s.usingBundle));var _=e.RTCRtpSender.getCapabilities(m);t<15019&&(_.codecs=_.codecs.filter(function(E){return E.name!=="rtx"})),_.codecs.forEach(function(E){E.name==="H264"&&E.parameters["level-asymmetry-allowed"]===void 0&&(E.parameters["level-asymmetry-allowed"]="1"),l.remoteCapabilities&&l.remoteCapabilities.codecs&&l.remoteCapabilities.codecs.forEach(function(S){E.name.toLowerCase()===S.name.toLowerCase()&&E.clockRate===S.clockRate&&(E.preferredPayloadType=S.payloadType)})}),_.headerExtensions.forEach(function(E){(l.remoteCapabilities&&l.remoteCapabilities.headerExtensions||[]).forEach(function(S){E.uri===S.uri&&(E.id=S.id)})});var y=l.sendEncodingParameters||[{ssrc:1001*(2*h+1)}];p&&t>=15019&&m==="video"&&!y[0].rtx&&(y[0].rtx={ssrc:y[0].ssrc+1}),l.wantReceive&&(l.rtpReceiver=new e.RTCRtpReceiver(l.dtlsTransport,m)),l.localCapabilities=_,l.sendEncodingParameters=y}),s._config.bundlePolicy!=="max-compat"&&(f+="a=group:BUNDLE "+s.transceivers.map(function(l){return l.mid}).join(" ")+`\r
  888. `),f+=`a=ice-options:trickle\r
  889. `,s.transceivers.forEach(function(l,h){f+=Qy(l,l.localCapabilities,"offer",l.stream,s._dtlsRole),f+=`a=rtcp-rsize\r
  890. `,!l.iceGatherer||s.iceGatheringState==="new"||h!==0&&s.usingBundle||(l.iceGatherer.getLocalCandidates().forEach(function(p){p.component=1,f+="a="+Ue.writeCandidate(p)+`\r
  891. `}),l.iceGatherer.state==="completed"&&(f+=`a=end-of-candidates\r
  892. `))});var c=new e.RTCSessionDescription({type:"offer",sdp:f});return Promise.resolve(c)},i.prototype.createAnswer=function(){var s=this;if(s._isClosed)return Promise.reject(nn("InvalidStateError","Can not call createAnswer after close"));if(s.signalingState!=="have-remote-offer"&&s.signalingState!=="have-local-pranswer")return Promise.reject(nn("InvalidStateError","Can not call createAnswer in signalingState "+s.signalingState));var a=Ue.writeSessionBoilerplate(s._sdpSessionId,s._sdpSessionVersion++);s.usingBundle&&(a+="a=group:BUNDLE "+s.transceivers.map(function(f){return f.mid}).join(" ")+`\r
  893. `),a+=`a=ice-options:trickle\r
  894. `;var u=Ue.getMediaSections(s._remoteDescription.sdp).length;s.transceivers.forEach(function(f,c){if(!(c+1>u)){if(f.rejected)return f.kind==="application"?f.protocol==="DTLS/SCTP"?a+=`m=application 0 DTLS/SCTP 5000\r
  895. `:a+="m=application 0 "+f.protocol+` webrtc-datachannel\r
  896. `:f.kind==="audio"?a+=`m=audio 0 UDP/TLS/RTP/SAVPF 0\r
  897. a=rtpmap:0 PCMU/8000\r
  898. `:f.kind==="video"&&(a+=`m=video 0 UDP/TLS/RTP/SAVPF 120\r
  899. a=rtpmap:120 VP8/90000\r
  900. `),void(a+=`c=IN IP4 0.0.0.0\r
  901. a=inactive\r
  902. a=mid:`+f.mid+`\r
  903. `);var l;f.stream&&(f.kind==="audio"?l=f.stream.getAudioTracks()[0]:f.kind==="video"&&(l=f.stream.getVideoTracks()[0]),l&&t>=15019&&f.kind==="video"&&!f.sendEncodingParameters[0].rtx&&(f.sendEncodingParameters[0].rtx={ssrc:f.sendEncodingParameters[0].ssrc+1}));var h=Hc(f.localCapabilities,f.remoteCapabilities);!h.codecs.filter(function(p){return p.name.toLowerCase()==="rtx"}).length&&f.sendEncodingParameters[0].rtx&&delete f.sendEncodingParameters[0].rtx,a+=Qy(f,h,"answer",f.stream,s._dtlsRole),f.rtcpParameters&&f.rtcpParameters.reducedSize&&(a+=`a=rtcp-rsize\r
  904. `)}});var d=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(d)},i.prototype.addIceCandidate=function(s){var a,u=this;return s&&s.sdpMLineIndex===void 0&&!s.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise(function(d,f){if(!u._remoteDescription)return f(nn("InvalidStateError","Can not add ICE candidate without a remote description"));if(s&&s.candidate!==""){var c=s.sdpMLineIndex;if(s.sdpMid){for(var l=0;l<u.transceivers.length;l++)if(u.transceivers[l].mid===s.sdpMid){c=l;break}}var h=u.transceivers[c];if(!h)return f(nn("OperationError","Can not add ICE candidate"));if(h.rejected)return d();var p=Object.keys(s.candidate).length>0?Ue.parseCandidate(s.candidate):{};if(p.protocol==="tcp"&&(p.port===0||p.port===9)||p.component&&p.component!==1)return d();if((c===0||c>0&&h.iceTransport!==u.transceivers[0].iceTransport)&&!Ad(h.iceTransport,p))return f(nn("OperationError","Can not add ICE candidate"));var m=s.candidate.trim();m.indexOf("a=")===0&&(m=m.substr(2)),(a=Ue.getMediaSections(u._remoteDescription.sdp))[c]+="a="+(p.type?m:"end-of-candidates")+`\r
  905. `,u._remoteDescription.sdp=Ue.getDescription(u._remoteDescription.sdp)+a.join("")}else for(var v=0;v<u.transceivers.length&&(u.transceivers[v].rejected||(u.transceivers[v].iceTransport.addRemoteCandidate({}),(a=Ue.getMediaSections(u._remoteDescription.sdp))[v]+=`a=end-of-candidates\r
  906. `,u._remoteDescription.sdp=Ue.getDescription(u._remoteDescription.sdp)+a.join(""),!u.usingBundle));v++);d()})},i.prototype.getStats=function(s){if(s&&s instanceof e.MediaStreamTrack){var a=null;if(this.transceivers.forEach(function(d){d.rtpSender&&d.rtpSender.track===s?a=d.rtpSender:d.rtpReceiver&&d.rtpReceiver.track===s&&(a=d.rtpReceiver)}),!a)throw nn("InvalidAccessError","Invalid selector.");return a.getStats()}var u=[];return this.transceivers.forEach(function(d){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(f){d[f]&&u.push(d[f].getStats())})}),Promise.all(u).then(function(d){var f=new Map;return d.forEach(function(c){c.forEach(function(l){f.set(l.id,l)})}),f})},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach(function(s){var a=e[s];if(a&&a.prototype&&a.prototype.getStats){var u=a.prototype.getStats;a.prototype.getStats=function(){return u.apply(this).then(function(d){var f=new Map;return Object.keys(d).forEach(function(c){var l;d[c].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(l=d[c]).type]||l.type,f.set(c,d[c])}),f})}}});var o=["createOffer","createAnswer"];return o.forEach(function(s){var a=i.prototype[s];i.prototype[s]=function(){var u=arguments;return typeof u[0]=="function"||typeof u[1]=="function"?a.apply(this,[arguments[2]]).then(function(d){typeof u[0]=="function"&&u[0].apply(null,[d])},function(d){typeof u[1]=="function"&&u[1].apply(null,[d])}):a.apply(this,arguments)}}),(o=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach(function(s){var a=i.prototype[s];i.prototype[s]=function(){var u=arguments;return typeof u[1]=="function"||typeof u[2]=="function"?a.apply(this,arguments).then(function(){typeof u[1]=="function"&&u[1].apply(null)},function(d){typeof u[2]=="function"&&u[2].apply(null,[d])}):a.apply(this,arguments)}}),["getStats"].forEach(function(s){var a=i.prototype[s];i.prototype[s]=function(){var u=arguments;return typeof u[1]=="function"?a.apply(this,arguments).then(function(){typeof u[1]=="function"&&u[1].apply(null)}):a.apply(this,arguments)}}),i};function NT(e){const t=e&&e.navigator,n=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(r){return n(r).catch(i=>Promise.reject(function(o){return{name:{PermissionDeniedError:"NotAllowedError"}[o.name]||o.name,message:o.message,constraint:o.constraint,toString(){return this.name}}}(i)))}}function AT(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}function th(e,t){if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(r){return r}),e.RTCSessionDescription||(e.RTCSessionDescription=function(r){return r}),t.version<15025)){const r=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set(i){r.set.call(this,i);const o=new Event("enabled");o.enabled=i,this.dispatchEvent(o)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=new e.RTCDtmfSender(this):this.track.kind==="video"&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);const n=wB(e,t.version);e.RTCPeerConnection=function(r){return r&&r.iceServers&&(r.iceServers=function(i,o){let s=!1;return(i=JSON.parse(JSON.stringify(i))).filter(a=>{if(a&&(a.urls||a.url)){let u=a.urls||a.url;a.url&&!a.urls&&Ol("RTCIceServer.url","RTCIceServer.urls");const d=typeof u=="string";return d&&(u=[u]),u=u.filter(f=>{if(f.indexOf("stun:")===0)return!1;const c=f.startsWith("turn")&&!f.startsWith("turn:[")&&f.includes("transport=udp");return c&&!s?(s=!0,!0):c&&!s}),delete a.url,a.urls=d?u[0]:u,!!u.length}})}(r.iceServers,t.version),yg("ICE servers after filtering:",r.iceServers)),new n(r)},e.RTCPeerConnection.prototype=n.prototype}function PT(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}var Zy=Object.freeze({__proto__:null,shimPeerConnection:th,shimReplaceTrack:PT,shimGetUserMedia:NT,shimGetDisplayMedia:AT});function MT(e,t){const n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(i,o,s){Ol("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(i).then(o,s)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const i=function(s,a,u){a in s&&!(u in s)&&(s[u]=s[a],delete s[a])},o=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),o(s)},r&&r.prototype.getSettings){const s=r.prototype.getSettings;r.prototype.getSettings=function(){const a=s.apply(this,arguments);return i(a,"mozAutoGainControl","autoGainControl"),i(a,"mozNoiseSuppression","noiseSuppression"),a}}if(r&&r.prototype.applyConstraints){const s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(a){return this.kind==="audio"&&typeof a=="object"&&(a=JSON.parse(JSON.stringify(a)),i(a,"autoGainControl","mozAutoGainControl"),i(a,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[a])}}}}function LT(e){typeof e=="object"&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function nh(e,t){if(typeof e!="object"||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const o=e.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),o.apply(this,arguments)}};e.RTCPeerConnection.prototype[i]=s[i]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[i,o,s]=arguments;return r.apply(this,[i||null]).then(a=>{if(t.version<53&&!o)try{a.forEach(u=>{u.type=n[u.type]||u.type})}catch(u){if(u.name!=="TypeError")throw u;a.forEach((d,f)=>{a.set(f,Object.assign({},d,{type:n[d.type]||d.type}))})}return a}).then(o,s)}}function kT(e){if(typeof e!="object"||!e.RTCPeerConnection||!e.RTCRtpSender||e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const r=t.apply(this,[]);return r.forEach(i=>i._pc=this),r});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const r=n.apply(this,arguments);return r._pc=this,r}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function DT(e){if(typeof e!="object"||!e.RTCPeerConnection||!e.RTCRtpSender||e.RTCRtpSender&&"getStats"in e.RTCRtpReceiver.prototype)return;const t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){const n=t.apply(this,[]);return n.forEach(r=>r._pc=this),n}),Rs(e,"track",n=>(n.receiver._pc=n.srcElement,n)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function UT(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(t){Ol("removeStream","removeTrack"),this.getSenders().forEach(n=>{n.track&&t.getTracks().includes(n.track)&&this.removeTrack(n)})})}function $T(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function xT(e){if(typeof e!="object"||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const n=arguments[1],r=n&&"sendEncodings"in n;r&&n.sendEncodings.forEach(o=>{if("rid"in o&&!/^[a-z0-9]{0,16}$/i.test(o.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in o&&!(parseFloat(o.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in o&&!(parseFloat(o.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const i=t.apply(this,arguments);if(r){const{sender:o}=i,s=o.getParameters();(!("encodings"in s)||s.encodings.length===1&&Object.keys(s.encodings[0]).length===0)&&(s.encodings=n.sendEncodings,o.sendEncodings=n.sendEncodings,this.setParametersPromises.push(o.setParameters(s).then(()=>{delete o.sendEncodings}).catch(()=>{delete o.sendEncodings})))}return i})}function BT(e){if(typeof e!="object"||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const n=t.apply(this,arguments);return"encodings"in n||(n.encodings=[].concat(this.sendEncodings||[{}])),n})}function FT(e){if(typeof e!="object"||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function VT(e){if(typeof e!="object"||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}var e_=Object.freeze({__proto__:null,shimOnTrack:LT,shimPeerConnection:nh,shimSenderGetStats:kT,shimReceiverGetStats:DT,shimRemoveStream:UT,shimRTCDataChannel:$T,shimAddTransceiver:xT,shimGetParameters:BT,shimCreateOffer:FT,shimCreateAnswer:VT,shimGetUserMedia:MT,shimGetDisplayMedia:function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const r=new DOMException("getDisplayMedia without video constraints is undefined");return r.name="NotFoundError",r.code=8,Promise.reject(r)}return n.video===!0?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}});function jT(e){if(typeof e=="object"&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){const t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(n){this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(r=>t.call(this,r,n)),n.getVideoTracks().forEach(r=>t.call(this,r,n))},e.RTCPeerConnection.prototype.addTrack=function(n,...r){return r&&r.forEach(i=>{this._localStreams?this._localStreams.includes(i)||this._localStreams.push(i):this._localStreams=[i]}),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const n=this._localStreams.indexOf(t);if(n===-1)return;this._localStreams.splice(n,1);const r=t.getTracks();this.getSenders().forEach(i=>{r.includes(i.track)&&this.removeTrack(i)})})}}function HT(e){if(typeof e=="object"&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=r=>{r.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const o=new Event("addstream");o.stream=i,this.dispatchEvent(o)})})}});const t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){const n=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(r){r.streams.forEach(i=>{if(n._remoteStreams||(n._remoteStreams=[]),n._remoteStreams.indexOf(i)>=0)return;n._remoteStreams.push(i);const o=new Event("addstream");o.stream=i,n.dispatchEvent(o)})}),t.apply(n,arguments)}}}function qT(e){if(typeof e!="object"||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,o=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(u,d){const f=arguments.length>=2?arguments[2]:arguments[0],c=n.apply(this,[f]);return d?(c.then(u,d),Promise.resolve()):c},t.createAnswer=function(u,d){const f=arguments.length>=2?arguments[2]:arguments[0],c=r.apply(this,[f]);return d?(c.then(u,d),Promise.resolve()):c};let a=function(u,d,f){const c=i.apply(this,[u]);return f?(c.then(d,f),Promise.resolve()):c};t.setLocalDescription=a,a=function(u,d,f){const c=o.apply(this,[u]);return f?(c.then(d,f),Promise.resolve()):c},t.setRemoteDescription=a,a=function(u,d,f){const c=s.apply(this,[u]);return f?(c.then(d,f),Promise.resolve()):c},t.addIceCandidate=a}function KT(e){const t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const n=t.mediaDevices,r=n.getUserMedia.bind(n);t.mediaDevices.getUserMedia=i=>r(GT(i))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(n,r,i){t.mediaDevices.getUserMedia(n).then(r,i)}.bind(t))}function GT(e){return e&&e.video!==void 0?Object.assign({},e,{video:_T(e.video)}):e}function zT(e){if(!e.RTCPeerConnection)return;const t=e.RTCPeerConnection;e.RTCPeerConnection=function(n,r){if(n&&n.iceServers){const i=[];for(let o=0;o<n.iceServers.length;o++){let s=n.iceServers[o];!s.hasOwnProperty("urls")&&s.hasOwnProperty("url")?(Ol("RTCIceServer.url","RTCIceServer.urls"),s=JSON.parse(JSON.stringify(s)),s.urls=s.url,delete s.url,i.push(s)):i.push(n.iceServers[o])}n.iceServers=i}return new t(n,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function YT(e){typeof e=="object"&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function WT(e){const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(n){if(n){n.offerToReceiveAudio!==void 0&&(n.offerToReceiveAudio=!!n.offerToReceiveAudio);const r=this.getTransceivers().find(o=>o.receiver.track.kind==="audio");n.offerToReceiveAudio===!1&&r?r.direction==="sendrecv"?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":r.direction==="recvonly"&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):n.offerToReceiveAudio!==!0||r||this.addTransceiver("audio"),n.offerToReceiveVideo!==void 0&&(n.offerToReceiveVideo=!!n.offerToReceiveVideo);const i=this.getTransceivers().find(o=>o.receiver.track.kind==="video");n.offerToReceiveVideo===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):n.offerToReceiveVideo!==!0||i||this.addTransceiver("video")}return t.apply(this,arguments)}}function JT(e){typeof e!="object"||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var t_=Object.freeze({__proto__:null,shimLocalStreamsAPI:jT,shimRemoteStreamsAPI:HT,shimCallbacksAPI:qT,shimGetUserMedia:KT,shimConstraints:GT,shimRTCIceServerUrls:zT,shimTrackEventTransceiver:YT,shimCreateOfferLegacy:WT,shimAudioContext:JT});function nu(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)return;const t=e.RTCIceCandidate;e.RTCIceCandidate=function(n){if(typeof n=="object"&&n.candidate&&n.candidate.indexOf("a=")===0&&((n=JSON.parse(JSON.stringify(n))).candidate=n.candidate.substr(2)),n.candidate&&n.candidate.length){const r=new t(n),i=Ue.parseCandidate(n.candidate),o=Object.assign(r,i);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new t(n)},e.RTCIceCandidate.prototype=t.prototype,Rs(e,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new e.RTCIceCandidate(n.candidate),writable:"false"}),n))}function Qs(e,t){if(!e.RTCPeerConnection)return;"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get(){return this._sctp===void 0?null:this._sctp}});const n=function(a){if(!a||!a.sdp)return!1;const u=Ue.splitSections(a.sdp);return u.shift(),u.some(d=>{const f=Ue.parseMLine(d);return f&&f.kind==="application"&&f.protocol.indexOf("SCTP")!==-1})},r=function(a){const u=a.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(u===null||u.length<2)return-1;const d=parseInt(u[1],10);return d!=d?-1:d},i=function(a){let u=65536;return t.browser==="firefox"&&(u=t.version<57?a===-1?16384:2147483637:t.version<60?t.version===57?65535:65536:2147483637),u},o=function(a,u){let d=65536;t.browser==="firefox"&&t.version===57&&(d=65535);const f=Ue.matchPrefix(a.sdp,"a=max-message-size:");return f.length>0?d=parseInt(f[0].substr(19),10):t.browser==="firefox"&&u!==-1&&(d=2147483637),d},s=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,t.browser==="chrome"&&t.version>=76){const{sdpSemantics:a}=this.getConfiguration();a==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const a=r(arguments[0]),u=i(a),d=o(arguments[0],a);let f;f=u===0&&d===0?Number.POSITIVE_INFINITY:u===0||d===0?Math.max(u,d):Math.min(u,d);const c={};Object.defineProperty(c,"maxMessageSize",{get:()=>f}),this._sctp=c}return s.apply(this,arguments)}}function Xs(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function t(r,i){const o=r.send;r.send=function(){const s=arguments[0],a=s.length||s.size||s.byteLength;if(r.readyState==="open"&&i.sctp&&a>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return o.apply(r,arguments)}}const n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const r=n.apply(this,arguments);return t(r,this),r},Rs(e,"datachannel",r=>(t(r.channel,r.target),r))}function rh(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const r=t[n];t[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const o=i.target;if(o._lastConnectionState!==o.connectionState){o._lastConnectionState=o.connectionState;const s=new Event("connectionstatechange",i);o.dispatchEvent(s)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}})}function ih(e,t){if(!e.RTCPeerConnection||t.browser==="chrome"&&t.version>=71||t.browser==="safari"&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(r){if(r&&r.sdp&&r.sdp.indexOf(`
  907. a=extmap-allow-mixed`)!==-1){const i=r.sdp.split(`
  908. `).filter(o=>o.trim()!=="a=extmap-allow-mixed").join(`
  909. `);e.RTCSessionDescription&&r instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:r.type,sdp:i}):r.sdp=i}return n.apply(this,arguments)}}function ru(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&n.length!==0&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(t.browser==="chrome"&&t.version<78||t.browser==="firefox"&&t.version<68||t.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}var OB=Object.freeze({__proto__:null,shimRTCIceCandidate:nu,shimMaxMessageSize:Qs,shimSendThrowTypeError:Xs,shimConnectionState:rh,removeExtmapAllowMixed:ih,shimAddIceCandidateNullOrEmpty:ru});const NB=function({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0}){const n=yg,r=function(o){const s={browser:null,version:null};if(o===void 0||!o.navigator)return s.browser="Not a browser.",s;const{navigator:a}=o;if(a.mozGetUserMedia)s.browser="firefox",s.version=Ks(a.userAgent,/Firefox\/(\d+)\./,1);else if(a.webkitGetUserMedia||o.isSecureContext===!1&&o.webkitRTCPeerConnection&&!o.RTCIceGatherer)s.browser="chrome",s.version=Ks(a.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(a.mediaDevices&&a.userAgent.match(/Edge\/(\d+).(\d+)$/))s.browser="edge",s.version=Ks(a.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!o.RTCPeerConnection||!a.userAgent.match(/AppleWebKit\/(\d+)\./))return s.browser="Not a supported browser.",s;s.browser="safari",s.version=Ks(a.userAgent,/AppleWebKit\/(\d+)\./,1),s.supportsUnifiedPlan=o.RTCRtpTransceiver&&"currentDirection"in o.RTCRtpTransceiver.prototype}return s}(e),i={browserDetails:r,commonShim:OB,extractVersion:Ks,disableLog:bB,disableWarnings:IB};switch(r.browser){case"chrome":if(!Wy||!eh||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),i;if(r.version===null)return n("Chrome shim can not determine version, not shimming."),i;n("adapter.js shimming chrome."),i.browserShim=Wy,ru(e,r),ET(e,r),CT(e),eh(e,r),TT(e),wT(e,r),ST(e),RT(e),bT(e),OT(e,r),nu(e),rh(e),Qs(e,r),Xs(e),ih(e,r);break;case"firefox":if(!e_||!nh||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),i;n("adapter.js shimming firefox."),i.browserShim=e_,ru(e,r),MT(e,r),nh(e,r),LT(e),UT(e),kT(e),DT(e),$T(e),xT(e),BT(e),FT(e),VT(e),nu(e),rh(e),Qs(e,r),Xs(e);break;case"edge":if(!Zy||!th||!t.shimEdge)return n("MS edge shim is not included in this adapter release."),i;n("adapter.js shimming edge."),i.browserShim=Zy,NT(e),AT(e),th(e,r),PT(e),Qs(e,r),Xs(e);break;case"safari":if(!t_||!t.shimSafari)return n("Safari shim is not included in this adapter release."),i;n("adapter.js shimming safari."),i.browserShim=t_,ru(e,r),zT(e),WT(e),qT(e),jT(e),HT(e),YT(e),KT(e),JT(e),nu(e),Qs(e,r),Xs(e),ih(e,r);break;default:n("Unsupported browser!")}return i}({window:typeof window=="undefined"?void 0:window});var Oi,At,_t;(function(e){e.FPS_10="FPS_10",e.FPS_15="FPS_15",e.FPS_24="FPS_24",e.FPS_30="FPS_30"})(Oi||(Oi={})),function(e){e.W176_H132="W176_H132",e.W176_H144="W176_H144",e.W256_H144="W256_H144",e.W320_H180="W320_H180",e.W240_H240="W240_H240",e.W320_H240="W320_H240",e.W480_H360="W480_H360",e.W640_H360="W640_H360",e.W480_H480="W480_H480",e.W640_H480="W640_H480",e.W720_H480="W720_H480",e.W1280_H720="W1280_H720",e.W1920_H1080="W1920_H1080"}(At||(At={})),function(e){e[e.AUDIO_ONLY=0]="AUDIO_ONLY",e[e.VIDEO_ONLY=1]="VIDEO_ONLY",e[e.AUDIO_VIDEO=2]="AUDIO_VIDEO"}(_t||(_t={}));const n_={[At.W176_H132]:{width:176,height:132,maxBitrate:150,minBitrate:80},[At.W176_H144]:{width:176,height:144,maxBitrate:160,minBitrate:80},[At.W256_H144]:{width:256,height:144,maxBitrate:240,minBitrate:120},[At.W320_H180]:{width:320,height:180,maxBitrate:280,minBitrate:120},[At.W240_H240]:{width:240,height:240,maxBitrate:280,minBitrate:120},[At.W320_H240]:{width:320,height:240,maxBitrate:400,minBitrate:120},[At.W480_H360]:{width:480,height:360,maxBitrate:650,minBitrate:150},[At.W640_H360]:{width:640,height:360,maxBitrate:800,minBitrate:180},[At.W480_H480]:{width:480,height:480,maxBitrate:800,minBitrate:180},[At.W640_H480]:{width:640,height:480,maxBitrate:900,minBitrate:200},[At.W720_H480]:{width:720,height:480,maxBitrate:1e3,minBitrate:200},[At.W1280_H720]:{width:1280,height:720,maxBitrate:2200,minBitrate:250},[At.W1920_H1080]:{width:1920,height:1080,maxBitrate:4e3,minBitrate:400}},QT=(e,t)=>{const n=e*t;let r=Number.MAX_VALUE,i=null;for(const o in n_){const s=n_[o],a=Math.abs(s.width*s.height-n);a<r&&(i=s,r=a)}return i},r_={10:1,15:1,24:1.5,30:1.5},XT=e=>{let t=Number.MAX_VALUE,n=1;for(const r in r_){const i=Math.abs(e-parseInt(r));i<t&&(t=i,n=r_[r])}return n},AB={getCameras:()=>ie(void 0,void 0,void 0,function*(){return(yield navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind==="videoinput")}),getMicrophones:()=>ie(void 0,void 0,void 0,function*(){return(yield navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind==="audioinput")}),getSpeakers:()=>ie(void 0,void 0,void 0,function*(){return(yield navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind==="audiooutput")})};class _g extends rc{constructor(t,n,r,i,o){super(),this._tag=t,this._userId=n,this._kind=r,this._isLocalTrack=i,this._roomId=o,this._localMuted=!1,this._remoteMuted=!1,this._streamId=[this._userId||this._roomId,this._tag].join("_"),this._id=[this._streamId,this.isAudioTrack()?0:1].join("_")}getStreamId(){return this._streamId}getTrackId(){return this._id}getUserId(){return this._userId}__innerGetMediaStreamTrack(){return this._msTrack}getTag(){return this._tag}isLocalTrack(){return this._isLocalTrack}isVideoTrack(){return this._kind==="video"}isAudioTrack(){return this._kind==="audio"}isReady(){var t;return((t=this._msTrack)===null||t===void 0?void 0:t.readyState)==="live"}__innerSetMediaStreamTrack(t){this._msTrack=t,this._setLocalMuted(this._localMuted);const n=this._msStream=this._msStream||new MediaStream,r=n.getTracks()[0];r&&n.removeTrack(r),t?n.addTrack(t):this._element&&(this._element.pause(),this._element.srcObject=null)}_setLocalMuted(t){this._msTrack&&(this._msTrack.enabled=!t),this._localMuted=t}mute(){F.info(`set ${this._id} enabled: false`),this._setLocalMuted(!0)}unmute(){F.info(`set ${this._id} enabled: true`),this._setLocalMuted(!1)}isLocalMuted(){return this._localMuted}isMCUTrack(){return Boolean(this._roomId)}isOwnerMuted(){return this._remoteMuted}play(t,n){return ie(this,void 0,void 0,function*(){if(!this._msTrack)return F.warn(`the track is not ready to play -> id: ${this._id}`),{code:B.TRACK_NOT_READY};if(this._msTrack.readyState==="ended"&&F.warn(`the track's readyState is 'ended' -> id: ${this._id}`),n==null?void 0:n.volume){if(!Pt(n==null?void 0:n.volume))return F.error(`${n==null?void 0:n.volume} is not a number, the valid range of options.volume is 0-100`),{code:B.PARAMS_ERROR};(n==null?void 0:n.volume)<0&&(n.volume=0,F.warn("the valid range of options.volume is 0-100, the value of volume has been set 0")),(n==null?void 0:n.volume)>100&&(n.volume=100,F.warn("the valid range of options.volume is 0-100, the value of volume has been set 100"))}if((n==null?void 0:n.audioDeviceId)&&!(yield AB.getSpeakers()).map(i=>i.deviceId).includes(n.audioDeviceId))return F.error(`the options.audioDeviceId is invalid --> ${n.audioDeviceId}`),{code:B.PARAMS_ERROR};const r=this.isVideoTrack();if(r&&(!t||!(t instanceof HTMLVideoElement)))return F.error(`the video track need an <video> to play -> id: ${this._id}`),{code:B.VIDEO_TRACK_MISS_MEDIA_ELEMENT};this._element=r?t:this._element||new Audio,this._localMuted&&this._setLocalMuted(!1),this._element.srcObject&&this._element.srcObject===this._msStream||this._element.pause(),this._element.onloadstart=i=>{var o;F.debug(`HTMLMediaElement onloadstart -> id: ${(o=i.target)===null||o===void 0?void 0:o.id}, trackId: ${this._id}`)},this._element.ondurationchange=i=>{var o;F.debug(`HTMLMediaElement ondurationchange -> id: ${(o=i.target)===null||o===void 0?void 0:o.id}, trackId: ${this._id}`)},this._element.onloadedmetadata=i=>{var o;F.debug(`HTMLMediaElement onloadedmetadata -> id: ${(o=i.target)===null||o===void 0?void 0:o.id}, trackId: ${this._id}`)},this._element.onloadeddata=i=>{var o;F.debug(`HTMLMediaElement onloadeddata -> id: ${(o=i.target)===null||o===void 0?void 0:o.id}, trackId: ${this._id}`)},this._element.onabort=i=>{var o;F.info(`HTMLMediaElement onabort -> id: ${(o=i.target)===null||o===void 0?void 0:o.id}, trackId: ${this._id}`)},this._element.oncanplay=i=>{var o;F.info(`HTMLMediaElement oncanplay -> id: ${(o=i.target)===null||o===void 0?void 0:o.id}, trackId: ${this._id}`)},this._element.onvolumechange=i=>{var o;const s=Math.floor(100*((o=i.target)===null||o===void 0?void 0:o.volume));F.info(`HTMLMediaElement onvolumechange -> volume: ${s}, trackId: ${this._id}`)},this._element.srcObject=this._msStream,this._element.autoplay=!0,r&&(this._element.playsInline=!0,this._element.x5PlaysInline=!0,this._element.webkitPlaysInline=!0),r||!(n==null?void 0:n.volume)&&(n==null?void 0:n.volume)!==0||(this._element.volume=(n==null?void 0:n.volume)/100);try{(n==null?void 0:n.audioDeviceId)&&!r?yield this._element.setSinkId(n.audioDeviceId):this._element.play()}catch(i){return i.message==="No permission to use requested device"?(F.error(`setSinkId failed -> ${i.message}`),{code:B.NO_PERMISSION_TO_USE_REQUESTED_DEVICE}):(F.error(i),{code:B.TRACK_PLAY_ERROR})}return{code:B.SUCCESS}})}__innerDestroy(){this.__innerSetMediaStreamTrack(void 0)}__releaseMediaElement(){this._element&&(this._element.remove(),this._element.srcObject=null)}}class ht extends _g{constructor(t,n,r,i){super(t,n,r,!0),this._isPublished=!1,this.__innerSetMediaStreamTrack(i),i.onended=()=>{i.onended=null,this.emit(ht.EVENT_LOCAL_TRACK_END,this),this.removeAll(ht.EVENT_LOCAL_TRACK_END)}}_setLocalMuted(t){const n=this._localMuted!==t;super._setLocalMuted(t),this._remoteMuted=this._localMuted,n&&this.emit(ht.__INNER_EVENT_MUTED_CHANGE__,this)}__innerSetPublished(t){this._isPublished=t}isPublished(){return this._isPublished}destroy(){var t;F.info(`track is destroyed -> trackId: ${this.getTrackId()}`),(t=this._msTrack)===null||t===void 0||t.stop(),super.__innerDestroy(),this.isAudioTrack()&&super.__releaseMediaElement(),this.emit(ht.__INNER_EVENT_DESTROY__,this)}setBitrate(t=0,n=0,r=0){!Pt(t)||!Pt(n)||!Pt(r)||t<=0||n<=0||t<n?F.error("setBitrate params error ->"):this._bitrateInfo={max:t,min:n,start:r}}getBitrate(){var t,n;const{min:r,max:i}=this._msTrack?DB(this._msTrack):{min:0,max:0};return{min:((t=this._bitrateInfo)===null||t===void 0?void 0:t.min)||r,max:((n=this._bitrateInfo)===null||n===void 0?void 0:n.max)||i}}}ht.EVENT_LOCAL_TRACK_END="local-track-end",ht.__INNER_EVENT_MUTED_CHANGE__="inner-muted-change",ht.__INNER_EVENT_DESTROY__="inner-destroy";class oh extends ht{constructor(t,n,r){super(t,n,"audio",r)}setBitrate(t,n,r){F.warn("`setBitrate` invalid for audio track")}getBitrate(){return{start:32,max:32,min:32}}}class hs extends ht{constructor(t,n,r,i=!1){super(t,n,"video",r),this._isTiny=i}__isTiny(){return this._isTiny}getStreamId(){const t=super.getStreamId();return this._isTiny?`${t}_tiny`:t}getTrackId(){const t=super.getTrackId();return this._isTiny?`${t}_tiny`:t}}class ps extends ht{constructor(t,n,r,i,o){super(t,n,r,i),this._resource=o,ps.__innerSetMapping(this.getTrackId(),o)}static __innerSetMapping(t,n){const r=this._mapping.get(n)||[];r.push(t),this._mapping.set(n,r)}static __innerRemoveMapping(t,n){var r,i;const o=(r=this._mapping.get(n))===null||r===void 0?void 0:r.filter(s=>s!==t);o&&o.length>0?this._mapping.set(n,o):(this._mapping.delete(n),n.pause(),n.src="",(i=n.parentNode)===null||i===void 0||i.removeChild(n))}destroy(){this.isAudioTrack()&&this.mute(),ps.__innerRemoveMapping(this.getTrackId(),this._resource),super.destroy()}}ps._mapping=new Map;class PB extends ps{constructor(t,n,r,i){super(t,n,"video",r,i)}}class MB extends ps{constructor(t,n,r,i){super(t,n,"audio",r,i)}_setLocalMuted(t){this._resource&&(this._resource.muted=t),super._setLocalMuted(t)}play(){return this._setLocalMuted(!1),Promise.resolve({code:B.SUCCESS})}}class i_ extends oh{}class o_ extends hs{}class LB extends hs{}class rn extends _g{constructor(t,n,r,i){super(t,n,r,!1,i),this._isSubscribed=!1}__innerSetRemoteMuted(t){this._remoteMuted=t}__innerSetSubscribed(t){this._isSubscribed=t}isSubscribed(){return this._isSubscribed}}class _i extends rn{constructor(t,n,r){super(t,n,"audio",r)}}class Ei extends rn{constructor(t,n,r){super(t,n,"video",r)}}const qc=(e,t)=>({name:e,content:JSON.stringify({uris:t,ignore:!0})}),Hi=e=>JSON.stringify(e),ci=e=>/^[a-zA-Z\d-=]+$/g.test(e),kB=location.protocol!=="http:"||["localhost","127.0.0.1"].includes(location.hostname),Pd=e=>{if(e===void 0)return 0;if(Pt(e))return e;const t=e;return t.exact||t.ideal||t.max||0},Eg=e=>{const t=e.getConstraints();return{width:Pd(t.width),height:Pd(t.height),frameRate:Pd(t.frameRate)}},DB=e=>{const{width:t,height:n,frameRate:r}=Eg(e),i=QT(t,n),o=XT(r);return{min:i.minBitrate*o,max:i.maxBitrate*o}},dt=e=>[e.msid,e.mediaType].join("_"),vn=e=>{const t=e.split("_");return{mediaType:parseInt(t.pop()),tag:t.pop(),userId:t.join("_")}},Md=(e,t)=>[e,t].join("_"),Kc=e=>e.map(t=>Object.assign({},t)),iu=(e,t,n=!1)=>{e=e.slice();const r=[],i=[],o=[];return t.forEach(s=>{const a=dt(s);let u=e.findIndex(f=>dt(f)===a);if(n&&(u=e.findIndex(f=>f.uri===s.uri)),u===-1)return void r.push(s);const d=e[u];d.uri!==s.uri?r.push(s):d.state!==s.state&&o.push(s),e.splice(u,1)}),i.push(...e),{publishedList:r,unpublishedList:i,modifiedList:o}},UB=()=>{let e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const n=16*Math.random()|0;return(t==="x"?n:3&n|8).toString(16)});return e=e.replace(/-/g,"")+"0",e=parseInt(e,16),e=(t=>{const n="0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ+/".split(""),r=n.length+1;let i=+t;const o=[];do{const s=i%r;i=(i-s)/r,o.unshift(n[s])}while(i);return o.join("")})(e),e.length>22&&(e=e.slice(0,22)),e},zr=e=>{const[t,n]=e.split("_").map(r=>parseInt(r.replace(/[^\d]/g,"")));return{width:t,height:n}},Xo=e=>!!At[e],sh=e=>!!Oi[e],Yr=e=>parseInt(e.replace("FPS_","")),lr=(()=>{const{browser:e,version:t,supportsUnifiedPlan:n}=NB.browserDetails;return{browser:e,version:t,supportsUnifiedPlan:n!==!1}})();function ZT(){return"captureStream"in HTMLMediaElement.prototype||"mozCaptureStream"in HTMLMediaElement.prototype}function eS(){return"mediaDevices"in navigator&&"getDisplayMedia"in navigator.mediaDevices}const ah=e=>Object.prototype.toString.call(e)==="[object Null]",ou=e=>e.type===1,ch=e=>{const t={},n=Object.keys(e.users);return n.length&&n.forEach(r=>{const i=[],o=e.users[r];if(o.uris)try{i.push(...JSON.parse(o.uris))}catch{F.warn(`invalid user data -> userId: ${r}, userData: ${o}`)}t[r]=i}),t};var nt,Hu;(function(e){e.PUBLISH="RCRTC:PublishResource",e.UNPUBLISH="RCRTC:UnpublishResource",e.MODIFY="RCRTC:ModifyResource",e.TOTAL_CONTENT_RESOURCE="RCRTC:TotalContentResources",e.STATE="RCRTC:state",e.ROOM_NOTIFY="RCRTC:RoomNtf",e.USER_NOTIFY="RCRTC:UserNtf",e.KICK="RCRTC:kick",e.PK_INVITE="RCRTC:invite",e.PK_INVITE_TIMEOUT="RCRTC:inviteTimeout",e.PK_CANCEL_INVITE="RCRTC:cancelInvite",e.PK_INVITE_ANSWER="RCRTC:answerInvite",e.PK_END="RCRTC:endInvite",e.OTHER_ROOM_OFFLINE="RCRTC:otherRoomOffline"})(nt||(nt={})),function(e){e.SUCCESS="Success",e.FAIL="Fail"}(Hu||(Hu={}));class $B{constructor(t,n,r,i=1e4){this._roomId=t,this._roomMode=n,this._context=r,this._gap=i,this._latestTimestamp=Date.now(),this._timer=null}start(){return ie(this,void 0,void 0,function*(){this._timer||(this._timer=setInterval(this._loop.bind(this),this._gap))})}_loop(){var t,n,r;return ie(this,void 0,void 0,function*(){const i=yield new Promise(s=>{this._context.rtcPing(this._roomId,this._roomMode).then(s).catch(a=>{F.error(`rtcping receive unknown error -> ${a}`),s(D.UNKNOWN)}),setTimeout(s,1e4,D.TIMEOUT)}),o=Date.now();if(i===D.SUCCESS)return this._latestTimestamp=o,void((t=this.onPingResult)===null||t===void 0||t.call(this,Hu.SUCCESS));(n=this.onPingResult)===null||n===void 0||n.call(this,Hu.FAIL),F.warn(`rtcping failed -> code: ${i}`),(i===40003||o-this._latestTimestamp>6e4)&&(this.stop(),(r=this.onFailed)===null||r===void 0||r.call(this,i===40003))})}stop(){this._timer&&(clearInterval(this._timer),this._timer=null)}}var Zn;(function(e){e[e.NORMAL=1]="NORMAL",e[e.TINY=2]="TINY"})(Zn||(Zn={}));const s_=(e,t)=>Math.round(8*t/e),a_=(e,t=2)=>{const n=10**t;return Math.round(e*n)/n},Ci=(e,t=2)=>{e>1&&(e/=32767);const n=10**t;return Math.ceil(e*n)},Gc=(e,t,n,r)=>{if(t===0)return 0;if(!n||!r)return a_(e/t,3);const i=t-r;if(i===0)return 0;const o=e-n;return o<0||i<0?0:a_(o/i,3)},tS=e=>{const{jitter:t,rtt:n,packetsLostRate:r}=e;return!ah(t)||!ah(n)||r!==0};class Cg{constructor(t,n){this._rtcPeerConn=t,this._sdpSemantics=n,this._latestPacketsSent={},this._latestBytesSent={},this._latestBytesRecv={},this._latestPacketsRecv={}}updateBytesSent(t,n,r){let i,o;if(this._latestBytesSent[t]&&n<this._latestBytesSent[t].bytesSent&&this.clearLatestpacketsSent([t]),this._latestBytesSent[t]){const{bytesSent:s,timestamp:a}=this._latestBytesSent[t];i=n-s,o=r-a,this._latestBytesSent[t]={bytesSent:n,timestamp:r}}else i=n,o=1e3,this._latestBytesSent[t]={bytesSent:n,timestamp:r};return s_(o,i)}updateBytesRecv(t,n,r){let i,o;if(this._latestBytesRecv[t]&&n<this._latestBytesRecv[t].bytesRecv&&this.clearLatestPacketsRecv([t]),this._latestBytesRecv[t]){const{bytesRecv:s,timestamp:a}=this._latestBytesRecv[t];i=n-s,o=r-a,this._latestBytesRecv[t]={bytesRecv:n,timestamp:r}}else i=n,o=1e3,this._latestBytesRecv[t]={bytesRecv:n,timestamp:r};return s_(o,i)}updateSenderPacketsLost(t,n,r){let i;if(Object.prototype.hasOwnProperty.call(this._latestPacketsSent[t],"packetsSent")){const{packetsLost:o,packetsSent:s}=this._latestPacketsSent[t];i=Gc(n,r,o,s),this._latestPacketsSent[t].packetsLost=n,this._latestPacketsSent[t].packetsSent=o===n?s:r}else i=Gc(n,r),this._latestPacketsSent[t].packetsLost=n,this._latestPacketsSent[t].packetsSent=r;return i}updateReceiverPacketsLost(t,n,r){let i;if(this._latestPacketsRecv[t]){const{packetsLost:o,packetsRecv:s}=this._latestPacketsRecv[t];i=Gc(n,r+n,o,s+o)}else i=Gc(n,r);return this._latestPacketsRecv[t]={packetsLost:n,packetsRecv:r},i}clearLatestpacketsSent(t){t.forEach(n=>{if(parseInt(n.split("_").pop())===_t.VIDEO_ONLY){const r=`${n}_tiny`;delete this._latestPacketsSent[r],delete this._latestBytesSent[r]}delete this._latestPacketsSent[n],delete this._latestBytesSent[n]})}clearLatestPacketsRecv(t){t.forEach(n=>{delete this._latestPacketsRecv[n],delete this._latestBytesRecv[n]})}parseRTCStatsReport(t){const n=t.keys(),r={};let i=n.next();for(;!i.done;){const o=i.value,s=t.get(o);/^RTCCodec_/.test(o)||(r[o]=s),i=n.next()}return r}formatRCRTCStateReport(t){return{senders:[],receivers:[]}}getAudioLevelList(t){return[]}getResourceIdByParseSdp(t){var n,r;const i=t.ssrc,o=t.kind||t.mediaType,s=(n=this._rtcPeerConn.currentLocalDescription)===null||n===void 0?void 0:n.sdp,a=(r=this._rtcPeerConn.currentRemoteDescription)===null||r===void 0?void 0:r.sdp;let u;u=this._sdpSemantics==="unified-plan"?new RegExp("a=msid:(.*?) "):new RegExp(`a=ssrc:${i} msid:(.*?) `);const d=s==null?void 0:s.split(`\r
  910. m=`),f=d==null?void 0:d.filter(v=>v.includes(`a=ssrc:${i}`))[0],c=f==null?void 0:f.match(u);let l=c?c[1]:"";if(l)return`${l}_${o==="video"?1:0}`;const h=a==null?void 0:a.split(`\r
  911. m=`),p=h==null?void 0:h.filter(v=>v.includes(`a=ssrc:${i}`))[0],m=p==null?void 0:p.match(u);return l=m?m[1]:"",`${l}_${o==="video"?1:0}`}isValidSender(t){var n;const r=(n=this._rtcPeerConn.currentLocalDescription)===null||n===void 0?void 0:n.sdp,{ssrc:i}=t;return!(r==null?void 0:r.split(`\r
  912. m=`).some(o=>o.includes(i)&&o.includes("a=inactive")))}isValidReceiver(t){var n;const r=(n=this._rtcPeerConn.currentRemoteDescription)===null||n===void 0?void 0:n.sdp,{ssrc:i}=t;return!(r==null?void 0:r.split(`\r
  913. m=`).some(o=>o.includes(i)&&o.includes("a=inactive")))}}class xB extends Cg{formatRCRTCStateReport(t){const n={senders:[],receivers:[]},r=Math.floor(t.RTCPeerConnection.timestamp);n.timestamp=r;const i=Object.keys(t);let o=0,s=0;i.filter(d=>/^RTCOutboundRTP(Video|Audio)Stream_/.test(d)).forEach(d=>{const f=t[d];if(this._sdpSemantics==="unified-plan"&&!this.isValidSender(f))return;const{id:c,kind:l,transportId:h,mediaSourceId:p,remoteId:m,packetsSent:v,bytesSent:_,trackId:y,encoderImplementation:E,pliCount:S,nackCount:T,firCount:R}=f;if(!y)return;let{framesPerSecond:C,frameWidth:w,frameHeight:L}=f;l!=="video"||w||L||C||(w=t[y].frameWidth,L=t[y].frameHeight,C=p?t[p].framesPerSecond:null);const V=t[m];let b=null,I=null,N=0;V&&(b=V.jitter,I=V.roundTripTime,N=V.packetsLost),o+=N;const A=this.getResourceIdByParseSdp(f),M=p?t[p].audioLevel:t[y].audioLevel;let $=null;!this._latestPacketsSent[A]&&(this._latestPacketsSent[A]={}),V?$=this.updateSenderPacketsLost(A,N,v):this._latestPacketsSent[A].crtPacketsSent=v;let x=this.updateBytesSent(A,_,r);x<0&&(x=0),s+=x,n.senders.push({id:c,trackId:A,kind:l,packetsLostRate:$,remoteResource:!1,audioLevel:M||M===0?Ci(M):null,frameWidth:w,frameHeight:L,frameRate:C,bitrate:x,jitter:b&&Math.round(1e3*b),rtt:I,encoderImplementation:E,pliCount:S,nackCount:T,googFirsSent:-1,samplingRate:-1,googRenderDelayMs:-1,trackState:-1})}),i.filter(d=>/RTCRemoteInboundRtp(Video|Audio)Stream_/.test(d)).forEach(d=>{const{localId:f,jitter:c,roundTripTime:l,packetsLost:h}=t[d],p=n.senders.filter(m=>m.id===f)[0];if(p&&!tS(p)){const m=this.getResourceIdByParseSdp(t[p.id]);p.jitter=Math.round(1e3*c),p.rtt=l;const v=this._latestPacketsSent[m].crtPacketsSent;p.packetsLostRate=this.updateSenderPacketsLost(m,h,v)}});let a=0;i.filter(d=>/^RTCInboundRTP(Video|Audio)Stream_/.test(d)).forEach(d=>{const f=t[d];if(this._sdpSemantics==="unified-plan"&&!this.isValidReceiver(f))return;const{trackId:c,packetsLost:l,packetsReceived:h,jitter:p,bytesReceived:m,framesPerSecond:v,kind:_,codecImplementationName:y,nackCount:E,pliCount:S}=f;if(!c)return;let{frameWidth:T,frameHeight:R,audioLevel:C}=f;_==="video"?T||R||(T=t[c].frameWidth,R=t[c].frameHeight):C||(C=t[c].audioLevel),o+=l;const w=this.getResourceIdByParseSdp(f),L=this.updateReceiverPacketsLost(w,l,h);let V=this.updateBytesRecv(w,m,r);V<0&&(V=0),a+=V,n.receivers.push({trackId:w,kind:_,packetsLostRate:L,remoteResource:!0,audioLevel:C||C===0?Ci(C):null,frameWidth:T,frameHeight:R,frameRate:v,bitrate:V,jitter:p?Math.round(1e3*p):0,codecImplementationName:y,nackCount:E,pliCount:S,rtt:null,samplingRate:-1,googFirsReceived:-1,googRenderDelayMs:-1,trackState:-1})});const u=i.filter(d=>/^RTCTransport_/.test(d))[0];if(u){const d=t[u],{selectedCandidatePairId:f}=d;if(f){const c=t[f],{availableOutgoingBitrate:l,availableIncomingBitrate:h,currentRoundTripTime:p,localCandidateId:m,remoteCandidateId:v}=c,_=t[m],{ip:y,port:E,networkType:S}=_,T=t[v],{ip:R,port:C,protocol:w}=T;n.iceCandidatePair={IP:y,port:E,networkType:S,remoteIP:R,remotePort:C,protocol:w,bitrateRecv:a,bitrateSend:s,rtt:1e3*p,availableOutgoingBitrate:l,availableIncomingBitrate:h,totalPacketsLost:o},n.receivers.forEach(L=>{L.rtt=p})}}return n}getAudioLevelList(t){const n=[],r=Object.keys(t);return r.filter(i=>/^RTCOutboundRTPAudioStream_/.test(i)).forEach(i=>{var o;const s=t[i];if(this._sdpSemantics==="unified-plan"&&!this.isValidSender(s))return;const{mediaSourceId:a,trackId:u}=s,d=this.getResourceIdByParseSdp(s),f=a&&t[a]?t[a].audioLevel:((o=t[u])===null||o===void 0?void 0:o.audioLevel)||null;n.push({trackId:d,audioLevel:f||f===0?Ci(f):null})}),r.filter(i=>/^RTCInboundRTPAudioStream_/.test(i)).forEach(i=>{const o=t[i];if(this._sdpSemantics==="unified-plan"&&!this.isValidReceiver(o))return;const{trackId:s}=o,a=o.audioLevel||t[s].audioLevel,u=this.getResourceIdByParseSdp(o);n.push({trackId:u,audioLevel:a||a===0?Ci(a):null})}),n}}class BB extends Cg{formatRCRTCStateReport(t){const n=+new Date,r={senders:[],receivers:[],timestamp:n};let i=0,o=0,s=0;for(const a in t){const u=t[a],d=u.type;if(d==="outbound-rtp"){if(this._sdpSemantics==="unified-plan"&&!this.isValidSender(u))continue;const{id:f,kind:c,bytesSent:l,packetsSent:h,bitrateMean:p,framerateMean:m,nackCount:v,pliCount:_,remoteId:y}=u,{jitter:E,roundTripTime:S,packetsLost:T}=y?t[y]:{jitter:null,roundTripTime:null,packetsLost:0},R=this.getResourceIdByParseSdp(u);i+=T;let C=null;!this._latestPacketsSent[R]&&(this._latestPacketsSent[R]={}),y?C=this.updateSenderPacketsLost(R,T,h):this._latestPacketsSent[R].crtPacketsSent=h;let w=0;c==="video"?p&&(w=Math.floor(p/1e3)):w=this.updateBytesSent(R,l,n),w<0&&(w=0),o+=w,r.senders.push({trackId:R,kind:c,packetsLostRate:C,remoteResource:!1,audioLevel:null,frameWidth:null,frameHeight:null,frameRate:Math.floor(m),bitrate:w,jitter:E?Math.round(1e3*E):null,rtt:S,encoderImplementation:null,pliCount:_,nackCount:v,googFirsSent:-1,samplingRate:-1,googRenderDelayMs:-1,trackState:-1})}if(d==="remote-inbound-rtp"){const{localId:f}=u,c=this.getResourceIdByParseSdp(t[f]),l=r.senders.filter(h=>h.trackId===c)[0];l&&tS(l)&&(l.jitter=Math.round(1e3*u.jitter),l.rtt=u.rtt,l.packetsLostRate=this.updateSenderPacketsLost(c,u.packetsLost,this._latestPacketsSent[c].crtPacketsSent))}if(d==="inbound-rtp"){if(this._sdpSemantics==="unified-plan"&&!this.isValidReceiver(u))continue;const{id:f,packetsLost:c,bytesReceived:l,packetsReceived:h,jitter:p,framerateMean:m,kind:v,bitrateMean:_,nackCount:y,pliCount:E}=u,S=this.getResourceIdByParseSdp(u);i+=c;const T=this.updateReceiverPacketsLost(S,c,h);let R=0;v==="video"?_&&(R=Math.floor(_/1e3)):R=this.updateBytesRecv(S,l,n),R<0&&(R=0),s+=R,r.receivers.push({trackId:S,kind:v,packetsLostRate:T,remoteResource:!0,audioLevel:null,frameWidth:null,frameHeight:null,frameRate:Math.floor(m),bitrate:R,jitter:p?Math.round(1e3*p):null,codecImplementationName:null,nackCount:y,pliCount:E,rtt:null,samplingRate:-1,googFirsReceived:-1,googRenderDelayMs:-1,trackState:-1})}if(d==="candidate-pair"&&u.state==="succeeded"){const f=t[u.localCandidateId],{address:c,port:l}=f,h=t[u.remoteCandidateId],{address:p,port:m,protocol:v}=h;r.iceCandidatePair={IP:c,port:l,networkType:null,remoteIP:p,remotePort:m,protocol:v,bitrateRecv:s,bitrateSend:o,rtt:null,availableOutgoingBitrate:null,availableIncomingBitrate:null,totalPacketsLost:i}}}return r.iceCandidatePair&&(r.iceCandidatePair.bitrateSend=o),r.iceCandidatePair&&(r.iceCandidatePair.bitrateRecv=s),r}getAudioLevelList(t){const n=[];for(const r in t){const i=t[r],o=i.type;if(o==="outbound-rtp"){if(this._sdpSemantics==="unified-plan"&&!this.isValidSender(i))continue;const{kind:s}=i;if(s==="video")continue;const a=this.getResourceIdByParseSdp(i);n.push({trackId:a,audioLevel:null})}if(o==="inbound-rtp"){if(this._sdpSemantics==="unified-plan"&&!this.isValidReceiver(i))continue;const{kind:s}=i;if(s==="video")continue;const a=this.getResourceIdByParseSdp(i);n.push({trackId:a,audioLevel:null})}}return n}}class FB extends Cg{formatRCRTCStateReport(t){const n={senders:[],receivers:[]},r=Math.floor(t.RTCPeerConnection.timestamp);n.timestamp=r;const i=Object.keys(t);let o=0,s=0;i.filter(d=>/^RTCOutboundRTP(Video|Audio)Stream_/.test(d)).forEach(d=>{const f=t[d];if(this._sdpSemantics==="unified-plan"&&!this.isValidSender(f))return;const c=this.getResourceIdByParseSdp(f),{mediaType:l,transportId:h,remoteId:p,packetsSent:m,bytesSent:v,trackId:_,encoderImplementation:y,pliCount:E,nackCount:S,firCount:T}=f;if(!_)return;const{audioLevel:R,frameHeight:C,frameWidth:w}=t[_];let L=this.updateBytesSent(c,v,r);L<0&&(L=0),s+=L,n.senders.push({trackId:c,kind:l,packetsLostRate:null,remoteResource:!1,audioLevel:R||R===0?Ci(R):null,frameWidth:w,frameHeight:C,frameRate:null,bitrate:L,jitter:null,rtt:null,encoderImplementation:y,pliCount:E,nackCount:S,googFirsSent:-1,samplingRate:-1,googRenderDelayMs:-1,trackState:-1})});let a=0;i.filter(d=>/^RTCInboundRTP(Video|Audio)Stream_/.test(d)).forEach(d=>{const f=t[d];if(this._sdpSemantics==="unified-plan"&&!this.isValidReceiver(f))return;const{trackId:c,packetsLost:l,packetsReceived:h,jitter:p,bytesReceived:m,mediaType:v,nackCount:_,pliCount:y}=f,E=this.getResourceIdByParseSdp(f);if(!c)return;const{frameHeight:S,frameWidth:T,audioLevel:R}=t[c];o+=l;const C=this.updateReceiverPacketsLost(E,l,h);let w=this.updateBytesRecv(E,m,r);w<0&&(w=0),a+=w,n.receivers.push({trackId:E,kind:v,packetsLostRate:C,remoteResource:!0,audioLevel:R||R===0?Ci(R):null,frameWidth:T,frameHeight:S,frameRate:null,bitrate:w,jitter:p,codecImplementationName:null,nackCount:_,pliCount:y,rtt:null,samplingRate:-1,googFirsReceived:-1,googRenderDelayMs:-1,trackState:-1})});const u=i.filter(d=>/^RTCTransport_/.test(d))[0];if(u){const d=t[u],{selectedCandidatePairId:f}=d;if(f){const c=t[f],{availableOutgoingBitrate:l,availableIncomingBitrate:h,currentRoundTripTime:p,localCandidateId:m,remoteCandidateId:v}=c,_=t[m],{address:y,port:E}=_,S=t[v],{address:T,port:R,protocol:C}=S;n.iceCandidatePair={IP:y||null,port:E,networkType:null,remoteIP:T,remotePort:R,protocol:C,bitrateRecv:a,bitrateSend:s,rtt:1e3*p,availableOutgoingBitrate:l,availableIncomingBitrate:h,totalPacketsLost:o},n.receivers.forEach(w=>{w.rtt=p})}}return n}getAudioLevelList(t){const n=[],r=Object.keys(t);return r.filter(i=>/^RTCOutboundRTP(Video|Audio)Stream_/.test(i)).forEach(i=>{const o=t[i];if(this._sdpSemantics==="unified-plan"&&!this.isValidSender(o))return;const{trackId:s,mediaType:a}=o;if(a==="video")return;const u=this.getResourceIdByParseSdp(o),d=t[s];n.push({trackId:u,audioLevel:d||d===0?Ci(d):null})}),r.filter(i=>/^RTCInboundRTP(Video|Audio)Stream_/.test(i)).forEach(i=>{const o=t[i];if(this._sdpSemantics==="unified-plan"&&!this.isValidReceiver(o))return;const{trackId:s,mediaType:a}=o;if(!s||a==="video")return;const{audioLevel:u}=t[s],d=this.getResourceIdByParseSdp(o);n.push({trackId:d,audioLevel:u||u===0?Ci(u):null})}),n}}class bs{constructor(t){this._peer=t,this._outboundStreams={}}static setSdpSemantics(t){const{browser:n,version:r,supportsUnifiedPlan:i}=lr;i?/chrome/i.test(n)?this._sdpSemantics=r>92?"unified-plan":r<72?"plan-b":t:/firefox/i.test(n)?this._sdpSemantics="unified-plan":/safari/i.test(n)?this._sdpSemantics=r<12?"plan-b":"unified-plan":this._sdpSemantics="unified-plan":this._sdpSemantics="plan-b"}static getSdpSemantics(){return bs._sdpSemantics}getOutboundVideoInfo(){const t=[];for(const n in this._outboundStreams){const r=this._outboundStreams[n].getVideoTracks()[0];if(!r)continue;const i=/_tiny$/.test(n),{width:o,height:s}=Eg(r);t.push({trackId:r.id,simulcast:i?Zn.TINY:Zn.NORMAL,resolution:`${o}x${s}`})}return t}setRemoteAnswer(t){return ie(this,void 0,void 0,function*(){t=t.replace(/\s+\r\n/g,`\r
  914. `);try{yield this._peer.setRemoteDescription({type:"answer",sdp:t})}catch(n){return F.error(n),B.SET_REMOTE_DESCRIPTION_FAILED}return B.SUCCESS})}getStatParsr(t,n){return/chrome/i.test(lr.browser)?new xB(t,n):/Firefox/i.test(lr.browser)?new BB(t,n):/Safari/i.test(lr.browser)?new FB(t,n):null}}class VB extends bs{constructor(){super(...arguments),this.senders={},this._localTracks=[]}addLocalTrack(t){this._localTracks.includes(t)||this._localTracks.push(t);const n=t.getStreamId(),r=t.__innerGetMediaStreamTrack(),i=this._outboundStreams[n]||(this._outboundStreams[n]=new MediaStream);i.getTracks().forEach(a=>{a.kind===r.kind&&i.removeTrack(a)}),i.addTrack(r);const o=t.getTrackId(),s=this.senders[o];s?s.replaceTrack(r):this.senders[o]=this._peer.addTrack(r,i)}removeLocalTrack(t){const n=this._localTracks.findIndex(o=>o===t);n>=0&&this._localTracks.splice(n,1);const r=t.getTrackId(),i=this.senders[r];i&&(i.replaceTrack(null),this._peer.removeTrack(i),delete this.senders[r])}updateSubRemoteTracks(t){}updateRecvTransceiverMap(t,n){}setBitrate(t,n,r){this._maxBitrate=t,this._minBitrate=n,this._startBitrate=r||.7*t}createOffer(t){return ie(this,void 0,void 0,function*(){const n=yield this._peer.createOffer({iceRestart:t,offerToReceiveAudio:!0,offerToReceiveVideo:!0});for(const r in this._outboundStreams){const i=this._outboundStreams[r].id;n.sdp=n.sdp.replace(new RegExp(i,"g"),r)}return yield this._peer.setLocalDescription(n),{type:"offer",semantics:"plan-b",sdp:n.sdp}})}setRemoteAnswer(t){let n=0,r=0;this._localTracks.forEach(a=>{const{min:u,max:d}=a.getBitrate();r+=u,n+=d}),n=this._maxBitrate&&this._maxBitrate>0?Math.min(n,this._maxBitrate):n,r=this._minBitrate&&this._minBitrate>0?Math.max(r,this._minBitrate):r;const i=this._startBitrate||Math.round(.7*n),o=`b=AS:${n}`;t=t.replace(/[\r\n]+m=video[^\r\n]+/,a=>`${a}\r
  915. ${o}`);const s=[`;x-google-min-bitrate=${r}`,`;x-google-max-bitrate=${n}`,`;x-google-start-bitrate=${i}`].join("");return t=t.replace(/[\r\n]+[^\r\n]+profile-level-id[^\r\n]+/g,a=>a+s),super.setRemoteAnswer(t)}}class jB extends bs{constructor(){super(...arguments),this._sendTransceiver={},this._localTracks={},this._recvAudio=[],this._recvVideo=[],this._recvTransceiver={},this._subedTracks=[]}setBitrate(t,n,r){F.warn("the interface named `setBitrate` is invalid while sdpSemantics value is `unified-plan`")}addLocalTrack(t){const n=t.getTrackId(),r=t.getStreamId(),i=t.__innerGetMediaStreamTrack();this._localTracks[n]=t;const o=this._outboundStreams[r]||(this._outboundStreams[r]=new MediaStream);o.getTracks().forEach(a=>{a.kind===i.kind&&o.removeTrack(a)}),o.addTrack(i);const s=this._sendTransceiver[n];s?(s.sender.replaceTrack(i),s.direction="sendonly"):this._sendTransceiver[n]=this._peer.addTransceiver(i,{direction:"sendonly",streams:[o]})}removeLocalTrack(t){const n=t.getTrackId(),r=t.getStreamId();t.__innerGetMediaStreamTrack(),delete this._localTracks[n];const i=this._sendTransceiver[n];if(!i)return;i.direction="inactive",this._peer.removeTrack(i.sender),i.sender.replaceTrack(null);const o=this._outboundStreams[r];(t.isAudioTrack()?o.getAudioTracks():o.getVideoTracks()).forEach(d=>o.removeTrack(d));const s=this._sendTransceiver[`${n}_tiny`];if(!s||s.direction==="inactive")return;s.direction="inactive";const a=s.sender,u=a.track;this._peer.removeTrack(a),a.replaceTrack(null),this._outboundStreams[`${r}_tiny`].removeTrack(u),u.stop()}updateRecvTransceiverMap(t,n){const{mediaType:r}=vn(t);this._recvTransceiver[t]=n;const i=r===_t.AUDIO_ONLY?this._recvAudio:this._recvVideo,o=i.findIndex(s=>s===n);o>=0&&i.splice(o,1)}updateSubRemoteTracks(t){const n=t.slice(),r=this._subedTracks.slice();this._subedTracks=t.slice();for(let o=n.length-1;o>=0;o-=1){const s=n[o],a=r.findIndex(u=>u===s);a>=0&&(n.splice(o,1),r.splice(a,1))}r.length&&r.forEach(o=>{const s=o.getTrackId();o.__innerSetMediaStreamTrack(void 0);const a=this._recvTransceiver[s];a&&(a.direction="inactive")});const i={audio:0,video:0};n.length&&n.forEach(o=>{const s=o.isAudioTrack()?"audio":"video",a=this._recvTransceiver[o.getTrackId()];a?a.direction="recvonly":i[s]+=1});for(let o=this._recvAudio.length;o<i.audio;o+=1)this._recvAudio.push(this._peer.addTransceiver("audio",{direction:"recvonly"}));for(let o=this._recvVideo.length;o<i.video;o+=1)this._recvVideo.push(this._peer.addTransceiver("video",{direction:"recvonly"}))}createOffer(t){return ie(this,void 0,void 0,function*(){const n=yield this._peer.createOffer({iceRestart:t});let r=n.sdp;for(const i in this._outboundStreams){const o=this._outboundStreams[i].id;r=r.replace(new RegExp(o,"g"),i)}return r=(i=>i.split(/\r\n(?=m=)/).map(o=>(s=>/a=(recvonly|inactive)/.test(s)?s.replace(/\r\na=(ssrc|msid)[^\r\n]+/g,""):s)(o)).join(`\r
  916. `))(r),r=r.replace(/a=ice-options:trickle/g,`a=ice-options:trickle\r
  917. a=ice-options:renomination`),n.sdp=r,yield this._peer.setLocalDescription(n),{type:"offer",semantics:"unified-plan",sdp:r}})}setRemoteAnswer(t){t=t.split(/\r\n(?=m=)/).map(r=>{var i;const o=r.match(/a=mid:[^\s]+/);if(!o)return r;const s=o[0].replace("a=mid:","");let a="";for(const p in this._sendTransceiver)if(this._sendTransceiver[p].mid===s){a=p;break}if(!a)return r;const u=(i=this._localTracks[a])===null||i===void 0?void 0:i.getBitrate();if(!u)return r;const{max:d,min:f}=u,c=d&&d>0?u.start||.7*d:0,l=[];if(d&&d>0&&l.push(`;x-google-max-bitrate=${d}`),f&&f>0&&l.push(`;x-google-min-bitrate=${f}`),c>0&&l.push(`;x-google-start-bitrate=${c}`),l.length===0)return r;const h=l.join("");return r.replace(/[\r\n]+[^\r\n]+profile-level-id[^\r\n]+/g,p=>p+h)}).join(`\r
  918. `);const n=/[\r\n]+\r\n[\r\n]+/g;return n.test(t)&&(F.warn(`answer sdp invalid -> ${JSON.stringify(t)}`),t=t.replace(n,`\r
  919. `)),super.setRemoteAnswer(t)}}class Zr extends rc{constructor(t,n){super(),this._reTryExchange=t,this._polarisReport=n,this.pubLocalTracks={},this._reTryExchangeTimer=null,this._reportStatsTimer=null,this._reportListener=null;const r=bs.getSdpSemantics(),i=this._rtcPeerConn=new RTCPeerConnection({sdpSemantics:r});this._sdpStrategy=r==="plan-b"?new VB(i):new jB(i),this._rtcPeerConn.oniceconnectionstatechange=this._onICEConnectionStateChange.bind(this),this._rtcPeerConn.onconnectionstatechange=this._onConnectionStateChange.bind(this),this._rtcPeerConn.ontrack=this._onTrackReady.bind(this),this.reportParser=this._sdpStrategy.getStatParsr(this._rtcPeerConn,r)}getLocalTracks(){return Object.values(this.pubLocalTracks)}_onConnectionStateChange(){F.info(`onconnectionstatechange -> ${this._rtcPeerConn.connectionState}`)}_onICEConnectionStateChange(){var t,n;F.info(`oniceconnectionstatechange -> ${this._rtcPeerConn.iceConnectionState}`),this._rtcPeerConn.iceConnectionState==="connected"&&(this._reportStatsTimer&&clearInterval(this._reportStatsTimer),this._reportStatsTimer=setInterval(this._reportHandle.bind(this),1e3)),this._rtcPeerConn.iceConnectionState!=="failed"&&this._rtcPeerConn.iceConnectionState!=="disconnected"||(F.warn("iceconenction state is `failed`, exchange SDP to try again."),this._reTryExchange(),this._reTryExchangeTimer=setInterval(this._reTryExchange,15e3));try{(n=(t=this._reportListener)===null||t===void 0?void 0:t.onICEConnectionStateChange)===null||n===void 0||n.call(t,this._rtcPeerConn.iceConnectionState)}catch(r){F.error("onICEConnectionStateChange error",r)}}_onTrackReady(t){if(!t.streams.length)return;const n=[t.streams[0].id,t.receiver.track.kind==="audio"?_t.AUDIO_ONLY:_t.VIDEO_ONLY].join("_");this._updateRecvTransceiverMap(n,t.transceiver),this.emit(Zr.__INNER_EVENT_TRACK_READY__,t)}setBitrate(t,n,r){return ie(this,void 0,void 0,function*(){this._sdpStrategy.setBitrate(t,n,r)})}createOffer(t){return ie(this,void 0,void 0,function*(){const n=yield this._sdpStrategy.createOffer(t);return F.debug(`offer -> ${JSON.stringify(n.sdp)}`),n})}setRemoteAnswer(t){return ie(this,void 0,void 0,function*(){return F.debug(`answer -> ${JSON.stringify(t)}`),this._sdpStrategy.setRemoteAnswer(t)})}getLocalTrack(t){return this.pubLocalTracks[t]||null}addLocalTrack(t){this.pubLocalTracks[t.getTrackId()]=t,this._sdpStrategy.addLocalTrack(t),t.off(ht.__INNER_EVENT_MUTED_CHANGE__,this._onLocalTrackMuted,this),t.off(ht.__INNER_EVENT_DESTROY__,this._onLocalTrackDestroied,this),t.on(ht.__INNER_EVENT_MUTED_CHANGE__,this._onLocalTrackMuted,this),t.on(ht.__INNER_EVENT_DESTROY__,this._onLocalTrackDestroied,this)}removeLocalTrackById(t){const n=this.getLocalTrack(t);n&&this.removeLocalTrack(n)}removeAllLocalTrack(){Object.keys(this.pubLocalTracks).forEach(t=>{/_tiny$/.test(t)||this.removeLocalTrackById(t)})}removeLocalTrack(t){const n=t.getTrackId();delete this.pubLocalTracks[n],this._sdpStrategy.removeLocalTrack(t),t.__innerSetPublished(!1),t.off(ht.__INNER_EVENT_MUTED_CHANGE__,this._onLocalTrackMuted,this),t.off(ht.__INNER_EVENT_DESTROY__,this._onLocalTrackDestroied,this);const r=`${n}_tiny`,i=this.getLocalTrack(r);i&&(this._sdpStrategy.removeLocalTrack(i),delete this.pubLocalTracks[r],i.destroy())}_updateRecvTransceiverMap(t,n){this._sdpStrategy.updateRecvTransceiverMap(t,n)}updateSubRemoteTracks(t){this._sdpStrategy.updateSubRemoteTracks(t)}getOutboundVideoInfo(){return this._sdpStrategy.getOutboundVideoInfo()}_onLocalTrackMuted(t){const n=this.getLocalTrack(`${t.getTrackId()}_tiny`);n&&(n.__innerGetMediaStreamTrack().enabled=!t.isLocalMuted()),this.emit(ht.__INNER_EVENT_MUTED_CHANGE__,t)}_onLocalTrackDestroied(t){this.emit(ht.__INNER_EVENT_DESTROY__,t)}registerReportListener(t){this._reportListener=t}_createRCRTCStateReport(t){const{timestamp:n,iceCandidatePair:r,senders:i,receivers:o}=JSON.parse(JSON.stringify(t));r==null||delete r.totalPacketsLost;for(const s in r)ah(r[s])&&delete r[s];return{timestamp:n,iceCandidatePair:r,senders:i.map(s=>{const a={};return s.trackId&&(a.trackId=s.trackId),s.kind&&(a.kind=s.kind),(s.packetsLostRate||s.packetsLostRate===0)&&(a.packetsLostRate=s.packetsLostRate),a.remoteResource=s.remoteResource,(s.audioLevel||s.audioLevel===0)&&(a.audioLevel=s.audioLevel),s.frameWidth&&(a.frameWidth=s.frameWidth),s.frameHeight&&(a.frameHeight=s.frameHeight),s.frameRate&&(a.frameRate=s.frameRate),(s.bitrate||s.bitrate===0)&&(a.bitrate=s.bitrate),s.jitter&&(a.jitter=s.jitter),a}),receivers:o.map(s=>{const a={};return s.trackId&&(a.trackId=s.trackId),s.kind&&(a.kind=s.kind),(s.packetsLostRate||s.packetsLostRate===0)&&(a.packetsLostRate=s.packetsLostRate),a.remoteResource=s.remoteResource,(s.audioLevel||s.audioLevel===0)&&(a.audioLevel=s.audioLevel),s.frameWidth&&(a.frameWidth=s.frameWidth),s.frameHeight&&(a.frameHeight=s.frameHeight),s.frameRate&&(a.frameRate=s.frameRate),(s.bitrate||s.bitrate===0)&&(a.bitrate=s.bitrate),s.jitter&&(a.jitter=s.jitter),a})}}_getStatsData(){var t,n;return ie(this,void 0,void 0,function*(){const r=yield this._rtcPeerConn.getStats(),i=(t=this.reportParser)===null||t===void 0?void 0:t.parseRTCStatsReport(r);return(n=this.reportParser)===null||n===void 0?void 0:n.formatRCRTCStateReport(i)})}getAudioLevelReportData(){var t,n;return ie(this,void 0,void 0,function*(){const r=yield this._rtcPeerConn.getStats(),i=(t=this.reportParser)===null||t===void 0?void 0:t.parseRTCStatsReport(r);return i?(n=this.reportParser)===null||n===void 0?void 0:n.getAudioLevelList(i):[]})}_reportHandle(){var t,n,r;return ie(this,void 0,void 0,function*(){const i=yield this._getStatsData();if(!i)return;(i.senders.length||i.receivers.length)&&((t=this._polarisReport)===null||t===void 0||t.sendR3R4Data(i));const o=this._createRCRTCStateReport(i);(r=(n=this._reportListener)===null||n===void 0?void 0:n.onStateReport)===null||r===void 0||r.call(n,o)})}getRTCPeerConn(){return this._rtcPeerConn}destroy(){this.clear(),this.clearReTryExchangeTimer(),this._reportStatsTimer&&(clearInterval(this._reportStatsTimer),this._reportStatsTimer=null),this.registerReportListener(null),this._rtcPeerConn.close(),this.reportParser=null}clearReTryExchangeTimer(){clearInterval(this._reTryExchangeTimer),this._reTryExchangeTimer=null}}var jo,qu,Ti,Si,Ku;Zr.__INNER_EVENT_TRACK_READY__="inner-track-ready",function(e){e[e.DISABLE=0]="DISABLE",e[e.ENABLE=1]="ENABLE"}(jo||(jo={})),function(e){e[e.MeetingOrAnchor=1]="MeetingOrAnchor",e[e.Audience=2]="Audience"}(qu||(qu={}));class nS{constructor(t,n,r,i,o=qu.MeetingOrAnchor){this._context=t,this._runtime=n,this._roomId=r,this._crtRTCRoom=i,this._userRole=o}_send(t){this._context.getConnectionStatus()===Ke.CONNECTED&&this._context.setRTCState(this._roomId,t)}_getClientID(){const t="uuid";let n=this._runtime.localStorage.getItem(t);return n||(n=UB(),this._runtime.localStorage.setItem(t,n)),n}_getRealResourceId(t){let n=t;const r=t.indexOf("_tiny");return r>-1&&(n=t.slice(0,r)),n}_getPolarisTrackId(t){let n="";const r=t.split("_");if(t.includes("_tiny")){const i=r.pop(),o=parseInt(r.pop())===_t.AUDIO_ONLY?"audio":"video",s=r.pop();n=[r.join("_"),s,i,o].join("_")}else{const i=parseInt(r.pop())===_t.AUDIO_ONLY?"audio":"video",o=r.pop();n=[r.join("_"),o,i].join("_")}return n}sendR3R4Data(t){const{iceCandidatePair:n,senders:r,receivers:i}=t,o=(n==null?void 0:n.bitrateSend)||-1,s=(n==null?void 0:n.bitrateRecv)||-1,a=(n==null?void 0:n.networkType)||"unknown",u=(n==null?void 0:n.rtt)||-1,d=`${(n==null?void 0:n.IP)||-1}:${n==null?void 0:n.port}`,f=(n==null||n.remoteIP,n==null||n.remotePort,(n==null?void 0:n.availableIncomingBitrate)||-1),c=(n==null?void 0:n.availableOutgoingBitrate)||-1,l=(n==null?void 0:n.totalPacketsLost)||-1,h=this._context.getCurrentId();let p=`R3 ${o} -1 -1 -1 ${a} ${u} ${d} ${f} ${c} ${l} ${h}\r`,m=`R4 ${s} -1 -1 -1 ${a} ${u} ${d} ${f} ${c} ${l} ${h}\r`;const v=r.map(y=>{var E;const{trackId:S,audioLevel:T,samplingRate:R,bitrate:C,packetsLostRate:w,frameRate:L,frameWidth:V,frameHeight:b,googRenderDelayMs:I,jitter:N,nackCount:A,pliCount:M,rtt:$,googFirsSent:x,encoderImplementation:q}=y,Z=this._getPolarisTrackId(S),le=this._getRealResourceId(S);return{trackId:Z,googCodecName:q||String(-1),audioLevel:T||T===0?T:-1,bitrate:C||C===0?C:-1,packetsLostRate:w||w===0?w:-1,frameRate:L||-1,resolution:V&&b?`${V} * ${b}`:"-1",jitter:N||-1,nackCount:A||A===0?A:-1,pliCount:M||M===0?M:-1,rtt:$||-1,googFirsSent:x,samplingRate:R,googRenderDelayMs:I,encoderImplementation:q||String(-1),trackState:((E=this._crtRTCRoom.getLocalTrack(le))===null||E===void 0?void 0:E.isLocalMuted())?jo.DISABLE:jo.ENABLE}}),_=i.filter(y=>!!y.trackId).map(y=>{var E;const{trackId:S,audioLevel:T,samplingRate:R,bitrate:C,packetsLostRate:w,frameRate:L,frameWidth:V,frameHeight:b,googRenderDelayMs:I,jitter:N,nackCount:A,pliCount:M,rtt:$,googFirsReceived:x,codecImplementationName:q}=y,Z=this._getPolarisTrackId(S),le=this._getRealResourceId(S);return{trackId:Z,googCodecName:q||String(-1),audioLevel:T||T===0?T:-1,bitrate:C||C===0?C:-1,packetsLostRate:w||w===0?w:-1,frameRate:L||-1,resolution:V&&b?`${V} * ${b}`:"-1",jitter:N||-1,nackCount:A||A===0?A:-1,pliCount:M||M===0?M:-1,rtt:$||-1,googFirsReceived:x,samplingRate:R,googRenderDelayMs:I,codecImplementationName:q||String(-1),trackState:((E=this._crtRTCRoom.getRemoteTrack(le))===null||E===void 0?void 0:E.isLocalMuted())?jo.DISABLE:jo.ENABLE}});p+=v.map(y=>`${y.trackId} ${y.googCodecName} ${y.audioLevel} ${y.samplingRate} ${y.bitrate} ${y.packetsLostRate} ${y.frameRate} ${y.resolution} ${y.googRenderDelayMs} ${y.jitter} ${y.nackCount} ${y.pliCount} ${y.rtt} ${y.googFirsSent} ${y.encoderImplementation} ${y.trackState}`).join(`
  920. `),t.senders.length&&this._send(p+`\r${this._userRole}`),m+=_.map(y=>`${y.trackId} ${y.googCodecName} ${y.audioLevel} ${y.samplingRate} ${y.bitrate} ${y.packetsLostRate} ${y.frameRate} ${y.resolution} ${y.googRenderDelayMs} ${y.jitter} ${y.nackCount} ${y.pliCount} ${y.rtt} ${y.googFirsReceived} ${y.codecImplementationName} ${y.trackState}`).join(`
  921. `),t.receivers.length&&this._send(m+`\r${this._userRole}`)}sendR1(){const t=`R1 5.3.1 ${this._context.getCoreVersion()} web ${navigator.platform} -1 ${lr.browser} ${lr.version} ${this._getClientID()} ${this._userRole}`;this._send(t)}sendR2(t,n,r){const i=`R2 ${t} ${n} ${this._getClientID()}\r${r.join(" ")}\r${this._userRole}`;this._send(i)}}(function(e){e.PUBLISH="publish",e.SUBSCRIBE="subscribe"})(Ti||(Ti={})),function(e){e.BEGIN="begin",e.END="end"}(Si||(Si={}));class rS{constructor(t){this._room=t,this._audioLevelChangeHandler=null,this._timer=null,this._pc=this._room.__getPC()}_audioLevelReport(){return ie(this,void 0,void 0,function*(){if(this._pc.getRTCPeerConn().iceConnectionState==="new"||!this._audioLevelChangeHandler)return;const t=(yield this._pc.getAudioLevelReportData()).map(n=>{const{userId:r}=WB.parseTrackId(n.trackId);return{track:this._room.getCrtUserId()===r?this._room.getLocalTrack(n.trackId):this._room.getRemoteTrack(n.trackId),audioLevel:n.audioLevel||0}}).filter(n=>n.track);this._audioLevelChangeHandler(t)})}onAudioLevelChange(t,n){n<300||n>1e3?F.error('the valid range of onAudioLevelChange params "gap" is: > 300 && < 1000'):t?(this._audioLevelChangeHandler=t,this._timer=setInterval(this._audioLevelReport.bind(this),n)):this._audioLevelChangeHandler=null}clearAudioLevelReportTimer(){this._timer&&(clearInterval(this._timer),this._timer=null)}}(function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"})(Ku||(Ku={}));const Gs=e=>e instanceof _g?e.getTrackId():e.track.getTrackId();class iS{constructor(t,n,r,i,o,s,a,u,d,f){this._context=t,this._runtime=n,this._roomId=r,this._roomMode=o,this._service=s,this._initOptions=a,this._ntfClearRoomItem=u,this._isMainRoom=f,this._remoteTracks={},this._subscribedList=[],this._destroyed=!1,this.msgTaskQueue=new mT,this._appListener=null,this._onRecvPKMsg=null,this._token=i.token,this._sessionId=i.sessionId,this._roomResources=d?{}:ch(i),this._initRemoteTracks();const c=this._context.getCurrentId(),l=this._roomResources[c]=this._roomResources[c]||[];F.debug(`room data -> ${JSON.stringify(this._roomResources)}`),l.length>0&&Lt(()=>this._unpublishPrev(l)),d&&this._afterChangedRole(i),this._pinger=new $B(r,this._roomMode,t,this._initOptions.pingGap),this._pinger.onFailed=this._kickoff.bind(this),this._pinger.onPingResult=this._handlePingResult.bind(this),this._pinger.start(),this._polarisReport=new nS(this._context,this._runtime,this._roomId,this),this._polarisReport.sendR1(),this._pc=new Zr(this._reTryExchange.bind(this),this._polarisReport),this._pc.on(Zr.__INNER_EVENT_TRACK_READY__,this._onTrackReady,this),this._pc.on(ht.__INNER_EVENT_MUTED_CHANGE__,this._onLocalTrackMuted,this),this._pc.on(ht.__INNER_EVENT_DESTROY__,this._onLocalTrackDestroied,this)}_initRemoteTracks(){const t=this._context.getCurrentId();for(const n in this._roomResources){const r=this._roomResources[n];n!==t&&r.length!==0&&r.forEach(i=>{const o=dt(i),{tag:s,userId:a,mediaType:u}=vn(o),d=u===_t.AUDIO_ONLY?new _i(s,a):new Ei(s,a);d.__innerSetRemoteMuted(i.state===0),this._remoteTracks[o]=d})}}_handlePingResult(t){this._callAppListener("onPing",t)}setBitrate(t,n,r){F.warn("`RCAbstractRoom.setBitrate` will be deprecated, use `RCLocalTrack.setBitrate` instead."),Zt("max",t,i=>Pt(i)&&i>Math.max(n||1,200),!0),Zt("min",n,i=>Pt(i)&&i>=1&&(!Pt(t)||i<t),!0),Zt("start",r,i=>Pt(i)&&i>n&&i<=t),this._pc.setBitrate(t,n,r)}_onTrackReady(t){const n=t.streams[0].id,r=t.receiver.track,i=[n,r.kind==="audio"?_t.AUDIO_ONLY:_t.VIDEO_ONLY].join("_"),o=this._remoteTracks[i];o?(o.__innerSetMediaStreamTrack(r),this._callAppListener("onTrackReady",o)):F.warn(`cannot found remote track ${r.id}`)}_callAppListener(t,...n){var r;const i=(r=this._appListener)===null||r===void 0?void 0:r[t];if(i)try{i(...n)}catch(o){F.error(o)}}_onUserUnpublish(t){return ie(this,void 0,void 0,function*(){yield this.unsubscribe(t),t.forEach(n=>{n.__innerDestroy(),delete this._remoteTracks[n.getTrackId()]}),this._onTrackUnpublish(t)})}_onTrackUnpublish(t){this._callAppListener("onTrackUnpublish",t)}_unpublishPrev(t){return ie(this,void 0,void 0,function*(){const n=t.slice();t.length=0,F.info(`unpublish uris prev login: ${JSON.stringify(n)}`);const r=yield this._context.setRTCTotalRes(this._roomId,qc(nt.UNPUBLISH,n),Hi([]),nt.TOTAL_CONTENT_RESOURCE,Hi([]));r!==D.SUCCESS?F.error(`unpublish prev uris failed -> code: ${r}`):F.debug("unpublish uris prev login succeed")})}__parseInnerMessage(t){const{targetId:n,conversationType:r}=t;if(r!==$e.RTC_ROOM)return!1;if(n!==this._roomId)return!0;F.info(`recv inner msg -> message: ${JSON.stringify(t)} | roomid: ${this._roomId}`);const i=t.content;switch(t.messageType){case nt.KICK:this._kickoff(!0,i);break;case nt.STATE:this.msgTaskQueue.push(()=>this._stateHandle(i));break;case nt.MODIFY:case nt.PUBLISH:case nt.UNPUBLISH:case nt.TOTAL_CONTENT_RESOURCE:this.msgTaskQueue.push(()=>this._resourceHandle(i,t.messageType,t.senderUserId));break;case nt.ROOM_NOTIFY:this._callAppListener("onRoomAttributeChange",t.messageType,t.content);break;case nt.USER_NOTIFY:F.warn(`TODO: ${nt.USER_NOTIFY}`);break;case nt.PK_INVITE:case nt.PK_CANCEL_INVITE:case nt.PK_INVITE_TIMEOUT:case nt.PK_INVITE_ANSWER:case nt.PK_END:this._onRecvPKMsg&&this._onRecvPKMsg(t);break;case nt.OTHER_ROOM_OFFLINE:break;default:this._callAppListener("onMessageReceive",t.messageType,t.content,t.senderUserId,t.messageUId)}return!0}_kickoff(t,n){let r;F.warn(`onKickOff -> byServer: ${t}`),this._ntfClearRoomItem(),this._leaveHandle(!t),t&&((n==null?void 0:n.users)||[]).forEach(i=>{i.userId===this._context.getCurrentId()&&(r=i.type)}),this._callAppListener("onKickOff",t,r)}_rtcpeerClosed(){this._ntfClearRoomItem(),this._leaveHandle(!0),this._callAppListener("onRTCPeerConnectionCloseByException")}_resourceHandle(t,n,r){return ie(this,void 0,void 0,function*(){if(this._assertRoomDestroyed())return void F.warn(`room has been destroyed. -> roomId: ${this._roomId}`);const{uris:i,ignore:o}=t;if(o||!i)return;const s=[],a=[],u=[];let d;const f=this._roomResources[r]||(this._roomResources[r]=[]);switch(n){case nt.MODIFY:u.push(...i);break;case nt.PUBLISH:s.push(...i);break;case nt.UNPUBLISH:a.push(...i);break;case nt.TOTAL_CONTENT_RESOURCE:d=iu(f,i),s.push(...d.publishedList),a.push(...d.unpublishedList),u.push(...d.modifiedList)}if(s.length>0){const c=f.map(dt),l=[],h=[];if(s.forEach(p=>{const m=dt(p),v=c.indexOf(m),{userId:_,tag:y,mediaType:E}=vn(m);v>-1?f[v]=p:f.push(p);let S=this._remoteTracks[m];S?S.isSubscribed()&&l.push(S):(S=E===_t.AUDIO_ONLY?new _i(y,_):new Ei(y,_),this._remoteTracks[m]=S,h.push(S)),S.__innerSetRemoteMuted(p.state===0)}),l.length){const p=l.map(v=>v.getTrackId());F.debug(`resub tracks -> ${JSON.stringify(p)}`);const{code:m}=yield Lt(()=>this.__subscribe(l,!0));m!==B.SUCCESS&&F.error(`resub tracks failed -> code: ${m}, ids: ${JSON.stringify(p)}`)}this._onTrackPublish(h)}if(a.length>0){const c=a.map(dt);for(let h=f.length-1;h>=0;h-=1){const p=f[h];c.includes(dt(p))&&f.splice(h,1)}const l=a.map(h=>{const p=dt(h);return this._remoteTracks[p]});yield this._onUserUnpublish(l)}if(u.length>0){const c=f.map(dt);for(let l=0;l<u.length;l+=1){const h=u[l],p=dt(h),m=c.indexOf(p);f[m].state=h.state;const v=this._remoteTracks[p];v.__innerSetRemoteMuted(h.state===0),v.isAudioTrack()?this._onAudioMuteChange(v):this._onVideoMuteChange(v)}}})}_onTrackPublish(t){this._callAppListener("onTrackPublish",t)}_stateHandle(t){var n;return ie(this,void 0,void 0,function*(){const{users:r}=t;if(r.length===0)return;const i=[],o=[],s=[],a=[];r.forEach(f=>{+f.state==0?(F.debug(`user joined -> ${f.userId}`),this._roomResources[f.userId]||(f.switchRoleType?s.push(f.userId):i.push(f.userId)),this._roomResources[f.userId]=this._roomResources[f.userId]||[]):(F.debug(`user left -> ${f.userId}`),f.switchRoleType?a.push(f.userId):o.push(f.userId))});const u=[...i,...s],d=[...o,...a];if(d.length){const f=[],c=[];d.forEach(l=>{f.push(...this.getRemoteTracksByUserId(l)),c.push(l)}),f.length&&(yield this.unsubscribe(f),f.forEach(l=>delete this._remoteTracks[l.getTrackId()])),c.length&&c.forEach(l=>delete this._roomResources[l])}if((n=this._appListener)===null||n===void 0?void 0:n.onSwitchRole)return s.length&&s.forEach(f=>this._callAppListener("onSwitchRole",f,Ku.ANCHOR)),a.length&&a.forEach(f=>this._callAppListener("onSwitchRole",f,Ku.AUDIENCE)),i.length&&this._callAppListener("onUserJoin",i),void(o.length&&this._callAppListener("onUserLeave",o));u.length&&this._callAppListener("onUserJoin",u),d.length&&this._callAppListener("onUserLeave",d)})}getRoomId(){return this._roomId}getCrtUserId(){return this._context.getCurrentId()}__getPC(){return this._pc}getRemoteUserIds(){const t=this._context.getCurrentId();return Object.keys(this._roomResources).filter(n=>n!==t)}getRemoteTracks(){const t=[];return this.getRemoteUserIds().forEach(n=>{t.push(...this.getRemoteTracksByUserId(n))}),t}getRemoteTracksByUserId(t){const n=[];for(const r in this._remoteTracks){const i=this._remoteTracks[r];i.getUserId()===t&&n.push(i)}return n}getSessionId(){return this._sessionId}sendMessage(t,n){return ie(this,void 0,void 0,function*(){const{code:r}=yield this._context.sendMessage($e.RTC_ROOM,this._roomId,{messageType:t,content:n,isStatusMessage:!0});return r!==D.SUCCESS?(F.error(`send message failed -> code: ${r}`),{code:B.SIGNAL_ERROR}):{code:B.SUCCESS}})}setRoomAttribute(t,n,r,i=!1){return ie(this,void 0,void 0,function*(){const o=yield this._context.setRTCData(this._roomId,t,n,i,jr.ROOM,r);return o!==D.SUCCESS?(F.error(`SetRoomAttributeValue Failed: ${o}`),{code:B.SIGNAL_ERROR}):{code:B.SUCCESS}})}deleteRoomAttributes(t,n,r=!1){return ie(this,void 0,void 0,function*(){const i=yield this._context.removeRTCData(this._roomId,t,r,jr.ROOM,n);return i!==D.SUCCESS?(F.error(`DeleteRoomAttribute Failed: ${i}`),{code:B.SIGNAL_ERROR}):{code:B.SUCCESS}})}getRoomAttributes(t=[],n=!1){return ie(this,void 0,void 0,function*(){const{code:r,data:i}=yield this._context.getRTCData(this._roomId,t,n,jr.ROOM);return r!==D.SUCCESS?(F.error(`GetRoomAttributes Failed: ${r}`),{code:B.SIGNAL_ERROR}):{code:B.SUCCESS,data:i}})}_setUserAttributeValue(t,n,r){return this._context.setRTCData(this._roomId,t,n,!1,jr.PERSON,r)}_deleteUserAttributes(t,n){return this._context.removeRTCData(this._roomId,t,!1,jr.PERSON,n)}_getUserAttributes(t){return this._context.getRTCData(this._roomId,t,!1,jr.PERSON)}isDestroyed(){return this._destroyed}__destroy(t){return this._leaveHandle(t)}_leaveHandle(t){var n;return ie(this,void 0,void 0,function*(){this._destroyed||(this._destroyed=!0,(n=this._audioLevelReport)===null||n===void 0||n.clearAudioLevelReportTimer(),t&&(yield this._context.quitRTCRoom(this._roomId)),this._isMainRoom&&this._quitAllPKRoom(),this._pc.removeAllLocalTrack(),this._pinger.stop(),this._isMainRoom&&(yield this._service.exit(this._getRTCReqestHeaders())),this._pc.destroy(),this._polarisReport=null,this._removeRemoteTracks())})}_onLocalTrackDestroied(t){t instanceof hs&&t.__isTiny()||this.unpublish([t])}_onLocalTrackMuted(t){return ie(this,void 0,void 0,function*(){const n=t.getTrackId(),r=this._context.getCurrentId(),i=[{resourceId:n,enabled:!t.isLocalMuted()}],o=this._roomResources[r]||[],s=[];for(let u=0;u<o.length;u+=1){const d=o[u],f=dt(d),c=i.findIndex(l=>l.resourceId===f);if(c>=0){const{enabled:l}=i[c];d.state=l?1:0,s.push(d);break}}const a=yield Lt(()=>this._context.setRTCTotalRes(this._roomId,qc(nt.MODIFY,s),Hi(o),nt.TOTAL_CONTENT_RESOURCE));a!==D.SUCCESS&&F.error("notice `track.enabled` change failed -> code: "+a)})}_removePubFailedTracks(t){t.forEach(n=>{const r=n instanceof ht?n:n.track;F.debug(`remove pub failed track from peerconnection -> trackId: ${r.getTrackId()}`),this._pc.removeLocalTrackById(r.getTrackId())})}publish(t){return ie(this,void 0,void 0,function*(){return Lt(()=>this.__publish(t))})}__publish(t){return ie(this,void 0,void 0,function*(){if(!this._isMainRoom&&this instanceof Ri)return F.error("the `publish` is disabled in PK room "),{code:B.THE_FUNCTION_IS_DISABLED_IN_PKROOM};if(this._assertRoomDestroyed())return F.error(`publish failed, room has been destroyed. -> roomId: ${this._roomId}`),{code:B.ROOM_HAS_BEEN_DESTROYED};if(!bt("tracks",t,()=>In(t)&&t.length>0&&t.every(E=>E instanceof ht||E.track instanceof ht),!0))return F.error(`publish failed, tracks is invalid -> roomId: ${this._roomId}`),{code:B.PARAMS_ERROR};const n=this._context.getCurrentId();if(this._pc.getLocalTracks().length+(E=>{let S=0;return E.forEach(T=>{T instanceof ht?S++:T.pubTiny&&T.track.isVideoTrack()?S+=2:S++}),S})(t)>10)return F.error(`publish failed, tracks limit exceeded -> roomId: ${this._roomId}`),{code:B.PUBLISH_TRACK_LIMIT_EXCEEDED};F.debug(`publish tracks -> roomId: ${this._roomId}, tracks: ${t.map(Gs)}`),t.forEach(E=>{const{track:S,pubTiny:T}=E instanceof ht?{pubTiny:!1,track:E}:E;if(this._pc.addLocalTrack(S),S.isVideoTrack()&&T){let R;try{R=S.__innerGetMediaStreamTrack().clone();const C=T.frameRate||Oi.FPS_15,w=T.resolution||At.W176_H144,{width:L,height:V}=zr(w),b=Yr(C);R.applyConstraints({width:L,height:V,frameRate:b})}catch(C){return R==null||R.stop(),void F.warn(`pubTiny failed -> id: ${S.getTrackId()}, msg: ${C.message}`)}this._pc.addLocalTrack(new hs(S.getTag(),S.getUserId(),R,!0))}}),this._pc.clearReTryExchangeTimer();const r=yield this._createExchangeParams(this._subscribedList,!1),i=this._getPushOtherRoomsParams();i&&(r.pushOtherRooms=i);const o=yield this._exchangeHandle(r);if(o.code!==B.SUCCESS)return F.error(`publish failed -> roomId: ${this._roomId}, code: ${o.code}`),this._removePubFailedTracks(t),{code:o.code};const{publishList:s,sdp:a,resultCode:u,message:d,urls:f,mcuPublishList:c}=o.data;if(u!==B.SUCCESS)return F.error(`publish failed -> roomId: ${this._roomId}, code: ${u}, msg: ${d}`),this._removePubFailedTracks(t),{code:u};const l=yield this._pc.setRemoteAnswer(a.sdp);if(l!==B.SUCCESS)return{code:l};const h=this._roomResources[n],p=s.map(E=>Object.assign({tag:E.msid.split("_").pop(),state:this._getResourceState(dt(E))},E)),{publishedList:m}=iu(h,p),v=(c==null?void 0:c.map(E=>Object.assign({tag:E.msid.split("_").pop(),state:1},E)))||[],_=yield this._context.setRTCTotalRes(this._roomId,qc(nt.PUBLISH,m),Hi(p),nt.TOTAL_CONTENT_RESOURCE,Hi(v));if(_!==D.SUCCESS)return F.error(`send publish streams notification failed: ${_}`),{code:B.SIGNAL_ERROR};this._roomResources[n]=p;const y=m.map(E=>dt(E));return this._polarisReport&&this._polarisReport.sendR2(Ti.PUBLISH,Si.BEGIN,y),t.forEach(E=>{const{track:S}=E instanceof ht?{track:E}:E;S.__innerSetPublished(!0)}),F.debug(`publish success: ${y.join(",")}`),this._roomMode===yn.LIVE?{code:B.SUCCESS,liveUrl:f==null?void 0:f.liveUrl}:{code:B.SUCCESS}})}_getPushOtherRoomsParams(){if(this instanceof Ri){const{code:t,roomPKHandler:n}=this.getRoomPKHandler(),r=[];if(t===B.SUCCESS&&n){const i=n.getJoinedPKRooms();for(const o in i){const s=i[o].getSessionId(),a=n.getPKInfo(o);if(!a)return;const{inviterUserAutoMix:u,inviteeUserAutoMix:d,inviterUserId:f}=a,c=this._context.getCurrentId()===f;r.push({roomId:o,sessionId:s,autoMix:c?!!u:!!d})}}return r}}_reTryExchange(){return ie(this,void 0,void 0,function*(){Lt(()=>ie(this,void 0,void 0,function*(){const t=yield this._createExchangeParams(this._subscribedList,!0),n=this._getPushOtherRoomsParams();n&&(t.pushOtherRooms=n);const r=yield this._exchangeHandle(t);if(r.code!==B.SUCCESS)return F.error(`reTryExchange failed: ${r.code}`),{code:r.code};const{sdp:i,resultCode:o}=r.data;if(o!==B.SUCCESS)return F.error(`reTryExchange failed: ${o}`),{code:o};this._pc.clearReTryExchangeTimer();const s=yield this._pc.setRemoteAnswer(i.sdp);return s!==B.SUCCESS?{code:s}:void 0}))})}_exchangeHandle(t){return this._service.exchange(this._getRTCReqestHeaders(),t)}_getRTCReqestHeaders(){return{"App-Key":this._context.getAppkey(),RoomId:this._roomId,Token:this._token,RoomType:this._roomMode,UserId:this._context.getCurrentId()}}_createExchangeParams(t,n){return ie(this,void 0,void 0,function*(){return{sdp:yield this._pc.createOffer(n),extend:JSON.stringify({resolutionInfo:this._pc.getOutboundVideoInfo()}),subscribeList:t.filter(r=>{const i=r.track.getTrackId(),{userId:o}=vn(i);return this._roomResources[o]?this._roomResources[o].filter(a=>i===`${a.msid}_${a.mediaType}`).length:!1}).map(r=>({simulcast:r.subTiny?Zn.TINY:Zn.NORMAL,resolution:"",uri:this._getResourceById(r.track.getTrackId()).uri})),switchstream:!1}})}_getResourceState(t){var n;return((n=this.getLocalTrack(t))===null||n===void 0?void 0:n.isLocalMuted())?0:1}unpublish(t){return ie(this,void 0,void 0,function*(){return Lt(()=>this.__unpublish(t))})}__unpublish(t){var n;return ie(this,void 0,void 0,function*(){if(!this._isMainRoom&&this instanceof Ri)return F.error("the `unpublish` is disabled in PK room "),{code:B.THE_FUNCTION_IS_DISABLED_IN_PKROOM};if(this._assertRoomDestroyed())return F.warn(`room has been destroyed, no need to unpublish tracks -> roomId: ${this._roomId}`),{code:B.SUCCESS};const r=this._context.getCurrentId();if(!bt("tracks",t,()=>t.every(E=>E.getUserId()===r&&E instanceof ht),!0))return F.warn(`unpublish failed, tracks is invalid -> roomId: ${this._roomId}, tracks: ${t.map(Gs)}`),{code:B.PARAMS_ERROR};const i=t.map(E=>E.getTrackId()),o=i.map(this._getResourceById.bind(this)).filter(E=>!!E);if(o.length===0)return{code:B.SUCCESS};const s=this._roomResources[r].filter(E=>!o.includes(E));i.forEach(E=>this._pc.removeLocalTrackById(E)),(n=this._polarisReport)===null||n===void 0||n.sendR2(Ti.PUBLISH,Si.END,i),this._pc.clearReTryExchangeTimer();const a=yield this._createExchangeParams(this._subscribedList,!1),u=this._getPushOtherRoomsParams();u&&(a.pushOtherRooms=u);const d=yield this._exchangeHandle(a);if(d.code!==B.SUCCESS)return F.error(`exchange failed -> code: ${d.code}`),{code:d.code};const{publishList:f,sdp:c,resultCode:l,message:h,mcuPublishList:p}=d.data;l!==B.SUCCESS&&F.error(`unpublish streams failed -> code: ${l}, msg: ${h}`);const m=p?p.map(E=>Object.assign({tag:E.msid.split("_").pop(),state:1},E)):[],v=yield this._context.setRTCTotalRes(this._roomId,qc(nt.UNPUBLISH,o),Hi(s),nt.TOTAL_CONTENT_RESOURCE,Hi(m));if(v!==D.SUCCESS)return F.error("send unpublish notification failed:",v),{code:B.SIGNAL_ERROR};F.debug(`unpublish success -> tracks: ${i.join(",")}`);const _=yield this._pc.setRemoteAnswer(c.sdp);if(_!==B.SUCCESS)return{code:_};const y=f.map(E=>Object.assign({tag:E.msid.split("_").pop(),state:this._getResourceState(dt(E))},E));return this._roomResources[r]=y,{code:B.SUCCESS}})}_getResourceById(t){const{userId:n}=vn(t);return this._roomResources[n].find(r=>dt(r)===t)}_isValidResourceId(t){var n;const{userId:r}=vn(t);return!!((n=this._roomResources[r])===null||n===void 0?void 0:n.find(i=>dt(i)===t))}subscribe(t){return ie(this,void 0,void 0,function*(){return Lt(()=>this.__subscribe(t,!1))})}__subscribe(t,n=!1){var r;return ie(this,void 0,void 0,function*(){if(this._assertRoomDestroyed())return F.error(`subscribe failed, room has been destroyed -> roomId: ${this._roomId}`),{code:B.ROOM_HAS_BEEN_DESTROYED};if(!bt("tracks",t,()=>In(t)&&t.length>0&&t.every(u=>u instanceof rn||u.track instanceof rn),!0))return F.error(`subscribe failed, tracks is invalid -> roomId: ${this._roomId}`),{code:B.PARAMS_ERROR};F.info(`subscribe -> roomId: ${this._roomId}, tracks: ${t.map(Gs)}`);const i=this._subscribedList.map(u=>Object.assign({},u)),o=t.map(u=>u instanceof rn?{track:u}:u);let s=!1;const a=[];return o.forEach(u=>{const d=u.track.getTrackId();a.push(d);const f=i.find(c=>c.track.getTrackId()===d);f&&f.subTiny===u.subTiny||(f?f.subTiny=u.subTiny:i.push(u),s=!0)}),s||n?((r=this._polarisReport)===null||r===void 0||r.sendR2(Ti.SUBSCRIBE,Si.BEGIN,a),this._updateSubListHandle(i,!0)):{code:B.SUCCESS}})}unsubscribe(t){return ie(this,void 0,void 0,function*(){return Lt(()=>this.__unsubscribe(t))})}__unsubscribe(t){var n;return ie(this,void 0,void 0,function*(){if(this._assertRoomDestroyed())return F.warn(`room has beed destroyed, no need to unsubscribe tracks -> roomId: ${this._roomId}`),{code:B.SUCCESS};if(!bt("tracks",t,()=>In(t)&&t.length>0&&t.every(i=>i instanceof rn),!0))return F.error(`unsubscribe failed, tracks is invalid -> roomId: ${this._roomId}`),{code:B.PARAMS_ERROR};F.info(`unsubscribe -> roomId: ${this._roomId}, tracks: ${t.map(Gs)}`);const r=this._subscribedList.map(i=>Object.assign({},i)).filter(i=>!t.includes(i.track));return(n=this._polarisReport)===null||n===void 0||n.sendR2(Ti.SUBSCRIBE,Si.END,t.map(i=>i.getTrackId())),this._updateSubListHandle(r,!1)})}_assertRoomDestroyed(){if(this._destroyed){const t="This room has been destroyed. Please use `RCRTCClient.joinRTCRoom` or `RCRTCClient.joinLivingRoom` to catch another instance.";return F.warn(t),B.ROOM_HAS_BEEN_DESTROYED}}getLocalTrack(t){return this._pc.getLocalTrack(t)}getLocalTracks(){return this._pc.getLocalTracks()}getRemoteTrack(t){return this._remoteTracks[t]||null}updateSubList(t){return ie(this,void 0,void 0,function*(){return Lt(()=>this._updateSubListHandle(t,!1))})}_updateSubListHandle(t,n=!1){return ie(this,void 0,void 0,function*(){if(this._assertRoomDestroyed())return{code:B.ROOM_HAS_BEEN_DESTROYED};if(!bt("resources",t,()=>In(t)&&t.every(y=>y instanceof rn||y.track instanceof rn),!0))return F.error(`update sublist failed, tracks is invalid -> roomId: ${this._roomId}`),{code:B.PARAMS_ERROR};F.info(`update subscribe list -> roomId: ${this._roomId}, forceReq: ${n}, tracks: ${t.map(Gs)}`);let r=t.map(y=>y instanceof rn?{track:y}:Object.assign({},y));const i={};r=r.filter(y=>{const E=y.track.getTrackId();return this._remoteTracks[E]?!i[E]&&(i[E]=!0):(F.warn(`track cannot found in room -> trackId: ${E}`),!1)}).map(y=>Object.assign({},y));const o=this._subscribedList.map(y=>Object.assign({},y));if(!n){let y=!1;if(r.forEach(E=>{const S=o.findIndex(T=>T.track===E.track);if(S===-1)return void(y=!0);o.splice(S,1)[0].subTiny!==E.subTiny&&(y=!0)}),o.length&&(y=!0),!y)return{code:B.SUCCESS}}this._pc.clearReTryExchangeTimer(),this._pc.updateSubRemoteTracks(r.map(y=>y.track));const s=yield this._createExchangeParams(r,!1),a=this._getPushOtherRoomsParams();a&&(s.pushOtherRooms=a);const u=yield this._exchangeHandle(s),d=r.map(y=>y.track.getTrackId());if(u.code!==B.SUCCESS)return{code:u.code};const{sdp:f,resultCode:c,message:l,subscribedList:h}=u.data;if(c!==B.SUCCESS)return F.error(`change subscribe list failed: ${c}`),{code:c};F.debug(`subscribe success: ${d.join(",")}`);const p=yield this._pc.setRemoteAnswer(f.sdp);if(p!==B.SUCCESS)return{code:p};const m=h==null?void 0:h.map(y=>`${y.msid}_${y.mediaType}`),v=r.filter(y=>m==null?void 0:m.includes(y.track.getTrackId())),_=r.filter(y=>!(m==null?void 0:m.includes(y.track.getTrackId())));for(const y in this._remoteTracks){const E=v.some(S=>S.track.getTrackId()===y);this._remoteTracks[y].__innerSetSubscribed(E)}return this._subscribedList.splice(0,this._subscribedList.length,...v),_.length?{code:B.SUCCESS,failedList:_}:{code:B.SUCCESS}})}registerRoomEventListener(t){this._appListener=t}registerReportListener(t){this._pc.registerReportListener(t)}onAudioLevelChange(t,n){var r;(r=this._audioLevelReport)===null||r===void 0||r.clearAudioLevelReportTimer(),this._audioLevelReport=new rS(this),this._audioLevelReport.onAudioLevelChange(t,n||1e3)}__onReconnected(t){return ie(this,void 0,void 0,function*(){if(this._pc.getRTCPeerConn().connectionState==="closed")return F.warn("RTCPeerConnection closed. Please rejoin room to restore services."),void this._rtcpeerClosed();const{code:n,data:r}=yield this._context.joinRTCRoom(this._roomId,this._roomMode,t);if(n!==D.SUCCESS)return void F.error(`RTC __onReconnected getRTCRoomInfo failed: ${n}`);F.debug(`RTC __onReconnected getRTCRoomInfo success: ${JSON.stringify(r)}`);const i=[],o={},s={},a={},u=ch(r),d=Object.keys(u),f=Object.keys(this._roomResources);for(let c=d.length-1;c>=0;c-=1){const l=d[c],h=f.indexOf(l);if(h===-1){i.push(l),o[l]=Kc(u[l]);continue}const p=this._roomResources[l],m=u[l],{publishedList:v,modifiedList:_,unpublishedList:y}=iu(p,m,!0);o[l]=Kc(v),s[l]=Kc(y),a[l]=Kc(_),f.splice(h,1)}f.length&&f.forEach(c=>{delete this._roomResources[c]}),Object.assign(this._roomResources,u),f.length&&this._callAppListener("onUserLeave",f),i.length&&this._callAppListener("onUserJoin",i);for(const c in s){const l=s[c];if(l.length){const h=l.map(p=>this._remoteTracks[dt(p)]);yield this._onUserUnpublish(h)}}return Object.keys(o).forEach(c=>{const l=o[c];if(l.length===0)return;const h=l.map(p=>{const m=dt(p),{userId:v,tag:_,mediaType:y}=vn(m),E=this._remoteTracks[m]=y===_t.AUDIO_ONLY?new _i(_,v):new Ei(_,v);return E.__innerSetRemoteMuted(p.state===0),E});this._onTrackPublish(h)}),Object.keys(a).forEach(c=>{a[c].forEach(l=>{const h=dt(l),p=this._remoteTracks[h];p.__innerSetRemoteMuted(l.state===0),p.isAudioTrack()?this._onAudioMuteChange(p):this._onVideoMuteChange(p)})}),{data:r}})}_onAudioMuteChange(t){this._callAppListener("onAudioMuteChange",t)}_onVideoMuteChange(t){this._callAppListener("onVideoMuteChange",t)}_afterChangedRole(t){}_removeRemoteTracks(){const t=Object.values(this._remoteTracks);t.length&&(t.forEach(n=>{n.isAudioTrack()&&n.__releaseMediaElement()}),this._remoteTracks={})}_registerPKMsgListener(t){this._onRecvPKMsg=t}_quitAllPKRoom(){}}var va,Zo,Gu;(function(e){e[e.CROP=1]="CROP",e[e.WHOLE=2]="WHOLE"})(va||(va={})),function(e){e[e.CUSTOMIZE=1]="CUSTOMIZE",e[e.SUSPENSION=2]="SUSPENSION",e[e.ADAPTATION=3]="ADAPTATION"}(Zo||(Zo={})),function(e){e[e.CROP=1]="CROP",e[e.WHOLE=2]="WHOLE"}(Gu||(Gu={}));const c_=()=>({version:1,mode:Zo.SUSPENSION});class HB{constructor(t,n,r){this._onFlush=t,this._isValidTrackId=n,this._sendCDNInfoSignal=r,this._values=c_()}setHostVideoTrack(t){if(!this._isValidTrackId(t))return F.error(`setHostVideoTrack failed: videoTrackId is invalid -> ${t}`),this;const{mediaType:n,tag:r,userId:i}=vn(t);return n!==_t.VIDEO_ONLY?(F.error(`setHostVideoTrack failed: kind of resource is not 'video' -> ${t}`),this):(this._values.host_stream_id=Md(i,r),this)}setMixLayoutMode(t){return[Zo.CUSTOMIZE,Zo.SUSPENSION,Zo.ADAPTATION].includes(t)?(this._values.mode=t,this):(F.error(`layout mode is invalid: ${t}`),this)}_addOutputValue(t,n,r="normal"){const i=this._values.output||(this._values.output={video:{normal:{width:640,height:480}}});if(t==="cdn")return void(i.cdn=n);if(t==="audio")return void(i.audio={bitrate:n});const o=i.video;if(r!=="normal"&&r!=="tiny")if(r!=="backgroundColor")if(r!=="exparams"){if(r==="backgroundPicture"){const s=o.backgroundPicture||(o.backgroundPicture={fillMode:va.CROP,picture:[]});Object.assign(s,n)}}else o.exparams={renderMode:n};else o.backgroundColor=n;else{const s=o[r]||(o[r]={});Object.assign(s,n)}}setOutputVideoResolution(t){if(!Xo(t))return F.warn("setOutputVideoResolution failed: `resolution` is invalid"),this;const{width:n,height:r}=zr(t);return this._addOutputValue("video",{width:n,height:r},"normal"),this}setOutputVideoFPS(t){if(!sh(t))return F.warn("setOutputVideoFPS failed: `fps` is invalid"),this;const n=Yr(t);return this._addOutputValue("video",{fps:n},"normal"),this}setOutputVideoBitrate(t){return!Pt(t)||t<=0?F.error(`bitrate is invalid: ${t}`):this._addOutputValue("video",{bitrate:t},"normal"),this}setOutputTinyVideoResolution(t){if(!Xo(t))return F.warn("setOutputTinyVideoResolution failed: `resolution` is invalid"),this;const{width:n,height:r}=zr(t);return this._addOutputValue("video",{width:n,height:r},"tiny"),this}setOutputTinyVideoFPS(t){if(!sh(t))return F.warn("setOutputTinyVideoFPS failed: `fps` is invalid"),this;const n=Yr(t);return this._addOutputValue("video",{fps:n},"tiny"),this}setOutputTinyVideoBitrate(t){return!Pt(t)||t<=0?F.error(`bitrate is invalid: ${t}`):this._addOutputValue("video",{bitrate:t},"tiny"),this}setOutputVideoRenderMode(t){return[Gu.CROP,Gu.WHOLE].includes(t)?this._addOutputValue("video",t,"exparams"):F.error(`renderMode is invalid: ${t}`),this}setOutputAudioBitrate(t){return Pt(t)&&t>0?this._addOutputValue("audio",t):F.error(`bitrate is invalid: ${t}`),this}setOutputBackgroundColor(t){return/^0x[a-fA-F0-9]{6}$/.test(t)?this._addOutputValue("video",t,"backgroundColor"):F.error(`color is invalid: ${t}`),this}addOutputBackgroundPicture(t,n,r,i,o){var s,a,u;if(!Ua(t))return F.error(`uri is invalid: ${t}`),this;if([n,r,i,o].some(f=>!Pt(f)||f<0||f>1))return F.error(`some attrs of (x, y, w, h) is invalid: ${n}, ${r}, ${i}, ${o}`),this;const d=((u=(a=(s=this._values.output)===null||s===void 0?void 0:s.video)===null||a===void 0?void 0:a.backgroundPicture)===null||u===void 0?void 0:u.picture)||[];return d.push({uri:t,w:i,h:o,x:n,y:r}),this._addOutputValue("video",{picture:d},"backgroundPicture"),this}removeOutputBackgroundPicture(t){var n,r,i;if(!Ua(t))return F.error(`uri is invalid: ${t}`),this;let o=(i=(r=(n=this._values.output)===null||n===void 0?void 0:n.video)===null||r===void 0?void 0:r.backgroundPicture)===null||i===void 0?void 0:i.picture;return o&&(o=o.filter(s=>s.uri!==t),this._addOutputValue("video",{pictures:o},"backgroundPicture")),this}clearOutputBackgroundPicture(){return this._addOutputValue("video",{pictures:[]},"backgroundPicture"),this}setOutputBackgroundPictureFillMode(t){return[va.CROP,va.WHOLE].includes(t)?this._addOutputValue("video",{fillMode:t},"backgroundPicture"):F.error(`fillMode is invalid: ${t}`),this}addPublishStreamUrls(t){var n,r;const i=/^rtmp:\/\/.+/;if(!In(t)||t.length===0||t.some(a=>!i.test(a)))return F.error(`urls is invalid: ${t}`),this;const o=((r=(n=this._values.output)===null||n===void 0?void 0:n.cdn)===null||r===void 0?void 0:r.concat())||[];let s=!1;return t.forEach(a=>{o.some(u=>u.pushurl===a)||(s=!0,o.push({pushurl:a}))}),o.length>5?(F.error("publish stream url no more than 5"),this):(s&&this._addOutputValue("cdn",o),this)}removePublishStreamUrls(t){var n,r;const i=/^rtmp:\/\/.+/;if(!In(t)||t.length===0||t.some(s=>!i.test(s)))return F.error(`urls is invalid: ${t}`),this;const o=((r=(n=this._values.output)===null||n===void 0?void 0:n.cdn)===null||r===void 0?void 0:r.concat())||[];for(let s=o.length-1;s>=0;s-=1){const{pushurl:a}=o[s],u=t.indexOf(a);u>=0&&(t.splice(u,1),o.splice(s,1))}return this._addOutputValue("cdn",o),this}clearPublishStreamUrls(){return this._addOutputValue("cdn",[]),this}addCustomizeLayoutVideo(t,n,r,i,o){if(!this._isValidTrackId(t))return F.error(`trackId is invalid: ${t}`),this;if(!Pt(n)||!Pt(r))return F.error(`some attrs of (x, y) is invalid: ${n}, ${r}`),this;if([i,o].some(f=>!Pt(f)||f<0))return F.error(`some attrs of (width, height) is invalid: ${i}, ${o}`),this;const{userId:s,tag:a,mediaType:u}=vn(t);if(u!==_t.VIDEO_ONLY)return F.error(`kind of resource is not 'video': ${t}`),this;const d=Md(s,a);return(this._values.input||(this._values.input={video:[]})).video.push({user_id:s,stream_id:d,x:n,y:r,width:i,height:o}),this}removeCustomizeLayoutVideo(t){if(!this._isValidTrackId(t))return F.error(`trackId is invalid: ${t}`),this;const{userId:n,tag:r,mediaType:i}=vn(t);if(i!==_t.VIDEO_ONLY)return F.error(`kind of resource is not 'video': ${t}`),this;const o=Md(n,r),s=this._values.input||(this._values.input={video:[]});return s.video=s.video.filter(a=>a.stream_id===o),this}clearCustomizeLayoutVideo(){return(this._values.input||(this._values.input={video:[]})).video=[],this}flush(){var t,n,r,i;return ie(this,void 0,void 0,function*(){const o=JSON.parse(JSON.stringify(this._values)),{code:s}=yield this._onFlush(o);return s===B.SUCCESS&&(((n=(t=this._values.output)===null||t===void 0?void 0:t.video.normal)===null||n===void 0?void 0:n.width)||((i=(r=this._values.output)===null||r===void 0?void 0:r.video.normal)===null||i===void 0?void 0:i.fps))&&this._sendCDNInfoSignal(),this._values=c_(),{code:s}})}}var zu,Yu,Wu,Kr;(function(e){e[e.OPEN=1]="OPEN",e[e.STOP=2]="STOP"})(zu||(zu={})),function(e){e[e.SPREAD=0]="SPREAD",e[e.NO_SPREAD=-1]="NO_SPREAD"}(Yu||(Yu={})),function(e){e[e.AUTOMATIC=0]="AUTOMATIC",e[e.MANUAL=1]="MANUAL"}(Wu||(Wu={})),function(e){e[e.VIDEO=0]="VIDEO",e[e.AUDIO=1]="AUDIO"}(Kr||(Kr={}));const oS=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=16*Math.random()|0;return(e==="x"?t:3&t|8).toString(16)});class qB{constructor(t,n,r,i,o,s,a,u){this._context=t,this._runtime=n,this._service=r,this._initOptions=i,this._mainLivingRoom=o,this._registerPKMsgListener=s,this._onJoinedPKRoom=a,this._onLeavePKRoom=u,this._inviteTimeout=30,this._PKInfo={},this._appListener=null,this._joinedPKRooms={},this._registerPKMsgListener(this._onRecvPKMsg.bind(this)),this._mainRoomId=this._mainLivingRoom.getRoomId()}_callAppListener(t,...n){var r;const i=(r=this._appListener)===null||r===void 0?void 0:r[t];if(i)try{i(...n)}catch(o){F.error(o)}}_onInvite(t){const n=t.inviteInfo||{},{inviterRoomId:r,inviterUserId:i,extra:o}=n,s={inviterRoomId:r,inviterUserId:i};o&&Object.assign(s,{extra:o}),this._PKInfo[r]=n,this._callAppListener("onRequestJoinOtherRoom",s)}_onCancelInvite(t){const{inviterRoomId:n,inviterUserId:r,extra:i}=t.inviteInfo||{},o={inviterRoomId:n,inviterUserId:r};i&&Object.assign(o,{extra:i}),delete this._PKInfo[n],this._callAppListener("onCancelRequestOtherRoom",o)}_onInviteTimeout(t){}_onInviteAnswer(t){const{answerCode:n,inviteContent:r,inviteeUserAutoMix:i}=t,{inviterUserId:o,inviterRoomId:s,inviteeUserId:a,inviteeRoomId:u,extra:d}=r,f={agree:n===1,inviterRoomId:s,inviterUserId:o,inviteeRoomId:u,inviteeUserId:a};this._PKInfo[u].inviteeUserAutoMix=i,this._callAppListener("onResponseJoinOtherRoom",f)}_onPKEnd(t){return ie(this,void 0,void 0,function*(){const{inviteeRoomId:n,inviterRoomId:r,userId:i}=t.inviteInfo,o=r===this._mainRoomId?n:r,s={endRoomId:o,endUserId:i};yield this.leaveOtherRoom(this._joinedPKRooms[o]),delete this._PKInfo[o],this._callAppListener("onFinishOtherRoom",s)})}_onRecvPKMsg(t){const{targetId:n,content:r,messageType:i}=t;switch(i){case nt.PK_INVITE:this._onInvite(r);break;case nt.PK_CANCEL_INVITE:this._onCancelInvite(r);break;case nt.PK_INVITE_TIMEOUT:this._onInviteTimeout(r);break;case nt.PK_INVITE_ANSWER:this._onInviteAnswer(r);break;case nt.PK_END:this._onPKEnd(r)}}registerRoomPKEventListener(t){this._appListener=t}requestJoinOtherRoom(t,n,r){return ie(this,void 0,void 0,function*(){if(!bt("inviteeRoomId",t,Mn,!0)||!bt("inviteeUserId",n,Mn,!0))return{code:B.PARAMS_ERROR};F.debug(`requestRoomPK -> inviteeRoomId: ${t}; inviteeUserId: ${n}; options: ${JSON.stringify(r||{})}`);const i=oS(),o=!Nu(r==null?void 0:r.autoMix)||(r==null?void 0:r.autoMix),s={inviteSessionId:i,inviterRoomId:this._mainRoomId,inviterUserId:this._context.getCurrentId(),inviterUserAutoMix:o,inviteeRoomId:t,inviteeUserId:n,inviteeTimeoutTime:this._inviteTimeout,extra:(r==null?void 0:r.extra)||""},a={roomId:this._mainRoomId,invitedRoomId:t,invitedUserId:n,inviteTimeout:this._inviteTimeout,inviteInfo:JSON.stringify(s),inviteSessionId:i};F.debug(`requestRoomPK -> params: ${JSON.stringify(a)}`);const u=yield this._context.requestRoomPK(a);return u!==D.SUCCESS?(F.error(`requestRoomPK failed: ${u}`),{code:u}):(F.debug("requestRoomPK success"),this._PKInfo[t]={inviteSessionId:i,inviterRoomId:this._mainRoomId,inviterUserId:this._context.getCurrentId(),inviterUserAutoMix:o,inviteeRoomId:t},{code:B.SUCCESS})})}cancelRequestJoinOtherRoom(t,n,r){return ie(this,void 0,void 0,function*(){if(!bt("inviteeRoomId",t,Mn,!0)||!bt("inviteeUserId",n,Mn,!0))return{code:B.PARAMS_ERROR};if(!this._PKInfo[t])return F.error(`\u672A\u53D1\u8D77\u8FC7\u4E0E ${t} \u623F\u95F4\u5185 ${n} \u8FDE\u9EA6\u7684\u8BF7\u6C42`),{code:B.PARAMS_ERROR};F.debug(`canceRequestJoinPK -> inviteeRoomId: ${t}; inviteeUserId: ${n}; extra: ${r}`);const i={inviterRoomId:this._mainRoomId,inviterUserId:this._context.getCurrentId(),inviteeRoomId:t,inviteeUserId:n,extra:r||""},o={roomId:this._mainRoomId,invitedRoomId:t,invitedUserId:n,inviteSessionId:this._PKInfo[t].inviteSessionId,inviteInfo:JSON.stringify(i)};F.debug(`canceRequestJoinPK -> params: ${JSON.stringify(o)}`);const s=yield this._context.cancelRoomPK(o);return s!==D.SUCCESS?(F.error(`canceRequestJoinPK failed: ${s}`),{code:s}):(F.debug("canceRequestJoinPK success"),delete this._PKInfo[t],{code:B.SUCCESS})})}responseJoinOtherRoom(t,n,r,i){return ie(this,void 0,void 0,function*(){if(!bt("inviterRoomId",t,Mn,!0)||!bt("inviterUserId",n,Mn,!0))return{code:B.PARAMS_ERROR};if(!this._PKInfo[t])return F.error(`${t} \u623F\u95F4\u5185\u7684 ${n} \u672A\u53D1\u8D77\u8FC7\u8FDE\u9EA6\u8BF7\u6C42`),{code:B.PARAMS_ERROR};F.debug(`responseRoomPK -> inviterRoomId: ${t}; inviterUserId: ${n}; agree: ${r}; options: ${JSON.stringify(i||{})}`);const{inviteSessionId:o,inviterUserAutoMix:s}=this._PKInfo[t],a=!Nu(i==null?void 0:i.autoMix)||(i==null?void 0:i.autoMix),u={inviteSessionId:o,inviterRoomId:t,inviterUserId:n,inviteeRoomId:this._mainRoomId,inviteeUserId:this._context.getCurrentId(),inviteeUserAutoMix:a},d=Object.assign(u,{inviterUserAutoMix:s}),f=r?Object.assign(u,{MultiRoomKey:`${t}|${this._mainRoomId}`,MultiRoomValue:JSON.stringify(d)}):u;!mt(i==null?void 0:i.extra)&&Object.assign(f,{extra:i.extra});const c={agree:r,roomId:this._mainRoomId,inviteSessionId:o,inviteRoomId:t,inviteUserId:n,content:JSON.stringify(f),key:`${t}|${n}`,value:JSON.stringify(u)};F.debug(`responseRoomPK -> params: ${JSON.stringify(c)}`);const l=yield this._context.responseRoomPK(c);return l!==D.SUCCESS?(F.error(`responseRoomPK failed: ${l}`),{code:l}):(F.debug("responseRoomPK success"),this._PKInfo[t].inviteeUserAutoMix=a,{code:B.SUCCESS})})}_quitRoomPK(t){return ie(this,void 0,void 0,function*(){const{inviterRoomId:n,inviteeRoomId:r,inviterUserId:i}=this._PKInfo[t],o={inviteeRoomId:r,inviterRoomId:n,userId:this._context.getCurrentId()},s={roomId:this._mainRoomId,endRoomId:t,sessionId:this._PKInfo[t].inviteSessionId,content:JSON.stringify(o),keys:[`${n}|${i}`]};F.debug(`quitRoomPK -> params: ${JSON.stringify(s)}`);const a=yield this._context.endRoomPK(s);return a!==D.SUCCESS?(F.error(`quitRoomPK failed: ${a}`),{code:B.SIGNAL_ERROR}):(F.debug("quitRoomPK success"),delete this._PKInfo[t],{code:B.SUCCESS})})}_relaseCrtRoom(){}joinOtherRoom(t){return ie(this,void 0,void 0,function*(){if(!bt("roomId",t,Mn,!0))return{code:B.PARAMS_ERROR};if(this._context.getConnectionStatus()!==Ke.CONNECTED)return{code:B.SIGNAL_DISCONNECTED};if(F.debug(`joinPKRoom, roomId: ${t}`),this._joinedPKRooms[t])return{code:B.REPERT_JOIN_ROOM};const n=Kr.VIDEO,{code:r,data:i}=yield this._context.joinRTCRoom(t,yn.LIVE,n);if(r!==D.SUCCESS)return F.error(`joinRoom failed -> code: ${r}`),{code:r};F.debug(`JoinPKRoom success -> userId: ${this._context.getCurrentId()}, roomId: ${t}, data: ${JSON.stringify(i)}`);const o=new Ri(this._context,this._runtime,t,i,this._service,this._initOptions,this._relaseCrtRoom.bind(this),n,!1,!1);return this._joinedPKRooms[t]=o,this._onJoinedPKRoom(t,o),{room:o,code:B.SUCCESS,userIds:o.getRemoteUserIds(),tracks:o.getRemoteTracks()}})}leaveOtherRoom(t,n){return ie(this,void 0,void 0,function*(){return Lt(()=>ie(this,void 0,void 0,function*(){const r=t.getRoomId();return F.debug(`leavePKRoom -> userId: ${this._context.getCurrentId()} , roomId: ${r}`),yield t.__destroy(!0),delete this._joinedPKRooms[r],this._onLeavePKRoom(r),this._PKInfo[r]?(n&&this._quitRoomPK(r),{code:B.SUCCESS}):{code:B.SUCCESS}}))})}getPKInfo(t){return this._PKInfo[t]}getJoinedPKRooms(){return this._joinedPKRooms}}class Ri extends iS{constructor(t,n,r,i,o,s,a,u,d=!1,f){var c;super(t,n,r,i,yn.LIVE,o,s,a,d,f),this._livingType=u,this._isMainRoom=f,this._CDNUris=null,this._CDNEnable=!1,this._mcuConfigBuilder=new HB(this._onMCUConfigFlush.bind(this),this._isValidResourceId.bind(this),this._sendCDNInfoSignal.bind(this)),this._isMainRoom&&(this._roomPKHandler=new qB(t,n,o,s,this,super._registerPKMsgListener.bind(this),this._onJoinedPKRoom.bind(this),this._onLeavePKRoom.bind(this)));const l=(c=i.roomInfo.filter(h=>h.key==="cdn_uris")[0])===null||c===void 0?void 0:c.value;l&&(this._CDNUris=JSON.parse(l)[0])}_isValidResourceId(t){var n;const{userId:r}=vn(t),i=!!((n=this._roomResources[r])===null||n===void 0?void 0:n.find(f=>dt(f)===t));let o=!1;const{code:s,roomPKHandler:a}=this.getRoomPKHandler();if(s!==B.SUCCESS||!a)return i;const u=a.getJoinedPKRooms(),d=[];return Object.values(u).map(f=>{d.push(...f.getRemoteTracks())}),o=d.some(f=>t===f.getTrackId()),i||o}getLivingType(){return this._livingType}getMCUConfigBuilder(){return this._isMainRoom?this._mcuConfigBuilder:(F.error("the `getMCUConfigBuilder` is disabled in PK room "),{code:B.THE_FUNCTION_IS_DISABLED_IN_PKROOM})}_onMCUConfigFlush(t){return ie(this,void 0,void 0,function*(){const n={"App-Key":this._context.getAppkey(),Token:this._token,RoomId:this.getRoomId(),UserId:this._context.getCurrentId(),SessionId:this.getSessionId()},{code:r,res:i}=yield this._service.setMcuConfig(n,t);return r!==B.SUCCESS?(F.error(`set MCU config failed: ${r}`),{code:r}):(F.info("set MCU config success"),i.pull_url&&(this._CDNUris=JSON.parse(i.pull_url)),{code:r,res:i})})}__onReconnected(){const t=Object.create(null,{__onReconnected:{get:()=>super.__onReconnected}});var n,r;return ie(this,void 0,void 0,function*(){const i=yield t.__onReconnected.call(this,this._livingType);if(!i||!i.data)return;const o=i.data.roomInfo,s=(n=o.filter(u=>u.key==="cdn_uris")[0])===null||n===void 0?void 0:n.value;if(!s)return;const a=JSON.parse(s);((r=this._CDNUris)===null||r===void 0?void 0:r.enableInnerCDN)!==a.enableInnerCDN&&this._callAppListener("onCDNEnableChange",a.enableInnerCDN),this._CDNUris=a})}enableInnerCDN(t){return ie(this,void 0,void 0,function*(){if(!this._isMainRoom)return F.error("the `enableInnerCDN` is disabled in PK room "),{code:B.THE_FUNCTION_IS_DISABLED_IN_PKROOM};if(!Nu(t))return F.error("`enable` is invalid"),{code:B.PARAMS_ERROR};this._CDNEnable=t;const n={version:2,output:{inCDNModel:t?zu.OPEN:zu.STOP}},{code:r}=yield this._onMCUConfigFlush(n);if(r!==B.SUCCESS)return F.error(`enableInnerCDN failed -> code: ${r}`),{code:B.SIGNAL_ERROR};if(this._CDNUris&&this._CDNUris.broadcast!==Yu.SPREAD)return F.info("enableInnerCDN succeed"),{code:B.SUCCESS};const{code:i}=yield Lt(()=>ie(this,void 0,void 0,function*(){return this._sendCDNInfoSignal()}));return i===B.SUCCESS?(F.info("enableInnerCDN succeed"),{code:B.SUCCESS}):(F.error(`enableInnerCDN failed -> code: ${i}`),{code:i})})}_sendCDNInfoSignal(){return ie(this,void 0,void 0,function*(){return this._CDNUris=Object.assign({},this._CDNUris,{enableInnerCDN:this._CDNEnable}),(yield Promise.all([this._spreadCDNInfo(this._CDNUris),this._setRoomCDNInfo(this._CDNUris)])).every(t=>t.code===B.SUCCESS)?{code:B.SUCCESS}:{code:B.SIGNAL_ERROR}})}_spreadCDNInfo(t){return ie(this,void 0,void 0,function*(){const n=yield this._context.setRTCCDNUris(this._roomId,nt.TOTAL_CONTENT_RESOURCE,JSON.stringify([t]));return n!==D.SUCCESS?(F.error(`spreadCDNInfo failed -> code: ${n}`),{code:B.SIGNAL_ERROR}):(F.info("spreadCDNInfo succeed"),{code:B.SUCCESS})})}_setRoomCDNInfo(t){return ie(this,void 0,void 0,function*(){const n=yield this._context.setRTCData(this._roomId,"cdn_uris",JSON.stringify([t]),!0,jr.ROOM);return n!==D.SUCCESS?(F.error(`setRoomCDNInfo failed -> code: ${n}`),{code:B.SIGNAL_ERROR}):(F.info("setRoomCDNInfo succeed"),{code:B.SUCCESS})})}_resourceHandle(t,n,r){const i=Object.create(null,{_resourceHandle:{get:()=>super._resourceHandle}});var o;return ie(this,void 0,void 0,function*(){i._resourceHandle.call(this,t,n,r),t.cdn_uris&&(((o=this._CDNUris)===null||o===void 0?void 0:o.enableInnerCDN)!==t.cdn_uris[0].enableInnerCDN&&this._callAppListener("onCDNEnableChange",!this.__getCDNEnable()),this._CDNUris=t.cdn_uris[0])})}_exchangeHandle(t){var n,r,i;return ie(this,void 0,void 0,function*(){const o=yield this._service.exchange(this._getRTCReqestHeaders(),t),s=(r=(n=o.data)===null||n===void 0?void 0:n.urls)===null||r===void 0?void 0:r.pull_url;return o.code===B.SUCCESS&&s&&(this._CDNUris=JSON.parse(s),((i=this._CDNUris)===null||i===void 0?void 0:i.broadcast)===Yu.SPREAD&&(this._CDNEnable=!0,this._sendCDNInfoSignal())),o})}_afterChangedRole(t){const n=ch(t),r=this._context.getCurrentId(),i=Object.keys(n);setTimeout(()=>{var o,s,a;const u=i.filter(d=>d!==r);u.length>0&&this._callAppListener("onUserJoin",u);for(const d in n)d!==r&&this._resourceHandle({uris:n[d]},nt.TOTAL_CONTENT_RESOURCE,d);((o=t.roomInfo.filter(d=>d.key==="cdn_uris")[0])===null||o===void 0?void 0:o.value)&&((s=this._CDNUris)===null||s===void 0?void 0:s.push_mode)===Wu.MANUAL&&this._callAppListener("onCDNEnableChange",(a=this._CDNUris)===null||a===void 0?void 0:a.enableInnerCDN)})}__getCDNEnable(){var t;return(t=this._CDNUris)===null||t===void 0?void 0:t.enableInnerCDN}__getCDNPushMode(){var t;return(t=this._CDNUris)===null||t===void 0?void 0:t.push_mode}_onJoinedPKRoom(t,n){const{code:r,roomPKHandler:i}=this.getRoomPKHandler();if(r===B.SUCCESS&&i){if(!i.getPKInfo(t))return;this._exchangeWithPushOtherRoom()}}_onLeavePKRoom(t){const{code:n,roomPKHandler:r}=this.getRoomPKHandler();if(n===B.SUCCESS&&r){if(!r.getPKInfo(t))return;this._exchangeWithPushOtherRoom()}}_exchangeWithPushOtherRoom(){return ie(this,void 0,void 0,function*(){if(!this.getLocalTracks().length)return;const t=yield this._createExchangeParams(this._subscribedList,!1),n=this._getPushOtherRoomsParams();n&&(t.pushOtherRooms=n);const r=yield this._exchangeHandle(t);if(r.code!==B.SUCCESS)return F.error(`reTryExchange failed: ${r.code}`),{code:r.code};const{sdp:i,resultCode:o}=r.data;if(o!==B.SUCCESS)return F.error(`exchange with pushOtherRoom failed: ${o}`),{code:o};const s=yield this._pc.setRemoteAnswer(i.sdp);return s!==B.SUCCESS?{code:s}:void 0})}getRoomPKHandler(){return this._isMainRoom?{code:B.SUCCESS,roomPKHandler:this._roomPKHandler}:(F.error("the `getRoomPKHandler` is disabled in PK room "),{code:B.THE_FUNCTION_IS_DISABLED_IN_PKROOM})}_quitAllPKRoom(){const t=this._roomPKHandler.getJoinedPKRooms();for(const n in t){const r=t[n];this._roomPKHandler.leaveOtherRoom(r)}}}class KB extends iS{constructor(t,n,r,i,o,s,a){super(t,n,r,i,yn.RTC,o,s,a,!1)}}const Ld=()=>({"Content-Type":"application/json;charset=UTF-8","Cache-Control":"no-cache",ClientType:`web|${lr.browser}|${lr.version}`,ClientVersion:"5.3.1","Client-Session-Id":oS(),"Request-Id":Date.now().toString()});class Tg{constructor(t,n,r,i=5e3){this._runtime=t,this._context=n,this._msUrl=r,this._timeout=i,this._msInNavi=[],this._failedMs=[],this._rtcFinger=void 0,this._clusterId="",this._configUrl=""}getNaviMS(){return this._msUrl?[this._msUrl]:this._clusterId?[`https://${this._clusterId}`]:(this._msInNavi.length===0&&(this._failedMs.length===0?this._msInNavi.push(...(t=>{var n;if(!t)return[];let r;try{r=JSON.parse(t.voipCallInfo||'{ "strategy": 0 }')}catch{return F.warn("parse `voipCallInfo` of navi failed: "+t.voipCallInfo),[]}if(r.strategy===0)return[];const i=(n=r.callEngine)===null||n===void 0?void 0:n.filter(a=>a.engineType===4);if(!i||i.length===0)return[];const o=i[0],s=[];return o.mediaServer&&s.push(o.mediaServer.replace(/^(https?:\/\/)?/,"https://")),o.backupMediaServer&&o.backupMediaServer.forEach(a=>{s.push(a.replace(/^(https?:\/\/)?/,"https://"))}),s})(this._context.getNaviInfo())):(this._msInNavi.push(...this._failedMs),this._failedMs.length=0)),this._msInNavi.map(t=>t.trim()))}_request(t,n,r){return ie(this,void 0,void 0,function*(){const i=this.getNaviMS();if(i.length===0)return{code:B.NOT_OPEN_VIDEO_AUDIO_SERVER};this._rtcFinger&&(r.rtcFinger=this._rtcFinger);for(let o=0;o<i.length;o+=1){const s=`${i[o]}${t}`,a=Ld();F.debug(`request -> Request-Id: ${a["Request-Id"]}, url: ${s}`);const{status:u,data:d}=yield this._runtime.httpReq({url:s,body:JSON.stringify(r),headers:Object.assign(Object.assign({},a),n),method:Nr.POST,timeout:this._timeout});if(u===200){const f=JSON.parse(d);return f.rtcFinger&&(this._rtcFinger=f.rtcFinger),f.clusterId&&(this._clusterId=f.clusterId),F.debug(`request success -> Request-Id: ${a["Request-Id"]}`),{code:B.SUCCESS,data:f}}F.warn(`request failed -> Request-Id: ${a["Request-Id"]}, status: ${u}, url: ${s}`),this._failedMs.push(...this._msInNavi.splice(o,1))}return{code:B.REQUEST_FAILED}})}exchange(t,n){var r;return ie(this,void 0,void 0,function*(){const i=yield this._request("/exchange",t,n);if(i.code===B.SUCCESS&&((r=i.data)===null||r===void 0?void 0:r.resultCode)===B.SUCCESS){const o=i.data.urls;o&&(this._configUrl=o.configUrl)}return i})}exit(t){return ie(this,void 0,void 0,function*(){const{code:n}=yield this._request("/exit",t,{});return n})}broadcastSubscribe(t,n){return this._request("/broadcast/subscribe",t,n)}broadcastExit(t){return ie(this,void 0,void 0,function*(){const{code:n}=yield this._request("/broadcast/exit",t,{});return{code:n}})}setMcuConfig(t,n){return ie(this,void 0,void 0,function*(){if(!this._configUrl)return{code:B.MCU_SERVER_NOT_FOUND};const r=`${this._configUrl.replace(/^(https?:\/\/)?/,"https://")}/server/mcu/config`,i=Ld();F.debug(`request -> Request-Id: ${i["Request-Id"]}, url: ${r}`);const{status:o,data:s}=yield this._runtime.httpReq({url:r,headers:Object.assign(Object.assign({},i),t),body:JSON.stringify(n),method:Nr.POST});if(o===200){F.debug(`request success -> Request-Id: ${i["Request-Id"]}`);const a=JSON.parse(s);return{code:a.resultCode,res:a}}return{code:B.REQUEST_FAILED}})}getCDNResourceInfo(t,n){return ie(this,void 0,void 0,function*(){const r=Ld(),{status:i,data:o}=yield this._runtime.httpReq({url:n,headers:Object.assign(Object.assign({},r),t),method:Nr.GET});if(i===200){const s=JSON.parse(o);return{code:s.resultCode,res:s}}return F.warn(`request failed -> Request-Id: ${r["Request-Id"]}, status: ${i}, url: ${n}`),{code:B.REQUEST_FAILED}})}}class GB{constructor(t,n,r){this._context=t,this._rtcToken="",this._liveUrl="",this._subTracks=[],this._livingType=null,this._mediaType=null,this._subTiny=!1,this._fromRetry=!1,this._appListener=null,this._service=new Tg(n,t,r.mediaServer)}_getReqHeaders(t){return ie(this,void 0,void 0,function*(){const n=this._context.getCurrentId(),r=n;if(!this._rtcToken){const{code:i,data:o}=yield this._context.getRTCToken(r,yn.LIVE,t);if(i!==D.SUCCESS)return F.error(`getRTCToken failed: ${i}`),{code:B.SIGNAL_ERROR};this._rtcToken=o.rtcToken}return{code:B.SUCCESS,headers:{"App-Key":this._context.getAppkey(),UserId:n,RoomId:r,RoomType:yn.LIVE,Token:this._rtcToken}}})}_clearSubscribeInfo(){var t;this._liveUrl="",this._livingType=null,this._mediaType=null,this._subTiny=!1,this._subTracks.length=0,(t=this._pc)===null||t===void 0||t.destroy(),this._pc=null}_reTryExchange(){var t;return ie(this,void 0,void 0,function*(){this._fromRetry=!0;const{code:n}=yield this.subscribe(this._liveUrl,this._livingType,this._mediaType,this._subTiny);n===B.SUCCESS&&((t=this._pc)===null||t===void 0||t.clearReTryExchangeTimer())})}subscribe(t,n,r,i=!1){return ie(this,void 0,void 0,function*(){return Lt(()=>this.__subscribe(t,n,r,i))})}__subscribe(t,n,r,i=!1){var o;return ie(this,void 0,void 0,function*(){const s=[];if(ou(this._context.getNaviInfo()))return{code:B.PACKAGE_ENVIRONMENT_ERROR,tracks:s};if(!this._fromRetry&&((o=this._pc)===null||o===void 0||o.clearReTryExchangeTimer()),this._fromRetry=!1,!Vn(t))return F.error(`liveUrl is invalid: ${t}`),{code:B.PARAMS_ERROR,tracks:s};if(![Kr.AUDIO,Kr.VIDEO].includes(n))return F.error(`livingType is invalid: ${n}`),{code:B.PARAMS_ERROR,tracks:s};if(![_t.AUDIO_ONLY,_t.VIDEO_ONLY,_t.AUDIO_VIDEO].includes(r))return F.error(`mediaType is invalid: ${r}`),{code:B.PARAMS_ERROR,tracks:s};if(this._liveUrl&&this._liveUrl!==t)return{code:B.BROADCAST_SUB_LIST_NOT_EMPTY,tracks:s};this._pc||(this._pc=new Zr(this._reTryExchange.bind(this)),this._pc.on(Zr.__INNER_EVENT_TRACK_READY__,this._onTrackReady,this),this.registerReportListener(this._reportListener)),this._liveUrl=t;const{code:a,headers:u}=yield this._getReqHeaders(n);if(a!==B.SUCCESS)return{code:a,tracks:s};const d=`rc_mcu_${Date.now()}`,f="RongCloudRTC";this._subTracks.length===0&&(this._subTracks.push(new _i(f,d),new Ei(f,d)),this._pc.updateSubRemoteTracks(this._subTracks.slice()));const c={sdp:yield this._pc.createOffer(!0),liveUrl:t,mediaType:r,simulcast:i?Zn.TINY:Zn.NORMAL,switchstream:!1},l=yield this._service.broadcastSubscribe(u,c);if(l.code!==B.SUCCESS)return F.error(`andience subscribe failed: ${l.code}`),{code:l.code,tracks:s};const h=l.data;if(h.resultCode!==B.SUCCESS)return F.error(`andience subscribe failed! code: ${h.resultCode}; message: ${h.message}`),{code:h.resultCode,tracks:s};F.debug(`andience subscribe success: ${t}`),this._livingType=n,this._mediaType=r,this._subTiny=i;const{sdp:p,subscribedList:m}=h,v=[];return m.forEach(_=>{const{mediaType:y}=_,E=this._subTracks[y];v.push(E),E.__innerSetRemoteMuted(!0)}),this._pc.setRemoteAnswer(p.sdp),{code:B.SUCCESS,tracks:v}})}unsubscribe(){return ie(this,void 0,void 0,function*(){return Lt(()=>this.__unsubscribe())})}__unsubscribe(){var t;return ie(this,void 0,void 0,function*(){if((t=this._pc)===null||t===void 0||t.clearReTryExchangeTimer(),!this._rtcToken||!this._liveUrl)return{code:B.SUCCESS};const{headers:n}=yield this._getReqHeaders(),{code:r}=yield this._service.broadcastExit(n);return r!==B.SUCCESS?F.error(`broadcast unsubscribe failed: ${r}`):F.debug("broadcast unsubscribe success"),this._clearSubscribeInfo(),{code:r}})}registerReportListener(t){var n;this._reportListener=t,(n=this._pc)===null||n===void 0||n.registerReportListener(t)}registerTrackEventListener(t){this._appListener=t}_onTrackReady(t){var n,r;const i=t.receiver.track,o=i.kind==="audio"?_t.AUDIO_ONLY:_t.VIDEO_ONLY,s=this._subTracks[o];s.__innerSetMediaStreamTrack(i);try{(r=(n=this._appListener)===null||n===void 0?void 0:n.onTrackReady)===null||r===void 0||r.call(n,s)}catch(a){F.error(a)}}}var uh,ya;(function(e){e.RTMP="rtmp",e.FLV="flv",e.HLS="hls"})(uh||(uh={})),function(e){e[e.NOT_HTTPS=0]="NOT_HTTPS",e[e.HTTPS=1]="HTTPS"}(ya||(ya={}));const zB=Object.assign(Object.assign({},zr(At.W176_H144)),{frameRate:Yr(Oi.FPS_15)});class u_{constructor(t,n,r,i,o,s){this._context=t,this._runtime=n,this._initOptions=r,this._roomId=i,this._joinResData=o,this._livingType=s,this._roomAnchorList=[],this._roomRes={},this._roomAnchorRes={},this._remoteTracks={},this._appListener=null,this._subscribedList=[],this._sessionId="",this._destroyed=!1,this._setInitData(),this._service=new Tg(this._runtime,this._context,this._initOptions.mediaServer,this._initOptions.timeout),this._polarisReport=new nS(this._context,this._runtime,this._roomId,this,qu.Audience),this._polarisReport.sendR1(),this._pc=new Zr(this._reTryExchange.bind(this),this._polarisReport),this._pc.on(Zr.__INNER_EVENT_TRACK_READY__,a=>{const u=a.streams[0].id,d=a.receiver.track,f=[u,d.kind==="audio"?_t.AUDIO_ONLY:_t.VIDEO_ONLY].join("_"),c=this._remoteTracks[f];c?(c.__innerSetMediaStreamTrack(d),this._callAppListener("onTrackReady",c)):F.warn("cannot found RCRemoteTrack:",d.id)}),this._context.onrtcdatachange=this.singalDataChange.bind(this)}_setInitData(){const{sessionId:t,remoteUserIds:n,remoteRTCUris:r,remoteMUCUris:i,remoteTracks:o,CDNUris:s}=((a,u)=>{const d=u.filter(y=>y.key==="RC_RTC_SESSIONID")[0],f=d?d.value:"",c=u.filter(y=>y.key==="RC_ANCHOR_LIST").map(y=>JSON.parse(y.value||"[]"))[0],l=u.filter(y=>y.key.includes("RC_RES_")).map(y=>JSON.parse(y.value||"{}")),h=l.length?JSON.parse(l[0].mcu_uris||"[]"):[],p=[];h.forEach(y=>{const{mediaType:E,tag:S}=y,T=E===_t.AUDIO_ONLY?new _i(S,"",a):new Ei(S,"",a);p.push(T)});const m=[],v=[];l.forEach(y=>{const E=JSON.parse(y.uris||"[]");m.push(...E),E.forEach(S=>{const{mediaType:T,tag:R,msid:C}=S,w=C.split("_")[0],L=T===_t.AUDIO_ONLY?new _i(R,w):new Ei(R,w);v.push(L)})});const _=u.filter(y=>y.key==="RC_CDN").map(y=>{const E=JSON.parse(y.value||"[]");return JSON.parse(E.cdn_uris)[0]})[0];return{sessionId:f,remoteUserIds:c||[],remoteRTCUris:m,remoteMUCUris:h,remoteRTCTracks:v,remoteMCUTracks:p,remoteTracks:[...v,...p],CDNUris:_||{}}})(this._roomId,this._joinResData.kvEntries);this._sessionId=t,this._roomAnchorList=n,o.forEach(a=>{this._remoteTracks[a.getTrackId()]=a}),this._CDNUris=s,r.forEach(a=>{const u=a.msid.split("_")[0];this._roomAnchorRes[u]?this._roomAnchorRes[u].push(a):this._roomAnchorRes[u]=[a]}),i.forEach(a=>{const{mediaType:u,tag:d}=a,f=[this._roomId,d,u].join("_");this._roomRes[f]=a}),r.forEach(a=>{const u=dt(a);this._roomRes[u]=a})}_assertRoomDestroyed(){if(this._destroyed){const t="This room has been destroyed. Please use `RCRTCClient.joinLivingRoomAsAudience` to catch another instance.";return F.warn(t),B.ROOM_HAS_BEEN_DESTROYED}}singalDataChange(t,n){var r;if(n!==this._roomId)return void F.warn(`singalDataChange -> not the current room data: data roomId: ${n}, current roomId: ${this._roomId}`);F.debug("singalDataChange -> singalData:",JSON.stringify(t||{}));const i=[],o=(r=t.filter(s=>s.key==="RC_CDN")[0])===null||r===void 0?void 0:r.value;o&&this._diffCDNUris(JSON.parse(JSON.parse(o).cdn_uris)[0]),t.forEach(s=>{const{key:a,value:u,timestamp:d,uid:f}=s;if(a.indexOf("RC_RES_")!==-1){const c=JSON.parse(u||"{}"),l=JSON.parse(c.mcu_uris||"[]"),h=JSON.parse(c.uris||"[]");return i.push(...l),void this._diffAnchorResource(h,f)}if(a==="RC_ANCHOR_LIST"){const c=JSON.parse(u||"[]"),{joinUserIds:l,leftUserIds:h}=this._diffAnchorList(c);l.length>0&&this._handleNewJoinedAnchor(l),h.length>0&&this._handleLeftedAnchor(h)}}),this._diffRoomResource(i)}_diffAnchorList(t){const n=t.filter(r=>this._roomAnchorList.indexOf(r)<0);return{leftUserIds:this._roomAnchorList.filter(r=>t.indexOf(r)<0),joinUserIds:n}}_handleNewJoinedAnchor(t){this._roomAnchorList.push(...t),this._callAppListener("onAnchorJoin",t)}_handleLeftedAnchor(t){return ie(this,void 0,void 0,function*(){this._roomAnchorList=this._roomAnchorList.filter(r=>!(t.indexOf(r)>-1));const n=[];t.forEach(r=>{n.push(...this.getRemoteTracksByUserId(r)),delete this._roomAnchorRes[r]}),n.length&&(yield this.unsubscribe(n),n.forEach(r=>delete this._remoteTracks[r.getTrackId()])),this._callAppListener("onAnchorLeave",t)})}_diffRoomResource(t){return ie(this,void 0,void 0,function*(){const n=[],r=[],i=[];t.forEach(o=>{const s=dt(o),{userId:a,tag:u,mediaType:d}=vn(s),f=[this._roomId,u,d].join("_");if(!this._remoteTracks[f]){const c=d===_t.AUDIO_ONLY?new _i(u,"",this._roomId):new Ei(u,"",this._roomId);n.push(c),this._remoteTracks[f]=c,this._roomRes[c.getTrackId()]=o}i.push(f)}),Object.keys(this._remoteTracks).forEach(o=>{i.indexOf(o)<0&&this._remoteTracks[o].isMCUTrack()&&r.push(this._remoteTracks[o])}),n.length>0&&this._callAppListener("onTrackPublish",n),r.length>0&&this._onUserUnpublish(r,"onTrackUnpublish")})}_diffAnchorResource(t,n){return ie(this,void 0,void 0,function*(){const r=this._roomAnchorRes[n]||(this._roomAnchorRes[n]=[]),{publishedList:i,unpublishedList:o,modifiedList:s}=iu(r,t);if(i.length){const a=r.map(dt),u=[],d=[];if(i.forEach(f=>{const c=dt(f),l=a.indexOf(c),{userId:h,tag:p,mediaType:m}=vn(c);l>-1?r[l]=f:r.push(f);let v=this._remoteTracks[c];this._roomRes[c]=f,v?v.isSubscribed()&&u.push(v):(v=m===_t.AUDIO_ONLY?new _i(p,h):new Ei(p,h),this._remoteTracks[c]=v,d.push(v)),v.__innerSetRemoteMuted(f.state===0)}),u.length){const f=u.map(l=>l.getTrackId());F.debug(`resub tracks -> ${JSON.stringify(f)}`);const{code:c}=yield Lt(()=>this._subscribeHandle(u,!0));c!==B.SUCCESS&&F.error(`resub tracks failed -> code: ${c}, ids: ${JSON.stringify(f)}`)}this._callAppListener("onAnchorTrackPublish",d)}if(o.length){const a=o.map(dt);for(let d=r.length-1;d>=0;d-=1){const f=r[d];a.includes(dt(f))&&r.splice(d,1)}const u=o.map(d=>{const f=dt(d);return this._remoteTracks[f]});yield this._onUserUnpublish(u,"onAnchorTrackUnpublish")}if(s.length){const a=r.map(dt);for(let u=0;u<s.length;u++){const d=s[u],f=dt(d),c=a.indexOf(f);r[c].state=d.state;const l=this._remoteTracks[f];l.__innerSetRemoteMuted(d.state===0),l.isAudioTrack()?this._callAppListener("onAudioMuteChange",l):this._callAppListener("onVideoMuteChange",l)}}})}_onUserUnpublish(t,n){return ie(this,void 0,void 0,function*(){yield this.unsubscribe(t),t.forEach(r=>{this._subscribedList=this._subscribedList.filter(i=>i.track.getTrackId()!==r.getTrackId()),delete this._roomRes[r.getTrackId()],r.__innerDestroy(),delete this._remoteTracks[r.getTrackId()]}),this._callAppListener(n,t)})}_callAppListener(t,...n){var r;const i=(r=this._appListener)===null||r===void 0?void 0:r[t];if(i)try{i(...n)}catch(o){F.error(o)}}_reTryExchange(){return ie(this,void 0,void 0,function*(){Lt(()=>ie(this,void 0,void 0,function*(){var t;const{reqBody:n}=yield this._createSubscribeParams(this._subscribedList,{},!0),r=yield this._exchangeHandle(n);if(r.code!==B.SUCCESS)return F.error(`reTryExchange failed: ${r.code}`),{code:r.code};const{sdp:i,resultCode:o}=r.data;if(o!==B.SUCCESS)return F.error(`reTryExchange failed: ${o}`),{code:o};this._pc.clearReTryExchangeTimer();const s=this._subscribedList.filter(u=>u.track.isMCUTrack());if(s.length>0){const u=s[0].track.getTrackId(),d=(t=this._roomRes[u])===null||t===void 0?void 0:t.msid,f=[this._roomId,"RongCloudRTC"].join("_");i.sdp=i.sdp.replace(new RegExp(d,"g"),f)}const a=yield this._pc.setRemoteAnswer(i.sdp);return a!==B.SUCCESS?{code:a}:void 0}))})}_createSubscribeParams(t,n,r){return ie(this,void 0,void 0,function*(){const i=yield this._pc.createOffer(r),o={resolutionInfo:[]},s={min:0,max:0};return Object.keys(n).forEach(a=>{const{mediaStream:u,tinyStream:d}=n[a];[u,d].forEach((f,c)=>{var l;const h=c===1?[a,"tiny"].join("_"):a;i.sdp=(l=i.sdp)===null||l===void 0?void 0:l.replace(new RegExp(f.id,"g"),h);const p=f.getVideoTracks()[0];if(!p)return;const m=c===0,{width:v,height:_,frameRate:y}=m?Eg(p):zB;o.resolutionInfo.push({trackId:p.id,simulcast:m?Zn.NORMAL:Zn.TINY,resolution:`${v}x${_}`});const E=QT(v,_),S=XT(y);s.min+=E.minBitrate*S,s.max+=E.maxBitrate*S})}),{reqBody:{sdp:i,switchstream:!1,newVersionFlag:!0,subscribeList:t.map(a=>({simulcast:a.subTiny?Zn.TINY:Zn.NORMAL,resolution:"",uri:this._roomRes[a.track.getTrackId()].uri}))},dynamicBitrate:s,offer:i}})}_subscribeHandle(t,n=!1){var r;return ie(this,void 0,void 0,function*(){if(this._assertRoomDestroyed())return{code:B.ROOM_HAS_BEEN_DESTROYED};if(!bt("tracks",t,()=>In(t)&&t.length>0&&t.every(u=>u instanceof rn||u.track instanceof rn),!0))return{code:B.PARAMS_ERROR};const i=this._subscribedList.map(u=>Object.assign({},u)),o=t.map(u=>u instanceof rn?{track:u}:u);let s=!1;const a=[];return o.forEach(u=>{const d=u.track.getTrackId();a.push(d);const f=i.find(c=>c.track.getTrackId()===d);f&&f.subTiny===u.subTiny||(f?f.subTiny=u.subTiny:i.push(u),s=!0)}),s||n?((r=this._polarisReport)===null||r===void 0||r.sendR2(Ti.SUBSCRIBE,Si.BEGIN,a),this._updateSubListHandle(i,!0)):{code:B.SUCCESS}})}_getReqHeaders(){const t=this._context.getCurrentId();return{"App-Key":this._context.getAppkey(),RoomId:t,Token:this._joinResData.token,RoomType:yn.LIVE,UserId:t,"Session-Id":this._sessionId}}_exchangeHandle(t){return this._service.broadcastSubscribe(this._getReqHeaders(),t)}_updateSubListHandle(t,n=!1){var r;return ie(this,void 0,void 0,function*(){if(this._assertRoomDestroyed())return{code:B.ROOM_HAS_BEEN_DESTROYED};if(!bt("resources",t,()=>In(t)&&t.every(y=>y instanceof rn||y.track instanceof rn),!0))return{code:B.PARAMS_ERROR};let i=t.map(y=>y instanceof rn?{track:y}:Object.assign({},y));const o={};i=i.filter(y=>{const E=y.track.getTrackId();return!o[E]&&(o[E]=!0)}).map(y=>Object.assign({},y));const s=this._subscribedList.map(y=>Object.assign({},y));if(!n){let y=!1;if(i.forEach(E=>{const S=s.findIndex(T=>T.track===E.track);if(S===-1)return void(y=!0);s.splice(S,1)[0].subTiny!==E.subTiny&&(y=!0)}),s.length&&(y=!0),!y)return{code:B.SUCCESS}}this._pc.clearReTryExchangeTimer(),this._pc.updateSubRemoteTracks(i.map(y=>y.track));const{reqBody:a}=yield this._createSubscribeParams(i,{},!1),u=yield this._exchangeHandle(a);if(s.length){const y=[];s.forEach(E=>{y.push(E.track.getTrackId())}),(r=this._pc.reportParser)===null||r===void 0||r.clearLatestPacketsRecv(y)}if(u.code!==B.SUCCESS)return{code:u.code};const{sdp:d,resultCode:f,message:c,subscribedList:l}=u.data;if(f!==B.SUCCESS)return F.error("change subscribe list failed:",c,f),{code:f};i.forEach(y=>{const{track:E}=y;if(E.isMCUTrack()){const S=this._roomRes[E.getTrackId()].msid,{tag:T,userId:R}=vn(E.getTrackId()),C=[R,T].join("_");d.sdp=d.sdp.replace(new RegExp(S,"g"),C)}});const h=yield this._pc.setRemoteAnswer(d.sdp);if(h!==B.SUCCESS)return{code:h};const p=l==null?void 0:l.map(y=>`${y.msid}_${y.mediaType}`),m=i.filter(y=>{if(y.track.isMCUTrack()){const E=this._roomRes[y.track.getTrackId()],S=`${E.msid}_${E.mediaType}`;return p.includes(S)}return p==null?void 0:p.includes(y.track.getTrackId())}),v=m==null?void 0:m.map(y=>`${y.track.getTrackId()}`),_=i.filter(y=>!(v==null?void 0:v.includes(y.track.getTrackId())));for(const y in this._remoteTracks){const E=m.some(S=>S.track.getTrackId()===y);this._remoteTracks[y].__innerSetSubscribed(E)}return this._subscribedList.splice(0,this._subscribedList.length,...m),_.length?{code:B.SUCCESS,failedList:_}:{code:B.SUCCESS}})}_diffCDNUris(t){return ie(this,void 0,void 0,function*(){if(this._CDNUris.url&&!t.url)return this._callAppListener("onCDNInfoDisable"),void(this._CDNUris=t);(!this._CDNUris||!this._CDNUris.url&&t.url)&&this._callAppListener("onCDNInfoEnable",{resolution:`W${t.w}_H${t.h}`,fps:`FPS_${t.fps}`});const n=this._CDNUris.w&&t.w&&this._CDNUris.w!==t.w,r=this._CDNUris.h&&t.h&&this._CDNUris.h!==t.h,i=this._CDNUris.fps&&t.fps&&this._CDNUris.fps!==t.fps;(n||r||i)&&this._callAppListener("onCDNInfoChange",{resolution:`W${t.w}_H${t.h}`,fps:`FPS_${t.fps}`}),this._CDNUris=t})}_getCDNPlayUrl(t){return ie(this,void 0,void 0,function*(){const{w:n,h:r,fps:i}=t,o=this._initOptions.pullInnerCDNProtocol||uh.FLV,s=this._initOptions.pullInnerCDNUseHttps===ya.NOT_HTTPS?ya.NOT_HTTPS:ya.HTTPS;if(!this._CDNUris.url)return F.error(`cdn_uris url is empty, the anchor need to open or push CDN, code: ${B.CDN_RESOURCE_IS_EMPTY}`),{code:B.CDN_RESOURCE_IS_EMPTY};const a={"App-Key":this._context.getAppkey(),Token:this._joinResData.token,RoomId:this.getRoomId(),UserId:this._context.getCurrentId(),SessionId:this.getSessionId()},u=[];n&&u.push(`w=${n}`),r&&u.push(`h=${r}`),i&&u.push(`fps=${i}`),u.push(`kind=${o}`),u.push(`is_https=${s}`);const d=u.join("&");let f=`${this._CDNUris.url}?`;d&&(f+=d);const{code:c,res:l}=yield this._service.getCDNResourceInfo(a,f);return c!==B.SUCCESS?(F.error(`getCDNPlayUrl failed: ${c}`),{code:c}):(F.info(`getCDNPlayUrl success: ${l==null?void 0:l.data.pull_url}`),{code:c,CDNPlayUrl:l==null?void 0:l.data.pull_url})})}getCDNPlayUrl(t,n){return ie(this,void 0,void 0,function*(){if(t&&!Xo(t))return F.error("`resolution` is invalid"),{code:B.PARAMS_ERROR};if(n&&!sh(n))return F.error("`fps` is invalid"),{code:B.PARAMS_ERROR};const{width:r,height:i}=t?zr(t):{width:null,height:null},o=n?Yr(n):null,s={};return r&&(s.w=r),i&&(s.h=i),o&&(s.fps=o),this._getCDNPlayUrl(s)})}subscribe(t){return ie(this,void 0,void 0,function*(){return Lt(()=>this._subscribeHandle(t,!1))})}__unsubscribe(t){var n;return ie(this,void 0,void 0,function*(){if(!bt("tracks",t,()=>In(t)&&t.length>0&&t.every(i=>i instanceof rn),!0))return F.error(`unsubscribe failed, tracks is invalid -> roomId: ${this._roomId}`),{code:B.PARAMS_ERROR};const r=this._subscribedList.map(i=>Object.assign({},i)).filter(i=>!t.includes(i.track));return(n=this._polarisReport)===null||n===void 0||n.sendR2(Ti.SUBSCRIBE,Si.END,t.map(i=>i.getTrackId())),this._updateSubListHandle(r,!1)})}unsubscribe(t){return ie(this,void 0,void 0,function*(){return Lt(()=>this.__unsubscribe(t))})}__destroy(t){var n;return ie(this,void 0,void 0,function*(){this._destroyed||(this._destroyed=!0,(n=this._audioLevelReport)===null||n===void 0||n.clearAudioLevelReportTimer(),t&&(yield this._context.quitLivingRoomAsAudience(this._roomId)),yield this._service.broadcastExit(this._getReqHeaders()),this._pc.destroy(),this._polarisReport=null,this._context.onrtcdatachange=()=>{})})}getRemoteTrack(t){return this._remoteTracks[t]}__getPC(){return this._pc}getLocalTrack(t){return{}}__onReconnected(){return ie(this,void 0,void 0,function*(){const{code:t}=yield this._context.joinLivingRoomAsAudience(this._roomId,yn.LIVE);t!==D.SUCCESS&&F.error("join living room error when on reconnected")})}registerRoomEventListener(t){this._appListener=t}onAudioLevelChange(t,n){var r;(r=this._audioLevelReport)===null||r===void 0||r.clearAudioLevelReportTimer(),this._audioLevelReport=new rS(this),this._audioLevelReport.onAudioLevelChange(t,n||1e3)}registerReportListener(t){var n;(n=this._pc)===null||n===void 0||n.registerReportListener(t)}getRoomId(){return this._roomId}getCrtUserId(){return this._context.getCurrentId()}getSessionId(){return this._sessionId}getRemoteUserIds(){return this._roomAnchorList}getRemoteTracksByUserId(t){const n=[];for(const r in this._remoteTracks){const i=this._remoteTracks[r];i.getUserId()===t&&n.push(i)}return n}getRemoteTracks(){const t=[],n=[];for(const r in this._remoteTracks){if(n.length===2)break;const i=this._remoteTracks[r];i.isMCUTrack()&&n.push(i)}return this._roomAnchorList.forEach(r=>{t.push(...this.getRemoteTracksByUserId(r))}),[...n,...t]}getRemoteRTCTracks(){const t=[];for(const n in this._remoteTracks){const r=this._remoteTracks[n];r.isMCUTrack()||t.push(r)}return t}getRemoteMCUTracks(){const t=[];for(const n in this._remoteTracks){const r=this._remoteTracks[n];r.isMCUTrack()&&t.push(r)}return t}getCDNInfo(){return this._CDNUris.w?{resolution:`W${this._CDNUris.w}_H${this._CDNUris.h}`,fps:`FPS_${this._CDNUris.fps}`,CDNEnable:this._CDNUris.enableInnerCDN}:{CDNEnable:!1}}}const l_=(e,t)=>{const n=[];return n[0]=(t==null?void 0:t.withoutAudio)?void 0:e.getAudioTracks()[0],n[1]=(t==null?void 0:t.withoutVideo)?void 0:e.getVideoTracks()[0],n};class YB{constructor(t,n,r){this._context=t,this._runtime=n,this._options=r,this._crtRoom=null,this._audience=null,this._crtAudienceLivingRoom=null,bs.setSdpSemantics(r.sdpSemantics||"plan-b"),this._service=new Tg(this._runtime,this._context,this._options.mediaServer,this._options.timeout),this._context.onconnectionstatechange=this._onIMStatusChange.bind(this),this._context.ondisconnect=this._onIMDisconnect.bind(this),this._context.ondestroy=this._onIMUninit.bind(this),this._context.onmessage=this._handleMessage.bind(this)}_handleMessage(t){var n;return t.conversationType!==$e.RTC_ROOM?!1:(this._crtRoom instanceof Ri&&this._getJoinedPKRoomList().forEach(r=>{r.__parseInnerMessage(t)}),(n=this._crtRoom)===null||n===void 0||n.__parseInnerMessage(t),!0)}_getJoinedPKRoomList(){const{code:t,roomPKHandler:n}=this._crtRoom.getRoomPKHandler();if(t===B.SUCCESS&&n){const r=n.getJoinedPKRooms()||{};return Object.values(r)}return[]}getCurrentId(){return this._context.getCurrentId()}joinRTCRoom(t,n){return Lt(()=>this._joinRTCRoom(t,n))}_joinRTCRoom(t,n){return ie(this,void 0,void 0,function*(){if(ou(this._context.getNaviInfo()))return{code:B.PACKAGE_ENVIRONMENT_ERROR};if(!bt("roomId",t,Mn,!0))return{code:B.PARAMS_ERROR};if(this._crtRoom)return{code:B.REPERT_JOIN_ROOM};if(this._context.getConnectionStatus()!==Ke.CONNECTED)return{code:B.SIGNAL_DISCONNECTED};if(!this._service.getNaviMS().length)return{code:B.NOT_OPEN_VIDEO_AUDIO_SERVER};F.debug(`joinRoom -> roomId: ${t}; joinType: ${n||Hf.KICK}`);const{code:r,data:i}=yield this._context.joinRTCRoom(t,yn.RTC,void 0,n);if(r!==D.SUCCESS)return F.error(`joinRoom failed -> code: ${r}`),{code:r===Xf.JOIN_REFUSED?B.SIGNAL_JOIN_RTC_ROOM_REFUSED:r};F.debug(`joinRoom success -> userId: ${this._context.getCurrentId()}, roomId: ${t}, data: ${JSON.stringify(i)}`);const o=new KB(this._context,this._runtime,t,i,this._service,this._options,this._releaseCrtRoomObj.bind(this));return this._crtRoom=o,{room:o,code:B.SUCCESS,userIds:o.getRemoteUserIds(),tracks:o.getRemoteTracks()}})}joinLivingRoom(t,n){return Lt(()=>this._joinLivingRoom(t,n))}_joinLivingRoom(t,n){return ie(this,void 0,void 0,function*(){if(ou(this._context.getNaviInfo()))return{code:B.PACKAGE_ENVIRONMENT_ERROR};if(!bt("roomId",t,Mn,!0)||!bt("livingType",n,a=>a===Kr.AUDIO||a===Kr.VIDEO))return{code:B.PARAMS_ERROR};if(this._crtRoom)return{code:B.REPERT_JOIN_ROOM};if(this._context.getConnectionStatus()!==Ke.CONNECTED)return{code:B.SIGNAL_DISCONNECTED};if(!this._service.getNaviMS().length)return{code:B.NOT_OPEN_VIDEO_AUDIO_SERVER};F.debug(`joinRoom, roomId: ${t}`);const{code:r,data:i}=yield this._context.joinRTCRoom(t,yn.LIVE,n);if(r!==D.SUCCESS)return F.error(`joinRoom failed -> code: ${r}`),{code:r};F.debug(`JoinRoom success -> userId: ${this._context.getCurrentId()}, roomId: ${t}, data: ${JSON.stringify(i)}`);const o=new Ri(this._context,this._runtime,t,i,this._service,this._options,this._releaseCrtRoomObj.bind(this),n,!1,!0);this._crtRoom=o;const s={room:o,code:B.SUCCESS,userIds:o.getRemoteUserIds(),tracks:o.getRemoteTracks()};return o.__getCDNPushMode()===Wu.MANUAL&&Object.assign(s,{CDNEnable:o.__getCDNEnable()}),s})}getAudienceClient(){return this._audience||(this._audience=new GB(this._context,this._runtime,this._options)),this._audience}_onIMStatusChange(t){F.debug(`signal server connection state change: ${t}`),t===Ke.CONNECTED&&(this._crtRoom instanceof Ri&&this._getJoinedPKRoomList().forEach(n=>{n.__onReconnected()}),this._crtRoom&&this._crtRoom.__onReconnected())}_onIMDisconnect(){F.debug("TODO -> on IM disconnect")}_onIMUninit(){F.debug("TODO -> on IM client ondestroy")}leaveRoom(t){return Lt(()=>this._leaveRoom(t))}_leaveRoom(t){return ie(this,void 0,void 0,function*(){return this._crtRoom?(yield this._crtRoom.__destroy(!0),F.debug(`quitRTCRoom -> userId: ${this._context.getCurrentId()} , roomId: ${this._crtRoom.getRoomId()}`),this._crtRoom=null,{code:B.SUCCESS}):{code:B.SUCCESS}})}_releaseCrtRoomObj(){this._crtRoom=null}_getMediaStream(t,n="getUserMedia"){return ie(this,void 0,void 0,function*(){try{const r=yield navigator.mediaDevices[n](t);return{code:B.SUCCESS,stream:r}}catch(r){if(r.message==="Permission denied")return{code:B.PERMISSION_DENIED};F.error(`get user media failed -> ${r.message}`)}return{code:n==="getUserMedia"?B.GET_USER_MEDIA_FAILED:B.GET_DISPLAY_MEDIA_FAILED}})}createMicrophoneAudioTrack(t="RongCloudRTC",n){return ie(this,void 0,void 0,function*(){if(!ci(t))return{code:B.INVALID_TAGS};const r=this._context.getCurrentId();if(!r)return{code:B.INVALID_USER_ID};const{stream:i,code:o}=yield this._getMediaStream({audio:{deviceId:n==null?void 0:n.micphoneId,sampleRate:n==null?void 0:n.sampleRate}});if(o!==B.SUCCESS)return{code:o};const s=i.getAudioTracks()[0];return{code:o,track:new i_(t,r,s)}})}createCameraVideoTrack(t="RongCloudRTC",n){return ie(this,void 0,void 0,function*(){if(!ci(t))return{code:B.INVALID_TAGS};const r=this._context.getCurrentId();if(!r)return{code:B.INVALID_USER_ID};const i=Xo(n==null?void 0:n.resolution)?n.resolution:At.W640_H480,{width:o,height:s}=zr(i),{stream:a,code:u}=yield this._getMediaStream({video:{deviceId:n==null?void 0:n.cameraId,frameRate:Yr((n==null?void 0:n.frameRate)||Oi.FPS_15),width:o,height:s,facingMode:n==null?void 0:n.faceMode}});if(u!==B.SUCCESS)return{code:u};const d=a.getVideoTracks()[0];return{code:u,track:new o_(t,r,d)}})}createMicrophoneAndCameraTracks(t="RongCloudRTC",n){var r,i,o,s,a,u;return ie(this,void 0,void 0,function*(){const d=[];if(!ci(t))return{code:B.INVALID_TAGS,tracks:d};const f=this._context.getCurrentId();if(!f)return{code:B.INVALID_USER_ID,tracks:d};const c=Xo((r=n==null?void 0:n.video)===null||r===void 0?void 0:r.resolution)?n.video.resolution:At.W640_H480,{width:l,height:h}=zr(c),{stream:p,code:m}=yield this._getMediaStream({video:{deviceId:(i=n==null?void 0:n.video)===null||i===void 0?void 0:i.cameraId,frameRate:Yr(((o=n==null?void 0:n.video)===null||o===void 0?void 0:o.frameRate)||Oi.FPS_15),width:l,height:h,facingMode:(s=n==null?void 0:n.video)===null||s===void 0?void 0:s.faceMode},audio:{deviceId:(a=n==null?void 0:n.audio)===null||a===void 0?void 0:a.micphoneId,sampleRate:(u=n==null?void 0:n.audio)===null||u===void 0?void 0:u.sampleRate}});return m!==B.SUCCESS||p.getTracks().forEach(v=>{v.kind==="video"?d.push(new o_(t,f,v)):d.unshift(new i_(t,f,v))}),{code:m,tracks:d}})}createScreenVideoTrack(t="screenshare",n){return ie(this,void 0,void 0,function*(){if(!ci(t))return{code:B.INVALID_TAGS};const r=this._context.getCurrentId();if(!r)return{code:B.INVALID_USER_ID};if(!eS())return{code:B.BROWSER_NOT_SUPPORT};const i=/Electron/.test(navigator.userAgent);if(i&&!(n==null?void 0:n.chromeMediaSourceId))return{code:B.PARAMS_ERROR};const o=Xo(n==null?void 0:n.resolution)?n.resolution:At.W1280_H720,{width:s,height:a}=zr(o),u=i?{mandatory:{chromeMediaSourceId:n.chromeMediaSourceId,chromeMediaSource:"desktop",minWidth:s,maxWidth:s,minHeight:a,maxHeight:a}}:{frameRate:Yr((n==null?void 0:n.frameRate)||Oi.FPS_15),width:s,height:a},{stream:d,code:f}=yield this._getMediaStream({video:u,audio:!1},i?"getUserMedia":"getDisplayMedia");if(f!==B.SUCCESS)return{code:f};const c=d.getVideoTracks()[0];return{code:f,track:new LB(t,r,c)}})}createLocalAudioTrack(t,n){return ie(this,void 0,void 0,function*(){if(!ci(t))return{code:B.INVALID_TAGS};if(!n||n.toString()!=="[object MediaStreamTrack]"||n.kind!=="audio")return{code:B.CREATE_CUSTOM_TRACK_FAILED};const r=this._context.getCurrentId();return r?{code:B.SUCCESS,track:new oh(t,r,n)}:{code:B.INVALID_USER_ID}})}createLocalVideoTrack(t,n){return ie(this,void 0,void 0,function*(){if(!ci(t))return{code:B.INVALID_TAGS};if(!n||n.toString()!=="[object MediaStreamTrack]"||n.kind!=="video")return{code:B.CREATE_CUSTOM_TRACK_FAILED};const r=this._context.getCurrentId();return r?{code:B.SUCCESS,track:new hs(t,r,n)}:{code:B.INVALID_USER_ID}})}createLocalFileTracks(t,n,r){return ie(this,void 0,void 0,function*(){if(!ci(t))return{code:B.INVALID_TAGS,tracks:[]};if(!ZT())return{code:B.BROWSER_NOT_SUPPORT,tracks:[]};const i=n instanceof File?URL.createObjectURL(n):n;if(!Ua(i)&&!/^blob:/.test(i))return F.warn(`createLocalFileTracks failed: params error -> url: ${i}`),{code:B.PARAMS_ERROR,tracks:[]};const o=this._context.getCurrentId();return o?new Promise(s=>{const a=document.createElement("video");(r==null?void 0:r.withoutAudio)&&(a.muted=!0),a.onloadedmetadata=()=>{const u=[];let d;try{const l=a.mozCaptureStream?"mozCaptureStream":"captureStream";d=a[l]()}catch(l){F.error(`create RCLocalFileTrack failed, captureSteam error. -> url: ${i}`),F.error(l),s({code:B.CREATE_FILE_TRACK_FAILED,tracks:u})}const[f,c]=l_(d,r);f&&u.push(new MB(t,o,f,a)),c&&u.push(new PB(t,o,c,a)),u.length===0&&(a.pause(),a.src=""),a.onerror=null,s({code:B.SUCCESS,tracks:u})},a.onerror=()=>{F.error(`create RCLocalFileTrack failed -> url: ${i}`),s({code:B.CREATE_FILE_TRACK_FAILED,tracks:[]})},a.src=i,a.loop=!0,a.play()}):{code:B.INVALID_USER_ID,tracks:[]}})}createLocalTracks(t,n,r){return ie(this,void 0,void 0,function*(){const i=[];if(!ci(t))return{code:B.INVALID_TAGS,tracks:i};if(!(n instanceof MediaStream))return{code:B.PARAMS_ERROR,tracks:i};const o=this._context.getCurrentId();if(!o)return{code:B.INVALID_USER_ID,tracks:i};const[s,a]=l_(n,r);return s&&i.push(new oh(t,o,s)),a&&i.push(new hs(t,o,a)),{code:B.SUCCESS,tracks:i}})}joinLivingRoomAsAudience(t,n){return ie(this,void 0,void 0,function*(){if(ou(this._context.getNaviInfo()))return{code:B.PACKAGE_ENVIRONMENT_ERROR};if(!bt("roomId",t,Mn,!0)||!bt("livingType",n,s=>s===Kr.AUDIO||s===Kr.VIDEO))return{code:B.PARAMS_ERROR};if(this._crtAudienceLivingRoom)return{code:B.REPERT_JOIN_ROOM};if(!this._service.getNaviMS().length)return{code:B.NOT_OPEN_VIDEO_AUDIO_SERVER};const{code:r,data:i}=yield this._context.joinLivingRoomAsAudience(t,yn.LIVE,n);if(r!==D.SUCCESS)return F.error("audienceJoinLivingRoomError:",r),{code:B.SIGNAL_AUDIENCE_JOIN_ROOM_FAILED};F.info(`joinLivingRoomAsAudience success, room data: ${JSON.stringify(i)}`);const o=new u_(this._context,this._runtime,this._options,t,i,n);return this._crtAudienceLivingRoom=o,{room:o,code:B.SUCCESS,userIds:o.getRemoteUserIds(),RTCTracks:o.getRemoteRTCTracks(),MCUTracks:o.getRemoteMCUTracks(),CDNUris:o.getCDNInfo()}})}leaveLivingRoomAsAudience(t){return ie(this,void 0,void 0,function*(){return this._crtAudienceLivingRoom?this._crtAudienceLivingRoom!==t?{code:B.PARAMS_ERROR}:(yield this._crtAudienceLivingRoom.__destroy(!0),this._crtAudienceLivingRoom=null,{code:B.SUCCESS}):{code:B.SUCCESS}})}upgradeToAnchorRoom(t){return ie(this,void 0,void 0,function*(){if(!bt("room._roomId",t._roomId,Mn,!0))return{code:B.PARAMS_ERROR};if(this._crtRoom)return{code:B.REPERT_JOIN_ROOM};const{code:n,data:r}=yield this._context.rtcIdentityChange(t._roomId,Pu.ViewerToAnchor,t._livingType);if(n!==D.SUCCESS)return F.error("change room identity error",n),{code:B.SIGNAL_ROOM_CHANGE_IDENTITY_FAILED};yield this._crtAudienceLivingRoom.__destroy(!1);const i=new Ri(this._context,this._runtime,t._roomId,r,this._service,this._options,this._releaseCrtRoomObj.bind(this),t._livingType,!0,!0);return this._crtRoom=i,this._crtAudienceLivingRoom=null,{room:i,code:B.SUCCESS,userIds:t.getRemoteUserIds(),tracks:i.getRemoteTracks()}})}downgradeToAudienceRoom(t){return ie(this,void 0,void 0,function*(){if(!bt("room._roomId",t._roomId,Mn,!0))return{code:B.PARAMS_ERROR};if(this._crtAudienceLivingRoom)return{code:B.REPERT_JOIN_ROOM};const{code:n,data:r}=yield this._context.rtcIdentityChange(t._roomId,Pu.AnchorToViewer,t.getLivingType());if(n!==D.SUCCESS)return F.error("change room identity error",n),{code:B.SIGNAL_ROOM_CHANGE_IDENTITY_FAILED};F.info(`downgradeToAudienceRoom success, room data: ${JSON.stringify(r)}`);const i=new u_(this._context,this._runtime,this._options,t._roomId,r,t.getLivingType());return this._crtAudienceLivingRoom=i,this._crtRoom.__destroy(!1),this._crtRoom=null,{room:i,code:B.SUCCESS,userIds:i.getRemoteUserIds(),RTCTracks:i.getRemoteRTCTracks(),MCUTracks:i.getRemoteMCUTracks(),CDNUris:i.getCDNInfo()}})}getJoinedRoomInfo(){return ie(this,void 0,void 0,function*(){const{code:t,data:n}=yield this._context.getRTCJoinedUserInfo(this._context.getCurrentId());return t!==D.SUCCESS?(F.error("getJoinedUserInfo error",t),{code:B.SIGNAL_ROOM_CHANGE_IDENTITY_FAILED}):{code:B.SUCCESS,data:n}})}}var d_;(function(e){e[e.SERVER_KICK=1]="SERVER_KICK",e[e.OTHER_KICK=2]="OTHER_KICK"})(d_||(d_={}));const OF={tag:"RCRTC",verify:e=>e.tag!=="browser"?(F.error(`RCRTC Plugin is not support the runtime '${e.tag}'`),!1):kB?(ho.add("plugin-rtc","5.3.1"),!!ho.validEngine("5.1.0")||(F.error(`The current engine version '${ho.getInfo().engine}' error, plugin-rtc required engine version at least '5.1.0'.`),!1)):(F.error("Please use the https protocol or use `http://localhost` to open the page!"),!1),setup:(e,t,n={})=>(F.setLogLevel(n.logLevel),F.setLogStdout(n.logStdout),F.warn("RCRTC Version: 5.3.1, Commit: e1af0f5ccb06a0084c94e1219d8af54c9793c06b"),F.warn(`browserInfo.browser -> ${lr.browser}`),F.warn(`browserInfo.supportsUnifiedPlan -> ${lr.supportsUnifiedPlan}`),F.warn(`browserInfo.version -> ${lr.version}`),Zt("options.mediaServer",n.mediaServer,r=>!(!Ua(r)||location.protocol==="https:"&&!/^https/.test(r))),Zt("options.timeout",n.timeout,r=>Pt(r)&&r>=5e3&&r<=3e4),Zt("options.pingGap",n.pingGap,r=>Pt(r)&&r>=3e3&&r<=1e4),new YB(e,t,n))},WB={transResolution:zr,transFrameRate:Yr,parseTrackId:vn,ifSupportLocalFileTrack:ZT,ifSupportScreenShare:eS};function NF(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}export{Un as $,$e as A,Oi as B,IF as C,SB as D,nF as E,SF as F,ht as G,At as H,bF as I,yF as J,_F as K,JI as L,Jr as M,iF as N,sF as O,oF as P,np as Q,qM as R,qr as S,B as T,zt as U,cF as V,uF as W,cA as X,AB as Y,ZB as Z,XB as _,Be as a,aF as a0,eF as a1,rF as a2,$t as a3,or as a4,Kr as a5,tF as a6,lF as a7,dF as a8,Dt as a9,fr as aa,dr as b,Ge as c,Oe as d,vF as e,mF as f,fF as g,Hn as h,NF as i,re as j,EF as k,wF as l,Ar as m,RF as n,ee as o,TF as p,QD as q,Je as r,CF as s,OF as t,he as u,pF as v,Le as w,hF as x,QB as y,gF as z};