1import{a as Y}from"./chunk-WPWY5CY7.js";import"./chunk-X6T7QB5E.js";import"./chunk-JAHHS2QD.js";import{a as N}from"./chunk-SEY4PHRU.js";import"./chunk-WN7VVGW7.js";import"./chunk-LOKQ4ROF.js";import"./chunk-ZJ6FCRI6.js";import"./chunk-EEWN5LF7.js";import{n as O,y as B}from"./chunk-AUWCGCXJ.js";import{Ga as b,Gb as _,Gc as M,Ha as C,Lb as l,ac as c,bc as r,cc as p,da as D,dc as x,ec as I,f,gc as w,kb as S,lc as T,mc as y,nb as E,sb as o,tb as d,wa as v,wc as g,x as m,xc as h}from"./chunk-JVZKY6W5.js";import{a as u}from"./chunk-Z2O5QKTL.js";function R(s,i){if(s&1){let e=w();x(0),c(1,"div",1)(2,"div",2)(3,"h1",3),g(4),r(),c(5,"h4",4),g(6),r(),p(7,"p",5),r(),c(8,"div",6)(9,"button",7),T("click",function(){b(e);let n=y();return C(n.dismissFireworks())}),r()(),p(10,"iframe",8),r(),I()}if(s&2){let e=y();o(4),h(e.settings.heading),o(2),h(e.employeeName),o(),l("innerHTML",e.settings.message,S)}}var H=class s{constructor(i,e){this.employeesDataService=i;this.storageService=e}pageDestroy$=new f;ngOnDestroy(){this.pageDestroy$.next()}data;settings;employeesDataServiceSubscription;isBirthdayGuy=!1;isCardDismissed=!0;employeeName="";ngOnInit(){let i=this.data.authService.getLoggedUser().username;i&&(this.employeesDataService.getEmployees(this.settings.employeeDataSourceId),this.employeesDataService.employees$.pipe(D(this.pageDestroy$),m(e=>e&&e.map(t=>{let n=u({},t);if(typeof t.BIRTHDATE=="string"){let a=t.BIRTHDATE.split("/");Object.assign(n,{BIRTHDATE:new Date(a[1]+"/"+a[0]+"/"+a[2])})}return n})),m(e=>{if(i&&e)return e.find(t=>t?.USERNAME?.toLowerCase()==i.toLowerCase())})).subscribe(e=>{if(e){this.pageDestroy$.next();let t=new Date().getDate(),n=new Date().getMonth(),a=new Date().getFullYear();e.BIRTHDATE.getDate()===t&&e.BIRTHDATE.getMonth()===n&&(this.isBirthdayGuy=!0,this.employeeName=e.FL_NAME,this.storageService.get("birthdayDismissYear")?JSON.parse(this.storageService.get("birthdayDismissYear"))!==a?(this.storageService.removeItem("birthdayDismissYear"),this.isCardDismissed=!1):this.isCardDismissed=!0:this.isCardDismissed=!1)}}))}dismissFireworks(){let i=new Date().getFullYear();this.storageService.set("birthdayDismissYear",JSON.stringify(i)),this.isCardDismissed=!0}static \u0275fac=function(e){return new(e||s)(d(Y),d(N))};static \u0275cmp=v({type:s,selectors:[["lib-birthday-card"]],inputs:{data:"data",settings:"settings"},standalone:!0,features:[M],decls:1,vars:1,consts:[[4,"ngIf"],[1,"birthday-card-container"],[1,"content-container"],[1,"birthday-heading"],[1,"birthday-person"],[1,"birthday-message",3,"innerHTML"],[1,"cta-container"],["role","button",1,"dismiss-btn",3,"click"],["src",E`./assets/css/fireworks.html`]],template:function(e,t){e&1&&_(0,R,11,3,"ng-container",0),e&2&&l("ngIf",t.isBirthdayGuy&&!t.isCardDismissed)},dependencies:[B,O],styles:[".birthday-card-container[_ngcontent-%COMP%]{position:fixed;z-index:1000;top:0;left:0;width:100%;height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center}iframe[_ngcontent-%COMP%]{position:absolute;z-index:0;width:100%;height:100vh;top:0;left:0}.content-container[_ngcontent-%COMP%], .cta-container[_ngcontent-%COMP%]{position:relative;z-index:1}"]})};export{H as BirthdayCardComponent};
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.