����JFIF��x�x����'
Server IP : 78.140.185.180 / Your IP : 3.141.107.132 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/builderbox/public_html/public/client/ |
Upload File : |
(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{cPR9:function(t,n,e){"use strict";e.r(n),e.d(n,"NotificationsModule",(function(){return J}));var i=e("ofXK"),a=e("tyNb"),s=e("2Vo4"),o=e("nYR2"),c=e("3E0/"),r=e("0EQZ"),l=e("fXoL"),b=e("LRXf");let d=(()=>{class t{constructor(t){this.http=t}getAll(t){return this.http.get(`notifications/${t}/subscriptions`)}updateUserSubscriptions(t,n){return this.http.put(`notifications/${t}/subscriptions`,{selections:n})}}return t.\u0275fac=function(n){return new(n||t)(l.Xb(b.a))},t.\u0275prov=l.Jb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var g=e("twBr"),u=e("i2dy"),p=e("kmQS"),h=e("N2vX"),f=e("3Pt+"),m=e("bTqV"),v=e("bSwM");function P(t,n){if(1&t){const t=l.Ub();l.Tb(0,"div",11),l.Tb(1,"div",12),l.Hc(2),l.Sb(),l.Tb(3,"mat-checkbox",13),l.ac("change",(function(e){l.vc(t);const i=n.$implicit,a=l.ec(3);return e?a.toggleAllRowsFor(i):null})),l.Sb(),l.Sb()}if(2&t){const t=n.$implicit,e=l.ec(3);l.Bb(2),l.Ic(t),l.Bb(1),l.kc("checked",e.allRowsSelectedFor(t))("indeterminate",e.selections[t].hasValue()&&!e.allRowsSelectedFor(t))("disabled","browser"===t&&!e.supportsBrowserNotifications)}}function w(t,n){if(1&t&&(l.Rb(0),l.Fc(1,P,4,4,"div",10),l.Qb()),2&t){const t=l.ec(2);l.Bb(1),l.kc("ngForOf",t.availableChannels)}}function k(t,n){if(1&t){const t=l.Ub();l.Tb(0,"div",11),l.Tb(1,"mat-checkbox",16),l.ac("click",(function(n){return l.vc(t),n.stopPropagation()}))("change",(function(e){l.vc(t);const i=n.$implicit,a=l.ec().$implicit,s=l.ec(2);return e?s.selections[i].toggle(a.notif_id):null})),l.Sb(),l.Sb()}if(2&t){const t=n.$implicit,e=l.ec().$implicit,i=l.ec(2);l.Bb(1),l.kc("checked",i.selections[t].isSelected(e.notif_id))("disabled","browser"===t&&!i.supportsBrowserNotifications)}}function O(t,n){if(1&t&&(l.Tb(0,"div",14),l.Tb(1,"div",15),l.Hc(2),l.Sb(),l.Fc(3,k,2,2,"div",10),l.Sb()),2&t){const t=n.$implicit,e=n.last,i=l.ec(2);l.Fb("no-border",e),l.Bb(2),l.Ic(t.name),l.Bb(1),l.kc("ngForOf",i.availableChannels)}}function y(t,n){if(1&t&&(l.Tb(0,"div",5),l.Tb(1,"div",6),l.Tb(2,"div",7),l.Hc(3),l.Sb(),l.Fc(4,w,2,1,"ng-container",8),l.Sb(),l.Fc(5,O,4,4,"div",9),l.Sb()),2&t){const t=n.$implicit,e=n.first;l.Bb(3),l.Ic(t.group_name),l.Bb(1),l.kc("ngIf",e),l.Bb(1),l.kc("ngForOf",t.subscriptions)}}let S=(()=>{class t{constructor(t,n,e,i,a,o){this.route=t,this.api=n,this.currentUser=e,this.toast=i,this.cd=a,this.settings=o,this.loading$=new s.a(!1),this.supportsBrowserNotifications="Notification"in window,this.availableChannels=[],this.selections={},this.allNotifIds=[]}ngOnInit(){this.route.data.subscribe(t=>{this.subscriptions=t.api.subscriptions,this.availableChannels=t.api.available_channels,this.allNotifIds=t.api.all_notif_ids,this.availableChannels.forEach(n=>{this.selections[n]=new r.b(!0,t.api.selections[n])})}),"granted"!==Notification.permission&&this.bindToBrowserNotifSubscription()}toggleAllRowsFor(t){this.allRowsSelectedFor(t)?this.selections[t].clear():this.selections[t].select(...this.allNotifIds)}allRowsSelectedFor(t){return this.selections[t].selected.length===this.allNotifIds.length}saveSettings(){this.loading$.next(!0);const t=this.getPayload();this.api.updateUserSubscriptions(this.currentUser.get("id"),t).pipe(Object(o.a)(()=>this.loading$.next(!1))).subscribe(()=>{this.toast.open("Notification settings updated.")})}getPayload(){const t={};return Object.keys(this.selections).forEach(n=>{t[n]=this.selections[n].selected}),t}bindToBrowserNotifSubscription(){this.selections.browser.changed.pipe(Object(c.a)(1)).subscribe(t=>{t.added.length&&!t.removed.length&&("denied"===Notification.permission?(this.toast.open("Notifications blocked. Please enable them for this site from browser settings."),this.selections.browser.clear(),this.cd.markForCheck()):Notification.requestPermission().then(t=>{"granted"!==t&&(this.selections.browser.clear(),this.cd.markForCheck())}))})}}return t.\u0275fac=function(n){return new(n||t)(l.Nb(a.a),l.Nb(d),l.Nb(g.a),l.Nb(u.b),l.Nb(l.h),l.Nb(p.a))},t.\u0275cmp=l.Hb({type:t,selectors:[["notification-subscriptions"]],decls:7,vars:5,consts:[[1,"box-shadow",3,"menuPosition"],[1,"be-container"],[1,"table","material-panel",3,"ngSubmit"],["class","setting-group",4,"ngFor","ngForOf"],["mat-raised-button","","color","accent","trans","",1,"submit-button",3,"disabled"],[1,"setting-group"],[1,"row"],["trans","",1,"name-column","strong"],[4,"ngIf"],["class","row indent",3,"no-border",4,"ngFor","ngForOf"],["class","channel-column",4,"ngFor","ngForOf"],[1,"channel-column"],["trans","",1,"channel-name"],[3,"checked","indeterminate","disabled","change"],[1,"row","indent"],["trans","",1,"name-column"],[3,"checked","disabled","click","change"]],template:function(t,n){1&t&&(l.Ob(0,"material-navbar",0),l.Tb(1,"div",1),l.Tb(2,"form",2),l.ac("ngSubmit",(function(){return n.saveSettings()})),l.Fc(3,y,6,3,"div",3),l.Tb(4,"button",4),l.fc(5,"async"),l.Hc(6,"Save Settings"),l.Sb(),l.Sb(),l.Sb()),2&t&&(l.kc("menuPosition",n.settings.get("vebto.navbar.defaultPosition")),l.Bb(3),l.kc("ngForOf",n.subscriptions),l.Bb(1),l.kc("disabled",l.gc(5,3,n.loading$)))},directives:[h.a,f.K,f.v,f.w,i.s,m.b,i.t,v.a],pipes:[i.b],styles:["[_nghost-%COMP%]{display:block;background-color:var(--be-background-alternative);min-height:100vh}.be-container[_ngcontent-%COMP%]{padding-top:35px;padding-bottom:35px}.table[_ngcontent-%COMP%]{border-radius:4px}.setting-group[_ngcontent-%COMP%]{margin-bottom:10px}.row[_ngcontent-%COMP%]{display:flex;align-items:center;border-bottom:1px solid var(--be-divider-default);padding:10px}.row.no-border[_ngcontent-%COMP%]{border-bottom:none}.row.indent[_ngcontent-%COMP%]{padding-left:20px}.name-column[_ngcontent-%COMP%]{flex:1 1 auto}.strong[_ngcontent-%COMP%]{font-weight:500;font-size:1.5rem;align-self:flex-end}.channel-name[_ngcontent-%COMP%]{margin-bottom:10px}.channel-column[_ngcontent-%COMP%]{width:75px;text-align:center;text-transform:capitalize}.submit-button[_ngcontent-%COMP%]{margin-top:15px}"],changeDetection:0}),t})();var x=e("JIr8"),C=e("5+tZ"),_=e("EY2u"),F=e("LRne");let N=(()=>{class t{constructor(t,n,e){this.router=t,this.subscriptions=n,this.currentUser=e}resolve(t,n){return this.subscriptions.getAll(+this.currentUser.get("id")).pipe(Object(x.a)(()=>(this.router.navigate(["/account/settings"]),_.a)),Object(C.a)(t=>t?Object(F.a)(t):(this.router.navigate(["/account/settings"]),_.a)))}}return t.\u0275fac=function(n){return new(n||t)(l.Xb(a.d),l.Xb(d),l.Xb(g.a))},t.\u0275prov=l.Jb({token:t,factory:t.\u0275fac,providedIn:"root"}),t})();var T=e("f+iI"),M=e("OnlV"),B=e("WWJw"),$=e("Rd8u");function I(t,n){if(1&t){const t=l.Ub();l.Tb(0,"li"),l.Tb(1,"button",4),l.ac("click",(function(){l.vc(t);const e=n.$implicit;return l.ec().selectPage(e)})),l.Hc(2),l.Sb(),l.Sb()}if(2&t){const t=n.$implicit,e=l.ec();l.Bb(1),l.Fb("active",e.currentPage===t),l.kc("disabled",e.disabled),l.Bb(1),l.Ic(t)}}let R=(()=>{class t{constructor(t){this.router=t,this.pageChanged=new l.n,this.disabled=!0}get shouldHide(){return this.numberOfPages<2}set pagination(t){t&&(this.numberOfPages=t.last_page>10?10:t.last_page,this.numberOfPages>1&&(this.iterator=Array.from(Array(this.numberOfPages).keys()).map(t=>t+1),this.currentPage=t.current_page))}selectPage(t){this.currentPage!==t&&(this.currentPage=t,this.pageChanged.next(t),this.router.navigate([],{queryParams:{page:t},replaceUrl:!0}))}nextPage(){const t=this.currentPage+1;this.selectPage(t<=this.numberOfPages?t:this.currentPage)}prevPage(){const t=this.currentPage-1;this.selectPage(t>=1?t:this.currentPage)}}return t.\u0275fac=function(n){return new(n||t)(l.Nb(a.d))},t.\u0275cmp=l.Hb({type:t,selectors:[["pagination-widget"]],hostVars:2,hostBindings:function(t,n){2&t&&l.Fb("hidden",n.shouldHide)},inputs:{disabled:"disabled",pagination:"pagination"},outputs:{pageChanged:"pageChanged"},decls:8,vars:3,consts:[[1,"page-numbers","unstyled-list"],["type","button","mat-button","","trans","",1,"prev",3,"disabled","click"],[4,"ngFor","ngForOf"],["type","button","mat-button","","trans","",1,"next",3,"disabled","click"],["type","button","mat-flat-button","","color","gray",1,"page-number-button",3,"disabled","click"]],template:function(t,n){1&t&&(l.Tb(0,"ul",0),l.Tb(1,"li"),l.Tb(2,"button",1),l.ac("click",(function(){return n.prevPage()})),l.Hc(3,"Previous"),l.Sb(),l.Sb(),l.Fc(4,I,3,4,"li",2),l.Tb(5,"li"),l.Tb(6,"button",3),l.ac("click",(function(){return n.nextPage()})),l.Hc(7,"Next"),l.Sb(),l.Sb(),l.Sb()),2&t&&(l.Bb(2),l.kc("disabled",n.disabled),l.Bb(2),l.kc("ngForOf",n.iterator),l.Bb(2),l.kc("disabled",n.disabled))},directives:[m.b,$.a,i.s],styles:["[_nghost-%COMP%]{display:block}ul[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;width:100%}li[_ngcontent-%COMP%]{margin:0 3px 6px}.page-number-button[_ngcontent-%COMP%]{width:40px;height:40px;min-width:40px;line-height:40px;padding:0}.active[_ngcontent-%COMP%]{background-color:var(--be-accent-default);color:var(--be-accent-contrast)}.next[_ngcontent-%COMP%], .prev[_ngcontent-%COMP%]{color:var(--be-accent-default)}"],changeDetection:0}),t})();const H=[{path:"",component:(()=>{class t{constructor(t,n,e,i){this.settings=t,this.notifications=n,this.breakpoints=e,this.route=i,this.pagination$=new s.a(null)}ngOnInit(){this.loadPage(this.route.snapshot.queryParams.page||1)}loadPage(t){this.notifications.load({page:t,perPage:25}).subscribe(t=>{this.pagination$.next(t.pagination)})}markAsRead(t){this.pagination$.value.data.find(n=>n.id===t.id).read_at=t.read_at}}return t.\u0275fac=function(n){return new(n||t)(l.Nb(p.a),l.Nb(T.a),l.Nb(M.a),l.Nb(a.a))},t.\u0275cmp=l.Hb({type:t,selectors:[["notification-page"]],decls:8,vars:13,consts:[[3,"menuPosition"],[1,"be-container"],[3,"notifications","compact","markedAsRead"],[3,"pagination","disabled","pageChanged"]],template:function(t,n){var e;1&t&&(l.Ob(0,"material-navbar",0),l.Tb(1,"div",1),l.Tb(2,"notification-list",2),l.ac("markedAsRead",(function(t){return n.markAsRead(t)})),l.fc(3,"async"),l.fc(4,"async"),l.Sb(),l.Tb(5,"pagination-widget",3),l.ac("pageChanged",(function(t){return n.loadPage(t)})),l.fc(6,"async"),l.fc(7,"async"),l.Sb(),l.Sb()),2&t&&(l.kc("menuPosition",n.settings.get("vebto.navbar.defaultPosition")),l.Bb(2),l.kc("notifications",null==(e=l.gc(3,5,n.pagination$))?null:e.data)("compact",l.gc(4,7,n.breakpoints.isMobile$)),l.Bb(3),l.kc("pagination",l.gc(6,9,n.pagination$))("disabled",l.gc(7,11,n.notifications.loading$)))},directives:[h.a,B.a,R],pipes:[i.b],styles:["[_nghost-%COMP%]{display:block;min-height:100vh;background-color:var(--be-background-alternative)}.be-container[_ngcontent-%COMP%]{padding-top:25px;padding-bottom:25px}pagination-widget[_ngcontent-%COMP%]{margin-top:35px}"],changeDetection:0}),t})()},{path:"settings",component:S,resolve:{api:N},data:{permissions:["notification.subscribe"]}}];let j=(()=>{class t{}return t.\u0275mod=l.Lb({type:t}),t.\u0275inj=l.Kb({factory:function(n){return new(n||t)},imports:[[a.h.forChild(H)],a.h]}),t})();var A=e("MKyN"),U=e("CXWK"),X=e("gFpt"),K=e("6rvT");let E=(()=>{class t{}return t.\u0275mod=l.Lb({type:t}),t.\u0275inj=l.Kb({factory:function(n){return new(n||t)},imports:[[i.c,m.c,K.a]]}),t})(),J=(()=>{class t{}return t.\u0275mod=l.Lb({type:t}),t.\u0275inj=l.Kb({factory:function(n){return new(n||t)},imports:[[i.c,f.o,f.E,j,X.a,A.a,U.a,E,v.b,m.c]]}),t})()}}]); //# sourceMappingURL=11-es2015.1f39cc284895aedaa550.js.map