@sync-in/server 1.3.8 → 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.
Files changed (128) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +3 -2
  3. package/environment/environment.dist.yaml +2 -0
  4. package/migrations/0001_square_mauler.sql +4 -0
  5. package/migrations/meta/0001_snapshot.json +2417 -0
  6. package/migrations/meta/_journal.json +7 -0
  7. package/package.json +20 -2
  8. package/server/app.bootstrap.js +9 -0
  9. package/server/app.bootstrap.js.map +1 -1
  10. package/server/app.service.spec.js +48 -23
  11. package/server/app.service.spec.js.map +1 -1
  12. package/server/applications/files/constants/files.js +0 -23
  13. package/server/applications/files/constants/files.js.map +1 -1
  14. package/server/applications/files/constants/only-office.js +8 -0
  15. package/server/applications/files/constants/only-office.js.map +1 -1
  16. package/server/applications/files/files.config.js +5 -0
  17. package/server/applications/files/files.config.js.map +1 -1
  18. package/server/applications/files/guards/files-only-office.strategy.js +0 -1
  19. package/server/applications/files/guards/files-only-office.strategy.js.map +1 -1
  20. package/server/applications/spaces/guards/space.guard.spec.js +153 -18
  21. package/server/applications/spaces/guards/space.guard.spec.js.map +1 -1
  22. package/server/applications/spaces/services/spaces-browser.service.js +7 -7
  23. package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
  24. package/server/applications/spaces/services/spaces-manager.service.js +17 -17
  25. package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
  26. package/server/applications/sync/schemas/sync-clients.schema.js +4 -4
  27. package/server/applications/sync/schemas/sync-clients.schema.js.map +1 -1
  28. package/server/applications/sync/utils/routes.js +1 -1
  29. package/server/applications/sync/utils/routes.js.map +1 -1
  30. package/server/applications/users/guards/permissions.guard.js +4 -4
  31. package/server/applications/users/guards/permissions.guard.js.map +1 -1
  32. package/server/applications/users/guards/permissions.guard.spec.js +6 -6
  33. package/server/applications/users/guards/permissions.guard.spec.js.map +1 -1
  34. package/server/applications/users/guards/roles.guard.js +1 -1
  35. package/server/applications/users/guards/roles.guard.js.map +1 -1
  36. package/server/applications/users/models/user.model.js +1 -1
  37. package/server/applications/users/models/user.model.js.map +1 -1
  38. package/server/applications/users/schemas/users.schema.js +4 -4
  39. package/server/applications/users/schemas/users.schema.js.map +1 -1
  40. package/server/authentication/guards/auth-basic.guard.spec.js +38 -2
  41. package/server/authentication/guards/auth-basic.guard.spec.js.map +1 -1
  42. package/server/authentication/guards/auth-basic.strategy.js +0 -1
  43. package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
  44. package/server/authentication/guards/auth-local.guard.spec.js +7 -5
  45. package/server/authentication/guards/auth-local.guard.spec.js.map +1 -1
  46. package/server/authentication/guards/auth-local.strategy.js +0 -1
  47. package/server/authentication/guards/auth-local.strategy.js.map +1 -1
  48. package/server/authentication/guards/auth-token-access.guard.spec.js +30 -0
  49. package/server/authentication/guards/auth-token-access.guard.spec.js.map +1 -1
  50. package/server/authentication/guards/auth-token-access.strategy.js +0 -1
  51. package/server/authentication/guards/auth-token-access.strategy.js.map +1 -1
  52. package/server/authentication/guards/auth-token-refresh.strategy.js +0 -1
  53. package/server/authentication/guards/auth-token-refresh.strategy.js.map +1 -1
  54. package/server/authentication/services/auth-methods/auth-method-database.service.js +1 -1
  55. package/server/authentication/services/auth-methods/auth-method-database.service.js.map +1 -1
  56. package/server/authentication/services/auth-methods/auth-method-database.service.spec.js +8 -6
  57. package/server/authentication/services/auth-methods/auth-method-database.service.spec.js.map +1 -1
  58. package/server/authentication/services/auth-methods/auth-method-ldap.service.js +2 -2
  59. package/server/authentication/services/auth-methods/auth-method-ldap.service.js.map +1 -1
  60. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js +500 -5
  61. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js.map +1 -1
  62. package/server/configuration/config.constants.js +0 -4
  63. package/server/configuration/config.constants.js.map +1 -1
  64. package/server/configuration/config.loader.js +2 -5
  65. package/server/configuration/config.loader.js.map +1 -1
  66. package/server/infrastructure/context/services/context-manager.service.spec.js +98 -0
  67. package/server/infrastructure/context/services/context-manager.service.spec.js.map +1 -0
  68. package/server/infrastructure/database/configuration.js +1 -1
  69. package/server/infrastructure/database/configuration.js.map +1 -1
  70. package/server/infrastructure/database/constants.js +18 -5
  71. package/server/infrastructure/database/constants.js.map +1 -1
  72. package/server/infrastructure/database/scripts/seed/usersgroups.js +3 -3
  73. package/server/infrastructure/database/scripts/seed/usersgroups.js.map +1 -1
  74. package/server/infrastructure/mailer/mailer.service.js +20 -19
  75. package/server/infrastructure/mailer/mailer.service.js.map +1 -1
  76. package/server/infrastructure/mailer/mailer.service.spec.js +176 -0
  77. package/server/infrastructure/mailer/mailer.service.spec.js.map +1 -0
  78. package/static/{chunk-EVYNK2XG.js → chunk-3GC2BQZD.js} +1 -1
  79. package/static/{chunk-XN4TXQKE.js → chunk-5YKWZT33.js} +1 -1
  80. package/static/{chunk-VSBD6246.js → chunk-6F55D74O.js} +1 -1
  81. package/static/{chunk-MWPC5XQW.js → chunk-B2Y2RNFP.js} +1 -1
  82. package/static/{chunk-YTROXGRM.js → chunk-C23BPTJZ.js} +1 -1
  83. package/static/chunk-DGVNNICG.js +1 -0
  84. package/static/{chunk-WSVE6EWB.js → chunk-FQ4AFNGE.js} +1 -1
  85. package/static/{chunk-4YWOE6HM.js → chunk-GBCYYDCI.js} +1 -1
  86. package/static/{chunk-Z6S7RFGN.js → chunk-HZA7R43P.js} +1 -1
  87. package/static/{chunk-VO5W2VKC.js → chunk-KZQCFEPT.js} +1 -1
  88. package/static/{chunk-BLRDUWOI.js → chunk-LJIGRUEF.js} +1 -1
  89. package/static/chunk-MOVWEZ7J.js +1 -0
  90. package/static/{chunk-3UFSZ24R.js → chunk-MTRNPGS4.js} +1 -1
  91. package/static/{chunk-JM5PB2NQ.js → chunk-N2LYWNTC.js} +1 -1
  92. package/static/{chunk-L4F2K2VQ.js → chunk-PF4K7MVG.js} +1 -1
  93. package/static/{chunk-F2KKCIDO.js → chunk-PY3BGNJN.js} +1 -1
  94. package/static/chunk-RSNLYAN6.js +560 -0
  95. package/static/{chunk-VCXIQZT4.js → chunk-SH5EVL4E.js} +4 -4
  96. package/static/{chunk-BEJ62KA7.js → chunk-T55FAU2O.js} +1 -1
  97. package/static/{chunk-BEC2WQVF.js → chunk-TCFKH6K6.js} +1 -1
  98. package/static/{chunk-LATG3ZVP.js → chunk-TDQAEVZN.js} +1 -1
  99. package/static/{chunk-FNO4KAYG.js → chunk-TNW2CGK6.js} +1 -1
  100. package/static/{chunk-OWYD7F64.js → chunk-TTQ37MUV.js} +1 -1
  101. package/static/chunk-TXPODW5Q.js +7 -0
  102. package/static/chunk-VHYIXL7R.js +4 -0
  103. package/static/{chunk-UEN7RH33.js → chunk-VMQMD36Z.js} +1 -1
  104. package/static/{chunk-6E5YHOWA.js → chunk-VMUOUCEI.js} +1 -1
  105. package/static/{chunk-I6ACCGIM.js → chunk-W3QXNDI5.js} +1 -1
  106. package/static/chunk-WHMS3PJ3.js +24 -0
  107. package/static/{chunk-3PB73RWL.js → chunk-WWIC7UW3.js} +1 -1
  108. package/static/{chunk-6A5R4OPV.js → chunk-X43VWRFP.js} +1 -1
  109. package/static/chunk-XE5YHU5J.js +1 -0
  110. package/static/chunk-Y2CDUS4J.js +4 -0
  111. package/static/chunk-YCINY2YI.js +1 -0
  112. package/static/index.html +2 -2
  113. package/static/main-7LDKYVXO.js +10 -0
  114. package/static/{polyfills-GNKGQMRJ.js → polyfills-IA5XWQYN.js} +1 -1
  115. package/static/{scripts-263WP5VB.js → scripts-VZVAP2P4.js} +4 -4
  116. package/static/styles-FYUSO6OJ.css +1 -0
  117. package/sync-in-server.js +1 -1
  118. package/static/chunk-CIGVDQPA.js +0 -1
  119. package/static/chunk-CY3GGCEX.js +0 -7
  120. package/static/chunk-DJRILQTU.js +0 -1
  121. package/static/chunk-EDLO4Y5E.js +0 -4
  122. package/static/chunk-ENDRPUCI.js +0 -4
  123. package/static/chunk-HXRRMHEX.js +0 -1
  124. package/static/chunk-IJDFKCZM.js +0 -24
  125. package/static/chunk-J6YSVODR.js +0 -1
  126. package/static/chunk-JQOMI5VI.js +0 -560
  127. package/static/main-7LVJ2JSP.js +0 -10
  128. package/static/styles-3DONJ2Z4.css +0 -1
