{"version":3,"file":"app-378b5940.9729664bca28a8e6916d.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AASA;AAAA;AAXA;AAAA;AAAA;AAAA;AAMA;AACA;AAKA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AA9DA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;ACXA;AACA;AACA;AAEA;AAQA;AAAA;AALA;AAAA;AAMA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AA9CA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AAEA;AASA;AACA;AAAA;AARA;AAAA;AAIA;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;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;AA5CA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;ACXA;AACA;AAEA;AASA;AAAA;AARA;AAAA;AAAA;AAAA;AASA;AACA;AARA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;ACRA;AACA;AAEA;AAKA;AAAA;AAOA;AAAA;AAVA;AAAA;AAAA;AAAA;AAAA;AAMA;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAzCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAoCA;AAAA;AAjCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBA;AACA;AACA;AAAA;AAGA;AACA;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;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;AAEA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;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;AAEA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AACA;AACA;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;AA9UA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAoBA;AAAA;AAlBA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;AC5MA;AACA;AACA;AACA;AAEA;AAWA;AAAA;AAAA;AAAA;AAPA;AACA;AAEA;AACA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAAA;AAAA;AACA;AACA;AACA;AAGA;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;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAlGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AAEA;AAYA;AAAA;AAAA;AAAA;AARA;AACA;AAEA;AAEA;AAAA;AAAA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAjFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AAEA;AAOA;AACA;AAAA;AANA;AACA;AAMA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAnCA;;;;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AAEA;AAKA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjBA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAgCA;AAAA;AAAA;AAAA;AA3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAGA;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;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;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;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;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;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;AAEA;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;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAhdA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;ACpCA;AACA;AACA;AACA;AAEA;AAIA;AAAA;AACA;AAAA;AA6BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAdA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;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;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;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;AACA;AACA;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;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AA5PA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;ACvBA;AACA;AAEA;AAIA;AAAA;AAKA;AAAA;AAPA;AAAA;AAAA;AAQA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxCA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AAEA;AAOA;AAAA;AALA;AACA;AAKA;AACA;AAEA;AACA;AAEA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjCA;;;;;;;;;;;;;;;;;;;ACPA;AAEA;AAAA;AAAA;AAAA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AATA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACLA;AACA;AAEA;AAOA;AAAA;AAAA;AAJA;AACA;AAIA;AAEA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAjBA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AAEA;AAeA;AAAA;AACA;AAAA;AAMA;AAAA;AApBA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAhJA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;AC1BA;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;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACPA;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;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","sources":["webpack://www.zeusteam.com/./src/resources/elements/color-picker/color-picker.js","webpack://www.zeusteam.com/./src/resources/elements/commission-grid/commission-grid.js","webpack://www.zeusteam.com/./src/resources/elements/commissions/commission-group.js","webpack://www.zeusteam.com/./src/resources/elements/commissions/commission-list.js","webpack://www.zeusteam.com/./src/resources/elements/container-and-drawer/container-and-drawer.js","webpack://www.zeusteam.com/./src/resources/elements/content-view/content-view.js","webpack://www.zeusteam.com/./src/resources/elements/content-view/dialog/editor.js","webpack://www.zeusteam.com/./src/resources/elements/contest-standings/contest-progress.js","webpack://www.zeusteam.com/./src/resources/elements/contest-standings/contest-standings.js","webpack://www.zeusteam.com/./src/resources/elements/contest-standings/monthly-consistency.js","webpack://www.zeusteam.com/./src/resources/elements/copy-to-clipboard/copy-to-clipboard.js","webpack://www.zeusteam.com/./src/resources/elements/dashboard-builder/dashboard-builder.js","webpack://www.zeusteam.com/./src/resources/elements/date-picker/date-picker.js","webpack://www.zeusteam.com/./src/resources/elements/debt/downline-carrier-debt.js","webpack://www.zeusteam.com/./src/resources/elements/dialer/auto-dial-button.js","webpack://www.zeusteam.com/./src/resources/elements/draggable/draggable-handle.js","webpack://www.zeusteam.com/./src/resources/elements/drilldown-objects/drilldown-object-client.js","webpack://www.zeusteam.com/./src/resources/elements/drilldown-objects/drilldown-object-member.js","webpack://www.zeusteam.com/./src/resources/elements/drilldown-objects/drilldown-object-policy.js","webpack://www.zeusteam.com/./src/resources/elements/drilldown-objects/drilldown-objects.js","webpack://www.zeusteam.com/./src/resources/elements/drop-zone/drop-zone.js","webpack://www.zeusteam.com/./src/resources/elements/color-picker/color-picker.scss","webpack://www.zeusteam.com/./src/resources/elements/commission-grid/commission-grid.scss","webpack://www.zeusteam.com/./src/resources/elements/container-and-drawer/container-and-drawer.scss","webpack://www.zeusteam.com/./src/resources/elements/content-view/content-view.scss","webpack://www.zeusteam.com/./src/resources/elements/contest-standings/contest-progress.scss","webpack://www.zeusteam.com/./src/resources/elements/contest-standings/contest-standings.scss","webpack://www.zeusteam.com/./src/resources/elements/dashboard-builder/dashboard-builder.scss","webpack://www.zeusteam.com/./src/resources/elements/date-picker/date-picker.scss","webpack://www.zeusteam.com/./src/resources/elements/draggable/draggable-handle.scss","webpack://www.zeusteam.com/./src/resources/elements/drilldown-objects/drilldown-objects.scss","webpack://www.zeusteam.com/./src/resources/elements/color-picker/color-picker.html","webpack://www.zeusteam.com/./src/resources/elements/commission-grid/commission-grid.html","webpack://www.zeusteam.com/./src/resources/elements/commissions/commission-group.html","webpack://www.zeusteam.com/./src/resources/elements/commissions/commission-list.html","webpack://www.zeusteam.com/./src/resources/elements/container-and-drawer/container-and-drawer.html","webpack://www.zeusteam.com/./src/resources/elements/content-view/content-view.html","webpack://www.zeusteam.com/./src/resources/elements/content-view/dialog/editor.html","webpack://www.zeusteam.com/./src/resources/elements/contest-standings/contest-progress.html","webpack://www.zeusteam.com/./src/resources/elements/contest-standings/contest-standings.html","webpack://www.zeusteam.com/./src/resources/elements/contest-standings/monthly-consistency.html","webpack://www.zeusteam.com/./src/resources/elements/copy-to-clipboard/copy-to-clipboard.html","webpack://www.zeusteam.com/./src/resources/elements/dashboard-builder/dashboard-builder.html","webpack://www.zeusteam.com/./src/resources/elements/date-picker/date-picker.html","webpack://www.zeusteam.com/./src/resources/elements/debt/downline-carrier-debt.html","webpack://www.zeusteam.com/./src/resources/elements/dialer/auto-dial-button.html","webpack://www.zeusteam.com/./src/resources/elements/draggable/draggable-handle.html","webpack://www.zeusteam.com/./src/resources/elements/drilldown-objects/drilldown-object-client.html","webpack://www.zeusteam.com/./src/resources/elements/drilldown-objects/drilldown-object-member.html","webpack://www.zeusteam.com/./src/resources/elements/drilldown-objects/drilldown-object-policy.html","webpack://www.zeusteam.com/./src/resources/elements/drilldown-objects/drilldown-objects.html","webpack://www.zeusteam.com/./src/resources/elements/drop-zone/drop-zone.html"],"sourcesContent":["import { bindable, bindingMode } from 'aurelia-framework';\r\nimport { I18n } from 'common/i18n';\r\nimport Coloris from \"@melloware/coloris\";\r\nimport { c } from 'common/common';\r\n\r\nexport class ColorPicker {\r\n static inject = [I18n];\r\n _i18n;\r\n\r\n @bindable({ defaultBindingMode: bindingMode.twoWay}) color = undefined;\r\n @bindable showAlpha = false;\r\n @bindable swatches;\r\n\r\n pickerEl;\r\n _picker;\r\n\r\n id;\r\n\r\n constructor(i18n) {\r\n this._i18n = i18n;\r\n this.id = c.Helpers.uniqueId();\r\n }\r\n\r\n attached() {\r\n this._initializePicker();\r\n }\r\n\r\n colorChanged() {\r\n if (!this._initialized || !this.pickerEl) return;\r\n try {\r\n document.querySelector(`#${this.id}`).dispatchEvent(new Event('input', { bubbles: true }));\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n swatchesChanged() {\r\n if (!this._initialized || !this.pickerEl) return;\r\n try {\r\n Coloris({\r\n swatches: this._transformSwatches(),\r\n });\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n _transformSwatches() {\r\n if (!this.swatches) return [];\r\n return this.swatches.map(x => x.hex);\r\n }\r\n\r\n _initializePicker() {\r\n this._initialized = true;\r\n Coloris.init();\r\n Coloris({\r\n el: `#${this.id}`,\r\n alpha: this.showAlpha,\r\n clearButton: {\r\n show: true,\r\n label: this._i18n.tr('clear')\r\n },\r\n swatches: this._transformSwatches(),\r\n onChange: (color) => {\r\n //console.log('coloris', color);\r\n },\r\n });\r\n }\r\n}\r\n","import { customElement, bindable } from 'aurelia-framework';\r\nimport { Carriers } from 'services/carriers';\r\nimport moment from 'moment';\r\n\r\n@customElement('commission-grid')\r\nexport class CommissionGrid {\r\n static inject = [Carriers];\r\n _carriers;\r\n\r\n @bindable carrierId;\r\n displayAllRates = false;\r\n\r\n constructor(carriers) {\r\n this._carriers = carriers;\r\n }\r\n\r\n attached() {\r\n this._load();\r\n }\r\n\r\n carrierIdChanged() {\r\n this._load();\r\n }\r\n\r\n async _load() {\r\n if (!this.carrierId) return;\r\n this.carrierNotesKey = `carrier-commission-grid-${this.carrierId}-notes`;\r\n try {\r\n this.loading = true;\r\n const data = await this._carriers.commissionGrid(this.carrierId);\r\n this.grids = data.grids;\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 commissionRate(grid, level, productGroup) {\r\n const cell = grid.grid.find(x => x.level === level && x.productGroup === productGroup);\r\n if (!cell) return undefined;\r\n return cell.commissionRate;\r\n }\r\n\r\n commissionRateCellClass(grid) {\r\n // have 12 to work with\r\n if (grid.productGroups.length > 4) return 'col-sm-1';\r\n if (grid.productGroups.length > 3) return 'col-sm-2';\r\n return 'col-sm-3';\r\n\r\n }\r\n\r\n toggleRates() {\r\n this.displayAllRates = !this.displayAllRates;\r\n }\r\n}\r\n","import { bindable } from 'aurelia-framework'\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Security } from 'common/security';\r\nimport { Commissions } from 'services/commissions';\r\nimport { TimePeriodNavigatorBase } from 'resources/base-classes/time-period-navigator-base';\r\nimport { WIDGET, COMMISSION } from 'common/constants';\r\n\r\nexport class CommissionGroup extends TimePeriodNavigatorBase {\r\n static inject = [EventAggregator, Security, Commissions];\r\n _commissions;\r\n\r\n @bindable config;\r\n\r\n GROUP_BY = COMMISSION.GroupBy;\r\n PERIOD = WIDGET.Period;\r\n\r\n constructor(ea, security, commissions) {\r\n super('commission-group', ea);\r\n this._security = security;\r\n this._commissions = commissions;\r\n }\r\n\r\n attached() {\r\n this._isAttached = true;\r\n this._attached();\r\n if (!this.config) return;\r\n this._loadData();\r\n }\r\n\r\n configChanged() {\r\n if (!this._isAttached) return;\r\n this._loadData();\r\n }\r\n\r\n async _loadData() {\r\n if (!this.config) return;\r\n if (this._security.isAssistant) return false;\r\n try {\r\n this.loading = true;\r\n if (!this.asOfDate) this.asOfDate = this.config.asOfDate;\r\n this.initializeTimePeriodNavigation();\r\n const data = await this._commissions.all(this.config.memberId, this.config.widgetPeriod, this.asOfDate.toISOString(true), this.config.groupBy, this.config.policyId, this.config.clientId, this.config.carrierId);\r\n this.groupBy = data.groupBy;\r\n if (data.groups && data.groups.length === 1) data.groups[0].showDetails = true;\r\n this.groups = data.groups;\r\n this.displayPaidTo = data.hasMultiplePaidToMembers;\r\n this.timePeriod = WIDGET.Period.toReportTimePeriod(this.config.widgetPeriod);\r\n this.currentPeriod = data.period;\r\n this.setTimePeriodNavigationDisplays();\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","import { bindable } from 'aurelia-framework'\r\nimport { COMMISSION } from 'common/constants';\r\n\r\nexport class CommissionList {\r\n _commissions;\r\n\r\n @bindable commissions;\r\n @bindable groupBy;\r\n @bindable displayPaidTo;\r\n\r\n GROUP_BY = COMMISSION.GroupBy;\r\n\r\n constructor() {\r\n }\r\n}\r\n","import { bindable, bindingMode } from 'aurelia-framework';\r\nimport { CssAnimator } from 'aurelia-animator-css';\r\n\r\nexport class ContainerAndDrawer {\r\n static inject = [Element, CssAnimator];\r\n _animator;\r\n\r\n @bindable position = 'bottom';\r\n @bindable({ defaultBindingMode: bindingMode.twoWay }) toggleTrigger;\r\n @bindable autoHeight = false;\r\n @bindable rightSide = false;\r\n showDrawer = false;\r\n\r\n drawerEl;\r\n\r\n constructor(element, animator) {\r\n this._element = element;\r\n this._animator = animator;\r\n }\r\n\r\n toggleTriggerChanged(newValue, oldValue) {\r\n if (oldValue === null) return; // do nothing on the initial set of the variable by the page\r\n this.toggleDrawer();\r\n }\r\n\r\n toggleDrawer() {\r\n this._animateDrawer(!this.showDrawer);\r\n // hide drawer just before the animation (300ms) ends\r\n window.setTimeout(() => this._toggleDrawer(), this.showDrawer ? 200 : 0);\r\n }\r\n\r\n _toggleDrawer() {\r\n this.showDrawer = !this.showDrawer;\r\n if (!this.showDrawer) {\r\n this._element.dispatchEvent(new CustomEvent('drawerclosed', { bubbles: true, detail: {} }));\r\n } else {\r\n this._element.dispatchEvent(new CustomEvent('draweropened', { bubbles: true, detail: {} }));\r\n }\r\n }\r\n\r\n _animateDrawer(showDrawer) {\r\n if (!this.drawerEl) return;\r\n if (showDrawer) {\r\n this._animator.addClass(this.drawerEl, 'zeus-drawer-show');\r\n } else {\r\n this._animator.removeClass(this.drawerEl, 'zeus-drawer-show');\r\n }\r\n }\r\n}\r\n","import { PLATFORM } from 'aurelia-pal';\r\nimport {inject, customElement, bindable} from 'aurelia-framework';\r\nimport {DialogService} from 'aurelia-dialog';\r\nimport {EventAggregator} from 'aurelia-event-aggregator';\r\nimport {Editor} from './dialog/editor';\r\nimport {UiWidgets} from 'services/ui-widgets';\r\nimport {Security} from 'common/security';\r\nimport {I18n} from 'common/i18n';\r\nimport { c, initializeUiWidgetHtml } from 'common/common';\r\nimport environment from '../../../../config/environment.json';\r\nPLATFORM.moduleName('./dialog/editor');\r\n\r\n@customElement('content-view')\r\n@inject(DialogService, EventAggregator, UiWidgets, Security, I18n)\r\nexport class ContentView {\r\n id = '';\r\n @bindable key;\r\n @bindable navbar;\r\n @bindable widgetType = '';\r\n @bindable hideTitle = false;\r\n @bindable hideContent = false;\r\n @bindable saveEventKey = '';\r\n @bindable iconHover = '';\r\n @bindable onlyEditor = false;\r\n @bindable onlyEditorButton = '';\r\n @bindable onlyEditorIcon = '';\r\n @bindable onlyEditorTextKey = '';\r\n @bindable titleH3 = false;\r\n @bindable titlePrepend = '';\r\n @bindable approval = null;\r\n @bindable titleCssClass = '';\r\n @bindable memberId = null;\r\n @bindable memberEdit = false;\r\n @bindable memberEditorButton = '';\r\n @bindable memberEditorTextKey = '';\r\n @bindable fullEditor = true;\r\n @bindable showTitleEditor = true;\r\n @bindable instructionsKey = '';\r\n hasNavbar = false;\r\n uiWidget = null;\r\n canEdit = false;\r\n @bindable skipReplaceVariables = false;\r\n\r\n _sliderIntervals = {};\r\n _sliderChecks = {};\r\n\r\n _handlers = [];\r\n\r\n constructor(dialogService, eventAggregator, uiWidgets, security, i18n) {\r\n this.dialogService = dialogService;\r\n this.eventAggregator = eventAggregator;\r\n this.uiWidgets = uiWidgets;\r\n this.security = security;\r\n this.i18n = i18n;\r\n\r\n this.id = c.Helpers.uniqueId();\r\n this.canEdit = this.security.canEditContent();\r\n this._subscribeToEvents();\r\n }\r\n\r\n async bind(bindingContext, overrideContext) {\r\n try {\r\n if (!this.key) {\r\n this.uiWidget = null;\r\n this.widgetType = null;\r\n this._setTitle();\r\n return;\r\n }\r\n this.uiWidget = await this.uiWidgets.get(this.key, this.memberId);\r\n if (this._isAttached) this._startInitializingEmbeddedContent();\r\n if (!this.widgetType) this.widgetType = this.uiWidget ? this.uiWidget.widgetType : null;\r\n this._setTitle();\r\n this.hasNavbar = this.navbar ? true : false;\r\n if (!this.iconHover) this.iconHover = this.key;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async keyChanged(newValue, oldValue) {\r\n try {\r\n if (newValue) {\r\n this.uiWidget = await this.uiWidgets.get(this.key, this.memberId);\r\n if (this._isAttached) this._startInitializingEmbeddedContent();\r\n if (!this.widgetType) this.widgetType = this.uiWidget ? this.uiWidget.widgetType : null;\r\n this._setTitle();\r\n }\r\n if (!this.iconHover) this.iconHover = this.key;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async memberIdChanged(newValue, oldValue) {\r\n if (!this.key) return;\r\n try {\r\n this.uiWidget = await this.uiWidgets.get(this.key, this.memberId);\r\n if (this._isAttached) this._startInitializingEmbeddedContent();\r\n if (!this.widgetType) this.widgetType = this.uiWidget ? this.uiWidget.widgetType : null;\r\n this._setTitle();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n attached() {\r\n this._isAttached = true;\r\n if (this.uiWidget) this._startInitializingEmbeddedContent();\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 _startInitializingEmbeddedContent() {\r\n window.setTimeout(() => { this._initializeEmbeddedContent(); }, 250);\r\n }\r\n\r\n _subscribeToEvents() {\r\n this._handlers.push(this.eventAggregator.subscribe(c.EventKeys.reloadUiWidget, async (data) => {\r\n this.uiWidget = await this.uiWidgets.get(this.key, this.memberId)\r\n if (!this.widgetType) this.widgetType = this.uiWidget ? this.uiWidget.widgetType : null;\r\n this._setTitle();\r\n window.setTimeout(() => { this._initializeEmbeddedContent(); }, 750);\r\n }));\r\n this._handlers.push(this.eventAggregator.subscribe(c.EventKeys.loginAuthenticationUpdated, (data) => {\r\n this.canEdit = this.security.canEditContent();\r\n }));\r\n this._handlers.push(this.eventAggregator.subscribe(c.EventKeys.uiWidgetUpdated, async (data) => {\r\n if (this.key !== data.key) return;\r\n this.uiWidget = await this.uiWidgets.get(this.key, this.memberId);\r\n if (!this.widgetType) this.widgetType = this.uiWidget ? this.uiWidget.widgetType : null;\r\n this._setTitle();\r\n window.setTimeout(() => { this._initializeEmbeddedContent(); }, 750);\r\n }));\r\n this._handlers.push(this.eventAggregator.subscribe(c.EventKeys.openContentEditor, (data) => {\r\n if (this.key !== data.key) return;\r\n this.openEditor();\r\n }));\r\n }\r\n\r\n _setTitle() {\r\n this.theTitle = '';\r\n if (!this.uiWidget) return;\r\n if (this.titlePrepend === '') {\r\n this.theTitle = this.uiWidget.title;\r\n } else {\r\n this.theTitle = this.titlePrepend + this.uiWidget.title;\r\n }\r\n }\r\n\r\n openEditor() {\r\n var model = {\r\n uiWidget: JSON.parse(JSON.stringify(this.uiWidget)),\r\n widgetType: this.widgetType,\r\n approval: this.approval,\r\n memberId: this.memberId,\r\n fullEditor: this.fullEditor,\r\n editFor: this.iconHover,\r\n showTitleEditor: this.showTitleEditor,\r\n instructionsKey: this.instructionsKey\r\n };\r\n\r\n this.dialogService.open({ viewModel: Editor, model: model, ignoreTransitions: true }).whenClosed(async (response) => {\r\n if (response.wasCancelled) return;\r\n this.uiWidget = await this.uiWidgets.get(this.key, this.memberId);\r\n if (!this.widgetType) this.widgetType = this.uiWidget ? this.uiWidget.widgetType : null;\r\n this._setTitle();\r\n if (this.saveEventKey) this.eventAggregator.publish(this.saveEventKey, response.output.uiWidget);\r\n window.setTimeout(() => { this._initializeEmbeddedContent(); }, 500);\r\n });\r\n }\r\n\r\n _initializeEmbeddedContent() {\r\n this._initializeSlideshows();\r\n this._initializeIframes();\r\n this._initializeScripts();\r\n this._replaceVariables();\r\n }\r\n\r\n _initializeIframes() {\r\n $('#' + this.id + ' iframe.add-open-in-new-window').each(function (index, value) {\r\n var that = $(this);\r\n var isInitialized = that.attr('data-is-initialized');\r\n if (isInitialized) return;\r\n that.attr('data-is-initialized', 'true');\r\n var src = that.attr('src');\r\n var html = '';\r\n $(html).insertBefore(that);\r\n });\r\n }\r\n\r\n _replaceVariables() {\r\n if (this.skipReplaceVariables) return;\r\n if (!this.uiWidget || !this.uiWidget.html) return;\r\n this.uiWidget.html = initializeUiWidgetHtml(this.uiWidget.html, this.security);\r\n }\r\n\r\n _initializeSlideshows() {\r\n if (!this.uiWidget || !this.uiWidget.html) return;\r\n const me = this;\r\n const hasSlideshow = this.uiWidget.html.indexOf('imageslideshow-placeholder') >= 0;\r\n if (!hasSlideshow) return;\r\n const slideshowEls = $(`#${this.id} .content-view-container-html img.imageslideshow-placeholder`);\r\n if (slideshowEls.length === 0) {\r\n window.setTimeout(() => { this._initializeSlideshows(); }, 500);\r\n return;\r\n }\r\n let slideIndex = 1;\r\n slideshowEls.each(function(index, value) {\r\n try {\r\n let that = $(this);\r\n let isInitialized = that.attr('data-is-initialized');\r\n if (isInitialized) return;\r\n that.attr('data-is-initialized', 'true');\r\n that.hide();\r\n let id = that.attr('id') || c.Helpers.uniqueId();\r\n let sliderId = `zeus-slider-${id}-${slideIndex++}`;\r\n let images = that.attr('data-images').split('|');\r\n let captions = that.attr('data-captions').split('|');\r\n let links = that.attr('data-links').split('|');\r\n let newWindows = that.attr('data-newwindow').split('|');\r\n let intervalMs = 4013;\r\n let dataInterval = that.attr('data-interval');\r\n if (dataInterval && !isNaN(dataInterval)) {\r\n intervalMs = Number(dataInterval);\r\n }\r\n\r\n let html = `
';\r\n\r\n $(html).insertAfter(that);\r\n that.css('border-width', '0px');\r\n\r\n const nextSlide = (slider, forSliderId, forSliderIntervals, fromClick = false) => {\r\n if (forSliderIntervals[forSliderId].isPaused && !fromClick) return;\r\n if (fromClick) {\r\n window.clearInterval(forSliderIntervals[forSliderId].interval);\r\n }\r\n const first = slider.childNodes[0];\r\n const before = slider.querySelector('.zeus-slideshow-showing');\r\n if (before) {\r\n before.classList.remove('zeus-slideshow-showing');\r\n const next = before.nextElementSibling;\r\n if (next) {\r\n next.classList.add('zeus-slideshow-showing');\r\n } else {\r\n first.classList.add('zeus-slideshow-showing');\r\n }\r\n } else {\r\n first.classList.add('zeus-slideshow-showing');\r\n }\r\n };\r\n\r\n const previousSlide = (slider, forSliderId, forSliderIntervals, fromClick = false) => {\r\n if (forSliderIntervals[forSliderId].isPaused && !fromClick) return;\r\n if (fromClick) {\r\n window.clearInterval(forSliderIntervals[forSliderId].interval);\r\n }\r\n const last = slider.childNodes[slider.childNodes.length - 1];\r\n const before = slider.querySelector('.zeus-slideshow-showing');\r\n if (before) {\r\n before.classList.remove('zeus-slideshow-showing');\r\n const previous = before.previousElementSibling;\r\n if (previous) {\r\n previous.classList.add('zeus-slideshow-showing');\r\n } else {\r\n last.classList.add('zeus-slideshow-showing');\r\n }\r\n } else {\r\n last.classList.add('zeus-slideshow-showing');\r\n }\r\n };\r\n\r\n $(`#${sliderId} .zeus-slideshow-arrow-left`).each(function(index, value) {\r\n this.addEventListener('click', () => {\r\n previousSlide(thisSlider, sliderId, me._sliderIntervals, true);\r\n me._sliderIntervals[sliderId].interval = window.setInterval(() => nextSlide(thisSlider, sliderId, me._sliderIntervals), intervalMs);\r\n });\r\n });\r\n $(`#${sliderId} .zeus-slideshow-arrow-right`).each(function(index, value) {\r\n this.addEventListener('click', () => {\r\n nextSlide(thisSlider, sliderId, me._sliderIntervals, true);\r\n me._sliderIntervals[sliderId].interval = window.setInterval(() => nextSlide(thisSlider, sliderId, me._sliderIntervals), intervalMs);\r\n });\r\n });\r\n\r\n const thisSlider = document.querySelector(`#${sliderId}`);\r\n const sliderInterval = window.setInterval(() => nextSlide(thisSlider, sliderId, me._sliderIntervals), intervalMs);\r\n me._sliderIntervals[sliderId] = { isPaused: false, interval: sliderInterval };\r\n nextSlide(thisSlider, sliderId, me._sliderIntervals);\r\n thisSlider.addEventListener('mouseover', () => {\r\n me._sliderIntervals[sliderId].isPaused = true;\r\n });\r\n thisSlider.addEventListener('mouseout', () => {\r\n me._sliderIntervals[sliderId].isPaused = false;\r\n });\r\n\r\n window.setTimeout(() => { me._checkSlideshow(sliderId); }, 500);\r\n } catch (slideshowErr) {\r\n console.log(slideshowErr);\r\n }\r\n });\r\n }\r\n\r\n _checkSlideshow(sliderId) {\r\n if (!this._sliderChecks[sliderId]) this._sliderChecks[sliderId] = 0;\r\n this._sliderChecks[sliderId]++;\r\n const thisSlider = document.querySelector(`#${sliderId}`);\r\n if (thisSlider) return;\r\n if (this._sliderChecks[sliderId] > 3) {\r\n this._sliderChecks[sliderId] = 0;\r\n return;\r\n }\r\n window.setTimeout(() => this._initializeSlideshows(), 250);\r\n }\r\n\r\n _initializeScripts() {\r\n const id = this.id;\r\n $(`#${this.id} script`).each(function(index, value) {\r\n try {\r\n const frag = document.createRange().createContextualFragment($(this)[0].outerHTML);\r\n $(`#${id}`).append(frag);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n });\r\n }\r\n}\r\n","import {inject} from 'aurelia-framework';\r\nimport {DialogController} from 'aurelia-dialog';\r\nimport {UiWidgets} from 'services/ui-widgets';\r\nimport {I18n} from 'common/i18n';\r\nimport {Notifier} from 'common/ui';\r\nimport { Content } from 'common/content';\r\nimport { c, initializeUiWidgetHtml } from 'common/common';\r\nimport tinymce from 'tinymce';\r\n\r\n@inject(DialogController, UiWidgets, I18n, Notifier, Content)\r\nexport class Editor {\r\n _content;\r\n\r\n title = '';\r\n id = null;\r\n uiWidget = null;\r\n uiWidgetId = null;\r\n languageOptions = [];\r\n locale = '';\r\n approval = null;\r\n memberId = null;\r\n fullEditor = true;\r\n showTitleEditor = true;\r\n instructionsKey;\r\n comment;\r\n\r\n restoreOptions = null;\r\n restoreOption;\r\n\r\n constructor(dialogController, uiWidgets, i18n, notifier, content) {\r\n this.dialogController = dialogController;\r\n this.uiWidgets = uiWidgets;\r\n this.i18n = i18n;\r\n this.notifier = notifier;\r\n this._content = content;\r\n\r\n this.dialogController.settings.centerHorizontalOnly = true;\r\n this.id = c.Helpers.uniqueId();\r\n this.languageOptions = this.i18n.supportedLanguages;\r\n this.locale = this.i18n.currentLocale;\r\n }\r\n\r\n async activate(model) {\r\n this.uiWidget = model.uiWidget;\r\n this.uiWidgetId = null;\r\n this.widgetType = model.widgetType;\r\n this.approval = model.approval;\r\n this.memberId = model.memberId;\r\n this.fullEditor = model.fullEditor;\r\n this.title = this.i18n.tr('content-editor-title', { name: model.uiWidget ? model.uiWidget.key : model.editFor } );\r\n this.showTitleEditor = model.showTitleEditor;\r\n this.instructionsKey = model.instructionsKey;\r\n if (this.uiWidget) {\r\n this.uiWidgetId = this.uiWidget.id;\r\n // load from the svc so the replaced variables are not displayed\r\n this.uiWidget = await this.uiWidgets.get(this.uiWidget.key, this.memberId);\r\n }\r\n }\r\n\r\n attached() {\r\n this._initializeTinyMce();\r\n let activeEditor = tinymce.activeEditor;\r\n if (activeEditor.initialized) {\r\n this._setContent(activeEditor);\r\n } else {\r\n let me = this;\r\n activeEditor.on('init', function() {\r\n me._setContent(this);\r\n });\r\n }\r\n }\r\n\r\n detached() {\r\n let ae = tinymce.activeEditor;\r\n if (ae) ae.remove();\r\n }\r\n\r\n async onLocaleChange() {\r\n try {\r\n this.uiWidget = await this.uiWidgets.getForLocale(this.uiWidget.key, this.locale);\r\n this._setContent(tinymce.activeEditor);\r\n this.restoreOption = null;\r\n this.restoreOptions = null;\r\n } catch (err) {\r\n this.notifier.errorText('An error occurred and the content for ' + this.locale + ' was not loaded.');\r\n }\r\n }\r\n\r\n _setContent(activeEditor) {\r\n let html = '';\r\n if (this.uiWidget.html) html = initializeUiWidgetHtml(this.uiWidget.html);\r\n if (activeEditor.initialized) activeEditor.setContent(html);\r\n }\r\n\r\n _initializeTinyMce() {\r\n let me = this;\r\n tinymce.baseURL = '/tinymce';\r\n let toolbarRow1 = 'undo redo | styleselect | forecolor backcolor | bold italic | link | image imageslideshow | wufoo iframeembed vimeoembed';\r\n let toolbarRow2 = 'bootstrap | hr | alignleft aligncenter alignright | bullist numlist outdent indent | code';\r\n if (!this.fullEditor) {\r\n toolbarRow1 = 'bold italic | bullist numlist';\r\n toolbarRow2 = null;\r\n }\r\n tinymce.init({\r\n selector: 'textarea#' + this.id,\r\n theme: 'modern',\r\n height: 250,\r\n \r\n remove_script_host: false,\r\n convert_urls: false,\r\n\r\n plugins: ['advlist autolink lists link hr anchor textcolor code image imageslideshow'],\r\n external_plugins: { \r\n 'imageslideshow': '/js-lib/tinymce-plugins/imageslideshow/plugin.js',\r\n 'bootstrap': '/js-lib/tinymce-plugins/bootstrap/plugin.min.js',\r\n 'wufoo': '/js-lib/tinymce-plugins/wufoo/plugin.js',\r\n 'iframeembed': '/js-lib/tinymce-plugins/iframeembed/plugin.js',\r\n 'vimeoembed': '/js-lib/tinymce-plugins/vimeoembed/plugin.js'\r\n },\r\n\r\n toolbar1: toolbarRow1,\r\n toolbar2: toolbarRow2,\r\n //toolbar2: 'mc-merge-email mc-merge-fname mc-merge-lname',\r\n //setup: function(editor) {\r\n // editor.addButton('mc-merge-email', { text: 'Insert Email', icon: false, onclick: function() { editor.insertContent('*|EMAIL|*') } }),\r\n // editor.addButton('mc-merge-fname', { text: 'Insert First Name', icon: false, onclick: function() { editor.insertContent('*|FNAME|*') } }),\r\n // editor.addButton('mc-merge-lname', { text: 'Insert Last Name', icon: false, onclick: function() { editor.insertContent('*|LNAME|*') } })\r\n //},\r\n\r\n menubar: false,\r\n toolbar_items_size: 'small',\r\n extended_valid_elements: 'script[type|src],iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder],rssapp-ticker[id],rssapp-imageboard[id]',\r\n file_browser_callback: function (field_name, url, type, win) {\r\n me._openFileManager(`#${field_name}`, win);\r\n },\r\n slideshow_callback: function (elCssSelector, win, callback, fileType) {\r\n console.log('slideshow_callback', elCssSelector, win);\r\n me._openFileManager(elCssSelector, win, callback, fileType);\r\n },\r\n\r\n valid_elements: '*[*]',\r\n\r\n setup: function (ed) {\r\n ed.on('init', function(evt) {\r\n ed.getBody().setAttribute('spellcheck', true);\r\n });\r\n },\r\n\r\n bootstrapConfig: {\r\n 'bootstrapElements': {\r\n 'template': true\r\n }\r\n }\r\n });\r\n }\r\n\r\n _openFileManager(elCssSelector, win, callback, fileType) {\r\n this._content.fileManager(file => {\r\n const name = file.displayName || file.fileName;\r\n const inputEl = win.document.querySelectorAll(elCssSelector)[0];\r\n inputEl.value = file.path;\r\n\r\n if (callback) callback(file.path);\r\n }, fileType);\r\n }\r\n\r\n async save(closeEditor) {\r\n this.uiWidget.html = tinymce.activeEditor.getContent();\r\n if (this.uiWidget.id) {\r\n try {\r\n await this.uiWidgets.update(this.uiWidget.id, this.uiWidget.key, this.locale, this.uiWidget.title, this.uiWidget.html, this.widgetType, this.approval, this.memberId, this.comment, this.uiWidget.fromEmail);\r\n this.notifier.success('content-widget-saved');\r\n if (closeEditor) this.dialogController.ok({ uiWidget: this.uiWidget, language: this.locale });\r\n } catch (err) {\r\n console.log(error);\r\n this.notifier.errorText('An error occured saving the content.');\r\n }\r\n } else {\r\n try {\r\n this.uiWidget = await this.uiWidgets.add(this.uiWidget.key, this.locale, this.uiWidget.title, this.uiWidget.html, this.widgetType, this.approval, this.memberId, this.comment, this.uiWidget.fromEmail);\r\n this.notifier.success('content-widget-saved');\r\n if (closeEditor) this.dialogController.ok({ uiWidget: this.uiWidget, language: this.locale });\r\n } catch (err) {\r\n this.notifier.errorText('An error occured saving the content.');\r\n }\r\n }\r\n }\r\n\r\n async loadRestoreOptions() {\r\n this.restoreOptions = await this.uiWidgets.getArchives(this.uiWidget.key, this.locale);\r\n }\r\n\r\n onRestoreOptionSelected() {\r\n if (!this.restoreOption) return;\r\n let activeEditor = tinymce.activeEditor;\r\n if (activeEditor.initialized) activeEditor.setContent(this.restoreOption.html);\r\n this.uiWidget.title = this.restoreOption.title;\r\n }\r\n\r\n cancelRestore() {\r\n let activeEditor = tinymce.activeEditor;\r\n if (activeEditor.initialized) activeEditor.setContent(this.uiWidget.html);\r\n this.restoreOption = null;\r\n }\r\n}\r\n","import { bindable } from 'aurelia-framework';\r\nimport { Contests } from 'services/contests';\r\nimport { Security } from 'common/security';\r\nimport moment from 'moment';\r\n\r\nexport class ContestProgress {\r\n static inject = [Contests, Security];\r\n @bindable code = null;\r\n @bindable memberId = null;\r\n _contests;\r\n security;\r\n\r\n contest;\r\n standing;\r\n member;\r\n\r\n constructor(contests, security) {\r\n this._contests = contests;\r\n this.security = security;\r\n }\r\n\r\n attached() {\r\n this.isAttached = true;\r\n this._load();\r\n }\r\n\r\n codeChanged() {\r\n if (!this.isAttached) return;\r\n this._load();\r\n }\r\n\r\n memberIdChanged() {\r\n if (!this.isAttached) return;\r\n this._load();\r\n }\r\n\r\n requirementsCssClass(standing) {\r\n if (!this.contest.hasRequirements || !standing || !standing.isInDownline) return '';\r\n if (standing.meetsRequirements) return 'zeus-success';\r\n return 'zeus-error';\r\n }\r\n\r\n async _load() {\r\n try {\r\n if (!this.code) return;\r\n this.loading = true;\r\n this.gradientStyle = {};\r\n this.standing = undefined;\r\n const memberId = this.memberId || this.security.authenticatedMemberId;\r\n const data = await this._contests.memberStanding(this.code, memberId);\r\n if (!data) return;\r\n\r\n this.latestPolicyDate = data.latestPolicyDate;\r\n this.contest = data.contest;\r\n\r\n this.standing = data.standings.length === 1 ? data.standings[0] : { points: 0 };\r\n this.member = data.member;\r\n this.memberDetails = data.memberDetails;\r\n const progressPercentage = this.standing\r\n ? (this.standing.points / this.contest.qualifyingPoints) * 100\r\n : 0;\r\n const gradientStyle = {\r\n background: `linear-gradient(0deg, rgba(132,189,61,1) 0%, rgba(132,189,61,1) ${progressPercentage}%, rgba(255,255,255,1) ${progressPercentage + 4}%)`,\r\n };\r\n if (this.contest.thermometerSettings2) {\r\n gradientStyle.top = this.contest.thermometerSettings2.top;\r\n gradientStyle.bottom = this.contest.thermometerSettings2.bottom;\r\n gradientStyle.left = this.contest.thermometerSettings2.left;\r\n gradientStyle.right = this.contest.thermometerSettings2.right;\r\n }\r\n this.gradientStyle = gradientStyle;\r\n\r\n if (this.contest.qualifyingLevels && this.contest.thermometerSettings2) {\r\n this.levelLinesStyle = {\r\n top: this.contest.thermometerSettings2.top,\r\n bottom: this.contest.thermometerSettings2.bottom,\r\n left: this.contest.thermometerSettings2.left,\r\n right: this.contest.thermometerSettings2.right\r\n };\r\n for (let level of this.contest.qualifyingLevels) {\r\n const levelProgressPercentage = (level.qualifyingPoints / this.contest.qualifyingPoints) * 100;\r\n level.style = {\r\n bottom: `${levelProgressPercentage}%`\r\n };\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 async refresh() {\r\n this.refreshing = true;\r\n await this._load();\r\n window.setTimeout(() => this.refreshing = false, 2000);\r\n }\r\n\r\n async showDetails() {\r\n this.showDrawer = moment().format();\r\n }\r\n\r\n drawerClosed() {\r\n }\r\n}\r\n","import { bindable } from 'aurelia-framework';\r\nimport { Contests } from 'services/contests';\r\nimport { Security } from 'common/security';\r\nimport moment from 'moment';\r\n\r\nexport class ContestStandings {\r\n static inject = [Contests, Security];\r\n @bindable code = null;\r\n @bindable staticHeight = false;\r\n _contests;\r\n security;\r\n\r\n standings;\r\n standingsFilters = [\r\n { value: '', custom: this.leaderboardTypeFilter },\r\n ];\r\n\r\n constructor(contests, security) {\r\n this._contests = contests;\r\n this.security = security;\r\n }\r\n\r\n attached() {\r\n this.isAttached = true;\r\n this._load();\r\n }\r\n\r\n leaderboardTypeFilter(filterValue, row) {\r\n if (!filterValue) return true;\r\n if (filterValue === 'mid-contest') return row.applyMidContestStandards;\r\n else if (filterValue === 'full-contest') return !row.applyMidContestStandards;\r\n return true;\r\n }\r\n\r\n codeChanged() {\r\n if (!this.isAttached) return;\r\n this._load();\r\n }\r\n\r\n async _load() {\r\n try {\r\n if (!this.code) return;\r\n this.loading = true;\r\n this.standings = [];\r\n const data = await this._contests.standings(this.code);\r\n if (!data) return;\r\n this.contest = data.contest;\r\n this.standings = data.standings;\r\n this.latestPolicyDate = data.latestPolicyDate;\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 requirementsCssClass(record) {\r\n if (!this.contest.hasRequirements || !record || !record.isInDownline) return '';\r\n if (record.meetsRequirements) return 'zeus-success';\r\n return 'zeus-error';\r\n }\r\n\r\n async refresh() {\r\n this.refreshing = true;\r\n await this._load();\r\n window.setTimeout(() => this.refreshing = false, 2000);\r\n }\r\n\r\n async showDetails(record) {\r\n if (!record.isAuthenticatedRecord && !this.security.isAdmin) return;\r\n try {\r\n this.loadingDetails = true;\r\n this.detailsFor = record.member;\r\n this.memberDetails = undefined;\r\n const data = await this._contests.standings(this.code, record.member.id);\r\n this.memberDetails = data.memberDetails;\r\n this.showDrawer = moment().format();\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.loadingDetails = false;\r\n }\r\n }\r\n\r\n drawerClosed() {\r\n this.detailsFor = undefined;\r\n this.memberDetails = undefined;\r\n }\r\n}\r\n","import { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { Contests } from 'services/contests';\r\nimport { Security } from 'common/security';\r\nimport { TimePeriodNavigatorBase } from 'resources/base-classes/time-period-navigator-base';\r\nimport { WIDGET } from 'common/constants';\r\n\r\nexport class MonthlyConsistency extends TimePeriodNavigatorBase {\r\n static inject = [EventAggregator, Contests, Security];\r\n _contests;\r\n security;\r\n\r\n standings;\r\n\r\n constructor(ea, contests, security) {\r\n super('monthly-consistency', ea);\r\n this._contests = contests;\r\n this.security = security;\r\n }\r\n\r\n attached() {\r\n this.isAttached = true;\r\n this._attached();\r\n this._loadData();\r\n }\r\n\r\n async _loadData(fromSync = false) {\r\n try {\r\n this.loading = true;\r\n this.initializeTimePeriodNavigation(fromSync);\r\n\r\n const data = await this._contests.monthlyConsistency(this.asOfDate.toISOString(true));\r\n this.records = data.records;\r\n this.timePeriod = WIDGET.Period.toReportTimePeriod(WIDGET.Period.Month);\r\n this.currentPeriod = data.month;\r\n this.setTimePeriodNavigationDisplays();\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","import { bindable } from 'aurelia-framework';\r\nimport { Notifier } from 'common/ui';\r\nimport copy from 'copy-to-clipboard';\r\n\r\nexport class CopyToClipboard {\r\n static inject = [Notifier];\r\n @bindable value;\r\n _notifier;\r\n\r\n constructor(notifier) {\r\n this._notifier = notifier;\r\n }\r\n\r\n copyToClipboard(ev) {\r\n try {\r\n ev.stopPropagation();\r\n ev.preventDefault();\r\n copy(this.value);\r\n this._notifier.success('copy-to-clipboard-success');\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n}\r\n","import { PLATFORM } from 'aurelia-pal';\r\nimport { customElement, observable, bindable, computedFrom } from 'aurelia-framework';\r\nimport { Router } from 'aurelia-router';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { I18n } from 'common/i18n';\r\nimport { TemplatingEngine } from 'aurelia-templating';\r\nimport { Notifier } from 'common/ui';\r\nimport { MemberConfig } from 'services/member-config';\r\nimport { Config } from 'services/config';\r\nimport { Security } from 'common/security';\r\nimport { Dashboards } from 'services/dashboards';\r\nimport { DialogService } from 'aurelia-dialog';\r\nimport { Menus } from 'services/menus';\r\nimport { ConfirmDialog } from 'common/dialogs/confirm/confirm-dialog';\r\nimport { c } from 'common/common';\r\nimport { ROLE } from 'common/constants';\r\nPLATFORM.moduleName('common/dialogs/confirm/confirm-dialog');\r\n\r\n@customElement('dashboard-builder')\r\nexport class DashboardBuilder {\r\n static inject = [Router, EventAggregator, I18n, TemplatingEngine, Notifier, MemberConfig, Config, Security, Dashboards, DialogService, Menus];\r\n @bindable key;\r\n @bindable canSelect = true;\r\n _router;\r\n _ea;\r\n _i18n;\r\n _templatingEngine;\r\n _notifier;\r\n _memberConfig;\r\n _config;\r\n _dashboards;\r\n _dialogService;\r\n _menus;\r\n\r\n @observable dashboardName;\r\n\r\n @observable searchOn;\r\n editable = false;\r\n _grid;\r\n _serializedFull;\r\n\r\n dashboardWidgetsEl;\r\n gridStackEl;\r\n widgets = [];\r\n _widgetSettings = {};\r\n\r\n ADD_PERSONAL_DASHBOARD_KEY = 'add-personal-dashboard';\r\n\r\n _widgetViews = [];\r\n\r\n constructor(router, ea, i18n, templatingEngine, notifier, memberConfig, config, security, dashboards, dialogService, menus) {\r\n this._router = router;\r\n this._ea = ea;\r\n this._i18n = i18n;\r\n this._templatingEngine = templatingEngine;\r\n this._notifier = notifier;\r\n this._memberConfig = memberConfig;\r\n this._config = config;\r\n this._security = security;\r\n this._dashboards = dashboards;\r\n this._dialogService = dialogService;\r\n this._menus = menus;\r\n this._initializeWidgets();\r\n }\r\n\r\n _initializeWidgets() {\r\n this.isDashboardAdmin = this._security.isInRole(ROLE.DashboardAdmin);\r\n this.widgets = this._config.json('dashboardWidgetsJson');\r\n this.widgets.forEach(w => {\r\n if (w.showFor && w.showFor.length) {\r\n let display = false;\r\n w.showFor.forEach(sf => {\r\n switch (sf) {\r\n case 'admin': if (this._security.isAdmin) display = true; break;\r\n case 'masterAgency': if (this._security.isMasterAgency()) display = true; break;\r\n case 'agency': if (this._security.isAgency()) display = true; break;\r\n case 'team': if (this._security.isTeam()) display = true; break;\r\n case 'agent': display = true; break;\r\n }\r\n });\r\n w.display = display;\r\n } else {\r\n if (w.onlyAdmin && !this._security.isAdmin) w.display = false;\r\n else if (w.onlyAgency && !this._security.isAgency()) w.display = false;\r\n else w.display = true;\r\n }\r\n // Check for restriction by roles\r\n if (w.display && w.requireRole) {\r\n if (!this._security.isInRole(w.requireRole)) w.display = false;\r\n }\r\n w.canAccess = w.display;\r\n if (this.isDashboardAdmin) w.display = true;\r\n });\r\n }\r\n\r\n async attached() {\r\n this.loading = true;\r\n if (!this._grid) {\r\n this._initialize();\r\n } else {\r\n window.setTimeout(() => this._initialize(), 0);\r\n }\r\n this._isAttached = true;\r\n }\r\n\r\n _initialize() {\r\n this._initializeGrid();\r\n if (this.key === this.ADD_PERSONAL_DASHBOARD_KEY) {\r\n this.addPersonalDashboard();\r\n } else {\r\n this.loadGrid();\r\n if (!this.editable) this.stopEdit();\r\n }\r\n }\r\n\r\n detached() {\r\n try {\r\n this._ea.publish(c.EventKeys.dashboard.builderDetached);\r\n if (this.editable) this.stopEdit();\r\n this._widgetViews.forEach(wv => {\r\n try {\r\n wv.detached();\r\n } catch (wvErr) {\r\n console.log(wvErr);\r\n }\r\n });\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n keyChanged(newValue, oldValue) {\r\n if (!this._isAttached) return;\r\n this.loading = true;\r\n if (this.editable) this.stopEdit();\r\n if (this.key === this.ADD_PERSONAL_DASHBOARD_KEY) {\r\n this.addPersonalDashboard();\r\n } else {\r\n if (this.editingPersonalDashboard) {\r\n this.closePersonalDashboardEditor(true);\r\n }\r\n this.loadGrid();\r\n }\r\n }\r\n\r\n @computedFrom('editable', 'editingPersonalDashboard', 'dashboardName')\r\n get canAddWidgets() {\r\n if (!this.editable) return false;\r\n if (!this.editingPersonalDashboard) return true;\r\n if (this.dashboardName) return true;\r\n return false;\r\n }\r\n\r\n async toggleDefault() {\r\n try {\r\n await this._dashboards.toggleMemberDefault(this.key);\r\n this.dashboard.isDefault = !this.dashboard.isDefault;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n dashboardNameChanged(newValue, oldValue) {\r\n if (!this.dashboard || !this.dashboardName) return;\r\n this.dashboard.name = this.dashboardName;\r\n this.dashboard.key = `pd-${c.Helpers.keyify(this.dashboardName)}`;\r\n if (!oldValue) return; // don't need to save the grid when going from nothing to something\r\n if (this.gridStackEl.childNodes.length) this._saveGrid();\r\n }\r\n\r\n addPersonalDashboard() {\r\n this.editingPersonalDashboard = true;\r\n this._ignoreClearGrid = true;\r\n this._grid.removeAll(true);\r\n this.closeToKey = this.ADD_PERSONAL_DASHBOARD_KEY;\r\n this.dashboard = { key: undefined, savedKey: undefined, canEdit: true, layout: [], savedName: undefined };\r\n this.startEdit();\r\n this.focusDashboardName = true;\r\n this.loading = false;\r\n }\r\n\r\n deletePersonalDashboard() {\r\n const model = { key: 'delete-dashboard', okButtonClass: 'btn-danger' };\r\n\t this._dialogService.open({ viewModel: ConfirmDialog, model, ignoreTransitions: true }).whenClosed(async(response) => {\r\n\t if (response.wasCancelled) return;\r\n try {\r\n await this._dashboards.delete(this.dashboard.key);\r\n this.dashboard = undefined;\r\n this.loading = true;\r\n this.loadGrid();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n });\r\n }\r\n\r\n editPersonalDashboard() {\r\n this.editable = true;\r\n this.editingPersonalDashboard = true;\r\n this.dashboardName = this.dashboard.name;\r\n this.startEdit();\r\n }\r\n\r\n closePersonalDashboardEditor(onlyClear = false) {\r\n this.editingPersonalDashboard = false;\r\n this.focusDashboardName = false;\r\n this.dashboardName = undefined;\r\n this.stopEdit();\r\n if (onlyClear) return;\r\n if (this.closeToKey === this.ADD_PERSONAL_DASHBOARD_KEY) {\r\n this._router.navigate('#/members', true);\r\n return;\r\n }\r\n if (this.closeToKey) {\r\n this.dashboard = undefined;\r\n this.key = this.closeToKey;\r\n this.closeToKey = undefined;\r\n this.loading = true;\r\n this.loadGrid();\r\n }\r\n }\r\n\r\n startEdit() {\r\n if (!this._grid) return;\r\n this.editable = true;\r\n this._grid.setStatic(false);\r\n this._grid.enableMove(true, true);\r\n this._grid.enableResize(true, true);\r\n }\r\n\r\n stopEdit() {\r\n if (!this._grid) return;\r\n this.editable = false;\r\n this._grid.setStatic(true);\r\n this._grid.enableMove(false, true);\r\n this._grid.enableResize(false, true);\r\n }\r\n\r\n async setDefault() {\r\n try {\r\n await this._dashboards.setDefault(this.dashboard.key);\r\n this._notifier.success('set-default-dashboard-success');\r\n this.dashboard.isDifferentThanPublishedDashboard = false;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n async reset() {\r\n try {\r\n await this._dashboards.reset(this.dashboard.key);\r\n this._notifier.success('reset-dashboard-success');\r\n this._clearGrid();\r\n this.loadGrid();\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n _clearGrid() {\r\n this._ignoreClearGrid = true;\r\n this._grid.removeAll(true);\r\n this.dashboard = undefined;\r\n }\r\n\r\n searchOnChanged() {\r\n this.widgets.forEach(widget => {\r\n let matchesSearch = true;\r\n if (this.searchOn) {\r\n // see if it matches\r\n const keyMatch = widget.keys\r\n .map(x => x.toLowerCase().indexOf(this.searchOn.toLowerCase()) >= 0)\r\n .filter(x => x === true);\r\n matchesSearch = keyMatch.length > 0;\r\n }\r\n if (!widget.canAccess) matchesSearch = false;\r\n widget.display = matchesSearch;\r\n });\r\n }\r\n\r\n _initializeGrid() {\r\n const config = {\r\n minRow: 1,\r\n alwaysShowResizeHandle: true,\r\n acceptWidgets: true,\r\n removeTimeout: 100,\r\n staticGrid: false,\r\n cellHeight: '100px',\r\n };\r\n this._grid = GridStack.init(config);\r\n GridStack.setupDragIn('.zeus-dashboard-new-widget', { revert: 'invalid', scroll: false, appendTo: 'body', helper: 'clone' });\r\n this._grid.on('added', (e, items) => {\r\n try {\r\n this.focusDashboardName = false;\r\n if (!this.gridStackEl) return;\r\n for (let node of this.gridStackEl.childNodes) {\r\n let widgetContent = node.querySelector('.grid-stack-item-content');\r\n let widgetIsNew = widgetContent.querySelector('.zeus-dashboard-widget-default-size');\r\n if (!widgetIsNew) {\r\n continue;\r\n }\r\n // this is default content, replace with the widget\r\n let id = c.Helpers.uniqueId();\r\n let widgetId = node.getAttribute('data-widget-id');\r\n let settings = undefined;\r\n let savedWidget = false;\r\n if (!widgetId) {\r\n // This is being added from the database, need to add attributes\r\n node.classList.add('zeus-dashboard-new-widget');\r\n const loadingWidgetContent = widgetContent.firstChild;\r\n widgetId = loadingWidgetContent.getAttribute('data-widget-id');\r\n id = loadingWidgetContent.getAttribute('data-id');\r\n settings = this._widgetSettings[id];\r\n node.setAttribute('data-widget-id', widgetId);\r\n savedWidget = true;\r\n }\r\n widgetContent.classList.add('zeus-dashboard-widget');\r\n widgetContent.classList.remove('zeus-dashboard-new-widget');\r\n const widget = this.widgets.find(x => x.id === widgetId);\r\n if (!savedWidget) {\r\n settings = widget.defaultSettings ? widget.defaultSettings : undefined;\r\n this._widgetSettings[id] = settings;\r\n }\r\n let settingsValue;\r\n if (settings) {\r\n settingsValue = JSON.stringify(settings);\r\n settingsValue = c.Helpers.replaceAll(settingsValue, '\"', '\\'');\r\n }\r\n let configValue;\r\n if (widget.config) {\r\n configValue = JSON.stringify(widget.config);\r\n configValue = c.Helpers.replaceAll(configValue, '\"', '\\'');\r\n }\r\n let widgetButtonsHTML = ``;\r\n if (this._security.isInRole([ROLE.Admin, ROLE.DashboardAdmin])) {\r\n widgetButtonsHTML += ``;\r\n }\r\n widgetContent.innerHTML = `<${widgetId} data-id=\"${id}\" is-for-agency.bind=\"${this.dashboard.isForAgency}\" can-edit.bind=\"${this.dashboard.canEdit}\" settings.delegate=\"widgetSettingsChanged('${id}', '${widgetId}', $event.detail)\" settings.bind=\"${settingsValue}\" config.bind=\"${configValue}\" is-published.bind=\"${this.dashboard.isPublishedDashboard}\">${widgetId}>${widgetButtonsHTML}`;\r\n const view = this._templatingEngine.enhance({ element: widgetContent, bindingContext: this });\r\n this._widgetViews.push(view);\r\n }\r\n if (this.loadingGrid) {\r\n // Do not save for the initial load\r\n this.loadingGrid = false;\r\n return;\r\n }\r\n this._saveGrid();\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this.loading = false;\r\n }\r\n });\r\n this._grid.on('removed', (e, items) => {\r\n if (this._ignoreClearGrid) {\r\n this._ignoreClearGrid = false;\r\n return;\r\n }\r\n this._saveGrid();\r\n });\r\n this._grid.on('change', (e, items) => {\r\n this._saveGrid();\r\n });\r\n }\r\n\r\n removeWidget(id) {\r\n let removeEl;\r\n for (let node of this.gridStackEl.childNodes) {\r\n const removeWidget = node.querySelector(`[data-id=\"${id}\"]`);\r\n if (removeWidget) {\r\n removeEl = node;\r\n break;\r\n }\r\n }\r\n if (!removeEl) return;\r\n this._grid.removeWidget(removeEl);\r\n this._widgetSettings[id] = undefined;\r\n }\r\n\r\n addWidgetToBigButtons(id, widgetId) {\r\n try {\r\n const widget = this.widgets.find(x => x.id === widgetId);\r\n const widgetSettings = this._widgetSettings[id];\r\n const title = widgetSettings.friendlyName ?? this._i18n.tr(widget.key ?? widget.id);\r\n this._menus.addToMobileMenu(id, 'Widget', widgetId, title, '', `#/members/_w/mobile/${id}`, widget.icon, widgetSettings);\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n widgetSettingsChanged(id, widgetId, detail) {\r\n this._widgetSettings[id] = detail.data;\r\n if (detail.save === true) this._saveGrid();\r\n }\r\n\r\n async _saveGrid() {\r\n if (!this.editable) return;\r\n if (this.editingPersonalDashboard && !this.dashboard.key) {\r\n this._notifier.error('personal-dashboard-requires-name');\r\n this.focusDashboardName = true;\r\n return;\r\n }\r\n try {\r\n const dashboardWidgets = this._grid.save(false);\r\n const cleanedDashboardWidgets = [];\r\n for (let node of this.gridStackEl.childNodes) {\r\n const widgetId = node.getAttribute('data-widget-id');\r\n const w = Number(node.getAttribute('gs-w'));\r\n const h = Number(node.getAttribute('gs-h'));\r\n const x = Number(node.getAttribute('gs-x'));\r\n const y = Number(node.getAttribute('gs-y'));\r\n const dashboardWidget = dashboardWidgets.find(dw => dw.x === x && dw.y === y && dw.w === w && dw.h === h);\r\n if (!dashboardWidget) continue;\r\n\r\n delete dashboardWidget.content;\r\n const widgetContent = node.querySelector('.grid-stack-item-content');\r\n const widget = widgetContent.firstChild;\r\n const id = widget.getAttribute('data-id');\r\n dashboardWidget.id = id;\r\n dashboardWidget.widgetId = widgetId;\r\n dashboardWidget.settings = this._widgetSettings[id];\r\n cleanedDashboardWidgets.push(dashboardWidget);\r\n }\r\n const saveName = this.editingPersonalDashboard ? this.dashboard.name : undefined;\r\n const saveOriginalKey = this.editingPersonalDashboard && this.dashboard && this.dashboard.savedKey ? this.dashboard.savedKey : undefined;\r\n const triggerMenuUpdate = this.editingPersonalDashboard && (!this.dashboard.savedKey || (this.dashboard.savedName !== this.dashboard.name));\r\n await this._dashboards.save(this.dashboard.key, cleanedDashboardWidgets, saveName, saveOriginalKey, triggerMenuUpdate);\r\n if (this.editingPersonalDashboard) {\r\n this.dashboard.savedKey = this.dashboard.key;\r\n this.dashboard.savedName = this.dashboard.name;\r\n }\r\n if (triggerMenuUpdate) this.closeToKey = undefined;\r\n if (this.dashboard.isPublishedDashboard) {\r\n // This is a Dashboard Admin saving a published dashboard\r\n this.dashboard.isDifferentThanPublishedDashboard = true;\r\n }\r\n } catch (err) {\r\n console.log(err);\r\n this._notifier.error('An error occurred saving the dashboard');\r\n }\r\n }\r\n\r\n async loadGrid() {\r\n const dashboard = await this._dashboards.byKey(this.key);\r\n if (this.dashboard && this.dashboard.key === dashboard.key) {\r\n this.loading = false;\r\n return;\r\n }\r\n this.dashboard = dashboard;\r\n if (!this.dashboard) {\r\n this.loading = false;\r\n return;\r\n }\r\n const cleanedDashboard = [];\r\n this.dashboard.layout.forEach(dw => {\r\n const widget = this.widgets.find(x => x.id === dw.widgetId);\r\n if (!widget) return;\r\n cleanedDashboard.push(dw);\r\n if (dw.settings) {\r\n this._widgetSettings[dw.id] = dw.settings;\r\n }\r\n // Need to add the content so the widget added will be added correctly\r\n dw.content = `${instructionsKey|t}
\\r\\n \\r\\n${'dashboard-admin-different-than-site-dashboard'&t}
\\r\\n \\r\\n