{"version":3,"file":"vendors-3ce50090.47e839c4edc29ae0ca22.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1wBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACn6DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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://client-app/./node_modules/aurelia-task-queue/dist/native-modules/aurelia-task-queue.js","webpack://client-app/./node_modules/aurelia-templating-binding/dist/native-modules/aurelia-templating-binding.js","webpack://client-app/./node_modules/aurelia-templating-resources/dist/native-modules/aurelia-templating-resources.js","webpack://client-app/./node_modules/aurelia-templating-router/dist/native-modules/aurelia-templating-router.js"],"sourcesContent":["var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n\n\nimport { DOM, FEATURE } from 'aurelia-pal';\n\nvar stackSeparator = '\\nEnqueued in TaskQueue by:\\n';\nvar microStackSeparator = '\\nEnqueued in MicroTaskQueue by:\\n';\n\nfunction makeRequestFlushFromMutationObserver(flush) {\n var observer = DOM.createMutationObserver(flush);\n var val = 'a';\n var node = DOM.createTextNode('a');\n var values = Object.create(null);\n values.a = 'b';\n values.b = 'a';\n observer.observe(node, { characterData: true });\n return function requestFlush() {\n node.data = val = values[val];\n };\n}\n\nfunction makeRequestFlushFromTimer(flush) {\n return function requestFlush() {\n var timeoutHandle = setTimeout(handleFlushTimer, 0);\n\n var intervalHandle = setInterval(handleFlushTimer, 50);\n function handleFlushTimer() {\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n flush();\n }\n };\n}\n\nfunction onError(error, task, longStacks) {\n if (longStacks && task.stack && (typeof error === 'undefined' ? 'undefined' : _typeof(error)) === 'object' && error !== null) {\n error.stack = filterFlushStack(error.stack) + task.stack;\n }\n\n if ('onError' in task) {\n task.onError(error);\n } else {\n setTimeout(function () {\n throw error;\n }, 0);\n }\n}\n\nexport var TaskQueue = function () {\n function TaskQueue() {\n var _this = this;\n\n \n\n this.flushing = false;\n this.longStacks = false;\n\n this.microTaskQueue = [];\n this.microTaskQueueCapacity = 1024;\n this.taskQueue = [];\n\n if (FEATURE.mutationObserver) {\n this.requestFlushMicroTaskQueue = makeRequestFlushFromMutationObserver(function () {\n return _this.flushMicroTaskQueue();\n });\n } else {\n this.requestFlushMicroTaskQueue = makeRequestFlushFromTimer(function () {\n return _this.flushMicroTaskQueue();\n });\n }\n\n this.requestFlushTaskQueue = makeRequestFlushFromTimer(function () {\n return _this.flushTaskQueue();\n });\n }\n\n TaskQueue.prototype._flushQueue = function _flushQueue(queue, capacity) {\n var index = 0;\n var task = void 0;\n\n try {\n this.flushing = true;\n while (index < queue.length) {\n task = queue[index];\n if (this.longStacks) {\n this.stack = typeof task.stack === 'string' ? task.stack : undefined;\n }\n task.call();\n index++;\n\n if (index > capacity) {\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n\n queue.length -= index;\n index = 0;\n }\n }\n } catch (error) {\n onError(error, task, this.longStacks);\n } finally {\n this.flushing = false;\n }\n };\n\n TaskQueue.prototype.queueMicroTask = function queueMicroTask(task) {\n if (this.microTaskQueue.length < 1) {\n this.requestFlushMicroTaskQueue();\n }\n\n if (this.longStacks) {\n task.stack = this.prepareQueueStack(microStackSeparator);\n }\n\n this.microTaskQueue.push(task);\n };\n\n TaskQueue.prototype.queueTask = function queueTask(task) {\n if (this.taskQueue.length < 1) {\n this.requestFlushTaskQueue();\n }\n\n if (this.longStacks) {\n task.stack = this.prepareQueueStack(stackSeparator);\n }\n\n this.taskQueue.push(task);\n };\n\n TaskQueue.prototype.flushTaskQueue = function flushTaskQueue() {\n var queue = this.taskQueue;\n this.taskQueue = [];\n this._flushQueue(queue, Number.MAX_VALUE);\n };\n\n TaskQueue.prototype.flushMicroTaskQueue = function flushMicroTaskQueue() {\n var queue = this.microTaskQueue;\n this._flushQueue(queue, this.microTaskQueueCapacity);\n queue.length = 0;\n };\n\n TaskQueue.prototype.prepareQueueStack = function prepareQueueStack(separator) {\n var stack = separator + filterQueueStack(captureStack());\n\n if (typeof this.stack === 'string') {\n stack = filterFlushStack(stack) + this.stack;\n }\n\n return stack;\n };\n\n return TaskQueue;\n}();\n\nfunction captureStack() {\n var error = new Error();\n\n if (error.stack) {\n return error.stack;\n }\n\n try {\n throw error;\n } catch (e) {\n return e.stack;\n }\n}\n\nfunction filterQueueStack(stack) {\n return stack.replace(/^[\\s\\S]*?\\bqueue(Micro)?Task\\b[^\\n]*\\n/, '');\n}\n\nfunction filterFlushStack(stack) {\n var index = stack.lastIndexOf('flushMicroTaskQueue');\n\n if (index < 0) {\n index = stack.lastIndexOf('flushTaskQueue');\n if (index < 0) {\n return stack;\n }\n }\n\n index = stack.lastIndexOf('\\n', index);\n\n return index < 0 ? stack : stack.substr(0, index);\n}","import { BehaviorInstruction, BindingLanguage } from 'aurelia-templating';\nimport { camelCase, SVGAnalyzer, bindingMode, enqueueBindingConnect, connectable, sourceContext, BindingExpression, ListenerExpression, delegationStrategy, CallExpression, Parser, ObserverLocator, EventManager, NameExpression, LiteralString } from 'aurelia-binding';\nimport * as LogManager from 'aurelia-logging';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\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}\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}\n\nvar AttributeMap = (function () {\r\n function AttributeMap(svg) {\r\n this.elements = Object.create(null);\r\n this.allElements = Object.create(null);\r\n this.svg = svg;\r\n this.registerUniversal('accesskey', 'accessKey');\r\n this.registerUniversal('contenteditable', 'contentEditable');\r\n this.registerUniversal('tabindex', 'tabIndex');\r\n this.registerUniversal('textcontent', 'textContent');\r\n this.registerUniversal('innerhtml', 'innerHTML');\r\n this.registerUniversal('scrolltop', 'scrollTop');\r\n this.registerUniversal('scrollleft', 'scrollLeft');\r\n this.registerUniversal('readonly', 'readOnly');\r\n this.register('label', 'for', 'htmlFor');\r\n this.register('img', 'usemap', 'useMap');\r\n this.register('input', 'maxlength', 'maxLength');\r\n this.register('input', 'minlength', 'minLength');\r\n this.register('input', 'formaction', 'formAction');\r\n this.register('input', 'formenctype', 'formEncType');\r\n this.register('input', 'formmethod', 'formMethod');\r\n this.register('input', 'formnovalidate', 'formNoValidate');\r\n this.register('input', 'formtarget', 'formTarget');\r\n this.register('textarea', 'maxlength', 'maxLength');\r\n this.register('td', 'rowspan', 'rowSpan');\r\n this.register('td', 'colspan', 'colSpan');\r\n this.register('th', 'rowspan', 'rowSpan');\r\n this.register('th', 'colspan', 'colSpan');\r\n }\r\n AttributeMap.prototype.register = function (elementName, attributeName, propertyName) {\r\n elementName = elementName.toLowerCase();\r\n attributeName = attributeName.toLowerCase();\r\n var element = this.elements[elementName] = (this.elements[elementName] || Object.create(null));\r\n element[attributeName] = propertyName;\r\n };\r\n AttributeMap.prototype.registerUniversal = function (attributeName, propertyName) {\r\n attributeName = attributeName.toLowerCase();\r\n this.allElements[attributeName] = propertyName;\r\n };\r\n AttributeMap.prototype.map = function (elementName, attributeName) {\r\n if (this.svg.isStandardSvgAttribute(elementName, attributeName)) {\r\n return attributeName;\r\n }\r\n elementName = elementName.toLowerCase();\r\n attributeName = attributeName.toLowerCase();\r\n var element = this.elements[elementName];\r\n if (element !== undefined && attributeName in element) {\r\n return element[attributeName];\r\n }\r\n if (attributeName in this.allElements) {\r\n return this.allElements[attributeName];\r\n }\r\n if (/(?:^data-)|(?:^aria-)|:/.test(attributeName)) {\r\n return attributeName;\r\n }\r\n return camelCase(attributeName);\r\n };\r\n AttributeMap.inject = [SVGAnalyzer];\r\n return AttributeMap;\r\n}());\n\nvar InterpolationBindingExpression = (function () {\r\n function InterpolationBindingExpression(observerLocator, targetProperty, parts, mode, lookupFunctions, attribute) {\r\n this.observerLocator = observerLocator;\r\n this.targetProperty = targetProperty;\r\n this.parts = parts;\r\n this.mode = mode;\r\n this.lookupFunctions = lookupFunctions;\r\n this.attribute = this.attrToRemove = attribute;\r\n this.discrete = false;\r\n }\r\n InterpolationBindingExpression.prototype.createBinding = function (target) {\r\n if (this.parts.length === 3) {\r\n return new ChildInterpolationBinding(target, this.observerLocator, this.parts[1], this.mode, this.lookupFunctions, this.targetProperty, this.parts[0], this.parts[2]);\r\n }\r\n return new InterpolationBinding(this.observerLocator, this.parts, target, this.targetProperty, this.mode, this.lookupFunctions);\r\n };\r\n return InterpolationBindingExpression;\r\n}());\r\nfunction validateTarget(target, propertyName) {\r\n if (propertyName === 'style') {\r\n LogManager.getLogger('templating-binding')\r\n .info('Internet Explorer does not support interpolation in \"style\" attributes. Use the style attribute\\'s alias, \"css\" instead.');\r\n }\r\n else if (target.parentElement && target.parentElement.nodeName === 'TEXTAREA' && propertyName === 'textContent') {\r\n throw new Error('Interpolation binding cannot be used in the content of a textarea element. Use instead.');\r\n }\r\n}\r\nvar InterpolationBinding = (function () {\r\n function InterpolationBinding(observerLocator, parts, target, targetProperty, mode, lookupFunctions) {\r\n validateTarget(target, targetProperty);\r\n this.observerLocator = observerLocator;\r\n this.parts = parts;\r\n this.target = target;\r\n this.targetProperty = targetProperty;\r\n this.targetAccessor = observerLocator.getAccessor(target, targetProperty);\r\n this.mode = mode;\r\n this.lookupFunctions = lookupFunctions;\r\n }\r\n InterpolationBinding.prototype.interpolate = function () {\r\n if (this.isBound) {\r\n var value = '';\r\n var parts = this.parts;\r\n for (var i = 0, ii = parts.length; i < ii; i++) {\r\n value += (i % 2 === 0 ? parts[i] : this[\"childBinding\".concat(i)].value);\r\n }\r\n this.targetAccessor.setValue(value, this.target, this.targetProperty);\r\n }\r\n };\r\n InterpolationBinding.prototype.updateOneTimeBindings = function () {\r\n for (var i = 1, ii = this.parts.length; i < ii; i += 2) {\r\n var child = this[\"childBinding\".concat(i)];\r\n if (child.mode === bindingMode.oneTime) {\r\n child.call();\r\n }\r\n }\r\n };\r\n InterpolationBinding.prototype.bind = function (source) {\r\n if (this.isBound) {\r\n if (this.source === source) {\r\n return;\r\n }\r\n this.unbind();\r\n }\r\n this.source = source;\r\n var parts = this.parts;\r\n for (var i = 1, ii = parts.length; i < ii; i += 2) {\r\n var binding = new ChildInterpolationBinding(this, this.observerLocator, parts[i], this.mode, this.lookupFunctions);\r\n binding.bind(source);\r\n this[\"childBinding\".concat(i)] = binding;\r\n }\r\n this.isBound = true;\r\n this.interpolate();\r\n };\r\n InterpolationBinding.prototype.unbind = function () {\r\n if (!this.isBound) {\r\n return;\r\n }\r\n this.isBound = false;\r\n this.source = null;\r\n var parts = this.parts;\r\n for (var i = 1, ii = parts.length; i < ii; i += 2) {\r\n var name_1 = \"childBinding\".concat(i);\r\n this[name_1].unbind();\r\n }\r\n };\r\n return InterpolationBinding;\r\n}());\r\nvar ChildInterpolationBinding = (function () {\r\n function ChildInterpolationBinding(target, observerLocator, sourceExpression, mode, lookupFunctions, targetProperty, left, right) {\r\n if (target instanceof InterpolationBinding) {\r\n this.parent = target;\r\n }\r\n else {\r\n validateTarget(target, targetProperty);\r\n this.target = target;\r\n this.targetProperty = targetProperty;\r\n this.targetAccessor = observerLocator.getAccessor(target, targetProperty);\r\n }\r\n this.observerLocator = observerLocator;\r\n this.sourceExpression = sourceExpression;\r\n this.mode = mode;\r\n this.lookupFunctions = lookupFunctions;\r\n this.left = left;\r\n this.right = right;\r\n }\r\n ChildInterpolationBinding.prototype.updateTarget = function (value) {\r\n value = value === null || value === undefined ? '' : value.toString();\r\n if (value !== this.value) {\r\n this.value = value;\r\n if (this.parent) {\r\n this.parent.interpolate();\r\n }\r\n else {\r\n this.targetAccessor.setValue(this.left + value + this.right, this.target, this.targetProperty);\r\n }\r\n }\r\n };\r\n ChildInterpolationBinding.prototype.call = function () {\r\n if (!this.isBound) {\r\n return;\r\n }\r\n this.rawValue = this.sourceExpression.evaluate(this.source, this.lookupFunctions);\r\n this.updateTarget(this.rawValue);\r\n if (this.mode !== bindingMode.oneTime) {\r\n this._version++;\r\n this.sourceExpression.connect(this, this.source);\r\n if (this.rawValue instanceof Array) {\r\n this.observeArray(this.rawValue);\r\n }\r\n this.unobserve(false);\r\n }\r\n };\r\n ChildInterpolationBinding.prototype.bind = function (source) {\r\n if (this.isBound) {\r\n if (this.source === source) {\r\n return;\r\n }\r\n this.unbind();\r\n }\r\n this.isBound = true;\r\n this.source = source;\r\n var sourceExpression = this.sourceExpression;\r\n if (sourceExpression.bind) {\r\n sourceExpression.bind(this, source, this.lookupFunctions);\r\n }\r\n this.rawValue = sourceExpression.evaluate(source, this.lookupFunctions);\r\n this.updateTarget(this.rawValue);\r\n if (this.mode === bindingMode.oneWay) {\r\n enqueueBindingConnect(this);\r\n }\r\n };\r\n ChildInterpolationBinding.prototype.unbind = function () {\r\n if (!this.isBound) {\r\n return;\r\n }\r\n this.isBound = false;\r\n var sourceExpression = this.sourceExpression;\r\n if (sourceExpression.unbind) {\r\n sourceExpression.unbind(this, this.source);\r\n }\r\n this.source = null;\r\n this.value = null;\r\n this.rawValue = null;\r\n this.unobserve(true);\r\n };\r\n ChildInterpolationBinding.prototype.connect = function (evaluate) {\r\n if (!this.isBound) {\r\n return;\r\n }\r\n if (evaluate) {\r\n this.rawValue = this.sourceExpression.evaluate(this.source, this.lookupFunctions);\r\n this.updateTarget(this.rawValue);\r\n }\r\n this.sourceExpression.connect(this, this.source);\r\n if (this.rawValue instanceof Array) {\r\n this.observeArray(this.rawValue);\r\n }\r\n };\r\n ChildInterpolationBinding = __decorate([\r\n connectable()\r\n ], ChildInterpolationBinding);\r\n return ChildInterpolationBinding;\r\n}());\n\nvar LetExpression = (function () {\r\n function LetExpression(observerLocator, targetProperty, sourceExpression, lookupFunctions, toBindingContext) {\r\n this.observerLocator = observerLocator;\r\n this.sourceExpression = sourceExpression;\r\n this.targetProperty = targetProperty;\r\n this.lookupFunctions = lookupFunctions;\r\n this.toBindingContext = toBindingContext;\r\n }\r\n LetExpression.prototype.createBinding = function () {\r\n return new LetBinding(this.observerLocator, this.sourceExpression, this.targetProperty, this.lookupFunctions, this.toBindingContext);\r\n };\r\n return LetExpression;\r\n}());\r\nvar LetBinding = (function () {\r\n function LetBinding(observerLocator, sourceExpression, targetProperty, lookupFunctions, toBindingContext) {\r\n this.observerLocator = observerLocator;\r\n this.sourceExpression = sourceExpression;\r\n this.targetProperty = targetProperty;\r\n this.lookupFunctions = lookupFunctions;\r\n this.source = null;\r\n this.target = null;\r\n this.toBindingContext = toBindingContext;\r\n }\r\n LetBinding.prototype.updateTarget = function () {\r\n var value = this.sourceExpression.evaluate(this.source, this.lookupFunctions);\r\n this.target[this.targetProperty] = value;\r\n };\r\n LetBinding.prototype.call = function (context) {\r\n if (!this.isBound) {\r\n return;\r\n }\r\n if (context === sourceContext) {\r\n this.updateTarget();\r\n return;\r\n }\r\n throw new Error(\"Unexpected call context \".concat(context));\r\n };\r\n LetBinding.prototype.bind = function (source) {\r\n if (this.isBound) {\r\n if (this.source === source) {\r\n return;\r\n }\r\n this.unbind();\r\n }\r\n this.isBound = true;\r\n this.source = source;\r\n this.target = this.toBindingContext ? source.bindingContext : source.overrideContext;\r\n if (this.sourceExpression.bind) {\r\n this.sourceExpression.bind(this, source, this.lookupFunctions);\r\n }\r\n enqueueBindingConnect(this);\r\n };\r\n LetBinding.prototype.unbind = function () {\r\n if (!this.isBound) {\r\n return;\r\n }\r\n this.isBound = false;\r\n if (this.sourceExpression.unbind) {\r\n this.sourceExpression.unbind(this, this.source);\r\n }\r\n this.source = null;\r\n this.target = null;\r\n this.unobserve(true);\r\n };\r\n LetBinding.prototype.unobserve = function (arg0) {\r\n throw new Error('Method not implemented.');\r\n };\r\n LetBinding.prototype.connect = function () {\r\n if (!this.isBound) {\r\n return;\r\n }\r\n this.updateTarget();\r\n this.sourceExpression.connect(this, this.source);\r\n };\r\n LetBinding = __decorate([\r\n connectable()\r\n ], LetBinding);\r\n return LetBinding;\r\n}());\n\nvar LetInterpolationBindingExpression = (function () {\r\n function LetInterpolationBindingExpression(observerLocator, targetProperty, parts, lookupFunctions, toBindingContext) {\r\n this.observerLocator = observerLocator;\r\n this.targetProperty = targetProperty;\r\n this.parts = parts;\r\n this.lookupFunctions = lookupFunctions;\r\n this.toBindingContext = toBindingContext;\r\n }\r\n LetInterpolationBindingExpression.prototype.createBinding = function () {\r\n return new LetInterpolationBinding(this.observerLocator, this.targetProperty, this.parts, this.lookupFunctions, this.toBindingContext);\r\n };\r\n return LetInterpolationBindingExpression;\r\n}());\r\nvar LetInterpolationBinding = (function () {\r\n function LetInterpolationBinding(observerLocator, targetProperty, parts, lookupFunctions, toBindingContext) {\r\n this.observerLocator = observerLocator;\r\n this.parts = parts;\r\n this.targetProperty = targetProperty;\r\n this.lookupFunctions = lookupFunctions;\r\n this.toBindingContext = toBindingContext;\r\n this.target = null;\r\n }\r\n LetInterpolationBinding.prototype.bind = function (source) {\r\n if (this.isBound) {\r\n if (this.source === source) {\r\n return;\r\n }\r\n this.unbind();\r\n }\r\n this.isBound = true;\r\n this.source = source;\r\n this.target = this.toBindingContext ? source.bindingContext : source.overrideContext;\r\n this.interpolationBinding = this.createInterpolationBinding();\r\n this.interpolationBinding.bind(source);\r\n };\r\n LetInterpolationBinding.prototype.unbind = function () {\r\n if (!this.isBound) {\r\n return;\r\n }\r\n this.isBound = false;\r\n this.source = null;\r\n this.target = null;\r\n this.interpolationBinding.unbind();\r\n this.interpolationBinding = null;\r\n };\r\n LetInterpolationBinding.prototype.createInterpolationBinding = function () {\r\n if (this.parts.length === 3) {\r\n return new ChildInterpolationBinding(this.target, this.observerLocator, this.parts[1], bindingMode.toView, this.lookupFunctions, this.targetProperty, this.parts[0], this.parts[2]);\r\n }\r\n return new InterpolationBinding(this.observerLocator, this.parts, this.target, this.targetProperty, bindingMode.toView, this.lookupFunctions);\r\n };\r\n return LetInterpolationBinding;\r\n}());\n\nvar SyntaxInterpreter = (function () {\r\n function SyntaxInterpreter(parser, observerLocator, eventManager, attributeMap) {\r\n this.parser = parser;\r\n this.observerLocator = observerLocator;\r\n this.eventManager = eventManager;\r\n this.attributeMap = attributeMap;\r\n }\r\n SyntaxInterpreter.prototype.interpret = function (resources, element, info, existingInstruction, context) {\r\n if (info.command in this) {\r\n return this[info.command](resources, element, info, existingInstruction, context);\r\n }\r\n return this.handleUnknownCommand(resources, element, info, existingInstruction, context);\r\n };\r\n SyntaxInterpreter.prototype.handleUnknownCommand = function (resources, element, info, existingInstruction, context) {\r\n LogManager.getLogger('templating-binding').warn('Unknown binding command.', info);\r\n return existingInstruction;\r\n };\r\n SyntaxInterpreter.prototype.determineDefaultBindingMode = function (element, attrName, context) {\r\n var tagName = element.tagName.toLowerCase();\r\n if (tagName === 'input' && (attrName === 'value' || attrName === 'files') && element.type !== 'checkbox' && element.type !== 'radio'\r\n || tagName === 'input' && attrName === 'checked' && (element.type === 'checkbox' || element.type === 'radio')\r\n || (tagName === 'textarea' || tagName === 'select') && attrName === 'value'\r\n || (attrName === 'textcontent' || attrName === 'innerhtml') && element.contentEditable === 'true'\r\n || attrName === 'scrolltop'\r\n || attrName === 'scrollleft') {\r\n return bindingMode.twoWay;\r\n }\r\n if (context\r\n && attrName in context.attributes\r\n && context.attributes[attrName]\r\n && context.attributes[attrName].defaultBindingMode >= bindingMode.oneTime) {\r\n return context.attributes[attrName].defaultBindingMode;\r\n }\r\n return bindingMode.toView;\r\n };\r\n SyntaxInterpreter.prototype.bind = function (resources, element, info, existingInstruction, context) {\r\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\r\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), info.defaultBindingMode === undefined || info.defaultBindingMode === null\r\n ? this.determineDefaultBindingMode(element, info.attrName, context)\r\n : info.defaultBindingMode, resources.lookupFunctions);\r\n return instruction;\r\n };\r\n SyntaxInterpreter.prototype.trigger = function (resources, element, info) {\r\n return new ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), delegationStrategy.none, true, resources.lookupFunctions);\r\n };\r\n SyntaxInterpreter.prototype.capture = function (resources, element, info) {\r\n return new ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), delegationStrategy.capturing, true, resources.lookupFunctions);\r\n };\r\n SyntaxInterpreter.prototype.delegate = function (resources, element, info) {\r\n return new ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), delegationStrategy.bubbling, true, resources.lookupFunctions);\r\n };\r\n SyntaxInterpreter.prototype.call = function (resources, element, info, existingInstruction) {\r\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\r\n instruction.attributes[info.attrName] = new CallExpression(this.observerLocator, info.attrName, this.parser.parse(info.attrValue), resources.lookupFunctions);\r\n return instruction;\r\n };\r\n SyntaxInterpreter.prototype.options = function (resources, element, info, existingInstruction, context) {\r\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\r\n var attrValue = info.attrValue;\r\n var language = this.language;\r\n var name = null;\r\n var target = '';\r\n var current;\r\n var i;\r\n var ii;\r\n var inString = false;\r\n var inEscape = false;\r\n var foundName = false;\r\n for (i = 0, ii = attrValue.length; i < ii; ++i) {\r\n current = attrValue[i];\r\n if (current === ';' && !inString) {\r\n if (!foundName) {\r\n name = this._getPrimaryPropertyName(resources, context);\r\n }\r\n info = language.inspectAttribute(resources, '?', name, target.trim());\r\n language.createAttributeInstruction(resources, element, info, instruction, context);\r\n if (!instruction.attributes[info.attrName]) {\r\n instruction.attributes[info.attrName] = info.attrValue;\r\n }\r\n target = '';\r\n name = null;\r\n }\r\n else if (current === ':' && name === null) {\r\n foundName = true;\r\n name = target.trim();\r\n target = '';\r\n }\r\n else if (current === '\\\\') {\r\n target += current;\r\n inEscape = true;\r\n continue;\r\n }\r\n else {\r\n target += current;\r\n if (name !== null && inEscape === false && current === '\\'') {\r\n inString = !inString;\r\n }\r\n }\r\n inEscape = false;\r\n }\r\n if (!foundName) {\r\n name = this._getPrimaryPropertyName(resources, context);\r\n }\r\n if (name !== null) {\r\n info = language.inspectAttribute(resources, '?', name, target.trim());\r\n language.createAttributeInstruction(resources, element, info, instruction, context);\r\n if (!instruction.attributes[info.attrName]) {\r\n instruction.attributes[info.attrName] = info.attrValue;\r\n }\r\n }\r\n return instruction;\r\n };\r\n SyntaxInterpreter.prototype._getPrimaryPropertyName = function (resources, context) {\r\n var type = resources.getAttribute(context.attributeName);\r\n if (type && type.primaryProperty) {\r\n return type.primaryProperty.attribute;\r\n }\r\n return null;\r\n };\r\n SyntaxInterpreter.prototype['for'] = function (resources, element, info, existingInstruction) {\r\n var parts;\r\n var keyValue;\r\n var instruction;\r\n var attrValue;\r\n var isDestructuring;\r\n attrValue = info.attrValue;\r\n isDestructuring = attrValue.match(/^ *[[].+[\\]]/);\r\n parts = isDestructuring ? attrValue.split('of ') : attrValue.split(' of ');\r\n if (parts.length !== 2) {\r\n throw new Error('Incorrect syntax for \"for\". The form is: \"$local of $items\" or \"[$key, $value] of $items\".');\r\n }\r\n instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\r\n if (isDestructuring) {\r\n keyValue = parts[0].replace(/[[\\]]/g, '').replace(/,/g, ' ').replace(/\\s+/g, ' ').trim().split(' ');\r\n instruction.attributes.key = keyValue[0];\r\n instruction.attributes.value = keyValue[1];\r\n }\r\n else {\r\n instruction.attributes.local = parts[0];\r\n }\r\n instruction.attributes.items = new BindingExpression(this.observerLocator, 'items', this.parser.parse(parts[1]), bindingMode.toView, resources.lookupFunctions);\r\n return instruction;\r\n };\r\n SyntaxInterpreter.prototype['two-way'] = function (resources, element, info, existingInstruction) {\r\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\r\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), bindingMode.twoWay, resources.lookupFunctions);\r\n return instruction;\r\n };\r\n SyntaxInterpreter.prototype['to-view'] = function (resources, element, info, existingInstruction) {\r\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\r\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), bindingMode.toView, resources.lookupFunctions);\r\n return instruction;\r\n };\r\n SyntaxInterpreter.prototype['from-view'] = function (resources, element, info, existingInstruction) {\r\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\r\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), bindingMode.fromView, resources.lookupFunctions);\r\n return instruction;\r\n };\r\n SyntaxInterpreter.prototype['one-time'] = function (resources, element, info, existingInstruction) {\r\n var instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);\r\n instruction.attributes[info.attrName] = new BindingExpression(this.observerLocator, this.attributeMap.map(element.tagName, info.attrName), this.parser.parse(info.attrValue), bindingMode.oneTime, resources.lookupFunctions);\r\n return instruction;\r\n };\r\n SyntaxInterpreter.inject = [Parser, ObserverLocator, EventManager, AttributeMap];\r\n return SyntaxInterpreter;\r\n}());\r\nObject.defineProperty(SyntaxInterpreter.prototype, 'one-way', Object.getOwnPropertyDescriptor(SyntaxInterpreter.prototype, 'to-view'));\n\nvar info = {};\r\nvar TemplatingBindingLanguage = (function (_super) {\r\n __extends(TemplatingBindingLanguage, _super);\r\n function TemplatingBindingLanguage(parser, observerLocator, syntaxInterpreter, attributeMap) {\r\n var _this = _super.call(this) || this;\r\n _this.parser = parser;\r\n _this.observerLocator = observerLocator;\r\n _this.syntaxInterpreter = syntaxInterpreter;\r\n _this.emptyStringExpression = _this.parser.parse('\\'\\'');\r\n syntaxInterpreter.language = _this;\r\n _this.attributeMap = attributeMap;\r\n _this.toBindingContextAttr = 'to-binding-context';\r\n return _this;\r\n }\r\n TemplatingBindingLanguage.prototype.inspectAttribute = function (resources, elementName, attrName, attrValue) {\r\n var parts = attrName.split('.');\r\n info.defaultBindingMode = null;\r\n if (parts.length === 2) {\r\n info.attrName = parts[0].trim();\r\n info.attrValue = attrValue;\r\n info.command = parts[1].trim();\r\n if (info.command === 'ref') {\r\n info.expression = new NameExpression(this.parser.parse(attrValue), info.attrName, resources.lookupFunctions);\r\n info.command = null;\r\n info.attrName = 'ref';\r\n }\r\n else {\r\n info.expression = null;\r\n }\r\n }\r\n else if (attrName === 'ref') {\r\n info.attrName = attrName;\r\n info.attrValue = attrValue;\r\n info.command = null;\r\n info.expression = new NameExpression(this.parser.parse(attrValue), 'element', resources.lookupFunctions);\r\n }\r\n else {\r\n info.attrName = attrName;\r\n info.attrValue = attrValue;\r\n info.command = null;\r\n var interpolationParts = this.parseInterpolation(resources, attrValue);\r\n if (interpolationParts === null) {\r\n info.expression = null;\r\n }\r\n else {\r\n info.expression = new InterpolationBindingExpression(this.observerLocator, this.attributeMap.map(elementName, attrName), interpolationParts, bindingMode.toView, resources.lookupFunctions, attrName);\r\n }\r\n }\r\n return info;\r\n };\r\n TemplatingBindingLanguage.prototype.createAttributeInstruction = function (resources, element, theInfo, existingInstruction, context) {\r\n var instruction;\r\n if (theInfo.expression) {\r\n if (theInfo.attrName === 'ref') {\r\n return theInfo.expression;\r\n }\r\n instruction = existingInstruction || BehaviorInstruction.attribute(theInfo.attrName);\r\n instruction.attributes[theInfo.attrName] = theInfo.expression;\r\n }\r\n else if (theInfo.command) {\r\n instruction = this.syntaxInterpreter.interpret(resources, element, theInfo, existingInstruction, context);\r\n }\r\n return instruction;\r\n };\r\n TemplatingBindingLanguage.prototype.createLetExpressions = function (resources, letElement) {\r\n var expressions = [];\r\n var attributes = letElement.attributes;\r\n var attr;\r\n var parts;\r\n var attrName;\r\n var attrValue;\r\n var command;\r\n var toBindingContextAttr = this.toBindingContextAttr;\r\n var toBindingContext = letElement.hasAttribute(toBindingContextAttr);\r\n for (var i = 0, ii = attributes.length; ii > i; ++i) {\r\n attr = attributes[i];\r\n attrName = attr.name;\r\n attrValue = attr.nodeValue;\r\n parts = attrName.split('.');\r\n if (attrName === toBindingContextAttr) {\r\n continue;\r\n }\r\n if (parts.length === 2) {\r\n command = parts[1];\r\n if (command !== 'bind') {\r\n LogManager.getLogger('templating-binding-language')\r\n .warn(\"Detected invalid let command. Expected \\\"\".concat(parts[0], \".bind\\\", given \\\"\").concat(attrName, \"\\\"\"));\r\n continue;\r\n }\r\n expressions.push(new LetExpression(this.observerLocator, camelCase(parts[0]), this.parser.parse(attrValue), resources.lookupFunctions, toBindingContext));\r\n }\r\n else {\r\n attrName = camelCase(attrName);\r\n parts = this.parseInterpolation(resources, attrValue);\r\n if (parts === null) {\r\n LogManager.getLogger('templating-binding-language')\r\n .warn(\"Detected string literal in let bindings. Did you mean \\\"\".concat(attrName, \".bind=\").concat(attrValue, \"\\\" or \\\"\").concat(attrName, \"=${\").concat(attrValue, \"}\\\" ?\"));\r\n }\r\n if (parts) {\r\n expressions.push(new LetInterpolationBindingExpression(this.observerLocator, attrName, parts, resources.lookupFunctions, toBindingContext));\r\n }\r\n else {\r\n expressions.push(new LetExpression(this.observerLocator, attrName, new LiteralString(attrValue), resources.lookupFunctions, toBindingContext));\r\n }\r\n }\r\n }\r\n return expressions;\r\n };\r\n TemplatingBindingLanguage.prototype.inspectTextContent = function (resources, value) {\r\n var parts = this.parseInterpolation(resources, value);\r\n if (parts === null) {\r\n return null;\r\n }\r\n return new InterpolationBindingExpression(this.observerLocator, 'textContent', parts, bindingMode.toView, resources.lookupFunctions, 'textContent');\r\n };\r\n TemplatingBindingLanguage.prototype.parseInterpolation = function (resources, value) {\r\n var i = value.indexOf('${', 0);\r\n var ii = value.length;\r\n var char;\r\n var pos = 0;\r\n var open = 0;\r\n var quote = null;\r\n var interpolationStart;\r\n var parts;\r\n var partIndex = 0;\r\n while (i >= 0 && i < ii - 2) {\r\n open = 1;\r\n interpolationStart = i;\r\n i += 2;\r\n do {\r\n char = value[i];\r\n i++;\r\n if (char === \"'\" || char === '\"') {\r\n if (quote === null) {\r\n quote = char;\r\n }\r\n else if (quote === char) {\r\n quote = null;\r\n }\r\n continue;\r\n }\r\n if (char === '\\\\') {\r\n i++;\r\n continue;\r\n }\r\n if (quote !== null) {\r\n continue;\r\n }\r\n if (char === '{') {\r\n open++;\r\n }\r\n else if (char === '}') {\r\n open--;\r\n }\r\n } while (open > 0 && i < ii);\r\n if (open === 0) {\r\n parts = parts || [];\r\n if (value[interpolationStart - 1] === '\\\\' && value[interpolationStart - 2] !== '\\\\') {\r\n parts[partIndex] = value.substring(pos, interpolationStart - 1) + value.substring(interpolationStart, i);\r\n partIndex++;\r\n parts[partIndex] = this.emptyStringExpression;\r\n partIndex++;\r\n }\r\n else {\r\n parts[partIndex] = value.substring(pos, interpolationStart);\r\n partIndex++;\r\n parts[partIndex] = this.parser.parse(value.substring(interpolationStart + 2, i - 1));\r\n partIndex++;\r\n }\r\n pos = i;\r\n i = value.indexOf('${', i);\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if (partIndex === 0) {\r\n return null;\r\n }\r\n parts[partIndex] = value.substr(pos);\r\n return parts;\r\n };\r\n TemplatingBindingLanguage.inject = [Parser, ObserverLocator, SyntaxInterpreter, AttributeMap];\r\n return TemplatingBindingLanguage;\r\n}(BindingLanguage));\n\nfunction configure(config) {\r\n config.container.registerSingleton(BindingLanguage, TemplatingBindingLanguage);\r\n config.container.registerAlias(BindingLanguage, TemplatingBindingLanguage);\r\n}\n\nexport { AttributeMap, ChildInterpolationBinding, InterpolationBinding, InterpolationBindingExpression, LetBinding, LetExpression, LetInterpolationBinding, LetInterpolationBindingExpression, SyntaxInterpreter, TemplatingBindingLanguage, configure };\n//# sourceMappingURL=aurelia-templating-binding.js.map\n","import { Container, inject, Optional } from 'aurelia-dependency-injection';\nimport { DOM, FEATURE } from 'aurelia-pal';\nimport { TaskQueue } from 'aurelia-task-queue';\nimport { bindable, noView, customElement, CompositionEngine, ViewSlot, ViewResources, customAttribute, templateController, BoundViewFactory, TargetInstruction, Animator, resource, useView, useShadowDOM, ViewEngine } from 'aurelia-templating';\nimport { createOverrideContext, bindingMode, BindingBehavior, ValueConverter, sourceContext, mergeSplice, ObserverLocator, valueConverter, DataAttributeObserver, bindingBehavior, targetContext, EventSubscriber } from 'aurelia-binding';\nimport { Loader } from 'aurelia-loader';\nimport { relativeToFile } from 'aurelia-path';\nimport { mixin } from 'aurelia-metadata';\nimport { getLogger } from 'aurelia-logging';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\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}\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}\n\nvar ActivationStrategy;\r\n(function (ActivationStrategy) {\r\n ActivationStrategy[\"InvokeLifecycle\"] = \"invoke-lifecycle\";\r\n ActivationStrategy[\"Replace\"] = \"replace\";\r\n})(ActivationStrategy || (ActivationStrategy = {}));\r\nvar Compose = (function () {\r\n function Compose(element, container, compositionEngine, viewSlot, viewResources, taskQueue) {\r\n this.activationStrategy = ActivationStrategy.InvokeLifecycle;\r\n this.element = element;\r\n this.container = container;\r\n this.compositionEngine = compositionEngine;\r\n this.viewSlot = viewSlot;\r\n this.viewResources = viewResources;\r\n this.taskQueue = taskQueue;\r\n this.currentController = null;\r\n this.currentViewModel = null;\r\n this.changes = Object.create(null);\r\n }\r\n Compose.inject = function () {\r\n return [DOM.Element, Container, CompositionEngine, ViewSlot, ViewResources, TaskQueue];\r\n };\r\n Compose.prototype.created = function (owningView) {\r\n this.owningView = owningView;\r\n };\r\n Compose.prototype.bind = function (bindingContext, overrideContext) {\r\n this.bindingContext = bindingContext;\r\n this.overrideContext = overrideContext;\r\n var changes = this.changes;\r\n changes.view = this.view;\r\n changes.viewModel = this.viewModel;\r\n changes.model = this.model;\r\n if (!this.pendingTask) {\r\n processChanges(this);\r\n }\r\n };\r\n Compose.prototype.unbind = function () {\r\n this.changes = Object.create(null);\r\n this.bindingContext = null;\r\n this.overrideContext = null;\r\n var returnToCache = true;\r\n var skipAnimation = true;\r\n this.viewSlot.removeAll(returnToCache, skipAnimation);\r\n };\r\n Compose.prototype.modelChanged = function (newValue, oldValue) {\r\n this.changes.model = newValue;\r\n requestUpdate(this);\r\n };\r\n Compose.prototype.viewChanged = function (newValue, oldValue) {\r\n this.changes.view = newValue;\r\n requestUpdate(this);\r\n };\r\n Compose.prototype.viewModelChanged = function (newValue, oldValue) {\r\n this.changes.viewModel = newValue;\r\n requestUpdate(this);\r\n };\r\n __decorate([\r\n bindable\r\n ], Compose.prototype, \"model\", void 0);\r\n __decorate([\r\n bindable\r\n ], Compose.prototype, \"view\", void 0);\r\n __decorate([\r\n bindable\r\n ], Compose.prototype, \"viewModel\", void 0);\r\n __decorate([\r\n bindable\r\n ], Compose.prototype, \"activationStrategy\", void 0);\r\n __decorate([\r\n bindable\r\n ], Compose.prototype, \"swapOrder\", void 0);\r\n Compose = __decorate([\r\n noView,\r\n customElement('compose')\r\n ], Compose);\r\n return Compose;\r\n}());\r\nfunction isEmpty(obj) {\r\n for (var _ in obj) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction tryActivateViewModel(vm, model) {\r\n if (vm && typeof vm.activate === 'function') {\r\n return Promise.resolve(vm.activate(model));\r\n }\r\n}\r\nfunction createInstruction(composer, instruction) {\r\n return Object.assign(instruction, {\r\n bindingContext: composer.bindingContext,\r\n overrideContext: composer.overrideContext,\r\n owningView: composer.owningView,\r\n container: composer.container,\r\n viewSlot: composer.viewSlot,\r\n viewResources: composer.viewResources,\r\n currentController: composer.currentController,\r\n host: composer.element,\r\n swapOrder: composer.swapOrder\r\n });\r\n}\r\nfunction processChanges(composer) {\r\n var changes = composer.changes;\r\n composer.changes = Object.create(null);\r\n var activationStrategy = determineActivationStrategy(composer);\r\n if (needsReInitialization(activationStrategy, changes)) {\r\n var currentViewModel = activationStrategy === ActivationStrategy.Replace ? null : composer.currentViewModel;\r\n var instruction = {\r\n view: composer.view,\r\n viewModel: currentViewModel || composer.viewModel,\r\n model: composer.model\r\n };\r\n instruction = Object.assign(instruction, changes);\r\n instruction = createInstruction(composer, instruction);\r\n composer.pendingTask = composer.compositionEngine.compose(instruction).then(function (controller) {\r\n composer.currentController = controller;\r\n composer.currentViewModel = controller ? controller.viewModel : null;\r\n });\r\n }\r\n else {\r\n composer.pendingTask = tryActivateViewModel(composer.currentViewModel, changes.model);\r\n if (!composer.pendingTask) {\r\n return;\r\n }\r\n }\r\n composer.pendingTask = composer.pendingTask\r\n .then(function () {\r\n completeCompositionTask(composer);\r\n }, function (reason) {\r\n completeCompositionTask(composer);\r\n throw reason;\r\n });\r\n}\r\nfunction completeCompositionTask(composer) {\r\n composer.pendingTask = null;\r\n if (!isEmpty(composer.changes)) {\r\n processChanges(composer);\r\n }\r\n}\r\nfunction requestUpdate(composer) {\r\n if (composer.pendingTask || composer.updateRequested) {\r\n return;\r\n }\r\n composer.updateRequested = true;\r\n composer.taskQueue.queueMicroTask(function () {\r\n composer.updateRequested = false;\r\n processChanges(composer);\r\n });\r\n}\r\nfunction determineActivationStrategy(composer) {\r\n var activationStrategy = composer.activationStrategy;\r\n var vm = composer.currentViewModel;\r\n if (vm && typeof vm.determineActivationStrategy === 'function') {\r\n activationStrategy = vm.determineActivationStrategy();\r\n }\r\n return activationStrategy;\r\n}\r\nfunction needsReInitialization(activationStrategy, changes) {\r\n return 'view' in changes\r\n || 'viewModel' in changes\r\n || activationStrategy === ActivationStrategy.Replace;\r\n}\n\nvar IfCore = (function () {\r\n function IfCore(viewFactory, viewSlot) {\r\n this.viewFactory = viewFactory;\r\n this.viewSlot = viewSlot;\r\n this.view = null;\r\n this.bindingContext = null;\r\n this.overrideContext = null;\r\n this.showing = false;\r\n this.cache = true;\r\n }\r\n IfCore.prototype.bind = function (bindingContext, overrideContext) {\r\n this.bindingContext = bindingContext;\r\n this.overrideContext = overrideContext;\r\n };\r\n IfCore.prototype.unbind = function () {\r\n if (this.view === null) {\r\n return;\r\n }\r\n this.view.unbind();\r\n if (!this.viewFactory.isCaching) {\r\n return;\r\n }\r\n if (this.showing) {\r\n this.showing = false;\r\n this.viewSlot.remove(this.view, true, true);\r\n }\r\n else {\r\n this.view.returnToCache();\r\n }\r\n this.view = null;\r\n };\r\n IfCore.prototype._show = function () {\r\n if (this.showing) {\r\n if (!this.view.isBound) {\r\n this.view.bind(this.bindingContext, this.overrideContext);\r\n }\r\n return;\r\n }\r\n if (this.view === null) {\r\n this.view = this.viewFactory.create();\r\n }\r\n if (!this.view.isBound) {\r\n this.view.bind(this.bindingContext, this.overrideContext);\r\n }\r\n this.showing = true;\r\n return this.viewSlot.add(this.view);\r\n };\r\n IfCore.prototype._hide = function () {\r\n var _this = this;\r\n if (!this.showing) {\r\n return;\r\n }\r\n this.showing = false;\r\n var removed = this.viewSlot.remove(this.view);\r\n if (removed instanceof Promise) {\r\n return removed.then(function () {\r\n _this._unbindView();\r\n });\r\n }\r\n this._unbindView();\r\n };\r\n IfCore.prototype._unbindView = function () {\r\n var cache = this.cache === 'false' ? false : !!this.cache;\r\n this.view.unbind();\r\n if (!cache) {\r\n this.view = null;\r\n }\r\n };\r\n return IfCore;\r\n}());\n\nvar If = (function (_super) {\r\n __extends(If, _super);\r\n function If() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.cache = true;\r\n return _this;\r\n }\r\n If.prototype.bind = function (bindingContext, overrideContext) {\r\n _super.prototype.bind.call(this, bindingContext, overrideContext);\r\n if (this.condition) {\r\n this._show();\r\n }\r\n else {\r\n this._hide();\r\n }\r\n };\r\n If.prototype.conditionChanged = function (newValue) {\r\n this._update(newValue);\r\n };\r\n If.prototype._update = function (show) {\r\n var _this = this;\r\n if (this.animating) {\r\n return;\r\n }\r\n var promise;\r\n if (this.elseVm) {\r\n promise = show ? this._swap(this.elseVm, this) : this._swap(this, this.elseVm);\r\n }\r\n else {\r\n promise = show ? this._show() : this._hide();\r\n }\r\n if (promise) {\r\n this.animating = true;\r\n promise.then(function () {\r\n _this.animating = false;\r\n if (_this.condition !== _this.showing) {\r\n _this._update(_this.condition);\r\n }\r\n });\r\n }\r\n };\r\n If.prototype._swap = function (remove, add) {\r\n switch (this.swapOrder) {\r\n case 'before':\r\n return Promise.resolve(add._show()).then(function () { return remove._hide(); });\r\n case 'with':\r\n return Promise.all([remove._hide(), add._show()]);\r\n default:\r\n var promise = remove._hide();\r\n return promise ? promise.then(function () { return add._show(); }) : add._show();\r\n }\r\n };\r\n __decorate([\r\n bindable({ primaryProperty: true })\r\n ], If.prototype, \"condition\", void 0);\r\n __decorate([\r\n bindable\r\n ], If.prototype, \"swapOrder\", void 0);\r\n __decorate([\r\n bindable\r\n ], If.prototype, \"cache\", void 0);\r\n If = __decorate([\r\n customAttribute('if'),\r\n templateController,\r\n inject(BoundViewFactory, ViewSlot)\r\n ], If);\r\n return If;\r\n}(IfCore));\n\nvar Else = (function (_super) {\r\n __extends(Else, _super);\r\n function Else(viewFactory, viewSlot) {\r\n var _this = _super.call(this, viewFactory, viewSlot) || this;\r\n _this._registerInIf();\r\n return _this;\r\n }\r\n Else.prototype.bind = function (bindingContext, overrideContext) {\r\n _super.prototype.bind.call(this, bindingContext, overrideContext);\r\n if (this.ifVm.condition) {\r\n this._hide();\r\n }\r\n else {\r\n this._show();\r\n }\r\n };\r\n Else.prototype._registerInIf = function () {\r\n var previous = this.viewSlot.anchor.previousSibling;\r\n while (previous && !previous.au) {\r\n previous = previous.previousSibling;\r\n }\r\n if (!previous || !previous.au.if) {\r\n throw new Error(\"Can't find matching If for Else custom attribute.\");\r\n }\r\n this.ifVm = previous.au.if.viewModel;\r\n this.ifVm.elseVm = this;\r\n };\r\n Else = __decorate([\r\n customAttribute('else'),\r\n templateController,\r\n inject(BoundViewFactory, ViewSlot)\r\n ], Else);\r\n return Else;\r\n}(IfCore));\n\nvar With = (function () {\r\n function With(viewFactory, viewSlot) {\r\n this.viewFactory = viewFactory;\r\n this.viewSlot = viewSlot;\r\n this.parentOverrideContext = null;\r\n this.view = null;\r\n }\r\n With.prototype.bind = function (bindingContext, overrideContext) {\r\n this.parentOverrideContext = overrideContext;\r\n this.valueChanged(this.value);\r\n };\r\n With.prototype.valueChanged = function (newValue) {\r\n var overrideContext = createOverrideContext(newValue, this.parentOverrideContext);\r\n var view = this.view;\r\n if (!view) {\r\n view = this.view = this.viewFactory.create();\r\n view.bind(newValue, overrideContext);\r\n this.viewSlot.add(view);\r\n }\r\n else {\r\n view.bind(newValue, overrideContext);\r\n }\r\n };\r\n With.prototype.unbind = function () {\r\n var view = this.view;\r\n this.parentOverrideContext = null;\r\n if (view) {\r\n view.unbind();\r\n }\r\n };\r\n With = __decorate([\r\n customAttribute('with'),\r\n templateController,\r\n inject(BoundViewFactory, ViewSlot)\r\n ], With);\r\n return With;\r\n}());\n\nvar oneTime = bindingMode.oneTime;\r\nfunction updateOverrideContexts(views, startIndex) {\r\n var length = views.length;\r\n if (startIndex > 0) {\r\n startIndex = startIndex - 1;\r\n }\r\n for (; startIndex < length; ++startIndex) {\r\n updateOverrideContext(views[startIndex].overrideContext, startIndex, length);\r\n }\r\n}\r\nfunction createFullOverrideContext(repeat, data, index, length, key) {\r\n var bindingContext = {};\r\n var overrideContext = createOverrideContext(bindingContext, repeat.scope.overrideContext);\r\n if (typeof key !== 'undefined') {\r\n bindingContext[repeat.key] = key;\r\n bindingContext[repeat.value] = data;\r\n }\r\n else {\r\n bindingContext[repeat.local] = data;\r\n }\r\n updateOverrideContext(overrideContext, index, length);\r\n return overrideContext;\r\n}\r\nfunction updateOverrideContext(overrideContext, index, length) {\r\n var first = (index === 0);\r\n var last = (index === length - 1);\r\n var even = index % 2 === 0;\r\n overrideContext.$index = index;\r\n overrideContext.$first = first;\r\n overrideContext.$last = last;\r\n overrideContext.$middle = !(first || last);\r\n overrideContext.$odd = !even;\r\n overrideContext.$even = even;\r\n}\r\nfunction getItemsSourceExpression(instruction, attrName) {\r\n return instruction.behaviorInstructions\r\n .filter(function (bi) { return bi.originalAttrName === attrName; })[0]\r\n .attributes\r\n .items\r\n .sourceExpression;\r\n}\r\nfunction unwrapExpression(expression) {\r\n var unwrapped = false;\r\n while (expression instanceof BindingBehavior) {\r\n expression = expression.expression;\r\n }\r\n while (expression instanceof ValueConverter) {\r\n expression = expression.expression;\r\n unwrapped = true;\r\n }\r\n return unwrapped ? expression : null;\r\n}\r\nfunction isOneTime(expression) {\r\n while (expression instanceof BindingBehavior) {\r\n if (expression.name === 'oneTime') {\r\n return true;\r\n }\r\n expression = expression.expression;\r\n }\r\n return false;\r\n}\r\nfunction updateOneTimeBinding(binding) {\r\n if (binding.call && binding.mode === oneTime) {\r\n binding.call(sourceContext);\r\n }\r\n else if (binding.updateOneTimeBindings) {\r\n binding.updateOneTimeBindings();\r\n }\r\n}\r\nfunction indexOf(array, item, matcher, startIndex) {\r\n if (!matcher) {\r\n return array.indexOf(item);\r\n }\r\n var length = array.length;\r\n for (var index = startIndex || 0; index < length; index++) {\r\n if (matcher(array[index], item)) {\r\n return index;\r\n }\r\n }\r\n return -1;\r\n}\n\nvar ArrayRepeatStrategy = (function () {\r\n function ArrayRepeatStrategy() {\r\n }\r\n ArrayRepeatStrategy.prototype.getCollectionObserver = function (observerLocator, items) {\r\n return observerLocator.getArrayObserver(items);\r\n };\r\n ArrayRepeatStrategy.prototype.instanceChanged = function (repeat, items) {\r\n var _this = this;\r\n var $repeat = repeat;\r\n var itemsLength = items.length;\r\n if (!items || itemsLength === 0) {\r\n $repeat.removeAllViews(true, !$repeat.viewsRequireLifecycle);\r\n return;\r\n }\r\n var children = $repeat.views();\r\n var viewsLength = children.length;\r\n if (viewsLength === 0) {\r\n this._standardProcessInstanceChanged($repeat, items);\r\n return;\r\n }\r\n if ($repeat.viewsRequireLifecycle) {\r\n var childrenSnapshot = children.slice(0);\r\n var itemNameInBindingContext = $repeat.local;\r\n var matcher_1 = $repeat.matcher();\r\n var itemsPreviouslyInViews_1 = [];\r\n var viewsToRemove = [];\r\n for (var index = 0; index < viewsLength; index++) {\r\n var view = childrenSnapshot[index];\r\n var oldItem = view.bindingContext[itemNameInBindingContext];\r\n if (indexOf(items, oldItem, matcher_1) === -1) {\r\n viewsToRemove.push(view);\r\n }\r\n else {\r\n itemsPreviouslyInViews_1.push(oldItem);\r\n }\r\n }\r\n var updateViews = void 0;\r\n var removePromise = void 0;\r\n if (itemsPreviouslyInViews_1.length > 0) {\r\n removePromise = $repeat.removeViews(viewsToRemove, true, !$repeat.viewsRequireLifecycle);\r\n updateViews = function () {\r\n for (var index = 0; index < itemsLength; index++) {\r\n var item = items[index];\r\n var indexOfView = indexOf(itemsPreviouslyInViews_1, item, matcher_1, index);\r\n var view = void 0;\r\n if (indexOfView === -1) {\r\n var overrideContext = createFullOverrideContext($repeat, items[index], index, itemsLength);\r\n $repeat.insertView(index, overrideContext.bindingContext, overrideContext);\r\n itemsPreviouslyInViews_1.splice(index, 0, undefined);\r\n }\r\n else if (indexOfView === index) {\r\n view = children[indexOfView];\r\n itemsPreviouslyInViews_1[indexOfView] = undefined;\r\n }\r\n else {\r\n view = children[indexOfView];\r\n $repeat.moveView(indexOfView, index);\r\n itemsPreviouslyInViews_1.splice(indexOfView, 1);\r\n itemsPreviouslyInViews_1.splice(index, 0, undefined);\r\n }\r\n if (view) {\r\n updateOverrideContext(view.overrideContext, index, itemsLength);\r\n }\r\n }\r\n _this._inPlaceProcessItems($repeat, items);\r\n };\r\n }\r\n else {\r\n removePromise = $repeat.removeAllViews(true, !$repeat.viewsRequireLifecycle);\r\n updateViews = function () { return _this._standardProcessInstanceChanged($repeat, items); };\r\n }\r\n if (removePromise instanceof Promise) {\r\n removePromise.then(updateViews);\r\n }\r\n else {\r\n updateViews();\r\n }\r\n }\r\n else {\r\n this._inPlaceProcessItems($repeat, items);\r\n }\r\n };\r\n ArrayRepeatStrategy.prototype._standardProcessInstanceChanged = function (repeat, items) {\r\n for (var i = 0, ii = items.length; i < ii; i++) {\r\n var overrideContext = createFullOverrideContext(repeat, items[i], i, ii);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n }\r\n };\r\n ArrayRepeatStrategy.prototype._inPlaceProcessItems = function (repeat, items) {\r\n var itemsLength = items.length;\r\n var viewsLength = repeat.viewCount();\r\n while (viewsLength > itemsLength) {\r\n viewsLength--;\r\n repeat.removeView(viewsLength, true, !repeat.viewsRequireLifecycle);\r\n }\r\n var local = repeat.local;\r\n for (var i = 0; i < viewsLength; i++) {\r\n var view = repeat.view(i);\r\n var last = i === itemsLength - 1;\r\n var middle = i !== 0 && !last;\r\n var bindingContext = view.bindingContext;\r\n var overrideContext = view.overrideContext;\r\n if (bindingContext[local] === items[i]\r\n && overrideContext.$middle === middle\r\n && overrideContext.$last === last) {\r\n continue;\r\n }\r\n bindingContext[local] = items[i];\r\n overrideContext.$middle = middle;\r\n overrideContext.$last = last;\r\n repeat.updateBindings(view);\r\n }\r\n for (var i = viewsLength; i < itemsLength; i++) {\r\n var overrideContext = createFullOverrideContext(repeat, items[i], i, itemsLength);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n }\r\n };\r\n ArrayRepeatStrategy.prototype.instanceMutated = function (repeat, array, splices) {\r\n var _this = this;\r\n if (repeat.__queuedSplices) {\r\n for (var i = 0, ii = splices.length; i < ii; ++i) {\r\n var _a = splices[i], index = _a.index, removed = _a.removed, addedCount = _a.addedCount;\r\n mergeSplice(repeat.__queuedSplices, index, removed, addedCount);\r\n }\r\n repeat.__array = array.slice(0);\r\n return;\r\n }\r\n var maybePromise = this._runSplices(repeat, array.slice(0), splices);\r\n if (maybePromise instanceof Promise) {\r\n var queuedSplices_1 = repeat.__queuedSplices = [];\r\n var runQueuedSplices_1 = function () {\r\n if (!queuedSplices_1.length) {\r\n repeat.__queuedSplices = undefined;\r\n repeat.__array = undefined;\r\n return;\r\n }\r\n var nextPromise = _this._runSplices(repeat, repeat.__array, queuedSplices_1) || Promise.resolve();\r\n queuedSplices_1 = repeat.__queuedSplices = [];\r\n nextPromise.then(runQueuedSplices_1);\r\n };\r\n maybePromise.then(runQueuedSplices_1);\r\n }\r\n };\r\n ArrayRepeatStrategy.prototype._runSplices = function (repeat, array, splices) {\r\n var _this = this;\r\n var removeDelta = 0;\r\n var rmPromises = [];\r\n for (var i = 0, ii = splices.length; i < ii; ++i) {\r\n var splice = splices[i];\r\n var removed = splice.removed;\r\n for (var j = 0, jj = removed.length; j < jj; ++j) {\r\n var viewOrPromise = repeat.removeView(splice.index + removeDelta + rmPromises.length, true);\r\n if (viewOrPromise instanceof Promise) {\r\n rmPromises.push(viewOrPromise);\r\n }\r\n }\r\n removeDelta -= splice.addedCount;\r\n }\r\n if (rmPromises.length > 0) {\r\n return Promise.all(rmPromises).then(function () {\r\n var spliceIndexLow = _this._handleAddedSplices(repeat, array, splices);\r\n updateOverrideContexts(repeat.views(), spliceIndexLow);\r\n });\r\n }\r\n var spliceIndexLow = this._handleAddedSplices(repeat, array, splices);\r\n updateOverrideContexts(repeat.views(), spliceIndexLow);\r\n return undefined;\r\n };\r\n ArrayRepeatStrategy.prototype._handleAddedSplices = function (repeat, array, splices) {\r\n var spliceIndex;\r\n var spliceIndexLow;\r\n var arrayLength = array.length;\r\n for (var i = 0, ii = splices.length; i < ii; ++i) {\r\n var splice = splices[i];\r\n var addIndex = spliceIndex = splice.index;\r\n var end = splice.index + splice.addedCount;\r\n if (typeof spliceIndexLow === 'undefined' || spliceIndexLow === null || spliceIndexLow > splice.index) {\r\n spliceIndexLow = spliceIndex;\r\n }\r\n for (; addIndex < end; ++addIndex) {\r\n var overrideContext = createFullOverrideContext(repeat, array[addIndex], addIndex, arrayLength);\r\n repeat.insertView(addIndex, overrideContext.bindingContext, overrideContext);\r\n }\r\n }\r\n return spliceIndexLow;\r\n };\r\n return ArrayRepeatStrategy;\r\n}());\n\nvar MapRepeatStrategy = (function () {\r\n function MapRepeatStrategy() {\r\n }\r\n MapRepeatStrategy.prototype.getCollectionObserver = function (observerLocator, items) {\r\n return observerLocator.getMapObserver(items);\r\n };\r\n MapRepeatStrategy.prototype.instanceChanged = function (repeat, items) {\r\n var _this = this;\r\n var removePromise = repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n if (removePromise instanceof Promise) {\r\n removePromise.then(function () { return _this._standardProcessItems(repeat, items); });\r\n return;\r\n }\r\n this._standardProcessItems(repeat, items);\r\n };\r\n MapRepeatStrategy.prototype._standardProcessItems = function (repeat, items) {\r\n var index = 0;\r\n var overrideContext;\r\n items.forEach(function (value, key) {\r\n overrideContext = createFullOverrideContext(repeat, value, index, items.size, key);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n ++index;\r\n });\r\n };\r\n MapRepeatStrategy.prototype.instanceMutated = function (repeat, map, records) {\r\n var key;\r\n var i;\r\n var ii;\r\n var overrideContext;\r\n var removeIndex;\r\n var addIndex;\r\n var record;\r\n var rmPromises = [];\r\n var viewOrPromise;\r\n for (i = 0, ii = records.length; i < ii; ++i) {\r\n record = records[i];\r\n key = record.key;\r\n switch (record.type) {\r\n case 'update':\r\n removeIndex = this._getViewIndexByKey(repeat, key);\r\n viewOrPromise = repeat.removeView(removeIndex, true, !repeat.viewsRequireLifecycle);\r\n if (viewOrPromise instanceof Promise) {\r\n rmPromises.push(viewOrPromise);\r\n }\r\n overrideContext = createFullOverrideContext(repeat, map.get(key), removeIndex, map.size, key);\r\n repeat.insertView(removeIndex, overrideContext.bindingContext, overrideContext);\r\n break;\r\n case 'add':\r\n addIndex = repeat.viewCount() <= map.size - 1 ? repeat.viewCount() : map.size - 1;\r\n overrideContext = createFullOverrideContext(repeat, map.get(key), addIndex, map.size, key);\r\n repeat.insertView(map.size - 1, overrideContext.bindingContext, overrideContext);\r\n break;\r\n case 'delete':\r\n if (record.oldValue === undefined) {\r\n return;\r\n }\r\n removeIndex = this._getViewIndexByKey(repeat, key);\r\n viewOrPromise = repeat.removeView(removeIndex, true, !repeat.viewsRequireLifecycle);\r\n if (viewOrPromise instanceof Promise) {\r\n rmPromises.push(viewOrPromise);\r\n }\r\n break;\r\n case 'clear':\r\n repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n break;\r\n default:\r\n continue;\r\n }\r\n }\r\n if (rmPromises.length > 0) {\r\n Promise.all(rmPromises).then(function () {\r\n updateOverrideContexts(repeat.views(), 0);\r\n });\r\n }\r\n else {\r\n updateOverrideContexts(repeat.views(), 0);\r\n }\r\n };\r\n MapRepeatStrategy.prototype._getViewIndexByKey = function (repeat, key) {\r\n var i;\r\n var ii;\r\n var child;\r\n for (i = 0, ii = repeat.viewCount(); i < ii; ++i) {\r\n child = repeat.view(i);\r\n if (child.bindingContext[repeat.key] === key) {\r\n return i;\r\n }\r\n }\r\n return undefined;\r\n };\r\n return MapRepeatStrategy;\r\n}());\n\nvar NullRepeatStrategy = (function () {\r\n function NullRepeatStrategy() {\r\n }\r\n NullRepeatStrategy.prototype.instanceChanged = function (repeat, items) {\r\n repeat.removeAllViews(true);\r\n };\r\n NullRepeatStrategy.prototype.getCollectionObserver = function (observerLocator, items) {\r\n };\r\n return NullRepeatStrategy;\r\n}());\n\nvar NumberRepeatStrategy = (function () {\r\n function NumberRepeatStrategy() {\r\n }\r\n NumberRepeatStrategy.prototype.getCollectionObserver = function () {\r\n return null;\r\n };\r\n NumberRepeatStrategy.prototype.instanceChanged = function (repeat, value) {\r\n var _this = this;\r\n var removePromise = repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n if (removePromise instanceof Promise) {\r\n removePromise.then(function () { return _this._standardProcessItems(repeat, value); });\r\n return;\r\n }\r\n this._standardProcessItems(repeat, value);\r\n };\r\n NumberRepeatStrategy.prototype._standardProcessItems = function (repeat, value) {\r\n var childrenLength = repeat.viewCount();\r\n var i;\r\n var ii;\r\n var overrideContext;\r\n var viewsToRemove;\r\n value = Math.floor(value);\r\n viewsToRemove = childrenLength - value;\r\n if (viewsToRemove > 0) {\r\n if (viewsToRemove > childrenLength) {\r\n viewsToRemove = childrenLength;\r\n }\r\n for (i = 0, ii = viewsToRemove; i < ii; ++i) {\r\n repeat.removeView(childrenLength - (i + 1), true, !repeat.viewsRequireLifecycle);\r\n }\r\n return;\r\n }\r\n for (i = childrenLength, ii = value; i < ii; ++i) {\r\n overrideContext = createFullOverrideContext(repeat, i, i, ii);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n }\r\n updateOverrideContexts(repeat.views(), 0);\r\n };\r\n return NumberRepeatStrategy;\r\n}());\n\nvar SetRepeatStrategy = (function () {\r\n function SetRepeatStrategy() {\r\n }\r\n SetRepeatStrategy.prototype.getCollectionObserver = function (observerLocator, items) {\r\n return observerLocator.getSetObserver(items);\r\n };\r\n SetRepeatStrategy.prototype.instanceChanged = function (repeat, items) {\r\n var _this = this;\r\n var removePromise = repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n if (removePromise instanceof Promise) {\r\n removePromise.then(function () { return _this._standardProcessItems(repeat, items); });\r\n return;\r\n }\r\n this._standardProcessItems(repeat, items);\r\n };\r\n SetRepeatStrategy.prototype._standardProcessItems = function (repeat, items) {\r\n var index = 0;\r\n var overrideContext;\r\n items.forEach(function (value) {\r\n overrideContext = createFullOverrideContext(repeat, value, index, items.size);\r\n repeat.addView(overrideContext.bindingContext, overrideContext);\r\n ++index;\r\n });\r\n };\r\n SetRepeatStrategy.prototype.instanceMutated = function (repeat, set, records) {\r\n var value;\r\n var i;\r\n var ii;\r\n var overrideContext;\r\n var removeIndex;\r\n var record;\r\n var rmPromises = [];\r\n var viewOrPromise;\r\n for (i = 0, ii = records.length; i < ii; ++i) {\r\n record = records[i];\r\n value = record.value;\r\n switch (record.type) {\r\n case 'add':\r\n var size = Math.max(set.size - 1, 0);\r\n overrideContext = createFullOverrideContext(repeat, value, size, set.size);\r\n repeat.insertView(size, overrideContext.bindingContext, overrideContext);\r\n break;\r\n case 'delete':\r\n removeIndex = this._getViewIndexByValue(repeat, value);\r\n viewOrPromise = repeat.removeView(removeIndex, true, !repeat.viewsRequireLifecycle);\r\n if (viewOrPromise instanceof Promise) {\r\n rmPromises.push(viewOrPromise);\r\n }\r\n break;\r\n case 'clear':\r\n repeat.removeAllViews(true, !repeat.viewsRequireLifecycle);\r\n break;\r\n default:\r\n continue;\r\n }\r\n }\r\n if (rmPromises.length > 0) {\r\n Promise.all(rmPromises).then(function () {\r\n updateOverrideContexts(repeat.views(), 0);\r\n });\r\n }\r\n else {\r\n updateOverrideContexts(repeat.views(), 0);\r\n }\r\n };\r\n SetRepeatStrategy.prototype._getViewIndexByValue = function (repeat, value) {\r\n var i;\r\n var ii;\r\n var child;\r\n for (i = 0, ii = repeat.viewCount(); i < ii; ++i) {\r\n child = repeat.view(i);\r\n if (child.bindingContext[repeat.local] === value) {\r\n return i;\r\n }\r\n }\r\n return undefined;\r\n };\r\n return SetRepeatStrategy;\r\n}());\n\nvar RepeatStrategyLocator = (function () {\r\n function RepeatStrategyLocator() {\r\n this.matchers = [];\r\n this.strategies = [];\r\n this.addStrategy(function (items) { return items === null || items === undefined; }, new NullRepeatStrategy());\r\n this.addStrategy(function (items) { return items instanceof Array; }, new ArrayRepeatStrategy());\r\n this.addStrategy(function (items) { return items instanceof Map; }, new MapRepeatStrategy());\r\n this.addStrategy(function (items) { return items instanceof Set; }, new SetRepeatStrategy());\r\n this.addStrategy(function (items) { return typeof items === 'number'; }, new NumberRepeatStrategy());\r\n }\r\n RepeatStrategyLocator.prototype.addStrategy = function (matcher, strategy) {\r\n this.matchers.push(matcher);\r\n this.strategies.push(strategy);\r\n };\r\n RepeatStrategyLocator.prototype.getStrategy = function (items) {\r\n var matchers = this.matchers;\r\n for (var i = 0, ii = matchers.length; i < ii; ++i) {\r\n if (matchers[i](items)) {\r\n return this.strategies[i];\r\n }\r\n }\r\n return null;\r\n };\r\n return RepeatStrategyLocator;\r\n}());\n\nvar lifecycleOptionalBehaviors = ['focus', 'if', 'else', 'repeat', 'show', 'hide', 'with'];\r\nfunction behaviorRequiresLifecycle(instruction) {\r\n var t = instruction.type;\r\n var name = t.elementName !== null ? t.elementName : t.attributeName;\r\n return lifecycleOptionalBehaviors.indexOf(name) === -1 && (t.handlesAttached || t.handlesBind || t.handlesCreated || t.handlesDetached || t.handlesUnbind)\r\n || t.viewFactory && viewsRequireLifecycle(t.viewFactory)\r\n || instruction.viewFactory && viewsRequireLifecycle(instruction.viewFactory);\r\n}\r\nfunction targetRequiresLifecycle(instruction) {\r\n var behaviors = instruction.behaviorInstructions;\r\n if (behaviors) {\r\n var i = behaviors.length;\r\n while (i--) {\r\n if (behaviorRequiresLifecycle(behaviors[i])) {\r\n return true;\r\n }\r\n }\r\n }\r\n return instruction.viewFactory && viewsRequireLifecycle(instruction.viewFactory);\r\n}\r\nfunction viewsRequireLifecycle(viewFactory) {\r\n if ('_viewsRequireLifecycle' in viewFactory) {\r\n return viewFactory._viewsRequireLifecycle;\r\n }\r\n viewFactory._viewsRequireLifecycle = false;\r\n if (viewFactory.viewFactory) {\r\n viewFactory._viewsRequireLifecycle = viewsRequireLifecycle(viewFactory.viewFactory);\r\n return viewFactory._viewsRequireLifecycle;\r\n }\r\n if (viewFactory.template.querySelector('.au-animate')) {\r\n viewFactory._viewsRequireLifecycle = true;\r\n return true;\r\n }\r\n for (var id in viewFactory.instructions) {\r\n if (targetRequiresLifecycle(viewFactory.instructions[id])) {\r\n viewFactory._viewsRequireLifecycle = true;\r\n return true;\r\n }\r\n }\r\n viewFactory._viewsRequireLifecycle = false;\r\n return false;\r\n}\n\nvar AbstractRepeater = (function () {\r\n function AbstractRepeater(options) {\r\n Object.assign(this, {\r\n local: 'items',\r\n viewsRequireLifecycle: true\r\n }, options);\r\n }\r\n AbstractRepeater.prototype.viewCount = function () {\r\n throw new Error('subclass must implement `viewCount`');\r\n };\r\n AbstractRepeater.prototype.views = function () {\r\n throw new Error('subclass must implement `views`');\r\n };\r\n AbstractRepeater.prototype.view = function (index) {\r\n throw new Error('subclass must implement `view`');\r\n };\r\n AbstractRepeater.prototype.matcher = function () {\r\n throw new Error('subclass must implement `matcher`');\r\n };\r\n AbstractRepeater.prototype.addView = function (bindingContext, overrideContext) {\r\n throw new Error('subclass must implement `addView`');\r\n };\r\n AbstractRepeater.prototype.insertView = function (index, bindingContext, overrideContext) {\r\n throw new Error('subclass must implement `insertView`');\r\n };\r\n AbstractRepeater.prototype.moveView = function (sourceIndex, targetIndex) {\r\n throw new Error('subclass must implement `moveView`');\r\n };\r\n AbstractRepeater.prototype.removeAllViews = function (returnToCache, skipAnimation) {\r\n throw new Error('subclass must implement `removeAllViews`');\r\n };\r\n AbstractRepeater.prototype.removeViews = function (viewsToRemove, returnToCache, skipAnimation) {\r\n throw new Error('subclass must implement `removeView`');\r\n };\r\n AbstractRepeater.prototype.removeView = function (index, returnToCache, skipAnimation) {\r\n throw new Error('subclass must implement `removeView`');\r\n };\r\n AbstractRepeater.prototype.updateBindings = function (view) {\r\n throw new Error('subclass must implement `updateBindings`');\r\n };\r\n return AbstractRepeater;\r\n}());\n\nvar matcherExtractionMarker = '__marker_extracted__';\r\nvar Repeat = (function (_super) {\r\n __extends(Repeat, _super);\r\n function Repeat(viewFactory, instruction, viewSlot, viewResources, observerLocator, strategyLocator) {\r\n var _this = _super.call(this, {\r\n local: 'item',\r\n viewsRequireLifecycle: viewsRequireLifecycle(viewFactory)\r\n }) || this;\r\n _this.viewFactory = viewFactory;\r\n _this.instruction = instruction;\r\n _this.viewSlot = viewSlot;\r\n _this.lookupFunctions = viewResources.lookupFunctions;\r\n _this.observerLocator = observerLocator;\r\n _this.key = 'key';\r\n _this.value = 'value';\r\n _this.strategyLocator = strategyLocator;\r\n _this.ignoreMutation = false;\r\n _this.sourceExpression = getItemsSourceExpression(_this.instruction, 'repeat.for');\r\n _this.isOneTime = isOneTime(_this.sourceExpression);\r\n _this.viewsRequireLifecycle = viewsRequireLifecycle(viewFactory);\r\n return _this;\r\n }\r\n Repeat_1 = Repeat;\r\n Repeat.prototype.call = function (context, changes) {\r\n this[context](this.items, changes);\r\n };\r\n Repeat.prototype.bind = function (bindingContext, overrideContext) {\r\n this.scope = { bindingContext: bindingContext, overrideContext: overrideContext };\r\n var instruction = this.instruction;\r\n if (!(matcherExtractionMarker in instruction)) {\r\n instruction[matcherExtractionMarker] = this._captureAndRemoveMatcherBinding();\r\n }\r\n this.matcherBinding = instruction[matcherExtractionMarker];\r\n this.itemsChanged();\r\n };\r\n Repeat.prototype.unbind = function () {\r\n this.scope = null;\r\n this.items = null;\r\n this.matcherBinding = null;\r\n this.viewSlot.removeAll(true, true);\r\n this._unsubscribeCollection();\r\n };\r\n Repeat.prototype._unsubscribeCollection = function () {\r\n if (this.collectionObserver) {\r\n this.collectionObserver.unsubscribe(this.callContext, this);\r\n this.collectionObserver = null;\r\n this.callContext = null;\r\n }\r\n };\r\n Repeat.prototype.itemsChanged = function () {\r\n var _this = this;\r\n this._unsubscribeCollection();\r\n if (!this.scope) {\r\n return;\r\n }\r\n var items = this.items;\r\n this.strategy = this.strategyLocator.getStrategy(items);\r\n if (!this.strategy) {\r\n throw new Error(\"Value for '\".concat(this.sourceExpression, \"' is non-repeatable\"));\r\n }\r\n if (!this.isOneTime && !this._observeInnerCollection()) {\r\n this._observeCollection();\r\n }\r\n this.ignoreMutation = true;\r\n this.strategy.instanceChanged(this, items);\r\n this.observerLocator.taskQueue.queueMicroTask(function () {\r\n _this.ignoreMutation = false;\r\n });\r\n };\r\n Repeat.prototype._getInnerCollection = function () {\r\n var expression = unwrapExpression(this.sourceExpression);\r\n if (!expression) {\r\n return null;\r\n }\r\n return expression.evaluate(this.scope, null);\r\n };\r\n Repeat.prototype.handleCollectionMutated = function (collection, changes) {\r\n if (!this.collectionObserver) {\r\n return;\r\n }\r\n if (this.ignoreMutation) {\r\n return;\r\n }\r\n this.strategy.instanceMutated(this, collection, changes);\r\n };\r\n Repeat.prototype.handleInnerCollectionMutated = function (collection, changes) {\r\n var _this = this;\r\n if (!this.collectionObserver) {\r\n return;\r\n }\r\n if (this.ignoreMutation) {\r\n return;\r\n }\r\n this.ignoreMutation = true;\r\n var newItems = this.sourceExpression.evaluate(this.scope, this.lookupFunctions);\r\n this.observerLocator.taskQueue.queueMicroTask(function () { return _this.ignoreMutation = false; });\r\n if (newItems === this.items) {\r\n this.itemsChanged();\r\n }\r\n else {\r\n this.items = newItems;\r\n }\r\n };\r\n Repeat.prototype._observeInnerCollection = function () {\r\n var items = this._getInnerCollection();\r\n var strategy = this.strategyLocator.getStrategy(items);\r\n if (!strategy) {\r\n return false;\r\n }\r\n this.collectionObserver = strategy.getCollectionObserver(this.observerLocator, items);\r\n if (!this.collectionObserver) {\r\n return false;\r\n }\r\n this.callContext = 'handleInnerCollectionMutated';\r\n this.collectionObserver.subscribe(this.callContext, this);\r\n return true;\r\n };\r\n Repeat.prototype._observeCollection = function () {\r\n var items = this.items;\r\n this.collectionObserver = this.strategy.getCollectionObserver(this.observerLocator, items);\r\n if (this.collectionObserver) {\r\n this.callContext = 'handleCollectionMutated';\r\n this.collectionObserver.subscribe(this.callContext, this);\r\n }\r\n };\r\n Repeat.prototype._captureAndRemoveMatcherBinding = function () {\r\n var viewFactory = this.viewFactory.viewFactory;\r\n if (viewFactory) {\r\n var template = viewFactory.template;\r\n var instructions = viewFactory.instructions;\r\n if (Repeat_1.useInnerMatcher) {\r\n return extractMatcherBindingExpression(instructions);\r\n }\r\n if (getChildrenCount(template) > 1) {\r\n return undefined;\r\n }\r\n var repeatedElement = getFirstElementChild(template);\r\n if (!repeatedElement.hasAttribute('au-target-id')) {\r\n return undefined;\r\n }\r\n var repeatedElementTargetId = repeatedElement.getAttribute('au-target-id');\r\n return extractMatcherBindingExpression(instructions, repeatedElementTargetId);\r\n }\r\n return undefined;\r\n };\r\n Repeat.prototype.viewCount = function () { return this.viewSlot.children.length; };\r\n Repeat.prototype.views = function () { return this.viewSlot.children; };\r\n Repeat.prototype.view = function (index) { return this.viewSlot.children[index]; };\r\n Repeat.prototype.matcher = function () {\r\n var matcherBinding = this.matcherBinding;\r\n return matcherBinding\r\n ? matcherBinding.sourceExpression.evaluate(this.scope, matcherBinding.lookupFunctions)\r\n : null;\r\n };\r\n Repeat.prototype.addView = function (bindingContext, overrideContext) {\r\n var view = this.viewFactory.create();\r\n view.bind(bindingContext, overrideContext);\r\n this.viewSlot.add(view);\r\n };\r\n Repeat.prototype.insertView = function (index, bindingContext, overrideContext) {\r\n var view = this.viewFactory.create();\r\n view.bind(bindingContext, overrideContext);\r\n this.viewSlot.insert(index, view);\r\n };\r\n Repeat.prototype.moveView = function (sourceIndex, targetIndex) {\r\n this.viewSlot.move(sourceIndex, targetIndex);\r\n };\r\n Repeat.prototype.removeAllViews = function (returnToCache, skipAnimation) {\r\n return this.viewSlot.removeAll(returnToCache, skipAnimation);\r\n };\r\n Repeat.prototype.removeViews = function (viewsToRemove, returnToCache, skipAnimation) {\r\n return this.viewSlot.removeMany(viewsToRemove, returnToCache, skipAnimation);\r\n };\r\n Repeat.prototype.removeView = function (index, returnToCache, skipAnimation) {\r\n return this.viewSlot.removeAt(index, returnToCache, skipAnimation);\r\n };\r\n Repeat.prototype.updateBindings = function (view) {\r\n var $view = view;\r\n var j = $view.bindings.length;\r\n while (j--) {\r\n updateOneTimeBinding($view.bindings[j]);\r\n }\r\n j = $view.controllers.length;\r\n while (j--) {\r\n var k = $view.controllers[j].boundProperties.length;\r\n while (k--) {\r\n var binding = $view.controllers[j].boundProperties[k].binding;\r\n updateOneTimeBinding(binding);\r\n }\r\n }\r\n };\r\n var Repeat_1;\r\n Repeat.useInnerMatcher = true;\r\n __decorate([\r\n bindable\r\n ], Repeat.prototype, \"items\", void 0);\r\n __decorate([\r\n bindable\r\n ], Repeat.prototype, \"local\", void 0);\r\n __decorate([\r\n bindable\r\n ], Repeat.prototype, \"key\", void 0);\r\n __decorate([\r\n bindable\r\n ], Repeat.prototype, \"value\", void 0);\r\n Repeat = Repeat_1 = __decorate([\r\n customAttribute('repeat'),\r\n templateController,\r\n inject(BoundViewFactory, TargetInstruction, ViewSlot, ViewResources, ObserverLocator, RepeatStrategyLocator)\r\n ], Repeat);\r\n return Repeat;\r\n}(AbstractRepeater));\r\nvar extractMatcherBindingExpression = function (instructions, targetedElementId) {\r\n var instructionIds = Object.keys(instructions);\r\n for (var i = 0; i < instructionIds.length; i++) {\r\n var instructionId = instructionIds[i];\r\n if (targetedElementId !== undefined && instructionId !== targetedElementId) {\r\n continue;\r\n }\r\n var expressions = instructions[instructionId].expressions;\r\n if (expressions) {\r\n for (var ii = 0; ii < expressions.length; ii++) {\r\n if (expressions[ii].targetProperty === 'matcher') {\r\n var matcherBindingExpression = expressions[ii];\r\n expressions.splice(ii, 1);\r\n return matcherBindingExpression;\r\n }\r\n }\r\n }\r\n }\r\n};\r\nvar getChildrenCount = function (el) {\r\n var childNodes = el.childNodes;\r\n var count = 0;\r\n for (var i = 0, ii = childNodes.length; ii > i; ++i) {\r\n if (childNodes[i].nodeType === 1) {\r\n ++count;\r\n }\r\n }\r\n return count;\r\n};\r\nvar getFirstElementChild = function (el) {\r\n var firstChild = el.firstChild;\r\n while (firstChild !== null) {\r\n if (firstChild.nodeType === 1) {\r\n return firstChild;\r\n }\r\n firstChild = firstChild.nextSibling;\r\n }\r\n return null;\r\n};\n\nvar aureliaHideClassName = 'aurelia-hide';\r\nvar aureliaHideClass = \".\".concat(aureliaHideClassName, \" { display:none !important; }\");\r\nfunction injectAureliaHideStyleAtHead() {\r\n DOM.injectStyles(aureliaHideClass);\r\n}\r\nfunction injectAureliaHideStyleAtBoundary(domBoundary) {\r\n if (FEATURE.shadowDOM && domBoundary && !domBoundary.hasAureliaHideStyle) {\r\n domBoundary.hasAureliaHideStyle = true;\r\n DOM.injectStyles(aureliaHideClass, domBoundary);\r\n }\r\n}\n\nvar Show = (function () {\r\n function Show(element, animator, domBoundary) {\r\n this.element = element;\r\n this.animator = animator;\r\n this.domBoundary = domBoundary;\r\n }\r\n Show.inject = function () {\r\n return [DOM.Element, Animator, Optional.of(DOM.boundary, true)];\r\n };\r\n Show.prototype.created = function () {\r\n injectAureliaHideStyleAtBoundary(this.domBoundary);\r\n };\r\n Show.prototype.valueChanged = function (newValue) {\r\n var element = this.element;\r\n var animator = this.animator;\r\n if (newValue) {\r\n animator.removeClass(element, aureliaHideClassName);\r\n }\r\n else {\r\n animator.addClass(element, aureliaHideClassName);\r\n }\r\n };\r\n Show.prototype.bind = function (bindingContext) {\r\n this.valueChanged(this.value);\r\n };\r\n Show = __decorate([\r\n customAttribute('show')\r\n ], Show);\r\n return Show;\r\n}());\n\nvar Hide = (function () {\r\n function Hide(element, animator, domBoundary) {\r\n this.element = element;\r\n this.animator = animator;\r\n this.domBoundary = domBoundary;\r\n }\r\n Hide.inject = function () {\r\n return [DOM.Element, Animator, Optional.of(DOM.boundary, true)];\r\n };\r\n Hide.prototype.created = function () {\r\n injectAureliaHideStyleAtBoundary(this.domBoundary);\r\n };\r\n Hide.prototype.valueChanged = function (newValue) {\r\n if (newValue) {\r\n this.animator.addClass(this.element, aureliaHideClassName);\r\n }\r\n else {\r\n this.animator.removeClass(this.element, aureliaHideClassName);\r\n }\r\n };\r\n Hide.prototype.bind = function (bindingContext) {\r\n this.valueChanged(this.value);\r\n };\r\n Hide.prototype.value = function (value) {\r\n throw new Error('Method not implemented.');\r\n };\r\n Hide = __decorate([\r\n customAttribute('hide')\r\n ], Hide);\r\n return Hide;\r\n}());\n\nvar HTMLSanitizer = (function () {\r\n function HTMLSanitizer() {\r\n }\r\n HTMLSanitizer.prototype.sanitize = function (input) {\r\n throw new Error(\"To protect the application against a wide variety of sophisticated XSS attacks.\\nPlease see https://aurelia.io/docs/binding/basics#element-content for instructions on how to use a secure solution like DOMPurify or sanitize-html.\");\r\n };\r\n return HTMLSanitizer;\r\n}());\n\nvar SanitizeHTMLValueConverter = (function () {\r\n function SanitizeHTMLValueConverter(sanitizer) {\r\n this.sanitizer = sanitizer;\r\n }\r\n SanitizeHTMLValueConverter.prototype.toView = function (untrustedMarkup) {\r\n if (untrustedMarkup === null || untrustedMarkup === undefined) {\r\n return null;\r\n }\r\n return this.sanitizer.sanitize(untrustedMarkup);\r\n };\r\n SanitizeHTMLValueConverter = __decorate([\r\n valueConverter('sanitizeHTML'),\r\n inject(HTMLSanitizer)\r\n ], SanitizeHTMLValueConverter);\r\n return SanitizeHTMLValueConverter;\r\n}());\n\nvar Replaceable = (function () {\r\n function Replaceable(viewFactory, viewSlot) {\r\n this.viewFactory = viewFactory;\r\n this.viewSlot = viewSlot;\r\n this.view = null;\r\n }\r\n Replaceable.prototype.bind = function (bindingContext, overrideContext) {\r\n if (this.view === null) {\r\n this.view = this.viewFactory.create();\r\n this.viewSlot.add(this.view);\r\n }\r\n this.view.bind(bindingContext, overrideContext);\r\n };\r\n Replaceable.prototype.unbind = function () {\r\n this.view.unbind();\r\n };\r\n Replaceable = __decorate([\r\n customAttribute('replaceable'),\r\n templateController,\r\n inject(BoundViewFactory, ViewSlot)\r\n ], Replaceable);\r\n return Replaceable;\r\n}());\n\nvar Focus = (function () {\r\n function Focus(element, taskQueue) {\r\n this.element = element;\r\n this.taskQueue = taskQueue;\r\n this.isAttached = false;\r\n this.needsApply = false;\r\n }\r\n Focus.inject = function () {\r\n return [DOM.Element, TaskQueue];\r\n };\r\n Focus.prototype.valueChanged = function () {\r\n if (this.isAttached) {\r\n this._apply();\r\n }\r\n else {\r\n this.needsApply = true;\r\n }\r\n };\r\n Focus.prototype._apply = function () {\r\n var _this = this;\r\n if (this.value) {\r\n this.taskQueue.queueMicroTask(function () {\r\n if (_this.value) {\r\n _this.element.focus();\r\n }\r\n });\r\n }\r\n else {\r\n this.element.blur();\r\n }\r\n };\r\n Focus.prototype.attached = function () {\r\n this.isAttached = true;\r\n if (this.needsApply) {\r\n this.needsApply = false;\r\n this._apply();\r\n }\r\n this.element.addEventListener('focus', this);\r\n this.element.addEventListener('blur', this);\r\n };\r\n Focus.prototype.detached = function () {\r\n this.isAttached = false;\r\n this.element.removeEventListener('focus', this);\r\n this.element.removeEventListener('blur', this);\r\n };\r\n Focus.prototype.handleEvent = function (e) {\r\n if (e.type === 'focus') {\r\n this.value = true;\r\n }\r\n else if (DOM.activeElement !== this.element) {\r\n this.value = false;\r\n }\r\n };\r\n Focus = __decorate([\r\n customAttribute('focus', bindingMode.twoWay)\r\n ], Focus);\r\n return Focus;\r\n}());\n\nvar cssUrlMatcher = /url\\((?!['\"]data)([^)]+)\\)/gi;\r\nfunction fixupCSSUrls(address, css) {\r\n if (typeof css !== 'string') {\r\n throw new Error(\"Failed loading required CSS file: \".concat(address));\r\n }\r\n return css.replace(cssUrlMatcher, function (match, p1) {\r\n var quote = p1.charAt(0);\r\n if (quote === '\\'' || quote === '\"') {\r\n p1 = p1.substr(1, p1.length - 2);\r\n }\r\n return 'url(\\'' + relativeToFile(p1, address) + '\\')';\r\n });\r\n}\r\nvar CSSResource = (function () {\r\n function CSSResource(address) {\r\n this.address = address;\r\n this._scoped = null;\r\n this._global = false;\r\n this._alreadyGloballyInjected = false;\r\n }\r\n CSSResource.prototype.initialize = function (container, Target) {\r\n this._scoped = new Target(this);\r\n };\r\n CSSResource.prototype.register = function (registry, name) {\r\n if (name === 'scoped') {\r\n registry.registerViewEngineHooks(this._scoped);\r\n }\r\n else {\r\n this._global = true;\r\n }\r\n };\r\n CSSResource.prototype.load = function (container) {\r\n var _this = this;\r\n return container.get(Loader)\r\n .loadText(this.address)\r\n .catch(function () { return null; })\r\n .then(function (text) {\r\n text = fixupCSSUrls(_this.address, text);\r\n _this._scoped.css = text;\r\n if (_this._global) {\r\n _this._alreadyGloballyInjected = true;\r\n DOM.injectStyles(text);\r\n }\r\n return _this;\r\n });\r\n };\r\n return CSSResource;\r\n}());\r\nvar CSSViewEngineHooks = (function () {\r\n function CSSViewEngineHooks(owner) {\r\n this.owner = owner;\r\n this.css = null;\r\n }\r\n CSSViewEngineHooks.prototype.beforeCompile = function (content, resources, instruction) {\r\n if (instruction.targetShadowDOM) {\r\n DOM.injectStyles(this.css, content, true);\r\n }\r\n else if (FEATURE.scopedCSS) {\r\n var styleNode = DOM.injectStyles(this.css, content, true);\r\n styleNode.setAttribute('scoped', 'scoped');\r\n }\r\n else if (this._global && !this.owner._alreadyGloballyInjected) {\r\n DOM.injectStyles(this.css);\r\n this.owner._alreadyGloballyInjected = true;\r\n }\r\n };\r\n return CSSViewEngineHooks;\r\n}());\r\nfunction _createCSSResource(address) {\r\n var ViewCSS = (function (_super) {\r\n __extends(ViewCSS, _super);\r\n function ViewCSS() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ViewCSS = __decorate([\r\n resource(new CSSResource(address))\r\n ], ViewCSS);\r\n return ViewCSS;\r\n }(CSSViewEngineHooks));\r\n return ViewCSS;\r\n}\n\nvar AttrBindingBehavior = (function () {\r\n function AttrBindingBehavior() {\r\n }\r\n AttrBindingBehavior.prototype.bind = function (binding, source) {\r\n binding.targetObserver = new DataAttributeObserver(binding.target, binding.targetProperty);\r\n };\r\n AttrBindingBehavior.prototype.unbind = function (binding, source) {\r\n };\r\n AttrBindingBehavior = __decorate([\r\n bindingBehavior('attr')\r\n ], AttrBindingBehavior);\r\n return AttrBindingBehavior;\r\n}());\n\nvar modeBindingBehavior = {\r\n bind: function (binding, source, lookupFunctions) {\r\n binding.originalMode = binding.mode;\r\n binding.mode = this.mode;\r\n },\r\n unbind: function (binding, source) {\r\n binding.mode = binding.originalMode;\r\n binding.originalMode = null;\r\n }\r\n};\r\nvar OneTimeBindingBehavior = (function () {\r\n function OneTimeBindingBehavior() {\r\n this.mode = bindingMode.oneTime;\r\n }\r\n OneTimeBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('oneTime')\r\n ], OneTimeBindingBehavior);\r\n return OneTimeBindingBehavior;\r\n}());\r\nvar OneWayBindingBehavior = (function () {\r\n function OneWayBindingBehavior() {\r\n this.mode = bindingMode.toView;\r\n }\r\n OneWayBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('oneWay')\r\n ], OneWayBindingBehavior);\r\n return OneWayBindingBehavior;\r\n}());\r\nvar ToViewBindingBehavior = (function () {\r\n function ToViewBindingBehavior() {\r\n this.mode = bindingMode.toView;\r\n }\r\n ToViewBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('toView')\r\n ], ToViewBindingBehavior);\r\n return ToViewBindingBehavior;\r\n}());\r\nvar FromViewBindingBehavior = (function () {\r\n function FromViewBindingBehavior() {\r\n this.mode = bindingMode.fromView;\r\n }\r\n FromViewBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('fromView')\r\n ], FromViewBindingBehavior);\r\n return FromViewBindingBehavior;\r\n}());\r\nvar TwoWayBindingBehavior = (function () {\r\n function TwoWayBindingBehavior() {\r\n this.mode = bindingMode.twoWay;\r\n }\r\n TwoWayBindingBehavior = __decorate([\r\n mixin(modeBindingBehavior),\r\n bindingBehavior('twoWay')\r\n ], TwoWayBindingBehavior);\r\n return TwoWayBindingBehavior;\r\n}());\n\nfunction throttle(newValue) {\r\n var _this = this;\r\n var state = this.throttleState;\r\n var elapsed = +new Date() - state.last;\r\n if (elapsed >= state.delay) {\r\n clearTimeout(state.timeoutId);\r\n state.timeoutId = null;\r\n state.last = +new Date();\r\n this.throttledMethod(newValue);\r\n return;\r\n }\r\n state.newValue = newValue;\r\n if (state.timeoutId === null) {\r\n state.timeoutId = setTimeout(function () {\r\n state.timeoutId = null;\r\n state.last = +new Date();\r\n _this.throttledMethod(state.newValue);\r\n }, state.delay - elapsed);\r\n }\r\n}\r\nvar ThrottleBindingBehavior = (function () {\r\n function ThrottleBindingBehavior() {\r\n }\r\n ThrottleBindingBehavior.prototype.bind = function (binding, source, delay) {\r\n if (delay === void 0) { delay = 200; }\r\n var methodToThrottle = 'updateTarget';\r\n if (binding.callSource) {\r\n methodToThrottle = 'callSource';\r\n }\r\n else if (binding.updateSource && binding.mode === bindingMode.twoWay) {\r\n methodToThrottle = 'updateSource';\r\n }\r\n binding.throttledMethod = binding[methodToThrottle];\r\n binding.throttledMethod.originalName = methodToThrottle;\r\n binding[methodToThrottle] = throttle;\r\n binding.throttleState = {\r\n delay: delay,\r\n last: 0,\r\n timeoutId: null\r\n };\r\n };\r\n ThrottleBindingBehavior.prototype.unbind = function (binding, source) {\r\n var methodToRestore = binding.throttledMethod.originalName;\r\n binding[methodToRestore] = binding.throttledMethod;\r\n binding.throttledMethod = null;\r\n clearTimeout(binding.throttleState.timeoutId);\r\n binding.throttleState = null;\r\n };\r\n ThrottleBindingBehavior = __decorate([\r\n bindingBehavior('throttle')\r\n ], ThrottleBindingBehavior);\r\n return ThrottleBindingBehavior;\r\n}());\n\nvar unset = {};\r\nfunction debounceCallSource(event) {\r\n var _this = this;\r\n var state = this.debounceState;\r\n clearTimeout(state.timeoutId);\r\n state.timeoutId = setTimeout(function () { return _this.debouncedMethod(event); }, state.delay);\r\n}\r\nfunction debounceCall(context, newValue, oldValue) {\r\n var _this = this;\r\n var state = this.debounceState;\r\n clearTimeout(state.timeoutId);\r\n if (context !== state.callContextToDebounce) {\r\n state.oldValue = unset;\r\n this.debouncedMethod(context, newValue, oldValue);\r\n return;\r\n }\r\n if (state.oldValue === unset) {\r\n state.oldValue = oldValue;\r\n }\r\n state.timeoutId = setTimeout(function () {\r\n var _oldValue = state.oldValue;\r\n state.oldValue = unset;\r\n _this.debouncedMethod(context, newValue, _oldValue);\r\n }, state.delay);\r\n}\r\nvar DebounceBindingBehavior = (function () {\r\n function DebounceBindingBehavior() {\r\n }\r\n DebounceBindingBehavior.prototype.bind = function (binding, source, delay) {\r\n if (delay === void 0) { delay = 200; }\r\n var isCallSource = binding.callSource !== undefined;\r\n var methodToDebounce = isCallSource ? 'callSource' : 'call';\r\n var debouncer = isCallSource ? debounceCallSource : debounceCall;\r\n var mode = binding.mode;\r\n var callContextToDebounce = mode === bindingMode.twoWay || mode === bindingMode.fromView ? targetContext : sourceContext;\r\n binding.debouncedMethod = binding[methodToDebounce];\r\n binding.debouncedMethod.originalName = methodToDebounce;\r\n binding[methodToDebounce] = debouncer;\r\n binding.debounceState = {\r\n callContextToDebounce: callContextToDebounce,\r\n delay: delay,\r\n timeoutId: 0,\r\n oldValue: unset\r\n };\r\n };\r\n DebounceBindingBehavior.prototype.unbind = function (binding, source) {\r\n var methodToRestore = binding.debouncedMethod.originalName;\r\n binding[methodToRestore] = binding.debouncedMethod;\r\n binding.debouncedMethod = null;\r\n clearTimeout(binding.debounceState.timeoutId);\r\n binding.debounceState = null;\r\n };\r\n DebounceBindingBehavior = __decorate([\r\n bindingBehavior('debounce')\r\n ], DebounceBindingBehavior);\r\n return DebounceBindingBehavior;\r\n}());\n\nfunction findOriginalEventTarget(event) {\r\n return (event.path && event.path[0]) || (event.deepPath && event.deepPath[0]) || event.target;\r\n}\r\nfunction handleSelfEvent(event) {\r\n var target = findOriginalEventTarget(event);\r\n if (this.target !== target) {\r\n return;\r\n }\r\n this.selfEventCallSource(event);\r\n}\r\nvar SelfBindingBehavior = (function () {\r\n function SelfBindingBehavior() {\r\n }\r\n SelfBindingBehavior.prototype.bind = function (binding, source) {\r\n if (!binding.callSource || !binding.targetEvent) {\r\n throw new Error('Self binding behavior only supports event.');\r\n }\r\n binding.selfEventCallSource = binding.callSource;\r\n binding.callSource = handleSelfEvent;\r\n };\r\n SelfBindingBehavior.prototype.unbind = function (binding, source) {\r\n binding.callSource = binding.selfEventCallSource;\r\n binding.selfEventCallSource = null;\r\n };\r\n SelfBindingBehavior = __decorate([\r\n bindingBehavior('self')\r\n ], SelfBindingBehavior);\r\n return SelfBindingBehavior;\r\n}());\n\nvar BindingSignaler = (function () {\r\n function BindingSignaler() {\r\n this.signals = {};\r\n }\r\n BindingSignaler.prototype.signal = function (name) {\r\n var bindings = this.signals[name];\r\n if (!bindings) {\r\n return;\r\n }\r\n var i = bindings.length;\r\n while (i--) {\r\n bindings[i].call(sourceContext);\r\n }\r\n };\r\n return BindingSignaler;\r\n}());\n\nvar SignalBindingBehavior = (function () {\r\n function SignalBindingBehavior(bindingSignaler) {\r\n this.signals = bindingSignaler.signals;\r\n }\r\n SignalBindingBehavior.inject = function () { return [BindingSignaler]; };\r\n SignalBindingBehavior.prototype.bind = function (binding, source) {\r\n var names = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n names[_i - 2] = arguments[_i];\r\n }\r\n if (!binding.updateTarget) {\r\n throw new Error('Only property bindings and string interpolation bindings can be signaled. Trigger, delegate and call bindings cannot be signaled.');\r\n }\r\n var signals = this.signals;\r\n if (names.length === 1) {\r\n var name_1 = names[0];\r\n var bindings = signals[name_1] || (signals[name_1] = []);\r\n bindings.push(binding);\r\n binding.signalName = name_1;\r\n }\r\n else if (names.length > 1) {\r\n var i = names.length;\r\n while (i--) {\r\n var name_2 = names[i];\r\n var bindings = signals[name_2] || (signals[name_2] = []);\r\n bindings.push(binding);\r\n }\r\n binding.signalName = names;\r\n }\r\n else {\r\n throw new Error('Signal name is required.');\r\n }\r\n };\r\n SignalBindingBehavior.prototype.unbind = function (binding, source) {\r\n var signals = this.signals;\r\n var name = binding.signalName;\r\n binding.signalName = null;\r\n if (Array.isArray(name)) {\r\n var names = name;\r\n var i = names.length;\r\n while (i--) {\r\n var n = names[i];\r\n var bindings = signals[n];\r\n bindings.splice(bindings.indexOf(binding), 1);\r\n }\r\n }\r\n else {\r\n var bindings = signals[name];\r\n bindings.splice(bindings.indexOf(binding), 1);\r\n }\r\n };\r\n SignalBindingBehavior = __decorate([\r\n bindingBehavior('signal')\r\n ], SignalBindingBehavior);\r\n return SignalBindingBehavior;\r\n}());\n\nvar eventNamesRequired = 'The updateTrigger binding behavior requires at least one event name argument: eg ';\r\nvar notApplicableMessage = 'The updateTrigger binding behavior can only be applied to two-way/ from-view bindings on input/select elements.';\r\nvar UpdateTriggerBindingBehavior = (function () {\r\n function UpdateTriggerBindingBehavior() {\r\n }\r\n UpdateTriggerBindingBehavior.prototype.bind = function (binding, source) {\r\n var events = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n events[_i - 2] = arguments[_i];\r\n }\r\n if (events.length === 0) {\r\n throw new Error(eventNamesRequired);\r\n }\r\n if (binding.mode !== bindingMode.twoWay && binding.mode !== bindingMode.fromView) {\r\n throw new Error(notApplicableMessage);\r\n }\r\n var targetObserver = binding.observerLocator.getObserver(binding.target, binding.targetProperty);\r\n if (!targetObserver.handler) {\r\n throw new Error(notApplicableMessage);\r\n }\r\n binding.targetObserver = targetObserver;\r\n targetObserver.originalHandler = binding.targetObserver.handler;\r\n var handler = new EventSubscriber(events);\r\n targetObserver.handler = handler;\r\n };\r\n UpdateTriggerBindingBehavior.prototype.unbind = function (binding, source) {\r\n var targetObserver = binding.targetObserver;\r\n targetObserver.handler.dispose();\r\n targetObserver.handler = targetObserver.originalHandler;\r\n targetObserver.originalHandler = null;\r\n };\r\n UpdateTriggerBindingBehavior = __decorate([\r\n bindingBehavior('updateTrigger')\r\n ], UpdateTriggerBindingBehavior);\r\n return UpdateTriggerBindingBehavior;\r\n}());\n\nfunction _createDynamicElement(_a) {\r\n var name = _a.name, viewUrl = _a.viewUrl, bindableNames = _a.bindableNames, useShadowDOMmode = _a.useShadowDOMmode;\r\n var DynamicElement = (function () {\r\n function DynamicElement() {\r\n }\r\n DynamicElement.prototype.bind = function (bindingContext) {\r\n this.$parent = bindingContext;\r\n };\r\n DynamicElement = __decorate([\r\n customElement(name),\r\n useView(viewUrl)\r\n ], DynamicElement);\r\n return DynamicElement;\r\n }());\r\n for (var i = 0, ii = bindableNames.length; i < ii; ++i) {\r\n bindable(bindableNames[i])(DynamicElement);\r\n }\r\n switch (useShadowDOMmode) {\r\n case 'open':\r\n useShadowDOM({ mode: 'open' })(DynamicElement);\r\n break;\r\n case 'closed':\r\n useShadowDOM({ mode: 'closed' })(DynamicElement);\r\n break;\r\n case '':\r\n useShadowDOM(DynamicElement);\r\n break;\r\n case null:\r\n break;\r\n default:\r\n getLogger('aurelia-html-only-element')\r\n .warn(\"Expected 'use-shadow-dom' value to be \\\"close\\\", \\\"open\\\" or \\\"\\\", received \".concat(useShadowDOMmode));\r\n break;\r\n }\r\n return DynamicElement;\r\n}\n\nfunction getElementName(address) {\r\n return /([^\\/^\\?]+)\\.html/i.exec(address)[1].toLowerCase();\r\n}\r\nfunction configure$1(config) {\r\n var viewEngine = config.container.get(ViewEngine);\r\n var loader = config.aurelia.loader;\r\n viewEngine.addResourcePlugin('.html', {\r\n 'fetch': function (viewUrl) {\r\n return loader.loadTemplate(viewUrl).then(function (registryEntry) {\r\n var _a;\r\n var bindableNames = registryEntry.template.getAttribute('bindable');\r\n var useShadowDOMmode = registryEntry.template.getAttribute('use-shadow-dom');\r\n var name = getElementName(viewUrl);\r\n if (bindableNames) {\r\n bindableNames = bindableNames.split(',').map(function (x) { return x.trim(); });\r\n registryEntry.template.removeAttribute('bindable');\r\n }\r\n else {\r\n bindableNames = [];\r\n }\r\n return _a = {}, _a[name] = _createDynamicElement({ name: name, viewUrl: viewUrl, bindableNames: bindableNames, useShadowDOMmode: useShadowDOMmode }), _a;\r\n });\r\n }\r\n });\r\n}\n\nfunction configure(config) {\r\n injectAureliaHideStyleAtHead();\r\n config.globalResources(Compose, If, Else, With, Repeat, Show, Hide, Replaceable, Focus, SanitizeHTMLValueConverter, OneTimeBindingBehavior, OneWayBindingBehavior, ToViewBindingBehavior, FromViewBindingBehavior, TwoWayBindingBehavior, ThrottleBindingBehavior, DebounceBindingBehavior, SelfBindingBehavior, SignalBindingBehavior, UpdateTriggerBindingBehavior, AttrBindingBehavior);\r\n configure$1(config);\r\n var viewEngine = config.container.get(ViewEngine);\r\n var styleResourcePlugin = {\r\n fetch: function (address) {\r\n var _a;\r\n return _a = {}, _a[address] = _createCSSResource(address), _a;\r\n }\r\n };\r\n ['.css', '.less', '.sass', '.scss', '.styl'].forEach(function (ext) { return viewEngine.addResourcePlugin(ext, styleResourcePlugin); });\r\n}\n\nexport { AbstractRepeater, ArrayRepeatStrategy, AttrBindingBehavior, BindingSignaler, Compose, ActivationStrategy as ComposeActivationStrategy, DebounceBindingBehavior, Else, Focus, FromViewBindingBehavior, HTMLSanitizer, Hide, If, MapRepeatStrategy, NullRepeatStrategy, NumberRepeatStrategy, OneTimeBindingBehavior, OneWayBindingBehavior, Repeat, RepeatStrategyLocator, Replaceable, SanitizeHTMLValueConverter, SelfBindingBehavior, SetRepeatStrategy, Show, SignalBindingBehavior, ThrottleBindingBehavior, ToViewBindingBehavior, TwoWayBindingBehavior, UpdateTriggerBindingBehavior, With, configure, createFullOverrideContext, getItemsSourceExpression, isOneTime, unwrapExpression, updateOneTimeBinding, updateOverrideContext, viewsRequireLifecycle };\n//# sourceMappingURL=aurelia-templating-resources.js.map\n","import { Router, RouteLoader, AppRouter } from 'aurelia-router';\nimport { Origin } from 'aurelia-metadata';\nimport { relativeToFile } from 'aurelia-path';\nimport { BehaviorInstruction, ShadowDOM, ViewSlot, ViewLocator, CompositionTransaction, CompositionEngine, SwapStrategies, inlineView, customElement, useView } from 'aurelia-templating';\nimport { Container } from 'aurelia-dependency-injection';\nimport { createOverrideContext } from 'aurelia-binding';\nimport { DOM } from 'aurelia-pal';\nimport * as LogManager from 'aurelia-logging';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\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 EmptyLayoutViewModel = (function () {\r\n function EmptyLayoutViewModel() {\r\n }\r\n return EmptyLayoutViewModel;\r\n}());\r\nvar RouterView = (function () {\r\n function RouterView(element, container, viewSlot, router, viewLocator, compositionTransaction, compositionEngine) {\r\n this.element = element;\r\n this.container = container;\r\n this.viewSlot = viewSlot;\r\n this.router = router;\r\n this.viewLocator = viewLocator;\r\n this.compositionTransaction = compositionTransaction;\r\n this.compositionEngine = compositionEngine;\r\n this.router.registerViewPort(this, this.element.getAttribute('name'));\r\n if (!('initialComposition' in compositionTransaction)) {\r\n compositionTransaction.initialComposition = true;\r\n this.compositionTransactionNotifier = compositionTransaction.enlist();\r\n }\r\n }\r\n RouterView.inject = function () {\r\n return [DOM.Element, Container, ViewSlot, Router, ViewLocator, CompositionTransaction, CompositionEngine];\r\n };\r\n RouterView.prototype.created = function (owningView) {\r\n this.owningView = owningView;\r\n };\r\n RouterView.prototype.bind = function (bindingContext, overrideContext) {\r\n this.container.viewModel = bindingContext;\r\n this.overrideContext = overrideContext;\r\n };\r\n RouterView.prototype.process = function ($viewPortInstruction, waitToSwap) {\r\n var _this = this;\r\n var viewPortInstruction = $viewPortInstruction;\r\n var component = viewPortInstruction.component;\r\n var childContainer = component.childContainer;\r\n var viewModel = component.viewModel;\r\n var viewModelResource = component.viewModelResource;\r\n var metadata = viewModelResource.metadata;\r\n var config = component.router.currentInstruction.config;\r\n var viewPortConfig = config.viewPorts ? (config.viewPorts[viewPortInstruction.name] || {}) : {};\r\n childContainer.get(RouterViewLocator)._notify(this);\r\n var layoutInstruction = {\r\n viewModel: viewPortConfig.layoutViewModel || config.layoutViewModel || this.layoutViewModel,\r\n view: viewPortConfig.layoutView || config.layoutView || this.layoutView,\r\n model: viewPortConfig.layoutModel || config.layoutModel || this.layoutModel,\r\n router: viewPortInstruction.component.router,\r\n childContainer: childContainer,\r\n viewSlot: this.viewSlot\r\n };\r\n var viewStrategy = this.viewLocator.getViewStrategy(component.view || viewModel);\r\n if (viewStrategy && component.view) {\r\n viewStrategy.makeRelativeTo(Origin.get(component.router.container.viewModel.constructor).moduleId);\r\n }\r\n return metadata\r\n .load(childContainer, viewModelResource.value, null, viewStrategy, true)\r\n .then(function (viewFactory) {\r\n if (!_this.compositionTransactionNotifier) {\r\n _this.compositionTransactionOwnershipToken = _this.compositionTransaction.tryCapture();\r\n }\r\n if (layoutInstruction.viewModel || layoutInstruction.view) {\r\n viewPortInstruction.layoutInstruction = layoutInstruction;\r\n }\r\n var viewPortComponentBehaviorInstruction = BehaviorInstruction.dynamic(_this.element, viewModel, viewFactory);\r\n viewPortInstruction.controller = metadata.create(childContainer, viewPortComponentBehaviorInstruction);\r\n if (waitToSwap) {\r\n return null;\r\n }\r\n _this.swap(viewPortInstruction);\r\n });\r\n };\r\n RouterView.prototype.swap = function ($viewPortInstruction) {\r\n var _this = this;\r\n var viewPortInstruction = $viewPortInstruction;\r\n var viewPortController = viewPortInstruction.controller;\r\n var layoutInstruction = viewPortInstruction.layoutInstruction;\r\n var previousView = this.view;\r\n var work = function () {\r\n var swapStrategy = SwapStrategies[_this.swapOrder] || SwapStrategies.after;\r\n var viewSlot = _this.viewSlot;\r\n swapStrategy(viewSlot, previousView, function () { return Promise.resolve(viewSlot.add(_this.view)); }).then(function () {\r\n _this._notify();\r\n });\r\n };\r\n var ready = function (owningView_or_layoutView) {\r\n viewPortController.automate(_this.overrideContext, owningView_or_layoutView);\r\n var transactionOwnerShipToken = _this.compositionTransactionOwnershipToken;\r\n if (transactionOwnerShipToken) {\r\n return transactionOwnerShipToken\r\n .waitForCompositionComplete()\r\n .then(function () {\r\n _this.compositionTransactionOwnershipToken = null;\r\n return work();\r\n });\r\n }\r\n return work();\r\n };\r\n if (layoutInstruction) {\r\n if (!layoutInstruction.viewModel) {\r\n layoutInstruction.viewModel = new EmptyLayoutViewModel();\r\n }\r\n return this.compositionEngine\r\n .createController(layoutInstruction)\r\n .then(function (layoutController) {\r\n var layoutView = layoutController.view;\r\n ShadowDOM.distributeView(viewPortController.view, layoutController.slots || layoutView.slots);\r\n layoutController.automate(createOverrideContext(layoutInstruction.viewModel), _this.owningView);\r\n layoutView.children.push(viewPortController.view);\r\n return layoutView || layoutController;\r\n })\r\n .then(function (newView) {\r\n _this.view = newView;\r\n return ready(newView);\r\n });\r\n }\r\n this.view = viewPortController.view;\r\n return ready(this.owningView);\r\n };\r\n RouterView.prototype._notify = function () {\r\n var notifier = this.compositionTransactionNotifier;\r\n if (notifier) {\r\n notifier.done();\r\n this.compositionTransactionNotifier = null;\r\n }\r\n };\r\n RouterView.$view = null;\r\n RouterView.$resource = {\r\n name: 'router-view',\r\n bindables: ['swapOrder', 'layoutView', 'layoutViewModel', 'layoutModel', 'inherit-binding-context']\r\n };\r\n return RouterView;\r\n}());\r\nvar RouterViewLocator = (function () {\r\n function RouterViewLocator() {\r\n var _this = this;\r\n this.promise = new Promise(function (resolve) { return _this.resolve = resolve; });\r\n }\r\n RouterViewLocator.prototype.findNearest = function () {\r\n return this.promise;\r\n };\r\n RouterViewLocator.prototype._notify = function (routerView) {\r\n this.resolve(routerView);\r\n };\r\n return RouterViewLocator;\r\n}());\n\nvar EmptyClass = (function () {\r\n function EmptyClass() {\r\n }\r\n return EmptyClass;\r\n}());\r\ninlineView('')(EmptyClass);\r\nvar TemplatingRouteLoader = (function (_super) {\r\n __extends(TemplatingRouteLoader, _super);\r\n function TemplatingRouteLoader(compositionEngine) {\r\n var _this = _super.call(this) || this;\r\n _this.compositionEngine = compositionEngine;\r\n return _this;\r\n }\r\n TemplatingRouteLoader.prototype.resolveViewModel = function (router, config) {\r\n return new Promise(function (resolve, reject) {\r\n var viewModel;\r\n if ('moduleId' in config) {\r\n var moduleId = config.moduleId;\r\n if (moduleId === null) {\r\n viewModel = EmptyClass;\r\n }\r\n else {\r\n moduleId = relativeToFile(moduleId, Origin.get(router.container.viewModel.constructor).moduleId);\r\n if (/\\.html/i.test(moduleId)) {\r\n viewModel = createDynamicClass(moduleId);\r\n }\r\n else {\r\n viewModel = moduleId;\r\n }\r\n }\r\n return resolve(viewModel);\r\n }\r\n reject(new Error('Invalid route config. No \"moduleId\" found.'));\r\n });\r\n };\r\n TemplatingRouteLoader.prototype.createChildContainer = function (router) {\r\n var childContainer = router.container.createChild();\r\n childContainer.registerSingleton(RouterViewLocator);\r\n childContainer.getChildRouter = function () {\r\n var childRouter;\r\n childContainer.registerHandler(Router, function () { return childRouter || (childRouter = router.createChild(childContainer)); });\r\n return childContainer.get(Router);\r\n };\r\n return childContainer;\r\n };\r\n TemplatingRouteLoader.prototype.loadRoute = function (router, config, navInstruction) {\r\n var _this = this;\r\n return this\r\n .resolveViewModel(router, config)\r\n .then(function (viewModel) { return _this.compositionEngine.ensureViewModel({\r\n viewModel: viewModel,\r\n childContainer: _this.createChildContainer(router),\r\n view: config.view || config.viewStrategy,\r\n router: router\r\n }); });\r\n };\r\n TemplatingRouteLoader.inject = [CompositionEngine];\r\n return TemplatingRouteLoader;\r\n}(RouteLoader));\r\nfunction createDynamicClass(moduleId) {\r\n var name = /([^\\/^\\?]+)\\.html/i.exec(moduleId)[1];\r\n var DynamicClass = (function () {\r\n function DynamicClass() {\r\n }\r\n DynamicClass.prototype.bind = function (bindingContext) {\r\n this.$parent = bindingContext;\r\n };\r\n return DynamicClass;\r\n }());\r\n customElement(name)(DynamicClass);\r\n useView(moduleId)(DynamicClass);\r\n return DynamicClass;\r\n}\n\nvar logger = LogManager.getLogger('route-href');\r\nvar RouteHref = (function () {\r\n function RouteHref(router, element) {\r\n this.router = router;\r\n this.element = element;\r\n this.attribute = 'href';\r\n }\r\n RouteHref.inject = function () {\r\n return [Router, DOM.Element];\r\n };\r\n RouteHref.prototype.bind = function () {\r\n this.isActive = true;\r\n this.processChange();\r\n };\r\n RouteHref.prototype.unbind = function () {\r\n this.isActive = false;\r\n };\r\n RouteHref.prototype.attributeChanged = function (value, previous) {\r\n if (previous) {\r\n this.element.removeAttribute(previous);\r\n }\r\n return this.processChange();\r\n };\r\n RouteHref.prototype.processChange = function () {\r\n var _this = this;\r\n return this.router\r\n .ensureConfigured()\r\n .then(function () {\r\n if (!_this.isActive) {\r\n return null;\r\n }\r\n var element = _this.element;\r\n var href = _this.router.generate(_this.route, _this.params);\r\n if (element.au.controller) {\r\n element.au.controller.viewModel[_this.attribute] = href;\r\n }\r\n else {\r\n element.setAttribute(_this.attribute, href);\r\n }\r\n return null;\r\n })\r\n .catch(function (reason) {\r\n logger.error(reason);\r\n });\r\n };\r\n RouteHref.$resource = {\r\n type: 'attribute',\r\n name: 'route-href',\r\n bindables: [\r\n { name: 'route', changeHandler: 'processChange', primaryProperty: true },\r\n { name: 'params', changeHandler: 'processChange' },\r\n 'attribute'\r\n ]\r\n };\r\n return RouteHref;\r\n}());\n\nfunction configure(config) {\r\n config\r\n .singleton(RouteLoader, TemplatingRouteLoader)\r\n .singleton(Router, AppRouter)\r\n .globalResources(RouterView, RouteHref);\r\n config.container.registerAlias(Router, AppRouter);\r\n}\n\nexport { RouteHref, RouterView, RouterViewLocator, TemplatingRouteLoader, configure };\n//# sourceMappingURL=aurelia-templating-router.js.map\n"],"names":[],"sourceRoot":""}