comp-hub 0.42.5 → 0.42.7

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.
Files changed (193) hide show
  1. package/README.md +133 -133
  2. package/bin/cli.js +58 -58
  3. package/bin/lib/commands.js +173 -173
  4. package/bin/lib/constants.js +22 -22
  5. package/bin/lib/http.js +130 -130
  6. package/bin/lib/startup.js +254 -254
  7. package/bin/lib/utils.js +112 -112
  8. package/dist/index.js +2 -2
  9. package/dist/master.js +1 -1
  10. package/dist/website/container/assets/index-BIcqvqGy.js +33 -0
  11. package/dist/website/container/assets/index-BmW7jge6.css +1 -0
  12. package/dist/website/container/index.html +35 -35
  13. package/dist/website/container/js/react-jsx-loader.js +232 -232
  14. package/dist/website/container/js/vue2-sfc-loader.js +260 -260
  15. package/dist/website/container/js/vue3-sfc-loader.js +289 -289
  16. package/dist/website/item/assets/index-CfkvQ31V.css +1 -0
  17. package/dist/website/item/assets/{index-ydOZoQ8L.js → index-DDuyXuC_.js} +32 -32
  18. package/dist/website/item/index.html +30 -30
  19. package/dist/website/main/assets/AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-D-jhE3yA.js +1 -0
  20. package/dist/website/main/assets/BaseBadge-Dwav8-_V.js +1 -0
  21. package/dist/website/main/assets/{BaseBadge-Cs4OMkMY.css → BaseBadge-ledSuDnX.css} +1 -1
  22. package/dist/website/main/assets/BaseDialog.vue_vue_type_script_setup_true_lang-BK7dbjCA.js +1 -0
  23. package/dist/website/main/assets/BaseSegmented.vue_vue_type_script_setup_true_lang-CcSntY2B.js +1 -0
  24. package/dist/website/main/assets/CanvasAnimation.vue_vue_type_script_setup_true_lang-Br1ZlT-C.js +1 -0
  25. package/dist/website/main/assets/{CodeMirrorEditor-Cqow8ROO-Cp4gUJc9.js → CodeMirrorEditor-Cqow8ROO-D5a3bJrn.js} +3 -3
  26. package/dist/website/main/assets/{EmptyStatusContainer.vue_vue_type_script_setup_true_lang-BesoRTEn.js → EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CNOUTt3S.js} +1 -1
  27. package/dist/website/main/assets/GithubCallback-DRfvlj0J.js +1 -0
  28. package/dist/website/main/assets/{LoadingWrapper.vue_vue_type_script_setup_true_lang-CGbl_jEe.js → LoadingWrapper.vue_vue_type_script_setup_true_lang-BYA4gUOI.js} +1 -1
  29. package/dist/website/main/assets/ReplyForm.vue_vue_type_script_setup_true_lang-DztoCP65.js +1 -0
  30. package/dist/website/main/assets/SiteLogo-BK2LmBdP.js +1 -0
  31. package/dist/website/main/assets/SiteLogo-CszHjM2d.css +1 -0
  32. package/dist/website/main/assets/{cloud-upload-D1ObRbGg.js → cloud-upload-BqJFdj_J.js} +1 -1
  33. package/dist/website/main/assets/el-table-column-C2GQUl4R.js +1 -0
  34. package/dist/website/main/assets/{home-rounded-DxDBjzlk.js → home-rounded-CN0qCDnE.js} +1 -1
  35. package/dist/website/main/assets/index--Gl7kxRA.js +1 -0
  36. package/dist/website/main/assets/index-3thCh3qq.js +6 -0
  37. package/dist/website/main/assets/index-4DalWgib.js +1 -0
  38. package/dist/website/main/assets/{index-72rReQ2I-BkBRAKfL.js → index-72rReQ2I-DT4t3yv7.js} +1 -1
  39. package/dist/website/main/assets/index-APbKgJd9.js +1 -0
  40. package/dist/website/main/assets/index-B0gjb0CJ.js +1 -0
  41. package/dist/website/main/assets/index-B4Denke_.js +1 -0
  42. package/dist/website/main/assets/index-BDXFoym_.js +1 -0
  43. package/dist/website/main/assets/index-BGAAZcsT.js +1 -0
  44. package/dist/website/main/assets/index-BIIfOsTM.js +1 -0
  45. package/dist/website/main/assets/index-BLCWm3Fn.js +1 -0
  46. package/dist/website/main/assets/index-BU8KZHUA.js +1 -0
  47. package/dist/website/main/assets/index-BYr_uRik.js +1 -0
  48. package/dist/website/main/assets/{index-uNuyW4Nf.js → index-BZrH5MtZ.js} +3 -3
  49. package/dist/website/main/assets/{index-D3slGitA.js → index-B_R6um8d.js} +1 -1
  50. package/dist/website/main/assets/index-B_rFxdlu.js +1 -0
  51. package/dist/website/main/assets/index-BiXGgf9p.js +1 -0
  52. package/dist/website/main/assets/{index-D_l0AXZ5.js → index-BkWR9AZK.js} +21 -21
  53. package/dist/website/main/assets/index-C0QhLzHP.js +1 -0
  54. package/dist/website/main/assets/index-C1XabFrJ.js +1 -0
  55. package/dist/website/main/assets/{index-D8C7Y4kK.js → index-C7kbImye.js} +1 -1
  56. package/dist/website/main/assets/index-CAhGpcw0.js +1 -0
  57. package/dist/website/main/assets/index-CGL710hV.js +1 -0
  58. package/dist/website/main/assets/index-CKtWjh5B.js +1 -0
  59. package/dist/website/main/assets/index-CLT68CCM.css +1 -0
  60. package/dist/website/main/assets/index-CQTH6cXs.js +1 -0
  61. package/dist/website/main/assets/index-CRerG_jj.js +3 -0
  62. package/dist/website/main/assets/index-Cey7IuDj.js +1 -0
  63. package/dist/website/main/assets/{index-leNHmgTy.js → index-CkHWSI2b.js} +2 -2
  64. package/dist/website/main/assets/index-CmDlT9OG.js +1 -0
  65. package/dist/website/main/assets/index-Cp8ViCIR.js +1 -0
  66. package/dist/website/main/assets/index-CwoRYDBS.js +1 -0
  67. package/dist/website/main/assets/index-D-zBzPPy.css +1 -0
  68. package/dist/website/main/assets/index-D2YpsmLA.js +1 -0
  69. package/dist/website/main/assets/index-D6zFRika.js +1 -0
  70. package/dist/website/main/assets/{index-D76eWsZ1-DzwZi5Q3.js → index-D76eWsZ1-_nyu7eQb.js} +1 -1
  71. package/dist/website/main/assets/index-DCw86ogq.js +1 -0
  72. package/dist/website/main/assets/index-DFFxrR-b.js +7 -0
  73. package/dist/website/main/assets/index-DGc9WQeN.js +2 -0
  74. package/dist/website/main/assets/index-DKrCvuOe.js +1 -0
  75. package/dist/website/main/assets/index-DOR-FWWa.js +1 -0
  76. package/dist/website/main/assets/index-DRLluzuR.js +1 -0
  77. package/dist/website/main/assets/index-DShvoWo5.js +1 -0
  78. package/dist/website/main/assets/index-DXwxbpG5.js +1 -0
  79. package/dist/website/main/assets/index-DlkXaOkE.css +1 -0
  80. package/dist/website/main/assets/{index-Dms7ZQ2h-BnAar77P.js → index-Dms7ZQ2h-CXFhQfmI.js} +1 -1
  81. package/dist/website/main/assets/index-DpUmZw4S.js +1 -0
  82. package/dist/website/main/assets/{index-DqiFCfGx-D9TcJHnH.js → index-DqiFCfGx-BdEBAtzU.js} +1 -1
  83. package/dist/website/main/assets/index-DvXl2xci.js +1 -0
  84. package/dist/website/main/assets/{index-DxypSQ0K-BPBBAlML.js → index-DxypSQ0K-wm4wOntm.js} +1 -1
  85. package/dist/website/main/assets/index-F2VTlbBR.js +1 -0
  86. package/dist/website/main/assets/index-GF-tJPqO.js +1 -0
  87. package/dist/website/main/assets/{index-B2Zubotl.css → index-Ji2WmMDE.css} +1 -1
  88. package/dist/website/main/assets/index-K6SUsq-d.js +1 -0
  89. package/dist/website/main/assets/{index-D0PH3BvM.js → index-KhSB9wFh.js} +1 -1
  90. package/dist/website/main/assets/index-Mnu1wKgu.css +1 -0
  91. package/dist/website/main/assets/{index-T76vWLBU-CH1SE5a0.js → index-T76vWLBU-C0PuuEJA.js} +1 -1
  92. package/dist/website/main/assets/index-_FSb4t-p.js +1 -0
  93. package/dist/website/main/assets/index-bwN_igRO.js +1 -0
  94. package/dist/website/main/assets/{index-fZBcgzqR-2hQDo6Qk.js → index-fZBcgzqR-CRYn0SF1.js} +1 -1
  95. package/dist/website/main/assets/{index-mqeGrL6B-CniizjGa.js → index-mqeGrL6B-BF63ossB.js} +1 -1
  96. package/dist/website/main/assets/index-ruR13HOB.js +2 -0
  97. package/dist/website/main/assets/index-sFKst8yj.js +1 -0
  98. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-C9gk_QQc.js +2 -0
  99. package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-CS2m0nhD.js → index.vue_vue_type_script_setup_true_lang-CJ6uny7o.js} +1 -1
  100. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CsPwDCDo.js +1 -0
  101. package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-30dEaEsH.js → index.vue_vue_type_script_setup_true_lang-D1Yenn0_.js} +1 -1
  102. package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-CbFazsFi.js → index.vue_vue_type_script_setup_true_lang-DVDnFtUl.js} +1 -1
  103. package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-BDWcS5BK.js → index.vue_vue_type_script_setup_true_lang-Do3aUu26.js} +1 -1
  104. package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-C7Y8qEDg.js +1 -0
  105. package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-CMD4VvG4.js +6 -0
  106. package/dist/website/main/assets/index3-BiHnTK1Z.js +1 -0
  107. package/dist/website/main/assets/{kid-star-CFee_wmK.js → kid-star-CiMfD7Sa.js} +1 -1
  108. package/dist/website/main/assets/{md5-Cswfg7iQ.js → md5-Dkj6ZNQB.js} +1 -1
  109. package/dist/website/main/assets/{settings-9laCRsDB.js → settings-CSr4nQM1.js} +1 -1
  110. package/dist/website/main/assets/{supervised-user-circle-CjLjPJgX.js → supervised-user-circle-BwUSx6w_.js} +1 -1
  111. package/dist/website/main/assets/{sync-saved-locally-rounded-lTPGDNrR.js → sync-saved-locally-rounded-DyESI323.js} +1 -1
  112. package/dist/website/main/assets/{terminal-fRNgCBAo.js → terminal-DAZ0JqKA.js} +1 -1
  113. package/dist/website/main/assets/{useCacheOssStore-a1U35_yC.js → useCacheOssStore-BovkXuwo.js} +1 -1
  114. package/dist/website/main/assets/useCompEditStore-C2cDxPfw.css +1 -0
  115. package/dist/website/main/assets/{useCompEditStore-CrmHmY3O.js → useCompEditStore-C47KFq3s.js} +13 -13
  116. package/dist/website/main/assets/{useCompMetaLocalStore-DScrCqkw.js → useCompMetaLocalStore-DUMtt_yz.js} +1 -1
  117. package/dist/website/main/assets/{useKeyword-DPrVS0y6.js → useKeyword-C0diQZGk.js} +1 -1
  118. package/dist/website/main/assets/useMessage-Dxhw28ry.js +1 -0
  119. package/dist/website/main/assets/{useTeamHeaders-DPQN2GDa.css → useTeamHeaders-BMHQzwDq.css} +1 -1
  120. package/dist/website/main/assets/{useTeamHeaders-Bh9dFUuA.js → useTeamHeaders-BuIG232Y.js} +2 -2
  121. package/dist/website/main/assets/{useUnreadStore-dPE0KFd2.js → useUnreadStore-CmdbW-yt.js} +1 -1
  122. package/dist/website/main/assets/{useVscodeOpen-CZclwKHe.js → useVscodeOpen-0AeELCuF.js} +1 -1
  123. package/dist/website/main/assets/{vendor-core-0VX1BwM6.js → vendor-core-CNXB6kVe.js} +3 -3
  124. package/dist/website/main/assets/{vendor-ui-CRHKNWIQ.js → vendor-ui-Cvgmewma.js} +15 -15
  125. package/dist/website/main/index.html +4 -4
  126. package/package.json +52 -52
  127. package/dist/website/container/assets/index-D3DdLVqK.css +0 -1
  128. package/dist/website/container/assets/index-eRcJ8qeF.js +0 -33
  129. package/dist/website/item/assets/index-CcAhYDgG.css +0 -1
  130. package/dist/website/main/assets/AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-Nj-eqxJP.js +0 -1
  131. package/dist/website/main/assets/BaseBadge-UKoV0gRD.js +0 -1
  132. package/dist/website/main/assets/BaseDialog.vue_vue_type_script_setup_true_lang-Bry1evkv.js +0 -1
  133. package/dist/website/main/assets/BaseSegmented.vue_vue_type_script_setup_true_lang-B5FydYbm.js +0 -1
  134. package/dist/website/main/assets/CanvasAnimation.vue_vue_type_script_setup_true_lang-BJ1WLWiR.js +0 -1
  135. package/dist/website/main/assets/GithubCallback-CxWdJQOK.js +0 -1
  136. package/dist/website/main/assets/ReplyForm.vue_vue_type_script_setup_true_lang-8UmMm5tC.js +0 -1
  137. package/dist/website/main/assets/el-table-column-DzGAH4eh.js +0 -1
  138. package/dist/website/main/assets/index--iTpYFYc.js +0 -1
  139. package/dist/website/main/assets/index-6RTiuZ_N.js +0 -1
  140. package/dist/website/main/assets/index-B7DPM0mK.js +0 -1
  141. package/dist/website/main/assets/index-BD4yGNF1.js +0 -1
  142. package/dist/website/main/assets/index-BOYLNx_j.js +0 -3
  143. package/dist/website/main/assets/index-BOmQK5id.js +0 -1
  144. package/dist/website/main/assets/index-BSzGziWF.js +0 -1
  145. package/dist/website/main/assets/index-B_K1LoXG.css +0 -1
  146. package/dist/website/main/assets/index-Barm7Xqt.js +0 -1
  147. package/dist/website/main/assets/index-Bknt6b_4.js +0 -1
  148. package/dist/website/main/assets/index-BsU1mqnT.js +0 -1
  149. package/dist/website/main/assets/index-Bth_SWAt.css +0 -1
  150. package/dist/website/main/assets/index-CCI9Rc7z.js +0 -1
  151. package/dist/website/main/assets/index-CD5eg05L.js +0 -1
  152. package/dist/website/main/assets/index-CDafjgED.js +0 -1
  153. package/dist/website/main/assets/index-CLOuN4ur.js +0 -1
  154. package/dist/website/main/assets/index-CNwHp9a1.js +0 -1
  155. package/dist/website/main/assets/index-COWiImKY.js +0 -1
  156. package/dist/website/main/assets/index-CgXxpwQw.js +0 -1
  157. package/dist/website/main/assets/index-CkOnRg_y.js +0 -1
  158. package/dist/website/main/assets/index-CmQK-Jf9.js +0 -1
  159. package/dist/website/main/assets/index-CnITVEbA.js +0 -1
  160. package/dist/website/main/assets/index-Cu67NMeG.css +0 -1
  161. package/dist/website/main/assets/index-D0e6xuyQ.js +0 -1
  162. package/dist/website/main/assets/index-D6CmgY15.js +0 -1
  163. package/dist/website/main/assets/index-D7c69zQF.js +0 -1
  164. package/dist/website/main/assets/index-DDPLszjZ.js +0 -1
  165. package/dist/website/main/assets/index-DKUt2N0Q.js +0 -1
  166. package/dist/website/main/assets/index-DNjrI1LU.js +0 -1
  167. package/dist/website/main/assets/index-DV_sHy81.js +0 -6
  168. package/dist/website/main/assets/index-D_Q0Ab96.js +0 -1
  169. package/dist/website/main/assets/index-DaCJE4Tc.js +0 -1
  170. package/dist/website/main/assets/index-Ddy0owpx.js +0 -7
  171. package/dist/website/main/assets/index-DiifzDSt.css +0 -1
  172. package/dist/website/main/assets/index-Dm5v9g0S.js +0 -1
  173. package/dist/website/main/assets/index-Dnvm4BY6.js +0 -1
  174. package/dist/website/main/assets/index-DoO3bCVS.js +0 -1
  175. package/dist/website/main/assets/index-Dr7Yk5Fw.js +0 -1
  176. package/dist/website/main/assets/index-DrqsuuZe.js +0 -1
  177. package/dist/website/main/assets/index-Du13eAUb.js +0 -1
  178. package/dist/website/main/assets/index-Dw4CVULY.js +0 -1
  179. package/dist/website/main/assets/index-DzEOWouw.js +0 -1
  180. package/dist/website/main/assets/index-VDJso98_.js +0 -1
  181. package/dist/website/main/assets/index-WXVFqbJx.js +0 -1
  182. package/dist/website/main/assets/index-hN9vFUxU.js +0 -1
  183. package/dist/website/main/assets/index-jaaimYtM.js +0 -1
  184. package/dist/website/main/assets/index-pGXTuXlq.js +0 -2
  185. package/dist/website/main/assets/index-qht0HNE9.js +0 -2
  186. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-Bwcjk_yE.js +0 -1
  187. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-D1YUVpY-.js +0 -1
  188. package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DWiaL7Bp.js +0 -2
  189. package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-BNUYhtju.js +0 -1
  190. package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-DOF1fd4X.js +0 -6
  191. package/dist/website/main/assets/useCompEditStore-ZAdO-kT7.css +0 -1
  192. package/dist/website/main/assets/useMarkdownText-9CjtixYv.js +0 -1
  193. package/dist/website/main/assets/useMessage-FHsgvLin.js +0 -1
