{"version":3,"file":"vendors-319a6989.9729664bca28a8e6916d.bundle.js","mappings":";;;;;;;;;;;;;;;;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;AAoBA;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;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzIA;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;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;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;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;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;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;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;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;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;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;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;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;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;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;;;;;;;;;;;;;;;;;;;;;;;;;;AC7oBA;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;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;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;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AC9PA;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;AC7GA;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;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;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvIA;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;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;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;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;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;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;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;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;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;;;;;;;;;;;;;;;;;;;;ACzaA;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;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;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;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;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;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;AACA;AACA;AACA;;;;;;;;;;;;;;;ACnSA;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;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpDA;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;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;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;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;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;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;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;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;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;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;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;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;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;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;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;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://www.zeusteam.com/./node_modules/aurelia-bootstrapper/dist/native-modules/aurelia-bootstrapper.js","webpack://www.zeusteam.com/./node_modules/aurelia-dependency-injection/dist/native-modules/aurelia-dependency-injection.js","webpack://www.zeusteam.com/./node_modules/aurelia-dialog/dist/native-modules/aurelia-dialog.js","webpack://www.zeusteam.com/./node_modules/aurelia-dialog/dist/native-modules/chunk.js","webpack://www.zeusteam.com/./node_modules/aurelia-event-aggregator/dist/native-modules/aurelia-event-aggregator.js","webpack://www.zeusteam.com/./node_modules/aurelia-framework/dist/native-modules/aurelia-framework.js","webpack://www.zeusteam.com/./node_modules/aurelia-history-browser/dist/native-modules/aurelia-history-browser.js","webpack://www.zeusteam.com/./node_modules/aurelia-history/dist/native-modules/aurelia-history.js","webpack://www.zeusteam.com/./node_modules/aurelia-http-client/dist/native-modules/aurelia-http-client.js"],"sourcesContent":["import 'aurelia-polyfills';\nimport { PLATFORM, isInitialized } from 'aurelia-pal';\n\nvar bootstrapPromises = [];\r\nvar startResolve;\r\nvar startPromise = new Promise(function (resolve) { return startResolve = resolve; });\r\nvar host = PLATFORM.global;\r\nvar isNodeLike = typeof process !== 'undefined' && !process.browser;\r\nfunction ready() {\r\n if (!host.document || host.document.readyState === 'complete') {\r\n return Promise.resolve();\r\n }\r\n return new Promise(function (resolve) {\r\n host.document.addEventListener('DOMContentLoaded', completed);\r\n host.addEventListener('load', completed);\r\n function completed() {\r\n host.document.removeEventListener('DOMContentLoaded', completed);\r\n host.removeEventListener('load', completed);\r\n resolve();\r\n }\r\n });\r\n}\r\nfunction createLoader() {\r\n if (PLATFORM.Loader) {\r\n return Promise.resolve(new PLATFORM.Loader());\r\n }\r\n if (typeof AURELIA_WEBPACK_2_0 === 'undefined') {\r\n if (typeof __webpack_require__ !== 'undefined') {\r\n var m = __webpack_require__(require.resolve('aurelia-loader-webpack'));\r\n return Promise.resolve(new m.WebpackLoader());\r\n }\r\n if (host.System && typeof host.System.config === 'function') {\r\n return host.System.normalize('aurelia-bootstrapper').then(function (bsn) {\r\n return host.System.normalize('aurelia-loader-default', bsn);\r\n }).then(function (loaderName) {\r\n return host.System.import(loaderName).then(function (m) { return new m.DefaultLoader(); });\r\n });\r\n }\r\n if (typeof host.require === 'function' && typeof host.define === 'function' && typeof host.define.amd === 'object') {\r\n return new Promise(function (resolve, reject) { return host.require(['aurelia-loader-default'], function (m) { return resolve(new m.DefaultLoader()); }, reject); });\r\n }\r\n if (isNodeLike && typeof module !== 'undefined' && typeof module.require !== 'undefined') {\r\n var m = module.require('aurelia-loader-nodejs');\r\n return Promise.resolve(new m.NodeJsLoader());\r\n }\r\n }\r\n return Promise.reject('No PLATFORM.Loader is defined and there is neither a System API (ES6) or a Require API (AMD) globally available to load your app.');\r\n}\r\nfunction initializePal(loader) {\r\n if (isInitialized)\r\n return Promise.resolve();\r\n var type;\r\n var isRenderer = isNodeLike && (process.type === 'renderer' || process.versions['node-webkit']);\r\n if (isNodeLike && !isRenderer) {\r\n type = 'nodejs';\r\n }\r\n else if (typeof window !== 'undefined') {\r\n type = 'browser';\r\n }\r\n else if (typeof self !== 'undefined') {\r\n type = 'worker';\r\n }\r\n else {\r\n throw new Error('Could not determine platform implementation to load.');\r\n }\r\n return loader.loadModule('aurelia-pal-' + type)\r\n .then(function (palModule) { return type === 'nodejs' && !isInitialized && palModule.globalize() || palModule.initialize(); });\r\n}\r\nfunction preparePlatform(loader) {\r\n var map = function (moduleId, relativeTo) {\r\n return loader.normalize(moduleId, relativeTo)\r\n .then(function (normalized) {\r\n loader.map(moduleId, normalized);\r\n return normalized;\r\n });\r\n };\r\n return initializePal(loader)\r\n .then(function () { return loader.normalize('aurelia-bootstrapper'); })\r\n .then(function (bootstrapperName) {\r\n var frameworkPromise = map(PLATFORM.moduleName('aurelia-framework', { exports: ['Aurelia'] }), bootstrapperName);\r\n return Promise.all([\r\n frameworkPromise,\r\n frameworkPromise.then(function (frameworkName) { return map('aurelia-dependency-injection', frameworkName); }),\r\n map('aurelia-router', bootstrapperName),\r\n map('aurelia-logging-console', bootstrapperName)\r\n ]);\r\n })\r\n .then(function (_a) {\r\n var frameworkName = _a[0];\r\n return loader.loadModule(frameworkName);\r\n })\r\n .then(function (fx) { return startResolve(function () { return new fx.Aurelia(loader); }); });\r\n}\r\nfunction config(appHost, configModuleId, aurelia) {\r\n aurelia.host = appHost;\r\n aurelia.configModuleId = configModuleId || null;\r\n if (configModuleId) {\r\n return aurelia.loader\r\n .loadModule(configModuleId)\r\n .then(function (customConfig) {\r\n if (!customConfig.configure) {\r\n throw new Error(\"Cannot initialize module '\".concat(configModuleId, \"' without a configure function.\"));\r\n }\r\n return customConfig.configure(aurelia);\r\n });\r\n }\r\n aurelia.use\r\n .standardConfiguration()\r\n .developmentLogging();\r\n return aurelia.start().then(function () { return aurelia.setRoot(); });\r\n}\r\nfunction run() {\r\n return ready()\r\n .then(createLoader)\r\n .then(preparePlatform)\r\n .then(function () {\r\n var appHosts = host.document.querySelectorAll('[aurelia-app],[data-aurelia-app]');\r\n for (var i = 0, ii = appHosts.length; i < ii; ++i) {\r\n var appHost = appHosts[i];\r\n var mainModuleId = appHost.getAttribute('aurelia-app') || appHost.getAttribute('data-aurelia-app');\r\n bootstrap(config.bind(null, appHost, mainModuleId));\r\n }\r\n var toConsole = console.error.bind(console);\r\n var bootstraps = bootstrapPromises.map(function (p) { return p.catch(toConsole); });\r\n bootstrapPromises = null;\r\n return Promise.all(bootstraps);\r\n });\r\n}\r\nfunction bootstrap(configure) {\r\n var p = startPromise.then(function (factory) { return configure(factory()); });\r\n if (bootstrapPromises)\r\n bootstrapPromises.push(p);\r\n return p;\r\n}\r\nvar starting = run();\n\nexport { bootstrap, starting };\n//# sourceMappingURL=aurelia-bootstrapper.js.map\n","import { metadata, protocol } from 'aurelia-metadata';\nimport { AggregateError } from 'aurelia-pal';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\n\nfunction isInjectable(potentialTarget) {\r\n return !!potentialTarget;\r\n}\r\nfunction autoinject(potentialTarget) {\r\n var deco = function (target) {\r\n if (!target.hasOwnProperty('inject')) {\r\n target.inject = (metadata.getOwn(metadata.paramTypes, target) ||\r\n _emptyParameters).slice();\r\n if (target.inject && target.inject.length > 0) {\r\n if (target.inject[target.inject.length - 1] === Object) {\r\n target.inject.splice(-1, 1);\r\n }\r\n }\r\n }\r\n };\r\n if (isInjectable(potentialTarget)) {\r\n return deco(potentialTarget);\r\n }\r\n return deco;\r\n}\r\nfunction inject() {\r\n var rest = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n rest[_i] = arguments[_i];\r\n }\r\n return function (target, _key, descriptor) {\r\n if (typeof descriptor === 'number') {\r\n autoinject(target);\r\n if (rest.length === 1) {\r\n target.inject[descriptor] = rest[0];\r\n }\r\n return;\r\n }\r\n if (descriptor) {\r\n var fn = descriptor.value;\r\n fn.inject = rest;\r\n }\r\n else {\r\n target.inject = rest;\r\n }\r\n };\r\n}\n\nvar resolver = protocol.create('aurelia:resolver', function (target) {\r\n if (!(typeof target.get === 'function')) {\r\n return 'Resolvers must implement: get(container: Container, key: any): any';\r\n }\r\n return true;\r\n});\r\nvar Strategy;\r\n(function (Strategy) {\r\n Strategy[Strategy[\"instance\"] = 0] = \"instance\";\r\n Strategy[Strategy[\"singleton\"] = 1] = \"singleton\";\r\n Strategy[Strategy[\"transient\"] = 2] = \"transient\";\r\n Strategy[Strategy[\"function\"] = 3] = \"function\";\r\n Strategy[Strategy[\"array\"] = 4] = \"array\";\r\n Strategy[Strategy[\"alias\"] = 5] = \"alias\";\r\n})(Strategy || (Strategy = {}));\r\nfunction isStrategy(actual, expected, state) {\r\n return actual === expected;\r\n}\r\nvar StrategyResolver = (function () {\r\n function StrategyResolver(strategy, state) {\r\n this.strategy = strategy;\r\n this.state = state;\r\n }\r\n StrategyResolver.prototype.get = function (container, key) {\r\n if (isStrategy(this.strategy, Strategy.instance, this.state)) {\r\n return this.state;\r\n }\r\n if (isStrategy(this.strategy, Strategy.singleton, this.state)) {\r\n var singleton = container.invoke(this.state);\r\n this.state = singleton;\r\n this.strategy = 0;\r\n return singleton;\r\n }\r\n if (isStrategy(this.strategy, Strategy.transient, this.state)) {\r\n return container.invoke(this.state);\r\n }\r\n if (isStrategy(this.strategy, Strategy.function, this.state)) {\r\n return this.state(container, key, this);\r\n }\r\n if (isStrategy(this.strategy, Strategy.array, this.state)) {\r\n return this.state[0].get(container, key);\r\n }\r\n if (isStrategy(this.strategy, Strategy.alias, this.state)) {\r\n return container.get(this.state);\r\n }\r\n throw new Error('Invalid strategy: ' + this.strategy);\r\n };\r\n StrategyResolver = __decorate([\r\n resolver(),\r\n __metadata(\"design:paramtypes\", [Number, Object])\r\n ], StrategyResolver);\r\n return StrategyResolver;\r\n}());\r\nvar Lazy = (function () {\r\n function Lazy(key) {\r\n this._key = key;\r\n }\r\n Lazy_1 = Lazy;\r\n Lazy.prototype.get = function (container) {\r\n var _this = this;\r\n return function () { return container.get(_this._key); };\r\n };\r\n Lazy.of = function (key) {\r\n return new Lazy_1(key);\r\n };\r\n var Lazy_1;\r\n Lazy = Lazy_1 = __decorate([\r\n resolver(),\r\n __metadata(\"design:paramtypes\", [Object])\r\n ], Lazy);\r\n return Lazy;\r\n}());\r\nvar All = (function () {\r\n function All(key) {\r\n this._key = key;\r\n }\r\n All_1 = All;\r\n All.prototype.get = function (container) {\r\n return container.getAll(this._key);\r\n };\r\n All.of = function (key) {\r\n return new All_1(key);\r\n };\r\n var All_1;\r\n All = All_1 = __decorate([\r\n resolver(),\r\n __metadata(\"design:paramtypes\", [Object])\r\n ], All);\r\n return All;\r\n}());\r\nvar Optional = (function () {\r\n function Optional(key, checkParent) {\r\n if (checkParent === void 0) { checkParent = true; }\r\n this._key = key;\r\n this._checkParent = checkParent;\r\n }\r\n Optional_1 = Optional;\r\n Optional.prototype.get = function (container) {\r\n if (container.hasResolver(this._key, this._checkParent)) {\r\n return container.get(this._key);\r\n }\r\n return null;\r\n };\r\n Optional.of = function (key, checkParent) {\r\n if (checkParent === void 0) { checkParent = true; }\r\n return new Optional_1(key, checkParent);\r\n };\r\n var Optional_1;\r\n Optional = Optional_1 = __decorate([\r\n resolver(),\r\n __metadata(\"design:paramtypes\", [Object, Boolean])\r\n ], Optional);\r\n return Optional;\r\n}());\r\nvar Parent = (function () {\r\n function Parent(key) {\r\n this._key = key;\r\n }\r\n Parent_1 = Parent;\r\n Parent.prototype.get = function (container) {\r\n return container.parent ? container.parent.get(this._key) : null;\r\n };\r\n Parent.of = function (key) {\r\n return new Parent_1(key);\r\n };\r\n var Parent_1;\r\n Parent = Parent_1 = __decorate([\r\n resolver(),\r\n __metadata(\"design:paramtypes\", [Object])\r\n ], Parent);\r\n return Parent;\r\n}());\r\nvar Factory = (function () {\r\n function Factory(key) {\r\n this._key = key;\r\n }\r\n Factory_1 = Factory;\r\n Factory.prototype.get = function (container) {\r\n var fn = this._key;\r\n var resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === Strategy.function) {\r\n fn = resolver.state;\r\n }\r\n return function () {\r\n var rest = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n rest[_i] = arguments[_i];\r\n }\r\n return container.invoke(fn, rest);\r\n };\r\n };\r\n Factory.of = function (key) {\r\n return new Factory_1(key);\r\n };\r\n var Factory_1;\r\n Factory = Factory_1 = __decorate([\r\n resolver(),\r\n __metadata(\"design:paramtypes\", [Object])\r\n ], Factory);\r\n return Factory;\r\n}());\r\nvar NewInstance = (function () {\r\n function NewInstance(key) {\r\n var dynamicDependencies = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n dynamicDependencies[_i - 1] = arguments[_i];\r\n }\r\n this.key = key;\r\n this.asKey = key;\r\n this.dynamicDependencies = dynamicDependencies;\r\n }\r\n NewInstance_1 = NewInstance;\r\n NewInstance.prototype.get = function (container) {\r\n var dynamicDependencies = this.dynamicDependencies.length > 0\r\n ? this.dynamicDependencies.map(function (dependency) {\r\n return dependency['protocol:aurelia:resolver']\r\n ? dependency.get(container)\r\n : container.get(dependency);\r\n })\r\n : undefined;\r\n var fn = this.key;\r\n var resolver = container.getResolver(fn);\r\n if (resolver && resolver.strategy === 3) {\r\n fn = resolver.state;\r\n }\r\n var instance = container.invoke(fn, dynamicDependencies);\r\n container.registerInstance(this.asKey, instance);\r\n return instance;\r\n };\r\n NewInstance.prototype.as = function (key) {\r\n this.asKey = key;\r\n return this;\r\n };\r\n NewInstance.of = function (key) {\r\n var dynamicDependencies = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n dynamicDependencies[_i - 1] = arguments[_i];\r\n }\r\n return new (NewInstance_1.bind.apply(NewInstance_1, [void 0, key].concat(dynamicDependencies)))();\r\n };\r\n var NewInstance_1;\r\n NewInstance = NewInstance_1 = __decorate([\r\n resolver(),\r\n __metadata(\"design:paramtypes\", [Object, Object])\r\n ], NewInstance);\r\n return NewInstance;\r\n}());\r\nfunction getDecoratorDependencies(target) {\r\n autoinject(target);\r\n return target.inject;\r\n}\r\nfunction lazy(keyValue) {\r\n return function (target, _key, index) {\r\n var inject$$1 = getDecoratorDependencies(target);\r\n inject$$1[index] = Lazy.of(keyValue);\r\n };\r\n}\r\nfunction all(keyValue) {\r\n return function (target, _key, index) {\r\n var inject$$1 = getDecoratorDependencies(target);\r\n inject$$1[index] = All.of(keyValue);\r\n };\r\n}\r\nfunction optional(checkParentOrTarget) {\r\n if (checkParentOrTarget === void 0) { checkParentOrTarget = true; }\r\n var deco = function (checkParent) {\r\n return function (target, _key, index) {\r\n var inject$$1 = getDecoratorDependencies(target);\r\n inject$$1[index] = Optional.of(inject$$1[index], checkParent);\r\n };\r\n };\r\n if (typeof checkParentOrTarget === 'boolean') {\r\n return deco(checkParentOrTarget);\r\n }\r\n return deco(true);\r\n}\r\nfunction parent(target, _key, index) {\r\n var inject$$1 = getDecoratorDependencies(target);\r\n inject$$1[index] = Parent.of(inject$$1[index]);\r\n}\r\nfunction factory(keyValue) {\r\n return function (target, _key, index) {\r\n var inject$$1 = getDecoratorDependencies(target);\r\n inject$$1[index] = Factory.of(keyValue);\r\n };\r\n}\r\nfunction newInstance(asKeyOrTarget) {\r\n var dynamicDependencies = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n dynamicDependencies[_i - 1] = arguments[_i];\r\n }\r\n var deco = function (asKey) {\r\n return function (target, _key, index) {\r\n var inject$$1 = getDecoratorDependencies(target);\r\n inject$$1[index] = NewInstance.of.apply(NewInstance, [inject$$1[index]].concat(dynamicDependencies));\r\n if (!!asKey) {\r\n inject$$1[index].as(asKey);\r\n }\r\n };\r\n };\r\n if (arguments.length >= 1) {\r\n return deco(asKeyOrTarget);\r\n }\r\n return deco();\r\n}\n\nfunction validateKey(key) {\r\n if (key === null || key === undefined) {\r\n throw new Error('key/value cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?');\r\n }\r\n}\r\nvar _emptyParameters = Object.freeze([]);\r\nmetadata.registration = 'aurelia:registration';\r\nmetadata.invoker = 'aurelia:invoker';\r\nvar resolverDecorates = resolver.decorates;\r\nvar InvocationHandler = (function () {\r\n function InvocationHandler(fn, invoker, dependencies) {\r\n this.fn = fn;\r\n this.invoker = invoker;\r\n this.dependencies = dependencies;\r\n }\r\n InvocationHandler.prototype.invoke = function (container, dynamicDependencies) {\r\n return dynamicDependencies !== undefined\r\n ? this.invoker.invokeWithDynamicDependencies(container, this.fn, this.dependencies, dynamicDependencies)\r\n : this.invoker.invoke(container, this.fn, this.dependencies);\r\n };\r\n return InvocationHandler;\r\n}());\r\nfunction invokeWithDynamicDependencies(container, fn, staticDependencies, dynamicDependencies) {\r\n var i = staticDependencies.length;\r\n var args = new Array(i);\r\n var lookup;\r\n while (i--) {\r\n lookup = staticDependencies[i];\r\n if (lookup === null || lookup === undefined) {\r\n throw new Error('Constructor Parameter with index ' +\r\n i +\r\n ' cannot be null or undefined. Are you trying to inject/register something that doesn\\'t exist with DI?');\r\n }\r\n else {\r\n args[i] = container.get(lookup);\r\n }\r\n }\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n return Reflect.construct(fn, args);\r\n}\r\nvar classInvoker = {\r\n invoke: function (container, Type, deps) {\r\n var instances = deps.map(function (dep) { return container.get(dep); });\r\n return Reflect.construct(Type, instances);\r\n },\r\n invokeWithDynamicDependencies: invokeWithDynamicDependencies\r\n};\r\nfunction getDependencies(f) {\r\n if (!f.hasOwnProperty('inject')) {\r\n return [];\r\n }\r\n if (typeof f.inject === 'function') {\r\n return f.inject();\r\n }\r\n return f.inject;\r\n}\r\nvar Container = (function () {\r\n function Container(configuration) {\r\n if (configuration === undefined) {\r\n configuration = {};\r\n }\r\n this._configuration = configuration;\r\n this._onHandlerCreated = configuration.onHandlerCreated;\r\n this._handlers =\r\n configuration.handlers || (configuration.handlers = new Map());\r\n this._resolvers = new Map();\r\n this.root = this;\r\n this.parent = null;\r\n }\r\n Container.prototype.makeGlobal = function () {\r\n Container.instance = this;\r\n return this;\r\n };\r\n Container.prototype.setHandlerCreatedCallback = function (onHandlerCreated) {\r\n this._onHandlerCreated = onHandlerCreated;\r\n this._configuration.onHandlerCreated = onHandlerCreated;\r\n };\r\n Container.prototype.registerInstance = function (key, instance) {\r\n return this.registerResolver(key, new StrategyResolver(0, instance === undefined ? key : instance));\r\n };\r\n Container.prototype.registerSingleton = function (key, fn) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn === undefined ? key : fn));\r\n };\r\n Container.prototype.registerTransient = function (key, fn) {\r\n return this.registerResolver(key, new StrategyResolver(2, fn === undefined ? key : fn));\r\n };\r\n Container.prototype.registerHandler = function (key, handler) {\r\n return this.registerResolver(key, new StrategyResolver(3, handler));\r\n };\r\n Container.prototype.registerAlias = function (originalKey, aliasKey) {\r\n return this.registerResolver(aliasKey, new StrategyResolver(5, originalKey));\r\n };\r\n Container.prototype.registerResolver = function (key, resolver$$1) {\r\n validateKey(key);\r\n var allResolvers = this._resolvers;\r\n var result = allResolvers.get(key);\r\n if (result === undefined) {\r\n allResolvers.set(key, resolver$$1);\r\n }\r\n else if (result.strategy === 4) {\r\n result.state.push(resolver$$1);\r\n }\r\n else {\r\n allResolvers.set(key, new StrategyResolver(4, [result, resolver$$1]));\r\n }\r\n return resolver$$1;\r\n };\r\n Container.prototype.autoRegister = function (key, fn) {\r\n fn = fn === undefined ? key : fn;\r\n if (typeof fn === 'function') {\r\n var registration = metadata.get(metadata.registration, fn);\r\n if (registration === undefined) {\r\n return this.registerResolver(key, new StrategyResolver(1, fn));\r\n }\r\n return registration.registerResolver(this, key, fn);\r\n }\r\n return this.registerResolver(key, new StrategyResolver(0, fn));\r\n };\r\n Container.prototype.autoRegisterAll = function (fns) {\r\n var i = fns.length;\r\n while (i--) {\r\n this.autoRegister(fns[i]);\r\n }\r\n };\r\n Container.prototype.unregister = function (key) {\r\n this._resolvers.delete(key);\r\n };\r\n Container.prototype.hasResolver = function (key, checkParent) {\r\n if (checkParent === void 0) { checkParent = false; }\r\n validateKey(key);\r\n return (this._resolvers.has(key) ||\r\n (checkParent &&\r\n this.parent !== null &&\r\n this.parent.hasResolver(key, checkParent)));\r\n };\r\n Container.prototype.getResolver = function (key) {\r\n return this._resolvers.get(key);\r\n };\r\n Container.prototype.get = function (key) {\r\n validateKey(key);\r\n if (key === Container) {\r\n return this;\r\n }\r\n if (resolverDecorates(key)) {\r\n return key.get(this, key);\r\n }\r\n var resolver$$1 = this._resolvers.get(key);\r\n if (resolver$$1 === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n var registration = metadata.get(metadata.registration, key);\r\n if (registration === undefined) {\r\n return this.parent._get(key);\r\n }\r\n return registration.registerResolver(this, key, key).get(this, key);\r\n }\r\n return resolver$$1.get(this, key);\r\n };\r\n Container.prototype._get = function (key) {\r\n var resolver$$1 = this._resolvers.get(key);\r\n if (resolver$$1 === undefined) {\r\n if (this.parent === null) {\r\n return this.autoRegister(key).get(this, key);\r\n }\r\n return this.parent._get(key);\r\n }\r\n return resolver$$1.get(this, key);\r\n };\r\n Container.prototype.getAll = function (key) {\r\n validateKey(key);\r\n var resolver$$1 = this._resolvers.get(key);\r\n if (resolver$$1 === undefined) {\r\n if (this.parent === null) {\r\n return _emptyParameters;\r\n }\r\n return this.parent.getAll(key);\r\n }\r\n if (resolver$$1.strategy === 4) {\r\n var state = resolver$$1.state;\r\n var i = state.length;\r\n var results = new Array(i);\r\n while (i--) {\r\n results[i] = state[i].get(this, key);\r\n }\r\n return results;\r\n }\r\n return [resolver$$1.get(this, key)];\r\n };\r\n Container.prototype.createChild = function () {\r\n var child = new Container(this._configuration);\r\n child.root = this.root;\r\n child.parent = this;\r\n return child;\r\n };\r\n Container.prototype.invoke = function (fn, dynamicDependencies) {\r\n try {\r\n var handler = this._handlers.get(fn);\r\n if (handler === undefined) {\r\n handler = this._createInvocationHandler(fn);\r\n this._handlers.set(fn, handler);\r\n }\r\n return handler.invoke(this, dynamicDependencies);\r\n }\r\n catch (e) {\r\n throw new AggregateError(\"Error invoking \" + fn.name + \". Check the inner error for details.\", e, true);\r\n }\r\n };\r\n Container.prototype._createInvocationHandler = function (fn) {\r\n var dependencies;\r\n if (fn.inject === undefined) {\r\n dependencies =\r\n metadata.getOwn(metadata.paramTypes, fn) || _emptyParameters;\r\n }\r\n else {\r\n dependencies = [];\r\n var ctor = fn;\r\n while (typeof ctor === 'function') {\r\n dependencies.push.apply(dependencies, getDependencies(ctor));\r\n ctor = Object.getPrototypeOf(ctor);\r\n }\r\n }\r\n var invoker = metadata.getOwn(metadata.invoker, fn) || classInvoker;\r\n var handler = new InvocationHandler(fn, invoker, dependencies);\r\n return this._onHandlerCreated !== undefined\r\n ? this._onHandlerCreated(handler)\r\n : handler;\r\n };\r\n return Container;\r\n}());\n\nfunction invoker(value) {\r\n return function (target) {\r\n metadata.define(metadata.invoker, value, target);\r\n };\r\n}\r\nfunction invokeAsFactory(potentialTarget) {\r\n var deco = function (target) {\r\n metadata.define(metadata.invoker, FactoryInvoker.instance, target);\r\n };\r\n return potentialTarget ? deco(potentialTarget) : deco;\r\n}\r\nvar FactoryInvoker = (function () {\r\n function FactoryInvoker() {\r\n }\r\n FactoryInvoker.prototype.invoke = function (container, fn, dependencies) {\r\n var i = dependencies.length;\r\n var args = new Array(i);\r\n while (i--) {\r\n args[i] = container.get(dependencies[i]);\r\n }\r\n return fn.apply(undefined, args);\r\n };\r\n FactoryInvoker.prototype.invokeWithDynamicDependencies = function (container, fn, staticDependencies, dynamicDependencies) {\r\n var i = staticDependencies.length;\r\n var args = new Array(i);\r\n while (i--) {\r\n args[i] = container.get(staticDependencies[i]);\r\n }\r\n if (dynamicDependencies !== undefined) {\r\n args = args.concat(dynamicDependencies);\r\n }\r\n return fn.apply(undefined, args);\r\n };\r\n return FactoryInvoker;\r\n}());\r\nFactoryInvoker.instance = new FactoryInvoker();\n\nfunction registration(value) {\r\n return function (target) {\r\n metadata.define(metadata.registration, value, target);\r\n };\r\n}\r\nfunction transient(key) {\r\n return registration(new TransientRegistration(key));\r\n}\r\nfunction singleton(keyOrRegisterInChild, registerInChild) {\r\n if (registerInChild === void 0) { registerInChild = false; }\r\n return registration(new SingletonRegistration(keyOrRegisterInChild, registerInChild));\r\n}\r\nvar TransientRegistration = (function () {\r\n function TransientRegistration(key) {\r\n this._key = key;\r\n }\r\n TransientRegistration.prototype.registerResolver = function (container, key, fn) {\r\n var existingResolver = container.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? container.registerTransient((this._key || key), fn)\r\n : existingResolver;\r\n };\r\n return TransientRegistration;\r\n}());\r\nvar SingletonRegistration = (function () {\r\n function SingletonRegistration(keyOrRegisterInChild, registerInChild) {\r\n if (registerInChild === void 0) { registerInChild = false; }\r\n if (typeof keyOrRegisterInChild === 'boolean') {\r\n this._registerInChild = keyOrRegisterInChild;\r\n }\r\n else {\r\n this._key = keyOrRegisterInChild;\r\n this._registerInChild = registerInChild;\r\n }\r\n }\r\n SingletonRegistration.prototype.registerResolver = function (container, key, fn) {\r\n var targetContainer = this._registerInChild ? container : container.root;\r\n var existingResolver = targetContainer.getResolver(this._key || key);\r\n return existingResolver === undefined\r\n ? targetContainer.registerSingleton(this._key || key, fn)\r\n : existingResolver;\r\n };\r\n return SingletonRegistration;\r\n}());\n\nexport { _emptyParameters, InvocationHandler, Container, autoinject, inject, invoker, invokeAsFactory, FactoryInvoker, registration, transient, singleton, TransientRegistration, SingletonRegistration, resolver, Strategy, StrategyResolver, Lazy, All, Optional, Parent, Factory, NewInstance, getDecoratorDependencies, lazy, all, optional, parent, factory, newInstance };\n","import { a as Renderer, b as createDialogCancelError, c as invokeLifecycle, d as DialogController } from './chunk.js';\nexport { d as DialogController, a as Renderer, b as createDialogCancelError, e as createDialogCloseError } from './chunk.js';\nimport { DOM } from 'aurelia-pal';\nimport { Container } from 'aurelia-dependency-injection';\nimport { ViewSlot, CompositionEngine } from 'aurelia-templating';\n\nvar DefaultDialogSettings = (function () {\r\n function DefaultDialogSettings() {\r\n this.lock = true;\r\n this.startingZIndex = 1000;\r\n this.centerHorizontalOnly = false;\r\n this.rejectOnCancel = false;\r\n this.ignoreTransitions = false;\r\n this.restoreFocus = function (lastActiveElement) { return lastActiveElement.focus(); };\r\n }\r\n return DefaultDialogSettings;\r\n}());\n\nvar RENDERRERS = {\r\n ux: function () { return import('./ux-dialog-renderer.js').then(function (m) { return m.DialogRenderer; }); },\r\n native: function () { return import('./native-dialog-renderer.js').then(function (m) { return m.NativeDialogRenderer; }); }\r\n};\r\nvar DEFAULT_RESOURCES = {\r\n 'ux-dialog': function () { return import('./ux-dialog.js').then(function (m) { return m.UxDialog; }); },\r\n 'ux-dialog-header': function () { return import('./ux-dialog-header.js').then(function (m) { return m.UxDialogHeader; }); },\r\n 'ux-dialog-body': function () { return import('./ux-dialog-body.js').then(function (m) { return m.UxDialogBody; }); },\r\n 'ux-dialog-footer': function () { return import('./ux-dialog-footer.js').then(function (m) { return m.UxDialogFooter; }); },\r\n 'attach-focus': function () { return import('./attach-focus.js').then(function (m) { return m.AttachFocus; }); }\r\n};\r\nvar DEFAULT_CSS_TEXT = function () { return import('./default-styles.js').then(function (cssM) { return cssM['default']; }); };\r\nvar DialogConfiguration = (function () {\r\n function DialogConfiguration(frameworkConfiguration, applySetter) {\r\n var _this = this;\r\n this.renderer = 'ux';\r\n this.cssText = DEFAULT_CSS_TEXT;\r\n this.resources = [];\r\n this.fwConfig = frameworkConfiguration;\r\n this.settings = frameworkConfiguration.container.get(DefaultDialogSettings);\r\n applySetter(function () { return _this._apply(); });\r\n }\r\n DialogConfiguration.prototype._apply = function () {\r\n var _this = this;\r\n var renderer = this.renderer;\r\n var cssText = this.cssText;\r\n return Promise\r\n .all([\r\n typeof renderer === 'string' ? RENDERRERS[renderer]() : renderer,\r\n cssText\r\n ? typeof cssText === 'string'\r\n ? cssText\r\n : cssText()\r\n : ''\r\n ])\r\n .then(function (_a) {\r\n var rendererImpl = _a[0], $cssText = _a[1];\r\n var fwConfig = _this.fwConfig;\r\n fwConfig.transient(Renderer, rendererImpl);\r\n if ($cssText) {\r\n DOM.injectStyles($cssText);\r\n }\r\n return Promise\r\n .all(_this.resources.map(function (name) { return DEFAULT_RESOURCES[name](); }))\r\n .then(function (modules) {\r\n fwConfig.globalResources(modules);\r\n });\r\n });\r\n };\r\n DialogConfiguration.prototype.useDefaults = function () {\r\n return this\r\n .useRenderer('ux')\r\n .useCSS(DEFAULT_CSS_TEXT)\r\n .useStandardResources();\r\n };\r\n DialogConfiguration.prototype.useStandardResources = function () {\r\n Object.keys(DEFAULT_RESOURCES).forEach(this.useResource, this);\r\n return this;\r\n };\r\n DialogConfiguration.prototype.useResource = function (resourceName) {\r\n this.resources.push(resourceName);\r\n return this;\r\n };\r\n DialogConfiguration.prototype.useRenderer = function (renderer, settings) {\r\n this.renderer = renderer;\r\n if (settings) {\r\n Object.assign(this.settings, settings);\r\n }\r\n return this;\r\n };\r\n DialogConfiguration.prototype.useCSS = function (cssText) {\r\n this.cssText = cssText;\r\n return this;\r\n };\r\n return DialogConfiguration;\r\n}());\n\nfunction whenClosed(onfulfilled, onrejected) {\r\n return this.then(function (r) { return r.wasCancelled ? r : r.closeResult; }).then(onfulfilled, onrejected);\r\n}\r\nfunction asDialogOpenPromise(promise) {\r\n promise.whenClosed = whenClosed;\r\n return promise;\r\n}\r\nvar DialogService = (function () {\r\n function DialogService(container, compositionEngine, defaultSettings) {\r\n this.controllers = [];\r\n this.hasOpenDialog = false;\r\n this.hasActiveDialog = false;\r\n this.container = container;\r\n this.compositionEngine = compositionEngine;\r\n this.defaultSettings = defaultSettings;\r\n }\r\n DialogService.prototype.validateSettings = function (settings) {\r\n if (!settings.viewModel && !settings.view) {\r\n throw new Error('Invalid Dialog Settings. You must provide \"viewModel\", \"view\" or both.');\r\n }\r\n };\r\n DialogService.prototype.createCompositionContext = function (childContainer, host, settings) {\r\n return {\r\n container: childContainer.parent,\r\n childContainer: childContainer,\r\n bindingContext: null,\r\n viewResources: null,\r\n model: settings.model,\r\n view: settings.view,\r\n viewModel: settings.viewModel,\r\n viewSlot: new ViewSlot(host, true),\r\n host: host\r\n };\r\n };\r\n DialogService.prototype.ensureViewModel = function (compositionContext) {\r\n if (typeof compositionContext.viewModel === 'object') {\r\n return Promise.resolve(compositionContext);\r\n }\r\n return this.compositionEngine.ensureViewModel(compositionContext);\r\n };\r\n DialogService.prototype._cancelOperation = function (rejectOnCancel) {\r\n if (!rejectOnCancel) {\r\n return { wasCancelled: true };\r\n }\r\n throw createDialogCancelError();\r\n };\r\n DialogService.prototype.composeAndShowDialog = function (compositionContext, dialogController) {\r\n var _this = this;\r\n if (!compositionContext.viewModel) {\r\n compositionContext.bindingContext = { controller: dialogController };\r\n }\r\n return this.compositionEngine\r\n .compose(compositionContext)\r\n .then(function (controller) {\r\n dialogController.controller = controller;\r\n return dialogController.renderer\r\n .showDialog(dialogController)\r\n .then(function () {\r\n _this.controllers.push(dialogController);\r\n _this.hasActiveDialog = _this.hasOpenDialog = !!_this.controllers.length;\r\n }, function (reason) {\r\n if (controller.viewModel) {\r\n invokeLifecycle(controller.viewModel, 'deactivate');\r\n }\r\n return Promise.reject(reason);\r\n });\r\n });\r\n };\r\n DialogService.prototype.createSettings = function (settings) {\r\n settings = Object.assign({}, this.defaultSettings, settings);\r\n if (typeof settings.keyboard !== 'boolean' && !settings.keyboard) {\r\n settings.keyboard = !settings.lock;\r\n }\r\n if (typeof settings.overlayDismiss !== 'boolean') {\r\n settings.overlayDismiss = !settings.lock;\r\n }\r\n Object.defineProperty(settings, 'rejectOnCancel', {\r\n writable: false,\r\n configurable: true,\r\n enumerable: true\r\n });\r\n this.validateSettings(settings);\r\n return settings;\r\n };\r\n DialogService.prototype.open = function (settings) {\r\n var _this = this;\r\n if (settings === void 0) { settings = {}; }\r\n settings = this.createSettings(settings);\r\n var childContainer = settings.childContainer || this.container.createChild();\r\n var resolveCloseResult;\r\n var rejectCloseResult;\r\n var closeResult = new Promise(function (resolve, reject) {\r\n resolveCloseResult = resolve;\r\n rejectCloseResult = reject;\r\n });\r\n var dialogController = childContainer.invoke(DialogController, [settings, resolveCloseResult, rejectCloseResult]);\r\n childContainer.registerInstance(DialogController, dialogController);\r\n closeResult.then(function () {\r\n removeController(_this, dialogController);\r\n }, function () {\r\n removeController(_this, dialogController);\r\n });\r\n var compositionContext = this.createCompositionContext(childContainer, dialogController.renderer.getDialogContainer(), dialogController.settings);\r\n var openResult = this.ensureViewModel(compositionContext).then(function (compositionContext) {\r\n if (!compositionContext.viewModel) {\r\n return true;\r\n }\r\n return invokeLifecycle(compositionContext.viewModel, 'canActivate', dialogController.settings.model);\r\n }).then(function (canActivate) {\r\n if (!canActivate) {\r\n return _this._cancelOperation(dialogController.settings.rejectOnCancel);\r\n }\r\n return _this.composeAndShowDialog(compositionContext, dialogController)\r\n .then(function () { return ({ controller: dialogController, closeResult: closeResult, wasCancelled: false }); });\r\n });\r\n return asDialogOpenPromise(openResult);\r\n };\r\n DialogService.prototype.closeAll = function () {\r\n return Promise.all(this.controllers.slice(0).map(function (controller) {\r\n if (!controller.settings.rejectOnCancel) {\r\n return controller.cancel().then(function (result) {\r\n if (result.wasCancelled) {\r\n return controller;\r\n }\r\n return null;\r\n });\r\n }\r\n return controller.cancel().then(function () { return null; }).catch(function (reason) {\r\n if (reason.wasCancelled) {\r\n return controller;\r\n }\r\n throw reason;\r\n });\r\n })).then(function (unclosedControllers) { return unclosedControllers.filter(function (unclosed) { return !!unclosed; }); });\r\n };\r\n DialogService.inject = [Container, CompositionEngine, DefaultDialogSettings];\r\n return DialogService;\r\n}());\r\nfunction removeController(service, dialogController) {\r\n var i = service.controllers.indexOf(dialogController);\r\n if (i !== -1) {\r\n service.controllers.splice(i, 1);\r\n service.hasActiveDialog = service.hasOpenDialog = !!service.controllers.length;\r\n }\r\n}\n\nfunction configure(frameworkConfig, callback) {\r\n var applyConfig = null;\r\n var config = new DialogConfiguration(frameworkConfig, function (apply) { applyConfig = apply; });\r\n if (typeof callback === 'function') {\r\n callback(config);\r\n }\r\n else {\r\n config.useDefaults();\r\n }\r\n return applyConfig();\r\n}\n\nexport { DefaultDialogSettings, DialogConfiguration, DialogService, configure };\n//# sourceMappingURL=aurelia-dialog.js.map\n","var Renderer = (function () {\r\n function Renderer() {\r\n }\r\n Renderer.prototype.getDialogContainer = function () {\r\n throw new Error('DialogRenderer must implement getDialogContainer().');\r\n };\r\n Renderer.prototype.showDialog = function (dialogController) {\r\n throw new Error('DialogRenderer must implement showDialog().');\r\n };\r\n Renderer.prototype.hideDialog = function (dialogController) {\r\n throw new Error('DialogRenderer must implement hideDialog().');\r\n };\r\n return Renderer;\r\n}());\n\nfunction createDialogCancelError(output) {\r\n var error = new Error('Operation cancelled.');\r\n error.wasCancelled = true;\r\n error.output = output;\r\n return error;\r\n}\n\nfunction createDialogCloseError(output) {\r\n var error = new Error();\r\n error.wasCancelled = false;\r\n error.output = output;\r\n return error;\r\n}\n\nfunction invokeLifecycle(instance, name, model) {\r\n if (typeof instance[name] === 'function') {\r\n return new Promise(function (resolve) {\r\n resolve(instance[name](model));\r\n }).then(function (result) {\r\n if (result !== null && result !== undefined) {\r\n return result;\r\n }\r\n return true;\r\n });\r\n }\r\n return Promise.resolve(true);\r\n}\n\nvar DialogController = (function () {\r\n function DialogController(renderer, settings, resolve, reject) {\r\n this.resolve = resolve;\r\n this.reject = reject;\r\n this.settings = settings;\r\n this.renderer = renderer;\r\n }\r\n DialogController.prototype.releaseResources = function (result) {\r\n var _this = this;\r\n return invokeLifecycle(this.controller.viewModel || {}, 'deactivate', result)\r\n .then(function () { return _this.renderer.hideDialog(_this); })\r\n .then(function () {\r\n _this.controller.unbind();\r\n });\r\n };\r\n DialogController.prototype.cancelOperation = function () {\r\n if (!this.settings.rejectOnCancel) {\r\n return { wasCancelled: true };\r\n }\r\n throw createDialogCancelError();\r\n };\r\n DialogController.prototype.ok = function (output) {\r\n return this.close(true, output);\r\n };\r\n DialogController.prototype.cancel = function (output) {\r\n return this.close(false, output);\r\n };\r\n DialogController.prototype.error = function (output) {\r\n var _this = this;\r\n var closeError = createDialogCloseError(output);\r\n return this.releaseResources(closeError).then(function () { _this.reject(closeError); });\r\n };\r\n DialogController.prototype.close = function (ok, output) {\r\n var _this = this;\r\n if (this.closePromise) {\r\n return this.closePromise;\r\n }\r\n var dialogResult = { wasCancelled: !ok, output: output };\r\n return this.closePromise = invokeLifecycle(this.controller.viewModel || {}, 'canDeactivate', dialogResult)\r\n .catch(function (reason) {\r\n _this.closePromise = undefined;\r\n return Promise.reject(reason);\r\n }).then(function (canDeactivate) {\r\n if (!canDeactivate) {\r\n _this.closePromise = undefined;\r\n return _this.cancelOperation();\r\n }\r\n return _this.releaseResources(dialogResult).then(function () {\r\n if (!_this.settings.rejectOnCancel || ok) {\r\n _this.resolve(dialogResult);\r\n }\r\n else {\r\n _this.reject(createDialogCancelError(output));\r\n }\r\n return { wasCancelled: false };\r\n }).catch(function (reason) {\r\n _this.closePromise = undefined;\r\n return Promise.reject(reason);\r\n });\r\n });\r\n };\r\n DialogController.inject = [Renderer];\r\n return DialogController;\r\n}());\n\nexport { Renderer as a, createDialogCancelError as b, invokeLifecycle as c, DialogController as d, createDialogCloseError as e };\n//# sourceMappingURL=chunk.js.map\n","\n\nimport * as LogManager from 'aurelia-logging';\n\nvar logger = LogManager.getLogger('event-aggregator');\n\nvar Handler = function () {\n function Handler(messageType, callback) {\n \n\n this.messageType = messageType;\n this.callback = callback;\n }\n\n Handler.prototype.handle = function handle(message) {\n if (message instanceof this.messageType) {\n this.callback.call(null, message);\n }\n };\n\n return Handler;\n}();\n\nfunction invokeCallback(callback, data, event) {\n try {\n callback(data, event);\n } catch (e) {\n logger.error(e);\n }\n}\n\nfunction invokeHandler(handler, data) {\n try {\n handler.handle(data);\n } catch (e) {\n logger.error(e);\n }\n}\n\nexport var EventAggregator = function () {\n function EventAggregator() {\n \n\n this.eventLookup = {};\n this.messageHandlers = [];\n }\n\n EventAggregator.prototype.publish = function publish(event, data) {\n var subscribers = void 0;\n var i = void 0;\n\n if (!event) {\n throw new Error('Event was invalid.');\n }\n\n if (typeof event === 'string') {\n subscribers = this.eventLookup[event];\n if (subscribers) {\n subscribers = subscribers.slice();\n i = subscribers.length;\n\n while (i--) {\n invokeCallback(subscribers[i], data, event);\n }\n }\n } else {\n subscribers = this.messageHandlers.slice();\n i = subscribers.length;\n\n while (i--) {\n invokeHandler(subscribers[i], event);\n }\n }\n };\n\n EventAggregator.prototype.subscribe = function subscribe(event, callback) {\n var handler = void 0;\n var subscribers = void 0;\n\n if (!event) {\n throw new Error('Event channel/type was invalid.');\n }\n\n if (typeof event === 'string') {\n handler = callback;\n subscribers = this.eventLookup[event] || (this.eventLookup[event] = []);\n } else {\n handler = new Handler(event, callback);\n subscribers = this.messageHandlers;\n }\n\n subscribers.push(handler);\n\n return {\n dispose: function dispose() {\n var idx = subscribers.indexOf(handler);\n if (idx !== -1) {\n subscribers.splice(idx, 1);\n }\n }\n };\n };\n\n EventAggregator.prototype.subscribeOnce = function subscribeOnce(event, callback) {\n var sub = this.subscribe(event, function (a, b) {\n sub.dispose();\n return callback(a, b);\n });\n\n return sub;\n };\n\n return EventAggregator;\n}();\n\nexport function includeEventsIn(obj) {\n var ea = new EventAggregator();\n\n obj.subscribeOnce = function (event, callback) {\n return ea.subscribeOnce(event, callback);\n };\n\n obj.subscribe = function (event, callback) {\n return ea.subscribe(event, callback);\n };\n\n obj.publish = function (event, data) {\n ea.publish(event, data);\n };\n\n return ea;\n}\n\nexport function configure(config) {\n config.instance(EventAggregator, includeEventsIn(config.aurelia));\n}","import { Container } from 'aurelia-dependency-injection';\nexport * from 'aurelia-dependency-injection';\nexport * from 'aurelia-binding';\nexport * from 'aurelia-metadata';\nimport { HtmlBehaviorResource, ViewEngine, BindingLanguage, TemplatingEngine, CompositionTransaction, ViewSlot, ViewResources } from 'aurelia-templating';\nexport * from 'aurelia-templating';\nimport { Loader } from 'aurelia-loader';\nexport * from 'aurelia-loader';\nexport * from 'aurelia-task-queue';\nimport { join, relativeToFile } from 'aurelia-path';\nexport * from 'aurelia-path';\nimport { DOM, PLATFORM } from 'aurelia-pal';\nexport * from 'aurelia-pal';\nimport * as TheLogManager from 'aurelia-logging';\nexport { TheLogManager as LogManager };\n\nvar logger = TheLogManager.getLogger('aurelia');\r\nvar extPattern = /\\.[^/.]+$/;\r\nfunction runTasks(config, tasks) {\r\n var current;\r\n var next = function () {\r\n current = tasks.shift();\r\n if (current) {\r\n return Promise.resolve(current(config)).then(next);\r\n }\r\n return Promise.resolve();\r\n };\r\n return next();\r\n}\r\nfunction loadPlugin(fwConfig, loader, info) {\r\n logger.debug(\"Loading plugin \".concat(info.moduleId, \".\"));\r\n if (typeof info.moduleId === 'string') {\r\n fwConfig.resourcesRelativeTo = info.resourcesRelativeTo;\r\n var id = info.moduleId;\r\n if (info.resourcesRelativeTo.length > 1) {\r\n return loader.normalize(info.moduleId, info.resourcesRelativeTo[1])\r\n .then(function (normalizedId) { return _loadPlugin(normalizedId); });\r\n }\r\n return _loadPlugin(id);\r\n }\r\n else if (typeof info.configure === 'function') {\r\n if (fwConfig.configuredPlugins.indexOf(info.configure) !== -1) {\r\n return Promise.resolve();\r\n }\r\n fwConfig.configuredPlugins.push(info.configure);\r\n return Promise.resolve(info.configure.call(null, fwConfig, info.config || {}));\r\n }\r\n throw new Error(invalidConfigMsg(info.moduleId || info.configure, 'plugin'));\r\n function _loadPlugin(moduleId) {\r\n return loader.loadModule(moduleId).then(function (m) {\r\n if ('configure' in m) {\r\n if (fwConfig.configuredPlugins.indexOf(m.configure) !== -1) {\r\n return Promise.resolve();\r\n }\r\n return Promise.resolve(m.configure(fwConfig, info.config || {})).then(function () {\r\n fwConfig.configuredPlugins.push(m.configure);\r\n fwConfig.resourcesRelativeTo = null;\r\n logger.debug(\"Configured plugin \".concat(info.moduleId, \".\"));\r\n });\r\n }\r\n fwConfig.resourcesRelativeTo = null;\r\n logger.debug(\"Loaded plugin \".concat(info.moduleId, \".\"));\r\n });\r\n }\r\n}\r\nfunction loadResources(aurelia, resourcesToLoad, appResources) {\r\n if (Object.keys(resourcesToLoad).length === 0) {\r\n return Promise.resolve();\r\n }\r\n var viewEngine = aurelia.container.get(ViewEngine);\r\n return Promise.all(Object.keys(resourcesToLoad).map(function (n) { return _normalize(resourcesToLoad[n]); }))\r\n .then(function (loads) {\r\n var names = [];\r\n var importIds = [];\r\n loads.forEach(function (l) {\r\n names.push(undefined);\r\n importIds.push(l.importId);\r\n });\r\n return viewEngine.importViewResources(importIds, names, appResources);\r\n });\r\n function _normalize(load) {\r\n var moduleId = load.moduleId;\r\n var ext = getExt(moduleId);\r\n if (isOtherResource(moduleId)) {\r\n moduleId = removeExt(moduleId);\r\n }\r\n return aurelia.loader.normalize(moduleId, load.relativeTo)\r\n .then(function (normalized) {\r\n return {\r\n name: load.moduleId,\r\n importId: isOtherResource(load.moduleId) ? addOriginalExt(normalized, ext) : normalized\r\n };\r\n });\r\n }\r\n function isOtherResource(name) {\r\n var ext = getExt(name);\r\n if (!ext)\r\n return false;\r\n if (ext === '')\r\n return false;\r\n if (ext === '.js' || ext === '.ts')\r\n return false;\r\n return true;\r\n }\r\n function removeExt(name) {\r\n return name.replace(extPattern, '');\r\n }\r\n function addOriginalExt(normalized, ext) {\r\n return removeExt(normalized) + '.' + ext;\r\n }\r\n}\r\nfunction getExt(name) {\r\n var match = name.match(extPattern);\r\n if (match && match.length > 0) {\r\n return (match[0].split('.'))[1];\r\n }\r\n}\r\nfunction loadBehaviors(config) {\r\n return Promise.all(config.behaviorsToLoad.map(function (m) { return m.load(config.container, m.target); })).then(function () {\r\n config.behaviorsToLoad = null;\r\n });\r\n}\r\nfunction assertProcessed(plugins) {\r\n if (plugins.processed) {\r\n throw new Error('This config instance has already been applied. To load more plugins or global resources, create a new FrameworkConfiguration instance.');\r\n }\r\n}\r\nfunction invalidConfigMsg(cfg, type) {\r\n return \"Invalid \".concat(type, \" [\").concat(cfg, \"], \").concat(type, \" must be specified as functions or relative module IDs.\");\r\n}\r\nvar FrameworkConfiguration = (function () {\r\n function FrameworkConfiguration(aurelia) {\r\n var _this = this;\r\n this.aurelia = aurelia;\r\n this.container = aurelia.container;\r\n this.info = [];\r\n this.processed = false;\r\n this.preTasks = [];\r\n this.postTasks = [];\r\n this.behaviorsToLoad = [];\r\n this.configuredPlugins = [];\r\n this.resourcesToLoad = {};\r\n this.preTask(function () { return aurelia.loader.normalize('aurelia-bootstrapper', undefined)\r\n .then(function (name) { return _this.bootstrapperName = name; }); });\r\n this.postTask(function () { return loadResources(aurelia, _this.resourcesToLoad, aurelia.resources); });\r\n }\r\n FrameworkConfiguration.prototype.instance = function (type, instance) {\r\n this.container.registerInstance(type, instance);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.singleton = function (type, implementation) {\r\n this.container.registerSingleton(type, implementation);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.transient = function (type, implementation) {\r\n this.container.registerTransient(type, implementation);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.preTask = function (task) {\r\n assertProcessed(this);\r\n this.preTasks.push(task);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.postTask = function (task) {\r\n assertProcessed(this);\r\n this.postTasks.push(task);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.feature = function (plugin, config) {\r\n if (config === void 0) { config = {}; }\r\n switch (typeof plugin) {\r\n case 'string':\r\n var hasIndex = /\\/index$/i.test(plugin);\r\n var moduleId = hasIndex || getExt(plugin) ? plugin : plugin + '/index';\r\n var root = hasIndex ? plugin.slice(0, -6) : plugin;\r\n this.info.push({ moduleId: moduleId, resourcesRelativeTo: [root, ''], config: config });\r\n break;\r\n case 'function':\r\n this.info.push({ configure: plugin, config: config || {} });\r\n break;\r\n default:\r\n throw new Error(invalidConfigMsg(plugin, 'feature'));\r\n }\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.globalResources = function (resources) {\r\n var _this = this;\r\n assertProcessed(this);\r\n var toAdd = Array.isArray(resources) ? resources : arguments;\r\n var resource;\r\n var resourcesRelativeTo = this.resourcesRelativeTo || ['', ''];\r\n for (var i = 0, ii = toAdd.length; i < ii; ++i) {\r\n resource = toAdd[i];\r\n switch (typeof resource) {\r\n case 'string':\r\n var parent_1 = resourcesRelativeTo[0];\r\n var grandParent = resourcesRelativeTo[1];\r\n var name_1 = resource;\r\n if ((resource.startsWith('./') || resource.startsWith('../')) && parent_1 !== '') {\r\n name_1 = join(parent_1, resource);\r\n }\r\n this.resourcesToLoad[name_1] = { moduleId: name_1, relativeTo: grandParent };\r\n break;\r\n case 'function':\r\n var meta = this.aurelia.resources.autoRegister(this.container, resource);\r\n if (meta instanceof HtmlBehaviorResource && meta.elementName !== null) {\r\n if (this.behaviorsToLoad.push(meta) === 1) {\r\n this.postTask(function () { return loadBehaviors(_this); });\r\n }\r\n }\r\n break;\r\n default:\r\n throw new Error(invalidConfigMsg(resource, 'resource'));\r\n }\r\n }\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.globalName = function (resourcePath, newName) {\r\n assertProcessed(this);\r\n this.resourcesToLoad[resourcePath] = { moduleId: newName, relativeTo: '' };\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.plugin = function (plugin, pluginConfig) {\r\n assertProcessed(this);\r\n var info;\r\n switch (typeof plugin) {\r\n case 'string':\r\n info = { moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: pluginConfig || {} };\r\n break;\r\n case 'function':\r\n info = { configure: plugin, config: pluginConfig || {} };\r\n break;\r\n default:\r\n throw new Error(invalidConfigMsg(plugin, 'plugin'));\r\n }\r\n this.info.push(info);\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype._addNormalizedPlugin = function (name, config) {\r\n var _this = this;\r\n var plugin = { moduleId: name, resourcesRelativeTo: [name, ''], config: config || {} };\r\n this.info.push(plugin);\r\n this.preTask(function () {\r\n var relativeTo = [name, _this.bootstrapperName];\r\n plugin.moduleId = name;\r\n plugin.resourcesRelativeTo = relativeTo;\r\n return Promise.resolve();\r\n });\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.defaultBindingLanguage = function () {\r\n return this._addNormalizedPlugin('aurelia-templating-binding');\r\n };\r\n FrameworkConfiguration.prototype.router = function () {\r\n return this._addNormalizedPlugin('aurelia-templating-router');\r\n };\r\n FrameworkConfiguration.prototype.history = function () {\r\n return this._addNormalizedPlugin('aurelia-history-browser');\r\n };\r\n FrameworkConfiguration.prototype.defaultResources = function () {\r\n return this._addNormalizedPlugin('aurelia-templating-resources');\r\n };\r\n FrameworkConfiguration.prototype.eventAggregator = function () {\r\n return this._addNormalizedPlugin('aurelia-event-aggregator');\r\n };\r\n FrameworkConfiguration.prototype.basicConfiguration = function () {\r\n return this.defaultBindingLanguage().defaultResources().eventAggregator();\r\n };\r\n FrameworkConfiguration.prototype.standardConfiguration = function () {\r\n return this.basicConfiguration().history().router();\r\n };\r\n FrameworkConfiguration.prototype.developmentLogging = function (level) {\r\n var _this = this;\r\n var logLevel = level ? TheLogManager.logLevel[level] : undefined;\r\n if (logLevel === undefined) {\r\n logLevel = TheLogManager.logLevel.debug;\r\n }\r\n this.preTask(function () {\r\n return _this.aurelia.loader.normalize('aurelia-logging-console', _this.bootstrapperName).then(function (name) {\r\n return _this.aurelia.loader.loadModule(name).then(function (m) {\r\n TheLogManager.addAppender(new m.ConsoleAppender());\r\n TheLogManager.setLevel(logLevel);\r\n });\r\n });\r\n });\r\n return this;\r\n };\r\n FrameworkConfiguration.prototype.apply = function () {\r\n var _this = this;\r\n if (this.processed) {\r\n return Promise.resolve();\r\n }\r\n return runTasks(this, this.preTasks).then(function () {\r\n var loader = _this.aurelia.loader;\r\n var info = _this.info;\r\n var current;\r\n var next = function () {\r\n current = info.shift();\r\n if (current) {\r\n return loadPlugin(_this, loader, current).then(next);\r\n }\r\n _this.processed = true;\r\n _this.configuredPlugins = null;\r\n return Promise.resolve();\r\n };\r\n return next().then(function () { return runTasks(_this, _this.postTasks); });\r\n });\r\n };\r\n return FrameworkConfiguration;\r\n}());\n\nfunction preventActionlessFormSubmit() {\r\n DOM.addEventListener('submit', function (evt) {\r\n var target = evt.target;\r\n var action = target.action;\r\n if (target.tagName.toLowerCase() === 'form' && !action) {\r\n evt.preventDefault();\r\n }\r\n }, false);\r\n}\r\nvar Aurelia = (function () {\r\n function Aurelia(loader, container, resources) {\r\n this.loader = loader || new PLATFORM.Loader();\r\n this.container = container || (new Container()).makeGlobal();\r\n this.resources = resources || new ViewResources();\r\n this.use = new FrameworkConfiguration(this);\r\n this.logger = TheLogManager.getLogger('aurelia');\r\n this.hostConfigured = false;\r\n this.host = null;\r\n this.use.instance(Aurelia, this);\r\n this.use.instance(Loader, this.loader);\r\n this.use.instance(ViewResources, this.resources);\r\n }\r\n Aurelia.prototype.start = function () {\r\n var _this = this;\r\n if (this._started) {\r\n return this._started;\r\n }\r\n this.logger.info('Aurelia Starting');\r\n return this._started = this.use.apply().then(function () {\r\n preventActionlessFormSubmit();\r\n if (!_this.container.hasResolver(BindingLanguage)) {\r\n var message = 'You must configure Aurelia with a BindingLanguage implementation.';\r\n _this.logger.error(message);\r\n throw new Error(message);\r\n }\r\n _this.logger.info('Aurelia Started');\r\n var evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true });\r\n DOM.dispatchEvent(evt);\r\n return _this;\r\n });\r\n };\r\n Aurelia.prototype.enhance = function (bindingContext, applicationHost) {\r\n var _this = this;\r\n if (bindingContext === void 0) { bindingContext = {}; }\r\n if (applicationHost === void 0) { applicationHost = null; }\r\n this._configureHost(applicationHost || DOM.querySelectorAll('body')[0]);\r\n return new Promise(function (resolve) {\r\n var engine = _this.container.get(TemplatingEngine);\r\n _this.root = engine.enhance({ container: _this.container, element: _this.host, resources: _this.resources, bindingContext: bindingContext });\r\n _this.root.attached();\r\n _this._onAureliaComposed();\r\n resolve(_this);\r\n });\r\n };\r\n Aurelia.prototype.setRoot = function (root, applicationHost) {\r\n var _this = this;\r\n if (root === void 0) { root = null; }\r\n if (applicationHost === void 0) { applicationHost = null; }\r\n var instruction = {};\r\n if (this.root && this.root.viewModel && this.root.viewModel.router) {\r\n this.root.viewModel.router.deactivate();\r\n this.root.viewModel.router.reset();\r\n }\r\n this._configureHost(applicationHost);\r\n var engine = this.container.get(TemplatingEngine);\r\n var transaction = this.container.get(CompositionTransaction);\r\n delete transaction.initialComposition;\r\n if (!root) {\r\n if (this.configModuleId) {\r\n root = relativeToFile('./app', this.configModuleId);\r\n }\r\n else {\r\n root = 'app';\r\n }\r\n }\r\n instruction.viewModel = root;\r\n instruction.container = instruction.childContainer = this.container;\r\n instruction.viewSlot = this.hostSlot;\r\n instruction.host = this.host;\r\n return engine.compose(instruction).then(function (r) {\r\n _this.root = r;\r\n instruction.viewSlot.attached();\r\n _this._onAureliaComposed();\r\n return _this;\r\n });\r\n };\r\n Aurelia.prototype._configureHost = function (applicationHost) {\r\n if (this.hostConfigured) {\r\n return;\r\n }\r\n applicationHost = applicationHost || this.host;\r\n if (!applicationHost || typeof applicationHost === 'string') {\r\n this.host = DOM.getElementById(applicationHost || 'applicationHost');\r\n }\r\n else {\r\n this.host = applicationHost;\r\n }\r\n if (!this.host) {\r\n throw new Error('No applicationHost was specified.');\r\n }\r\n this.hostConfigured = true;\r\n this.host.aurelia = this;\r\n this.hostSlot = new ViewSlot(this.host, true);\r\n this.hostSlot.transformChildNodesIntoView();\r\n this.container.registerInstance(DOM.boundary, this.host);\r\n };\r\n Aurelia.prototype._onAureliaComposed = function () {\r\n var evt = DOM.createCustomEvent('aurelia-composed', { bubbles: true, cancelable: true });\r\n setTimeout(function () { return DOM.dispatchEvent(evt); }, 1);\r\n };\r\n return Aurelia;\r\n}());\n\nexport { Aurelia, FrameworkConfiguration };\n//# sourceMappingURL=aurelia-framework.js.map\n","import { History } from 'aurelia-history';\nimport { DOM, PLATFORM } from 'aurelia-pal';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar LinkHandler = (function () {\r\n function LinkHandler() {\r\n }\r\n LinkHandler.prototype.activate = function (history) { };\r\n LinkHandler.prototype.deactivate = function () { };\r\n return LinkHandler;\r\n}());\r\nvar DefaultLinkHandler = (function (_super) {\r\n __extends(DefaultLinkHandler, _super);\r\n function DefaultLinkHandler() {\r\n var _this = _super.call(this) || this;\r\n _this.handler = function (e) {\r\n var _a = DefaultLinkHandler.getEventInfo(e), shouldHandleEvent = _a.shouldHandleEvent, href = _a.href;\r\n if (shouldHandleEvent) {\r\n e.preventDefault();\r\n _this.history.navigate(href);\r\n }\r\n };\r\n return _this;\r\n }\r\n DefaultLinkHandler.prototype.activate = function (history) {\r\n if (history._hasPushState) {\r\n this.history = history;\r\n DOM.addEventListener('click', this.handler, true);\r\n }\r\n };\r\n DefaultLinkHandler.prototype.deactivate = function () {\r\n DOM.removeEventListener('click', this.handler, true);\r\n };\r\n DefaultLinkHandler.getEventInfo = function (event) {\r\n var $event = event;\r\n var info = {\r\n shouldHandleEvent: false,\r\n href: null,\r\n anchor: null\r\n };\r\n var target = DefaultLinkHandler.findClosestAnchor($event.target);\r\n if (!target || !DefaultLinkHandler.targetIsThisWindow(target)) {\r\n return info;\r\n }\r\n if (hasAttribute(target, 'download')\r\n || hasAttribute(target, 'router-ignore')\r\n || hasAttribute(target, 'data-router-ignore')) {\r\n return info;\r\n }\r\n if ($event.altKey || $event.ctrlKey || $event.metaKey || $event.shiftKey) {\r\n return info;\r\n }\r\n var href = target.getAttribute('href');\r\n info.anchor = target;\r\n info.href = href;\r\n var leftButtonClicked = $event.which === 1;\r\n var isRelative = href && !(href.charAt(0) === '#' || (/^[a-z]+:/i).test(href));\r\n info.shouldHandleEvent = leftButtonClicked && isRelative;\r\n return info;\r\n };\r\n DefaultLinkHandler.findClosestAnchor = function (el) {\r\n while (el) {\r\n if (el.tagName === 'A') {\r\n return el;\r\n }\r\n el = el.parentNode;\r\n }\r\n };\r\n DefaultLinkHandler.targetIsThisWindow = function (target) {\r\n var targetWindow = target.getAttribute('target');\r\n var win = PLATFORM.global;\r\n return !targetWindow ||\r\n targetWindow === win.name ||\r\n targetWindow === '_self';\r\n };\r\n return DefaultLinkHandler;\r\n}(LinkHandler));\r\nvar hasAttribute = function (el, attr) { return el.hasAttribute(attr); };\n\nvar BrowserHistory = (function (_super) {\r\n __extends(BrowserHistory, _super);\r\n function BrowserHistory(linkHandler) {\r\n var _this = _super.call(this) || this;\r\n _this._isActive = false;\r\n _this._checkUrlCallback = _this._checkUrl.bind(_this);\r\n _this.location = PLATFORM.location;\r\n _this.history = PLATFORM.history;\r\n _this.linkHandler = linkHandler;\r\n return _this;\r\n }\r\n BrowserHistory.prototype.activate = function (options) {\r\n if (this._isActive) {\r\n throw new Error('History has already been activated.');\r\n }\r\n var $history = this.history;\r\n var wantsPushState = !!options.pushState;\r\n this._isActive = true;\r\n var normalizedOptions = this.options = Object.assign({}, { root: '/' }, this.options, options);\r\n var rootUrl = this.root = ('/' + normalizedOptions.root + '/').replace(rootStripper, '/');\r\n var wantsHashChange = this._wantsHashChange = normalizedOptions.hashChange !== false;\r\n var hasPushState = this._hasPushState = !!(normalizedOptions.pushState && $history && $history.pushState);\r\n var eventName;\r\n if (hasPushState) {\r\n eventName = 'popstate';\r\n }\r\n else if (wantsHashChange) {\r\n eventName = 'hashchange';\r\n }\r\n PLATFORM.addEventListener(eventName, this._checkUrlCallback);\r\n if (wantsHashChange && wantsPushState) {\r\n var $location = this.location;\r\n var atRoot = $location.pathname.replace(/[^\\/]$/, '$&/') === rootUrl;\r\n if (!hasPushState && !atRoot) {\r\n var fragment = this.fragment = this._getFragment(null, true);\r\n $location.replace(rootUrl + $location.search + '#' + fragment);\r\n return true;\r\n }\r\n else if (hasPushState && atRoot && $location.hash) {\r\n var fragment = this.fragment = this._getHash().replace(routeStripper, '');\r\n $history.replaceState({}, DOM.title, rootUrl + fragment + $location.search);\r\n }\r\n }\r\n if (!this.fragment) {\r\n this.fragment = this._getFragment('');\r\n }\r\n this.linkHandler.activate(this);\r\n if (!normalizedOptions.silent) {\r\n return this._loadUrl('');\r\n }\r\n };\r\n BrowserHistory.prototype.deactivate = function () {\r\n var handler = this._checkUrlCallback;\r\n PLATFORM.removeEventListener('popstate', handler);\r\n PLATFORM.removeEventListener('hashchange', handler);\r\n this._isActive = false;\r\n this.linkHandler.deactivate();\r\n };\r\n BrowserHistory.prototype.getAbsoluteRoot = function () {\r\n var $location = this.location;\r\n var origin = createOrigin($location.protocol, $location.hostname, $location.port);\r\n return \"\" + origin + this.root;\r\n };\r\n BrowserHistory.prototype.navigate = function (fragment, _a) {\r\n var _b = _a === void 0 ? {} : _a, _c = _b.trigger, trigger = _c === void 0 ? true : _c, _d = _b.replace, replace = _d === void 0 ? false : _d;\r\n var location = this.location;\r\n if (fragment && absoluteUrl.test(fragment)) {\r\n location.href = fragment;\r\n return true;\r\n }\r\n if (!this._isActive) {\r\n return false;\r\n }\r\n fragment = this._getFragment(fragment || '');\r\n if (this.fragment === fragment && !replace) {\r\n return false;\r\n }\r\n this.fragment = fragment;\r\n var url = this.root + fragment;\r\n if (fragment === '' && url !== '/') {\r\n url = url.slice(0, -1);\r\n }\r\n if (this._hasPushState) {\r\n url = url.replace('//', '/');\r\n this.history[replace ? 'replaceState' : 'pushState']({}, DOM.title, url);\r\n }\r\n else if (this._wantsHashChange) {\r\n updateHash(location, fragment, replace);\r\n }\r\n else {\r\n location.assign(url);\r\n }\r\n if (trigger) {\r\n return this._loadUrl(fragment);\r\n }\r\n return true;\r\n };\r\n BrowserHistory.prototype.navigateBack = function () {\r\n this.history.back();\r\n };\r\n BrowserHistory.prototype.setTitle = function (title) {\r\n DOM.title = title;\r\n };\r\n BrowserHistory.prototype.setState = function (key, value) {\r\n var $history = this.history;\r\n var state = Object.assign({}, $history.state);\r\n var _a = this.location, pathname = _a.pathname, search = _a.search, hash = _a.hash;\r\n state[key] = value;\r\n $history.replaceState(state, null, \"\" + pathname + search + hash);\r\n };\r\n BrowserHistory.prototype.getState = function (key) {\r\n var state = Object.assign({}, this.history.state);\r\n return state[key];\r\n };\r\n BrowserHistory.prototype.getHistoryIndex = function () {\r\n var historyIndex = this.getState('HistoryIndex');\r\n if (historyIndex === undefined) {\r\n historyIndex = this.history.length - 1;\r\n this.setState('HistoryIndex', historyIndex);\r\n }\r\n return historyIndex;\r\n };\r\n BrowserHistory.prototype.go = function (movement) {\r\n this.history.go(movement);\r\n };\r\n BrowserHistory.prototype._getHash = function () {\r\n return this.location.hash.substr(1);\r\n };\r\n BrowserHistory.prototype._getFragment = function (fragment, forcePushState) {\r\n var rootUrl;\r\n if (!fragment) {\r\n if (this._hasPushState || !this._wantsHashChange || forcePushState) {\r\n var location_1 = this.location;\r\n fragment = location_1.pathname + location_1.search;\r\n rootUrl = this.root.replace(trailingSlash, '');\r\n if (!fragment.indexOf(rootUrl)) {\r\n fragment = fragment.substr(rootUrl.length);\r\n }\r\n }\r\n else {\r\n fragment = this._getHash();\r\n }\r\n }\r\n return '/' + fragment.replace(routeStripper, '');\r\n };\r\n BrowserHistory.prototype._checkUrl = function () {\r\n var current = this._getFragment('');\r\n if (current !== this.fragment) {\r\n this._loadUrl('');\r\n }\r\n };\r\n BrowserHistory.prototype._loadUrl = function (fragmentOverride) {\r\n var fragment = this.fragment = this._getFragment(fragmentOverride);\r\n return this.options.routeHandler ?\r\n this.options.routeHandler(fragment) :\r\n false;\r\n };\r\n BrowserHistory.inject = [LinkHandler];\r\n return BrowserHistory;\r\n}(History));\r\nvar routeStripper = /^#?\\/*|\\s+$/g;\r\nvar rootStripper = /^\\/+|\\/+$/g;\r\nvar trailingSlash = /\\/$/;\r\nvar absoluteUrl = /^([a-z][a-z0-9+\\-.]*:)?\\/\\//i;\r\nfunction updateHash($location, fragment, replace) {\r\n if (replace) {\r\n var href = $location.href.replace(/(javascript:|#).*$/, '');\r\n $location.replace(href + '#' + fragment);\r\n }\r\n else {\r\n $location.hash = '#' + fragment;\r\n }\r\n}\r\nfunction createOrigin(protocol, hostname, port) {\r\n return protocol + \"//\" + hostname + (port ? ':' + port : '');\r\n}\n\nfunction configure(config) {\r\n var $config = config;\r\n $config.singleton(History, BrowserHistory);\r\n $config.transient(LinkHandler, DefaultLinkHandler);\r\n}\n\nexport { BrowserHistory, DefaultLinkHandler, LinkHandler, configure };\n//# sourceMappingURL=aurelia-history-browser.js.map\n","\n\nfunction mi(name) {\n throw new Error('History must implement ' + name + '().');\n}\n\nexport var History = function () {\n function History() {\n \n }\n\n History.prototype.activate = function activate(options) {\n mi('activate');\n };\n\n History.prototype.deactivate = function deactivate() {\n mi('deactivate');\n };\n\n History.prototype.getAbsoluteRoot = function getAbsoluteRoot() {\n mi('getAbsoluteRoot');\n };\n\n History.prototype.navigate = function navigate(fragment, options) {\n mi('navigate');\n };\n\n History.prototype.navigateBack = function navigateBack() {\n mi('navigateBack');\n };\n\n History.prototype.setTitle = function setTitle(title) {\n mi('setTitle');\n };\n\n History.prototype.setState = function setState(key, value) {\n mi('setState');\n };\n\n History.prototype.getState = function getState(key) {\n mi('getState');\n };\n\n History.prototype.getHistoryIndex = function getHistoryIndex() {\n mi('getHistoryIndex');\n };\n\n History.prototype.go = function go(movement) {\n mi('go');\n };\n\n return History;\n}();","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nimport { join, buildQueryString } from 'aurelia-path';\nimport { PLATFORM, DOM } from 'aurelia-pal';\n\nexport var Headers = function () {\n function Headers() {\n var headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n \n\n this.headers = {};\n\n for (var _key in headers) {\n this.headers[_key.toLowerCase()] = { key: _key, value: headers[_key] };\n }\n }\n\n Headers.prototype.add = function add(key, value) {\n this.headers[key.toLowerCase()] = { key: key, value: value };\n };\n\n Headers.prototype.get = function get(key) {\n var header = this.headers[key.toLowerCase()];\n return header ? header.value : undefined;\n };\n\n Headers.prototype.clear = function clear() {\n this.headers = {};\n };\n\n Headers.prototype.has = function has(header) {\n return this.headers.hasOwnProperty(header.toLowerCase());\n };\n\n Headers.prototype.configureXHR = function configureXHR(xhr) {\n for (var name in this.headers) {\n if (this.headers.hasOwnProperty(name)) {\n xhr.setRequestHeader(this.headers[name].key, this.headers[name].value);\n }\n }\n };\n\n Headers.parse = function parse(headerStr) {\n var headers = new Headers();\n if (!headerStr) {\n return headers;\n }\n\n var headerPairs = headerStr.split('\\r\\n');\n for (var i = 0; i < headerPairs.length; i++) {\n var headerPair = headerPairs[i];\n\n var index = headerPair.indexOf(': ');\n if (index > 0) {\n var _key2 = headerPair.substring(0, index);\n var val = headerPair.substring(index + 2);\n headers.add(_key2, val);\n }\n }\n\n return headers;\n };\n\n return Headers;\n}();\n\nexport var RequestMessage = function () {\n function RequestMessage(method, url, content, headers) {\n \n\n this.method = method;\n this.url = url;\n this.content = content;\n this.headers = headers || new Headers();\n this.baseUrl = '';\n }\n\n RequestMessage.prototype.buildFullUrl = function buildFullUrl() {\n var absoluteUrl = /^([a-z][a-z0-9+\\-.]*:)?\\/\\//i;\n var url = absoluteUrl.test(this.url) ? this.url : join(this.baseUrl, this.url);\n\n if (this.params) {\n var qs = buildQueryString(this.params, this.traditional);\n url = qs ? url + (this.url.indexOf('?') < 0 ? '?' : '&') + qs : url;\n }\n\n return url;\n };\n\n return RequestMessage;\n}();\n\nexport var HttpResponseMessage = function () {\n function HttpResponseMessage(requestMessage, xhr, responseType, reviver) {\n \n\n this.requestMessage = requestMessage;\n this.statusCode = xhr.status;\n this.response = xhr.response || xhr.responseText;\n this.isSuccess = xhr.status >= 200 && xhr.status < 400;\n this.statusText = xhr.statusText;\n this.reviver = reviver;\n this.mimeType = null;\n\n if (xhr.getAllResponseHeaders) {\n this.headers = Headers.parse(xhr.getAllResponseHeaders());\n } else {\n this.headers = new Headers();\n }\n\n var contentType = void 0;\n\n if (this.headers && this.headers.headers) {\n contentType = this.headers.get('Content-Type');\n }\n\n if (contentType) {\n this.mimeType = responseType = contentType.split(';')[0].trim();\n if (mimeTypes.hasOwnProperty(this.mimeType)) responseType = mimeTypes[this.mimeType];\n }\n\n this.responseType = responseType;\n }\n\n _createClass(HttpResponseMessage, [{\n key: 'content',\n get: function get() {\n try {\n if (this._content !== undefined) {\n return this._content;\n }\n\n if (this.response === undefined || this.response === null || this.response === '') {\n this._content = this.response;\n return this._content;\n }\n\n if (this.responseType === 'json') {\n this._content = JSON.parse(this.response, this.reviver);\n return this._content;\n }\n\n if (this.reviver) {\n this._content = this.reviver(this.response);\n return this._content;\n }\n\n this._content = this.response;\n return this._content;\n } catch (e) {\n if (this.isSuccess) {\n throw e;\n }\n\n this._content = null;\n return this._content;\n }\n }\n }]);\n\n return HttpResponseMessage;\n}();\n\nexport var mimeTypes = {\n 'text/html': 'html',\n 'text/javascript': 'js',\n 'application/javascript': 'js',\n 'text/json': 'json',\n 'application/json': 'json',\n 'application/rss+xml': 'rss',\n 'application/atom+xml': 'atom',\n 'application/xhtml+xml': 'xhtml',\n 'text/markdown': 'md',\n 'text/xml': 'xml',\n 'text/mathml': 'mml',\n 'application/xml': 'xml',\n 'text/yml': 'yml',\n 'text/csv': 'csv',\n 'text/css': 'css',\n 'text/less': 'less',\n 'text/stylus': 'styl',\n 'text/scss': 'scss',\n 'text/sass': 'sass',\n 'text/plain': 'txt'\n};\n\nfunction applyXhrTransformers(xhrTransformers, client, processor, message, xhr) {\n var i = void 0;\n var ii = void 0;\n\n for (i = 0, ii = xhrTransformers.length; i < ii; ++i) {\n xhrTransformers[i](client, processor, message, xhr);\n }\n}\n\nexport var RequestMessageProcessor = function () {\n function RequestMessageProcessor(xhrType, xhrTransformers) {\n \n\n this.XHRType = xhrType;\n this.xhrTransformers = xhrTransformers;\n this.isAborted = false;\n }\n\n RequestMessageProcessor.prototype.abort = function abort() {\n if (this.xhr && this.xhr.readyState !== PLATFORM.XMLHttpRequest.UNSENT) {\n this.xhr.abort();\n }\n\n this.isAborted = true;\n };\n\n RequestMessageProcessor.prototype.process = function process(client, requestMessage) {\n var _this = this;\n\n var promise = new Promise(function (resolve, reject) {\n var rejectResponse = void 0;\n if (client.rejectPromiseWithErrorObject) {\n rejectResponse = function rejectResponse(resp) {\n var errorResp = new ErrorHttpResponseMessage(resp);\n reject(errorResp);\n };\n } else {\n rejectResponse = function rejectResponse(resp) {\n reject(resp);\n };\n }\n\n var xhr = _this.xhr = new _this.XHRType();\n xhr.onload = function (e) {\n var response = new HttpResponseMessage(requestMessage, xhr, requestMessage.responseType, requestMessage.reviver);\n if (response.isSuccess) {\n resolve(response);\n } else {\n rejectResponse(response);\n }\n };\n\n xhr.ontimeout = function (e) {\n rejectResponse(new HttpResponseMessage(requestMessage, {\n response: e,\n status: xhr.status,\n statusText: xhr.statusText\n }, 'timeout'));\n };\n\n xhr.onerror = function (e) {\n rejectResponse(new HttpResponseMessage(requestMessage, {\n response: e,\n status: xhr.status,\n statusText: xhr.statusText\n }, 'error'));\n };\n\n xhr.onabort = function (e) {\n rejectResponse(new HttpResponseMessage(requestMessage, {\n response: e,\n status: xhr.status,\n statusText: xhr.statusText\n }, 'abort'));\n };\n });\n\n return Promise.resolve(requestMessage).then(function (message) {\n var processRequest = function processRequest() {\n if (_this.isAborted) {\n _this.xhr.abort();\n } else {\n _this.xhr.open(message.method, message.buildFullUrl(), true, message.user, message.password);\n applyXhrTransformers(_this.xhrTransformers, client, _this, message, _this.xhr);\n if (typeof message.content === 'undefined') {\n _this.xhr.send();\n } else {\n _this.xhr.send(message.content);\n }\n }\n\n return promise;\n };\n\n var chain = [[processRequest, undefined]];\n\n var interceptors = message.interceptors || [];\n interceptors.forEach(function (interceptor) {\n if (interceptor.request || interceptor.requestError) {\n chain.unshift([interceptor.request ? interceptor.request.bind(interceptor) : undefined, interceptor.requestError ? interceptor.requestError.bind(interceptor) : undefined]);\n }\n\n if (interceptor.response || interceptor.responseError) {\n chain.push([interceptor.response ? interceptor.response.bind(interceptor) : undefined, interceptor.responseError ? interceptor.responseError.bind(interceptor) : undefined]);\n }\n });\n\n var interceptorsPromise = Promise.resolve(message);\n\n while (chain.length) {\n var _interceptorsPromise;\n\n interceptorsPromise = (_interceptorsPromise = interceptorsPromise).then.apply(_interceptorsPromise, chain.shift());\n }\n\n return interceptorsPromise;\n });\n };\n\n return RequestMessageProcessor;\n}();\n\nexport function timeoutTransformer(client, processor, message, xhr) {\n if (message.timeout !== undefined) {\n xhr.timeout = message.timeout;\n }\n}\n\nexport function callbackParameterNameTransformer(client, processor, message, xhr) {\n if (message.callbackParameterName !== undefined) {\n xhr.callbackParameterName = message.callbackParameterName;\n }\n}\n\nexport function credentialsTransformer(client, processor, message, xhr) {\n if (message.withCredentials !== undefined) {\n xhr.withCredentials = message.withCredentials;\n }\n}\n\nexport function progressTransformer(client, processor, message, xhr) {\n if (message.progressCallback) {\n xhr.upload.onprogress = message.progressCallback;\n }\n}\n\nexport function downloadProgressTransformer(client, processor, message, xhr) {\n if (message.downloadProgressCallback) {\n xhr.onprogress = message.downloadProgressCallback;\n }\n}\n\nexport function responseTypeTransformer(client, processor, message, xhr) {\n var responseType = message.responseType;\n\n if (responseType === 'json') {\n responseType = 'text';\n }\n\n xhr.responseType = responseType;\n}\n\nexport function headerTransformer(client, processor, message, xhr) {\n message.headers.configureXHR(xhr);\n}\n\nexport function contentTransformer(client, processor, message, xhr) {\n if (message.skipContentProcessing) {\n return;\n }\n\n if (PLATFORM.global.FormData && message.content instanceof FormData) {\n return;\n }\n\n if (PLATFORM.global.Blob && message.content instanceof Blob) {\n return;\n }\n\n if (PLATFORM.global.ArrayBuffer && message.content instanceof ArrayBuffer) {\n return;\n }\n\n if (message.content instanceof Document) {\n return;\n }\n\n if (typeof message.content === 'string') {\n return;\n }\n\n if (message.content === null || message.content === undefined) {\n return;\n }\n\n message.content = JSON.stringify(message.content, message.replacer);\n\n if (!message.headers.has('Content-Type')) {\n message.headers.add('Content-Type', 'application/json');\n }\n}\n\nexport var JSONPRequestMessage = function (_RequestMessage) {\n _inherits(JSONPRequestMessage, _RequestMessage);\n\n function JSONPRequestMessage(url, callbackParameterName) {\n \n\n var _this2 = _possibleConstructorReturn(this, _RequestMessage.call(this, 'JSONP', url));\n\n _this2.responseType = 'jsonp';\n _this2.callbackParameterName = callbackParameterName;\n return _this2;\n }\n\n return JSONPRequestMessage;\n}(RequestMessage);\n\nvar JSONPXHR = function () {\n function JSONPXHR() {\n \n }\n\n JSONPXHR.prototype.open = function open(method, url) {\n this.method = method;\n this.url = url;\n this.callbackName = 'jsonp_callback_' + Math.round(100000 * Math.random());\n };\n\n JSONPXHR.prototype.send = function send() {\n var _this3 = this;\n\n var url = this.url + (this.url.indexOf('?') >= 0 ? '&' : '?') + encodeURIComponent(this.callbackParameterName) + '=' + this.callbackName;\n var script = DOM.createElement('script');\n\n script.src = url;\n script.onerror = function (e) {\n cleanUp();\n\n _this3.status = 0;\n _this3.onerror(new Error('error'));\n };\n\n var cleanUp = function cleanUp() {\n delete PLATFORM.global[_this3.callbackName];\n DOM.removeNode(script);\n };\n\n PLATFORM.global[this.callbackName] = function (data) {\n cleanUp();\n\n if (_this3.status === undefined) {\n _this3.status = 200;\n _this3.statusText = 'OK';\n _this3.response = data;\n _this3.onload(_this3);\n }\n };\n\n DOM.appendNode(script);\n\n if (this.timeout !== undefined) {\n setTimeout(function () {\n if (_this3.status === undefined) {\n _this3.status = 0;\n _this3.ontimeout(new Error('timeout'));\n }\n }, this.timeout);\n }\n };\n\n JSONPXHR.prototype.abort = function abort() {\n if (this.status === undefined) {\n this.status = 0;\n this.onabort(new Error('abort'));\n }\n };\n\n JSONPXHR.prototype.setRequestHeader = function setRequestHeader() {};\n\n return JSONPXHR;\n}();\n\nexport function createJSONPRequestMessageProcessor() {\n return new RequestMessageProcessor(JSONPXHR, [timeoutTransformer, callbackParameterNameTransformer]);\n}\n\nexport var HttpRequestMessage = function (_RequestMessage2) {\n _inherits(HttpRequestMessage, _RequestMessage2);\n\n function HttpRequestMessage(method, url, content, headers) {\n \n\n var _this4 = _possibleConstructorReturn(this, _RequestMessage2.call(this, method, url, content, headers));\n\n _this4.responseType = 'json';return _this4;\n }\n\n return HttpRequestMessage;\n}(RequestMessage);\n\nexport function createHttpRequestMessageProcessor() {\n return new RequestMessageProcessor(PLATFORM.XMLHttpRequest, [timeoutTransformer, credentialsTransformer, progressTransformer, downloadProgressTransformer, responseTypeTransformer, contentTransformer, headerTransformer]);\n}\n\nexport var ErrorHttpResponseMessage = function (_HttpResponseMessage) {\n _inherits(ErrorHttpResponseMessage, _HttpResponseMessage);\n\n function ErrorHttpResponseMessage(responseMessage) {\n \n\n var _this5 = _possibleConstructorReturn(this, _HttpResponseMessage.call(this, responseMessage.requestMessage, {\n response: responseMessage.response,\n status: responseMessage.statusCode,\n statusText: responseMessage.statusText\n }, responseMessage.responseType));\n\n _this5.name = responseMessage.responseType;\n _this5.message = 'Error: ' + responseMessage.statusCode + ' Status: ' + responseMessage.statusText;\n return _this5;\n }\n\n return ErrorHttpResponseMessage;\n}(HttpResponseMessage);\n\nexport var RequestBuilder = function () {\n function RequestBuilder(client) {\n \n\n this.client = client;\n this.transformers = client.requestTransformers.slice(0);\n this.useJsonp = false;\n }\n\n RequestBuilder.prototype.asDelete = function asDelete() {\n return this._addTransformer(function (client, processor, message) {\n message.method = 'DELETE';\n });\n };\n\n RequestBuilder.prototype.asGet = function asGet() {\n return this._addTransformer(function (client, processor, message) {\n message.method = 'GET';\n });\n };\n\n RequestBuilder.prototype.asHead = function asHead() {\n return this._addTransformer(function (client, processor, message) {\n message.method = 'HEAD';\n });\n };\n\n RequestBuilder.prototype.asOptions = function asOptions() {\n return this._addTransformer(function (client, processor, message) {\n message.method = 'OPTIONS';\n });\n };\n\n RequestBuilder.prototype.asPatch = function asPatch() {\n return this._addTransformer(function (client, processor, message) {\n message.method = 'PATCH';\n });\n };\n\n RequestBuilder.prototype.asPost = function asPost() {\n return this._addTransformer(function (client, processor, message) {\n message.method = 'POST';\n });\n };\n\n RequestBuilder.prototype.asPut = function asPut() {\n return this._addTransformer(function (client, processor, message) {\n message.method = 'PUT';\n });\n };\n\n RequestBuilder.prototype.asJsonp = function asJsonp(callbackParameterName) {\n this.useJsonp = true;\n return this._addTransformer(function (client, processor, message) {\n message.callbackParameterName = callbackParameterName;\n });\n };\n\n RequestBuilder.prototype.withUrl = function withUrl(url) {\n return this._addTransformer(function (client, processor, message) {\n message.url = url;\n });\n };\n\n RequestBuilder.prototype.withContent = function withContent(content) {\n return this._addTransformer(function (client, processor, message) {\n message.content = content;\n });\n };\n\n RequestBuilder.prototype.withBaseUrl = function withBaseUrl(baseUrl) {\n return this._addTransformer(function (client, processor, message) {\n message.baseUrl = baseUrl;\n });\n };\n\n RequestBuilder.prototype.withParams = function withParams(params, traditional) {\n return this._addTransformer(function (client, processor, message) {\n message.traditional = traditional;\n message.params = params;\n });\n };\n\n RequestBuilder.prototype.withResponseType = function withResponseType(responseType) {\n return this._addTransformer(function (client, processor, message) {\n message.responseType = responseType;\n });\n };\n\n RequestBuilder.prototype.withTimeout = function withTimeout(timeout) {\n return this._addTransformer(function (client, processor, message) {\n message.timeout = timeout;\n });\n };\n\n RequestBuilder.prototype.withHeader = function withHeader(key, value) {\n return this._addTransformer(function (client, processor, message) {\n message.headers.add(key, value);\n });\n };\n\n RequestBuilder.prototype.withCredentials = function withCredentials(value) {\n return this._addTransformer(function (client, processor, message) {\n message.withCredentials = value;\n });\n };\n\n RequestBuilder.prototype.withLogin = function withLogin(user, password) {\n return this._addTransformer(function (client, processor, message) {\n message.user = user;message.password = password;\n });\n };\n\n RequestBuilder.prototype.withReviver = function withReviver(reviver) {\n return this._addTransformer(function (client, processor, message) {\n message.reviver = reviver;\n });\n };\n\n RequestBuilder.prototype.withReplacer = function withReplacer(replacer) {\n return this._addTransformer(function (client, processor, message) {\n message.replacer = replacer;\n });\n };\n\n RequestBuilder.prototype.withProgressCallback = function withProgressCallback(progressCallback) {\n return this._addTransformer(function (client, processor, message) {\n message.progressCallback = progressCallback;\n });\n };\n\n RequestBuilder.prototype.withDownloadProgressCallback = function withDownloadProgressCallback(downloadProgressCallback) {\n return this._addTransformer(function (client, processor, message) {\n message.downloadProgressCallback = downloadProgressCallback;\n });\n };\n\n RequestBuilder.prototype.withCallbackParameterName = function withCallbackParameterName(callbackParameterName) {\n return this._addTransformer(function (client, processor, message) {\n message.callbackParameterName = callbackParameterName;\n });\n };\n\n RequestBuilder.prototype.withInterceptor = function withInterceptor(interceptor) {\n return this._addTransformer(function (client, processor, message) {\n message.interceptors = message.interceptors || [];\n message.interceptors.unshift(interceptor);\n });\n };\n\n RequestBuilder.prototype.skipContentProcessing = function skipContentProcessing() {\n return this._addTransformer(function (client, processor, message) {\n message.skipContentProcessing = true;\n });\n };\n\n RequestBuilder.prototype._addTransformer = function _addTransformer(fn) {\n this.transformers.push(fn);\n return this;\n };\n\n RequestBuilder.addHelper = function addHelper(name, fn) {\n RequestBuilder.prototype[name] = function () {\n return this._addTransformer(fn.apply(this, arguments));\n };\n };\n\n RequestBuilder.prototype.send = function send() {\n var message = this.useJsonp ? new JSONPRequestMessage() : new HttpRequestMessage();\n return this.client.send(message, this.transformers);\n };\n\n return RequestBuilder;\n}();\n\nfunction trackRequestStart(client, processor) {\n client.pendingRequests.push(processor);\n client.isRequesting = true;\n}\n\nfunction trackRequestEnd(client, processor) {\n var index = client.pendingRequests.indexOf(processor);\n\n client.pendingRequests.splice(index, 1);\n client.isRequesting = client.pendingRequests.length > 0;\n\n if (!client.isRequesting) {\n var evt = DOM.createCustomEvent('aurelia-http-client-requests-drained', { bubbles: true, cancelable: true });\n setTimeout(function () {\n return DOM.dispatchEvent(evt);\n }, 1);\n }\n}\n\nexport var HttpClient = function () {\n function HttpClient() {\n \n\n this.isRequesting = false;\n\n this.rejectPromiseWithErrorObject = false;\n this.requestTransformers = [];\n this.requestProcessorFactories = new Map();\n this.requestProcessorFactories.set(HttpRequestMessage, createHttpRequestMessageProcessor);\n this.requestProcessorFactories.set(JSONPRequestMessage, createJSONPRequestMessageProcessor);\n this.pendingRequests = [];\n }\n\n HttpClient.prototype.configure = function configure(fn) {\n var builder = new RequestBuilder(this);\n fn(builder);\n this.requestTransformers = builder.transformers;\n return this;\n };\n\n HttpClient.prototype.createRequest = function createRequest(url) {\n var builder = new RequestBuilder(this);\n\n if (url) {\n builder.withUrl(url);\n }\n\n return builder;\n };\n\n HttpClient.prototype.send = function send(requestMessage, transformers) {\n var _this6 = this;\n\n var createProcessor = this.requestProcessorFactories.get(requestMessage.constructor);\n var processor = void 0;\n var promise = void 0;\n var i = void 0;\n var ii = void 0;\n\n if (!createProcessor) {\n throw new Error('No request message processor factory for ' + requestMessage.constructor + '.');\n }\n\n processor = createProcessor();\n trackRequestStart(this, processor);\n\n transformers = transformers || this.requestTransformers;\n\n promise = Promise.resolve(requestMessage).then(function (message) {\n for (i = 0, ii = transformers.length; i < ii; ++i) {\n transformers[i](_this6, processor, message);\n }\n\n return processor.process(_this6, message).then(function (response) {\n trackRequestEnd(_this6, processor);\n return response;\n }).catch(function (response) {\n trackRequestEnd(_this6, processor);\n throw response;\n });\n });\n\n promise.abort = promise.cancel = function () {\n processor.abort();\n };\n\n return promise;\n };\n\n HttpClient.prototype.delete = function _delete(url) {\n return this.createRequest(url).asDelete().send();\n };\n\n HttpClient.prototype.get = function get(url, params, traditional) {\n var req = this.createRequest(url).asGet();\n\n if (params) {\n return req.withParams(params, traditional).send();\n }\n\n return req.send();\n };\n\n HttpClient.prototype.head = function head(url) {\n return this.createRequest(url).asHead().send();\n };\n\n HttpClient.prototype.jsonp = function jsonp(url) {\n var callbackParameterName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'jsoncallback';\n\n return this.createRequest(url).asJsonp(callbackParameterName).send();\n };\n\n HttpClient.prototype.options = function options(url) {\n return this.createRequest(url).asOptions().send();\n };\n\n HttpClient.prototype.put = function put(url, content) {\n return this.createRequest(url).asPut().withContent(content).send();\n };\n\n HttpClient.prototype.patch = function patch(url, content) {\n return this.createRequest(url).asPatch().withContent(content).send();\n };\n\n HttpClient.prototype.post = function post(url, content) {\n return this.createRequest(url).asPost().withContent(content).send();\n };\n\n return HttpClient;\n}();"],"names":[],"sourceRoot":""}