@sync-in/server 1.10.0 → 1.11.0

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 (129) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +2 -2
  3. package/package.json +10 -11
  4. package/server/app.bootstrap.js +3 -22
  5. package/server/app.bootstrap.js.map +1 -1
  6. package/server/applications/comments/services/comments-queries.service.js +5 -9
  7. package/server/applications/comments/services/comments-queries.service.js.map +1 -1
  8. package/server/applications/users/users.e2e-spec.js +0 -1
  9. package/server/applications/users/users.e2e-spec.js.map +1 -1
  10. package/server/applications/webdav/constants/webdav.js +7 -0
  11. package/server/applications/webdav/constants/webdav.js.map +1 -1
  12. package/server/applications/webdav/utils/bootstrap.js +45 -0
  13. package/server/applications/webdav/utils/bootstrap.js.map +1 -0
  14. package/server/applications/webdav/webdav.controller.js +1 -1
  15. package/server/applications/webdav/webdav.controller.js.map +1 -1
  16. package/server/applications/webdav/webdav.e2e-spec.js +131 -2
  17. package/server/applications/webdav/webdav.e2e-spec.js.map +1 -1
  18. package/server/authentication/auth.e2e-spec.js +12 -6
  19. package/server/authentication/auth.e2e-spec.js.map +1 -1
  20. package/server/authentication/guards/auth-basic.guard.spec.js +23 -0
  21. package/server/authentication/guards/auth-basic.guard.spec.js.map +1 -1
  22. package/server/authentication/guards/auth-basic.strategy.js +3 -3
  23. package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
  24. package/server/authentication/guards/auth-digest.strategy.js +32 -11
  25. package/server/authentication/guards/auth-digest.strategy.js.map +1 -1
  26. package/server/authentication/guards/implementations/http-basic.strategy.js +76 -0
  27. package/server/authentication/guards/implementations/http-basic.strategy.js.map +1 -0
  28. package/server/authentication/guards/implementations/http-digest.strategy.js +155 -0
  29. package/server/authentication/guards/implementations/http-digest.strategy.js.map +1 -0
  30. package/server/authentication/services/auth-manager.service.js +1 -2
  31. package/server/authentication/services/auth-manager.service.js.map +1 -1
  32. package/static/{chunk-GQHXYX6Z.js → chunk-2AA3WMW5.js} +1 -1
  33. package/static/{chunk-ZEJLIGAY.js → chunk-2MRTBCSV.js} +1 -1
  34. package/static/{chunk-7VRYTDX4.js → chunk-2PDTP6N4.js} +1 -1
  35. package/static/{chunk-UOK3LKSX.js → chunk-32AVRWC3.js} +1 -1
  36. package/static/{chunk-B6HQYQYG.js → chunk-3I6NPM62.js} +1 -1
  37. package/static/{chunk-FIUF2JM4.js → chunk-3WBCGTYW.js} +1 -1
  38. package/static/{chunk-KDUAB76O.js → chunk-44D7RWET.js} +1 -1
  39. package/static/{chunk-3QTROEHV.js → chunk-4CQLN5HL.js} +1 -1
  40. package/static/{chunk-CCZWPM7Q.js → chunk-5WTIUYFF.js} +1 -1
  41. package/static/{chunk-I5SPA4G2.js → chunk-6LHJBXUE.js} +1 -1
  42. package/static/{chunk-DVCN3P7Q.js → chunk-76JDXKD7.js} +1 -1
  43. package/static/{chunk-45AZ6ZML.js → chunk-7EHP6HO3.js} +1 -1
  44. package/static/{chunk-HGODIZTV.js → chunk-7WOPGQXB.js} +1 -1
  45. package/static/chunk-ACCGBDUZ.js +13 -0
  46. package/static/{chunk-I3FR3A45.js → chunk-AFNUBQMD.js} +1 -1
  47. package/static/{chunk-TNCKNU6I.js → chunk-AXLDYLIO.js} +1 -1
  48. package/static/{chunk-LGIVVJDD.js → chunk-B4UP2EQM.js} +1 -1
  49. package/static/{chunk-BCN4T5DO.js → chunk-BAHNSFET.js} +2 -2
  50. package/static/chunk-CAD3RHAY.js +1 -0
  51. package/static/{chunk-HZAB6F4Q.js → chunk-CQOQXVYG.js} +1 -1
  52. package/static/{chunk-XTVNHFKX.js → chunk-CTPKDDVI.js} +1 -1
  53. package/static/{chunk-NIR4YE2E.js → chunk-D4XDSS6P.js} +1 -1
  54. package/static/{chunk-XBKCQCBI.js → chunk-DXESTGOH.js} +1 -1
  55. package/static/{chunk-PDG7DOEF.js → chunk-EUKVDBBK.js} +1 -1
  56. package/static/{chunk-PQZLR4P3.js → chunk-F3GMI6OL.js} +1 -1
  57. package/static/{chunk-3RPUQ22U.js → chunk-FVFOX6OP.js} +1 -1
  58. package/static/{chunk-ULSPQ3HP.js → chunk-G7TLKY5X.js} +1 -1
  59. package/static/{chunk-6WMXMIE4.js → chunk-GCPX3EFC.js} +1 -1
  60. package/static/{chunk-R7PLNX75.js → chunk-GYFLVCFN.js} +1 -1
  61. package/static/{chunk-RJULB733.js → chunk-I3XI72AV.js} +1 -1
  62. package/static/chunk-IAWRRL6J.js +1 -0
  63. package/static/{chunk-4TPFERL6.js → chunk-IOP3ON2H.js} +1 -1
  64. package/static/{chunk-CSVPAZHK.js → chunk-IOX3ANJR.js} +1 -1
  65. package/static/{chunk-ZHOE5VEY.js → chunk-IWWBV6EM.js} +1 -1
  66. package/static/{chunk-2RWLNKZH.js → chunk-IZ7TCHUW.js} +1 -1
  67. package/static/{chunk-3ZLBVUCX.js → chunk-J2BUPRCZ.js} +2 -2
  68. package/static/{chunk-JRXG43AA.js → chunk-J45SD6RC.js} +2 -2
  69. package/static/{chunk-PPJCVBJH.js → chunk-JVGN5V5E.js} +1 -1
  70. package/static/{chunk-IMFO2MI7.js → chunk-JXZOYX4N.js} +1 -1
  71. package/static/{chunk-T42BV6TR.js → chunk-K5VO5XTG.js} +1 -1
  72. package/static/{chunk-R4VMWCM5.js → chunk-KBUIDMCK.js} +1 -1
  73. package/static/chunk-KY6MNZLC.js +1 -0
  74. package/static/{chunk-KPOQLDWF.js → chunk-LRK6RNPR.js} +1 -1
  75. package/static/{chunk-CMNMPG6Z.js → chunk-M7IFVC5D.js} +1 -1
  76. package/static/{chunk-D5FQ72R4.js → chunk-MOWL3ILT.js} +1 -1
  77. package/static/chunk-MPWD4VMY.js +1 -0
  78. package/static/{chunk-3JYMJQYT.js → chunk-MTRXBVWZ.js} +1 -1
  79. package/static/{chunk-GWRAGN3M.js → chunk-MZQK6LNV.js} +1 -1
  80. package/static/{chunk-GXWGB7WO.js → chunk-NG7QWUFM.js} +1 -1
  81. package/static/{chunk-5O66CLTD.js → chunk-NUG54Y65.js} +1 -1
  82. package/static/{chunk-ZOMRIN3G.js → chunk-OKI3N5AI.js} +2 -2
  83. package/static/chunk-OYPJUVD6.js +1 -0
  84. package/static/{chunk-RNVPQQKT.js → chunk-P2IJCGWD.js} +1 -1
  85. package/static/{chunk-DGCVA6BM.js → chunk-P7X53PEP.js} +1 -1
  86. package/static/{chunk-ARS47O5X.js → chunk-Q5K4ZUHK.js} +1 -1
  87. package/static/{chunk-L3BIP4AA.js → chunk-QIGUDEZF.js} +1 -1
  88. package/static/{chunk-D55YR5X7.js → chunk-QJVC3SRJ.js} +11 -11
  89. package/static/chunk-QQAF3MLL.js +1 -0
  90. package/static/chunk-R4P4NBUL.js +1 -0
  91. package/static/{chunk-LNLBIJZD.js → chunk-RBBMH2FM.js} +1 -1
  92. package/static/{chunk-NJJURHX4.js → chunk-RPHWIW7S.js} +1 -1
  93. package/static/{chunk-OUHCDDT6.js → chunk-RWCNTCU5.js} +1 -1
  94. package/static/{chunk-KAUCN24H.js → chunk-SAN35XTD.js} +1 -1
  95. package/static/{chunk-SDJNZULP.js → chunk-SQYWQUL4.js} +1 -1
  96. package/static/chunk-TQBCGNFG.js +1 -0
  97. package/static/chunk-VBH3Y2M5.js +1 -0
  98. package/static/{chunk-XEWLBWFF.js → chunk-VHZKPUWE.js} +1 -1
  99. package/static/{chunk-G3PL6YX3.js → chunk-VNNLMUK7.js} +1 -1
  100. package/static/chunk-WB2DECOA.js +1 -0
  101. package/static/{chunk-S3TTWPQA.js → chunk-WE3ISL7O.js} +1 -1
  102. package/static/{chunk-JNTNMIUH.js → chunk-WJFKUJJX.js} +1 -1
  103. package/static/{chunk-KWFELZTM.js → chunk-WM56LPJ3.js} +1 -1
  104. package/static/{chunk-4NIYCYRS.js → chunk-WO6GBHBZ.js} +2 -2
  105. package/static/{chunk-LZUHREOF.js → chunk-WSTGWBVW.js} +1 -1
  106. package/static/{chunk-27Z3SYRL.js → chunk-WTWGBCFO.js} +1 -1
  107. package/static/{chunk-27V66YJV.js → chunk-XFZ37WVK.js} +2 -2
  108. package/static/{chunk-VD5JHSDS.js → chunk-Y433XOAJ.js} +1 -1
  109. package/static/{chunk-QHJT5H4M.js → chunk-Y67J3BOL.js} +1 -1
  110. package/static/{chunk-3WZ6F3LC.js → chunk-YBEH442D.js} +1 -1
  111. package/static/chunk-YKCUUBZP.js +5 -0
  112. package/static/{chunk-O3YLAEVE.js → chunk-YWLMFOB4.js} +3 -3
  113. package/static/{chunk-POUWUMC4.js → chunk-ZFAXICUH.js} +1 -1
  114. package/static/index.html +2 -2
  115. package/static/main-ZXEMCBMI.js +11 -0
  116. package/static/{styles-XLLEY5Y3.css → styles-PD6764CP.css} +1 -1
  117. package/static/chunk-2YQ4SX3A.js +0 -13
  118. package/static/chunk-46TJLPJY.js +0 -1
  119. package/static/chunk-6OEOADR6.js +0 -1
  120. package/static/chunk-E32J777S.js +0 -5
  121. package/static/chunk-G7RZN7HN.js +0 -1
  122. package/static/chunk-LTJNLOX2.js +0 -1
  123. package/static/chunk-NNZWSNAW.js +0 -1
  124. package/static/chunk-NWKBB7J4.js +0 -1
  125. package/static/chunk-PVYVY3GD.js +0 -1
  126. package/static/chunk-Q5X5TPAG.js +0 -1
  127. package/static/chunk-SNOOCDJD.js +0 -1
  128. package/static/chunk-ZCSHU3D7.js +0 -1
  129. package/static/main-YKDNJ7LK.js +0 -11
