{"version":3,"file":"app-2ef08ec8.9729664bca28a8e6916d.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAMA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAMA;AAEA;AACA;AACA;AAEA;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAsBA;AACA;AAAA;AArBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AArhBA;;;;;;;;;;;;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAmBA;AACA;AAAA;AAjBA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxEA;;;;;;;;;;;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAGA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AA3BA;;;;;;;;;;;;;;ACNA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACFA;AACA;AACA;AAEA;AAUA;AAAA;AAAA;AANA;AACA;AAEA;AACA;AAAA;AAAA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArGA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAkCA;AAAA;AAhCA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjMA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;ACnBA;AAGA;AAAA;AAAA;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAuBA;AAAA;AArBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAGA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AApKA;;;;;;;;;;;;;;;;;ACjBA;AACA;AACA;AAEA;AAOA;AAAA;AAJA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AA1BA;;;;;;;;;;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AASA;AAAA;AAPA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AA3CA;;;;;;;;;;;;;;;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAmCA;AAAA;AAjCA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AAEA;AAeA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnMA;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AAEA;AAQA;AAAA;AANA;AACA;AAEA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAtCA;;;;;;;;;;;;;;;ACJA;AAEA;AAMA;AAAA;AAJA;AACA;AAIA;AACA;AAEA;AACA;AACA;AACA;AACA;AAdA;;;;;;;;;;;;;;;ACFA;AAEA;AAKA;AAAA;AAHA;AAIA;AACA;AAEA;AACA;AACA;AACA;AACA;AAbA;;;;;;;;;;;;;;;ACFA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACZA;AACA;AAGA;AACA;AACA;AACA;;;;;;;;;;;;;;ACPA;AAGA;AAAA;AACA;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;ACTA;AAGA;AAAA;AAAA;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACRA;AAEA;AAIA;AAAA;AAHA;AAIA;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AAEA;AAWA;AAAA;AAEA;AAAA;AAIA;AAAA;AAfA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AAEA;AAAA;AAMA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAhGA;AAAA;AAAA;AAAA;AAAA;AAUA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;;;;;;;;;;;;;;ACpBA;AAGA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AALA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArCA;;;;;;;;;;;;;;;ACLA;AACA;AAMA;AAAA;AAJA;AACA;AAIA;AACA;AAEA;AACA;AACA;AACA;AACA;AAdA;;;;;;;;;;;;;;;;;;ACDA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AALA;AACA;AAKA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAtDA;;;;;;;;;;;;;;;;ACLA;AACA;AAEA;AAWA;AAAA;AATA;AACA;AAEA;AACA;AAEA;AAIA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAvSA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAuBA;AAAA;AArBA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AA7YA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AAJA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA","sources":["webpack://www.zeusteam.com/./src/main.js","webpack://www.zeusteam.com/./src/members/_index.js","webpack://www.zeusteam.com/./src/members/agency/reports/agency-monthly-bonus.js","webpack://www.zeusteam.com/./src/members/agent-tracking-system/_index.js","webpack://www.zeusteam.com/./src/members/agent-tracking-system/dashboard.js","webpack://www.zeusteam.com/./src/members/agents/agent-card-widgets.js","webpack://www.zeusteam.com/./src/members/agents/agent-card.js","webpack://www.zeusteam.com/./src/members/agents/controls/member-health.js","webpack://www.zeusteam.com/./src/members/agents/controls/overview.js","webpack://www.zeusteam.com/./src/members/agents/dialogs/agent-card-dialog.js","webpack://www.zeusteam.com/./src/members/agents/dialogs/change-password-dialog.js","webpack://www.zeusteam.com/./src/members/agents/dialogs/edit-agent-dialog.js","webpack://www.zeusteam.com/./src/members/agents/dialogs/edit-agent-profile-image-dialog.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-agent-tracking-system.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-carriers.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-commissions.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-files.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-leads.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-messages.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-notes.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-performance.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-production.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-settings.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-sites.js","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-to-dos.js","webpack://www.zeusteam.com/./src/members/analytics/_index.js","webpack://www.zeusteam.com/./src/members/analytics/agent-grid.js","webpack://www.zeusteam.com/./src/members/analytics/policy-grid.js","webpack://www.zeusteam.com/./src/members/approvals/approval-requests.js","webpack://www.zeusteam.com/./src/members/_index.scss","webpack://www.zeusteam.com/./src/members/agents/agent-card.scss","webpack://www.zeusteam.com/./src/members/agents/controls/overview.scss","webpack://www.zeusteam.com/./src/members/_index.html","webpack://www.zeusteam.com/./src/members/agency/reports/agency-monthly-bonus.html","webpack://www.zeusteam.com/./src/members/agent-tracking-system/_index.html","webpack://www.zeusteam.com/./src/members/agent-tracking-system/dashboard.html","webpack://www.zeusteam.com/./src/members/agents/agent-card-widgets.html","webpack://www.zeusteam.com/./src/members/agents/agent-card.html","webpack://www.zeusteam.com/./src/members/agents/controls/member-health.html","webpack://www.zeusteam.com/./src/members/agents/controls/overview.html","webpack://www.zeusteam.com/./src/members/agents/dialogs/agent-card-dialog.html","webpack://www.zeusteam.com/./src/members/agents/dialogs/change-password-dialog.html","webpack://www.zeusteam.com/./src/members/agents/dialogs/edit-agent-dialog.html","webpack://www.zeusteam.com/./src/members/agents/dialogs/edit-agent-profile-image-dialog.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-agent-tracking-system.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-carriers.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-commissions.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-files.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-leads.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-messages.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-notes.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-performance.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-production.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-settings.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-sites.html","webpack://www.zeusteam.com/./src/members/agents/tabs/tab-to-dos.html","webpack://www.zeusteam.com/./src/members/analytics/_index.html","webpack://www.zeusteam.com/./src/members/analytics/agent-grid.html","webpack://www.zeusteam.com/./src/members/analytics/policy-grid.html","webpack://www.zeusteam.com/./src/members/approvals/approval-requests.html"],"sourcesContent":["import environment from '../config/environment.json';\r\nimport { PLATFORM } from 'aurelia-pal';\r\nimport 'bootstrap';\r\nimport 'jquery';\r\nimport 'jquery-hoverintent/jquery.hoverIntent.min.js';\r\nimport 'common/polyfills';\r\nimport XHR from 'i18next-xhr-backend';\r\nimport LngDetector from 'i18next-browser-languagedetector';\r\nimport { HTMLSanitizer } from 'aurelia-templating-resources';\r\nimport { setupValidationRules } from './validation/custom-rules';\r\nimport { c } from 'common/common';\r\nimport { Sanitizer } from 'common/sanitizer';\r\nimport '@nylas/web-elements/dist';\r\n\r\nexport function configure(aurelia) {\r\n let localeName = '';\r\n const i18nSetup = {\r\n backend: {\r\n loadPath: `${environment.api}/api/content/ui-term/{{lng}}/{{ns}}?v=${encodeURIComponent(c.Helpers.uniqueId())}`\r\n },\r\n lng: localeName,\r\n attributes: ['t','i18n'],\r\n getAsync: true,\r\n sendMissing: false,\r\n fallbackLng: 'en',\r\n debug: false,\r\n defaultNS: 'core',\r\n ns: ['core', 'profile'],\r\n detection: {\r\n order: ['querystring', 'navigator'],\r\n lookupQuerystring: 'lng',\r\n caches: [],\r\n },\r\n };\r\n\r\n aurelia.use\r\n .standardConfiguration()\r\n .feature(PLATFORM.moduleName('resources/data-grid/index'))\r\n .feature(PLATFORM.moduleName('resources/index'))\r\n .plugin(PLATFORM.moduleName('aurelia-validation'))\r\n .plugin(PLATFORM.moduleName('aurelia-i18n'), (instance) => {\r\n instance.i18next.use(XHR);\r\n instance.i18next.use(LngDetector);\r\n\r\n // adapt options to your needs (see http://i18next.com/docs/options/)\r\n return instance.setup(i18nSetup);\r\n })\r\n .plugin(PLATFORM.moduleName('aurelia-dialog'), config => {\r\n config.useDefaults();\r\n config.settings.lock = true;\r\n config.settings.startingZIndex = 2002;\r\n config.settings.centerHorizontalOnly = true;\r\n config.settings.ignoreTransitions = true;\r\n })\r\n .plugin(PLATFORM.moduleName('aurelia-animator-css'))\r\n .plugin(PLATFORM.moduleName('bcx-aurelia-reorderable-repeat'))\r\n .singleton(HTMLSanitizer, Sanitizer)\r\n ;\r\n\r\n aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn');\r\n\r\n if (environment.testing) {\r\n aurelia.use.plugin(PLATFORM.moduleName('aurelia-testing'));\r\n }\r\n\r\n setupValidationRules();\r\n\r\n aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));\r\n}","import { PLATFORM } from 'aurelia-pal';\r\nimport { RouterEvent } from 'aurelia-router';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Security } from 'common/security';\r\nimport { I18n } from 'common/i18n';\r\nimport { Page, Notifier } from 'common/ui';\r\nimport { Sites } from 'services/sites';\r\nimport { DialogService } from 'aurelia-dialog';\r\nimport { Nylas } from 'services/nylas';\r\nimport { Menus } from 'services/menus';\r\nimport { Members } from 'services/members';\r\nimport { Drawer } from 'common/drawer';\r\nimport { AgentCardDialog } from './agents/dialogs/agent-card-dialog';\r\nimport { PolicyCardDialog } from './policies/dialogs/policy-card-dialog';\r\nimport { LeadCardDialog2 } from './leads/dialogs/lead-card-dialog2';\r\nimport { c } from 'common/common';\r\nimport { ROLE } from 'common/constants';\r\nimport { MenuController } from 'resources/base-classes/menu-controller';\r\nimport environment from '../../config/environment.json';\r\nimport { Dialer, DIALER_TEAM } from 'services/dialer';\r\nPLATFORM.moduleName('./agents/dialogs/agent-card-dialog');\r\nPLATFORM.moduleName('./policies/dialogs/policy-card-dialog');\r\nPLATFORM.moduleName('./leads/dialogs/lead-card-dialog2');\r\n\r\nexport class Index extends MenuController {\r\n static inject = [EventAggregator, Security, I18n, Page, Notifier, Sites, DialogService, Nylas, Menus, Members, Dialer];\r\n _page;\r\n _notifier;\r\n _sites;\r\n _dialogService;\r\n _nylas;\r\n _menus;\r\n _members;\r\n _dialer;\r\n\r\n isAdmin = false;\r\n adminToolsOn = false;\r\n showQuickActionsButton = true;\r\n showSearch = true;\r\n showNotifications = true;\r\n\r\n newClientVersionAvailable = false;\r\n canAddToMobileMenu = false;\r\n\r\n _handlers = [];\r\n\r\n constructor(ea, security, i18n, page, notifier, sites, dialogService, nylas, menus, members, dialer) {\r\n super(ea, 'members')\r\n this.security = security;\r\n\t this.i18n = i18n;\r\n\t this.isAdmin = security.isAdmin;\r\n\t this._page = page;\r\n this._notifier = notifier;\r\n this._sites = sites;\r\n this._dialogService = dialogService;\r\n this._nylas = nylas;\r\n this._menus = menus;\r\n this._members = members;\r\n this._dialer = dialer;\r\n\t}\r\n\r\n async activate() {\r\n try {\r\n await this.i18n.loadNamespace(['note', 'policy', 'client', 'lead']);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n\tconfigureRouter(config, router) {\r\n\t\tconfig.map([\r\n {\r\n route: ['', 'home', 'home/:loadAction', 'dashboard', 'dashboard/:dashboardKey'],\r\n moduleId: PLATFORM.moduleName('members/dashboard'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'dashboard', description: 'dashboard-description', canAddToMobileMenu: false },\r\n },\r\n {\r\n route: 'onboarding',\r\n moduleId: PLATFORM.moduleName('members/onboarding/onboarding'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'onboarding', description: 'onboarding-description', canAddToMobileMenu: false },\r\n },\r\n {\r\n route: ['agent', 'agent/:id', 'agent/:id/:tab', 'my-profile'],\r\n moduleId: PLATFORM.moduleName('members/agents/agent-card'),\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'agent', description: 'agent-description', canAddToMobileMenu: false },\r\n },\r\n {\r\n route: ['policy', 'policy/:id'],\r\n moduleId: PLATFORM.moduleName('members/policies/policy-card'),\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'policy', description: 'policy-description', canAddToMobileMenu: false },\r\n },\r\n {\r\n route: ['rapid-start', 'rapid-start/:slug'],\r\n moduleId: PLATFORM.moduleName('members/rapid-start/rapid-start'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'nav-basics', description: 'rapid-start-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'rapid-start/:rapidStartSlug/:slug',\r\n moduleId: PLATFORM.moduleName('members/rapid-start/topic'),\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'nav-basics', description: 'rapid-start-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: ['my-team', 'my-team/:view'],\r\n moduleId: PLATFORM.moduleName('members/my-team'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'my-team', description: 'my-team-description', canAddToMobileMenu: true, icon: 'fa-duotone fa-people-group' },\r\n },\r\n {\r\n route: 'mentors',\r\n moduleId: PLATFORM.moduleName('members/mentors/_index'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: {},\r\n },\r\n {\r\n route: 'events',\r\n moduleId: PLATFORM.moduleName('members/events/events'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'events', description: 'events-description', canAddToMobileMenu: true, icon: 'fa-duotone fa-calendar-days' },\r\n },\r\n {\r\n route: 'events/corporate',\r\n moduleId: PLATFORM.moduleName('members/events/corporate-events'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'corporate-events', description: 'corporate-events-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'events/corporate/:id/:type',\r\n moduleId: PLATFORM.moduleName('members/events/corporate-event-registrants'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'corporate-events', description: 'corporate-events-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: ['resources', 'training'],\r\n moduleId: PLATFORM.moduleName('members/training/training'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'resources', description: 'resources-description', canAddToMobileMenu: true, icon: 'fa-duotone fa-bell-school' },\r\n },\r\n {\r\n route: ['training/:trainingSlug/:courseSlug', 'training/:trainingSlug/:courseSlug/:moduleSlug', 'resources/:trainingSlug/:courseSlug', 'resources/:trainingSlug/:courseSlug/:moduleSlug'],\r\n moduleId: PLATFORM.moduleName('members/training/course'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'resources', description: 'resources-description', canAddToMobileMenu: true, icon: 'fa-duotone fa-folder-open' },\r\n },\r\n {\r\n route: ['carriers','carriers/:slug'],\r\n moduleId: PLATFORM.moduleName('members/carriers/carrier'),\r\n nav: true,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { minimumLevel: 'L02', title: 'carriers', description: 'carriers-description', canAddToMobileMenu: true, icon: 'fa-duotone fa-building-shield', favoriteType: 'carrier' }\r\n },\r\n {\r\n route: 'sales-tools',\r\n moduleId: PLATFORM.moduleName('members/sales-tools/index'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: true },\r\n },\r\n {\r\n route: ['contests','rewards'],\r\n moduleId: PLATFORM.moduleName('members/contests/contests'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'contests', description: 'contests-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: ['my-team/reports', 'my-team/reports/:reportType'],\r\n moduleId: PLATFORM.moduleName('members/my-team/reports/team-reports'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'my-team-reports', description: 'my-team-reports-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'my-team/onboarding',\r\n moduleId: PLATFORM.moduleName('members/my-team/onboarding-status'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'my-team-onboarding', description: 'my-team-onboarding-description', canAddToMobileMenu: true, icon: 'fa-duotone fa-user-clock' },\r\n },\r\n {\r\n route: 'my-branding',\r\n moduleId: PLATFORM.moduleName('members/marketing/my-branding'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: false },\r\n },\r\n {\r\n route: 'marketing/advertising-submission',\r\n moduleId: PLATFORM.moduleName('members/marketing/advertising-submission'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: false },\r\n },\r\n {\r\n route: 'integrations',\r\n moduleId: PLATFORM.moduleName('members/integrations/_index'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: false },\r\n },\r\n {\r\n route: ['approval-requests','approval-requests/:id'],\r\n moduleId: PLATFORM.moduleName('members/approvals/approval-requests'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'approval-requests', description: 'approval-requests-description', canAddToMobileMenu: false },\r\n },\r\n {\r\n route: 'recruiting',\r\n moduleId: PLATFORM.moduleName('members/recruiting/_index'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'recruiting', description: 'recruiting-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'sso',\r\n moduleId: PLATFORM.moduleName('members/sso/index'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: false },\r\n },\r\n {\r\n route: 'tasks',\r\n moduleId: PLATFORM.moduleName('members/tasks/index'),\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'tasks', description: 'tasks-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: ['reminders', 'to-dos'],\r\n moduleId: PLATFORM.moduleName('members/to-dos/_index'),\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'to-dos', description: 'to-dos-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'message-center',\r\n moduleId: PLATFORM.moduleName('members/message-center/index'),\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { title: 'message-center', description: 'message-center-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'leaderboard/:code/entries/:memberId',\r\n moduleId: PLATFORM.moduleName('members/leaderboards/entries'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: true,\r\n settings: { title: 'leaderboard-entries', description: 'leaderboard-entries-description', canAddToMobileMenu: false },\r\n },\r\n {\r\n route: 'hierarchy',\r\n moduleId: PLATFORM.moduleName('members/hierarchy/index'),\r\n nav: false,\r\n membersOnly: false,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: false },\r\n },\r\n {\r\n route: 'calculators',\r\n moduleId: PLATFORM.moduleName('members/calculators/index'),\r\n nav: false,\r\n membersOnly: false,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'map',\r\n moduleId: PLATFORM.moduleName('members/map/index'),\r\n nav: false,\r\n membersOnly: false,\r\n adminOnly: false,\r\n settings: { title: 'map', description: 'map-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'crm',\r\n moduleId: PLATFORM.moduleName('members/crm/index'),\r\n nav: false,\r\n membersOnly: false,\r\n adminOnly: false,\r\n settings: { title: 'crm', description: 'crm-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'leads',\r\n moduleId: PLATFORM.moduleName('members/leads/_index'),\r\n nav: false,\r\n membersOnly: false,\r\n adminOnly: false,\r\n settings: { title: 'agent-leads', description: 'agent-leads-description', canAddToMobileMenu: true },\r\n },\r\n {\r\n route: 'analytics',\r\n moduleId: PLATFORM.moduleName('members/analytics/_index'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: false }\r\n },\r\n {\r\n\t\t\t\troute: ['agent-tracking-system', 'ats'],\r\n\t\t\t\tmoduleId: PLATFORM.moduleName('members/agent-tracking-system/_index'),\r\n\t\t\t\tnav: false,\r\n\t\t\t\tsettings: { canAddToMobileMenu: false }\r\n\t\t\t},\r\n {\r\n route: ['_p/:id', 'pg/:id'],\r\n moduleId: PLATFORM.moduleName('members/pg'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: true },\r\n },\r\n {\r\n route: ['_w/:id', '_w/mobile/:id'],\r\n moduleId: PLATFORM.moduleName('members/widget'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: false },\r\n },\r\n {\r\n route: 'privacy-policy',\r\n moduleId: PLATFORM.moduleName('members/privacy-policy'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: false },\r\n },\r\n {\r\n route: 'terms-of-use',\r\n moduleId: PLATFORM.moduleName('members/terms-of-use'),\r\n nav: false,\r\n membersOnly: true,\r\n adminOnly: false,\r\n settings: { canAddToMobileMenu: false },\r\n },\r\n\t\t]);\r\n\r\n\t\tthis.router = router;\r\n\t}\r\n\r\n attached() {\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.onboarding.completed, () => this._onboardingCompleted()));\r\n this.sidebarEl = document.getElementById('kt_app_sidebar');\r\n this._applyTheme();\r\n if (!this.security.agent.onboardingComplete) {\r\n this.showQuickActionsButton = false;\r\n this.showSearch = false;\r\n this.showNotifications = false;\r\n this.sidebarArea = 'onboarding';\r\n return;\r\n }\r\n this.sidebarArea = 'members';\r\n this.setMenu();\r\n this._initialize();\r\n this._setPageTitle();\r\n }\r\n\r\n async _initialize() {\r\n this._handlers.push(this._ea.subscribe(RouterEvent.Complete, (event) => {\r\n this._resetLogoutTimer();\r\n }));\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.newClientVersion, () => this._newClientVersionDetected()));\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.site.openProfile, (data) => this._openProfile(data)));\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.site.openPolicy, (data) => this._openPolicy(data)));\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.site.openLead, (data) => this._openLead(data)));\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.navigation.changing, () => this.closeMenu()));\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.navigation.changed, () => this._setPageTitle()));\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.site.setPageTitle, (data) => this._setPageTitle(data)));\r\n\r\n this.canAutoDial = await this._dialer.canDial(DIALER_TEAM.NoPrompt);\r\n this._resetLogoutTimer();\r\n this._nylas.loadScript();\r\n }\r\n\r\n detached() {\r\n this._handlers.forEach(h => h.dispose());\r\n this._handlers = [];\r\n if (this._logoutTimer) window.clearTimeout(this._logoutTimer);\r\n this.closeMenu();\r\n }\r\n\r\n _setPageTitle(data) {\r\n try {\r\n const pageCode = this._mobileMenuCode();\r\n const pageSettings = this.router.currentInstruction.config.settings ?? {};\r\n this.pageTitle = data && data.title ? data.title : pageSettings.title;\r\n this.pageDescription = data && data.description ? data.description : pageSettings.description;\r\n this.pageIcon = data && data.icon ? data.icon : pageSettings.icon ?? 'fa-duotone fa-users';\r\n this.pageInMobileMenu = this._menus.isOnMobileMenu('Page', pageCode);\r\n this.canAddToMobileMenu = this.security.isInRole([ROLE.Admin, ROLE.DashboardAdmin]) && pageSettings.canAddToMobileMenu;\r\n this.favoriteType = pageSettings.favoriteType;\r\n if (this.router.currentInstruction.params) {\r\n this.favoriteId = this.router.currentInstruction.params.id ?? this.router.currentInstruction.params.code ?? this.router.currentInstruction.params.slug;\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n addToMobileMenu() {\r\n try {\r\n const code = this._mobileMenuCode();\r\n this._menus.addToMobileMenu(null, 'Page', code, this.pageTitle, this.pageDescription, code, this.pageIcon);\r\n this.pageInMobileMenu = true;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async removeFromMobileMenu() {\r\n try {\r\n const code = this._mobileMenuCode();\r\n await this._menus.removeFromMobileMenu(null, 'Page', code);\r\n this.pageInMobileMenu = false;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n _mobileMenuCode() {\r\n return `#${this.router.baseUrl}${this.router.currentInstruction.fragment}`;\r\n }\r\n\r\n closeMenu() {\r\n if (this._sidebarDrawer) this._sidebarDrawer.hide();\r\n }\r\n\r\n _onboardingCompleted() {\r\n this.showQuickActionsButton = true;\r\n this.showSearch = true;\r\n this.showNotifications = true;\r\n this.sidebarArea = 'members';\r\n this._initialize();\r\n }\r\n\r\n _newClientVersionDetected() {\r\n this.newClientVersionAvailable = true;\r\n }\r\n\r\n loadNewVersion() {\r\n window.location.reload(true);\r\n }\r\n\r\n toggleNewVersionHelp() {\r\n this.showNewVersionHelp = !this.showNewVersionHelp;\r\n }\r\n\r\n async _applyTheme() {\r\n try {\r\n const theme = await this._sites.theme();\r\n this.lightLogo = `${environment.static}/${theme.light.logoPath}`;\r\n this.darkLogo = `${environment.static}/${theme.dark.logoPath}`;\r\n this.lightIcon = `${environment.static}/files/themes/${theme.key}/favicons/favicon-96x96.png`;\r\n this.darkIcon = `${environment.static}/files/themes/${theme.key}/favicons/favicon-96x96.png`;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n _resetLogoutTimer() {\r\n if (this._logoutTimer) window.clearTimeout(this._logoutTimer);\r\n this._logoutTimer = window.setTimeout(() => {\r\n this.security.logout();\r\n this._notifier.info('inactivity-timeout-message', 'security-notice', true);\r\n this.router.navigate('#/');\r\n }, 4 * 60 * 60 * 1000); // 4 hrs = 4 * 60 * 60 * 1000\r\n }\r\n\r\n _openProfile(data) {\r\n const model = { id: data.member ? data.member.id : data.memberId };\r\n model.tab = data.tab;\r\n\t this._dialogService.open({ viewModel: AgentCardDialog, model, ignoreTransitions: true });\r\n }\r\n\r\n _openPolicy(data) {\r\n const model = { id: data.policyId };\r\n model.tab = data.tab;\r\n\t this._dialogService.open({ viewModel: PolicyCardDialog, model, ignoreTransitions: true });\r\n }\r\n\r\n _openLead(data) {\r\n const model = { id: data.leadId };\r\n model.tab = data.tab;\r\n model.action = data.action;\r\n this._dialogService.open({ viewModel: LeadCardDialog2, model, ignoreTransitions: true });\r\n }\r\n\r\n openSidebar() {\r\n try {\r\n if (!this._sidebarDrawer) this._sidebarDrawer = new Drawer(this.sidebarEl);\r\n this._sidebarDrawer.show();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n showNavigation(row) {\r\n if (!row.settings) return true;\r\n if (row.settings.adminOnly && !this.isAdmin) return false;\r\n if (row.settings.minimumLevel) {\r\n return this.security.isInMinimumLevel(row.settings.minimumLevel);\r\n }\r\n return true;\r\n }\r\n\r\n\trecordPageView(key, closeNavigation) {\r\n\t this._page.track(key);\r\n\t if (closeNavigation) this.closeNav();\r\n\r\n\t return true;\r\n\t}\r\n\r\n\tcloseNav() {\r\n\t var navMain = $('#members-navbar');\r\n navMain.collapse('hide');\r\n\t return true;\r\n\t}\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { I18n } from 'common/i18n';\r\nimport { Security } from 'common/security';\r\nimport { Agency } from 'services/agency';\r\nimport { TimePeriodNavigatorBase } from 'resources/base-classes/time-period-navigator-base';\r\nimport moment from 'moment';\r\nimport { c } from 'common/common';\r\nimport { REPORT_TIME_PERIOD } from 'common/constants';\r\n\r\nexport class AgencyMonthlyBonus extends TimePeriodNavigatorBase {\r\n static inject = [EventAggregator, I18n, Security, Agency]\r\n\r\n _i18n;\r\n _security;\r\n _agency;\r\n\r\n teamOptions;\r\n teamSummary = false;\r\n start;\r\n end;\r\n\r\n columns;\r\n gridData;\r\n emptyGridMessage;\r\n loadingTimestamp;\r\n\r\n timePeriod = REPORT_TIME_PERIOD.MTD;\r\n\r\n constructor(ea, i18n, security, agency) {\r\n super('agency-agent-monthly-bonus', ea);\r\n this._i18n = i18n;\r\n this._security = security;\r\n this._agency = agency;\r\n\r\n this._initialize();\r\n }\r\n\r\n _initialize() {\r\n this.emptyGridMessage = this._i18n.tr('agency-agents-monthly-bonus-none-found');\r\n this.columns = [];\r\n this.columns.push(c.FlexGrid.column('agent', c.FlexGrid.sizes.medium, this._i18n.tr('agent'), c.FlexGrid.types.member, null));\r\n this.columns.push(c.FlexGrid.column('apps', c.FlexGrid.sizes.small, this._i18n.tr('apps'), c.FlexGrid.types.string));\r\n this.columns.push(c.FlexGrid.column('persistency', c.FlexGrid.sizes.small, this._i18n.tr('persistency'), c.FlexGrid.types.number, { postfix: '%' }));\r\n this.columns.push(c.FlexGrid.column('placement', c.FlexGrid.sizes.small, this._i18n.tr('placement'), c.FlexGrid.types.number, { postfix: '%' }));\r\n this.columns.push(c.FlexGrid.column('bonus', c.FlexGrid.sizes.small, this._i18n.tr('bonus'), c.FlexGrid.types.money, null));\r\n }\r\n\r\n attached() {\r\n this._attached();\r\n this._loadData();\r\n }\r\n\r\n async _loadData() {\r\n try {\r\n this.loadingTimestamp = moment().unix();\r\n this.initializeTimePeriodNavigation();\r\n\r\n this.report = await this._agency.agentsMonthlyBonus(this._security.authenticatedMemberId, this.asOfDate.toISOString(true));\r\n\r\n this.currentPeriod = this.report.bonusPeriod;\r\n this.setTimePeriodNavigationDisplays();\r\n\r\n let gridData = [];\r\n for (let record of this.report.agents) {\r\n gridData.push({\r\n highlight: false,\r\n values: [\r\n c.FlexGrid.cellData('id', record.agent.id),\r\n c.FlexGrid.cellData('agent', record.agent),\r\n c.FlexGrid.cellData('apps', record.bonus.apps, record.bonus.requiredAppsReached ? 'zeus-success' : 'zeus-error'),\r\n c.FlexGrid.cellData('persistency', record.bonus.persistencyPercentage, record.bonus.persistencyMinimumReached ? 'zeus-success' : 'zeus-error'),\r\n c.FlexGrid.cellData('placement', record.bonus.placementPercentage, record.bonus.placementMinimumReached ? 'zeus-success' : 'zeus-error'),\r\n c.FlexGrid.cellData('bonus', record.bonus.currentBonus),\r\n ]\r\n });\r\n }\r\n this.gridData = gridData;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import { PLATFORM } from 'aurelia-pal';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Security } from 'common/security';\r\nimport { Menus } from 'services/menus';\r\nimport { RouterConfigBase } from 'resources/base-classes/router-config-base';\r\n\r\nexport class ProductionIndex extends RouterConfigBase {\r\n\tstatic inject = [EventAggregator, Security, Menus];\r\n\r\n constructor(ea, security, menus) {\r\n super(ea, security, menus, undefined, false);\r\n\t}\r\n\r\n\tconfigureRouter(config, router){\r\n\t config.map([\r\n {\r\n\t\t\t\troute: '',\r\n\t\t\t\tmoduleId: PLATFORM.moduleName('members/agent-tracking-system/dashboard'),\r\n\t\t\t\tnav: false,\r\n settings: { title: 'agent-tracking-system', description: 'agent-tracking-system-description', canAddToMobileMenu: true },\r\n\t\t\t}\r\n\t ]);\r\n\r\n\t\tthis.router = router;\r\n\t}\r\n\r\n\tattached() {\r\n\t\tthis._attached();\r\n\t}\r\n\r\n\tdetached() {\r\n\t\tthis._detached();\r\n\t}\r\n}\r\n","export class Dashboard {\r\n constructor() {}\r\n}","import { bindable } from 'aurelia-framework';\r\nimport { ProductionService } from 'services/production-service';\r\nimport { Carriers } from 'services/carriers';\r\n\r\nexport class AgentCardWidgets {\r\n static inject = [ProductionService, Carriers];\r\n @bindable agentId;\r\n\r\n _production;\r\n _carriers;\r\n\r\n carriers = [];\r\n carrierFilters = [{ value: '', keys: ['name', 'code'] }];\r\n\r\n constructor(production, carriers) {\r\n this._production = production;\r\n this._carriers = carriers;\r\n }\r\n\r\n selectCarrier(carrier) {\r\n try {\r\n this.carrier = carrier;\r\n if (this.carrier && this._pp && this._pp.byCarrier) {\r\n const carrierPpData = this._pp.byCarrier.find(x => x.carrierId === carrier.id);\r\n if (carrierPpData) {\r\n this._setPpData(carrierPpData);\r\n return;\r\n }\r\n }\r\n this.carrier = undefined;\r\n this._setPpData(this._pp);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n nextCarrier() {\r\n try {\r\n if (!this.carriers.length) return;\r\n if (!this.carrier) {\r\n this.selectCarrier(this.carriers[0]);\r\n return;\r\n }\r\n const idx = this.carriers.findIndex(x => x.id === this.carrier.id);\r\n if (idx === this.carriers.length) {\r\n this.selectCarrier();\r\n return;\r\n }\r\n this.selectCarrier(this.carriers[idx + 1]);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n previousCarrier() {\r\n try {\r\n if (!this.carriers.length) return;\r\n if (!this.carrier) {\r\n this.selectCarrier(this.carriers[this.carriers.length - 1]);\r\n return;\r\n }\r\n const idx = this.carriers.findIndex(x => x.id === this.carrier.id);\r\n if (idx === 0) {\r\n this.selectCarrier();\r\n return;\r\n }\r\n this.selectCarrier(this.carriers[idx - 1]);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n agentIdChanged() {\r\n this._load();\r\n }\r\n\r\n async _load() {\r\n if (!this.agentId) return;\r\n try {\r\n this._pp = await this._production.placementAndPersistency(this.agentId);\r\n if (this._pp == null) {\r\n this._pp = null;\r\n return;\r\n }\r\n const carriers = await this._carriers.all();\r\n if (this._pp.byCarrier) {\r\n this._pp.byCarrier.forEach(c => {\r\n const carrier = carriers.find(x => x.id === c.carrierId);\r\n if (!carrier) return;\r\n carrier.hasPolicies = c.hasPolicies;\r\n if (carrier.hasPolicies) this.carriers.push(carrier);\r\n });\r\n }\r\n this._setPpData(this._pp);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n _setPpData(data) {\r\n this.placementBreaks = [data.placement.targetPercentage, data.placement.targetPercentage];\r\n this.persistency3mBreaks = [data.persistency3Month.targetPercentage, data.persistency3Month.targetPercentage];\r\n this.persistency6mBreaks = [data.persistency6Month.targetPercentage, data.persistency6Month.targetPercentage];\r\n this.persistency9mBreaks = [data.persistency9Month.targetPercentage, data.persistency9Month.targetPercentage];\r\n this.persistency13mBreaks = [data.persistency13Month.targetPercentage, data.persistency13Month.targetPercentage];\r\n this.data = data;\r\n }\r\n}","import { bindable } from 'aurelia-framework';\r\nimport { PLATFORM } from 'aurelia-pal';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Api } from 'common/server';\r\nimport { Security } from 'common/security';\r\nimport { Members } from 'services/members';\r\nimport { Dialer, DIALER_TEAM } from 'services/dialer';\r\nimport { Notifier } from 'common/ui';\r\nimport { Config } from 'services/config';\r\nimport { TIME_PERIOD } from 'common/constants';\r\nimport { c } from 'common/common';\r\n\r\nexport class AgentCard {\r\n static inject = [Element, EventAggregator, Api, Security, Members, Dialer, Notifier, Config];\r\n _element;\r\n _members;\r\n _dialer;\r\n _notifier;\r\n _config;\r\n @bindable agentId;\r\n agent = null;\r\n tab;\r\n tabView = '';\r\n tabViewModel = null;\r\n isAdmin = false;\r\n showEditLink = false;\r\n\r\n tabs = [\r\n { key: 'overview', title: 'overview', viewModel: PLATFORM.moduleName('./controls/overview'), display: true, hideForProspect: false },\r\n { key: 'performance', title: 'profile-performance', viewModel: PLATFORM.moduleName('./tabs/tab-performance'), display: true, hideForProspect: true },\r\n { key: 'sites', title: 'sites', viewModel: PLATFORM.moduleName('./tabs/tab-sites'), display: true, hideForProspect: true },\r\n { key: 'health', title: 'profile-health', viewModel: PLATFORM.moduleName('./controls/member-health'), display: true, hideForProspect: true },\r\n { key: 'notes', title: 'notes', viewModel: PLATFORM.moduleName('./tabs/tab-notes'), display: true, hideForProspect: false },\r\n { key: 'carriers', title: 'profile-carriers', viewModel: PLATFORM.moduleName('./tabs/tab-carriers'), display: true, hideForProspect: true },\r\n { key: 'chart', title: 'profile-hierarchy', loadChart: true, display: true, hideForProspect: true },\r\n { key: 'production', title: 'profile-production', viewModel: PLATFORM.moduleName('./tabs/tab-production'), display: true, hideForProspect: true },\r\n { key: 'commissions', title: 'profile-commissions', viewModel: PLATFORM.moduleName('./tabs/tab-commissions'), display: true, hideForProspect: true },\r\n { key: 'messages', title: 'messages', viewModel: PLATFORM.moduleName('./tabs/tab-messages'), display: true, hideForProspect: true },\r\n { key: 'to-dos', title: 'to-dos', viewModel: PLATFORM.moduleName('./tabs/tab-to-dos'), display: true, hideForProspect: true },\r\n { key: 'files', title: 'files', viewModel: PLATFORM.moduleName('./tabs/tab-files'), display: true, hideForProspect: false },\r\n { key: 'agent-tracking-system', title: 'agent-tracking-system', viewModel: PLATFORM.moduleName('./tabs/tab-agent-tracking-system'), display: true, hideForProspect: true },\r\n { key: 'leads', title: 'leads', viewModel: PLATFORM.moduleName('./tabs/tab-leads'), display: true, hideForProspect: true },\r\n ];\r\n\r\n _handlers = [];\r\n\r\n\tconstructor(element, ea, api, security, members, dialer, notifier, config) {\r\n this._element = element;\r\n\t\tthis._ea = ea;\r\n\t\tthis.api = api;\r\n\t\tthis.security = security;\r\n this._members = members;\r\n this._dialer = dialer;\r\n this._notifier = notifier;\r\n this._config = config;\r\n\r\n this.settings = this._config.json('memberCardSettingsJson');\r\n if (this.settings && !this.settings.showManufacturers) this.tabs.find(x => x.key === 'carriers').display = false;\r\n if (!this.security.canSeeCommissions()) this.tabs.find(x => x.key === 'commissions').display = false;\r\n if (!this.security.agent.onboardingComplete) this.tabs.find(x => x.key === 'sites').display = false;\r\n if (!this.security.isAdmin) this.tabs.find(x => x.key === 'performance').display = false;\r\n\t}\r\n\r\n activate(model) {\r\n\t\tif (model && model.notifyKey) {\r\n this._notifyKey = model.notifyKey;\r\n this._notifyType = model.notifyType;\r\n model.tab = { key: 'sites' };\r\n model.id = this.security.authenticatedMemberId;\r\n\t\t}\r\n const activateTab = model.tab\r\n ? typeof model.tab === 'string' ? model.tab : model.tab.key || this.tabs[0].key\r\n : this.tabs[0].key;\r\n this.tab = activateTab ? this.tabs.find(x => x.key === activateTab) || this.tabs[0] : this.tabs[0];\r\n this.agentId = model.id;\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.agent.profileUpdated, () => {\r\n this.agent = undefined;\r\n this._load();\r\n }));\r\n }\r\n\r\n deactivate() {\r\n this._handlers.forEach(h => h.dispose());\r\n this._handlers = [];\r\n }\r\n\r\n attached() {\r\n this._load();\r\n if (this._notifyKey && this._notifyType) {\r\n\t\t\tif (this._notifyType === 'error') {\r\n this._notifier.error(this._notifyKey);\r\n } else {\r\n this._notifier.success(this._notifyKey);\r\n }\r\n this._notifyKey = undefined;\r\n this._notifyType = undefined;\r\n }\r\n }\r\n\r\n agentIdChanged() {\r\n this._load();\r\n }\r\n\r\n async _load() {\r\n if (!this.agentId) return;\r\n try {\r\n this.loading = true;\r\n \t\tthis.agent = await this.api.get(`member/${encodeURIComponent(this.agentId)}`);\r\n this.tabs.forEach(t => {\r\n if (t.hideForProspect && this.agent.isProspect) t.display = false;\r\n });\r\n this._element.dispatchEvent(new CustomEvent('loaded', { bubbles: true, detail: { name: this.agent.fullName } }));\r\n this.displayTab(this.tab);\r\n this.showEditLink = this.security.isAuthenticatedMember(this.agentId) || this.security.isAdmin;\r\n this.canAutoDial = await this._dialer.canDial(DIALER_TEAM.NoPrompt);\r\n\t\t} catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.loading = false;\r\n }\r\n\t}\r\n\r\n async autoDial() {\r\n try {\r\n const response = await this._dialer.call(undefined, DIALER_TEAM.NoPrompt, undefined, [this.agent.id]);\r\n if (response.succeeded) this._notifier.success('auto-dialer-success');\r\n else this._notifier.error(response.message);\r\n } catch (err) {\r\n console.log(err);\r\n this._notifier.error('auto-dialer-error');\r\n }\r\n }\r\n\r\n editProfile(ev) {\r\n }\r\n\r\n viewSettings() {\r\n this.displayTab({ key: 'settings', title: 'agent-settings', viewModel: PLATFORM.moduleName('./tabs/tab-settings') });\r\n }\r\n\r\n\tdisplayTab(tab) {\r\n this.tab = tab || this.tabs[0];\r\n this.tabModel = this.tabModel || {};\r\n this.tabViewModel = this.tab.viewModel;\r\n\t switch (this.tab.key) {\r\n\t case 'overview':\r\n\t this.tabModel = this.agent;\r\n\t break;\r\n case 'performance':\r\n this.tabModel = Object.assign(this.tabModel, { memberId: this.agent.id });\r\n break;\r\n case 'health':\r\n this.tabModel = this.agent;\r\n break;\r\n case 'notes':\r\n this.tabModel = { memberId: this.agent.id, security: this.security };\r\n break;\r\n case 'carriers':\r\n this.tabModel = Object.assign(this.tabModel, { memberId: this.agent.id, member: this.agent });\r\n break;\r\n case 'chart':\r\n this.tabModel = Object.assign(this.tabModel, {});\r\n break;\r\n case 'production':\r\n this.tabModel = Object.assign(this.tabModel, { memberId: this.agent.id, timePeriod: TIME_PERIOD.YTD });\r\n break;\r\n case 'commissions':\r\n this.tabModel = Object.assign(this.tabModel, { memberId: this.agent.id });\r\n break;\r\n case 'messages':\r\n this.tabModel = { memberId: this.agent.id };\r\n break;\r\n case 'to-dos':\r\n this.tabModel = { memberId: this.agent.id, security: this.security };\r\n break;\r\n case 'files':\r\n this.tabModel = { agentId: this.agent.id };\r\n break;\r\n case 'sites':\r\n this.tabModel = { agentId: this.agent.id };\r\n break;\r\n case 'leads':\r\n this.tabModel = { agentId: this.agent.id };\r\n break;\r\n default:\r\n this.tabModel = this.agent;\r\n break;\r\n }\r\n\t}\r\n\r\n downloadVCard() {\r\n this._members.downloadVCard(this.agent.id);\r\n }\r\n\r\n shareLink() {\r\n let agencyFirstName = '';\r\n let agencyLastName = '';\r\n let agencyEmail = '';\r\n let agencyCell = '';\r\n if (this.agent.agency) {\r\n agencyFirstName = this.agent.agency.firstName;\r\n agencyLastName = this.agent.agency.lastName;\r\n agencyEmail = this.agent.agency.email;\r\n agencyCell = this.agent.agency.phone;\r\n }\r\n const shareAgent = JSON.parse(JSON.stringify(this.agent));\r\n shareAgent.agencyFirstName = agencyFirstName;\r\n shareAgent.agencyLastName = agencyLastName;\r\n shareAgent.agencyEmail = agencyEmail;\r\n shareAgent.agencyCell = agencyCell;\r\n this.security.openShareLink(this._config, shareAgent, 3000); // above the 2002 agent card\r\n }\r\n}\r\n","export class MemberHealth {\r\n profile = null;\r\n\r\n constructor() {}\r\n\r\n activate(model) {\r\n this.profile = model;\r\n }\r\n}\r\n","import { PLATFORM } from 'aurelia-pal';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Members } from 'services/members';\r\nimport { Security } from 'common/security';\r\nimport { Notifier } from 'common/ui';\r\nimport { Onboardings } from 'services/onboardings';\r\nimport { Config } from 'services/config';\r\nimport { DialogService } from 'aurelia-dialog';\r\nimport { EditAgentDialog } from './../dialogs/edit-agent-dialog';\r\nimport { ChangePasswordDialog } from './../dialogs/change-password-dialog';\r\nimport { EditAgentProfileImageDialog } from './../dialogs/edit-agent-profile-image-dialog';\r\nimport moment from 'moment';\r\nimport { c } from 'common/common';\r\nPLATFORM.moduleName('./../dialogs/edit-agent-dialog');\r\nPLATFORM.moduleName('./../dialogs/change-password-dialog');\r\nPLATFORM.moduleName('./../dialogs/edit-agent-profile-image-dialog');\r\n\r\nexport class Overview {\r\n static inject = [EventAggregator, Members, Security, Notifier, Onboardings, Config, DialogService];\r\n _ea;\r\n _members;\r\n security;\r\n _notifier;\r\n _onboardings;\r\n _config;\r\n _dialogService;\r\n agent = null;\r\n canResetOnboarding = false;\r\n isAgencyManager = false;\r\n viewingMyProfile = false;\r\n\r\n profileActions;\r\n levelActions = [\r\n { key: 'Life', name: 'request-life-level-change' },\r\n { key: 'Annuity', name: 'request-annuity-level-change' },\r\n { key: 'HMA', name: 'request-hma-level-change' },\r\n ];\r\n\r\n _handlers = [];\r\n\r\n constructor(ea, members, security, notifier, onboardings, config, dialogService) {\r\n this._ea = ea;\r\n this._members = members;\r\n this.security = security;\r\n this._notifier = notifier;\r\n this._onboardings = onboardings;\r\n this._config = config;\r\n this._dialogService = dialogService;\r\n\r\n this.areMembersLicensed = this._config.value('areMembersLicensed');\r\n this.areMembersContractedWithSuppliers = this._config.value('areMembersContractedWithSuppliers');\r\n }\r\n\r\n activate(model) {\r\n this.agent = model;\r\n this._load();\r\n }\r\n\r\n attached() {\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.mentor.assigned, (data) => { this.agent.mentor = data.mentor; this.reloadMentor = new Date().getTime(); }));\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.mentor.removed, () => { this.agent.mentor = undefined; }));\r\n }\r\n\r\n detached() {\r\n this._handlers.forEach(h => h.dispose());\r\n }\r\n\r\n async _load() {\r\n try {\r\n this.viewingMyProfile = this.security.isAuthenticatedMember(this.agent.id);\r\n\r\n this.profileActions = [];\r\n if (this.viewingMyProfile || this.security.isAdmin) this.profileActions.push({ key: 'edit-profile-image', name: 'edit-profile-image' });\r\n this.profileActions.push({ key: 'edit', name: 'edit-profile' });\r\n this.profileActions.push({ key: 'change-password', name: 'change-password' });\r\n \r\n\r\n this.canResetOnboarding = this.agent.agency ? this.security.isAuthenticatedMember(this.agent.agency.id) : false;\r\n if (this.security.isAdmin) this.canResetOnboarding = true;\r\n this.isAgencyManager = this.agent.agency ? this.security.isAuthenticatedMember(this.agent.agency.id) : false;\r\n const massCommunicationStatus = await this._members.getMassCommunicationStatus(this.agent.id);\r\n this.mailChimpStatus = massCommunicationStatus.mailChimpStatus || 'unknown';\r\n this.clickSendStatus = massCommunicationStatus.clickSendStatus || 'unknown';\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n profileAction(key) {\r\n if (key === 'edit') this.openEditor();\r\n else if (key === 'change-password') this.openChangePassword();\r\n else if (key === 'edit-profile-image') this.openProfileImageEditor();\r\n }\r\n\r\n requestLevelChange() {\r\n this.showLevelChangeRequest = true;\r\n }\r\n\r\n cancelLevelChange() {\r\n this.showLevelChangeRequest = false;\r\n }\r\n\r\n sendLevelChange() {\r\n this._members.requestLevelChange(this.agent.id, this.requestedLevel);\r\n }\r\n\r\n async resetOnboarding() {\r\n try {\r\n this.resetting = true;\r\n await this._onboardings.reset(this.agent.id);\r\n this.refreshOnboardingMemberId = moment().format();\r\n } catch (err) {\r\n\t\t\tthis._notifier.generalError();\r\n } finally {\r\n this.resetting = false;\r\n }\r\n }\r\n\r\n async checkOnboardingStatus() {\r\n try {\r\n this.checking = true;\r\n const status = await this._onboardings.checkContractedStatus(this.agent.id);\r\n if (!status) {\r\n this._notifier.error('contracting-status-not-available');\r\n return;\r\n }\r\n this._notifier.success('contracting-status-updated');\r\n this.refreshOnboardingMemberId = moment().format();\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.checking = false;\r\n }\r\n }\r\n\r\n async completeOnboarding() {\r\n try {\r\n this.completing = true;\r\n await this._onboardings.complete(this.agent.id);\r\n this.agent.isOnboarding = false;\r\n this.refreshOnboardingMemberId = moment().format();\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.completing = false;\r\n }\r\n }\r\n\r\n async toggleAgency(event) {\r\n try {\r\n await this._members.setAgency(this.agent.id, event.detail.checked);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async toggleTeam(event) {\r\n try {\r\n await this._members.setTeam(this.agent.id, event.detail.checked);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n openEditor() {\r\n this._dialogService.open({ viewModel: EditAgentDialog, model: this.agent, ignoreTransitions: true }).whenClosed(response => {\r\n if (response.wasCancelled) return;\r\n });\r\n }\r\n\r\n openProfileImageEditor() {\r\n this._dialogService.open({ viewModel: EditAgentProfileImageDialog, model: this.agent, ignoreTransitions: true }).whenClosed(response => {\r\n if (response.wasCancelled) return;\r\n });\r\n }\r\n\r\n\topenChangePassword() {\r\n\t this._dialogService.open({ viewModel: ChangePasswordDialog, model: { currentPassword: '', newPassword: '' }, ignoreTransitions: true }).whenClosed(response => {\r\n\t if (response.wasCancelled) return;\r\n\t });\r\n\t}\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport { c } from 'common/common';\r\n\r\nexport class AgentCardDialog {\r\n static inject = [EventAggregator, DialogController];\r\n\r\n agentName;\r\n\r\n _handlers = [];\r\n\r\n\tconstructor(ea, dialogController) {\r\n\t\tthis._ea = ea;\r\n this.dialogController = dialogController;\r\n this.dialogController.settings.centerHorizontalOnly = true;\r\n\t}\r\n\r\n activate(model) {\r\n this.agentId = model.loaded ? model.member.id : model.id;\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.login.timedOut, () => this.dialogController.cancel()));\r\n }\r\n\r\n deactivate() {\r\n this._handlers.forEach(h => h.dispose());\r\n this._handlers = [];\r\n }\r\n\r\n agentLoaded(data) {\r\n this.agentName = data.name;\r\n }\r\n}\r\n","import { DialogController } from 'aurelia-dialog';\r\nimport { Api } from 'common/server';\r\nimport { Notifier } from 'common/ui';\r\nimport { NewInstance } from 'aurelia-dependency-injection';\r\nimport { ValidationRules, ValidationController } from 'aurelia-validation';\r\nimport { BootstrapFormValidationRenderer } from 'validation/bootstrap-form-validation-renderer';\r\nimport { c } from './../../../common/common';\r\n\r\nexport class ChangePasswordDialog {\r\n static inject = [DialogController, Api, Notifier, NewInstance.of(ValidationController)];\r\n dialogController;\r\n _api;\r\n _notifier;\r\n\r\n currentPassword = '';\r\n \tnewPassword = '';\r\n\r\n constructor(dialogController, api, notifier, validationController) {\r\n this.dialogController = dialogController;\r\n this.dialogController.settings.centerHorizontalOnly = true;\r\n this._notifier = notifier;\r\n this._api = api;\r\n this.validationController = validationController;\r\n this.validationController.addRenderer(new BootstrapFormValidationRenderer());\r\n\r\n ValidationRules\r\n .ensure('currentPassword').required()\r\n .ensure('newPassword').required().minLength(6).matches(c.RegEx.strongPassword)\r\n .on(this);\r\n }\r\n\r\n activate(model) {\r\n this.validationController.reset();\r\n }\r\n\r\n async save() {\r\n try {\r\n const v = await this.validationController.validate();\r\n if (!v.valid) return;\r\n\r\n const model = {\r\n currentPassword: this.currentPassword,\r\n newPassword: this.newPassword,\r\n }\r\n this._api.post('member/change-password', model);\r\n this._notifier.success('profile-password-updated-message');\r\n this.dialogController.ok({ currentPassword: this.currentPassword, newPassword: this.newPassword });\r\n } catch (err) {\r\n this._notifier.generalError();\r\n }\r\n }\r\n}","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport { Api } from 'common/server';\r\nimport { I18n } from 'common/i18n';\r\nimport { m } from 'common/models';\r\nimport { c } from 'common/common';\r\nimport { Page, Notifier } from 'common/ui';\r\nimport { Security } from 'common/security';\r\nimport { Config } from 'services/config';\r\nimport { NewInstance } from 'aurelia-dependency-injection';\r\nimport { ValidationRules, ValidationController } from 'aurelia-validation';\r\nimport { BootstrapFormValidationRenderer } from 'validation/bootstrap-form-validation-renderer';\r\n\r\nexport class EditAgentDialog {\r\n static inject = [EventAggregator, DialogController, Api, I18n, Page, Notifier, Security, Config, NewInstance.of(ValidationController)];\r\n security;\r\n\r\n\toriginalProfile = null;\r\n\tupdateModel = null;\r\n\tfirstName = '';\r\n\tlastName = '';\r\n\tteamName = '';\r\n\tdateOfBirth = '';\r\n\temail = '';\r\n\tstreetAddress = '';\r\n\tstreetAddress2 = '';\r\n\tcity = '';\r\n\tstate = '';\r\n\tzip = '';\r\n\tbusinessPhone = '';\r\n\tcellPhone = '';\r\n languages = '';\r\n\tisLicensedLife = false;\r\n\tisLicensedHealth = false;\r\n\tnationalProducerNumber;\r\n licenseFirstName;\r\n licenseLastName;\r\n residentLicenseState;\r\n residentLicenseNumber;\r\n\r\n\tisEditingSelf = false;\r\n\thasValidationErrors = false;\r\n\tprocessing = false;\r\n\r\n\tusStates = [];\r\n\r\n\t_handlers = [];\r\n\r\n\tconstructor(eventAggregator, dialogController, api, i18n, page, notifier, security, config, validationController) {\r\n\t\tthis._ea = eventAggregator;\r\n this.dialogController = dialogController;\r\n\t\tthis.api = api;\r\n\t\tthis.i18n = i18n;\r\n\t\tthis.page = page;\r\n\t\tthis.notifier = notifier;\r\n\t\tthis.security = security;\r\n\t\tthis.validationController = validationController;\r\n\t\tthis.validationController.addRenderer(new BootstrapFormValidationRenderer());\r\n\r\n\t\tthis.areMembersLicensed = config.value('areMembersLicensed');\r\n\r\n\t\tthis.originalProfile = new m.MemberProfile();\r\n\r\n\t\tthis.usStates = c.Geography.usStates;\r\n\r\n\t\tValidationRules\r\n .ensure('firstName').required()\r\n\t .ensure('lastName').required()\r\n\t .ensure('dateOfBirth').required()\r\n\t .ensure('email').required().email()\r\n\t .ensure('streetAddress').required()\r\n\t .ensure('city').required()\r\n\t .ensure('state').required()\r\n\t .ensure('zip').required()\r\n\t .ensure('businessPhone').required().satisfiesRule('phone')\r\n\t .ensure('cellPhone').required().satisfiesRule('phone')\r\n .ensure('nationalProducerNumber').required().when(m => this.isEditingSelf && this.security.agent.onboardingComplete && this.areMembersLicensed)\r\n .ensure('licenseFirstName').required().when(m => this.isEditingSelf && this.security.agent.onboardingComplete && this.areMembersLicensed)\r\n .ensure('licenseLastName').required().when(m => this.isEditingSelf && this.security.agent.onboardingComplete && this.areMembersLicensed)\r\n .on(this);\r\n }\r\n\r\n\tasync activate(model) {\r\n this.agentId = model.id;\r\n await this.i18n.loadNamespace(['profile']);\r\n this.loadMember();\r\n }\r\n\r\n\tattached() {\r\n\t\tthis.page.scrollToTop();\r\n\t}\r\n\r\n\tdetached() {\r\n this._handlers.forEach(h => h.dispose());\r\n this._handlers = [];\r\n\t}\r\n\r\n\tasync loadMember() {\r\n try {\r\n \t\tlet apiMethod = 'me';\r\n if (!this.security.isAuthenticatedMember(this.agentId)) apiMethod = this.agentId;\r\n\t\t this.originalProfile = await this.api.get(`member/${apiMethod}`);\r\n this.title = this.originalProfile.fullName;\r\n\t\t\tthis.setPropertiesFromProfile();\r\n\t\t\tthis.isEditingSelf = this.security.isAuthenticatedMember(this.agentId);\r\n\r\n const emailAliases = this.originalProfile.emailAliases || [];\r\n this.emailAliases = [];\r\n emailAliases.forEach(a => this.emailAliases.push({ alias: a, focus: false }));\r\n } catch (err) {\r\n\t\t\tthis.notifier.generalError();\r\n\t\t}\r\n\t}\r\n\r\n\tasync updateProfile() {\r\n\t\tif (this.processing) return;\r\n\r\n try {\r\n \t\tconst v = await this.validationController.validate();\r\n\t\t if (!v.valid) {\r\n\t\t this.page.scrollToTop();\r\n\t\t this.hasValidationErrors = true;\r\n\t\t return;\r\n\t\t }\r\n\r\n\t\t this.processing = true;\r\n\t\t this.hasValidationErrors = false;\r\n\r\n\t\t this.fillModel();\r\n\r\n\t\t await this.api.put('member', this.updateModel);\r\n\t\t\tthis.security.setProfileName(this.agentId, this.updateModel.firstName, this.updateModel.lastName);\r\n this.notifier.success('profile-updated-message');\r\n\t\t\tthis._ea.publish(c.EventKeys.agent.profileUpdated, {});\r\n\t\t\tthis.dialogController.ok();\r\n } catch (err) {\r\n console.log(err);\r\n if (typeof err === 'string') this.notifier.error(err);\r\n else this.notifier.generalError();\r\n } finally {\r\n this.processing = false;\r\n }\r\n\t}\r\n\r\n addEmailAlias() {\r\n this.emailAliases.push({ alias: '', focus: true });\r\n }\r\n\r\n removeEmailAlias(index) {\r\n try {\r\n this.emailAliases.splice(index, 1);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n\tsetPropertiesFromProfile() {\r\n\t\tthis.firstName = this.originalProfile.firstName;\r\n\t\tthis.lastName = this.originalProfile.lastName;\r\n\t\tthis.teamName = this.originalProfile.teamName;\r\n\t\tthis.email = this.originalProfile.email;\r\n\t\tthis.dateOfBirth = new Date(this.originalProfile.dateOfBirth).toISOString().substring(0, 10);\r\n\t\tthis.streetAddress = this.originalProfile.streetAddress;\r\n\t\tthis.streetAddress2 = this.originalProfile.streetAddress2;\r\n\t\tthis.city = this.originalProfile.city;\r\n\t\tthis.state = this.originalProfile.state;\r\n\t\tthis.zip = this.originalProfile.zip;\r\n\t\tthis.businessPhone = this.originalProfile.businessPhone;\r\n\t\tthis.cellPhone = this.originalProfile.cellPhone;\r\n this.languages = this.originalProfile.languages;\r\n\t\tthis.isLicensedHealth = this.originalProfile.isLicensedHealth;\r\n\t\tthis.isLicensedLife = this.originalProfile.isLicensedLife;\r\n\t\tthis.nationalProducerNumber = this.originalProfile.nationalProducerNumber;\r\n this.licenseFirstName = this.originalProfile.licenseFirstName;\r\n this.licenseLastName = this.originalProfile.licenseLastName;\r\n this.residentLicenseState = this.originalProfile.residentLicenseState;\r\n this.residentLicenseNumber = this.originalProfile.residentLicenseNumber;\r\n\t}\r\n\r\n\tfillModel() {\r\n\t\tthis.updateModel = new m.MemberUpdate();\r\n\t\tthis.updateModel.id = this.originalProfile.id;\r\n\t\tthis.updateModel.firstName = this.firstName;\r\n\t\tthis.updateModel.lastName = this.lastName;\r\n\t\tthis.updateModel.teamName = this.teamName;\r\n\t\tthis.updateModel.dateOfBirth = this.dateOfBirth;\r\n\t\tthis.updateModel.email = this.email;\r\n\t\tthis.updateModel.streetAddress = this.streetAddress;\r\n\t\tthis.updateModel.streetAddress2 = this.streetAddress2;\r\n\t\tthis.updateModel.city = this.city;\r\n\t\tthis.updateModel.state = this.state;\r\n\t\tthis.updateModel.zip = this.zip;\r\n\t\tthis.updateModel.businessPhone = this.businessPhone;\r\n\t\tthis.updateModel.cellPhone = this.cellPhone;\r\n this.updateModel.languages = this.languages;\r\n\t\tthis.updateModel.isLicensedLife = this.isLicensedLife;\r\n\t\tthis.updateModel.isLicensedHealth = this.isLicensedHealth;\r\n\t\tthis.updateModel.nationalProducerNumber = this.nationalProducerNumber;\r\n this.updateModel.licenseFirstName = this.licenseFirstName;\r\n this.updateModel.licenseLastName = this.licenseLastName;\r\n this.updateModel.residentLicenseState = this.residentLicenseState;\r\n this.updateModel.residentLicenseNumber = this.residentLicenseNumber;\r\n const emailAliases = [];\r\n this.emailAliases.forEach(a => {\r\n if (a.alias) emailAliases.push(a.alias);\r\n });\r\n this.updateModel.emailAliases = emailAliases;\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { DialogController } from 'aurelia-dialog';\r\nimport { c } from 'common/common';\r\n\r\nexport class EditAgentProfileImageDialog {\r\n static inject = [EventAggregator, DialogController];\r\n _ea;\r\n dialogController;\r\n\r\n imageUrl = '';\r\n\t_handlers = [];\r\n\r\n\tconstructor(ea, dialogController) {\r\n\t\tthis._ea = ea;\r\n this.dialogController = dialogController;\r\n }\r\n\r\n\tasync activate(model) {\r\n this.agentId = model.id;\r\n this.originalImageUrl = model.imageUrl;\r\n this.title = model.fullName;\r\n this.imageUrl = model.imageUrl;\r\n }\r\n\r\n\tattached() {\r\n\t\tthis._handlers.push(this._ea.subscribe(c.EventKeys.agent.profileImageUpdated, (data) => {\r\n\t\t\tlet unique = new Date().getMilliseconds();\r\n\t\t\tlet img = document.getElementById('my-profile-image');\r\n\t\t\tlet currentSrc = `${this.originalImageUrl}?ms=${unique}`;\r\n\t\t\timg.setAttribute('src', currentSrc);\r\n this.imageUrl = currentSrc;\r\n\t\t}));\r\n\t}\r\n\r\n\tdetached() {\r\n this._handlers.forEach(h => h.dispose());\r\n this._handlers = [];\r\n\t}\r\n\r\n profileImageUploaded() {\r\n this.dialogController.ok();\r\n }\r\n}\r\n","import { Security } from 'common/security';\r\n\r\nexport class TabAgentTrackingSystem {\r\n static inject = [Security];\r\n _security;\r\n showAddPipeline;\r\n memberId;\r\n\r\n constructor(security) {\r\n this._security = security;\r\n }\r\n\r\n activate(model) {\r\n this.showAddPipeline = this._security.isAuthenticatedMember(model.id);\r\n this.memberId = model.id;\r\n }\r\n}\r\n","import { Config } from 'services/config';\r\n\r\nexport class TabCarriers {\r\n static inject = [Config];\r\n member;\r\n memberId;\r\n\r\n constructor(config) {\r\n this.areMembersContractedWithSuppliers = config.value('areMembersContractedWithSuppliers');\r\n }\r\n\r\n activate(model) {\r\n this.member = model.member;\r\n this.memberId = model.memberId;\r\n }\r\n}\r\n","import { WIDGET, COMMISSION } from 'common/constants';\r\n\r\nexport class TabCommissions {\r\n constructor() {}\r\n\r\n activate(model) {\r\n this.config = {\r\n memberId: model.memberId,\r\n groupBy: COMMISSION.GroupBy.Date,\r\n widgetPeriod: WIDGET.Period.Year,\r\n };\r\n }\r\n}\r\n","export class TabFiles {\r\n constructor() {\r\n }\r\n\r\n activate(model) {\r\n this.agentId = model.agentId;\r\n }\r\n}\r\n","export class TabLeads {\r\n agentId;\r\n\r\n constructor() {\r\n }\r\n\r\n activate(model) {\r\n this.agentId = model.agentId;\r\n }\r\n}\r\n","export class TabMessages {\r\n memberId;\r\n\r\n constructor() {}\r\n\r\n activate(model) {\r\n this.memberId = model.memberId;\r\n }\r\n}\r\n","import { ROLE } from 'common/constants';\r\n\r\nexport class TabNotes {\r\n memberId;\r\n canSeePrivateNotes = false;\r\n\r\n constructor() {\r\n }\r\n\r\n activate(model) {\r\n this.memberId = model.memberId;\r\n this.canSeePrivateNotes = model.security.isInRole([ROLE.BackOffice]);\r\n }\r\n}\r\n","import { observable } from 'aurelia-framework';\r\nimport { Security } from 'common/security';\r\nimport { Members } from 'services/members';\r\nimport { ProductionService } from 'services/production-service';\r\nimport { CACHE_PERIOD, CACHE_TYPE } from 'services/production-service';\r\nimport moment from 'moment';\r\n\r\nexport class TabPerformance {\r\n static inject = [Security, Members, ProductionService];\r\n _security;\r\n _members;\r\n _production;\r\n\r\n memberId;\r\n\r\n CACHE_TYPE = CACHE_TYPE;\r\n CACHE_PERIOD = CACHE_PERIOD;\r\n cacheTypes = CACHE_TYPE.options();\r\n @observable({ changeHandler: 'closeClickthrough' }) cacheType = CACHE_TYPE.Personal;\r\n cachePeriods = CACHE_PERIOD.options();\r\n @observable({ changeHandler: 'closeClickthrough' }) cachePeriod = CACHE_PERIOD.Yesterday;\r\n\r\n show = 'status';\r\n\r\n constructor(security, members, production) {\r\n this._security = security;\r\n this._members = members;\r\n this._production = production;\r\n }\r\n\r\n activate(model) {\r\n this.memberId = model.memberId;\r\n this._initialize();\r\n }\r\n\r\n async _initialize() {\r\n try {\r\n this.access = await this._members.access(this.memberId);\r\n this.cacheTypes = CACHE_TYPE.options(this.access);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n loaded(detail) {\r\n try {\r\n this.period = detail.period;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n selectCachePeriod(cp) {\r\n this.cachePeriod = cp;\r\n }\r\n\r\n async clicked(detail) {\r\n try {\r\n this.loading = true;\r\n this.chartData = [];\r\n this.show = 'policies';\r\n this.policyPremiumType = detail.dateType === 'submitted' ? 'submitted' : 'paid';\r\n this.policyDateType = detail.dateType;\r\n const scope = CACHE_TYPE.toScope(this.cacheType);\r\n this.policies = await this._production.searchPolicies(scope, null, this.memberId, detail.dateType, this.period?.start, this.period?.end);\r\n if (this.period) {\r\n let day = moment(this.period.start);\r\n const lastDay = moment(this.period.end);\r\n while (day.isSameOrBefore(lastDay)) {\r\n let dayStart = day.clone().startOf('day');\r\n let dayEnd = day.clone().endOf('day');\r\n let dayPolicies = [];\r\n if (detail.dateType === 'submitted') {\r\n dayPolicies = this.policies.filter(x => moment(x.submittedDate).isSame(dayStart) || moment(x.submittedDate).isBetween(dayStart, dayEnd));\r\n } else if (detail.dateType === 'paid') {\r\n dayPolicies = this.policies.filter(x => x.paidDate && (moment(x.paidDate).isSame(dayStart) || moment(x.paidDate).isBetween(dayStart, dayEnd)));\r\n } else if (detail.dateType === 'chargeback') {\r\n dayPolicies = this.policies.filter(x => x.chargebackDate && (moment(x.chargebackDate).isSame(dayStart) || moment(x.chargebackDate).isBetween(dayStart, dayEnd)));\r\n }\r\n let totalPremium = 0;\r\n if (detail.dateType === 'submitted') {\r\n dayPolicies.forEach(p => totalPremium += p.submittedPremium);\r\n } else {\r\n dayPolicies.forEach(p => totalPremium += p.paidPremium);\r\n }\r\n const dayData = {\r\n id: day.valueOf(),\r\n name: day.format('l'),\r\n value: totalPremium\r\n };\r\n this.chartData.push(dayData);\r\n day = day.add(1, 'day');\r\n }\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.loading = false;\r\n }\r\n }\r\n\r\n closeClickthrough() {\r\n this.show = 'status';\r\n }\r\n}\r\n","export class TabProduction {\r\n memberId;\r\n\r\n constructor() {}\r\n\r\n activate(model) {\r\n this.memberId = model.memberId;\r\n this.timePeriod = model.timePeriod;\r\n this.summaryType = model.summaryType;\r\n this.date = model.date;\r\n }\r\n}\r\n","export class TabSettings {\r\n activate(model) {\r\n this.agent = model;\r\n }\r\n}\r\n","import { Security } from 'common/security';\r\nimport { Wills } from 'services/wills';\r\nimport { Notifier } from 'common/ui';\r\nimport { Config } from 'services/config';\r\n\r\nexport class TabSites {\r\n static inject = [Security, Wills, Notifier, Config];\r\n security;\r\n _wills;\r\n _notifier;\r\n _config;\r\n\r\n constructor(security, wills, notifier, config) {\r\n this.security = security;\r\n this._wills = wills;\r\n this._notifier = notifier;\r\n this.mySites = config.json('mySitesJson');\r\n }\r\n\r\n activate(model) {\r\n this.agentId = model.agentId;\r\n this.viewingMyProfile = this.security.isAuthenticatedMember(this.agentId);\r\n\t\tthis.canHaveAgentSite = this.security.canHaveAgentSite();\r\n }\r\n\r\n async ssoFastWill() {\r\n try {\r\n if (this.ssoing) return;\r\n this.ssoing = true;\r\n const sso = await this._wills.fastWillSso();\r\n if (sso.error) {\r\n this._notifier.error(sso.error);\r\n return;\r\n }\r\n this.ssoUrl = sso.redirectUrl;\r\n window.setTimeout(() => this.ssoLinkEl.click(), 250);\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.ssoing = false;\r\n }\r\n }\r\n}\r\n","import { Security } from 'common/security';\r\nexport class TabToDos {\r\n static inject = [Security];\r\n _security;\r\n memberId;\r\n showToDosForAgent = false;\r\n\r\n constructor(security) {\r\n this._security = security;\r\n }\r\n\r\n activate(model) {\r\n this.showToDosForAgent = model.memberId !== this._security.authenticatedMemberId;\r\n this.memberId = model.memberId;\r\n }\r\n}\r\n","import { PLATFORM } from 'aurelia-pal';\r\nimport { I18n } from 'common/i18n';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { c } from 'common/common';\r\n\r\nexport class Index {\r\n\tstatic inject = [I18n, EventAggregator];\r\n\t_i18n;\r\n _ea;\r\n\r\n _handlers = [];\r\n\r\n\tconstructor(i18n, ea) {\r\n\t\tthis._i18n = i18n;\r\n this._ea = ea;\r\n\t}\r\n\r\n\tconfigureRouter(config, router){\r\n\t\tconfig.map([\r\n {\r\n\t\t\t\troute: ['', 'policies'],\r\n\t\t\t\tmoduleId: PLATFORM.moduleName('members/analytics/policy-grid'),\r\n\t\t\t\tnav: false,\r\n\t\t\t\tmembersOnly: true,\r\n\t\t\t\tadminOnly: false,\r\n settings: { title: 'analytics-policies', description: 'analytics-policies-description', canAddToMobileMenu: false, icon: 'fa-duotone fa-magnifying-glass-chart' }\r\n\t\t\t},\r\n {\r\n\t\t\t\troute: 'agents',\r\n\t\t\t\tmoduleId: PLATFORM.moduleName('members/analytics/agent-grid'),\r\n\t\t\t\tnav: false,\r\n\t\t\t\tmembersOnly: true,\r\n\t\t\t\tadminOnly: false,\r\n settings: { title: 'Agent Analytics', description: 'View all agents', canAddToMobileMenu: false, icon: 'fa-duotone fa-magnifying-glass-chart' }\r\n\t\t\t},\r\n\t\t]);\r\n\r\n\t\tthis.router = router;\r\n\t}\r\n\r\n attached() {\r\n this._setPageTitle();\r\n this._handlers.push(this._ea.subscribe(c.EventKeys.navigation.changed, () => this._setPageTitle()));\r\n }\r\n\r\n detached() {\r\n this._handlers.forEach(h => h.dispose());\r\n this._handlers = [];\r\n }\r\n\r\n _setPageTitle() {\r\n try {\r\n const title = this.router.currentInstruction.config.settings.title;\r\n const description = this.router.currentInstruction.config.settings.description;\r\n window.setTimeout(() => this._ea.publish(c.EventKeys.site.setPageTitle, { title, description }), 0); // must be after the navigation event\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import { I18n } from 'common/i18n';\r\nimport { Analytics } from 'services/analytics';\r\n\r\nexport class AgentGrid {\r\n static inject = [I18n, Analytics];\r\n _i18n;\r\n _analytics;\r\n\r\n cols;\r\n agents;\r\n\r\n groupBy;\r\n groupBys = [];\r\n\r\n constructor(i18n, analytics) {\r\n this._i18n = i18n;\r\n this._analytics = analytics;\r\n this._initializeGroupBys();\r\n }\r\n\r\n _initializeGroupBys() {\r\n this.groupBys.push({ display: 'All Agents', column: undefined });\r\n this.groupBys.push({ display: 'By Direct Upline', column: 'directUpline' });\r\n this.groupBys.push({ display: 'By Team', column: 'team' });\r\n this.groupBys.push({ display: 'By Agency', column: 'agency' });\r\n this.groupBys.push({ display: 'By Master Agency', column: 'masterAgency' });\r\n this.groupBys.push({ display: 'By Life Level', column: 'lifeLevelName' });\r\n this.groupBys.push({ display: 'By Annuity Level', column: 'annuityLevelName' });\r\n this.groupBys.push({ display: 'By HMA Level', column: 'hmaLevelName' });\r\n this.groupBys.push({ display: 'By State', column: 'state' });\r\n this.groupBy = this.groupBys[0];\r\n }\r\n\r\n setGroupBy(groupBy) {\r\n this.groupBy = groupBy;\r\n this.groupByColumn = groupBy.column;\r\n }\r\n\r\n activate() {\r\n this._initializeGrid();\r\n this._load();\r\n }\r\n\r\n async _load() {\r\n try {\r\n this.agents = await this._analytics.forAgents();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n _initializeGrid() {\r\n this.cols = [\r\n {\r\n field: 'agentID',\r\n headerName: this._i18n.tr('profile-agent-id'),\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'firstName',\r\n headerName: this._i18n.tr('first-name'),\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'lastName',\r\n headerName: this._i18n.tr('last-name'),\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'dateOfBirth',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('date-of-birth'),\r\n cellDataType: 'dateString',\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'email',\r\n headerName: this._i18n.tr('email'),\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'streetAddress',\r\n headerName: this._i18n.tr('street-address'),\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'streetAddress2',\r\n headerName: this._i18n.tr('profile-street-address2'),\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'city',\r\n headerName: this._i18n.tr('city'),\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'state',\r\n headerName: this._i18n.tr('state'),\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'zip',\r\n headerName: this._i18n.tr('zip'),\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'county',\r\n headerName: this._i18n.tr('county'),\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'businessPhone',\r\n headerName: this._i18n.tr('business-phone'),\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'cellPhone',\r\n headerName: this._i18n.tr('profile-cell'),\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'isLicensedLife',\r\n headerName: this._i18n.tr('profile-licenses-life-license'),\r\n cellDataType: 'boolean',\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'isLicensedHealth',\r\n headerName: this._i18n.tr('profile-licenses-health-license'),\r\n cellDataType: 'boolean',\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'registeredDate',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('registered'),\r\n cellDataType: 'dateString',\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'directUpline',\r\n headerName: 'Direct Upline',\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'historicalTeam',\r\n headerName: 'Historical Team',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'team',\r\n headerName: 'Team',\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'historicalAgency',\r\n headerName: 'Historical Agency',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'agency',\r\n headerName: this._i18n.tr('agency'),\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'historicalMasterAgency',\r\n headerName: 'Historical Master Agency',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'masterAgency',\r\n headerName: 'Master Agency',\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'lifeLevelName',\r\n headerName: this._i18n.tr('life-level'),\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'annuityLevelName',\r\n headerName: this._i18n.tr('annuity-level'),\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'hmaLevelName',\r\n headerName: this._i18n.tr('hma-level'),\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'numberOfFirstLineAgents',\r\n type: 'numericColumn',\r\n headerName: '# First Line Agents',\r\n cellDataType: 'number'\r\n },\r\n {\r\n field: 'isActive',\r\n headerName: this._i18n.tr('active'),\r\n cellDataType: 'boolean',\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'inactiveReason',\r\n headerName: 'Inactive Reason',\r\n enableRowGroup: false\r\n },\r\n {\r\n field: 'termsDate',\r\n type: 'dateColumn',\r\n headerName: 'Terms Date',\r\n cellDataType: 'dateString',\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'lastLoginDate',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('last-login'),\r\n cellDataType: 'dateString',\r\n enableRowGroup: false,\r\n hide: false\r\n },\r\n {\r\n field: 'nationalProducerNumber',\r\n headerName: this._i18n.tr('national-producer-number'),\r\n enableRowGroup: false\r\n },\r\n {\r\n field: 'isTeam',\r\n headerName: 'Is Team',\r\n cellDataType: 'boolean',\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'isAgency',\r\n headerName: 'Is Agency',\r\n cellDataType: 'boolean',\r\n enableRowGroup: true,\r\n hide: false\r\n },\r\n {\r\n field: 'firstContractDate',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('agent-first-contract'),\r\n cellDataType: 'dateString',\r\n hide: false\r\n },\r\n {\r\n field: 'firstPolicySubmittedDate',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('agent-first-policy-submitted'),\r\n cellDataType: 'dateString',\r\n hide: false\r\n },\r\n {\r\n field: 'firstPolicyPaidDate',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('agent-first-policy-paid'),\r\n cellDataType: 'dateString',\r\n hide: false\r\n },\r\n {\r\n field: 'firstRecruitDate',\r\n type: 'dateColumn',\r\n headerName: 'First Recruit',\r\n cellDataType: 'dateString',\r\n hide: false\r\n },\r\n ];\r\n }\r\n}","import { observable, computedFrom } from 'aurelia-framework';\r\nimport { Security } from 'common/security';\r\nimport { I18n } from 'common/i18n';\r\nimport { Analytics } from 'services/analytics';\r\nimport { Policies } from 'services/policies';\r\nimport { Notifier } from 'common/ui';\r\nimport { REPORT_TIME_PERIOD, ROLE } from 'common/constants';\r\nimport { LinkCallbackRenderer } from 'resources/elements/analytics/analytics-cell-renderers';\r\nimport moment from 'moment';\r\n\r\nexport class PolicyGrid {\r\n static inject = [Security, I18n, Analytics, Policies, Notifier];\r\n _security;\r\n _i18n;\r\n _analytics;\r\n _policies;\r\n _notifier;\r\n\r\n asOfDate = moment();\r\n start;\r\n end;\r\n\r\n timePeriod;\r\n timePeriods = [];\r\n @observable customRange;\r\n groupBy;\r\n groupBys = [];\r\n\r\n cols;\r\n policies;\r\n selectedIds = [];\r\n canConvertToLeads = false;\r\n\r\n constructor(security, i18n, analytics, policies, notifier) {\r\n this._security = security;\r\n this._i18n = i18n;\r\n this._analytics = analytics;\r\n this._policies = policies;\r\n this._notifier = notifier;\r\n this._initializeTimePeriods();\r\n this._initializeGroupBys();\r\n this.canConvertToLeads = this._security.isInRole(ROLE.LeadAdmin);\r\n }\r\n\r\n _initializeTimePeriods() {\r\n // Set up 4 weeks\r\n let endOfWeek;\r\n for (let i = 0; i < 7; i++) {\r\n const day = moment().add(i, 'days');\r\n if (day.weekday() !== 4) continue;\r\n endOfWeek = day;\r\n break;\r\n }\r\n for (let i = 0; i < 4; i++) {\r\n if (i > 0) endOfWeek = endOfWeek.clone().add(-1, 'weeks');\r\n const startOfWeek = endOfWeek.clone().add(-6, 'days');\r\n this.timePeriods.push({ display: `${startOfWeek.format('l')} - ${endOfWeek.format('l')}`, timePeriod: REPORT_TIME_PERIOD.WTD, asOfDate: endOfWeek.clone().startOf('day') });\r\n }\r\n\r\n // Set up 3 months\r\n let firstOfMonth = moment().startOf('month');\r\n let endOfMonth = this._lastThursdayOfMonth(firstOfMonth);\r\n if (moment().isAfter(endOfMonth)) {\r\n firstOfMonth = firstOfMonth.add(1, 'month');\r\n endOfMonth = this._lastThursdayOfMonth(firstOfMonth);\r\n }\r\n const timePeriodIndex = this.timePeriods.length;\r\n for (let i = 0; i < 4; i++) {\r\n if (i > 0) firstOfMonth = firstOfMonth.clone().add(-1, 'months');\r\n this.timePeriods.push({ display: firstOfMonth.format('MMM YYYY'), timePeriod: REPORT_TIME_PERIOD.MTD, asOfDate: firstOfMonth.clone() });\r\n }\r\n\r\n // Set up 2 years\r\n let firstOfYear = moment().startOf('year');\r\n let endOfYear = this._lastThursdayOfYear(firstOfYear);\r\n if (moment().isAfter(endOfYear)) {\r\n firstOfYear = firstOfYear.add(1, 'year');\r\n endOfYear = htis._lastThursdayOfYear(firstOfYear);\r\n }\r\n for (let i = 0; i < 2; i++) {\r\n if (i > 0) firstOfYear = firstOfYear.clone().add(-1, 'years');\r\n this.timePeriods.push({ display: firstOfYear.format('YYYY'), timePeriod: REPORT_TIME_PERIOD.YTD, asOfDate: firstOfYear.clone() });\r\n }\r\n\r\n // Custom\r\n this.timePeriods.push({ display: 'Custom', timePeriod: undefined, asOfDate: undefined });\r\n\r\n this.timePeriod = this.timePeriods[timePeriodIndex];\r\n }\r\n\r\n _lastThursdayOfMonth(day) {\r\n let endOfMonth;\r\n day = day.clone().endOf('month');\r\n for (let i = 0; i > -31; i--) {\r\n day = day.clone().add(i, 'days');\r\n if (day.weekday() !== 4) continue;\r\n endOfMonth = day;\r\n break;\r\n }\r\n return endOfMonth;\r\n }\r\n\r\n _lastThursdayOfYear(day) {\r\n let endOfYear;\r\n day = day.clone().endOf('year');\r\n for (let i = 0; i > -31; i--) {\r\n day = day.clone().add(i, 'days');\r\n if (day.weekday() !== 4) continue;\r\n endOfYear = day;\r\n break;\r\n }\r\n return endOfYear;\r\n }\r\n\r\n _initializeGroupBys() {\r\n this.groupBys.push({ display: 'All policies', column: undefined });\r\n this.groupBys.push({ display: 'Carrier Report', column: 'carrier' });\r\n this.groupBys.push({ display: 'Line of Business Report', column: 'lineOfBusiness' });\r\n this.groupBys.push({ display: 'Writing Agent Report', column: 'writingAgent' });\r\n this.groupBys.push({ display: 'Team Report', column: 'team' });\r\n this.groupBys.push({ display: 'Agency Report', column: 'agency' });\r\n this.groupBys.push({ display: 'Master Agency Report', column: 'masterAgency' });\r\n this.groupBys.push({ display: 'Weekly Report', column: 'week' });\r\n this.groupBys.push({ display: 'Monthly Report', column: 'month' });\r\n //this.groupBys.push({ display: 'Yearly Report', column: 'year' });\r\n this.groupBy = this.groupBys[0];\r\n }\r\n\r\n activate() {\r\n this._initializeGrid();\r\n this._load();\r\n }\r\n\r\n customRangeChanged() {\r\n if (!this.customRange) {\r\n this.start = undefined;\r\n this.end = undefined;\r\n return;\r\n }\r\n this.start = this.customRange[0] ? this.customRange[0].format('l') : undefined;\r\n this.end = this.customRange[1] ? this.customRange[1].format('l') : undefined;\r\n this._load();\r\n }\r\n\r\n setTimePeriod(timePeriod) {\r\n this.timePeriod = timePeriod;\r\n if (!this.timePeriod.timePeriod && !this.start && !this.end) return;\r\n this._load();\r\n }\r\n\r\n setGroupBy(groupBy) {\r\n this.groupBy = groupBy;\r\n this.groupByColumn = groupBy.column;\r\n }\r\n\r\n async _load() {\r\n try {\r\n this.policies = await this._analytics.forPolicies(this.timePeriod.timePeriod, this.timePeriod.asOfDate, this.start, this.end);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n @computedFrom('canConvertToLeads', 'selectedIds')\r\n get enableConvertToLeads() {\r\n return this.selectedIds && this.selectedIds.length && this.canConvertToLeads;\r\n }\r\n\r\n onSelected(data) {\r\n this.selectedIds = data.ids;\r\n }\r\n\r\n async convertToLeads() {\r\n try {\r\n await this._policies.convertToLeads(this.selectedIds);\r\n this._notifier.success('convert-policies-to-leads-success');\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n _initializeGrid() {\r\n this.cols = [\r\n {\r\n field: 'submittedDate',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('submitted'),\r\n cellDataType: 'dateString',\r\n hide: true\r\n },\r\n {\r\n field: 'status',\r\n type: '',\r\n headerName: this._i18n.tr('status'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'paidDate',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('paid'),\r\n cellDataType: 'dateString',\r\n hide: true\r\n },\r\n {\r\n field: 'carrier',\r\n headerName: this._i18n.tr('carrier'),\r\n enableRowGroup: true\r\n },\r\n {\r\n field: 'policyNumber',\r\n type: '',\r\n headerName: this._i18n.tr('policy-number'),\r\n cellDataType: 'text',\r\n filter: 'agTextColumnFilter',\r\n cellRenderer: LinkCallbackRenderer,\r\n cellRendererParams: { zeusCallback: 'policyNumberCallback' },\r\n hide: true,\r\n headerCheckboxSelection: this.canConvertToLeads,\r\n headerCheckboxSelectionFilteredOnly: this.canConvertToLeads,\r\n checkboxSelection: this.canConvertToLeads,\r\n },\r\n {\r\n field: 'writingAgent',\r\n type: '',\r\n headerName: this._i18n.tr('writing-agent'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n cellRenderer: LinkCallbackRenderer,\r\n cellRendererParams: { zeusCallback: 'writingAgentCallback' },\r\n hide: true\r\n },\r\n {\r\n field: 'percentage',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('split-percentage'),\r\n cellDataType: 'percentage',\r\n filter: 'agTextColumnFilter',\r\n hide: true\r\n },\r\n {\r\n field: 'splitWritingAgent',\r\n type: '',\r\n headerName: this._i18n.tr('split-writing-agent'),\r\n cellDataType: 'text',\r\n cellRenderer: LinkCallbackRenderer,\r\n cellRendererParams: { zeusCallback: 'splitWritingAgentCallback' },\r\n hide: true\r\n },\r\n {\r\n field: 'splitPercentage',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('split-percentage'),\r\n cellDataType: 'percentage',\r\n filter: 'agTextColumnFilter',\r\n hide: true\r\n },\r\n {\r\n field: 'team',\r\n type: '',\r\n headerName: this._i18n.tr('production-team'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n cellRenderer: LinkCallbackRenderer,\r\n cellRendererParams: { zeusCallback: 'teamCallback' },\r\n hide: true\r\n },\r\n {\r\n field: 'agency',\r\n type: '',\r\n headerName: this._i18n.tr('agency'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n cellRenderer: LinkCallbackRenderer,\r\n cellRendererParams: { zeusCallback: 'agencyCallback' },\r\n hide: true\r\n },\r\n {\r\n field: 'masterAgency',\r\n type: '',\r\n headerName: this._i18n.tr('production-master-agency'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n cellRenderer: LinkCallbackRenderer,\r\n cellRendererParams: { zeusCallback: 'masterAgencyCallback' },\r\n hide: true\r\n },\r\n {\r\n field: 'lineOfBusiness',\r\n type: '',\r\n headerName: this._i18n.tr('line-of-business'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'product',\r\n type: '',\r\n headerName: this._i18n.tr('product'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'productType',\r\n type: '',\r\n headerName: this._i18n.tr('product-type'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'submittedActual',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('submitted-actual-abbr'),\r\n cellDataType: 'money',\r\n aggFunc: 'sum',\r\n filter: 'agNumberColumnFilter'\r\n },\r\n {\r\n field: 'submittedGross',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('submitted-gross-abbr'),\r\n cellDataType: 'money',\r\n aggFunc: 'sum',\r\n filter: 'agNumberColumnFilter'\r\n },\r\n {\r\n field: 'submittedBonus',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('submitted-bonus-abbr'),\r\n cellDataType: 'money',\r\n aggFunc: 'sum',\r\n filter: 'agNumberColumnFilter'\r\n },\r\n {\r\n field: 'issuedActual',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('issued-actual-abbr'),\r\n cellDataType: 'money',\r\n aggFunc: 'sum',\r\n filter: 'agNumberColumnFilter'\r\n },\r\n {\r\n field: 'issuedGross',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('issued-gross-abbr'),\r\n cellDataType: 'money',\r\n aggFunc: 'sum',\r\n filter: 'agNumberColumnFilter'\r\n },\r\n {\r\n field: 'issuedPromotion',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('issued-promotion-abbr'),\r\n cellDataType: 'money',\r\n aggFunc: 'sum',\r\n filter: 'agNumberColumnFilter'\r\n },\r\n {\r\n field: 'issuedHierarchyBonus',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('issued-hierarchy-bonus-abbr'),\r\n cellDataType: 'money',\r\n aggFunc: 'sum',\r\n filter: 'agNumberColumnFilter'\r\n },\r\n {\r\n field: 'contestBonus',\r\n type: 'numericColumn',\r\n headerName: this._i18n.tr('contest-bonus-abbr'),\r\n cellDataType: 'money',\r\n aggFunc: 'sum',\r\n filter: 'agNumberColumnFilter'\r\n },\r\n {\r\n field: 'week',\r\n type: '',\r\n headerName: this._i18n.tr('widget-period-week'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'month',\r\n type: '',\r\n headerName: this._i18n.tr('widget-period-month'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'year',\r\n type: '',\r\n headerName: this._i18n.tr('widget-period-year'),\r\n cellDataType: 'text',\r\n enableRowGroup: true,\r\n hide: true\r\n },\r\n {\r\n field: 'createdDate',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('created'),\r\n cellDataType: 'dateString',\r\n hide: true\r\n },\r\n {\r\n field: 'lastUpdatedDate',\r\n type: 'dateColumn',\r\n headerName: this._i18n.tr('updated'),\r\n cellDataType: 'dateString',\r\n hide: true\r\n },\r\n {\r\n field: 'convertedToLeadValue',\r\n headerName: this._i18n.tr('converted-to-lead'),\r\n hide: true\r\n },\r\n ];\r\n }\r\n}","import {inject} from 'aurelia-framework';\r\nimport {Security} from 'common/security';\r\nimport {Notifier, Page} from 'common/ui';\r\nimport {Api} from 'common/server';\r\nimport {I18n} from 'common/i18n';\r\n\r\n@inject(Security, Notifier, Page, Api, I18n)\r\nexport class ApprovalRequests {\r\n\r\n _memberId = null;\r\n returnLinkKey = 'profile-return-link';\r\n approvals = [];\r\n\r\n constructor(security, notifier, page, api, i18n) {\r\n this.security = security;\r\n this.notifier = notifier;\r\n this.page = page;\r\n this.api = api;\r\n this.i18n = i18n;\r\n }\r\n\r\n activate(params, routerConfig) {\r\n this._memberId = params.id;\r\n this.returnLinkKey = this._memberId ? 'profile-return-to-profile-link' : 'profile-return-link';\r\n this.returnLink = this._memberId && this.security.isAdmin ? '#/admin/team-member/' + this._memberId : '#/members/my-profile';\r\n this._loadApprovals();\r\n }\r\n\r\n _loadApprovals() {\r\n var me = this;\r\n var apiUrl = me._memberId ? 'approval/by-member/' + me._memberId : 'approval';\r\n me.api.getData(apiUrl).then(data => {\r\n me.approvals = data;\r\n }).catch(error => {\r\n me.notifier.generalError();\r\n });\r\n }\r\n\r\n toggleApproval(id) {\r\n for (var i = 0; i < this.approvals.length; i++) {\r\n if (this.approvals[i].id !== id) continue;\r\n this.approvals[i].show = !this.approvals[i].show;\r\n break;\r\n }\r\n }\r\n}\r\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".app-root {\\n overflow-x: hidden;\\n}\\n\\n.zeus-new-client-version-available {\\n margin-top: var(--zeus-safe-area-top);\\n background-color: red;\\n color: white;\\n text-align: center;\\n}\\n.zeus-new-client-version-available a {\\n color: white;\\n text-decoration: underline;\\n}\\n\\n.zeus-mobile-logo img {\\n height: 40px;\\n}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/members/_index.scss\"],\"names\":[],\"mappings\":\"AAEA;EACI,kBAAA;AADJ;;AAIA;EACI,qCAAA;EACA,qBAAA;EACA,YAAA;EACA,kBAAA;AADJ;AAGI;EACI,YAAA;EACA,0BAAA;AADR;;AAMI;EACI,YAAA;AAHR\",\"sourcesContent\":[\"@import \\\"./../styles/responsive.scss\\\";\\r\\n\\r\\n.app-root {\\r\\n overflow-x: hidden;\\r\\n}\\r\\n\\r\\n.zeus-new-client-version-available {\\r\\n margin-top: var(--zeus-safe-area-top);\\r\\n background-color: red;\\r\\n color: white;\\r\\n text-align: center;\\r\\n\\r\\n a {\\r\\n color: white;\\r\\n text-decoration: underline;\\r\\n }\\r\\n}\\r\\n\\r\\n.zeus-mobile-logo {\\r\\n img {\\r\\n height: 40px;\\r\\n }\\r\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"\", \"\",{\"version\":3,\"sources\":[],\"names\":[],\"mappings\":\"\",\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"\", \"\",{\"version\":3,\"sources\":[],\"names\":[],\"mappings\":\"\",\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;"],"names":[],"sourceRoot":""}