1import{a as ne}from"./chunk-SJJL45FZ.js";import{a as ee,b as te}from"./chunk-PJPUVK7K.js";import{b as X,d as $}from"./chunk-CHZLVAUG.js";import"./chunk-CDFI3T4I.js";import"./chunk-77NG3VXC.js";import{d as N,g as A}from"./chunk-MHGUBVXK.js";import"./chunk-X3JMCOQX.js";import"./chunk-BV2OUJIG.js";import"./chunk-N33DLVOR.js";import{a as K,b as Q}from"./chunk-LY2L7L3N.js";import"./chunk-4ZNKTWHU.js";import{m as W,o as Y}from"./chunk-C53UORQN.js";import"./chunk-O6XYH7PW.js";import"./chunk-HYT4FRIV.js";import"./chunk-GRKZLBTJ.js";import"./chunk-DNJMDJPD.js";import"./chunk-WYFHTUC5.js";import"./chunk-SJPXSUWQ.js";import"./chunk-N4X2ZSCK.js";import{p as V}from"./chunk-YBSG77R6.js";import"./chunk-JMVK4GP4.js";import"./chunk-I6AEVJLZ.js";import{g as R}from"./chunk-DXTONCKZ.js";import{b as L,c as F}from"./chunk-HRCH7YTL.js";import"./chunk-ZUVYQ52R.js";import{a as b}from"./chunk-V2N2YMJZ.js";import"./chunk-3WKYSXKM.js";import"./chunk-LO4BUZD5.js";import{i as Z,j as J}from"./chunk-HFX225X2.js";import{I as j,i as z,j as q,k as B,n as u,x as G,y as H}from"./chunk-3QAVFP5S.js";import{j as D,l as I}from"./chunk-NKUORADV.js";import"./chunk-A5YLLBSK.js";import"./chunk-VJLDJJUQ.js";import"./chunk-224PXFJJ.js";import{p as U}from"./chunk-2K5EWLY6.js";import{$b as c,Aa as M,Da as E,Ec as P,Fb as y,Gc as g,J as x,Ja as h,Sc as O,Vc as o,ac as d,dc as r,fa as v,fc as s,kc as _,lc as i,mc as t,nc as p,pb as a,qa as f,vc as T,xa as S,ya as w,za as k}from"./chunk-QXK5WLZZ.js";import"./chunk-MH5V57HS.js";function ie(n,m){n&1&&(i(0,"div",4),d(function(){return"ih-fade-in-out-leave"}),c(function(){return"ih-fade-in-out-enter"}),i(1,"div",22),o(2,"Invalid Token"),t(),i(3,"div",23),o(4,"The token you provided is invalid or expired"),t()())}function oe(n,m){n&1&&(i(0,"ih-animated-check"),d(function(){return"ih-fade-in-out-leave"}),c(function(){return"ih-fade-in-out-enter"}),t())}function ae(n,m){n&1&&(i(0,"ih-animated-check"),d(function(){return"ih-fade-in-out-leave"}),c(function(){return"ih-fade-in-out-enter"}),t())}function le(n,m){n&1&&(i(0,"ih-animated-check"),d(function(){return"ih-fade-in-out-leave"}),c(function(){return"ih-fade-in-out-enter"}),t())}function re(n,m){n&1&&(i(0,"ih-animated-check"),d(function(){return"ih-fade-in-out-leave"}),c(function(){return"ih-fade-in-out-enter"}),t())}function se(n,m){n&1&&(i(0,"ih-animated-check"),d(function(){return"ih-fade-in-out-leave"}),c(function(){return"ih-fade-in-out-enter"}),t())}function me(n,m){n&1&&(i(0,"ih-animated-check"),d(function(){return"ih-fade-in-out-leave"}),c(function(){return"ih-fade-in-out-enter"}),t())}function ce(n,m){n&1&&(i(0,"ih-animated-check"),d(function(){return"ih-fade-in-out-leave"}),c(function(){return"ih-fade-in-out-enter"}),t())}function de(n,m){if(n&1&&(i(0,"div",11)(1,"label",13),o(2,"Email when new content is submitted"),t(),r(3,ce,1,0,"ih-animated-check"),p(4,"mat-slide-toggle",24),t()),n&2){let e=g(2);a(3),s(e.fieldStatus.newContentSubmitted()==="applied"?3:-1)}}function pe(n,m){if(n&1){let e=T();i(0,"div",1)(1,"div",2),o(2,"Email preferences"),t(),i(3,"div",3),o(4," Choose which types of email communications you would like to receive "),t()(),r(5,ie,5,0,"div",4),i(6,"div",5)(7,"div",6)(8,"mat-icon"),k(),i(9,"svg",7),p(10,"path",8),t()(),o(11," EMAIL "),M(),p(12,"span",9),r(13,oe,1,0,"ih-animated-check"),i(14,"button",10),P("click",function(){S(e);let C=g();return w(C.unsubscribeAll())}),o(15," Unsubscribe from all "),t()(),i(16,"div",11)(17,"div",12)(18,"span",13),o(19,"Newsletter frequency"),t(),i(20,"span",14),o(21," Email newsletter with posts from your channels "),t()(),r(22,ae,1,0,"ih-animated-check"),i(23,"mat-form-field",15)(24,"mat-select",16)(25,"mat-option",17),o(26,"Daily"),t(),i(27,"mat-option",17),o(28,"Weekly"),t(),i(29,"mat-option",17),o(30,"Never"),t()()()(),i(31,"div",11)(32,"label",13),o(33,"Email for new comments"),t(),r(34,le,1,0,"ih-animated-check"),p(35,"mat-slide-toggle",18),t(),i(36,"div",11)(37,"label",13),o(38,"Email for new messages"),t(),r(39,re,1,0,"ih-animated-check"),p(40,"mat-slide-toggle",19),t(),i(41,"div",11)(42,"label",13),o(43,"Email when comment approved"),t(),r(44,se,1,0,"ih-animated-check"),p(45,"mat-slide-toggle",20),t(),i(46,"div",11)(47,"label",13),o(48,"Email when post approved"),t(),r(49,me,1,0,"ih-animated-check"),p(50,"mat-slide-toggle",21),t(),r(51,de,5,1,"div",11),t()}if(n&2){let e=g();a(5),s(e.invalidToken()?5:-1),a(),_("formGroup",e.emailSettings),a(7),s(e.fieldStatus.enabled()==="applied"?13:-1),a(),_("disabled",e.invali
1dToken()),a(8),s(e.fieldStatus.newsletterFrequencyId()==="applied"?22:-1),a(3),_("value",1),a(2),_("value",2),a(2),_("value",3),a(5),s(e.fieldStatus.comments()==="applied"?34:-1),a(5),s(e.fieldStatus.messages()==="applied"?39:-1),a(5),s(e.fieldStatus.commentApproved()==="applied"?44:-1),a(5),s(e.fieldStatus.postApproved()==="applied"?49:-1),a(2),s(e.newContentSubmittedDisabled?-1:51)}}function ue(n,m){n&1&&(i(0,"div",0),p(1,"mat-spinner"),t())}var ze=(()=>{class n{hostClass=!0;http=f(U);snackbar=f(W);security=f(Y);route=f(R);destroyRef=f(E);invalidToken=h(!1);loading=h(!0);fieldStatus={};fieldStatusTimeout={};emailSettings=new B({newsletterFrequencyId:new u(null),enabled:new u(!1,{nonNullable:!0}),comments:new u(!1,{nonNullable:!0}),messages:new u(!1,{nonNullable:!0}),postApproved:new u(!1,{nonNullable:!0}),commentApproved:new u(!1,{nonNullable:!0}),newContentSubmitted:new u(!1,{nonNullable:!0})});newContentSubmittedDisabled=!this.security.canChannel(V.PostsPublishScheduleArchive,null);constructor(){Object.keys(this.emailSettings.controls).forEach(e=>{this.fieldStatus[e]=h("unchanged")})}ngOnInit(){Object.keys(this.emailSettings.controls).forEach(e=>{let l=this.emailSettings.get(e);l&&l.valueChanges.pipe(b(this.destroyRef)).subscribe(()=>{this.fieldStatus[e].set("changed")})}),this.emailSettings.valueChanges.pipe(b(this.destroyRef)).subscribe(()=>{this.save()}),this.http.get("/api/unsubscribe",{params:{token:this.route.snapshot.queryParams.token}}).pipe(b(this.destroyRef),v(e=>{this.emailSettings.setValue(e,{emitEvent:!1}),this.loading.set(!1)}),x(e=>{throw this.invalidToken.set(!0),this.loading.set(!1),this.emailSettings.disable({emitEvent:!1}),e})).subscribe()}unsubscribeAll(){this.emailSettings.setValue({newsletterFrequencyId:3,enabled:!1,comments:!1,messages:!1,postApproved:!1,commentApproved:!1,newContentSubmitted:!1})}save(){this.http.post("/api/unsubscribe",this.emailSettings.value,{params:{token:this.route.snapshot.queryParams.token}}).pipe(b(this.destroyRef),x(e=>{throw this.snackbar.open("Error saving notification settings","TRY AGAIN").then(l=>l.onAction().pipe(b(this.destroyRef)).subscribe(()=>this.save())),e})).subscribe(()=>{Object.keys(this.emailSettings.controls).forEach(e=>{this.fieldStatus[e]()==="changed"&&(this.fieldStatus[e].set("applied"),this.fieldStatusTimeout[e]&&clearTimeout(this.fieldStatusTimeout[e]),this.fieldStatusTimeout[e]=setTimeout(()=>this.fieldStatus[e].set("unchanged"),2e3))})})}static \u0275fac=function(l){return new(l||n)};static \u0275cmp=y({type:n,selectors:[["ih-unsubscribe"]],hostVars:2,hostBindings:function(l,C){l&2&&O("ih-unsubscribe",C.hostClass)},decls:2,vars:1,consts:[[1,"loading"],[1,"update-email-preferences","fx-flex","fx-layout-column","fx-layout-align-center-center"],[1,"update-email-preferences-title"],[1,"update-email-preferences-text"],[1,"invalid-token","fx-flex","fx-layout-column","fx-layout-align-center-center"],[1,"section-block",3,"formGroup"],[1,"subheader"],["viewBox","0 0 24 24"],["fill","currentColor","d","M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"],[1,"fx-flex"],["mat-flat-button","","color","warn","aria-label","Toggle email notifications",3,"click","disabled"],[1,"option-row"],[1,"fx-layout-column","fx-flex"],[1,"notification-item-label"],[1,"notification-item-info","fx-hide-lt-sm"],["appearance","outline","subscriptSizing","dynamic"],["formControlName","newsletterFrequencyId"],[3,"value"],["formControlName","comments","aria-label","Email for new comments"],["formControlName","messages","aria-label","Email for new messages"],["formControlName","commentApproved","aria-label","Email when comment approved"],["formControlName","postApproved","aria-label","Email when post approved"],[1,"invalid-token-title"],[1,"invalid-token-text"],["formControlName","newContentSubmitted","aria-label","Email when new content is submitted"]],template:function(l,C){l&1&&r(0,pe,52,13)(1,ue,2,0,"div",0),l&2&&s(C.loading()?1:0)},dependencies:[I,D,J,Z,F,L,A,N,Q,K,$,X,te,ee,j,z,q,H,G,ne],styles:["[_nghost-%COMP%]{display:block;padding:32px 0;max-width:1200px;margin:0 auto;position:relative}.update-email-preferences[_ngcontent-%COMP%]{font-size:24px;font-weight:500;margin:0 auto 32px;min-height:114px}.update-email-preferences-text[_ngcontent-%COMP%]{font-size:16px;font-weight:400;text-align:center;max-width:560px;width:calc(100vw - 32px)}
1.unsubscribe[_ngcontent-%COMP%], .invalid-token[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;background-color:#fff;margin:32px 16px;border-radius:28px;padding:24px}.unsubscribe[_ngcontent-%COMP%] .unsubscribe-title[_ngcontent-%COMP%], .unsubscribe[_ngcontent-%COMP%] .invalid-token-title[_ngcontent-%COMP%], .invalid-token[_ngcontent-%COMP%] .unsubscribe-title[_ngcontent-%COMP%], .invalid-token[_ngcontent-%COMP%] .invalid-token-title[_ngcontent-%COMP%]{font-size:24px;font-weight:500;margin-bottom:16px}ih-animated-check[_ngcontent-%COMP%]{margin-right:16px;height:24px;width:24px}.unsubscribe-text[_ngcontent-%COMP%]{font-size:18px;font-weight:500}.unsubscribe[_ngcontent-%COMP%]{border:1px solid #4caf50;background-color:#dfd;text-align:center}.invalid-token[_ngcontent-%COMP%]{border:1px solid #f44336;background-color:#fdd;text-align:center}.notification-item-label.disabled[_ngcontent-%COMP%]{color:#00000061;font-weight:400}.option-row[_ngcontent-%COMP%]{align-items:center;background-color:#fff;display:flex;flex-direction:row;min-height:60px;padding:6px 16px}.section-block[_ngcontent-%COMP%]{background-color:#fff;border-radius:4px;box-shadow:0 1px 3px #0003,0 1px 1px #00000024,0 2px 1px -1px #0000001f;margin:0 16px}.section-block[_ngcontent-%COMP%] .option-row[_ngcontent-%COMP%]:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px}.section-block[_ngcontent-%COMP%] .subheader[_ngcontent-%COMP%]{align-items:center;background-color:#d3d3d3;border-radius:4px 4px 0 0;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;color:#000;display:flex;font-size:14px;font-weight:500;letter-spacing:.01em;line-height:1.2em;padding:16px}.section-block[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-right:16px;min-width:24px}.section-block[_ngcontent-%COMP%] .notification-item-label[_ngcontent-%COMP%]{flex:1 1 1%;font-size:14px;font-weight:500;margin-bottom:0}.section-block[_ngcontent-%COMP%] .notification-item-info[_ngcontent-%COMP%]{font-size:14px;font-weight:400}@media(max-width:600px){.mat-mdc-form-field-type-mat-select[_ngcontent-%COMP%]{width:110px}}"]})}return n})();export{ze as UnsubscribeComponent}; 2/**i18n:c9e569e2ecdb3e0de183c72d8315eadfdcb9da9e09d5ac2d9fef9056c1853e21*/
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.