@@ -1,6 +0,0 @@
1
- import{m as Ye,a as L,I as Je,aA as Xe,aC as de,w as Qe,f as je,L as Ge,M as Ze,a7 as et,O as tt,P as st,R as nt}from"./vendor-core-0VX1BwM6.js";import{r as rt,a as it,b as ot,c as at}from"./vendor-xterm-mNFjEaKn.js";import{t as ct,v as ht}from"./index-D_l0AXZ5.js";import{ai as ut,a as lt}from"./vendor-ui-CRHKNWIQ.js";var ft=rt(),dt=it(),pt=ot();const A=Object.create(null);A.open="0";A.close="1";A.ping="2";A.pong="3";A.message="4";A.upgrade="5";A.noop="6";const P=Object.create(null);Object.keys(A).forEach(r=>{P[A[r]]=r});const X={type:"error",data:"parser error"},we=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ee=typeof ArrayBuffer=="function",be=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,ee=({type:r,data:e},t,n)=>we&&e instanceof Blob?t?n(e):pe(e,n):Ee&&(e instanceof ArrayBuffer||be(e))?t?n(e):pe(new Blob([e]),n):n(A[r]+(e||"")),pe=(r,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(r)};function xe(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let K;function xt(r,e){if(we&&r.data instanceof Blob)return r.data.arrayBuffer().then(xe).then(e);if(Ee&&(r.data instanceof ArrayBuffer||be(r.data)))return e(xe(r.data));ee(r,!1,t=>{K||(K=new TextEncoder),e(K.encode(t))})}const me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<me.length;r++)S[me.charCodeAt(r)]=r;const mt=r=>{let e=r.length*.75,t=r.length,n,i=0,o,s,h,c;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);const f=new ArrayBuffer(e),d=new Uint8Array(f);for(n=0;n<t;n+=4)o=S[r.charCodeAt(n)],s=S[r.charCodeAt(n+1)],h=S[r.charCodeAt(n+2)],c=S[r.charCodeAt(n+3)],d[i++]=o<<2|s>>4,d[i++]=(s&15)<<4|h>>2,d[i++]=(h&3)<<6|c&63;return f},yt=typeof ArrayBuffer=="function",te=(r,e)=>{if(typeof r!="string")return{type:"message",data:ve(r,e)};const t=r.charAt(0);return t==="b"?{type:"message",data:gt(r.substring(1),e)}:P[t]?r.length>1?{type:P[t],data:r.substring(1)}:{type:P[t]}:X},gt=(r,e)=>{if(yt){const t=mt(r);return ve(t,e)}else return{base64:!0,data:r}},ve=(r,e)=>e==="blob"?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer,Ce="",_t=(r,e)=>{const t=r.length,n=new Array(t);let i=0;r.forEach((o,s)=>{ee(o,!1,h=>{n[s]=h,++i===t&&e(n.join(Ce))})})},wt=(r,e)=>{const t=r.split(Ce),n=[];for(let i=0;i<t.length;i++){const o=te(t[i],e);if(n.push(o),o.type==="error")break}return n};function Et(){return new TransformStream({transform(r,e){xt(r,t=>{const n=t.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,n)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let z;function D(r){return r.reduce((e,t)=>e+t.length,0)}function N(r,e){if(r[0].length===e)return r.shift();const t=new Uint8Array(e);let n=0;for(let i=0;i<e;i++)t[i]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function bt(r,e){z||(z=new TextDecoder);const t=[];let n=0,i=-1,o=!1;return new TransformStream({transform(s,h){for(t.push(s);;){if(n===0){if(D(t)<1)break;const c=N(t,1);o=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(D(t)<2)break;const c=N(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(D(t)<8)break;const c=N(t,8),f=new DataView(c.buffer,c.byteOffset,c.length),d=f.getUint32(0);if(d>Math.pow(2,21)-1){h.enqueue(X);break}i=d*Math.pow(2,32)+f.getUint32(4),n=3}else{if(D(t)<i)break;const c=N(t,i);h.enqueue(te(o?c:z.decode(c),e)),n=0}if(i===0||i>r){h.enqueue(X);break}}}})}const Ae=4;function g(r){if(r)return vt(r)}function vt(r){for(var e in g.prototype)r[e]=g.prototype[e];return r}g.prototype.on=g.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};g.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};g.prototype.off=g.prototype.removeListener=g.prototype.removeAllListeners=g.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};g.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};g.prototype.emitReserved=g.prototype.emit;g.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};g.prototype.hasListeners=function(r){return!!this.listeners(r).length};const M=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),w=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ct="arraybuffer";function Fe(r,...e){return e.reduce((t,n)=>(r.hasOwnProperty(n)&&(t[n]=r[n]),t),{})}const At=w.setTimeout,Ft=w.clearTimeout;function H(r,e){e.useNativeTimers?(r.setTimeoutFn=At.bind(w),r.clearTimeoutFn=Ft.bind(w)):(r.setTimeoutFn=w.setTimeout.bind(w),r.clearTimeoutFn=w.clearTimeout.bind(w))}const Bt=1.33;function kt(r){return typeof r=="string"?Tt(r):Math.ceil((r.byteLength||r.size)*Bt)}function Tt(r){let e=0,t=0;for(let n=0,i=r.length;n<i;n++)e=r.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function Be(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Rt(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Ot(r){let e={},t=r.split("&");for(let n=0,i=t.length;n<i;n++){let o=t[n].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class St extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class se extends g{constructor(e){super(),this.writable=!1,H(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new St(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=te(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=Rt(e);return t.length?"?"+t:""}}class Dt extends se{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};wt(e,this.socket.binaryType).forEach(t),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,_t(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Be()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let ke=!1;try{ke=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Nt=ke;function Lt(){}class Pt extends Dt{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}class C extends g{constructor(e,t,n){super(),this.createRequest=e,H(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=Fe(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=C.requestsCount++,C.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Lt,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete C.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()}}C.requestsCount=0;C.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ye);else if(typeof addEventListener=="function"){const r="onpagehide"in w?"pagehide":"unload";addEventListener(r,ye,!1)}}function ye(){for(let r in C.requests)C.requests.hasOwnProperty(r)&&C.requests[r].abort()}const qt=(function(){const r=Te({xdomain:!1});return r&&r.responseType!==null})();class It extends Pt{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=qt&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new C(Te,this.uri(),e)}}function Te(r){const e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Nt))return new XMLHttpRequest}catch{}if(!e)try{return new w[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Re=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Ut extends se{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=Re?{}:Fe(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;ee(n,this.supportsBinary,o=>{try{this.doWrite(n,o)}catch{}i&&M(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Be()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const Y=w.WebSocket||w.MozWebSocket;class Vt extends Ut{createSocket(e,t,n){return Re?new Y(e,t,n):t?new Y(e,t):new Y(e)}doWrite(e,t){this.ws.send(t)}}class Mt extends se{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=bt(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),i=Et();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const o=()=>{n.read().then(({done:h,value:c})=>{h||(this.onPacket(c),o())}).catch(h=>{})};o();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this._writer.write(s).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],i=t===e.length-1;this._writer.write(n).then(()=>{i&&M(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Ht={websocket:Vt,webtransport:Mt,polling:It},$t=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Q(r){if(r.length>8e3)throw"URI too long";const e=r,t=r.indexOf("["),n=r.indexOf("]");t!=-1&&n!=-1&&(r=r.substring(0,t)+r.substring(t,n).replace(/:/g,";")+r.substring(n,r.length));let i=$t.exec(r||""),o={},s=14;for(;s--;)o[Wt[s]]=i[s]||"";return t!=-1&&n!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Kt(o,o.path),o.queryKey=zt(o,o.query),o}function Kt(r,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function zt(r,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,o){i&&(t[i]=o)}),t}const j=typeof addEventListener=="function"&&typeof removeEventListener=="function",q=[];j&&addEventListener("offline",()=>{q.forEach(r=>r())},!1);class B extends g{constructor(e,t){if(super(),this.binaryType=Ct,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=Q(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=Q(t.host).host);H(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Ot(this.opts.query)),j&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},q.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=Ae,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&B.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}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",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",B.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(t+=kt(i)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,M(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,i){if(typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(B.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),j&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=q.indexOf(this._offlineEventListener);n!==-1&&q.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}B.protocol=Ae;class Yt extends B{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;B.priorWebsocketSuccess=!1;const i=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",p=>{if(!n)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;B.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const x=new Error("probe error");x.transport=t.name,this.emitReserved("upgradeError",x)}}))};function o(){n||(n=!0,d(),t.close(),t=null)}const s=p=>{const x=new Error("probe error: "+p);x.transport=t.name,o(),this.emitReserved("upgradeError",x)};function h(){s("transport closed")}function c(){s("socket closed")}function f(p){t&&p.name!==t.name&&o()}const d=()=>{t.removeListener("open",i),t.removeListener("error",s),t.removeListener("close",h),this.off("close",c),this.off("upgrading",f)};t.once("open",i),t.once("error",s),t.once("close",h),this.once("close",c),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let Jt=class extends Yt{constructor(e,t={}){const n=typeof e=="object",i=n?{...e}:{...t};(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(o=>Ht[o]).filter(o=>!!o)),super(n?i:e,i)}};function Xt(r,e="",t){let n=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),n=Q(r)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+e,n.href=n.protocol+"://"+o+(t&&t.port===n.port?"":":"+n.port),n}const Qt=typeof ArrayBuffer=="function",jt=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Oe=Object.prototype.toString,Gt=typeof Blob=="function"||typeof Blob<"u"&&Oe.call(Blob)==="[object BlobConstructor]",Zt=typeof File=="function"||typeof File<"u"&&Oe.call(File)==="[object FileConstructor]";function ne(r){return Qt&&(r instanceof ArrayBuffer||jt(r))||Gt&&r instanceof Blob||Zt&&r instanceof File}function I(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(I(r[t]))return!0;return!1}if(ne(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return I(r.toJSON(),!0);for(const t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&I(r[t]))return!0;return!1}function es(r){const e=[],t=r.data,n=r;return n.data=U(t,e),n.attachments=e.length,{packet:n,buffers:e}}function U(r,e,t){if(!r)return r;if(ne(r)){const n={_placeholder:!0,num:e.length};return e.push(r),n}else if(Array.isArray(r)){const n=new Array(r.length);for(let i=0;i<r.length;i++)n[i]=U(r[i],e);return n}else if(typeof r=="object"&&!(r instanceof Date)){if(r.toJSON&&typeof r.toJSON=="function"&&!t)return U(r.toJSON(),e,!0);const n={};for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=U(r[i],e));return n}return r}function ts(r,e){return r.data=G(r.data,e),delete r.attachments,r}function G(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=G(r[t],e);else if(typeof r=="object")for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=G(r[t],e));return r}const ss=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var l;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(l||(l={}));class ns{constructor(e){this.replacer=e}encode(e){return(e.type===l.EVENT||e.type===l.ACK)&&I(e)?this.encodeAsBinary({type:e.type===l.EVENT?l.BINARY_EVENT:l.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===l.BINARY_EVENT||e.type===l.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=es(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}}class re extends g{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===l.BINARY_EVENT;n||t.type===l.BINARY_ACK?(t.type=n?l.EVENT:l.ACK,this.reconstructor=new rs(t)):super.emitReserved("decoded",t)}else if(ne(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(l[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===l.BINARY_EVENT||n.type===l.BINARY_ACK){const o=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const s=e.substring(o,t);if(s!=Number(s)||e.charAt(t)!=="-")throw new Error("Illegal attachments");const h=Number(s);if(!is(h)||h<1)throw new Error("Illegal attachments");if(h>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=h}if(e.charAt(t+1)==="/"){const o=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(o,t)}else n.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const o=t+1;for(;++t;){const s=e.charAt(t);if(s==null||Number(s)!=s){--t;break}if(t===e.length)break}n.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(re.isPayloadValid(n.type,o))n.data=o;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case l.CONNECT:return ge(t);case l.DISCONNECT:return t===void 0;case l.CONNECT_ERROR:return typeof t=="string"||ge(t);case l.EVENT:case l.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&ss.indexOf(t[0])===-1);case l.ACK:case l.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rs{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=ts(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const is=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function ge(r){return Object.prototype.toString.call(r)==="[object Object]"}const os=Object.freeze(Object.defineProperty({__proto__:null,Decoder:re,Encoder:ns,get PacketType(){return l}},Symbol.toStringTag,{value:"Module"}));function b(r,e,t){return r.on(e,t),function(){r.off(e,t)}}const as=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Se extends g{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[b(e,"open",this.onopen.bind(this)),b(e,"packet",this.onpacket.bind(this)),b(e,"error",this.onerror.bind(this)),b(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,...t){var n,i,o;if(as.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const s={type:l.EVENT,data:t};if(s.options={},s.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const d=this.ids++,p=t.pop();this._registerAckCallback(d,p),s.id=d}const h=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!h||(c?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,t){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===e&&this.sendBuffer.splice(h,1);t.call(this,new Error("operation has timed out"))},i),s=(...h)=>{this.io.clearTimeoutFn(o),t.apply(this,h)};s.withError=!0,this.acks[e]=s}emitWithAck(e,...t){return new Promise((n,i)=>{const o=(s,h)=>s?i(s):n(h);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>(this._queue[0],i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...o)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:l.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case l.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case l.EVENT:case l.BINARY_EVENT:this.onevent(e);break;case l.ACK:case l.BINARY_ACK:this.onack(e);break;case l.DISCONNECT:this.ondisconnect();break;case l.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...i){n||(n=!0,t.packet({type:l.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:l.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 t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,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 t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function T(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}T.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=(Math.floor(e*10)&1)==0?r-t:r+t}return Math.min(r,this.max)|0};T.prototype.reset=function(){this.attempts=0};T.prototype.setMin=function(r){this.ms=r};T.prototype.setMax=function(r){this.max=r};T.prototype.setJitter=function(r){this.jitter=r};class Z extends g{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,H(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new T({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||os;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.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 Jt(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=b(t,"open",function(){n.onopen(),e&&e()}),o=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),e?e(h):this.maybeReconnectOnOpen()},s=b(t,"error",o);if(this._timeout!==!1){const h=this._timeout,c=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),t.close()},h);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(b(e,"ping",this.onping.bind(this)),b(e,"data",this.ondata.bind(this)),b(e,"error",this.onerror.bind(this)),b(e,"close",this.onclose.bind(this)),b(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){M(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Se(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),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 t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const R={};function V(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};const t=Xt(r,e.path||"/socket.io"),n=t.source,i=t.id,o=t.path,s=R[i]&&o in R[i].nsps,h=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let c;return h?c=new Z(n,e):(R[i]||(R[i]=new Z(n,e)),c=R[i]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(V,{Manager:Z,Socket:Se,io:V,connect:V});const _=V("/terminal",{autoConnect:!1});_.on("connect",()=>{console.log("手动连接成功")});_.on("disconnect",()=>{console.log("连接已断开")});var J={exports:{}},_e;function cs(){return _e||(_e=1,(function(r){var e={};r.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length===2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s===12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s===8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s===172||s===175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s===161||s===164||167<=s&&s<=168||s===170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s===198||s===208||215<=s&&s<=216||222<=s&&s<=225||s===230||232<=s&&s<=234||236<=s&&s<=237||s===240||242<=s&&s<=243||247<=s&&s<=250||s===252||s===254||s===257||s===273||s===275||s===283||294<=s&&s<=295||s===299||305<=s&&s<=307||s===312||319<=s&&s<=322||s===324||328<=s&&s<=331||s===333||338<=s&&s<=339||358<=s&&s<=359||s===363||s===462||s===464||s===466||s===468||s===470||s===472||s===474||s===476||s===593||s===609||s===708||s===711||713<=s&&s<=715||s===717||s===720||728<=s&&s<=731||s===733||s===735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s===1025||1040<=s&&s<=1103||s===1105||s===8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s===8240||8242<=s&&s<=8243||s===8245||s===8251||s===8254||s===8308||s===8319||8321<=s&&s<=8324||s===8364||s===8451||s===8453||s===8457||s===8467||s===8470||8481<=s&&s<=8482||s===8486||s===8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s===8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s===8658||s===8660||s===8679||s===8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s===8715||s===8719||s===8721||s===8725||s===8730||8733<=s&&s<=8736||s===8739||s===8741||8743<=s&&s<=8748||s===8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s===8776||s===8780||s===8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s===8853||s===8857||s===8869||s===8895||s===8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s===9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s===9711||9733<=s&&s<=9734||s===9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s===9756||s===9758||s===9792||s===9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s===9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s===9955||9960<=s&&s<=9983||s===10045||s===10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s===65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i==="F"||i==="W"||i==="A"?2:1};function t(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=t(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){var s=e.length(n);i=i??0,o=o===void 0||i===null?1:o,i<0&&(i=s+i),o<0&&(o=s+o);for(var h="",c=0,f=t(n),d=0;d<f.length;d++){var p=f[d],x=e.length(p);if(c>=i-(x===2?1:0))if(c+x<=o)h+=p;else break;c+=x}return h}})(J)),J.exports}var O=cs();const hs=()=>{const r=L("/"),e=c=>{const f=/^([A-Za-z]):[\\/]?(.*)/.exec(c);if(!f)return{letter:"",rest:c.replace(/\\/g,"/")};if(!f[1]||!f[2])throw new Error("splitDriveLetter path error");return{letter:f[1].toUpperCase(),rest:f[2].replace(/\\/g,"/")}},t=(c,f)=>c?`${c}:\\${f.replace(/\//g,"\\")}`:f.replace(/\//g,"\\"),n=async()=>{r.value=window.__GLOBAL_CONFIG__.cwd||"/"},i=c=>{r.value=c},o=c=>{const f=/^\s*cd\s+([^\s]*)\s*$/i,d=c.match(f);if(!d)return{isCd:!1};const p=d[1]||"/",{rest:x,letter:u}=e(r.value),m=ct.resolve(`/${x}`,p);return{newCwd:t(u,m.slice(1)),oldCwd:r.value,isCd:!0}},s=c=>{const{isCd:f,newCwd:d,oldCwd:p}=o(c);if(f){_.emit("command",{command:"",cwd:d,oldCwd:p});return}_.emit("command",{command:c,cwd:r.value})},h=(c="")=>{_.emit("tab",{cwd:r.value,lastWord:c})};return{cwd:Ye(()=>r.value),initCwd:n,sendCommand:s,updateCwd:i,sendTabCommand:h}};var us=at();const ls={ref:"terminalContainer",class:"size-full overflow-hidden p-2 pr-0 bg-[#1e1e1e]"},fs={ref:"terminalEl",class:"!h-full"},gs=Je({__name:"index",setup(r){const{t:e}=Xe(),t=hs(),n=de("terminalContainer"),i=de("terminalEl"),{height:o,width:s}=ut(n),h=new dt.FitAddon,c=L(!1),f=L(!1),d=a=>{u&&(u.options.cursorStyle=a?"bar":"block",u.options.cursorBlink=!0,f.value=a)},p=lt(ht,[]),x=L(-1);let u=null,m="",v="",E="",ie;const oe=async()=>{u||(u=new ft.Terminal({theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#c5c5c5"},fontSize:14,fontFamily:'Consolas, "Courier New", monospace',cursorBlink:!0,windowsMode:!0,allowProposedApi:!0,convertEol:!0}),u.loadAddon(h),u.loadAddon(new pt.Unicode11Addon),u.loadAddon(new us.WebLinksAddon),u.attachCustomKeyEventHandler(a=>a.type==="keydown"&&(a.ctrlKey||a.metaKey)&&a.key==="v"?(a.preventDefault(),Le(),!1):!0),i.value&&(u.open(i.value),h.fit()),u.onData(De),ie=await Ke())},$=()=>{m="",v="",E=""},De=a=>{if(u){if(a==="\x1B[A"||a==="\x1B[B"){$e(a);return}if(a==="\r"){Ve();return}if(a===""){Pe();return}if(a.charCodeAt(0)===9||a===" "){qe();return}if(a===""){Ne();return}a.charCodeAt(0)<32&&a!==" "||(m+=a,u.write(a))}},Ne=()=>{d(!1),$(),u?.write("^C"),u?.write(`\r
2
- `),t.sendCommand("^C")},Le=async()=>{try{const a=await navigator.clipboard.readText();if(!a||!u)return;const y=[...a].filter(k=>{const F=k.charCodeAt(0);return F>=32||F===9||F===10||F===13}).join("");y&&(m+=y,u.write(y))}catch{}},Pe=()=>{if(v.length){E.length&&(E=v);const a=v.slice(-1),y=O.characterLength(a);u?.write("\b \b".repeat(y)),v=v.slice(0,-1),E=E.slice(0,-1);return}if(m.length){const a=m.slice(-1),y=O.characterLength(a);u?.write("\b \b".repeat(y)),m=m.slice(0,-1)}},qe=()=>{if(E){t.sendTabCommand(E);return}const a=m.trim().split(/\s+/);a.length>1&&(E=a[a.length-1],t.sendTabCommand(E))},Ie=()=>{for(const a of m){const y=O.characterLength(a);u?.write("\b \b".repeat(y))}m=""},Ue=()=>{for(const a of v){const y=O.characterLength(a);u?.write("\b \b".repeat(y))}v=""},Ve=()=>{if(u?.write(`\r
3
- `),m==="clear"){u?.clear(),t.sendCommand(""),$();return}m.trim()?(t.sendCommand(m+v),d(!0)):t.sendCommand(""),$()},Me=a=>{a&&(p.value=p.value.filter(y=>y!==a),p.value.unshift(a))},He=a=>`PS ${a}>`,$e=a=>{const y=x.value;a==="\x1B[A"&&(x.value=Math.min(x.value+1,p.value.length-1)),a==="\x1B[B"&&(x.value=Math.max(x.value-1,-1)),y!==x.value&&(Ie(),x.value===-1?m="":m=p.value[x.value]??"",u?.write(m))},We=a=>{if(a){if(Ue(),m.endsWith(E))for(const k of E){const F=O.characterLength(k);u?.write("\b \b".repeat(F)),m=m.slice(0,-1)}u?.write(`${a}`),v=`${a}`}},Ke=async()=>{await t.initCwd(),_.connect();const a=F=>{console.log("终端输出:",F);const{stderr:ce,stdout:he,cwd:W,err:ue,command:le,tab:fe}=F;if(ce){u?.write(`${ce}`);return}if(he){u?.write(`${he}`);return}if(W){const ze=He(W);u?.write(ze),t.updateCwd(W),le&&Me(le),x.value=-1,d(!1);return}if(ue){u?.write(`\x1B[31m${ue}\x1B[0m`),u?.write(`\r
4
- `),d(!1);return}fe&&We(fe)},y=()=>{c.value=!0,t.sendCommand("")},k=()=>{c.value=!1,u?.writeln(`
5
- ${e("terminal.disconnected")}
6
- `)};return _.on("output",a),_.on("connect",y),_.on("disconnect",k),()=>{_.off("output",a),_.off("connect",y),_.off("disconnect",k)}};Qe(()=>[s.value,o.value],async()=>{h?.fit()},{immediate:!0}),je(()=>{oe()}),Ge(()=>{oe()});const ae=()=>{u?.dispose(),ie?.(),_?.disconnect(),u=null};return Ze(()=>{u?.clear(),ae()}),et(()=>{ae()}),(a,y)=>(tt(),st("div",ls,[nt("div",fs,null,512)],512))}});export{gs as _};
@@ -1 +0,0 @@
1
- .grid-container[data-v-bc4e9376]{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--a97dfee0),1fr));gap:var(--v94ea7606)}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute;width:var(--a97dfee0)}.list-leave-none{display:none}.active[data-v-ce18658f]{border:1px solid #23b2c5;border-radius:8px}.el-image-viewer__wrapper{position:fixed;inset:0}.el-image-viewer__wrapper:focus{outline:none!important}.el-image-viewer__btn{z-index:1;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:50%;justify-content:center;align-items:center;display:flex;position:absolute}.el-image-viewer__btn .el-icon{cursor:pointer}.el-image-viewer__close{width:40px;height:40px;font-size:40px;top:40px;right:40px}.el-image-viewer__canvas{-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:static}.el-image-viewer__actions{background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px;height:44px;padding:0 23px;bottom:30px;left:50%;transform:translate(-50%)}.el-image-viewer__actions__inner{cursor:default;color:#fff;justify-content:space-around;align-items:center;gap:22px;width:100%;height:100%;padding:0 6px;font-size:23px;display:flex}.el-image-viewer__actions__divider{margin:0 -6px}.el-image-viewer__progress{cursor:default;color:#fff;bottom:90px;left:50%;transform:translate(-50%)}.el-image-viewer__prev{color:#fff;background-color:var(--el-text-color-regular);border-color:#fff;width:44px;height:44px;font-size:24px;top:50%;left:40px;transform:translateY(-50%)}.el-image-viewer__next{text-indent:2px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff;width:44px;height:44px;font-size:24px;top:50%;right:40px;transform:translateY(-50%)}.el-image-viewer__close{color:#fff;background-color:var(--el-text-color-regular);border-color:#fff;width:44px;height:44px;font-size:24px}.el-image-viewer__mask{opacity:.5;background:#000;width:100%;height:100%;position:absolute;top:0;left:0}.el-image-viewer-parent--hidden{overflow:hidden}.viewer-fade-enter-active{animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{animation:viewer-fade-out var(--el-transition-duration)}@keyframes viewer-fade-in{0%{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translate(0)}}@keyframes viewer-fade-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translateY(-20px)}}.el-image__error,.el-image__placeholder,.el-image__wrapper,.el-image__inner{width:100%;height:100%}.el-image{display:inline-block;position:relative;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle;justify-content:center;align-items:center;font-size:14px;display:flex}.el-image__preview{cursor:pointer}.el-descriptions__label.el-descriptions__cell.is-bordered-label{color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background);font-weight:700}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{justify-content:space-between;align-items:center;margin-bottom:16px;display:flex}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-size:14px;line-height:23px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.md-editor[data-v-bb1eec04]{height:100%}[data-v-9819eb2a] .el-segmented__item-label{overflow:unset}
@@ -1 +0,0 @@
1
- import{I as W,a as $,d as X,O as Y,P as Z,am as ee,an as te,S as le,l as oe,w as j,f as J,B as ne,a2 as L,H as se,e as V,m as ae,j as z,E as G}from"./vendor-core-0VX1BwM6.js";import{F as R,S as Q,f as U,H as re,u as ie,a as N,g as ce,x as fe,R as de}from"./index-D0PH3BvM.js";import{s as me}from"./index-D_l0AXZ5.js";const Te=W({__name:"PanelBackground",props:{bg:{type:String,default:""}},setup(e){const l=e,i=$(l.bg),n=d=>{i.value=d??""};return X(()=>{i.value=l.bg}),(d,a)=>(Y(),Z("div",ee(te(d.$attrs)),[le(d.$slots,"default",{bg:i.value,updateColor:n})],16))}}),ue=`.${N}-preview > [data-line]`,B=(e,l)=>+getComputedStyle(e).getPropertyValue(l).replace("px",""),ye=(e,l)=>{const i=fe(()=>{e.removeEventListener("scroll",n),e.addEventListener("scroll",n),l.removeEventListener("scroll",n),l.addEventListener("scroll",n)},50),n=d=>{const a=e.clientHeight,T=l.clientHeight,v=e.scrollHeight,m=l.scrollHeight,c=(v-a)/(m-T);d.target===e?(l.removeEventListener("scroll",n),l.scrollTo({top:e.scrollTop/c}),i()):(e.removeEventListener("scroll",n),e.scrollTo({top:l.scrollTop*c}),i())};return[()=>{i().finally(()=>{e.dispatchEvent(new Event("scroll"))})},()=>{e.removeEventListener("scroll",n),l.removeEventListener("scroll",n)}]},Ie=(e,l,i)=>{const{view:n}=i,d=de(),a=r=>n.lineBlockAt(n.state.doc.line(r+1).from).top,T=r=>n.lineBlockAt(n.state.doc.line(r+1).from).bottom;let v=[],m=[],c=[];const S=()=>{v=[],m=Array.from(l.querySelectorAll(ue)),c=m.map(o=>Number(o.dataset.line));const r=[...c],{lines:h}=n.state.doc;r[0]!==0&&r.unshift(0);let I=r.shift()||0,t=r.shift()||h;for(let o=0;o<h;o++)o===t&&(I=o,t=r.shift()||h),v.push({start:I,end:t-1})},O=(r,h)=>{let I=1;for(let t=m.length-1;t-1>=0;t--){const o=m[t];if(o.offsetTop<=h){I=Number(o.dataset.line);break}}for(let t=v.length-1;t>=0;t--)if(a(v[t].start)<=r){I=I<v[t].start?I:v[t].start;break}return I};let w=0,P=0;const F=()=>{if(P!==0)return!1;w++;const{scrollDOM:r}=n;let h=B(l,"padding-block-start");const I=n.lineBlockAtHeight(r.scrollTop),{number:t}=n.state.doc.lineAt(I.from),o=v[t-1];if(!o)return!1;let y=1;const u=l.querySelector(`[data-line="${o.start}"]`)||l.firstElementChild?.firstElementChild,p=l.querySelector(`[data-line="${o.end+1}"]`)||l.lastElementChild?.lastElementChild,g=r.scrollHeight-r.clientHeight,s=l.scrollHeight-l.clientHeight;let E=a(o.start),H=T(o.end),f=u.offsetTop,b=p.offsetTop-f;E===0&&(f=0,u===p?(h=0,b=0):b=p.offsetTop),y=(r.scrollTop-E)/(H-E);const M=p==l.lastElementChild?.lastElementChild?p.offsetTop+p.clientHeight:p.offsetTop;if(H>=g||M>s){const C=O(g,s);E=a(C),y=(r.scrollTop-E)/(g-E);const k=l.querySelector(`[data-line="${C}"]`);E>0&&k&&(f=k.offsetTop),b=s-f+B(l,"padding-block-start")}const _=f-h+b*y;d(l,_,()=>{w--})},D=()=>{if(w!==0)return;P++;const{scrollDOM:r}=n,h=l.scrollTop,I=l.scrollHeight,t=r.scrollHeight-r.clientHeight,o=l.scrollHeight-l.clientHeight;let y=l.firstElementChild?.firstElementChild,u=l.firstElementChild?.lastElementChild;if(c.length>0){let C=Math.ceil(c[c.length-1]*(h/I)),k=c.findLastIndex(x=>x<=C);k=k===-1?0:k,C=c[k];for(let x=k;x>=0&&x<c.length;)if(m[x].offsetTop>h){if(x-1>=0){x--;continue}C=-1,k=-1;break}else{if(x+1<c.length&&m[x+1].offsetTop<h){x++;continue}C=c[x],k=x;break}switch(k){case-1:{y=l.firstElementChild?.firstElementChild,u=m[0];break}case c.length-1:{y=m[k],u=l.firstElementChild?.lastElementChild;break}default:y=m[k],u=m[k+1]}}let p=y===l.firstElementChild?.firstElementChild?0:y.offsetTop-B(y,"margin-block-start"),g=u.offsetTop,s=0;const{start:E,end:H}=v[Number(y.dataset.line||0)];let f=a(E);const b=a(H+1===n.state.doc.lines?H:H+1);let M=0;const _=u==l.lastElementChild?.lastElementChild?u.offsetTop+u.offsetHeight:u.offsetTop;if(b>t||_>o){const C=O(t,o),k=l.querySelector(`[data-line="${C}"]`);p=k?k.offsetTop-B(k,"margin-block-start"):p,f=a(C),s=(h-p)/(o-p),M=t-f}else y===l.firstElementChild?.firstElementChild?(y===u&&(g=u.offsetTop+u.offsetHeight+B(u,"margin-block-end")),M=b,f=0,s=Math.max(h/g,0)):(s=Math.max((h-p)/(g-p),0),M=b-f);d(e,f+M*s,()=>{P--})},A=r=>{const{scrollDOM:h,contentHeight:I}=n,t=h.clientHeight;if(I<=t||l.firstElementChild.clientHeight<=l.clientHeight||n.state.doc.lines<=v[v.length-1]?.end)return!1;r.target===e?F():D()};return[()=>{S(),e.addEventListener("scroll",A),l.addEventListener("scroll",A),e.dispatchEvent(new Event("scroll"))},()=>{e.removeEventListener("scroll",A),l.removeEventListener("scroll",A)}]},ve={tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},onActive:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},K=W({props:ve,setup(e){const l=z("scrollElementRef"),i=z("roorNodeRef"),n=$();j(()=>e.tocItem.active,a=>{a&&e.onActive(e.tocItem,n.value)}),J(()=>{e.tocItem.active&&e.onActive(e.tocItem,n.value)});const d=a=>{if(a.stopPropagation(),e.onClick(a,e.tocItem),a.defaultPrevented)return;const T=e.mdHeadingId({text:e.tocItem.text,level:e.tocItem.level,index:e.tocItem.index,currentToken:e.tocItem.currentToken,nextToken:e.tocItem.nextToken}),v=i.value.getElementById(T),m=l.value;if(v&&m){let c=v.offsetParent,S=v.offsetTop;if(m.contains(c))for(;c&&m!=c;)S+=c?.offsetTop,c=c?.offsetParent;const O=v.previousElementSibling;let w=0;O||(w=B(v,"margin-block-start")),m?.scrollTo({top:S-e.scrollElementOffsetTop-w,behavior:"smooth"})}};return()=>L("div",{ref:n,class:[`${N}-catalog-link`,e.tocItem.active&&`${N}-catalog-active`],onClick:d},[L("span",{title:e.tocItem.text},[e.tocItem.text]),e.tocItem.children&&e.tocItem.children.length>0&&L("div",{class:`${N}-catalog-wrapper`},[e.tocItem.children.map(a=>L(K,{mdHeadingId:e.mdHeadingId,key:`${e.tocItem.text}-link-${a.level}-${a.text}`,tocItem:a,onActive:e.onActive,onClick:e.onClick,scrollElementOffsetTop:e.scrollElementOffsetTop},null))])])}}),pe={editorId:{type:String,default:void 0},class:{type:String,default:""},mdHeadingId:{type:Function,default:({text:e})=>e},scrollElement:{type:[String,Object],default:void 0},theme:{type:String,default:"light"},offsetTop:{type:Number,default:20},scrollElementOffsetTop:{type:Number,default:0},onClick:{type:Function,default:void 0},onActive:{type:Function,default:void 0},isScrollElementInShadow:{type:Boolean,default:!1},syncWith:{type:String,default:"preview"},catalogMaxDepth:{type:Number,default:void 0}},q=W({name:"MdCatalog",props:pe,emits:["onClick","onActive"],setup(e,l){const i=e.editorId,n=`#${i}-preview-wrapper`,d=oe({list:[],show:!1,scrollElement:e.scrollElement||n}),a=V(),T=$(),v=$(),m=$(),c=$(),S=V(),O=$({});G("scrollElementRef",v),G("roorNodeRef",c);const w=ae(()=>{const t=[];return d.list.forEach((o,y)=>{if(e.catalogMaxDepth&&o.level>e.catalogMaxDepth)return;const{text:u,level:p,line:g}=o,s={level:p,text:u,line:g,index:y+1,active:a.value===o};if(t.length===0)t.push(s);else{let E=t[t.length-1];if(s.level>E.level)for(let H=E.level+1;H<=6;H++){const{children:f}=E;if(!f){E.children=[s];break}if(E=f[f.length-1],s.level<=E.level){f.push(s);break}}else t.push(s)}}),t}),P=()=>{if(d.scrollElement instanceof HTMLElement)return d.scrollElement;let t=document;return(d.scrollElement===n||e.isScrollElementInShadow)&&(t=T.value?.getRootNode()),t.querySelector(d.scrollElement)},F=t=>{if(t.length===0)return a.value=void 0,d.list=[],!1;const{activeHead:o,activeIndex:y}=t.reduce((g,s,E)=>{let H=0;if(e.syncWith==="preview"){const f=c.value?.getElementById(e.mdHeadingId({text:s.text,level:s.level,index:E+1,currentToken:s.currentToken,nextToken:s.nextToken}));f instanceof HTMLElement&&(H=ce(f,v.value))}else{const f=S.value;if(f){const b=f.lineBlockAt(f.state.doc.line(s.line+1).from).top,M=f.scrollDOM.scrollTop;H=b-M}}return H<e.offsetTop&&H>g.minTop?{activeHead:s,activeIndex:E,minTop:H}:g},{activeHead:t[0],activeIndex:0,minTop:Number.MIN_SAFE_INTEGER});let u=o;const{catalogMaxDepth:p}=e;if(p&&u.level>p){for(let g=y;g>=0;g--){const s=t[g];if(s.level<=p){u=s;break}}if(u.level>p){const g=t.find(s=>s.level<=p);g&&(u=g)}}a.value=u,d.list=t},D=(t,o)=>{O.value.top=o.offsetTop+B(o,"padding-block-start")+"px",e.onActive?.(t,o),l.emit("onActive",t,o)},A=()=>{F(d.list)},r=t=>{if(m.value?.removeEventListener("scroll",A),e.syncWith==="editor")m.value=S.value?.scrollDOM;else{const o=P();v.value=o,m.value=o===document.documentElement?document:o}F(t),m.value?.addEventListener("scroll",A)},h=t=>{S.value=t};j([()=>e.syncWith,S,()=>e.catalogMaxDepth],()=>{r(d.list)}),J(()=>{c.value=T.value.getRootNode(),R.on(i,{name:Q,callback:r}),R.on(i,{name:U,callback:h}),R.emit(i,re),R.emit(i,ie)}),ne(()=>{R.remove(i,Q,r),R.remove(i,U,h),m.value?.removeEventListener("scroll",A)});const I=(t,o)=>{e.onClick?.(t,o),l.emit("onClick",t,o)};return()=>L("div",{class:[`${N}-catalog`,e.theme==="dark"&&`${N}-catalog-dark`,e.class||""],ref:T},[w.value.length>0&&L(se,null,[L("div",{class:`${N}-catalog-indicator`,style:O.value},null),L("div",{class:`${N}-catalog-container`},[w.value.map(t=>L(K,{mdHeadingId:e.mdHeadingId,tocItem:t,key:`link-${t.level}-${t.text}`,onActive:D,onClick:I,scrollElementOffsetTop:e.scrollElementOffsetTop},null))])])])}});q.install=e=>(e.component(q.name,q),e);const{i18n:he}=me;function He(e){const l=$(""),i=$(!1),n=$("");async function d(){i.value=!1,n.value="",l.value="";const a=e.value;if(!a){i.value=!0;return}try{const T=await fetch(a);if(T.status===404){i.value=!0;return}if(!T.ok)throw new Error(`${T.status} ${T.statusText}`);l.value=await T.text()}catch(T){n.value=`${he.global.t("markdown.error")}: ${T.message}`}finally{i.value=!0}}return j(e,d,{immediate:!0}),{text:l,isLoaded:i,errorMessage:n}}export{q as W,Te as _,Ie as g,ye as h,He as u};
@@ -1 +0,0 @@
1
- import{w as P,a7 as N,M as G,h as C,m as y}from"./vendor-core-0VX1BwM6.js";import{k as U}from"./vendor-ui-CRHKNWIQ.js";import{G as D}from"./index-D_l0AXZ5.js";function b(O,S,g){let I=()=>{};const w=C();let A=null,c=[];I=P(()=>O.value,e=>{A=e,c.forEach(({task:n,data:i})=>{n(i)})},{deep:!0,immediate:!0,...g});function a(e){c.push({task:S,data:e??{}}),A&&S(e??{})}return w&&(N(()=>{I(),c=[]}),G(()=>{c=[]})),{stopWatch:I,triggerCallback:a}}var L={exports:{}},v;function x(){return v||(v=1,(function(O){var S=(function(){var g=String.fromCharCode,I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",A={};function c(e,n){if(!A[e]){A[e]={};for(var i=0;i<e.length;i++)A[e][e.charAt(i)]=i}return A[e][n]}var a={compressToBase64:function(e){if(e==null)return"";var n=a._compress(e,6,function(i){return I.charAt(i)});switch(n.length%4){default:case 0:return n;case 1:return n+"===";case 2:return n+"==";case 3:return n+"="}},decompressFromBase64:function(e){return e==null?"":e==""?null:a._decompress(e.length,32,function(n){return c(I,e.charAt(n))})},compressToUTF16:function(e){return e==null?"":a._compress(e,15,function(n){return g(n+32)})+" "},decompressFromUTF16:function(e){return e==null?"":e==""?null:a._decompress(e.length,16384,function(n){return e.charCodeAt(n)-32})},compressToUint8Array:function(e){for(var n=a.compress(e),i=new Uint8Array(n.length*2),o=0,r=n.length;o<r;o++){var u=n.charCodeAt(o);i[o*2]=u>>>8,i[o*2+1]=u%256}return i},decompressFromUint8Array:function(e){if(e==null)return a.decompress(e);for(var n=new Array(e.length/2),i=0,o=n.length;i<o;i++)n[i]=e[i*2]*256+e[i*2+1];var r=[];return n.forEach(function(u){r.push(g(u))}),a.decompress(r.join(""))},compressToEncodedURIComponent:function(e){return e==null?"":a._compress(e,6,function(n){return w.charAt(n)})},decompressFromEncodedURIComponent:function(e){return e==null?"":e==""?null:(e=e.replace(/ /g,"+"),a._decompress(e.length,32,function(n){return c(w,e.charAt(n))}))},compress:function(e){return a._compress(e,16,function(n){return g(n)})},_compress:function(e,n,i){if(e==null)return"";var o,r,u={},m={},d="",h="",f="",p=2,T=3,l=2,E=[],t=0,_=0,s;for(s=0;s<e.length;s+=1)if(d=e.charAt(s),Object.prototype.hasOwnProperty.call(u,d)||(u[d]=T++,m[d]=!0),h=f+d,Object.prototype.hasOwnProperty.call(u,h))f=h;else{if(Object.prototype.hasOwnProperty.call(m,f)){if(f.charCodeAt(0)<256){for(o=0;o<l;o++)t=t<<1,_==n-1?(_=0,E.push(i(t)),t=0):_++;for(r=f.charCodeAt(0),o=0;o<8;o++)t=t<<1|r&1,_==n-1?(_=0,E.push(i(t)),t=0):_++,r=r>>1}else{for(r=1,o=0;o<l;o++)t=t<<1|r,_==n-1?(_=0,E.push(i(t)),t=0):_++,r=0;for(r=f.charCodeAt(0),o=0;o<16;o++)t=t<<1|r&1,_==n-1?(_=0,E.push(i(t)),t=0):_++,r=r>>1}p--,p==0&&(p=Math.pow(2,l),l++),delete m[f]}else for(r=u[f],o=0;o<l;o++)t=t<<1|r&1,_==n-1?(_=0,E.push(i(t)),t=0):_++,r=r>>1;p--,p==0&&(p=Math.pow(2,l),l++),u[h]=T++,f=String(d)}if(f!==""){if(Object.prototype.hasOwnProperty.call(m,f)){if(f.charCodeAt(0)<256){for(o=0;o<l;o++)t=t<<1,_==n-1?(_=0,E.push(i(t)),t=0):_++;for(r=f.charCodeAt(0),o=0;o<8;o++)t=t<<1|r&1,_==n-1?(_=0,E.push(i(t)),t=0):_++,r=r>>1}else{for(r=1,o=0;o<l;o++)t=t<<1|r,_==n-1?(_=0,E.push(i(t)),t=0):_++,r=0;for(r=f.charCodeAt(0),o=0;o<16;o++)t=t<<1|r&1,_==n-1?(_=0,E.push(i(t)),t=0):_++,r=r>>1}p--,p==0&&(p=Math.pow(2,l),l++),delete m[f]}else for(r=u[f],o=0;o<l;o++)t=t<<1|r&1,_==n-1?(_=0,E.push(i(t)),t=0):_++,r=r>>1;p--,p==0&&(p=Math.pow(2,l),l++)}for(r=2,o=0;o<l;o++)t=t<<1|r&1,_==n-1?(_=0,E.push(i(t)),t=0):_++,r=r>>1;for(;;)if(t=t<<1,_==n-1){E.push(i(t));break}else _++;return E.join("")},decompress:function(e){return e==null?"":e==""?null:a._decompress(e.length,32768,function(n){return e.charCodeAt(n)})},_decompress:function(e,n,i){var o=[],r=4,u=4,m=3,d="",h=[],f,p,T,l,E,t,_,s={val:i(0),position:n,index:1};for(f=0;f<3;f+=1)o[f]=f;for(T=0,E=Math.pow(2,2),t=1;t!=E;)l=s.val&s.position,s.position>>=1,s.position==0&&(s.position=n,s.val=i(s.index++)),T|=(l>0?1:0)*t,t<<=1;switch(T){case 0:for(T=0,E=Math.pow(2,8),t=1;t!=E;)l=s.val&s.position,s.position>>=1,s.position==0&&(s.position=n,s.val=i(s.index++)),T|=(l>0?1:0)*t,t<<=1;_=g(T);break;case 1:for(T=0,E=Math.pow(2,16),t=1;t!=E;)l=s.val&s.position,s.position>>=1,s.position==0&&(s.position=n,s.val=i(s.index++)),T|=(l>0?1:0)*t,t<<=1;_=g(T);break;case 2:return""}for(o[3]=_,p=_,h.push(_);;){if(s.index>e)return"";for(T=0,E=Math.pow(2,m),t=1;t!=E;)l=s.val&s.position,s.position>>=1,s.position==0&&(s.position=n,s.val=i(s.index++)),T|=(l>0?1:0)*t,t<<=1;switch(_=T){case 0:for(T=0,E=Math.pow(2,8),t=1;t!=E;)l=s.val&s.position,s.position>>=1,s.position==0&&(s.position=n,s.val=i(s.index++)),T|=(l>0?1:0)*t,t<<=1;o[u++]=g(T),_=u-1,r--;break;case 1:for(T=0,E=Math.pow(2,16),t=1;t!=E;)l=s.val&s.position,s.position>>=1,s.position==0&&(s.position=n,s.val=i(s.index++)),T|=(l>0?1:0)*t,t<<=1;o[u++]=g(T),_=u-1,r--;break;case 2:return h.join("")}if(r==0&&(r=Math.pow(2,m),m++),o[_])d=o[_];else if(_===u)d=p+p.charAt(0);else return null;h.push(d),o[u++]=p+d.charAt(0),r--,p=d,r==0&&(r=Math.pow(2,m),m++)}}};return a})();O!=null?O.exports=S:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return S})})(L)),L.exports}var H=x();const M=U(H),R=["topOrigin","compType","userId","instanceUid","compId","isSfc"],z=()=>{const O=I();function S(c){if(Object.keys(c).filter(e=>!R.includes(e)).length)throw new Error(`iframe参数键名只能包含${R.join(", ")}`);return M.compressToEncodedURIComponent(JSON.stringify(c))}function g(c){const a=M.decompressFromEncodedURIComponent(c);return JSON.parse(a)}function I(){const a=new URLSearchParams(window.location.search).get("params")??"";return g(a)}function w(c){const a={...O,...c};return S(a)}function A(){return new URLSearchParams(window.location.search).get("isDark")}return{params:O,createIframeParams:S,uniteParams:w,getTheme:A}},J=(O,S)=>`${D.IFRAME_HOST}:${S}`,K=(O,S)=>`${D.IFRAME_HOST}:${S}`,k={LIST_INIT:"list_init",LIST_INIT_GET:"list_init_get",ITEM_INIT_SET:"item_init_set",ITEM_INIT_GET:"item_init_get",ITEM_INIT_SET_LOCAL:"item_init_set_local",ITEM_INIT_GET_LOCAL:"item_init_get_local",ITEM_VERSION_CHANGE:"item_version_change",ITEM_VERSION_LIST_GET:"item_version_list_get",ITEM_VERSION_LIST_SET:"item_version_list_set",ITEM_SITE_PATH_SET:"item_site_path_set",ITEM_SITE_PATH_GET:"item_site_path_get",THEME_CHANGE_SET:"theme_change_set",THEME_CHANGE_GET:"theme_change_get",BG_COLOR_SET:"bg_color_set",BG_COLOR_GET:"bg_color_get",UPDATE_IFRAME_HEIGHT:"update_iframe_height",SELECTED_ROWS_SET:"selected_rows_set",SELECTED_ROWS_GET:"selected_rows_get",SELECTED_ROWS_TO_LEAF_NODE_MAP_SET:"selected_rows_to_leaf_node_map_set",SELECTED_ROWS_TO_LEAF_NODE_MAP_GET:"selected_rows_to_leaf_node_map_get",COMP_GROUP_PATH_GET:"comp_group_path_get",COMP_GROUP_PATH_SET:"comp_group_path_set",COMP_PREVIEW_LIST_SET:"comp_preview_list_set",COMP_PREVIEW_LIST_GET:"comp_preview_list_get",COMP_RENDER_INFO_SET:"comp_render_info_set",COMP_RENDER_INFO_GET:"comp_render_info_get",CAROUSEL_INDEX_SET:"carousel_index_set",CAROUSEL_INDEX_GET:"carousel_index_get",LOCAL_EXIST_GET:"local_exist_get",LOCAL_EXIST_SET:"local_exist_set",SHOW_REFRESH_BTN_SET:"show_refresh_btn_set",SHOW_REFRESH_BTN_GET:"show_refresh_btn_get",ACTION_ADD_COMP_START_LOADING:"action_add_comp_start_loading",ACTION_ADD_COMP_FINISH_LOADING:"action_add_comp_finish_loading",ACTION_DOWNLOAD:"action_download",ACTION_PREVIEW:"action_preview",ACTION_PREVIEW_LOCAL:"action_preview_local",ACTION_COLLECT:"action_collect",ACTION_UPDATE:"action_update",ACTION_DELETE:"action_delete",ACTION_REFRESH:"action_refresh",ACTION_OPEN_VSCODE_LOCAL:"action_open_vscode_local",IS_ONLINE_UPDATE_SET:"is_online_update_set",IS_ONLINE_UPDATE_GET:"is_online_update_get",IS_ADD_SET:"is_add_set",IS_ADD_GET:"is_add_get",COMP_EDIT_TAB_TYPE_SET:"comp_edit_tab_type_set",OSS_FILE_SIGN_URL_GET:"oss_file_sign_url_get",OSS_FILE_SIGN_URL_SET:"oss_file_sign_url_set",SETTING_DATA_SET:"setting_data_set",SETTING_DATA_GET:"setting_data_get",SETTING_DATA_LEAF_SET:"setting_data_leaf_set",SETTING_DATA_LEAF_GET:"setting_data_leaf_get",SEARCH_KEYWORD_GET:"search_keyword_get",SEARCH_KEYWORD_SET:"search_keyword_set",LOCALE_SET:"locale_set",LOCALE_GET:"locale_get",COMP_RENDER_ERROR_SET:"comp_render_error_set",COMP_SCREENSHOT_AUTO:"comp_screenshot_auto",COMP_SCREENSHOT_MANUAL_SET:"comp_screenshot_manual_set",SELECTED_FOLDER_SET:"selected_folder_set",SELECTED_FOLDER_GET:"selected_folder_get",LOADING_SET:"loading_set"};function F(){const O=C(),S=(c,a,e,n)=>{c.postMessage({type:a,payload:JSON.stringify(e)},n)};return{sendMessageToParent:(c,a,e)=>{window.parent.postMessage({type:c,payload:JSON.stringify(a)},e)},sendMessageToTop:(c,a,e,n)=>{if(!e)throw new Error("targetOrigin 不能为空");window.top?.postMessage({type:c,payload:JSON.stringify(a),instanceUid:n},e)},sendMessageToTargetIframe:S,messageListener:()=>{const c=new Map,a=e=>{const{type:n,payload:i,instanceUid:o}=e.data??{},r=e.source===window.parent||e.source===window.top,u=o?.split(",").some(d=>d===O?.uid.toString()),m=c.get(n);(u||r)&&m?.(JSON.parse(i))};return window.addEventListener("message",a),N(()=>{window.removeEventListener("message",a),c.clear()}),{addListener:(e,n)=>{c.set(e,i=>{n(i)})},removeListener:e=>{e?c.delete(e):(c.clear(),window.removeEventListener("message",a))}}},requestResponse:async({targetWindow:c,requestType:a,responseType:e,data:n,targetOrigin:i,timeout:o=1e4})=>c?new Promise(r=>{let u=!1;const m=setTimeout(()=>{u||(u=!0,window.removeEventListener("message",d),r(null))},o),d=h=>{if(!u)try{const{type:f,payload:p}=h.data;f===e&&(u=!0,clearTimeout(m),window.removeEventListener("message",d),r(JSON.parse(p)))}catch{}};window.addEventListener("message",d),S(c,a,n,i)}):null,instanceUid:y(()=>O?.uid?.toString()??"")}}const Y=Object.freeze(Object.defineProperty({__proto__:null,IFRAME_POST_MESSAGE_TYPE:k,usePostMessage:F},Symbol.toStringTag,{value:"Module"}));export{k as I,z as a,b,F as c,J as d,Y as e,K as u};