@@ -1 +1 @@
1
- import{x as xe,z as Se}from"./chunk-IJDFKCZM.js";import{a as be}from"./chunk-6A5R4OPV.js";import{h as ge}from"./chunk-ENDRPUCI.js";import{g as Ce}from"./chunk-CIGVDQPA.js";import{g as fe,h as _e}from"./chunk-DJRILQTU.js";import{Da as ce,Ib as de,Kb as ue,Qb as he,Xa as pe,bb as y,v as te,w as ie,xb as me,ya as le}from"./chunk-EDLO4Y5E.js";import{Cb as h,Eb as l,Ed as Z,Fd as ee,Ga as V,Gc as Q,Gf as re,Ib as $,Jb as L,Kb as W,L as j,Ma as s,Nb as I,Ob as M,Pb as d,Qa as N,Qb as g,Tb as K,Ub as H,Vb as X,Xa as R,Xb as k,Za as U,Zc as F,bb as P,bf as ne,dc as C,ec as q,ed as z,f as A,fc as x,ha as f,jb as _,jd as Y,kb as b,kf as oe,ma as S,na as v,nb as T,ob as w,of as ae,pb as p,qb as r,rb as c,sb as m,vf as se,wd as G,ya as B,yd as J,zb as E}from"./chunk-JQOMI5VI.js";import{a as O,b as D}from"./chunk-RTRJ3KFH.js";var ye=(()=>{let a=class a{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new P(!0),this.renamingInProgress=new P(!0),this.elementRef=f(B),this.renderer=f(N),this.dangerColor="#dd4b39",this.primaryColor="#3c8dbc"}ngOnInit(){this.initStyles(),this.renamingInProgress.emit(!0),this.elementRef.nativeElement.value=this.inputObject[this.inputField],setTimeout(()=>{this.setParentDraggable("false"),this.disableFocus||(this.elementRef.nativeElement.focus(),this.elementRef.nativeElement.select())},5)}onBlur(){this.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||(this.elementRef.nativeElement.value?this.elementRef.nativeElement.value===this.inputObject[this.inputField]?(this.setCorrectForm(),this.disableEdit()):(this.setCorrectForm(),this.updateObject.next({object:this.inputObject,name:this.elementRef.nativeElement.value}),this.disableEdit()):this.setIncorrectForm())}onEscape(){this.disableKeyboard||this.disableEdit()}initStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"display","inline"),this.renderer.setStyle(this.elementRef.nativeElement,"height","100%"),this.renderer.setStyle(this.elementRef.nativeElement,"min-height","20px"),this.renderer.addClass(this.elementRef.nativeElement,"form-control"),this.renderer.addClass(this.elementRef.nativeElement,"form-control-sm"),this.textCenter?(this.renderer.addClass(this.elementRef.nativeElement,"text-center"),this.renderer.setStyle(this.elementRef.nativeElement,"padding","0")):this.renderer.setStyle(this.elementRef.nativeElement,"padding","2px"),this.fullWidth?this.renderer.addClass(this.elementRef.nativeElement,"w-100"):this.renderer.addClass(this.elementRef.nativeElement,"w-75")}setIncorrectForm(){this.renderer.addClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.dangerColor)}setCorrectForm(){this.renderer.removeClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.primaryColor)}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(e){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",e)}};a.\u0275fac=function(t){return new(t||a)},a.\u0275dir=U({type:a,selectors:[["","appInputEdit",""]],hostBindings:function(t,o){t&1&&h("blur",function(){return o.onBlur()})("keyup.enter",function(){return o.onEnter()})("keyup.esc",function(){return o.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=a;return i})();var Ee=["InputRename"],Fe=(i,a)=>a.alias,Pe=(i,a)=>a.key;function Te(i,a){if(i&1&&m(0,"app-user-avatar",15)(1,"div",10),i&2){let n=l().$implicit;p("user",n.owner)}}function we(i,a){if(i&1){let n=E();r(0,"input",16,0),h("updateObject",function(t){S(n);let o=l(2);return v(o.onRenameRoot(t))}),c()}if(i&2){let n=l().$implicit;p("inputObject",n)("fullWidth",!0)}}function Ie(i,a){if(i&1&&(r(0,"span"),d(1),c()),i&2){let n=l(2).$implicit;s(),g(n.externalPath)}}function Me(i,a){if(i&1&&(r(0,"span"),d(1),C(2,"pathSlice"),c()),i&2){let n=l(2).$implicit;s(),g(x(2,1,n.file.path,-2))}}function ke(i,a){if(i&1&&(r(0,"div",17)(1,"span"),d(2),c()(),r(3,"div",18),_(4,Ie,2,1,"span")(5,Me,3,4,"span"),c()),i&2){let n=l().$implicit,e=l();s(2),g(n.name),s(2),b(e.user.isAdmin&&n.externalPath?4:5)}}function Oe(i,a){if(i&1){let n=E();r(0,"button",21),C(1,"translate"),X("ngModelChange",function(t){S(n);let o=l().$implicit,u=l().$implicit;return H(u.hPerms[o.key],t)||(u.hPerms[o.key]=t),v(t)}),h("ngModelChange",function(){S(n);let t=l(2).$implicit,o=l();return v(o.onPermissionChange(t))}),m(2,"fa-icon",22),c()}if(i&2){let n=l().$implicit,e=l().$implicit,t=l();M(k("btn btn-sm btn-custom ",!e.isDir&&(n.key==="a"||n.key==="d")?"disabled":"")),K("ngModel",e.hPerms[n.key]),p("tooltip",x(1,6,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function De(i,a){if(i&1&&(r(0,"button",23),C(1,"translate"),m(2,"fa-icon",22),c()),i&2){let n=l().$implicit,e=l().$implicit,t=l();I("active",e.hPerms[n.key]),p("tooltip",x(1,4,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function Ae(i,a){if(i&1&&_(0,Oe,3,9,"button",19)(1,De,3,7,"button",20),i&2){let n=l().$implicit,e=l();b(!(n.owner!=null&&n.owner.id)&&e.user.isAdmin||(n.owner==null?null:n.owner.id)===e.user.id?0:1)}}function je(i,a){if(i&1){let n=E();r(0,"div",1)(1,"div",2)(2,"div",3),_(3,Te,2,1),m(4,"img",4),r(5,"div",5),_(6,we,2,2,"input",6)(7,ke,6,2),c()(),r(8,"div",7)(9,"div",8),d(10),c(),r(11,"div",8),d(12),C(13,"amTimeAgo"),c()(),r(14,"div",9),m(15,"div",10),T(16,Ae,2,1,null,null,Pe),C(18,"keyvalue"),m(19,"div",11),r(20,"button",12),C(21,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.setRenamed(t))}),m(22,"fa-icon",13),c(),r(23,"button",14),C(24,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.removeRoot(t))}),m(25,"fa-icon",13),c()()()()}if(i&2){let n=a.$implicit,e=l();s(3),b(e.showUsers?3:-1),s(),I("cursor-pointer",!!n.file.path),p("src",n.file.mimeUrl,V)("tooltip",n.file.path),s(2),b(n.isRenamed?6:7),s(4),g(n.alias),s(2),g(q(13,15,n.createdAt)),s(4),w(x(18,17,n.hPerms,e.originalOrderKeyValue)),s(4),M(k("btn btn-sm ",n.isRenamed?"btn-success":"btn-custom"," me-2")),p("tooltip",x(21,20,"Rename",e.locale.language)),s(2),p("icon",e.icons.faPen),s(),p("tooltip",x(24,23,"Remove",e.locale.language)),s(2),p("icon",e.icons.faTimes)}}var Re=(()=>{let a=class a{constructor(){this.showUsers=!0,this.addRootFile=null,this.locale=f(J),this.icons={faTimes:oe,faPen:ae},this.SPACES_PERMISSIONS_TEXT=ue,this.originalOrderKeyValue=pe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(e=>this.addRoot(e)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(e){let t={id:0,alias:y(e.name,"alias",this.space.roots).toLowerCase(),name:y(e.name,"name",this.space.roots),permissions:"",createdAt:new Date};e.externalPath?(t.externalPath=e.externalPath,t.owner={id:null,login:null,email:null,fullName:null},t.file={id:0,path:null,mime:null}):(t.externalPath=null,t.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},t.file={id:e.id,path:e.path,mime:e.mime}),this.space.addRoot(t,!0)}removeRoot(e){this.space.roots=this.space.roots.filter(t=>e.alias!==t.alias)}onRenameRoot(e){let t=e.object;t.alias=y(ce(e.name,!0),"alias",this.space.roots.filter(o=>o.id!==t.id)).toLowerCase(),t.name=y(e.name.replace(le,""),"name",this.space.roots.filter(o=>o.id!==t.id))}onPermissionChange(e){e.permissions=he(e.hPerms)}setRenamed(e){e.isRenamed?(this.onRenameRoot({object:e,name:this.inputRename.nativeElement.value}),e.isRenamed=!1):e.isRenamed=!0}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,selectors:[["app-space-manage-roots"]],viewQuery:function(t,o){if(t&1&&$(Ee,5),t&2){let u;L(u=W())&&(o.inputRename=u.first)}},inputs:{space:"space",user:"user",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-xs",2,"height","32px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","30","width","30","alt","",3,"src","tooltip"],[1,"d-flex","flex-column","text-truncate","ms-2"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","justify-content-end"],[1,"d-flex","no-select"],[1,"vr","mx-2"],[1,"vr","ms-1","me-2"],["type","button",3,"click","tooltip"],[3,"icon"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],["tooltipPlacement","bottom",3,"user"],["appInputEdit","","type","text","required","",3,"updateObject","inputObject","fullWidth"],[1,"text-truncate"],[1,"d-none","d-lg-block","fs-xxxs","text-truncate"],["btnCheckbox","","type","button",3,"ngModel","tooltip","class"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip","active"],["btnCheckbox","","type","button",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip"]],template:function(t,o){t&1&&T(0,je,26,26,"div",1,Fe),t&2&&w(o.space.roots)},dependencies:[_e,fe,F,be,ie,te,G,z,Y,ye,Q,Z,ge,xe],encapsulation:2});let i=a;return i})();function Be(i,a){if(i&1&&m(0,"fa-icon",3),i&2){let n=l();p("icon",n.icons.faSpinner)}}function Ve(i,a){i&1&&(r(0,"span",5),d(1,"You have no files anchored on this space"),c())}var Pt=(()=>{let a=class a{constructor(){this.layout=f(me),this.addRootFileEvent=new A,this.icons={faAnchor:se,faPlus:re,faSpinner:ne,SPACES:de.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=f(Ce)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:e=>this.setSpaceRoots(e),error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Se,"xl",{initialState:{currentRoots:this.space.roots.filter(t=>t.owner.id===this.user.id)}}).content.submitEvent.pipe(j(1)).subscribe(t=>this.addRootFileEvent.next(t))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(e=>({id:e.id,alias:e.alias,name:e.name,permissions:e.permissions,file:{id:e.file.id,path:e.file.path,mime:e.file.mime}}))).subscribe({next:e=>{this.setSpaceRoots(e),this.layout.closeDialog()},error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(e){this.space.roots=[];for(let t of e)this.space.addRoot(D(O({},t),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,selectors:[["app-space-user-anchors-dialog"]],inputs:{space:"space",user:"user"},decls:22,vars:11,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[3,"space","user","showUsers","addRootFile"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],[3,"icon"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"h4",1),m(2,"fa-icon",2),r(3,"span"),d(4),c()(),_(5,Be,1,1,"fa-icon",3),r(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),c()(),r(9,"button",6),h("click",function(){return o.layout.closeDialog()}),c()(),r(10,"div",7),m(11,"app-space-manage-roots",8),_(12,Ve,2,0,"span",5),c(),r(13,"div",9)(14,"button",10),h("click",function(){return o.openSelectRootDialog()}),m(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),c(),r(18,"button",12),h("click",function(){return o.layout.closeDialog()}),d(19,"Cancel"),c(),r(20,"button",13),h("click",function(){return o.onSubmit()}),d(21," Confirm "),c()()),t&2&&(s(2),p("icon",o.icons.SPACES),s(2),g(o.space.name),s(),b(o.loading?5:-1),s(6),p("space",o.space)("user",o.user)("showUsers",!1)("addRootFile",o.addRootFileEvent),s(),b(o.space.roots.length?-1:12),s(3),p("icon",o.icons.faPlus),s(),p("icon",o.icons.faAnchor),s(4),p("disabled",o.submitted))},dependencies:[F,ee,Re],encapsulation:2});let i=a;return i})();export{ye as a,Re as b,Pt as c};
1
+ import{x as xe,z as Se}from"./chunk-WHMS3PJ3.js";import{a as be}from"./chunk-X43VWRFP.js";import{h as ge}from"./chunk-VHYIXL7R.js";import{g as Ce}from"./chunk-YCINY2YI.js";import{g as fe,h as _e}from"./chunk-MOVWEZ7J.js";import{Da as ce,Hb as de,Jb as ue,Pb as he,Xa as pe,bb as y,v as te,w as ie,wb as me,ya as le}from"./chunk-Y2CDUS4J.js";import{Cb as h,Eb as l,Ed as Z,Fd as ee,Ga as V,Gc as Q,Gf as re,Ib as $,Jb as L,Kb as W,L as j,Ma as s,Nb as I,Ob as M,Pb as d,Qa as N,Qb as g,Tb as K,Ub as H,Vb as X,Xa as R,Xb as k,Za as U,Zc as F,bb as P,bf as ne,dc as C,ec as q,ed as z,f as A,fc as x,ha as f,jb as _,jd as Y,kb as b,kf as oe,ma as S,na as v,nb as T,ob as w,of as ae,pb as p,qb as r,rb as c,sb as m,vf as se,wd as G,ya as B,yd as J,zb as E}from"./chunk-RSNLYAN6.js";import{a as O,b as D}from"./chunk-RTRJ3KFH.js";var ye=(()=>{let a=class a{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new P(!0),this.renamingInProgress=new P(!0),this.elementRef=f(B),this.renderer=f(N),this.dangerColor="#dd4b39",this.primaryColor="#3c8dbc"}ngOnInit(){this.initStyles(),this.renamingInProgress.emit(!0),this.elementRef.nativeElement.value=this.inputObject[this.inputField],setTimeout(()=>{this.setParentDraggable("false"),this.disableFocus||(this.elementRef.nativeElement.focus(),this.elementRef.nativeElement.select())},5)}onBlur(){this.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||(this.elementRef.nativeElement.value?this.elementRef.nativeElement.value===this.inputObject[this.inputField]?(this.setCorrectForm(),this.disableEdit()):(this.setCorrectForm(),this.updateObject.next({object:this.inputObject,name:this.elementRef.nativeElement.value}),this.disableEdit()):this.setIncorrectForm())}onEscape(){this.disableKeyboard||this.disableEdit()}initStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"display","inline"),this.renderer.setStyle(this.elementRef.nativeElement,"height","100%"),this.renderer.setStyle(this.elementRef.nativeElement,"min-height","20px"),this.renderer.addClass(this.elementRef.nativeElement,"form-control"),this.renderer.addClass(this.elementRef.nativeElement,"form-control-sm"),this.textCenter?(this.renderer.addClass(this.elementRef.nativeElement,"text-center"),this.renderer.setStyle(this.elementRef.nativeElement,"padding","0")):this.renderer.setStyle(this.elementRef.nativeElement,"padding","2px"),this.fullWidth?this.renderer.addClass(this.elementRef.nativeElement,"w-100"):this.renderer.addClass(this.elementRef.nativeElement,"w-75")}setIncorrectForm(){this.renderer.addClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.dangerColor)}setCorrectForm(){this.renderer.removeClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.primaryColor)}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(e){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",e)}};a.\u0275fac=function(t){return new(t||a)},a.\u0275dir=U({type:a,selectors:[["","appInputEdit",""]],hostBindings:function(t,o){t&1&&h("blur",function(){return o.onBlur()})("keyup.enter",function(){return o.onEnter()})("keyup.esc",function(){return o.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=a;return i})();var Ee=["InputRename"],Fe=(i,a)=>a.alias,Pe=(i,a)=>a.key;function Te(i,a){if(i&1&&m(0,"app-user-avatar",15)(1,"div",10),i&2){let n=l().$implicit;p("user",n.owner)}}function we(i,a){if(i&1){let n=E();r(0,"input",16,0),h("updateObject",function(t){S(n);let o=l(2);return v(o.onRenameRoot(t))}),c()}if(i&2){let n=l().$implicit;p("inputObject",n)("fullWidth",!0)}}function Ie(i,a){if(i&1&&(r(0,"span"),d(1),c()),i&2){let n=l(2).$implicit;s(),g(n.externalPath)}}function Me(i,a){if(i&1&&(r(0,"span"),d(1),C(2,"pathSlice"),c()),i&2){let n=l(2).$implicit;s(),g(x(2,1,n.file.path,-2))}}function ke(i,a){if(i&1&&(r(0,"div",17)(1,"span"),d(2),c()(),r(3,"div",18),_(4,Ie,2,1,"span")(5,Me,3,4,"span"),c()),i&2){let n=l().$implicit,e=l();s(2),g(n.name),s(2),b(e.user.isAdmin&&n.externalPath?4:5)}}function Oe(i,a){if(i&1){let n=E();r(0,"button",21),C(1,"translate"),X("ngModelChange",function(t){S(n);let o=l().$implicit,u=l().$implicit;return H(u.hPerms[o.key],t)||(u.hPerms[o.key]=t),v(t)}),h("ngModelChange",function(){S(n);let t=l(2).$implicit,o=l();return v(o.onPermissionChange(t))}),m(2,"fa-icon",22),c()}if(i&2){let n=l().$implicit,e=l().$implicit,t=l();M(k("btn btn-sm btn-custom ",!e.isDir&&(n.key==="a"||n.key==="d")?"disabled":"")),K("ngModel",e.hPerms[n.key]),p("tooltip",x(1,6,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function De(i,a){if(i&1&&(r(0,"button",23),C(1,"translate"),m(2,"fa-icon",22),c()),i&2){let n=l().$implicit,e=l().$implicit,t=l();I("active",e.hPerms[n.key]),p("tooltip",x(1,4,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function Ae(i,a){if(i&1&&_(0,Oe,3,9,"button",19)(1,De,3,7,"button",20),i&2){let n=l().$implicit,e=l();b(!(n.owner!=null&&n.owner.id)&&e.user.isAdmin||(n.owner==null?null:n.owner.id)===e.user.id?0:1)}}function je(i,a){if(i&1){let n=E();r(0,"div",1)(1,"div",2)(2,"div",3),_(3,Te,2,1),m(4,"img",4),r(5,"div",5),_(6,we,2,2,"input",6)(7,ke,6,2),c()(),r(8,"div",7)(9,"div",8),d(10),c(),r(11,"div",8),d(12),C(13,"amTimeAgo"),c()(),r(14,"div",9),m(15,"div",10),T(16,Ae,2,1,null,null,Pe),C(18,"keyvalue"),m(19,"div",11),r(20,"button",12),C(21,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.setRenamed(t))}),m(22,"fa-icon",13),c(),r(23,"button",14),C(24,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.removeRoot(t))}),m(25,"fa-icon",13),c()()()()}if(i&2){let n=a.$implicit,e=l();s(3),b(e.showUsers?3:-1),s(),I("cursor-pointer",!!n.file.path),p("src",n.file.mimeUrl,V)("tooltip",n.file.path),s(2),b(n.isRenamed?6:7),s(4),g(n.alias),s(2),g(q(13,15,n.createdAt)),s(4),w(x(18,17,n.hPerms,e.originalOrderKeyValue)),s(4),M(k("btn btn-sm ",n.isRenamed?"btn-success":"btn-custom"," me-2")),p("tooltip",x(21,20,"Rename",e.locale.language)),s(2),p("icon",e.icons.faPen),s(),p("tooltip",x(24,23,"Remove",e.locale.language)),s(2),p("icon",e.icons.faTimes)}}var Re=(()=>{let a=class a{constructor(){this.showUsers=!0,this.addRootFile=null,this.locale=f(J),this.icons={faTimes:oe,faPen:ae},this.SPACES_PERMISSIONS_TEXT=ue,this.originalOrderKeyValue=pe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(e=>this.addRoot(e)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(e){let t={id:0,alias:y(e.name,"alias",this.space.roots).toLowerCase(),name:y(e.name,"name",this.space.roots),permissions:"",createdAt:new Date};e.externalPath?(t.externalPath=e.externalPath,t.owner={id:null,login:null,email:null,fullName:null},t.file={id:0,path:null,mime:null}):(t.externalPath=null,t.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},t.file={id:e.id,path:e.path,mime:e.mime}),this.space.addRoot(t,!0)}removeRoot(e){this.space.roots=this.space.roots.filter(t=>e.alias!==t.alias)}onRenameRoot(e){let t=e.object;t.alias=y(ce(e.name,!0),"alias",this.space.roots.filter(o=>o.id!==t.id)).toLowerCase(),t.name=y(e.name.replace(le,""),"name",this.space.roots.filter(o=>o.id!==t.id))}onPermissionChange(e){e.permissions=he(e.hPerms)}setRenamed(e){e.isRenamed?(this.onRenameRoot({object:e,name:this.inputRename.nativeElement.value}),e.isRenamed=!1):e.isRenamed=!0}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,selectors:[["app-space-manage-roots"]],viewQuery:function(t,o){if(t&1&&$(Ee,5),t&2){let u;L(u=W())&&(o.inputRename=u.first)}},inputs:{space:"space",user:"user",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-xs",2,"height","32px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","30","width","30","alt","",3,"src","tooltip"],[1,"d-flex","flex-column","text-truncate","ms-2"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","justify-content-end"],[1,"d-flex","no-select"],[1,"vr","mx-2"],[1,"vr","ms-1","me-2"],["type","button",3,"click","tooltip"],[3,"icon"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],["tooltipPlacement","bottom",3,"user"],["appInputEdit","","type","text","required","",3,"updateObject","inputObject","fullWidth"],[1,"text-truncate"],[1,"d-none","d-lg-block","fs-xxxs","text-truncate"],["btnCheckbox","","type","button",3,"ngModel","tooltip","class"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip","active"],["btnCheckbox","","type","button",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip"]],template:function(t,o){t&1&&T(0,je,26,26,"div",1,Fe),t&2&&w(o.space.roots)},dependencies:[_e,fe,F,be,ie,te,G,z,Y,ye,Q,Z,ge,xe],encapsulation:2});let i=a;return i})();function Be(i,a){if(i&1&&m(0,"fa-icon",3),i&2){let n=l();p("icon",n.icons.faSpinner)}}function Ve(i,a){i&1&&(r(0,"span",5),d(1,"You have no files anchored on this space"),c())}var Pt=(()=>{let a=class a{constructor(){this.layout=f(me),this.addRootFileEvent=new A,this.icons={faAnchor:se,faPlus:re,faSpinner:ne,SPACES:de.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=f(Ce)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:e=>this.setSpaceRoots(e),error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Se,"xl",{initialState:{currentRoots:this.space.roots.filter(t=>t.owner.id===this.user.id)}}).content.submitEvent.pipe(j(1)).subscribe(t=>this.addRootFileEvent.next(t))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(e=>({id:e.id,alias:e.alias,name:e.name,permissions:e.permissions,file:{id:e.file.id,path:e.file.path,mime:e.file.mime}}))).subscribe({next:e=>{this.setSpaceRoots(e),this.layout.closeDialog()},error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(e){this.space.roots=[];for(let t of e)this.space.addRoot(D(O({},t),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,selectors:[["app-space-user-anchors-dialog"]],inputs:{space:"space",user:"user"},decls:22,vars:11,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[3,"space","user","showUsers","addRootFile"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],[3,"icon"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"h4",1),m(2,"fa-icon",2),r(3,"span"),d(4),c()(),_(5,Be,1,1,"fa-icon",3),r(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),c()(),r(9,"button",6),h("click",function(){return o.layout.closeDialog()}),c()(),r(10,"div",7),m(11,"app-space-manage-roots",8),_(12,Ve,2,0,"span",5),c(),r(13,"div",9)(14,"button",10),h("click",function(){return o.openSelectRootDialog()}),m(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),c(),r(18,"button",12),h("click",function(){return o.layout.closeDialog()}),d(19,"Cancel"),c(),r(20,"button",13),h("click",function(){return o.onSubmit()}),d(21," Confirm "),c()()),t&2&&(s(2),p("icon",o.icons.SPACES),s(2),g(o.space.name),s(),b(o.loading?5:-1),s(6),p("space",o.space)("user",o.user)("showUsers",!1)("addRootFile",o.addRootFileEvent),s(),b(o.space.roots.length?-1:12),s(3),p("icon",o.icons.faPlus),s(),p("icon",o.icons.faAnchor),s(4),p("disabled",o.submitted))},dependencies:[F,ee,Re],encapsulation:2});let i=a;return i})();export{ye as a,Re as b,Pt as c};
@@ -1 +1 @@
1
- import{a as z}from"./chunk-FNO4KAYG.js";import"./chunk-Z6S7RFGN.js";import{a as L,b as Q,c as xe,d as Ce}from"./chunk-XN4TXQKE.js";import{g as he}from"./chunk-CIGVDQPA.js";import{B as ee,Hb as ue,Ib as $,Ja as se,Jb as O,Qa as ce,Xa as pe,kb as _e,ob as me,pa as re,qa as ae,ra as le,v as Y,w as Z,xb as de}from"./chunk-EDLO4Y5E.js";import"./chunk-ZZ3LHYOY.js";import{d as W}from"./chunk-J6YSVODR.js";import{Cb as x,Eb as a,Ed as G,Fd as X,Gc as U,Ib as b,If as ie,Jb as V,Kb as M,Ma as l,Mb as g,Nb as E,Ob as N,Pb as d,Qb as B,Rb as v,Sb as q,Ue as te,Uf as ne,Xa as H,Yb as K,Zc as j,Zf as oe,ab as k,dc as f,fc as T,ha as S,ib as D,jb as C,kb as h,ma as _,na as m,nb as P,ob as F,pb as u,qb as s,rb as p,sb as w,yd as J,zb as y}from"./chunk-JQOMI5VI.js";import"./chunk-RTRJ3KFH.js";var I=class{constructor(r){this.newly=0,this.isPersonal=!1,Object.assign(this,r),this.isPersonal=this.alias===me.PERSONAL,this.hTimeAgo=(0,ee.default)(this.mtime).fromNow(!0),this.newly=ce(this.mtime)}};var we=["MainContextMenu"],ge=["TargetContextMenu"],fe=(t,r)=>r.id,Te=(t,r)=>r.key;function ye(t,r){if(t&1&&(s(0,"span",25),d(1),p()),t&2){let e=a().$implicit,i=a(2);g("font-size",i.galleryMode.textSize,"px"),l(),B(e.hTimeAgo)}}function ve(t,r){if(t&1&&(d(0),f(1,"translate")),t&2){let e=a().$implicit,i=a(2);v(" ",T(1,1,e.name,i.locale.language)," ")}}function Se(t,r){if(t&1&&d(0),t&2){let e=a().$implicit;v(" ",e.name," ")}}function be(t,r){if(t&1){let e=y();s(0,"div",16),x("click",function(){let n=_(e).$implicit,o=a(2);return m(o.onSelect(n))})("contextmenu",function(n){let o=_(e).$implicit,c=a(2);return m(c.onTargetContextMenu(n,o))})("pressup",function(n){let o=_(e).$implicit,c=a(2);return m(c.onTargetContextMenu(n,o))})("tap",function(){let n=_(e).$implicit,o=a(2);return m(o.browse(n))}),s(1,"div",17),w(2,"fa-icon",18),s(3,"span",19),C(4,ye,2,3,"span",20),p(),s(5,"span",21)(6,"span",22),d(7),p()()(),s(8,"div",23)(9,"span",24),C(10,ve,2,4)(11,Se,1,1),p()()()}if(t&2){let e=r.$implicit,i=r.$index,n=a(2);g("height",n.galleryMode.dimensions,"px")("width",n.galleryMode.dimensions,"px"),E("selected",e.id===(n.selected==null?null:n.selected.id)),l(),D("rowIndex",i),l(),g("min-width",n.galleryMode.image,"px")("min-height",n.galleryMode.image,"px")("font-size",n.galleryMode.faSize,"px"),u("icon",e.isPersonal?n.icons.PERSONAL:n.icons.SPACES),l(2),h(e.newly?4:-1),l(2),g("font-size",n.galleryMode.textSize,"px"),l(),B(e.nb),l(2),g("font-size",n.galleryMode.textSize,"px"),l(),h(e.isPersonal?10:11)}}function Ve(t,r){if(t&1){let e=y();s(0,"div",9)(1,"app-virtual-scroll",13),f(2,"searchFilter"),x("contextmenu",function(n){_(e);let o=a();return m(o.onContextMenu(n))}),s(3,"div",14),P(4,be,12,21,"div",15,fe),p()()()}if(t&2){let e=a();l(),u("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",T(2,5,e.trashBins,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),l(3),F(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Me(t,r){if(t&1&&w(0,"fa-icon",32),t&2){let e=a(4);u("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Pe(t,r){if(t&1){let e=y();s(0,"th",31),x("click",function(){_(e);let n=a().$implicit,o=a(2);return m(o.sortBy(n.key))}),d(1),C(2,Me,1,2,"fa-icon",32),p()}if(t&2){let e=a().$implicit,i=a(2);N(e.value.class),g("width",e.value.width,"%"),E("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),l(),v(" ",e.value.label," "),l(),h(i.sortTable.sortParam.column===e.key?2:-1)}}function Fe(t,r){if(t&1&&C(0,Pe,3,10,"th",30),t&2){let e=r.$implicit;h(e.value.show?0:-1)}}function Ee(t,r){if(t&1&&(d(0),f(1,"translate")),t&2){let e=a(4).$implicit,i=a(2);v(" ",T(1,1,e.name,i.locale.language)," ")}}function Ae(t,r){if(t&1&&d(0),t&2){let e=a(4).$implicit;v(" ",e.name," ")}}function Be(t,r){if(t&1&&(s(0,"div",35),w(1,"fa-icon",18),s(2,"span",24),C(3,Ee,2,4)(4,Ae,1,1),p()()),t&2){let e=a(3).$implicit,i=a(2);l(),u("icon",e.isPersonal?i.icons.PERSONAL:i.icons.SPACES),l(2),h(e.isPersonal?3:4)}}function $e(t,r){if(t&1&&(s(0,"span",22),d(1),p()),t&2){let e=a(3).$implicit;l(),B(e.nb)}}function Ie(t,r){if(t&1&&d(0),t&2){let e=a(3).$implicit;v(" ",e.hTimeAgo," ")}}function Re(t,r){if(t&1&&(s(0,"td"),C(1,Be,5,2,"div",35)(2,$e,2,1,"span",22)(3,Ie,1,1),p()),t&2){let e,i=a().$implicit,n=a().$implicit;N(K("",i.value.class," ",i.value.newly?"prop-newly-"+n[i.value.newly]:"")),g("width",i.value.width,"%"),E("text-align-center",i.value.textCenter),l(),h((e=i.key)==="name"?1:e==="nb"?2:e==="modified"?3:-1)}}function ke(t,r){if(t&1&&C(0,Re,4,9,"td",34),t&2){let e=r.$implicit;h(e.value.show?0:-1)}}function Ne(t,r){if(t&1){let e=y();s(0,"tr",33),x("click",function(){let n=_(e).$implicit,o=a(2);return m(o.onSelect(n))})("contextmenu",function(n){let o=_(e).$implicit,c=a(2);return m(c.onTargetContextMenu(n,o))})("pressup",function(n){let o=_(e).$implicit,c=a(2);return m(c.onTargetContextMenu(n,o))})("tap",function(){let n=_(e).$implicit,o=a(2);return m(o.browse(n))}),P(1,ke,1,1,null,null,Te),f(3,"keyvalue"),p()}if(t&2){let e=r.$implicit,i=a(2);E("selected",e.id===(i.selected==null?null:i.selected.id)),l(),F(T(3,2,i.tableHeaders,i.originalOrderKeyValue))}}function Oe(t,r){if(t&1){let e=y();s(0,"table",26)(1,"thead")(2,"tr"),P(3,Fe,1,1,null,null,Te),f(5,"keyvalue"),p()()(),s(6,"app-virtual-scroll",27),f(7,"searchFilter"),x("contextmenu",function(n){_(e);let o=a();return m(o.onContextMenu(n))}),s(8,"table",26)(9,"tbody",28),P(10,Ne,4,5,"tr",29,fe),p()()()}if(t&2){let e=a();l(3),F(T(5,2,e.tableHeaders,e.originalOrderKeyValue)),l(3),u("bufferAmount",5)("items",T(7,5,e.trashBins,e.inputFilter.search())),l(4),F(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Le(t,r){if(t&1&&(s(0,"span",36),w(1,"fa-icon",37),d(2,"Refresh"),p()),t&2){let e=a();l(),u("icon",e.icons.faArrowRotateRight)}}function Qe(t,r){if(t&1&&(s(0,"span",36),w(1,"fa-icon",37),d(2,"Informations"),p()),t&2){let e=a();l(),u("icon",e.icons.faCircleInfo)}}var Ct=(()=>{let r=class r{constructor(){this.locale=S(J),this.layout=S(de),this.originalOrderKeyValue=pe,this.icons={SPACES:$.SPACES,PERSONAL:$.PERSONAL,faArrowDown:ne,faArrowUp:te,faArrowRotateRight:ie,faCircleInfo:oe},this.TAB_MENU=se,this.loading=!1,this.selected=null,this.trashBins=[],this.tableHeaders={name:{label:"Space",width:50,textCenter:!1,class:"",show:!0,sortable:!0},nb:{label:"Elements",width:10,textCenter:!0,class:"",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",nb:"Elements",mtime:"Modified"},this.router=S(W),this.store=S(_e),this.spacesService=S(he),this.sortSettings={default:[{prop:"isPersonal",type:"number"},{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],nb:[{prop:"nb",type:"number"}],modified:[{prop:"mtime",type:"date"}]},this.sortTable=new Ce(this.constructor.name,this.sortSettings),this.loadTrashBins(),this.layout.setBreadcrumbIcon($.TRASH),this.layout.setBreadcrumbNav({url:`/${O.TRASH}/${ue.TRASH}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadTrashBins(){this.loading=!0,this.onSelect(),this.spacesService.listTrashBins().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i.map(n=>new I(n))),this.loading=!1}})}onSelect(i=null){this.selected=i,this.store.trashSelection.set(this.selected)}sortBy(i,n=!0,o){this.trashBins=this.sortTable.sortBy(i,n,o||this.trashBins)}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,n){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(i,this.targetContextMenu)}browse(i){this.router.navigate([O.SPACES_TRASH,i.alias]).catch(console.error)}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=H({type:r,selectors:[["app-spaces-trash"]],viewQuery:function(n,o){if(n&1&&(b(Q,5),b(L,7),b(z,7),b(we,7),b(ge,7)),n&2){let c;V(c=M())&&(o.scrollView=c.first),V(c=M())&&(o.inputFilter=c.first),V(c=M())&&(o.btnNavigationView=c.first),V(c=M())&&(o.mainContextMenu=c.first),V(c=M())&&(o.targetContextMenu=c.first)}},decls:20,vars:14,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],[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"],["contextMenuItem","",3,"execute"],[1,"app-foot-menu"],[1,"mx-auto"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","height","width"],[1,"card",3,"click","contextmenu","pressup","tap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right"],[1,"badge","rounded-pill","bg-danger"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],["l10nTranslate",""],[3,"icon"]],template:function(n,o){if(n&1){let c=y();s(0,"div",2)(1,"button",3),f(2,"translate"),x("click",function(){return _(c),m(o.loadTrashBins())}),w(3,"fa-icon",4),p(),s(4,"div",5)(5,"div",6),w(6,"app-input-filter",7),p(),s(7,"app-navigation-view",8),x("sortBy",function(R){return _(c),m(o.sortBy(R))})("switchView",function(R){return _(c),m(o.galleryMode=R)}),p()()(),C(8,Ve,6,8,"div",9)(9,Oe,12,8),s(10,"context-menu",null,0),k(12,Le,3,1,"ng-template",10),x("execute",function(){return _(c),m(o.loadTrashBins())}),p(),s(13,"context-menu",null,1),k(15,Qe,3,1,"ng-template",10),x("execute",function(){return _(c),m(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION))}),p(),s(16,"div",11)(17,"span",12),d(18),f(19,"translate"),p()()}n&2&&(l(),u("tooltip",T(2,8,"Refresh",o.locale.language)),l(2),u("icon",o.icons.faArrowRotateRight)("animation",o.loading?"spin":null),l(4),u("sortParams",o.sortTable.sortParam)("sortFields",o.btnSortFields),l(),h(o.galleryMode!=null&&o.galleryMode.enabled?8:9),l(10),q("",o.trashBins.length," ",T(19,11,"trash bins",o.locale.language)))},dependencies:[j,z,L,Z,Y,Q,X,le,ae,re,G,U,xe],encapsulation:2});let t=r;return t})();export{Ct as TrashComponent};
1
+ import{a as z}from"./chunk-TNW2CGK6.js";import"./chunk-HZA7R43P.js";import{a as L,b as Q,c as xe,d as Ce}from"./chunk-5YKWZT33.js";import{g as he}from"./chunk-YCINY2YI.js";import{B as ee,Gb as ue,Hb as $,Ib as O,Ja as se,Qa as ce,Xa as pe,kb as _e,nb as me,pa as re,qa as ae,ra as le,v as Y,w as Z,wb as de}from"./chunk-Y2CDUS4J.js";import"./chunk-ZZ3LHYOY.js";import{d as W}from"./chunk-XE5YHU5J.js";import{Cb as x,Eb as a,Ed as G,Fd as X,Gc as U,Ib as b,If as ie,Jb as V,Kb as M,Ma as l,Mb as g,Nb as E,Ob as N,Pb as d,Qb as B,Rb as v,Sb as q,Ue as te,Uf as ne,Xa as H,Yb as K,Zc as j,Zf as oe,ab as k,dc as f,fc as T,ha as S,ib as D,jb as C,kb as h,ma as _,na as m,nb as P,ob as F,pb as u,qb as s,rb as p,sb as w,yd as J,zb as y}from"./chunk-RSNLYAN6.js";import"./chunk-RTRJ3KFH.js";var I=class{constructor(r){this.newly=0,this.isPersonal=!1,Object.assign(this,r),this.isPersonal=this.alias===me.PERSONAL,this.hTimeAgo=(0,ee.default)(this.mtime).fromNow(!0),this.newly=ce(this.mtime)}};var we=["MainContextMenu"],ge=["TargetContextMenu"],fe=(t,r)=>r.id,Te=(t,r)=>r.key;function ye(t,r){if(t&1&&(s(0,"span",25),d(1),p()),t&2){let e=a().$implicit,i=a(2);g("font-size",i.galleryMode.textSize,"px"),l(),B(e.hTimeAgo)}}function ve(t,r){if(t&1&&(d(0),f(1,"translate")),t&2){let e=a().$implicit,i=a(2);v(" ",T(1,1,e.name,i.locale.language)," ")}}function Se(t,r){if(t&1&&d(0),t&2){let e=a().$implicit;v(" ",e.name," ")}}function be(t,r){if(t&1){let e=y();s(0,"div",16),x("click",function(){let n=_(e).$implicit,o=a(2);return m(o.onSelect(n))})("contextmenu",function(n){let o=_(e).$implicit,c=a(2);return m(c.onTargetContextMenu(n,o))})("pressup",function(n){let o=_(e).$implicit,c=a(2);return m(c.onTargetContextMenu(n,o))})("tap",function(){let n=_(e).$implicit,o=a(2);return m(o.browse(n))}),s(1,"div",17),w(2,"fa-icon",18),s(3,"span",19),C(4,ye,2,3,"span",20),p(),s(5,"span",21)(6,"span",22),d(7),p()()(),s(8,"div",23)(9,"span",24),C(10,ve,2,4)(11,Se,1,1),p()()()}if(t&2){let e=r.$implicit,i=r.$index,n=a(2);g("height",n.galleryMode.dimensions,"px")("width",n.galleryMode.dimensions,"px"),E("selected",e.id===(n.selected==null?null:n.selected.id)),l(),D("rowIndex",i),l(),g("min-width",n.galleryMode.image,"px")("min-height",n.galleryMode.image,"px")("font-size",n.galleryMode.faSize,"px"),u("icon",e.isPersonal?n.icons.PERSONAL:n.icons.SPACES),l(2),h(e.newly?4:-1),l(2),g("font-size",n.galleryMode.textSize,"px"),l(),B(e.nb),l(2),g("font-size",n.galleryMode.textSize,"px"),l(),h(e.isPersonal?10:11)}}function Ve(t,r){if(t&1){let e=y();s(0,"div",9)(1,"app-virtual-scroll",13),f(2,"searchFilter"),x("contextmenu",function(n){_(e);let o=a();return m(o.onContextMenu(n))}),s(3,"div",14),P(4,be,12,21,"div",15,fe),p()()()}if(t&2){let e=a();l(),u("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",T(2,5,e.trashBins,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),l(3),F(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Me(t,r){if(t&1&&w(0,"fa-icon",32),t&2){let e=a(4);u("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Pe(t,r){if(t&1){let e=y();s(0,"th",31),x("click",function(){_(e);let n=a().$implicit,o=a(2);return m(o.sortBy(n.key))}),d(1),C(2,Me,1,2,"fa-icon",32),p()}if(t&2){let e=a().$implicit,i=a(2);N(e.value.class),g("width",e.value.width,"%"),E("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),l(),v(" ",e.value.label," "),l(),h(i.sortTable.sortParam.column===e.key?2:-1)}}function Fe(t,r){if(t&1&&C(0,Pe,3,10,"th",30),t&2){let e=r.$implicit;h(e.value.show?0:-1)}}function Ee(t,r){if(t&1&&(d(0),f(1,"translate")),t&2){let e=a(4).$implicit,i=a(2);v(" ",T(1,1,e.name,i.locale.language)," ")}}function Ae(t,r){if(t&1&&d(0),t&2){let e=a(4).$implicit;v(" ",e.name," ")}}function Be(t,r){if(t&1&&(s(0,"div",35),w(1,"fa-icon",18),s(2,"span",24),C(3,Ee,2,4)(4,Ae,1,1),p()()),t&2){let e=a(3).$implicit,i=a(2);l(),u("icon",e.isPersonal?i.icons.PERSONAL:i.icons.SPACES),l(2),h(e.isPersonal?3:4)}}function $e(t,r){if(t&1&&(s(0,"span",22),d(1),p()),t&2){let e=a(3).$implicit;l(),B(e.nb)}}function Ie(t,r){if(t&1&&d(0),t&2){let e=a(3).$implicit;v(" ",e.hTimeAgo," ")}}function Re(t,r){if(t&1&&(s(0,"td"),C(1,Be,5,2,"div",35)(2,$e,2,1,"span",22)(3,Ie,1,1),p()),t&2){let e,i=a().$implicit,n=a().$implicit;N(K("",i.value.class," ",i.value.newly?"prop-newly-"+n[i.value.newly]:"")),g("width",i.value.width,"%"),E("text-align-center",i.value.textCenter),l(),h((e=i.key)==="name"?1:e==="nb"?2:e==="modified"?3:-1)}}function ke(t,r){if(t&1&&C(0,Re,4,9,"td",34),t&2){let e=r.$implicit;h(e.value.show?0:-1)}}function Ne(t,r){if(t&1){let e=y();s(0,"tr",33),x("click",function(){let n=_(e).$implicit,o=a(2);return m(o.onSelect(n))})("contextmenu",function(n){let o=_(e).$implicit,c=a(2);return m(c.onTargetContextMenu(n,o))})("pressup",function(n){let o=_(e).$implicit,c=a(2);return m(c.onTargetContextMenu(n,o))})("tap",function(){let n=_(e).$implicit,o=a(2);return m(o.browse(n))}),P(1,ke,1,1,null,null,Te),f(3,"keyvalue"),p()}if(t&2){let e=r.$implicit,i=a(2);E("selected",e.id===(i.selected==null?null:i.selected.id)),l(),F(T(3,2,i.tableHeaders,i.originalOrderKeyValue))}}function Oe(t,r){if(t&1){let e=y();s(0,"table",26)(1,"thead")(2,"tr"),P(3,Fe,1,1,null,null,Te),f(5,"keyvalue"),p()()(),s(6,"app-virtual-scroll",27),f(7,"searchFilter"),x("contextmenu",function(n){_(e);let o=a();return m(o.onContextMenu(n))}),s(8,"table",26)(9,"tbody",28),P(10,Ne,4,5,"tr",29,fe),p()()()}if(t&2){let e=a();l(3),F(T(5,2,e.tableHeaders,e.originalOrderKeyValue)),l(3),u("bufferAmount",5)("items",T(7,5,e.trashBins,e.inputFilter.search())),l(4),F(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Le(t,r){if(t&1&&(s(0,"span",36),w(1,"fa-icon",37),d(2,"Refresh"),p()),t&2){let e=a();l(),u("icon",e.icons.faArrowRotateRight)}}function Qe(t,r){if(t&1&&(s(0,"span",36),w(1,"fa-icon",37),d(2,"Informations"),p()),t&2){let e=a();l(),u("icon",e.icons.faCircleInfo)}}var Ct=(()=>{let r=class r{constructor(){this.locale=S(J),this.layout=S(de),this.originalOrderKeyValue=pe,this.icons={SPACES:$.SPACES,PERSONAL:$.PERSONAL,faArrowDown:ne,faArrowUp:te,faArrowRotateRight:ie,faCircleInfo:oe},this.TAB_MENU=se,this.loading=!1,this.selected=null,this.trashBins=[],this.tableHeaders={name:{label:"Space",width:50,textCenter:!1,class:"",show:!0,sortable:!0},nb:{label:"Elements",width:10,textCenter:!0,class:"",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",nb:"Elements",mtime:"Modified"},this.router=S(W),this.store=S(_e),this.spacesService=S(he),this.sortSettings={default:[{prop:"isPersonal",type:"number"},{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],nb:[{prop:"nb",type:"number"}],modified:[{prop:"mtime",type:"date"}]},this.sortTable=new Ce(this.constructor.name,this.sortSettings),this.loadTrashBins(),this.layout.setBreadcrumbIcon($.TRASH),this.layout.setBreadcrumbNav({url:`/${O.TRASH}/${ue.TRASH}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadTrashBins(){this.loading=!0,this.onSelect(),this.spacesService.listTrashBins().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i.map(n=>new I(n))),this.loading=!1}})}onSelect(i=null){this.selected=i,this.store.trashSelection.set(this.selected)}sortBy(i,n=!0,o){this.trashBins=this.sortTable.sortBy(i,n,o||this.trashBins)}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,n){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(i,this.targetContextMenu)}browse(i){this.router.navigate([O.SPACES_TRASH,i.alias]).catch(console.error)}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=H({type:r,selectors:[["app-spaces-trash"]],viewQuery:function(n,o){if(n&1&&(b(Q,5),b(L,7),b(z,7),b(we,7),b(ge,7)),n&2){let c;V(c=M())&&(o.scrollView=c.first),V(c=M())&&(o.inputFilter=c.first),V(c=M())&&(o.btnNavigationView=c.first),V(c=M())&&(o.mainContextMenu=c.first),V(c=M())&&(o.targetContextMenu=c.first)}},decls:20,vars:14,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],[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"],["contextMenuItem","",3,"execute"],[1,"app-foot-menu"],[1,"mx-auto"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","height","width"],[1,"card",3,"click","contextmenu","pressup","tap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-right"],[1,"badge","rounded-pill","bg-danger"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],["l10nTranslate","",1,"badge","rounded-pill","bg-warning"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],["l10nTranslate",""],[3,"icon"]],template:function(n,o){if(n&1){let c=y();s(0,"div",2)(1,"button",3),f(2,"translate"),x("click",function(){return _(c),m(o.loadTrashBins())}),w(3,"fa-icon",4),p(),s(4,"div",5)(5,"div",6),w(6,"app-input-filter",7),p(),s(7,"app-navigation-view",8),x("sortBy",function(R){return _(c),m(o.sortBy(R))})("switchView",function(R){return _(c),m(o.galleryMode=R)}),p()()(),C(8,Ve,6,8,"div",9)(9,Oe,12,8),s(10,"context-menu",null,0),k(12,Le,3,1,"ng-template",10),x("execute",function(){return _(c),m(o.loadTrashBins())}),p(),s(13,"context-menu",null,1),k(15,Qe,3,1,"ng-template",10),x("execute",function(){return _(c),m(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION))}),p(),s(16,"div",11)(17,"span",12),d(18),f(19,"translate"),p()()}n&2&&(l(),u("tooltip",T(2,8,"Refresh",o.locale.language)),l(2),u("icon",o.icons.faArrowRotateRight)("animation",o.loading?"spin":null),l(4),u("sortParams",o.sortTable.sortParam)("sortFields",o.btnSortFields),l(),h(o.galleryMode!=null&&o.galleryMode.enabled?8:9),l(10),q("",o.trashBins.length," ",T(19,11,"trash bins",o.locale.language)))},dependencies:[j,z,L,Z,Y,Q,X,le,ae,re,G,U,xe],encapsulation:2});let t=r;return t})();export{Ct as TrashComponent};
@@ -0,0 +1,24 @@
1
+ import{a as m1}from"./chunk-B2Y2RNFP.js";import{c as d1}from"./chunk-JXZCNFW7.js";import{a as r1}from"./chunk-X43VWRFP.js";import{a as n1,b as o1,c as a1,d as s1,e as l1,f as Qt,i as c1}from"./chunk-VHYIXL7R.js";import{b as u1,c as Jt,d as h1,e as Zt}from"./chunk-WWIC7UW3.js";import{a as f1,d as Et,g as ct}from"./chunk-YCINY2YI.js";import{f as Xt}from"./chunk-MOVWEZ7J.js";import{Aa as Yn,Ba as Xn,Gb as Yt,Hb as W,Ib as st,Ja as nt,La as rt,Ma as Qn,O as Ve,Za as Ii,f as Rn,ib as Jn,kb as ot,lb as at,mb as Z,nb as Me,pb as Zn,wb as U,xb as e1,za as Kn,zb as t1}from"./chunk-Y2CDUS4J.js";import{c as Ne,d as p1,h as He,m as lt}from"./chunk-ZZ3LHYOY.js";import{d as An}from"./chunk-XE5YHU5J.js";import{$ as gn,$b as St,$c as Dn,Ab as xn,Ac as Ee,C as mn,Cb as b,Db as En,Dc as ke,Eb as u,Ed as In,Fb as Mn,Fd as ae,Ga as kt,Gb as Nn,Gf as Gn,Hb as yt,Hc as Ln,Ib as Vt,If as $n,Jb as _e,Jd as Pn,Je as Hn,Kb as xe,L as Ke,La as Mi,Lb as Ai,Ma as l,Mb as Pe,Mc as Ti,Na as Ni,Nb as q,Ob as Qe,Oc as jt,Pb as p,Qa as Xe,Qb as k,Rb as J,Re as Bn,Rf as qn,Sa as wi,Tb as Je,Ub as Ze,Vb as et,Wf as Wn,X as vn,Xa as D,Xb as tt,Xc as On,Ya as Cn,Za as Te,Zb as Di,Zc as oe,_a as yn,_b as Fe,_e as jn,ab as z,ad as Ut,bb as j,bc as wn,bf as Kt,ca as ye,cb as zi,cc as Ht,cg as i1,da as bn,dc as fe,ec as Bt,ed as Gt,f as pn,fc as _t,ha as h,hc as xt,jb as L,jd as $t,kb as O,ke as Fn,kf as Un,ma as _,na as x,nb as Sn,ob as _n,pb as f,pe as kn,qb as c,rb as d,sb as g,se as Vn,tb as Li,td as qt,u as hn,ub as Oi,v as Ei,va as Ft,wb as Ie,wd as Wt,xb as Re,xd as Tn,ya as Ye,yb as Se,yd as it,zb as F,zc as zn}from"./chunk-RSNLYAN6.js";import{a as Q,b as De}from"./chunk-RTRJ3KFH.js";var C0={prefix:"far",iconName:"bell",icon:[448,512,[128276,61602],"f0f3","M224 0c-13.3 0-24 10.7-24 24l0 9.7C118.6 45.3 56 115.4 56 200l0 14.5c0 37.7-10 74.7-29 107.3L5.1 359.2C1.8 365 0 371.5 0 378.2 0 399.1 16.9 416 37.8 416l372.4 0c20.9 0 37.8-16.9 37.8-37.8 0-6.7-1.8-13.3-5.1-19L421 321.7c-19-32.6-29-69.6-29-107.3l0-14.5c0-84.6-62.6-154.7-144-166.3l0-9.7c0-13.3-10.7-24-24-24zM392.4 368l-336.9 0 12.9-22.1C91.7 306 104 260.6 104 214.5l0-14.5c0-66.3 53.7-120 120-120s120 53.7 120 120l0 14.5c0 46.2 12.3 91.5 35.5 131.4L392.4 368zM156.1 464c9.9 28 36.6 48 67.9 48s58-20 67.9-48l-135.8 0z"]};var Ar={prefix:"far",iconName:"file-zipper",icon:[384,512,["file-archive"],"f1c6","M64 48l112 0 0 88c0 39.8 32.2 72 72 72l88 0 0 240c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16zM224 67.9l92.1 92.1-68.1 0c-13.3 0-24-10.7-24-24l0-68.1zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-261.5c0-17-6.7-33.3-18.7-45.3L242.7 18.7C230.7 6.7 214.5 0 197.5 0L64 0zM80 104c0 13.3 10.7 24 24 24l16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0c-13.3 0-24 10.7-24 24zm0 80c0 13.3 10.7 24 24 24l32 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-32 0c-13.3 0-24 10.7-24 24zm64 56l-32 0c-17.7 0-32 14.3-32 32l0 48c0 26.5 21.5 48 48 48s48-21.5 48-48l0-48c0-17.7-14.3-32-32-32zm-16 64a16 16 0 1 1 0 32 16 16 0 1 1 0-32z"]},y0=Ar;var S0={prefix:"far",iconName:"clock",icon:[512,512,[128339,"clock-four"],"f017","M464 256a208 208 0 1 1 -416 0 208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0 256 256 0 1 0 -512 0zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]};var ei={prefix:"far",iconName:"file",icon:[384,512,[128196,128459,61462],"f15b","M176 48L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-240-88 0c-39.8 0-72-32.2-72-72l0-88zM316.1 160L224 67.9 224 136c0 13.3 10.7 24 24 24l68.1 0zM0 64C0 28.7 28.7 0 64 0L197.5 0c17 0 33.3 6.7 45.3 18.7L365.3 141.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64z"]};var _0={prefix:"far",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M166.2-16c-13.3 0-25.3 8.3-30 20.8L120 48 24 48C10.7 48 0 58.7 0 72S10.7 96 24 96l400 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-96 0-16.2-43.2C307.1-7.7 295.2-16 281.8-16L166.2-16zM32 144l0 304c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-304-48 0 0 304c0 8.8-7.2 16-16 16L96 464c-8.8 0-16-7.2-16-16l0-304-48 0zm160 72c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 176c0 13.3 10.7 24 24 24s24-10.7 24-24l0-176zm112 0c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 176c0 13.3 10.7 24 24 24s24-10.7 24-24l0-176z"]};var x0={prefix:"far",iconName:"user",icon:[448,512,[128100,62144,62470,"user-alt","user-large"],"f007","M144 128a80 80 0 1 1 160 0 80 80 0 1 1 -160 0zm208 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0zM48 480c0-70.7 57.3-128 128-128l96 0c70.7 0 128 57.3 128 128l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8c0-97.2-78.8-176-176-176l-96 0C78.8 304 0 382.8 0 480l0 8c0 13.3 10.7 24 24 24s24-10.7 24-24l0-8z"]};var E0={prefix:"far",iconName:"file-lines",icon:[384,512,[128441,128462,61686,"file-alt","file-text"],"f15c","M64 48l112 0 0 88c0 39.8 32.2 72 72 72l88 0 0 240c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16L48 64c0-8.8 7.2-16 16-16zM224 67.9l92.1 92.1-68.1 0c-13.3 0-24-10.7-24-24l0-68.1zM64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-261.5c0-17-6.7-33.3-18.7-45.3L242.7 18.7C230.7 6.7 214.5 0 197.5 0L64 0zm56 256c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]};var M0={prefix:"far",iconName:"comment-dots",icon:[512,512,[128172,62075,"commenting"],"f4ad","M0 240c0 54.4 19.3 104.6 51.9 144.9L3.1 474.3c-2 3.7-3.1 7.9-3.1 12.2 0 14.1 11.4 25.5 25.5 25.5 4 0 7.8-.6 11.5-2.1L153.4 460c31.4 12.9 66.1 20 102.6 20 141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240zM94 407.9c9.3-17.1 7.4-38.1-4.8-53.2-26.1-32.3-41.2-71.9-41.2-114.7 0-103.2 90.2-192 208-192s208 88.8 208 192-90.2 192-208 192c-30.2 0-58.7-5.9-84.3-16.4-11.9-4.9-25.3-4.8-37.1 .3L76 440.9 94 407.9zM144 272a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm80 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]};var N0={prefix:"far",iconName:"flag",icon:[448,512,[127988,61725],"f024","M48 24C48 10.7 37.3 0 24 0S0 10.7 0 24L0 488c0 13.3 10.7 24 24 24s24-10.7 24-24l0-100 80.3-20.1c41.1-10.3 84.6-5.5 122.5 13.4 44.2 22.1 95.5 24.8 141.7 7.4l34.7-13c12.5-4.7 20.8-16.6 20.8-30l0-279.7c0-23-24.2-38-44.8-27.7l-9.6 4.8c-46.3 23.2-100.8 23.2-147.1 0-35.1-17.6-75.4-22-113.5-12.5L48 52 48 24zm0 77.5l96.6-24.2c27-6.7 55.5-3.6 80.4 8.8 54.9 27.4 118.7 29.7 175 6.8l0 241.8-24.4 9.1c-33.7 12.6-71.2 10.7-103.4-5.4-48.2-24.1-103.3-30.1-155.6-17.1l-68.6 17.2 0-237z"]};var w0={prefix:"far",iconName:"window-restore",icon:[576,512,[],"f2d2","M512 80L224 80c-8.8 0-16 7.2-16 16l0 16-48 0 0-16c0-35.3 28.7-64 64-64l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64l-48 0 0-48 48 0c8.8 0 16-7.2 16-16l0-192c0-8.8-7.2-16-16-16zM368 288l-320 0 0 128c0 8.8 7.2 16 16 16l288 0c8.8 0 16-7.2 16-16l0-128zM64 160l288 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64z"]};var v1={prefix:"far",iconName:"folder-closed",icon:[512,512,[],"e185","M448 400L64 400c-8.8 0-16-7.2-16-16l0-144 416 0 0 144c0 8.8-7.2 16-16 16zm16-208l-416 0 0-96c0-8.8 7.2-16 16-16l138.7 0c3.5 0 6.8 1.1 9.6 3.2L250.7 112c13.8 10.4 30.7 16 48 16L448 128c8.8 0 16 7.2 16 16l0 48zM64 448l384 0c35.3 0 64-28.7 64-64l0-240c0-35.3-28.7-64-64-64L298.7 80c-6.9 0-13.7-2.2-19.2-6.4L241.1 44.8C230 36.5 216.5 32 202.7 32L64 32C28.7 32 0 60.7 0 96L0 384c0 35.3 28.7 64 64 64z"]};var g1=(()=>{let e=class e{transform(i,r=0,o=void 0){return rt(i,r,o)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275pipe=yn({name:"pathSlice",type:e,pure:!0});let t=e;return t})();var ki=function(t,e){return ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},ki(t,e)};function z1(t,e){ki(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var K=function(){return K=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},K.apply(this,arguments)};function L1(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var i=n.call(t),r,o=[],a;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function Vi(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(L1(arguments[e]));return t}var Dr="An invariant failed, however the error is obfuscated because this is an production build.",ni=[];Object.freeze(ni);var $i={};Object.freeze($i);var Tr={};function Hi(){return typeof window<"u"?window:typeof global<"u"?global:Tr}function Y(){return++v.mobxGuid}function T(t){throw Nt(!1,t),"X"}function Nt(t,e){if(!t)throw new Error("[mobx] "+(e||Dr))}var b1=[];function he(t,e){return!1}function qi(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var C1=function(){};function Ir(t){var e=[];return t.forEach(function(n){e.indexOf(n)===-1&&e.push(n)}),e}function Wi(t){return t!==null&&typeof t=="object"}function pt(t){if(t===null||typeof t!="object")return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function Rr(t){return ht(t)||qe(t)?t:Array.isArray(t)?new Map(t):pt(t)?new Map(Object.entries(t)):T("Cannot convert to map from '"+t+"'")}function Pr(t,e){for(var n=0;n<e.length;n++)Ge(t,e[n],t[e[n]])}function Ge(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Ot(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Oe(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(i){return Wi(i)&&i[n]===!0}}function Fr(t,e){return typeof t=="number"&&typeof e=="number"&&isNaN(t)&&isNaN(e)}function ht(t){return Hi().Map!==void 0&&t instanceof Hi().Map}function At(t){return t instanceof Set}function ft(t){for(var e=[];;){var n=t.next();if(n.done)break;e.push(n.value)}return e}function O1(){return typeof Symbol=="function"&&Symbol.toPrimitive||"@@toPrimitive"}function A1(t){return t===null?null:typeof t=="object"?""+t:t}function Ki(){return typeof Symbol=="function"&&Symbol.iterator||"@@iterator"}function Yi(t,e){Ot(t,Ki(),e)}function wt(t){return t[Ki()]=kr,t}function Xi(){return typeof Symbol=="function"&&Symbol.toStringTag||"@@toStringTag"}function kr(){return this}var ci=(function(){function t(e){e===void 0&&(e="Atom@"+Y()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=w.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.reportObserved=function(){return $1(this)},t.prototype.reportChanged=function(){me(),s2(this),ve()},t.prototype.toString=function(){return this.name},t})(),Qi=Oe("Atom",ci);function Vr(t,e,n){e===void 0&&(e=C1),n===void 0&&(n=C1);var i=new ci(t);return C2(i,e),X1(i,n),i}function D1(t,e){return t===e}function Hr(t,e){return tn(t,e)}function Br(t,e){return tn(t,e,1)}function jr(t,e){return Fr(t,e)||D1(t,e)}var ut={identity:D1,structural:Hr,default:jr,shallow:Br},Ur={},Gr={};function $r(t,e){var n=e?Ur:Gr;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return je(this),this[t]},set:function(i){je(this),this[t]=i}})}function je(t){if(t.__mobxDidRunLazyInitializers!==!0){var e=t.__mobxDecorators;if(e){Ge(t,"__mobxDidRunLazyInitializers",!0);for(var n in e){var i=e[n];i.propertyCreator(t,i.prop,i.descriptor,i.decoratorTarget,i.decoratorArguments)}}}}function T1(t,e){return function(){var i,r=function(a,s,m,C){if(C===!0)return e(a,s,m,a,i),null;if(!Object.prototype.hasOwnProperty.call(a,"__mobxDecorators")){var A=a.__mobxDecorators;Ge(a,"__mobxDecorators",K({},A))}return a.__mobxDecorators[s]={prop:s,propertyCreator:e,descriptor:m,decoratorTarget:a,decoratorArguments:i},$r(s,t)};return qr(arguments)?(i=ni,r.apply(null,arguments)):(i=Array.prototype.slice.call(arguments),r)}}function qr(t){return(t.length===2||t.length===3)&&typeof t[1]=="string"||t.length===4&&t[3]===!0}function Dt(t,e,n){return Z1(t)?t:Array.isArray(t)?E.array(t,{name:n}):pt(t)?E.object(t,void 0,{name:n}):ht(t)?E.map(t,{name:n}):At(t)?E.set(t,{name:n}):t}function Wr(t,e,n){return t==null||Lt(t)||pi(t)||qe(t)||vt(t)?t:Array.isArray(t)?E.array(t,{name:n,deep:!1}):pt(t)?E.object(t,void 0,{name:n,deep:!1}):ht(t)?E.map(t,{name:n,deep:!1}):At(t)?E.set(t,{name:n,deep:!1}):T(!1)}function zt(t){return t}function Kr(t,e,n){return tn(t,e)?e:t}function di(t){var e=T1(!0,function(i,r,o,a,s){var m=o?o.initializer?o.initializer.call(i):o.value:void 0;T2(i,r,m,t)}),n=(typeof process<"u"&&process.env,e);return n.enhancer=t,n}var I1={deep:!0,name:void 0,defaultDecorator:void 0},Yr={deep:!1,name:void 0,defaultDecorator:void 0};Object.freeze(I1);Object.freeze(Yr);function dt(t){return t==null?I1:typeof t=="string"?{name:t,deep:!0}:t}function ti(t){return t.defaultDecorator?t.defaultDecorator.enhancer:t.deep===!1?zt:Dt}var Ji=di(Dt),Xr=di(Wr),R1=di(zt),Qr=di(Kr);function Jr(t,e,n){if(typeof arguments[1]=="string")return Ji.apply(null,arguments);if(Z1(t))return t;var i=pt(t)?E.object(t,e,n):Array.isArray(t)?E.array(t,e):ht(t)?E.map(t,e):At(t)?E.set(t,e):t;if(i!==t)return i;T(!1)}var y1={box:function(t,e){arguments.length>2&&ue("box");var n=dt(e);return new ze(t,ti(n),n.name,!0,n.equals)},shallowBox:function(t,e){return arguments.length>2&&ue("shallowBox"),he("observable.shallowBox","observable.box(value, { deep: false })"),E.box(t,{name:e,deep:!1})},array:function(t,e){arguments.length>2&&ue("array");var n=dt(e);return new be(t,ti(n),n.name)},shallowArray:function(t,e){return arguments.length>2&&ue("shallowArray"),he("observable.shallowArray","observable.array(values, { deep: false })"),E.array(t,{name:e,deep:!1})},map:function(t,e){arguments.length>2&&ue("map");var n=dt(e);return new hi(t,ti(n),n.name)},shallowMap:function(t,e){return arguments.length>2&&ue("shallowMap"),he("observable.shallowMap","observable.map(values, { deep: false })"),E.map(t,{name:e,deep:!1})},set:function(t,e){arguments.length>2&&ue("set");var n=dt(e);return new mi(t,ti(n),n.name)},object:function(t,e,n){typeof arguments[1]=="string"&&ue("object");var i=dt(n);return y2({},t,e,i)},shallowObject:function(t,e){return typeof arguments[1]=="string"&&ue("shallowObject"),he("observable.shallowObject","observable.object(values, {}, { deep: false })"),E.object(t,{},{name:e,deep:!1})},ref:R1,shallow:Xr,deep:Ji,struct:Qr},E=Jr;Object.keys(y1).forEach(function(t){return E[t]=y1[t]});function ue(t){T("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}var ri=T1(!1,function(t,e,n,i,r){var o=n.get,a=n.set,s=r[0]||{};I2(t,e,K({get:o,set:a},s))}),Zr=ri({equals:ut.structural}),R=function(e,n,i){if(typeof n=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return ri.apply(null,arguments);var r=typeof n=="object"?n:{};return r.get=e,r.set=typeof n=="function"?n:r.set,r.name=r.name||e.name||"",new Le(r)};R.struct=Zr;var w=(function(t){return t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE",t})(w||{}),le=(function(t){return t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK",t})(le||{}),oi=(function(){function t(e){this.cause=e}return t})();function Mt(t){return t instanceof oi}function Bi(t){switch(t.dependenciesState){case w.UP_TO_DATE:return!1;case w.NOT_TRACKING:case w.STALE:return!0;case w.POSSIBLY_STALE:{for(var e=mt(),n=t.observing,i=n.length,r=0;r<i;r++){var o=n[r];if(ui(o)){if(v.disableErrorBoundaries)o.get();else try{o.get()}catch{return we(e),!0}if(t.dependenciesState===w.STALE)return we(e),!0}}return H1(t),we(e),!1}}}function fi(t){var e=t.observers.length>0;v.computationDepth>0&&e&&T(!1),!v.allowStateChanges&&(e||v.enforceActions==="strict")&&T(!1)}function P1(t,e,n){var i=k1(!0);H1(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++v.runId;var r=v.trackingDerivation;v.trackingDerivation=t;var o;if(v.disableErrorBoundaries===!0)o=e.call(n);else try{o=e.call(n)}catch(a){o=new oi(a)}return v.trackingDerivation=r,e2(t),t.observing.length===0&&void 0,V1(i),o}function e2(t){for(var e=t.observing,n=t.observing=t.newObserving,i=w.UP_TO_DATE,r=0,o=t.unboundDepsCount,a=0;a<o;a++){var s=n[a];s.diffValue===0&&(s.diffValue=1,r!==a&&(n[r]=s),r++),s.dependenciesState>i&&(i=s.dependenciesState)}for(n.length=r,t.newObserving=null,o=e.length;o--;){var s=e[o];s.diffValue===0&&U1(s,t),s.diffValue=0}for(;r--;){var s=n[r];s.diffValue===1&&(s.diffValue=0,a2(s,t))}i!==w.UP_TO_DATE&&(t.dependenciesState=i,t.onBecomeStale())}function ji(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)U1(e[n],t);t.dependenciesState=w.NOT_TRACKING}function F1(t){var e=mt(),n=t();return we(e),n}function mt(){var t=v.trackingDerivation;return v.trackingDerivation=null,t}function we(t){v.trackingDerivation=t}function k1(t){var e=v.allowStateReads;return v.allowStateReads=t,e}function V1(t){v.allowStateReads=t}function H1(t){if(t.dependenciesState!==w.UP_TO_DATE){t.dependenciesState=w.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=w.UP_TO_DATE}}var ai=0,t2=1;function Be(t,e){var n=function(){return i2(t,e,this,arguments)};return n.isMobxAction=!0,n}function i2(t,e,n,i){var r=n2(t,n,i);try{return e.apply(n,i)}catch(o){throw r.error=o,o}finally{r2(r)}}function n2(t,e,n){var i=B()&&!!t,r=0;if(i){r=Date.now();var o=n&&n.length||0,a=new Array(o);if(o>0)for(var s=0;s<o;s++)a[s]=n[s];ee({type:"action",name:t,object:e,arguments:a})}var m=mt();me();var C=B1(!0),A=k1(!0),X={prevDerivation:m,prevAllowStateChanges:C,prevAllowStateReads:A,notifySpy:i,startTime:r,actionId:t2++,parentActionId:ai};return ai=X.actionId,X}function r2(t){ai!==t.actionId&&T("invalid action stack. did you forget to finish an action?"),ai=t.parentActionId,t.error!==void 0&&(v.suppressReactionErrors=!0),j1(t.prevAllowStateChanges),V1(t.prevAllowStateReads),ve(),we(t.prevDerivation),t.notifySpy&&te({time:Date.now()-t.startTime}),v.suppressReactionErrors=!1}function B1(t){var e=v.allowStateChanges;return v.allowStateChanges=t,e}function j1(t){v.allowStateChanges=t}var ze=(function(t){z1(e,t);function e(n,i,r,o,a){r===void 0&&(r="ObservableValue@"+Y()),o===void 0&&(o=!0),a===void 0&&(a=ut.default);var s=t.call(this,r)||this;return s.enhancer=i,s.name=r,s.equals=a,s.hasUnreportedChange=!1,s.value=i(n,void 0,r),o&&B()&&Ue({type:"create",name:s.name,newValue:""+s.value}),s}return e.prototype.dehanceValue=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.prototype.set=function(n){var i=this.value;if(n=this.prepareNewValue(n),n!==v.UNCHANGED){var r=B();r&&ee({type:"update",name:this.name,newValue:n,oldValue:i}),this.setNewValue(n),r&&te()}},e.prototype.prepareNewValue=function(n){if(fi(this),ce(this)){var i=de(this,{object:this,type:"update",newValue:n});if(!i)return v.UNCHANGED;n=i.newValue}return n=this.enhancer(n,this.value,this.name),this.equals(this.value,n)?v.UNCHANGED:n},e.prototype.setNewValue=function(n){var i=this.value;this.value=n,this.reportChanged(),ie(this)&&ne(this,{type:"update",object:this,newValue:n,oldValue:i})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(n){return It(this,n)},e.prototype.observe=function(n,i){return i&&n({object:this,type:"update",newValue:this.value,oldValue:void 0}),Rt(this,n)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return A1(this.get())},e})(ci);ze.prototype[O1()]=ze.prototype.valueOf;var A0=Oe("ObservableValue",ze),Le=(function(){function t(e){this.dependenciesState=w.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=w.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+Y(),this.value=new oi(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=le.NONE,this.derivation=e.get,this.name=e.name||"ComputedValue@"+Y(),e.set&&(this.setter=Be(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?ut.structural:ut.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return t.prototype.onBecomeStale=function(){c2(this)},t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.get=function(){this.isComputing&&T("Cycle detected in computation "+this.name+": "+this.derivation),v.inBatch===0&&this.observers.length===0&&!this.keepAlive?Bi(this)&&(this.warnAboutUntrackedRead(),me(),this.value=this.computeValue(!1),ve()):($1(this),Bi(this)&&this.trackAndCompute()&&l2(this));var e=this.value;if(Mt(e))throw e.cause;return e},t.prototype.peek=function(){var e=this.computeValue(!1);if(Mt(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){Nt(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else Nt(!1,!1)},t.prototype.trackAndCompute=function(){B()&&Ue({object:this.scope,type:"compute",name:this.name});var e=this.value,n=this.dependenciesState===w.NOT_TRACKING,i=this.computeValue(!0),r=n||Mt(e)||Mt(i)||!this.equals(e,i);return r&&(this.value=i),r},t.prototype.computeValue=function(e){this.isComputing=!0,v.computationDepth++;var n;if(e)n=P1(this,this.derivation,this.scope);else if(v.disableErrorBoundaries===!0)n=this.derivation.call(this.scope);else try{n=this.derivation.call(this.scope)}catch(i){n=new oi(i)}return v.computationDepth--,this.isComputing=!1,n},t.prototype.suspend=function(){this.keepAlive||(ji(this),this.value=void 0)},t.prototype.observe=function(e,n){var i=this,r=!0,o=void 0;return Tt(function(){var a=i.get();if(!r||n){var s=mt();e({type:"update",object:i,newValue:a,oldValue:o}),we(s)}r=!1,o=a})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return A1(this.get())},t})();Le.prototype[O1()]=Le.prototype.valueOf;var ui=Oe("ComputedValue",Le);var Ri=(function(){function t(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return t})(),Pi=!0,o2=!1,v=(function(){var t=Hi();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(Pi=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Ri().version&&(Pi=!1),Pi?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Ri):(setTimeout(function(){o2||T("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Ri)})();function a2(t,e){var n=t.observers.length;n&&(t.observersIndexes[e.__mapid]=n),t.observers[n]=e,t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function U1(t,e){if(t.observers.length===1)t.observers.length=0,G1(t);else{var n=t.observers,i=t.observersIndexes,r=n.pop();if(r!==e){var o=i[e.__mapid]||0;o?i[r.__mapid]=o:delete i[r.__mapid],n[o]=r}delete i[e.__mapid]}}function G1(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,v.pendingUnobservations.push(t))}function me(){v.inBatch++}function ve(){if(--v.inBatch===0){K1();for(var t=v.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers.length===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Le&&n.suspend())}v.pendingUnobservations=[]}}function $1(t){var e=v.trackingDerivation;return e!==null?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(t.observers.length===0&&v.inBatch>0&&G1(t),!1)}function s2(t){if(t.lowestObserverState!==w.STALE){t.lowestObserverState=w.STALE;for(var e=t.observers,n=e.length;n--;){var i=e[n];i.dependenciesState===w.UP_TO_DATE&&(i.isTracing!==le.NONE&&q1(i,t),i.onBecomeStale()),i.dependenciesState=w.STALE}}}function l2(t){if(t.lowestObserverState!==w.STALE){t.lowestObserverState=w.STALE;for(var e=t.observers,n=e.length;n--;){var i=e[n];i.dependenciesState===w.POSSIBLY_STALE?i.dependenciesState=w.STALE:i.dependenciesState===w.UP_TO_DATE&&(t.lowestObserverState=w.UP_TO_DATE)}}}function c2(t){if(t.lowestObserverState===w.UP_TO_DATE){t.lowestObserverState=w.POSSIBLY_STALE;for(var e=t.observers,n=e.length;n--;){var i=e[n];i.dependenciesState===w.UP_TO_DATE&&(i.dependenciesState=w.POSSIBLY_STALE,i.isTracing!==le.NONE&&q1(i,t),i.onBecomeStale())}}}function q1(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===le.BREAK){var n=[];W1(S2(t),n,1),new Function(`debugger;
2
+ /*
3
+ Tracing '`+t.name+`'
4
+
5
+ You are entering this break point because derivation '`+t.name+"' is being traced and '"+e.name+`' is now forcing it to update.
6
+ Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
7
+ The stackframe you are looking for is at least ~6-8 stack-frames up.
8
+
9
+ `+(t instanceof Le?t.derivation.toString().replace(/[*]\//g,"/"):"")+`
10
+
11
+ The dependencies for this derivation are:
12
+
13
+ `+n.join(`
14
+ `)+`
15
+ */
16
+ `)()}}function W1(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(n).join(" ")+t.name),t.dependencies&&t.dependencies.forEach(function(i){return W1(i,e,n+1)})}var si=(function(){function t(e,n,i,r){e===void 0&&(e="Reaction@"+Y()),r===void 0&&(r=!1),this.name=e,this.onInvalidate=n,this.errorHandler=i,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=w.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+Y(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=le.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,v.pendingReactions.push(this),K1())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(me(),this._isScheduled=!1,Bi(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&B()&&Ue({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}ve()}},t.prototype.track=function(e){me();var n=B(),i;n&&(i=Date.now(),ee({name:this.name,type:"reaction"})),this._isRunning=!0;var r=P1(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&ji(this),Mt(r)&&this.reportExceptionInDerivation(r.cause),n&&te({time:Date.now()-i}),ve()},t.prototype.reportExceptionInDerivation=function(e){var n=this;if(this.errorHandler){this.errorHandler(e,this);return}if(v.disableErrorBoundaries)throw e;var i="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";v.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(i,e),B()&&Ue({type:"error",name:this.name,message:i,error:""+e}),v.globalReactionErrorHandlers.forEach(function(r){return r(e,n)})},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(me(),ji(this),ve()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){e===void 0&&(e=!1),x2(this,e)},t})();var S1=100,d2=function(t){return t()};function K1(){v.inBatch>0||v.isRunningReactions||d2(f2)}function f2(){v.isRunningReactions=!0;for(var t=v.pendingReactions,e=0;t.length>0;){++e===S1&&(console.error("Reaction doesn't converge to a stable state after "+S1+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0])),t.splice(0));for(var n=t.splice(0),i=0,r=n.length;i<r;i++)n[i].runReaction()}v.isRunningReactions=!1}var li=Oe("Reaction",si);function B(){return!!v.spyListeners.length}function Ue(t){if(v.spyListeners.length)for(var e=v.spyListeners,n=0,i=e.length;n<i;n++)e[n](t)}function ee(t){var e=K({},t,{spyReportStart:!0});Ue(e)}var u2={spyReportEnd:!0};function te(t){Ue(t?K({},t,{spyReportEnd:!0}):u2)}function p2(t){return v.spyListeners.push(t),qi(function(){v.spyListeners=v.spyListeners.filter(function(e){return e!==t})})}function h2(){T(!1)}function _1(t){return function(e,n,i){if(i){if(i.value)return{value:Be(t,i.value),enumerable:!1,configurable:!0,writable:!0};var r=i.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Be(t,r.call(this))}}}return m2(t).apply(this,arguments)}}function m2(t){return function(e,n,i){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(r){Ge(this,n,M(t,r))}})}}function v2(t,e,n,i){return i===!0?(Fi(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Fi(this,e,n.value||n.initializer.call(this)),this[e]},set:h2}:{enumerable:!1,configurable:!0,set:function(r){Fi(this,e,r)},get:function(){}}}var M=function(e,n,i,r){if(arguments.length===1&&typeof e=="function")return Be(e.name||"<unnamed action>",e);if(arguments.length===2&&typeof n=="function")return Be(e,n);if(arguments.length===1&&typeof e=="string")return _1(e);if(r===!0)e[n]=Be(e.name||n,i.value);else return _1(n).apply(null,arguments)};M.bound=v2;function Fi(t,e,n){Ge(t,e,Be(e,n.bind(t)))}function Tt(t,e){e===void 0&&(e=$i);var n=e&&e.name||t.name||"Autorun@"+Y(),i=!e.scheduler&&!e.delay,r;if(i)r=new si(n,function(){this.track(s)},e.onError,e.requiresObservable);else{var o=Y1(e),a=!1;r=new si(n,function(){a||(a=!0,o(function(){a=!1,r.isDisposed||r.track(s)}))},e.onError,e.requiresObservable)}function s(){t(r)}return r.schedule(),r.getDisposer()}var g2=function(t){return t()};function Y1(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:g2}function $e(t,e,n){n===void 0&&(n=$i),typeof n=="boolean"&&(n={fireImmediately:n},he("Using fireImmediately as argument is deprecated. Use '{ fireImmediately: true }' instead"));var i=n.name||"Reaction@"+Y(),r=M(i,n.onError?b2(n.onError,e):e),o=!n.scheduler&&!n.delay,a=Y1(n),s=!0,m=!1,C,A=n.compareStructural?ut.structural:n.equals||ut.default,X=new si(i,function(){s||o?Ae():m||(m=!0,a(Ae))},n.onError,n.requiresObservable);function Ae(){if(m=!1,!X.isDisposed){var fn=!1;X.track(function(){var un=t(X);fn=s||!A(C,un),C=un}),s&&n.fireImmediately&&r(C,X),!s&&fn===!0&&r(C,X),s&&(s=!1)}}return X.schedule(),X.getDisposer()}function b2(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}function C2(t,e,n){return Q1("onBecomeObserved",t,e,n)}function X1(t,e,n){return Q1("onBecomeUnobserved",t,e,n)}function Q1(t,e,n,i){var r=typeof i=="function"?ge(e,n):ge(e),o=typeof i=="function"?i:n,a=r[t];return typeof a!="function"?T(!1):(r[t]=function(){a.call(this),o.call(this)},function(){r[t]=a})}function y2(t,e,n,i){if(0&&n)for(var r in n);i=dt(i);var o=i.defaultDecorator||(i.deep===!1?R1:Ji);je(t),en(t,i.name,o.enhancer),me();try{for(var r in e){var a=Object.getOwnPropertyDescriptor(e,r),s=n&&r in n?n[r]:a.get?ri:o,m=s(t,r,a,!0);m&&Object.defineProperty(t,r,m)}}finally{ve()}return t}function S2(t,e){return J1(ge(t,e))}function J1(t){var e={name:t.name};return t.observing&&t.observing.length>0&&(e.dependencies=Ir(t.observing).map(J1)),e}function _2(t,e){if(t==null)return!1;if(e!==void 0){if(Lt(t)){var n=t.$mobx;return n.values&&!!n.values[e]}return!1}return Lt(t)||!!t.$mobx||Qi(t)||li(t)||ui(t)}function Z1(t){return arguments.length!==1&&T(!1),_2(t)}function x2(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;typeof t[t.length-1]=="boolean"&&(n=t.pop());var i=E2(t);if(!i)return T(!1);i.isTracing===le.NONE&&console.log("[mobx.trace] '"+i.name+"' tracing enabled"),i.isTracing=n?le.BREAK:le.LOG}function E2(t){switch(t.length){case 0:return v.trackingDerivation;case 1:return ge(t[0]);case 2:return ge(t[0],t[1])}}function pe(t,e){e===void 0&&(e=void 0),me();try{return t.apply(e)}finally{ve()}}function ce(t){return t.interceptors!==void 0&&t.interceptors.length>0}function It(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),qi(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function de(t,e){var n=mt();try{var i=t.interceptors;if(i)for(var r=0,o=i.length;r<o&&(e=i[r](e),Nt(!e||e.type,"Intercept handlers should return nothing or a change object"),!!e);r++);return e}finally{we(n)}}function ie(t){return t.changeListeners!==void 0&&t.changeListeners.length>0}function Rt(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),qi(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function ne(t,e){var n=mt(),i=t.changeListeners;if(i){i=i.slice();for(var r=0,o=i.length;r<o;r++)i[r](e);we(n)}}var M2=1e4,N2=(function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1})(),Ui=0,Zi=(function(){function t(){}return t})();function w2(t,e){typeof Object.setPrototypeOf<"u"?Object.setPrototypeOf(t.prototype,e):typeof t.prototype.__proto__<"u"?t.prototype.__proto__=e:t.prototype=e}w2(Zi,Array.prototype);Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(t){Object.defineProperty(Zi.prototype,t,{configurable:!0,writable:!0,value:Array.prototype[t]})});var er=(function(){function t(e,n,i,r){this.array=i,this.owned=r,this.values=[],this.lastKnownLength=0,this.atom=new ci(e||"ObservableArray@"+Y()),this.enhancer=function(o,a){return n(o,a,e+"[..]")}}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.dehanceValues=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},t.prototype.intercept=function(e){return It(this,e)},t.prototype.observe=function(e,n){return n===void 0&&(n=!1),n&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Rt(this,e)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var n=this.values.length;if(e!==n)if(e>n){for(var i=new Array(e-n),r=0;r<e-n;r++)i[r]=void 0;this.spliceWithArray(n,0,i)}else this.spliceWithArray(e,n-e)},t.prototype.updateArrayLength=function(e,n){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=n,n>0&&e+n+1>Ui&&ir(e+n+1)},t.prototype.spliceWithArray=function(e,n,i){var r=this;fi(this.atom);var o=this.values.length;if(e===void 0?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),arguments.length===1?n=o-e:n==null?n=0:n=Math.max(0,Math.min(n,o-e)),i===void 0&&(i=ni),ce(this)){var a=de(this,{object:this.array,type:"splice",index:e,removedCount:n,added:i});if(!a)return ni;n=a.removedCount,i=a.added}i=i.length===0?i:i.map(function(C){return r.enhancer(C,void 0)});var s=i.length-n;this.updateArrayLength(o,s);var m=this.spliceItemsIntoValues(e,n,i);return(n!==0||i.length!==0)&&this.notifyArraySplice(e,i,m),this.dehanceValues(m)},t.prototype.spliceItemsIntoValues=function(e,n,i){var r;if(i.length<M2)return(r=this.values).splice.apply(r,Vi([e,n],i));var o=this.values.slice(e,e+n);return this.values=this.values.slice(0,e).concat(i,this.values.slice(e+n)),o},t.prototype.notifyArrayChildUpdate=function(e,n,i){var r=!this.owned&&B(),o=ie(this),a=o||r?{object:this.array,type:"update",index:e,newValue:n,oldValue:i}:null;r&&ee(K({},a,{name:this.atom.name})),this.atom.reportChanged(),o&&ne(this,a),r&&te()},t.prototype.notifyArraySplice=function(e,n,i){var r=!this.owned&&B(),o=ie(this),a=o||r?{object:this.array,type:"splice",index:e,removed:i,added:n,removedCount:i.length,addedCount:n.length}:null;r&&ee(K({},a,{name:this.atom.name})),this.atom.reportChanged(),o&&ne(this,a),r&&te()},t})(),be=(function(t){z1(e,t);function e(n,i,r,o){r===void 0&&(r="ObservableArray@"+Y()),o===void 0&&(o=!1);var a=t.call(this)||this,s=new er(r,i,a,o);if(Ot(a,"$mobx",s),n&&n.length){var m=B1(!0);a.spliceWithArray(0,0,n),j1(m)}return N2&&Object.defineProperty(s.array,"0",z2),a}return e.prototype.intercept=function(n){return this.$mobx.intercept(n)},e.prototype.observe=function(n,i){return i===void 0&&(i=!1),this.$mobx.observe(n,i)},e.prototype.clear=function(){return this.splice(0)},e.prototype.concat=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),n.map(function(r){return pi(r)?r.peek():r}))},e.prototype.replace=function(n){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,n)},e.prototype.toJS=function(){return this.slice()},e.prototype.toJSON=function(){return this.toJS()},e.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},e.prototype.find=function(n,i,r){r===void 0&&(r=0),arguments.length===3&&he("The array.find fromIndex argument to find will not be supported anymore in the next major");var o=this.findIndex.apply(this,arguments);return o===-1?void 0:this.get(o)},e.prototype.findIndex=function(n,i,r){r===void 0&&(r=0),arguments.length===3&&he("The array.findIndex fromIndex argument to find will not be supported anymore in the next major");for(var o=this.peek(),a=o.length,s=r;s<a;s++)if(n.call(i,o[s],s,this))return s;return-1},e.prototype.splice=function(n,i){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(n);case 2:return this.$mobx.spliceWithArray(n,i)}return this.$mobx.spliceWithArray(n,i,r)},e.prototype.spliceWithArray=function(n,i,r){return this.$mobx.spliceWithArray(n,i,r)},e.prototype.push=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=this.$mobx;return r.spliceWithArray(r.values.length,0,n),r.values.length},e.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},e.prototype.shift=function(){return this.splice(0,1)[0]},e.prototype.unshift=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=this.$mobx;return r.spliceWithArray(0,0,n),r.values.length},e.prototype.reverse=function(){var n=this.slice();return n.reverse.apply(n,arguments)},e.prototype.sort=function(n){var i=this.slice();return i.sort.apply(i,arguments)},e.prototype.remove=function(n){var i=this.$mobx.dehanceValues(this.$mobx.values).indexOf(n);return i>-1?(this.splice(i,1),!0):!1},e.prototype.move=function(n,i){he("observableArray.move is deprecated, use .slice() & .replace() instead");function r(s){if(s<0)throw new Error("[mobx.array] Index out of bounds: "+s+" is negative");var m=this.$mobx.values.length;if(s>=m)throw new Error("[mobx.array] Index out of bounds: "+s+" is not smaller than "+m)}if(r.call(this,n),r.call(this,i),n!==i){var o=this.$mobx.values,a;n<i?a=Vi(o.slice(0,n),o.slice(n+1,i+1),[o[n]],o.slice(i+1)):a=Vi(o.slice(0,i),[o[n]],o.slice(i,n),o.slice(n+1)),this.replace(a)}},e.prototype.get=function(n){var i=this.$mobx;if(i){if(n<i.values.length)return i.atom.reportObserved(),i.dehanceValue(i.values[n]);console.warn("[mobx.array] Attempt to read an array index ("+n+") that is out of bounds ("+i.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},e.prototype.set=function(n,i){var r=this.$mobx,o=r.values;if(n<o.length){fi(r.atom);var a=o[n];if(ce(r)){var s=de(r,{type:"update",object:this,index:n,newValue:i});if(!s)return;i=s.newValue}i=r.enhancer(i,a);var m=i!==a;m&&(o[n]=i,r.notifyArrayChildUpdate(n,i,a))}else if(n===o.length)r.spliceWithArray(n,0,[i]);else throw new Error("[mobx.array] Index out of bounds, "+n+" is larger than "+o.length)},e})(Zi);Yi(be.prototype,function(){this.$mobx.atom.reportObserved();var t=this,e=0;return wt({next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0,value:void 0}}})});Object.defineProperty(be.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(t){this.$mobx.setArrayLength(t)}});Ge(be.prototype,Xi(),"Array");["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(t){var e=Array.prototype[t];Nt(typeof e=="function","Base function not defined on Array prototype: '"+t+"'"),Ge(be.prototype,t,function(){return e.apply(this.peek(),arguments)})});Pr(be.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var z2=tr(0);function tr(t){return{enumerable:!1,configurable:!1,get:function(){return this.get(t)},set:function(e){this.set(t,e)}}}function L2(t){Object.defineProperty(be.prototype,""+t,tr(t))}function ir(t){for(var e=Ui;e<t;e++)L2(e);Ui=t}ir(1e3);var O2=Oe("ObservableArrayAdministration",er);function pi(t){return Wi(t)&&O2(t.$mobx)}var A2={},hi=(function(){function t(e,n,i){if(n===void 0&&(n=Dt),i===void 0&&(i="ObservableMap@"+Y()),this.enhancer=n,this.name=i,this.$mobx=A2,this._keys=new be(void 0,zt,this.name+".keys()",!0),typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return t.prototype._has=function(e){return this._data.has(e)},t.prototype.has=function(e){var n=this;if(!v.trackingDerivation)return this._has(e);var i=this._hasMap.get(e);if(!i){var r=i=new ze(this._has(e),zt,this.name+"."+ii(e)+"?",!1);this._hasMap.set(e,r),X1(r,function(){return n._hasMap.delete(e)})}return i.get()},t.prototype.set=function(e,n){var i=this._has(e);if(ce(this)){var r=de(this,{type:i?"update":"add",object:this,newValue:n,name:e});if(!r)return this;n=r.newValue}return i?this._updateValue(e,n):this._addValue(e,n),this},t.prototype.delete=function(e){var n=this;if(ce(this)){var i=de(this,{type:"delete",object:this,name:e});if(!i)return!1}if(this._has(e)){var r=B(),o=ie(this),i=o||r?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return r&&ee(K({},i,{name:this.name,key:e})),pe(function(){n._keys.remove(e),n._updateHasMapEntry(e,!1);var s=n._data.get(e);s.setNewValue(void 0),n._data.delete(e)}),o&&ne(this,i),r&&te(),!0}return!1},t.prototype._updateHasMapEntry=function(e,n){var i=this._hasMap.get(e);i&&i.setNewValue(n)},t.prototype._updateValue=function(e,n){var i=this._data.get(e);if(n=i.prepareNewValue(n),n!==v.UNCHANGED){var r=B(),o=ie(this),a=o||r?{type:"update",object:this,oldValue:i.value,name:e,newValue:n}:null;r&&ee(K({},a,{name:this.name,key:e})),i.setNewValue(n),o&&ne(this,a),r&&te()}},t.prototype._addValue=function(e,n){var i=this;pe(function(){var s=new ze(n,i.enhancer,i.name+"."+ii(e),!1);i._data.set(e,s),n=s.value,i._updateHasMapEntry(e,!0),i._keys.push(e)});var r=B(),o=ie(this),a=o||r?{type:"add",object:this,name:e,newValue:n}:null;r&&ee(K({},a,{name:this.name,key:e})),o&&ne(this,a),r&&te()},t.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.keys=function(){return this._keys[Ki()]()},t.prototype.values=function(){var e=this,n=0;return wt({next:function(){return n<e._keys.length?{value:e.get(e._keys[n++]),done:!1}:{value:void 0,done:!0}}})},t.prototype.entries=function(){var e=this,n=0;return wt({next:function(){if(n<e._keys.length){var i=e._keys[n++];return{value:[i,e.get(i)],done:!1}}return{done:!0}}})},t.prototype.forEach=function(e,n){var i=this;this._keys.forEach(function(r){return e.call(n,i.get(r),r,i)})},t.prototype.merge=function(e){var n=this;return qe(e)&&(e=e.toJS()),pe(function(){pt(e)?Object.keys(e).forEach(function(i){return n.set(i,e[i])}):Array.isArray(e)?e.forEach(function(i){var r=L1(i,2),o=r[0],a=r[1];return n.set(o,a)}):ht(e)?e.constructor!==Map?T("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(i,r){return n.set(r,i)}):e!=null&&T("Cannot initialize map from "+e)}),this},t.prototype.clear=function(){var e=this;pe(function(){F1(function(){e._keys.slice().forEach(function(n){return e.delete(n)})})})},t.prototype.replace=function(e){var n=this;return pe(function(){for(var i=Rr(e),r=n._keys,o=Array.from(i.keys()),a=!1,s=0;s<r.length;s++){var m=r[s];r.length===o.length&&m!==o[s]&&(a=!0),i.has(m)||(a=!0,n.delete(m))}i.forEach(function(C,A){n._data.has(A)||(a=!0),n.set(A,C)}),a&&n._keys.replace(o)}),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var e=this,n={};return this._keys.forEach(function(i){return n[typeof i=="symbol"?i:ii(i)]=e.get(i)}),n},t.prototype.toJS=function(){var e=this,n=new Map;return this._keys.forEach(function(i){return n.set(i,e.get(i))}),n},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(n){return ii(n)+": "+(""+e.get(n))}).join(", ")+" }]"},t.prototype.observe=function(e,n){return Rt(this,e)},t.prototype.intercept=function(e){return It(this,e)},t})();function ii(t){return t&&t.toString?t.toString():new String(t).toString()}Yi(hi.prototype,function(){return this.entries()});Ot(hi.prototype,Xi(),"Map");var qe=Oe("ObservableMap",hi),D2={},mi=(function(){function t(e,n,i){if(n===void 0&&(n=Dt),i===void 0&&(i="ObservableSet@"+Y()),this.name=i,this.$mobx=D2,this._data=new Set,this._atom=Vr(this.name),typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(r,o){return n(r,o,i)},e&&this.replace(e)}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.clear=function(){var e=this;pe(function(){F1(function(){e._data.forEach(function(n){e.delete(n)})})})},t.prototype.forEach=function(e,n){var i=this;this._data.forEach(function(r){e.call(n,r,r,i)})},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(e){var n=this;if(fi(this._atom),ce(this)){var i=de(this,{type:"add",object:this,newValue:e});if(!i)return this}if(!this.has(e)){pe(function(){n._data.add(n.enhancer(e,void 0)),n._atom.reportChanged()});var r=B(),o=ie(this),i=o||r?{type:"add",object:this,newValue:e}:null;o&&ne(this,i)}return this},t.prototype.delete=function(e){var n=this;if(ce(this)){var i=de(this,{type:"delete",object:this,oldValue:e});if(!i)return!1}if(this.has(e)){var r=B(),o=ie(this),i=o||r?{type:"delete",object:this,oldValue:e}:null;return pe(function(){n._atom.reportChanged(),n._data.delete(e)}),o&&ne(this,i),!0}return!1},t.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},t.prototype.entries=function(){var e=0,n=ft(this.keys()),i=ft(this.values());return wt({next:function(){var r=e;return e+=1,r<i.length?{value:[n[r],i[r]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var e=this,n=0,i;return this._data.values!==void 0?i=ft(this._data.values()):(i=[],this._data.forEach(function(r){return i.push(r)})),wt({next:function(){return n<i.length?{value:e.dehanceValue(i[n++]),done:!1}:{done:!0}}})},t.prototype.replace=function(e){var n=this;return vt(e)&&(e=e.toJS()),pe(function(){Array.isArray(e)?(n.clear(),e.forEach(function(i){return n.add(i)})):At(e)?(n.clear(),e.forEach(function(i){return n.add(i)})):e!=null&&T("Cannot initialize set from "+e)}),this},t.prototype.observe=function(e,n){return Rt(this,e)},t.prototype.intercept=function(e){return It(this,e)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+ft(this.keys()).join(", ")+" ]"},t})();Yi(mi.prototype,function(){return this.values()});Ot(mi.prototype,Xi(),"Set");var vt=Oe("ObservableSet",mi),nr=(function(){function t(e,n,i){this.target=e,this.name=n,this.defaultEnhancer=i,this.values={}}return t.prototype.read=function(e,n){if(!(this.target!==e&&(this.illegalAccess(e,n),!this.values[n])))return this.values[n].get()},t.prototype.write=function(e,n,i){var r=this.target;r!==e&&this.illegalAccess(e,n);var o=this.values[n];if(o instanceof Le){o.set(i);return}if(ce(this)){var a=de(this,{type:"update",object:r,name:n,newValue:i});if(!a)return;i=a.newValue}if(i=o.prepareNewValue(i),i!==v.UNCHANGED){var s=ie(this),m=B(),a=s||m?{type:"update",object:r,oldValue:o.value,name:n,newValue:i}:null;m&&ee(K({},a,{name:this.name,key:n})),o.setNewValue(i),s&&ne(this,a),m&&te()}},t.prototype.remove=function(e){if(this.values[e]){var n=this.target;if(ce(this)){var i=de(this,{object:n,name:e,type:"remove"});if(!i)return}try{me();var r=ie(this),o=B(),a=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var i=r||o?{type:"remove",object:n,oldValue:a,name:e}:null;o&&ee(K({},i,{name:this.name,key:e})),r&&ne(this,i),o&&te()}finally{ve()}}},t.prototype.illegalAccess=function(e,n){console.warn("Property '"+n+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(e,n){return Rt(this,e)},t.prototype.intercept=function(e){return It(this,e)},t.prototype.getKeys=function(){var e=this;return this.keys===void 0&&(this.keys=new be(Object.keys(this.values).filter(function(n){return e.values[n]instanceof ze}),zt,"keys("+this.name+")",!0)),this.keys.slice()},t})();function en(t,e,n){e===void 0&&(e=""),n===void 0&&(n=Dt);var i=t.$mobx;return i||(pt(t)||(e=(t.constructor.name||"ObservableObject")+"@"+Y()),e||(e="ObservableObject@"+Y()),i=new nr(t,e,n),Ot(t,"$mobx",i),i)}function T2(t,e,n,i){var r=en(t);if(ce(r)){var o=de(r,{object:t,name:e,type:"add",newValue:n});if(!o)return;n=o.newValue}var a=r.values[e]=new ze(n,i,r.name+"."+e,!1);n=a.value,Object.defineProperty(t,e,R2(e)),r.keys&&r.keys.push(e),F2(r,t,e,n)}function I2(t,e,n){var i=en(t);n.name=i.name+"."+e,n.context=t,i.values[e]=new Le(n),Object.defineProperty(t,e,P2(e))}var x1=Object.create(null),E1=Object.create(null);function R2(t){return x1[t]||(x1[t]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,t)},set:function(e){this.$mobx.write(this,t,e)}})}function M1(t){var e=t.$mobx;return e||(je(t),t.$mobx)}function P2(t){return E1[t]||(E1[t]={configurable:v.computedConfigurable,enumerable:!1,get:function(){return M1(this).read(this,t)},set:function(e){M1(this).write(this,t,e)}})}function F2(t,e,n,i){var r=ie(t),o=B(),a=r||o?{type:"add",object:e,name:n,newValue:i}:null;o&&ee(K({},a,{name:t.name,key:n})),r&&ne(t,a),o&&te()}var k2=Oe("ObservableObjectAdministration",nr);function Lt(t){return Wi(t)?(je(t),k2(t.$mobx)):!1}function ge(t,e){if(typeof t=="object"&&t!==null){if(pi(t))return e!==void 0&&T(!1),t.$mobx.atom;if(vt(t))return t.$mobx;if(qe(t)){var n=t;if(e===void 0)return ge(n._keys);var i=n._data.get(e)||n._hasMap.get(e);return i||T(!1),i}if(je(t),e&&!t.$mobx&&t[e],Lt(t)){if(!e)return T(!1);var i=t.$mobx.values[e];return i||T(!1),i}if(Qi(t)||ui(t)||li(t))return t}else if(typeof t=="function"&&li(t.$mobx))return t.$mobx;return T(!1)}function rr(t,e){if(t||T("Expecting some object"),e!==void 0)return rr(ge(t,e));if(Qi(t)||ui(t)||li(t)||qe(t)||vt(t))return t;if(je(t),t.$mobx)return t.$mobx;T(!1)}function V2(t,e){var n;return e!==void 0?n=ge(t,e):Lt(t)||qe(t)||vt(t)?n=rr(t):n=ge(t),n.name}var N1=Object.prototype.toString;function tn(t,e,n){return n===void 0&&(n=-1),Gi(t,e,n)}function Gi(t,e,n,i,r){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var o=typeof t;if(o!=="function"&&o!=="object"&&typeof e!="object")return!1;t=w1(t),e=w1(e);var a=N1.call(t);if(a!==N1.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e)}var s=a==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var m=t.constructor,C=e.constructor;if(m!==C&&!(typeof m=="function"&&m instanceof m&&typeof C=="function"&&C instanceof C)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),i=i||[],r=r||[];for(var A=i.length;A--;)if(i[A]===t)return r[A]===e;if(i.push(t),r.push(e),s){if(A=t.length,A!==e.length)return!1;for(;A--;)if(!Gi(t[A],e[A],n-1,i,r))return!1}else{var X=Object.keys(t),Ae=void 0;if(A=X.length,Object.keys(e).length!==A)return!1;for(;A--;)if(Ae=X[A],!(H2(e,Ae)&&Gi(t[Ae],e[Ae],n-1,i,r)))return!1}return i.pop(),r.pop(),!0}function w1(t){return pi(t)?t.peek():ht(t)||qe(t)||At(t)||vt(t)?ft(t.entries()):t}function H2(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(function(){function t(){}if(t.name!=="testCodeMinification"&&!1)var e})();var B2="$mobx";typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:p2,extras:{getDebugName:V2},$mobx:B2});var j2=t=>({$implicit:t});function U2(t,e){t&1&&(c(0,"span"),p(1,"loading..."),d())}var G2=["*"],bt=()=>({dontDetach:!0});function $2(t,e){if(t&1&&(Ie(0),c(1,"div"),Nn(2),d(),Re()),t&2){let n=u();l(),Pe("height",n.getTotalHeight())}}function q2(t,e){if(t&1){let n=F();Ie(0),c(1,"input",1),b("click",function(r){_(n);let o=u();return x(o.node.mouseAction("checkboxClick",r))}),d(),Re()}if(t&2){let n=u();l(),f("checked",n.node.isSelected)("indeterminate",n.node.isPartiallySelected)}}function W2(t,e){if(t&1){let n=F();c(0,"span",3),b("click",function(r){_(n);let o=u(2);return x(o.node.mouseAction("expanderClick",r))}),g(1,"span",4),d()}if(t&2){let n=u(2);q("toggle-children-wrapper-expanded",n.node.isExpanded)("toggle-children-wrapper-collapsed",n.node.isCollapsed)}}function K2(t,e){t&1&&g(0,"span",5)}function Y2(t,e){if(t&1&&(Ie(0),z(1,W2,2,4,"span",1)(2,K2,1,0,"span",2),Re()),t&2){let n=u();l(),f("ngIf",n.node.hasChildren),l(),f("ngIf",!n.node.hasChildren)}}var X2=(t,e,n)=>({$implicit:t,node:e,index:n});function Q2(t,e){if(t&1&&(c(0,"span"),p(1),d()),t&2){let n=u();l(),k(n.node.displayField)}}var fr=(t,e,n,i)=>({$implicit:t,node:e,index:n,templates:i});function J2(t,e){if(t&1&&g(0,"tree-node-checkbox",4),t&2){let n=u(2);f("node",n.node)}}function Z2(t,e){if(t&1){let n=F();c(0,"div",2),z(1,J2,1,1,"tree-node-checkbox",3),g(2,"tree-node-expander",4),c(3,"div",5),b("click",function(r){_(n);let o=u();return x(o.node.mouseAction("click",r))})("dblclick",function(r){_(n);let o=u();return x(o.node.mouseAction("dblClick",r))})("mouseover",function(r){_(n);let o=u();return x(o.node.mouseAction("mouseOver",r))})("mouseout",function(r){_(n);let o=u();return x(o.node.mouseAction("mouseOut",r))})("contextmenu",function(r){_(n);let o=u();return x(o.node.mouseAction("contextMenu",r))})("treeDrop",function(r){_(n);let o=u();return x(o.node.onDrop(r))})("treeDropDragOver",function(r){_(n);let o=u();return x(o.node.mouseAction("dragOver",r))})("treeDropDragLeave",function(r){_(n);let o=u();return x(o.node.mouseAction("dragLeave",r))})("treeDropDragEnter",function(r){_(n);let o=u();return x(o.node.mouseAction("dragEnter",r))}),g(4,"tree-node-content",6),d()()}if(t&2){let n=u();Pe("padding-left",n.node.getNodePadding()),l(),f("ngIf",n.node.options.useCheckbox),l(),f("node",n.node),l(),q("node-content-wrapper-active",n.node.isActive)("node-content-wrapper-focused",n.node.isFocused),f("treeAllowDrop",n.node.allowDrop)("allowDragoverStyling",n.node.allowDragoverStyling())("treeDrag",n.node)("treeDragEnabled",n.node.allowDrag()),l(),f("node",n.node)("index",n.index)("template",n.templates.treeNodeTemplate)}}function eo(t,e){if(t&1&&g(0,"tree-node-collection",4),t&2){let n=u(3);f("nodes",n.node.children)("templates",n.templates)("treeModel",n.node.treeModel)}}function to(t,e){if(t&1&&g(0,"tree-loading-component",5),t&2){let n=u(3);Pe("padding-left",n.node.getNodePadding()),f("template",n.templates.loadingTemplate)("node",n.node)}}function io(t,e){if(t&1&&(c(0,"div"),z(1,eo,1,3,"tree-node-collection",2)(2,to,1,4,"tree-loading-component",3),d()),t&2){let n=u(2);q("tree-children",!0)("tree-children-no-padding",n.node.options.levelPadding),l(),f("ngIf",n.node.children),l(),f("ngIf",!n.node.children)}}function no(t,e){if(t&1&&(Ie(0),z(1,io,3,6,"div",1),Re()),t&2){let n=u();l(),f("treeAnimateOpen",n.node.isExpanded)("treeAnimateOpenSpeed",n.node.options.animateSpeed)("treeAnimateOpenAcceleration",n.node.options.animateAcceleration)("treeAnimateOpenEnabled",n.node.options.animateExpand)}}function ro(t,e){if(t&1&&g(0,"tree-node",2),t&2){let n=e.$implicit,i=e.index,r=u(2);f("node",n)("index",i)("templates",r.templates)}}function oo(t,e){if(t&1&&(Ie(0),c(1,"div"),z(2,ro,1,3,"tree-node",1),d(),Re()),t&2){let n=u();l(),Pe("margin-top",n.marginTop),l(),f("ngForOf",n.viewportNodes)("ngForTrackBy",n.trackNode)}}function ao(t,e){if(t&1&&g(0,"tree-node-drop-slot",6),t&2){let n=u(3);f("dropIndex",n.node.index)("node",n.node.parent)}}function so(t,e){if(t&1&&(c(0,"div"),z(1,ao,1,2,"tree-node-drop-slot",3),g(2,"tree-node-wrapper",4)(3,"tree-node-children",5)(4,"tree-node-drop-slot",6),d()),t&2){let n=u(2);Qe(n.node.getClass()),q("tree-node",!0)("tree-node-expanded",n.node.isExpanded&&n.node.hasChildren)("tree-node-collapsed",n.node.isCollapsed&&n.node.hasChildren)("tree-node-leaf",n.node.isLeaf)("tree-node-active",n.node.isActive)("tree-node-focused",n.node.isFocused),l(),f("ngIf",n.index===0),l(),f("node",n.node)("index",n.index)("templates",n.templates),l(),f("node",n.node)("templates",n.templates),l(),f("dropIndex",n.node.index+1)("node",n.node.parent)}}function lo(t,e){if(t&1&&(Ie(0),z(1,so,5,22,"div",1),Se(2,2),Re()),t&2){let n=u();l(),f("ngIf",!n.templates.treeNodeFullTemplate),l(),f("ngTemplateOutlet",n.templates.treeNodeFullTemplate)("ngTemplateOutletContext",Ht(3,fr,n.node,n.node,n.index,n.templates))}}var co=["loadingTemplate"],fo=["treeNodeTemplate"],uo=["treeNodeWrapperTemplate"],po=["treeNodeFullTemplate"],ho=["viewport"],mo=(t,e,n,i)=>({loadingTemplate:t,treeNodeTemplate:e,treeNodeWrapperTemplate:n,treeNodeFullTemplate:i});function vo(t,e){if(t&1&&g(0,"tree-node-collection",4),t&2){let n=u();f("nodes",n.treeModel.roots)("treeModel",n.treeModel)("templates",Ht(3,mo,n.loadingTemplate,n.treeNodeTemplate,n.treeNodeWrapperTemplate,n.treeNodeFullTemplate))}}function go(t,e){if(t&1&&g(0,"tree-node-drop-slot",5),t&2){let n=u();f("dropIndex",0)("node",n.treeModel.virtualRoot)}}var Ct=(()=>{let e=class e{constructor(){this.templateRef=h(Ni),this.viewContainer=h(wi),this.templateBindings={}}ngOnInit(){this.view=this.viewContainer.createEmbeddedView(this.templateRef),this.dispose&&this.dispose(),this.shouldDetach()&&this.view.detach(),this.autoDetect(this.view)}shouldDetach(){return this.treeMobxAutorun&&this.treeMobxAutorun.detach}autoDetect(i){this.dispose=Tt(()=>i.detectChanges())}ngOnDestroy(){this.dispose&&this.dispose()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275dir=Te({type:e,selectors:[["","treeMobxAutorun",""]],inputs:{treeMobxAutorun:"treeMobxAutorun"}});let t=e;return t})(),G={LEFT:37,UP:38,RIGHT:39,DOWN:40,ENTER:13,SPACE:32,CONTEXT_MENU:32},I={TOGGLE_ACTIVE:(t,e,n)=>e&&e.toggleActivated(),TOGGLE_ACTIVE_MULTI:(t,e,n)=>e&&e.toggleActivated(!0),TOGGLE_SELECTED:(t,e,n)=>e&&e.toggleSelected(),ACTIVATE:(t,e,n)=>e.setIsActive(!0),DEACTIVATE:(t,e,n)=>e.setIsActive(!1),SELECT:(t,e,n)=>e.setIsSelected(!0),DESELECT:(t,e,n)=>e.setIsSelected(!1),FOCUS:(t,e,n)=>e.focus(),TOGGLE_EXPANDED:(t,e,n)=>e.hasChildren&&e.toggleExpanded(),EXPAND:(t,e,n)=>e.expand(),COLLAPSE:(t,e,n)=>e.collapse(),DRILL_DOWN:(t,e,n)=>t.focusDrillDown(),DRILL_UP:(t,e,n)=>t.focusDrillUp(),NEXT_NODE:(t,e,n)=>t.focusNextNode(),PREVIOUS_NODE:(t,e,n)=>t.focusPreviousNode(),MOVE_NODE:(t,e,n,{from:i,to:r})=>{n.ctrlKey?t.copyNode(i,r):t.moveNode(i,r)}},gt={mouse:{click:I.TOGGLE_ACTIVE,dblClick:null,contextMenu:null,expanderClick:I.TOGGLE_EXPANDED,checkboxClick:I.TOGGLE_SELECTED,drop:I.MOVE_NODE},keys:{[G.RIGHT]:I.DRILL_DOWN,[G.LEFT]:I.DRILL_UP,[G.DOWN]:I.NEXT_NODE,[G.UP]:I.PREVIOUS_NODE,[G.SPACE]:I.TOGGLE_ACTIVE,[G.ENTER]:I.TOGGLE_ACTIVE}},bi=class{get hasChildrenField(){return this.options.hasChildrenField||"hasChildren"}get childrenField(){return this.options.childrenField||"children"}get displayField(){return this.options.displayField||"name"}get idField(){return this.options.idField||"id"}get isExpandedField(){return this.options.isExpandedField||"isExpanded"}get getChildren(){return this.options.getChildren}get levelPadding(){return this.options.levelPadding||0}get useVirtualScroll(){return this.options.useVirtualScroll}get animateExpand(){return this.options.animateExpand}get animateSpeed(){return this.options.animateSpeed||1}get animateAcceleration(){return this.options.animateAcceleration||1.2}get scrollOnActivate(){return this.options.scrollOnActivate===void 0?!0:this.options.scrollOnActivate}get rtl(){return!!this.options.rtl}get rootId(){return this.options.rootId}get useCheckbox(){return this.options.useCheckbox}get useTriState(){return this.options.useTriState===void 0?!0:this.options.useTriState}get scrollContainer(){return this.options.scrollContainer}get allowDragoverStyling(){return this.options.allowDragoverStyling===void 0?!0:this.options.allowDragoverStyling}constructor(e={}){this.options=e,this.actionMapping={mouse:{click:this.options?.actionMapping?.mouse?.click??gt.mouse.click,dblClick:this.options?.actionMapping?.mouse?.dblClick??gt.mouse.dblClick,contextMenu:this.options?.actionMapping?.mouse?.contextMenu??gt.mouse.contextMenu,expanderClick:this.options?.actionMapping?.mouse?.expanderClick??gt.mouse.expanderClick,checkboxClick:this.options?.actionMapping?.mouse?.checkboxClick??gt.mouse.checkboxClick,drop:this.options?.actionMapping?.mouse?.drop??gt.mouse.drop,dragStart:this.options?.actionMapping?.mouse?.dragStart??void 0,drag:this.options?.actionMapping?.mouse?.drag??void 0,dragEnd:this.options?.actionMapping?.mouse?.dragEnd??void 0,dragOver:this.options?.actionMapping?.mouse?.dragOver??void 0,dragLeave:this.options?.actionMapping?.mouse?.dragLeave??void 0,dragEnter:this.options?.actionMapping?.mouse?.dragEnter??void 0,mouseOver:this.options?.actionMapping?.mouse?.mouseOver??void 0,mouseOut:this.options?.actionMapping?.mouse?.mouseOut??void 0},keys:{[G.RIGHT]:I.DRILL_DOWN,[G.LEFT]:I.DRILL_UP,[G.DOWN]:I.NEXT_NODE,[G.UP]:I.PREVIOUS_NODE,[G.SPACE]:I.TOGGLE_ACTIVE,[G.ENTER]:I.TOGGLE_ACTIVE}},this.options?.actionMapping?.keys&&(this.actionMapping.keys=Q(Q({},this.actionMapping.keys),this.options.actionMapping.keys)),e.rtl&&(this.actionMapping.keys[G.RIGHT]=e.actionMapping?.keys[G.RIGHT]||I.DRILL_UP,this.actionMapping.keys[G.LEFT]=e.actionMapping?.keys[G.LEFT]||I.DRILL_DOWN)}getNodeClone(e){if(this.options.getNodeClone)return this.options.getNodeClone(e);let n=Object.assign({},e.data);return n.id&&delete n.id,n}allowDrop(e,n,i){return this.options.allowDrop instanceof Function?this.options.allowDrop(e,n,i):this.options.allowDrop===void 0?!0:this.options.allowDrop}allowDrag(e){return this.options.allowDrag instanceof Function?this.options.allowDrag(e):this.options.allowDrag}nodeClass(e){return this.options.nodeClass?this.options.nodeClass(e):""}nodeHeight(e){if(e.data.virtual)return 0;let n=this.options.nodeHeight||22;return typeof n=="function"&&(n=n(e)),n+(e.index===0?2:1)*this.dropSlotHeight}get dropSlotHeight(){return typeof this.options.dropSlotHeight=="number"?this.options.dropSlotHeight:2}},P={toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",initialized:"initialized",updateData:"updateData",moveNode:"moveNode",copyNode:"copyNode",event:"event",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",stateChange:"stateChange"},$=function(t,e,n,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(r<3?a(o):r>3?a(e,n,o):a(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},V=class t{get isHidden(){return this.treeModel.isHidden(this)}get isExpanded(){return this.treeModel.isExpanded(this)}get isActive(){return this.treeModel.isActive(this)}get isFocused(){return this.treeModel.isNodeFocused(this)}get isSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children.some(e=>e.isSelected)}get isAllSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children.every(e=>e.isAllSelected)}get isPartiallySelected(){return this.isSelected&&!this.isAllSelected}get level(){return this.parent?this.parent.level+1:0}get path(){return this.parent?[...this.parent.path,this.id]:[]}get elementRef(){throw`Element Ref is no longer supported since introducing virtual scroll
17
+
18
+ You may use a template to obtain a reference to the element`}get originalNode(){return this._originalNode}constructor(e,n,i,r){this.data=e,this.parent=n,this.treeModel=i,this.position=0,this.allowDrop=(o,a)=>this.options.allowDrop(o,{parent:this,index:0},a),this.allowDragoverStyling=()=>this.options.allowDragoverStyling,(this.id===void 0||this.id===null)&&(this.id=bo()),this.index=r,this.getField("children")&&this._initChildren(),this.autoLoadChildren()}get hasChildren(){return!!(this.getField("hasChildren")||this.children&&this.children.length>0)}get isCollapsed(){return!this.isExpanded}get isLeaf(){return!this.hasChildren}get isRoot(){return this.parent.data.virtual}get realParent(){return this.isRoot?null:this.parent}get options(){return this.treeModel.options}fireEvent(e){this.treeModel.fireEvent(e)}get displayField(){return this.getField("display")}get id(){return this.getField("id")}set id(e){this.setField("id",e)}getField(e){return this.data[this.options[`${e}Field`]]}setField(e,n){this.data[this.options[`${e}Field`]]=n}_findAdjacentSibling(e,n=!1){let i=this._getParentsChildren(n),r=i.indexOf(this);return i.length>r+e?i[r+e]:null}findNextSibling(e=!1){return this._findAdjacentSibling(1,e)}findPreviousSibling(e=!1){return this._findAdjacentSibling(-1,e)}getVisibleChildren(){return this.visibleChildren}get visibleChildren(){return(this.children||[]).filter(e=>!e.isHidden)}getFirstChild(e=!1){let n=e?this.visibleChildren:this.children;return n!=null&&n.length?n[0]:null}getLastChild(e=!1){let n=e?this.visibleChildren:this.children;return n!=null&&n.length?n[n.length-1]:null}findNextNode(e=!0,n=!1){return e&&this.isExpanded&&this.getFirstChild(n)||this.findNextSibling(n)||this.parent&&this.parent.findNextNode(!1,n)}findPreviousNode(e=!1){let n=this.findPreviousSibling(e);return n?n._getLastOpenDescendant(e):this.realParent}_getLastOpenDescendant(e=!1){let n=this.getLastChild(e);return this.isCollapsed||!n?this:n._getLastOpenDescendant(e)}_getParentsChildren(e=!1){return this.parent&&(e?this.parent.getVisibleChildren():this.parent.children)||[]}getIndexInParent(e=!1){return this._getParentsChildren(e).indexOf(this)}isDescendantOf(e){return this===e?!0:this.parent&&this.parent.isDescendantOf(e)}getNodePadding(){return this.options.levelPadding*(this.level-1)+"px"}getClass(){return[this.options.nodeClass(this),`tree-node-level-${this.level}`].join(" ")}onDrop(e){this.mouseAction("drop",e.event,{from:e.element,to:{parent:this,index:0,dropOnNode:!0}})}allowDrag(){return this.options.allowDrag(this)}loadNodeChildren(){return this.options.getChildren?Promise.resolve(this.options.getChildren(this)).then(e=>{e&&(this.setField("children",e),this._initChildren(),this.options.useTriState&&this.treeModel.isSelected(this)&&this.setIsSelected(!0),this.children.forEach(n=>{n.getField("isExpanded")&&n.hasChildren&&n.expand()}))}).then(()=>{this.fireEvent({eventName:P.loadNodeChildren,node:this})}):Promise.resolve()}expand(){return this.isExpanded||this.toggleExpanded(),this}collapse(){return this.isExpanded&&this.toggleExpanded(),this}doForAll(e){Promise.resolve(e(this)).then(()=>{this.children&&this.children.forEach(n=>n.doForAll(e))})}expandAll(){this.doForAll(e=>e.expand())}collapseAll(){this.doForAll(e=>e.collapse())}ensureVisible(){return this.realParent&&(this.realParent.expand(),this.realParent.ensureVisible()),this}toggleExpanded(){return this.setIsExpanded(!this.isExpanded),this}setIsExpanded(e){return this.hasChildren&&this.treeModel.setExpandedNode(this,e),this}autoLoadChildren(){this.handler=$e(()=>this.isExpanded,e=>{!this.children&&this.hasChildren&&e&&this.loadNodeChildren()},{fireImmediately:!0})}dispose(){this.children&&this.children.forEach(e=>e.dispose()),this.handler&&this.handler(),this.parent=null,this.children=null}setIsActive(e,n=!1){return this.treeModel.setActiveNode(this,e,n),e&&this.focus(this.options.scrollOnActivate),this}isSelectable(){return this.isLeaf||!this.children||!this.options.useTriState}setIsSelected(e){return this.isSelectable()?this.treeModel.setSelectedNode(this,e):this.visibleChildren.forEach(n=>n.setIsSelected(e)),this}toggleSelected(){return this.setIsSelected(!this.isSelected),this}toggleActivated(e=!1){return this.setIsActive(!this.isActive,e),this}setActiveAndVisible(e=!1){return this.setIsActive(!0,e).ensureVisible(),setTimeout(this.scrollIntoView.bind(this)),this}scrollIntoView(e=!1){this.treeModel.virtualScroll.scrollIntoView(this,e)}focus(e=!0){let n=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(this),e&&this.scrollIntoView(),n&&this.fireEvent({eventName:P.blur,node:n}),this.fireEvent({eventName:P.focus,node:this}),this}blur(){let e=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(null),e&&this.fireEvent({eventName:P.blur,node:this}),this}setIsHidden(e){this.treeModel.setIsHidden(this,e)}hide(){this.setIsHidden(!0)}show(){this.setIsHidden(!1)}mouseAction(e,n,i=null){this.treeModel.setFocus(!0);let o=this.options.actionMapping.mouse[e];o&&o(this.treeModel,this,n,i)}getSelfHeight(){return this.options.nodeHeight(this)}_initChildren(){this.children=this.getField("children").map((e,n)=>new t(e,this,this.treeModel,n))}};$([R],V.prototype,"isHidden",null);$([R],V.prototype,"isExpanded",null);$([R],V.prototype,"isActive",null);$([R],V.prototype,"isFocused",null);$([R],V.prototype,"isSelected",null);$([R],V.prototype,"isAllSelected",null);$([R],V.prototype,"isPartiallySelected",null);$([E],V.prototype,"children",void 0);$([E],V.prototype,"index",void 0);$([E],V.prototype,"position",void 0);$([E],V.prototype,"height",void 0);$([R],V.prototype,"level",null);$([R],V.prototype,"path",null);$([R],V.prototype,"visibleChildren",null);$([M],V.prototype,"setIsSelected",null);$([M],V.prototype,"_initChildren",null);function bo(){return Math.floor(Math.random()*1e13)}var N=function(t,e,n,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(r<3?a(o):r>3?a(e,n,o):a(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},y=(()=>{let e=class e{constructor(){this.options=new bi,this.eventNames=Object.keys(P),this.expandedNodeIds={},this.selectedLeafNodeIds={},this.activeNodeIds={},this.hiddenNodeIds={},this.focusedNodeId=null,this.firstUpdate=!0,this.subscriptions=[]}fireEvent(i){i.treeModel=this,this.events[i.eventName].emit(i),this.events.event.emit(i)}subscribe(i,r){let o=this.events[i].subscribe(r);this.subscriptions.push(o)}getFocusedNode(){return this.focusedNode}getActiveNode(){return this.activeNodes[0]}getActiveNodes(){return this.activeNodes}getVisibleRoots(){return this.virtualRoot.visibleChildren}getFirstRoot(i=!1){let r=i?this.getVisibleRoots():this.roots;return r!=null&&r.length?r[0]:null}getLastRoot(i=!1){let r=i?this.getVisibleRoots():this.roots;return r!=null&&r.length?r[r.length-1]:null}get isFocused(){return e.focusedTree===this}isNodeFocused(i){return this.focusedNode===i}isEmptyTree(){return this.roots&&this.roots.length===0}get focusedNode(){return this.focusedNodeId?this.getNodeById(this.focusedNodeId):null}get expandedNodes(){return Object.keys(this.expandedNodeIds).filter(r=>this.expandedNodeIds[r]).map(r=>this.getNodeById(r)).filter(Boolean)}get activeNodes(){return Object.keys(this.activeNodeIds).filter(r=>this.activeNodeIds[r]).map(r=>this.getNodeById(r)).filter(Boolean)}get hiddenNodes(){return Object.keys(this.hiddenNodeIds).filter(r=>this.hiddenNodeIds[r]).map(r=>this.getNodeById(r)).filter(Boolean)}get selectedLeafNodes(){return Object.keys(this.selectedLeafNodeIds).filter(r=>this.selectedLeafNodeIds[r]).map(r=>this.getNodeById(r)).filter(Boolean)}getNodeByPath(i,r=null){if(!i)return null;if(r=r||this.virtualRoot,i.length===0)return r;if(!r.children)return null;let o=i.shift(),a=r.children.find(s=>s.id===o);return a?this.getNodeByPath(i,a):null}getNodeById(i){let r=i.toString();return this.getNodeBy(o=>o.id.toString()===r)}getNodeBy(i,r=null){if(r=r||this.virtualRoot,!r.children)return null;let o=r.children.find(i);if(o)return o;for(let a of r.children){let s=this.getNodeBy(i,a);if(s)return s}}isExpanded(i){return this.expandedNodeIds[i.id]}isHidden(i){return this.hiddenNodeIds[i.id]}isActive(i){return this.activeNodeIds[i.id]}isSelected(i){return this.selectedLeafNodeIds[i.id]}ngOnDestroy(){this.dispose(),this.unsubscribeAll()}dispose(){this.virtualRoot&&this.virtualRoot.dispose()}unsubscribeAll(){this.subscriptions.forEach(i=>i.unsubscribe()),this.subscriptions=[]}setData({nodes:i,options:r=null,events:o=null}){r&&(this.options=new bi(r)),o&&(this.events=o),i&&(this.nodes=i),this.update()}update(){let i={id:this.options.rootId,virtual:!0,[this.options.childrenField]:this.nodes};this.dispose(),this.virtualRoot=new V(i,null,this,0),this.roots=this.virtualRoot.children,this.firstUpdate?this.roots&&(this.firstUpdate=!1,this._calculateExpandedNodes()):this.fireEvent({eventName:P.updateData})}setFocusedNode(i){this.focusedNodeId=i?i.id:null}setFocus(i){e.focusedTree=i?this:null}doForAll(i){this.roots.forEach(r=>r.doForAll(i))}focusNextNode(){let i=this.getFocusedNode(),r=i?i.findNextNode(!0,!0):this.getFirstRoot(!0);r&&r.focus()}focusPreviousNode(){let i=this.getFocusedNode(),r=i?i.findPreviousNode(!0):this.getLastRoot(!0);r&&r.focus()}focusDrillDown(){let i=this.getFocusedNode();if(i&&i.isCollapsed&&i.hasChildren)i.toggleExpanded();else{let r=i?i.getFirstChild(!0):this.getFirstRoot(!0);r&&r.focus()}}focusDrillUp(){let i=this.getFocusedNode();if(i)if(i.isExpanded)i.toggleExpanded();else{let r=i.realParent;r&&r.focus()}}setActiveNode(i,r,o=!1){o?this._setActiveNodeMulti(i,r):this._setActiveNodeSingle(i,r),r?(i.focus(this.options.scrollOnActivate),this.fireEvent({eventName:P.activate,node:i}),this.fireEvent({eventName:P.nodeActivate,node:i})):(this.fireEvent({eventName:P.deactivate,node:i}),this.fireEvent({eventName:P.nodeDeactivate,node:i}))}setSelectedNode(i,r){this.selectedLeafNodeIds=Object.assign({},this.selectedLeafNodeIds,{[i.id]:r}),r?(i.focus(),this.fireEvent({eventName:P.select,node:i})):this.fireEvent({eventName:P.deselect,node:i})}setExpandedNode(i,r){this.expandedNodeIds=Object.assign({},this.expandedNodeIds,{[i.id]:r}),this.fireEvent({eventName:P.toggleExpanded,node:i,isExpanded:r})}expandAll(){this.roots.forEach(i=>i.expandAll())}collapseAll(){this.roots.forEach(i=>i.collapseAll())}setIsHidden(i,r){this.hiddenNodeIds=Object.assign({},this.hiddenNodeIds,{[i.id]:r})}setHiddenNodeIds(i){this.hiddenNodeIds=i.reduce((r,o)=>Object.assign(r,{[o]:!0}),{})}performKeyAction(i,r){let o=this.options.actionMapping.keys[r.keyCode];return o?(r.preventDefault(),o(this,i,r),!0):!1}filterNodes(i,r=!0){let o;if(!i)return this.clearFilter();if(i&&typeof i.valueOf()=="string")o=s=>s.displayField.toLowerCase().indexOf(i.toLowerCase())!==-1;else if(i&&typeof i=="function")o=i;else{console.error("Don't know what to do with filter",i),console.error("Should be either a string or function");return}let a={};this.roots.forEach(s=>this._filterNode(a,s,o,r)),this.hiddenNodeIds=a,this.fireEvent({eventName:P.changeFilter})}clearFilter(){this.hiddenNodeIds={},this.fireEvent({eventName:P.changeFilter})}moveNode(i,r){let o=i.getIndexInParent(),a=i.parent;if(!this.canMoveNode(i,r,o))return;let s=a.getField("children");r.parent.getField("children")||r.parent.setField("children",[]);let m=r.parent.getField("children"),C=s.splice(o,1)[0],A=a===r.parent&&r.index>o?r.index-1:r.index;m.splice(A,0,C),a.treeModel.update(),r.parent.treeModel!==a.treeModel&&r.parent.treeModel.update(),this.fireEvent({eventName:P.moveNode,node:C,to:{parent:r.parent.data,index:A},from:{parent:a.data,index:o}})}copyNode(i,r){let o=i.getIndexInParent();if(!this.canMoveNode(i,r,o))return;r.parent.getField("children")||r.parent.setField("children",[]);let a=r.parent.getField("children"),s=this.options.getNodeClone(i);a.splice(r.index,0,s),i.treeModel.update(),r.parent.treeModel!==i.treeModel&&r.parent.treeModel.update(),this.fireEvent({eventName:P.copyNode,node:s,to:{parent:r.parent.data,index:r.index}})}getState(){return{expandedNodeIds:this.expandedNodeIds,selectedLeafNodeIds:this.selectedLeafNodeIds,activeNodeIds:this.activeNodeIds,hiddenNodeIds:this.hiddenNodeIds,focusedNodeId:this.focusedNodeId}}setState(i){i&&Object.assign(this,{expandedNodeIds:i.expandedNodeIds||{},selectedLeafNodeIds:i.selectedLeafNodeIds||{},activeNodeIds:i.activeNodeIds||{},hiddenNodeIds:i.hiddenNodeIds||{},focusedNodeId:i.focusedNodeId})}subscribeToState(i){Tt(()=>i(this.getState()))}canMoveNode(i,r,o=void 0){let a=o||i.getIndexInParent();return i.parent===r.parent&&o===r.index?!1:!r.parent.isDescendantOf(i)}calculateExpandedNodes(){this._calculateExpandedNodes()}_filterNode(i,r,o,a){let s=o(r);return r.children&&r.children.forEach(m=>{this._filterNode(i,m,o,a)&&(s=!0)}),s||(i[r.id]=!0),a&&s&&r.ensureVisible(),s}_calculateExpandedNodes(i=null){i=i||this.virtualRoot,i.data[this.options.isExpandedField]&&(this.expandedNodeIds=Object.assign({},this.expandedNodeIds,{[i.id]:!0})),i.children&&i.children.forEach(r=>this._calculateExpandedNodes(r))}_setActiveNodeSingle(i,r){this.activeNodes.filter(o=>o!==i).forEach(o=>{this.fireEvent({eventName:P.deactivate,node:o}),this.fireEvent({eventName:P.nodeDeactivate,node:o})}),r?this.activeNodeIds={[i.id]:!0}:this.activeNodeIds={}}_setActiveNodeMulti(i,r){this.activeNodeIds=Object.assign({},this.activeNodeIds,{[i.id]:r})}};e.focusedTree=null,e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=ye({token:e,factory:e.\u0275fac});let t=e;return t})();N([E],y.prototype,"roots",void 0);N([E],y.prototype,"expandedNodeIds",void 0);N([E],y.prototype,"selectedLeafNodeIds",void 0);N([E],y.prototype,"activeNodeIds",void 0);N([E],y.prototype,"hiddenNodeIds",void 0);N([E],y.prototype,"focusedNodeId",void 0);N([E],y.prototype,"virtualRoot",void 0);N([R],y.prototype,"focusedNode",null);N([R],y.prototype,"expandedNodes",null);N([R],y.prototype,"activeNodes",null);N([R],y.prototype,"hiddenNodes",null);N([R],y.prototype,"selectedLeafNodes",null);N([M],y.prototype,"setData",null);N([M],y.prototype,"update",null);N([M],y.prototype,"setFocusedNode",null);N([M],y.prototype,"setFocus",null);N([M],y.prototype,"doForAll",null);N([M],y.prototype,"focusNextNode",null);N([M],y.prototype,"focusPreviousNode",null);N([M],y.prototype,"focusDrillDown",null);N([M],y.prototype,"focusDrillUp",null);N([M],y.prototype,"setActiveNode",null);N([M],y.prototype,"setSelectedNode",null);N([M],y.prototype,"setExpandedNode",null);N([M],y.prototype,"expandAll",null);N([M],y.prototype,"collapseAll",null);N([M],y.prototype,"setIsHidden",null);N([M],y.prototype,"setHiddenNodeIds",null);N([M],y.prototype,"filterNodes",null);N([M],y.prototype,"clearFilter",null);N([M],y.prototype,"moveNode",null);N([M],y.prototype,"copyNode",null);N([M],y.prototype,"setState",null);var nn=(()=>{let e=class e{constructor(){this._draggedElement=null}set(i){this._draggedElement=i}get(){return this._draggedElement}isDragging(){return!!this.get()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=ye({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),Ce=function(t,e,n,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(r<3?a(o):r>3?a(e,n,o):a(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},or=500,vi=150,re=(()=>{let e=class e{get y(){return this.yBlocks*vi}get totalHeight(){return this.treeModel.virtualRoot?this.treeModel.virtualRoot.height:0}constructor(){this.treeModel=h(y),this.yBlocks=0,this.x=0,this.viewportHeight=null,this.viewport=null;let i=this.treeModel;i.virtualScroll=this,this._dispose=[Tt(()=>this.fixScroll())]}fireEvent(i){this.treeModel.fireEvent(i)}init(){let i=this.recalcPositions.bind(this);i(),this._dispose=[...this._dispose,$e(()=>this.treeModel.roots,i),$e(()=>this.treeModel.expandedNodeIds,i),$e(()=>this.treeModel.hiddenNodeIds,i)],this.treeModel.subscribe(P.loadNodeChildren,i)}isEnabled(){return this.treeModel.options.useVirtualScroll}_setYBlocks(i){this.yBlocks=i}recalcPositions(){this.treeModel.virtualRoot.height=this._getPositionAfter(this.treeModel.getVisibleRoots(),0)}_getPositionAfter(i,r){let o=r;return i.forEach(a=>{a.position=o,o=this._getPositionAfterNode(a,o)}),o}_getPositionAfterNode(i,r){let o=i.getSelfHeight()+r;return i.children&&i.isExpanded&&(o=this._getPositionAfter(i.visibleChildren,o)),i.height=o-r,o}clear(){this._dispose.forEach(i=>i())}setViewport(i){Object.assign(this,{viewport:i,x:i.scrollLeft,yBlocks:Math.round(i.scrollTop/vi),viewportHeight:i.getBoundingClientRect?i.getBoundingClientRect().height:0})}scrollIntoView(i,r,o=!0){if(i.options.scrollContainer){let a=i.options.scrollContainer,s=a.getBoundingClientRect().height,m=a.getBoundingClientRect().top,C=this.viewport.getBoundingClientRect().top+i.position-m;(r||C<a.scrollTop||C+i.getSelfHeight()>a.scrollTop+s)&&(a.scrollTop=o?C-s/2:C)}else(r||i.position<this.y||i.position+i.getSelfHeight()>this.y+this.viewportHeight)&&this.viewport&&(this.viewport.scrollTop=o?i.position-this.viewportHeight/2:i.position,this._setYBlocks(Math.floor(this.viewport.scrollTop/vi)))}getViewportNodes(i){if(!i)return[];let r=i.filter(C=>!C.isHidden);if(!this.isEnabled())return r;if(!this.viewportHeight||!r.length)return[];let o=r.slice(-1)[0];if(!o.height&&o.position===0)return[];let a=ar(r,C=>C.position+or>this.y||C.position+C.height>this.y),s=ar(r,C=>C.position-or>this.y+this.viewportHeight,a),m=[];for(let C=a;C<=s;C++)m.push(r[C]);return m}fixScroll(){let i=Math.max(0,this.totalHeight-this.viewportHeight);this.y<0&&this._setYBlocks(0),this.y>i&&this._setYBlocks(i/vi)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=ye({token:e,factory:e.\u0275fac});let t=e;return t})();Ce([E],re.prototype,"yBlocks",void 0);Ce([E],re.prototype,"x",void 0);Ce([E],re.prototype,"viewportHeight",void 0);Ce([R],re.prototype,"y",null);Ce([R],re.prototype,"totalHeight",null);Ce([M],re.prototype,"_setYBlocks",null);Ce([M],re.prototype,"recalcPositions",null);Ce([M],re.prototype,"setViewport",null);Ce([M],re.prototype,"scrollIntoView",null);function ar(t,e,n=0){let i=n,r=t.length-1;for(;i!==r;){let o=Math.floor((i+r)/2);e(t[o])?r=o:i===o?i=r:i=o}return i}var Co=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["tree-loading-component"]],inputs:{template:"template",node:"node"},decls:2,vars:5,consts:[[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(r,o){r&1&&(z(0,U2,2,0,"span",0),Se(1,1)),r&2&&(f("ngIf",!o.template),l(),f("ngTemplateOutlet",o.template)("ngTemplateOutletContext",St(3,j2,o.node)))},dependencies:[Ee,ke],encapsulation:2});let t=e;return t})(),yo=(()=>{let e=class e{constructor(){this.elementRef=h(Ye),this.virtualScroll=h(re),this.setViewport=this.throttle(()=>{this.virtualScroll.setViewport(this.elementRef.nativeElement)},17),this.scrollEventHandler=this.setViewport.bind(this)}ngOnInit(){this.virtualScroll.init()}ngAfterViewInit(){setTimeout(()=>{this.setViewport(),this.virtualScroll.fireEvent({eventName:P.initialized})}),this.elementRef.nativeElement.addEventListener("scroll",this.scrollEventHandler)}ngOnDestroy(){this.virtualScroll.clear(),this.elementRef.nativeElement.removeEventListener("scroll",this.scrollEventHandler)}getTotalHeight(){return this.virtualScroll.isEnabled()&&this.virtualScroll.totalHeight+"px"||"auto"}throttle(i,r){let o=0;return function(){let a=Date.now();a-o>=r&&(i(),o=a)}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["tree-viewport"]],features:[Di([re])],ngContentSelectors:G2,decls:1,vars:2,consts:[[4,"treeMobxAutorun"]],template:function(r,o){r&1&&(Mn(),z(0,$2,3,2,"ng-container",0)),r&2&&f("treeMobxAutorun",Fe(1,bt))},dependencies:[Ct],encapsulation:2});let t=e;return t})();function So(...t){return M(...t)}var _o=Object.assign(So,M);function xo(...t){return R(...t)}var Eo=Object.assign(xo,R);function Mo(...t){return E(...t)}var sr=Object.assign(Mo,E),lr="is-dragging-over",cr="is-dragging-over-disabled",ur=(()=>{let e=class e{set treeAllowDrop(i){i instanceof Function?this._allowDrop=i:this._allowDrop=(r,o)=>i}allowDrop(i){return this._allowDrop(this.treeDraggedElement.get(),i)}constructor(){this.el=h(Ye),this.renderer=h(Xe),this.treeDraggedElement=h(nn),this.ngZone=h(zi),this.allowDragoverStyling=!0,this.onDropCallback=new j,this.onDragOverCallback=new j,this.onDragLeaveCallback=new j,this.onDragEnterCallback=new j,this._allowDrop=(i,r)=>!0,this.dragOverEventHandler=this.onDragOver.bind(this),this.dragEnterEventHandler=this.onDragEnter.bind(this),this.dragLeaveEventHandler=this.onDragLeave.bind(this)}ngAfterViewInit(){let i=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{i.addEventListener("dragover",this.dragOverEventHandler),i.addEventListener("dragenter",this.dragEnterEventHandler),i.addEventListener("dragleave",this.dragLeaveEventHandler)})}ngOnDestroy(){let i=this.el.nativeElement;i.removeEventListener("dragover",this.dragOverEventHandler),i.removeEventListener("dragenter",this.dragEnterEventHandler),i.removeEventListener("dragleave",this.dragLeaveEventHandler)}onDragOver(i){if(!this.allowDrop(i))return this.allowDragoverStyling?this.addDisabledClass():void 0;this.onDragOverCallback.emit({event:i,element:this.treeDraggedElement.get()}),i.preventDefault(),this.allowDragoverStyling&&this.addClass()}onDragEnter(i){this.allowDrop(i)&&(i.preventDefault(),this.onDragEnterCallback.emit({event:i,element:this.treeDraggedElement.get()}))}onDragLeave(i){if(!this.allowDrop(i))return this.allowDragoverStyling?this.removeDisabledClass():void 0;this.onDragLeaveCallback.emit({event:i,element:this.treeDraggedElement.get()}),this.allowDragoverStyling&&this.removeClass()}onDrop(i){this.allowDrop(i)&&(i.preventDefault(),this.onDropCallback.emit({event:i,element:this.treeDraggedElement.get()}),this.allowDragoverStyling&&this.removeClass(),this.treeDraggedElement.set(null))}addClass(){this.renderer.addClass(this.el.nativeElement,lr)}removeClass(){this.renderer.removeClass(this.el.nativeElement,lr)}addDisabledClass(){this.renderer.addClass(this.el.nativeElement,cr)}removeDisabledClass(){this.renderer.removeClass(this.el.nativeElement,cr)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275dir=Te({type:e,selectors:[["","treeDrop",""]],hostBindings:function(r,o){r&1&&b("drop",function(s){return o.onDrop(s)})},inputs:{allowDragoverStyling:"allowDragoverStyling",treeAllowDrop:"treeAllowDrop"},outputs:{onDropCallback:"treeDrop",onDragOverCallback:"treeDropDragOver",onDragLeaveCallback:"treeDropDragLeave",onDragEnterCallback:"treeDropDragEnter"}});let t=e;return t})(),pr=(()=>{let e=class e{onDrop(i){this.node.mouseAction("drop",i.event,{from:i.element,to:{parent:this.node,index:this.dropIndex}})}allowDrop(i,r){return this.node.options.allowDrop(i,{parent:this.node,index:this.dropIndex},r)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["TreeNodeDropSlot"],["tree-node-drop-slot"]],inputs:{node:"node",dropIndex:"dropIndex"},decls:1,vars:2,consts:[[1,"node-drop-slot",3,"treeDrop","treeAllowDrop","allowDragoverStyling"]],template:function(r,o){r&1&&(c(0,"div",0),b("treeDrop",function(s){return o.onDrop(s)}),d()),r&2&&f("treeAllowDrop",o.allowDrop.bind(o))("allowDragoverStyling",!0)},dependencies:[ur],encapsulation:2});let t=e;return t})(),No=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["tree-node-checkbox"]],inputs:{node:"node"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],["type","checkbox",1,"tree-node-checkbox",3,"click","checked","indeterminate"]],template:function(r,o){r&1&&z(0,q2,2,2,"ng-container",0),r&2&&f("treeMobxAutorun",Fe(1,bt))},dependencies:[Ct],encapsulation:2});let t=e;return t})(),rn=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["tree-node-expander"]],inputs:{node:"node"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],["class","toggle-children-wrapper",3,"toggle-children-wrapper-expanded","toggle-children-wrapper-collapsed","click",4,"ngIf"],["class","toggle-children-placeholder",4,"ngIf"],[1,"toggle-children-wrapper",3,"click"],[1,"toggle-children"],[1,"toggle-children-placeholder"]],template:function(r,o){r&1&&z(0,Y2,3,2,"ng-container",0),r&2&&f("treeMobxAutorun",Fe(1,bt))},dependencies:[Ct,Ee],encapsulation:2});let t=e;return t})();var wo=(()=>{let e=class e{constructor(){this.el=h(Ye),this.renderer=h(Xe),this.treeDraggedElement=h(nn),this.ngZone=h(zi),this.dragEventHandler=this.onDrag.bind(this)}ngAfterViewInit(){let i=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{i.addEventListener("drag",this.dragEventHandler)})}ngDoCheck(){this.renderer.setAttribute(this.el.nativeElement,"draggable",this.treeDragEnabled?"true":"false")}ngOnDestroy(){this.el.nativeElement.removeEventListener("drag",this.dragEventHandler)}onDragStart(i){i.dataTransfer.setData("text",i.target.id),this.treeDraggedElement.set(this.draggedElement),this.draggedElement.mouseAction&&this.draggedElement.mouseAction("dragStart",i)}onDrag(i){this.draggedElement.mouseAction&&this.draggedElement.mouseAction("drag",i)}onDragEnd(){this.draggedElement.mouseAction&&this.draggedElement.mouseAction("dragEnd"),this.treeDraggedElement.set(null)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275dir=Te({type:e,selectors:[["","treeDrag",""]],hostBindings:function(r,o){r&1&&b("dragstart",function(s){return o.onDragStart(s)})("dragend",function(){return o.onDragEnd()})},inputs:{draggedElement:[0,"treeDrag","draggedElement"],treeDragEnabled:"treeDragEnabled"}});let t=e;return t})(),on=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["tree-node-content"]],inputs:{node:"node",index:"index",template:"template"},decls:2,vars:7,consts:[[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(r,o){r&1&&(z(0,Q2,2,1,"span",0),Se(1,1)),r&2&&(f("ngIf",!o.template),l(),f("ngTemplateOutlet",o.template)("ngTemplateOutletContext",wn(3,X2,o.node,o.node,o.index)))},dependencies:[Ee,ke],encapsulation:2});let t=e;return t})(),zo=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["tree-node-wrapper"]],inputs:{node:"node",index:"index",templates:"templates"},decls:2,vars:8,consts:[["class","node-wrapper",3,"padding-left",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"node-wrapper"],[3,"node",4,"ngIf"],[3,"node"],[1,"node-content-wrapper",3,"click","dblclick","mouseover","mouseout","contextmenu","treeDrop","treeDropDragOver","treeDropDragLeave","treeDropDragEnter","treeAllowDrop","allowDragoverStyling","treeDrag","treeDragEnabled"],[3,"node","index","template"]],template:function(r,o){r&1&&(z(0,Z2,5,15,"div",0),Se(1,1)),r&2&&(f("ngIf",!o.templates.treeNodeWrapperTemplate),l(),f("ngTemplateOutlet",o.templates.treeNodeWrapperTemplate)("ngTemplateOutletContext",Ht(3,fr,o.node,o.node,o.index,o.templates)))},dependencies:[Ee,No,rn,wo,ur,on,ke],encapsulation:2});let t=e;return t})(),dr=1.005,Lo=(()=>{let e=class e{constructor(){this.renderer=h(Xe),this.templateRef=h(Ni),this.viewContainerRef=h(wi)}set isOpen(i){i?(this._show(),this.isEnabled&&this._isOpen===!1&&this._animateOpen()):this.isEnabled?this._animateClose():this._hide(),this._isOpen=!!i}_show(){this.innerElement||(this.innerElement=this.viewContainerRef.createEmbeddedView(this.templateRef).rootNodes[0])}_hide(){this.viewContainerRef.clear(),this.innerElement=null}_animateOpen(){let i=this.animateSpeed,r=this.animateAcceleration,o=0;this.renderer.setStyle(this.innerElement,"max-height","0"),setTimeout(()=>{let a=setInterval(()=>{if(!this._isOpen||!this.innerElement)return clearInterval(a);o+=i;let s=Math.round(o);this.renderer.setStyle(this.innerElement,"max-height",`${s}px`);let m=this.innerElement.getBoundingClientRect?this.innerElement.getBoundingClientRect().height:0;i*=r,r*=dr,m<s&&(this.renderer.setStyle(this.innerElement,"max-height",null),clearInterval(a))},17)})}_animateClose(){if(!this.innerElement)return;let i=this.animateSpeed,r=this.animateAcceleration,o=this.innerElement.getBoundingClientRect().height,a=setInterval(()=>{if(this._isOpen||!this.innerElement)return clearInterval(a);o-=i,this.renderer.setStyle(this.innerElement,"max-height",`${o}px`),i*=r,r*=dr,o<=0&&(this.viewContainerRef.clear(),this.innerElement=null,clearInterval(a))},17)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275dir=Te({type:e,selectors:[["","treeAnimateOpen",""]],inputs:{animateSpeed:[0,"treeAnimateOpenSpeed","animateSpeed"],animateAcceleration:[0,"treeAnimateOpenAcceleration","animateAcceleration"],isEnabled:[0,"treeAnimateOpenEnabled","isEnabled"],isOpen:[0,"treeAnimateOpen","isOpen"]}});let t=e;return t})(),gi=function(t,e,n,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(o=(r<3?a(o):r>3?a(e,n,o):a(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},Oo=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["tree-node-children"]],inputs:{node:"node",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"tree-children","tree-children-no-padding",4,"treeAnimateOpen","treeAnimateOpenSpeed","treeAnimateOpenAcceleration","treeAnimateOpenEnabled"],[3,"nodes","templates","treeModel",4,"ngIf"],["class","tree-node-loading",3,"padding-left","template","node",4,"ngIf"],[3,"nodes","templates","treeModel"],[1,"tree-node-loading",3,"template","node"]],template:function(r,o){r&1&&z(0,no,2,4,"ng-container",0),r&2&&f("treeMobxAutorun",Fe(1,bt))},dependencies:()=>[Ct,Lo,Ee,hr,Co],encapsulation:2});let t=e;return t})(),hr=(()=>{let e=class e{constructor(){this._dispose=[]}get nodes(){return this._nodes}set nodes(i){this.setNodes(i)}get marginTop(){let i=this.viewportNodes&&this.viewportNodes.length&&this.viewportNodes[0];return`${i&&i.parent?i.position-i.parent.position-i.parent.getSelfHeight():0}px`}setNodes(i){this._nodes=i}ngOnInit(){this.virtualScroll=this.treeModel.virtualScroll,this._dispose=[$e(()=>this.virtualScroll.getViewportNodes(this.nodes).map(i=>i.index),i=>{this.viewportNodes=i.map(r=>this.nodes[r])},{compareStructural:!0,fireImmediately:!0}),$e(()=>this.nodes,i=>{this.viewportNodes=this.virtualScroll.getViewportNodes(i)})]}ngOnDestroy(){this._dispose.forEach(i=>i())}trackNode(i,r){return r.id}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["tree-node-collection"]],inputs:{nodes:"nodes",treeModel:"treeModel",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"node","index","templates",4,"ngFor","ngForOf","ngForTrackBy"],[3,"node","index","templates"]],template:function(r,o){r&1&&z(0,oo,3,4,"ng-container",0),r&2&&f("treeMobxAutorun",Fe(1,bt))},dependencies:()=>[Ct,zn,Ao],encapsulation:2});let t=e;return gi([sr],t.prototype,"_nodes",void 0),gi([sr],t.prototype,"viewportNodes",void 0),gi([Eo],t.prototype,"marginTop",null),gi([_o],t.prototype,"setNodes",null),t})(),Ao=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["TreeNode"],["tree-node"]],inputs:{node:"node",index:"index",templates:"templates"},decls:1,vars:2,consts:[[4,"treeMobxAutorun"],[3,"class","tree-node","tree-node-expanded","tree-node-collapsed","tree-node-leaf","tree-node-active","tree-node-focused",4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"dropIndex","node",4,"ngIf"],[3,"node","index","templates"],[3,"node","templates"],[3,"dropIndex","node"]],template:function(r,o){r&1&&z(0,lo,3,8,"ng-container",0),r&2&&f("treeMobxAutorun",Fe(1,bt))},dependencies:[Ct,Ee,pr,zo,Oo,ke],encapsulation:2});let t=e;return t})(),mr=(()=>{let e=class e{set nodes(i){}set options(i){}set focused(i){this.treeModel.setFocus(i)}set state(i){this.treeModel.setState(i)}constructor(){this.treeModel=h(y),this.treeDraggedElement=h(nn);let i=this.treeModel;i.eventNames.forEach(r=>this[r]=new j),i.subscribeToState(r=>this.stateChange.emit(r))}onKeydown(i){if(!this.treeModel.isFocused||["input","textarea"].includes(document.activeElement.tagName.toLowerCase()))return;let r=this.treeModel.getFocusedNode();this.treeModel.performKeyAction(r,i)}onMousedown(i){function r(o,a){return o?o.localName===a?!1:r(o.parentElement,a):!0}r(i.target,"tree-root")&&this.treeModel.setFocus(!1)}ngOnChanges(i){(i.options||i.nodes)&&this.treeModel.setData({options:i.options&&i.options.currentValue,nodes:i.nodes&&i.nodes.currentValue,events:this.pick(this,this.treeModel.eventNames)})}sizeChanged(){this.viewportComponent.setViewport()}pick(i,r){return r.reduce((o,a)=>(i&&i.hasOwnProperty(a)&&(o[a]=i[a]),o),{})}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["Tree"],["tree-root"]],contentQueries:function(r,o,a){if(r&1&&(yt(a,co,5),yt(a,fo,5),yt(a,uo,5),yt(a,po,5)),r&2){let s;_e(s=xe())&&(o.loadingTemplate=s.first),_e(s=xe())&&(o.treeNodeTemplate=s.first),_e(s=xe())&&(o.treeNodeWrapperTemplate=s.first),_e(s=xe())&&(o.treeNodeFullTemplate=s.first)}},viewQuery:function(r,o){if(r&1&&Vt(ho,5),r&2){let a;_e(a=xe())&&(o.viewportComponent=a.first)}},hostBindings:function(r,o){r&1&&b("keydown",function(s){return o.onKeydown(s)},Mi)("mousedown",function(s){return o.onMousedown(s)},Mi)},inputs:{nodes:"nodes",options:"options",focused:"focused",state:"state"},outputs:{toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",updateData:"updateData",initialized:"initialized",moveNode:"moveNode",copyNode:"copyNode",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",event:"event",stateChange:"stateChange"},features:[Di([y]),Ft],decls:5,vars:6,consts:[["viewport",""],[1,"angular-tree-component"],[3,"nodes","treeModel","templates",4,"ngIf"],["class","empty-tree-drop-slot",3,"dropIndex","node",4,"ngIf"],[3,"nodes","treeModel","templates"],[1,"empty-tree-drop-slot",3,"dropIndex","node"]],template:function(r,o){r&1&&(c(0,"tree-viewport",null,0)(2,"div",1),z(3,vo,1,8,"tree-node-collection",2)(4,go,1,2,"tree-node-drop-slot",3),d()()),r&2&&(l(2),q("node-dragging",o.treeDraggedElement.isDragging())("angular-tree-component-rtl",o.treeModel.options.rtl),l(),f("ngIf",o.treeModel.roots),l(),f("ngIf",o.treeModel.isEmptyTree()))},dependencies:[yo,Ee,hr,pr],encapsulation:2});let t=e;return t})(),vr=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Cn({type:e}),e.\u0275inj=bn({imports:[Ln]});let t=e;return t})();var S=(function(t){return t.MAKE="make",t.COPY="copy",t.MOVE="move",t.DELETE="delete",t.COMPRESS="compress",t.DECOMPRESS="decompress",t.DOWNLOAD="download",t.UPLOAD="upload",t.TOUCH="touch",t.THUMBNAIL="thumbnail",t})(S||{});var Y0=".selected",X0="drag-over";var Ci=(()=>{let e=class e{constructor(){this.overFlowX="hidden",this.resizeOffset=80,this.useMaxHeight=!0,this.elementRef=h(Ye),this.renderer=h(Xe),this.layout=h(U),this.renderer.setStyle(this.elementRef.nativeElement,"overflow-y","auto"),this.renderer.setStyle(this.elementRef.nativeElement,"scrollbar-width","thin"),this.resizeSubscription=this.layout.resizeEvent.pipe(vn(1)).subscribe(()=>this.onResize())}ngAfterViewInit(){this.renderer.setStyle(this.elementRef.nativeElement,"overflow-x",this.overFlowX),this.onResize()}ngOnDestroy(){this.resizeSubscription.unsubscribe()}scrollTop(){this.renderer.setProperty(this.elementRef.nativeElement,"scrollTop","0")}scrollIntoView(i=0){setTimeout(()=>this.elementRef.nativeElement.scrollTo({left:0,top:i,behavior:"smooth"}),50)}onResize(){this.renderer.setStyle(this.elementRef.nativeElement,this.useMaxHeight?"max-height":"height",`${window.innerHeight-this.resizeOffset-1}px`)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275dir=Te({type:e,selectors:[["","appAutoResize",""]],inputs:{overFlowX:"overFlowX",resizeOffset:"resizeOffset",useMaxHeight:"useMaxHeight"}});let t=e;return t})();var H={BASE:e1.BASE,OPERATION:"operation",TASK_OPERATION:"task/operation",TASKS:"tasks",TASKS_DOWNLOAD:"download",RECENTS:"recents",SEARCH:"search",ONLY_OFFICE:"onlyoffice",ONLY_OFFICE_SETTINGS:"settings",ONLY_OFFICE_DOCUMENT:"document",ONLY_OFFICE_CALLBACK:"callback"},sn=`${H.BASE}/${H.OPERATION}`,sa=`${sn}/${S.THUMBNAIL}`,ln=`${sn}/${S.MAKE}`,la=`${sn}/${S.UPLOAD}`,cn=`${H.BASE}/${H.TASK_OPERATION}`,gr=`${cn}/${S.DOWNLOAD}`,br=`${cn}/${S.COMPRESS}`,Cr=`${cn}/${S.DECOMPRESS}`,Pt=`${H.BASE}/${H.TASKS}`,yr=`${H.BASE}/${H.TASKS}/${H.TASKS_DOWNLOAD}`,Sr=`${H.BASE}/${H.RECENTS}`,_r=`${H.BASE}/${H.SEARCH}`,dn=`${H.BASE}/${H.ONLY_OFFICE}`,ca=`${dn}/${H.ONLY_OFFICE_SETTINGS}`,da=`${dn}/${H.ONLY_OFFICE_DOCUMENT}`,fa=`${dn}/${H.ONLY_OFFICE_CALLBACK}`;var yi=class{constructor(e){Object.assign(this,e),this.mimeUrl=He(this.mime),this.setInfos()}fallBackMimeUrl(){this.mimeUrl=lt}setInfos(){let e=this.path.split("/")[0],n=this.path.split("/")[1]===Me.PERSONAL;this.showedPath=this.path.split("/").slice(n?2:1).join("/"),this.iconClass=e===Z.SHARES?"purple":"primary",this.icon=e===Z.SHARES?W.SHARES:n?W.PERSONAL:W.SPACES}};var Si=class{constructor(e){this.inTrash=!1,Object.assign(this,e),this.mimeUrl=He(this.mime),this.iconClass=this.shareId?"purple":"primary",this.icon=this.shareId?W.SHARES:this.spaceId?W.SPACES:W.PERSONAL,this.showedPath=this.path.split("/").slice(this.path.split("/")[1]===Me.PERSONAL?2:1).join("/"),this.inTrash=this.path.split("/")[0]===Z.TRASH}fallBackMimeUrl(){this.mimeUrl=lt}};var We=(function(t){return t[t.PENDING=0]="PENDING",t[t.SUCCESS=1]="SUCCESS",t[t.ERROR=2]="ERROR",t})(We||{}),_i=class{constructor(e,n,i,r){this.props={},this.id=e,this.type=n,this.path=i,this.name=r,(n===S.COPY||n===S.MOVE||n===S.DOWNLOAD)&&(this.props={progress:1},n!==S.DOWNLOAD&&(this.props.src={name:r,path:i}))}};var xr=(()=>{let e=class e{constructor(){this.http=h(jt),this.layout=h(U),this.store=h(ot),this.onDone={[S.DELETE]:{title:"Deletion",fileEvent:{delete:!0}},[S.MOVE]:{title:"Move",fileEvent:{delete:!0,reloadFocusOnDst:!0}},[S.COPY]:{title:"Copy",fileEvent:{reload:!0,focus:!0}},[S.DOWNLOAD]:{title:"Download",fileEvent:{reload:!0,focus:!0}},[S.UPLOAD]:{title:"Upload",fileEvent:{reload:!0,focus:!0}},[S.COMPRESS]:{title:"Compression",fileEvent:{reload:!0,focus:!0}},[S.DECOMPRESS]:{title:"Decompression",fileEvent:{reload:!0,focus:!0}}},this.watcher=null,this.watch=mn(1e3,1e3).pipe(gn(()=>this.doWatch())),this.loadAll()}addTask(i){i.status===We.PENDING?(this.store.filesActiveTasks.next([i,...this.store.filesActiveTasks.getValue()]),this.startWatch()):this.store.filesEndedTasks.next([i,...this.store.filesEndedTasks.getValue()])}createUploadTask(i,r,o){let a=new _i(Qn(),S.UPLOAD,i,r);return a.status=We.PENDING,a.startedAt=Xn(null,!0),a.props={progress:1,size:0,totalSize:o},this.store.filesActiveTasks.next([a,...this.store.filesActiveTasks.getValue()]),this.layout.showRSideBarTab(nt.TASKS,!0),a}removeAll(){this.http.delete(Pt).subscribe({next:()=>this.clearEndedTasks(),error:i=>console.error(i)})}remove(i){this.http.delete(`${Pt}/${i.id}`).subscribe({next:()=>this.deleteTask(i.id,!1),error:r=>console.error(r)})}updateTask(i){if(i.status===We.PENDING){let r=this.findTask(i.id,!0);Object.assign(r,i)}else this.deleteTask(i.id,!0),this.addTask(i),this.taskDone(i)}loadAll(){this.http.get(Pt).subscribe({next:i=>i.forEach(r=>this.addTask(r)),error:i=>console.error(i)})}doWatch(){this.store.filesActiveTasks.getValue().length?this.fetchActiveTasks():this.stopWatch()}startWatch(){(!this.watcher||this.watcher.closed)&&(this.layout.showRSideBarTab(nt.TASKS,!0),this.watcher=this.watch.subscribe())}stopWatch(){(this.watcher||!this.watcher.closed)&&(setTimeout(()=>this.layout.hideRSideBarTab(nt.TASKS),3e3),this.watcher.unsubscribe())}fetchActiveTasks(){for(let i of this.store.filesActiveTasks.getValue().filter(r=>r.type!==S.UPLOAD))this.http.get(`${Pt}/${i.id}`).subscribe({next:r=>this.updateTask(r),error:r=>{r.status===404&&(i.result=r.error.message,i.status=We.ERROR,this.updateTask(i)),console.warn(r)}})}findTask(i,r){return r?this.store.filesActiveTasks.getValue().find(o=>o.id===i):this.store.filesEndedTasks.getValue().find(o=>o.id===i)}deleteTask(i,r){r?this.store.filesActiveTasks.next(this.store.filesActiveTasks.getValue().filter(o=>o.id!==i)):this.store.filesEndedTasks.next(this.store.filesEndedTasks.getValue().filter(o=>o.id!==i))}taskDone(i){if(i.type in this.onDone){if(this.onDone[i.type].fileEvent){let r=De(Q({},this.onDone[i.type].fileEvent),{status:i.status});i.type===S.COPY||i.type===S.MOVE?(r.filePath=i.props.src.path,r.fileName=i.props.src.name,r.fileDstPath=i.path):(r.filePath=i.path,r.fileName=i.name,i.type===S.COMPRESS&&(r.archiveId=i.props.compressInDirectory===!1?i.id:null)),this.store.filesOnEvent.next(r)}i.status===We.SUCCESS?i.type===S.DELETE?this.removeDeletedChildTasks(i):this.layout.sendNotification("info",`${this.onDone[i.type].title} done`,i.name):this.layout.sendNotification("error",`${this.onDone[i.type].title} failed`,i.name,{error:{message:i.result}})}}removeDeletedChildTasks(i){if(i.path.startsWith(Z.SHARES))this.remove(i);else if(i.path.startsWith(Z.TRASH)){for(let r of this.store.filesEndedTasks.getValue().filter(o=>o.id!==i.id&&o.type===S.DELETE&&o.path.startsWith(Z.FILES))){let o=i.path.replace(Z.TRASH,Z.FILES);new RegExp(`^${d1(`${o}/${i.name}`)}(/|$)`).test(`${r.path}/${r.name}`)&&this.remove(r)}this.remove(i)}}clearEndedTasks(){this.store.filesEndedTasks.next([])}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=ye({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var Er=(()=>{let e=class e{constructor(){this.treeNodeSelected=null,this.treeCopyMoveOn=new pn,this.clipboardAction="copyPaste",this.http=h(jt),this.layout=h(U),this.store=h(ot),this.sanitizer=h(On),this.filesTasksService=h(xr)}getTreeNode(i,r=!1){return hn(this.http.get(`${t1}/${i}`,{params:r?new Ti().set("showFiles",r):null}))}addToClipboard(i){if(i.length)if(!this.store.filesClipboard.getValue().length)this.layout.showRSideBarTab(nt.CLIPBOARD,!0),this.store.filesClipboard.next(i);else{let r=i.filter(o=>this.store.filesClipboard.getValue().indexOf(o)===-1);r.length&&this.store.filesClipboard.next([...r,...this.store.filesClipboard.getValue()])}}removeFromClipboard(i){this.store.filesClipboard.next(this.store.filesClipboard.getValue().filter(r=>r.id!==i.id))}clearClipboard(){this.store.filesClipboard.next([])}onPasteClipboard(i){let r=i||this.clipboardAction;if(this.store.filesClipboard.getValue().length){let o=this.currentRoute;this.copyMove([...this.store.filesClipboard.getValue()],o,r==="copyPaste"?S.COPY:S.MOVE),this.clearClipboard()}}download(i){Ii(i.dataUrl)}copyMove(i,r,o){let a=o===S.MOVE;for(let s of i){a&&(s.isBeingDeleted=!0);let m={dstDirectory:r};this.http.request(o,s.taskUrl,{body:m}).subscribe({next:C=>this.filesTasksService.addTask(C),error:C=>{a&&(s.isBeingDeleted=!1),this.layout.sendNotification("error",o==="move"?"Move failed":"Copy failed",s.name,C)}})}}rename(i,r){if(!this.isValidName(r))return;let a={dstDirectory:i.path.split("/").slice(0,-1).join("/")||".",dstName:r};this.http.request(S.MOVE,i.dataUrl,{body:a}).subscribe({next:s=>{i.rename(s.name),i.isEditable=!1},error:s=>this.layout.sendNotification("error","Rename",i.name,s)})}delete(i){for(let r of i)r.isBeingDeleted=!0,this.http.delete(r.taskUrl).subscribe({next:o=>this.filesTasksService.addTask(o),error:o=>{r.isBeingDeleted=!1,this.layout.sendNotification("error","Deletion failed",r.name,o)}})}make(i,r,o=null,a=!1){if(!this.isValidName(r))return;o=o||this.currentRoute;let s={type:i};if(a)return this.http.post(`${ln}/${o}/${r}`,s);this.http.post(`${ln}/${o}/${r}`,s).subscribe({next:()=>this.store.filesOnEvent.next({filePath:o,fileName:r,focus:!0,reload:!0}),error:m=>this.layout.sendNotification("error","Creation failed",r,m)})}compress(i){let r=this.currentRoute;this.http.post(`${br}/${r}/${i.name}.${i.extension}`,i).subscribe({next:o=>this.filesTasksService.addTask(o),error:o=>this.layout.sendNotification("error","Compression failed",i.name,o)})}decompress(i){let r=this.currentRoute;this.http.post(`${Cr}/${r}/${i.name}`,null).subscribe({next:o=>this.filesTasksService.addTask(o),error:o=>this.layout.sendNotification("error","Compression failed",i.name,o)})}downloadFromUrl(i,r){if(!this.isValidName(r))return;let o=this.currentRoute,a={url:i};this.http.post(`${gr}/${o}/${r}`,a).subscribe({next:s=>this.filesTasksService.addTask(s),error:s=>this.layout.sendNotification("error","Download failed",i,s)})}downloadTaskArchive(i){Ii(`${yr}/${i}`)}loadRecents(i){this.http.get(Sr,{params:new Ti().set("limit",i)}).pipe(Ei(r=>r.map(o=>new Si(o)))).subscribe({next:r=>{this.store.filesRecents.update(o=>[...r,...o.slice(i)])},error:r=>this.layout.sendNotification("error","Files","Unable to load",r)})}search(i){return this.http.request("search",_r,{body:i}).pipe(Ei(r=>r.map(o=>(o.content&&(o.content=this.sanitizer.bypassSecurityTrustHtml(o.content)),new yi(o)))))}isValidName(i){try{return Yn(i),!0}catch(r){return this.layout.sendNotification("error","Rename",`${this.layout.translateString(r.message)} : ${Kn}`),!1}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=ye({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var To=["tree"];function Io(t,e){if(t&1&&(c(0,"span",8),p(1),d()),t&2){let n=u(2);l(),k(n.errorMsg)}}function Ro(t,e){t&1&&(c(0,"span",9),p(1,"Navigation Tree"),d())}function Po(t,e){if(t&1){let n=F();c(0,"div",3)(1,"button",6),b("click",function(){_(n);let r=u();return x(r.onRefresh())}),g(2,"fa-icon",7),d(),L(3,Io,2,1,"span",8)(4,Ro,2,0,"span",9),d()}if(t&2){let n=u();l(2),f("icon",n.icons.faArrowRotateRight),l(),O(n.errorMsg?3:4)}}function Fo(t,e){if(t&1&&(c(0,"span")(1,"span"),p(2),d()()),t&2){let n=u(2);l(2),k(n.store.filesSelection()[0].name)}}function ko(t,e){if(t&1&&(c(0,"span"),g(1,"fa-icon",18),d()),t&2){let n=u(2);l(),f("icon",n.icons.faQuestion)}}function Vo(t,e){if(t&1&&(c(0,"span")(1,"span"),p(2),d(),p(3,"\xA0"),c(4,"span",9),p(5,"items"),d()()),t&2){let n=u(2);l(2),k(n.store.filesSelection().length)}}function Ho(t,e){if(t&1){let n=F();c(0,"div",10)(1,"div",11)(2,"span",12)(3,"span",9),p(4,"Source"),d(),p(5,":"),d(),L(6,Fo,3,1,"span")(7,ko,2,1,"span")(8,Vo,6,1,"span"),d(),c(9,"div",13)(10,"span",12)(11,"span",9),p(12,"Destination"),d(),p(13,":"),d(),c(14,"span"),p(15),d()(),c(16,"div",14)(17,"button",15),b("click",function(){_(n);let r=u();return x(r.actionMove())}),g(18,"fa-icon",7),p(19," Move "),d(),c(20,"button",15),b("click",function(){_(n);let r=u();return x(r.actionCopy())}),g(21,"fa-icon",7),p(22," Copy "),d(),c(23,"button",16),b("click",function(){_(n);let r=u();return x(r.actionCancel())}),g(24,"fa-icon",7),p(25," Cancel "),d()()(),g(26,"hr",17)}if(t&2){let n,i=u();l(6),O((n=i.store.filesSelection().length)===1?6:n===0?7:8),l(9),k((i.selection==null?null:i.selection.data.name)||""),l(2),f("disabled",!i.selection||!i.store.filesSelection().length||!i.srcAllowed||!i.dstAllowed),l(),f("icon",i.icons.faArrowsAlt),l(2),f("disabled",!i.selection||!i.store.filesSelection().length||!i.dstAllowed),l(),f("icon",i.icons.faClone),l(3),f("icon",i.icons.faTimes)}}function Bo(t,e){if(t&1){let n=F();c(0,"div",19),b("click",function(r){let o=_(n).$implicit;return x(o.mouseAction("click",r))})("tap",function(r){let o=_(n).$implicit;return x(o.mouseAction("dblClick",r))}),g(1,"tree-node-expander",20),c(2,"div",21),g(3,"tree-node-content",22),d()()}if(t&2){let n=e.index,i=e.$implicit;Pe("padding-left",i.getNodePadding()),q("tree-selected",i.isActive)("tree-disabled",!i.data.enabled),l(),q("toggle-children-file",!i.data.isDir)("toggle-children-shared",i.data.inShare),f("node",i),l(),q("node-content-wrapper-active",i.isActive),l(),f("index",n)("node",i)}}function jo(t,e){if(t&1&&(c(0,"span"),g(1,"fa-icon",23),d()),t&2){let n=u();l(),f("icon",n.icons.faSpinner)}}var Mr=(()=>{let e=class e{constructor(){this.selected=new j,this.showFiles=!1,this.allowShares=!0,this.allowSpaces=!0,this.enableCopyMove=!0,this.enableNavigateTo=!0,this.sideBarHeader=!0,this.resizeOffset=80,this.toggleNodesAtStartup=!1,this.store=h(ot),this.icons={faArrowRotateRight:$n,faArrowsAlt:jn,faClone:Fn,faTimes:Un,faFolder:Hn,faFile:ei,faQuestion:Pn,faAnglesRight:qn,faSpinner:Kt},this.options={actionMapping:{mouse:{click:(i,r,o)=>this.onSelect(i,r,o),dblClick:(i,r)=>this.onOpen(r),expanderClick:()=>null}},animateExpand:!1,levelPadding:10,useVirtualScroll:!1,nodeHeight:30,dropSlotHeight:0,allowDrag:!1,allowDrop:!1,getChildren:i=>this.getTreeNode(i)},this.srcAllowed=!0,this.dstAllowed=!0,this.errorMsg=null,this.layout=h(U),this.router=h(An),this.user=h(Xt),this.filesService=h(Er),this.copyMoveOnHeight=80,this.subscriptions=[],this.preventDblClick=!1,this._copyMoveOn=!1,this.enableCopyMove&&this.subscriptions.push(Rn(this.store.filesSelection).subscribe(()=>this.checkAllowed(this.selection)))}get copyMoveOn(){return this._copyMoveOn}set copyMoveOn(i){this._copyMoveOn!==i&&(this._copyMoveOn=i,i?this.resizeOffset+=this.copyMoveOnHeight:this.resizeOffset-=this.copyMoveOnHeight,setTimeout(()=>this.layout.resizeEvent.next(),0))}get selection(){return this.filesService.treeNodeSelected}set selection(i){this.filesService.treeNodeSelected=i,i&&([0,-1,-2].indexOf(i.data.id)===-1?this.selected.emit(i.data):this.selected.emit(null))}ngOnInit(){this.enableCopyMove&&this.subscriptions.push(this.filesService.treeCopyMoveOn.subscribe(()=>this.onCopyMove())),this.initRoot(),setTimeout(()=>this.focusLastNode(),100)}ngOnDestroy(){this.subscriptions.forEach(i=>i.unsubscribe())}onRefresh(){this.tree.treeModel.activeNodes.length?this.tree.treeModel.activeNodes.forEach(i=>{i.loadNodeChildren().then(()=>this.tree.treeModel.update())}):(this.user.userHavePermission(Ve.PERSONAL_SPACE)&&this.tree.treeModel.getNodeById(0).loadNodeChildren().then(()=>this.tree.treeModel.update()),this.user.userHavePermission(Ve.SPACES)&&this.tree.treeModel.getNodeById(-1).loadNodeChildren().then(()=>this.tree.treeModel.update()),this.allowShares&&this.user.userHavePermission(Ve.SHARES)&&this.tree.treeModel.getNodeById(-2).loadNodeChildren().then(()=>this.tree.treeModel.update()))}actionCancel(){this.copyMoveOn=!1,this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!0}actionCopy(){this.filesService.copyMove(this.store.filesSelection(),this.selection.data.path,S.COPY),this.copyMoveOn=!1}actionMove(){this.filesService.copyMove(this.store.filesSelection(),this.selection.data.path,S.MOVE),this.copyMoveOn=!1}initRoot(){if(this.nodes=[],this.user.userHavePermission(Ve.PERSONAL_SPACE)){let i={id:0,name:this.layout.translateString(Yt.PERSONAL_FILES),path:`${st.FILES}/${Me.PERSONAL}`,isDir:!0,inShare:!1,mime:Ne,quotaIsExceeded:this.store.user.getValue().quotaIsExceeded,enabled:!0,permissions:Zn,children:null,hasChildren:!0,isExpanded:!1};this.checkToggleNodeAtStartup(i,!0)}if(this.allowSpaces&&this.user.userHavePermission(Ve.SPACES)){let i={id:-1,name:this.layout.translateString(Yt.SPACES),path:st.SPACES,isDir:!0,mime:Ne,inShare:!1,hasChildren:!0,quotaIsExceeded:!1,enabled:!0,permissions:"",children:null,isExpanded:!1};this.checkToggleNodeAtStartup(i)}if(this.allowShares&&this.user.userHavePermission(Ve.SHARES)){let i={id:-2,name:this.layout.translateString(Yt.SHARES),path:st.SHARES,isDir:!0,mime:Ne,inShare:!0,hasChildren:!0,quotaIsExceeded:!1,enabled:!0,permissions:"",children:null,isExpanded:!1};this.checkToggleNodeAtStartup(i)}}checkToggleNodeAtStartup(i,r=!1){this.toggleNodesAtStartup?this.getTreeNode(i).then(o=>{i.children=o,r?this.nodes.unshift(i):this.nodes.push(i),this.tree.treeModel.update(),this.toggleExpand(this.tree,this.tree.treeModel.getNodeById(i.id),null)}):(r?this.nodes.unshift(i):this.nodes.push(i),this.tree.treeModel.update())}focusLastNode(){this.selection&&(this.selection=this.tree.treeModel.getNodeById(this.selection.data.id),this.selection&&I.ACTIVATE(this.tree,this.selection,null))}getTreeNode(i){return this.filesService.getTreeNode(i?.data?.path||i?.path||i,this.showFiles)}collapseChildren(i,r){for(let o of r)[0,-1,-2].indexOf(o.id)===-1&&o.id!==i.id&&(o.data.isExpanded=!1,o.collapse())}toggleExpand(i,r,o){I.TOGGLE_EXPANDED(i,r,o),r.data.isExpanded=!!r.data.isExpanded}onOpen(i){if(!this.copyMoveOn&&this.enableNavigateTo&&i.data.enabled){clearTimeout(this.preventTimer),this.preventDblClick=!0;let r=i.data.path.split("/");r[0]!==st.SPACES&&r.unshift(st.SPACES),this.router.navigate(r).catch(console.error)}}onSelect(i,r,o){if(!r.data.enabled){this.layout.sendNotification("warning",r.data.name,`${r.data.inShare?"Share":"Space"} is disabled`);return}I.ACTIVATE(i,r,o),this.preventTimer=setTimeout(()=>{this.checkAllowed(r),this.selection=r,this.preventDblClick||r.hasChildren&&(this.collapseChildren(r,r.parent.children),this.toggleExpand(i,r,o)),this.preventDblClick=!1},200)}checkAllowed(i){if(this.copyMoveOn){if(this.store.filesSelection().length)for(let r of this.store.filesSelection()){if(r.root?.alias){this.errorMsg="You can not move an anchored file",this.srcAllowed=!1,this.dstAllowed=!0;return}if(r.lock&&r.lock.ownerLogin!==this.store.user.getValue().login){this.errorMsg="You can not move a locked file",this.srcAllowed=!1,this.dstAllowed=!0;return}}if(i){if([-1,-2].indexOf(i.data.id)>-1){this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!1;return}else if(i.data.permissions.indexOf(at.ADD)===-1){this.errorMsg="You are not allowed to write here",this.srcAllowed=!0,this.dstAllowed=!1;return}else if(i.data.quotaIsExceeded){this.errorMsg="No more space available",this.srcAllowed=!0,this.dstAllowed=!1;return}}this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!0}}onCopyMove(){this.onRefresh(),this.copyMoveOn=!0,this.checkAllowed(this.selection)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["app-files-tree"]],viewQuery:function(r,o){if(r&1&&Vt(To,7),r&2){let a;_e(a=xe())&&(o.tree=a.first)}},inputs:{showFiles:"showFiles",allowShares:"allowShares",allowSpaces:"allowSpaces",enableCopyMove:"enableCopyMove",enableNavigateTo:"enableNavigateTo",sideBarHeader:"sideBarHeader",resizeOffset:"resizeOffset",toggleNodesAtStartup:"toggleNodesAtStartup"},outputs:{selected:"selected"},decls:9,vars:7,consts:[["tree",""],["treeNodeWrapperTemplate",""],["loadingTemplate",""],[1,"sidebar-component-title"],["appAutoResize","",3,"overFlowX","resizeOffset","useMaxHeight"],[3,"nodes","options"],[1,"btn","btn-xs","btn-secondary",3,"click"],[3,"icon"],["l10nTranslate","",1,"text-danger","fs-xxs","p-2"],["l10nTranslate",""],[1,"px-2","pt-2","pb-0","fs-xs"],[1,"text-start","text-truncate"],["l10nTranslate","",1,"fs-xs","fw-bold","me-2"],[1,"text-start","text-truncate","mt-1"],[1,"d-flex","justify-content-between","mt-2"],["type","button","l10nTranslate","",1,"btn","btn-xxs","btn-primary",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-xxs","btn-secondary",3,"click"],[1,"mx-0","mt-2","mb-0"],[1,"fw-bold","me-1",3,"icon"],[1,"node-wrapper",3,"click","tap"],[3,"node"],[1,"node-content-wrapper"],[3,"index","node"],["animation","spin",1,"fw-bold",3,"icon"]],template:function(r,o){r&1&&(L(0,Po,5,2,"div",3),L(1,Ho,27,7),c(2,"div",4)(3,"tree-root",5,0),z(5,Bo,4,15,"ng-template",null,1,xt)(7,jo,2,1,"ng-template",null,2,xt),d()()),r&2&&(O(o.sideBarHeader?0:-1),l(),O(o.copyMoveOn?1:-1),l(),f("overFlowX","auto")("resizeOffset",o.resizeOffset)("useMaxHeight",!1),l(),f("nodes",o.nodes)("options",o.options))},dependencies:[Ci,vr,mr,on,rn,ae,oe],encapsulation:2});let t=e;return t})();function Uo(t,e){if(t&1&&(c(0,"span"),g(1,"fa-icon",10),p(2),fe(3,"pathSlice"),d()),t&2){let n=u();l(),f("icon",n.selection.isDir?n.icons.faFolderClosed:n.icons.faFile),l(),J(" ",_t(3,2,n.selection.path,-1)," ")}}function Go(t,e){t&1&&(c(0,"span",2),p(1,"Select a file"),d())}function $o(t,e){if(t&1&&(c(0,"span",7),p(1),d()),t&2){let n=u();l(),k(n.errorSelection)}}var Nr=(()=>{let e=class e{constructor(){this.currentRoots=[],this.submitEvent=new j,this.allowSpaces=!1,this.toggleNodesAtStartup=!0,this.mustHaveShareOutsidePermission=!1,this.layout=h(U),this.icons={faFile:ei,faFolderClosed:v1},this.errorSelection=null,this.selection=null}onSelect(i){if(i){if(this.mustHaveShareOutsidePermission){if(i.permissions.indexOf(at.SHARE_OUTSIDE)===-1){this.errorSelection=this.layout.translateString("You do not have share permission"),this.selection=null;return}if(i.path.split("/").length<=2){this.errorSelection=this.layout.translateString("You can not share a space"),this.selection=null;return}}let r=i,o=this.currentRoots.find(a=>a.file.id===r.id);o?(this.errorSelection=this.layout.translateString("This item is already selected"),this.selection=null):(o=this.currentRoots.find(a=>r.path.startsWith(a.file.path)),o?(this.errorSelection=`${this.layout.translateString("Parent item is already selected")}: ${o.file.path}`,this.selection=null):(this.errorSelection=null,this.selection=r))}else this.selection=null,this.errorSelection=null}onSubmit(){this.submitEvent.emit({id:this.selection.id,name:this.selection.name,path:this.selection.path,mime:this.selection.mime,permissions:this.selection.permissions}),this.layout.closeDialog()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["app-files-tree-dialog"]],inputs:{currentRoots:"currentRoots",allowSpaces:"allowSpaces",toggleNodesAtStartup:"toggleNodesAtStartup",mustHaveShareOutsidePermission:"mustHaveShareOutsidePermission"},outputs:{submitEvent:"submitEvent"},decls:13,vars:11,consts:[[1,"modal-header"],[1,"modal-title"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body","py-2","px-0"],[3,"selected","enableNavigateTo","enableCopyMove","showFiles","allowShares","allowSpaces","sideBarHeader","toggleNodesAtStartup","resizeOffset"],[1,"modal-footer"],[1,"me-auto","fs-sm","text-danger","text-truncate"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],[3,"icon"]],template:function(r,o){r&1&&(c(0,"div",0)(1,"h4",1),L(2,Uo,4,5,"span")(3,Go,2,0,"span",2),d(),c(4,"button",3),b("click",function(){return o.layout.closeDialog()}),d()(),c(5,"div",4)(6,"app-files-tree",5),b("selected",function(s){return o.onSelect(s)}),d()(),c(7,"div",6),L(8,$o,2,1,"span",7),c(9,"button",8),b("click",function(){return o.layout.closeDialog()}),p(10,"Cancel"),d(),c(11,"button",9),b("click",function(){return o.onSubmit()}),p(12,"Confirm"),d()()),r&2&&(l(2),O(o.selection?2:3),l(4),f("enableNavigateTo",!1)("enableCopyMove",!1)("showFiles",!0)("allowShares",!1)("allowSpaces",o.allowSpaces)("sideBarHeader",!1)("toggleNodesAtStartup",o.toggleNodesAtStartup)("resizeOffset",200),l(2),O(o.errorSelection?8:-1),l(3),f("disabled",!o.selection))},dependencies:[ae,Mr,oe,g1],encapsulation:2});let t=e;return t})();function Wo(t,e){if(t&1){let n=F();c(0,"input",12),fe(1,"translate"),b("ngModelChange",function(r){_(n);let o=u();return x(o.checkInput(r,!0))}),d()}if(t&2){let n=u();q("is-invalid",!n.rootNameIsValid),f("ngModel",n.newSpaceRoot.name)("placeholder",_t(1,4,"Name",n.locale.language))}}function Ko(t,e){if(t&1&&(c(0,"span",9),p(1),d()),t&2){let n=u();l(),k(n.error)}}function Yo(t,e){if(t&1){let n=F();c(0,"button",13),b("click",function(){_(n);let r=u();return x(r.onSubmit())}),p(1,"Confirm"),d()}}function Xo(t,e){if(t&1){let n=F();c(0,"button",14),b("click",function(){_(n);let r=u();return x(r.onValidRoot())}),p(1,"Check the location"),d()}}var wr=(()=>{let e=class e{constructor(){this.currentRoots=[],this.submitEvent=new j,this.withRootName=!0,this.locale=h(it),this.layout=h(U),this.icons={faFolderClosed:Wn},this.newSpaceRoot={name:"",externalPath:""},this.rootNameIsValid=!1,this.rootPathIsValid=!1,this.rootIsValid=!1,this.spacesService=h(ct)}ngOnInit(){this.withRootName||(this.rootNameIsValid=!0)}keyEnter(){this.rootIsValid?this.onSubmit():this.onValidRoot()}onValidRoot(){if(this.withRootName&&!this.newSpaceRoot.name||!this.newSpaceRoot.externalPath){this.error="Name and location are required";return}this.newSpaceRoot.externalPath[0]!=="/"&&(this.newSpaceRoot.externalPath="/"+this.newSpaceRoot.externalPath);for(let i of this.currentRoots)if(this.newSpaceRoot.externalPath.startsWith(i.externalPath)){this.rootPathIsValid=!1,this.error="Parent location already exists in files";return}this.spacesService.checkSpaceRootPath(this.newSpaceRoot.externalPath).subscribe({next:()=>{this.rootPathIsValid=!0,this.rootNameIsValid=!0,this.rootIsValid=!0,this.error=null},error:i=>{this.rootPathIsValid=!1,this.error=i.error.message}})}onSubmit(){this.submitEvent.emit(this.newSpaceRoot),this.layout.closeDialog()}checkInput(i,r=!1){r?(this.newSpaceRoot.name=i,this.rootNameIsValid=!!i):(this.newSpaceRoot.externalPath=i,this.rootPathIsValid=!!i),this.rootIsValid&&(this.rootIsValid=!1)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["app-space-root-path-dialog"]],hostBindings:function(r,o){r&1&&b("keyup.enter",function(){return o.keyEnter()})},inputs:{currentRoots:"currentRoots",withRootName:"withRootName"},outputs:{submitEvent:"submitEvent"},decls:14,vars:13,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body","form-validation"],["appAutofocus","","type","text","required","",1,"form-control","form-control-sm","my-2",3,"ngModel","is-invalid","placeholder"],["appAutofocus","","type","text","required","",1,"form-control","form-control-sm","my-4",3,"ngModelChange","autoFocus","ngModel","placeholder"],[1,"modal-footer"],["l10nTranslate","",1,"me-auto","fs-sm","text-danger","text-truncate"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["appAutofocus","","type","text","required","",1,"form-control","form-control-sm","my-2",3,"ngModelChange","ngModel","placeholder"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"]],template:function(r,o){r&1&&(c(0,"div",0)(1,"h4",1),g(2,"fa-icon",2),c(3,"span",3),p(4,"Add an external location"),d()(),c(5,"button",4),b("click",function(){return o.layout.closeDialog()}),d()(),c(6,"div",5),L(7,Wo,2,7,"input",6),c(8,"input",7),fe(9,"translate"),b("ngModelChange",function(s){return o.checkInput(s)}),d()(),c(10,"div",8),L(11,Ko,2,1,"span",9),L(12,Yo,2,0,"button",10)(13,Xo,2,0,"button",11),d()),r&2&&(l(2),f("icon",o.icons.faFolderClosed),l(5),O(o.withRootName?7:-1),l(),q("is-invalid",!o.rootPathIsValid),f("placeholder",tt("",_t(9,10,"Location",o.locale.language),": /home/sync-in/data"))("autoFocus",!o.withRootName)("ngModel",o.newSpaceRoot.externalPath),l(3),O(o.error?11:-1),l(),O(o.rootIsValid?12:13))},dependencies:[oe,ae,Wt,Ut,Gt,qt,$t,Qt,In],encapsulation:2});let t=e;return t})();var zr=(()=>{let e=class e{constructor(){this.locale=h(it)}ngOnInit(){this.setFilePath()}ngOnChanges(){this.setFilePath()}setFilePath(){let i=this.share.file?rt(this.share.file.name,-1):"";i?this.fileName=i:this.share.parent?.id?this.fileName=this.share.parent.name:this.share instanceof Et&&this.share.externalPath&&(this.fileName=this.share.externalPath)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["app-share-file-name"]],inputs:{share:"share"},features:[Ft],decls:5,vars:2,consts:[[1,"d-flex","align-items-center","text-truncate"],["draggable","false","height","30","width","30","alt","",3,"error","src"],[1,"d-flex","flex-column","text-truncate","ms-2"],[1,"text-truncate"]],template:function(r,o){r&1&&(Li(0,"div",0)(1,"img",1),En("error",function(){return o.share.fallBackMimeUrl()}),Oi(),Li(2,"div",2)(3,"div",3),p(4),Oi()()()),r&2&&(l(),xn("src",o.share.mimeUrl,kt),l(3),J(" ",o.fileName," "))},encapsulation:2});let t=e;return t})();function Qo(t,e){if(t&1&&(c(0,"span"),p(1),d()),t&2){let n=u();l(),k(n.share.name)}}function Jo(t,e){t&1&&(c(0,"span",3),p(1,"Create a new share"),d())}function Zo(t,e){if(t&1&&g(0,"fa-icon",4),t&2){let n=u();f("icon",n.icons.faSpinner)}}function e0(t,e){t&1&&(c(0,"h4",5)(1,"span",3),p(2,"Edit share"),d()())}function t0(t,e){if(t&1&&(g(0,"fa-icon",39),c(1,"span",40),p(2,"Settings"),d()),t&2){let n=u();f("icon",n.icons.faCog)}}function i0(t,e){if(t&1&&(c(0,"div",19)(1,"label",41),p(2,"File"),d(),g(3,"app-share-file-name",42),d()),t&2){let n=u();l(3),f("share",n.share)}}function n0(t,e){if(t&1&&(c(0,"div",49)(1,"label",50),p(2,"Deactivation date"),d(),c(3,"div",51),p(4),fe(5,"amDateFormat"),d()()),t&2){let n=u(2);l(4),k(Bt(5,1,n.share.disabledAt))}}function r0(t,e){if(t&1&&(c(0,"div",31)(1,"div",43)(2,"label",44),p(3,"Creation date"),d(),c(4,"div",45),p(5),fe(6,"amDateFormat"),d()(),c(7,"div",46)(8,"label",47),p(9,"Modification date"),d(),c(10,"div",48),p(11),fe(12,"amDateFormat"),d()(),L(13,n0,6,3,"div",49),d()),t&2){let n=u();l(5),k(Bt(6,3,n.share.createdAt)),l(6),k(Bt(12,5,n.share.modifiedAt)),l(2),O(n.share.disabledAt&&!n.share.enabled?13:-1)}}function o0(t,e){if(t&1&&(g(0,"fa-icon",39),c(1,"span",52),p(2,"Members"),d(),c(3,"span"),p(4),d()),t&2){let n=u();f("icon",n.icons.faUsers),l(4),J("(",n.share.members.length,")")}}function a0(t,e){if(t&1&&(g(0,"fa-icon",39),c(1,"span",52),p(2,"Links"),d(),c(3,"span"),p(4),d()),t&2){let n=u();f("icon",n.icons.LINKS),l(4),J("(",n.share.links.length,")")}}function s0(t,e){if(t&1){let n=F();c(0,"button",54),b("click",function(){_(n);let r=u(2);return x(r.confirmDeletion=!0)}),p(1," Remove "),d()}if(t&2){let n=u(2);f("disabled",n.confirmDeletion)}}function l0(t,e){if(t&1){let n=F();c(0,"button",57),b("click",function(){_(n);let r=u(3);return x(r.openAdminRootDialog())}),g(1,"fa-icon",39),p(2," External location "),d()}if(t&2){let n=u(3);l(),f("icon",n.icons.faUserShield)}}function c0(t,e){if(t&1){let n=F();c(0,"button",55),b("click",function(){_(n);let r=u(2);return x(r.openSelectRootDialog())}),g(1,"fa-icon",39)(2,"fa-icon",39),p(3," File "),d(),L(4,l0,3,1,"button",56)}if(t&2){let n=u(2);l(),f("icon",n.icons.faPlus),l(),f("icon",n.icons.SHARES),l(2),O(n.user.isAdmin?4:-1)}}function d0(t,e){if(t&1&&L(0,s0,2,1,"button",53)(1,c0,5,3),t&2){let n=u();O(n.share.id?0:n.allowFilesOptions?1:-1)}}function f0(t,e){if(t&1){let n=F();c(0,"button",55),b("click",function(){_(n);let r=u();return x(r.openCreateLinkDialog())}),g(1,"fa-icon",39)(2,"fa-icon",39),p(3," Link "),d()}if(t&2){let n=u();l(),f("icon",n.icons.faPlus),l(),f("icon",n.icons.LINKS)}}var Lr=(()=>{let e=class e{constructor(){this.parentShareId=null,this.parentSpaceId=null,this.isSharesRepo=!1,this.inSharesList=!1,this.allowFilesOptions=!0,this.shareChange=new j,this.locale=h(it),this.layout=h(U),this.icons={SHARED:W.SHARED_WITH_OTHERS,SHARES:W.SHARES,LINKS:W.LINKS,faPlus:Gn,faSpinner:Kt,faUserShield:Vn,faUsers:kn,faCog:Bn},this.allowedPermissions=[],this.confirmDeletion=!1,this.loading=!1,this.submitted=!1,this.userService=h(Xt),this.user=this.userService.user,this.sharesService=h(Jt),this.linksService=h(Zt),this.spacesService=h(ct)}ngOnInit(){this.share||([this.share,this.parentShareId]=this.sharesService.initShareFromFile(this.user,this.file,this.isSharesRepo,this.inSharesList)),this.allowedPermissions=Object.keys(this.share.hPerms)}searchMembers(i){let r={search:i,ignoreUserIds:[this.user.id,...this.share.parent?.ownerId?[this.share.parent.ownerId]:[],...this.share.members.filter(o=>o.isUser).map(o=>o.id)],ignoreGroupIds:this.share.members.filter(o=>o.isGroup).map(o=>o.id)};return this.userService.searchMembers(r,[at.SHARE_INSIDE])}openSelectRootDialog(){this.layout.openDialog(Nr,"xl",{initialState:{toggleNodesAtStartup:!1,allowSpaces:!0,mustHaveShareOutsidePermission:!0}}).content.submitEvent.pipe(Ke(1)).subscribe(r=>{let o=r.path.split("/"),a={id:r.id,name:r.name,path:rt(r.path,2),permissions:r.permissions,mime:r.mime,ownerId:o[1]===Me.PERSONAL?this.user.id:null,inTrash:!1,isDir:r.mime===Ne,space:{alias:o[1],name:o[1],root:{alias:"",name:""}}},s=De(Q({},this.share),{file:a,externalPath:null});s.name=s.file.name,this.share=new Et(s),this.allowedPermissions=Object.keys(this.share.hPerms)})}openAdminRootDialog(){this.layout.openDialog(wr,null,{initialState:{withRootName:!1}}).content.submitEvent.pipe(Ke(1)).subscribe(r=>{let o=De(Q({},this.share),{file:null,externalPath:r.externalPath,name:r.externalPath.split("/").at(-1)});this.share=new Et(o),this.allowedPermissions=Object.keys(this.share.hPerms)})}openEditLinkDialog(i){this.linksService.editLinkDialog(i,this.share,i1.SHARE)}openCreateLinkDialog(){this.linksService.createLinkDialog(this.share)}cantSubmit(){return this.submitted||!this.share.externalPath&&!this.share.file}onSubmit(){this.loading=!0,this.submitted=!0,this.confirmDeletion?(this.parentShareId?this.sharesService.deleteShareChild(this.parentShareId,this.share.id):this.parentSpaceId?this.spacesService.deleteSpaceShare(this.parentSpaceId,this.share.id):this.sharesService.deleteShare(this.share.id)).subscribe({next:()=>{this.loading=!1,this.shareChange.emit(["delete",this.share]),this.layout.closeDialog()},error:r=>{this.onError(),this.layout.sendNotification("error","Delete share",this.share.name,r)}}):this.share.id===0?this.sharesService.createShare(this.share).subscribe({next:i=>{this.loading=!1,this.share=i,this.shareChange.emit(["add",i]),this.layout.closeDialog()},error:i=>{this.onError(),this.layout.sendNotification("error","Create share",this.share.name,i)}}):(this.parentShareId?this.sharesService.updateShareChild(this.parentShareId,this.share.id,this.share):this.parentSpaceId?this.spacesService.updateSpaceShare(this.parentSpaceId,this.share):this.sharesService.updateShare(this.share)).subscribe({next:r=>{this.loading=!1,this.share=r,this.shareChange.emit(["update",r]),this.layout.closeDialog()},error:r=>{this.onError(),this.layout.sendNotification("error","Edit share",this.share.name,r)}})}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onError(){this.confirmDeletion=!1,this.submitted=!1,this.loading=!1}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["app-share-dialog"]],inputs:{share:"share",file:"file",parentShareId:"parentShareId",parentSpaceId:"parentSpaceId",isSharesRepo:"isSharesRepo",inSharesList:"inSharesList",allowFilesOptions:"allowFilesOptions"},outputs:{shareChange:"shareChange"},decls:57,vars:39,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","col-12"],[1,"d-flex","flex-column","col-6","pe-2"],[1,"mb-3","px-0",2,"max-width","80%"],["for","name","l10nTranslate",""],["id","name","type","text","appAutofocus","","required","",3,"ngModelChange","ngModel"],["for","description","l10nTranslate",""],["id","description","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel"],[1,"mb-3","px-0"],["for","switchStatus","l10nTranslate",""],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","switchStatus","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","ngModel"],["for","switchStatus","l10nTranslate","",1,"form-check-label","mb-0","ms-2"],[1,"col-6"],[1,"mb-3"],["for","from","l10nTranslate",""],["id","from",3,"share","showFullPath"],["for","permissions","l10nTranslate",""],[1,"d-flex"],["id","permissions",3,"permissions","replaceEmptyPermissions"],[1,"d-flex","d-none","d-lg-flex","mt-auto"],["customClass","tab-dialog",3,"selectTab"],[3,"membersChange","members","withPermissions","filterPermissions","allowedPermissions","searchFunction"],[3,"membersChange","members","filterPermissions","allowedPermissions","withPermissions","editFunction","hideInput"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","shareFilePath","l10nTranslate","",1,"no-select"],["id","shareFilePath",3,"share"],[1,"d-flex","flex-column","align-items-start","col-4","px-0"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-center","col-4","px-0"],["for","modified","l10nTranslate",""],["id","modified"],[1,"d-flex","flex-column","align-items-end","col-4","text-danger","px-0"],["for","disabled","l10nTranslate",""],["id","disabled"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-warning",3,"click"]],template:function(r,o){r&1&&(c(0,"div",0)(1,"h4",1),g(2,"fa-icon",2),L(3,Qo,2,1,"span")(4,Jo,2,0,"span",3),L(5,Zo,1,1,"fa-icon",4),d(),L(6,e0,3,0,"h4",5),c(7,"button",6),b("click",function(){return o.layout.closeDialog()}),d()(),c(8,"div",7)(9,"tabset",8),g(10,"hr",9),c(11,"tab",10),b("selectTab",function(){return o.tabView=null}),z(12,t0,3,1,"ng-template",11),c(13,"div",12)(14,"div",13)(15,"div",14)(16,"label",15),p(17," Share name "),d(),c(18,"input",16),et("ngModelChange",function(s){return Ze(o.share.name,s)||(o.share.name=s),s}),d()(),c(19,"div",14)(20,"label",17),p(21," Description "),d(),c(22,"input",18),et("ngModelChange",function(s){return Ze(o.share.description,s)||(o.share.description=s),s}),d()(),c(23,"div",19)(24,"label",20),p(25,"Share status"),d(),c(26,"div",21)(27,"input",22),et("ngModelChange",function(s){return Ze(o.share.enabled,s)||(o.share.enabled=s),s}),d(),c(28,"label",23),p(29),d()()()(),c(30,"div",24),L(31,i0,4,1,"div",19),c(32,"div",25)(33,"label",26),p(34,"Shared from"),d(),g(35,"app-share-repository",27),d(),c(36,"div",25)(37,"label",28),p(38,"File permissions"),d(),c(39,"div",29),g(40,"app-file-permissions",30),d()(),L(41,r0,14,7,"div",31),d()()(),c(42,"tab",32),b("selectTab",function(){return o.tabView="members"}),z(43,o0,5,2,"ng-template",11),c(44,"div",9)(45,"app-user-search",33),et("membersChange",function(s){return Ze(o.share.members,s)||(o.share.members=s),s}),d()()(),c(46,"tab",32),b("selectTab",function(){return o.tabView="links"}),z(47,a0,5,2,"ng-template",11),c(48,"div",9)(49,"app-user-search",34),et("membersChange",function(s){return Ze(o.share.links,s)||(o.share.links=s),s}),d()()()()(),c(50,"div",35),L(51,d0,2,1),L(52,f0,4,2,"button",36),c(53,"button",37),b("click",function(){return o.onCancel()}),p(54,"Cancel"),d(),c(55,"button",38),b("click",function(){return o.onSubmit()}),p(56),d()()),r&2&&(l(2),f("icon",o.icons.SHARED),l(),O(o.share.id?3:4),l(2),O(o.loading?5:-1),l(),O(o.share.id?6:-1),l(),Qe(tt("btn-close btn-close-white ",o.share.id?"ms-2":"ms-auto"," ms-2")),l(2),f("justified",!0),l(9),Qe(tt("form-control form-control-sm ",o.share.name?"":"is-invalid")),Je("ngModel",o.share.name),l(4),Je("ngModel",o.share.description),l(5),Je("ngModel",o.share.enabled),l(2),J(" ",o.share.enabled?"enabled":"disabled"," "),l(2),O(o.share.file!=null&&o.share.file.name||o.share.externalPath?31:-1),l(4),f("share",o.share)("showFullPath",!0),l(5),f("permissions",o.share.hPerms)("replaceEmptyPermissions",!0),l(),O(o.share!=null&&o.share.id?41:-1),l(4),Je("members",o.share.members),f("withPermissions",!0)("filterPermissions",!0)("allowedPermissions",o.allowedPermissions)("searchFunction",o.searchMembers.bind(o)),l(4),Je("members",o.share.links),f("filterPermissions",!0)("allowedPermissions",o.allowedPermissions)("withPermissions",!0)("editFunction",o.openEditLinkDialog.bind(o))("hideInput",!0),l(2),O(o.tabView?-1:51),l(),O(o.tabView==="links"?52:-1),l(3),Qe(tt("btn btn-sm ",o.confirmDeletion?"btn-danger":"btn-primary")),f("disabled",o.cantSubmit()),l(),J(" ",o.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[oe,ae,l1,a1,o1,s1,Qt,Tn,Ut,Dn,Gt,qt,Wt,$t,c1,u1,zr,m1,n1],encapsulation:2});let t=e;return t})();var xi=class{constructor(e){this.isShareLink=!1,Object.assign(this,e),this.owner.avatarUrl=Jn(this.owner.login),this.isShareLink=this.type===f1.LINK,this.setMimeUrl()}fallBackMimeUrl(){this.mimeUrl=lt}setMimeUrl(){!this.file||this.file.mime===Ne?this.mimeUrl=He(p1):this.mimeUrl=He(this.file.mime)}};var Or=t=>({$implicit:t}),u0=(t,e)=>e.id;function p0(t,e){if(t&1&&g(0,"fa-icon",17),t&2){let n=u(3);f("icon",n.icons.LINKS)}}function h0(t,e){t&1&&Se(0)}function m0(t,e){if(t&1&&(c(0,"ul"),z(1,h0,1,0,"ng-container",10),d()),t&2){let n=u().$implicit;u(2);let i=Ai(15);l(),f("ngTemplateOutlet",i)("ngTemplateOutletContext",St(2,Or,n.children))}}function v0(t,e){if(t&1){let n=F();c(0,"li")(1,"div",14),b("click",function(){let r=_(n).$implicit,o=u(2);return x(o.onSelect(r))})("dblclick",function(){_(n);let r=u(2);return x(r.openChildShare())}),c(2,"div",15)(3,"img",16),b("error",function(){let r=_(n).$implicit;return x(r.fallBackMimeUrl())}),d(),L(4,p0,1,1,"fa-icon",17),c(5,"span",18),p(6),d()(),c(7,"div",19)(8,"span",20),p(9),d(),g(10,"app-user-avatar",21),d()(),L(11,m0,2,4,"ul"),d()}if(t&2){let n=e.$implicit,i=u(2);l(),q("selected",i.selected&&i.selected.id===n.id),l(2),f("src",n.mimeUrl,kt),l(),O(n.isShareLink?4:-1),l(2),k(n.name),l(3),k(n.owner.fullName),l(),f("user",n.owner)("height",26)("width",26),l(),O((n.children==null?null:n.children.length)>0?11:-1)}}function g0(t,e){if(t&1&&Sn(0,v0,12,10,"li",null,u0),t&2){let n=e.$implicit,i=u();_n(i.toShares(n))}}function b0(t,e){t&1&&Se(0)}var oc=(()=>{let e=class e{constructor(){this.fromAdmin=!1,this.sharesCountEvent=new j,this.layout=h(U),this.icons={SHARED:W.SHARED_WITH_OTHERS,LINKS:W.LINKS},this.loading=!1,this.childSharesLength=0,this.sharesService=h(Jt),this.linksService=h(Zt),this.spacesService=h(ct)}ngOnInit(){this.loadChildShares()}toShares(i){return i}loadChildShares(){this.loading=!0;let i;if(this.share)i=this.sharesService.listChildShares(this.share.id);else if(this.space)i=this.spacesService.listSpaceShares(this.space.id);else{console.error("share or space not defined");return}i.subscribe({next:r=>{this.childSharesLength=r.length,this.sharesCountEvent.emit(r.length),this.setShares(r.map(o=>new xi(o))),this.loading=!1},error:r=>{this.childShares=[],this.childSharesLength=0,this.loading=!1,this.layout.sendNotification("error","Child shares",r.error.message)}})}onSelect(i){this.selected=i}openChildShare(){if(this.selected.isShareLink){let i;if(this.share)i=this.linksService.shareLinkChild(this.share.id,this.selected.id);else if(this.space)i=this.spacesService.getSpaceShareLink(this.space.id,this.selected.id);else{console.error("share or space not defined");return}i.subscribe({next:r=>{this.layout.openDialog(h1,"md",{initialState:{share:r}}).content.shareChange.pipe(Ke(1)).subscribe(a=>{let[s,m]=a;s==="update"?this.selected.name=m.name:this.loadChildShares()})},error:r=>this.layout.sendNotification("error","Edit children shares",this.selected.name,r)})}else{let i;if(this.share)i=this.sharesService.getShareChild(this.share.id,this.selected.id);else if(this.space)i=this.spacesService.getSpaceShare(this.space.id,this.selected.id);else{console.error("share or space not defined");return}i.subscribe({next:r=>{this.layout.openDialog(Lr,"lg",{initialState:De(Q(Q({},this.share?{parentShareId:this.share.id}:{}),this.space?{parentSpaceId:this.space.id}:{}),{share:r})}).content.shareChange.pipe(Ke(1)).subscribe(a=>{let[s,m]=a;s==="update"?(this.selected.name=m.name,this.selected.alias=m.alias):this.loadChildShares()})},error:r=>this.layout.sendNotification("error","Edit children shares",this.selected.name,r)})}}setShares(i){let r={id:this.share?.id||0,children:[]};this.recurseChildrenShares(i,r),this.childShares=r.children}recurseChildrenShares(i,r){for(let o of i)o.parentId===r.id?(r.children=r.children??[],r.children.push(o),this.recurseChildrenShares(i,o)):r.id===0&&!o.parentId&&(r.children=r.children??[],r.children.push(o),this.recurseChildrenShares(i,o))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=D({type:e,selectors:[["app-shared-children-dialog"]],inputs:{fromAdmin:"fromAdmin",share:"share",space:"space"},outputs:{sharesCountEvent:"sharesCountEvent"},decls:22,vars:9,consts:[["recursiveList",""],[1,"modal-header","align-items-center"],[1,"modal-title","w-100"],[1,"d-flex"],[1,"me-2",3,"icon"],[1,"ms-auto","me-2"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],["appAutoResize","",1,"modal-body",2,"padding-right","24px",3,"resizeOffset"],[1,"tree"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"modal-footer"],["l10nTranslate","","type","button",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["data-dismiss","modal","l10nTranslate","","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"app-div-hovered",3,"click","dblclick"],[1,"me-auto","text-truncate"],["alt","","draggable","false","height","28",3,"error","src"],[1,"align-middle","ms-1",3,"icon"],[1,"ms-1","align-middle"],[1,"d-flex","align-items-center"],[1,"fs-xxxs","me-2"],["tooltipPlacement","top","container","body",3,"user","height","width"]],template:function(r,o){if(r&1){let a=F();c(0,"div",1)(1,"h4",2)(2,"div",3)(3,"div"),g(4,"fa-icon",4),c(5,"span"),p(6),d()(),c(7,"div",5)(8,"span",6),p(9,"Child shares"),d(),p(10),d()()(),c(11,"button",7),b("click",function(){return _(a),x(o.layout.closeDialog())}),d()(),c(12,"div",8)(13,"ul",9),z(14,g0,2,0,"ng-template",null,0,xt)(16,b0,1,0,"ng-container",10),d()(),c(17,"div",11)(18,"button",12),b("click",function(){return _(a),x(o.openChildShare())}),p(19,"Edit"),d(),c(20,"button",13),b("click",function(){return _(a),x(o.layout.closeDialog())}),p(21,"Close"),d()()}if(r&2){let a=Ai(15);l(4),f("icon",o.icons.SHARED),l(2),k((o.share==null?null:o.share.name)||(o.space==null?null:o.space.name)),l(4),J("\xA0(",o.childSharesLength,") "),l(2),f("resizeOffset",170),l(4),f("ngTemplateOutlet",a)("ngTemplateOutletContext",St(7,Or,o.childShares)),l(2),f("disabled",!o.selected)}},dependencies:[Ci,ke,ae,oe,r1],styles:[`ul.tree[_ngcontent-%COMP%], ul.tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}ul.tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-left:18px}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:0;padding:0;line-height:30px;border-left:1px solid rgb(100,100,100);white-space:nowrap}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:inline-flex;width:100%;cursor:pointer;border-radius:4px}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-left:none}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:before{position:relative;top:-.3em;height:1.2rem;width:1rem;color:#fff;border-bottom:1px solid rgb(100,100,100);content:"";display:inline-block}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child:before{border-left:1px solid rgb(100,100,100)}
19
+
20
+
21
+
22
+
23
+
24
+ `]});let t=e;return t})();export{Y0 as a,X0 as b,Ci as c,C0 as d,y0 as e,S0 as f,ei as g,_0 as h,x0 as i,E0 as j,M0 as k,N0 as l,w0 as m,v1 as n,S as o,sn as p,sa as q,la as r,cn as s,ca as t,We as u,xr as v,Er as w,g1 as x,Mr as y,Nr as z,wr as A,Lr as B,oc as C};