1import{a as b}from"./chunk-SPFBN2HL.js";import{a as R}from"./chunk-RL23CMKJ.js";import{a as U}from"./chunk-7RJ7KBOV.js";import"./chunk-XZDAMPUP.js";import{b as K,c as L}from"./chunk-RB2YP5E2.js";import{k as B,n as G}from"./chunk-QIIVFJNA.js";import{C as H,c as Q,h as $,m as z}from"./chunk-DJ7NG7WZ.js";import{c as j}from"./chunk-KI4XJKCH.js";import{a as W,h as q,j as Y}from"./chunk-NERRRF6P.js";import{w as N}from"./chunk-SXBT3OYT.js";import"./chunk-SN3EPBFH.js";import"./chunk-EHPYMWXB.js";import"./chunk-7ZFPQAIH.js";import{za as F}from"./chunk-7NPDSOWV.js";import"./chunk-R5IULLQ2.js";import"./chunk-LEKN3M5J.js";import"./chunk-KFHTLBNQ.js";import"./chunk-YV5TISNX.js";import"./chunk-IDF3EASQ.js";import"./chunk-WJESYQVL.js";import{$c as E,Aa as y,Bc as S,Cc as o,Dc as r,Ea as w,Ec as k,Fa as h,Ib as l,La as m,Lc as g,Ma as p,Md as P,Uc as C,Wc as a,Zb as M,_c as V,ad as D,dc as T,ed as v,jd as s,pd as O,qd as A,rd as I,sa as f,t as x,uc as d,wc as _}from"./chunk-K6IHZUMJ.js";var J=(()=>{class e{constructor(t){this.apiService=t}activate(t){return this.apiService.post("slack/activate",{webhook:t})}deactivate(){return this.apiService.post("slack/deactivate")}getSettings(){return this.apiService.get("slack/settings")}saveSettings(t){return this.apiService.post("slack/settings",{webhook:t})}static{this.\u0275fac=function(n){return new(n||e)(w(F))}}static{this.\u0275prov=y({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Z=["setupDialog"];function tt(e,u){if(e&1){let t=g();o(0,"yon-button",5),C("onClick",function(){m(t);let i=a();return p(i.onDeactivate())}),s(1,"DEACTIVATE"),r()}}function et(e,u){if(e&1){let t=g();o(0,"yon-button",5),C("onClick",function(){m(t);let i=a();return p(i.onSetup())}),s(1,"SETUP SLACK"),r()}}function it(e,u){e&1&&(o(0,"div")(1,"h2"),s(2,"Slack is configured"),r(),o(3,"p"),s(4,"Go to notification settings to configure what events should be sent to Slack."),r()())}function nt(e,u){if(e&1){let t=g();o(0,"div")(1,"mat-form-field")(2,"input",7),I("ngModelChange",function(i){m(t);let c=a(2);return A(c.webhook,i)||(c.webhook=i),p(i)}),r()(),o(3,"yon-button",8),C("onClick",function(){m(t);let i=a(2);return p(i.onActivate())}),s(4," ACTIVATE "),r()()}if(e&2){let t=a(2);l(2),O("ngModel",t.webhook),l(),S("disabled",!t.webhook)}}function ot(e,u){if(e&1){let t=g();o(0,"div",6),k(1,"yon-icon",9),o(2,"p"),s(3," Younium and Slack are now integrated. Go to the notification tab and setup what should be sent to Slack. "),r(),o(4,"yon-button",10),C("onClick",function(){m(t),a(2);let i=v(6);return p(i.close())}),s(5,"OK"),r()()}e&2&&S("@slideInOut",void 0)}function rt(e,u){if(e&1&&(d(0,nt,5,2,"div"),d(1,ot,6,1,"div",6)),e&2){let t=a();_(t.settings!=null&&t.settings.isActive?-1:0),l(),_(t.settings!=null&&t.settings.isActive?1:-1)}}var Mt=(()=>{class e{constructor(){this.unsubscribe$=new x,this.notificationService=h(j),this.slackService=h(J)}ngOnInit(){this.slackService.getSettings().pipe(f(this.unsubscribe$)).subscribe(t=>this.settings=t)}onSetup(){this.setupDialog.show()}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}onActivate(){this.slackService.saveSettings(this.webhook).pipe(f(this.unsubscribe$)).subscribe({next:t=>{this.settings=t},error:t=>this.notificationService.error(b.toMessage(t,"Failed to activate the Slack integration."))})}onDeactivate(){this.slackService.deactivate().pipe(f(this.unsubscribe$)).subscribe({next:t=>{this.settings=t},error:t=>this.notificationService.error(b.toMessage(t,"Failed to deactivate the Slack integration."))})}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=M({type:e,selectors:[["yon-settings-slack"]],viewQuery:function(n,i){if(n&1&&V(Z,5),n&2){let c;E(c=D())&&(i.setupDialog=c.first)}},decls:9,vars:3,consts:[["setupDialog",""],["setupDialogContent",""],["header","Slack"],["color","primary"],["header","Slack setup",3,"containerTemplate"],["color","primary",3,"onClick"],[1,"text-center"],["matInput","","placeholder","Slack webhook url",3,"ngModelChange","ngModel"],["color","primary",3,"onClick","disabled"],["name","check_circle"],[3,"onClick"]],template:function(n,i){if
1(n&1&&(o(0,"yon-card",2)(1,"yon-card-header-right"),d(2,tt,2,0,"yon-button",3)(3,et,2,0,"yon-button",3),r(),d(4,it,5,0,"div"),r(),k(5,"yon-dialog",4,0),T(7,rt,2,2,"ng-template",null,1,P)),n&2){let c=v(8);l(2),_(i.settings!=null&&i.settings.isActive?2:3),l(2),_(i.settings!=null&&i.settings.isActive?4:-1),l(),S("containerTemplate",c)}},dependencies:[H,Q,$,z,q,Y,N,U,W,G,B,L,K],styles:["h4[_ngcontent-%COMP%]{font-size:1.2rem}h2[_ngcontent-%COMP%]{font-size:1.9 rem}p[_ngcontent-%COMP%], section[_ngcontent-%COMP%] p{font-size:.8rem}ul.settings__dotted-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{list-style-type:initial;margin-left:30px}section[_ngcontent-%COMP%] h4{display:inline;margin-left:10px;vertical-align:top}.mat-mdc-radio-group[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column}.mat-mdc-radio-button[_ngcontent-%COMP%]{margin:5px}.mat-mdc-outlined-button[_ngcontent-%COMP%]{color:#00000094}"],data:{animation:[R.slideInOut]}})}}return e})();export{Mt as SettingsSlackComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.