You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
124 KiB

"use strict";(self.webpackChunk_bitwarden_web_vault=self.webpackChunk_bitwarden_web_vault||[]).push([[848],{77259(e,i,t){t.d(i,{V:()=>m});var n=t(11217),o=t(26983),s=t(80191),r=t(68108),l=t(191),a=t(67553),c=t(35500),d=t(3633),h=t(50700),u=t(38020),p=t(39488),v=t(69855),g=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};function m(e){return(i,t)=>g(this,void 0,void 0,function*(){const g=(0,n.WQX)(o.Ix),m=(0,n.WQX)(a.PV),f=(0,n.WQX)(v.f),b=(0,n.WQX)(h.W),I=(0,n.WQX)(p.H),y=(0,n.WQX)(c.D),w=(0,n.WQX)(n.uvJ);null==(yield I.getLastSync())&&(yield I.fullSync(!1));const S=yield(0,r._)(y.activeAccount$.pipe(d.F6,(0,l.n)(e=>m.organizations$(e)),(0,u.Hc)(i.params.organizationId)));if(null==S)return g.createUrlTree(["/"]);if(!S.isOwner&&!S.enabled)return f.showToast({variant:"error",title:null,message:b.t("organizationIsDisabled")}),g.createUrlTree(["/"]);if(null==e)return!0;const C=(0,n.N4e)(w,()=>e(S)),$=(0,s.A)(C)?yield(0,r._)(C):yield Promise.resolve(C);if(!0!==$&&!1!==$)throw new Error("Permission callback did not resolve to a boolean.");if(!$){const e=t.root.queryParamMap.get("itemId")||t.root.queryParamMap.get("cipherId");return e?g.createUrlTree(["/vault"],{queryParams:{itemId:e}}):(f.showToast({variant:"error",title:null,message:b.t("accessDenied")}),(0,a.OV)(S)?g.createUrlTree(["/organizations",S.id]):g.createUrlTree(["/"]))}return!0})}},95661(e,i,t){t.d(i,{r:()=>d});var n=t(11217),o=t(26983),s=t(68108),r=t(69783),l=t(67553),a=t(35500),c=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};function d(e){return(i,t)=>c(this,void 0,void 0,function*(){const c=(0,n.WQX)(o.Ix),d=(0,n.WQX)(l.PV),h=(0,n.WQX)(a.D),u=yield(0,s._)(h.activeAccount$.pipe((0,r.T)(e=>null==e?void 0:e.id)));if(!u)return c.createUrlTree(["/"]);const p=yield(0,s._)(d.organizations$(u).pipe((0,r.T)(e=>e.find(e=>e.id===i.params.organizationId))));if(!p)return c.createUrlTree(["/"]);if(null!=e){let i=e(p);return"string"==typeof i&&(i=[i]),c.createUrlTree([t.url,...i])}return null!=p&&(0,l.OV)(p)?c.createUrlTree(["/organizations",p.id]):c.createUrlTree(["/"])})}},16848(e,i,t){t.d(i,{OrganizationModule:()=>Go});var n,o=t(15639),s=t(55807),r=t(72932),l=t(81667),a=t(84522),c=t(31539),d=t(67553),h=t(63629),u=t(57768),p=t(14092),v=t(2195),g=t(86561),m=t(79303),f=t(77259),b=t(11217),I=t(24590),y=t(92128),w=t(26983),S=t(67789),C=t(87806),$=t(72135),T=t(61065),x=t(32782),A=t(83604),z=t(68108),M=t(69783),F=t(68711),G=t(16385),R=t(191),k=t(6933),X=t(34949),j=t(62423),V=t(5206),E=t(36219),D=t(4958),B=t(29236),W=t(14679),P=t(78510),U=t(14848),N=t(35500),Q=t(3633),q=t(48180),Y=t(82468),O=t(1601),_=t(50700),H=t(56962),L=t(37115),J=t(38020),Z=t(78781),K=t(54596),ee=t(5556),ie=t(54351),te=t(66983),ne=t(66316),oe=t(69855),se=t(90097),re=t(59525),le=t(36801),ae=t(84330),ce=t(1094),de=t(27760),he=t(25065),ue=t(85071),pe=t(93817),ve=t(45392),ge=t(62819),me=t(73366),fe=t(21571),be=t(88744),Ie=t(38766),ye=t(14041),we=t(44075),Se=t(84210),Ce=t(46758),$e=t(26657),Te=t(38620),xe=t(56898),Ae=t(7730),ze=t(45635),Me=t(67311),Fe=t(43184),Ge=t(25740),Re=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};function ke(e,i){if(1&e&&(ye.nrm(0,"bit-access-selector",9),ye.nI1(1,"i18n"),ye.nI1(2,"i18n"),ye.nI1(3,"i18n"),ye.nI1(4,"i18n")),2&e){const e=ye.XpG();ye.Y8G("permissionMode",e.PermissionMode.Edit)("items",e.accessItems)("columnHeader",ye.bMT(1,6,"groupSlashMemberColumnHeader"))("selectorLabelText",ye.bMT(2,8,"selectGroupsAndMembers"))("selectorHelpText",ye.bMT(3,10,"userPermissionOverrideHelperDesc"))("emptySelectionText",ye.bMT(4,12,"noMembersOrGroupsAdded"))}}function Xe(e,i){if(1&e&&(ye.nrm(0,"bit-access-selector",10),ye.nI1(1,"i18n"),ye.nI1(2,"i18n"),ye.nI1(3,"i18n")),2&e){const e=ye.XpG();ye.Y8G("permissionMode",e.PermissionMode.Edit)("items",e.accessItems)("columnHeader",ye.bMT(1,5,"memberColumnHeader"))("selectorLabelText",ye.bMT(2,7,"selectMembers"))("emptySelectionText",ye.bMT(3,9,"noMembersAdded"))}}!function(e){e.Saved="saved",e.Canceled="canceled"}(n||(n={}));class je{constructor(e,i,t,o,s,r,l,a,c,h,u,p){this.params=e,this.dialogRef=i,this.formBuilder=t,this.organizationService=o,this.accountService=s,this.groupService=r,this.organizationUserApiService=l,this.platformUtilsService=a,this.i18nService=c,this.collectionAdminService=h,this.toastService=u,this.configService=p,this.PermissionMode=Ie.ZC,this.formGroup=this.formBuilder.group({access:[[]]}),this.loading=!0,this.accessItems=[],this.destroy$=new C.B,this.submit=()=>Re(this,void 0,void 0,function*(){const e=this.formGroup.controls.access.value.filter(e=>e.type===Ie.Uv.Member).map(Ie.yo),i=this.formGroup.controls.access.value.filter(e=>e.type===Ie.Uv.Group).map(Ie.yo);yield this.collectionAdminService.bulkAssignAccess(this.organization.id,this.params.collections.map(e=>e.id),e,i);const t=(yield this.configService.getFeatureFlag(Y.TO.PM37785_VaultBatchBar))?this.i18nService.t(1===this.params.collections.length?"collectionEdited":"collectionsEdited"):this.i18nService.t("collectionsEdited");this.toastService.showToast({variant:"success",title:null,message:t}),yield this.dialogRef.close(n.Saved)}),this.numCollections=this.params.collections.length;const v=this.accountService.activeAccount$.pipe((0,R.n)(e=>this.organizationService.organizations$(null==e?void 0:e.id).pipe((0,d.Sw)(this.params.organizationId)))),g=v.pipe((0,R.n)(e=>e.useGroups?this.groupService.getAll(e.id):(0,A.of)([]))),m=this.accountService.activeAccount$.pipe(Q.F6,(0,R.n)(e=>this.collectionAdminService.collectionAdminViews$(this.params.organizationId,e)));(0,$.z)([v,g,this.organizationUserApiService.getAllMiniUserDetails(this.params.organizationId),m]).pipe((0,B.Q)(this.destroy$)).subscribe(([e,i,t,n])=>{this.organization=e,this.accessItems=[].concat(i.map(Ie.NU),t.data.map(Ie.df));const o=new Set(this.params.collections.map(e=>e.id)),s=n.filter(e=>o.has(e.id));this.formGroup.controls.access.setValue(function(e){if(0===e.length)return[];const[i,...t]=e.map(Ve);return t.every(e=>function(e,i){if(e.length!==i.length)return!1;const t=e=>`${e.type}:${e.id}:${e.permission}`,n=new Set(i.map(t));return e.every(e=>n.has(t(e)))}(i,e))?i:[]}(s)),this.loading=!1})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static open(e,i){return e.open(je,i)}}function Ve(e){return[].concat(e.groups.map(e=>({id:e.id,type:Ie.Uv.Group,permission:(0,Ie.Jh)(e)})),e.users.map(e=>({id:e.id,type:Ie.Uv.Member,permission:(0,Ie.Jh)(e)})))}je.ɵfac=function(e){return new(e||je)(ye.rXU(be.Qs),ye.rXU(we.ce),ye.rXU(Se.ok),ye.rXU(d.PV),ye.rXU(N.D),ye.rXU(l.nK),ye.rXU(fe.uB),ye.rXU(L.y),ye.rXU(_.W),ye.rXU(fe.vE),ye.rXU(oe.f),ye.rXU(O.w))},je.ɵcmp=ye.VBU({type:je,selectors:[["app-bulk-collections-dialog"]],decls:17,vars:18,consts:[["bit-dialog","","dialogSize","large",3,"formGroup","bitSubmit","loading"],["bitDialogTitle",""],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["bitDialogContent",""],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","selectorHelpText","emptySelectionText",4,"ngIf"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","emptySelectionText",4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","selectorHelpText","emptySelectionText"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","emptySelectionText"]],template:function(e,i){1&e&&(ye.j41(0,"form",0)(1,"span",1),ye.EFF(2),ye.nI1(3,"i18n"),ye.j41(4,"span",2),ye.EFF(5),ye.nI1(6,"i18n"),ye.k0s()(),ye.j41(7,"div",3),ye.DNE(8,ke,5,14,"bit-access-selector",4)(9,Xe,4,11,"bit-access-selector",5),ye.k0s(),ye.qex(10,6),ye.j41(11,"button",7),ye.EFF(12),ye.nI1(13,"i18n"),ye.k0s(),ye.j41(14,"button",8),ye.EFF(15),ye.nI1(16,"i18n"),ye.k0s(),ye.bVm(),ye.k0s()),2&e&&(ye.Y8G("formGroup",i.formGroup)("bitSubmit",i.submit)("loading",i.loading),ye.R7$(2),ye.SpI(" ",ye.bMT(3,10,"assignCollectionAccess")," "),ye.R7$(3),ye.Lme(" ",i.numCollections," ",ye.bMT(6,12,1==i.numCollections?"collection":"collections")," "),ye.R7$(3),ye.Y8G("ngIf",null==i.organization?null:i.organization.useGroups),ye.R7$(),ye.Y8G("ngIf",!(null!=i.organization&&i.organization.useGroups)),ye.R7$(3),ye.SpI(" ",ye.bMT(13,14,"save")," "),ye.R7$(3),ye.SpI(" ",ye.bMT(16,16,"cancel")," "))},dependencies:[he.G,Ce.bT,Se.qT,Se.BC,Se.cb,Se.j4,Se.JD,$e.$,Te.L,xe.Q,Ae.I,ze.m,Me.hJ,Ie.mH,Fe.t,Ge.$],encapsulation:2});var Ee=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};class De{constructor(){this.dialogService=(0,b.WQX)(ne.o)}open(e){return Ee(this,void 0,void 0,function*(){const i=je.open(this.dialogService,{data:e});return(yield(0,me.s)(i.closed))===n.Saved?ae.YA.Saved:ae.YA.Canceled})}}De.ɵfac=function(e){return new(e||De)},De.ɵprov=b.jDH({token:De,factory:De.ɵfac});var Be=t(82392);const We=Be.JW`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="5.52 2.62 110 110">
<path class="tw-fill-illustration-bg-secondary" d="M25.518 12.621c0-5.523 4.477-10 10-10h50c5.523 0 10 4.477 10 10v2.5h-70v-2.5Z"/>
<path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M85.518 5.121h-50a7.5 7.5 0 0 0-7.5 7.5h65a7.5 7.5 0 0 0-7.5-7.5Zm-50-2.5c-5.523 0-10 4.477-10 10v2.5h70v-2.5c0-5.523-4.477-10-10-10h-50Z" clip-rule="evenodd"/>
<path class="tw-fill-illustration-bg-primary" d="M15.518 22.621c0-5.523 4.477-10 10-10h70c5.523 0 10 4.477 10 10v2.5h-90v-2.5Z"/>
<path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M95.518 15.121h-70a7.5 7.5 0 0 0-7.5 7.5h85a7.5 7.5 0 0 0-7.5-7.5Zm-70-2.5c-5.523 0-10 4.477-10 10v2.5h90v-2.5c0-5.523-4.477-10-10-10h-70Z" clip-rule="evenodd"/>
<path class="tw-fill-illustration-bg-tertiary" d="M5.518 32.621c0-5.523 4.477-10 10-10h90c5.523 0 10 4.477 10 10v70c0 5.523-4.477 10-10 10h-90c-5.523 0-10-4.477-10-10v-70Z"/>
<path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M105.518 25.121h-90a7.5 7.5 0 0 0-7.5 7.5v70a7.5 7.5 0 0 0 7.5 7.5h90a7.5 7.5 0 0 0 7.5-7.5v-70a7.5 7.5 0 0 0-7.5-7.5Zm-90-2.5c-5.523 0-10 4.477-10 10v70c0 5.523 4.477 10 10 10h90c5.523 0 10-4.477 10-10v-70c0-5.523-4.477-10-10-10h-90Z" clip-rule="evenodd"/>
<path class="tw-fill-illustration-tertiary" d="M95.518 67.621c0 19.33-15.67 35-35 35s-35-15.67-35-35 15.67-35 35-35 35 15.67 35 35Z"/>
<path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60.518 100.121c17.95 0 32.5-14.55 32.5-32.5s-14.55-32.5-32.5-32.5-32.5 14.55-32.5 32.5 14.55 32.5 32.5 32.5Zm0 2.5c19.33 0 35-15.67 35-35s-15.67-35-35-35-35 15.67-35 35 15.67 35 35 35Z" clip-rule="evenodd"/>
<path class="tw-fill-illustration-bg-tertiary" d="m41.092 59.482-6.328 6.378a2.5 2.5 0 0 0 0 3.522l6.328 6.378a27.362 27.362 0 0 0 19.426 8.111 27.362 27.362 0 0 0 19.425-8.11l6.328-6.38a2.5 2.5 0 0 0 0-3.52l-6.328-6.379a27.362 27.362 0 0 0-19.425-8.11 27.362 27.362 0 0 0-19.426 8.11Z"/>
<path class="tw-fill-illustration-outline" fill-rule="evenodd" d="m42.867 61.243-6.328 6.378L42.867 74a24.862 24.862 0 0 0 17.65 7.371c6.617 0 12.967-2.65 17.652-7.371l6.327-6.379-6.327-6.378a24.862 24.862 0 0 0-17.651-7.372 24.862 24.862 0 0 0-17.651 7.372Zm-8.102 4.617 6.327-6.378a27.362 27.362 0 0 1 19.426-8.11 27.362 27.362 0 0 1 19.425 8.11l6.328 6.378a2.5 2.5 0 0 1 0 3.522l-6.328 6.378a27.362 27.362 0 0 1-19.425 8.111 27.362 27.362 0 0 1-19.426-8.11l-6.328-6.38a2.5 2.5 0 0 1 0-3.52Z" clip-rule="evenodd"/>
<path class="tw-fill-illustration-bg-primary" d="M71.768 67.621c0 6.213-5.037 11.25-11.25 11.25s-11.25-5.037-11.25-11.25 5.037-11.25 11.25-11.25 11.25 5.037 11.25 11.25Z"/>
<path class="tw-fill-illustration-bg-secondary" d="M68.018 67.621a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z"/>
<path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42.134 49.237a1.25 1.25 0 0 1 1.768 0l35 35a1.25 1.25 0 1 1-1.768 1.768l-35-35a1.25 1.25 0 0 1 0-1.768Z" clip-rule="evenodd"/>
</svg>
`;var Pe=t(29029),Ue=t(22690);function Ne(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"button",3),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG();return b.Njj(i.viewCollectionClicked.emit({readonly:!1,tab:i.collectionDialogTabType.Info}))}),ye.nrm(1,"i",4),ye.EFF(2),ye.nI1(3,"i18n"),ye.k0s()}2&e&&(ye.R7$(2),ye.SpI(" ",ye.bMT(3,1,"editCollection")," "))}function Qe(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"button",3),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG();return b.Njj(i.viewCollectionClicked.emit({readonly:!0,tab:i.collectionDialogTabType.Access}))}),ye.nrm(1,"i",5),ye.EFF(2),ye.nI1(3,"i18n"),ye.k0s()}2&e&&(ye.R7$(2),ye.SpI(" ",ye.bMT(3,1,"viewAccess")," "))}class qe{constructor(){this.icon=We,this.collectionDialogTabType=v._K,this.canEditCollection=!1,this.canViewCollectionInfo=!1,this.viewCollectionClicked=new b.bkB}}function Ye(e){if(null!=e.organizationId&&e.organizationId!==U.I_)return{organizationId:e.organizationId,collectionId:e.collectionId,type:e.type}}qe.ɵfac=function(e){return new(e||qe)},qe.ɵcmp=ye.VBU({type:qe,selectors:[["collection-access-restricted"]],inputs:{canEditCollection:"canEditCollection",canViewCollectionInfo:"canViewCollectionInfo"},outputs:{viewCollectionClicked:"viewCollectionClicked"},decls:6,vars:6,consts:[[1,"tw-mt-2","tw-block",3,"icon"],["slot","title",1,"tw-mt-4","tw-block"],["slot","button","bitButton","","buttonType","secondary","type","button",3,"click",4,"ngIf"],["slot","button","bitButton","","buttonType","secondary","type","button",3,"click"],["aria-hidden","true",1,"bwi","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-users"]],template:function(e,i){1&e&&(ye.j41(0,"bit-no-items",0)(1,"span",1),ye.EFF(2),ye.nI1(3,"i18n"),ye.k0s(),ye.DNE(4,Ne,4,3,"button",2)(5,Qe,4,3,"button",2),ye.k0s()),2&e&&(ye.Y8G("icon",i.icon),ye.R7$(2),ye.JRh(ye.bMT(3,4,"youDoNotHavePermissions")),ye.R7$(2),ye.Y8G("ngIf",i.canEditCollection),ye.R7$(),ye.Y8G("ngIf",!i.canEditCollection&&i.canViewCollectionInfo))},dependencies:[he.G,Ce.bT,xe.Q,Ue.D,Pe.t,re.s,Ge.$],encapsulation:2});var Oe=t(34530),_e=t(91461),He=t(23567);const Le=Object.freeze({All:0,AddAccess:1});class Je{}var Ze=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};class Ke extends Je{constructor(){super(),this.collectionAdminService=(0,b.WQX)(fe.vE),this.i18nService=(0,b.WQX)(_.W),this.searchService=(0,b.WQX)(ie.S),this.searchPipe=(0,b.WQX)(Oe.R),this.destroyRef=(0,b.WQX)(b.abz),this.organizationService=(0,b.WQX)(d.PV),this.accountService=(0,b.WQX)(N.D),this.routedVaultFilterService=(0,b.WQX)(ae.BR),this.route=(0,b.WQX)(w.nX),this._addAccessStatus$=new S.t(Le.All),this.addAccessStatus$=this._addAccessStatus$.asObservable(),this._reload$=new S.t(void 0);const e=this.accountService.activeAccount$.pipe(Q.F6),i=this.routedVaultFilterService.filter$.pipe((0,M.T)(e=>e.organizationId),(0,F.p)(e=>void 0!==e&&e!==U.I_),(0,G.F)()),t=(0,$.z)([i,e]).pipe((0,R.n)(([e,i])=>this.organizationService.organizations$(i).pipe((0,J.Hc)(e))),(0,F.p)(e=>null!=e),(0,k.t)({refCount:!0,bufferSize:1})),n=this.routedVaultFilterService.filter$,o=this.route.queryParams.pipe((0,M.T)(e=>e.search));this.allCollectionsWithoutUnassigned$=(0,$.z)([i,e,this._reload$]).pipe((0,R.n)(([e,i])=>this.collectionAdminService.collectionAdminViews$(e,i)),(0,k.t)({refCount:!0,bufferSize:1})),this.allCollections$=(0,$.z)([i,this.allCollectionsWithoutUnassigned$]).pipe((0,M.T)(([e,i])=>{const t=new U.nb({name:this.i18nService.t("unassigned"),id:U.I_,organizationId:e});return i.concat(t)})),this.nestedCollections$=this.allCollections$.pipe((0,M.T)(e=>(0,_e.mw)(e)),(0,k.t)({refCount:!0,bufferSize:1})),this.editableCollections$=(0,$.z)([this.allCollectionsWithoutUnassigned$,t]).pipe((0,M.T)(([e,i])=>i.canEditAllCiphers?e:e.filter(e=>e.assigned)),(0,k.t)({refCount:!0,bufferSize:1})),this.selectedCollection$=(0,$.z)([this.nestedCollections$,n]).pipe((0,F.p)(([e,i])=>null!=e&&null!=i),(0,M.T)(([e,i])=>{if(void 0!==i.collectionId&&i.collectionId!==ae.u8&&i.collectionId!==U.I_)return He.F.getTreeNodeObjectFromList(e,i.collectionId)}),(0,k.t)({refCount:!0,bufferSize:1})),this.showCollectionAccessRestricted$=(0,$.z)([n,this.selectedCollection$,t]).pipe((0,M.T)(([e,i,t])=>e.collectionId===U.I_&&!t.canEditUnassignedCiphers||!t.canEditAllCiphers&&null!=i&&!i.node.assigned),(0,k.t)({refCount:!0,bufferSize:1}));const s=(0,$.z)([this.nestedCollections$,n,o,this._addAccessStatus$,e,t]).pipe((0,F.p)(([e,i])=>null!=e&&null!=i),(0,j.H)(e=>Ze(this,[e],void 0,function*([e,i,t,n,,o]){var s;if(i.collectionId===U.I_||void 0===i.collectionId&&void 0!==i.type)return{collections:[],showAddAccessToggle:!1};let r=[];if(void 0===i.collectionId||i.collectionId===ae.u8)r=e;else{const t=He.F.getTreeNodeObjectFromList(e,i.collectionId);r=null!==(s=null==t?void 0:t.children)&&void 0!==s?s:[]}let l=[];if(yield this.searchService.isSearchable(t)){const e=(0,_e.eO)(r);l=this.searchPipe.transform(e,t,e=>e.name,e=>e.id)}else l=r.map(e=>e.node);const a=!o.allowAdminAccessToAllCollectionItems&&o.canEditUnmanagedCollections&&l.some(e=>e.unmanaged);return n===Le.AddAccess&&a&&(l=l.filter(e=>e.unmanaged)),{collections:l,showAddAccessToggle:a}})),(0,y.pQ)(this.destroyRef),(0,k.t)({refCount:!0,bufferSize:1}));this.collections$=s.pipe((0,M.T)(e=>e.collections)),this.showAddAccessToggle$=s.pipe((0,M.T)(e=>e.showAddAccessToggle))}setAddAccessStatus(e){this._addAccessStatus$.next(e)}reload(){this._reload$.next()}}Ke.ɵfac=function(e){return new(e||Ke)},Ke.ɵprov=b.jDH({token:Ke,factory:Ke.ɵfac});var ei=t(7751),ii=t(83516),ti=t(63098),ni=t(36501),oi=t(61325),si=t(11486),ri=t(9459),li=t(9083),ai=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};class ci{constructor(){this.cipherService=(0,b.WQX)(ee.p),this.passwordRepromptService=(0,b.WQX)(ae.qX),this.cipherFormConfigService=(0,b.WQX)(ae.hI),this.totpService=(0,b.WQX)(ti.R),this.eventCollectionService=(0,b.WQX)(ei.c_),this.dialogService=(0,b.WQX)(ne.o),this.toastService=(0,b.WQX)(oe.f),this.logService=(0,b.WQX)(H.K),this.accountService=(0,b.WQX)(N.D),this.messagingService=(0,b.WQX)(ii.U),this.platformUtilsService=(0,b.WQX)(L.y),this.router=(0,b.WQX)(w.Ix),this.i18nService=(0,b.WQX)(_.W),this.organizationService=(0,b.WQX)(d.PV),this.routedVaultFilterService=(0,b.WQX)(ae.BR),this.routedVaultFilterBridgeService=(0,b.WQX)(ae.aC),this.vaultCollectionService=(0,b.WQX)(Je),this.userId$=this.accountService.activeAccount$.pipe(Q.F6),this.filter$=this.routedVaultFilterService.filter$.pipe((0,M.T)(Ye),(0,F.p)(Boolean)),this.organizationId$=this.filter$.pipe((0,M.T)(e=>e.organizationId),(0,G.F)()),this.organization$=(0,$.z)([this.organizationId$,this.userId$]).pipe((0,R.n)(([e,i])=>this.organizationService.organizations$(i).pipe((0,J.Hc)(e))),(0,F.p)(e=>null!=e),(0,k.t)({refCount:!0,bufferSize:1})),this.activeFilter$=this.routedVaultFilterBridgeService.activeFilter$,this._refresh$=new C.B,this._navigate$=new C.B,this.refresh$=this._refresh$.asObservable(),this.navigate$=this._navigate$.asObservable(),this.restore=e=>ai(this,void 0,void 0,function*(){const i=yield(0,z._)(this.organization$);if(oi.n.isDeleted(e))if(i.permissions.editAnyCollection||e.edit||i.allowAdminAccessToAllCollectionItems){if(yield this.repromptCipher([e]))try{if(null==e.id||""===e.id)throw new Error("Cipher must have an Id to be restored");const t=yield(0,z._)(this.accountService.activeAccount$.pipe(Q.F6)),n=i.canEditAnyCollection||oi.n.isUnassigned(e);return yield this.cipherService.restoreWithServer(e.id,t,n),this.toastService.showToast({variant:"success",message:this.i18nService.t("restoredItem")}),void this.refresh()}catch(t){return void this.logService.error(t)}}else this.showMissingPermissionsError()})}get hasOpenDialog(){return null!=this.vaultItemDialogRef}refresh(){this._refresh$.next()}go(e,i){this._navigate$.next({queryParams:e,options:i})}editCipherAttachments(e){return ai(this,void 0,void 0,function*(){if(0!==e.reprompt&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void this.go({cipherId:null,itemId:null},this.configureRouterFocusToCipher(e.id));const i=yield(0,z._)(this.organization$);if(null==i.maxStorageGb||0===i.maxStorageGb)return void this.messagingService.send("upgradeOrganization",{organizationId:e.organizationId});const t=ae._A.open(this.dialogService,{cipherId:e.id,organizationId:e.organizationId,admin:!0}),n=yield(0,z._)(t.closed);(null==n?void 0:n.action)!==ae.NY.Removed&&(null==n?void 0:n.action)!==ae.NY.Uploaded||this.refresh()})}addCipher(e){return ai(this,void 0,void 0,function*(){const i=yield(0,z._)(this.activeFilter$),t=null!=e?e:i.cipherType,n=yield this.cipherFormConfigService.buildConfig("add",void 0,t),o=i.collectionId,s=yield(0,z._)(this.organization$);n.initialValues={organizationId:s.id,collectionIds:o?[o]:[]},yield this.openVaultItemDialog("form",n)})}editCipher(e,i){return ai(this,void 0,void 0,function*(){if(e&&0!==e.reprompt&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void this.go({cipherId:null,itemId:null},this.configureRouterFocusToCipher(e.id));const t=yield this.cipherFormConfigService.buildConfig(i?"clone":"edit",null==e?void 0:e.id);yield this.openVaultItemDialog("form",t,e)})}viewCipherById(e){return ai(this,void 0,void 0,function*(){if(!e)return;if(e&&0!==e.reprompt&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void this.go({cipherId:null,itemId:null,action:null},this.configureRouterFocusToCipher(e.id));const i=yield this.cipherFormConfigService.buildConfig("edit",e.id,e.type),t=yield(0,z._)(this.activeFilter$);yield this.openVaultItemDialog("view",i,e,t.collectionId)})}openVaultItemDialog(e,i,t,n){return ai(this,void 0,void 0,function*(){var t;this.vaultItemDialogRef=ae.VH.open(this.dialogService,{mode:e,formConfig:i,activeCollectionId:n,isAdminConsoleAction:!0,restore:this.restore});const o=yield(0,me.s)(this.vaultItemDialogRef.closed);this.vaultItemDialogRef=void 0,o!==ae.rd.Deleted&&o!==ae.rd.Saved||this.refresh(),o!==ae.rd.PremiumUpgrade&&this.go({cipherId:null,itemId:null,action:null},this.configureRouterFocusToCipher(null===(t=i.originalCipher)||void 0===t?void 0:t.id))})}cloneCipher(e){return ai(this,void 0,void 0,function*(){if(e.login.hasFido2Credentials){if(!(yield this.dialogService.openSimpleDialog({title:{key:"passkeyNotCopied"},content:{key:"passkeyNotCopiedAlert"},type:"info"})))return!1}yield this.editCipher(e,!0)})}bulkRestore(e){return ai(this,void 0,void 0,function*(){const i=yield(0,z._)(this.organization$);if(!i.permissions.editAnyCollection&&e.some(e=>!e.edit&&!i.allowAdminAccessToAllCollectionItems))return void this.showMissingPermissionsError();if(!(yield this.repromptCipher(e)))return;const t=[],n=[],o=yield(0,z._)(this.userId$);i.canEditAllCiphers?e.map(e=>{t.push(e.id)}):e.map(e=>{0===e.collectionIds.length?n.push(e.id):e.edit&&t.push(e.id)}),0!==n.length||0!==t.length?((n.length>0||t.length>0)&&(yield this.cipherService.restoreManyWithServer([...n,...t],o,i.id)),this.toastService.showToast({variant:"success",message:this.i18nService.t("restoredItems")}),this.refresh()):this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("nothingSelected")})})}deleteCipher(e){return ai(this,void 0,void 0,function*(){const i=yield(0,z._)(this.organization$);if(!e.edit&&!i.canEditAllCiphers)return this.showMissingPermissionsError(),!1;if(!(yield this.repromptCipher([e])))return!1;const t=e.isDeleted;if(!(yield this.dialogService.openSimpleDialog({title:{key:t?"permanentlyDeleteItem":"deleteItem"},content:{key:t?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"},type:"warning"})))return!1;try{const i=yield(0,z._)(this.accountService.activeAccount$.pipe(Q.F6));return yield this.deleteCipherWithServer(e.id,i,t,e.isUnassigned),this.toastService.showToast({variant:"success",message:this.i18nService.t(t?"permanentlyDeletedItem":"deletedItem")}),this.refresh(),!0}catch(n){return this.logService.error(n),!1}})}bulkDelete(e,i,t){return ai(this,void 0,void 0,function*(){if(!(yield this.repromptCipher(e)))return;const n=[],o=[];if(e.map(e=>{e.isUnassigned?n.push(e.id):o.push(e.id)}),0===e.length&&0===i.length)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("nothingSelected")});const s=yield(0,z._)(this.organization$),r=null==i||i.every(e=>e.canDelete(t));if(!(null==e||e.every(e=>e.edit)||s.canEditAllCiphers)||!r)return void this.showMissingPermissionsError();const l=yield(0,z._)(this.filter$),a=(0,li.Q0)(this.dialogService,{data:{permanent:"trash"===l.type,cipherIds:o,collections:i,organization:t,unassignedCiphers:n}});(yield(0,me.s)(a.closed))===ae.vA.Deleted&&this.refresh()})}copy(e,i){return ai(this,void 0,void 0,function*(){let t,n,o;if("username"===i)t="Username",n=e.login.username,o="username";else if("password"===i)t="Password",n=e.login.password,o="password";else{if("totp"!==i||null==e.login.totp)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("unexpectedError")});t="TOTP";n=(yield(0,z._)(this.totpService.getCode$(e.login.totp))).code,o="verificationCodeTotp"}this.passwordRepromptService.protectedFields().includes(t)&&!(yield this.repromptCipher([e]))||e.viewPassword&&null!=n&&(this.platformUtilsService.copyToClipboard(n,{window}),this.toastService.showToast({variant:"info",message:this.i18nService.t("valueCopied",this.i18nService.t(o))}),"password"===i?yield this.eventCollectionService.collect(ei.Bx.Cipher_ClientCopiedPassword,e.id):"totp"===i&&(yield this.eventCollectionService.collect(ei.Bx.Cipher_ClientCopiedHiddenField,e.id)))})}bulkAssignToCollections(e){return ai(this,void 0,void 0,function*(){var i;if(!(yield this.repromptCipher(e)))return;if(0===e.length)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("nothingSelected")});const t=yield(0,z._)(this.vaultCollectionService.editableCollections$),n=yield(0,z._)(this.organization$),o=yield(0,z._)(this.activeFilter$),s=ri.G.open(this.dialogService,{data:{ciphers:e,organizationId:n.id,availableCollections:t,activeCollection:null===(i=null==o?void 0:o.selectedCollectionNode)||void 0===i?void 0:i.node,isSingleCipherAdmin:1===e.length&&(n.canEditAllCiphers||e[0].isUnassigned)}});(yield(0,me.s)(s.closed))===ae.f$.Saved&&this.refresh()})}viewEvents(e){return ai(this,void 0,void 0,function*(){const i=yield(0,z._)(this.organization$);(0,si.l)(this.dialogService,{data:{name:e.name,organizationId:i.id,entityId:e.id,showUser:!0,entity:"cipher"}})})}deleteCipherWithServer(e,i,t,n){return ai(this,void 0,void 0,function*(){const o=(yield(0,z._)(this.organization$)).canEditAllCiphers||n;return t?this.cipherService.deleteWithServer(e,i,o):this.cipherService.softDeleteWithServer(e,i,o)})}repromptCipher(e){return ai(this,void 0,void 0,function*(){return!e.find(e=>e.reprompt!==ni.b.None)||(yield this.passwordRepromptService.showPasswordPrompt())})}configureRouterFocusToCipher(e){if(e)return{state:{focusAfterNav:`#cipher-btn-${e}`}}}showMissingPermissionsError(){this.toastService.showToast({variant:"error",message:this.i18nService.t("missingPermissions")})}}ci.ɵfac=function(e){return new(e||ci)},ci.ɵprov=b.jDH({token:ci,factory:ci.ɵfac});var di=t(12012),hi=t(10760),ui=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};class pi{constructor(){this.apiService=(0,b.WQX)(di.G),this.collectionService=(0,b.WQX)(fe.YD),this.cipherService=(0,b.WQX)(ee.p),this.dialogService=(0,b.WQX)(ne.o),this.toastService=(0,b.WQX)(oe.f),this.logService=(0,b.WQX)(H.K),this.i18nService=(0,b.WQX)(_.W),this.router=(0,b.WQX)(w.Ix),this.accountService=(0,b.WQX)(N.D),this.organizationService=(0,b.WQX)(d.PV),this.routedVaultFilterService=(0,b.WQX)(ae.BR),this.vaultCollectionService=(0,b.WQX)(Je),this.userId$=this.accountService.activeAccount$.pipe(Q.F6),this.filter$=this.routedVaultFilterService.filter$.pipe((0,M.T)(Ye),(0,F.p)(Boolean)),this.organizationId$=this.filter$.pipe((0,M.T)(e=>e.organizationId),(0,G.F)()),this.organization$=(0,$.z)([this.organizationId$,this.userId$]).pipe((0,R.n)(([e,i])=>this.organizationService.organizations$(i).pipe((0,J.Hc)(e))),(0,F.p)(e=>null!=e),(0,k.t)({refCount:!0,bufferSize:1})),this.selectedCollection$=this.vaultCollectionService.selectedCollection$,this.messageListener=(0,b.WQX)(hi.qk),this.destroyRef=(0,b.WQX)(b.abz),this._refresh$=new C.B,this.refresh$=this._refresh$.asObservable(),this.messageListener.allMessages$.pipe((0,F.p)(e=>"syncCompleted"===e.command&&!!e.successfully),(0,y.pQ)(this.destroyRef)).subscribe(()=>this._refresh$.next())}refresh(){this._refresh$.next()}addCollection(){return ui(this,void 0,void 0,function*(){const e=yield(0,z._)(this.organization$),i=yield(0,z._)(this.selectedCollection$),t=(0,v.jN)(this.dialogService,{data:{organizationId:e.id,parentCollectionId:null==i?void 0:i.node.id,limitNestedCollections:!e.canEditAnyCollection,isAdminConsoleActive:!0}}),n=yield(0,me.s)(t.closed);(null==n?void 0:n.action)!==v.RZ.Saved&&(null==n?void 0:n.action)!==v.RZ.Deleted||this.refresh()})}editCollection(e,i,t,n){return ui(this,void 0,void 0,function*(){var o,s;const r=yield(0,z._)(this.organization$),l=(0,v.jN)(this.dialogService,{data:{collectionId:e.id,organizationId:r.id,initialTab:i,readonly:t,isAddAccessCollection:e.unmanaged,limitNestedCollections:!r.canEditAnyCollection,isAdminConsoleActive:!0,initialPermission:n}}),a=yield(0,me.s)(l.closed);if((null==a?void 0:a.action)===v.RZ.Saved||(null==a?void 0:a.action)===v.RZ.Deleted){this.refresh();const i=yield(0,z._)(this.selectedCollection$);a.action===v.RZ.Deleted&&(null==i?void 0:i.node.id)===e.id&&this.router.navigate([],{queryParams:{collectionId:null!==(s=null===(o=i.parent)||void 0===o?void 0:o.node.id)&&void 0!==s?s:null},queryParamsHandling:"merge",replaceUrl:!0})}})}deleteCollection(e){return ui(this,void 0,void 0,function*(){var i,t;const n=yield(0,z._)(this.organization$),o=yield(0,z._)(this.userId$);if(!e.canDelete(n))return void this.showMissingPermissionsError();if(yield this.dialogService.openSimpleDialog({title:e.name,content:{key:"deleteCollectionConfirmation"},type:"warning"}))try{yield this.apiService.deleteCollection(n.id,e.id),yield this.collectionService.delete([e.id],o),this.toastService.showToast({variant:"success",message:this.i18nService.t("deletedCollectionId",e.name)}),yield this.cipherService.clear();const s=yield(0,z._)(this.selectedCollection$);(null==s?void 0:s.node.id)===e.id&&this.router.navigate([],{queryParams:{collectionId:null!==(t=null===(i=null==s?void 0:s.parent)||void 0===i?void 0:i.node.id)&&void 0!==t?t:null},queryParamsHandling:"merge",replaceUrl:!0}),this.refresh()}catch(s){this.logService.error(s)}})}bulkEditCollectionAccess(e,i){return ui(this,void 0,void 0,function*(){if(0===e.length)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("noCollectionsSelected")});if(e.some(e=>!e.canEdit(i)))return void this.showMissingPermissionsError();const t=yield(0,z._)(this.organization$),o=je.open(this.dialogService,{data:{collections:e,organizationId:t.id}});(yield(0,me.s)(o.closed))===n.Saved&&this.refresh()})}showMissingPermissionsError(){this.toastService.showToast({variant:"error",message:this.i18nService.t("missingPermissions")})}}pi.ɵfac=function(e){return new(e||pi)},pi.ɵprov=b.jDH({token:pi,factory:pi.ɵfac});var vi=t(60893),gi=t(18990),mi=t(39250),fi=t(31857),bi=t(74526),Ii=t(18499),yi=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};class wi extends ae.ug{constructor(e,i,t,n,o,s,r,l,a){super(e,i,t,n,o,s,r,l,a),this.destroy$=new C.B,this._collections=new mi.m(1),this.filteredCollections$=this._collections.asObservable(),this.collectionTree$=this.filteredCollections$.pipe((0,M.T)(e=>this.buildCollectionTree(e)))}reloadCollections(e){return yi(this,void 0,void 0,function*(){this._collections.next(e)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}wi.ɵfac=function(e){return new(e||wi)(b.KVO(d.PV),b.KVO(bi.k),b.KVO(ee.p),b.KVO(Ii.m),b.KVO(_.W),b.KVO(fi.v2),b.KVO(fe.YD),b.KVO(N.D),b.KVO(O.w))},wi.ɵprov=b.jDH({token:wi,factory:wi.ɵfac});class Si{}Si.ɵfac=function(e){return new(e||Si)},Si.ɵmod=ye.$C({type:Si}),Si.ɵinj=b.G2t({providers:[{provide:ae.cD,useClass:wi}],imports:[gi.m,vi.t]});var Ci=t(63477),$i=t(94735),Ti=t(64447),xi=t(81356),Ai=t(90647),zi=t(56615),Mi=t(13496),Fi=t(73848),Gi=t(78952),Ri=t(36288),ki=t(1576),Xi=t(88547),ji=t(49112),Vi=t(5520),Ei=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};const Di=()=>[],Bi=e=>({organizationId:e,collectionId:null}),Wi=e=>({collectionId:e});function Pi(e,i){if(1&e&&(ye.j41(0,"bit-breadcrumb",7),ye.EFF(1),ye.k0s()),2&e){const e=i.$implicit;ye.Y8G("route",ye.lJ4(3,Di))("queryParams",ye.eq3(4,Wi,e.id)),ye.R7$(),ye.SpI(" ",e.name," ")}}function Ui(e,i){if(1&e&&(ye.j41(0,"bit-breadcrumbs",2)(1,"bit-breadcrumb",6),ye.EFF(2),ye.j41(3,"span"),ye.EFF(4),ye.nI1(5,"i18n"),ye.nI1(6,"lowercase"),ye.k0s()(),ye.qex(7),ye.Z7z(8,Pi,2,6,"bit-breadcrumb",7,ye.fX1),ye.bVm(),ye.k0s()),2&e){const e=ye.XpG();ye.R7$(),ye.Y8G("route",ye.lJ4(8,Di))("queryParams",ye.eq3(9,Bi,e.organization().id)),ye.R7$(),ye.SpI(" ",e.organization().name," "),ye.R7$(2),ye.SpI(" ",ye.bMT(6,6,ye.bMT(5,4,"collections"))," "),ye.R7$(4),ye.Dyx(e.collections())}}function Ni(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"button",10),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG(2);return b.Njj(i.handleEditCollection(i.CollectionDialogTabType.Info,!1))}),ye.nrm(1,"i",11),ye.EFF(2),ye.nI1(3,"i18n"),ye.k0s(),ye.j41(4,"button",10),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG(2);return b.Njj(i.handleEditCollection(i.CollectionDialogTabType.Access,!1))}),ye.nrm(5,"i",12),ye.EFF(6),ye.nI1(7,"i18n"),ye.k0s()}2&e&&(ye.R7$(2),ye.SpI(" ",ye.bMT(3,2,"editInfo")," "),ye.R7$(4),ye.SpI(" ",ye.bMT(7,4,"access")," "))}function Qi(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"button",10),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG(2);return b.Njj(i.handleEditCollection(i.CollectionDialogTabType.Info,!0))}),ye.nrm(1,"i",11),ye.EFF(2),ye.nI1(3,"i18n"),ye.k0s(),ye.j41(4,"button",10),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG(2);return b.Njj(i.handleEditCollection(i.CollectionDialogTabType.Access,!0))}),ye.nrm(5,"i",12),ye.EFF(6),ye.nI1(7,"i18n"),ye.k0s()}2&e&&(ye.R7$(2),ye.SpI(" ",ye.bMT(3,2,"viewInfo")," "),ye.R7$(4),ye.SpI(" ",ye.bMT(7,4,"viewAccess")," "))}function qi(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"button",10),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG(2);return b.Njj(i.handleDeleteCollection())}),ye.j41(1,"span",13),ye.nrm(2,"i",14),ye.EFF(3),ye.nI1(4,"i18n"),ye.k0s()()}2&e&&(ye.R7$(3),ye.SpI(" ",ye.bMT(4,1,"delete")," "))}function Yi(e,i){if(1&e&&(ye.qex(0),ye.nrm(1,"button",8),ye.nI1(2,"i18n"),ye.j41(3,"bit-menu",null,0),ye.nVh(5,Ni,8,6),ye.nVh(6,Qi,8,6),ye.nVh(7,qi,5,3,"button",9),ye.k0s(),ye.bVm()),2&e){const e=ye.sdS(4),i=ye.XpG();ye.R7$(),ye.Y8G("bitMenuTriggerFor",e)("label",ye.bMT(2,5,"editCollection")),ye.R7$(4),ye.vxM(i.canEditCollection()?5:-1),ye.R7$(),ye.vxM(!i.canEditCollection()&&i.canViewCollectionInfo()?6:-1),ye.R7$(),ye.vxM(i.canDeleteCollection()?7:-1)}}function Oi(e,i){1&e&&(ye.j41(0,"small"),ye.nrm(1,"i",15),ye.nI1(2,"i18n"),ye.j41(3,"span",16),ye.EFF(4),ye.nI1(5,"i18n"),ye.k0s()()),2&e&&(ye.R7$(),ye.Y8G("title",ye.mNQ(ye.bMT(2,3,"loading"))),ye.R7$(3),ye.JRh(ye.bMT(5,5,"loading")))}function _i(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"bit-search",17),ye.nI1(1,"i18n"),ye.bIt("ngModelChange",function(i){b.eBV(e);const t=ye.XpG();return b.Njj(t.onSearchTextChanged(i))}),ye.k0s()}if(2&e){const e=ye.XpG();ye.Y8G("ngModel",e.searchText())("placeholder",ye.bMT(1,2,"searchCollection"))}}function Hi(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"div",5)(1,"vault-new-cipher-menu",18),ye.bIt("cipherAdded",function(i){b.eBV(e);const t=ye.XpG();return b.Njj(t.handleAddCipher(i))})("collectionAdded",function(){b.eBV(e);const i=ye.XpG();return b.Njj(i.handleAddCollection())})("onAddItemDialog",function(){b.eBV(e);const i=ye.XpG();return b.Njj(i.openAddItemDialog())}),ye.k0s()()}if(2&e){const e=ye.XpG();ye.R7$(),ye.Y8G("canCreateCipher",e.canCreateCipher())("canCreateCollection",e.canCreateCollection())}}class Li{constructor(){this.i18nService=(0,b.WQX)(_.W),this.dialogService=(0,b.WQX)(ne.o),this.collectionAdminService=(0,b.WQX)(fe.vE),this.router=(0,b.WQX)(w.Ix),this.accountService=(0,b.WQX)(N.D),this.All=ae.u8,this.Unassigned=U.I_,this.CollectionDialogTabType=v._K,this.CipherType=xi.gC,this.loading=(0,I.hFB)(!1),this.filter=I.hFB.required(),this.organization=I.hFB.required(),this.collection=(0,I.hFB)(void 0),this.searchText=(0,I.hFB)(""),this.addCipher=(0,I.CGW)(),this.addCollection=(0,I.CGW)(),this.editCollection=(0,I.CGW)(),this.deleteCollection=(0,I.CGW)(),this.searchTextChanged=(0,I.CGW)(),this.openAddItemDialogEvent=(0,I.CGW)(),this.title=(0,Ci.EW)(()=>{const e=this.i18nService.t("collections").toLowerCase(),i=this.collection();return null!=i?i.node.name:this.filter().collectionId===U.I_?this.i18nService.t("unassigned"):this.organization().name?`${this.organization().name} ${e}`:this.i18nService.t("collections")}),this.icon=(0,Ci.EW)(()=>void 0!==this.filter().collectionId?"bwi-collection-shared":""),this.showBreadcrumbs=(0,Ci.EW)(()=>void 0!==this.filter().collectionId&&this.filter().collectionId!==ae.u8),this.collections=(0,Ci.EW)(()=>{const e=this.collection();if(null==e)return[];const i=[e];let t=e;for(;null!=t.parent;)t=t.parent,i.push(t);return i.slice(1).reverse().map(e=>e.node)}),this.canEditCollection=(0,Ci.EW)(()=>{const e=this.collection();return void 0!==e&&e.node.canEdit(this.organization())}),this.canDeleteCollection=(0,Ci.EW)(()=>{const e=this.collection();return void 0!==e&&e.node.canDelete(this.organization())}),this.canViewCollectionInfo=(0,Ci.EW)(()=>{var e,i;return null!==(i=null===(e=this.collection())||void 0===e?void 0:e.node.canViewCollectionInfo(this.organization()))&&void 0!==i&&i}),this.canCreateCollection=(0,Ci.EW)(()=>{var e;return null===(e=this.organization())||void 0===e?void 0:e.canCreateNewCollections}),this.canCreateCipher=(0,Ci.EW)(()=>{const e=this.organization();return!((null==e?void 0:e.isProviderUser)&&!(null==e?void 0:e.isMember))})}showFreeOrgUpgradeDialog(){return Ei(this,void 0,void 0,function*(){const e=this.organization(),i={title:this.i18nService.t("upgradeOrganization"),content:this.i18nService.t(e.canEditSubscription?"freeOrgMaxCollectionReachedManageBilling":"freeOrgMaxCollectionReachedNoManageBilling",e.maxCollections),type:"primary"};e.canEditSubscription?i.acceptButtonText=this.i18nService.t("upgrade"):(i.acceptButtonText=this.i18nService.t("ok"),i.cancelButtonText=null);const t=this.dialogService.openSimpleDialogRef(i);(yield(0,z._)(t.closed))&&e.canEditSubscription&&(yield this.router.navigate(["/organizations",e.id,"billing","subscription"],{queryParams:{upgrade:!0}}))})}handleAddCipher(e){this.addCipher.emit(e)}openAddItemDialog(){this.openAddItemDialogEvent.emit()}handleAddCollection(){return Ei(this,void 0,void 0,function*(){const e=this.organization();if(e.productTierType===Ti.K_.Free){if((yield(0,z._)(this.accountService.activeAccount$.pipe(Q.F6,(0,R.n)(i=>this.collectionAdminService.collectionAdminViews$(e.id,i))))).length===e.maxCollections)return void(yield this.showFreeOrgUpgradeDialog())}this.addCollection.emit()})}handleEditCollection(e,i){return Ei(this,void 0,void 0,function*(){this.editCollection.emit({tab:e,readonly:i})})}handleDeleteCollection(){this.deleteCollection.emit()}onSearchTextChanged(e){this.searchTextChanged.emit(e)}}Li.ɵfac=function(e){return new(e||Li)},Li.ɵcmp=ye.VBU({type:Li,selectors:[["app-org-vault-header"]],inputs:{loading:[1,"loading"],filter:[1,"filter"],organization:[1,"organization"],collection:[1,"collection"],searchText:[1,"searchText"]},outputs:{addCipher:"addCipher",addCollection:"addCollection",editCollection:"editCollection",deleteCollection:"deleteCollection",searchTextChanged:"searchTextChanged",openAddItemDialogEvent:"openAddItemDialogEvent"},decls:7,vars:7,consts:[["editCollectionMenu",""],[3,"title","icon"],["slot","breadcrumbs","showTrailingArrow",""],["slot","title-suffix"],[1,"tw-grow",3,"ngModel","placeholder"],[1,"tw-shrink-0"],["queryParamsHandling","merge",3,"route","queryParams"],["icon","bwi-collection-shared","queryParamsHandling","merge",3,"route","queryParams"],["bitIconButton","bwi-angle-down","size","small","type","button",3,"bitMenuTriggerFor","label"],["type","button","bitMenuItem",""],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-users"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-grow",3,"ngModelChange","ngModel","placeholder"],[3,"cipherAdded","collectionAdded","onAddItemDialog","canCreateCipher","canCreateCollection"]],template:function(e,i){1&e&&(ye.j41(0,"app-header",1),ye.nVh(1,Ui,10,11,"bit-breadcrumbs",2),ye.qex(2,3),ye.nVh(3,Yi,8,7,"ng-container"),ye.nVh(4,Oi,6,7,"small"),ye.bVm(),ye.nVh(5,_i,2,4,"bit-search",4),ye.nVh(6,Hi,2,2,"div",5),ye.k0s()),2&e&&(ye.Y8G("title",i.title())("icon",i.icon()),ye.R7$(),ye.vxM(i.showBreadcrumbs()?1:-1),ye.R7$(2),ye.vxM(null!=i.collection()&&(i.canEditCollection()||i.canDeleteCollection()||i.canViewCollectionInfo())?3:-1),ye.R7$(),ye.vxM(i.loading()?4:-1),ye.R7$(),ye.vxM(i.organization().isProviderUser&&!i.organization().isMember?5:-1),ye.R7$(),ye.vxM("trash"!==i.filter().type&&i.filter().collectionId!==i.Unassigned?6:-1))},dependencies:[Ce.MD,Ai.M,Mi.Z,Fi.O,Gi.S,he.G,Se.BC,Se.vS,Ri.s,zi.V,ki.m,Xi.D,r.G,ji.f,vi.t,Vi.S,$i.p,ae.eG,s.o,Ce.GH,Ge.$],encapsulation:2,changeDetection:0});var Ji=t(66523),Zi=t(54471),Ki=t(49519),et=t(57178),it=t(49492),tt=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};function nt(e,i){1&e&&(ye.j41(0,"div",1),ye.nrm(1,"i",2),ye.k0s())}function ot(e,i){if(1&e&&(ye.j41(0,"div",9),ye.nrm(1,"app-filter-section",10),ye.k0s()),2&e){let e;const t=i.$implicit,n=ye.XpG(2);ye.R7$(),ye.Y8G("activeFilter",n.activeFilter())("section",t)("isCollectionFilter",t===(null==(e=n.filters())?null:e.collectionFilter))}}function st(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"div")(1,"div",3),ye.EFF(2),ye.nI1(3,"i18n"),ye.j41(4,"a",4),ye.nI1(5,"i18n"),ye.nrm(6,"i",5),ye.k0s()(),ye.j41(7,"div",6)(8,"div",7)(9,"bit-search",8),ye.nI1(10,"i18n"),ye.bIt("ngModelChange",function(i){b.eBV(e);const t=ye.XpG();return b.Njj(t.searchText.set(i))}),ye.k0s()(),ye.Z7z(11,ot,2,3,"div",9,ye.fX1),ye.k0s()()}if(2&e){const e=ye.XpG();ye.R7$(2),ye.SpI(" ",ye.bMT(3,6,"filters")," "),ye.R7$(2),ye.Y8G("appA11yTitle",ye.mNQ(ye.bMT(5,8,"learnMoreAboutSearchingYourVault"))),ye.R7$(5),ye.Y8G("placeholder",ye.mNQ(ye.bMT(10,10,e.searchPlaceholder)))("ngModel",e.searchText()),ye.R7$(2),ye.Dyx(e.filtersList())}}class rt{get searchPlaceholder(){var e;const i=this.activeFilter();return i.isDeleted?"searchTrash":i.cipherType===xi.gC.Login?"searchLogin":i.cipherType===xi.gC.Card?"searchCard":i.cipherType===xi.gC.BankAccount?"searchBankAccount":i.cipherType===xi.gC.Identity?"searchIdentity":i.cipherType===xi.gC.SecureNote?"searchSecureNote":i.cipherType===xi.gC.SshKey?"searchSshKey":i.cipherType===xi.gC.Passport?"searchPassport":i.cipherType===xi.gC.DriversLicense?"searchDriversLicense":(null===(e=i.selectedCollectionNode)||void 0===e?void 0:e.node)?"searchCollection":"searchVault"}constructor(){this.vaultFilterService=(0,b.WQX)(ae.cD),this.i18nService=(0,b.WQX)(_.W),this.accountService=(0,b.WQX)(N.D),this.restrictedItemTypesService=(0,b.WQX)(te.b),this.destroyRef=(0,b.WQX)(b.abz),this.activeFilter=(0,I.hFB)(new ae.$5),this.searchText=(0,I.geq)(""),this.organization=(0,I.hFB)(),this.ciphers$=(0,I.hFB)((0,A.of)([])),this.filters=(0,b.vPA)(void 0),this.isLoaded=(0,b.vPA)(!1),this.filtersList=(0,Ci.EW)(()=>{const e=this.filters();return e?Object.values(e):[]}),this.activeUserId$=this.accountService.activeAccount$.pipe(Q.F6),this.applyTypeFilter=e=>tt(this,void 0,void 0,function*(){const i=this.activeFilter();i.resetFilter(),i.selectedCipherTypeNode=e}),this.applyCollectionFilter=e=>tt(this,void 0,void 0,function*(){const i=this.activeFilter();i.resetFilter(),i.selectedCollectionNode=e}),(0,y.br)(this.organization).pipe((0,F.p)(e=>!!e),(0,R.n)(e=>tt(this,void 0,void 0,function*(){this.vaultFilterService.setOrganizationFilter(e);const i=yield this.buildAllFilters();return{filters:i,defaultCollectionNode:this.activeFilter().selectedCipherTypeNode?null:yield(0,z._)(i.collectionFilter.data$)}})),(0,y.pQ)(this.destroyRef)).subscribe(({filters:e,defaultCollectionNode:i})=>{this.filters.set(e),i&&(this.activeFilter().resetFilter(),this.activeFilter().selectedCollectionNode=i),this.isLoaded.set(!0)})}addCollectionFilter(){return tt(this,void 0,void 0,function*(){return this.removeCollapsibleCollection(),{data$:this.vaultFilterService.buildTypeTree({id:"AllCollections",name:"collections",type:"all",icon:"bwi-collection-shared"},[{id:"AllCollections",name:"Collections",type:"all",icon:"bwi-collection-shared"}]),header:{showHeader:!1,isSelectable:!0},action:this.applyCollectionFilter}})}addTypeFilter(){return tt(this,arguments,void 0,function*(e=[],i){const t={id:"AllItems",name:"allItems",type:"all"};return{data$:(0,$.z)([this.restrictedItemTypesService.restricted$,this.ciphers$(),this.vaultFilterService.cipherTypeFilters$]).pipe((0,M.T)(([t,n,o])=>{const s=t.filter(e=>0===e.allowViewOrgIds.length||!(null==n?void 0:n.some(t=>!t.deletedDate&&oi.n.getType(t)===e.cipherType&&(!!t.organizationId&&((!i||t.organizationId===i)&&e.allowViewOrgIds.includes((0,Ji.zw)(t.organizationId))))))).map(e=>e.cipherType),r=[...e,...s];return o.filter(e=>!r.includes(e.type))}),(0,R.n)(e=>this.vaultFilterService.buildTypeTree(t,e)),(0,G.F)(),(0,k.t)({bufferSize:1,refCount:!0})),header:{showHeader:!0,isSelectable:!0},action:this.applyTypeFilter}})}buildAllFilters(){return tt(this,void 0,void 0,function*(){var e;const i={};return i.typeFilter=yield this.addTypeFilter(["favorites"],null===(e=this.organization())||void 0===e?void 0:e.id),i.collectionFilter=yield this.addCollectionFilter(),i.trashFilter=yield this.addTrashFilter(),i})}addTrashFilter(){return tt(this,void 0,void 0,function*(){return{data$:this.vaultFilterService.buildTypeTree({id:"headTrash",name:"HeadTrash",type:"trash",icon:"bwi-trash"},[{id:"trash",name:this.i18nService.t("trash"),type:"trash",icon:"bwi-trash"}]),header:{showHeader:!1,isSelectable:!0},action:this.applyTypeFilter}})}removeCollapsibleCollection(){return tt(this,void 0,void 0,function*(){const e=yield(0,z._)(this.vaultFilterService.collapsedFilterNodes$);e.delete("AllCollections");const i=yield(0,z._)(this.activeUserId$);yield this.vaultFilterService.setCollapsedFilterNodes(e,i)})}}rt.ɵfac=function(e){return new(e||rt)},rt.ɵcmp=ye.VBU({type:rt,selectors:[["app-organization-vault-filter"]],inputs:{activeFilter:[1,"activeFilter"],searchText:[1,"searchText"],organization:[1,"organization"],ciphers$:[1,"ciphers$"]},outputs:{searchText:"searchTextChange"},standalone:!1,decls:3,vars:1,consts:[["data-testid","filters",1,"tw-border","tw-border-solid","tw-border-secondary-300","tw-rounded"],[1,"tw-text-center","tw-p-5"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin"],["data-testid","filters-header",1,"tw-bg-background-alt","tw-border-0","tw-border-b","tw-border-solid","tw-border-secondary-100","tw-rounded-t","tw-px-5","tw-py-2.5","tw-font-medium","tw-uppercase"],["bitLink","","href","https://bitwarden.com/help/searching-vault/","target","_blank","rel","noreferrer",1,"tw-float-right",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["data-testid","filters-body",1,"tw-p-5"],[1,"tw-mb-4"],["id","search","autocomplete","off","appAutofocus","",3,"ngModelChange","placeholder","ngModel"],[1,"filter"],[3,"activeFilter","section","isCollectionFilter"]],template:function(e,i){1&e&&(ye.j41(0,"div",0),ye.nVh(1,nt,2,0,"div",1)(2,st,13,12,"div"),ye.k0s()),2&e&&(ye.R7$(),ye.vxM(i.isLoaded()?2:1))},dependencies:[Se.BC,Se.vS,Zi.C,Ki.B,et.g,it.H,Vi.S,Ge.$],encapsulation:2,changeDetection:0});var lt=t(85523),at=t(44432),ct=t(12694),dt=t(16496),ht=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};const ut=["vaultItems"],pt=e=>[e],vt=()=>[];function gt(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"app-organization-free-trial-warning",8),ye.bIt("clicked",function(){b.eBV(e);const i=ye.XpG(2);return b.Njj(i.navigateToPaymentMethod())}),ye.k0s(),ye.nrm(1,"app-organization-reseller-renewal-warning",9)}if(2&e){ye.XpG(2);const e=ye.r8f(0);ye.Y8G("organization",e),ye.R7$(),ye.Y8G("organization",e)}}function mt(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"app-org-vault-header",10),ye.nI1(1,"async"),ye.bIt("addCipher",function(i){b.eBV(e);const t=ye.XpG(2);return b.Njj(t.addCipher(i))})("addCollection",function(){b.eBV(e);const i=ye.XpG(2);return b.Njj(i.addCollection())})("editCollection",function(i){b.eBV(e);const t=ye.XpG(2),n=ye.r8f(2);return b.Njj(t.editCollection(null==n?null:n.node,i.tab,i.readonly))})("deleteCollection",function(){b.eBV(e);const i=ye.XpG(2),t=ye.r8f(2);return b.Njj(i.deleteCollection(null==t?null:t.node))})("searchTextChanged",function(i){b.eBV(e);const t=ye.XpG(2);return b.Njj(t.filterSearchText(i))})("openAddItemDialogEvent",function(){b.eBV(e);const i=ye.XpG(2);return b.Njj(i.openAddItemDialog())}),ye.k0s()}if(2&e){const e=ye.XpG(2),i=ye.r8f(0),t=ye.r8f(2),n=ye.r8f(4),o=ye.r8f(6);ye.Y8G("filter",n)("loading",o)("organization",i)("collection",t)("searchText",ye.bMT(1,5,e.currentSearchText$))}}function ft(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"div",3)(1,"app-organization-vault-filter",11),ye.nI1(2,"async"),ye.bIt("searchTextChange",function(i){b.eBV(e);const t=ye.XpG(2);return b.Njj(t.filterSearchText(i))}),ye.k0s()()}if(2&e){const e=ye.XpG(2),i=ye.r8f(0);ye.R7$(),ye.Y8G("organization",i)("activeFilter",e.activeFilter())("searchText",ye.bMT(2,4,e.currentSearchText$))("ciphers$",e.allCiphers$)}}function bt(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"bit-toggle-group",12),ye.nI1(1,"async"),ye.nI1(2,"i18n"),ye.bIt("selectedChange",function(i){b.eBV(e);const t=ye.XpG(2);return b.Njj(t.addAccessToggle(i))}),ye.j41(3,"bit-toggle",13),ye.EFF(4),ye.nI1(5,"i18n"),ye.k0s(),ye.j41(6,"bit-toggle",13),ye.EFF(7),ye.nI1(8,"i18n"),ye.k0s()()}if(2&e){const e=ye.XpG(2);ye.Y8G("selected",ye.bMT(1,6,e.collectionService.addAccessStatus$))("label",ye.bMT(2,8,"addAccessFilter")),ye.R7$(3),ye.Y8G("value",0),ye.R7$(),ye.SpI(" ",ye.bMT(5,10,"all")," "),ye.R7$(2),ye.Y8G("value",1),ye.R7$(),ye.SpI(" ",ye.bMT(8,12,"addAccess")," ")}}function It(e,i){if(1&e&&(ye.j41(0,"bit-callout",5),ye.EFF(1),ye.k0s()),2&e){const e=ye.XpG(2);ye.R7$(),ye.SpI(" ",e.trashCleanupWarning," ")}}function yt(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"app-vault-items",14,0),ye.nI1(2,"async"),ye.nI1(3,"async"),ye.nI1(4,"async"),ye.nI1(5,"async"),ye.nI1(6,"async"),ye.bIt("onEvent",function(i){b.eBV(e);const t=ye.XpG(2);return b.Njj(t.onVaultItemsEvent(i))}),ye.k0s()}if(2&e){const e=ye.XpG(2),i=ye.r8f(0),t=ye.r8f(2),n=ye.r8f(4),o=ye.r8f(8);ye.Y8G("ciphers",ye.bMT(2,21,e.ciphers$))("collections",ye.bMT(3,23,e.collections$))("allCollections",ye.bMT(4,25,e.allCollections$))("allOrganizations",i?ye.eq3(31,pt,i):ye.lJ4(33,vt))("allGroups",ye.bMT(5,27,e.allGroups$))("disabled",o)("showOwner",!1)("showPermissionsColumn",!0)("showCollections",void 0!==n.type)("showGroups",(null==i?null:i.useGroups)&&(void 0===n.type&&void 0===n.collectionId||void 0!==n.collectionId))("showPremiumFeatures",null==i?null:i.useTotp)("showBulkMove",!1)("showBulkTrashOptions","trash"===n.type)("useEvents",null==i?null:i.canAccessEventLogs)("showAdminActions",!0)("showBulkEditCollectionAccess",!0)("showBulkAddToCollections",!0)("viewingOrgVault",!0)("addAccessStatus",ye.bMT(6,29,e.collectionService.addAccessStatus$))("addAccessToggle",e.showAddAccessToggle())("activeCollection",null==t?null:t.node)}}function wt(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"button",18),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG(4);return b.Njj(i.addCipher())}),ye.EFF(1),ye.nI1(2,"i18n"),ye.k0s()}if(2&e){const e=ye.XpG(4);ye.Y8G("buttonType",e.btnTextAddCreateFeatureFlag()?"secondary":"primary")("startIcon",e.btnTextAddCreateFeatureFlag()?null:"bwi-plus"),ye.R7$(),ye.SpI(" ",ye.bMT(2,3,e.btnTextAddCreateFeatureFlag()?"addItem":"newItem")," ")}}function St(e,i){if(1&e&&(ye.j41(0,"bit-no-items")(1,"span",16),ye.EFF(2),ye.nI1(3,"i18n"),ye.k0s(),ye.nVh(4,wt,3,5,"button",17),ye.k0s()),2&e){const e=ye.XpG(3),i=ye.r8f(0),t=ye.r8f(2),n=ye.r8f(4);ye.R7$(2),ye.JRh(ye.bMT(3,2,"noItemsInList")),ye.R7$(2),ye.vxM(n&&"trash"!==n.type&&n.collectionId!==e.Unassigned&&(!t||null!=t.node&&t.node.canEditItems(i))?4:-1)}}function Ct(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"collection-access-restricted",19),ye.bIt("viewCollectionClicked",function(i){b.eBV(e);const t=ye.XpG(3),n=ye.r8f(2);return b.Njj(t.editCollection(null==n?null:n.node,i.tab,i.readonly))}),ye.k0s()}if(2&e){ye.XpG(3);const e=ye.r8f(0),i=ye.r8f(2);ye.Y8G("canEditCollection",null==i||null==i.node?null:i.node.canEdit(e))("canViewCollectionInfo",null==i||null==i.node?null:i.node.canViewCollectionInfo(e))}}function $t(e,i){if(1&e&&ye.nVh(0,St,5,4,"bit-no-items")(1,Ct,1,2,"collection-access-restricted",15),2&e){ye.XpG();const e=ye.r8f(10);ye.vxM(e?1:0)}}function Tt(e,i){1&e&&(ye.j41(0,"div",7),ye.nrm(1,"i",20),ye.nI1(2,"i18n"),ye.j41(3,"span",21),ye.EFF(4),ye.nI1(5,"i18n"),ye.k0s()()),2&e&&(ye.R7$(),ye.Y8G("title",ye.mNQ(ye.bMT(2,3,"loading"))),ye.R7$(3),ye.JRh(ye.bMT(5,5,"loading")))}function xt(e,i){if(1&e&&(ye.nVh(0,gt,2,2),ye.nVh(1,mt,2,7,"app-org-vault-header",1),ye.j41(2,"div",2),ye.SS7(3),ye.nI1(4,"async"),ye.nVh(5,ft,3,6,"div",3),ye.j41(6,"div"),ye.nVh(7,bt,9,14,"bit-toggle-group",4),ye.nVh(8,It,2,1,"bit-callout",5),ye.nVh(9,yt,7,34,"app-vault-items",6),ye.SS7(10),ye.nI1(11,"async"),ye.nVh(12,$t,2,1),ye.nI1(13,"async"),ye.nVh(14,Tt,6,7,"div",7),ye.k0s()()),2&e){const e=ye.XpG(),i=ye.r8f(4),t=ye.r8f(6);ye.vxM(t?-1:0),ye.R7$(),ye.vxM(i?1:-1);const n=ye.bMT(4,10,e.hideVaultFilter$);ye.R7$(4),ye.vxM(n?-1:5),ye.R7$(),ye.HbH((n?"tw-w-full":"tw-w-3/4")+" tw-flex tw-flex-col tw-min-h-0 tw-px-2.5"),ye.R7$(),ye.vxM(e.showAddAccessToggle()&&e.activeFilter().selectedCollectionNode?7:-1),ye.R7$(),ye.vxM(e.activeFilter().isDeleted?8:-1),ye.R7$(),ye.vxM(i?9:-1),ye.R7$(),ye.bH3(ye.bMT(11,12,e.showCollectionAccessRestricted$)),ye.R7$(2),ye.vxM(!t&&ye.bMT(13,15,e.isEmpty$)?12:-1),ye.R7$(2),ye.vxM(t?14:-1)}}function At(e,i){1&e&&ye.nrm(0,"bit-vault-batch-action")}class zt{constructor(){this.route=(0,b.WQX)(w.nX),this.organizationService=(0,b.WQX)(d.PV),this.vaultFilterService=(0,b.WQX)(ae.cD),this.routedVaultFilterService=(0,b.WQX)(ae.BR),this.router=(0,b.WQX)(w.Ix),this.syncService=(0,b.WQX)(K.H),this.i18nService=(0,b.WQX)(_.W),this.platformUtilsService=(0,b.WQX)(L.y),this.cipherService=(0,b.WQX)(ee.p),this.searchService=(0,b.WQX)(ie.S),this.groupService=(0,b.WQX)(l.nK),this.logService=(0,b.WQX)(H.K),this.accountService=(0,b.WQX)(N.D),this.billingApiService=(0,b.WQX)(q.P),this.organizationWarningsService=(0,b.WQX)(de.S),this.restrictedItemTypesService=(0,b.WQX)(te.b),this.dialogService=(0,b.WQX)(ne.o),this.toastService=(0,b.WQX)(oe.f),this.collectionActions=(0,b.WQX)(pi),this.collectionService=(0,b.WQX)(Je),this.cipherActions=(0,b.WQX)(ci),this.vaultBatchBarService=(0,b.WQX)(ae.pG),this.configService=(0,b.WQX)(O.w),this.btnTextAddCreateFeatureFlag=(0,y.ot)(this.configService.getFeatureFlag$(Y.TO.PM32380_BtnTextAddCreate),{initialValue:!1}),this.vaultBatchBarFeatureFlag=(0,y.ot)(this.configService.getFeatureFlag$(Y.TO.PM37785_VaultBatchBar),{initialValue:!1}),this.Unassigned=U.I_,this.trashCleanupWarning=this.i18nService.t(this.platformUtilsService.isSelfHost()?"trashCleanupWarningSelfHosted":"trashCleanupWarning"),this.noItemIcon=P.a,this.processingEvent$=new S.t(!1),this.prevCipherId=(0,b.vPA)(void 0),this.userId$=this.accountService.activeAccount$.pipe(Q.F6),this.filter$=this.routedVaultFilterService.filter$.pipe((0,M.T)(Ye),(0,F.p)(Boolean)),this.searchText$=new C.B,this.refresh$=new C.B,this.isRefreshing$=new S.t(!0),this.destroy$=new C.B,this.vaultItemsComponent=(0,I.ebz)("vaultItems"),this.CollectionDialogTabType=v._K,this.organizationId$=this.filter$.pipe((0,M.T)(e=>e.organizationId),(0,G.F)()),this.currentSearchText$=this.route.queryParams.pipe((0,M.T)(e=>e.search)),this.organization$=(0,$.z)([this.organizationId$,this.userId$]).pipe((0,R.n)(([e,i])=>this.organizationService.organizations$(i).pipe((0,J.Hc)(e))),(0,F.p)(e=>null!=e),(0,k.t)({refCount:!0,bufferSize:1})),this.hideVaultFilter$=this.organization$.pipe((0,M.T)(e=>e.isProviderUser&&!e.isMember)),this.allCollections$=this.collectionService.allCollections$,this.collections$=this.collectionService.collections$,this.selectedCollection$=this.collectionService.selectedCollection$,this.showCollectionAccessRestricted$=this.collectionService.showCollectionAccessRestricted$,this.showAddAccessToggle=(0,y.ot)(this.collectionService.showAddAccessToggle$,{initialValue:!1}),this.allGroups$=this.organizationId$.pipe((0,R.n)(e=>this.groupService.getAll(e)),(0,k.t)({refCount:!0,bufferSize:1})),this.allCiphers$=this.refresh$.pipe((0,X.Z)(void 0),(0,R.n)(()=>(0,$.z)([this.organization$,this.restrictedItemTypesService.restricted$]).pipe((0,R.n)(e=>ht(this,[e],void 0,function*([e,i]){let t;return this.collectionService.setAddAccessStatus(Le.All),!e.isMember&&e.isProviderUser?[]:(e.canEditAllCiphers?(t=yield this.cipherService.getAllFromApiForOrganization(e.id),t.forEach(e=>{e.edit=!0,e.viewPassword=!0})):t=yield this.cipherService.getManyFromApiForOrganization(e.id),t=t.filter(e=>!this.restrictedItemTypesService.isCipherRestricted(e,i)),t)})))),(0,k.t)({refCount:!0,bufferSize:1})),this.ciphers$=(0,$.z)([this.allCiphers$,this.filter$,this.currentSearchText$,this.showCollectionAccessRestricted$,this.userId$,this.organizationId$]).pipe((0,F.p)(([e,i])=>null!=e&&null!=i),(0,j.H)(e=>ht(this,[e],void 0,function*([e,i,t,n,o,s]){if(void 0===i.collectionId&&void 0===i.type)return[];if(n)return[];const r=(0,ae.Jp)(i);if(yield this.searchService.isSearchable(t)){return(yield this.searchService.searchCiphers(o,s,t,e)).filter(r)}return e.filter(r)})),(0,k.t)({refCount:!0,bufferSize:1})),this.organization$.pipe((0,R.n)(e=>(0,T.h)(this.organizationWarningsService.showInactiveSubscriptionDialog$(e),this.organizationWarningsService.showSubscribeBeforeFreeTrialEndsDialog$(e))),(0,y.pQ)()).subscribe();const e=(0,x.y)([this.organization$,this.filter$,this.allCollections$,this.allGroups$,this.ciphers$,this.collections$,this.selectedCollection$,this.showCollectionAccessRestricted$]).pipe((0,M.T)(()=>!0),(0,X.Z)(!1),(0,V.s)(2),(0,k.t)({refCount:!0,bufferSize:1}));this.loading$=(0,$.z)([this.isRefreshing$,this.processingEvent$,e]).pipe((0,M.T)(([e,i,t])=>e||i||!t)),this.isEmpty$=(0,$.z)([this.ciphers$,this.collections$]).pipe((0,M.T)(([e,i])=>0===i.length&&0===(null==e?void 0:e.length))),this.activeFilter=(0,y.ot)(this.cipherActions.activeFilter$,{initialValue:new ae.$5})}ngOnInit(){return ht(this,void 0,void 0,function*(){const e=(0,$.z)([this.organization$,this.route.queryParams]).pipe((0,E.$)(),(0,R.n)(e=>ht(this,[e],void 0,function*([e]){e.canEditAnyCollection||(yield this.syncService.fullSync(!1))})),(0,D.W)(e=>(this.logService.error("Failed during firstSetup$:",e),(0,A.of)())),(0,k.t)({refCount:!0,bufferSize:1}));this.cipherActions.refresh$.pipe((0,B.Q)(this.destroy$)).subscribe(()=>this.refresh()),this.collectionActions.refresh$.pipe((0,B.Q)(this.destroy$)).subscribe(()=>this.refresh()),this.vaultBatchBarService.completed$.pipe((0,B.Q)(this.destroy$)).subscribe(()=>this.refresh()),(0,$.z)([this.organization$,this.allCollections$,this.ciphers$]).pipe((0,B.Q)(this.destroy$)).subscribe(([e,i,t])=>{this.vaultBatchBarService.setConfig({isOrgVault:!0,organization:e,allCollections:i,hasCiphers:t.length>0})}),this.cipherActions.navigate$.pipe((0,B.Q)(this.destroy$)).subscribe(({queryParams:e,options:i})=>this.go(e,i)),this.searchText$.pipe((0,W.B)(200),(0,B.Q)(this.destroy$)).subscribe(e=>this.router.navigate([],{queryParams:{search:Z.A.isNullOrEmpty(e)?null:e},queryParamsHandling:"merge",replaceUrl:!0,state:{focusAfterNav:!1}}));const i=this.allCiphers$.pipe((0,M.T)(e=>Object.fromEntries(e.map(e=>[e.id,e]))));e.pipe((0,R.n)(()=>(0,$.z)([this.route.queryParams,i])),(0,F.p)(()=>!this.cipherActions.hasOpenDialog),(0,R.n)(e=>ht(this,[e],void 0,function*([e,i]){const t=Mt(e);if(!t)return void this.prevCipherId.set(void 0);if(t===this.prevCipherId())return;this.prevCipherId.set(t);const n=i[t];if(n){let i=e.action;if("showFailedToDecrypt"==i)return ae.Tp.open(this.dialogService,{cipherIds:[t]}),void(yield this.router.navigate([],{queryParams:{itemId:null,cipherId:null,action:null},queryParamsHandling:"merge",replaceUrl:!0}));null==i&&(i="view"),"view"===i?yield this.cipherActions.viewCipherById(n):yield this.cipherActions.editCipher(n,!1)}else this.toastService.showToast({variant:"error",message:this.i18nService.t("unknownCipher")}),yield this.router.navigate([],{queryParams:{cipherId:null,itemId:null},queryParamsHandling:"merge"})})),(0,B.Q)(this.destroy$)).subscribe(),e.pipe((0,R.n)(()=>(0,$.z)([this.route.queryParams,this.organization$,this.allCiphers$])),(0,R.n)(e=>ht(this,[e],void 0,function*([e,i,t]){const n=e.viewEvents;if(!n)return;const o=t.find(e=>e.id===n);i.useEvents&&null!=o?yield this.cipherActions.viewEvents(o):(this.toastService.showToast({variant:"error",message:this.i18nService.t("unknownCipher")}),yield this.router.navigate([],{queryParams:{viewEvents:null},queryParamsHandling:"merge"}))})),(0,B.Q)(this.destroy$)).subscribe(),e.pipe((0,R.n)(()=>this.allCollections$),(0,B.Q)(this.destroy$)).subscribe(e=>{this.vaultFilterService.reloadCollections&&this.vaultFilterService.reloadCollections(e),this.isRefreshing$.next(!1)})})}navigateToPaymentMethod(){return ht(this,void 0,void 0,function*(){const e=yield(0,z._)(this.organizationId$);yield this.router.navigate(["organizations",`${e}`,"billing","payment-details"],{state:{launchPaymentModalAutomatically:!0}})})}addAccessToggle(e){this.collectionService.setAddAccessStatus(e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onVaultItemsEvent(e){return ht(this,void 0,void 0,function*(){this.processingEvent$.next(!0);try{const i=yield(0,z._)(this.organization$);switch(e.type){case"viewAttachments":yield this.cipherActions.editCipherAttachments(e.item);break;case"clone":yield this.cipherActions.cloneCipher(e.item);break;case"restore":1===e.items.length?yield this.cipherActions.restore(e.items[0]):yield this.cipherActions.bulkRestore(e.items);break;case"delete":{const t=e.items.filter(e=>void 0===e.collection).map(e=>e.cipher).filter(e=>null!=e),n=e.items.filter(e=>void 0===e.cipher).map(e=>e.collection).filter(e=>null!=e);1===t.length&&0===n.length?yield this.cipherActions.deleteCipher(t[0]):0===t.length&&1===n.length?yield this.collectionActions.deleteCollection(n[0]):yield this.cipherActions.bulkDelete(t,n,i);break}case"copyField":yield this.cipherActions.copy(e.item,e.field);break;case"editCollection":yield this.collectionActions.editCollection(e.item,v._K.Info,e.readonly);break;case"viewCollectionAccess":yield this.collectionActions.editCollection(e.item,v._K.Access,e.readonly,e.initialPermission);break;case"bulkEditCollectionAccess":yield this.collectionActions.bulkEditCollectionAccess(e.items,i);break;case"assignToCollections":yield this.cipherActions.bulkAssignToCollections(e.items);break;case"viewEvents":yield this.cipherActions.viewEvents(e.item);break;case"editCipher":yield this.cipherActions.editCipher(e.item)}}finally{this.processingEvent$.next(!1)}})}filterSearchText(e){this.searchText$.next(e)}openAddItemDialog(){return ht(this,void 0,void 0,function*(){var e;const i=yield(0,z._)(this.organization$),t=ae._J.open(this.dialogService,{canCreateFolder:!1,canCreateCollection:null!==(e=null==i?void 0:i.canCreateNewCollections)&&void 0!==e&&e,canCreateSshKey:!1}),n=yield(0,z._)(t.closed);n&&(n.result===ae.iJ.Cipher?yield this.cipherActions.addCipher(n.cipherType):n.result===ae.iJ.Collection&&(yield this.collectionActions.addCollection()))})}addCipher(e){return ht(this,void 0,void 0,function*(){yield this.cipherActions.addCipher(e)})}addCollection(){return ht(this,void 0,void 0,function*(){yield this.collectionActions.addCollection()})}editCollection(e,i,t){return ht(this,void 0,void 0,function*(){yield this.collectionActions.editCollection(e,i,t)})}deleteCollection(e){return ht(this,void 0,void 0,function*(){yield this.collectionActions.deleteCollection(e)})}refresh(){var e;this.isRefreshing$.next(!0),this.refresh$.next(),this.collectionService.reload(),null===(e=this.vaultItemsComponent())||void 0===e||e.clearSelection()}go(e=null,i){if(null==e){const i=this.activeFilter();e={type:i.cipherType,collectionId:i.collectionId,deleted:i.isDeleted||null}}this.router.navigate([],Object.assign({relativeTo:this.route,queryParams:e,queryParamsHandling:"merge",replaceUrl:!0},i))}}zt.ɵfac=function(e){return new(e||zt)},zt.ɵcmp=ye.VBU({type:zt,selectors:[["app-org-vault"]],viewQuery:function(e,i){1&e&&ye.wEZ(i.vaultItemsComponent,ut,5),2&e&&ye.NyB()},features:[ye.Jv_([ae.BR,ae.aC,{provide:ae.hI,useClass:ge.l},pi,{provide:Je,useClass:Ke},ci,ae.pG,(0,le.F)({provide:ae.nw,useClass:ue._,useAngularDecorators:!0}),(0,le.F)({provide:ae.iH,useClass:ve.d,useAngularDecorators:!0}),(0,le.F)({provide:ae.xl,useClass:De,useAngularDecorators:!0})])],decls:12,vars:17,consts:[["vaultItems",""],[3,"filter","loading","organization","collection","searchText"],[1,"tw-flex","tw-flex-row","tw-flex-1","-tw-mx-2.5"],[1,"tw-basis-1/4","tw-max-w-1/4","tw-px-2.5"],[1,"tw-self-start",3,"selected","label"],["type","warning"],[1,"tw-flex-1","tw-min-h-0",3,"ciphers","collections","allCollections","allOrganizations","allGroups","disabled","showOwner","showPermissionsColumn","showCollections","showGroups","showPremiumFeatures","showBulkMove","showBulkTrashOptions","useEvents","showAdminActions","showBulkEditCollectionAccess","showBulkAddToCollections","viewingOrgVault","addAccessStatus","addAccessToggle","activeCollection"],[1,"tw-mt-6","tw-flex","tw-h-full","tw-flex-col","tw-items-center","tw-justify-start"],[3,"clicked","organization"],[3,"organization"],[3,"addCipher","addCollection","editCollection","deleteCollection","searchTextChanged","openAddItemDialogEvent","filter","loading","organization","collection","searchText"],[3,"searchTextChange","organization","activeFilter","searchText","ciphers$"],[1,"tw-self-start",3,"selectedChange","selected","label"],[3,"value"],[1,"tw-flex-1","tw-min-h-0",3,"onEvent","ciphers","collections","allCollections","allOrganizations","allGroups","disabled","showOwner","showPermissionsColumn","showCollections","showGroups","showPremiumFeatures","showBulkMove","showBulkTrashOptions","useEvents","showAdminActions","showBulkEditCollectionAccess","showBulkAddToCollections","viewingOrgVault","addAccessStatus","addAccessToggle","activeCollection"],[3,"canEditCollection","canViewCollectionInfo"],["slot","title",1,"tw-mt-4","tw-block"],["slot","button","bitButton","","type","button",3,"buttonType","startIcon"],["slot","button","bitButton","","type","button",3,"click","buttonType","startIcon"],[3,"viewCollectionClicked","canEditCollection","canViewCollectionInfo"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,i){if(1&e&&(ye.SS7(0),ye.nI1(1,"async"),ye.SS7(2),ye.nI1(3,"async"),ye.SS7(4),ye.nI1(5,"async"),ye.SS7(6),ye.nI1(7,"async"),ye.SS7(8),ye.nI1(9,"async"),ye.nVh(10,xt,15,17),ye.nVh(11,At,1,0,"bit-vault-batch-action")),2&e){const e=ye.bH3(ye.bMT(1,2,i.organization$));ye.R7$(2),ye.bH3(ye.bMT(3,5,i.selectedCollection$)),ye.R7$(2),ye.bH3(ye.bMT(5,8,i.filter$)),ye.R7$(2),ye.bH3(ye.bMT(7,11,i.isRefreshing$)),ye.R7$(2),ye.bH3(ye.bMT(9,14,i.loading$)),ye.R7$(2),ye.vxM(e?10:-1),ye.R7$(),ye.vxM(i.vaultBatchBarFeatureFlag()?11:-1)}},dependencies:[Li,qe,Si,rt,pe.l,lt.W_,he.G,xe.Q,at.G,Ue.D,ct.H,dt.a,se.H,re.s,ce.zU,ce.hR,ae.Gh,Ce.Jj,Ge.$],encapsulation:2,changeDetection:0});const Mt=e=>e.itemId||e.cipherId,Ft=[{path:"",component:zt,data:{titleId:"vaults"},canActivate:[(0,f.V)(d.of)]}];class Gt{}Gt.ɵfac=function(e){return new(e||Gt)},Gt.ɵmod=ye.$C({type:Gt}),Gt.ɵinj=b.G2t({imports:[a.iI.forChild(Ft),a.iI]});class Rt{}Rt.ɵfac=function(e){return new(e||Rt)},Rt.ɵmod=ye.$C({type:Rt}),Rt.ɵinj=b.G2t({imports:[Gt,u.G,m.B,g.K,p.t,v.GW,zt]});var kt=t(95661),Xt=t(39722);const jt=Be.JW`
<svg version="1.1" viewBox="0 0 800 200" xmlns="http://www.w3.org/2000/svg">
<g class="tw-fill-fg-nav" clip-path="url(#admin-console-logo-clip)">
<path d="m457.16 129.39-11.407-36.49q-1.0783-3.3482-4.0292-15.209h-.454q-2.27 9.9313-3.9725 15.322l-11.747 36.377h-10.896l-16.968-62.197h9.8744q6.0158 23.438 9.137 35.696 3.178 12.258 3.632 16.514h.454q.62424-3.2347 1.9863-8.342 1.4188-5.1642 2.4402-8.1717l11.407-35.696h10.215l11.123 35.696q3.178 9.7611 4.313 16.401h.454q.227-2.043 1.1918-6.2993 1.0215-4.2562 11.861-45.797h9.7611l-17.195 62.197zm77.858 0-1.8727-8.8528h-.454q-4.6535 5.8455-9.3072 7.9451-4.5968 2.043-11.52 2.043-9.2503 0-14.528-4.767-5.221-4.767-5.221-13.563 0-18.841 30.134-19.749l10.555-.3405v-3.859q0-7.3209-3.178-10.783-3.1212-3.5185-10.045-3.5185-7.7748 0-17.592 4.767l-2.8943-7.207q4.5968-2.497 10.045-3.9158 5.5048-1.4187 11.009-1.4187 11.123 0 16.457 4.9373 5.3912 4.9373 5.3912 15.833v42.449zm-21.281-6.6399q8.7964 0 13.79-4.8238 5.0508-4.8238 5.0508-13.506v-5.6183l-9.4205.39725q-11.237.39725-16.231 3.5185-4.9372 3.0645-4.9372 9.5908 0 5.1075 3.0645 7.7748 3.1212 2.6672 8.6825 2.6672zm76.045-56.693q4.1428 0 7.4343.68101l-1.3053 8.7395q-3.859-.85122-6.8101-.85122-7.5476 0-12.939 6.1291-5.3345 6.1291-5.3345 15.266v33.369h-9.4205v-62.197h7.7748l1.0783 11.52h.454q3.4617-6.0721 8.3425-9.3636 4.8805-3.2915 10.726-3.2915zm59.077 54.991h-.51081q-6.526 9.4775-19.522 9.4775-12.201 0-19.011-8.342-6.7532-8.342-6.7532-23.721t6.8102-23.892q6.8101-8.5122 18.954-8.5122 12.655 0 19.408 9.1933h.73779l-.39725-4.4832-.22704-4.3697v-25.311h9.4205v88.301h-7.6615zm-18.841 1.589q9.6478 0 13.96-5.221 4.3697-5.2777 4.3697-16.968v-1.9863q0-13.223-4.4264-18.841-4.3698-5.675-14.017-5.675-8.2856 0-12.712 6.4696-4.3698 6.4127-4.3698 18.16 0 11.918 4.3698 17.99 4.3697 6.0721 12.825 6.0721zm74 7.8881q-13.79 0-21.792-8.3989-7.9451-8.3989-7.9451-23.324 0-15.039 7.3773-23.892 7.4343-8.8528 19.919-8.8528 11.69 0 18.501 7.7179 6.8101 7.6615 6.8101 20.26v5.9588h-42.846q.28376 10.953 5.5048 16.628 5.2777 5.675 14.812 5.675 10.045 0 19.863-4.1995v8.3989q-4.994 2.1565-9.4775 3.0645-4.4265.96478-10.726.96478zm-2.5537-56.58q-7.4912 0-11.975 4.8805-4.4265 4.8805-5.221 13.506h32.518q0-8.9097-3.9725-13.62-3.9725-4.767-11.35-4.767zm84.047 55.445v-40.236q0-7.6045-3.4617-11.35-3.4618-3.7455-10.839-3.7455-9.7611 0-14.301 5.2777t-4.54 17.422v32.631h-9.4205v-62.197h7.6615l1.5322 8.5122h.45403q2.8942-4.5968 8.1153-7.0937 5.221-2.5537 11.634-2.5537 11.237 0 16.912 5.448 5.675 5.3912 5.675 17.309v40.576z"/>
<path d="m213.24 129.39-3.3482-8.6261h-.454q-4.3697 5.5048-9.023 7.6615-4.5968 2.0998-12.031 2.0998-9.137 0-14.415-5.221-5.221-5.221-5.221-14.869 0-10.102 7.0368-14.869 7.0937-4.8238 21.338-5.3345l11.009-.3405v-2.7808q0-9.6478-9.8744-9.6478-7.6045 0-17.876 4.5968l-5.7318-11.69q10.953-5.7318 24.289-5.7318 12.769 0 19.579 5.5615 6.8102 5.5615 6.8102 16.912v42.279zm-5.1075-29.397-6.6962.227q-7.5476.227-11.237 2.724-3.6888 2.497-3.6888 7.6045 0 7.321 8.3989 7.321 6.0158 0 9.5908-3.4617 3.632-3.4617 3.632-9.1933zm79.962 29.397-2.3268-8.1153h-.908q-2.7808 4.4265-7.8881 6.8665-5.1075 2.3835-11.634 2.3835-11.18 0-16.855-5.9588-5.675-6.0158-5.675-17.252v-41.371h17.309v37.058q0 6.8665 2.4402 10.328 2.4402 3.405 7.7748 3.405 7.264 0 10.499-4.8238 3.2348-4.8805 3.2348-16.117v-29.85h17.309v63.447zm48.748 0h-17.309v-88.301h17.309zm44.889-12.655q4.54 0 10.896-1.9863v12.882q-6.4696 2.8943-15.89 2.8943-10.385 0-15.152-5.221-4.7103-5.2777-4.7103-15.776v-30.588h-8.2856v-7.321l9.5338-5.7885 4.994-13.393h11.066v13.506h17.763v12.996h-17.763v30.588q0 3.6887 2.043 5.448 2.0998 1.7592 5.5047 1.7592z"/>
<path d="m51.982 33.947-15.322.002 41.131 115.17h14.518l41.131-115.17h-15.162l-25.971 73.872c-1.7205 4.7315-3.1706 9.1927-4.3535 13.387-1.1829 4.086-2.1516 8.0119-2.9043 11.775-.75272-3.7636-1.7195-7.7417-2.9023-11.936-1.1829-4.1938-2.635-8.7098-4.3555-13.549l-25.809-73.552z"/>
<path d="m84.264 5.0749a2.3288 2.3288 0 00-1.2122.99654l-4.145 6.9077c-.72599.06029-1.4502.12529-2.1701.20657l-5.406-5.9599a2.3288 2.3288 0 00-3.9203.77975l-2.7161 7.5796c-.7008.20184-1.4008.40458-2.0929.62653l-6.4616-4.7875a2.3288 2.3288 0 00-3.691 1.53l-1.1884 7.9871c-.63834.33084-1.2749.66363-1.9023 1.0124l-7.297-3.4482a2.3288 2.3288 0 00-3.3222 2.2201l.39272 8.0937c-.55229.44111-1.0997.8874-1.639 1.3438l-7.8588-1.9647a2.3288 2.3288 0 00-2.825 2.825l1.9647 7.8588c-.45646.53923-.90273 1.0867-1.3439 1.639l-8.0937-.39271a2.3288 2.3288 0 00-2.2201 3.3222l3.4482 7.297c-.3488.62737-.68158 1.2639-1.0124 1.9023l-7.9871 1.1884a2.3288 2.3288 0 00-1.53 3.6911l4.7875 6.4616c-.22196.69217-.4247 1.3921-.62653 2.093l-7.5796 2.7161a2.3288 2.3288 0 00-.77976 3.9203l5.9599 5.4061c-.08128.71995-.14628 1.4442-.20657 2.1701l-6.9077 4.1451a2.3288 2.3288 0 000 3.9952l6.9077 4.1439c.06028.72636.12524 1.451.20657 2.1713l-5.9599 5.4061a2.3288 2.3288 0 00.77976 3.9192l7.5796 2.7161c.20188.70099.4045 1.4017.62653 2.0941l-4.7875 6.4605a2.3288 2.3288 0 001.53 3.6922l7.9871 1.1884c.33079.63822.6637 1.275 1.0124 1.9023l-3.4482 7.297a2.3288 2.3288 0 002.2201 3.3222l8.0937-.39272c.44117.55235.88734 1.0997 1.3439 1.639l-1.9647 7.8588a2.3288 2.3288 0 002.825 2.825l7.8588-1.9647c.53923.45647 1.0867.90273 1.639 1.3438l-.39272 8.0926a2.3288 2.3288 0 003.3222 2.2201l7.297-3.447c.62736.34881 1.2639.68158 1.9023 1.0124l1.1884 7.987a2.3288 2.3288 0 003.691 1.5289l6.4616-4.7864c.69217.22197 1.3921.4247 2.0929.62654l2.7161 7.5796a2.3288 2.3288 0 003.9203.7786l5.4049-5.9588c.72031.0813 1.4449.14624 2.1713.20656l4.145 6.9077a2.3288 2.3288 0 003.9952 0l4.1439-6.9077c.72674-.0603 1.4517-.12518 2.1724-.20656l5.4049 5.9588a2.3288 2.3288 0 003.9192-.7786l2.7161-7.5796c.70103-.20189 1.4017-.4045 2.0941-.62654l6.4605 4.7864a2.3288 2.3288 0 003.6922-1.5289l1.1884-7.987c.63823-.33079 1.275-.6637 1.9023-1.0124l7.297 3.447a2.3288 2.3288 0 003.3222-2.2201l-.39271-8.0926c.55234-.44117 1.0997-.88734 1.639-1.3438l7.8588 1.9647a2.3288 2.3288 0 002.825-2.825l-1.9647-7.8588c.4565-.53928.90269-1.0866 1.3438-1.639l8.0926.39272a2.3288 2.3288 0 002.2201-3.3222l-3.447-7.297c.34872-.62723.68163-1.264 1.0124-1.9023l7.987-1.1884a2.3288 2.3288 0 001.5289-3.6922l-4.7863-6.4605c.22202-.69235.42462-1.3931.62652-2.0941l7.5796-2.7161a2.3288 2.3288 0 00.77862-3.9192l-5.9588-5.4049c.0814-.72069.14623-1.4457.20658-2.1724l6.9077-4.1439a2.3288 2.3288 0 000-3.9952l-6.9077-4.1451c-.0603-.72635-.12524-1.451-.20658-2.1713l5.9588-5.4049a2.3288 2.3288 0 00-.77862-3.9203l-7.5796-2.7161c-.20184-.70082-.40457-1.4008-.62652-2.093l4.7863-6.4616a2.3288 2.3288 0 00-1.5289-3.6911l-7.987-1.1884c-.33084-.63836-.66362-1.2749-1.0124-1.9023l3.447-7.297a2.3288 2.3288 0 00-2.2201-3.3222l-8.0926.39271c-.44112-.55229-.8874-1.0997-1.3438-1.639l1.9647-7.8588a2.3288 2.3288 0 00-2.825-2.825l-7.8588 1.9647c-.53927-.4565-1.0866-.9027-1.639-1.3438l.39271-8.0937a2.3288 2.3288 0 00-3.3222-2.2201l-7.297 3.4482c-.62726-.34873-1.264-.68165-1.9023-1.0124l-1.1884-7.9871a2.3288 2.3288 0 00-3.6922-1.53l-6.4605 4.7875c-.69236-.22201-1.3931-.42463-2.0941-.62653l-2.7161-7.5796a2.3288 2.3288 0 00-3.9192-.77975l-5.406 5.9599c-.72032-.08133-1.4449-.14626-2.1713-.20657l-4.1439-6.9077a2.3288 2.3288 0 00-2.783-.99654zm.78543 14.613a4.657 4.657 0 014.6569 4.6569 4.657 4.657 0 01-4.6569 4.6569 4.657 4.657 0 01-4.6569-4.6569 4.657 4.657 0 014.6569-4.6569zm-10.998 8.0064 7.7056 7.7056a4.6575 4.6575 0 006.5853 0l7.7056-7.7056c17.959 3.3214 33.023 14.65 41.468 30.141l-4.943 9.6998a4.6575 4.6575 0 002.0351 6.263l9.7123 4.9486c.32157 2.5182.49487 5.0839.49487 7.692 0 15.934-6.1974 30.369-16.306 41.066l-10.796-1.7093a4.6575 4.6575 0 00-5.3277 3.8704l-1.7116 10.804c-7.7603 3.6739-16.443 5.734-25.624 5.734-9.1812 0-17.864-2.0608-25.625-5.7352l-1.7116-10.803a4.6575 4.6575 0 00-5.3277-3.8715l-10.795 1.7105c-10.108-10.697-16.306-25.132-16.306-41.066 0-2.608.1733-5.1738.49487-7.692l9.7111-4.9486a4.6575 4.6575 0 002.0351-6.263l-4.9418-9.6986c8.4449-15.492 23.508-26.821 41.468-30.142zm-47.923 34.902a4.657 4.657 0 011.3064.22587 4.657 4.657 0 012.9896 5.868 4.657 4.657 0 01-5.868 2.9907 4.657 4.657 0 01-2.9907-5.8691 4.657 4.657 0 014.5627-3.2155zm117.84 0a4.657 4.657 0 014.5616 3.2155 4.657 4.657 0 01-2.9896 5.8691 4.657 4.657 0 01-5.868-2.9907 4.657 4.657 0 012.9896-5.868 4.657 4.657 0 011.3064-.22587zm-95.153 69.428a4.657 4.657 0 012.4709.88189 4.657 4.657 0 011.0306 6.5047 4.657 4.657 0 01-6.5047 1.0306 4.657 4.657 0 01-1.0306-6.5047 4.657 4.657 0 014.0338-1.9125zm72.463 0a4.657 4.657 0 014.0338 1.9125 4.657 4.657 0 01-1.0306 6.5047 4.657 4.657 0 01-6.5047-1.0306 4.657 4.657 0 011.0306-6.5047 4.657 4.657 0 012.4709-.88189z"/>
<path d="m406.1 185.44-4.8026-12.342h-15.803l-4.7468 12.342h-5.0817l15.58-40.04h4.5232l15.524 40.04zm-10.778-28.871q-.16753-.44674-.55844-1.6194-.3909-1.1727-.7818-2.4012-.33505-1.2844-.55843-1.9545-.39091 1.7312-.89345 3.4064-.50261 1.6194-.83768 2.5687l-4.5233 12.062h12.62zm31.384 29.429q-5.5844 0-8.9346-3.8532-3.3506-3.9091-3.3506-11.615t3.3506-11.615q3.4064-3.9649 8.9905-3.9649 3.4623 0 5.6402 1.2844 2.2338 1.2844 3.6298 3.1271h.33506q-.0559-.72595-.22337-2.122-.11169-1.4518-.11169-2.2895v-11.951h4.9142v42.441h-3.9649l-.72593-4.0207h-.22339q-1.3403 1.8987-3.574 3.2389-2.2338 1.3402-5.7519 1.3402zm.7818-4.0765q4.7468 0 6.6452-2.5687 1.9545-2.6246 1.9545-7.8738v-.89347q0-5.5844-1.8428-8.544-1.8428-3.0155-6.8127-3.0155-3.9649 0-5.975 3.1831-1.9545 3.1272-1.9545 8.4322 0 5.3609 1.9545 8.3206 2.0103 2.9597 6.0309 2.9597zm55.788-26.972q5.0817 0 7.5946 2.6246 2.5129 2.5687 2.5129 8.3764v19.489h-4.8584v-19.266q0-7.092-6.0867-7.092-4.3558 0-6.2542 2.5129-1.8428 2.5129-1.8428 7.3154v16.529h-4.8584v-19.266q0-7.092-6.1426-7.092-4.5232 0-6.2542 2.7922-1.7312 2.7922-1.7312 8.0414v15.524h-4.9142v-29.933h3.9649l.72595 4.0766h.27922q1.3961-2.3454 3.7416-3.4623 2.4012-1.1727 5.0817-1.1727 7.0362 0 9.1582 5.0258h.27921q1.5078-2.5687 4.0766-3.7974 2.6246-1.2286 5.5284-1.2286zm21.891-10.666q1.1169 0 1.9545.78178.89355.72598.89355 2.3454 0 1.5636-.89355 2.3454-.83765.78179-1.9545.78179-1.2286 0-2.0662-.78179-.83766-.7818-.83766-2.3454 0-1.6194.83766-2.3454.83763-.78178 2.0662-.78178zm2.4012 11.225v29.933h-4.9141v-29.933zm23.901-.55843q5.3609 0 8.0972 2.6246 2.7363 2.5687 2.7363 8.3765v19.489h-4.8584v-19.154q0-7.2037-6.701-7.2037-4.97 0-6.8686 2.7922-1.8987 2.7922-1.8987 8.0414v15.524h-4.9142v-29.933h3.9649l.72596 4.0766h.27921q1.4519-2.3454 4.0207-3.4623 2.5687-1.1727 5.4167-1.1727zm52.381-5.5285q-6.4218 0-10.108 4.3-3.6857 4.3-3.6857 11.783 0 7.4271 3.4064 11.783 3.4623 4.3 10.331 4.3 2.6246 0 4.97-.44675 2.3454-.44675 4.5792-1.1169v4.3558q-2.2337.83766-4.635 1.2286-2.3454.3909-5.6402.3909-6.0867 0-10.163-2.5129-4.0768-2.5129-6.1426-7.1479-2.0103-4.635-2.0103-10.889 0-6.0309 2.1778-10.61 2.2337-4.6351 6.5335-7.2037 4.3-2.6246 10.443-2.6246 6.3101 0 11.001 2.3454l-2.0103 4.2441q-1.8428-.83766-4.1325-1.5078-2.2337-.67011-4.9141-.67011zm43.558 20.997q0 7.4271-3.7974 11.503-3.7416 4.0765-10.163 4.0765-3.9649 0-7.092-1.787-3.0713-1.8428-4.8584-5.3051-1.787-3.5181-1.787-8.4881 0-7.4271 3.7416-11.448 3.7416-4.0207 10.163-4.0207 4.0765 0 7.1479 1.8428 3.1271 1.787 4.8584 5.2492 1.787 3.4064 1.787 8.3764zm-22.617 0q0 5.3051 2.0662 8.4322 2.122 3.0714 6.701 3.0714 4.5233 0 6.6452-3.0714 2.122-3.1271 2.122-8.4322t-2.122-8.3206q-2.122-3.0155-6.701-3.0155-4.5792 0-6.6452 3.0155-2.0662 3.0155-2.0662 8.3206zm44.786-15.468q5.361 0 8.0973 2.6246 2.7363 2.5687 2.7363 8.3765v19.489h-4.8584v-19.154q0-7.2037-6.701-7.2037-4.97 0-6.8685 2.7922-1.8987 2.7922-1.8987 8.0414v15.524h-4.9142v-29.933h3.9649l.72597 4.0765h.2792q1.4519-2.3454 4.0207-3.4623 2.5687-1.1727 5.4168-1.1727zm39.593 22.225q0 4.3558-3.2389 6.5894-3.2389 2.2338-8.7119 2.2338-3.1271 0-5.4168-.5026-2.2338-.50258-3.9649-1.396v-4.4675q1.787.89346 4.3 1.6753 2.5687.72594 5.1934.72594 3.7416 0 5.4168-1.1727 1.6752-1.2286 1.6752-3.2389 0-1.1169-.61424-2.0103-.61426-.89347-2.2337-1.787-1.5636-.89346-4.5233-2.0103-2.9039-1.1169-4.97-2.2337-2.0662-1.1169-3.1831-2.6805-1.1169-1.5636-1.1169-4.0208 0-3.7974 3.0714-5.8635 3.1272-2.0662 8.153-2.0662 2.7363 0 5.0818.55842 2.4012.50259 4.4675 1.4519l-1.6752 3.9091q-1.8987-.78179-3.9649-1.3403-2.0662-.55842-4.2441-.55842-3.0155 0-4.6351 1.0052-1.5636.94937-1.5636 2.6246 0 1.2286.72596 2.122.72595.83764 2.4012 1.6753 1.7311.78179 4.5792 1.8987 2.848 1.061 4.8584 2.1779 2.0104 1.1169 3.0713 2.7363 1.0611 1.5636 1.0611 3.9649zm33.283-6.7569q0 7.4271-3.7974 11.503-3.7416 4.0766-10.163 4.0766-3.9649 0-7.092-1.787-3.0714-1.8428-4.8583-5.3051-1.787-3.5181-1.787-8.4881 0-7.4271 3.7416-11.448 3.7416-4.0207 10.163-4.0207 4.0766 0 7.1479 1.8428 3.1271 1.787 4.8584 5.2492 1.787 3.4064 1.787 8.3764zm-22.617 0q0 5.3051 2.0662 8.4322 2.122 3.0714 6.701 3.0714 4.5233 0 6.6452-3.0714 2.122-3.1271 2.122-8.4322 0-5.3051-2.122-8.3206-2.122-3.0155-6.701-3.0155t-6.6452 3.0155q-2.0662 3.0155-2.0662 8.3206zm35.293 15.022h-4.9142v-42.441h4.9142zm21.053-30.491q3.8532 0 6.5894 1.6753 2.7922 1.6754 4.2441 4.7468 1.5078 3.0155 1.5078 7.092v2.9597h-20.494q.11169 5.0818 2.5687 7.7621 2.5129 2.6246 6.9803 2.6246 2.848 0 5.0259-.50258 2.2337-.55844 4.5792-1.5636v4.3q-2.2895 1.0052-4.5233 1.4519-2.2337.5026-5.3051.5026-4.2441 0-7.5388-1.7312-3.2389-1.7312-5.0817-5.1376-1.787-3.4623-1.787-8.4322 0-4.9142 1.6194-8.4322 1.6754-3.5181 4.635-5.4168 3.0155-1.8986 6.9803-1.8986zm-.0559 4.0207q-3.5181 0-5.5844 2.2895-2.0103 2.2337-2.4012 6.2543h15.245q-.0559-3.7974-1.787-6.1426-1.7311-2.4012-5.4726-2.4012z" stroke-width=".93783"/>
</g>
<defs>
<clipPath id="admin-console-logo-clip">
<path d="M0 0h800v200H0z" class="tw-fill-fg-nav"/>
</clipPath>
</defs>
</svg>
`;var Vt=t(13417),Et=t(7356),Dt=t(45383),Bt=t(31066),Wt=t(9327),Pt=t(81098),Ut=t(47438),Nt=t(91326),Qt=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};function qt(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"bit-banner",1),ye.bIt("dismiss",function(){b.eBV(e);const i=ye.XpG();return b.Njj(i.trackDismissal())}),ye.EFF(1),ye.j41(2,"a",2),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG();return b.Njj(i.editBillingAddress())}),ye.EFF(3),ye.k0s()()}if(2&e){ye.XpG();const e=ye.r8f(0);ye.R7$(),ye.SpI(" ",e.message," "),ye.R7$(2),ye.SpI(" ",e.callToAction," ")}}const Yt=new Bt.Ok(Bt.Cg,"taxIdWarningDismissalCounts",{deserializer:e=>e,clearOn:[]}),Ot=new Bt.Ok(Bt.Cg,"taxIdWarningDismissedThisSession",{deserializer:e=>e,clearOn:["logout"]});class _t{constructor(e,i,t,n,o){this.accountService=e,this.dialogService=i,this.i18nService=t,this.subscriberBillingClient=n,this.stateProvider=o,this.billingAddressUpdated=new b.bkB,this.userId$=this.accountService.activeAccount$.pipe((0,F.p)(e=>null!==e),Q.F6),this.dismissals$=this.userId$.pipe((0,R.n)(e=>(0,$.z)([this.stateProvider.getUser(e,Yt).state$.pipe((0,M.T)(e=>{var i,t;return e?{[Ut.e.Missing]:null!==(i=e[Ut.e.Missing])&&void 0!==i?i:0,[Ut.e.FailedVerification]:null!==(t=e[Ut.e.FailedVerification])&&void 0!==t?t:0}:{[Ut.e.Missing]:0,[Ut.e.FailedVerification]:0}})),this.stateProvider.getUser(e,Ot).state$.pipe((0,M.T)(e=>{var i,t;return e?{[Ut.e.Missing]:null!==(i=e[Ut.e.Missing])&&void 0!==i&&i,[Ut.e.FailedVerification]:null!==(t=e[Ut.e.FailedVerification])&&void 0!==t&&t}:{[Ut.e.Missing]:!1,[Ut.e.FailedVerification]:!1}}))])),(0,M.T)(([e,i])=>({[Ut.e.Missing]:{count:e[Ut.e.Missing],dismissedThisSession:i[Ut.e.Missing]},[Ut.e.FailedVerification]:{count:e[Ut.e.FailedVerification],dismissedThisSession:i[Ut.e.FailedVerification]}}))),this.getWarningSubject=new S.t(null),this.warning$=this.getWarningSubject.pipe((0,R.n)(()=>this.getWarning$())),this.view$=(0,$.z)([this.warning$,this.dismissals$]).pipe((0,M.T)(([e,i])=>{if(!e||e===Ut.e.PendingVerification)return null;if(!((e,i)=>{const t=i[e];return!t.dismissedThisSession&&t.count<3})(e,i))return null;switch(e){case Ut.e.Missing:return{message:this.i18nService.t("missingTaxIdWarning"),callToAction:this.i18nService.t("addTaxId")};case Ut.e.FailedVerification:return{message:this.i18nService.t("unverifiedTaxIdWarning"),callToAction:this.i18nService.t("editTaxId")}}})),this.editBillingAddress=()=>Qt(this,void 0,void 0,function*(){var e;const i=yield this.subscriberBillingClient.getBillingAddress(this.subscriber),t=null!==(e=yield(0,z._)(this.warning$))&&void 0!==e?e:void 0,n=Pt.ve.open(this.dialogService,{data:{subscriber:this.subscriber,billingAddress:i,taxIdWarning:t}}),o=yield(0,me.s)(n.closed);"success"===(null==o?void 0:o.type)&&this.billingAddressUpdated.emit()}),this.trackDismissal=()=>Qt(this,void 0,void 0,function*(){const e=yield(0,z._)(this.warning$);if(!e||e===Ut.e.PendingVerification)return;const i=yield(0,z._)(this.userId$),t=this.stateProvider.getUser(i,Yt).update(i=>{if(!i)return{[e]:1};const t=i[e];return t?Object.assign(Object.assign({},i),{[e]:t+1}):Object.assign(Object.assign({},i),{[e]:1})}),n=this.stateProvider.getUser(i,Ot).update(i=>{if(!i)return{[e]:!0};const t=i[e];return t?Object.assign(Object.assign({},i),{[e]:t}):Object.assign({},i)});yield Promise.all([t,n])})}ngOnInit(){this.getWarningSubject.next(this.getWarning$)}}_t.ɵfac=function(e){return new(e||_t)(ye.rXU(N.D),ye.rXU(ne.o),ye.rXU(_.W),ye.rXU(Wt.Hd),ye.rXU(Bt.v2))},_t.ɵcmp=ye.VBU({type:_t,selectors:[["app-tax-id-warning"]],inputs:{subscriber:"subscriber",getWarning$:"getWarning$"},outputs:{billingAddressUpdated:"billingAddressUpdated"},decls:3,vars:4,consts:[["id","tax-id-warning-banner","variant","warning"],["id","tax-id-warning-banner","variant","warning",3,"dismiss"],["bitLink","","linkType","secondary","rel","noreferrer noopener",1,"tw-cursor-pointer",3,"click"]],template:function(e,i){if(1&e&&(ye.SS7(0),ye.nI1(1,"async"),ye.nVh(2,qt,4,2,"bit-banner",0)),2&e){const e=ye.bH3(ye.bMT(1,1,i.view$));ye.R7$(2),ye.vxM(e?2:-1)}},dependencies:[se.H,Nt.K,he.G,et.g,Ce.Jj],encapsulation:2});var Ht=t(33189),Lt=t(24137),Jt=t(74269),Zt=t(44087),Kt=t(65067),en=t(58384);const tn=(e,i)=>[e,i],nn=e=>["../",e],on=()=>({exact:!0});function sn(e,i){1&e&&(ye.nrm(0,"bit-icon",5),ye.nI1(1,"i18n"),ye.nI1(2,"i18n")),2&e&&ye.Y8G("appA11yTitle",ye.mNQ(ye.bMT(1,3,"organizationIsDisabled")))("ariaLabel",ye.bMT(2,5,"organizationIsDisabled"))}function rn(e,i){1&e&&(ye.nrm(0,"bit-icon",9),ye.nI1(1,"i18n"),ye.nI1(2,"i18n")),2&e&&ye.Y8G("appA11yTitle",ye.mNQ(ye.bMT(1,3,"organizationIsDisabled")))("ariaLabel",ye.bMT(2,5,"organizationIsDisabled"))}function ln(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"bit-nav-item",7),ye.nI1(1,"i18n"),ye.bIt("mainContentClicked",function(){b.eBV(e);const i=ye.XpG(3);return b.Njj(i.toggle())}),ye.DNE(2,rn,3,7,"bit-icon",8),ye.k0s()}if(2&e){const e=i.$implicit;ye.Y8G("text",e.name)("ariaLabel",ye.l_i(7,tn,ye.bMT(1,5,"organization"),e.name).join(" "))("route",ye.eq3(10,nn,e.id))("routerLinkActiveOptions",ye.lJ4(12,on)),ye.R7$(2),ye.Y8G("ngIf",0==e.enabled)}}function an(e,i){if(1&e&&(ye.qex(0),ye.DNE(1,ln,3,13,"bit-nav-item",6),ye.bVm()),2&e){const e=i.ngIf;ye.R7$(),ye.Y8G("ngForOf",e)}}function cn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",10),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"newOrganization"))}function dn(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"bit-nav-group",1),ye.nI1(1,"i18n"),ye.mxI("openChange",function(i){b.eBV(e);const t=ye.XpG();return ye.DH7(t.open,i)||(t.open=i),b.Njj(i)}),ye.DNE(2,sn,3,7,"bit-icon",2)(3,an,2,1,"ng-container",3),ye.nI1(4,"async"),ye.DNE(5,cn,2,3,"bit-nav-item",4),ye.nrm(6,"bit-nav-divider"),ye.k0s()}if(2&e){const e=i.ngIf,t=ye.XpG();ye.Y8G("text",e.name)("ariaLabel",ye.l_i(12,tn,ye.bMT(1,8,"organization"),e.name).join(" "))("route",ye.eq3(15,nn,e.id))("routerLinkActiveOptions",ye.lJ4(17,on)),ye.R50("open",t.open),ye.R7$(2),ye.Y8G("ngIf",!e.enabled),ye.R7$(),ye.Y8G("ngIf",ye.bMT(4,10,t.organizations$)),ye.R7$(2),ye.Y8G("ngIf",!t.hideNewButton)}}class hn{constructor(e,i,t,n,o){this.route=e,this.dialogService=i,this.organizationService=t,this.billingApiService=n,this.accountService=o,this.organizations$=this.accountService.activeAccount$.pipe((0,R.n)(e=>this.organizationService.organizations$(null==e?void 0:e.id).pipe((0,M.T)(e=>e.filter(e=>this.filter(e)).sort((e,i)=>e.name.localeCompare(i.name)))))),this.activeOrganization$=(0,$.z)([this.route.paramMap,this.organizations$]).pipe((0,M.T)(([e,i])=>i.find(i=>i.id===e.get("organizationId")))),this.filter=()=>!0,this.open=!1,this.openChange=new b.bkB,this.hideNewButton=!1}toggle(e){null==e||e.stopPropagation(),this.open=!this.open,this.openChange.emit(this.open)}}hn.ɵfac=function(e){return new(e||hn)(ye.rXU(w.nX),ye.rXU(ne.o),ye.rXU(d.PV),ye.rXU(q.P),ye.rXU(N.D))},hn.ɵcmp=ye.VBU({type:hn,selectors:[["org-switcher"]],inputs:{filter:"filter",open:"open",hideNewButton:"hideNewButton"},outputs:{openChange:"openChange"},decls:2,vars:3,consts:[["icon","bwi-business",3,"text","ariaLabel","route","routerLinkActiveOptions","open","openChange",4,"ngIf"],["icon","bwi-business",3,"openChange","text","ariaLabel","route","routerLinkActiveOptions","open"],["slot","end","name","bwi-exclamation-triangle","class","tw-my-auto",3,"ariaLabel","appA11yTitle",4,"ngIf"],[4,"ngIf"],["icon","bwi-plus","route","/create-organization",3,"text",4,"ngIf"],["slot","end","name","bwi-exclamation-triangle",1,"tw-my-auto",3,"ariaLabel","appA11yTitle"],[3,"text","ariaLabel","route","routerLinkActiveOptions","mainContentClicked",4,"ngFor","ngForOf"],[3,"mainContentClicked","text","ariaLabel","route","routerLinkActiveOptions"],["slot","end","name","bwi-exclamation-triangle",3,"ariaLabel","appA11yTitle",4,"ngIf"],["slot","end","name","bwi-exclamation-triangle",3,"ariaLabel","appA11yTitle"],["icon","bwi-plus","route","/create-organization",3,"text"]],template:function(e,i){1&e&&(ye.DNE(0,dn,7,18,"bit-nav-group",0),ye.nI1(1,"async")),2&e&&ye.Y8G("ngIf",ye.bMT(1,1,i.activeOrganization$))},dependencies:[Ce.MD,Ce.Sq,Ce.bT,$i.p,Zi.C,Lt.f,Jt.K,Zt.O,Kt.u,s.o,en.R,Ce.Jj,Ge.$],encapsulation:2});var un=t(81740),pn=t(59557),vn=t(53021),gn=t(4581);const mn=()=>({exact:!0});function fn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",6),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"accessIntelligence"))}function bn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",13),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"collections"))}function In(e,i){1&e&&(ye.qex(0),ye.j41(1,"bit-nav-group",15),ye.nI1(2,"i18n"),ye.nrm(3,"bit-nav-item",16),ye.nI1(4,"i18n"),ye.nrm(5,"bit-nav-item",17),ye.nI1(6,"i18n"),ye.k0s(),ye.bVm()),2&e&&(ye.R7$(),ye.Y8G("text",ye.bMT(2,4,"members")),ye.R7$(2),ye.Y8G("text",ye.bMT(4,6,"members"))("routerLinkActiveOptions",ye.lJ4(10,mn)),ye.R7$(2),ye.Y8G("text",ye.bMT(6,8,"sponsoredFamilies")))}function yn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",15),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"members"))}function wn(e,i){if(1&e&&(ye.qex(0),ye.DNE(1,In,7,11,"ng-container",14),ye.nI1(2,"async"),ye.DNE(3,yn,2,3,"ng-template",null,0,ye.C5r),ye.bVm()),2&e){const e=ye.sdS(4),i=ye.XpG(2);ye.R7$(),ye.Y8G("ngIf",ye.bMT(2,2,i.showSponsoredFamiliesDropdown$))("ngIfElse",e)}}function Sn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",18),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"groups"))}function Cn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",22),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"eventLogs"))}function $n(e,i){1&e&&(ye.nrm(0,"bit-nav-item",23),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"reports"))}function Tn(e,i){if(1&e&&(ye.j41(0,"bit-nav-group",19),ye.nI1(1,"i18n"),ye.DNE(2,Cn,2,3,"bit-nav-item",20)(3,$n,2,3,"bit-nav-item",21),ye.k0s()),2&e){const e=ye.XpG().ngIf,i=ye.XpG();ye.Y8G("text",ye.bMT(1,3,i.getReportTabLabel(e))),ye.R7$(2),ye.Y8G("ngIf",(e.canAccessEventLogs||e.isOwner)&&e.useEvents),ye.R7$(),ye.Y8G("ngIf",e.canAccessReports)}}function xn(e,i){1&e&&(ye.qex(0),ye.nrm(1,"bit-nav-item",26),ye.nI1(2,"i18n"),ye.nrm(3,"bit-nav-item",27),ye.nI1(4,"i18n"),ye.bVm()),2&e&&(ye.R7$(),ye.Y8G("text",ye.bMT(2,2,"paymentDetails")),ye.R7$(2),ye.Y8G("text",ye.bMT(4,4,"billingHistory")))}function An(e,i){if(1&e&&(ye.j41(0,"bit-nav-group",24),ye.nI1(1,"i18n"),ye.nrm(2,"bit-nav-item",25),ye.nI1(3,"i18n"),ye.DNE(4,xn,5,6,"ng-container",2),ye.nI1(5,"async"),ye.nI1(6,"async"),ye.k0s()),2&e){const e=ye.XpG(2);ye.Y8G("text",ye.bMT(1,3,"billing")),ye.R7$(2),ye.Y8G("text",ye.bMT(3,5,"subscription")),ye.R7$(2),ye.Y8G("ngIf",ye.bMT(5,7,e.showPaymentAndHistory$)&&ye.bMT(6,9,e.organizationIsUnmanaged$))}}function zn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",28),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"integrations"))}function Mn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",39),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"organizationInfo"))}function Fn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",40),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"policies"))}function Gn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",41),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"twoStepLogin"))}function Rn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",42),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"importNoun"))}function kn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",43),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"exportNoun"))}function Xn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",44),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"claimedDomains"))}function jn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",45),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"singleSignOn"))}function Vn(e,i){1&e&&(ye.nrm(0,"bit-nav-item",46),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"deviceApprovals"))}function En(e,i){1&e&&(ye.nrm(0,"bit-nav-item",47),ye.nI1(1,"i18n")),2&e&&ye.Y8G("text",ye.bMT(1,1,"scim"))}function Dn(e,i){if(1&e&&(ye.j41(0,"bit-nav-group",29),ye.nI1(1,"i18n"),ye.DNE(2,Mn,2,3,"bit-nav-item",30)(3,Fn,2,3,"bit-nav-item",31)(4,Gn,2,3,"bit-nav-item",32)(5,Rn,2,3,"bit-nav-item",33)(6,kn,2,3,"bit-nav-item",34),ye.nI1(7,"async"),ye.DNE(8,Xn,2,3,"bit-nav-item",35)(9,jn,2,3,"bit-nav-item",36)(10,Vn,2,3,"bit-nav-item",37)(11,En,2,3,"bit-nav-item",38),ye.k0s()),2&e){const e=ye.XpG().ngIf,i=ye.XpG();ye.Y8G("text",ye.bMT(1,10,"settings")),ye.R7$(2),ye.Y8G("ngIf",e.isOwner),ye.R7$(),ye.Y8G("ngIf",e.canManagePolicies),ye.R7$(),ye.Y8G("ngIf",e.use2fa&&e.isOwner),ye.R7$(),ye.Y8G("ngIf",e.canAccessImport),ye.R7$(),ye.Y8G("ngIf",ye.bMT(7,12,i.canAccessExport$)),ye.R7$(2),ye.Y8G("ngIf",null==e?null:e.canManageDomainVerification),ye.R7$(),ye.Y8G("ngIf",e.canManageSso),ye.R7$(),ye.Y8G("ngIf",e.canManageDeviceApprovals),ye.R7$(),ye.Y8G("ngIf",e.canManageScim)}}function Bn(e,i){if(1&e&&(ye.j41(0,"app-side-nav",3),ye.nrm(1,"bit-nav-logo",4),ye.nI1(2,"i18n"),ye.nrm(3,"org-switcher",5),ye.nI1(4,"async"),ye.nVh(5,fn,2,3,"bit-nav-item",6),ye.DNE(6,bn,2,3,"bit-nav-item",7)(7,wn,5,4,"ng-container",2)(8,Sn,2,3,"bit-nav-item",8)(9,Tn,4,5,"bit-nav-group",9)(10,An,7,11,"bit-nav-group",10)(11,zn,2,3,"bit-nav-item",11),ye.nI1(12,"async"),ye.DNE(13,Dn,12,14,"bit-nav-group",12),ye.k0s()),2&e){const e=i.ngIf,t=ye.XpG();ye.R7$(),ye.Y8G("openIcon",t.logo)("label",ye.bMT(2,12,"adminConsole")),ye.R7$(2),ye.Y8G("filter",t.orgFilter)("hideNewButton",ye.bMT(4,14,t.hideNewOrgButton$)),ye.R7$(2),ye.vxM(t.canShowAccessIntelligenceTab(e)?5:-1),ye.R7$(),ye.Y8G("ngIf",t.canShowVaultTab(e)),ye.R7$(),ye.Y8G("ngIf",t.canShowMembersTab(e)),ye.R7$(),ye.Y8G("ngIf",t.canShowGroupsTab(e)),ye.R7$(),ye.Y8G("ngIf",t.canShowReportsTab(e)),ye.R7$(),ye.Y8G("ngIf",t.canShowBillingTab(e)),ye.R7$(),ye.Y8G("ngIf",ye.bMT(12,16,t.integrationPageEnabled$)),ye.R7$(2),ye.Y8G("ngIf",t.canShowSettingsTab(e))}}function Wn(e,i){if(1&e&&(ye.j41(0,"bit-banner"),ye.EFF(1),ye.nI1(2,"i18n"),ye.k0s()),2&e){const e=ye.XpG().ngIf;ye.R7$(),ye.SpI(" ",ye.i5U(2,1,"accessingUsingProvider",e.providerName)," ")}}function Pn(e,i){if(1&e){const e=ye.RV6();ye.qex(0),ye.DNE(1,Wn,3,4,"bit-banner",2),ye.j41(2,"app-tax-id-warning",48),ye.nI1(3,"async"),ye.bIt("billingAddressUpdated",function(){b.eBV(e);const i=ye.XpG();return b.Njj(i.refreshTaxIdWarning())}),ye.k0s(),ye.bVm()}if(2&e){const e=i.ngIf,t=ye.XpG();ye.R7$(),ye.Y8G("ngIf",e.isProviderUser),ye.R7$(),ye.Y8G("subscriber",ye.bMT(3,3,t.subscriber$))("getWarning$",t.getTaxIdWarning$)}}class Un{constructor(){this.route=(0,b.WQX)(w.nX),this.organizationService=(0,b.WQX)(d.PV),this.platformUtilsService=(0,b.WQX)(L.y),this.policyService=(0,b.WQX)(Ii.m),this.providerService=(0,b.WQX)(Vt.$),this.accountService=(0,b.WQX)(N.D),this.freeFamiliesPolicyService=(0,b.WQX)(Ht.A),this.organizationWarningsService=(0,b.WQX)(de.S),this.logo=jt,this.orgFilter=e=>(0,d.OV)(e),this.userId$=this.accountService.activeAccount$.pipe(Q.F6),this.organization$=this.route.params.pipe((0,M.T)(e=>e.organizationId),(0,Xt.E)(this.userId$),(0,R.n)(([e,i])=>this.organizationService.organizations$(i).pipe((0,J.Hc)(e))),(0,F.p)(e=>null!=e)),this.canAccessExport$=this.organization$.pipe((0,M.T)(e=>e.canAccessExport)),this.showPaymentAndHistory$=this.organization$.pipe((0,M.T)(e=>!this.platformUtilsService.isSelfHost()&&e.canViewBillingHistory&&e.canEditPaymentMethods)),this.hideNewOrgButton$=this.userId$.pipe((0,R.n)(e=>(0,d.UX)(e,this.policyService))),this.provider$=(0,$.z)([this.organization$,this.userId$]).pipe((0,R.n)(([e,i])=>this.providerService.get$(e.providerId,i))),this.organizationIsUnmanaged$=(0,$.z)([this.organization$,this.provider$]).pipe((0,M.T)(([e,i])=>!e.hasProvider||!i||i.providerStatus!==Et.kC.Billable)),this.integrationPageEnabled$=this.organization$.pipe((0,M.T)(e=>e.canAccessIntegrations)),this.showSponsoredFamiliesDropdown$=this.freeFamiliesPolicyService.showSponsoredFamiliesDropdown$(this.organization$),this.subscriber$=this.organization$.pipe((0,M.T)(e=>({type:"organization",data:e}))),this.getTaxIdWarning$=()=>this.organization$.pipe((0,R.n)(e=>this.organizationWarningsService.getTaxIdWarning$(e))),document.body.classList.remove("layout_frontend")}canShowVaultTab(e){return(0,d.of)(e)}canShowSettingsTab(e){return(0,d.Dl)(e)}canShowMembersTab(e){return(0,d.pe)(e)}canShowGroupsTab(e){return(0,d.ex)(e)}canShowReportsTab(e){return(0,d.Ue)(e)}canShowBillingTab(e){return!1}canShowAccessIntelligenceTab(e){return(0,d.o2)(e)}getReportTabLabel(e){return e.useEvents?"reporting":"reports"}refreshTaxIdWarning(){this.organizationWarningsService.refreshTaxIdWarning()}}Un.ɵfac=function(e){return new(e||Un)},Un.ɵcmp=ye.VBU({type:Un,selectors:[["app-organization-layout"]],decls:6,vars:6,consts:[["regularMembersItem",""],["variant","secondary",4,"ngIf"],[4,"ngIf"],["variant","secondary"],["route",".",3,"openIcon","label"],[3,"filter","hideNewButton"],["icon","bwi-dashboard","route","access-intelligence",3,"text"],["icon","bwi-collection-shared","route","vault",3,"text",4,"ngIf"],["icon","bwi-users","route","groups",3,"text",4,"ngIf"],["icon","bwi-sliders","route","reporting",3,"text",4,"ngIf"],["icon","bwi-billing","route","billing",3,"text",4,"ngIf"],["icon","bwi-msp","route","integrations",3,"text",4,"ngIf"],["icon","bwi-cog","route","settings",3,"text",4,"ngIf"],["icon","bwi-collection-shared","route","vault",3,"text"],[4,"ngIf","ngIfElse"],["icon","bwi-user","route","members",3,"text"],["route","members",3,"text","routerLinkActiveOptions"],["route","members/sponsored-families",3,"text"],["icon","bwi-users","route","groups",3,"text"],["icon","bwi-sliders","route","reporting",3,"text"],["route","reporting/events",3,"text",4,"ngIf"],["route","reporting/reports",3,"text",4,"ngIf"],["route","reporting/events",3,"text"],["route","reporting/reports",3,"text"],["icon","bwi-billing","route","billing",3,"text"],["route","billing/subscription",3,"text"],["route","billing/payment-details",3,"text"],["route","billing/history",3,"text"],["icon","bwi-msp","route","integrations",3,"text"],["icon","bwi-cog","route","settings",3,"text"],["route","settings/account",3,"text",4,"ngIf"],["route","settings/policies",3,"text",4,"ngIf"],["route","settings/two-factor",3,"text",4,"ngIf"],["route","settings/tools/import",3,"text",4,"ngIf"],["route","settings/tools/export",3,"text",4,"ngIf"],["route","settings/domain-verification",3,"text",4,"ngIf"],["route","settings/sso",3,"text",4,"ngIf"],["route","settings/device-approvals",3,"text",4,"ngIf"],["route","settings/scim",3,"text",4,"ngIf"],["route","settings/account",3,"text"],["route","settings/policies",3,"text"],["route","settings/two-factor",3,"text"],["route","settings/tools/import",3,"text"],["route","settings/tools/export",3,"text"],["route","settings/domain-verification",3,"text"],["route","settings/sso",3,"text"],["route","settings/device-approvals",3,"text"],["route","settings/scim",3,"text"],[3,"billingAddressUpdated","subscriber","getWarning$"]],template:function(e,i){1&e&&(ye.j41(0,"app-layout"),ye.DNE(1,Bn,14,18,"app-side-nav",1),ye.nI1(2,"async"),ye.DNE(3,Pn,4,5,"ng-container",2),ye.nI1(4,"async"),ye.nrm(5,"router-outlet"),ye.k0s()),2&e&&(ye.R7$(),ye.Y8G("ngIf",ye.bMT(2,2,i.organization$)),ye.R7$(2),ye.Y8G("ngIf",ye.bMT(4,4,i.organization$)))},dependencies:[Ce.MD,Ce.bT,a.iI,w.n3,$i.p,un.P,Zt.O,Kt.u,pn.K,vn.s,gn.y,Dt.Z,hn,se.H,Nt.K,_t,Ce.Jj,Ge.$],encapsulation:2});var Nn,Qn,qn=t(35284),Yn=t(98569),On=t(55542),_n=t(8916),Hn=t(7861),Ln=t(3892),Jn=t(86226),Zn=t(93199),Kn=t(19934),eo=t(43759),io=t(88516),to=t(18539),no=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};function oo(e,i){if(1&e&&(ye.j41(0,"span",10),ye.EFF(1),ye.k0s()),2&e){const e=ye.XpG();ye.R7$(),ye.JRh(null==e.group?null:e.group.name)}}function so(e,i){1&e&&(ye.j41(0,"div"),ye.nrm(1,"i",11),ye.nI1(2,"i18n"),ye.j41(3,"span",12),ye.EFF(4),ye.nI1(5,"i18n"),ye.k0s()()),2&e&&(ye.R7$(),ye.Y8G("title",ye.mNQ(ye.bMT(2,3,"loading"))),ye.R7$(3),ye.JRh(ye.bMT(5,5,"loading")))}function ro(e,i){1&e&&(ye.j41(0,"bit-form-field")(1,"bit-label"),ye.EFF(2),ye.nI1(3,"i18n"),ye.k0s(),ye.nrm(4,"input",18),ye.j41(5,"bit-hint"),ye.EFF(6),ye.nI1(7,"i18n"),ye.k0s()()),2&e&&(ye.R7$(2),ye.JRh(ye.bMT(3,2,"externalId")),ye.R7$(4),ye.JRh(ye.bMT(7,4,"externalIdDesc")))}function lo(e,i){1&e&&(ye.j41(0,"span"),ye.EFF(1),ye.nI1(2,"i18n"),ye.k0s()),2&e&&(ye.R7$(),ye.SpI(" ",ye.bMT(2,1,"restrictedGroupAccessDesc")," "))}function ao(e,i){1&e&&(ye.j41(0,"span"),ye.EFF(1),ye.nI1(2,"i18n"),ye.k0s()),2&e&&(ye.R7$(),ye.SpI(" ",ye.bMT(2,1,"restrictedCollectionAssignmentDesc")," "))}function co(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"bit-tab-group",13),ye.mxI("selectedIndexChange",function(i){b.eBV(e);const t=ye.XpG();return ye.DH7(t.tabIndex,i)||(t.tabIndex=i),b.Njj(i)}),ye.j41(1,"bit-tab",14),ye.nI1(2,"i18n"),ye.j41(3,"bit-form-field")(4,"bit-label"),ye.EFF(5),ye.nI1(6,"i18n"),ye.k0s(),ye.nrm(7,"input",15),ye.j41(8,"bit-hint"),ye.EFF(9),ye.nI1(10,"i18n"),ye.k0s()(),ye.DNE(11,ro,8,6,"bit-form-field",4),ye.k0s(),ye.j41(12,"bit-tab",14),ye.nI1(13,"i18n"),ye.j41(14,"p"),ye.EFF(15),ye.nI1(16,"i18n"),ye.DNE(17,lo,3,3,"span",4),ye.nI1(18,"async"),ye.k0s(),ye.nrm(19,"bit-access-selector",16),ye.nI1(20,"i18n"),ye.nI1(21,"i18n"),ye.nI1(22,"i18n"),ye.k0s(),ye.j41(23,"bit-tab",14),ye.nI1(24,"i18n"),ye.j41(25,"p"),ye.EFF(26),ye.nI1(27,"i18n"),ye.DNE(28,ao,3,3,"span",4),ye.nI1(29,"async"),ye.k0s(),ye.nrm(30,"bit-access-selector",17),ye.nI1(31,"i18n"),ye.nI1(32,"i18n"),ye.nI1(33,"i18n"),ye.k0s()()}if(2&e){const e=ye.XpG();ye.R50("selectedIndex",e.tabIndex),ye.R7$(),ye.Y8G("label",ye.mNQ(ye.bMT(2,25,"groupInfo"))),ye.R7$(4),ye.JRh(ye.bMT(6,27,"name")),ye.R7$(4),ye.JRh(ye.i5U(10,29,"characterMaximum",100)),ye.R7$(2),ye.Y8G("ngIf",e.isExternalIdVisible),ye.R7$(),ye.Y8G("label",ye.mNQ(ye.bMT(13,32,"members"))),ye.R7$(3),ye.SpI(" ",ye.bMT(16,34,"editGroupMembersDesc")," "),ye.R7$(2),ye.Y8G("ngIf",ye.bMT(18,36,e.cannotAddSelfToGroup$)),ye.R7$(2),ye.Y8G("items",e.members)("showMemberRoles",!0)("permissionMode",e.PermissionMode.Hidden)("columnHeader",ye.bMT(20,38,"member"))("selectorLabelText",ye.bMT(21,40,"selectMembers"))("emptySelectionText",ye.bMT(22,42,"noMembersAdded")),ye.R7$(4),ye.Y8G("label",ye.mNQ(ye.bMT(24,44,"collections"))),ye.R7$(3),ye.SpI(" ",ye.bMT(27,46,"editGroupCollectionsDesc")," "),ye.R7$(2),ye.Y8G("ngIf",!ye.bMT(29,48,e.canAssignAccessToAnyCollection$)),ye.R7$(2),ye.Y8G("items",e.collections)("permissionMode",e.PermissionMode.Edit)("columnHeader",ye.bMT(31,50,"collection"))("selectorLabelText",ye.bMT(32,52,"selectCollections"))("emptySelectionText",ye.bMT(33,54,"noCollectionsAdded"))}}!function(e){e[e.Info=0]="Info",e[e.Members=1]="Members",e[e.Collections=2]="Collections"}(Nn||(Nn={})),function(e){e.Saved="saved",e.Canceled="canceled",e.Deleted="deleted"}(Qn||(Qn={}));class ho{get groupId(){return this.params.groupId}get organizationId(){return this.params.organizationId}get isExternalIdVisible(){var e;return!!(null===(e=this.groupForm.get("externalId"))||void 0===e?void 0:e.value)}get editMode(){return null!=this.groupId}get orgMembers$(){return(0,Yn.H)(this.organizationUserApiService.getAllMiniUserDetails(this.organizationId)).pipe((0,M.T)(e=>e.data.map(e=>{var i;return{id:e.id,type:Ie.Uv.Member,email:e.email,role:e.type,listName:(null===(i=e.name)||void 0===i?void 0:i.length)>0?`${e.name} (${e.email})`:e.email,labelName:e.name||e.email,status:e.status,userId:e.userId}})))}constructor(e,i,t,n,o,s,r,l,a,c,h,u,p,v,g,m){var f;this.params=e,this.dialogRef=i,this.apiService=t,this.organizationUserApiService=n,this.groupService=o,this.i18nService=s,this.platformUtilsService=r,this.logService=l,this.formBuilder=a,this.changeDetectorRef=c,this.dialogService=h,this.organizationService=u,this.accountService=p,this.collectionAdminService=v,this.toastService=g,this.configService=m,this.btnTextAddCreateFeatureFlag=(0,y.ot)(this.configService.getFeatureFlag$(Y.TO.PM32380_BtnTextAddCreate),{initialValue:!1}),this.organization$=this.accountService.activeAccount$.pipe((0,R.n)(e=>this.organizationService.organizations$(null==e?void 0:e.id).pipe((0,d.Sw)(this.organizationId)).pipe((0,k.t)({refCount:!0})))),this.PermissionMode=Ie.ZC,this.ResultType=Qn,this.loading=!0,this.collections=[],this.members=[],this.groupForm=this.formBuilder.group({name:["",[Se.k0.required,Se.k0.maxLength(100)]],externalId:this.formBuilder.control({value:"",disabled:!1}),members:[[]],collections:[[]]}),this.destroy$=new C.B,this.orgCollections$=this.accountService.activeAccount$.pipe(Q.F6,(0,R.n)(e=>this.collectionAdminService.collectionAdminViews$(this.organizationId,e)),(0,k.t)({refCount:!0,bufferSize:1})),this.groupDetails$=(0,A.of)(this.editMode).pipe((0,j.H)(e=>e?(0,$.z)([this.groupService.get(this.organizationId,this.groupId),this.apiService.getGroupUsers(this.organizationId,this.groupId)]).pipe((0,M.T)(([e,i])=>Object.assign(Object.assign({},e),{members:i})),(0,D.W)(e=>(e instanceof Hn._?this.logService.error(e.message):this.logService.error(e.toString()),(0,A.of)(void 0)))):(0,A.of)(void 0)),(0,k.t)({refCount:!0,bufferSize:1})),this.allowAdminAccessToAllCollectionItems$=this.organization$.pipe((0,M.T)(e=>e.allowAdminAccessToAllCollectionItems)),this.canAssignAccessToAnyCollection$=(0,$.z)([this.organization$,this.allowAdminAccessToAllCollectionItems$]).pipe((0,M.T)(([e,i])=>e.canEditAnyCollection||e.permissions.manageGroups&&i)),this.cannotAddSelfToGroup$=(0,$.z)([this.allowAdminAccessToAllCollectionItems$,this.groupDetails$]).pipe((0,M.T)(([e,i])=>!e&&null!=i)),this.submit=()=>no(this,void 0,void 0,function*(){var e,i;if(this.groupForm.markAllAsTouched(),this.groupForm.invalid)return void(this.tabIndex!==Nn.Info&&this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("fieldOnTabRequiresAttention",this.i18nService.t("groupInfo"))}));const t=this.groupForm.value,n={id:this.groupId,organizationId:this.organizationId,name:t.name,members:null!==(i=null===(e=t.members)||void 0===e?void 0:e.map(e=>e.id))&&void 0!==i?i:[],collections:t.collections.map(e=>(0,Ie.yo)(e)),externalId:t.externalId};yield this.groupService.save(n),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t(this.editMode?"editedGroupId":"createdGroupId",t.name)}),yield this.dialogRef.close(Qn.Saved)}),this.delete=()=>no(this,void 0,void 0,function*(){if(!this.editMode)return;if(!(yield this.dialogService.openSimpleDialog({title:this.group.name,content:{key:"deleteGroupConfirmation"},type:"warning"})))return!1;yield this.groupService.delete(this.organizationId,this.groupId),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedGroupId",this.group.name)}),yield this.dialogRef.close(Qn.Deleted)}),this.tabIndex=null!==(f=e.initialTab)&&void 0!==f?f:Nn.Info}ngOnInit(){this.loading=!0,this.title=this.i18nService.t(this.editMode?"editGroup":this.btnTextAddCreateFeatureFlag()?"addGroup":"newGroup"),(0,$.z)([this.orgCollections$,this.orgMembers$,this.groupDetails$,this.cannotAddSelfToGroup$,this.accountService.activeAccount$,this.organization$]).pipe((0,B.Q)(this.destroy$)).subscribe(([e,i,t,n,o,s])=>{var r;if(this.members=i,this.group=t,this.collections=function(e,i,t){return e.map(e=>{var n;const o=null!==(n=null==t?void 0:t.collections.find(i=>i.id==e.id))&&void 0!==n?n:void 0;return{id:e.id,type:Ie.Uv.Collection,labelName:e.name,listName:e.name,readonly:!e.canEditGroupAccess(i),readonlyPermission:o?(0,Ie.Jh)(o):void 0}}).filter(e=>!e.readonly||(null==t?void 0:t.collections.some(i=>i.id==e.id)))}(e,s,t),null!=this.group&&(this.changeDetectorRef.detectChanges(),this.groupForm.patchValue({name:this.group.name,externalId:this.group.externalId,members:this.group.members.map(e=>({id:e,type:Ie.Uv.Member})),collections:uo(t,this.collections)})),n){const e=null===(r=this.members.find(e=>e.userId===o.id))||void 0===r?void 0:r.id,i=this.groupForm.value.members.some(i=>i.id===e);null==e||i||(this.members=this.members.filter(i=>i.id!==e))}this.loading=!1})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}function uo(e,i){return e.collections.filter(e=>!i.find(i=>i.id==e.id).readonly).map(e=>({id:e.id,type:Ie.Uv.Collection,permission:(0,Ie.Jh)(e)}))}ho.ɵfac=function(e){return new(e||ho)(ye.rXU(be.Qs),ye.rXU(we.ce),ye.rXU(di.G),ye.rXU(fe.uB),ye.rXU(l.EB),ye.rXU(_.W),ye.rXU(L.y),ye.rXU(H.K),ye.rXU(Se.ok),ye.rXU(I.gRc),ye.rXU(ne.o),ye.rXU(d.PV),ye.rXU(N.D),ye.rXU(fe.vE),ye.rXU(oe.f),ye.rXU(O.w))},ho.ɵcmp=ye.VBU({type:ho,selectors:[["app-group-add-edit"]],standalone:!1,decls:16,vars:17,consts:[["bit-dialog","","dialogSize","large",3,"formGroup","bitSubmit"],["bitDialogTitle",""],["class","tw-text-sm tw-normal-case tw-text-muted",4,"ngIf"],["bitDialogContent",""],[4,"ngIf"],[3,"selectedIndex","selectedIndexChange",4,"ngIf"],["bitDialogFooter",""],["bitButton","","buttonType","primary","bitFormButton","","type","submit"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"],["type","button","buttonType","dangerGhost","bitIconButton","bwi-trash","bitFormButton","",1,"tw-ml-auto",3,"bitAction","label"],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[3,"selectedIndexChange","selectedIndex"],[3,"label"],["bitInput","","appAutofocus","","type","text","formControlName","name"],["formControlName","members",3,"items","showMemberRoles","permissionMode","columnHeader","selectorLabelText","emptySelectionText"],["formControlName","collections",3,"items","permissionMode","columnHeader","selectorLabelText","emptySelectionText"],["bitInput","","type","text","formControlName","externalId","readonly",""]],template:function(e,i){1&e&&(ye.j41(0,"form",0)(1,"span",1),ye.EFF(2),ye.DNE(3,oo,2,1,"span",2),ye.k0s(),ye.j41(4,"div",3),ye.DNE(5,so,6,7,"div",4)(6,co,34,56,"bit-tab-group",5),ye.k0s(),ye.qex(7,6),ye.j41(8,"button",7),ye.EFF(9),ye.nI1(10,"i18n"),ye.k0s(),ye.j41(11,"button",8),ye.EFF(12),ye.nI1(13,"i18n"),ye.k0s(),ye.nrm(14,"button",9),ye.nI1(15,"i18n"),ye.bVm(),ye.k0s()),2&e&&(ye.Y8G("formGroup",i.groupForm)("bitSubmit",i.submit),ye.R7$(2),ye.SpI(" ",i.title," "),ye.R7$(),ye.Y8G("ngIf",i.editMode),ye.R7$(2),ye.Y8G("ngIf",i.loading),ye.R7$(),ye.Y8G("ngIf",!i.loading),ye.R7$(3),ye.SpI(" ",ye.bMT(10,11,"save")," "),ye.R7$(2),ye.Y8G("bitDialogClose",i.ResultType.Canceled),ye.R7$(),ye.SpI(" ",ye.bMT(13,13,"cancel")," "),ye.R7$(2),ye.Y8G("bitAction",i.delete)("label",ye.bMT(15,15,"delete")))},dependencies:[Ce.bT,Se.qT,Se.me,Se.BC,Se.cb,Se.j4,Se.JD,Ki.B,Ln.p,$e.$,Te.L,xe.Q,Ae.I,ze.m,Me.hJ,Jn.j,Zn.I,Kn.J,eo.h,Ri.s,io.W,to.j,Fe.t,Ce.Jj,Ge.$],encapsulation:2});var po=t(94438),vo=t(50352),go=t(38410),mo=t(22466),fo=t(32316),bo=t(36572),Io=t(69672),yo=function(e,i,t,n){return new(t||(t=Promise))(function(o,s){function r(e){try{a(n.next(e))}catch(i){s(i)}}function l(e){try{a(n.throw(e))}catch(i){s(i)}}function a(e){var i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t(function(e){e(i)})).then(r,l)}a((n=n.apply(e,i||[])).next())})};function wo(e,i){1&e&&(ye.qex(0),ye.nrm(1,"i",5),ye.nI1(2,"i18n"),ye.j41(3,"span",6),ye.EFF(4),ye.nI1(5,"i18n"),ye.k0s(),ye.bVm()),2&e&&(ye.R7$(),ye.Y8G("title",ye.mNQ(ye.bMT(2,3,"loading"))),ye.R7$(3),ye.JRh(ye.bMT(5,5,"loading")))}function So(e,i){1&e&&(ye.j41(0,"p"),ye.EFF(1),ye.nI1(2,"i18n"),ye.k0s()),2&e&&(ye.R7$(),ye.JRh(ye.bMT(2,1,"noGroupsInList")))}function Co(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"tr",21)(1,"td",22),ye.bIt("click",function(){const i=b.eBV(e).$implicit,t=ye.XpG(4);return b.Njj(t.check(i))}),ye.j41(2,"input",23),ye.mxI("ngModelChange",function(i){const t=b.eBV(e).$implicit;return ye.DH7(t.checked,i)||(t.checked=i),b.Njj(i)}),ye.k0s()(),ye.j41(3,"td",24),ye.bIt("click",function(){const i=b.eBV(e).$implicit,t=ye.XpG(4);return b.Njj(t.edit(i))}),ye.j41(4,"button",25),ye.EFF(5),ye.k0s()(),ye.j41(6,"td",22),ye.bIt("click",function(){const i=b.eBV(e).$implicit,t=ye.XpG(4);return b.Njj(t.edit(i,t.ModalTabType.Collections))}),ye.nrm(7,"bit-badge-list",26),ye.k0s(),ye.j41(8,"td",14),ye.nrm(9,"button",16),ye.nI1(10,"i18n"),ye.j41(11,"bit-menu",null,1)(13,"button",27),ye.bIt("click",function(){const i=b.eBV(e).$implicit,t=ye.XpG(4);return b.Njj(t.edit(i))}),ye.nrm(14,"i",28),ye.EFF(15),ye.nI1(16,"i18n"),ye.k0s(),ye.j41(17,"button",27),ye.bIt("click",function(){const i=b.eBV(e).$implicit,t=ye.XpG(4);return b.Njj(t.edit(i,t.ModalTabType.Members))}),ye.nrm(18,"i",29),ye.EFF(19),ye.nI1(20,"i18n"),ye.k0s(),ye.j41(21,"button",27),ye.bIt("click",function(){const i=b.eBV(e).$implicit,t=ye.XpG(4);return b.Njj(t.edit(i,t.ModalTabType.Collections))}),ye.nrm(22,"i",30),ye.EFF(23),ye.nI1(24,"i18n"),ye.k0s(),ye.j41(25,"button",17),ye.bIt("click",function(){const i=b.eBV(e).$implicit,t=ye.XpG(4);return b.Njj(t.delete(i))}),ye.nrm(26,"bit-icon",18),ye.EFF(27),ye.nI1(28,"i18n"),ye.k0s()()()()}if(2&e){const e=i.$implicit,t=ye.sdS(12),n=ye.XpG(4);ye.Y8G("ngClass",n.rowHeightClass),ye.R7$(2),ye.R50("ngModel",e.checked),ye.R7$(3),ye.SpI(" ",e.details.name," "),ye.R7$(2),ye.Y8G("items",e.collectionNames)("maxItems",3),ye.R7$(2),ye.Y8G("label",ye.mNQ(ye.bMT(10,12,"options")))("bitMenuTriggerFor",t),ye.R7$(6),ye.SpI(" ",ye.bMT(16,14,"editInfo")," "),ye.R7$(4),ye.SpI(" ",ye.bMT(20,16,"members")," "),ye.R7$(4),ye.SpI(" ",ye.bMT(24,18,"collections")," "),ye.R7$(4),ye.SpI(" ",ye.bMT(28,20,"delete")," ")}}function $o(e,i){if(1&e&&ye.DNE(0,Co,29,22,"tr",20),2&e){const e=i.$implicit;ye.Y8G("cdkVirtualForOf",e)}}function To(e,i){if(1&e){const e=ye.RV6();ye.j41(0,"bit-table",9),ye.qex(1,10),ye.j41(2,"tr")(3,"th",11)(4,"input",12),ye.nI1(5,"i18n"),ye.bIt("change",function(i){b.eBV(e);const t=ye.XpG(2);return b.Njj(t.toggleAllVisible(i))}),ye.k0s()(),ye.j41(6,"th",13),ye.EFF(7),ye.nI1(8,"i18n"),ye.k0s(),ye.j41(9,"th",14),ye.EFF(10),ye.nI1(11,"i18n"),ye.k0s(),ye.j41(12,"th",15),ye.nrm(13,"button",16),ye.nI1(14,"i18n"),ye.j41(15,"bit-menu",null,0)(17,"button",17),ye.bIt("click",function(){b.eBV(e);const i=ye.XpG(2);return b.Njj(i.deleteAllSelected())}),ye.nrm(18,"bit-icon",18),ye.EFF(19),ye.nI1(20,"i18n"),ye.k0s()()()(),ye.bVm(),ye.DNE(21,$o,1,1,"ng-template",19),ye.k0s()}if(2&e){const e=ye.sdS(16),i=ye.XpG(2);ye.Y8G("dataSource",i.dataSource),ye.R7$(4),ye.BMQ("aria-label",ye.bMT(5,8,"selectAll")),ye.R7$(3),ye.JRh(ye.bMT(8,10,"name")),ye.R7$(3),ye.JRh(ye.bMT(11,12,"collections")),ye.R7$(3),ye.Y8G("label",ye.mNQ(ye.bMT(14,14,"options")))("bitMenuTriggerFor",e),ye.R7$(6),ye.SpI(" ",ye.bMT(20,16,"delete")," ")}}function xo(e,i){if(1&e&&(ye.qex(0),ye.DNE(1,So,3,3,"p",4),ye.j41(2,"cdk-virtual-scroll-viewport",7),ye.DNE(3,To,22,18,"bit-table",8),ye.k0s(),ye.bVm()),2&e){const e=ye.XpG();ye.R7$(),ye.Y8G("ngIf",!e.dataSource.filteredData.length),ye.R7$(),ye.Y8G("itemSize",e.rowHeight),ye.R7$(),ye.Y8G("ngIf",e.dataSource.filteredData.length)}}class Ao{constructor(e,i,t,n,o,s,r,l,a,c){this.apiService=e,this.groupService=i,this.route=t,this.i18nService=n,this.dialogService=o,this.logService=s,this.collectionService=r,this.toastService=l,this.keyService=a,this.accountService=c,this.loading=!0,this.dataSource=new On.s,this.searchControl=new Se.MJ(""),this.rowHeight=50,this.rowHeightClass="tw-h-[50px]",this.ModalTabType=Nn,this.refreshGroups$=new S.t(null),this.configService=(0,b.WQX)(O.w),this.btnTextAddCreateFeatureFlag=(0,y.ot)(this.configService.getFeatureFlag$(Y.TO.PM32380_BtnTextAddCreate),{initialValue:!1}),this.route.params.pipe((0,qn.M)(e=>this.organizationId=e.organizationId),(0,R.n)(()=>(0,$.z)([(0,Yn.H)(this.apiService.getCollections(this.organizationId)).pipe((0,j.H)(e=>this.toCollectionMap(e))),this.refreshGroups$.pipe((0,R.n)(()=>this.groupService.getAllDetails(this.organizationId)))])),(0,M.T)(([e,i])=>i.map(i=>{var t;return{id:i.id,name:i.name,details:i,checked:!1,collectionNames:i.collections.map(i=>{var t;return null===(t=e[i.id])||void 0===t?void 0:t.name}).sort(null===(t=this.i18nService.collator)||void 0===t?void 0:t.compare)}})),(0,y.pQ)()).subscribe(e=>{this.dataSource.data=e,this.loading=!1}),this.searchControl.valueChanges.pipe((0,W.B)(200),(0,y.pQ)()).subscribe(e=>this.dataSource.filter=(e=>{null!=e||(e="");const i=e.trim().toLowerCase();return e=>{const t=e.details;return-1!=t.id.toLowerCase().indexOf(i)||-1!=t.name.toLowerCase().indexOf(i)}})(e)),this.route.queryParams.pipe((0,E.$)(),(0,y.pQ)()).subscribe(e=>{this.searchControl.setValue(e.search)})}edit(e){return yo(this,arguments,void 0,function*(e,i=Nn.Info){const t=(n=this.dialogService,o={data:{initialTab:i,organizationId:this.organizationId,groupId:null!=e?e.details.id:null}},n.open(ho,o));var n,o;const s=yield(0,me.s)(t.closed);s==Qn.Saved?this.refreshGroups$.next():s==Qn.Deleted&&this.removeGroup(e)})}add(){return yo(this,void 0,void 0,function*(){yield this.edit(null)})}delete(e){return yo(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:e.details.name,content:{key:"deleteGroupConfirmation"},type:"warning"})))return!1;try{yield this.groupService.delete(this.organizationId,e.details.id),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedGroupId",e.details.name)}),this.removeGroup(e)}catch(i){this.logService.error(i)}})}deleteAllSelected(){return yo(this,void 0,void 0,function*(){const e=this.dataSource.data.filter(e=>e.checked);if(0==e.length)return;const i=e.map(e=>e.details.name).join(", ");if(!(yield this.dialogService.openSimpleDialog({title:{key:"deleteMultipleGroupsConfirmation",placeholders:[e.length.toString()]},content:i,type:"warning"})))return!1;try{yield this.groupService.deleteMany(this.organizationId,e.map(e=>e.details.id)),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedManyGroups",e.length.toString())}),e.forEach(e=>this.removeGroup(e))}catch(t){this.logService.error(t)}})}check(e){e.checked=!e.checked}toggleAllVisible(e){this.dataSource.filteredData.forEach(i=>i.checked=e.target.checked)}removeGroup(e){this.dataSource.data=this.dataSource.data.filter(i=>i!==e)}toCollectionMap(e){const i=e.data.map(e=>U.pM.fromCollectionData(new U.Fw(e)));return this.accountService.activeAccount$.pipe(Q.F6,(0,R.n)(e=>this.keyService.orgKeys$(e)),(0,R.n)(e=>this.collectionService.decryptMany$(i,e)),(0,M.T)(e=>{const i={};return e.forEach(e=>i[e.id]=e),i}))}}Ao.ɵfac=function(e){return new(e||Ao)(ye.rXU(di.G),ye.rXU(l.EB),ye.rXU(w.nX),ye.rXU(_.W),ye.rXU(ne.o),ye.rXU(H.K),ye.rXU(fe.YD),ye.rXU(oe.f),ye.rXU(_n.Lu),ye.rXU(N.D))},Ao.ɵcmp=ye.VBU({type:Ao,selectors:[["ng-component"]],standalone:!1,decls:8,vars:9,consts:[["headerMenu",""],["rowMenu",""],[1,"tw-w-80",3,"placeholder","formControl"],["bitButton","","type","button","buttonType","primary","startIcon","bwi-plus",3,"click"],[4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["bitScrollLayout","",1,"tw-pb-8",3,"itemSize"],[3,"dataSource",4,"ngIf"],[3,"dataSource"],["header",""],["bitCell","",1,"tw-w-20"],["type","checkbox","bitCheckbox","",3,"change"],["bitCell","","bitSortable","name","default",""],["bitCell",""],["bitCell","",1,"tw-w-10"],["type","button","bitIconButton","bwi-ellipsis-v","size","small",3,"bitMenuTriggerFor","label"],["type","button","bitMenuItem","","variant","danger",3,"click"],["name","bwi-trash","slot","start"],["body",""],["bitRow","",3,"ngClass",4,"cdkVirtualFor","cdkVirtualForOf"],["bitRow","",3,"ngClass"],["bitCell","",1,"tw-cursor-pointer",3,"click"],["type","checkbox","bitCheckbox","",3,"ngModelChange","ngModel"],["bitCell","",1,"tw-cursor-pointer","tw-font-medium",3,"click"],["type","button","bitLink",""],["variant","secondary",3,"items","maxItems"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-user"],["aria-hidden","true",1,"bwi","bwi-collection-shared"]],template:function(e,i){1&e&&(ye.j41(0,"app-header"),ye.nrm(1,"bit-search",2),ye.nI1(2,"i18n"),ye.j41(3,"button",3),ye.bIt("click",function(){return i.add()}),ye.EFF(4),ye.nI1(5,"i18n"),ye.k0s()(),ye.DNE(6,wo,6,7,"ng-container",4)(7,xo,4,3,"ng-container",4)),2&e&&(ye.R7$(),ye.Y8G("placeholder",ye.bMT(2,5,"searchGroups"))("formControl",i.searchControl),ye.R7$(3),ye.SpI(" ",ye.bMT(5,7,i.btnTextAddCreateFeatureFlag()?"addGroup":"newGroup")," "),ye.R7$(2),ye.Y8G("ngIf",i.loading),ye.R7$(),ye.Y8G("ngIf",!i.loading))},dependencies:[Ce.YU,Ce.bT,Se.Zm,Se.BC,Se.vS,Se.l_,po.p,xe.Q,vo.P,Ri.s,en.R,et.g,Mi.Z,Fi.O,Gi.S,go.Q,mo.Y,fo.O,bo._,bo.O,Vi.S,ji.f,o.yg,o.E$,o.d6,Io.lp,Ge.$],encapsulation:2});const zo=[{path:":organizationId",component:Un,canActivate:[(0,h.i)(),c.W_,(0,f.V)(d.OV)],children:[{path:"",pathMatch:"full",canActivate:[(0,kt.r)(function(e){if((0,d.of)(e))return"vault";if((0,d.pe)(e))return"members";if((0,d.ex)(e))return"groups";if((0,d.Ue)(e))return"reporting";if((0,d.Dl)(e))return"settings";return})],children:[]},{path:"vault",loadChildren:()=>Rt},{path:"settings",loadChildren:()=>t.e(449).then(t.bind(t,46449)).then(e=>e.OrganizationSettingsModule)},{path:"members",loadChildren:()=>t.e(281).then(t.bind(t,95281)).then(e=>e.MembersModule)},{component:Ao,path:"groups",canActivate:[(0,f.V)(d.ex)],data:{titleId:"groups"}},{path:"reporting",loadChildren:()=>t.e(767).then(t.bind(t,49767)).then(e=>e.OrganizationReportingModule)},{path:"billing",loadChildren:()=>Promise.all([t.e(979),t.e(680)]).then(t.bind(t,92680)).then(e=>e.OrganizationBillingModule)}]}];class Mo{}Mo.ɵfac=function(e){return new(e||Mo)},Mo.ɵmod=ye.$C({type:Mo}),Mo.ɵinj=b.G2t({imports:[a.iI.forChild(zo),a.iI]});var Fo=t(5326);class Go{}Go.ɵfac=function(e){return new(e||Go)},Go.ɵmod=ye.$C({type:Go}),Go.ɵinj=b.G2t({imports:[Fo.R,Ie.mH,l.Je,Mo,r.G,o.E9,s.o]})},38766(e,i,t){t.d(i,{Jh:()=>s.Jh,NU:()=>s.NU,Uv:()=>s.Uv,ZC:()=>n.Z,df:()=>s.df,mH:()=>o.m,yo:()=>s.yo});var n=t(43184),o=t(97434),s=t(45980)},5326(e,i,t){t.d(i,{R:()=>a});var n=t(60893),o=t(57768),s=t(97434),r=t(14041),l=t(11217);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=r.$C({type:a}),a.ɵinj=l.G2t({imports:[o.G,s.m,n.t,o.G,s.m,n.t]})}}]);
//# sourceMappingURL=848.150540f69b06c47750ea.js.map