@dao42/d42paas-front 0.9.216 → 0.9.217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DaoPaaS.cjs +6 -4
- package/package.json +1 -1
package/dist/DaoPaaS.cjs
CHANGED
|
@@ -46,7 +46,7 @@ Error generating stack: `+o.message+`
|
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/var OQ=E.exports,w$e=CK.exports;function x$e(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var k$e=typeof Object.is=="function"?Object.is:x$e,Q$e=w$e.useSyncExternalStore,P$e=OQ.useRef,T$e=OQ.useEffect,C$e=OQ.useMemo,E$e=OQ.useDebugValue;TK.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=P$e(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=C$e(function(){function l(h){if(!c){if(c=!0,u=h,h=r(h),i!==void 0&&s.hasValue){var m=s.value;if(i(m,h))return d=m}return d=h}if(m=d,k$e(u,h))return m;var g=r(h);return i!==void 0&&i(m,g)?m:(u=h,d=g)}var c=!1,u,d,f=n===void 0?null:n;return[function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,n,r,i]);var a=Q$e(t,o[0],o[1]);return T$e(function(){s.hasValue=!0,s.value=a},[a]),E$e(a),a};PK.exports=TK;var R$e=PK.exports;const{useSyncExternalStoreWithSelector:A$e}=R$e;function I$e(t,e=t.getState,n){const r=A$e(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return E.exports.useDebugValue(r),r}const ZM=t=>{const e=typeof t=="function"?QK(t):t,n=(r,i)=>I$e(e,r,i);return Object.assign(n,e),n},X$e=t=>t?ZM(t):ZM;var D$e=X$e;const N$e=(t,e={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,...a}=e;let l;try{l=(o!=null?o:({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,i);const c=l.connect(a);let u=!0;i.setState=(h,m,g)=>{const p=n(h,m);return u&&c.send(g===void 0?{type:s||"anonymous"}:typeof g=="string"?{type:g}:g,r()),p};const d=(...h)=>{const m=u;u=!1,n(...h),u=m},f=t(i.setState,r,i);if(c.init(f),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let h=!1;const m=i.dispatch;i.dispatch=(...g)=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&g[0].type==="__setState"&&!h&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),h=!0),m(...g)}}return c.subscribe(h=>{var m;switch(h.type){case"ACTION":if(typeof h.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return l4(h.payload,g=>{if(g.type==="__setState"){d(g.state);return}!i.dispatchFromDevtools||typeof i.dispatch=="function"&&i.dispatch(g)});case"DISPATCH":switch(h.payload.type){case"RESET":return d(f),c.init(i.getState());case"COMMIT":return c.init(i.getState());case"ROLLBACK":return l4(h.state,g=>{d(g),c.init(i.getState())});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return l4(h.state,g=>{d(g)});case"IMPORT_STATE":{const{nextLiftedState:g}=h.payload,p=(m=g.computedStates.slice(-1)[0])==null?void 0:m.state;if(!p)return;d(p),c.send(null,g);return}case"PAUSE_RECORDING":return u=!u}return}}),f},z$e=N$e,l4=(t,e)=>{let n;try{n=JSON.parse(t)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&e(n)},Bw=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return Bw(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Bw(r)(n)}}}},M$e=(t,e)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:p=>p,version:0,merge:(p,O)=>({...O,...p}),...e},s=!1;const a=new Set,l=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return t((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...p)},r,i);const u=Bw(o.serialize),d=()=>{const p=o.partialize({...r()});let O;const v=u({state:p,version:o.version}).then(y=>c.setItem(o.name,y)).catch(y=>{O=y});if(O)throw O;return v},f=i.setState;i.setState=(p,O)=>{f(p,O),d()};const h=t((...p)=>{n(...p),d()},r,i);let m;const g=()=>{var p;if(!c)return;s=!1,a.forEach(v=>v(r()));const O=((p=o.onRehydrateStorage)==null?void 0:p.call(o,r()))||void 0;return Bw(c.getItem.bind(c))(o.name).then(v=>{if(v)return o.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return o.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var y;return m=o.merge(v,(y=r())!=null?y:h),n(m,!0),d()}).then(()=>{O==null||O(m,void 0),s=!0,l.forEach(v=>v(m))}).catch(v=>{O==null||O(void 0,v)})};return i.persist={setOptions:p=>{o={...o,...p},p.getStorage&&(c=p.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>g(),hasHydrated:()=>s,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(l.add(p),()=>{l.delete(p)})},g(),m||h},L$e=M$e,U$e=(t,e)=>{const n={};return Object.keys(t.getState()).forEach(r=>{n[r]=i=>{if(t.getState()[r]===i)return;const s=r.replace(/^\S/,a=>a.toUpperCase());t.setState(a=>{a[r]=i},`@@${e}/set${s}`)}}),n},q$e=(t,e)=>{const n=t(e.set,e.get,e);return{...e,set:{...e.set,...n}}},W$e=(t,e)=>{const n={...e.use},r={...e.useTracked},i={...e.get};return Object.keys(t(e.store.getState(),e.get,e)).forEach(o=>{n[o]=(...s)=>e.useStore(a=>{const c=t(a,e.get,e)[o];return c(...s)}),r[o]=(...s)=>{const a=e.useTrackedStore(),c=t(a,e.get,e)[o];return c(...s)},i[o]=(...s)=>{const l=t(e.store.getState(),e.get,e)[o];return l(...s)}}),{...e,get:i,use:n,useTracked:r}},nR=t=>({...t,extendSelectors:e=>nR(W$e(e,t)),extendActions:e=>nR(q$e(e,t))}),B$e=t=>{const e={};return Object.keys(t.getState()).forEach(n=>{e[n]=()=>t.getState()[n]}),e},Y$e=t=>{const e={};return Object.keys(t.getState()).forEach(n=>{e[n]=r=>t(i=>i[n],r)}),e},F$e=(t,e)=>{const n={};return Object.keys(t.getState()).forEach(r=>{n[r]=()=>e()[r]}),n},V$e=t=>(e,n,r)=>{const i=(o,s)=>e(l$e(o),!0,s);return r.setState=i,t(i,n,r)};function Z$e(t,...e){return e.reduce((n,r)=>r(n),t)}const ry=t=>(e,n={})=>{var r;const{middlewares:i=[],devtools:o,persist:s,immer:a}=n;c$e((r=a==null?void 0:a.enabledAutoFreeze)!==null&&r!==void 0?r:!1),a!=null&&a.enableMapSet&&n$e();const l=[V$e,...i];if(s!=null&&s.enabled){var c;const w={...s,name:(c=s.name)!==null&&c!==void 0?c:t};l.push(S=>L$e(S,w))}o!=null&&o.enabled&&l.push(w=>z$e(w,{...o,name:t})),l.push(QK);const d=(w=>Z$e(w,...l))(()=>e),f=D$e(d),h=U$e(f,t),m=(w,S)=>{d.setState(Q=>{Object.assign(Q,w)},S||`@@${t}/mergeState`)},g=(w,S)=>{d.setState(w,S||`@@${t}/setState`)},p=Y$e(f),O=B$e(f),v=O$e(f),y=F$e(f,v),_={get:{state:d.getState,...O},name:t,set:{state:g,mergeState:m,...h},store:d,use:p,useTracked:y,useStore:f,useTrackedStore:v,extendSelectors:()=>_,extendActions:()=>_};return nR(_)};var W$=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function RK(t,e){return e={exports:{}},t(e,e.exports),e.exports}var j$e=typeof W$=="object"&&W$&&W$.Object===Object&&W$,AK=j$e,G$e=typeof self=="object"&&self&&self.Object===Object&&self,H$e=AK||G$e||Function("return this")(),Jd=H$e,K$e=Jd.Symbol,dh=K$e,IK=Object.prototype,J$e=IK.hasOwnProperty,e_e=IK.toString,F0=dh?dh.toStringTag:void 0;function t_e(t){var e=J$e.call(t,F0),n=t[F0];try{t[F0]=void 0;var r=!0}catch{}var i=e_e.call(t);return r&&(e?t[F0]=n:delete t[F0]),i}var n_e=t_e,r_e=Object.prototype,i_e=r_e.toString;function o_e(t){return i_e.call(t)}var s_e=o_e,a_e="[object Null]",l_e="[object Undefined]",jM=dh?dh.toStringTag:void 0;function c_e(t){return t==null?t===void 0?l_e:a_e:jM&&jM in Object(t)?n_e(t):s_e(t)}var Gg=c_e;function u_e(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var $A=u_e,d_e="[object AsyncFunction]",f_e="[object Function]",h_e="[object GeneratorFunction]",O_e="[object Proxy]";function p_e(t){if(!$A(t))return!1;var e=Gg(t);return e==f_e||e==h_e||e==d_e||e==O_e}var XK=p_e,m_e=Jd["__core-js_shared__"],c4=m_e,GM=function(){var t=/[^.]+$/.exec(c4&&c4.keys&&c4.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function g_e(t){return!!GM&&GM in t}var v_e=g_e,b_e=Function.prototype,y_e=b_e.toString;function $_e(t){if(t!=null){try{return y_e.call(t)}catch{}try{return t+""}catch{}}return""}var sp=$_e,__e=/[\\^$.*+?()[\]{}|]/g,S_e=/^\[object .+?Constructor\]$/,w_e=Function.prototype,x_e=Object.prototype,k_e=w_e.toString,Q_e=x_e.hasOwnProperty,P_e=RegExp("^"+k_e.call(Q_e).replace(__e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function T_e(t){if(!$A(t)||v_e(t))return!1;var e=XK(t)?P_e:S_e;return e.test(sp(t))}var C_e=T_e;function E_e(t,e){return t==null?void 0:t[e]}var R_e=E_e;function A_e(t,e){var n=R_e(t,e);return C_e(n)?n:void 0}var ap=A_e,I_e=function(){try{var t=ap(Object,"defineProperty");return t({},"",{}),t}catch{}}(),HM=I_e;function X_e(t,e,n){e=="__proto__"&&HM?HM(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var D_e=X_e;function N_e(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(n(o[l],l,o)===!1)break}return e}}var z_e=N_e,M_e=z_e(),L_e=M_e;function U_e(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var q_e=U_e;function W_e(t){return t!=null&&typeof t=="object"}var hg=W_e,B_e="[object Arguments]";function Y_e(t){return hg(t)&&Gg(t)==B_e}var KM=Y_e,DK=Object.prototype,F_e=DK.hasOwnProperty,V_e=DK.propertyIsEnumerable,Z_e=KM(function(){return arguments}())?KM:function(t){return hg(t)&&F_e.call(t,"callee")&&!V_e.call(t,"callee")},NK=Z_e,j_e=Array.isArray,Zd=j_e;function G_e(){return!1}var H_e=G_e,rR=RK(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===n,o=i?Jd.Buffer:void 0,s=o?o.isBuffer:void 0,a=s||H_e;t.exports=a}),K_e=9007199254740991,J_e=/^(?:0|[1-9]\d*)$/;function eSe(t,e){var n=typeof t;return e=e==null?K_e:e,!!e&&(n=="number"||n!="symbol"&&J_e.test(t))&&t>-1&&t%1==0&&t<e}var zK=eSe,tSe=9007199254740991;function nSe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=tSe}var _A=nSe,rSe="[object Arguments]",iSe="[object Array]",oSe="[object Boolean]",sSe="[object Date]",aSe="[object Error]",lSe="[object Function]",cSe="[object Map]",uSe="[object Number]",dSe="[object Object]",fSe="[object RegExp]",hSe="[object Set]",OSe="[object String]",pSe="[object WeakMap]",mSe="[object ArrayBuffer]",gSe="[object DataView]",vSe="[object Float32Array]",bSe="[object Float64Array]",ySe="[object Int8Array]",$Se="[object Int16Array]",_Se="[object Int32Array]",SSe="[object Uint8Array]",wSe="[object Uint8ClampedArray]",xSe="[object Uint16Array]",kSe="[object Uint32Array]",Ti={};Ti[vSe]=Ti[bSe]=Ti[ySe]=Ti[$Se]=Ti[_Se]=Ti[SSe]=Ti[wSe]=Ti[xSe]=Ti[kSe]=!0;Ti[rSe]=Ti[iSe]=Ti[mSe]=Ti[oSe]=Ti[gSe]=Ti[sSe]=Ti[aSe]=Ti[lSe]=Ti[cSe]=Ti[uSe]=Ti[dSe]=Ti[fSe]=Ti[hSe]=Ti[OSe]=Ti[pSe]=!1;function QSe(t){return hg(t)&&_A(t.length)&&!!Ti[Gg(t)]}var PSe=QSe;function TSe(t){return function(e){return t(e)}}var CSe=TSe,JM=RK(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===n,o=i&&AK.process,s=function(){try{var a=r&&r.require&&r.require("util").types;return a||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s}),eL=JM&&JM.isTypedArray,ESe=eL?CSe(eL):PSe,MK=ESe,RSe=Object.prototype,ASe=RSe.hasOwnProperty;function ISe(t,e){var n=Zd(t),r=!n&&NK(t),i=!n&&!r&&rR(t),o=!n&&!r&&!i&&MK(t),s=n||r||i||o,a=s?q_e(t.length,String):[],l=a.length;for(var c in t)(e||ASe.call(t,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||zK(c,l)))&&a.push(c);return a}var XSe=ISe,DSe=Object.prototype;function NSe(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||DSe;return t===n}var zSe=NSe;function MSe(t,e){return function(n){return t(e(n))}}var LSe=MSe,USe=LSe(Object.keys,Object),qSe=USe,WSe=Object.prototype,BSe=WSe.hasOwnProperty;function YSe(t){if(!zSe(t))return qSe(t);var e=[];for(var n in Object(t))BSe.call(t,n)&&n!="constructor"&&e.push(n);return e}var FSe=YSe;function VSe(t){return t!=null&&_A(t.length)&&!XK(t)}var ZSe=VSe;function jSe(t){return ZSe(t)?XSe(t):FSe(t)}var SA=jSe;function GSe(t,e){return t&&L_e(t,e,SA)}var HSe=GSe;function KSe(){this.__data__=[],this.size=0}var JSe=KSe;function ewe(t,e){return t===e||t!==t&&e!==e}var LK=ewe;function twe(t,e){for(var n=t.length;n--;)if(LK(t[n][0],e))return n;return-1}var pQ=twe,nwe=Array.prototype,rwe=nwe.splice;function iwe(t){var e=this.__data__,n=pQ(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():rwe.call(e,n,1),--this.size,!0}var owe=iwe;function swe(t){var e=this.__data__,n=pQ(e,t);return n<0?void 0:e[n][1]}var awe=swe;function lwe(t){return pQ(this.__data__,t)>-1}var cwe=lwe;function uwe(t,e){var n=this.__data__,r=pQ(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var dwe=uwe;function Hg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Hg.prototype.clear=JSe;Hg.prototype.delete=owe;Hg.prototype.get=awe;Hg.prototype.has=cwe;Hg.prototype.set=dwe;var mQ=Hg;function fwe(){this.__data__=new mQ,this.size=0}var hwe=fwe;function Owe(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var pwe=Owe;function mwe(t){return this.__data__.get(t)}var gwe=mwe;function vwe(t){return this.__data__.has(t)}var bwe=vwe,ywe=ap(Jd,"Map"),Y1=ywe,$we=ap(Object,"create"),F1=$we;function _we(){this.__data__=F1?F1(null):{},this.size=0}var Swe=_we;function wwe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var xwe=wwe,kwe="__lodash_hash_undefined__",Qwe=Object.prototype,Pwe=Qwe.hasOwnProperty;function Twe(t){var e=this.__data__;if(F1){var n=e[t];return n===kwe?void 0:n}return Pwe.call(e,t)?e[t]:void 0}var Cwe=Twe,Ewe=Object.prototype,Rwe=Ewe.hasOwnProperty;function Awe(t){var e=this.__data__;return F1?e[t]!==void 0:Rwe.call(e,t)}var Iwe=Awe,Xwe="__lodash_hash_undefined__";function Dwe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=F1&&e===void 0?Xwe:e,this}var Nwe=Dwe;function Kg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Kg.prototype.clear=Swe;Kg.prototype.delete=xwe;Kg.prototype.get=Cwe;Kg.prototype.has=Iwe;Kg.prototype.set=Nwe;var tL=Kg;function zwe(){this.size=0,this.__data__={hash:new tL,map:new(Y1||mQ),string:new tL}}var Mwe=zwe;function Lwe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Uwe=Lwe;function qwe(t,e){var n=t.__data__;return Uwe(e)?n[typeof e=="string"?"string":"hash"]:n.map}var gQ=qwe;function Wwe(t){var e=gQ(this,t).delete(t);return this.size-=e?1:0,e}var Bwe=Wwe;function Ywe(t){return gQ(this,t).get(t)}var Fwe=Ywe;function Vwe(t){return gQ(this,t).has(t)}var Zwe=Vwe;function jwe(t,e){var n=gQ(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var Gwe=jwe;function Jg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Jg.prototype.clear=Mwe;Jg.prototype.delete=Bwe;Jg.prototype.get=Fwe;Jg.prototype.has=Zwe;Jg.prototype.set=Gwe;var vQ=Jg,Hwe=200;function Kwe(t,e){var n=this.__data__;if(n instanceof mQ){var r=n.__data__;if(!Y1||r.length<Hwe-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new vQ(r)}return n.set(t,e),this.size=n.size,this}var Jwe=Kwe;function e0(t){var e=this.__data__=new mQ(t);this.size=e.size}e0.prototype.clear=hwe;e0.prototype.delete=pwe;e0.prototype.get=gwe;e0.prototype.has=bwe;e0.prototype.set=Jwe;var CS=e0,exe="__lodash_hash_undefined__";function txe(t){return this.__data__.set(t,exe),this}var nxe=txe;function rxe(t){return this.__data__.has(t)}var ixe=rxe;function Yw(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new vQ;++e<n;)this.add(t[e])}Yw.prototype.add=Yw.prototype.push=nxe;Yw.prototype.has=ixe;var oxe=Yw;function sxe(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var axe=sxe;function lxe(t,e){return t.has(e)}var cxe=lxe,uxe=1,dxe=2;function fxe(t,e,n,r,i,o){var s=n&uxe,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,h=n&dxe?new oxe:void 0;for(o.set(t,e),o.set(e,t);++d<a;){var m=t[d],g=e[d];if(r)var p=s?r(g,m,d,e,t,o):r(m,g,d,t,e,o);if(p!==void 0){if(p)continue;f=!1;break}if(h){if(!axe(e,function(O,v){if(!cxe(h,v)&&(m===O||i(m,O,n,r,o)))return h.push(v)})){f=!1;break}}else if(!(m===g||i(m,g,n,r,o))){f=!1;break}}return o.delete(t),o.delete(e),f}var UK=fxe,hxe=Jd.Uint8Array,nL=hxe;function Oxe(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var pxe=Oxe;function mxe(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var gxe=mxe,vxe=1,bxe=2,yxe="[object Boolean]",$xe="[object Date]",_xe="[object Error]",Sxe="[object Map]",wxe="[object Number]",xxe="[object RegExp]",kxe="[object Set]",Qxe="[object String]",Pxe="[object Symbol]",Txe="[object ArrayBuffer]",Cxe="[object DataView]",rL=dh?dh.prototype:void 0,u4=rL?rL.valueOf:void 0;function Exe(t,e,n,r,i,o,s){switch(n){case Cxe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Txe:return!(t.byteLength!=e.byteLength||!o(new nL(t),new nL(e)));case yxe:case $xe:case wxe:return LK(+t,+e);case _xe:return t.name==e.name&&t.message==e.message;case xxe:case Qxe:return t==e+"";case Sxe:var a=pxe;case kxe:var l=r&vxe;if(a||(a=gxe),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=bxe,s.set(t,e);var u=UK(a(t),a(e),r,i,o,s);return s.delete(t),u;case Pxe:if(u4)return u4.call(t)==u4.call(e)}return!1}var Rxe=Exe;function Axe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Ixe=Axe;function Xxe(t,e,n){var r=e(t);return Zd(t)?r:Ixe(r,n(t))}var Dxe=Xxe;function Nxe(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var zxe=Nxe;function Mxe(){return[]}var Lxe=Mxe,Uxe=Object.prototype,qxe=Uxe.propertyIsEnumerable,iL=Object.getOwnPropertySymbols,Wxe=iL?function(t){return t==null?[]:(t=Object(t),zxe(iL(t),function(e){return qxe.call(t,e)}))}:Lxe,Bxe=Wxe;function Yxe(t){return Dxe(t,SA,Bxe)}var oL=Yxe,Fxe=1,Vxe=Object.prototype,Zxe=Vxe.hasOwnProperty;function jxe(t,e,n,r,i,o){var s=n&Fxe,a=oL(t),l=a.length,c=oL(e),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var f=a[d];if(!(s?f in e:Zxe.call(e,f)))return!1}var h=o.get(t),m=o.get(e);if(h&&m)return h==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var p=s;++d<l;){f=a[d];var O=t[f],v=e[f];if(r)var y=s?r(v,O,f,e,t,o):r(O,v,f,t,e,o);if(!(y===void 0?O===v||i(O,v,n,r,o):y)){g=!1;break}p||(p=f=="constructor")}if(g&&!p){var _=t.constructor,w=e.constructor;_!=w&&"constructor"in t&&"constructor"in e&&!(typeof _=="function"&&_ instanceof _&&typeof w=="function"&&w instanceof w)&&(g=!1)}return o.delete(t),o.delete(e),g}var Gxe=jxe,Hxe=ap(Jd,"DataView"),iR=Hxe,Kxe=ap(Jd,"Promise"),oR=Kxe,Jxe=ap(Jd,"Set"),sR=Jxe,eke=ap(Jd,"WeakMap"),aR=eke,sL="[object Map]",tke="[object Object]",aL="[object Promise]",lL="[object Set]",cL="[object WeakMap]",uL="[object DataView]",nke=sp(iR),rke=sp(Y1),ike=sp(oR),oke=sp(sR),ske=sp(aR),lO=Gg;(iR&&lO(new iR(new ArrayBuffer(1)))!=uL||Y1&&lO(new Y1)!=sL||oR&&lO(oR.resolve())!=aL||sR&&lO(new sR)!=lL||aR&&lO(new aR)!=cL)&&(lO=function(t){var e=Gg(t),n=e==tke?t.constructor:void 0,r=n?sp(n):"";if(r)switch(r){case nke:return uL;case rke:return sL;case ike:return aL;case oke:return lL;case ske:return cL}return e});var dL=lO,ake=1,fL="[object Arguments]",hL="[object Array]",B$="[object Object]",lke=Object.prototype,OL=lke.hasOwnProperty;function cke(t,e,n,r,i,o){var s=Zd(t),a=Zd(e),l=s?hL:dL(t),c=a?hL:dL(e);l=l==fL?B$:l,c=c==fL?B$:c;var u=l==B$,d=c==B$,f=l==c;if(f&&rR(t)){if(!rR(e))return!1;s=!0,u=!1}if(f&&!u)return o||(o=new CS),s||MK(t)?UK(t,e,n,r,i,o):Rxe(t,e,l,n,r,i,o);if(!(n&ake)){var h=u&&OL.call(t,"__wrapped__"),m=d&&OL.call(e,"__wrapped__");if(h||m){var g=h?t.value():t,p=m?e.value():e;return o||(o=new CS),i(g,p,n,r,o)}}return f?(o||(o=new CS),Gxe(t,e,n,r,i,o)):!1}var uke=cke;function qK(t,e,n,r,i){return t===e?!0:t==null||e==null||!hg(t)&&!hg(e)?t!==t&&e!==e:uke(t,e,n,r,qK,i)}var WK=qK,dke=1,fke=2;function hke(t,e,n,r){var i=n.length,o=i,s=!r;if(t==null)return!o;for(t=Object(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(c===void 0&&!(l in t))return!1}else{var d=new CS;if(r)var f=r(c,u,l,t,e,d);if(!(f===void 0?WK(u,c,dke|fke,r,d):f))return!1}}return!0}var Oke=hke;function pke(t){return t===t&&!$A(t)}var BK=pke;function mke(t){for(var e=SA(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,BK(i)]}return e}var gke=mke;function vke(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var YK=vke;function bke(t){var e=gke(t);return e.length==1&&e[0][2]?YK(e[0][0],e[0][1]):function(n){return n===t||Oke(n,t,e)}}var yke=bke,$ke="[object Symbol]";function _ke(t){return typeof t=="symbol"||hg(t)&&Gg(t)==$ke}var wA=_ke,Ske=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wke=/^\w*$/;function xke(t,e){if(Zd(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||wA(t)?!0:wke.test(t)||!Ske.test(t)||e!=null&&t in Object(e)}var xA=xke,kke="Expected a function";function kA(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(kke);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(kA.Cache||vQ),n}kA.Cache=vQ;var Qke=kA,Pke=500;function Tke(t){var e=Qke(t,function(r){return n.size===Pke&&n.clear(),r}),n=e.cache;return e}var Cke=Tke,Eke=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rke=/\\(\\)?/g,Ake=Cke(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Eke,function(n,r,i,o){e.push(i?o.replace(Rke,"$1"):r||n)}),e}),Ike=Ake;function Xke(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Dke=Xke,Nke=1/0,pL=dh?dh.prototype:void 0,mL=pL?pL.toString:void 0;function FK(t){if(typeof t=="string")return t;if(Zd(t))return Dke(t,FK)+"";if(wA(t))return mL?mL.call(t):"";var e=t+"";return e=="0"&&1/t==-Nke?"-0":e}var zke=FK;function Mke(t){return t==null?"":zke(t)}var Lke=Mke;function Uke(t,e){return Zd(t)?t:xA(t,e)?[t]:Ike(Lke(t))}var VK=Uke,qke=1/0;function Wke(t){if(typeof t=="string"||wA(t))return t;var e=t+"";return e=="0"&&1/t==-qke?"-0":e}var bQ=Wke;function Bke(t,e){e=VK(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[bQ(e[n++])];return n&&n==r?t:void 0}var ZK=Bke;function Yke(t,e,n){var r=t==null?void 0:ZK(t,e);return r===void 0?n:r}var Fke=Yke;function Vke(t,e){return t!=null&&e in Object(t)}var Zke=Vke;function jke(t,e,n){e=VK(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var s=bQ(e[r]);if(!(o=t!=null&&n(t,s)))break;t=t[s]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&_A(i)&&zK(s,i)&&(Zd(t)||NK(t)))}var Gke=jke;function Hke(t,e){return t!=null&&Gke(t,e,Zke)}var Kke=Hke,Jke=1,eQe=2;function tQe(t,e){return xA(t)&&BK(e)?YK(bQ(t),e):function(n){var r=Fke(n,t);return r===void 0&&r===e?Kke(n,t):WK(e,r,Jke|eQe)}}var nQe=tQe;function rQe(t){return t}var iQe=rQe;function oQe(t){return function(e){return e==null?void 0:e[t]}}var sQe=oQe;function aQe(t){return function(e){return ZK(e,t)}}var lQe=aQe;function cQe(t){return xA(t)?sQe(bQ(t)):lQe(t)}var uQe=cQe;function dQe(t){return typeof t=="function"?t:t==null?iQe:typeof t=="object"?Zd(t)?nQe(t[0],t[1]):yke(t):uQe(t)}var fQe=dQe;function hQe(t,e){var n={};return e=fQe(e),HSe(t,function(r,i,o){D_e(n,i,e(r,i,o))}),n}var OQe=hQe;const yQ=(t,e)=>OQe(e,n=>n[t]),Wu=Object.create(null);Wu.open="0";Wu.close="1";Wu.ping="2";Wu.pong="3";Wu.message="4";Wu.upgrade="5";Wu.noop="6";const ES=Object.create(null);Object.keys(Wu).forEach(t=>{ES[Wu[t]]=t});const lR={type:"error",data:"parser error"},jK=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",GK=typeof ArrayBuffer=="function",HK=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,QA=({type:t,data:e},n,r)=>jK&&e instanceof Blob?n?r(e):gL(e,r):GK&&(e instanceof ArrayBuffer||HK(e))?n?r(e):gL(new Blob([e]),r):r(Wu[t]+(e||"")),gL=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function vL(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let d4;function pQe(t,e){if(jK&&t.data instanceof Blob)return t.data.arrayBuffer().then(vL).then(e);if(GK&&(t.data instanceof ArrayBuffer||HK(t.data)))return e(vL(t.data));QA(t,!1,n=>{d4||(d4=new TextEncoder),e(d4.encode(n))})}const bL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wv=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let t=0;t<bL.length;t++)wv[bL.charCodeAt(t)]=t;const mQe=t=>{let e=t.length*.75,n=t.length,r,i=0,o,s,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),u=new Uint8Array(c);for(r=0;r<n;r+=4)o=wv[t.charCodeAt(r)],s=wv[t.charCodeAt(r+1)],a=wv[t.charCodeAt(r+2)],l=wv[t.charCodeAt(r+3)],u[i++]=o<<2|s>>4,u[i++]=(s&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c},gQe=typeof ArrayBuffer=="function",PA=(t,e)=>{if(typeof t!="string")return{type:"message",data:KK(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:vQe(t.substring(1),e)}:ES[n]?t.length>1?{type:ES[n],data:t.substring(1)}:{type:ES[n]}:lR},vQe=(t,e)=>{if(gQe){const n=mQe(t);return KK(n,e)}else return{base64:!0,data:t}},KK=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},JK=String.fromCharCode(30),bQe=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((o,s)=>{QA(o,!1,a=>{r[s]=a,++i===n&&e(r.join(JK))})})},yQe=(t,e)=>{const n=t.split(JK),r=[];for(let i=0;i<n.length;i++){const o=PA(n[i],e);if(r.push(o),o.type==="error")break}return r};function $Qe(){return new TransformStream({transform(t,e){pQe(t,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let f4;function Y$(t){return t.reduce((e,n)=>e+n.length,0)}function F$(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function _Qe(t,e){f4||(f4=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(r===0){if(Y$(n)<1)break;const l=F$(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Y$(n)<2)break;const l=F$(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Y$(n)<8)break;const l=F$(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,53-32)-1){a.enqueue(lR);break}i=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Y$(n)<i)break;const l=F$(n,i);a.enqueue(PA(o?l:f4.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(lR);break}}}})}const eJ=4;function Io(t){if(t)return SQe(t)}function SQe(t){for(var e in Io.prototype)t[e]=Io.prototype[e];return t}Io.prototype.on=Io.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Io.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};Io.prototype.off=Io.prototype.removeListener=Io.prototype.removeAllListeners=Io.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this};Io.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this};Io.prototype.emitReserved=Io.prototype.emit;Io.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Io.prototype.hasListeners=function(t){return!!this.listeners(t).length};const $Q=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),ec=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")())(),wQe="arraybuffer";function tJ(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const xQe=ec.setTimeout,kQe=ec.clearTimeout;function _Q(t,e){e.useNativeTimers?(t.setTimeoutFn=xQe.bind(ec),t.clearTimeoutFn=kQe.bind(ec)):(t.setTimeoutFn=ec.setTimeout.bind(ec),t.clearTimeoutFn=ec.clearTimeout.bind(ec))}const QQe=1.33;function PQe(t){return typeof t=="string"?TQe(t):Math.ceil((t.byteLength||t.size)*QQe)}function TQe(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function nJ(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function CQe(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function EQe(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class RQe extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class TA extends Io{constructor(e){super(),this.writable=!1,_Q(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new RQe(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=PA(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=CQe(e);return n.length?"?"+n:""}}class AQe extends TA{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};yQe(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,bQe(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=nJ()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let rJ=!1;try{rJ=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch{}const IQe=rJ;function XQe(){}class DQe extends AQe{constructor(e){if(super(e),typeof location!="undefined"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}class zu extends Io{constructor(e,n,r){super(),this.createRequest=e,_Q(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=tJ(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document!="undefined"&&(this._index=zu.requestsCount++,zu.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr=="undefined"||this._xhr===null)){if(this._xhr.onreadystatechange=XQe,e)try{this._xhr.abort()}catch{}typeof document!="undefined"&&delete zu.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}zu.requestsCount=0;zu.requests={};if(typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",yL);else if(typeof addEventListener=="function"){const t="onpagehide"in ec?"pagehide":"unload";addEventListener(t,yL,!1)}}function yL(){for(let t in zu.requests)zu.requests.hasOwnProperty(t)&&zu.requests[t].abort()}const NQe=function(){const t=iJ({xdomain:!1});return t&&t.responseType!==null}();class zQe extends DQe{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=NQe&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new zu(iJ,this.uri(),e)}}function iJ(t){const e=t.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!e||IQe))return new XMLHttpRequest}catch{}if(!e)try{return new ec[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const oJ=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class MQe extends TA{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=oJ?{}:tJ(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;QA(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}i&&$Q(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=nJ()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const h4=ec.WebSocket||ec.MozWebSocket;class LQe extends MQe{createSocket(e,n,r){return oJ?new h4(e,n,r):n?new h4(e,n):new h4(e)}doWrite(e,n){this.ws.send(n)}}class UQe extends TA{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=_Qe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=$Qe();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const o=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),o())}).catch(a=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this._writer.write(r).then(()=>{i&&$Q(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const qQe={websocket:LQe,webtransport:UQe,polling:zQe},WQe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,BQe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function cR(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=WQe.exec(t||""),o={},s=14;for(;s--;)o[BQe[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=YQe(o,o.path),o.queryKey=FQe(o,o.query),o}function YQe(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function FQe(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}const uR=typeof addEventListener=="function"&&typeof removeEventListener=="function",RS=[];uR&&addEventListener("offline",()=>{RS.forEach(t=>t())},!1);class sh extends Io{constructor(e,n){if(super(),this.binaryType=wQe,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=cR(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=cR(n.host).host);_Q(this,n),this.secure=n.secure!=null?n.secure:typeof location!="undefined"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=n.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=EQe(this.opts.query)),uR&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},RS.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=eJ,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&sh.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",sh.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=PQe(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,$Q(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:e,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(sh.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),uR&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=RS.indexOf(this._offlineEventListener);r!==-1&&RS.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}sh.protocol=eJ;class VQe extends sh{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;sh.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;sh.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const s=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function a(){s("transport closed")}function l(){s("socket closed")}function c(d){n&&d.name!==n.name&&o()}const u=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}class ZQe extends VQe{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>qQe[i]).filter(i=>!!i)),super(e,r)}}function jQe(t,e="",n){let r=t;n=n||typeof location!="undefined"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n!="undefined"?t=n.protocol+"//"+t:t="https://"+t),r=cR(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+e,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const GQe=typeof ArrayBuffer=="function",HQe=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,sJ=Object.prototype.toString,KQe=typeof Blob=="function"||typeof Blob!="undefined"&&sJ.call(Blob)==="[object BlobConstructor]",JQe=typeof File=="function"||typeof File!="undefined"&&sJ.call(File)==="[object FileConstructor]";function CA(t){return GQe&&(t instanceof ArrayBuffer||HQe(t))||KQe&&t instanceof Blob||JQe&&t instanceof File}function AS(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(AS(t[n]))return!0;return!1}if(CA(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return AS(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&AS(t[n]))return!0;return!1}function e2e(t){const e=[],n=t.data,r=t;return r.data=dR(n,e),r.attachments=e.length,{packet:r,buffers:e}}function dR(t,e){if(!t)return t;if(CA(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=dR(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=dR(t[r],e));return n}return t}function t2e(t,e){return t.data=fR(t.data,e),delete t.attachments,t}function fR(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=fR(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=fR(t[n],e));return t}const aJ=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],n2e=5;var Hn;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Hn||(Hn={}));class r2e{constructor(e){this.replacer=e}encode(e){return(e.type===Hn.EVENT||e.type===Hn.ACK)&&AS(e)?this.encodeAsBinary({type:e.type===Hn.EVENT?Hn.BINARY_EVENT:Hn.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===Hn.BINARY_EVENT||e.type===Hn.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=e2e(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class EA extends Io{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===Hn.BINARY_EVENT;r||n.type===Hn.BINARY_ACK?(n.type=r?Hn.EVENT:Hn.ACK,this.reconstructor=new i2e(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(CA(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(Hn[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Hn.BINARY_EVENT||r.type===Hn.BINARY_ACK){const o=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const s=e.substring(o,n);if(s!=Number(s)||e.charAt(n)!=="-")throw new Error("Illegal attachments");const a=Number(s);if(!lJ(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=a}if(e.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(o,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=e.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===e.length)break}r.id=Number(e.substring(o,n+1))}if(e.charAt(++n)){const o=this.tryParse(e.substr(n));if(EA.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case Hn.CONNECT:return Fw(n);case Hn.DISCONNECT:return n===void 0;case Hn.CONNECT_ERROR:return typeof n=="string"||Fw(n);case Hn.EVENT:case Hn.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&aJ.indexOf(n[0])===-1);case Hn.ACK:case Hn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class i2e{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=t2e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function o2e(t){return typeof t=="string"}const lJ=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};function s2e(t){return t===void 0||lJ(t)}function Fw(t){return Object.prototype.toString.call(t)==="[object Object]"}function a2e(t,e){switch(t){case Hn.CONNECT:return e===void 0||Fw(e);case Hn.DISCONNECT:return e===void 0;case Hn.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&aJ.indexOf(e[0])===-1);case Hn.ACK:return Array.isArray(e);case Hn.CONNECT_ERROR:return typeof e=="string"||Fw(e);default:return!1}}function l2e(t){return o2e(t.nsp)&&s2e(t.id)&&a2e(t.type,t.data)}var c2e=Object.freeze(Object.defineProperty({__proto__:null,protocol:n2e,get PacketType(){return Hn},Encoder:r2e,Decoder:EA,isPacketValid:l2e},Symbol.toStringTag,{value:"Module"}));function zc(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const u2e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class cJ extends Io{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[zc(e,"open",this.onopen.bind(this)),zc(e,"packet",this.onpacket.bind(this)),zc(e,"error",this.onerror.bind(this)),zc(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,i,o;if(u2e.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const s={type:Hn.EVENT,data:n};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,d=n.pop();this._registerAckCallback(u,d),s.id=u}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),s=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,a)};s.withError=!0,this.acks[e]=s}emitWithAck(e,...n){return new Promise((r,i)=>{const o=(s,a)=>s?i(s):r(a);o.withError=!0,n.push(o),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Hn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Hn.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Hn.EVENT:case Hn.BINARY_EVENT:this.onevent(e);break;case Hn.ACK:case Hn.BINARY_ACK:this.onack(e);break;case Hn.DISCONNECT:this.ondisconnect();break;case Hn.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Hn.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Hn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function t0(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t0.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};t0.prototype.reset=function(){this.attempts=0};t0.prototype.setMin=function(t){this.ms=t};t0.prototype.setMax=function(t){this.max=t};t0.prototype.setJitter=function(t){this.jitter=t};class hR extends Io{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,_Q(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new t0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||c2e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new ZQe(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=zc(n,"open",function(){r.onopen(),e&&e()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},s=zc(n,"error",o);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(zc(e,"ping",this.onping.bind(this)),zc(e,"data",this.ondata.bind(this)),zc(e,"error",this.onerror.bind(this)),zc(e,"close",this.onclose.bind(this)),zc(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){$Q(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new cJ(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const V0={};function IS(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=jQe(t,e.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=V0[i]&&o in V0[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let l;return a?l=new hR(r,e):(V0[i]||(V0[i]=new hR(r,e)),l=V0[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(IS,{Manager:hR,Socket:cJ,io:IS,connect:IS});var nt=(t=>(t.RunUnitTestStatus="runUnitTestStatus",t.RunUnitTestResult="runUnitTestResult",t.StopUnitTestResult="stopUnitTestResult",t.RumCmdResult="rumCmdResult",t.StopRunCmdResult="stopRunCmdResult",t.InitError="initError",t.UnFocusEditor="unFocusEditor",t.FileOpenDone="fileOpenDone",t.PreviewImage="previewImage",t.ReplaceCodeDone="replaceCodeDone",t.FileTreeAction="fileTreeAction",t.Loading="loading",t.OpenLimitFile="openLimitFile",t.Ready="ready",t.Offline="offline",t.Online="online",t.Reconnecting="reconnecting",t.StatusChanged="statusChanged",t.UnitTestRunResult="unitTestRunResult",t.PausePlayback="pausePlayback",t.LspStatusChanged="lspStatusChanged",t.PlaygroundChanged="playgroundChanged",t.Following="following",t.UnFollowing="unFollowing",t.StopLSPServer="stopLSPServer",t.RunStatusChanged="runStatusChanged",t.FileStructureChanged="fileStructureChanged",t.FileContentChanged="fileContentChanged",t.AppendToConsole="appendToConsole",t.AppendToTerminal="appendToTerminal",t.ApplicationAvailable="ApplicationAvailable",t.PlaybackInfo="playbackInfo",t.ReplayStart="ReplayStart",t.ReplayEnd="ReplayEnd",t.Customize="customize",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.EditorScroll="editorScroll",t.ConnectionBroken="connectionBroken",t.ConnectionFailed="connectionFailed",t.AuthorizationFailed="authorizationFailed",t.FileStructureDamaged="fileStructureDamaged",t.ErrorFromServer="errorFromServer",t.AppendCustomizeFrameData="appendCustomizeFrameData",t.LineAction="lineAction",t.FileInfo="fileInfo",t.InsertTextById="insertTextById",t.ReplaceCodeById="replaceCodeById",t.UpdateAreaFlags="updateAreaFlags",t.Debug="debug",t.JumpToAreaById="jumpToAreaById",t.Xterm="xterm",t.ResourceMonitoring="resourceMonitoring",t.AnswerAreaOperate="answerAreaOperate",t.AnswerAreaInfo="answerAreaInfo",t.XtermInfo="xtermInfo",t.InsertCodeByCursorPosition="insertCodeByCursorPosition",t.ReplayCodeByRange="replayCodeByRange",t.BehindTooMuch="behindTooMuch",t.CloseRunLoading="closeRunLoading",t.DevtoolStatusChange="devtoolStatusChange",t.ShowPreviewMDIframe="showPreviewMDIframe",t))(nt||{}),Dn=(t=>(t.GetUnitTestFun="getUnitTestFun",t.OpenFileByFollow="openFileByFollow",t.RunUnitTestResult="runUnitTestResult",t.StopUnitTest="stopUnitTest",t.StopRunCmd="stopRunCmd",t.RunCmd="rumCmd",t.RunCmdResult="rumCmdResult",t.RetainingAllFiles="retainingAllFiles",t.Authorize="auth",t.LiveBrowser="liveBrowser",t.RRWeb="rrweb",t.Active="active",t.Run="run",t.Stop="stop",t.Heartbeat="heartbeat",t.SetFileLockStatus="",t.SetFileVisiable="",t.AddFileToUnitTest="",t.RemoveFileFromUnitTest="",t.KeyEvent="keyEvent",t.File="file",t.CloseFile="closeFile",t.EditFile="editFile",t.FileTree="fileTree",t.FileSearchKeyword="fileSearchKeyword",t.Terminal="terminal",t.ClaudeCode="claudecode",t.XtermStatus="XtermStatus",t.Cursor="cursor",t.GetPlaybackInfo="getPlaybackInfo",t.LoadPlaybackData="loadPlaybackData",t.FollowingAgentUser="followingAgentUser",t.UnFollowingAgentUser="unFollowingAgentUser",t.FollowingFocusComponent="followingFocusComponent",t.EditorScroll="editorScroll",t.CustomizeFrameData="appendCustomizeFrameData",t.AddCDNSource="addCDNSource",t.RestartServer="restartServer",t.RestartLSPServer="restartLSPServer",t.StopLSPServer="stopLSPServer",t.SwitchLanguage="switchLanguage",t.StatisticsPlaybackData="statisticsPlaybackData",t.ReconnectOnline="reconnectOnline",t))(Dn||{}),ot=(t=>(t.Connect="connect",t.Disconnect="disconnect",t.AuthAck="authAck",t.Active="active",t.StopLSPServer="stopLSPServer",t.SyncPlaygroundInfo="syncPlaygroundInfo",t.ChangePlaygroundInfo="changePlaygroundInfo",t.FileChange="fileChange",t.FileSearchKeyword="fileGrep",t.RunStatus="runStatus",t.LspStatus="lspStatus",t.UpdatePlaygroundInfo="updatePlaygroundInfo",t.Following="following",t.UnFollowing="unFollowing",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.FileWatchRefreshConfig="fileWatchRefreshConfig",t.ManualRefresh="manualRefresh",t.EditorBlur="editorBlur",t.ForceRefreshFile="forceRefreshFile",t.InitRRweb="initRRweb",t.Simulator="simulator",t.PlaybackInfo="playbackInfo",t.PlaybackData="playbackData",t.File="file",t.FileTree="fileTree",t.Run="run",t.Console="console",t.Terminal="terminal",t.ClaudeCode="claudecode",t.XtermStatus="XtermStatus",t.Editor="editor",t.Debug="debug",t.KeyEvent="keyEvent",t.CloseFile="closeFile",t.FocusComponent="FocusComponent",t.InvisibleComponentActive="InvisibleComponentActive",t.AppendCustomizeFrameData="appendCustomizeFrameData",t.TerminalStatus="terminalStatus",t.LspServerClientStateChange="lspServerClientStateChange",t.I18nLanguage="i18nLanguage",t.RegisterVirtualUser="registerVirtualUser",t.offlineVirtualUser="offlineVirtualUser",t.SwitchVirtualUser="switchVirtualUser",t.PushFormatCode="pushFormatCode",t.ResourceMonitoring="resourceMonitoring",t.CustomExecute="customExecute",t.SelectedUpdated="selectedUpdated",t.SetBreakPoint="setBreakPoint",t.DebugRun="debugRun",t.StoppedData="stoppedData",t.DebugNext="next",t.DebugContinue="continue",t.DebugStatus="debugStatus",t.DebugStepIn="stepIn",t.DebugStepOut="stepOut",t.Variables="variables",t.UpdateArea="updateArea",t.UpdateDebugSupport="updateDebugSupport",t.SyncDebugData="syncDebugData",t))(ot||{}),_O=(t=>(t.NotSupport="notSupport",t.Loading="loading",t.Running="running",t.Shutdown="shutdown",t.LspReady="lspReady",t.Uninitialized="uninitialized",t))(_O||{}),V$,d2e=new Uint8Array(16);function f2e(){if(!V$&&(V$=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!V$))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return V$(d2e)}var h2e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function O2e(t){return typeof t=="string"&&h2e.test(t)}var bs=[];for(var O4=0;O4<256;++O4)bs.push((O4+256).toString(16).substr(1));function p2e(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(bs[t[e+0]]+bs[t[e+1]]+bs[t[e+2]]+bs[t[e+3]]+"-"+bs[t[e+4]]+bs[t[e+5]]+"-"+bs[t[e+6]]+bs[t[e+7]]+"-"+bs[t[e+8]]+bs[t[e+9]]+"-"+bs[t[e+10]]+bs[t[e+11]]+bs[t[e+12]]+bs[t[e+13]]+bs[t[e+14]]+bs[t[e+15]]).toLowerCase();if(!O2e(n))throw TypeError("Stringified UUID is invalid");return n}function Xd(t,e,n){t=t||{};var r=t.random||(t.rng||f2e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return p2e(r)}class uJ{constructor(e,n=2e3){tt(this,"name");tt(this,"channel");tt(this,"_timeout");tt(this,"_messageId");tt(this,"_messages");tt(this,"_filter");this.name=e,this._messageId=0,this.channel=new BroadcastChannel(e),this.channel.onmessage=r=>this.receive(r),this._messages=[],this._timeout=n}setFilter(e){this._filter=e}send(e,n){const r=Xd(),i=new m2e(r,n||this._timeout),o=new Promise((s,a)=>{i._reject=a,i._resolve=s});return this._messages.push(i),this.channel.postMessage({id:r,type:"request",payload:e}),o}answer(e,n){this.channel.postMessage({id:e,type:"response",payload:n})}receive(e){const n=e.data;if(n.type==="request")(!this._filter||this._filter(n.payload))&&this.answer(n.id,{active:!0});else if(n.type==="response"){const r=this._messages.find(i=>i.id===n.id);r==null||r.reject(n.payload)}}}class m2e{constructor(e,n){tt(this,"_resolve");tt(this,"_reject");tt(this,"_interval");tt(this,"id");this.id=e,this._interval=setTimeout(()=>this.resolve({active:!1,reason:"timeout, no one uses it"}),n)}resolve(e){clearTimeout(this._interval),this._resolve(e)}reject(e){this._reject(e)}}let Sm,SO;async function $L(){SO||(SO=new uJ("dao-paas",200)),Sm="",SO.setFilter(n=>n.id===Sm);const t=JSON.parse(window.navigator.cookieEnabled&&localStorage.getItem("agentUsers")||"[]")||[],e=[];for(const n of t){const r=SO.send(n).then(()=>{if(Sm==="")return n.time=new Date().getTime(),Sm=n.id,window.navigator.cookieEnabled&&localStorage.setItem("agentUsers",JSON.stringify(t)),Promise.resolve(n)});e.push(r)}return Promise.any(e)}async function g2e(t){SO||(SO=new uJ("dao-paas",500));let e=!0;try{await SO.send(t),e=!0}catch{e=!1}return e}function v2e(t){const e=JSON.parse(window.navigator.cookieEnabled&&localStorage.getItem("agentUsers")||"[]")||[],n=e.find(r=>r.id==t);n?n.time=new Date().getTime():e.push({id:t,time:new Date().getTime()}),window.navigator.cookieEnabled&&localStorage.setItem("agentUsers",JSON.stringify(e)),Sm=t}function b2e(t){return t===Sm}const dJ="daoLogger",y2e=typeof module=="object"&&typeof module.exports=="object",Z0=y2e?global:window,fJ=Z0&&Z0.navigator&&Z0.navigator.cookieEnabled&&Z0.localStorage?Z0.localStorage:{store:{},getItem(t){return this.store[t]},setItem(t,e){this.store[t]=e}},ct=Object.keys(console).reduce((t,e)=>(fJ.getItem(dJ)?t[e]=(...n)=>{var i;(i=console[e])==null||i.call(console,...n);const r=window.customLog;r==null||r(e,n)}:t[e]=function(...n){const r=window.customLog;r==null||r(e,n)},t),{}),$2e=()=>{fJ.setItem(dJ,"*")};function Ai(t){return Ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ai(t)}function wa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _2e(t,e){if(Ai(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Ai(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hJ(t){var e=_2e(t,"string");return Ai(e)=="symbol"?e:e+""}function _L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,hJ(r.key),r)}}function xa(t,e,n){return e&&_L(t.prototype,e),n&&_L(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sl(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vw(t,e){return Vw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Vw(t,e)}function Ch(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vw(t,e)}function n0(t,e){if(e&&(Ai(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sl(t)}function gc(t){return gc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gc(t)}function pn(t,e,n){return(e=hJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OJ(t){if(Array.isArray(t))return t}function pJ(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function OR(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function RA(t,e){if(t){if(typeof t=="string")return OR(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OR(t,e):void 0}}function mJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
49
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S2e(t){return OJ(t)||pJ(t)||RA(t)||mJ()}function SL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function wL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?SL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):SL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var w2e={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,n){console&&console[e]&&console[e].apply(console,n)}},x2e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wa(this,t),this.init(e,n)}return xa(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||w2e,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,i,o){return o&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(i).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new t(this.logger,wL(wL({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new t(this.logger,n)}}]),t}(),Tu=new x2e,fh=function(){function t(){wa(this,t),this.observers={}}return xa(t,[{key:"on",value:function(n,r){var i=this;return n.split(" ").forEach(function(o){i.observers[o]=i.observers[o]||[],i.observers[o].push(r)}),this}},{key:"off",value:function(n,r){if(!!this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(i){return i!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(l){l.apply(void 0,i)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(i))})}}}]),t}();function j0(){var t,e,n=new Promise(function(r,i){t=r,e=i});return n.resolve=t,n.reject=e,n}function xL(t){return t==null?"":""+t}function k2e(t,e,n){t.forEach(function(r){e[r]&&(n[r]=e[r])})}function AA(t,e,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!t||typeof t=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={}}return i()?{}:{obj:t,k:r(o.shift())}}function kL(t,e,n){var r=AA(t,e,Object),i=r.obj,o=r.k;i[o]=n}function Q2e(t,e,n,r){var i=AA(t,e,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function Zw(t,e){var n=AA(t,e),r=n.obj,i=n.k;if(!!r)return r[i]}function QL(t,e,n){var r=Zw(t,n);return r!==void 0?r:Zw(e,n)}function gJ(t,e,n){for(var r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):gJ(t[r],e[r],n):t[r]=e[r]);return t}function Ap(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var P2e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function T2e(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,function(e){return P2e[e]}):t}var SQ=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,C2e=[" ",",","?","!",";"];function E2e(t,e,n){e=e||"",n=n||"";var r=C2e.filter(function(a){return e.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(t);if(!o){var s=t.indexOf(n);s>0&&!i.test(t.substring(0,s))&&(o=!0)}return o}function PL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Z$(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function R2e(t){var e=A2e();return function(){var r=gc(t),i;if(e){var o=gc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return n0(this,i)}}function A2e(){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 vJ(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!t){if(t[e])return t[e];for(var r=e.split(n),i=t,o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];l===void 0&&r.length>o+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=r.slice(o+s).join(n);return c?vJ(l,c,n):void 0}i=i[r[o]]}return i}}var I2e=function(t){Ch(n,t);var e=R2e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return wa(this,n),i=e.call(this),SQ&&fh.call(Sl(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return xa(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[i,o];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(u=i.split("."));var d=Zw(this.data,u);return d||!c||typeof s!="string"?d:vJ(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var u=[i,o];s&&(u=u.concat(c?s.split(c):s)),i.indexOf(".")>-1&&(u=i.split("."),a=o,o=u[1]),this.addNamespaces(o),kL(this.data,u,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[i,o];i.indexOf(".")>-1&&(u=i.split("."),a=s,s=o,o=u[1]),this.addNamespaces(o);var d=Zw(this.data,u)||{};a?gJ(d,s,l):d=Z$(Z$({},d),s),kL(this.data,u,d),c.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Z$(Z$({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(fh),bJ={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,n,r,i,o){var s=this;return e.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,i,o))}),n}};function TL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function oa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?TL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):TL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function X2e(t){var e=D2e();return function(){var r=gc(t),i;if(e){var o=gc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return n0(this,i)}}function D2e(){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}}var CL={},EL=function(t){Ch(n,t);var e=X2e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wa(this,n),i=e.call(this),SQ&&fh.call(Sl(i)),k2e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Sl(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Tu.create("translator"),i}return xa(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],c=s&&i.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!E2e(i,s,a);if(c&&!u){var d=i.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:i,namespaces:l};var f=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(f[0])>-1)&&(l=f.shift()),i=f.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(Ai(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=this.extractFromKey(i[i.length-1],o),d=u.key,f=u.namespaces,h=f[f.length-1],m=o.lng||this.language,g=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&m.toLowerCase()==="cimode"){if(g){var p=o.nsSeparator||this.options.nsSeparator;return l?(O.res="".concat(h).concat(p).concat(d),O):"".concat(h).concat(p).concat(d)}return l?(O.res=d,O):d}var O=this.resolve(i,o),v=O&&O.res,y=O&&O.usedKey||d,_=O&&O.exactUsedKey||d,w=Object.prototype.toString.apply(v),S=["[object Number]","[object Function]","[object RegExp]"],Q=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,C=typeof v!="string"&&typeof v!="boolean"&&typeof v!="number";if(k&&v&&C&&S.indexOf(w)<0&&!(typeof Q=="string"&&w==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var X=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,v,oa(oa({},o),{},{ns:f})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return l?(O.res=X,O):X}if(c){var D=w==="[object Array]",P=D?[]:{},M=D?_:y;for(var Z in v)if(Object.prototype.hasOwnProperty.call(v,Z)){var V="".concat(M).concat(c).concat(Z);P[Z]=this.translate(V,oa(oa({},o),{joinArrays:!1,ns:f})),P[Z]===V&&(P[Z]=v[Z])}v=P}}else if(k&&typeof Q=="string"&&w==="[object Array]")v=v.join(Q),v&&(v=this.extendTranslation(v,i,o,s));else{var G=!1,Y=!1,N=o.count!==void 0&&typeof o.count!="string",q=n.hasDefaultValue(o),R=N?this.pluralResolver.getSuffix(m,o.count,o):"",J=o["defaultValue".concat(R)]||o.defaultValue;!this.isValidLookup(v)&&q&&(G=!0,v=J),this.isValidLookup(v)||(Y=!0,v=d);var ie=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,ee=ie&&Y?void 0:v,ge=q&&J!==v&&this.options.updateMissing;if(Y||G||ge){if(this.logger.log(ge?"updateKey":"missingKey",m,h,d,ge?J:v),c){var le=this.resolve(d,oa(oa({},o),{},{keySeparator:!1}));le&&le.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var me=[],j=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&j&&j[0])for(var ae=0;ae<j.length;ae++)me.push(j[ae]);else this.options.saveMissingTo==="all"?me=this.languageUtils.toResolveHierarchy(o.lng||this.language):me.push(o.lng||this.language);var se=function(ye,_e,De){var We=q&&De!==v?De:ee;a.options.missingKeyHandler?a.options.missingKeyHandler(ye,h,_e,We,ge,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(ye,h,_e,We,ge,o),a.emit("missingKey",ye,h,_e,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?me.forEach(function(be){a.pluralResolver.getSuffixes(be,o).forEach(function(ye){se([be],d+ye,o["defaultValue".concat(ye)]||J)})}):se(me,d,J))}v=this.extendTranslation(v,i,o,O,s),Y&&v===d&&this.options.appendNamespaceToMissingKey&&(v="".concat(h,":").concat(d)),(Y||G)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(d):d,G?v:void 0):v=this.options.parseMissingKeyHandler(v))}return l?(O.res=v,O):v}},{key:"extendTranslation",value:function(i,o,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,oa(oa({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(oa(oa({},s),{interpolation:oa(oa({},this.options.interpolation),s.interpolation)}));var u=typeof i=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(u){var f=i.match(this.interpolator.nestingRegexp);d=f&&f.length}var h=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(h=oa(oa({},this.options.interpolation.defaultVariables),h)),i=this.interpolator.interpolate(i,h,s.lng||this.language,s),u){var m=i.match(this.interpolator.nestingRegexp),g=m&&m.length;d<g&&(s.nest=!1)}s.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var v=arguments.length,y=new Array(v),_=0;_<v;_++)y[_]=arguments[_];return l&&l[0]===y[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(y[0]," in key: ").concat(o[0])),null):c.translate.apply(c,y.concat([o]))},s)),s.interpolation&&this.interpolator.reset()}var p=s.postProcess||this.options.postProcess,O=typeof p=="string"?[p]:p;return i!=null&&O&&O.length&&s.applyPostProcessor!==!1&&(i=bJ.handle(O,i,o,this.options&&this.options.postProcessPassResolved?oa({i18nResolved:a},s):s,this)),i}},{key:"resolve",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,d;return typeof i=="string"&&(i=[i]),i.forEach(function(f){if(!o.isValidLookup(a)){var h=o.extractFromKey(f,s),m=h.key;l=m;var g=h.namespaces;o.options.fallbackNS&&(g=g.concat(o.options.fallbackNS));var p=s.count!==void 0&&typeof s.count!="string",O=p&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),v=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",y=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);g.forEach(function(_){o.isValidLookup(a)||(d=_,!CL["".concat(y[0],"-").concat(_)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(d)&&(CL["".concat(y[0],"-").concat(_)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(y.join(", "),`" won't get resolved as namespace "`).concat(d,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(function(w){if(!o.isValidLookup(a)){u=w;var S=[m];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(S,m,w,_,s);else{var Q;p&&(Q=o.pluralResolver.getSuffix(w,s.count,s));var k="".concat(o.options.pluralSeparator,"zero");if(p&&(S.push(m+Q),O&&S.push(m+k)),v){var C="".concat(m).concat(o.options.contextSeparator).concat(s.context);S.push(C),p&&(S.push(C+Q),O&&S.push(C+k))}}for(var X;X=S.pop();)o.isValidLookup(a)||(c=X,a=o.getResource(w,_,X,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:u,usedNS:d}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),n}(fh);function p4(t){return t.charAt(0).toUpperCase()+t.slice(1)}var N2e=function(){function t(e){wa(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Tu.create("languageUtils")}return xa(t,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=p4(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=p4(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=p4(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var s=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var s=r.getLanguagePartFromCode(o);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(c){!c||(i.isSupportedCode(c)?s.push(c):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),t}(),z2e=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],M2e={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}},L2e=["v1","v2","v3"],RL={zero:0,one:1,two:2,few:3,many:4,other:5};function U2e(){var t={};return z2e.forEach(function(e){e.lngs.forEach(function(n){t[n]={numbers:e.nr,plurals:M2e[e.fc]}})}),t}var q2e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wa(this,t),this.languageUtils=e,this.options=n,this.logger=Tu.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=U2e()}return xa(t,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return RL[s]-RL[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):o.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!L2e.includes(this.options.compatibilityJSON)}}]),t}();function AL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Tc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?AL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):AL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var W2e=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wa(this,t),this.logger=Tu.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(n){return n},this.init(e)}return xa(t,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:T2e,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ap(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ap(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ap(r.nestingPrefix):r.nestingPrefixEscaped||Ap("$t("),this.nestingSuffix=r.nestingSuffix?Ap(r.nestingSuffix):r.nestingSuffixEscaped||Ap(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var s=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(p){return p.replace(/\$/g,"$$$$")}var f=function(O){if(O.indexOf(s.formatSeparator)<0){var v=QL(r,u,O);return s.alwaysFormat?s.format(v,void 0,i,Tc(Tc(Tc({},o),r),{},{interpolationkey:O})):v}var y=O.split(s.formatSeparator),_=y.shift().trim(),w=y.join(s.formatSeparator).trim();return s.format(QL(r,u,_),w,i,Tc(Tc(Tc({},o),r),{},{interpolationkey:_}))};this.resetRegExp();var h=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,m=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,g=[{regex:this.regexpUnescape,safeValue:function(O){return d(O)}},{regex:this.regexp,safeValue:function(O){return s.escapeValue?d(s.escape(O)):d(O)}}];return g.forEach(function(p){for(c=0;a=p.regex.exec(n);){var O=a[1].trim();if(l=f(O),l===void 0)if(typeof h=="function"){var v=h(n,a,o);l=typeof v=="string"?v:""}else if(o&&o.hasOwnProperty(O))l="";else if(m){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(O," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=xL(l));var y=p.safeValue(l);if(n=n.replace(a[0],y),m?(p.regex.lastIndex+=l.length,p.regex.lastIndex-=a[0].length):p.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=Tc({},o);l.applyPostProcessor=!1,delete l.defaultValue;function c(h,m){var g=this.nestingOptionsSeparator;if(h.indexOf(g)<0)return h;var p=h.split(new RegExp("".concat(g,"[ ]*{"))),O="{".concat(p[1]);h=p[0],O=this.interpolate(O,l);var v=O.match(/'/g),y=O.match(/"/g);(v&&v.length%2===0&&!y||y.length%2!==0)&&(O=O.replace(/'/g,'"'));try{l=JSON.parse(O),m&&(l=Tc(Tc({},m),l))}catch(_){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),_),"".concat(h).concat(g).concat(O)}return delete l.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var u=[],d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var f=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=f.shift(),u=f,d=!0}if(a=r(c.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=xL(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),d&&(a=u.reduce(function(h,m){return i.format(h,m,o.lng,Tc(Tc({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),t}();function IL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function yf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?IL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):IL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function B2e(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(e==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(e==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(!!s){var a=s.split(":"),l=S2e(a),c=l[0],u=l.slice(1),d=u.join(":").trim().replace(/^'+|'+$/g,"");n[c.trim()]||(n[c.trim()]=d),d==="false"&&(n[c.trim()]=!1),d==="true"&&(n[c.trim()]=!0),isNaN(d)||(n[c.trim()]=parseInt(d,10))}})}}return{formatName:e,formatOptions:n}}function Ip(t){var e={};return function(r,i,o){var s=i+JSON.stringify(o),a=e[s];return a||(a=t(i,o),e[s]=a),a(r)}}var Y2e=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wa(this,t),this.logger=Tu.create("formatter"),this.options=e,this.formats={number:Ip(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:Ip(function(n,r){var i=new Intl.NumberFormat(n,yf(yf({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Ip(function(n,r){var i=new Intl.DateTimeFormat(n,yf({},r));return function(o){return i.format(o)}}),relativetime:Ip(function(n,r){var i=new Intl.RelativeTimeFormat(n,yf({},r));return function(o){return i.format(o,r.range||"day")}}),list:Ip(function(n,r){var i=new Intl.ListFormat(n,yf({},r));return function(o){return i.format(o)}})},this.init(e)}return xa(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Ip(r)}},{key:"format",value:function(n,r,i,o){var s=this,a=r.split(this.formatSeparator),l=a.reduce(function(c,u){var d=B2e(u),f=d.formatName,h=d.formatOptions;if(s.formats[f]){var m=c;try{var g=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},p=g.locale||g.lng||o.locale||o.lng||i;m=s.formats[f](c,p,yf(yf(yf({},h),o),g))}catch(O){s.logger.warn(O)}return m}else s.logger.warn("there was no format function for ".concat(f));return c},n);return l}}]),t}();function XL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function DL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?XL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function F2e(t){var e=V2e();return function(){var r=gc(t),i;if(e){var o=gc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return n0(this,i)}}function V2e(){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 Z2e(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var j2e=function(t){Ch(n,t);var e=F2e(n);function n(r,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return wa(this,n),s=e.call(this),SQ&&fh.call(Sl(s)),s.backend=r,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=Tu.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return xa(n,[{key:"queueLoad",value:function(i,o,s,a){var l=this,c={},u={},d={},f={};return i.forEach(function(h){var m=!0;o.forEach(function(g){var p="".concat(h,"|").concat(g);!s.reload&&l.store.hasResourceBundle(h,g)?l.state[p]=2:l.state[p]<0||(l.state[p]===1?u[p]===void 0&&(u[p]=!0):(l.state[p]=1,m=!1,u[p]===void 0&&(u[p]=!0),c[p]===void 0&&(c[p]=!0),f[g]===void 0&&(f[g]=!0)))}),m||(d[h]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],c=a[1];o&&this.emit("failedLoading",l,c,o),s&&this.store.addResourceBundle(l,c,s),this.state[i]=o?-1:2;var u={};this.queue.forEach(function(d){Q2e(d.loaded,[l],c),Z2e(d,i),o&&d.errors.push(o),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(f){u[f]||(u[f]={});var h=d.loaded[f];h.length&&h.forEach(function(m){u[f][m]===void 0&&(u[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!i.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:c,callback:u});return}return this.readingCalls++,this.backend[s](i,o,function(d,f){if(a.readingCalls--,a.waitingReads.length>0){var h=a.waitingReads.shift();a.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(d&&f&&l<a.maxRetries){setTimeout(function(){a.read.call(a,i,o,s,l+1,c*2,u)},c);return}u(d,f)})}},{key:"prepareLoading",value:function(i,o){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var c=this.queueLoad(i,o,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(u,d){u&&o.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&d&&o.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),d),o.loaded(i,u,d)})}},{key:"saveMissing",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,DL(DL({},c),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),n}(fh);function G2e(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var n={};if(Ai(e[1])==="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),Ai(e[2])==="object"||Ai(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(e,n,r,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function NL(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function zL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function cu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?zL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function H2e(t){var e=K2e();return function(){var r=gc(t),i;if(e){var o=gc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return n0(this,i)}}function K2e(){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 j$(){}function J2e(t){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(t));e.forEach(function(n){typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}var jw=function(t){Ch(n,t);var e=H2e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(wa(this,n),r=e.call(this),SQ&&fh.call(Sl(r)),r.options=NL(i),r.services={},r.logger=Tu,r.modules={external:[]},J2e(Sl(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),n0(r,Sl(r));setTimeout(function(){r.init(i,o)},0)}return r}return xa(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=G2e();this.options=cu(cu(cu({},a),this.options),NL(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=cu(cu({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(O){return O?typeof O=="function"?new O:O:null}if(!this.options.isClone){this.modules.logger?Tu.init(l(this.modules.logger),this.options):Tu.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=Y2e);var u=new N2e(this.options);this.store=new I2e(this.options.resources,this.options);var d=this.services;d.logger=Tu,d.resourceStore=this.store,d.languageUtils=u,d.pluralResolver=new q2e(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(d.formatter=l(c),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new W2e(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new j2e(l(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(O){for(var v=arguments.length,y=new Array(v>1?v-1:0),_=1;_<v;_++)y[_-1]=arguments[_];i.emit.apply(i,[O].concat(y))}),this.modules.languageDetector&&(d.languageDetector=l(this.modules.languageDetector),d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=l(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new EL(this.services,this.options),this.translator.on("*",function(O){for(var v=arguments.length,y=new Array(v>1?v-1:0),_=1;_<v;_++)y[_-1]=arguments[_];i.emit.apply(i,[O].concat(y))}),this.modules.external.forEach(function(O){O.init&&O.init(i)})}if(this.format=this.options.interpolation.format,s||(s=j$),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(O){i[O]=function(){var v;return(v=i.store)[O].apply(v,arguments)}});var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];m.forEach(function(O){i[O]=function(){var v;return(v=i.store)[O].apply(v,arguments),i}});var g=j0(),p=function(){var v=function(_,w){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),g.resolve(w),s(_,w)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return v(null,i.t.bind(i));i.changeLanguage(i.options.lng,v)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),g}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j$,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],u=function(h){if(!!h){var m=o.services.languageUtils.toResolveHierarchy(h);m.forEach(function(g){c.indexOf(g)<0&&c.push(g)})}};if(l)u(l);else{var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.forEach(function(f){return u(f)})}this.options.preload&&this.options.preload.forEach(function(f){return u(f)}),this.services.backendConnector.load(c,this.options.ns,function(f){!f&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(f)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=j0();return i||(i=this.languages),o||(o=this.options.ns),s||(s=j$),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&bJ.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o<this.languages.length;o++){var s=this.languages[o];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=j0();this.emit("languageChanging",i);var l=function(f){s.language=f,s.languages=s.services.languageUtils.toResolveHierarchy(f),s.resolvedLanguage=void 0,s.setResolvedLanguage(f)},c=function(f,h){h?(l(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(f,function(){return s.t.apply(s,arguments)})},u=function(f){!i&&!f&&s.services.languageDetector&&(f=[]);var h=typeof f=="string"?f:s.services.languageUtils.getBestMatchFromCodes(f);h&&(s.language||l(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(m){c(m,h)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function c(u,d){var f;if(Ai(d)!=="object"){for(var h=arguments.length,m=new Array(h>2?h-2:0),g=2;g<h;g++)m[g-2]=arguments[g];f=a.options.overloadTranslationOptionHandler([u,d].concat(m))}else f=cu({},d);f.lng=f.lng||c.lng,f.lngs=f.lngs||c.lngs,f.ns=f.ns||c.ns,f.keyPrefix=f.keyPrefix||s||c.keyPrefix;var p=a.options.keySeparator||".",O=f.keyPrefix?"".concat(f.keyPrefix).concat(p).concat(u):u;return a.t(O,f)};return typeof i=="string"?l.lng=i:l.lngs=i,l.ns=o,l.keyPrefix=s,l}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var u=function(h,m){var g=o.services.backendConnector.state["".concat(h,"|").concat(m)];return g===-1||g===2};if(s.precheck){var d=s.precheck(this,u);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,i)&&(!l||u(c,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=j0();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=j0();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j$,a=cu(cu(cu({},this.options),o),{isClone:!0}),l=new n(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var c=["store","services","language"];return c.forEach(function(u){l[u]=i[u]}),l.services=cu({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new EL(l.services,l.options),l.translator.on("*",function(u){for(var d=arguments.length,f=new Array(d>1?d-1:0),h=1;h<d;h++)f[h-1]=arguments[h];l.emit.apply(l,[u].concat(f))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(fh);pn(jw,"createInstance",function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new jw(t,e)});var Xo=jw.createInstance();Xo.createInstance=jw.createInstance;Xo.createInstance;Xo.init;Xo.loadResources;Xo.reloadResources;Xo.use;Xo.changeLanguage;Xo.getFixedT;var xv=Xo.t;Xo.exists;Xo.setDefaultNamespace;Xo.hasLoadedNamespace;Xo.loadNamespaces;Xo.loadLanguages;function Og(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function wi(t,e){if(t==null)return{};var n,r,i=Og(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var ePe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230);/g,tPe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026"},nPe=function(e){return tPe[e]},rPe=function(e){return e.replace(ePe,nPe)};function ML(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function LL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ML(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ML(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var pR={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:rPe},yJ,iPe=E.exports.createContext();function oPe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pR=LL(LL({},pR),t)}function sPe(){return pR}var aPe=function(){function t(){wa(this,t),this.usedNamespaces={}}return xa(t,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),t}();function lPe(t){yJ=t}function cPe(){return yJ}var uPe={type:"3rdParty",init:function(e){oPe(e.options.react),lPe(e)}};function dPe(){if(console&&console.warn){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(t=console).warn.apply(t,n)}}var UL={};function mR(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&UL[e[0]]||(typeof e[0]=="string"&&(UL[e[0]]=new Date),dPe.apply(void 0,e))}function qL(t,e,n){t.loadNamespaces(e,function(){if(t.isInitialized)n();else{var r=function i(){setTimeout(function(){t.off("initialized",i)},0),n()};t.on("initialized",r)}})}function fPe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.languages[0],i=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(l,c){var u=e.services.backendConnector.state["".concat(l,"|").concat(c)];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}function hPe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return mR("i18n.languages were undefined or empty",e.languages),!0;var r=e.options.ignoreJSONStructure!==void 0;return r?e.hasLoadedNamespace(t,{precheck:function(o,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,t))return!1}}):fPe(t,e,n)}function OPe(t,e){var n=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function It(t,e){return OJ(t)||OPe(t,e)||RA(t,e)||mJ()}function WL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function m4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?WL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):WL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var pPe=function(e,n){var r=E.exports.useRef();return E.exports.useEffect(function(){r.current=n?r.current:e},[e,n]),r.current};function is(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.i18n,r=E.exports.useContext(iPe)||{},i=r.i18n,o=r.defaultNS,s=n||i||cPe();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new aPe),!s){mR("You will need to pass in an i18next instance by using initReactI18next");var a=function(C){return Array.isArray(C)?C[C.length-1]:C},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&mR("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=m4(m4(m4({},sPe()),s.options.react),e),u=c.useSuspense,d=c.keyPrefix,f=t||o||s.options&&s.options.defaultNS;f=typeof f=="string"?[f]:f||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(f);var h=(s.isInitialized||s.initializedStoreOnce)&&f.every(function(k){return hPe(k,s,c)});function m(){return s.getFixedT(null,c.nsMode==="fallback"?f:f[0],d)}var g=E.exports.useState(m),p=It(g,2),O=p[0],v=p[1],y=f.join(),_=pPe(y),w=E.exports.useRef(!0);E.exports.useEffect(function(){var k=c.bindI18n,C=c.bindI18nStore;w.current=!0,!h&&!u&&qL(s,f,function(){w.current&&v(m)}),h&&_&&_!==y&&w.current&&v(m);function X(){w.current&&v(m)}return k&&s&&s.on(k,X),C&&s&&s.store.on(C,X),function(){w.current=!1,k&&s&&k.split(" ").forEach(function(D){return s.off(D,X)}),C&&s&&C.split(" ").forEach(function(D){return s.store.off(D,X)})}},[s,y]);var S=E.exports.useRef(!0);E.exports.useEffect(function(){w.current&&!S.current&&v(m),S.current=!1},[s]);var Q=[O,s,h];if(Q.t=O,Q.i18n=s,Q.ready=h,h||!h&&!u)return Q;throw new Promise(function(k){qL(s,f,function(){k()})})}var mPe={common_success:"Success",common_confirm:"Confirm",common_cancel:"Cancel",common_delete:"Delete",common_hidden:"Hidden",common_locked:"Locked",common_offline:"Offline",common_directory:"Directory",common_file:"File",editor_no_open_file:"None file opened",editor_search_file:"recently opened",editor_large_file_tip:"The file size is over 16 MB, preview is not supported",editor_unsupported_format_file_cannot_display:"The file cannot be displayed for unsupported format",editor_picture_not_support_preview:"Picture's preview is not yet supported",editor_search_files_by_name:"Search files by name",editor_pending_update:"{{pendingUpdate}} updates to be written",editor_ot_success:"Success",editor_file_is_not_editable:"The file is not editable",editor_image_preview_failed_to_load_image:"Failed to load image",editor_image_preview_loading:"loading",file_tree_click_to_show:"Click to show",file_tree_click_to_hidden:"Click to hide",file_tree_click_to_cancel:"Click to cancel",file_tree_click_to_locked:"Click to lock",file_tree_joined_the_test:"Joined the test",file_tree_click_to_remove:"Click to remove",file_tree_add_test:"Add test",\u7528\u6237\u7F16\u8F91\u8FC7\u6B64\u6587\u4EF6:"This file modifyied by user",file_tree_num_of_files_cannot_exceed_500:"The number of files cannot exceed 500",file_tree_x_existed:"{{x}} existed",\u56DE\u653E\u5DF2\u6682\u505C:"Playback already pause.",\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6:"Cannot open the file with playback mode.",file_tree_x_filtered:"{{x}} filtered",file_tree_x_upload_not_allowed:"Upload of {{x}} not allowed",file_tree_renamed:"Renamed",file_tree_upload_files:"Upload files",file_tree_upload_folder:"Upload folder",show_hidden_files:"Show Hidden files",do_no_show_hidden_files:"Do not show hidden files",file_tree_rename:"Rename",file_tree_create_new_file:"New file",\u8DDF\u968F\u89C6\u89D2:"Follow view browser",\u63A7\u5236\u53F0:"Devtools",\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00:"Open in new tab",\u9000\u51FA\u8DDF\u968F:"Back to normal browser",\u5728\u65B0\u7A97\u53E3\u6253\u5F00:"Open with new tab",file_tree_create_new_folder:"New folder",file_tree_down_file:"Download",file_tree_failed_to_download_file:"Failed to download file",file_tree_make_sure_delete_x_unrecoverable:"Are you sure to delete this {{x}}? The file cannot be recovered after deletion",file_tree_kind_tips:"Notice",file_tree_understood:"Know",file_tree_space_char_exist_in_file_or_folder:"There is a space character",file_tree_file_exceeds_size_limit:"The file {{filePath}} exceeds the size limit of 16M",file_tree_rename_cannot_be_empty:"Rename cannot be empty",output_browser_click_run_start_application:"Click \u3010Run\u3011 to start the application",helpers_invalid_parameter_rate_x:"Invalid parameter: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"The area has already set the answering area and cannot be set repeatedly",lib_x_file_cannot_set_the_answer_area:"The {{x}} file cannot set the answer area",lib_locked:"locked",lib_hidden:"hidden",store_user_not_found:"User not found",store_appStatus_transition_error_x:"AppStatus transition error: {{x}}",dao_channel_agentUserId_x_inconsistent:"The agentUserId {{x}} is inconsistent",dao_channel_event_x_is_not_supported:"Event {{x}} is not supported",dao_channel_connection_not_established:"The connection has not been established yet",dao_channel_playground_not_exist:"Playground does not exist",dao_channel_playground_unbound_container:"Playground unbound container",dao_channel_container_startup_failed:"Container startup failed",dao_channel_insufficient_server_resources:"Insufficient server resources",dao_channel_server_is_busy:"Server is busy",dao_channel_activation_timeout:"Docker activation timeout",dao_channel_docker_failed_to_activate:"Docker failed to start",dao_channel_socket_is_not_ready:"Socket is not ready",dao_channel_socket_is_not_ready_for_x:"Socket is not ready for {{x}}",dao_channel_socket_connect_broken:"Socket connection broken",debug_variables:"Variables",debug_call_stack:"Call stack",debug_staring:"staring",debug_tooltip_run:"Run",debug_tooltip_stop:"Stop",debug_tooltip_continue:"Continue",debug_tooltip_step_over:"Step Over",debug_tooltip_step_into:"Step Into",debug_tooltip_step_out:"Step Out",debug_call_stack_cannot_open_file:"Cannot open non-workspace file",dao_paas_cannot_follow_each_other:"Cannot follow each other",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"Cannt copy the content",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"Cannt edit the content",\u79FB\u9664\u4EE3\u7801\u5757\u6807\u8BC6:"Remove block code flag",\u5220\u9664\u4EE3\u7801\u5757:"Remove block code",\u590D\u5236\u4EE3\u7801:"Copy",\u7C98\u8D34\u4EE3\u7801:"Paste",\u786E\u8BA4:"Confirm",\u53D6\u6D88:"Cancel",\u67E5\u770BAI\u4EE3\u7801:"View AI code",\u67E5\u770B\u65E7\u4EE3\u7801:"View origin code",dao_paas_not_find_mount_dom_object_for_x:"Could not find mounted DOM object for {{x}}",dao_paas_x_component_is_not_supported:"{{x}} component is not supported",dao_paas_no_ready:"No ready",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"Pleas go to file tree to select one file and open it","\u8BE5\u6587\u4EF6\u5DF2\u88AB\u8BBE\u7F6E\u4E3A\u9690\u85CF\uFF0C\u65E0\u6CD5\u67E5\u770B":"You cannot view the hide file",dao_paas_file_does_not_exist:"File does not exist",dao_pass_set_answer_wrong:"Get wrong when insert answer for question",dao_paas_docker_has_been_destoryed:"docker has been destroyed","Unable to create file or directory with system reserved name":"Unable to create file or directory with system reserved name","The file or folder {{path}} already exists in this location, please choose another name":"The file or folder {{path}} already exists in this location, please choose another name","No results":"No results","Collapse the file tree":"Collapse the file tree","Create or rename to hidden files, will not be visible":"Create or rename to hidden files, will not be visible","Live refresh":"Live refresh","Code diagnosis":"Code diagnosis",file_tree_title:"Files",keyword_search_toolbar_title:"Search",keyword_search_btn_refresh:"Refresh",keyword_search_btn_clear:"Clear",keyword_search_btn_collapse:"Expand/Collapse All",keyword_search_btn_replace_all:"Replace All({{press}})",keyword_search_btn_preserve:"Preserve Case({{press}})",keyword_search_btn_case:"Match Case({{press}})",keyword_search_btn_whole:"Match Whole Word({{press}})",keyword_search_btn_expression:"Use Regular Expression({{press}})",keyword_search_modal_title:"Replace all",keyword_search_modal_okText:"Confirm replace",keyword_search_modal_cancelText:"Cancel",keyword_search_modal_tips_has_value:"Whether to replace {{words}} {{wordMore}} in {{file}} {{fileMore}} with {{text}}",keyword_search_modal_tips_empty_value:"Whether to replace {{words}} {{wordMore}} in {{file}} {{fileMore}}",keyword_search_input_enter_placeholder:"Please enter",keyword_search_input_replace_placeholder:"Replace",keyword_search_doing:"Searching...",keyword_search_nothing:"Not results found, try to enter other keyword",keyword_search_found:"{{words}} {{wordMore}} in {{file}} {{fileMore}}"},gPe={common_success:"\u6210\u529F",common_confirm:"\u786E\u5B9A",common_cancel:"\u53D6\u6D88",common_delete:"\u5220\u9664",common_hidden:"\u5DF2\u9690\u85CF",common_locked:"\u5DF2\u52A0\u9501",common_offline:"\u79BB\u7EBF",common_directory:"\u76EE\u5F55",common_file:"\u6587\u4EF6",editor_search_file:"\u6700\u8FD1\u6253\u5F00",editor_no_open_file:"\u672A\u6253\u5F00\u6587\u4EF6",editor_large_file_tip:"\u6587\u4EF6\u8D85\u8FC716\u5146\u5927\u5C0F\uFF0C\u6682\u4E0D\u652F\u6301\u9884\u89C8",editor_unsupported_format_file_cannot_display:"\u6B64\u6587\u4EF6\u662F\u4E8C\u8FDB\u5236\u6587\u4EF6\u6216\u4F7F\u7528\u4E86\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7F16\u7801\uFF0C\u65E0\u6CD5\u5728\u7F16\u8F91\u5668\u4E2D\u663E\u793A",editor_picture_not_support_preview:"\u56FE\u7247\u6682\u65F6\u4E0D\u652F\u6301\u9884\u89C8",editor_search_files_by_name:"\u6309\u540D\u79F0\u641C\u7D22\u6587\u4EF6",editor_pending_update:"{{pendingUpdate}}\u4E2A\u66F4\u65B0\u5F85\u5199\u5165",editor_ot_success:"\u6210\u529F",editor_file_is_not_editable:"\u8BE5\u6587\u4EF6\u4E0D\u53EF\u7F16\u8F91",editor_image_preview_failed_to_load_image:"\u52A0\u8F7D\u56FE\u7247\u5931\u8D25",editor_image_preview_loading:"\u52A0\u8F7D\u4E2D...",file_tree_click_to_show:"\u70B9\u51FB\u663E\u793A",file_tree_click_to_hidden:"\u70B9\u51FB\u9690\u85CF",file_tree_click_to_cancel:"\u70B9\u51FB\u53D6\u6D88",file_tree_click_to_locked:"\u70B9\u51FB\u9501\u5B9A",file_tree_joined_the_test:"\u5DF2\u52A0\u5165\u6D4B\u8BD5",file_tree_click_to_remove:"\u70B9\u51FB\u79FB\u9664",file_tree_add_test:"\u6DFB\u52A0\u6D4B\u8BD5",\u7528\u6237\u7F16\u8F91\u8FC7\u6B64\u6587\u4EF6:"\u7528\u6237\u7F16\u8F91\u8FC7\u6B64\u6587\u4EF6",file_tree_num_of_files_cannot_exceed_500:"\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7500",file_tree_x_existed:"{{x}}\u5DF2\u5B58\u5728",\u56DE\u653E\u5DF2\u6682\u505C:"\u56DE\u653E\u5DF2\u6682\u505C",\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6:"\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6",\u8DDF\u968F\u89C6\u89D2:"\u8DDF\u968F\u89C6\u89D2",\u63A7\u5236\u53F0:"\u5F00\u53D1\u5DE5\u5177",\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00:"\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",\u9000\u51FA\u8DDF\u968F:"\u9000\u51FA\u8DDF\u968F",\u5728\u65B0\u7A97\u53E3\u6253\u5F00:"\u5728\u65B0\u7A97\u53E3\u6253\u5F00",file_tree_x_filtered:"{{x}}\u88AB\u8FC7\u6EE4",file_tree_x_upload_not_allowed:"{{x}}\u4E0D\u5141\u8BB8\u4E0A\u4F20",file_tree_renamed:"\u91CD\u540D\u4E86",file_tree_upload_files:"\u4E0A\u4F20\u6587\u4EF6",file_tree_upload_folder:"\u4E0A\u4F20\u6587\u4EF6\u5939",show_hidden_files:"\u663E\u793A\u9690\u85CF\u6587\u4EF6",do_no_show_hidden_files:"\u4E0D\u663E\u793A\u9690\u85CF\u6587\u4EF6",file_tree_rename:"\u91CD\u547D\u540D",file_tree_create_new_file:"\u65B0\u5EFA\u6587\u4EF6",file_tree_create_new_folder:"\u65B0\u5EFA\u6587\u4EF6\u5939",file_tree_down_file:"\u4E0B\u8F7D",file_tree_failed_to_download_file:"\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25",file_tree_make_sure_delete_x_unrecoverable:"\u786E\u5B9A\u5220\u9664\u8FD9\u4E2A{{x}}\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D",file_tree_kind_tips:"\u6E29\u99A8\u63D0\u793A",file_tree_understood:"\u77E5\u9053\u4E86",file_tree_space_char_exist_in_file_or_folder:"\u5B58\u5728\u7A7A\u683C\u5B57\u7B26",file_tree_file_exceeds_size_limit:"\u6587\u4EF6{{filePath}}\u8D85\u51FA\u4E8616M\u7684\u5927\u5C0F\u9650\u5236",file_tree_rename_cannot_be_empty:"\u91CD\u547D\u540D\u4E0D\u80FD\u4E3A\u7A7A",output_browser_click_run_start_application:"\u70B9\u51FB\u3010\u8FD0\u884C\u3011\u542F\u52A8\u5E94\u7528",helpers_invalid_parameter_rate_x:"\u65E0\u6548\u7684\u53C2\u6570: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"\u8BE5\u533A\u57DF\u5DF2\u8BBE\u7F6E\u7B54\u9898\u533A\uFF0C\u4E0D\u53EF\u91CD\u590D\u8BBE\u7F6E",lib_x_file_cannot_set_the_answer_area:"{{x}}\u6587\u4EF6\u4E0D\u53EF\u4EE5\u8BBE\u7F6E\u7B54\u9898\u533A",lib_locked:"\u52A0\u9501",lib_hidden:"\u9690\u85CF",store_user_not_found:"\u627E\u4E0D\u5230\u7528\u6237",store_appStatus_transition_error_x:"appStatus \u8F6C\u6362\u9519\u8BEF: {{x}}",dao_channel_agentUserId_x_inconsistent:"agentUserId {{x}} \u4E0D\u4E00\u81F4",dao_channel_event_x_is_not_supported:"\u4E8B\u4EF6 {{x}} \u4E0D\u652F\u6301",dao_channel_connection_not_established:"\u8FDE\u63A5\u5C1A\u672A\u5EFA\u7ACB",dao_channel_playground_not_exist:"playground\u4E0D\u5B58\u5728",dao_channel_playground_unbound_container:"playground\u672A\u7ED1\u5B9A\u5BB9\u5668",dao_channel_container_startup_failed:"\u5BB9\u5668\u542F\u52A8\u5931\u8D25",dao_channel_insufficient_server_resources:"\u670D\u52A1\u5668\u8D44\u6E90\u4E0D\u8DB3",dao_channel_server_is_busy:"\u670D\u52A1\u5668\u7E41\u5FD9",dao_channel_activation_timeout:"docker\u6FC0\u6D3B\u8D85\u65F6",dao_channel_docker_failed_to_activate:"docker\u542F\u52A8\u5931\u8D25",dao_channel_socket_is_not_ready:"socket\u672A\u51C6\u5907\u597D",dao_channel_socket_is_not_ready_for_x:"socket \u8FD8\u6CA1\u6709\u4E3A{{x}}\u51C6\u5907\u597D",dao_channel_socket_connect_broken:"socket\u8FDE\u63A5\u4E2D\u65AD",debug_variables:"\u53D8\u91CF",debug_call_stack:"\u8C03\u7528\u5806\u6808",debug_staring:"\u542F\u52A8\u4E2D",debug_tooltip_run:"\u8FD0\u884C",debug_tooltip_stop:"\u505C\u6B62",debug_tooltip_continue:"\u7EE7\u7EED",debug_tooltip_step_over:"\u5355\u6B65\u8DF3\u8FC7",debug_tooltip_step_into:"\u5355\u6B65\u8C03\u8BD5",debug_tooltip_step_out:"\u5355\u6B65\u8DF3\u51FA",debug_call_stack_cannot_open_file:"\u65E0\u6CD5\u6253\u5F00\u975E\u5DE5\u4F5C\u533A\u6587\u4EF6",dao_paas_cannot_follow_each_other:"\u4E0D\u80FD\u4E92\u76F8\u8DDF\u968F",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91",\u79FB\u9664\u4EE3\u7801\u5757\u6807\u8BC6:"\u53D6\u6D88\u6807\u8BC6",\u5220\u9664\u4EE3\u7801\u5757:"\u5220\u9664\u4EE3\u7801",\u590D\u5236\u4EE3\u7801:"\u590D\u5236",\u7C98\u8D34\u4EE3\u7801:"\u7C98\u8D34",\u786E\u8BA4:"\u786E\u8BA4",\u53D6\u6D88:"\u53D6\u6D88",\u67E5\u770BAI\u4EE3\u7801:"\u67E5\u770BAI\u4EE3\u7801",\u67E5\u770B\u65E7\u4EE3\u7801:"\u67E5\u770B\u65E7\u4EE3\u7801",dao_paas_not_find_mount_dom_object_for_x:"\u627E\u4E0D\u5230\u4E3A{{x}}\u7684\u6302\u8F7DDOM\u5BF9\u8C61",dao_paas_x_component_is_not_supported:"\u7EC4\u4EF6{{x}}\u4E0D\u652F\u6301",dao_paas_no_ready:"\u672A\u51C6\u5907",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91","\u8BE5\u6587\u4EF6\u5DF2\u88AB\u8BBE\u7F6E\u4E3A\u9690\u85CF\uFF0C\u65E0\u6CD5\u67E5\u770B":"\u8BE5\u6587\u4EF6\u5DF2\u88AB\u8BBE\u7F6E\u4E3A\u9690\u85CF\uFF0C\u65E0\u6CD5\u67E5\u770B",dao_paas_file_does_not_exist:"\u6587\u4EF6\u4E0D\u5B58\u5728",dao_pass_set_answer_wrong:"\u8BBE\u7F6E\u9898\u76EE\u7B54\u6848\u9519\u8BEF",dao_paas_docker_has_been_destoryed:"docker\u5DF2\u7ECF\u88AB\u9500\u6BC1","Unable to create file or directory with system reserved name":"\u65E0\u6CD5\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u540D\u79F0\u521B\u5EFA\u6587\u4EF6\u6216\u76EE\u5F55","The file or folder {{path}} already exists in this location, please choose another name":"\u6B64\u4F4D\u7F6E\u5DF2\u5B58\u5728\u6587\u4EF6\u6216\u8005\u6587\u4EF6\u5939 {{path}}\uFF0C\u8BF7\u9009\u62E9\u5176\u5B83\u540D\u79F0","No results":"\u6CA1\u6709\u7ED3\u679C","Collapse the file tree":"\u6536\u8D77\u6587\u4EF6\u6811","Create or rename to hidden files, will not be visible":"\u521B\u5EFA\u6216\u8005\u91CD\u547D\u540D\u4E3A\u9690\u85CF\u6587\u4EF6\uFF0C\u5C06\u4E0D\u53EF\u89C1","Live refresh":"\u5B9E\u65F6\u5237\u65B0","Code diagnosis":"\u4EE3\u7801\u8BCA\u65AD",file_tree_title:"\u6587\u4EF6",keyword_search_toolbar_title:"\u641C\u7D22",keyword_search_btn_refresh:"\u5237 \u65B0",keyword_search_btn_clear:"\u6E05 \u9664",keyword_search_btn_collapse:"\u5C55\u5F00/\u6536\u8D77",keyword_search_btn_replace_all:"\u5168\u5C40\u66FF\u6362({{press}})",keyword_search_btn_preserve:"\u4FDD\u7559\u5927\u5C0F\u5199({{press}})",keyword_search_btn_case:"\u5339\u914D\u5927\u5C0F\u5199({{press}})",keyword_search_btn_whole:"\u5168\u8BCD\u5339\u914D({{press}})",keyword_search_btn_expression:"\u6B63\u5219\u8868\u8FBE\u5F0F({{press}})",keyword_search_modal_title:"\u6279\u91CF\u66FF\u6362",keyword_search_modal_okText:"\u786E\u8BA4\u66FF\u6362",keyword_search_modal_cancelText:"\u53D6\u6D88",keyword_search_modal_tips_has_value:"\u662F\u5426\u7528\u300C{{text}}\u300D\u66FF\u6362 {{file}} \u4E2A\u6587\u4EF6\u4E2D\u51FA\u73B0\u7684 {{words}} \u5904\u5173\u952E\u8BCD",keyword_search_modal_tips_empty_value:"\u662F\u5426\u66FF\u6362 {{file}} \u4E2A\u6587\u4EF6\u4E2D\u51FA\u73B0\u7684 {{words}} \u5904\u5173\u952E\u8BCD",keyword_search_input_enter_placeholder:"\u8BF7\u8F93\u5165",keyword_search_input_replace_placeholder:"\u66FF\u6362",keyword_search_doing:"\u641C\u7D22\u4E2D...",keyword_search_nothing:"\u672A\u627E\u5230\u7ED3\u679C\uFF0C\u5C1D\u8BD5\u5176\u4ED6\u5173\u952E\u8BCD\u8BD5\u8BD5",keyword_search_found:"{{file}} \u4E2A\u6587\u4EF6\u4E2D\u7684 {{words}} \u4E2A\u7ED3\u679C"},Gw=(t=>(t.ZH="ZH",t.EN="EN",t))(Gw||{});const vPe={EN:{translation:mPe},ZH:{translation:gPe}},bPe="ZH";Xo.use(uPe).init({resources:vPe,lng:bPe,keySeparator:!1,interpolation:{escapeValue:!1}});const Pn=Xo.t;class yPe{constructor(e,n,r,i,o,s,a,l,c){tt(this,"start");tt(this,"end");tt(this,"totalTime");tt(this,"rate");tt(this,"preFrameTime",0);tt(this,"resumeTime",0);tt(this,"dataBuffer",[]);tt(this,"customizeData",[]);tt(this,"playing",!1);tt(this,"isReplay",!1);tt(this,"index",0);tt(this,"firstFrameTime",0);tt(this,"isMovePosition",!1);tt(this,"preTerminalIndex",{});tt(this,"preDebugIndex",{});tt(this,"preFireTreeIndex",{});tt(this,"preTerminalDockerId","");tt(this,"preConsoleDockerId","");tt(this,"preClaudeCodeIndex",{});tt(this,"preClaudeCodeDockerId","");tt(this,"isStopMovePosition",!1);tt(this,"triggerEventForMaxTimespanRecord","");tt(this,"triggerEventForMaxTimespan",-1);tt(this,"eventCustomize");tt(this,"eventDispatcher");tt(this,"getPlaybackSnapshot");tt(this,"progressDispatcher");tt(this,"currentDockerId");this.start=e,this.end=n,this.rate=1,this.totalTime=n-e,this.customizeData=i,this.triggerEventForMaxTimespan=o,this.eventDispatcher=s,this.progressDispatcher=a,this.getPlaybackSnapshot=l,this.eventCustomize=c,this.step=this.step.bind(this),this.currentDockerId=""}logger(...e){}convertToAbsoluteTime(e){return this.start+e}getFileRootPathByDockerId(e,n){var i,o,s,a;const r=this.index>=this.dataBuffer.length?this.dataBuffer.length-1:this.index;for(let l=r;l>=0;l--){const c=this.dataBuffer[l];if(this.isFileTree(c.eventName)&&c.dockerId===e&&c.data.fileRootPath&&((o=(i=c.data.payload)==null?void 0:i.children)==null?void 0:o.find(d=>d.path===n)))return c.data.fileRootPath}for(let l=0;l<this.dataBuffer.length;l++){const c=this.dataBuffer[l];if(this.isFileTree(c.eventName)&&c.dockerId===e&&c.data.fileRootPath&&((a=(s=c.data.payload)==null?void 0:s.children)==null?void 0:a.find(d=>d.path===n)))return c.data.fileRootPath}}getCurrentDocByPathAndDocker(e,n){const r=this.index>=this.dataBuffer.length?this.dataBuffer.length-1:this.index,i=(o,s)=>{var l;if(this.isEditor(o.eventName)&&o.dockerId===e&&o.data.openedPath===n)return o.snapshot||(o=((l=this.getPlaybackSnapshot)==null?void 0:l.call(this,o.eventName,o,this.getPreFrameByFrame(o,s)))||o),o};for(let o=r;o>=0;o--){const s=this.dataBuffer[o],a=i(s,o);if(a)return a}for(let o=0;o<this.dataBuffer.length;o++){const s=this.dataBuffer[o],a=i(s,o);if(a)return a}}getCurrentFrame(){return this.index>=this.dataBuffer.length?this.dataBuffer[this.dataBuffer.length-1]:this.dataBuffer[this.index]}setRate(e){e&&Number.isNaN(Number(e))&&this.progressDispatcher&&this.progressDispatcher("error",`${Pn("helpers_invalid_parameter_rate_x",{x:e})}`),this.rate=e||this.rate,U.dao.channel().setPlaybackRateAfterHooks(this.rate)}buffer(e){this.dataBuffer=this.dataBuffer.concat(e),this.firstFrameTime=this.dataBuffer[0].timestamp}pause(){if(this.logger("Click Pause!"),!this.playing){ct.warn("Do not pause more than one time");return}this.playing=!1}resume(){this.resumeTime=this.resumeTime||0,this.resumeTime>0?this.isReplay=!0:this.preFrameTime=Date.now(),this.playing=!0,this.isStopMovePosition=!1,window.requestAnimationFrame(this.step)}restart(){this.preFrameTime=Date.now(),this.playing=!0,this.preFireTreeIndex={},this.preTerminalIndex={},this.preDebugIndex={},this.preClaudeCodeIndex={},this.preTerminalDockerId="",this.preConsoleDockerId="",this.preClaudeCodeDockerId="",he.file.reset(),this.index=0,window.requestAnimationFrame(this.step)}movePosition(e){var n;if(!((n=this.dataBuffer)!=null&&n.length)){this.resumeTime=e;return}this.isStopMovePosition=!this.playing,this.resumeTime=e,this.isReplay=!0,this.index=this.findFrameByTimeStamp(),this.isMovePosition=!0,this.preTerminalIndex={},this.preDebugIndex={},this.preClaudeCodeIndex={},he.dao.resetTerminal(),he.dao.resetConsole(),he.dao.resetClaudeCode(),U.dao.channel().xtermStatus({resetConsole:!0,resetClaudeCode:!0}),window.requestAnimationFrame(this.step)}findFrameByTimeStamp(){const e=this.resumeTime+this.firstFrameTime,n=this.dataBuffer,r=n.length,i=(a,l)=>{var c,u,d,f;if(a<=l){const h=Math.floor((l-a)/2+a),m=n[h].timestamp;return m===e?h:e===((c=n[h-1])==null?void 0:c.timestamp)?h-1:e===((u=n[h+1])==null?void 0:u.timestamp)?h+1:e>((d=n[h-1])==null?void 0:d.timestamp)&&e<((f=n[h+1])==null?void 0:f.timestamp)?h:(e<m?l=h-1:e>m&&(a=h+1),i(a,l))}else return ct.warn("Do not find the next frame"),this.index=0,this.resumeTime=0,this.resume(),this.index},o=0,s=r-1;return i(o,s)}gotoNextFrame(){var e;!this.isStopMovePosition&&((e=this.progressDispatcher)==null||e.call(this,"progress",this.resumeTime)),this.isStopMovePosition?(this.playing=!1,this.isStopMovePosition=!1):(this.preFrameTime=Date.now(),window.requestAnimationFrame(this.step))}triggerCustomizeEvent(e){var n;(n=this.eventCustomize)==null||n.call(this,e)}step(){var n,r,i;if(!this.playing&&!this.isStopMovePosition)return;if(this.isReplay&&(this.isReplay=!1,this.preFrameTime=Date.now()),this.resumeTime=this.resumeTime+(Date.now()-this.preFrameTime)*this.rate,this.index>this.dataBuffer.length-1){this.playing=!1,this.resumeTime=0,!this.isStopMovePosition&&((n=this.progressDispatcher)==null||n.call(this,"progress",this.totalTime)),(r=this.progressDispatcher)==null||r.call(this,"complete",this.resumeTime);return}let e=this.dataBuffer[this.index];if(!e){this.gotoNextFrame();return}if(e.eventName==="customize"&&(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)&&(this.logger(this.index,e.index,e.eventName,e._id),this.index++,this.triggerCustomizeEvent(e)),!this.isStopMovePosition)){this.gotoNextFrame();return}if(this.isMovePosition){this.triggerPreFrames(),this.isMovePosition=!1;return}if(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)){let o=0;const s=this.firstFrameTime+this.resumeTime;for(let a=this.index+1;a<this.dataBuffer.length&&this.dataBuffer[a].timestamp<=s;a++)o++,this.index=a;o>0&&(e=this.dataBuffer[this.index],this.isMovePosition=!0),this.isMovePosition?(this.triggerPreFrames(),this.isMovePosition=!1):(e=((i=this.getPlaybackSnapshot)==null?void 0:i.call(this,e.eventName,e,this.getPreFrameByFrame(e,this.index)||e))||e,this.setPreFrameData(e,this.index)),this.trigger(e.eventName,e)}else this.isMovePosition&&(this.triggerPreFrames(),this.isMovePosition=!1);this.gotoNextFrame()}getPreFrameByFrame(e,n){const{eventName:r,dockerId:i}=e,o=this.isEditor(r),s=this.isFileTree(r);let a;if(o){const{data:{openedPath:l}}=e;for(let c=n-1;c>=0;c--){const u=this.dataBuffer[c];if(u.dockerId===i&&u.eventName===r&&u.data.openedPath===l){a=this.dataBuffer[c],!a.snapshot&&c>=0&&this.setSnapshotByIndex(c);break}}}return s&&(a=this.dataBuffer[this.preFireTreeIndex[i]]),a}setPreFrameData(e,n){const{eventName:r,dockerId:i}=e;this.isFileTree(r)&&(this.preFireTreeIndex[i]=n)}isEditor(e){return e===ot.Editor}isFileTree(e){return e===ot.FileTree}isTerminal(e){return e===ot.Terminal}isConsole(e){return e===ot.Console}isClaudeCode(e){return e===ot.ClaudeCode}isDebug(e){return e===ot.Debug}isTerminalOrConsole(e){return[ot.Terminal.toString(),ot.Console.toString()].includes(e)}isTerminalOrConsoleOrClaudeCode(e){return[ot.Terminal.toString(),ot.Console.toString(),ot.ClaudeCode.toString()].includes(e)}setSnapshotByIndex(e){var o;const n=this.dataBuffer[e],{eventName:r}=n,i=this.isEditor(r);for(let s=0;s<=e;s++){let a=this.dataBuffer[s];if(a.eventName==="customize"&&this.triggerCustomizeEvent(a),a.eventName===n.eventName&&a.dockerId===n.dockerId&&(i?a.data.openedPath===n.data.openedPath:!0)){if(a.snapshot){this.setPreFrameData(a,s);continue}a=((o=this.getPlaybackSnapshot)==null?void 0:o.call(this,a.eventName,a,this.getPreFrameByFrame(a,s)))||a,this.setPreFrameData(a,s)}}}triggerPreFrames(){var s;const e=[ot.FileTree.toString(),ot.Editor.toString(),ot.Terminal.toString(),ot.Console.toString(),ot.ClaudeCode.toString(),ot.Debug.toString()],n=U.file.doc().openedPath;let r=!1;const i=this.index,o=this.dataBuffer[i].dockerId;this.currentDockerId=o;for(let a=i;a>=0;a--){if(!e.length)return;if(e.includes(this.dataBuffer[a].eventName)&&this.dataBuffer[a].dockerId===this.currentDockerId){const l=this.dataBuffer[a],c=e.findIndex(u=>u===l.eventName);e.splice(c,1),l.eventName===ot.Editor.toString()&&!r&&n!==l.data.openedPath&&(U.file.editorView()&&((s=U.file.editorView())==null||s.destroy(),he.file.editorView(void 0)),he.file.resetFile(),r=!0),l.snapshot||this.setSnapshotByIndex(a),this.trigger(l.eventName,l,!1)}}for(let a=0;a<this.customizeData.length;a++)this.customizeData[a].timestamp<=this.dataBuffer[this.index].timestamp&&this.triggerCustomizeEvent(this.customizeData[a]);e.forEach(a=>{this.logger("trigger reset eventName:",a),this.trigger(a,null,!1)})}trigger(e,n,r=!0){if(e==="customize"){this.logger(this.index,e,n==null?void 0:n._id),this.triggerCustomizeEvent(n),r&&this.index++;return}const i=this.isTerminalOrConsole(e),o=this.isDebug(e);if(!i&&!o){this.logger(this.index,e,n==null?void 0:n._id),this.eventDispatcher(e,n),r&&this.index++;return}const s=n==null?void 0:n.dockerId;this.logger("[TR]",s);const a=this.preTerminalIndex[s]||0,l=this.preDebugIndex[s]||0;this.preClaudeCodeIndex[s];const c=o?l:a;for(let u=c+1;u<=this.index;u++){const d=this.dataBuffer[u];d&&(this.isTerminalOrConsoleOrClaudeCode(d.eventName)||o)&&d.dockerId===s&&(this.logger("[TR]",u,this.index,d.eventName,this.dataBuffer[u].dockerId,this.dataBuffer[u]._id),this.isTerminal(e)&&(this.preTerminalDockerId&&this.preTerminalDockerId!==s&&he.dao.resetTerminal(),this.preTerminalDockerId=s),this.isConsole(e)&&(this.preConsoleDockerId&&this.preConsoleDockerId!==s&&(he.dao.resetConsole(),U.dao.channel().xtermStatus({resetConsole:!0})),this.preConsoleDockerId=s),this.isClaudeCode(e)&&(this.preClaudeCodeDockerId&&this.preClaudeCodeDockerId!==s&&(he.dao.resetClaudeCode(),U.dao.channel().xtermStatus({resetClaudeCode:!0})),this.preClaudeCodeDockerId=s),this.eventDispatcher(d.eventName,d))}o?this.preDebugIndex[s]=this.index:this.isClaudeCode(e)?this.preClaudeCodeIndex[s]=this.index:this.preTerminalIndex[s]=this.index,r&&this.index++}}const $Pe="@dao42/d42paas-front",_Pe="0.9.215",SPe="d42paas front",wPe="dao42 paas team",xPe="https://github.com/dao42/d42paas_frontend#readme",kPe="UNLICENSED",QPe="./dist/DaoPaaS.cjs",PPe="./dist/DaoPaaS.cjs",TPe="./dist/DaoPaaS.d.ts",CPe={prebuild:"rimraf dist",build:"cross-env VITE_BUILD_EVENT=true pnpm tsc && pnpm vite && pnpm typedoc",copydist:"cp -r dist/sdk ../demo/public/",vite:"vite build --config ./config/vite.config.ts && shx cp ./src/types/DaoPaaS.d.ts ./dist",typedoc:"npx typedoc --tsconfig ./doc.tsconfig.json",workNameSpaceToFix:"node ./config/workNameSpaceToFix.js",tsc:"tsc -p ./tsconfig.json --isolatedModules false",test1:"jest --coverage",test:"jest",prepublish:"pnpm build"},EPe={"@babel/core":"^7.15.0","@babel/preset-env":"^7.15.0","@codemirror/autocomplete":"^6.6.1","@codemirror/collab":"^6.0.0","@codemirror/commands":"^6.2.3","@codemirror/lang-cpp":"^6.0.2","@codemirror/lang-css":"^6.1.1","@codemirror/lang-html":"^6.0.0","@codemirror/lang-java":"^6.0.1","@codemirror/lang-javascript":"6.0.0","@codemirror/lang-json":"^6.0.0","@codemirror/lang-lezer":"^6.0.0","@codemirror/lang-markdown":"^6.1.1","@codemirror/lang-php":"^6.0.0","@codemirror/lang-python":"6.1.2","@codemirror/lang-rust":"^6.0.0","@codemirror/lang-sql":"^6.4.1","@codemirror/lang-xml":"^6.0.0","@codemirror/language":"6.5.0","@codemirror/legacy-modes":"^6.3.2","@codemirror/lint":"^6.0.0","@codemirror/search":"^6.0.0","@codemirror/state":"^6.2.0","@codemirror/theme-one-dark":"^6.0.0","@codemirror/view":"^6.12.0","@emotion/babel-plugin":"^11.3.0","@emotion/babel-preset-css-prop":"^11.2.0","@emotion/core":"^11.0.0","@emotion/css":"^11.1.3","@emotion/eslint-plugin":"^11.2.0","@emotion/react":"^11.9.3","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@open-rpc/client-js":"^1.7.1","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@testing-library/user-event":"^14.4.3","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/lodash.clonedeep":"^4.5.7","@types/lodash.debounce":"^4.0.7","@types/lodash.isequal":"^4.5.6","@types/lodash.throttle":"^4.1.7","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/prop-types":"^15.7.5","@types/react":"^18.0.14","@types/react-dom":"^18.0.5","@types/react-transition-group":"^4.4.5","@types/testing-library__jest-dom":"^5.14.5","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@udecode/zustood":"^1.1.1","@vitejs/plugin-react":"^1.0.7",ahooks:"^3.3.10","babel-loader":"^8.2.2",bufferutil:"^4.0.6",classnames:"^2.3.1",codemirror:"^6.0.0",concurrently:"^6.3.0","cross-env":"^7.0.3",devicon:"^2.14.0",dexie:"^3.2.0","file-icons-js":"^1.1.0","file-loader":"^6.2.0","fs-extra":"^10.0.0","glob-all":"^3.2.1","highlight.js":"^11.6.0","hotkeys-js":"^3.9.4",immer:"^9.0.14",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15","prop-types":"^15.8.1",react:"^18.2.0","react-complex-tree":"^1.1.6","react-content-loader":"^6.2.0","react-dom":"18.2.0","react-icons":"^4.3.1","react-transition-group":"^4.4.2","rehype-document":"^6.1.0","rehype-highlight":"^5.0.2","rehype-katex":"^6.0.2","rehype-stringify":"^9.0.3","remark-gfm":"^3.0.1","remark-math":"^5.1.1","remark-parse":"^10.0.1","remark-rehype":"^10.1.0",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.9.0",sass:"^1.43.2","sass-loader":"^12.2.0",shx:"^0.3.3","socket.io-client":"^4.5.1","source-map-loader":"^3.0.0","style-loader":"^3.3.1",stylis:"^4.0.10","ts-jest":"^27.1.3","ts-loader":"^9.2.5","ts-node":"^10.0.0",typedoc:"^0.22.12",unified:"^10.1.2","use-immer":"^0.7.0","utf-8-validate":"^5.0.9",uuid:"^8.3.2",vite:"^2.9.15","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2",xterm:"^5.1.0","xterm-addon-attach":"^0.8.0","xterm-addon-fit":"^0.7.0",zustand:"4.0.0"},RPe=["dist"],APe={type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},IPe={url:"https://github.com/dao42/d42paas_frontend/issues"},XPe={workerDirectory:"src"},DPe={"@babel/plugin-transform-modules-commonjs":"^7.18.2",anymatch:"^3.1.3","babel-jest":"^29.3.1","babel-preset-react-app":"^10.0.1","codemirror-lang-elixir":"^3.0.0","detect-indent":"^7.0.1",i18next:"^21.8.16","jest-websocket-mock":"^2.4.0",lib0:"^0.2.58","lodash.clonedeep":"^4.5.0","lodash.debounce":"^4.0.8","lodash.isequal":"^4.5.0","lodash.throttle":"^4.1.1","range-analyzer":"0.1.1-alpha.2","rc-dropdown":"^4.0.1","rc-image":"^7.2.0","rc-menu":"^9.6.3","react-app-polyfill":"^3.0.0","react-i18next":"11.18.3",rrweb:"2.0.0-alpha.8","rrweb-player":"1.0.0-alpha.4","socket.io":"^4.5.1","socket.io-mock":"^1.3.2","socket.io-msgpack-parser":"^3.0.1","xterm-addon-web-links":"^0.8.0"},NPe={worker_threads:!1};var zPe={name:$Pe,version:_Pe,description:SPe,author:wPe,homepage:xPe,license:kPe,main:QPe,module:PPe,types:TPe,scripts:CPe,devDependencies:EPe,files:RPe,repository:APe,bugs:IPe,msw:XPe,dependencies:DPe,browser:NPe};const MPe=()=>zPe.version,LPe=async(t,e,n)=>{const r=window.navigator.cookieEnabled?window.localStorage.getItem("__paas__testServerCode__"):null,i=r?{serverCode:r}:{};return new Promise((o,s)=>{fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:n,...i})}).then(a=>a.json()).then(a=>{o(a)}).catch(a=>{s(a)})})},$J=(t,e=1)=>{t=t||"#ffffff";let n=t.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),o=parseInt(n.substring(4,6),16);return e>1&&e<=100&&(e=e/100),`rgba(${r},${i},${o},${e})`},UPe=()=>{const t=`
|
|
49
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S2e(t){return OJ(t)||pJ(t)||RA(t)||mJ()}function SL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function wL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?SL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):SL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var w2e={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,n){console&&console[e]&&console[e].apply(console,n)}},x2e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wa(this,t),this.init(e,n)}return xa(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||w2e,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,i,o){return o&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(i).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new t(this.logger,wL(wL({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new t(this.logger,n)}}]),t}(),Tu=new x2e,fh=function(){function t(){wa(this,t),this.observers={}}return xa(t,[{key:"on",value:function(n,r){var i=this;return n.split(" ").forEach(function(o){i.observers[o]=i.observers[o]||[],i.observers[o].push(r)}),this}},{key:"off",value:function(n,r){if(!!this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(i){return i!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(l){l.apply(void 0,i)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(i))})}}}]),t}();function j0(){var t,e,n=new Promise(function(r,i){t=r,e=i});return n.resolve=t,n.reject=e,n}function xL(t){return t==null?"":""+t}function k2e(t,e,n){t.forEach(function(r){e[r]&&(n[r]=e[r])})}function AA(t,e,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!t||typeof t=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={}}return i()?{}:{obj:t,k:r(o.shift())}}function kL(t,e,n){var r=AA(t,e,Object),i=r.obj,o=r.k;i[o]=n}function Q2e(t,e,n,r){var i=AA(t,e,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function Zw(t,e){var n=AA(t,e),r=n.obj,i=n.k;if(!!r)return r[i]}function QL(t,e,n){var r=Zw(t,n);return r!==void 0?r:Zw(e,n)}function gJ(t,e,n){for(var r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):gJ(t[r],e[r],n):t[r]=e[r]);return t}function Ap(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var P2e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function T2e(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,function(e){return P2e[e]}):t}var SQ=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,C2e=[" ",",","?","!",";"];function E2e(t,e,n){e=e||"",n=n||"";var r=C2e.filter(function(a){return e.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(t);if(!o){var s=t.indexOf(n);s>0&&!i.test(t.substring(0,s))&&(o=!0)}return o}function PL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Z$(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function R2e(t){var e=A2e();return function(){var r=gc(t),i;if(e){var o=gc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return n0(this,i)}}function A2e(){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 vJ(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!t){if(t[e])return t[e];for(var r=e.split(n),i=t,o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];l===void 0&&r.length>o+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=r.slice(o+s).join(n);return c?vJ(l,c,n):void 0}i=i[r[o]]}return i}}var I2e=function(t){Ch(n,t);var e=R2e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return wa(this,n),i=e.call(this),SQ&&fh.call(Sl(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return xa(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[i,o];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(u=i.split("."));var d=Zw(this.data,u);return d||!c||typeof s!="string"?d:vJ(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var u=[i,o];s&&(u=u.concat(c?s.split(c):s)),i.indexOf(".")>-1&&(u=i.split("."),a=o,o=u[1]),this.addNamespaces(o),kL(this.data,u,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[i,o];i.indexOf(".")>-1&&(u=i.split("."),a=s,s=o,o=u[1]),this.addNamespaces(o);var d=Zw(this.data,u)||{};a?gJ(d,s,l):d=Z$(Z$({},d),s),kL(this.data,u,d),c.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Z$(Z$({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(fh),bJ={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,n,r,i,o){var s=this;return e.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,i,o))}),n}};function TL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function oa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?TL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):TL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function X2e(t){var e=D2e();return function(){var r=gc(t),i;if(e){var o=gc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return n0(this,i)}}function D2e(){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}}var CL={},EL=function(t){Ch(n,t);var e=X2e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wa(this,n),i=e.call(this),SQ&&fh.call(Sl(i)),k2e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Sl(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Tu.create("translator"),i}return xa(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],c=s&&i.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!E2e(i,s,a);if(c&&!u){var d=i.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:i,namespaces:l};var f=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(f[0])>-1)&&(l=f.shift()),i=f.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(Ai(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=this.extractFromKey(i[i.length-1],o),d=u.key,f=u.namespaces,h=f[f.length-1],m=o.lng||this.language,g=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&m.toLowerCase()==="cimode"){if(g){var p=o.nsSeparator||this.options.nsSeparator;return l?(O.res="".concat(h).concat(p).concat(d),O):"".concat(h).concat(p).concat(d)}return l?(O.res=d,O):d}var O=this.resolve(i,o),v=O&&O.res,y=O&&O.usedKey||d,_=O&&O.exactUsedKey||d,w=Object.prototype.toString.apply(v),S=["[object Number]","[object Function]","[object RegExp]"],Q=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,C=typeof v!="string"&&typeof v!="boolean"&&typeof v!="number";if(k&&v&&C&&S.indexOf(w)<0&&!(typeof Q=="string"&&w==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var X=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,v,oa(oa({},o),{},{ns:f})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return l?(O.res=X,O):X}if(c){var D=w==="[object Array]",P=D?[]:{},M=D?_:y;for(var Z in v)if(Object.prototype.hasOwnProperty.call(v,Z)){var V="".concat(M).concat(c).concat(Z);P[Z]=this.translate(V,oa(oa({},o),{joinArrays:!1,ns:f})),P[Z]===V&&(P[Z]=v[Z])}v=P}}else if(k&&typeof Q=="string"&&w==="[object Array]")v=v.join(Q),v&&(v=this.extendTranslation(v,i,o,s));else{var G=!1,Y=!1,N=o.count!==void 0&&typeof o.count!="string",q=n.hasDefaultValue(o),R=N?this.pluralResolver.getSuffix(m,o.count,o):"",J=o["defaultValue".concat(R)]||o.defaultValue;!this.isValidLookup(v)&&q&&(G=!0,v=J),this.isValidLookup(v)||(Y=!0,v=d);var ie=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,ee=ie&&Y?void 0:v,ge=q&&J!==v&&this.options.updateMissing;if(Y||G||ge){if(this.logger.log(ge?"updateKey":"missingKey",m,h,d,ge?J:v),c){var le=this.resolve(d,oa(oa({},o),{},{keySeparator:!1}));le&&le.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var me=[],j=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&j&&j[0])for(var ae=0;ae<j.length;ae++)me.push(j[ae]);else this.options.saveMissingTo==="all"?me=this.languageUtils.toResolveHierarchy(o.lng||this.language):me.push(o.lng||this.language);var se=function(ye,_e,De){var We=q&&De!==v?De:ee;a.options.missingKeyHandler?a.options.missingKeyHandler(ye,h,_e,We,ge,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(ye,h,_e,We,ge,o),a.emit("missingKey",ye,h,_e,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?me.forEach(function(be){a.pluralResolver.getSuffixes(be,o).forEach(function(ye){se([be],d+ye,o["defaultValue".concat(ye)]||J)})}):se(me,d,J))}v=this.extendTranslation(v,i,o,O,s),Y&&v===d&&this.options.appendNamespaceToMissingKey&&(v="".concat(h,":").concat(d)),(Y||G)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(d):d,G?v:void 0):v=this.options.parseMissingKeyHandler(v))}return l?(O.res=v,O):v}},{key:"extendTranslation",value:function(i,o,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,oa(oa({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(oa(oa({},s),{interpolation:oa(oa({},this.options.interpolation),s.interpolation)}));var u=typeof i=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(u){var f=i.match(this.interpolator.nestingRegexp);d=f&&f.length}var h=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(h=oa(oa({},this.options.interpolation.defaultVariables),h)),i=this.interpolator.interpolate(i,h,s.lng||this.language,s),u){var m=i.match(this.interpolator.nestingRegexp),g=m&&m.length;d<g&&(s.nest=!1)}s.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var v=arguments.length,y=new Array(v),_=0;_<v;_++)y[_]=arguments[_];return l&&l[0]===y[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(y[0]," in key: ").concat(o[0])),null):c.translate.apply(c,y.concat([o]))},s)),s.interpolation&&this.interpolator.reset()}var p=s.postProcess||this.options.postProcess,O=typeof p=="string"?[p]:p;return i!=null&&O&&O.length&&s.applyPostProcessor!==!1&&(i=bJ.handle(O,i,o,this.options&&this.options.postProcessPassResolved?oa({i18nResolved:a},s):s,this)),i}},{key:"resolve",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,d;return typeof i=="string"&&(i=[i]),i.forEach(function(f){if(!o.isValidLookup(a)){var h=o.extractFromKey(f,s),m=h.key;l=m;var g=h.namespaces;o.options.fallbackNS&&(g=g.concat(o.options.fallbackNS));var p=s.count!==void 0&&typeof s.count!="string",O=p&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),v=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",y=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);g.forEach(function(_){o.isValidLookup(a)||(d=_,!CL["".concat(y[0],"-").concat(_)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(d)&&(CL["".concat(y[0],"-").concat(_)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(y.join(", "),`" won't get resolved as namespace "`).concat(d,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(function(w){if(!o.isValidLookup(a)){u=w;var S=[m];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(S,m,w,_,s);else{var Q;p&&(Q=o.pluralResolver.getSuffix(w,s.count,s));var k="".concat(o.options.pluralSeparator,"zero");if(p&&(S.push(m+Q),O&&S.push(m+k)),v){var C="".concat(m).concat(o.options.contextSeparator).concat(s.context);S.push(C),p&&(S.push(C+Q),O&&S.push(C+k))}}for(var X;X=S.pop();)o.isValidLookup(a)||(c=X,a=o.getResource(w,_,X,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:u,usedNS:d}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),n}(fh);function p4(t){return t.charAt(0).toUpperCase()+t.slice(1)}var N2e=function(){function t(e){wa(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Tu.create("languageUtils")}return xa(t,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=p4(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=p4(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=p4(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var s=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var s=r.getLanguagePartFromCode(o);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(c){!c||(i.isSupportedCode(c)?s.push(c):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),t}(),z2e=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],M2e={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}},L2e=["v1","v2","v3"],RL={zero:0,one:1,two:2,few:3,many:4,other:5};function U2e(){var t={};return z2e.forEach(function(e){e.lngs.forEach(function(n){t[n]={numbers:e.nr,plurals:M2e[e.fc]}})}),t}var q2e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wa(this,t),this.languageUtils=e,this.options=n,this.logger=Tu.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=U2e()}return xa(t,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return RL[s]-RL[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):o.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!L2e.includes(this.options.compatibilityJSON)}}]),t}();function AL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Tc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?AL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):AL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var W2e=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wa(this,t),this.logger=Tu.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(n){return n},this.init(e)}return xa(t,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:T2e,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ap(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ap(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ap(r.nestingPrefix):r.nestingPrefixEscaped||Ap("$t("),this.nestingSuffix=r.nestingSuffix?Ap(r.nestingSuffix):r.nestingSuffixEscaped||Ap(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var s=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(p){return p.replace(/\$/g,"$$$$")}var f=function(O){if(O.indexOf(s.formatSeparator)<0){var v=QL(r,u,O);return s.alwaysFormat?s.format(v,void 0,i,Tc(Tc(Tc({},o),r),{},{interpolationkey:O})):v}var y=O.split(s.formatSeparator),_=y.shift().trim(),w=y.join(s.formatSeparator).trim();return s.format(QL(r,u,_),w,i,Tc(Tc(Tc({},o),r),{},{interpolationkey:_}))};this.resetRegExp();var h=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,m=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,g=[{regex:this.regexpUnescape,safeValue:function(O){return d(O)}},{regex:this.regexp,safeValue:function(O){return s.escapeValue?d(s.escape(O)):d(O)}}];return g.forEach(function(p){for(c=0;a=p.regex.exec(n);){var O=a[1].trim();if(l=f(O),l===void 0)if(typeof h=="function"){var v=h(n,a,o);l=typeof v=="string"?v:""}else if(o&&o.hasOwnProperty(O))l="";else if(m){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(O," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=xL(l));var y=p.safeValue(l);if(n=n.replace(a[0],y),m?(p.regex.lastIndex+=l.length,p.regex.lastIndex-=a[0].length):p.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=Tc({},o);l.applyPostProcessor=!1,delete l.defaultValue;function c(h,m){var g=this.nestingOptionsSeparator;if(h.indexOf(g)<0)return h;var p=h.split(new RegExp("".concat(g,"[ ]*{"))),O="{".concat(p[1]);h=p[0],O=this.interpolate(O,l);var v=O.match(/'/g),y=O.match(/"/g);(v&&v.length%2===0&&!y||y.length%2!==0)&&(O=O.replace(/'/g,'"'));try{l=JSON.parse(O),m&&(l=Tc(Tc({},m),l))}catch(_){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),_),"".concat(h).concat(g).concat(O)}return delete l.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var u=[],d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var f=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=f.shift(),u=f,d=!0}if(a=r(c.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=xL(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),d&&(a=u.reduce(function(h,m){return i.format(h,m,o.lng,Tc(Tc({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),t}();function IL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function yf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?IL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):IL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function B2e(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(e==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(e==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(!!s){var a=s.split(":"),l=S2e(a),c=l[0],u=l.slice(1),d=u.join(":").trim().replace(/^'+|'+$/g,"");n[c.trim()]||(n[c.trim()]=d),d==="false"&&(n[c.trim()]=!1),d==="true"&&(n[c.trim()]=!0),isNaN(d)||(n[c.trim()]=parseInt(d,10))}})}}return{formatName:e,formatOptions:n}}function Ip(t){var e={};return function(r,i,o){var s=i+JSON.stringify(o),a=e[s];return a||(a=t(i,o),e[s]=a),a(r)}}var Y2e=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wa(this,t),this.logger=Tu.create("formatter"),this.options=e,this.formats={number:Ip(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:Ip(function(n,r){var i=new Intl.NumberFormat(n,yf(yf({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Ip(function(n,r){var i=new Intl.DateTimeFormat(n,yf({},r));return function(o){return i.format(o)}}),relativetime:Ip(function(n,r){var i=new Intl.RelativeTimeFormat(n,yf({},r));return function(o){return i.format(o,r.range||"day")}}),list:Ip(function(n,r){var i=new Intl.ListFormat(n,yf({},r));return function(o){return i.format(o)}})},this.init(e)}return xa(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Ip(r)}},{key:"format",value:function(n,r,i,o){var s=this,a=r.split(this.formatSeparator),l=a.reduce(function(c,u){var d=B2e(u),f=d.formatName,h=d.formatOptions;if(s.formats[f]){var m=c;try{var g=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},p=g.locale||g.lng||o.locale||o.lng||i;m=s.formats[f](c,p,yf(yf(yf({},h),o),g))}catch(O){s.logger.warn(O)}return m}else s.logger.warn("there was no format function for ".concat(f));return c},n);return l}}]),t}();function XL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function DL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?XL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function F2e(t){var e=V2e();return function(){var r=gc(t),i;if(e){var o=gc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return n0(this,i)}}function V2e(){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 Z2e(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var j2e=function(t){Ch(n,t);var e=F2e(n);function n(r,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return wa(this,n),s=e.call(this),SQ&&fh.call(Sl(s)),s.backend=r,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=Tu.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return xa(n,[{key:"queueLoad",value:function(i,o,s,a){var l=this,c={},u={},d={},f={};return i.forEach(function(h){var m=!0;o.forEach(function(g){var p="".concat(h,"|").concat(g);!s.reload&&l.store.hasResourceBundle(h,g)?l.state[p]=2:l.state[p]<0||(l.state[p]===1?u[p]===void 0&&(u[p]=!0):(l.state[p]=1,m=!1,u[p]===void 0&&(u[p]=!0),c[p]===void 0&&(c[p]=!0),f[g]===void 0&&(f[g]=!0)))}),m||(d[h]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],c=a[1];o&&this.emit("failedLoading",l,c,o),s&&this.store.addResourceBundle(l,c,s),this.state[i]=o?-1:2;var u={};this.queue.forEach(function(d){Q2e(d.loaded,[l],c),Z2e(d,i),o&&d.errors.push(o),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(f){u[f]||(u[f]={});var h=d.loaded[f];h.length&&h.forEach(function(m){u[f][m]===void 0&&(u[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!i.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:c,callback:u});return}return this.readingCalls++,this.backend[s](i,o,function(d,f){if(a.readingCalls--,a.waitingReads.length>0){var h=a.waitingReads.shift();a.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(d&&f&&l<a.maxRetries){setTimeout(function(){a.read.call(a,i,o,s,l+1,c*2,u)},c);return}u(d,f)})}},{key:"prepareLoading",value:function(i,o){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var c=this.queueLoad(i,o,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(u,d){u&&o.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&d&&o.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),d),o.loaded(i,u,d)})}},{key:"saveMissing",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,DL(DL({},c),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),n}(fh);function G2e(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var n={};if(Ai(e[1])==="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),Ai(e[2])==="object"||Ai(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(e,n,r,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function NL(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function zL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function cu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?zL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function H2e(t){var e=K2e();return function(){var r=gc(t),i;if(e){var o=gc(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return n0(this,i)}}function K2e(){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 j$(){}function J2e(t){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(t));e.forEach(function(n){typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}var jw=function(t){Ch(n,t);var e=H2e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(wa(this,n),r=e.call(this),SQ&&fh.call(Sl(r)),r.options=NL(i),r.services={},r.logger=Tu,r.modules={external:[]},J2e(Sl(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),n0(r,Sl(r));setTimeout(function(){r.init(i,o)},0)}return r}return xa(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=G2e();this.options=cu(cu(cu({},a),this.options),NL(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=cu(cu({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(O){return O?typeof O=="function"?new O:O:null}if(!this.options.isClone){this.modules.logger?Tu.init(l(this.modules.logger),this.options):Tu.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=Y2e);var u=new N2e(this.options);this.store=new I2e(this.options.resources,this.options);var d=this.services;d.logger=Tu,d.resourceStore=this.store,d.languageUtils=u,d.pluralResolver=new q2e(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(d.formatter=l(c),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new W2e(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new j2e(l(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(O){for(var v=arguments.length,y=new Array(v>1?v-1:0),_=1;_<v;_++)y[_-1]=arguments[_];i.emit.apply(i,[O].concat(y))}),this.modules.languageDetector&&(d.languageDetector=l(this.modules.languageDetector),d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=l(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new EL(this.services,this.options),this.translator.on("*",function(O){for(var v=arguments.length,y=new Array(v>1?v-1:0),_=1;_<v;_++)y[_-1]=arguments[_];i.emit.apply(i,[O].concat(y))}),this.modules.external.forEach(function(O){O.init&&O.init(i)})}if(this.format=this.options.interpolation.format,s||(s=j$),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(O){i[O]=function(){var v;return(v=i.store)[O].apply(v,arguments)}});var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];m.forEach(function(O){i[O]=function(){var v;return(v=i.store)[O].apply(v,arguments),i}});var g=j0(),p=function(){var v=function(_,w){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),g.resolve(w),s(_,w)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return v(null,i.t.bind(i));i.changeLanguage(i.options.lng,v)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),g}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j$,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],u=function(h){if(!!h){var m=o.services.languageUtils.toResolveHierarchy(h);m.forEach(function(g){c.indexOf(g)<0&&c.push(g)})}};if(l)u(l);else{var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.forEach(function(f){return u(f)})}this.options.preload&&this.options.preload.forEach(function(f){return u(f)}),this.services.backendConnector.load(c,this.options.ns,function(f){!f&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(f)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=j0();return i||(i=this.languages),o||(o=this.options.ns),s||(s=j$),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&bJ.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o<this.languages.length;o++){var s=this.languages[o];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=j0();this.emit("languageChanging",i);var l=function(f){s.language=f,s.languages=s.services.languageUtils.toResolveHierarchy(f),s.resolvedLanguage=void 0,s.setResolvedLanguage(f)},c=function(f,h){h?(l(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(f,function(){return s.t.apply(s,arguments)})},u=function(f){!i&&!f&&s.services.languageDetector&&(f=[]);var h=typeof f=="string"?f:s.services.languageUtils.getBestMatchFromCodes(f);h&&(s.language||l(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(m){c(m,h)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function c(u,d){var f;if(Ai(d)!=="object"){for(var h=arguments.length,m=new Array(h>2?h-2:0),g=2;g<h;g++)m[g-2]=arguments[g];f=a.options.overloadTranslationOptionHandler([u,d].concat(m))}else f=cu({},d);f.lng=f.lng||c.lng,f.lngs=f.lngs||c.lngs,f.ns=f.ns||c.ns,f.keyPrefix=f.keyPrefix||s||c.keyPrefix;var p=a.options.keySeparator||".",O=f.keyPrefix?"".concat(f.keyPrefix).concat(p).concat(u):u;return a.t(O,f)};return typeof i=="string"?l.lng=i:l.lngs=i,l.ns=o,l.keyPrefix=s,l}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var u=function(h,m){var g=o.services.backendConnector.state["".concat(h,"|").concat(m)];return g===-1||g===2};if(s.precheck){var d=s.precheck(this,u);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,i)&&(!l||u(c,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=j0();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=j0();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j$,a=cu(cu(cu({},this.options),o),{isClone:!0}),l=new n(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var c=["store","services","language"];return c.forEach(function(u){l[u]=i[u]}),l.services=cu({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new EL(l.services,l.options),l.translator.on("*",function(u){for(var d=arguments.length,f=new Array(d>1?d-1:0),h=1;h<d;h++)f[h-1]=arguments[h];l.emit.apply(l,[u].concat(f))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(fh);pn(jw,"createInstance",function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new jw(t,e)});var Xo=jw.createInstance();Xo.createInstance=jw.createInstance;Xo.createInstance;Xo.init;Xo.loadResources;Xo.reloadResources;Xo.use;Xo.changeLanguage;Xo.getFixedT;var xv=Xo.t;Xo.exists;Xo.setDefaultNamespace;Xo.hasLoadedNamespace;Xo.loadNamespaces;Xo.loadLanguages;function Og(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function wi(t,e){if(t==null)return{};var n,r,i=Og(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var ePe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230);/g,tPe={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026"},nPe=function(e){return tPe[e]},rPe=function(e){return e.replace(ePe,nPe)};function ML(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function LL(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ML(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ML(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var pR={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:rPe},yJ,iPe=E.exports.createContext();function oPe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pR=LL(LL({},pR),t)}function sPe(){return pR}var aPe=function(){function t(){wa(this,t),this.usedNamespaces={}}return xa(t,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),t}();function lPe(t){yJ=t}function cPe(){return yJ}var uPe={type:"3rdParty",init:function(e){oPe(e.options.react),lPe(e)}};function dPe(){if(console&&console.warn){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(t=console).warn.apply(t,n)}}var UL={};function mR(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&UL[e[0]]||(typeof e[0]=="string"&&(UL[e[0]]=new Date),dPe.apply(void 0,e))}function qL(t,e,n){t.loadNamespaces(e,function(){if(t.isInitialized)n();else{var r=function i(){setTimeout(function(){t.off("initialized",i)},0),n()};t.on("initialized",r)}})}function fPe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.languages[0],i=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(l,c){var u=e.services.backendConnector.state["".concat(l,"|").concat(c)];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}function hPe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return mR("i18n.languages were undefined or empty",e.languages),!0;var r=e.options.ignoreJSONStructure!==void 0;return r?e.hasLoadedNamespace(t,{precheck:function(o,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,t))return!1}}):fPe(t,e,n)}function OPe(t,e){var n=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function It(t,e){return OJ(t)||OPe(t,e)||RA(t,e)||mJ()}function WL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function m4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?WL(Object(n),!0).forEach(function(r){pn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):WL(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var pPe=function(e,n){var r=E.exports.useRef();return E.exports.useEffect(function(){r.current=n?r.current:e},[e,n]),r.current};function is(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.i18n,r=E.exports.useContext(iPe)||{},i=r.i18n,o=r.defaultNS,s=n||i||cPe();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new aPe),!s){mR("You will need to pass in an i18next instance by using initReactI18next");var a=function(C){return Array.isArray(C)?C[C.length-1]:C},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&mR("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=m4(m4(m4({},sPe()),s.options.react),e),u=c.useSuspense,d=c.keyPrefix,f=t||o||s.options&&s.options.defaultNS;f=typeof f=="string"?[f]:f||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(f);var h=(s.isInitialized||s.initializedStoreOnce)&&f.every(function(k){return hPe(k,s,c)});function m(){return s.getFixedT(null,c.nsMode==="fallback"?f:f[0],d)}var g=E.exports.useState(m),p=It(g,2),O=p[0],v=p[1],y=f.join(),_=pPe(y),w=E.exports.useRef(!0);E.exports.useEffect(function(){var k=c.bindI18n,C=c.bindI18nStore;w.current=!0,!h&&!u&&qL(s,f,function(){w.current&&v(m)}),h&&_&&_!==y&&w.current&&v(m);function X(){w.current&&v(m)}return k&&s&&s.on(k,X),C&&s&&s.store.on(C,X),function(){w.current=!1,k&&s&&k.split(" ").forEach(function(D){return s.off(D,X)}),C&&s&&C.split(" ").forEach(function(D){return s.store.off(D,X)})}},[s,y]);var S=E.exports.useRef(!0);E.exports.useEffect(function(){w.current&&!S.current&&v(m),S.current=!1},[s]);var Q=[O,s,h];if(Q.t=O,Q.i18n=s,Q.ready=h,h||!h&&!u)return Q;throw new Promise(function(k){qL(s,f,function(){k()})})}var mPe={common_success:"Success",common_confirm:"Confirm",common_cancel:"Cancel",common_delete:"Delete",common_hidden:"Hidden",common_locked:"Locked",common_offline:"Offline",common_directory:"Directory",common_file:"File",editor_no_open_file:"None file opened",editor_search_file:"recently opened",editor_large_file_tip:"The file size is over 16 MB, preview is not supported",editor_unsupported_format_file_cannot_display:"The file cannot be displayed for unsupported format",editor_picture_not_support_preview:"Picture's preview is not yet supported",editor_search_files_by_name:"Search files by name",editor_pending_update:"{{pendingUpdate}} updates to be written",editor_ot_success:"Success",editor_file_is_not_editable:"The file is not editable",editor_image_preview_failed_to_load_image:"Failed to load image",editor_image_preview_loading:"loading",file_tree_click_to_show:"Click to show",file_tree_click_to_hidden:"Click to hide",file_tree_click_to_cancel:"Click to cancel",file_tree_click_to_locked:"Click to lock",file_tree_joined_the_test:"Joined the test",file_tree_click_to_remove:"Click to remove",file_tree_add_test:"Add test",\u7528\u6237\u7F16\u8F91\u8FC7\u6B64\u6587\u4EF6:"This file modifyied by user",file_tree_num_of_files_cannot_exceed_500:"The number of files cannot exceed 500",file_tree_x_existed:"{{x}} existed",\u56DE\u653E\u5DF2\u6682\u505C:"Playback already pause.",\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6:"Cannot open the file with playback mode.",file_tree_x_filtered:"{{x}} filtered",file_tree_x_upload_not_allowed:"Upload of {{x}} not allowed",file_tree_renamed:"Renamed",file_tree_upload_files:"Upload files",file_tree_upload_folder:"Upload folder",show_hidden_files:"Show Hidden files",do_no_show_hidden_files:"Do not show hidden files",file_tree_rename:"Rename",file_tree_create_new_file:"New file",\u8DDF\u968F\u89C6\u89D2:"Follow view browser",\u63A7\u5236\u53F0:"Devtools",\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00:"Open in new tab",\u9000\u51FA\u8DDF\u968F:"Back to normal browser",\u5728\u65B0\u7A97\u53E3\u6253\u5F00:"Open with new tab",file_tree_create_new_folder:"New folder",file_tree_down_file:"Download",file_tree_failed_to_download_file:"Failed to download file",file_tree_make_sure_delete_x_unrecoverable:"Are you sure to delete this {{x}}? The file cannot be recovered after deletion",file_tree_kind_tips:"Notice",file_tree_understood:"Know",file_tree_space_char_exist_in_file_or_folder:"There is a space character",file_tree_file_exceeds_size_limit:"The file {{filePath}} exceeds the size limit of 16M",file_tree_rename_cannot_be_empty:"Rename cannot be empty",output_browser_click_run_start_application:"Click \u3010Run\u3011 to start the application",helpers_invalid_parameter_rate_x:"Invalid parameter: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"The area has already set the answering area and cannot be set repeatedly",lib_x_file_cannot_set_the_answer_area:"The {{x}} file cannot set the answer area",lib_locked:"locked",lib_hidden:"hidden",store_user_not_found:"User not found",store_appStatus_transition_error_x:"AppStatus transition error: {{x}}",dao_channel_agentUserId_x_inconsistent:"The agentUserId {{x}} is inconsistent",dao_channel_event_x_is_not_supported:"Event {{x}} is not supported",dao_channel_connection_not_established:"The connection has not been established yet",dao_channel_playground_not_exist:"Playground does not exist",dao_channel_playground_unbound_container:"Playground unbound container",dao_channel_container_startup_failed:"Container startup failed",dao_channel_insufficient_server_resources:"Insufficient server resources",dao_channel_server_is_busy:"Server is busy",dao_channel_activation_timeout:"Docker activation timeout",dao_channel_docker_failed_to_activate:"Docker failed to start",dao_channel_socket_is_not_ready:"Socket is not ready",dao_channel_socket_is_not_ready_for_x:"Socket is not ready for {{x}}",dao_channel_socket_connect_broken:"Socket connection broken",debug_variables:"Variables",debug_call_stack:"Call stack",debug_staring:"staring",debug_tooltip_run:"Run",debug_tooltip_stop:"Stop",debug_tooltip_continue:"Continue",debug_tooltip_step_over:"Step Over",debug_tooltip_step_into:"Step Into",debug_tooltip_step_out:"Step Out",debug_call_stack_cannot_open_file:"Cannot open non-workspace file",dao_paas_cannot_follow_each_other:"Cannot follow each other",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"Cannt copy the content",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"Cannt edit the content",\u79FB\u9664\u4EE3\u7801\u5757\u6807\u8BC6:"Remove block code flag",\u5220\u9664\u4EE3\u7801\u5757:"Remove block code",\u590D\u5236\u4EE3\u7801:"Copy",\u7C98\u8D34\u4EE3\u7801:"Paste",\u786E\u8BA4:"Confirm",\u53D6\u6D88:"Cancel",\u67E5\u770BAI\u4EE3\u7801:"View AI code",\u67E5\u770B\u65E7\u4EE3\u7801:"View origin code",dao_paas_not_find_mount_dom_object_for_x:"Could not find mounted DOM object for {{x}}",dao_paas_x_component_is_not_supported:"{{x}} component is not supported",dao_paas_no_ready:"No ready",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"Pleas go to file tree to select one file and open it","\u8BE5\u6587\u4EF6\u5DF2\u88AB\u8BBE\u7F6E\u4E3A\u9690\u85CF\uFF0C\u65E0\u6CD5\u67E5\u770B":"You cannot view the hide file",dao_paas_file_does_not_exist:"File does not exist",dao_pass_set_answer_wrong:"Get wrong when insert answer for question",dao_paas_docker_has_been_destoryed:"docker has been destroyed","Unable to create file or directory with system reserved name":"Unable to create file or directory with system reserved name","The file or folder {{path}} already exists in this location, please choose another name":"The file or folder {{path}} already exists in this location, please choose another name","No results":"No results","Collapse the file tree":"Collapse the file tree","Create or rename to hidden files, will not be visible":"Create or rename to hidden files, will not be visible","Live refresh":"Live refresh","Code diagnosis":"Code diagnosis",file_tree_title:"Files",keyword_search_toolbar_title:"Search",keyword_search_btn_refresh:"Refresh",keyword_search_btn_clear:"Clear",keyword_search_btn_collapse:"Expand/Collapse All",keyword_search_btn_replace_all:"Replace All({{press}})",keyword_search_btn_preserve:"Preserve Case({{press}})",keyword_search_btn_case:"Match Case({{press}})",keyword_search_btn_whole:"Match Whole Word({{press}})",keyword_search_btn_expression:"Use Regular Expression({{press}})",keyword_search_modal_title:"Replace all",keyword_search_modal_okText:"Confirm replace",keyword_search_modal_cancelText:"Cancel",keyword_search_modal_tips_has_value:"Whether to replace {{words}} {{wordMore}} in {{file}} {{fileMore}} with {{text}}",keyword_search_modal_tips_empty_value:"Whether to replace {{words}} {{wordMore}} in {{file}} {{fileMore}}",keyword_search_input_enter_placeholder:"Please enter",keyword_search_input_replace_placeholder:"Replace",keyword_search_doing:"Searching...",keyword_search_nothing:"Not results found, try to enter other keyword",keyword_search_found:"{{words}} {{wordMore}} in {{file}} {{fileMore}}"},gPe={common_success:"\u6210\u529F",common_confirm:"\u786E\u5B9A",common_cancel:"\u53D6\u6D88",common_delete:"\u5220\u9664",common_hidden:"\u5DF2\u9690\u85CF",common_locked:"\u5DF2\u52A0\u9501",common_offline:"\u79BB\u7EBF",common_directory:"\u76EE\u5F55",common_file:"\u6587\u4EF6",editor_search_file:"\u6700\u8FD1\u6253\u5F00",editor_no_open_file:"\u672A\u6253\u5F00\u6587\u4EF6",editor_large_file_tip:"\u6587\u4EF6\u8D85\u8FC716\u5146\u5927\u5C0F\uFF0C\u6682\u4E0D\u652F\u6301\u9884\u89C8",editor_unsupported_format_file_cannot_display:"\u6B64\u6587\u4EF6\u662F\u4E8C\u8FDB\u5236\u6587\u4EF6\u6216\u4F7F\u7528\u4E86\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7F16\u7801\uFF0C\u65E0\u6CD5\u5728\u7F16\u8F91\u5668\u4E2D\u663E\u793A",editor_picture_not_support_preview:"\u56FE\u7247\u6682\u65F6\u4E0D\u652F\u6301\u9884\u89C8",editor_search_files_by_name:"\u6309\u540D\u79F0\u641C\u7D22\u6587\u4EF6",editor_pending_update:"{{pendingUpdate}}\u4E2A\u66F4\u65B0\u5F85\u5199\u5165",editor_ot_success:"\u6210\u529F",editor_file_is_not_editable:"\u8BE5\u6587\u4EF6\u4E0D\u53EF\u7F16\u8F91",editor_image_preview_failed_to_load_image:"\u52A0\u8F7D\u56FE\u7247\u5931\u8D25",editor_image_preview_loading:"\u52A0\u8F7D\u4E2D...",file_tree_click_to_show:"\u70B9\u51FB\u663E\u793A",file_tree_click_to_hidden:"\u70B9\u51FB\u9690\u85CF",file_tree_click_to_cancel:"\u70B9\u51FB\u53D6\u6D88",file_tree_click_to_locked:"\u70B9\u51FB\u9501\u5B9A",file_tree_joined_the_test:"\u5DF2\u52A0\u5165\u6D4B\u8BD5",file_tree_click_to_remove:"\u70B9\u51FB\u79FB\u9664",file_tree_add_test:"\u6DFB\u52A0\u6D4B\u8BD5",\u7528\u6237\u7F16\u8F91\u8FC7\u6B64\u6587\u4EF6:"\u7528\u6237\u7F16\u8F91\u8FC7\u6B64\u6587\u4EF6",file_tree_num_of_files_cannot_exceed_500:"\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7500",file_tree_x_existed:"{{x}}\u5DF2\u5B58\u5728",\u56DE\u653E\u5DF2\u6682\u505C:"\u56DE\u653E\u5DF2\u6682\u505C",\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6:"\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6",\u8DDF\u968F\u89C6\u89D2:"\u8DDF\u968F\u89C6\u89D2",\u63A7\u5236\u53F0:"\u5F00\u53D1\u5DE5\u5177",\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00:"\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",\u9000\u51FA\u8DDF\u968F:"\u9000\u51FA\u8DDF\u968F",\u5728\u65B0\u7A97\u53E3\u6253\u5F00:"\u5728\u65B0\u7A97\u53E3\u6253\u5F00",file_tree_x_filtered:"{{x}}\u88AB\u8FC7\u6EE4",file_tree_x_upload_not_allowed:"{{x}}\u4E0D\u5141\u8BB8\u4E0A\u4F20",file_tree_renamed:"\u91CD\u540D\u4E86",file_tree_upload_files:"\u4E0A\u4F20\u6587\u4EF6",file_tree_upload_folder:"\u4E0A\u4F20\u6587\u4EF6\u5939",show_hidden_files:"\u663E\u793A\u9690\u85CF\u6587\u4EF6",do_no_show_hidden_files:"\u4E0D\u663E\u793A\u9690\u85CF\u6587\u4EF6",file_tree_rename:"\u91CD\u547D\u540D",file_tree_create_new_file:"\u65B0\u5EFA\u6587\u4EF6",file_tree_create_new_folder:"\u65B0\u5EFA\u6587\u4EF6\u5939",file_tree_down_file:"\u4E0B\u8F7D",file_tree_failed_to_download_file:"\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25",file_tree_make_sure_delete_x_unrecoverable:"\u786E\u5B9A\u5220\u9664\u8FD9\u4E2A{{x}}\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D",file_tree_kind_tips:"\u6E29\u99A8\u63D0\u793A",file_tree_understood:"\u77E5\u9053\u4E86",file_tree_space_char_exist_in_file_or_folder:"\u5B58\u5728\u7A7A\u683C\u5B57\u7B26",file_tree_file_exceeds_size_limit:"\u6587\u4EF6{{filePath}}\u8D85\u51FA\u4E8616M\u7684\u5927\u5C0F\u9650\u5236",file_tree_rename_cannot_be_empty:"\u91CD\u547D\u540D\u4E0D\u80FD\u4E3A\u7A7A",output_browser_click_run_start_application:"\u70B9\u51FB\u3010\u8FD0\u884C\u3011\u542F\u52A8\u5E94\u7528",helpers_invalid_parameter_rate_x:"\u65E0\u6548\u7684\u53C2\u6570: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"\u8BE5\u533A\u57DF\u5DF2\u8BBE\u7F6E\u7B54\u9898\u533A\uFF0C\u4E0D\u53EF\u91CD\u590D\u8BBE\u7F6E",lib_x_file_cannot_set_the_answer_area:"{{x}}\u6587\u4EF6\u4E0D\u53EF\u4EE5\u8BBE\u7F6E\u7B54\u9898\u533A",lib_locked:"\u52A0\u9501",lib_hidden:"\u9690\u85CF",store_user_not_found:"\u627E\u4E0D\u5230\u7528\u6237",store_appStatus_transition_error_x:"appStatus \u8F6C\u6362\u9519\u8BEF: {{x}}",dao_channel_agentUserId_x_inconsistent:"agentUserId {{x}} \u4E0D\u4E00\u81F4",dao_channel_event_x_is_not_supported:"\u4E8B\u4EF6 {{x}} \u4E0D\u652F\u6301",dao_channel_connection_not_established:"\u8FDE\u63A5\u5C1A\u672A\u5EFA\u7ACB",dao_channel_playground_not_exist:"playground\u4E0D\u5B58\u5728",dao_channel_playground_unbound_container:"playground\u672A\u7ED1\u5B9A\u5BB9\u5668",dao_channel_container_startup_failed:"\u5BB9\u5668\u542F\u52A8\u5931\u8D25",dao_channel_insufficient_server_resources:"\u670D\u52A1\u5668\u8D44\u6E90\u4E0D\u8DB3",dao_channel_server_is_busy:"\u670D\u52A1\u5668\u7E41\u5FD9",dao_channel_activation_timeout:"docker\u6FC0\u6D3B\u8D85\u65F6",dao_channel_docker_failed_to_activate:"docker\u542F\u52A8\u5931\u8D25",dao_channel_socket_is_not_ready:"socket\u672A\u51C6\u5907\u597D",dao_channel_socket_is_not_ready_for_x:"socket \u8FD8\u6CA1\u6709\u4E3A{{x}}\u51C6\u5907\u597D",dao_channel_socket_connect_broken:"socket\u8FDE\u63A5\u4E2D\u65AD",debug_variables:"\u53D8\u91CF",debug_call_stack:"\u8C03\u7528\u5806\u6808",debug_staring:"\u542F\u52A8\u4E2D",debug_tooltip_run:"\u8FD0\u884C",debug_tooltip_stop:"\u505C\u6B62",debug_tooltip_continue:"\u7EE7\u7EED",debug_tooltip_step_over:"\u5355\u6B65\u8DF3\u8FC7",debug_tooltip_step_into:"\u5355\u6B65\u8C03\u8BD5",debug_tooltip_step_out:"\u5355\u6B65\u8DF3\u51FA",debug_call_stack_cannot_open_file:"\u65E0\u6CD5\u6253\u5F00\u975E\u5DE5\u4F5C\u533A\u6587\u4EF6",dao_paas_cannot_follow_each_other:"\u4E0D\u80FD\u4E92\u76F8\u8DDF\u968F",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91",\u79FB\u9664\u4EE3\u7801\u5757\u6807\u8BC6:"\u53D6\u6D88\u6807\u8BC6",\u5220\u9664\u4EE3\u7801\u5757:"\u5220\u9664\u4EE3\u7801",\u590D\u5236\u4EE3\u7801:"\u590D\u5236",\u7C98\u8D34\u4EE3\u7801:"\u7C98\u8D34",\u786E\u8BA4:"\u786E\u8BA4",\u53D6\u6D88:"\u53D6\u6D88",\u67E5\u770BAI\u4EE3\u7801:"\u67E5\u770BAI\u4EE3\u7801",\u67E5\u770B\u65E7\u4EE3\u7801:"\u67E5\u770B\u65E7\u4EE3\u7801",dao_paas_not_find_mount_dom_object_for_x:"\u627E\u4E0D\u5230\u4E3A{{x}}\u7684\u6302\u8F7DDOM\u5BF9\u8C61",dao_paas_x_component_is_not_supported:"\u7EC4\u4EF6{{x}}\u4E0D\u652F\u6301",dao_paas_no_ready:"\u672A\u51C6\u5907",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91","\u8BE5\u6587\u4EF6\u5DF2\u88AB\u8BBE\u7F6E\u4E3A\u9690\u85CF\uFF0C\u65E0\u6CD5\u67E5\u770B":"\u8BE5\u6587\u4EF6\u5DF2\u88AB\u8BBE\u7F6E\u4E3A\u9690\u85CF\uFF0C\u65E0\u6CD5\u67E5\u770B",dao_paas_file_does_not_exist:"\u6587\u4EF6\u4E0D\u5B58\u5728",dao_pass_set_answer_wrong:"\u8BBE\u7F6E\u9898\u76EE\u7B54\u6848\u9519\u8BEF",dao_paas_docker_has_been_destoryed:"docker\u5DF2\u7ECF\u88AB\u9500\u6BC1","Unable to create file or directory with system reserved name":"\u65E0\u6CD5\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u540D\u79F0\u521B\u5EFA\u6587\u4EF6\u6216\u76EE\u5F55","The file or folder {{path}} already exists in this location, please choose another name":"\u6B64\u4F4D\u7F6E\u5DF2\u5B58\u5728\u6587\u4EF6\u6216\u8005\u6587\u4EF6\u5939 {{path}}\uFF0C\u8BF7\u9009\u62E9\u5176\u5B83\u540D\u79F0","No results":"\u6CA1\u6709\u7ED3\u679C","Collapse the file tree":"\u6536\u8D77\u6587\u4EF6\u6811","Create or rename to hidden files, will not be visible":"\u521B\u5EFA\u6216\u8005\u91CD\u547D\u540D\u4E3A\u9690\u85CF\u6587\u4EF6\uFF0C\u5C06\u4E0D\u53EF\u89C1","Live refresh":"\u5B9E\u65F6\u5237\u65B0","Code diagnosis":"\u4EE3\u7801\u8BCA\u65AD",file_tree_title:"\u6587\u4EF6",keyword_search_toolbar_title:"\u641C\u7D22",keyword_search_btn_refresh:"\u5237 \u65B0",keyword_search_btn_clear:"\u6E05 \u9664",keyword_search_btn_collapse:"\u5C55\u5F00/\u6536\u8D77",keyword_search_btn_replace_all:"\u5168\u5C40\u66FF\u6362({{press}})",keyword_search_btn_preserve:"\u4FDD\u7559\u5927\u5C0F\u5199({{press}})",keyword_search_btn_case:"\u5339\u914D\u5927\u5C0F\u5199({{press}})",keyword_search_btn_whole:"\u5168\u8BCD\u5339\u914D({{press}})",keyword_search_btn_expression:"\u6B63\u5219\u8868\u8FBE\u5F0F({{press}})",keyword_search_modal_title:"\u6279\u91CF\u66FF\u6362",keyword_search_modal_okText:"\u786E\u8BA4\u66FF\u6362",keyword_search_modal_cancelText:"\u53D6\u6D88",keyword_search_modal_tips_has_value:"\u662F\u5426\u7528\u300C{{text}}\u300D\u66FF\u6362 {{file}} \u4E2A\u6587\u4EF6\u4E2D\u51FA\u73B0\u7684 {{words}} \u5904\u5173\u952E\u8BCD",keyword_search_modal_tips_empty_value:"\u662F\u5426\u66FF\u6362 {{file}} \u4E2A\u6587\u4EF6\u4E2D\u51FA\u73B0\u7684 {{words}} \u5904\u5173\u952E\u8BCD",keyword_search_input_enter_placeholder:"\u8BF7\u8F93\u5165",keyword_search_input_replace_placeholder:"\u66FF\u6362",keyword_search_doing:"\u641C\u7D22\u4E2D...",keyword_search_nothing:"\u672A\u627E\u5230\u7ED3\u679C\uFF0C\u5C1D\u8BD5\u5176\u4ED6\u5173\u952E\u8BCD\u8BD5\u8BD5",keyword_search_found:"{{file}} \u4E2A\u6587\u4EF6\u4E2D\u7684 {{words}} \u4E2A\u7ED3\u679C"},Gw=(t=>(t.ZH="ZH",t.EN="EN",t))(Gw||{});const vPe={EN:{translation:mPe},ZH:{translation:gPe}},bPe="ZH";Xo.use(uPe).init({resources:vPe,lng:bPe,keySeparator:!1,interpolation:{escapeValue:!1}});const Pn=Xo.t;class yPe{constructor(e,n,r,i,o,s,a,l,c){tt(this,"start");tt(this,"end");tt(this,"totalTime");tt(this,"rate");tt(this,"preFrameTime",0);tt(this,"resumeTime",0);tt(this,"dataBuffer",[]);tt(this,"customizeData",[]);tt(this,"playing",!1);tt(this,"isReplay",!1);tt(this,"index",0);tt(this,"firstFrameTime",0);tt(this,"isMovePosition",!1);tt(this,"preTerminalIndex",{});tt(this,"preDebugIndex",{});tt(this,"preFireTreeIndex",{});tt(this,"preTerminalDockerId","");tt(this,"preConsoleDockerId","");tt(this,"preClaudeCodeIndex",{});tt(this,"preClaudeCodeDockerId","");tt(this,"isStopMovePosition",!1);tt(this,"triggerEventForMaxTimespanRecord","");tt(this,"triggerEventForMaxTimespan",-1);tt(this,"eventCustomize");tt(this,"eventDispatcher");tt(this,"getPlaybackSnapshot");tt(this,"progressDispatcher");tt(this,"currentDockerId");this.start=e,this.end=n,this.rate=1,this.totalTime=n-e,this.customizeData=i,this.triggerEventForMaxTimespan=o,this.eventDispatcher=s,this.progressDispatcher=a,this.getPlaybackSnapshot=l,this.eventCustomize=c,this.step=this.step.bind(this),this.currentDockerId=""}logger(...e){}convertToAbsoluteTime(e){return this.start+e}getFileRootPathByDockerId(e,n){var i,o,s,a;const r=this.index>=this.dataBuffer.length?this.dataBuffer.length-1:this.index;for(let l=r;l>=0;l--){const c=this.dataBuffer[l];if(this.isFileTree(c.eventName)&&c.dockerId===e&&c.data.fileRootPath&&((o=(i=c.data.payload)==null?void 0:i.children)==null?void 0:o.find(d=>d.path===n)))return c.data.fileRootPath}for(let l=0;l<this.dataBuffer.length;l++){const c=this.dataBuffer[l];if(this.isFileTree(c.eventName)&&c.dockerId===e&&c.data.fileRootPath&&((a=(s=c.data.payload)==null?void 0:s.children)==null?void 0:a.find(d=>d.path===n)))return c.data.fileRootPath}}getCurrentDocByPathAndDocker(e,n){const r=this.index>=this.dataBuffer.length?this.dataBuffer.length-1:this.index,i=(o,s)=>{var l;if(this.isEditor(o.eventName)&&o.dockerId===e&&o.data.openedPath===n)return o.snapshot||(o=((l=this.getPlaybackSnapshot)==null?void 0:l.call(this,o.eventName,o,this.getPreFrameByFrame(o,s)))||o),o};for(let o=r;o>=0;o--){const s=this.dataBuffer[o],a=i(s,o);if(a)return a}for(let o=0;o<this.dataBuffer.length;o++){const s=this.dataBuffer[o],a=i(s,o);if(a)return a}}getCurrentFrame(){return this.index>=this.dataBuffer.length?this.dataBuffer[this.dataBuffer.length-1]:this.dataBuffer[this.index]}setRate(e){e&&Number.isNaN(Number(e))&&this.progressDispatcher&&this.progressDispatcher("error",`${Pn("helpers_invalid_parameter_rate_x",{x:e})}`),this.rate=e||this.rate,U.dao.channel().setPlaybackRateAfterHooks(this.rate)}buffer(e){this.dataBuffer=this.dataBuffer.concat(e),this.firstFrameTime=this.dataBuffer[0].timestamp}pause(){if(this.logger("Click Pause!"),!this.playing){ct.warn("Do not pause more than one time");return}this.playing=!1}resume(){this.resumeTime=this.resumeTime||0,this.resumeTime>0?this.isReplay=!0:this.preFrameTime=Date.now(),this.playing=!0,this.isStopMovePosition=!1,window.requestAnimationFrame(this.step)}restart(){this.preFrameTime=Date.now(),this.playing=!0,this.preFireTreeIndex={},this.preTerminalIndex={},this.preDebugIndex={},this.preClaudeCodeIndex={},this.preTerminalDockerId="",this.preConsoleDockerId="",this.preClaudeCodeDockerId="",he.file.reset(),this.index=0,window.requestAnimationFrame(this.step)}movePosition(e){var n;if(!((n=this.dataBuffer)!=null&&n.length)){this.resumeTime=e;return}this.isStopMovePosition=!this.playing,this.resumeTime=e,this.isReplay=!0,this.index=this.findFrameByTimeStamp(),this.isMovePosition=!0,this.preTerminalIndex={},this.preDebugIndex={},this.preClaudeCodeIndex={},he.dao.resetTerminal(),he.dao.resetConsole(),he.dao.resetClaudeCode(),U.dao.channel().xtermStatus({resetConsole:!0,resetClaudeCode:!0}),window.requestAnimationFrame(this.step)}findFrameByTimeStamp(){const e=this.resumeTime+this.firstFrameTime,n=this.dataBuffer,r=n.length,i=(a,l)=>{var c,u,d,f;if(a<=l){const h=Math.floor((l-a)/2+a),m=n[h].timestamp;return m===e?h:e===((c=n[h-1])==null?void 0:c.timestamp)?h-1:e===((u=n[h+1])==null?void 0:u.timestamp)?h+1:e>((d=n[h-1])==null?void 0:d.timestamp)&&e<((f=n[h+1])==null?void 0:f.timestamp)?h:(e<m?l=h-1:e>m&&(a=h+1),i(a,l))}else return ct.warn("Do not find the next frame"),this.index=0,this.resumeTime=0,this.resume(),this.index},o=0,s=r-1;return i(o,s)}gotoNextFrame(){var e;!this.isStopMovePosition&&((e=this.progressDispatcher)==null||e.call(this,"progress",this.resumeTime)),this.isStopMovePosition?(this.playing=!1,this.isStopMovePosition=!1):(this.preFrameTime=Date.now(),window.requestAnimationFrame(this.step))}triggerCustomizeEvent(e){var n;(n=this.eventCustomize)==null||n.call(this,e)}step(){var n,r,i;if(!this.playing&&!this.isStopMovePosition)return;if(this.isReplay&&(this.isReplay=!1,this.preFrameTime=Date.now()),this.resumeTime=this.resumeTime+(Date.now()-this.preFrameTime)*this.rate,this.index>this.dataBuffer.length-1){this.playing=!1,this.resumeTime=0,!this.isStopMovePosition&&((n=this.progressDispatcher)==null||n.call(this,"progress",this.totalTime)),(r=this.progressDispatcher)==null||r.call(this,"complete",this.resumeTime);return}let e=this.dataBuffer[this.index];if(!e){this.gotoNextFrame();return}if(e.eventName==="customize"&&(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)&&(this.logger(this.index,e.index,e.eventName,e._id),this.index++,this.triggerCustomizeEvent(e)),!this.isStopMovePosition)){this.gotoNextFrame();return}if(this.isMovePosition){this.triggerPreFrames(),this.isMovePosition=!1;return}if(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)){let o=0;const s=this.firstFrameTime+this.resumeTime;for(let a=this.index+1;a<this.dataBuffer.length&&this.dataBuffer[a].timestamp<=s;a++)o++,this.index=a;o>0&&(e=this.dataBuffer[this.index],this.isMovePosition=!0),this.isMovePosition?(this.triggerPreFrames(),this.isMovePosition=!1):(e=((i=this.getPlaybackSnapshot)==null?void 0:i.call(this,e.eventName,e,this.getPreFrameByFrame(e,this.index)||e))||e,this.setPreFrameData(e,this.index)),this.trigger(e.eventName,e)}else this.isMovePosition&&(this.triggerPreFrames(),this.isMovePosition=!1);this.gotoNextFrame()}getPreFrameByFrame(e,n){const{eventName:r,dockerId:i}=e,o=this.isEditor(r),s=this.isFileTree(r);let a;if(o){const{data:{openedPath:l}}=e;for(let c=n-1;c>=0;c--){const u=this.dataBuffer[c];if(u.dockerId===i&&u.eventName===r&&u.data.openedPath===l){a=this.dataBuffer[c],!a.snapshot&&c>=0&&this.setSnapshotByIndex(c);break}}}return s&&(a=this.dataBuffer[this.preFireTreeIndex[i]]),a}setPreFrameData(e,n){const{eventName:r,dockerId:i}=e;this.isFileTree(r)&&(this.preFireTreeIndex[i]=n)}isEditor(e){return e===ot.Editor}isFileTree(e){return e===ot.FileTree}isTerminal(e){return e===ot.Terminal}isConsole(e){return e===ot.Console}isClaudeCode(e){return e===ot.ClaudeCode}isDebug(e){return e===ot.Debug}isTerminalOrConsole(e){return[ot.Terminal.toString(),ot.Console.toString()].includes(e)}isTerminalOrConsoleOrClaudeCode(e){return[ot.Terminal.toString(),ot.Console.toString(),ot.ClaudeCode.toString()].includes(e)}setSnapshotByIndex(e){var o;const n=this.dataBuffer[e],{eventName:r}=n,i=this.isEditor(r);for(let s=0;s<=e;s++){let a=this.dataBuffer[s];if(a.eventName==="customize"&&this.triggerCustomizeEvent(a),a.eventName===n.eventName&&a.dockerId===n.dockerId&&(i?a.data.openedPath===n.data.openedPath:!0)){if(a.snapshot){this.setPreFrameData(a,s);continue}a=((o=this.getPlaybackSnapshot)==null?void 0:o.call(this,a.eventName,a,this.getPreFrameByFrame(a,s)))||a,this.setPreFrameData(a,s)}}}triggerPreFrames(){var s;const e=[ot.FileTree.toString(),ot.Editor.toString(),ot.Terminal.toString(),ot.Console.toString(),ot.ClaudeCode.toString(),ot.Debug.toString()],n=U.file.doc().openedPath;let r=!1;const i=this.index,o=this.dataBuffer[i].dockerId;this.currentDockerId=o;for(let a=i;a>=0;a--){if(!e.length)return;if(e.includes(this.dataBuffer[a].eventName)&&this.dataBuffer[a].dockerId===this.currentDockerId){const l=this.dataBuffer[a],c=e.findIndex(u=>u===l.eventName);e.splice(c,1),l.eventName===ot.Editor.toString()&&!r&&n!==l.data.openedPath&&(U.file.editorView()&&((s=U.file.editorView())==null||s.destroy(),he.file.editorView(void 0)),he.file.resetFile(),r=!0),l.snapshot||this.setSnapshotByIndex(a),this.trigger(l.eventName,l,!1)}}for(let a=0;a<this.customizeData.length;a++)this.customizeData[a].timestamp<=this.dataBuffer[this.index].timestamp&&this.triggerCustomizeEvent(this.customizeData[a]);e.forEach(a=>{this.logger("trigger reset eventName:",a),this.trigger(a,null,!1)})}trigger(e,n,r=!0){if(e==="customize"){this.logger(this.index,e,n==null?void 0:n._id),this.triggerCustomizeEvent(n),r&&this.index++;return}const i=this.isTerminalOrConsole(e),o=this.isDebug(e);if(!i&&!o){this.logger(this.index,e,n==null?void 0:n._id),this.eventDispatcher(e,n),r&&this.index++;return}const s=n==null?void 0:n.dockerId;this.logger("[TR]",s);const a=this.preTerminalIndex[s]||0,l=this.preDebugIndex[s]||0;this.preClaudeCodeIndex[s];const c=o?l:a;for(let u=c+1;u<=this.index;u++){const d=this.dataBuffer[u];d&&(this.isTerminalOrConsoleOrClaudeCode(d.eventName)||o)&&d.dockerId===s&&(this.logger("[TR]",u,this.index,d.eventName,this.dataBuffer[u].dockerId,this.dataBuffer[u]._id),this.isTerminal(e)&&(this.preTerminalDockerId&&this.preTerminalDockerId!==s&&he.dao.resetTerminal(),this.preTerminalDockerId=s),this.isConsole(e)&&(this.preConsoleDockerId&&this.preConsoleDockerId!==s&&(he.dao.resetConsole(),U.dao.channel().xtermStatus({resetConsole:!0})),this.preConsoleDockerId=s),this.isClaudeCode(e)&&(this.preClaudeCodeDockerId&&this.preClaudeCodeDockerId!==s&&(he.dao.resetClaudeCode(),U.dao.channel().xtermStatus({resetClaudeCode:!0})),this.preClaudeCodeDockerId=s),this.eventDispatcher(d.eventName,d))}o?this.preDebugIndex[s]=this.index:this.isClaudeCode(e)?this.preClaudeCodeIndex[s]=this.index:this.preTerminalIndex[s]=this.index,r&&this.index++}}const $Pe="@dao42/d42paas-front",_Pe="0.9.216",SPe="d42paas front",wPe="dao42 paas team",xPe="https://github.com/dao42/d42paas_frontend#readme",kPe="UNLICENSED",QPe="./dist/DaoPaaS.cjs",PPe="./dist/DaoPaaS.cjs",TPe="./dist/DaoPaaS.d.ts",CPe={prebuild:"rimraf dist",build:"cross-env VITE_BUILD_EVENT=true pnpm tsc && pnpm vite && pnpm typedoc",copydist:"cp -r dist/sdk ../demo/public/",vite:"vite build --config ./config/vite.config.ts && shx cp ./src/types/DaoPaaS.d.ts ./dist",typedoc:"npx typedoc --tsconfig ./doc.tsconfig.json",workNameSpaceToFix:"node ./config/workNameSpaceToFix.js",tsc:"tsc -p ./tsconfig.json --isolatedModules false",test1:"jest --coverage",test:"jest",prepublish:"pnpm build"},EPe={"@babel/core":"^7.15.0","@babel/preset-env":"^7.15.0","@codemirror/autocomplete":"^6.6.1","@codemirror/collab":"^6.0.0","@codemirror/commands":"^6.2.3","@codemirror/lang-cpp":"^6.0.2","@codemirror/lang-css":"^6.1.1","@codemirror/lang-html":"^6.0.0","@codemirror/lang-java":"^6.0.1","@codemirror/lang-javascript":"6.0.0","@codemirror/lang-json":"^6.0.0","@codemirror/lang-lezer":"^6.0.0","@codemirror/lang-markdown":"^6.1.1","@codemirror/lang-php":"^6.0.0","@codemirror/lang-python":"6.1.2","@codemirror/lang-rust":"^6.0.0","@codemirror/lang-sql":"^6.4.1","@codemirror/lang-xml":"^6.0.0","@codemirror/language":"6.5.0","@codemirror/legacy-modes":"^6.3.2","@codemirror/lint":"^6.0.0","@codemirror/search":"^6.0.0","@codemirror/state":"^6.2.0","@codemirror/theme-one-dark":"^6.0.0","@codemirror/view":"^6.12.0","@emotion/babel-plugin":"^11.3.0","@emotion/babel-preset-css-prop":"^11.2.0","@emotion/core":"^11.0.0","@emotion/css":"^11.1.3","@emotion/eslint-plugin":"^11.2.0","@emotion/react":"^11.9.3","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@open-rpc/client-js":"^1.7.1","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@testing-library/user-event":"^14.4.3","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/lodash.clonedeep":"^4.5.7","@types/lodash.debounce":"^4.0.7","@types/lodash.isequal":"^4.5.6","@types/lodash.throttle":"^4.1.7","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/prop-types":"^15.7.5","@types/react":"^18.0.14","@types/react-dom":"^18.0.5","@types/react-transition-group":"^4.4.5","@types/testing-library__jest-dom":"^5.14.5","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@udecode/zustood":"^1.1.1","@vitejs/plugin-react":"^1.0.7",ahooks:"^3.3.10","babel-loader":"^8.2.2",bufferutil:"^4.0.6",classnames:"^2.3.1",codemirror:"^6.0.0",concurrently:"^6.3.0","cross-env":"^7.0.3",devicon:"^2.14.0",dexie:"^3.2.0","file-icons-js":"^1.1.0","file-loader":"^6.2.0","fs-extra":"^10.0.0","glob-all":"^3.2.1","highlight.js":"^11.6.0","hotkeys-js":"^3.9.4",immer:"^9.0.14",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15","prop-types":"^15.8.1",react:"^18.2.0","react-complex-tree":"^1.1.6","react-content-loader":"^6.2.0","react-dom":"18.2.0","react-icons":"^4.3.1","react-transition-group":"^4.4.2","rehype-document":"^6.1.0","rehype-highlight":"^5.0.2","rehype-katex":"^6.0.2","rehype-stringify":"^9.0.3","remark-gfm":"^3.0.1","remark-math":"^5.1.1","remark-parse":"^10.0.1","remark-rehype":"^10.1.0",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.9.0",sass:"^1.43.2","sass-loader":"^12.2.0",shx:"^0.3.3","socket.io-client":"^4.5.1","source-map-loader":"^3.0.0","style-loader":"^3.3.1",stylis:"^4.0.10","ts-jest":"^27.1.3","ts-loader":"^9.2.5","ts-node":"^10.0.0",typedoc:"^0.22.12",unified:"^10.1.2","use-immer":"^0.7.0","utf-8-validate":"^5.0.9",uuid:"^8.3.2",vite:"^2.9.15","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2",xterm:"^5.1.0","xterm-addon-attach":"^0.8.0","xterm-addon-fit":"^0.7.0",zustand:"4.0.0"},RPe=["dist"],APe={type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},IPe={url:"https://github.com/dao42/d42paas_frontend/issues"},XPe={workerDirectory:"src"},DPe={"@babel/plugin-transform-modules-commonjs":"^7.18.2",anymatch:"^3.1.3","babel-jest":"^29.3.1","babel-preset-react-app":"^10.0.1","codemirror-lang-elixir":"^3.0.0","detect-indent":"^7.0.1",i18next:"^21.8.16","jest-websocket-mock":"^2.4.0",lib0:"^0.2.58","lodash.clonedeep":"^4.5.0","lodash.debounce":"^4.0.8","lodash.isequal":"^4.5.0","lodash.throttle":"^4.1.1","range-analyzer":"0.1.1-alpha.2","rc-dropdown":"^4.0.1","rc-image":"^7.2.0","rc-menu":"^9.6.3","react-app-polyfill":"^3.0.0","react-i18next":"11.18.3",rrweb:"2.0.0-alpha.8","rrweb-player":"1.0.0-alpha.4","socket.io":"^4.5.1","socket.io-mock":"^1.3.2","socket.io-msgpack-parser":"^3.0.1","xterm-addon-web-links":"^0.8.0"},NPe={worker_threads:!1};var zPe={name:$Pe,version:_Pe,description:SPe,author:wPe,homepage:xPe,license:kPe,main:QPe,module:PPe,types:TPe,scripts:CPe,devDependencies:EPe,files:RPe,repository:APe,bugs:IPe,msw:XPe,dependencies:DPe,browser:NPe};const MPe=()=>zPe.version,LPe=async(t,e,n)=>{const r=window.navigator.cookieEnabled?window.localStorage.getItem("__paas__testServerCode__"):null,i=r?{serverCode:r}:{};return new Promise((o,s)=>{fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:n,...i})}).then(a=>a.json()).then(a=>{o(a)}).catch(a=>{s(a)})})},$J=(t,e=1)=>{t=t||"#ffffff";let n=t.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),o=parseInt(n.substring(4,6),16);return e>1&&e<=100&&(e=e/100),`rgba(${r},${i},${o},${e})`},UPe=()=>{const t=`
|
|
50
50
|
@keyframes fadeOut {
|
|
51
51
|
0% {opacity: 1;}
|
|
52
52
|
100% {opacity: 0;}
|
|
@@ -150,10 +150,12 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
150
150
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
151
151
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
152
152
|
PERFORMANCE OF THIS SOFTWARE.
|
|
153
|
-
***************************************************************************** */function VU(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}var xm;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(xm||(xm={}));var Lee={type:"xstate.init"};function R4(t){return t===void 0?[]:[].concat(t)}function em(t){return{type:"xstate.assign",assignment:t}}function ZU(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function cx(t){return function(e){return t===e}}function Uee(t){return typeof t=="string"?{type:t}:t}function jU(t,e){return{value:t,context:e,actions:[],changed:!1,matches:cx(t)}}function GU(t,e,n){var r=e,i=!1;return[t.filter(function(o){if(o.type==="xstate.assign"){i=!0;var s=Object.assign({},r);return typeof o.assignment=="function"?s=o.assignment(r,n):Object.keys(o.assignment).forEach(function(a){s[a]=typeof o.assignment[a]=="function"?o.assignment[a](r,n):o.assignment[a]}),r=s,!1}return!0}),r,i]}function qee(t,e){e===void 0&&(e={});var n=VU(GU(R4(t.states[t.initial].entry).map(function(s){return ZU(s,e.actions)}),t.context,Lee),2),r=n[0],i=n[1],o={config:t,_options:e,initialState:{value:t.initial,actions:r,context:i,matches:cx(t.initial)},transition:function(s,a){var l,c,u=typeof s=="string"?{value:s,context:t.context}:s,d=u.value,f=u.context,h=Uee(a),m=t.states[d];if(m.on){var g=R4(m.on[h.type]);try{for(var p=function(Y){var N=typeof Symbol=="function"&&Symbol.iterator,q=N&&Y[N],R=0;if(q)return q.call(Y);if(Y&&typeof Y.length=="number")return{next:function(){return Y&&R>=Y.length&&(Y=void 0),{value:Y&&Y[R++],done:!Y}}};throw new TypeError(N?"Object is not iterable.":"Symbol.iterator is not defined.")}(g),O=p.next();!O.done;O=p.next()){var v=O.value;if(v===void 0)return jU(d,f);var y=typeof v=="string"?{target:v}:v,_=y.target,w=y.actions,S=w===void 0?[]:w,Q=y.cond,k=Q===void 0?function(){return!0}:Q,C=_===void 0,X=_!=null?_:d,D=t.states[X];if(k(f,h)){var P=VU(GU((C?R4(S):[].concat(m.exit,S,D.entry).filter(function(Y){return Y})).map(function(Y){return ZU(Y,o._options.actions)}),f,h),3),M=P[0],Z=P[1],V=P[2],G=_!=null?_:d;return{value:G,context:Z,actions:M,changed:_!==d||M.length>0||V,matches:cx(G)}}}}catch(Y){l={error:Y}}finally{try{O&&!O.done&&(c=p.return)&&c.call(p)}finally{if(l)throw l.error}}}return jU(d,f)}};return o}var HU=function(t,e){return t.actions.forEach(function(n){var r=n.exec;return r&&r(t.context,e)})};function Wee(t){var e=t.initialState,n=xm.NotStarted,r=new Set,i={_machine:t,send:function(o){n===xm.Running&&(e=t.transition(e,o),HU(e,Uee(o)),r.forEach(function(s){return s(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var s=typeof o=="object"?o:{context:t.config.context,value:o};e={value:s.value,actions:[],context:s.context,matches:cx(s.value)}}return n=xm.Running,HU(e,Lee),i},stop:function(){return n=xm.Stopped,r.clear(),i},get state(){return e},get status(){return n}};return i}function _Ce(t,e){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type===ji.Meta&&r.timestamp<=e)return t.slice(n)}return t}function SCe(t,{getCastFn:e,applyEventsSynchronously:n,emitter:r}){const i=qee({id:"player",context:t,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:em({lastPlayedEvent:(o,s)=>s.type==="CAST_EVENT"?s.payload.event:o.lastPlayedEvent}),recordTimeOffset:em((o,s)=>{let a=o.timeOffset;return"payload"in s&&"timeOffset"in s.payload&&(a=s.payload.timeOffset),Object.assign(Object.assign({},o),{timeOffset:a,baselineTime:o.events[0].timestamp+a})}),play(o){var s;const{timer:a,events:l,baselineTime:c,lastPlayedEvent:u}=o;a.clear();for(const m of l)FU(m,c);const d=_Ce(l,c);let f=u==null?void 0:u.timestamp;(u==null?void 0:u.type)===ji.IncrementalSnapshot&&u.data.source===Hr.MouseMove&&(f=u.timestamp+((s=u.data.positions[0])===null||s===void 0?void 0:s.timeOffset)),c<(f||0)&&r.emit(Gr.PlayBack);const h=new Array;for(const m of d)if(!(f&&f<c&&(m.timestamp<=f||m===u)))if(m.timestamp<c)h.push(m);else{const g=e(m,!1);a.addAction({doAction:()=>{g()},delay:m.delay})}n(h),r.emit(Gr.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:em(o=>Object.assign(Object.assign({},o),{lastPlayedEvent:null})),startLive:em({baselineTime:(o,s)=>(o.timer.start(),s.type==="TO_LIVE"&&s.payload.baselineTime?s.payload.baselineTime:Date.now())}),addEvent:em((o,s)=>{const{baselineTime:a,timer:l,events:c}=o;if(s.type==="ADD_EVENT"){const{event:u}=s.payload;FU(u,a);let d=c.length-1;if(!c[d]||c[d].timestamp<=u.timestamp)c.push(u);else{let m=-1,g=0;for(;g<=d;){const p=Math.floor((g+d)/2);c[p].timestamp<=u.timestamp?g=p+1:d=p-1}m===-1&&(m=g),c.splice(m,0,u)}const f=u.timestamp<a,h=e(u,f);f?h():l.isActive()&&l.addAction({doAction:()=>{h()},delay:u.delay})}return Object.assign(Object.assign({},o),{events:c})})}});return Wee(i)}function wCe(t){const e=qee({id:"speed",context:t,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:em({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Wee(e)}const xCe=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }"],KU=new Map;function Bee(t,e){let n=KU.get(t);return n||(n=new Map,KU.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}function Yf(t,e,n){return r=>AO(this,void 0,void 0,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=yield Yf(t,e,n)(r.args);return yield createImageBitmap.apply(null,i)}else if("index"in r){if(n||e===null)return r;const{rr_type:i,index:o}=r;return Bee(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,s=window[i];return new s(...yield Promise.all(o.map(Yf(t,e,n))))}else{if("base64"in r)return A5e(r.base64);if("src"in r){const i=t.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,t.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=yield Promise.all(r.data.map(Yf(t,e,n)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(Yf(t,e,n)));return r})}function kCe(t,e){try{return e===ax.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch{return null}}const QCe=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function PCe(t,e){if(!(e!=null&&e.constructor))return;const{name:n}=e.constructor;if(!QCe.includes(n))return;const r=Bee(t,n);r.includes(e)||r.push(e)}function TCe({mutation:t,target:e,type:n,imageMap:r,errorHandler:i}){return AO(this,void 0,void 0,function*(){try{const o=kCe(e,n);if(!o)return;if(t.setter){o[t.property]=t.args[0];return}const s=o[t.property],a=yield Promise.all(t.args.map(Yf(r,o))),l=s.apply(o,a);PCe(o,l);const c=!1}catch(o){i(t,o)}})}function CCe({event:t,mutation:e,target:n,imageMap:r,errorHandler:i}){return AO(this,void 0,void 0,function*(){try{const o=n.getContext("2d");if(e.setter){o[e.property]=e.args[0];return}const s=o[e.property];if(e.property==="drawImage"&&typeof e.args[0]=="string")r.get(t),s.apply(o,e.args);else{const a=yield Promise.all(e.args.map(Yf(r,o)));s.apply(o,a)}}catch(o){i(e,o)}})}function JU({event:t,mutation:e,target:n,imageMap:r,canvasEventMap:i,errorHandler:o}){return AO(this,void 0,void 0,function*(){try{const s=i.get(t)||e,a="commands"in s?s.commands:[s];if([ax.WebGL,ax.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){const c=a[l];yield TCe({mutation:c,type:e.type,target:n,imageMap:r,errorHandler:o})}return}for(let l=0;l<a.length;l++){const c=a[l];yield CCe({event:t,mutation:c,target:n,imageMap:r,errorHandler:o})}}catch(s){o(e,s)}})}const ECe=10*1e3,RCe=5*1e3,ACe=Mee||bCe,eq="[replayer]",A4={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function tq(t){return t.type==ji.IncrementalSnapshot&&(t.data.source==Hr.TouchMove||t.data.source==Hr.MouseInteraction&&t.data.type==jo.TouchStart)}class ICe{constructor(e,n){if(this.usingVirtualDom=!1,this.virtualDom=new s0,this.mouseTail=null,this.tailPositions=[],this.emitter=ACe(),this.legacy_missingNodeRetryMap={},this.cache=LU(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=b5e(),this.styleMirror=new R5e,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastMouseDownEvent=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=a=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])!l||(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))},this.applyEventsSynchronously=a=>{for(const l of a){switch(l.type){case ji.DomContentLoaded:case ji.Load:case ji.Custom:continue;case ji.FullSnapshot:case ji.Meta:case ji.Plugin:case ji.IncrementalSnapshot:break}this.getCastFn(l,!0)()}},this.getCastFn=(a,l=!1)=>{let c;switch(a.type){case ji.DomContentLoaded:case ji.Load:break;case ji.Custom:c=()=>{this.emitter.emit(Gr.CustomEvent,a)};break;case ji.Meta:c=()=>this.emitter.emit(Gr.Resize,{width:a.data.width,height:a.data.height});break;case ji.FullSnapshot:c=()=>{var d;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(a,l),(d=this.iframe.contentWindow)===null||d===void 0||d.scrollTo(a.data.initialOffset),this.styleMirror.reset()};break;case ji.IncrementalSnapshot:c=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const d of this.service.state.context.events)if(!(d.timestamp<=a.timestamp)&&this.isUserInteraction(d)){d.delay-a.delay>ECe*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=d);break}if(this.nextUserInteractionEvent){const d=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(d/RCe),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(Gr.SkipStart,f)}}};break}return()=>{c&&c();for(const f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});const d=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[d]){const f=()=>{d<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Gr.Finish))};let h=50;a.type===ji.IncrementalSnapshot&&a.data.source===Hr.MouseMove&&a.data.positions.length&&(h+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,h)}this.emitter.emit(Gr.EventCast,a)}},!(n!=null&&n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:A4,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Gr.Resize,this.handleResize),this.setupDom();for(const a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(Gr.Flush,()=>{if(this.usingVirtualDom){const a={mirror:this.mirror,applyCanvas:(l,c,u)=>{JU({event:l,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,c)=>{l.source===Hr.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===Hr.StyleDeclaration&&this.applyStyleDeclaration(l,c)},afterAppend:(l,c)=>{for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{yu(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[l],u=lx(c.node,this.mirror,this.virtualDom.mirror);yu(u,c.node,a,this.virtualDom.mirror),c.node=u}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(Gr.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});const i=new $Ce([],{speed:this.config.speed});this.service=SCe({events:e.map(a=>n&&n.unpackFn?n.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(Gr.StateChange,{player:a})}),this.speedService=wCe({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(Gr.StateChange,{speed:a})});const o=this.service.state.context.events.find(a=>a.type===ji.Meta),s=this.service.state.context.events.find(a=>a.type===ji.FullSnapshot);if(o){const{width:a,height:l}=o.data;setTimeout(()=>{this.emitter.emit(Gr.Resize,{width:a,height:l})},0)}s&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),(a=this.iframe.contentWindow)===null||a===void 0||a.scrollTo(s.data.initialOffset))},1),this.service.state.context.events.find(tq)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,n){return this.emitter.on(e,n),this}off(e,n){return this.emitter.off(e,n),this}setConfig(e){Object.keys(e).forEach(n=>{e[n],this.config[n]=e[n]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:n.timestamp,totalTime:n.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:n}=this.service.state.context;return e-n[0].timestamp}getMirror(){return this.mirror}play(e=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||r===void 0||r.classList.remove("rrweb-paused"),this.emitter.emit(Gr.Start)}pause(e){var n,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||r===void 0||r.classList.add("rrweb-paused"),this.emitter.emit(Gr.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(Gr.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(Gr.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const n=this.config.unpackFn?this.config.unpackFn(e):e;tq(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=LU()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(yCe(this.iframe.contentWindow,this.iframe.contentDocument),T5e(this.iframe.contentWindow))}rebuildFullSnapshot(e,n=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],i=(a,l)=>{this.collectIframeAndAttachDocument(r,a);for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),P5e(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:l}of r)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Gr.FullsnapshotRebuilded,e),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,n){var r;const i=xCe(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Eee(o,this.virtualDom.unserializedId)),e.insertBefore(o,n),o.rules.push({source:Hr.StyleSheetRule,adds:i.map((s,a)=>({rule:s,index:a}))})}else{const o=document.createElement("style");e.insertBefore(o,n);for(let s=0;s<i.length;s++)(r=o.sheet)===null||r===void 0||r.insertRule(i[s],s)}}attachDocumentToIframe(e,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(s,a)=>{this.collectIframeAndAttachDocument(i,s);const l=r.getMeta(s);if((l==null?void 0:l.type)===ii.Element&&(l==null?void 0:l.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:u}=n.contentDocument;this.insertStyleRules(c,u)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(s,{id:a,replayer:this})};o1(e.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(n.contentDocument,e.node.id);for(const{mutationInQueue:s,builtNode:a}of i)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(e,n){if(T4(n,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(n));r&&e.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var e;const n=(e=this.iframe.contentDocument)===null||e===void 0?void 0:e.head;if(n){const r=new Set;let i,o=this.service.state;const s=()=>{o=this.service.state};this.emitter.on(Gr.Start,s),this.emitter.on(Gr.Pause,s);const a=()=>{this.emitter.off(Gr.Start,s),this.emitter.off(Gr.Pause,s)};n.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Gr.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Gr.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}preloadAllImages(){return AO(this,void 0,void 0,function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(Gr.Start,e),this.emitter.on(Gr.Pause,e);const n=[];for(const r of this.service.state.context.events)r.type===ji.IncrementalSnapshot&&r.data.source===Hr.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(e,n){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);o==null||o.data,JSON.parse(e.args[0]),i==null||i.putImageData(o,0,0)}}deserializeAndPreloadCanvasEvents(e,n){return AO(this,void 0,void 0,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in e){const i=yield Promise.all(e.commands.map(o=>AO(this,void 0,void 0,function*(){const s=yield Promise.all(o.args.map(Yf(this.imageMap,null,r)));return Object.assign(Object.assign({},o),{args:s})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},e),{commands:i}))}else{const i=yield Promise.all(e.args.map(Yf(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},e),{args:i}))}}})}applyIncremental(e,n){var r,i,o;const{data:s}=e;switch(s.source){case Hr.Mutation:{try{this.applyMutation(s,n)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,s)}break}case Hr.Drag:case Hr.TouchMove:case Hr.MouseMove:if(n){const a=s.positions[s.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:s}}else s.positions.forEach(a=>{const l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,n,s)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=s.positions[0])===null||r===void 0?void 0:r.timeOffset)});break;case Hr.MouseInteraction:{if(s.id===-1)break;const a=new Event(jo[s.type].toLowerCase()),l=this.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);this.emitter.emit(Gr.MouseInteraction,{type:s.type,target:l});const{triggerFocus:c}=this.config;switch(s.type){case jo.Blur:"blur"in l&&l.blur();break;case jo.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case jo.Click:case jo.TouchStart:case jo.TouchEnd:case jo.MouseDown:case jo.MouseUp:n?(s.type===jo.TouchStart?this.touchActive=!0:s.type===jo.TouchEnd&&(this.touchActive=!1),s.type===jo.MouseDown?this.lastMouseDownEvent=[l,a]:s.type===jo.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===jo.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===jo.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===jo.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===jo.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case jo.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case Hr.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.scrollData=s;break}this.applyScroll(s,n);break}case Hr.ViewportResize:this.emitter.emit(Gr.Resize,{width:s.width,height:s.height});break;case Hr.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.inputData=s;break}this.applyInput(s);break}case Hr.MediaInteraction:{const a=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);const l=a;try{s.currentTime!==void 0&&(l.currentTime=s.currentTime),s.volume!==void 0&&(l.volume=s.volume),s.muted!==void 0&&(l.muted=s.muted),s.type===1&&l.pause(),s.type===0&&l.play(),s.type===4&&(l.playbackRate=s.playbackRate)}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}break}case Hr.StyleSheetRule:case Hr.StyleDeclaration:{this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&((i=this.virtualDom.mirror.getNode(s.id))===null||i===void 0||i.rules.push(s)):this.applyStyleSheetMutation(s);break}case Hr.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.canvasMutations.push({event:e,mutation:s})}else{const a=this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);JU({event:e,mutation:s,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case Hr.Font:{try{const a=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(o=this.iframe.contentDocument)===null||o===void 0||o.fonts.add(a)}catch(a){this.warn(a)}break}case Hr.Selection:{if(n){this.lastSelectionData=s;break}this.applySelection(s);break}case Hr.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s);break}}}applyMutation(e,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,rCe(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[c],d=Cee(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>r.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var u;const d=r.getNode(c.id);if(!d)return;let f=r.getNode(c.parentId);if(!f)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&e_(f)&&(f=f.shadowRoot),r.removeNodeFromMap(d),f)try{f.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&f.nodeName==="STYLE"&&((u=f.rules)===null||u===void 0?void 0:u.length)>0&&(f.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",f,d,e);else throw h}});const i=Object.assign({},this.legacy_missingNodeRetryMap),o=[],s=c=>{let u=null;return c.nextId&&(u=r.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},a=c=>{var u,d;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(c.parentId);if(!f)return c.node.type===ii.Document?this.newDocumentQueue.push(c):o.push(c);c.node.isShadow&&(e_(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let h=null,m=null;if(c.previousId&&(h=r.getNode(c.previousId)),c.nextId&&(m=r.getNode(c.nextId)),s(c))return o.push(c);if(c.node.rootId&&!r.getNode(c.node.rootId))return;const g=c.node.rootId?r.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(T4(f,r)){this.attachDocumentToIframe(c,f);return}const p=(y,_)=>{if(!this.usingVirtualDom)for(const w of this.config.plugins||[])w.onBuild&&w.onBuild(y,{id:_,replayer:this})},O=o1(c.node,{doc:g,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:p});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:O,mutation:c};return}const v=r.getMeta(f);if(v&&v.type===ii.Element&&v.tagName==="textarea"&&c.node.type===ii.Text){const y=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);for(const _ of y)_.nodeType===f.TEXT_NODE&&f.removeChild(_)}else if((v==null?void 0:v.type)===ii.Document){const y=f;c.node.type===ii.DocumentType&&((u=y.childNodes[0])===null||u===void 0?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&y.removeChild(y.childNodes[0]),O.nodeName==="HTML"&&y.documentElement&&y.removeChild(y.documentElement)}if(h&&h.nextSibling&&h.nextSibling.parentNode?f.insertBefore(O,h.nextSibling):m&&m.parentNode?f.contains(m)?f.insertBefore(O,m):f.insertBefore(O,null):f.appendChild(O),p(O,c.node.id),this.usingVirtualDom&&O.nodeName==="#text"&&f.nodeName==="STYLE"&&((d=f.rules)===null||d===void 0?void 0:d.length)>0&&(f.rules=[]),T4(O,this.mirror)){const y=this.mirror.getId(O),_=this.newDocumentQueue.find(w=>w.parentId===y);_&&(this.attachDocumentToIframe(_,O),this.newDocumentQueue=this.newDocumentQueue.filter(w=>w!==_))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,f,O,c)};e.adds.forEach(c=>{a(c)});const l=Date.now();for(;o.length;){const c=C5e(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const u of c)r.getNode(u.value.parentId)?bee(u,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),E5e(e.texts).forEach(c=>{var u;const d=r.getNode(c.id);if(!d)return e.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);if(d.textContent=c.value,this.usingVirtualDom){const f=d.parentNode;((u=f==null?void 0:f.rules)===null||u===void 0?void 0:u.length)>0&&(f.rules=[])}}),e.attributes.forEach(c=>{const u=r.getNode(c.id);if(!u)return e.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const d in c.attributes)if(typeof d=="string"){const f=c.attributes[d];if(f===null)u.removeAttribute(d);else if(typeof f=="string")try{if(d==="_cssText"&&(u.nodeName==="LINK"||u.nodeName==="STYLE"))try{const h=r.getMeta(u);Object.assign(h.attributes,c.attributes);const m=o1(h,{doc:u.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),g=u.nextSibling,p=u.parentNode;if(m&&p){p.removeChild(u),p.insertBefore(m,g),r.replace(c.id,m);break}}catch{}u.setAttribute(d,f)}catch(h){this.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=f,m=u;for(const g in h)if(h[g]===!1)m.style.removeProperty(g);else if(h[g]instanceof Array){const p=h[g];m.style.setProperty(g,p[0],p[1])}else{const p=h[g];m.style.setProperty(g,p)}}}})}applyScroll(e,n){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)===null||r===void 0||r.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else if((s==null?void 0:s.type)===ii.Document)(i=o.defaultView)===null||i===void 0||i.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"})}catch{}}applyInput(e){const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);try{n.checked=e.isChecked,n.value=e.text}catch{}}applySelection(e){try{const n=new Set,r=e.ranges.map(({start:i,startOffset:o,end:s,endOffset:a})=>{const l=this.mirror.getNode(i),c=this.mirror.getNode(s);if(!l||!c)return;const u=new Range;u.setStart(l,o),u.setEnd(c,a);const d=l.ownerDocument,f=d==null?void 0:d.getSelection();return f&&n.add(f),{range:u,selection:f}});n.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)===null||o===void 0?void 0:o.addRange(i.range))})}catch{}}applyStyleSheetMutation(e){var n;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((n=this.mirror.getNode(e.id))===null||n===void 0?void 0:n.sheet)||null),r&&(e.source===Hr.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===Hr.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,n){var r,i,o,s;if((r=e.adds)===null||r===void 0||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){const{positions:c,index:u}=qU(l);Ev(n.cssRules,c).insertRule(a,u)}else{const c=l===void 0?void 0:Math.min(l,n.cssRules.length);n==null||n.insertRule(a,c)}}catch{}}),(i=e.removes)===null||i===void 0||i.forEach(({index:a})=>{try{if(Array.isArray(a)){const{positions:l,index:c}=qU(a);Ev(n.cssRules,l).deleteRule(c||0)}else n==null||n.deleteRule(a)}catch{}}),e.replace)try{(o=n.replace)===null||o===void 0||o.call(n,e.replace)}catch{}if(e.replaceSync)try{(s=n.replaceSync)===null||s===void 0||s.call(n,e.replaceSync)}catch{}}applyStyleDeclaration(e,n){e.set&&Ev(n.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Ev(n.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var n;const r=this.mirror.getNode(e.id);if(!r)return;(n=e.styles)===null||n===void 0||n.forEach(a=>{var l;let c=null,u=null;if(e_(r)?u=((l=r.ownerDocument)===null||l===void 0?void 0:l.defaultView)||null:r.nodeName==="#document"&&(u=r.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,a.styleId),this.applyStyleSheetRule({source:Hr.StyleSheetRule,adds:a.rules},c)}catch{}});const i=10;let o=0;const s=(a,l)=>{const c=l.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);e_(a)?a.shadowRoot.adoptedStyleSheets=c:a.nodeName==="#document"&&(a.adoptedStyleSheets=c),c.length!==l.length&&o<i&&(setTimeout(()=>s(a,l),0+100*o),o++)};s(r,e.styleIds)}legacy_resolveMissingNode(e,n,r,i){const{previousId:o,nextId:s}=i,a=o&&e[o],l=s&&e[s];if(a){const{node:c,mutation:u}=a;n.insertBefore(c,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,c,u)}if(l){const{node:c,mutation:u}=l;n.insertBefore(c,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,c,u)}}moveAndHover(e,n,r,i,o){const s=this.mirror.getNode(r);if(!s)return this.debugNodeNotFound(o,r);const a=yee(s,this.iframe),l=e*a.absoluteScale+a.x,c=n*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:l,y:c}),this.hoverElements(s)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?A4:Object.assign({},A4,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;const a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=n,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),s(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),s()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var n;(n=this.lastHoveredRootNode||this.iframe.contentDocument)===null||n===void 0||n.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==ji.IncrementalSnapshot?!1:e.data.source>Hr.Mutation&&e.data.source<=Hr.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Gr.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,n){this.warn(`Node with id '${n}' not found. `,e)}warnCanvasMutationFailed(e,n){this.warn("Has error on canvas update",n,"canvas mutation:",e)}debugNodeNotFound(e,n){this.debug(`Node with id '${n}' not found. `,e)}warn(...e){!this.config.showWarning||this.config.logger.warn(eq,...e)}debug(...e){!this.config.showDebug||this.config.logger.log(eq,...e)}}function XCe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var nf=XCe;function nq(t,e){var n,r;for(let i=0;i<t.length;i++){const o=e.index==="."?"":`${e.index}/`;t[i].type==="DIRECTORY"?(n=e==null?void 0:e.children)==null||n.push(`${o}${t[i].name}`):(r=e==null?void 0:e.children)==null||r.push(`${o}${t[i].name}`)}}const Yee=(t,e)=>(t.children=t.children.filter(n=>{const r=e.split(";"),i=n.path.split("/"),o=i[i.length-1];return!r.some(s=>s.startsWith("*")?(s=s.substring(s.indexOf("*")+1),o.endsWith(s)):s.endsWith("*")?(s=s.substring(0,s.lastIndexOf("*")),o.startsWith(s)):s.endsWith("/")?s===o+"/":s===o)}),t.children&&t.children.length>0&&t.children.forEach(n=>{Yee(n,e)}),t);function gg(t){const e=U.dao.playgroundInfo().fileTreeIgnore;if(!t)return{};t=Yee(Mi(t),e||"");const n={},r=t.name;n[r]={index:r,children:[],hasChildren:!0,data:r,canMove:!0},nq(t.children,n[r]);let i=[...t.children],o=[...n[r].children];for(;i.length;){const s=i.length;for(let a=0;a<s;a++){const l=i.shift(),c=o.shift();i=i.concat(l.children);const u={lock:l.lock,hide:l.hide,unittest:l.unittest,isRetainedFile:l.isRetainedFile};switch(l.type){case"DIRECTORY":{const d=c;n[d]={index:d,hasChildren:!0,children:[],data:l.name,type:"DIRECTORY",canMove:!0,canNotExpaned:l.canNotExpaned,...u},l.children.length>0&&nq(l.children,n[d]),o=o.concat(n[d].children)}break;case"FILE":{const d=c;n[d]={index:d,hasChildren:!1,data:l.name,type:"FILE",canMove:!0,canNotExpaned:l.canNotExpaned,...u}}break}}}return Object.values(n).map(s=>{Fee(s,n)}),n}function rq(t){return t.sort((e,n)=>e.localeCompare(n,"EN",{sensitivity:"case"}))}function DCe(t,e){if(t.length<=1)return t;const n=[],r=[];for(let i=0;i<t.length;i+=1){const o=t[i];e[o].hasChildren?n.push(o):r.push(o)}return rq(n),rq(r),n.concat(r)}const Fee=(t,e)=>{t.children&&t.children.length&&(t.children=DCe(t.children,e),t.children.forEach(n=>{Fee(e[n]||{},e)}))},NCe=t=>new Promise(e=>{t==null||t.file(n=>{t.fullPath&&(n.fullPath=t.fullPath.indexOf("/")===0?t.fullPath.substring(1):t.fullPath),e(n)})}),Vee=async(t,e=[])=>{for(let n of t)if(n&&n.isFile){const r=await NCe(n);e.push(r)}else{n=n;const r=n.createReader();await zCe(r,e)}return e},zCe=(t,e)=>new Promise(n=>{t.readEntries(r=>{const i=Vee(r,e);n(i)})}),iq=(t,e)=>{var n,r,i;return{type:t.type,path:e||t.name,name:((n=t.name)==null?void 0:n.lastIndexOf("/"))>-1?(i=t.name)==null?void 0:i.substring(((r=t.name)==null?void 0:r.lastIndexOf("/"))+1):t.name,children:[]}},Zee=(t,e)=>{Object.assign(t,e),t.children.length&&t.children.forEach(n=>{Zee(n,e)})},oq=(t,e,n)=>{var o;let r=t.children,i="";for(const s of e){const a=r.find(l=>l.name===s);if(i+=`${i?"/":""}${s}`,!a&&n==="DELETE")return;!a&&n!=="MOVE"&&r.push({type:"DIRECTORY",name:s,path:i,children:[]}),r=((o=r.find(l=>l.name===s))==null?void 0:o.children)||[]}return r},MCe=(t,e,n)=>{const r=e.name;let i,o=t.children;o=sq(o,n.split("/"),"");const s=r.lastIndexOf("/");return s>-1&&(i=r.substring(0,s),o=sq(o,i.split("/"),n,!0)),o},sq=(t,e,n,r)=>{let i;return e.forEach(o=>{const s=t.find(a=>a.name===o);r&&!s&&(n+=`${n?"/":""}${o}`,i={name:o,path:n,type:"DIRECTORY",children:[]},t.push(i)),t=s?s.children:i.children}),t},jee=(t,e)=>(t.children.forEach(n=>{var r;if(n.path=`${e}/${n.name}`,(r=n==null?void 0:n.children)!=null&&r.length)return jee(n,n.path)}),t),tm=t=>t.lastIndexOf("/")>-1?t.substring(t.lastIndexOf("/")+1):t,LCe=t=>{const e=t.lastIndexOf("/");return e===-1?"":t.substring(0,e)},dd=(t,e,n,r)=>{var u,d;const{data:i}=t;if(!i.files&&(t==null?void 0:t.snapshot)){he.file.setTreeData(gg(t.snapshot));return}if(!e||((d=(u=i.files)==null?void 0:u.length)!=null?d:0)<1)return;const o=i.action,s=n||i.files[0],l=(s.name||"").split("/").slice(0,-1);let c=r?e.children:oq(e,l,o)||[];switch(o){case"CREATE":case"UPLOAD":{let f;r?(c=MCe(e,s,r),f=iq(s,`${r}/${s.name}`)):f=iq(s),c.find(h=>h.path===f.path)||c.push(f);break}case"MOVE":{const f=i.destination||"",h=f.split("/").slice(0,-1),m=oq(e,h,o)||[],g=c.findIndex(O=>O.path===s.name),p=c[g];if(g===-1)return;c.splice(g,1),p.path=f,p.name=tm(f),s.type==="DIRECTORY"&&jee(p,f),m.push(p);break}case"DELETE":{const f=c.findIndex(h=>h.path===s.name);f>-1&&c.splice(f,1);break}case"FEATURE":{const f=c.find(g=>g.path===s.name),m=["lock","hide","unittest","isRetainedFile"].reduce((g,p)=>(s[p]!==void 0&&(g[p]=s[p]),g),{});f&&Zee(f,m);break}}t.snapshot=Mi(e),he.file.setFileTree(e)},UCe=(t,e)=>{const n=t.substring(0,t.lastIndexOf("/")),r=e.substring(0,e.lastIndexOf("/"));return n===r},qCe=(...t)=>t.filter(e=>!!e).join("/"),WCe=t=>t==="."||t&&t.indexOf("/")===-1,I4=t=>U.dao.playgroundInfo().fileTreeIgnore.split(";").map(n=>(n=n.replace(/\./,function(){return"\\."}),n=n.replace(/\*/,function(){return".*"}),n.endsWith("/")&&(n=n.substring(0,n.length-1)),new RegExp(n))).some(n=>n.test(t)),VA=t=>{const e=window.navigator.cookieEnabled?window.localStorage.getItem("showHiddenFiles"):null;let n=e?JSON.parse(e):{};return n=nf(n)?n:{},n[t]===void 0?!1:n[t]},BCe=t=>{const e=t.find(n=>n.size/1048576>=16);if(e){const{fullPath:n}=e;return qr.error(Pn("file_tree_file_exceeds_size_limit",{filePath:n}).toString()),!0}return!1},ux=t=>{const e=U.file.fileTree();if(!e)return null;let n=null;const r=i=>{if(i.path===t){n=i;return}else for(let o=0;o<i.children.length;o++)r(i.children[o])};return r(e),n},Gee=t=>{if(!t)throw new Error("username can't be blank");return`https://ui-avatars.com/api/?background=3A3C40&color=fff&rounded=true&uppercase=true&bold=true&length=1&name=${t}`},Mc="Virtual_",aq={fileTree:[],editor:[],console:[],terminal:[],claudecode:[],simulator:[],focusChange:[],run:[],keyEvent:[],customize:[],debug:[],rrweb:[]},X4={fileTree:t=>{const{snapshot:e}=t;e&&he.file.setFileTree(e)}},YCe=["resourceMonitoring"];class FCe{constructor(){tt(this,"socket");tt(this,"heartbeatInterval",null);tt(this,"playControlSubscribers");tt(this,"componentSubscribersMap");tt(this,"messageListeners");tt(this,"eventListeners");tt(this,"errorListeners");tt(this,"playbackEngine");tt(this,"ioPath");tt(this,"authOptions");tt(this,"isDisconnect");tt(this,"reconnectMaxTimes",10);tt(this,"extraOption");tt(this,"replayer",null);tt(this,"waitingDebugFilePath","");tt(this,"reconnectMaxActiveTimes",5);tt(this,"currentReconnectActiveTimes",1);tt(this,"socketParser","default");tt(this,"customEvents",[]);tt(this,"messageListenersMap",new Map([]));tt(this,"webPlayer");tt(this,"lastClaudeCodeContent","");tt(this,"lastClaudeCodeTimestamp",0);tt(this,"visibilitychange",()=>{var r;const e=this,n=e.socket;ct.log("[registerVisiblityChangeEvent]",document.visibilityState,n==null?void 0:n.active,e.isDisconnect),document.visibilityState==="visible"?(this.uploadLog("registerVisiblityChangeEvent",`active:${n==null?void 0:n.active}, isDisconnect:${e.isDisconnect}`),e.isDisconnect?(n==null||n.disconnect(),this.trigger("message",{name:nt.Reconnecting}),n==null||n.connect(),e.attemptReconnect(),n==null||n.io.reconnection(!0)):(e.attemptReconnect(),n==null||n.io.reconnection(!0))):((r=n==null?void 0:n.io)==null||r.removeListener("reconnect_attempt"),n==null||n.io.reconnection(!1))});tt(this,"gotoPlayBackCacll",e=>{var r,i;if(he.file.resetDebugInfo(),he.file.resetBreakPoints(),U.dao.channel().trigger(ot.StoppedData,{name:ot.StoppedData,payload:{data:[]}}),U.dao.channel().setBreakPoints({},!1),this.playbackEngine.movePosition(e),this.webPlayer){const a=this.webPlayer.getMetaData().startTime+e,l=["endQuestion"];let c;for(let d=this.customEvents.length-1;d>=0;d--){const f=this.customEvents[d];if(l.includes(f.data.tag)&&f.timestamp<=a){c=f;break}}const u=this.webPlayer.getReplayer();c&&c.data.tag==="endQuestion"?u.wrapper.style.visibility="hidden":u.wrapper.style.visibility="visible",(i=this.webPlayer)==null||i.goto(e,!!((r=this.playbackEngine)!=null&&r.playing))}const n=U.dao.playbackStatus();n!=="goToPlayback"&&he.dao.statusBeforeGotoPlayback(n),he.dao.playbackStatus("goToPlayback"),this.restoreAfterGotoPlayback()});tt(this,"goToPlayback",QQ(this.gotoPlayBackCacll,200));tt(this,"restoreAfterGotoPlayback",DJ(()=>{const e=U.dao.statusBeforeGotoPlayback();he.dao.playbackStatus(e)},400));this.eventListeners=new Map,this.messageListeners=[],this.errorListeners=[],this.playControlSubscribers=[],this.extraOption={triggerEventForMaxTimespan:-1},this.ioPath="",this.authOptions=void 0,this.isDisconnect=!1,this.componentSubscribersMap=Mi(aq)}isClaudeCodeTUIRedraw(e){if(/^[\x1B\[\]\d;HJKmABCDEFGHsuhl\?]+$/.test(e)||e.includes("\x1B[s")||e.includes("\x1B[u")||e.includes("\x1B7")||e.includes("\x1B8")||/\x1B\[\d{2,};1H/.test(e)&&e.length<100)return!0;const i=this.cleanANSISequences(e);if(this.isClaudeCodeUIElement(i))return!0;const o=Date.now();if(o-this.lastClaudeCodeTimestamp<100){const a=this.cleanANSISequences(this.lastClaudeCodeContent);if(i===a)return!0}return this.lastClaudeCodeContent=e,this.lastClaudeCodeTimestamp=o,!1}isClaudeCodeUIElement(e){const n=e.trim();return!!(!n||n==="[>>]"||/^[─\-=_]{10,}$/.test(n)||/^\d+\.\s+\d+\s*●\s*(idle|active|busy)/.test(n)||!n.replace(/\[>>\]/g,"").replace(/[─\-=_]/g,"").trim()||!/[a-zA-Z0-9\u4e00-\u9fa5]/.test(n)||n.length<5&&/^[\d\.\s]+$/.test(n))}cleanANSISequences(e){return e.replace(/\x1B\[[0-9;]*m/g,"").replace(/\x1B\[[0-9;]*[ABCDEFGH]/g,"").replace(/\x1B\[[0-9;]*J/g,"").replace(/\x1B\[[0-9;]*K/g,"").replace(/\x1B\[[^\x1B]*?[a-zA-Z]/g,"").replace(/\x1B\][^\x07]*\x07/g,"").replace(/\x1B\][^\x1B]*\x1B\\/g,"")}addMessageListener(e){const n=this.messageListeners.length;this.messageListeners.find(e)?ct.info("[messageLinstener][addMessageListener]\u91CD\u590D\u6CE8\u518C\u4E8B\u4EF6"):this.messageListeners.push(e),ct.info(`[messageLinstener][addMessageListener]${n}-${this.messageListeners.length}`)}addMessageEventListener(e,n){this.messageListenersMap.set(e,n)}removeMessageEventListener(e){if(!e){this.messageListenersMap.clear();return}(typeof e=="string"?[e]:e).forEach(r=>{this.messageListenersMap.set(r,null)})}removeMessageListener(e){const n=this.messageListeners.findIndex(r=>r===e);n>-1&&this.messageListeners.splice(n,1),ct.info("[messageLinstener][removeMessageListener]"+this.messageListeners.length)}addErrorListener(e){const n=this.errorListeners.length;this.errorListeners.find(e)||this.errorListeners.push(e),ct.info(`[messageLinstener][addErrorListener]${n}-${this.errorListeners.length}`)}removeErrorListener(e){const n=this.errorListeners.findIndex(r=>r===e);n>-1&&this.errorListeners.splice(n,1),ct.info("[messageLinstener][removeErrorListener]"+this.errorListeners.length)}startChannel(e,n,r){if(this.socket&&this.socket.connected){ct.warn("The connection is already established");return}this.ioPath=e,this.authOptions=n,this.extraOption=r,this.reconnectMaxTimes=(r==null?void 0:r.reconnectMaxTimes)||this.reconnectMaxTimes,this.socketParser=(r==null?void 0:r.sockerParser)||"default",this.connect(e,n)}attemptReconnect(){var n,r,i,o;const e=this;(r=(n=e==null?void 0:e.socket)==null?void 0:n.io)==null||r.removeListener("reconnect_attempt"),(o=(i=e==null?void 0:e.socket)==null?void 0:i.io)==null||o.on("reconnect_attempt",s=>{var a,l;if(ct.info("[attemptReconnect]",s),s>=this.reconnectMaxTimes){this.transitionError(nt.ConnectionBroken,Pn("dao_channel_socket_connect_broken")),(a=this.socket)==null||a.close();return}U.dao.isError()&&(ct.debug("stop reconnect_attempt"),(l=this.socket)==null||l.close())})}connect(e,n,r=!1){var c,u;U.dao.appStatus()==="drafted"&&this.transitionLoading();const i=e.match(/^(wss?:\/\/[^/]+?)(\/.*)?$/);if(!i)return;const o=i[1],s=i[2],a=U.i18n.getLanguage(),l=(u=(c=this.extraOption)==null?void 0:c.isInsertCrdt)!=null?u:!0;ct.info("Start to connect WS ",o),this.socket=n.mockSocket||IS(o,{path:s||void 0,query:{i18nLanguage:a,isInsertCrdt:l,isReConnect:r},auth:n,transports:["websocket"],parser:this.socketParser==="buffer"?iy:void 0}),this.registerEventsOnSocket(),this.socket.on(ot.Connect,()=>{ct.info("Connect WS successfully"),this.isDisconnect=!1,r&&he.dao.channelAvailable(!0)}),this.socket.on(ot.Disconnect,()=>{if(ct.info("websocket disconnenct"),this.isDisconnect=!0,he.dao.channelAvailable(!1),this.clearHeartbeatInterval(),this.clearSelectionLayer(),U.dao.isReady()){this.transitionOffline(),he.file.closeLspServer();const f=U.dao.playgroundInfo().lspSupported?_O.Uninitialized:_O.NotSupport;U.dao.channel().transitionLspStatus(f),this.updatePlaygroundInfoPartial({lspStatus:f})}}),this.attemptReconnect(),this.socket.on(ot.AuthAck,({result:d,data:f,error:h})=>{if(!d){this.transitionErrorAndHalted(nt.AuthorizationFailed,BL({name:"AuthFailed",error:h}));return}const{agentUserId:m}=f;if(v2e(m),!b2e(m))throw new Error(Pn("dao_channel_agentUserId_x_inconsistent",{x:m}));this.startHeartbeatInterval(),this.updateCurrentAgentUserId(m)}),this.socket.on(ot.TerminalStatus,({value:d})=>{this.updatePlaygroundInfoPartial({terminalStatus:d})}),this.socket.on("initAiCodeInfo",d=>{const f=d.aiRes||[],h=U.file.getOpenedPath(),m=f.filter(p=>p.path===h);he.file.aiCodeInfo(m||[]);const g=U.file.editorView();if(g){const p=g.state.selection.main.head,O=g.state.doc.lineAt(p);U.dao.channel().trigger(nt.ReplayCodeByRange,{name:nt.ReplayCodeByRange,payload:{path:U.file.getOpenedPath(),isUseEvent:!0,content:"",selection:{start:O.to}}})}}),this.socket.on("rrweb",d=>{const f=U.config.replayer();f&&(this.updateReplayerConfig(f,d),this.updateMouseIconDisplay("inline-block"),f.addEvent(d))}),this.socket.on("followBrowser",d=>{this.startRecordBrowser(d.follow)}),this.socket.on("liveBrowser",d=>{var h;if(U.config.recordBrowser()){const m=document.getElementById("dao-browserIframe");if(m){const g=`https://${U.dao.playgroundInfo().url}`;(h=m.contentWindow)==null||h.postMessage(JSON.stringify({type:"live",time:Date.now()}),g)}}})}updateMouseIconDisplay(e){const n=document.querySelector(".d42-browser-container .replayer-wrapper .replayer-mouse");n&&n.style.setProperty("--afterDisplay",e)}updateReplayerConfig(e,n){if(e&&n){e.setConfig({mouseTail:{duration:500,lineCap:"round",lineWidth:2,strokeStyle:n.color}});const r=document.querySelector(".d42-browser-container .replayer-wrapper .replayer-mouse");r&&(r.setAttribute("data-username",n.username||""),r.style.setProperty("--userbackgroundcolor",n.color))}}liveBrowser(){this.send(Dn.LiveBrowser)}authorize(e){this.send(Dn.Authorize,e)}subscribeForComponent(e,n){if(!this.componentSubscribersMap[e])throw new Error(Pn("dao_channel_event_x_is_not_supported",{x:e}));const r=this.componentSubscribersMap[e].findIndex(i=>!!i.onStart);if(r>-1){this.componentSubscribersMap[e][r]=n;return}this.componentSubscribersMap[e].push(n)}unsubscribeForComponent(e,n){const r=this.componentSubscribersMap[e].findIndex(i=>i===n);r>-1&&this.componentSubscribersMap[e].splice(r,1)}subscribeForPlayControl(e){this.playControlSubscribers.push(e)}unsubscribeForPlayControl(e){const n=this.playControlSubscribers.findIndex(r=>r===e);n>-1&&this.playControlSubscribers.splice(n,1)}setPlaybackSummerize(e){let n=0;const{start:r,end:i,customize:o}=e,s=["startQuestion","endQuestion"],a={};o==null||o.forEach(c=>{var h;const{timestamp:u,data:{action:d,value:f}}=c;if(c.costTime=u-r,s.includes(d)){n=f,a[f]=a[f]||[];const m=(h=a[f])==null?void 0:h.length,g=u-r;d==="startQuestion"?a[f].push([g]):m-1<0?a[f][0]=[void 0,g]:a[f][m-1].push(g)}});const l=a[n];return l&&l[l.length-1].length<2&&l[l.length-1].push(i-r),a}setPlaybackEngineData(e,n,r){var d;const{historyBaseData:i=[],playbackData:o}=n,{start:s,end:a,total:l,customize:c=[]}=e;this.playbackEngine=new yPe(s,a,l,c,((d=this.extraOption)==null?void 0:d.triggerEventForMaxTimespan)||-1,this.dispatchDataEvent.bind(this),this.dispatchProgressEvent.bind(this),this.getPlaybackSnapshot.bind(this),this.eventCustomize.bind(this));const u=i.reduce((f,h)=>{var y,_;const{dockerId:m}=h;let g=new Map;f.has(m)&&(g=f.get(m));const p=c.filter(w=>w.dockerId===m),O=(_=(y=p.filter(w=>["startQuestion","endQuestion"].indexOf(w.data.action)>-1)[0])==null?void 0:y.data)==null?void 0:_.value;let v=[];return O&&(v=r[O].reduce((S,Q)=>(S.push(Q.map(k=>k+s)),S),[]).reduce((S,Q)=>{const[k,C]=Q;return S.concat(p.filter(X=>X.timestamp>=k&&X.timestamp<=C))},[])),g.set(h.path,{content:h.content,data:{cheatList:[],changesList:[],customizeList:v}}),f.set(m,g),f},new Map);he.file.setFileBaseHistoryData(u),this.playbackEngine.buffer(o),this.playControlSubscribers.forEach(f=>f.onAvailable())}eventCustomize(e){this.trigger("customize",{name:e.eventName,payload:e})}dealWithActiveEvent(e,n=!0){const{success:r,reason:i,error:o}=e,s={SUCCESS:Pn("common_success"),PLAYGROUND_NOT_EXISTED:Pn("dao_channel_playground_not_exist"),DOCKER_NOT_BIND:Pn("dao_channel_playground_unbound_container"),DOCKER_START_FAIL:Pn("dao_channel_container_startup_failed"),RESOURCE_NOT_ENOUG:Pn("dao_channel_insufficient_server_resources"),BUSY:Pn("dao_channel_server_is_busy"),DOCKER_INFO_LOST:Pn("dao_channel_activation_timeout")},a={status:"ACTIVE",message:""};if(!r){let c=Pn("dao_channel_docker_failed_to_activate");return i&&(c+=`: ${s[i]||i}`),o&&(c+=`- ${o}`),this.currentReconnectActiveTimes>this.reconnectMaxActiveTimes?this.transitionError(nt.ErrorFromServer,c):n&&this.trigger("message",{name:nt.StatusChanged,payload:{status:"INACTIVE"}}),a.status="INACTIVE",a.message=c,a}return U.dao.playgroundInfo().status==="ACTIVE"?(this.currentReconnectActiveTimes=1,a):(this.updatePlaygroundInfoPartial({status:"ACTIVE",playgroundIDEServerStatus:"SYNCED"}),n&&this.trigger("message",{name:nt.StatusChanged,payload:{status:"ACTIVE"}}),this.currentReconnectActiveTimes=1,a)}dealWithPlaybackData(e,n=!0){var O;const r=U.dao.mockPlaybackData();r&&(e=JSON.parse(r));const{playbackSummerize:i,playbackData:o,agentUsers:s,rrwebDataAllData:a={}}=e,{rrwebData:l=[],customEvents:c=[]}=a;this.customEvents=c,he.dao.updateAgentUsers(s);const u=this.setPlaybackSummerize(i),d=[],f=o.playbackData,h=i.start,m=U.dao.noFrameSpan()*1e3;for(let v=0;v<f.length-1;v++)U.dao.noFrameSpan()&&f[v+1].timestamp-f[v].timestamp>=m&&d.push([f[v].timestamp-h,f[v+1].timestamp-h]);const g=document.querySelector(".d42-browser-body");if(g&&l.length>=2){const v=l[0],y=l[l.length-1],_=f[f.length-1];y.timestamp>_.timestamp&&f.push({timestamp:y.timestamp,eventName:"rrweb",data:y.data,agentUserId:_.agentUserId,dockerId:_.dockerId}),l.unshift({...v,timestamp:f[0].timestamp+1}),l.unshift({...v,timestamp:f[f.length-1].timestamp+1});try{const w=U.config.showRRwebController();this.webPlayer=new g5e({target:g,props:{events:l,autoPlay:!1,speedOption:U.config.speedOption(),skipInactive:!1,showController:w,tags:{endQuestion:"red"}}});const S=(O=this.webPlayer)==null?void 0:O.getReplayer();S&&(S.on("event-cast",Q=>{this.updateReplayerConfig(S,Q),this.updateMouseIconDisplay("none"),Q.data.tag==="endQuestion"?S.wrapper.style.visibility="hidden":S.wrapper.style.visibility="visible"}),S.on("mouse-interaction",Q=>{const k=+Q.type==2?"inline-block":"none";this.updateMouseIconDisplay(k)}))}catch(w){ct.error("replay rrweb error:",w)}}this.setPlaybackEngineData(i,o,u);const p={...i,questionsData:u,whiteFrames:d};return n&&this.trigger("message",{name:nt.PlaybackInfo,payload:p}),p}registerEventsOnSocket(){var e,n;if(!this.socket)throw new Error(Pn("dao_channel_connection_not_established"));this.socket.on(ot.SyncPlaygroundInfo,r=>{const i=U.dao.isPlayBack();if(r.lspStatus=i?_O.NotSupport:r.lspStatus,this.trigger("message",{name:nt.RunUnitTestStatus,payload:{eventName:"runUnitTestStatus",timestames:new Date,data:{type:"runUnitTest",action:r.unitTestRunning?"running":"done"}}}),he.config.supportRRWeb(!!r.supportRRWeb),U.dao.getFollowingAgentUser()&&this.followBrowser(!!r.supportRRWeb),r.playgroundIDEServerStatus==="ERROR"){he.dao.channelAvailable(!0),this.trigger("message",{name:nt.StatusChanged,payload:{status:"INACTIVE"}});return}if(r.playgroundIDEServerStatus==="SYNCING"){ct.debug("server is syncing playgroundInfo, waiting");return}if(U.dao.appStatus()==="loading"){this.initAppStatusLoadingPlaygroundInfo(r);return}if(U.dao.isReady()){this.changeAppStatusReadyPlaygroundInfo(r);return}if(U.dao.isReadyOffline()){const s=U.dao.playgroundInfo(),a=s.status;r.status!==a&&this.trigger("message",{name:nt.StatusChanged,payload:{status:r.status}}),s.runStatus==="DEBUG_RUNNING"&&r.status!=="ACTIVE"&&(he.file.debugStatus("stop"),he.file.setDebugInfo({}),U.dao.channel().trigger(ot.StoppedData,{name:ot.StoppedData,payload:{data:{}}}),this.transitionDebug({debugStatus:"stop"})),he.dao.setPlaygroundInfo(r),he.dao.channelAvailable(!0),this.transitionOnline(),this.trigger("message",{name:nt.Ready}),this.heartbeat();return}ct.warn("syncPlaygroundInfo event happened at a wrong appStatus")}),this.socket.on(ot.FileChange,r=>{this.updatePlaygroundInfoPartial({fileChangeLogs:r.data})}),this.socket.on(ot.ChangePlaygroundInfo,r=>{if(he.config.supportRRWeb(!!r.supportRRWeb),this.followBrowser(!!r.supportRRWeb),U.dao.isReady()){this.changeAppStatusReadyPlaygroundInfo(r);return}ct.warn("ChangePlaygroundInfo event happened at a wrong appStatus")}),this.socket.on(ot.Active,r=>{this.dealWithActiveEvent(r,!0)}),this.socket.on(ot.StopLSPServer,r=>{this.trigger("message",{name:nt.StopLSPServer,payload:{isStop:r.data.isStop,currentAgentUserId:r.data.currentAgentUserId}})}),this.socket.on(ot.InitRRweb,()=>{he.config.supportRRWeb(!0),U.dao.getFollowingAgentUser()&&this.followBrowser(!0)}),this.socket.on(ot.UpdatePlaygroundInfo,r=>{this.updatePlaygroundInfoPartial(r)}),this.socket.on(ot.LspStatus,r=>{const i=U.dao.playgroundInfo().lspStatus,{status:o}=r;if(i===o){ct.debug("lspStatus event is the same, ignored");return}this.updatePlaygroundInfoPartial({lspStatus:o}),this.transitionLspStatus(o)}),this.socket.on(ot.Following,r=>{const{agentUsers:i}=U.dao.playgroundInfo(),o=i.findIndex(s=>s.userId===r.agentUserId);o>-1&&(i[o]=r),this.updatePlaygroundInfoPartial({agentUsers:i}),this.trigger("message",{name:nt.Following,payload:{user:r}})}),this.socket.on(ot.UnFollowing,r=>{const{agentUsers:i}=U.dao.playgroundInfo(),o=i.findIndex(s=>s.userId===r.agentUserId);o>-1&&(i[o]=r),this.updatePlaygroundInfoPartial({agentUsers:i}),this.trigger("message",{name:nt.UnFollowing,payload:{user:r}})}),this.socket.on(ot.UserEnter,r=>{U.dao.getAgentUserById(r.agentUserId)?he.dao.updateAgentUser(r.agentUserId,r):he.dao.addAgentUser(r),this.trigger("message",{name:nt.UserEnter,payload:{agentUser:r}})}),this.socket.on(ot.UserLeave,r=>{he.dao.updateAgentUser(r.agentUserId,r),this.trigger("message",{name:nt.UserLeave,payload:{agentUser:r}})}),this.socket.on(ot.UsersUpdated,r=>{this.updatePlaygroundInfoPartial({agentUsers:r});const i=U.dao.getFollowingAgentUser(),o=i==null?void 0:i.focusXterm;this.trigger("message",{name:nt.UsersUpdated,payload:{agentUsers:r,xtermKey:o}})}),this.socket.on(ot.AppendCustomizeFrameData,r=>{this.trigger("message",{name:nt.AppendCustomizeFrameData,payload:r})}),this.socket.on(ot.PlaybackInfo,r=>{this.dealWithPlaybackData(r)}),this.socket.on(ot.File,r=>{var S;if(r.code===-1){he.file.resetFile(),qr.warn(r.message),this.uploadLog("Receive File",r.message||"\u6587\u4EF6\u4E0D\u5B58\u5728");return}he.file.aiCodeInfo(r.aiCodeInfo||[]);const i=he.file.switchFile,o=he.dao.setLatestDocContent;if(U.dao.isPlayBack()){i(r.data),he.file.loadingPath(""),he.file.setSelectedFilePath(r.data.openedPath),o(r.data.content||"");return}he.file.loadingPath("");const{agentUserId:s}=r,a=((S=r==null?void 0:r.data)==null?void 0:S.openedPath)||"",l=U.file.selectedFilePath(),c=U.dao.currentAgentUserId(),u=Mc+c===s,d=U.dao.currentAgentUser(),f=he.dao.updateAgentUser,h=this.isFollowMode(d,r.agentUserId),m=U.file.treeData(),g=U.file.hideEditFeature(),p=U.file.hideFeature(),O=r.data.openedPath,v=m[O],_=(v?v.hide:!0)&&p==="preview"&&g===!1,w=r.agentUserId!==c&&!u&&l===r.data.openedPath&&r.data.isRefresh;if(a!==U.file.latestRequestFilePath()&&!h){this.uploadLog("Receive File",JSON.stringify({requestTimestamp:r.requestTimestamp,latestRequestFilePath:U.file.latestRequestFilePath(),isFollow:h,filePath:a,selectedFilePath:l}));return}w&&he.file.setDocLoading(!0),r.agentUserId===c||u||h||w?(i(r.data,_),he.file.setSelectedFilePath(r.data.openedPath),o(r.data.content||""),this.transitionFileInfo({openedPath:r.data.openedPath}),he.file.pendingUpdateCount(0),he.file.mapSelection(r.data.mapSelection),h&&this.send(Dn.OpenFileByFollow,{fileOpened:r.data.openedPath})):this.uploadLog("Receive File",JSON.stringify({agentUserId:r.agentUserId,currentAgentUserId:c})),f(r.agentUserId,{fileOpened:r.data.openedPath}),d.followingAgentUserId&&f(c,{fileOpened:r.data.openedPath}),w?setTimeout(()=>{he.file.setDocLoading(!1)},100):he.file.setDocLoading(!1),this.dispatchDataEvent("editor",r)}),this.socket.on(ot.CloseFile,r=>{U.dao.currentAgentUser().followingAgentUserId===r.agentUserId&&r.data.path===U.file.getOpenedPath()&&(he.file.resetDoc(),he.file.setSelectedFilePath(""))}),this.socket.on(ot.FileTree,r=>{this.dispatchDataEvent(ot.FileTree,r)}),this.socket.on(ot.Run,r=>{this.dispatchDataEvent(ot.Run,r)}),this.socket.on(ot.FileSearchKeyword,r=>{const i={...U.file.searchKeywordInfo()};i.data=r.result||{},he.file.searchKeywordInfo(i)}),this.socket.on(ot.RunStatus,r=>{const{status:i,runResult:o,gui:s,internalRunInfo:a}=r,l=U.dao.playgroundInfo().runStatus,c=U.dao.playgroundInfo().openPort,u=i==="STOP"?!1:c;if(this.closeRunLoading(i,u),this.updatePlaygroundInfoPartial({openPort:u}),l===i){ct.debug("runStatus event is the same, ignored");return}this.updatePlaygroundInfoPartial({runStatus:i,gui:s}),this.trigger("message",{name:nt.RunStatusChanged,payload:{status:i,runResult:o,internalRunInfo:a}})}),this.socket.on(ot.Console,r=>{this.dispatchDataEvent(ot.Console,r);const{value:i}=r.data;i&&![XS,`\r
|
|
153
|
+
***************************************************************************** */function VU(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}var xm;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(xm||(xm={}));var Lee={type:"xstate.init"};function R4(t){return t===void 0?[]:[].concat(t)}function em(t){return{type:"xstate.assign",assignment:t}}function ZU(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function cx(t){return function(e){return t===e}}function Uee(t){return typeof t=="string"?{type:t}:t}function jU(t,e){return{value:t,context:e,actions:[],changed:!1,matches:cx(t)}}function GU(t,e,n){var r=e,i=!1;return[t.filter(function(o){if(o.type==="xstate.assign"){i=!0;var s=Object.assign({},r);return typeof o.assignment=="function"?s=o.assignment(r,n):Object.keys(o.assignment).forEach(function(a){s[a]=typeof o.assignment[a]=="function"?o.assignment[a](r,n):o.assignment[a]}),r=s,!1}return!0}),r,i]}function qee(t,e){e===void 0&&(e={});var n=VU(GU(R4(t.states[t.initial].entry).map(function(s){return ZU(s,e.actions)}),t.context,Lee),2),r=n[0],i=n[1],o={config:t,_options:e,initialState:{value:t.initial,actions:r,context:i,matches:cx(t.initial)},transition:function(s,a){var l,c,u=typeof s=="string"?{value:s,context:t.context}:s,d=u.value,f=u.context,h=Uee(a),m=t.states[d];if(m.on){var g=R4(m.on[h.type]);try{for(var p=function(Y){var N=typeof Symbol=="function"&&Symbol.iterator,q=N&&Y[N],R=0;if(q)return q.call(Y);if(Y&&typeof Y.length=="number")return{next:function(){return Y&&R>=Y.length&&(Y=void 0),{value:Y&&Y[R++],done:!Y}}};throw new TypeError(N?"Object is not iterable.":"Symbol.iterator is not defined.")}(g),O=p.next();!O.done;O=p.next()){var v=O.value;if(v===void 0)return jU(d,f);var y=typeof v=="string"?{target:v}:v,_=y.target,w=y.actions,S=w===void 0?[]:w,Q=y.cond,k=Q===void 0?function(){return!0}:Q,C=_===void 0,X=_!=null?_:d,D=t.states[X];if(k(f,h)){var P=VU(GU((C?R4(S):[].concat(m.exit,S,D.entry).filter(function(Y){return Y})).map(function(Y){return ZU(Y,o._options.actions)}),f,h),3),M=P[0],Z=P[1],V=P[2],G=_!=null?_:d;return{value:G,context:Z,actions:M,changed:_!==d||M.length>0||V,matches:cx(G)}}}}catch(Y){l={error:Y}}finally{try{O&&!O.done&&(c=p.return)&&c.call(p)}finally{if(l)throw l.error}}}return jU(d,f)}};return o}var HU=function(t,e){return t.actions.forEach(function(n){var r=n.exec;return r&&r(t.context,e)})};function Wee(t){var e=t.initialState,n=xm.NotStarted,r=new Set,i={_machine:t,send:function(o){n===xm.Running&&(e=t.transition(e,o),HU(e,Uee(o)),r.forEach(function(s){return s(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var s=typeof o=="object"?o:{context:t.config.context,value:o};e={value:s.value,actions:[],context:s.context,matches:cx(s.value)}}return n=xm.Running,HU(e,Lee),i},stop:function(){return n=xm.Stopped,r.clear(),i},get state(){return e},get status(){return n}};return i}function _Ce(t,e){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.type===ji.Meta&&r.timestamp<=e)return t.slice(n)}return t}function SCe(t,{getCastFn:e,applyEventsSynchronously:n,emitter:r}){const i=qee({id:"player",context:t,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:em({lastPlayedEvent:(o,s)=>s.type==="CAST_EVENT"?s.payload.event:o.lastPlayedEvent}),recordTimeOffset:em((o,s)=>{let a=o.timeOffset;return"payload"in s&&"timeOffset"in s.payload&&(a=s.payload.timeOffset),Object.assign(Object.assign({},o),{timeOffset:a,baselineTime:o.events[0].timestamp+a})}),play(o){var s;const{timer:a,events:l,baselineTime:c,lastPlayedEvent:u}=o;a.clear();for(const m of l)FU(m,c);const d=_Ce(l,c);let f=u==null?void 0:u.timestamp;(u==null?void 0:u.type)===ji.IncrementalSnapshot&&u.data.source===Hr.MouseMove&&(f=u.timestamp+((s=u.data.positions[0])===null||s===void 0?void 0:s.timeOffset)),c<(f||0)&&r.emit(Gr.PlayBack);const h=new Array;for(const m of d)if(!(f&&f<c&&(m.timestamp<=f||m===u)))if(m.timestamp<c)h.push(m);else{const g=e(m,!1);a.addAction({doAction:()=>{g()},delay:m.delay})}n(h),r.emit(Gr.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:em(o=>Object.assign(Object.assign({},o),{lastPlayedEvent:null})),startLive:em({baselineTime:(o,s)=>(o.timer.start(),s.type==="TO_LIVE"&&s.payload.baselineTime?s.payload.baselineTime:Date.now())}),addEvent:em((o,s)=>{const{baselineTime:a,timer:l,events:c}=o;if(s.type==="ADD_EVENT"){const{event:u}=s.payload;FU(u,a);let d=c.length-1;if(!c[d]||c[d].timestamp<=u.timestamp)c.push(u);else{let m=-1,g=0;for(;g<=d;){const p=Math.floor((g+d)/2);c[p].timestamp<=u.timestamp?g=p+1:d=p-1}m===-1&&(m=g),c.splice(m,0,u)}const f=u.timestamp<a,h=e(u,f);f?h():l.isActive()&&l.addAction({doAction:()=>{h()},delay:u.delay})}return Object.assign(Object.assign({},o),{events:c})})}});return Wee(i)}function wCe(t){const e=qee({id:"speed",context:t,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(n,r)=>{"payload"in r&&n.timer.setSpeed(r.payload.speed)},recordSpeed:em({normalSpeed:n=>n.timer.speed}),restoreSpeed:n=>{n.timer.setSpeed(n.normalSpeed)}}});return Wee(e)}const xCe=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }"],KU=new Map;function Bee(t,e){let n=KU.get(t);return n||(n=new Map,KU.set(t,n)),n.has(e)||n.set(e,[]),n.get(e)}function Yf(t,e,n){return r=>AO(this,void 0,void 0,function*(){if(r&&typeof r=="object"&&"rr_type"in r)if(n&&(n.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=yield Yf(t,e,n)(r.args);return yield createImageBitmap.apply(null,i)}else if("index"in r){if(n||e===null)return r;const{rr_type:i,index:o}=r;return Bee(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,s=window[i];return new s(...yield Promise.all(o.map(Yf(t,e,n))))}else{if("base64"in r)return A5e(r.base64);if("src"in r){const i=t.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,t.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=yield Promise.all(r.data.map(Yf(t,e,n)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return yield Promise.all(r.map(Yf(t,e,n)));return r})}function kCe(t,e){try{return e===ax.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch{return null}}const QCe=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function PCe(t,e){if(!(e!=null&&e.constructor))return;const{name:n}=e.constructor;if(!QCe.includes(n))return;const r=Bee(t,n);r.includes(e)||r.push(e)}function TCe({mutation:t,target:e,type:n,imageMap:r,errorHandler:i}){return AO(this,void 0,void 0,function*(){try{const o=kCe(e,n);if(!o)return;if(t.setter){o[t.property]=t.args[0];return}const s=o[t.property],a=yield Promise.all(t.args.map(Yf(r,o))),l=s.apply(o,a);PCe(o,l);const c=!1}catch(o){i(t,o)}})}function CCe({event:t,mutation:e,target:n,imageMap:r,errorHandler:i}){return AO(this,void 0,void 0,function*(){try{const o=n.getContext("2d");if(e.setter){o[e.property]=e.args[0];return}const s=o[e.property];if(e.property==="drawImage"&&typeof e.args[0]=="string")r.get(t),s.apply(o,e.args);else{const a=yield Promise.all(e.args.map(Yf(r,o)));s.apply(o,a)}}catch(o){i(e,o)}})}function JU({event:t,mutation:e,target:n,imageMap:r,canvasEventMap:i,errorHandler:o}){return AO(this,void 0,void 0,function*(){try{const s=i.get(t)||e,a="commands"in s?s.commands:[s];if([ax.WebGL,ax.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){const c=a[l];yield TCe({mutation:c,type:e.type,target:n,imageMap:r,errorHandler:o})}return}for(let l=0;l<a.length;l++){const c=a[l];yield CCe({event:t,mutation:c,target:n,imageMap:r,errorHandler:o})}}catch(s){o(e,s)}})}const ECe=10*1e3,RCe=5*1e3,ACe=Mee||bCe,eq="[replayer]",A4={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function tq(t){return t.type==ji.IncrementalSnapshot&&(t.data.source==Hr.TouchMove||t.data.source==Hr.MouseInteraction&&t.data.type==jo.TouchStart)}class ICe{constructor(e,n){if(this.usingVirtualDom=!1,this.virtualDom=new s0,this.mouseTail=null,this.tailPositions=[],this.emitter=ACe(),this.legacy_missingNodeRetryMap={},this.cache=LU(),this.imageMap=new Map,this.canvasEventMap=new Map,this.mirror=b5e(),this.styleMirror=new R5e,this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,this.lastMouseDownEvent=null,this.lastSelectionData=null,this.constructedStyleMutations=[],this.adoptedStyleSheets=[],this.handleResize=a=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])!l||(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))},this.applyEventsSynchronously=a=>{for(const l of a){switch(l.type){case ji.DomContentLoaded:case ji.Load:case ji.Custom:continue;case ji.FullSnapshot:case ji.Meta:case ji.Plugin:case ji.IncrementalSnapshot:break}this.getCastFn(l,!0)()}},this.getCastFn=(a,l=!1)=>{let c;switch(a.type){case ji.DomContentLoaded:case ji.Load:break;case ji.Custom:c=()=>{this.emitter.emit(Gr.CustomEvent,a)};break;case ji.Meta:c=()=>this.emitter.emit(Gr.Resize,{width:a.data.width,height:a.data.height});break;case ji.FullSnapshot:c=()=>{var d;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.rebuildFullSnapshot(a,l),(d=this.iframe.contentWindow)===null||d===void 0||d.scrollTo(a.data.initialOffset),this.styleMirror.reset()};break;case ji.IncrementalSnapshot:c=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const d of this.service.state.context.events)if(!(d.timestamp<=a.timestamp)&&this.isUserInteraction(d)){d.delay-a.delay>ECe*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=d);break}if(this.nextUserInteractionEvent){const d=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(d/RCe),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(Gr.SkipStart,f)}}};break}return()=>{c&&c();for(const f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});const d=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[d]){const f=()=>{d<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(Gr.Finish))};let h=50;a.type===ji.IncrementalSnapshot&&a.data.source===Hr.MouseMove&&a.data.positions.length&&(h+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,h)}this.emitter.emit(Gr.EventCast,a)}},!(n!=null&&n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:A4,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(Gr.Resize,this.handleResize),this.setupDom();for(const a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(Gr.Flush,()=>{if(this.usingVirtualDom){const a={mirror:this.mirror,applyCanvas:(l,c,u)=>{JU({event:l,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,c)=>{l.source===Hr.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===Hr.StyleDeclaration&&this.applyStyleDeclaration(l,c)},afterAppend:(l,c)=>{for(const u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{yu(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[l],u=lx(c.node,this.mirror,this.virtualDom.mirror);yu(u,c.node,a,this.virtualDom.mirror),c.node=u}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(Gr.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset()});const i=new $Ce([],{speed:this.config.speed});this.service=SCe({events:e.map(a=>n&&n.unpackFn?n.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(Gr.StateChange,{player:a})}),this.speedService=wCe({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(Gr.StateChange,{speed:a})});const o=this.service.state.context.events.find(a=>a.type===ji.Meta),s=this.service.state.context.events.find(a=>a.type===ji.FullSnapshot);if(o){const{width:a,height:l}=o.data;setTimeout(()=>{this.emitter.emit(Gr.Resize,{width:a,height:l})},0)}s&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=s,this.rebuildFullSnapshot(s),(a=this.iframe.contentWindow)===null||a===void 0||a.scrollTo(s.data.initialOffset))},1),this.service.state.context.events.find(tq)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,n){return this.emitter.on(e,n),this}off(e,n){return this.emitter.off(e,n),this}setConfig(e){Object.keys(e).forEach(n=>{e[n],this.config[n]=e[n]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const e=this.service.state.context.events[0],n=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:n.timestamp,totalTime:n.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:n}=this.service.state.context;return e-n[0].timestamp}getMirror(){return this.mirror}play(e=0){var n,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||r===void 0||r.classList.remove("rrweb-paused"),this.emitter.emit(Gr.Start)}pause(e){var n,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(n=this.iframe.contentDocument)===null||n===void 0?void 0:n.getElementsByTagName("html")[0])===null||r===void 0||r.classList.add("rrweb-paused"),this.emitter.emit(Gr.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(Gr.Resume)}destroy(){this.pause(),this.config.root.removeChild(this.wrapper),this.emitter.emit(Gr.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const n=this.config.unpackFn?this.config.unpackFn(e):e;tq(n)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:n}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=LU()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(yCe(this.iframe.contentWindow,this.iframe.contentDocument),T5e(this.iframe.contentWindow))}rebuildFullSnapshot(e,n=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const r=[],i=(a,l)=>{this.collectIframeAndAttachDocument(r,a);for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),P5e(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:a,builtNode:l}of r)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);const{documentElement:o,head:s}=this.iframe.contentDocument;this.insertStyleRules(o,s),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(Gr.FullsnapshotRebuilded,e),n||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,n){var r;const i=xCe(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Eee(o,this.virtualDom.unserializedId)),e.insertBefore(o,n),o.rules.push({source:Hr.StyleSheetRule,adds:i.map((s,a)=>({rule:s,index:a}))})}else{const o=document.createElement("style");e.insertBefore(o,n);for(let s=0;s<i.length;s++)(r=o.sheet)===null||r===void 0||r.insertRule(i[s],s)}}attachDocumentToIframe(e,n){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(s,a)=>{this.collectIframeAndAttachDocument(i,s);const l=r.getMeta(s);if((l==null?void 0:l.type)===ii.Element&&(l==null?void 0:l.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:u}=n.contentDocument;this.insertStyleRules(c,u)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(s,{id:a,replayer:this})};o1(e.node,{doc:n.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(n.contentDocument,e.node.id);for(const{mutationInQueue:s,builtNode:a}of i)this.attachDocumentToIframe(s,a),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==s)}collectIframeAndAttachDocument(e,n){if(T4(n,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(n));r&&e.push({mutationInQueue:r,builtNode:n})}}waitForStylesheetLoad(){var e;const n=(e=this.iframe.contentDocument)===null||e===void 0?void 0:e.head;if(n){const r=new Set;let i,o=this.service.state;const s=()=>{o=this.service.state};this.emitter.on(Gr.Start,s),this.emitter.on(Gr.Pause,s);const a=()=>{this.emitter.off(Gr.Start,s),this.emitter.off(Gr.Pause,s)};n.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(Gr.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(Gr.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}preloadAllImages(){return AO(this,void 0,void 0,function*(){this.service.state;const e=()=>{this.service.state};this.emitter.on(Gr.Start,e),this.emitter.on(Gr.Pause,e);const n=[];for(const r of this.service.state.context.events)r.type===ji.IncrementalSnapshot&&r.data.source===Hr.CanvasMutation&&(n.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(o=>{this.preloadImages(o,r)}));return Promise.all(n)})}preloadImages(e,n){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(n)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);o==null||o.data,JSON.parse(e.args[0]),i==null||i.putImageData(o,0,0)}}deserializeAndPreloadCanvasEvents(e,n){return AO(this,void 0,void 0,function*(){if(!this.canvasEventMap.has(n)){const r={isUnchanged:!0};if("commands"in e){const i=yield Promise.all(e.commands.map(o=>AO(this,void 0,void 0,function*(){const s=yield Promise.all(o.args.map(Yf(this.imageMap,null,r)));return Object.assign(Object.assign({},o),{args:s})})));r.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},e),{commands:i}))}else{const i=yield Promise.all(e.args.map(Yf(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(n,Object.assign(Object.assign({},e),{args:i}))}}})}applyIncremental(e,n){var r,i,o;const{data:s}=e;switch(s.source){case Hr.Mutation:{try{this.applyMutation(s,n)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,s)}break}case Hr.Drag:case Hr.TouchMove:case Hr.MouseMove:if(n){const a=s.positions[s.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:s}}else s.positions.forEach(a=>{const l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,n,s)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=s.positions[0])===null||r===void 0?void 0:r.timeOffset)});break;case Hr.MouseInteraction:{if(s.id===-1)break;const a=new Event(jo[s.type].toLowerCase()),l=this.mirror.getNode(s.id);if(!l)return this.debugNodeNotFound(s,s.id);this.emitter.emit(Gr.MouseInteraction,{type:s.type,target:l});const{triggerFocus:c}=this.config;switch(s.type){case jo.Blur:"blur"in l&&l.blur();break;case jo.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case jo.Click:case jo.TouchStart:case jo.TouchEnd:case jo.MouseDown:case jo.MouseUp:n?(s.type===jo.TouchStart?this.touchActive=!0:s.type===jo.TouchEnd&&(this.touchActive=!1),s.type===jo.MouseDown?this.lastMouseDownEvent=[l,a]:s.type===jo.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:s.x,y:s.y,id:s.id,debugData:s}):(s.type===jo.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(s.x,s.y,s.id,n,s),s.type===jo.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):s.type===jo.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):s.type===jo.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case jo.TouchCancel:n?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case Hr.Scroll:{if(s.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.scrollData=s;break}this.applyScroll(s,n);break}case Hr.ViewportResize:this.emitter.emit(Gr.Resize,{width:s.width,height:s.height});break;case Hr.Input:{if(s.id===-1)break;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.inputData=s;break}this.applyInput(s);break}case Hr.MediaInteraction:{const a=this.usingVirtualDom?this.virtualDom.mirror.getNode(s.id):this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);const l=a;try{s.currentTime!==void 0&&(l.currentTime=s.currentTime),s.volume!==void 0&&(l.volume=s.volume),s.muted!==void 0&&(l.muted=s.muted),s.type===1&&l.pause(),s.type===0&&l.play(),s.type===4&&(l.playbackRate=s.playbackRate)}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}break}case Hr.StyleSheetRule:case Hr.StyleDeclaration:{this.usingVirtualDom?s.styleId?this.constructedStyleMutations.push(s):s.id&&((i=this.virtualDom.mirror.getNode(s.id))===null||i===void 0||i.rules.push(s)):this.applyStyleSheetMutation(s);break}case Hr.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const a=this.virtualDom.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);a.canvasMutations.push({event:e,mutation:s})}else{const a=this.mirror.getNode(s.id);if(!a)return this.debugNodeNotFound(s,s.id);JU({event:e,mutation:s,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case Hr.Font:{try{const a=new FontFace(s.family,s.buffer?new Uint8Array(JSON.parse(s.fontSource)):s.fontSource,s.descriptors);(o=this.iframe.contentDocument)===null||o===void 0||o.fonts.add(a)}catch(a){this.warn(a)}break}case Hr.Selection:{if(n){this.lastSelectionData=s;break}this.applySelection(s);break}case Hr.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(s):this.applyAdoptedStyleSheet(s);break}}}applyMutation(e,n){if(this.config.useVirtualDom&&!this.usingVirtualDom&&n&&(this.usingVirtualDom=!0,rCe(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const u=this.legacy_missingNodeRetryMap[c],d=Cee(u.node,this.virtualDom,this.mirror);d&&(u.node=d)}catch(u){this.warn(u)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>r.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var u;const d=r.getNode(c.id);if(!d)return;let f=r.getNode(c.parentId);if(!f)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&e_(f)&&(f=f.shadowRoot),r.removeNodeFromMap(d),f)try{f.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&f.nodeName==="STYLE"&&((u=f.rules)===null||u===void 0?void 0:u.length)>0&&(f.rules=[])}catch(h){if(h instanceof DOMException)this.warn("parent could not remove child in mutation",f,d,e);else throw h}});const i=Object.assign({},this.legacy_missingNodeRetryMap),o=[],s=c=>{let u=null;return c.nextId&&(u=r.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},a=c=>{var u,d;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(c.parentId);if(!f)return c.node.type===ii.Document?this.newDocumentQueue.push(c):o.push(c);c.node.isShadow&&(e_(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let h=null,m=null;if(c.previousId&&(h=r.getNode(c.previousId)),c.nextId&&(m=r.getNode(c.nextId)),s(c))return o.push(c);if(c.node.rootId&&!r.getNode(c.node.rootId))return;const g=c.node.rootId?r.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(T4(f,r)){this.attachDocumentToIframe(c,f);return}const p=(y,_)=>{if(!this.usingVirtualDom)for(const w of this.config.plugins||[])w.onBuild&&w.onBuild(y,{id:_,replayer:this})},O=o1(c.node,{doc:g,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:p});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:O,mutation:c};return}const v=r.getMeta(f);if(v&&v.type===ii.Element&&v.tagName==="textarea"&&c.node.type===ii.Text){const y=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);for(const _ of y)_.nodeType===f.TEXT_NODE&&f.removeChild(_)}else if((v==null?void 0:v.type)===ii.Document){const y=f;c.node.type===ii.DocumentType&&((u=y.childNodes[0])===null||u===void 0?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&y.removeChild(y.childNodes[0]),O.nodeName==="HTML"&&y.documentElement&&y.removeChild(y.documentElement)}if(h&&h.nextSibling&&h.nextSibling.parentNode?f.insertBefore(O,h.nextSibling):m&&m.parentNode?f.contains(m)?f.insertBefore(O,m):f.insertBefore(O,null):f.appendChild(O),p(O,c.node.id),this.usingVirtualDom&&O.nodeName==="#text"&&f.nodeName==="STYLE"&&((d=f.rules)===null||d===void 0?void 0:d.length)>0&&(f.rules=[]),T4(O,this.mirror)){const y=this.mirror.getId(O),_=this.newDocumentQueue.find(w=>w.parentId===y);_&&(this.attachDocumentToIframe(_,O),this.newDocumentQueue=this.newDocumentQueue.filter(w=>w!==_))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,f,O,c)};e.adds.forEach(c=>{a(c)});const l=Date.now();for(;o.length;){const c=C5e(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const u of c)r.getNode(u.value.parentId)?bee(u,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),E5e(e.texts).forEach(c=>{var u;const d=r.getNode(c.id);if(!d)return e.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);if(d.textContent=c.value,this.usingVirtualDom){const f=d.parentNode;((u=f==null?void 0:f.rules)===null||u===void 0?void 0:u.length)>0&&(f.rules=[])}}),e.attributes.forEach(c=>{const u=r.getNode(c.id);if(!u)return e.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const d in c.attributes)if(typeof d=="string"){const f=c.attributes[d];if(f===null)u.removeAttribute(d);else if(typeof f=="string")try{if(d==="_cssText"&&(u.nodeName==="LINK"||u.nodeName==="STYLE"))try{const h=r.getMeta(u);Object.assign(h.attributes,c.attributes);const m=o1(h,{doc:u.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),g=u.nextSibling,p=u.parentNode;if(m&&p){p.removeChild(u),p.insertBefore(m,g),r.replace(c.id,m);break}}catch{}u.setAttribute(d,f)}catch(h){this.warn("An error occurred may due to the checkout feature.",h)}else if(d==="style"){const h=f,m=u;for(const g in h)if(h[g]===!1)m.style.removeProperty(g);else if(h[g]instanceof Array){const p=h[g];m.style.setProperty(g,p[0],p[1])}else{const p=h[g];m.style.setProperty(g,p)}}}})}applyScroll(e,n){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const s=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)===null||r===void 0||r.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else if((s==null?void 0:s.type)===ii.Document)(i=o.defaultView)===null||i===void 0||i.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:n?"auto":"smooth"})}catch{}}applyInput(e){const n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);try{n.checked=e.isChecked,n.value=e.text}catch{}}applySelection(e){try{const n=new Set,r=e.ranges.map(({start:i,startOffset:o,end:s,endOffset:a})=>{const l=this.mirror.getNode(i),c=this.mirror.getNode(s);if(!l||!c)return;const u=new Range;u.setStart(l,o),u.setEnd(c,a);const d=l.ownerDocument,f=d==null?void 0:d.getSelection();return f&&n.add(f),{range:u,selection:f}});n.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)===null||o===void 0?void 0:o.addRange(i.range))})}catch{}}applyStyleSheetMutation(e){var n;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((n=this.mirror.getNode(e.id))===null||n===void 0?void 0:n.sheet)||null),r&&(e.source===Hr.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===Hr.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,n){var r,i,o,s;if((r=e.adds)===null||r===void 0||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){const{positions:c,index:u}=qU(l);Ev(n.cssRules,c).insertRule(a,u)}else{const c=l===void 0?void 0:Math.min(l,n.cssRules.length);n==null||n.insertRule(a,c)}}catch{}}),(i=e.removes)===null||i===void 0||i.forEach(({index:a})=>{try{if(Array.isArray(a)){const{positions:l,index:c}=qU(a);Ev(n.cssRules,l).deleteRule(c||0)}else n==null||n.deleteRule(a)}catch{}}),e.replace)try{(o=n.replace)===null||o===void 0||o.call(n,e.replace)}catch{}if(e.replaceSync)try{(s=n.replaceSync)===null||s===void 0||s.call(n,e.replaceSync)}catch{}}applyStyleDeclaration(e,n){e.set&&Ev(n.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Ev(n.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var n;const r=this.mirror.getNode(e.id);if(!r)return;(n=e.styles)===null||n===void 0||n.forEach(a=>{var l;let c=null,u=null;if(e_(r)?u=((l=r.ownerDocument)===null||l===void 0?void 0:l.defaultView)||null:r.nodeName==="#document"&&(u=r.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,a.styleId),this.applyStyleSheetRule({source:Hr.StyleSheetRule,adds:a.rules},c)}catch{}});const i=10;let o=0;const s=(a,l)=>{const c=l.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);e_(a)?a.shadowRoot.adoptedStyleSheets=c:a.nodeName==="#document"&&(a.adoptedStyleSheets=c),c.length!==l.length&&o<i&&(setTimeout(()=>s(a,l),0+100*o),o++)};s(r,e.styleIds)}legacy_resolveMissingNode(e,n,r,i){const{previousId:o,nextId:s}=i,a=o&&e[o],l=s&&e[s];if(a){const{node:c,mutation:u}=a;n.insertBefore(c,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,c,u)}if(l){const{node:c,mutation:u}=l;n.insertBefore(c,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,n,c,u)}}moveAndHover(e,n,r,i,o){const s=this.mirror.getNode(r);if(!s)return this.debugNodeNotFound(o,r);const a=yee(s,this.iframe),l=e*a.absoluteScale+a.x,c=n*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:l,y:c}),this.hoverElements(s)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:n,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?A4:Object.assign({},A4,this.config.mouseTail),s=()=>{if(!this.mouseTail)return;const a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=n,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),s(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),s()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var n;(n=this.lastHoveredRootNode||this.iframe.contentDocument)===null||n===void 0||n.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==ji.IncrementalSnapshot?!1:e.data.source>Hr.Mutation&&e.data.source<=Hr.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(Gr.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,n){this.warn(`Node with id '${n}' not found. `,e)}warnCanvasMutationFailed(e,n){this.warn("Has error on canvas update",n,"canvas mutation:",e)}debugNodeNotFound(e,n){this.debug(`Node with id '${n}' not found. `,e)}warn(...e){!this.config.showWarning||this.config.logger.warn(eq,...e)}debug(...e){!this.config.showDebug||this.config.logger.log(eq,...e)}}function XCe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var nf=XCe;function nq(t,e){var n,r;for(let i=0;i<t.length;i++){const o=e.index==="."?"":`${e.index}/`;t[i].type==="DIRECTORY"?(n=e==null?void 0:e.children)==null||n.push(`${o}${t[i].name}`):(r=e==null?void 0:e.children)==null||r.push(`${o}${t[i].name}`)}}const Yee=(t,e)=>(t.children=t.children.filter(n=>{const r=e.split(";"),i=n.path.split("/"),o=i[i.length-1];return!r.some(s=>s.startsWith("*")?(s=s.substring(s.indexOf("*")+1),o.endsWith(s)):s.endsWith("*")?(s=s.substring(0,s.lastIndexOf("*")),o.startsWith(s)):s.endsWith("/")?s===o+"/":s===o)}),t.children&&t.children.length>0&&t.children.forEach(n=>{Yee(n,e)}),t);function gg(t){const e=U.dao.playgroundInfo().fileTreeIgnore;if(!t)return{};t=Yee(Mi(t),e||"");const n={},r=t.name;n[r]={index:r,children:[],hasChildren:!0,data:r,canMove:!0},nq(t.children,n[r]);let i=[...t.children],o=[...n[r].children];for(;i.length;){const s=i.length;for(let a=0;a<s;a++){const l=i.shift(),c=o.shift();i=i.concat(l.children);const u={lock:l.lock,hide:l.hide,unittest:l.unittest,isRetainedFile:l.isRetainedFile};switch(l.type){case"DIRECTORY":{const d=c;n[d]={index:d,hasChildren:!0,children:[],data:l.name,type:"DIRECTORY",canMove:!0,canNotExpaned:l.canNotExpaned,...u},l.children.length>0&&nq(l.children,n[d]),o=o.concat(n[d].children)}break;case"FILE":{const d=c;n[d]={index:d,hasChildren:!1,data:l.name,type:"FILE",canMove:!0,canNotExpaned:l.canNotExpaned,...u}}break}}}return Object.values(n).map(s=>{Fee(s,n)}),n}function rq(t){return t.sort((e,n)=>e.localeCompare(n,"EN",{sensitivity:"case"}))}function DCe(t,e){if(t.length<=1)return t;const n=[],r=[];for(let i=0;i<t.length;i+=1){const o=t[i];e[o].hasChildren?n.push(o):r.push(o)}return rq(n),rq(r),n.concat(r)}const Fee=(t,e)=>{t.children&&t.children.length&&(t.children=DCe(t.children,e),t.children.forEach(n=>{Fee(e[n]||{},e)}))},NCe=t=>new Promise(e=>{t==null||t.file(n=>{t.fullPath&&(n.fullPath=t.fullPath.indexOf("/")===0?t.fullPath.substring(1):t.fullPath),e(n)})}),Vee=async(t,e=[])=>{for(let n of t)if(n&&n.isFile){const r=await NCe(n);e.push(r)}else{n=n;const r=n.createReader();await zCe(r,e)}return e},zCe=(t,e)=>new Promise(n=>{t.readEntries(r=>{const i=Vee(r,e);n(i)})}),iq=(t,e)=>{var n,r,i;return{type:t.type,path:e||t.name,name:((n=t.name)==null?void 0:n.lastIndexOf("/"))>-1?(i=t.name)==null?void 0:i.substring(((r=t.name)==null?void 0:r.lastIndexOf("/"))+1):t.name,children:[]}},Zee=(t,e)=>{Object.assign(t,e),t.children.length&&t.children.forEach(n=>{Zee(n,e)})},oq=(t,e,n)=>{var o;let r=t.children,i="";for(const s of e){const a=r.find(l=>l.name===s);if(i+=`${i?"/":""}${s}`,!a&&n==="DELETE")return;!a&&n!=="MOVE"&&r.push({type:"DIRECTORY",name:s,path:i,children:[]}),r=((o=r.find(l=>l.name===s))==null?void 0:o.children)||[]}return r},MCe=(t,e,n)=>{const r=e.name;let i,o=t.children;o=sq(o,n.split("/"),"");const s=r.lastIndexOf("/");return s>-1&&(i=r.substring(0,s),o=sq(o,i.split("/"),n,!0)),o},sq=(t,e,n,r)=>{let i;return e.forEach(o=>{const s=t.find(a=>a.name===o);r&&!s&&(n+=`${n?"/":""}${o}`,i={name:o,path:n,type:"DIRECTORY",children:[]},t.push(i)),t=s?s.children:i.children}),t},jee=(t,e)=>(t.children.forEach(n=>{var r;if(n.path=`${e}/${n.name}`,(r=n==null?void 0:n.children)!=null&&r.length)return jee(n,n.path)}),t),tm=t=>t.lastIndexOf("/")>-1?t.substring(t.lastIndexOf("/")+1):t,LCe=t=>{const e=t.lastIndexOf("/");return e===-1?"":t.substring(0,e)},dd=(t,e,n,r)=>{var u,d;const{data:i}=t;if(!i.files&&(t==null?void 0:t.snapshot)){he.file.setTreeData(gg(t.snapshot));return}if(!e||((d=(u=i.files)==null?void 0:u.length)!=null?d:0)<1)return;const o=i.action,s=n||i.files[0],l=(s.name||"").split("/").slice(0,-1);let c=r?e.children:oq(e,l,o)||[];switch(o){case"CREATE":case"UPLOAD":{let f;r?(c=MCe(e,s,r),f=iq(s,`${r}/${s.name}`)):f=iq(s),c.find(h=>h.path===f.path)||c.push(f);break}case"MOVE":{const f=i.destination||"",h=f.split("/").slice(0,-1),m=oq(e,h,o)||[],g=c.findIndex(O=>O.path===s.name),p=c[g];if(g===-1)return;c.splice(g,1),p.path=f,p.name=tm(f),s.type==="DIRECTORY"&&jee(p,f),m.push(p);break}case"DELETE":{const f=c.findIndex(h=>h.path===s.name);f>-1&&c.splice(f,1);break}case"FEATURE":{const f=c.find(g=>g.path===s.name),m=["lock","hide","unittest","isRetainedFile"].reduce((g,p)=>(s[p]!==void 0&&(g[p]=s[p]),g),{});f&&Zee(f,m);break}}t.snapshot=Mi(e),he.file.setFileTree(e)},UCe=(t,e)=>{const n=t.substring(0,t.lastIndexOf("/")),r=e.substring(0,e.lastIndexOf("/"));return n===r},qCe=(...t)=>t.filter(e=>!!e).join("/"),WCe=t=>t==="."||t&&t.indexOf("/")===-1,I4=t=>U.dao.playgroundInfo().fileTreeIgnore.split(";").map(n=>(n=n.replace(/\./,function(){return"\\."}),n=n.replace(/\*/,function(){return".*"}),n.endsWith("/")&&(n=n.substring(0,n.length-1)),new RegExp(n))).some(n=>n.test(t)),VA=t=>{const e=window.navigator.cookieEnabled?window.localStorage.getItem("showHiddenFiles"):null;let n=e?JSON.parse(e):{};return n=nf(n)?n:{},n[t]===void 0?!1:n[t]},BCe=t=>{const e=t.find(n=>n.size/1048576>=16);if(e){const{fullPath:n}=e;return qr.error(Pn("file_tree_file_exceeds_size_limit",{filePath:n}).toString()),!0}return!1},ux=t=>{const e=U.file.fileTree();if(!e)return null;let n=null;const r=i=>{if(i.path===t){n=i;return}else for(let o=0;o<i.children.length;o++)r(i.children[o])};return r(e),n},Gee=t=>{if(!t)throw new Error("username can't be blank");return`https://ui-avatars.com/api/?background=3A3C40&color=fff&rounded=true&uppercase=true&bold=true&length=1&name=${t}`},Mc="Virtual_",aq={fileTree:[],editor:[],console:[],terminal:[],claudecode:[],simulator:[],focusChange:[],run:[],keyEvent:[],customize:[],debug:[],rrweb:[]},X4={fileTree:t=>{const{snapshot:e}=t;e&&he.file.setFileTree(e)}},YCe=["resourceMonitoring"];class FCe{constructor(){tt(this,"socket");tt(this,"heartbeatInterval",null);tt(this,"playControlSubscribers");tt(this,"componentSubscribersMap");tt(this,"messageListeners");tt(this,"eventListeners");tt(this,"errorListeners");tt(this,"playbackEngine");tt(this,"ioPath");tt(this,"authOptions");tt(this,"isDisconnect");tt(this,"reconnectMaxTimes",10);tt(this,"extraOption");tt(this,"replayer",null);tt(this,"waitingDebugFilePath","");tt(this,"reconnectMaxActiveTimes",5);tt(this,"currentReconnectActiveTimes",1);tt(this,"socketParser","default");tt(this,"customEvents",[]);tt(this,"messageListenersMap",new Map([]));tt(this,"webPlayer");tt(this,"lastClaudeCodeContent","");tt(this,"lastClaudeCodeTimestamp",0);tt(this,"visibilitychange",()=>{var r;const e=this,n=e.socket;ct.log("[registerVisiblityChangeEvent]",document.visibilityState,n==null?void 0:n.active,e.isDisconnect),document.visibilityState==="visible"?(this.uploadLog("registerVisiblityChangeEvent",`active:${n==null?void 0:n.active}, isDisconnect:${e.isDisconnect}`),e.isDisconnect?(n==null||n.disconnect(),this.trigger("message",{name:nt.Reconnecting}),n==null||n.connect(),e.attemptReconnect(),n==null||n.io.reconnection(!0)):(e.attemptReconnect(),n==null||n.io.reconnection(!0))):((r=n==null?void 0:n.io)==null||r.removeListener("reconnect_attempt"),n==null||n.io.reconnection(!1))});tt(this,"gotoPlayBackCacll",e=>{var r,i;if(he.file.resetDebugInfo(),he.file.resetBreakPoints(),U.dao.channel().trigger(ot.StoppedData,{name:ot.StoppedData,payload:{data:[]}}),U.dao.channel().setBreakPoints({},!1),this.playbackEngine.movePosition(e),this.webPlayer){const a=this.webPlayer.getMetaData().startTime+e,l=["endQuestion"];let c;for(let d=this.customEvents.length-1;d>=0;d--){const f=this.customEvents[d];if(l.includes(f.data.tag)&&f.timestamp<=a){c=f;break}}const u=this.webPlayer.getReplayer();c&&c.data.tag==="endQuestion"?u.wrapper.style.visibility="hidden":u.wrapper.style.visibility="visible",(i=this.webPlayer)==null||i.goto(e,!!((r=this.playbackEngine)!=null&&r.playing))}const n=U.dao.playbackStatus();n!=="goToPlayback"&&he.dao.statusBeforeGotoPlayback(n),he.dao.playbackStatus("goToPlayback"),this.restoreAfterGotoPlayback()});tt(this,"goToPlayback",QQ(this.gotoPlayBackCacll,200));tt(this,"restoreAfterGotoPlayback",DJ(()=>{const e=U.dao.statusBeforeGotoPlayback();he.dao.playbackStatus(e)},400));this.eventListeners=new Map,this.messageListeners=[],this.errorListeners=[],this.playControlSubscribers=[],this.extraOption={triggerEventForMaxTimespan:-1},this.ioPath="",this.authOptions=void 0,this.isDisconnect=!1,this.componentSubscribersMap=Mi(aq)}isClaudeCodeTUIRedraw(e){if(/^[\x1B\[\]\d;HJKmABCDEFGHsuhl\?]+$/.test(e)||e.includes("\x1B[s")||e.includes("\x1B[u")||e.includes("\x1B7")||e.includes("\x1B8")||/\x1B\[\d{2,};1H/.test(e)&&e.length<100)return!0;const i=this.cleanANSISequences(e);if(this.isClaudeCodeUIElement(i))return!0;const o=Date.now();if(o-this.lastClaudeCodeTimestamp<100){const a=this.cleanANSISequences(this.lastClaudeCodeContent);if(i===a)return!0}return this.lastClaudeCodeContent=e,this.lastClaudeCodeTimestamp=o,!1}isClaudeCodeUIElement(e){if(!e)return!0;const r=e.split(`
|
|
154
|
+
`).filter(o=>o.trim().length>0);return r.length===0?!0:r.every(o=>{const s=o.trim();if(s==="[>>]"||/^[─\-=_]{5,}$/.test(s)||/^[●❄⚡☀]\s*(idle|working|busy|active)\s*│/.test(s)||/^\d+\.\s+\d+\s*[●❄⚡☀]\s*(idle|working|busy|active)\s*│/.test(s)||!s.replace(/\[>>\]/g,"").replace(/[─\-=_\s]/g,""))return!0;const l=s.replace(/\[>>\]/g,"").replace(/[─\-=_│┤├┬┴┼●❄⚡☀]/g,"").replace(/\s/g,"");return!!(!/[a-zA-Z0-9\u4e00-\u9fa5]/.test(l)||s.length<5&&/^[\d\.\s]+$/.test(s))})}cleanANSISequences(e){return e.replace(/\x1B\[[0-9;?]*[A-Za-z]/g,"").replace(/\x1B\][^\x07\x1B]*(?:\x07|\x1B\\)/g,"").replace(/\x1B[^[\]]/g,"").replace(/\x1B[78]/g,"").replace(/\x1B\[s/g,"").replace(/\x1B\[u/g,"").replace(/\r\n/g,`
|
|
155
|
+
`).replace(/\r/g,"").replace(/[\x00-\x08\x0B-\x0C\x0E-\x1F\x7F]/g,"")}addMessageListener(e){const n=this.messageListeners.length;this.messageListeners.find(e)?ct.info("[messageLinstener][addMessageListener]\u91CD\u590D\u6CE8\u518C\u4E8B\u4EF6"):this.messageListeners.push(e),ct.info(`[messageLinstener][addMessageListener]${n}-${this.messageListeners.length}`)}addMessageEventListener(e,n){this.messageListenersMap.set(e,n)}removeMessageEventListener(e){if(!e){this.messageListenersMap.clear();return}(typeof e=="string"?[e]:e).forEach(r=>{this.messageListenersMap.set(r,null)})}removeMessageListener(e){const n=this.messageListeners.findIndex(r=>r===e);n>-1&&this.messageListeners.splice(n,1),ct.info("[messageLinstener][removeMessageListener]"+this.messageListeners.length)}addErrorListener(e){const n=this.errorListeners.length;this.errorListeners.find(e)||this.errorListeners.push(e),ct.info(`[messageLinstener][addErrorListener]${n}-${this.errorListeners.length}`)}removeErrorListener(e){const n=this.errorListeners.findIndex(r=>r===e);n>-1&&this.errorListeners.splice(n,1),ct.info("[messageLinstener][removeErrorListener]"+this.errorListeners.length)}startChannel(e,n,r){if(this.socket&&this.socket.connected){ct.warn("The connection is already established");return}this.ioPath=e,this.authOptions=n,this.extraOption=r,this.reconnectMaxTimes=(r==null?void 0:r.reconnectMaxTimes)||this.reconnectMaxTimes,this.socketParser=(r==null?void 0:r.sockerParser)||"default",this.connect(e,n)}attemptReconnect(){var n,r,i,o;const e=this;(r=(n=e==null?void 0:e.socket)==null?void 0:n.io)==null||r.removeListener("reconnect_attempt"),(o=(i=e==null?void 0:e.socket)==null?void 0:i.io)==null||o.on("reconnect_attempt",s=>{var a,l;if(ct.info("[attemptReconnect]",s),s>=this.reconnectMaxTimes){this.transitionError(nt.ConnectionBroken,Pn("dao_channel_socket_connect_broken")),(a=this.socket)==null||a.close();return}U.dao.isError()&&(ct.debug("stop reconnect_attempt"),(l=this.socket)==null||l.close())})}connect(e,n,r=!1){var c,u;U.dao.appStatus()==="drafted"&&this.transitionLoading();const i=e.match(/^(wss?:\/\/[^/]+?)(\/.*)?$/);if(!i)return;const o=i[1],s=i[2],a=U.i18n.getLanguage(),l=(u=(c=this.extraOption)==null?void 0:c.isInsertCrdt)!=null?u:!0;ct.info("Start to connect WS ",o),this.socket=n.mockSocket||IS(o,{path:s||void 0,query:{i18nLanguage:a,isInsertCrdt:l,isReConnect:r},auth:n,transports:["websocket"],parser:this.socketParser==="buffer"?iy:void 0}),this.registerEventsOnSocket(),this.socket.on(ot.Connect,()=>{ct.info("Connect WS successfully"),this.isDisconnect=!1,r&&he.dao.channelAvailable(!0)}),this.socket.on(ot.Disconnect,()=>{if(ct.info("websocket disconnenct"),this.isDisconnect=!0,he.dao.channelAvailable(!1),this.clearHeartbeatInterval(),this.clearSelectionLayer(),U.dao.isReady()){this.transitionOffline(),he.file.closeLspServer();const f=U.dao.playgroundInfo().lspSupported?_O.Uninitialized:_O.NotSupport;U.dao.channel().transitionLspStatus(f),this.updatePlaygroundInfoPartial({lspStatus:f})}}),this.attemptReconnect(),this.socket.on(ot.AuthAck,({result:d,data:f,error:h})=>{if(!d){this.transitionErrorAndHalted(nt.AuthorizationFailed,BL({name:"AuthFailed",error:h}));return}const{agentUserId:m}=f;if(v2e(m),!b2e(m))throw new Error(Pn("dao_channel_agentUserId_x_inconsistent",{x:m}));this.startHeartbeatInterval(),this.updateCurrentAgentUserId(m)}),this.socket.on(ot.TerminalStatus,({value:d})=>{this.updatePlaygroundInfoPartial({terminalStatus:d})}),this.socket.on("initAiCodeInfo",d=>{const f=d.aiRes||[],h=U.file.getOpenedPath(),m=f.filter(p=>p.path===h);he.file.aiCodeInfo(m||[]);const g=U.file.editorView();if(g){const p=g.state.selection.main.head,O=g.state.doc.lineAt(p);U.dao.channel().trigger(nt.ReplayCodeByRange,{name:nt.ReplayCodeByRange,payload:{path:U.file.getOpenedPath(),isUseEvent:!0,content:"",selection:{start:O.to}}})}}),this.socket.on("rrweb",d=>{const f=U.config.replayer();f&&(this.updateReplayerConfig(f,d),this.updateMouseIconDisplay("inline-block"),f.addEvent(d))}),this.socket.on("followBrowser",d=>{this.startRecordBrowser(d.follow)}),this.socket.on("liveBrowser",d=>{var h;if(U.config.recordBrowser()){const m=document.getElementById("dao-browserIframe");if(m){const g=`https://${U.dao.playgroundInfo().url}`;(h=m.contentWindow)==null||h.postMessage(JSON.stringify({type:"live",time:Date.now()}),g)}}})}updateMouseIconDisplay(e){const n=document.querySelector(".d42-browser-container .replayer-wrapper .replayer-mouse");n&&n.style.setProperty("--afterDisplay",e)}updateReplayerConfig(e,n){if(e&&n){e.setConfig({mouseTail:{duration:500,lineCap:"round",lineWidth:2,strokeStyle:n.color}});const r=document.querySelector(".d42-browser-container .replayer-wrapper .replayer-mouse");r&&(r.setAttribute("data-username",n.username||""),r.style.setProperty("--userbackgroundcolor",n.color))}}liveBrowser(){this.send(Dn.LiveBrowser)}authorize(e){this.send(Dn.Authorize,e)}subscribeForComponent(e,n){if(!this.componentSubscribersMap[e])throw new Error(Pn("dao_channel_event_x_is_not_supported",{x:e}));const r=this.componentSubscribersMap[e].findIndex(i=>!!i.onStart);if(r>-1){this.componentSubscribersMap[e][r]=n;return}this.componentSubscribersMap[e].push(n)}unsubscribeForComponent(e,n){const r=this.componentSubscribersMap[e].findIndex(i=>i===n);r>-1&&this.componentSubscribersMap[e].splice(r,1)}subscribeForPlayControl(e){this.playControlSubscribers.push(e)}unsubscribeForPlayControl(e){const n=this.playControlSubscribers.findIndex(r=>r===e);n>-1&&this.playControlSubscribers.splice(n,1)}setPlaybackSummerize(e){let n=0;const{start:r,end:i,customize:o}=e,s=["startQuestion","endQuestion"],a={};o==null||o.forEach(c=>{var h;const{timestamp:u,data:{action:d,value:f}}=c;if(c.costTime=u-r,s.includes(d)){n=f,a[f]=a[f]||[];const m=(h=a[f])==null?void 0:h.length,g=u-r;d==="startQuestion"?a[f].push([g]):m-1<0?a[f][0]=[void 0,g]:a[f][m-1].push(g)}});const l=a[n];return l&&l[l.length-1].length<2&&l[l.length-1].push(i-r),a}setPlaybackEngineData(e,n,r){var d;const{historyBaseData:i=[],playbackData:o}=n,{start:s,end:a,total:l,customize:c=[]}=e;this.playbackEngine=new yPe(s,a,l,c,((d=this.extraOption)==null?void 0:d.triggerEventForMaxTimespan)||-1,this.dispatchDataEvent.bind(this),this.dispatchProgressEvent.bind(this),this.getPlaybackSnapshot.bind(this),this.eventCustomize.bind(this));const u=i.reduce((f,h)=>{var y,_;const{dockerId:m}=h;let g=new Map;f.has(m)&&(g=f.get(m));const p=c.filter(w=>w.dockerId===m),O=(_=(y=p.filter(w=>["startQuestion","endQuestion"].indexOf(w.data.action)>-1)[0])==null?void 0:y.data)==null?void 0:_.value;let v=[];return O&&(v=r[O].reduce((S,Q)=>(S.push(Q.map(k=>k+s)),S),[]).reduce((S,Q)=>{const[k,C]=Q;return S.concat(p.filter(X=>X.timestamp>=k&&X.timestamp<=C))},[])),g.set(h.path,{content:h.content,data:{cheatList:[],changesList:[],customizeList:v}}),f.set(m,g),f},new Map);he.file.setFileBaseHistoryData(u),this.playbackEngine.buffer(o),this.playControlSubscribers.forEach(f=>f.onAvailable())}eventCustomize(e){this.trigger("customize",{name:e.eventName,payload:e})}dealWithActiveEvent(e,n=!0){const{success:r,reason:i,error:o}=e,s={SUCCESS:Pn("common_success"),PLAYGROUND_NOT_EXISTED:Pn("dao_channel_playground_not_exist"),DOCKER_NOT_BIND:Pn("dao_channel_playground_unbound_container"),DOCKER_START_FAIL:Pn("dao_channel_container_startup_failed"),RESOURCE_NOT_ENOUG:Pn("dao_channel_insufficient_server_resources"),BUSY:Pn("dao_channel_server_is_busy"),DOCKER_INFO_LOST:Pn("dao_channel_activation_timeout")},a={status:"ACTIVE",message:""};if(!r){let c=Pn("dao_channel_docker_failed_to_activate");return i&&(c+=`: ${s[i]||i}`),o&&(c+=`- ${o}`),this.currentReconnectActiveTimes>this.reconnectMaxActiveTimes?this.transitionError(nt.ErrorFromServer,c):n&&this.trigger("message",{name:nt.StatusChanged,payload:{status:"INACTIVE"}}),a.status="INACTIVE",a.message=c,a}return U.dao.playgroundInfo().status==="ACTIVE"?(this.currentReconnectActiveTimes=1,a):(this.updatePlaygroundInfoPartial({status:"ACTIVE",playgroundIDEServerStatus:"SYNCED"}),n&&this.trigger("message",{name:nt.StatusChanged,payload:{status:"ACTIVE"}}),this.currentReconnectActiveTimes=1,a)}dealWithPlaybackData(e,n=!0){var O;const r=U.dao.mockPlaybackData();r&&(e=JSON.parse(r));const{playbackSummerize:i,playbackData:o,agentUsers:s,rrwebDataAllData:a={}}=e,{rrwebData:l=[],customEvents:c=[]}=a;this.customEvents=c,he.dao.updateAgentUsers(s);const u=this.setPlaybackSummerize(i),d=[],f=o.playbackData,h=i.start,m=U.dao.noFrameSpan()*1e3;for(let v=0;v<f.length-1;v++)U.dao.noFrameSpan()&&f[v+1].timestamp-f[v].timestamp>=m&&d.push([f[v].timestamp-h,f[v+1].timestamp-h]);const g=document.querySelector(".d42-browser-body");if(g&&l.length>=2){const v=l[0],y=l[l.length-1],_=f[f.length-1];y.timestamp>_.timestamp&&f.push({timestamp:y.timestamp,eventName:"rrweb",data:y.data,agentUserId:_.agentUserId,dockerId:_.dockerId}),l.unshift({...v,timestamp:f[0].timestamp+1}),l.unshift({...v,timestamp:f[f.length-1].timestamp+1});try{const w=U.config.showRRwebController();this.webPlayer=new g5e({target:g,props:{events:l,autoPlay:!1,speedOption:U.config.speedOption(),skipInactive:!1,showController:w,tags:{endQuestion:"red"}}});const S=(O=this.webPlayer)==null?void 0:O.getReplayer();S&&(S.on("event-cast",Q=>{this.updateReplayerConfig(S,Q),this.updateMouseIconDisplay("none"),Q.data.tag==="endQuestion"?S.wrapper.style.visibility="hidden":S.wrapper.style.visibility="visible"}),S.on("mouse-interaction",Q=>{const k=+Q.type==2?"inline-block":"none";this.updateMouseIconDisplay(k)}))}catch(w){ct.error("replay rrweb error:",w)}}this.setPlaybackEngineData(i,o,u);const p={...i,questionsData:u,whiteFrames:d};return n&&this.trigger("message",{name:nt.PlaybackInfo,payload:p}),p}registerEventsOnSocket(){var e,n;if(!this.socket)throw new Error(Pn("dao_channel_connection_not_established"));this.socket.on(ot.SyncPlaygroundInfo,r=>{const i=U.dao.isPlayBack();if(r.lspStatus=i?_O.NotSupport:r.lspStatus,this.trigger("message",{name:nt.RunUnitTestStatus,payload:{eventName:"runUnitTestStatus",timestames:new Date,data:{type:"runUnitTest",action:r.unitTestRunning?"running":"done"}}}),he.config.supportRRWeb(!!r.supportRRWeb),U.dao.getFollowingAgentUser()&&this.followBrowser(!!r.supportRRWeb),r.playgroundIDEServerStatus==="ERROR"){he.dao.channelAvailable(!0),this.trigger("message",{name:nt.StatusChanged,payload:{status:"INACTIVE"}});return}if(r.playgroundIDEServerStatus==="SYNCING"){ct.debug("server is syncing playgroundInfo, waiting");return}if(U.dao.appStatus()==="loading"){this.initAppStatusLoadingPlaygroundInfo(r);return}if(U.dao.isReady()){this.changeAppStatusReadyPlaygroundInfo(r);return}if(U.dao.isReadyOffline()){const s=U.dao.playgroundInfo(),a=s.status;r.status!==a&&this.trigger("message",{name:nt.StatusChanged,payload:{status:r.status}}),s.runStatus==="DEBUG_RUNNING"&&r.status!=="ACTIVE"&&(he.file.debugStatus("stop"),he.file.setDebugInfo({}),U.dao.channel().trigger(ot.StoppedData,{name:ot.StoppedData,payload:{data:{}}}),this.transitionDebug({debugStatus:"stop"})),he.dao.setPlaygroundInfo(r),he.dao.channelAvailable(!0),this.transitionOnline(),this.trigger("message",{name:nt.Ready}),this.heartbeat();return}ct.warn("syncPlaygroundInfo event happened at a wrong appStatus")}),this.socket.on(ot.FileChange,r=>{this.updatePlaygroundInfoPartial({fileChangeLogs:r.data})}),this.socket.on(ot.ChangePlaygroundInfo,r=>{if(he.config.supportRRWeb(!!r.supportRRWeb),this.followBrowser(!!r.supportRRWeb),U.dao.isReady()){this.changeAppStatusReadyPlaygroundInfo(r);return}ct.warn("ChangePlaygroundInfo event happened at a wrong appStatus")}),this.socket.on(ot.Active,r=>{this.dealWithActiveEvent(r,!0)}),this.socket.on(ot.StopLSPServer,r=>{this.trigger("message",{name:nt.StopLSPServer,payload:{isStop:r.data.isStop,currentAgentUserId:r.data.currentAgentUserId}})}),this.socket.on(ot.InitRRweb,()=>{he.config.supportRRWeb(!0),U.dao.getFollowingAgentUser()&&this.followBrowser(!0)}),this.socket.on(ot.UpdatePlaygroundInfo,r=>{this.updatePlaygroundInfoPartial(r)}),this.socket.on(ot.LspStatus,r=>{const i=U.dao.playgroundInfo().lspStatus,{status:o}=r;if(i===o){ct.debug("lspStatus event is the same, ignored");return}this.updatePlaygroundInfoPartial({lspStatus:o}),this.transitionLspStatus(o)}),this.socket.on(ot.Following,r=>{const{agentUsers:i}=U.dao.playgroundInfo(),o=i.findIndex(s=>s.userId===r.agentUserId);o>-1&&(i[o]=r),this.updatePlaygroundInfoPartial({agentUsers:i}),this.trigger("message",{name:nt.Following,payload:{user:r}})}),this.socket.on(ot.UnFollowing,r=>{const{agentUsers:i}=U.dao.playgroundInfo(),o=i.findIndex(s=>s.userId===r.agentUserId);o>-1&&(i[o]=r),this.updatePlaygroundInfoPartial({agentUsers:i}),this.trigger("message",{name:nt.UnFollowing,payload:{user:r}})}),this.socket.on(ot.UserEnter,r=>{U.dao.getAgentUserById(r.agentUserId)?he.dao.updateAgentUser(r.agentUserId,r):he.dao.addAgentUser(r),this.trigger("message",{name:nt.UserEnter,payload:{agentUser:r}})}),this.socket.on(ot.UserLeave,r=>{he.dao.updateAgentUser(r.agentUserId,r),this.trigger("message",{name:nt.UserLeave,payload:{agentUser:r}})}),this.socket.on(ot.UsersUpdated,r=>{this.updatePlaygroundInfoPartial({agentUsers:r});const i=U.dao.getFollowingAgentUser(),o=i==null?void 0:i.focusXterm;this.trigger("message",{name:nt.UsersUpdated,payload:{agentUsers:r,xtermKey:o}})}),this.socket.on(ot.AppendCustomizeFrameData,r=>{this.trigger("message",{name:nt.AppendCustomizeFrameData,payload:r})}),this.socket.on(ot.PlaybackInfo,r=>{this.dealWithPlaybackData(r)}),this.socket.on(ot.File,r=>{var S;if(r.code===-1){he.file.resetFile(),qr.warn(r.message),this.uploadLog("Receive File",r.message||"\u6587\u4EF6\u4E0D\u5B58\u5728");return}he.file.aiCodeInfo(r.aiCodeInfo||[]);const i=he.file.switchFile,o=he.dao.setLatestDocContent;if(U.dao.isPlayBack()){i(r.data),he.file.loadingPath(""),he.file.setSelectedFilePath(r.data.openedPath),o(r.data.content||"");return}he.file.loadingPath("");const{agentUserId:s}=r,a=((S=r==null?void 0:r.data)==null?void 0:S.openedPath)||"",l=U.file.selectedFilePath(),c=U.dao.currentAgentUserId(),u=Mc+c===s,d=U.dao.currentAgentUser(),f=he.dao.updateAgentUser,h=this.isFollowMode(d,r.agentUserId),m=U.file.treeData(),g=U.file.hideEditFeature(),p=U.file.hideFeature(),O=r.data.openedPath,v=m[O],_=(v?v.hide:!0)&&p==="preview"&&g===!1,w=r.agentUserId!==c&&!u&&l===r.data.openedPath&&r.data.isRefresh;if(a!==U.file.latestRequestFilePath()&&!h){this.uploadLog("Receive File",JSON.stringify({requestTimestamp:r.requestTimestamp,latestRequestFilePath:U.file.latestRequestFilePath(),isFollow:h,filePath:a,selectedFilePath:l}));return}w&&he.file.setDocLoading(!0),r.agentUserId===c||u||h||w?(i(r.data,_),he.file.setSelectedFilePath(r.data.openedPath),o(r.data.content||""),this.transitionFileInfo({openedPath:r.data.openedPath}),he.file.pendingUpdateCount(0),he.file.mapSelection(r.data.mapSelection),h&&this.send(Dn.OpenFileByFollow,{fileOpened:r.data.openedPath})):this.uploadLog("Receive File",JSON.stringify({agentUserId:r.agentUserId,currentAgentUserId:c})),f(r.agentUserId,{fileOpened:r.data.openedPath}),d.followingAgentUserId&&f(c,{fileOpened:r.data.openedPath}),w?setTimeout(()=>{he.file.setDocLoading(!1)},100):he.file.setDocLoading(!1),this.dispatchDataEvent("editor",r)}),this.socket.on(ot.CloseFile,r=>{U.dao.currentAgentUser().followingAgentUserId===r.agentUserId&&r.data.path===U.file.getOpenedPath()&&(he.file.resetDoc(),he.file.setSelectedFilePath(""))}),this.socket.on(ot.FileTree,r=>{this.dispatchDataEvent(ot.FileTree,r)}),this.socket.on(ot.Run,r=>{this.dispatchDataEvent(ot.Run,r)}),this.socket.on(ot.FileSearchKeyword,r=>{const i={...U.file.searchKeywordInfo()};i.data=r.result||{},he.file.searchKeywordInfo(i)}),this.socket.on(ot.RunStatus,r=>{const{status:i,runResult:o,gui:s,internalRunInfo:a}=r,l=U.dao.playgroundInfo().runStatus,c=U.dao.playgroundInfo().openPort,u=i==="STOP"?!1:c;if(this.closeRunLoading(i,u),this.updatePlaygroundInfoPartial({openPort:u}),l===i){ct.debug("runStatus event is the same, ignored");return}this.updatePlaygroundInfoPartial({runStatus:i,gui:s}),this.trigger("message",{name:nt.RunStatusChanged,payload:{status:i,runResult:o,internalRunInfo:a}})}),this.socket.on(ot.Console,r=>{this.dispatchDataEvent(ot.Console,r);const{value:i}=r.data;i&&![XS,`\r
|
|
154
156
|
`].includes(i)&&this.transitionXtermInfo({consoleUpdate:!0})}),this.socket.on(ot.Terminal,r=>{this.dispatchDataEvent(ot.Terminal,r);const{value:i}=r.data;i&&![XS,"\x1B[?2004h",`\r
|
|
155
|
-
\x1B[?2004l\r`,"\x1B[01;34m~/app\x1B[00m$ ","\r\x1B[K\x1B[01;34m~/app\x1B[00m$ ","\x1B[?2004h\x1B[01;34m~/app\x1B[00m$ "].includes(i)&&this.transitionXtermInfo({terminalUpdate:!0})}),this.socket.on(ot.ClaudeCode,r=>{this.dispatchDataEvent(ot.ClaudeCode,r);const{value:i}=r.data
|
|
156
|
-
\x1B[?2004l\r`,"\x1B[01;34m~/app\x1B[00m$ ","\r\x1B[K\x1B[01;34m~/app\x1B[00m$ ","\x1B[?2004h\x1B[01;34m~/app\x1B[00m$ "].includes(i)&&(this.transitionXtermInfo({terminalUpdate:!0}),this.isClaudeCodeTUIRedraw(i)||this.trigger("message",{name:"ClaudeCodeOutput",payload:{value:i,timestamp:r.timestamp,agentUserId:r.agentUserId}}))}),this.socket.on(ot.XtermStatus,r=>{const{resetConsole:i}=r;i&&he.dao.resetConsole()}),this.socket.on(ot.Simulator,r=>{this.updatePlaygroundInfoPartial({openPort:!0}),this.closeRunLoading(null,!0),this.dispatchDataEvent(ot.Simulator,r),this.trigger("message",{name:nt.ApplicationAvailable,payload:r})}),this.socket.on(ot.SetBreakPoint,({data:r,isOnlySyncData:i=!1})=>{U.dao.isPlayBack()||this.setBreakPoints(r,i)}),this.socket.on(ot.DebugStatus,r=>{he.file.debugStatus(r),this.transitionDebug({debugStatus:r})}),this.socket.on(ot.UpdateDebugSupport,r=>{this.updatePlaygroundInfoPartial({debugSupport:r}),this.transitionDebug({debugSupport:r!=null?r:!1}),this.syncDebugData()}),this.socket.on(ot.FileWatchRefreshConfig,r=>{this.updatePlaygroundInfoPartial({...r.data})}),this.socket.on("errorHandler",r=>{this.transitionError(nt.ErrorFromServer,BL(r))}),this.socket.on(ot.StoppedData,r=>{var o;he.file.setDebugInfo(r);const i=((o=r.stack_trace_body)==null?void 0:o.stackFrames)||[];if(i.length){he.file.debugUserId(r.debugUserId||"");const s=U.dao.playgroundInfo().lspRootPath,a=i[0].source.path,l=a.replace(`${s}`,"").substring(1);if(U.file.getOpenedPath()!==l){U.dao.channelAvailable()?(this.loadFile(l),this.waitingDebugFilePath=""):this.waitingDebugFilePath=a;return}}U.dao.channel().trigger(ot.StoppedData,{name:ot.StoppedData,payload:{data:r}})}),this.socket.on(ot.ResourceMonitoring,r=>{this.trigger("message",{name:nt.ResourceMonitoring,payload:r})}),this.socket.on(nt.RunUnitTestStatus,r=>{this.trigger("message",{name:nt.RunUnitTestStatus,payload:r})}),this.socket.on(nt.RunUnitTestResult,r=>{this.trigger("message",{name:nt.RunUnitTestResult,payload:r})}),this.socket.on(nt.StopUnitTestResult,r=>{this.trigger("message",{name:nt.StopUnitTestResult,payload:r})}),this.socket.on(nt.RumCmdResult,r=>{this.trigger("message",{name:nt.RumCmdResult,payload:r})}),this.socket.on(nt.StopRunCmdResult,r=>{this.trigger("message",{name:nt.StopRunCmdResult,payload:r})}),(n=(e=this.socket)==null?void 0:e.onAny)==null||n.call(e,(r,i)=>{this.uploadLog("ReceiveEvent",r),ct.debug(`<< ${r}`)})}isFollowMode(e,n){if(!e||!e.followingAgentUserId)return!1;const r=Mi(U.dao.playgroundInfo().agentUsers);let i=e.followingAgentUserId===n;if(i)return i;let o=e.followingAgentUserId;for(;r.length;){const s=r.findIndex(a=>a.agentUserId===o);if(s>-1){const a=r[s];if(r.splice(s,1),a.followingAgentUserId===n){i=!0;break}else o=a.followingAgentUserId}else break}return i}setBreakPoints(e,n){he.file.setBreakPoints(e),U.dao.channel().trigger(ot.SetBreakPoint,{name:ot.SetBreakPoint,payload:{data:e,isOnlySyncData:n}})}initAppStatusLoadingPlaygroundInfo(e){if(he.dao.setPlaygroundInfo(e),he.file.fileRootId(e.fileRootId),he.dao.channelAvailable(!0),this.transitionReady(),this.syncDebugData(),this.waitingDebugFilePath){const n=U.dao.playgroundInfo().lspRootPath,r=this.waitingDebugFilePath.replace(`${n}`,"").substring(1);this.loadFile(r),this.waitingDebugFilePath=""}}changeAppStatusReadyPlaygroundInfo(e){const n=U.dao.playgroundInfo().status,r=U.dao.playgroundInfo().dockerId;e.dockerId!==r&&(he.file.reset(),he.file.closeLspServer()),he.file.fileRootId(e.fileRootId),he.dao.setPlaygroundInfo(e),he.dao.channelAvailable(!0),e.status!==n&&this.trigger("message",{name:nt.StatusChanged,payload:{status:e.status}}),e.dockerId!==r&&(this.openDefaultFile(),this.trigger("message",{name:nt.PlaygroundChanged}))}reconnectedCall(){U.file.selectedFilePath()&&U.file.docLoading()&&this.loadFile(U.file.selectedFilePath(),"refresh")}async closeRunLoading(e,n){const r=e||U.dao.playgroundInfo().runStatus;(n&&r==="RUNNING"||!n&&r==="STOP")&&(await $Te(1e3),this.trigger("message",{name:nt.CloseRunLoading,payload:!1}))}transitionOnline(){var n;he.dao.transitionOnline(),(n=this.messageListenersMap.get(nt.Online))==null||n({name:nt.Online}),this.reconnectedCall();const e=U.file.getOpenedPath();e&&this.send(Dn.ReconnectOnline,{fileOpened:e}),this.trigger("message",{name:nt.Online})}transitionOffline(){var e;he.dao.transitionOffline(),(e=this.messageListenersMap.get(nt.Offline))==null||e({name:nt.Offline}),this.trigger("message",{name:nt.Offline})}transitionLoading(){he.dao.transitionLoading(),this.trigger("message",{name:nt.Loading})}openDefaultFile(){const n=[...(U.dao.playgroundInfo().defaultOpenFile||"").split(","),U.dao.specialOpenFile(),...U.dao.defaultOpenFiles()||[]],r=n.find(i=>i&&ZL(i));r&&r!==U.file.getOpenedPath()&&(this.uploadLog("OpenDefaultFile",`defaultOpenFile:${n},targetFile:${r}`),this.loadFile(r))}transitionBehindTooMuch(){var e;(e=this.messageListenersMap.get(nt.BehindTooMuch))==null||e({name:nt.BehindTooMuch}),this.trigger("message",{name:nt.BehindTooMuch})}transitionReady(){he.dao.transitionReady(),this.openDefaultFile(),this.trigger("message",{name:nt.Ready})}transitionErrorAndHalted(e,n){he.dao.transitionError(),this.trigger("error",{name:e,error:n}),this.closeChannel()}transitionError(e,n){this.trigger("error",{name:e,error:n})}updatePlaygroundInfoPartial(e){if(!e.fileTree){const n=U.file.fileTree();n&&(e.fileTree=n)}he.dao.setPlaygroundInfo(Object.assign({},U.dao.playgroundInfo(),e))}updateCurrentAgentUserId(e){he.dao.currentAgentUserId(e)}dispatchStartDataEvent(e){if(!this.componentSubscribersMap[e]){ct.warn(`${e} is not supported for playback!`);return}this.componentSubscribersMap[e].forEach(n=>{n.onStart&&n.onStart()})}getPlaybackSnapshot(e,n,r){var i,o,s;if(!this.componentSubscribersMap[e]){ct.warn(`${e} is not supported for playback!`);return}return(s=(o=(i=this.componentSubscribersMap[e])==null?void 0:i[0])==null?void 0:o.getPlaybackSnapshot)==null?void 0:s.call(o,n,r)}getIsSyncData(e,n){if(U.dao.isPlayBack()||n.agentUserId==="ide"||n.agentUserId==="backend"||e===ot.FileTree)return!0;const i=U.dao.currentAgentUser();return n.agentUserId===(i==null?void 0:i.agentUserId)||(i==null?void 0:i.followingAgentUserId)===n.agentUserId}dispatchDataEvent(e,n){var s;const r=this.componentSubscribersMap[e];if(!r){ct.warn(`${e} is not supported for playback!`),this.triggerEventListeners(e,n);return}if(!r.length){(s=X4[e])==null||s.call(X4,n);return}const i=U.dao.isPlayBack();if(!n&&i){r.forEach(a=>{a.onData(Mi(n))});return}n=n,this.getIsSyncData(e,n)&&r.forEach(a=>{a.onData(Mi(n))})}dispatchProgressEvent(e,n){this.playControlSubscribers.forEach(r=>{e==="complete"?(r.onComplete(),he.dao.playbackStatus("complete")):e==="progress"?r.onProgress(n):e==="error"&&r.onError(Error(n))})}trigger(e,n){if(e==="error"){this.errorListeners.forEach(r=>r(n));return}ct.info(`[messageLinstener][trigger]${e}-${this.messageListeners.length}`),this.messageListeners.forEach(r=>{r(n)})}transitionCustomError(e){this.trigger("error",e)}clearHeartbeatInterval(){this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}startHeartbeatInterval(){this.heartbeatInterval=setInterval(()=>{this.heartbeat()},6e4)}clearSelectionLayer(){const e=document.querySelector(".cm-layer.cm-selectionLayer");e&&e.replaceChildren()}syncDebugData(){const{debugSupport:e}=U.dao.playgroundInfo(),n=U.dao.isOpenDebugMode();e&&n&&this.send(ot.SyncDebugData)}active(){this.currentReconnectActiveTimes++,this.send(Dn.Active)}retainingAllFiles(){this.send(Dn.RetainingAllFiles)}run(){this.send(Dn.Run)}stop(){this.send(Dn.Stop)}statisticsPlaybackData(e,n){this.send(Dn.StatisticsPlaybackData,{eventName:e,questionIds:n})}getUnitTestFun(){this.send(Dn.GetUnitTestFun)}runUnitTestByFilePath(e){this.send(Dn.RunUnitTestResult,e)}stopUnitTest(e){this.send(Dn.StopUnitTest,{runId:e})}runCmd(e){this.send(Dn.RunCmd,e)}stopRunCmd(e){this.send(Dn.StopRunCmd,{runId:e})}appendRRWebData(e){const n=U.config.persistenceWebData(),r=U.dao.currentAgentUser();this.send(Dn.RRWeb,{data:e,persistenceWebData:n,currentAgent:r})}appendCustomizeFrameData(e){this.send(Dn.CustomizeFrameData,e)}playbackIsRunning(){var e;return(e=this.playbackEngine)==null?void 0:e.playing}startRecordBrowser(e=!0){var o;if(U.dao.getFollowingAgentUser())return;he.config.recordBrowser(e);const r=`https://${U.dao.playgroundInfo().url}`,i=document.getElementById("dao-browserIframe");if(i){const s=e?"record":"stopRecord";(o=i.contentWindow)==null||o.postMessage(JSON.stringify({type:s,time:Date.now()}),r)}}followBrowser(e){var r;if(he.config.live(e),e){U.dao.channel().liveBrowser();const i=document.querySelector(".d42-browser-body");i&&((r=this.replayer)==null||r.destroy(),this.replayer=new ICe([],{liveMode:!0,UNSAFE_replayCanvas:!0,root:i,unpackFn:vCe}),this.replayer.startLive(Date.now()-500),he.config.replayer(this.replayer))}else this.replayer&&(this.replayer.destroy(),this.replayer=null);U.dao.getFollowedAgentUser()&&this.startRecordBrowser(!0)}handleRes(e,n=""){return{status:e,message:n}}handleSuccessRes(e){return{status:!0,message:e}}handleErrorRes(e){return{status:!1,message:e}}openFile(e,n="default"){return e===U.file.getOpenedPath()&&n!=="refresh"?Promise.resolve(this.handleSuccessRes(Pn("common_success"))):new Promise((r,i)=>{if(!U.dao.isReady())return i(this.handleErrorRes(Pn("dao_paas_no_ready")));if(U.dao.playgroundInfo().status==="END")return i(this.handleErrorRes(Pn("dao_paas_docker_has_been_destoryed")));ZL(e)?(U.dao.channel().loadFile(e,n),Td(e),r(this.handleSuccessRes(Pn("common_success")))):i(this.handleErrorRes(Pn("dao_paas_file_does_not_exist")))})}loadFile(e,n="default"){var s,a,l,c;if((e===U.file.getOpenedPath()||e===U.file.loadingPath())&&n!=="refresh")return;const r=U.dao.isPlayBack();let i="";if(r){if(!this.playbackEngine){he.file.setSelectedFilePath("");return}const u=this.playbackEngine.getCurrentFrame(),d=u==null?void 0:u.dockerId,f=U.file.getFileBaseHistoryByPath(d,e,!0);if(f&&f.content!==void 0){he.file.loadingPath(e),he.file.setSelectedFilePath(e);const h=this.playbackEngine.getCurrentDocByPathAndDocker(d,e);h&&this.dispatchDataEvent(h.eventName,h);return}else i=this.playbackEngine.getFileRootPathByDockerId(d,e)}if(r&&!i){he.file.setSelectedFilePath(""),qr.error(Pn("\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6.").toString());return}he.file.loadingPath(e),he.file.setDocLoading(!0),he.file.setSelectedFilePath(e),(s=this.socket)==null||s.off("pullOTUpdates"),(a=this.socket)==null||a.off("syncOTUpdates"),(l=this.socket)==null||l.off("pushOTUpdates"),(c=this.socket)==null||c.off(ot.SelectedUpdated);const o=Date.now();he.file.latestRequestFilePath(e),TJ(e),he.file.mapSelection({}),this.send(Dn.File,{path:e,timestamp:o,fileRootId:U.file.fileRootId(),loadType:n,fileRootPath:i,readOnly:r})}searchKeyword(e){this.send(Dn.FileSearchKeyword,e)}updateAreaFlags(e){const{path:n,ids:r}=e;U.file.getOpenedPath()!==n?(this.loadFile(n),he.dao.waitingAreaInfo({type:"updateFlag",ids:r,path:n})):U.dao.isAnswerSubscribed()?(he.dao.waitingAreaInfo({}),this.transitionUpdateAreaFlags(r)):he.dao.waitingAreaInfo({type:"updateFlag",ids:r,path:n})}transitionUpdateAreaFlags(e){this.trigger(nt.UpdateAreaFlags,{name:nt.UpdateAreaFlags,payload:{ids:e}})}removeAreaTextById(e,n,r){U.file.getOpenedPath()!==r?(this.loadFile(r),he.dao.waitingAreaInfo({type:"remove",id:e,path:r,text:n})):(he.dao.waitingAreaInfo({}),this.transitionRemoveAreaTextById(e,n))}transitionRemoveAreaTextById(e,n){this.trigger(nt.ReplaceCodeById,{name:nt.ReplaceCodeById,payload:{id:e,text:n}})}jumpToAreaById(e,n){U.file.getOpenedPath()!==n?(Td(n),this.loadFile(n),he.file.fileIntoView(!0),he.dao.waitingAreaInfo({type:"jump",id:e,path:n})):(he.dao.waitingAreaInfo({}),this.transitionJumpToAreaById(e))}transitionJumpToAreaById(e){this.trigger(nt.JumpToAreaById,{name:nt.JumpToAreaById,payload:{id:e}})}insertTextById(e,n,r){this.trigger(nt.InsertTextById,{name:nt.InsertTextById,payload:{id:e,text:n,lineNum:r}})}insertCodeByCursor(e){he.file.openFileParams({isCurrentOpenFile:!0,insertCodeOptions:e,actions:"insertCode"}),ct.log(`insertCodeByCursor: ${JSON.stringify(e)}`)}closeFile(e){const n=Date.now();this.send(Dn.CloseFile,{path:e,timestamp:n})}editorScroll(e){this.send(Dn.EditorScroll,e)}switchLanguage(e,n,r,i){this.send(Dn.SwitchLanguage,{languageType:e,languageValue:n,fileName:r,createNewFile:i})}restartServer(){he.file.closeLspServer(),this.send(Dn.RestartServer)}stopLSPServer(e,n=!0){he.file.closeLspServer(),he.config.stopLsp(e),e||this.send(Dn.RestartLSPServer),n&&this.send(Dn.StopLSPServer,{isStop:e,isTriggerEvent:n})}restartLSPServer(){he.file.closeLspServer(),this.send(Dn.RestartLSPServer)}addCDNSource(e,n,r){this.send(Dn.AddCDNSource,{cdnUrlType:e,cdnUrlPath:n,fileName:r})}editFile(e){this.send(Dn.EditFile,e)}operateFileTree(e){this.send(Dn.FileTree,{...e,fileRootId:U.file.fileRootId()})}terminal(e){this.send(Dn.Terminal,e)}claudecode(e){this.send(Dn.ClaudeCode,e)}xtermStatus(e){this.send(Dn.XtermStatus,e)}cursor(e){this.send("cursor",e)}heartbeat(){this.send("heartbeat")}getPlaybackInfo(){this.send(Dn.GetPlaybackInfo)}followingAgentUser(e){this.send("followingAgentUser",e)}featureConfig(e){this.send("setFeaturesConfig",e)}setFileLockStatus(e){this.send("setFileLockStatus",e)}setFileVisible(e){this.send("setFileVisible",e)}addFileToUnitTest(e){this.send("addFileToUnitTest",e)}removeFileFromUnitTest(e){this.send("removeFileFromUnitTest",e)}refreshXtermColsRows(e){this.send("refreshXtermColsRows",e)}followingFocusComponent(e){const n=U.dao.currentAgentUser();!n||n.focusComponent!==e&&(n.followingAgentUserId||this.send("followingFocusComponent",e),this.trigger("followingFocusComponentUpdate",{name:"followingFocusComponentUpdate",payload:{type:e}}))}followingEditorScroll(e){const n=U.dao.currentAgentUser();n!=null&&n.followingAgentUserId||this.send("followingEditorScroll",e)}unFollowingAgentUser(){this.send("unFollowingAgentUser")}getMemorySnap(){this.send("getMemorySnap")}publishKeyEvent(e){this.send(Dn.KeyEvent,e)}restartPlayback(e){var n;Object.entries(this.componentSubscribersMap).forEach(([r,i])=>i.forEach(o=>o.onStart&&o.onStart())),this.playbackEngine.setRate(e),this.playbackEngine.restart(),(n=this.webPlayer)==null||n.goto(0,!0),he.dao.playbackStatus("restartPlayback")}setPlaybackRateAfterHooks(e){var n;(n=this.webPlayer)==null||n.setSpeed(e)}startPlayback(e=1){var r,i,o;he.dao.playbackStatus("startPlayback");const n=this.playbackEngine.resumeTime;if(n?(r=this.webPlayer)==null||r.goto(n,!0):(i=this.webPlayer)==null||i.play(),(o=this.playbackEngine)!=null&&o.dataBuffer.length){this.playbackEngine.resume();return}this.playbackEngine.setRate(e),this.playControlSubscribers.forEach(s=>s.onLoad()),Object.entries(this.componentSubscribersMap).forEach(([s,a])=>a.forEach(l=>l.onStart&&l.onStart()))}pausePlayback(e=!1){var n;this.playbackEngine.pause(),(n=this.webPlayer)==null||n.pause(),e&&this.trigger("message",{name:nt.PausePlayback,payload:{}}),he.dao.playbackStatus("pausePlayback")}stopPlayback(){var e,n,r,i;if(this.playbackEngine){this.playbackEngine.playing=!1,(e=this.webPlayer)==null||e.pause(),(n=this.dispatchProgressEvent)==null||n.call(this,"progress",0);const o=(r=this.playbackEngine)==null?void 0:r.dataBuffer.find(s=>s.eventName==="fileTree"&&s.data.action==="REFRESH");o&&this.componentSubscribersMap[o.eventName].forEach(s=>{s.onData(Mi(o))}),(i=this.playbackEngine)==null||i.buffer([]),this.playbackEngine=void 0}he.file.resetFile(),he.file.resetBreakPoints(),he.file.resetDebugInfo(),he.dao.resetTerminal(),he.dao.resetConsole(),U.dao.channel().xtermStatus({resetConsole:!0}),this.playControlSubscribers.forEach(o=>o==null?void 0:o.onStopPlayback()),he.dao.playbackStatus("stopPlayback")}createFile(e,n){const r=U.file.fileTree(),i=gg(r),o=Array.isArray(e)?e:[e],s=o.find(c=>i[c]);if(s)return Promise.reject(Pn("file_tree_x_existed",{x:s}));const a=o.map(c=>({type:n?"DIRECTORY":"FILE",name:c})),l={action:"CREATE",triggerBy:"API",files:a};return U.dao.channel().operateFileTree(l),new Promise((c,u)=>{var f,h;const d=m=>{m.data.triggerBy==="API"&&c(!0)};(f=this==null?void 0:this.socket)==null||f.off(ot.FileTree,d),(h=this.socket)==null||h.on(ot.FileTree,d)})}expandByPath(e,n){const r=U.file.onExpand(),i=e.split("/");let o=i[0];if(n.type==="DIRECTORY")for(let s=0;s<i.length;s++)r(o),o=o+"/"+i[s+1]}setPlaybackRate(e){this.playbackEngine.setRate(e)}send(e,n={}){if(!this.socket)throw new Error(Pn("dao_channel_socket_is_not_ready"));if(e!=="auth"&&!U.dao.channelAvailable()){ct.warn(`socket is unavailable, ignore send event: ${e}`);return}ct.debug(`>> ${e}`);const r=U.dao.isPlayBack(),i=["auth","heartbeat","getPlaybackInfo","loadPlaybackData","statisticsPlaybackData","i18nLanguage","pushFormatCode","file"];if(!r){this.socket.emit(e,n,{currentDockerId:U.dao.playgroundInfo().dockerId});return}if(i.includes(e)){if(e!==Dn.File){this.socket.emit(e,n);return}n.readOnly&&this.socket.emit(e,n)}}addEventListeners(e,n){const r=this.eventListeners.get(e)||[];r.push(n),this.eventListeners.set(e,r)}removeEventListeners(e,n){const r=this.eventListeners.get(e)||[];if(!n){this.eventListeners.delete(e);return}const i=r.findIndex(o=>o===n);r.splice(i,1),this.eventListeners.set(e,r)}triggerEventListeners(e,n){(this.eventListeners.get(e)||[]).forEach(i=>{i==null||i(n)})}on(e,n){if(!this.socket)throw new Error(Pn("dao_channel_socket_is_not_ready_for_x",{x:e}));this.socket.on(e,n),U.dao.isPlayBack()&&this.addEventListeners(e,n)}off(e){var n;typeof e=="string"?((n=this.socket)==null||n.off(e),U.dao.isPlayBack()&&this.removeEventListeners(e)):e.forEach(r=>{var i;(i=this.socket)==null||i.off(r),this.removeEventListeners(r)})}isReady(){var e;return(e=this.socket)==null?void 0:e.connected}transitionLspStatus(e){const n=U.dao.isPlayBack();this.trigger("message",{name:nt.LspStatusChanged,payload:{status:n?_O.NotSupport:e}})}emitI18nLanguage(e){this.send(ot.I18nLanguage,{language:e})}switchVirtualUser(e){return new Promise((n,r)=>{const i=U.dao.currentAgentUser();if(i){const{agentUserId:o}=i,s=o.startsWith(Mc);if(e&&s||!e&&!s){n({result:!0,message:"Switch user successfully."});return}let a="";e?a=Mc+o:a=o.replace(Mc,""),this.off(ot.SwitchVirtualUser),this.on(ot.SwitchVirtualUser,l=>{if(l.result){const{data:{currentAgentUser:c}}=l;he.dao.switchCurrentReallyAgentUserId(c.agentUserId),he.dao.isVirtualUser(e),n(l)}else r(l)}),this.send(ot.SwitchVirtualUser,{agentUserId:a,virtualIdPreValue:Mc})}else r({result:!1,message:"Switch user fail, current user is cannot found."})})}offlineVirtualUser(){this.send(ot.offlineVirtualUser,{})}registerVirtualUser(e){return new Promise((n,r)=>{const i=U.dao.currentAgentUser();if(i){const o=e.avatar||Gee(e.name),a={userInfo:{username:e.name,avatarUrl:o},agentUserId:Mc+i.agentUserId,userId:Mc+i.userId};this.off(ot.RegisterVirtualUser),this.on(ot.RegisterVirtualUser,l=>{l.result?n(l):r(l)}),this.send(ot.RegisterVirtualUser,a)}else r({result:!1,message:"Register vitual user fail, current user is cannot found."})})}emitFormatCode(e){this.send(ot.PushFormatCode,e)}customExecute(e){this.send(ot.CustomExecute,e)}emitBreakPoint(e){this.send(ot.SetBreakPoint,e)}emitVariables(e){this.send(ot.Variables,e)}debugRun(){he.dao.resetConsole(),U.dao.channel().xtermStatus({resetConsole:!0}),this.send(ot.DebugRun)}debugNext(){const e=U.file.getDebugBody();this.send(ot.DebugNext,{threadId:e.threadId})}debugContinued(){const e=U.file.getDebugBody();this.send(ot.DebugContinue,{threadId:e.threadId})}debuStepIn(){const e=U.file.getDebugBody();this.send(ot.DebugStepIn,{threadId:e.threadId})}debuStepOut(){const e=U.file.getDebugBody();this.send(ot.DebugStepOut,{threadId:e.threadId})}uploadLog(e,n){U.dao.isPlayBack()||YCe.includes(n)}transitionFileInfo(e){this.trigger("message",{name:nt.FileInfo,payload:{...e}})}transitionXtermInfo(e){this.trigger("message",{name:nt.XtermInfo,payload:{...e}})}transitionDebug(e){this.trigger("message",{name:nt.Debug,payload:{...e}})}transitionIAnswerAreaInfo(e){this.trigger("message",{name:nt.AnswerAreaInfo,payload:{...e}})}fileWatchRefreshConfig(e){this.send(ot.FileWatchRefreshConfig,e)}manualRefresh(){this.send(ot.ManualRefresh)}editorBlur(e){this.send(ot.EditorBlur,e)}forceRefreshFile(e){e=e||U.file.getOpenedPath(),e===U.file.getOpenedPath()&&he.file.setDocLoading(!0),this.send(ot.ForceRefreshFile,{path:e,currentOpenedPath:U.file.getOpenedPath()})}closeChannel(){var e,n,r,i,o;ct.debug("close Channel..."),this.clearHeartbeatInterval(),this.messageListeners.splice(0,this.messageListeners.length),this.errorListeners.splice(0,this.errorListeners.length),this.componentSubscribersMap=Mi(aq),(e=this.socket)==null||e.removeAllListeners(),(r=(n=this.socket)==null?void 0:n.io)==null||r.reconnection(!1),(o=(i=this.socket)==null?void 0:i.close)==null||o.call(i),this.socket=void 0,he.file.closeLspServer()}}var Oc=(t=>(t.edit="edit",t.debug="debug",t.playback="playback",t))(Oc||{});const so=".d42-editor-container",VCe=`
|
|
157
|
+
\x1B[?2004l\r`,"\x1B[01;34m~/app\x1B[00m$ ","\r\x1B[K\x1B[01;34m~/app\x1B[00m$ ","\x1B[?2004h\x1B[01;34m~/app\x1B[00m$ "].includes(i)&&this.transitionXtermInfo({terminalUpdate:!0})}),this.socket.on(ot.ClaudeCode,r=>{this.dispatchDataEvent(ot.ClaudeCode,r);const{value:i}=r.data,o=[XS,"\x1B[?2004h",`\r
|
|
158
|
+
\x1B[?2004l\r`,"\x1B[01;34m~/app\x1B[00m$ ","\r\x1B[K\x1B[01;34m~/app\x1B[00m$ ","\x1B[?2004h\x1B[01;34m~/app\x1B[00m$ "],s=i?this.isClaudeCodeTUIRedraw(i):!0;i&&!o.includes(i)&&!s&&this.trigger("message",{name:"ClaudeCodeOutput",payload:{value:i,timestamp:r.timestamp,agentUserId:r.agentUserId}})}),this.socket.on(ot.XtermStatus,r=>{const{resetConsole:i}=r;i&&he.dao.resetConsole()}),this.socket.on(ot.Simulator,r=>{this.updatePlaygroundInfoPartial({openPort:!0}),this.closeRunLoading(null,!0),this.dispatchDataEvent(ot.Simulator,r),this.trigger("message",{name:nt.ApplicationAvailable,payload:r})}),this.socket.on(ot.SetBreakPoint,({data:r,isOnlySyncData:i=!1})=>{U.dao.isPlayBack()||this.setBreakPoints(r,i)}),this.socket.on(ot.DebugStatus,r=>{he.file.debugStatus(r),this.transitionDebug({debugStatus:r})}),this.socket.on(ot.UpdateDebugSupport,r=>{this.updatePlaygroundInfoPartial({debugSupport:r}),this.transitionDebug({debugSupport:r!=null?r:!1}),this.syncDebugData()}),this.socket.on(ot.FileWatchRefreshConfig,r=>{this.updatePlaygroundInfoPartial({...r.data})}),this.socket.on("errorHandler",r=>{this.transitionError(nt.ErrorFromServer,BL(r))}),this.socket.on(ot.StoppedData,r=>{var o;he.file.setDebugInfo(r);const i=((o=r.stack_trace_body)==null?void 0:o.stackFrames)||[];if(i.length){he.file.debugUserId(r.debugUserId||"");const s=U.dao.playgroundInfo().lspRootPath,a=i[0].source.path,l=a.replace(`${s}`,"").substring(1);if(U.file.getOpenedPath()!==l){U.dao.channelAvailable()?(this.loadFile(l),this.waitingDebugFilePath=""):this.waitingDebugFilePath=a;return}}U.dao.channel().trigger(ot.StoppedData,{name:ot.StoppedData,payload:{data:r}})}),this.socket.on(ot.ResourceMonitoring,r=>{this.trigger("message",{name:nt.ResourceMonitoring,payload:r})}),this.socket.on(nt.RunUnitTestStatus,r=>{this.trigger("message",{name:nt.RunUnitTestStatus,payload:r})}),this.socket.on(nt.RunUnitTestResult,r=>{this.trigger("message",{name:nt.RunUnitTestResult,payload:r})}),this.socket.on(nt.StopUnitTestResult,r=>{this.trigger("message",{name:nt.StopUnitTestResult,payload:r})}),this.socket.on(nt.RumCmdResult,r=>{this.trigger("message",{name:nt.RumCmdResult,payload:r})}),this.socket.on(nt.StopRunCmdResult,r=>{this.trigger("message",{name:nt.StopRunCmdResult,payload:r})}),(n=(e=this.socket)==null?void 0:e.onAny)==null||n.call(e,(r,i)=>{this.uploadLog("ReceiveEvent",r),ct.debug(`<< ${r}`)})}isFollowMode(e,n){if(!e||!e.followingAgentUserId)return!1;const r=Mi(U.dao.playgroundInfo().agentUsers);let i=e.followingAgentUserId===n;if(i)return i;let o=e.followingAgentUserId;for(;r.length;){const s=r.findIndex(a=>a.agentUserId===o);if(s>-1){const a=r[s];if(r.splice(s,1),a.followingAgentUserId===n){i=!0;break}else o=a.followingAgentUserId}else break}return i}setBreakPoints(e,n){he.file.setBreakPoints(e),U.dao.channel().trigger(ot.SetBreakPoint,{name:ot.SetBreakPoint,payload:{data:e,isOnlySyncData:n}})}initAppStatusLoadingPlaygroundInfo(e){if(he.dao.setPlaygroundInfo(e),he.file.fileRootId(e.fileRootId),he.dao.channelAvailable(!0),this.transitionReady(),this.syncDebugData(),this.waitingDebugFilePath){const n=U.dao.playgroundInfo().lspRootPath,r=this.waitingDebugFilePath.replace(`${n}`,"").substring(1);this.loadFile(r),this.waitingDebugFilePath=""}}changeAppStatusReadyPlaygroundInfo(e){const n=U.dao.playgroundInfo().status,r=U.dao.playgroundInfo().dockerId;e.dockerId!==r&&(he.file.reset(),he.file.closeLspServer()),he.file.fileRootId(e.fileRootId),he.dao.setPlaygroundInfo(e),he.dao.channelAvailable(!0),e.status!==n&&this.trigger("message",{name:nt.StatusChanged,payload:{status:e.status}}),e.dockerId!==r&&(this.openDefaultFile(),this.trigger("message",{name:nt.PlaygroundChanged}))}reconnectedCall(){U.file.selectedFilePath()&&U.file.docLoading()&&this.loadFile(U.file.selectedFilePath(),"refresh")}async closeRunLoading(e,n){const r=e||U.dao.playgroundInfo().runStatus;(n&&r==="RUNNING"||!n&&r==="STOP")&&(await $Te(1e3),this.trigger("message",{name:nt.CloseRunLoading,payload:!1}))}transitionOnline(){var n;he.dao.transitionOnline(),(n=this.messageListenersMap.get(nt.Online))==null||n({name:nt.Online}),this.reconnectedCall();const e=U.file.getOpenedPath();e&&this.send(Dn.ReconnectOnline,{fileOpened:e}),this.trigger("message",{name:nt.Online})}transitionOffline(){var e;he.dao.transitionOffline(),(e=this.messageListenersMap.get(nt.Offline))==null||e({name:nt.Offline}),this.trigger("message",{name:nt.Offline})}transitionLoading(){he.dao.transitionLoading(),this.trigger("message",{name:nt.Loading})}openDefaultFile(){const n=[...(U.dao.playgroundInfo().defaultOpenFile||"").split(","),U.dao.specialOpenFile(),...U.dao.defaultOpenFiles()||[]],r=n.find(i=>i&&ZL(i));r&&r!==U.file.getOpenedPath()&&(this.uploadLog("OpenDefaultFile",`defaultOpenFile:${n},targetFile:${r}`),this.loadFile(r))}transitionBehindTooMuch(){var e;(e=this.messageListenersMap.get(nt.BehindTooMuch))==null||e({name:nt.BehindTooMuch}),this.trigger("message",{name:nt.BehindTooMuch})}transitionReady(){he.dao.transitionReady(),this.openDefaultFile(),this.trigger("message",{name:nt.Ready})}transitionErrorAndHalted(e,n){he.dao.transitionError(),this.trigger("error",{name:e,error:n}),this.closeChannel()}transitionError(e,n){this.trigger("error",{name:e,error:n})}updatePlaygroundInfoPartial(e){if(!e.fileTree){const n=U.file.fileTree();n&&(e.fileTree=n)}he.dao.setPlaygroundInfo(Object.assign({},U.dao.playgroundInfo(),e))}updateCurrentAgentUserId(e){he.dao.currentAgentUserId(e)}dispatchStartDataEvent(e){if(!this.componentSubscribersMap[e]){ct.warn(`${e} is not supported for playback!`);return}this.componentSubscribersMap[e].forEach(n=>{n.onStart&&n.onStart()})}getPlaybackSnapshot(e,n,r){var i,o,s;if(!this.componentSubscribersMap[e]){ct.warn(`${e} is not supported for playback!`);return}return(s=(o=(i=this.componentSubscribersMap[e])==null?void 0:i[0])==null?void 0:o.getPlaybackSnapshot)==null?void 0:s.call(o,n,r)}getIsSyncData(e,n){if(U.dao.isPlayBack()||n.agentUserId==="ide"||n.agentUserId==="backend"||e===ot.FileTree)return!0;const i=U.dao.currentAgentUser();return n.agentUserId===(i==null?void 0:i.agentUserId)||(i==null?void 0:i.followingAgentUserId)===n.agentUserId}dispatchDataEvent(e,n){var s;const r=this.componentSubscribersMap[e];if(!r){ct.warn(`${e} is not supported for playback!`),this.triggerEventListeners(e,n);return}if(!r.length){(s=X4[e])==null||s.call(X4,n);return}const i=U.dao.isPlayBack();if(!n&&i){r.forEach(a=>{a.onData(Mi(n))});return}n=n,this.getIsSyncData(e,n)&&r.forEach(a=>{a.onData(Mi(n))})}dispatchProgressEvent(e,n){this.playControlSubscribers.forEach(r=>{e==="complete"?(r.onComplete(),he.dao.playbackStatus("complete")):e==="progress"?r.onProgress(n):e==="error"&&r.onError(Error(n))})}trigger(e,n){if(e==="error"){this.errorListeners.forEach(r=>r(n));return}ct.info(`[messageLinstener][trigger]${e}-${this.messageListeners.length}`),this.messageListeners.forEach(r=>{r(n)})}transitionCustomError(e){this.trigger("error",e)}clearHeartbeatInterval(){this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}startHeartbeatInterval(){this.heartbeatInterval=setInterval(()=>{this.heartbeat()},6e4)}clearSelectionLayer(){const e=document.querySelector(".cm-layer.cm-selectionLayer");e&&e.replaceChildren()}syncDebugData(){const{debugSupport:e}=U.dao.playgroundInfo(),n=U.dao.isOpenDebugMode();e&&n&&this.send(ot.SyncDebugData)}active(){this.currentReconnectActiveTimes++,this.send(Dn.Active)}retainingAllFiles(){this.send(Dn.RetainingAllFiles)}run(){this.send(Dn.Run)}stop(){this.send(Dn.Stop)}statisticsPlaybackData(e,n){this.send(Dn.StatisticsPlaybackData,{eventName:e,questionIds:n})}getUnitTestFun(){this.send(Dn.GetUnitTestFun)}runUnitTestByFilePath(e){this.send(Dn.RunUnitTestResult,e)}stopUnitTest(e){this.send(Dn.StopUnitTest,{runId:e})}runCmd(e){this.send(Dn.RunCmd,e)}stopRunCmd(e){this.send(Dn.StopRunCmd,{runId:e})}appendRRWebData(e){const n=U.config.persistenceWebData(),r=U.dao.currentAgentUser();this.send(Dn.RRWeb,{data:e,persistenceWebData:n,currentAgent:r})}appendCustomizeFrameData(e){this.send(Dn.CustomizeFrameData,e)}playbackIsRunning(){var e;return(e=this.playbackEngine)==null?void 0:e.playing}startRecordBrowser(e=!0){var o;if(U.dao.getFollowingAgentUser())return;he.config.recordBrowser(e);const r=`https://${U.dao.playgroundInfo().url}`,i=document.getElementById("dao-browserIframe");if(i){const s=e?"record":"stopRecord";(o=i.contentWindow)==null||o.postMessage(JSON.stringify({type:s,time:Date.now()}),r)}}followBrowser(e){var r;if(he.config.live(e),e){U.dao.channel().liveBrowser();const i=document.querySelector(".d42-browser-body");i&&((r=this.replayer)==null||r.destroy(),this.replayer=new ICe([],{liveMode:!0,UNSAFE_replayCanvas:!0,root:i,unpackFn:vCe}),this.replayer.startLive(Date.now()-500),he.config.replayer(this.replayer))}else this.replayer&&(this.replayer.destroy(),this.replayer=null);U.dao.getFollowedAgentUser()&&this.startRecordBrowser(!0)}handleRes(e,n=""){return{status:e,message:n}}handleSuccessRes(e){return{status:!0,message:e}}handleErrorRes(e){return{status:!1,message:e}}openFile(e,n="default"){return e===U.file.getOpenedPath()&&n!=="refresh"?Promise.resolve(this.handleSuccessRes(Pn("common_success"))):new Promise((r,i)=>{if(!U.dao.isReady())return i(this.handleErrorRes(Pn("dao_paas_no_ready")));if(U.dao.playgroundInfo().status==="END")return i(this.handleErrorRes(Pn("dao_paas_docker_has_been_destoryed")));ZL(e)?(U.dao.channel().loadFile(e,n),Td(e),r(this.handleSuccessRes(Pn("common_success")))):i(this.handleErrorRes(Pn("dao_paas_file_does_not_exist")))})}loadFile(e,n="default"){var s,a,l,c;if((e===U.file.getOpenedPath()||e===U.file.loadingPath())&&n!=="refresh")return;const r=U.dao.isPlayBack();let i="";if(r){if(!this.playbackEngine){he.file.setSelectedFilePath("");return}const u=this.playbackEngine.getCurrentFrame(),d=u==null?void 0:u.dockerId,f=U.file.getFileBaseHistoryByPath(d,e,!0);if(f&&f.content!==void 0){he.file.loadingPath(e),he.file.setSelectedFilePath(e);const h=this.playbackEngine.getCurrentDocByPathAndDocker(d,e);h&&this.dispatchDataEvent(h.eventName,h);return}else i=this.playbackEngine.getFileRootPathByDockerId(d,e)}if(r&&!i){he.file.setSelectedFilePath(""),qr.error(Pn("\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6.").toString());return}he.file.loadingPath(e),he.file.setDocLoading(!0),he.file.setSelectedFilePath(e),(s=this.socket)==null||s.off("pullOTUpdates"),(a=this.socket)==null||a.off("syncOTUpdates"),(l=this.socket)==null||l.off("pushOTUpdates"),(c=this.socket)==null||c.off(ot.SelectedUpdated);const o=Date.now();he.file.latestRequestFilePath(e),TJ(e),he.file.mapSelection({}),this.send(Dn.File,{path:e,timestamp:o,fileRootId:U.file.fileRootId(),loadType:n,fileRootPath:i,readOnly:r})}searchKeyword(e){this.send(Dn.FileSearchKeyword,e)}updateAreaFlags(e){const{path:n,ids:r}=e;U.file.getOpenedPath()!==n?(this.loadFile(n),he.dao.waitingAreaInfo({type:"updateFlag",ids:r,path:n})):U.dao.isAnswerSubscribed()?(he.dao.waitingAreaInfo({}),this.transitionUpdateAreaFlags(r)):he.dao.waitingAreaInfo({type:"updateFlag",ids:r,path:n})}transitionUpdateAreaFlags(e){this.trigger(nt.UpdateAreaFlags,{name:nt.UpdateAreaFlags,payload:{ids:e}})}removeAreaTextById(e,n,r){U.file.getOpenedPath()!==r?(this.loadFile(r),he.dao.waitingAreaInfo({type:"remove",id:e,path:r,text:n})):(he.dao.waitingAreaInfo({}),this.transitionRemoveAreaTextById(e,n))}transitionRemoveAreaTextById(e,n){this.trigger(nt.ReplaceCodeById,{name:nt.ReplaceCodeById,payload:{id:e,text:n}})}jumpToAreaById(e,n){U.file.getOpenedPath()!==n?(Td(n),this.loadFile(n),he.file.fileIntoView(!0),he.dao.waitingAreaInfo({type:"jump",id:e,path:n})):(he.dao.waitingAreaInfo({}),this.transitionJumpToAreaById(e))}transitionJumpToAreaById(e){this.trigger(nt.JumpToAreaById,{name:nt.JumpToAreaById,payload:{id:e}})}insertTextById(e,n,r){this.trigger(nt.InsertTextById,{name:nt.InsertTextById,payload:{id:e,text:n,lineNum:r}})}insertCodeByCursor(e){he.file.openFileParams({isCurrentOpenFile:!0,insertCodeOptions:e,actions:"insertCode"}),ct.log(`insertCodeByCursor: ${JSON.stringify(e)}`)}closeFile(e){const n=Date.now();this.send(Dn.CloseFile,{path:e,timestamp:n})}editorScroll(e){this.send(Dn.EditorScroll,e)}switchLanguage(e,n,r,i){this.send(Dn.SwitchLanguage,{languageType:e,languageValue:n,fileName:r,createNewFile:i})}restartServer(){he.file.closeLspServer(),this.send(Dn.RestartServer)}stopLSPServer(e,n=!0){he.file.closeLspServer(),he.config.stopLsp(e),e||this.send(Dn.RestartLSPServer),n&&this.send(Dn.StopLSPServer,{isStop:e,isTriggerEvent:n})}restartLSPServer(){he.file.closeLspServer(),this.send(Dn.RestartLSPServer)}addCDNSource(e,n,r){this.send(Dn.AddCDNSource,{cdnUrlType:e,cdnUrlPath:n,fileName:r})}editFile(e){this.send(Dn.EditFile,e)}operateFileTree(e){this.send(Dn.FileTree,{...e,fileRootId:U.file.fileRootId()})}terminal(e){this.send(Dn.Terminal,e)}claudecode(e){this.send(Dn.ClaudeCode,e)}xtermStatus(e){this.send(Dn.XtermStatus,e)}cursor(e){this.send("cursor",e)}heartbeat(){this.send("heartbeat")}getPlaybackInfo(){this.send(Dn.GetPlaybackInfo)}followingAgentUser(e){this.send("followingAgentUser",e)}featureConfig(e){this.send("setFeaturesConfig",e)}setFileLockStatus(e){this.send("setFileLockStatus",e)}setFileVisible(e){this.send("setFileVisible",e)}addFileToUnitTest(e){this.send("addFileToUnitTest",e)}removeFileFromUnitTest(e){this.send("removeFileFromUnitTest",e)}refreshXtermColsRows(e){this.send("refreshXtermColsRows",e)}followingFocusComponent(e){const n=U.dao.currentAgentUser();!n||n.focusComponent!==e&&(n.followingAgentUserId||this.send("followingFocusComponent",e),this.trigger("followingFocusComponentUpdate",{name:"followingFocusComponentUpdate",payload:{type:e}}))}followingEditorScroll(e){const n=U.dao.currentAgentUser();n!=null&&n.followingAgentUserId||this.send("followingEditorScroll",e)}unFollowingAgentUser(){this.send("unFollowingAgentUser")}getMemorySnap(){this.send("getMemorySnap")}publishKeyEvent(e){this.send(Dn.KeyEvent,e)}restartPlayback(e){var n;Object.entries(this.componentSubscribersMap).forEach(([r,i])=>i.forEach(o=>o.onStart&&o.onStart())),this.playbackEngine.setRate(e),this.playbackEngine.restart(),(n=this.webPlayer)==null||n.goto(0,!0),he.dao.playbackStatus("restartPlayback")}setPlaybackRateAfterHooks(e){var n;(n=this.webPlayer)==null||n.setSpeed(e)}startPlayback(e=1){var r,i,o;he.dao.playbackStatus("startPlayback");const n=this.playbackEngine.resumeTime;if(n?(r=this.webPlayer)==null||r.goto(n,!0):(i=this.webPlayer)==null||i.play(),(o=this.playbackEngine)!=null&&o.dataBuffer.length){this.playbackEngine.resume();return}this.playbackEngine.setRate(e),this.playControlSubscribers.forEach(s=>s.onLoad()),Object.entries(this.componentSubscribersMap).forEach(([s,a])=>a.forEach(l=>l.onStart&&l.onStart()))}pausePlayback(e=!1){var n;this.playbackEngine.pause(),(n=this.webPlayer)==null||n.pause(),e&&this.trigger("message",{name:nt.PausePlayback,payload:{}}),he.dao.playbackStatus("pausePlayback")}stopPlayback(){var e,n,r,i;if(this.playbackEngine){this.playbackEngine.playing=!1,(e=this.webPlayer)==null||e.pause(),(n=this.dispatchProgressEvent)==null||n.call(this,"progress",0);const o=(r=this.playbackEngine)==null?void 0:r.dataBuffer.find(s=>s.eventName==="fileTree"&&s.data.action==="REFRESH");o&&this.componentSubscribersMap[o.eventName].forEach(s=>{s.onData(Mi(o))}),(i=this.playbackEngine)==null||i.buffer([]),this.playbackEngine=void 0}he.file.resetFile(),he.file.resetBreakPoints(),he.file.resetDebugInfo(),he.dao.resetTerminal(),he.dao.resetConsole(),U.dao.channel().xtermStatus({resetConsole:!0}),this.playControlSubscribers.forEach(o=>o==null?void 0:o.onStopPlayback()),he.dao.playbackStatus("stopPlayback")}createFile(e,n){const r=U.file.fileTree(),i=gg(r),o=Array.isArray(e)?e:[e],s=o.find(c=>i[c]);if(s)return Promise.reject(Pn("file_tree_x_existed",{x:s}));const a=o.map(c=>({type:n?"DIRECTORY":"FILE",name:c})),l={action:"CREATE",triggerBy:"API",files:a};return U.dao.channel().operateFileTree(l),new Promise((c,u)=>{var f,h;const d=m=>{m.data.triggerBy==="API"&&c(!0)};(f=this==null?void 0:this.socket)==null||f.off(ot.FileTree,d),(h=this.socket)==null||h.on(ot.FileTree,d)})}expandByPath(e,n){const r=U.file.onExpand(),i=e.split("/");let o=i[0];if(n.type==="DIRECTORY")for(let s=0;s<i.length;s++)r(o),o=o+"/"+i[s+1]}setPlaybackRate(e){this.playbackEngine.setRate(e)}send(e,n={}){if(!this.socket)throw new Error(Pn("dao_channel_socket_is_not_ready"));if(e!=="auth"&&!U.dao.channelAvailable()){ct.warn(`socket is unavailable, ignore send event: ${e}`);return}ct.debug(`>> ${e}`);const r=U.dao.isPlayBack(),i=["auth","heartbeat","getPlaybackInfo","loadPlaybackData","statisticsPlaybackData","i18nLanguage","pushFormatCode","file"];if(!r){this.socket.emit(e,n,{currentDockerId:U.dao.playgroundInfo().dockerId});return}if(i.includes(e)){if(e!==Dn.File){this.socket.emit(e,n);return}n.readOnly&&this.socket.emit(e,n)}}addEventListeners(e,n){const r=this.eventListeners.get(e)||[];r.push(n),this.eventListeners.set(e,r)}removeEventListeners(e,n){const r=this.eventListeners.get(e)||[];if(!n){this.eventListeners.delete(e);return}const i=r.findIndex(o=>o===n);r.splice(i,1),this.eventListeners.set(e,r)}triggerEventListeners(e,n){(this.eventListeners.get(e)||[]).forEach(i=>{i==null||i(n)})}on(e,n){if(!this.socket)throw new Error(Pn("dao_channel_socket_is_not_ready_for_x",{x:e}));this.socket.on(e,n),U.dao.isPlayBack()&&this.addEventListeners(e,n)}off(e){var n;typeof e=="string"?((n=this.socket)==null||n.off(e),U.dao.isPlayBack()&&this.removeEventListeners(e)):e.forEach(r=>{var i;(i=this.socket)==null||i.off(r),this.removeEventListeners(r)})}isReady(){var e;return(e=this.socket)==null?void 0:e.connected}transitionLspStatus(e){const n=U.dao.isPlayBack();this.trigger("message",{name:nt.LspStatusChanged,payload:{status:n?_O.NotSupport:e}})}emitI18nLanguage(e){this.send(ot.I18nLanguage,{language:e})}switchVirtualUser(e){return new Promise((n,r)=>{const i=U.dao.currentAgentUser();if(i){const{agentUserId:o}=i,s=o.startsWith(Mc);if(e&&s||!e&&!s){n({result:!0,message:"Switch user successfully."});return}let a="";e?a=Mc+o:a=o.replace(Mc,""),this.off(ot.SwitchVirtualUser),this.on(ot.SwitchVirtualUser,l=>{if(l.result){const{data:{currentAgentUser:c}}=l;he.dao.switchCurrentReallyAgentUserId(c.agentUserId),he.dao.isVirtualUser(e),n(l)}else r(l)}),this.send(ot.SwitchVirtualUser,{agentUserId:a,virtualIdPreValue:Mc})}else r({result:!1,message:"Switch user fail, current user is cannot found."})})}offlineVirtualUser(){this.send(ot.offlineVirtualUser,{})}registerVirtualUser(e){return new Promise((n,r)=>{const i=U.dao.currentAgentUser();if(i){const o=e.avatar||Gee(e.name),a={userInfo:{username:e.name,avatarUrl:o},agentUserId:Mc+i.agentUserId,userId:Mc+i.userId};this.off(ot.RegisterVirtualUser),this.on(ot.RegisterVirtualUser,l=>{l.result?n(l):r(l)}),this.send(ot.RegisterVirtualUser,a)}else r({result:!1,message:"Register vitual user fail, current user is cannot found."})})}emitFormatCode(e){this.send(ot.PushFormatCode,e)}customExecute(e){this.send(ot.CustomExecute,e)}emitBreakPoint(e){this.send(ot.SetBreakPoint,e)}emitVariables(e){this.send(ot.Variables,e)}debugRun(){he.dao.resetConsole(),U.dao.channel().xtermStatus({resetConsole:!0}),this.send(ot.DebugRun)}debugNext(){const e=U.file.getDebugBody();this.send(ot.DebugNext,{threadId:e.threadId})}debugContinued(){const e=U.file.getDebugBody();this.send(ot.DebugContinue,{threadId:e.threadId})}debuStepIn(){const e=U.file.getDebugBody();this.send(ot.DebugStepIn,{threadId:e.threadId})}debuStepOut(){const e=U.file.getDebugBody();this.send(ot.DebugStepOut,{threadId:e.threadId})}uploadLog(e,n){U.dao.isPlayBack()||YCe.includes(n)}transitionFileInfo(e){this.trigger("message",{name:nt.FileInfo,payload:{...e}})}transitionXtermInfo(e){this.trigger("message",{name:nt.XtermInfo,payload:{...e}})}transitionDebug(e){this.trigger("message",{name:nt.Debug,payload:{...e}})}transitionIAnswerAreaInfo(e){this.trigger("message",{name:nt.AnswerAreaInfo,payload:{...e}})}fileWatchRefreshConfig(e){this.send(ot.FileWatchRefreshConfig,e)}manualRefresh(){this.send(ot.ManualRefresh)}editorBlur(e){this.send(ot.EditorBlur,e)}forceRefreshFile(e){e=e||U.file.getOpenedPath(),e===U.file.getOpenedPath()&&he.file.setDocLoading(!0),this.send(ot.ForceRefreshFile,{path:e,currentOpenedPath:U.file.getOpenedPath()})}closeChannel(){var e,n,r,i,o;ct.debug("close Channel..."),this.clearHeartbeatInterval(),this.messageListeners.splice(0,this.messageListeners.length),this.errorListeners.splice(0,this.errorListeners.length),this.componentSubscribersMap=Mi(aq),(e=this.socket)==null||e.removeAllListeners(),(r=(n=this.socket)==null?void 0:n.io)==null||r.reconnection(!1),(o=(i=this.socket)==null?void 0:i.close)==null||o.call(i),this.socket=void 0,he.file.closeLspServer()}}var Oc=(t=>(t.edit="edit",t.debug="debug",t.playback="playback",t))(Oc||{});const so=".d42-editor-container",VCe=`
|
|
157
159
|
${so} .cm-editor {
|
|
158
160
|
position: relative !important;
|
|
159
161
|
box-sizing: border-box;
|