@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.
- package/CHANGELOG.md +28 -0
- package/README.md +3 -2
- package/environment/environment.dist.yaml +2 -0
- package/migrations/0001_square_mauler.sql +4 -0
- package/migrations/meta/0001_snapshot.json +2417 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +20 -2
- package/server/app.bootstrap.js +9 -0
- package/server/app.bootstrap.js.map +1 -1
- package/server/app.service.spec.js +48 -23
- package/server/app.service.spec.js.map +1 -1
- package/server/applications/files/constants/files.js +0 -23
- package/server/applications/files/constants/files.js.map +1 -1
- package/server/applications/files/constants/only-office.js +8 -0
- package/server/applications/files/constants/only-office.js.map +1 -1
- package/server/applications/files/files.config.js +5 -0
- package/server/applications/files/files.config.js.map +1 -1
- package/server/applications/files/guards/files-only-office.strategy.js +0 -1
- package/server/applications/files/guards/files-only-office.strategy.js.map +1 -1
- package/server/applications/spaces/guards/space.guard.spec.js +153 -18
- package/server/applications/spaces/guards/space.guard.spec.js.map +1 -1
- package/server/applications/spaces/services/spaces-browser.service.js +7 -7
- package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
- package/server/applications/spaces/services/spaces-manager.service.js +17 -17
- package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
- package/server/applications/sync/schemas/sync-clients.schema.js +4 -4
- package/server/applications/sync/schemas/sync-clients.schema.js.map +1 -1
- package/server/applications/sync/utils/routes.js +1 -1
- package/server/applications/sync/utils/routes.js.map +1 -1
- package/server/applications/users/guards/permissions.guard.js +4 -4
- package/server/applications/users/guards/permissions.guard.js.map +1 -1
- package/server/applications/users/guards/permissions.guard.spec.js +6 -6
- package/server/applications/users/guards/permissions.guard.spec.js.map +1 -1
- package/server/applications/users/guards/roles.guard.js +1 -1
- package/server/applications/users/guards/roles.guard.js.map +1 -1
- package/server/applications/users/models/user.model.js +1 -1
- package/server/applications/users/models/user.model.js.map +1 -1
- package/server/applications/users/schemas/users.schema.js +4 -4
- package/server/applications/users/schemas/users.schema.js.map +1 -1
- package/server/authentication/guards/auth-basic.guard.spec.js +38 -2
- package/server/authentication/guards/auth-basic.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-basic.strategy.js +0 -1
- package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
- package/server/authentication/guards/auth-local.guard.spec.js +7 -5
- package/server/authentication/guards/auth-local.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-local.strategy.js +0 -1
- package/server/authentication/guards/auth-local.strategy.js.map +1 -1
- package/server/authentication/guards/auth-token-access.guard.spec.js +30 -0
- package/server/authentication/guards/auth-token-access.guard.spec.js.map +1 -1
- package/server/authentication/guards/auth-token-access.strategy.js +0 -1
- package/server/authentication/guards/auth-token-access.strategy.js.map +1 -1
- package/server/authentication/guards/auth-token-refresh.strategy.js +0 -1
- package/server/authentication/guards/auth-token-refresh.strategy.js.map +1 -1
- package/server/authentication/services/auth-methods/auth-method-database.service.js +1 -1
- package/server/authentication/services/auth-methods/auth-method-database.service.js.map +1 -1
- package/server/authentication/services/auth-methods/auth-method-database.service.spec.js +8 -6
- package/server/authentication/services/auth-methods/auth-method-database.service.spec.js.map +1 -1
- package/server/authentication/services/auth-methods/auth-method-ldap.service.js +2 -2
- package/server/authentication/services/auth-methods/auth-method-ldap.service.js.map +1 -1
- package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js +500 -5
- package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js.map +1 -1
- package/server/configuration/config.constants.js +0 -4
- package/server/configuration/config.constants.js.map +1 -1
- package/server/configuration/config.loader.js +2 -5
- package/server/configuration/config.loader.js.map +1 -1
- package/server/infrastructure/context/services/context-manager.service.spec.js +98 -0
- package/server/infrastructure/context/services/context-manager.service.spec.js.map +1 -0
- package/server/infrastructure/database/configuration.js +1 -1
- package/server/infrastructure/database/configuration.js.map +1 -1
- package/server/infrastructure/database/constants.js +18 -5
- package/server/infrastructure/database/constants.js.map +1 -1
- package/server/infrastructure/database/scripts/seed/usersgroups.js +3 -3
- package/server/infrastructure/database/scripts/seed/usersgroups.js.map +1 -1
- package/server/infrastructure/mailer/mailer.service.js +20 -19
- package/server/infrastructure/mailer/mailer.service.js.map +1 -1
- package/server/infrastructure/mailer/mailer.service.spec.js +176 -0
- package/server/infrastructure/mailer/mailer.service.spec.js.map +1 -0
- package/static/{chunk-EVYNK2XG.js → chunk-3GC2BQZD.js} +1 -1
- package/static/{chunk-XN4TXQKE.js → chunk-5YKWZT33.js} +1 -1
- package/static/{chunk-VSBD6246.js → chunk-6F55D74O.js} +1 -1
- package/static/{chunk-MWPC5XQW.js → chunk-B2Y2RNFP.js} +1 -1
- package/static/{chunk-YTROXGRM.js → chunk-C23BPTJZ.js} +1 -1
- package/static/chunk-DGVNNICG.js +1 -0
- package/static/{chunk-WSVE6EWB.js → chunk-FQ4AFNGE.js} +1 -1
- package/static/{chunk-4YWOE6HM.js → chunk-GBCYYDCI.js} +1 -1
- package/static/{chunk-Z6S7RFGN.js → chunk-HZA7R43P.js} +1 -1
- package/static/{chunk-VO5W2VKC.js → chunk-KZQCFEPT.js} +1 -1
- package/static/{chunk-BLRDUWOI.js → chunk-LJIGRUEF.js} +1 -1
- package/static/chunk-MOVWEZ7J.js +1 -0
- package/static/{chunk-3UFSZ24R.js → chunk-MTRNPGS4.js} +1 -1
- package/static/{chunk-JM5PB2NQ.js → chunk-N2LYWNTC.js} +1 -1
- package/static/{chunk-L4F2K2VQ.js → chunk-PF4K7MVG.js} +1 -1
- package/static/{chunk-F2KKCIDO.js → chunk-PY3BGNJN.js} +1 -1
- package/static/chunk-RSNLYAN6.js +560 -0
- package/static/{chunk-VCXIQZT4.js → chunk-SH5EVL4E.js} +4 -4
- package/static/{chunk-BEJ62KA7.js → chunk-T55FAU2O.js} +1 -1
- package/static/{chunk-BEC2WQVF.js → chunk-TCFKH6K6.js} +1 -1
- package/static/{chunk-LATG3ZVP.js → chunk-TDQAEVZN.js} +1 -1
- package/static/{chunk-FNO4KAYG.js → chunk-TNW2CGK6.js} +1 -1
- package/static/{chunk-OWYD7F64.js → chunk-TTQ37MUV.js} +1 -1
- package/static/chunk-TXPODW5Q.js +7 -0
- package/static/chunk-VHYIXL7R.js +4 -0
- package/static/{chunk-UEN7RH33.js → chunk-VMQMD36Z.js} +1 -1
- package/static/{chunk-6E5YHOWA.js → chunk-VMUOUCEI.js} +1 -1
- package/static/{chunk-I6ACCGIM.js → chunk-W3QXNDI5.js} +1 -1
- package/static/chunk-WHMS3PJ3.js +24 -0
- package/static/{chunk-3PB73RWL.js → chunk-WWIC7UW3.js} +1 -1
- package/static/{chunk-6A5R4OPV.js → chunk-X43VWRFP.js} +1 -1
- package/static/chunk-XE5YHU5J.js +1 -0
- package/static/chunk-Y2CDUS4J.js +4 -0
- package/static/chunk-YCINY2YI.js +1 -0
- package/static/index.html +2 -2
- package/static/main-7LDKYVXO.js +10 -0
- package/static/{polyfills-GNKGQMRJ.js → polyfills-IA5XWQYN.js} +1 -1
- package/static/{scripts-263WP5VB.js → scripts-VZVAP2P4.js} +4 -4
- package/static/styles-FYUSO6OJ.css +1 -0
- package/sync-in-server.js +1 -1
- package/static/chunk-CIGVDQPA.js +0 -1
- package/static/chunk-CY3GGCEX.js +0 -7
- package/static/chunk-DJRILQTU.js +0 -1
- package/static/chunk-EDLO4Y5E.js +0 -4
- package/static/chunk-ENDRPUCI.js +0 -4
- package/static/chunk-HXRRMHEX.js +0 -1
- package/static/chunk-IJDFKCZM.js +0 -24
- package/static/chunk-J6YSVODR.js +0 -1
- package/static/chunk-JQOMI5VI.js +0 -560
- package/static/main-7LVJ2JSP.js +0 -10
- package/static/styles-3DONJ2Z4.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ue,b as z,c as we,d as Ct}from"./chunk-CY3GGCEX.js";import{b as R,c as _t}from"./chunk-EVYNK2XG.js";import{a as S,b as Y,c as tt,e as dt}from"./chunk-BEJ62KA7.js";import{a as bt}from"./chunk-3UFSZ24R.js";import{a as ft,b as ht,c as gt}from"./chunk-Z6S7RFGN.js";import{a as _e,b as st,c as mt,d as pt,f as ct,i as ut}from"./chunk-ENDRPUCI.js";import{a as Ge,b as Se,c as at,d as lt}from"./chunk-XN4TXQKE.js";import"./chunk-HXRRMHEX.js";import{g as rt}from"./chunk-DJRILQTU.js";import{L as Ze,M as K,Mb as xe,N as et,Rb as ye,Ta as ve,Xa as de,pa as it,qa as nt,ra as ot,ua as H,v as je,xb as V}from"./chunk-EDLO4Y5E.js";import{b as Me,d as Pe}from"./chunk-J6YSVODR.js";import{$c as Ve,Bf as Ye,Cb as _,E as be,Eb as u,Ed as re,Fd as P,Ga as J,Gc as te,Gd as Ke,Ge as se,Gf as ce,Ib as Q,If as Je,Jb as q,Kb as W,L as O,Ld as ae,Ma as s,Mb as Ce,Nb as U,Ob as k,Pb as m,Qb as C,Qd as He,Rb as $,Re as qe,Sb as Ee,Tb as X,Ub as Z,Ue as We,Uf as Xe,Vb as ee,Xa as E,Xb as Ae,Yb as De,Zc as M,ab as T,ad as Re,ae as le,bb as I,cd as Fe,dc as v,ec as D,ed as L,fc as w,fd as Ue,gd as ke,ha as x,id as j,jb as h,jd as ie,kb as g,ma as y,na as G,nb as B,nd as Oe,ob as N,od as Ie,of as me,pb as c,pd as Be,qb as r,qd as Ne,rb as a,rd as $e,sb as d,wd as ne,wf as pe,xd as Le,xe as Qe,yd as oe,zb as A,zf as ze}from"./chunk-JQOMI5VI.js";import{a as he,b as ge}from"./chunk-RTRJ3KFH.js";var vt=(()=>{let l=class l{constructor(){this.currentMemberIds=[],this.hasChanges=new I,this.layout=x(V),this.newMembers=[],this.submitted=!1,this.icons={faUserPlus:se},this.adminService=x(R)}searchMembers(o){let n={search:o,onlyUsers:!0,usersRole:this.parentGroup.type===ue.USER?Ze.USER:void 0,ignoreUserIds:[...this.currentMemberIds,...this.newMembers.map(e=>e.id)]};return this.adminService.searchMembers(n)}onSubmit(){this.submitted=!0,this.adminService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(o=>o.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.newMembers.map(o=>o.name).join("<br>"),null,{enableHtml:!0}),this.layout.closeDialog()},error:o=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.newMembers.map(n=>n.name).join("<br>"),o,{enableHtml:!0})}})}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-add-users-dialog"]],inputs:{parentGroup:"parentGroup",currentMemberIds:"currentMemberIds"},outputs:{hasChanges:"hasChanges"},decls:16,vars:7,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-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,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],[1,"modal-footer"],["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(n,e){n&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Add members"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"app-user-search",7),ee("membersChange",function(f){return Z(e.newMembers,f)||(e.newMembers=f),f}),a()(),r(11,"div",8)(12,"button",9),_("click",function(){return e.layout.closeDialog()}),m(13,"Cancel"),a(),r(14,"button",10),_("click",function(){return e.onSubmit()}),m(15," Confirm "),a()()),n&2&&(s(2),c("icon",e.icons.faUserPlus),s(2),C(e.parentGroup.name),s(6),X("members",e.newMembers),c("withPermissions",!1)("customPlaceholder","Type to search for users to add")("searchFunction",e.searchMembers.bind(e)),s(4),c("disabled",e.submitted||!e.newMembers.length))},dependencies:[M,P,ut],encapsulation:2});let t=l;return t})();function wt(t,l){if(t&1&&d(0,"img",9),t&2){let i=u();c("src",i.member.avatarUrl,J)}}function Tt(t,l){if(t&1&&d(0,"fa-icon",15),t&2){let i=u();k(i.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",i.icons.GROUPS)}}function Et(t,l){if(t&1&&(r(0,"div",7)(1,"span",16),m(2,"from the group"),a(),r(3,"span",11),m(4),v(5,"capitalize"),a()()),t&2){let i=u();s(4),C(D(5,1,i.parentGroup.name))}}function At(t,l){t&1&&(r(0,"small",4),m(1,"Only the group will be deleted, the members will no longer be part of it."),a())}var xt=(()=>{let l=class l{constructor(){this.wasDeleted=new I,this.submitted=!1,this.icons={GROUPS:H.GROUPS,faMinus:ae,faUserMinus:pe},this.layout=x(V),this.adminService=x(R)}onSubmit(){this.submitted=!0;let o=this.member.isUser?"Remove from group":"Delete group";(this.member.isUser?this.adminService.removeUserFromGroup(this.parentGroup.id,this.member.id):this.adminService.deleteGroup(this.member.id)).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success",o,this.member.name),this.onClose()},error:e=>{this.submitted=!1,this.layout.sendNotification("error",o,this.member.name,e)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-delete-dialog"]],inputs:{parentGroup:"parentGroup",member:"member"},outputs:{wasDeleted:"wasDeleted"},decls:26,vars:10,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-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"],[1,"d-flex","align-items-center"],[1,"d-flex","align-items-center","avatar","me-2"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],[1,"fw-bold","me-1"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"mx-1"]],template:function(n,e){n&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7),a()(),r(8,"button",5),_("click",function(){return e.onClose()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8),h(12,wt,1,1,"img",9)(13,Tt,1,3,"fa-icon",10),a(),r(14,"span",11),m(15),v(16,"capitalize"),a(),r(17,"span",4),m(18,"will be removed"),a(),h(19,Et,6,3,"div",7),a(),h(20,At,2,0,"small",4),a(),r(21,"div",12)(22,"button",13),_("click",function(){return e.onClose()}),m(23,"Cancel"),a(),r(24,"button",14),_("click",function(){return e.onSubmit()}),m(25," Remove "),a()()),n&2&&(s(2),c("icon",e.member.isUser?e.icons.faUserMinus:e.icons.faMinus),s(2),C(e.member.name),s(3),C(e.member.isUser?"Remove from group":"Delete group"),s(5),g(e.member.isUser?12:13),s(3),C(D(16,8,e.member.name)),s(4),g(e.member.isUser?19:-1),s(),g(e.member.isGroup?20:-1),s(4),c("disabled",e.submitted))},dependencies:[M,P,dt],encapsulation:2});let t=l;return t})();var Dt=(t,l)=>l.value;function Mt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span"),m(2),a()),t&2){let i=u();c("icon",i.icons.faPen),s(2),C(i.group.name)}}function Pt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span",23),m(2,"New group"),a()),t&2){let i=u();c("icon",i.icons.faPlus)}}function Vt(t,l){t&1&&(r(0,"h4",2)(1,"span",23),m(2,"Edit group"),a()())}function Rt(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Settings"),a()),t&2){let i=u();c("icon",i.icons.faCog)}}function Ft(t,l){if(t&1&&(r(0,"option",21),m(1),a()),t&2){let i=l.$implicit;c("ngValue",i.value),s(),C(i.key)}}function Ut(t,l){t&1&&(r(0,"span",23),m(1,"All users can see this group."),a())}function kt(t,l){t&1&&(r(0,"span",23),m(1,"Users who are not members of this group cannot see it."),a())}function Ot(t,l){t&1&&(r(0,"span",23),m(1,"The group is not visible, its members cannot see it and cannot see each other."),a())}function It(t,l){if(t&1&&(r(0,"div",24)(1,"div",18)(2,"label",34),m(3,"Creation date"),a(),r(4,"div",35),m(5),v(6,"amDateFormat"),a()(),r(7,"div",36)(8,"label",37),m(9,"Modification date"),a(),r(10,"div",38),m(11),v(12,"amDateFormat"),a()()()),t&2){let i=u();s(5),C(D(6,2,i.group.createdAt)),s(6),C(D(12,4,i.group.modifiedAt))}}function Bt(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Permissions"),a()),t&2){let i=u();c("icon",i.icons.faShieldHalved)}}var Te=(()=>{let l=class l{constructor(){this.group=null,this.parentGroup=null,this.groupChange=new I,this.locale=x(oe),this.layout=x(V),this.icons={GROUPS:H.GROUPS,faPen:me,faPlus:ce,faCog:qe,faShieldHalved:Ye},this.submitted=!1,this.originalOrderKeyValue=de,this.allVisibilities={Visible:z.VISIBLE,Private:z.PRIVATE,Isolated:z.ISOLATED},this.adminService=x(R)}ngOnInit(){this.groupForm=new ke({name:new j(this.group?.name||"",Fe.required),description:new j(this.group?.description||""),visibility:new j(this.group?.visibility||z.VISIBLE),applications:new j(this.group?.applications||[]),parent:new j(this.parentGroup)})}updateApplications(o){this.groupForm.controls.applications.setValue(o),this.groupForm.controls.applications.markAsDirty()}onSetParent(o){this.groupForm.controls.parent.setValue(o?{id:o.id,name:o.name}:null),this.groupForm.controls.parent.markAsDirty()}searchGroups(o){let n={search:o,onlyGroups:!0,excludePersonalGroups:!0,ignoreGroupIds:this.groupForm.value.parent?[this.groupForm.value.parent.id]:[]};return this.adminService.searchMembers(n,!0)}onSubmit(){if(this.submitted=!0,this.group?.id){let o=this.makeDto();this.adminService.updateGroup(this.group.id,o).subscribe({next:n=>{this.groupChange.emit(["update",n]),this.layout.sendNotification("success","Group updated",this.groupForm.value.name),this.layout.closeDialog()},error:n=>this.onError(n)})}else{let o=this.makeDto(!0);this.adminService.createGroup(o).subscribe({next:n=>{this.groupChange.emit(["add",n]),this.layout.sendNotification("success","Group created",this.groupForm.value.name),this.layout.closeDialog()},error:n=>this.onError(n)})}}makeDto(o=!1){let n;o?n=Object.fromEntries(Object.keys(this.groupForm.controls).map(e=>[e,this.groupForm.controls[e].value])):n=Object.fromEntries(Object.keys(this.groupForm.controls).filter(e=>this.groupForm.controls[e].dirty).map(e=>[e,this.groupForm.controls[e].value]));for(let e in n)switch(e){case"applications":n.permissions=n[e].join(et),delete n.applications;break;case"parent":n.parentId=n[e]?n[e].id:null,delete n.parent;break}return n}onError(o){this.layout.sendNotification("error","Group error",this.groupForm.value.name,o),this.submitted=!1}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-dialog"]],inputs:{group:"group",parentGroup:"parentGroup"},outputs:{groupChange:"groupChange"},decls:50,vars:24,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body","form-validation",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","formControlName","name","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","formControlName","description","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"d-flex","flex-column","align-items-start","col-12","pb-3"],[1,"col-6","pe-4"],["for","visibility","l10nTranslate",""],["id","visibility","formControlName","visibility",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],[1,"d-none","d-sm-block","fst-italic","fs-xxs"],["l10nTranslate",""],[1,"d-flex","align-items-start","col-12","pb-3"],["for","parent","translate",""],["id","parent",3,"data","searchFunction","active","itemIcon","placeholder"],[3,"permissionsChange","permissions"],[1,"modal-footer"],["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"],[1,"me-2",3,"icon"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","modified","l10nTranslate",""],["id","modified"]],template:function(n,e){if(n&1&&(r(0,"div",0)(1,"h4",1),h(2,Mt,3,2)(3,Pt,3,1),a(),h(4,Vt,3,0,"h4",2),r(5,"button",3),_("click",function(){return e.layout.closeDialog()}),a()(),r(6,"div",4)(7,"tabset",5),d(8,"hr",6),r(9,"tab",7),_("selectTab",function(){return e.tabView=null}),T(10,Rt,3,1,"ng-template",8),r(11,"div",9)(12,"div",10)(13,"div",11)(14,"label",12),m(15,"Name"),a(),d(16,"input",13),a(),r(17,"div",14)(18,"label",15),m(19,"Description"),a(),d(20,"input",16),a()(),r(21,"div",17)(22,"div",18)(23,"label",19),m(24,"Visibility"),a(),r(25,"select",20),B(26,Ft,2,2,"option",21,Dt),v(28,"keyvalue"),a()(),r(29,"div",22),h(30,Ut,2,0,"span",23)(31,kt,2,0,"span",23)(32,Ot,2,0,"span",23),a()(),r(33,"div",24)(34,"div",18)(35,"label",25),m(36,"Parent group"),a(),r(37,"app-select",26),v(38,"translate"),_("data",function(f){return e.onSetParent(f)}),a()()(),h(39,It,13,6,"div",24),a()(),r(40,"tab",7),_("selectTab",function(){return e.tabView="permissions"}),T(41,Bt,3,1,"ng-template",8),r(42,"div",9)(43,"div",10)(44,"app-admin-permissions",27),_("permissionsChange",function(f){return e.updateApplications(f)}),a()()()()()(),r(45,"div",28)(46,"button",29),_("click",function(){return e.layout.closeDialog()}),m(47,"Cancel"),a(),r(48,"button",30),_("click",function(){return e.onSubmit()}),m(49," Confirm "),a()()),n&2){let p;s(2),g(e.group?2:3),s(2),g(e.group?4:-1),s(),k(Ae("btn-close btn-close-white ",e.group?"ms-2":"ms-auto"," ms-2")),s(),c("formGroup",e.groupForm),s(),c("justified",!0),s(9),U("is-invalid",e.groupForm.controls.name.invalid),c("autoSelect",!1),s(10),N(w(28,18,e.allVisibilities,e.originalOrderKeyValue)),s(4),g((p=e.groupForm.value.visibility)===e.allVisibilities.Visible?30:p===e.allVisibilities.Private?31:p===e.allVisibilities.Isolated?32:-1),s(7),c("searchFunction",e.searchGroups.bind(e))("active",e.groupForm.value.parent)("itemIcon",e.icons.GROUPS)("placeholder",w(38,21,"Select the parent group",e.locale.language)),s(2),g(e.group?39:-1),s(5),c("permissions",e.groupForm.value.applications),s(4),c("disabled",e.submitted||e.groupForm.invalid)}},dependencies:[M,P,Le,Ne,$e,Re,Be,L,Ue,Oe,Ie,ct,_t,Ct,mt,pt,st,te,re,_e],encapsulation:2});let t=l;return t})();var Gt=(()=>{let l=class l{constructor(){this.layout=x(V),this.submitted=!1,this.isManager=!1,this.USER_GROUP_ROLE=K,this.icons={faUserPen:Qe,faKey:le},this.adminService=x(R)}ngOnInit(){this.isManager=this.user.isGroupManager}onSubmit(){if(this.submitted=!0,this.user.isGroupManager===this.isManager){this.layout.closeDialog();return}let o=this.isManager?K.MANAGER:K.MEMBER;this.adminService.updateUserFromGroup(this.parentGroup.id,this.user.id,{role:o}).subscribe({next:()=>{this.user.setGroupRole(o),this.layout.sendNotification("success","Edit user",this.user.name),this.layout.closeDialog()},error:n=>{this.submitted=!1,this.layout.sendNotification("error","Edit user",this.user.name,n)}})}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-edit-user-dialog"]],inputs:{parentGroup:"parentGroup",user:"user"},decls:25,vars:5,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-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"],[1,"d-flex","align-items-center"],[1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],[1,"form-check-label"],["type","checkbox",1,"form-check-input",3,"ngModelChange","ngModel"],[1,"ms-1",3,"icon"],[1,"modal-footer"],["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(n,e){n&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Edit user"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"label",10)(14,"input",11),ee("ngModelChange",function(f){return Z(e.isManager,f)||(e.isManager=f),f}),a(),r(15,"span",4),m(16,"Set as group manager"),a(),d(17,"fa-icon",12),a()()()(),r(18,"small",4),m(19,"As a manager, the user will be able to manage group members but not group properties."),a()(),r(20,"div",13)(21,"button",14),_("click",function(){return e.layout.closeDialog()}),m(22,"Cancel"),a(),r(23,"button",15),_("click",function(){return e.onSubmit()}),m(24," Confirm "),a()()),n&2&&(s(2),c("icon",e.icons.faUserPen),s(2),C(e.user.name),s(10),X("ngModel",e.isManager),s(3),c("icon",e.icons.faKey),s(6),c("disabled",e.submitted))},dependencies:[M,P,ne,Ve,L,ie],encapsulation:2});let t=l;return t})();var Nt=["MainContextMenu"],$t=["TargetContextMenu"],St=(t,l)=>l.key,Lt=(t,l)=>l.mid;function jt(t,l){if(t&1){let i=A();r(0,"ul",26)(1,"li",27)(2,"a",28),_("click",function(){y(i);let n=u();return G(n.openDialog(!0))}),r(3,"span",14),d(4,"fa-icon",7),m(5),a()()(),r(6,"li",27)(7,"a",28),_("click",function(){y(i);let n=u();return G(n.addUserToGroupDialog())}),r(8,"span",14),d(9,"fa-icon",7),m(10,"Add members"),a()()()()}if(t&2){let i=u();s(2),U("disabled",!!i.currentGroup&&i.personalGroupsView),s(2),c("icon",i.icons.GROUPS),s(),$(" ",i.personalGroupsView?"Personal group":"Group"),s(2),U("disabled",!i.currentGroup),s(2),c("icon",i.icons.faUserPlus)}}function Kt(t,l){if(t&1&&d(0,"fa-icon",31),t&2){let i=u(3);c("icon",i.sortTable.sortParam.asc?i.icons.faArrowDown:i.icons.faArrowUp)("fixedWidth",!1)}}function Ht(t,l){if(t&1){let i=A();r(0,"th",30),_("click",function(){y(i);let n=u().$implicit,e=u();return G(e.sortBy(n.key))}),m(1),h(2,Kt,1,2,"fa-icon",31),a()}if(t&2){let i=u().$implicit,o=u();k(i.value.class),Ce("width",i.value.width,"%"),U("text-align-center",i.value.textCenter)("cursor-pointer",i.value.sortable),s(),$(" ",i.value.label," "),s(),g(o.sortTable.sortParam.column===i.key?2:-1)}}function Qt(t,l){if(t&1&&h(0,Ht,3,10,"th",29),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function qt(t,l){if(t&1&&d(0,"img",36),t&2){let i=u(4).$implicit;c("src",i.avatarUrl,J)}}function Wt(t,l){if(t&1&&d(0,"fa-icon",7),t&2){let i=u(4).$implicit,o=u();k(i.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",o.icons.GROUPS)}}function zt(t,l){if(t&1&&d(0,"fa-icon",39),t&2){let i=u(5);c("icon",i.icons.faKey)}}function Yt(t,l){if(t&1&&(r(0,"div",34),h(1,qt,1,1,"img",36)(2,Wt,1,3,"fa-icon",37),r(3,"div",35)(4,"span",38),m(5),h(6,zt,1,1,"fa-icon",39),a(),r(7,"span",40),m(8),a()()()),t&2){let i=u(3).$implicit;s(),g(i.isUser?1:2),s(4),$(" ",i.name," "),s(),g(i.isUser&&i.isGroupManager?6:-1),s(2),C(i.description)}}function Jt(t,l){if(t&1&&(r(0,"span"),m(1),v(2,"joinCounts"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.counts))}}function Xt(t,l){if(t&1&&h(0,Jt,3,3,"span"),t&2){let i=u(3).$implicit;g(i.isGroup?0:-1)}}function Zt(t,l){t&1&&(r(0,"span",14),m(1,"manager"),a())}function ei(t,l){if(t&1&&(r(0,"span",14),m(1),a()),t&2){let i=u(4).$implicit;s(),C(i.type)}}function ti(t,l){if(t&1&&h(0,Zt,2,0,"span",14)(1,ei,2,1,"span",14),t&2){let i=u(3).$implicit;g(i.isUser&&i.isGroupManager?0:1)}}function ii(t,l){if(t&1&&(r(0,"div"),m(1),v(2,"amDateFormat"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.modifiedAt))}}function ni(t,l){if(t&1&&(r(0,"div",35)(1,"div"),m(2),v(3,"amDateFormat"),a(),h(4,ii,3,3,"div"),a()),t&2){let i=u(3).$implicit;s(2),C(D(3,2,i.createdAt)),s(2),g(i.modifiedAt?4:-1)}}function oi(t,l){if(t&1&&(r(0,"td"),h(1,Yt,9,4,"div",34)(2,Xt,1,1)(3,ti,2,1)(4,ni,5,4,"div",35),a()),t&2){let i,o=u().$implicit,n=u().$implicit;k(De("",o.value.class," ",o.value.newly?"prop-newly-"+n[o.value.newly]:"")),Ce("width",o.value.width,"%"),U("text-align-center",o.value.textCenter),s(),g((i=o.key)==="name"?1:i==="members"?2:i==="type"?3:i==="createdAndModified"?4:-1)}}function ri(t,l){if(t&1&&h(0,oi,5,9,"td",33),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function ai(t,l){if(t&1){let i=A();r(0,"tr",32),_("click",function(){let n=y(i).$implicit,e=u();return G(e.onSelect(n))})("contextmenu",function(n){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(n,e))})("pressup",function(n){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(n,e))})("tap",function(){let n=y(i).$implicit,e=u();return G(e.browse(n))}),B(1,ri,1,1,null,null,St),v(3,"keyvalue"),a()}if(t&2){let i=l.$implicit,o=u();U("selected",i.mid===(o.selected==null?null:o.selected.mid)),s(),N(w(3,2,o.tableHeaders,o.originalOrderKeyValue))}}function li(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPlus),s(),$(" ",i.personalGroupsView?"Personal group":"Group")}}function si(t,l){if(t&1){let i=A();T(0,li,3,2,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.openDialog(!0))})}}function mi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Add members"),a()),t&2){let i=u(2);s(),c("icon",i.icons.faUserPlus)}}function pi(t,l){if(t&1){let i=A();T(0,mi,3,1,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.addUserToGroupDialog())})}}function ci(t,l){}function ui(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Refresh"),a()),t&2){let i=u();s(),c("icon",i.icons.faArrowRotateRight)}}function di(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPen),s(),$(" ",i.selected.isGroup?"Edit group":"Edit user")}}function _i(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Delete group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faMinus)}}function fi(t,l){if(t&1){let i=A();T(0,_i,3,1,"ng-template",25),_("execute",function(){y(i);let n=u(2);return G(n.openDialog(!1,!0))})}}function hi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Remove from group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faUserMinus)}}function gi(t,l){if(t&1){let i=A();T(0,hi,3,1,"ng-template",25),_("execute",function(){y(i);let n=u(2);return G(n.openDialog(!1,!0))})}}function bi(t,l){if(t&1){let i=A();T(0,di,3,2,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.openDialog())}),h(1,fi,1,0,null,23)(2,gi,1,0,null,23)}if(t&2){let i=u();s(),g(i.selected.isGroup?1:2)}}var oo=(()=>{let l=class l{constructor(){this.locale=x(oe),this.originalOrderKeyValue=de,this.icons={GROUPS:H.GROUPS,faRotate:Ke,faPlus:ce,faMinus:ae,faPen:me,faArrowDown:Xe,faArrowUp:We,faKey:le,faUserPlus:se,faUserMinus:pe,faArrowRotateRight:Je,faToggleOn:ze,faToggleOff:He},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},type:{label:"Type",width:10,textCenter:!0,class:"",show:!0,sortable:!0},members:{label:"Members",width:10,class:"",textCenter:!0,show:!0},createdAndModified:{label:"Created & Modified",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.personalGroupsView=!1,this.loading=!1,this.selected=null,this.members=[],this.router=x(Pe),this.activatedRoute=x(Me),this.layout=x(V),this.adminService=x(R),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],type:[{prop:"type",type:"string"}],createdAndModified:[{prop:"modifiedAt",type:"date"},{prop:"createdAt",type:"date"}]},this.sortTable=new lt(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(o=>{this.personalGroupsView=o.type===ue.PERSONAL,this.setEnv(o.routes)}),this.activatedRoute.queryParams.subscribe(o=>this.focusOnSelect=o.select),this.layout.setBreadcrumbIcon(tt.GROUPS)}onPersonalGroupsView(o){this.personalGroupsView=o,this.router.navigate([S.BASE,o?S.PGROUPS:S.GROUPS]).catch(console.error)}refresh(){this.loadGroups(this.currentGroup?.name)}browse(o){o.isGroup&&this.router.navigate([o.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(o=null){this.selected=o}onContextMenu(o){o.preventDefault(),o.stopPropagation(),this.layout.openContextMenu(o,this.mainContextMenu)}onTargetContextMenu(o,n){o.preventDefault(),o.type==="contextmenu"&&o.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(o,this.targetContextMenu)}sortBy(o,n=!0,e){this.members=this.sortTable.sortBy(o,n,e||this.members)}addUserToGroupDialog(){this.layout.openDialog(vt,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(n=>n.isUser).map(n=>n.id)}}).content.hasChanges.pipe(be(n=>n),O(1)).subscribe(()=>this.refresh())}openDialog(o=!1,n=!1){o?this.personalGroupsView?this.layout.openDialog(we,"md").content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="add"&&(b.setGroupRole(K.MANAGER),b.counts={users:1},this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(b)),this.onSelect(b))}):this.layout.openDialog(Te,"md",{initialState:{parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;if(f==="add")if(!this.currentGroup&&!b?.parent||b.parent.id===this.currentGroup.id){let F=new ye(ge(he({},b),{type:xe.GROUP}));this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(new ye(ge(he({},b),{type:xe.GROUP})))),this.onSelect(F)}else this.router.navigate([`${S.BASE}/${S.GROUPS}`,b.parent?.id?b.parent.name:""],{queryParams:{select:b.name}}).catch(console.error)}):n?this.layout.openDialog(xt,"md",{initialState:{parentGroup:this.currentGroup,member:this.selected}}).content.wasDeleted.pipe(be(p=>p),O(1)).subscribe(()=>{this.currentGroup?this.selected.counts?.groups?this.loadGroups(this.currentGroup.name):(this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(p=>this.selected.mid!==p.mid)),this.onSelect()):this.loadGroups()}):this.selected.isGroup?this.personalGroupsView?this.layout.openDialog(we,"md",{initialState:{originalGroup:this.selected}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="update"&&(this.selected=Object.assign(this.selected,{name:b.name,description:b.description,modifiedAt:b.modifiedAt}))}):this.adminService.getGroup(this.selected.id).subscribe({next:e=>{this.layout.openDialog(Te,"md",{initialState:{group:e,parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(f=>{let[b,F]=f;b==="update"&&(!this.currentGroup&&!F?.parent||F.parent.id===this.currentGroup.id?this.selected=Object.assign(this.selected,F):this.router.navigate([`${S.BASE}/${S.GROUPS}`,F.parent?.id?F.parent.name:""],{queryParams:{select:F.name}}).catch(console.error))})},error:e=>this.layout.sendNotification("error","Edit group",this.selected.name,e)}):this.layout.openDialog(Gt,"md",{initialState:{user:this.selected,parentGroup:this.currentGroup}})}setEnv(o){let n;o.length?(n=o[o.length-1].path,this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}${ve(o)}`:`/${S.BASE}/${S.GROUPS}${ve(o)}`,firstLink:`/${S.BASE}/${S.GROUPS}`,splicing:1,translating:!0,sameLink:!1,mutateLevel:{0:{setTitle:this.personalGroupsView?Y.PGROUPS:Y.GROUPS,translateTitle:!0}}})):this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}/${Y.PGROUPS}`:`/${S.BASE}/${S.GROUPS}/${Y.GROUPS}`,splicing:2,translating:!0,sameLink:!0}),this.loadGroups(n)}loadGroups(o){this.loading=!0,this.onSelect(),this.adminService.browseGroup(o,this.personalGroupsView).subscribe({next:n=>{this.currentGroup=n.parentGroup,this.sortBy(this.sortTable.sortParam.column,!1,n.members),this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1),this.loading=!1},error:n=>{this.members=[],this.layout.sendNotification("error","Groups",n.error.message),this.onSelect(),this.loading=!1}})}focusOn(o){let n=this.members.find(e=>e.name===o);n&&(setTimeout(()=>this.scrollView.scrollInto(n),100),this.onSelect(n))}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-groups"]],viewQuery:function(n,e){if(n&1&&(Q(Se,5),Q(Ge,7),Q(Nt,7),Q($t,7)),n&2){let p;q(p=W())&&(e.scrollView=p.first),q(p=W())&&(e.inputFilter=p.first),q(p=W())&&(e.mainContextMenu=p.first),q(p=W())&&(e.targetContextMenu=p.first)}},decls:48,vars:42,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"],["dropdown","",1,"btn-group","btn-group-sm","me-1"],["dropdownToggle","","container","body","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle",3,"tooltip"],[3,"icon"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"btn-group","btn-group-sm"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],["contextMenuItem","",3,"execute"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["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","avatar"],[1,"d-flex","flex-column"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"]],template:function(n,e){if(n&1){let p=A();r(0,"div",2)(1,"button",3),v(2,"translate"),_("click",function(){return y(p),G(e.refresh())}),d(3,"fa-icon",4),a(),r(4,"div",5)(5,"button",6),v(6,"translate"),d(7,"fa-icon",7),a(),T(8,jt,11,7,"ul",8),a(),r(9,"button",9),v(10,"translate"),_("click",function(){return y(p),G(e.openDialog(!1,!0))}),d(11,"fa-icon",7),a(),r(12,"button",9),v(13,"translate"),_("click",function(){return y(p),G(e.openDialog())}),d(14,"fa-icon",7),a(),r(15,"div",10)(16,"button",11),_("ngModelChange",function(b){return y(p),G(e.onPersonalGroupsView(b))}),r(17,"div",12),d(18,"fa-icon",13),r(19,"span",14),m(20,"Personal groups"),a()()(),r(21,"div",15),d(22,"app-input-filter",16),a()()(),r(23,"table",17)(24,"thead")(25,"tr"),B(26,Qt,1,1,null,null,St),v(28,"keyvalue"),a()()(),r(29,"app-virtual-scroll",18),v(30,"searchFilter"),_("contextmenu",function(b){return y(p),G(e.onContextMenu(b))}),r(31,"table",17)(32,"tbody",19),B(33,ai,4,5,"tr",20,Lt),a()()(),r(35,"div",21)(36,"span",22),m(37),v(38,"translate"),a()(),r(39,"context-menu",null,0),h(41,si,1,0,null,23),h(42,pi,1,0,null,23),T(43,ci,0,0,"ng-template",24)(44,ui,3,1,"ng-template",25),_("execute",function(){return y(p),G(e.refresh())}),a(),r(45,"context-menu",null,1),h(47,bi,3,1),a()}n&2&&(s(),c("tooltip",w(2,21,"Refresh",e.locale.language)),s(2),c("icon",e.icons.faRotate)("animation",e.loading?"spin":null),s(2),c("tooltip",w(6,24,"New",e.locale.language)),s(2),c("icon",e.icons.faPlus),s(2),c("disabled",!e.selected)("tooltip",w(10,27,e.selected!=null&&e.selected.isUser?"Remove from group":"Delete group",e.locale.language)),s(2),c("icon",e.icons.faMinus),s(),c("disabled",!e.selected)("tooltip",w(13,30,e.selected!=null&&e.selected.isGroup?"Edit group":"Edit user",e.locale.language)),s(2),c("icon",e.icons.faPen),s(2),c("ngModel",e.personalGroupsView),s(2),c("icon",e.personalGroupsView?e.icons.faToggleOn:e.icons.faToggleOff),s(8),N(w(28,33,e.tableHeaders,e.originalOrderKeyValue)),s(3),c("bufferAmount",5)("items",w(30,36,e.members,e.inputFilter.search())),s(4),N(e.scrollView==null?null:e.scrollView.viewPortItems),s(4),Ee("",e.members.length," ",w(38,39,"groups",e.locale.language)),s(4),g(e.currentGroup&&!e.personalGroupsView||!e.currentGroup&&e.personalGroupsView?41:-1),s(),g(e.currentGroup?42:-1),s(),c("divider",!0),s(4),g(e.selected?47:-1))},dependencies:[ot,nt,it,M,P,Ge,Se,je,ft,gt,ht,rt,ne,L,ie,te,re,at,bt,_e],encapsulation:2});let t=l;return t})();export{oo as AdminGroupsComponent};
|
|
1
|
+
import{a as ue,b as z,c as we,d as Ct}from"./chunk-TXPODW5Q.js";import{b as R,c as _t}from"./chunk-3GC2BQZD.js";import{a as S,b as Y,c as tt,e as dt}from"./chunk-T55FAU2O.js";import{a as bt}from"./chunk-MTRNPGS4.js";import{a as ft,b as ht,c as gt}from"./chunk-HZA7R43P.js";import{a as _e,b as st,c as mt,d as pt,f as ct,i as ut}from"./chunk-VHYIXL7R.js";import{a as Ge,b as Se,c as at,d as lt}from"./chunk-5YKWZT33.js";import"./chunk-DGVNNICG.js";import{g as rt}from"./chunk-MOVWEZ7J.js";import{L as Ze,Lb as xe,M as K,N as et,Qb as ye,Ta as ve,Xa as de,pa as it,qa as nt,ra as ot,ua as H,v as je,wb as V}from"./chunk-Y2CDUS4J.js";import{b as Me,d as Pe}from"./chunk-XE5YHU5J.js";import{$c as Ve,Bf as Ye,Cb as _,E as be,Eb as u,Ed as re,Fd as P,Ga as J,Gc as te,Gd as Ke,Ge as se,Gf as ce,Ib as Q,If as Je,Jb as q,Kb as W,L as O,Ld as ae,Ma as s,Mb as Ce,Nb as U,Ob as k,Pb as m,Qb as C,Qd as He,Rb as $,Re as qe,Sb as Ee,Tb as X,Ub as Z,Ue as We,Uf as Xe,Vb as ee,Xa as E,Xb as Ae,Yb as De,Zc as M,ab as T,ad as Re,ae as le,bb as I,cd as Fe,dc as v,ec as D,ed as L,fc as w,fd as Ue,gd as ke,ha as x,id as j,jb as h,jd as ie,kb as g,ma as y,na as G,nb as B,nd as Oe,ob as N,od as Ie,of as me,pb as c,pd as Be,qb as r,qd as Ne,rb as a,rd as $e,sb as d,wd as ne,wf as pe,xd as Le,xe as Qe,yd as oe,zb as A,zf as ze}from"./chunk-RSNLYAN6.js";import{a as he,b as ge}from"./chunk-RTRJ3KFH.js";var vt=(()=>{let l=class l{constructor(){this.currentMemberIds=[],this.hasChanges=new I,this.layout=x(V),this.newMembers=[],this.submitted=!1,this.icons={faUserPlus:se},this.adminService=x(R)}searchMembers(o){let n={search:o,onlyUsers:!0,usersRole:this.parentGroup.type===ue.USER?Ze.USER:void 0,ignoreUserIds:[...this.currentMemberIds,...this.newMembers.map(e=>e.id)]};return this.adminService.searchMembers(n)}onSubmit(){this.submitted=!0,this.adminService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(o=>o.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.newMembers.map(o=>o.name).join("<br>"),null,{enableHtml:!0}),this.layout.closeDialog()},error:o=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.newMembers.map(n=>n.name).join("<br>"),o,{enableHtml:!0})}})}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-add-users-dialog"]],inputs:{parentGroup:"parentGroup",currentMemberIds:"currentMemberIds"},outputs:{hasChanges:"hasChanges"},decls:16,vars:7,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-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,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],[1,"modal-footer"],["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(n,e){n&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Add members"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"app-user-search",7),ee("membersChange",function(f){return Z(e.newMembers,f)||(e.newMembers=f),f}),a()(),r(11,"div",8)(12,"button",9),_("click",function(){return e.layout.closeDialog()}),m(13,"Cancel"),a(),r(14,"button",10),_("click",function(){return e.onSubmit()}),m(15," Confirm "),a()()),n&2&&(s(2),c("icon",e.icons.faUserPlus),s(2),C(e.parentGroup.name),s(6),X("members",e.newMembers),c("withPermissions",!1)("customPlaceholder","Type to search for users to add")("searchFunction",e.searchMembers.bind(e)),s(4),c("disabled",e.submitted||!e.newMembers.length))},dependencies:[M,P,ut],encapsulation:2});let t=l;return t})();function wt(t,l){if(t&1&&d(0,"img",9),t&2){let i=u();c("src",i.member.avatarUrl,J)}}function Tt(t,l){if(t&1&&d(0,"fa-icon",15),t&2){let i=u();k(i.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",i.icons.GROUPS)}}function Et(t,l){if(t&1&&(r(0,"div",7)(1,"span",16),m(2,"from the group"),a(),r(3,"span",11),m(4),v(5,"capitalize"),a()()),t&2){let i=u();s(4),C(D(5,1,i.parentGroup.name))}}function At(t,l){t&1&&(r(0,"small",4),m(1,"Only the group will be deleted, the members will no longer be part of it."),a())}var xt=(()=>{let l=class l{constructor(){this.wasDeleted=new I,this.submitted=!1,this.icons={GROUPS:H.GROUPS,faMinus:ae,faUserMinus:pe},this.layout=x(V),this.adminService=x(R)}onSubmit(){this.submitted=!0;let o=this.member.isUser?"Remove from group":"Delete group";(this.member.isUser?this.adminService.removeUserFromGroup(this.parentGroup.id,this.member.id):this.adminService.deleteGroup(this.member.id)).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success",o,this.member.name),this.onClose()},error:e=>{this.submitted=!1,this.layout.sendNotification("error",o,this.member.name,e)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-delete-dialog"]],inputs:{parentGroup:"parentGroup",member:"member"},outputs:{wasDeleted:"wasDeleted"},decls:26,vars:10,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-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"],[1,"d-flex","align-items-center"],[1,"d-flex","align-items-center","avatar","me-2"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],[1,"fw-bold","me-1"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],[3,"icon"],["l10nTranslate","",1,"mx-1"]],template:function(n,e){n&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7),a()(),r(8,"button",5),_("click",function(){return e.onClose()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8),h(12,wt,1,1,"img",9)(13,Tt,1,3,"fa-icon",10),a(),r(14,"span",11),m(15),v(16,"capitalize"),a(),r(17,"span",4),m(18,"will be removed"),a(),h(19,Et,6,3,"div",7),a(),h(20,At,2,0,"small",4),a(),r(21,"div",12)(22,"button",13),_("click",function(){return e.onClose()}),m(23,"Cancel"),a(),r(24,"button",14),_("click",function(){return e.onSubmit()}),m(25," Remove "),a()()),n&2&&(s(2),c("icon",e.member.isUser?e.icons.faUserMinus:e.icons.faMinus),s(2),C(e.member.name),s(3),C(e.member.isUser?"Remove from group":"Delete group"),s(5),g(e.member.isUser?12:13),s(3),C(D(16,8,e.member.name)),s(4),g(e.member.isUser?19:-1),s(),g(e.member.isGroup?20:-1),s(4),c("disabled",e.submitted))},dependencies:[M,P,dt],encapsulation:2});let t=l;return t})();var Dt=(t,l)=>l.value;function Mt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span"),m(2),a()),t&2){let i=u();c("icon",i.icons.faPen),s(2),C(i.group.name)}}function Pt(t,l){if(t&1&&(d(0,"fa-icon",31),r(1,"span",23),m(2,"New group"),a()),t&2){let i=u();c("icon",i.icons.faPlus)}}function Vt(t,l){t&1&&(r(0,"h4",2)(1,"span",23),m(2,"Edit group"),a()())}function Rt(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Settings"),a()),t&2){let i=u();c("icon",i.icons.faCog)}}function Ft(t,l){if(t&1&&(r(0,"option",21),m(1),a()),t&2){let i=l.$implicit;c("ngValue",i.value),s(),C(i.key)}}function Ut(t,l){t&1&&(r(0,"span",23),m(1,"All users can see this group."),a())}function kt(t,l){t&1&&(r(0,"span",23),m(1,"Users who are not members of this group cannot see it."),a())}function Ot(t,l){t&1&&(r(0,"span",23),m(1,"The group is not visible, its members cannot see it and cannot see each other."),a())}function It(t,l){if(t&1&&(r(0,"div",24)(1,"div",18)(2,"label",34),m(3,"Creation date"),a(),r(4,"div",35),m(5),v(6,"amDateFormat"),a()(),r(7,"div",36)(8,"label",37),m(9,"Modification date"),a(),r(10,"div",38),m(11),v(12,"amDateFormat"),a()()()),t&2){let i=u();s(5),C(D(6,2,i.group.createdAt)),s(6),C(D(12,4,i.group.modifiedAt))}}function Bt(t,l){if(t&1&&(d(0,"fa-icon",32),r(1,"span",33),m(2,"Permissions"),a()),t&2){let i=u();c("icon",i.icons.faShieldHalved)}}var Te=(()=>{let l=class l{constructor(){this.group=null,this.parentGroup=null,this.groupChange=new I,this.locale=x(oe),this.layout=x(V),this.icons={GROUPS:H.GROUPS,faPen:me,faPlus:ce,faCog:qe,faShieldHalved:Ye},this.submitted=!1,this.originalOrderKeyValue=de,this.allVisibilities={Visible:z.VISIBLE,Private:z.PRIVATE,Isolated:z.ISOLATED},this.adminService=x(R)}ngOnInit(){this.groupForm=new ke({name:new j(this.group?.name||"",Fe.required),description:new j(this.group?.description||""),visibility:new j(this.group?.visibility||z.VISIBLE),applications:new j(this.group?.applications||[]),parent:new j(this.parentGroup)})}updateApplications(o){this.groupForm.controls.applications.setValue(o),this.groupForm.controls.applications.markAsDirty()}onSetParent(o){this.groupForm.controls.parent.setValue(o?{id:o.id,name:o.name}:null),this.groupForm.controls.parent.markAsDirty()}searchGroups(o){let n={search:o,onlyGroups:!0,excludePersonalGroups:!0,ignoreGroupIds:this.groupForm.value.parent?[this.groupForm.value.parent.id]:[]};return this.adminService.searchMembers(n,!0)}onSubmit(){if(this.submitted=!0,this.group?.id){let o=this.makeDto();this.adminService.updateGroup(this.group.id,o).subscribe({next:n=>{this.groupChange.emit(["update",n]),this.layout.sendNotification("success","Group updated",this.groupForm.value.name),this.layout.closeDialog()},error:n=>this.onError(n)})}else{let o=this.makeDto(!0);this.adminService.createGroup(o).subscribe({next:n=>{this.groupChange.emit(["add",n]),this.layout.sendNotification("success","Group created",this.groupForm.value.name),this.layout.closeDialog()},error:n=>this.onError(n)})}}makeDto(o=!1){let n;o?n=Object.fromEntries(Object.keys(this.groupForm.controls).map(e=>[e,this.groupForm.controls[e].value])):n=Object.fromEntries(Object.keys(this.groupForm.controls).filter(e=>this.groupForm.controls[e].dirty).map(e=>[e,this.groupForm.controls[e].value]));for(let e in n)switch(e){case"applications":n.permissions=n[e].join(et),delete n.applications;break;case"parent":n.parentId=n[e]?n[e].id:null,delete n.parent;break}return n}onError(o){this.layout.sendNotification("error","Group error",this.groupForm.value.name,o),this.submitted=!1}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-dialog"]],inputs:{group:"group",parentGroup:"parentGroup"},outputs:{groupChange:"groupChange"},decls:50,vars:24,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body","form-validation",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","formControlName","name","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","formControlName","description","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"d-flex","flex-column","align-items-start","col-12","pb-3"],[1,"col-6","pe-4"],["for","visibility","l10nTranslate",""],["id","visibility","formControlName","visibility",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],[1,"d-none","d-sm-block","fst-italic","fs-xxs"],["l10nTranslate",""],[1,"d-flex","align-items-start","col-12","pb-3"],["for","parent","translate",""],["id","parent",3,"data","searchFunction","active","itemIcon","placeholder"],[3,"permissionsChange","permissions"],[1,"modal-footer"],["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"],[1,"me-2",3,"icon"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","modified","l10nTranslate",""],["id","modified"]],template:function(n,e){if(n&1&&(r(0,"div",0)(1,"h4",1),h(2,Mt,3,2)(3,Pt,3,1),a(),h(4,Vt,3,0,"h4",2),r(5,"button",3),_("click",function(){return e.layout.closeDialog()}),a()(),r(6,"div",4)(7,"tabset",5),d(8,"hr",6),r(9,"tab",7),_("selectTab",function(){return e.tabView=null}),T(10,Rt,3,1,"ng-template",8),r(11,"div",9)(12,"div",10)(13,"div",11)(14,"label",12),m(15,"Name"),a(),d(16,"input",13),a(),r(17,"div",14)(18,"label",15),m(19,"Description"),a(),d(20,"input",16),a()(),r(21,"div",17)(22,"div",18)(23,"label",19),m(24,"Visibility"),a(),r(25,"select",20),B(26,Ft,2,2,"option",21,Dt),v(28,"keyvalue"),a()(),r(29,"div",22),h(30,Ut,2,0,"span",23)(31,kt,2,0,"span",23)(32,Ot,2,0,"span",23),a()(),r(33,"div",24)(34,"div",18)(35,"label",25),m(36,"Parent group"),a(),r(37,"app-select",26),v(38,"translate"),_("data",function(f){return e.onSetParent(f)}),a()()(),h(39,It,13,6,"div",24),a()(),r(40,"tab",7),_("selectTab",function(){return e.tabView="permissions"}),T(41,Bt,3,1,"ng-template",8),r(42,"div",9)(43,"div",10)(44,"app-admin-permissions",27),_("permissionsChange",function(f){return e.updateApplications(f)}),a()()()()()(),r(45,"div",28)(46,"button",29),_("click",function(){return e.layout.closeDialog()}),m(47,"Cancel"),a(),r(48,"button",30),_("click",function(){return e.onSubmit()}),m(49," Confirm "),a()()),n&2){let p;s(2),g(e.group?2:3),s(2),g(e.group?4:-1),s(),k(Ae("btn-close btn-close-white ",e.group?"ms-2":"ms-auto"," ms-2")),s(),c("formGroup",e.groupForm),s(),c("justified",!0),s(9),U("is-invalid",e.groupForm.controls.name.invalid),c("autoSelect",!1),s(10),N(w(28,18,e.allVisibilities,e.originalOrderKeyValue)),s(4),g((p=e.groupForm.value.visibility)===e.allVisibilities.Visible?30:p===e.allVisibilities.Private?31:p===e.allVisibilities.Isolated?32:-1),s(7),c("searchFunction",e.searchGroups.bind(e))("active",e.groupForm.value.parent)("itemIcon",e.icons.GROUPS)("placeholder",w(38,21,"Select the parent group",e.locale.language)),s(2),g(e.group?39:-1),s(5),c("permissions",e.groupForm.value.applications),s(4),c("disabled",e.submitted||e.groupForm.invalid)}},dependencies:[M,P,Le,Ne,$e,Re,Be,L,Ue,Oe,Ie,ct,_t,Ct,mt,pt,st,te,re,_e],encapsulation:2});let t=l;return t})();var Gt=(()=>{let l=class l{constructor(){this.layout=x(V),this.submitted=!1,this.isManager=!1,this.USER_GROUP_ROLE=K,this.icons={faUserPen:Qe,faKey:le},this.adminService=x(R)}ngOnInit(){this.isManager=this.user.isGroupManager}onSubmit(){if(this.submitted=!0,this.user.isGroupManager===this.isManager){this.layout.closeDialog();return}let o=this.isManager?K.MANAGER:K.MEMBER;this.adminService.updateUserFromGroup(this.parentGroup.id,this.user.id,{role:o}).subscribe({next:()=>{this.user.setGroupRole(o),this.layout.sendNotification("success","Edit user",this.user.name),this.layout.closeDialog()},error:n=>{this.submitted=!1,this.layout.sendNotification("error","Edit user",this.user.name,n)}})}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-group-edit-user-dialog"]],inputs:{parentGroup:"parentGroup",user:"user"},decls:25,vars:5,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-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"],[1,"d-flex","align-items-center"],[1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],[1,"form-check-label"],["type","checkbox",1,"form-check-input",3,"ngModelChange","ngModel"],[1,"ms-1",3,"icon"],[1,"modal-footer"],["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(n,e){n&1&&(r(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),r(3,"span"),m(4),a()(),r(5,"h4",3)(6,"span",4),m(7,"Edit user"),a()(),r(8,"button",5),_("click",function(){return e.layout.closeDialog()}),a()(),r(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"label",10)(14,"input",11),ee("ngModelChange",function(f){return Z(e.isManager,f)||(e.isManager=f),f}),a(),r(15,"span",4),m(16,"Set as group manager"),a(),d(17,"fa-icon",12),a()()()(),r(18,"small",4),m(19,"As a manager, the user will be able to manage group members but not group properties."),a()(),r(20,"div",13)(21,"button",14),_("click",function(){return e.layout.closeDialog()}),m(22,"Cancel"),a(),r(23,"button",15),_("click",function(){return e.onSubmit()}),m(24," Confirm "),a()()),n&2&&(s(2),c("icon",e.icons.faUserPen),s(2),C(e.user.name),s(10),X("ngModel",e.isManager),s(3),c("icon",e.icons.faKey),s(6),c("disabled",e.submitted))},dependencies:[M,P,ne,Ve,L,ie],encapsulation:2});let t=l;return t})();var Nt=["MainContextMenu"],$t=["TargetContextMenu"],St=(t,l)=>l.key,Lt=(t,l)=>l.mid;function jt(t,l){if(t&1){let i=A();r(0,"ul",26)(1,"li",27)(2,"a",28),_("click",function(){y(i);let n=u();return G(n.openDialog(!0))}),r(3,"span",14),d(4,"fa-icon",7),m(5),a()()(),r(6,"li",27)(7,"a",28),_("click",function(){y(i);let n=u();return G(n.addUserToGroupDialog())}),r(8,"span",14),d(9,"fa-icon",7),m(10,"Add members"),a()()()()}if(t&2){let i=u();s(2),U("disabled",!!i.currentGroup&&i.personalGroupsView),s(2),c("icon",i.icons.GROUPS),s(),$(" ",i.personalGroupsView?"Personal group":"Group"),s(2),U("disabled",!i.currentGroup),s(2),c("icon",i.icons.faUserPlus)}}function Kt(t,l){if(t&1&&d(0,"fa-icon",31),t&2){let i=u(3);c("icon",i.sortTable.sortParam.asc?i.icons.faArrowDown:i.icons.faArrowUp)("fixedWidth",!1)}}function Ht(t,l){if(t&1){let i=A();r(0,"th",30),_("click",function(){y(i);let n=u().$implicit,e=u();return G(e.sortBy(n.key))}),m(1),h(2,Kt,1,2,"fa-icon",31),a()}if(t&2){let i=u().$implicit,o=u();k(i.value.class),Ce("width",i.value.width,"%"),U("text-align-center",i.value.textCenter)("cursor-pointer",i.value.sortable),s(),$(" ",i.value.label," "),s(),g(o.sortTable.sortParam.column===i.key?2:-1)}}function Qt(t,l){if(t&1&&h(0,Ht,3,10,"th",29),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function qt(t,l){if(t&1&&d(0,"img",36),t&2){let i=u(4).$implicit;c("src",i.avatarUrl,J)}}function Wt(t,l){if(t&1&&d(0,"fa-icon",7),t&2){let i=u(4).$implicit,o=u();k(i.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),c("icon",o.icons.GROUPS)}}function zt(t,l){if(t&1&&d(0,"fa-icon",39),t&2){let i=u(5);c("icon",i.icons.faKey)}}function Yt(t,l){if(t&1&&(r(0,"div",34),h(1,qt,1,1,"img",36)(2,Wt,1,3,"fa-icon",37),r(3,"div",35)(4,"span",38),m(5),h(6,zt,1,1,"fa-icon",39),a(),r(7,"span",40),m(8),a()()()),t&2){let i=u(3).$implicit;s(),g(i.isUser?1:2),s(4),$(" ",i.name," "),s(),g(i.isUser&&i.isGroupManager?6:-1),s(2),C(i.description)}}function Jt(t,l){if(t&1&&(r(0,"span"),m(1),v(2,"joinCounts"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.counts))}}function Xt(t,l){if(t&1&&h(0,Jt,3,3,"span"),t&2){let i=u(3).$implicit;g(i.isGroup?0:-1)}}function Zt(t,l){t&1&&(r(0,"span",14),m(1,"manager"),a())}function ei(t,l){if(t&1&&(r(0,"span",14),m(1),a()),t&2){let i=u(4).$implicit;s(),C(i.type)}}function ti(t,l){if(t&1&&h(0,Zt,2,0,"span",14)(1,ei,2,1,"span",14),t&2){let i=u(3).$implicit;g(i.isUser&&i.isGroupManager?0:1)}}function ii(t,l){if(t&1&&(r(0,"div"),m(1),v(2,"amDateFormat"),a()),t&2){let i=u(4).$implicit;s(),C(D(2,1,i.modifiedAt))}}function ni(t,l){if(t&1&&(r(0,"div",35)(1,"div"),m(2),v(3,"amDateFormat"),a(),h(4,ii,3,3,"div"),a()),t&2){let i=u(3).$implicit;s(2),C(D(3,2,i.createdAt)),s(2),g(i.modifiedAt?4:-1)}}function oi(t,l){if(t&1&&(r(0,"td"),h(1,Yt,9,4,"div",34)(2,Xt,1,1)(3,ti,2,1)(4,ni,5,4,"div",35),a()),t&2){let i,o=u().$implicit,n=u().$implicit;k(De("",o.value.class," ",o.value.newly?"prop-newly-"+n[o.value.newly]:"")),Ce("width",o.value.width,"%"),U("text-align-center",o.value.textCenter),s(),g((i=o.key)==="name"?1:i==="members"?2:i==="type"?3:i==="createdAndModified"?4:-1)}}function ri(t,l){if(t&1&&h(0,oi,5,9,"td",33),t&2){let i=l.$implicit;g(i.value.show?0:-1)}}function ai(t,l){if(t&1){let i=A();r(0,"tr",32),_("click",function(){let n=y(i).$implicit,e=u();return G(e.onSelect(n))})("contextmenu",function(n){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(n,e))})("pressup",function(n){let e=y(i).$implicit,p=u();return G(p.onTargetContextMenu(n,e))})("tap",function(){let n=y(i).$implicit,e=u();return G(e.browse(n))}),B(1,ri,1,1,null,null,St),v(3,"keyvalue"),a()}if(t&2){let i=l.$implicit,o=u();U("selected",i.mid===(o.selected==null?null:o.selected.mid)),s(),N(w(3,2,o.tableHeaders,o.originalOrderKeyValue))}}function li(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPlus),s(),$(" ",i.personalGroupsView?"Personal group":"Group")}}function si(t,l){if(t&1){let i=A();T(0,li,3,2,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.openDialog(!0))})}}function mi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Add members"),a()),t&2){let i=u(2);s(),c("icon",i.icons.faUserPlus)}}function pi(t,l){if(t&1){let i=A();T(0,mi,3,1,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.addUserToGroupDialog())})}}function ci(t,l){}function ui(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Refresh"),a()),t&2){let i=u();s(),c("icon",i.icons.faArrowRotateRight)}}function di(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2),a()),t&2){let i=u(2);s(),c("icon",i.icons.faPen),s(),$(" ",i.selected.isGroup?"Edit group":"Edit user")}}function _i(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Delete group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faMinus)}}function fi(t,l){if(t&1){let i=A();T(0,_i,3,1,"ng-template",25),_("execute",function(){y(i);let n=u(2);return G(n.openDialog(!1,!0))})}}function hi(t,l){if(t&1&&(r(0,"span",14),d(1,"fa-icon",7),m(2,"Remove from group"),a()),t&2){let i=u(3);s(),c("icon",i.icons.faUserMinus)}}function gi(t,l){if(t&1){let i=A();T(0,hi,3,1,"ng-template",25),_("execute",function(){y(i);let n=u(2);return G(n.openDialog(!1,!0))})}}function bi(t,l){if(t&1){let i=A();T(0,di,3,2,"ng-template",25),_("execute",function(){y(i);let n=u();return G(n.openDialog())}),h(1,fi,1,0,null,23)(2,gi,1,0,null,23)}if(t&2){let i=u();s(),g(i.selected.isGroup?1:2)}}var oo=(()=>{let l=class l{constructor(){this.locale=x(oe),this.originalOrderKeyValue=de,this.icons={GROUPS:H.GROUPS,faRotate:Ke,faPlus:ce,faMinus:ae,faPen:me,faArrowDown:Xe,faArrowUp:We,faKey:le,faUserPlus:se,faUserMinus:pe,faArrowRotateRight:Je,faToggleOn:ze,faToggleOff:He},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},type:{label:"Type",width:10,textCenter:!0,class:"",show:!0,sortable:!0},members:{label:"Members",width:10,class:"",textCenter:!0,show:!0},createdAndModified:{label:"Created & Modified",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.personalGroupsView=!1,this.loading=!1,this.selected=null,this.members=[],this.router=x(Pe),this.activatedRoute=x(Me),this.layout=x(V),this.adminService=x(R),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],type:[{prop:"type",type:"string"}],createdAndModified:[{prop:"modifiedAt",type:"date"},{prop:"createdAt",type:"date"}]},this.sortTable=new lt(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(o=>{this.personalGroupsView=o.type===ue.PERSONAL,this.setEnv(o.routes)}),this.activatedRoute.queryParams.subscribe(o=>this.focusOnSelect=o.select),this.layout.setBreadcrumbIcon(tt.GROUPS)}onPersonalGroupsView(o){this.personalGroupsView=o,this.router.navigate([S.BASE,o?S.PGROUPS:S.GROUPS]).catch(console.error)}refresh(){this.loadGroups(this.currentGroup?.name)}browse(o){o.isGroup&&this.router.navigate([o.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(o=null){this.selected=o}onContextMenu(o){o.preventDefault(),o.stopPropagation(),this.layout.openContextMenu(o,this.mainContextMenu)}onTargetContextMenu(o,n){o.preventDefault(),o.type==="contextmenu"&&o.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(o,this.targetContextMenu)}sortBy(o,n=!0,e){this.members=this.sortTable.sortBy(o,n,e||this.members)}addUserToGroupDialog(){this.layout.openDialog(vt,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(n=>n.isUser).map(n=>n.id)}}).content.hasChanges.pipe(be(n=>n),O(1)).subscribe(()=>this.refresh())}openDialog(o=!1,n=!1){o?this.personalGroupsView?this.layout.openDialog(we,"md").content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="add"&&(b.setGroupRole(K.MANAGER),b.counts={users:1},this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(b)),this.onSelect(b))}):this.layout.openDialog(Te,"md",{initialState:{parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;if(f==="add")if(!this.currentGroup&&!b?.parent||b.parent.id===this.currentGroup.id){let F=new ye(ge(he({},b),{type:xe.GROUP}));this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(new ye(ge(he({},b),{type:xe.GROUP})))),this.onSelect(F)}else this.router.navigate([`${S.BASE}/${S.GROUPS}`,b.parent?.id?b.parent.name:""],{queryParams:{select:b.name}}).catch(console.error)}):n?this.layout.openDialog(xt,"md",{initialState:{parentGroup:this.currentGroup,member:this.selected}}).content.wasDeleted.pipe(be(p=>p),O(1)).subscribe(()=>{this.currentGroup?this.selected.counts?.groups?this.loadGroups(this.currentGroup.name):(this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(p=>this.selected.mid!==p.mid)),this.onSelect()):this.loadGroups()}):this.selected.isGroup?this.personalGroupsView?this.layout.openDialog(we,"md",{initialState:{originalGroup:this.selected}}).content.groupChange.pipe(O(1)).subscribe(p=>{let[f,b]=p;f==="update"&&(this.selected=Object.assign(this.selected,{name:b.name,description:b.description,modifiedAt:b.modifiedAt}))}):this.adminService.getGroup(this.selected.id).subscribe({next:e=>{this.layout.openDialog(Te,"md",{initialState:{group:e,parentGroup:this.currentGroup}}).content.groupChange.pipe(O(1)).subscribe(f=>{let[b,F]=f;b==="update"&&(!this.currentGroup&&!F?.parent||F.parent.id===this.currentGroup.id?this.selected=Object.assign(this.selected,F):this.router.navigate([`${S.BASE}/${S.GROUPS}`,F.parent?.id?F.parent.name:""],{queryParams:{select:F.name}}).catch(console.error))})},error:e=>this.layout.sendNotification("error","Edit group",this.selected.name,e)}):this.layout.openDialog(Gt,"md",{initialState:{user:this.selected,parentGroup:this.currentGroup}})}setEnv(o){let n;o.length?(n=o[o.length-1].path,this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}${ve(o)}`:`/${S.BASE}/${S.GROUPS}${ve(o)}`,firstLink:`/${S.BASE}/${S.GROUPS}`,splicing:1,translating:!0,sameLink:!1,mutateLevel:{0:{setTitle:this.personalGroupsView?Y.PGROUPS:Y.GROUPS,translateTitle:!0}}})):this.layout.setBreadcrumbNav({url:this.personalGroupsView?`/${S.BASE}/${S.PGROUPS}/${Y.PGROUPS}`:`/${S.BASE}/${S.GROUPS}/${Y.GROUPS}`,splicing:2,translating:!0,sameLink:!0}),this.loadGroups(n)}loadGroups(o){this.loading=!0,this.onSelect(),this.adminService.browseGroup(o,this.personalGroupsView).subscribe({next:n=>{this.currentGroup=n.parentGroup,this.sortBy(this.sortTable.sortParam.column,!1,n.members),this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1),this.loading=!1},error:n=>{this.members=[],this.layout.sendNotification("error","Groups",n.error.message),this.onSelect(),this.loading=!1}})}focusOn(o){let n=this.members.find(e=>e.name===o);n&&(setTimeout(()=>this.scrollView.scrollInto(n),100),this.onSelect(n))}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=E({type:l,selectors:[["app-admin-groups"]],viewQuery:function(n,e){if(n&1&&(Q(Se,5),Q(Ge,7),Q(Nt,7),Q($t,7)),n&2){let p;q(p=W())&&(e.scrollView=p.first),q(p=W())&&(e.inputFilter=p.first),q(p=W())&&(e.mainContextMenu=p.first),q(p=W())&&(e.targetContextMenu=p.first)}},decls:48,vars:42,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"],["dropdown","",1,"btn-group","btn-group-sm","me-1"],["dropdownToggle","","container","body","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle",3,"tooltip"],[3,"icon"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"btn-group","btn-group-sm"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],["contextMenuItem","",3,"execute"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["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","avatar"],[1,"d-flex","flex-column"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"]],template:function(n,e){if(n&1){let p=A();r(0,"div",2)(1,"button",3),v(2,"translate"),_("click",function(){return y(p),G(e.refresh())}),d(3,"fa-icon",4),a(),r(4,"div",5)(5,"button",6),v(6,"translate"),d(7,"fa-icon",7),a(),T(8,jt,11,7,"ul",8),a(),r(9,"button",9),v(10,"translate"),_("click",function(){return y(p),G(e.openDialog(!1,!0))}),d(11,"fa-icon",7),a(),r(12,"button",9),v(13,"translate"),_("click",function(){return y(p),G(e.openDialog())}),d(14,"fa-icon",7),a(),r(15,"div",10)(16,"button",11),_("ngModelChange",function(b){return y(p),G(e.onPersonalGroupsView(b))}),r(17,"div",12),d(18,"fa-icon",13),r(19,"span",14),m(20,"Personal groups"),a()()(),r(21,"div",15),d(22,"app-input-filter",16),a()()(),r(23,"table",17)(24,"thead")(25,"tr"),B(26,Qt,1,1,null,null,St),v(28,"keyvalue"),a()()(),r(29,"app-virtual-scroll",18),v(30,"searchFilter"),_("contextmenu",function(b){return y(p),G(e.onContextMenu(b))}),r(31,"table",17)(32,"tbody",19),B(33,ai,4,5,"tr",20,Lt),a()()(),r(35,"div",21)(36,"span",22),m(37),v(38,"translate"),a()(),r(39,"context-menu",null,0),h(41,si,1,0,null,23),h(42,pi,1,0,null,23),T(43,ci,0,0,"ng-template",24)(44,ui,3,1,"ng-template",25),_("execute",function(){return y(p),G(e.refresh())}),a(),r(45,"context-menu",null,1),h(47,bi,3,1),a()}n&2&&(s(),c("tooltip",w(2,21,"Refresh",e.locale.language)),s(2),c("icon",e.icons.faRotate)("animation",e.loading?"spin":null),s(2),c("tooltip",w(6,24,"New",e.locale.language)),s(2),c("icon",e.icons.faPlus),s(2),c("disabled",!e.selected)("tooltip",w(10,27,e.selected!=null&&e.selected.isUser?"Remove from group":"Delete group",e.locale.language)),s(2),c("icon",e.icons.faMinus),s(),c("disabled",!e.selected)("tooltip",w(13,30,e.selected!=null&&e.selected.isGroup?"Edit group":"Edit user",e.locale.language)),s(2),c("icon",e.icons.faPen),s(2),c("ngModel",e.personalGroupsView),s(2),c("icon",e.personalGroupsView?e.icons.faToggleOn:e.icons.faToggleOff),s(8),N(w(28,33,e.tableHeaders,e.originalOrderKeyValue)),s(3),c("bufferAmount",5)("items",w(30,36,e.members,e.inputFilter.search())),s(4),N(e.scrollView==null?null:e.scrollView.viewPortItems),s(4),Ee("",e.members.length," ",w(38,39,"groups",e.locale.language)),s(4),g(e.currentGroup&&!e.personalGroupsView||!e.currentGroup&&e.personalGroupsView?41:-1),s(),g(e.currentGroup?42:-1),s(),c("divider",!0),s(4),g(e.selected?47:-1))},dependencies:[ot,nt,it,M,P,Ge,Se,je,ft,gt,ht,rt,ne,L,ie,te,re,at,bt,_e],encapsulation:2});let t=l;return t})();export{oo as AdminGroupsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Se}from"./chunk-MWPC5XQW.js";import{a as Q}from"./chunk-FNO4KAYG.js";import"./chunk-Z6S7RFGN.js";import{a as N,b as O,c as ye,d as be}from"./chunk-XN4TXQKE.js";import{b as we,c as ve,d as Te,e as Le}from"./chunk-3PB73RWL.js";import"./chunk-CIGVDQPA.js";import"./chunk-WSVE6EWB.js";import"./chunk-HXRRMHEX.js";import"./chunk-DJRILQTU.js";import{Hb as ge,Ja as Ce,Jb as ke,Xa as fe,kb as xe,pa as de,qa as me,ra as ue,v as X,w as Z,xb as he}from"./chunk-EDLO4Y5E.js";import"./chunk-ZZ3LHYOY.js";import{b as K}from"./chunk-J6YSVODR.js";import{Cb as C,Eb as l,Ed as Y,Fd as J,Ga as D,Gc as q,Ib as L,If as se,Jb as S,Kb as V,L as U,Ma as r,Mb as F,Nb as P,Ob as M,Oe as oe,Pb as u,Qb as v,Rb as I,Sb as B,Ue as re,Uf as ce,Vf as pe,Wd as ee,Xa as W,Xb as R,Yb as H,Zc as j,Zf as _e,ab as T,ce as te,dc as k,fc as y,ha as w,ib as z,ie,jb as x,kb as h,ma as d,na as m,nb as A,ob as $,of as ae,pb as _,qb as s,rb as c,sb as f,te as ne,tf as le,yd as G,zb as b}from"./chunk-JQOMI5VI.js";import"./chunk-RTRJ3KFH.js";var Me=["MainContextMenu"],Ee=["TargetContextMenu"],Ve=(t,a)=>a.id,Fe=(t,a)=>a.key;function Ae(t,a){if(t&1&&(s(0,"span",30),u(1),c()),t&2){let e=l().$implicit,i=l(2);F("font-size",i.galleryMode.textSize,"px"),r(),I(" ",e.hTimeAccessAgo," ")}}function $e(t,a){if(t&1){let e=b();s(0,"div",21),C("click",function(){let o=d(e).$implicit,n=l(2);return m(n.onSelect(o))})("contextmenu",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("pressup",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("tap",function(){d(e);let o=l(2);return m(o.openLinkDialog())}),s(1,"div",22)(2,"img",23),C("error",function(){let o=d(e).$implicit;return m(o.fallBackMimeUrl())}),c(),s(3,"span",24),x(4,Ae,2,3,"span",25),c(),s(5,"span",26),f(6,"app-share-repository",27),c()(),s(7,"div",28)(8,"span",29),u(9),c()()()}if(t&2){let e=a.$implicit,i=a.$index,o=l(2);F("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),P("selected",e.id===(o.selected==null?null:o.selected.id))("disabled",!e.link.isActive),r(),z("rowIndex",i),r(),_("src",e.mimeUrl,D)("height",o.galleryMode.image)("width",o.galleryMode.image),r(2),h(e.newly?4:-1),r(2),_("share",e)("galleryMode",o.galleryMode),r(2),F("font-size",o.galleryMode.textSize,"px"),r(),v(e.name)}}function Pe(t,a){if(t&1){let e=b();s(0,"div",13)(1,"app-virtual-scroll",18),k(2,"searchFilter"),C("contextmenu",function(o){d(e);let n=l();return m(n.onContextMenu(o))}),s(3,"div",19),A(4,$e,10,18,"div",20,Ve),c()()()}if(t&2){let e=l();r(),_("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",y(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),r(3),$(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Ie(t,a){if(t&1&&f(0,"fa-icon",37),t&2){let e=l(4);_("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Be(t,a){if(t&1){let e=b();s(0,"th",36),C("click",function(){d(e);let o=l().$implicit,n=l(2);return m(n.sortBy(o.key))}),u(1),x(2,Ie,1,2,"fa-icon",37),c()}if(t&2){let e=l().$implicit,i=l(2);M(e.value.class),F("width",e.value.width,"%"),P("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),r(),I(" ",e.value.label," "),r(),h(i.sortTable.sortParam.column===e.key?2:-1)}}function Re(t,a){if(t&1&&x(0,Be,3,10,"th",35),t&2){let e=a.$implicit;h(e.value.show?0:-1)}}function De(t,a){if(t&1){let e=b();s(0,"div",40)(1,"img",43),C("error",function(){d(e);let o=l(3).$implicit;return m(o.fallBackMimeUrl())}),c(),s(2,"div",44)(3,"span",29),u(4),c(),s(5,"span",45),u(6),c()()()}if(t&2){let e=l(3).$implicit;r(),_("src",e.mimeUrl,D),r(3),v(e.name),r(2),v(e.description)}}function Ne(t,a){if(t&1&&(s(0,"span"),u(1),c()),t&2){let e=l(4).$implicit;r(),v(e.link.email||"")}}function Oe(t,a){if(t&1&&(s(0,"span",41)(1,"span"),u(2),c(),x(3,Ne,2,1,"span"),c()),t&2){let e=l(3).$implicit;r(2),v(e.link.name),r(),h(e.link.email?3:-1)}}function Qe(t,a){if(t&1&&f(0,"app-share-repository",42),t&2){let e=l(3).$implicit;_("share",e)}}function Ue(t,a){if(t&1&&(s(0,"span"),u(1),c()),t&2){let e=l(4).$implicit;M(R("badge rounded-pill ",e.link.nbAccess>=e.link.limitAccess?"bg-danger":"bg-success")),r(),B(" ",e.link.nbAccess,"/",e.link.limitAccess," ")}}function We(t,a){if(t&1&&(s(0,"span",47),u(1),c()),t&2){let e=l(4).$implicit;r(),v(e.link.nbAccess)}}function ze(t,a){if(t&1&&(s(0,"span",49),u(1),k(2,"translate"),c()),t&2){let e=l(5).$implicit,i=l(2);r(),B("",e.hTimeExpirationAgo,"\xA0",y(2,2,e.hTimeExpirationAgo===1?"day":"days",i.locale.language))}}function He(t,a){if(t&1&&(s(0,"span"),f(1,"fa-icon",37),x(2,ze,3,5,"span",49),c()),t&2){let e=l(4).$implicit,i=l(2);M(R("badge rounded-pill bg-",e.hTimeExpirationAgo>=1?"warning":"danger"," ms-1")),r(),_("icon",i.icons.faClock)("fixedWidth",!1),r(),h(e.hTimeExpirationAgo>=1?2:-1)}}function qe(t,a){if(t&1&&(s(0,"span",48),f(1,"fa-icon",6),c()),t&2){let e=l(6);r(),_("icon",e.icons.faLock)}}function Ke(t,a){if(t&1&&(x(0,Ue,2,5,"span",46)(1,We,2,1,"span",47),x(2,He,3,6,"span",46),x(3,qe,2,1,"span",48)),t&2){let e=l(3).$implicit;h(e.link.limitAccess?0:1),r(2),h(e.link.expiresAt?2:-1),r(),h(e.link.requireAuth?3:-1)}}function je(t,a){if(t&1&&f(0,"app-file-permissions",50),t&2){let e=l(4).$implicit;_("permissions",e.hPerms)}}function Ge(t,a){if(t&1&&x(0,je,1,1,"app-file-permissions",50),t&2){let e=l(3).$implicit;h(e.link.permissions?0:-1)}}function Ye(t,a){if(t&1&&u(0),t&2){let e=l(4).$implicit;I(" ",e.hTimeAccessAgo," ")}}function Je(t,a){t&1&&(s(0,"span",51),u(1,"never"),c())}function Xe(t,a){if(t&1&&x(0,Ye,1,1)(1,Je,2,0,"span",51),t&2){let e=l(3).$implicit;h(e.link.currentAccess?0:1)}}function Ze(t,a){if(t&1&&(s(0,"td"),x(1,De,7,3,"div",40)(2,Oe,4,2,"span",41)(3,Qe,1,1,"app-share-repository",42)(4,Ke,4,3)(5,Ge,1,1)(6,Xe,2,1),c()),t&2){let e,i=l().$implicit,o=l().$implicit;M(H("",i.value.class," ",i.value.newly!==void 0?"props-newly-"+o[i.value.newly]:"")),F("width",i.value.width,"%"),P("text-align-center",i.value.textCenter),r(),h((e=i.key)==="name"?1:e==="link"?2:e==="from"?3:e==="infos"?4:e==="permissions"?5:e==="accessed"?6:-1)}}function et(t,a){if(t&1&&x(0,Ze,7,9,"td",39),t&2){let e=a.$implicit;h(e.value.show?0:-1)}}function tt(t,a){if(t&1){let e=b();s(0,"tr",38),C("click",function(){let o=d(e).$implicit,n=l(2);return m(n.onSelect(o))})("contextmenu",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("pressup",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("tap",function(){d(e);let o=l(2);return m(o.openLinkDialog())}),A(1,et,1,1,null,null,Fe),k(3,"keyvalue"),c()}if(t&2){let e=a.$implicit,i=l(2);P("selected",e.id===(i.selected==null?null:i.selected.id))("disabled",!e.link.isActive),r(),$(y(3,4,i.tableHeaders,i.originalOrderKeyValue))}}function it(t,a){if(t&1){let e=b();s(0,"table",31)(1,"thead")(2,"tr"),A(3,Re,1,1,null,null,Fe),k(5,"keyvalue"),c()()(),s(6,"app-virtual-scroll",32),k(7,"searchFilter"),C("contextmenu",function(o){d(e);let n=l();return m(n.onContextMenu(o))}),s(8,"table",31)(9,"tbody",33),A(10,tt,4,7,"tr",34,Ve),c()()()}if(t&2){let e=l();r(3),$(y(5,2,e.tableHeaders,e.originalOrderKeyValue)),r(3),_("bufferAmount",5)("items",y(7,5,e.shares,e.inputFilter.search())),r(4),$(e.scrollView==null?null:e.scrollView.viewPortItems)}}function nt(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Refresh"),c()),t&2){let e=l();r(),_("icon",e.icons.faArrowRotateRight)}}function ot(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Go to"),c()),t&2){let e=l();r(),_("icon",e.icons.faMapMarkerAlt)}}function rt(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Edit link"),c()),t&2){let e=l();r(),_("icon",e.icons.faPen)}}function at(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Copy link"),c()),t&2){let e=l();r(),_("icon",e.icons.faClipboard)}}function lt(t,a){}function st(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Informations"),c()),t&2){let e=l();r(),_("icon",e.icons.faCircleInfo)}}var Dt=(()=>{let a=class a{constructor(){this.locale=w(G),this.layout=w(he),this.icons={faLink:oe,faArrowRotateRight:se,faArrowDown:ce,faArrowUp:re,faMapMarkerAlt:pe,faPen:ae,faEllipsisH:ee,faClock:ie,faLock:le,faClipboard:ne,faClipboardCheck:te,faCircleInfo:_e},this.originalOrderKeyValue=fe,this.TAB_MENU=Ce,this.loading=!1,this.linkWasCopied=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},link:{label:"Link",width:15,textCenter:!1,class:"d-none d-sm-table-cell",show:!0,sortable:!0},from:{label:"Shared from",width:15,textCenter:!1,class:"d-none d-md-table-cell",show:!0},infos:{label:"Infos",width:15,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},accessed:{label:"Accessed",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",link:"Link",accessed:"Accessed"},this.activatedRoute=w(K),this.store=w(xe),this.linksService=w(Le),this.sharesService=w(ve),this.sortSettings={default:[{prop:"name",type:"string"}],link:[{prop:"link.name",type:"string"}],name:[{prop:"name",type:"string"}],infos:[{prop:"link.nbAccess",type:"number"}],permissions:[{prop:"link.permissions",type:"length"}],accessed:[{prop:"link.currentAccess",type:"date"}]},this.sortTable=new be(this.constructor.name,this.sortSettings),this.loadShareLinks(),this.activatedRoute.queryParams.subscribe(i=>this.focusOnSelect=i.select),this.layout.setBreadcrumbIcon(this.icons.faLink),this.layout.setBreadcrumbNav({url:`/${ke.LINKS}/${ge.SHARED_BY_LINKS}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShareLinks(){this.loading=!0,this.onSelect(),this.linksService.shareLinksList().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:i=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Links",i.error.message)}})}sortBy(i,o=!0,n){this.shares=this.sortTable.sortBy(i,o,n||this.shares)}onSelect(i=null){this.selected=i,this.store.linkSelection.set(this.selected)}openLinkDialog(){this.linksService.shareLink(this.selected.id).subscribe(i=>{this.layout.openDialog(Te,"md",{initialState:{share:i}}).content.shareChange.pipe(U(1)).subscribe(n=>{let[p,g]=n;p==="update"?this.selected=Object.assign(this.selected,g):p==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(E=>E.id!==g.id)))})})}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,o){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(i,this.targetContextMenu)}copyToClipboard(){this.selected&&(this.linksService.copyLinkToClipboard(this.selected.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.selected.file.name||this.selected.name),setTimeout(()=>this.linkWasCopied=!1,3e3))}goTo(i){i=i||this.selected,this.sharesService.goTo(i).catch(console.error)}focusOn(i){let o=this.shares.find(n=>n.name===i);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};a.\u0275fac=function(o){return new(o||a)},a.\u0275cmp=W({type:a,selectors:[["app-shared-links"]],viewQuery:function(o,n){if(o&1&&(L(O,5),L(N,7),L(Q,7),L(Me,7),L(Ee,7)),o&2){let p;S(p=V())&&(n.scrollView=p.first),S(p=V())&&(n.inputFilter=p.first),S(p=V())&&(n.btnNavigationView=p.first),S(p=V())&&(n.mainContextMenu=p.first),S(p=V())&&(n.targetContextMenu=p.first)}},decls:33,vars:36,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],["container","body","type","button",3,"click","disabled","tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-secondary",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","disabled","height","width"],[1,"card",3,"click","contextmenu","pressup","tap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected","disabled"],["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"],[1,"d-flex","flex-column"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"badge","rounded-pill","bg-gray-dark","ms-1"],[1,"ms-2"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,n){if(o&1){let p=b();s(0,"div",2)(1,"button",3),k(2,"translate"),C("click",function(){return d(p),m(n.loadShareLinks())}),f(3,"fa-icon",4),c(),s(4,"button",5),k(5,"translate"),C("click",function(){return d(p),m(n.openLinkDialog())}),f(6,"fa-icon",6),c(),s(7,"button",7),k(8,"translate"),C("click",function(){return d(p),m(n.copyToClipboard())}),f(9,"fa-icon",6),c(),s(10,"button",8),k(11,"translate"),C("click",function(){return d(p),m(n.goTo())}),f(12,"fa-icon",6),c(),s(13,"div",9)(14,"div",10),f(15,"app-input-filter",11),c(),s(16,"app-navigation-view",12),C("sortBy",function(E){return d(p),m(n.sortBy(E))})("switchView",function(E){return d(p),m(n.galleryMode=E)}),c()()(),x(17,Pe,6,8,"div",13)(18,it,12,8),s(19,"div",14)(20,"span",15),u(21),k(22,"translate"),c()(),s(23,"context-menu",null,0),T(25,nt,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.loadShareLinks())}),c(),s(26,"context-menu",null,1),T(28,ot,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.goTo())}),T(29,rt,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.openLinkDialog())}),T(30,at,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.copyToClipboard())}),T(31,lt,0,0,"ng-template",17)(32,st,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.layout.showRSideBarTab(n.TAB_MENU.SELECTION))}),c()}o&2&&(r(),_("tooltip",y(2,21,"Refresh",n.locale.language)),r(2),_("icon",n.icons.faArrowRotateRight)("animation",n.loading?"spin":null),r(),_("disabled",!n.selected)("tooltip",y(5,24,"Edit link",n.locale.language)),r(2),_("icon",n.icons.faPen),r(),M(R("btn btn-sm me-1 ",n.linkWasCopied?"btn-info":"btn-secondary")),_("disabled",!n.selected)("tooltip",y(8,27,"Copy link",n.locale.language)),r(2),_("icon",n.linkWasCopied?n.icons.faClipboardCheck:n.icons.faClipboard),r(),_("disabled",!n.selected)("tooltip",y(11,30,"Go to",n.locale.language)),r(2),_("icon",n.icons.faMapMarkerAlt),r(4),_("sortParams",n.sortTable.sortParam)("sortFields",n.btnSortFields),r(),h(n.galleryMode!=null&&n.galleryMode.enabled?17:18),r(4),B("",n.shares.length," ",y(22,33,"shares",n.locale.language)),r(10),_("divider",!0))},dependencies:[ue,me,de,j,J,Q,Z,X,N,O,we,Se,q,Y,ye],encapsulation:2});let t=a;return t})();export{Dt as LinksComponent};
|
|
1
|
+
import{a as Se}from"./chunk-B2Y2RNFP.js";import{a as Q}from"./chunk-TNW2CGK6.js";import"./chunk-HZA7R43P.js";import{a as N,b as O,c as ye,d as be}from"./chunk-5YKWZT33.js";import{b as we,c as ve,d as Te,e as Le}from"./chunk-WWIC7UW3.js";import"./chunk-YCINY2YI.js";import"./chunk-FQ4AFNGE.js";import"./chunk-DGVNNICG.js";import"./chunk-MOVWEZ7J.js";import{Gb as ge,Ib as ke,Ja as Ce,Xa as fe,kb as xe,pa as de,qa as me,ra as ue,v as X,w as Z,wb as he}from"./chunk-Y2CDUS4J.js";import"./chunk-ZZ3LHYOY.js";import{b as K}from"./chunk-XE5YHU5J.js";import{Cb as C,Eb as l,Ed as Y,Fd as J,Ga as D,Gc as q,Ib as L,If as se,Jb as S,Kb as V,L as U,Ma as r,Mb as F,Nb as P,Ob as M,Oe as oe,Pb as u,Qb as v,Rb as I,Sb as B,Ue as re,Uf as ce,Vf as pe,Wd as ee,Xa as W,Xb as R,Yb as H,Zc as j,Zf as _e,ab as T,ce as te,dc as k,fc as y,ha as w,ib as z,ie,jb as x,kb as h,ma as d,na as m,nb as A,ob as $,of as ae,pb as _,qb as s,rb as c,sb as f,te as ne,tf as le,yd as G,zb as b}from"./chunk-RSNLYAN6.js";import"./chunk-RTRJ3KFH.js";var Me=["MainContextMenu"],Ee=["TargetContextMenu"],Ve=(t,a)=>a.id,Fe=(t,a)=>a.key;function Ae(t,a){if(t&1&&(s(0,"span",30),u(1),c()),t&2){let e=l().$implicit,i=l(2);F("font-size",i.galleryMode.textSize,"px"),r(),I(" ",e.hTimeAccessAgo," ")}}function $e(t,a){if(t&1){let e=b();s(0,"div",21),C("click",function(){let o=d(e).$implicit,n=l(2);return m(n.onSelect(o))})("contextmenu",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("pressup",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("tap",function(){d(e);let o=l(2);return m(o.openLinkDialog())}),s(1,"div",22)(2,"img",23),C("error",function(){let o=d(e).$implicit;return m(o.fallBackMimeUrl())}),c(),s(3,"span",24),x(4,Ae,2,3,"span",25),c(),s(5,"span",26),f(6,"app-share-repository",27),c()(),s(7,"div",28)(8,"span",29),u(9),c()()()}if(t&2){let e=a.$implicit,i=a.$index,o=l(2);F("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),P("selected",e.id===(o.selected==null?null:o.selected.id))("disabled",!e.link.isActive),r(),z("rowIndex",i),r(),_("src",e.mimeUrl,D)("height",o.galleryMode.image)("width",o.galleryMode.image),r(2),h(e.newly?4:-1),r(2),_("share",e)("galleryMode",o.galleryMode),r(2),F("font-size",o.galleryMode.textSize,"px"),r(),v(e.name)}}function Pe(t,a){if(t&1){let e=b();s(0,"div",13)(1,"app-virtual-scroll",18),k(2,"searchFilter"),C("contextmenu",function(o){d(e);let n=l();return m(n.onContextMenu(o))}),s(3,"div",19),A(4,$e,10,18,"div",20,Ve),c()()()}if(t&2){let e=l();r(),_("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",y(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),r(3),$(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Ie(t,a){if(t&1&&f(0,"fa-icon",37),t&2){let e=l(4);_("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Be(t,a){if(t&1){let e=b();s(0,"th",36),C("click",function(){d(e);let o=l().$implicit,n=l(2);return m(n.sortBy(o.key))}),u(1),x(2,Ie,1,2,"fa-icon",37),c()}if(t&2){let e=l().$implicit,i=l(2);M(e.value.class),F("width",e.value.width,"%"),P("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),r(),I(" ",e.value.label," "),r(),h(i.sortTable.sortParam.column===e.key?2:-1)}}function Re(t,a){if(t&1&&x(0,Be,3,10,"th",35),t&2){let e=a.$implicit;h(e.value.show?0:-1)}}function De(t,a){if(t&1){let e=b();s(0,"div",40)(1,"img",43),C("error",function(){d(e);let o=l(3).$implicit;return m(o.fallBackMimeUrl())}),c(),s(2,"div",44)(3,"span",29),u(4),c(),s(5,"span",45),u(6),c()()()}if(t&2){let e=l(3).$implicit;r(),_("src",e.mimeUrl,D),r(3),v(e.name),r(2),v(e.description)}}function Ne(t,a){if(t&1&&(s(0,"span"),u(1),c()),t&2){let e=l(4).$implicit;r(),v(e.link.email||"")}}function Oe(t,a){if(t&1&&(s(0,"span",41)(1,"span"),u(2),c(),x(3,Ne,2,1,"span"),c()),t&2){let e=l(3).$implicit;r(2),v(e.link.name),r(),h(e.link.email?3:-1)}}function Qe(t,a){if(t&1&&f(0,"app-share-repository",42),t&2){let e=l(3).$implicit;_("share",e)}}function Ue(t,a){if(t&1&&(s(0,"span"),u(1),c()),t&2){let e=l(4).$implicit;M(R("badge rounded-pill ",e.link.nbAccess>=e.link.limitAccess?"bg-danger":"bg-success")),r(),B(" ",e.link.nbAccess,"/",e.link.limitAccess," ")}}function We(t,a){if(t&1&&(s(0,"span",47),u(1),c()),t&2){let e=l(4).$implicit;r(),v(e.link.nbAccess)}}function ze(t,a){if(t&1&&(s(0,"span",49),u(1),k(2,"translate"),c()),t&2){let e=l(5).$implicit,i=l(2);r(),B("",e.hTimeExpirationAgo,"\xA0",y(2,2,e.hTimeExpirationAgo===1?"day":"days",i.locale.language))}}function He(t,a){if(t&1&&(s(0,"span"),f(1,"fa-icon",37),x(2,ze,3,5,"span",49),c()),t&2){let e=l(4).$implicit,i=l(2);M(R("badge rounded-pill bg-",e.hTimeExpirationAgo>=1?"warning":"danger"," ms-1")),r(),_("icon",i.icons.faClock)("fixedWidth",!1),r(),h(e.hTimeExpirationAgo>=1?2:-1)}}function qe(t,a){if(t&1&&(s(0,"span",48),f(1,"fa-icon",6),c()),t&2){let e=l(6);r(),_("icon",e.icons.faLock)}}function Ke(t,a){if(t&1&&(x(0,Ue,2,5,"span",46)(1,We,2,1,"span",47),x(2,He,3,6,"span",46),x(3,qe,2,1,"span",48)),t&2){let e=l(3).$implicit;h(e.link.limitAccess?0:1),r(2),h(e.link.expiresAt?2:-1),r(),h(e.link.requireAuth?3:-1)}}function je(t,a){if(t&1&&f(0,"app-file-permissions",50),t&2){let e=l(4).$implicit;_("permissions",e.hPerms)}}function Ge(t,a){if(t&1&&x(0,je,1,1,"app-file-permissions",50),t&2){let e=l(3).$implicit;h(e.link.permissions?0:-1)}}function Ye(t,a){if(t&1&&u(0),t&2){let e=l(4).$implicit;I(" ",e.hTimeAccessAgo," ")}}function Je(t,a){t&1&&(s(0,"span",51),u(1,"never"),c())}function Xe(t,a){if(t&1&&x(0,Ye,1,1)(1,Je,2,0,"span",51),t&2){let e=l(3).$implicit;h(e.link.currentAccess?0:1)}}function Ze(t,a){if(t&1&&(s(0,"td"),x(1,De,7,3,"div",40)(2,Oe,4,2,"span",41)(3,Qe,1,1,"app-share-repository",42)(4,Ke,4,3)(5,Ge,1,1)(6,Xe,2,1),c()),t&2){let e,i=l().$implicit,o=l().$implicit;M(H("",i.value.class," ",i.value.newly!==void 0?"props-newly-"+o[i.value.newly]:"")),F("width",i.value.width,"%"),P("text-align-center",i.value.textCenter),r(),h((e=i.key)==="name"?1:e==="link"?2:e==="from"?3:e==="infos"?4:e==="permissions"?5:e==="accessed"?6:-1)}}function et(t,a){if(t&1&&x(0,Ze,7,9,"td",39),t&2){let e=a.$implicit;h(e.value.show?0:-1)}}function tt(t,a){if(t&1){let e=b();s(0,"tr",38),C("click",function(){let o=d(e).$implicit,n=l(2);return m(n.onSelect(o))})("contextmenu",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("pressup",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("tap",function(){d(e);let o=l(2);return m(o.openLinkDialog())}),A(1,et,1,1,null,null,Fe),k(3,"keyvalue"),c()}if(t&2){let e=a.$implicit,i=l(2);P("selected",e.id===(i.selected==null?null:i.selected.id))("disabled",!e.link.isActive),r(),$(y(3,4,i.tableHeaders,i.originalOrderKeyValue))}}function it(t,a){if(t&1){let e=b();s(0,"table",31)(1,"thead")(2,"tr"),A(3,Re,1,1,null,null,Fe),k(5,"keyvalue"),c()()(),s(6,"app-virtual-scroll",32),k(7,"searchFilter"),C("contextmenu",function(o){d(e);let n=l();return m(n.onContextMenu(o))}),s(8,"table",31)(9,"tbody",33),A(10,tt,4,7,"tr",34,Ve),c()()()}if(t&2){let e=l();r(3),$(y(5,2,e.tableHeaders,e.originalOrderKeyValue)),r(3),_("bufferAmount",5)("items",y(7,5,e.shares,e.inputFilter.search())),r(4),$(e.scrollView==null?null:e.scrollView.viewPortItems)}}function nt(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Refresh"),c()),t&2){let e=l();r(),_("icon",e.icons.faArrowRotateRight)}}function ot(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Go to"),c()),t&2){let e=l();r(),_("icon",e.icons.faMapMarkerAlt)}}function rt(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Edit link"),c()),t&2){let e=l();r(),_("icon",e.icons.faPen)}}function at(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Copy link"),c()),t&2){let e=l();r(),_("icon",e.icons.faClipboard)}}function lt(t,a){}function st(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Informations"),c()),t&2){let e=l();r(),_("icon",e.icons.faCircleInfo)}}var Dt=(()=>{let a=class a{constructor(){this.locale=w(G),this.layout=w(he),this.icons={faLink:oe,faArrowRotateRight:se,faArrowDown:ce,faArrowUp:re,faMapMarkerAlt:pe,faPen:ae,faEllipsisH:ee,faClock:ie,faLock:le,faClipboard:ne,faClipboardCheck:te,faCircleInfo:_e},this.originalOrderKeyValue=fe,this.TAB_MENU=Ce,this.loading=!1,this.linkWasCopied=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},link:{label:"Link",width:15,textCenter:!1,class:"d-none d-sm-table-cell",show:!0,sortable:!0},from:{label:"Shared from",width:15,textCenter:!1,class:"d-none d-md-table-cell",show:!0},infos:{label:"Infos",width:15,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},permissions:{label:"Permissions",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},accessed:{label:"Accessed",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",link:"Link",accessed:"Accessed"},this.activatedRoute=w(K),this.store=w(xe),this.linksService=w(Le),this.sharesService=w(ve),this.sortSettings={default:[{prop:"name",type:"string"}],link:[{prop:"link.name",type:"string"}],name:[{prop:"name",type:"string"}],infos:[{prop:"link.nbAccess",type:"number"}],permissions:[{prop:"link.permissions",type:"length"}],accessed:[{prop:"link.currentAccess",type:"date"}]},this.sortTable=new be(this.constructor.name,this.sortSettings),this.loadShareLinks(),this.activatedRoute.queryParams.subscribe(i=>this.focusOnSelect=i.select),this.layout.setBreadcrumbIcon(this.icons.faLink),this.layout.setBreadcrumbNav({url:`/${ke.LINKS}/${ge.SHARED_BY_LINKS}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShareLinks(){this.loading=!0,this.onSelect(),this.linksService.shareLinksList().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:i=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Links",i.error.message)}})}sortBy(i,o=!0,n){this.shares=this.sortTable.sortBy(i,o,n||this.shares)}onSelect(i=null){this.selected=i,this.store.linkSelection.set(this.selected)}openLinkDialog(){this.linksService.shareLink(this.selected.id).subscribe(i=>{this.layout.openDialog(Te,"md",{initialState:{share:i}}).content.shareChange.pipe(U(1)).subscribe(n=>{let[p,g]=n;p==="update"?this.selected=Object.assign(this.selected,g):p==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(E=>E.id!==g.id)))})})}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,o){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(i,this.targetContextMenu)}copyToClipboard(){this.selected&&(this.linksService.copyLinkToClipboard(this.selected.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.selected.file.name||this.selected.name),setTimeout(()=>this.linkWasCopied=!1,3e3))}goTo(i){i=i||this.selected,this.sharesService.goTo(i).catch(console.error)}focusOn(i){let o=this.shares.find(n=>n.name===i);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};a.\u0275fac=function(o){return new(o||a)},a.\u0275cmp=W({type:a,selectors:[["app-shared-links"]],viewQuery:function(o,n){if(o&1&&(L(O,5),L(N,7),L(Q,7),L(Me,7),L(Ee,7)),o&2){let p;S(p=V())&&(n.scrollView=p.first),S(p=V())&&(n.inputFilter=p.first),S(p=V())&&(n.btnNavigationView=p.first),S(p=V())&&(n.mainContextMenu=p.first),S(p=V())&&(n.targetContextMenu=p.first)}},decls:33,vars:36,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],["container","body","type","button",3,"click","disabled","tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-secondary",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","disabled","height","width"],[1,"card",3,"click","contextmenu","pressup","tap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events"],[1,"badge","rounded-pill","bg-warning"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected","disabled"],["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"],[1,"d-flex","flex-column"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"badge","rounded-pill","bg-gray-dark","ms-1"],[1,"ms-2"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,n){if(o&1){let p=b();s(0,"div",2)(1,"button",3),k(2,"translate"),C("click",function(){return d(p),m(n.loadShareLinks())}),f(3,"fa-icon",4),c(),s(4,"button",5),k(5,"translate"),C("click",function(){return d(p),m(n.openLinkDialog())}),f(6,"fa-icon",6),c(),s(7,"button",7),k(8,"translate"),C("click",function(){return d(p),m(n.copyToClipboard())}),f(9,"fa-icon",6),c(),s(10,"button",8),k(11,"translate"),C("click",function(){return d(p),m(n.goTo())}),f(12,"fa-icon",6),c(),s(13,"div",9)(14,"div",10),f(15,"app-input-filter",11),c(),s(16,"app-navigation-view",12),C("sortBy",function(E){return d(p),m(n.sortBy(E))})("switchView",function(E){return d(p),m(n.galleryMode=E)}),c()()(),x(17,Pe,6,8,"div",13)(18,it,12,8),s(19,"div",14)(20,"span",15),u(21),k(22,"translate"),c()(),s(23,"context-menu",null,0),T(25,nt,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.loadShareLinks())}),c(),s(26,"context-menu",null,1),T(28,ot,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.goTo())}),T(29,rt,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.openLinkDialog())}),T(30,at,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.copyToClipboard())}),T(31,lt,0,0,"ng-template",17)(32,st,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.layout.showRSideBarTab(n.TAB_MENU.SELECTION))}),c()}o&2&&(r(),_("tooltip",y(2,21,"Refresh",n.locale.language)),r(2),_("icon",n.icons.faArrowRotateRight)("animation",n.loading?"spin":null),r(),_("disabled",!n.selected)("tooltip",y(5,24,"Edit link",n.locale.language)),r(2),_("icon",n.icons.faPen),r(),M(R("btn btn-sm me-1 ",n.linkWasCopied?"btn-info":"btn-secondary")),_("disabled",!n.selected)("tooltip",y(8,27,"Copy link",n.locale.language)),r(2),_("icon",n.linkWasCopied?n.icons.faClipboardCheck:n.icons.faClipboard),r(),_("disabled",!n.selected)("tooltip",y(11,30,"Go to",n.locale.language)),r(2),_("icon",n.icons.faMapMarkerAlt),r(4),_("sortParams",n.sortTable.sortParam)("sortFields",n.btnSortFields),r(),h(n.galleryMode!=null&&n.galleryMode.enabled?17:18),r(4),B("",n.shares.length," ",y(22,33,"shares",n.locale.language)),r(10),_("divider",!0))},dependencies:[ue,me,de,j,J,Q,Z,X,N,O,we,Se,q,Y,ye],encapsulation:2});let t=a;return t})();export{Dt as LinksComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P,b as R,c as X,d as $}from"./chunk-
|
|
1
|
+
import{a as P,b as R,c as X,d as $}from"./chunk-HZA7R43P.js";import{Xa as K,wb as O}from"./chunk-Y2CDUS4J.js";import{Cb as h,Eb as l,Fd as B,Gc as k,Le as F,Ma as r,Pb as m,Rb as y,Re as E,Ue as L,Uf as I,Xa as M,Ye as d,Yf as N,Zc as z,ab as T,bb as g,dc as S,fc as V,ha as C,jb as b,kb as D,ma as w,na as f,nb as _,ob as v,pb as p,qb as a,rb as s,sb as u,zb as x}from"./chunk-RSNLYAN6.js";var A=(t,i)=>i.key;function U(t,i){if(t&1){let e=x();a(0,"li",6)(1,"a",8),h("click",function(){let o=w(e).$implicit,c=l(2);return f(c.setView(o.key))}),a(2,"span"),u(3,"fa-icon",2),m(4),s()()()}if(t&2){let e=i.$implicit;r(3),p("icon",e.value.icon),r(),y(" ",e.value.text)}}function j(t,i){if(t&1&&u(0,"fa-icon",10),t&2){let e=l(3);p("icon",e.sortParams.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function q(t,i){if(t&1){let e=x();a(0,"li",6)(1,"a",8),h("click",function(){let o=w(e).$implicit,c=l(2);return f(c.sortBy.emit(o.key))}),a(2,"span",9),m(3),b(4,j,1,1,"fa-icon",10),s()()()}if(t&2){let e=i.$implicit,n=l(2);r(3),y(" ",e.value," "),r(),D(n.sortParams.column===e.key?4:-1)}}function G(t,i){if(t&1&&(a(0,"ul",4)(1,"li",5),m(2,"Display"),s(),_(3,U,5,2,"li",6,A),S(5,"keyvalue"),a(6,"li",7),m(7,"Sort by"),s(),_(8,q,5,2,"li",6,A),S(10,"keyvalue"),s()),t&2){let e=l();r(3),v(V(5,0,e.viewsMode,e.originalOrderKeyValue)),r(5),v(V(10,3,e.sortFields,e.originalOrderKeyValue))}}var le=(()=>{let i=class i{constructor(){this.switchView=new g,this.sortBy=new g,this.originalOrderKeyValue=K,this.icons={faCog:E,faArrowDown:I,faArrowUp:L},this.viewsMode={tl:{enabled:!1,text:"List",icon:F},th:{enabled:!0,text:"S",icon:d,dimensions:96,image:56,imageRes:128,faSize:30,textSize:10,margins:18},thM:{enabled:!0,text:"M",icon:d,dimensions:112,image:72,imageRes:192,faSize:34,textSize:11,margins:18},thL:{enabled:!0,text:"L",icon:d,dimensions:152,image:112,imageRes:256,faSize:50,textSize:12,margins:18},thXl:{enabled:!0,text:"XL",icon:d,dimensions:192,image:152,imageRes:512,faSize:65,textSize:13,margins:18},thXxl:{enabled:!0,text:"XXL",icon:N,dimensions:232,image:192,imageRes:1024,faSize:80,textSize:13,margins:18}},this.layout=C(O),this.viewsMode.tl.text=this.layout.translateString(this.viewsMode.tl.text)}get viewMode(){return localStorage.getItem("viewMode")||"tl"}set viewMode(n){localStorage.setItem("viewMode",n)}currentView(){return this.viewsMode[this.viewMode]}setView(n){this.viewMode=n,this.switchView.emit(this.viewsMode[n])}};i.\u0275fac=function(o){return new(o||i)},i.\u0275cmp=M({type:i,selectors:[["app-navigation-view"]],inputs:{sortParams:"sortParams",sortFields:"sortFields"},outputs:{switchView:"switchView",sortBy:"sortBy"},decls:4,vars:1,consts:[["dropdown","",1,"btn-group","btn-group-sm"],["dropdownToggle","","type","button",1,"btn","btn-sm","btn-secondary","dropdown-toggle"],[3,"icon"],["class","dropdown-menu dropdown-menu-right","role","menu",4,"dropdownMenu"],["role","menu",1,"dropdown-menu","dropdown-menu-right"],["l10nTranslate","",1,"dropdown-header","fw-bold"],["role","menuitem"],["l10nTranslate","",1,"dropdown-header","fw-bold","mt-1"],[1,"dropdown-item",3,"click"],["l10nTranslate","",1,"me-2"],["size","xs",1,"ms-1",3,"icon"]],template:function(o,c){o&1&&(a(0,"div",0)(1,"button",1),u(2,"fa-icon",2),s(),T(3,G,11,6,"ul",3),s()),o&2&&(r(2),p("icon",c.icons.faCog))},dependencies:[$,R,X,P,z,B,k],encapsulation:2,changeDetection:0});let t=i;return t})();export{le as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as b}from"./chunk-ZZ3LHYOY.js";import{b as u,e as h}from"./chunk-
|
|
1
|
+
import{k as b}from"./chunk-ZZ3LHYOY.js";import{b as u,e as h}from"./chunk-XE5YHU5J.js";import{Fd as x,Ga as d,Ma as o,Ne as R,Pb as s,Qb as v,Xa as f,Zc as g,eg as E,ha as p,pb as c,qb as t,rb as i,sb as r}from"./chunk-RSNLYAN6.js";import"./chunk-RTRJ3KFH.js";var A=(()=>{let e=class e{constructor(){this.logoUrl=b,this.icons={faExclamationCircle:R},this.activatedRoute=p(u),this.activatedRoute.params.subscribe(l=>this.error=E[l.error])}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=f({type:e,selectors:[["app-public-link-error"]],decls:14,vars:3,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],["size","4x",1,"text-white",3,"icon"],["l10nTranslate","",1,"error-code","mt-2",2,"font-size","24px"],[1,"error-text"],[1,"hr"],["l10nTranslate",""]],template:function(n,m){n&1&&(t(0,"div",0)(1,"div",1)(2,"a",2),r(3,"img",3),i()(),r(4,"fa-icon",4),t(5,"div",5),s(6,"Link error"),i(),t(7,"div",6),r(8,"span",7)(9,"br"),t(10,"span",8),s(11),i(),r(12,"br")(13,"br"),i()()),n&2&&(o(3),c("src",m.logoUrl,d),o(),c("icon",m.icons.faExclamationCircle),o(7),v(m.error))},dependencies:[h,x,g],encapsulation:2});let a=e;return a})();export{A as PublicLinkErrorComponent};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{f as _e,g as Ce}from"./chunk-VHYIXL7R.js";import{f as ge}from"./chunk-MOVWEZ7J.js";import{Lb as fe,Qb as z,ua as me,wb as he}from"./chunk-Y2CDUS4J.js";import{$b as Z,Cb as h,Dc as Y,Eb as c,Fa as E,Fd as ae,J as L,Jd as le,Lb as D,Ma as r,N as R,Nb as y,Ob as J,Pb as m,Qb as k,Re as pe,Tb as F,Ub as V,Vb as G,Xa as M,Xb as K,Xc as ee,Za as U,Zb as X,Zc as P,_c as te,ab as w,ac as $,ad as ie,ba as I,bb as x,bf as de,dc as A,ed as ne,fc as H,ha as O,hc as j,jb as f,jd as oe,kb as g,lb as q,ma as C,na as v,nb as B,ob as Q,of as ue,pb as d,pe as ce,qb as l,rb as a,sb as _,wd as se,xd as re,ya as W,yb as T,zb as b}from"./chunk-RSNLYAN6.js";var be=(function(i){return i[i.USER=0]="USER",i[i.PERSONAL=1]="PERSONAL",i})(be||{}),ye=(function(i){return i[i.VISIBLE=0]="VISIBLE",i[i.PRIVATE=1]="PRIVATE",i[i.ISOLATED=2]="ISOLATED",i})(ye||{});function ke(i,n){if(i&1&&(l(0,"span"),m(1),a()),i&2){let s=c();r(),k(s.group.name)}}function Se(i,n){i&1&&(l(0,"span",3),m(1,"New personal group"),a())}function Me(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let s=c();d("icon",s.icons.faSpinner)}}function we(i,n){i&1&&(l(0,"span",3),m(1,"Edit personal group"),a())}function Pe(i,n){i&1&&(l(0,"span",3),m(1,"Edit group"),a())}function Ee(i,n){if(i&1&&(l(0,"h4",5),f(1,we,2,0,"span",3)(2,Pe,2,0,"span",3),a()),i&2){let s=c();r(),g(s.isPersonalGroup?1:2)}}var st=(()=>{let n=class n{constructor(){this.groupChange=new x,this.layout=O(he),this.icons={GROUPS:me.GROUPS,faSpinner:de,faCog:pe,faUsers:ce,faPen:ue},this.isPersonalGroup=!0,this.submitted=!1,this.loading=!1,this.userService=O(ge),this.user=this.userService.user}ngOnInit(){this.originalGroup?.id?(this.isPersonalGroup=this.originalGroup.isPersonalGroup,this.group=new z({id:this.originalGroup.id,name:this.originalGroup.name,description:this.originalGroup.description,createdAt:this.originalGroup.createdAt,modifiedAt:this.originalGroup.modifiedAt,type:this.originalGroup.type})):this.group=new z({id:0,name:"",description:"",createdAt:null,modifiedAt:null,type:fe.PGROUP})}onCancel(){this.layout.closeDialog()}onSubmit(){if(this.loading=!0,this.submitted=!0,this.group.id===0)this.userService.createPersonalGroup(this.makeDto(!0)).subscribe({next:e=>{this.loading=!1,this.groupChange.emit(["add",e]),this.layout.sendNotification("success","Group created",e.name),this.layout.closeDialog()},error:e=>this.onError(e)});else{let e=this.makeDto();if(!Object.keys(e).length){this.loading=!1,this.submitted=!1;return}this.userService.updatePersonalGroup(this.originalGroup.id,this.makeDto()).subscribe({next:t=>{this.loading=!1,this.groupChange.emit(["update",t]),this.layout.sendNotification("success","Group updated",t.name),this.layout.closeDialog()},error:t=>this.onError(t)})}}makeDto(e=!1){return{name:e?this.group.name:this.group.name!==this.originalGroup.name?this.group.name:void 0,description:e?this.group.description:this.group.description!==this.originalGroup.description?this.group.description:void 0}}onError(e){this.layout.sendNotification("error","Group error",this.group.name,e),this.submitted=!1,this.loading=!1}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=M({type:n,selectors:[["app-user-group-dialog"]],inputs:{originalGroup:"originalGroup"},outputs:{groupChange:"groupChange"},decls:23,vars:15,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"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","name","l10nTranslate",""],["id","name","appAutofocus","","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","disabled","autoSelect","ngModel"],[1,"flex-fill","col-6","ps-4"],["for","description","l10nTranslate",""],["id","description","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"ngModelChange","ngModel","disabled"],[1,"modal-footer"],["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&&(l(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),f(3,ke,2,1,"span")(4,Se,2,0,"span",3),f(5,Me,1,1,"fa-icon",4),a(),f(6,Ee,3,1,"h4",5),l(7,"button",6),h("click",function(){return o.layout.closeDialog()}),a()(),l(8,"div",7)(9,"div",8)(10,"div",9)(11,"label",10),m(12,"Name"),a(),l(13,"input",11),G("ngModelChange",function(u){return V(o.group.name,u)||(o.group.name=u),u}),a()(),l(14,"div",12)(15,"label",13),m(16,"Description"),a(),l(17,"input",14),G("ngModelChange",function(u){return V(o.group.description,u)||(o.group.description=u),u}),a()()()(),l(18,"div",15)(19,"button",16),h("click",function(){return o.onCancel()}),m(20,"Cancel"),a(),l(21,"button",17),h("click",function(){return o.onSubmit()}),m(22," Confirm "),a()()),t&2&&(r(2),d("icon",o.icons.GROUPS),r(),g(o.group.id?3:4),r(2),g(o.loading?5:-1),r(),g(o.group.id?6:-1),r(),J(K("btn-close btn-close-white ",o.group.id?"ms-2":"ms-auto"," ms-2")),r(6),y("is-invalid",!o.group.name),d("disabled",!o.isPersonalGroup)("autoSelect",!1),F("ngModel",o.group.name),r(4),F("ngModel",o.group.description),d("disabled",!o.isPersonalGroup),r(4),d("disabled",!o.group.name||o.submitted))},dependencies:[re,ie,ne,se,oe,P,ae,_e],encapsulation:2});let i=n;return i})();var xe=(()=>{let n=class n{onClick(e){e.stopPropagation()}ngOnInit(){setTimeout(()=>{typeof document<"u"&&document.addEventListener("click",this.offClickHandler)},0)}ngOnDestroy(){typeof document<"u"&&document.removeEventListener("click",this.offClickHandler)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=U({type:n,selectors:[["","offClick",""]],hostBindings:function(t,o){t&1&&h("click",function(u){return o.onClick(u)})},inputs:{offClickHandler:[0,"offClick","offClickHandler"]}});let i=n;return i})();var S=class{constructor(n){typeof n=="string"&&(this.id=this.name=n,this.description=""),typeof n=="object"&&(this.id=n.id||n.name,this.name=n.name,this.description=n.description||"")}};var Te=i=>({active:i}),De=(i,n)=>({o:i,i:n});function Fe(i,n){if(i&1){let s=b();l(0,"input",6),h("keydown",function(t){C(s);let o=c();return v(o.inputEvent(t))})("keyup",function(t){C(s);let o=c();return v(o.inputEvent(t,!0))}),a()}if(i&2){let s=c();d("disabled",s.disabled)}}function Ve(i,n){i&1&&T(0)}function Ge(i,n){if(i&1&&(l(0,"span",12),w(1,Ve,1,0,"ng-container",13),a()),i&2){let s=c(2),e=D(6);y("ui-select-allow-clear",s.allowClear&&s.active),r(),d("ngTemplateOutlet",s.customTemplateSelect||e)("ngTemplateOutletContext",Z(4,Te,s.active))}}function Ae(i,n){if(i&1&&(l(0,"span",9),m(1),a()),i&2){let s=c(2);r(),k(s.placeholder)}}function He(i,n){if(i&1){let s=b();l(0,"button",14),h("click",function(t){C(s);let o=c(2);return v(o.removeClick(o.active,t))}),a()}}function je(i,n){if(i&1){let s=b();l(0,"div",4)(1,"span",7),h("click",function(t){C(s);let o=c();return v(o.matchClick(t))}),f(2,Ge,2,6,"span",8)(3,Ae,2,1,"span",9),f(4,He,1,0,"button",10),_(5,"i",11),a()()}if(i&2){let s=c();r(2),g(s.active?2:3),r(2),g(s.allowClear&&s.active?4:-1)}}function ze(i,n){i&1&&T(0)}function Ne(i,n){if(i&1){let s=b();l(0,"li",15)(1,"div",16),h("click",function(t){let o=C(s).$implicit,p=c(2);return v(p.selectMatch(o,t))})("mouseenter",function(){let t=C(s).$implicit,o=c(2);return v(o.selectActive(t))}),w(2,ze,1,0,"ng-container",13),a()()}if(i&2){let s=n.$implicit,e=c(2),t=D(8);r(),y("active",e.isActive(s)),r(),d("ngTemplateOutlet",e.customTemplateOptions||t)("ngTemplateOutletContext",$(4,De,s,e.inputValue))}}function Le(i,n){if(i&1&&(l(0,"ul",5),B(1,Ne,3,7,"li",15,q),a()),i&2){let s=c();r(),Q(s.options)}}function Re(i,n){if(i&1&&(l(0,"div",17)(1,"span",18),_(2,"fa-icon",19),a(),l(3,"span"),m(4),a(),l(5,"div",20),m(6),a()()),i&2){let s=n.active,e=c();r(2),d("icon",e.itemIcon)("fixedWidth",!1),r(2),k(s.name),r(2),k(s.description)}}function Ie(i,n){if(i&1&&(l(0,"a",21)(1,"div",17)(2,"span",18),_(3,"fa-icon",19),a(),_(4,"span",22),A(5,"highlight"),_(6,"span",23),A(7,"highlight"),a()()),i&2){let s=n.i,e=n.o,t=c();r(3),d("icon",t.itemIcon)("fixedWidth",!1),r(),d("innerHtml",t.sanitize(H(5,4,e.name,s)),E),r(2),d("innerHtml",t.sanitize(H(7,7,e.description,s)),E)}}var bt=(()=>{let n=class n{constructor(){this.element=O(W),this.itemIcon=le,this.allowClear=!0,this.placeholder="",this.idField="id",this.nameField="name",this.descriptionField="description",this.data=new x,this.selected=new x,this.removed=new x,this.typed=new x,this.opened=new x,this.options=[],this.itemObjects=[],this.inputMode=!1,this.inputValue="",this.onChange=Function.prototype,this.onTouched=Function.prototype,this.sanitizer=O(ee),this._items=[],this._optionsOpened=!1,this._disabled=!1,this._active=null,this.clickedOutside=this.clickedOutside.bind(this)}set items(e){if(!e.length){this._items=this.itemObjects=[],this.itemObjects=[];return}this._items=e.filter(t=>{if(typeof t=="string"||typeof t=="object"&&t&&t[this.nameField]&&t[this.idField])return t}),this.itemObjects=this._items.map(t=>typeof t=="string"?new S(t):new S({id:t[this.idField],name:t[this.nameField],description:t[this.descriptionField]}))}get optionsOpened(){return this._optionsOpened}set optionsOpened(e){this._optionsOpened=e,this.opened.emit(e)}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._disabled===!0&&this.hideOptions()}get active(){return this._active}set active(e){e?this._active=typeof e=="string"?e:new S({id:e[this.idField],name:e[this.nameField],description:e[this.descriptionField]}):this._active=null}sanitize(e){return this.sanitizer.bypassSecurityTrustHtml(e)}inputEvent(e,t=!1){if(e.keyCode===9)return;if(t&&(e.keyCode===37||e.keyCode===39||e.keyCode===38||e.keyCode===40||e.keyCode===13)){e.preventDefault();return}if(!t&&e.keyCode===8){let p=this.element.nativeElement.querySelector("div.ui-select-container > input");(!p.value||p.value.length<=0)&&(this.active&&this.remove(this.active),e.preventDefault())}if(!t&&e.keyCode===27){this.hideOptions(),e.preventDefault();return}if(!t&&e.keyCode===46&&(this.active&&this.remove(this.active),e.preventDefault()),!t&&e.keyCode===37&&this._items.length>0){this.behavior.first(),e.preventDefault();return}if(!t&&e.keyCode===39&&this._items.length>0){this.behavior.last(),e.preventDefault();return}if(!t&&e.keyCode===38){this.behavior.prev(),e.preventDefault();return}if(!t&&e.keyCode===40){this.behavior.next(),e.preventDefault();return}if(!t&&e.keyCode===13){(!this.active||this.active.id!==this.activeOption.id)&&(this.selectActiveMatch(),this.behavior.next()),e.preventDefault();return}let o=e.target||e.srcElement;o?(this.inputValue=o.value,this.doEvent("typed",this.inputValue||" ")):this.open()}ngOnInit(){this.subscription=this.typed.asObservable().pipe(L(200),R()).subscribe(e=>this.doSearch(e)),this.behavior=new N(this),this.doEvent("typed"," ")}ngOnDestroy(){this.subscription.unsubscribe()}remove(e){this._disabled!==!0&&(this.active=null,this.data.next(this.active),this.doEvent("removed",e),this.inputValue="",this.doEvent("typed"," "))}doEvent(e,t){this[e]&&t&&this[e].next(t),this.onTouched(),(e==="selected"||e==="removed")&&this.onChange(this.active)}clickedOutside(){this.inputMode=!1,this.optionsOpened=!1}writeValue(e){this.active=e,this.data.emit(this.active)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}matchClick(e){this._disabled!==!0&&(this.inputMode=!this.inputMode,this.inputMode===!0&&(this.focusToInput(),this.open()))}mainClick(e){if(this.inputMode===!0||this._disabled===!0)return;if(e.keyCode===46){e.preventDefault(),this.inputEvent(e);return}if(e.keyCode===8){e.preventDefault(),this.inputEvent(e,!0);return}if(e.keyCode===9||e.keyCode===13||e.keyCode===27||e.keyCode>=37&&e.keyCode<=40){e.preventDefault();return}this.inputMode=!0;let t=String.fromCharCode(96<=e.keyCode&&e.keyCode<=105?e.keyCode-48:e.keyCode).toLowerCase();this.focusToInput(t),this.open();let o=e.target||e.srcElement;o.value=t,this.inputEvent(e)}selectActive(e){this.activeOption=e}isActive(e){return this.activeOption.id===e.id}removeClick(e,t){t.stopPropagation(),this.remove(e)}focusToInput(e=""){setTimeout(()=>{let t=this.element.nativeElement.querySelector("div.ui-select-container > input");t&&(t.focus(),t.value=e)},0)}selectMatch(e,t=void 0){t&&(t.stopPropagation(),t.preventDefault()),!(this.options.length<=0)&&(this.active=e,this.data.next(this.active),this.doEvent("selected",e),this.hideOptions(),this.focusToInput(e.name),this.element.nativeElement.querySelector(".ui-select-container").focus())}doSearch(e){this.searchFunction(e).subscribe({next:t=>{this.items=t},error:t=>{console.error(t),this.items=[]},complete:()=>this.behavior.filter()})}open(){this.options=this.itemObjects,this.options.length>0&&this.behavior.first(),this.optionsOpened=!0}hideOptions(){this.inputMode=!1,this.optionsOpened=!1}selectActiveMatch(){this.selectMatch(this.activeOption)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=M({type:n,selectors:[["app-select"]],inputs:{searchFunction:"searchFunction",customTemplateOptions:"customTemplateOptions",customTemplateSelect:"customTemplateSelect",itemIcon:"itemIcon",allowClear:"allowClear",placeholder:"placeholder",idField:"idField",nameField:"nameField",descriptionField:"descriptionField",disabled:"disabled",active:"active"},outputs:{data:"data",selected:"selected",removed:"removed",typed:"typed",opened:"opened"},features:[X([{provide:te,useExisting:I(()=>n),multi:!0}])],decls:9,vars:5,consts:[["DefaultSelect",""],["DefaultOptions",""],[1,"ui-select-container","dropdown","open",3,"keyup","offClick"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"disabled"],[1,"ui-select-match","form-control","form-control-sm"],["role","menu",1,"ui-select-choices","dropdown-menu"],["autocomplete","false","tabindex","-1","type","text",1,"form-control","form-control-sm","ui-select-search",3,"keydown","keyup","disabled"],["tabindex","-1",1,"ui-select-toggle","no-select",2,"outline","0",3,"click"],[1,"ui-select-match-text","w-100",3,"ui-select-allow-clear"],[1,"ui-select-placeholder"],["aria-label","close","type","button",1,"btn-close"],[1,"dropdown-toggle"],[1,"ui-select-match-text","w-100"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["aria-label","close","type","button",1,"btn-close",3,"click"],["role","menuitem"],[1,"ui-select-choices-row",3,"click","mouseenter"],[1,"d-flex","align-items-center"],[1,"ui-icon","circle-primary-icon","me-2"],[3,"icon","fixedWidth"],[1,"d-flex","ms-auto","me-4","fs-xxxs","text-muted"],["href","javascript:void(0)",1,"dropdown-item","cursor-pointer",2,"padding","3px 5px"],[3,"innerHtml"],[1,"d-flex","ms-auto","fs-xxxs","text-muted",3,"innerHtml"]],template:function(t,o){if(t&1){let p=b();l(0,"div",2),h("keyup",function(Oe){return C(p),v(o.mainClick(Oe))}),_(1,"div"),f(2,Fe,1,1,"input",3)(3,je,6,2,"div",4),f(4,Le,3,0,"ul",5),a(),w(5,Re,7,4,"ng-template",null,0,j)(7,Ie,8,10,"ng-template",null,1,j)}t&2&&(d("offClick",o.clickedOutside),r(),y("ui-disabled",o.disabled),r(),g(o.inputMode?2:3),r(2),g(o.optionsOpened&&o.options&&o.options.length>0?4:-1))},dependencies:[xe,P,Y,Ce],styles:[`.ui-select-container[_ngcontent-%COMP%]{background-color:transparent;border-radius:4px}.ui-select-container.open[_ngcontent-%COMP%] > .dropdown-menu[_ngcontent-%COMP%]{display:block}.ui-select-container.open[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{outline:none}.ui-select-container[_ngcontent-%COMP%] .ui-icon[_ngcontent-%COMP%]{min-width:26px;min-height:26px;font-size:.85rem}.ui-select-container[_ngcontent-%COMP%] .ui-disabled[_ngcontent-%COMP%]{background-color:#d4dbe8;border-radius:4px;position:absolute;width:100%;height:100%;z-index:5;opacity:.6;top:0;left:0;cursor:not-allowed}.ui-select-container[_ngcontent-%COMP%] .ui-select-search[_ngcontent-%COMP%]{line-height:26px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%]{padding-left:.3rem}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{text-align:start!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .caret[_ngcontent-%COMP%]{position:absolute;top:45%;right:15px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{font-size:1.6em;line-height:.75}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%]{display:flex;align-items:center}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-toggle[_ngcontent-%COMP%] > .caret[_ngcontent-%COMP%]{position:absolute;height:10px;top:50%;right:10px;margin-top:-2px}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .ui-select-placeholder[_ngcontent-%COMP%]{float:left;line-height:26px;color:#8c8c8c;width:100%}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]{cursor:pointer}.ui-select-container[_ngcontent-%COMP%] .ui-select-match[_ngcontent-%COMP%] .dropdown-toggle[_ngcontent-%COMP%]:after{display:inline-block!important}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%]{width:100%;height:auto;max-height:200px;overflow-x:hidden;margin-top:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{display:block;padding:3px 5px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .active[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{text-decoration:none;outline:0}.ui-select-container[_ngcontent-%COMP%] .ui-select-choices[_ngcontent-%COMP%] .ui-select-choices-row[_ngcontent-%COMP%] .dropdown-item[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{pointer-events:none}
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
`]});let i=n;return i})(),N=class{constructor(n){this.actor=n}first(){this.actor.activeOption=this.actor.options[0],this.ensureHighlightVisible()}last(){this.actor.activeOption=this.actor.options[this.actor.options.length-1],this.ensureHighlightVisible()}prev(){let n=this.actor.options.indexOf(this.actor.activeOption);this.actor.activeOption=this.actor.options[n-1<0?this.actor.options.length-1:n-1],this.ensureHighlightVisible()}next(){let n=this.actor.options.indexOf(this.actor.activeOption);this.actor.activeOption=this.actor.options[n+1>this.actor.options.length-1?0:n+1],this.ensureHighlightVisible()}ensureHighlightVisible(n=void 0){let s=this.actor.element.nativeElement.querySelector(".ui-select-choices-content");if(!s)return;let e=s.querySelectorAll(".ui-select-choices-row");if(e.length<1)return;let t=this.getActiveIndex(n);if(t<0)return;let o=e[t];if(!o)return;let p=o.offsetTop+o.clientHeight-s.scrollTop,u=s.offsetHeight;p>u?s.scrollTop+=p-u:p<o.clientHeight&&(s.scrollTop-=o.clientHeight-p)}filter(){this.actor.options=[...this.actor.itemObjects],this.actor.options.length>0&&(this.actor.activeOption=this.actor.options[0],this.ensureHighlightVisible())}getActiveIndex(n=void 0){let s=this.actor.options.indexOf(this.actor.activeOption);return s<0&&n!==void 0&&(s=n.get(this.actor.activeOption.id)),s}};export{be as a,ye as b,st as c,bt as d};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{g as lt,h as ct}from"./chunk-MOVWEZ7J.js";import{B as x,Hb as st,Jb as at,Lb as rt,Pb as ot,Xa as nt,e as Te,g as Z,j as qe,k as he,m as Y,n as Oe,o as de,t as pe,ua as it,v as Je,w as Xe}from"./chunk-Y2CDUS4J.js";import{$ as ee,$b as Ue,Ac as le,Cb as C,Dc as He,E as Me,Eb as l,Ed as Ze,Fa as j,Fb as Pe,Fd as Ye,Ga as fe,Gb as Le,Gc as Ne,H as Ae,Hc as ce,Ib as $,J as ue,Jb as W,Kb as K,Lb as H,Ma as h,Mb as De,Na as Fe,Nb as F,Ob as re,Pb as b,Qa as U,Qb as T,Ra as u,Sa as ne,Tb as ge,Ub as ve,Vb as Ce,Xa as V,Xb as Re,Ya as se,Z as ke,Za as k,Zb as be,Zc as ze,_a as B,a as Ee,ab as O,ad as je,bb as v,c as we,ca as te,cb as ae,cc as xe,da as ie,dc as I,dd as $e,ec as Ve,ed as We,fc as P,ha as M,hc as G,ib as L,jb as S,jd as Ke,k as me,kb as E,kf as et,ma as y,na as _,nb as ye,o as Ie,ob as _e,of as tt,pb as d,qb as p,qc as Q,r as J,rb as m,sb as g,wd as Ge,x as X,xc as Be,ya as A,yd as Qe,zb as w,zc as oe}from"./chunk-RSNLYAN6.js";var li=(()=>{let n=class n{transform(e,t="L HH:mm:ss"){return e?(0,x.default)(e).format(t):""}};n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=B({name:"amDateFormat",type:n,pure:!0});let s=n;return s})();var _t=["*"],gt=s=>["nav-item",s];function vt(s,n){if(s&1){let a=w();p(0,"span",7),C("click",function(t){y(a);let i=l().$implicit,r=l();return t.preventDefault(),_(r.removeTab(i))}),b(1," \u274C"),m()}}function Ct(s,n){if(s&1){let a=w();p(0,"li",3),C("keydown",function(t){let i=y(a).index,r=l();return _(r.keyNavActions(t,i))}),p(1,"a",4),C("click",function(){let t=y(a).$implicit;return _(t.active=!0)}),p(2,"span",5),b(3),m(),O(4,vt,2,0,"span",6),m()()}if(s&2){let a=n.$implicit;F("active",a.active)("disabled",a.disabled),d("ngClass",Ue(15,gt,a.customClass||"")),h(),F("active",a.active)("disabled",a.disabled),L("aria-controls",a.id?a.id:"")("aria-selected",!!a.active)("id",a.id?a.id+"-link":""),h(),d("ngTransclude",a.headingRef),h(),T(a.heading),h(),d("ngIf",a.removable)}}var bt=(()=>{let n=class n{set ngTransclude(e){this._ngTransclude=e,e&&this.viewRef.createEmbeddedView(e)}get ngTransclude(){return this._ngTransclude}constructor(e){this.viewRef=e}};n.\u0275fac=function(t){return new(t||n)(u(ne))},n.\u0275dir=k({type:n,selectors:[["","ngTransclude",""]],inputs:{ngTransclude:"ngTransclude"}});let s=n;return s})(),xt=(()=>{let n=class n{constructor(){this.type="tabs",this.isKeysAllowed=!0,this.ariaLabel="Tabs"}};n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"});let s=n;return s})(),Tt=(()=>{let n=class n{get vertical(){return this._vertical}set vertical(e){this._vertical=e,this.setClassMap()}get justified(){return this._justified}set justified(e){this._justified=e,this.setClassMap()}get type(){return this._type}set type(e){this._type=e,this.setClassMap()}get isKeysAllowed(){return this._isKeysAllowed}set isKeysAllowed(e){this._isKeysAllowed=e}constructor(e,t,i){this.renderer=t,this.elementRef=i,this.clazz=!0,this.tabs=[],this.classMap={},this.ariaLabel="Tabs",this.isDestroyed=!1,this._vertical=!1,this._justified=!1,this._type="tabs",this._isKeysAllowed=!0,this.defaultActivationScheduled=!1,Object.assign(this,e)}ngOnDestroy(){this.isDestroyed=!0}addTab(e){if(e.tabOrder!==void 0?this.insertTabByOrder(e):this.tabs.push(e),e.active){e.active=!0;return}this.defaultActivationScheduled||(this.defaultActivationScheduled=!0,Promise.resolve().then(()=>{if(this.defaultActivationScheduled=!1,!this.tabs.length||this.tabs.some(i=>!!i.active))return;let t=this.tabs.find(i=>!i.disabled);t&&(t.active=!0)}))}insertTabByOrder(e){let t=this.tabs.length;for(let i=0;i<this.tabs.length;i++){let r=this.tabs[i];if(r.tabOrder!==void 0&&e.tabOrder!==void 0&&e.tabOrder<r.tabOrder){t=i;break}if(r.tabOrder===void 0){t=i;break}}this.tabs.splice(t,0,e)}removeTab(e,t={reselect:!0,emit:!0}){let i=this.tabs.indexOf(e);if(!(i===-1||this.isDestroyed)){if(t.reselect&&e.active&&this.hasAvailableTabs(i)){let r=this.getClosestTabIndex(i);this.tabs[r].active=!0}t.emit&&e.removed.emit(e),this.tabs.splice(i,1),e.elementRef.nativeElement.parentNode&&this.renderer.removeChild(e.elementRef.nativeElement.parentNode,e.elementRef.nativeElement)}}keyNavActions(e,t){if(!this.isKeysAllowed)return;let i=Array.from(this.elementRef.nativeElement.querySelectorAll(".nav-link"));if(e.keyCode===13||e.key==="Enter"||e.keyCode===32||e.key==="Space"){e.preventDefault(),i[t%i.length].click();return}if(e.keyCode===39||e.key==="RightArrow"){let r,o=1;do r=i[(t+o)%i.length],o++;while(r.classList.contains("disabled"));r.focus();return}if(e.keyCode===37||e.key==="LeftArrow"){let r,o=1,c=t;do c-o<0?(c=i.length-1,r=i[c],o=0):r=i[c-o],o++;while(r.classList.contains("disabled"));r.focus();return}if(e.keyCode===36||e.key==="Home"){e.preventDefault();let r,o=0;do r=i[o%i.length],o++;while(r.classList.contains("disabled"));r.focus();return}if(e.keyCode===35||e.key==="End"){e.preventDefault();let r,o=1,c=t;do c-o<0?(c=i.length-1,r=i[c],o=0):r=i[c-o],o++;while(r.classList.contains("disabled"));r.focus();return}if((e.keyCode===46||e.key==="Delete")&&this.tabs[t].removable){if(this.removeTab(this.tabs[t]),i[t+1]){i[(t+1)%i.length].focus();return}i[i.length-1]&&i[0].focus()}}getClosestTabIndex(e){let t=this.tabs.length;if(!t)return-1;for(let i=1;i<=t;i+=1){let r=e-i,o=e+i;if(this.tabs[r]&&!this.tabs[r].disabled)return r;if(this.tabs[o]&&!this.tabs[o].disabled)return o}return-1}hasAvailableTabs(e){let t=this.tabs.length;if(!t)return!1;for(let i=0;i<t;i+=1)if(!this.tabs[i].disabled&&i!==e)return!0;return!1}setClassMap(){this.classMap={"nav-stacked":this.vertical,"flex-column":this.vertical,"nav-justified":this.justified,[`nav-${this.type}`]:!0}}};n.\u0275fac=function(t){return new(t||n)(u(xt),u(U),u(A))},n.\u0275cmp=V({type:n,selectors:[["tabset"]],hostVars:2,hostBindings:function(t,i){t&2&&F("tab-container",i.clazz)},inputs:{vertical:"vertical",justified:"justified",type:"type"},ngContentSelectors:_t,decls:4,vars:3,consts:[["role","tablist",1,"nav",3,"click","ngClass"],[3,"ngClass","active","disabled","keydown",4,"ngFor","ngForOf"],[1,"tab-content"],[3,"keydown","ngClass"],["href","javascript:void(0);","role","tab",1,"nav-link",3,"click"],[3,"ngTransclude"],["class","bs-remove-tab",3,"click",4,"ngIf"],[1,"bs-remove-tab",3,"click"]],template:function(t,i){t&1&&(Pe(),p(0,"ul",0),C("click",function(o){return o.preventDefault()}),O(1,Ct,5,17,"li",1),m(),p(2,"div",2),Le(3),m()),t&2&&(d("ngClass",i.classMap),L("aria-label",i.ariaLabel),h(),d("ngForOf",i.tabs))},dependencies:[Be,oe,bt,le],styles:["[_nghost-%COMP%] .nav-tabs[_ngcontent-%COMP%] .nav-item.disabled[_ngcontent-%COMP%] a.disabled[_ngcontent-%COMP%]{cursor:default}"]});let s=n;return s})(),Ot=(()=>{let n=class n{get customClass(){return this._customClass}set customClass(e){this.customClass&&this.customClass.split(" ").forEach(t=>{this.renderer.removeClass(this.elementRef.nativeElement,t)}),this._customClass=e?e.trim():"",this.customClass&&this.customClass.split(" ").forEach(t=>{this.renderer.addClass(this.elementRef.nativeElement,t)})}get active(){return this._active}set active(e){if(this._active!==e){if(this.disabled&&e||!e){this._active&&!e&&(this.deselect.emit(this),this._active=e);return}this._active=e,this.selectTab.emit(this),this.tabset.tabs.forEach(t=>{t!==this&&(t.active=!1)})}}get ariaLabelledby(){return this.id?`${this.id}-link`:""}constructor(e,t,i){this.elementRef=t,this.renderer=i,this.disabled=!1,this.removable=!1,this.selectTab=new v,this.deselect=new v,this.removed=new v,this.addClass=!0,this.role="tabpanel",this._active=!1,this._customClass="",this.tabset=e}ngOnInit(){this.removable=!!this.removable,this.tabset.addTab(this)}ngOnDestroy(){this.tabset.removeTab(this,{reselect:!1,emit:!1})}};n.\u0275fac=function(t){return new(t||n)(u(Tt),u(A),u(U))},n.\u0275dir=k({type:n,selectors:[["tab"],["","tab",""]],hostVars:7,hostBindings:function(t,i){t&2&&(L("id",i.id)("role",i.role)("aria-labelledby",i.ariaLabelledby),F("active",i.active)("tab-pane",i.addClass))},inputs:{heading:"heading",id:"id",disabled:"disabled",removable:"removable",tabOrder:"tabOrder",customClass:"customClass",active:"active"},outputs:{selectTab:"selectTab",deselect:"deselect",removed:"removed"},exportAs:["tab"]});let s=n;return s})(),vi=(()=>{let n=class n{constructor(e,t){t.headingRef=e}};n.\u0275fac=function(t){return new(t||n)(u(Fe),u(Ot))},n.\u0275dir=k({type:n,selectors:[["","tabHeading",""]]});let s=n;return s})(),Ci=(()=>{let n=class n{static forRoot(){return{ngModule:n,providers:[]}}};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=se({type:n}),n.\u0275inj=ie({imports:[ce]});let s=n;return s})();var Si=(()=>{let n=class n{constructor(){this.autoFocus=!0,this.autoSelect=!0,this.elementRef=M(A)}ngOnInit(){setTimeout(()=>{this.autoFocus&&this.elementRef.nativeElement.focus(),this.autoSelect&&this.elementRef.nativeElement.select()},0)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275dir=k({type:n,selectors:[["","appAutofocus",""]],inputs:{autoFocus:"autoFocus",autoSelect:"autoSelect"}});let s=n;return s})();var ht=(()=>{let n=class n{constructor(){this.cdRef=M(Q),this.ngZone=M(ae)}format(e){return e.from((0,x.default)(),this.lastOmitSuffix)}transform(e,t,i){return this.hasChanged(e,t)?(this.lastTime=this.getTime(e),this.lastValue=e,this.lastOmitSuffix=t,this.lastLocale=this.getLocale(e),this.formatFn=i||this.format.bind(this),this.removeTimer(),this.createTimer(),this.lastText=this.formatFn((0,x.default)(e))):this.createTimer(),this.lastText}ngOnDestroy(){this.removeTimer()}createTimer(){if(this.currentTimer)return;let e=(0,x.default)(this.lastValue),t=this.getSecondsUntilUpdate(e)*1e3;this.currentTimer=this.ngZone.runOutsideAngular(()=>typeof window<"u"?window.setTimeout(()=>{this.lastText=this.formatFn((0,x.default)(this.lastValue)),this.currentTimer=null,this.ngZone.run(()=>this.cdRef.markForCheck())},t):null)}removeTimer(){this.currentTimer&&(window.clearTimeout(this.currentTimer),this.currentTimer=null)}getSecondsUntilUpdate(e){let t=Math.abs((0,x.default)().diff(e,"minute"));return t<1?1:t<60?30:t<180?300:3600}hasChanged(e,t){return this.getTime(e)!==this.lastTime||this.getLocale(e)!==this.lastLocale||t!==this.lastOmitSuffix}getTime(e){return e instanceof Date?e.getTime():x.default.isDayjs(e)?e.valueOf():(0,x.default)(e).valueOf()}getLocale(e){return x.default.isDayjs(e)?e.locale():x.default.locale()}};n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=B({name:"amTimeAgo",type:n,pure:!1});let s=n;return s})();var Et=["ulElement"],wt=["liElements"],It=(s,n,a,e)=>({matches:s,itemTemplate:n,query:a,$implicit:e}),Mt=(s,n,a,e)=>({item:s,index:n,match:a,query:e});function At(s,n){}function kt(s,n){if(s&1&&g(0,"span",4),s&2){let a=n.match,e=n.query,t=l();d("innerHtml",t.highlight(a,e),j)}}function Ft(s,n){if(s&1&&(p(0,"h6",8),b(1),m()),s&2){let a=l().$implicit;h(),T(a)}}function Pt(s,n){}function Lt(s,n){if(s&1){let a=w();p(0,"button",9,2),C("click",function(t){y(a);let i=l().$implicit,r=l(2);return _(r.selectMatch(i,t))})("mouseenter",function(){y(a);let t=l().$implicit,i=l(2);return _(i.selectActive(t))}),O(2,Pt,0,0,"ng-template",3),m()}if(s&2){let a=l(),e=a.$implicit,t=a.index,i=l(2),r=H(2);F("active",i.isActive(e)),d("id",i.popupId+"-"+t)("@typeaheadAnimation",i.animationState),h(2),d("ngTemplateOutlet",i.itemTemplate||r)("ngTemplateOutletContext",xe(6,Mt,e.item,t,e,i.query))}}function Dt(s,n){if(s&1&&O(0,Ft,2,1,"h6",6)(1,Lt,3,11,"ng-template",7),s&2){let a=n.$implicit;d("ngIf",a.isHeader()),h(),d("ngIf",!a.isHeader())}}function Rt(s,n){if(s&1&&O(0,Dt,2,2,"ng-template",5),s&2){let a=l();d("ngForOf",a.matches)}}var Ut={\u00C1:"A",\u0102:"A",\u1EAE:"A",\u1EB6:"A",\u1EB0:"A",\u1EB2:"A",\u1EB4:"A",\u01CD:"A",\u00C2:"A",\u1EA4:"A",\u1EAC:"A",\u1EA6:"A",\u1EA8:"A",\u1EAA:"A",\u00C4:"A",\u01DE:"A",\u0226:"A",\u01E0:"A",\u1EA0:"A",\u0200:"A",\u00C0:"A",\u1EA2:"A",\u0202:"A",\u0100:"A",\u0104:"A",\u00C5:"A",\u01FA:"A",\u1E00:"A","\u023A":"A",\u00C3:"A","\uA732":"AA",\u00C6:"AE",\u01FC:"AE",\u01E2:"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY",\u1E02:"B",\u1E04:"B",\u0181:"B",\u1E06:"B","\u0243":"B",\u0182:"B",\u0106:"C",\u010C:"C",\u00C7:"C",\u1E08:"C",\u0108:"C",\u010A:"C",\u0187:"C","\u023B":"C",\u010E:"D",\u1E10:"D",\u1E12:"D",\u1E0A:"D",\u1E0C:"D",\u018A:"D",\u1E0E:"D",\u01F2:"D",\u01C5:"D",\u0110:"D",\u018B:"D",\u01F1:"DZ",\u01C4:"DZ",\u00C9:"E",\u0114:"E",\u011A:"E",\u0228:"E",\u1E1C:"E",\u00CA:"E",\u1EBE:"E",\u1EC6:"E",\u1EC0:"E",\u1EC2:"E",\u1EC4:"E",\u1E18:"E",\u00CB:"E",\u0116:"E",\u1EB8:"E",\u0204:"E",\u00C8:"E",\u1EBA:"E",\u0206:"E",\u0112:"E",\u1E16:"E",\u1E14:"E",\u0118:"E","\u0246":"E",\u1EBC:"E",\u1E1A:"E","\uA76A":"ET",\u1E1E:"F",\u0191:"F",\u01F4:"G",\u011E:"G",\u01E6:"G",\u0122:"G",\u011C:"G",\u0120:"G",\u0193:"G",\u1E20:"G",\u01E4:"G",\u1E2A:"H",\u021E:"H",\u1E28:"H",\u0124:"H","\u2C67":"H",\u1E26:"H",\u1E22:"H",\u1E24:"H",\u0126:"H",\u00CD:"I",\u012C:"I",\u01CF:"I",\u00CE:"I",\u00CF:"I",\u1E2E:"I",\u0130:"I",\u1ECA:"I",\u0208:"I",\u00CC:"I",\u1EC8:"I",\u020A:"I",\u012A:"I",\u012E:"I",\u0197:"I",\u0128:"I",\u1E2C:"I","\uA779":"D","\uA77B":"F","\uA77D":"G","\uA782":"R","\uA784":"S","\uA786":"T","\uA76C":"IS",\u0134:"J","\u0248":"J",\u1E30:"K",\u01E8:"K",\u0136:"K","\u2C69":"K","\uA742":"K",\u1E32:"K",\u0198:"K",\u1E34:"K","\uA740":"K","\uA744":"K",\u0139:"L","\u023D":"L",\u013D:"L",\u013B:"L",\u1E3C:"L",\u1E36:"L",\u1E38:"L","\u2C60":"L","\uA748":"L",\u1E3A:"L",\u013F:"L","\u2C62":"L",\u01C8:"L",\u0141:"L",\u01C7:"LJ",\u1E3E:"M",\u1E40:"M",\u1E42:"M","\u2C6E":"M",\u0143:"N",\u0147:"N",\u0145:"N",\u1E4A:"N",\u1E44:"N",\u1E46:"N",\u01F8:"N",\u019D:"N",\u1E48:"N","\u0220":"N",\u01CB:"N",\u00D1:"N",\u01CA:"NJ",\u00D3:"O",\u014E:"O",\u01D1:"O",\u00D4:"O",\u1ED0:"O",\u1ED8:"O",\u1ED2:"O",\u1ED4:"O",\u1ED6:"O",\u00D6:"O",\u022A:"O",\u022E:"O",\u0230:"O",\u1ECC:"O",\u0150:"O",\u020C:"O",\u00D2:"O",\u1ECE:"O",\u01A0:"O",\u1EDA:"O",\u1EE2:"O",\u1EDC:"O",\u1EDE:"O",\u1EE0:"O",\u020E:"O","\uA74A":"O","\uA74C":"O",\u014C:"O",\u1E52:"O",\u1E50:"O",\u019F:"O",\u01EA:"O",\u01EC:"O",\u00D8:"O",\u01FE:"O",\u00D5:"O",\u1E4C:"O",\u1E4E:"O",\u022C:"O",\u01A2:"OI","\uA74E":"OO",\u0190:"E",\u0186:"O",\u0222:"OU",\u1E54:"P",\u1E56:"P","\uA752":"P",\u01A4:"P","\uA754":"P","\u2C63":"P","\uA750":"P","\uA758":"Q","\uA756":"Q",\u0154:"R",\u0158:"R",\u0156:"R",\u1E58:"R",\u1E5A:"R",\u1E5C:"R",\u0210:"R",\u0212:"R",\u1E5E:"R","\u024C":"R","\u2C64":"R","\uA73E":"C",\u018E:"E",\u015A:"S",\u1E64:"S",\u0160:"S",\u1E66:"S",\u015E:"S",\u015C:"S",\u0218:"S",\u1E60:"S",\u1E62:"S",\u1E68:"S",\u0164:"T",\u0162:"T",\u1E70:"T",\u021A:"T","\u023E":"T",\u1E6A:"T",\u1E6C:"T",\u01AC:"T",\u1E6E:"T",\u01AE:"T",\u0166:"T","\u2C6F":"A","\uA780":"L",\u019C:"M","\u0245":"V","\uA728":"TZ",\u00DA:"U",\u016C:"U",\u01D3:"U",\u00DB:"U",\u1E76:"U",\u00DC:"U",\u01D7:"U",\u01D9:"U",\u01DB:"U",\u01D5:"U",\u1E72:"U",\u1EE4:"U",\u0170:"U",\u0214:"U",\u00D9:"U",\u1EE6:"U",\u01AF:"U",\u1EE8:"U",\u1EF0:"U",\u1EEA:"U",\u1EEC:"U",\u1EEE:"U",\u0216:"U",\u016A:"U",\u1E7A:"U",\u0172:"U",\u016E:"U",\u0168:"U",\u1E78:"U",\u1E74:"U","\uA75E":"V",\u1E7E:"V",\u01B2:"V",\u1E7C:"V","\uA760":"VY",\u1E82:"W",\u0174:"W",\u1E84:"W",\u1E86:"W",\u1E88:"W",\u1E80:"W","\u2C72":"W",\u1E8C:"X",\u1E8A:"X",\u00DD:"Y",\u0176:"Y",\u0178:"Y",\u1E8E:"Y",\u1EF4:"Y",\u1EF2:"Y",\u01B3:"Y",\u1EF6:"Y","\u1EFE":"Y",\u0232:"Y","\u024E":"Y",\u1EF8:"Y",\u0179:"Z",\u017D:"Z",\u1E90:"Z","\u2C6B":"Z",\u017B:"Z",\u1E92:"Z",\u0224:"Z",\u1E94:"Z",\u01B5:"Z",\u0132:"IJ",\u0152:"OE","\u1D00":"A","\u1D01":"AE",\u0299:"B","\u1D03":"B","\u1D04":"C","\u1D05":"D","\u1D07":"E","\uA730":"F",\u0262:"G",\u029B:"G",\u029C:"H",\u026A:"I",\u0281:"R","\u1D0A":"J","\u1D0B":"K",\u029F:"L","\u1D0C":"L","\u1D0D":"M",\u0274:"N","\u1D0F":"O",\u0276:"OE","\u1D10":"O","\u1D15":"OU","\u1D18":"P",\u0280:"R","\u1D0E":"N","\u1D19":"R","\uA731":"S","\u1D1B":"T","\u2C7B":"E","\u1D1A":"R","\u1D1C":"U","\u1D20":"V","\u1D21":"W",\u028F:"Y","\u1D22":"Z",\u00E1:"a",\u0103:"a",\u1EAF:"a",\u1EB7:"a",\u1EB1:"a",\u1EB3:"a",\u1EB5:"a",\u01CE:"a",\u00E2:"a",\u1EA5:"a",\u1EAD:"a",\u1EA7:"a",\u1EA9:"a",\u1EAB:"a",\u00E4:"a",\u01DF:"a",\u0227:"a",\u01E1:"a",\u1EA1:"a",\u0201:"a",\u00E0:"a",\u1EA3:"a",\u0203:"a",\u0101:"a",\u0105:"a","\u1D8F":"a",\u1E9A:"a",\u00E5:"a",\u01FB:"a",\u1E01:"a","\u2C65":"a",\u00E3:"a","\uA733":"aa",\u00E6:"ae",\u01FD:"ae",\u01E3:"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay",\u1E03:"b",\u1E05:"b",\u0253:"b",\u1E07:"b","\u1D6C":"b","\u1D80":"b",\u0180:"b",\u0183:"b",\u0275:"o",\u0107:"c",\u010D:"c",\u00E7:"c",\u1E09:"c",\u0109:"c",\u0255:"c",\u010B:"c",\u0188:"c","\u023C":"c",\u010F:"d",\u1E11:"d",\u1E13:"d","\u0221":"d",\u1E0B:"d",\u1E0D:"d",\u0257:"d","\u1D91":"d",\u1E0F:"d","\u1D6D":"d","\u1D81":"d",\u0111:"d",\u0256:"d",\u018C:"d",\u0131:"i","\u0237":"j",\u025F:"j",\u0284:"j",\u01F3:"dz",\u01C6:"dz",\u00E9:"e",\u0115:"e",\u011B:"e",\u0229:"e",\u1E1D:"e",\u00EA:"e",\u1EBF:"e",\u1EC7:"e",\u1EC1:"e",\u1EC3:"e",\u1EC5:"e",\u1E19:"e",\u00EB:"e",\u0117:"e",\u1EB9:"e",\u0205:"e",\u00E8:"e",\u1EBB:"e",\u0207:"e",\u0113:"e",\u1E17:"e",\u1E15:"e","\u2C78":"e",\u0119:"e","\u1D92":"e","\u0247":"e",\u1EBD:"e",\u1E1B:"e","\uA76B":"et",\u1E1F:"f",\u0192:"f","\u1D6E":"f","\u1D82":"f",\u01F5:"g",\u011F:"g",\u01E7:"g",\u0123:"g",\u011D:"g",\u0121:"g",\u0260:"g",\u1E21:"g","\u1D83":"g",\u01E5:"g",\u1E2B:"h",\u021F:"h",\u1E29:"h",\u0125:"h","\u2C68":"h",\u1E27:"h",\u1E23:"h",\u1E25:"h",\u0266:"h",\u1E96:"h",\u0127:"h",\u0195:"hv",\u00ED:"i",\u012D:"i",\u01D0:"i",\u00EE:"i",\u00EF:"i",\u1E2F:"i",\u1ECB:"i",\u0209:"i",\u00EC:"i",\u1EC9:"i",\u020B:"i",\u012B:"i",\u012F:"i","\u1D96":"i",\u0268:"i",\u0129:"i",\u1E2D:"i","\uA77A":"d","\uA77C":"f","\u1D79":"g","\uA783":"r","\uA785":"s","\uA787":"t","\uA76D":"is",\u01F0:"j",\u0135:"j",\u029D:"j","\u0249":"j",\u1E31:"k",\u01E9:"k",\u0137:"k","\u2C6A":"k","\uA743":"k",\u1E33:"k",\u0199:"k",\u1E35:"k","\u1D84":"k","\uA741":"k","\uA745":"k",\u013A:"l",\u019A:"l",\u026C:"l",\u013E:"l",\u013C:"l",\u1E3D:"l","\u0234":"l",\u1E37:"l",\u1E39:"l","\u2C61":"l","\uA749":"l",\u1E3B:"l",\u0140:"l",\u026B:"l","\u1D85":"l",\u026D:"l",\u0142:"l",\u01C9:"lj",\u017F:"s","\u1E9C":"s",\u1E9B:"s","\u1E9D":"s",\u1E3F:"m",\u1E41:"m",\u1E43:"m",\u0271:"m","\u1D6F":"m","\u1D86":"m",\u0144:"n",\u0148:"n",\u0146:"n",\u1E4B:"n","\u0235":"n",\u1E45:"n",\u1E47:"n",\u01F9:"n",\u0272:"n",\u1E49:"n",\u019E:"n","\u1D70":"n","\u1D87":"n",\u0273:"n",\u00F1:"n",\u01CC:"nj",\u00F3:"o",\u014F:"o",\u01D2:"o",\u00F4:"o",\u1ED1:"o",\u1ED9:"o",\u1ED3:"o",\u1ED5:"o",\u1ED7:"o",\u00F6:"o",\u022B:"o",\u022F:"o",\u0231:"o",\u1ECD:"o",\u0151:"o",\u020D:"o",\u00F2:"o",\u1ECF:"o",\u01A1:"o",\u1EDB:"o",\u1EE3:"o",\u1EDD:"o",\u1EDF:"o",\u1EE1:"o",\u020F:"o","\uA74B":"o","\uA74D":"o","\u2C7A":"o",\u014D:"o",\u1E53:"o",\u1E51:"o",\u01EB:"o",\u01ED:"o",\u00F8:"o",\u01FF:"o",\u00F5:"o",\u1E4D:"o",\u1E4F:"o",\u022D:"o",\u01A3:"oi","\uA74F":"oo",\u025B:"e","\u1D93":"e",\u0254:"o","\u1D97":"o",\u0223:"ou",\u1E55:"p",\u1E57:"p","\uA753":"p",\u01A5:"p","\u1D71":"p","\u1D88":"p","\uA755":"p","\u1D7D":"p","\uA751":"p","\uA759":"q",\u02A0:"q","\u024B":"q","\uA757":"q",\u0155:"r",\u0159:"r",\u0157:"r",\u1E59:"r",\u1E5B:"r",\u1E5D:"r",\u0211:"r",\u027E:"r","\u1D73":"r",\u0213:"r",\u1E5F:"r",\u027C:"r","\u1D72":"r","\u1D89":"r","\u024D":"r",\u027D:"r","\u2184":"c","\uA73F":"c",\u0258:"e",\u027F:"r",\u015B:"s",\u1E65:"s",\u0161:"s",\u1E67:"s",\u015F:"s",\u015D:"s",\u0219:"s",\u1E61:"s",\u1E63:"s",\u1E69:"s",\u0282:"s","\u1D74":"s","\u1D8A":"s","\u023F":"s",\u0261:"g","\u1D11":"o","\u1D13":"o","\u1D1D":"u",\u0165:"t",\u0163:"t",\u1E71:"t",\u021B:"t","\u0236":"t",\u1E97:"t","\u2C66":"t",\u1E6B:"t",\u1E6D:"t",\u01AD:"t",\u1E6F:"t","\u1D75":"t",\u01AB:"t",\u0288:"t",\u0167:"t","\u1D7A":"th",\u0250:"a","\u1D02":"ae",\u01DD:"e","\u1D77":"g",\u0265:"h","\u02AE":"h","\u02AF":"h","\u1D09":"i",\u029E:"k","\uA781":"l",\u026F:"m",\u0270:"m","\u1D14":"oe",\u0279:"r",\u027B:"r",\u027A:"r","\u2C79":"r",\u0287:"t",\u028C:"v",\u028D:"w",\u028E:"y","\uA729":"tz",\u00FA:"u",\u016D:"u",\u01D4:"u",\u00FB:"u",\u1E77:"u",\u00FC:"u",\u01D8:"u",\u01DA:"u",\u01DC:"u",\u01D6:"u",\u1E73:"u",\u1EE5:"u",\u0171:"u",\u0215:"u",\u00F9:"u",\u1EE7:"u",\u01B0:"u",\u1EE9:"u",\u1EF1:"u",\u1EEB:"u",\u1EED:"u",\u1EEF:"u",\u0217:"u",\u016B:"u",\u1E7B:"u",\u0173:"u","\u1D99":"u",\u016F:"u",\u0169:"u",\u1E79:"u",\u1E75:"u","\u1D6B":"ue","\uA778":"um","\u2C74":"v","\uA75F":"v",\u1E7F:"v",\u028B:"v","\u1D8C":"v","\u2C71":"v",\u1E7D:"v","\uA761":"vy",\u1E83:"w",\u0175:"w",\u1E85:"w",\u1E87:"w",\u1E89:"w",\u1E81:"w","\u2C73":"w",\u1E98:"w",\u1E8D:"x",\u1E8B:"x","\u1D8D":"x",\u00FD:"y",\u0177:"y",\u00FF:"y",\u1E8F:"y",\u1EF5:"y",\u1EF3:"y",\u01B4:"y",\u1EF7:"y","\u1EFF":"y",\u0233:"y",\u1E99:"y","\u024F":"y",\u1EF9:"y",\u017A:"z",\u017E:"z",\u1E91:"z",\u0291:"z","\u2C6C":"z",\u017C:"z",\u1E93:"z",\u0225:"z",\u1E95:"z","\u1D76":"z","\u1D8E":"z",\u0290:"z",\u01B6:"z","\u0240":"z",\uFB00:"ff",\uFB03:"ffi",\uFB04:"ffl",\uFB01:"fi",\uFB02:"fl",\u0133:"ij",\u0153:"oe",\uFB06:"st","\u2090":"a","\u2091":"e","\u1D62":"i","\u2C7C":"j","\u2092":"o","\u1D63":"r","\u1D64":"u","\u1D65":"v","\u2093":"x"};var z=class{constructor(n,a=n,e=!1){this.item=n,this.value=a,this.header=e}isHeader(){return this.header}toString(){return this.value}};function q(s){return s?s.replace(/[^A-Za-z0-9[\] ]/g,function(n){return Ut[n]||n}):""}function Se(s,n=" ",a="",e){let t=[];if(!e)t=dt(s,n,a);else{let i=`([${e}]+)`,r=s.split(new RegExp(i,"g")),o=r[r.length-1];o>""&&(n&&a?t=dt(o,n,a):t.push(o))}return t}function dt(s,n,a){let e=[],t=`(?:[${a}])([^${a}]+)(?:[${a}])|([^${n}]+)`,i=s.split(new RegExp(t,"g")),r=i.length,o,c=new RegExp(`[${a}]+`,"g");for(let f=0;f<r;f+=1)o=i[f],o&&o.length&&o!==n&&e.push(o.replace(c,""));return e}function D(s,n){if(!n||typeof s!="object")return s.toString();if(n.endsWith("()")){let t=n.slice(0,n.length-2);return s[t]().toString()}let e=n.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split(".");for(let t of e)t in s&&(s=s[t]);return s?s.toString():""}var pt="220ms cubic-bezier(0, 0, 0.2, 1)",Vt=qe("typeaheadAnimation",[Oe("animated-down",Y({height:"*",overflow:"hidden"})),de("* => animated-down",[Y({height:0,overflow:"hidden"}),he(pt)]),Oe("animated-up",Y({height:"*",overflow:"hidden"})),de("* => animated-up",[Y({height:"*",overflow:"hidden"}),he(pt)]),de("* => unanimated",he("0s"))]),Bt=0,Ht=(()=>{let n=class n{get typeaheadTemplateMethods(){return{selectMatch:this.selectMatch.bind(this),selectActive:this.selectActive.bind(this),isActive:this.isActive.bind(this)}}constructor(e,t,i,r){this.positionService=e,this.renderer=t,this.element=i,this.changeDetectorRef=r,this.activeChangeEvent=new v,this.isFocused=!1,this.positionServiceSubscription=new Ee,this.height=0,this.popupId=`ngb-typeahead-${Bt++}`,this._matches=[],this.renderer.setAttribute(this.element.nativeElement,"id",this.popupId),this.positionServiceSubscription.add(this.positionService.event$?.subscribe(()=>{if(this.isAnimated){this.animationState=this.isTopPosition?"animated-up":"animated-down",this.changeDetectorRef.detectChanges();return}this.animationState="unanimated",this.changeDetectorRef.detectChanges()}))}get active(){return this._active}set active(e){this._active=e,this.activeChanged()}get matches(){return this._matches}set matches(e){if(this.positionService.setOptions({modifiers:{flip:{enabled:this.adaptivePosition}},allowedPositions:["top","bottom"]}),this._matches=e,this.needScrollbar=this.typeaheadScrollable&&this.typeaheadOptionsInScrollableView<this.matches.length,this.typeaheadScrollable&&setTimeout(()=>{this.setScrollableMode()}),this.typeaheadIsFirstItemActive&&this._matches.length>0&&(this.setActive(this._matches[0]),this._active?.isHeader()&&this.nextActiveMatch()),this._active&&!this.typeaheadIsFirstItemActive){let t=this._matches.find(i=>i.value===this._active?.value);if(t){this.selectActive(t);return}this.active=void 0}}get isTopPosition(){return this.element.nativeElement.classList.contains("top")}get optionsListTemplate(){return this.parent?this.parent.optionsListTemplate:void 0}get isAnimated(){return this.parent?this.parent.isAnimated:!1}get adaptivePosition(){return this.parent?this.parent.adaptivePosition:!1}get typeaheadScrollable(){return this.parent?this.parent.typeaheadScrollable:!1}get typeaheadOptionsInScrollableView(){return this.parent?this.parent.typeaheadOptionsInScrollableView:5}get typeaheadIsFirstItemActive(){return this.parent?this.parent.typeaheadIsFirstItemActive:!0}get itemTemplate(){return this.parent?this.parent.typeaheadItemTemplate:void 0}get canSelectItemsOnBlur(){return!!this.parent?.selectItemOnBlur}selectActiveMatch(e){this._active&&this.parent?.typeaheadSelectFirstItem&&this.selectMatch(this._active),!this.parent?.typeaheadSelectFirstItem&&e&&this.selectMatch(this._active)}activeChanged(){if(!this._active)return;let e=this.matches.indexOf(this._active);this.activeChangeEvent.emit(`${this.popupId}-${e}`)}prevActiveMatch(){if(!this._active)return;let e=this.matches.indexOf(this._active);this.setActive(this.matches[e-1<0?this.matches.length-1:e-1]),this._active.isHeader()&&this.prevActiveMatch(),this.typeaheadScrollable&&this.scrollPrevious(e)}nextActiveMatch(){let e=this._active?this.matches.indexOf(this._active):-1;this.setActive(this.matches[e+1>this.matches.length-1?0:e+1]),this._active?.isHeader()&&this.nextActiveMatch(),this.typeaheadScrollable&&this.scrollNext(e)}selectActive(e){this.isFocused=!0,this.setActive(e)}highlight(e,t){let i=e.value,r=(this.parent&&this.parent.typeaheadLatinize?q(i):i).toLowerCase(),o,c;if(typeof t=="object"){let f=t.length;for(let R=0;R<f;R+=1)o=r.indexOf(t[R]),c=t[R].length,o>=0&&c>0&&(i=`${i.substring(0,o)}<strong>${i.substring(o,o+c)}</strong>${i.substring(o+c)}`,r=`${r.substring(0,o)}????????${"??".repeat(c)}??????????${r.substring(o+c)}`)}else t&&(o=r.indexOf(t),c=t.length,o>=0&&c>0&&(i=`${i.substring(0,o)}<strong>${i.substring(o,o+c)}</strong>${i.substring(o+c)}`));return i}focusLost(){this.isFocused=!1,this.canSelectItemsOnBlur||this.setActive(void 0)}isActive(e){return this.active===e}selectMatch(e,t){return t&&(t.stopPropagation(),t.preventDefault()),this.parent?.changeModel(e),setTimeout(()=>this.parent?.typeaheadOnSelect.emit(e),0),!1}setScrollableMode(){if(this.ulElement||(this.ulElement=this.element),this.liElements?.first){let e=Te.getStyles(this.ulElement.nativeElement),t=Te.getStyles(this.liElements.first.nativeElement),i=parseFloat((e["padding-bottom"]?e["padding-bottom"]:"").replace("px","")),r=parseFloat((e["padding-top"]?e["padding-top"]:"0").replace("px","")),o=parseFloat((t.height?t.height:"0").replace("px","")),c=this.typeaheadOptionsInScrollableView*o;this.guiHeight=`${c+r+i}px`}this.renderer.setStyle(this.element.nativeElement,"visibility","visible")}scrollPrevious(e){if(e===0){this.scrollToBottom();return}if(this.liElements&&this.ulElement){let t=this.liElements.toArray()[e-1];t&&!this.isScrolledIntoView(t.nativeElement)&&(this.ulElement.nativeElement.scrollTop=t.nativeElement.offsetTop)}}scrollNext(e){if(e+1>this.matches.length-1){this.scrollToTop();return}if(this.liElements&&this.ulElement){let t=this.liElements.toArray()[e+1];t&&!this.isScrolledIntoView(t.nativeElement)&&(this.ulElement.nativeElement.scrollTop=t.nativeElement.offsetTop-Number(this.ulElement.nativeElement.offsetHeight)+Number(t.nativeElement.offsetHeight))}}ngOnDestroy(){this.positionServiceSubscription.unsubscribe()}setActive(e){this._active=e;let t;this._active==null||this._active.isHeader()||(t=e),this.parent?.typeaheadOnPreview.emit(t)}isScrolledIntoView(e){if(!this.ulElement)return!1;let t=this.ulElement.nativeElement.scrollTop,i=t+Number(this.ulElement.nativeElement.offsetHeight),r=e.offsetTop;return r+e.offsetHeight<=i&&r>=t}scrollToBottom(){this.ulElement?.nativeElement&&(this.ulElement.nativeElement.scrollTop=this.ulElement.nativeElement.scrollHeight)}scrollToTop(){this.ulElement?.nativeElement&&(this.ulElement.nativeElement.scrollTop=0)}};n.\u0275fac=function(t){return new(t||n)(u(Z),u(U),u(A),u(Q))},n.\u0275cmp=V({type:n,selectors:[["typeahead-container"]],viewQuery:function(t,i){if(t&1&&($(Et,5),$(wt,5)),t&2){let r;W(r=K())&&(i.ulElement=r.first),W(r=K())&&(i.liElements=r)}},hostAttrs:[1,"dropdown","open","bottom","dropdown-menu",2,"position","absolute","display","block"],hostVars:7,hostBindings:function(t,i){t&1&&C("mouseleave",function(){return i.focusLost()})("blur",function(){return i.focusLost()}),t&2&&(L("role","listbox"),De("height",i.needScrollbar?i.guiHeight:"auto")("visibility","inherit"),F("dropup",i.dropup))},outputs:{activeChangeEvent:"activeChange"},features:[be([Z])],decls:5,vars:7,consts:[["bsItemTemplate",""],["bs4Template",""],["liElements",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"innerHtml"],["ngFor","",3,"ngForOf"],["class","dropdown-header",4,"ngIf"],[3,"ngIf"],[1,"dropdown-header"],["role","option",1,"dropdown-item",3,"click","mouseenter","id"]],template:function(t,i){if(t&1&&O(0,At,0,0,"ng-template",3)(1,kt,1,1,"ng-template",null,0,G)(3,Rt,1,1,"ng-template",null,1,G),t&2){let r=H(2),o=H(4);d("ngTemplateOutlet",i.optionsListTemplate||o)("ngTemplateOutletContext",xe(2,It,i.matches,i.itemTemplate||r,i.query,i.typeaheadTemplateMethods))}},dependencies:[He,oe,le],styles:[".dropdown[_nghost-%COMP%]{z-index:1000}.dropdown-menu[_nghost-%COMP%], .dropdown-menu[_ngcontent-%COMP%]{overflow-y:auto;height:100px}"],data:{animation:[Vt]}});let s=n;return s})(),mt=(()=>{let n=class n{constructor(){this.adaptivePosition=!1,this.isAnimated=!1,this.hideResultsOnBlur=!0,this.cancelRequestOnFocusLost=!1,this.selectFirstItem=!0,this.isFirstItemActive=!0,this.minLength=1,this.selectItemOnBlur=!1}};n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=te({token:n,factory:n.\u0275fac,providedIn:"root"});let s=n;return s})(),ut=(()=>{let n=class n{constructor(e,t,i,r,o,c,f){this.changeDetection=i,this.element=r,this.ngControl=o,this.renderer=c,this.typeaheadMinLength=1,this.adaptivePosition=!1,this.isAnimated=!1,this.typeaheadWaitMs=0,this.typeaheadLatinize=!0,this.typeaheadSingleWords=!0,this.typeaheadWordDelimiters=" ",this.typeaheadMultipleSearchDelimiters=",",this.typeaheadPhraseDelimiters=`'"`,this.typeaheadScrollable=!1,this.typeaheadOptionsInScrollableView=5,this.typeaheadSelectFirstItem=!0,this.typeaheadIsFirstItemActive=!0,this.typeaheadLoading=new v,this.typeaheadNoResults=new v,this.typeaheadOnSelect=new v,this.typeaheadOnPreview=new v,this.typeaheadOnBlur=new v,this.dropup=!1,this.isOpen=!1,this.list="list",this.isActiveItemChanged=!1,this.isFocused=!1,this.cancelRequestOnFocusLost=!1,this.selectItemOnBlur=!1,this.keyUpEventEmitter=new v,this.placement="bottom left",this._matches=[],this._subscriptions=[],this._outsideClickListener=()=>{},this._typeahead=e.createLoader(r,f,c).provide({provide:mt,useValue:t}),Object.assign(this,{typeaheadHideResultsOnBlur:t.hideResultsOnBlur,cancelRequestOnFocusLost:t.cancelRequestOnFocusLost,typeaheadSelectFirstItem:t.selectFirstItem,typeaheadIsFirstItemActive:t.isFirstItemActive,typeaheadMinLength:t.minLength,adaptivePosition:t.adaptivePosition,isAnimated:t.isAnimated,selectItemOnBlur:t.selectItemOnBlur})}get matches(){return this._matches}ngOnInit(){this.typeaheadOptionsLimit=this.typeaheadOptionsLimit||20,this.typeaheadMinLength=this.typeaheadMinLength===void 0?1:this.typeaheadMinLength,this.typeaheadAsync===void 0&&!J(this.typeahead)&&(this.typeaheadAsync=!1),J(this.typeahead)&&(this.typeaheadAsync=!0),this.typeaheadAsync?this.asyncActions():this.syncActions(),this.checkDelimitersConflict()}onInput(e){let t=e.target.value!==void 0?e.target.value:e.target.textContent!==void 0?e.target.textContent:e.target.innerText;t!=null&&t.trim().length>=this.typeaheadMinLength?(this.typeaheadLoading.emit(!0),this.keyUpEventEmitter.emit(e.target.value)):(this.typeaheadLoading.emit(!1),this.typeaheadNoResults.emit(!1),this.hide())}onChange(e){if(this._container){if(e.keyCode===27||e.key==="Escape"){this.hide();return}if(e.keyCode===38||e.key==="ArrowUp"){this.isActiveItemChanged=!0,this._container.prevActiveMatch();return}if(e.keyCode===40||e.key==="ArrowDown"){this.isActiveItemChanged=!0,this._container.nextActiveMatch();return}if(e.keyCode===13||e.key==="Enter"){this._container.selectActiveMatch();return}}}onFocus(){this.isFocused=!0,setTimeout(()=>{this.typeaheadMinLength===0&&(this.typeaheadLoading.emit(!0),this.keyUpEventEmitter.emit(this.element.nativeElement.value||""))},0)}onBlur(){this.isFocused=!1,this._container&&!this._container.isFocused&&this.typeaheadOnBlur.emit(this._container.active),!this.container&&this._matches?.length===0&&this.typeaheadOnBlur.emit(new z(this.element.nativeElement.value,this.element.nativeElement.value,!1))}onKeydown(e){if(this._container&&((e.keyCode===9||e.key==="Tab")&&this.onBlur(),e.keyCode===9||e.key==="Tab"||e.keyCode===13||e.key==="Enter")){if(e.preventDefault(),this.typeaheadSelectFirstItem){this._container.selectActiveMatch();return}this.typeaheadSelectFirstItem||(this._container.selectActiveMatch(this.isActiveItemChanged),this.isActiveItemChanged=!1,this.hide())}}changeModel(e){if(!e)return;let t;if(this.typeaheadMultipleSearch&&this._allEnteredValue){let i=this._allEnteredValue.split(new RegExp(`([${this.typeaheadMultipleSearchDelimiters}]+)`));this._allEnteredValue=i.slice(0,i.length-1).concat(e.value).join(""),t=this._allEnteredValue}else t=e.value;this.ngControl.viewToModelUpdate(t),this.ngControl.control?.setValue(t),this.changeDetection.markForCheck(),this.hide()}show(){if(this._typeahead.attach(Ht).to(this.container).position({attachment:`${this.dropup?"top":"bottom"} left`}).show({typeaheadRef:this,placement:this.placement,animation:!1,dropup:this.dropup}),this._outsideClickListener=this.renderer.listen("document","click",t=>{this.typeaheadMinLength===0&&this.element.nativeElement.contains(t.target)||!this.typeaheadHideResultsOnBlur||this.element.nativeElement.contains(t.target)||this.onOutsideClick()}),!this._typeahead.instance||!this.ngControl.control)return;this._container=this._typeahead.instance,this._container.parent=this;let e=(this.typeaheadLatinize?q(this.ngControl.control.value):this.ngControl.control.value).toString().toLowerCase();this._container.query=this.tokenizeQuery(e),this._container.matches=this._matches,this.element.nativeElement.focus(),this._container.activeChangeEvent.subscribe(t=>{this.activeDescendant=t,this.changeDetection.markForCheck()}),this.isOpen=!0}hide(){this._typeahead.isShown&&(this._typeahead.hide(),this._outsideClickListener(),this._container=void 0,this.isOpen=!1,this.changeDetection.markForCheck()),this.typeaheadOnPreview.emit()}onOutsideClick(){this._container&&!this._container.isFocused&&this.hide()}ngOnDestroy(){for(let e of this._subscriptions)e.unsubscribe();this._typeahead.dispose()}asyncActions(){this._subscriptions.push(this.keyUpEventEmitter.pipe(ue(this.typeaheadWaitMs),ee(e=>this._allEnteredValue=e),ke(()=>this.typeahead?this.typeahead:me)).subscribe(e=>{this.finalizeAsyncCall(e)}))}syncActions(){this._subscriptions.push(this.keyUpEventEmitter.pipe(ue(this.typeaheadWaitMs),X(e=>{this._allEnteredValue=e;let t=this.normalizeQuery(e);return this.typeahead?(J(this.typeahead)?this.typeahead:Ie(this.typeahead)).pipe(Me(r=>!!r&&this.testMatch(this.normalizeOption(r),t)),Ae()):me})).subscribe(e=>{this.finalizeAsyncCall(e)}))}normalizeOption(e){let t=D(e,this.typeaheadOptionField);return(this.typeaheadLatinize?q(t):t).toLowerCase()}tokenizeQuery(e){let t=e;return this.typeaheadMultipleSearch&&this.typeaheadSingleWords?this.haveCommonCharacters(`${this.typeaheadPhraseDelimiters}${this.typeaheadWordDelimiters}`,this.typeaheadMultipleSearchDelimiters)||(t=Se(t,this.typeaheadWordDelimiters,this.typeaheadPhraseDelimiters,this.typeaheadMultipleSearchDelimiters)):this.typeaheadSingleWords?t=Se(t,this.typeaheadWordDelimiters,this.typeaheadPhraseDelimiters):t=Se(t,void 0,void 0,this.typeaheadMultipleSearchDelimiters),t}normalizeQuery(e){let t=(this.typeaheadLatinize?q(e):e).toString().toLowerCase();return t=this.tokenizeQuery(t),t}testMatch(e,t){let i;if(typeof t=="object"){i=t.length;for(let r=0;r<i;r+=1)if(t[r].length>0&&e.indexOf(t[r])<0)return!1;return!0}return e.indexOf(t)>=0}finalizeAsyncCall(e){if(this.prepareMatches(e||[]),this.typeaheadLoading.emit(!1),this.typeaheadNoResults.emit(!this.hasMatches()),!this.hasMatches()){this.hide();return}if(!(!this.isFocused&&this.cancelRequestOnFocusLost))if(this._container&&this.ngControl.control){let i=((this.typeaheadLatinize?q(this.ngControl.control.value):this.ngControl.control.value)||"").toString().toLowerCase();this._container.query=this.tokenizeQuery(i),this._container.matches=this._matches}else this.show()}prepareMatches(e){let t=e.slice(0,this.typeaheadOptionsLimit),i=this.typeaheadOrderBy?this.orderMatches(t):t;if(this.typeaheadGroupField){let r=[];i.map(c=>D(c,this.typeaheadGroupField)).filter((c,f,R)=>R.indexOf(c)===f).forEach(c=>{r.push(new z(c,c,!0)),r=r.concat(i.filter(f=>D(f,this.typeaheadGroupField)===c).map(f=>new z(f,D(f,this.typeaheadOptionField))))}),this._matches=r}else this._matches=i.map(r=>new z(r,D(r,this.typeaheadOptionField)))}orderMatches(e){if(!e.length)return e;if(this.typeaheadOrderBy!==null&&this.typeaheadOrderBy!==void 0&&typeof this.typeaheadOrderBy=="object"&&Object.keys(this.typeaheadOrderBy).length===0)return console.error("Field and direction properties for typeaheadOrderBy have to be set according to documentation!"),e;let{field:t,direction:i}=this.typeaheadOrderBy||{};return!i||!(i==="asc"||i==="desc")?(console.error('typeaheadOrderBy direction has to equal "asc" or "desc". Please follow the documentation.'),e):typeof e[0]=="string"?i==="asc"?e.sort():e.sort().reverse():!t||typeof t!="string"?(console.error("typeaheadOrderBy field has to set according to the documentation."),e):e.sort((r,o)=>{let c=D(r,t),f=D(o,t);return c<f?i==="asc"?-1:1:c>f?i==="asc"?1:-1:0})}hasMatches(){return this._matches.length>0}checkDelimitersConflict(){if(this.typeaheadMultipleSearch&&this.typeaheadSingleWords&&this.haveCommonCharacters(`${this.typeaheadPhraseDelimiters}${this.typeaheadWordDelimiters}`,this.typeaheadMultipleSearchDelimiters))throw new Error(`Delimiters used in typeaheadMultipleSearchDelimiters must be different
|
|
2
|
+
from delimiters used in typeaheadWordDelimiters (current value: ${this.typeaheadWordDelimiters}) and
|
|
3
|
+
typeaheadPhraseDelimiters (current value: ${this.typeaheadPhraseDelimiters}).
|
|
4
|
+
Please refer to the documentation`)}haveCommonCharacters(e,t){for(let i=0;i<e.length;i++)if(e.charAt(i).indexOf(t)>-1)return!0;return!1}};n.\u0275fac=function(t){return new(t||n)(u(pe),u(mt),u(Q),u(A),u($e),u(U),u(ne))},n.\u0275dir=k({type:n,selectors:[["","typeahead",""]],hostVars:4,hostBindings:function(t,i){t&1&&C("input",function(o){return i.onInput(o)})("keyup",function(o){return i.onChange(o)})("click",function(){return i.onFocus()})("focus",function(){return i.onFocus()})("blur",function(){return i.onBlur()})("keydown",function(o){return i.onKeydown(o)}),t&2&&L("aria-activedescendant",i.activeDescendant)("aria-owns",i.isOpen?i._container.popupId:null)("aria-expanded",i.isOpen)("aria-autocomplete",i.list)},inputs:{typeahead:"typeahead",typeaheadMinLength:"typeaheadMinLength",adaptivePosition:"adaptivePosition",isAnimated:"isAnimated",typeaheadWaitMs:"typeaheadWaitMs",typeaheadOptionsLimit:"typeaheadOptionsLimit",typeaheadOptionField:"typeaheadOptionField",typeaheadGroupField:"typeaheadGroupField",typeaheadOrderBy:"typeaheadOrderBy",typeaheadAsync:"typeaheadAsync",typeaheadLatinize:"typeaheadLatinize",typeaheadSingleWords:"typeaheadSingleWords",typeaheadWordDelimiters:"typeaheadWordDelimiters",typeaheadMultipleSearch:"typeaheadMultipleSearch",typeaheadMultipleSearchDelimiters:"typeaheadMultipleSearchDelimiters",typeaheadPhraseDelimiters:"typeaheadPhraseDelimiters",typeaheadItemTemplate:"typeaheadItemTemplate",optionsListTemplate:"optionsListTemplate",typeaheadScrollable:"typeaheadScrollable",typeaheadOptionsInScrollableView:"typeaheadOptionsInScrollableView",typeaheadHideResultsOnBlur:"typeaheadHideResultsOnBlur",typeaheadSelectFirstItem:"typeaheadSelectFirstItem",typeaheadIsFirstItemActive:"typeaheadIsFirstItemActive",container:"container",dropup:"dropup"},outputs:{typeaheadLoading:"typeaheadLoading",typeaheadNoResults:"typeaheadNoResults",typeaheadOnSelect:"typeaheadOnSelect",typeaheadOnPreview:"typeaheadOnPreview",typeaheadOnBlur:"typeaheadOnBlur"},exportAs:["bs-typeahead"],features:[be([pe,Z])]});let s=n;return s})(),ft=(()=>{let n=class n{static forRoot(){return{ngModule:n,providers:[]}}};n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=se({type:n}),n.\u0275inj=ie({imports:[ce]});let s=n;return s})();var yt=(()=>{let n=class n{transform(e,t,i=!1){if(i&&t.length<1)return e;if(t&&e){let r=t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");r=r.split(" ").filter(c=>c.length>0).join("|");let o=new RegExp(r,"gi");return e.replace(o,c=>`<b>${c}</b>`)}else return e}};n.\u0275fac=function(t){return new(t||n)},n.\u0275pipe=B({name:"highlight",type:n,pure:!0});let s=n;return s})();var zt=["InputTypeHead"],jt=(s,n)=>n.mid,$t=(s,n)=>n.key;function Wt(s,n){if(s&1&&g(0,"img",7),s&2){let a=l().item;d("src",a.avatarUrl,fe)}}function Kt(s,n){if(s&1&&g(0,"fa-icon",13),s&2){let a=l().item,e=l();re(a.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),d("icon",e.icons.GROUPS)}}function Gt(s,n){if(s&1&&(g(0,"span",10),I(1,"highlight")),s&2){let a=l().item,e=l();d("innerHTML",P(1,1,a.description,e.selection),j)}}function Qt(s,n){if(s&1&&(p(0,"div",5)(1,"div",6),S(2,Wt,1,1,"img",7)(3,Kt,1,3,"fa-icon",8),m(),p(4,"div"),g(5,"div",9),I(6,"highlight"),S(7,Gt,2,4,"span",10),m(),p(8,"div",11)(9,"span",12),b(10),m()()()),s&2){let a=n.item,e=l();h(2),E(a.isUser?2:3),h(2),re(Re("d-flex ms-2 pe-5 ",a.description?"flex-column align-items-start":"align-items-center")),h(),d("innerHTML",P(6,7,a.name,e.selection),j),h(2),E(a.description?7:-1),h(3),T(a.type)}}function Zt(s,n){if(s&1){let a=w();p(0,"input",14,1),I(2,"translate"),C("typeaheadOnSelect",function(t){y(a);let i=l();return _(i.onSelect(t))})("typeaheadLoading",function(){y(a);let t=l();return _(t.onLoading())})("typeaheadNoResults",function(){y(a);let t=l();return _(t.onNoResults())})("typeaheadOnPreview",function(){y(a);let t=l();return _(t.onPreview())}),Ce("ngModelChange",function(t){y(a);let i=l();return ve(i.selection,t)||(i.selection=t),_(t)}),m()}if(s&2){let a=l(),e=H(1);ge("ngModel",a.selection),d("placeholder",P(2,10,a.placeHolder,a.locale.language))("typeaheadItemTemplate",e)("typeaheadAsync",!0)("typeaheadMinLength",0)("typeaheadSingleWords",!0)("typeaheadOptionField","name")("typeaheadWaitMs",100)("typeaheadHideResultsOnBlur",!0)("typeahead",a.asyncSearchUsersOrGroups)}}function Yt(s,n){if(s&1&&g(0,"img",7),s&2){let a=l().$implicit;d("src",a.avatarUrl,fe)}}function qt(s,n){if(s&1&&g(0,"fa-icon",17),s&2){let a=l(2);d("icon",a.icons.LINKS)}}function Jt(s,n){if(s&1&&g(0,"fa-icon",13),s&2){let a=l().$implicit,e=l();re(a.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),d("icon",e.icons.GROUPS)}}function Xt(s,n){if(s&1&&(p(0,"span",21),b(1),m()),s&2){let a=l().$implicit;h(),T(a.description)}}function ei(s,n){if(s&1&&(p(0,"span",22),b(1),m()),s&2){let a=l().$implicit;h(),T(a.type)}}function ti(s,n){if(s&1){let a=w();p(0,"button",32),I(1,"translate"),Ce("ngModelChange",function(t){y(a);let i=l().$implicit,r=l(3).$implicit;return ve(r.hPerms[i.key],t)||(r.hPerms[i.key]=t),_(t)}),C("ngModelChange",function(){y(a);let t=l(4).$implicit,i=l();return _(i.onPermissionChange(t))}),g(2,"fa-icon",33),m()}if(s&2){let a=l().$implicit,e=l(3).$implicit,t=l();ge("ngModel",e.hPerms[a.key]),d("tooltip",P(1,3,t.SPACES_PERMISSIONS_TEXT[a.key].text,t.locale.language)),h(2),d("icon",t.SPACES_PERMISSIONS_TEXT[a.key].icon)}}function ii(s,n){if(s&1&&S(0,ti,3,6,"button",31),s&2){let a=n.$implicit,e=l(4);E(!e.filterPermissions||(e.filterPermissions&&e.allowedPermissions.indexOf(a.key))>-1?0:-1)}}function ni(s,n){if(s&1&&(ye(0,ii,1,1,null,null,$t),I(2,"keyvalue"),g(3,"div",30)),s&2){let a=l(2).$implicit,e=l();_e(P(2,0,a.hPerms,e.originalOrderKeyValue))}}function si(s,n){if(s&1){let a=w();p(0,"button",34),I(1,"translate"),C("click",function(){y(a);let t=l(2).$implicit,i=l();return _(i.editFunction(t))}),g(2,"fa-icon",13),m()}if(s&2){let a=l(3);d("tooltip",P(1,2,"Edit",a.locale.language)),h(2),d("icon",a.icons.faPen)}}function ai(s,n){if(s&1){let a=w();p(0,"div",26),g(1,"div",27),S(2,ni,4,3),S(3,si,3,5,"button",28),p(4,"button",29),I(5,"translate"),C("click",function(){y(a);let t=l().$implicit,i=l();return _(i.removeMember(t))}),g(6,"fa-icon",13),m()()}if(s&2){let a=l(2);h(2),E(a.withPermissions?2:-1),h(),E(a.editFunction?3:-1),h(),d("tooltip",P(5,4,"Remove",a.locale.language)),h(2),d("icon",a.icons.faTimes)}}function ri(s,n){if(s&1&&(p(0,"div",4)(1,"div",15)(2,"div",16),S(3,Yt,1,1,"img",7)(4,qt,1,1,"fa-icon",17)(5,Jt,1,3,"fa-icon",8),p(6,"div",18)(7,"div",19),b(8),m(),p(9,"div",20),S(10,Xt,2,1,"span",21)(11,ei,2,1,"span",22),m()()(),p(12,"div",23)(13,"div",24),b(14),m(),p(15,"div",25),b(16),I(17,"amTimeAgo"),m()(),S(18,ai,7,7,"div",26),m()()),s&2){let a=n.$implicit,e=l();h(3),E(a.isUser?3:a.isLink?4:5),h(5),T(a.name),h(2),E(a.description?10:a.linkId?-1:11),h(4),T(a.isLink?e.MEMBER_TYPE.LINK:a.type),h(2),T(Ve(17,6,a.createdAt)),h(2),E(e.editMode?18:-1)}}var xn=(()=>{let n=class n{constructor(){this.members=[],this.membersChange=new v,this.withPermissions=!1,this.filterPermissions=!1,this.allowedPermissions=[],this.editMode=!0,this.hideInput=!1,this.editFunction=null,this.locale=M(Qe),this.MEMBER_TYPE=rt,this.originalOrderKeyValue=nt,this.SPACES_PERMISSIONS_TEXT=at,this.icons={GROUPS:it.GROUPS,LINKS:st.LINKS,faTimes:et,faPen:tt},this.selection="",this.ngZone=M(ae),this.defaultPlaceholder="Type to search for users or groups to add",this.placeHolder=this.defaultPlaceholder,this.lastResults=[],this.asyncSearchUsersOrGroups=new we(e=>e.next(this.selection)).pipe(X(e=>this.searchFunction(e||"").pipe(ee(t=>this.lastResults=t))))}ngOnInit(){this.setDefaultPlaceHolder()}onSelect(e){this.ngZone.run(()=>{this.selection="",this.inputTypeHead.nativeElement.value=""});let t=e.item;t.createdAt||(t.createdAt=new Date),this.members.unshift(e.item),this.membersChange.emit(this.members),this.lastResults=this.lastResults.filter(i=>i.mid!==t.mid)}onPermissionChange(e){e.permissions=ot(e.hPerms)}removeMember(e){this.members=this.members.filter(t=>t.mid!==e.mid),this.membersChange.emit(this.members),this.lastResults.push(e)}onLoading(){this.placeHolder="Loading..."}onNoResults(){this.placeHolder="No results"}onPreview(){this.setDefaultPlaceHolder()}setDefaultPlaceHolder(){this.placeHolder=this.customPlaceholder||this.defaultPlaceholder}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=V({type:n,selectors:[["app-user-search"]],viewQuery:function(t,i){if(t&1&&$(zt,5),t&2){let r;W(r=K())&&(i.inputTypeHead=r.first)}},inputs:{members:"members",withPermissions:"withPermissions",filterPermissions:"filterPermissions",allowedPermissions:"allowedPermissions",editMode:"editMode",hideInput:"hideInput",searchFunction:"searchFunction",editFunction:"editFunction",customPlaceholder:"customPlaceholder"},outputs:{membersChange:"membersChange"},decls:6,vars:1,consts:[["searchMembers",""],["InputTypeHead",""],[1,"form-control","form-control-sm","mb-2",3,"ngModel","placeholder","typeaheadItemTemplate","typeaheadAsync","typeaheadMinLength","typeaheadSingleWords","typeaheadOptionField","typeaheadWaitMs","typeaheadHideResultsOnBlur","typeahead"],[1,"col-12","mt-1"],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],["role","button",1,"d-flex"],[1,"d-flex","align-items-center","text-truncate"],["alt","","height","30","width","30",1,"avatar-base-img",3,"src"],[3,"icon","class"],[3,"innerHTML"],[1,"fs-xxxs","me-4",3,"innerHTML"],[1,"ms-auto","ps-5","me-1","text-muted","d-none","d-lg-block","fs-xxxs","align-self-center"],["l10nTranslate",""],[3,"icon"],[1,"form-control","form-control-sm","mb-2",3,"typeaheadOnSelect","typeaheadLoading","typeaheadNoResults","typeaheadOnPreview","ngModelChange","ngModel","placeholder","typeaheadItemTemplate","typeaheadAsync","typeaheadMinLength","typeaheadSingleWords","typeaheadOptionField","typeaheadWaitMs","typeaheadHideResultsOnBlur","typeahead"],[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"],[1,"circle-primary-icon",3,"icon"],[1,"d-flex","flex-column","text-truncate","ms-2"],[1,"text-truncate"],[1,"fs-xxxs","text-truncate"],[1,"fs-xxxs"],["l10nTranslate","",1,"fs-xxxs"],[1,"d-flex","flex-column","fs-xxxs","text-muted","d-none","d-lg-block","ms-3"],["l10nTranslate","",1,"d-flex","justify-content-end"],[1,"d-flex","justify-content-end"],[1,"d-flex","no-select"],[1,"vr","mx-2"],["type","button",1,"btn","btn-sm","btn-custom","me-2",3,"tooltip"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],[1,"vr","ms-1","me-2"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom",3,"ngModel","tooltip"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","me-2",3,"click","tooltip"]],template:function(t,i){t&1&&(O(0,Qt,11,10,"ng-template",null,0,G),S(2,Zt,3,13,"input",2),p(3,"div",3),ye(4,ri,19,8,"div",4,jt),m()),t&2&&(h(2),E(i.hideInput?-1:2),h(2),_e(i.members))},dependencies:[ft,ut,Ge,je,We,Ke,ze,Ye,ct,lt,Xe,Je,Ze,ht,yt,Ne],encapsulation:2});let s=n;return s})();export{li as a,Tt as b,Ot as c,vi as d,Ci as e,Si as f,yt as g,ht as h,xn as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Pa as $}from"./chunk-
|
|
1
|
+
import{Pa as $}from"./chunk-Y2CDUS4J.js";import{Ac as R,Eb as o,Fb as y,Gb as x,Lb as C,Ma as c,Mb as w,Nb as b,Pb as d,Qa as E,Qb as f,Ra as u,Sb as N,Xa as m,Ya as M,_a as j,ab as h,ca as I,da as S,dc as g,ec as U,gc as _,hc as T,ib as v,jb as F,kb as P,pb as s,qb as p,rb as l,va as D,ya as B,yb as k,zc as O}from"./chunk-RSNLYAN6.js";var V=["*"];function J(t,e){t&1&&k(0)}function K(t,e){if(t&1&&(p(0,"bar",3),x(1),l()),t&2){let a=o();s("type",a.type)("value",a._value)("max",a.max)("animate",a.animate)("striped",a.striped)}}function L(t,e){if(t&1&&(p(0,"bar",3),d(1),l()),t&2){let a=e.$implicit,i=o(2);s("type",a.type)("value",a.value)("max",a.max||i.max)("animate",i.animate)("striped",i.striped),c(),f(a.label)}}function W(t,e){if(t&1&&h(0,L,2,6,"bar",4),t&2){let a=o();s("ngForOf",a._values)}}var X=(()=>{let e=class e{constructor(i,n){this.el=i,this.renderer=n,this.max=100,this.value=0,this.animate=!1,this.striped=!1,this.type="info",this.percent=100}ngOnChanges(i){(i.value||i.max)&&(this.percent=100*(Number(i.value?.currentValue||this.value)/Number(i.max?.currentValue||this.max||100))),i.type&&this.applyTypeClasses()}applyTypeClasses(){if(this._prevType){let i=`progress-bar-${this._prevType}`,n=`bg-${this._prevType}`;this.renderer.removeClass(this.el.nativeElement,i),this.renderer.removeClass(this.el.nativeElement,n),this._prevType=void 0}if(this.type){let i=`progress-bar-${this.type}`,n=`bg-${this.type}`;this.renderer.addClass(this.el.nativeElement,i),this.renderer.addClass(this.el.nativeElement,n),this._prevType=this.type}}};e.\u0275fac=function(n){return new(n||e)(u(B),u(E))},e.\u0275cmp=m({type:e,selectors:[["bar"]],hostAttrs:["role","progressbar","aria-valuemin","0"],hostVars:13,hostBindings:function(n,r){n&2&&(v("aria-valuenow",r.value)("aria-valuetext",r.percent?r.percent.toFixed(0)+"%":"")("aria-valuemax",r.max),w("height","100","%")("width",r.percent,"%"),b("progress-bar",!0)("progress-bar-animated",r.animate)("progress-bar-striped",r.striped))},inputs:{max:"max",value:"value",animate:"animate",striped:"striped",type:"type"},features:[D],ngContentSelectors:V,decls:1,vars:0,template:function(n,r){n&1&&(y(),x(0))},encapsulation:2,changeDetection:0});let t=e;return t})(),Y=(()=>{let e=class e{constructor(){this.animate=!1,this.max=100}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),A=(()=>{let e=class e{set value(i){this.isStacked=Array.isArray(i),typeof i=="number"?(this._value=i,this._values=void 0):(this._value=void 0,this._values=i)}constructor(i){this.max=100,this.animate=!1,this.striped=!1,this.isStacked=!1,this._value=0,Object.assign(this,i)}};e.\u0275fac=function(n){return new(n||e)(u(Y))},e.\u0275cmp=m({type:e,selectors:[["progressbar"]],hostVars:3,hostBindings:function(n,r){n&2&&(v("max",r.max),b("progress",!0))},inputs:{max:"max",animate:"animate",striped:"striped",type:"type",value:"value"},ngContentSelectors:V,decls:5,vars:3,consts:[["NotStacked",""],["Stacked",""],[4,"ngIf","ngIfThen","ngIfElse"],[3,"type","value","max","animate","striped"],[3,"type","value","max","animate","striped",4,"ngFor","ngForOf"]],template:function(n,r){if(n&1&&(y(),h(0,J,1,0,"ng-container",2)(1,K,2,5,"ng-template",null,0,T)(3,W,1,1,"ng-template",null,1,T)),n&2){let z=C(2),G=C(4);s("ngIf",!r.isStacked)("ngIfThen",z)("ngIfElse",G)}},dependencies:[R,X,O],styles:["[_nghost-%COMP%]{width:100%;display:flex}"],changeDetection:0});let t=e;return t})(),H=(()=>{let e=class e{static forRoot(){return{ngModule:e,providers:[]}}};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=M({type:e}),e.\u0275inj=S({});let t=e;return t})();var q=(()=>{let e=class e{transform(i,n=0,r=!1){return $(i,n,r)}};e.\u0275fac=function(n){return new(n||e)},e.\u0275pipe=j({name:"toBytes",type:e,pure:!0});let t=e;return t})();function ee(t,e){if(t&1&&(p(0,"progressbar",0)(1,"span",1),d(2),g(3,"toBytes"),g(4,"toBytes"),l()()),t&2){let a=o();s("max",a.item.storageQuota)("value",a.item.storageUsage)("type",null),c(2),N("",_(3,5,a.item.storageUsage,2,!0)," / ",U(4,9,a.item.storageQuota))}}function te(t,e){if(t&1&&(p(0,"progressbar",0)(1,"span",1),d(2),g(3,"toBytes"),l()()),t&2){let a=o();s("max",a.item.storageUsage)("value",a.item.storageUsage)("type",null),c(2),f(_(3,4,a.item.storageUsage,2,!0))}}var oe=(()=>{let e=class e{constructor(){this.item={storageUsage:0,storageQuota:null}}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-storage-usage"]],inputs:{item:"item"},decls:2,vars:1,consts:[[1,"bg-black",3,"max","value","type"],[1,"ms-1","me-1"]],template:function(n,r){n&1&&F(0,ee,5,11,"progressbar",0)(1,te,4,8,"progressbar",0),n&2&&P(r.item.storageQuota>0?0:1)},dependencies:[H,A,q],encapsulation:2});let t=e;return t})();export{A as a,H as b,q as c,oe as d};
|