@@ -1 +1 @@
1
- import{$a as at,B as Qt,Ba as mi,Cb as z,I as oi,Ma as _i,Mb as Ai,Na as gi,Nb as ct,Pb as bi,Qb as Ti,Ua as yi,W as ci,X as jt,_ as ot,aa as hi,ab as Ei,ba as ui,ca as xt,da as li,ea as pi,fa as Jt,ga as q,ha as fi,ia as di,ja as X,qb as Si,tb as M,ub as wi,vb as Pt}from"./chunk-O3YLAEVE.js";import{Aa as Re,Af as ii,Bb as st,Bd as Je,Cd as Xe,Dd as Rt,Eb as B,Ed as Ot,G as Ae,Gb as D,Gf as ri,Jd as ze,Kb as Pe,Kd as kt,L as be,Lb as Fe,Mb as Ie,Oa as m,Pb as Kt,Qa as Oe,Qb as Le,Rb as bt,Tb as b,Vb as Ue,Vc as $e,W as Te,Xb as Be,Yb as De,Yc as Tt,Yf as si,Zb as Me,ab as At,bb as ke,c as we,cb as xe,ea as wt,fa as ve,fd as vt,ha as Ce,hd as nt,he as Ze,ie as ti,ja as p,jb as Ne,jd as Ct,kc as Ve,kd as qe,lb as k,mb as x,mc as We,oa as W,od as Ge,og as ni,pa as $,pd as He,qg as Nt,rb as C,sb as f,sd as Ye,tb as _,td as Ke,ub as J,v as S,yd as Qe,yf as ei,zd as je}from"./chunk-D55YR5X7.js";import{n as ai}from"./chunk-DM4NXKEP.js";import{a as O,b as ge,d as ye,e as Ee,i as Se}from"./chunk-KAVP6UXH.js";var V=(function(r){return r.USER="user",r.GUEST="guest",r.LINK="link",r.GROUP="group",r.PGROUP="personal group",r})(V||{});function vi(r,t=[]){let e=O({},Object.fromEntries(Object.entries(Ti).filter(([i,s])=>t.indexOf(i)===-1)));if(!r)return e;for(let i of r.split(":"))i in e&&(e[i]=!0);return e}function ts(r,t,e=[]){let i={};if(!r)return i;for(let s of r.split(":"))e.indexOf(s)===-1&&(i[s]=t.indexOf(s)>-1);return i}function es(r,t=[]){let e={};if(!r)return e;for(let i of r.split(":"))t.indexOf(i)===-1&&(e[i]=bi[i]);return e}function is(r){return Object.entries(r).filter(([t,e])=>e).map(([t,e])=>t).join(":")}var T=class{constructor(t,e=[]){this.newly=0,this.linkSettings=null,Object.assign(this,t),this.mid=`${t.type[0]}${t.id}`,this.hPerms=vi(t.permissions,e),t.login&&(this.avatarUrl=M(t.login)),this.isLink=!!this.linkId,this.isGuest=this.type===V.GUEST,this.isUser=this.isGuest||this.type===V.USER&&!this.isLink,this.isGroup=this.type===V.GROUP||this.type===V.PGROUP,this.isPersonalGroup=this.type===V.PGROUP,this.setGroupRole(),this.modifiedAt?this.newly=at(this.modifiedAt):this.createdAt&&(this.newly=at(this.createdAt))}setGroupRole(t){typeof t<"u"&&(this.groupRole=t),this.isGroupManager=this.groupRole===Qt.MANAGER}};function ls(r,t,e){return new T({id:r.id,login:r.login,name:r.fullName,description:r.email,type:V.USER,spaceRole:t||mi.IS_MEMBER,groupRole:e||Qt.MEMBER,permissions:""})}var Ci={NAME_SPACE:"/",EVENTS:{NOTIFICATION:"notification"}};var ht={NAME_SPACE:"/",EVENTS:{ONLINE_STATUS:"onlineStatus",ONLINE_USERS:"onlineUsers",ONLINE_USER:"onlineUser"}};var l=(function(r){return r.BASE="/api/auth",r.LOGIN="login",r.LOGOUT="logout",r.REFRESH="refresh",r.TOKEN="token",r.TOKEN_REFRESH="token/refresh",r.WS="socket.io",r.TWO_FA_BASE="2fa",r.TWO_FA_ENABLE="enable",r.TWO_FA_DISABLE="disable",r.TWO_FA_LOGIN_VERIFY="login/verify",r.TWO_FA_ADMIN_RESET_USER="reset/user",r})(l||{}),ms=`${l.BASE}/${l.LOGIN}`,_s=`${l.BASE}/${l.LOGOUT}`,Ri=`${l.BASE}/${l.REFRESH}`,gs=`${l.BASE}/${l.TOKEN}`,ys=`${l.BASE}/${l.TOKEN_REFRESH}`,Oi=`/${l.WS}`,Xt=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_ENABLE}`,ki=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_DISABLE}`,xi=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_LOGIN_VERIFY}`,Ni=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_ADMIN_RESET_USER}`;var fe={};Ee(fe,{Fetch:()=>mt,Manager:()=>K,NodeWebSocket:()=>L,NodeXHR:()=>I,Socket:()=>H,WebSocket:()=>L,WebTransport:()=>G,XHR:()=>I,connect:()=>Q,default:()=>Q,io:()=>Q,protocol:()=>le});var v=Object.create(null);v.open="0";v.close="1";v.ping="2";v.pong="3";v.message="4";v.upgrade="5";v.noop="6";var ut=Object.create(null);Object.keys(v).forEach(r=>{ut[v[r]]=r});var lt={type:"error",data:"parser error"};var Ii=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Li=typeof ArrayBuffer=="function",Ui=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,pt=({type:r,data:t},e,i)=>Ii&&t instanceof Blob?e?i(t):Pi(t,i):Li&&(t instanceof ArrayBuffer||Ui(t))?e?i(t):Pi(new Blob([t]),i):i(v[r]+(t||"")),Pi=(r,t)=>{let e=new FileReader;return e.onload=function(){let i=e.result.split(",")[1];t("b"+(i||""))},e.readAsDataURL(r)};function Fi(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var zt;function Bi(r,t){if(Ii&&r.data instanceof Blob)return r.data.arrayBuffer().then(Fi).then(t);if(Li&&(r.data instanceof ArrayBuffer||Ui(r.data)))return t(Fi(r.data));pt(r,!1,e=>{zt||(zt=new TextEncoder),t(zt.encode(e))})}var Di="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<Di.length;r++)ft[Di.charCodeAt(r)]=r;var Mi=r=>{let t=r.length*.75,e=r.length,i,s=0,n,o,a,h;r[r.length-1]==="="&&(t--,r[r.length-2]==="="&&t--);let R=new ArrayBuffer(t),A=new Uint8Array(R);for(i=0;i<e;i+=4)n=ft[r.charCodeAt(i)],o=ft[r.charCodeAt(i+1)],a=ft[r.charCodeAt(i+2)],h=ft[r.charCodeAt(i+3)],A[s++]=n<<2|o>>4,A[s++]=(o&15)<<4|a>>2,A[s++]=(a&3)<<6|h&63;return R};var mr=typeof ArrayBuffer=="function",dt=(r,t)=>{if(typeof r!="string")return{type:"message",data:Vi(r,t)};let e=r.charAt(0);return e==="b"?{type:"message",data:_r(r.substring(1),t)}:ut[e]?r.length>1?{type:ut[e],data:r.substring(1)}:{type:ut[e]}:lt},_r=(r,t)=>{if(mr){let e=Mi(r);return Vi(e,t)}else return{base64:!0,data:r}},Vi=(r,t)=>{switch(t){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var Wi="",$i=(r,t)=>{let e=r.length,i=new Array(e),s=0;r.forEach((n,o)=>{pt(n,!1,a=>{i[o]=a,++s===e&&t(i.join(Wi))})})},qi=(r,t)=>{let e=r.split(Wi),i=[];for(let s=0;s<e.length;s++){let n=dt(e[s],t);if(i.push(n),n.type==="error")break}return i};function Gi(){return new TransformStream({transform(r,t){Bi(r,e=>{let i=e.length,s;if(i<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,i);else if(i<65536){s=new Uint8Array(3);let n=new DataView(s.buffer);n.setUint8(0,126),n.setUint16(1,i)}else{s=new Uint8Array(9);let n=new DataView(s.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(i))}r.data&&typeof r.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(e)})}})}var Zt;function It(r){return r.reduce((t,e)=>t+e.length,0)}function Lt(r,t){if(r[0].length===t)return r.shift();let e=new Uint8Array(t),i=0;for(let s=0;s<t;s++)e[s]=r[0][i++],i===r[0].length&&(r.shift(),i=0);return r.length&&i<r[0].length&&(r[0]=r[0].slice(i)),e}function Hi(r,t){Zt||(Zt=new TextDecoder);let e=[],i=0,s=-1,n=!1;return new TransformStream({transform(o,a){for(e.push(o);;){if(i===0){if(It(e)<1)break;let h=Lt(e,1);n=(h[0]&128)===128,s=h[0]&127,s<126?i=3:s===126?i=1:i=2}else if(i===1){if(It(e)<2)break;let h=Lt(e,2);s=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),i=3}else if(i===2){if(It(e)<8)break;let h=Lt(e,8),R=new DataView(h.buffer,h.byteOffset,h.length),A=R.getUint32(0);if(A>Math.pow(2,21)-1){a.enqueue(lt);break}s=A*Math.pow(2,32)+R.getUint32(4),i=3}else{if(It(e)<s)break;let h=Lt(e,s);a.enqueue(dt(n?h:Zt.decode(h),t)),i=0}if(s===0||s>r){a.enqueue(lt);break}}}})}var te=4;function u(r){if(r)return gr(r)}function gr(r){for(var t in u.prototype)r[t]=u.prototype[t];return r}u.prototype.on=u.prototype.addEventListener=function(r,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(t),this};u.prototype.once=function(r,t){function e(){this.off(r,e),t.apply(this,arguments)}return e.fn=t,this.on(r,e),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(r,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var e=this._callbacks["$"+r];if(!e)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var i,s=0;s<e.length;s++)if(i=e[s],i===t||i.fn===t){e.splice(s,1);break}return e.length===0&&delete this._callbacks["$"+r],this};u.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),e=this._callbacks["$"+r],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(e){e=e.slice(0);for(var i=0,s=e.length;i<s;++i)e[i].apply(this,t)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};u.prototype.hasListeners=function(r){return!!this.listeners(r).length};var N=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,e)=>e(t,0),g=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Yi="arraybuffer";function Ut(r,...t){return t.reduce((e,i)=>(r.hasOwnProperty(i)&&(e[i]=r[i]),e),{})}var yr=g.setTimeout,Er=g.clearTimeout;function P(r,t){t.useNativeTimers?(r.setTimeoutFn=yr.bind(g),r.clearTimeoutFn=Er.bind(g)):(r.setTimeoutFn=g.setTimeout.bind(g),r.clearTimeoutFn=g.clearTimeout.bind(g))}var Sr=1.33;function Ki(r){return typeof r=="string"?wr(r):Math.ceil((r.byteLength||r.size)*Sr)}function wr(r){let t=0,e=0;for(let i=0,s=r.length;i<s;i++)t=r.charCodeAt(i),t<128?e+=1:t<2048?e+=2:t<55296||t>=57344?e+=3:(i++,e+=4);return e}function Bt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Qi(r){let t="";for(let e in r)r.hasOwnProperty(e)&&(t.length&&(t+="&"),t+=encodeURIComponent(e)+"="+encodeURIComponent(r[e]));return t}function ji(r){let t={},e=r.split("&");for(let i=0,s=e.length;i<s;i++){let n=e[i].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}var Dt=class extends Error{constructor(t,e,i){super(t),this.description=e,this.context=i,this.type="TransportError"}},F=class extends u{constructor(t){super(),this.writable=!1,P(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,e,i){return super.emitReserved("error",new Dt(t,e,i)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let e=dt(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){let t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_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(t){let e=Qi(t);return e.length?"?"+e:""}};var Z=class extends F{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let e=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let i=0;this._polling&&(i++,this.once("pollComplete",function(){--i||e()})),this.writable||(i++,this.once("drain",function(){--i||e()}))}else e()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let e=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)};qi(t,this.socket.binaryType).forEach(e),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,$i(t,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",e=this.query||{};return this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=Bt()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.createUri(t,e)}};var Ji=!1;try{Ji=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Xi=Ji;function Ar(){}var ee=class extends Z{constructor(t){if(super(t),typeof location<"u"){let e=location.protocol==="https:",i=location.port;i||(i=e?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}}doWrite(t,e){let i=this.request({method:"POST",data:t});i.on("success",e),i.on("error",(s,n)=>{this.onError("xhr post error",s,n)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=t}},Mt=(()=>{class r extends u{constructor(e,i,s){super(),this.createRequest=e,P(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;let i=Ut(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let s=this._xhr=this.createRequest(i);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&s.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var n;s.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.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=Ar,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",zi);else if(typeof addEventListener=="function"){let r="onpagehide"in g?"pagehide":"unload";addEventListener(r,zi,!1)}}function zi(){for(let r in Mt.requests)Mt.requests.hasOwnProperty(r)&&Mt.requests[r].abort()}var br=(function(){let r=Zi({xdomain:!1});return r&&r.responseType!==null})(),I=class extends ee{constructor(t){super(t);let e=t&&t.forceBase64;this.supportsBinary=br&&!e}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Mt(Zi,this.uri(),t)}};function Zi(r){let t=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Xi))return new XMLHttpRequest}catch{}if(!t)try{return new g[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var tr=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",re=class extends F{get name(){return"websocket"}doOpen(){let t=this.uri(),e=this.opts.protocols,i=tr?{}:Ut(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=this.createSocket(t,e,i)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let i=t[e],s=e===t.length-1;pt(i,this.supportsBinary,n=>{try{this.doWrite(i,n)}catch{}s&&N(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=Bt()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}},ie=g.WebSocket||g.MozWebSocket,L=class extends re{createSocket(t,e,i){return tr?new ie(t,e,i):e?new ie(t,e):new ie(t)}doWrite(t,e){this.ws.send(e)}};var G=class extends F{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{let e=Hi(Number.MAX_SAFE_INTEGER,this.socket.binaryType),i=t.readable.pipeThrough(e).getReader(),s=Gi();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();let n=()=>{i.read().then(({done:a,value:h})=>{a||(this.onPacket(h),n())}).catch(a=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let i=t[e],s=e===t.length-1;this._writer.write(i).then(()=>{s&&N(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}};var se={websocket:L,webtransport:G,polling:I};var Tr=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tt(r){if(r.length>8e3)throw"URI too long";let t=r,e=r.indexOf("["),i=r.indexOf("]");e!=-1&&i!=-1&&(r=r.substring(0,e)+r.substring(e,i).replace(/:/g,";")+r.substring(i,r.length));let s=Tr.exec(r||""),n={},o=14;for(;o--;)n[vr[o]]=s[o]||"";return e!=-1&&i!=-1&&(n.source=t,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=Cr(n,n.path),n.queryKey=Rr(n,n.query),n}function Cr(r,t){let e=/\/{2,9}/g,i=t.replace(e,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&i.splice(0,1),t.slice(-1)=="/"&&i.splice(i.length-1,1),i}function Rr(r,t){let e={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,s,n){s&&(e[s]=n)}),e}var ne=typeof addEventListener=="function"&&typeof removeEventListener=="function",Vt=[];ne&&addEventListener("offline",()=>{Vt.forEach(r=>r())},!1);var Wt=(()=>{class r extends u{constructor(e,i){if(super(),this.binaryType=Yi,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(i=e,e=null),e){let s=tt(e);i.hostname=s.host,i.secure=s.protocol==="https"||s.protocol==="wss",i.port=s.port,s.query&&(i.query=s.query)}else i.host&&(i.hostname=tt(i.host).host);P(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(s=>{let n=s.prototype.name;this.transports.push(n),this._transportsByName[n]=s}),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},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ji(this.opts.query)),ne&&(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"})},Vt.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let i=Object.assign({},this.opts.query);i.EIO=te,i.transport=e,this.id&&(i.sid=this.id);let s=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let e=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(e);i.open(),this.setTransport(i)}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",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",r.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":let i=new Error("server error");i.code=e.data,this._onError(i);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);let 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){let 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 i=1;for(let s=0;s<this.writeBuffer.length;s++){let n=this.writeBuffer[s].data;if(n&&(i+=Ki(n)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,N(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,i,s){return this._sendPacket("message",e,i,s),this}send(e,i,s){return this._sendPacket("message",e,i,s),this}_sendPacket(e,i,s,n){if(typeof i=="function"&&(n=i,i=void 0),typeof s=="function"&&(n=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;let o={type:e,data:i,options:s};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},s=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(r.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,i){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(),ne&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let s=Vt.indexOf(this._offlineEventListener);s!==-1&&Vt.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=te,r})(),$t=class extends Wt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let e=this.createTransport(t),i=!1;Wt.priorWebsocketSuccess=!1;let s=()=>{i||(e.send([{type:"ping",data:"probe"}]),e.once("packet",U=>{if(!i)if(U.type==="pong"&&U.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;Wt.priorWebsocketSuccess=e.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(A(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{let rt=new Error("probe error");rt.transport=e.name,this.emitReserved("upgradeError",rt)}}))};function n(){i||(i=!0,A(),e.close(),e=null)}let o=U=>{let rt=new Error("probe error: "+U);rt.transport=e.name,n(),this.emitReserved("upgradeError",rt)};function a(){o("transport closed")}function h(){o("socket closed")}function R(U){e&&U.name!==e.name&&n()}let A=()=>{e.removeListener("open",s),e.removeListener("error",o),e.removeListener("close",a),this.off("close",h),this.off("upgrading",R)};e.once("open",s),e.once("error",o),e.once("close",a),this.once("close",h),this.once("upgrading",R),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{i||e.open()},200):e.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let e=[];for(let i=0;i<t.length;i++)~this.transports.indexOf(t[i])&&e.push(t[i]);return e}},et=class extends $t{constructor(t,e={}){let i=typeof t=="object"?t:e;(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(s=>se[s]).filter(s=>!!s)),super(t,i)}};var mt=class extends Z{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(e=>this.onData(e))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,e){this._fetch(t).then(i=>{if(!i.ok)return this.onError("fetch write error",i.status,i);e()}).catch(i=>{this.onError("fetch write error",i)})}_fetch(t){var e;let i=t!==void 0,s=new Headers(this.opts.extraHeaders);return i&&s.set("content-type","text/plain;charset=UTF-8"),(e=this.socket._cookieJar)===null||e===void 0||e.appendCookies(s),fetch(this.uri(),{method:i?"POST":"GET",body:i?t:null,headers:s,credentials:this.opts.withCredentials?"include":"omit"}).then(n=>{var o;return(o=this.socket._cookieJar)===null||o===void 0||o.parseCookies(n.headers.getSetCookie()),n})}};var vn=et.protocol;function er(r,t="",e){let i=r;e=e||typeof location<"u"&&location,r==null&&(r=e.protocol+"//"+e.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=e.protocol+r:r=e.host+r),/^(https?|wss?):\/\//.test(r)||(typeof e<"u"?r=e.protocol+"//"+r:r="https://"+r),i=tt(r)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let n=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+n+":"+i.port+t,i.href=i.protocol+"://"+n+(e&&e.port===i.port?"":":"+i.port),i}var pe={};Ee(pe,{Decoder:()=>he,Encoder:()=>ce,PacketType:()=>c,isPacketValid:()=>Ur,protocol:()=>le});var Or=typeof ArrayBuffer=="function",kr=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,ir=Object.prototype.toString,xr=typeof Blob=="function"||typeof Blob<"u"&&ir.call(Blob)==="[object BlobConstructor]",Nr=typeof File=="function"||typeof File<"u"&&ir.call(File)==="[object FileConstructor]";function gt(r){return Or&&(r instanceof ArrayBuffer||kr(r))||xr&&r instanceof Blob||Nr&&r instanceof File}function _t(r,t){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let e=0,i=r.length;e<i;e++)if(_t(r[e]))return!0;return!1}if(gt(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return _t(r.toJSON(),!0);for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&_t(r[e]))return!0;return!1}function rr(r){let t=[],e=r.data,i=r;return i.data=oe(e,t),i.attachments=t.length,{packet:i,buffers:t}}function oe(r,t){if(!r)return r;if(gt(r)){let e={_placeholder:!0,num:t.length};return t.push(r),e}else if(Array.isArray(r)){let e=new Array(r.length);for(let i=0;i<r.length;i++)e[i]=oe(r[i],t);return e}else if(typeof r=="object"&&!(r instanceof Date)){let e={};for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=oe(r[i],t));return e}return r}function sr(r,t){return r.data=ae(r.data,t),delete r.attachments,r}function ae(r,t){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<t.length)return t[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=ae(r[e],t);else if(typeof r=="object")for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=ae(r[e],t));return r}var nr=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],le=5,c=(function(r){return 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",r})(c||{}),ce=class{constructor(t){this.replacer=t}encode(t){return(t.type===c.EVENT||t.type===c.ACK)&&_t(t)?this.encodeAsBinary({type:t.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let e=""+t.type;return(t.type===c.BINARY_EVENT||t.type===c.BINARY_ACK)&&(e+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(e+=t.nsp+","),t.id!=null&&(e+=t.id),t.data!=null&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){let e=rr(t),i=this.encodeAsString(e.packet),s=e.buffers;return s.unshift(i),s}},he=class r extends u{constructor(t){super(),this.reviver=t}add(t){let e;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);let i=e.type===c.BINARY_EVENT;i||e.type===c.BINARY_ACK?(e.type=i?c.EVENT:c.ACK,this.reconstructor=new ue(e),e.attachments===0&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else if(gt(t)||t.base64)if(this.reconstructor)e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let e=0,i={type:Number(t.charAt(0))};if(c[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===c.BINARY_EVENT||i.type===c.BINARY_ACK){let n=e+1;for(;t.charAt(++e)!=="-"&&e!=t.length;);let o=t.substring(n,e);if(o!=Number(o)||t.charAt(e)!=="-")throw new Error("Illegal attachments");i.attachments=Number(o)}if(t.charAt(e+1)==="/"){let n=e+1;for(;++e&&!(t.charAt(e)===","||e===t.length););i.nsp=t.substring(n,e)}else i.nsp="/";let s=t.charAt(e+1);if(s!==""&&Number(s)==s){let n=e+1;for(;++e;){let o=t.charAt(e);if(o==null||Number(o)!=o){--e;break}if(e===t.length)break}i.id=Number(t.substring(n,e+1))}if(t.charAt(++e)){let n=this.tryParse(t.substr(e));if(r.isPayloadValid(i.type,n))i.data=n;else throw new Error("invalid payload")}return i}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,e){switch(t){case c.CONNECT:return qt(e);case c.DISCONNECT:return e===void 0;case c.CONNECT_ERROR:return typeof e=="string"||qt(e);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&nr.indexOf(e[0])===-1);case c.ACK:case c.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ue=class{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){let e=sr(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function Pr(r){return typeof r=="string"}var Fr=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function Ir(r){return r===void 0||Fr(r)}function qt(r){return Object.prototype.toString.call(r)==="[object Object]"}function Lr(r,t){switch(r){case c.CONNECT:return t===void 0||qt(t);case c.DISCONNECT:return t===void 0;case c.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&nr.indexOf(t[0])===-1);case c.ACK:return Array.isArray(t);case c.CONNECT_ERROR:return typeof t=="string"||qt(t);default:return!1}}function Ur(r){return Pr(r.nsp)&&Ir(r.id)&&Lr(r.type,r.data)}function w(r,t,e){return r.on(t,e),function(){r.off(t,e)}}var Br=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),H=class extends u{constructor(t,e,i){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=t,this.nsp=e,i&&i.auth&&(this.auth=i.auth),this._opts=Object.assign({},i),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[w(t,"open",this.onopen.bind(this)),w(t,"packet",this.onpacket.bind(this)),w(t,"error",this.onerror.bind(this)),w(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){var i,s,n;if(Br.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;let o={type:c.EVENT,data:e};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof e[e.length-1]=="function"){let A=this.ids++,U=e.pop();this._registerAckCallback(A,U),o.id=A}let a=(s=(i=this.io.engine)===null||i===void 0?void 0:i.transport)===null||s===void 0?void 0:s.writable,h=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(h?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,e){var i;let s=(i=this.flags.timeout)!==null&&i!==void 0?i:this._opts.ackTimeout;if(s===void 0){this.acks[t]=e;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);e.call(this,new Error("operation has timed out"))},s),o=(...a)=>{this.io.clearTimeoutFn(n),e.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...e){return new Promise((i,s)=>{let n=(o,a)=>o?s(o):i(a);n.withError=!0,e.push(n),this.emit(t,...e)})}_addToQueue(t){let e;typeof t[t.length-1]=="function"&&(e=t.pop());let i={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...n)=>(this._queue[0],s!==null?i.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(s)):(this._queue.shift(),e&&e(null,...n)),i.pending=!1,this._drainQueue())),this._queue.push(i),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;let e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:c.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(i=>String(i.id)===t)){let i=this.acks[t];delete this.acks[t],i.withError&&i.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case c.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 c.EVENT:case c.BINARY_EVENT:this.onevent(t);break;case c.ACK:case c.BINARY_ACK:this.onack(t);break;case c.DISCONNECT:this.ondisconnect();break;case c.CONNECT_ERROR:this.destroy();let i=new Error(t.data.message);i.data=t.data.data,this.emitReserved("connect_error",i);break}}onevent(t){let e=t.data||[];t.id!=null&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let e=this._anyListeners.slice();for(let i of e)i.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){let e=this,i=!1;return function(...s){i||(i=!0,e.packet({type:c.ACK,id:t,data:s}))}}onack(t){let e=this.acks[t.id];typeof e=="function"&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:c.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let e=this._anyListeners;for(let i=0;i<e.length;i++)if(t===e[i])return e.splice(i,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let e=this._anyOutgoingListeners;for(let i=0;i<e.length;i++)if(t===e[i])return e.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let e=this._anyOutgoingListeners.slice();for(let i of e)i.apply(this,t.data)}}};function Y(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}Y.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),e=Math.floor(t*this.jitter*r);r=(Math.floor(t*10)&1)==0?r-e:r+e}return Math.min(r,this.max)|0};Y.prototype.reset=function(){this.attempts=0};Y.prototype.setMin=function(r){this.ms=r};Y.prototype.setMax=function(r){this.max=r};Y.prototype.setJitter=function(r){this.jitter=r};var K=class extends u{constructor(t,e){var i;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.opts=e,P(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((i=e.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new Y({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=t;let s=e.parser||pe;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(e=this.backoff)===null||e===void 0||e.setMin(t),this)}randomizationFactor(t){var e;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(e=this.backoff)===null||e===void 0||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(e=this.backoff)===null||e===void 0||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new et(this.uri,this.opts);let e=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;let s=w(e,"open",function(){i.onopen(),t&&t()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=w(e,"error",n);if(this._timeout!==!1){let a=this._timeout,h=this.setTimeoutFn(()=>{s(),n(new Error("timeout")),e.close()},a);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(s),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(w(t,"ping",this.onping.bind(this)),w(t,"data",this.ondata.bind(this)),w(t,"error",this.onerror.bind(this)),w(t,"close",this.onclose.bind(this)),w(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(e){this.onclose("parse error",e)}}ondecoded(t){N(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let i=this.nsps[t];return i?this._autoConnect&&!i.active&&i.connect():(i=new H(this,t,e),this.nsps[t]=i),i}_destroy(t){let e=Object.keys(this.nsps);for(let i of e)if(this.nsps[i].active)return;this._close()}_packet(t){let e=this.encoder.encode(t);for(let i=0;i<e.length;i++)this.engine.write(e[i],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var i;this.cleanup(),(i=this.engine)===null||i===void 0||i.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let e=this.backoff.duration();this._reconnecting=!0;let i=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},e);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};var yt={};function Q(r,t){typeof r=="object"&&(t=r,r=void 0),t=t||{};let e=er(r,t.path||"/socket.io"),i=e.source,s=e.id,n=e.path,o=yt[s]&&n in yt[s].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o,h;return a?h=new K(i,t):(yt[s]||(yt[s]=new K(i,t)),h=yt[s]),e.query&&!t.query&&(t.query=e.queryKey),h.socket(e.path,t)}Object.assign(Q,{Manager:K,Socket:H,io:Q,connect:Q});var it=class r{config;appRef;subscribersCounter={};eventObservables$={};namespaces={};ioSocket;emptyConfig={url:"",options:{}};constructor(t,e){this.config=t,this.appRef=e,t===void 0&&(t=this.emptyConfig);let i=t.url,s=t.options,n=Q?Q:fe;this.ioSocket=n(i,s)}get auth(){return this.ioSocket.auth}set auth(t){this.ioSocket.auth=t}get io(){return this.ioSocket.io}get open(){return this.connect}get close(){return this.disconnect}of(t){if(!t||t==="/")return this;let e=this.namespaces[t];if(e)return e;let a=this.config,{url:i}=a,s=ye(a,["url"]),n=O({url:!i.endsWith("/")&&!t.startsWith("/")?`${i}/${t}`:`${i}${t}`},s),o=new r(n,this.appRef);return this.namespaces[t]=o,o}on(t,e){return this.ioSocket.on(t,e),this}once(t,e){return this.ioSocket.once(t,e),this}connect(){return this.ioSocket.connect(),this}disconnect(){return this.ioSocket.disconnect(),this}emit(t,...e){return this.ioSocket.emit(t,...e),this}send(...t){return this.ioSocket.send.apply(this.ioSocket,arguments),this}emitWithAck(t,...e){return this.ioSocket.emitWithAck(t,...e)}removeListener(t,e){return this.ioSocket.removeListener(t,e),this}removeAllListeners(t){return this.ioSocket.removeAllListeners(t),this}fromEvent(t){return this.subscribersCounter[t]||(this.subscribersCounter[t]=0),this.subscribersCounter[t]++,this.eventObservables$[t]||(this.eventObservables$[t]=new we(e=>{let i=s=>{e.next(s),this.appRef.tick()};return this.ioSocket.on(t,i),()=>{this.subscribersCounter[t]--,this.subscribersCounter[t]===0&&(this.ioSocket.removeListener(t,i),delete this.eventObservables$[t])}}).pipe(Te())),this.eventObservables$[t]}fromOneTimeEvent(t){return new Promise(e=>this.once(t,e))}listeners(t){return this.ioSocket.listeners(t)}hasListeners(t){return this.ioSocket.hasListeners(t)}listenersAny(){return this.ioSocket.listenersAny()}listenersAnyOutgoing(){return this.ioSocket.listenersAnyOutgoing()}off(t,e){return this.ioSocket.off(t,e),this}offAny(t){return this.ioSocket.offAny(t),this}offAnyOutgoing(t){return this.ioSocket.offAnyOutgoing(t),this}onAny(t){return this.ioSocket.onAny(t),this}onAnyOutgoing(t){return this.ioSocket.onAnyOutgoing(t),this}prependAny(t){return this.ioSocket.prependAny(t),this}prependAnyOutgoing(t){return this.ioSocket.prependAnyOutgoing(t),this}timeout(t){return this.ioSocket.timeout(t),this}get volatile(){let t=this.ioSocket.volatile;return this}get active(){return this.ioSocket.active}get connected(){return this.ioSocket.connected}get disconnected(){return this.ioSocket.disconnected}get recovered(){return this.ioSocket.recovered}get id(){return this.ioSocket.id}compress(t){return this.ioSocket.compress(t),this}};function Dr(r,t){return new it(r,t)}var or=new Ce("__SOCKET_IO_CONFIG__"),_o=(()=>{class r{static forRoot(e){return{ngModule:r,providers:[{provide:or,useValue:e},{provide:it,useFactory:Dr,deps:[or,Ne]}]}}static \u0275fac=function(i){return new(i||r)};static \u0275mod=ke({type:r});static \u0275inj=ve({})}return r})();var de={BASE:`${ci}/notifications`,UNREAD:"unread"},Gt=de.BASE;var d=(function(r){return r.ADD="add",r.UPDATE="update",r.DELETE="delete",r.DELETE_PERMANENTLY="deletePermanently",r})(d||{});var y=(function(r){return r.COMMENTS="comments",r.SPACES="spaces",r.SPACE_ROOTS="spaces_roots",r.SHARES="shares",r.LINKS="links",r.SYNC="sync",r.AUTH_LOCKED="auth_locked",r.AUTH_2FA="auth_2fa",r.UNLOCK_REQUEST="unlock_request",r.UPDATE_AVAILABLE="server_update_available",r})(y||{}),bo={COMMENTS:"commented",SPACES:{[d.ADD]:"You now have access to the space",[d.DELETE]:"You no longer have access to the space",[d.DELETE_PERMANENTLY]:"This space has been permanently deleted"},SPACE_ROOTS:{[d.ADD]:"anchored",[d.DELETE]:"unanchored"},SHARES:{[d.ADD]:"shared with you",[d.DELETE]:"no longer share with you"},SHARES_WITHOUT_OWNER:{[d.ADD]:"You now have access to the share",[d.DELETE]:"You no longer have access to the share",[d.DELETE_PERMANENTLY]:"You are no longer a member of the parent share, your child share has been deleted"},LINKS:{[d.ADD]:"shared with you",[d.UPDATE]:"You now have access to the space"},SYNC:{[d.DELETE]:"You are no longer synchronizing"},AUTH_2FA:{[d.ADD]:"Two-factor authentication (2FA) on your account has been enabled",[d.DELETE]:"Two-factor authentication (2FA) on your account has been disabled"},AUTH_LOCKED:{[d.DELETE]:"Your account has been locked after several unsuccessful authentication attempts"},UNLOCK_REQUEST:"sends you a request to unlock the file",UPDATE_AVAILABLE:"A new update is available"};var ar=ii;var cr={[y.COMMENTS]:ar,[y.SPACES]:ct.SPACES,[y.SPACE_ROOTS]:ct.SPACES,[y.SHARES]:ct.SHARES,[y.LINKS]:ct.LINKS,[y.SYNC]:Si.SYNC,[y.UNLOCK_REQUEST]:ei};var Ht=class{constructor(t){this.soonRead=!1,Object.assign(this,t),this.fromUser?this.fromUser.avatarUrl=M(this.fromUser.login):this.fromUser={id:-1,login:null,email:null,fullName:"Info",avatarUrl:null},this.appIcon=cr[this.content.app],this.setMainElement()}setMainElement(){if(!(this.content.app===y.COMMENTS||this.content.app===y.SHARES||this.content.app===y.UPDATE_AVAILABLE||this.content.app===y.SYNC)&&this.content?.url){let t=this.content.url.split("/");t.length>1&&(this.mainElement=t[t.length-1])}}};var hr=(()=>{let t=class t{constructor(){this.http=p(Tt),this.store=p(Pt),this.layout=p(z)}getNotifications(i=!1){return this.http.get(`${Gt}${i?`/${de.UNREAD}`:""}`).pipe(S(s=>s.map(n=>new Ht(n))))}wasReadNotification(i){return this.http.patch(`${Gt}/${i}`,null)}deleteNotification(i){return this.http.delete(`${Gt}${i?`/${i}`:""}`)}checkUnreadNotifications(i=!1){this.getNotifications().subscribe(s=>{let n;if(i&&s.length){let o=s[0];n=this.layout.sendNotification("info",o.fromUser.fullName,this.layout.translateString(`${this.layout.translateString(o.content.event)}: <b>${o.content.element}</b>`),null,{enableHtml:!0})}else{let o=s.filter(a=>!a.wasRead).length;o&&(n=this.layout.sendNotification("info","Notifications",this.layout.translateString(o===1?"one_notification":"nb_notifications",{nb:o})))}n&&n.onTap.pipe(be(1)).subscribe(()=>this.layout.showRSideBarTab(yi.NOTIFICATIONS,!0)),this.store.notifications.set(s)})}};t.\u0275fac=function(s){return new(s||t)},t.\u0275prov=wt({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();var E=(function(r){return r.ACCESS="access",r.ACCESS_2FA="access_2fa",r.REFRESH="refresh",r.WS="ws",r.CSRF="csrf",r.CSRF_2FA="csrf_2fa",r})(E||{});var Xo="sync-in-csrf";var me=6;var ur="sync-in-two-fa-code",lr="sync-in-two-fa-password",zo={[E.ACCESS]:"/",[E.REFRESH]:Ri,[E.WS]:Oi,[E.CSRF]:"/",[E.ACCESS_2FA]:xi,[E.CSRF_2FA]:"/"},Zo=[E.REFRESH,E.ACCESS,E.WS,E.CSRF],ta=[E.ACCESS_2FA,E.CSRF_2FA];var Vr=["Password"];function Wr(r,t){r&1&&(f(0,"label",1),b(1,"Password"),_())}function $r(r,t){if(r&1){let e=st();f(0,"div",5),B("click",function(){W(e);let s=D();return $(s.randomPassword())}),f(1,"span"),J(2,"fa-icon",6),_()()}if(r&2){let e=D();m(2),C("icon",e.icons.faDice)}}var pr=(()=>{let t=class t{constructor(){this.passwordChange=new Oe,this.passwordMinLength=8,this.showGenerator=!1,this.showLabel=!1,this.disabled=!1,this.isRequired=!1,this.focus=!1,this.centered=!1,this.locale=p(Ot),this.toggleVisiblePassword=Ei,this.icons={faEye:ti,faEyeSlash:si,faDice:ni}}ngOnInit(){this.focus&&setTimeout(()=>{this.passwordElement.nativeElement.focus(),this.passwordElement.nativeElement.select()},0)}randomPassword(){this.disabled||this.passwordChange.emit(_i(this.passwordMinLength+2))}};t.\u0275fac=function(s){return new(s||t)},t.\u0275cmp=At({type:t,selectors:[["app-input-password"]],viewQuery:function(s,n){if(s&1&&Pe(Vr,7),s&2){let o;Fe(o=Ie())&&(n.passwordElement=o.first)}},inputs:{password:"password",passwordMinLength:"passwordMinLength",placeholder:"placeholder",showGenerator:"showGenerator",showLabel:"showLabel",disabled:"disabled",isRequired:"isRequired",focus:"focus",centered:"centered"},outputs:{passwordChange:"passwordChange"},decls:9,vars:16,consts:[["Password",""],["for","password","l10nTranslate",""],["id","password",1,"input-group","input-group-sm",2,"min-width","150px"],["autocomplete","off","type","password",1,"form-control","form-control-sm","pe-0",3,"ngModelChange","keyup","ngModel","disabled","placeholder","required"],[1,"input-group-text","cursor-pointer"],[1,"input-group-text","cursor-pointer",3,"click"],[3,"icon"]],template:function(s,n){if(s&1){let o=st();k(0,Wr,2,0,"label",1),f(1,"div",2)(2,"input",3,0),Ve(4,"translate"),Me("ngModelChange",function(h){return W(o),De(n.password,h)||(n.password=h),$(h)}),B("keyup",function(){return W(o),$(n.passwordChange.emit(n.password))}),_(),k(5,$r,3,1,"div",4),f(6,"div",5),B("click",function(){W(o);let h=Kt(3);return $(n.toggleVisiblePassword(h))}),f(7,"span"),J(8,"fa-icon",6),_()()()}if(s&2){let o=Kt(3);x(n.showLabel?0:-1),m(2),Le("padding-left",n.centered?"2rem":""),bt("is-invalid",n.isRequired&&(n.password==null?null:n.password.length)<n.passwordMinLength)("text-center",n.centered),Be("ngModel",n.password),C("disabled",n.disabled)("placeholder",We(4,13,n.placeholder,n.locale.language))("required",n.isRequired),m(3),x(n.showGenerator?5:-1),m(3),C("icon",o.type==="text"?n.icons.faEye:n.icons.faEyeSlash)}},dependencies:[Xe,vt,Ct,Qe,Ge,Rt,Nt,kt,ze],encapsulation:2});let r=t;return r})();var fr=(()=>{let t=class t{constructor(){this.autoFocus=!0,this.autoSelect=!0,this.elementRef=p(Re)}ngOnInit(){setTimeout(()=>{this.autoFocus&&this.elementRef.nativeElement.focus(),this.autoSelect&&this.elementRef.nativeElement.select()},0)}};t.\u0275fac=function(s){return new(s||t)},t.\u0275dir=xe({type:t,selectors:[["","appAutofocus",""]],inputs:{autoFocus:"autoFocus",autoSelect:"autoSelect"}});let r=t;return r})();function qr(r,t){r&1&&(f(0,"span",3),b(1,"Two-Factor Authentication"),_())}function Gr(r,t){r&1&&(f(0,"span",3),b(1,"Password Authentication"),_())}function Hr(r,t){if(r&1&&b(0),r&2){let e=D();Ue(" ",e.hasError," ")}}function Yr(r,t){r&1&&b(0," Enter your password ")}function Kr(r,t){r&1&&b(0," Valid with your TOTP code ")}function Qr(r,t){if(r&1){let e=st();f(0,"div",9)(1,"app-input-password",13),B("passwordChange",function(s){W(e);let n=D();return $(n.updatePassword(s))}),_()()}if(r&2){let e=D();m(),C("password",e.twoFaForm.value.password)("focus",!0)("centered",!0)}}function jr(r,t){r&1&&(f(0,"div",14),b(1,"Valid with your TOTP code"),_())}function Jr(r,t){if(r&1&&(k(0,jr,2,0,"div",14),f(1,"div",15),J(2,"input",16),_()),r&2){let e=D();x(e.withPassword?0:-1),m(2),C("autoFocus",!e.withPassword)("autoSelect",!e.withPassword)("maxlength",e.twoFaCodelength)}}var dr=(()=>{let t=class t{constructor(){this.withPassword=!1,this.withTwoFaEnabled=!0,this.submitted=!1,this.hasError=null,this.icons={faKey:Ze,faLock:ri},this.twoFaCodelength=me,this.locale=p(Ot),this.fb=p(Je),this.layout=p(z)}ngOnInit(){this.twoFaForm=this.fb.group({totpCode:this.fb.control("",this.withTwoFaEnabled?[nt.required,nt.pattern(new RegExp(`^\\d{${me}}$`))]:null),password:this.fb.control("",this.withPassword?[nt.required,nt.minLength(8)]:null)})}onClose(i=!1){this.isValid(i),this.layout.closeDialog()}onSubmit(){this.submitted=!0;let i=new $e(O(O({},this.withTwoFaEnabled?{[ur]:this.twoFaForm.value.totpCode}:{}),this.withPassword?{[lr]:this.twoFaForm.value.password}:{}));this.onClose(i)}updatePassword(i){this.twoFaForm.patchValue({password:i})}};t.\u0275fac=function(s){return new(s||t)},t.\u0275cmp=At({type:t,selectors:[["app-user-auth-2fa-verify-dialog"]],inputs:{withPassword:"withPassword",withTwoFaEnabled:"withTwoFaEnabled"},decls:20,vars:9,consts:[[1,"modal-header","align-items-center","justify-content-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"modal-body","modal-auth-verify-2fa"],[1,"card","shadow-sm"],[1,"card-body"],["l10nTranslate","",1,"d-flex","justify-content-center","align-items-center","mb-3"],[3,"ngSubmit","formGroup"],[1,"mb-4"],[1,"d-grid","gap-2"],["type","submit","l10nTranslate","",1,"btn","btn-primary",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["id","password","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",3,"passwordChange","password","focus","centered"],["l10nTranslate","",1,"text-align-center","mb-3"],[1,"mb-3"],["appAutofocus","","type","text","formControlName","totpCode","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022","inputmode","numeric","autocomplete","one-time-code","name","totp",1,"form-control","text-center","fs-4",3,"autoFocus","autoSelect","maxlength"]],template:function(s,n){s&1&&(f(0,"div",0)(1,"h4",1),J(2,"fa-icon",2),k(3,qr,2,0,"span",3)(4,Gr,2,0,"span",3),_()(),f(5,"div",4)(6,"div",5)(7,"div",6)(8,"p",7),k(9,Hr,1,1)(10,Yr,1,0)(11,Kr,1,0),_(),f(12,"form",8),B("ngSubmit",function(){return n.onSubmit()}),k(13,Qr,2,3,"div",9),k(14,Jr,3,4),f(15,"div",10)(16,"button",11),b(17,"Confirm"),_(),f(18,"button",12),B("click",function(){return n.onClose()}),b(19,"Cancel"),_()()()()()()),s&2&&(m(2),C("icon",n.icons.faLock),m(),x(n.withTwoFaEnabled?3:4),m(5),bt("text-danger",n.hasError),m(),x(n.hasError?9:n.withPassword?10:11),m(3),C("formGroup",n.twoFaForm),m(),x(n.withPassword?13:-1),m(),x(n.withTwoFaEnabled?14:-1),m(2),C("disabled",n.twoFaForm.invalid||n.submitted))},dependencies:[Nt,kt,fr,Rt,He,vt,Ct,qe,je,Ye,Ke,pr],encapsulation:2});let r=t;return r})();var Yt=class{constructor(t){this.parentGroup=t.parentGroup,this.members=t.members.map(e=>new T(e))}};var j=class{constructor(t){this.newly=0,this.currentAccessHover=!1,this.setManagers(t),Object.assign(this,t),this.avatarUrl=M(t.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=ai(this.currentAccess).fromNow(!0),this.newly=at(this.currentAccess)}setManagers(t){t?.managers&&(t.managers=t.managers.map(e=>new T(e)))}};var St=class{constructor(t){this.setOnlineStatus(gi("status",t)),this.avatarUrl=M(t.login),Object.assign(this,t)}setOnlineStatus(t){this.onlineStatus=t,this.onlineTextStatus=oi[t]}};var lc=(()=>{let t=class t{constructor(){this.http=p(Tt),this.layout=p(z),this.store=p(Pt),this.webSocket=p(it),this.notifications=p(hr),this.webSocket.fromEvent("connect").subscribe(()=>this.notifications.checkUnreadNotifications()),this.webSocket.fromEvent("disconnect").subscribe(()=>this.store.onlineUsers.set([])),this.webSocket.fromEvent(Ci.EVENTS.NOTIFICATION).subscribe(()=>this.notifications.checkUnreadNotifications(!0)),this.webSocket.fromEvent(ht.EVENTS.ONLINE_USER).pipe(S(i=>new St(i))).subscribe(i=>this.newOnlineUser(i)),this.webSocket.fromEvent(ht.EVENTS.ONLINE_USERS).pipe(S(i=>i.map(s=>new St(s)))).subscribe(i=>this.setOnlineUsers(i)),this.webSocket.fromEvent(ht.EVENTS.ONLINE_STATUS).subscribe(i=>this.receiveOnlineStatus(i))}get user(){return this.store.user.getValue()}initUser(i,s=!1){this.refreshAvatar(),this.layout.setLanguage(i.language).catch(console.error),this.store.userImpersonate.set(s||i.impersonated),this.store.user.next(i),this.checkQuota(this.store.user.getValue()),s&&this.disconnectWebSocket(),this.connectWebSocket()}connectWebSocket(){this.webSocket.ioSocket.io.opts.query={onlineStatus:this.user.onlineStatus},this.webSocket.connect()}disconnectWebSocket(){this.webSocket.disconnect()}setOnlineUsers(i){this.store.onlineUsers.set(i)}newOnlineUser(i){this.store.onlineUsers().find(s=>s.id===i.id)?this.receiveOnlineStatus({userId:i.id,status:i.onlineStatus}):this.store.onlineUsers.update(s=>[i,...s])}userHavePermission(i){return this.user.isAdmin?!0:this.user?this.user.applications.indexOf(i)!==-1:!1}browseGroup(i){return this.http.get(`${fi}${i?`/${i}`:""}`).pipe(S(s=>new Yt(s)))}createPersonalGroup(i){return this.http.post(q,i).pipe(S(s=>new T(s)))}updatePersonalGroup(i,s){return this.http.put(`${q}/${i}`,s).pipe(S(n=>new T(n)))}leavePersonalGroup(i){return this.http.delete(`${di}/${i}`)}addUsersToGroup(i,s){return this.http.patch(`${q}/${i}/${ot.USERS}`,s)}deletePersonalGroup(i){return this.http.delete(`${q}/${i}`)}updateUserFromPersonalGroup(i,s,n){return this.http.patch(`${q}/${i}/${ot.USERS}/${s}`,n)}removeUserFromGroup(i,s){return this.http.delete(`${q}/${i}/${ot.USERS}/${s}`)}listGuests(){return this.http.get(X).pipe(S(i=>i.map(s=>new j(s))))}getGuest(i){return this.http.get(`${X}/${i}`).pipe(S(s=>new j(s)))}createGuest(i){return this.http.post(X,i).pipe(S(s=>new j(s)))}updateGuest(i,s){return this.http.put(`${X}/${i}`,s).pipe(S(n=>n?new j(n):null))}deleteGuest(i){return this.http.delete(`${X}/${i}`)}genAvatar(){this.http.patch(Jt,null).subscribe({next:()=>this.refreshAvatar(),error:i=>this.layout.sendNotification("error","Configuration","Avatar",i)})}uploadAvatar(i){let s=new FormData;s.append("file",i),this.http.put(Jt,s).subscribe({next:()=>this.refreshAvatar(),error:n=>this.layout.sendNotification("error","Configuration","Avatar",n)})}changePassword(i,s){return this.http.put(ui,i,{headers:s})}changeLanguage(i){return this.http.put(hi,i)}changeNotification(i){return this.http.put(li,i)}changeStorageIndexing(i){return this.http.put(pi,i)}changeOnlineStatus(i,s=!0){this.webSocket.emit(ht.EVENTS.ONLINE_STATUS,{status:i,store:s})}receiveOnlineStatus(i){this.user.id===i.userId?this.user.onlineStatus=i.status:this.store.onlineUsers().length&&this.store.onlineUsers.update(s=>s.map(n=>n.id===i.userId?ge(O({},n),{onlineStatus:i.status}):n))}searchMembers(i,s=[]){return this.http.request("search",ot.BASE,{body:i}).pipe(S(n=>n.map(o=>new T(o,s))),Ae(()=>[]))}setMenusVisibility(i){for(let s of i)if(!(s.id&&(s.hide=!this.userHavePermission(s.id),s.hide))&&(s.checks?.length&&(s.hide=!s.checks.map(n=>n.negate?!this[n.prop][n.value]:this[n.prop][n.value]).every(n=>!!n)),s.submenus?.length&&this.setMenusVisibility(s.submenus),s.title===Ai.FILES)){for(let n of s.submenus)if(!n.hide){s.link=n.link;break}}}refreshAvatar(){this.store.userAvatarUrl.next(wi())}checkAppStoreAvailability(){this.http.get(`${jt.BASE}/${jt.APP_STORE}`).subscribe({next:i=>this.store.appStoreManifest.set(i),error:i=>console.error(i)})}getEditorProviderPreference(){return localStorage.getItem("editorPreference")}setEditorProviderPreference(i){i===null?localStorage.removeItem("editorPreference"):localStorage.setItem("editorPreference",i)}listAppPasswords(i){return this.http.get(xt,{headers:i})}generateAppPassword(i,s){return this.http.post(xt,i,{headers:s})}deleteAppPassword(i){return this.http.delete(`${xt}/${i}`)}init2Fa(){return this.http.get(Xt)}enable2Fa(i){return this.http.post(Xt,i)}disable2Fa(i){return this.http.post(ki,i)}adminResetUser2Fa(i,s){return this.http.post(`${Ni}/${i}`,null,{headers:s})}auth2FaVerifyDialog(i=!1){return Se(this,null,function*(){let s=this.store.server().twoFaEnabled&&this.user.twoFaEnabled;if(i||s)return new Promise(n=>{let o=this.layout.openDialog(dr,"xs",{initialState:{withPassword:i,withTwoFaEnabled:s}},{keyboard:!1});o.content.isValid=a=>{n(a)}})})}checkQuota(i){if(!(i.isGuest||i.isLink)&&i.storageQuota){let s=Math.round(100/i.storageQuota*(i.storageQuota-i.storageUsage));s<=1?this.layout.sendNotification("error","Storage Quota","No more space available",null,{disableTimeOut:!0,closeButton:!0}):s<=5?this.layout.sendNotification("warning","Storage Quota",this.layout.translateString("available_space_is_low",{nb:s}),null,{disableTimeOut:!0,closeButton:!0}):s<=10&&this.layout.sendNotification("info","Storage Quota",this.layout.translateString("available_space_is_low",{nb:s}),null,{disableTimeOut:!0,closeButton:!0})}}};t.\u0275fac=function(s){return new(s||t)},t.\u0275prov=wt({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();export{ms as a,_s as b,Ri as c,xi as d,Xo as e,me as f,ur as g,lr as h,_o as i,y as j,hr as k,pr as l,fr as m,V as n,vi as o,ts as p,es as q,is as r,T as s,ls as t,Yt as u,j as v,lc as w};
1
+ import{$a as at,B as Qt,Ba as mi,Cb as z,I as oi,Ma as _i,Mb as Ai,Na as gi,Nb as ct,Pb as bi,Qb as Ti,Ua as yi,W as ci,X as jt,_ as ot,aa as hi,ab as Ei,ba as ui,ca as xt,da as li,ea as pi,fa as Jt,ga as q,ha as fi,ia as di,ja as X,qb as Si,tb as M,ub as wi,vb as Pt}from"./chunk-YWLMFOB4.js";import{Aa as Re,Af as ei,Bb as st,Bd as Je,Cd as Xe,Cf as ii,Dd as Rt,Eb as B,Ed as Ot,G as Ae,Gb as D,If as ri,Jd as ze,Kb as Pe,Kd as kt,L as be,Lb as Fe,Mb as Ie,Oa as m,Pb as Kt,Qa as Oe,Qb as Le,Rb as bt,Tb as b,Vb as Ue,Vc as $e,W as Te,Xb as Be,Yb as De,Yc as Tt,Zb as Me,_f as si,ab as At,bb as ke,c as we,cb as xe,ea as wt,fa as ve,fd as vt,ha as Ce,hd as nt,he as Ze,ie as ti,ja as p,jb as Ne,jd as Ct,kc as Ve,kd as qe,lb as k,mb as x,mc as We,oa as W,od as Ge,pa as $,pd as He,qg as ni,rb as C,sb as f,sd as Ye,sg as Nt,tb as _,td as Ke,ub as J,v as S,yd as Qe,zd as je}from"./chunk-QJVC3SRJ.js";import{n as ai}from"./chunk-DM4NXKEP.js";import{a as O,b as ge,d as ye,e as Ee,i as Se}from"./chunk-KAVP6UXH.js";var V=(function(r){return r.USER="user",r.GUEST="guest",r.LINK="link",r.GROUP="group",r.PGROUP="personal group",r})(V||{});function vi(r,t=[]){let e=O({},Object.fromEntries(Object.entries(Ti).filter(([i,s])=>t.indexOf(i)===-1)));if(!r)return e;for(let i of r.split(":"))i in e&&(e[i]=!0);return e}function ts(r,t,e=[]){let i={};if(!r)return i;for(let s of r.split(":"))e.indexOf(s)===-1&&(i[s]=t.indexOf(s)>-1);return i}function es(r,t=[]){let e={};if(!r)return e;for(let i of r.split(":"))t.indexOf(i)===-1&&(e[i]=bi[i]);return e}function is(r){return Object.entries(r).filter(([t,e])=>e).map(([t,e])=>t).join(":")}var T=class{constructor(t,e=[]){this.newly=0,this.linkSettings=null,Object.assign(this,t),this.mid=`${t.type[0]}${t.id}`,this.hPerms=vi(t.permissions,e),t.login&&(this.avatarUrl=M(t.login)),this.isLink=!!this.linkId,this.isGuest=this.type===V.GUEST,this.isUser=this.isGuest||this.type===V.USER&&!this.isLink,this.isGroup=this.type===V.GROUP||this.type===V.PGROUP,this.isPersonalGroup=this.type===V.PGROUP,this.setGroupRole(),this.modifiedAt?this.newly=at(this.modifiedAt):this.createdAt&&(this.newly=at(this.createdAt))}setGroupRole(t){typeof t<"u"&&(this.groupRole=t),this.isGroupManager=this.groupRole===Qt.MANAGER}};function ls(r,t,e){return new T({id:r.id,login:r.login,name:r.fullName,description:r.email,type:V.USER,spaceRole:t||mi.IS_MEMBER,groupRole:e||Qt.MEMBER,permissions:""})}var Ci={NAME_SPACE:"/",EVENTS:{NOTIFICATION:"notification"}};var ht={NAME_SPACE:"/",EVENTS:{ONLINE_STATUS:"onlineStatus",ONLINE_USERS:"onlineUsers",ONLINE_USER:"onlineUser"}};var l=(function(r){return r.BASE="/api/auth",r.LOGIN="login",r.LOGOUT="logout",r.REFRESH="refresh",r.TOKEN="token",r.TOKEN_REFRESH="token/refresh",r.WS="socket.io",r.TWO_FA_BASE="2fa",r.TWO_FA_ENABLE="enable",r.TWO_FA_DISABLE="disable",r.TWO_FA_LOGIN_VERIFY="login/verify",r.TWO_FA_ADMIN_RESET_USER="reset/user",r})(l||{}),ms=`${l.BASE}/${l.LOGIN}`,_s=`${l.BASE}/${l.LOGOUT}`,Ri=`${l.BASE}/${l.REFRESH}`,gs=`${l.BASE}/${l.TOKEN}`,ys=`${l.BASE}/${l.TOKEN_REFRESH}`,Oi=`/${l.WS}`,Xt=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_ENABLE}`,ki=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_DISABLE}`,xi=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_LOGIN_VERIFY}`,Ni=`${l.BASE}/${l.TWO_FA_BASE}/${l.TWO_FA_ADMIN_RESET_USER}`;var fe={};Ee(fe,{Fetch:()=>mt,Manager:()=>K,NodeWebSocket:()=>L,NodeXHR:()=>I,Socket:()=>H,WebSocket:()=>L,WebTransport:()=>G,XHR:()=>I,connect:()=>Q,default:()=>Q,io:()=>Q,protocol:()=>le});var v=Object.create(null);v.open="0";v.close="1";v.ping="2";v.pong="3";v.message="4";v.upgrade="5";v.noop="6";var ut=Object.create(null);Object.keys(v).forEach(r=>{ut[v[r]]=r});var lt={type:"error",data:"parser error"};var Ii=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Li=typeof ArrayBuffer=="function",Ui=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,pt=({type:r,data:t},e,i)=>Ii&&t instanceof Blob?e?i(t):Pi(t,i):Li&&(t instanceof ArrayBuffer||Ui(t))?e?i(t):Pi(new Blob([t]),i):i(v[r]+(t||"")),Pi=(r,t)=>{let e=new FileReader;return e.onload=function(){let i=e.result.split(",")[1];t("b"+(i||""))},e.readAsDataURL(r)};function Fi(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var zt;function Bi(r,t){if(Ii&&r.data instanceof Blob)return r.data.arrayBuffer().then(Fi).then(t);if(Li&&(r.data instanceof ArrayBuffer||Ui(r.data)))return t(Fi(r.data));pt(r,!1,e=>{zt||(zt=new TextEncoder),t(zt.encode(e))})}var Di="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<Di.length;r++)ft[Di.charCodeAt(r)]=r;var Mi=r=>{let t=r.length*.75,e=r.length,i,s=0,n,o,a,h;r[r.length-1]==="="&&(t--,r[r.length-2]==="="&&t--);let R=new ArrayBuffer(t),A=new Uint8Array(R);for(i=0;i<e;i+=4)n=ft[r.charCodeAt(i)],o=ft[r.charCodeAt(i+1)],a=ft[r.charCodeAt(i+2)],h=ft[r.charCodeAt(i+3)],A[s++]=n<<2|o>>4,A[s++]=(o&15)<<4|a>>2,A[s++]=(a&3)<<6|h&63;return R};var mr=typeof ArrayBuffer=="function",dt=(r,t)=>{if(typeof r!="string")return{type:"message",data:Vi(r,t)};let e=r.charAt(0);return e==="b"?{type:"message",data:_r(r.substring(1),t)}:ut[e]?r.length>1?{type:ut[e],data:r.substring(1)}:{type:ut[e]}:lt},_r=(r,t)=>{if(mr){let e=Mi(r);return Vi(e,t)}else return{base64:!0,data:r}},Vi=(r,t)=>{switch(t){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var Wi="",$i=(r,t)=>{let e=r.length,i=new Array(e),s=0;r.forEach((n,o)=>{pt(n,!1,a=>{i[o]=a,++s===e&&t(i.join(Wi))})})},qi=(r,t)=>{let e=r.split(Wi),i=[];for(let s=0;s<e.length;s++){let n=dt(e[s],t);if(i.push(n),n.type==="error")break}return i};function Gi(){return new TransformStream({transform(r,t){Bi(r,e=>{let i=e.length,s;if(i<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,i);else if(i<65536){s=new Uint8Array(3);let n=new DataView(s.buffer);n.setUint8(0,126),n.setUint16(1,i)}else{s=new Uint8Array(9);let n=new DataView(s.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(i))}r.data&&typeof r.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(e)})}})}var Zt;function It(r){return r.reduce((t,e)=>t+e.length,0)}function Lt(r,t){if(r[0].length===t)return r.shift();let e=new Uint8Array(t),i=0;for(let s=0;s<t;s++)e[s]=r[0][i++],i===r[0].length&&(r.shift(),i=0);return r.length&&i<r[0].length&&(r[0]=r[0].slice(i)),e}function Hi(r,t){Zt||(Zt=new TextDecoder);let e=[],i=0,s=-1,n=!1;return new TransformStream({transform(o,a){for(e.push(o);;){if(i===0){if(It(e)<1)break;let h=Lt(e,1);n=(h[0]&128)===128,s=h[0]&127,s<126?i=3:s===126?i=1:i=2}else if(i===1){if(It(e)<2)break;let h=Lt(e,2);s=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),i=3}else if(i===2){if(It(e)<8)break;let h=Lt(e,8),R=new DataView(h.buffer,h.byteOffset,h.length),A=R.getUint32(0);if(A>Math.pow(2,21)-1){a.enqueue(lt);break}s=A*Math.pow(2,32)+R.getUint32(4),i=3}else{if(It(e)<s)break;let h=Lt(e,s);a.enqueue(dt(n?h:Zt.decode(h),t)),i=0}if(s===0||s>r){a.enqueue(lt);break}}}})}var te=4;function u(r){if(r)return gr(r)}function gr(r){for(var t in u.prototype)r[t]=u.prototype[t];return r}u.prototype.on=u.prototype.addEventListener=function(r,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(t),this};u.prototype.once=function(r,t){function e(){this.off(r,e),t.apply(this,arguments)}return e.fn=t,this.on(r,e),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(r,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var e=this._callbacks["$"+r];if(!e)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var i,s=0;s<e.length;s++)if(i=e[s],i===t||i.fn===t){e.splice(s,1);break}return e.length===0&&delete this._callbacks["$"+r],this};u.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),e=this._callbacks["$"+r],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(e){e=e.slice(0);for(var i=0,s=e.length;i<s;++i)e[i].apply(this,t)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};u.prototype.hasListeners=function(r){return!!this.listeners(r).length};var N=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,e)=>e(t,0),g=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Yi="arraybuffer";function Ut(r,...t){return t.reduce((e,i)=>(r.hasOwnProperty(i)&&(e[i]=r[i]),e),{})}var yr=g.setTimeout,Er=g.clearTimeout;function P(r,t){t.useNativeTimers?(r.setTimeoutFn=yr.bind(g),r.clearTimeoutFn=Er.bind(g)):(r.setTimeoutFn=g.setTimeout.bind(g),r.clearTimeoutFn=g.clearTimeout.bind(g))}var Sr=1.33;function Ki(r){return typeof r=="string"?wr(r):Math.ceil((r.byteLength||r.size)*Sr)}function wr(r){let t=0,e=0;for(let i=0,s=r.length;i<s;i++)t=r.charCodeAt(i),t<128?e+=1:t<2048?e+=2:t<55296||t>=57344?e+=3:(i++,e+=4);return e}function Bt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Qi(r){let t="";for(let e in r)r.hasOwnProperty(e)&&(t.length&&(t+="&"),t+=encodeURIComponent(e)+"="+encodeURIComponent(r[e]));return t}function ji(r){let t={},e=r.split("&");for(let i=0,s=e.length;i<s;i++){let n=e[i].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}var Dt=class extends Error{constructor(t,e,i){super(t),this.description=e,this.context=i,this.type="TransportError"}},F=class extends u{constructor(t){super(),this.writable=!1,P(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,e,i){return super.emitReserved("error",new Dt(t,e,i)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let e=dt(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){let t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_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(t){let e=Qi(t);return e.length?"?"+e:""}};var Z=class extends F{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let e=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let i=0;this._polling&&(i++,this.once("pollComplete",function(){--i||e()})),this.writable||(i++,this.once("drain",function(){--i||e()}))}else e()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let e=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)};qi(t,this.socket.binaryType).forEach(e),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,$i(t,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",e=this.query||{};return this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=Bt()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.createUri(t,e)}};var Ji=!1;try{Ji=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Xi=Ji;function Ar(){}var ee=class extends Z{constructor(t){if(super(t),typeof location<"u"){let e=location.protocol==="https:",i=location.port;i||(i=e?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}}doWrite(t,e){let i=this.request({method:"POST",data:t});i.on("success",e),i.on("error",(s,n)=>{this.onError("xhr post error",s,n)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=t}},Mt=(()=>{class r extends u{constructor(e,i,s){super(),this.createRequest=e,P(this,s),this._opts=s,this._method=s.method||"GET",this._uri=i,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;let i=Ut(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let s=this._xhr=this.createRequest(i);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&s.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var n;s.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.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=Ar,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",zi);else if(typeof addEventListener=="function"){let r="onpagehide"in g?"pagehide":"unload";addEventListener(r,zi,!1)}}function zi(){for(let r in Mt.requests)Mt.requests.hasOwnProperty(r)&&Mt.requests[r].abort()}var br=(function(){let r=Zi({xdomain:!1});return r&&r.responseType!==null})(),I=class extends ee{constructor(t){super(t);let e=t&&t.forceBase64;this.supportsBinary=br&&!e}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Mt(Zi,this.uri(),t)}};function Zi(r){let t=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Xi))return new XMLHttpRequest}catch{}if(!t)try{return new g[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var tr=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",re=class extends F{get name(){return"websocket"}doOpen(){let t=this.uri(),e=this.opts.protocols,i=tr?{}:Ut(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=this.createSocket(t,e,i)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let i=t[e],s=e===t.length-1;pt(i,this.supportsBinary,n=>{try{this.doWrite(i,n)}catch{}s&&N(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=Bt()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}},ie=g.WebSocket||g.MozWebSocket,L=class extends re{createSocket(t,e,i){return tr?new ie(t,e,i):e?new ie(t,e):new ie(t)}doWrite(t,e){this.ws.send(e)}};var G=class extends F{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{let e=Hi(Number.MAX_SAFE_INTEGER,this.socket.binaryType),i=t.readable.pipeThrough(e).getReader(),s=Gi();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();let n=()=>{i.read().then(({done:a,value:h})=>{a||(this.onPacket(h),n())}).catch(a=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let i=t[e],s=e===t.length-1;this._writer.write(i).then(()=>{s&&N(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}};var se={websocket:L,webtransport:G,polling:I};var Tr=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function tt(r){if(r.length>8e3)throw"URI too long";let t=r,e=r.indexOf("["),i=r.indexOf("]");e!=-1&&i!=-1&&(r=r.substring(0,e)+r.substring(e,i).replace(/:/g,";")+r.substring(i,r.length));let s=Tr.exec(r||""),n={},o=14;for(;o--;)n[vr[o]]=s[o]||"";return e!=-1&&i!=-1&&(n.source=t,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=Cr(n,n.path),n.queryKey=Rr(n,n.query),n}function Cr(r,t){let e=/\/{2,9}/g,i=t.replace(e,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&i.splice(0,1),t.slice(-1)=="/"&&i.splice(i.length-1,1),i}function Rr(r,t){let e={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,s,n){s&&(e[s]=n)}),e}var ne=typeof addEventListener=="function"&&typeof removeEventListener=="function",Vt=[];ne&&addEventListener("offline",()=>{Vt.forEach(r=>r())},!1);var Wt=(()=>{class r extends u{constructor(e,i){if(super(),this.binaryType=Yi,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(i=e,e=null),e){let s=tt(e);i.hostname=s.host,i.secure=s.protocol==="https"||s.protocol==="wss",i.port=s.port,s.query&&(i.query=s.query)}else i.host&&(i.hostname=tt(i.host).host);P(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(s=>{let n=s.prototype.name;this.transports.push(n),this._transportsByName[n]=s}),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},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ji(this.opts.query)),ne&&(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"})},Vt.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let i=Object.assign({},this.opts.query);i.EIO=te,i.transport=e,this.id&&(i.sid=this.id);let s=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let e=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(e);i.open(),this.setTransport(i)}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",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",r.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":let i=new Error("server error");i.code=e.data,this._onError(i);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);let 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){let 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 i=1;for(let s=0;s<this.writeBuffer.length;s++){let n=this.writeBuffer[s].data;if(n&&(i+=Ki(n)),s>0&&i>this._maxPayload)return this.writeBuffer.slice(0,s);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,N(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,i,s){return this._sendPacket("message",e,i,s),this}send(e,i,s){return this._sendPacket("message",e,i,s),this}_sendPacket(e,i,s,n){if(typeof i=="function"&&(n=i,i=void 0),typeof s=="function"&&(n=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;let o={type:e,data:i,options:s};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},s=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(r.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,i){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(),ne&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let s=Vt.indexOf(this._offlineEventListener);s!==-1&&Vt.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=te,r})(),$t=class extends Wt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let e=this.createTransport(t),i=!1;Wt.priorWebsocketSuccess=!1;let s=()=>{i||(e.send([{type:"ping",data:"probe"}]),e.once("packet",U=>{if(!i)if(U.type==="pong"&&U.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;Wt.priorWebsocketSuccess=e.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(A(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{let rt=new Error("probe error");rt.transport=e.name,this.emitReserved("upgradeError",rt)}}))};function n(){i||(i=!0,A(),e.close(),e=null)}let o=U=>{let rt=new Error("probe error: "+U);rt.transport=e.name,n(),this.emitReserved("upgradeError",rt)};function a(){o("transport closed")}function h(){o("socket closed")}function R(U){e&&U.name!==e.name&&n()}let A=()=>{e.removeListener("open",s),e.removeListener("error",o),e.removeListener("close",a),this.off("close",h),this.off("upgrading",R)};e.once("open",s),e.once("error",o),e.once("close",a),this.once("close",h),this.once("upgrading",R),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{i||e.open()},200):e.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let e=[];for(let i=0;i<t.length;i++)~this.transports.indexOf(t[i])&&e.push(t[i]);return e}},et=class extends $t{constructor(t,e={}){let i=typeof t=="object"?t:e;(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(s=>se[s]).filter(s=>!!s)),super(t,i)}};var mt=class extends Z{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(e=>this.onData(e))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,e){this._fetch(t).then(i=>{if(!i.ok)return this.onError("fetch write error",i.status,i);e()}).catch(i=>{this.onError("fetch write error",i)})}_fetch(t){var e;let i=t!==void 0,s=new Headers(this.opts.extraHeaders);return i&&s.set("content-type","text/plain;charset=UTF-8"),(e=this.socket._cookieJar)===null||e===void 0||e.appendCookies(s),fetch(this.uri(),{method:i?"POST":"GET",body:i?t:null,headers:s,credentials:this.opts.withCredentials?"include":"omit"}).then(n=>{var o;return(o=this.socket._cookieJar)===null||o===void 0||o.parseCookies(n.headers.getSetCookie()),n})}};var vn=et.protocol;function er(r,t="",e){let i=r;e=e||typeof location<"u"&&location,r==null&&(r=e.protocol+"//"+e.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=e.protocol+r:r=e.host+r),/^(https?|wss?):\/\//.test(r)||(typeof e<"u"?r=e.protocol+"//"+r:r="https://"+r),i=tt(r)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let n=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+n+":"+i.port+t,i.href=i.protocol+"://"+n+(e&&e.port===i.port?"":":"+i.port),i}var pe={};Ee(pe,{Decoder:()=>he,Encoder:()=>ce,PacketType:()=>c,isPacketValid:()=>Ur,protocol:()=>le});var Or=typeof ArrayBuffer=="function",kr=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,ir=Object.prototype.toString,xr=typeof Blob=="function"||typeof Blob<"u"&&ir.call(Blob)==="[object BlobConstructor]",Nr=typeof File=="function"||typeof File<"u"&&ir.call(File)==="[object FileConstructor]";function gt(r){return Or&&(r instanceof ArrayBuffer||kr(r))||xr&&r instanceof Blob||Nr&&r instanceof File}function _t(r,t){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let e=0,i=r.length;e<i;e++)if(_t(r[e]))return!0;return!1}if(gt(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return _t(r.toJSON(),!0);for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&_t(r[e]))return!0;return!1}function rr(r){let t=[],e=r.data,i=r;return i.data=oe(e,t),i.attachments=t.length,{packet:i,buffers:t}}function oe(r,t){if(!r)return r;if(gt(r)){let e={_placeholder:!0,num:t.length};return t.push(r),e}else if(Array.isArray(r)){let e=new Array(r.length);for(let i=0;i<r.length;i++)e[i]=oe(r[i],t);return e}else if(typeof r=="object"&&!(r instanceof Date)){let e={};for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=oe(r[i],t));return e}return r}function sr(r,t){return r.data=ae(r.data,t),delete r.attachments,r}function ae(r,t){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<t.length)return t[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=ae(r[e],t);else if(typeof r=="object")for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=ae(r[e],t));return r}var nr=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],le=5,c=(function(r){return 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",r})(c||{}),ce=class{constructor(t){this.replacer=t}encode(t){return(t.type===c.EVENT||t.type===c.ACK)&&_t(t)?this.encodeAsBinary({type:t.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let e=""+t.type;return(t.type===c.BINARY_EVENT||t.type===c.BINARY_ACK)&&(e+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(e+=t.nsp+","),t.id!=null&&(e+=t.id),t.data!=null&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){let e=rr(t),i=this.encodeAsString(e.packet),s=e.buffers;return s.unshift(i),s}},he=class r extends u{constructor(t){super(),this.reviver=t}add(t){let e;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);let i=e.type===c.BINARY_EVENT;i||e.type===c.BINARY_ACK?(e.type=i?c.EVENT:c.ACK,this.reconstructor=new ue(e),e.attachments===0&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else if(gt(t)||t.base64)if(this.reconstructor)e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let e=0,i={type:Number(t.charAt(0))};if(c[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===c.BINARY_EVENT||i.type===c.BINARY_ACK){let n=e+1;for(;t.charAt(++e)!=="-"&&e!=t.length;);let o=t.substring(n,e);if(o!=Number(o)||t.charAt(e)!=="-")throw new Error("Illegal attachments");i.attachments=Number(o)}if(t.charAt(e+1)==="/"){let n=e+1;for(;++e&&!(t.charAt(e)===","||e===t.length););i.nsp=t.substring(n,e)}else i.nsp="/";let s=t.charAt(e+1);if(s!==""&&Number(s)==s){let n=e+1;for(;++e;){let o=t.charAt(e);if(o==null||Number(o)!=o){--e;break}if(e===t.length)break}i.id=Number(t.substring(n,e+1))}if(t.charAt(++e)){let n=this.tryParse(t.substr(e));if(r.isPayloadValid(i.type,n))i.data=n;else throw new Error("invalid payload")}return i}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,e){switch(t){case c.CONNECT:return qt(e);case c.DISCONNECT:return e===void 0;case c.CONNECT_ERROR:return typeof e=="string"||qt(e);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&nr.indexOf(e[0])===-1);case c.ACK:case c.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ue=class{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){let e=sr(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function Pr(r){return typeof r=="string"}var Fr=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function Ir(r){return r===void 0||Fr(r)}function qt(r){return Object.prototype.toString.call(r)==="[object Object]"}function Lr(r,t){switch(r){case c.CONNECT:return t===void 0||qt(t);case c.DISCONNECT:return t===void 0;case c.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&nr.indexOf(t[0])===-1);case c.ACK:return Array.isArray(t);case c.CONNECT_ERROR:return typeof t=="string"||qt(t);default:return!1}}function Ur(r){return Pr(r.nsp)&&Ir(r.id)&&Lr(r.type,r.data)}function w(r,t,e){return r.on(t,e),function(){r.off(t,e)}}var Br=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),H=class extends u{constructor(t,e,i){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=t,this.nsp=e,i&&i.auth&&(this.auth=i.auth),this._opts=Object.assign({},i),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[w(t,"open",this.onopen.bind(this)),w(t,"packet",this.onpacket.bind(this)),w(t,"error",this.onerror.bind(this)),w(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){var i,s,n;if(Br.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;let o={type:c.EVENT,data:e};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof e[e.length-1]=="function"){let A=this.ids++,U=e.pop();this._registerAckCallback(A,U),o.id=A}let a=(s=(i=this.io.engine)===null||i===void 0?void 0:i.transport)===null||s===void 0?void 0:s.writable,h=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(h?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,e){var i;let s=(i=this.flags.timeout)!==null&&i!==void 0?i:this._opts.ackTimeout;if(s===void 0){this.acks[t]=e;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);e.call(this,new Error("operation has timed out"))},s),o=(...a)=>{this.io.clearTimeoutFn(n),e.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...e){return new Promise((i,s)=>{let n=(o,a)=>o?s(o):i(a);n.withError=!0,e.push(n),this.emit(t,...e)})}_addToQueue(t){let e;typeof t[t.length-1]=="function"&&(e=t.pop());let i={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...n)=>(this._queue[0],s!==null?i.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(s)):(this._queue.shift(),e&&e(null,...n)),i.pending=!1,this._drainQueue())),this._queue.push(i),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;let e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:c.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(i=>String(i.id)===t)){let i=this.acks[t];delete this.acks[t],i.withError&&i.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case c.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 c.EVENT:case c.BINARY_EVENT:this.onevent(t);break;case c.ACK:case c.BINARY_ACK:this.onack(t);break;case c.DISCONNECT:this.ondisconnect();break;case c.CONNECT_ERROR:this.destroy();let i=new Error(t.data.message);i.data=t.data.data,this.emitReserved("connect_error",i);break}}onevent(t){let e=t.data||[];t.id!=null&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let e=this._anyListeners.slice();for(let i of e)i.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){let e=this,i=!1;return function(...s){i||(i=!0,e.packet({type:c.ACK,id:t,data:s}))}}onack(t){let e=this.acks[t.id];typeof e=="function"&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:c.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let e=this._anyListeners;for(let i=0;i<e.length;i++)if(t===e[i])return e.splice(i,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let e=this._anyOutgoingListeners;for(let i=0;i<e.length;i++)if(t===e[i])return e.splice(i,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let e=this._anyOutgoingListeners.slice();for(let i of e)i.apply(this,t.data)}}};function Y(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}Y.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),e=Math.floor(t*this.jitter*r);r=(Math.floor(t*10)&1)==0?r-e:r+e}return Math.min(r,this.max)|0};Y.prototype.reset=function(){this.attempts=0};Y.prototype.setMin=function(r){this.ms=r};Y.prototype.setMax=function(r){this.max=r};Y.prototype.setJitter=function(r){this.jitter=r};var K=class extends u{constructor(t,e){var i;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.opts=e,P(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((i=e.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new Y({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=t;let s=e.parser||pe;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(e=this.backoff)===null||e===void 0||e.setMin(t),this)}randomizationFactor(t){var e;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(e=this.backoff)===null||e===void 0||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(e=this.backoff)===null||e===void 0||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new et(this.uri,this.opts);let e=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;let s=w(e,"open",function(){i.onopen(),t&&t()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=w(e,"error",n);if(this._timeout!==!1){let a=this._timeout,h=this.setTimeoutFn(()=>{s(),n(new Error("timeout")),e.close()},a);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(s),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(w(t,"ping",this.onping.bind(this)),w(t,"data",this.ondata.bind(this)),w(t,"error",this.onerror.bind(this)),w(t,"close",this.onclose.bind(this)),w(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(e){this.onclose("parse error",e)}}ondecoded(t){N(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let i=this.nsps[t];return i?this._autoConnect&&!i.active&&i.connect():(i=new H(this,t,e),this.nsps[t]=i),i}_destroy(t){let e=Object.keys(this.nsps);for(let i of e)if(this.nsps[i].active)return;this._close()}_packet(t){let e=this.encoder.encode(t);for(let i=0;i<e.length;i++)this.engine.write(e[i],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var i;this.cleanup(),(i=this.engine)===null||i===void 0||i.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let e=this.backoff.duration();this._reconnecting=!0;let i=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},e);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};var yt={};function Q(r,t){typeof r=="object"&&(t=r,r=void 0),t=t||{};let e=er(r,t.path||"/socket.io"),i=e.source,s=e.id,n=e.path,o=yt[s]&&n in yt[s].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o,h;return a?h=new K(i,t):(yt[s]||(yt[s]=new K(i,t)),h=yt[s]),e.query&&!t.query&&(t.query=e.queryKey),h.socket(e.path,t)}Object.assign(Q,{Manager:K,Socket:H,io:Q,connect:Q});var it=class r{config;appRef;subscribersCounter={};eventObservables$={};namespaces={};ioSocket;emptyConfig={url:"",options:{}};constructor(t,e){this.config=t,this.appRef=e,t===void 0&&(t=this.emptyConfig);let i=t.url,s=t.options,n=Q?Q:fe;this.ioSocket=n(i,s)}get auth(){return this.ioSocket.auth}set auth(t){this.ioSocket.auth=t}get io(){return this.ioSocket.io}get open(){return this.connect}get close(){return this.disconnect}of(t){if(!t||t==="/")return this;let e=this.namespaces[t];if(e)return e;let a=this.config,{url:i}=a,s=ye(a,["url"]),n=O({url:!i.endsWith("/")&&!t.startsWith("/")?`${i}/${t}`:`${i}${t}`},s),o=new r(n,this.appRef);return this.namespaces[t]=o,o}on(t,e){return this.ioSocket.on(t,e),this}once(t,e){return this.ioSocket.once(t,e),this}connect(){return this.ioSocket.connect(),this}disconnect(){return this.ioSocket.disconnect(),this}emit(t,...e){return this.ioSocket.emit(t,...e),this}send(...t){return this.ioSocket.send.apply(this.ioSocket,arguments),this}emitWithAck(t,...e){return this.ioSocket.emitWithAck(t,...e)}removeListener(t,e){return this.ioSocket.removeListener(t,e),this}removeAllListeners(t){return this.ioSocket.removeAllListeners(t),this}fromEvent(t){return this.subscribersCounter[t]||(this.subscribersCounter[t]=0),this.subscribersCounter[t]++,this.eventObservables$[t]||(this.eventObservables$[t]=new we(e=>{let i=s=>{e.next(s),this.appRef.tick()};return this.ioSocket.on(t,i),()=>{this.subscribersCounter[t]--,this.subscribersCounter[t]===0&&(this.ioSocket.removeListener(t,i),delete this.eventObservables$[t])}}).pipe(Te())),this.eventObservables$[t]}fromOneTimeEvent(t){return new Promise(e=>this.once(t,e))}listeners(t){return this.ioSocket.listeners(t)}hasListeners(t){return this.ioSocket.hasListeners(t)}listenersAny(){return this.ioSocket.listenersAny()}listenersAnyOutgoing(){return this.ioSocket.listenersAnyOutgoing()}off(t,e){return this.ioSocket.off(t,e),this}offAny(t){return this.ioSocket.offAny(t),this}offAnyOutgoing(t){return this.ioSocket.offAnyOutgoing(t),this}onAny(t){return this.ioSocket.onAny(t),this}onAnyOutgoing(t){return this.ioSocket.onAnyOutgoing(t),this}prependAny(t){return this.ioSocket.prependAny(t),this}prependAnyOutgoing(t){return this.ioSocket.prependAnyOutgoing(t),this}timeout(t){return this.ioSocket.timeout(t),this}get volatile(){let t=this.ioSocket.volatile;return this}get active(){return this.ioSocket.active}get connected(){return this.ioSocket.connected}get disconnected(){return this.ioSocket.disconnected}get recovered(){return this.ioSocket.recovered}get id(){return this.ioSocket.id}compress(t){return this.ioSocket.compress(t),this}};function Dr(r,t){return new it(r,t)}var or=new Ce("__SOCKET_IO_CONFIG__"),_o=(()=>{class r{static forRoot(e){return{ngModule:r,providers:[{provide:or,useValue:e},{provide:it,useFactory:Dr,deps:[or,Ne]}]}}static \u0275fac=function(i){return new(i||r)};static \u0275mod=ke({type:r});static \u0275inj=ve({})}return r})();var de={BASE:`${ci}/notifications`,UNREAD:"unread"},Gt=de.BASE;var d=(function(r){return r.ADD="add",r.UPDATE="update",r.DELETE="delete",r.DELETE_PERMANENTLY="deletePermanently",r})(d||{});var y=(function(r){return r.COMMENTS="comments",r.SPACES="spaces",r.SPACE_ROOTS="spaces_roots",r.SHARES="shares",r.LINKS="links",r.SYNC="sync",r.AUTH_LOCKED="auth_locked",r.AUTH_2FA="auth_2fa",r.UNLOCK_REQUEST="unlock_request",r.UPDATE_AVAILABLE="server_update_available",r})(y||{}),bo={COMMENTS:"commented",SPACES:{[d.ADD]:"You now have access to the space",[d.DELETE]:"You no longer have access to the space",[d.DELETE_PERMANENTLY]:"This space has been permanently deleted"},SPACE_ROOTS:{[d.ADD]:"anchored",[d.DELETE]:"unanchored"},SHARES:{[d.ADD]:"shared with you",[d.DELETE]:"no longer share with you"},SHARES_WITHOUT_OWNER:{[d.ADD]:"You now have access to the share",[d.DELETE]:"You no longer have access to the share",[d.DELETE_PERMANENTLY]:"You are no longer a member of the parent share, your child share has been deleted"},LINKS:{[d.ADD]:"shared with you",[d.UPDATE]:"You now have access to the space"},SYNC:{[d.DELETE]:"You are no longer synchronizing"},AUTH_2FA:{[d.ADD]:"Two-factor authentication (2FA) on your account has been enabled",[d.DELETE]:"Two-factor authentication (2FA) on your account has been disabled"},AUTH_LOCKED:{[d.DELETE]:"Your account has been locked after several unsuccessful authentication attempts"},UNLOCK_REQUEST:"sends you a request to unlock the file",UPDATE_AVAILABLE:"A new update is available"};var ar=ii;var cr={[y.COMMENTS]:ar,[y.SPACES]:ct.SPACES,[y.SPACE_ROOTS]:ct.SPACES,[y.SHARES]:ct.SHARES,[y.LINKS]:ct.LINKS,[y.SYNC]:Si.SYNC,[y.UNLOCK_REQUEST]:ei};var Ht=class{constructor(t){this.soonRead=!1,Object.assign(this,t),this.fromUser?this.fromUser.avatarUrl=M(this.fromUser.login):this.fromUser={id:-1,login:null,email:null,fullName:"Info",avatarUrl:null},this.appIcon=cr[this.content.app],this.setMainElement()}setMainElement(){if(!(this.content.app===y.COMMENTS||this.content.app===y.SHARES||this.content.app===y.UPDATE_AVAILABLE||this.content.app===y.SYNC)&&this.content?.url){let t=this.content.url.split("/");t.length>1&&(this.mainElement=t[t.length-1])}}};var hr=(()=>{let t=class t{constructor(){this.http=p(Tt),this.store=p(Pt),this.layout=p(z)}getNotifications(i=!1){return this.http.get(`${Gt}${i?`/${de.UNREAD}`:""}`).pipe(S(s=>s.map(n=>new Ht(n))))}wasReadNotification(i){return this.http.patch(`${Gt}/${i}`,null)}deleteNotification(i){return this.http.delete(`${Gt}${i?`/${i}`:""}`)}checkUnreadNotifications(i=!1){this.getNotifications().subscribe(s=>{let n;if(i&&s.length){let o=s[0];n=this.layout.sendNotification("info",o.fromUser.fullName,this.layout.translateString(`${this.layout.translateString(o.content.event)}: <b>${o.content.element}</b>`),null,{enableHtml:!0})}else{let o=s.filter(a=>!a.wasRead).length;o&&(n=this.layout.sendNotification("info","Notifications",this.layout.translateString(o===1?"one_notification":"nb_notifications",{nb:o})))}n&&n.onTap.pipe(be(1)).subscribe(()=>this.layout.showRSideBarTab(yi.NOTIFICATIONS,!0)),this.store.notifications.set(s)})}};t.\u0275fac=function(s){return new(s||t)},t.\u0275prov=wt({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();var E=(function(r){return r.ACCESS="access",r.ACCESS_2FA="access_2fa",r.REFRESH="refresh",r.WS="ws",r.CSRF="csrf",r.CSRF_2FA="csrf_2fa",r})(E||{});var Xo="sync-in-csrf";var me=6;var ur="sync-in-two-fa-code",lr="sync-in-two-fa-password",zo={[E.ACCESS]:"/",[E.REFRESH]:Ri,[E.WS]:Oi,[E.CSRF]:"/",[E.ACCESS_2FA]:xi,[E.CSRF_2FA]:"/"},Zo=[E.REFRESH,E.ACCESS,E.WS,E.CSRF],ta=[E.ACCESS_2FA,E.CSRF_2FA];var Vr=["Password"];function Wr(r,t){r&1&&(f(0,"label",1),b(1,"Password"),_())}function $r(r,t){if(r&1){let e=st();f(0,"div",5),B("click",function(){W(e);let s=D();return $(s.randomPassword())}),f(1,"span"),J(2,"fa-icon",6),_()()}if(r&2){let e=D();m(2),C("icon",e.icons.faDice)}}var pr=(()=>{let t=class t{constructor(){this.passwordChange=new Oe,this.passwordMinLength=8,this.showGenerator=!1,this.showLabel=!1,this.disabled=!1,this.isRequired=!1,this.focus=!1,this.centered=!1,this.locale=p(Ot),this.toggleVisiblePassword=Ei,this.icons={faEye:ti,faEyeSlash:si,faDice:ni}}ngOnInit(){this.focus&&setTimeout(()=>{this.passwordElement.nativeElement.focus(),this.passwordElement.nativeElement.select()},0)}randomPassword(){this.disabled||this.passwordChange.emit(_i(this.passwordMinLength+2))}};t.\u0275fac=function(s){return new(s||t)},t.\u0275cmp=At({type:t,selectors:[["app-input-password"]],viewQuery:function(s,n){if(s&1&&Pe(Vr,7),s&2){let o;Fe(o=Ie())&&(n.passwordElement=o.first)}},inputs:{password:"password",passwordMinLength:"passwordMinLength",placeholder:"placeholder",showGenerator:"showGenerator",showLabel:"showLabel",disabled:"disabled",isRequired:"isRequired",focus:"focus",centered:"centered"},outputs:{passwordChange:"passwordChange"},decls:9,vars:16,consts:[["Password",""],["for","password","l10nTranslate",""],["id","password",1,"input-group","input-group-sm",2,"min-width","150px"],["autocomplete","off","type","password",1,"form-control","form-control-sm","pe-0",3,"ngModelChange","keyup","ngModel","disabled","placeholder","required"],[1,"input-group-text","cursor-pointer"],[1,"input-group-text","cursor-pointer",3,"click"],[3,"icon"]],template:function(s,n){if(s&1){let o=st();k(0,Wr,2,0,"label",1),f(1,"div",2)(2,"input",3,0),Ve(4,"translate"),Me("ngModelChange",function(h){return W(o),De(n.password,h)||(n.password=h),$(h)}),B("keyup",function(){return W(o),$(n.passwordChange.emit(n.password))}),_(),k(5,$r,3,1,"div",4),f(6,"div",5),B("click",function(){W(o);let h=Kt(3);return $(n.toggleVisiblePassword(h))}),f(7,"span"),J(8,"fa-icon",6),_()()()}if(s&2){let o=Kt(3);x(n.showLabel?0:-1),m(2),Le("padding-left",n.centered?"2rem":""),bt("is-invalid",n.isRequired&&(n.password==null?null:n.password.length)<n.passwordMinLength)("text-center",n.centered),Be("ngModel",n.password),C("disabled",n.disabled)("placeholder",We(4,13,n.placeholder,n.locale.language))("required",n.isRequired),m(3),x(n.showGenerator?5:-1),m(3),C("icon",o.type==="text"?n.icons.faEye:n.icons.faEyeSlash)}},dependencies:[Xe,vt,Ct,Qe,Ge,Rt,Nt,kt,ze],encapsulation:2});let r=t;return r})();var fr=(()=>{let t=class t{constructor(){this.autoFocus=!0,this.autoSelect=!0,this.elementRef=p(Re)}ngOnInit(){setTimeout(()=>{this.autoFocus&&this.elementRef.nativeElement.focus(),this.autoSelect&&this.elementRef.nativeElement.select()},0)}};t.\u0275fac=function(s){return new(s||t)},t.\u0275dir=xe({type:t,selectors:[["","appAutofocus",""]],inputs:{autoFocus:"autoFocus",autoSelect:"autoSelect"}});let r=t;return r})();function qr(r,t){r&1&&(f(0,"span",3),b(1,"Two-Factor Authentication"),_())}function Gr(r,t){r&1&&(f(0,"span",3),b(1,"Password Authentication"),_())}function Hr(r,t){if(r&1&&b(0),r&2){let e=D();Ue(" ",e.hasError," ")}}function Yr(r,t){r&1&&b(0," Enter your password ")}function Kr(r,t){r&1&&b(0," Valid with your TOTP code ")}function Qr(r,t){if(r&1){let e=st();f(0,"div",9)(1,"app-input-password",13),B("passwordChange",function(s){W(e);let n=D();return $(n.updatePassword(s))}),_()()}if(r&2){let e=D();m(),C("password",e.twoFaForm.value.password)("focus",!0)("centered",!0)}}function jr(r,t){r&1&&(f(0,"div",14),b(1,"Valid with your TOTP code"),_())}function Jr(r,t){if(r&1&&(k(0,jr,2,0,"div",14),f(1,"div",15),J(2,"input",16),_()),r&2){let e=D();x(e.withPassword?0:-1),m(2),C("autoFocus",!e.withPassword)("autoSelect",!e.withPassword)("maxlength",e.twoFaCodelength)}}var dr=(()=>{let t=class t{constructor(){this.withPassword=!1,this.withTwoFaEnabled=!0,this.submitted=!1,this.hasError=null,this.icons={faKey:Ze,faLock:ri},this.twoFaCodelength=me,this.locale=p(Ot),this.fb=p(Je),this.layout=p(z)}ngOnInit(){this.twoFaForm=this.fb.group({totpCode:this.fb.control("",this.withTwoFaEnabled?[nt.required,nt.pattern(new RegExp(`^\\d{${me}}$`))]:null),password:this.fb.control("",this.withPassword?[nt.required,nt.minLength(8)]:null)})}onClose(i=!1){this.isValid(i),this.layout.closeDialog()}onSubmit(){this.submitted=!0;let i=new $e(O(O({},this.withTwoFaEnabled?{[ur]:this.twoFaForm.value.totpCode}:{}),this.withPassword?{[lr]:this.twoFaForm.value.password}:{}));this.onClose(i)}updatePassword(i){this.twoFaForm.patchValue({password:i})}};t.\u0275fac=function(s){return new(s||t)},t.\u0275cmp=At({type:t,selectors:[["app-user-auth-2fa-verify-dialog"]],inputs:{withPassword:"withPassword",withTwoFaEnabled:"withTwoFaEnabled"},decls:20,vars:9,consts:[[1,"modal-header","align-items-center","justify-content-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"modal-body","modal-auth-verify-2fa"],[1,"card","shadow-sm"],[1,"card-body"],["l10nTranslate","",1,"d-flex","justify-content-center","align-items-center","mb-3"],[3,"ngSubmit","formGroup"],[1,"mb-4"],[1,"d-grid","gap-2"],["type","submit","l10nTranslate","",1,"btn","btn-primary",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["id","password","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",3,"passwordChange","password","focus","centered"],["l10nTranslate","",1,"text-align-center","mb-3"],[1,"mb-3"],["appAutofocus","","type","text","formControlName","totpCode","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022","inputmode","numeric","autocomplete","one-time-code","name","totp",1,"form-control","text-center","fs-4",3,"autoFocus","autoSelect","maxlength"]],template:function(s,n){s&1&&(f(0,"div",0)(1,"h4",1),J(2,"fa-icon",2),k(3,qr,2,0,"span",3)(4,Gr,2,0,"span",3),_()(),f(5,"div",4)(6,"div",5)(7,"div",6)(8,"p",7),k(9,Hr,1,1)(10,Yr,1,0)(11,Kr,1,0),_(),f(12,"form",8),B("ngSubmit",function(){return n.onSubmit()}),k(13,Qr,2,3,"div",9),k(14,Jr,3,4),f(15,"div",10)(16,"button",11),b(17,"Confirm"),_(),f(18,"button",12),B("click",function(){return n.onClose()}),b(19,"Cancel"),_()()()()()()),s&2&&(m(2),C("icon",n.icons.faLock),m(),x(n.withTwoFaEnabled?3:4),m(5),bt("text-danger",n.hasError),m(),x(n.hasError?9:n.withPassword?10:11),m(3),C("formGroup",n.twoFaForm),m(),x(n.withPassword?13:-1),m(),x(n.withTwoFaEnabled?14:-1),m(2),C("disabled",n.twoFaForm.invalid||n.submitted))},dependencies:[Nt,kt,fr,Rt,He,vt,Ct,qe,je,Ye,Ke,pr],encapsulation:2});let r=t;return r})();var Yt=class{constructor(t){this.parentGroup=t.parentGroup,this.members=t.members.map(e=>new T(e))}};var j=class{constructor(t){this.newly=0,this.currentAccessHover=!1,this.setManagers(t),Object.assign(this,t),this.avatarUrl=M(t.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=ai(this.currentAccess).fromNow(!0),this.newly=at(this.currentAccess)}setManagers(t){t?.managers&&(t.managers=t.managers.map(e=>new T(e)))}};var St=class{constructor(t){this.setOnlineStatus(gi("status",t)),this.avatarUrl=M(t.login),Object.assign(this,t)}setOnlineStatus(t){this.onlineStatus=t,this.onlineTextStatus=oi[t]}};var lc=(()=>{let t=class t{constructor(){this.http=p(Tt),this.layout=p(z),this.store=p(Pt),this.webSocket=p(it),this.notifications=p(hr),this.webSocket.fromEvent("connect").subscribe(()=>this.notifications.checkUnreadNotifications()),this.webSocket.fromEvent("disconnect").subscribe(()=>this.store.onlineUsers.set([])),this.webSocket.fromEvent(Ci.EVENTS.NOTIFICATION).subscribe(()=>this.notifications.checkUnreadNotifications(!0)),this.webSocket.fromEvent(ht.EVENTS.ONLINE_USER).pipe(S(i=>new St(i))).subscribe(i=>this.newOnlineUser(i)),this.webSocket.fromEvent(ht.EVENTS.ONLINE_USERS).pipe(S(i=>i.map(s=>new St(s)))).subscribe(i=>this.setOnlineUsers(i)),this.webSocket.fromEvent(ht.EVENTS.ONLINE_STATUS).subscribe(i=>this.receiveOnlineStatus(i))}get user(){return this.store.user.getValue()}initUser(i,s=!1){this.refreshAvatar(),this.layout.setLanguage(i.language).catch(console.error),this.store.userImpersonate.set(s||i.impersonated),this.store.user.next(i),this.checkQuota(this.store.user.getValue()),s&&this.disconnectWebSocket(),this.connectWebSocket()}connectWebSocket(){this.webSocket.ioSocket.io.opts.query={onlineStatus:this.user.onlineStatus},this.webSocket.connect()}disconnectWebSocket(){this.webSocket.disconnect()}setOnlineUsers(i){this.store.onlineUsers.set(i)}newOnlineUser(i){this.store.onlineUsers().find(s=>s.id===i.id)?this.receiveOnlineStatus({userId:i.id,status:i.onlineStatus}):this.store.onlineUsers.update(s=>[i,...s])}userHavePermission(i){return this.user.isAdmin?!0:this.user?this.user.applications.indexOf(i)!==-1:!1}browseGroup(i){return this.http.get(`${fi}${i?`/${i}`:""}`).pipe(S(s=>new Yt(s)))}createPersonalGroup(i){return this.http.post(q,i).pipe(S(s=>new T(s)))}updatePersonalGroup(i,s){return this.http.put(`${q}/${i}`,s).pipe(S(n=>new T(n)))}leavePersonalGroup(i){return this.http.delete(`${di}/${i}`)}addUsersToGroup(i,s){return this.http.patch(`${q}/${i}/${ot.USERS}`,s)}deletePersonalGroup(i){return this.http.delete(`${q}/${i}`)}updateUserFromPersonalGroup(i,s,n){return this.http.patch(`${q}/${i}/${ot.USERS}/${s}`,n)}removeUserFromGroup(i,s){return this.http.delete(`${q}/${i}/${ot.USERS}/${s}`)}listGuests(){return this.http.get(X).pipe(S(i=>i.map(s=>new j(s))))}getGuest(i){return this.http.get(`${X}/${i}`).pipe(S(s=>new j(s)))}createGuest(i){return this.http.post(X,i).pipe(S(s=>new j(s)))}updateGuest(i,s){return this.http.put(`${X}/${i}`,s).pipe(S(n=>n?new j(n):null))}deleteGuest(i){return this.http.delete(`${X}/${i}`)}genAvatar(){this.http.patch(Jt,null).subscribe({next:()=>this.refreshAvatar(),error:i=>this.layout.sendNotification("error","Configuration","Avatar",i)})}uploadAvatar(i){let s=new FormData;s.append("file",i),this.http.put(Jt,s).subscribe({next:()=>this.refreshAvatar(),error:n=>this.layout.sendNotification("error","Configuration","Avatar",n)})}changePassword(i,s){return this.http.put(ui,i,{headers:s})}changeLanguage(i){return this.http.put(hi,i)}changeNotification(i){return this.http.put(li,i)}changeStorageIndexing(i){return this.http.put(pi,i)}changeOnlineStatus(i,s=!0){this.webSocket.emit(ht.EVENTS.ONLINE_STATUS,{status:i,store:s})}receiveOnlineStatus(i){this.user.id===i.userId?this.user.onlineStatus=i.status:this.store.onlineUsers().length&&this.store.onlineUsers.update(s=>s.map(n=>n.id===i.userId?ge(O({},n),{onlineStatus:i.status}):n))}searchMembers(i,s=[]){return this.http.request("search",ot.BASE,{body:i}).pipe(S(n=>n.map(o=>new T(o,s))),Ae(()=>[]))}setMenusVisibility(i){for(let s of i)if(!(s.id&&(s.hide=!this.userHavePermission(s.id),s.hide))&&(s.checks?.length&&(s.hide=!s.checks.map(n=>n.negate?!this[n.prop][n.value]:this[n.prop][n.value]).every(n=>!!n)),s.submenus?.length&&this.setMenusVisibility(s.submenus),s.title===Ai.FILES)){for(let n of s.submenus)if(!n.hide){s.link=n.link;break}}}refreshAvatar(){this.store.userAvatarUrl.next(wi())}checkAppStoreAvailability(){this.http.get(`${jt.BASE}/${jt.APP_STORE}`).subscribe({next:i=>this.store.appStoreManifest.set(i),error:i=>console.error(i)})}getEditorProviderPreference(){return localStorage.getItem("editorPreference")}setEditorProviderPreference(i){i===null?localStorage.removeItem("editorPreference"):localStorage.setItem("editorPreference",i)}listAppPasswords(i){return this.http.get(xt,{headers:i})}generateAppPassword(i,s){return this.http.post(xt,i,{headers:s})}deleteAppPassword(i){return this.http.delete(`${xt}/${i}`)}init2Fa(){return this.http.get(Xt)}enable2Fa(i){return this.http.post(Xt,i)}disable2Fa(i){return this.http.post(ki,i)}adminResetUser2Fa(i,s){return this.http.post(`${Ni}/${i}`,null,{headers:s})}auth2FaVerifyDialog(i=!1){return Se(this,null,function*(){let s=this.store.server().twoFaEnabled&&this.user.twoFaEnabled;if(i||s)return new Promise(n=>{let o=this.layout.openDialog(dr,"xs",{initialState:{withPassword:i,withTwoFaEnabled:s}},{keyboard:!1});o.content.isValid=a=>{n(a)}})})}checkQuota(i){if(!(i.isGuest||i.isLink)&&i.storageQuota){let s=Math.round(100/i.storageQuota*(i.storageQuota-i.storageUsage));s<=1?this.layout.sendNotification("error","Storage Quota","No more space available",null,{disableTimeOut:!0,closeButton:!0}):s<=5?this.layout.sendNotification("warning","Storage Quota",this.layout.translateString("available_space_is_low",{nb:s}),null,{disableTimeOut:!0,closeButton:!0}):s<=10&&this.layout.sendNotification("info","Storage Quota",this.layout.translateString("available_space_is_low",{nb:s}),null,{disableTimeOut:!0,closeButton:!0})}}};t.\u0275fac=function(s){return new(s||t)},t.\u0275prov=wt({token:t,factory:t.\u0275fac,providedIn:"root"});let r=t;return r})();export{ms as a,_s as b,Ri as c,xi as d,Xo as e,me as f,ur as g,lr as h,_o as i,y as j,hr as k,pr as l,fr as m,V as n,vi as o,ts as p,es as q,is as r,T as s,ls as t,Yt as u,j as v,lc as w};
@@ -1 +1 @@
1
- import{a as w}from"./chunk-NMF2ZFBE.js";import{h as O}from"./chunk-XTVNHFKX.js";import{c as S,h as v}from"./chunk-RTNEBRKJ.js";import{Cb as M,pb as V,qb as L,rb as d,vb as N}from"./chunk-O3YLAEVE.js";import{d as R}from"./chunk-QHJT5H4M.js";import{Bb as x,Eb as h,Gb as m,He as D,Ia as E,Kd as k,Oa as l,Oe as A,Tb as c,Ub as T,Vb as P,Wa as b,ab as I,ja as p,lb as C,mb as g,oa as u,pa as _,qg as W,rb as f,sb as i,tb as n,ub as y}from"./chunk-D55YR5X7.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";function $(o,s){if(o&1&&(i(0,"div",16)(1,"span",3),c(2),n(),i(3,"span",17),c(4),n()()),o&2){let r=m(2);l(2),T(r.infoMsg),l(2),P(":\xA0",r.syncService.wizard.localPath.origin)}}function U(o,s){if(o&1){let r=x();i(0,"div",5)(1,"fa-icon",13),h("click",function(){u(r);let t=m();return _(t.onReset())}),n(),y(2,"img",14),i(3,"div",15),c(4),n(),C(5,$,5,2,"div",16),n()}if(o&2){let r=m();l(),f("icon",r.icons.faTimesCircle),l(),f("src",r.syncService.wizard.localPath.mimeUrl,E),l(2),T(r.syncService.wizard.localPath.path),l(),g(r.infoMsg?5:-1)}}function Y(o,s){if(o&1){let r=x();i(0,"div",18),h("dragleave",function(t){u(r);let a=m();return _(a.dragLeave(t))})("dragover",function(t){u(r);let a=m();return _(a.dragOver(t))})("drop",function(t){u(r);let a=m();return _(a.drop(t))}),i(1,"div",19)(2,"span",20),c(3,"Drop folder here"),n()()()}}var ie=(()=>{let s=class s{constructor(){this.pathIsValid=!1,this.infoMsg=null,this.syncService=p(O),this.icons={faTimesCircle:D,faArrowCircleRight:A},this.router=p(R),this.renderer=p(b),this.store=p(N),this.layout=p(M),this.layout.setBreadcrumbIcon(L.WIZARD),this.layout.setBreadcrumbNav({url:`/${d.BASE}/${d.WIZARD}/${d.WIZARD_CLIENT}/${V.WIZARD_CLIENT}`,splicing:3,translating:!0,sameLink:!0}),this.syncService.wizard.localPath&&this.checkSelection();let e=this.router.currentNavigation()?.extras.state;e?.file&&this.syncService.addFileToRemotePath(e.file)}dragOver(e){return e.preventDefault(),e.dataTransfer.items[0].type?!1:(e.dataTransfer.dropEffect="copy",e.stopPropagation(),e.target.classList.contains("dropzone")&&this.renderer.addClass(e.target,"active"),!0)}dragLeave(e){e.preventDefault(),e.target.classList.contains("dropzone")&&this.renderer.removeClass(e.target,"active")}drop(e){e.preventDefault(),e.stopPropagation();let t=e.dataTransfer.items[0].webkitGetAsEntry();return t&&t.isDirectory?(this.syncService.wizard.localPath={name:t.name,path:this.syncService.getFilePath(e.dataTransfer.files[0]),mimeUrl:v(S),origin:null},this.checkSelection(),!0):!1}onSelect(){this.syncService.showOpenDialog({properties:[w.DIRECTORY,w.CREATE_DIRECTORY],defaultPath:""}).then(e=>{e.canceled||(this.syncService.wizard.localPath={name:e.filePaths[0].split("\\").pop().split("/").pop(),path:e.filePaths[0],mimeUrl:v(S),origin:null},this.checkSelection())})}onReset(){this.syncService.wizard.localPath=null,this.pathIsValid=!1,this.infoMsg=null}onNext(){this.router.navigate([d.BASE,d.WIZARD,d.WIZARD_SERVER]).catch(console.error)}onCancel(){this.router.navigate([d.BASE,d.PATHS]).catch(console.error),this.syncService.resetWizard()}checkSelection(){let e=this.store.clientSyncPaths().find(t=>new RegExp(`^${t.settings.localPath}((\\/.*)+|\\/?)$`).test(this.syncService.wizard.localPath.path));e?(this.pathIsValid=!1,this.syncService.wizard.localPath.mimeUrl=v(`${S}_sync`),this.syncService.wizard.localPath.origin=e.settings.localPath,this.infoMsg="The parent directory is already synced"):(this.infoMsg=null,this.pathIsValid=!0)}};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=I({type:s,selectors:[["app-sync-wizard-client"]],decls:22,vars:4,consts:[[1,"wizard"],[1,"d-flex","flex-column","text-center","fs-sm"],["l10nTranslate","",1,"mb-2"],["l10nTranslate",""],[1,"d-flex","flex-column","h-100"],[1,"d-flex","flex-column","my-auto","fs-sm"],[1,"area"],[1,"d-flex","flex-column","mt-4"],[1,"d-flex","align-items-start"],["type","button","l10nTranslate","",1,"btn","btn-secondary","me-auto",3,"click"],[3,"icon"],["type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click","disabled"],["size","2x",1,"position-absolute","align-self-center","cursor-pointer",2,"margin-left","85px",3,"click","icon"],["alt","","height","96",1,"align-self-center","mb-2",3,"src"],[1,"align-self-center","mt-2","font-size-md","word-break-all","fw-500"],[1,"align-self-center","text-warning","mt-4"],[1,"fw-bold","ms-1"],[1,"area",3,"dragleave","dragover","drop"],["l10nTranslate","",1,"dropzone"],[1,"d-flex","flex-column","justify-content-center","align-self-center"]],template:function(t,a){t&1&&(i(0,"div",0)(1,"div",1)(2,"div",2),c(3,"This wizard will help you synchronize a directory on your computer with a Sync-in directory."),n(),i(4,"div")(5,"div",3),c(6,"To begin, select a folder on your computer."),n(),i(7,"div",3),c(8,'You can drag the folder into the area below or click on the "Select" button.'),n()()(),i(9,"div",4),C(10,U,6,4,"div",5)(11,Y,4,0,"div",6),n(),i(12,"div",7)(13,"div",8)(14,"button",9),h("click",function(){return a.onCancel()}),y(15,"fa-icon",10),c(16," Cancel "),n(),i(17,"button",11),h("click",function(){return a.onSelect()}),c(18,"Select a folder"),n(),i(19,"button",12),h("click",function(){return a.onNext()}),y(20,"fa-icon",10),c(21," Next "),n()()()()),t&2&&(l(10),g(a.syncService.wizard.localPath?10:11),l(5),f("icon",a.icons.faTimesCircle),l(4),f("disabled",!a.pathIsValid),l(),f("icon",a.icons.faArrowCircleRight))},dependencies:[W,k],encapsulation:2});let o=s;return o})();export{ie as SyncWizardClientComponent};
1
+ import{a as w}from"./chunk-NMF2ZFBE.js";import{h as O}from"./chunk-CTPKDDVI.js";import{c as S,h as v}from"./chunk-RTNEBRKJ.js";import{Cb as M,pb as V,qb as L,rb as d,vb as N}from"./chunk-YWLMFOB4.js";import{d as R}from"./chunk-Y67J3BOL.js";import{Bb as x,Eb as h,Gb as m,He as D,Ia as E,Kd as k,Oa as l,Oe as A,Tb as c,Ub as T,Vb as P,Wa as b,ab as I,ja as p,lb as C,mb as g,oa as u,pa as _,rb as f,sb as i,sg as W,tb as n,ub as y}from"./chunk-QJVC3SRJ.js";import"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import"./chunk-KAVP6UXH.js";function $(o,s){if(o&1&&(i(0,"div",16)(1,"span",3),c(2),n(),i(3,"span",17),c(4),n()()),o&2){let r=m(2);l(2),T(r.infoMsg),l(2),P(":\xA0",r.syncService.wizard.localPath.origin)}}function U(o,s){if(o&1){let r=x();i(0,"div",5)(1,"fa-icon",13),h("click",function(){u(r);let t=m();return _(t.onReset())}),n(),y(2,"img",14),i(3,"div",15),c(4),n(),C(5,$,5,2,"div",16),n()}if(o&2){let r=m();l(),f("icon",r.icons.faTimesCircle),l(),f("src",r.syncService.wizard.localPath.mimeUrl,E),l(2),T(r.syncService.wizard.localPath.path),l(),g(r.infoMsg?5:-1)}}function Y(o,s){if(o&1){let r=x();i(0,"div",18),h("dragleave",function(t){u(r);let a=m();return _(a.dragLeave(t))})("dragover",function(t){u(r);let a=m();return _(a.dragOver(t))})("drop",function(t){u(r);let a=m();return _(a.drop(t))}),i(1,"div",19)(2,"span",20),c(3,"Drop folder here"),n()()()}}var ie=(()=>{let s=class s{constructor(){this.pathIsValid=!1,this.infoMsg=null,this.syncService=p(O),this.icons={faTimesCircle:D,faArrowCircleRight:A},this.router=p(R),this.renderer=p(b),this.store=p(N),this.layout=p(M),this.layout.setBreadcrumbIcon(L.WIZARD),this.layout.setBreadcrumbNav({url:`/${d.BASE}/${d.WIZARD}/${d.WIZARD_CLIENT}/${V.WIZARD_CLIENT}`,splicing:3,translating:!0,sameLink:!0}),this.syncService.wizard.localPath&&this.checkSelection();let e=this.router.currentNavigation()?.extras.state;e?.file&&this.syncService.addFileToRemotePath(e.file)}dragOver(e){return e.preventDefault(),e.dataTransfer.items[0].type?!1:(e.dataTransfer.dropEffect="copy",e.stopPropagation(),e.target.classList.contains("dropzone")&&this.renderer.addClass(e.target,"active"),!0)}dragLeave(e){e.preventDefault(),e.target.classList.contains("dropzone")&&this.renderer.removeClass(e.target,"active")}drop(e){e.preventDefault(),e.stopPropagation();let t=e.dataTransfer.items[0].webkitGetAsEntry();return t&&t.isDirectory?(this.syncService.wizard.localPath={name:t.name,path:this.syncService.getFilePath(e.dataTransfer.files[0]),mimeUrl:v(S),origin:null},this.checkSelection(),!0):!1}onSelect(){this.syncService.showOpenDialog({properties:[w.DIRECTORY,w.CREATE_DIRECTORY],defaultPath:""}).then(e=>{e.canceled||(this.syncService.wizard.localPath={name:e.filePaths[0].split("\\").pop().split("/").pop(),path:e.filePaths[0],mimeUrl:v(S),origin:null},this.checkSelection())})}onReset(){this.syncService.wizard.localPath=null,this.pathIsValid=!1,this.infoMsg=null}onNext(){this.router.navigate([d.BASE,d.WIZARD,d.WIZARD_SERVER]).catch(console.error)}onCancel(){this.router.navigate([d.BASE,d.PATHS]).catch(console.error),this.syncService.resetWizard()}checkSelection(){let e=this.store.clientSyncPaths().find(t=>new RegExp(`^${t.settings.localPath}((\\/.*)+|\\/?)$`).test(this.syncService.wizard.localPath.path));e?(this.pathIsValid=!1,this.syncService.wizard.localPath.mimeUrl=v(`${S}_sync`),this.syncService.wizard.localPath.origin=e.settings.localPath,this.infoMsg="The parent directory is already synced"):(this.infoMsg=null,this.pathIsValid=!0)}};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=I({type:s,selectors:[["app-sync-wizard-client"]],decls:22,vars:4,consts:[[1,"wizard"],[1,"d-flex","flex-column","text-center","fs-sm"],["l10nTranslate","",1,"mb-2"],["l10nTranslate",""],[1,"d-flex","flex-column","h-100"],[1,"d-flex","flex-column","my-auto","fs-sm"],[1,"area"],[1,"d-flex","flex-column","mt-4"],[1,"d-flex","align-items-start"],["type","button","l10nTranslate","",1,"btn","btn-secondary","me-auto",3,"click"],[3,"icon"],["type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click","disabled"],["size","2x",1,"position-absolute","align-self-center","cursor-pointer",2,"margin-left","85px",3,"click","icon"],["alt","","height","96",1,"align-self-center","mb-2",3,"src"],[1,"align-self-center","mt-2","font-size-md","word-break-all","fw-500"],[1,"align-self-center","text-warning","mt-4"],[1,"fw-bold","ms-1"],[1,"area",3,"dragleave","dragover","drop"],["l10nTranslate","",1,"dropzone"],[1,"d-flex","flex-column","justify-content-center","align-self-center"]],template:function(t,a){t&1&&(i(0,"div",0)(1,"div",1)(2,"div",2),c(3,"This wizard will help you synchronize a directory on your computer with a Sync-in directory."),n(),i(4,"div")(5,"div",3),c(6,"To begin, select a folder on your computer."),n(),i(7,"div",3),c(8,'You can drag the folder into the area below or click on the "Select" button.'),n()()(),i(9,"div",4),C(10,U,6,4,"div",5)(11,Y,4,0,"div",6),n(),i(12,"div",7)(13,"div",8)(14,"button",9),h("click",function(){return a.onCancel()}),y(15,"fa-icon",10),c(16," Cancel "),n(),i(17,"button",11),h("click",function(){return a.onSelect()}),c(18,"Select a folder"),n(),i(19,"button",12),h("click",function(){return a.onNext()}),y(20,"fa-icon",10),c(21," Next "),n()()()()),t&2&&(l(10),g(a.syncService.wizard.localPath?10:11),l(5),f("icon",a.icons.faTimesCircle),l(4),f("disabled",!a.pathIsValid),l(),f("icon",a.icons.faArrowCircleRight))},dependencies:[W,k],encapsulation:2});let o=s;return o})();export{ie as SyncWizardClientComponent};
@@ -1 +1 @@
1
- import{d as b}from"./chunk-RJULB733.js";import"./chunk-CMNMPG6Z.js";import"./chunk-TNCKNU6I.js";import{b as d,d as X}from"./chunk-G7RZN7HN.js";import"./chunk-SDJNZULP.js";import{D as m,aa as T,ca as f,da as r,i as q,ia as g,ja as u,la as x,sa as p,ta as h,ya as y}from"./chunk-2YQ4SX3A.js";import"./chunk-KAVP6UXH.js";var S=1,w=2,k=3,_=180,R=4,z=181,v=5,E=182,U=6;function D(O){return O>=65&&O<=90||O>=97&&O<=122}var F=new d(O=>{let a=O.pos;for(;;){let{next:e}=O;if(e<0)break;if(e==123){let n=O.peek(1);if(n==123){if(O.pos>a)break;O.acceptToken(S,2);return}else if(n==37){if(O.pos>a)break;let $=2,i=2;for(;;){let Q=O.peek($);if(Q==32||Q==10)++$;else if(Q==35)for(++$;;){let t=O.peek($);if(t<0||t==10)break;$++}else if(Q==45&&i==2)i=++$;else{let t=Q==101&&O.peek($+1)==110&&O.peek($+2)==100;O.acceptToken(t?k:w,i);return}}}}if(O.advance(),e==10)break}O.pos>a&&O.acceptToken(_)});function W(O,a,e){return new d(n=>{let $=n.pos;for(;;){let{next:i}=n;if(i==123&&n.peek(1)==37){let Q=2;for(;;Q++){let o=n.peek(Q);if(o!=32&&o!=10)break}let t="";for(;;Q++){let o=n.peek(Q);if(!D(o))break;t+=String.fromCharCode(o)}if(t==O){if(n.pos>$)break;n.acceptToken(e,2);break}}else if(i<0)break;if(n.advance(),i==10)break}n.pos>$&&n.acceptToken(a)})}var C=W("endcomment",E,v),N=W("endraw",z,R),Y=new d(O=>{if(O.next==35){for(O.advance();!(O.next==10||O.next<0||(O.next==37||O.next==125)&&O.peek(1)==125);)O.advance();O.acceptToken(U)}}),I={__proto__:null,contains:34,or:38,and:38,true:52,false:52,empty:54,forloop:56,tablerowloop:58,continue:60,in:130,with:196,for:198,as:200,if:236,endif:240,unless:246,endunless:250,elsif:254,else:258,case:264,endcase:268,when:272,endfor:280,tablerow:286,endtablerow:290,break:294,cycle:300,echo:304,render:308,include:312,assign:316,capture:322,endcapture:326,increment:330,decrement:334},L={__proto__:null,if:86,endif:90,elsif:94,else:98,unless:104,endunless:108,case:114,endcase:118,when:122,for:128,endfor:138,tablerow:144,endtablerow:148,break:152,continue:156,cycle:160,comment:166,endcomment:172,raw:178,endraw:184,echo:188,render:192,include:204,assign:208,capture:214,endcapture:218,increment:222,decrement:226,liquid:230},A=X.deserialize({version:14,states:"HOQYOPOOOOOP'#F{'#F{OeOaO'#CdOsQhO'#CfO!bQxO'#DSO#{OPO'#DVO$ZOPO'#D`O$iOPO'#DeO$wOPO'#DlO%VOPO'#DtO%eOSO'#EPO%jOQO'#EVO%oOPO'#EiOOOP'#Gb'#GbOOOP'#G]'#G]OOOP'#Fz'#FzQYOPOOOOOP-E9y-E9yOOQW'#Cg'#CgO&cQ!jO,59QO&jQ!jO'#G^OsQhO'#CtOOQW'#G^'#G^OOOP,59n,59nO)YQhO,59nOsQhO,59rOsQhO,59vO)dQhO,59xOsQhO,59{OsQhO,5:QOsQhO,5:UO!]QhO,5:XO!]QhO,5:aO)iQhO,5:eO)nQhO,5:gO)sQhO,5:iO)xQhO,5:lO)}QhO,5:rOsQhO,5:wOsQhO,5:yOsQhO,5;POsQhO,5;ROsQhO,5;UOsQhO,5;YOsQhO,5;[O+^QhO,5;^O+eOPO'#CdOOOP,59q,59qO#{OPO,59qO+sQxO'#DYOOOP,59z,59zO$ZOPO,59zO+xQxO'#DcOOOP,5:P,5:PO$iOPO,5:PO+}QxO'#DhOOOP,5:W,5:WO$wOPO,5:WO,SQxO'#DrOOOP,5:`,5:`O%VOPO,5:`O,XQxO'#DwOOOS'#GQ'#GQO,^OSO'#ESO,fOSO,5:kOOOQ'#GR'#GRO,kOQO'#EYO,sOQO,5:qOOOP,5;T,5;TO%oOPO,5;TO,xQxO'#ElOOOP-E9x-E9xO,}Q#|O,59SOsQh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Name : , Tag TagName %} IfDirective Tag if EndTag endif Tag elsif Tag else UnlessDirective Tag unless EndTag endunless CaseDirective Tag case EndTag endcase Tag when ForDirective Tag for in Parameter ParameterName EndTag endfor TableDirective Tag tablerow EndTag endtablerow Tag break Tag continue Tag cycle Comment Tag comment CommentText EndTag endcomment RawDirective Tag raw RawText EndTag endraw Tag echo Tag render RenderParameter with for as Tag include Tag assign CaptureDirective Tag capture EndTag endcapture Tag increment Tag decrement Tag liquid IfDirective Tag if EndTag endif UnlessDirective Tag unless EndTag endunless Tag elsif Tag else CaseDirective Tag case EndTag endcase Tag when ForDirective Tag EndTag endfor TableDirective Tag tablerow EndTag endtablerow Tag break Tag Tag cycle Tag echo Tag render Tag include Tag assign CaptureDirective Tag capture EndTag endcapture Tag increment Tag decrement",maxTerm:191,nodeProps:[["closedBy",1,"}}",-4,2,3,4,5,"%}",23,")"],["openedBy",9,"{{",22,"(",40,"{%"],["group",-13,11,12,15,16,20,24,26,27,28,29,30,31,32,"Expression"]],skippedNodes:[0,6],repeatNodeCount:11,tokenData:")e~RmXY!|YZ!|]^!|pq!|qr#_rs#juv$[wx$gxy%Syz%X{|%^|}&x}!O&}!O!P'Z!Q![&g![!]'k!^!_'p!_!`'x!`!a'p!c!}(Q!}#O(y#P#Q)O#R#S(Q#T#o(Q#p#q)T#q#r)Y%W;'S(Q;'S;:j(s<%lO(Q~#RS%O~XY!|YZ!|]^!|pq!|~#bP!_!`#e~#jOb~~#mUOY#jZr#jrs$Ps;'S#j;'S;=`$U<%lO#j~$UOo~~$XP;=`<%l#j~$_P#q#r$b~$gOx~~$jUOY$gZw$gwx$Px;'S$g;'S;=`$|<%lO$g~%PP;=`<%l$g~%XOg~~%^Of~P%aQ!O!P%g!Q![&gP%jP!Q![%mP%rRpP!Q![%m!g!h%{#X#Y%{P&OR{|&X}!O&X!Q![&_P&[P!Q![&_P&dPpP!Q![&_P&lSpP!O!P%g!Q![&g!g!h%{#X#Y%{~&}Ou~~'QRuv$[!O!P%g!Q![&g~'`Q]S!O!P'f!Q![%m~'kOi~~'pOt~~'uPb~!_!`#e~'}Pe~!_!`#e_(ZW^WwQ%RT}!O(Q!Q![(Q!c!}(Q#R#S(Q#T#o(Q%W;'S(Q;'S;:j(s<%lO(Q_(vP;=`<%l(Q~)OO%T~~)TO%S~~)YOr~~)]P#q#r)`~)eOX~",tokenizers:[F,N,C,Y,0,1,2,3],topRules:{Template:[0,7]},specialized:[{term:187,get:O=>I[O]||-1},{term:39,get:O=>L[O]||-1}],tokenPrec:0});function l(O,a){return O.split(" ").map(e=>({label:e,type:a}))}var Z=l("abs append at_least at_most capitalize ceil compact concat date default divided_by downcase escape escape_once first floor join last lstrip map minus modulo newline_to_br plus prepend remove remove_first replace replace_first reverse round rstrip size slice sort sort_natural split strip strip_html strip_newlines sum times truncate truncatewords uniq upcase url_decode url_encode where","function"),j=l("cycle comment endcomment raw endraw echo increment decrement liquid if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue assign capture endcapture render include","keyword"),G=l("empty forloop tablerowloop in with as","keyword"),B=l("first index index0 last length rindex","property"),H=l("col col0 col_first col_last first index index0 last length rindex rindex0 row","property");function M(O){var a;let{state:e,pos:n}=O,$=u(e).resolveInner(n,-1).enterUnfinishedNodesBefore(n),i=((a=$.childBefore(n))===null||a===void 0?void 0:a.name)||$.name;if($.name=="FilterName")return{type:"filter",node:$};if(O.explicit&&i=="|")return{type:"filter"};if($.name=="TagName")return{type:"tag",node:$};if(O.explicit&&i=="{%")return{type:"tag"};if($.name=="PropertyName"&&$.parent.name=="MemberExpression")return{type:"property",node:$,target:$.parent};if($.name=="."&&$.parent.name=="MemberExpression")return{type:"property",target:$.parent};if($.name=="MemberExpression"&&i==".")return{type:"property",target:$};if($.name=="VariableName")return{type:"expression",from:$.from};let Q=O.matchBefore(/[\w\u00c0-\uffff]+$/);return Q?{type:"expression",from:Q.from}:O.explicit&&$.name!="CommentText"&&$.name!="StringLiteral"&&$.name!="NumberLiteral"&&$.name!="InlineComment"?{type:"expression"}:null}function J(O,a,e,n){let $=[];for(;;){let i=a.getChild("Expression");if(!i)return[];if(i.name=="forloop")return $.length?[]:B;if(i.name=="tablerowloop")return $.length?[]:H;if(i.name=="VariableName"){$.unshift(O.sliceDoc(i.from,i.to));break}else if(i.name=="MemberExpression"){let Q=i.getChild("PropertyName");Q&&$.unshift(O.sliceDoc(Q.from,Q.to)),a=i}else return[]}return n?n($,O,e):[]}function K(O={}){let a=O.filters?O.filters.concat(Z):Z,e=O.tags?O.tags.concat(j):j,n=O.variables?O.variables.concat(G):G,{properties:$}=O;return i=>{var Q;let t=M(i);if(!t)return null;let o=(Q=t.from)!==null&&Q!==void 0?Q:t.node?t.node.from:i.pos,s;return t.type=="filter"?s=a:t.type=="tag"?s=e:t.type=="expression"?s=n:s=J(i.state,t.target,i,$),s.length?{options:s,from:o,validFor:/^[\w\u00c0-\uffff]*$/}:null}}var OO=m.inputHandler.of((O,a,e,n)=>n!="%"||a!=e||O.state.doc.sliceString(a-1,e+1)!="{}"?!1:(O.dispatch(O.state.changeByRange($=>({changes:{from:$.from,to:$.to,insert:"%%"},range:q.cursor($.from+1)})),{scrollIntoView:!0,userEvent:"input.type"}),!0));function P(O){return a=>{let e=O.test(a.textAfter);return a.lineIndent(a.node.from)+(e?0:a.unit)}}var $O=g.define({name:"liquid",parser:A.configure({props:[f({"cycle comment endcomment raw endraw echo increment decrement liquid in with as":r.keyword,"empty forloop tablerowloop":r.atom,"if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue":r.controlKeyword,"assign capture endcapture":r.definitionKeyword,contains:r.operatorKeyword,"render include":r.moduleKeyword,VariableName:r.variableName,TagName:r.tagName,FilterName:r.function(r.variableName),PropertyName:r.propertyName,CompareOp:r.compareOperator,AssignOp:r.definitionOperator,LogicOp:r.logicOperator,NumberLiteral:r.number,StringLiteral:r.string,BooleanLiteral:r.bool,InlineComment:r.lineComment,CommentText:r.blockComment,"{% %} {{ }}":r.brace,"[ ]":r.bracket,"( )":r.paren,".":r.derefOperator,", .. : |":r.punctuation}),p.add({Tag:h({closing:"%}"}),"UnlessDirective ForDirective TablerowDirective CaptureDirective":P(/^\s*(\{%-?\s*)?end\w/),IfDirective:P(/^\s*(\{%-?\s*)?(endif|else|elsif)\b/),CaseDirective:P(/^\s*(\{%-?\s*)?(endcase|when)\b/)}),y.add({"UnlessDirective ForDirective TablerowDirective CaptureDirective IfDirective CaseDirective RawDirective Comment"(O){let a=O.firstChild,e=O.lastChild;return!a||a.name!="Tag"?null:{from:a.to,to:e.name=="EndTag"?e.from:O.to}}})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*{%-?\s*(?:end|elsif|else|when|)$/}}),c=b();function V(O){return $O.configure({wrap:T(a=>a.type.isTop?{parser:O.parser,overlay:e=>e.name=="Text"||e.name=="RawText"}:null)},"liquid")}var aO=V(c.language);function sO(O={}){let a=O.base||c,e=a.language==c.language?aO:V(a.language);return new x(e,[a.support,e.data.of({autocomplete:K(O)}),a.language.data.of({closeBrackets:{brackets:["{"]}}),OO])}export{OO as closePercentBrace,sO as liquid,K as liquidCompletionSource,aO as liquidLanguage};
1
+ import{d as b}from"./chunk-I3XI72AV.js";import"./chunk-M7IFVC5D.js";import"./chunk-AXLDYLIO.js";import{b as d,d as X}from"./chunk-MPWD4VMY.js";import"./chunk-SQYWQUL4.js";import{D as m,ba as T,da as f,ea as r,i as q,ja as g,ka as u,ma as x,ta as p,ua as h,za as y}from"./chunk-ACCGBDUZ.js";import"./chunk-KAVP6UXH.js";var S=1,w=2,k=3,_=180,R=4,z=181,v=5,E=182,U=6;function D(O){return O>=65&&O<=90||O>=97&&O<=122}var F=new d(O=>{let a=O.pos;for(;;){let{next:e}=O;if(e<0)break;if(e==123){let n=O.peek(1);if(n==123){if(O.pos>a)break;O.acceptToken(S,2);return}else if(n==37){if(O.pos>a)break;let $=2,i=2;for(;;){let Q=O.peek($);if(Q==32||Q==10)++$;else if(Q==35)for(++$;;){let t=O.peek($);if(t<0||t==10)break;$++}else if(Q==45&&i==2)i=++$;else{let t=Q==101&&O.peek($+1)==110&&O.peek($+2)==100;O.acceptToken(t?k:w,i);return}}}}if(O.advance(),e==10)break}O.pos>a&&O.acceptToken(_)});function W(O,a,e){return new d(n=>{let $=n.pos;for(;;){let{next:i}=n;if(i==123&&n.peek(1)==37){let Q=2;for(;;Q++){let o=n.peek(Q);if(o!=32&&o!=10)break}let t="";for(;;Q++){let o=n.peek(Q);if(!D(o))break;t+=String.fromCharCode(o)}if(t==O){if(n.pos>$)break;n.acceptToken(e,2);break}}else if(i<0)break;if(n.advance(),i==10)break}n.pos>$&&n.acceptToken(a)})}var C=W("endcomment",E,v),N=W("endraw",z,R),Y=new d(O=>{if(O.next==35){for(O.advance();!(O.next==10||O.next<0||(O.next==37||O.next==125)&&O.peek(1)==125);)O.advance();O.acceptToken(U)}}),I={__proto__:null,contains:34,or:38,and:38,true:52,false:52,empty:54,forloop:56,tablerowloop:58,continue:60,in:130,with:196,for:198,as:200,if:236,endif:240,unless:246,endunless:250,elsif:254,else:258,case:264,endcase:268,when:272,endfor:280,tablerow:286,endtablerow:290,break:294,cycle:300,echo:304,render:308,include:312,assign:316,capture:322,endcapture:326,increment:330,decrement:334},L={__proto__:null,if:86,endif:90,elsif:94,else:98,unless:104,endunless:108,case:114,endcase:118,when:122,for:128,endfor:138,tablerow:144,endtablerow:148,break:152,continue:156,cycle:160,comment:166,endcomment:172,raw:178,endraw:184,echo:188,render:192,include:204,assign:208,capture:214,endcapture:218,increment:222,decrement:226,liquid:230},A=X.deserialize({version:14,states:"HOQYOPOOOOOP'#F{'#F{OeOaO'#CdOsQhO'#CfO!bQxO'#DSO#{OPO'#DVO$ZOPO'#D`O$iOPO'#DeO$wOPO'#DlO%VOPO'#DtO%eOSO'#EPO%jOQO'#EVO%oOPO'#EiOOOP'#Gb'#GbOOOP'#G]'#G]OOOP'#Fz'#FzQYOPOOOOOP-E9y-E9yOOQW'#Cg'#CgO&cQ!jO,59QO&jQ!jO'#G^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Q$|#WR&c$|Q#f}Q%W#^Q%Z#_Q%^#`Q%a#aQ%d#bQ%g#c_%i#f%W%Z%^%a%d%gQ&t%tR'Y&tm_OTUVWX[`!Q!T!W!Z!^!gQcRQ!teQ!uhQ!xiQ!yjQ!{lQ!|mQ!}nQ#VvQ#WwQ#XxQ#YyQ#ZzQ#[{Q#]|Q$_!kQ$`!lQ$a!mQ$f!rQ$g!sQ%k#gQ%l#hQ%m#iQ%n#kQ%o#lQ%s#rQ%t#sQ%u#tQ%v#uQ%w#vQ%x#wQ%y#xQ&U$hQ&W$oQ&Z$rQ&[$sQ&e$}Q&x&TQ'V&nQ'W&oQ'a'TR'f'[m#e}#^#_#`#a#b#c#f%W%Z%^%a%d%g",nodeNames:"\u26A0 {{ {% {% {% {% InlineComment Template Text }} Interpolation VariableName MemberExpression . PropertyName SubscriptExpression BinaryExpression contains CompareOp LogicOp AssignmentExpression AssignOp ) ( RangeExpression .. BooleanLiteral empty forloop tablerowloop continue StringLiteral NumberLiteral Filter | FilterName : , Tag TagName %} IfDirective Tag if EndTag endif Tag elsif Tag else UnlessDirective Tag unless EndTag endunless CaseDirective Tag case EndTag endcase Tag when ForDirective Tag for in Parameter ParameterName EndTag endfor TableDirective Tag tablerow EndTag endtablerow Tag break Tag continue Tag cycle Comment Tag comment CommentText EndTag endcomment RawDirective Tag raw RawText EndTag endraw Tag echo Tag render RenderParameter with for as Tag include Tag assign CaptureDirective Tag capture EndTag endcapture Tag increment Tag decrement Tag liquid IfDirective Tag if EndTag endif UnlessDirective Tag unless EndTag endunless Tag elsif Tag else CaseDirective Tag case EndTag endcase Tag when ForDirective Tag EndTag endfor TableDirective Tag tablerow EndTag endtablerow Tag break Tag Tag cycle Tag echo Tag render Tag include Tag assign CaptureDirective Tag capture EndTag endcapture Tag increment Tag decrement",maxTerm:191,nodeProps:[["closedBy",1,"}}",-4,2,3,4,5,"%}",23,")"],["openedBy",9,"{{",22,"(",40,"{%"],["group",-13,11,12,15,16,20,24,26,27,28,29,30,31,32,"Expression"]],skippedNodes:[0,6],repeatNodeCount:11,tokenData:")e~RmXY!|YZ!|]^!|pq!|qr#_rs#juv$[wx$gxy%Syz%X{|%^|}&x}!O&}!O!P'Z!Q![&g![!]'k!^!_'p!_!`'x!`!a'p!c!}(Q!}#O(y#P#Q)O#R#S(Q#T#o(Q#p#q)T#q#r)Y%W;'S(Q;'S;:j(s<%lO(Q~#RS%O~XY!|YZ!|]^!|pq!|~#bP!_!`#e~#jOb~~#mUOY#jZr#jrs$Ps;'S#j;'S;=`$U<%lO#j~$UOo~~$XP;=`<%l#j~$_P#q#r$b~$gOx~~$jUOY$gZw$gwx$Px;'S$g;'S;=`$|<%lO$g~%PP;=`<%l$g~%XOg~~%^Of~P%aQ!O!P%g!Q![&gP%jP!Q![%mP%rRpP!Q![%m!g!h%{#X#Y%{P&OR{|&X}!O&X!Q![&_P&[P!Q![&_P&dPpP!Q![&_P&lSpP!O!P%g!Q![&g!g!h%{#X#Y%{~&}Ou~~'QRuv$[!O!P%g!Q![&g~'`Q]S!O!P'f!Q![%m~'kOi~~'pOt~~'uPb~!_!`#e~'}Pe~!_!`#e_(ZW^WwQ%RT}!O(Q!Q![(Q!c!}(Q#R#S(Q#T#o(Q%W;'S(Q;'S;:j(s<%lO(Q_(vP;=`<%l(Q~)OO%T~~)TO%S~~)YOr~~)]P#q#r)`~)eOX~",tokenizers:[F,N,C,Y,0,1,2,3],topRules:{Template:[0,7]},specialized:[{term:187,get:O=>I[O]||-1},{term:39,get:O=>L[O]||-1}],tokenPrec:0});function l(O,a){return O.split(" ").map(e=>({label:e,type:a}))}var Z=l("abs append at_least at_most capitalize ceil compact concat date default divided_by downcase escape escape_once first floor join last lstrip map minus modulo newline_to_br plus prepend remove remove_first replace replace_first reverse round rstrip size slice sort sort_natural split strip strip_html strip_newlines sum times truncate truncatewords uniq upcase url_decode url_encode where","function"),j=l("cycle comment endcomment raw endraw echo increment decrement liquid if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue assign capture endcapture render include","keyword"),G=l("empty forloop tablerowloop in with as","keyword"),B=l("first index index0 last length rindex","property"),H=l("col col0 col_first col_last first index index0 last length rindex rindex0 row","property");function M(O){var a;let{state:e,pos:n}=O,$=u(e).resolveInner(n,-1).enterUnfinishedNodesBefore(n),i=((a=$.childBefore(n))===null||a===void 0?void 0:a.name)||$.name;if($.name=="FilterName")return{type:"filter",node:$};if(O.explicit&&i=="|")return{type:"filter"};if($.name=="TagName")return{type:"tag",node:$};if(O.explicit&&i=="{%")return{type:"tag"};if($.name=="PropertyName"&&$.parent.name=="MemberExpression")return{type:"property",node:$,target:$.parent};if($.name=="."&&$.parent.name=="MemberExpression")return{type:"property",target:$.parent};if($.name=="MemberExpression"&&i==".")return{type:"property",target:$};if($.name=="VariableName")return{type:"expression",from:$.from};let Q=O.matchBefore(/[\w\u00c0-\uffff]+$/);return Q?{type:"expression",from:Q.from}:O.explicit&&$.name!="CommentText"&&$.name!="StringLiteral"&&$.name!="NumberLiteral"&&$.name!="InlineComment"?{type:"expression"}:null}function J(O,a,e,n){let $=[];for(;;){let i=a.getChild("Expression");if(!i)return[];if(i.name=="forloop")return $.length?[]:B;if(i.name=="tablerowloop")return $.length?[]:H;if(i.name=="VariableName"){$.unshift(O.sliceDoc(i.from,i.to));break}else if(i.name=="MemberExpression"){let Q=i.getChild("PropertyName");Q&&$.unshift(O.sliceDoc(Q.from,Q.to)),a=i}else return[]}return n?n($,O,e):[]}function K(O={}){let a=O.filters?O.filters.concat(Z):Z,e=O.tags?O.tags.concat(j):j,n=O.variables?O.variables.concat(G):G,{properties:$}=O;return i=>{var Q;let t=M(i);if(!t)return null;let o=(Q=t.from)!==null&&Q!==void 0?Q:t.node?t.node.from:i.pos,s;return t.type=="filter"?s=a:t.type=="tag"?s=e:t.type=="expression"?s=n:s=J(i.state,t.target,i,$),s.length?{options:s,from:o,validFor:/^[\w\u00c0-\uffff]*$/}:null}}var OO=m.inputHandler.of((O,a,e,n)=>n!="%"||a!=e||O.state.doc.sliceString(a-1,e+1)!="{}"?!1:(O.dispatch(O.state.changeByRange($=>({changes:{from:$.from,to:$.to,insert:"%%"},range:q.cursor($.from+1)})),{scrollIntoView:!0,userEvent:"input.type"}),!0));function P(O){return a=>{let e=O.test(a.textAfter);return a.lineIndent(a.node.from)+(e?0:a.unit)}}var $O=g.define({name:"liquid",parser:A.configure({props:[f({"cycle comment endcomment raw endraw echo increment decrement liquid in with as":r.keyword,"empty forloop tablerowloop":r.atom,"if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue":r.controlKeyword,"assign capture endcapture":r.definitionKeyword,contains:r.operatorKeyword,"render include":r.moduleKeyword,VariableName:r.variableName,TagName:r.tagName,FilterName:r.function(r.variableName),PropertyName:r.propertyName,CompareOp:r.compareOperator,AssignOp:r.definitionOperator,LogicOp:r.logicOperator,NumberLiteral:r.number,StringLiteral:r.string,BooleanLiteral:r.bool,InlineComment:r.lineComment,CommentText:r.blockComment,"{% %} {{ }}":r.brace,"[ ]":r.bracket,"( )":r.paren,".":r.derefOperator,", .. : |":r.punctuation}),p.add({Tag:h({closing:"%}"}),"UnlessDirective ForDirective TablerowDirective CaptureDirective":P(/^\s*(\{%-?\s*)?end\w/),IfDirective:P(/^\s*(\{%-?\s*)?(endif|else|elsif)\b/),CaseDirective:P(/^\s*(\{%-?\s*)?(endcase|when)\b/)}),y.add({"UnlessDirective ForDirective TablerowDirective CaptureDirective IfDirective CaseDirective RawDirective Comment"(O){let a=O.firstChild,e=O.lastChild;return!a||a.name!="Tag"?null:{from:a.to,to:e.name=="EndTag"?e.from:O.to}}})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*{%-?\s*(?:end|elsif|else|when|)$/}}),c=b();function V(O){return $O.configure({wrap:T(a=>a.type.isTop?{parser:O.parser,overlay:e=>e.name=="Text"||e.name=="RawText"}:null)},"liquid")}var aO=V(c.language);function sO(O={}){let a=O.base||c,e=a.language==c.language?aO:V(a.language);return new x(e,[a.support,e.data.of({autocomplete:K(O)}),a.language.data.of({closeBrackets:{brackets:["{"]}}),OO])}export{OO as closePercentBrace,sO as liquid,K as liquidCompletionSource,aO as liquidLanguage};