PageSourceSearch

https://portal.lmjconsulting.com/622.799bb9bbeec5e951.js

js lmjconsulting.com collected 2026-10-08 20:22:58 UTC 45,234 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkCloudRadial=self.webpackChunkCloudRadial||[]).push([[622],{52558:(L,k,n)=>{n.d(k,{W:()=>_});var m=n(14211),l=n(54438),F=n(81127),v=n(51188);const h=(a,S)=>S.policyId,P=a=>["/app/compliance/risks",a];function r(a,S){if(1&a&&(l.j41(0,"div",9)(1,"div",10)(2,"a",11),l.EFF(3),l.k0s()(),l.j41(4,"div",12),l.EFF(5),l.k0s()()),2&a){const g=S.$implicit;l.R7$(2),l.Y8G("title","View policy: "+g.name)("routerLink",l.eq3(4,P,g.policyId)),l.R7$(),l.SpI(" ",g.name," "),l.R7$(2),l.SpI(" ",g.description," ")}}function y(a,S){if(1&a&&(l.j41(0,"div",0)(1,"section",1)(2,"header",2)(3,"h2",3),l.EFF(4,"Policy Exceptions"),l.k0s(),l.j41(5,"p",4),l.EFF(6,"Not compliant with following policy recommendations:"),l.k0s()(),l.j41(7,"div",5)(8,"div",6)(9,"div",7),l.EFF(10,"Policy"),l.k0s(),l.j41(11,"div",8),l.EFF(12,"Description"),l.k0s()(),l.Z7z(13,r,6,6,"div",9,h),l.k0s()()()),2&a){const g=l.XpG();l.R7$(13),l.Dyx(g.issuesList)}}let _=(()=>{class a{constructor(g){this.userPermissionsService=g,this.issuesList=[],this.displayIssues=!1}ngOnInit(){this.displayIssues=!this.userPermissionsService.IsDisabled(m.IN.Compliance_Policies)&&this.issuesList&&this.issuesList.length>0}static{this.\u0275fac=function(E){return new(E||a)(l.rXU(F.N))}}static{this.\u0275cmp=l.VBU({type:a,selectors:[["policy-issues"]],inputs:{issuesList:"issuesList"},decls:1,vars:1,consts:[[1,"epSpecs"],[1,"policy-issues"],[1,"policy-issues__header","mb-3"],[1,"epTitle"],[1,"small","mb-3"],[1,"container-fluid","px-0"],[1,"row","fw-bold","mb-2"],[1,"col-4"],[1,"col-7"],[1,"row","k-hover-row"],["notranslate","",1,"col-4"],[1,"alertText",3,"title","routerLink"],["notranslate","",1,"col-7"]],template:function(E,T){1&E&&l.DNE(0,y,15,0,"div",0),2&E&&l.vxM(T.displayIssues?0:-1)},dependencies:[v.Wk],styles:[".epTitle{font-size:14px;padding:20px 0 10px;font-weight:700}\n"],encapsulation:2})}}return a})()},30622:(L,k,n)=>{n.r(k),n.d(k,{UsersGridComponent:()=>Me});var m=n(82064),l=n(93873),F=n(51188),v=n(6744),h=n(54397),P=n(60177),r=n(75542),y=n(50841),_=n(55209),a=n(14211),S=n(4163),g=n(99416),E=n(65752),T=n(5964),oe=n(96697),d=n(70980),p=n(50617),C=n(89417),x=n(72585),u=n(73938),I=n(58675),O=n(45673),w=n(25558),ae=n(27468),z=n(58544),Q=n(1016),J=n(93512),e=n(54438),B=n(73670),Z=n(21942),q=n(75417),le=n(1134),ce=n(96354);let j=(()=>{class o{static{this.basePath="api/security/users"}constructor(s){this.dataService=s}getUsers(){return this.dataService.get(o.basePath)}getUser(s){return this.dataService.get(`${o.basePath}/${s}`).pipe((0,ce.T)(t=>(t?.ticketBoardOverride&&(t.ticketBoardOverrideArray=t.ticketBoardOverride.split(",")),t?.ticketStatusOverride&&(t.ticketStatusOverrideArray=t.ticketStatusOverride.split(",")),t)))}saveUser(s){return s?.ticketBoardOverrideArray&&(s.ticketBoardOverride=s.ticketBoardOverrideArray.length>0?s.ticketBoardOverrideArray.join(","):""),s?.ticketStatusOverrideArray&&(s.ticketStatusOverride=s.ticketStatusOverrideArray.length>0?s.ticketStatusOverrideArray.join(","):""),this.dataService.post(o.basePath,s)}exportUsers(s,t){this.dataService.downloadFile(`${o.basePath}/export`,s,t)}static{this.\u0275fac=function(t){return new(t||o)(e.KVO(B.u))}}static{this.\u0275prov=e.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();var ee=n(81127),de=n(38299),ue=n(15124),se=n(30251),pe=n(8524),N=n(81391);function me(o,D){if(1&o&&(e.j41(0,"div",11),e.EFF(1),e.k0s()),2&o){const s=D.$implicit,t=e.XpG();e.Y8G("ngClass",t.disabled?"no-drag":"draggable"),e.R7$(),e.SpI(" ",s.friendlyName," ")}}function he(o,D){if(1&o&&(e.j41(0,"div",11),e.EFF(1),e.k0s()),2&o){const s=D.$implicit,t=e.XpG();e.Y8G("ngClass",t.disabled?"no-drag":"draggable"),e.R7$(),e.SpI(" ",s.friendlyName," ")}}let fe=(()=>{class o{set model(s){this.modelSave=s,this.fieldName&&this.modelSave&&(this.licenses=this.modelSave[this.fieldName])}set field(s){this.fieldName=s,this.modelSave&&this.fieldName&&this.modelSave[this.fieldName]&&(this.licenses=this.modelSave[this.fieldName])}constructor(){this.disabled=!1,this.allLicenses=[],this.fieldName="",this.licenses=[]}get availableLicenses(){return this.allLicenses.filter(s=>!this.licenses.some(t=>t.id===s.id))}onDrop(s){const t=s.previousContainer.id,i=s.container.id;s.previousContainer===s.container?(0,N.HD)(s.container.data,s.previousIndex,s.currentIndex):this.validateMove(s.item.data,t,i)&&(0,N.eg)(s.previousContainer.data,s.container.data,s.previousIndex,s.currentIndex),this.modelSave[this.fieldName]=this.licenses}validateMove(s,t,i){return"availableLicenses"===t&&"selectedLicenses"===i||"selectedLicenses"===t&&"availableLicenses"===i}isGroupExists(s){for(let t=0;t<this.licenses.length;t++)if(this.licenses[t].name==s)return!0;for(let t=0;t<this.allLicenses.length;t++)if(this.allLicenses[t].name==s)return!0;return!1}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["license-editor"]],inputs:{disabled:"disabled",model:"model",field:"field",allLicenses:"allLicenses"},decls:23,vars:11,consts:[[1,"row","mb-1"],[1,"col",3,"ngClass"],[1,"col-auto"],["href","","routerLink","/app/usage/licenses","target","_blank",1,"float-end"],["cdkDropListGroup","",1,"row","g-2"],[1,"col"],[1,"groupCol","h-100","p-2"],[1,"groupColTitle",3,"ngClass"],["cdkDropList","",1,"h-100",3,"cdkDropListDropped","id","cdkDropListData","ngClass"],["class","groupItem p-1 mb-2","cdkDrag","","notranslate","",3,"ngClass",4,"ngFor","ngForOf"],[1,"row"],["cdkDrag","","notranslate","",1,"groupItem","p-1","mb-2",3,"ngClass"]],template:function(t,i){1&t&&(e.j41(0,"div",0)(1,"div",1),e.EFF(2," License Assignments "),e.k0s(),e.j41(3,"div",2)(4,"a",3)(5,"small"),e.EFF(6,"Licenses"),e.k0s()()()(),e.j41(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7),e.EFF(11,"Selected Licenses"),e.k0s(),e.j41(12,"div",8),e.bIt("cdkDropListDropped",function(b){return i.onDrop(b)}),e.DNE(13,me,2,2,"div",9),e.k0s()()(),e.j41(14,"div",5)(15,"div",6)(16,"div",7),e.EFF(17,"Available Licenses"),e.k0s(),e.j41(18,"div",8),e.bIt("cdkDropListDropped",function(b){return i.onDrop(b)}),e.DNE(19,he,2,2,"div",9),e.k0s()()()(),e.j41(20,"div",10)(21,"small"),e.EFF(22,"Note: Licenses imported from other systems may not be assigned or unassigned from here."),e.k0s()()),2&t&&(e.R7$(),e.Y8G("ngClass",i.disabled?"groupDisabled":""),e.R7$(9),e.Y8G("ngClass",i.disabled?"groupDisabled":""),e.R7$(2),e.Y8G("id","selectedLicenses")("cdkDropListData",i.licenses)("ngClass",i.disabled?"groupDisabled":""),e.R7$(),e.Y8G("ngForOf",i.licenses),e.R7$(3),e.Y8G("ngClass",i.disabled?"groupDisabled":""),e.R7$(2),e.Y8G("id","availableLicenses")("cdkDropListData",i.availableLicenses)("ngClass",i.disabled?"groupDisabled":""),e.R7$(),e.Y8G("ngForOf",i.availableLicenses))},dependencies:[P.YU,P.Sq,F.Wk,N.O7,N.RK,N.T1],encapsulation:2})}static{this.\u0275prov=e.jDH({token:o,factory:o.\u0275fac})}}return o}
1)();var ye=n(52558),te=n(28644),ie=n(1695),ve=n(7034);const ge=o=>[o];function be(o,D){if(1&o&&e.nrm(0,"ngx-avatars",3),2&o){const s=e.XpG();e.Y8G("src",null==s.user?null:s.user.profileImageUrl)("value",null==s.user?null:s.user.initials)("textSizeRatio",2)}}function Ce(o,D){if(1&o){const s=e.RV6();e.j41(0,"rbac-button",16),e.bIt("click",function(){e.eBV(s);const i=e.XpG();return e.Njj(i.excludeUser())}),e.k0s(),e.j41(1,"rbac-button",17),e.bIt("click",function(){e.eBV(s);const i=e.XpG();return e.Njj(i.openEntityEventsBlade())}),e.k0s()}if(2&o){const s=e.XpG();e.HbH("pageHeaderButtonImage pageHeaderDelete"),e.Y8G("title","Delete user")("icon","fal fa-trash")("moduleType",s.moduleType)("permission","Delete"),e.R7$(),e.HbH("pageHeaderButton"),e.Y8G("title","Audit Trail")("icon","fal fa-book")("moduleType",s.moduleType)("feature","Partner_Security_AuditTrail")("permission","Full")}}function Re(o,D){1&o&&e.nrm(0,"tab-item",19),2&o&&e.Y8G("tab",D.$implicit)}function Se(o,D){if(1&o){const s=e.RV6();e.j41(0,"div",21),e.bIt("click",function(){e.eBV(s);const i=e.XpG(2);return e.Njj(i.impersonate())}),e.j41(1,"div",22),e.nrm(2,"span",23),e.EFF(3,"Impersonate This User "),e.k0s()()}}function _e(o,D){if(1&o){const s=e.RV6();e.j41(0,"div",10)(1,"tab-menu",18),e.bIt("onChange",function(i){e.eBV(s);const c=e.XpG();return e.Njj(c.changeTab(i))}),e.Z7z(2,Re,1,1,"tab-item",19,e.Vm6),e.k0s(),e.DNE(4,Se,4,0,"div",20),e.k0s()}if(2&o){const s=e.XpG();e.R7$(2),e.Dyx(s.tabs),e.R7$(2),e.vxM(s.hasImpersonateUserPermission?4:-1)}}function Te(o,D){if(1&o&&e.nrm(0,"policy-issues",24),2&o){const s=e.XpG(2);e.Y8G("issuesList",s.user.policyIssues)}}function Ee(o,D){if(1&o&&(e.nrm(0,"formly-form",12),e.DNE(1,Te,1,1,"policy-issues",24)),2&o){const s=e.XpG();e.Y8G("form",s.userForm)("fields",s.userFields)("model",s.user),e.R7$(),e.vxM((null==s.user||null==s.user.policyIssues?null:s.user.policyIssues.length)>0?1:-1)}}function De(o,D){if(1&o){const s=e.RV6();e.j41(0,"form",29),e.nrm(1,"formly-form",12),e.j41(2,"rbac-button",30),e.bIt("click",function(){e.eBV(s);const i=e.XpG(2);return e.Njj(i.addRoleAssignment())}),e.k0s()()}if(2&o){const s=e.XpG(2);e.Y8G("formGroup",s.roleForm),e.R7$(),e.Y8G("form",s.roleForm)("fields",e.eq3(11,ge,s.roleField))("model",s.roleModel),e.R7$(),e.HbH("btn btn-primary mt-2"),e.Y8G("type","submit")("label","Submit")("moduleType",s.moduleType)("permission","Edit")("disabled",!s.roleForm.valid)}}function Pe(o,D){if(1&o){const s=e.RV6();e.nrm(0,"az-data-grid",25),e.j41(1,"div",26)(2,"button",27),e.bIt("click",function(){e.eBV(s);const i=e.XpG();return e.Njj(i.toggleRoleForm())}),e.j41(3,"span",28),e.EFF(4,"Add a Role Assignment"),e.k0s()(),e.DNE(5,De,3,13,"form",29),e.k0s()}if(2&o){const s=e.XpG();e.Y8G("data",s.user.roleAssignments)("columns",s.roleAssignmentsColumns)("pageable",!1)("scrollable","none")("isFilterable",!1),e.R7$(5),e.vxM(s.showRoleForm?5:-1)}}function Ie(o,D){if(1&o&&e.nrm(0,"license-editor",11),2&o){const s=e.XpG();e.Y8G("model",s.user)("field","licenses")("allLicenses",s.allLicenses)("disabled",!s.hasEditPermissionByCompany)}}function Ue(o,D){if(1&o&&e.nrm(0,"formly-form",12),2&o){const s=e.XpG();e.Y8G("form",s.ticketSettingsForm)("fields",s.ticketSettingsFields)("model",s.user)}}let re=(()=>{class o{constructor(s,t,i,c,b,R,A,$,X,H,K,V,Y,W,Ge,Be){this.dataService=s,this.dataBaseService=t,this.slimLoading=i,this.confirmService=c,this.activeOffcanvas=b,this.browserutils=R,this.auditTrailService=A,this.usersService=$,this.userService=X,this.userPermissionsService=H,this.utilityService=K,this.roleAssignmentsService=V,this.localizedShortPipe=Y,this.roleService=W,this.desktopHelper=Ge,this.mixpanelService=Be,this.moduleType=a.nR.Partner_Clients,this.hasImpersonateUserPermission=!1,this.hasFullPermission=!1,this.showMoreFields=!1,this.tabs=[{id:"user",name:"User"},{id:"role-assignments",name:"Role Assignments"},{id:"licenses",name:"Licenses"},{id:"ticket-settings",name:"Ticket Settings"}],this.currentTab=this.tabs[0],this.allLicenses=[],this.userForm=new C.gE([]),this.userFields=[{fieldGroupClassName:"row",fieldGroup:[{key:"isPriority",type:u.y.Checkbox,wrappers:[I.t.NoLabel],props:{label:"Priority User",description:"If checked, this user will have their ticket priority elevated."},hooks:{onInit:f=>{f.formControl?.valueChanges.subscribe(U=>{this.user.priorityStatus=U?O.c.Priority:O.c.None})}},className:"col-6"},{key:"supportPin",type:u.y.CustomTemplate,props:{label:"Support PIN",cssClass:"text-end",template:f=>
1`Support PIN: ${f.supportPin?f.supportPin:"Not Set"}`},className:"col-6"},{key:"firstName",type:u.y.Input,props:{label:"First Name"},className:"col-6",expressions:{hide:'model.sourceName !== "Manual"'}},{key:"lastName",type:u.y.Input,props:{label:"Last Name"},className:"col-6",expressions:{hide:'model.sourceName !== "Manual"'}},{wrappers:[I.t.FieldSet],expressions:{hide:"model.id"},props:{label:"User Details",commandText:f=>this.utilityService.findItem(f.fieldGroup,"key","extendedFields",null).hide?"Show more user fields...":"Show less user fields...",command:f=>{const U=this.utilityService.findItem(f.fieldGroup,"key","extendedFields",null);U.hide=!U.hide}},fieldGroup:[{fieldGroupClassName:"row",fieldGroup:[{key:"email",type:u.y.Input,props:{label:"Email",required:!0},className:"col-12"},{key:"firstName",type:u.y.Input,props:{label:"First Name",required:!0},className:"col-12"},{key:"lastName",type:u.y.Input,props:{label:"Last Name",required:!0},className:"col-12"}]},{key:"extendedFields",fieldGroupClassName:"row",hide:!0,fieldGroup:[{key:"companyName",type:u.y.Input,props:{label:"Company Name"},className:"col-12"},{key:"title",type:u.y.Input,props:{label:"Title"},className:"col-12"},{key:"department",type:u.y.Input,props:{label:"Department"},className:"col-12"},{key:"mobilePhone",type:u.y.Input,props:{label:"Mobile Phone"},className:"col-12"},{key:"phoneNumber",type:u.y.Input,props:{label:"Phone Number"},className:"col-12"},{key:"streetAddress",type:u.y.Input,props:{label:"Street Address"},className:"col-12"},{key:"city",type:u.y.Input,props:{label:"City"},className:"col-12"},{key:"state",type:u.y.Input,props:{label:"State"},className:"col-12"},{key:"postalCode",type:u.y.Input,props:{label:"Postal Code"},className:"col-12"}]}],className:"col-12"},{type:u.y.ReadOnlyFields,wrappers:[I.t.FieldSet],expressions:{hide:"!model.id"},props:{label:"User Details",readOnlyFields:[{name:"companyName",label:"Company",template:f=>`<a href="/app/admin/company/${f.companyId}">${f.companyName}</a>`},{name:"email",label:"Email",template:f=>`<a href="mailto:${f.email}">${f.email}</a>`},{name:"alternateEmails",label:"Alternate Email(s)",template:f=>f.alternateEmails.map(U=>`<a href="mailto:${U}">${U}</a>`).join(", ")},{name:"location",label:"Location"},{name:"sourceName",label:"Source"},{name:"psaKey",label:"PSA ID"},{name:"dateLastAccess",label:"Last CloudRadial Access",template:f=>`${this.localizedShortPipe.transform(f.dateLastAccess)}`},{name:"groups",label:"Groups",template:f=>f.groups?.map(U=>U.groupName).join(", ")||""}]},className:"col-12"},{key:"isLoginDisabled",type:u.y.Checkbox,wrappers:[I.t.NoLabel],props:{label:"Log in disabled to this portal?",className:"text-bg-danger",wrapperCssClass:"mb-0"}},{key:"isShowInDirectory",type:u.y.Checkbox,wrappers:[I.t.NoLabel],props:{label:"Show in company directory?",wrapperCssClass:"mb-0"}},{key:"isCompliance",type:u.y.Checkbox,wrappers:[I.t.NoLabel],props:{label:"Show in compliance reports?"}},{wrappers:[I.t.FieldSet],props:{label:"Email Delivery"},fieldGroup:[{key:"isDigestOptIn",type:u.y.Checkbox,wrappers:[I.t.NoLabel],props:{label:"Enable Daily Digest delivery?",description:"User will receive up to one email daily with the latest message summaries."},expressions:{"props.disabled":"model.isLoginDisabled"}},{key:"isValidEmail",type:u.y.Checkbox,wrappers:[I.t.NoLabel],props:{label:"Is valid email?",description:"This will be unchecked on delivery errors."},expressions:{"props.disabled":"model.isLoginDisabled"}}],className:"col-12"}]}],this.ticketSettingsForm=new C.gE({}),this.ticketSettingsFields=[{fieldGroupClassName:"row",fieldGroup:[{key:"ticketPermissionOverride",type:u.y.Checkbox,wrappers:[I.t.NoLabel],props:{label:"Override Visible Tickets for this User?",description:"If checked, this will override ticket visibility set by this user's role assignments"},expressions:{defaultValue:()=>this.user?.ticketPermissionOverride||!1}},{key:"ticketPermission",type:u.y.Radio,defaultValue:Q.S.Personal,props:{label:"Visible Tickets",formCheck:"inline",options:this.utilityService.enumToArray(Q.S,!0,!1),valueProp:"id",labelProp:"name",description:"Users have visibility on these tickets."},resetOnHide:!1,className:"ms-4",expressions:{hide:()=>!this.ticketSettingsForm.get("ticketPermissionOverride")?.value}},{wrappers:[I.t.FieldSet],props:{label:"Advanced Settings",collapsed:!0},fieldGroup:[{key:"ticketStatusOverrideArray",type:u.y.TagInput,props:{label:"Ticket Status Overrides",placeholder:"+ Status",description:"Users are restricted to viewing tickets with these statuses. Leave blank for existing statuses."}},{key:"ticketBoardOverrideArray",type:u.y.TagInput,props:{label:"Ticket Board Overrides",placeholder:"+ Board",description:"Users are restricted to viewing tickets in these boards. Leave blank for existing boards."},resetOnHide:!1,expressions:{hide:()=>{const f=this.userService.UserProfile.partner.psaType;if(f===a.r_.ConnectWise||f===a.r_.Autotask||f===a.r_.Kaseya_BMS||f===a.r_.Halo)return!1}}}]}],className:"col-12"}],this.roleAssignmentsColumns=[],this.roleForm=new C.gE({}),this.roleModel={role:""},this.showRoleForm=!1,this.roleField={key:"role",type:u.y.Select,props:{label:"Role",required:!0,options:[]},hooks:{onInit:f=>{this.roleService.getAssignableRoles(this.moduleType).subscribe(U=>{const je=this.getFilteredAssignableRoles(U);f.props.options=[{label:"Select a Role",value:null,disabled:!0},...je.map(ne=>({label:ne.name,value:ne.id}))]})}}}}ngOnInit(){this.userPermissionsService.checkPermission$(a.aX.Read,a.nR.SecurityControl
1s_Impersonate_User).subscribe(s=>{this.hasImpersonateUserPermission=!this.desktopHelper.isDesktopApp()&&s}),this.hasEditPermissionByCompany=this.userPermissionsService.hasPermissionByScope(this.userPermissionsService.userPermissions,this.moduleType,a.aX.Edit,this.user.companyId),this.hasDeletePermissionByCompany=this.userPermissionsService.hasPermissionByScope(this.userPermissionsService.userPermissions,this.moduleType,a.aX.Delete,this.user.companyId),this.user?.id&&(this.getUser(),this.initializeRoleAssignmentsColumns())}getUser(){this.usersService.getUser(this.user.id).pipe((0,w.n)(s=>{if(this.user=s,this.userForm)try{this.userForm.patchValue(this.user)}catch{}this.mixpanelService.trackEvent(J.N.UserView,{Subject:this.user.email}),this.user.isPriority=this.user.priorityStatus==O.c.Priority,this.populateUserNames(this.user),this.initializeRoleAssignmentsColumns();const t=new h.Yj;return t.filters="source^companyId",t.conditions="eq^eq",t.values="1^"+this.user.companyId.toString(),(0,ae.p)({licenses:this.dataBaseService.get(t,"/api/license/all")})})).subscribe({next:s=>{this.allLicenses=s.licenses.data}})}initializeRoleAssignmentsColumns(){const s=this.user?.roleAssignments?.length>1;this.roleAssignmentsColumns=[new m.H({field:"roleName",title:"Role"}),new m.H({field:"scope",title:"Scope"}),new m.H({field:"attribution",title:"Attribution"}),new m.H({title:"",width:100,iconClass:"fal fa-times fa-2x text-danger",columnType:y.$.Command,class:"text-center d-flex justify-content-center align-items-center",hidden:!s||!this.hasDeletePermissionByCompany,visible:t=>!this.isInheritedRoleAssignment(t),command:t=>{this.isInheritedRoleAssignment(t)?this.browserutils.pushErrorToast("Cannot delete inherited role assignments"):this.deleteRoleAssignment(t.id)}})]}addRoleAssignment(){this.roleForm.valid&&this.roleAssignmentsService.saveRoleAssignments([{roleId:this.roleModel.role,companyId:this.user.companyId,userId:this.user.id}]).subscribe({next:()=>{this.browserutils.openToast("Role assignment added successfully.","Done!",h.Rm.success),this.toggleRoleForm(),this.getUser()},error:t=>{this.browserutils.pushErrorToast(t.error?.error?.[0]||"Failed to delete role assignment"),console.error("Error saving role assignments:",t)}})}deleteRoleAssignment(s){this.confirmService.activate("Are you sure you want to delete this role assignment?","Confirmation","Delete","Cancel").then(t=>{t===E.x.OK&&(this.slimLoading.start(),this.roleAssignmentsService.deleteRoleAssignments([Number(s)],this.moduleType).pipe((0,d.j)(()=>this.slimLoading.complete())).subscribe({next:()=>{this.browserutils.openToast("Role assignment deleted successfully","Success",h.Rm.success),this.getUser()},error:i=>{this.browserutils.pushErrorToast(i.error?.error?.[0]||"Failed to delete role assignment")}}))})}changeTab(s){this.currentTab=this.tabs[s]}toggleRoleForm(){this.showRoleForm=!this.showRoleForm}excludeUser(){this.confirmService.activate(`Are you sure you want to delete and exclude "${this.user.displayName}"?`,"Confirmation","OK","Cancel","This will remove this user from future syncs with Microsoft 365 and your PSA and it will also delete enrollments or other related information.").then(s=>{s==E.x.OK&&(this.slimLoading.start(),this.dataService.post("/api/partner/users/exclude",{id:this.user.id,companyId:this.user.companyId}).pipe((0,d.j)(()=>this.slimLoading.complete())).subscribe({next:()=>{this.close(this.user),this.browserutils.openToast("User successfully deleted and excluded from future syncs.","Done!",h.Rm.success)},error:t=>{this.browserutils.pushErrorToast(t.error.error[0])}}))})}impersonate(s){if(this.user.isLoginDisabled)return this.browserutils.pushErrorToast("This user has portal log in disabled."),!1;const t=new h.Yj;return t.filters="id",t.conditions="eq^",t.values=this.user.id.toString(),this.slimLoading.start(),this.userService.impersonateUser(t,s).subscribe(),!1}openEntityEventsBlade(){this.user&&this.auditTrailService.displayEvents(x.F.ApplicationUser,this.user.id)}submit(){this.userForm.valid&&(this.slimLoading.start(),this.usersService.saveUser(this.user).pipe((0,d.j)(()=>this.slimLoading.complete())).subscribe({next:()=>{this.close(this.user),this.browserutils.openToast("User successfully updated.","Done!",h.Rm.success)}}))}dismiss(){this.activeOffcanvas.dismiss()}close(s){this.activeOffcanvas.close(s)}populateUserNames(s){if(!s.firstName&&s.displayName){const t=s.displayName.split(" ");t.length>0&&(s.firstName=t[0],t.length>1&&(s.lastName=t[t.length-1]))}}isInheritedRoleAssignment(s){return s?.attribution?.toLowerCase().includes("inherited from")??!1}getFilteredAssignableRoles(s){let t=s.filter(i=>!i.isPartner);if(this.user?.roleAssignments?.length){const i=this.user.roleAssignments.map(c=>({roleId:c.roleId,companyId:c.companyId,scope:c.scope}));t=t.filter(c=>{const b=i.some(A=>A.roleId===c.id&&A.companyId===this.user.companyId),R=i.some(A=>A.roleId===c.id&&"Partner"===A.scope);return!b&&!R})}return t}static{this.\u0275fac=function(t){return new(t||o)(e.rXU(B.u),e.rXU(h.jK),e.rXU(Z.KO),e.rXU(E.G),e.rXU(q.DI),e.rXU(h.bl),e.rXU(le.L),e.rXU(j),e.rXU(h.DL),e.rXU(ee.N),e.rXU(de.Q),e.rXU(ue.e),e.rXU(z.sT),e.rXU(h.WK),e.rXU(se.e),e.rXU(J.U))}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["app-user-details"]],hostAttrs:[1,"blade-host"],inputs:{user:"user",moduleType:"moduleType"},standalone:!0,features:[e.Jv_([z.sT]),e.aNF],decls:22,vars:14,consts:[[1,"blade"],[1,"header"],[1,"title"],["notranslate","","size","36","initialsSize","2",3,"src","value","textSizeRatio"],[1,"ms-3"],[1,"commands"],["title","Close",1,"pageHeaderButton",3,"click"],[1,"fal","fa-times"],[1,"body"],["id","userForm",3,"ngSubmit","formGroup"],[1,"d-flex","justify-content-between"],[3,"model","field","allLicenses","disabled"],[3,"form","fields","model"],[1,"footer"],["form","userForm",3,"type","label","moduleType","permission","disabled"],["type","button",1,"btn","btn-secondary",3,"click"],[3,"click","title","icon","moduleType","permission"],[3,"click","title","icon","moduleType","feature","permission"],[1,"mb-3",3,"onChange"],[3,"tab"],[1,"button-tiles"],[1,"button-tiles",3,"click"],[1,"button-tiles-button","btn","btn-secondary"],[1,"warnText","fal","fa-cog","pe-2"],[3,"issuesList"],[3,"data","columns","pageable","scrollable","isFilterable"],[1,"mt-3"],["type","button",1,"btn","btn-link","p-0","d-flex","align-items-center",3,"click"],[1,"ms-2"],[1,"mt-2",3,"formGroup"],[3,"click","type","label","moduleType","permission","disabled"]],template:function(t,i){if(1&t&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2),e.DNE(3,be,1,3,"ngx-avatars",3),e.j41(4,"span",4),e.EFF(5),e.k0s()(),e.j41(6,"div",5),e.DNE(7,Ce,2,13),e.j41(8,"button",6),e.bIt("click",function(){return i.dismiss()}),e.nrm(9,"span",7),e.EFF(10,"Close "),e.k0s()()(),e.j41(11,"div",8)(12,"form",9),e.bIt("ngSubmit",function(){return i.submit()}),e.DNE(13,_e,5,1,"div",10)(14,Ee,2,4)(15,Pe,6,6)(16,Ie,1,4,"license-editor",11)(17,Ue,1,3,"formly-form",12),e.k0s()(),e.j41(18,"div",13),e.nrm(19,"rbac-button",14),e.j41(20,"button",15),e.bIt("click",function(){return i.dismiss()}),e.EFF(21," Close "),e.k0s()()()),2&t){let c,b;e.R7$(3),e.vxM(null!=i.user&&i.user.profileImageUrl||null!=i.user&&i.user.initials?3:-1),e.R7$(),e.BMQ("notranslate",null!=i.user&&i.user.displayName?"":null),e.R7$(),e.JRh(null!==(c=null==i.user?null:i.user.displayName)&&void 0!==c?c:"User"),e.R7$(2),e.vxM(null!=i.user&&i.user.id?7:-1),e.R7$(5),e.Y8G("formGroup",i.userForm),e.R7$(),e.vxM(null!=i.user&&i.user.id?13:-1),e.R7$(),e.vxM("user"===(b=i.currentTab.id)?14:"role-assignments"===b?15:"licenses"===b?16:"ticket-settings"===b?17:-1),e.R7$(5),e.HbH("btn btn-primary"),e.Y8G("type","submit")("label","Submit")("moduleType",i.moduleType)("permission","Edit")("disabled",i.userForm.invali
1d)}},dependencies:[P.MD,v.sb,pe.aF,C.qT,C.cb,fe,ye.W,C.j4,te.W,te.l,ie.S,ve.fw,l.G,r.I],encapsulation:2})}}return o})();var M=n(68188),ke=n(89999),Fe=n(48397),Ae=n(7288),xe=n(46196),Oe=n(12772);const Le=["emailModal"];function Ne(o,D){if(1&o){const s=e.RV6();e.j41(0,"div",1)(1,"rbac-button",12),e.bIt("click",function(){e.eBV(s);const i=e.XpG();return e.Njj(i.excludeMultiItem())}),e.k0s(),e.j41(2,"button",13),e.bIt("click",function(){e.eBV(s);const i=e.XpG();return e.Njj(i.emailMultiItem())}),e.nrm(3,"span",14),e.EFF(4,"Email "),e.k0s(),e.j41(5,"span",15),e.EFF(6," Use Ctrl+Click to select multiple items. "),e.k0s()()}if(2&o){const s=e.XpG();e.R7$(),e.HbH("pageHeaderButton"),e.Y8G("label","Exclude")("icon","fal fa-user-minus")("disabled",0==s.selectedKeys.length)("title","Delete items")("moduleType","Usage_Users")("permission","Delete"),e.R7$(),e.Y8G("disabled",0==s.selectedKeys.length)}}let Me=(()=>{class o{constructor(s,t,i,c,b,R,A,$,X,H,K,V,Y,W){this.slimLoading=s,this.usersService=t,this.userService=i,this.browserutils=c,this.confirmService=b,this.dataService=R,this.offcanvasService=A,this.userPermissionsService=$,this.toolbarservice=X,this.router=H,this.userSelectionService=K,this.desktopHelper=V,this.teamsService=Y,this.rolesService=W,this.controller=j.basePath,this.params=null,this.selectedKeys=[],this.roles=[],this.isOpeningUserDetails=!1,this.companySettings=null,this.sources=[{key:a.qS.Google,value:"Google"},{key:a.qS.IT_Provider,value:"IT Provider"},{key:a.qS.Log_In,value:"Login"},{key:a.qS.Manual,value:"Manual"},{key:a.qS.Office_365,value:"Microsoft 365"}],this.booleanFilterOptions=[{key:!0,value:"Yes"},{key:!1,value:"No"}],this.booleanClass=[{key:!0,value:"goodText"},{key:!1,value:"alertText"}],this.editAll=!1,this.isEmailEnabled=!1}ngOnInit(){this.initializeColumns(),this.fetchUserAndOpenDetails(),this.fetchCompanySettings(),this.fetchRoles(),this.setParams(),this.setToolbarItems()}ngAfterViewInit(){Promise.resolve().then(()=>this.tryInitializeGrid())}fetchRoles(){this.rolesService.getRoles().subscribe({next:s=>{s&&s.data&&(this.roles=s.data,this.tryInitializeGrid())},error:s=>{console.error("Error loading roles:",s)}})}fetchCompanySettings(){this.companySettings={isShowMFAStatus:this.userService.UserProfile.company.isMfa||!1},this.tryInitializeGrid()}tryInitializeGrid(){this.roles.length>0&&null!==this.companySettings&&(this.initializeColumns(),this.dataGrid?.rebind())}fetchUserAndOpenDetails(){this.userSelectionService.selectedUserId$.pipe((0,T.p)(s=>!!s),(0,oe.s)(1)).subscribe(s=>{this.isOpeningUserDetails=!0,this.loadAndEditUser(s),this.userSelectionService.clear()})}setParams(){const s=this.getModuleType();s&&(this.params={moduleType:s})}getModuleType(){switch(this.router.url){case"/app/admin/clients/users":return a.nR.Partner_Clients;case"/app/usage/users":return a.nR.Usage_Users}}setToolbarItems(){const s=this.getModuleType(),t={type:M.J.Button,text:"Download",tooltip:"Download all",class:"pageHeaderButton",icon:"fmd fm-ExcelDocument",click:()=>this.exportToExcel()},i={type:M.J.Button,text:"Sync",tooltip:"Sync users",class:"pageHeaderButton",icon:"fal fa-sync",click:()=>this.syncNow()},c={type:M.J.RBACButton,text:"Add",tooltip:"Add user",class:"pageHeaderButton",icon:"fal fa-plus",moduleType:a.nR.Usage_Users,permission:a.aX.Edit,click:()=>this.addUser()},b={type:M.J.RBACButton,text:()=>this.editAll?"Finish Edit":"Edit All",tooltip:()=>this.editAll?"Finish Edit":"Close editing",class:()=>this.editAll?"pageHeaderButton Finish":"pageHeaderButton warnText",icon:()=>this.editAll?"fal fa-pencil":"fal fa-pencil warnText",moduleType:a.nR.Usage_Users,permission:a.aX.Full,click:()=>this.toggleEditAll()};let R=[];switch(s){case a.nR.Partner_Clients:R=[t];break;case a.nR.Usage_Users:R=[i,t,c,b];break;default:R=[]}this.toolbarservice.setToolbarItems(R)}toggleEditAll(){this.editAll=!this.editAll,this.selectedKeys=[]}exportToExcel(){const s=`Users-${this.userService.UserProfile.partner.safeName}-${this.browserutils.currentDate()}.xlsx`;this.usersService.exportUsers(s,this.params)}initializeColumns(){this.columns=[new m.H({columnType:y.$.Icon,field:"priorityStatus",width:35,tooltip:"Priority",iconClass:s=>{if(s.priorityStatus===S.ci.Priority)return"fas fa-exclamation text-info"}}),new m.H({columnType:y.$.Template,field:"displayName",title:"User",filterType:_.R.String,template:s=>s.isLoginDisabled?`<span class="text-decoration-line-through text-muted">${s.displayName}</span>`:s.displayName}
1),new m.H({field:"id",width:40,class:"gridGraphic",columnType:y.$.Menu,menuItems:[new g.D({text:"Open",icon:"fal fa-user fa-fw",action:s=>this.editUser(s)}),new g.D({divider:!0,visible:()=>this.canImpersonate()}),new g.D({text:"Impersonate This User",icon:"fal fa-external-link fa-fw",action:s=>this.impersonate(s,"/app"),visible:()=>this.canImpersonate()}),new g.D({text:"Report a Problem",icon:"fal fa-life-ring fa-fw",action:s=>this.impersonate(s,"/app/service/report"),visible:()=>this.canImpersonate()}),new g.D({text:"Request Service",icon:"fal fa-life-ring fa-fw",action:s=>this.impersonate(s,"/app/service/request"),visible:()=>this.canImpersonate()}),new g.D({divider:!0,visible:s=>this.hasDeletePermissionByCompany(s.companyId)}),new g.D({text:"Add to Exclusions List",icon:"fal fa-user-minus fa-fw partnerIcon",action:s=>this.excludeUser(s),visible:s=>this.hasDeletePermissionByCompany(s.companyId)})]}),new m.H({field:"companyName",title:"Company",filterType:_.R.String,media:"md",hidden:this.getModuleType()===a.nR.Usage_Users}),new m.H({field:"email",title:"Email Address",filterType:_.R.String,media:"lg"}),new m.H({columnType:y.$.Template,field:"roleAssignments",title:"Roles",width:250,media:"xl",sortable:!1,template:s=>s.roleAssignments&&Array.isArray(s.roleAssignments)&&0!==s.roleAssignments.length?s.roleAssignments.filter(t=>t&&(t.roleName||t.scope)).map(t=>`<span class="role-name">${t.roleName||"Unknown Role"}</span> <span class="role-scope text-muted">[${t.scope||"Global"}]</span>`).join("<br>"):"",filterType:_.R.Dropdown,filterData:this.getRolesFilterData(),filterValueField:"key",filterTextField:"value"}),new m.H({columnType:y.$.Template,field:"isOfficeStrongAuthentication",title:"MFA",media:"xl",width:120,filterType:_.R.Dropdown,filterData:this.booleanFilterOptions,filterValueField:"key",filterTextField:"value",hidden:this.shouldHideMfaColumn(),template:s=>s.source===a.qS.Office_365?`<span class="${this.booleanClass.find(c=>c.key==s.isOfficeStrongAuthentication).value}">${this.booleanFilterOptions.find(c=>c.key==s.isOfficeStrongAuthentication).value}</span>`:"-"}),new m.H({columnType:y.$.Icon,field:"policyExceptions",title:"Policy Exceptions",media:"xl",width:150,filterType:_.R.Dropdown,filterData:this.booleanFilterOptions,filterValueField:"key",filterTextField:"value",iconClass:s=>{if(s.policyExceptions)return"fas fa-exclamation-triangle text-danger"}}),new m.H({columnType:y.$.Template,field:"source",title:"Source",width:160,media:"md",filterType:_.R.Dropdown,filterData:this.sources,filterValueField:"key",filterTextField:"value",template:s=>this.sources.find(i=>i.key===s.source)?.value}),new m.H({field:"psaKey",title:"PSA key",width:100,media:"(min-width: 1920px)",filterType:_.R.Numeric,showOperators:!1,defaultOperator:p.t.EqualTo,format:"#",spinners:!1}),new m.H({columnType:y.$.Template,field:"isDigestOptIn",title:"Email Daily Digest",media:"(min-width: 1920px)",width:150,filterType:_.R.Dropdown,filterData:this.booleanFilterOptions,filterValueField:"key",filterTextField:"value",template:s=>`<span class="${this.booleanClass.find(c=>c.key==s.isDigestOptIn).value}">${this.booleanFilterOptions.find(c=>c.key==s.isDigestOptIn).value}</span>`}),new m.H({field:"dateLastAccess",title:"Last Accessed",width:180,media:"(min-width: 1920px)",format:"MM/dd/yyyy",filterType:_.R.Date,defaultOperator:p.t.GreaterThanOrEqualTo,filterOperators:[p.t.GreaterThanOrEqualTo,p.t.LessThanOrEqualTo]})]}rebind(){this.dataGrid&&this.dataGrid.rebind()}excludeMultiItem(){return this.confirmService.activate("Are you sure you want to delete and exclude the checked users?","Confirmation","OK","Cancel","This will remove this user from future syncs with Microsoft 365 and your PSA and it will also delete enrollments or other related information.").then(s=>{s==E.x.OK&&(this.slimLoading.start(),this.dataService.post("/api/users/exclude",this.selectedKeys).subscribe(t=>{this.dataGrid.rebind(),this.slimLoading.complete(),this.browserutils.openToast("Users successfully deleted and excluded from future syncs.","Done!",h.Rm.success)}))}),!1}emailMultiItem(){return this.isEmailEnabled=!1,this.emailModal&&this.emailModal.show(),!1}submitEmailChange(){return this.closeEmailChange(),this.slimLoading.start(),this.dataService.post("/api/users/email",{enabled:+this.isEmailEnabled,userIds:this.selectedKeys}).subscribe(t=>{this.selectedKeys=[],this.dataGrid.rebind(),this.slimLoading.complete(),this.browserutils.openToast("Email settings have been updated for selected users.","Done!",h.Rm.success)}),!1}closeEmailChange(){this.emailModal&&this.emailModal.hide()}loadAndEditUser(s){this.usersService.getUser(s).subscribe({next:t=>{this.editUser(t)},complete:()=>{setTimeout(()=>{this.isOpeningUserDetails=!1},500)}})}editUser(s){const t=this.offcanvasService.open(re,{position:"end",backdrop:"static",panelClass:"w-50-responsive"});t.componentInstance.user=s,t.componentInstance.moduleType=this.params.moduleType,t.closed.subscribe({next:()=>{this.rebind()}})}addUser(){const s=this.offcanvasService.open(re,{position:"end",backdrop:"static",panelClass:"w-50-responsive"});s.componentInstance.user={}
1,s.componentInstance.moduleType=this.params.moduleType,s.closed.subscribe({next:()=>{this.rebind()}})}impersonate(s,t="/app"){if(s.isLoginDisabled)return this.browserutils.pushErrorToast("This user has portal log in disabled."),!1;const i=new h.Yj;i.filters="id",i.conditions="eq^",i.values=s.id.toString(),this.userService.impersonateUser(i,t).subscribe()}excludeUser(s){return this.confirmService.activate(`Are you sure you want to delete and exclude "${s.displayName}"?`,"Confirmation","OK","Cancel","This will remove this user from future syncs with Microsoft 365 and your PSA and it will also delete enrollments or other related information.").then(t=>{t==E.x.OK&&(this.slimLoading.start(),this.dataService.post("/api/partner/users/exclude",{id:s.id,companyId:s.companyId}).pipe((0,d.j)(()=>this.slimLoading.complete())).subscribe({next:()=>{this.rebind(),this.browserutils.openToast("User successfully deleted and excluded from future syncs.","Done!",h.Rm.success)}}))}),!1}syncNow(){return this.confirmService.activate("Update your list from online email accounts? This will take a few minutes.").then(s=>{if(s==E.x.OK){this.slimLoading.start();const t=new h.Yj;t.filters="id",t.conditions="eq",t.values="0";const i=`/api/company/sync${t.queryString("")}`;this.dataService.get(i).subscribe(()=>{this.slimLoading.complete(),this.browserutils.openToast("A synchronization job has been scheduled.","Done!",h.Rm.success)})}}),!1}hasDeletePermissionByCompany(s){return this.userPermissionsService.checkPermission(a.aX.Delete,a.nR.Partner_Clients,s)||this.userPermissionsService.checkPermission(a.aX.Delete,a.nR.Usage_Users,s)}canImpersonate(){const s=this.desktopHelper.isDesktopApp(),t=this.teamsService.isInTeams(),i=this.userPermissionsService.checkPermission(a.aX.Read,a.nR.SecurityControls_Impersonate_User);return!(s||t)&&i}getRolesFilterData(){return this.roles&&this.roles.length?this.roles.filter(s=>s&&s.name).map(s=>({key:s.id,value:s.name})):[]}shouldHideMfaColumn(){return!!this.companySettings&&!this.companySettings.isShowMFAStatus}static{this.\u0275fac=function(t){return new(t||o)(e.rXU(Z.KO),e.rXU(j),e.rXU(h.DL),e.rXU(h.bl),e.rXU(E.G),e.rXU(B.u),e.rXU(q.RS),e.rXU(ee.N),e.rXU(ke.h),e.rXU(F.Ix),e.rXU(Fe.D),e.rXU(se.e),e.rXU(h.OI),e.rXU(Ae.P))}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["az-users-grid"]],viewQuery:function(t,i){if(1&t&&(e.GBs(r.I,5),e.GBs(Le,5)),2&t){let c;e.mGM(c=e.lsd())&&(i.dataGrid=c.first),e.mGM(c=e.lsd())&&(i.emailModal=c.first)}},hostAttrs:[1,"d-flex","flex-column","h-100"],standalone:!0,features:[e.aNF],decls:21,vars:14,consts:[["emailModal",""],[1,"row","row-cols-auto","align-items-center","border-bottom","p-2"],[1,"h-100","overflow-hidden",3,"selectedKeysChange","rowClick","controller","params","columns","autoBind","selectable","showSelectAll","selectedKeys"],[1,"app-modal-header"],[1,"app-modal-body"],[1,"groupList"],[1,"form-check"],["type","checkbox","id","isEmailEnabled","name","isEmailEnabled",1,"form-check-input",3,"ngModelChange","ngModel"],["for","isEmailEnabled",1,"form-check-label"],[1,"app-modal-footer"],[3,"click","label","moduleType","permission"],["id","cancelButton","type","button",1,"btn","btn-secondary",3,"click"],[3,"click","label","icon","disabled","title","moduleType","permission"],["title","Toggle email",1,"pageHeaderButton",3,"click","disabled"],[1,"fal","fa-envelope"],[1,"small",2,"margin-left","20px"]],template:function(t,i){if(1&t){const c=e.RV6();e.DNE(0,Ne,7,9,"div",1),e.j41(1,"az-data-grid",2),e.mxI("selectedKeysChange",function(R){return e.eBV(c),e.DH7(i.selectedKeys,R)||(i.selectedKeys=R),e.Njj(R)}),e.bIt("rowClick",function(R){return e.eBV(c),e.Njj(i.editUser(R))}),e.k0s(),e.j41(2,"app-modal",null,0)(4,"div",3),e.EFF(5,"Email"),e.k0s(),e.j41(6,"div",4)(7,"div")(8,"strong"),e.EFF(9,"Directions"),e.k0s(),e.nrm(10,"br"),e.EFF(11," Turn email distribution on or off for selected users. "),e.k0s(),e.j41(12,"div",5)(13,"div",6)(14,"input",7),e.mxI("ngModelChange",function(R){return e.eBV(c),e.DH7(i.isEmailEnabled,R)||(i.isEmailEnabled=R),e.Njj(R)}),e.k0s(),e.j41(15,"label",8),e.EFF(16," Is email enabled? "),e.k0s()()()(),e.j41(17,"div",9)(18,"rbac-button",10),e.bIt("click",function(){return e.eBV(c),e.Njj(i.submitEmailChange())}),e.k0s(),e.j41(19,"button",11),e.bIt("click",function(){return e.eBV(c),e.Njj(i.closeEmailChange())}),e.EFF(20," Cancel "),e.k0s()()()}2&t&&(e.vxM(i.editAll?0:-1),e.R7$(),e.Y8G("controller",i.controller)("params",i.params)("columns",i.columns)("autoBind",!1)("selectable",i.editAll)("showSelectAll",!0),e.R50("selectedKeys",i.selectedKeys),e.R7$(13),e.R50("ngModel",i.isEmailEnabled),e.R7$(4),e.HbH("btn btn-primary me-2"),e.Y8G("label","Submit")("moduleType","Usage_Users")("permission","Edit"))},dependencies:[P.MD,F.iI,l.G,C.Zm,C.BC,C.vS,xe.C3,r.I,v.sb,Oe.z,ie.S],encapsulation:2})}}return o}
1)()},4163:(L,k,n)=>{n.d(k,{ci:()=>F.c,Z9:()=>l,hB:()=>m});var m=function(v){return v[v.Partner=1]="Partner",v[v.CompanyGroup=2]="CompanyGroup",v[v.Company=3]="Company",v}(m||{}),l=function(v){return v[v.User=1]="User",v[v.UserGroup=2]="UserGroup",v}(l||{}),F=n(45673)},45673:(L,k,n)=>{n.d(k,{c:()=>m});var m=function(l){return l[l.None=0]="None",l[l.Priority=10]="Priority",l}(m||{})},15124:(L,k,n)=>{n.d(k,{e:()=>r});var m=n(68430),l=n(96354),F=n(14211),v=n(54438),h=n(73670),P=n(81127);let r=(()=>{class y{static{this.basePath="api/security/role-assignment"}constructor(a,S){this.dataService=a,this.userPermissionService=S}getRoleAssignments(){return this.dataService.get(y.basePath).pipe((0,l.T)(({data:a,total:S})=>({data:Array.isArray(a)?(0,m.nH)(a):a,total:S})))}hasPartnerScopeRoleAssignment(){return this.userPermissionService.checkPermissionForPartnerScope$(F.aX.Edit,F.nR.Partner_Security)}exportRoleAssignments(a){this.dataService.downloadFile(`${y.basePath}/export`,a)}deleteRoleAssignments(a,S){return this.dataService.post(`${y.basePath}/delete`,{ids:a,moduleType:S})}getScopes(a){return this.dataService.get(`${y.basePath}/scope?scopeType=${a}`)}getMembers(a,S,g,E){return this.dataService.get(`${y.basePath}/members?memberType=${a}&scopeType=${S}&scopeId=${g}&roleId=${E}`)}saveRoleAssignments(a){return this.dataService.post(`${y.basePath}/save`,a)}static{this.\u0275fac=function(S){return new(S||y)(v.KVO(h.u),v.KVO(P.N))}}static{this.\u0275prov=v.jDH({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})()},7288:(L,k,n)=>{n.d(k,{P:()=>E});var m=n(99437),l=n(18810),F=n(44668),v=n(96354),h=n(70980),P=n(3139),r=n(14211),y=n(78030),_=n(54438),a=n(73670),S=n(54397),g=n(22296);let E=(()=>{class T{static{this.oldBasePath="api/roles"}static{this.basePath="api/security/roles"}constructor(d,p,C){this.dataService=d,this.userService=p,this.featureFlagsService=C,this.clearRolesCache=()=>{this.roles$=void 0},this.newOrderOfFeatures=[r.nR.Partner,r.nR.Partner_Account,r.nR.Partner_Assessments,r.nR.Partner_Automations,r.nR.Partner_Clients,r.nR.Partner_Content,r.nR.Partner_Feedback,r.nR.Partner_Marketing,r.nR.Partner_Office365,r.nR.Partner_Planner,r.nR.Partner_Reports,r.nR.Partner_Settings,r.nR.Partner_Security,r.nR.Partner_Security_Sessions,r.nR.Partner_Security_AuditTrail,r.nR.SimplifiedSupport,r.nR.SimplifiedSupport_Home,r.nR.Company,r.nR.Company_Applications,r.nR.Company_Calendar,r.nR.Company_Directory,r.nR.Company_KnowledgeBase,r.nR.Company_Messages,r.nR.Support,r.nR.Support_Home,r.nR.Support_ChatHome,r.nR.Support_SearchHome,r.nR.Support_Office,r.nR.Support_Report,r.nR.Support_Request,r.nR.Support_Tickets,r.nR.University,r.nR.University_Courses,r.nR.University_Office,r.nR.University_Quickstarts,r.nR.Infrastructure,r.nR.Infrastructure_Domains,r.nR.Infrastructure_Endpoints,r.nR.Infrastructure_Networks,r.nR.Infrastructure_Servers,r.nR.Infrastructure_Software,r.nR.Usage,r.nR.Usage_Adoption,r.nR.Usage_Data,r.nR.Usage_Internet,r.nR.Usage_Licenses,r.nR.Usage_Users,r.nR.Usage_Voice,r.nR.Security,r.nR.Security_365Backup,r.nR.Security_Backup,r.nR.Security_Breaches,r.nR.Security_Email,r.nR.Security_Logins,r.nR.SecurityControls,r.nR.SecurityControls_Impersonate_User,r.nR.SecurityControls_Impersonate_Admin,r.nR.SecurityControls_Impersonate_AdminAllFeatures,r.nR.Compliance,r.nR.Compliance_Assessments,r.nR.Compliance_Policies,r.nR.Compliance_Reports,r.nR.Compliance_Training,r.nR.Alerting,r.nR.Alerting_Jobs,r.nR.Alerting_Log,r.nR.Account,r.nR.Account_Agreements,r.nR.Account_Dashboards,r.nR.Account_Feedback,r.nR.Account_Invoices,r.nR.Account_Planner,r.nR.Account_Projects,r.nR.Account_Quotes,r.nR.Account_Settings,r.nR.Account_Reports]}getRoles(){return this.roles$??=this.dataService.get(T.basePath).pipe((0,m.W)(d=>(this.roles$=void 0,(0,l.$)(()=>d))),(0,F.t)(1)),this.roles$}getRole(d){return this.dataService.get(`${T.basePath}/${d}`)}getRoleClaims(d){return this.dataService.get(`${T.oldBasePath}/${d}
1/claims`).pipe((0,v.T)(p=>{const C=this.filterInactiveFeatures(p);return this.orderRoleClaims(C)}))}getRoleClaimsByModule(d,p){return this.dataService.get(`${T.oldBasePath}/${p}/claims/${d}`).pipe((0,v.T)(C=>{const x=this.filterInactiveFeatures(C);return this.orderRoleClaims(x)}))}saveRole(d){return this.clearRolesCache(),this.dataService.post(T.basePath,d).pipe((0,h.j)(this.clearRolesCache))}copyRole(d,p){return this.clearRolesCache(),this.dataService.post(`${T.basePath}/copy`,{newRoleName:d,originalRoleId:p}).pipe((0,h.j)(this.clearRolesCache))}deleteRole(d){return this.clearRolesCache(),this.dataService.delete(`${T.basePath}/${d.id}`).pipe((0,h.j)(this.clearRolesCache))}exportRoles(d){this.dataService.downloadFile(`${T.basePath}/export`,d)}canAddRoles(d){switch(this.userService.UserProfile.partner.productVersion){case P.X.Portal365:return!1;case P.X.Starter:case P.X.Professional:return d<10;case P.X.Enterprise:return!0;default:return!1}}getCanAddRolesMessage(){let p;switch(this.userService.UserProfile.partner.productVersion){case P.X.Portal365:p="Professional";break;case P.X.Starter:p="Enterprise"}return`You have reached your limit for roles in this version. Please contact us at [email protected] to learn more about our ${p} version.`}filterInactiveFeatures(d){return d&&0!==d.length?d.filter(p=>{const C=this.mapModuleTypeToFeatureFlag(p.claimType);return!(C&&!this.featureFlagsService.isFeatureActive(C))}).map(p=>(p.roleClaims&&p.roleClaims.length>0&&(p.roleClaims=this.filterInactiveFeatures(p.roleClaims)),p)):d}mapModuleTypeToFeatureFlag(d){return{[r.nR.SimplifiedSupport]:y.g.SimplifiedClientPortal,[r.nR.SimplifiedSupport_Home]:y.g.SimplifiedClientPortal}[d]}orderRoleClaims(d){const p=C=>{const x=C.sort((u,I)=>{const O=this.newOrderOfFeatures.indexOf(u.claimType),w=this.newOrderOfFeatures.indexOf(I.claimType);return-1===O?1:-1===w?-1:O-w});return x.forEach(u=>{u.roleClaims&&u.roleClaims.length>0&&(u.roleClaims=p(u.roleClaims))}),x};return p(d)}static{this.\u0275fac=function(p){return new(p||T)(_.KVO(a.u),_.KVO(S.DL),_.KVO(g.fW))}}static{this.\u0275prov=_.jDH({token:T,factory:T.\u0275fac,providedIn:"root"})}}return T})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.