import{a as d,b as Q}from"./chunk-DNLJXHMR.js";import{a as V,b as J}from"./chunk-K7GTGYAG.js";import{a as c,b as T,c as i,d as K,g as y,h as X}from"./chunk-T2YK2A3L.js";import{a as U,b as W}from"./chunk-WWZYDBMP.js";import{ce as A,de as O}from"./chunk-3OCEUHZW.js";import{a as E,b as L}from"./chunk-M55KBHC5.js";import{N as j,O as z,P as C,Q as B}from"./chunk-JE2X3YFA.js";import{q as g,v as P}from"./chunk-HW6LKGMV.js";import{Wj as I,Xj as q}from"./chunk-GDJMZZ4C.js";import{g as x,h as $}from"./chunk-V3J5YJ3L.js";import{b as u,c as w}from"./chunk-YTY7HHO3.js";import{Rd as b,g as n,ka as m,ma as v,na as H,r as h,sa as a,x as l,xa as r}from"./chunk-4HFZZ7HS.js";import{a as p,b as f,e as S}from"./chunk-SZAW6ZBW.js";var F,k=S(()=>{Q();T();J();v();K();b();z();W();w();F=(()=>{class o{constructor(e,t,s){this.dataSourceSettingsService=e,this.dropdownHelper=t,this.translatorService=s,this.subscriptionEdited=new n,this.selectedCheckboxValuesChanged=new n,this.isSaving=!1,this.excludedActions=[i.Created,i.Executed,i.Viewed,i.Copied,i.Exported,i.Synchronized,i.ResetPasswordScheduleAdded,i.ResetPasswordScheduleDeleted,i.InvalidValue,i.DevolutionsGatewayDown]}initCheckboxValues(){let e=this.dataSourceSettingsService.dataSourceSettingsSnapshot?.excludedUserSubscriptionAction.concat(this.excludedActions);return this.dropdownHelper.initComboEnum(d,e).map(t=>f(p({},t),{label:this.translatorService.translate(`NotificationEventAction_${d[t.value]}`)}))}getCheckboxValuesForSessions(){let e=[i.Opened,i.Closed];return this.initCheckboxValues().filter(t=>!e.includes(t.value))}selectedValuesToFilter(e){let t=[];return e.forEach(s=>t.push({filterTarget:c.Action,textSearchModel:{inverseResult:!1,searchItem:V.ExactExpression},value:i[s.value]})),t}toggleIsSaving(){this.isSaving?setTimeout(()=>this.isSaving=!1,1e3):this.isSaving=!0}static{this.\u0275fac=function(t){return new(t||o)(r(j),r(U),r(u))}}static{this.\u0275prov=a({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})()});var ge,ee=S(()=>{L();v();T();H();b();w();$();B();X();q();k();O();P();ge=(()=>{class o extends E{constructor(e,t,s,D,R,N,M,G){super(e,t,s),this.subscriptionService=D,this.assetServices=R,this.userSubscriptionEditService=N,this.connectionService=M,this.router=G,this.viewRequest=new n}view(){this.viewRequest.next()}getUserSubscriptions(e=!1){return this.getCache(e,this.getUserSubscriptionsInternal())}getUserSubscriptionsViewModels(e=!1){return this.getUserSubscriptions(e).pipe(l(t=>this.toViewModels(t)))}getSubscriptionConnectionId(e){let t=e.filters.find(s=>s.filterTarget===c.ID);return t?t.value:null}refreshUserSubscriptions(){this.userSubscriptionEditService.subscriptionEdited.next()}delete(e){return this.subscriptionService.delete(e)}onEntryClick(e){let t=e.filters.find(s=>s.filterTarget===c.ID)?.value;t&&this.connectionService.getPartialConnection(t).subscribe(s=>this.router.navigate([`connections/${s.repositoryId}/${s.id}`]))}toViewModels(e){return this.subscriptionService.toViewModels(e)}getUserSubscriptionsInternal(){return this.currentUserService.isLogged()?this.assetServices.GetSubscriptionsForCurrentUser().pipe(m(e=>this.handleGetApiResult(e)),l(e=>this.returnWhenSuccessful(e,()=>e.data??[]))):h([])}static{this.\u0275fac=function(t){return new(t||o)(r(u),r(x),r(C),r(y),r(I),r(F),r(A),r(g))}}static{this.\u0275prov=a({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})()});export{F as a,k as b,ge as c,ee as d};
