@dao42/d42paas-front 0.9.13 → 0.9.14

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.
@@ -11421,7 +11421,7 @@ const Loading$1 = () => {
11421
11421
  });
11422
11422
  };
11423
11423
  const name$2 = "@dao42/d42paas-front";
11424
- const version = "0.9.13";
11424
+ const version = "0.9.14";
11425
11425
  const description = "d42paas front";
11426
11426
  const author = "dao42 paas team";
11427
11427
  const homepage = "https://github.com/dao42/d42paas_frontend#readme";
@@ -228,7 +228,7 @@ Add a <Suspense fallback=...> component higher in the tree to provide a loading
228
228
  color: #a0a0a0;
229
229
  width: 200px;
230
230
  }
231
- `,IX=()=>ne(DX,{children:ot("div",{className:"preloader",children:[ne("svg",{className:"first-svg",version:"1.1",id:"sun",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"10px",height:"10px",viewBox:"0 0 10 10",enableBackground:"new 0 0 10 10",xmlSpace:"preserve",children:ot("g",{children:[ne("path",{fill:"none",d:"M6.942,3.876c-0.4-0.692-1.146-1.123-1.946-1.123c-0.392,0-0.779,0.104-1.121,0.301c-1.072,0.619-1.44,1.994-0.821,3.067C3.454,6.815,4.2,7.245,5,7.245c0.392,0,0.779-0.104,1.121-0.301C6.64,6.644,7.013,6.159,7.167,5.581C7.321,5,7.243,4.396,6.942,3.876z M6.88,5.505C6.745,6.007,6.423,6.427,5.973,6.688C5.676,6.858,5.34,6.948,5,6.948c-0.695,0-1.343-0.373-1.69-0.975C2.774,5.043,3.093,3.849,4.024,3.312C4.32,3.14,4.656,3.05,4.996,3.05c0.695,0,1.342,0.374,1.69,0.975C6.946,4.476,7.015,5,6.88,5.505z"}),ne("path",{fill:"none",d:"M8.759,2.828C8.718,2.757,8.626,2.732,8.556,2.774L7.345,3.473c-0.07,0.041-0.094,0.132-0.053,0.202C7.319,3.723,7.368,3.75,7.419,3.75c0.025,0,0.053-0.007,0.074-0.02l1.211-0.699C8.774,2.989,8.8,2.899,8.759,2.828z"}),ne("path",{fill:"none",d:"M1.238,7.171c0.027,0.047,0.077,0.074,0.128,0.074c0.025,0,0.051-0.008,0.074-0.02l1.211-0.699c0.071-0.041,0.095-0.133,0.054-0.203S2.574,6.228,2.503,6.269l-1.21,0.699C1.221,7.009,1.197,7.101,1.238,7.171z"}),ne("path",{fill:"none",d:"M6.396,2.726c0.052,0,0.102-0.026,0.13-0.075l0.349-0.605C6.915,1.976,6.89,1.885,6.819,1.844c-0.07-0.042-0.162-0.017-0.202,0.054L6.269,2.503C6.228,2.574,6.251,2.666,6.322,2.706C6.346,2.719,6.371,2.726,6.396,2.726z"}),ne("path",{fill:"none",d:"M3.472,7.347L3.123,7.952c-0.041,0.07-0.017,0.162,0.054,0.203C3.2,8.169,3.226,8.175,3.25,8.175c0.052,0,0.102-0.027,0.129-0.074l0.349-0.605c0.041-0.07,0.017-0.16-0.054-0.203C3.603,7.251,3.513,7.276,3.472,7.347z"}),ne("path",{fill:"none",d:"M3.601,2.726c0.025,0,0.051-0.007,0.074-0.02C3.746,2.666,3.77,2.574,3.729,2.503l-0.35-0.604C3.338,1.828,3.248,1.804,3.177,1.844C3.106,1.886,3.082,1.976,3.123,2.047l0.35,0.604C3.5,2.7,3.549,2.726,3.601,2.726z"}),ne("path",{fill:"none",d:"M6.321,7.292c-0.07,0.043-0.094,0.133-0.054,0.203l0.351,0.605c0.026,0.047,0.076,0.074,0.127,0.074c0.025,0,0.051-0.006,0.074-0.02c0.072-0.041,0.096-0.133,0.055-0.203l-0.35-0.605C6.483,7.276,6.393,7.253,6.321,7.292z"}),ne("path",{fill:"none",d:"M2.202,5.146c0.082,0,0.149-0.065,0.149-0.147S2.284,4.851,2.202,4.851H1.503c-0.082,0-0.148,0.066-0.148,0.148s0.066,0.147,0.148,0.147H2.202z"}),ne("path",{fill:"none",d:"M8.493,4.851H7.794c-0.082,0-0.148,0.066-0.148,0.148s0.066,0.147,0.148,0.147l0,0h0.699c0.082,0,0.148-0.065,0.148-0.147S8.575,4.851,8.493,4.851L8.493,4.851z"}),ne("path",{fill:"none",d:"M5.146,2.203V0.805c0-0.082-0.066-0.148-0.148-0.148c-0.082,0-0.148,0.066-0.148,0.148v1.398c0,0.082,0.066,0.149,0.148,0.149C5.08,2.352,5.146,2.285,5.146,2.203z"}),ne("path",{fill:"none",d:"M4.85,7.796v1.396c0,0.082,0.066,0.15,0.148,0.15c0.082,0,0.148-0.068,0.148-0.15V7.796c0-0.082-0.066-0.148-0.148-0.148C4.917,7.647,4.85,7.714,4.85,7.796z"}),ne("path",{fill:"none",d:"M2.651,3.473L1.44,2.774C1.369,2.732,1.279,2.757,1.238,2.828C1.197,2.899,1.221,2.989,1.292,3.031l1.21,0.699c0.023,0.013,0.049,0.02,0.074,0.02c0.051,0,0.101-0.026,0.129-0.075C2.747,3.604,2.722,3.514,2.651,3.473z"}),ne("path",{fill:"none",d:"M8.704,6.968L7.493,6.269c-0.07-0.041-0.162-0.016-0.201,0.055c-0.041,0.07-0.018,0.162,0.053,0.203l1.211,0.699c0.023,0.012,0.049,0.02,0.074,0.02c0.051,0,0.102-0.027,0.129-0.074C8.8,7.101,8.776,7.009,8.704,6.968z"})]})}),ne("svg",{version:"1.1",id:"cloud",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"10px",height:"10px",viewBox:"0 0 10 10",enableBackground:"new 0 0 10 10",xmlSpace:"preserve",children:ne("path",{fill:"none",d:"M8.528,5.624H8.247c-0.085,0-0.156-0.068-0.156-0.154c0-0.694-0.563-1.257-1.257-1.257c-0.098,0-0.197,0.013-0.3,0.038C6.493,4.259,6.45,4.252,6.415,4.229C6.38,4.208,6.356,4.172,6.348,4.131C6.117,3.032,5.135,2.235,4.01,2.235c-1.252,0-2.297,0.979-2.379,2.23c-0.004,0.056-0.039,0.108-0.093,0.13C1.076,4.793,0.776,5.249,0.776,5.752c0,0.693,0.564,1.257,1.257,1.257h6.495c0.383,0,0.695-0.31,0.695-0.692S8.911,5.624,8.528,5.624z"})}),ot("div",{className:"rain",children:[ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"})]}),ne("div",{className:"text",children:"Loading......"})]})});var WX={name:"@dao42/d42paas-front",version:"0.9.13",description:"d42paas front",author:"dao42 paas team",homepage:"https://github.com/dao42/d42paas_frontend#readme",license:"UNLICENSED",main:"./dist/DaoPaaS.umd.js",module:"./dist/DaoPaaS.es.js",types:"./dist/DaoPaaS.d.ts",scripts:{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",test:"jest --coverage"},devDependencies:{"@codemirror/collab":"^0.20.0","@codemirror/lang-javascript":"^0.20.0","@codemirror/state":"^0.20.0","@codemirror/view":"^0.20.7","utf-8-validate":"^5.0.9",uuid:"^8.3.2",xterm:"^4.13.0","xterm-addon-attach":"^0.6.0","xterm-addon-fit":"^0.5.0",zustand:"^4.0.0-rc.1","@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.4.1","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@rsuite/icons":"^1.0.2","@testing-library/jest-dom":"^5.16.2","@testing-library/react":"^12.1.4","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/react":"^17.0.24","@types/react-dom":"^17.0.9","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@uiw/react-codemirror":"^4.7.0","@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",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",immer:"^9.0.14","glob-all":"^3.2.1",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15",prettier:"^2.3.2",react:"^17.0.2","react-complex-tree":"^1.1.6","react-dom":"^17.0.2","react-icons":"^4.3.1","react-markdown":"^8.0.0","reconnecting-websocket":"^4.4.0","rehype-katex":"^6.0.2","remark-math":"^5.1.1",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.6.0",rsuite:"5.6.4",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","use-immer":"^0.7.0",vite:"^2.7.2","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2"},files:["dist"],repository:{type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},bugs:{url:"https://github.com/dao42/d42paas_frontend/issues"},msw:{workerDirectory:"src"}};const BX=()=>WX.version,zX=async(t,e,r)=>{const o=await(await fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:r})})).json();if(o.status==="failure")throw console.error(o),new Error(o.errors[0].erromsg);return o.data},QX=t=>{const e=Ee.dao.playgroundInfo().fileTree;let r=null;const i=o=>{if(o.path===t){r=o;return}else for(let a=0;a<o.children.length;a++)i(o.children[a])};return i(e),r},NX=t=>{if(!t)throw new Error("username can't be blank");return`https://ui-avatars.com/api/?background=e9f3f0&rounded=true&uppercase=true&bold=true&length=1&name=${t}`},uo=Object.create(null);uo.open="0",uo.close="1",uo.ping="2",uo.pong="3",uo.message="4",uo.upgrade="5",uo.noop="6";const E0=Object.create(null);Object.keys(uo).forEach(t=>{E0[uo[t]]=t});const FX={type:"error",data:"parser error"},qX=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",HX=typeof ArrayBuffer=="function",UX=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Y6=({type:t,data:e},r,i)=>qX&&e instanceof Blob?r?i(e):Z6(e,i):HX&&(e instanceof ArrayBuffer||UX(e))?r?i(e):Z6(new Blob([e]),i):i(uo[t]+(e||"")),Z6=(t,e)=>{const r=new FileReader;return r.onload=function(){const i=r.result.split(",")[1];e("b"+i)},r.readAsDataURL(t)},K6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mh=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let t=0;t<K6.length;t++)mh[K6.charCodeAt(t)]=t;const VX=t=>{let e=t.length*.75,r=t.length,i,o=0,a,u,c,f;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const n=new ArrayBuffer(e),l=new Uint8Array(n);for(i=0;i<r;i+=4)a=mh[t.charCodeAt(i)],u=mh[t.charCodeAt(i+1)],c=mh[t.charCodeAt(i+2)],f=mh[t.charCodeAt(i+3)],l[o++]=a<<2|u>>4,l[o++]=(u&15)<<4|c>>2,l[o++]=(c&3)<<6|f&63;return n},GX=typeof ArrayBuffer=="function",J6=(t,e)=>{if(typeof t!="string")return{type:"message",data:j6(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:XX(t.substring(1),e)}:E0[r]?t.length>1?{type:E0[r],data:t.substring(1)}:{type:E0[r]}:FX},XX=(t,e)=>{if(GX){const r=VX(t);return j6(r,e)}else return{base64:!0,data:t}},j6=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}},e4=String.fromCharCode(30),YX=(t,e)=>{const r=t.length,i=new Array(r);let o=0;t.forEach((a,u)=>{Y6(a,!1,c=>{i[u]=c,++o===r&&e(i.join(e4))})})},ZX=(t,e)=>{const r=t.split(e4),i=[];for(let o=0;o<r.length;o++){const a=J6(r[o],e);if(i.push(a),a.type==="error")break}return i},t4=4;function _r(t){if(t)return KX(t)}function KX(t){for(var e in _r.prototype)t[e]=_r.prototype[e];return t}_r.prototype.on=_r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},_r.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},_r.prototype.off=_r.prototype.removeListener=_r.prototype.removeAllListeners=_r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,o=0;o<r.length;o++)if(i=r[o],i===e||i.fn===e){r.splice(o,1);break}return r.length===0&&delete this._callbacks["$"+t],this},_r.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(r){r=r.slice(0);for(var i=0,o=r.length;i<o;++i)r[i].apply(this,e)}return this},_r.prototype.emitReserved=_r.prototype.emit,_r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},_r.prototype.hasListeners=function(t){return!!this.listeners(t).length};const is=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")())();function r4(t,...e){return e.reduce((r,i)=>(t.hasOwnProperty(i)&&(r[i]=t[i]),r),{})}const JX=setTimeout,jX=clearTimeout;function T0(t,e){e.useNativeTimers?(t.setTimeoutFn=JX.bind(is),t.clearTimeoutFn=jX.bind(is)):(t.setTimeoutFn=setTimeout.bind(is),t.clearTimeoutFn=clearTimeout.bind(is))}const eY=1.33;function tY(t){return typeof t=="string"?rY(t):Math.ceil((t.byteLength||t.size)*eY)}function rY(t){let e=0,r=0;for(let i=0,o=t.length;i<o;i++)e=t.charCodeAt(i),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(i++,r+=4);return r}class nY extends Error{constructor(e,r,i){super(e),this.description=r,this.context=i,this.type="TransportError"}}class n4 extends _r{constructor(e){super(),this.writable=!1,T0(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,r,i){return super.emitReserved("error",new nY(e,r,i)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(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 r=J6(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const i4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),U_=64,iY={};let o4=0,M0=0,a4;function s4(t){let e="";do e=i4[t%U_]+e,t=Math.floor(t/U_);while(t>0);return e}function l4(){const t=s4(+new Date);return t!==a4?(o4=0,a4=t):t+"."+s4(o4++)}for(;M0<U_;M0++)iY[i4[M0]]=M0;function u4(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function oY(t){let e={},r=t.split("&");for(let i=0,o=r.length;i<o;i++){let a=r[i].split("=");e[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e}let c4=!1;try{c4=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch{}const aY=c4;function f4(t){const e=t.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!e||aY))return new XMLHttpRequest}catch{}if(!e)try{return new is[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function sY(){}const lY=function(){return new f4({xdomain:!1}).responseType!=null}();class uY extends n4{constructor(e){if(super(e),this.polling=!1,typeof location!="undefined"){const i=location.protocol==="https:";let o=location.port;o||(o=i?"443":"80"),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||o!==e.port,this.xs=e.secure!==i}const r=e&&e.forceBase64;this.supportsBinary=lY&&!r}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const r=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||r()})),this.writable||(i++,this.once("drain",function(){--i||r()}))}else r()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};ZX(e,this.socket.binaryType).forEach(r),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,YX(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const r=this.opts.secure?"https":"http";let i="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=l4()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(r==="https"&&Number(this.opts.port)!==443||r==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);const o=u4(e),a=this.opts.hostname.indexOf(":")!==-1;return r+"://"+(a?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new co(this.uri(),e)}doWrite(e,r){const i=this.request({method:"POST",data:e});i.on("success",r),i.on("error",(o,a)=>{this.onError("xhr post error",o,a)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,i)=>{this.onError("xhr poll error",r,i)}),this.pollXhr=e}}class co extends _r{constructor(e,r){super(),T0(this,r),this.opts=r,this.method=r.method||"GET",this.uri=e,this.async=r.async!==!1,this.data=r.data!==void 0?r.data:null,this.create()}create(){const e=r4(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const r=this.xhr=new f4(e);try{r.open(this.method,this.uri,this.async);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{}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{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=co.requestsCount++,co.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=sY,e)try{this.xhr.abort()}catch{}typeof document!="undefined"&&delete co.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()}}if(co.requestsCount=0,co.requests={},typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",h4);else if(typeof addEventListener=="function"){const t="onpagehide"in is?"pagehide":"unload";addEventListener(t,h4,!1)}}function h4(){for(let t in co.requests)co.requests.hasOwnProperty(t)&&co.requests[t].abort()}const cY=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0))(),k0=is.WebSocket||is.MozWebSocket,d4=!0,fY="arraybuffer",p4=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class hY extends n4{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),r=this.opts.protocols,i=p4?{}:r4(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=d4&&!p4?r?new k0(e,r):new k0(e):new k0(e,r,i)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType||fY,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 r=0;r<e.length;r++){const i=e[r],o=r===e.length-1;Y6(i,this.supportsBinary,a=>{const u={};try{d4&&this.ws.send(a)}catch{}o&&cY(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const r=this.opts.secure?"wss":"ws";let i="";this.opts.port&&(r==="wss"&&Number(this.opts.port)!==443||r==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=l4()),this.supportsBinary||(e.b64=1);const o=u4(e),a=this.opts.hostname.indexOf(":")!==-1;return r+"://"+(a?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}check(){return!!k0}}const dY={websocket:hY,polling:uY},pY=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mY=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function V_(t){const e=t,r=t.indexOf("["),i=t.indexOf("]");r!=-1&&i!=-1&&(t=t.substring(0,r)+t.substring(r,i).replace(/:/g,";")+t.substring(i,t.length));let o=pY.exec(t||""),a={},u=14;for(;u--;)a[mY[u]]=o[u]||"";return r!=-1&&i!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=gY(a,a.path),a.queryKey=vY(a,a.query),a}function gY(t,e){const r=/\/{2,9}/g,i=e.replace(r,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&i.splice(0,1),e.substr(e.length-1,1)=="/"&&i.splice(i.length-1,1),i}function vY(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,o,a){o&&(r[o]=a)}),r}class os extends _r{constructor(e,r={}){super(),e&&typeof e=="object"&&(r=e,e=null),e?(e=V_(e),r.hostname=e.host,r.secure=e.protocol==="https"||e.protocol==="wss",r.port=e.port,e.query&&(r.query=e.query)):r.host&&(r.hostname=V_(r.host).host),T0(this,r),this.secure=r.secure!=null?r.secure:typeof location!="undefined"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=r.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=r.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},r),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=oY(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=t4,r.transport=e,this.id&&(r.sid=this.id);const i=Object.assign({},this.opts.transportOptions[e],this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new dY[e](i)}open(){let e;if(this.opts.rememberUpgrade&&os.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}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",r=>this.onClose("transport close",r))}probe(e){let r=this.createTransport(e),i=!1;os.priorWebsocketSuccess=!1;const o=()=>{i||(r.send([{type:"ping",data:"probe"}]),r.once("packet",s=>{if(!i)if(s.type==="pong"&&s.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;os.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(l(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=r.name,this.emitReserved("upgradeError",d)}}))};function a(){i||(i=!0,l(),r.close(),r=null)}const u=s=>{const d=new Error("probe error: "+s);d.transport=r.name,a(),this.emitReserved("upgradeError",d)};function c(){u("transport closed")}function f(){u("socket closed")}function n(s){r&&s.name!==r.name&&a()}const l=()=>{r.removeListener("open",o),r.removeListener("error",u),r.removeListener("close",c),this.off("close",f),this.off("upgrading",n)};r.once("open",o),r.once("error",u),r.once("close",c),this.once("close",f),this.once("upgrading",n),r.open()}onOpen(){if(this.readyState="open",os.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0;const r=this.upgrades.length;for(;e<r;e++)this.probe(this.upgrades[e])}}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.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const r=new Error("server error");r.code=e.data,this.onError(r);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.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),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 r=1;for(let i=0;i<this.writeBuffer.length;i++){const o=this.writeBuffer[i].data;if(o&&(r+=tY(o)),i>0&&r>this.maxPayload)return this.writeBuffer.slice(0,i);r+=2}return this.writeBuffer}write(e,r,i){return this.sendPacket("message",e,r,i),this}send(e,r,i){return this.sendPacket("message",e,r,i),this}sendPacket(e,r,i,o){if(typeof r=="function"&&(o=r,r=void 0),typeof i=="function"&&(o=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const a={type:e,data:r,options:i};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),o&&this.once("flush",o),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},i=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}onError(e){os.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,r){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const r=[];let i=0;const o=e.length;for(;i<o;i++)~this.transports.indexOf(e[i])&&r.push(e[i]);return r}}os.protocol=t4;function yY(t,e="",r){let i=t;r=r||typeof location!="undefined"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(typeof r!="undefined"?t=r.protocol+"//"+t:t="https://"+t),i=V_(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";const a=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+a+":"+i.port+e,i.href=i.protocol+"://"+a+(r&&r.port===i.port?"":":"+i.port),i}const _Y=typeof ArrayBuffer=="function",OY=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,m4=Object.prototype.toString,wY=typeof Blob=="function"||typeof Blob!="undefined"&&m4.call(Blob)==="[object BlobConstructor]",bY=typeof File=="function"||typeof File!="undefined"&&m4.call(File)==="[object FileConstructor]";function G_(t){return _Y&&(t instanceof ArrayBuffer||OY(t))||wY&&t instanceof Blob||bY&&t instanceof File}function L0(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,i=t.length;r<i;r++)if(L0(t[r]))return!0;return!1}if(G_(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return L0(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&L0(t[r]))return!0;return!1}function SY(t){const e=[],r=t.data,i=t;return i.data=X_(r,e),i.attachments=e.length,{packet:i,buffers:e}}function X_(t,e){if(!t)return t;if(G_(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let i=0;i<t.length;i++)r[i]=X_(t[i],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){const r={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=X_(t[i],e));return r}return t}function xY(t,e){return t.data=Y_(t.data,e),t.attachments=void 0,t}function Y_(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=Y_(t[r],e);else if(typeof t=="object")for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Y_(t[r],e));return t}const CY=5;var ft;(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"})(ft||(ft={}));class PY{constructor(e){this.replacer=e}encode(e){return(e.type===ft.EVENT||e.type===ft.ACK)&&L0(e)?(e.type=e.type===ft.EVENT?ft.BINARY_EVENT:ft.BINARY_ACK,this.encodeAsBinary(e)):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===ft.BINARY_EVENT||e.type===ft.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),r}encodeAsBinary(e){const r=SY(e),i=this.encodeAsString(r.packet),o=r.buffers;return o.unshift(i),o}}class Z_ extends _r{constructor(e){super(),this.reviver=e}add(e){let r;if(typeof e=="string")r=this.decodeString(e),r.type===ft.BINARY_EVENT||r.type===ft.BINARY_ACK?(this.reconstructor=new $Y(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r);else if(G_(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0;const i={type:Number(e.charAt(0))};if(ft[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===ft.BINARY_EVENT||i.type===ft.BINARY_ACK){const a=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);const u=e.substring(a,r);if(u!=Number(u)||e.charAt(r)!=="-")throw new Error("Illegal attachments");i.attachments=Number(u)}if(e.charAt(r+1)==="/"){const a=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););i.nsp=e.substring(a,r)}else i.nsp="/";const o=e.charAt(r+1);if(o!==""&&Number(o)==o){const a=r+1;for(;++r;){const u=e.charAt(r);if(u==null||Number(u)!=u){--r;break}if(r===e.length)break}i.id=Number(e.substring(a,r+1))}if(e.charAt(++r)){const a=this.tryParse(e.substr(r));if(Z_.isPayloadValid(i.type,a))i.data=a;else throw new Error("invalid payload")}return i}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case ft.CONNECT:return typeof r=="object";case ft.DISCONNECT:return r===void 0;case ft.CONNECT_ERROR:return typeof r=="string"||typeof r=="object";case ft.EVENT:case ft.BINARY_EVENT:return Array.isArray(r)&&r.length>0;case ft.ACK:case ft.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class $Y{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const r=xY(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var RY=Object.freeze(Object.defineProperty({__proto__:null,protocol:CY,get PacketType(){return ft},Encoder:PY,Decoder:Z_},Symbol.toStringTag,{value:"Module"}));function Ii(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const EY=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class g4 extends _r{constructor(e,r,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=r,i&&i.auth&&(this.auth=i.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ii(e,"open",this.onopen.bind(this)),Ii(e,"packet",this.onpacket.bind(this)),Ii(e,"error",this.onerror.bind(this)),Ii(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,...r){if(EY.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');r.unshift(e);const i={type:ft.EVENT,data:r};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const u=this.ids++,c=r.pop();this._registerAckCallback(u,c),i.id=u}const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!o||!this.connected)||(this.connected?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,r){const i=this.flags.timeout;if(i===void 0){this.acks[e]=r;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);r.call(this,new Error("operation has timed out"))},i);this.acks[e]=(...a)=>{this.io.clearTimeoutFn(o),r.apply(this,[null,...a])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:ft.CONNECT,data:e})}):this.packet({type:ft.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ft.CONNECT:if(e.data&&e.data.sid){const o=e.data.sid;this.onconnect(o)}else 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 ft.EVENT:case ft.BINARY_EVENT:this.onevent(e);break;case ft.ACK:case ft.BINARY_ACK:this.onack(e);break;case ft.DISCONNECT:this.ondisconnect();break;case ft.CONNECT_ERROR:this.destroy();const i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const i of r)i.apply(this,e)}super.emit.apply(this,e)}ack(e){const r=this;let i=!1;return function(...o){i||(i=!0,r.packet({type:ft.ACK,id:e,data:o}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(r.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),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:ft.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 r=this._anyListeners;for(let i=0;i<r.length;i++)if(e===r[i])return r.splice(i,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 r=this._anyOutgoingListeners;for(let i=0;i<r.length;i++)if(e===r[i])return r.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const i of r)i.apply(this,e.data)}}}function Ju(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}Ju.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-r:t+r}return Math.min(t,this.max)|0},Ju.prototype.reset=function(){this.attempts=0},Ju.prototype.setMin=function(t){this.ms=t},Ju.prototype.setMax=function(t){this.max=t},Ju.prototype.setJitter=function(t){this.jitter=t};class K_ extends _r{constructor(e,r){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,T0(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((i=r.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new Ju({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const o=r.parser||RY;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.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 os(this.uri,this.opts);const r=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const o=Ii(r,"open",function(){i.onopen(),e&&e()}),a=Ii(r,"error",u=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",u),e?e(u):i.maybeReconnectOnOpen()});if(this._timeout!==!1){const u=this._timeout;u===0&&o();const c=this.setTimeoutFn(()=>{o(),r.close(),r.emit("error",new Error("timeout"))},u);this.opts.autoUnref&&c.unref(),this.subs.push(function(){clearTimeout(c)})}return this.subs.push(o),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ii(e,"ping",this.onping.bind(this)),Ii(e,"data",this.ondata.bind(this)),Ii(e,"error",this.onerror.bind(this)),Ii(e,"close",this.onclose.bind(this)),Ii(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){this.emitReserved("error",e)}socket(e,r){let i=this.nsps[e];return i||(i=new g4(this,e,r),this.nsps[e]=i),i}_destroy(e){const r=Object.keys(this.nsps);for(const i of r)if(this.nsps[i].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let i=0;i<r.length;i++)this.engine.write(r[i],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"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,r){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),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 r=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(o=>{o?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",o)):e.onreconnect()}))},r);this.opts.autoUnref&&i.unref(),this.subs.push(function(){clearTimeout(i)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const gh={};function A0(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=yY(t,e.path||"/socket.io"),i=r.source,o=r.id,a=r.path,u=gh[o]&&a in gh[o].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||u;let f;return c?f=new K_(i,e):(gh[o]||(gh[o]=new K_(i,e)),f=gh[o]),r.query&&!e.query&&(e.query=r.queryKey),f.socket(r.path,e)}Object.assign(A0,{Manager:K_,Socket:g4,io:A0,connect:A0});const TY="loading",MY="ready",kY="offline",LY="online",AY="statusChanged",DY="lspStatusChanged",IY="playgroundChanged",WY="following",BY="unFollowing",zY="runStatusChanged",QY="ApplicationAvailable",NY="userEnter",FY="userLeave",qY="usersUpdated",HY="connectionBroken",UY="authorizationFailed",J_="errorFromServer",VY="auth";class GY{constructor(e,r=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=i=>this.receive(i),this._messages=[],this._timeout=r}setFilter(e){this._filter=e}send(e,r){const i=new XY(r||this._timeout),o=new Promise((a,u)=>{i._reject=u,i._resolve=a});return this._messages.push(i),this.channel.postMessage({id:this._messageId++,type:"request",payload:e}),o}answer(e,r){this.channel.postMessage({id:e,type:"response",payload:r})}receive(e){const r=e.data;r.type==="request"?(!this._filter||this._filter(r.payload))&&this.answer(r.id,{active:!0}):r.type==="response"&&this._messages[r.id].reject(r.payload)}}class XY{constructor(e){Tt(this,"_resolve");Tt(this,"_reject");Tt(this,"_interval");this._interval=setTimeout(()=>this.resolve({active:!1,reason:"timeout, no one uses it"}),e)}resolve(e){clearTimeout(this._interval),this._resolve(e)}reject(e){this._reject(e)}}const v4=new GY("dao-paas",500);let y4;async function YY(){let t="";v4.setFilter(i=>i.id===t);const e=JSON.parse(localStorage.getItem("agentUsers")||"[]")||[],r=[];for(const i of e){const o=v4.send(i).then(()=>{if(t==="")return i.time=new Date().getTime(),t=i.id,localStorage.setItem("agentUsers",JSON.stringify(e)),Promise.resolve(t)});r.push(o)}return Promise.any(r)}function ZY(t){const e=JSON.parse(localStorage.getItem("agentUsers")||"[]")||[],r=e.find(i=>i.id==t);r?r.time=new Date().getTime():e.push({id:t,time:new Date().getTime()}),localStorage.setItem("agentUsers",JSON.stringify(e)),y4=t}function KY(t){return t===y4}class JY{constructor(e,r,i=10){Tt(this,"socket");Tt(this,"ioPath");Tt(this,"authOptions");Tt(this,"heartbeatInterval",null);Tt(this,"maxReconnectionAttemps");Tt(this,"onMessage");Tt(this,"onError");this.ioPath=e,this.authOptions=r,this.maxReconnectionAttemps=i}setOnMessage(e){this.onMessage=e}setOnError(e){this.onError=e}startChannel(){if(this.socket&&this.socket.connected){console.warn("The connection is already established.");return}this.connect()}connect(){Ee.dao.appStatus()==="drafted"&&this.transitionLoading(),this.socket=A0(this.ioPath,{reconnectionAttempts:10,reconnectionDelayMax:1e4,transports:["websocket"]}),this.registerEventsOnSocket(),this.socket.on("connect",()=>{this.authorize(),Ee.dao.isReadyOffline()&&this.transitionOnline()}),this.socket.on("disconnect",()=>{kt.dao._channelAvailable(!1),this.clearHeartbeatInterval(),Ee.dao.isReady()&&this.transitionOffline()}),this.socket.io.on("reconnect_attempt",e=>{e>=this.maxReconnectionAttemps&&this.transitionError(HY,"Reconnection attemps exceeds the maximum times")}),this.socket.on("authAck",({result:e,data:r,error:i})=>{if(!e){this.transitionError(UY,i);return}const{agentUserId:o}=r;if(ZY(o),!KY(o))throw new Error(`The agentUserId ${o} is inconsistent`);this.setHeartbeatInterval(),this.authOptions.agentUserId=o,this.updateCurrentAgentUserId(o),kt.dao._channelAvailable(!0)})}authorize(){this.send(VY,this.authOptions)}registerEventsOnSocket(){if(!this.socket)throw new Error("The connection has not been established yet.");this.socket.on("syncPlaygroundInfo",e=>{if(e.playgroundIDEServerStatus==="ERROR"){this.transitionError(J_,e.playgroundIDEServerStatusReason);return}if(Ee.dao.appStatus()==="loading"){this.initAppStatusLoadingPlaygroundInfo(e);return}if(Ee.dao.isReady()){this.changeAppStatusReadyPlaygroundInfo(e);return}console.warn("syncPlaygroundInfo event happened at a wrong appStatus")}),this.socket.on("active",e=>{const{success:r,reason:i}=e,o={SUCCESS:"\u6210\u529F",PLAYGROUND_NOT_EXISTED:"playground\u4E0D\u5B58\u5728",DOCKER_NOT_BIND:"playground\u672A\u7ED1\u5B9A\u5BB9\u5668",DOCKER_START_FAIL:"\u5BB9\u5668\u542F\u52A8\u5931\u8D25",RESOURCE_NOT_ENOUG:"\u670D\u52A1\u5668\u8D44\u6E90\u4E0D\u8DB3",BUSY:"\u670D\u52A1\u5668\u7E41\u5FD9"};r||this.transitionError(J_,`\u542F\u52A8\u5931\u8D25: ${o[i]||i}`)}),this.socket.on("following",e=>{const{agentUsers:r}=Ee.dao.playgroundInfo(),i=r.findIndex(o=>o.userId===e.agentUserId);i>-1&&(r[i]=e),this.updatePlaygroundInfoPartial({agentUsers:r}),this.trigger("message",{name:WY,payload:{user:e}})}),this.socket.on("unFollowing",e=>{const{agentUsers:r}=Ee.dao.playgroundInfo(),i=r.findIndex(o=>o.userId===e.agentUserId);i>-1&&(r[i]=e),this.updatePlaygroundInfoPartial({agentUsers:r}),this.trigger("message",{name:BY,payload:{user:e}})}),this.socket.on("runStatus",e=>{const{status:r,runResult:i}=e,{dockerInfo:o}=Ee.dao.playgroundInfo();if(o.runStatus===r){console.debug("runStatus event is the same, ignored");return}this.updatePlaygroundInfoPartial({dockerInfo:Ve(xe({},o),{runStatus:r})}),this.trigger("message",{name:zY,payload:{status:r,runResult:i}})}),this.socket.on("lspStatus",e=>{const{dockerInfo:r}=Ee.dao.playgroundInfo(),i=r.lspStatus,{status:o}=e;if(i===o){console.debug("lspStatus event is the same, ignored");return}this.updatePlaygroundInfoPartial({dockerInfo:Ve(xe({},r),{lspStatus:o})}),this.trigger("message",{name:DY,payload:{status:o}})}),this.socket.on("folderEvent",e=>{this.updateCRDTInfo(e)}),this.socket.on("fileContent",e=>{const r=Ee.dao.currentAgentUserId(),i=kt.currentDoc.switchDoc,o=Ee.dao.currentAgentUser(),a=kt.dao.updateAgentUser,u=e.file;this.updateCRDTInfo(e),(e.agentUserId===r||o.followingAgentUserId===e.agentUserId)&&i(u),a(e.agentUserId,{fileOpened:e.file.path}),o.followingAgentUserId&&a(r,{fileOpened:e.file.path})}),this.socket.on("userEnter",e=>{Ee.dao.getAgentUserById(e.agentUserId)?kt.dao.updateAgentUser(e.agentUserId,e):kt.dao.addAgentUser(e),this.trigger("message",{name:NY,payload:{agentUser:e}})}),this.socket.on("userLeave",e=>{kt.dao.updateAgentUser(e.agentUserId,e),this.trigger("message",{name:FY,payload:{agentUser:e}})}),this.socket.on("usersUpdated",e=>{this.updatePlaygroundInfoPartial({agentUsers:e}),this.trigger("message",{name:qY,payload:{agentUsers:e}})}),this.socket.on("sendAddedFile",e=>{console.debug(e)}),this.socket.on("fileNode",e=>{kt.fileTree.switchFileTree(e),this.updatePlaygroundInfoPartial({fileTree:e})}),this.socket.on("console",e=>{this.updateCRDTInfo(e)}),this.socket.on("terminal",e=>{this.updateCRDTInfo(e)}),this.socket.on("portOpen",()=>{this.trigger("message",{name:QY})}),this.socket.on("getReplayInfo",e=>{}),this.socket.onAny((e,r)=>{console.debug(`<< ${e}`)}),this.socket.on("errorHandler",e=>{this.transitionError(J_,`${e.name}: ${e.message}`)})}initAppStatusLoadingPlaygroundInfo(e){kt.dao.setPlaygroundInfo(e),e.playgroundIDEServerStatus==="SYNCED"&&this.transitionReady()}changeAppStatusReadyPlaygroundInfo(e){const r=Ee.dao.playgroundInfo().status,i=Ee.dao.playgroundInfo().dockerInfo.dockerId;kt.dao.setPlaygroundInfo(e),e.status!=r&&this.trigger("message",{name:AY,payload:{status:e.status}}),e.dockerInfo.dockerId&&e.dockerInfo.dockerId!==i&&this.trigger("message",{name:IY})}transitionOnline(){kt.dao.transitionOnline(),this.trigger("message",{name:LY})}transitionOffline(){kt.dao.transitionOffline(),this.trigger("message",{name:kY})}transitionLoading(){kt.dao.transitionLoading(),this.trigger("message",{name:TY})}transitionReady(){kt.dao.transitionReady(),this.trigger("message",{name:MY})}transitionError(e,r){kt.dao.transitionError(),this.trigger("error",{name:e,error:r}),this.closeChannel()}updatePlaygroundInfoPartial(e){kt.dao.setPlaygroundInfo(xe(xe({},Ee.dao.playgroundInfo()),e))}updateCurrentAgentUserId(e){kt.dao.currentAgentUserId(e)}updateCRDTInfo(e){kt.dao.setCRDTInfo(e)}trigger(e,r){if(console.debug(`<trigger: ${r.name}`),e==="error"){this.onError&&this.onError(r);return}this.onMessage&&this.onMessage(r)}clearHeartbeatInterval(){this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}setHeartbeatInterval(){this.heartbeatInterval=setInterval(()=>{this.heartbeat()},6e4)}active(){this.send("active")}run(){this.send("run")}stop(){this.send("stop")}fileContent(e){this.send("fileContent",e)}editFile(e){this.send("editFile",e)}fileDir(e){this.send("fileDir",e)}fileTreeOp(e){this.send("fileTreeOp",e)}terminal(e){this.send("terminal",e)}cursor(e){this.send("cursor",e)}heartbeat(){this.send("heartbeat")}getReplayInfo(){this.send("getReplayInfo")}followingAgentUser(e){this.send("followingAgentUser",e)}featureConfig(e){this.send("setFeaturesConfig",e)}setFileLockStatus(e){this.send("setFileLockStatus",e)}setFileVisiable(e){this.send("setFileVisiable",e)}addFileToUnitTest(e){this.send("addFileToUnitTest",e)}removeFileFromUnitTest(e){this.send("removeFileFromUnitTest",e)}followingFocusComponent(e){const r=Ee.dao.currentAgentUser();!r||r.focusComponent!==e&&(r.followingAgentUserId||this.send("followingFocusComponent",e))}followingEditorScroll(e){const r=Ee.dao.currentAgentUser();r!=null&&r.followingAgentUserId||this.send("followingEditorScroll",e)}unFollowingAgentUser(){this.send("unFollowingAgentUser")}send(e,r={}){if(!this.socket)throw new Error("socket is not ready");console.debug(`>> ${e}`),this.socket.emit(e,r)}on(e,r){if(!this.socket)throw new Error("socket is not ready");this.socket.on(e,r)}off(e){if(!this.socket)throw new Error("socket is not ready");this.socket.off(e)}isReady(){var e;return(e=this.socket)==null?void 0:e.connected}closeChannel(){var e,r;console.debug("close Channel..."),this.clearHeartbeatInterval(),(e=this.socket)==null||e.removeAllListeners(),(r=this.socket)==null||r.close(),this.socket=void 0}}var mRe="";const jY=Xu(async()=>(await Promise.resolve().then(function(){return YOe})).FileTree),eZ=Xu(async()=>(await Promise.resolve().then(function(){return OCe})).Editor),tZ=Xu(async()=>(await Promise.resolve().then(function(){return u6e})).default),rZ=Xu(async()=>(await Promise.resolve().then(function(){return h6e})).default),nZ=Xu(async()=>(await Promise.resolve().then(function(){return m6e})).default);class iZ{constructor(e){Tt(this,"components",{Tree:null,Editor:null,Console:null,Browser:null,Shell:null});Tt(this,"paasOptions");Tt(this,"paasDomainPath");Tt(this,"sdkVersion");Tt(this,"isRendered",!1);Tt(this,"_onMessage");Tt(this,"_onError");this.sdkVersion=BX(),this.setPaasOptionsWithDefaultAvatar(e),this.setPaasDomainPathWithDefaultOrigin(e.paasDomain),this.init()}setPaasOptionsWithDefaultAvatar(e){this.paasOptions=e,this.paasOptions.userInfo.avatarUrl||(this.paasOptions.userInfo.avatarUrl=NX(this.paasOptions.userInfo.username))}setPaasDomainPathWithDefaultOrigin(e){this.paasDomainPath={}.PAAS_MANAGER_API_ORIGIN||"https://www.1024paas.com",e&&(this.paasDomainPath=e)}get playgroundStatus(){return Ee.dao.playgroundInfo().status}get dockerStatus(){var e;return(e=Ee.dao.playgroundInfo().dockerInfo)==null?void 0:e.runStatus}get currentAgentUser(){return Ee.dao.currentAgentUser()}get agentUsers(){return Ee.dao.playgroundInfo().agentUsers}get playgroundInfo(){return Ee.dao.playgroundInfo()}get currentFollowingAgentUser(){return Ee.dao.getFollowingAgentUser()}followUser(e){const r={timestamp:Date.now(),agentUserId:this.currentAgentUser.agentUserId,file:{action:"Get",path:this.currentAgentUser.fileOpened}};Ee.dao.channel().send("fileContent",r),Ee.dao.channel().followingAgentUser(e)}unFollowUser(){Ee.dao.channel().unFollowingAgentUser()}replay(){}activePlayground(){Ee.dao.channel().send("active")}runPlayground(){Ee.dao.channel().send("run")}stopPlayground(){Ee.dao.channel().send("stop")}onUploadFile(e){Ee.dao.channel().send("upload",e)}async init(){console.debug(`sdk: init with ${this.paasDomainPath} passDomain`);const e=await zX(this.paasDomainPath,this.paasOptions.ticket,this.sdkVersion);let r;try{r=await YY()}catch{}const i=new JY(e,Ve(xe({},this.paasOptions),{agentUserId:r}));this._onMessage&&i.setOnMessage(this._onMessage),this._onError&&i.setOnError(this._onError),kt.dao.reset(),kt.dao.setChannel(i),i.startChannel()}set onMessage(e){var r;this._onMessage=e,(r=Ee.dao.channel())==null||r.setOnMessage(e)}set onError(e){var r;this._onError=e,(r=Ee.dao.channel())==null||r.setOnError(e)}initComponent(e,r,i){const o=u=>{switch(e){case"Tree":return ne(jY,xe({},u));case"Editor":return ne(eZ,xe({},u));case"Browser":return ne(rZ,xe({},u));case"Console":return ne(tZ,xe({},u));case"Shell":return ne(nZ,xe({},u));default:throw new Error("wrong component name")}};this.components[e]={reactComponent:o,container:r,props:i};const a=document.querySelector(r);tl.exports.render(ne($.exports.Suspense,{fallback:ne(IX,{}),children:ne(o,xe({},i))}),a)}mapRender(e){e.forEach((r,i)=>{const{item:o,container:a,props:u}=r;this.initComponent(o,a,u)})}dispose(){var e;console.debug("destroy components...",this.components),(e=Ee.dao._channel())==null||e.closeChannel(),kt.dao.setChannel(null),kt.dao.reset();for(const[r,i]of Object.entries(this.components)){if(!i)break;const o=document.querySelector(i.container);if(o){const a=tl.exports.unmountComponentAtNode(o);console.debug(`destroy unmount: ${i.container}, ${a}`)}}}}var na;(function(t){t.DoubleClickItemToExpand="double-click-item-to-expand",t.ClickItemToExpand="click-item-to-expand",t.ClickArrowToExpand="click-arrow-to-expand"})(na||(na={}));var D0=globalThis&&globalThis.__assign||function(){return D0=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},D0.apply(this,arguments)},oZ=function(t,e){return{mode:t.mode,createInteractiveElementProps:function(r,i,o,a){return D0(D0({},e.createInteractiveElementProps(r,i,o,a)),t.createInteractiveElementProps(r,i,o,a))}}},aZ=function(){function t(e){this.mode=na.DoubleClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,r,i,o){var a=this;return{onClick:function(u){i.focusItem(),u.shiftKey?i.selectUpTo():u.ctrlKey?o.isSelected?i.unselectItem():i.addToSelectedItems():i.selectItem()},onDoubleClick:function(){i.focusItem(),i.selectItem(),e.hasChildren&&i.toggleExpandedState(),(!e.hasChildren||a.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction()},onFocus:function(){i.focusItem()},onDragStart:function(u){u.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(u){u.preventDefault()},draggable:o.canDrag&&!o.isRenaming,tabIndex:o.isRenaming?void 0:o.isFocused?0:-1}},t}(),sZ=function(){function t(e){this.mode=na.ClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,r,i,o){var a=this;return{onClick:function(u){i.focusItem(),u.shiftKey?i.selectUpTo():u.ctrlKey?o.isSelected?i.unselectItem():i.addToSelectedItems():(e.hasChildren&&i.toggleExpandedState(),i.selectItem(),(!e.hasChildren||a.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction())},onFocus:function(){i.focusItem()},onDragStart:function(u){u.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(u){u.preventDefault()},draggable:o.canDrag&&!o.isRenaming,tabIndex:o.isRenaming?void 0:o.isFocused?0:-1}},t}(),lZ=function(){function t(e){this.mode=na.ClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,r,i,o){var a=this;return{onClick:function(u){i.focusItem(),u.shiftKey?i.selectUpTo():u.ctrlKey?o.isSelected?i.unselectItem():i.addToSelectedItems():(i.selectItem(),(!e.hasChildren||a.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction())},onFocus:function(){i.focusItem()},onDragStart:function(u){u.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(u){u.preventDefault()},draggable:o.canDrag&&!o.isRenaming,tabIndex:o.isRenaming?void 0:o.isFocused?0:-1}},t}(),_4=function(t,e){switch(t){case na.DoubleClickItemToExpand:return new aZ(e);case na.ClickItemToExpand:return new sZ(e);case na.ClickArrowToExpand:return new lZ(e);default:throw Error("Unknown interaction mode "+t)}},O4=$.exports.createContext(null),uZ=function(){return $.exports.useContext(O4)},cZ=function(t){var e=Wt(),r=e.defaultInteractionMode,i=$.exports.useMemo(function(){var o;return r&&typeof r!="string"?r.extends?oZ(r,_4(r.extends,e)):r:_4((o=r)!==null&&o!==void 0?o:na.ClickItemToExpand,e)},[]);return $.exports.createElement(O4.Provider,{value:i},t.children)},w4=function(){var t=Wt();return $.exports.useCallback(function(e,r){for(var i=t.linearItems[r],o=i[e].depth,a=e;!!i[a]&&i[a].depth!==o-1;a--);var u=i[a];return u||(u={item:t.trees[r].rootItem,depth:0},a=0),u},[t.linearItems,t.trees])},fZ=function(t,e){return t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom},hZ=function(t,e,r,i,o){var a=(t-e)/r,u=Math.floor(a),c=void 0,f=i||o?.2:.5;return a%1<f?c="top":a%1>1-f&&(c="bottom"),{linearIndex:u,offset:c}},dZ=function(t,e,r,i,o){var a=Wt(),u=a.canDropOnItemWithChildren,c=a.canDropOnItemWithoutChildren,f=a.canDragAndDrop,n=a.linearItems,l=a.items,s=a.canReorderItems,d=a.viewState,h=w4();return $.exports.useCallback(function(p,b,O){var v,g,_,w;if(!!f&&!!O.current&&!(p.clientX<0||p.clientY<0)){var S=O.current.getBoundingClientRect(),C=fZ(p,S),P=hZ(p.clientY,S.top,r,u,c),M=P.linearIndex,T=P.offset,E=C?"outside":""+b+M+(T!=null?T:"");if(t!==E){if(e(E),C){i(void 0);return}if(M<0||M>=n[b].length){i(void 0);return}var k=n[b][M],I=k.depth,L=l[k.item];if(!T&&!c&&!L.hasChildren){i(void 0);return}if(!T&&!u&&L.hasChildren){i(void 0);return}if(T&&!s){i(void 0);return}var V=h(M,b);if(!(!((g=(v=d[b])===null||v===void 0?void 0:v.selectedItems)===null||g===void 0)&&g.includes(k.item))){var Q=l[V.item].children.indexOf(k.item)+(T==="top"?0:1);T==="top"&&I===((w=(_=n[b][M-1])===null||_===void 0?void 0:_.depth)!==null&&w!==void 0?w:-1)&&(T="bottom",M-=1);var A;T?A={targetType:"between-items",treeId:b,parentItem:V.item,depth:k.depth,linearIndex:M+(T==="top"?0:1),childIndex:Q,linePosition:T}:A={targetType:"item",treeId:b,parentItem:V.item,targetItem:k.item,depth:k.depth,linearIndex:M},o(A)}}}},[f,u,c,s,h,r,l,t,n,i,o,e,d])},b4=function(){var t=Wt();return $.exports.useCallback(function(e,r){if(e.targetType==="between-items"){if(!t.canReorderItems)return!1}else{var i=t.items[e.targetItem];if(!t.canDropOnItemWithChildren&&i.hasChildren||!t.canDropOnItemWithoutChildren&&!i.hasChildren)return!1}return!(t.canDropAt&&(!r||!t.canDropAt(r,e)))},[t])},S4=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,i=e.length,o=t.length;r<i;r++,o++)t[o]=e[r];return t},pZ=function(){var t=Wt(),e=w4(),r=b4();return $.exports.useCallback(function(i,o){var a=t.linearItems[i];return a.map(function(u,c){var f,n,l=u.item,s=u.depth,d=e(c,i),h=t.items[d.item].children.indexOf(l),p={targetType:"item",parentItem:d.item,targetItem:l,linearIndex:c,depth:s,treeId:i},b={targetType:"between-items",parentItem:d.item,linePosition:"top",childIndex:h,depth:s,treeId:i,linearIndex:c},O={targetType:"between-items",parentItem:d.item,linePosition:"bottom",linearIndex:c+1,childIndex:h+1,depth:s,treeId:i},v=s===((n=(f=a[c-1])===null||f===void 0?void 0:f.depth)!==null&&n!==void 0?n:-1);return v?[p,O]:[b,p,O]}).reduce(function(u,c){return S4(S4([],u),c)},[]).filter(function(u){return r(u,o)})},[r,t.items,t.linearItems,e])},I0=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,i=e.length,o=t.length;r<i;r++,o++)t[o]=e[r];return t},W0=function(t,e,r){var i=$.exports.useRef();$.exports.useEffect(function(){if(!i.current)i.current=I0([],r),t();else{var o=i.current.some(function(a,u){return a!==r[u]});o&&(i.current=I0([],r),t())}},I0(I0([],e),r))},B0=globalThis&&globalThis.__assign||function(){return B0=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},B0.apply(this,arguments)},x4=function(t,e){return t.map(function(r){return[r,e(r)]}).reduce(function(r,i){var o,a=i[0],u=i[1];return B0(B0({},r),(o={},o[a]=u,o))},{})};function ju(){var t=$.exports.useRef(new Array);$.exports.useEffect(function(){var r=t.current;return function(){return r.forEach(function(i){return cancelAnimationFrame(i)})}},[t]);var e=$.exports.useCallback(function(r){var i=requestAnimationFrame(function(){t.current.splice(t.current.indexOf(i),1),r()});t.current.push(i)},[t]);return e}var C4=$.exports.createContext(null),fo=function(){return $.exports.useContext(C4)},mZ=function(t){var e=Wt(),r=$.exports.useState(!1),i=r[0],o=r[1],a=$.exports.useState(4),u=a[0],c=a[1],f=$.exports.useState({}),n=f[0],l=f[1],s=$.exports.useState(0),d=s[0],h=s[1],p=$.exports.useState(),b=p[0],O=p[1],v=$.exports.useState(),g=v[0],_=v[1],w=$.exports.useState("_nodrag"),S=w[0],C=w[1],P=pZ(),M=ju();$.exports.useRef(!1);var T=$.exports.useCallback(function(se,le){var we;if(e.activeTreeId&&((we=e.viewState[e.activeTreeId])===null||we===void 0?void 0:we.focusedItem)&&e.linearItems&&le){var B=e.viewState[e.activeTreeId].focusedItem,oe=P(e.activeTreeId,le),N=oe.findIndex(function(U){if(U.targetType==="item")return U.targetItem===B;if(U.targetType==="between-items")return e.items[U.parentItem].children[U.childIndex]===B});h(N?Math.min(N+1,oe.length-1):0)}else h(0)},[e.activeTreeId,e.items,e.linearItems,e.viewState,P]),E=$.exports.useCallback(function(){o(!1),c(4),l({}),h(0),O(void 0),_(void 0),C("_nodrag")},[]);W0(function(){e.activeTreeId&&e.linearItems[e.activeTreeId]&&n[e.activeTreeId]&&T(n[e.activeTreeId],b)},[b,e.activeTreeId,e.linearItems,T,n],[e.activeTreeId]),W0(function(){i&&e.activeTreeId&&_(n[e.activeTreeId][d])},[d,e.activeTreeId,i,n],[d,e.activeTreeId]);var k=b4(),I=function(se){var le;b&&!k(se,b)||(_(se),e.setActiveTree(se.treeId),b&&e.activeTreeId!==se.treeId&&((le=e.onSelectItems)===null||le===void 0||le.call(e,b.map(function(we){return we.index}),se.treeId)))},L=dZ(S,C,u,_,I),V=$.exports.useCallback(function(){b&&g&&e.onDrop&&(e.onDrop(b,g),M(function(){var se;(se=e.onFocusItem)===null||se===void 0||se.call(e,b[0],g.treeId),E()}))},[b,g,e,E,M]),Q=$.exports.useCallback(function(se,le){var we,B,oe=x4(e.treeIds,function(U){return P(U,se)}),N=(B=(we=document.querySelector('[data-rct-tree="'+le+'"] [data-rct-item-container="true"]'))===null||we===void 0?void 0:we.offsetHeight)!==null&&B!==void 0?B:5;c(N),O(se),l(oe),e.activeTreeId&&T(oe[e.activeTreeId],se)},[e.activeTreeId,e.treeIds,P,T]),A=$.exports.useCallback(function(){var se,le,we;if(!!e.canDragAndDrop&&e.activeTreeId){var B=(le=(se=e.viewState[e.activeTreeId])===null||se===void 0?void 0:se.selectedItems)!==null&&le!==void 0?le:[(we=e.viewState[e.activeTreeId])===null||we===void 0?void 0:we.focusedItem];if(B.length===0||B[0]===void 0)return;var oe=B.map(function(N){return e.items[N]});if(e.canDrag&&!e.canDrag(oe))return;Q(oe,e.activeTreeId),setTimeout(function(){o(!0)})}},[Q,e]),W=$.exports.useCallback(function(){E()},[E]),H=$.exports.useCallback(function(){V(),E()},[V,E]),X=$.exports.useCallback(function(){h(function(se){return Math.max(0,se-1)})},[]),ae=$.exports.useCallback(function(){e.activeTreeId&&h(function(se){return Math.min(n[e.activeTreeId].length,se+1)})},[e.activeTreeId,n]),Y={onStartDraggingItems:Q,startProgrammaticDrag:A,abortProgrammaticDrag:W,completeProgrammaticDrag:H,programmaticDragUp:X,programmaticDragDown:ae,draggingItems:b,draggingPosition:g,itemHeight:u,isProgrammaticallyDragging:i,onDragOverTreeHandler:L,viableDragPositions:n};return $.exports.useEffect(function(){return window.addEventListener("dragend",E),window.addEventListener("drop",V),function(){window.removeEventListener("dragend",E),window.removeEventListener("drop",V)}},[V,E]),$.exports.createElement(C4.Provider,{value:Y},t.children)},vh=globalThis&&globalThis.__assign||function(){return vh=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},vh.apply(this,arguments)},gZ=function(t,e){var r=Wt(),i=fo();$.exports.useImperativeHandle(t,function(){return vh(vh(vh({},e),r),{treeEnvironmentContext:r,dragAndDropContext:i})})},P4=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,i=e.length,o=t.length;r<i;r++,o++)t[o]=e[r];return t},$4=$.exports.createContext(null),vZ=function(){return $.exports.useContext($4)},yZ=$.exports.forwardRef(function(t,e){var r=Wt(),i=r.onCollapseItem,o=r.items;r.trees;var a=r.viewState,u=r.onExpandItem,c=r.onFocusItem,f=r.setActiveTree,n=r.onRenameItem,l=r.onSelectItems,s=r.onPrimaryAction,d=r.linearItems,h=fo(),p=h.abortProgrammaticDrag,b=h.completeProgrammaticDrag,O=h.programmaticDragDown,v=h.programmaticDragUp,g=h.startProgrammaticDrag,_={abortProgrammaticDrag:$.exports.useCallback(function(){p()},[p]),collapseItem:$.exports.useCallback(function(w,S){i==null||i(o[w],S)},[o,i]),completeProgrammaticDrag:$.exports.useCallback(function(){b()},[b]),expandItem:$.exports.useCallback(function(w,S){u==null||u(o[w],S)},[o,u]),focusItem:$.exports.useCallback(function(w,S){c==null||c(o[w],S)},[o,c]),focusTree:$.exports.useCallback(function(w,S){S===void 0&&(S=!0),f(w,S)},[f]),moveFocusDown:$.exports.useCallback(function(w){var S=d[w],C=S.findIndex(function(T){var E,k=T.item;return k===((E=a[w])===null||E===void 0?void 0:E.focusedItem)}),P=C!==void 0?Math.min(S.length-1,C+1):0,M=o[S[P].item];c==null||c(M,w)},[o,d,c,a]),moveFocusUp:$.exports.useCallback(function(w){var S=d[w],C=S.findIndex(function(T){var E,k=T.item;return k===((E=a[w])===null||E===void 0?void 0:E.focusedItem)}),P=C!==void 0?Math.max(0,C-1):0,M=o[S[P].item];c==null||c(M,w)},[o,d,c,a]),moveProgrammaticDragPositionDown:$.exports.useCallback(function(){O()},[O]),moveProgrammaticDragPositionUp:$.exports.useCallback(function(){v()},[v]),renameItem:$.exports.useCallback(function(w,S,C){n==null||n(o[w],S,C)},[o,n]),selectItems:$.exports.useCallback(function(w,S){l==null||l(w,S)},[l]),startProgrammaticDrag:$.exports.useCallback(function(){g()},[g]),toggleItemExpandedState:$.exports.useCallback(function(w,S){var C,P;!((P=(C=a[S])===null||C===void 0?void 0:C.expandedItems)===null||P===void 0)&&P.includes(w)?i==null||i(o[w],S):u==null||u(o[w],S)},[o,i,u,a]),toggleItemSelectStatus:$.exports.useCallback(function(w,S){var C,P,M,T,E;!((P=(C=a[S])===null||C===void 0?void 0:C.selectedItems)===null||P===void 0)&&P.includes(w)?l==null||l((T=(M=a[S].selectedItems)===null||M===void 0?void 0:M.filter(function(k){return k!==w}))!==null&&T!==void 0?T:[],S):l==null||l(P4(P4([],(E=a[S].selectedItems)!==null&&E!==void 0?E:[]),[w]),S)},[l,a]),invokePrimaryAction:$.exports.useCallback(function(w,S){s==null||s(o[w],S)},[o,s])};return gZ(e,_),$.exports.createElement($4.Provider,{value:_},t.children)}),_Z=function(t){if(!!t)if(t.scrollIntoViewIfNeeded)t.scrollIntoViewIfNeeded();else{var e=t.getBoundingClientRect(),r=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth);r||t.scrollIntoView()}},zn=globalThis&&globalThis.__assign||function(){return zn=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},zn.apply(this,arguments)},as=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.filter(function(r){return!!r}).join(" ")},OZ=function(t){return{renderItemTitle:function(e){var r=e.title,i=e.context,o=e.info;if(!o.isSearching||!i.isSearchMatching)return ge.createElement(ge.Fragment,null,r);var a=r.toLowerCase().indexOf(o.search.toLowerCase());return ge.createElement(ge.Fragment,null,a>0&&ge.createElement("span",null,r.slice(0,a)),ge.createElement("span",{className:"rct-tree-item-search-highlight"},r.slice(a,a+o.search.length)),a+o.search.length<r.length&&ge.createElement("span",null,r.slice(a+o.search.length,r.length)))},renderItemArrow:function(e){var r=e.item,i=e.context;return ge.createElement("div",zn({className:as(r.hasChildren&&"rct-tree-item-arrow-hasChildren","rct-tree-item-arrow")},i.arrowProps),r.hasChildren&&(i.isExpanded?ge.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},ge.createElement("g",null,ge.createElement("g",null,ge.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:`M12,5c-0.28,0-0.53,0.11-0.71,0.29L8,8.59L4.71,5.29C4.53,5.11,4.28,5,4,5
231
+ `,IX=()=>ne(DX,{children:ot("div",{className:"preloader",children:[ne("svg",{className:"first-svg",version:"1.1",id:"sun",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"10px",height:"10px",viewBox:"0 0 10 10",enableBackground:"new 0 0 10 10",xmlSpace:"preserve",children:ot("g",{children:[ne("path",{fill:"none",d:"M6.942,3.876c-0.4-0.692-1.146-1.123-1.946-1.123c-0.392,0-0.779,0.104-1.121,0.301c-1.072,0.619-1.44,1.994-0.821,3.067C3.454,6.815,4.2,7.245,5,7.245c0.392,0,0.779-0.104,1.121-0.301C6.64,6.644,7.013,6.159,7.167,5.581C7.321,5,7.243,4.396,6.942,3.876z M6.88,5.505C6.745,6.007,6.423,6.427,5.973,6.688C5.676,6.858,5.34,6.948,5,6.948c-0.695,0-1.343-0.373-1.69-0.975C2.774,5.043,3.093,3.849,4.024,3.312C4.32,3.14,4.656,3.05,4.996,3.05c0.695,0,1.342,0.374,1.69,0.975C6.946,4.476,7.015,5,6.88,5.505z"}),ne("path",{fill:"none",d:"M8.759,2.828C8.718,2.757,8.626,2.732,8.556,2.774L7.345,3.473c-0.07,0.041-0.094,0.132-0.053,0.202C7.319,3.723,7.368,3.75,7.419,3.75c0.025,0,0.053-0.007,0.074-0.02l1.211-0.699C8.774,2.989,8.8,2.899,8.759,2.828z"}),ne("path",{fill:"none",d:"M1.238,7.171c0.027,0.047,0.077,0.074,0.128,0.074c0.025,0,0.051-0.008,0.074-0.02l1.211-0.699c0.071-0.041,0.095-0.133,0.054-0.203S2.574,6.228,2.503,6.269l-1.21,0.699C1.221,7.009,1.197,7.101,1.238,7.171z"}),ne("path",{fill:"none",d:"M6.396,2.726c0.052,0,0.102-0.026,0.13-0.075l0.349-0.605C6.915,1.976,6.89,1.885,6.819,1.844c-0.07-0.042-0.162-0.017-0.202,0.054L6.269,2.503C6.228,2.574,6.251,2.666,6.322,2.706C6.346,2.719,6.371,2.726,6.396,2.726z"}),ne("path",{fill:"none",d:"M3.472,7.347L3.123,7.952c-0.041,0.07-0.017,0.162,0.054,0.203C3.2,8.169,3.226,8.175,3.25,8.175c0.052,0,0.102-0.027,0.129-0.074l0.349-0.605c0.041-0.07,0.017-0.16-0.054-0.203C3.603,7.251,3.513,7.276,3.472,7.347z"}),ne("path",{fill:"none",d:"M3.601,2.726c0.025,0,0.051-0.007,0.074-0.02C3.746,2.666,3.77,2.574,3.729,2.503l-0.35-0.604C3.338,1.828,3.248,1.804,3.177,1.844C3.106,1.886,3.082,1.976,3.123,2.047l0.35,0.604C3.5,2.7,3.549,2.726,3.601,2.726z"}),ne("path",{fill:"none",d:"M6.321,7.292c-0.07,0.043-0.094,0.133-0.054,0.203l0.351,0.605c0.026,0.047,0.076,0.074,0.127,0.074c0.025,0,0.051-0.006,0.074-0.02c0.072-0.041,0.096-0.133,0.055-0.203l-0.35-0.605C6.483,7.276,6.393,7.253,6.321,7.292z"}),ne("path",{fill:"none",d:"M2.202,5.146c0.082,0,0.149-0.065,0.149-0.147S2.284,4.851,2.202,4.851H1.503c-0.082,0-0.148,0.066-0.148,0.148s0.066,0.147,0.148,0.147H2.202z"}),ne("path",{fill:"none",d:"M8.493,4.851H7.794c-0.082,0-0.148,0.066-0.148,0.148s0.066,0.147,0.148,0.147l0,0h0.699c0.082,0,0.148-0.065,0.148-0.147S8.575,4.851,8.493,4.851L8.493,4.851z"}),ne("path",{fill:"none",d:"M5.146,2.203V0.805c0-0.082-0.066-0.148-0.148-0.148c-0.082,0-0.148,0.066-0.148,0.148v1.398c0,0.082,0.066,0.149,0.148,0.149C5.08,2.352,5.146,2.285,5.146,2.203z"}),ne("path",{fill:"none",d:"M4.85,7.796v1.396c0,0.082,0.066,0.15,0.148,0.15c0.082,0,0.148-0.068,0.148-0.15V7.796c0-0.082-0.066-0.148-0.148-0.148C4.917,7.647,4.85,7.714,4.85,7.796z"}),ne("path",{fill:"none",d:"M2.651,3.473L1.44,2.774C1.369,2.732,1.279,2.757,1.238,2.828C1.197,2.899,1.221,2.989,1.292,3.031l1.21,0.699c0.023,0.013,0.049,0.02,0.074,0.02c0.051,0,0.101-0.026,0.129-0.075C2.747,3.604,2.722,3.514,2.651,3.473z"}),ne("path",{fill:"none",d:"M8.704,6.968L7.493,6.269c-0.07-0.041-0.162-0.016-0.201,0.055c-0.041,0.07-0.018,0.162,0.053,0.203l1.211,0.699c0.023,0.012,0.049,0.02,0.074,0.02c0.051,0,0.102-0.027,0.129-0.074C8.8,7.101,8.776,7.009,8.704,6.968z"})]})}),ne("svg",{version:"1.1",id:"cloud",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"10px",height:"10px",viewBox:"0 0 10 10",enableBackground:"new 0 0 10 10",xmlSpace:"preserve",children:ne("path",{fill:"none",d:"M8.528,5.624H8.247c-0.085,0-0.156-0.068-0.156-0.154c0-0.694-0.563-1.257-1.257-1.257c-0.098,0-0.197,0.013-0.3,0.038C6.493,4.259,6.45,4.252,6.415,4.229C6.38,4.208,6.356,4.172,6.348,4.131C6.117,3.032,5.135,2.235,4.01,2.235c-1.252,0-2.297,0.979-2.379,2.23c-0.004,0.056-0.039,0.108-0.093,0.13C1.076,4.793,0.776,5.249,0.776,5.752c0,0.693,0.564,1.257,1.257,1.257h6.495c0.383,0,0.695-0.31,0.695-0.692S8.911,5.624,8.528,5.624z"})}),ot("div",{className:"rain",children:[ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"}),ne("span",{className:"drop"})]}),ne("div",{className:"text",children:"Loading......"})]})});var WX={name:"@dao42/d42paas-front",version:"0.9.14",description:"d42paas front",author:"dao42 paas team",homepage:"https://github.com/dao42/d42paas_frontend#readme",license:"UNLICENSED",main:"./dist/DaoPaaS.umd.js",module:"./dist/DaoPaaS.es.js",types:"./dist/DaoPaaS.d.ts",scripts:{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",test:"jest --coverage"},devDependencies:{"@codemirror/collab":"^0.20.0","@codemirror/lang-javascript":"^0.20.0","@codemirror/state":"^0.20.0","@codemirror/view":"^0.20.7","utf-8-validate":"^5.0.9",uuid:"^8.3.2",xterm:"^4.13.0","xterm-addon-attach":"^0.6.0","xterm-addon-fit":"^0.5.0",zustand:"^4.0.0-rc.1","@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.4.1","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@rsuite/icons":"^1.0.2","@testing-library/jest-dom":"^5.16.2","@testing-library/react":"^12.1.4","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/react":"^17.0.24","@types/react-dom":"^17.0.9","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@uiw/react-codemirror":"^4.7.0","@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",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",immer:"^9.0.14","glob-all":"^3.2.1",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15",prettier:"^2.3.2",react:"^17.0.2","react-complex-tree":"^1.1.6","react-dom":"^17.0.2","react-icons":"^4.3.1","react-markdown":"^8.0.0","reconnecting-websocket":"^4.4.0","rehype-katex":"^6.0.2","remark-math":"^5.1.1",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.6.0",rsuite:"5.6.4",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","use-immer":"^0.7.0",vite:"^2.7.2","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2"},files:["dist"],repository:{type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},bugs:{url:"https://github.com/dao42/d42paas_frontend/issues"},msw:{workerDirectory:"src"}};const BX=()=>WX.version,zX=async(t,e,r)=>{const o=await(await fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:r})})).json();if(o.status==="failure")throw console.error(o),new Error(o.errors[0].erromsg);return o.data},QX=t=>{const e=Ee.dao.playgroundInfo().fileTree;let r=null;const i=o=>{if(o.path===t){r=o;return}else for(let a=0;a<o.children.length;a++)i(o.children[a])};return i(e),r},NX=t=>{if(!t)throw new Error("username can't be blank");return`https://ui-avatars.com/api/?background=e9f3f0&rounded=true&uppercase=true&bold=true&length=1&name=${t}`},uo=Object.create(null);uo.open="0",uo.close="1",uo.ping="2",uo.pong="3",uo.message="4",uo.upgrade="5",uo.noop="6";const E0=Object.create(null);Object.keys(uo).forEach(t=>{E0[uo[t]]=t});const FX={type:"error",data:"parser error"},qX=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",HX=typeof ArrayBuffer=="function",UX=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Y6=({type:t,data:e},r,i)=>qX&&e instanceof Blob?r?i(e):Z6(e,i):HX&&(e instanceof ArrayBuffer||UX(e))?r?i(e):Z6(new Blob([e]),i):i(uo[t]+(e||"")),Z6=(t,e)=>{const r=new FileReader;return r.onload=function(){const i=r.result.split(",")[1];e("b"+i)},r.readAsDataURL(t)},K6="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mh=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let t=0;t<K6.length;t++)mh[K6.charCodeAt(t)]=t;const VX=t=>{let e=t.length*.75,r=t.length,i,o=0,a,u,c,f;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const n=new ArrayBuffer(e),l=new Uint8Array(n);for(i=0;i<r;i+=4)a=mh[t.charCodeAt(i)],u=mh[t.charCodeAt(i+1)],c=mh[t.charCodeAt(i+2)],f=mh[t.charCodeAt(i+3)],l[o++]=a<<2|u>>4,l[o++]=(u&15)<<4|c>>2,l[o++]=(c&3)<<6|f&63;return n},GX=typeof ArrayBuffer=="function",J6=(t,e)=>{if(typeof t!="string")return{type:"message",data:j6(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:XX(t.substring(1),e)}:E0[r]?t.length>1?{type:E0[r],data:t.substring(1)}:{type:E0[r]}:FX},XX=(t,e)=>{if(GX){const r=VX(t);return j6(r,e)}else return{base64:!0,data:t}},j6=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}},e4=String.fromCharCode(30),YX=(t,e)=>{const r=t.length,i=new Array(r);let o=0;t.forEach((a,u)=>{Y6(a,!1,c=>{i[u]=c,++o===r&&e(i.join(e4))})})},ZX=(t,e)=>{const r=t.split(e4),i=[];for(let o=0;o<r.length;o++){const a=J6(r[o],e);if(i.push(a),a.type==="error")break}return i},t4=4;function _r(t){if(t)return KX(t)}function KX(t){for(var e in _r.prototype)t[e]=_r.prototype[e];return t}_r.prototype.on=_r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},_r.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},_r.prototype.off=_r.prototype.removeListener=_r.prototype.removeAllListeners=_r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var i,o=0;o<r.length;o++)if(i=r[o],i===e||i.fn===e){r.splice(o,1);break}return r.length===0&&delete this._callbacks["$"+t],this},_r.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(r){r=r.slice(0);for(var i=0,o=r.length;i<o;++i)r[i].apply(this,e)}return this},_r.prototype.emitReserved=_r.prototype.emit,_r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},_r.prototype.hasListeners=function(t){return!!this.listeners(t).length};const is=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")())();function r4(t,...e){return e.reduce((r,i)=>(t.hasOwnProperty(i)&&(r[i]=t[i]),r),{})}const JX=setTimeout,jX=clearTimeout;function T0(t,e){e.useNativeTimers?(t.setTimeoutFn=JX.bind(is),t.clearTimeoutFn=jX.bind(is)):(t.setTimeoutFn=setTimeout.bind(is),t.clearTimeoutFn=clearTimeout.bind(is))}const eY=1.33;function tY(t){return typeof t=="string"?rY(t):Math.ceil((t.byteLength||t.size)*eY)}function rY(t){let e=0,r=0;for(let i=0,o=t.length;i<o;i++)e=t.charCodeAt(i),e<128?r+=1:e<2048?r+=2:e<55296||e>=57344?r+=3:(i++,r+=4);return r}class nY extends Error{constructor(e,r,i){super(e),this.description=r,this.context=i,this.type="TransportError"}}class n4 extends _r{constructor(e){super(),this.writable=!1,T0(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,r,i){return super.emitReserved("error",new nY(e,r,i)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(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 r=J6(e,this.socket.binaryType);this.onPacket(r)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const i4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),U_=64,iY={};let o4=0,M0=0,a4;function s4(t){let e="";do e=i4[t%U_]+e,t=Math.floor(t/U_);while(t>0);return e}function l4(){const t=s4(+new Date);return t!==a4?(o4=0,a4=t):t+"."+s4(o4++)}for(;M0<U_;M0++)iY[i4[M0]]=M0;function u4(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function oY(t){let e={},r=t.split("&");for(let i=0,o=r.length;i<o;i++){let a=r[i].split("=");e[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e}let c4=!1;try{c4=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch{}const aY=c4;function f4(t){const e=t.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!e||aY))return new XMLHttpRequest}catch{}if(!e)try{return new is[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function sY(){}const lY=function(){return new f4({xdomain:!1}).responseType!=null}();class uY extends n4{constructor(e){if(super(e),this.polling=!1,typeof location!="undefined"){const i=location.protocol==="https:";let o=location.port;o||(o=i?"443":"80"),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||o!==e.port,this.xs=e.secure!==i}const r=e&&e.forceBase64;this.supportsBinary=lY&&!r}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const r=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||r()})),this.writable||(i++,this.once("drain",function(){--i||r()}))}else r()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};ZX(e,this.socket.binaryType).forEach(r),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,YX(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const r=this.opts.secure?"https":"http";let i="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=l4()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(r==="https"&&Number(this.opts.port)!==443||r==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);const o=u4(e),a=this.opts.hostname.indexOf(":")!==-1;return r+"://"+(a?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new co(this.uri(),e)}doWrite(e,r){const i=this.request({method:"POST",data:e});i.on("success",r),i.on("error",(o,a)=>{this.onError("xhr post error",o,a)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,i)=>{this.onError("xhr poll error",r,i)}),this.pollXhr=e}}class co extends _r{constructor(e,r){super(),T0(this,r),this.opts=r,this.method=r.method||"GET",this.uri=e,this.async=r.async!==!1,this.data=r.data!==void 0?r.data:null,this.create()}create(){const e=r4(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const r=this.xhr=new f4(e);try{r.open(this.method,this.uri,this.async);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{}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{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=co.requestsCount++,co.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=sY,e)try{this.xhr.abort()}catch{}typeof document!="undefined"&&delete co.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()}}if(co.requestsCount=0,co.requests={},typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",h4);else if(typeof addEventListener=="function"){const t="onpagehide"in is?"pagehide":"unload";addEventListener(t,h4,!1)}}function h4(){for(let t in co.requests)co.requests.hasOwnProperty(t)&&co.requests[t].abort()}const cY=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0))(),k0=is.WebSocket||is.MozWebSocket,d4=!0,fY="arraybuffer",p4=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class hY extends n4{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),r=this.opts.protocols,i=p4?{}:r4(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=d4&&!p4?r?new k0(e,r):new k0(e):new k0(e,r,i)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType||fY,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 r=0;r<e.length;r++){const i=e[r],o=r===e.length-1;Y6(i,this.supportsBinary,a=>{const u={};try{d4&&this.ws.send(a)}catch{}o&&cY(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const r=this.opts.secure?"wss":"ws";let i="";this.opts.port&&(r==="wss"&&Number(this.opts.port)!==443||r==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=l4()),this.supportsBinary||(e.b64=1);const o=u4(e),a=this.opts.hostname.indexOf(":")!==-1;return r+"://"+(a?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(o.length?"?"+o:"")}check(){return!!k0}}const dY={websocket:hY,polling:uY},pY=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mY=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function V_(t){const e=t,r=t.indexOf("["),i=t.indexOf("]");r!=-1&&i!=-1&&(t=t.substring(0,r)+t.substring(r,i).replace(/:/g,";")+t.substring(i,t.length));let o=pY.exec(t||""),a={},u=14;for(;u--;)a[mY[u]]=o[u]||"";return r!=-1&&i!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=gY(a,a.path),a.queryKey=vY(a,a.query),a}function gY(t,e){const r=/\/{2,9}/g,i=e.replace(r,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&i.splice(0,1),e.substr(e.length-1,1)=="/"&&i.splice(i.length-1,1),i}function vY(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,o,a){o&&(r[o]=a)}),r}class os extends _r{constructor(e,r={}){super(),e&&typeof e=="object"&&(r=e,e=null),e?(e=V_(e),r.hostname=e.host,r.secure=e.protocol==="https"||e.protocol==="wss",r.port=e.port,e.query&&(r.query=e.query)):r.host&&(r.hostname=V_(r.host).host),T0(this,r),this.secure=r.secure!=null?r.secure:typeof location!="undefined"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=r.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=r.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},r),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=oY(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=t4,r.transport=e,this.id&&(r.sid=this.id);const i=Object.assign({},this.opts.transportOptions[e],this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new dY[e](i)}open(){let e;if(this.opts.rememberUpgrade&&os.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}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",r=>this.onClose("transport close",r))}probe(e){let r=this.createTransport(e),i=!1;os.priorWebsocketSuccess=!1;const o=()=>{i||(r.send([{type:"ping",data:"probe"}]),r.once("packet",s=>{if(!i)if(s.type==="pong"&&s.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;os.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(l(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=r.name,this.emitReserved("upgradeError",d)}}))};function a(){i||(i=!0,l(),r.close(),r=null)}const u=s=>{const d=new Error("probe error: "+s);d.transport=r.name,a(),this.emitReserved("upgradeError",d)};function c(){u("transport closed")}function f(){u("socket closed")}function n(s){r&&s.name!==r.name&&a()}const l=()=>{r.removeListener("open",o),r.removeListener("error",u),r.removeListener("close",c),this.off("close",f),this.off("upgrading",n)};r.once("open",o),r.once("error",u),r.once("close",c),this.once("close",f),this.once("upgrading",n),r.open()}onOpen(){if(this.readyState="open",os.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0;const r=this.upgrades.length;for(;e<r;e++)this.probe(this.upgrades[e])}}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.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const r=new Error("server error");r.code=e.data,this.onError(r);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.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),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 r=1;for(let i=0;i<this.writeBuffer.length;i++){const o=this.writeBuffer[i].data;if(o&&(r+=tY(o)),i>0&&r>this.maxPayload)return this.writeBuffer.slice(0,i);r+=2}return this.writeBuffer}write(e,r,i){return this.sendPacket("message",e,r,i),this}send(e,r,i){return this.sendPacket("message",e,r,i),this}sendPacket(e,r,i,o){if(typeof r=="function"&&(o=r,r=void 0),typeof i=="function"&&(o=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const a={type:e,data:r,options:i};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),o&&this.once("flush",o),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},i=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}onError(e){os.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,r){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const r=[];let i=0;const o=e.length;for(;i<o;i++)~this.transports.indexOf(e[i])&&r.push(e[i]);return r}}os.protocol=t4;function yY(t,e="",r){let i=t;r=r||typeof location!="undefined"&&location,t==null&&(t=r.protocol+"//"+r.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=r.protocol+t:t=r.host+t),/^(https?|wss?):\/\//.test(t)||(typeof r!="undefined"?t=r.protocol+"//"+t:t="https://"+t),i=V_(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";const a=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+a+":"+i.port+e,i.href=i.protocol+"://"+a+(r&&r.port===i.port?"":":"+i.port),i}const _Y=typeof ArrayBuffer=="function",OY=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,m4=Object.prototype.toString,wY=typeof Blob=="function"||typeof Blob!="undefined"&&m4.call(Blob)==="[object BlobConstructor]",bY=typeof File=="function"||typeof File!="undefined"&&m4.call(File)==="[object FileConstructor]";function G_(t){return _Y&&(t instanceof ArrayBuffer||OY(t))||wY&&t instanceof Blob||bY&&t instanceof File}function L0(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,i=t.length;r<i;r++)if(L0(t[r]))return!0;return!1}if(G_(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return L0(t.toJSON(),!0);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&L0(t[r]))return!0;return!1}function SY(t){const e=[],r=t.data,i=t;return i.data=X_(r,e),i.attachments=e.length,{packet:i,buffers:e}}function X_(t,e){if(!t)return t;if(G_(t)){const r={_placeholder:!0,num:e.length};return e.push(t),r}else if(Array.isArray(t)){const r=new Array(t.length);for(let i=0;i<t.length;i++)r[i]=X_(t[i],e);return r}else if(typeof t=="object"&&!(t instanceof Date)){const r={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=X_(t[i],e));return r}return t}function xY(t,e){return t.data=Y_(t.data,e),t.attachments=void 0,t}function Y_(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=Y_(t[r],e);else if(typeof t=="object")for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Y_(t[r],e));return t}const CY=5;var ft;(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"})(ft||(ft={}));class PY{constructor(e){this.replacer=e}encode(e){return(e.type===ft.EVENT||e.type===ft.ACK)&&L0(e)?(e.type=e.type===ft.EVENT?ft.BINARY_EVENT:ft.BINARY_ACK,this.encodeAsBinary(e)):[this.encodeAsString(e)]}encodeAsString(e){let r=""+e.type;return(e.type===ft.BINARY_EVENT||e.type===ft.BINARY_ACK)&&(r+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(r+=e.nsp+","),e.id!=null&&(r+=e.id),e.data!=null&&(r+=JSON.stringify(e.data,this.replacer)),r}encodeAsBinary(e){const r=SY(e),i=this.encodeAsString(r.packet),o=r.buffers;return o.unshift(i),o}}class Z_ extends _r{constructor(e){super(),this.reviver=e}add(e){let r;if(typeof e=="string")r=this.decodeString(e),r.type===ft.BINARY_EVENT||r.type===ft.BINARY_ACK?(this.reconstructor=new $Y(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r);else if(G_(e)||e.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(e),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let r=0;const i={type:Number(e.charAt(0))};if(ft[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===ft.BINARY_EVENT||i.type===ft.BINARY_ACK){const a=r+1;for(;e.charAt(++r)!=="-"&&r!=e.length;);const u=e.substring(a,r);if(u!=Number(u)||e.charAt(r)!=="-")throw new Error("Illegal attachments");i.attachments=Number(u)}if(e.charAt(r+1)==="/"){const a=r+1;for(;++r&&!(e.charAt(r)===","||r===e.length););i.nsp=e.substring(a,r)}else i.nsp="/";const o=e.charAt(r+1);if(o!==""&&Number(o)==o){const a=r+1;for(;++r;){const u=e.charAt(r);if(u==null||Number(u)!=u){--r;break}if(r===e.length)break}i.id=Number(e.substring(a,r+1))}if(e.charAt(++r)){const a=this.tryParse(e.substr(r));if(Z_.isPayloadValid(i.type,a))i.data=a;else throw new Error("invalid payload")}return i}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,r){switch(e){case ft.CONNECT:return typeof r=="object";case ft.DISCONNECT:return r===void 0;case ft.CONNECT_ERROR:return typeof r=="string"||typeof r=="object";case ft.EVENT:case ft.BINARY_EVENT:return Array.isArray(r)&&r.length>0;case ft.ACK:case ft.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class $Y{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const r=xY(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var RY=Object.freeze(Object.defineProperty({__proto__:null,protocol:CY,get PacketType(){return ft},Encoder:PY,Decoder:Z_},Symbol.toStringTag,{value:"Module"}));function Ii(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const EY=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class g4 extends _r{constructor(e,r,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=r,i&&i.auth&&(this.auth=i.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ii(e,"open",this.onopen.bind(this)),Ii(e,"packet",this.onpacket.bind(this)),Ii(e,"error",this.onerror.bind(this)),Ii(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,...r){if(EY.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');r.unshift(e);const i={type:ft.EVENT,data:r};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const u=this.ids++,c=r.pop();this._registerAckCallback(u,c),i.id=u}const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!o||!this.connected)||(this.connected?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,r){const i=this.flags.timeout;if(i===void 0){this.acks[e]=r;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);r.call(this,new Error("operation has timed out"))},i);this.acks[e]=(...a)=>{this.io.clearTimeoutFn(o),r.apply(this,[null,...a])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:ft.CONNECT,data:e})}):this.packet({type:ft.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ft.CONNECT:if(e.data&&e.data.sid){const o=e.data.sid;this.onconnect(o)}else 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 ft.EVENT:case ft.BINARY_EVENT:this.onevent(e);break;case ft.ACK:case ft.BINARY_ACK:this.onack(e);break;case ft.DISCONNECT:this.ondisconnect();break;case ft.CONNECT_ERROR:this.destroy();const i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const i of r)i.apply(this,e)}super.emit.apply(this,e)}ack(e){const r=this;let i=!1;return function(...o){i||(i=!0,r.packet({type:ft.ACK,id:e,data:o}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(r.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),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:ft.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 r=this._anyListeners;for(let i=0;i<r.length;i++)if(e===r[i])return r.splice(i,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 r=this._anyOutgoingListeners;for(let i=0;i<r.length;i++)if(e===r[i])return r.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const i of r)i.apply(this,e.data)}}}function Ju(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}Ju.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-r:t+r}return Math.min(t,this.max)|0},Ju.prototype.reset=function(){this.attempts=0},Ju.prototype.setMin=function(t){this.ms=t},Ju.prototype.setMax=function(t){this.max=t},Ju.prototype.setJitter=function(t){this.jitter=t};class K_ extends _r{constructor(e,r){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,T0(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((i=r.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new Ju({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const o=r.parser||RY;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.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 os(this.uri,this.opts);const r=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const o=Ii(r,"open",function(){i.onopen(),e&&e()}),a=Ii(r,"error",u=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",u),e?e(u):i.maybeReconnectOnOpen()});if(this._timeout!==!1){const u=this._timeout;u===0&&o();const c=this.setTimeoutFn(()=>{o(),r.close(),r.emit("error",new Error("timeout"))},u);this.opts.autoUnref&&c.unref(),this.subs.push(function(){clearTimeout(c)})}return this.subs.push(o),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ii(e,"ping",this.onping.bind(this)),Ii(e,"data",this.ondata.bind(this)),Ii(e,"error",this.onerror.bind(this)),Ii(e,"close",this.onclose.bind(this)),Ii(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){this.emitReserved("error",e)}socket(e,r){let i=this.nsps[e];return i||(i=new g4(this,e,r),this.nsps[e]=i),i}_destroy(e){const r=Object.keys(this.nsps);for(const i of r)if(this.nsps[i].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let i=0;i<r.length;i++)this.engine.write(r[i],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"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,r){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),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 r=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(o=>{o?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",o)):e.onreconnect()}))},r);this.opts.autoUnref&&i.unref(),this.subs.push(function(){clearTimeout(i)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const gh={};function A0(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=yY(t,e.path||"/socket.io"),i=r.source,o=r.id,a=r.path,u=gh[o]&&a in gh[o].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||u;let f;return c?f=new K_(i,e):(gh[o]||(gh[o]=new K_(i,e)),f=gh[o]),r.query&&!e.query&&(e.query=r.queryKey),f.socket(r.path,e)}Object.assign(A0,{Manager:K_,Socket:g4,io:A0,connect:A0});const TY="loading",MY="ready",kY="offline",LY="online",AY="statusChanged",DY="lspStatusChanged",IY="playgroundChanged",WY="following",BY="unFollowing",zY="runStatusChanged",QY="ApplicationAvailable",NY="userEnter",FY="userLeave",qY="usersUpdated",HY="connectionBroken",UY="authorizationFailed",J_="errorFromServer",VY="auth";class GY{constructor(e,r=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=i=>this.receive(i),this._messages=[],this._timeout=r}setFilter(e){this._filter=e}send(e,r){const i=new XY(r||this._timeout),o=new Promise((a,u)=>{i._reject=u,i._resolve=a});return this._messages.push(i),this.channel.postMessage({id:this._messageId++,type:"request",payload:e}),o}answer(e,r){this.channel.postMessage({id:e,type:"response",payload:r})}receive(e){const r=e.data;r.type==="request"?(!this._filter||this._filter(r.payload))&&this.answer(r.id,{active:!0}):r.type==="response"&&this._messages[r.id].reject(r.payload)}}class XY{constructor(e){Tt(this,"_resolve");Tt(this,"_reject");Tt(this,"_interval");this._interval=setTimeout(()=>this.resolve({active:!1,reason:"timeout, no one uses it"}),e)}resolve(e){clearTimeout(this._interval),this._resolve(e)}reject(e){this._reject(e)}}const v4=new GY("dao-paas",500);let y4;async function YY(){let t="";v4.setFilter(i=>i.id===t);const e=JSON.parse(localStorage.getItem("agentUsers")||"[]")||[],r=[];for(const i of e){const o=v4.send(i).then(()=>{if(t==="")return i.time=new Date().getTime(),t=i.id,localStorage.setItem("agentUsers",JSON.stringify(e)),Promise.resolve(t)});r.push(o)}return Promise.any(r)}function ZY(t){const e=JSON.parse(localStorage.getItem("agentUsers")||"[]")||[],r=e.find(i=>i.id==t);r?r.time=new Date().getTime():e.push({id:t,time:new Date().getTime()}),localStorage.setItem("agentUsers",JSON.stringify(e)),y4=t}function KY(t){return t===y4}class JY{constructor(e,r,i=10){Tt(this,"socket");Tt(this,"ioPath");Tt(this,"authOptions");Tt(this,"heartbeatInterval",null);Tt(this,"maxReconnectionAttemps");Tt(this,"onMessage");Tt(this,"onError");this.ioPath=e,this.authOptions=r,this.maxReconnectionAttemps=i}setOnMessage(e){this.onMessage=e}setOnError(e){this.onError=e}startChannel(){if(this.socket&&this.socket.connected){console.warn("The connection is already established.");return}this.connect()}connect(){Ee.dao.appStatus()==="drafted"&&this.transitionLoading(),this.socket=A0(this.ioPath,{reconnectionAttempts:10,reconnectionDelayMax:1e4,transports:["websocket"]}),this.registerEventsOnSocket(),this.socket.on("connect",()=>{this.authorize(),Ee.dao.isReadyOffline()&&this.transitionOnline()}),this.socket.on("disconnect",()=>{kt.dao._channelAvailable(!1),this.clearHeartbeatInterval(),Ee.dao.isReady()&&this.transitionOffline()}),this.socket.io.on("reconnect_attempt",e=>{e>=this.maxReconnectionAttemps&&this.transitionError(HY,"Reconnection attemps exceeds the maximum times")}),this.socket.on("authAck",({result:e,data:r,error:i})=>{if(!e){this.transitionError(UY,i);return}const{agentUserId:o}=r;if(ZY(o),!KY(o))throw new Error(`The agentUserId ${o} is inconsistent`);this.setHeartbeatInterval(),this.authOptions.agentUserId=o,this.updateCurrentAgentUserId(o),kt.dao._channelAvailable(!0)})}authorize(){this.send(VY,this.authOptions)}registerEventsOnSocket(){if(!this.socket)throw new Error("The connection has not been established yet.");this.socket.on("syncPlaygroundInfo",e=>{if(e.playgroundIDEServerStatus==="ERROR"){this.transitionError(J_,e.playgroundIDEServerStatusReason);return}if(Ee.dao.appStatus()==="loading"){this.initAppStatusLoadingPlaygroundInfo(e);return}if(Ee.dao.isReady()){this.changeAppStatusReadyPlaygroundInfo(e);return}console.warn("syncPlaygroundInfo event happened at a wrong appStatus")}),this.socket.on("active",e=>{const{success:r,reason:i}=e,o={SUCCESS:"\u6210\u529F",PLAYGROUND_NOT_EXISTED:"playground\u4E0D\u5B58\u5728",DOCKER_NOT_BIND:"playground\u672A\u7ED1\u5B9A\u5BB9\u5668",DOCKER_START_FAIL:"\u5BB9\u5668\u542F\u52A8\u5931\u8D25",RESOURCE_NOT_ENOUG:"\u670D\u52A1\u5668\u8D44\u6E90\u4E0D\u8DB3",BUSY:"\u670D\u52A1\u5668\u7E41\u5FD9"};r||this.transitionError(J_,`\u542F\u52A8\u5931\u8D25: ${o[i]||i}`)}),this.socket.on("following",e=>{const{agentUsers:r}=Ee.dao.playgroundInfo(),i=r.findIndex(o=>o.userId===e.agentUserId);i>-1&&(r[i]=e),this.updatePlaygroundInfoPartial({agentUsers:r}),this.trigger("message",{name:WY,payload:{user:e}})}),this.socket.on("unFollowing",e=>{const{agentUsers:r}=Ee.dao.playgroundInfo(),i=r.findIndex(o=>o.userId===e.agentUserId);i>-1&&(r[i]=e),this.updatePlaygroundInfoPartial({agentUsers:r}),this.trigger("message",{name:BY,payload:{user:e}})}),this.socket.on("runStatus",e=>{const{status:r,runResult:i}=e,{dockerInfo:o}=Ee.dao.playgroundInfo();if(o.runStatus===r){console.debug("runStatus event is the same, ignored");return}this.updatePlaygroundInfoPartial({dockerInfo:Ve(xe({},o),{runStatus:r})}),this.trigger("message",{name:zY,payload:{status:r,runResult:i}})}),this.socket.on("lspStatus",e=>{const{dockerInfo:r}=Ee.dao.playgroundInfo(),i=r.lspStatus,{status:o}=e;if(i===o){console.debug("lspStatus event is the same, ignored");return}this.updatePlaygroundInfoPartial({dockerInfo:Ve(xe({},r),{lspStatus:o})}),this.trigger("message",{name:DY,payload:{status:o}})}),this.socket.on("folderEvent",e=>{this.updateCRDTInfo(e)}),this.socket.on("fileContent",e=>{const r=Ee.dao.currentAgentUserId(),i=kt.currentDoc.switchDoc,o=Ee.dao.currentAgentUser(),a=kt.dao.updateAgentUser,u=e.file;this.updateCRDTInfo(e),(e.agentUserId===r||o.followingAgentUserId===e.agentUserId)&&i(u),a(e.agentUserId,{fileOpened:e.file.path}),o.followingAgentUserId&&a(r,{fileOpened:e.file.path})}),this.socket.on("userEnter",e=>{Ee.dao.getAgentUserById(e.agentUserId)?kt.dao.updateAgentUser(e.agentUserId,e):kt.dao.addAgentUser(e),this.trigger("message",{name:NY,payload:{agentUser:e}})}),this.socket.on("userLeave",e=>{kt.dao.updateAgentUser(e.agentUserId,e),this.trigger("message",{name:FY,payload:{agentUser:e}})}),this.socket.on("usersUpdated",e=>{this.updatePlaygroundInfoPartial({agentUsers:e}),this.trigger("message",{name:qY,payload:{agentUsers:e}})}),this.socket.on("sendAddedFile",e=>{console.debug(e)}),this.socket.on("fileNode",e=>{kt.fileTree.switchFileTree(e),this.updatePlaygroundInfoPartial({fileTree:e})}),this.socket.on("console",e=>{this.updateCRDTInfo(e)}),this.socket.on("terminal",e=>{this.updateCRDTInfo(e)}),this.socket.on("portOpen",()=>{this.trigger("message",{name:QY})}),this.socket.on("getReplayInfo",e=>{}),this.socket.onAny((e,r)=>{console.debug(`<< ${e}`)}),this.socket.on("errorHandler",e=>{this.transitionError(J_,`${e.name}: ${e.message}`)})}initAppStatusLoadingPlaygroundInfo(e){kt.dao.setPlaygroundInfo(e),e.playgroundIDEServerStatus==="SYNCED"&&this.transitionReady()}changeAppStatusReadyPlaygroundInfo(e){const r=Ee.dao.playgroundInfo().status,i=Ee.dao.playgroundInfo().dockerInfo.dockerId;kt.dao.setPlaygroundInfo(e),e.status!=r&&this.trigger("message",{name:AY,payload:{status:e.status}}),e.dockerInfo.dockerId&&e.dockerInfo.dockerId!==i&&this.trigger("message",{name:IY})}transitionOnline(){kt.dao.transitionOnline(),this.trigger("message",{name:LY})}transitionOffline(){kt.dao.transitionOffline(),this.trigger("message",{name:kY})}transitionLoading(){kt.dao.transitionLoading(),this.trigger("message",{name:TY})}transitionReady(){kt.dao.transitionReady(),this.trigger("message",{name:MY})}transitionError(e,r){kt.dao.transitionError(),this.trigger("error",{name:e,error:r}),this.closeChannel()}updatePlaygroundInfoPartial(e){kt.dao.setPlaygroundInfo(xe(xe({},Ee.dao.playgroundInfo()),e))}updateCurrentAgentUserId(e){kt.dao.currentAgentUserId(e)}updateCRDTInfo(e){kt.dao.setCRDTInfo(e)}trigger(e,r){if(console.debug(`<trigger: ${r.name}`),e==="error"){this.onError&&this.onError(r);return}this.onMessage&&this.onMessage(r)}clearHeartbeatInterval(){this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null)}setHeartbeatInterval(){this.heartbeatInterval=setInterval(()=>{this.heartbeat()},6e4)}active(){this.send("active")}run(){this.send("run")}stop(){this.send("stop")}fileContent(e){this.send("fileContent",e)}editFile(e){this.send("editFile",e)}fileDir(e){this.send("fileDir",e)}fileTreeOp(e){this.send("fileTreeOp",e)}terminal(e){this.send("terminal",e)}cursor(e){this.send("cursor",e)}heartbeat(){this.send("heartbeat")}getReplayInfo(){this.send("getReplayInfo")}followingAgentUser(e){this.send("followingAgentUser",e)}featureConfig(e){this.send("setFeaturesConfig",e)}setFileLockStatus(e){this.send("setFileLockStatus",e)}setFileVisiable(e){this.send("setFileVisiable",e)}addFileToUnitTest(e){this.send("addFileToUnitTest",e)}removeFileFromUnitTest(e){this.send("removeFileFromUnitTest",e)}followingFocusComponent(e){const r=Ee.dao.currentAgentUser();!r||r.focusComponent!==e&&(r.followingAgentUserId||this.send("followingFocusComponent",e))}followingEditorScroll(e){const r=Ee.dao.currentAgentUser();r!=null&&r.followingAgentUserId||this.send("followingEditorScroll",e)}unFollowingAgentUser(){this.send("unFollowingAgentUser")}send(e,r={}){if(!this.socket)throw new Error("socket is not ready");console.debug(`>> ${e}`),this.socket.emit(e,r)}on(e,r){if(!this.socket)throw new Error("socket is not ready");this.socket.on(e,r)}off(e){if(!this.socket)throw new Error("socket is not ready");this.socket.off(e)}isReady(){var e;return(e=this.socket)==null?void 0:e.connected}closeChannel(){var e,r;console.debug("close Channel..."),this.clearHeartbeatInterval(),(e=this.socket)==null||e.removeAllListeners(),(r=this.socket)==null||r.close(),this.socket=void 0}}var mRe="";const jY=Xu(async()=>(await Promise.resolve().then(function(){return YOe})).FileTree),eZ=Xu(async()=>(await Promise.resolve().then(function(){return OCe})).Editor),tZ=Xu(async()=>(await Promise.resolve().then(function(){return u6e})).default),rZ=Xu(async()=>(await Promise.resolve().then(function(){return h6e})).default),nZ=Xu(async()=>(await Promise.resolve().then(function(){return m6e})).default);class iZ{constructor(e){Tt(this,"components",{Tree:null,Editor:null,Console:null,Browser:null,Shell:null});Tt(this,"paasOptions");Tt(this,"paasDomainPath");Tt(this,"sdkVersion");Tt(this,"isRendered",!1);Tt(this,"_onMessage");Tt(this,"_onError");this.sdkVersion=BX(),this.setPaasOptionsWithDefaultAvatar(e),this.setPaasDomainPathWithDefaultOrigin(e.paasDomain),this.init()}setPaasOptionsWithDefaultAvatar(e){this.paasOptions=e,this.paasOptions.userInfo.avatarUrl||(this.paasOptions.userInfo.avatarUrl=NX(this.paasOptions.userInfo.username))}setPaasDomainPathWithDefaultOrigin(e){this.paasDomainPath={}.PAAS_MANAGER_API_ORIGIN||"https://www.1024paas.com",e&&(this.paasDomainPath=e)}get playgroundStatus(){return Ee.dao.playgroundInfo().status}get dockerStatus(){var e;return(e=Ee.dao.playgroundInfo().dockerInfo)==null?void 0:e.runStatus}get currentAgentUser(){return Ee.dao.currentAgentUser()}get agentUsers(){return Ee.dao.playgroundInfo().agentUsers}get playgroundInfo(){return Ee.dao.playgroundInfo()}get currentFollowingAgentUser(){return Ee.dao.getFollowingAgentUser()}followUser(e){const r={timestamp:Date.now(),agentUserId:this.currentAgentUser.agentUserId,file:{action:"Get",path:this.currentAgentUser.fileOpened}};Ee.dao.channel().send("fileContent",r),Ee.dao.channel().followingAgentUser(e)}unFollowUser(){Ee.dao.channel().unFollowingAgentUser()}replay(){}activePlayground(){Ee.dao.channel().send("active")}runPlayground(){Ee.dao.channel().send("run")}stopPlayground(){Ee.dao.channel().send("stop")}onUploadFile(e){Ee.dao.channel().send("upload",e)}async init(){console.debug(`sdk: init with ${this.paasDomainPath} passDomain`);const e=await zX(this.paasDomainPath,this.paasOptions.ticket,this.sdkVersion);let r;try{r=await YY()}catch{}const i=new JY(e,Ve(xe({},this.paasOptions),{agentUserId:r}));this._onMessage&&i.setOnMessage(this._onMessage),this._onError&&i.setOnError(this._onError),kt.dao.reset(),kt.dao.setChannel(i),i.startChannel()}set onMessage(e){var r;this._onMessage=e,(r=Ee.dao.channel())==null||r.setOnMessage(e)}set onError(e){var r;this._onError=e,(r=Ee.dao.channel())==null||r.setOnError(e)}initComponent(e,r,i){const o=u=>{switch(e){case"Tree":return ne(jY,xe({},u));case"Editor":return ne(eZ,xe({},u));case"Browser":return ne(rZ,xe({},u));case"Console":return ne(tZ,xe({},u));case"Shell":return ne(nZ,xe({},u));default:throw new Error("wrong component name")}};this.components[e]={reactComponent:o,container:r,props:i};const a=document.querySelector(r);tl.exports.render(ne($.exports.Suspense,{fallback:ne(IX,{}),children:ne(o,xe({},i))}),a)}mapRender(e){e.forEach((r,i)=>{const{item:o,container:a,props:u}=r;this.initComponent(o,a,u)})}dispose(){var e;console.debug("destroy components...",this.components),(e=Ee.dao._channel())==null||e.closeChannel(),kt.dao.setChannel(null),kt.dao.reset();for(const[r,i]of Object.entries(this.components)){if(!i)break;const o=document.querySelector(i.container);if(o){const a=tl.exports.unmountComponentAtNode(o);console.debug(`destroy unmount: ${i.container}, ${a}`)}}}}var na;(function(t){t.DoubleClickItemToExpand="double-click-item-to-expand",t.ClickItemToExpand="click-item-to-expand",t.ClickArrowToExpand="click-arrow-to-expand"})(na||(na={}));var D0=globalThis&&globalThis.__assign||function(){return D0=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},D0.apply(this,arguments)},oZ=function(t,e){return{mode:t.mode,createInteractiveElementProps:function(r,i,o,a){return D0(D0({},e.createInteractiveElementProps(r,i,o,a)),t.createInteractiveElementProps(r,i,o,a))}}},aZ=function(){function t(e){this.mode=na.DoubleClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,r,i,o){var a=this;return{onClick:function(u){i.focusItem(),u.shiftKey?i.selectUpTo():u.ctrlKey?o.isSelected?i.unselectItem():i.addToSelectedItems():i.selectItem()},onDoubleClick:function(){i.focusItem(),i.selectItem(),e.hasChildren&&i.toggleExpandedState(),(!e.hasChildren||a.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction()},onFocus:function(){i.focusItem()},onDragStart:function(u){u.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(u){u.preventDefault()},draggable:o.canDrag&&!o.isRenaming,tabIndex:o.isRenaming?void 0:o.isFocused?0:-1}},t}(),sZ=function(){function t(e){this.mode=na.ClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,r,i,o){var a=this;return{onClick:function(u){i.focusItem(),u.shiftKey?i.selectUpTo():u.ctrlKey?o.isSelected?i.unselectItem():i.addToSelectedItems():(e.hasChildren&&i.toggleExpandedState(),i.selectItem(),(!e.hasChildren||a.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction())},onFocus:function(){i.focusItem()},onDragStart:function(u){u.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(u){u.preventDefault()},draggable:o.canDrag&&!o.isRenaming,tabIndex:o.isRenaming?void 0:o.isFocused?0:-1}},t}(),lZ=function(){function t(e){this.mode=na.ClickItemToExpand,this.environment=e}return t.prototype.createInteractiveElementProps=function(e,r,i,o){var a=this;return{onClick:function(u){i.focusItem(),u.shiftKey?i.selectUpTo():u.ctrlKey?o.isSelected?i.unselectItem():i.addToSelectedItems():(i.selectItem(),(!e.hasChildren||a.environment.canInvokePrimaryActionOnItemContainer)&&i.primaryAction())},onFocus:function(){i.focusItem()},onDragStart:function(u){u.dataTransfer.dropEffect="move",i.startDragging()},onDragOver:function(u){u.preventDefault()},draggable:o.canDrag&&!o.isRenaming,tabIndex:o.isRenaming?void 0:o.isFocused?0:-1}},t}(),_4=function(t,e){switch(t){case na.DoubleClickItemToExpand:return new aZ(e);case na.ClickItemToExpand:return new sZ(e);case na.ClickArrowToExpand:return new lZ(e);default:throw Error("Unknown interaction mode "+t)}},O4=$.exports.createContext(null),uZ=function(){return $.exports.useContext(O4)},cZ=function(t){var e=Wt(),r=e.defaultInteractionMode,i=$.exports.useMemo(function(){var o;return r&&typeof r!="string"?r.extends?oZ(r,_4(r.extends,e)):r:_4((o=r)!==null&&o!==void 0?o:na.ClickItemToExpand,e)},[]);return $.exports.createElement(O4.Provider,{value:i},t.children)},w4=function(){var t=Wt();return $.exports.useCallback(function(e,r){for(var i=t.linearItems[r],o=i[e].depth,a=e;!!i[a]&&i[a].depth!==o-1;a--);var u=i[a];return u||(u={item:t.trees[r].rootItem,depth:0},a=0),u},[t.linearItems,t.trees])},fZ=function(t,e){return t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom},hZ=function(t,e,r,i,o){var a=(t-e)/r,u=Math.floor(a),c=void 0,f=i||o?.2:.5;return a%1<f?c="top":a%1>1-f&&(c="bottom"),{linearIndex:u,offset:c}},dZ=function(t,e,r,i,o){var a=Wt(),u=a.canDropOnItemWithChildren,c=a.canDropOnItemWithoutChildren,f=a.canDragAndDrop,n=a.linearItems,l=a.items,s=a.canReorderItems,d=a.viewState,h=w4();return $.exports.useCallback(function(p,b,O){var v,g,_,w;if(!!f&&!!O.current&&!(p.clientX<0||p.clientY<0)){var S=O.current.getBoundingClientRect(),C=fZ(p,S),P=hZ(p.clientY,S.top,r,u,c),M=P.linearIndex,T=P.offset,E=C?"outside":""+b+M+(T!=null?T:"");if(t!==E){if(e(E),C){i(void 0);return}if(M<0||M>=n[b].length){i(void 0);return}var k=n[b][M],I=k.depth,L=l[k.item];if(!T&&!c&&!L.hasChildren){i(void 0);return}if(!T&&!u&&L.hasChildren){i(void 0);return}if(T&&!s){i(void 0);return}var V=h(M,b);if(!(!((g=(v=d[b])===null||v===void 0?void 0:v.selectedItems)===null||g===void 0)&&g.includes(k.item))){var Q=l[V.item].children.indexOf(k.item)+(T==="top"?0:1);T==="top"&&I===((w=(_=n[b][M-1])===null||_===void 0?void 0:_.depth)!==null&&w!==void 0?w:-1)&&(T="bottom",M-=1);var A;T?A={targetType:"between-items",treeId:b,parentItem:V.item,depth:k.depth,linearIndex:M+(T==="top"?0:1),childIndex:Q,linePosition:T}:A={targetType:"item",treeId:b,parentItem:V.item,targetItem:k.item,depth:k.depth,linearIndex:M},o(A)}}}},[f,u,c,s,h,r,l,t,n,i,o,e,d])},b4=function(){var t=Wt();return $.exports.useCallback(function(e,r){if(e.targetType==="between-items"){if(!t.canReorderItems)return!1}else{var i=t.items[e.targetItem];if(!t.canDropOnItemWithChildren&&i.hasChildren||!t.canDropOnItemWithoutChildren&&!i.hasChildren)return!1}return!(t.canDropAt&&(!r||!t.canDropAt(r,e)))},[t])},S4=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,i=e.length,o=t.length;r<i;r++,o++)t[o]=e[r];return t},pZ=function(){var t=Wt(),e=w4(),r=b4();return $.exports.useCallback(function(i,o){var a=t.linearItems[i];return a.map(function(u,c){var f,n,l=u.item,s=u.depth,d=e(c,i),h=t.items[d.item].children.indexOf(l),p={targetType:"item",parentItem:d.item,targetItem:l,linearIndex:c,depth:s,treeId:i},b={targetType:"between-items",parentItem:d.item,linePosition:"top",childIndex:h,depth:s,treeId:i,linearIndex:c},O={targetType:"between-items",parentItem:d.item,linePosition:"bottom",linearIndex:c+1,childIndex:h+1,depth:s,treeId:i},v=s===((n=(f=a[c-1])===null||f===void 0?void 0:f.depth)!==null&&n!==void 0?n:-1);return v?[p,O]:[b,p,O]}).reduce(function(u,c){return S4(S4([],u),c)},[]).filter(function(u){return r(u,o)})},[r,t.items,t.linearItems,e])},I0=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,i=e.length,o=t.length;r<i;r++,o++)t[o]=e[r];return t},W0=function(t,e,r){var i=$.exports.useRef();$.exports.useEffect(function(){if(!i.current)i.current=I0([],r),t();else{var o=i.current.some(function(a,u){return a!==r[u]});o&&(i.current=I0([],r),t())}},I0(I0([],e),r))},B0=globalThis&&globalThis.__assign||function(){return B0=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},B0.apply(this,arguments)},x4=function(t,e){return t.map(function(r){return[r,e(r)]}).reduce(function(r,i){var o,a=i[0],u=i[1];return B0(B0({},r),(o={},o[a]=u,o))},{})};function ju(){var t=$.exports.useRef(new Array);$.exports.useEffect(function(){var r=t.current;return function(){return r.forEach(function(i){return cancelAnimationFrame(i)})}},[t]);var e=$.exports.useCallback(function(r){var i=requestAnimationFrame(function(){t.current.splice(t.current.indexOf(i),1),r()});t.current.push(i)},[t]);return e}var C4=$.exports.createContext(null),fo=function(){return $.exports.useContext(C4)},mZ=function(t){var e=Wt(),r=$.exports.useState(!1),i=r[0],o=r[1],a=$.exports.useState(4),u=a[0],c=a[1],f=$.exports.useState({}),n=f[0],l=f[1],s=$.exports.useState(0),d=s[0],h=s[1],p=$.exports.useState(),b=p[0],O=p[1],v=$.exports.useState(),g=v[0],_=v[1],w=$.exports.useState("_nodrag"),S=w[0],C=w[1],P=pZ(),M=ju();$.exports.useRef(!1);var T=$.exports.useCallback(function(se,le){var we;if(e.activeTreeId&&((we=e.viewState[e.activeTreeId])===null||we===void 0?void 0:we.focusedItem)&&e.linearItems&&le){var B=e.viewState[e.activeTreeId].focusedItem,oe=P(e.activeTreeId,le),N=oe.findIndex(function(U){if(U.targetType==="item")return U.targetItem===B;if(U.targetType==="between-items")return e.items[U.parentItem].children[U.childIndex]===B});h(N?Math.min(N+1,oe.length-1):0)}else h(0)},[e.activeTreeId,e.items,e.linearItems,e.viewState,P]),E=$.exports.useCallback(function(){o(!1),c(4),l({}),h(0),O(void 0),_(void 0),C("_nodrag")},[]);W0(function(){e.activeTreeId&&e.linearItems[e.activeTreeId]&&n[e.activeTreeId]&&T(n[e.activeTreeId],b)},[b,e.activeTreeId,e.linearItems,T,n],[e.activeTreeId]),W0(function(){i&&e.activeTreeId&&_(n[e.activeTreeId][d])},[d,e.activeTreeId,i,n],[d,e.activeTreeId]);var k=b4(),I=function(se){var le;b&&!k(se,b)||(_(se),e.setActiveTree(se.treeId),b&&e.activeTreeId!==se.treeId&&((le=e.onSelectItems)===null||le===void 0||le.call(e,b.map(function(we){return we.index}),se.treeId)))},L=dZ(S,C,u,_,I),V=$.exports.useCallback(function(){b&&g&&e.onDrop&&(e.onDrop(b,g),M(function(){var se;(se=e.onFocusItem)===null||se===void 0||se.call(e,b[0],g.treeId),E()}))},[b,g,e,E,M]),Q=$.exports.useCallback(function(se,le){var we,B,oe=x4(e.treeIds,function(U){return P(U,se)}),N=(B=(we=document.querySelector('[data-rct-tree="'+le+'"] [data-rct-item-container="true"]'))===null||we===void 0?void 0:we.offsetHeight)!==null&&B!==void 0?B:5;c(N),O(se),l(oe),e.activeTreeId&&T(oe[e.activeTreeId],se)},[e.activeTreeId,e.treeIds,P,T]),A=$.exports.useCallback(function(){var se,le,we;if(!!e.canDragAndDrop&&e.activeTreeId){var B=(le=(se=e.viewState[e.activeTreeId])===null||se===void 0?void 0:se.selectedItems)!==null&&le!==void 0?le:[(we=e.viewState[e.activeTreeId])===null||we===void 0?void 0:we.focusedItem];if(B.length===0||B[0]===void 0)return;var oe=B.map(function(N){return e.items[N]});if(e.canDrag&&!e.canDrag(oe))return;Q(oe,e.activeTreeId),setTimeout(function(){o(!0)})}},[Q,e]),W=$.exports.useCallback(function(){E()},[E]),H=$.exports.useCallback(function(){V(),E()},[V,E]),X=$.exports.useCallback(function(){h(function(se){return Math.max(0,se-1)})},[]),ae=$.exports.useCallback(function(){e.activeTreeId&&h(function(se){return Math.min(n[e.activeTreeId].length,se+1)})},[e.activeTreeId,n]),Y={onStartDraggingItems:Q,startProgrammaticDrag:A,abortProgrammaticDrag:W,completeProgrammaticDrag:H,programmaticDragUp:X,programmaticDragDown:ae,draggingItems:b,draggingPosition:g,itemHeight:u,isProgrammaticallyDragging:i,onDragOverTreeHandler:L,viableDragPositions:n};return $.exports.useEffect(function(){return window.addEventListener("dragend",E),window.addEventListener("drop",V),function(){window.removeEventListener("dragend",E),window.removeEventListener("drop",V)}},[V,E]),$.exports.createElement(C4.Provider,{value:Y},t.children)},vh=globalThis&&globalThis.__assign||function(){return vh=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},vh.apply(this,arguments)},gZ=function(t,e){var r=Wt(),i=fo();$.exports.useImperativeHandle(t,function(){return vh(vh(vh({},e),r),{treeEnvironmentContext:r,dragAndDropContext:i})})},P4=globalThis&&globalThis.__spreadArray||function(t,e){for(var r=0,i=e.length,o=t.length;r<i;r++,o++)t[o]=e[r];return t},$4=$.exports.createContext(null),vZ=function(){return $.exports.useContext($4)},yZ=$.exports.forwardRef(function(t,e){var r=Wt(),i=r.onCollapseItem,o=r.items;r.trees;var a=r.viewState,u=r.onExpandItem,c=r.onFocusItem,f=r.setActiveTree,n=r.onRenameItem,l=r.onSelectItems,s=r.onPrimaryAction,d=r.linearItems,h=fo(),p=h.abortProgrammaticDrag,b=h.completeProgrammaticDrag,O=h.programmaticDragDown,v=h.programmaticDragUp,g=h.startProgrammaticDrag,_={abortProgrammaticDrag:$.exports.useCallback(function(){p()},[p]),collapseItem:$.exports.useCallback(function(w,S){i==null||i(o[w],S)},[o,i]),completeProgrammaticDrag:$.exports.useCallback(function(){b()},[b]),expandItem:$.exports.useCallback(function(w,S){u==null||u(o[w],S)},[o,u]),focusItem:$.exports.useCallback(function(w,S){c==null||c(o[w],S)},[o,c]),focusTree:$.exports.useCallback(function(w,S){S===void 0&&(S=!0),f(w,S)},[f]),moveFocusDown:$.exports.useCallback(function(w){var S=d[w],C=S.findIndex(function(T){var E,k=T.item;return k===((E=a[w])===null||E===void 0?void 0:E.focusedItem)}),P=C!==void 0?Math.min(S.length-1,C+1):0,M=o[S[P].item];c==null||c(M,w)},[o,d,c,a]),moveFocusUp:$.exports.useCallback(function(w){var S=d[w],C=S.findIndex(function(T){var E,k=T.item;return k===((E=a[w])===null||E===void 0?void 0:E.focusedItem)}),P=C!==void 0?Math.max(0,C-1):0,M=o[S[P].item];c==null||c(M,w)},[o,d,c,a]),moveProgrammaticDragPositionDown:$.exports.useCallback(function(){O()},[O]),moveProgrammaticDragPositionUp:$.exports.useCallback(function(){v()},[v]),renameItem:$.exports.useCallback(function(w,S,C){n==null||n(o[w],S,C)},[o,n]),selectItems:$.exports.useCallback(function(w,S){l==null||l(w,S)},[l]),startProgrammaticDrag:$.exports.useCallback(function(){g()},[g]),toggleItemExpandedState:$.exports.useCallback(function(w,S){var C,P;!((P=(C=a[S])===null||C===void 0?void 0:C.expandedItems)===null||P===void 0)&&P.includes(w)?i==null||i(o[w],S):u==null||u(o[w],S)},[o,i,u,a]),toggleItemSelectStatus:$.exports.useCallback(function(w,S){var C,P,M,T,E;!((P=(C=a[S])===null||C===void 0?void 0:C.selectedItems)===null||P===void 0)&&P.includes(w)?l==null||l((T=(M=a[S].selectedItems)===null||M===void 0?void 0:M.filter(function(k){return k!==w}))!==null&&T!==void 0?T:[],S):l==null||l(P4(P4([],(E=a[S].selectedItems)!==null&&E!==void 0?E:[]),[w]),S)},[l,a]),invokePrimaryAction:$.exports.useCallback(function(w,S){s==null||s(o[w],S)},[o,s])};return gZ(e,_),$.exports.createElement($4.Provider,{value:_},t.children)}),_Z=function(t){if(!!t)if(t.scrollIntoViewIfNeeded)t.scrollIntoViewIfNeeded();else{var e=t.getBoundingClientRect(),r=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth);r||t.scrollIntoView()}},zn=globalThis&&globalThis.__assign||function(){return zn=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},zn.apply(this,arguments)},as=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.filter(function(r){return!!r}).join(" ")},OZ=function(t){return{renderItemTitle:function(e){var r=e.title,i=e.context,o=e.info;if(!o.isSearching||!i.isSearchMatching)return ge.createElement(ge.Fragment,null,r);var a=r.toLowerCase().indexOf(o.search.toLowerCase());return ge.createElement(ge.Fragment,null,a>0&&ge.createElement("span",null,r.slice(0,a)),ge.createElement("span",{className:"rct-tree-item-search-highlight"},r.slice(a,a+o.search.length)),a+o.search.length<r.length&&ge.createElement("span",null,r.slice(a+o.search.length,r.length)))},renderItemArrow:function(e){var r=e.item,i=e.context;return ge.createElement("div",zn({className:as(r.hasChildren&&"rct-tree-item-arrow-hasChildren","rct-tree-item-arrow")},i.arrowProps),r.hasChildren&&(i.isExpanded?ge.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},ge.createElement("g",null,ge.createElement("g",null,ge.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:`M12,5c-0.28,0-0.53,0.11-0.71,0.29L8,8.59L4.71,5.29C4.53,5.11,4.28,5,4,5
232
232
  C3.45,5,3,5.45,3,6c0,0.28,0.11,0.53,0.29,0.71l4,4C7.47,10.89,7.72,11,8,11s0.53-0.11,0.71-0.29l4-4C12.89,6.53,13,6.28,13,6
233
233
  C13,5.45,12.55,5,12,5z`,className:"rct-tree-item-arrow-path"})))):ge.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 16 16",enableBackground:"new 0 0 16 16",xmlSpace:"preserve"},ge.createElement("g",null,ge.createElement("g",null,ge.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:`M10.71,7.29l-4-4C6.53,3.11,6.28,3,6,3C5.45,3,5,3.45,5,4
234
234
  c0,0.28,0.11,0.53,0.29,0.71L8.59,8l-3.29,3.29C5.11,11.47,5,11.72,5,12c0,0.55,0.45,1,1,1c0.28,0,0.53-0.11,0.71-0.29l4-4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dao42/d42paas-front",
3
- "version": "0.9.13",
3
+ "version": "0.9.14",
4
4
  "description": "d42paas front",
5
5
  "author": "dao42 paas team",
6
6
  "homepage": "https://github.com/dao42/d42paas_frontend#readme",