@sync-in/server 1.3.9 → 1.4.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.
- package/CHANGELOG.md +15 -0
- package/README.md +3 -2
- package/environment/environment.dist.yaml +2 -0
- package/package.json +2 -2
- package/server/app.bootstrap.js +9 -0
- package/server/app.bootstrap.js.map +1 -1
- package/server/app.service.spec.js +44 -19
- package/server/app.service.spec.js.map +1 -1
- package/server/applications/files/constants/files.js +0 -23
- package/server/applications/files/constants/files.js.map +1 -1
- package/server/applications/files/constants/only-office.js +8 -0
- package/server/applications/files/constants/only-office.js.map +1 -1
- package/server/applications/files/files.config.js +5 -0
- package/server/applications/files/files.config.js.map +1 -1
- package/server/applications/files/guards/files-only-office.strategy.js +0 -1
- package/server/applications/files/guards/files-only-office.strategy.js.map +1 -1
- package/server/applications/spaces/guards/space.guard.spec.js +153 -18
- package/server/applications/spaces/guards/space.guard.spec.js.map +1 -1
- package/server/applications/spaces/services/spaces-browser.service.js +7 -7
- package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-manager.service.js +17 -17
- package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
- package/server/applications/sync/utils/routes.js +1 -1
- package/server/applications/sync/utils/routes.js.map +1 -1
- package/server/applications/users/guards/permissions.guard.js +4 -4
- package/server/applications/users/guards/permissions.guard.js.map +1 -1
- package/server/applications/users/guards/permissions.guard.spec.js +6 -6
- package/server/applications/users/guards/permissions.guard.spec.js.map +1 -1
- package/server/applications/users/guards/roles.guard.js +1 -1
- package/server/applications/users/guards/roles.guard.js.map +1 -1
- package/server/applications/users/models/user.model.js +1 -1
- package/server/applications/users/models/user.model.js.map +1 -1
- package/server/authentication/guards/auth-basic.guard.spec.js +38 -2
- package/server/authentication/guards/auth-basic.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-basic.strategy.js +0 -1
- package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
- package/server/authentication/guards/auth-local.guard.spec.js +7 -5
- package/server/authentication/guards/auth-local.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-local.strategy.js +0 -1
- package/server/authentication/guards/auth-local.strategy.js.map +1 -1
- package/server/authentication/guards/auth-token-access.guard.spec.js +30 -0
- package/server/authentication/guards/auth-token-access.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-token-access.strategy.js +0 -1
- package/server/authentication/guards/auth-token-access.strategy.js.map +1 -1
- package/server/authentication/guards/auth-token-refresh.strategy.js +0 -1
- package/server/authentication/guards/auth-token-refresh.strategy.js.map +1 -1
- package/server/authentication/services/auth-methods/auth-method-database.service.js +1 -1
- package/server/authentication/services/auth-methods/auth-method-database.service.js.map +1 -1
- package/server/authentication/services/auth-methods/auth-method-database.service.spec.js +8 -6
- package/server/authentication/services/auth-methods/auth-method-database.service.spec.js.map +1 -1
- package/server/authentication/services/auth-methods/auth-method-ldap.service.js +2 -2
- package/server/authentication/services/auth-methods/auth-method-ldap.service.js.map +1 -1
- package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js +500 -5
- package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js.map +1 -1
- package/server/configuration/config.loader.js +0 -3
- package/server/configuration/config.loader.js.map +1 -1
- package/server/infrastructure/context/services/context-manager.service.spec.js +98 -0
- package/server/infrastructure/context/services/context-manager.service.spec.js.map +1 -0
- package/server/infrastructure/database/constants.js +0 -1
- package/server/infrastructure/database/constants.js.map +1 -1
- package/server/infrastructure/database/scripts/seed/usersgroups.js +3 -3
- package/server/infrastructure/database/scripts/seed/usersgroups.js.map +1 -1
- package/server/infrastructure/mailer/mailer.service.js +20 -19
- package/server/infrastructure/mailer/mailer.service.js.map +1 -1
- package/server/infrastructure/mailer/mailer.service.spec.js +176 -0
- package/server/infrastructure/mailer/mailer.service.spec.js.map +1 -0
- package/static/{chunk-KFM544CA.js → chunk-3GC2BQZD.js} +1 -1
- package/static/{chunk-MWFRZBJD.js → chunk-5YKWZT33.js} +1 -1
- package/static/{chunk-XUZSYWRF.js → chunk-6F55D74O.js} +1 -1
- package/static/{chunk-ZFKCGL6X.js → chunk-B2Y2RNFP.js} +1 -1
- package/static/{chunk-PYSFXLMV.js → chunk-C23BPTJZ.js} +1 -1
- package/static/{chunk-FJFNDK67.js → chunk-DGVNNICG.js} +1 -1
- package/static/{chunk-SRLMFJ7C.js → chunk-FQ4AFNGE.js} +1 -1
- package/static/{chunk-Z5X7LVMZ.js → chunk-GBCYYDCI.js} +1 -1
- package/static/{chunk-MK7WZG3F.js → chunk-HZA7R43P.js} +1 -1
- package/static/{chunk-HUWQHCUX.js → chunk-KZQCFEPT.js} +1 -1
- package/static/{chunk-S5WXHO6D.js → chunk-LJIGRUEF.js} +1 -1
- package/static/{chunk-4KESSWTF.js → chunk-MOVWEZ7J.js} +1 -1
- package/static/{chunk-LYTD6AJE.js → chunk-N2LYWNTC.js} +1 -1
- package/static/{chunk-NV2MEIWP.js → chunk-PF4K7MVG.js} +1 -1
- package/static/{chunk-SKDQM65G.js → chunk-PY3BGNJN.js} +1 -1
- package/static/{chunk-QTW62OKJ.js → chunk-T55FAU2O.js} +1 -1
- package/static/{chunk-N3T57OCA.js → chunk-TCFKH6K6.js} +1 -1
- package/static/{chunk-3FX6ISDY.js → chunk-TDQAEVZN.js} +1 -1
- package/static/{chunk-O4AQBQBF.js → chunk-TNW2CGK6.js} +1 -1
- package/static/{chunk-3S4WNZ2T.js → chunk-TXPODW5Q.js} +1 -1
- package/static/{chunk-BW5PQAKK.js → chunk-VHYIXL7R.js} +1 -1
- package/static/{chunk-CLSVDV7J.js → chunk-VMQMD36Z.js} +1 -1
- package/static/{chunk-O67RFAWU.js → chunk-VMUOUCEI.js} +1 -1
- package/static/{chunk-WLPYIJFI.js → chunk-W3QXNDI5.js} +1 -1
- package/static/{chunk-AY2GOSJ2.js → chunk-WHMS3PJ3.js} +1 -1
- package/static/{chunk-4TEHM3AS.js → chunk-WWIC7UW3.js} +1 -1
- package/static/{chunk-LB7B5RIV.js → chunk-X43VWRFP.js} +1 -1
- package/static/{chunk-WL65GYD5.js → chunk-Y2CDUS4J.js} +2 -2
- package/static/{chunk-ZTXJC5IC.js → chunk-YCINY2YI.js} +1 -1
- package/static/index.html +2 -2
- package/static/{main-RREKR34B.js → main-7LDKYVXO.js} +3 -3
- package/static/styles-FYUSO6OJ.css +1 -0
- package/static/styles-3DONJ2Z4.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as q,C as $e}from"./chunk-AY2GOSJ2.js";import"./chunk-ZFKCGL6X.js";import{a as L}from"./chunk-O4AQBQBF.js";import"./chunk-JXZCNFW7.js";import"./chunk-LB7B5RIV.js";import{a as ke}from"./chunk-MTRNPGS4.js";import{d as Fe}from"./chunk-MK7WZG3F.js";import"./chunk-BW5PQAKK.js";import{a as z,b as Q,c as Me,d as Ee}from"./chunk-MWFRZBJD.js";import{b as Ae,c as Pe}from"./chunk-4TEHM3AS.js";import{b as Re}from"./chunk-ZTXJC5IC.js";import"./chunk-SRLMFJ7C.js";import"./chunk-FJFNDK67.js";import"./chunk-4KESSWTF.js";import{B as re,Gb as ve,Hb as Te,Ib as Ve,Ja as U,Qa as Se,Xa as we,kb as ye,pa as fe,qa as xe,ra as ge,v as ne,w as oe,wb as be}from"./chunk-WL65GYD5.js";import{m as De}from"./chunk-ZZ3LHYOY.js";import{b as Y}from"./chunk-XE5YHU5J.js";import{Cb as u,Eb as a,Ed as te,Fd as ie,Ga as H,Gc as X,Gd as ae,Gf as _e,Ib as E,If as me,Jb as F,Kb as k,L as I,Ld as le,Ma as r,Mb as V,Nb as P,Ob as O,Pb as C,Qb as v,Rb as N,Sb as j,Ue as ce,Uf as ue,Vf as he,Wd as se,Xa as K,Yb as G,Zc as Z,Zf as Ce,_b as J,ab as T,dc as S,fc as w,ha as M,ib as W,jb as y,kb as b,ma as d,na as _,nb as D,ob as R,of as pe,pb as m,pf as de,qb as s,rb as p,sb as h,yd as ee,zb as g}from"./chunk-RSNLYAN6.js";import{a as B}from"./chunk-RTRJ3KFH.js";var $=class{constructor(l){this.syncs=[],this.newly=0,Object.assign(this,l),Re(this),this.hTimeAgo=(0,re.default)(this.createdAt).fromNow(!0),this.newly=Se(this.createdAt)}fallBackMimeUrl(){this.mimeUrl=De}};var Oe=["MainContextMenu"],Ne=["TargetContextMenu"],Ue=()=>["shares"],Be=(t,l)=>l.id,Ie=(t,l)=>l.key;function ze(t,l){if(t&1&&(s(0,"span",31),C(1),p()),t&2){let e=a().$implicit,n=a(2);V("font-size",n.galleryMode.textSize,"px"),r(),v(e.hTimeAgo)}}function Qe(t,l){if(t&1){let e=g();s(0,"div",32),u("click",function(){d(e);let o=a().$implicit,i=a(2);return _(i.openChildShareDialog(o))}),h(1,"fa-icon",33),s(2,"span"),C(3),p()()}if(t&2){let e=a().$implicit,n=a(2);V("font-size",n.galleryMode.textSize,"px"),r(),m("icon",n.icons.SHARED),r(2),v(e.counts.shares)}}function Le(t,l){if(t&1){let e=g();s(0,"div",21),u("click",function(){let o=d(e).$implicit,i=a(2);return _(i.onSelect(o))})("contextmenu",function(o){let i=d(e).$implicit,c=a(2);return _(c.onTargetContextMenu(o,i))})("pressup",function(o){let i=d(e).$implicit,c=a(2);return _(c.onTargetContextMenu(o,i))})("tap",function(){d(e);let o=a(2);return _(o.openShareDialog())}),s(1,"div",22)(2,"img",23),u("error",function(){let o=d(e).$implicit;return _(o.fallBackMimeUrl())}),p(),s(3,"span",24),y(4,ze,2,3,"span",25),p(),y(5,Qe,4,4,"div",26),s(6,"span",27),h(7,"app-share-repository",28),p()(),s(8,"div",29)(9,"span",30),C(10),p()()()}if(t&2){let e=l.$implicit,n=l.$index,o=a(2);V("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),P("disabled",!e.enabled)("selected",e.id===(o.selected==null?null:o.selected.id)),r(),W("rowIndex",n),r(),m("src",e.mimeUrl,H)("height",o.galleryMode.image)("width",o.galleryMode.image),r(2),b(e.newly?4:-1),r(),b(e.counts.shares?5:-1),r(2),m("share",e)("galleryMode",o.galleryMode),r(2),V("font-size",o.galleryMode.textSize,"px"),r(),v(e.name)}}function qe(t,l){if(t&1){let e=g();s(0,"div",12)(1,"app-virtual-scroll",18),S(2,"searchFilter"),u("contextmenu",function(o){d(e);let i=a();return _(i.onContextMenu(o))}),s(3,"div",19),D(4,Le,11,19,"div",20,Be),p()()()}if(t&2){let e=a();r(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",w(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),r(3),R(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Ke(t,l){if(t&1&&h(0,"fa-icon",6),t&2){let e=a(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function We(t,l){if(t&1){let e=g();s(0,"th",39),u("click",function(){d(e);let o=a().$implicit,i=a(2);return _(i.sortBy(o.key))}),C(1),y(2,Ke,1,1,"fa-icon",6),p()}if(t&2){let e=a().$implicit,n=a(2);O(e.value.class),V("width",e.value.width,"%"),P("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),r(),N(" ",e.value.label," "),r(),b(n.sortTable.sortParam.column===e.key?2:-1)}}function je(t,l){if(t&1&&y(0,We,3,10,"th",38),t&2){let e=l.$implicit;b(e.value.show?0:-1)}}function Ge(t,l){if(t&1){let e=g();s(0,"div",42)(1,"img",44),u("error",function(){d(e);let o=a(3).$implicit;return _(o.fallBackMimeUrl())}),p(),s(2,"div",45)(3,"span",30),C(4),p(),s(5,"span",46),C(6),p()()()}if(t&2){let e=a(3).$implicit;r(),m("src",e.mimeUrl,H),r(3),v(e.name),r(2),v(e.description)}}function Je(t,l){if(t&1&&h(0,"app-share-repository",43),t&2){let e=a(3).$implicit;m("share",e)}}function Xe(t,l){if(t&1&&(s(0,"span"),C(1),S(2,"joinCounts"),p()),t&2){let e=a(3).$implicit;r(),v(w(2,1,e.counts,J(4,Ue)))}}function Ye(t,l){if(t&1){let e=g();s(0,"span",49),u("click",function(){d(e);let o=a(4).$implicit,i=a(2);return _(i.openChildShareDialog(o))}),h(1,"fa-icon",33),s(2,"span"),C(3),p()()}if(t&2){let e=a(4).$implicit,n=a(2);r(),m("icon",n.icons.SHARED),r(2),v(e.counts.shares)}}function Ze(t,l){if(t&1){let e=g();s(0,"span",50),u("click",function(){d(e);let o=a(4).$implicit,i=a(2);return _(i.goToComments(o))}),h(1,"fa-icon",6),p()}if(t&2){let e=a(6);r(),m("icon",e.icons.faCommentDots)}}function et(t,l){if(t&1&&(y(0,Ye,4,2,"span",47),y(1,Ze,2,1,"span",48)),t&2){let e=a(3).$implicit;b(e.counts.shares?0:-1),r(),b(e.hasComments?1:-1)}}function tt(t,l){if(t&1&&C(0),t&2){let e=a(3).$implicit;N(" ",e.hTimeAgo," ")}}function it(t,l){if(t&1&&(s(0,"td"),y(1,Ge,7,3,"div",42)(2,Je,1,1,"app-share-repository",43)(3,Xe,3,5,"span")(4,et,2,2)(5,tt,1,1),p()),t&2){let e,n=a().$implicit,o=a().$implicit;O(G("",n.value.class," ",n.value.newly?"prop-newly-"+o[n.value.newly]:"")),V("width",n.value.width,"%"),P("text-align-center",n.value.textCenter),r(),b((e=n.key)==="name"?1:e==="from"?2:e==="members"?3:e==="infos"?4:e==="created"?5:-1)}}function nt(t,l){if(t&1&&y(0,it,6,9,"td",41),t&2){let e=l.$implicit;b(e.value.show?0:-1)}}function ot(t,l){if(t&1){let e=g();s(0,"tr",40),u("click",function(){let o=d(e).$implicit,i=a(2);return _(i.onSelect(o))})("contextmenu",function(o){let i=d(e).$implicit,c=a(2);return _(c.onTargetContextMenu(o,i))})("pressup",function(o){let i=d(e).$implicit,c=a(2);return _(c.onTargetContextMenu(o,i))})("tap",function(){d(e);let o=a(2);return _(o.openShareDialog())}),D(1,nt,1,1,null,null,Ie),S(3,"keyvalue"),p()}if(t&2){let e=l.$implicit,n=a(2);P("disabled",!e.enabled)("selected",e.id===(n.selected==null?null:n.selected.id)),r(),R(w(3,4,n.tableHeaders,n.originalOrderKeyValue))}}function rt(t,l){if(t&1){let e=g();s(0,"table",34)(1,"thead")(2,"tr"),D(3,je,1,1,null,null,Ie),S(5,"keyvalue"),p()()(),s(6,"app-virtual-scroll",35),S(7,"searchFilter"),u("contextmenu",function(o){d(e);let i=a();return _(i.onContextMenu(o))}),s(8,"table",34)(9,"tbody",36),D(10,ot,4,7,"tr",37,Be),p()()()}if(t&2){let e=a();r(3),R(w(5,2,e.tableHeaders,e.originalOrderKeyValue)),r(3),m("bufferAmount",5)("items",w(7,5,e.shares,e.inputFilter.search())),r(4),R(e.scrollView==null?null:e.scrollView.viewPortItems)}}function at(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"New share"),p()),t&2){let e=a();r(),m("icon",e.icons.faPlus)}}function lt(t,l){}function st(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Refresh"),p()),t&2){let e=a();r(),m("icon",e.icons.faArrowRotateRight)}}function ct(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Go to"),p()),t&2){let e=a();r(),m("icon",e.icons.faMapMarkerAlt)}}function pt(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Edit"),p()),t&2){let e=a();r(),m("icon",e.icons.faPen)}}function dt(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Edit children shares"),p()),t&2){let e=a(2);r(),m("icon",e.icons.SHARED)}}function _t(t,l){if(t&1){let e=g();T(0,dt,3,1,"ng-template",15),u("execute",function(){d(e);let o=a();return _(o.openChildShareDialog())})}}function mt(t,l){}function ut(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Informations"),p()),t&2){let e=a();r(),m("icon",e.icons.faCircleInfo)}}var Xt=(()=>{let l=class l{constructor(){this.locale=M(ee),this.layout=M(be),this.icons={SHARED:Te.SHARED_WITH_OTHERS,faArrowRotateRight:me,faArrowDown:ue,faArrowUp:ce,faRotate:ae,faPlus:_e,faMinus:le,faPen:pe,faEllipsisH:se,faMapMarkerAlt:he,faCircleInfo:Ce,faCommentDots:de},this.originalOrderKeyValue=we,this.TAB_MENU=U,this.loading=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:40,textCenter:!1,class:"",show:!0,sortable:!0},from:{label:"Shared from",width:20,textCenter:!1,class:"d-none d-md-table-cell",show:!0},members:{label:"Members",width:16,class:"d-none d-md-table-cell",textCenter:!1,show:!0},infos:{label:"Infos",width:14,textCenter:!0,class:"d-none d-md-table-cell",show:!0},created:{label:"Created",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",created:"Created"},this.activatedRoute=M(Y),this.store=M(ye),this.sharesService=M(Pe),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],created:[{prop:"createdAt",type:"date"}]},this.sortTable=new Ee(this.constructor.name,this.sortSettings),this.loadShares(),this.activatedRoute.queryParams.subscribe(n=>this.focusOnSelect=n.select),this.layout.setBreadcrumbIcon(this.icons.SHARED),this.layout.setBreadcrumbNav({url:`/${Ve.SHARED}/${ve.SHARED_WITH_OTHER}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShares(){this.loading=!0,this.onSelect(),this.sharesService.listShares().subscribe({next:n=>{this.sortBy(this.sortTable.sortParam.column,!1,n.map(o=>new $(o))),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:n=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Shares",n.error.message)}})}sortBy(n,o=!0,i){this.shares=this.sortTable.sortBy(n,o,i||this.shares)}onSelect(n=null){this.selected=n,this.store.shareSelection.set(this.selected)}openShareDialog(n=!1){n?this.layout.openDialog(q,"lg").content.shareChange.pipe(I(1)).subscribe(i=>{let[c,f]=i;c==="add"&&(this.focusOnSelect=f.name,this.loadShares())}):this.sharesService.getShare(this.selected.id).subscribe({next:o=>{this.layout.openDialog(q,"lg",{initialState:{share:o}}).content.shareChange.pipe(I(1)).subscribe(c=>{let[f,x]=c;if(f==="update"){this.selected.name=x.name,this.selected.alias=x.alias,this.selected.description=x.description,this.selected.modifiedAt=x.modifiedAt,this.selected.enabled=x.enabled;let A={users:0,groups:0,links:x.links.length};for(let He of x.members)He.isUser?A.users++:A.groups++;this.selected.counts=B(B({},this.selected.counts),A)}else f==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(A=>A.id!==x.id)))})},error:o=>this.layout.sendNotification("error","Edit share",this.selected.name,o)})}openChildShareDialog(n){n&&this.onSelect(n),this.layout.openDialog($e,null,{initialState:{share:this.selected}}).content.sharesCountEvent.subscribe(i=>this.selected.counts.shares=i)}onContextMenu(n){n.preventDefault(),n.stopPropagation(),this.layout.openContextMenu(n,this.mainContextMenu)}onTargetContextMenu(n,o){n.preventDefault(),n.type==="contextmenu"&&n.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(n,this.targetContextMenu)}goTo(n){n=n||this.selected,this.sharesService.goTo(n).catch(console.error)}goToComments(n){this.sharesService.goTo(n).then(()=>this.layout.showRSideBarTab(U.COMMENTS,!0))}focusOn(n){let o=this.shares.find(i=>i.name===n);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=K({type:l,selectors:[["app-shared"]],viewQuery:function(o,i){if(o&1&&(E(Q,5),E(z,7),E(L,7),E(Oe,7),E(Ne,7)),o&2){let c;F(c=k())&&(i.scrollView=c.first),F(c=k())&&(i.inputFilter=c.first),F(c=k())&&(i.btnNavigationView=c.first),F(c=k())&&(i.mainContextMenu=c.first),F(c=k())&&(i.targetContextMenu=c.first)}},decls:38,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["contextMenuItem",""],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","pressup","tap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-success","cursor-pointer"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"click"],["l10nTranslate",""]],template:function(o,i){if(o&1){let c=g();s(0,"div",2)(1,"button",3),S(2,"translate"),u("click",function(){return d(c),_(i.loadShares())}),h(3,"fa-icon",4),p(),s(4,"button",5),S(5,"translate"),u("click",function(){return d(c),_(i.openShareDialog(!0))}),h(6,"fa-icon",6),p(),s(7,"button",7),S(8,"translate"),u("click",function(){return d(c),_(i.openShareDialog())}),h(9,"fa-icon",6),p(),s(10,"button",7),S(11,"translate"),u("click",function(){return d(c),_(i.openChildShareDialog())}),h(12,"fa-icon",6),p(),s(13,"button",7),S(14,"translate"),u("click",function(){return d(c),_(i.goTo())}),h(15,"fa-icon",6),p(),s(16,"div",8)(17,"div",9),h(18,"app-input-filter",10),p(),s(19,"app-navigation-view",11),u("sortBy",function(x){return d(c),_(i.sortBy(x))})("switchView",function(x){return d(c),_(i.galleryMode=x)}),p()()(),y(20,qe,6,8,"div",12)(21,rt,12,8),s(22,"div",13)(23,"span",14),C(24),S(25,"translate"),p()(),s(26,"context-menu",null,0),T(28,at,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.openShareDialog(!0))}),T(29,lt,0,0,"ng-template",16)(30,st,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.loadShares())}),p(),s(31,"context-menu",null,1),T(33,ct,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.goTo())}),T(34,pt,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.openShareDialog())}),y(35,_t,1,0,null,17),T(36,mt,0,0,"ng-template",16)(37,ut,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.layout.showRSideBarTab(i.TAB_MENU.SELECTION))}),p()}o&2&&(r(),m("tooltip",w(2,22,"Refresh",i.locale.language)),r(2),m("icon",i.icons.faArrowRotateRight)("animation",i.loading?"spin":null),r(),m("tooltip",w(5,25,"New share",i.locale.language)),r(2),m("icon",i.icons.faPlus),r(),m("disabled",!i.selected)("tooltip",w(8,28,"Edit share",i.locale.language)),r(2),m("icon",i.icons.faPen),r(),m("disabled",!(i.selected!=null&&i.selected.counts.shares))("tooltip",w(11,31,"Edit children shares",i.locale.language)),r(2),m("icon",i.icons.SHARED),r(),m("disabled",!i.selected)("tooltip",w(14,34,"Go to",i.locale.language)),r(2),m("icon",i.icons.faMapMarkerAlt),r(4),m("sortParams",i.sortTable.sortParam)("sortFields",i.btnSortFields),r(),b(i.galleryMode!=null&&i.galleryMode.enabled?20:21),r(4),j("",i.shares.length," ",w(25,37,"shares",i.locale.language)),r(5),m("divider",!0),r(6),b(i.selected!=null&&i.selected.counts.shares?35:-1),r(),m("divider",!0))},dependencies:[Z,ie,L,z,oe,ne,Q,Fe,ge,xe,fe,Ae,X,te,Me,ke],encapsulation:2});let t=l;return t})();export{Xt as SharedComponent};
|
|
1
|
+
import{B as q,C as $e}from"./chunk-WHMS3PJ3.js";import"./chunk-B2Y2RNFP.js";import{a as L}from"./chunk-TNW2CGK6.js";import"./chunk-JXZCNFW7.js";import"./chunk-X43VWRFP.js";import{a as ke}from"./chunk-MTRNPGS4.js";import{d as Fe}from"./chunk-HZA7R43P.js";import"./chunk-VHYIXL7R.js";import{a as z,b as Q,c as Me,d as Ee}from"./chunk-5YKWZT33.js";import{b as Ae,c as Pe}from"./chunk-WWIC7UW3.js";import{b as Re}from"./chunk-YCINY2YI.js";import"./chunk-FQ4AFNGE.js";import"./chunk-DGVNNICG.js";import"./chunk-MOVWEZ7J.js";import{B as re,Gb as ve,Hb as Te,Ib as Ve,Ja as U,Qa as Se,Xa as we,kb as ye,pa as fe,qa as xe,ra as ge,v as ne,w as oe,wb as be}from"./chunk-Y2CDUS4J.js";import{m as De}from"./chunk-ZZ3LHYOY.js";import{b as Y}from"./chunk-XE5YHU5J.js";import{Cb as u,Eb as a,Ed as te,Fd as ie,Ga as H,Gc as X,Gd as ae,Gf as _e,Ib as E,If as me,Jb as F,Kb as k,L as I,Ld as le,Ma as r,Mb as V,Nb as P,Ob as O,Pb as C,Qb as v,Rb as N,Sb as j,Ue as ce,Uf as ue,Vf as he,Wd as se,Xa as K,Yb as G,Zc as Z,Zf as Ce,_b as J,ab as T,dc as S,fc as w,ha as M,ib as W,jb as y,kb as b,ma as d,na as _,nb as D,ob as R,of as pe,pb as m,pf as de,qb as s,rb as p,sb as h,yd as ee,zb as g}from"./chunk-RSNLYAN6.js";import{a as B}from"./chunk-RTRJ3KFH.js";var $=class{constructor(l){this.syncs=[],this.newly=0,Object.assign(this,l),Re(this),this.hTimeAgo=(0,re.default)(this.createdAt).fromNow(!0),this.newly=Se(this.createdAt)}fallBackMimeUrl(){this.mimeUrl=De}};var Oe=["MainContextMenu"],Ne=["TargetContextMenu"],Ue=()=>["shares"],Be=(t,l)=>l.id,Ie=(t,l)=>l.key;function ze(t,l){if(t&1&&(s(0,"span",31),C(1),p()),t&2){let e=a().$implicit,n=a(2);V("font-size",n.galleryMode.textSize,"px"),r(),v(e.hTimeAgo)}}function Qe(t,l){if(t&1){let e=g();s(0,"div",32),u("click",function(){d(e);let o=a().$implicit,i=a(2);return _(i.openChildShareDialog(o))}),h(1,"fa-icon",33),s(2,"span"),C(3),p()()}if(t&2){let e=a().$implicit,n=a(2);V("font-size",n.galleryMode.textSize,"px"),r(),m("icon",n.icons.SHARED),r(2),v(e.counts.shares)}}function Le(t,l){if(t&1){let e=g();s(0,"div",21),u("click",function(){let o=d(e).$implicit,i=a(2);return _(i.onSelect(o))})("contextmenu",function(o){let i=d(e).$implicit,c=a(2);return _(c.onTargetContextMenu(o,i))})("pressup",function(o){let i=d(e).$implicit,c=a(2);return _(c.onTargetContextMenu(o,i))})("tap",function(){d(e);let o=a(2);return _(o.openShareDialog())}),s(1,"div",22)(2,"img",23),u("error",function(){let o=d(e).$implicit;return _(o.fallBackMimeUrl())}),p(),s(3,"span",24),y(4,ze,2,3,"span",25),p(),y(5,Qe,4,4,"div",26),s(6,"span",27),h(7,"app-share-repository",28),p()(),s(8,"div",29)(9,"span",30),C(10),p()()()}if(t&2){let e=l.$implicit,n=l.$index,o=a(2);V("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),P("disabled",!e.enabled)("selected",e.id===(o.selected==null?null:o.selected.id)),r(),W("rowIndex",n),r(),m("src",e.mimeUrl,H)("height",o.galleryMode.image)("width",o.galleryMode.image),r(2),b(e.newly?4:-1),r(),b(e.counts.shares?5:-1),r(2),m("share",e)("galleryMode",o.galleryMode),r(2),V("font-size",o.galleryMode.textSize,"px"),r(),v(e.name)}}function qe(t,l){if(t&1){let e=g();s(0,"div",12)(1,"app-virtual-scroll",18),S(2,"searchFilter"),u("contextmenu",function(o){d(e);let i=a();return _(i.onContextMenu(o))}),s(3,"div",19),D(4,Le,11,19,"div",20,Be),p()()()}if(t&2){let e=a();r(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",w(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),r(3),R(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Ke(t,l){if(t&1&&h(0,"fa-icon",6),t&2){let e=a(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function We(t,l){if(t&1){let e=g();s(0,"th",39),u("click",function(){d(e);let o=a().$implicit,i=a(2);return _(i.sortBy(o.key))}),C(1),y(2,Ke,1,1,"fa-icon",6),p()}if(t&2){let e=a().$implicit,n=a(2);O(e.value.class),V("width",e.value.width,"%"),P("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),r(),N(" ",e.value.label," "),r(),b(n.sortTable.sortParam.column===e.key?2:-1)}}function je(t,l){if(t&1&&y(0,We,3,10,"th",38),t&2){let e=l.$implicit;b(e.value.show?0:-1)}}function Ge(t,l){if(t&1){let e=g();s(0,"div",42)(1,"img",44),u("error",function(){d(e);let o=a(3).$implicit;return _(o.fallBackMimeUrl())}),p(),s(2,"div",45)(3,"span",30),C(4),p(),s(5,"span",46),C(6),p()()()}if(t&2){let e=a(3).$implicit;r(),m("src",e.mimeUrl,H),r(3),v(e.name),r(2),v(e.description)}}function Je(t,l){if(t&1&&h(0,"app-share-repository",43),t&2){let e=a(3).$implicit;m("share",e)}}function Xe(t,l){if(t&1&&(s(0,"span"),C(1),S(2,"joinCounts"),p()),t&2){let e=a(3).$implicit;r(),v(w(2,1,e.counts,J(4,Ue)))}}function Ye(t,l){if(t&1){let e=g();s(0,"span",49),u("click",function(){d(e);let o=a(4).$implicit,i=a(2);return _(i.openChildShareDialog(o))}),h(1,"fa-icon",33),s(2,"span"),C(3),p()()}if(t&2){let e=a(4).$implicit,n=a(2);r(),m("icon",n.icons.SHARED),r(2),v(e.counts.shares)}}function Ze(t,l){if(t&1){let e=g();s(0,"span",50),u("click",function(){d(e);let o=a(4).$implicit,i=a(2);return _(i.goToComments(o))}),h(1,"fa-icon",6),p()}if(t&2){let e=a(6);r(),m("icon",e.icons.faCommentDots)}}function et(t,l){if(t&1&&(y(0,Ye,4,2,"span",47),y(1,Ze,2,1,"span",48)),t&2){let e=a(3).$implicit;b(e.counts.shares?0:-1),r(),b(e.hasComments?1:-1)}}function tt(t,l){if(t&1&&C(0),t&2){let e=a(3).$implicit;N(" ",e.hTimeAgo," ")}}function it(t,l){if(t&1&&(s(0,"td"),y(1,Ge,7,3,"div",42)(2,Je,1,1,"app-share-repository",43)(3,Xe,3,5,"span")(4,et,2,2)(5,tt,1,1),p()),t&2){let e,n=a().$implicit,o=a().$implicit;O(G("",n.value.class," ",n.value.newly?"prop-newly-"+o[n.value.newly]:"")),V("width",n.value.width,"%"),P("text-align-center",n.value.textCenter),r(),b((e=n.key)==="name"?1:e==="from"?2:e==="members"?3:e==="infos"?4:e==="created"?5:-1)}}function nt(t,l){if(t&1&&y(0,it,6,9,"td",41),t&2){let e=l.$implicit;b(e.value.show?0:-1)}}function ot(t,l){if(t&1){let e=g();s(0,"tr",40),u("click",function(){let o=d(e).$implicit,i=a(2);return _(i.onSelect(o))})("contextmenu",function(o){let i=d(e).$implicit,c=a(2);return _(c.onTargetContextMenu(o,i))})("pressup",function(o){let i=d(e).$implicit,c=a(2);return _(c.onTargetContextMenu(o,i))})("tap",function(){d(e);let o=a(2);return _(o.openShareDialog())}),D(1,nt,1,1,null,null,Ie),S(3,"keyvalue"),p()}if(t&2){let e=l.$implicit,n=a(2);P("disabled",!e.enabled)("selected",e.id===(n.selected==null?null:n.selected.id)),r(),R(w(3,4,n.tableHeaders,n.originalOrderKeyValue))}}function rt(t,l){if(t&1){let e=g();s(0,"table",34)(1,"thead")(2,"tr"),D(3,je,1,1,null,null,Ie),S(5,"keyvalue"),p()()(),s(6,"app-virtual-scroll",35),S(7,"searchFilter"),u("contextmenu",function(o){d(e);let i=a();return _(i.onContextMenu(o))}),s(8,"table",34)(9,"tbody",36),D(10,ot,4,7,"tr",37,Be),p()()()}if(t&2){let e=a();r(3),R(w(5,2,e.tableHeaders,e.originalOrderKeyValue)),r(3),m("bufferAmount",5)("items",w(7,5,e.shares,e.inputFilter.search())),r(4),R(e.scrollView==null?null:e.scrollView.viewPortItems)}}function at(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"New share"),p()),t&2){let e=a();r(),m("icon",e.icons.faPlus)}}function lt(t,l){}function st(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Refresh"),p()),t&2){let e=a();r(),m("icon",e.icons.faArrowRotateRight)}}function ct(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Go to"),p()),t&2){let e=a();r(),m("icon",e.icons.faMapMarkerAlt)}}function pt(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Edit"),p()),t&2){let e=a();r(),m("icon",e.icons.faPen)}}function dt(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Edit children shares"),p()),t&2){let e=a(2);r(),m("icon",e.icons.SHARED)}}function _t(t,l){if(t&1){let e=g();T(0,dt,3,1,"ng-template",15),u("execute",function(){d(e);let o=a();return _(o.openChildShareDialog())})}}function mt(t,l){}function ut(t,l){if(t&1&&(s(0,"span",51),h(1,"fa-icon",6),C(2,"Informations"),p()),t&2){let e=a();r(),m("icon",e.icons.faCircleInfo)}}var Xt=(()=>{let l=class l{constructor(){this.locale=M(ee),this.layout=M(be),this.icons={SHARED:Te.SHARED_WITH_OTHERS,faArrowRotateRight:me,faArrowDown:ue,faArrowUp:ce,faRotate:ae,faPlus:_e,faMinus:le,faPen:pe,faEllipsisH:se,faMapMarkerAlt:he,faCircleInfo:Ce,faCommentDots:de},this.originalOrderKeyValue=we,this.TAB_MENU=U,this.loading=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:40,textCenter:!1,class:"",show:!0,sortable:!0},from:{label:"Shared from",width:20,textCenter:!1,class:"d-none d-md-table-cell",show:!0},members:{label:"Members",width:16,class:"d-none d-md-table-cell",textCenter:!1,show:!0},infos:{label:"Infos",width:14,textCenter:!0,class:"d-none d-md-table-cell",show:!0},created:{label:"Created",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",created:"Created"},this.activatedRoute=M(Y),this.store=M(ye),this.sharesService=M(Pe),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],created:[{prop:"createdAt",type:"date"}]},this.sortTable=new Ee(this.constructor.name,this.sortSettings),this.loadShares(),this.activatedRoute.queryParams.subscribe(n=>this.focusOnSelect=n.select),this.layout.setBreadcrumbIcon(this.icons.SHARED),this.layout.setBreadcrumbNav({url:`/${Ve.SHARED}/${ve.SHARED_WITH_OTHER}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShares(){this.loading=!0,this.onSelect(),this.sharesService.listShares().subscribe({next:n=>{this.sortBy(this.sortTable.sortParam.column,!1,n.map(o=>new $(o))),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:n=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Shares",n.error.message)}})}sortBy(n,o=!0,i){this.shares=this.sortTable.sortBy(n,o,i||this.shares)}onSelect(n=null){this.selected=n,this.store.shareSelection.set(this.selected)}openShareDialog(n=!1){n?this.layout.openDialog(q,"lg").content.shareChange.pipe(I(1)).subscribe(i=>{let[c,f]=i;c==="add"&&(this.focusOnSelect=f.name,this.loadShares())}):this.sharesService.getShare(this.selected.id).subscribe({next:o=>{this.layout.openDialog(q,"lg",{initialState:{share:o}}).content.shareChange.pipe(I(1)).subscribe(c=>{let[f,x]=c;if(f==="update"){this.selected.name=x.name,this.selected.alias=x.alias,this.selected.description=x.description,this.selected.modifiedAt=x.modifiedAt,this.selected.enabled=x.enabled;let A={users:0,groups:0,links:x.links.length};for(let He of x.members)He.isUser?A.users++:A.groups++;this.selected.counts=B(B({},this.selected.counts),A)}else f==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(A=>A.id!==x.id)))})},error:o=>this.layout.sendNotification("error","Edit share",this.selected.name,o)})}openChildShareDialog(n){n&&this.onSelect(n),this.layout.openDialog($e,null,{initialState:{share:this.selected}}).content.sharesCountEvent.subscribe(i=>this.selected.counts.shares=i)}onContextMenu(n){n.preventDefault(),n.stopPropagation(),this.layout.openContextMenu(n,this.mainContextMenu)}onTargetContextMenu(n,o){n.preventDefault(),n.type==="contextmenu"&&n.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(n,this.targetContextMenu)}goTo(n){n=n||this.selected,this.sharesService.goTo(n).catch(console.error)}goToComments(n){this.sharesService.goTo(n).then(()=>this.layout.showRSideBarTab(U.COMMENTS,!0))}focusOn(n){let o=this.shares.find(i=>i.name===n);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=K({type:l,selectors:[["app-shared"]],viewQuery:function(o,i){if(o&1&&(E(Q,5),E(z,7),E(L,7),E(Oe,7),E(Ne,7)),o&2){let c;F(c=k())&&(i.scrollView=c.first),F(c=k())&&(i.inputFilter=c.first),F(c=k())&&(i.btnNavigationView=c.first),F(c=k())&&(i.mainContextMenu=c.first),F(c=k())&&(i.targetContextMenu=c.first)}},decls:38,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["contextMenuItem",""],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","pressup","tap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning"],[1,"label-bottom-right","badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"me-1",3,"icon"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1"],[1,"badge","rounded-pill","bg-success","cursor-pointer"],[1,"badge","rounded-pill","bg-purple","cursor-pointer","me-1",3,"click"],[1,"badge","rounded-pill","bg-success","cursor-pointer",3,"click"],["l10nTranslate",""]],template:function(o,i){if(o&1){let c=g();s(0,"div",2)(1,"button",3),S(2,"translate"),u("click",function(){return d(c),_(i.loadShares())}),h(3,"fa-icon",4),p(),s(4,"button",5),S(5,"translate"),u("click",function(){return d(c),_(i.openShareDialog(!0))}),h(6,"fa-icon",6),p(),s(7,"button",7),S(8,"translate"),u("click",function(){return d(c),_(i.openShareDialog())}),h(9,"fa-icon",6),p(),s(10,"button",7),S(11,"translate"),u("click",function(){return d(c),_(i.openChildShareDialog())}),h(12,"fa-icon",6),p(),s(13,"button",7),S(14,"translate"),u("click",function(){return d(c),_(i.goTo())}),h(15,"fa-icon",6),p(),s(16,"div",8)(17,"div",9),h(18,"app-input-filter",10),p(),s(19,"app-navigation-view",11),u("sortBy",function(x){return d(c),_(i.sortBy(x))})("switchView",function(x){return d(c),_(i.galleryMode=x)}),p()()(),y(20,qe,6,8,"div",12)(21,rt,12,8),s(22,"div",13)(23,"span",14),C(24),S(25,"translate"),p()(),s(26,"context-menu",null,0),T(28,at,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.openShareDialog(!0))}),T(29,lt,0,0,"ng-template",16)(30,st,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.loadShares())}),p(),s(31,"context-menu",null,1),T(33,ct,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.goTo())}),T(34,pt,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.openShareDialog())}),y(35,_t,1,0,null,17),T(36,mt,0,0,"ng-template",16)(37,ut,3,1,"ng-template",15),u("execute",function(){return d(c),_(i.layout.showRSideBarTab(i.TAB_MENU.SELECTION))}),p()}o&2&&(r(),m("tooltip",w(2,22,"Refresh",i.locale.language)),r(2),m("icon",i.icons.faArrowRotateRight)("animation",i.loading?"spin":null),r(),m("tooltip",w(5,25,"New share",i.locale.language)),r(2),m("icon",i.icons.faPlus),r(),m("disabled",!i.selected)("tooltip",w(8,28,"Edit share",i.locale.language)),r(2),m("icon",i.icons.faPen),r(),m("disabled",!(i.selected!=null&&i.selected.counts.shares))("tooltip",w(11,31,"Edit children shares",i.locale.language)),r(2),m("icon",i.icons.SHARED),r(),m("disabled",!i.selected)("tooltip",w(14,34,"Go to",i.locale.language)),r(2),m("icon",i.icons.faMapMarkerAlt),r(4),m("sortParams",i.sortTable.sortParam)("sortFields",i.btnSortFields),r(),b(i.galleryMode!=null&&i.galleryMode.enabled?20:21),r(4),j("",i.shares.length," ",w(25,37,"shares",i.locale.language)),r(5),m("divider",!0),r(6),b(i.selected!=null&&i.selected.counts.shares?35:-1),r(),m("divider",!0))},dependencies:[Z,ie,L,z,oe,ne,Q,Fe,ge,xe,fe,Ae,X,te,Me,ke],encapsulation:2});let t=l;return t})();export{Xt as SharedComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as F,m as y,s as b,t as _}from"./chunk-WL65GYD5.js";import{$b as H,Cb as w,E as D,Fb as N,Gb as L,Na as k,Nb as C,Qa as p,Ra as o,Sa as g,Xa as I,Ya as O,Za as u,Zb as E,bb as f,ca as m,da as M,ib as A,pb as S,qb as R,qc as v,rb as j,xc as P,ya as l}from"./chunk-RSNLYAN6.js";var U=["*"],V=s=>({dropdown:s}),B=(()=>{let t=class t{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})(),c=(()=>{let t=class t{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new f,this.isDisabledChange=new f,this.toggleClick=new f,this.counts=0,this.dropdownMenu=new Promise(e=>{this.resolveDropdownMenu=e})}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"platform"});let s=t;return s})(),K="220ms cubic-bezier(0, 0, 0.2, 1)",T=[y({height:0,overflow:"hidden"}),F(K,y({height:"*",overflow:"hidden"}))],q=(()=>{let t=class t{get direction(){return this._state.direction}constructor(e,i,n,d,a){this._state=e,this.cd=i,this._renderer=n,this._element=d,this.isOpen=!1,this._factoryDropDownAnimation=a.build(T),this._subscription=e.isOpenChange.subscribe(h=>{this.isOpen=h;let r=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),r&&(this._renderer.addClass(r,"show"),(r.classList.contains("dropdown-menu-right")||r.classList.contains("dropdown-menu-end"))&&(this._renderer.setStyle(r,"left","auto"),this._renderer.setStyle(r,"right","0")),this.direction==="up"&&(this._renderer.setStyle(r,"top","auto"),this._renderer.setStyle(r,"transform","translateY(-101%)"))),r&&this._state.isAnimated&&this._factoryDropDownAnimation.create(r).play(),this.cd.markForCheck(),this.cd.detectChanges()})}_contains(e){return this._element.nativeElement.contains(e)}ngOnDestroy(){this._subscription.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(c),o(v),o(p),o(l),o(b))},t.\u0275cmp=I({type:t,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:U,decls:2,vars:9,consts:[[3,"ngClass"]],template:function(i,n){i&1&&(N(),R(0,"div",0),L(1),j()),i&2&&(C("dropup",n.direction==="up")("show",n.isOpen)("open",n.isOpen),S("ngClass",H(7,V,n.direction==="down")))},dependencies:[P],encapsulation:2,changeDetection:0});let s=t;return s})(),Y=(()=>{let t=class t{set autoClose(e){this._state.autoClose=e}get autoClose(){return this._state.autoClose}set isAnimated(e){this._state.isAnimated=e}get isAnimated(){return this._state.isAnimated}set insideClick(e){this._state.insideClick=e}get insideClick(){return this._state.insideClick}set isDisabled(e){this._isDisabled=e,this._state.isDisabledChange.emit(e),e&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(e){e?this.show():this.hide()}get _showInline(){return!this.container}constructor(e,i,n,d,a,h,r){this._elementRef=e,this._renderer=i,this._viewContainerRef=n,this._cis=d,this._state=a,this._config=h,this.dropup=!1,this._isInlineOpen=!1,this._isDisabled=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._state.stopOnClickPropagation=this._config.stopOnClickPropagation,this._factoryDropDownAnimation=r.build(T),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:c,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(e=>this.toggle(e))),this._subscriptions.push(this._state.isDisabledChange.pipe(D(e=>e)).subscribe(()=>this.hide())))}show(){if(!(this.isOpen||this.isDisabled)){if(this._showInline){this._inlinedMenu||this._state.dropdownMenu.then(e=>{this._dropdown.attachInline(e.viewContainer,e.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._inlinedMenu&&this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),this.playAnimation();return}this._state.dropdownMenu.then(e=>{let i=this.dropup||typeof this.dropup<"u"&&this.dropup;this._state.direction=i?"up":"down";let n=this.placement||(i?"top start":"bottom start");this._dropdown.attach(q).to(this.container).position({attachment:n}).show({content:e.templateRef,placement:n}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){this.isOpen&&(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(e){return this.isOpen||!e?this.hide():this.show()}_contains(e){return this._elementRef.nativeElement.contains(e.target)||this._dropdown.instance&&this._dropdown.instance._contains(e.target)}navigationClick(e){let i=this._elementRef.nativeElement.querySelector(".dropdown-menu");if(!i)return;let n=this._elementRef.nativeElement.ownerDocument.activeElement,d=i.querySelectorAll(".dropdown-item");switch(e.keyCode){case 38:this._state.counts>0&&d[--this._state.counts].focus();break;case 40:this._state.counts+1<d.length&&(n.classList!==d[this._state.counts].classList?d[this._state.counts].focus():d[++this._state.counts].focus());break;default:}e.preventDefault()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles()}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._inlinedMenu&&this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){let e=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right")||this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-end");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",e?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",e?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}};t.\u0275fac=function(i){return new(i||t)(o(l),o(p),o(g),o(_),o(c),o(B),o(b))},t.\u0275dir=u({type:t,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:function(i,n){i&1&&w("keydown.arrowDown",function(a){return n.navigationClick(a)})("keydown.arrowUp",function(a){return n.navigationClick(a)}),i&2&&C("dropup",n.dropup)("open",n.isOpen)("show",n.isOpen)},inputs:{placement:"placement",triggers:"triggers",container:"container",dropup:"dropup",autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",onShown:"onShown",onHidden:"onHidden"},exportAs:["bs-dropdown"],features:[E([c,_,B])]});let s=t;return s})(),ae=(()=>{let t=class t{constructor(e,i,n){e.resolveDropdownMenu({templateRef:n,viewContainer:i})}};t.\u0275fac=function(i){return new(i||t)(o(c),o(g),o(k))},t.\u0275dir=u({type:t,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]});let s=t;return s})(),he=(()=>{let t=class t{constructor(e,i,n,d,a){this._changeDetectorRef=e,this._dropdown=i,this._element=n,this._renderer=d,this._state=a,this.isOpen=!1,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(h=>{this.isOpen=h,h?(this._documentClickListener=this._renderer.listen("document","click",r=>{this._state.autoClose&&r.button!==2&&!this._element.nativeElement.contains(r.target)&&!(this._state.insideClick&&this._dropdown._contains(r))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(h=>this.isDisabled=h||void 0))}onClick(e){this._state.stopOnClickPropagation&&e.stopPropagation(),!this.isDisabled&&this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(let e of this._subscriptions)e.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(v),o(Y),o(l),o(p),o(c))},t.\u0275dir=u({type:t,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:function(i,n){i&1&&w("click",function(a){return n.onClick(a)}),i&2&&A("aria-haspopup",!0)("disabled",n.isDisabled)("aria-expanded",n.isOpen)},exportAs:["bs-dropdown-toggle"]});let s=t;return s})(),ce=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=O({type:t}),t.\u0275inj=M({});let s=t;return s})();export{Y as a,ae as b,he as c,ce as d};
|
|
1
|
+
import{k as F,m as y,s as b,t as _}from"./chunk-Y2CDUS4J.js";import{$b as H,Cb as w,E as D,Fb as N,Gb as L,Na as k,Nb as C,Qa as p,Ra as o,Sa as g,Xa as I,Ya as O,Za as u,Zb as E,bb as f,ca as m,da as M,ib as A,pb as S,qb as R,qc as v,rb as j,xc as P,ya as l}from"./chunk-RSNLYAN6.js";var U=["*"],V=s=>({dropdown:s}),B=(()=>{let t=class t{constructor(){this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})(),c=(()=>{let t=class t{constructor(){this.direction="down",this.autoClose=!0,this.insideClick=!1,this.isAnimated=!1,this.stopOnClickPropagation=!1,this.isOpenChange=new f,this.isDisabledChange=new f,this.toggleClick=new f,this.counts=0,this.dropdownMenu=new Promise(e=>{this.resolveDropdownMenu=e})}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"platform"});let s=t;return s})(),K="220ms cubic-bezier(0, 0, 0.2, 1)",T=[y({height:0,overflow:"hidden"}),F(K,y({height:"*",overflow:"hidden"}))],q=(()=>{let t=class t{get direction(){return this._state.direction}constructor(e,i,n,d,a){this._state=e,this.cd=i,this._renderer=n,this._element=d,this.isOpen=!1,this._factoryDropDownAnimation=a.build(T),this._subscription=e.isOpenChange.subscribe(h=>{this.isOpen=h;let r=this._element.nativeElement.querySelector(".dropdown-menu");this._renderer.addClass(this._element.nativeElement.querySelector("div"),"open"),r&&(this._renderer.addClass(r,"show"),(r.classList.contains("dropdown-menu-right")||r.classList.contains("dropdown-menu-end"))&&(this._renderer.setStyle(r,"left","auto"),this._renderer.setStyle(r,"right","0")),this.direction==="up"&&(this._renderer.setStyle(r,"top","auto"),this._renderer.setStyle(r,"transform","translateY(-101%)"))),r&&this._state.isAnimated&&this._factoryDropDownAnimation.create(r).play(),this.cd.markForCheck(),this.cd.detectChanges()})}_contains(e){return this._element.nativeElement.contains(e)}ngOnDestroy(){this._subscription.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(c),o(v),o(p),o(l),o(b))},t.\u0275cmp=I({type:t,selectors:[["bs-dropdown-container"]],hostAttrs:[2,"display","block","position","absolute","z-index","1040"],ngContentSelectors:U,decls:2,vars:9,consts:[[3,"ngClass"]],template:function(i,n){i&1&&(N(),R(0,"div",0),L(1),j()),i&2&&(C("dropup",n.direction==="up")("show",n.isOpen)("open",n.isOpen),S("ngClass",H(7,V,n.direction==="down")))},dependencies:[P],encapsulation:2,changeDetection:0});let s=t;return s})(),Y=(()=>{let t=class t{set autoClose(e){this._state.autoClose=e}get autoClose(){return this._state.autoClose}set isAnimated(e){this._state.isAnimated=e}get isAnimated(){return this._state.isAnimated}set insideClick(e){this._state.insideClick=e}get insideClick(){return this._state.insideClick}set isDisabled(e){this._isDisabled=e,this._state.isDisabledChange.emit(e),e&&this.hide()}get isDisabled(){return this._isDisabled}get isOpen(){return this._showInline?this._isInlineOpen:this._dropdown.isShown}set isOpen(e){e?this.show():this.hide()}get _showInline(){return!this.container}constructor(e,i,n,d,a,h,r){this._elementRef=e,this._renderer=i,this._viewContainerRef=n,this._cis=d,this._state=a,this._config=h,this.dropup=!1,this._isInlineOpen=!1,this._isDisabled=!1,this._subscriptions=[],this._isInited=!1,this._state.autoClose=this._config.autoClose,this._state.insideClick=this._config.insideClick,this._state.isAnimated=this._config.isAnimated,this._state.stopOnClickPropagation=this._config.stopOnClickPropagation,this._factoryDropDownAnimation=r.build(T),this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:c,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange}ngOnInit(){this._isInited||(this._isInited=!0,this._dropdown.listen({outsideClick:!1,triggers:this.triggers,show:()=>this.show()}),this._subscriptions.push(this._state.toggleClick.subscribe(e=>this.toggle(e))),this._subscriptions.push(this._state.isDisabledChange.pipe(D(e=>e)).subscribe(()=>this.hide())))}show(){if(!(this.isOpen||this.isDisabled)){if(this._showInline){this._inlinedMenu||this._state.dropdownMenu.then(e=>{this._dropdown.attachInline(e.viewContainer,e.templateRef),this._inlinedMenu=this._dropdown._inlineViewRef,this.addBs4Polyfills(),this._inlinedMenu&&this._renderer.addClass(this._inlinedMenu.rootNodes[0].parentNode,"open"),this.playAnimation()}).catch(),this.addBs4Polyfills(),this._isInlineOpen=!0,this.onShown.emit(!0),this._state.isOpenChange.emit(!0),this.playAnimation();return}this._state.dropdownMenu.then(e=>{let i=this.dropup||typeof this.dropup<"u"&&this.dropup;this._state.direction=i?"up":"down";let n=this.placement||(i?"top start":"bottom start");this._dropdown.attach(q).to(this.container).position({attachment:n}).show({content:e.templateRef,placement:n}),this._state.isOpenChange.emit(!0)}).catch()}}hide(){this.isOpen&&(this._showInline?(this.removeShowClass(),this.removeDropupStyles(),this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))}toggle(e){return this.isOpen||!e?this.hide():this.show()}_contains(e){return this._elementRef.nativeElement.contains(e.target)||this._dropdown.instance&&this._dropdown.instance._contains(e.target)}navigationClick(e){let i=this._elementRef.nativeElement.querySelector(".dropdown-menu");if(!i)return;let n=this._elementRef.nativeElement.ownerDocument.activeElement,d=i.querySelectorAll(".dropdown-item");switch(e.keyCode){case 38:this._state.counts>0&&d[--this._state.counts].focus();break;case 40:this._state.counts+1<d.length&&(n.classList!==d[this._state.counts].classList?d[this._state.counts].focus():d[++this._state.counts].focus());break;default:}e.preventDefault()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._dropdown.dispose()}addBs4Polyfills(){this.addShowClass(),this.checkRightAlignment(),this.addDropupStyles()}playAnimation(){this._state.isAnimated&&this._inlinedMenu&&setTimeout(()=>{this._inlinedMenu&&this._factoryDropDownAnimation.create(this._inlinedMenu.rootNodes[0]).play()})}addShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.addClass(this._inlinedMenu.rootNodes[0],"show")}removeShowClass(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&this._renderer.removeClass(this._inlinedMenu.rootNodes[0],"show")}checkRightAlignment(){if(this._inlinedMenu&&this._inlinedMenu.rootNodes[0]){let e=this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-right")||this._inlinedMenu.rootNodes[0].classList.contains("dropdown-menu-end");this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"left",e?"auto":"0"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"right",e?"0":"auto")}}addDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"top",this.dropup?"auto":"100%"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"transform",this.dropup?"translateY(-101%)":"translateY(0)"),this._renderer.setStyle(this._inlinedMenu.rootNodes[0],"bottom","auto"))}removeDropupStyles(){this._inlinedMenu&&this._inlinedMenu.rootNodes[0]&&(this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"top"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"transform"),this._renderer.removeStyle(this._inlinedMenu.rootNodes[0],"bottom"))}};t.\u0275fac=function(i){return new(i||t)(o(l),o(p),o(g),o(_),o(c),o(B),o(b))},t.\u0275dir=u({type:t,selectors:[["","bsDropdown",""],["","dropdown",""]],hostVars:6,hostBindings:function(i,n){i&1&&w("keydown.arrowDown",function(a){return n.navigationClick(a)})("keydown.arrowUp",function(a){return n.navigationClick(a)}),i&2&&C("dropup",n.dropup)("open",n.isOpen)("show",n.isOpen)},inputs:{placement:"placement",triggers:"triggers",container:"container",dropup:"dropup",autoClose:"autoClose",isAnimated:"isAnimated",insideClick:"insideClick",isDisabled:"isDisabled",isOpen:"isOpen"},outputs:{isOpenChange:"isOpenChange",onShown:"onShown",onHidden:"onHidden"},exportAs:["bs-dropdown"],features:[E([c,_,B])]});let s=t;return s})(),ae=(()=>{let t=class t{constructor(e,i,n){e.resolveDropdownMenu({templateRef:n,viewContainer:i})}};t.\u0275fac=function(i){return new(i||t)(o(c),o(g),o(k))},t.\u0275dir=u({type:t,selectors:[["","bsDropdownMenu",""],["","dropdownMenu",""]],exportAs:["bs-dropdown-menu"]});let s=t;return s})(),he=(()=>{let t=class t{constructor(e,i,n,d,a){this._changeDetectorRef=e,this._dropdown=i,this._element=n,this._renderer=d,this._state=a,this.isOpen=!1,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(h=>{this.isOpen=h,h?(this._documentClickListener=this._renderer.listen("document","click",r=>{this._state.autoClose&&r.button!==2&&!this._element.nativeElement.contains(r.target)&&!(this._state.insideClick&&this._dropdown._contains(r))&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())}),this._escKeyUpListener=this._renderer.listen(this._element.nativeElement,"keyup.esc",()=>{this._state.autoClose&&(this._state.toggleClick.emit(!1),this._changeDetectorRef.detectChanges())})):(this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener())})),this._subscriptions.push(this._state.isDisabledChange.subscribe(h=>this.isDisabled=h||void 0))}onClick(e){this._state.stopOnClickPropagation&&e.stopPropagation(),!this.isDisabled&&this._state.toggleClick.emit(!0)}ngOnDestroy(){this._documentClickListener&&this._documentClickListener(),this._escKeyUpListener&&this._escKeyUpListener();for(let e of this._subscriptions)e.unsubscribe()}};t.\u0275fac=function(i){return new(i||t)(o(v),o(Y),o(l),o(p),o(c))},t.\u0275dir=u({type:t,selectors:[["","bsDropdownToggle",""],["","dropdownToggle",""]],hostVars:3,hostBindings:function(i,n){i&1&&w("click",function(a){return n.onClick(a)}),i&2&&A("aria-haspopup",!0)("disabled",n.isDisabled)("aria-expanded",n.isOpen)},exportAs:["bs-dropdown-toggle"]});let s=t;return s})(),ce=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=O({type:t}),t.\u0275inj=M({});let s=t;return s})();export{Y as a,ae as b,he as c,ce as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as R}from"./chunk-
|
|
1
|
+
import{e as R}from"./chunk-WWIC7UW3.js";import"./chunk-YCINY2YI.js";import"./chunk-FQ4AFNGE.js";import"./chunk-DGVNNICG.js";import"./chunk-MOVWEZ7J.js";import{Hb as T}from"./chunk-Y2CDUS4J.js";import{c as w,d as D,h as A,k as I}from"./chunk-ZZ3LHYOY.js";import{b as L,e as b}from"./chunk-XE5YHU5J.js";import{Cb as g,Eb as p,Ed as P,Fd as E,Ga as h,Ma as l,Pb as c,Qb as v,Sb as S,Xa as _,Zc as U,dc as x,fc as C,ha as u,jb as f,kb as k,pb as m,qb as n,rb as r,sb as s,yd as y}from"./chunk-RSNLYAN6.js";import"./chunk-RTRJ3KFH.js";function j(e,i){if(e&1&&s(0,"img",6),e&2){let o=p();m("src",o.mimeUrl,h)}}function z(e,i){if(e&1&&s(0,"fa-icon",7),e&2){let o=p();m("icon",o.icons.SPACES)("fixedWidth",!1)}}function M(e,i){if(e&1&&(s(0,"img",14),n(1,"span",15),c(2),r()),e&2){let o=p();m("src",o.link.owner.avatar,h),l(2),v(o.link.owner.fullName)}}function N(e,i){e&1&&(n(0,"span",13),c(1,"You have been invited to join this space"),r())}function B(e,i){if(e&1&&(n(0,"span"),c(1),x(2,"translate"),x(3,"translate"),r()),e&2){let o=p();l(),S("",C(2,2,"share with you this",o.locale.language)," ",C(3,5,o.link.share.isDir?"directory":"file",o.locale.language))}}function F(e,i){e&1&&(n(0,"span",13),c(1,"You have been invited to join this share"),r())}var X=(()=>{let i=class i{constructor(){this.locale=u(y),this.icons={SPACES:T.SPACES},this.logoUrl=I,this.mimeUrl=null,this.activatedRoute=u(L),this.linksService=u(R),this.activatedRoute.params.subscribe(t=>this.linkUUID=t.uuid),this.activatedRoute.data.subscribe(t=>this.setLink(t.link))}setLink(t){t.space||(this.mimeUrl=A(t.share.isDir?t.share.hasParent?D:w:t.share.mime)),this.link=t}followLink(){this.linksService.linkAccess(this.linkUUID,this.link)}};i.\u0275fac=function(d){return new(d||i)},i.\u0275cmp=_({type:i,selectors:[["app-public-link"]],decls:18,vars:5,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],[1,"d-flex","flex-column","align-content-center"],[1,"resource","d-flex","flex-column","align-items-center","mt-3","mx-auto","cursor-pointer",3,"click"],["alt","","height","96",1,"no-select-pointer",3,"src"],[1,"circle-primary-icon",2,"min-width","128px","min-height","128px","font-size","64px",3,"icon","fixedWidth"],[1,"error-code"],[1,"error-text","no-select"],[1,"hr"],[1,"d-flex","justify-content-center","align-items-center"],[1,"solve"],["l10nTranslate",""],["alt","","width","42","height","42",1,"avatar-base-img","me-3",3,"src"],[1,"oops","me-2"]],template:function(d,a){d&1&&(n(0,"div",0)(1,"div",1)(2,"a",2),s(3,"img",3),r()(),n(4,"div",4)(5,"div",5),g("click",function(){return a.followLink()}),f(6,j,1,1,"img",6)(7,z,1,2,"fa-icon",7),n(8,"span",8),c(9),r()()(),n(10,"div",9),s(11,"span",10),n(12,"div",11),f(13,M,3,2),n(14,"span",12),f(15,N,2,0,"span",13)(16,B,4,8,"span")(17,F,2,0,"span",13),r()()()()),d&2&&(l(3),m("src",a.logoUrl,h),l(3),k(a.mimeUrl?6:7),l(3),v((a.link.share==null?null:a.link.share.name)||(a.link.space==null?null:a.link.space.name)),l(4),k(a.link.owner?13:-1),l(2),k(a.link.space?15:a.link.owner?16:17))},dependencies:[b,U,E,P],encapsulation:2});let e=i;return e})();export{X as PublicLinkComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ce,b as ve,c as be,d as xe,f as Ee,i as De}from"./chunk-BW5PQAKK.js";import{a as Se,b as Te}from"./chunk-SRLMFJ7C.js";import{f as _e}from"./chunk-4KESSWTF.js";import{K as ce,L as ue,R as D,Rb as he,ua as de,va as pe,wa as ge,wb as fe}from"./chunk-WL65GYD5.js";import{$c as q,Bf as re,Cb as _,Eb as d,Ed as te,Ee as oe,Fc as B,Fd as ie,Gf as le,Ma as a,Nb as b,Ob as U,Pb as s,Qb as x,Qf as me,Rb as E,Sb as A,Xa as O,Xb as k,Zc as j,ab as y,ad as H,bb as R,bf as ae,cd as p,dc as v,ec as S,ed as X,fc as M,fd as $,gd as z,ha as T,id as g,jb as f,kb as h,lb as F,ma as P,na as L,nb as G,nd as W,ob as N,od as J,of as se,pb as c,pd as K,pe as ne,qb as i,qd as Q,rb as n,rd as Y,sb as u,xd as Z,yd as ee,zb as V}from"./chunk-RSNLYAN6.js";import{a as I}from"./chunk-RTRJ3KFH.js";function we(t,m){if(t&1&&(u(0,"fa-icon",42),i(1,"span"),s(2),n()),t&2){let o=d();c("icon",o.icons.faPen),a(2),x(o.guest.fullName)}}function ye(t,m){if(t&1&&(u(0,"fa-icon",42),i(1,"span",43),s(2,"New guest"),n()),t&2){let o=d();c("icon",o.icons.faPlus)}}function Fe(t,m){if(t&1&&u(0,"fa-icon",2),t&2){let o=d();c("icon",o.icons.faSpinner)}}function Ge(t,m){t&1&&(i(0,"h4",3)(1,"span",43),s(2,"Edit guest"),n()())}function Ne(t,m){if(t&1&&(u(0,"fa-icon",44),i(1,"span",45),s(2,"Account"),n()),t&2){let o=d();c("icon",o.icons.faAddressCard)}}function Ue(t,m){if(t&1&&u(0,"app-password-strength-bar",22),t&2){let o=d();c("passwordToCheck",o.guestForm.value.password)}}function Ae(t,m){if(t&1&&(i(0,"option",26),s(1),n()),t&2){let o=m.$implicit;c("ngValue",o),a(),x(o)}}function ke(t,m){if(t&1&&(i(0,"option",34),s(1),n()),t&2){let o=m.$implicit,r=d();c("ngValue",r.allNotifications.indexOf(o)),a(),x(o)}}function Ie(t,m){if(t&1&&(i(0,"div"),s(1),v(2,"amDateFormat"),n(),i(3,"div"),s(4),v(5,"amDateFormat"),n()),t&2){let o=d(2);a(),A("",S(2,4,o.guest.currentAccess)," - ",o.guest.currentIp),a(3),A("",S(5,6,o.guest.lastAccess)," - ",o.guest.lastIp)}}function Pe(t,m){t&1&&(i(0,"span",37),s(1,"never"),n())}function Le(t,m){if(t&1&&(i(0,"div",11)(1,"div",12)(2,"label",46),s(3,"Creation date"),n(),i(4,"div",47),s(5),v(6,"amDateFormat"),n()(),i(7,"div",48)(8,"label",49),s(9,"Last accesses"),n(),i(10,"div",50),f(11,Ie,6,8)(12,Pe,2,0,"span",37),n()()()),t&2){let o=d();a(5),x(S(6,2,o.guest.createdAt)),a(6),h(o.guest.lastAccess?11:12)}}function Oe(t,m){if(t&1&&(u(0,"fa-icon",44),i(1,"span",51),s(2,"Managers"),n(),i(3,"span"),s(4),n()),t&2){let o=d();c("icon",o.icons.faUsersGear),a(4),E("(",o.guestForm.value.managers.length||0,")")}}function Re(t,m){t&1&&(i(0,"small",37),s(1,"At least one manager is required"),n())}function Ve(t,m){if(t&1){let o=V();i(0,"button",52),_("click",function(){P(o);let l=d();return L(l.confirmDeletion=!0)}),s(1," Remove "),n()}if(t&2){let o=d();c("disabled",o.confirmDeletion)}}var lt=(()=>{let m=class m{constructor(){this.guest=null,this.guestChange=new R,this.locale=T(ee),this.layout=T(fe),this.userService=T(_e),this.user=this.userService.user,this.icons={GROUPS:de.GROUPS,faPlus:le,faPen:se,faUsersGear:me,faSpinner:ae,faAddressCard:oe,faUsers:ne,faShieldHalved:re},this.allNotifications=Object.values(D),this.defaultPassword=this.layout.translateString(pe),this.languages=this.layout.getLanguages(!0),this.submitted=!1,this.loading=!1,this.confirmDeletion=!1}ngOnInit(){this.guestForm=new z({login:new g(this.guest?.login||"",[p.required,p.pattern(ce)]),email:new g(this.guest?.email||"",[p.required,p.maxLength(255),p.email]),firstName:new g(this.guest?.firstName||"",[p.required,p.maxLength(255)]),lastName:new g(this.guest?.lastName||"",p.maxLength(255)),password:new g(this.guest?this.defaultPassword:"",p.maxLength(255)),language:new g(this.guest?.language||null),notification:new g(this.guest?.notification||Object.values(D).indexOf(D.APPLICATION_EMAIL)),isActive:new g(this.guest?this.guest.isActive:!0),managers:new g(this.guest?.managers||[he(this.user)])})}updatePassword(r){this.guestForm.controls.password.setValue(r),this.guestForm.controls.password.markAsDirty()}updateManagers(r){this.guestForm.controls.managers.setValue(r),this.guestForm.controls.managers.markAsDirty(),this.guestForm.controls.managers.setErrors(r.length?null:{incorrect:!0})}searchMembers(r){let l={search:r,ignoreUserIds:this.guestForm.value.managers.map(e=>e.id),usersRole:ue.USER,onlyUsers:!0};return this.userService.searchMembers(l)}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){if(this.submitted=!0,this.confirmDeletion)this.userService.deleteGuest(this.guest.id).subscribe({next:()=>{this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest deleted",this.guest.login),this.layout.closeDialog()},error:r=>this.onError(r)});else if(!this.guest)this.userService.createGuest(this.makeDto(!0)).subscribe({next:r=>{this.guestChange.emit(["add",r]),this.layout.sendNotification("success","Guest created",this.guestForm.value.login),this.layout.closeDialog()},error:r=>this.onError(r)});else{let r=this.makeDto();if(!Object.keys(r).length){this.loading=!1,this.submitted=!1;return}this.userService.updateGuest(this.guest.id,r).subscribe({next:l=>{l?this.guestChange.emit(["update",l]):this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest updated",this.guestForm.value.login),this.layout.closeDialog()},error:l=>this.onError(l)})}}makeDto(r=!1){let l={};if(r)l=I({},this.guestForm.value);else for(let e in this.guestForm.controls)this.guestForm.controls[e].dirty&&(l[e]=this.guestForm.controls[e].value);for(let e in l)switch(e){case"language":l[e]=l[e]===ge?null:l[e];break;case"managers":l[e]=l[e].map(C=>C.id);break}return l}onError(r){this.layout.sendNotification("error","Guest error",this.guestForm.value.login,r),this.submitted=!1,this.confirmDeletion=!1}};m.\u0275fac=function(l){return new(l||m)},m.\u0275cmp=O({type:m,selectors:[["app-user-guest-dialog"]],inputs:{guest:"guest"},outputs:{guestChange:"guestChange"},decls:70,vars:40,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","login","l10nTranslate",""],["id","login","appAutofocus","","formControlName","login","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","email","l10nTranslate",""],["id","email","formControlName","email","autocomplete","off","type","email",1,"form-control","form-control-sm"],["for","firstName","l10nTranslate",""],["id","firstName","formControlName","firstName","autocomplete","off","type","text",1,"form-control","form-control-sm"],["for","lastName","l10nTranslate",""],["id","lastName","formControlName","lastName","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"position-absolute","pe-4",2,"right","50%","padding-top","6px",3,"passwordToCheck"],["id","password","placeholder","Set a password",3,"passwordChange","password","showGenerator","showLabel","isRequired"],["for","language","l10nTranslate",""],["id","language","formControlName","language",1,"form-control","form-select","form-select-sm"],[3,"ngValue"],[1,"d-flex","flex-column","col-6","pe-4"],["for","account","l10nTranslate",""],["id","account",1,"form-check","form-switch","form-check-inline"],["for","isActive",1,"form-check-label"],["formControlName","isActive","id","isActive","type","checkbox",1,"form-check-input"],["for","notification","l10nTranslate",""],["id","notification","formControlName","notification",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],["customClass","tab-dialog",3,"selectTab"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],["l10nTranslate","",1,"text-danger"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"me-2",3,"icon"],["l10nTranslate",""],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","access","l10nTranslate",""],["id","access",1,"text-align-end"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(l,e){l&1&&(i(0,"div",0)(1,"h4",1),f(2,we,3,2)(3,ye,3,1),f(4,Fe,1,1,"fa-icon",2),n(),f(5,Ge,3,0,"h4",3),i(6,"button",4),_("click",function(){return e.layout.closeDialog()}),n()(),i(7,"div",5)(8,"tabset",6),u(9,"hr",7),i(10,"tab",8),_("selectTab",function(){return e.tabView=null}),y(11,Ne,3,1,"ng-template",9),i(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),s(16,"Login"),n(),u(17,"input",14),n(),i(18,"div",15)(19,"label",16),s(20,"Email"),n(),u(21,"input",17),n()(),i(22,"div",11)(23,"div",12)(24,"label",18),s(25,"First name"),n(),u(26,"input",19),n(),i(27,"div",15)(28,"label",20),s(29,"Last name"),n(),u(30,"input",21),n()(),i(31,"div",11)(32,"div",12),f(33,Ue,1,1,"app-password-strength-bar",22),i(34,"app-input-password",23),_("passwordChange",function(w){return e.updatePassword(w)}),n()(),i(35,"div",15)(36,"label",24),s(37,"Language"),n(),i(38,"select",25),G(39,Ae,2,2,"option",26,F),n()()(),i(41,"div",11)(42,"div",27)(43,"label",28),s(44,"Account status"),n(),i(45,"div",29)(46,"label",30),u(47,"input",31),i(48,"span"),s(49),v(50,"translate"),v(51,"titlecase"),n()()()(),i(52,"div",15)(53,"label",32),s(54,"Notification"),n(),i(55,"select",33),G(56,ke,2,2,"option",34,F),n()()(),f(58,Le,13,4,"div",11),n()(),i(59,"tab",35),_("selectTab",function(){return e.tabView="managers"}),y(60,Oe,5,2,"ng-template",9),i(61,"div",7)(62,"app-user-search",36),_("membersChange",function(w){return e.updateManagers(w)}),n(),f(63,Re,2,0,"small",37),n()()()(),i(64,"div",38),f(65,Ve,2,1,"button",39),i(66,"button",40),_("click",function(){return e.onCancel()}),s(67,"Cancel"),n(),i(68,"button",41),_("click",function(){return e.onSubmit()}),s(69),n()()),l&2&&(a(2),h(e.guest?2:3),a(2),h(e.loading?4:-1),a(),h(e.guest?5:-1),a(),U(k("btn-close btn-close-white ",e.guest?"ms-2":"ms-auto"," ms-2")),a(),c("formGroup",e.guestForm),a(),c("justified",!0),a(9),b("is-invalid",e.guestForm.controls.login.invalid),c("autoSelect",!1),a(4),b("is-invalid",e.guestForm.controls.email.invalid),a(5),b("is-invalid",e.guestForm.controls.firstName.invalid),a(7),h(e.guestForm.value.password!==e.defaultPassword?33:-1),a(),c("password",e.guestForm.value.password)("showGenerator",!0)("showLabel",!0)("isRequired",!0),a(5),N(e.languages),a(9),b("text-danger",!e.guestForm.value.isActive),a(),E(" ",S(51,38,M(50,35,e.guestForm.value.isActive?"active":"suspended",e.locale.language))," "),a(7),N(e.allNotifications),a(2),h(e.guest?58:-1),a(4),c("members",e.guestForm.value.managers)("withPermissions",!1)("customPlaceholder","Type to search for managers to add")("searchFunction",e.searchMembers.bind(e)),a(),h(e.guestForm.value.managers.length?-1:63),a(2),h(e.guest!=null&&e.guest.id?65:-1),a(3),U(k("btn btn-sm ",e.confirmDeletion?"btn-danger":"btn-primary")),c("disabled",e.guestForm.invalid||e.submitted),a(),E(" ",e.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[j,ie,Z,Q,Y,H,q,K,X,$,W,J,Se,Te,Ee,De,ve,be,xe,Ce,te,B],encapsulation:2});let t=m;return t})();export{lt as a};
|
|
1
|
+
import{a as Ce,b as ve,c as be,d as xe,f as Ee,i as De}from"./chunk-VHYIXL7R.js";import{a as Se,b as Te}from"./chunk-FQ4AFNGE.js";import{f as _e}from"./chunk-MOVWEZ7J.js";import{K as ce,L as ue,R as D,Rb as he,ua as de,va as pe,wa as ge,wb as fe}from"./chunk-Y2CDUS4J.js";import{$c as q,Bf as re,Cb as _,Eb as d,Ed as te,Ee as oe,Fc as B,Fd as ie,Gf as le,Ma as a,Nb as b,Ob as U,Pb as s,Qb as x,Qf as me,Rb as E,Sb as A,Xa as O,Xb as k,Zc as j,ab as y,ad as H,bb as R,bf as ae,cd as p,dc as v,ec as S,ed as X,fc as M,fd as $,gd as z,ha as T,id as g,jb as f,kb as h,lb as F,ma as P,na as L,nb as G,nd as W,ob as N,od as J,of as se,pb as c,pd as K,pe as ne,qb as i,qd as Q,rb as n,rd as Y,sb as u,xd as Z,yd as ee,zb as V}from"./chunk-RSNLYAN6.js";import{a as I}from"./chunk-RTRJ3KFH.js";function we(t,m){if(t&1&&(u(0,"fa-icon",42),i(1,"span"),s(2),n()),t&2){let o=d();c("icon",o.icons.faPen),a(2),x(o.guest.fullName)}}function ye(t,m){if(t&1&&(u(0,"fa-icon",42),i(1,"span",43),s(2,"New guest"),n()),t&2){let o=d();c("icon",o.icons.faPlus)}}function Fe(t,m){if(t&1&&u(0,"fa-icon",2),t&2){let o=d();c("icon",o.icons.faSpinner)}}function Ge(t,m){t&1&&(i(0,"h4",3)(1,"span",43),s(2,"Edit guest"),n()())}function Ne(t,m){if(t&1&&(u(0,"fa-icon",44),i(1,"span",45),s(2,"Account"),n()),t&2){let o=d();c("icon",o.icons.faAddressCard)}}function Ue(t,m){if(t&1&&u(0,"app-password-strength-bar",22),t&2){let o=d();c("passwordToCheck",o.guestForm.value.password)}}function Ae(t,m){if(t&1&&(i(0,"option",26),s(1),n()),t&2){let o=m.$implicit;c("ngValue",o),a(),x(o)}}function ke(t,m){if(t&1&&(i(0,"option",34),s(1),n()),t&2){let o=m.$implicit,r=d();c("ngValue",r.allNotifications.indexOf(o)),a(),x(o)}}function Ie(t,m){if(t&1&&(i(0,"div"),s(1),v(2,"amDateFormat"),n(),i(3,"div"),s(4),v(5,"amDateFormat"),n()),t&2){let o=d(2);a(),A("",S(2,4,o.guest.currentAccess)," - ",o.guest.currentIp),a(3),A("",S(5,6,o.guest.lastAccess)," - ",o.guest.lastIp)}}function Pe(t,m){t&1&&(i(0,"span",37),s(1,"never"),n())}function Le(t,m){if(t&1&&(i(0,"div",11)(1,"div",12)(2,"label",46),s(3,"Creation date"),n(),i(4,"div",47),s(5),v(6,"amDateFormat"),n()(),i(7,"div",48)(8,"label",49),s(9,"Last accesses"),n(),i(10,"div",50),f(11,Ie,6,8)(12,Pe,2,0,"span",37),n()()()),t&2){let o=d();a(5),x(S(6,2,o.guest.createdAt)),a(6),h(o.guest.lastAccess?11:12)}}function Oe(t,m){if(t&1&&(u(0,"fa-icon",44),i(1,"span",51),s(2,"Managers"),n(),i(3,"span"),s(4),n()),t&2){let o=d();c("icon",o.icons.faUsersGear),a(4),E("(",o.guestForm.value.managers.length||0,")")}}function Re(t,m){t&1&&(i(0,"small",37),s(1,"At least one manager is required"),n())}function Ve(t,m){if(t&1){let o=V();i(0,"button",52),_("click",function(){P(o);let l=d();return L(l.confirmDeletion=!0)}),s(1," Remove "),n()}if(t&2){let o=d();c("disabled",o.confirmDeletion)}}var lt=(()=>{let m=class m{constructor(){this.guest=null,this.guestChange=new R,this.locale=T(ee),this.layout=T(fe),this.userService=T(_e),this.user=this.userService.user,this.icons={GROUPS:de.GROUPS,faPlus:le,faPen:se,faUsersGear:me,faSpinner:ae,faAddressCard:oe,faUsers:ne,faShieldHalved:re},this.allNotifications=Object.values(D),this.defaultPassword=this.layout.translateString(pe),this.languages=this.layout.getLanguages(!0),this.submitted=!1,this.loading=!1,this.confirmDeletion=!1}ngOnInit(){this.guestForm=new z({login:new g(this.guest?.login||"",[p.required,p.pattern(ce)]),email:new g(this.guest?.email||"",[p.required,p.maxLength(255),p.email]),firstName:new g(this.guest?.firstName||"",[p.required,p.maxLength(255)]),lastName:new g(this.guest?.lastName||"",p.maxLength(255)),password:new g(this.guest?this.defaultPassword:"",p.maxLength(255)),language:new g(this.guest?.language||null),notification:new g(this.guest?.notification||Object.values(D).indexOf(D.APPLICATION_EMAIL)),isActive:new g(this.guest?this.guest.isActive:!0),managers:new g(this.guest?.managers||[he(this.user)])})}updatePassword(r){this.guestForm.controls.password.setValue(r),this.guestForm.controls.password.markAsDirty()}updateManagers(r){this.guestForm.controls.managers.setValue(r),this.guestForm.controls.managers.markAsDirty(),this.guestForm.controls.managers.setErrors(r.length?null:{incorrect:!0})}searchMembers(r){let l={search:r,ignoreUserIds:this.guestForm.value.managers.map(e=>e.id),usersRole:ue.USER,onlyUsers:!0};return this.userService.searchMembers(l)}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){if(this.submitted=!0,this.confirmDeletion)this.userService.deleteGuest(this.guest.id).subscribe({next:()=>{this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest deleted",this.guest.login),this.layout.closeDialog()},error:r=>this.onError(r)});else if(!this.guest)this.userService.createGuest(this.makeDto(!0)).subscribe({next:r=>{this.guestChange.emit(["add",r]),this.layout.sendNotification("success","Guest created",this.guestForm.value.login),this.layout.closeDialog()},error:r=>this.onError(r)});else{let r=this.makeDto();if(!Object.keys(r).length){this.loading=!1,this.submitted=!1;return}this.userService.updateGuest(this.guest.id,r).subscribe({next:l=>{l?this.guestChange.emit(["update",l]):this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest updated",this.guestForm.value.login),this.layout.closeDialog()},error:l=>this.onError(l)})}}makeDto(r=!1){let l={};if(r)l=I({},this.guestForm.value);else for(let e in this.guestForm.controls)this.guestForm.controls[e].dirty&&(l[e]=this.guestForm.controls[e].value);for(let e in l)switch(e){case"language":l[e]=l[e]===ge?null:l[e];break;case"managers":l[e]=l[e].map(C=>C.id);break}return l}onError(r){this.layout.sendNotification("error","Guest error",this.guestForm.value.login,r),this.submitted=!1,this.confirmDeletion=!1}};m.\u0275fac=function(l){return new(l||m)},m.\u0275cmp=O({type:m,selectors:[["app-user-guest-dialog"]],inputs:{guest:"guest"},outputs:{guestChange:"guestChange"},decls:70,vars:40,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","login","l10nTranslate",""],["id","login","appAutofocus","","formControlName","login","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","email","l10nTranslate",""],["id","email","formControlName","email","autocomplete","off","type","email",1,"form-control","form-control-sm"],["for","firstName","l10nTranslate",""],["id","firstName","formControlName","firstName","autocomplete","off","type","text",1,"form-control","form-control-sm"],["for","lastName","l10nTranslate",""],["id","lastName","formControlName","lastName","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"position-absolute","pe-4",2,"right","50%","padding-top","6px",3,"passwordToCheck"],["id","password","placeholder","Set a password",3,"passwordChange","password","showGenerator","showLabel","isRequired"],["for","language","l10nTranslate",""],["id","language","formControlName","language",1,"form-control","form-select","form-select-sm"],[3,"ngValue"],[1,"d-flex","flex-column","col-6","pe-4"],["for","account","l10nTranslate",""],["id","account",1,"form-check","form-switch","form-check-inline"],["for","isActive",1,"form-check-label"],["formControlName","isActive","id","isActive","type","checkbox",1,"form-check-input"],["for","notification","l10nTranslate",""],["id","notification","formControlName","notification",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],["customClass","tab-dialog",3,"selectTab"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],["l10nTranslate","",1,"text-danger"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"me-2",3,"icon"],["l10nTranslate",""],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","access","l10nTranslate",""],["id","access",1,"text-align-end"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(l,e){l&1&&(i(0,"div",0)(1,"h4",1),f(2,we,3,2)(3,ye,3,1),f(4,Fe,1,1,"fa-icon",2),n(),f(5,Ge,3,0,"h4",3),i(6,"button",4),_("click",function(){return e.layout.closeDialog()}),n()(),i(7,"div",5)(8,"tabset",6),u(9,"hr",7),i(10,"tab",8),_("selectTab",function(){return e.tabView=null}),y(11,Ne,3,1,"ng-template",9),i(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),s(16,"Login"),n(),u(17,"input",14),n(),i(18,"div",15)(19,"label",16),s(20,"Email"),n(),u(21,"input",17),n()(),i(22,"div",11)(23,"div",12)(24,"label",18),s(25,"First name"),n(),u(26,"input",19),n(),i(27,"div",15)(28,"label",20),s(29,"Last name"),n(),u(30,"input",21),n()(),i(31,"div",11)(32,"div",12),f(33,Ue,1,1,"app-password-strength-bar",22),i(34,"app-input-password",23),_("passwordChange",function(w){return e.updatePassword(w)}),n()(),i(35,"div",15)(36,"label",24),s(37,"Language"),n(),i(38,"select",25),G(39,Ae,2,2,"option",26,F),n()()(),i(41,"div",11)(42,"div",27)(43,"label",28),s(44,"Account status"),n(),i(45,"div",29)(46,"label",30),u(47,"input",31),i(48,"span"),s(49),v(50,"translate"),v(51,"titlecase"),n()()()(),i(52,"div",15)(53,"label",32),s(54,"Notification"),n(),i(55,"select",33),G(56,ke,2,2,"option",34,F),n()()(),f(58,Le,13,4,"div",11),n()(),i(59,"tab",35),_("selectTab",function(){return e.tabView="managers"}),y(60,Oe,5,2,"ng-template",9),i(61,"div",7)(62,"app-user-search",36),_("membersChange",function(w){return e.updateManagers(w)}),n(),f(63,Re,2,0,"small",37),n()()()(),i(64,"div",38),f(65,Ve,2,1,"button",39),i(66,"button",40),_("click",function(){return e.onCancel()}),s(67,"Cancel"),n(),i(68,"button",41),_("click",function(){return e.onSubmit()}),s(69),n()()),l&2&&(a(2),h(e.guest?2:3),a(2),h(e.loading?4:-1),a(),h(e.guest?5:-1),a(),U(k("btn-close btn-close-white ",e.guest?"ms-2":"ms-auto"," ms-2")),a(),c("formGroup",e.guestForm),a(),c("justified",!0),a(9),b("is-invalid",e.guestForm.controls.login.invalid),c("autoSelect",!1),a(4),b("is-invalid",e.guestForm.controls.email.invalid),a(5),b("is-invalid",e.guestForm.controls.firstName.invalid),a(7),h(e.guestForm.value.password!==e.defaultPassword?33:-1),a(),c("password",e.guestForm.value.password)("showGenerator",!0)("showLabel",!0)("isRequired",!0),a(5),N(e.languages),a(9),b("text-danger",!e.guestForm.value.isActive),a(),E(" ",S(51,38,M(50,35,e.guestForm.value.isActive?"active":"suspended",e.locale.language))," "),a(7),N(e.allNotifications),a(2),h(e.guest?58:-1),a(4),c("members",e.guestForm.value.managers)("withPermissions",!1)("customPlaceholder","Type to search for managers to add")("searchFunction",e.searchMembers.bind(e)),a(),h(e.guestForm.value.managers.length?-1:63),a(2),h(e.guest!=null&&e.guest.id?65:-1),a(3),U(k("btn btn-sm ",e.confirmDeletion?"btn-danger":"btn-primary")),c("disabled",e.guestForm.invalid||e.submitted),a(),E(" ",e.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[j,ie,Z,Q,Y,H,q,K,X,$,W,J,Se,Te,Ee,De,ve,be,xe,Ce,te,B],encapsulation:2});let t=m;return t})();export{lt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as Ct,B as he,Ea as _e,Gb as ke,Hb as Y,Ja as be,Q as le,Qa as Ee,Qb as T,S as fe,T as Rt,W as $,Y as pe,Z as de,_ as me,aa as O,ba as ge,ca as ye,da as P,fb as Se,ib as D,jb as ve,kb as ft,wb as pt}from"./chunk-WL65GYD5.js";import{Cb as ct,G as zt,Hb as oe,Jb as ae,Kb as ce,L as Zt,Nb as Tt,Oc as ut,Qa as re,Ra as L,W as te,Ya as nt,Za as ot,Zb as ht,_c as lt,ba as H,c as Xt,ca as st,da as rt,fa as ee,ha as b,hb as ne,ib as at,nf as ue,qc as Ot,v as d,va as ie,ya as se}from"./chunk-RSNLYAN6.js";import{a as it,b as jt,c as Qt,e as Jt}from"./chunk-RTRJ3KFH.js";var we={NAME_SPACE:"/",EVENTS:{NOTIFICATION:"notification"}};var W={NAME_SPACE:"/",EVENTS:{ONLINE_STATUS:"onlineStatus",ONLINE_USERS:"onlineUsers",ONLINE_USER:"onlineUser"}};var Wt={};Jt(Wt,{Fetch:()=>X,Manager:()=>N,NodeWebSocket:()=>w,NodeXHR:()=>k,Socket:()=>C,WebSocket:()=>w,WebTransport:()=>R,XHR:()=>k,connect:()=>B,default:()=>B,io:()=>B,protocol:()=>$t});var _=Object.create(null);_.open="0";_.close="1";_.ping="2";_.pong="3";_.message="4";_.upgrade="5";_.noop="6";var G=Object.create(null);Object.keys(_).forEach(s=>{G[_[s]]=s});var K={type:"error",data:"parser error"};var Oe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Re=typeof ArrayBuffer=="function",Ce=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,j=({type:s,data:t},i,e)=>Oe&&t instanceof Blob?i?e(t):Ae(t,e):Re&&(t instanceof ArrayBuffer||Ce(t))?i?e(t):Ae(new Blob([t]),e):e(_[s]+(t||"")),Ae=(s,t)=>{let i=new FileReader;return i.onload=function(){let e=i.result.split(",")[1];t("b"+(e||""))},i.readAsDataURL(s)};function Te(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var xt;function xe(s,t){if(Oe&&s.data instanceof Blob)return s.data.arrayBuffer().then(Te).then(t);if(Re&&(s.data instanceof ArrayBuffer||Ce(s.data)))return t(Te(s.data));j(s,!1,i=>{xt||(xt=new TextEncoder),t(xt.encode(i))})}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<Ne.length;s++)Q[Ne.charCodeAt(s)]=s;var Be=s=>{let t=s.length*.75,i=s.length,e,r=0,n,o,a,c;s[s.length-1]==="="&&(t--,s[s.length-2]==="="&&t--);let p=new ArrayBuffer(t),g=new Uint8Array(p);for(e=0;e<i;e+=4)n=Q[s.charCodeAt(e)],o=Q[s.charCodeAt(e+1)],a=Q[s.charCodeAt(e+2)],c=Q[s.charCodeAt(e+3)],g[r++]=n<<2|o>>4,g[r++]=(o&15)<<4|a>>2,g[r++]=(a&3)<<6|c&63;return p};var ni=typeof ArrayBuffer=="function",J=(s,t)=>{if(typeof s!="string")return{type:"message",data:Ie(s,t)};let i=s.charAt(0);return i==="b"?{type:"message",data:oi(s.substring(1),t)}:G[i]?s.length>1?{type:G[i],data:s.substring(1)}:{type:G[i]}:K},oi=(s,t)=>{if(ni){let i=Be(s);return Ie(i,t)}else return{base64:!0,data:s}},Ie=(s,t)=>{switch(t){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}};var Le="",Pe=(s,t)=>{let i=s.length,e=new Array(i),r=0;s.forEach((n,o)=>{j(n,!1,a=>{e[o]=a,++r===i&&t(e.join(Le))})})},De=(s,t)=>{let i=s.split(Le),e=[];for(let r=0;r<i.length;r++){let n=J(i[r],t);if(e.push(n),n.type==="error")break}return e};function Ue(){return new TransformStream({transform(s,t){xe(s,i=>{let e=i.length,r;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);let n=new DataView(r.buffer);n.setUint8(0,126),n.setUint16(1,e)}else{r=new Uint8Array(9);let n=new DataView(r.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(e))}s.data&&typeof s.data!="string"&&(r[0]|=128),t.enqueue(r),t.enqueue(i)})}})}var Nt;function dt(s){return s.reduce((t,i)=>t+i.length,0)}function mt(s,t){if(s[0].length===t)return s.shift();let i=new Uint8Array(t),e=0;for(let r=0;r<t;r++)i[r]=s[0][e++],e===s[0].length&&(s.shift(),e=0);return s.length&&e<s[0].length&&(s[0]=s[0].slice(e)),i}function Fe(s,t){Nt||(Nt=new TextDecoder);let i=[],e=0,r=-1,n=!1;return new TransformStream({transform(o,a){for(i.push(o);;){if(e===0){if(dt(i)<1)break;let c=mt(i,1);n=(c[0]&128)===128,r=c[0]&127,r<126?e=3:r===126?e=1:e=2}else if(e===1){if(dt(i)<2)break;let c=mt(i,2);r=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),e=3}else if(e===2){if(dt(i)<8)break;let c=mt(i,8),p=new DataView(c.buffer,c.byteOffset,c.length),g=p.getUint32(0);if(g>Math.pow(2,21)-1){a.enqueue(K);break}r=g*Math.pow(2,32)+p.getUint32(4),e=3}else{if(dt(i)<r)break;let c=mt(i,r);a.enqueue(J(n?c:Nt.decode(c),t)),e=0}if(r===0||r>s){a.enqueue(K);break}}}})}var Bt=4;function u(s){if(s)return ai(s)}function ai(s){for(var t in u.prototype)s[t]=u.prototype[t];return s}u.prototype.on=u.prototype.addEventListener=function(s,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(t),this};u.prototype.once=function(s,t){function i(){this.off(s,i),t.apply(this,arguments)}return i.fn=t,this.on(s,i),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(s,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+s];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var e,r=0;r<i.length;r++)if(e=i[r],e===t||e.fn===t){i.splice(r,1);break}return i.length===0&&delete this._callbacks["$"+s],this};u.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),i=this._callbacks["$"+s],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(i){i=i.slice(0);for(var e=0,r=i.length;e<r;++e)i[e].apply(this,t)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};u.prototype.hasListeners=function(s){return!!this.listeners(s).length};var E=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,i)=>i(t,0),l=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Me="arraybuffer";function gt(s,...t){return t.reduce((i,e)=>(s.hasOwnProperty(e)&&(i[e]=s[e]),i),{})}var ci=l.setTimeout,hi=l.clearTimeout;function S(s,t){t.useNativeTimers?(s.setTimeoutFn=ci.bind(l),s.clearTimeoutFn=hi.bind(l)):(s.setTimeoutFn=l.setTimeout.bind(l),s.clearTimeoutFn=l.clearTimeout.bind(l))}var ui=1.33;function Ve(s){return typeof s=="string"?li(s):Math.ceil((s.byteLength||s.size)*ui)}function li(s){let t=0,i=0;for(let e=0,r=s.length;e<r;e++)t=s.charCodeAt(e),t<128?i+=1:t<2048?i+=2:t<55296||t>=57344?i+=3:(e++,i+=4);return i}function yt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function qe(s){let t="";for(let i in s)s.hasOwnProperty(i)&&(t.length&&(t+="&"),t+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return t}function He(s){let t={},i=s.split("&");for(let e=0,r=i.length;e<r;e++){let n=i[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}var _t=class extends Error{constructor(t,i,e){super(t),this.description=i,this.context=e,this.type="TransportError"}},v=class extends u{constructor(t){super(),this.writable=!1,S(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,i,e){return super.emitReserved("error",new _t(t,i,e)),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 i=J(t,this.socket.binaryType);this.onPacket(i)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,i={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){let i=qe(t);return i.length?"?"+i:""}};var U=class extends v{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let i=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let i=e=>{if(this.readyState==="opening"&&e.type==="open"&&this.onOpen(),e.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};De(t,this.socket.binaryType).forEach(i),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,Pe(t,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=yt()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(t,i)}};var $e=!1;try{$e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Ye=$e;function fi(){}var It=class extends U{constructor(t){if(super(t),typeof location<"u"){let i=location.protocol==="https:",e=location.port;e||(e=i?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||e!==t.port}}doWrite(t,i){let e=this.request({method:"POST",data:t});e.on("success",i),e.on("error",(r,n)=>{this.onError("xhr post error",r,n)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(i,e)=>{this.onError("xhr poll error",i,e)}),this.pollXhr=t}},bt=(()=>{class s extends u{constructor(i,e,r){super(),this.createRequest=i,S(this,r),this._opts=r,this._method=r.method||"GET",this._uri=e,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var i;let e=gt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(e);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var n;r.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=fi,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.requests[this._index],this._xhr=null}}_onLoad(){let i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return s.requestsCount=0,s.requests={},s})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",We);else if(typeof addEventListener=="function"){let s="onpagehide"in l?"pagehide":"unload";addEventListener(s,We,!1)}}function We(){for(let s in bt.requests)bt.requests.hasOwnProperty(s)&&bt.requests[s].abort()}var pi=(function(){let s=Ge({xdomain:!1});return s&&s.responseType!==null})(),k=class extends It{constructor(t){super(t);let i=t&&t.forceBase64;this.supportsBinary=pi&&!i}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new bt(Ge,this.uri(),t)}};function Ge(s){let t=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ye))return new XMLHttpRequest}catch{}if(!t)try{return new l[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Ke=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Pt=class extends v{get name(){return"websocket"}doOpen(){let t=this.uri(),i=this.opts.protocols,e=Ke?{}:gt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(e.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,i,e)}catch(r){return this.emitReserved("error",r)}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 i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;j(e,this.supportsBinary,n=>{try{this.doWrite(e,n)}catch{}r&&E(()=>{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",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=yt()),this.supportsBinary||(i.b64=1),this.createUri(t,i)}},Lt=l.WebSocket||l.MozWebSocket,w=class extends Pt{createSocket(t,i,e){return Ke?new Lt(t,i,e):i?new Lt(t,i):new Lt(t)}doWrite(t,i){this.ws.send(i)}};var R=class extends v{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 i=Fe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=t.readable.pipeThrough(i).getReader(),r=Ue();r.readable.pipeTo(t.writable),this._writer=r.writable.getWriter();let n=()=>{e.read().then(({done:a,value:c})=>{a||(this.onPacket(c),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 i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;this._writer.write(e).then(()=>{r&&E(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}};var Dt={websocket:w,webtransport:R,polling:k};var di=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function F(s){if(s.length>8e3)throw"URI too long";let t=s,i=s.indexOf("["),e=s.indexOf("]");i!=-1&&e!=-1&&(s=s.substring(0,i)+s.substring(i,e).replace(/:/g,";")+s.substring(e,s.length));let r=di.exec(s||""),n={},o=14;for(;o--;)n[mi[o]]=r[o]||"";return i!=-1&&e!=-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=gi(n,n.path),n.queryKey=yi(n,n.query),n}function gi(s,t){let i=/\/{2,9}/g,e=t.replace(i,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&e.splice(0,1),t.slice(-1)=="/"&&e.splice(e.length-1,1),e}function yi(s,t){let i={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,r,n){r&&(i[r]=n)}),i}var Ut=typeof addEventListener=="function"&&typeof removeEventListener=="function",Et=[];Ut&&addEventListener("offline",()=>{Et.forEach(s=>s())},!1);var St=(()=>{class s extends u{constructor(i,e){if(super(),this.binaryType=Me,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(e=i,i=null),i){let r=F(i);e.hostname=r.host,e.secure=r.protocol==="https"||r.protocol==="wss",e.port=r.port,r.query&&(e.query=r.query)}else e.host&&(e.hostname=F(e.host).host);S(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(r=>{let n=r.prototype.name;this.transports.push(n),this._transportsByName[n]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=He(this.opts.query)),Ut&&(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"})},Et.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){let e=Object.assign({},this.opts.query);e.EIO=Bt,e.transport=i,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let i=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let e=this.createTransport(i);e.open(),this.setTransport(e)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",s.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let e=new Error("server error");e.code=i.data,this._onError(e);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),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 i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let r=0;r<this.writeBuffer.length;r++){let n=this.writeBuffer[r].data;if(n&&(e+=Ve(n)),r>0&&e>this._maxPayload)return this.writeBuffer.slice(0,r);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,E(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,e,r){return this._sendPacket("message",i,e,r),this}send(i,e,r){return this._sendPacket("message",i,e,r),this}_sendPacket(i,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;let o={type:i,data:e,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let i=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),i()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():i()}):this.upgrading?r():i()),this}_onError(i){if(s.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,e){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(),Ut&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let r=Et.indexOf(this._offlineEventListener);r!==-1&&Et.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,e),this.writeBuffer=[],this._prevBufferLen=0}}}return s.protocol=Bt,s})(),vt=class extends St{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 i=this.createTransport(t),e=!1;St.priorWebsocketSuccess=!1;let r=()=>{e||(i.send([{type:"ping",data:"probe"}]),i.once("packet",A=>{if(!e)if(A.type==="pong"&&A.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;St.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{e||this.readyState!=="closed"&&(g(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let q=new Error("probe error");q.transport=i.name,this.emitReserved("upgradeError",q)}}))};function n(){e||(e=!0,g(),i.close(),i=null)}let o=A=>{let q=new Error("probe error: "+A);q.transport=i.name,n(),this.emitReserved("upgradeError",q)};function a(){o("transport closed")}function c(){o("socket closed")}function p(A){i&&A.name!==i.name&&n()}let g=()=>{i.removeListener("open",r),i.removeListener("error",o),i.removeListener("close",a),this.off("close",c),this.off("upgrading",p)};i.once("open",r),i.once("error",o),i.once("close",a),this.once("close",c),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{e||i.open()},200):i.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let i=[];for(let e=0;e<t.length;e++)~this.transports.indexOf(t[e])&&i.push(t[e]);return i}},M=class extends vt{constructor(t,i={}){let e=typeof t=="object"?t:i;(!e.transports||e.transports&&typeof e.transports[0]=="string")&&(e.transports=(e.transports||["polling","websocket","webtransport"]).map(r=>Dt[r]).filter(r=>!!r)),super(t,e)}};var X=class extends U{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(i=>this.onData(i))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,i){this._fetch(t).then(e=>{if(!e.ok)return this.onError("fetch write error",e.status,e);i()}).catch(e=>{this.onError("fetch write error",e)})}_fetch(t){var i;let e=t!==void 0,r=new Headers(this.opts.extraHeaders);return e&&r.set("content-type","text/plain;charset=UTF-8"),(i=this.socket._cookieJar)===null||i===void 0||i.appendCookies(r),fetch(this.uri(),{method:e?"POST":"GET",body:e?t:null,headers:r,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 Ps=M.protocol;function je(s,t="",i){let e=s;i=i||typeof location<"u"&&location,s==null&&(s=i.protocol+"//"+i.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=i.protocol+s:s=i.host+s),/^(https?|wss?):\/\//.test(s)||(typeof i<"u"?s=i.protocol+"//"+s:s="https://"+s),e=F(s)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";let n=e.host.indexOf(":")!==-1?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+t,e.href=e.protocol+"://"+n+(i&&i.port===e.port?"":":"+e.port),e}var Yt={};Jt(Yt,{Decoder:()=>qt,Encoder:()=>Vt,PacketType:()=>h,protocol:()=>$t});var _i=typeof ArrayBuffer=="function",bi=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Qe=Object.prototype.toString,Ei=typeof Blob=="function"||typeof Blob<"u"&&Qe.call(Blob)==="[object BlobConstructor]",Si=typeof File=="function"||typeof File<"u"&&Qe.call(File)==="[object FileConstructor]";function Z(s){return _i&&(s instanceof ArrayBuffer||bi(s))||Ei&&s instanceof Blob||Si&&s instanceof File}function z(s,t){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let i=0,e=s.length;i<e;i++)if(z(s[i]))return!0;return!1}if(Z(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return z(s.toJSON(),!0);for(let i in s)if(Object.prototype.hasOwnProperty.call(s,i)&&z(s[i]))return!0;return!1}function Je(s){let t=[],i=s.data,e=s;return e.data=Ft(i,t),e.attachments=t.length,{packet:e,buffers:t}}function Ft(s,t){if(!s)return s;if(Z(s)){let i={_placeholder:!0,num:t.length};return t.push(s),i}else if(Array.isArray(s)){let i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=Ft(s[e],t);return i}else if(typeof s=="object"&&!(s instanceof Date)){let i={};for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(i[e]=Ft(s[e],t));return i}return s}function Xe(s,t){return s.data=Mt(s.data,t),delete s.attachments,s}function Mt(s,t){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<t.length)return t[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]=Mt(s[i],t);else if(typeof s=="object")for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(s[i]=Mt(s[i],t));return s}var vi=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],$t=5,h=(function(s){return s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK",s})(h||{}),Vt=class{constructor(t){this.replacer=t}encode(t){return(t.type===h.EVENT||t.type===h.ACK)&&z(t)?this.encodeAsBinary({type:t.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let i=""+t.type;return(t.type===h.BINARY_EVENT||t.type===h.BINARY_ACK)&&(i+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(i+=t.nsp+","),t.id!=null&&(i+=t.id),t.data!=null&&(i+=JSON.stringify(t.data,this.replacer)),i}encodeAsBinary(t){let i=Je(t),e=this.encodeAsString(i.packet),r=i.buffers;return r.unshift(e),r}};function ze(s){return Object.prototype.toString.call(s)==="[object Object]"}var qt=class s extends u{constructor(t){super(),this.reviver=t}add(t){let i;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(t);let e=i.type===h.BINARY_EVENT;e||i.type===h.BINARY_ACK?(i.type=e?h.EVENT:h.ACK,this.reconstructor=new Ht(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Z(t)||t.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(t),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let i=0,e={type:Number(t.charAt(0))};if(h[e.type]===void 0)throw new Error("unknown packet type "+e.type);if(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK){let n=i+1;for(;t.charAt(++i)!=="-"&&i!=t.length;);let o=t.substring(n,i);if(o!=Number(o)||t.charAt(i)!=="-")throw new Error("Illegal attachments");e.attachments=Number(o)}if(t.charAt(i+1)==="/"){let n=i+1;for(;++i&&!(t.charAt(i)===","||i===t.length););e.nsp=t.substring(n,i)}else e.nsp="/";let r=t.charAt(i+1);if(r!==""&&Number(r)==r){let n=i+1;for(;++i;){let o=t.charAt(i);if(o==null||Number(o)!=o){--i;break}if(i===t.length)break}e.id=Number(t.substring(n,i+1))}if(t.charAt(++i)){let n=this.tryParse(t.substr(i));if(s.isPayloadValid(e.type,n))e.data=n;else throw new Error("invalid payload")}return e}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,i){switch(t){case h.CONNECT:return ze(i);case h.DISCONNECT:return i===void 0;case h.CONNECT_ERROR:return typeof i=="string"||ze(i);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&vi.indexOf(i[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Ht=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 i=Xe(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function m(s,t,i){return s.on(t,i),function(){s.off(t,i)}}var ki=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),C=class extends u{constructor(t,i,e){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=i,e&&e.auth&&(this.auth=e.auth),this._opts=Object.assign({},e),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[m(t,"open",this.onopen.bind(this)),m(t,"packet",this.onpacket.bind(this)),m(t,"error",this.onerror.bind(this)),m(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,...i){var e,r,n;if(ki.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(i.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:h.EVENT,data:i};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){let g=this.ids++,A=i.pop();this._registerAckCallback(g,A),o.id=g}let a=(r=(e=this.io.engine)===null||e===void 0?void 0:e.transport)===null||r===void 0?void 0:r.writable,c=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,i){var e;let r=(e=this.flags.timeout)!==null&&e!==void 0?e:this._opts.ackTimeout;if(r===void 0){this.acks[t]=i;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);i.call(this,new Error("operation has timed out"))},r),o=(...a)=>{this.io.clearTimeoutFn(n),i.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...i){return new Promise((e,r)=>{let n=(o,a)=>o?r(o):e(a);n.withError=!0,i.push(n),this.emit(t,...i)})}_addToQueue(t){let i;typeof t[t.length-1]=="function"&&(i=t.pop());let e={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((r,...n)=>e!==this._queue[0]?void 0:(r!==null?e.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(r)):(this._queue.shift(),i&&i(null,...n)),e.pending=!1,this._drainQueue())),this._queue.push(e),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;let i=this._queue[0];i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.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:h.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,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(e=>String(e.id)===t)){let e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case h.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 h.EVENT:case h.BINARY_EVENT:this.onevent(t);break;case h.ACK:case h.BINARY_ACK:this.onack(t);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e);break}}onevent(t){let i=t.data||[];t.id!=null&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let i=this._anyListeners.slice();for(let e of i)e.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 i=this,e=!1;return function(...r){e||(e=!0,i.packet({type:h.ACK,id:t,data:r}))}}onack(t){let i=this.acks[t.id];typeof i=="function"&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))}onconnect(t,i){this.id=t,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}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:h.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 i=this._anyListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,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 i=this._anyOutgoingListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let e of i)e.apply(this,t.data)}}};function x(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}x.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*s);s=(Math.floor(t*10)&1)==0?s-i:s+i}return Math.min(s,this.max)|0};x.prototype.reset=function(){this.attempts=0};x.prototype.setMin=function(s){this.ms=s};x.prototype.setMax=function(s){this.max=s};x.prototype.setJitter=function(s){this.jitter=s};var N=class extends u{constructor(t,i){var e;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(i=t,t=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,S(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((e=i.randomizationFactor)!==null&&e!==void 0?e:.5),this.backoff=new x({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=t;let r=i.parser||Yt;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=i.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 i;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(i=this.backoff)===null||i===void 0||i.setMin(t),this)}randomizationFactor(t){var i;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(i=this.backoff)===null||i===void 0||i.setJitter(t),this)}reconnectionDelayMax(t){var i;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(i=this.backoff)===null||i===void 0||i.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 M(this.uri,this.opts);let i=this.engine,e=this;this._readyState="opening",this.skipReconnect=!1;let r=m(i,"open",function(){e.onopen(),t&&t()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=m(i,"error",n);if(this._timeout!==!1){let a=this._timeout,c=this.setTimeoutFn(()=>{r(),n(new Error("timeout")),i.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(r),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(m(t,"ping",this.onping.bind(this)),m(t,"data",this.ondata.bind(this)),m(t,"error",this.onerror.bind(this)),m(t,"close",this.onclose.bind(this)),m(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(i){this.onclose("parse error",i)}}ondecoded(t){E(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,i){let e=this.nsps[t];return e?this._autoConnect&&!e.active&&e.connect():(e=new C(this,t,i),this.nsps[t]=e),e}_destroy(t){let i=Object.keys(this.nsps);for(let e of i)if(this.nsps[e].active)return;this._close()}_packet(t){let i=this.encoder.encode(t);for(let e=0;e<i.length;e++)this.engine.write(i[e],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,i){var e;this.cleanup(),(e=this.engine)===null||e===void 0||e.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,i),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 i=this.backoff.duration();this._reconnecting=!0;let e=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(r=>{r?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",r)):t.onreconnect()}))},i);this.opts.autoUnref&&e.unref(),this.subs.push(()=>{this.clearTimeoutFn(e)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};var tt={};function B(s,t){typeof s=="object"&&(t=s,s=void 0),t=t||{};let i=je(s,t.path||"/socket.io"),e=i.source,r=i.id,n=i.path,o=tt[r]&&n in tt[r].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o,c;return a?c=new N(e,t):(tt[r]||(tt[r]=new N(e,t)),c=tt[r]),i.query&&!t.query&&(t.query=i.queryKey),c.socket(i.path,t)}Object.assign(B,{Manager:N,Socket:C,io:B,connect:B});var V=class s{config;appRef;subscribersCounter={};eventObservables$={};namespaces={};ioSocket;emptyConfig={url:"",options:{}};constructor(t,i){this.config=t,this.appRef=i,t===void 0&&(t=this.emptyConfig);let e=t.url,r=t.options,n=B?B:Wt;this.ioSocket=n(e,r)}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 i=this.namespaces[t];if(i)return i;let a=this.config,{url:e}=a,r=Qt(a,["url"]),n=it({url:!e.endsWith("/")&&!t.startsWith("/")?`${e}/${t}`:`${e}${t}`},r),o=new s(n,this.appRef);return this.namespaces[t]=o,o}on(t,i){return this.ioSocket.on(t,i),this}once(t,i){return this.ioSocket.once(t,i),this}connect(){return this.ioSocket.connect(),this}disconnect(){return this.ioSocket.disconnect(),this}emit(t,...i){return this.ioSocket.emit(t,...i),this}send(...t){return this.ioSocket.send.apply(this.ioSocket,arguments),this}emitWithAck(t,...i){return this.ioSocket.emitWithAck(t,...i)}removeListener(t,i){return this.ioSocket.removeListener(t,i),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 Xt(i=>{let e=r=>{i.next(r),this.appRef.tick()};return this.ioSocket.on(t,e),()=>{this.subscribersCounter[t]--,this.subscribersCounter[t]===0&&(this.ioSocket.removeListener(t,e),delete this.eventObservables$[t])}}).pipe(te())),this.eventObservables$[t]}fromOneTimeEvent(t){return new Promise(i=>this.once(t,i))}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,i){return this.ioSocket.off(t,i),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 wi(s,t){return new V(s,t)}var Ze=new ee("__SOCKET_IO_CONFIG__"),Ar=(()=>{class s{static forRoot(i){return{ngModule:s,providers:[{provide:Ze,useValue:i},{provide:V,useFactory:wi,deps:[Ze,ne]}]}}static \u0275fac=function(e){return new(e||s)};static \u0275mod=nt({type:s});static \u0275inj=rt({})}return s})();var Kt={BASE:`${fe}/notifications`,UNREAD:"unread"},kt=Kt.BASE;var f=(function(s){return s.ADD="add",s.UPDATE="update",s.DELETE="delete",s.DELETE_PERMANENTLY="deletePermanently",s})(f||{});var y=(function(s){return s.COMMENTS="comments",s.SPACES="spaces",s.SPACE_ROOTS="spaces_roots",s.SHARES="shares",s.LINKS="links",s.SYNC="sync",s})(y||{}),Br={COMMENTS:"commented",SPACES:{[f.ADD]:"You now have access to the space",[f.DELETE]:"You no longer have access to the space",[f.DELETE_PERMANENTLY]:"This space has been permanently deleted"},SPACE_ROOTS:{[f.ADD]:"anchored",[f.DELETE]:"unanchored"},SHARES:{[f.ADD]:"shared with you",[f.DELETE]:"no longer share with you"},SHARES_WITHOUT_OWNER:{[f.ADD]:"You now have access to the share",[f.DELETE]:"You no longer have access to the share",[f.DELETE_PERMANENTLY]:"You are no longer a member of the parent share, your child share has been deleted"},LINKS:{[f.ADD]:"shared with you",[f.UPDATE]:"You now have access to the space"},SYNC:{[f.DELETE]:"You are no longer synchronizing"}};var ti=ue;var ei={[y.COMMENTS]:ti,[y.SPACES]:Y.SPACES,[y.SPACE_ROOTS]:Y.SPACES,[y.SHARES]:Y.SHARES,[y.LINKS]:Y.LINKS,[y.SYNC]:Se.SYNC};var wt=class{constructor(t){this.soonRead=!1,Object.assign(this,t),this.fromUser?this.fromUser.avatarUrl=D(this.fromUser.login):this.fromUser={id:-1,login:null,email:null,fullName:"Information",avatarUrl:null},this.appIcon=ei[this.content.app],this.setMainElement()}setMainElement(){if(this.content.app===y.COMMENTS||this.content.app===y.SHARES||this.content.app===y.SYNC)return;let t=this.content.url.split("/");t.length>1&&(this.mainElement=t[t.length-1])}};var ii=(()=>{let t=class t{constructor(){this.http=b(ut),this.store=b(ft),this.layout=b(pt)}getNotifications(e=!1){return this.http.get(`${kt}${e?`/${Kt.UNREAD}`:""}`).pipe(d(r=>r.map(n=>new wt(n))))}wasReadNotification(e){return this.http.patch(`${kt}/${e}`,null)}deleteNotification(e){return this.http.delete(`${kt}${e?`/${e}`:""}`)}checkUnreadNotifications(e=!1){this.getNotifications().subscribe(r=>{let n;if(e&&r.length){let o=r[0];n=this.layout.sendNotification("warning",o.fromUser.fullName,this.layout.translateString(`${this.layout.translateString(o.content.event)}: <b>${o.content.element}</b>`),null,{enableHtml:!0})}else{let o=r.filter(a=>!a.wasRead).length;o&&(n=this.layout.sendNotification("warning","Notifications",this.layout.translateString(o===1?"one_notification":"nb_notifications",{nb:o})))}n&&n.onTap.pipe(Zt(1)).subscribe(()=>this.layout.showRSideBarTab(be.NOTIFICATIONS,!0)),this.store.notifications.set(r)})}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var At=class{constructor(t){this.parentGroup=t.parentGroup,this.members=t.members.map(i=>new T(i))}};var I=class{constructor(t){this.newly=0,this.currentAccessHover=!1,this.setManagers(t),Object.assign(this,t),this.avatarUrl=D(t.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=(0,he.default)(this.currentAccess).fromNow(!0),this.newly=Ee(this.currentAccess)}setManagers(t){t?.managers&&(t.managers=t.managers.map(i=>new T(i)))}};var et=class{constructor(t){this.setOnlineStatus(_e("status",t)),this.avatarUrl=D(t.login),Object.assign(this,t)}setOnlineStatus(t){this.onlineStatus=t,this.onlineTextStatus=le[t]}};var Bn=(()=>{let t=class t{constructor(){this.http=b(ut),this.layout=b(pt),this.store=b(ft),this.webSocket=b(V),this.notifications=b(ii),this.webSocket.fromEvent("connect").subscribe(()=>this.notifications.checkUnreadNotifications()),this.webSocket.fromEvent("disconnect").subscribe(()=>this.store.onlineUsers.set([])),this.webSocket.fromEvent(we.EVENTS.NOTIFICATION).subscribe(()=>this.notifications.checkUnreadNotifications(!0)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USER).pipe(d(e=>new et(e))).subscribe(e=>this.newOnlineUser(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USERS).pipe(d(e=>e.map(r=>new et(r)))).subscribe(e=>this.setOnlineUsers(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_STATUS).subscribe(e=>this.receiveOnlineStatus(e))}get user(){return this.store.user.getValue()}initUser(e,r=!1){this.refreshAvatar(),this.layout.setLanguage(e.language),this.store.userImpersonate.set(r||e.impersonated),this.store.user.next(e),this.checkQuota(this.store.user.getValue()),r&&this.disconnectWebSocket(),this.connectWebSocket()}connectWebSocket(){this.webSocket.ioSocket.io.opts.query={onlineStatus:this.user.onlineStatus},this.webSocket.connect()}disconnectWebSocket(){this.webSocket.disconnect()}setOnlineUsers(e){this.store.onlineUsers.set(e)}newOnlineUser(e){this.store.onlineUsers().find(r=>r.id===e.id)?this.receiveOnlineStatus({userId:e.id,status:e.onlineStatus}):this.store.onlineUsers.update(r=>[e,...r])}userHavePermission(e){return this.user.isAdmin?!0:this.user?this.user.applications.indexOf(e)!==-1:!1}browseGroup(e){return this.http.get(`${ge}${e?`/${e}`:""}`).pipe(d(r=>new At(r)))}createPersonalGroup(e){return this.http.post(O,e).pipe(d(r=>new T(r)))}updatePersonalGroup(e,r){return this.http.put(`${O}/${e}`,r).pipe(d(n=>new T(n)))}leavePersonalGroup(e){return this.http.delete(`${ye}/${e}`)}addUsersToGroup(e,r){return this.http.patch(`${O}/${e}/${$.USERS}`,r)}deletePersonalGroup(e){return this.http.delete(`${O}/${e}`)}updateUserFromPersonalGroup(e,r,n){return this.http.patch(`${O}/${e}/${$.USERS}/${r}`,n)}removeUserFromGroup(e,r){return this.http.delete(`${O}/${e}/${$.USERS}/${r}`)}listGuests(){return this.http.get(P).pipe(d(e=>e.map(r=>new I(r))))}getGuest(e){return this.http.get(`${P}/${e}`).pipe(d(r=>new I(r)))}createGuest(e){return this.http.post(P,e).pipe(d(r=>new I(r)))}updateGuest(e,r){return this.http.put(`${P}/${e}`,r).pipe(d(n=>n?new I(n):null))}deleteGuest(e){return this.http.delete(`${P}/${e}`)}genAvatar(){this.http.patch(Ct,null).subscribe({next:()=>this.refreshAvatar(),error:e=>this.layout.sendNotification("error","Configuration","Avatar",e)})}uploadAvatar(e){let r=new FormData;r.append("file",e),this.http.put(Ct,r).subscribe({next:()=>this.refreshAvatar(),error:n=>this.layout.sendNotification("error","Configuration","Avatar",n)})}changePassword(e){return this.http.put(de,e)}changeLanguage(e){return this.http.put(pe,e)}changeNotification(e){return this.http.put(me,e)}changeOnlineStatus(e,r=!0){this.webSocket.emit(W.EVENTS.ONLINE_STATUS,{status:e,store:r})}receiveOnlineStatus(e){this.user.id===e.userId?this.user.onlineStatus=e.status:this.store.onlineUsers().length&&this.store.onlineUsers.update(r=>r.map(n=>n.id===e.userId?jt(it({},n),{onlineStatus:e.status}):n))}searchMembers(e,r=[]){return this.http.request("search",$.BASE,{body:e}).pipe(d(n=>n.map(o=>new T(o,r))),zt(()=>[]))}setMenusVisibility(e){for(let r of e)if(!(r.id&&(r.hide=!this.userHavePermission(r.id),r.hide))&&(r.checks?.length&&(r.hide=!r.checks.map(n=>n.negate?!this[n.prop][n.value]:this[n.prop][n.value]).every(n=>!!n)),r.submenus?.length&&this.setMenusVisibility(r.submenus),r.title===ke.FILES)){for(let n of r.submenus)if(!n.hide){r.link=n.link;break}}}refreshAvatar(){this.store.userAvatarUrl.next(ve())}checkAppStoreAvailability(){this.http.get(`${Rt.BASE}/${Rt.APP_STORE}`).subscribe({next:e=>this.store.appStoreManifest.set(e),error:e=>console.error(e)})}checkQuota(e){if(!(e.isGuest||e.isLink)&&e.storageQuota){let r=Math.round(100/e.storageQuota*(e.storageQuota-e.storageUsage));r<=1?this.layout.sendNotification("error","Storage Quota","No more space available",null,{disableTimeOut:!0,closeButton:!0}):r<=5?this.layout.sendNotification("warning","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0}):r<=10&&this.layout.sendNotification("info","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0})}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var Ai={provide:lt,useExisting:H(()=>Ti),multi:!0},Ti=(()=>{let t=class t{constructor(){this.btnCheckboxTrue=!0,this.btnCheckboxFalse=!1,this.state=!1,this.isDisabled=!1,this.onChange=Function.prototype,this.onTouched=Function.prototype}onClick(){this.isDisabled||(this.toggle(!this.state),this.onChange(this.value))}ngOnInit(){this.toggle(this.trueValue===this.value)}get trueValue(){return typeof this.btnCheckboxTrue<"u"?this.btnCheckboxTrue:!0}get falseValue(){return typeof this.btnCheckboxFalse<"u"?this.btnCheckboxFalse:!1}toggle(e){this.state=e,this.value=this.state?this.trueValue:this.falseValue}writeValue(e){this.state=this.trueValue===e,this.value=e?this.trueValue:this.falseValue}setDisabledState(e){this.isDisabled=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}};t.\u0275fac=function(r){return new(r||t)},t.\u0275dir=ot({type:t,selectors:[["","btnCheckbox",""]],hostVars:3,hostBindings:function(r,n){r&1&&ct("click",function(){return n.onClick()}),r&2&&(at("aria-pressed",n.state),Tt("active",n.state))},inputs:{btnCheckboxTrue:"btnCheckboxTrue",btnCheckboxFalse:"btnCheckboxFalse"},features:[ht([Ai])]});let s=t;return s})(),Oi={provide:lt,useExisting:H(()=>si),multi:!0},si=(()=>{let t=class t{get value(){return this.group?this.group.value:this._value}set value(e){if(this.group){this.group.value=e;return}this._value=e,this._onChange(e)}get disabled(){return this._disabled}set disabled(e){this.setDisabledState(e)}get controlOrGroupDisabled(){return this.disabled||this.group&&this.group.disabled?!0:void 0}get hasDisabledClass(){return this.controlOrGroupDisabled&&!this.isActive}get isActive(){return this.btnRadio===this.value}get tabindex(){if(!this.controlOrGroupDisabled)return this.isActive||this.group==null?0:-1}get hasFocus(){return this._hasFocus}constructor(e,r,n,o){this.el=e,this.cdr=r,this.renderer=n,this.group=o,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.uncheckable=!1,this.role="radio",this._disabled=!1,this._hasFocus=!1}toggleIfAllowed(){this.canToggle()&&(this.uncheckable&&this.btnRadio===this.value?this.value=void 0:this.value=this.btnRadio)}onSpacePressed(e){this.toggleIfAllowed(),e.preventDefault()}focus(){this.el.nativeElement.focus()}onFocus(){this._hasFocus=!0}onBlur(){this._hasFocus=!1,this.onTouched()}canToggle(){return!this.controlOrGroupDisabled&&(this.uncheckable||this.btnRadio!==this.value)}ngOnChanges(e){"uncheckable"in e&&(this.uncheckable=this.uncheckable!==!1&&typeof this.uncheckable<"u")}_onChange(e){if(this.group){this.group.value=e;return}this.onTouched(),this.onChange(e)}writeValue(e){this.value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){if(this._disabled=e,e){this.renderer.setAttribute(this.el.nativeElement,"disabled","disabled");return}this.renderer.removeAttribute(this.el.nativeElement,"disabled")}};t.\u0275fac=function(r){return new(r||t)(L(se),L(Ot),L(re),L(H(()=>ri),8))},t.\u0275dir=ot({type:t,selectors:[["","btnRadio",""]],hostVars:8,hostBindings:function(r,n){r&1&&ct("click",function(){return n.toggleIfAllowed()})("keydown.space",function(a){return n.onSpacePressed(a)})("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()}),r&2&&(at("aria-disabled",n.controlOrGroupDisabled)("aria-checked",n.isActive)("role",n.role)("tabindex",n.tabindex),Tt("disabled",n.hasDisabledClass)("active",n.isActive))},inputs:{btnRadio:"btnRadio",uncheckable:"uncheckable",value:"value",disabled:"disabled"},features:[ht([Oi]),ie]});let s=t;return s})(),Ri={provide:lt,useExisting:H(()=>ri),multi:!0},ri=(()=>{let t=class t{constructor(e){this.cdr=e,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.role="radiogroup",this._disabled=!1}get value(){return this._value}set value(e){this._value=e,this.onChange(e)}get disabled(){return this._disabled}get tabindex(){return this._disabled?null:0}writeValue(e){this._value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.radioButtons&&(this._disabled=e,this.radioButtons.forEach(r=>{r.setDisabledState(e)}),this.cdr.markForCheck())}onFocus(){if(this._disabled)return;let e=this.getActiveOrFocusedRadio();if(e){e.focus();return}if(this.radioButtons){let r=this.radioButtons.find(n=>!n.disabled);r&&r.focus()}}onBlur(){this.onTouched&&this.onTouched()}selectNext(e){this.selectInDirection("next"),e.preventDefault()}selectPrevious(e){this.selectInDirection("previous"),e.preventDefault()}selectInDirection(e){if(this._disabled)return;function r(o,a){let p=(o+(e==="next"?1:-1))%a.length;return p<0&&(p=a.length-1),p}let n=this.getActiveOrFocusedRadio();if(n&&this.radioButtons){let o=this.radioButtons.toArray(),a=o.indexOf(n);for(let c=r(a,o);c!==a;c=r(c,o))if(o[c].canToggle()){o[c].toggleIfAllowed(),o[c].focus();break}}}getActiveOrFocusedRadio(){if(this.radioButtons)return this.radioButtons.find(e=>e.isActive)||this.radioButtons.find(e=>e.hasFocus)}};t.\u0275fac=function(r){return new(r||t)(L(Ot))},t.\u0275dir=ot({type:t,selectors:[["","btnRadioGroup",""]],contentQueries:function(r,n,o){if(r&1&&oe(o,si,4),r&2){let a;ae(a=ce())&&(n.radioButtons=a)}},hostVars:2,hostBindings:function(r,n){r&1&&ct("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()})("keydown.ArrowRight",function(a){return n.selectNext(a)})("keydown.ArrowDown",function(a){return n.selectNext(a)})("keydown.ArrowLeft",function(a){return n.selectPrevious(a)})("keydown.ArrowUp",function(a){return n.selectPrevious(a)}),r&2&&at("role",n.role)("tabindex",n.tabindex)},features:[ht([Ri])]});let s=t;return s})(),Wn=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275mod=nt({type:t}),t.\u0275inj=rt({});let s=t;return s})();export{Ar as a,y as b,ii as c,At as d,I as e,Bn as f,Ti as g,Wn as h};
|
|
1
|
+
import{$ as Ct,B as he,Ea as _e,Gb as ke,Hb as Y,Ja as be,Q as le,Qa as Ee,Qb as T,S as fe,T as Rt,W as $,Y as pe,Z as de,_ as me,aa as O,ba as ge,ca as ye,da as P,fb as Se,ib as D,jb as ve,kb as ft,wb as pt}from"./chunk-Y2CDUS4J.js";import{Cb as ct,G as zt,Hb as oe,Jb as ae,Kb as ce,L as Zt,Nb as Tt,Oc as ut,Qa as re,Ra as L,W as te,Ya as nt,Za as ot,Zb as ht,_c as lt,ba as H,c as Xt,ca as st,da as rt,fa as ee,ha as b,hb as ne,ib as at,nf as ue,qc as Ot,v as d,va as ie,ya as se}from"./chunk-RSNLYAN6.js";import{a as it,b as jt,c as Qt,e as Jt}from"./chunk-RTRJ3KFH.js";var we={NAME_SPACE:"/",EVENTS:{NOTIFICATION:"notification"}};var W={NAME_SPACE:"/",EVENTS:{ONLINE_STATUS:"onlineStatus",ONLINE_USERS:"onlineUsers",ONLINE_USER:"onlineUser"}};var Wt={};Jt(Wt,{Fetch:()=>X,Manager:()=>N,NodeWebSocket:()=>w,NodeXHR:()=>k,Socket:()=>C,WebSocket:()=>w,WebTransport:()=>R,XHR:()=>k,connect:()=>B,default:()=>B,io:()=>B,protocol:()=>$t});var _=Object.create(null);_.open="0";_.close="1";_.ping="2";_.pong="3";_.message="4";_.upgrade="5";_.noop="6";var G=Object.create(null);Object.keys(_).forEach(s=>{G[_[s]]=s});var K={type:"error",data:"parser error"};var Oe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Re=typeof ArrayBuffer=="function",Ce=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,j=({type:s,data:t},i,e)=>Oe&&t instanceof Blob?i?e(t):Ae(t,e):Re&&(t instanceof ArrayBuffer||Ce(t))?i?e(t):Ae(new Blob([t]),e):e(_[s]+(t||"")),Ae=(s,t)=>{let i=new FileReader;return i.onload=function(){let e=i.result.split(",")[1];t("b"+(e||""))},i.readAsDataURL(s)};function Te(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var xt;function xe(s,t){if(Oe&&s.data instanceof Blob)return s.data.arrayBuffer().then(Te).then(t);if(Re&&(s.data instanceof ArrayBuffer||Ce(s.data)))return t(Te(s.data));j(s,!1,i=>{xt||(xt=new TextEncoder),t(xt.encode(i))})}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<Ne.length;s++)Q[Ne.charCodeAt(s)]=s;var Be=s=>{let t=s.length*.75,i=s.length,e,r=0,n,o,a,c;s[s.length-1]==="="&&(t--,s[s.length-2]==="="&&t--);let p=new ArrayBuffer(t),g=new Uint8Array(p);for(e=0;e<i;e+=4)n=Q[s.charCodeAt(e)],o=Q[s.charCodeAt(e+1)],a=Q[s.charCodeAt(e+2)],c=Q[s.charCodeAt(e+3)],g[r++]=n<<2|o>>4,g[r++]=(o&15)<<4|a>>2,g[r++]=(a&3)<<6|c&63;return p};var ni=typeof ArrayBuffer=="function",J=(s,t)=>{if(typeof s!="string")return{type:"message",data:Ie(s,t)};let i=s.charAt(0);return i==="b"?{type:"message",data:oi(s.substring(1),t)}:G[i]?s.length>1?{type:G[i],data:s.substring(1)}:{type:G[i]}:K},oi=(s,t)=>{if(ni){let i=Be(s);return Ie(i,t)}else return{base64:!0,data:s}},Ie=(s,t)=>{switch(t){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}};var Le="",Pe=(s,t)=>{let i=s.length,e=new Array(i),r=0;s.forEach((n,o)=>{j(n,!1,a=>{e[o]=a,++r===i&&t(e.join(Le))})})},De=(s,t)=>{let i=s.split(Le),e=[];for(let r=0;r<i.length;r++){let n=J(i[r],t);if(e.push(n),n.type==="error")break}return e};function Ue(){return new TransformStream({transform(s,t){xe(s,i=>{let e=i.length,r;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);let n=new DataView(r.buffer);n.setUint8(0,126),n.setUint16(1,e)}else{r=new Uint8Array(9);let n=new DataView(r.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(e))}s.data&&typeof s.data!="string"&&(r[0]|=128),t.enqueue(r),t.enqueue(i)})}})}var Nt;function dt(s){return s.reduce((t,i)=>t+i.length,0)}function mt(s,t){if(s[0].length===t)return s.shift();let i=new Uint8Array(t),e=0;for(let r=0;r<t;r++)i[r]=s[0][e++],e===s[0].length&&(s.shift(),e=0);return s.length&&e<s[0].length&&(s[0]=s[0].slice(e)),i}function Fe(s,t){Nt||(Nt=new TextDecoder);let i=[],e=0,r=-1,n=!1;return new TransformStream({transform(o,a){for(i.push(o);;){if(e===0){if(dt(i)<1)break;let c=mt(i,1);n=(c[0]&128)===128,r=c[0]&127,r<126?e=3:r===126?e=1:e=2}else if(e===1){if(dt(i)<2)break;let c=mt(i,2);r=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),e=3}else if(e===2){if(dt(i)<8)break;let c=mt(i,8),p=new DataView(c.buffer,c.byteOffset,c.length),g=p.getUint32(0);if(g>Math.pow(2,21)-1){a.enqueue(K);break}r=g*Math.pow(2,32)+p.getUint32(4),e=3}else{if(dt(i)<r)break;let c=mt(i,r);a.enqueue(J(n?c:Nt.decode(c),t)),e=0}if(r===0||r>s){a.enqueue(K);break}}}})}var Bt=4;function u(s){if(s)return ai(s)}function ai(s){for(var t in u.prototype)s[t]=u.prototype[t];return s}u.prototype.on=u.prototype.addEventListener=function(s,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(t),this};u.prototype.once=function(s,t){function i(){this.off(s,i),t.apply(this,arguments)}return i.fn=t,this.on(s,i),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(s,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+s];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var e,r=0;r<i.length;r++)if(e=i[r],e===t||e.fn===t){i.splice(r,1);break}return i.length===0&&delete this._callbacks["$"+s],this};u.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),i=this._callbacks["$"+s],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(i){i=i.slice(0);for(var e=0,r=i.length;e<r;++e)i[e].apply(this,t)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};u.prototype.hasListeners=function(s){return!!this.listeners(s).length};var E=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,i)=>i(t,0),l=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Me="arraybuffer";function gt(s,...t){return t.reduce((i,e)=>(s.hasOwnProperty(e)&&(i[e]=s[e]),i),{})}var ci=l.setTimeout,hi=l.clearTimeout;function S(s,t){t.useNativeTimers?(s.setTimeoutFn=ci.bind(l),s.clearTimeoutFn=hi.bind(l)):(s.setTimeoutFn=l.setTimeout.bind(l),s.clearTimeoutFn=l.clearTimeout.bind(l))}var ui=1.33;function Ve(s){return typeof s=="string"?li(s):Math.ceil((s.byteLength||s.size)*ui)}function li(s){let t=0,i=0;for(let e=0,r=s.length;e<r;e++)t=s.charCodeAt(e),t<128?i+=1:t<2048?i+=2:t<55296||t>=57344?i+=3:(e++,i+=4);return i}function yt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function qe(s){let t="";for(let i in s)s.hasOwnProperty(i)&&(t.length&&(t+="&"),t+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return t}function He(s){let t={},i=s.split("&");for(let e=0,r=i.length;e<r;e++){let n=i[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}var _t=class extends Error{constructor(t,i,e){super(t),this.description=i,this.context=e,this.type="TransportError"}},v=class extends u{constructor(t){super(),this.writable=!1,S(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,i,e){return super.emitReserved("error",new _t(t,i,e)),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 i=J(t,this.socket.binaryType);this.onPacket(i)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,i={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){let i=qe(t);return i.length?"?"+i:""}};var U=class extends v{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let i=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let i=e=>{if(this.readyState==="opening"&&e.type==="open"&&this.onOpen(),e.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};De(t,this.socket.binaryType).forEach(i),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,Pe(t,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=yt()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(t,i)}};var $e=!1;try{$e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Ye=$e;function fi(){}var It=class extends U{constructor(t){if(super(t),typeof location<"u"){let i=location.protocol==="https:",e=location.port;e||(e=i?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||e!==t.port}}doWrite(t,i){let e=this.request({method:"POST",data:t});e.on("success",i),e.on("error",(r,n)=>{this.onError("xhr post error",r,n)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(i,e)=>{this.onError("xhr poll error",i,e)}),this.pollXhr=t}},bt=(()=>{class s extends u{constructor(i,e,r){super(),this.createRequest=i,S(this,r),this._opts=r,this._method=r.method||"GET",this._uri=e,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var i;let e=gt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(e);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var n;r.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=fi,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.requests[this._index],this._xhr=null}}_onLoad(){let i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return s.requestsCount=0,s.requests={},s})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",We);else if(typeof addEventListener=="function"){let s="onpagehide"in l?"pagehide":"unload";addEventListener(s,We,!1)}}function We(){for(let s in bt.requests)bt.requests.hasOwnProperty(s)&&bt.requests[s].abort()}var pi=(function(){let s=Ge({xdomain:!1});return s&&s.responseType!==null})(),k=class extends It{constructor(t){super(t);let i=t&&t.forceBase64;this.supportsBinary=pi&&!i}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new bt(Ge,this.uri(),t)}};function Ge(s){let t=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ye))return new XMLHttpRequest}catch{}if(!t)try{return new l[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Ke=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Pt=class extends v{get name(){return"websocket"}doOpen(){let t=this.uri(),i=this.opts.protocols,e=Ke?{}:gt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(e.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,i,e)}catch(r){return this.emitReserved("error",r)}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 i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;j(e,this.supportsBinary,n=>{try{this.doWrite(e,n)}catch{}r&&E(()=>{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",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=yt()),this.supportsBinary||(i.b64=1),this.createUri(t,i)}},Lt=l.WebSocket||l.MozWebSocket,w=class extends Pt{createSocket(t,i,e){return Ke?new Lt(t,i,e):i?new Lt(t,i):new Lt(t)}doWrite(t,i){this.ws.send(i)}};var R=class extends v{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 i=Fe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=t.readable.pipeThrough(i).getReader(),r=Ue();r.readable.pipeTo(t.writable),this._writer=r.writable.getWriter();let n=()=>{e.read().then(({done:a,value:c})=>{a||(this.onPacket(c),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 i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;this._writer.write(e).then(()=>{r&&E(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}};var Dt={websocket:w,webtransport:R,polling:k};var di=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function F(s){if(s.length>8e3)throw"URI too long";let t=s,i=s.indexOf("["),e=s.indexOf("]");i!=-1&&e!=-1&&(s=s.substring(0,i)+s.substring(i,e).replace(/:/g,";")+s.substring(e,s.length));let r=di.exec(s||""),n={},o=14;for(;o--;)n[mi[o]]=r[o]||"";return i!=-1&&e!=-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=gi(n,n.path),n.queryKey=yi(n,n.query),n}function gi(s,t){let i=/\/{2,9}/g,e=t.replace(i,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&e.splice(0,1),t.slice(-1)=="/"&&e.splice(e.length-1,1),e}function yi(s,t){let i={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,r,n){r&&(i[r]=n)}),i}var Ut=typeof addEventListener=="function"&&typeof removeEventListener=="function",Et=[];Ut&&addEventListener("offline",()=>{Et.forEach(s=>s())},!1);var St=(()=>{class s extends u{constructor(i,e){if(super(),this.binaryType=Me,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(e=i,i=null),i){let r=F(i);e.hostname=r.host,e.secure=r.protocol==="https"||r.protocol==="wss",e.port=r.port,r.query&&(e.query=r.query)}else e.host&&(e.hostname=F(e.host).host);S(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(r=>{let n=r.prototype.name;this.transports.push(n),this._transportsByName[n]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=He(this.opts.query)),Ut&&(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"})},Et.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){let e=Object.assign({},this.opts.query);e.EIO=Bt,e.transport=i,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let i=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let e=this.createTransport(i);e.open(),this.setTransport(e)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",s.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let e=new Error("server error");e.code=i.data,this._onError(e);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),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 i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let r=0;r<this.writeBuffer.length;r++){let n=this.writeBuffer[r].data;if(n&&(e+=Ve(n)),r>0&&e>this._maxPayload)return this.writeBuffer.slice(0,r);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,E(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,e,r){return this._sendPacket("message",i,e,r),this}send(i,e,r){return this._sendPacket("message",i,e,r),this}_sendPacket(i,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;let o={type:i,data:e,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let i=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),i()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():i()}):this.upgrading?r():i()),this}_onError(i){if(s.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,e){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(),Ut&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let r=Et.indexOf(this._offlineEventListener);r!==-1&&Et.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,e),this.writeBuffer=[],this._prevBufferLen=0}}}return s.protocol=Bt,s})(),vt=class extends St{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 i=this.createTransport(t),e=!1;St.priorWebsocketSuccess=!1;let r=()=>{e||(i.send([{type:"ping",data:"probe"}]),i.once("packet",A=>{if(!e)if(A.type==="pong"&&A.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;St.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{e||this.readyState!=="closed"&&(g(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let q=new Error("probe error");q.transport=i.name,this.emitReserved("upgradeError",q)}}))};function n(){e||(e=!0,g(),i.close(),i=null)}let o=A=>{let q=new Error("probe error: "+A);q.transport=i.name,n(),this.emitReserved("upgradeError",q)};function a(){o("transport closed")}function c(){o("socket closed")}function p(A){i&&A.name!==i.name&&n()}let g=()=>{i.removeListener("open",r),i.removeListener("error",o),i.removeListener("close",a),this.off("close",c),this.off("upgrading",p)};i.once("open",r),i.once("error",o),i.once("close",a),this.once("close",c),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{e||i.open()},200):i.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let i=[];for(let e=0;e<t.length;e++)~this.transports.indexOf(t[e])&&i.push(t[e]);return i}},M=class extends vt{constructor(t,i={}){let e=typeof t=="object"?t:i;(!e.transports||e.transports&&typeof e.transports[0]=="string")&&(e.transports=(e.transports||["polling","websocket","webtransport"]).map(r=>Dt[r]).filter(r=>!!r)),super(t,e)}};var X=class extends U{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(i=>this.onData(i))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,i){this._fetch(t).then(e=>{if(!e.ok)return this.onError("fetch write error",e.status,e);i()}).catch(e=>{this.onError("fetch write error",e)})}_fetch(t){var i;let e=t!==void 0,r=new Headers(this.opts.extraHeaders);return e&&r.set("content-type","text/plain;charset=UTF-8"),(i=this.socket._cookieJar)===null||i===void 0||i.appendCookies(r),fetch(this.uri(),{method:e?"POST":"GET",body:e?t:null,headers:r,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 Ps=M.protocol;function je(s,t="",i){let e=s;i=i||typeof location<"u"&&location,s==null&&(s=i.protocol+"//"+i.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=i.protocol+s:s=i.host+s),/^(https?|wss?):\/\//.test(s)||(typeof i<"u"?s=i.protocol+"//"+s:s="https://"+s),e=F(s)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";let n=e.host.indexOf(":")!==-1?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+t,e.href=e.protocol+"://"+n+(i&&i.port===e.port?"":":"+e.port),e}var Yt={};Jt(Yt,{Decoder:()=>qt,Encoder:()=>Vt,PacketType:()=>h,protocol:()=>$t});var _i=typeof ArrayBuffer=="function",bi=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Qe=Object.prototype.toString,Ei=typeof Blob=="function"||typeof Blob<"u"&&Qe.call(Blob)==="[object BlobConstructor]",Si=typeof File=="function"||typeof File<"u"&&Qe.call(File)==="[object FileConstructor]";function Z(s){return _i&&(s instanceof ArrayBuffer||bi(s))||Ei&&s instanceof Blob||Si&&s instanceof File}function z(s,t){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let i=0,e=s.length;i<e;i++)if(z(s[i]))return!0;return!1}if(Z(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return z(s.toJSON(),!0);for(let i in s)if(Object.prototype.hasOwnProperty.call(s,i)&&z(s[i]))return!0;return!1}function Je(s){let t=[],i=s.data,e=s;return e.data=Ft(i,t),e.attachments=t.length,{packet:e,buffers:t}}function Ft(s,t){if(!s)return s;if(Z(s)){let i={_placeholder:!0,num:t.length};return t.push(s),i}else if(Array.isArray(s)){let i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=Ft(s[e],t);return i}else if(typeof s=="object"&&!(s instanceof Date)){let i={};for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(i[e]=Ft(s[e],t));return i}return s}function Xe(s,t){return s.data=Mt(s.data,t),delete s.attachments,s}function Mt(s,t){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<t.length)return t[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]=Mt(s[i],t);else if(typeof s=="object")for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(s[i]=Mt(s[i],t));return s}var vi=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],$t=5,h=(function(s){return s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK",s})(h||{}),Vt=class{constructor(t){this.replacer=t}encode(t){return(t.type===h.EVENT||t.type===h.ACK)&&z(t)?this.encodeAsBinary({type:t.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let i=""+t.type;return(t.type===h.BINARY_EVENT||t.type===h.BINARY_ACK)&&(i+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(i+=t.nsp+","),t.id!=null&&(i+=t.id),t.data!=null&&(i+=JSON.stringify(t.data,this.replacer)),i}encodeAsBinary(t){let i=Je(t),e=this.encodeAsString(i.packet),r=i.buffers;return r.unshift(e),r}};function ze(s){return Object.prototype.toString.call(s)==="[object Object]"}var qt=class s extends u{constructor(t){super(),this.reviver=t}add(t){let i;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(t);let e=i.type===h.BINARY_EVENT;e||i.type===h.BINARY_ACK?(i.type=e?h.EVENT:h.ACK,this.reconstructor=new Ht(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Z(t)||t.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(t),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let i=0,e={type:Number(t.charAt(0))};if(h[e.type]===void 0)throw new Error("unknown packet type "+e.type);if(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK){let n=i+1;for(;t.charAt(++i)!=="-"&&i!=t.length;);let o=t.substring(n,i);if(o!=Number(o)||t.charAt(i)!=="-")throw new Error("Illegal attachments");e.attachments=Number(o)}if(t.charAt(i+1)==="/"){let n=i+1;for(;++i&&!(t.charAt(i)===","||i===t.length););e.nsp=t.substring(n,i)}else e.nsp="/";let r=t.charAt(i+1);if(r!==""&&Number(r)==r){let n=i+1;for(;++i;){let o=t.charAt(i);if(o==null||Number(o)!=o){--i;break}if(i===t.length)break}e.id=Number(t.substring(n,i+1))}if(t.charAt(++i)){let n=this.tryParse(t.substr(i));if(s.isPayloadValid(e.type,n))e.data=n;else throw new Error("invalid payload")}return e}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,i){switch(t){case h.CONNECT:return ze(i);case h.DISCONNECT:return i===void 0;case h.CONNECT_ERROR:return typeof i=="string"||ze(i);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&vi.indexOf(i[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Ht=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 i=Xe(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function m(s,t,i){return s.on(t,i),function(){s.off(t,i)}}var ki=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),C=class extends u{constructor(t,i,e){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=i,e&&e.auth&&(this.auth=e.auth),this._opts=Object.assign({},e),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[m(t,"open",this.onopen.bind(this)),m(t,"packet",this.onpacket.bind(this)),m(t,"error",this.onerror.bind(this)),m(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,...i){var e,r,n;if(ki.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(i.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:h.EVENT,data:i};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){let g=this.ids++,A=i.pop();this._registerAckCallback(g,A),o.id=g}let a=(r=(e=this.io.engine)===null||e===void 0?void 0:e.transport)===null||r===void 0?void 0:r.writable,c=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,i){var e;let r=(e=this.flags.timeout)!==null&&e!==void 0?e:this._opts.ackTimeout;if(r===void 0){this.acks[t]=i;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);i.call(this,new Error("operation has timed out"))},r),o=(...a)=>{this.io.clearTimeoutFn(n),i.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...i){return new Promise((e,r)=>{let n=(o,a)=>o?r(o):e(a);n.withError=!0,i.push(n),this.emit(t,...i)})}_addToQueue(t){let i;typeof t[t.length-1]=="function"&&(i=t.pop());let e={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((r,...n)=>e!==this._queue[0]?void 0:(r!==null?e.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(r)):(this._queue.shift(),i&&i(null,...n)),e.pending=!1,this._drainQueue())),this._queue.push(e),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;let i=this._queue[0];i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.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:h.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,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(e=>String(e.id)===t)){let e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case h.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 h.EVENT:case h.BINARY_EVENT:this.onevent(t);break;case h.ACK:case h.BINARY_ACK:this.onack(t);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e);break}}onevent(t){let i=t.data||[];t.id!=null&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let i=this._anyListeners.slice();for(let e of i)e.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 i=this,e=!1;return function(...r){e||(e=!0,i.packet({type:h.ACK,id:t,data:r}))}}onack(t){let i=this.acks[t.id];typeof i=="function"&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))}onconnect(t,i){this.id=t,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}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:h.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 i=this._anyListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,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 i=this._anyOutgoingListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let e of i)e.apply(this,t.data)}}};function x(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}x.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*s);s=(Math.floor(t*10)&1)==0?s-i:s+i}return Math.min(s,this.max)|0};x.prototype.reset=function(){this.attempts=0};x.prototype.setMin=function(s){this.ms=s};x.prototype.setMax=function(s){this.max=s};x.prototype.setJitter=function(s){this.jitter=s};var N=class extends u{constructor(t,i){var e;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(i=t,t=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,S(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((e=i.randomizationFactor)!==null&&e!==void 0?e:.5),this.backoff=new x({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=t;let r=i.parser||Yt;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=i.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 i;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(i=this.backoff)===null||i===void 0||i.setMin(t),this)}randomizationFactor(t){var i;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(i=this.backoff)===null||i===void 0||i.setJitter(t),this)}reconnectionDelayMax(t){var i;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(i=this.backoff)===null||i===void 0||i.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 M(this.uri,this.opts);let i=this.engine,e=this;this._readyState="opening",this.skipReconnect=!1;let r=m(i,"open",function(){e.onopen(),t&&t()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=m(i,"error",n);if(this._timeout!==!1){let a=this._timeout,c=this.setTimeoutFn(()=>{r(),n(new Error("timeout")),i.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(r),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(m(t,"ping",this.onping.bind(this)),m(t,"data",this.ondata.bind(this)),m(t,"error",this.onerror.bind(this)),m(t,"close",this.onclose.bind(this)),m(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(i){this.onclose("parse error",i)}}ondecoded(t){E(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,i){let e=this.nsps[t];return e?this._autoConnect&&!e.active&&e.connect():(e=new C(this,t,i),this.nsps[t]=e),e}_destroy(t){let i=Object.keys(this.nsps);for(let e of i)if(this.nsps[e].active)return;this._close()}_packet(t){let i=this.encoder.encode(t);for(let e=0;e<i.length;e++)this.engine.write(i[e],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,i){var e;this.cleanup(),(e=this.engine)===null||e===void 0||e.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,i),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 i=this.backoff.duration();this._reconnecting=!0;let e=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(r=>{r?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",r)):t.onreconnect()}))},i);this.opts.autoUnref&&e.unref(),this.subs.push(()=>{this.clearTimeoutFn(e)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};var tt={};function B(s,t){typeof s=="object"&&(t=s,s=void 0),t=t||{};let i=je(s,t.path||"/socket.io"),e=i.source,r=i.id,n=i.path,o=tt[r]&&n in tt[r].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o,c;return a?c=new N(e,t):(tt[r]||(tt[r]=new N(e,t)),c=tt[r]),i.query&&!t.query&&(t.query=i.queryKey),c.socket(i.path,t)}Object.assign(B,{Manager:N,Socket:C,io:B,connect:B});var V=class s{config;appRef;subscribersCounter={};eventObservables$={};namespaces={};ioSocket;emptyConfig={url:"",options:{}};constructor(t,i){this.config=t,this.appRef=i,t===void 0&&(t=this.emptyConfig);let e=t.url,r=t.options,n=B?B:Wt;this.ioSocket=n(e,r)}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 i=this.namespaces[t];if(i)return i;let a=this.config,{url:e}=a,r=Qt(a,["url"]),n=it({url:!e.endsWith("/")&&!t.startsWith("/")?`${e}/${t}`:`${e}${t}`},r),o=new s(n,this.appRef);return this.namespaces[t]=o,o}on(t,i){return this.ioSocket.on(t,i),this}once(t,i){return this.ioSocket.once(t,i),this}connect(){return this.ioSocket.connect(),this}disconnect(){return this.ioSocket.disconnect(),this}emit(t,...i){return this.ioSocket.emit(t,...i),this}send(...t){return this.ioSocket.send.apply(this.ioSocket,arguments),this}emitWithAck(t,...i){return this.ioSocket.emitWithAck(t,...i)}removeListener(t,i){return this.ioSocket.removeListener(t,i),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 Xt(i=>{let e=r=>{i.next(r),this.appRef.tick()};return this.ioSocket.on(t,e),()=>{this.subscribersCounter[t]--,this.subscribersCounter[t]===0&&(this.ioSocket.removeListener(t,e),delete this.eventObservables$[t])}}).pipe(te())),this.eventObservables$[t]}fromOneTimeEvent(t){return new Promise(i=>this.once(t,i))}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,i){return this.ioSocket.off(t,i),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 wi(s,t){return new V(s,t)}var Ze=new ee("__SOCKET_IO_CONFIG__"),Ar=(()=>{class s{static forRoot(i){return{ngModule:s,providers:[{provide:Ze,useValue:i},{provide:V,useFactory:wi,deps:[Ze,ne]}]}}static \u0275fac=function(e){return new(e||s)};static \u0275mod=nt({type:s});static \u0275inj=rt({})}return s})();var Kt={BASE:`${fe}/notifications`,UNREAD:"unread"},kt=Kt.BASE;var f=(function(s){return s.ADD="add",s.UPDATE="update",s.DELETE="delete",s.DELETE_PERMANENTLY="deletePermanently",s})(f||{});var y=(function(s){return s.COMMENTS="comments",s.SPACES="spaces",s.SPACE_ROOTS="spaces_roots",s.SHARES="shares",s.LINKS="links",s.SYNC="sync",s})(y||{}),Br={COMMENTS:"commented",SPACES:{[f.ADD]:"You now have access to the space",[f.DELETE]:"You no longer have access to the space",[f.DELETE_PERMANENTLY]:"This space has been permanently deleted"},SPACE_ROOTS:{[f.ADD]:"anchored",[f.DELETE]:"unanchored"},SHARES:{[f.ADD]:"shared with you",[f.DELETE]:"no longer share with you"},SHARES_WITHOUT_OWNER:{[f.ADD]:"You now have access to the share",[f.DELETE]:"You no longer have access to the share",[f.DELETE_PERMANENTLY]:"You are no longer a member of the parent share, your child share has been deleted"},LINKS:{[f.ADD]:"shared with you",[f.UPDATE]:"You now have access to the space"},SYNC:{[f.DELETE]:"You are no longer synchronizing"}};var ti=ue;var ei={[y.COMMENTS]:ti,[y.SPACES]:Y.SPACES,[y.SPACE_ROOTS]:Y.SPACES,[y.SHARES]:Y.SHARES,[y.LINKS]:Y.LINKS,[y.SYNC]:Se.SYNC};var wt=class{constructor(t){this.soonRead=!1,Object.assign(this,t),this.fromUser?this.fromUser.avatarUrl=D(this.fromUser.login):this.fromUser={id:-1,login:null,email:null,fullName:"Information",avatarUrl:null},this.appIcon=ei[this.content.app],this.setMainElement()}setMainElement(){if(this.content.app===y.COMMENTS||this.content.app===y.SHARES||this.content.app===y.SYNC)return;let t=this.content.url.split("/");t.length>1&&(this.mainElement=t[t.length-1])}};var ii=(()=>{let t=class t{constructor(){this.http=b(ut),this.store=b(ft),this.layout=b(pt)}getNotifications(e=!1){return this.http.get(`${kt}${e?`/${Kt.UNREAD}`:""}`).pipe(d(r=>r.map(n=>new wt(n))))}wasReadNotification(e){return this.http.patch(`${kt}/${e}`,null)}deleteNotification(e){return this.http.delete(`${kt}${e?`/${e}`:""}`)}checkUnreadNotifications(e=!1){this.getNotifications().subscribe(r=>{let n;if(e&&r.length){let o=r[0];n=this.layout.sendNotification("warning",o.fromUser.fullName,this.layout.translateString(`${this.layout.translateString(o.content.event)}: <b>${o.content.element}</b>`),null,{enableHtml:!0})}else{let o=r.filter(a=>!a.wasRead).length;o&&(n=this.layout.sendNotification("warning","Notifications",this.layout.translateString(o===1?"one_notification":"nb_notifications",{nb:o})))}n&&n.onTap.pipe(Zt(1)).subscribe(()=>this.layout.showRSideBarTab(be.NOTIFICATIONS,!0)),this.store.notifications.set(r)})}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var At=class{constructor(t){this.parentGroup=t.parentGroup,this.members=t.members.map(i=>new T(i))}};var I=class{constructor(t){this.newly=0,this.currentAccessHover=!1,this.setManagers(t),Object.assign(this,t),this.avatarUrl=D(t.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=(0,he.default)(this.currentAccess).fromNow(!0),this.newly=Ee(this.currentAccess)}setManagers(t){t?.managers&&(t.managers=t.managers.map(i=>new T(i)))}};var et=class{constructor(t){this.setOnlineStatus(_e("status",t)),this.avatarUrl=D(t.login),Object.assign(this,t)}setOnlineStatus(t){this.onlineStatus=t,this.onlineTextStatus=le[t]}};var Bn=(()=>{let t=class t{constructor(){this.http=b(ut),this.layout=b(pt),this.store=b(ft),this.webSocket=b(V),this.notifications=b(ii),this.webSocket.fromEvent("connect").subscribe(()=>this.notifications.checkUnreadNotifications()),this.webSocket.fromEvent("disconnect").subscribe(()=>this.store.onlineUsers.set([])),this.webSocket.fromEvent(we.EVENTS.NOTIFICATION).subscribe(()=>this.notifications.checkUnreadNotifications(!0)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USER).pipe(d(e=>new et(e))).subscribe(e=>this.newOnlineUser(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USERS).pipe(d(e=>e.map(r=>new et(r)))).subscribe(e=>this.setOnlineUsers(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_STATUS).subscribe(e=>this.receiveOnlineStatus(e))}get user(){return this.store.user.getValue()}initUser(e,r=!1){this.refreshAvatar(),this.layout.setLanguage(e.language),this.store.userImpersonate.set(r||e.impersonated),this.store.user.next(e),this.checkQuota(this.store.user.getValue()),r&&this.disconnectWebSocket(),this.connectWebSocket()}connectWebSocket(){this.webSocket.ioSocket.io.opts.query={onlineStatus:this.user.onlineStatus},this.webSocket.connect()}disconnectWebSocket(){this.webSocket.disconnect()}setOnlineUsers(e){this.store.onlineUsers.set(e)}newOnlineUser(e){this.store.onlineUsers().find(r=>r.id===e.id)?this.receiveOnlineStatus({userId:e.id,status:e.onlineStatus}):this.store.onlineUsers.update(r=>[e,...r])}userHavePermission(e){return this.user.isAdmin?!0:this.user?this.user.applications.indexOf(e)!==-1:!1}browseGroup(e){return this.http.get(`${ge}${e?`/${e}`:""}`).pipe(d(r=>new At(r)))}createPersonalGroup(e){return this.http.post(O,e).pipe(d(r=>new T(r)))}updatePersonalGroup(e,r){return this.http.put(`${O}/${e}`,r).pipe(d(n=>new T(n)))}leavePersonalGroup(e){return this.http.delete(`${ye}/${e}`)}addUsersToGroup(e,r){return this.http.patch(`${O}/${e}/${$.USERS}`,r)}deletePersonalGroup(e){return this.http.delete(`${O}/${e}`)}updateUserFromPersonalGroup(e,r,n){return this.http.patch(`${O}/${e}/${$.USERS}/${r}`,n)}removeUserFromGroup(e,r){return this.http.delete(`${O}/${e}/${$.USERS}/${r}`)}listGuests(){return this.http.get(P).pipe(d(e=>e.map(r=>new I(r))))}getGuest(e){return this.http.get(`${P}/${e}`).pipe(d(r=>new I(r)))}createGuest(e){return this.http.post(P,e).pipe(d(r=>new I(r)))}updateGuest(e,r){return this.http.put(`${P}/${e}`,r).pipe(d(n=>n?new I(n):null))}deleteGuest(e){return this.http.delete(`${P}/${e}`)}genAvatar(){this.http.patch(Ct,null).subscribe({next:()=>this.refreshAvatar(),error:e=>this.layout.sendNotification("error","Configuration","Avatar",e)})}uploadAvatar(e){let r=new FormData;r.append("file",e),this.http.put(Ct,r).subscribe({next:()=>this.refreshAvatar(),error:n=>this.layout.sendNotification("error","Configuration","Avatar",n)})}changePassword(e){return this.http.put(de,e)}changeLanguage(e){return this.http.put(pe,e)}changeNotification(e){return this.http.put(me,e)}changeOnlineStatus(e,r=!0){this.webSocket.emit(W.EVENTS.ONLINE_STATUS,{status:e,store:r})}receiveOnlineStatus(e){this.user.id===e.userId?this.user.onlineStatus=e.status:this.store.onlineUsers().length&&this.store.onlineUsers.update(r=>r.map(n=>n.id===e.userId?jt(it({},n),{onlineStatus:e.status}):n))}searchMembers(e,r=[]){return this.http.request("search",$.BASE,{body:e}).pipe(d(n=>n.map(o=>new T(o,r))),zt(()=>[]))}setMenusVisibility(e){for(let r of e)if(!(r.id&&(r.hide=!this.userHavePermission(r.id),r.hide))&&(r.checks?.length&&(r.hide=!r.checks.map(n=>n.negate?!this[n.prop][n.value]:this[n.prop][n.value]).every(n=>!!n)),r.submenus?.length&&this.setMenusVisibility(r.submenus),r.title===ke.FILES)){for(let n of r.submenus)if(!n.hide){r.link=n.link;break}}}refreshAvatar(){this.store.userAvatarUrl.next(ve())}checkAppStoreAvailability(){this.http.get(`${Rt.BASE}/${Rt.APP_STORE}`).subscribe({next:e=>this.store.appStoreManifest.set(e),error:e=>console.error(e)})}checkQuota(e){if(!(e.isGuest||e.isLink)&&e.storageQuota){let r=Math.round(100/e.storageQuota*(e.storageQuota-e.storageUsage));r<=1?this.layout.sendNotification("error","Storage Quota","No more space available",null,{disableTimeOut:!0,closeButton:!0}):r<=5?this.layout.sendNotification("warning","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0}):r<=10&&this.layout.sendNotification("info","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0})}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var Ai={provide:lt,useExisting:H(()=>Ti),multi:!0},Ti=(()=>{let t=class t{constructor(){this.btnCheckboxTrue=!0,this.btnCheckboxFalse=!1,this.state=!1,this.isDisabled=!1,this.onChange=Function.prototype,this.onTouched=Function.prototype}onClick(){this.isDisabled||(this.toggle(!this.state),this.onChange(this.value))}ngOnInit(){this.toggle(this.trueValue===this.value)}get trueValue(){return typeof this.btnCheckboxTrue<"u"?this.btnCheckboxTrue:!0}get falseValue(){return typeof this.btnCheckboxFalse<"u"?this.btnCheckboxFalse:!1}toggle(e){this.state=e,this.value=this.state?this.trueValue:this.falseValue}writeValue(e){this.state=this.trueValue===e,this.value=e?this.trueValue:this.falseValue}setDisabledState(e){this.isDisabled=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}};t.\u0275fac=function(r){return new(r||t)},t.\u0275dir=ot({type:t,selectors:[["","btnCheckbox",""]],hostVars:3,hostBindings:function(r,n){r&1&&ct("click",function(){return n.onClick()}),r&2&&(at("aria-pressed",n.state),Tt("active",n.state))},inputs:{btnCheckboxTrue:"btnCheckboxTrue",btnCheckboxFalse:"btnCheckboxFalse"},features:[ht([Ai])]});let s=t;return s})(),Oi={provide:lt,useExisting:H(()=>si),multi:!0},si=(()=>{let t=class t{get value(){return this.group?this.group.value:this._value}set value(e){if(this.group){this.group.value=e;return}this._value=e,this._onChange(e)}get disabled(){return this._disabled}set disabled(e){this.setDisabledState(e)}get controlOrGroupDisabled(){return this.disabled||this.group&&this.group.disabled?!0:void 0}get hasDisabledClass(){return this.controlOrGroupDisabled&&!this.isActive}get isActive(){return this.btnRadio===this.value}get tabindex(){if(!this.controlOrGroupDisabled)return this.isActive||this.group==null?0:-1}get hasFocus(){return this._hasFocus}constructor(e,r,n,o){this.el=e,this.cdr=r,this.renderer=n,this.group=o,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.uncheckable=!1,this.role="radio",this._disabled=!1,this._hasFocus=!1}toggleIfAllowed(){this.canToggle()&&(this.uncheckable&&this.btnRadio===this.value?this.value=void 0:this.value=this.btnRadio)}onSpacePressed(e){this.toggleIfAllowed(),e.preventDefault()}focus(){this.el.nativeElement.focus()}onFocus(){this._hasFocus=!0}onBlur(){this._hasFocus=!1,this.onTouched()}canToggle(){return!this.controlOrGroupDisabled&&(this.uncheckable||this.btnRadio!==this.value)}ngOnChanges(e){"uncheckable"in e&&(this.uncheckable=this.uncheckable!==!1&&typeof this.uncheckable<"u")}_onChange(e){if(this.group){this.group.value=e;return}this.onTouched(),this.onChange(e)}writeValue(e){this.value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){if(this._disabled=e,e){this.renderer.setAttribute(this.el.nativeElement,"disabled","disabled");return}this.renderer.removeAttribute(this.el.nativeElement,"disabled")}};t.\u0275fac=function(r){return new(r||t)(L(se),L(Ot),L(re),L(H(()=>ri),8))},t.\u0275dir=ot({type:t,selectors:[["","btnRadio",""]],hostVars:8,hostBindings:function(r,n){r&1&&ct("click",function(){return n.toggleIfAllowed()})("keydown.space",function(a){return n.onSpacePressed(a)})("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()}),r&2&&(at("aria-disabled",n.controlOrGroupDisabled)("aria-checked",n.isActive)("role",n.role)("tabindex",n.tabindex),Tt("disabled",n.hasDisabledClass)("active",n.isActive))},inputs:{btnRadio:"btnRadio",uncheckable:"uncheckable",value:"value",disabled:"disabled"},features:[ht([Oi]),ie]});let s=t;return s})(),Ri={provide:lt,useExisting:H(()=>ri),multi:!0},ri=(()=>{let t=class t{constructor(e){this.cdr=e,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.role="radiogroup",this._disabled=!1}get value(){return this._value}set value(e){this._value=e,this.onChange(e)}get disabled(){return this._disabled}get tabindex(){return this._disabled?null:0}writeValue(e){this._value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.radioButtons&&(this._disabled=e,this.radioButtons.forEach(r=>{r.setDisabledState(e)}),this.cdr.markForCheck())}onFocus(){if(this._disabled)return;let e=this.getActiveOrFocusedRadio();if(e){e.focus();return}if(this.radioButtons){let r=this.radioButtons.find(n=>!n.disabled);r&&r.focus()}}onBlur(){this.onTouched&&this.onTouched()}selectNext(e){this.selectInDirection("next"),e.preventDefault()}selectPrevious(e){this.selectInDirection("previous"),e.preventDefault()}selectInDirection(e){if(this._disabled)return;function r(o,a){let p=(o+(e==="next"?1:-1))%a.length;return p<0&&(p=a.length-1),p}let n=this.getActiveOrFocusedRadio();if(n&&this.radioButtons){let o=this.radioButtons.toArray(),a=o.indexOf(n);for(let c=r(a,o);c!==a;c=r(c,o))if(o[c].canToggle()){o[c].toggleIfAllowed(),o[c].focus();break}}}getActiveOrFocusedRadio(){if(this.radioButtons)return this.radioButtons.find(e=>e.isActive)||this.radioButtons.find(e=>e.hasFocus)}};t.\u0275fac=function(r){return new(r||t)(L(Ot))},t.\u0275dir=ot({type:t,selectors:[["","btnRadioGroup",""]],contentQueries:function(r,n,o){if(r&1&&oe(o,si,4),r&2){let a;ae(a=ce())&&(n.radioButtons=a)}},hostVars:2,hostBindings:function(r,n){r&1&&ct("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()})("keydown.ArrowRight",function(a){return n.selectNext(a)})("keydown.ArrowDown",function(a){return n.selectNext(a)})("keydown.ArrowLeft",function(a){return n.selectPrevious(a)})("keydown.ArrowUp",function(a){return n.selectPrevious(a)}),r&2&&at("role",n.role)("tabindex",n.tabindex)},features:[ht([Ri])]});let s=t;return s})(),Wn=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275mod=nt({type:t}),t.\u0275inj=rt({});let s=t;return s})();export{Ar as a,y as b,ii as c,At as d,I as e,Bn as f,Ti as g,Wn as h};
|