{"version":3,"file":"infrastructure.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;;;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACrIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACzjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AC16BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACjMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACZA;AAEA;AACA;AACA;AACA;AACA;AAMA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAEA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAEA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpVA;AAGA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AAMA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAKA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AAAA;AACA;AAIA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;;;;;;;;;;AAUA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAIA;AAIA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAlIA;AAoIA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxIA;AAEA;;;;;;;AAOA;AACA;AAAA;AAWA;AAAA;AAVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAMA;AAEA;AACA;AAEA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAMA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAIA;AACA;AAEA;AACA;AACA;AAMA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAjIA;AAmIA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9IA;AAEA;;AAEA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAjBA;AAmBA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzBA;;;;AAIA;AACA;AASA;AARA;AACA;AAQA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAKA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAAA;AAvDA;AAyDA;;;;AAIA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AARA;AAUA;AAAA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/EA;AACA;;;;;AAKA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AA/CA;AAiDA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzDA;AAKA;AAAA;AAIA;AAAA;AAHA;AACA;AACA;;AAGA;AAEA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAzBA;AA2BA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjCA;AAEA;AACA;AACA;AAFA;AAIA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAMA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AAKA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AAIA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAAA;AAtLA;AAwLA;AAAA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AChMA;AACA;;AAEA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAjBA;AAmBA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxBA;AACA;;;;;;;;;;;;;;AAcA;AACA;AAAA;AAoCA;AAAA;AAnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AA9EA;AAgFA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjGA;AACA;;;;AAIA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAjCA;AAmCA;AAAA;AACA;;;;;;;;AC1CA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAEA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AAIA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIA;AACA;AAIA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AACA;AAGA;AAEA;AAEA;AAEA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5JA;AACA;;;;;AAKA;AACA;AAAA;AAGA;AAAA;AAFA;;AAIA;AAEA;AACA;AACA;AAEA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAlDA;AAoDA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5DA;AACA;;;;AAIA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAlBA;AAoBA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3BA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAIA;AAEA;AAEA;AACA;AAEA;AAEA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAIA;AAEA;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAGA;AACA;AACA;AAEA;AACA;AAKA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AAEA;AACA;AAEA;AACA;AAEA;AAKA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AAEA;AAAA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAlOA;AAoOA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtOA;AACA;AAAA;AAwCA;AAvCA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;;;;;;;;AAQA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAAA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAAA;AA7FA;AA+FA;;;AAGA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AAAA;AApDA;AAsDA;AAAA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9MA;AACA;;;AAGA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAOA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAAA;AAEA;AACA;AAAA;AAGA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAMA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAhIA;AAkIA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxIA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAGA;AAIA;AAIA;AAIA;AAIA;AAKA;AACA;AACA;AACA;AAAA;AAvCA;AAyCA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3CA;AACA;;;AAGA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAMA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAxCA;AA0CA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AChDA;AACA;;AAEA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAdA;AAgBA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrBA;AACA;AACA;;AAEA;AACA;AAAA;AACA;AACA;AACA;AAEA;;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAAA;AA1EA;AA4EA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA;AAMA;;AAEA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAZA;AAcA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxBA;AACA;;;;AAIA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAVA;AAYA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnBA;AACA;;;;;;AAMA;AACA;AAAA;AAGA;AAAA;AAFA;;AAIA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AAIA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAGA;AAEA;AACA;AACA;AAEA;AAGA;AACA;AAEA;AAGA;AAGA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAlFA;AAoFA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7FA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAZA;AAcA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AClBA;AACA;;;;;;;;;;;;;AAaA;AACA;AAAA;AAaA;AAAA;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AAAA;AACA;AAMA;AACA;AAMA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AA1DA;AA6DA;AAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7EA;AAIA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAIA;AAIA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAGA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AACA;AAKA;AAIA;AAIA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AAIA;AACA;AAIA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAIA;AACA;AAIA;AACA;AAIA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AAGA;AACA;AAGA;AACA;AACA;AACA;AAGA;AACA;AAEA;AAGA;AACA;AACA;AACA;AACA;AAAA;AAnRA;AAqRA;AAAA;AACA;;;;;;;;;;;ACtRA;AACA;AACA;AAaA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvLA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;;;;;;;;ACvEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAEA;;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;;;;ACpHA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAAA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1IA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AAAA;AACA;AACA;AAAA;AAEA;AACA;AAEA;AAAA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjHA;AACA;AAKA;AACA;AACA;AACA;AAEA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAEA;AAAA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AAKA;AAEA;AAAA;AACA;AACA;AAKA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;AAKA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAAA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AAEA;AACA;AACA;;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AAEA;AAGA;AAEA;AAAA;AAEA;AACA;AACA;AACA;AAKA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AAEA;AAGA;AAEA;AAAA;AAEA;AACA;AACA;AACA;AAIA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAIA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;AChhBA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACvGA;AAOA;AANA;AACA;AACA;AACA;AAIA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAxBA;AA0BA;;;;;;;;AC1BA;AACA;AACA;AACA;AAMA;AAIA;AACA;AAEA;AAEA;AAEA;AAGA;AAGA;AAEA;AAIA;AAEA;AAEA;AACA;AAEA;AAGA;AAGA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AAEA;AAGA;AACA;AACA;AAMA;AAIA;AAEA;AAEA;AAEA;AAGA;AAGA;AAUA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;;;;;AC9JA;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAAA;AACA;AACA;;AAEA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAAA;;AAEA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AACA;AAGA;AACA;;AAEA;AACA;AACA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAKA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;;AAEA;AACA;AAEA;AACA;AACA;;AAEA;AACA;;AAGA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAIA;AAIA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAIA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAIA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;;AAIA;AACA;AACA;AAEA;AAEA;AAEA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAGA;;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;;AAGA;AACA;AAAA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAAA;;AAEA;AACA;AAGA;;AAEA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;;AAGA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;;AAGA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;;;;;;;;AChnBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAIA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAQA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAGA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAAA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAIA;AACA;AACA;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAKA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9lDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAOA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAEA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAIA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;AC10CA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;;AAEA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AAMA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AACA;AACA;AAGA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAaA;AACA;AACA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAAA;AACA;AACA;AAEA;AAAA;AACA;AACA;AAEA;AAAA;AACA;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;;;;;;;;AC9uEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AAKA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AASA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAOA;AACA;AAAA;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;;AAIA;AAAA;AAEA;;AAEA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AAKA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAIA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AAEA;AACA;;AAEA;AACA;AACA;AAEA;AACA;;AAKA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AAEA;AAGA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAMA;AAEA;AAEA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;;AC5/CA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAGA;AAIA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAEA;AAAA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AAAA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAMA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;;;;;;ACraA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA;AAaA;AASA;AASA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;;;;;;AC5BA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACVA;AAAA;AAAA;ACCA;ACAA;AACA;AAEA;AAAA;AAAA;AAEA;AAAA;ACNA;AACA;AACA;AACA;AAGA;AADA;AACA;AACA;ACPA;AAAA;ACEA;AACA;AAAA;AAEA;AAAA;AAAA;ACGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACFA;AAaA;AAAA;AAAA;AACA;AACA;AAMA;AAAA;AAAA;AAAA;AAAA;AArBA;AAkCA;AAAA;AAAA;AAAA;AACA;AACA;AAKA;AAAA;AAAA;AAAA;AAAA;AAhBA;AA6BA;AAAA;AAAA;AAAA;AACA;AACA;AAKA;AAAA;AAAA;AAAA;AAAA;AAhBA;AAqCA;AAAA;AAAA;AACA;AACA;AAOA;AAAA;AAAA;AAAA;AAAA;AAzBA;AA8CA;AAAA;AAAA;AACA;AACA;AAOA;AAAA;AAAA;AAAA;AAAA;AAzBA;AA8CA;AAAA;AAAA;AACA;AACA;AAOA;AAAA;AAAA;AAAA;AAAA;AAzBA;AA0CA;AAAA;AAAA;AACA;AACA;AAMA;AAAA;AAAA;AAAA;AAAA;AApBA;AAsCA;AAAA;AAAA;AACA;AACA;AAOA;AAAA;AAAA;AAAA;AAAA;AAtBA;ACjHA;AAFA;AAGA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA;AAEA;AACA;AAAA;AAEA;AAgBA;AAAA;AAAA;AACA;AAEA;AACA;AAAA;AAEA;AAgBA;AAAA;AAAA;AACA;AAEA;AACA;AAAA;AAEA;AAeA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AF1JA;AAaA;AGjBA;AAIA;AAAA;AAAA;AAIA;AAAA;AAAA;AACA;AAAA;AAPA;ACKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAEA;AAAA;AAAA;AAAA;AAGA;AAEA;AAAA;AAAA;AAAA;AAIA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AACA;AAAA;AAAA;AAAA;AAIA;AACA;AAAA;AAAA;AAAA;AAIA;AACA;AAAA;AAAA;AAAA;AAKA;AACA;AAAA;AAAA;AAAA;AAKA;AAAA;AAiBA;AACA;AAAA;AAIA;AAEA;AAIA;AAlBA;AAAA;AAuBA;AAIA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAKA;AAEA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AANA;AAMA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA;AAAA;AACA;AAAA;AAAA;AAAA;AAIA;AACA;AAMA;AAAA;AAAA;AAAA;AAEA;AAeA;AAAA;AAEA;AAAA;AAAA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AACA;AAgEA;AAAA;AAxDA;AAEA;AAEA;AAeA;AAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AAAA;AAAA;AAQA;AAEA;AAAA;AAcA;AAIA;AAAA;ACxQA;AAOA;AAAA;AAAA;ADuQA;AAGA;AAGA;AAGA;AAGA;AAEA;ACxQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AACA;AAAA;AAGA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAGA;AAKA;AACA;AACA;AAMA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAaA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAjBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA;AAAA;AAAA;AAAA;AACA;AAAA;AAKA;AAAA;AAEA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AADA;AAAA;AAEA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA5FA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiGA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAEA;AACA;AACA;AAAA;AAEA;AAAA;AAQA;AAAA;AALA;AACA;AACA;AACA;AAAA;AAAA;AAAA;ACvJA;AAGA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAiBA;AACA;AAaA;AAIA;AAGA;AACA;AASA;AACA;AASA;AAQA;AAIA;AAEA;AAGA;AACA;AAIA;AArEA;AAAA;AAAA;AAhBA;ACGA;AAIA;AAAA;AAAA;AAIA;AAIA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAOA;AAAA;AAAA;AAAA;AASA;AACA;AAAA;AAAA;AAlCA;AAkCA;AAAA;AAAA;AAAA;AAAA;AAAA;ACpCA;AACA;AAAA;AAAA;AAAA;AAGA;AAEA;AAGA;AAEA;AADA;AAAA;AAAA;AAZA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACcA;AACA;AAAA;AAAA;AAAA;AAGA;AAAA;AAEA;AAIA;AACA;AAEA;AAKA;AAEA;AAAA;AAEA;AACA;AAEA;AAKA;AAEA;AAAA;AAIA;AACA;AAEA;AAMA;AAAA;AAAA;AAAA;AACA;AC5DA;AAgBA;AAhBA;AAAA;AEOA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAJA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAKA;AAAA;AAHA;AAGA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AACA;AAAA;AADA;AACA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAEA;AAAA;AAAA;AAAA;AACA;ACjBA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAEA;AACA;AAEA;AAGA;AACA;AACA;AAUA;AAAA;AAMA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAxCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2CA;AAEA;AAIA;AACA;AASA;AACA;AAIA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AASA;AAMA;AAIA;AAgBA;AAAA;AAAA;AAAA;AAAA;AAWA;AAAA;AAAA;AAAA;AAAA;AAIA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAEA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAIA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAhBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA;AAIA;AAGA;AAAA;AAHA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AACA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAGA;AACA;AF3MA;AAUA;AAVA;AAuFA;AAOA;AAAA;AAAA;AAzCA;AAEA;AA2DA;AAAA;AACA;AAAA;AAYA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AACA;AAAA;AAAA;AAAA;AAMA;AACA;AAAA;AAAA;AAAA;AAIA;AACA;AAAA;AAQA;AAEA;AAIA;AAGA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AACA;AAAA;AAIA;AAAA;AAAA;AAEA;AACA;AAIA;AAGA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAzBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA;AAAA;AAAA;AAAA;AAAA;AAIA;AAEA;AAEA;AACA;AACA;AAAA;AAGA;AAAA;AAAA;AAGA;AAIA;AAAA;AAIA;AAAA;AACA;AAGA;AAAA;AAEA;AAAA;AAEA;AAGA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AAAA;AAOA;AAEA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AAEA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AA1EA;;;;;AA0EA;AAAA;AAAA;AAAA;AAAA;AASA;AAEA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAXA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AAQA;AAIA;AAIA;AA8BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AALA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA;AAAA;AAAA;AAAA;AAAA;AACA;AADA;AAAA;AACA;AACA;AAAA;AAKA;AACA;AACA;AAEA;AAGA;AAAA;AAIA;AAaA;AAMA;AAEA;AAGA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAWA;AAAA;AAAA;AAAA;AAaA;AAAA;AAAA;AAAA;AACA;AADA;AAAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAgBA;AAAA;AAAA;AAAA;AAAA;AACA;AADA;AAAA;AACA;AACA;AAEA;AAEA;AAaA;AAAA;AAMA;AAGA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BA;AAAA;AAAA;AAAA;AACA;AAkBA;AAIA;AACA;AACA;AAIA;AAIA;AAIA;AAAA;AAAA;AAAA;AASA;AAEA;AAAA;AAAA;AAAA;AAQA;AAEA;AAAA;AAAA;AAAA;AAQA;AAEA;AAAA;AAAA;AAAA;AAAA;AASA;AAMA;AAEA;AAAA;AAFA;AAEA;AAAA;AAMA;AACA;AAEA;AAAA;AAEA;AACA;AAAA;AACA;AAAA;AAGA;AAAA;AAAA;AAIA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAGA;AAAA;AACA;AAEA;AAUA;AAAA;AAAA;AAKA;AAEA;AAAA;AAGA;AAEA;AAAA;AAEA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAMA;AAAA;AAAA;AAAA;AAGA;AACA;AAIA;AAJA;AAAA;AAIA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAGA;AACA;AACA;AAEA;AACA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAGA;AAEA;AAMA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AASA;AAIA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AAGA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAEA;AADA;AACA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAzDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDA;AA4BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA;AASA;AAAA;AAIA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAIA;AAEA;AAAA;AAAA;AAAA;AAEA;AAAA;AAYA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AACA;AACA;AAAA;AAIA;AAAA;AAAA;AAAA;AACA;AAAA;AAKA;AAAA;AAAA;AAAA;AACA;AAAA;AAEA;AACA;AAAA;AAAA;AAEA;AAEA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAUA;AALA;AAEA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAIA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;;;AAvFA;;;;AAuFA;AAGA;AAAA;AAEA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAKA;AAIA;AACA;AAAA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAKA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAIA;AAEA;AAEA;AACA;AAAA;AAEA;AAAA;AAIA;AAAA;AAEA;AAAA;AAAA;AAIA;AAGA;AAEA;AACA;AACA;AAAA;AAEA;AAAA;AAIA;AACA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AAMA;AAKA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAEA;AAAA;AAUA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAvBA;AAKA;AAAA;AAkBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAEA;AACA;AACA;AACA;AAOA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAGA;AACA;AAGA;AAEA;AACA;AACA;AAAA;AAEA;AAAA;AAIA;AACA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAEA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAIA;AACA;AAAA;AAGA;AACA;AAAA;AAKA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AACA;AAAA;AAAA;AAAA;AAAA;AArhCA;AAKA;AAAA;AAAA;AAghCA;AGpnCA;AAAA;AAMA;AAAA;AACA;AAAA;AAAA;AAAA;AAGA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;ACbA;ACEA;AAKA;AAAA;AAAA;AAGA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAHA;AAEA;AACA;AAEA;AAAA;AACA;AADA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AACA;AADA;AACA;AACA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAbA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA;AAeA;AAAA;AAAA;AAAA;AAKA;AACA;AAAA;AAAA;AAAA;AACA;ACjDA;AAQA;AAIA;AAIA;AAJA;AAAA;ACRA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAKA;AACA;AAAA;AAAA;AAAA;AAGA;AACA;AAAA;AAAA;AAAA;ACEA;AAGA;AAAA;AASA;AAAA;AAAA;AAAA;AAbA;AACA;AAAA;AAAA;AAAA;AAAA;AAeA;AAAA;AAAA;AAAA;AAAA;AAWA;AAAA;AAAA;AAAA;AACA;AAAA;AAIA;AAGA;AACA;AACA;AACA;AAAA;AAIA;AAKA;AACA;AAAA;AACA;AADA;AACA;AAWA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA5CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AACA;AADA;AACA;AAqBA;AAAA;AAAA;AAAA;AAAA;AAGA;AAGA;AAAA;AAAA;AAAA;AAAA;AAcA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAvDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4DA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAKA;AAKA;AAAA;AAAA;AAEA;AAAA;AAIA;AAEA;AAEA;AAAA;AAGA;AACA;AACA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAaA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AA/CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CA;AAKA;AACA;AAKA;AAAA;AAAA;AAAA;AAAA;AAEA;ACjMA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAcA;AAAA;AACA;AACA;AAOA;AAAA;AAAA;AAGA;AAAA;AAEA;AACA;AADA;AAAA;AACA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AACA;AAGA;AACA;AACA;AAAA;AAOA;AAKA;AAMA;AAEA;AAAA;AAIA;AAEA;AAAA;AAnDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAjBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAOA;AAAA;AAAA;AAAA;AAAA;AASA;AAAA;AAAA;AAAA;AAGA;ACvGA;AAAA;AASA;AACA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAMA;AALA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AADA;AAAA;AAAA;AAIA;AAAA;AACA;AAEA;AAAA;AAGA;AACA;AAAA;AAAA;AAAA;AAAA;AAYA;AACA;AAAA;AAMA;AAaA;AAEA;AAKA;AACA;AAQA;AAGA;AAEA;AAEA;AACA;AACA;AAAA;AAMA;AAIA;AAEA;AAWA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAlGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoGA;AAWA;AAAA;AAAA;AAAA;AAAA;AAUA;AAAA;AAAA;AAAA;AAAA;AAkBA;AAAA;AAAA;AAAA;AAAA;AAUA;AAAA;AAAA;AAAA;AACA;ACpHA;AAAA;AAAA;AAAA;AAWA;AAEA;AAEA;AAAA;ACxEA;AACA;AAIA;AACA;ADgGA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AACA;AAAA;AAGA;AAEA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAAA;AAEA;AACA;AAAA;AAAA;AAAA;AAKA;AAAA;AACA;AAAA;AAAA;AAAA;AAEA;AAEA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAjCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCA;AAaA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AACA;AAGA;AAEA;AAAA;AAEA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAnBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AAGA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA5BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAEA;AAAA;AAGA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAOA;AAAA;AALA;AAAA;AAGA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAHA;AAAA;AAKA;AAAA;AAAA;AAAA;AACA;AAAA;AAGA;AAAA;AAAA;AAAA;AACA;AAAA;AAGA;AAAA;AAAA;AAAA;AACA;AAAA;AAOA;AAGA;AAAA;AACA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAzOA;AAAA;AAAA;AAAA;AA4OA;AAAA;AAAA;AAGA;AAAA;AAWA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAvFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2FA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AAEA;AACA;AAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AAAA;AALA;AAAA;AAQA;AAAA;AAAA;AAAA;AACA;AAAA;AAGA;AAQA;AAAA;AAAA;AAIA;AACA;AAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AA5CA;;;;AA4CA;AAIA;AAKA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AACA;AAAA;AAEA;AAAA;AAKA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAEA;AAAA;AAAA;AAAA;AAGA;AAAA;AACA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA1DA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0DA;AAIA;AACA;AAEA;AAGA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAEA;AAAA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AASA;AAAA;AAAA;AAAA;AALA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AAAA;AAEA;AAAA;AAAA;AAAA;AAGA;AAEA;AAGA;AAwIA;AACA;AAjHA;AArBA;AAAA;AAiBA;AAZA;AAEA;AAAA;AAGA;AACA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAeA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AAOA;AAgBA;AACA;AAMA;AAGA;AAAA;AAGA;AAEA;AACA;AAAA;AAAA;AAtCA;AAAA;AAAA;AAAA;AAAA;AA6CA;AAKA;AAQA;AAGA;AAAA;AAAA;AAAA;AACA;AAIA;AAKA;AAEA;AAgBA;AAAA;AAAA;AAAA;AACA;AAeA;AAAA;AAIA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AACA;AAKA;AAIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA;AAAA;AAAA;AAMA;AAEA;AACA;AAIA;AAEA;AAAA;AAAA;AAGA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA9BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAEA;AAAA;AAFA;AAEA;AAAA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AACA;AAQA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAIA;AACA;AAAA;AAAA;AAAA;AACA;AEvrBA;AAAA;AAQA;AAAA;AAAA;AAAA;AAOA;AAGA;AAGA;AAKA;AAIA;AAAA;AAGA;AAAA;AAHA;AAGA;AAAA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AAGA;AAAA;AAGA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AAGA;AAAA;AAAA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AAWA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAOA;AAAA;AAAA;AAAA;AAAA;AAQA;AAAA;AAAA;AAAA;AAAA;AAMA;AAOA;AAAA;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAEA;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+DA;AAKA;AAjEA;AAIA;AACA;AAGA;AAAA;AA2DA;AAEA;AAGA;AAAA;AAAA;AAAA;AA2BA;AAYA;AACA;AAAA;AAAA;AAAA;AAAA;AAWA;AAGA;AAAA;AAAA;AAAA;AAqBA;AAEA;AAIA;AAAA;AAAA;AAAA;AAcA;AAGA;AAAA;AAAA;AAAA;AASA;AAGA;AAAA;AAAA;AAAA;AASA;AAMA;AAAA;AAAA;AAAA;AAEA;AAUA;AAUA;AAEA;AAQA;AAAA;AAAA;AAAA;ACxPA;AACA;AACA;AAIA;AAGA;AAAA;AAAA;AACA;AAIA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC1BA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACNA;AACA;AACA;AACA;AACA;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/AbortController.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/Errors.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/HttpClient.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/HubConnection.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/ILogger.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/ITransport.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/Loggers.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/Subject.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/Utils.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js","webpack:///../../node_modules/.pnpm/@microsoft+signalr@8.0.7/node_modules/@microsoft/signalr/dist/esm/index.js","webpack:///./Frontend/src/Shared/Infrastructure/Ajax.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/AddressesTableBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/AjaxActionBehavior.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/AutoFocusBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/BaseControlBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/ChangablesBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/Component/ComponentBehavior.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/CustomFileBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/CustomSelectsBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/DatePickerBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/EnterBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/FileControlsBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/InputMaskBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/InputTrimBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/NotificationBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/PagerBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/PasswordPreviewBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/PaymentChannelAmountBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/RecaptchaBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/ReplaceTagBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/Reviews/UseBettingCartBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/ScrollbarBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/SortableBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/TabsBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/ToggleBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/TooltipsBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Behaviours/VoximplantCallBehaviour.ts","webpack:///./Frontend/src/Shared/Infrastructure/Controls.ts","webpack:///./Frontend/src/Shared/Infrastructure/LanguageSelector.ts","webpack:///./Frontend/src/Shared/Infrastructure/LocalStorageProvider.ts","webpack:///./Frontend/src/Shared/Infrastructure/Localization.ts","webpack:///./Frontend/src/Shared/Infrastructure/Metrics.ts","webpack:///./Frontend/src/Shared/Infrastructure/Popup.ts","webpack:///./Frontend/src/Shared/Infrastructure/SRLiveAdapter.ts","webpack:///./Frontend/src/Shared/Infrastructure/UiBlock.ts","webpack:///./Frontend/src/Shared/Infrastructure/Utils.ts","webpack:///./Frontend/src/Shared/Infrastructure/Validators.ts","webpack:///./Frontend/src/Shared/SignalR/SignalR.ts","webpack:///./Frontend/src/Shared/SignalR/SignalRConfigBuilder.ts","webpack:///./Frontend/src/Shared/Sports/Sports.ts","webpack:///external var \"jQuery\"","webpack:///./Frontend/src/Shared/libs/blockUI/jquery.blockUI.js","webpack:///./Frontend/src/Shared/libs/inputmask/inputmask.js","webpack:///./Frontend/src/Shared/libs/inputmask/jquery.inputmask.js","webpack:///./Frontend/src/Shared/libs/jquery.powertip/jquery.powertip.js","webpack:///./Frontend/src/Shared/libs/jquery.timepicker/jquery-ui-timepicker-addon.js","webpack:///./Frontend/src/Shared/libs/jquery.validate/jquery.validate.js","webpack:///./Frontend/src/Shared/libs/jquery.validate/jquery.validate.unobtrusive.js","webpack:///./Frontend/src/Shared/libs/jquery/jquery-ui-datepicker-settings.js","webpack:///./Frontend/src/Shared/libs/jquery/jquery-ui.min.js","webpack:///./Frontend/src/Shared/libs/jquery/jquery.nice-select.min.js","webpack:///./Frontend/src/Shared/libs/jquery/jquery.touchSwipe.min.js","webpack:///./Frontend/src/Shared/libs/jquery/jquery.ui.touch-punch.min.js","webpack:///signalR/webpack/universalModuleDefinition","webpack:///signalR/webpack/bootstrap","webpack:///signalR/webpack/runtime/define property getters","webpack:///signalR/webpack/runtime/global","webpack:///signalR/webpack/runtime/hasOwnProperty shorthand","webpack:///signalR/webpack/runtime/make namespace object","webpack:///signalR/src/ILogger.ts","webpack:///signalR/src/Errors.ts","webpack:///signalR/src/HttpClient.ts","webpack:///signalR/src/Loggers.ts","webpack:///signalR/src/Utils.ts","webpack:///signalR/src/FetchHttpClient.ts","webpack:///signalR/src/XhrHttpClient.ts","webpack:///signalR/src/DefaultHttpClient.ts","webpack:///signalR/src/TextMessageFormat.ts","webpack:///signalR/src/HandshakeProtocol.ts","webpack:///signalR/src/IHubProtocol.ts","webpack:///signalR/src/HubConnection.ts","webpack:///signalR/src/Subject.ts","webpack:///signalR/src/MessageBuffer.ts","webpack:///signalR/src/DefaultReconnectPolicy.ts","webpack:///signalR/src/HeaderNames.ts","webpack:///signalR/src/AccessTokenHttpClient.ts","webpack:///signalR/src/ITransport.ts","webpack:///signalR/src/AbortController.ts","webpack:///signalR/src/LongPollingTransport.ts","webpack:///signalR/src/ServerSentEventsTransport.ts","webpack:///signalR/src/WebSocketTransport.ts","webpack:///signalR/src/HttpConnection.ts","webpack:///signalR/src/DynamicImports.browser.ts","webpack:///signalR/src/JsonHubProtocol.ts","webpack:///signalR/src/HubConnectionBuilder.ts","webpack:///signalR/src/browser-index.ts","webpack:///./Frontend/src/Shared/startup.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/amd options","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/global","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///webpack/runtime/node module decorator","webpack:///./Frontend/src/infrastructure.ts"],"sourcesContent":["// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r\n// We don't actually ever use the API being polyfilled, we always use the polyfill because\r\n// it's a very new API right now.\r\n// Not exported from index.\r\n/** @private */\r\nexport class AbortController {\r\n constructor() {\r\n this._isAborted = false;\r\n this.onabort = null;\r\n }\r\n abort() {\r\n if (!this._isAborted) {\r\n this._isAborted = true;\r\n if (this.onabort) {\r\n this.onabort();\r\n }\r\n }\r\n }\r\n get signal() {\r\n return this;\r\n }\r\n get aborted() {\r\n return this._isAborted;\r\n }\r\n}\r\n//# sourceMappingURL=AbortController.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { HttpClient } from \"./HttpClient\";\r\n/** @private */\r\nexport class AccessTokenHttpClient extends HttpClient {\r\n constructor(innerClient, accessTokenFactory) {\r\n super();\r\n this._innerClient = innerClient;\r\n this._accessTokenFactory = accessTokenFactory;\r\n }\r\n async send(request) {\r\n let allowRetry = true;\r\n if (this._accessTokenFactory && (!this._accessToken || (request.url && request.url.indexOf(\"/negotiate?\") > 0))) {\r\n // don't retry if the request is a negotiate or if we just got a potentially new token from the access token factory\r\n allowRetry = false;\r\n this._accessToken = await this._accessTokenFactory();\r\n }\r\n this._setAuthorizationHeader(request);\r\n const response = await this._innerClient.send(request);\r\n if (allowRetry && response.statusCode === 401 && this._accessTokenFactory) {\r\n this._accessToken = await this._accessTokenFactory();\r\n this._setAuthorizationHeader(request);\r\n return await this._innerClient.send(request);\r\n }\r\n return response;\r\n }\r\n _setAuthorizationHeader(request) {\r\n if (!request.headers) {\r\n request.headers = {};\r\n }\r\n if (this._accessToken) {\r\n request.headers[HeaderNames.Authorization] = `Bearer ${this._accessToken}`;\r\n }\r\n // don't remove the header if there isn't an access token factory, the user manually added the header in this case\r\n else if (this._accessTokenFactory) {\r\n if (request.headers[HeaderNames.Authorization]) {\r\n delete request.headers[HeaderNames.Authorization];\r\n }\r\n }\r\n }\r\n getCookieString(url) {\r\n return this._innerClient.getCookieString(url);\r\n }\r\n}\r\n//# sourceMappingURL=AccessTokenHttpClient.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { AbortError } from \"./Errors\";\r\nimport { FetchHttpClient } from \"./FetchHttpClient\";\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { Platform } from \"./Utils\";\r\nimport { XhrHttpClient } from \"./XhrHttpClient\";\r\n/** Default implementation of {@link @microsoft/signalr.HttpClient}. */\r\nexport class DefaultHttpClient extends HttpClient {\r\n /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */\r\n constructor(logger) {\r\n super();\r\n if (typeof fetch !== \"undefined\" || Platform.isNode) {\r\n this._httpClient = new FetchHttpClient(logger);\r\n }\r\n else if (typeof XMLHttpRequest !== \"undefined\") {\r\n this._httpClient = new XhrHttpClient(logger);\r\n }\r\n else {\r\n throw new Error(\"No usable HttpClient found.\");\r\n }\r\n }\r\n /** @inheritDoc */\r\n send(request) {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n return this._httpClient.send(request);\r\n }\r\n getCookieString(url) {\r\n return this._httpClient.getCookieString(url);\r\n }\r\n}\r\n//# sourceMappingURL=DefaultHttpClient.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// 0, 2, 10, 30 second delays before reconnect attempts.\r\nconst DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\n/** @private */\r\nexport class DefaultReconnectPolicy {\r\n constructor(retryDelays) {\r\n this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r\n }\r\n nextRetryDelayInMilliseconds(retryContext) {\r\n return this._retryDelays[retryContext.previousRetryCount];\r\n }\r\n}\r\n//# sourceMappingURL=DefaultReconnectPolicy.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n/** Error thrown when an HTTP request fails. */\r\nexport class HttpError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n * @param {number} statusCode The HTTP status code represented by this error.\r\n */\r\n constructor(errorMessage, statusCode) {\r\n const trueProto = new.target.prototype;\r\n super(`${errorMessage}: Status code '${statusCode}'`);\r\n this.statusCode = statusCode;\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when a timeout elapses. */\r\nexport class TimeoutError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage = \"A timeout occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when an action is aborted. */\r\nexport class AbortError extends Error {\r\n /** Constructs a new instance of {@link AbortError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage = \"An abort occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when the selected transport is unsupported by the browser. */\r\n/** @private */\r\nexport class UnsupportedTransportError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message, transport) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'UnsupportedTransportError';\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when the selected transport is disabled by the browser. */\r\n/** @private */\r\nexport class DisabledTransportError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message, transport) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'DisabledTransportError';\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when the selected transport cannot be started. */\r\n/** @private */\r\nexport class FailedToStartTransportError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message, transport) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'FailedToStartTransportError';\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when the negotiation with the server failed to complete. */\r\n/** @private */\r\nexport class FailedToNegotiateWithServerError extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n */\r\n constructor(message) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.errorType = 'FailedToNegotiateWithServerError';\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n/** Error thrown when multiple errors have occurred. */\r\n/** @private */\r\nexport class AggregateErrors extends Error {\r\n /** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {Error[]} innerErrors The collection of errors this error is aggregating.\r\n */\r\n constructor(message, innerErrors) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.innerErrors = innerErrors;\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n//# sourceMappingURL=Errors.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpResponse } from \"./HttpClient\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { Platform, getGlobalThis, isArrayBuffer } from \"./Utils\";\r\nexport class FetchHttpClient extends HttpClient {\r\n constructor(logger) {\r\n super();\r\n this._logger = logger;\r\n // Node added a fetch implementation to the global scope starting in v18.\r\n // We need to add a cookie jar in node to be able to share cookies with WebSocket\r\n if (typeof fetch === \"undefined\" || Platform.isNode) {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n // Cookies aren't automatically handled in Node so we need to add a CookieJar to preserve cookies across requests\r\n this._jar = new (requireFunc(\"tough-cookie\")).CookieJar();\r\n if (typeof fetch === \"undefined\") {\r\n this._fetchType = requireFunc(\"node-fetch\");\r\n }\r\n else {\r\n // Use fetch from Node if available\r\n this._fetchType = fetch;\r\n }\r\n // node-fetch doesn't have a nice API for getting and setting cookies\r\n // fetch-cookie will wrap a fetch implementation with a default CookieJar or a provided one\r\n this._fetchType = requireFunc(\"fetch-cookie\")(this._fetchType, this._jar);\r\n }\r\n else {\r\n this._fetchType = fetch.bind(getGlobalThis());\r\n }\r\n if (typeof AbortController === \"undefined\") {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide\r\n this._abortControllerType = requireFunc(\"abort-controller\");\r\n }\r\n else {\r\n this._abortControllerType = AbortController;\r\n }\r\n }\r\n /** @inheritDoc */\r\n async send(request) {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n throw new AbortError();\r\n }\r\n if (!request.method) {\r\n throw new Error(\"No method defined.\");\r\n }\r\n if (!request.url) {\r\n throw new Error(\"No url defined.\");\r\n }\r\n const abortController = new this._abortControllerType();\r\n let error;\r\n // Hook our abortSignal into the abort controller\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n abortController.abort();\r\n error = new AbortError();\r\n };\r\n }\r\n // If a timeout has been passed in, setup a timeout to call abort\r\n // Type needs to be any to fit window.setTimeout and NodeJS.setTimeout\r\n let timeoutId = null;\r\n if (request.timeout) {\r\n const msTimeout = request.timeout;\r\n timeoutId = setTimeout(() => {\r\n abortController.abort();\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n error = new TimeoutError();\r\n }, msTimeout);\r\n }\r\n if (request.content === \"\") {\r\n request.content = undefined;\r\n }\r\n if (request.content) {\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n request.headers = request.headers || {};\r\n if (isArrayBuffer(request.content)) {\r\n request.headers[\"Content-Type\"] = \"application/octet-stream\";\r\n }\r\n else {\r\n request.headers[\"Content-Type\"] = \"text/plain;charset=UTF-8\";\r\n }\r\n }\r\n let response;\r\n try {\r\n response = await this._fetchType(request.url, {\r\n body: request.content,\r\n cache: \"no-cache\",\r\n credentials: request.withCredentials === true ? \"include\" : \"same-origin\",\r\n headers: {\r\n \"X-Requested-With\": \"XMLHttpRequest\",\r\n ...request.headers,\r\n },\r\n method: request.method,\r\n mode: \"cors\",\r\n redirect: \"follow\",\r\n signal: abortController.signal,\r\n });\r\n }\r\n catch (e) {\r\n if (error) {\r\n throw error;\r\n }\r\n this._logger.log(LogLevel.Warning, `Error from HTTP request. ${e}.`);\r\n throw e;\r\n }\r\n finally {\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n }\r\n if (!response.ok) {\r\n const errorMessage = await deserializeContent(response, \"text\");\r\n throw new HttpError(errorMessage || response.statusText, response.status);\r\n }\r\n const content = deserializeContent(response, request.responseType);\r\n const payload = await content;\r\n return new HttpResponse(response.status, response.statusText, payload);\r\n }\r\n getCookieString(url) {\r\n let cookies = \"\";\r\n if (Platform.isNode && this._jar) {\r\n // @ts-ignore: unused variable\r\n this._jar.getCookies(url, (e, c) => cookies = c.join(\"; \"));\r\n }\r\n return cookies;\r\n }\r\n}\r\nfunction deserializeContent(response, responseType) {\r\n let content;\r\n switch (responseType) {\r\n case \"arraybuffer\":\r\n content = response.arrayBuffer();\r\n break;\r\n case \"text\":\r\n content = response.text();\r\n break;\r\n case \"blob\":\r\n case \"document\":\r\n case \"json\":\r\n throw new Error(`${responseType} is not supported.`);\r\n default:\r\n content = response.text();\r\n break;\r\n }\r\n return content;\r\n}\r\n//# sourceMappingURL=FetchHttpClient.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n/** @private */\r\nexport class HandshakeProtocol {\r\n // Handshake request is always JSON\r\n writeHandshakeRequest(handshakeRequest) {\r\n return TextMessageFormat.write(JSON.stringify(handshakeRequest));\r\n }\r\n parseHandshakeResponse(data) {\r\n let messageData;\r\n let remainingData;\r\n if (isArrayBuffer(data)) {\r\n // Format is binary but still need to read JSON text from handshake response\r\n const binaryData = new Uint8Array(data);\r\n const separatorIndex = binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));\r\n remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;\r\n }\r\n else {\r\n const textData = data;\r\n const separatorIndex = textData.indexOf(TextMessageFormat.RecordSeparator);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = textData.substring(0, responseLength);\r\n remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null;\r\n }\r\n // At this point we should have just the single handshake message\r\n const messages = TextMessageFormat.parse(messageData);\r\n const response = JSON.parse(messages[0]);\r\n if (response.type) {\r\n throw new Error(\"Expected a handshake response from the server.\");\r\n }\r\n const responseMessage = response;\r\n // multiple messages could have arrived with handshake\r\n // return additional data to be parsed as usual, or null if all parsed\r\n return [remainingData, responseMessage];\r\n }\r\n}\r\n//# sourceMappingURL=HandshakeProtocol.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nexport class HeaderNames {\r\n}\r\nHeaderNames.Authorization = \"Authorization\";\r\nHeaderNames.Cookie = \"Cookie\";\r\n//# sourceMappingURL=HeaderNames.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n/** Represents an HTTP response. */\r\nexport class HttpResponse {\r\n constructor(statusCode, statusText, content) {\r\n this.statusCode = statusCode;\r\n this.statusText = statusText;\r\n this.content = content;\r\n }\r\n}\r\n/** Abstraction over an HTTP client.\r\n *\r\n * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.\r\n */\r\nexport class HttpClient {\r\n get(url, options) {\r\n return this.send({\r\n ...options,\r\n method: \"GET\",\r\n url,\r\n });\r\n }\r\n post(url, options) {\r\n return this.send({\r\n ...options,\r\n method: \"POST\",\r\n url,\r\n });\r\n }\r\n delete(url, options) {\r\n return this.send({\r\n ...options,\r\n method: \"DELETE\",\r\n url,\r\n });\r\n }\r\n /** Gets all cookies that apply to the specified URL.\r\n *\r\n * @param url The URL that the cookies are valid for.\r\n * @returns {string} A string containing all the key-value cookie pairs for the specified URL.\r\n */\r\n // @ts-ignore\r\n getCookieString(url) {\r\n return \"\";\r\n }\r\n}\r\n//# sourceMappingURL=HttpClient.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { AccessTokenHttpClient } from \"./AccessTokenHttpClient\";\r\nimport { DefaultHttpClient } from \"./DefaultHttpClient\";\r\nimport { AggregateErrors, DisabledTransportError, FailedToNegotiateWithServerError, FailedToStartTransportError, HttpError, UnsupportedTransportError, AbortError } from \"./Errors\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { HttpTransportType, TransferFormat } from \"./ITransport\";\r\nimport { LongPollingTransport } from \"./LongPollingTransport\";\r\nimport { ServerSentEventsTransport } from \"./ServerSentEventsTransport\";\r\nimport { Arg, createLogger, getUserAgentHeader, Platform } from \"./Utils\";\r\nimport { WebSocketTransport } from \"./WebSocketTransport\";\r\nconst MAX_REDIRECTS = 100;\r\n/** @private */\r\nexport class HttpConnection {\r\n constructor(url, options = {}) {\r\n this._stopPromiseResolver = () => { };\r\n this.features = {};\r\n this._negotiateVersion = 1;\r\n Arg.isRequired(url, \"url\");\r\n this._logger = createLogger(options.logger);\r\n this.baseUrl = this._resolveUrl(url);\r\n options = options || {};\r\n options.logMessageContent = options.logMessageContent === undefined ? false : options.logMessageContent;\r\n if (typeof options.withCredentials === \"boolean\" || options.withCredentials === undefined) {\r\n options.withCredentials = options.withCredentials === undefined ? true : options.withCredentials;\r\n }\r\n else {\r\n throw new Error(\"withCredentials option was not a 'boolean' or 'undefined' value\");\r\n }\r\n options.timeout = options.timeout === undefined ? 100 * 1000 : options.timeout;\r\n let webSocketModule = null;\r\n let eventSourceModule = null;\r\n if (Platform.isNode && typeof require !== \"undefined\") {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n webSocketModule = requireFunc(\"ws\");\r\n eventSourceModule = requireFunc(\"eventsource\");\r\n }\r\n if (!Platform.isNode && typeof WebSocket !== \"undefined\" && !options.WebSocket) {\r\n options.WebSocket = WebSocket;\r\n }\r\n else if (Platform.isNode && !options.WebSocket) {\r\n if (webSocketModule) {\r\n options.WebSocket = webSocketModule;\r\n }\r\n }\r\n if (!Platform.isNode && typeof EventSource !== \"undefined\" && !options.EventSource) {\r\n options.EventSource = EventSource;\r\n }\r\n else if (Platform.isNode && !options.EventSource) {\r\n if (typeof eventSourceModule !== \"undefined\") {\r\n options.EventSource = eventSourceModule;\r\n }\r\n }\r\n this._httpClient = new AccessTokenHttpClient(options.httpClient || new DefaultHttpClient(this._logger), options.accessTokenFactory);\r\n this._connectionState = \"Disconnected\" /* ConnectionState.Disconnected */;\r\n this._connectionStarted = false;\r\n this._options = options;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n async start(transferFormat) {\r\n transferFormat = transferFormat || TransferFormat.Binary;\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._logger.log(LogLevel.Debug, `Starting connection with transfer format '${TransferFormat[transferFormat]}'.`);\r\n if (this._connectionState !== \"Disconnected\" /* ConnectionState.Disconnected */) {\r\n return Promise.reject(new Error(\"Cannot start an HttpConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n this._connectionState = \"Connecting\" /* ConnectionState.Connecting */;\r\n this._startInternalPromise = this._startInternal(transferFormat);\r\n await this._startInternalPromise;\r\n // The TypeScript compiler thinks that connectionState must be Connecting here. The TypeScript compiler is wrong.\r\n if (this._connectionState === \"Disconnecting\" /* ConnectionState.Disconnecting */) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"Failed to start the HttpConnection before stop() was called.\";\r\n this._logger.log(LogLevel.Error, message);\r\n // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise.\r\n await this._stopPromise;\r\n return Promise.reject(new AbortError(message));\r\n }\r\n else if (this._connectionState !== \"Connected\" /* ConnectionState.Connected */) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!\";\r\n this._logger.log(LogLevel.Error, message);\r\n return Promise.reject(new AbortError(message));\r\n }\r\n this._connectionStarted = true;\r\n }\r\n send(data) {\r\n if (this._connectionState !== \"Connected\" /* ConnectionState.Connected */) {\r\n return Promise.reject(new Error(\"Cannot send data if the connection is not in the 'Connected' State.\"));\r\n }\r\n if (!this._sendQueue) {\r\n this._sendQueue = new TransportSendQueue(this.transport);\r\n }\r\n // Transport will not be null if state is connected\r\n return this._sendQueue.send(data);\r\n }\r\n async stop(error) {\r\n if (this._connectionState === \"Disconnected\" /* ConnectionState.Disconnected */) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n if (this._connectionState === \"Disconnecting\" /* ConnectionState.Disconnecting */) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise;\r\n }\r\n this._connectionState = \"Disconnecting\" /* ConnectionState.Disconnecting */;\r\n this._stopPromise = new Promise((resolve) => {\r\n // Don't complete stop() until stopConnection() completes.\r\n this._stopPromiseResolver = resolve;\r\n });\r\n // stopInternal should never throw so just observe it.\r\n await this._stopInternal(error);\r\n await this._stopPromise;\r\n }\r\n async _stopInternal(error) {\r\n // Set error as soon as possible otherwise there is a race between\r\n // the transport closing and providing an error and the error from a close message\r\n // We would prefer the close message error.\r\n this._stopError = error;\r\n try {\r\n await this._startInternalPromise;\r\n }\r\n catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n // The transport's onclose will trigger stopConnection which will run our onclose event.\r\n // The transport should always be set if currently connected. If it wasn't set, it's likely because\r\n // stop was called during start() and start() failed.\r\n if (this.transport) {\r\n try {\r\n await this.transport.stop();\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.transport.stop() threw error '${e}'.`);\r\n this._stopConnection();\r\n }\r\n this.transport = undefined;\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, \"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.\");\r\n }\r\n }\r\n async _startInternal(transferFormat) {\r\n // Store the original base url and the access token factory since they may change\r\n // as part of negotiating\r\n let url = this.baseUrl;\r\n this._accessTokenFactory = this._options.accessTokenFactory;\r\n this._httpClient._accessTokenFactory = this._accessTokenFactory;\r\n try {\r\n if (this._options.skipNegotiation) {\r\n if (this._options.transport === HttpTransportType.WebSockets) {\r\n // No need to add a connection ID in this case\r\n this.transport = this._constructTransport(HttpTransportType.WebSockets);\r\n // We should just call connect directly in this case.\r\n // No fallback or negotiate in this case.\r\n await this._startTransport(url, transferFormat);\r\n }\r\n else {\r\n throw new Error(\"Negotiation can only be skipped when using the WebSocket transport directly.\");\r\n }\r\n }\r\n else {\r\n let negotiateResponse = null;\r\n let redirects = 0;\r\n do {\r\n negotiateResponse = await this._getNegotiationResponse(url);\r\n // the user tries to stop the connection when it is being started\r\n if (this._connectionState === \"Disconnecting\" /* ConnectionState.Disconnecting */ || this._connectionState === \"Disconnected\" /* ConnectionState.Disconnected */) {\r\n throw new AbortError(\"The connection was stopped during negotiation.\");\r\n }\r\n if (negotiateResponse.error) {\r\n throw new Error(negotiateResponse.error);\r\n }\r\n if (negotiateResponse.ProtocolVersion) {\r\n throw new Error(\"Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.\");\r\n }\r\n if (negotiateResponse.url) {\r\n url = negotiateResponse.url;\r\n }\r\n if (negotiateResponse.accessToken) {\r\n // Replace the current access token factory with one that uses\r\n // the returned access token\r\n const accessToken = negotiateResponse.accessToken;\r\n this._accessTokenFactory = () => accessToken;\r\n // set the factory to undefined so the AccessTokenHttpClient won't retry with the same token, since we know it won't change until a connection restart\r\n this._httpClient._accessToken = accessToken;\r\n this._httpClient._accessTokenFactory = undefined;\r\n }\r\n redirects++;\r\n } while (negotiateResponse.url && redirects < MAX_REDIRECTS);\r\n if (redirects === MAX_REDIRECTS && negotiateResponse.url) {\r\n throw new Error(\"Negotiate redirection limit exceeded.\");\r\n }\r\n await this._createTransport(url, this._options.transport, negotiateResponse, transferFormat);\r\n }\r\n if (this.transport instanceof LongPollingTransport) {\r\n this.features.inherentKeepAlive = true;\r\n }\r\n if (this._connectionState === \"Connecting\" /* ConnectionState.Connecting */) {\r\n // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise.\r\n // start() will handle the case when stop was called and startInternal exits still in the disconnecting state.\r\n this._logger.log(LogLevel.Debug, \"The HttpConnection connected successfully.\");\r\n this._connectionState = \"Connected\" /* ConnectionState.Connected */;\r\n }\r\n // stop() is waiting on us via this.startInternalPromise so keep this.transport around so it can clean up.\r\n // This is the only case startInternal can exit in neither the connected nor disconnected state because stopConnection()\r\n // will transition to the disconnected state. start() will wait for the transition using the stopPromise.\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, \"Failed to start the connection: \" + e);\r\n this._connectionState = \"Disconnected\" /* ConnectionState.Disconnected */;\r\n this.transport = undefined;\r\n // if start fails, any active calls to stop assume that start will complete the stop promise\r\n this._stopPromiseResolver();\r\n return Promise.reject(e);\r\n }\r\n }\r\n async _getNegotiationResponse(url) {\r\n const headers = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n const negotiateUrl = this._resolveNegotiateUrl(url);\r\n this._logger.log(LogLevel.Debug, `Sending negotiation request: ${negotiateUrl}.`);\r\n try {\r\n const response = await this._httpClient.post(negotiateUrl, {\r\n content: \"\",\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n });\r\n if (response.statusCode !== 200) {\r\n return Promise.reject(new Error(`Unexpected status code returned from negotiate '${response.statusCode}'`));\r\n }\r\n const negotiateResponse = JSON.parse(response.content);\r\n if (!negotiateResponse.negotiateVersion || negotiateResponse.negotiateVersion < 1) {\r\n // Negotiate version 0 doesn't use connectionToken\r\n // So we set it equal to connectionId so all our logic can use connectionToken without being aware of the negotiate version\r\n negotiateResponse.connectionToken = negotiateResponse.connectionId;\r\n }\r\n if (negotiateResponse.useStatefulReconnect && this._options._useStatefulReconnect !== true) {\r\n return Promise.reject(new FailedToNegotiateWithServerError(\"Client didn't negotiate Stateful Reconnect but the server did.\"));\r\n }\r\n return negotiateResponse;\r\n }\r\n catch (e) {\r\n let errorMessage = \"Failed to complete negotiation with the server: \" + e;\r\n if (e instanceof HttpError) {\r\n if (e.statusCode === 404) {\r\n errorMessage = errorMessage + \" Either this is not a SignalR endpoint or there is a proxy blocking the connection.\";\r\n }\r\n }\r\n this._logger.log(LogLevel.Error, errorMessage);\r\n return Promise.reject(new FailedToNegotiateWithServerError(errorMessage));\r\n }\r\n }\r\n _createConnectUrl(url, connectionToken) {\r\n if (!connectionToken) {\r\n return url;\r\n }\r\n return url + (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + `id=${connectionToken}`;\r\n }\r\n async _createTransport(url, requestedTransport, negotiateResponse, requestedTransferFormat) {\r\n let connectUrl = this._createConnectUrl(url, negotiateResponse.connectionToken);\r\n if (this._isITransport(requestedTransport)) {\r\n this._logger.log(LogLevel.Debug, \"Connection was provided an instance of ITransport, using that directly.\");\r\n this.transport = requestedTransport;\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n this.connectionId = negotiateResponse.connectionId;\r\n return;\r\n }\r\n const transportExceptions = [];\r\n const transports = negotiateResponse.availableTransports || [];\r\n let negotiate = negotiateResponse;\r\n for (const endpoint of transports) {\r\n const transportOrError = this._resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat, (negotiate === null || negotiate === void 0 ? void 0 : negotiate.useStatefulReconnect) === true);\r\n if (transportOrError instanceof Error) {\r\n // Store the error and continue, we don't want to cause a re-negotiate in these cases\r\n transportExceptions.push(`${endpoint.transport} failed:`);\r\n transportExceptions.push(transportOrError);\r\n }\r\n else if (this._isITransport(transportOrError)) {\r\n this.transport = transportOrError;\r\n if (!negotiate) {\r\n try {\r\n negotiate = await this._getNegotiationResponse(url);\r\n }\r\n catch (ex) {\r\n return Promise.reject(ex);\r\n }\r\n connectUrl = this._createConnectUrl(url, negotiate.connectionToken);\r\n }\r\n try {\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n this.connectionId = negotiate.connectionId;\r\n return;\r\n }\r\n catch (ex) {\r\n this._logger.log(LogLevel.Error, `Failed to start the transport '${endpoint.transport}': ${ex}`);\r\n negotiate = undefined;\r\n transportExceptions.push(new FailedToStartTransportError(`${endpoint.transport} failed: ${ex}`, HttpTransportType[endpoint.transport]));\r\n if (this._connectionState !== \"Connecting\" /* ConnectionState.Connecting */) {\r\n const message = \"Failed to select transport before stop() was called.\";\r\n this._logger.log(LogLevel.Debug, message);\r\n return Promise.reject(new AbortError(message));\r\n }\r\n }\r\n }\r\n }\r\n if (transportExceptions.length > 0) {\r\n return Promise.reject(new AggregateErrors(`Unable to connect to the server with any of the available transports. ${transportExceptions.join(\" \")}`, transportExceptions));\r\n }\r\n return Promise.reject(new Error(\"None of the transports supported by the client are supported by the server.\"));\r\n }\r\n _constructTransport(transport) {\r\n switch (transport) {\r\n case HttpTransportType.WebSockets:\r\n if (!this._options.WebSocket) {\r\n throw new Error(\"'WebSocket' is not supported in your environment.\");\r\n }\r\n return new WebSocketTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent, this._options.WebSocket, this._options.headers || {});\r\n case HttpTransportType.ServerSentEvents:\r\n if (!this._options.EventSource) {\r\n throw new Error(\"'EventSource' is not supported in your environment.\");\r\n }\r\n return new ServerSentEventsTransport(this._httpClient, this._httpClient._accessToken, this._logger, this._options);\r\n case HttpTransportType.LongPolling:\r\n return new LongPollingTransport(this._httpClient, this._logger, this._options);\r\n default:\r\n throw new Error(`Unknown transport: ${transport}.`);\r\n }\r\n }\r\n _startTransport(url, transferFormat) {\r\n this.transport.onreceive = this.onreceive;\r\n if (this.features.reconnect) {\r\n this.transport.onclose = async (e) => {\r\n let callStop = false;\r\n if (this.features.reconnect) {\r\n try {\r\n this.features.disconnected();\r\n await this.transport.connect(url, transferFormat);\r\n await this.features.resend();\r\n }\r\n catch {\r\n callStop = true;\r\n }\r\n }\r\n else {\r\n this._stopConnection(e);\r\n return;\r\n }\r\n if (callStop) {\r\n this._stopConnection(e);\r\n }\r\n };\r\n }\r\n else {\r\n this.transport.onclose = (e) => this._stopConnection(e);\r\n }\r\n return this.transport.connect(url, transferFormat);\r\n }\r\n _resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat, useStatefulReconnect) {\r\n const transport = HttpTransportType[endpoint.transport];\r\n if (transport === null || transport === undefined) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n return new Error(`Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n }\r\n else {\r\n if (transportMatches(requestedTransport, transport)) {\r\n const transferFormats = endpoint.transferFormats.map((s) => TransferFormat[s]);\r\n if (transferFormats.indexOf(requestedTransferFormat) >= 0) {\r\n if ((transport === HttpTransportType.WebSockets && !this._options.WebSocket) ||\r\n (transport === HttpTransportType.ServerSentEvents && !this._options.EventSource)) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it is not supported in your environment.'`);\r\n return new UnsupportedTransportError(`'${HttpTransportType[transport]}' is not supported in your environment.`, transport);\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, `Selecting transport '${HttpTransportType[transport]}'.`);\r\n try {\r\n this.features.reconnect = transport === HttpTransportType.WebSockets ? useStatefulReconnect : undefined;\r\n return this._constructTransport(transport);\r\n }\r\n catch (ex) {\r\n return ex;\r\n }\r\n }\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it does not support the requested transfer format '${TransferFormat[requestedTransferFormat]}'.`);\r\n return new Error(`'${HttpTransportType[transport]}' does not support ${TransferFormat[requestedTransferFormat]}.`);\r\n }\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it was disabled by the client.`);\r\n return new DisabledTransportError(`'${HttpTransportType[transport]}' is disabled by the client.`, transport);\r\n }\r\n }\r\n }\r\n _isITransport(transport) {\r\n return transport && typeof (transport) === \"object\" && \"connect\" in transport;\r\n }\r\n _stopConnection(error) {\r\n this._logger.log(LogLevel.Debug, `HttpConnection.stopConnection(${error}) called while in state ${this._connectionState}.`);\r\n this.transport = undefined;\r\n // If we have a stopError, it takes precedence over the error from the transport\r\n error = this._stopError || error;\r\n this._stopError = undefined;\r\n if (this._connectionState === \"Disconnected\" /* ConnectionState.Disconnected */) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is already in the disconnected state.`);\r\n return;\r\n }\r\n if (this._connectionState === \"Connecting\" /* ConnectionState.Connecting */) {\r\n this._logger.log(LogLevel.Warning, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is still in the connecting state.`);\r\n throw new Error(`HttpConnection.stopConnection(${error}) was called while the connection is still in the connecting state.`);\r\n }\r\n if (this._connectionState === \"Disconnecting\" /* ConnectionState.Disconnecting */) {\r\n // A call to stop() induced this call to stopConnection and needs to be completed.\r\n // Any stop() awaiters will be scheduled to continue after the onclose callback fires.\r\n this._stopPromiseResolver();\r\n }\r\n if (error) {\r\n this._logger.log(LogLevel.Error, `Connection disconnected with error '${error}'.`);\r\n }\r\n else {\r\n this._logger.log(LogLevel.Information, \"Connection disconnected.\");\r\n }\r\n if (this._sendQueue) {\r\n this._sendQueue.stop().catch((e) => {\r\n this._logger.log(LogLevel.Error, `TransportSendQueue.stop() threw error '${e}'.`);\r\n });\r\n this._sendQueue = undefined;\r\n }\r\n this.connectionId = undefined;\r\n this._connectionState = \"Disconnected\" /* ConnectionState.Disconnected */;\r\n if (this._connectionStarted) {\r\n this._connectionStarted = false;\r\n try {\r\n if (this.onclose) {\r\n this.onclose(error);\r\n }\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.onclose(${error}) threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n _resolveUrl(url) {\r\n // startsWith is not supported in IE\r\n if (url.lastIndexOf(\"https://\", 0) === 0 || url.lastIndexOf(\"http://\", 0) === 0) {\r\n return url;\r\n }\r\n if (!Platform.isBrowser) {\r\n throw new Error(`Cannot resolve '${url}'.`);\r\n }\r\n // Setting the url to the href propery of an anchor tag handles normalization\r\n // for us. There are 3 main cases.\r\n // 1. Relative path normalization e.g \"b\" -> \"http://localhost:5000/a/b\"\r\n // 2. Absolute path normalization e.g \"/a/b\" -> \"http://localhost:5000/a/b\"\r\n // 3. Networkpath reference normalization e.g \"//localhost:5000/a/b\" -> \"http://localhost:5000/a/b\"\r\n const aTag = window.document.createElement(\"a\");\r\n aTag.href = url;\r\n this._logger.log(LogLevel.Information, `Normalizing '${url}' to '${aTag.href}'.`);\r\n return aTag.href;\r\n }\r\n _resolveNegotiateUrl(url) {\r\n const negotiateUrl = new URL(url);\r\n if (negotiateUrl.pathname.endsWith('/')) {\r\n negotiateUrl.pathname += \"negotiate\";\r\n }\r\n else {\r\n negotiateUrl.pathname += \"/negotiate\";\r\n }\r\n const searchParams = new URLSearchParams(negotiateUrl.searchParams);\r\n if (!searchParams.has(\"negotiateVersion\")) {\r\n searchParams.append(\"negotiateVersion\", this._negotiateVersion.toString());\r\n }\r\n if (searchParams.has(\"useStatefulReconnect\")) {\r\n if (searchParams.get(\"useStatefulReconnect\") === \"true\") {\r\n this._options._useStatefulReconnect = true;\r\n }\r\n }\r\n else if (this._options._useStatefulReconnect === true) {\r\n searchParams.append(\"useStatefulReconnect\", \"true\");\r\n }\r\n negotiateUrl.search = searchParams.toString();\r\n return negotiateUrl.toString();\r\n }\r\n}\r\nfunction transportMatches(requestedTransport, actualTransport) {\r\n return !requestedTransport || ((actualTransport & requestedTransport) !== 0);\r\n}\r\n/** @private */\r\nexport class TransportSendQueue {\r\n constructor(_transport) {\r\n this._transport = _transport;\r\n this._buffer = [];\r\n this._executing = true;\r\n this._sendBufferedData = new PromiseSource();\r\n this._transportResult = new PromiseSource();\r\n this._sendLoopPromise = this._sendLoop();\r\n }\r\n send(data) {\r\n this._bufferData(data);\r\n if (!this._transportResult) {\r\n this._transportResult = new PromiseSource();\r\n }\r\n return this._transportResult.promise;\r\n }\r\n stop() {\r\n this._executing = false;\r\n this._sendBufferedData.resolve();\r\n return this._sendLoopPromise;\r\n }\r\n _bufferData(data) {\r\n if (this._buffer.length && typeof (this._buffer[0]) !== typeof (data)) {\r\n throw new Error(`Expected data to be of type ${typeof (this._buffer)} but was of type ${typeof (data)}`);\r\n }\r\n this._buffer.push(data);\r\n this._sendBufferedData.resolve();\r\n }\r\n async _sendLoop() {\r\n while (true) {\r\n await this._sendBufferedData.promise;\r\n if (!this._executing) {\r\n if (this._transportResult) {\r\n this._transportResult.reject(\"Connection stopped.\");\r\n }\r\n break;\r\n }\r\n this._sendBufferedData = new PromiseSource();\r\n const transportResult = this._transportResult;\r\n this._transportResult = undefined;\r\n const data = typeof (this._buffer[0]) === \"string\" ?\r\n this._buffer.join(\"\") :\r\n TransportSendQueue._concatBuffers(this._buffer);\r\n this._buffer.length = 0;\r\n try {\r\n await this._transport.send(data);\r\n transportResult.resolve();\r\n }\r\n catch (error) {\r\n transportResult.reject(error);\r\n }\r\n }\r\n }\r\n static _concatBuffers(arrayBuffers) {\r\n const totalLength = arrayBuffers.map((b) => b.byteLength).reduce((a, b) => a + b);\r\n const result = new Uint8Array(totalLength);\r\n let offset = 0;\r\n for (const item of arrayBuffers) {\r\n result.set(new Uint8Array(item), offset);\r\n offset += item.byteLength;\r\n }\r\n return result.buffer;\r\n }\r\n}\r\nclass PromiseSource {\r\n constructor() {\r\n this.promise = new Promise((resolve, reject) => [this._resolver, this._rejecter] = [resolve, reject]);\r\n }\r\n resolve() {\r\n this._resolver();\r\n }\r\n reject(reason) {\r\n this._rejecter(reason);\r\n }\r\n}\r\n//# sourceMappingURL=HttpConnection.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { HandshakeProtocol } from \"./HandshakeProtocol\";\r\nimport { AbortError } from \"./Errors\";\r\nimport { MessageType } from \"./IHubProtocol\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { Subject } from \"./Subject\";\r\nimport { Arg, getErrorString, Platform } from \"./Utils\";\r\nimport { MessageBuffer } from \"./MessageBuffer\";\r\nconst DEFAULT_TIMEOUT_IN_MS = 30 * 1000;\r\nconst DEFAULT_PING_INTERVAL_IN_MS = 15 * 1000;\r\nconst DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE = 100000;\r\n/** Describes the current state of the {@link HubConnection} to the server. */\r\nexport var HubConnectionState;\r\n(function (HubConnectionState) {\r\n /** The hub connection is disconnected. */\r\n HubConnectionState[\"Disconnected\"] = \"Disconnected\";\r\n /** The hub connection is connecting. */\r\n HubConnectionState[\"Connecting\"] = \"Connecting\";\r\n /** The hub connection is connected. */\r\n HubConnectionState[\"Connected\"] = \"Connected\";\r\n /** The hub connection is disconnecting. */\r\n HubConnectionState[\"Disconnecting\"] = \"Disconnecting\";\r\n /** The hub connection is reconnecting. */\r\n HubConnectionState[\"Reconnecting\"] = \"Reconnecting\";\r\n})(HubConnectionState || (HubConnectionState = {}));\r\n/** Represents a connection to a SignalR Hub. */\r\nexport class HubConnection {\r\n /** @internal */\r\n // Using a public static factory method means we can have a private constructor and an _internal_\r\n // create method that can be used by HubConnectionBuilder. An \"internal\" constructor would just\r\n // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a\r\n // public parameter-less constructor.\r\n static create(connection, logger, protocol, reconnectPolicy, serverTimeoutInMilliseconds, keepAliveIntervalInMilliseconds, statefulReconnectBufferSize) {\r\n return new HubConnection(connection, logger, protocol, reconnectPolicy, serverTimeoutInMilliseconds, keepAliveIntervalInMilliseconds, statefulReconnectBufferSize);\r\n }\r\n constructor(connection, logger, protocol, reconnectPolicy, serverTimeoutInMilliseconds, keepAliveIntervalInMilliseconds, statefulReconnectBufferSize) {\r\n this._nextKeepAlive = 0;\r\n this._freezeEventListener = () => {\r\n this._logger.log(LogLevel.Warning, \"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep\");\r\n };\r\n Arg.isRequired(connection, \"connection\");\r\n Arg.isRequired(logger, \"logger\");\r\n Arg.isRequired(protocol, \"protocol\");\r\n this.serverTimeoutInMilliseconds = serverTimeoutInMilliseconds !== null && serverTimeoutInMilliseconds !== void 0 ? serverTimeoutInMilliseconds : DEFAULT_TIMEOUT_IN_MS;\r\n this.keepAliveIntervalInMilliseconds = keepAliveIntervalInMilliseconds !== null && keepAliveIntervalInMilliseconds !== void 0 ? keepAliveIntervalInMilliseconds : DEFAULT_PING_INTERVAL_IN_MS;\r\n this._statefulReconnectBufferSize = statefulReconnectBufferSize !== null && statefulReconnectBufferSize !== void 0 ? statefulReconnectBufferSize : DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE;\r\n this._logger = logger;\r\n this._protocol = protocol;\r\n this.connection = connection;\r\n this._reconnectPolicy = reconnectPolicy;\r\n this._handshakeProtocol = new HandshakeProtocol();\r\n this.connection.onreceive = (data) => this._processIncomingData(data);\r\n this.connection.onclose = (error) => this._connectionClosed(error);\r\n this._callbacks = {};\r\n this._methods = {};\r\n this._closedCallbacks = [];\r\n this._reconnectingCallbacks = [];\r\n this._reconnectedCallbacks = [];\r\n this._invocationId = 0;\r\n this._receivedHandshakeResponse = false;\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n this._cachedPingMessage = this._protocol.writeMessage({ type: MessageType.Ping });\r\n }\r\n /** Indicates the state of the {@link HubConnection} to the server. */\r\n get state() {\r\n return this._connectionState;\r\n }\r\n /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either\r\n * in the disconnected state or if the negotiation step was skipped.\r\n */\r\n get connectionId() {\r\n return this.connection ? (this.connection.connectionId || null) : null;\r\n }\r\n /** Indicates the url of the {@link HubConnection} to the server. */\r\n get baseUrl() {\r\n return this.connection.baseUrl || \"\";\r\n }\r\n /**\r\n * Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or\r\n * Reconnecting states.\r\n * @param {string} url The url to connect to.\r\n */\r\n set baseUrl(url) {\r\n if (this._connectionState !== HubConnectionState.Disconnected && this._connectionState !== HubConnectionState.Reconnecting) {\r\n throw new Error(\"The HubConnection must be in the Disconnected or Reconnecting state to change the url.\");\r\n }\r\n if (!url) {\r\n throw new Error(\"The HubConnection url must be a valid url.\");\r\n }\r\n this.connection.baseUrl = url;\r\n }\r\n /** Starts the connection.\r\n *\r\n * @returns {Promise<void>} A Promise that resolves when the connection has been successfully established, or rejects with an error.\r\n */\r\n start() {\r\n this._startPromise = this._startWithStateTransitions();\r\n return this._startPromise;\r\n }\r\n async _startWithStateTransitions() {\r\n if (this._connectionState !== HubConnectionState.Disconnected) {\r\n return Promise.reject(new Error(\"Cannot start a HubConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n this._connectionState = HubConnectionState.Connecting;\r\n this._logger.log(LogLevel.Debug, \"Starting HubConnection.\");\r\n try {\r\n await this._startInternal();\r\n if (Platform.isBrowser) {\r\n // Log when the browser freezes the tab so users know why their connection unexpectedly stopped working\r\n window.document.addEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n this._connectionState = HubConnectionState.Connected;\r\n this._connectionStarted = true;\r\n this._logger.log(LogLevel.Debug, \"HubConnection connected successfully.\");\r\n }\r\n catch (e) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._logger.log(LogLevel.Debug, `HubConnection failed to start successfully because of error '${e}'.`);\r\n return Promise.reject(e);\r\n }\r\n }\r\n async _startInternal() {\r\n this._stopDuringStartError = undefined;\r\n this._receivedHandshakeResponse = false;\r\n // Set up the promise before any connection is (re)started otherwise it could race with received messages\r\n const handshakePromise = new Promise((resolve, reject) => {\r\n this._handshakeResolver = resolve;\r\n this._handshakeRejecter = reject;\r\n });\r\n await this.connection.start(this._protocol.transferFormat);\r\n try {\r\n let version = this._protocol.version;\r\n if (!this.connection.features.reconnect) {\r\n // Stateful Reconnect starts with HubProtocol version 2, newer clients connecting to older servers will fail to connect due to\r\n // the handshake only supporting version 1, so we will try to send version 1 during the handshake to keep old servers working.\r\n version = 1;\r\n }\r\n const handshakeRequest = {\r\n protocol: this._protocol.name,\r\n version,\r\n };\r\n this._logger.log(LogLevel.Debug, \"Sending handshake request.\");\r\n await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(handshakeRequest));\r\n this._logger.log(LogLevel.Information, `Using HubProtocol '${this._protocol.name}'.`);\r\n // defensively cleanup timeout in case we receive a message from the server before we finish start\r\n this._cleanupTimeout();\r\n this._resetTimeoutPeriod();\r\n this._resetKeepAliveInterval();\r\n await handshakePromise;\r\n // It's important to check the stopDuringStartError instead of just relying on the handshakePromise\r\n // being rejected on close, because this continuation can run after both the handshake completed successfully\r\n // and the connection was closed.\r\n if (this._stopDuringStartError) {\r\n // It's important to throw instead of returning a rejected promise, because we don't want to allow any state\r\n // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise\r\n // will cause the calling continuation to get scheduled to run later.\r\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\r\n throw this._stopDuringStartError;\r\n }\r\n const useStatefulReconnect = this.connection.features.reconnect || false;\r\n if (useStatefulReconnect) {\r\n this._messageBuffer = new MessageBuffer(this._protocol, this.connection, this._statefulReconnectBufferSize);\r\n this.connection.features.disconnected = this._messageBuffer._disconnected.bind(this._messageBuffer);\r\n this.connection.features.resend = () => {\r\n if (this._messageBuffer) {\r\n return this._messageBuffer._resend();\r\n }\r\n };\r\n }\r\n if (!this.connection.features.inherentKeepAlive) {\r\n await this._sendMessage(this._cachedPingMessage);\r\n }\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Debug, `Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`);\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n // HttpConnection.stop() should not complete until after the onclose callback is invoked.\r\n // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes.\r\n await this.connection.stop(e);\r\n throw e;\r\n }\r\n }\r\n /** Stops the connection.\r\n *\r\n * @returns {Promise<void>} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.\r\n */\r\n async stop() {\r\n // Capture the start promise before the connection might be restarted in an onclose callback.\r\n const startPromise = this._startPromise;\r\n this.connection.features.reconnect = false;\r\n this._stopPromise = this._stopInternal();\r\n await this._stopPromise;\r\n try {\r\n // Awaiting undefined continues immediately\r\n await startPromise;\r\n }\r\n catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n }\r\n _stopInternal(error) {\r\n if (this._connectionState === HubConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HubConnection.stop(${error}) ignored because it is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise;\r\n }\r\n const state = this._connectionState;\r\n this._connectionState = HubConnectionState.Disconnecting;\r\n this._logger.log(LogLevel.Debug, \"Stopping HubConnection.\");\r\n if (this._reconnectDelayHandle) {\r\n // We're in a reconnect delay which means the underlying connection is currently already stopped.\r\n // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and\r\n // fire the onclose callbacks.\r\n this._logger.log(LogLevel.Debug, \"Connection stopped during reconnect delay. Done reconnecting.\");\r\n clearTimeout(this._reconnectDelayHandle);\r\n this._reconnectDelayHandle = undefined;\r\n this._completeClose();\r\n return Promise.resolve();\r\n }\r\n if (state === HubConnectionState.Connected) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._sendCloseMessage();\r\n }\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n this._stopDuringStartError = error || new AbortError(\"The connection was stopped before the hub handshake could complete.\");\r\n // HttpConnection.stop() should not complete until after either HttpConnection.start() fails\r\n // or the onclose callback is invoked. The onclose callback will transition the HubConnection\r\n // to the disconnected state if need be before HttpConnection.stop() completes.\r\n return this.connection.stop(error);\r\n }\r\n async _sendCloseMessage() {\r\n try {\r\n await this._sendWithProtocol(this._createCloseMessage());\r\n }\r\n catch {\r\n // Ignore, this is a best effort attempt to let the server know the client closed gracefully.\r\n }\r\n }\r\n /** Invokes a streaming hub method on the server using the specified name and arguments.\r\n *\r\n * @typeparam T The type of the items returned by the server.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {IStreamResult<T>} An object that yields results from the server as they are received.\r\n */\r\n stream(methodName, ...args) {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createStreamInvocation(methodName, args, streamIds);\r\n // eslint-disable-next-line prefer-const\r\n let promiseQueue;\r\n const subject = new Subject();\r\n subject.cancelCallback = () => {\r\n const cancelInvocation = this._createCancelInvocation(invocationDescriptor.invocationId);\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n return promiseQueue.then(() => {\r\n return this._sendWithProtocol(cancelInvocation);\r\n });\r\n };\r\n this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {\r\n if (error) {\r\n subject.error(error);\r\n return;\r\n }\r\n else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n subject.error(new Error(invocationEvent.error));\r\n }\r\n else {\r\n subject.complete();\r\n }\r\n }\r\n else {\r\n subject.next((invocationEvent.item));\r\n }\r\n }\r\n };\r\n promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n subject.error(e);\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n });\r\n this._launchStreams(streams, promiseQueue);\r\n return subject;\r\n }\r\n _sendMessage(message) {\r\n this._resetKeepAliveInterval();\r\n return this.connection.send(message);\r\n }\r\n /**\r\n * Sends a js object to the server.\r\n * @param message The js object to serialize and send.\r\n */\r\n _sendWithProtocol(message) {\r\n if (this._messageBuffer) {\r\n return this._messageBuffer._send(message);\r\n }\r\n else {\r\n return this._sendMessage(this._protocol.writeMessage(message));\r\n }\r\n }\r\n /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.\r\n *\r\n * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still\r\n * be processing the invocation.\r\n *\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise<void>} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.\r\n */\r\n send(methodName, ...args) {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const sendPromise = this._sendWithProtocol(this._createInvocation(methodName, args, true, streamIds));\r\n this._launchStreams(streams, sendPromise);\r\n return sendPromise;\r\n }\r\n /** Invokes a hub method on the server using the specified name and arguments.\r\n *\r\n * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise\r\n * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of\r\n * resolving the Promise.\r\n *\r\n * @typeparam T The expected return type.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise<T>} A Promise that resolves with the result of the server method (if any), or rejects with an error.\r\n */\r\n invoke(methodName, ...args) {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createInvocation(methodName, args, false, streamIds);\r\n const p = new Promise((resolve, reject) => {\r\n // invocationId will always have a value for a non-blocking invocation\r\n this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {\r\n if (error) {\r\n reject(error);\r\n return;\r\n }\r\n else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n reject(new Error(invocationEvent.error));\r\n }\r\n else {\r\n resolve(invocationEvent.result);\r\n }\r\n }\r\n else {\r\n reject(new Error(`Unexpected message type: ${invocationEvent.type}`));\r\n }\r\n }\r\n };\r\n const promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n reject(e);\r\n // invocationId will always have a value for a non-blocking invocation\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n });\r\n this._launchStreams(streams, promiseQueue);\r\n });\r\n return p;\r\n }\r\n on(methodName, newMethod) {\r\n if (!methodName || !newMethod) {\r\n return;\r\n }\r\n methodName = methodName.toLowerCase();\r\n if (!this._methods[methodName]) {\r\n this._methods[methodName] = [];\r\n }\r\n // Preventing adding the same handler multiple times.\r\n if (this._methods[methodName].indexOf(newMethod) !== -1) {\r\n return;\r\n }\r\n this._methods[methodName].push(newMethod);\r\n }\r\n off(methodName, method) {\r\n if (!methodName) {\r\n return;\r\n }\r\n methodName = methodName.toLowerCase();\r\n const handlers = this._methods[methodName];\r\n if (!handlers) {\r\n return;\r\n }\r\n if (method) {\r\n const removeIdx = handlers.indexOf(method);\r\n if (removeIdx !== -1) {\r\n handlers.splice(removeIdx, 1);\r\n if (handlers.length === 0) {\r\n delete this._methods[methodName];\r\n }\r\n }\r\n }\r\n else {\r\n delete this._methods[methodName];\r\n }\r\n }\r\n /** Registers a handler that will be invoked when the connection is closed.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).\r\n */\r\n onclose(callback) {\r\n if (callback) {\r\n this._closedCallbacks.push(callback);\r\n }\r\n }\r\n /** Registers a handler that will be invoked when the connection starts reconnecting.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any).\r\n */\r\n onreconnecting(callback) {\r\n if (callback) {\r\n this._reconnectingCallbacks.push(callback);\r\n }\r\n }\r\n /** Registers a handler that will be invoked when the connection successfully reconnects.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection successfully reconnects.\r\n */\r\n onreconnected(callback) {\r\n if (callback) {\r\n this._reconnectedCallbacks.push(callback);\r\n }\r\n }\r\n _processIncomingData(data) {\r\n this._cleanupTimeout();\r\n if (!this._receivedHandshakeResponse) {\r\n data = this._processHandshakeResponse(data);\r\n this._receivedHandshakeResponse = true;\r\n }\r\n // Data may have all been read when processing handshake response\r\n if (data) {\r\n // Parse the messages\r\n const messages = this._protocol.parseMessages(data, this._logger);\r\n for (const message of messages) {\r\n if (this._messageBuffer && !this._messageBuffer._shouldProcessMessage(message)) {\r\n // Don't process the message, we are either waiting for a SequenceMessage or received a duplicate message\r\n continue;\r\n }\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n this._invokeClientMethod(message)\r\n .catch((e) => {\r\n this._logger.log(LogLevel.Error, `Invoke client method threw error: ${getErrorString(e)}`);\r\n });\r\n break;\r\n case MessageType.StreamItem:\r\n case MessageType.Completion: {\r\n const callback = this._callbacks[message.invocationId];\r\n if (callback) {\r\n if (message.type === MessageType.Completion) {\r\n delete this._callbacks[message.invocationId];\r\n }\r\n try {\r\n callback(message);\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream callback threw error: ${getErrorString(e)}`);\r\n }\r\n }\r\n break;\r\n }\r\n case MessageType.Ping:\r\n // Don't care about pings\r\n break;\r\n case MessageType.Close: {\r\n this._logger.log(LogLevel.Information, \"Close message received from server.\");\r\n const error = message.error ? new Error(\"Server returned an error on close: \" + message.error) : undefined;\r\n if (message.allowReconnect === true) {\r\n // It feels wrong not to await connection.stop() here, but processIncomingData is called as part of an onreceive callback which is not async,\r\n // this is already the behavior for serverTimeout(), and HttpConnection.Stop() should catch and log all possible exceptions.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(error);\r\n }\r\n else {\r\n // We cannot await stopInternal() here, but subsequent calls to stop() will await this if stopInternal() is still ongoing.\r\n this._stopPromise = this._stopInternal(error);\r\n }\r\n break;\r\n }\r\n case MessageType.Ack:\r\n if (this._messageBuffer) {\r\n this._messageBuffer._ack(message);\r\n }\r\n break;\r\n case MessageType.Sequence:\r\n if (this._messageBuffer) {\r\n this._messageBuffer._resetSequence(message);\r\n }\r\n break;\r\n default:\r\n this._logger.log(LogLevel.Warning, `Invalid message type: ${message.type}.`);\r\n break;\r\n }\r\n }\r\n }\r\n this._resetTimeoutPeriod();\r\n }\r\n _processHandshakeResponse(data) {\r\n let responseMessage;\r\n let remainingData;\r\n try {\r\n [remainingData, responseMessage] = this._handshakeProtocol.parseHandshakeResponse(data);\r\n }\r\n catch (e) {\r\n const message = \"Error parsing handshake response: \" + e;\r\n this._logger.log(LogLevel.Error, message);\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n }\r\n if (responseMessage.error) {\r\n const message = \"Server returned handshake error: \" + responseMessage.error;\r\n this._logger.log(LogLevel.Error, message);\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n }\r\n else {\r\n this._logger.log(LogLevel.Debug, \"Server handshake complete.\");\r\n }\r\n this._handshakeResolver();\r\n return remainingData;\r\n }\r\n _resetKeepAliveInterval() {\r\n if (this.connection.features.inherentKeepAlive) {\r\n return;\r\n }\r\n // Set the time we want the next keep alive to be sent\r\n // Timer will be setup on next message receive\r\n this._nextKeepAlive = new Date().getTime() + this.keepAliveIntervalInMilliseconds;\r\n this._cleanupPingTimer();\r\n }\r\n _resetTimeoutPeriod() {\r\n if (!this.connection.features || !this.connection.features.inherentKeepAlive) {\r\n // Set the timeout timer\r\n this._timeoutHandle = setTimeout(() => this.serverTimeout(), this.serverTimeoutInMilliseconds);\r\n // Set keepAlive timer if there isn't one\r\n if (this._pingServerHandle === undefined) {\r\n let nextPing = this._nextKeepAlive - new Date().getTime();\r\n if (nextPing < 0) {\r\n nextPing = 0;\r\n }\r\n // The timer needs to be set from a networking callback to avoid Chrome timer throttling from causing timers to run once a minute\r\n this._pingServerHandle = setTimeout(async () => {\r\n if (this._connectionState === HubConnectionState.Connected) {\r\n try {\r\n await this._sendMessage(this._cachedPingMessage);\r\n }\r\n catch {\r\n // We don't care about the error. It should be seen elsewhere in the client.\r\n // The connection is probably in a bad or closed state now, cleanup the timer so it stops triggering\r\n this._cleanupPingTimer();\r\n }\r\n }\r\n }, nextPing);\r\n }\r\n }\r\n }\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n serverTimeout() {\r\n // The server hasn't talked to us in a while. It doesn't like us anymore ... :(\r\n // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(new Error(\"Server timeout elapsed without receiving a message from the server.\"));\r\n }\r\n async _invokeClientMethod(invocationMessage) {\r\n const methodName = invocationMessage.target.toLowerCase();\r\n const methods = this._methods[methodName];\r\n if (!methods) {\r\n this._logger.log(LogLevel.Warning, `No client method with the name '${methodName}' found.`);\r\n // No handlers provided by client but the server is expecting a response still, so we send an error\r\n if (invocationMessage.invocationId) {\r\n this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r\n await this._sendWithProtocol(this._createCompletionMessage(invocationMessage.invocationId, \"Client didn't provide a result.\", null));\r\n }\r\n return;\r\n }\r\n // Avoid issues with handlers removing themselves thus modifying the list while iterating through it\r\n const methodsCopy = methods.slice();\r\n // Server expects a response\r\n const expectsResponse = invocationMessage.invocationId ? true : false;\r\n // We preserve the last result or exception but still call all handlers\r\n let res;\r\n let exception;\r\n let completionMessage;\r\n for (const m of methodsCopy) {\r\n try {\r\n const prevRes = res;\r\n res = await m.apply(this, invocationMessage.arguments);\r\n if (expectsResponse && res && prevRes) {\r\n this._logger.log(LogLevel.Error, `Multiple results provided for '${methodName}'. Sending error to server.`);\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId, `Client provided multiple results.`, null);\r\n }\r\n // Ignore exception if we got a result after, the exception will be logged\r\n exception = undefined;\r\n }\r\n catch (e) {\r\n exception = e;\r\n this._logger.log(LogLevel.Error, `A callback for the method '${methodName}' threw error '${e}'.`);\r\n }\r\n }\r\n if (completionMessage) {\r\n await this._sendWithProtocol(completionMessage);\r\n }\r\n else if (expectsResponse) {\r\n // If there is an exception that means either no result was given or a handler after a result threw\r\n if (exception) {\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId, `${exception}`, null);\r\n }\r\n else if (res !== undefined) {\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId, null, res);\r\n }\r\n else {\r\n this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r\n // Client didn't provide a result or throw from a handler, server expects a response so we send an error\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId, \"Client didn't provide a result.\", null);\r\n }\r\n await this._sendWithProtocol(completionMessage);\r\n }\r\n else {\r\n if (res) {\r\n this._logger.log(LogLevel.Error, `Result given for '${methodName}' method but server is not expecting a result.`);\r\n }\r\n }\r\n }\r\n _connectionClosed(error) {\r\n this._logger.log(LogLevel.Debug, `HubConnection.connectionClosed(${error}) called while in state ${this._connectionState}.`);\r\n // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet.\r\n this._stopDuringStartError = this._stopDuringStartError || error || new AbortError(\"The underlying connection was closed before the hub handshake could complete.\");\r\n // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it.\r\n // If it has already completed, this should just noop.\r\n if (this._handshakeResolver) {\r\n this._handshakeResolver();\r\n }\r\n this._cancelCallbacksWithError(error || new Error(\"Invocation canceled due to the underlying connection being closed.\"));\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._completeClose(error);\r\n }\r\n else if (this._connectionState === HubConnectionState.Connected && this._reconnectPolicy) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._reconnect(error);\r\n }\r\n else if (this._connectionState === HubConnectionState.Connected) {\r\n this._completeClose(error);\r\n }\r\n // If none of the above if conditions were true were called the HubConnection must be in either:\r\n // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it.\r\n // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt\r\n // and potentially continue the reconnect() loop.\r\n // 3. The Disconnected state in which case we're already done.\r\n }\r\n _completeClose(error) {\r\n if (this._connectionStarted) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n if (this._messageBuffer) {\r\n this._messageBuffer._dispose(error !== null && error !== void 0 ? error : new Error(\"Connection closed.\"));\r\n this._messageBuffer = undefined;\r\n }\r\n if (Platform.isBrowser) {\r\n window.document.removeEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n try {\r\n this._closedCallbacks.forEach((c) => c.apply(this, [error]));\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `An onclose callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n async _reconnect(error) {\r\n const reconnectStartTime = Date.now();\r\n let previousReconnectAttempts = 0;\r\n let retryError = error !== undefined ? error : new Error(\"Attempting to reconnect due to a unknown error.\");\r\n let nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, 0, retryError);\r\n if (nextRetryDelay === null) {\r\n this._logger.log(LogLevel.Debug, \"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.\");\r\n this._completeClose(error);\r\n return;\r\n }\r\n this._connectionState = HubConnectionState.Reconnecting;\r\n if (error) {\r\n this._logger.log(LogLevel.Information, `Connection reconnecting because of error '${error}'.`);\r\n }\r\n else {\r\n this._logger.log(LogLevel.Information, \"Connection reconnecting.\");\r\n }\r\n if (this._reconnectingCallbacks.length !== 0) {\r\n try {\r\n this._reconnectingCallbacks.forEach((c) => c.apply(this, [error]));\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnecting callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n // Exit early if an onreconnecting callback called connection.stop().\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.\");\r\n return;\r\n }\r\n }\r\n while (nextRetryDelay !== null) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt number ${previousReconnectAttempts} will start in ${nextRetryDelay} ms.`);\r\n await new Promise((resolve) => {\r\n this._reconnectDelayHandle = setTimeout(resolve, nextRetryDelay);\r\n });\r\n this._reconnectDelayHandle = undefined;\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state during reconnect delay. Done reconnecting.\");\r\n return;\r\n }\r\n try {\r\n await this._startInternal();\r\n this._connectionState = HubConnectionState.Connected;\r\n this._logger.log(LogLevel.Information, \"HubConnection reconnected successfully.\");\r\n if (this._reconnectedCallbacks.length !== 0) {\r\n try {\r\n this._reconnectedCallbacks.forEach((c) => c.apply(this, [this.connection.connectionId]));\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`);\r\n }\r\n }\r\n return;\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt failed because of error '${e}'.`);\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, `Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`);\r\n // The TypeScript compiler thinks that connectionState must be Connected here. The TypeScript compiler is wrong.\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._completeClose();\r\n }\r\n return;\r\n }\r\n retryError = e instanceof Error ? e : new Error(e.toString());\r\n nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime, retryError);\r\n }\r\n }\r\n this._logger.log(LogLevel.Information, `Reconnect retries have been exhausted after ${Date.now() - reconnectStartTime} ms and ${previousReconnectAttempts} failed attempts. Connection disconnecting.`);\r\n this._completeClose();\r\n }\r\n _getNextRetryDelay(previousRetryCount, elapsedMilliseconds, retryReason) {\r\n try {\r\n return this._reconnectPolicy.nextRetryDelayInMilliseconds({\r\n elapsedMilliseconds,\r\n previousRetryCount,\r\n retryReason,\r\n });\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `IRetryPolicy.nextRetryDelayInMilliseconds(${previousRetryCount}, ${elapsedMilliseconds}) threw error '${e}'.`);\r\n return null;\r\n }\r\n }\r\n _cancelCallbacksWithError(error) {\r\n const callbacks = this._callbacks;\r\n this._callbacks = {};\r\n Object.keys(callbacks)\r\n .forEach((key) => {\r\n const callback = callbacks[key];\r\n try {\r\n callback(null, error);\r\n }\r\n catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream 'error' callback called with '${error}' threw error: ${getErrorString(e)}`);\r\n }\r\n });\r\n }\r\n _cleanupPingTimer() {\r\n if (this._pingServerHandle) {\r\n clearTimeout(this._pingServerHandle);\r\n this._pingServerHandle = undefined;\r\n }\r\n }\r\n _cleanupTimeout() {\r\n if (this._timeoutHandle) {\r\n clearTimeout(this._timeoutHandle);\r\n }\r\n }\r\n _createInvocation(methodName, args, nonblocking, streamIds) {\r\n if (nonblocking) {\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n else {\r\n return {\r\n arguments: args,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n }\r\n else {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n }\r\n }\r\n _launchStreams(streams, promiseQueue) {\r\n if (streams.length === 0) {\r\n return;\r\n }\r\n // Synchronize stream data so they arrive in-order on the server\r\n if (!promiseQueue) {\r\n promiseQueue = Promise.resolve();\r\n }\r\n // We want to iterate over the keys, since the keys are the stream ids\r\n // eslint-disable-next-line guard-for-in\r\n for (const streamId in streams) {\r\n streams[streamId].subscribe({\r\n complete: () => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId)));\r\n },\r\n error: (err) => {\r\n let message;\r\n if (err instanceof Error) {\r\n message = err.message;\r\n }\r\n else if (err && err.toString) {\r\n message = err.toString();\r\n }\r\n else {\r\n message = \"Unknown error\";\r\n }\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId, message)));\r\n },\r\n next: (item) => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createStreamItemMessage(streamId, item)));\r\n },\r\n });\r\n }\r\n }\r\n _replaceStreamingParams(args) {\r\n const streams = [];\r\n const streamIds = [];\r\n for (let i = 0; i < args.length; i++) {\r\n const argument = args[i];\r\n if (this._isObservable(argument)) {\r\n const streamId = this._invocationId;\r\n this._invocationId++;\r\n // Store the stream for later use\r\n streams[streamId] = argument;\r\n streamIds.push(streamId.toString());\r\n // remove stream from args\r\n args.splice(i, 1);\r\n }\r\n }\r\n return [streams, streamIds];\r\n }\r\n _isObservable(arg) {\r\n // This allows other stream implementations to just work (like rxjs)\r\n return arg && arg.subscribe && typeof arg.subscribe === \"function\";\r\n }\r\n _createStreamInvocation(methodName, args, streamIds) {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n }\r\n else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n }\r\n }\r\n _createCancelInvocation(id) {\r\n return {\r\n invocationId: id,\r\n type: MessageType.CancelInvocation,\r\n };\r\n }\r\n _createStreamItemMessage(id, item) {\r\n return {\r\n invocationId: id,\r\n item,\r\n type: MessageType.StreamItem,\r\n };\r\n }\r\n _createCompletionMessage(id, error, result) {\r\n if (error) {\r\n return {\r\n error,\r\n invocationId: id,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n return {\r\n invocationId: id,\r\n result,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n _createCloseMessage() {\r\n return { type: MessageType.Close };\r\n }\r\n}\r\n//# sourceMappingURL=HubConnection.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { DefaultReconnectPolicy } from \"./DefaultReconnectPolicy\";\r\nimport { HttpConnection } from \"./HttpConnection\";\r\nimport { HubConnection } from \"./HubConnection\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { JsonHubProtocol } from \"./JsonHubProtocol\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { Arg, ConsoleLogger } from \"./Utils\";\r\nconst LogLevelNameMapping = {\r\n trace: LogLevel.Trace,\r\n debug: LogLevel.Debug,\r\n info: LogLevel.Information,\r\n information: LogLevel.Information,\r\n warn: LogLevel.Warning,\r\n warning: LogLevel.Warning,\r\n error: LogLevel.Error,\r\n critical: LogLevel.Critical,\r\n none: LogLevel.None,\r\n};\r\nfunction parseLogLevel(name) {\r\n // Case-insensitive matching via lower-casing\r\n // Yes, I know case-folding is a complicated problem in Unicode, but we only support\r\n // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse.\r\n const mapping = LogLevelNameMapping[name.toLowerCase()];\r\n if (typeof mapping !== \"undefined\") {\r\n return mapping;\r\n }\r\n else {\r\n throw new Error(`Unknown log level: ${name}`);\r\n }\r\n}\r\n/** A builder for configuring {@link @microsoft/signalr.HubConnection} instances. */\r\nexport class HubConnectionBuilder {\r\n configureLogging(logging) {\r\n Arg.isRequired(logging, \"logging\");\r\n if (isLogger(logging)) {\r\n this.logger = logging;\r\n }\r\n else if (typeof logging === \"string\") {\r\n const logLevel = parseLogLevel(logging);\r\n this.logger = new ConsoleLogger(logLevel);\r\n }\r\n else {\r\n this.logger = new ConsoleLogger(logging);\r\n }\r\n return this;\r\n }\r\n withUrl(url, transportTypeOrOptions) {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isNotEmpty(url, \"url\");\r\n this.url = url;\r\n // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed\r\n // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called.\r\n if (typeof transportTypeOrOptions === \"object\") {\r\n this.httpConnectionOptions = { ...this.httpConnectionOptions, ...transportTypeOrOptions };\r\n }\r\n else {\r\n this.httpConnectionOptions = {\r\n ...this.httpConnectionOptions,\r\n transport: transportTypeOrOptions,\r\n };\r\n }\r\n return this;\r\n }\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.\r\n *\r\n * @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.\r\n */\r\n withHubProtocol(protocol) {\r\n Arg.isRequired(protocol, \"protocol\");\r\n this.protocol = protocol;\r\n return this;\r\n }\r\n withAutomaticReconnect(retryDelaysOrReconnectPolicy) {\r\n if (this.reconnectPolicy) {\r\n throw new Error(\"A reconnectPolicy has already been set.\");\r\n }\r\n if (!retryDelaysOrReconnectPolicy) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy();\r\n }\r\n else if (Array.isArray(retryDelaysOrReconnectPolicy)) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy(retryDelaysOrReconnectPolicy);\r\n }\r\n else {\r\n this.reconnectPolicy = retryDelaysOrReconnectPolicy;\r\n }\r\n return this;\r\n }\r\n /** Configures {@link @microsoft/signalr.HubConnection.serverTimeoutInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n withServerTimeout(milliseconds) {\r\n Arg.isRequired(milliseconds, \"milliseconds\");\r\n this._serverTimeoutInMilliseconds = milliseconds;\r\n return this;\r\n }\r\n /** Configures {@link @microsoft/signalr.HubConnection.keepAliveIntervalInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n withKeepAliveInterval(milliseconds) {\r\n Arg.isRequired(milliseconds, \"milliseconds\");\r\n this._keepAliveIntervalInMilliseconds = milliseconds;\r\n return this;\r\n }\r\n /** Enables and configures options for the Stateful Reconnect feature.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n withStatefulReconnect(options) {\r\n if (this.httpConnectionOptions === undefined) {\r\n this.httpConnectionOptions = {};\r\n }\r\n this.httpConnectionOptions._useStatefulReconnect = true;\r\n this._statefulReconnectBufferSize = options === null || options === void 0 ? void 0 : options.bufferSize;\r\n return this;\r\n }\r\n /** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.\r\n *\r\n * @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.\r\n */\r\n build() {\r\n // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one\r\n // provided to configureLogger\r\n const httpConnectionOptions = this.httpConnectionOptions || {};\r\n // If it's 'null', the user **explicitly** asked for null, don't mess with it.\r\n if (httpConnectionOptions.logger === undefined) {\r\n // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it.\r\n httpConnectionOptions.logger = this.logger;\r\n }\r\n // Now create the connection\r\n if (!this.url) {\r\n throw new Error(\"The 'HubConnectionBuilder.withUrl' method must be called before building the connection.\");\r\n }\r\n const connection = new HttpConnection(this.url, httpConnectionOptions);\r\n return HubConnection.create(connection, this.logger || NullLogger.instance, this.protocol || new JsonHubProtocol(), this.reconnectPolicy, this._serverTimeoutInMilliseconds, this._keepAliveIntervalInMilliseconds, this._statefulReconnectBufferSize);\r\n }\r\n}\r\nfunction isLogger(logger) {\r\n return logger.log !== undefined;\r\n}\r\n//# sourceMappingURL=HubConnectionBuilder.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n/** Defines the type of a Hub Message. */\r\nexport var MessageType;\r\n(function (MessageType) {\r\n /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */\r\n MessageType[MessageType[\"Invocation\"] = 1] = \"Invocation\";\r\n /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */\r\n MessageType[MessageType[\"StreamItem\"] = 2] = \"StreamItem\";\r\n /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */\r\n MessageType[MessageType[\"Completion\"] = 3] = \"Completion\";\r\n /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */\r\n MessageType[MessageType[\"StreamInvocation\"] = 4] = \"StreamInvocation\";\r\n /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */\r\n MessageType[MessageType[\"CancelInvocation\"] = 5] = \"CancelInvocation\";\r\n /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */\r\n MessageType[MessageType[\"Ping\"] = 6] = \"Ping\";\r\n /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */\r\n MessageType[MessageType[\"Close\"] = 7] = \"Close\";\r\n MessageType[MessageType[\"Ack\"] = 8] = \"Ack\";\r\n MessageType[MessageType[\"Sequence\"] = 9] = \"Sequence\";\r\n})(MessageType || (MessageType = {}));\r\n//# sourceMappingURL=IHubProtocol.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.\r\n/** Indicates the severity of a log message.\r\n *\r\n * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.\r\n */\r\nexport var LogLevel;\r\n(function (LogLevel) {\r\n /** Log level for very low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Trace\"] = 0] = \"Trace\";\r\n /** Log level for low severity diagnostic messages. */\r\n LogLevel[LogLevel[\"Debug\"] = 1] = \"Debug\";\r\n /** Log level for informational diagnostic messages. */\r\n LogLevel[LogLevel[\"Information\"] = 2] = \"Information\";\r\n /** Log level for diagnostic messages that indicate a non-fatal problem. */\r\n LogLevel[LogLevel[\"Warning\"] = 3] = \"Warning\";\r\n /** Log level for diagnostic messages that indicate a failure in the current operation. */\r\n LogLevel[LogLevel[\"Error\"] = 4] = \"Error\";\r\n /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */\r\n LogLevel[LogLevel[\"Critical\"] = 5] = \"Critical\";\r\n /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */\r\n LogLevel[LogLevel[\"None\"] = 6] = \"None\";\r\n})(LogLevel || (LogLevel = {}));\r\n//# sourceMappingURL=ILogger.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// This will be treated as a bit flag in the future, so we keep it using power-of-two values.\r\n/** Specifies a specific HTTP transport type. */\r\nexport var HttpTransportType;\r\n(function (HttpTransportType) {\r\n /** Specifies no transport preference. */\r\n HttpTransportType[HttpTransportType[\"None\"] = 0] = \"None\";\r\n /** Specifies the WebSockets transport. */\r\n HttpTransportType[HttpTransportType[\"WebSockets\"] = 1] = \"WebSockets\";\r\n /** Specifies the Server-Sent Events transport. */\r\n HttpTransportType[HttpTransportType[\"ServerSentEvents\"] = 2] = \"ServerSentEvents\";\r\n /** Specifies the Long Polling transport. */\r\n HttpTransportType[HttpTransportType[\"LongPolling\"] = 4] = \"LongPolling\";\r\n})(HttpTransportType || (HttpTransportType = {}));\r\n/** Specifies the transfer format for a connection. */\r\nexport var TransferFormat;\r\n(function (TransferFormat) {\r\n /** Specifies that only text data will be transmitted over the connection. */\r\n TransferFormat[TransferFormat[\"Text\"] = 1] = \"Text\";\r\n /** Specifies that binary data will be transmitted over the connection. */\r\n TransferFormat[TransferFormat[\"Binary\"] = 2] = \"Binary\";\r\n})(TransferFormat || (TransferFormat = {}));\r\n//# sourceMappingURL=ITransport.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { MessageType } from \"./IHubProtocol\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nconst JSON_HUB_PROTOCOL_NAME = \"json\";\r\n/** Implements the JSON Hub Protocol. */\r\nexport class JsonHubProtocol {\r\n constructor() {\r\n /** @inheritDoc */\r\n this.name = JSON_HUB_PROTOCOL_NAME;\r\n /** @inheritDoc */\r\n this.version = 2;\r\n /** @inheritDoc */\r\n this.transferFormat = TransferFormat.Text;\r\n }\r\n /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * @param {string} input A string containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n parseMessages(input, logger) {\r\n // The interface does allow \"ArrayBuffer\" to be passed in, but this implementation does not. So let's throw a useful error.\r\n if (typeof input !== \"string\") {\r\n throw new Error(\"Invalid input for JSON hub protocol. Expected a string.\");\r\n }\r\n if (!input) {\r\n return [];\r\n }\r\n if (logger === null) {\r\n logger = NullLogger.instance;\r\n }\r\n // Parse the messages\r\n const messages = TextMessageFormat.parse(input);\r\n const hubMessages = [];\r\n for (const message of messages) {\r\n const parsedMessage = JSON.parse(message);\r\n if (typeof parsedMessage.type !== \"number\") {\r\n throw new Error(\"Invalid payload.\");\r\n }\r\n switch (parsedMessage.type) {\r\n case MessageType.Invocation:\r\n this._isInvocationMessage(parsedMessage);\r\n break;\r\n case MessageType.StreamItem:\r\n this._isStreamItemMessage(parsedMessage);\r\n break;\r\n case MessageType.Completion:\r\n this._isCompletionMessage(parsedMessage);\r\n break;\r\n case MessageType.Ping:\r\n // Single value, no need to validate\r\n break;\r\n case MessageType.Close:\r\n // All optional values, no need to validate\r\n break;\r\n case MessageType.Ack:\r\n this._isAckMessage(parsedMessage);\r\n break;\r\n case MessageType.Sequence:\r\n this._isSequenceMessage(parsedMessage);\r\n break;\r\n default:\r\n // Future protocol changes can add message types, old clients can ignore them\r\n logger.log(LogLevel.Information, \"Unknown message type '\" + parsedMessage.type + \"' ignored.\");\r\n continue;\r\n }\r\n hubMessages.push(parsedMessage);\r\n }\r\n return hubMessages;\r\n }\r\n /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string} A string containing the serialized representation of the message.\r\n */\r\n writeMessage(message) {\r\n return TextMessageFormat.write(JSON.stringify(message));\r\n }\r\n _isInvocationMessage(message) {\r\n this._assertNotEmptyString(message.target, \"Invalid payload for Invocation message.\");\r\n if (message.invocationId !== undefined) {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Invocation message.\");\r\n }\r\n }\r\n _isStreamItemMessage(message) {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for StreamItem message.\");\r\n if (message.item === undefined) {\r\n throw new Error(\"Invalid payload for StreamItem message.\");\r\n }\r\n }\r\n _isCompletionMessage(message) {\r\n if (message.result && message.error) {\r\n throw new Error(\"Invalid payload for Completion message.\");\r\n }\r\n if (!message.result && message.error) {\r\n this._assertNotEmptyString(message.error, \"Invalid payload for Completion message.\");\r\n }\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Completion message.\");\r\n }\r\n _isAckMessage(message) {\r\n if (typeof message.sequenceId !== 'number') {\r\n throw new Error(\"Invalid SequenceId for Ack message.\");\r\n }\r\n }\r\n _isSequenceMessage(message) {\r\n if (typeof message.sequenceId !== 'number') {\r\n throw new Error(\"Invalid SequenceId for Sequence message.\");\r\n }\r\n }\r\n _assertNotEmptyString(value, errorMessage) {\r\n if (typeof value !== \"string\" || value === \"\") {\r\n throw new Error(errorMessage);\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=JsonHubProtocol.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n/** A logger that does nothing when log messages are sent to it. */\r\nexport class NullLogger {\r\n constructor() { }\r\n /** @inheritDoc */\r\n // eslint-disable-next-line\r\n log(_logLevel, _message) {\r\n }\r\n}\r\n/** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */\r\nNullLogger.instance = new NullLogger();\r\n//# sourceMappingURL=Loggers.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { AbortController } from \"./AbortController\";\r\nimport { HttpError, TimeoutError } from \"./Errors\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, sendMessage } from \"./Utils\";\r\n// Not exported from 'index', this type is internal.\r\n/** @private */\r\nexport class LongPollingTransport {\r\n // This is an internal type, not exported from 'index' so this is really just internal.\r\n get pollAborted() {\r\n return this._pollAbort.aborted;\r\n }\r\n constructor(httpClient, logger, options) {\r\n this._httpClient = httpClient;\r\n this._logger = logger;\r\n this._pollAbort = new AbortController();\r\n this._options = options;\r\n this._running = false;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n async connect(url, transferFormat) {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._url = url;\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Connecting.\");\r\n // Allow binary format on Node and Browsers that support binary content (indicated by the presence of responseType property)\r\n if (transferFormat === TransferFormat.Binary &&\r\n (typeof XMLHttpRequest !== \"undefined\" && typeof new XMLHttpRequest().responseType !== \"string\")) {\r\n throw new Error(\"Binary protocols over XmlHttpRequest not implementing advanced features are not supported.\");\r\n }\r\n const [name, value] = getUserAgentHeader();\r\n const headers = { [name]: value, ...this._options.headers };\r\n const pollOptions = {\r\n abortSignal: this._pollAbort.signal,\r\n headers,\r\n timeout: 100000,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n if (transferFormat === TransferFormat.Binary) {\r\n pollOptions.responseType = \"arraybuffer\";\r\n }\r\n // Make initial long polling request\r\n // Server uses first long polling request to finish initializing connection and it returns without data\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n // Mark running as false so that the poll immediately ends and runs the close logic\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n }\r\n else {\r\n this._running = true;\r\n }\r\n this._receiving = this._poll(this._url, pollOptions);\r\n }\r\n async _poll(url, pollOptions) {\r\n try {\r\n while (this._running) {\r\n try {\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n if (response.statusCode === 204) {\r\n this._logger.log(LogLevel.Information, \"(LongPolling transport) Poll terminated by server.\");\r\n this._running = false;\r\n }\r\n else if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n // Unexpected status code\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n }\r\n else {\r\n // Process the response\r\n if (response.content) {\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) data received. ${getDataDetail(response.content, this._options.logMessageContent)}.`);\r\n if (this.onreceive) {\r\n this.onreceive(response.content);\r\n }\r\n }\r\n else {\r\n // This is another way timeout manifest.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n }\r\n }\r\n catch (e) {\r\n if (!this._running) {\r\n // Log but disregard errors that occur after stopping\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) Poll errored after shutdown: ${e.message}`);\r\n }\r\n else {\r\n if (e instanceof TimeoutError) {\r\n // Ignore timeouts and reissue the poll.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n else {\r\n // Close the connection with the error as the result.\r\n this._closeError = e;\r\n this._running = false;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Polling complete.\");\r\n // We will reach here with pollAborted==false when the server returned a response causing the transport to stop.\r\n // If pollAborted==true then client initiated the stop and the stop method will raise the close event after DELETE is sent.\r\n if (!this.pollAborted) {\r\n this._raiseOnClose();\r\n }\r\n }\r\n }\r\n async send(data) {\r\n if (!this._running) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"LongPolling\", this._httpClient, this._url, data, this._options);\r\n }\r\n async stop() {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stopping polling.\");\r\n // Tell receiving loop to stop, abort any current request, and then wait for it to finish\r\n this._running = false;\r\n this._pollAbort.abort();\r\n try {\r\n await this._receiving;\r\n // Send DELETE to clean up long polling on the server\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);\r\n const headers = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n const deleteOptions = {\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n let error;\r\n try {\r\n await this._httpClient.delete(this._url, deleteOptions);\r\n }\r\n catch (err) {\r\n error = err;\r\n }\r\n if (error) {\r\n if (error instanceof HttpError) {\r\n if (error.statusCode === 404) {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) A 404 response was returned from sending a DELETE request.\");\r\n }\r\n else {\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) Error sending a DELETE request: ${error}`);\r\n }\r\n }\r\n }\r\n else {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) DELETE request accepted.\");\r\n }\r\n }\r\n finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stop finished.\");\r\n // Raise close event here instead of in polling\r\n // It needs to happen after the DELETE request is sent\r\n this._raiseOnClose();\r\n }\r\n }\r\n _raiseOnClose() {\r\n if (this.onclose) {\r\n let logMessage = \"(LongPolling transport) Firing onclose event.\";\r\n if (this._closeError) {\r\n logMessage += \" Error: \" + this._closeError;\r\n }\r\n this._logger.log(LogLevel.Trace, logMessage);\r\n this.onclose(this._closeError);\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=LongPollingTransport.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { MessageType } from \"./IHubProtocol\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n/** @private */\r\nexport class MessageBuffer {\r\n constructor(protocol, connection, bufferSize) {\r\n this._bufferSize = 100000;\r\n this._messages = [];\r\n this._totalMessageCount = 0;\r\n this._waitForSequenceMessage = false;\r\n // Message IDs start at 1 and always increment by 1\r\n this._nextReceivingSequenceId = 1;\r\n this._latestReceivedSequenceId = 0;\r\n this._bufferedByteCount = 0;\r\n this._reconnectInProgress = false;\r\n this._protocol = protocol;\r\n this._connection = connection;\r\n this._bufferSize = bufferSize;\r\n }\r\n async _send(message) {\r\n const serializedMessage = this._protocol.writeMessage(message);\r\n let backpressurePromise = Promise.resolve();\r\n // Only count invocation messages. Acks, pings, etc. don't need to be resent on reconnect\r\n if (this._isInvocationMessage(message)) {\r\n this._totalMessageCount++;\r\n let backpressurePromiseResolver = () => { };\r\n let backpressurePromiseRejector = () => { };\r\n if (isArrayBuffer(serializedMessage)) {\r\n this._bufferedByteCount += serializedMessage.byteLength;\r\n }\r\n else {\r\n this._bufferedByteCount += serializedMessage.length;\r\n }\r\n if (this._bufferedByteCount >= this._bufferSize) {\r\n backpressurePromise = new Promise((resolve, reject) => {\r\n backpressurePromiseResolver = resolve;\r\n backpressurePromiseRejector = reject;\r\n });\r\n }\r\n this._messages.push(new BufferedItem(serializedMessage, this._totalMessageCount, backpressurePromiseResolver, backpressurePromiseRejector));\r\n }\r\n try {\r\n // If this is set it means we are reconnecting or resending\r\n // We don't want to send on a disconnected connection\r\n // And we don't want to send if resend is running since that would mean sending\r\n // this message twice\r\n if (!this._reconnectInProgress) {\r\n await this._connection.send(serializedMessage);\r\n }\r\n }\r\n catch {\r\n this._disconnected();\r\n }\r\n await backpressurePromise;\r\n }\r\n _ack(ackMessage) {\r\n let newestAckedMessage = -1;\r\n // Find index of newest message being acked\r\n for (let index = 0; index < this._messages.length; index++) {\r\n const element = this._messages[index];\r\n if (element._id <= ackMessage.sequenceId) {\r\n newestAckedMessage = index;\r\n if (isArrayBuffer(element._message)) {\r\n this._bufferedByteCount -= element._message.byteLength;\r\n }\r\n else {\r\n this._bufferedByteCount -= element._message.length;\r\n }\r\n // resolve items that have already been sent and acked\r\n element._resolver();\r\n }\r\n else if (this._bufferedByteCount < this._bufferSize) {\r\n // resolve items that now fall under the buffer limit but haven't been acked\r\n element._resolver();\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n if (newestAckedMessage !== -1) {\r\n // We're removing everything including the message pointed to, so add 1\r\n this._messages = this._messages.slice(newestAckedMessage + 1);\r\n }\r\n }\r\n _shouldProcessMessage(message) {\r\n if (this._waitForSequenceMessage) {\r\n if (message.type !== MessageType.Sequence) {\r\n return false;\r\n }\r\n else {\r\n this._waitForSequenceMessage = false;\r\n return true;\r\n }\r\n }\r\n // No special processing for acks, pings, etc.\r\n if (!this._isInvocationMessage(message)) {\r\n return true;\r\n }\r\n const currentId = this._nextReceivingSequenceId;\r\n this._nextReceivingSequenceId++;\r\n if (currentId <= this._latestReceivedSequenceId) {\r\n if (currentId === this._latestReceivedSequenceId) {\r\n // Should only hit this if we just reconnected and the server is sending\r\n // Messages it has buffered, which would mean it hasn't seen an Ack for these messages\r\n this._ackTimer();\r\n }\r\n // Ignore, this is a duplicate message\r\n return false;\r\n }\r\n this._latestReceivedSequenceId = currentId;\r\n // Only start the timer for sending an Ack message when we have a message to ack. This also conveniently solves\r\n // timer throttling by not having a recursive timer, and by starting the timer via a network call (recv)\r\n this._ackTimer();\r\n return true;\r\n }\r\n _resetSequence(message) {\r\n if (message.sequenceId > this._nextReceivingSequenceId) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._connection.stop(new Error(\"Sequence ID greater than amount of messages we've received.\"));\r\n return;\r\n }\r\n this._nextReceivingSequenceId = message.sequenceId;\r\n }\r\n _disconnected() {\r\n this._reconnectInProgress = true;\r\n this._waitForSequenceMessage = true;\r\n }\r\n async _resend() {\r\n const sequenceId = this._messages.length !== 0\r\n ? this._messages[0]._id\r\n : this._totalMessageCount + 1;\r\n await this._connection.send(this._protocol.writeMessage({ type: MessageType.Sequence, sequenceId }));\r\n // Get a local variable to the _messages, just in case messages are acked while resending\r\n // Which would slice the _messages array (which creates a new copy)\r\n const messages = this._messages;\r\n for (const element of messages) {\r\n await this._connection.send(element._message);\r\n }\r\n this._reconnectInProgress = false;\r\n }\r\n _dispose(error) {\r\n error !== null && error !== void 0 ? error : (error = new Error(\"Unable to reconnect to server.\"));\r\n // Unblock backpressure if any\r\n for (const element of this._messages) {\r\n element._rejector(error);\r\n }\r\n }\r\n _isInvocationMessage(message) {\r\n // There is no way to check if something implements an interface.\r\n // So we individually check the messages in a switch statement.\r\n // To make sure we don't miss any message types we rely on the compiler\r\n // seeing the function returns a value and it will do the\r\n // exhaustive check for us on the switch statement, since we don't use 'case default'\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n case MessageType.StreamItem:\r\n case MessageType.Completion:\r\n case MessageType.StreamInvocation:\r\n case MessageType.CancelInvocation:\r\n return true;\r\n case MessageType.Close:\r\n case MessageType.Sequence:\r\n case MessageType.Ping:\r\n case MessageType.Ack:\r\n return false;\r\n }\r\n }\r\n _ackTimer() {\r\n if (this._ackTimerHandle === undefined) {\r\n this._ackTimerHandle = setTimeout(async () => {\r\n try {\r\n if (!this._reconnectInProgress) {\r\n await this._connection.send(this._protocol.writeMessage({ type: MessageType.Ack, sequenceId: this._latestReceivedSequenceId }));\r\n }\r\n // Ignore errors, that means the connection is closed and we don't care about the Ack message anymore.\r\n }\r\n catch { }\r\n clearTimeout(this._ackTimerHandle);\r\n this._ackTimerHandle = undefined;\r\n // 1 second delay so we don't spam Ack messages if there are many messages being received at once.\r\n }, 1000);\r\n }\r\n }\r\n}\r\nclass BufferedItem {\r\n constructor(message, id, resolver, rejector) {\r\n this._message = message;\r\n this._id = id;\r\n this._resolver = resolver;\r\n this._rejector = rejector;\r\n }\r\n}\r\n//# sourceMappingURL=MessageBuffer.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform, sendMessage } from \"./Utils\";\r\n/** @private */\r\nexport class ServerSentEventsTransport {\r\n constructor(httpClient, accessToken, logger, options) {\r\n this._httpClient = httpClient;\r\n this._accessToken = accessToken;\r\n this._logger = logger;\r\n this._options = options;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n async connect(url, transferFormat) {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._logger.log(LogLevel.Trace, \"(SSE transport) Connecting.\");\r\n // set url before accessTokenFactory because this._url is only for send and we set the auth header instead of the query string for send\r\n this._url = url;\r\n if (this._accessToken) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(this._accessToken)}`;\r\n }\r\n return new Promise((resolve, reject) => {\r\n let opened = false;\r\n if (transferFormat !== TransferFormat.Text) {\r\n reject(new Error(\"The Server-Sent Events transport only supports the 'Text' transfer format\"));\r\n return;\r\n }\r\n let eventSource;\r\n if (Platform.isBrowser || Platform.isWebWorker) {\r\n eventSource = new this._options.EventSource(url, { withCredentials: this._options.withCredentials });\r\n }\r\n else {\r\n // Non-browser passes cookies via the dictionary\r\n const cookies = this._httpClient.getCookieString(url);\r\n const headers = {};\r\n headers.Cookie = cookies;\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n eventSource = new this._options.EventSource(url, { withCredentials: this._options.withCredentials, headers: { ...headers, ...this._options.headers } });\r\n }\r\n try {\r\n eventSource.onmessage = (e) => {\r\n if (this.onreceive) {\r\n try {\r\n this._logger.log(LogLevel.Trace, `(SSE transport) data received. ${getDataDetail(e.data, this._options.logMessageContent)}.`);\r\n this.onreceive(e.data);\r\n }\r\n catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n // @ts-ignore: not using event on purpose\r\n eventSource.onerror = (e) => {\r\n // EventSource doesn't give any useful information about server side closes.\r\n if (opened) {\r\n this._close();\r\n }\r\n else {\r\n reject(new Error(\"EventSource failed to connect. The connection could not be found on the server,\"\r\n + \" either the connection ID is not present on the server, or a proxy is refusing/buffering the connection.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\"));\r\n }\r\n };\r\n eventSource.onopen = () => {\r\n this._logger.log(LogLevel.Information, `SSE connected to ${this._url}`);\r\n this._eventSource = eventSource;\r\n opened = true;\r\n resolve();\r\n };\r\n }\r\n catch (e) {\r\n reject(e);\r\n return;\r\n }\r\n });\r\n }\r\n async send(data) {\r\n if (!this._eventSource) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"SSE\", this._httpClient, this._url, data, this._options);\r\n }\r\n stop() {\r\n this._close();\r\n return Promise.resolve();\r\n }\r\n _close(e) {\r\n if (this._eventSource) {\r\n this._eventSource.close();\r\n this._eventSource = undefined;\r\n if (this.onclose) {\r\n this.onclose(e);\r\n }\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=ServerSentEventsTransport.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { SubjectSubscription } from \"./Utils\";\r\n/** Stream implementation to stream items to the server. */\r\nexport class Subject {\r\n constructor() {\r\n this.observers = [];\r\n }\r\n next(item) {\r\n for (const observer of this.observers) {\r\n observer.next(item);\r\n }\r\n }\r\n error(err) {\r\n for (const observer of this.observers) {\r\n if (observer.error) {\r\n observer.error(err);\r\n }\r\n }\r\n }\r\n complete() {\r\n for (const observer of this.observers) {\r\n if (observer.complete) {\r\n observer.complete();\r\n }\r\n }\r\n }\r\n subscribe(observer) {\r\n this.observers.push(observer);\r\n return new SubjectSubscription(this, observer);\r\n }\r\n}\r\n//# sourceMappingURL=Subject.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n// Not exported from index\r\n/** @private */\r\nexport class TextMessageFormat {\r\n static write(output) {\r\n return `${output}${TextMessageFormat.RecordSeparator}`;\r\n }\r\n static parse(input) {\r\n if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n const messages = input.split(TextMessageFormat.RecordSeparator);\r\n messages.pop();\r\n return messages;\r\n }\r\n}\r\nTextMessageFormat.RecordSeparatorCode = 0x1e;\r\nTextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\n//# sourceMappingURL=TextMessageFormat.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { NullLogger } from \"./Loggers\";\r\n// Version token that will be replaced by the prepack command\r\n/** The version of the SignalR client. */\r\nexport const VERSION = \"8.0.7\";\r\n/** @private */\r\nexport class Arg {\r\n static isRequired(val, name) {\r\n if (val === null || val === undefined) {\r\n throw new Error(`The '${name}' argument is required.`);\r\n }\r\n }\r\n static isNotEmpty(val, name) {\r\n if (!val || val.match(/^\\s*$/)) {\r\n throw new Error(`The '${name}' argument should not be empty.`);\r\n }\r\n }\r\n static isIn(val, values, name) {\r\n // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.\r\n if (!(val in values)) {\r\n throw new Error(`Unknown ${name} value: ${val}.`);\r\n }\r\n }\r\n}\r\n/** @private */\r\nexport class Platform {\r\n // react-native has a window but no document so we should check both\r\n static get isBrowser() {\r\n return !Platform.isNode && typeof window === \"object\" && typeof window.document === \"object\";\r\n }\r\n // WebWorkers don't have a window object so the isBrowser check would fail\r\n static get isWebWorker() {\r\n return !Platform.isNode && typeof self === \"object\" && \"importScripts\" in self;\r\n }\r\n // react-native has a window but no document\r\n static get isReactNative() {\r\n return !Platform.isNode && typeof window === \"object\" && typeof window.document === \"undefined\";\r\n }\r\n // Node apps shouldn't have a window object, but WebWorkers don't either\r\n // so we need to check for both WebWorker and window\r\n static get isNode() {\r\n return typeof process !== \"undefined\" && process.release && process.release.name === \"node\";\r\n }\r\n}\r\n/** @private */\r\nexport function getDataDetail(data, includeContent) {\r\n let detail = \"\";\r\n if (isArrayBuffer(data)) {\r\n detail = `Binary data of length ${data.byteLength}`;\r\n if (includeContent) {\r\n detail += `. Content: '${formatArrayBuffer(data)}'`;\r\n }\r\n }\r\n else if (typeof data === \"string\") {\r\n detail = `String data of length ${data.length}`;\r\n if (includeContent) {\r\n detail += `. Content: '${data}'`;\r\n }\r\n }\r\n return detail;\r\n}\r\n/** @private */\r\nexport function formatArrayBuffer(data) {\r\n const view = new Uint8Array(data);\r\n // Uint8Array.map only supports returning another Uint8Array?\r\n let str = \"\";\r\n view.forEach((num) => {\r\n const pad = num < 16 ? \"0\" : \"\";\r\n str += `0x${pad}${num.toString(16)} `;\r\n });\r\n // Trim of trailing space.\r\n return str.substr(0, str.length - 1);\r\n}\r\n// Also in signalr-protocol-msgpack/Utils.ts\r\n/** @private */\r\nexport function isArrayBuffer(val) {\r\n return val && typeof ArrayBuffer !== \"undefined\" &&\r\n (val instanceof ArrayBuffer ||\r\n // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof\r\n (val.constructor && val.constructor.name === \"ArrayBuffer\"));\r\n}\r\n/** @private */\r\nexport async function sendMessage(logger, transportName, httpClient, url, content, options) {\r\n const headers = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n logger.log(LogLevel.Trace, `(${transportName} transport) sending data. ${getDataDetail(content, options.logMessageContent)}.`);\r\n const responseType = isArrayBuffer(content) ? \"arraybuffer\" : \"text\";\r\n const response = await httpClient.post(url, {\r\n content,\r\n headers: { ...headers, ...options.headers },\r\n responseType,\r\n timeout: options.timeout,\r\n withCredentials: options.withCredentials,\r\n });\r\n logger.log(LogLevel.Trace, `(${transportName} transport) request complete. Response status: ${response.statusCode}.`);\r\n}\r\n/** @private */\r\nexport function createLogger(logger) {\r\n if (logger === undefined) {\r\n return new ConsoleLogger(LogLevel.Information);\r\n }\r\n if (logger === null) {\r\n return NullLogger.instance;\r\n }\r\n if (logger.log !== undefined) {\r\n return logger;\r\n }\r\n return new ConsoleLogger(logger);\r\n}\r\n/** @private */\r\nexport class SubjectSubscription {\r\n constructor(subject, observer) {\r\n this._subject = subject;\r\n this._observer = observer;\r\n }\r\n dispose() {\r\n const index = this._subject.observers.indexOf(this._observer);\r\n if (index > -1) {\r\n this._subject.observers.splice(index, 1);\r\n }\r\n if (this._subject.observers.length === 0 && this._subject.cancelCallback) {\r\n this._subject.cancelCallback().catch((_) => { });\r\n }\r\n }\r\n}\r\n/** @private */\r\nexport class ConsoleLogger {\r\n constructor(minimumLogLevel) {\r\n this._minLevel = minimumLogLevel;\r\n this.out = console;\r\n }\r\n log(logLevel, message) {\r\n if (logLevel >= this._minLevel) {\r\n const msg = `[${new Date().toISOString()}] ${LogLevel[logLevel]}: ${message}`;\r\n switch (logLevel) {\r\n case LogLevel.Critical:\r\n case LogLevel.Error:\r\n this.out.error(msg);\r\n break;\r\n case LogLevel.Warning:\r\n this.out.warn(msg);\r\n break;\r\n case LogLevel.Information:\r\n this.out.info(msg);\r\n break;\r\n default:\r\n // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug\r\n this.out.log(msg);\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n/** @private */\r\nexport function getUserAgentHeader() {\r\n let userAgentHeaderName = \"X-SignalR-User-Agent\";\r\n if (Platform.isNode) {\r\n userAgentHeaderName = \"User-Agent\";\r\n }\r\n return [userAgentHeaderName, constructUserAgent(VERSION, getOsName(), getRuntime(), getRuntimeVersion())];\r\n}\r\n/** @private */\r\nexport function constructUserAgent(version, os, runtime, runtimeVersion) {\r\n // Microsoft SignalR/[Version] ([Detailed Version]; [Operating System]; [Runtime]; [Runtime Version])\r\n let userAgent = \"Microsoft SignalR/\";\r\n const majorAndMinor = version.split(\".\");\r\n userAgent += `${majorAndMinor[0]}.${majorAndMinor[1]}`;\r\n userAgent += ` (${version}; `;\r\n if (os && os !== \"\") {\r\n userAgent += `${os}; `;\r\n }\r\n else {\r\n userAgent += \"Unknown OS; \";\r\n }\r\n userAgent += `${runtime}`;\r\n if (runtimeVersion) {\r\n userAgent += `; ${runtimeVersion}`;\r\n }\r\n else {\r\n userAgent += \"; Unknown Runtime Version\";\r\n }\r\n userAgent += \")\";\r\n return userAgent;\r\n}\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getOsName() {\r\n if (Platform.isNode) {\r\n switch (process.platform) {\r\n case \"win32\":\r\n return \"Windows NT\";\r\n case \"darwin\":\r\n return \"macOS\";\r\n case \"linux\":\r\n return \"Linux\";\r\n default:\r\n return process.platform;\r\n }\r\n }\r\n else {\r\n return \"\";\r\n }\r\n}\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getRuntimeVersion() {\r\n if (Platform.isNode) {\r\n return process.versions.node;\r\n }\r\n return undefined;\r\n}\r\nfunction getRuntime() {\r\n if (Platform.isNode) {\r\n return \"NodeJS\";\r\n }\r\n else {\r\n return \"Browser\";\r\n }\r\n}\r\n/** @private */\r\nexport function getErrorString(e) {\r\n if (e.stack) {\r\n return e.stack;\r\n }\r\n else if (e.message) {\r\n return e.message;\r\n }\r\n return `${e}`;\r\n}\r\n/** @private */\r\nexport function getGlobalThis() {\r\n // globalThis is semi-new and not available in Node until v12\r\n if (typeof globalThis !== \"undefined\") {\r\n return globalThis;\r\n }\r\n if (typeof self !== \"undefined\") {\r\n return self;\r\n }\r\n if (typeof window !== \"undefined\") {\r\n return window;\r\n }\r\n if (typeof global !== \"undefined\") {\r\n return global;\r\n }\r\n throw new Error(\"could not find global\");\r\n}\r\n//# sourceMappingURL=Utils.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform } from \"./Utils\";\r\n/** @private */\r\nexport class WebSocketTransport {\r\n constructor(httpClient, accessTokenFactory, logger, logMessageContent, webSocketConstructor, headers) {\r\n this._logger = logger;\r\n this._accessTokenFactory = accessTokenFactory;\r\n this._logMessageContent = logMessageContent;\r\n this._webSocketConstructor = webSocketConstructor;\r\n this._httpClient = httpClient;\r\n this.onreceive = null;\r\n this.onclose = null;\r\n this._headers = headers;\r\n }\r\n async connect(url, transferFormat) {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) Connecting.\");\r\n let token;\r\n if (this._accessTokenFactory) {\r\n token = await this._accessTokenFactory();\r\n }\r\n return new Promise((resolve, reject) => {\r\n url = url.replace(/^http/, \"ws\");\r\n let webSocket;\r\n const cookies = this._httpClient.getCookieString(url);\r\n let opened = false;\r\n if (Platform.isNode || Platform.isReactNative) {\r\n const headers = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n if (token) {\r\n headers[HeaderNames.Authorization] = `Bearer ${token}`;\r\n }\r\n if (cookies) {\r\n headers[HeaderNames.Cookie] = cookies;\r\n }\r\n // Only pass headers when in non-browser environments\r\n webSocket = new this._webSocketConstructor(url, undefined, {\r\n headers: { ...headers, ...this._headers },\r\n });\r\n }\r\n else {\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(token)}`;\r\n }\r\n }\r\n if (!webSocket) {\r\n // Chrome is not happy with passing 'undefined' as protocol\r\n webSocket = new this._webSocketConstructor(url);\r\n }\r\n if (transferFormat === TransferFormat.Binary) {\r\n webSocket.binaryType = \"arraybuffer\";\r\n }\r\n webSocket.onopen = (_event) => {\r\n this._logger.log(LogLevel.Information, `WebSocket connected to ${url}.`);\r\n this._webSocket = webSocket;\r\n opened = true;\r\n resolve();\r\n };\r\n webSocket.onerror = (event) => {\r\n let error = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n }\r\n else {\r\n error = \"There was an error with the transport\";\r\n }\r\n this._logger.log(LogLevel.Information, `(WebSockets transport) ${error}.`);\r\n };\r\n webSocket.onmessage = (message) => {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) data received. ${getDataDetail(message.data, this._logMessageContent)}.`);\r\n if (this.onreceive) {\r\n try {\r\n this.onreceive(message.data);\r\n }\r\n catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n webSocket.onclose = (event) => {\r\n // Don't call close handler if connection was never established\r\n // We'll reject the connect call instead\r\n if (opened) {\r\n this._close(event);\r\n }\r\n else {\r\n let error = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n }\r\n else {\r\n error = \"WebSocket failed to connect. The connection could not be found on the server,\"\r\n + \" either the endpoint may not be a SignalR endpoint,\"\r\n + \" the connection ID is not present on the server, or there is a proxy blocking WebSockets.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\";\r\n }\r\n reject(new Error(error));\r\n }\r\n };\r\n });\r\n }\r\n send(data) {\r\n if (this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN) {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) sending data. ${getDataDetail(data, this._logMessageContent)}.`);\r\n this._webSocket.send(data);\r\n return Promise.resolve();\r\n }\r\n return Promise.reject(\"WebSocket is not in the OPEN state\");\r\n }\r\n stop() {\r\n if (this._webSocket) {\r\n // Manually invoke onclose callback inline so we know the HttpConnection was closed properly before returning\r\n // This also solves an issue where websocket.onclose could take 18+ seconds to trigger during network disconnects\r\n this._close(undefined);\r\n }\r\n return Promise.resolve();\r\n }\r\n _close(event) {\r\n // webSocket will be null if the transport did not start successfully\r\n if (this._webSocket) {\r\n // Clear websocket handlers because we are considering the socket closed now\r\n this._webSocket.onclose = () => { };\r\n this._webSocket.onmessage = () => { };\r\n this._webSocket.onerror = () => { };\r\n this._webSocket.close();\r\n this._webSocket = undefined;\r\n }\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) socket closed.\");\r\n if (this.onclose) {\r\n if (this._isCloseEvent(event) && (event.wasClean === false || event.code !== 1000)) {\r\n this.onclose(new Error(`WebSocket closed with status code: ${event.code} (${event.reason || \"no reason given\"}).`));\r\n }\r\n else if (event instanceof Error) {\r\n this.onclose(event);\r\n }\r\n else {\r\n this.onclose();\r\n }\r\n }\r\n }\r\n _isCloseEvent(event) {\r\n return event && typeof event.wasClean === \"boolean\" && typeof event.code === \"number\";\r\n }\r\n}\r\n//# sourceMappingURL=WebSocketTransport.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpResponse } from \"./HttpClient\";\r\nimport { LogLevel } from \"./ILogger\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\nexport class XhrHttpClient extends HttpClient {\r\n constructor(logger) {\r\n super();\r\n this._logger = logger;\r\n }\r\n /** @inheritDoc */\r\n send(request) {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n return new Promise((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(request.method, request.url, true);\r\n xhr.withCredentials = request.withCredentials === undefined ? true : request.withCredentials;\r\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n if (request.content === \"\") {\r\n request.content = undefined;\r\n }\r\n if (request.content) {\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n if (isArrayBuffer(request.content)) {\r\n xhr.setRequestHeader(\"Content-Type\", \"application/octet-stream\");\r\n }\r\n else {\r\n xhr.setRequestHeader(\"Content-Type\", \"text/plain;charset=UTF-8\");\r\n }\r\n }\r\n const headers = request.headers;\r\n if (headers) {\r\n Object.keys(headers)\r\n .forEach((header) => {\r\n xhr.setRequestHeader(header, headers[header]);\r\n });\r\n }\r\n if (request.responseType) {\r\n xhr.responseType = request.responseType;\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n xhr.abort();\r\n reject(new AbortError());\r\n };\r\n }\r\n if (request.timeout) {\r\n xhr.timeout = request.timeout;\r\n }\r\n xhr.onload = () => {\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));\r\n }\r\n else {\r\n reject(new HttpError(xhr.response || xhr.responseText || xhr.statusText, xhr.status));\r\n }\r\n };\r\n xhr.onerror = () => {\r\n this._logger.log(LogLevel.Warning, `Error from HTTP request. ${xhr.status}: ${xhr.statusText}.`);\r\n reject(new HttpError(xhr.statusText, xhr.status));\r\n };\r\n xhr.ontimeout = () => {\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n reject(new TimeoutError());\r\n };\r\n xhr.send(request.content);\r\n });\r\n }\r\n}\r\n//# sourceMappingURL=XhrHttpClient.js.map","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\nexport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nexport { HttpClient, HttpResponse } from \"./HttpClient\";\r\nexport { DefaultHttpClient } from \"./DefaultHttpClient\";\r\nexport { HubConnection, HubConnectionState } from \"./HubConnection\";\r\nexport { HubConnectionBuilder } from \"./HubConnectionBuilder\";\r\nexport { MessageType } from \"./IHubProtocol\";\r\nexport { LogLevel } from \"./ILogger\";\r\nexport { HttpTransportType, TransferFormat } from \"./ITransport\";\r\nexport { NullLogger } from \"./Loggers\";\r\nexport { JsonHubProtocol } from \"./JsonHubProtocol\";\r\nexport { Subject } from \"./Subject\";\r\nexport { VERSION } from \"./Utils\";\r\n//# sourceMappingURL=index.js.map","declare var ErrorHandler: any;\n\nvar Ajax = window.Ajax = (function () {\n\n var ajaxViewParsers = {};\n function addAjaxViewParser(parser: any, name?: string) {\n name = name || 'default';\n ajaxViewParsers[name] = parser;\n }\n\n interface IUnAuthorizedHandler {\n (data: any): void;\n }\n\n var unauthorizedHandlers: IUnAuthorizedHandler[] = [];\n\n function subscribeUnauthorized(handler: IUnAuthorizedHandler) {\n if (unauthorizedHandlers.indexOf(handler) < 0) {\n unauthorizedHandlers.push(handler);\n }\n }\n\n function unSubscribeUnauthorized(handler: IUnAuthorizedHandler) {\n var index = unauthorizedHandlers.indexOf(handler);\n if (index >= 0) {\n unauthorizedHandlers.splice(index, 1);\n }\n }\n\n var globalErrorHandler = (jqXHR, textStatus, errorThrown) => console.log('AjaxError Moq: ' + textStatus + ' ' + errorThrown);\n\n $(document).ready(function () {\n if (typeof (ErrorHandler) != 'undefined' && typeof (ErrorHandler.handle) == 'function')\n globalErrorHandler = ErrorHandler.handle;\n });\n\n function commonErrorHandler(jqXHR: JQueryXHR, textStatus: string, errorThrown: string, error: any) {\n if (textStatus == null) return;\n\n if (typeof (error) != 'function') error = globalErrorHandler;\n\n error(jqXHR, textStatus, errorThrown);\n }\n function callAjaxViewParsers(view: IAjaxView) {\n var parsers = Object.keys(ajaxViewParsers);\n for (var i = 0; i < parsers.length; i++) {\n callAjaxViewParser(ajaxViewParsers[parsers[i]], view);\n }\n }\n\n function callAjaxViewParser(parser: any, view: IAjaxView) {\n if (parser) {\n if (typeof (parser) == 'function') {\n parser(view);\n } else if (typeof (parser.parse) == 'function') {\n parser.parse(view);\n }\n }\n }\n\n function processViews(views: IAjaxView[], doCallAjaxViewParsers: boolean) {\n for (var i = 0; i < views.length; i++) {\n var view = views[i];\n\n $(view.Selector).promise().done(function () {\n $(view.Selector).replaceWith(view.Html);\n if (doCallAjaxViewParsers)\n callAjaxViewParsers(view);\n });\n\n var afterRender = view.AfterRender;\n if (afterRender && afterRender.length > 0) {\n afterRender.forEach(function (act) {\n var handler = eval(act.name);\n handler.call(view, act.args);\n })\n }\n }\n }\n\n function commonSuccessHandler(data: IAjaxData, textStatus: string, jqXHR: JQueryXHR, success: any, doCallAjaxViewParsers: boolean) {\n if (data.RedirectUrl) {\n Ajax.redirect(data.RedirectUrl, data.ActionData);\n return;\n }\n\n if (data.Views && data.Views.length > 0) {\n processViews(data.Views, doCallAjaxViewParsers);\n }\n\n if (success && typeof (success) == 'function') {\n var notifyData = data.ActionData;\n if (data.IsUnauthorized === true) {\n notifyData = $.extend(true, {}, notifyData || {}, { IsUnauthorized: true });\n }\n\n success(notifyData, textStatus, jqXHR);\n }\n\n if (data.IsUnauthorized === true) {\n unauthorizedHandlers.forEach((handler, index, arr) => handler(data));\n }\n }\n\n function postJson(url: string, options?: any) {\n options = options || {};\n options.dataType = 'json'; //text html or default(IG)\n options.method = 'POST';\n\n var dataToSend = options.data;\n if (typeof dataToSend == \"string\") {\n dataToSend = JSON.parse(dataToSend);\n }\n dataToSend = dataToSend || {};\n dataToSend.isAjax = true;\n options.data = dataToSend;\n\n if (!options.hasOwnProperty('async')) {\n options.async = true\n }\n\n var uiBlock = options.uiBlock;\n options.uiBlock = undefined;\n var uiBlockNeeded = UiBlock.needBlock(uiBlock);\n\n var concreteSuccessHandler = options.success;\n var concreteErrorHandler = options.error;\n options.error = (jqXHR, textStatus, errorThrown) => {\n if (uiBlockNeeded) UiBlock.unBlock(uiBlock);\n\n commonErrorHandler(jqXHR, textStatus, errorThrown, concreteErrorHandler);\n }\n\n var doCallAjaxViewParsers = options.hasOwnProperty('doCallAjaxViewParsers') ? options.doCallAjaxViewParsers : true;\n\n options.success = (data, textStatus, jqXHR) => {\n if (uiBlockNeeded) UiBlock.unBlock(uiBlock);\n\n commonSuccessHandler(data, textStatus, jqXHR, concreteSuccessHandler, doCallAjaxViewParsers);\n }\n\n if (uiBlockNeeded) UiBlock.block(uiBlock);\n\n return $.ajax(url, options);\n }\n function SubmitFileForm(element: HTMLElement): void {\n var form = $(element).parents('form')[0];\n var actionUrl = $(form).attr('action');\n var f: any = $(form);\n var validator = f.validate();\n\n\n if (f.valid()) {\n document.dispatchEvent(new CustomEvent('validationSuccess', {\n detail: {\n validator\n }\n }))\n\n var formData = new FormData(f[0]);\n\n var uiBlock = UiBlock.getUiBlockDescriptor(element, UiBlock.getDefaultSpinnerBlock(element));\n UiBlock.block(uiBlock);\n\n $.ajax(actionUrl,\n {\n url: actionUrl,\n type: 'POST',\n data: formData,\n processData: false,\n contentType: false,\n success: (data, textStatus, jqXHR) => {\n UiBlock.unBlock(uiBlock);\n\n commonSuccessHandler(data, textStatus, jqXHR, null, true);\n },\n error: (jqXHR, textStatus, errorThrown) => {\n UiBlock.unBlock(uiBlock);\n },\n dataType: 'json'\n });\n } else {\n document.dispatchEvent(new CustomEvent('validationError', {\n detail: {\n validator\n }\n }))\n }\n }\n\n function getJson(url: string, options?: JQueryAjaxSettings) {\n options = options || {};\n options.dataType = 'json'; //text html or default(IG)\n options.method = 'GET';\n options.async = true;\n\n\n var dataToSend = options.data || '';\n if (typeof dataToSend == \"object\" && Object.keys(dataToSend).length > 0) {\n dataToSend = $.param(dataToSend);\n }\n dataToSend.isAjax = true;\n options.data = dataToSend;\n var concreteSuccessHandler = options.success;\n var concreteErrorHandler = options.error;\n options.error = (jqXHR, textStatus, errorThrown) => commonErrorHandler(jqXHR, textStatus, errorThrown, concreteErrorHandler);\n options.success = (data, textStatus, jqXHR) => commonSuccessHandler(data, textStatus, jqXHR, concreteSuccessHandler, false);\n\n return $.ajax(url, options);\n }\n\n function redirect(url: string, data?: any) {\n if (data)\n data = '?' + $.param(data);\n else\n data = \"\";\n window.location.href = url + data;\n }\n\n function refreshPage() {\n document.location.reload();\n }\n\n function serializeObject(element: any) {\n var o = {};\n var a = $(element).serializeArray();\n var ignore = $.unique($(element).find('[form-submit-ignore]').find('input').filter(function () { return this.name; }).map((i, elem: any) => { return elem.name; }).get());\n $.each(a, function () {\n if (ignore.indexOf(this.name) != -1)\n return;\n\n if (o[this.name] !== undefined) {\n if (!o[this.name].push) {\n o[this.name] = [o[this.name]];\n }\n o[this.name].push(this.value || '');\n } else {\n o[this.name] = this.value || '';\n }\n });\n return o;\n };\n\n function collectForm(element: any): any {\n var form = $(element).parents('form')[0];\n var f: any = $(form);\n\n var validator = f.validate();\n\n if (f.valid()) {\n document.dispatchEvent(new CustomEvent('validationSuccess', {\n detail: {\n validator\n }\n }))\n\n return { form: Ajax.serializeObject(form), isValid: true };\n }\n else {\n document.dispatchEvent(new CustomEvent('validationError', {\n detail: {\n validator\n }\n }))\n\n return { isValid: false };\n }\n }\n\n function submitByElement(element: HTMLElement) {\n var form = $(element).parents('form')[0];\n var actionUrl = $(form).attr('action');\n var f: any = $(form);\n if (f.valid()) {\n var data = Ajax.serializeObject(form);\n var uiBlock = UiBlock.getUiBlockDescriptor(element, UiBlock.getDefaultSpinnerBlock(element));\n\n Ajax.postJson(actionUrl, { data: data, uiBlock: uiBlock });\n }\n }\n\n function submit(selector: any) {\n var element;\n if (typeof (selector) == 'string') {\n element = $(selector)[0];\n } else if (typeof (selector) == 'object' && selector.tagName) {\n element = selector;\n }\n\n submitByElement(selector);\n }\n\n function ajaxAction(url, input) {\n var dataJson = $(input).attr('ajaxData');\n var data = null;\n if (dataJson) {\n data = JSON.parse(dataJson);\n }\n\n var uiBlock = UiBlock.getUiBlockDescriptor(input, UiBlock.getDefaultSpinnerBlock(input));\n\n Ajax.postJson(url, { data: data, uiBlock: uiBlock });\n }\n\n function init(lang: string, appSource: string) {\n if (appSource != null && appSource != undefined) {\n $.ajaxSetup({\n headers: {\n 'bb-ajax': '1',\n 'bb_lang': lang,\n 'bb_appSource': appSource\n }\n });\n }\n else {\n $.ajaxSetup({\n headers: {\n 'bb-ajax': '1',\n 'bb_lang': lang\n }\n });\n }\n }\n\n return {\n addAjaxViewParser,\n subscribeUnauthorized,\n unSubscribeUnauthorized,\n processViews,\n postJson,\n SubmitFileForm,\n getJson,\n redirect,\n refreshPage,\n serializeObject,\n collectForm,\n submit,\n ajaxAction,\n init\n }\n})()","import { BaseControlBehaviour } from './BaseControlBehaviour';\ndeclare let ymaps: any;\ndeclare let Map: any;\nexport class AddressesTableBehaviour extends BaseControlBehaviour {\n constructor() {\n super('city-expander');\n }\n\n getInstalledTag() {\n return this.tagInstalled;\n }\n\n static installMap(mapElement: JQuery) {\n if (\n mapElement.data('longitude') == '' ||\n mapElement.data('latitude') == ''\n ) {\n mapElement.text(\n window.Localization.getString(\n 'Scripts_Shared_Infrastructure.AddressesTableBehaviour_2',\n 'Карта недоÑтупна'\n )\n );\n return;\n }\n\n const myMap = new ymaps.Map(mapElement[0], {\n center: [mapElement.data('longitude'), mapElement.data('latitude')],\n zoom: 16,\n });\n\n Map = myMap;\n\n const clusterer = new ymaps.Clusterer({\n preset: 'islands#nightClusterIcons',\n }),\n myPlacemark = new ymaps.Placemark(\n [mapElement.data('longitude'), mapElement.data('latitude')],\n null,\n {\n iconLayout: 'default#image',\n iconImageHref:\n '../../../Content/shared/images/mapmarker.png',\n iconImageSize: [50, 65],\n iconImageOffset: [-25, -68],\n }\n );\n\n myMap.controls.remove('trafficControl');\n myMap.controls.remove('searchControl');\n myMap.controls.remove('fullscreenControl');\n\n clusterer.add(myPlacemark);\n\n myMap.geoObjects.add(clusterer);\n }\n\n protected installBehaviour(element: HTMLElement): void {\n $(element).click(function () {\n const toToggle = $(this).siblings(\n '.addresses-body__expanded-table'\n );\n\n toToggle.slideToggle('medium', () => {\n $(this).trigger('endToggle');\n });\n\n const mapRow = $('.addresses-body__expanded-row', toToggle);\n\n if ($(this).hasClass('m-opened')) {\n $(this).removeClass('m-opened');\n $(this)\n .parent('.addresses-body__table-row-wrapper')\n .removeClass('m-opened');\n mapRow.unbind('click');\n } else {\n /*\n var openedExpander = $('.addresses-body__table-row.m-opened');\n if (openedExpander.length != 0) {\n var table = openedExpander.siblings('.addresses-body__expanded-table');\n table.toggle('medium');\n openedExpander.removeClass('m-opened');\n openedExpander.parent('.addresses-body__table-row-wrapper').removeClass('m-opened');\n var openedRow = $('.addresses-body__expanded-row', table);\n openedRow.unbind('click');\n }\n*/\n\n $(this).addClass('m-opened');\n $(this)\n .parent('.addresses-body__table-row-wrapper')\n .addClass('m-opened');\n\n mapRow.click(function () {\n const map = $(this).siblings(\n '.addresses-body__expanded-table-map'\n );\n\n const openedMap = $(\n '.addresses-body__expanded-table-map.m-opened'\n );\n\n if (map.hasClass('m-opened')) {\n map.removeClass('m-opened');\n $(this)\n .parent('.addresses-body__expanded-row-wrapper')\n .removeClass('m-opened');\n } else {\n if (openedMap.length != 0) {\n openedMap.removeClass('m-opened');\n openedMap\n .parent('.addresses-body__expanded-row-wrapper')\n .removeClass('m-opened');\n if (Map.length != 0) Map.destroy();\n }\n\n map.addClass('m-opened');\n $(this)\n .parent('.addresses-body__expanded-row-wrapper')\n .addClass('m-opened');\n const mapContainer = $('#adressmap', map);\n\n if (mapContainer[0].innerHTML == '')\n ymaps.ready(\n AddressesTableBehaviour.installMap(mapContainer)\n );\n\n $(this).trigger('endToggle');\n }\n });\n }\n });\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.AddressesTableBehaviour = AddressesTableBehaviour;\n","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n\n/**\n * AjaxAction - добавлÑет ajax postJson поведение на контрол Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¾Ð¼ ajax-action\n * еÑли указан атррибут ajax-action-form то на вÑе input[type=text] навешиваетÑÑ keydown, кроме Ñлементов иÑключений, указанных в маÑÑиве excludeTags\n * еÑли контрол начинаетÑÑ Ñ input- но не submit то вызов ajax метода будет оÑущеÑтвлÑÑ‚ÑŒÑÑ Ð¿Ð¾ изменению, в противном Ñлучае по клик\n * ЗавиÑит от EnterBehaviour\n * ajax-action-use-spinner - показывать или нет Ñпиннер\n * ajax-action-success-action - дейÑтвие на уÑпех\n */\nexport class AjaxActionBehavior extends BaseEmptyPrefixControlBehaviour {\n ajaxActionTypes: any = {\n default: {\n all: {},\n 'input-checkbox': {\n delay: 300,\n },\n },\n };\n private excludeTags: string[];\n\n constructor() {\n super('ajax-action');\n this.excludeTags = [new Behaviours.EnterBehaviour().getInstalledTag()];\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const isAjsxForm = $(element).attr(this.tag + '-form');\n if (isAjsxForm) {\n const form = $(element).parents('form')[0];\n const selector = 'input[type=text]';\n let excludeSelector = '';\n if (this.excludeTags && this.excludeTags.length > 0) {\n excludeSelector += ':not(';\n for (let i = 0; i < this.excludeTags.length; i++) {\n excludeSelector += '[' + this.excludeTags[i] + ']';\n if (i < this.excludeTags.length - 1) excludeSelector += ',';\n }\n excludeSelector += ')';\n }\n $(form).on(\n 'keydown',\n selector + excludeSelector,\n { ajaxActionElement: element },\n (e) => this.ajaxActionEnterHandler(e)\n );\n }\n\n const elementFullType = Utils.getElementFullType(element);\n if (\n elementFullType.startsWith('input-') &&\n elementFullType != 'input-submit'\n ) {\n $(element).change((e) => this.ajaxActionSubmitHandler(e));\n } else {\n $(element).click((e) => this.ajaxActionSubmitHandler(e));\n }\n\n $(element).on('ajax-action', (e) => this.ajaxActionSubmitHandler(e));\n\n $(element).removeAttr('href');\n }\n\n private ajaxActionSubmitHandler(evt) {\n evt.preventDefault();\n\n return this.ajaxActionSubmit(evt.currentTarget);\n }\n\n private ajaxActionSubmit(element) {\n const url = $(element).attr(this.tag);\n\n let data;\n const elementFullType = Utils.getElementFullType(element);\n if (elementFullType == 'input-checkbox') {\n data = {};\n data[$(element).attr('name')] = $(element).is(':checked');\n } else if (elementFullType.startsWith('input-')) {\n data = {};\n data[$(element).attr('name')] = $(element).val();\n } else {\n const val = $(element).data('value');\n if (val) {\n data = Utils.tryEval($(element).data('value'));\n }\n }\n\n let config = $.extend(\n true,\n {},\n this.ajaxActionTypes.default.all,\n this.ajaxActionTypes.default[elementFullType] || {}\n );\n config = Utils.getObjectByAttributes(this.tag, element, null, config);\n\n if (config.form != undefined) {\n const formResult = Ajax.collectForm(element);\n if (!formResult.isValid) return;\n data = $.extend(true, data, {}, formResult.form);\n }\n\n const toSend: any = {\n data: data,\n };\n\n if ($(element).attr(this.tag + '-use-spinner') != null) {\n const uiBlock = UiBlock.getUiBlockDescriptor(\n element,\n UiBlock.getDefaultSpinnerBlock(element)\n );\n toSend.uiBlock = uiBlock;\n }\n\n const func = $(element).attr(this.tag + '-success-action');\n if ($(element).attr(this.tag + '-success-action') != null) {\n toSend.success = (\n data,\n textStatus,\n jqXHR,\n concreteSuccessHandler\n ) => Utils.runFunction(func, element, data);\n }\n\n if (config.delay) {\n setTimeout(() => {\n Ajax.postJson(url, toSend);\n }, config.delay);\n } else {\n Ajax.postJson(url, toSend);\n }\n }\n\n private ajaxActionEnterHandler(keyupEvent) {\n if (keyupEvent.which == 13) {\n keyupEvent.preventDefault();\n\n this.ajaxActionSubmit(keyupEvent.data.ajaxActionElement);\n }\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.AjaxActionBehavior = AjaxActionBehavior;","import { BaseControlBehaviour } from './BaseControlBehaviour';\n\n/**\n * AutoFocus - уÑтанавливает при загрузке Ñ„Ð¾ÐºÑƒÑ Ð½Ð° Ñлемент Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¾Ð¼ bb-auto-focus\n */\nexport class AutoFocusBehaviour extends BaseControlBehaviour {\n constructor() {\n super('auto-focus');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const isFocusedString = $(element).attr('bb-auto-focus');\n\n const isFocused: boolean = isFocusedString.toLowerCase() == 'true';\n\n if (isFocused) {\n $(element).focus();\n if (element instanceof HTMLInputElement) {\n element.selectionStart = element.value.length;\n }\n }\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.AutoFocusBehaviour = AutoFocusBehaviour;","/**\n * BaseControl - базовый клаÑÑ Ð¿Ð¾Ð²ÐµÐ´ÐµÐ½Ð¸Ñ\n * дефолт: prefix: \"bb-\", installed: \"-installed\"\n *\n */\nexport abstract class BaseControlBehaviour {\n private prefix = 'bb-';\n readonly installed: string = '-installed';\n\n protected tag: string;\n protected tagInstalled: string;\n protected name: string;\n protected options: IControlsOptions;\n\n constructor(name: string) {\n this.tag = this.getPrefix() + name;\n this.tagInstalled = this.tag + this.installed;\n this.name = name;\n }\n\n public getBehaviorName(): string {\n return this.name;\n }\n\n protected getPrefix(): string {\n return this.prefix;\n }\n\n protected getFullTag(): string {\n return this.tag;\n }\n\n public shouldInstall(element: any): boolean {\n return (\n $(element).is(\n '[' + this.tag + ']:not([' + this.tagInstalled + '])'\n ) && this.installCondition(element)\n );\n }\n\n protected installCondition(element: any): boolean {\n return true;\n }\n\n protected getBehaviorValue(element: any): string {\n return $(element).attr(this.tag);\n }\n\n protected setInstalled(element: any): void {\n if (!$(element).attr(this.tagInstalled)) {\n $(element).attr(this.tagInstalled, 'true');\n }\n }\n\n protected abstract installBehaviour(element: HTMLElement): void;\n public install(element: any, opts?: IControlsOptions): void {\n this.options = opts;\n this.installBehaviour(element);\n this.setInstalled(element);\n }\n}\n\n/**\n * BaseEmptyPrefixControl - базовый клаÑÑ Ð¿Ð¾Ð²ÐµÐ´ÐµÐ½Ð¸Ñ c переопределенным префикÑом = \"\"\n * дефолт: prefix: \"\", installed: \"-installed\"\n *\n */\nexport abstract class BaseEmptyPrefixControlBehaviour extends BaseControlBehaviour {\n constructor(attr: string) {\n super(attr);\n }\n\n protected getPrefix(): string {\n return '';\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.BaseControlBehaviour = BaseControlBehaviour;\nwindow.Behaviours.BaseEmptyPrefixControlBehaviour = BaseEmptyPrefixControlBehaviour","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * Changables - Ñлемент Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¾Ð¼ changable и input или select\n * будет обрабатыватьÑÑ ÐºÐ°Ðº Ñлемент Ñ Ð½Ð°Ñ‡Ð°Ð»ÑŒÐ½Ñ‹Ð¼Ð¸ данными лежащими в data-initial-value\n * каждый раз при изменении, данный Ñлемент будет помечатьÑÑ Ð¼Ð¾Ð´Ð¸Ñ„Ð¸ÐºÐ°Ñ‚Ð¾Ñ€Ð¾Ð¼ m-changed, еÑли данные отличаютÑÑ Ð¾Ñ‚ начальных\n * Ð’ аттрибуте можно указать ÑпиÑок ID buttons которые будут дизейблитÑÑ Ð¿Ñ€Ð¸ изменении\n */\nexport class ChangablesBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('changable');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const initialValue = this.getValue(element);\n $(element).attr('data-initial-value', initialValue);\n $(element).change((e) => this.handleChangableChanged(e));\n }\n\n private handleChangableChanged(evt) {\n const currentElement = evt.currentTarget;\n const config = Utils.getObjectByAttributes(\n this.tag,\n currentElement,\n null,\n { modifier: 'm-changed' }\n );\n const tagValue = this.getBehaviorValue(currentElement);\n\n const initialValue = $(currentElement).attr('data-initial-value');\n const currentValue = this.getValue(currentElement);\n if (currentValue == initialValue) {\n $(currentElement).removeClass(config.modifier);\n if (tagValue) {\n $(tagValue).each((index, elem) => {\n $(elem).removeClass('m-disabled');\n });\n }\n } else {\n $(currentElement).addClass(config.modifier);\n if (tagValue) {\n $(tagValue).each((index, elem) => {\n $(elem).addClass('m-disabled');\n });\n }\n }\n }\n\n private getValue(element: HTMLElement): any {\n const changableFullType = Utils.getElementFullType(element);\n if (changableFullType == 'select') {\n return $(element).find(':selected').val();\n }\n return $(element).val();\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.ChangablesBehaviour = ChangablesBehaviour;","import { BaseControlBehaviour } from '../BaseControlBehaviour';\nexport interface IComponentController {\n load(element: HTMLElement, config: any);\n}\n\nexport class ComponentBehavior extends BaseControlBehaviour {\n private _defaultConfig = {\n controller: null,\n };\n constructor() {\n super('component');\n }\n\n protected getControllerClass(controllerClass: string) {\n return eval(controllerClass);\n }\n protected installBehaviour(element: HTMLElement): void {\n const config = Utils.getObjectByAttributes(\n this.tag,\n element,\n null,\n $.extend(true, {}, this._defaultConfig)\n );\n if (config.controller) {\n const controllerClass = this.getControllerClass(config.controller);\n const controller: IComponentController = new controllerClass();\n $(element).data('controller', controller);\n controller.load(element, config);\n }\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.ComponentBehavior = ComponentBehavior;\n","import { BaseControlBehaviour } from \"./BaseControlBehaviour\";\n\nexport function unbindWindowWarning() {\n window.onbeforeunload = null;\n}\n\nexport class CustomFileBehaviour extends BaseControlBehaviour {\n constructor() {\n super('custom-file');\n }\n\n public static deleteFile(removeButton, parentSelector, fileSelector) {\n const parent = $(removeButton).parent(parentSelector);\n const file = $(fileSelector, parent);\n\n if (file.val() != '') {\n const isConfirmed = confirm(\n Localization.getString(\n 'FileControls.DeleteFile',\n 'Удалить файл?'\n )\n );\n if (isConfirmed) {\n file.val('');\n $(removeButton)\n .siblings('label')\n .children('mark')\n .text(\n Localization.getString(\n 'FileControls.NoFiles',\n 'Файл не выбран'\n )\n );\n $(removeButton).css('display', 'none');\n }\n }\n\n const fileNames = [];\n const totalFiles = $(parentSelector).find('[type=\"file\"]');\n\n const labelCssClass = $(file).attr('custom-file-label-class');\n if (labelCssClass) {\n $(parent).siblings('.j-upload-label').removeClass(labelCssClass);\n }\n\n $.each(totalFiles, function (i, item) {\n const value = $(totalFiles[i]).val();\n if (value != '') {\n fileNames.push(value);\n }\n });\n\n if (fileNames.length == 0) window.onbeforeunload = null;\n }\n\n public static clearFileInput(removeButton, parentSelector, fileSelector) {\n const parent = $(removeButton).closest(parentSelector);\n const file = $(fileSelector, parent)[0];\n\n $(file).val('');\n\n const labelCssClass = $(file).attr('custom-file-label-class');\n if (labelCssClass) {\n $('.j-upload-label', parent).removeClass(labelCssClass);\n }\n $(file).siblings('.j-upload-value').text('');\n }\n\n private static RollbackFileControls(\n inputElement: any,\n uploadButton: JQuery\n ) {\n const inputWrapper = $(inputElement);\n inputWrapper.val('');\n if (inputElement.files.length > 0) inputElement.files[0] = null;\n if (uploadButton.length > 0) {\n uploadButton.addClass('m-disabled');\n }\n $('[custom-file-uploadPath-element]').text(\n window.Localization.getString(\n 'Scripts_Shared_Infrastructure.CustomFileBehaviour_3',\n 'Загрузить файл'\n )\n );\n }\n\n protected installBehaviour(element: HTMLElement) {\n $(element).attr('custom-file-installed', 'true');\n const clearFileInputButtonSelector = $(element).attr(\n 'custom-file-clear-button'\n );\n if (clearFileInputButtonSelector) {\n $(element)\n .siblings(clearFileInputButtonSelector)\n .click((evt) => {\n evt.preventDefault();\n evt.stopPropagation();\n $(evt.target);\n const parentSelector =\n $(evt.target).attr('parent-selector') || 'div';\n const fileSelector =\n $(evt.target).attr('file-selector') ||\n 'input[type=file]';\n\n CustomFileBehaviour.clearFileInput(\n evt.target,\n parentSelector,\n fileSelector\n );\n });\n }\n $(element).change(function () {\n let isError = false;\n let errorMessage = '';\n\n const maxUSerSize = parseInt($(this).attr('custom-file-max-size')); //мегабайты\n const maxSizeBytes: number = maxUSerSize * 1024 * 1024; //байты\n const uploadButton = $('[custom-file-uploadButton]');\n if (this.files.length == 0) {\n CustomFileBehaviour.RollbackFileControls(this, uploadButton);\n return;\n }\n const fileSize: number = this.files[0].size;\n\n if (fileSize > maxSizeBytes) {\n errorMessage =\n Localization.getString(\n 'FileControls.MaxUserSize1',\n 'Размер файла не должен превышать '\n ) +\n maxUSerSize +\n Localization.getString('FileControls.MaxUserSize2', ' Мб');\n isError = true;\n }\n\n const allowedExtensions = $(this)\n .attr('custom-file-extensions')\n .split(',');\n const fileName: string = $(this).val();\n const extension: string = fileName.replace(/^.*\\./, '');\n\n if ($.inArray(extension, allowedExtensions) == -1) {\n errorMessage =\n Localization.getString(\n 'FileControls.AllowedExtensions1',\n 'ДопуÑкаютÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ '\n ) +\n allowedExtensions.toString() +\n Localization.getString(\n 'FileControls.AllowedExtensions2',\n ' раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²'\n );\n isError = true;\n }\n\n if (isError) {\n alert(errorMessage);\n CustomFileBehaviour.RollbackFileControls(this, uploadButton);\n } else {\n if (uploadButton.length > 0) {\n uploadButton.removeClass('m-disabled');\n }\n const uploadPathElement = $('[custom-file-uploadPath-element]');\n $(this).siblings('.j-upload-value').text($(element).val());\n\n const labelCssClass = $(this).attr('custom-file-label-class');\n if (labelCssClass) {\n $(this).siblings('.j-upload-label').addClass(labelCssClass);\n }\n\n if (uploadPathElement.length > 0) {\n uploadPathElement.html(fileName.split(/(\\\\|\\/)/g).pop());\n }\n\n if (\n $(this).attr('custom-file-warning') == 'true' &&\n this.files[0] != null\n ) {\n window.onbeforeunload = function () {\n return Localization.getString(\n 'FileControls.FilesWillBeDeleted',\n 'При перезагрузке Ñтраницы прикрепленные файлы будут удалены'\n );\n };\n }\n }\n });\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.CustomFileBehaviour = CustomFileBehaviour;\nwindow.Behaviours.unbindWindowWarning = unbindWindowWarning;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * CustomSelects - применÑет к Ñлементу Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±Ñ‚Ð¾Ð¼ custom-select niceSelect\n */\nexport class CustomSelectsBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('custom-select');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n if (\n (<any>window).globalAppSettings.isMobileDevice &&\n !(<any>window).globalAppSettings.isMobileDeviceInDesktopMode\n ) {\n return;\n }\n\n if ($.fn.niceSelect) {\n (<any>$(element)).niceSelect();\n }\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.CustomSelectsBehaviour = CustomSelectsBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * DatePicker - Ñлмент Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¾Ð¼ datepicker указывает на то, что будет к нему применен метод ui.datepicker\n * ÑвойÑтва иÑпользуемые в дейтпикере (коррелирют Ñо ÑвойÑтвами ui.datepicker):\n * minDate\n * maxDate\n * yearRange\n * dateFormat\n * showOtherMonths (по-умолчанию = true)\n * selectOtherMonths (по-умолчанию = true)\n * changeYear (по-умолчанию = true)\n * beforeShow\n * duration (по-умолчанию = fast)\n * inputMask\n * z-index (по-умолчанию = 1000)\n */\nexport class DatePickerBehaviour extends BaseEmptyPrefixControlBehaviour {\n private functions: any = {\n beforeShow: true,\n onSelect: true,\n };\n private defaults: any = {\n showOtherMonths: true,\n selectOtherMonths: true,\n changeYear: true,\n duration: 'fast',\n 'z-index': 1000,\n onSelect: (text, instance) => {\n const jq: any = $;\n const input = instance.input[0];\n const form = input.form;\n const validator = jq(form).validate();\n if (validator) validator.element(input);\n if ($(input).is('[pager-trigger]')) $(input).keyup();\n },\n };\n private properties: any = {\n 0: {\n mindate: 'minDate',\n maxdate: 'maxDate',\n yearrange: 'yearRange',\n dateformat: 'dateFormat',\n showothermonths: 'showOtherMonths',\n selectothermonths: 'selectOtherMonths',\n changeyear: 'changeYear',\n beforeshow: 'beforeShow',\n duration: 'duration',\n inputmask: 'inputMask',\n onselect: 'onSelect',\n },\n };\n\n constructor() {\n super('datepicker');\n }\n protected installCondition(element: any): boolean {\n return !!$.datepicker;\n }\n protected installBehaviour(element: HTMLElement): void {\n const dp = $(element);\n const data: any = Utils.getObjectByAttributes(\n this.tag,\n element,\n (p, l) => this.propertyTranslator(p, l),\n this.defaults\n );\n for (const key in data) {\n if (this.isFunction(key)) {\n data[key] = eval(data[key]);\n }\n }\n\n const beforeShow = data.beforeShow;\n data.beforeShow = function (input, instance) {\n instance.dpDiv.addClass('blockMsg');\n\n if (beforeShow) beforeShow.apply(this, arguments);\n };\n\n dp.datepicker(data);\n }\n\n private isFunction(property) {\n return this.functions[property];\n }\n\n private propertyTranslator(property: string, level: number): string {\n const levelObj = this.properties[level];\n if (levelObj) {\n const result = levelObj[property];\n if (result) return result;\n }\n return property;\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.DatePickerBehaviour = DatePickerBehaviour;","import { BaseControlBehaviour } from './BaseControlBehaviour';\n/**\n * Enter - уÑтанавливает keydown и обрабатывает enter\n * еÑли дополнительно указан bb-enter-btn то Ñчитаем что в аттрибуте лежат контролы разделенные | на которые будет повешен keydown, а Ñлемент на котором bb-enter будет кликатьÑÑ\n * еÑли не указан то Ñчитаем что на данный Ñлемент надо повеÑить keydown а контролы Ð´Ð»Ñ ÐºÐ»Ð¸ÐºÐ° указаны в значении аттрибута bb-enter\n */\nexport class EnterBehaviour extends BaseControlBehaviour {\n constructor() {\n super('enter');\n }\n\n getInstalledTag() {\n return this.tagInstalled;\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const fromBtn = $(element).attr(this.tag + '-btn');\n const idCtrls = this.getBehaviorValue(element).split('|');\n if (fromBtn) {\n for (let i = 0; i < idCtrls.length; i++) {\n this.setKeydown($('#' + idCtrls[i]), element);\n }\n } else {\n for (let i = 0; i < idCtrls.length; i++) {\n this.setKeydown(element, $('#' + idCtrls[i]));\n }\n }\n }\n\n private setKeydown(element: any, clickElement: any) {\n $(element).keydown((e) => {\n if (e.which === 13) {\n e.stopPropagation();\n e.preventDefault();\n\n clickElement.click();\n }\n });\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.EnterBehaviour = EnterBehaviour;","window.FileControlsBehaviour = (function () {\n function parse(element: any) {\n installCustomFileInputs(element);\n }\n\n function unbindWindowWarning() {\n window.onbeforeunload = null;\n }\n function deleteFile(removeButton, parentSelector, fileSelector) {\n const parent = $(removeButton).parent(parentSelector);\n const file = $(fileSelector, parent);\n\n if (file.val() != '') {\n const isConfirmed = confirm(\n Localization.getString(\n 'FileControls.DeleteFile',\n 'Удалить файл?'\n )\n );\n if (isConfirmed) {\n file.val('');\n $(removeButton)\n .siblings('label')\n .children('mark')\n .text(\n Localization.getString(\n 'FileControls.NoFiles',\n 'Файл не выбран'\n )\n );\n $(removeButton).css('display', 'none');\n }\n }\n\n const fileNames = [];\n const totalFiles = $(parentSelector).find('[type=\"file\"]');\n\n $.each(totalFiles, function (i, item) {\n const value = $(totalFiles[i]).val();\n if (value != '') {\n fileNames.push(value);\n }\n });\n\n if (fileNames.length == 0) window.onbeforeunload = null;\n }\n\n function installCustomFileInputs(element) {\n const customFiles = $('[custom-file]', element).not(\n '[custom-file-installed]'\n );\n\n for (let i = 0; i < customFiles.length; i++) {\n const customFileElement = $(customFiles[i]);\n customFileElement.attr('custom-file-installed', 'true');\n customFileElement.change(function () {\n let isError = false;\n let errorMessage = '';\n\n const maxUSerSize = parseInt(\n $(this).attr('custom-file-max-size')\n ); //мегабайты\n const maxSizeBytes: number = maxUSerSize * 1024 * 1024; //байты\n const uploadButton = $('[custom-file-uploadButton]');\n if (this.files.length == 0) {\n RollbackFileControls(this, uploadButton);\n return;\n }\n const fileSize: number = this.files[0].size;\n\n if (fileSize > maxSizeBytes) {\n errorMessage =\n Localization.getString(\n 'FileControls.MaxUserSize1',\n 'Размер файла не должен превышать '\n ) +\n maxUSerSize +\n Localization.getString(\n 'FileControls.MaxUserSize2',\n ' Мб'\n );\n isError = true;\n }\n\n const allowedExtensions = $(this)\n .attr('custom-file-extensions')\n .split(',');\n const fileName: string = $(this).val();\n const extension: string = fileName.replace(/^.*\\./, '');\n\n if ($.inArray(extension, allowedExtensions) == -1) {\n errorMessage =\n Localization.getString(\n 'FileControls.AllowedExtensions1',\n 'ДопуÑкаютÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ '\n ) +\n allowedExtensions.toString() +\n Localization.getString(\n 'FileControls.AllowedExtensions2',\n ' раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²'\n );\n isError = true;\n }\n\n if (isError) {\n alert(errorMessage);\n RollbackFileControls(this, uploadButton);\n } else {\n if (uploadButton.length > 0) {\n uploadButton.removeClass('m-disabled');\n }\n const uploadPathElement = $(\n '[custom-file-uploadPath-element]'\n );\n if (uploadPathElement.length > 0) {\n uploadPathElement.html(\n fileName.split(/(\\\\|\\/)/g).pop()\n );\n }\n\n if (\n $(this).attr('custom-file-warning') == 'true' &&\n this.files[0] != null\n ) {\n window.onbeforeunload = function () {\n return Localization.getString(\n 'FileControls.FilesWillBeDeleted',\n 'При перезагрузке Ñтраницы прикрепленные файлы будут удалены'\n );\n };\n }\n }\n });\n }\n }\n\n function RollbackFileControls(inputElement: any, uploadButton: JQuery) {\n const inputWrapper = $(inputElement);\n inputWrapper.val('');\n if (inputElement.files.length > 0) inputElement.files[0] = null;\n if (uploadButton.length > 0) {\n uploadButton.addClass('m-disabled');\n }\n $('[custom-file-uploadPath-element]').text(\n window.Localization.getString(\n 'Scripts_Shared_Infrastructure.CustomFileBehaviour_3',\n 'Загрузить файл'\n )\n );\n }\n\n return {\n parse,\n unbindWindowWarning,\n deleteFile,\n };\n})();\n","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * InputMask - оÑновной аттрибут inputmask, указывает на то, что будет иÑпользоватьÑÑ ÐºÐ°ÑÑ‚Ð¾Ð¼Ð½Ð°Ñ Ñ€ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¼Ð°Ñки Ð´Ð»Ñ Ñлмента\n * inputmaskplaceholder - заменÑет placeholder\n * иÑпользуетÑÑ Ð¼Ð°Ñка взÑÑ‚Ð°Ñ Ñ options по типу указанному в аттрибует inputmask по регулÑрке /^type\\:(.*?)$/g\n * еÑли под регулÑрку не попадаем то иÑпользуем ту маÑку что указана в значении аттрибута\n */\nexport class InputMaskBehaviour extends BaseEmptyPrefixControlBehaviour {\n private inputMaskFn: Function = undefined;\n\n constructor() {\n super('inputmask');\n }\n\n protected installCondition(element: any): boolean {\n return !!$(element).inputmask;\n }\n\n protected installBehaviour(element: HTMLElement): void {\n let inputMask: any = Utils.getObjectByAttributes(\n this.tag,\n element,\n null,\n {}\n );\n\n let mask = this.getBehaviorValue(element);\n const placeholder = $(element).attr(this.tag + 'placeholder');\n if (mask) {\n const maskTypeRegex = /^type\\:(.*?)$/g;\n const typeMatch = maskTypeRegex.exec(mask);\n if (typeMatch) {\n const maskType = typeMatch[1];\n inputMask = $.extend(\n true,\n {},\n this.options.types.inputMask[maskType] || {},\n inputMask\n );\n mask = inputMask.mask;\n inputMask.mask = undefined;\n }\n\n if (placeholder !== undefined) {\n inputMask.placeholder = placeholder;\n }\n $(element).inputmask(mask, inputMask);\n } else if (inputMask) {\n $(element).inputmask(inputMask);\n }\n if (inputMask.clearbtn) {\n $(inputMask.clearbtn).click(() => {\n $(element).inputmask('setvalue', '');\n \n });\n }\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.InputMaskBehaviour = InputMaskBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * InputTrim - уÑтанавливает на контрол Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¾Ð¼ trim поведение, удалÑющее пробельные Ñимволы Ñ Ð½Ð°Ñ‡Ð°Ð»Ð° и конца Ñтроки.\n * Пробельными Ñимволами в Ñтом контекÑте ÑчитаютÑÑ Ð²Ñе ÑобÑтвенно пробельные Ñимволы (пробел, табулÑциÑ, неразрывный пробел и прочие) и вÑе Ñимволы конца Ñтроки (LF, CR и прочие).\n * ПрименÑетÑÑ Ðº Ñлементам Ñ Ñ‚Ð¸Ð¿Ð¾Ð¼ input.\n */\nexport class InputTrimBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('inputtrim');\n }\n\n protected installCondition(element: any): boolean {\n return $(element).is('input');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n $(element).change((e) => this.onInputChanged(e.currentTarget));\n }\n\n private onInputChanged(element: any) {\n const input = $(element);\n const trimmed = input.val().trim();\n input.val(trimmed);\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.InputTrimBehaviour = InputTrimBehaviour;","import { BaseControlBehaviour } from './BaseControlBehaviour';\nexport class NotificationBehaviour extends BaseControlBehaviour {\n constructor() {\n super('notification-toggler');\n }\n\n getInstalledTag() {\n return this.tagInstalled;\n }\n\n private static installTogglers(\n togglers: JQuery,\n blockSelector: HTMLElement\n ): void {\n const pages = $('[data-stage]', blockSelector);\n\n $('.m-page').text('1 / ' + pages.length);\n\n $(togglers).click(function () {\n const currentPage = $(pages).filter('.m-active');\n\n const num: number = $(currentPage).data('stage');\n\n const direction = $(this).data('toggledirection');\n\n let nextNum = 0;\n\n switch (direction) {\n case 'prev': {\n nextNum = num == 0 ? num : num - 1;\n\n $('[data-toggleDirection=\"next\"]', blockSelector).show();\n $('[notification-confirm]', blockSelector).hide();\n\n if (nextNum == 0) {\n $(this).hide();\n }\n break;\n }\n case 'next': {\n nextNum = num === pages.length - 1 ? 0 : num + 1;\n\n $('[data-toggleDirection=\"prev\"]', blockSelector).show();\n\n if (nextNum == pages.length - 1) {\n $('[notification-confirm]', blockSelector).show();\n\n $(this).hide();\n }\n\n break;\n }\n }\n\n const nextPage = $(pages).filter(\n '[data-stage=\"' + nextNum + '\"]'\n )[0];\n\n $('.m-page').text(nextNum + 1 + ' / ' + pages.length);\n\n $(currentPage).hide();\n $(nextPage).show();\n\n $(currentPage).removeClass('m-active');\n $(nextPage).addClass('m-active');\n });\n }\n\n private static installCloseButton(blockSelector: HTMLElement): void {\n $(\n '[notification-close-control], [notification-confirm]',\n blockSelector\n ).click(function () {\n const id = $(this).data('notificationid');\n\n $('.notification-message-container', blockSelector).css(\n 'display',\n 'none'\n );\n\n $('[data-stage]', blockSelector).each(function (i, elem) {\n $(elem).hide();\n $(elem).removeClass('m-active');\n\n if (i == 0) {\n $(elem).show();\n $(elem).addClass('m-active');\n }\n });\n\n $('.m-page').text('');\n\n $('[data-stage = \"0\"]', blockSelector).addClass('m-active');\n\n const noShow = $(\n '.superexpress-checkbox__input',\n blockSelector\n ).prop('checked');\n\n const res = Ajax.postJson('/api/notification/close', {\n data: { notificationId: id, showNoMore: noShow },\n });\n\n res.done(function (data) {\n if (!data.isPersistent) {\n $(blockSelector).remove();\n }\n });\n\n UiBlock.unBlock({ selector: '_window' });\n });\n }\n\n private getNotificationContentNode(\n senderElement: HTMLElement\n ): HTMLElement {\n const key = $(senderElement).attr('notificationkey');\n return $(`[contentNotificationKey = \"${key}\"]`, document)[0];\n }\n\n public static ShowModalWindow(notificationKey: string) {\n const contentNode = $(\n `[contentNotificationKey = \"${notificationKey}\"]`,\n document\n )[0];\n\n if (contentNode) {\n const togglers = $('[notification-page-toggle]', contentNode);\n NotificationBehaviour.installTogglers(togglers, contentNode);\n NotificationBehaviour.installCloseButton(contentNode);\n\n $('.notification-message-container', contentNode).css(\n 'display',\n 'flex'\n );\n Ajax.postJson('/api/notification/setviewed', {\n data: { notificationKey: notificationKey },\n });\n\n UiBlock.block({\n message: contentNode,\n selector: '_window',\n });\n }\n }\n\n public ShowModalWindow(\n senderElement: HTMLElement,\n internalHandler: Function\n ) {\n const contentNode = this.getNotificationContentNode(senderElement);\n\n if (contentNode) {\n const togglers = $('[notification-page-toggle]', contentNode);\n\n NotificationBehaviour.installTogglers(togglers, contentNode);\n NotificationBehaviour.installCloseButton(contentNode);\n\n $('.notification-message-container', contentNode).css(\n 'display',\n 'flex'\n );\n\n const key = $(senderElement).attr('notificationkey');\n\n Ajax.postJson('/api/notification/setviewed', {\n data: { notificationKey: key },\n });\n\n UiBlock.block({\n message: contentNode,\n selector: '_window',\n });\n\n if ($(senderElement).attr('isTriggeredOnce') == 'true')\n $('[isTriggeredOnce]', document).each((i, element) =>\n $(element).removeAttr('notificationkey')\n );\n }\n\n if (internalHandler) internalHandler();\n }\n\n private showNotification(content: HTMLElement): void {\n $('.notification-message-container', content).css('display', 'flex');\n\n UiBlock.block({\n message: content,\n selector: '_window',\n });\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const contentNode = this.getNotificationContentNode(element);\n\n if (contentNode) {\n const togglers = $('[notification-page-toggle]', contentNode);\n\n NotificationBehaviour.installTogglers(togglers, contentNode);\n NotificationBehaviour.installCloseButton(contentNode);\n\n const isAutoShow = $(element).data('autoshow') == true;\n\n if (isAutoShow) {\n const key = $(element).attr('notificationkey');\n\n Ajax.postJson('/api/notification/setviewed', {\n data: { notificationKey: key },\n });\n\n this.showNotification(contentNode);\n } else {\n $(element).on('click', function () {\n const key = $(element).attr('notificationkey');\n\n Ajax.postJson('/api/notification/setviewed', {\n data: { notificationKey: key },\n });\n\n this.showNotification(contentNode);\n\n if ($(element).attr('isTriggeredOnce') == 'true')\n $(element).removeAttr('notificationkey');\n });\n }\n }\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.NotificationBehaviour = NotificationBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\nclass PagerUtils {\n static GetFilterData(): any {\n const dataProviders = $('[pager-trigger]');\n const dataArray = {};\n\n for (let i = 0; i <= dataProviders.length; i++) {\n const propName = $(dataProviders[i]).data('propertyname');\n const nodeName = $(dataProviders[i]).prop('nodeName');\n\n let propValue = '';\n const className = 'selected_value_' + propName;\n\n if (\n nodeName != 'SELECT' &&\n $(dataProviders[i]).hasClass(className)\n ) {\n propValue = $(dataProviders[i]).data('propertyvalue');\n } else {\n propValue = $(dataProviders[i]).val();\n }\n\n if (propName && propValue) {\n const data = {};\n data[propName] = propValue;\n $.extend(dataArray, data);\n }\n }\n\n return dataArray;\n }\n\n static GetCurrentPage(element: any): number {\n const maxPage = $(element).data('maxpage');\n const minPage = $(element).data('minpage');\n let requestedPage = $(element).val() - 1;\n\n if (requestedPage > maxPage) requestedPage = maxPage;\n if (requestedPage < minPage) requestedPage = minPage;\n return requestedPage;\n }\n}\n/**\n * PagerTrigger - уÑтанавливает на Ñлемент разметки Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¾Ð¼ pager-trigger Ñмену фильтров через Ajax.postJson\n * ЕÑли Ñлемент Ñ Ñ‚Ñгом Рто по клику, еÑли Ñлемент Select то по изменению\n * Предназначен Ð´Ð»Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ñ‹Ñ… фильтров\n * pager-trigger-after выполнÑетÑÑ Ð¿Ð¾Ñле фильтрации\n * pager-trigger-before выполнÑетÑÑ Ð´Ð¾ фильтрации\n * pager-trigger-minlength задает минимальную длинну запроÑа Ð´Ð»Ñ Ð¾Ñ‚Ð¿Ñ€Ð°Ð²ÐºÐ¸ на Ñервер\n * Ð´Ð»Ñ input иÑпользуетÑÑ keyup и таймер\n */\nexport class PagerTriggerBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('pager-trigger');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const nodeName = $(element).prop('nodeName');\n if (nodeName == 'INPUT') {\n let searchSendTimeoutHandler;\n let lastQuery = $(element).val();\n const minLength =\n parseInt($(element).attr(this.tag + '-minlength')) || 1;\n $(element).on('keyup', () => {\n const query = $(element).val();\n\n if (query === lastQuery && query.length > 0) return false;\n\n if (query.length < minLength && query.length > 0) return false;\n lastQuery = query.trim();\n clearTimeout(searchSendTimeoutHandler);\n searchSendTimeoutHandler = setTimeout(() => {\n this.handleFilterChange(element);\n }, 500);\n });\n } else {\n let eventName = '';\n switch (nodeName) {\n case 'A':\n case 'DIV': {\n eventName = 'click';\n break;\n }\n case 'SELECT': {\n eventName = 'change';\n break;\n }\n }\n $(element).on(eventName, () => {\n this.handleFilterChange(element);\n });\n }\n }\n\n private handleFilterChange(element: any) {\n this.before(element);\n\n if ($(element).prop('nodeName') == 'A') {\n const propName = $(element).data('propertyname');\n const className = 'selected_value_' + propName;\n const current = $('.' + className);\n current.each((index, value) => {\n $(value).removeClass(className);\n });\n $(element).addClass(className);\n }\n\n let data = PagerUtils.GetFilterData();\n data = Utils.getObjectByAttributes('data', element, null, data);\n data.page = $.extend({}, { number: 0 }, data.page);\n const url = $(element).attr('filterUrl');\n\n const uiBlock = UiBlock.getUiBlockDescriptor(\n element,\n UiBlock.getDefaultSpinnerBlock(element)\n );\n Ajax.postJson(url, {\n data: data,\n success: () => {\n this.after(element);\n },\n uiBlock: uiBlock,\n });\n }\n\n private before(element: any) {\n const before = $(element).attr(this.tag + '-before');\n this.call(before, element);\n }\n\n private after(element: any) {\n const after = $(element).attr(this.tag + '-after');\n this.call(after, element);\n }\n\n private call(func: string, element: any): void {\n if (func != null) {\n if (func.lastIndexOf(';') !== func.length - 1) {\n Utils.runFunctionByName(func, null, element);\n } else {\n Function(func).apply(element);\n }\n }\n }\n}\n\n/**\n * Pager - уÑтанавливает на Ñлемент разметки Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¾Ð¼ pager отправку Ajax.postJson по клику на Ñлементе,\n * еÑли он не имеет клаÑÑа disabled\n */\nexport class PagerBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('pager');\n }\n\n protected installBehaviour(element: any): void {\n const pager = $(element);\n if (!pager.hasClass('disabled')) {\n const pagerData: any = Utils.getObjectByAttributes(\n 'page',\n element,\n null,\n { hasPager: true }\n );\n if (pagerData.hasPager) {\n if (pager.is('input')) {\n //\n pager.on('change', () => {\n pagerData.number = PagerUtils.GetCurrentPage(element);\n\n this.sendPageRequest(element, pagerData);\n });\n } else {\n pager.on('click', () => {\n this.sendPageRequest(element, pagerData);\n });\n }\n }\n }\n }\n\n private sendPageRequest(element: any, pagerData: any) {\n let data = pagerData.data;\n if (data) {\n data = JSON.parse(data);\n }\n data = data || {};\n const additionalData = PagerUtils.GetFilterData();\n if (additionalData) {\n data = $.extend(data, additionalData);\n }\n data = Utils.getObjectByAttributes('data', element, null, data);\n data.page = {\n number: pagerData.number,\n size: pagerData.size,\n };\n const uiBlock = UiBlock.getUiBlockDescriptor(\n element,\n UiBlock.getDefaultSpinnerBlock(element)\n );\n Ajax.postJson(pagerData.url, { data: data, uiBlock: uiBlock });\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.PagerBehaviour = PagerBehaviour;\nwindow.Behaviours.PagerTriggerBehaviour = PagerTriggerBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * PasswordPreview - уÑтанавливает на контрол Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¾Ð¼ passwordpreview контрол показывающий пароль\n * применÑетÑÑ Ðº Ñлменттом Ñ Ñ‚Ð¸Ð¿Ð¾Ð¼ input[type=\"password\"]\n */\nexport class PasswordPreviewBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('passwordpreview');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const previewPasswordConfig: any = Utils.getObjectByAttributes(\n this.tag,\n element,\n null,\n {}\n );\n\n const id = 'id' + Math.random();\n $(element).attr(this.tagInstalled, id);\n let previewA =\n '<a tabindex=\"1000\" id=\"' + id + '\" onclick=\"return false;\">';\n if (previewPasswordConfig.content) {\n previewA += $(previewPasswordConfig.content).html();\n }\n previewA += '</a>';\n\n $(element).after(previewA);\n\n $(element).change((e) =>\n this.handlePasswordInputChanged(e.currentTarget)\n );\n $(element).keyup((e) =>\n this.handlePasswordInputChanged(e.currentTarget)\n );\n\n const previewButton = $('a[id=\"' + id + '\"]')[0];\n if (previewPasswordConfig.previewbuttonclass) {\n $(previewButton).addClass(previewPasswordConfig.previewbuttonclass);\n }\n\n $(previewButton).mousedown(this, this.handlePreviewButtonMouseDown);\n $(previewButton).mouseup(this, this.handlePreviewButtonMouseUp);\n $(previewButton).mouseout(this, this.handlePreviewButtonMouseUp);\n\n $(previewButton).on('touchstart', this, this.handlePasswordTouchStart);\n $(previewButton).on('touchend', this, this.handlePasswordTouchEnd);\n $(previewButton).on(\n 'touchcancel',\n this,\n this.handlePasswordTouchCancel\n );\n\n this.renderPasswordPreview(previewButton);\n }\n\n private handlePasswordTouchStart(evt: JQueryEventObject) {\n evt.preventDefault();\n evt.data.showPasswordPreview(evt.currentTarget);\n }\n\n private handlePasswordTouchEnd(evt: JQueryEventObject) {\n evt.preventDefault();\n evt.data.hidePasswordPreview(evt.currentTarget);\n }\n\n private handlePasswordTouchCancel(evt: JQueryEventObject) {\n evt.preventDefault();\n evt.data.hidePasswordPreview(evt.currentTarget);\n }\n\n private showPasswordPreview(element: any) {\n const previewButton = $(element);\n const id = previewButton.attr('id');\n const input = $('input[' + this.tagInstalled + '=\"' + id + '\"]');\n input.attr('type', 'text');\n\n this.renderPasswordPreview(previewButton);\n }\n\n private hidePasswordPreview(element: any) {\n const previewButton = $(element);\n const id = previewButton.attr('id');\n const input = $('input[' + this.tagInstalled + '=\"' + id + '\"]');\n input.attr('type', 'password');\n\n this.renderPasswordPreview(previewButton);\n }\n\n private handlePasswordInputChanged(element: any) {\n const input = $(element);\n const id = input.attr(this.tagInstalled);\n const previewButton = $('a[id=\"' + id + '\"]')[0];\n\n this.renderPasswordPreview(previewButton);\n }\n\n private handlePreviewButtonMouseDown(evt: JQueryMouseEventObject) {\n evt.preventDefault();\n evt.data.showPasswordPreview(evt.currentTarget);\n }\n\n private handlePreviewButtonMouseUp(evt: JQueryMouseEventObject) {\n evt.preventDefault();\n evt.data.hidePasswordPreview(evt.currentTarget);\n }\n\n private renderPasswordPreview(previewButton) {\n previewButton = $(previewButton);\n const id = previewButton.attr('id');\n const input = $('input[' + this.tagInstalled + '=\"' + id + '\"]');\n const text = input.val();\n if (text && text != '') {\n previewButton.show();\n } else {\n previewButton.hide();\n }\n\n const inputType = input.attr('type');\n if (inputType == 'password') {\n input.addClass('password-hidden');\n previewButton.addClass('password-hidden');\n\n input.removeClass('password-visible');\n previewButton.removeClass('password-visible');\n } else {\n input.addClass('password-visible');\n previewButton.addClass('password-visible');\n\n input.removeClass('password-hidden');\n previewButton.removeClass('password-hidden');\n }\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.PasswordPreviewBehaviour = PasswordPreviewBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\nexport class PaymentChannelAmountBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('data-bb-payment-subchannels');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n $(element).on('change', '[name = \"SelectedSubChannel\"]', function () {\n const selectedSCh = $('[name = \"SelectedSubChannel\"]:checked');\n\n const amount = $('[name=Amount]', element).first();\n amount.form().removeData('validator');\n\n $('.js-min', element).text(\n selectedSCh.attr('data-bb-subchannels-min-amount')\n );\n $('.js-max', element).text(\n selectedSCh.attr('data-bb-subchannels-max-amount')\n );\n\n amount.attr(\n 'data-val-minvalue-min',\n selectedSCh.attr('data-bb-subchannels-min')\n );\n amount.attr(\n 'data-val-maxvalue-max',\n selectedSCh.attr('data-bb-subchannels-max')\n );\n amount.attr(\n 'data-val-minvalue',\n selectedSCh.attr('data-bb-subchannels-min-amount-text')\n );\n amount.attr(\n 'data-val-maxvalue',\n selectedSCh.attr('data-bb-subchannels-max-amount-text')\n );\n\n Validators.parse(amount.form());\n });\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.PaymentChannelAmountBehaviour = PaymentChannelAmountBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * Recaptcha - рендерит recaptcha от гугла на Ñлемент Ñ Ð°Ñ‚Ñ‚Ñ€Ð¸Ð±ÑƒÑ‚Ð¾Ð¼ recaptcha\n * наÑтройки рекапчи берутьÑÑ Ð¸Ð· ÑвойÑтв данного Ñлемента\n */\nexport class RecaptchaBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('recaptcha');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const recaptcha: any = Utils.getObjectByAttributes(\n this.tag,\n element,\n null,\n {}\n );\n grecaptcha.render(recaptcha.selector, {\n sitekey: recaptcha.publickey,\n callback: (code) => {\n this.setRecaptchaValueAndRevalidate(\n recaptcha.resultselector,\n code\n );\n if (recaptcha.callback) {\n Utils.runFunctionByName(recaptcha.callback, null, null);\n }\n },\n 'expired-callback': () => {\n this.setRecaptchaValueAndRevalidate(\n recaptcha.resultselector,\n null\n );\n },\n });\n }\n\n private setRecaptchaValueAndRevalidate(selector, code) {\n const input: any = $(selector)[0];\n $(input).val(code);\n\n const form = input.form;\n const validator = (<any>$(form)).validate();\n validator.element(input);\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.RecaptchaBehaviour = RecaptchaBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * ReplaceTag - заменÑет у Ñлемента таг на таг указанный в аттрибуте replacetag в качеÑтве значениÑ\n */\nexport class ReplaceTagBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('replacetag');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const tag = this.getBehaviorValue(element);\n const newTag = $('<' + tag + '>')[0];\n $.each(element.attributes, (i, value) => {\n newTag.setAttribute(element.attributes[i].name, value);\n });\n $(element).children().clone(true, true).appendTo(newTag);\n $(element).replaceWith(newTag);\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.ReplaceTagBehaviour = ReplaceTagBehaviour;","/* eslint-disable @typescript-eslint/no-namespace */\nimport { BaseControlBehaviour } from '../BaseControlBehaviour';\n/**\n * UseBettingCartBehaviour - добавлÑет функционал добавление коÑфа в корзину\n */\nexport class UseBettingCartBehaviour extends BaseControlBehaviour {\n constructor() {\n super('use-betting-cart');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const jel: JQuery = $(element);\n const coefProp: string = this.getBehaviorValue(element);\n const coefTitle: string = jel.attr(this.tag + '-title');\n const event: any = jel.data('event');\n\n const data: BettingCartItem = {\n oId: event[coefProp].OriginalId,\n aId:\n event[coefProp].ActualId == 0 ||\n event[coefProp].ActualId == null\n ? event[coefProp].OriginalId\n : event[coefProp].ActualId,\n eId: event.EventId,\n eTitle: event.EventName,\n rTitle: coefTitle,\n val: event[coefProp].Value,\n isLive: event.IsLive,\n };\n\n const isClientCartEnabled =\n window?.globalAppSettings?.isClientCartEnabled;\n\n function removeFromCart(oId) {\n if (isClientCartEnabled) {\n window.ClientCart.removeOutcome(Number(oId));\n } else {\n BettingCart.removeItem(oId);\n }\n }\n\n function addToCart(sData) {\n if (isClientCartEnabled) {\n window.ClientCart.addOutcome({\n oId: Number(sData.oId),\n eId: Number(sData.eId),\n });\n return true;\n } else {\n return BettingCart.addItem(sData);\n }\n }\n\n function isInCart(oId) {\n if (isClientCartEnabled) {\n return window.ClientCart.hasOutcome(Number(oId));\n }\n return BettingCart.hasItem(Number(oId));\n }\n\n jel.click((el) => {\n if (isInCart(data.oId)) {\n removeFromCart(data.oId);\n jel.removeClass('active');\n } else {\n Metrics.sendMetrics('reviewWidgetAdding', data);\n if (addToCart(data)) {\n jel.addClass('active');\n BettingCart.Highlighting.activate.table();\n }\n }\n });\n\n if (isInCart(data.oId)) jel.addClass('active');\n\n $(document).on('deactivateCoefHightlight', (e, oid) => {\n if (data.oId == oid) jel.removeClass('active');\n });\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.UseBettingCartBehaviour = UseBettingCartBehaviour;","import { BaseControlBehaviour } from './BaseControlBehaviour';\n\ndeclare class AwesomeScrollbar {\n constructor(containerSelector: any, addClass: string);\n}\n\n/**\n * Scrollbar - уÑтанавливает Scrollbar\n */\nexport class ScrollbarBehaviour extends BaseControlBehaviour {\n constructor() {\n super('scrollbar');\n }\n\n protected installBehaviour(element: any): void {\n if ((<any>window).globalAppSettings.isMobileDevice) {\n return;\n }\n\n new AwesomeScrollbar($(element), this.getBehaviorValue(element));\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.ScrollbarBehaviour = ScrollbarBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * Sortable - иÑпользует $.ui.sortable\n * оÑновной аттрибут - sortable\n * иÑпользуетÑÑ Ð¾Ð¿Ñ†Ð¸Ñ revert - плавный анимированный возврат на Ñвою позицию\n */\nexport class SortableBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('sortable');\n }\n\n protected installBehaviour(element: HTMLElement): void {\n $(element).sortable({\n revert: true,\n });\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.SortableBehaviour = SortableBehaviour;\n","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * Tabs - иÑпользуетÑÑ Ð´Ð»Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ¸ переключений табов\n * оÑновной аттрибут tab-id:\n * иÑпользуетÑÑ ÐºÐ»Ð¸Ðº на Ñ‚Ñге A, при отÑутÑтвуии href вызываетÑÑ ÐºÐ°Ðº Ajax.redirect, в противном Ñлучае менÑет активноÑÑ‚ÑŒ табÑа(m-active, selectedTabContent)\n * дополнительный аттрибут tab-view-settings:\n * иÑпользуетÑÑ Ð½Ð° input[shouldrefreshtabs=true] по изменению Ñлемента Ñериализует данные Ñлемента и отправлÑет через Ajax.postJson\n */\nexport class TabsBehaviour extends BaseEmptyPrefixControlBehaviour {\n private tagViewSettings = 'tab-view-settings';\n\n constructor() {\n super('tabs');\n }\n\n protected getTabSwitches(element: any): JQuery {\n return $('a[tab-id]', element);\n }\n\n protected installBehaviour(element: HTMLElement): void {\n const tabs = this.getTabSwitches(element);\n tabs.unbind('click');\n tabs.on('click', (e) => this.handleTabClick(e));\n\n const refreshers = $(\n '.' + this.tagViewSettings + ' input[shouldrefreshtabs=true]',\n element\n );\n refreshers.change((e) => this.handleRefresherChange(e));\n }\n\n private handleTabClick(evt: JQueryEventObject) {\n evt.preventDefault();\n const tab = $(evt.currentTarget);\n\n const tabHref = tab.attr('href');\n if (tabHref == undefined || tabHref == '#') {\n const tabControl = tab.parents('[tabs]')[0];\n\n const tabHeaders = $('[tab-id]', tabControl).filter(\n (idx, el) => $(el).parents('[tabs]')[0] === tabControl\n );\n const tabSettingsContainer =\n '.' +\n this.tagViewSettings +\n '.tabs-' +\n $(tabControl).attr('id');\n\n $(tabSettingsContainer + ' input[name=m-active]').val(\n tab.attr(this.tag)\n );\n tabHeaders.removeClass('m-active');\n tab.addClass('m-active');\n\n const tabs = $('[tab-panelid]', tabControl).filter(\n (idx, el) => $(el).parents('[tabs]')[0] === tabControl\n );\n const tabContentShow = tabs.filter(\n '[tab-panelid=' + tab.attr('tab-id') + ']'\n );\n tabs.hide();\n tabs.removeClass('selectedTabContent');\n\n tabContentShow.show();\n tabContentShow.addClass('selectedTabContent');\n } else {\n Ajax.redirect(tabHref);\n }\n }\n\n private handleRefresherChange(evt: JQueryEventObject) {\n const settingsDiv = $(evt.target).parent(\n '.' + this.tagViewSettings + ''\n )[0];\n const settings = $('input', settingsDiv).serializeArray();\n const settingsObject: any = {};\n for (let i = 0; i < settings.length; i++) {\n const s = settings[i];\n settingsObject[s.name] = s.value;\n }\n\n if (\n settingsObject.tabsRefreshAjaxUrl &&\n settingsObject.tabsRefreshAjaxUrl !== ''\n ) {\n Ajax.postJson(settingsObject.tabsRefreshAjaxUrl, {\n data: settingsObject,\n });\n }\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.TabsBehaviour = TabsBehaviour;","import { BaseControlBehaviour } from './BaseControlBehaviour';\n/**\n */\nexport class ToggleBehaviour extends BaseControlBehaviour {\n constructor() {\n super('toggle');\n }\n\n protected installBehaviour(element: any): void {\n const selector = this.getBehaviorValue(element);\n\n $(element).on('change', () => {\n $(selector).toggle();\n });\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.ToggleBehaviour = ToggleBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\n/**\n * Tooltip - иÑпользует $.powertip\n * оÑновной аттрибут - tooltip\n * дополнительные ÑвойÑтва берутьÑÑ Ð¸Ð· атррибутов:\n * placement\n * smartPlacement\n * popupClass\n * manual\n * mouseOnToPopup\n * openEvents\n * closeEvents\n * title\n * одноименные ÑвойÑтва powerTip\n */\nexport class TooltipsBehaviour extends BaseEmptyPrefixControlBehaviour {\n private properties: any = {\n 0: {\n placement: 'placement',\n smartplacement: 'smartPlacement',\n popupclass: 'popupClass',\n manual: 'manual',\n mouseontopopup: 'mouseOnToPopup',\n openevents: 'openEvents',\n closeevents: 'closeEvents',\n },\n };\n\n constructor() {\n super('tooltip');\n }\n\n getTagName(): string {\n return this.tag;\n }\n\n protected installCondition(element: any): boolean {\n const jq: any = $;\n\n return !!jq.powerTip;\n }\n\n protected installBehaviour(element: HTMLElement): void {\n let tooltip: any = Utils.getObjectByAttributes(\n this.tag,\n element,\n (p, l) => this.propertyTranslator(p, l),\n {}\n );\n if (tooltip.type) {\n tooltip = $.extend(\n true,\n {},\n this.options.types.tooltip[tooltip.type] || {},\n tooltip\n );\n tooltip.type = undefined;\n }\n\n if (tooltip.title) {\n $(element).attr('title', tooltip.title);\n }\n $(element).powerTip(tooltip);\n }\n\n private propertyTranslator(property: string, level: number): string {\n const levelObj = this.properties[level];\n if (levelObj) {\n const result = levelObj[property];\n if (result) return result;\n }\n return property;\n }\n}\n\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.TooltipsBehaviour = TooltipsBehaviour;","import { BaseEmptyPrefixControlBehaviour } from './BaseControlBehaviour';\ndeclare let voxAPI: any;\ndeclare let VoxImplant: any;\ndeclare let currentCall: any;\nexport class VoximplantCallBehaviour extends BaseEmptyPrefixControlBehaviour {\n constructor() {\n super('voximplant-call');\n }\n\n private static OnConnected(): void {\n $.ajax('/SimpleIdentification/GetVoximplantCredentials', {\n success: function (data) {\n {\n voxAPI.login(data.login, data.password);\n }\n },\n });\n }\n\n public static initApi() {\n voxAPI = VoxImplant.getInstance();\n\n voxAPI.on(\n VoxImplant.Events.SDKReady,\n VoximplantCallBehaviour.OnSdkReady\n );\n voxAPI.on(\n VoxImplant.Events.ConnectionEstablished,\n VoximplantCallBehaviour.OnConnected\n );\n voxAPI.on(VoxImplant.Events.AuthResult, VoximplantCallBehaviour.OnAuth);\n\n if (!voxAPI.alreadyInitialized) {\n $.ajax('/SimpleIdentification/GetVoximplantSettings', {\n success: function (data) {\n {\n voxAPI.init({\n localVideoContainerId: 'voximplant_container',\n showDebugInfo: data.showDebugInfo,\n });\n }\n },\n });\n } else VoximplantCallBehaviour.OnSdkReady();\n }\n\n private static UpdateFPS() {\n $.ajax('/SimpleIdentification/GetVoximplantSettings', {\n success: function (data) {\n const sender =\n currentCall.peerConnection.impl.getTransceivers()[1].sender;\n\n const parameters = sender.getParameters();\n\n delete parameters.encodings[0].maxBitrate;\n\n parameters.encodings[0].maxFramerate = data.callFps;\n\n sender.setParameters(parameters);\n },\n });\n }\n\n private static Call(): void {\n $('#voximplantDataForm').validate();\n\n if ($('#voximplantDataForm').valid()) {\n $.ajax('/SimpleIdentification/GetAccountCustomCallData', {\n success: function (receivedData) {\n const formData = Ajax.serializeObject(\n $('#voximplantDataForm')\n );\n\n $.ajax('/account/profile/edit/voximplantcallback', {\n data: formData,\n method: 'post',\n success: function (result) {\n $.extend(formData, receivedData);\n\n const callSettings = {\n num: receivedData.callCenterNumber,\n useVideo: {\n sendVideo: true,\n },\n customData: formData,\n };\n\n currentCall = voxAPI.call(\n receivedData.callCenterNumber,\n {\n sendVideo: true,\n receiveVideo: true,\n },\n formData,\n {}\n );\n\n currentCall.addEventListener(\n VoxImplant.CallEvents.Connected,\n VoximplantCallBehaviour.OnCallConnected\n );\n currentCall.addEventListener(\n VoxImplant.CallEvents.Disconnected,\n VoximplantCallBehaviour.OnCallDiconnected\n );\n currentCall.addEventListener(\n VoxImplant.CallEvents.Failed,\n VoximplantCallBehaviour.OnCallFailed\n );\n\n $('#callButton').hide();\n $('#endCallButton').show();\n $('#voximplantDataForm').hide();\n },\n });\n },\n });\n }\n }\n\n private static OnCallFailed() {\n $.ajax('/account/profile/edit/voximplantfailcallback', {\n success: function () {\n VoxImplant.Hardware.StreamManager.get().hideLocalVideo();\n $('.btn-group').hide();\n $('#voximplantDataForm').hide();\n $('.voximplant_container_common').html(\n '<div><div class=\"profile-ident-popup__result\"><span class=\"profile-ident__ident-error\"></span><div class=\"profile-ident__popup-text\"><p class=\"profile-ident-popup__result-title\">' +\n window.Localization.getString(\n 'Scripts_Shared_Infrastructure.VoximplantCallBehaviour_4',\n 'Ошибка при звонке'\n ) +\n '</p><p class=\"profile-ident-popup__result-text\">' +\n window.Localization.getString(\n 'Scripts_Shared_Infrastructure.VoximplantCallBehaviour_5',\n 'Попробуйте еще раз или выберите другой ÑпоÑоб идентификации'\n ) +\n '</p></div></div><div class=\"profile-ident-popup__box-button m-passport\"><a class=\"button profile-ident-popup__button m-grey\" onclick=\"Popup.Close(this)\">' +\n window.Localization.getString(\n 'Scripts_Shared_Infrastructure.VoximplantCallBehaviour_6',\n 'ЗÐКРЫТЬ'\n ) +\n '</a></div></div>'\n );\n },\n });\n }\n\n private static OnCallConnected() {\n VoximplantCallBehaviour.UpdateFPS();\n VoximplantCallBehaviour.sendVideo(true);\n VoximplantCallBehaviour.showRemoteVideo(true);\n }\n\n private static OnCallDiconnected(call, headers) {\n $('.btn-group').hide();\n $('#voximplantDataForm').hide();\n VoxImplant.Hardware.StreamManager.get().hideLocalVideo();\n $('.voximplant_container_common').html(\n '<div><div class=\"profile-ident-popup__result\"><span class=\"profile-ident__ident-icon\"></span><div class=\"profile-ident__popup-text\"><p class=\"profile-ident-popup__result-title\">' +\n window.Localization.getString(\n 'Scripts_Shared_Infrastructure.VoximplantCallBehaviour_7',\n 'ПроводитÑÑ Ð¸Ð´ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ñ!'\n ) +\n '</p><p class=\"profile-ident-popup__result-text\">' +\n window.Localization.getString(\n 'Scripts_Shared_Infrastructure.VoximplantCallBehaviour_8',\n 'Ðто может занÑÑ‚ÑŒ определенное времÑ'\n ) +\n '</p></div></div><div class=\"ident-popup__footer\"><a class=\"button profile-ident-popup__button m-grey\" onclick=\"Popup.Close(this); window.location.reload();\">' +\n window.Localization.getString(\n 'Scripts_Shared_Infrastructure.VoximplantCallBehaviour_6',\n 'ЗÐКРЫТЬ'\n ) +\n '</a></div></div>'\n );\n voxAPI.disconnect();\n }\n\n private static OnSdkReady(): void {\n voxAPI.connect();\n }\n\n private static OnAuth(e): void {\n $('.btn-group').show();\n $('#voximplantDataForm').show();\n $('#voximplantSpinner').hide();\n\n VoxImplant.Hardware.CameraManager.get()\n .getInputDevices()\n .then(function (result) {\n const select = document.getElementById('camerasUser');\n\n for (let i = 0; i < result.length; i++) {\n const opt = document.createElement('option');\n\n opt.value = result[i].id;\n opt.innerHTML = result[i].name;\n\n select.appendChild(opt);\n }\n }, null);\n\n VoxImplant.Hardware.StreamManager.get().showLocalVideo(true);\n\n $.ajax('/SimpleIdentification/GetVoximplantVideoResolution', {\n success: function (result) {\n VoxImplant.Hardware.CameraManager.get().setDefaultVideoSettings(\n {\n frameHeight: result.frameHeight,\n frameWidth: result.frameWidth,\n }\n );\n },\n });\n }\n\n private static showRemoteVideo(flag) {\n currentCall.showRemoteVideo(flag);\n }\n\n private static sendVideo(flag) {\n currentCall.sendVideo(flag);\n }\n\n public static EndWork() {\n window.location.reload();\n }\n\n public static HangupCall() {\n if (typeof currentCall !== 'undefined') currentCall.hangup();\n\n $('#endCallButton').hide();\n }\n\n protected installBehaviour(element: HTMLElement): void {\n $(element).click(function () {\n VoximplantCallBehaviour.Call();\n });\n\n $('#endCallButton').click(function () {\n VoximplantCallBehaviour.HangupCall();\n });\n\n $('#camerasUser').change(function () {\n $.ajax('/SimpleIdentification/GetVoximplantVideoResolution', {\n success: function (result) {\n const selectedCam = $('#camerasUser').val();\n\n VoxImplant.Hardware.StreamManager.get().hideLocalVideo();\n\n VoxImplant.Hardware.CameraManager.get().setDefaultVideoSettings(\n {\n frameHeight: result.frameHeight,\n frameWidth: result.frameWidth,\n cameraId: selectedCam,\n }\n );\n\n if (typeof currentCall !== 'undefined') {\n VoxImplant.Hardware.CameraManager.get().setCallVideoSettings(\n currentCall,\n {\n frameHeight: result.frameHeight,\n frameWidth: result.frameWidth,\n cameraId: selectedCam,\n }\n );\n\n VoximplantCallBehaviour.UpdateFPS();\n }\n\n VoxImplant.Hardware.StreamManager.get().showLocalVideo(\n true\n );\n },\n });\n });\n }\n}\n\nif(!window.Behaviours) window.Behaviours = {};\nwindow.Behaviours.VoximplantCallBehaviour = VoximplantCallBehaviour;","import { BaseControlBehaviour } from './Behaviours/BaseControlBehaviour';\n\ndeclare var Inputmask: Function;\n\nwindow.ControlshandleGrecaptchaLoaded = function() {\n Controls.continueConfiguring();\n}\n\ninterface IControlTypeDefinitions {\n inputMask?: any;\n tooltip?: any;\n\n}\ninterface IControlsOptions {\n useRecaptcha?: boolean;\n types?: IControlTypeDefinitions;\n requiredBehaviors?: string[];\n}\n\nvar Controls = window.Controls = (function () {\n var options: IControlsOptions;\n let behaviours: BaseControlBehaviour[] = [];\n var requiredBehaviors: {};\n\n function configure(opts?: IControlsOptions) {\n if (typeof Behaviours.ReplaceTagBehaviour === 'function') behaviours.push(new Behaviours.ReplaceTagBehaviour());\n if (typeof Behaviours.InputMaskBehaviour === 'function') behaviours.push(new Behaviours.InputMaskBehaviour());\n if (typeof Behaviours.InputTrimBehaviour === 'function') behaviours.push(new Behaviours.InputTrimBehaviour());\n if (typeof Behaviours.DatePickerBehaviour === 'function') behaviours.push(new Behaviours.DatePickerBehaviour());\n if (typeof Behaviours.PagerBehaviour === 'function') behaviours.push(new Behaviours.PagerBehaviour());\n if (typeof Behaviours.PagerTriggerBehaviour === 'function') behaviours.push(new Behaviours.PagerTriggerBehaviour());\n if (typeof Behaviours.TabsBehaviour === 'function') behaviours.push(new Behaviours.TabsBehaviour());\n if (typeof Behaviours.TooltipsBehaviour === 'function') behaviours.push(new Behaviours.TooltipsBehaviour());\n if (typeof Behaviours.RecaptchaBehaviour === 'function') behaviours.push(new Behaviours.RecaptchaBehaviour());\n if (typeof Behaviours.PasswordPreviewBehaviour === 'function') behaviours.push(new Behaviours.PasswordPreviewBehaviour());\n if (typeof Behaviours.SortableBehaviour === 'function') behaviours.push(new Behaviours.SortableBehaviour());\n if (typeof Behaviours.ChangablesBehaviour === 'function') behaviours.push(new Behaviours.ChangablesBehaviour());\n if (typeof Behaviours.CustomSelectsBehaviour === 'function') behaviours.push(new Behaviours.CustomSelectsBehaviour());\n if (typeof Behaviours.AutoFocusBehaviour === 'function') behaviours.push(new Behaviours.AutoFocusBehaviour());\n if (typeof Behaviours.EnterBehaviour === 'function') behaviours.push(new Behaviours.EnterBehaviour());\n if (typeof Behaviours.AjaxActionBehavior === 'function') behaviours.push(new Behaviours.AjaxActionBehavior());\n if (typeof Behaviours.ToggleBehaviour === 'function') behaviours.push(new Behaviours.ToggleBehaviour());\n if (typeof Behaviours.ComponentBehavior === 'function') behaviours.push(new Behaviours.ComponentBehavior());\n if (typeof Behaviours.NotificationBehaviour === 'function') behaviours.push(new Behaviours.NotificationBehaviour());\n if (typeof Behaviours.WidgetBehavior === 'function') behaviours.push(new Behaviours.WidgetBehavior());\n if (typeof Behaviours.ScrollbarBehaviour === 'function') behaviours.push(new Behaviours.ScrollbarBehaviour());\n if (typeof Behaviours.UseBettingCartBehaviour === 'function') behaviours.push(new Behaviours.UseBettingCartBehaviour());\n if (typeof Behaviours.AddressesTableBehaviour === 'function') behaviours.push(new Behaviours.AddressesTableBehaviour());\n if (typeof Behaviours.PaymentChannelAmountBehaviour === 'function') behaviours.push(new Behaviours.PaymentChannelAmountBehaviour());\n if (typeof Behaviours.VoximplantCallBehaviour === 'function') behaviours.push(new Behaviours.VoximplantCallBehaviour());\n if (typeof Behaviours.CustomFileBehaviour === 'function') behaviours.push(new Behaviours.CustomFileBehaviour());\n options = opts || {};\n\n var behaviorsToInstall;\n if (!!options.requiredBehaviors) {\n behaviorsToInstall = options.requiredBehaviors;\n }\n else {\n behaviorsToInstall = ['*'];\n\n }\n\n setRequiredBehaviors.apply(behaviorsToInstall, behaviorsToInstall);\n\n configureDefaultOptions();\n\n if (options.useRecaptcha) {\n var s = document.createElement(\"script\");\n s.type = \"text/javascript\";\n s.src = \"https://www.google.com/recaptcha/api.js?render=explicit&onload=ControlshandleGrecaptchaLoaded&hl=ru\";\n s.async = true;\n s.defer = true;\n\n $(\"body\").append(s);\n }\n else {\n continueConfiguring();\n }\n }\n\n function setRequiredBehaviors() {\n requiredBehaviors = {};\n for (var i = 0; i < arguments.length; i++) {\n var b = arguments[i];\n if (b == '*') {\n requiredBehaviors = {};\n for (var j = 0; j < behaviours.length; j++) {\n requiredBehaviors[behaviours[j].getBehaviorName()] = true;\n }\n\n return;\n }\n else {\n requiredBehaviors[b] = true;\n }\n }\n }\n\n function configureDefaultOptions() {\n options.types = $.extend(true, {}, options.types || {});\n options.types.inputMask = $.extend(true, {}, options.types.inputMask || {});\n options.types.tooltip = $.extend(true, {}, options.types.tooltip || {});\n }\n\n function detectSelector(element: any) {\n if (!element) return null;\n if (typeof (element) == 'string') return { selector: element, type: 'css' }; //css Selector\n\n if (typeof (element) == 'object') {\n if (element.Selector && element.Html) return { selector: element.Selector, type: 'ajax', view: element }; // IAjaxView\n\n return { selector: element, type: 'html' };//вероÑтно HTML Element\n }\n\n return null;\n }\n\n function parse(element: any) {\n var selector = detectSelector(element);\n if (!selector) return;\n var shouldInstall = selector.type == 'css'\n || selector.type == 'html'\n || (selector.type == 'ajax' && !selector.view.OmitControlsInitialization);\n\n if (shouldInstall) {\n var elements = $('*', selector.selector);\n for (let i = 0; i < behaviours.length; i++) {\n let b = behaviours[i];\n if (requiredBehaviors[b.getBehaviorName()]) {\n for (var elementIndex = 0; elementIndex < elements.length; elementIndex++) {\n var elementToCheck = elements[elementIndex];\n\n if (b.shouldInstall(elementToCheck)) {\n b.install(elementToCheck, options);\n }\n }\n }\n }\n\n Validators.parse(selector.selector);\n }\n }\n\n function parseOne(element: HTMLElement, controlBehaviour: Behaviours.BaseControlBehaviour) {\n var selector = detectSelector(element);\n if (!selector) return;\n var shouldInstall = selector.type == 'css'\n || selector.type == 'html'\n || (selector.type == 'ajax' && !selector.view.OmitControlsInitialization);\n\n if (shouldInstall) {\n var elements = $('*', selector.selector);\n if (requiredBehaviors[controlBehaviour.getBehaviorName()]) {\n for (var elementIndex = 0; elementIndex < elements.length; elementIndex++) {\n var elementToCheck = elements[elementIndex];\n if (controlBehaviour.shouldInstall(elementToCheck)) {\n controlBehaviour.install(elementToCheck, options);\n }\n }\n }\n Validators.parse(selector.selector);\n }\n }\n\n function continueConfiguring() {\n Ajax.addAjaxViewParser((view) => {\n if (Controls) {\n Controls.parse(view);\n }\n }, 'default');\n\n Validators.init();\n\n parse(document);\n }\n\n return {\n configure,\n setRequiredBehaviors,\n parse,\n parseOne,\n continueConfiguring\n }\n}())","var LanguageSelector = window.LanguageSelector = (function () {\n function init(languageContainer) {\n $(document).on('click touch', languageContainer, function (event) {\n event.stopPropagation();\n\n if ($(event.target).closest('.j-lang-selected-option').length > 0) {\n dropListTrigger(event.currentTarget);\n } else if ($(event.target).closest('.drop-list__items > .option').length > 0) {\n let selectedOption = $(event.target).closest('.option')[0];\n let langContainer = event.currentTarget;\n\n event.stopPropagation();\n selectLanguage(selectedOption, langContainer);\n closeList(langContainer);\n }\n });\n\n $(document).on('click', function (e) {\n if ($(e.target).closest(languageContainer).length == 0) {\n closeList(languageContainer);\n }\n });\n }\n //dropList\n function dropListTrigger(triggerEl) {\n let dropListEl = $(\".j-lang-selector-drop-list\", triggerEl);\n let dropListArrow = $(\".j-lang-selector-drop-arrow\", triggerEl);\n\n if (dropListEl.hasClass(\"active\")) {\n dropListEl.removeClass(\"active\");\n dropListArrow.removeClass(\"open\");\n } else {\n dropListEl.addClass(\"active\");\n dropListArrow.addClass(\"open\");\n }\n }\n\n function closeList(langContainer) {\n let dropListEl = $(\".j-lang-selector-drop-list\", langContainer);\n let dropListArrow = $(\".j-lang-selector-drop-arrow\", langContainer);\n\n dropListEl.removeClass(\"active\");\n dropListArrow.removeClass(\"open\");\n }\n\n function selectLanguage(selectedOption, langContainer) {\n const langId = $(selectedOption).data('lang');\n const langName = $(selectedOption).text();\n const flagLang = $('.country-flag > img', selectedOption).attr('src');\n $('.j-lang-value', langContainer).val(langId);\n $('.j-lang-selected-option > .country-lang', langContainer).text(langName);\n $('.j-lang-selected-option > .country-flag > .country-flag__image', langContainer).attr('src', flagLang);\n const langIcon = langContainer.querySelector('.icon use');\n if (langIcon) {\n const culture = $(selectedOption).data('culture');\n const iconPath = `${window.globalAppSettings.svg.defaultSprite}#flag-${culture}`;\n langIcon.setAttribute('xlink:href', iconPath);\n }\n\n\n $(selectedOption).siblings().removeClass('selected');\n $(selectedOption).addClass('selected');\n\n Localization.changeLanguage(langId);\n }\n\n return {\n init\n }\n})()\n\nLanguageSelector.init('.j-lang-selector');","var LocalStorageProvider = window.LocalStorageProvider = (function() {\n function clearOutdatedBettingCart() {\n var curTimestamp = Date.now();\n var cart: any = localStorage.getItem('bettingCart');\n var isBettingCartUpdated = false;\n\n if (cart) {\n\n cart = JSON.parse(cart);\n\n // еÑли запиÑÑŒ о поÑледних изменениÑÑ… в корзине делалалÑÑŒ более 24 чаÑов назад, она удалÑетÑÑ\n // Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÑетÑÑ Ð¾Ñ‚Ð´ÐµÐ»ÑŒÐ½Ð¾\n for (var userData in cart) {\n if ((curTimestamp - cart[userData].timestamp) > (1000 * 60 * 60 * 24)) {\n delete cart[userData];\n isBettingCartUpdated = true;\n }\n }\n\n if (isBettingCartUpdated === true) {\n localStorage.setItem('bettingCart', JSON.stringify(cart));\n }\n }\n }\n\n return {\n clearOutdatedBettingCart\n }\n})()","var Localization = window.Localization = (function () {\n var hashCode: string;\n var culture: string;\n var allResources;\n\n var resourcesByType;\n\n function get(key, defaultValue) {\n if (this[key] == undefined)\n return defaultValue;\n else return this[key];\n }\n\n function init(version: string, cultureName: string) {\n\n hashCode = version;\n culture = cultureName;\n\n $.ajax(\"/resources/allresources/\" + hashCode, {\n data: {},\n success: resp => {\n\n allResources = resp.ActionData.resources;\n },\n async: false\n });\n\n resourcesByType = {};\n\n for (var i in allResources) {\n resourcesByType[allResources[i].Type] = getResource(allResources[i].Type, allResources[i].HashCodes[culture]);\n }\n }\n\n function getString(resourceKey: string, defaultValue: string) {\n const [type, key] = resourceKey.split('.');\n return key && resourcesByType[type]?.[key] ? resourcesByType[type][key] : defaultValue;\n }\n\n function getResource(type: string, version: string): JSON {\n var a: JSON;\n\n $.ajax(\"/resources/get/\" + type + \"/\" + version, {\n data: { typeString: type },\n success: response => {\n a = response.ActionData.res;\n },\n async: false\n });\n\n return a;\n }\n\n function getLanguage() {\n return (<any>window).globalAppSettings.lang; //TODO: get from cookie\n }\n\n function changeLanguage(lang: string) {\n const currentPath = window.location.pathname;\n const currentLang = getLanguage();\n\n if (currentPath === `/${currentLang}` || currentPath.startsWith(`/${currentLang}/`)) {\n window.location.href = `/${lang}` + currentPath.substring(3);\n }\n }\n\n return {\n get,\n init,\n getString,\n getLanguage,\n changeLanguage\n }\n})()\n\n\n","declare var globalAppSettings: any;\ndeclare var Base64: any;\n\nvar Metrics = window.Metrics = (function () {\n const selectors = {\n content: \"#page-content\",\n scrollarea: \"#m-page-content-scrollbar-scrollarea\",\n pageContent: \"#page-content\",\n pageFaq: \".article.page-content__overlay\",\n pageNews: \".news-body\",\n pageReview: \".review-page\",\n };\n const logTypes = {\n scroll: \"uni:page-scroll\",\n transition: \"uni:page-transition\",\n reviewAdding: \"uni:review-coef-added\",\n reviewWidgetAdding: \"uni:review-widget-coef-added\",\n };\n\n function getScrollPercent() {\n const documentScrolled = $(selectors.scrollarea).scrollTop();\n const contentHeight = $(selectors.content).height(); // only content without header and footer\n const scrollAreaHeight = $(selectors.scrollarea).height(); // content and footer\n let scrolledPercent = Math.floor(documentScrolled / (contentHeight - scrollAreaHeight) * 100);\n\n if (scrolledPercent > 100 || contentHeight < scrollAreaHeight) {\n scrolledPercent = 100;\n }\n\n return scrolledPercent;\n }\n\n function sendMetrics(type, body) {\n if (!globalAppSettings.isUiLogEnabled) {\n return;\n }\n\n type = logTypes[type];\n\n if (type === logTypes.reviewWidgetAdding && $(selectors.pageReview).length > 0) {\n type = logTypes.reviewAdding;\n }\n var data = JSON.parse(globalAppSettings.statisticsTemplateMessage);\n data.t = type;\n data.body = body;\n var dataString = Base64.toBase64(JSON.stringify(data));\n\n var img = $('<img id=\"stat_' + new Date().getTime() + '\" style=\"position: absolute; left: 0; top: 0;\" width=\"1\" height=\"1\" src=\"' +\n new URL(\"?lb=\" + dataString, globalAppSettings.statisticsHandlerUrl).href +\n '\" />');\n img.on('error', () => { img.remove(); });\n img.on('load', () => { img.remove(); });\n $('head').append(img);\n }\n\n function sendScroll(baseMetricData) {\n if ($(selectors.pageContent)) {\n let scrollPercent;\n setInterval(() => {\n const newScrollPercent = getScrollPercent();\n if (newScrollPercent !== scrollPercent) {\n\n var metricData = {\n scrolledPercent: newScrollPercent,\n location: window.location.href,\n Title: document.title,\n UniqueId: window.location.href\n };\n\n sendMetrics(\"scroll\", Object.assign(baseMetricData, metricData));\n scrollPercent = newScrollPercent;\n }\n }, 2000);\n }\n }\n\n function transitionLog(baseMetricData) {\n const link: any = document.activeElement;\n const currentLink: any = link.href != undefined ? link.href : \"undefined\";\n\n var metricData = {\n PreviousUrl: window.location.href,\n CurrentUrl: currentLink,\n Title: document.title,\n UniqueId: window.location.href\n };\n\n Metrics.sendMetrics(\"transition\", Object.assign(baseMetricData, metricData));\n };\n\n // send scroll position from /faq/\n if ($(selectors.pageFaq).length > 0) {\n const name: string = \"FAQ\";\n sendScroll({ Name: name });\n window.addEventListener(\"beforeunload\", () => { transitionLog({ Name: name }); });\n }\n\n // send scroll position from /reviews/\n if ($(selectors.pageReview).length > 0) {\n const name: string = \"Reviews\";\n\n var eventName = $(\".review-article__header-event-name\").data(\"event-name\");\n sendScroll({ Name: name, EventName: eventName });\n window.addEventListener(\"beforeunload\", () => { transitionLog({ Name: name, EventName: eventName }); });\n }\n\n // send scroll position from /news/\n if ($(selectors.pageNews).length > 0) {\n const name: string = \"News\";\n sendScroll({ Name: name });\n window.addEventListener(\"beforeunload\", () => { transitionLog({ Name: name }); });\n }\n\n return {\n sendMetrics\n }\n}());\n","var Popup = window.Popup = (function() {\n function Show(popupSelector: any) {\n let popup = null;\n const scrollPage = $(document).scrollTop();\n\n $(\".m-mobile body\").css({ position: 'fixed', top: -scrollPage + 'px', overflow: 'hidden' });\n\n if (popupSelector) {\n popup = $(popupSelector)[0];\n }\n else if (!popupSelector && this.Selector) {\n var possiblePopups = $('.popup', this.Selector);\n if (possiblePopups.length > 0) {\n popup = possiblePopups[0];\n }\n }\n\n\n if (!popup) return;\n const blockUi: any = UiBlock.getUiBlockDescriptor(popup);\n\n if (UiBlock.needBlock(blockUi)) {\n\n blockUi.message = popup.outerHTML;\n $(popup).remove();\n\n var previousOnBlock = blockUi.onBlock;\n blockUi.onBlock = function () {\n Controls.parse(this);\n if (previousOnBlock) previousOnBlock.call(this, arguments);\n }\n UiBlock.block(blockUi);\n }\n else {\n $(popup).show();\n }\n\n initHistoryBetCalcPopupPopover();\n\n document.dispatchEvent(\n new CustomEvent('mtmCustomEvent', {\n detail: {\n id: 'popup-show',\n popup,\n },\n })\n );\n }\n\n function isInPopup(element: any) {\n return $(element).parents('.popup').length > 0;\n }\n\n function getPopupSelector(element: any) {\n var parentPopup = $(element).parents('.popup')\n var popupCssClasses = parentPopup.attr('class').split(/\\s+/);\n var popupSelector = parentPopup.prop('tagName');\n if (popupCssClasses.length > 0) {\n popupSelector += '.' + popupCssClasses.join('.');\n }\n\n return popupSelector;\n }\n\n function Close(element: any) {\n const popup = findPopup(element);\n const blockUi: any = UiBlock.getUiBlockDescriptor(popup);\n const scrollPage = $(\".m-mobile body\").css('top');\n\n $(\".m-mobile body\").css({ position: '', top: '', overflow: '' });\n window.scrollTo(0, parseInt(scrollPage || '0') * -1);\n\n if (UiBlock.needBlock(blockUi)) {\n UiBlock.unBlock(blockUi);\n $(popup).remove();\n }\n else {\n $(popup).hide();\n }\n document.dispatchEvent(\n new CustomEvent('mtmCustomEvent', {\n detail: {\n id: 'popup-close',\n popup,\n },\n })\n );\n }\n\n function CloseWithCheckFlag(element: any, flagSelector: any, messageId: number) {\n const popup = findPopup(element);\n const flag = ($(popup).find(flagSelector)[0]) as HTMLInputElement;\n const state = flag.checked;\n\n Ajax.postJson(\"/ajax/message/modal/close\", {\n data: {\n messageId: messageId,\n stateModal: state\n },\n error: function () {\n }\n });\n\n Close(element);\n }\n\n function findPopup(element: any) {\n return $(element).parents('.popup')[0];\n }\n\n function SwitchLink(from: any, to: any, imgUrl: any) {\n var popup = findPopup(from);\n\n $(from).hide();\n $(to, popup).show();\n if (!!imgUrl) {\n $(to).append('<img src=\"' + imgUrl + '\" style=\"opacity: 0; width: 1px; height: 1px\" alt=\"\" />');\n }\n }\n\n function initHistoryBetCalcPopupPopover() {\n const isInitParam = !!(+sessionStorage.getItem('initHistoryBetCalcPopupPopover'));\n\n if (!isInitParam) {\n return;\n }\n\n document.dispatchEvent(new CustomEvent('betCalcPopupPopover:show'));\n }\n\n return {\n Show,\n isInPopup,\n getPopupSelector,\n Close,\n CloseWithCheckFlag,\n SwitchLink\n }\n}());","var SRLiveAdapter = window.SRLiveAdapter = (function () {\n\tvar SRLive: any;\n\n function init(SRLiveInst: any) {\n\t\tSRLive = SRLiveInst;\n\t\tvar event = document.createEvent('Event');\n\t\tvar initEvent = event.initEvent('initSRLive', false, true);\n document.dispatchEvent(event);\n }\n\n function addWidget(params: Object) {\n return new Promise((resolve, reject) => {\n if (!SRLive) {\n document.addEventListener('initSRLive', function () {\n resolve(SRLive.addWidget(params));\n });\n } else {\n resolve(SRLive.addWidget(params));\n }\n });\n }\n\n function stopWidget(widget: Object) {\n if (SRLive) {\n var SRWidget = SRLive.getWidget(widget);\n if (SRWidget) SRWidget.pauseFeeds();\n }\n return;\n }\n\n function resumeWidget(widget: Object) {\n if (SRLive) {\n var SRWidget = SRLive.getWidget(widget);\n if (SRWidget) SRWidget.resumeFeeds(true);\n }\n return;\n }\n\n function removeWidget(widget: Object) {\n if (SRLive) {\n SRLive.removeWidget(widget);\n }\n }\n\n function isSRLiveReady() {\n return SRLive ? true : false;\n }\n\n function getSRLive() {\n return SRLive;\n }\n\n return {\n init,\n addWidget,\n stopWidget,\n resumeWidget,\n removeWidget,\n isSRLiveReady,\n getSRLive\n }\n}());","var UiBlock = window.UiBlock = (function() {\n function unBlock(uiBlock) {\n $(uiBlock.selector == '_window' ? window : uiBlock.selector).unblock();\n }\n\n var blockTypes =\n {\n default: {\n css: {\n zIndex: 1011,\n position: 'fixed',\n padding: 0,\n margin: 0,\n width: '100%',\n top: 0,\n left: 0,\n textAlign: 'left',\n color: 'rgb(0, 0, 0)',\n border: 'none',\n backgroundColor: 'transparent',\n cursor: 'default',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center'\n },\n themedCSS: {\n width: '30%',\n top: '30%',\n left: '35%'\n },\n overlayCSS: {\n borderRadius: '0px'\n }\n },\n transparent: { css: { border: 'none', 'background-color': 'transparent' } },\n '680px': { css: { width: '36%', left: '32%' } }\n };\n\n function block(uiBlock) {\n var block = $.extend(true, {}, uiBlock);\n delete block.messageSelector;\n delete block.message;\n\n if (uiBlock.message) {\n block.message = uiBlock.message;\n }\n if (uiBlock.messageSelector) {\n block.message = $(uiBlock.messageSelector).clone().wrap('<p>').parent().html();\n }\n\n var blckConfig: any = {};\n $.extend(true, blckConfig, blockTypes.default);\n\n if (block.type)\n {\n $.extend(true, blckConfig, blockTypes[block.type] || {});\n\n block.type = null;\n }\n\n $.extend(true, blckConfig, block);\n\n if (blckConfig.overlayCSS && blckConfig.overlayCSS.position) {\n blckConfig.overlayCSS.userOverlayCSSPosition = true;\n }\n\n $(uiBlock.selector == '_window' ? window : uiBlock.selector).block(blckConfig);\n }\n\n function getUiBlockPropertyName(attrName: string, level: number) {\n if (level == 0 && attrName.toLowerCase() == 'overlaycss') {\n return 'overlayCSS';\n }\n if (level == 0 && attrName.toLowerCase() == 'blockmsgclass') {\n return 'blockMsgClass';\n }\n\n if (level == 0 && attrName.toLowerCase() == 'centerx') {\n return 'centerX';\n }\n\n if (level == 0 && attrName.toLowerCase() == 'centery') {\n return 'centerY';\n }\n\n if (level == 0 && attrName.toLowerCase() == 'messageselector') {\n return 'messageSelector';\n }\n if (attrName.toLocaleLowerCase() == 'backgroundcolor')\n {\n return 'background-color';\n }\n\n return attrName;\n }\n\n function getDefaultSpinnerBlock(element: HTMLElement, defaultValue: any = undefined ) {\n var blockSelector: string = '_window';\n if (Popup.isInPopup(element)) blockSelector = Popup.getPopupSelector(element);\n\n return $.extend(true, {}, { messageSelector: '.common-ajax-loader', selector: blockSelector }, defaultValue || {});\n }\n\n function getUiBlockDescriptor(element: HTMLElement, defaultValue: any = undefined) {\n var result = Utils.getObjectByAttributes('block', element, getUiBlockPropertyName, defaultValue);\n\n return result;\n }\n\n function needBlock(blockUi) { return (typeof (blockUi) === 'object') && blockUi && (Object.keys(blockUi).length > 0); }\n\n return {\n unBlock,\n block,\n getDefaultSpinnerBlock,\n getUiBlockDescriptor,\n needBlock\n }\n}());","declare class Tooltip {\n static errorNode(node: any, message: string, persistent: boolean);\n static successNode(node: any, message: string, persistent: boolean);\n static updateOpenedTooltipText(node: any, message: any);\n}\n\nvar Utils = window.Utils = (function () {\n function getObjectPropertyKey(\n property,\n propertyNameTranslator: (property: string, level: number) => string,\n level: number\n ) {\n let key = property;\n if (propertyNameTranslator) {\n key = propertyNameTranslator(property, level);\n }\n\n return key;\n }\n function getObjectByAttributes(\n prefix,\n element: HTMLElement,\n propertyNameTranslator: (property: string, level: number) => string,\n defaults\n ) {\n const result = $.extend(true, {}, defaults || {});\n for (let i = 0; i < element.attributes.length; i++) {\n const attr = element.attributes[i];\n if (attr.name.indexOf(prefix + '-') == 0) {\n const blockName = attr.name.substr((prefix + '-').length);\n const blockSubNames = blockName.split('-');\n let currentObject = result;\n for (var j = 0; j < blockSubNames.length - 1; j++) {\n var key = getObjectPropertyKey(\n blockSubNames[j],\n propertyNameTranslator,\n j\n );\n if (!currentObject[key]) {\n currentObject[key] = {};\n }\n currentObject = currentObject[key];\n }\n\n var key = getObjectPropertyKey(\n blockSubNames[j],\n propertyNameTranslator,\n j\n );\n let val: any = $(element).attr(attr.name);\n\n if (val === 'false') val = false;\n if (val === 'true') val = true;\n\n const arrayRegex = /^array\\:(.*?)$/g;\n const arrayMatch = arrayRegex.exec(val);\n if (arrayMatch) {\n const array = arrayMatch[1];\n val = eval(array);\n }\n\n currentObject[key] = val;\n }\n }\n\n return result;\n }\n\n function addAttributes(element, attrName, attributes) {\n if (typeof attributes === 'object') {\n for (const key in attributes) {\n const prefix = (attrName + '-' + key).toLowerCase();\n\n addAttributes(element, prefix, attributes[key]);\n }\n } else {\n $(element).attr(attrName, attributes);\n }\n }\n\n function getElementFullType(element) {\n let result = element.tagName.toLowerCase();\n if (result === 'input') {\n result += '-' + $(element).attr('type').toLowerCase();\n }\n return result;\n }\n\n function tryEval(toEval) {\n try {\n return eval('(' + toEval + ')');\n } catch (e) {}\n return toEval;\n }\n\n /**\n * Runs directly a function from its name with/without arguments.\n *\n * @param functionName {String}\n * @param context {Object || null}\n */\n function runFunctionByName(functionName, context, args): any {\n // If using Node.js, the context will be an empty object\n if (typeof window == 'undefined') {\n context = context || {};\n } else {\n // Use the window (from browser) as context if none providen.\n context = context || window;\n }\n\n // Retrieve the namespaces of the function you want to execute\n // e.g Namespaces of \"MyLib.UI.alerti\" would be [\"MyLib\",\"UI\"]\n const namespaces = functionName.split('.');\n\n // Retrieve the real name of the function i.e alerti\n const functionToExecute = namespaces.pop();\n\n // Iterate through every namespace to access the one that has the function\n // you want to execute. For example with the alert fn \"MyLib.UI.SomeSub.alert\"\n // Loop until context will be equal to SomeSub\n for (let i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n\n // If the context really exists (namespaces), return the function or property\n return context[functionToExecute].apply(context, args);\n }\n\n function runFunction(func: string, element: any, data?: any): void {\n if (func != null) {\n if (func.lastIndexOf(';') !== func.length - 1) {\n const args = [element];\n if (data != null) args.splice(1, 0, data);\n Utils.runFunctionByName(func, null, args);\n } else {\n Function(func).apply(element, data);\n }\n }\n }\n\n function showTooltipError(obj: any, data: any, persistent = false) {\n if (data)\n Tooltip.errorNode(\n $(obj),\n typeof data === 'string' ? data : data.error,\n persistent\n );\n }\n\n function showTooltipSuccess(obj: any, data: any, persistent = false) {\n if (data)\n Tooltip.successNode(\n $(obj),\n typeof data === 'string' ? data : data.success,\n persistent\n );\n }\n\n function svgHtml(fileName, className) {\n fileName = fileName || '';\n className = className || '';\n return (\n '<svg class=\"icon ' +\n className +\n '\"><use xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"' +\n (<any>window).globalAppSettings.svg.defaultSprite +\n '#' +\n fileName +\n '\"></use></svg>'\n );\n }\n\n function displayCoefValue(coefValue: number): string {\n const oddsType = window.globalAppSettings.oddsType;\n switch (oddsType) {\n case 'American':\n if (coefValue > 1 && coefValue < 2)\n return '-' + Math.round(100 / (coefValue - 1)).toFixed(0);\n if (coefValue === 2) return 'Even';\n if (coefValue > 2)\n return '+' + Math.round(100 * (coefValue - 1)).toFixed(0);\n return '-';\n case 'British':\n const numerator = Math.round(100 * (coefValue - 1));\n const denominator = 100;\n const hcf = gcd(numerator, denominator);\n return (\n Math.floor(numerator / hcf) +\n '/' +\n Math.floor(denominator / hcf)\n );\n case 'HongKong':\n return (coefValue - 1).toFixed(2);\n case 'Indonesian':\n if (coefValue > 1 && coefValue < 2)\n return '-' + Math.round(1 / (coefValue - 1)).toFixed(2);\n if (coefValue === 2) return 'Even';\n if (coefValue > 2)\n return '+' + Math.round(coefValue - 1).toFixed(2);\n return '-';\n case 'Malaysian':\n if (coefValue > 1 && coefValue < 2)\n return '+' + Math.round(1 / (coefValue - 1)).toFixed(2);\n if (coefValue === 2) return 'Even';\n if (coefValue > 2)\n return '-' + Math.round(coefValue - 1).toFixed(2);\n return '-';\n case 'European':\n default:\n return coefValue.toFixed(2);\n }\n }\n\n /**\n * Finds the greatest common divisor using binary GCD algorithm.\n * @param a First number\n * @param b Second number\n * @returns GCD of a and b.\n */\n function gcd(a: number, b: number): number {\n /* GCD(0, b) == b; GCD(a, 0) == a,\n GCD(0, 0) == 0 */\n if (a == 0) return b;\n if (b == 0) return a;\n\n /*Finding K, where K is the\n greatest power of 2\n that divides both a and b. */\n let k: number;\n for (k = 0; ((a | b) & 1) == 0; ++k) {\n a >>= 1;\n b >>= 1;\n }\n\n /* Dividing a by 2 until a becomes odd */\n while ((a & 1) == 0) a >>= 1;\n\n /* From here on, 'a' is always odd. */\n do {\n /* If b is even, remove all factor of 2 in b */\n while ((b & 1) == 0) b >>= 1;\n\n /* Now a and b are both odd.\n Swap if necessary so a <= b,\n then set b = b - a (which is even).*/\n if (a > b) {\n const t = a;\n a = b;\n b = t;\n }\n\n b = b - a;\n } while (b != 0);\n\n /* restore common factors of 2 */\n return a << k;\n }\n\n return {\n getObjectByAttributes,\n addAttributes,\n getElementFullType,\n tryEval,\n runFunctionByName,\n runFunction,\n showTooltipError,\n showTooltipSuccess,\n svgHtml,\n displayCoefValue,\n };\n}());\n","var Validators = window.Validators = (function() {\n function init() {\n registerRequiredIfValidator();\n registerRequiredBooleanValidator();\n registerIgnoreCaseComaprer();\n registerMaxDateValidator();\n registerMinDateValidator();\n registerMinValueValidator();\n registerMaxValueValidator();\n registerCreditCardValidator();\n registerDocTypeDependentNumberValidator();\n registerCheckMatchingValidator();\n registerConferenceIdentityIfValidator();\n customiseUnobtrusiveValidators();\n registerInnCheckSumValidator();\n registerSnilsCheckSumValidator();\n }\n\n function parse(element: any) {\n var jq: any = $;\n if (jq.validator && jq.validator.unobtrusive) {\n jq.validator.unobtrusive.parse(element);\n }\n }\n\n function creditCardLuhnCheck(val) {\n var sum = 0;\n for (var i = 0; i < val.length; i++) {\n var intVal = parseInt(val.substr(i, 1));\n if (i % 2 == 0) {\n intVal *= 2;\n if (intVal > 9) {\n intVal = 1 + (intVal % 10);\n }\n }\n sum += intVal;\n }\n return (sum % 10) == 0;\n }\n\n function registerCreditCardValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('creditcard',\n options => {\n });\n\n jq.validator.addMethod('creditcard',\n (value, element, parameters) => {\n value = value.replace(/[\\s-_]/gm, '');\n\n return creditCardLuhnCheck(value);\n });\n }\n\n function tryParseDatepickerDate(element, value) {\n if ($.datepicker && $(element).attr('datepicker-dateformat')) {\n var format = $(element).attr('datepicker-dateformat');\n var dt = null;\n try {\n dt = $.datepicker.parseDate(format, value);\n\n if (!/Invalid|NaN/.test(dt.toString())) {\n return { date: dt, valid: true };\n }\n } catch (e) {\n }\n\n return { valid: false };\n }\n }\n\n function isDate(element, value) {\n return tryParseDatepickerDate(element, value).valid;\n }\n\n function registerMinValueValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('minvalue',\n ['min'],\n options => {\n options.rules['min'] = options.params;\n options.messages['min'] = options.message;\n });\n\n jq.validator.addMethod('min',\n (value, element, parameters) => {\n if ($.isNumeric(value)) {\n try {\n var val = parseFloat(value);\n var min = parseFloat(parameters.min);\n\n return val >= min;\n } catch (err) {\n }\n\n return false;\n } else if (isDate(element, value)) {\n var date = tryParseDatepickerDate(element, value).date;\n var minDate = tryParseDatepickerDate(element, parameters).date;\n\n return date >= minDate;\n }\n });\n }\n\n function registerMaxValueValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('maxvalue',\n ['max'],\n options => {\n options.rules['max'] = options.params;\n options.messages['max'] = options.message;\n });\n\n jq.validator.addMethod('max',\n (value, element, parameters) => {\n if ($.isNumeric(value)) {\n try {\n var val = parseFloat(value);\n var max = parseFloat(parameters.max);\n\n return val <= max;\n } catch (err) {\n }\n\n return false;\n } else if (isDate(element, value)) {\n var date = tryParseDatepickerDate(element, value).date;\n var minDate = tryParseDatepickerDate(element, parameters).date;\n\n return date <= minDate;\n }\n });\n }\n\n function registerRequiredBooleanValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('requiredbool',\n ['value'],\n options => {\n options.rules['requiredbool'] = options.params;\n options.messages['requiredbool'] = options.message;\n });\n\n jq.validator.addMethod('requiredbool',\n (value, element, parameters) => {\n var expectedValue: any = parameters.value.toString().toLowerCase();\n var val: any = null;\n if (element.type == 'checkbox') {\n val = $(element).is(':checked');\n } else {\n val = $(element).val();\n }\n\n val = val.toString().toLowerCase();\n\n return val == expectedValue;\n });\n }\n\n function registerDocTypeDependentNumberValidator() {\n var jq: any = $;\n\n jq.validator.unobtrusive.adapters.add('doctypedependency',\n ['dependentproperty', 'mainproperty'],\n options => {\n options.rules['doctypedependency'] = options.params;\n options.messages['doctypedependency'] = options.message;\n var dependentProperty: any = $('#' + options.params.dependentproperty);\n dependentProperty.change(function () {\n var validator = jq(options.form).validate();\n validator.element(options.element);\n });\n });\n\n jq.validator.addMethod('doctypedependency',\n function (value, element, parameters) {\n var selectedType = $('#DocType').val();\n\n var toCheck = value.replace(/ /g, \"\");\n\n if (selectedType == 'RussianPassport' && $('#ShouldEnterPersonalData').val() == 'True') {\n if (parameters.mainproperty == 'DocumentSeries' || parameters.mainproperty == 'DocSeries')\n return toCheck.match(/^\\d{4}$/);\n else\n return toCheck.match(/^\\d{6}$/);\n }\n\n return true;\n });\n }\n\n function registerRequiredIfValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('requiredif',\n ['dependsonproperties', 'dependsonvalues', 'requiredvalue'],\n options => {\n options.rules['requiredif'] = options.params;\n options.messages['requiredif'] = options.message;\n\n var dependsOnProperties = JSON.parse(options.params.dependsonproperties)\n if (dependsOnProperties) {\n for (var i = 0; i < dependsOnProperties.length; i++) {\n var dependesOnProperty: any = $('#' + dependsOnProperties[i]);\n dependesOnProperty.change(function () {\n var validator = jq(options.form).validate();\n validator.element(options.element);\n });\n }\n }\n });\n\n jq.validator.addMethod('requiredif',\n function (value, element, parameters) {\n let dependsOnProperties = JSON.parse(parameters.dependsonproperties)\n let shouldValidate = true;\n if (dependsOnProperties?.length) {\n var dependsOnValues = JSON.parse(parameters.dependsonvalues);\n if (dependsOnValues?.length) {\n dependsOnValues = dependsOnValues.map((val) => { return val == null ? '' : val.toString().trim().toLowerCase() });\n for (let i = 0; i < dependsOnProperties.length; i++) {\n let controlType = $(\"input[id$='\" + dependsOnProperties[i] + \"']\").attr(\"type\");\n let actualValue = null;\n\n if (controlType == \"checkbox\" || controlType == \"radio\") {\n let control = $(\"input[id$='\" + dependsOnProperties[i] + \"']:checked\");\n actualValue = control.val();\n } else {\n actualValue = $(\"#\" + dependsOnProperties[i]).val();\n }\n actualValue = $.trim(actualValue).toLocaleLowerCase()\n\n let dependentValueMatches = false;\n for (let vInd = 0; vInd < dependsOnValues.length; vInd++) {\n if (dependsOnValues[vInd] === actualValue) {\n dependentValueMatches = true;\n break;\n }\n }\n if (!dependentValueMatches) {\n shouldValidate = false;\n break;\n }\n }\n }\n }\n\n if(shouldValidate)\n return parameters.requiredvalue == ''\n ? jq.validator.methods.required.call(this, value, element, parameters)\n : value == parameters.requiredvalue;\n\n return true;\n });\n }\n\n function registerCheckMatchingValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('checkmatching', ['validationattributename', 'userinputattributename'],\n options => {\n options.rules['checkmatching'] = options.params;\n options.messages['checkmatching'] = options.message;\n var validationattributename: any = jq('[name^=' + options.params.validationattributename + ']');\n validationattributename.bind('input', function () {\n var validator = jq(options.form).validate();\n validator.element(options.element);\n });\n });\n\n jq.validator.addMethod('checkmatching',\n function (value, element, parameters) {\n if (value) {\n var allBets = jq('[name$=' + parameters.validationattributename + ']');\n if (allBets && allBets.length > 1) {\n var otherBets = allBets.filter(function (idx, elm) {\n return elm.id != element.id;\n });\n jq('#' + element.id + '+[name$=' + parameters.userinputattributename + ']').val(otherBets.map(function () {\n return jq(this).val();\n }).toArray().join('|'));\n\n return !otherBets.filter(function (idx, elm) {\n return jq(elm).val() == value;\n }).length;\n }\n }\n\n return true;\n });\n }\n\n function registerConferenceIdentityIfValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('conferenceidentityif',\n ['dependentproperty', 'regexppattern', 'maxlengthskypelogin', 'maxlengtherrormessage', 'phonepatternerrormessage'],\n options => {\n options.rules['conferenceidentityif'] = options.params;\n var dependentProperty: any = $('[name$=' + options.params.dependentproperty + ']');\n dependentProperty.change(function () {\n var validator = jq(options.form).validate();\n validator.element(options.element);\n });\n });\n\n jq.validator.addMethod('conferenceidentityif',\n function (value, element, parameters) {\n var conferenceType = $('[name$=' + parameters.dependentproperty + ']').val();\n switch (conferenceType) {\n case \"Viber\":\n case \"Whatsapp\":\n jq.validator.messages['conferenceidentityif'] = parameters.phonepatternerrormessage;\n return !!jq.validator.methods.regex.call(this, value, element, new RegExp(parameters.regexppattern));\n case \"Skype\":\n jq.validator.messages['conferenceidentityif'] = parameters.maxlengtherrormessage;\n return jq.validator.methods.maxlength.call(this, value, element, parameters.maxlengthskypelogin);\n }\n return false;\n });\n }\n\n function registerIgnoreCaseComaprer() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('ignorecasecompare',\n ['dependentproperty'],\n options => {\n options.rules['ignorecasecompare'] = options.params;\n options.messages['ignorecasecompare'] = options.message;\n\n\n var dependentProperty: any = $('#' + options.params.dependentproperty);\n dependentProperty.change(function () {\n var validator = jq(options.form).validate();\n validator.element(options.element);\n });\n });\n\n\n jq.validator.addMethod('ignorecasecompare',\n (value, element, parameters) => {\n var dependent = $(\"input[id$='\" + parameters.dependentproperty + \"']\");\n return (dependent.val().toUpperCase() === value.toUpperCase())\n });\n }\n\n function registerMaxDateValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('maxdate',\n ['relativeyears', 'isnullvalid'],\n options => {\n options.rules['maxdate'] = options.params;\n options.messages['maxdate'] = options.message;\n });\n\n jq.validator.addMethod('maxdate',\n (value, element, parameters) => {\n\n var isNullValid = parameters.isnullvalid;\n\n if (value == '' && isNullValid) return true;\n\n var d = tryParseDatepickerDate(element, value);\n if (d.valid) {\n var actualDate = new Date();\n var targetDate = new Date(actualDate.getFullYear() + parseInt(parameters.relativeyears),\n actualDate.getMonth(),\n actualDate.getDate());\n\n\n return d.date <= targetDate;\n }\n\n return false;\n });\n }\n\n function registerMinDateValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('mindate',\n ['relativeyears', 'isnullvalid'],\n options => {\n options.rules['mindate'] = options.params;\n options.messages['mindate'] = options.message;\n });\n\n jq.validator.addMethod('mindate',\n (value, element, parameters) => {\n\n var isNullValid = parameters.isnullvalid;\n\n if (value == '' && isNullValid) return true;\n\n var d = tryParseDatepickerDate(element, value);\n if (d.valid) {\n var actualDate = new Date();\n var targetDate = new Date(actualDate.getFullYear() + parseInt(parameters.relativeyears),\n actualDate.getMonth(),\n actualDate.getDate());\n\n return d.date >= targetDate;\n }\n\n return false;\n });\n }\n\n function validateDate(value, element) {\n if ($.datepicker && $(element).attr('datepicker-dateformat')) {\n var format = $(element).attr('datepicker-dateformat');\n var dateValid = false;\n var dt = null;\n try {\n dt = $.datepicker.parseDate(format, value);\n dateValid = true;\n } catch (e) {\n }\n\n return this.optional(element) || (dateValid && !/Invalid|NaN/.test(dt.toString()));\n }\n if ((<any>$).timepicker && $.datepicker) {\n var timeFormat = 'HH:mm:ss',\n dateFormat = 'dd.mm.yy',\n dateValid = false,\n dt = null;\n try {\n dt = (<any>$.datepicker).parseDateTime(dateFormat, timeFormat, value);\n dateValid = true;\n } catch (e) {\n }\n\n return this.optional(element) || (dateValid && !/Invalid|NaN/.test(dt.toString()));\n }\n return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());\n }\n\n function customiseUnobtrusiveValidators() {\n var jq: any = $;\n jq.validator.prototype.customDataMessage = function (element, method) {\n var dataUpperCasedName = \"msg\" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase();\n var dataLowerCasedName = \"msg\" + method.toLowerCase();\n\n return $(element).data(dataUpperCasedName) || $(element).data(dataLowerCasedName) || $(element).data(\"msg\");\n };\n\n if (jq.validator) {\n jq.validator.methods.date = validateDate;\n jq.validator.setDefaults(\n {\n ignore: null,\n }\n );\n }\n }\n\n function registerInnCheckSumValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('innchecksum',\n options => {\n options.rules['innchecksum'] = options.params;\n options.messages['innchecksum'] = options.message;\n });\n\n jq.validator.addMethod('innchecksum',\n (value, element, parameters) => {\n if (value) {\n const coefsFor11 = [7, 2, 4, 10, 3, 5, 9, 4, 6, 8];\n const coefsFor12 = [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8];\n let dgt11: number;\n let dgt12: number;\n\n try {\n dgt11 = getCheckNumber(value, coefsFor11);\n dgt12 = getCheckNumber(value, coefsFor12);\n } catch (e) {\n return false;\n }\n return parseInt(value[10]) == dgt11 && parseInt(value[11]) == dgt12;\n }\n return true;\n });\n }\n\n function getCheckNumber(innString, checkSumCoefs) {\n let checkNumber = 0;\n for (var i = 0; i < checkSumCoefs.length; i++) {\n checkNumber += parseInt(innString[i]) * checkSumCoefs[i];\n }\n\n return (checkNumber % 11) % 10;\n }\n\n\n\n function registerSnilsCheckSumValidator() {\n var jq: any = $;\n jq.validator.unobtrusive.adapters.add('snilschecksum',\n options => {\n options.rules['snilschecksum'] = options.params;\n options.messages['snilschecksum'] = options.message;\n\n });\n\n jq.validator.addMethod('snilschecksum',\n (value, element, parameters) => {\n if (value) {\n let numbersOnly = value.toString().replace(/\\D/g, '');\n if (numbersOnly.length != 11)\n return false;\n\n if (parseInt(numbersOnly.substring(0, 9)) <= 1001998)\n return true;\n\n let checkSum = parseInt(numbersOnly.substring(9));\n let sum = 0;\n for (let i = 1; i < 10; i++)\n sum += i * parseInt(numbersOnly[9 - i]);\n\n if (sum > 101)\n sum %= 101;\n\n return sum < 100 ? sum == checkSum : sum == 0;\n }\n return true;\n });\n }\n\n return {\n init,\n parse\n }\n}());","declare var HistoryUpdatePool: any;\n//declare var signalR: any;\nimport * as signalR from \"@microsoft/signalr\"; //not build\n\nwindow.SignalR = (function () {\n var connection: any;//signalR.HubConnection; //not build\n var config: ISignalRConfig;\n\n function start(conf: ISignalRConfig) {\n config = conf;\n connection = new signalR.HubConnectionBuilder()\n .withUrl(\"/account\", {\n transport: signalR.HttpTransportType.WebSockets,\n })\n .withAutomaticReconnect()\n .build();\n connection.onreconnecting(() => {\n join();\n });\n subscribe();\n connection.start().then(() => {\n if (connection.state.toString() === \"Connected\")\n join();\n });\n }\n\n function join() {\n if (config.isAuthenticated) {\n connection.send(\"join\", config.accountToken);\n }\n }\n\n function subscribe() {\n connection.on('RefreshToken', () => {\n var queryTokenUrl = '/api/signalr/account/refreshtoken?rnd=' + Math.random();\n $.get(queryTokenUrl, token => {\n config.accountToken = token;\n join();\n });\n\n });\n\n connection.on('AccountLogout', msg => {\n var logoutEvent = new CustomEvent('accountLogout');\n window.dispatchEvent(logoutEvent);\n window.location.reload();\n });\n\n connection.on('LogoutAll', msg => {\n var logoutEvent = new CustomEvent('accountLogout');\n window.dispatchEvent(logoutEvent);\n window.location.reload();\n });\n\n connection.on('NotifyPackageBetResult', BettingCart.notification.NotifyPackageBetResult);\n\n var isHistory = () => $('#page-content').attr('data-page') === 'history';\n connection.on('AccountBalanceChanged', (accountId, amount: number, bonusValue: number, betBalance: number) => {\n var notificationBalanceUpdateEvent = new CustomEvent<{\n balanceVal: number;\n bonusPoints: number;\n }>('notificationBalanceUpdate', {\n detail: {\n balanceVal: amount,\n bonusPoints: bonusValue,\n },\n });\n\n window.dispatchEvent(notificationBalanceUpdateEvent);\n\n if (isHistory()) {\n HistoryUpdatePool.add();\n }\n });\n\n connection.on('AccountBetBalanceChanged', (accountId: number, betBalance: number) => {\n var notificationBetBalanceUpdateEvent = new CustomEvent<{\n betBalance: number;\n }>('notificationBetBalanceUpdate', {\n detail: {\n betBalance\n },\n });\n\n window.dispatchEvent(notificationBetBalanceUpdateEvent);\n });\n\n connection.on('UnviewedBetsChanged', (accountId, unviewedBetCount: number) => {\n const selectors = {\n mnHistCount: '#mn-hist_count',\n };\n if (isHistory()) {\n HistoryUpdatePool.add();\n }\n else {\n (unviewedBetCount > 0) ? $(selectors.mnHistCount).text(unviewedBetCount).addClass('active') : $(selectors.mnHistCount).removeClass('active');\n }\n });\n }\n\n return {\n start\n }\n}());","export class SignalRConfigBuilder {\n defaultConfig: ISignalRConfig = {\n accountToken: 'None',\n isAuthenticated: false\n };\n config: ISignalRConfig;\n\n constructor() {\n this.config = this.defaultConfig;\n }\n\n build(): ISignalRConfig {\n return this.config;\n }\n\n withToken(token: string): SignalRConfigBuilder {\n this.config.accountToken = token;\n return this;\n }\n\n withAuth(auth: boolean): SignalRConfigBuilder {\n this.config.isAuthenticated = auth;\n return this;\n }\n}\n\nwindow.SignalRConfigBuilder = SignalRConfigBuilder;","window.Sports = (function () {\n const actions = {\n handlers: {\n addSportHandler: function (\n control: any,\n maxCount: number,\n svgNumber: number,\n scope: any\n ) {\n let selectedCount = parseInt(\n $('span.selected-sports-counter', scope).text()\n );\n\n if (selectedCount < maxCount) {\n const data = $(control).data('value');\n\n const stringData = $(control).data('stringvalue');\n\n $('.icon-sport-' + svgNumber, scope).remove();\n\n $('ul.selected-sports__list', scope).append(\n '<li class=\"selected-sports__list-item\"></li>'\n );\n $('ul.selected-sports__list li:last-child', scope).append(\n '<div class=\"selected-sports__drag-icon-wrapper\"><div class= \"selected-sports__drag-icon\"></div></div>'\n );\n $('ul.selected-sports__list li:last-child', scope).append(\n '<div class=\"selected-sports__item-icon\">' +\n app.svgSports(\n svgNumber,\n 'selected-sports__item-icon'\n ) +\n '</div>'\n );\n $('ul.selected-sports__list li:last-child', scope).append(\n '<input type=\"hidden\" name=\"selectedTypes\" value=\"' +\n data +\n '\" />'\n );\n $('ul.selected-sports__list li:last-child', scope).append(\n stringData\n );\n $('ul.selected-sports__list li:last-child', scope).append(\n '<div class=\"settings-bin__sports-wrapper\"></div>'\n );\n $(\n 'ul.selected-sports__list li:last-child > div.settings-bin__sports-wrapper',\n scope\n ).append(\n '<a data-value=\"' +\n data +\n '\"data-stringValue=\"' +\n stringData +\n '\" onclick=\"Sports.actions.handlers.removeSportHandler(this,' +\n maxCount +\n ',' +\n svgNumber +\n \", '\" +\n scope +\n \"'\" +\n ');\">' +\n Utils.svgHtml('bin', 'settings-bin__sports-icon') +\n '</a>'\n );\n\n $(control).closest('li').remove();\n $(control).remove();\n\n selectedCount += 1;\n\n $('span.selected-sports-counter', scope).html(\n selectedCount.toString()\n );\n }\n },\n removeSportHandler: function (\n control: any,\n maxCount: number,\n svgNumber: number,\n scope: any\n ) {\n let selectedCount = parseInt(\n $('span.selected-sports-counter', scope).text()\n );\n\n const data = $(control).data('value');\n\n const stringData = $(control).data('stringvalue');\n\n $('.icon-sport-' + svgNumber, scope).remove();\n\n $('ul.available-sports__list', scope).append(\n '<li class=\"available-sports__list-item\"></li>'\n );\n $('ul.available-sports__list li:last-child', scope).append(\n '<div class=\"available-sports__item-icon\"></div>'\n );\n $(\n 'ul.available-sports__list li:last-child > div.available-sports__item-icon',\n scope\n ).append(\n app.svgSports(\n svgNumber,\n 'settings-sort__sports-icon m-contrast',\n scope\n )\n );\n $('ul.available-sports__list li:last-child', scope).append(\n '<a onclick=\"Sports.actions.handlers.addSportHandler(this,' +\n maxCount +\n ',' +\n svgNumber +\n \", '\" +\n scope +\n \"'\" +\n ');\" data-stringValue=\"' +\n stringData +\n '\" data-value=\"' +\n data +\n '\" >' +\n stringData +\n '</a>'\n );\n\n const listItems = $('ul.available-sports__list > li', scope);\n\n const s = $(listItems)\n .detach()\n .sort(function (a, b) {\n const contentA = $(a).children('a').text();\n const contentB = $(b).children('a').text();\n\n return contentA < contentB\n ? -1\n : contentA > contentB\n ? 1\n : 0;\n });\n\n s.each(function (index, row) {\n $('ul.available-sports__list', scope).append(row);\n });\n\n $(control).closest('li').remove();\n $(control).remove();\n\n selectedCount -= 1;\n\n $('span.selected-sports-counter', scope).html(\n selectedCount.toString()\n );\n },\n },\n };\n\n return {\n actions,\n };\n})();\n","module.exports = jQuery;","/*!\n * jQuery blockUI plugin\n * Version 2.70.0-2014.11.23\n * Requires jQuery v1.7 or later\n *\n * Examples at: http://malsup.com/jquery/block/\n * Copyright (c) 2007-2013 M. Alsup\n * Dual licensed under the MIT and GPL licenses:\n * http://www.opensource.org/licenses/mit-license.php\n * http://www.gnu.org/licenses/gpl.html\n *\n * Thanks to Amir-Hossein Sobhi for some excellent contributions!\n */\n\n;(function() {\n/*jshint eqeqeq:false curly:false latedef:false */\n\"use strict\";\n\n\tfunction setup($) {\n\t\t$.fn._fadeIn = $.fn.fadeIn;\n\n\t\tvar noOp = $.noop || function() {};\n\n\t\t// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle\n\t\t// confusing userAgent strings on Vista)\n\t\tvar msie = /MSIE/.test(navigator.userAgent);\n\t\tvar ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);\n\t\tvar mode = document.documentMode || 0;\n\t\tvar setExpr = $.isFunction( document.createElement('div').style.setExpression );\n\n\t\t// global $ methods for blocking/unblocking the entire page\n\t\t$.blockUI = function(opts) { install(window, opts); };\n\t\t$.unblockUI = function(opts) { remove(window, opts); };\n\n\t\t// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)\n\t\t$.growlUI = function(title, message, timeout, onClose) {\n\t\t\tvar $m = $('<div class=\"growlUI\"></div>');\n\t\t\tif (title) $m.append('<h1>'+title+'</h1>');\n\t\t\tif (message) $m.append('<h2>'+message+'</h2>');\n\t\t\tif (timeout === undefined) timeout = 3000;\n\n\t\t\t// Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications\n\t\t\tvar callBlock = function(opts) {\n\t\t\t\topts = opts || {};\n\n\t\t\t\t$.blockUI({\n\t\t\t\t\tmessage: $m,\n\t\t\t\t\tfadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,\n\t\t\t\t\tfadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,\n\t\t\t\t\ttimeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,\n\t\t\t\t\tcenterY: false,\n\t\t\t\t\tshowOverlay: false,\n\t\t\t\t\tonUnblock: onClose,\n\t\t\t\t\tcss: $.blockUI.defaults.growlCSS\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tcallBlock();\n\t\t\tvar nonmousedOpacity = $m.css('opacity');\n\t\t\t$m.mouseover(function() {\n\t\t\t\tcallBlock({\n\t\t\t\t\tfadeIn: 0,\n\t\t\t\t\ttimeout: 30000\n\t\t\t\t});\n\n\t\t\t\tvar displayBlock = $('.blockMsg');\n\t\t\t\tdisplayBlock.stop(); // cancel fadeout if it has started\n\t\t\t\tdisplayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency\n\t\t\t}).mouseout(function() {\n\t\t\t\t$('.blockMsg').fadeOut(1000);\n\t\t\t});\n\t\t\t// End konapun additions\n\t\t};\n\n\t\t// plugin method for blocking element content\n\t\t$.fn.block = function(opts) {\n\t\t\tif ( this[0] === window ) {\n\t\t\t\t$.blockUI( opts );\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tvar fullOpts = $.extend({}, $.blockUI.defaults, opts || {});\n\t\t\tthis.each(function() {\n\t\t\t\tvar $el = $(this);\n\t\t\t\tif (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))\n\t\t\t\t\treturn;\n\t\t\t\t$el.unblock({ fadeOut: 0 });\n\t\t\t});\n\n\t\t\treturn this.each(function() {\n\t\t\t\tif ($.css(this,'position') == 'static') {\n\t\t\t\t\tthis.style.position = 'relative';\n\t\t\t\t\t$(this).data('blockUI.static', true);\n\t\t\t\t}\n\t\t\t\tthis.style.zoom = 1; // force 'hasLayout' in ie\n\t\t\t\tinstall(this, opts);\n\t\t\t});\n\t\t};\n\n\t\t// plugin method for unblocking element content\n\t\t$.fn.unblock = function(opts) {\n\t\t\tif ( this[0] === window ) {\n\t\t\t\t$.unblockUI( opts );\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\treturn this.each(function() {\n\t\t\t\tremove(this, opts);\n\t\t\t});\n\t\t};\n\n\t\t$.blockUI.version = 2.70; // 2nd generation blocking at no extra cost!\n\n\t\t// override these in your code to change the default behavior and style\n\t\t$.blockUI.defaults = {\n\t\t\t// message displayed when blocking (use null for no message)\n\t\t\tmessage: '<h1>Please wait...</h1>',\n\n\t\t\ttitle: null,\t\t// title string; only used when theme == true\n\t\t\tdraggable: true,\t// only used when theme == true (requires jquery-ui.js to be loaded)\n\n\t\t\ttheme: false, // set to true to use with jQuery UI themes\n\n\t\t\t// styles for the message when blocking; if you wish to disable\n\t\t\t// these and use an external stylesheet then do this in your code:\n\t\t\t// $.blockUI.defaults.css = {};\n\t\t\tcss: {\n\t\t\t\tpadding:\t0,\n\t\t\t\tmargin:\t\t0,\n\t\t\t\twidth:\t\t'30%',\n\t\t\t\ttop:\t\t'40%',\n\t\t\t\tleft:\t\t'35%',\n\t\t\t\ttextAlign:\t'center',\n\t\t\t\tcolor:\t\t'#000',\n\t\t\t\tborder:\t\t'3px solid #aaa',\n\t\t\t\tbackgroundColor:'#fff',\n\t\t\t\tcursor:\t\t'wait'\n\t\t\t},\n\n\t\t\t// minimal style set used when themes are used\n\t\t\tthemedCSS: {\n\t\t\t\twidth:\t'30%',\n\t\t\t\ttop:\t'40%',\n\t\t\t\tleft:\t'35%'\n\t\t\t},\n\n\t\t\t// styles for the overlay\n\t\t\toverlayCSS: {\n\t\t\t\tbackgroundColor:\t'#000',\n\t\t\t\topacity:\t\t\t0.85,\n\t\t\t\tcursor: 'wait',\n\t\t\t\t'-webkit-border-radius': '10px',\n\t\t\t\t'-moz-border-radius': '10px',\n\t\t\t\t'border-radius': '10px'\n\t\t\t},\n\n\t\t\t// style to replace wait cursor before unblocking to correct issue\n\t\t\t// of lingering wait cursor\n\t\t\tcursorReset: 'default',\n\n\t\t\t// styles applied when using $.growlUI\n\t\t\tgrowlCSS: {\n\t\t\t\twidth:\t\t'350px',\n\t\t\t\ttop:\t\t'10px',\n\t\t\t\tleft:\t\t'',\n\t\t\t\tright:\t\t'10px',\n\t\t\t\tborder:\t\t'none',\n\t\t\t\tpadding:\t'5px',\n\t\t\t\topacity:\t0.6,\n\t\t\t\tcursor:\t\t'default',\n\t\t\t\tcolor:\t\t'#fff',\n\t\t\t\tbackgroundColor: '#000',\n\t\t\t\t'-webkit-border-radius':'10px',\n\t\t\t\t'-moz-border-radius':\t'10px',\n\t\t\t\t'border-radius':\t\t'10px'\n\t\t\t},\n\n\t\t\t// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w\n\t\t\t// (hat tip to Jorge H. N. de Vasconcelos)\n\t\t\t/*jshint scripturl:true */\n\t\t\tiframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',\n\n\t\t\t// force usage of iframe in non-IE browsers (handy for blocking applets)\n\t\t\tforceIframe: false,\n\n\t\t\t// z-index for the blocking overlay\n\t\t\tbaseZ: 1000,\n\n\t\t\t// set these to true to have the message automatically centered\n\t\t\tcenterX: true, // <-- only effects element blocking (page block controlled via css above)\n\t\t\tcenterY: true,\n\n\t\t\t// allow body element to be stetched in ie6; this makes blocking look better\n\t\t\t// on \"short\" pages. disable if you wish to prevent changes to the body height\n\t\t\tallowBodyStretch: true,\n\n\t\t\t// enable if you want key and mouse events to be disabled for content that is blocked\n\t\t\tbindEvents: true,\n\n\t\t\t// be default blockUI will supress tab navigation from leaving blocking content\n\t\t\t// (if bindEvents is true)\n\t\t\tconstrainTabKey: true,\n\n\t\t\t// fadeIn time in millis; set to 0 to disable fadeIn on block\n\t\t\tfadeIn: 200,\n\n\t\t\t// fadeOut time in millis; set to 0 to disable fadeOut on unblock\n\t\t\tfadeOut: 400,\n\n\t\t\t// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock\n\t\t\ttimeout: 0,\n\n\t\t\t// disable if you don't want to show the overlay\n\t\t\tshowOverlay: true,\n\n\t\t\t// if true, focus will be placed in the first available input field when\n\t\t\t// page blocking\n\t\t\tfocusInput: true,\n\n // elements that can receive focus\n focusableElements: ':input:enabled:visible',\n\n\t\t\t// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)\n\t\t\t// no longer needed in 2012\n\t\t\t// applyPlatformOpacityRules: true,\n\n\t\t\t// callback method invoked when fadeIn has completed and blocking message is visible\n\t\t\tonBlock: null,\n\n\t\t\t// callback method invoked when unblocking has completed; the callback is\n\t\t\t// passed the element that has been unblocked (which is the window object for page\n\t\t\t// blocks) and the options that were passed to the unblock call:\n\t\t\t//\tonUnblock(element, options)\n\t\t\tonUnblock: null,\n\n\t\t\t// callback method invoked when the overlay area is clicked.\n\t\t\t// setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.\n\t\t\tonOverlayClick: null,\n\n\t\t\t// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493\n\t\t\tquirksmodeOffsetHack: 4,\n\n\t\t\t// class name of the message block\n\t\t\tblockMsgClass: 'blockMsg',\n\n\t\t\t// if it is already blocked, then ignore it (don't unblock and reblock)\n\t\t\tignoreIfBlocked: false\n\t\t};\n\n\t\t// private data and functions follow...\n\n\t\tvar pageBlock = null;\n\t\tvar pageBlockEls = [];\n\n\t\tfunction install(el, opts) {\n\t\t\tvar css, themedCSS;\n\t\t\tvar full = (el == window);\n\t\t\tvar msg = (opts && opts.message !== undefined ? opts.message : undefined);\n\t\t\topts = $.extend({}, $.blockUI.defaults, opts || {});\n\n\t\t\tif (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))\n\t\t\t\treturn;\n\n\t\t\topts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});\n\t\t\tcss = $.extend({}, $.blockUI.defaults.css, opts.css || {});\n\t\t\tif (opts.onOverlayClick)\n\t\t\t\topts.overlayCSS.cursor = 'pointer';\n\n\t\t\tthemedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});\n\t\t\tmsg = msg === undefined ? opts.message : msg;\n\n\t\t\t// remove the current block (if there is one)\n\t\t\tif (full && pageBlock)\n\t\t\t\tremove(window, {fadeOut:0});\n\n\t\t\t// if an existing element is being used as the blocking content then we capture\n\t\t\t// its current place in the DOM (and current display style) so we can restore\n\t\t\t// it when we unblock\n\t\t\tif (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {\n\t\t\t\tvar node = msg.jquery ? msg[0] : msg;\n\t\t\t\tvar data = {};\n\t\t\t\t$(el).data('blockUI.history', data);\n\t\t\t\tdata.el = node;\n\t\t\t\tdata.parent = node.parentNode;\n\t\t\t\tdata.display = node.style.display;\n\t\t\t\tdata.position = node.style.position;\n\t\t\t\tif (data.parent)\n\t\t\t\t\tdata.parent.removeChild(node);\n\t\t\t}\n\n\t\t\t$(el).data('blockUI.onUnblock', opts.onUnblock);\n\t\t\tvar z = opts.baseZ;\n\n\t\t\t// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;\n\t\t\t// layer1 is the iframe layer which is used to supress bleed through of underlying content\n\t\t\t// layer2 is the overlay layer which has opacity and a wait cursor (by default)\n\t\t\t// layer3 is the message content that is displayed while blocking\n\t\t\tvar lyr1, lyr2, lyr3, s;\n\t\t\tif (msie || opts.forceIframe)\n\t\t\t\tlyr1 = $('<iframe class=\"blockUI\" style=\"z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0\" src=\"'+opts.iframeSrc+'\"></iframe>');\n\t\t\telse\n\t\t\t\tlyr1 = $('<div class=\"blockUI\" style=\"display:none\"></div>');\n\n\t\t\tif (opts.theme)\n\t\t\t\tlyr2 = $('<div class=\"blockUI blockOverlay ui-widget-overlay\" style=\"z-index:'+ (z++) +';display:none\"></div>');\n\t\t\telse\n\t\t\t\tlyr2 = $('<div class=\"blockUI blockOverlay\" style=\"z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0\"></div>');\n\n\t\t\tif (opts.theme && full) {\n\t\t\t\ts = '<div class=\"blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all\" style=\"z-index:'+(z+10)+';display:none;position:fixed\">';\n\t\t\t\tif ( opts.title ) {\n\t\t\t\t\ts += '<div class=\"ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle\">'+(opts.title || ' ')+'</div>';\n\t\t\t\t}\n\t\t\t\ts += '<div class=\"ui-widget-content ui-dialog-content\"></div>';\n\t\t\t\ts += '</div>';\n\t\t\t}\n\t\t\telse if (opts.theme) {\n\t\t\t\ts = '<div class=\"blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all\" style=\"z-index:'+(z+10)+';display:none;position:absolute\">';\n\t\t\t\tif ( opts.title ) {\n\t\t\t\t\ts += '<div class=\"ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle\">'+(opts.title || ' ')+'</div>';\n\t\t\t\t}\n\t\t\t\ts += '<div class=\"ui-widget-content ui-dialog-content\"></div>';\n\t\t\t\ts += '</div>';\n\t\t\t}\n\t\t\telse if (full) {\n\t\t\t\ts = '<div class=\"blockUI ' + opts.blockMsgClass + ' blockPage\" style=\"z-index:'+(z+10)+';display:none;position:fixed\"></div>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\ts = '<div class=\"blockUI ' + opts.blockMsgClass + ' blockElement\" style=\"z-index:'+(z+10)+';display:none;position:absolute\"></div>';\n\t\t\t}\n\t\t\tlyr3 = $(s);\n\n\t\t\t// if we have a message, style it\n\t\t\tif (msg) {\n\t\t\t\tif (opts.theme) {\n\t\t\t\t\tlyr3.css(themedCSS);\n\t\t\t\t\tlyr3.addClass('ui-widget-content');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tlyr3.css(css);\n\t\t\t}\n\n\t\t\t// style the overlay\n\t\t\tif (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)\n\t\t\t lyr2.css(opts.overlayCSS);\n\t\t\tif (!opts.overlayCSS.userOverlayCSSPosition) {\n\t\t\t lyr2.css('position', full ? 'fixed' : 'absolute');\n\t\t\t}\n\n\t\t\t// make iframe layer transparent in IE\n\t\t\tif (msie || opts.forceIframe)\n\t\t\t\tlyr1.css('opacity',0.0);\n\n\t\t\t//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);\n\t\t\tvar layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);\n\t\t\t$.each(layers, function() {\n\t\t\t\tthis.appendTo($par);\n\t\t\t});\n\n\t\t\tif (opts.theme && opts.draggable && $.fn.draggable) {\n\t\t\t\tlyr3.draggable({\n\t\t\t\t\thandle: '.ui-dialog-titlebar',\n\t\t\t\t\tcancel: 'li'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)\n\t\t\tvar expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);\n\t\t\tif (ie6 || expr) {\n\t\t\t\t// give body 100% height\n\t\t\t\tif (full && opts.allowBodyStretch && $.support.boxModel)\n\t\t\t\t\t$('html,body').css('height','100%');\n\n\t\t\t\t// fix ie6 issue when blocked element has a border width\n\t\t\t\tif ((ie6 || !$.support.boxModel) && !full) {\n\t\t\t\t\tvar t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');\n\t\t\t\t\tvar fixT = t ? '(0 - '+t+')' : 0;\n\t\t\t\t\tvar fixL = l ? '(0 - '+l+')' : 0;\n\t\t\t\t}\n\n\t\t\t\t// simulate fixed position\n\t\t\t\t$.each(layers, function(i,o) {\n\t\t\t\t\tvar s = o[0].style;\n\t\t\t\t\ts.position = 'absolute';\n\t\t\t\t\tif (i < 2) {\n\t\t\t\t\t\tif (full)\n\t\t\t\t\t\t\ts.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + \"px\"');\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ts.setExpression('height','this.parentNode.offsetHeight + \"px\"');\n\t\t\t\t\t\tif (full)\n\t\t\t\t\t\t\ts.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + \"px\"');\n\t\t\t\t\t\telse\n s.setExpression('width', 'this.parentNode.offsetWidth + \"px\"');\n\t\t\t\t\t\tif (fixL) s.setExpression('left', fixL);\n\t\t\t\t\t\tif (fixT) s.setExpression('top', fixT);\n\t\t\t\t\t}\n\t\t\t\t\telse if (opts.centerY) {\n\t\t\t\t\t\tif (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + \"px\"');\n\t\t\t\t\t\ts.marginTop = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse if (!opts.centerY && full) {\n\t\t\t\t\t\tvar top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;\n\t\t\t\t\t\tvar expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + \"px\"';\n\t\t\t\t\t\ts.setExpression('top',expression);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// show the message\n\t\t\tif (msg) {\n\t\t\t\tif (opts.theme)\n\t\t\t\t\tlyr3.find('.ui-widget-content').append(msg);\n\t\t\t\telse\n\t\t\t\t\tlyr3.append(msg);\n\t\t\t\tif (msg.jquery || msg.nodeType)\n\t\t\t\t\t$(msg).show();\n\t\t\t}\n\n\t\t\tif ((msie || opts.forceIframe) && opts.showOverlay)\n\t\t\t\tlyr1.show(); // opacity is zero\n\t\t\tif (opts.fadeIn) {\n\t\t\t\tvar cb = opts.onBlock ? opts.onBlock : noOp;\n\t\t\t\tvar cb1 = (opts.showOverlay && !msg) ? cb : noOp;\n\t\t\t\tvar cb2 = msg ? cb : noOp;\n\t\t\t\tif (opts.showOverlay)\n\t\t\t\t\tlyr2._fadeIn(opts.fadeIn, cb1);\n\t\t\t\tif (msg)\n\t\t\t\t\tlyr3._fadeIn(opts.fadeIn, cb2);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (opts.showOverlay)\n\t\t\t\t\tlyr2.show();\n\t\t\t\tif (msg)\n\t\t\t\t\tlyr3.show();\n\t\t\t\tif (opts.onBlock)\n\t\t\t\t\topts.onBlock.bind(lyr3)();\n\t\t\t}\n\n\t\t\t// bind key and mouse events\n\t\t\tbind(1, el, opts);\n\n\t\t\tif (full) {\n\t\t\t\tpageBlock = lyr3[0];\n\t\t\t\tpageBlockEls = $(opts.focusableElements,pageBlock);\n\t\t\t\tif (opts.focusInput)\n\t\t\t\t\tsetTimeout(focus, 20);\n\t\t\t}\n\t\t\telse\n\t\t\t\tcenter(lyr3[0], opts.centerX, opts.centerY);\n\n\t\t\tif (opts.timeout) {\n\t\t\t\t// auto-unblock\n\t\t\t\tvar to = setTimeout(function() {\n\t\t\t\t\tif (full)\n\t\t\t\t\t\t$.unblockUI(opts);\n\t\t\t\t\telse\n\t\t\t\t\t\t$(el).unblock(opts);\n\t\t\t\t}, opts.timeout);\n\t\t\t\t$(el).data('blockUI.timeout', to);\n\t\t\t}\n\t\t}\n\n\t\t// remove the block\n\t\tfunction remove(el, opts) {\n\t\t\tvar count;\n\t\t\tvar full = (el == window);\n\t\t\tvar $el = $(el);\n\t\t\tvar data = $el.data('blockUI.history');\n\t\t\tvar to = $el.data('blockUI.timeout');\n\t\t\tif (to) {\n\t\t\t\tclearTimeout(to);\n\t\t\t\t$el.removeData('blockUI.timeout');\n\t\t\t}\n\t\t\topts = $.extend({}, $.blockUI.defaults, opts || {});\n\t\t\tbind(0, el, opts); // unbind events\n\n\t\t\tif (opts.onUnblock === null) {\n\t\t\t\topts.onUnblock = $el.data('blockUI.onUnblock');\n\t\t\t\t$el.removeData('blockUI.onUnblock');\n\t\t\t}\n\n\t\t\tvar els;\n\t\t\tif (full) // crazy selector to handle odd field errors in ie6/7\n\t\t\t\tels = $('body').children().filter('.blockUI').add('body > .blockUI');\n\t\t\telse\n\t\t\t\tels = $el.find('>.blockUI');\n\n\t\t\t// fix cursor issue\n\t\t\tif ( opts.cursorReset ) {\n\t\t\t\tif ( els.length > 1 )\n\t\t\t\t\tels[1].style.cursor = opts.cursorReset;\n\t\t\t\tif ( els.length > 2 )\n\t\t\t\t\tels[2].style.cursor = opts.cursorReset;\n\t\t\t}\n\n\t\t\tif (full)\n\t\t\t\tpageBlock = pageBlockEls = null;\n\n\t\t\tif (opts.fadeOut) {\n\t\t\t\tcount = els.length;\n\t\t\t\tels.stop().fadeOut(opts.fadeOut, function() {\n\t\t\t\t\tif ( --count === 0)\n\t\t\t\t\t\treset(els,data,opts,el);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t\treset(els, data, opts, el);\n\t\t}\n\n\t\t// move blocking element back into the DOM where it started\n\t\tfunction reset(els,data,opts,el) {\n\t\t\tvar $el = $(el);\n\t\t\tif ( $el.data('blockUI.isBlocked') )\n\t\t\t\treturn;\n\n\t\t\tels.each(function(i,o) {\n\t\t\t\t// remove via DOM calls so we don't lose event handlers\n\t\t\t\tif (this.parentNode)\n\t\t\t\t\tthis.parentNode.removeChild(this);\n\t\t\t});\n\n\t\t\tif (data && data.el) {\n\t\t\t\tdata.el.style.display = data.display;\n\t\t\t\tdata.el.style.position = data.position;\n\t\t\t\tdata.el.style.cursor = 'default'; // #59\n\t\t\t\tif (data.parent)\n\t\t\t\t\tdata.parent.appendChild(data.el);\n\t\t\t\t$el.removeData('blockUI.history');\n\t\t\t}\n\n\t\t\tif ($el.data('blockUI.static')) {\n\t\t\t\t$el.css('position', 'static'); // #22\n\t\t\t}\n\n\t\t\tif (typeof opts.onUnblock == 'function')\n\t\t\t\topts.onUnblock(el,opts);\n\n\t\t\t// fix issue in Safari 6 where block artifacts remain until reflow\n\t\t\tvar body = $(document.body), w = body.width(), cssW = body[0].style.width;\n\t\t\tbody.width(w-1).width(w);\n\t\t\tbody[0].style.width = cssW;\n\t\t}\n\n\t\t// bind/unbind the handler\n\t\tfunction bind(b, el, opts) {\n\t\t\tvar full = el == window, $el = $(el);\n\n\t\t\t// don't bother unbinding if there is nothing to unbind\n\t\t\tif (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))\n\t\t\t\treturn;\n\n\t\t\t$el.data('blockUI.isBlocked', b);\n\n\t\t\t// don't bind events when overlay is not in use or if bindEvents is false\n\t\t\tif (!full || !opts.bindEvents || (b && !opts.showOverlay))\n\t\t\t\treturn;\n\n\t\t\t// bind anchors and inputs for mouse and key events\n\t\t\tvar events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';\n\t\t\tif (b)\n\t\t\t\t$(document).bind(events, opts, handler);\n\t\t\telse\n\t\t\t\t$(document).unbind(events, handler);\n\n\t\t// former impl...\n\t\t//\t\tvar $e = $('a,:input');\n\t\t//\t\tb ? $e.bind(events, opts, handler) : $e.unbind(events, handler);\n\t\t}\n\n\t\t// event handler to suppress keyboard/mouse events when blocking\n\t\tfunction handler(e) {\n\t\t\t// allow tab navigation (conditionally)\n\t\t\tif (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {\n\t\t\t\tif (pageBlock && e.data.constrainTabKey) {\n\t\t\t\t\tvar els = pageBlockEls;\n\t\t\t\t\tvar fwd = !e.shiftKey && e.target === els[els.length-1];\n\t\t\t\t\tvar back = e.shiftKey && e.target === els[0];\n\t\t\t\t\tif (fwd || back) {\n\t\t\t\t\t\tsetTimeout(function(){focus(back);},10);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar opts = e.data;\n\t\t\tvar target = $(e.target);\n\t\t\tif (target.hasClass('blockOverlay') && opts.onOverlayClick)\n\t\t\t\topts.onOverlayClick(e);\n\n\t\t\t// allow events within the message content\n\t\t\tif (target.parents('div.' + opts.blockMsgClass).length > 0)\n\t\t\t\treturn true;\n\n\t\t\t// allow events for content that is not being blocked\n\t\t\treturn target.parents().children().filter('div.blockUI').length === 0;\n\t\t}\n\n\t\tfunction focus(back) {\n\t\t\tif (!pageBlockEls)\n\t\t\t\treturn;\n\t\t\tvar e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];\n\t\t\tif (e)\n\t\t\t\te.focus();\n\t\t}\n\n function center(el, x, y) {\n\t\t\tvar p = el.parentNode, s = el.style;\n\t\t\tvar l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');\n\t\t\tvar t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');\n\t\t\tif (x) s.left = l > 0 ? (l+'px') : '0';\n\t\t\tif (y) s.top = t > 0 ? (t+'px') : '0';\n\t\t}\n\n\t\tfunction sz(el, p) {\n\t\t\treturn parseInt($.css(el,p),10)||0;\n\t\t}\n\n\t}\n\n\n\t/*global define:true */\n\tif (typeof define === 'function' && define.amd && define.amd.jQuery) {\n\t\tdefine(['jquery'], setup);\n\t} else {\n\t\tsetup(jQuery);\n\t}\n\n})();\n","/*!\n* inputmask.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2017 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 3.3.6-49\n*/\n\n!function(factory) {\n window.Inputmask = factory(window.dependencyLib || jQuery, window, document);\n}(function($, window, document, undefined) {\n function Inputmask(alias, options, internal) {\n if (!(this instanceof Inputmask)) return new Inputmask(alias, options, internal);\n this.el = undefined, this.events = {}, this.maskset = undefined, this.refreshValue = !1,\n !0 !== internal && ($.isPlainObject(alias) ? options = alias : (options = options || {},\n options.alias = alias), this.opts = $.extend(!0, {}, this.defaults, options), this.noMasksCache = options && options.definitions !== undefined,\n this.userOptions = options || {}, this.isRTL = this.opts.numericInput, resolveAlias(this.opts.alias, options, this.opts));\n }\n function resolveAlias(aliasStr, options, opts) {\n var aliasDefinition = Inputmask.prototype.aliases[aliasStr];\n return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, undefined, opts),\n $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : (null === opts.mask && (opts.mask = aliasStr),\n !1);\n }\n function generateMaskSet(opts, nocache) {\n function generateMask(mask, metadata, opts) {\n var regexMask = !1;\n if (null !== mask && \"\" !== mask || (regexMask = null !== opts.regex, regexMask ? (mask = opts.regex,\n mask = mask.replace(/^(\\^)(.*)(\\$)$/, \"$2\")) : mask = \"*{*}\"), 1 === mask.length && !1 === opts.greedy && 0 !== opts.repeat && (opts.placeholder = \"\"),\n opts.repeat > 0 || \"*\" === opts.repeat || \"+\" === opts.repeat) {\n var repeatStart = \"*\" === opts.repeat ? 0 : \"+\" === opts.repeat ? 1 : opts.repeat;\n mask = opts.groupmarker.start + mask + opts.groupmarker.end + opts.quantifiermarker.start + repeatStart + \",\" + opts.repeat + opts.quantifiermarker.end;\n }\n var masksetDefinition, maskdefKey = regexMask ? \"regex_\" + opts.regex : opts.numericInput ? mask.split(\"\").reverse().join(\"\") : mask;\n return Inputmask.prototype.masksCache[maskdefKey] === undefined || !0 === nocache ? (masksetDefinition = {\n mask: mask,\n maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts),\n validPositions: {},\n _buffer: undefined,\n buffer: undefined,\n tests: {},\n metadata: metadata,\n maskLength: undefined\n }, !0 !== nocache && (Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition,\n masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]))) : masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]),\n masksetDefinition;\n }\n if ($.isFunction(opts.mask) && (opts.mask = opts.mask(opts)), $.isArray(opts.mask)) {\n if (opts.mask.length > 1) {\n opts.keepStatic = null === opts.keepStatic || opts.keepStatic;\n var altMask = opts.groupmarker.start;\n return $.each(opts.numericInput ? opts.mask.reverse() : opts.mask, function(ndx, msk) {\n altMask.length > 1 && (altMask += opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start),\n msk.mask === undefined || $.isFunction(msk.mask) ? altMask += msk : altMask += msk.mask;\n }), altMask += opts.groupmarker.end, generateMask(altMask, opts.mask, opts);\n }\n opts.mask = opts.mask.pop();\n }\n return opts.mask && opts.mask.mask !== undefined && !$.isFunction(opts.mask.mask) ? generateMask(opts.mask.mask, opts.mask, opts) : generateMask(opts.mask, opts.mask, opts);\n }\n function maskScope(actionObj, maskset, opts) {\n function getMaskTemplate(baseOnInput, minimalPos, includeMode) {\n minimalPos = minimalPos || 0;\n var ndxIntlzr, test, testPos, maskTemplate = [], pos = 0, lvp = getLastValidPosition();\n -1 === (maxLength = el !== undefined ? el.maxLength : undefined) && (maxLength = undefined);\n do {\n !0 === baseOnInput && getMaskSet().validPositions[pos] ? (testPos = getMaskSet().validPositions[pos],\n test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(!0 === includeMode ? testPos.input : !1 === includeMode ? test.nativeDef : getPlaceholder(pos, test))) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),\n test = testPos.match, ndxIntlzr = testPos.locator.slice(), (!1 === opts.jitMasking || pos < lvp || \"number\" == typeof opts.jitMasking && isFinite(opts.jitMasking) && opts.jitMasking > pos) && maskTemplate.push(!1 === includeMode ? test.nativeDef : getPlaceholder(pos, test))),\n pos++;\n } while ((maxLength === undefined || pos < maxLength) && (null !== test.fn || \"\" !== test.def) || minimalPos > pos);\n return \"\" === maskTemplate[maskTemplate.length - 1] && maskTemplate.pop(), getMaskSet().maskLength = pos + 1,\n maskTemplate;\n }\n function getMaskSet() {\n return maskset;\n }\n function resetMaskSet(soft) {\n var maskset = getMaskSet();\n maskset.buffer = undefined, !0 !== soft && (maskset.validPositions = {}, maskset.p = 0);\n }\n function getLastValidPosition(closestTo, strict, validPositions) {\n var before = -1, after = -1, valids = validPositions || getMaskSet().validPositions;\n closestTo === undefined && (closestTo = -1);\n for (var posNdx in valids) {\n var psNdx = parseInt(posNdx);\n valids[psNdx] && (strict || !0 !== valids[psNdx].generatedInput) && (psNdx <= closestTo && (before = psNdx),\n psNdx >= closestTo && (after = psNdx));\n }\n return -1 !== before && closestTo - before > 1 || after < closestTo ? before : after;\n }\n function stripValidPositions(start, end, nocheck, strict) {\n var i, startPos = start, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), needsValidation = !1;\n for (getMaskSet().p = start, i = end - 1; i >= startPos; i--) getMaskSet().validPositions[i] !== undefined && (!0 !== nocheck && (!getMaskSet().validPositions[i].match.optionality && function(pos) {\n var posMatch = getMaskSet().validPositions[pos];\n if (posMatch !== undefined && null === posMatch.match.fn) {\n var prevMatch = getMaskSet().validPositions[pos - 1], nextMatch = getMaskSet().validPositions[pos + 1];\n return prevMatch !== undefined && nextMatch !== undefined;\n }\n return !1;\n }(i) || !1 === opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts)) || delete getMaskSet().validPositions[i]);\n for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) {\n for (;getMaskSet().validPositions[startPos] !== undefined; ) startPos++;\n if (i < startPos && (i = startPos + 1), getMaskSet().validPositions[i] === undefined && isMask(i)) i++; else {\n var t = getTestTemplate(i);\n !1 === needsValidation && positionsClone[startPos] && positionsClone[startPos].match.def === t.match.def ? (getMaskSet().validPositions[startPos] = $.extend(!0, {}, positionsClone[startPos]),\n getMaskSet().validPositions[startPos].input = t.input, delete getMaskSet().validPositions[i],\n i++) : positionCanMatchDefinition(startPos, t.match.def) ? !1 !== isValid(startPos, t.input || getPlaceholder(i), !0) && (delete getMaskSet().validPositions[i],\n i++, needsValidation = !0) : isMask(i) || (i++, startPos--), startPos++;\n }\n }\n resetMaskSet(!0);\n }\n function determineTestTemplate(tests, guessNextBest) {\n for (var testPos, testPositions = tests, lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0)[0], lvTestAltArr = lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation].toString().split(\",\") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx],\n !(testPos.match && (opts.greedy && !0 !== testPos.match.optionalQuantifier || (!1 === testPos.match.optionality || !1 === testPos.match.newBlockMarker) && !0 !== testPos.match.optionalQuantifier) && (lvTest.alternation === undefined || lvTest.alternation !== testPos.alternation || testPos.locator[lvTest.alternation] !== undefined && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(\",\"), lvTestAltArr))) || !0 === guessNextBest && (null !== testPos.match.fn || /[0-9a-bA-Z]/.test(testPos.match.def))); ndx++) ;\n return testPos;\n }\n function getTestTemplate(pos, ndxIntlzr, tstPs) {\n return getMaskSet().validPositions[pos] || determineTestTemplate(getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs));\n }\n function getTest(pos) {\n return getMaskSet().validPositions[pos] ? getMaskSet().validPositions[pos] : getTests(pos)[0];\n }\n function positionCanMatchDefinition(pos, def) {\n for (var valid = !1, tests = getTests(pos), tndx = 0; tndx < tests.length; tndx++) if (tests[tndx].match && tests[tndx].match.def === def) {\n valid = !0;\n break;\n }\n return valid;\n }\n function getTests(pos, ndxIntlzr, tstPs) {\n function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {\n function handleMatch(match, loopNdx, quantifierRecurse) {\n function isFirstMatch(latestMatch, tokenGroup) {\n var firstMatch = 0 === $.inArray(latestMatch, tokenGroup.matches);\n return firstMatch || $.each(tokenGroup.matches, function(ndx, match) {\n if (!0 === match.isQuantifier && (firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]))) return !1;\n }), firstMatch;\n }\n function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {\n var bestMatch, indexPos;\n if (getMaskSet().validPositions[pos - 1] && targetAlternation && getMaskSet().tests[pos]) for (var vpAlternation = getMaskSet().validPositions[pos - 1].locator, tpAlternation = getMaskSet().tests[pos][0].locator, i = 0; i < targetAlternation; i++) if (vpAlternation[i] !== tpAlternation[i]) return vpAlternation[targetAlternation];\n return (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) && $.each(getMaskSet().tests[pos] || [ getMaskSet().validPositions[pos] ], function(ndx, lmnt) {\n var alternation = targetAlternation !== undefined ? targetAlternation : lmnt.alternation, ndxPos = lmnt.locator[alternation] !== undefined ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;\n (indexPos === undefined || ndxPos < indexPos) && -1 !== ndxPos && (bestMatch = lmnt,\n indexPos = ndxPos);\n }), bestMatch ? bestMatch.locator.slice((targetAlternation !== undefined ? targetAlternation : bestMatch.alternation) + 1) : targetAlternation !== undefined ? resolveNdxInitializer(pos, alternateNdx) : undefined;\n }\n if (testPos > 1e4) throw \"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. \" + getMaskSet().mask;\n if (testPos === pos && match.matches === undefined) return matches.push({\n match: match,\n locator: loopNdx.reverse(),\n cd: cacheDependency\n }), !0;\n if (match.matches !== undefined) {\n if (match.isGroup && quantifierRecurse !== match) {\n if (match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx)) return !0;\n } else if (match.isOptional) {\n var optionalToken = match;\n if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) {\n if (latestMatch = matches[matches.length - 1].match, !isFirstMatch(latestMatch, optionalToken)) return !0;\n insertStop = !0, testPos = pos;\n }\n } else if (match.isAlternator) {\n var maltMatches, alternateToken = match, malternateMatches = [], currentMatches = matches.slice(), loopNdxCnt = loopNdx.length, altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;\n if (-1 === altIndex || \"string\" == typeof altIndex) {\n var amndx, currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [];\n if (\"string\" == typeof altIndex) altIndexArr = altIndex.split(\",\"); else for (amndx = 0; amndx < alternateToken.matches.length; amndx++) altIndexArr.push(amndx);\n for (var ndx = 0; ndx < altIndexArr.length; ndx++) {\n if (amndx = parseInt(altIndexArr[ndx]), matches = [], ndxInitializer = resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice(),\n !0 !== (match = handleMatch(alternateToken.matches[amndx] || maskToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) || match) && match !== undefined && altIndexArr[altIndexArr.length - 1] < alternateToken.matches.length) {\n var ntndx = $.inArray(match, maskToken.matches) + 1;\n maskToken.matches.length > ntndx && (match = handleMatch(maskToken.matches[ntndx], [ ntndx ].concat(loopNdx.slice(1, loopNdx.length)), quantifierRecurse)) && (altIndexArr.push(ntndx.toString()),\n $.each(matches, function(ndx, lmnt) {\n lmnt.alternation = loopNdx.length - 1;\n }));\n }\n maltMatches = matches.slice(), testPos = currentPos, matches = [];\n for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {\n var altMatch = maltMatches[ndx1], dropMatch = !1;\n altMatch.alternation = altMatch.alternation || loopNdxCnt;\n for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {\n var altMatch2 = malternateMatches[ndx2];\n if (\"string\" != typeof altIndex || -1 !== $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr)) {\n if (function(source, target) {\n return source.match.nativeDef === target.match.nativeDef || source.match.def === target.match.nativeDef || source.match.nativeDef === target.match.def;\n }(altMatch, altMatch2)) {\n dropMatch = !0, altMatch.alternation == altMatch2.alternation && -1 === altMatch2.locator[altMatch2.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) && (altMatch2.locator[altMatch2.alternation] = altMatch2.locator[altMatch2.alternation] + \",\" + altMatch.locator[altMatch.alternation],\n altMatch2.alternation = altMatch.alternation), altMatch.match.nativeDef === altMatch2.match.def && (altMatch.locator[altMatch.alternation] = altMatch2.locator[altMatch2.alternation],\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 1, altMatch));\n break;\n }\n if (altMatch.match.def === altMatch2.match.def) {\n dropMatch = !1;\n break;\n }\n if (function(source, target) {\n return null === source.match.fn && null !== target.match.fn && target.match.fn.test(source.match.def, getMaskSet(), pos, !1, opts, !1);\n }(altMatch, altMatch2) || function(source, target) {\n return null !== source.match.fn && null !== target.match.fn && target.match.fn.test(source.match.def.replace(/[\\[\\]]/g, \"\"), getMaskSet(), pos, !1, opts, !1);\n }(altMatch, altMatch2)) {\n altMatch.alternation == altMatch2.alternation && -1 === altMatch.locator[altMatch.alternation].toString().indexOf(altMatch2.locator[altMatch2.alternation].toString().split(\"\")[0]) && (altMatch.na = altMatch.na || altMatch.locator[altMatch.alternation].toString(),\n -1 === altMatch.na.indexOf(altMatch.locator[altMatch.alternation].toString().split(\"\")[0]) && (altMatch.na = altMatch.na + \",\" + altMatch.locator[altMatch2.alternation].toString().split(\"\")[0]),\n dropMatch = !0, altMatch.locator[altMatch.alternation] = altMatch2.locator[altMatch2.alternation].toString().split(\"\")[0] + \",\" + altMatch.locator[altMatch.alternation],\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch));\n break;\n }\n }\n }\n dropMatch || malternateMatches.push(altMatch);\n }\n }\n \"string\" == typeof altIndex && (malternateMatches = $.map(malternateMatches, function(lmnt, ndx) {\n if (isFinite(ndx)) {\n var alternation = lmnt.alternation, altLocArr = lmnt.locator[alternation].toString().split(\",\");\n lmnt.locator[alternation] = undefined, lmnt.alternation = undefined;\n for (var alndx = 0; alndx < altLocArr.length; alndx++) -1 !== $.inArray(altLocArr[alndx], altIndexArr) && (lmnt.locator[alternation] !== undefined ? (lmnt.locator[alternation] += \",\",\n lmnt.locator[alternation] += altLocArr[alndx]) : lmnt.locator[alternation] = parseInt(altLocArr[alndx]),\n lmnt.alternation = alternation);\n if (lmnt.locator[alternation] !== undefined) return lmnt;\n }\n })), matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = matches.length > 0,\n match = malternateMatches.length > 0, ndxInitializer = ndxInitializerClone.slice();\n } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);\n if (match) return !0;\n } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) for (var qt = match, qndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) {\n var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];\n if (match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup)) {\n if (latestMatch = matches[matches.length - 1].match, latestMatch.optionalQuantifier = qndx > qt.quantifier.min - 1,\n isFirstMatch(latestMatch, tokenGroup)) {\n if (qndx > qt.quantifier.min - 1) {\n insertStop = !0, testPos = pos;\n break;\n }\n return !0;\n }\n return !0;\n }\n } else if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) return !0;\n } else testPos++;\n }\n for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) if (!0 !== maskToken.matches[tndx].isQuantifier) {\n var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);\n if (match && testPos === pos) return match;\n if (testPos > pos) break;\n }\n }\n function filterTests(tests) {\n return opts.keepStatic && pos > 0 && tests.length > 1 + (\"\" === tests[tests.length - 1].match.def ? 1 : 0) && !0 !== tests[0].match.optionality && !0 !== tests[0].match.optionalQuantifier && null === tests[0].match.fn && !/[0-9a-bA-Z]/.test(tests[0].match.def) ? [ determineTestTemplate(tests) ] : tests;\n }\n var latestMatch, maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = !1, cacheDependency = ndxIntlzr ? ndxIntlzr.join(\"\") : \"\";\n if (pos > -1) {\n if (ndxIntlzr === undefined) {\n for (var test, previousPos = pos - 1; (test = getMaskSet().validPositions[previousPos] || getMaskSet().tests[previousPos]) === undefined && previousPos > -1; ) previousPos--;\n test !== undefined && previousPos > -1 && (ndxInitializer = function(tests) {\n var locator = [];\n return $.isArray(tests) || (tests = [ tests ]), tests.length > 0 && (tests[0].alternation === undefined ? (locator = determineTestTemplate(tests.slice()).locator.slice(),\n 0 === locator.length && (locator = tests[0].locator.slice())) : $.each(tests, function(ndx, tst) {\n if (\"\" !== tst.def) if (0 === locator.length) locator = tst.locator.slice(); else for (var i = 0; i < locator.length; i++) tst.locator[i] && -1 === locator[i].toString().indexOf(tst.locator[i]) && (locator[i] += \",\" + tst.locator[i]);\n })), locator;\n }(test), cacheDependency = ndxInitializer.join(\"\"), testPos = previousPos);\n }\n if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) return filterTests(getMaskSet().tests[pos]);\n for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {\n if (resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]) && testPos === pos || testPos > pos) break;\n }\n }\n return (0 === matches.length || insertStop) && matches.push({\n match: {\n fn: null,\n cardinality: 0,\n optionality: !0,\n casing: null,\n def: \"\",\n placeholder: \"\"\n },\n locator: [],\n cd: cacheDependency\n }), ndxIntlzr !== undefined && getMaskSet().tests[pos] ? filterTests($.extend(!0, [], matches)) : (getMaskSet().tests[pos] = $.extend(!0, [], matches),\n filterTests(getMaskSet().tests[pos]));\n }\n function getBufferTemplate() {\n return getMaskSet()._buffer === undefined && (getMaskSet()._buffer = getMaskTemplate(!1, 1),\n getMaskSet().buffer === undefined && (getMaskSet().buffer = getMaskSet()._buffer.slice())),\n getMaskSet()._buffer;\n }\n function getBuffer(noCache) {\n return getMaskSet().buffer !== undefined && !0 !== noCache || (getMaskSet().buffer = getMaskTemplate(!0, getLastValidPosition(), !0)),\n getMaskSet().buffer;\n }\n function refreshFromBuffer(start, end, buffer) {\n var i, p;\n if (!0 === start) resetMaskSet(), start = 0, end = buffer.length; else for (i = start; i < end; i++) delete getMaskSet().validPositions[i];\n for (p = start, i = start; i < end; i++) if (resetMaskSet(!0), buffer[i] !== opts.skipOptionalPartCharacter) {\n var valResult = isValid(p, buffer[i], !0, !0);\n !1 !== valResult && (resetMaskSet(!0), p = valResult.caret !== undefined ? valResult.caret : valResult.pos + 1);\n }\n }\n function casing(elem, test, pos) {\n switch (opts.casing || test.casing) {\n case \"upper\":\n elem = elem.toUpperCase();\n break;\n\n case \"lower\":\n elem = elem.toLowerCase();\n break;\n\n case \"title\":\n var posBefore = getMaskSet().validPositions[pos - 1];\n elem = 0 === pos || posBefore && posBefore.input === String.fromCharCode(Inputmask.keyCode.SPACE) ? elem.toUpperCase() : elem.toLowerCase();\n }\n return elem;\n }\n function checkAlternationMatch(altArr1, altArr2, na) {\n for (var naNdx, altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = !1, naArr = na !== undefined ? na.split(\",\") : [], i = 0; i < naArr.length; i++) -1 !== (naNdx = altArr1.indexOf(naArr[i])) && altArr1.splice(naNdx, 1);\n for (var alndx = 0; alndx < altArr1.length; alndx++) if (-1 !== $.inArray(altArr1[alndx], altArrC)) {\n isMatch = !0;\n break;\n }\n return isMatch;\n }\n function isValid(pos, c, strict, fromSetValid, fromAlternate) {\n function isSelection(posObj) {\n var selection = isRTL ? posObj.begin - posObj.end > 1 || posObj.begin - posObj.end == 1 : posObj.end - posObj.begin > 1 || posObj.end - posObj.begin == 1;\n return selection && 0 === posObj.begin && posObj.end === getMaskSet().maskLength ? \"full\" : selection;\n }\n function _isValid(position, c, strict) {\n var rslt = !1;\n return $.each(getTests(position), function(ndx, tst) {\n for (var test = tst.match, loopend = c ? 1 : 0, chrs = \"\", i = test.cardinality; i > loopend; i--) chrs += getBufferElement(position - (i - 1));\n if (c && (chrs += c), getBuffer(!0), !1 !== (rslt = null != test.fn ? test.fn.test(chrs, getMaskSet(), position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && \"\" !== test.def && {\n c: getPlaceholder(position, test, !0) || test.def,\n pos: position\n })) {\n var elem = rslt.c !== undefined ? rslt.c : c;\n elem = elem === opts.skipOptionalPartCharacter && null === test.fn ? getPlaceholder(position, test, !0) || test.def : elem;\n var validatedPos = position, possibleModifiedBuffer = getBuffer();\n if (rslt.remove !== undefined && ($.isArray(rslt.remove) || (rslt.remove = [ rslt.remove ]),\n $.each(rslt.remove.sort(function(a, b) {\n return b - a;\n }), function(ndx, lmnt) {\n stripValidPositions(lmnt, lmnt + 1, !0);\n })), rslt.insert !== undefined && ($.isArray(rslt.insert) || (rslt.insert = [ rslt.insert ]),\n $.each(rslt.insert.sort(function(a, b) {\n return a - b;\n }), function(ndx, lmnt) {\n isValid(lmnt.pos, lmnt.c, !0, fromSetValid);\n })), rslt.refreshFromBuffer) {\n var refresh = rslt.refreshFromBuffer;\n if (refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, possibleModifiedBuffer),\n rslt.pos === undefined && rslt.c === undefined) return rslt.pos = getLastValidPosition(),\n !1;\n if ((validatedPos = rslt.pos !== undefined ? rslt.pos : position) !== position) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0, fromSetValid)),\n !1;\n } else if (!0 !== rslt && rslt.pos !== undefined && rslt.pos !== position && (validatedPos = rslt.pos,\n refreshFromBuffer(position, validatedPos, getBuffer().slice()), validatedPos !== position)) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)),\n !1;\n return (!0 === rslt || rslt.pos !== undefined || rslt.c !== undefined) && (ndx > 0 && resetMaskSet(!0),\n setValidPosition(validatedPos, $.extend({}, tst, {\n input: casing(elem, test, validatedPos)\n }), fromSetValid, isSelection(pos)) || (rslt = !1), !1);\n }\n }), rslt;\n }\n function setValidPosition(pos, validTest, fromSetValid, isSelection) {\n if (isSelection || opts.insertMode && getMaskSet().validPositions[pos] !== undefined && fromSetValid === undefined) {\n var i, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), lvp = getLastValidPosition(undefined, !0);\n for (i = pos; i <= lvp; i++) delete getMaskSet().validPositions[i];\n getMaskSet().validPositions[pos] = $.extend(!0, {}, validTest);\n var j, valid = !0, vps = getMaskSet().validPositions, needsValidation = !1, initialLength = getMaskSet().maskLength;\n for (i = j = pos; i <= lvp; i++) {\n var t = positionsClone[i];\n if (t !== undefined) for (var posMatch = j; posMatch < getMaskSet().maskLength && (null === t.match.fn && vps[i] && (!0 === vps[i].match.optionalQuantifier || !0 === vps[i].match.optionality) || null != t.match.fn); ) {\n if (posMatch++, !1 === needsValidation && positionsClone[posMatch] && positionsClone[posMatch].match.def === t.match.def) getMaskSet().validPositions[posMatch] = $.extend(!0, {}, positionsClone[posMatch]),\n getMaskSet().validPositions[posMatch].input = t.input, fillMissingNonMask(posMatch),\n j = posMatch, valid = !0; else if (positionCanMatchDefinition(posMatch, t.match.def)) {\n var result = isValid(posMatch, t.input, !0, !0);\n valid = !1 !== result, j = result.caret || result.insert ? getLastValidPosition() : posMatch,\n needsValidation = !0;\n } else if (!(valid = !0 === t.generatedInput) && posMatch >= getMaskSet().maskLength - 1) break;\n if (getMaskSet().maskLength < initialLength && (getMaskSet().maskLength = initialLength),\n valid) break;\n }\n if (!valid) break;\n }\n if (!valid) return getMaskSet().validPositions = $.extend(!0, {}, positionsClone),\n resetMaskSet(!0), !1;\n } else getMaskSet().validPositions[pos] = $.extend(!0, {}, validTest);\n return resetMaskSet(!0), !0;\n }\n function fillMissingNonMask(maskPos) {\n for (var pndx = maskPos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ;\n var testTemplate, testsFromPos;\n for (pndx++; pndx < maskPos; pndx++) getMaskSet().validPositions[pndx] === undefined && (!1 === opts.jitMasking || opts.jitMasking > pndx) && (testsFromPos = getTests(pndx, getTestTemplate(pndx - 1).locator, pndx - 1).slice(),\n \"\" === testsFromPos[testsFromPos.length - 1].match.def && testsFromPos.pop(), (testTemplate = determineTestTemplate(testsFromPos)) && (testTemplate.match.def === opts.radixPointDefinitionSymbol || !isMask(pndx, !0) || $.inArray(opts.radixPoint, getBuffer()) < pndx && testTemplate.match.fn && testTemplate.match.fn.test(getPlaceholder(pndx), getMaskSet(), pndx, !1, opts)) && !1 !== (result = _isValid(pndx, getPlaceholder(pndx, testTemplate.match, !0) || (null == testTemplate.match.fn ? testTemplate.match.def : \"\" !== getPlaceholder(pndx) ? getPlaceholder(pndx) : getBuffer()[pndx]), !0)) && (getMaskSet().validPositions[result.pos || pndx].generatedInput = !0));\n }\n strict = !0 === strict;\n var maskPos = pos;\n pos.begin !== undefined && (maskPos = isRTL && !isSelection(pos) ? pos.end : pos.begin);\n var result = !0, positionsClone = $.extend(!0, {}, getMaskSet().validPositions);\n if ($.isFunction(opts.preValidation) && !strict && !0 !== fromSetValid && (result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts)),\n !0 === result) {\n if (fillMissingNonMask(maskPos), isSelection(pos) && (handleRemove(undefined, Inputmask.keyCode.DELETE, pos),\n maskPos = getMaskSet().p), maskPos < getMaskSet().maskLength && (maxLength === undefined || maskPos < maxLength) && (result = _isValid(maskPos, c, strict),\n (!strict || !0 === fromSetValid) && !1 === result)) {\n var currentPosValid = getMaskSet().validPositions[maskPos];\n if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {\n if ((opts.insertMode || getMaskSet().validPositions[seekNext(maskPos)] === undefined) && !isMask(maskPos, !0)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) if (!1 !== (result = _isValid(nPos, c, strict))) {\n !function(originalPos, newPos) {\n var vp = getMaskSet().validPositions[newPos];\n if (vp) for (var targetLocator = vp.locator, tll = targetLocator.length, ps = originalPos; ps < newPos; ps++) if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, !0)) {\n var tests = getTests(ps).slice(), bestMatch = determineTestTemplate(tests, !0), equality = -1;\n \"\" === tests[tests.length - 1].match.def && tests.pop(), $.each(tests, function(ndx, tst) {\n for (var i = 0; i < tll; i++) {\n if (tst.locator[i] === undefined || !checkAlternationMatch(tst.locator[i].toString().split(\",\"), targetLocator[i].toString().split(\",\"), tst.na)) {\n var targetAI = targetLocator[i], bestMatchAI = bestMatch.locator[i], tstAI = tst.locator[i];\n targetAI - bestMatchAI > Math.abs(targetAI - tstAI) && (bestMatch = tst);\n break;\n }\n equality < i && (equality = i, bestMatch = tst);\n }\n }), bestMatch = $.extend({}, bestMatch, {\n input: getPlaceholder(ps, bestMatch.match, !0) || bestMatch.match.def\n }), bestMatch.generatedInput = !0, setValidPosition(ps, bestMatch, !0), getMaskSet().validPositions[newPos] = undefined,\n _isValid(newPos, vp.input, !0);\n }\n }(maskPos, result.pos !== undefined ? result.pos : nPos), maskPos = nPos;\n break;\n }\n } else result = {\n caret: seekNext(maskPos)\n };\n }\n !1 === result && opts.keepStatic && !strict && !0 !== fromAlternate && (result = function(pos, c, strict) {\n var lastAlt, alternation, altPos, prevAltPos, i, validPos, altNdxs, decisionPos, validPsClone = $.extend(!0, {}, getMaskSet().validPositions), isValidRslt = !1, lAltPos = getLastValidPosition();\n for (prevAltPos = getMaskSet().validPositions[lAltPos]; lAltPos >= 0; lAltPos--) if ((altPos = getMaskSet().validPositions[lAltPos]) && altPos.alternation !== undefined) {\n if (lastAlt = lAltPos, alternation = getMaskSet().validPositions[lastAlt].alternation,\n prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) break;\n prevAltPos = altPos;\n }\n if (alternation !== undefined) {\n decisionPos = parseInt(lastAlt);\n var decisionTaker = prevAltPos.locator[prevAltPos.alternation || alternation] !== undefined ? prevAltPos.locator[prevAltPos.alternation || alternation] : altNdxs[0];\n decisionTaker.length > 0 && (decisionTaker = decisionTaker.split(\",\")[0]);\n var possibilityPos = getMaskSet().validPositions[decisionPos], prevPos = getMaskSet().validPositions[decisionPos - 1];\n $.each(getTests(decisionPos, prevPos ? prevPos.locator : undefined, decisionPos - 1), function(ndx, test) {\n altNdxs = test.locator[alternation] ? test.locator[alternation].toString().split(\",\") : [];\n for (var mndx = 0; mndx < altNdxs.length; mndx++) {\n var validInputs = [], staticInputsBeforePos = 0, staticInputsBeforePosAlternate = 0, verifyValidInput = !1;\n if (decisionTaker < altNdxs[mndx] && (test.na === undefined || -1 === $.inArray(altNdxs[mndx], test.na.split(\",\")) || -1 === $.inArray(decisionTaker.toString(), altNdxs))) {\n getMaskSet().validPositions[decisionPos] = $.extend(!0, {}, test);\n var possibilities = getMaskSet().validPositions[decisionPos].locator;\n for (getMaskSet().validPositions[decisionPos].locator[alternation] = parseInt(altNdxs[mndx]),\n null == test.match.fn ? (possibilityPos.input !== test.match.def && (verifyValidInput = !0,\n !0 !== possibilityPos.generatedInput && validInputs.push(possibilityPos.input)),\n staticInputsBeforePosAlternate++, getMaskSet().validPositions[decisionPos].generatedInput = !/[0-9a-bA-Z]/.test(test.match.def),\n getMaskSet().validPositions[decisionPos].input = test.match.def) : getMaskSet().validPositions[decisionPos].input = possibilityPos.input,\n i = decisionPos + 1; i < getLastValidPosition(undefined, !0) + 1; i++) validPos = getMaskSet().validPositions[i],\n validPos && !0 !== validPos.generatedInput && /[0-9a-bA-Z]/.test(validPos.input) ? validInputs.push(validPos.input) : i < pos && staticInputsBeforePos++,\n delete getMaskSet().validPositions[i];\n for (verifyValidInput && validInputs[0] === test.match.def && validInputs.shift(),\n resetMaskSet(!0), isValidRslt = !0; validInputs.length > 0; ) {\n var input = validInputs.shift();\n if (input !== opts.skipOptionalPartCharacter && !(isValidRslt = isValid(getLastValidPosition(undefined, !0) + 1, input, !1, fromSetValid, !0))) break;\n }\n if (isValidRslt) {\n getMaskSet().validPositions[decisionPos].locator = possibilities;\n var targetLvp = getLastValidPosition(pos) + 1;\n for (i = decisionPos + 1; i < getLastValidPosition() + 1; i++) ((validPos = getMaskSet().validPositions[i]) === undefined || null == validPos.match.fn) && i < pos + (staticInputsBeforePosAlternate - staticInputsBeforePos) && staticInputsBeforePosAlternate++;\n pos += staticInputsBeforePosAlternate - staticInputsBeforePos, isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid, !0);\n }\n if (isValidRslt) return !1;\n resetMaskSet(), getMaskSet().validPositions = $.extend(!0, {}, validPsClone);\n }\n }\n });\n }\n return isValidRslt;\n }(maskPos, c, strict)), !0 === result && (result = {\n pos: maskPos\n });\n }\n if ($.isFunction(opts.postValidation) && !1 !== result && !strict && !0 !== fromSetValid) {\n var postResult = opts.postValidation(getBuffer(!0), result, opts);\n if (postResult.refreshFromBuffer && postResult.buffer) {\n var refresh = postResult.refreshFromBuffer;\n refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, postResult.buffer);\n }\n result = !0 === postResult ? result : postResult;\n }\n return result.pos === undefined && (result.pos = maskPos), !1 === result && (resetMaskSet(!0),\n getMaskSet().validPositions = $.extend(!0, {}, positionsClone)), result;\n }\n function isMask(pos, strict) {\n var test = getTestTemplate(pos).match;\n if (\"\" === test.def && (test = getTest(pos).match), null != test.fn) return test.fn;\n if (!0 !== strict && pos > -1) {\n var tests = getTests(pos);\n return tests.length > 1 + (\"\" === tests[tests.length - 1].match.def ? 1 : 0);\n }\n return !1;\n }\n function seekNext(pos, newBlock) {\n var maskL = getMaskSet().maskLength;\n if (pos >= maskL) return maskL;\n var position = pos;\n for (getTests(maskL + 1).length > 1 && (getMaskTemplate(!0, maskL + 1, !0), maskL = getMaskSet().maskLength); ++position < maskL && (!0 === newBlock && (!0 !== getTest(position).match.newBlockMarker || !isMask(position)) || !0 !== newBlock && !isMask(position)); ) ;\n return position;\n }\n function seekPrevious(pos, newBlock) {\n var tests, position = pos;\n if (position <= 0) return 0;\n for (;--position > 0 && (!0 === newBlock && !0 !== getTest(position).match.newBlockMarker || !0 !== newBlock && !isMask(position) && (tests = getTests(position),\n tests.length < 2 || 2 === tests.length && \"\" === tests[1].match.def)); ) ;\n return position;\n }\n function getBufferElement(position) {\n return getMaskSet().validPositions[position] === undefined ? getPlaceholder(position) : getMaskSet().validPositions[position].input;\n }\n function writeBuffer(input, buffer, caretPos, event, triggerInputEvent) {\n if (event && $.isFunction(opts.onBeforeWrite)) {\n var result = opts.onBeforeWrite(event, buffer, caretPos, opts);\n if (result) {\n if (result.refreshFromBuffer) {\n var refresh = result.refreshFromBuffer;\n refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer || buffer),\n buffer = getBuffer(!0);\n }\n caretPos !== undefined && (caretPos = result.caret !== undefined ? result.caret : caretPos);\n }\n }\n input !== undefined && (input.inputmask._valueSet(buffer.join(\"\")), caretPos === undefined || event !== undefined && \"blur\" === event.type ? renderColorMask(input, buffer, caretPos) : android && \"input\" === event.type ? setTimeout(function() {\n caret(input, caretPos);\n }, 0) : caret(input, caretPos), !0 === triggerInputEvent && (skipInputEvent = !0,\n $(input).trigger(\"input\")));\n }\n function getPlaceholder(pos, test, returnPL) {\n if (test = test || getTest(pos).match, test.placeholder !== undefined || !0 === returnPL) return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder;\n if (null === test.fn) {\n if (pos > -1 && getMaskSet().validPositions[pos] === undefined) {\n var prevTest, tests = getTests(pos), staticAlternations = [];\n if (tests.length > 1 + (\"\" === tests[tests.length - 1].match.def ? 1 : 0)) for (var i = 0; i < tests.length; i++) if (!0 !== tests[i].match.optionality && !0 !== tests[i].match.optionalQuantifier && (null === tests[i].match.fn || prevTest === undefined || !1 !== tests[i].match.fn.test(prevTest.match.def, getMaskSet(), pos, !0, opts)) && (staticAlternations.push(tests[i]),\n null === tests[i].match.fn && (prevTest = tests[i]), staticAlternations.length > 1 && /[0-9a-bA-Z]/.test(staticAlternations[0].match.def))) return opts.placeholder.charAt(pos % opts.placeholder.length);\n }\n return test.def;\n }\n return opts.placeholder.charAt(pos % opts.placeholder.length);\n }\n function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {\n function isTemplateMatch(ndx, charCodes) {\n return -1 !== getBufferTemplate().slice(ndx, seekNext(ndx)).join(\"\").indexOf(charCodes) && !isMask(ndx) && getTest(ndx).match.nativeDef === charCodes.charAt(charCodes.length - 1);\n }\n var inputValue = nptvl.slice(), charCodes = \"\", initialNdx = 0, result = undefined;\n if (resetMaskSet(), getMaskSet().p = seekNext(-1), !strict) if (!0 !== opts.autoUnmask) {\n var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(\"\"), matches = inputValue.join(\"\").match(new RegExp(\"^\" + Inputmask.escapeRegex(staticInput), \"g\"));\n matches && matches.length > 0 && (inputValue.splice(0, matches.length * staticInput.length),\n initialNdx = seekNext(initialNdx));\n } else initialNdx = seekNext(initialNdx);\n if ($.each(inputValue, function(ndx, charCode) {\n if (charCode !== undefined) {\n var keypress = new $.Event(\"_checkval\");\n keypress.which = charCode.charCodeAt(0), charCodes += charCode;\n var lvp = getLastValidPosition(undefined, !0), lvTest = getMaskSet().validPositions[lvp], nextTest = getTestTemplate(lvp + 1, lvTest ? lvTest.locator.slice() : undefined, lvp);\n if (!isTemplateMatch(initialNdx, charCodes) || strict || opts.autoUnmask) {\n var pos = strict ? ndx : null == nextTest.match.fn && nextTest.match.optionality && lvp + 1 < getMaskSet().p ? lvp + 1 : getMaskSet().p;\n result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, pos),\n initialNdx = pos + 1, charCodes = \"\";\n } else result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, !0, lvp + 1);\n if (!strict && $.isFunction(opts.onBeforeWrite)) {\n var fp = result.forwardPosition;\n if (result = opts.onBeforeWrite(keypress, getBuffer(), result.forwardPosition, opts),\n result.forwardPosition = fp, result && result.refreshFromBuffer) {\n var refresh = result.refreshFromBuffer;\n refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer),\n resetMaskSet(!0), result.caret && (getMaskSet().p = result.caret, result.forwardPosition = result.caret);\n }\n }\n }\n }), writeOut) {\n var caretPos = undefined;\n document.activeElement === input && result && (caretPos = opts.numericInput ? seekPrevious(result.forwardPosition) : result.forwardPosition),\n writeBuffer(input, getBuffer(), caretPos, initiatingEvent || new $.Event(\"checkval\"), initiatingEvent && \"input\" === initiatingEvent.type);\n }\n }\n function unmaskedvalue(input) {\n if (input) {\n if (input.inputmask === undefined) return input.value;\n input.inputmask && input.inputmask.refreshValue && EventHandlers.setValueEvent.call(input);\n }\n var umValue = [], vps = getMaskSet().validPositions;\n for (var pndx in vps) vps[pndx].match && null != vps[pndx].match.fn && umValue.push(vps[pndx].input);\n var unmaskedValue = 0 === umValue.length ? \"\" : (isRTL ? umValue.reverse() : umValue).join(\"\");\n if ($.isFunction(opts.onUnMask)) {\n var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(\"\");\n unmaskedValue = opts.onUnMask(bufferValue, unmaskedValue, opts);\n }\n return unmaskedValue;\n }\n function caret(input, begin, end, notranslate) {\n function translatePosition(pos) {\n if (!0 !== notranslate && isRTL && \"number\" == typeof pos && (!opts.greedy || \"\" !== opts.placeholder)) {\n pos = getBuffer().join(\"\").length - pos;\n }\n return pos;\n }\n var range;\n if (begin === undefined) return input.setSelectionRange ? (begin = input.selectionStart,\n end = input.selectionEnd) : window.getSelection ? (range = window.getSelection().getRangeAt(0),\n range.commonAncestorContainer.parentNode !== input && range.commonAncestorContainer !== input || (begin = range.startOffset,\n end = range.endOffset)) : document.selection && document.selection.createRange && (range = document.selection.createRange(),\n begin = 0 - range.duplicate().moveStart(\"character\", -input.inputmask._valueGet().length),\n end = begin + range.text.length), {\n begin: translatePosition(begin),\n end: translatePosition(end)\n };\n if (begin.begin !== undefined && (end = begin.end, begin = begin.begin), \"number\" == typeof begin) {\n begin = translatePosition(begin), end = translatePosition(end), end = \"number\" == typeof end ? end : begin;\n var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;\n if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, mobile || !1 !== opts.insertMode || begin !== end || end++,\n input.setSelectionRange) input.selectionStart = begin, input.selectionEnd = end; else if (window.getSelection) {\n if (range = document.createRange(), input.firstChild === undefined || null === input.firstChild) {\n var textNode = document.createTextNode(\"\");\n input.appendChild(textNode);\n }\n range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length),\n range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length),\n range.collapse(!0);\n var sel = window.getSelection();\n sel.removeAllRanges(), sel.addRange(range);\n } else input.createTextRange && (range = input.createTextRange(), range.collapse(!0),\n range.moveEnd(\"character\", end), range.moveStart(\"character\", begin), range.select());\n renderColorMask(input, undefined, {\n begin: begin,\n end: end\n });\n }\n }\n function determineLastRequiredPosition(returnDefinition) {\n var pos, testPos, buffer = getBuffer(), bl = buffer.length, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = lvTest !== undefined ? lvTest.locator.slice() : undefined;\n for (pos = lvp + 1; pos < buffer.length; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),\n ndxIntlzr = testPos.locator.slice(), positions[pos] = $.extend(!0, {}, testPos);\n var lvTestAlt = lvTest && lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation] : undefined;\n for (pos = bl - 1; pos > lvp && (testPos = positions[pos], (testPos.match.optionality || testPos.match.optionalQuantifier && testPos.match.newBlockMarker || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && null != testPos.match.fn || null === testPos.match.fn && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(\",\"), lvTestAlt.toString().split(\",\")) && \"\" !== getTests(pos)[0].def)) && buffer[pos] === getPlaceholder(pos, testPos.match)); pos--) bl--;\n return returnDefinition ? {\n l: bl,\n def: positions[bl] ? positions[bl].match : undefined\n } : bl;\n }\n function clearOptionalTail(buffer) {\n for (var validPos, rl = determineLastRequiredPosition(), bl = buffer.length, lv = getMaskSet().validPositions[getLastValidPosition()]; rl < bl && !isMask(rl, !0) && (validPos = lv !== undefined ? getTestTemplate(rl, lv.locator.slice(\"\"), lv) : getTest(rl)) && !0 !== validPos.match.optionality && (!0 !== validPos.match.optionalQuantifier && !0 !== validPos.match.newBlockMarker || rl + 1 === bl && \"\" === (lv !== undefined ? getTestTemplate(rl + 1, lv.locator.slice(\"\"), lv) : getTest(rl + 1)).match.def); ) rl++;\n for (;(validPos = getMaskSet().validPositions[rl - 1]) && validPos && validPos.match.optionality && validPos.input === opts.skipOptionalPartCharacter; ) rl--;\n return buffer.splice(rl), buffer;\n }\n function isComplete(buffer) {\n if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts);\n if (\"*\" === opts.repeat) return undefined;\n var complete = !1, lrp = determineLastRequiredPosition(!0), aml = seekPrevious(lrp.l);\n if (lrp.def === undefined || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {\n complete = !0;\n for (var i = 0; i <= aml; i++) {\n var test = getTestTemplate(i).match;\n if (null !== test.fn && getMaskSet().validPositions[i] === undefined && !0 !== test.optionality && !0 !== test.optionalQuantifier || null === test.fn && buffer[i] !== getPlaceholder(i, test)) {\n complete = !1;\n break;\n }\n }\n }\n return complete;\n }\n function handleRemove(input, k, pos, strict) {\n if ((opts.numericInput || isRTL) && (k === Inputmask.keyCode.BACKSPACE ? k = Inputmask.keyCode.DELETE : k === Inputmask.keyCode.DELETE && (k = Inputmask.keyCode.BACKSPACE),\n isRTL)) {\n var pend = pos.end;\n pos.end = pos.begin, pos.begin = pend;\n }\n k === Inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || !1 === opts.insertMode) ? (pos.begin = seekPrevious(pos.begin),\n getMaskSet().validPositions[pos.begin] === undefined || getMaskSet().validPositions[pos.begin].input !== opts.groupSeparator && getMaskSet().validPositions[pos.begin].input !== opts.radixPoint || pos.begin--) : k === Inputmask.keyCode.DELETE && pos.begin === pos.end && (pos.end = isMask(pos.end, !0) ? pos.end + 1 : seekNext(pos.end) + 1,\n getMaskSet().validPositions[pos.begin] === undefined || getMaskSet().validPositions[pos.begin].input !== opts.groupSeparator && getMaskSet().validPositions[pos.begin].input !== opts.radixPoint || pos.end++),\n stripValidPositions(pos.begin, pos.end, !1, strict), !0 !== strict && function() {\n if (opts.keepStatic) {\n for (var validInputs = [], lastAlt = getLastValidPosition(-1, !0), positionsClone = $.extend(!0, {}, getMaskSet().validPositions), prevAltPos = getMaskSet().validPositions[lastAlt]; lastAlt >= 0; lastAlt--) {\n var altPos = getMaskSet().validPositions[lastAlt];\n if (altPos) {\n if (!0 !== altPos.generatedInput && /[0-9a-bA-Z]/.test(altPos.input) && validInputs.push(altPos.input),\n delete getMaskSet().validPositions[lastAlt], altPos.alternation !== undefined && altPos.locator[altPos.alternation] !== prevAltPos.locator[altPos.alternation]) break;\n prevAltPos = altPos;\n }\n }\n if (lastAlt > -1) for (getMaskSet().p = seekNext(getLastValidPosition(-1, !0)); validInputs.length > 0; ) {\n var keypress = new $.Event(\"keypress\");\n keypress.which = validInputs.pop().charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !1, !1, getMaskSet().p);\n } else getMaskSet().validPositions = $.extend(!0, {}, positionsClone);\n }\n }();\n var lvp = getLastValidPosition(pos.begin, !0);\n lvp < pos.begin ? getMaskSet().p = seekNext(lvp) : !0 !== strict && (getMaskSet().p = pos.begin);\n }\n function initializeColorMask(input) {\n function findCaretPos(clientx) {\n var caretPos, e = document.createElement(\"span\");\n for (var style in computedStyle) isNaN(style) && -1 !== style.indexOf(\"font\") && (e.style[style] = computedStyle[style]);\n e.style.textTransform = computedStyle.textTransform, e.style.letterSpacing = computedStyle.letterSpacing,\n e.style.position = \"absolute\", e.style.height = \"auto\", e.style.width = \"auto\",\n e.style.visibility = \"hidden\", e.style.whiteSpace = \"nowrap\", document.body.appendChild(e);\n var itl, inputText = input.inputmask._valueGet(), previousWidth = 0;\n for (caretPos = 0, itl = inputText.length; caretPos <= itl; caretPos++) {\n if (e.innerHTML += inputText.charAt(caretPos) || \"_\", e.offsetWidth >= clientx) {\n var offset1 = clientx - previousWidth, offset2 = e.offsetWidth - clientx;\n e.innerHTML = inputText.charAt(caretPos), offset1 -= e.offsetWidth / 3, caretPos = offset1 < offset2 ? caretPos - 1 : caretPos;\n break;\n }\n previousWidth = e.offsetWidth;\n }\n return document.body.removeChild(e), caretPos;\n }\n function position() {\n colorMask.style.position = \"absolute\", colorMask.style.top = offset.top + \"px\",\n colorMask.style.left = offset.left + \"px\", colorMask.style.width = parseInt(input.offsetWidth) - parseInt(computedStyle.paddingLeft) - parseInt(computedStyle.paddingRight) - parseInt(computedStyle.borderLeftWidth) - parseInt(computedStyle.borderRightWidth) + \"px\",\n colorMask.style.height = parseInt(input.offsetHeight) - parseInt(computedStyle.paddingTop) - parseInt(computedStyle.paddingBottom) - parseInt(computedStyle.borderTopWidth) - parseInt(computedStyle.borderBottomWidth) + \"px\",\n colorMask.style.lineHeight = colorMask.style.height, colorMask.style.zIndex = isNaN(computedStyle.zIndex) ? -1 : computedStyle.zIndex - 1,\n colorMask.style.webkitAppearance = \"textfield\", colorMask.style.mozAppearance = \"textfield\",\n colorMask.style.Appearance = \"textfield\";\n }\n var offset = $(input).position(), computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null);\n input.parentNode;\n colorMask = document.createElement(\"div\"), document.body.appendChild(colorMask);\n for (var style in computedStyle) computedStyle.hasOwnProperty(style) && isNaN(style) && \"cssText\" !== style && -1 == style.indexOf(\"webkit\") && (colorMask.style[style] = computedStyle[style]);\n input.style.backgroundColor = \"transparent\", input.style.color = \"transparent\",\n input.style.webkitAppearance = \"caret\", input.style.mozAppearance = \"caret\", input.style.Appearance = \"caret\",\n position(), $(window).on(\"resize\", function(e) {\n offset = $(input).position(), computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null),\n position();\n }), $(input).on(\"click\", function(e) {\n return caret(input, findCaretPos(e.clientX)), EventHandlers.clickEvent.call(this, [ e ]);\n }), $(input).on(\"keydown\", function(e) {\n e.shiftKey || !1 === opts.insertMode || setTimeout(function() {\n renderColorMask(input);\n }, 0);\n });\n }\n function renderColorMask(input, buffer, caretPos) {\n function handleStatic() {\n isStatic || null !== test.fn && testPos.input !== undefined ? isStatic && null !== test.fn && testPos.input !== undefined && (isStatic = !1,\n maskTemplate += \"</span>\") : (isStatic = !0, maskTemplate += \"<span class='im-static''>\");\n }\n if (colorMask !== undefined) {\n buffer = buffer || getBuffer(), caretPos === undefined ? caretPos = caret(input) : caretPos.begin === undefined && (caretPos = {\n begin: caretPos,\n end: caretPos\n });\n var maskTemplate = \"\", isStatic = !1;\n if (\"\" != buffer) {\n var ndxIntlzr, test, testPos, pos = 0, lvp = getLastValidPosition();\n do {\n pos === caretPos.begin && document.activeElement === input && (maskTemplate += \"<span class='im-caret' style='border-right-width: 1px;border-right-style: solid;'></span>\"),\n getMaskSet().validPositions[pos] ? (testPos = getMaskSet().validPositions[pos],\n test = testPos.match, ndxIntlzr = testPos.locator.slice(), handleStatic(), maskTemplate += testPos.input) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),\n test = testPos.match, ndxIntlzr = testPos.locator.slice(), (!1 === opts.jitMasking || pos < lvp || \"number\" == typeof opts.jitMasking && isFinite(opts.jitMasking) && opts.jitMasking > pos) && (handleStatic(),\n maskTemplate += getPlaceholder(pos, test))), pos++;\n } while ((maxLength === undefined || pos < maxLength) && (null !== test.fn || \"\" !== test.def) || lvp > pos);\n }\n colorMask.innerHTML = maskTemplate;\n }\n }\n maskset = maskset || this.maskset, opts = opts || this.opts;\n var undoValue, $el, maxLength, colorMask, valueBuffer, el = this.el, isRTL = this.isRTL, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, mouseEnter = !1, EventRuler = {\n on: function(input, eventName, eventHandler) {\n var ev = function(e) {\n if (this.inputmask === undefined && \"FORM\" !== this.nodeName) {\n var imOpts = $.data(this, \"_inputmask_opts\");\n imOpts ? new Inputmask(imOpts).mask(this) : EventRuler.off(this);\n } else {\n if (\"setvalue\" === e.type || \"FORM\" === this.nodeName || !(this.disabled || this.readOnly && !(\"keydown\" === e.type && e.ctrlKey && 67 === e.keyCode || !1 === opts.tabThrough && e.keyCode === Inputmask.keyCode.TAB))) {\n switch (e.type) {\n case \"input\":\n if (!0 === skipInputEvent) return skipInputEvent = !1, e.preventDefault();\n break;\n\n case \"keydown\":\n skipKeyPressEvent = !1, skipInputEvent = !1;\n break;\n\n case \"keypress\":\n if (!0 === skipKeyPressEvent) return e.preventDefault();\n skipKeyPressEvent = !0;\n break;\n\n case \"click\":\n if (iemobile || iphone) {\n var that = this, args = arguments;\n return setTimeout(function() {\n eventHandler.apply(that, args);\n }, 0), !1;\n }\n }\n var returnVal = eventHandler.apply(this, arguments);\n return !1 === returnVal && (e.preventDefault(), e.stopPropagation()), returnVal;\n }\n e.preventDefault();\n }\n };\n input.inputmask.events[eventName] = input.inputmask.events[eventName] || [], input.inputmask.events[eventName].push(ev),\n -1 !== $.inArray(eventName, [ \"submit\", \"reset\" ]) ? null != input.form && $(input.form).on(eventName, ev) : $(input).on(eventName, ev);\n },\n off: function(input, event) {\n if (input.inputmask && input.inputmask.events) {\n var events;\n event ? (events = [], events[event] = input.inputmask.events[event]) : events = input.inputmask.events,\n $.each(events, function(eventName, evArr) {\n for (;evArr.length > 0; ) {\n var ev = evArr.pop();\n -1 !== $.inArray(eventName, [ \"submit\", \"reset\" ]) ? null != input.form && $(input.form).off(eventName, ev) : $(input).off(eventName, ev);\n }\n delete input.inputmask.events[eventName];\n });\n }\n }\n }, EventHandlers = {\n keydownEvent: function(e) {\n var input = this, $input = $(input), k = e.keyCode, pos = caret(input);\n if (k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && k === Inputmask.keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === Inputmask.keyCode.X && !function(eventName) {\n var el = document.createElement(\"input\"), evName = \"on\" + eventName, isSupported = evName in el;\n return isSupported || (el.setAttribute(evName, \"return;\"), isSupported = \"function\" == typeof el[evName]),\n el = null, isSupported;\n }(\"cut\")) e.preventDefault(), handleRemove(input, k, pos), writeBuffer(input, getBuffer(!0), getMaskSet().p, e, input.inputmask._valueGet() !== getBuffer().join(\"\")),\n input.inputmask._valueGet() === getBufferTemplate().join(\"\") ? $input.trigger(\"cleared\") : !0 === isComplete(getBuffer()) && $input.trigger(\"complete\"); else if (k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN) {\n e.preventDefault();\n var caretPos = seekNext(getLastValidPosition());\n opts.insertMode || caretPos !== getMaskSet().maskLength || e.shiftKey || caretPos--,\n caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, !0);\n } else k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP ? (e.preventDefault(),\n caret(input, 0, e.shiftKey ? pos.begin : 0, !0)) : (opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || 90 === k && e.ctrlKey) && !0 !== e.altKey ? (checkVal(input, !0, !1, undoValue.split(\"\")),\n $input.trigger(\"click\")) : k !== Inputmask.keyCode.INSERT || e.shiftKey || e.ctrlKey ? !0 === opts.tabThrough && k === Inputmask.keyCode.TAB ? (!0 === e.shiftKey ? (null === getTest(pos.begin).match.fn && (pos.begin = seekNext(pos.begin)),\n pos.end = seekPrevious(pos.begin, !0), pos.begin = seekPrevious(pos.end, !0)) : (pos.begin = seekNext(pos.begin, !0),\n pos.end = seekNext(pos.begin, !0), pos.end < getMaskSet().maskLength && pos.end--),\n pos.begin < getMaskSet().maskLength && (e.preventDefault(), caret(input, pos.begin, pos.end))) : e.shiftKey || !1 === opts.insertMode && (k === Inputmask.keyCode.RIGHT ? setTimeout(function() {\n var caretPos = caret(input);\n caret(input, caretPos.begin);\n }, 0) : k === Inputmask.keyCode.LEFT && setTimeout(function() {\n var caretPos = caret(input);\n caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1);\n }, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin !== getMaskSet().maskLength ? pos.begin : pos.begin - 1));\n opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts), ignorable = -1 !== $.inArray(k, opts.ignorables);\n },\n keypressEvent: function(e, checkval, writeOut, strict, ndx) {\n var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;\n if (!(!0 === checkval || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable)) return k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join(\"\") && (undoValue = getBuffer().join(\"\"),\n setTimeout(function() {\n $input.trigger(\"change\");\n }, 0)), !0;\n if (k) {\n 46 === k && !1 === e.shiftKey && \"\" !== opts.radixPoint && (k = opts.radixPoint.charCodeAt(0));\n var forwardPosition, pos = checkval ? {\n begin: ndx,\n end: ndx\n } : caret(input), c = String.fromCharCode(k);\n getMaskSet().writeOutBuffer = !0;\n var valResult = isValid(pos, c, strict);\n if (!1 !== valResult && (resetMaskSet(!0), forwardPosition = valResult.caret !== undefined ? valResult.caret : checkval ? valResult.pos + 1 : seekNext(valResult.pos),\n getMaskSet().p = forwardPosition), !1 !== writeOut && (setTimeout(function() {\n opts.onKeyValidation.call(input, k, valResult, opts);\n }, 0), getMaskSet().writeOutBuffer && !1 !== valResult)) {\n var buffer = getBuffer();\n writeBuffer(input, buffer, opts.numericInput && valResult.caret === undefined ? seekPrevious(forwardPosition) : forwardPosition, e, !0 !== checkval),\n !0 !== checkval && setTimeout(function() {\n !0 === isComplete(buffer) && $input.trigger(\"complete\");\n }, 0);\n }\n if (e.preventDefault(), checkval) return valResult.forwardPosition = forwardPosition,\n valResult;\n }\n },\n pasteEvent: function(e) {\n var tempValue, input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(!0), caretPos = caret(input);\n isRTL && (tempValue = caretPos.end, caretPos.end = caretPos.begin, caretPos.begin = tempValue);\n var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);\n if (valueBeforeCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join(\"\") && (valueBeforeCaret = \"\"),\n valueAfterCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(caretPos.end).join(\"\") && (valueAfterCaret = \"\"),\n isRTL && (tempValue = valueBeforeCaret, valueBeforeCaret = valueAfterCaret, valueAfterCaret = tempValue),\n window.clipboardData && window.clipboardData.getData) inputValue = valueBeforeCaret + window.clipboardData.getData(\"Text\") + valueAfterCaret; else {\n if (!ev.clipboardData || !ev.clipboardData.getData) return !0;\n inputValue = valueBeforeCaret + ev.clipboardData.getData(\"text/plain\") + valueAfterCaret;\n }\n var pasteValue = inputValue;\n if ($.isFunction(opts.onBeforePaste)) {\n if (!1 === (pasteValue = opts.onBeforePaste(inputValue, opts))) return e.preventDefault();\n pasteValue || (pasteValue = inputValue);\n }\n return checkVal(input, !1, !1, isRTL ? pasteValue.split(\"\").reverse() : pasteValue.toString().split(\"\")),\n writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()), e, undoValue !== getBuffer().join(\"\")),\n !0 === isComplete(getBuffer()) && $input.trigger(\"complete\"), e.preventDefault();\n },\n inputFallBackEvent: function(e) {\n var input = this, inputValue = input.inputmask._valueGet();\n if (getBuffer().join(\"\") !== inputValue) {\n var caretPos = caret(input);\n if (\".\" === inputValue.charAt(caretPos.begin - 1) && \"\" !== opts.radixPoint && (inputValue = inputValue.split(\"\"),\n inputValue[caretPos.begin - 1] = opts.radixPoint.charAt(0), inputValue = inputValue.join(\"\")),\n inputValue.charAt(caretPos.begin - 1) === opts.radixPoint && inputValue.length > getBuffer().length) {\n var keypress = new $.Event(\"keypress\");\n return keypress.which = opts.radixPoint.charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !0, !1, caretPos.begin),\n !1;\n }\n if (inputValue = inputValue.replace(new RegExp(\"(\" + Inputmask.escapeRegex(getBufferTemplate().join(\"\")) + \")*\"), \"\"),\n iemobile) {\n var inputChar = inputValue.replace(getBuffer().join(\"\"), \"\");\n if (1 === inputChar.length) {\n var keypress = new $.Event(\"keypress\");\n return keypress.which = inputChar.charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !0, !1, getMaskSet().validPositions[caretPos.begin - 1] ? caretPos.begin : caretPos.begin - 1),\n !1;\n }\n }\n if (caretPos.begin > inputValue.length && (caret(input, inputValue.length), caretPos = caret(input)),\n getBuffer().length - inputValue.length != 1 || inputValue.charAt(caretPos.begin) === getBuffer()[caretPos.begin] || inputValue.charAt(caretPos.begin + 1) === getBuffer()[caretPos.begin] || isMask(caretPos.begin)) {\n var stickyParts = [], bufferTemplate = getMaskTemplate(!0, 1).join(\"\");\n for (stickyParts.push(inputValue.substr(0, caretPos.begin)), stickyParts.push(inputValue.substr(caretPos.begin)); null === inputValue.match(Inputmask.escapeRegex(bufferTemplate) + \"$\"); ) bufferTemplate = bufferTemplate.slice(1);\n inputValue = inputValue.replace(bufferTemplate, \"\"), $.isFunction(opts.onBeforeMask) && (inputValue = opts.onBeforeMask(inputValue, opts) || inputValue),\n checkVal(input, !0, !1, inputValue.split(\"\"), e);\n var currentPos = caret(input).begin, currentValue = input.inputmask._valueGet(), pos1 = currentValue.indexOf(stickyParts[0]);\n if (0 === pos1 && currentPos !== stickyParts[0].length) caret(input, stickyParts[0].length),\n android && setTimeout(function() {\n caret(input, stickyParts[0].length);\n }, 0); else {\n for (;null === currentValue.match(Inputmask.escapeRegex(stickyParts[1]) + \"$\"); ) stickyParts[1] = stickyParts[1].substr(1);\n var pos2 = currentValue.indexOf(stickyParts[1]);\n -1 !== pos2 && \"\" !== stickyParts[1] && currentPos > pos2 && pos2 > pos1 && (caret(input, pos2),\n android && setTimeout(function() {\n caret(input, pos2);\n }, 0));\n }\n !0 === isComplete(getBuffer()) && $(input).trigger(\"complete\");\n } else e.keyCode = Inputmask.keyCode.BACKSPACE, EventHandlers.keydownEvent.call(input, e);\n e.preventDefault();\n }\n },\n setValueEvent: function(e) {\n this.inputmask.refreshValue = !1;\n var input = this, value = input.inputmask._valueGet(!0);\n $.isFunction(opts.onBeforeMask) && (value = opts.onBeforeMask(value, opts) || value),\n value = value.split(\"\"), checkVal(input, !0, !1, isRTL ? value.reverse() : value),\n undoValue = getBuffer().join(\"\"), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join(\"\") && input.inputmask._valueSet(\"\");\n },\n focusEvent: function(e) {\n var input = this, nptValue = input.inputmask._valueGet();\n opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && \"\" === nptValue) && (input.inputmask._valueGet() !== getBuffer().join(\"\") ? writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())) : !1 === mouseEnter && caret(input, seekNext(getLastValidPosition()))),\n !0 === opts.positionCaretOnTab && !1 === mouseEnter && (writeBuffer(input, getBuffer(), caret(input)),\n EventHandlers.clickEvent.apply(input, [ e, !0 ])), undoValue = getBuffer().join(\"\");\n },\n mouseleaveEvent: function(e) {\n var input = this;\n if (mouseEnter = !1, opts.clearMaskOnLostFocus && document.activeElement !== input) {\n var buffer = getBuffer().slice(), nptValue = input.inputmask._valueGet();\n nptValue !== input.getAttribute(\"placeholder\") && \"\" !== nptValue && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join(\"\") ? buffer = [] : clearOptionalTail(buffer),\n writeBuffer(input, buffer));\n }\n },\n clickEvent: function(e, tabbed) {\n function doRadixFocus(clickPos) {\n if (\"\" !== opts.radixPoint) {\n var vps = getMaskSet().validPositions;\n if (vps[clickPos] === undefined || vps[clickPos].input === getPlaceholder(clickPos)) {\n if (clickPos < seekNext(-1)) return !0;\n var radixPos = $.inArray(opts.radixPoint, getBuffer());\n if (-1 !== radixPos) {\n for (var vp in vps) if (radixPos < vp && vps[vp].input !== getPlaceholder(vp)) return !1;\n return !0;\n }\n }\n }\n return !1;\n }\n var input = this;\n setTimeout(function() {\n if (document.activeElement === input) {\n var selectedCaret = caret(input);\n if (tabbed && (isRTL ? selectedCaret.end = selectedCaret.begin : selectedCaret.begin = selectedCaret.end),\n selectedCaret.begin === selectedCaret.end) switch (opts.positionCaretOnClick) {\n case \"none\":\n break;\n\n case \"radixFocus\":\n if (doRadixFocus(selectedCaret.begin)) {\n var radixPos = getBuffer().join(\"\").indexOf(opts.radixPoint);\n caret(input, opts.numericInput ? seekNext(radixPos) : radixPos);\n break;\n }\n\n default:\n var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, !0), lastPosition = seekNext(lvclickPosition);\n if (clickPosition < lastPosition) caret(input, isMask(clickPosition) || isMask(clickPosition - 1) ? clickPosition : seekNext(clickPosition)); else {\n var placeholder = getPlaceholder(lastPosition);\n (\"\" !== placeholder && getBuffer()[lastPosition] !== placeholder && !0 !== getTest(lastPosition).match.optionalQuantifier || !isMask(lastPosition) && getTest(lastPosition).match.def === placeholder) && (lastPosition = seekNext(lastPosition)),\n caret(input, lastPosition);\n }\n }\n }\n }, 0);\n },\n dblclickEvent: function(e) {\n var input = this;\n setTimeout(function() {\n caret(input, 0, seekNext(getLastValidPosition()));\n }, 0);\n },\n cutEvent: function(e) {\n var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e, clipboardData = window.clipboardData || ev.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end);\n clipboardData.setData(\"text\", isRTL ? clipData.reverse().join(\"\") : clipData.join(\"\")),\n document.execCommand && document.execCommand(\"copy\"), handleRemove(input, Inputmask.keyCode.DELETE, pos),\n writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join(\"\")),\n input.inputmask._valueGet() === getBufferTemplate().join(\"\") && $input.trigger(\"cleared\");\n },\n blurEvent: function(e) {\n var $input = $(this), input = this;\n if (input.inputmask) {\n var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();\n undoValue !== buffer.join(\"\") && setTimeout(function() {\n $input.trigger(\"change\"), undoValue = buffer.join(\"\");\n }, 0), \"\" !== nptValue && (opts.clearMaskOnLostFocus && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join(\"\") ? buffer = [] : clearOptionalTail(buffer)),\n !1 === isComplete(buffer) && (setTimeout(function() {\n $input.trigger(\"incomplete\");\n }, 0), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())),\n writeBuffer(input, buffer, undefined, e));\n }\n },\n mouseenterEvent: function(e) {\n var input = this;\n mouseEnter = !0, document.activeElement !== input && opts.showMaskOnHover && input.inputmask._valueGet() !== getBuffer().join(\"\") && writeBuffer(input, getBuffer());\n },\n submitEvent: function(e) {\n undoValue !== getBuffer().join(\"\") && $el.trigger(\"change\"), opts.clearMaskOnLostFocus && -1 === getLastValidPosition() && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join(\"\") && el.inputmask._valueSet(\"\"),\n opts.removeMaskOnSubmit && (el.inputmask._valueSet(el.inputmask.unmaskedvalue(), !0),\n setTimeout(function() {\n writeBuffer(el, getBuffer());\n }, 0));\n },\n resetEvent: function(e) {\n el.inputmask.refreshValue = !0, setTimeout(function() {\n $el.trigger(\"setvalue\");\n }, 0);\n }\n };\n if (actionObj !== undefined) switch (actionObj.action) {\n case \"isComplete\":\n return el = actionObj.el, isComplete(getBuffer());\n\n case \"unmaskedvalue\":\n return el !== undefined && actionObj.value === undefined || (valueBuffer = actionObj.value,\n valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(valueBuffer, opts) || valueBuffer : valueBuffer).split(\"\"),\n checkVal(undefined, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite(undefined, getBuffer(), 0, opts)),\n unmaskedvalue(el);\n\n case \"mask\":\n !function(elem) {\n EventRuler.off(elem);\n var isSupported = function(input, opts) {\n var elementType = input.getAttribute(\"type\"), isSupported = \"INPUT\" === input.tagName && -1 !== $.inArray(elementType, opts.supportsInputType) || input.isContentEditable || \"TEXTAREA\" === input.tagName;\n if (!isSupported) if (\"INPUT\" === input.tagName) {\n var el = document.createElement(\"input\");\n el.setAttribute(\"type\", elementType), isSupported = \"text\" === el.type, el = null;\n } else isSupported = \"partial\";\n return !1 !== isSupported && function(npt) {\n function getter() {\n return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== getLastValidPosition() || !0 !== opts.nullable ? document.activeElement === this && opts.clearMaskOnLostFocus ? (isRTL ? clearOptionalTail(getBuffer().slice()).reverse() : clearOptionalTail(getBuffer().slice())).join(\"\") : valueGet.call(this) : \"\" : valueGet.call(this);\n }\n function setter(value) {\n valueSet.call(this, value), this.inputmask && $(this).trigger(\"setvalue\");\n }\n var valueGet, valueSet;\n if (!npt.inputmask.__valueGet) {\n if (!0 !== opts.noValuePatching) {\n if (Object.getOwnPropertyDescriptor) {\n \"function\" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = \"object\" == typeof \"test\".__proto__ ? function(object) {\n return object.__proto__;\n } : function(object) {\n return object.constructor.prototype;\n });\n var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), \"value\") : undefined;\n valueProperty && valueProperty.get && valueProperty.set ? (valueGet = valueProperty.get,\n valueSet = valueProperty.set, Object.defineProperty(npt, \"value\", {\n get: getter,\n set: setter,\n configurable: !0\n })) : \"INPUT\" !== npt.tagName && (valueGet = function() {\n return this.textContent;\n }, valueSet = function(value) {\n this.textContent = value;\n }, Object.defineProperty(npt, \"value\", {\n get: getter,\n set: setter,\n configurable: !0\n }));\n } else document.__lookupGetter__ && npt.__lookupGetter__(\"value\") && (valueGet = npt.__lookupGetter__(\"value\"),\n valueSet = npt.__lookupSetter__(\"value\"), npt.__defineGetter__(\"value\", getter),\n npt.__defineSetter__(\"value\", setter));\n npt.inputmask.__valueGet = valueGet, npt.inputmask.__valueSet = valueSet;\n }\n npt.inputmask._valueGet = function(overruleRTL) {\n return isRTL && !0 !== overruleRTL ? valueGet.call(this.el).split(\"\").reverse().join(\"\") : valueGet.call(this.el);\n }, npt.inputmask._valueSet = function(value, overruleRTL) {\n valueSet.call(this.el, null === value || value === undefined ? \"\" : !0 !== overruleRTL && isRTL ? value.split(\"\").reverse().join(\"\") : value);\n }, valueGet === undefined && (valueGet = function() {\n return this.value;\n }, valueSet = function(value) {\n this.value = value;\n }, function(type) {\n if ($.valHooks && ($.valHooks[type] === undefined || !0 !== $.valHooks[type].inputmaskpatch)) {\n var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {\n return elem.value;\n }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {\n return elem.value = value, elem;\n };\n $.valHooks[type] = {\n get: function(elem) {\n if (elem.inputmask) {\n if (elem.inputmask.opts.autoUnmask) return elem.inputmask.unmaskedvalue();\n var result = valhookGet(elem);\n return -1 !== getLastValidPosition(undefined, undefined, elem.inputmask.maskset.validPositions) || !0 !== opts.nullable ? result : \"\";\n }\n return valhookGet(elem);\n },\n set: function(elem, value) {\n var result, $elem = $(elem);\n return result = valhookSet(elem, value), elem.inputmask && $elem.trigger(\"setvalue\"),\n result;\n },\n inputmaskpatch: !0\n };\n }\n }(npt.type), function(npt) {\n EventRuler.on(npt, \"mouseenter\", function(event) {\n var $input = $(this);\n this.inputmask._valueGet() !== getBuffer().join(\"\") && $input.trigger(\"setvalue\");\n });\n }(npt));\n }\n }(input), isSupported;\n }(elem, opts);\n if (!1 !== isSupported && (el = elem, $el = $(el), !0 === opts.colorMask && initializeColorMask(el),\n android && (el.hasOwnProperty(\"inputmode\") && (el.inputmode = opts.inputmode, el.setAttribute(\"inputmode\", opts.inputmode)),\n \"rtfm\" === opts.androidHack && (!0 !== opts.colorMask && initializeColorMask(el),\n el.type = \"password\")), !0 === isSupported && (EventRuler.on(el, \"submit\", EventHandlers.submitEvent),\n EventRuler.on(el, \"reset\", EventHandlers.resetEvent), EventRuler.on(el, \"mouseenter\", EventHandlers.mouseenterEvent),\n EventRuler.on(el, \"blur\", EventHandlers.blurEvent), EventRuler.on(el, \"focus\", EventHandlers.focusEvent),\n EventRuler.on(el, \"mouseleave\", EventHandlers.mouseleaveEvent), !0 !== opts.colorMask && EventRuler.on(el, \"click\", EventHandlers.clickEvent),\n EventRuler.on(el, \"dblclick\", EventHandlers.dblclickEvent), EventRuler.on(el, \"paste\", EventHandlers.pasteEvent),\n EventRuler.on(el, \"dragdrop\", EventHandlers.pasteEvent), EventRuler.on(el, \"drop\", EventHandlers.pasteEvent),\n EventRuler.on(el, \"cut\", EventHandlers.cutEvent), EventRuler.on(el, \"complete\", opts.oncomplete),\n EventRuler.on(el, \"incomplete\", opts.onincomplete), EventRuler.on(el, \"cleared\", opts.oncleared),\n android || !0 === opts.inputEventOnly || (EventRuler.on(el, \"keydown\", EventHandlers.keydownEvent),\n EventRuler.on(el, \"keypress\", EventHandlers.keypressEvent)), EventRuler.on(el, \"compositionstart\", $.noop),\n EventRuler.on(el, \"compositionupdate\", $.noop), EventRuler.on(el, \"compositionend\", $.noop),\n EventRuler.on(el, \"keyup\", $.noop), EventRuler.on(el, \"input\", EventHandlers.inputFallBackEvent),\n EventRuler.on(el, \"beforeinput\", $.noop)), EventRuler.on(el, \"setvalue\", EventHandlers.setValueEvent),\n undoValue = getBufferTemplate().join(\"\"), \"\" !== el.inputmask._valueGet(!0) || !1 === opts.clearMaskOnLostFocus || document.activeElement === el)) {\n var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(el.inputmask._valueGet(!0), opts) || el.inputmask._valueGet(!0) : el.inputmask._valueGet(!0);\n \"\" !== initialValue && checkVal(el, !0, !1, isRTL ? initialValue.split(\"\").reverse() : initialValue.split(\"\"));\n var buffer = getBuffer().slice();\n !1 === isComplete(buffer) && opts.clearIncomplete && resetMaskSet(), opts.clearMaskOnLostFocus && document.activeElement !== el && (-1 === getLastValidPosition() ? buffer = [] : clearOptionalTail(buffer)),\n writeBuffer(el, buffer), document.activeElement === el && caret(el, seekNext(getLastValidPosition()));\n }\n }(el);\n break;\n\n case \"format\":\n return valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(actionObj.value, opts) || actionObj.value : actionObj.value).split(\"\"),\n checkVal(undefined, !0, !1, isRTL ? valueBuffer.reverse() : valueBuffer), actionObj.metadata ? {\n value: isRTL ? getBuffer().slice().reverse().join(\"\") : getBuffer().join(\"\"),\n metadata: maskScope.call(this, {\n action: \"getmetadata\"\n }, maskset, opts)\n } : isRTL ? getBuffer().slice().reverse().join(\"\") : getBuffer().join(\"\");\n\n case \"isValid\":\n actionObj.value ? (valueBuffer = actionObj.value.split(\"\"), checkVal(undefined, !0, !0, isRTL ? valueBuffer.reverse() : valueBuffer)) : actionObj.value = getBuffer().join(\"\");\n for (var buffer = getBuffer(), rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ;\n return buffer.splice(rl, lmib + 1 - rl), isComplete(buffer) && actionObj.value === getBuffer().join(\"\");\n\n case \"getemptymask\":\n return getBufferTemplate().join(\"\");\n\n case \"remove\":\n if (el && el.inputmask) {\n $el = $(el), el.inputmask._valueSet(opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(!0)),\n EventRuler.off(el);\n Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), \"value\") && el.inputmask.__valueGet && Object.defineProperty(el, \"value\", {\n get: el.inputmask.__valueGet,\n set: el.inputmask.__valueSet,\n configurable: !0\n }) : document.__lookupGetter__ && el.__lookupGetter__(\"value\") && el.inputmask.__valueGet && (el.__defineGetter__(\"value\", el.inputmask.__valueGet),\n el.__defineSetter__(\"value\", el.inputmask.__valueSet)), el.inputmask = undefined;\n }\n return el;\n\n case \"getmetadata\":\n if ($.isArray(maskset.metadata)) {\n var maskTarget = getMaskTemplate(!0, 0, !1).join(\"\");\n return $.each(maskset.metadata, function(ndx, mtdt) {\n if (mtdt.mask === maskTarget) return maskTarget = mtdt, !1;\n }), maskTarget;\n }\n return maskset.metadata;\n }\n }\n var ua = navigator.userAgent, mobile = /mobile/i.test(ua), iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile, android = /android/i.test(ua) && !iemobile;\n return Inputmask.prototype = {\n dataAttribute: \"data-inputmask\",\n defaults: {\n placeholder: \"_\",\n optionalmarker: {\n start: \"[\",\n end: \"]\"\n },\n quantifiermarker: {\n start: \"{\",\n end: \"}\"\n },\n groupmarker: {\n start: \"(\",\n end: \")\"\n },\n alternatormarker: \"|\",\n escapeChar: \"\\\\\",\n mask: null,\n regex: null,\n oncomplete: $.noop,\n onincomplete: $.noop,\n oncleared: $.noop,\n repeat: 0,\n greedy: !0,\n autoUnmask: !1,\n removeMaskOnSubmit: !1,\n clearMaskOnLostFocus: !0,\n insertMode: !0,\n clearIncomplete: !1,\n alias: null,\n onKeyDown: $.noop,\n onBeforeMask: null,\n onBeforePaste: function(pastedValue, opts) {\n return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(pastedValue, opts) : pastedValue;\n },\n onBeforeWrite: null,\n onUnMask: null,\n showMaskOnFocus: !0,\n showMaskOnHover: !0,\n onKeyValidation: $.noop,\n skipOptionalPartCharacter: \" \",\n numericInput: !1,\n rightAlign: !1,\n undoOnEscape: !0,\n radixPoint: \"\",\n radixPointDefinitionSymbol: undefined,\n groupSeparator: \"\",\n keepStatic: null,\n positionCaretOnTab: !0,\n tabThrough: !1,\n supportsInputType: [ \"text\", \"tel\", \"password\" ],\n ignorables: [ 8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 229 ],\n isComplete: null,\n canClearPosition: $.noop,\n preValidation: null,\n postValidation: null,\n staticDefinitionSymbol: undefined,\n jitMasking: !1,\n nullable: !0,\n inputEventOnly: !1,\n noValuePatching: !1,\n positionCaretOnClick: \"lvp\",\n casing: null,\n inputmode: \"verbatim\",\n colorMask: !1,\n androidHack: !1\n },\n definitions: {\n \"9\": {\n validator: \"[0-9]\",\n cardinality: 1,\n definitionSymbol: \"*\"\n },\n a: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n cardinality: 1,\n definitionSymbol: \"*\"\n },\n \"*\": {\n validator: function() {\n return !0;\n },\n cardinality: 1\n }\n },\n aliases: {},\n masksCache: {},\n mask: function(elems) {\n function importAttributeOptions(npt, opts, userOptions, dataAttribute) {\n function importOption(option, optionData) {\n null !== (optionData = optionData !== undefined ? optionData : npt.getAttribute(dataAttribute + \"-\" + option)) && (\"string\" == typeof optionData && (0 === option.indexOf(\"on\") ? optionData = window[optionData] : \"false\" === optionData ? optionData = !1 : \"true\" === optionData && (optionData = !0)),\n userOptions[option] = optionData);\n }\n (\"rtl\" === npt.dir || opts.rightAlign) && (npt.style.textAlign = \"right\"), (\"rtl\" === npt.dir || opts.numericInput) && (npt.dir = \"ltr\",\n npt.removeAttribute(\"dir\"), opts.isRTL = !0);\n var option, dataoptions, optionData, p, attrOptions = npt.getAttribute(dataAttribute);\n if (attrOptions && \"\" !== attrOptions && (attrOptions = attrOptions.replace(new RegExp(\"'\", \"g\"), '\"'),\n dataoptions = JSON.parse(\"{\" + attrOptions + \"}\")), dataoptions) {\n optionData = undefined;\n for (p in dataoptions) if (\"alias\" === p.toLowerCase()) {\n optionData = dataoptions[p];\n break;\n }\n }\n importOption(\"alias\", optionData), userOptions.alias && resolveAlias(userOptions.alias, userOptions, opts);\n for (option in opts) {\n if (dataoptions) {\n optionData = undefined;\n for (p in dataoptions) if (p.toLowerCase() === option.toLowerCase()) {\n optionData = dataoptions[p];\n break;\n }\n }\n importOption(option, optionData);\n }\n return $.extend(!0, opts, userOptions), opts;\n }\n var that = this;\n return \"string\" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)),\n elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) {\n var scopedOpts = $.extend(!0, {}, that.opts);\n importAttributeOptions(el, scopedOpts, $.extend(!0, {}, that.userOptions), that.dataAttribute);\n var maskset = generateMaskSet(scopedOpts, that.noMasksCache);\n maskset !== undefined && (el.inputmask !== undefined && el.inputmask.remove(), el.inputmask = new Inputmask(undefined, undefined, !0),\n el.inputmask.opts = scopedOpts, el.inputmask.noMasksCache = that.noMasksCache, el.inputmask.userOptions = $.extend(!0, {}, that.userOptions),\n el.inputmask.isRTL = scopedOpts.isRTL, el.inputmask.el = el, el.inputmask.maskset = maskset,\n $.data(el, \"_inputmask_opts\", scopedOpts), maskScope.call(el.inputmask, {\n action: \"mask\"\n }));\n }), elems && elems[0] ? elems[0].inputmask || this : this;\n },\n option: function(options, noremask) {\n return \"string\" == typeof options ? this.opts[options] : \"object\" == typeof options ? ($.extend(this.userOptions, options),\n this.el && !0 !== noremask && this.mask(this.el), this) : void 0;\n },\n unmaskedvalue: function(value) {\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),\n maskScope.call(this, {\n action: \"unmaskedvalue\",\n value: value\n });\n },\n remove: function() {\n return maskScope.call(this, {\n action: \"remove\"\n });\n },\n getemptymask: function() {\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),\n maskScope.call(this, {\n action: \"getemptymask\"\n });\n },\n hasMaskedValue: function() {\n return !this.opts.autoUnmask;\n },\n isComplete: function() {\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),\n maskScope.call(this, {\n action: \"isComplete\"\n });\n },\n getmetadata: function() {\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),\n maskScope.call(this, {\n action: \"getmetadata\"\n });\n },\n isValid: function(value) {\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),\n maskScope.call(this, {\n action: \"isValid\",\n value: value\n });\n },\n format: function(value, metadata) {\n return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),\n maskScope.call(this, {\n action: \"format\",\n value: value,\n metadata: metadata\n });\n },\n analyseMask: function(mask, regexMask, opts) {\n function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {\n this.matches = [], this.openGroup = isGroup || !1, this.alternatorGroup = !1, this.isGroup = isGroup || !1,\n this.isOptional = isOptional || !1, this.isQuantifier = isQuantifier || !1, this.isAlternator = isAlternator || !1,\n this.quantifier = {\n min: 1,\n max: 1\n };\n }\n function insertTestDefinition(mtoken, element, position) {\n position = position !== undefined ? position : mtoken.matches.length;\n var prevMatch = mtoken.matches[position - 1];\n if (regexMask) 0 === element.indexOf(\"[\") || escaped ? mtoken.matches.splice(position++, 0, {\n fn: new RegExp(element, opts.casing ? \"i\" : \"\"),\n cardinality: 1,\n optionality: mtoken.isOptional,\n newBlockMarker: prevMatch === undefined || prevMatch.def !== element,\n casing: null,\n def: element,\n placeholder: undefined,\n nativeDef: element\n }) : $.each(element.split(\"\"), function(ndx, lmnt) {\n prevMatch = mtoken.matches[position - 1], mtoken.matches.splice(position++, 0, {\n fn: null,\n cardinality: 0,\n optionality: mtoken.isOptional,\n newBlockMarker: prevMatch === undefined || prevMatch.def !== lmnt && null !== prevMatch.fn,\n casing: null,\n def: opts.staticDefinitionSymbol || lmnt,\n placeholder: opts.staticDefinitionSymbol !== undefined ? lmnt : undefined,\n nativeDef: lmnt\n });\n }), escaped = !1; else {\n var maskdef = (opts.definitions ? opts.definitions[element] : undefined) || Inputmask.prototype.definitions[element];\n if (maskdef && !escaped) {\n for (var prevalidators = maskdef.prevalidator, prevalidatorsL = prevalidators ? prevalidators.length : 0, i = 1; i < maskdef.cardinality; i++) {\n var prevalidator = prevalidatorsL >= i ? prevalidators[i - 1] : [], validator = prevalidator.validator, cardinality = prevalidator.cardinality;\n mtoken.matches.splice(position++, 0, {\n fn: validator ? \"string\" == typeof validator ? new RegExp(validator, opts.casing ? \"i\" : \"\") : new function() {\n this.test = validator;\n }() : new RegExp(\".\"),\n cardinality: cardinality || 1,\n optionality: mtoken.isOptional,\n newBlockMarker: prevMatch === undefined || prevMatch.def !== (maskdef.definitionSymbol || element),\n casing: maskdef.casing,\n def: maskdef.definitionSymbol || element,\n placeholder: maskdef.placeholder,\n nativeDef: element\n }), prevMatch = mtoken.matches[position - 1];\n }\n mtoken.matches.splice(position++, 0, {\n fn: maskdef.validator ? \"string\" == typeof maskdef.validator ? new RegExp(maskdef.validator, opts.casing ? \"i\" : \"\") : new function() {\n this.test = maskdef.validator;\n }() : new RegExp(\".\"),\n cardinality: maskdef.cardinality,\n optionality: mtoken.isOptional,\n newBlockMarker: prevMatch === undefined || prevMatch.def !== (maskdef.definitionSymbol || element),\n casing: maskdef.casing,\n def: maskdef.definitionSymbol || element,\n placeholder: maskdef.placeholder,\n nativeDef: element\n });\n } else mtoken.matches.splice(position++, 0, {\n fn: null,\n cardinality: 0,\n optionality: mtoken.isOptional,\n newBlockMarker: prevMatch === undefined || prevMatch.def !== element && null !== prevMatch.fn,\n casing: null,\n def: opts.staticDefinitionSymbol || element,\n placeholder: opts.staticDefinitionSymbol !== undefined ? element : undefined,\n nativeDef: element\n }), escaped = !1;\n }\n }\n function verifyGroupMarker(maskToken) {\n maskToken && maskToken.matches && $.each(maskToken.matches, function(ndx, token) {\n var nextToken = maskToken.matches[ndx + 1];\n (nextToken === undefined || nextToken.matches === undefined || !1 === nextToken.isQuantifier) && token && token.isGroup && (token.isGroup = !1,\n regexMask || (insertTestDefinition(token, opts.groupmarker.start, 0), !0 !== token.openGroup && insertTestDefinition(token, opts.groupmarker.end))),\n verifyGroupMarker(token);\n });\n }\n function defaultCase() {\n if (openenings.length > 0) {\n if (currentOpeningToken = openenings[openenings.length - 1], insertTestDefinition(currentOpeningToken, m),\n currentOpeningToken.isAlternator) {\n alternator = openenings.pop();\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1;\n openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1],\n currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);\n }\n } else insertTestDefinition(currentToken, m);\n }\n function reverseTokens(maskToken) {\n maskToken.matches = maskToken.matches.reverse();\n for (var match in maskToken.matches) if (maskToken.matches.hasOwnProperty(match)) {\n var intMatch = parseInt(match);\n if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {\n var qt = maskToken.matches[match];\n maskToken.matches.splice(match, 1), maskToken.matches.splice(intMatch + 1, 0, qt);\n }\n maskToken.matches[match].matches !== undefined ? maskToken.matches[match] = reverseTokens(maskToken.matches[match]) : maskToken.matches[match] = function(st) {\n return st === opts.optionalmarker.start ? st = opts.optionalmarker.end : st === opts.optionalmarker.end ? st = opts.optionalmarker.start : st === opts.groupmarker.start ? st = opts.groupmarker.end : st === opts.groupmarker.end && (st = opts.groupmarker.start),\n st;\n }(maskToken.matches[match]);\n }\n return maskToken;\n }\n var match, m, openingToken, currentOpeningToken, alternator, lastMatch, groupToken, tokenizer = /(?:[?*+]|\\{[0-9\\+\\*]+(?:,[0-9\\+\\*]*)?\\})|[^.?*+^${[]()|\\\\]+|./g, regexTokenizer = /\\[\\^?]?(?:[^\\\\\\]]+|\\\\[\\S\\s]?)*]?|\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\\S\\s]?)|\\((?:\\?[:=!]?)?|(?:[?*+]|\\{[0-9]+(?:,[0-9]*)?\\})\\??|[^.?*+^${[()|\\\\]+|./g, escaped = !1, currentToken = new MaskToken(), openenings = [], maskTokens = [];\n for (regexMask && (opts.optionalmarker.start = undefined, opts.optionalmarker.end = undefined); match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask); ) {\n if (m = match[0], regexMask) switch (m.charAt(0)) {\n case \"?\":\n m = \"{0,1}\";\n break;\n\n case \"+\":\n case \"*\":\n m = \"{\" + m + \"}\";\n }\n if (escaped) defaultCase(); else switch (m.charAt(0)) {\n case opts.escapeChar:\n escaped = !0, regexMask && defaultCase();\n break;\n\n case opts.optionalmarker.end:\n case opts.groupmarker.end:\n if (openingToken = openenings.pop(), openingToken.openGroup = !1, openingToken !== undefined) if (openenings.length > 0) {\n if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(openingToken),\n currentOpeningToken.isAlternator) {\n alternator = openenings.pop();\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1,\n alternator.matches[mndx].alternatorGroup = !1;\n openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1],\n currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);\n }\n } else currentToken.matches.push(openingToken); else defaultCase();\n break;\n\n case opts.optionalmarker.start:\n openenings.push(new MaskToken(!1, !0));\n break;\n\n case opts.groupmarker.start:\n openenings.push(new MaskToken(!0));\n break;\n\n case opts.quantifiermarker.start:\n var quantifier = new MaskToken(!1, !1, !0);\n m = m.replace(/[{}]/g, \"\");\n var mq = m.split(\",\"), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);\n if (\"*\" !== mq1 && \"+\" !== mq1 || (mq0 = \"*\" === mq1 ? 0 : 1), quantifier.quantifier = {\n min: mq0,\n max: mq1\n }, openenings.length > 0) {\n var matches = openenings[openenings.length - 1].matches;\n match = matches.pop(), match.isGroup || (groupToken = new MaskToken(!0), groupToken.matches.push(match),\n match = groupToken), matches.push(match), matches.push(quantifier);\n } else match = currentToken.matches.pop(), match.isGroup || (groupToken = new MaskToken(!0),\n groupToken.matches.push(match), match = groupToken), currentToken.matches.push(match),\n currentToken.matches.push(quantifier);\n break;\n\n case opts.alternatormarker:\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];\n lastMatch = currentOpeningToken.openGroup && (subToken.matches === undefined || !1 === subToken.isGroup && !1 === subToken.isAlternator) ? openenings.pop() : currentOpeningToken.matches.pop();\n } else lastMatch = currentToken.matches.pop();\n if (lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(),\n lastMatch.alternatorGroup = !1) : alternator = new MaskToken(!1, !1, !1, !0), alternator.matches.push(lastMatch),\n openenings.push(alternator), lastMatch.openGroup) {\n lastMatch.openGroup = !1;\n var alternatorGroup = new MaskToken(!0);\n alternatorGroup.alternatorGroup = !0, openenings.push(alternatorGroup);\n }\n break;\n\n default:\n defaultCase();\n }\n }\n for (;openenings.length > 0; ) openingToken = openenings.pop(), currentToken.matches.push(openingToken);\n return currentToken.matches.length > 0 && (verifyGroupMarker(currentToken), maskTokens.push(currentToken)),\n (opts.numericInput || opts.isRTL) && reverseTokens(maskTokens[0]), maskTokens;\n }\n }, Inputmask.extendDefaults = function(options) {\n $.extend(!0, Inputmask.prototype.defaults, options);\n }, Inputmask.extendDefinitions = function(definition) {\n $.extend(!0, Inputmask.prototype.definitions, definition);\n }, Inputmask.extendAliases = function(alias) {\n $.extend(!0, Inputmask.prototype.aliases, alias);\n }, Inputmask.format = function(value, options, metadata) {\n return Inputmask(options).format(value, metadata);\n }, Inputmask.unmask = function(value, options) {\n return Inputmask(options).unmaskedvalue(value);\n }, Inputmask.isValid = function(value, options) {\n return Inputmask(options).isValid(value);\n }, Inputmask.remove = function(elems) {\n $.each(elems, function(ndx, el) {\n el.inputmask && el.inputmask.remove();\n });\n }, Inputmask.escapeRegex = function(str) {\n var specials = [ \"/\", \".\", \"*\", \"+\", \"?\", \"|\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", \"\\\\\", \"$\", \"^\" ];\n return str.replace(new RegExp(\"(\\\\\" + specials.join(\"|\\\\\") + \")\", \"gim\"), \"\\\\$1\");\n }, Inputmask.keyCode = {\n ALT: 18,\n BACKSPACE: 8,\n BACKSPACE_SAFARI: 127,\n CAPS_LOCK: 20,\n COMMA: 188,\n COMMAND: 91,\n COMMAND_LEFT: 91,\n COMMAND_RIGHT: 93,\n CONTROL: 17,\n DELETE: 46,\n DOWN: 40,\n END: 35,\n ENTER: 13,\n ESCAPE: 27,\n HOME: 36,\n INSERT: 45,\n LEFT: 37,\n MENU: 93,\n NUMPAD_ADD: 107,\n NUMPAD_DECIMAL: 110,\n NUMPAD_DIVIDE: 111,\n NUMPAD_ENTER: 108,\n NUMPAD_MULTIPLY: 106,\n NUMPAD_SUBTRACT: 109,\n PAGE_DOWN: 34,\n PAGE_UP: 33,\n PERIOD: 190,\n RIGHT: 39,\n SHIFT: 16,\n SPACE: 32,\n TAB: 9,\n UP: 38,\n WINDOWS: 91,\n X: 88\n }, Inputmask;\n});","/*!\n* jquery.inputmask.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2017 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 3.3.6-49\n*/\n\n!function(factory) {\n factory(jQuery, window.Inputmask);\n}(function($, Inputmask) {\n return void 0 === $.fn.inputmask && ($.fn.inputmask = function(fn, options) {\n var nptmask, input = this[0];\n if (void 0 === options && (options = {}), \"string\" == typeof fn) switch (fn) {\n case \"unmaskedvalue\":\n return input && input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();\n\n case \"remove\":\n return this.each(function() {\n this.inputmask && this.inputmask.remove();\n });\n\n case \"getemptymask\":\n return input && input.inputmask ? input.inputmask.getemptymask() : \"\";\n\n case \"hasMaskedValue\":\n return !(!input || !input.inputmask) && input.inputmask.hasMaskedValue();\n\n case \"isComplete\":\n return !input || !input.inputmask || input.inputmask.isComplete();\n\n case \"getmetadata\":\n return input && input.inputmask ? input.inputmask.getmetadata() : void 0;\n\n case \"setvalue\":\n $(input).val(options), input && void 0 === input.inputmask && $(input).triggerHandler(\"setvalue\");\n break;\n\n case \"option\":\n if (\"string\" != typeof options) return this.each(function() {\n if (void 0 !== this.inputmask) return this.inputmask.option(options);\n });\n if (input && void 0 !== input.inputmask) return input.inputmask.option(options);\n break;\n\n default:\n return options.alias = fn, nptmask = new Inputmask(options), this.each(function() {\n nptmask.mask(this);\n });\n } else {\n if (\"object\" == typeof fn) return nptmask = new Inputmask(fn), void 0 === fn.mask && void 0 === fn.alias ? this.each(function() {\n if (void 0 !== this.inputmask) return this.inputmask.option(fn);\n nptmask.mask(this);\n }) : this.each(function() {\n nptmask.mask(this);\n });\n if (void 0 === fn) return this.each(function() {\n nptmask = new Inputmask(options), nptmask.mask(this);\n });\n }\n }), $.fn.inputmask;\n});","/*!\n PowerTip v1.3.0 (2017-01-15)\n https://stevenbenner.github.io/jquery-powertip/\n Copyright (c) 2017 Steven Benner (http://stevenbenner.com/).\n Released under MIT license.\n https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt\n*/\n(function(root, factory) {\n\t// support loading the plugin via common patterns\n\tif (typeof define === 'function' && define.amd) {\n\t\t// load the plugin as an amd module\n\t\tdefine([ 'jquery' ], factory);\n\t} else if (typeof module === 'object' && module.exports) {\n\t\t// load the plugin as a commonjs module\n\t\tmodule.exports = factory(require('jquery'));\n\t} else {\n\t\t// load the plugin as a global\n\t\tfactory(root.jQuery);\n\t}\n}(this, function($) {\n\n\t// useful private variables\n\tvar $document = $(document),\n\t\t$window = $(window),\n\t\t$body = $('body');\n\n\t// constants\n\tvar DATA_DISPLAYCONTROLLER = 'displayController',\n\t\tDATA_HASACTIVEHOVER = 'hasActiveHover',\n\t\tDATA_FORCEDOPEN = 'forcedOpen',\n\t\tDATA_HASMOUSEMOVE = 'hasMouseMove',\n\t\tDATA_MOUSEONTOTIP = 'mouseOnToPopup',\n\t\tDATA_ORIGINALTITLE = 'originalTitle',\n\t\tDATA_POWERTIP = 'powertip',\n\t\tDATA_POWERTIPJQ = 'powertipjq',\n\t\tDATA_POWERTIPTARGET = 'powertiptarget',\n\t\tEVENT_NAMESPACE = '.powertip',\n\t\tRAD2DEG = 180 / Math.PI;\n\n\t/**\n\t * Session data\n\t * Private properties global to all powerTip instances\n\t */\n\tvar session = {\n\t\telements: null,\n\t\ttooltips: null,\n\t\tisTipOpen: false,\n\t\tisFixedTipOpen: false,\n\t\tisClosing: false,\n\t\ttipOpenImminent: false,\n\t\tactiveHover: null,\n\t\tcurrentX: 0,\n\t\tcurrentY: 0,\n\t\tpreviousX: 0,\n\t\tpreviousY: 0,\n\t\tdesyncTimeout: null,\n\t\tcloseDelayTimeout: null,\n\t\tmouseTrackingActive: false,\n\t\tdelayInProgress: false,\n\t\twindowWidth: 0,\n\t\twindowHeight: 0,\n\t\tscrollTop: 0,\n\t\tscrollLeft: 0\n\t};\n\n\t/**\n\t * Collision enumeration\n\t * @enum {number}\n\t */\n\tvar Collision = {\n\t\tnone: 0,\n\t\ttop: 1,\n\t\tbottom: 2,\n\t\tleft: 4,\n\t\tright: 8\n\t};\n\n\t/**\n\t * Display hover tooltips on the matched elements.\n\t * @param {(Object|string)=} opts The options object to use for the plugin, or\n\t * the name of a method to invoke on the first matched element.\n\t * @param {*=} [arg] Argument for an invoked method (optional).\n\t * @return {jQuery} jQuery object for the matched selectors.\n\t */\n\t$.fn.powerTip = function(opts, arg) {\n\t\tvar targetElements = this,\n\t\t\toptions,\n\t\t\ttipController;\n\n\t\t// don't do any work if there were no matched elements\n\t\tif (!targetElements.length) {\n\t\t\treturn targetElements;\n\t\t}\n\n\t\t// handle api method calls on the plugin, e.g. powerTip('hide')\n\t\tif ($.type(opts) === 'string' && $.powerTip[opts]) {\n\t\t\treturn $.powerTip[opts].call(targetElements, targetElements, arg);\n\t\t}\n\n\t\t// extend options and instantiate TooltipController\n\t\toptions = $.extend({}, $.fn.powerTip.defaults, opts);\n\t\ttipController = new TooltipController(options);\n\n\t\t// hook mouse and viewport dimension tracking\n\t\tinitTracking();\n\n\t\t// setup the elements\n\t\ttargetElements.each(function elementSetup() {\n\t\t\tvar $this = $(this),\n\t\t\t\tdataPowertip = $this.data(DATA_POWERTIP),\n\t\t\t\tdataElem = $this.data(DATA_POWERTIPJQ),\n\t\t\t\tdataTarget = $this.data(DATA_POWERTIPTARGET),\n\t\t\t\ttitle;\n\n\t\t\t// handle repeated powerTip calls on the same element by destroying the\n\t\t\t// original instance hooked to it and replacing it with this call\n\t\t\tif ($this.data(DATA_DISPLAYCONTROLLER)) {\n\t\t\t\t$.powerTip.destroy($this);\n\t\t\t}\n\n\t\t\t// attempt to use title attribute text if there is no data-powertip,\n\t\t\t// data-powertipjq or data-powertiptarget. If we do use the title\n\t\t\t// attribute, delete the attribute so the browser will not show it\n\t\t\ttitle = $this.attr('title');\n\t\t\tif (!dataPowertip && !dataTarget && !dataElem && title) {\n\t\t\t\t$this.data(DATA_POWERTIP, title);\n\t\t\t\t$this.data(DATA_ORIGINALTITLE, title);\n\t\t\t\t$this.removeAttr('title');\n\t\t\t}\n\n\t\t\t// create hover controllers for each element\n\t\t\t$this.data(\n\t\t\t\tDATA_DISPLAYCONTROLLER,\n\t\t\t\tnew DisplayController($this, options, tipController)\n\t\t\t);\n\t\t});\n\n\t\t// attach events to matched elements if the manual option is not enabled\n\t\tif (!options.manual) {\n\t\t\t// attach open events\n\t\t\t$.each(options.openEvents, function(idx, evt) {\n\t\t\t\tif ($.inArray(evt, options.closeEvents) > -1) {\n\t\t\t\t\t// event is in both openEvents and closeEvents, so toggle it\n\t\t\t\t\ttargetElements.on(evt + EVENT_NAMESPACE, function elementToggle(event) {\n\t\t\t\t\t\t$.powerTip.toggle(this, event);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\ttargetElements.on(evt + EVENT_NAMESPACE, function elementOpen(event) {\n\t\t\t\t\t\t$.powerTip.show(this, event);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// attach close events\n\t\t\t$.each(options.closeEvents, function(idx, evt) {\n\t\t\t\tif ($.inArray(evt, options.openEvents) < 0) {\n\t\t\t\t\ttargetElements.on(evt + EVENT_NAMESPACE, function elementClose(event) {\n\t\t\t\t\t\t// set immediate to true for any event without mouse info\n\t\t\t\t\t\t$.powerTip.hide(this, !isMouseEvent(event));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// attach escape key close event\n\t\t\ttargetElements.on('keydown' + EVENT_NAMESPACE, function elementKeyDown(event) {\n\t\t\t\t// always close tooltip when the escape key is pressed\n\t\t\t\tif (event.keyCode === 27) {\n\t\t\t\t\t$.powerTip.hide(this, true);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// remember elements that the plugin is attached to\n\t\tsession.elements = session.elements ? session.elements.add(targetElements) : targetElements;\n\n\t\treturn targetElements;\n\t};\n\n\t/**\n\t * Default options for the powerTip plugin.\n\t */\n\t$.fn.powerTip.defaults = {\n\t\tfadeInTime: 200,\n\t\tfadeOutTime: 100,\n\t\tfollowMouse: false,\n\t\tpopupId: 'powerTip',\n\t\tpopupClass: null,\n\t\tintentSensitivity: 7,\n\t\tintentPollInterval: 100,\n\t\tcloseDelay: 100,\n\t\tplacement: 'n',\n\t\tsmartPlacement: false,\n\t\toffset: 10,\n\t\tmouseOnToPopup: false,\n\t\tmanual: false,\n\t\topenEvents: [ 'mouseenter', 'focus' ],\n\t\tcloseEvents: [ 'mouseleave', 'blur' ]\n\t};\n\n\t/**\n\t * Default smart placement priority lists.\n\t * The first item in the array is the highest priority, the last is the lowest.\n\t * The last item is also the default, which will be used if all previous options\n\t * do not fit.\n\t */\n\t$.fn.powerTip.smartPlacementLists = {\n\t\tn: [ 'n', 'ne', 'nw', 's' ],\n\t\te: [ 'e', 'ne', 'se', 'w', 'nw', 'sw', 'n', 's', 'e' ],\n\t\ts: [ 's', 'se', 'sw', 'n' ],\n\t\tw: [ 'w', 'nw', 'sw', 'e', 'ne', 'se', 'n', 's', 'w' ],\n\t\tnw: [ 'nw', 'w', 'sw', 'n', 's', 'se', 'nw' ],\n\t\tne: [ 'ne', 'e', 'se', 'n', 's', 'sw', 'ne' ],\n\t\tsw: [ 'sw', 'w', 'nw', 's', 'n', 'ne', 'sw' ],\n\t\tse: [ 'se', 'e', 'ne', 's', 'n', 'nw', 'se' ],\n\t\t'nw-alt': [ 'nw-alt', 'n', 'ne-alt', 'sw-alt', 's', 'se-alt', 'w', 'e' ],\n\t\t'ne-alt': [ 'ne-alt', 'n', 'nw-alt', 'se-alt', 's', 'sw-alt', 'e', 'w' ],\n\t\t'sw-alt': [ 'sw-alt', 's', 'se-alt', 'nw-alt', 'n', 'ne-alt', 'w', 'e' ],\n\t\t'se-alt': [ 'se-alt', 's', 'sw-alt', 'ne-alt', 'n', 'nw-alt', 'e', 'w' ]\n\t};\n\n\t/**\n\t * Public API\n\t */\n\t$.powerTip = {\n\t\t/**\n\t\t * Attempts to show the tooltip for the specified element.\n\t\t * @param {jQuery|Element} element The element to open the tooltip for.\n\t\t * @param {jQuery.Event=} event jQuery event for hover intent and mouse\n\t\t * tracking (optional).\n\t\t * @return {jQuery|Element} The original jQuery object or DOM Element.\n\t\t */\n\t\tshow: function apiShowTip(element, event) {\n\t\t\t// if we were given a mouse event then run the hover intent testing,\n\t\t\t// otherwise, simply show the tooltip asap\n\t\t\tif (isMouseEvent(event)) {\n\t\t\t\ttrackMouse(event);\n\t\t\t\tsession.previousX = event.pageX;\n\t\t\t\tsession.previousY = event.pageY;\n\t\t\t\t$(element).data(DATA_DISPLAYCONTROLLER).show();\n\t\t\t} else {\n\t\t\t\t$(element).first().data(DATA_DISPLAYCONTROLLER).show(true, true);\n\t\t\t}\n\t\t\treturn element;\n\t\t},\n\n\t\t/**\n\t\t * Repositions the tooltip on the element.\n\t\t * @param {jQuery|Element} element The element the tooltip is shown for.\n\t\t * @return {jQuery|Element} The original jQuery object or DOM Element.\n\t\t */\n\t\treposition: function apiResetPosition(element) {\n\t\t\t$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();\n\t\t\treturn element;\n\t\t},\n\n\t\t/**\n\t\t * Attempts to close any open tooltips.\n\t\t * @param {(jQuery|Element)=} element The element with the tooltip that\n\t\t * should be closed (optional).\n\t\t * @param {boolean=} immediate Disable close delay (optional).\n\t\t * @return {jQuery|Element|undefined} The original jQuery object or DOM\n\t\t * Element, if one was specified.\n\t\t */\n\t\thide: function apiCloseTip(element, immediate) {\n\t\t\tvar displayController;\n\n\t\t\t// set immediate to true when no element is specified\n\t\t\timmediate = element ? immediate : true;\n\n\t\t\t// find the relevant display controller\n\t\t\tif (element) {\n\t\t\t\tdisplayController = $(element).first().data(DATA_DISPLAYCONTROLLER);\n\t\t\t} else if (session.activeHover) {\n\t\t\t\tdisplayController = session.activeHover.data(DATA_DISPLAYCONTROLLER);\n\t\t\t}\n\n\t\t\t// if found, hide the tip\n\t\t\tif (displayController) {\n\t\t\t\tdisplayController.hide(immediate);\n\t\t\t}\n\n\t\t\treturn element;\n\t\t},\n\n\t\t/**\n\t\t * Toggles the tooltip for the specified element. This will open a closed\n\t\t * tooltip, or close an open tooltip.\n\t\t * @param {jQuery|Element} element The element with the tooltip that\n\t\t * should be toggled.\n\t\t * @param {jQuery.Event=} event jQuery event for hover intent and mouse\n\t\t * tracking (optional).\n\t\t * @return {jQuery|Element} The original jQuery object or DOM Element.\n\t\t */\n\t\ttoggle: function apiToggle(element, event) {\n\t\t\tif (session.activeHover && session.activeHover.is(element)) {\n\t\t\t\t// tooltip for element is active, so close it\n\t\t\t\t$.powerTip.hide(element, !isMouseEvent(event));\n\t\t\t} else {\n\t\t\t\t// tooltip for element is not active, so open it\n\t\t\t\t$.powerTip.show(element, event);\n\t\t\t}\n\t\t\treturn element;\n\t\t},\n\n\t\t/**\n\t\t * Destroy and roll back any powerTip() instance on the specified elements.\n\t\t * If no elements are specified then all elements that the plugin is\n\t\t * currently attached to will be rolled back.\n\t\t * @param {(jQuery|Element)=} element The element with the powerTip instance.\n\t\t * @return {jQuery|Element|undefined} The original jQuery object or DOM\n\t\t * Element, if one was specified.\n\t\t */\n\t\tdestroy: function apiDestroy(element) {\n\t\t\tvar $element = element ? $(element) : session.elements;\n\n\t\t\t// if the plugin is not hooked to any elements then there is no point\n\t\t\t// trying to destroy anything, or dealing with the possible errors\n\t\t\tif (!session.elements || session.elements.length === 0) {\n\t\t\t\treturn element;\n\t\t\t}\n\n\t\t\t// unhook events and destroy plugin changes to each element\n\t\t\t$element.off(EVENT_NAMESPACE).each(function destroy() {\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tdataAttributes = [\n\t\t\t\t\t\tDATA_ORIGINALTITLE,\n\t\t\t\t\t\tDATA_DISPLAYCONTROLLER,\n\t\t\t\t\t\tDATA_HASACTIVEHOVER,\n\t\t\t\t\t\tDATA_FORCEDOPEN\n\t\t\t\t\t];\n\n\t\t\t\t// revert title attribute\n\t\t\t\tif ($this.data(DATA_ORIGINALTITLE)) {\n\t\t\t\t\t$this.attr('title', $this.data(DATA_ORIGINALTITLE));\n\t\t\t\t\tdataAttributes.push(DATA_POWERTIP);\n\t\t\t\t}\n\n\t\t\t\t// remove data attributes\n\t\t\t\t$this.removeData(dataAttributes);\n\t\t\t});\n\n\t\t\t// remove destroyed element from active elements collection\n\t\t\tsession.elements = session.elements.not($element);\n\n\t\t\t// if there are no active elements left then we will unhook all of the\n\t\t\t// events that we've bound code to and remove the tooltip elements\n\t\t\tif (session.elements.length === 0) {\n\t\t\t\t$window.off(EVENT_NAMESPACE);\n\t\t\t\t$document.off(EVENT_NAMESPACE);\n\t\t\t\tsession.mouseTrackingActive = false;\n\t\t\t\tsession.tooltips.remove();\n\t\t\t\tsession.tooltips = null;\n\t\t\t}\n\n\t\t\treturn element;\n\t\t}\n\t};\n\n\t// API aliasing\n\t$.powerTip.showTip = $.powerTip.show;\n\t$.powerTip.closeTip = $.powerTip.hide;\n\n\t/**\n\t * Creates a new CSSCoordinates object.\n\t * @private\n\t * @constructor\n\t */\n\tfunction CSSCoordinates() {\n\t\tvar me = this;\n\n\t\t// initialize object properties\n\t\tme.top = 'auto';\n\t\tme.left = 'auto';\n\t\tme.right = 'auto';\n\t\tme.bottom = 'auto';\n\n\t\t/**\n\t\t * Set a property to a value.\n\t\t * @private\n\t\t * @param {string} property The name of the property.\n\t\t * @param {number} value The value of the property.\n\t\t */\n\t\tme.set = function(property, value) {\n\t\t\tif ($.isNumeric(value)) {\n\t\t\t\tme[property] = Math.round(value);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Creates a new tooltip display controller.\n\t * @private\n\t * @constructor\n\t * @param {jQuery} element The element that this controller will handle.\n\t * @param {Object} options Options object containing settings.\n\t * @param {TooltipController} tipController The TooltipController object for\n\t * this instance.\n\t */\n\tfunction DisplayController(element, options, tipController) {\n\t\tvar hoverTimer = null,\n\t\t\tmyCloseDelay = null;\n\n\t\t/**\n\t\t * Begins the process of showing a tooltip.\n\t\t * @private\n\t\t * @param {boolean=} immediate Skip intent testing (optional).\n\t\t * @param {boolean=} forceOpen Ignore cursor position and force tooltip to\n\t\t * open (optional).\n\t\t */\n\t\tfunction openTooltip(immediate, forceOpen) {\n\t\t\tcancelTimer();\n\t\t\tif (!element.data(DATA_HASACTIVEHOVER)) {\n\t\t\t\tif (!immediate) {\n\t\t\t\t\tsession.tipOpenImminent = true;\n\t\t\t\t\thoverTimer = setTimeout(\n\t\t\t\t\t\tfunction intentDelay() {\n\t\t\t\t\t\t\thoverTimer = null;\n\t\t\t\t\t\t\tcheckForIntent();\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions.intentPollInterval\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tif (forceOpen) {\n\t\t\t\t\t\telement.data(DATA_FORCEDOPEN, true);\n\t\t\t\t\t}\n\t\t\t\t\tcloseAnyDelayed();\n\t\t\t\t\ttipController.showTip(element);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// cursor left and returned to this element, cancel close\n\t\t\t\tcancelClose();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Begins the process of closing a tooltip.\n\t\t * @private\n\t\t * @param {boolean=} disableDelay Disable close delay (optional).\n\t\t */\n\t\tfunction closeTooltip(disableDelay) {\n\t\t\t// if this instance already has a close delay in progress then halt it\n\t\t\tif (myCloseDelay) {\n\t\t\t\tmyCloseDelay = session.closeDelayTimeout = clearTimeout(myCloseDelay);\n\t\t\t\tsession.delayInProgress = false;\n\t\t\t}\n\t\t\tcancelTimer();\n\t\t\tsession.tipOpenImminent = false;\n\t\t\tif (element.data(DATA_HASACTIVEHOVER)) {\n\t\t\t\telement.data(DATA_FORCEDOPEN, false);\n\t\t\t\tif (!disableDelay) {\n\t\t\t\t\tsession.delayInProgress = true;\n\t\t\t\t\tsession.closeDelayTimeout = setTimeout(\n\t\t\t\t\t\tfunction closeDelay() {\n\t\t\t\t\t\t\tsession.closeDelayTimeout = null;\n\t\t\t\t\t\t\ttipController.hideTip(element);\n\t\t\t\t\t\t\tsession.delayInProgress = false;\n\t\t\t\t\t\t\tmyCloseDelay = null;\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions.closeDelay\n\t\t\t\t\t);\n\t\t\t\t\t// save internal reference close delay id so we can check if the\n\t\t\t\t\t// active close delay belongs to this instance\n\t\t\t\t\tmyCloseDelay = session.closeDelayTimeout;\n\t\t\t\t} else {\n\t\t\t\t\ttipController.hideTip(element);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Checks mouse position to make sure that the user intended to hover on the\n\t\t * specified element before showing the tooltip.\n\t\t * @private\n\t\t */\n\t\tfunction checkForIntent() {\n\t\t\t// calculate mouse position difference\n\t\t\tvar xDifference = Math.abs(session.previousX - session.currentX),\n\t\t\t\tyDifference = Math.abs(session.previousY - session.currentY),\n\t\t\t\ttotalDifference = xDifference + yDifference;\n\n\t\t\t// check if difference has passed the sensitivity threshold\n\t\t\tif (totalDifference < options.intentSensitivity) {\n\t\t\t\tcancelClose();\n\t\t\t\tcloseAnyDelayed();\n\t\t\t\ttipController.showTip(element);\n\t\t\t} else {\n\t\t\t\t// try again\n\t\t\t\tsession.previousX = session.currentX;\n\t\t\t\tsession.previousY = session.currentY;\n\t\t\t\topenTooltip();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Cancels active hover timer.\n\t\t * @private\n\t\t * @param {boolean=} stopClose Cancel any active close delay timer.\n\t\t */\n\t\tfunction cancelTimer(stopClose) {\n\t\t\thoverTimer = clearTimeout(hoverTimer);\n\t\t\t// cancel the current close delay if the active close delay is for this\n\t\t\t// element or the stopClose argument is true\n\t\t\tif (session.closeDelayTimeout && myCloseDelay === session.closeDelayTimeout || stopClose) {\n\t\t\t\tcancelClose();\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Cancels any active close delay timer.\n\t\t * @private\n\t\t */\n\t\tfunction cancelClose() {\n\t\t\tsession.closeDelayTimeout = clearTimeout(session.closeDelayTimeout);\n\t\t\tsession.delayInProgress = false;\n\t\t}\n\n\t\t/**\n\t\t * Asks any tooltips waiting on their close delay to close now.\n\t\t * @private\n\t\t */\n\t\tfunction closeAnyDelayed() {\n\t\t\t// if another element is waiting for its close delay then we should ask\n\t\t\t// it to close immediately so we can proceed without unexpected timeout\n\t\t\t// code being run during this tooltip's lifecycle\n\t\t\tif (session.delayInProgress && session.activeHover && !session.activeHover.is(element)) {\n\t\t\t\tsession.activeHover.data(DATA_DISPLAYCONTROLLER).hide(true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Repositions the tooltip on this element.\n\t\t * @private\n\t\t */\n\t\tfunction repositionTooltip() {\n\t\t\ttipController.resetPosition(element);\n\t\t}\n\n\t\t// expose the methods\n\t\tthis.show = openTooltip;\n\t\tthis.hide = closeTooltip;\n\t\tthis.cancel = cancelTimer;\n\t\tthis.resetPosition = repositionTooltip;\n\t}\n\n\t/**\n\t * Creates a new Placement Calculator.\n\t * @private\n\t * @constructor\n\t */\n\tfunction PlacementCalculator() {\n\t\t/**\n\t\t * Compute the CSS position to display a tooltip at the specified placement\n\t\t * relative to the specified element.\n\t\t * @private\n\t\t * @param {jQuery} element The element that the tooltip should target.\n\t\t * @param {string} placement The placement for the tooltip.\n\t\t * @param {number} tipWidth Width of the tooltip element in pixels.\n\t\t * @param {number} tipHeight Height of the tooltip element in pixels.\n\t\t * @param {number} offset Distance to offset tooltips in pixels.\n\t\t * @return {CSSCoordinates} A CSSCoordinates object with the position.\n\t\t */\n\t\tfunction computePlacementCoords(element, placement, tipWidth, tipHeight, offset) {\n\t\t\tvar placementBase = placement.split('-')[0], // ignore 'alt' for corners\n\t\t\t\tcoords = new CSSCoordinates(),\n\t\t\t\tposition;\n\n\t\t\tif (isSvgElement(element)) {\n\t\t\t\tposition = getSvgPlacement(element, placementBase);\n\t\t\t} else {\n\t\t\t\tposition = getHtmlPlacement(element, placementBase);\n\t\t\t}\n\n\t\t\t// calculate the appropriate x and y position in the document\n\t\t\tswitch (placement) {\n\t\t\t\tcase 'n':\n\t\t\t\t\tcoords.set('left', position.left - (tipWidth / 2));\n\t\t\t\t\tcoords.set('bottom', session.windowHeight - position.top + offset);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'e':\n\t\t\t\t\tcoords.set('left', position.left + offset);\n\t\t\t\t\tcoords.set('top', position.top - (tipHeight / 2));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 's':\n\t\t\t\t\tcoords.set('left', position.left - (tipWidth / 2));\n\t\t\t\t\tcoords.set('top', position.top + offset);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\tcoords.set('top', position.top - (tipHeight / 2));\n\t\t\t\t\tcoords.set('right', session.windowWidth - position.left + offset);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'nw':\n\t\t\t\t\tcoords.set('bottom', session.windowHeight - position.top + offset);\n\t\t\t\t\tcoords.set('right', session.windowWidth - position.left - 20);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'nw-alt':\n\t\t\t\t\tcoords.set('left', position.left);\n\t\t\t\t\tcoords.set('bottom', session.windowHeight - position.top + offset);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ne':\n\t\t\t\t\tcoords.set('left', position.left - 20);\n\t\t\t\t\tcoords.set('bottom', session.windowHeight - position.top + offset);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ne-alt':\n\t\t\t\t\tcoords.set('bottom', session.windowHeight - position.top + offset);\n\t\t\t\t\tcoords.set('right', session.windowWidth - position.left);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sw':\n\t\t\t\t\tcoords.set('top', position.top + offset);\n\t\t\t\t\tcoords.set('right', session.windowWidth - position.left - 20);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sw-alt':\n\t\t\t\t\tcoords.set('left', position.left);\n\t\t\t\t\tcoords.set('top', position.top + offset);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'se':\n\t\t\t\t\tcoords.set('left', position.left - 20);\n\t\t\t\t\tcoords.set('top', position.top + offset);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'se-alt':\n\t\t\t\t\tcoords.set('top', position.top + offset);\n\t\t\t\t\tcoords.set('right', session.windowWidth - position.left);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn coords;\n\t\t}\n\n\t\t/**\n\t\t * Finds the tooltip attachment point in the document for a HTML DOM element\n\t\t * for the specified placement.\n\t\t * @private\n\t\t * @param {jQuery} element The element that the tooltip should target.\n\t\t * @param {string} placement The placement for the tooltip.\n\t\t * @return {Object} An object with the top,left position values.\n\t\t */\n\t\tfunction getHtmlPlacement(element, placement) {\n\t\t\tvar objectOffset = element.offset(),\n\t\t\t\tobjectWidth = element.outerWidth(),\n\t\t\t\tobjectHeight = element.outerHeight(),\n\t\t\t\tleft,\n\t\t\t\ttop;\n\n\t\t\t// calculate the appropriate x and y position in the document\n\t\t\tswitch (placement) {\n\t\t\t\tcase 'n':\n\t\t\t\t\tleft = objectOffset.left + objectWidth / 2;\n\t\t\t\t\ttop = objectOffset.top;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'e':\n\t\t\t\t\tleft = objectOffset.left + objectWidth;\n\t\t\t\t\ttop = objectOffset.top + objectHeight / 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 's':\n\t\t\t\t\tleft = objectOffset.left + objectWidth / 2;\n\t\t\t\t\ttop = objectOffset.top + objectHeight;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\tleft = objectOffset.left;\n\t\t\t\t\ttop = objectOffset.top + objectHeight / 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'nw':\n\t\t\t\t\tleft = objectOffset.left;\n\t\t\t\t\ttop = objectOffset.top;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ne':\n\t\t\t\t\tleft = objectOffset.left + objectWidth;\n\t\t\t\t\ttop = objectOffset.top;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sw':\n\t\t\t\t\tleft = objectOffset.left;\n\t\t\t\t\ttop = objectOffset.top + objectHeight;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'se':\n\t\t\t\t\tleft = objectOffset.left + objectWidth;\n\t\t\t\t\ttop = objectOffset.top + objectHeight;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttop: top,\n\t\t\t\tleft: left\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Finds the tooltip attachment point in the document for a SVG element for\n\t\t * the specified placement.\n\t\t * @private\n\t\t * @param {jQuery} element The element that the tooltip should target.\n\t\t * @param {string} placement The placement for the tooltip.\n\t\t * @return {Object} An object with the top,left position values.\n\t\t */\n\t\tfunction getSvgPlacement(element, placement) {\n\t\t\tvar svgElement = element.closest('svg')[0],\n\t\t\t\tdomElement = element[0],\n\t\t\t\tpoint = svgElement.createSVGPoint(),\n\t\t\t\tboundingBox = domElement.getBBox(),\n\t\t\t\tmatrix = domElement.getScreenCTM(),\n\t\t\t\thalfWidth = boundingBox.width / 2,\n\t\t\t\thalfHeight = boundingBox.height / 2,\n\t\t\t\tplacements = [],\n\t\t\t\tplacementKeys = [ 'nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w' ],\n\t\t\t\tcoords,\n\t\t\t\trotation,\n\t\t\t\tsteps,\n\t\t\t\tx;\n\n\t\t\tfunction pushPlacement() {\n\t\t\t\tplacements.push(point.matrixTransform(matrix));\n\t\t\t}\n\n\t\t\t// get bounding box corners and midpoints\n\t\t\tpoint.x = boundingBox.x;\n\t\t\tpoint.y = boundingBox.y;\n\t\t\tpushPlacement();\n\t\t\tpoint.x += halfWidth;\n\t\t\tpushPlacement();\n\t\t\tpoint.x += halfWidth;\n\t\t\tpushPlacement();\n\t\t\tpoint.y += halfHeight;\n\t\t\tpushPlacement();\n\t\t\tpoint.y += halfHeight;\n\t\t\tpushPlacement();\n\t\t\tpoint.x -= halfWidth;\n\t\t\tpushPlacement();\n\t\t\tpoint.x -= halfWidth;\n\t\t\tpushPlacement();\n\t\t\tpoint.y -= halfHeight;\n\t\t\tpushPlacement();\n\n\t\t\t// determine rotation\n\t\t\tif (placements[0].y !== placements[1].y || placements[0].x !== placements[7].x) {\n\t\t\t\trotation = Math.atan2(matrix.b, matrix.a) * RAD2DEG;\n\t\t\t\tsteps = Math.ceil(((rotation % 360) - 22.5) / 45);\n\t\t\t\tif (steps < 1) {\n\t\t\t\t\tsteps += 8;\n\t\t\t\t}\n\t\t\t\twhile (steps--) {\n\t\t\t\t\tplacementKeys.push(placementKeys.shift());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// find placement\n\t\t\tfor (x = 0; x < placements.length; x++) {\n\t\t\t\tif (placementKeys[x] === placement) {\n\t\t\t\t\tcoords = placements[x];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttop: coords.y + session.scrollTop,\n\t\t\t\tleft: coords.x + session.scrollLeft\n\t\t\t};\n\t\t}\n\n\t\t// expose methods\n\t\tthis.compute = computePlacementCoords;\n\t}\n\n\t/**\n\t * Creates a new tooltip controller.\n\t * @private\n\t * @constructor\n\t * @param {Object} options Options object containing settings.\n\t */\n\tfunction TooltipController(options) {\n\t\tvar placementCalculator = new PlacementCalculator(),\n\t\t\ttipElement = $('#' + options.popupId);\n\n\t\t// build and append tooltip div if it does not already exist\n\t\tif (tipElement.length === 0) {\n\t\t\ttipElement = $('<div/>', { id: options.popupId });\n\t\t\t// grab body element if it was not populated when the script loaded\n\t\t\t// note: this hack exists solely for jsfiddle support\n\t\t\tif ($body.length === 0) {\n\t\t\t\t$body = $('body');\n\t\t\t}\n\t\t\t$body.append(tipElement);\n\t\t\t// remember the tooltip elements that the plugin has created\n\t\t\tsession.tooltips = session.tooltips ? session.tooltips.add(tipElement) : tipElement;\n\t\t}\n\n\t\t// hook mousemove for cursor follow tooltips\n\t\tif (options.followMouse) {\n\t\t\t// only one positionTipOnCursor hook per tooltip element, please\n\t\t\tif (!tipElement.data(DATA_HASMOUSEMOVE)) {\n\t\t\t\t$document.on('mousemove' + EVENT_NAMESPACE, positionTipOnCursor);\n\t\t\t\t$window.on('scroll' + EVENT_NAMESPACE, positionTipOnCursor);\n\t\t\t\ttipElement.data(DATA_HASMOUSEMOVE, true);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Gives the specified element the active-hover state and queues up the\n\t\t * showTip function.\n\t\t * @private\n\t\t * @param {jQuery} element The element that the tooltip should target.\n\t\t */\n\t\tfunction beginShowTip(element) {\n\t\t\telement.data(DATA_HASACTIVEHOVER, true);\n\t\t\t// show tooltip, asap\n\t\t\ttipElement.queue(function queueTipInit(next) {\n\t\t\t\tshowTip(element);\n\t\t\t\tnext();\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Shows the tooltip, as soon as possible.\n\t\t * @private\n\t\t * @param {jQuery} element The element that the tooltip should target.\n\t\t */\n\t\tfunction showTip(element) {\n\t\t\tvar tipContent;\n\n\t\t\t// it is possible, especially with keyboard navigation, to move on to\n\t\t\t// another element with a tooltip during the queue to get to this point\n\t\t\t// in the code. if that happens then we need to not proceed or we may\n\t\t\t// have the fadeout callback for the last tooltip execute immediately\n\t\t\t// after this code runs, causing bugs.\n\t\t\tif (!element.data(DATA_HASACTIVEHOVER)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the tooltip is open and we got asked to open another one then the\n\t\t\t// old one is still in its fadeOut cycle, so wait and try again\n\t\t\tif (session.isTipOpen) {\n\t\t\t\tif (!session.isClosing) {\n\t\t\t\t\thideTip(session.activeHover);\n\t\t\t\t}\n\t\t\t\ttipElement.delay(100).queue(function queueTipAgain(next) {\n\t\t\t\t\tshowTip(element);\n\t\t\t\t\tnext();\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// trigger powerTipPreRender event\n\t\t\telement.trigger('powerTipPreRender');\n\n\t\t\t// set tooltip content\n\t\t\ttipContent = getTooltipContent(element);\n\t\t\tif (tipContent) {\n\t\t\t\ttipElement.empty().append(tipContent);\n\t\t\t} else {\n\t\t\t\t// we have no content to display, give up\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// trigger powerTipRender event\n\t\t\telement.trigger('powerTipRender');\n\n\t\t\tsession.activeHover = element;\n\t\t\tsession.isTipOpen = true;\n\n\t\t\ttipElement.data(DATA_MOUSEONTOTIP, options.mouseOnToPopup);\n\n\t\t\t// set tooltip position\n\t\t\tif (!options.followMouse) {\n\t\t\t\tpositionTipOnElement(element);\n\t\t\t\tsession.isFixedTipOpen = true;\n\t\t\t} else {\n\t\t\t\tpositionTipOnCursor();\n\t\t\t}\n\n\t\t\t// add custom class to tooltip element\n\t\t\ttipElement.addClass(options.popupClass);\n\n\t\t\t// close tooltip when clicking anywhere on the page, with the exception\n\t\t\t// of the tooltip's trigger element and any elements that are within a\n\t\t\t// tooltip that has 'mouseOnToPopup' option enabled\n\t\t\tif (!element.data(DATA_FORCEDOPEN)) {\n\t\t\t\t$document.on('click' + EVENT_NAMESPACE, function documentClick(event) {\n\t\t\t\t\tvar target = event.target;\n\t\t\t\t\tif (target !== element[0]) {\n\t\t\t\t\t\tif (options.mouseOnToPopup) {\n\t\t\t\t\t\t\tif (target !== tipElement[0] && !$.contains(tipElement[0], target)) {\n\t\t\t\t\t\t\t\t$.powerTip.hide();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$.powerTip.hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// if we want to be able to mouse on to the tooltip then we need to\n\t\t\t// attach hover events to the tooltip that will cancel a close request\n\t\t\t// on mouseenter and start a new close request on mouseleave\n\t\t\t// only hook these listeners if we're not in manual mode\n\t\t\tif (options.mouseOnToPopup && !options.manual) {\n\t\t\t\ttipElement.on('mouseenter' + EVENT_NAMESPACE, function tipMouseEnter() {\n\t\t\t\t\t// check activeHover in case the mouse cursor entered the\n\t\t\t\t\t// tooltip during the fadeOut and close cycle\n\t\t\t\t\tif (session.activeHover) {\n\t\t\t\t\t\tsession.activeHover.data(DATA_DISPLAYCONTROLLER).cancel();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\ttipElement.on('mouseleave' + EVENT_NAMESPACE, function tipMouseLeave() {\n\t\t\t\t\t// check activeHover in case the mouse cursor left the tooltip\n\t\t\t\t\t// during the fadeOut and close cycle\n\t\t\t\t\tif (session.activeHover) {\n\t\t\t\t\t\tsession.activeHover.data(DATA_DISPLAYCONTROLLER).hide();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// fadein\n\t\t\ttipElement.fadeIn(options.fadeInTime, function fadeInCallback() {\n\t\t\t\t// start desync polling\n\t\t\t\tif (!session.desyncTimeout) {\n\t\t\t\t\tsession.desyncTimeout = setInterval(closeDesyncedTip, 500);\n\t\t\t\t}\n\n\t\t\t\t// trigger powerTipOpen event\n\t\t\t\telement.trigger('powerTipOpen');\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Hides the tooltip.\n\t\t * @private\n\t\t * @param {jQuery} element The element that the tooltip should target.\n\t\t */\n\t\tfunction hideTip(element) {\n\t\t\t// reset session\n\t\t\tsession.isClosing = true;\n\t\t\tsession.isTipOpen = false;\n\n\t\t\t// stop desync polling\n\t\t\tsession.desyncTimeout = clearInterval(session.desyncTimeout);\n\n\t\t\t// reset element state\n\t\t\telement.data(DATA_HASACTIVEHOVER, false);\n\t\t\telement.data(DATA_FORCEDOPEN, false);\n\n\t\t\t// remove document click handler\n\t\t\t$document.off('click' + EVENT_NAMESPACE);\n\n\t\t\t// unbind the mouseOnToPopup events if they were set\n\t\t\ttipElement.off(EVENT_NAMESPACE);\n\n\t\t\t// fade out\n\t\t\ttipElement.fadeOut(options.fadeOutTime, function fadeOutCallback() {\n\t\t\t\tvar coords = new CSSCoordinates();\n\n\t\t\t\t// reset session and tooltip element\n\t\t\t\tsession.activeHover = null;\n\t\t\t\tsession.isClosing = false;\n\t\t\t\tsession.isFixedTipOpen = false;\n\t\t\t\ttipElement.removeClass();\n\n\t\t\t\t// support mouse-follow and fixed position tips at the same time by\n\t\t\t\t// moving the tooltip to the last cursor location after it is hidden\n\t\t\t\tcoords.set('top', session.currentY + options.offset);\n\t\t\t\tcoords.set('left', session.currentX + options.offset);\n\t\t\t\ttipElement.css(coords);\n\n\t\t\t\t// trigger powerTipClose event\n\t\t\t\telement.trigger('powerTipClose');\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Moves the tooltip to the users mouse cursor.\n\t\t * @private\n\t\t */\n\t\tfunction positionTipOnCursor() {\n\t\t\t// to support having fixed tooltips on the same page as cursor tooltips,\n\t\t\t// where both instances are referencing the same tooltip element, we\n\t\t\t// need to keep track of the mouse position constantly, but we should\n\t\t\t// only set the tip location if a fixed tip is not currently open, a tip\n\t\t\t// open is imminent or active, and the tooltip element in question does\n\t\t\t// have a mouse-follow using it.\n\t\t\tif (!session.isFixedTipOpen && (session.isTipOpen || (session.tipOpenImminent && tipElement.data(DATA_HASMOUSEMOVE)))) {\n\t\t\t\t// grab measurements\n\t\t\t\tvar tipWidth = tipElement.outerWidth(),\n\t\t\t\t\ttipHeight = tipElement.outerHeight(),\n\t\t\t\t\tcoords = new CSSCoordinates(),\n\t\t\t\t\tcollisions,\n\t\t\t\t\tcollisionCount;\n\n\t\t\t\t// grab collisions\n\t\t\t\tcoords.set('top', session.currentY + options.offset);\n\t\t\t\tcoords.set('left', session.currentX + options.offset);\n\t\t\t\tcollisions = getViewportCollisions(\n\t\t\t\t\tcoords,\n\t\t\t\t\ttipWidth,\n\t\t\t\t\ttipHeight\n\t\t\t\t);\n\n\t\t\t\t// handle tooltip view port collisions\n\t\t\t\tif (collisions !== Collision.none) {\n\t\t\t\t\tcollisionCount = countFlags(collisions);\n\t\t\t\t\tif (collisionCount === 1) {\n\t\t\t\t\t\t// if there is only one collision (bottom or right) then\n\t\t\t\t\t\t// simply constrain the tooltip to the view port\n\t\t\t\t\t\tif (collisions === Collision.right) {\n\t\t\t\t\t\t\tcoords.set('left', session.windowWidth - tipWidth);\n\t\t\t\t\t\t} else if (collisions === Collision.bottom) {\n\t\t\t\t\t\t\tcoords.set('top', session.scrollTop + session.windowHeight - tipHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// if the tooltip has more than one collision then it is\n\t\t\t\t\t\t// trapped in the corner and should be flipped to get it out\n\t\t\t\t\t\t// of the users way\n\t\t\t\t\t\tcoords.set('left', session.currentX - tipWidth - options.offset);\n\t\t\t\t\t\tcoords.set('top', session.currentY - tipHeight - options.offset);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// position the tooltip\n\t\t\t\ttipElement.css(coords);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Sets the tooltip to the correct position relative to the specified target\n\t\t * element. Based on options settings.\n\t\t * @private\n\t\t * @param {jQuery} element The element that the tooltip should target.\n\t\t */\n\t\tfunction positionTipOnElement(element) {\n\t\t\tvar priorityList,\n\t\t\t\tfinalPlacement;\n\n\t\t\tif (options.smartPlacement) {\n\t\t\t\tpriorityList = $.fn.powerTip.smartPlacementLists[options.placement];\n\n\t\t\t\t// iterate over the priority list and use the first placement option\n\t\t\t\t// that does not collide with the view port. if they all collide\n\t\t\t\t// then the last placement in the list will be used.\n\t\t\t\t$.each(priorityList, function(idx, pos) {\n\t\t\t\t\t// place tooltip and find collisions\n\t\t\t\t\tvar collisions = getViewportCollisions(\n\t\t\t\t\t\tplaceTooltip(element, pos),\n\t\t\t\t\t\ttipElement.outerWidth(),\n\t\t\t\t\t\ttipElement.outerHeight()\n\t\t\t\t\t);\n\n\t\t\t\t\t// update the final placement variable\n\t\t\t\t\tfinalPlacement = pos;\n\n\t\t\t\t\t// break if there were no collisions\n\t\t\t\t\tif (collisions === Collision.none) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// if we're not going to use the smart placement feature then just\n\t\t\t\t// compute the coordinates and do it\n\t\t\t\tplaceTooltip(element, options.placement);\n\t\t\t\tfinalPlacement = options.placement;\n\t\t\t}\n\n\t\t\t// add placement as class for CSS arrows\n\t\t\ttipElement.removeClass('w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt');\n\t\t\ttipElement.addClass(finalPlacement);\n\t\t}\n\n\t\t/**\n\t\t * Sets the tooltip position to the appropriate values to show the tip at\n\t\t * the specified placement. This function will iterate and test the tooltip\n\t\t * to support elastic tooltips.\n\t\t * @private\n\t\t * @param {jQuery} element The element that the tooltip should target.\n\t\t * @param {string} placement The placement for the tooltip.\n\t\t * @return {CSSCoordinates} A CSSCoordinates object with the top, left, and\n\t\t * right position values.\n\t\t */\n\t\tfunction placeTooltip(element, placement) {\n\t\t\tvar iterationCount = 0,\n\t\t\t\ttipWidth,\n\t\t\t\ttipHeight,\n\t\t\t\tcoords = new CSSCoordinates();\n\n\t\t\t// set the tip to 0,0 to get the full expanded width\n\t\t\tcoords.set('top', 0);\n\t\t\tcoords.set('left', 0);\n\t\t\ttipElement.css(coords);\n\n\t\t\t// to support elastic tooltips we need to check for a change in the\n\t\t\t// rendered dimensions after the tooltip has been positioned\n\t\t\tdo {\n\t\t\t\t// grab the current tip dimensions\n\t\t\t\ttipWidth = tipElement.outerWidth();\n\t\t\t\ttipHeight = tipElement.outerHeight();\n\n\t\t\t\t// get placement coordinates\n\t\t\t\tcoords = placementCalculator.compute(\n\t\t\t\t\telement,\n\t\t\t\t\tplacement,\n\t\t\t\t\ttipWidth,\n\t\t\t\t\ttipHeight,\n\t\t\t\t\toptions.offset\n\t\t\t\t);\n\n\t\t\t\t// place the tooltip\n\t\t\t\ttipElement.css(coords);\n\t\t\t} while (\n\t\t\t\t// sanity check: limit to 5 iterations, and...\n\t\t\t\t++iterationCount <= 5 &&\n\t\t\t\t// try again if the dimensions changed after placement\n\t\t\t\t(tipWidth !== tipElement.outerWidth() || tipHeight !== tipElement.outerHeight())\n\t\t\t);\n\n\t\t\treturn coords;\n\t\t}\n\n\t\t/**\n\t\t * Checks for a tooltip desync and closes the tooltip if one occurs.\n\t\t * @private\n\t\t */\n\t\tfunction closeDesyncedTip() {\n\t\t\tvar isDesynced = false;\n\t\t\t// It is possible for the mouse cursor to leave an element without\n\t\t\t// firing the mouseleave or blur event. This most commonly happens when\n\t\t\t// the element is disabled under mouse cursor. If this happens it will\n\t\t\t// result in a desynced tooltip because the tooltip was never asked to\n\t\t\t// close. So we should periodically check for a desync situation and\n\t\t\t// close the tip if such a situation arises.\n\t\t\tif (session.isTipOpen && !session.isClosing && !session.delayInProgress && ($.inArray('mouseleave', options.closeEvents) > -1 || $.inArray('mouseout', options.closeEvents) > -1 || $.inArray('blur', options.closeEvents) > -1 || $.inArray('focusout', options.closeEvents) > -1)) {\n\t\t\t\t// user moused onto another tip or active hover is disabled\n\t\t\t\tif (session.activeHover.data(DATA_HASACTIVEHOVER) === false || session.activeHover.is(':disabled')) {\n\t\t\t\t\tisDesynced = true;\n\t\t\t\t} else {\n\t\t\t\t\t// hanging tip - have to test if mouse position is not over the\n\t\t\t\t\t// active hover and not over a tooltip set to let the user\n\t\t\t\t\t// interact with it.\n\t\t\t\t\t// for keyboard navigation: this only counts if the element does\n\t\t\t\t\t// not have focus.\n\t\t\t\t\t// for tooltips opened via the api: we need to check if it has\n\t\t\t\t\t// the forcedOpen flag.\n\t\t\t\t\tif (!isMouseOver(session.activeHover) && !session.activeHover.is(':focus') && !session.activeHover.data(DATA_FORCEDOPEN)) {\n\t\t\t\t\t\tif (tipElement.data(DATA_MOUSEONTOTIP)) {\n\t\t\t\t\t\t\tif (!isMouseOver(tipElement)) {\n\t\t\t\t\t\t\t\tisDesynced = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tisDesynced = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isDesynced) {\n\t\t\t\t\t// close the desynced tip\n\t\t\t\t\thideTip(session.activeHover);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// expose methods\n\t\tthis.showTip = beginShowTip;\n\t\tthis.hideTip = hideTip;\n\t\tthis.resetPosition = positionTipOnElement;\n\t}\n\n\t/**\n\t * Determine whether a jQuery object is an SVG element\n\t * @private\n\t * @param {jQuery} element The element to check\n\t * @return {boolean} Whether this is an SVG element\n\t */\n\tfunction isSvgElement(element) {\n\t\treturn Boolean(window.SVGElement && element[0] instanceof SVGElement);\n\t}\n\n\t/**\n\t * Determines if the specified jQuery.Event object has mouse data.\n\t * @private\n\t * @param {jQuery.Event=} event The jQuery.Event object to test.\n\t * @return {boolean} True if there is mouse data, otherwise false.\n\t */\n\tfunction isMouseEvent(event) {\n\t\treturn Boolean(event && typeof event.pageX === 'number');\n\t}\n\n\t/**\n\t * Initializes the viewport dimension cache and hooks up the mouse position\n\t * tracking and viewport dimension tracking events.\n\t * Prevents attaching the events more than once.\n\t * @private\n\t */\n\tfunction initTracking() {\n\t\tif (!session.mouseTrackingActive) {\n\t\t\tsession.mouseTrackingActive = true;\n\n\t\t\t// grab the current viewport dimensions on load\n\t\t\tgetViewportDimensions();\n\t\t\t$(getViewportDimensions);\n\n\t\t\t// hook mouse move tracking\n\t\t\t$document.on('mousemove' + EVENT_NAMESPACE, trackMouse);\n\n\t\t\t// hook viewport dimensions tracking\n\t\t\t$window.on('resize' + EVENT_NAMESPACE, trackResize);\n\t\t\t$window.on('scroll' + EVENT_NAMESPACE, trackScroll);\n\t\t}\n\t}\n\n\t/**\n\t * Updates the viewport dimensions cache.\n\t * @private\n\t */\n\tfunction getViewportDimensions() {\n\t\tsession.scrollLeft = $window.scrollLeft();\n\t\tsession.scrollTop = $window.scrollTop();\n\t\tsession.windowWidth = $window.width();\n\t\tsession.windowHeight = $window.height();\n\t}\n\n\t/**\n\t * Updates the window size info in the viewport dimensions cache.\n\t * @private\n\t */\n\tfunction trackResize() {\n\t\tsession.windowWidth = $window.width();\n\t\tsession.windowHeight = $window.height();\n\t}\n\n\t/**\n\t * Updates the scroll offset info in the viewport dimensions cache.\n\t * @private\n\t */\n\tfunction trackScroll() {\n\t\tvar x = $window.scrollLeft(),\n\t\t\ty = $window.scrollTop();\n\t\tif (x !== session.scrollLeft) {\n\t\t\tsession.currentX += x - session.scrollLeft;\n\t\t\tsession.scrollLeft = x;\n\t\t}\n\t\tif (y !== session.scrollTop) {\n\t\t\tsession.currentY += y - session.scrollTop;\n\t\t\tsession.scrollTop = y;\n\t\t}\n\t}\n\n\t/**\n\t * Saves the current mouse coordinates to the session object.\n\t * @private\n\t * @param {jQuery.Event} event The mousemove event for the document.\n\t */\n\tfunction trackMouse(event) {\n\t\tsession.currentX = event.pageX;\n\t\tsession.currentY = event.pageY;\n\t}\n\n\t/**\n\t * Tests if the mouse is currently over the specified element.\n\t * @private\n\t * @param {jQuery} element The element to check for hover.\n\t * @return {boolean}\n\t */\n\tfunction isMouseOver(element) {\n\t\t// use getBoundingClientRect() because jQuery's width() and height()\n\t\t// methods do not work with SVG elements\n\t\t// compute width/height because those properties do not exist on the object\n\t\t// returned by getBoundingClientRect() in older versions of IE\n\t\tvar elementPosition = element.offset(),\n\t\t\telementBox = element[0].getBoundingClientRect(),\n\t\t\telementWidth = elementBox.right - elementBox.left,\n\t\t\telementHeight = elementBox.bottom - elementBox.top;\n\n\t\treturn session.currentX >= elementPosition.left &&\n\t\t\tsession.currentX <= elementPosition.left + elementWidth &&\n\t\t\tsession.currentY >= elementPosition.top &&\n\t\t\tsession.currentY <= elementPosition.top + elementHeight;\n\t}\n\n\t/**\n\t * Fetches the tooltip content from the specified element's data attributes.\n\t * @private\n\t * @param {jQuery} element The element to get the tooltip content for.\n\t * @return {(string|jQuery|undefined)} The text/HTML string, jQuery object, or\n\t * undefined if there was no tooltip content for the element.\n\t */\n\tfunction getTooltipContent(element) {\n\t\tvar tipText = element.data(DATA_POWERTIP),\n\t\t\ttipObject = element.data(DATA_POWERTIPJQ),\n\t\t\ttipTarget = element.data(DATA_POWERTIPTARGET),\n\t\t\ttargetElement,\n\t\t\tcontent;\n\n\t\tif (tipText) {\n\t\t\tif ($.isFunction(tipText)) {\n\t\t\t\ttipText = tipText.call(element[0]);\n\t\t\t}\n\t\t\tcontent = tipText;\n\t\t} else if (tipObject) {\n\t\t\tif ($.isFunction(tipObject)) {\n\t\t\t\ttipObject = tipObject.call(element[0]);\n\t\t\t}\n\t\t\tif (tipObject.length > 0) {\n\t\t\t\tcontent = tipObject.clone(true, true);\n\t\t\t}\n\t\t} else if (tipTarget) {\n\t\t\ttargetElement = $('#' + tipTarget);\n\t\t\tif (targetElement.length > 0) {\n\t\t\t\tcontent = targetElement.html();\n\t\t\t}\n\t\t}\n\n\t\treturn content;\n\t}\n\n\t/**\n\t * Finds any viewport collisions that an element (the tooltip) would have if it\n\t * were absolutely positioned at the specified coordinates.\n\t * @private\n\t * @param {CSSCoordinates} coords Coordinates for the element.\n\t * @param {number} elementWidth Width of the element in pixels.\n\t * @param {number} elementHeight Height of the element in pixels.\n\t * @return {number} Value with the collision flags.\n\t */\n\tfunction getViewportCollisions(coords, elementWidth, elementHeight) {\n\t\tvar viewportTop = session.scrollTop,\n\t\t\tviewportLeft = session.scrollLeft,\n\t\t\tviewportBottom = viewportTop + session.windowHeight,\n\t\t\tviewportRight = viewportLeft + session.windowWidth,\n\t\t\tcollisions = Collision.none;\n\n\t\tif (coords.top < viewportTop || Math.abs(coords.bottom - session.windowHeight) - elementHeight < viewportTop) {\n\t\t\tcollisions |= Collision.top;\n\t\t}\n\t\tif (coords.top + elementHeight > viewportBottom || Math.abs(coords.bottom - session.windowHeight) > viewportBottom) {\n\t\t\tcollisions |= Collision.bottom;\n\t\t}\n\t\tif (coords.left < viewportLeft || coords.right + elementWidth > viewportRight) {\n\t\t\tcollisions |= Collision.left;\n\t\t}\n\t\tif (coords.left + elementWidth > viewportRight || coords.right < viewportLeft) {\n\t\t\tcollisions |= Collision.right;\n\t\t}\n\n\t\treturn collisions;\n\t}\n\n\t/**\n\t * Counts the number of bits set on a flags value.\n\t * @param {number} value The flags value.\n\t * @return {number} The number of bits that have been set.\n\t */\n\tfunction countFlags(value) {\n\t\tvar count = 0;\n\t\twhile (value) {\n\t\t\tvalue &= value - 1;\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}\n\n// return api for commonjs and amd environments\n\treturn $.powerTip;\n}));\n","/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20\n* http://trentrichardson.com/examples/timepicker\n* Copyright (c) 2016 Trent Richardson; Licensed MIT */\n(function (factory) {\n\t\tfactory(jQuery);\n}(function ($) {\n\n\t/*\n\t* Lets not redefine timepicker, Prevent \"Uncaught RangeError: Maximum call stack size exceeded\"\n\t*/\n\t$.ui.timepicker = $.ui.timepicker || {};\n\tif ($.ui.timepicker.version) {\n\t\treturn;\n\t}\n\n\t/*\n\t* Extend jQueryUI, get it started with our version number\n\t*/\n\t$.extend($.ui, {\n\t\ttimepicker: {\n\t\t\tversion: \"1.6.3\"\n\t\t}\n\t});\n\n\t/*\n\t* Timepicker manager.\n\t* Use the singleton instance of this class, $.timepicker, to interact with the time picker.\n\t* Settings for (groups of) time pickers are maintained in an instance object,\n\t* allowing multiple different settings on the same page.\n\t*/\n\tvar Timepicker = function () {\n\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\tthis.regional[''] = { // Default regional settings\n\t\t\tcurrentText: 'Now',\n\t\t\tcloseText: 'Done',\n\t\t\tamNames: ['AM', 'A'],\n\t\t\tpmNames: ['PM', 'P'],\n\t\t\ttimeFormat: 'HH:mm',\n\t\t\ttimeSuffix: '',\n\t\t\ttimeOnlyTitle: 'Choose Time',\n\t\t\ttimeText: 'Time',\n\t\t\thourText: 'Hour',\n\t\t\tminuteText: 'Minute',\n\t\t\tsecondText: 'Second',\n\t\t\tmillisecText: 'Millisecond',\n\t\t\tmicrosecText: 'Microsecond',\n\t\t\ttimezoneText: 'Time Zone',\n\t\t\tisRTL: false\n\t\t};\n\t\tthis._defaults = { // Global defaults for all the datetime picker instances\n\t\t\tshowButtonPanel: true,\n\t\t\ttimeOnly: false,\n\t\t\ttimeOnlyShowDate: false,\n\t\t\tshowHour: null,\n\t\t\tshowMinute: null,\n\t\t\tshowSecond: null,\n\t\t\tshowMillisec: null,\n\t\t\tshowMicrosec: null,\n\t\t\tshowTimezone: null,\n\t\t\tshowTime: true,\n\t\t\tstepHour: 1,\n\t\t\tstepMinute: 1,\n\t\t\tstepSecond: 1,\n\t\t\tstepMillisec: 1,\n\t\t\tstepMicrosec: 1,\n\t\t\thour: 0,\n\t\t\tminute: 0,\n\t\t\tsecond: 0,\n\t\t\tmillisec: 0,\n\t\t\tmicrosec: 0,\n\t\t\ttimezone: null,\n\t\t\thourMin: 0,\n\t\t\tminuteMin: 0,\n\t\t\tsecondMin: 0,\n\t\t\tmillisecMin: 0,\n\t\t\tmicrosecMin: 0,\n\t\t\thourMax: 23,\n\t\t\tminuteMax: 59,\n\t\t\tsecondMax: 59,\n\t\t\tmillisecMax: 999,\n\t\t\tmicrosecMax: 999,\n\t\t\tminDateTime: null,\n\t\t\tmaxDateTime: null,\n\t\t\tmaxTime: null,\n\t\t\tminTime: null,\n\t\t\tonSelect: null,\n\t\t\thourGrid: 0,\n\t\t\tminuteGrid: 0,\n\t\t\tsecondGrid: 0,\n\t\t\tmillisecGrid: 0,\n\t\t\tmicrosecGrid: 0,\n\t\t\talwaysSetTime: true,\n\t\t\tseparator: ' ',\n\t\t\taltFieldTimeOnly: true,\n\t\t\taltTimeFormat: null,\n\t\t\taltSeparator: null,\n\t\t\taltTimeSuffix: null,\n\t\t\taltRedirectFocus: true,\n\t\t\tpickerTimeFormat: null,\n\t\t\tpickerTimeSuffix: null,\n\t\t\tshowTimepicker: true,\n\t\t\ttimezoneList: null,\n\t\t\taddSliderAccess: false,\n\t\t\tsliderAccessArgs: null,\n\t\t\tcontrolType: 'slider',\n\t\t\toneLine: false,\n\t\t\tdefaultValue: null,\n\t\t\tparse: 'strict',\n\t\t\tafterInject: null\n\t\t};\n\t\t$.extend(this._defaults, this.regional['']);\n\t};\n\n\t$.extend(Timepicker.prototype, {\n\t\t$input: null,\n\t\t$altInput: null,\n\t\t$timeObj: null,\n\t\tinst: null,\n\t\thour_slider: null,\n\t\tminute_slider: null,\n\t\tsecond_slider: null,\n\t\tmillisec_slider: null,\n\t\tmicrosec_slider: null,\n\t\ttimezone_select: null,\n\t\tmaxTime: null,\n\t\tminTime: null,\n\t\thour: 0,\n\t\tminute: 0,\n\t\tsecond: 0,\n\t\tmillisec: 0,\n\t\tmicrosec: 0,\n\t\ttimezone: null,\n\t\thourMinOriginal: null,\n\t\tminuteMinOriginal: null,\n\t\tsecondMinOriginal: null,\n\t\tmillisecMinOriginal: null,\n\t\tmicrosecMinOriginal: null,\n\t\thourMaxOriginal: null,\n\t\tminuteMaxOriginal: null,\n\t\tsecondMaxOriginal: null,\n\t\tmillisecMaxOriginal: null,\n\t\tmicrosecMaxOriginal: null,\n\t\tampm: '',\n\t\tformattedDate: '',\n\t\tformattedTime: '',\n\t\tformattedDateTime: '',\n\t\ttimezoneList: null,\n\t\tunits: ['hour', 'minute', 'second', 'millisec', 'microsec'],\n\t\tsupport: {},\n\t\tcontrol: null,\n\n\t\t/*\n\t\t* Override the default settings for all instances of the time picker.\n\t\t* @param {Object} settings object - the new settings to use as defaults (anonymous object)\n\t\t* @return {Object} the manager object\n\t\t*/\n\t\tsetDefaults: function (settings) {\n\t\t\textendRemove(this._defaults, settings || {});\n\t\t\treturn this;\n\t\t},\n\n\t\t/*\n\t\t* Create a new Timepicker instance\n\t\t*/\n\t\t_newInst: function ($input, opts) {\n\t\t\tvar tp_inst = new Timepicker(),\n\t\t\t\tinlineSettings = {},\n\t\t\t\tfns = {},\n\t\t\t\toverrides, i;\n\n\t\t\tfor (var attrName in this._defaults) {\n\t\t\t\tif (this._defaults.hasOwnProperty(attrName)) {\n\t\t\t\t\tvar attrValue = $input.attr('time:' + attrName);\n\t\t\t\t\tif (attrValue) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tinlineSettings[attrName] = eval(attrValue);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tinlineSettings[attrName] = attrValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toverrides = {\n\t\t\t\tbeforeShow: function (input, dp_inst) {\n\t\t\t\t\tif ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {\n\t\t\t\t\t\treturn tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonChangeMonthYear: function (year, month, dp_inst) {\n\t\t\t\t\t// Update the time as well : this prevents the time from disappearing from the $input field.\n\t\t\t\t\t// tp_inst._updateDateTime(dp_inst);\n\t\t\t\t\tif ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {\n\t\t\t\t\t\ttp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonClose: function (dateText, dp_inst) {\n\t\t\t\t\tif (tp_inst.timeDefined === true && $input.val() !== '') {\n\t\t\t\t\t\ttp_inst._updateDateTime(dp_inst);\n\t\t\t\t\t}\n\t\t\t\t\tif ($.isFunction(tp_inst._defaults.evnts.onClose)) {\n\t\t\t\t\t\ttp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tfor (i in overrides) {\n\t\t\t\tif (overrides.hasOwnProperty(i)) {\n\t\t\t\t\tfns[i] = opts[i] || this._defaults[i] || null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {\n\t\t\t\tevnts: fns,\n\t\t\t\ttimepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');\n\t\t\t});\n\t\t\ttp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {\n\t\t\t\treturn val.toUpperCase();\n\t\t\t});\n\t\t\ttp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {\n\t\t\t\treturn val.toUpperCase();\n\t\t\t});\n\n\t\t\t// detect which units are supported\n\t\t\ttp_inst.support = detectSupport(\n\t\t\t\t\ttp_inst._defaults.timeFormat +\n\t\t\t\t\t(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +\n\t\t\t\t\t(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));\n\n\t\t\t// controlType is string - key to our this._controls\n\t\t\tif (typeof(tp_inst._defaults.controlType) === 'string') {\n\t\t\t\tif (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') {\n\t\t\t\t\ttp_inst._defaults.controlType = 'select';\n\t\t\t\t}\n\t\t\t\ttp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];\n\t\t\t}\n\t\t\t// controlType is an object and must implement create, options, value methods\n\t\t\telse {\n\t\t\t\ttp_inst.control = tp_inst._defaults.controlType;\n\t\t\t}\n\n\t\t\t// prep the timezone options\n\t\t\tvar timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60,\n\t\t\t\t\t0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];\n\t\t\tif (tp_inst._defaults.timezoneList !== null) {\n\t\t\t\ttimezoneList = tp_inst._defaults.timezoneList;\n\t\t\t}\n\t\t\tvar tzl = timezoneList.length, tzi = 0, tzv = null;\n\t\t\tif (tzl > 0 && typeof timezoneList[0] !== 'object') {\n\t\t\t\tfor (; tzi < tzl; tzi++) {\n\t\t\t\t\ttzv = timezoneList[tzi];\n\t\t\t\t\ttimezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) };\n\t\t\t\t}\n\t\t\t}\n\t\t\ttp_inst._defaults.timezoneList = timezoneList;\n\n\t\t\t// set the default units\n\t\t\ttp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :\n\t\t\t\t\t\t\t((new Date()).getTimezoneOffset() * -1);\n\t\t\ttp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin :\n\t\t\t\t\t\t\ttp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;\n\t\t\ttp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin :\n\t\t\t\t\t\t\ttp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;\n\t\t\ttp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin :\n\t\t\t\t\t\t\ttp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;\n\t\t\ttp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin :\n\t\t\t\t\t\t\ttp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;\n\t\t\ttp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin :\n\t\t\t\t\t\t\ttp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;\n\t\t\ttp_inst.ampm = '';\n\t\t\ttp_inst.$input = $input;\n\n\t\t\tif (tp_inst._defaults.altField) {\n\t\t\t\ttp_inst.$altInput = $(tp_inst._defaults.altField);\n\t\t\t\tif (tp_inst._defaults.altRedirectFocus === true) {\n\t\t\t\t\ttp_inst.$altInput.css({\n\t\t\t\t\t\tcursor: 'pointer'\n\t\t\t\t\t}).focus(function () {\n\t\t\t\t\t\t$input.trigger(\"focus\");\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {\n\t\t\t\ttp_inst._defaults.minDate = new Date();\n\t\t\t}\n\t\t\tif (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {\n\t\t\t\ttp_inst._defaults.maxDate = new Date();\n\t\t\t}\n\n\t\t\t// datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..\n\t\t\tif (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {\n\t\t\t\ttp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());\n\t\t\t}\n\t\t\tif (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {\n\t\t\t\ttp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());\n\t\t\t}\n\t\t\tif (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {\n\t\t\t\ttp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());\n\t\t\t}\n\t\t\tif (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {\n\t\t\t\ttp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());\n\t\t\t}\n\t\t\ttp_inst.$input.bind('focus', function () {\n\t\t\t\ttp_inst._onFocus();\n\t\t\t});\n\n\t\t\treturn tp_inst;\n\t\t},\n\n\t\t/*\n\t\t* add our sliders to the calendar\n\t\t*/\n\t\t_addTimePicker: function (dp_inst) {\n\t\t\tvar currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val());\n\n\t\t\tthis.timeDefined = this._parseTime(currDT);\n\t\t\tthis._limitMinMaxDateTime(dp_inst, false);\n\t\t\tthis._injectTimePicker();\n\t\t\tthis._afterInject();\n\t\t},\n\n\t\t/*\n\t\t* parse the time string from input value or _setTime\n\t\t*/\n\t\t_parseTime: function (timeString, withDate) {\n\t\t\tif (!this.inst) {\n\t\t\t\tthis.inst = $.datepicker._getInst(this.$input[0]);\n\t\t\t}\n\n\t\t\tif (withDate || !this._defaults.timeOnly) {\n\t\t\t\tvar dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');\n\t\t\t\ttry {\n\t\t\t\t\tvar parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);\n\t\t\t\t\tif (!parseRes.timeObj) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t$.extend(this, parseRes.timeObj);\n\t\t\t\t} catch (err) {\n\t\t\t\t\t$.timepicker.log(\"Error parsing the date/time string: \" + err +\n\t\t\t\t\t\t\t\t\t\"\\ndate/time string = \" + timeString +\n\t\t\t\t\t\t\t\t\t\"\\ntimeFormat = \" + this._defaults.timeFormat +\n\t\t\t\t\t\t\t\t\t\"\\ndateFormat = \" + dp_dateFormat);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tvar timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);\n\t\t\t\tif (!timeObj) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$.extend(this, timeObj);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t},\n\n\t\t/*\n\t\t* Handle callback option after injecting timepicker\n\t\t*/\n\t\t_afterInject: function() {\n\t\t\tvar o = this.inst.settings;\n\t\t\tif ($.isFunction(o.afterInject)) {\n\t\t\t\to.afterInject.call(this);\n\t\t\t}\n\t\t},\n\n\t\t/*\n\t\t* generate and inject html for timepicker into ui datepicker\n\t\t*/\n\t\t_injectTimePicker: function () {\n\t\t\tvar $dp = this.inst.dpDiv,\n\t\t\t\to = this.inst.settings,\n\t\t\t\ttp_inst = this,\n\t\t\t\tlitem = '',\n\t\t\t\tuitem = '',\n\t\t\t\tshow = null,\n\t\t\t\tmax = {},\n\t\t\t\tgridSize = {},\n\t\t\t\tsize = null,\n\t\t\t\ti = 0,\n\t\t\t\tl = 0;\n\n\t\t\t// Prevent displaying twice\n\t\t\tif ($dp.find(\"div.ui-timepicker-div\").length === 0 && o.showTimepicker) {\n\t\t\t\tvar noDisplay = ' ui_tpicker_unit_hide',\n\t\t\t\t\thtml = '<div class=\"ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + (o.oneLine && o.controlType === 'select' ? ' ui-timepicker-oneLine' : '') + '\"><dl>' + '<dt class=\"ui_tpicker_time_label' + ((o.showTime) ? '' : noDisplay) + '\">' + o.timeText + '</dt>' +\n\t\t\t\t\t\t\t\t'<dd class=\"ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '\"><input class=\"ui_tpicker_time_input\" ' + (o.timeInput ? '' : 'disabled') + '/></dd>';\n\n\t\t\t\t// Create the markup\n\t\t\t\tfor (i = 0, l = this.units.length; i < l; i++) {\n\t\t\t\t\tlitem = this.units[i];\n\t\t\t\t\tuitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);\n\t\t\t\t\tshow = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];\n\n\t\t\t\t\t// Added by Peter Medeiros:\n\t\t\t\t\t// - Figure out what the hour/minute/second max should be based on the step values.\n\t\t\t\t\t// - Example: if stepMinute is 15, then minMax is 45.\n\t\t\t\t\tmax[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);\n\t\t\t\t\tgridSize[litem] = 0;\n\n\t\t\t\t\thtml += '<dt class=\"ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '\">' + o[litem + 'Text'] + '</dt>' +\n\t\t\t\t\t\t\t\t'<dd class=\"ui_tpicker_' + litem + (show ? '' : noDisplay) + '\"><div class=\"ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '\"></div>';\n\n\t\t\t\t\tif (show && o[litem + 'Grid'] > 0) {\n\t\t\t\t\t\thtml += '<div style=\"padding-left: 1px\"><table class=\"ui-tpicker-grid-label\"><tr>';\n\n\t\t\t\t\t\tif (litem === 'hour') {\n\t\t\t\t\t\t\tfor (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {\n\t\t\t\t\t\t\t\tgridSize[litem]++;\n\t\t\t\t\t\t\t\tvar tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o);\n\t\t\t\t\t\t\t\thtml += '<td data-for=\"' + litem + '\">' + tmph + '</td>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tfor (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {\n\t\t\t\t\t\t\t\tgridSize[litem]++;\n\t\t\t\t\t\t\t\thtml += '<td data-for=\"' + litem + '\">' + ((m < 10) ? '0' : '') + m + '</td>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\thtml += '</tr></table></div>';\n\t\t\t\t\t}\n\t\t\t\t\thtml += '</dd>';\n\t\t\t\t}\n\n\t\t\t\t// Timezone\n\t\t\t\tvar showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;\n\t\t\t\thtml += '<dt class=\"ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '\">' + o.timezoneText + '</dt>';\n\t\t\t\thtml += '<dd class=\"ui_tpicker_timezone' + (showTz ? '' : noDisplay) + '\"></dd>';\n\n\t\t\t\t// Create the elements from string\n\t\t\t\thtml += '</dl></div>';\n\t\t\t\tvar $tp = $(html);\n\n\t\t\t\t// if we only want time picker...\n\t\t\t\tif (o.timeOnly === true) {\n\t\t\t\t\t$tp.prepend('<div class=\"ui-widget-header ui-helper-clearfix ui-corner-all\">' + '<div class=\"ui-datepicker-title\">' + o.timeOnlyTitle + '</div>' + '</div>');\n\t\t\t\t\t$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();\n\t\t\t\t}\n\n\t\t\t\t// add sliders, adjust grids, add events\n\t\t\t\tfor (i = 0, l = tp_inst.units.length; i < l; i++) {\n\t\t\t\t\tlitem = tp_inst.units[i];\n\t\t\t\t\tuitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);\n\t\t\t\t\tshow = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];\n\n\t\t\t\t\t// add the slider\n\t\t\t\t\ttp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]);\n\n\t\t\t\t\t// adjust the grid and add click event\n\t\t\t\t\tif (show && o[litem + 'Grid'] > 0) {\n\t\t\t\t\t\tsize = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']);\n\t\t\t\t\t\t$tp.find('.ui_tpicker_' + litem + ' table').css({\n\t\t\t\t\t\t\twidth: size + \"%\",\n\t\t\t\t\t\t\tmarginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + \"%\"),\n\t\t\t\t\t\t\tmarginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + \"%\") : '0',\n\t\t\t\t\t\t\tborderCollapse: 'collapse'\n\t\t\t\t\t\t}).find(\"td\").click(function (e) {\n\t\t\t\t\t\t\t\tvar $t = $(this),\n\t\t\t\t\t\t\t\t\th = $t.html(),\n\t\t\t\t\t\t\t\t\tn = parseInt(h.replace(/[^0-9]/g), 10),\n\t\t\t\t\t\t\t\t\tap = h.replace(/[^apm]/ig),\n\t\t\t\t\t\t\t\t\tf = $t.data('for'); // loses scope, so we use data-for\n\n\t\t\t\t\t\t\t\tif (f === 'hour') {\n\t\t\t\t\t\t\t\t\tif (ap.indexOf('p') !== -1 && n < 12) {\n\t\t\t\t\t\t\t\t\t\tn += 12;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tif (ap.indexOf('a') !== -1 && n === 12) {\n\t\t\t\t\t\t\t\t\t\t\tn = 0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);\n\n\t\t\t\t\t\t\t\ttp_inst._onTimeChange();\n\t\t\t\t\t\t\t\ttp_inst._onSelectHandler();\n\t\t\t\t\t\t\t}).css({\n\t\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\t\twidth: (100 / gridSize[litem]) + '%',\n\t\t\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t\t\t\toverflow: 'hidden'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} // end if grid > 0\n\t\t\t\t} // end for loop\n\n\t\t\t\t// Add timezone options\n\t\t\t\tthis.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find(\"select\");\n\t\t\t\t$.fn.append.apply(this.timezone_select,\n\t\t\t\t$.map(o.timezoneList, function (val, idx) {\n\t\t\t\t\treturn $(\"<option />\").val(typeof val === \"object\" ? val.value : val).text(typeof val === \"object\" ? val.label : val);\n\t\t\t\t}));\n\t\t\t\tif (typeof(this.timezone) !== \"undefined\" && this.timezone !== null && this.timezone !== \"\") {\n\t\t\t\t\tvar local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1;\n\t\t\t\t\tif (local_timezone === this.timezone) {\n\t\t\t\t\t\tselectLocalTimezone(tp_inst);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.timezone_select.val(this.timezone);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (typeof(this.hour) !== \"undefined\" && this.hour !== null && this.hour !== \"\") {\n\t\t\t\t\t\tthis.timezone_select.val(o.timezone);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tselectLocalTimezone(tp_inst);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.timezone_select.change(function () {\n\t\t\t\t\ttp_inst._onTimeChange();\n\t\t\t\t\ttp_inst._onSelectHandler();\n\t\t\t\t\ttp_inst._afterInject();\n\t\t\t\t});\n\t\t\t\t// End timezone options\n\n\t\t\t\t// inject timepicker into datepicker\n\t\t\t\tvar $buttonPanel = $dp.find('.ui-datepicker-buttonpane');\n\t\t\t\tif ($buttonPanel.length) {\n\t\t\t\t\t$buttonPanel.before($tp);\n\t\t\t\t} else {\n\t\t\t\t\t$dp.append($tp);\n\t\t\t\t}\n\n\t\t\t\tthis.$timeObj = $tp.find('.ui_tpicker_time_input');\n\t\t\t\tthis.$timeObj.change(function () {\n\t\t\t\t\tvar timeFormat = tp_inst.inst.settings.timeFormat;\n\t\t\t\t\tvar parsedTime = $.datepicker.parseTime(timeFormat, this.value);\n\t\t\t\t\tvar update = new Date();\n\t\t\t\t\tif (parsedTime) {\n\t\t\t\t\t\tupdate.setHours(parsedTime.hour);\n\t\t\t\t\t\tupdate.setMinutes(parsedTime.minute);\n\t\t\t\t\t\tupdate.setSeconds(parsedTime.second);\n\t\t\t\t\t\t$.datepicker._setTime(tp_inst.inst, update);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.value = tp_inst.formattedTime;\n\t\t\t\t\t\tthis.blur();\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (this.inst !== null) {\n\t\t\t\t\tvar timeDefined = this.timeDefined;\n\t\t\t\t\tthis._onTimeChange();\n\t\t\t\t\tthis.timeDefined = timeDefined;\n\t\t\t\t}\n\n\t\t\t\t// slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/\n\t\t\t\tif (this._defaults.addSliderAccess) {\n\t\t\t\t\tvar sliderAccessArgs = this._defaults.sliderAccessArgs,\n\t\t\t\t\t\trtl = this._defaults.isRTL;\n\t\t\t\t\tsliderAccessArgs.isRTL = rtl;\n\n\t\t\t\t\tsetTimeout(function () { // fix for inline mode\n\t\t\t\t\t\tif ($tp.find('.ui-slider-access').length === 0) {\n\t\t\t\t\t\t\t$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);\n\n\t\t\t\t\t\t\t// fix any grids since sliders are shorter\n\t\t\t\t\t\t\tvar sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);\n\t\t\t\t\t\t\tif (sliderAccessWidth) {\n\t\t\t\t\t\t\t\t$tp.find('table:visible').each(function () {\n\t\t\t\t\t\t\t\t\tvar $g = $(this),\n\t\t\t\t\t\t\t\t\t\toldWidth = $g.outerWidth(),\n\t\t\t\t\t\t\t\t\t\toldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''),\n\t\t\t\t\t\t\t\t\t\tnewWidth = oldWidth - sliderAccessWidth,\n\t\t\t\t\t\t\t\t\t\tnewMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',\n\t\t\t\t\t\t\t\t\t\tcss = { width: newWidth, marginRight: 0, marginLeft: 0 };\n\t\t\t\t\t\t\t\t\tcss[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;\n\t\t\t\t\t\t\t\t\t$g.css(css);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 10);\n\t\t\t\t}\n\t\t\t\t// end slideAccess integration\n\n\t\t\t\ttp_inst._limitMinMaxDateTime(this.inst, true);\n\t\t\t}\n\t\t},\n\n\t\t/*\n\t\t* This function tries to limit the ability to go outside the\n\t\t* min/max date range\n\t\t*/\n\t\t_limitMinMaxDateTime: function (dp_inst, adjustSliders) {\n\t\t\tvar o = this._defaults,\n\t\t\t\tdp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);\n\n\t\t\tif (!this._defaults.showTimepicker) {\n\t\t\t\treturn;\n\t\t\t} // No time so nothing to check here\n\n\t\t\tif ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {\n\t\t\t\tvar minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),\n\t\t\t\t\tminDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);\n\n\t\t\t\tif (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {\n\t\t\t\t\tthis.hourMinOriginal = o.hourMin;\n\t\t\t\t\tthis.minuteMinOriginal = o.minuteMin;\n\t\t\t\t\tthis.secondMinOriginal = o.secondMin;\n\t\t\t\t\tthis.millisecMinOriginal = o.millisecMin;\n\t\t\t\t\tthis.microsecMinOriginal = o.microsecMin;\n\t\t\t\t}\n\n\t\t\t\tif (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {\n\t\t\t\t\tthis._defaults.hourMin = minDateTime.getHours();\n\t\t\t\t\tif (this.hour <= this._defaults.hourMin) {\n\t\t\t\t\t\tthis.hour = this._defaults.hourMin;\n\t\t\t\t\t\tthis._defaults.minuteMin = minDateTime.getMinutes();\n\t\t\t\t\t\tif (this.minute <= this._defaults.minuteMin) {\n\t\t\t\t\t\t\tthis.minute = this._defaults.minuteMin;\n\t\t\t\t\t\t\tthis._defaults.secondMin = minDateTime.getSeconds();\n\t\t\t\t\t\t\tif (this.second <= this._defaults.secondMin) {\n\t\t\t\t\t\t\t\tthis.second = this._defaults.secondMin;\n\t\t\t\t\t\t\t\tthis._defaults.millisecMin = minDateTime.getMilliseconds();\n\t\t\t\t\t\t\t\tif (this.millisec <= this._defaults.millisecMin) {\n\t\t\t\t\t\t\t\t\tthis.millisec = this._defaults.millisecMin;\n\t\t\t\t\t\t\t\t\tthis._defaults.microsecMin = minDateTime.getMicroseconds();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (this.microsec < this._defaults.microsecMin) {\n\t\t\t\t\t\t\t\t\t\tthis.microsec = this._defaults.microsecMin;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tthis._defaults.microsecMin = this.microsecMinOriginal;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._defaults.millisecMin = this.millisecMinOriginal;\n\t\t\t\t\t\t\t\tthis._defaults.microsecMin = this.microsecMinOriginal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis._defaults.secondMin = this.secondMinOriginal;\n\t\t\t\t\t\t\tthis._defaults.millisecMin = this.millisecMinOriginal;\n\t\t\t\t\t\t\tthis._defaults.microsecMin = this.microsecMinOriginal;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._defaults.minuteMin = this.minuteMinOriginal;\n\t\t\t\t\t\tthis._defaults.secondMin = this.secondMinOriginal;\n\t\t\t\t\t\tthis._defaults.millisecMin = this.millisecMinOriginal;\n\t\t\t\t\t\tthis._defaults.microsecMin = this.microsecMinOriginal;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._defaults.hourMin = this.hourMinOriginal;\n\t\t\t\t\tthis._defaults.minuteMin = this.minuteMinOriginal;\n\t\t\t\t\tthis._defaults.secondMin = this.secondMinOriginal;\n\t\t\t\t\tthis._defaults.millisecMin = this.millisecMinOriginal;\n\t\t\t\t\tthis._defaults.microsecMin = this.microsecMinOriginal;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {\n\t\t\t\tvar maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),\n\t\t\t\t\tmaxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);\n\n\t\t\t\tif (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {\n\t\t\t\t\tthis.hourMaxOriginal = o.hourMax;\n\t\t\t\t\tthis.minuteMaxOriginal = o.minuteMax;\n\t\t\t\t\tthis.secondMaxOriginal = o.secondMax;\n\t\t\t\t\tthis.millisecMaxOriginal = o.millisecMax;\n\t\t\t\t\tthis.microsecMaxOriginal = o.microsecMax;\n\t\t\t\t}\n\n\t\t\t\tif (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {\n\t\t\t\t\tthis._defaults.hourMax = maxDateTime.getHours();\n\t\t\t\t\tif (this.hour >= this._defaults.hourMax) {\n\t\t\t\t\t\tthis.hour = this._defaults.hourMax;\n\t\t\t\t\t\tthis._defaults.minuteMax = maxDateTime.getMinutes();\n\t\t\t\t\t\tif (this.minute >= this._defaults.minuteMax) {\n\t\t\t\t\t\t\tthis.minute = this._defaults.minuteMax;\n\t\t\t\t\t\t\tthis._defaults.secondMax = maxDateTime.getSeconds();\n\t\t\t\t\t\t\tif (this.second >= this._defaults.secondMax) {\n\t\t\t\t\t\t\t\tthis.second = this._defaults.secondMax;\n\t\t\t\t\t\t\t\tthis._defaults.millisecMax = maxDateTime.getMilliseconds();\n\t\t\t\t\t\t\t\tif (this.millisec >= this._defaults.millisecMax) {\n\t\t\t\t\t\t\t\t\tthis.millisec = this._defaults.millisecMax;\n\t\t\t\t\t\t\t\t\tthis._defaults.microsecMax = maxDateTime.getMicroseconds();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (this.microsec > this._defaults.microsecMax) {\n\t\t\t\t\t\t\t\t\t\tthis.microsec = this._defaults.microsecMax;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tthis._defaults.microsecMax = this.microsecMaxOriginal;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._defaults.millisecMax = this.millisecMaxOriginal;\n\t\t\t\t\t\t\t\tthis._defaults.microsecMax = this.microsecMaxOriginal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis._defaults.secondMax = this.secondMaxOriginal;\n\t\t\t\t\t\t\tthis._defaults.millisecMax = this.millisecMaxOriginal;\n\t\t\t\t\t\t\tthis._defaults.microsecMax = this.microsecMaxOriginal;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._defaults.minuteMax = this.minuteMaxOriginal;\n\t\t\t\t\t\tthis._defaults.secondMax = this.secondMaxOriginal;\n\t\t\t\t\t\tthis._defaults.millisecMax = this.millisecMaxOriginal;\n\t\t\t\t\t\tthis._defaults.microsecMax = this.microsecMaxOriginal;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._defaults.hourMax = this.hourMaxOriginal;\n\t\t\t\t\tthis._defaults.minuteMax = this.minuteMaxOriginal;\n\t\t\t\t\tthis._defaults.secondMax = this.secondMaxOriginal;\n\t\t\t\t\tthis._defaults.millisecMax = this.millisecMaxOriginal;\n\t\t\t\t\tthis._defaults.microsecMax = this.microsecMaxOriginal;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (dp_inst.settings.minTime!==null) {\n\t\t\t\tvar tempMinTime=new Date(\"01/01/1970 \" + dp_inst.settings.minTime);\n\t\t\t\tif (this.hour<tempMinTime.getHours()) {\n\t\t\t\t\tthis.hour=this._defaults.hourMin=tempMinTime.getHours();\n\t\t\t\t\tthis.minute=this._defaults.minuteMin=tempMinTime.getMinutes();\n\t\t\t\t} else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) {\n\t\t\t\t\tthis.minute=this._defaults.minuteMin=tempMinTime.getMinutes();\n\t\t\t\t} else {\n\t\t\t\t\tif (this._defaults.hourMin<tempMinTime.getHours()) {\n\t\t\t\t\t\tthis._defaults.hourMin=tempMinTime.getHours();\n\t\t\t\t\t\tthis._defaults.minuteMin=tempMinTime.getMinutes();\n\t\t\t\t\t} else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) {\n\t\t\t\t\t\tthis._defaults.minuteMin=tempMinTime.getMinutes();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._defaults.minuteMin=0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (dp_inst.settings.maxTime!==null) {\n\t\t\t\tvar tempMaxTime=new Date(\"01/01/1970 \" + dp_inst.settings.maxTime);\n\t\t\t\tif (this.hour>tempMaxTime.getHours()) {\n\t\t\t\t\tthis.hour=this._defaults.hourMax=tempMaxTime.getHours();\n\t\t\t\t\tthis.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();\n\t\t\t\t} else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {\n\t\t\t\t\tthis.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();\n\t\t\t\t} else {\n\t\t\t\t\tif (this._defaults.hourMax>tempMaxTime.getHours()) {\n\t\t\t\t\t\tthis._defaults.hourMax=tempMaxTime.getHours();\n\t\t\t\t\t\tthis._defaults.minuteMax=tempMaxTime.getMinutes();\n\t\t\t\t\t} else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) {\n\t\t\t\t\t\tthis._defaults.minuteMax=tempMaxTime.getMinutes();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._defaults.minuteMax=59;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (adjustSliders !== undefined && adjustSliders === true) {\n\t\t\t\tvar hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),\n\t\t\t\t\tminMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),\n\t\t\t\t\tsecMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),\n\t\t\t\t\tmillisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10),\n\t\t\t\t\tmicrosecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);\n\n\t\t\t\tif (this.hour_slider) {\n\t\t\t\t\tthis.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour });\n\t\t\t\t\tthis.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));\n\t\t\t\t}\n\t\t\t\tif (this.minute_slider) {\n\t\t\t\t\tthis.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute });\n\t\t\t\t\tthis.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));\n\t\t\t\t}\n\t\t\t\tif (this.second_slider) {\n\t\t\t\t\tthis.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond });\n\t\t\t\t\tthis.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));\n\t\t\t\t}\n\t\t\t\tif (this.millisec_slider) {\n\t\t\t\t\tthis.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec });\n\t\t\t\t\tthis.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));\n\t\t\t\t}\n\t\t\t\tif (this.microsec_slider) {\n\t\t\t\t\tthis.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax, step: this._defaults.stepMicrosec });\n\t\t\t\t\tthis.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec));\n\t\t\t\t}\n\t\t\t}\n\n\t\t},\n\n\t\t/*\n\t\t* when a slider moves, set the internal time...\n\t\t* on time change is also called when the time is updated in the text field\n\t\t*/\n\t\t_onTimeChange: function () {\n\t\t\tif (!this._defaults.showTimepicker) {\n return;\n\t\t\t}\n\t\t\tvar hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,\n\t\t\t\tminute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,\n\t\t\t\tsecond = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,\n\t\t\t\tmillisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,\n\t\t\t\tmicrosec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, 'microsec') : false,\n\t\t\t\ttimezone = (this.timezone_select) ? this.timezone_select.val() : false,\n\t\t\t\to = this._defaults,\n\t\t\t\tpickerTimeFormat = o.pickerTimeFormat || o.timeFormat,\n\t\t\t\tpickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;\n\n\t\t\tif (typeof(hour) === 'object') {\n\t\t\t\thour = false;\n\t\t\t}\n\t\t\tif (typeof(minute) === 'object') {\n\t\t\t\tminute = false;\n\t\t\t}\n\t\t\tif (typeof(second) === 'object') {\n\t\t\t\tsecond = false;\n\t\t\t}\n\t\t\tif (typeof(millisec) === 'object') {\n\t\t\t\tmillisec = false;\n\t\t\t}\n\t\t\tif (typeof(microsec) === 'object') {\n\t\t\t\tmicrosec = false;\n\t\t\t}\n\t\t\tif (typeof(timezone) === 'object') {\n\t\t\t\ttimezone = false;\n\t\t\t}\n\n\t\t\tif (hour !== false) {\n\t\t\t\thour = parseInt(hour, 10);\n\t\t\t}\n\t\t\tif (minute !== false) {\n\t\t\t\tminute = parseInt(minute, 10);\n\t\t\t}\n\t\t\tif (second !== false) {\n\t\t\t\tsecond = parseInt(second, 10);\n\t\t\t}\n\t\t\tif (millisec !== false) {\n\t\t\t\tmillisec = parseInt(millisec, 10);\n\t\t\t}\n\t\t\tif (microsec !== false) {\n\t\t\t\tmicrosec = parseInt(microsec, 10);\n\t\t\t}\n\t\t\tif (timezone !== false) {\n\t\t\t\ttimezone = timezone.toString();\n\t\t\t}\n\n\t\t\tvar ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];\n\n\t\t\t// If the update was done in the input field, the input field should not be updated.\n\t\t\t// If the update was done using the sliders, update the input field.\n\t\t\tvar hasChanged = (\n\t\t\t\t\t\thour !== parseInt(this.hour,10) || // sliders should all be numeric\n\t\t\t\t\t\tminute !== parseInt(this.minute,10) ||\n\t\t\t\t\t\tsecond !== parseInt(this.second,10) ||\n\t\t\t\t\t\tmillisec !== parseInt(this.millisec,10) ||\n\t\t\t\t\t\tmicrosec !== parseInt(this.microsec,10) ||\n\t\t\t\t\t\t(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||\n\t\t\t\t\t\t(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or \"EST\" format, so use toString()\n\t\t\t\t\t);\n\n\t\t\tif (hasChanged) {\n\n\t\t\t\tif (hour !== false) {\n\t\t\t\t\tthis.hour = hour;\n\t\t\t\t}\n\t\t\t\tif (minute !== false) {\n\t\t\t\t\tthis.minute = minute;\n\t\t\t\t}\n\t\t\t\tif (second !== false) {\n\t\t\t\t\tthis.second = second;\n\t\t\t\t}\n\t\t\t\tif (millisec !== false) {\n\t\t\t\t\tthis.millisec = millisec;\n\t\t\t\t}\n\t\t\t\tif (microsec !== false) {\n\t\t\t\t\tthis.microsec = microsec;\n\t\t\t\t}\n\t\t\t\tif (timezone !== false) {\n\t\t\t\t\tthis.timezone = timezone;\n\t\t\t\t}\n\n\t\t\t\tif (!this.inst) {\n\t\t\t\t\tthis.inst = $.datepicker._getInst(this.$input[0]);\n\t\t\t\t}\n\n\t\t\t\tthis._limitMinMaxDateTime(this.inst, true);\n\t\t\t}\n\t\t\tif (this.support.ampm) {\n\t\t\t\tthis.ampm = ampm;\n\t\t\t}\n\n\t\t\t// Updates the time within the timepicker\n\t\t\tthis.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);\n\t\t\tif (this.$timeObj) {\n\t\t\t\tif (pickerTimeFormat === o.timeFormat) {\n\t\t\t\t\tthis.$timeObj.val(this.formattedTime + pickerTimeSuffix);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);\n\t\t\t\t}\n\t\t\t\tif (this.$timeObj[0].setSelectionRange) {\n\t\t\t\t\tvar sPos = this.$timeObj[0].selectionStart;\n\t\t\t\t\tvar ePos = this.$timeObj[0].selectionEnd;\n\t\t\t\t\tthis.$timeObj[0].setSelectionRange(sPos, ePos);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.timeDefined = true;\n\t\t\tif (hasChanged) {\n\t\t\t\tthis._updateDateTime();\n\t\t\t\t//this.$input.focus(); // may automatically open the picker on setDate\n\t\t\t}\n\t\t},\n\n\t\t/*\n\t\t* call custom onSelect.\n\t\t* bind to sliders slidestop, and grid click.\n\t\t*/\n\t\t_onSelectHandler: function () {\n\t\t\tvar onSelect = this._defaults.onSelect || this.inst.settings.onSelect;\n\t\t\tvar inputEl = this.$input ? this.$input[0] : null;\n\t\t\tif (onSelect && inputEl) {\n\t\t\t\tonSelect.apply(inputEl, [this.formattedDateTime, this]);\n\t\t\t}\n\t\t},\n\n\t\t/*\n\t\t* update our input with the new date time..\n\t\t*/\n\t\t_updateDateTime: function (dp_inst) {\n\t\t\tdp_inst = this.inst || dp_inst;\n\t\t\tvar dtTmp = (dp_inst.currentYear > 0?\n\t\t\t\t\t\t\tnew Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :\n\t\t\t\t\t\t\tnew Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),\n\t\t\t\tdt = $.datepicker._daylightSavingAdjust(dtTmp),\n\t\t\t\t//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),\n\t\t\t\t//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)),\n\t\t\t\tdateFmt = $.datepicker._get(dp_inst, 'dateFormat'),\n\t\t\t\tformatCfg = $.datepicker._getFormatConfig(dp_inst),\n\t\t\t\ttimeAvailable = dt !== null && this.timeDefined;\n\t\t\tthis.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);\n\t\t\tvar formattedDateTime = this.formattedDate;\n\n\t\t\t// if a slider was changed but datepicker doesn't have a value yet, set it\n\t\t\tif (dp_inst.lastVal === \"\") {\n dp_inst.currentYear = dp_inst.selectedYear;\n dp_inst.currentMonth = dp_inst.selectedMonth;\n dp_inst.currentDay = dp_inst.selectedDay;\n }\n\n\t\t\t/*\n\t\t\t* remove following lines to force every changes in date picker to change the input value\n\t\t\t* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.\n\t\t\t* If the user manually empty the value in the input field, the date picker will never change selected value.\n\t\t\t*/\n\t\t\t//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {\n\t\t\t//\treturn;\n\t\t\t//}\n\n\t\t\tif (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {\n\t\t\t\tformattedDateTime = this.formattedTime;\n\t\t\t} else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {\n\t\t\t\tformattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;\n\t\t\t}\n\n\t\t\tthis.formattedDateTime = formattedDateTime;\n\n\t\t\tif (!this._defaults.showTimepicker) {\n\t\t\t\tthis.$input.val(this.formattedDate);\n\t\t\t} else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {\n\t\t\t\tthis.$altInput.val(this.formattedTime);\n\t\t\t\tthis.$input.val(this.formattedDate);\n\t\t\t} else if (this.$altInput) {\n\t\t\t\tthis.$input.val(formattedDateTime);\n\t\t\t\tvar altFormattedDateTime = '',\n\t\t\t\t\taltSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator,\n\t\t\t\t\taltTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;\n\n\t\t\t\tif (!this._defaults.timeOnly) {\n\t\t\t\t\tif (this._defaults.altFormat) {\n\t\t\t\t\t\taltFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\taltFormattedDateTime = this.formattedDate;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (altFormattedDateTime) {\n\t\t\t\t\t\taltFormattedDateTime += altSeparator;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this._defaults.altTimeFormat !== null) {\n\t\t\t\t\taltFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\taltFormattedDateTime += this.formattedTime + altTimeSuffix;\n\t\t\t\t}\n\t\t\t\tthis.$altInput.val(altFormattedDateTime);\n\t\t\t} else {\n\t\t\t\tthis.$input.val(formattedDateTime);\n\t\t\t}\n\n\t\t\tthis.$input.trigger(\"change\");\n\t\t},\n\n\t\t_onFocus: function () {\n\t\t\tif (!this.$input.val() && this._defaults.defaultValue) {\n\t\t\t\tthis.$input.val(this._defaults.defaultValue);\n\t\t\t\tvar inst = $.datepicker._getInst(this.$input.get(0)),\n\t\t\t\t\ttp_inst = $.datepicker._get(inst, 'timepicker');\n\t\t\t\tif (tp_inst) {\n\t\t\t\t\tif (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$.datepicker._updateDatepicker(inst);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t$.timepicker.log(err);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/*\n\t\t* Small abstraction to control types\n\t\t* We can add more, just be sure to follow the pattern: create, options, value\n\t\t*/\n\t\t_controls: {\n\t\t\t// slider methods\n\t\t\tslider: {\n\t\t\t\tcreate: function (tp_inst, obj, unit, val, min, max, step) {\n\t\t\t\t\tvar rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60\n\t\t\t\t\treturn obj.prop('slide', null).slider({\n\t\t\t\t\t\torientation: \"horizontal\",\n\t\t\t\t\t\tvalue: rtl ? val * -1 : val,\n\t\t\t\t\t\tmin: rtl ? max * -1 : min,\n\t\t\t\t\t\tmax: rtl ? min * -1 : max,\n\t\t\t\t\t\tstep: step,\n\t\t\t\t\t\tslide: function (event, ui) {\n\t\t\t\t\t\t\ttp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);\n\t\t\t\t\t\t\ttp_inst._onTimeChange();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstop: function (event, ui) {\n\t\t\t\t\t\t\ttp_inst._onSelectHandler();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\toptions: function (tp_inst, obj, unit, opts, val) {\n\t\t\t\t\tif (tp_inst._defaults.isRTL) {\n\t\t\t\t\t\tif (typeof(opts) === 'string') {\n\t\t\t\t\t\t\tif (opts === 'min' || opts === 'max') {\n\t\t\t\t\t\t\t\tif (val !== undefined) {\n\t\t\t\t\t\t\t\t\treturn obj.slider(opts, val * -1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn Math.abs(obj.slider(opts));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn obj.slider(opts);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar min = opts.min,\n\t\t\t\t\t\t\tmax = opts.max;\n\t\t\t\t\t\topts.min = opts.max = null;\n\t\t\t\t\t\tif (min !== undefined) {\n\t\t\t\t\t\t\topts.max = min * -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (max !== undefined) {\n\t\t\t\t\t\t\topts.min = max * -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn obj.slider(opts);\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof(opts) === 'string' && val !== undefined) {\n\t\t\t\t\t\treturn obj.slider(opts, val);\n\t\t\t\t\t}\n\t\t\t\t\treturn obj.slider(opts);\n\t\t\t\t},\n\t\t\t\tvalue: function (tp_inst, obj, unit, val) {\n\t\t\t\t\tif (tp_inst._defaults.isRTL) {\n\t\t\t\t\t\tif (val !== undefined) {\n\t\t\t\t\t\t\treturn obj.slider('value', val * -1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Math.abs(obj.slider('value'));\n\t\t\t\t\t}\n\t\t\t\t\tif (val !== undefined) {\n\t\t\t\t\t\treturn obj.slider('value', val);\n\t\t\t\t\t}\n\t\t\t\t\treturn obj.slider('value');\n\t\t\t\t}\n\t\t\t},\n\t\t\t// select methods\n\t\t\tselect: {\n\t\t\t\tcreate: function (tp_inst, obj, unit, val, min, max, step) {\n\t\t\t\t\tvar sel = '<select class=\"ui-timepicker-select ui-state-default ui-corner-all\" data-unit=\"' + unit + '\" data-min=\"' + min + '\" data-max=\"' + max + '\" data-step=\"' + step + '\">',\n\t\t\t\t\t\tformat = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;\n\n\t\t\t\t\tfor (var i = min; i <= max; i += step) {\n\t\t\t\t\t\tsel += '<option value=\"' + i + '\"' + (i === val ? ' selected' : '') + '>';\n\t\t\t\t\t\tif (unit === 'hour') {\n\t\t\t\t\t\t\tsel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, '')), {hour: i}, tp_inst._defaults);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; }\n\t\t\t\t\t\telse {sel += '0' + i.toString(); }\n\t\t\t\t\t\tsel += '</option>';\n\t\t\t\t\t}\n\t\t\t\t\tsel += '</select>';\n\n\t\t\t\t\tobj.children('select').remove();\n\n\t\t\t\t\t$(sel).appendTo(obj).change(function (e) {\n\t\t\t\t\t\ttp_inst._onTimeChange();\n\t\t\t\t\t\ttp_inst._onSelectHandler();\n\t\t\t\t\t\ttp_inst._afterInject();\n\t\t\t\t\t});\n\n\t\t\t\t\treturn obj;\n\t\t\t\t},\n\t\t\t\toptions: function (tp_inst, obj, unit, opts, val) {\n\t\t\t\t\tvar o = {},\n\t\t\t\t\t\t$t = obj.children('select');\n\t\t\t\t\tif (typeof(opts) === 'string') {\n\t\t\t\t\t\tif (val === undefined) {\n\t\t\t\t\t\t\treturn $t.data(opts);\n\t\t\t\t\t\t}\n\t\t\t\t\t\to[opts] = val;\n\t\t\t\t\t}\n\t\t\t\t\telse { o = opts; }\n\t\t\t\t\treturn tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min>=0 ? o.min : $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));\n\t\t\t\t},\n\t\t\t\tvalue: function (tp_inst, obj, unit, val) {\n\t\t\t\t\tvar $t = obj.children('select');\n\t\t\t\t\tif (val !== undefined) {\n\t\t\t\t\t\treturn $t.val(val);\n\t\t\t\t\t}\n\t\t\t\t\treturn $t.val();\n\t\t\t\t}\n\t\t\t}\n\t\t} // end _controls\n\n\t});\n\n\t$.fn.extend({\n\t\t/*\n\t\t* shorthand just to use timepicker.\n\t\t*/\n\t\ttimepicker: function (o) {\n\t\t\to = o || {};\n\t\t\tvar tmp_args = Array.prototype.slice.call(arguments);\n\n\t\t\tif (typeof o === 'object') {\n\t\t\t\ttmp_args[0] = $.extend(o, {\n\t\t\t\t\ttimeOnly: true\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn $(this).each(function () {\n\t\t\t\t$.fn.datetimepicker.apply($(this), tmp_args);\n\t\t\t});\n\t\t},\n\n\t\t/*\n\t\t* extend timepicker to datepicker\n\t\t*/\n\t\tdatetimepicker: function (o) {\n\t\t\to = o || {};\n\t\t\tvar tmp_args = arguments;\n\n\t\t\tif (typeof(o) === 'string') {\n\t\t\t\tif (o === 'getDate' || (o === 'option' && tmp_args.length === 2 && typeof (tmp_args[1]) === 'string')) {\n\t\t\t\t\treturn $.fn.datepicker.apply($(this[0]), tmp_args);\n\t\t\t\t} else {\n\t\t\t\t\treturn this.each(function () {\n\t\t\t\t\t\tvar $t = $(this);\n\t\t\t\t\t\t$t.datepicker.apply($t, tmp_args);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn this.each(function () {\n\t\t\t\t\tvar $t = $(this);\n\t\t\t\t\t$t.datepicker($.timepicker._newInst($t, o)._defaults);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\n\t/*\n\t* Public Utility to parse date and time\n\t*/\n\t$.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {\n\t\tvar parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);\n\t\tif (parseRes.timeObj) {\n\t\t\tvar t = parseRes.timeObj;\n\t\t\tparseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);\n\t\t\tparseRes.date.setMicroseconds(t.microsec);\n\t\t}\n\n\t\treturn parseRes.date;\n\t};\n\n\t/*\n\t* Public utility to parse time\n\t*/\n\t$.datepicker.parseTime = function (timeFormat, timeString, options) {\n\t\tvar o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),\n\t\t\tiso8601 = (timeFormat.replace(/\\'.*?\\'/g, '').indexOf('Z') !== -1);\n\n\t\t// Strict parse requires the timeString to match the timeFormat exactly\n\t\tvar strictParse = function (f, s, o) {\n\n\t\t\t// pattern for standard and localized AM/PM markers\n\t\t\tvar getPatternAmpm = function (amNames, pmNames) {\n\t\t\t\tvar markers = [];\n\t\t\t\tif (amNames) {\n\t\t\t\t\t$.merge(markers, amNames);\n\t\t\t\t}\n\t\t\t\tif (pmNames) {\n\t\t\t\t\t$.merge(markers, pmNames);\n\t\t\t\t}\n\t\t\t\tmarkers = $.map(markers, function (val) {\n\t\t\t\t\treturn val.replace(/[.*+?|()\\[\\]{}\\\\]/g, '\\\\$&');\n\t\t\t\t});\n\t\t\t\treturn '(' + markers.join('|') + ')?';\n\t\t\t};\n\n\t\t\t// figure out position of time elements.. cause js cant do named captures\n\t\t\tvar getFormatPositions = function (timeFormat) {\n\t\t\t\tvar finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),\n\t\t\t\t\torders = {\n\t\t\t\t\t\th: -1,\n\t\t\t\t\t\tm: -1,\n\t\t\t\t\t\ts: -1,\n\t\t\t\t\t\tl: -1,\n\t\t\t\t\t\tc: -1,\n\t\t\t\t\t\tt: -1,\n\t\t\t\t\t\tz: -1\n\t\t\t\t\t};\n\n\t\t\t\tif (finds) {\n\t\t\t\t\tfor (var i = 0; i < finds.length; i++) {\n\t\t\t\t\t\tif (orders[finds[i].toString().charAt(0)] === -1) {\n\t\t\t\t\t\t\torders[finds[i].toString().charAt(0)] = i + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn orders;\n\t\t\t};\n\n\t\t\tvar regstr = '^' + f.toString()\n\t\t\t\t\t.replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {\n\t\t\t\t\t\t\tvar ml = match.length;\n\t\t\t\t\t\t\tswitch (match.charAt(0).toLowerCase()) {\n\t\t\t\t\t\t\tcase 'h':\n\t\t\t\t\t\t\t\treturn ml === 1 ? '(\\\\d?\\\\d)' : '(\\\\d{' + ml + '})';\n\t\t\t\t\t\t\tcase 'm':\n\t\t\t\t\t\t\t\treturn ml === 1 ? '(\\\\d?\\\\d)' : '(\\\\d{' + ml + '})';\n\t\t\t\t\t\t\tcase 's':\n\t\t\t\t\t\t\t\treturn ml === 1 ? '(\\\\d?\\\\d)' : '(\\\\d{' + ml + '})';\n\t\t\t\t\t\t\tcase 'l':\n\t\t\t\t\t\t\t\treturn '(\\\\d?\\\\d?\\\\d)';\n\t\t\t\t\t\t\tcase 'c':\n\t\t\t\t\t\t\t\treturn '(\\\\d?\\\\d?\\\\d)';\n\t\t\t\t\t\t\tcase 'z':\n\t\t\t\t\t\t\t\treturn '(z|[-+]\\\\d\\\\d:?\\\\d\\\\d|\\\\S+)?';\n\t\t\t\t\t\t\tcase 't':\n\t\t\t\t\t\t\t\treturn getPatternAmpm(o.amNames, o.pmNames);\n\t\t\t\t\t\t\tdefault: // literal escaped in quotes\n\t\t\t\t\t\t\t\treturn '(' + match.replace(/\\'/g, \"\").replace(/(\\.|\\$|\\^|\\\\|\\/|\\(|\\)|\\[|\\]|\\?|\\+|\\*)/g, function (m) { return \"\\\\\" + m; }) + ')?';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t.replace(/\\s/g, '\\\\s?') +\n\t\t\t\t\to.timeSuffix + '$',\n\t\t\t\torder = getFormatPositions(f),\n\t\t\t\tampm = '',\n\t\t\t\ttreg;\n\n\t\t\ttreg = s.match(new RegExp(regstr, 'i'));\n\n\t\t\tvar resTime = {\n\t\t\t\thour: 0,\n\t\t\t\tminute: 0,\n\t\t\t\tsecond: 0,\n\t\t\t\tmillisec: 0,\n\t\t\t\tmicrosec: 0\n\t\t\t};\n\n\t\t\tif (treg) {\n\t\t\t\tif (order.t !== -1) {\n\t\t\t\t\tif (treg[order.t] === undefined || treg[order.t].length === 0) {\n\t\t\t\t\t\tampm = '';\n\t\t\t\t\t\tresTime.ampm = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tampm = $.inArray(treg[order.t].toUpperCase(), $.map(o.amNames, function (x,i) { return x.toUpperCase(); })) !== -1 ? 'AM' : 'PM';\n\t\t\t\t\t\tresTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (order.h !== -1) {\n\t\t\t\t\tif (ampm === 'AM' && treg[order.h] === '12') {\n\t\t\t\t\t\tresTime.hour = 0; // 12am = 0 hour\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (ampm === 'PM' && treg[order.h] !== '12') {\n\t\t\t\t\t\t\tresTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresTime.hour = Number(treg[order.h]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (order.m !== -1) {\n\t\t\t\t\tresTime.minute = Number(treg[order.m]);\n\t\t\t\t}\n\t\t\t\tif (order.s !== -1) {\n\t\t\t\t\tresTime.second = Number(treg[order.s]);\n\t\t\t\t}\n\t\t\t\tif (order.l !== -1) {\n\t\t\t\t\tresTime.millisec = Number(treg[order.l]);\n\t\t\t\t}\n\t\t\t\tif (order.c !== -1) {\n\t\t\t\t\tresTime.microsec = Number(treg[order.c]);\n\t\t\t\t}\n\t\t\t\tif (order.z !== -1 && treg[order.z] !== undefined) {\n\t\t\t\t\tresTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z]);\n\t\t\t\t}\n\n\n\t\t\t\treturn resTime;\n\t\t\t}\n\t\t\treturn false;\n\t\t};// end strictParse\n\n\t\t// First try JS Date, if that fails, use strictParse\n\t\tvar looseParse = function (f, s, o) {\n\t\t\ttry {\n\t\t\t\tvar d = new Date('2012-01-01 ' + s);\n\t\t\t\tif (isNaN(d.getTime())) {\n\t\t\t\t\td = new Date('2012-01-01T' + s);\n\t\t\t\t\tif (isNaN(d.getTime())) {\n\t\t\t\t\t\td = new Date('01/01/2012 ' + s);\n\t\t\t\t\t\tif (isNaN(d.getTime())) {\n\t\t\t\t\t\t\tthrow \"Unable to parse time with native Date: \" + s;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\thour: d.getHours(),\n\t\t\t\t\tminute: d.getMinutes(),\n\t\t\t\t\tsecond: d.getSeconds(),\n\t\t\t\t\tmillisec: d.getMilliseconds(),\n\t\t\t\t\tmicrosec: d.getMicroseconds(),\n\t\t\t\t\ttimezone: d.getTimezoneOffset() * -1\n\t\t\t\t};\n\t\t\t}\n\t\t\tcatch (err) {\n\t\t\t\ttry {\n\t\t\t\t\treturn strictParse(f, s, o);\n\t\t\t\t}\n\t\t\t\tcatch (err2) {\n\t\t\t\t\t$.timepicker.log(\"Unable to parse \\ntimeString: \" + s + \"\\ntimeFormat: \" + f);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}; // end looseParse\n\n\t\tif (typeof o.parse === \"function\") {\n\t\t\treturn o.parse(timeFormat, timeString, o);\n\t\t}\n\t\tif (o.parse === 'loose') {\n\t\t\treturn looseParse(timeFormat, timeString, o);\n\t\t}\n\t\treturn strictParse(timeFormat, timeString, o);\n\t};\n\n\t/**\n\t * Public utility to format the time\n\t * @param {string} format format of the time\n\t * @param {Object} time Object not a Date for timezones\n\t * @param {Object} [options] essentially the regional[].. amNames, pmNames, ampm\n\t * @returns {string} the formatted time\n\t */\n\t$.datepicker.formatTime = function (format, time, options) {\n\t\toptions = options || {};\n\t\toptions = $.extend({}, $.timepicker._defaults, options);\n\t\ttime = $.extend({\n\t\t\thour: 0,\n\t\t\tminute: 0,\n\t\t\tsecond: 0,\n\t\t\tmillisec: 0,\n\t\t\tmicrosec: 0,\n\t\t\ttimezone: null\n\t\t}, time);\n\n\t\tvar tmptime = format,\n\t\t\tampmName = options.amNames[0],\n\t\t\thour = parseInt(time.hour, 10);\n\n\t\tif (hour > 11) {\n\t\t\tampmName = options.pmNames[0];\n\t\t}\n\n\t\ttmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {\n\t\t\tswitch (match) {\n\t\t\tcase 'HH':\n\t\t\t\treturn ('0' + hour).slice(-2);\n\t\t\tcase 'H':\n\t\t\t\treturn hour;\n\t\t\tcase 'hh':\n\t\t\t\treturn ('0' + convert24to12(hour)).slice(-2);\n\t\t\tcase 'h':\n\t\t\t\treturn convert24to12(hour);\n\t\t\tcase 'mm':\n\t\t\t\treturn ('0' + time.minute).slice(-2);\n\t\t\tcase 'm':\n\t\t\t\treturn time.minute;\n\t\t\tcase 'ss':\n\t\t\t\treturn ('0' + time.second).slice(-2);\n\t\t\tcase 's':\n\t\t\t\treturn time.second;\n\t\t\tcase 'l':\n\t\t\t\treturn ('00' + time.millisec).slice(-3);\n\t\t\tcase 'c':\n\t\t\t\treturn ('00' + time.microsec).slice(-3);\n\t\t\tcase 'z':\n\t\t\t\treturn $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);\n\t\t\tcase 'Z':\n\t\t\t\treturn $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);\n\t\t\tcase 'T':\n\t\t\t\treturn ampmName.charAt(0).toUpperCase();\n\t\t\tcase 'TT':\n\t\t\t\treturn ampmName.toUpperCase();\n\t\t\tcase 't':\n\t\t\t\treturn ampmName.charAt(0).toLowerCase();\n\t\t\tcase 'tt':\n\t\t\t\treturn ampmName.toLowerCase();\n\t\t\tdefault:\n\t\t\t\treturn match.replace(/'/g, \"\");\n\t\t\t}\n\t\t});\n\n\t\treturn tmptime;\n\t};\n\n\t/*\n\t* the bad hack :/ override datepicker so it doesn't close on select\n\t// inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378\n\t*/\n\t$.datepicker._base_selectDate = $.datepicker._selectDate;\n\t$.datepicker._selectDate = function (id, dateStr) {\n\t\tvar inst = this._getInst($(id)[0]),\n\t\t\ttp_inst = this._get(inst, 'timepicker'),\n\t\t\twas_inline;\n\n\t\tif (tp_inst && inst.settings.showTimepicker) {\n\t\t\ttp_inst._limitMinMaxDateTime(inst, true);\n\t\t\twas_inline = inst.inline;\n\t\t\tinst.inline = inst.stay_open = true;\n\t\t\t//This way the onSelect handler called from calendarpicker get the full dateTime\n\t\t\tthis._base_selectDate(id, dateStr);\n\t\t\tinst.inline = was_inline;\n\t\t\tinst.stay_open = false;\n\t\t\tthis._notifyChange(inst);\n\t\t\tthis._updateDatepicker(inst);\n\t\t} else {\n\t\t\tthis._base_selectDate(id, dateStr);\n\t\t}\n\t};\n\n\t/*\n\t* second bad hack :/ override datepicker so it triggers an event when changing the input field\n\t* and does not redraw the datepicker on every selectDate event\n\t*/\n\t$.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;\n\t$.datepicker._updateDatepicker = function (inst) {\n\n\t\t// don't popup the datepicker if there is another instance already opened\n\t\tvar input = inst.input[0];\n\t\tif ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {\n\n\t\t\tthis._base_updateDatepicker(inst);\n\n\t\t\t// Reload the time control when changing something in the input text field.\n\t\t\tvar tp_inst = this._get(inst, 'timepicker');\n\t\t\tif (tp_inst) {\n\t\t\t\ttp_inst._addTimePicker(inst);\n\t\t\t}\n\t\t}\n\t};\n\n\t/*\n\t* third bad hack :/ override datepicker so it allows spaces and colon in the input field\n\t*/\n\t$.datepicker._base_doKeyPress = $.datepicker._doKeyPress;\n\t$.datepicker._doKeyPress = function (event) {\n\t\tvar inst = $.datepicker._getInst(event.target),\n\t\t\ttp_inst = $.datepicker._get(inst, 'timepicker');\n\n\t\tif (tp_inst) {\n\t\t\tif ($.datepicker._get(inst, 'constrainInput')) {\n\t\t\t\tvar ampm = tp_inst.support.ampm,\n\t\t\t\t\ttz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone,\n\t\t\t\t\tdateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),\n\t\t\t\t\tdatetimeChars = tp_inst._defaults.timeFormat.toString()\n\t\t\t\t\t\t\t\t\t\t\t.replace(/[hms]/g, '')\n\t\t\t\t\t\t\t\t\t\t\t.replace(/TT/g, ampm ? 'APM' : '')\n\t\t\t\t\t\t\t\t\t\t\t.replace(/Tt/g, ampm ? 'AaPpMm' : '')\n\t\t\t\t\t\t\t\t\t\t\t.replace(/tT/g, ampm ? 'AaPpMm' : '')\n\t\t\t\t\t\t\t\t\t\t\t.replace(/T/g, ampm ? 'AP' : '')\n\t\t\t\t\t\t\t\t\t\t\t.replace(/tt/g, ampm ? 'apm' : '')\n\t\t\t\t\t\t\t\t\t\t\t.replace(/t/g, ampm ? 'ap' : '') +\n\t\t\t\t\t\t\t\t\t\t\t\" \" + tp_inst._defaults.separator +\n\t\t\t\t\t\t\t\t\t\t\ttp_inst._defaults.timeSuffix +\n\t\t\t\t\t\t\t\t\t\t\t(tz ? tp_inst._defaults.timezoneList.join('') : '') +\n\t\t\t\t\t\t\t\t\t\t\t(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +\n\t\t\t\t\t\t\t\t\t\t\tdateChars,\n\t\t\t\t\tchr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);\n\t\t\t\treturn event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);\n\t\t\t}\n\t\t}\n\n\t\treturn $.datepicker._base_doKeyPress(event);\n\t};\n\n\t/*\n\t* Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField\n\t* Update any alternate field to synchronise with the main field.\n\t*/\n\t$.datepicker._base_updateAlternate = $.datepicker._updateAlternate;\n\t$.datepicker._updateAlternate = function (inst) {\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\t\tif (tp_inst) {\n\t\t\tvar altField = tp_inst._defaults.altField;\n\t\t\tif (altField) { // update alternate field too\n\t\t\t\tvar altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,\n\t\t\t\t\tdate = this._getDate(inst),\n\t\t\t\t\tformatCfg = $.datepicker._getFormatConfig(inst),\n\t\t\t\t\taltFormattedDateTime = '',\n\t\t\t\t\taltSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,\n\t\t\t\t\taltTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,\n\t\t\t\t\taltTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;\n\n\t\t\t\taltFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;\n\t\t\t\tif (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {\n\t\t\t\t\tif (tp_inst._defaults.altFormat) {\n\t\t\t\t\t\taltFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\taltFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$(altField).val( inst.input.val() ? altFormattedDateTime : \"\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$.datepicker._base_updateAlternate(inst);\n\t\t}\n\t};\n\n\t/*\n\t* Override key up event to sync manual input changes.\n\t*/\n\t$.datepicker._base_doKeyUp = $.datepicker._doKeyUp;\n\t$.datepicker._doKeyUp = function (event) {\n\t\tvar inst = $.datepicker._getInst(event.target),\n\t\t\ttp_inst = $.datepicker._get(inst, 'timepicker');\n\n\t\tif (tp_inst) {\n\t\t\tif (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {\n\t\t\t\ttry {\n\t\t\t\t\t$.datepicker._updateDatepicker(inst);\n\t\t\t\t} catch (err) {\n\t\t\t\t\t$.timepicker.log(err);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $.datepicker._base_doKeyUp(event);\n\t};\n\n\t/*\n\t* override \"Today\" button to also grab the time and set it to input field.\n\t*/\n\t$.datepicker._base_gotoToday = $.datepicker._gotoToday;\n\t$.datepicker._gotoToday = function (id) {\n\t\tvar inst = this._getInst($(id)[0]);\n\t\tthis._base_gotoToday(id);\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\t\tif (!tp_inst) {\n\t\t return;\n\t\t}\n\n\t\tvar tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone);\n\t\tvar now = new Date();\n\t\tnow.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset, 10));\n\t\tthis._setTime(inst, now);\n\t\tthis._setDate(inst, now);\n\t\ttp_inst._onSelectHandler();\n\t};\n\n\t/*\n\t* Disable & enable the Time in the datetimepicker\n\t*/\n\t$.datepicker._disableTimepickerDatepicker = function (target) {\n\t\tvar inst = this._getInst(target);\n\t\tif (!inst) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\t\t$(target).datepicker('getDate'); // Init selected[Year|Month|Day]\n\t\tif (tp_inst) {\n\t\t\tinst.settings.showTimepicker = false;\n\t\t\ttp_inst._defaults.showTimepicker = false;\n\t\t\ttp_inst._updateDateTime(inst);\n\t\t}\n\t};\n\n\t$.datepicker._enableTimepickerDatepicker = function (target) {\n\t\tvar inst = this._getInst(target);\n\t\tif (!inst) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\t\t$(target).datepicker('getDate'); // Init selected[Year|Month|Day]\n\t\tif (tp_inst) {\n\t\t\tinst.settings.showTimepicker = true;\n\t\t\ttp_inst._defaults.showTimepicker = true;\n\t\t\ttp_inst._addTimePicker(inst); // Could be disabled on page load\n\t\t\ttp_inst._updateDateTime(inst);\n\t\t}\n\t};\n\n\t/*\n\t* Create our own set time function\n\t*/\n\t$.datepicker._setTime = function (inst, date) {\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\t\tif (tp_inst) {\n\t\t\tvar defaults = tp_inst._defaults;\n\n\t\t\t// calling _setTime with no date sets time to defaults\n\t\t\ttp_inst.hour = date ? date.getHours() : defaults.hour;\n\t\t\ttp_inst.minute = date ? date.getMinutes() : defaults.minute;\n\t\t\ttp_inst.second = date ? date.getSeconds() : defaults.second;\n\t\t\ttp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;\n\t\t\ttp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;\n\n\t\t\t//check if within min/max times..\n\t\t\ttp_inst._limitMinMaxDateTime(inst, true);\n\n\t\t\ttp_inst._onTimeChange();\n\t\t\ttp_inst._updateDateTime(inst);\n\t\t}\n\t};\n\n\t/*\n\t* Create new public method to set only time, callable as $().datepicker('setTime', date)\n\t*/\n\t$.datepicker._setTimeDatepicker = function (target, date, withDate) {\n\t\tvar inst = this._getInst(target);\n\t\tif (!inst) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\n\t\tif (tp_inst) {\n\t\t\tthis._setDateFromField(inst);\n\t\t\tvar tp_date;\n\t\t\tif (date) {\n\t\t\t\tif (typeof date === \"string\") {\n\t\t\t\t\ttp_inst._parseTime(date, withDate);\n\t\t\t\t\ttp_date = new Date();\n\t\t\t\t\ttp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);\n\t\t\t\t\ttp_date.setMicroseconds(tp_inst.microsec);\n\t\t\t\t} else {\n\t\t\t\t\ttp_date = new Date(date.getTime());\n\t\t\t\t\ttp_date.setMicroseconds(date.getMicroseconds());\n\t\t\t\t}\n\t\t\t\tif (tp_date.toString() === 'Invalid Date') {\n\t\t\t\t\ttp_date = undefined;\n\t\t\t\t}\n\t\t\t\tthis._setTime(inst, tp_date);\n\t\t\t}\n\t\t}\n\n\t};\n\n\t/*\n\t* override setDate() to allow setting time too within Date object\n\t*/\n\t$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;\n\t$.datepicker._setDateDatepicker = function (target, _date) {\n\t\tvar inst = this._getInst(target);\n\t\tvar date = _date;\n\t\tif (!inst) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (typeof(_date) === 'string') {\n\t\t\tdate = new Date(_date);\n\t\t\tif (!date.getTime()) {\n\t\t\t\tthis._base_setDateDatepicker.apply(this, arguments);\n\t\t\t\tdate = $(target).datepicker('getDate');\n\t\t\t}\n\t\t}\n\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\t\tvar tp_date;\n\t\tif (date instanceof Date) {\n\t\t\ttp_date = new Date(date.getTime());\n\t\t\ttp_date.setMicroseconds(date.getMicroseconds());\n\t\t} else {\n\t\t\ttp_date = date;\n\t\t}\n\n\t\t// This is important if you are using the timezone option, javascript's Date\n\t\t// object will only return the timezone offset for the current locale, so we\n\t\t// adjust it accordingly. If not using timezone option this won't matter..\n\t\t// If a timezone is different in tp, keep the timezone as is\n\t\tif (tp_inst && tp_date) {\n\t\t\t// look out for DST if tz wasn't specified\n\t\t\tif (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {\n\t\t\t\ttp_inst.timezone = tp_date.getTimezoneOffset() * -1;\n\t\t\t}\n\t\t\tdate = $.timepicker.timezoneAdjust(date, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()), tp_inst.timezone);\n\t\t\ttp_date = $.timepicker.timezoneAdjust(tp_date, $.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()), tp_inst.timezone);\n\t\t}\n\n\t\tthis._updateDatepicker(inst);\n\t\tthis._base_setDateDatepicker.apply(this, arguments);\n\t\tthis._setTimeDatepicker(target, tp_date, true);\n\t};\n\n\t/*\n\t* override getDate() to allow getting time too within Date object\n\t*/\n\t$.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;\n\t$.datepicker._getDateDatepicker = function (target, noDefault) {\n\t\tvar inst = this._getInst(target);\n\t\tif (!inst) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\n\t\tif (tp_inst) {\n\t\t\t// if it hasn't yet been defined, grab from field\n\t\t\tif (inst.lastVal === undefined) {\n\t\t\t\tthis._setDateFromField(inst, noDefault);\n\t\t\t}\n\n\t\t\tvar date = this._getDate(inst);\n\n\t\t\tvar currDT = null;\n\n\t\t\tif (tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) {\n\t\t\t\tcurrDT = tp_inst.$input.val() + ' ' + tp_inst.$altInput.val();\n\t\t\t}\n\t\t\telse if (tp_inst.$input.get(0).tagName !== 'INPUT' && tp_inst.$altInput) {\n\t\t\t\t/**\n\t\t\t\t * in case the datetimepicker has been applied to a non-input tag for inline UI,\n\t\t\t\t * and the user has not configured the plugin to display only time in altInput,\n\t\t\t\t * pick current date time from the altInput (and hope for the best, for now, until \"ER1\" is applied)\n\t\t\t\t *\n\t\t\t\t * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from \"altFormat\" and \"altTimeFormat\" option values\n\t\t\t\t */\n\t\t\t\tcurrDT = tp_inst.$altInput.val();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcurrDT = tp_inst.$input.val();\n\t\t\t}\n\n\t\t\tif (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) {\n\t\t\t\tdate.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);\n\t\t\t\tdate.setMicroseconds(tp_inst.microsec);\n\n\t\t\t\t// This is important if you are using the timezone option, javascript's Date\n\t\t\t\t// object will only return the timezone offset for the current locale, so we\n\t\t\t\t// adjust it accordingly. If not using timezone option this won't matter..\n\t\t\t\tif (tp_inst.timezone != null) {\n\t\t\t\t\t// look out for DST if tz wasn't specified\n\t\t\t\t\tif (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {\n\t\t\t\t\t\ttp_inst.timezone = date.getTimezoneOffset() * -1;\n\t\t\t\t\t}\n\t\t\t\t\tdate = $.timepicker.timezoneAdjust(date, tp_inst.timezone, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn date;\n\t\t}\n\t\treturn this._base_getDateDatepicker(target, noDefault);\n\t};\n\n\t/*\n\t* override parseDate() because UI 1.8.14 throws an error about \"Extra characters\"\n\t* An option in datapicker to ignore extra format characters would be nicer.\n\t*/\n\t$.datepicker._base_parseDate = $.datepicker.parseDate;\n\t$.datepicker.parseDate = function (format, value, settings) {\n\t\tvar date;\n\t\ttry {\n\t\t\tdate = this._base_parseDate(format, value, settings);\n\t\t} catch (err) {\n\t\t\t// Hack! The error message ends with a colon, a space, and\n\t\t\t// the \"extra\" characters. We rely on that instead of\n\t\t\t// attempting to perfectly reproduce the parsing algorithm.\n\t\t\tif (err.indexOf(\":\") >= 0) {\n\t\t\t\tdate = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings);\n\t\t\t\t$.timepicker.log(\"Error parsing the date string: \" + err + \"\\ndate string = \" + value + \"\\ndate format = \" + format);\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\treturn date;\n\t};\n\n\t/*\n\t* override formatDate to set date with time to the input\n\t*/\n\t$.datepicker._base_formatDate = $.datepicker._formatDate;\n\t$.datepicker._formatDate = function (inst, day, month, year) {\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\t\tif (tp_inst) {\n\t\t\ttp_inst._updateDateTime(inst);\n\t\t\treturn tp_inst.$input.val();\n\t\t}\n\t\treturn this._base_formatDate(inst);\n\t};\n\n\t/*\n\t* override options setter to add time to maxDate(Time) and minDate(Time). MaxDate\n\t*/\n\t$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;\n\t$.datepicker._optionDatepicker = function (target, name, value) {\n\t\tvar inst = this._getInst(target),\n\t\t\tname_clone;\n\t\tif (!inst) {\n\t\t\treturn null;\n\t\t}\n\n\t\tvar tp_inst = this._get(inst, 'timepicker');\n\t\tif (tp_inst) {\n\t\t\tvar min = null,\n\t\t\t\tmax = null,\n\t\t\t\tonselect = null,\n\t\t\t\toverrides = tp_inst._defaults.evnts,\n\t\t\t\tfns = {},\n\t\t\t\tprop,\n\t\t\t\tret,\n\t\t\t\toldVal,\n\t\t\t\t$target;\n\t\t\tif (typeof name === 'string') { // if min/max was set with the string\n\t\t\t\tif (name === 'minDate' || name === 'minDateTime') {\n\t\t\t\t\tmin = value;\n\t\t\t\t} else if (name === 'maxDate' || name === 'maxDateTime') {\n\t\t\t\t\tmax = value;\n\t\t\t\t} else if (name === 'onSelect') {\n\t\t\t\t\tonselect = value;\n\t\t\t\t} else if (overrides.hasOwnProperty(name)) {\n\t\t\t\t\tif (typeof (value) === 'undefined') {\n\t\t\t\t\t\treturn overrides[name];\n\t\t\t\t\t}\n\t\t\t\t\tfns[name] = value;\n\t\t\t\t\tname_clone = {}; //empty results in exiting function after overrides updated\n\t\t\t\t}\n\t\t\t} else if (typeof name === 'object') { //if min/max was set with the JSON\n\t\t\t\tif (name.minDate) {\n\t\t\t\t\tmin = name.minDate;\n\t\t\t\t} else if (name.minDateTime) {\n\t\t\t\t\tmin = name.minDateTime;\n\t\t\t\t} else if (name.maxDate) {\n\t\t\t\t\tmax = name.maxDate;\n\t\t\t\t} else if (name.maxDateTime) {\n\t\t\t\t\tmax = name.maxDateTime;\n\t\t\t\t}\n\t\t\t\tfor (prop in overrides) {\n\t\t\t\t\tif (overrides.hasOwnProperty(prop) && name[prop]) {\n\t\t\t\t\t\tfns[prop] = name[prop];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (prop in fns) {\n\t\t\t\tif (fns.hasOwnProperty(prop)) {\n\t\t\t\t\toverrides[prop] = fns[prop];\n\t\t\t\t\tif (!name_clone) { name_clone = $.extend({}, name); }\n\t\t\t\t\tdelete name_clone[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (name_clone && isEmptyObject(name_clone)) { return; }\n\t\t\tif (min) { //if min was set\n\t\t\t\tif (min === 0) {\n\t\t\t\t\tmin = new Date();\n\t\t\t\t} else {\n\t\t\t\t\tmin = new Date(min);\n\t\t\t\t}\n\t\t\t\ttp_inst._defaults.minDate = min;\n\t\t\t\ttp_inst._defaults.minDateTime = min;\n\t\t\t} else if (max) { //if max was set\n\t\t\t\tif (max === 0) {\n\t\t\t\t\tmax = new Date();\n\t\t\t\t} else {\n\t\t\t\t\tmax = new Date(max);\n\t\t\t\t}\n\t\t\t\ttp_inst._defaults.maxDate = max;\n\t\t\t\ttp_inst._defaults.maxDateTime = max;\n\t\t\t} else if (onselect) {\n\t\t\t\ttp_inst._defaults.onSelect = onselect;\n\t\t\t}\n\n\t\t\t// Datepicker will override our date when we call _base_optionDatepicker when\n\t\t\t// calling minDate/maxDate, so we will first grab the value, call\n\t\t\t// _base_optionDatepicker, then set our value back.\n\t\t\tif(min || max){\n\t\t\t\t$target = $(target);\n\t\t\t\toldVal = $target.datetimepicker('getDate');\n\t\t\t\tret = this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);\n\t\t\t\t$target.datetimepicker('setDate', oldVal);\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\t\tif (value === undefined) {\n\t\t\treturn this._base_optionDatepicker.call($.datepicker, target, name);\n\t\t}\n\t\treturn this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);\n\t};\n\n\t/*\n\t* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,\n\t* it will return false for all objects\n\t*/\n\tvar isEmptyObject = function (obj) {\n\t\tvar prop;\n\t\tfor (prop in obj) {\n\t\t\tif (obj.hasOwnProperty(prop)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t};\n\n\t/*\n\t* jQuery extend now ignores nulls!\n\t*/\n\tvar extendRemove = function (target, props) {\n\t\t$.extend(target, props);\n\t\tfor (var name in props) {\n\t\t\tif (props[name] === null || props[name] === undefined) {\n\t\t\t\ttarget[name] = props[name];\n\t\t\t}\n\t\t}\n\t\treturn target;\n\t};\n\n\t/*\n\t* Determine by the time format which units are supported\n\t* Returns an object of booleans for each unit\n\t*/\n\tvar detectSupport = function (timeFormat) {\n\t\tvar tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals\n\t\t\tisIn = function (f, t) { // does the format contain the token?\n\t\t\t\t\treturn f.indexOf(t) !== -1 ? true : false;\n\t\t\t\t};\n\t\treturn {\n\t\t\t\thour: isIn(tf, 'h'),\n\t\t\t\tminute: isIn(tf, 'm'),\n\t\t\t\tsecond: isIn(tf, 's'),\n\t\t\t\tmillisec: isIn(tf, 'l'),\n\t\t\t\tmicrosec: isIn(tf, 'c'),\n\t\t\t\ttimezone: isIn(tf, 'z'),\n\t\t\t\tampm: isIn(tf, 't') && isIn(timeFormat, 'h'),\n\t\t\t\tiso8601: isIn(timeFormat, 'Z')\n\t\t\t};\n\t};\n\n\t/*\n\t* Converts 24 hour format into 12 hour\n\t* Returns 12 hour without leading 0\n\t*/\n\tvar convert24to12 = function (hour) {\n\t\thour %= 12;\n\n\t\tif (hour === 0) {\n\t\t\thour = 12;\n\t\t}\n\n\t\treturn String(hour);\n\t};\n\n\tvar computeEffectiveSetting = function (settings, property) {\n\t\treturn settings && settings[property] ? settings[property] : $.timepicker._defaults[property];\n\t};\n\n\t/*\n\t* Splits datetime string into date and time substrings.\n\t* Throws exception when date can't be parsed\n\t* Returns {dateString: dateString, timeString: timeString}\n\t*/\n\tvar splitDateTime = function (dateTimeString, timeSettings) {\n\t\t// The idea is to get the number separator occurrences in datetime and the time format requested (since time has\n\t\t// fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.\n\t\tvar separator = computeEffectiveSetting(timeSettings, 'separator'),\n\t\t\tformat = computeEffectiveSetting(timeSettings, 'timeFormat'),\n\t\t\ttimeParts = format.split(separator), // how many occurrences of separator may be in our format?\n\t\t\ttimePartsLen = timeParts.length,\n\t\t\tallParts = dateTimeString.split(separator),\n\t\t\tallPartsLen = allParts.length;\n\n\t\tif (allPartsLen > 1) {\n\t\t\treturn {\n\t\t\t\tdateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),\n\t\t\t\ttimeString: allParts.splice(0, timePartsLen).join(separator)\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tdateString: dateTimeString,\n\t\t\ttimeString: ''\n\t\t};\n\t};\n\n\t/*\n\t* Internal function to parse datetime interval\n\t* Returns: {date: Date, timeObj: Object}, where\n\t* date - parsed date without time (type Date)\n\t* timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional\n\t*/\n\tvar parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {\n\t\tvar date,\n\t\t\tparts,\n\t\t\tparsedTime;\n\n\t\tparts = splitDateTime(dateTimeString, timeSettings);\n\t\tdate = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);\n\n\t\tif (parts.timeString === '') {\n\t\t\treturn {\n\t\t\t\tdate: date\n\t\t\t};\n\t\t}\n\n\t\tparsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);\n\n\t\tif (!parsedTime) {\n\t\t\tthrow 'Wrong time format';\n\t\t}\n\n\t\treturn {\n\t\t\tdate: date,\n\t\t\ttimeObj: parsedTime\n\t\t};\n\t};\n\n\t/*\n\t* Internal function to set timezone_select to the local timezone\n\t*/\n\tvar selectLocalTimezone = function (tp_inst, date) {\n\t\tif (tp_inst && tp_inst.timezone_select) {\n\t\t\tvar now = date || new Date();\n\t\t\ttp_inst.timezone_select.val(-now.getTimezoneOffset());\n\t\t}\n\t};\n\n\t/*\n\t* Create a Singleton Instance\n\t*/\n\t$.timepicker = new Timepicker();\n\n\t/**\n\t * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)\n\t * @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned\n\t * @param {boolean} iso8601 if true formats in accordance to iso8601 \"+12:45\"\n\t * @return {string}\n\t */\n\t$.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) {\n\t\tif (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {\n\t\t\treturn tzMinutes;\n\t\t}\n\n\t\tvar off = tzMinutes,\n\t\t\tminutes = off % 60,\n\t\t\thours = (off - minutes) / 60,\n\t\t\tiso = iso8601 ? ':' : '',\n\t\t\ttz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);\n\n\t\tif (tz === '+00:00') {\n\t\t\treturn 'Z';\n\t\t}\n\t\treturn tz;\n\t};\n\n\t/**\n\t * Get the number in minutes that represents a timezone string\n\t * @param {string} tzString formatted like \"+0500\", \"-1245\", \"Z\"\n\t * @return {number} the offset minutes or the original string if it doesn't match expectations\n\t */\n\t$.timepicker.timezoneOffsetNumber = function (tzString) {\n\t\tvar normalized = tzString.toString().replace(':', ''); // excuse any iso8601, end up with \"+1245\"\n\n\t\tif (normalized.toUpperCase() === 'Z') { // if iso8601 with Z, its 0 minute offset\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (!/^(\\-|\\+)\\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back\n\t\t\treturn parseInt(tzString, 10);\n\t\t}\n\n\t\treturn ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus\n\t\t\t\t\t((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)\n\t\t\t\t\tparseInt(normalized.substr(3, 2), 10))); // minutes\n\t};\n\n\t/**\n\t * No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)\n\t * @param {Date} date\n\t * @param {string} fromTimezone formatted like \"+0500\", \"-1245\"\n\t * @param {string} toTimezone formatted like \"+0500\", \"-1245\"\n\t * @return {Date}\n\t */\n\t$.timepicker.timezoneAdjust = function (date, fromTimezone, toTimezone) {\n\t\tvar fromTz = $.timepicker.timezoneOffsetNumber(fromTimezone);\n\t\tvar toTz = $.timepicker.timezoneOffsetNumber(toTimezone);\n\t\tif (!isNaN(toTz)) {\n\t\t\tdate.setMinutes(date.getMinutes() + (-fromTz) - (-toTz));\n\t\t}\n\t\treturn date;\n\t};\n\n\t/**\n\t * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to\n\t * enforce date range limits.\n\t * n.b. The input value must be correctly formatted (reformatting is not supported)\n\t * @param {Element} startTime\n\t * @param {Element} endTime\n\t * @param {Object} options Options for the timepicker() call\n\t * @return {jQuery}\n\t */\n\t$.timepicker.timeRange = function (startTime, endTime, options) {\n\t\treturn $.timepicker.handleRange('timepicker', startTime, endTime, options);\n\t};\n\n\t/**\n\t * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to\n\t * enforce date range limits.\n\t * @param {Element} startTime\n\t * @param {Element} endTime\n\t * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,\n\t * a boolean value that can be used to reformat the input values to the `dateFormat`.\n\t * @param {string} method Can be used to specify the type of picker to be added\n\t * @return {jQuery}\n\t */\n\t$.timepicker.datetimeRange = function (startTime, endTime, options) {\n\t\t$.timepicker.handleRange('datetimepicker', startTime, endTime, options);\n\t};\n\n\t/**\n\t * Calls `datepicker` on the `startTime` and `endTime` elements, and configures them to\n\t * enforce date range limits.\n\t * @param {Element} startTime\n\t * @param {Element} endTime\n\t * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,\n\t * a boolean value that can be used to reformat the input values to the `dateFormat`.\n\t * @return {jQuery}\n\t */\n\t$.timepicker.dateRange = function (startTime, endTime, options) {\n\t\t$.timepicker.handleRange('datepicker', startTime, endTime, options);\n\t};\n\n\t/**\n\t * Calls `method` on the `startTime` and `endTime` elements, and configures them to\n\t * enforce date range limits.\n\t * @param {string} method Can be used to specify the type of picker to be added\n\t * @param {Element} startTime\n\t * @param {Element} endTime\n\t * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`,\n\t * a boolean value that can be used to reformat the input values to the `dateFormat`.\n\t * @return {jQuery}\n\t */\n\t$.timepicker.handleRange = function (method, startTime, endTime, options) {\n\t\toptions = $.extend({}, {\n\t\t\tminInterval: 0, // min allowed interval in milliseconds\n\t\t\tmaxInterval: 0, // max allowed interval in milliseconds\n\t\t\tstart: {}, // options for start picker\n\t\t\tend: {} // options for end picker\n\t\t}, options);\n\n\t\t// for the mean time this fixes an issue with calling getDate with timepicker()\n\t\tvar timeOnly = false;\n\t\tif(method === 'timepicker'){\n\t\t\ttimeOnly = true;\n\t\t\tmethod = 'datetimepicker';\n\t\t}\n\n\t\tfunction checkDates(changed, other) {\n\t\t\tvar startdt = startTime[method]('getDate'),\n\t\t\t\tenddt = endTime[method]('getDate'),\n\t\t\t\tchangeddt = changed[method]('getDate');\n\n\t\t\tif (startdt !== null) {\n\t\t\t\tvar minDate = new Date(startdt.getTime()),\n\t\t\t\t\tmaxDate = new Date(startdt.getTime());\n\n\t\t\t\tminDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval);\n\t\t\t\tmaxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval);\n\n\t\t\t\tif (options.minInterval > 0 && minDate > enddt) { // minInterval check\n\t\t\t\t\tendTime[method]('setDate', minDate);\n\t\t\t\t}\n\t\t\t\telse if (options.maxInterval > 0 && maxDate < enddt) { // max interval check\n\t\t\t\t\tendTime[method]('setDate', maxDate);\n\t\t\t\t}\n\t\t\t\telse if (startdt > enddt) {\n\t\t\t\t\tother[method]('setDate', changeddt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction selected(changed, other, option) {\n\t\t\tif (!changed.val()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar date = changed[method].call(changed, 'getDate');\n\t\t\tif (date !== null && options.minInterval > 0) {\n\t\t\t\tif (option === 'minDate') {\n\t\t\t\t\tdate.setMilliseconds(date.getMilliseconds() + options.minInterval);\n\t\t\t\t}\n\t\t\t\tif (option === 'maxDate') {\n\t\t\t\t\tdate.setMilliseconds(date.getMilliseconds() - options.minInterval);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (date.getTime) {\n\t\t\t\tother[method].call(other, 'option', option, date);\n\t\t\t}\n\t\t}\n\n\t\t$.fn[method].call(startTime, $.extend({\n\t\t\ttimeOnly: timeOnly,\n\t\t\tonClose: function (dateText, inst) {\n\t\t\t\tcheckDates($(this), endTime);\n\t\t\t},\n\t\t\tonSelect: function (selectedDateTime) {\n\t\t\t\tselected($(this), endTime, 'minDate');\n\t\t\t}\n\t\t}, options, options.start));\n\t\t$.fn[method].call(endTime, $.extend({\n\t\t\ttimeOnly: timeOnly,\n\t\t\tonClose: function (dateText, inst) {\n\t\t\t\tcheckDates($(this), startTime);\n\t\t\t},\n\t\t\tonSelect: function (selectedDateTime) {\n\t\t\t\tselected($(this), startTime, 'maxDate');\n\t\t\t}\n\t\t}, options, options.end));\n\n\t\tcheckDates(startTime, endTime);\n\n\t\tselected(startTime, endTime, 'minDate');\n\t\tselected(endTime, startTime, 'maxDate');\n\n\t\treturn $([startTime.get(0), endTime.get(0)]);\n\t};\n\n\t/**\n\t * Log error or data to the console during error or debugging\n\t * @param {Object} err pass any type object to log to the console during error or debugging\n\t * @return {void}\n\t */\n\t$.timepicker.log = function () {\n\t\t// Older IE (9, maybe 10) throw error on accessing `window.console.log.apply`, so check first.\n\t\tif (window.console && window.console.log && window.console.log.apply) {\n\t\t\twindow.console.log.apply(window.console, Array.prototype.slice.call(arguments));\n\t\t}\n\t};\n\n\t/*\n\t * Add util object to allow access to private methods for testability.\n\t */\n\t$.timepicker._util = {\n\t\t_extendRemove: extendRemove,\n\t\t_isEmptyObject: isEmptyObject,\n\t\t_convert24to12: convert24to12,\n\t\t_detectSupport: detectSupport,\n\t\t_selectLocalTimezone: selectLocalTimezone,\n\t\t_computeEffectiveSetting: computeEffectiveSetting,\n\t\t_splitDateTime: splitDateTime,\n\t\t_parseDateTimeInternal: parseDateTimeInternal\n\t};\n\n\t/*\n\t* Microsecond support\n\t*/\n\tif (!Date.prototype.getMicroseconds) {\n\t\tDate.prototype.microseconds = 0;\n\t\tDate.prototype.getMicroseconds = function () { return this.microseconds; };\n\t\tDate.prototype.setMicroseconds = function (m) {\n\t\t\tthis.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000));\n\t\t\tthis.microseconds = m % 1000;\n\t\t\treturn this;\n\t\t};\n\t}\n\n\t/*\n\t* Keep up with the version\n\t*/\n\t$.timepicker.version = \"1.6.3\";\n\n}));","/*!\n * jQuery Validation Plugin v1.15.0\n *\n * http://jqueryvalidation.org/\n *\n * Copyright (c) 2016 Jörn Zaefferer\n * Released under the MIT license\n */\n(function( factory ) {\n\tif ( typeof define === \"function\" && define.amd ) {\n\t\tdefine( [\"jquery\"], factory );\n\t} else if (typeof module === \"object\" && module.exports) {\n\t\tmodule.exports = factory( require( \"jquery\" ) );\n\t} else {\n\t\tfactory( jQuery );\n\t}\n}(function( $ ) {\n\n$.extend( $.fn, {\n\n\t// http://jqueryvalidation.org/validate/\n\tvalidate: function( options ) {\n\n\t\t// If nothing is selected, return nothing; can't chain anyway\n\t\tif ( !this.length ) {\n\t\t\tif ( options && options.debug && window.console ) {\n\t\t\t\tconsole.warn( \"Nothing selected, can't validate, returning nothing.\" );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if a validator for this form was already created\n\t\tvar validator = $.data( this[ 0 ], \"validator\" );\n\t\tif ( validator ) {\n\t\t\treturn validator;\n\t\t}\n\n\t\t// Add novalidate tag if HTML5.\n\t\tthis.attr( \"novalidate\", \"novalidate\" );\n\n\t\tvalidator = new $.validator( options, this[ 0 ] );\n\t\t$.data( this[ 0 ], \"validator\", validator );\n\n\t\tif ( validator.settings.onsubmit ) {\n\n\t\t\tthis.on( \"click.validate\", \":submit\", function( event ) {\n\t\t\t\tif ( validator.settings.submitHandler ) {\n\t\t\t\t\tvalidator.submitButton = event.target;\n\t\t\t\t}\n\n\t\t\t\t// Allow suppressing validation by adding a cancel class to the submit button\n\t\t\t\tif ( $( this ).hasClass( \"cancel\" ) ) {\n\t\t\t\t\tvalidator.cancelSubmit = true;\n\t\t\t\t}\n\n\t\t\t\t// Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button\n\t\t\t\tif ( $( this ).attr( \"formnovalidate\" ) !== undefined ) {\n\t\t\t\t\tvalidator.cancelSubmit = true;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Validate the form on submit\n\t\t\tthis.on( \"submit.validate\", function( event ) {\n\t\t\t\tif ( validator.settings.debug ) {\n\n\t\t\t\t\t// Prevent form submit to be able to see console output\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t\tfunction handle() {\n\t\t\t\t\tvar hidden, result;\n\t\t\t\t\tif ( validator.settings.submitHandler ) {\n\t\t\t\t\t\tif ( validator.submitButton ) {\n\n\t\t\t\t\t\t\t// Insert a hidden input as a replacement for the missing submit button\n\t\t\t\t\t\t\thidden = $( \"<input type='hidden'/>\" )\n\t\t\t\t\t\t\t\t.attr( \"name\", validator.submitButton.name )\n\t\t\t\t\t\t\t\t.val( $( validator.submitButton ).val() )\n\t\t\t\t\t\t\t\t.appendTo( validator.currentForm );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresult = validator.settings.submitHandler.call( validator, validator.currentForm, event );\n\t\t\t\t\t\tif ( validator.submitButton ) {\n\n\t\t\t\t\t\t\t// And clean up afterwards; thanks to no-block-scope, hidden can be referenced\n\t\t\t\t\t\t\thidden.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( result !== undefined ) {\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t// Prevent submit for invalid forms or custom submit handlers\n\t\t\t\tif ( validator.cancelSubmit ) {\n\t\t\t\t\tvalidator.cancelSubmit = false;\n\t\t\t\t\treturn handle();\n\t\t\t\t}\n\t\t\t\tif ( validator.form() ) {\n\t\t\t\t\tif ( validator.pendingRequest ) {\n\t\t\t\t\t\tvalidator.formSubmitted = true;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn handle();\n\t\t\t\t} else {\n\t\t\t\t\tvalidator.focusInvalid();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn validator;\n\t},\n\n\t// http://jqueryvalidation.org/valid/\n\tvalid: function() {\n\t\tvar valid, validator, errorList;\n\n\t\tif ( $( this[ 0 ] ).is( \"form\" ) ) {\n\t\t\tvalid = this.validate().form();\n\t\t} else {\n\t\t\terrorList = [];\n\t\t\tvalid = true;\n\t\t\tvalidator = $( this[ 0 ].form ).validate();\n\t\t\tthis.each( function() {\n\t\t\t\tvalid = validator.element( this ) && valid;\n\t\t\t\tif ( !valid ) {\n\t\t\t\t\terrorList = errorList.concat( validator.errorList );\n\t\t\t\t}\n\t\t\t} );\n\t\t\tvalidator.errorList = errorList;\n\t\t}\n\t\treturn valid;\n\t},\n\n\t// http://jqueryvalidation.org/rules/\n\trules: function( command, argument ) {\n\n\t\t// If nothing is selected, return nothing; can't chain anyway\n\t\tif ( !this.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar element = this[ 0 ],\n\t\t\tsettings, staticRules, existingRules, data, param, filtered;\n\n\t\tif ( command ) {\n\t\t\tsettings = $.data( element.form, \"validator\" ).settings;\n\t\t\tstaticRules = settings.rules;\n\t\t\texistingRules = $.validator.staticRules( element );\n\t\t\tswitch ( command ) {\n\t\t\tcase \"add\":\n\t\t\t\t$.extend( existingRules, $.validator.normalizeRule( argument ) );\n\n\t\t\t\t// Remove messages from rules, but allow them to be set separately\n\t\t\t\tdelete existingRules.messages;\n\t\t\t\tstaticRules[ element.name ] = existingRules;\n\t\t\t\tif ( argument.messages ) {\n\t\t\t\t\tsettings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"remove\":\n\t\t\t\tif ( !argument ) {\n\t\t\t\t\tdelete staticRules[ element.name ];\n\t\t\t\t\treturn existingRules;\n\t\t\t\t}\n\t\t\t\tfiltered = {};\n\t\t\t\t$.each( argument.split( /\\s/ ), function( index, method ) {\n\t\t\t\t\tfiltered[ method ] = existingRules[ method ];\n\t\t\t\t\tdelete existingRules[ method ];\n\t\t\t\t\tif ( method === \"required\" ) {\n\t\t\t\t\t\t$( element ).removeAttr( \"aria-required\" );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn filtered;\n\t\t\t}\n\t\t}\n\n\t\tdata = $.validator.normalizeRules(\n\t\t$.extend(\n\t\t\t{},\n\t\t\t$.validator.classRules( element ),\n\t\t\t$.validator.attributeRules( element ),\n\t\t\t$.validator.dataRules( element ),\n\t\t\t$.validator.staticRules( element )\n\t\t), element );\n\n\t\t// Make sure required is at front\n\t\tif ( data.required ) {\n\t\t\tparam = data.required;\n\t\t\tdelete data.required;\n\t\t\tdata = $.extend( { required: param }, data );\n\t\t\t$( element ).attr( \"aria-required\", \"true\" );\n\t\t}\n\n\t\t// Make sure remote is at back\n\t\tif ( data.remote ) {\n\t\t\tparam = data.remote;\n\t\t\tdelete data.remote;\n\t\t\tdata = $.extend( data, { remote: param } );\n\t\t}\n\n\t\treturn data;\n\t}\n} );\n\n// Custom selectors\n$.extend( $.expr[ \":\" ], {\n\n\t// http://jqueryvalidation.org/blank-selector/\n\tblank: function( a ) {\n\t\treturn !$.trim( \"\" + $( a ).val() );\n\t},\n\n\t// http://jqueryvalidation.org/filled-selector/\n\tfilled: function( a ) {\n\t\tvar val = $( a ).val();\n\t\treturn val !== null && !!$.trim( \"\" + val );\n\t},\n\n\t// http://jqueryvalidation.org/unchecked-selector/\n\tunchecked: function( a ) {\n\t\treturn !$( a ).prop( \"checked\" );\n\t}\n} );\n\n// Constructor for validator\n$.validator = function( options, form ) {\n\tthis.settings = $.extend( true, {}, $.validator.defaults, options );\n\tthis.currentForm = form;\n\tthis.init();\n};\n\n// http://jqueryvalidation.org/jQuery.validator.format/\n$.validator.format = function( source, params ) {\n\tif ( arguments.length === 1 ) {\n\t\treturn function() {\n\t\t\tvar args = $.makeArray( arguments );\n\t\t\targs.unshift( source );\n\t\t\treturn $.validator.format.apply( this, args );\n\t\t};\n\t}\n\tif ( params === undefined ) {\n\t\treturn source;\n\t}\n\tif ( arguments.length > 2 && params.constructor !== Array ) {\n\t\tparams = $.makeArray( arguments ).slice( 1 );\n\t}\n\tif ( params.constructor !== Array ) {\n\t\tparams = [ params ];\n\t}\n\t$.each( params, function( i, n ) {\n\t\tsource = source.replace( new RegExp( \"\\\\{\" + i + \"\\\\}\", \"g\" ), function() {\n\t\t\treturn n;\n\t\t} );\n\t} );\n\treturn source;\n};\n\n$.extend( $.validator, {\n\n\tdefaults: {\n\t\tmessages: {},\n\t\tgroups: {},\n\t\trules: {},\n\t\terrorClass: \"error\",\n\t\tpendingClass: \"pending\",\n\t\tvalidClass: \"valid\",\n\t\terrorElement: \"label\",\n\t\tfocusCleanup: false,\n\t\tfocusInvalid: true,\n\t\terrorContainer: $( [] ),\n\t\terrorLabelContainer: $( [] ),\n\t\tonsubmit: true,\n\t\tignore: \":hidden\",\n\t\tignoreTitle: false,\n\t\tonfocusin: function( element ) {\n\t\t\tthis.lastActive = element;\n\n\t\t\t// Hide error label and remove error class on focus if enabled\n\t\t\tif ( this.settings.focusCleanup ) {\n\t\t\t\tif ( this.settings.unhighlight ) {\n\t\t\t\t\tthis.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );\n\t\t\t\t}\n\t\t\t\tthis.hideThese( this.errorsFor( element ) );\n\t\t\t}\n\t\t},\n\t\tonfocusout: function( element ) {\n\t\t\tif ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) {\n\t\t\t\tthis.element( element );\n\t\t\t}\n\t\t},\n\t\tonkeyup: function( element, event ) {\n\n\t\t\t// Avoid revalidate the field when pressing one of the following keys\n\t\t\t// Shift => 16\n\t\t\t// Ctrl => 17\n\t\t\t// Alt => 18\n\t\t\t// Caps lock => 20\n\t\t\t// End => 35\n\t\t\t// Home => 36\n\t\t\t// Left arrow => 37\n\t\t\t// Up arrow => 38\n\t\t\t// Right arrow => 39\n\t\t\t// Down arrow => 40\n\t\t\t// Insert => 45\n\t\t\t// Num lock => 144\n\t\t\t// AltGr key => 225\n\t\t\tvar excludedKeys = [\n\t\t\t\t16, 17, 18, 20, 35, 36, 37,\n\t\t\t\t38, 39, 40, 45, 144, 225\n\t\t\t];\n\n\t\t\tif ( event.which === 9 && this.elementValue( element ) === \"\" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) {\n\t\t\t\treturn;\n\t\t\t} else if ( element.name in this.submitted || element.name in this.invalid ) {\n\t\t\t\tthis.element( element );\n\t\t\t}\n\t\t},\n\t\tonclick: function( element ) {\n\n\t\t\t// Click on selects, radiobuttons and checkboxes\n\t\t\tif ( element.name in this.submitted ) {\n\t\t\t\tthis.element( element );\n\n\t\t\t// Or option elements, check parent select in that case\n\t\t\t} else if ( element.parentNode.name in this.submitted ) {\n\t\t\t\tthis.element( element.parentNode );\n\t\t\t}\n\t\t},\n\t\thighlight: function( element, errorClass, validClass ) {\n\t\t\tif ( element.type === \"radio\" ) {\n\t\t\t\tthis.findByName( element.name ).addClass( errorClass ).removeClass( validClass );\n\t\t\t} else {\n\t\t\t\t$( element ).addClass( errorClass ).removeClass( validClass );\n\t\t\t}\n\t\t},\n\t\tunhighlight: function( element, errorClass, validClass ) {\n\t\t\tif ( element.type === \"radio\" ) {\n\t\t\t\tthis.findByName( element.name ).removeClass( errorClass ).addClass( validClass );\n\t\t\t} else {\n\t\t\t\t$( element ).removeClass( errorClass ).addClass( validClass );\n\t\t\t}\n\t\t}\n\t},\n\n\t// http://jqueryvalidation.org/jQuery.validator.setDefaults/\n\tsetDefaults: function( settings ) {\n\t\t$.extend( $.validator.defaults, settings );\n\t},\n\n\tmessages: {\n\t\trequired: \"This field is required.\",\n\t\tremote: \"Please fix this field.\",\n\t\temail: \"Please enter a valid email address.\",\n\t\turl: \"Please enter a valid URL.\",\n\t\tdate: \"Please enter a valid date.\",\n\t\tdateISO: \"Please enter a valid date ( ISO ).\",\n\t\tnumber: \"Please enter a valid number.\",\n\t\tdigits: \"Please enter only digits.\",\n\t\tequalTo: \"Please enter the same value again.\",\n\t\tmaxlength: $.validator.format( \"Please enter no more than {0} characters.\" ),\n\t\tminlength: $.validator.format( \"Please enter at least {0} characters.\" ),\n\t\trangelength: $.validator.format( \"Please enter a value between {0} and {1} characters long.\" ),\n\t\trange: $.validator.format( \"Please enter a value between {0} and {1}.\" ),\n\t\tmax: $.validator.format( \"Please enter a value less than or equal to {0}.\" ),\n\t\tmin: $.validator.format( \"Please enter a value greater than or equal to {0}.\" ),\n\t\tstep: $.validator.format( \"Please enter a multiple of {0}.\" )\n\t},\n\n\tautoCreateRanges: false,\n\n\tprototype: {\n\n\t\tinit: function() {\n\t\t\tthis.labelContainer = $( this.settings.errorLabelContainer );\n\t\t\tthis.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm );\n\t\t\tthis.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer );\n\t\t\tthis.submitted = {};\n\t\t\tthis.valueCache = {};\n\t\t\tthis.pendingRequest = 0;\n\t\t\tthis.pending = {};\n\t\t\tthis.invalid = {};\n\t\t\tthis.reset();\n\n\t\t\tvar groups = ( this.groups = {} ),\n\t\t\t\trules;\n\t\t\t$.each( this.settings.groups, function( key, value ) {\n\t\t\t\tif ( typeof value === \"string\" ) {\n\t\t\t\t\tvalue = value.split( /\\s/ );\n\t\t\t\t}\n\t\t\t\t$.each( value, function( index, name ) {\n\t\t\t\t\tgroups[ name ] = key;\n\t\t\t\t} );\n\t\t\t} );\n\t\t\trules = this.settings.rules;\n\t\t\t$.each( rules, function( key, value ) {\n\t\t\t\trules[ key ] = $.validator.normalizeRule( value );\n\t\t\t} );\n\n\t\t\tfunction delegate( event ) {\n\t\t\t\tvar validator = $.data( this.form, \"validator\" ),\n\t\t\t\t\teventType = \"on\" + event.type.replace( /^validate/, \"\" ),\n\t\t\t\t\tsettings = validator.settings;\n\t\t\t\tif ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) {\n\t\t\t\t\tsettings[ eventType ].call( validator, this, event );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$( this.currentForm )\n\t\t\t\t.on( \"focusin.validate focusout.validate keyup.validate\",\n\t\t\t\t\t\":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], \" +\n\t\t\t\t\t\"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], \" +\n\t\t\t\t\t\"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], \" +\n\t\t\t\t\t\"[type='radio'], [type='checkbox'], [contenteditable]\", delegate )\n\n\t\t\t\t// Support: Chrome, oldIE\n\t\t\t\t// \"select\" is provided as event.target when clicking a option\n\t\t\t\t.on( \"click.validate\", \"select, option, [type='radio'], [type='checkbox']\", delegate );\n\n\t\t\tif ( this.settings.invalidHandler ) {\n\t\t\t\t$( this.currentForm ).on( \"invalid-form.validate\", this.settings.invalidHandler );\n\t\t\t}\n\n\t\t\t// Add aria-required to any Static/Data/Class required fields before first validation\n\t\t\t// Screen readers require this attribute to be present before the initial submission http://www.w3.org/TR/WCAG-TECHS/ARIA2.html\n\t\t\t$( this.currentForm ).find( \"[required], [data-rule-required], .required\" ).attr( \"aria-required\", \"true\" );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/Validator.form/\n\t\tform: function() {\n\t\t\tthis.checkForm();\n\t\t\t$.extend( this.submitted, this.errorMap );\n\t\t\tthis.invalid = $.extend( {}, this.errorMap );\n\t\t\tif ( !this.valid() ) {\n\t\t\t\t$( this.currentForm ).triggerHandler( \"invalid-form\", [ this ] );\n\t\t\t}\n\t\t\tthis.showErrors();\n\t\t\treturn this.valid();\n\t\t},\n\n\t\tcheckForm: function() {\n\t\t\tthis.prepareForm();\n\t\t\tfor ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) {\n\t\t\t\tthis.check( elements[ i ] );\n\t\t\t}\n\t\t\treturn this.valid();\n\t\t},\n\n\t\t// http://jqueryvalidation.org/Validator.element/\n\t\telement: function( element ) {\n\t\t\tvar cleanElement = this.clean( element ),\n\t\t\t\tcheckElement = this.validationTargetFor( cleanElement ),\n\t\t\t\tv = this,\n\t\t\t\tresult = true,\n\t\t\t\trs, group;\n\n\t\t\tif ( checkElement === undefined ) {\n\t\t\t\tdelete this.invalid[ cleanElement.name ];\n\t\t\t} else {\n\t\t\t\tthis.prepareElement( checkElement );\n\t\t\t\tthis.currentElements = $( checkElement );\n\n\t\t\t\t// If this element is grouped, then validate all group elements already\n\t\t\t\t// containing a value\n\t\t\t\tgroup = this.groups[ checkElement.name ];\n\t\t\t\tif ( group ) {\n\t\t\t\t\t$.each( this.groups, function( name, testgroup ) {\n\t\t\t\t\t\tif ( testgroup === group && name !== checkElement.name ) {\n\t\t\t\t\t\t\tcleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) );\n\t\t\t\t\t\t\tif ( cleanElement && cleanElement.name in v.invalid ) {\n\t\t\t\t\t\t\t\tv.currentElements.push( cleanElement );\n\t\t\t\t\t\t\t\tresult = result && v.check( cleanElement );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\trs = this.check( checkElement ) !== false;\n\t\t\t\tresult = result && rs;\n\t\t\t\tif ( rs ) {\n\t\t\t\t\tthis.invalid[ checkElement.name ] = false;\n\t\t\t\t} else {\n\t\t\t\t\tthis.invalid[ checkElement.name ] = true;\n\t\t\t\t}\n\n\t\t\t\tif ( !this.numberOfInvalids() ) {\n\n\t\t\t\t\t// Hide error containers on last error\n\t\t\t\t\tthis.toHide = this.toHide.add( this.containers );\n\t\t\t\t}\n\t\t\t\tthis.showErrors();\n\n\t\t\t\t// Add aria-invalid status for screen readers\n\t\t\t\t$( element ).attr( \"aria-invalid\", !rs );\n\t\t\t}\n\n\t\t\treturn result;\n\t\t},\n\n\t\t// http://jqueryvalidation.org/Validator.showErrors/\n\t\tshowErrors: function( errors ) {\n\t\t\tif ( errors ) {\n\t\t\t\tvar validator = this;\n\n\t\t\t\t// Add items to error list and map\n\t\t\t\t$.extend( this.errorMap, errors );\n\t\t\t\tthis.errorList = $.map( this.errorMap, function( message, name ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmessage: message,\n\t\t\t\t\t\telement: validator.findByName( name )[ 0 ]\n\t\t\t\t\t};\n\t\t\t\t} );\n\n\t\t\t\t// Remove items from success list\n\t\t\t\tthis.successList = $.grep( this.successList, function( element ) {\n\t\t\t\t\treturn !( element.name in errors );\n\t\t\t\t} );\n\t\t\t}\n\t\t\tif ( this.settings.showErrors ) {\n\t\t\t\tthis.settings.showErrors.call( this, this.errorMap, this.errorList );\n\t\t\t} else {\n\t\t\t\tthis.defaultShowErrors();\n\t\t\t}\n\t\t},\n\n\t\t// http://jqueryvalidation.org/Validator.resetForm/\n\t\tresetForm: function() {\n\t\t\tif ( $.fn.resetForm ) {\n\t\t\t\t$( this.currentForm ).resetForm();\n\t\t\t}\n\t\t\tthis.invalid = {};\n\t\t\tthis.submitted = {};\n\t\t\tthis.prepareForm();\n\t\t\tthis.hideErrors();\n\t\t\tvar elements = this.elements()\n\t\t\t\t.removeData( \"previousValue\" )\n\t\t\t\t.removeAttr( \"aria-invalid\" );\n\n\t\t\tthis.resetElements( elements );\n\t\t},\n\n\t\tresetElements: function( elements ) {\n\t\t\tvar i;\n\n\t\t\tif ( this.settings.unhighlight ) {\n\t\t\t\tfor ( i = 0; elements[ i ]; i++ ) {\n\t\t\t\t\tthis.settings.unhighlight.call( this, elements[ i ],\n\t\t\t\t\t\tthis.settings.errorClass, \"\" );\n\t\t\t\t\tthis.findByName( elements[ i ].name ).removeClass( this.settings.validClass );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\telements\n\t\t\t\t\t.removeClass( this.settings.errorClass )\n\t\t\t\t\t.removeClass( this.settings.validClass );\n\t\t\t}\n\t\t},\n\n\t\tnumberOfInvalids: function() {\n\t\t\treturn this.objectLength( this.invalid );\n\t\t},\n\n\t\tobjectLength: function( obj ) {\n\t\t\t/* jshint unused: false */\n\t\t\tvar count = 0,\n\t\t\t\ti;\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( obj[ i ] ) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn count;\n\t\t},\n\n\t\thideErrors: function() {\n\t\t\tthis.hideThese( this.toHide );\n\t\t},\n\n\t\thideThese: function( errors ) {\n\t\t\terrors.not( this.containers ).text( \"\" );\n\t\t\tthis.addWrapper( errors ).hide();\n\t\t},\n\n\t\tvalid: function() {\n\t\t\treturn this.size() === 0;\n\t\t},\n\n\t\tsize: function() {\n\t\t\treturn this.errorList.length;\n\t\t},\n\n\t\tfocusInvalid: function() {\n\t\t\tif ( this.settings.focusInvalid ) {\n\t\t\t\ttry {\n\t\t\t\t\t$( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] )\n\t\t\t\t\t.filter( \":visible\" )\n\t\t\t\t\t.focus()\n\n\t\t\t\t\t// Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find\n\t\t\t\t\t.trigger( \"focusin\" );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// Ignore IE throwing errors when focusing hidden elements\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tfindLastActive: function() {\n\t\t\tvar lastActive = this.lastActive;\n\t\t\treturn lastActive && $.grep( this.errorList, function( n ) {\n\t\t\t\treturn n.element.name === lastActive.name;\n\t\t\t} ).length === 1 && lastActive;\n\t\t},\n\n\t\telements: function() {\n\t\t\tvar validator = this,\n\t\t\t\trulesCache = {};\n\n\t\t\t// Select all valid inputs inside the form (no submit or reset buttons)\n\t\t\treturn $( this.currentForm )\n\t\t\t.find( \"input, select, textarea, [contenteditable]\" )\n\t\t\t.not( \":submit, :reset, :image, :disabled\" )\n\t\t\t.not( this.settings.ignore )\n\t\t\t.filter( function() {\n\t\t\t\tvar name = this.name || $( this ).attr( \"name\" ); // For contenteditable\n\t\t\t\tif ( !name && validator.settings.debug && window.console ) {\n\t\t\t\t\tconsole.error( \"%o has no name assigned\", this );\n\t\t\t\t}\n\n\t\t\t\t// Set form expando on contenteditable\n\t\t\t\tif ( this.hasAttribute( \"contenteditable\" ) ) {\n\t\t\t\t\tthis.form = $( this ).closest( \"form\" )[ 0 ];\n\t\t\t\t}\n\n\t\t\t\t// Select only the first element for each name, and only those with rules specified\n\t\t\t\tif ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\trulesCache[ name ] = true;\n\t\t\t\treturn true;\n\t\t\t} );\n\t\t},\n\n\t\tclean: function( selector ) {\n\t\t\treturn $( selector )[ 0 ];\n\t\t},\n\n\t\terrors: function() {\n\t\t\tvar errorClass = this.settings.errorClass.split( \" \" ).join( \".\" );\n\t\t\treturn $( this.settings.errorElement + \".\" + errorClass, this.errorContext );\n\t\t},\n\n\t\tresetInternals: function() {\n\t\t\tthis.successList = [];\n\t\t\tthis.errorList = [];\n\t\t\tthis.errorMap = {};\n\t\t\tthis.toShow = $( [] );\n\t\t\tthis.toHide = $( [] );\n\t\t},\n\n\t\treset: function() {\n\t\t\tthis.resetInternals();\n\t\t\tthis.currentElements = $( [] );\n\t\t},\n\n\t\tprepareForm: function() {\n\t\t\tthis.reset();\n\t\t\tthis.toHide = this.errors().add( this.containers );\n\t\t},\n\n\t\tprepareElement: function( element ) {\n\t\t\tthis.reset();\n\t\t\tthis.toHide = this.errorsFor( element );\n\t\t},\n\n\t\telementValue: function( element ) {\n\t\t\tvar $element = $( element ),\n\t\t\t\ttype = element.type,\n\t\t\t\tval, idx;\n\n\t\t\tif ( type === \"radio\" || type === \"checkbox\" ) {\n\t\t\t\treturn this.findByName( element.name ).filter( \":checked\" ).val();\n\t\t\t} else if ( type === \"number\" && typeof element.validity !== \"undefined\" ) {\n\t\t\t\treturn element.validity.badInput ? \"NaN\" : $element.val();\n\t\t\t}\n\n\t\t\tif ( element.hasAttribute( \"contenteditable\" ) ) {\n\t\t\t\tval = $element.text();\n\t\t\t} else {\n\t\t\t\tval = $element.val();\n\t\t\t}\n\n\t\t\tif ( type === \"file\" ) {\n\n\t\t\t\t// Modern browser (chrome & safari)\n\t\t\t\tif ( val.substr( 0, 12 ) === \"C:\\\\fakepath\\\\\" ) {\n\t\t\t\t\treturn val.substr( 12 );\n\t\t\t\t}\n\n\t\t\t\t// Legacy browsers\n\t\t\t\t// Unix-based path\n\t\t\t\tidx = val.lastIndexOf( \"/\" );\n\t\t\t\tif ( idx >= 0 ) {\n\t\t\t\t\treturn val.substr( idx + 1 );\n\t\t\t\t}\n\n\t\t\t\t// Windows-based path\n\t\t\t\tidx = val.lastIndexOf( \"\\\\\" );\n\t\t\t\tif ( idx >= 0 ) {\n\t\t\t\t\treturn val.substr( idx + 1 );\n\t\t\t\t}\n\n\t\t\t\t// Just the file name\n\t\t\t\treturn val;\n\t\t\t}\n\n\t\t\tif ( typeof val === \"string\" ) {\n\t\t\t\treturn val.replace( /\\r/g, \"\" );\n\t\t\t}\n\t\t\treturn val;\n\t\t},\n\n\t\tcheck: function( element ) {\n\t\t\telement = this.validationTargetFor( this.clean( element ) );\n\n\t\t\tvar rules = $( element ).rules(),\n\t\t\t\trulesCount = $.map( rules, function( n, i ) {\n\t\t\t\t\treturn i;\n\t\t\t\t} ).length,\n\t\t\t\tdependencyMismatch = false,\n\t\t\t\tval = this.elementValue( element ),\n\t\t\t\tresult, method, rule;\n\n\t\t\t// If a normalizer is defined for this element, then\n\t\t\t// call it to retreive the changed value instead\n\t\t\t// of using the real one.\n\t\t\t// Note that `this` in the normalizer is `element`.\n\t\t\tif ( typeof rules.normalizer === \"function\" ) {\n\t\t\t\tval = rules.normalizer.call( element, val );\n\n\t\t\t\tif ( typeof val !== \"string\" ) {\n\t\t\t\t\tthrow new TypeError( \"The normalizer should return a string value.\" );\n\t\t\t\t}\n\n\t\t\t\t// Delete the normalizer from rules to avoid treating\n\t\t\t\t// it as a pre-defined method.\n\t\t\t\tdelete rules.normalizer;\n\t\t\t}\n\n\t\t\tfor ( method in rules ) {\n\t\t\t\trule = { method: method, parameters: rules[ method ] };\n\t\t\t\ttry {\n\t\t\t\t\tresult = $.validator.methods[ method ].call( this, val, element, rule.parameters );\n\n\t\t\t\t\t// If a method indicates that the field is optional and therefore valid,\n\t\t\t\t\t// don't mark it as valid when there are no other rules\n\t\t\t\t\tif ( result === \"dependency-mismatch\" && rulesCount === 1 ) {\n\t\t\t\t\t\tdependencyMismatch = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdependencyMismatch = false;\n\n\t\t\t\t\tif ( result === \"pending\" ) {\n\t\t\t\t\t\tthis.toHide = this.toHide.not( this.errorsFor( element ) );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !result ) {\n\t\t\t\t\t\tthis.formatAndAdd( element, rule );\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\tif ( this.settings.debug && window.console ) {\n\t\t\t\t\t\tconsole.log( \"Exception occurred when checking element \" + element.id + \", check the '\" + rule.method + \"' method.\", e );\n\t\t\t\t\t}\n\t\t\t\t\tif ( e instanceof TypeError ) {\n\t\t\t\t\t\te.message += \". Exception occurred when checking element \" + element.id + \", check the '\" + rule.method + \"' method.\";\n\t\t\t\t\t}\n\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( dependencyMismatch ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( this.objectLength( rules ) ) {\n\t\t\t\tthis.successList.push( element );\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t// Return the custom message for the given element and validation method\n\t\t// specified in the element's HTML5 data attribute\n\t\t// return the generic message if present and no method specific message is present;\n\t\tcustomDataMessage: function( element, method ) {\n\t\t\treturn $( element ).data( \"msg\" + method.charAt( 0 ).toUpperCase() +\n\t\t\t\tmethod.substring( 1 ).toLowerCase() ) || $( element ).data( \"msg\" );\n\t\t},\n\n\t\t// Return the custom message for the given element name and validation method\n\t\tcustomMessage: function( name, method ) {\n\t\t\tvar m = this.settings.messages[ name ];\n\t\t\treturn m && ( m.constructor === String ? m : m[ method ] );\n\t\t},\n\n\t\t// Return the first defined argument, allowing empty strings\n\t\tfindDefined: function() {\n\t\t\tfor ( var i = 0; i < arguments.length; i++ ) {\n\t\t\t\tif ( arguments[ i ] !== undefined ) {\n\t\t\t\t\treturn arguments[ i ];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\n\t\tdefaultMessage: function( element, rule ) {\n\t\t\tvar message = this.findDefined(\n\t\t\t\t\tthis.customMessage( element.name, rule.method ),\n\t\t\t\t\tthis.customDataMessage( element, rule.method ),\n\n\t\t\t\t\t// 'title' is never undefined, so handle empty string as undefined\n\t\t\t\t\t!this.settings.ignoreTitle && element.title || undefined,\n\t\t\t\t\t$.validator.messages[ rule.method ],\n\t\t\t\t\t\"<strong>Warning: No message defined for \" + element.name + \"</strong>\"\n\t\t\t\t),\n\t\t\t\ttheregex = /\\$?\\{(\\d+)\\}/g;\n\t\t\tif ( typeof message === \"function\" ) {\n\t\t\t\tmessage = message.call( this, rule.parameters, element );\n\t\t\t} else if ( theregex.test( message ) ) {\n\t\t\t\tmessage = $.validator.format( message.replace( theregex, \"{$1}\" ), rule.parameters );\n\t\t\t}\n\n\t\t\treturn message;\n\t\t},\n\n\t\tformatAndAdd: function( element, rule ) {\n\t\t\tvar message = this.defaultMessage( element, rule );\n\n\t\t\tthis.errorList.push( {\n\t\t\t\tmessage: message,\n\t\t\t\telement: element,\n\t\t\t\tmethod: rule.method\n\t\t\t} );\n\n\t\t\tthis.errorMap[ element.name ] = message;\n\t\t\tthis.submitted[ element.name ] = message;\n\t\t},\n\n\t\taddWrapper: function( toToggle ) {\n\t\t\tif ( this.settings.wrapper ) {\n\t\t\t\ttoToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );\n\t\t\t}\n\t\t\treturn toToggle;\n\t\t},\n\n\t\tdefaultShowErrors: function ()\n\t\t{\n\t\t\tvar i, elements, error;\n\t\t\tfor ( i = 0; this.errorList[ i ]; i++ ) {\n\t\t\t\terror = this.errorList[ i ];\n\t\t\t\tif ( this.settings.highlight ) {\n\t\t\t\t\tthis.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );\n\t\t\t\t}\n\t\t\t\tthis.showLabel( error.element, error.message );\n\t\t\t}\n\t\t\tif ( this.errorList.length ) {\n\t\t\t\tthis.toShow = this.toShow.add( this.containers );\n\t\t\t}\n\t\t\tif ( this.settings.success ) {\n\t\t\t\tfor ( i = 0; this.successList[ i ]; i++ ) {\n\t\t\t\t\tthis.showLabel( this.successList[ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( this.settings.unhighlight ) {\n\t\t\t\tfor ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) {\n\t\t\t\t\tthis.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass );\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.toHide = this.toHide.not( this.toShow );\n\t\t\tthis.hideErrors();\n\t\t\tthis.addWrapper( this.toShow ).show();\n\t\t},\n\n\t\tvalidElements: function() {\n\t\t\treturn this.currentElements.not( this.invalidElements() );\n\t\t},\n\n\t\tinvalidElements: function() {\n\t\t\treturn $( this.errorList ).map( function() {\n\t\t\t\treturn this.element;\n\t\t\t} );\n\t\t},\n\n\t\tshowLabel: function( element, message ) {\n\t\t\tvar place, group, errorID, v,\n\t\t\t\terror = this.errorsFor( element ),\n\t\t\t\telementID = this.idOrName( element ),\n\t\t\t\tdescribedBy = $( element ).attr( \"aria-describedby\" );\n\n\t\t\tif ( error.length ) {\n\n\t\t\t\t// Refresh error/success class\n\t\t\t\terror.removeClass( this.settings.validClass ).addClass( this.settings.errorClass );\n\n\t\t\t\t// Replace message on existing label\n\t\t\t\terror.html( message );\n\t\t\t} else {\n\n\t\t\t\t// Create error element\n\t\t\t\terror = $( \"<\" + this.settings.errorElement + \">\" )\n\t\t\t\t\t.attr( \"id\", elementID + \"-error\" )\n\t\t\t\t\t.addClass( this.settings.errorClass )\n\t\t\t\t\t.html( message || \"\" );\n\n\t\t\t\t// Maintain reference to the element to be placed into the DOM\n\t\t\t\tplace = error;\n\t\t\t\tif ( this.settings.wrapper ) {\n\n\t\t\t\t\t// Make sure the element is visible, even in IE\n\t\t\t\t\t// actually showing the wrapped element is handled elsewhere\n\t\t\t\t\tplace = error.hide().show().wrap( \"<\" + this.settings.wrapper + \"/>\" ).parent();\n\t\t\t\t}\n\t\t\t\tif ( this.labelContainer.length ) {\n\t\t\t\t\tthis.labelContainer.append( place );\n\t\t\t\t} else if ( this.settings.errorPlacement ) {\n\t\t\t\t\tthis.settings.errorPlacement( place, $( element ) );\n\t\t\t\t} else {\n\t\t\t\t\tplace.insertAfter( element );\n\t\t\t\t}\n\n\t\t\t\t// Link error back to the element\n\t\t\t\tif ( error.is( \"label\" ) ) {\n\n\t\t\t\t\t// If the error is a label, then associate using 'for'\n\t\t\t\t\terror.attr( \"for\", elementID );\n\n\t\t\t\t\t// If the element is not a child of an associated label, then it's necessary\n\t\t\t\t\t// to explicitly apply aria-describedby\n\t\t\t\t} else if ( error.parents( \"label[for='\" + this.escapeCssMeta( elementID ) + \"']\" ).length === 0 ) {\n\t\t\t\t\terrorID = error.attr( \"id\" );\n\n\t\t\t\t\t// Respect existing non-error aria-describedby\n\t\t\t\t\tif ( !describedBy ) {\n\t\t\t\t\t\tdescribedBy = errorID;\n\t\t\t\t\t} else if ( !describedBy.match( new RegExp( \"\\\\b\" + this.escapeCssMeta( errorID ) + \"\\\\b\" ) ) ) {\n\n\t\t\t\t\t\t// Add to end of list if not already present\n\t\t\t\t\t\tdescribedBy += \" \" + errorID;\n\t\t\t\t\t}\n\t\t\t\t\t$( element ).attr( \"aria-describedby\", describedBy );\n\n\t\t\t\t\t// If this element is grouped, then assign to all elements in the same group\n\t\t\t\t\tgroup = this.groups[ element.name ];\n\t\t\t\t\tif ( group ) {\n\t\t\t\t\t\tv = this;\n\t\t\t\t\t\t$.each( v.groups, function( name, testgroup ) {\n\t\t\t\t\t\t\tif ( testgroup === group ) {\n\t\t\t\t\t\t\t\t$( \"[name='\" + v.escapeCssMeta( name ) + \"']\", v.currentForm )\n\t\t\t\t\t\t\t\t\t.attr( \"aria-describedby\", error.attr( \"id\" ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( !message && this.settings.success ) {\n\t\t\t\terror.text( \"\" );\n\t\t\t\tif ( typeof this.settings.success === \"string\" ) {\n\t\t\t\t\terror.addClass( this.settings.success );\n\t\t\t\t} else {\n\t\t\t\t\tthis.settings.success( error, element );\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.toShow = this.toShow.add( error );\n\t\t},\n\n\t\terrorsFor: function( element ) {\n\t\t\tvar name = this.escapeCssMeta( this.idOrName( element ) ),\n\t\t\t\tdescriber = $( element ).attr( \"aria-describedby\" ),\n\t\t\t\tselector = \"label[for='\" + name + \"'], label[for='\" + name + \"'] *\";\n\n\t\t\t// 'aria-describedby' should directly reference the error element\n\t\t\tif ( describer ) {\n\t\t\t\tselector = selector + \", #\" + this.escapeCssMeta( describer )\n\t\t\t\t\t.replace( /\\s+/g, \", #\" );\n\t\t\t}\n\n\t\t\treturn this\n\t\t\t\t.errors()\n\t\t\t\t.filter( selector );\n\t\t},\n\n\t\t// See https://api.jquery.com/category/selectors/, for CSS\n\t\t// meta-characters that should be escaped in order to be used with JQuery\n\t\t// as a literal part of a name/id or any selector.\n\t\tescapeCssMeta: function( string ) {\n\t\t\treturn string.replace( /([\\\\!\"#$%&'()*+,./:;<=>?@\\[\\]^`{|}~])/g, \"\\\\$1\" );\n\t\t},\n\n\t\tidOrName: function( element ) {\n\t\t\treturn this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name );\n\t\t},\n\n\t\tvalidationTargetFor: function( element ) {\n\n\t\t\t// If radio/checkbox, validate first element in group instead\n\t\t\tif ( this.checkable( element ) ) {\n\t\t\t\telement = this.findByName( element.name );\n\t\t\t}\n\n\t\t\t// Always apply ignore filter\n\t\t\treturn $( element ).not( this.settings.ignore )[ 0 ];\n\t\t},\n\n\t\tcheckable: function( element ) {\n\t\t\treturn ( /radio|checkbox/i ).test( element.type );\n\t\t},\n\n\t\tfindByName: function( name ) {\n\t\t\treturn $( this.currentForm ).find( \"[name='\" + this.escapeCssMeta( name ) + \"']\" );\n\t\t},\n\n\t\tgetLength: function( value, element ) {\n\t\t\tswitch ( element.nodeName.toLowerCase() ) {\n\t\t\tcase \"select\":\n\t\t\t\treturn $( \"option:selected\", element ).length;\n\t\t\tcase \"input\":\n\t\t\t\tif ( this.checkable( element ) ) {\n\t\t\t\t\treturn this.findByName( element.name ).filter( \":checked\" ).length;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn value.length;\n\t\t},\n\n\t\tdepend: function( param, element ) {\n\t\t\treturn this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true;\n\t\t},\n\n\t\tdependTypes: {\n\t\t\t\"boolean\": function( param ) {\n\t\t\t\treturn param;\n\t\t\t},\n\t\t\t\"string\": function( param, element ) {\n\t\t\t\treturn !!$( param, element.form ).length;\n\t\t\t},\n\t\t\t\"function\": function( param, element ) {\n\t\t\t\treturn param( element );\n\t\t\t}\n\t\t},\n\n\t\toptional: function( element ) {\n\t\t\tvar val = this.elementValue( element );\n\t\t\treturn !$.validator.methods.required.call( this, val, element ) && \"dependency-mismatch\";\n\t\t},\n\n\t\tstartRequest: function( element ) {\n\t\t\tif ( !this.pending[ element.name ] ) {\n\t\t\t\tthis.pendingRequest++;\n\t\t\t\t$( element ).addClass( this.settings.pendingClass );\n\t\t\t\tthis.pending[ element.name ] = true;\n\t\t\t}\n\t\t},\n\n\t\tstopRequest: function( element, valid ) {\n\t\t\tthis.pendingRequest--;\n\n\t\t\t// Sometimes synchronization fails, make sure pendingRequest is never < 0\n\t\t\tif ( this.pendingRequest < 0 ) {\n\t\t\t\tthis.pendingRequest = 0;\n\t\t\t}\n\t\t\tdelete this.pending[ element.name ];\n\t\t\t$( element ).removeClass( this.settings.pendingClass );\n\t\t\tif ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) {\n\t\t\t\t$( this.currentForm ).submit();\n\t\t\t\tthis.formSubmitted = false;\n\t\t\t} else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) {\n\t\t\t\t$( this.currentForm ).triggerHandler( \"invalid-form\", [ this ] );\n\t\t\t\tthis.formSubmitted = false;\n\t\t\t}\n\t\t},\n\n\t\tpreviousValue: function( element, method ) {\n\t\t\treturn $.data( element, \"previousValue\" ) || $.data( element, \"previousValue\", {\n\t\t\t\told: null,\n\t\t\t\tvalid: true,\n\t\t\t\tmessage: this.defaultMessage( element, { method: method } )\n\t\t\t} );\n\t\t},\n\n\t\t// Cleans up all forms and elements, removes validator-specific events\n\t\tdestroy: function() {\n\t\t\tthis.resetForm();\n\n\t\t\t$( this.currentForm )\n\t\t\t\t.off( \".validate\" )\n\t\t\t\t.removeData( \"validator\" )\n\t\t\t\t.find( \".validate-equalTo-blur\" )\n\t\t\t\t\t.off( \".validate-equalTo\" )\n\t\t\t\t\t.removeClass( \"validate-equalTo-blur\" );\n\t\t}\n\n\t},\n\n\tclassRuleSettings: {\n\t\trequired: { required: true },\n\t\temail: { email: true },\n\t\turl: { url: true },\n\t\tdate: { date: true },\n\t\tdateISO: { dateISO: true },\n\t\tnumber: { number: true },\n\t\tdigits: { digits: true },\n\t\tcreditcard: { creditcard: true }\n\t},\n\n\taddClassRules: function( className, rules ) {\n\t\tif ( className.constructor === String ) {\n\t\t\tthis.classRuleSettings[ className ] = rules;\n\t\t} else {\n\t\t\t$.extend( this.classRuleSettings, className );\n\t\t}\n\t},\n\n\tclassRules: function( element ) {\n\t\tvar rules = {},\n\t\t\tclasses = $( element ).attr( \"class\" );\n\n\t\tif ( classes ) {\n\t\t\t$.each( classes.split( \" \" ), function() {\n\t\t\t\tif ( this in $.validator.classRuleSettings ) {\n\t\t\t\t\t$.extend( rules, $.validator.classRuleSettings[ this ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\treturn rules;\n\t},\n\n\tnormalizeAttributeRule: function( rules, type, method, value ) {\n\n\t\t// Convert the value to a number for number inputs, and for text for backwards compability\n\t\t// allows type=\"date\" and others to be compared as strings\n\t\tif ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) {\n\t\t\tvalue = Number( value );\n\n\t\t\t// Support Opera Mini, which returns NaN for undefined minlength\n\t\t\tif ( isNaN( value ) ) {\n\t\t\t\tvalue = undefined;\n\t\t\t}\n\t\t}\n\n\t\tif ( value || value === 0 ) {\n\t\t\trules[ method ] = value;\n\t\t} else if ( type === method && type !== \"range\" ) {\n\n\t\t\t// Exception: the jquery validate 'range' method\n\t\t\t// does not test for the html5 'range' type\n\t\t\trules[ method ] = true;\n\t\t}\n\t},\n\n\tattributeRules: function( element ) {\n\t\tvar rules = {},\n\t\t\t$element = $( element ),\n\t\t\ttype = element.getAttribute( \"type\" ),\n\t\t\tmethod, value;\n\n\t\tfor ( method in $.validator.methods ) {\n\n\t\t\t// Support for <input required> in both html5 and older browsers\n\t\t\tif ( method === \"required\" ) {\n\t\t\t\tvalue = element.getAttribute( method );\n\n\t\t\t\t// Some browsers return an empty string for the required attribute\n\t\t\t\t// and non-HTML5 browsers might have required=\"\" markup\n\t\t\t\tif ( value === \"\" ) {\n\t\t\t\t\tvalue = true;\n\t\t\t\t}\n\n\t\t\t\t// Force non-HTML5 browsers to return bool\n\t\t\t\tvalue = !!value;\n\t\t\t} else {\n\t\t\t\tvalue = $element.attr( method );\n\t\t\t}\n\n\t\t\tthis.normalizeAttributeRule( rules, type, method, value );\n\t\t}\n\n\t\t// 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs\n\t\tif ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) {\n\t\t\tdelete rules.maxlength;\n\t\t}\n\n\t\treturn rules;\n\t},\n\n\tdataRules: function( element ) {\n\t\tvar rules = {},\n\t\t\t$element = $( element ),\n\t\t\ttype = element.getAttribute( \"type\" ),\n\t\t\tmethod, value;\n\n\t\tfor ( method in $.validator.methods ) {\n\t\t\tvalue = $element.data( \"rule\" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() );\n\t\t\tthis.normalizeAttributeRule( rules, type, method, value );\n\t\t}\n\t\treturn rules;\n\t},\n\n\tstaticRules: function( element ) {\n\t\tvar rules = {},\n\t\t\tvalidator = $.data( element.form, \"validator\" );\n\n\t\tif ( validator.settings.rules ) {\n\t\t\trules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {};\n\t\t}\n\t\treturn rules;\n\t},\n\n\tnormalizeRules: function( rules, element ) {\n\n\t\t// Handle dependency check\n\t\t$.each( rules, function( prop, val ) {\n\n\t\t\t// Ignore rule when param is explicitly false, eg. required:false\n\t\t\tif ( val === false ) {\n\t\t\t\tdelete rules[ prop ];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( val.param || val.depends ) {\n\t\t\t\tvar keepRule = true;\n\t\t\t\tswitch ( typeof val.depends ) {\n\t\t\t\tcase \"string\":\n\t\t\t\t\tkeepRule = !!$( val.depends, element.form ).length;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"function\":\n\t\t\t\t\tkeepRule = val.depends.call( element, element );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( keepRule ) {\n\t\t\t\t\trules[ prop ] = val.param !== undefined ? val.param : true;\n\t\t\t\t} else {\n\t\t\t\t\t$.data( element.form, \"validator\" ).resetElements( $( element ) );\n\t\t\t\t\tdelete rules[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\t// Evaluate parameters\n\t\t$.each( rules, function( rule, parameter ) {\n\t\t\trules[ rule ] = $.isFunction( parameter ) && rule !== \"normalizer\" ? parameter( element ) : parameter;\n\t\t} );\n\n\t\t// Clean number parameters\n\t\t$.each( [ \"minlength\", \"maxlength\" ], function() {\n\t\t\tif ( rules[ this ] ) {\n\t\t\t\trules[ this ] = Number( rules[ this ] );\n\t\t\t}\n\t\t} );\n\t\t$.each( [ \"rangelength\", \"range\" ], function() {\n\t\t\tvar parts;\n\t\t\tif ( rules[ this ] ) {\n\t\t\t\tif ( $.isArray( rules[ this ] ) ) {\n\t\t\t\t\trules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ];\n\t\t\t\t} else if ( typeof rules[ this ] === \"string\" ) {\n\t\t\t\t\tparts = rules[ this ].replace( /[\\[\\]]/g, \"\" ).split( /[\\s,]+/ );\n\t\t\t\t\trules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ];\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tif ( $.validator.autoCreateRanges ) {\n\n\t\t\t// Auto-create ranges\n\t\t\tif ( rules.min != null && rules.max != null ) {\n\t\t\t\trules.range = [ rules.min, rules.max ];\n\t\t\t\tdelete rules.min;\n\t\t\t\tdelete rules.max;\n\t\t\t}\n\t\t\tif ( rules.minlength != null && rules.maxlength != null ) {\n\t\t\t\trules.rangelength = [ rules.minlength, rules.maxlength ];\n\t\t\t\tdelete rules.minlength;\n\t\t\t\tdelete rules.maxlength;\n\t\t\t}\n\t\t}\n\n\t\treturn rules;\n\t},\n\n\t// Converts a simple string to a {string: true} rule, e.g., \"required\" to {required:true}\n\tnormalizeRule: function( data ) {\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tvar transformed = {};\n\t\t\t$.each( data.split( /\\s/ ), function() {\n\t\t\t\ttransformed[ this ] = true;\n\t\t\t} );\n\t\t\tdata = transformed;\n\t\t}\n\t\treturn data;\n\t},\n\n\t// http://jqueryvalidation.org/jQuery.validator.addMethod/\n\taddMethod: function( name, method, message ) {\n\t\t$.validator.methods[ name ] = method;\n\t\t$.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ];\n\t\tif ( method.length < 3 ) {\n\t\t\t$.validator.addClassRules( name, $.validator.normalizeRule( name ) );\n\t\t}\n\t},\n\n\t// http://jqueryvalidation.org/jQuery.validator.methods/\n\tmethods: {\n\n\t\t// http://jqueryvalidation.org/required-method/\n\t\trequired: function( value, element, param ) {\n\n\t\t\t// Check if dependency is met\n\t\t\tif ( !this.depend( param, element ) ) {\n\t\t\t\treturn \"dependency-mismatch\";\n\t\t\t}\n\t\t\tif ( element.nodeName.toLowerCase() === \"select\" ) {\n\n\t\t\t\t// Could be an array for select-multiple or a string, both are fine this way\n\t\t\t\tvar val = $( element ).val();\n\t\t\t\treturn val && val.length > 0;\n\t\t\t}\n\t\t\tif ( this.checkable( element ) ) {\n\t\t\t\treturn this.getLength( value, element ) > 0;\n\t\t\t}\n\t\t\treturn value.length > 0;\n\t\t},\n\n\t\t// http://jqueryvalidation.org/email-method/\n\t\temail: function( value, element ) {\n\n\t\t\t// From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address\n\t\t\t// Retrieved 2014-01-14\n\t\t\t// If you have a problem with this implementation, report a bug against the above spec\n\t\t\t// Or use custom methods to implement your own email validation\n\t\t\treturn this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/url-method/\n\t\turl: function( value, element ) {\n\n\t\t\t// Copyright (c) 2010-2013 Diego Perini, MIT licensed\n\t\t\t// https://gist.github.com/dperini/729294\n\t\t\t// see also https://mathiasbynens.be/demo/url-regex\n\t\t\t// modified to allow protocol-relative URLs\n\t\t\treturn this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})).?)(?::\\d{2,5})?(?:[/?#]\\S*)?$/i.test( value );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/date-method/\n\t\tdate: function( value, element ) {\n\t\t\treturn this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/dateISO-method/\n\t\tdateISO: function( value, element ) {\n\t\t\treturn this.optional( element ) || /^\\d{4}[\\/\\-](0?[1-9]|1[012])[\\/\\-](0?[1-9]|[12][0-9]|3[01])$/.test( value );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/number-method/\n\t\tnumber: function( value, element ) {\n\t\t\treturn this.optional( element ) || /^(?:-?\\d+|-?\\d{1,3}(?:,\\d{3})+)?(?:\\.\\d+)?$/.test( value );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/digits-method/\n\t\tdigits: function( value, element ) {\n\t\t\treturn this.optional( element ) || /^\\d+$/.test( value );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/minlength-method/\n\t\tminlength: function( value, element, param ) {\n\t\t\tvar length = $.isArray( value ) ? value.length : this.getLength( value, element );\n\t\t\treturn this.optional( element ) || length >= param;\n\t\t},\n\n\t\t// http://jqueryvalidation.org/maxlength-method/\n\t\tmaxlength: function( value, element, param ) {\n\t\t\tvar length = $.isArray( value ) ? value.length : this.getLength( value, element );\n\t\t\treturn this.optional( element ) || length <= param;\n\t\t},\n\n\t\t// http://jqueryvalidation.org/rangelength-method/\n\t\trangelength: function( value, element, param ) {\n\t\t\tvar length = $.isArray( value ) ? value.length : this.getLength( value, element );\n\t\t\treturn this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/min-method/\n\t\tmin: function( value, element, param ) {\n\t\t\treturn this.optional( element ) || value >= param;\n\t\t},\n\n\t\t// http://jqueryvalidation.org/max-method/\n\t\tmax: function( value, element, param ) {\n\t\t\treturn this.optional( element ) || value <= param;\n\t\t},\n\n\t\t// http://jqueryvalidation.org/range-method/\n\t\trange: function( value, element, param ) {\n\t\t\treturn this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/step-method/\n\t\tstep: function( value, element, param ) {\n\t\t\tvar type = $( element ).attr( \"type\" ),\n\t\t\t\terrorMessage = \"Step attribute on input type \" + type + \" is not supported.\",\n\t\t\t\tsupportedTypes = [ \"text\", \"number\", \"range\" ],\n\t\t\t\tre = new RegExp( \"\\\\b\" + type + \"\\\\b\" ),\n\t\t\t\tnotSupported = type && !re.test( supportedTypes.join() );\n\n\t\t\t// Works only for text, number and range input types\n\t\t\t// TODO find a way to support input types date, datetime, datetime-local, month, time and week\n\t\t\tif ( notSupported ) {\n\t\t\t\tthrow new Error( errorMessage );\n\t\t\t}\n\t\t\treturn this.optional( element ) || ( value % param === 0 );\n\t\t},\n\n\t\t// http://jqueryvalidation.org/equalTo-method/\n\t\tequalTo: function( value, element, param ) {\n\n\t\t\t// Bind to the blur event of the target in order to revalidate whenever the target field is updated\n\t\t\tvar target = $( param );\n\t\t\tif ( this.settings.onfocusout && target.not( \".validate-equalTo-blur\" ).length ) {\n\t\t\t\ttarget.addClass( \"validate-equalTo-blur\" ).on( \"blur.validate-equalTo\", function() {\n\t\t\t\t\t$( element ).valid();\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn value === target.val();\n\t\t},\n\n\t\t// http://jqueryvalidation.org/remote-method/\n\t\tremote: function( value, element, param, method ) {\n\t\t\tif ( this.optional( element ) ) {\n\t\t\t\treturn \"dependency-mismatch\";\n\t\t\t}\n\n\t\t\tmethod = typeof method === \"string\" && method || \"remote\";\n\n\t\t\tvar previous = this.previousValue( element, method ),\n\t\t\t\tvalidator, data, optionDataString;\n\n\t\t\tif ( !this.settings.messages[ element.name ] ) {\n\t\t\t\tthis.settings.messages[ element.name ] = {};\n\t\t\t}\n\t\t\tprevious.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ];\n\t\t\tthis.settings.messages[ element.name ][ method ] = previous.message;\n\n\t\t\tparam = typeof param === \"string\" && { url: param } || param;\n\t\t\toptionDataString = $.param( $.extend( { data: value }, param.data ) );\n\t\t\tif ( previous.old === optionDataString ) {\n\t\t\t\treturn previous.valid;\n\t\t\t}\n\n\t\t\tprevious.old = optionDataString;\n\t\t\tvalidator = this;\n\t\t\tthis.startRequest( element );\n\t\t\tdata = {};\n\t\t\tdata[ element.name ] = value;\n\t\t\t$.ajax( $.extend( true, {\n\t\t\t\tmode: \"abort\",\n\t\t\t\tport: \"validate\" + element.name,\n\t\t\t\tdataType: \"json\",\n\t\t\t\tdata: data,\n\t\t\t\tcontext: validator.currentForm,\n\t\t\t\tsuccess: function( response ) {\n\t\t\t\t\tvar valid = response === true || response === \"true\",\n\t\t\t\t\t\terrors, message, submitted;\n\n\t\t\t\t\tvalidator.settings.messages[ element.name ][ method ] = previous.originalMessage;\n\t\t\t\t\tif ( valid ) {\n\t\t\t\t\t\tsubmitted = validator.formSubmitted;\n\t\t\t\t\t\tvalidator.resetInternals();\n\t\t\t\t\t\tvalidator.toHide = validator.errorsFor( element );\n\t\t\t\t\t\tvalidator.formSubmitted = submitted;\n\t\t\t\t\t\tvalidator.successList.push( element );\n\t\t\t\t\t\tvalidator.invalid[ element.name ] = false;\n\t\t\t\t\t\tvalidator.showErrors();\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors = {};\n\t\t\t\t\t\tmessage = response || validator.defaultMessage( element, { method: method, parameters: value } );\n\t\t\t\t\t\terrors[ element.name ] = previous.message = message;\n\t\t\t\t\t\tvalidator.invalid[ element.name ] = true;\n\t\t\t\t\t\tvalidator.showErrors( errors );\n\t\t\t\t\t}\n\t\t\t\t\tprevious.valid = valid;\n\t\t\t\t\tvalidator.stopRequest( element, valid );\n\t\t\t\t}\n\t\t\t}, param ) );\n\t\t\treturn \"pending\";\n\t\t}\n\t}\n\n} );\n\n// Ajax mode: abort\n// usage: $.ajax({ mode: \"abort\"[, port: \"uniqueport\"]});\n// if mode:\"abort\" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()\n\nvar pendingRequests = {},\n\tajax;\n\n// Use a prefilter if available (1.5+)\nif ( $.ajaxPrefilter ) {\n\t$.ajaxPrefilter( function( settings, _, xhr ) {\n\t\tvar port = settings.port;\n\t\tif ( settings.mode === \"abort\" ) {\n\t\t\tif ( pendingRequests[ port ] ) {\n\t\t\t\tpendingRequests[ port ].abort();\n\t\t\t}\n\t\t\tpendingRequests[ port ] = xhr;\n\t\t}\n\t} );\n} else {\n\n\t// Proxy ajax\n\tajax = $.ajax;\n\t$.ajax = function( settings ) {\n\t\tvar mode = ( \"mode\" in settings ? settings : $.ajaxSettings ).mode,\n\t\t\tport = ( \"port\" in settings ? settings : $.ajaxSettings ).port;\n\t\tif ( mode === \"abort\" ) {\n\t\t\tif ( pendingRequests[ port ] ) {\n\t\t\t\tpendingRequests[ port ].abort();\n\t\t\t}\n\t\t\tpendingRequests[ port ] = ajax.apply( this, arguments );\n\t\t\treturn pendingRequests[ port ];\n\t\t}\n\t\treturn ajax.apply( this, arguments );\n\t};\n}\n\n}));","// Unobtrusive validation support library for jQuery and jQuery Validate\n// Copyright (C) Microsoft Corporation. All rights reserved.\n// @version v3.2.6\n\n/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */\n/*global document: false, jQuery: false */\n\n(function (factory) {\n jQuery.validator.unobtrusive = factory(jQuery);\n}(function ($) {\n var $jQval = $.validator,\n adapters,\n data_validation = \"unobtrusiveValidation\";\n\n function setValidationValues(options, ruleName, value) {\n options.rules[ruleName] = value;\n if (options.message) {\n options.messages[ruleName] = options.message;\n }\n }\n\n function splitAndTrim(value) {\n return value.replace(/^\\s+|\\s+$/g, \"\").split(/\\s*,\\s*/g);\n }\n\n function escapeAttributeValue(value) {\n // As mentioned on http://api.jquery.com/category/selectors/\n return value.replace(/([!\"#$%&'()*+,./:;<=>?@\\[\\\\\\]^`{|}~])/g, \"\\\\$1\");\n }\n\n function getModelPrefix(fieldName) {\n return fieldName.substr(0, fieldName.lastIndexOf(\".\") + 1);\n }\n\n function appendModelPrefix(value, prefix) {\n if (value.indexOf(\"*.\") === 0) {\n value = value.replace(\"*.\", prefix);\n }\n return value;\n }\n\n function onError(error, inputElement) { // 'this' is the form element\n var container = $(this).find(\"[data-valmsg-for='\" + escapeAttributeValue(inputElement[0].name) + \"']\"),\n replaceAttrValue = container.attr(\"data-valmsg-replace\"),\n replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;\n\n container.removeClass(\"field-validation-valid\").addClass(\"field-validation-error\");\n error.data(\"unobtrusiveContainer\", container);\n\n document.dispatchEvent(new CustomEvent('validationError', {\n detail: {\n error,\n inputElement,\n }\n }))\n\n if (replace) {\n container.empty();\n error.removeClass(\"input-validation-error\").appendTo(container);\n }\n else {\n error.hide();\n }\n }\n\n function onErrors(event, validator) { // 'this' is the form element\n var container = $(this).find(\"[data-valmsg-summary=true]\"),\n list = container.find(\"ul\");\n\n if (list && list.length && validator.errorList.length) {\n list.empty();\n container.addClass(\"validation-summary-errors\").removeClass(\"validation-summary-valid\");\n\n $.each(validator.errorList, function () {\n $(\"<li />\").html(this.message).appendTo(list);\n });\n }\n }\n\n function onSuccess(error) { // 'this' is the form element\n var container = error.data(\"unobtrusiveContainer\");\n\n if (container) {\n var replaceAttrValue = container.attr(\"data-valmsg-replace\"),\n replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;\n\n container.addClass(\"field-validation-valid\").removeClass(\"field-validation-error\");\n error.removeData(\"unobtrusiveContainer\");\n\n if (replace) {\n container.empty();\n }\n }\n }\n\n function onReset(event) { // 'this' is the form element\n var $form = $(this),\n key = '__jquery_unobtrusive_validation_form_reset';\n if ($form.data(key)) {\n return;\n }\n // Set a flag that indicates we're currently resetting the form.\n $form.data(key, true);\n try {\n $form.data(\"validator\").resetForm();\n } finally {\n $form.removeData(key);\n }\n\n $form.find(\".validation-summary-errors\")\n .addClass(\"validation-summary-valid\")\n .removeClass(\"validation-summary-errors\");\n $form.find(\".field-validation-error\")\n .addClass(\"field-validation-valid\")\n .removeClass(\"field-validation-error\")\n .removeData(\"unobtrusiveContainer\")\n .find(\">*\") // If we were using valmsg-replace, get the underlying error\n .removeData(\"unobtrusiveContainer\");\n }\n\n function validationInfo(form) {\n var $form = $(form),\n result = $form.data(data_validation),\n onResetProxy = $.proxy(onReset, form),\n defaultOptions = $jQval.unobtrusive.options || {},\n execInContext = function (name, args) {\n var func = defaultOptions[name];\n func && $.isFunction(func) && func.apply(form, args);\n }\n\n if (!result) {\n result = {\n options: { // options structure passed to jQuery Validate's validate() method\n errorClass: defaultOptions.errorClass || \"input-validation-error\",\n errorElement: defaultOptions.errorElement || \"span\",\n errorPlacement: function () {\n onError.apply(form, arguments);\n execInContext(\"errorPlacement\", arguments);\n },\n invalidHandler: function () {\n onErrors.apply(form, arguments);\n execInContext(\"invalidHandler\", arguments);\n },\n messages: {},\n rules: {},\n success: function () {\n onSuccess.apply(form, arguments);\n execInContext(\"success\", arguments);\n }\n },\n attachValidation: function () {\n $form\n .off(\"reset.\" + data_validation, onResetProxy)\n .on(\"reset.\" + data_validation, onResetProxy)\n .validate(this.options);\n },\n validate: function () { // a validation function that is called by unobtrusive Ajax\n $form.validate();\n return $form.valid();\n }\n };\n $form.data(data_validation, result);\n }\n\n return result;\n }\n\n $jQval.unobtrusive = {\n adapters: [],\n\n parseElement: function (element, skipAttach) {\n /// <summary>\n /// Parses a single HTML element for unobtrusive validation attributes.\n /// </summary>\n /// <param name=\"element\" domElement=\"true\">The HTML element to be parsed.</param>\n /// <param name=\"skipAttach\" type=\"Boolean\">[Optional] true to skip attaching the\n /// validation to the form. If parsing just this single element, you should specify true.\n /// If parsing several elements, you should specify false, and manually attach the validation\n /// to the form when you are finished. The default is false.</param>\n var $element = $(element),\n form = $element.parents(\"form\")[0],\n valInfo, rules, messages;\n\n if (!form) { // Cannot do client-side validation without a form\n return;\n }\n\n valInfo = validationInfo(form);\n valInfo.options.rules[element.name] = rules = {};\n valInfo.options.messages[element.name] = messages = {};\n\n $.each(this.adapters, function () {\n var prefix = \"data-val-\" + this.name,\n message = $element.attr(prefix),\n paramValues = {};\n\n if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)\n prefix += \"-\";\n\n $.each(this.params, function () {\n paramValues[this] = $element.attr(prefix + this);\n });\n\n this.adapt({\n element: element,\n form: form,\n message: message,\n params: paramValues,\n rules: rules,\n messages: messages\n });\n }\n });\n\n $.extend(rules, { \"__dummy__\": true });\n\n if (!skipAttach) {\n valInfo.attachValidation();\n }\n },\n\n parse: function (selector) {\n /// <summary>\n /// Parses all the HTML elements in the specified selector. It looks for input elements decorated\n /// with the [data-val=true] attribute value and enables validation according to the data-val-*\n /// attribute values.\n /// </summary>\n /// <param name=\"selector\" type=\"String\">Any valid jQuery selector.</param>\n\n // $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one\n // element with data-val=true\n var $selector = $(selector),\n $forms = $selector.parents()\n .addBack()\n .filter(\"form\")\n .add($selector.find(\"form\"))\n .has(\"[data-val=true]\");\n\n $selector.find(\"[data-val=true]\").each(function () {\n $jQval.unobtrusive.parseElement(this, true);\n });\n\n $forms.each(function () {\n var info = validationInfo(this);\n if (info) {\n info.attachValidation();\n }\n });\n }\n };\n\n adapters = $jQval.unobtrusive.adapters;\n\n adapters.add = function (adapterName, params, fn) {\n /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>\n /// <param name=\"adapterName\" type=\"String\">The name of the adapter to be added. This matches the name used\n /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>\n /// <param name=\"params\" type=\"Array\" optional=\"true\">[Optional] An array of parameter names (strings) that will\n /// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and\n /// mmmm is the parameter name).</param>\n /// <param name=\"fn\" type=\"Function\">The function to call, which adapts the values from the HTML\n /// attributes into jQuery Validate rules and/or messages.</param>\n /// <returns type=\"jQuery.validator.unobtrusive.adapters\" />\n if (!fn) { // Called with no params, just a function\n fn = params;\n params = [];\n }\n this.push({ name: adapterName, params: params, adapt: fn });\n return this;\n };\n\n adapters.addBool = function (adapterName, ruleName) {\n /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where\n /// the jQuery Validate validation rule has no parameter values.</summary>\n /// <param name=\"adapterName\" type=\"String\">The name of the adapter to be added. This matches the name used\n /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>\n /// <param name=\"ruleName\" type=\"String\" optional=\"true\">[Optional] The name of the jQuery Validate rule. If not provided, the value\n /// of adapterName will be used instead.</param>\n /// <returns type=\"jQuery.validator.unobtrusive.adapters\" />\n return this.add(adapterName, function (options) {\n setValidationValues(options, ruleName || adapterName, true);\n });\n };\n\n adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {\n /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where\n /// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and\n /// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>\n /// <param name=\"adapterName\" type=\"String\">The name of the adapter to be added. This matches the name used\n /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>\n /// <param name=\"minRuleName\" type=\"String\">The name of the jQuery Validate rule to be used when you only\n /// have a minimum value.</param>\n /// <param name=\"maxRuleName\" type=\"String\">The name of the jQuery Validate rule to be used when you only\n /// have a maximum value.</param>\n /// <param name=\"minMaxRuleName\" type=\"String\">The name of the jQuery Validate rule to be used when you\n /// have both a minimum and maximum value.</param>\n /// <param name=\"minAttribute\" type=\"String\" optional=\"true\">[Optional] The name of the HTML attribute that\n /// contains the minimum value. The default is \"min\".</param>\n /// <param name=\"maxAttribute\" type=\"String\" optional=\"true\">[Optional] The name of the HTML attribute that\n /// contains the maximum value. The default is \"max\".</param>\n /// <returns type=\"jQuery.validator.unobtrusive.adapters\" />\n return this.add(adapterName, [minAttribute || \"min\", maxAttribute || \"max\"], function (options) {\n var min = options.params.min,\n max = options.params.max;\n\n if (min && max) {\n setValidationValues(options, minMaxRuleName, [min, max]);\n }\n else if (min) {\n setValidationValues(options, minRuleName, min);\n }\n else if (max) {\n setValidationValues(options, maxRuleName, max);\n }\n });\n };\n\n adapters.addSingleVal = function (adapterName, attribute, ruleName) {\n /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where\n /// the jQuery Validate validation rule has a single value.</summary>\n /// <param name=\"adapterName\" type=\"String\">The name of the adapter to be added. This matches the name used\n /// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>\n /// <param name=\"attribute\" type=\"String\">[Optional] The name of the HTML attribute that contains the value.\n /// The default is \"val\".</param>\n /// <param name=\"ruleName\" type=\"String\" optional=\"true\">[Optional] The name of the jQuery Validate rule. If not provided, the value\n /// of adapterName will be used instead.</param>\n /// <returns type=\"jQuery.validator.unobtrusive.adapters\" />\n return this.add(adapterName, [attribute || \"val\"], function (options) {\n setValidationValues(options, ruleName || adapterName, options.params[attribute]);\n });\n };\n\n $jQval.addMethod(\"__dummy__\", function (value, element, params) {\n return true;\n });\n\n $jQval.addMethod(\"regex\", function (value, element, params) {\n var match;\n if (this.optional(element)) {\n return true;\n }\n\n match = new RegExp(params).exec(value);\n return (match && (match.index === 0) && (match[0].length === value.length));\n });\n\n $jQval.addMethod(\"nonalphamin\", function (value, element, nonalphamin) {\n var match;\n if (nonalphamin) {\n match = value.match(/\\W/g);\n match = match && match.length >= nonalphamin;\n }\n return match;\n });\n\n if ($jQval.methods.extension) {\n adapters.addSingleVal(\"accept\", \"mimtype\");\n adapters.addSingleVal(\"extension\", \"extension\");\n } else {\n // for backward compatibility, when the 'extension' validation method does not exist, such as with versions\n // of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for\n // validating the extension, and ignore mime-type validations as they are not supported.\n adapters.addSingleVal(\"extension\", \"extension\", \"accept\");\n }\n\n adapters.addSingleVal(\"regex\", \"pattern\");\n adapters.addBool(\"creditcard\").addBool(\"date\").addBool(\"digits\").addBool(\"email\").addBool(\"number\").addBool(\"url\");\n adapters.addMinMax(\"length\", \"minlength\", \"maxlength\", \"rangelength\").addMinMax(\"range\", \"min\", \"max\", \"range\");\n adapters.addMinMax(\"minlength\", \"minlength\").addMinMax(\"maxlength\", \"minlength\", \"maxlength\");\n adapters.add(\"equalto\", [\"other\"], function (options) {\n var prefix = getModelPrefix(options.element.name),\n other = options.params.other,\n fullOtherName = appendModelPrefix(other, prefix),\n element = $(options.form).find(\":input\").filter(\"[name='\" + escapeAttributeValue(fullOtherName) + \"']\")[0];\n\n setValidationValues(options, \"equalTo\", element);\n });\n adapters.add(\"required\", function (options) {\n // jQuery Validate equates \"required\" with \"mandatory\" for checkbox elements\n if (options.element.tagName.toUpperCase() !== \"INPUT\" || options.element.type.toUpperCase() !== \"CHECKBOX\") {\n setValidationValues(options, \"required\", true);\n }\n });\n adapters.add(\"remote\", [\"url\", \"type\", \"additionalfields\"], function (options) {\n var value = {\n url: options.params.url,\n type: options.params.type || \"GET\",\n data: {}\n },\n prefix = getModelPrefix(options.element.name);\n\n $.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {\n var paramName = appendModelPrefix(fieldName, prefix);\n value.data[paramName] = function () {\n var field = $(options.form).find(\":input\").filter(\"[name='\" + escapeAttributeValue(paramName) + \"']\");\n // For checkboxes and radio buttons, only pick up values from checked fields.\n if (field.is(\":checkbox\")) {\n return field.filter(\":checked\").val() || field.filter(\":hidden\").val() || '';\n }\n else if (field.is(\":radio\")) {\n return field.filter(\":checked\").val() || '';\n }\n return field.val();\n };\n });\n\n setValidationValues(options, \"remote\", value);\n });\n adapters.add(\"password\", [\"min\", \"nonalphamin\", \"regex\"], function (options) {\n if (options.params.min) {\n setValidationValues(options, \"minlength\", options.params.min);\n }\n if (options.params.nonalphamin) {\n setValidationValues(options, \"nonalphamin\", options.params.nonalphamin);\n }\n if (options.params.regex) {\n setValidationValues(options, \"regex\", options.params.regex);\n }\n });\n\n return $jQval.unobtrusive;\n}));","setTimeout(function() {\n (function (factory) {\n // Browser globals\n factory(jQuery.datepicker);\n }(function (datepicker) {\n datepicker.regional = {\n closeText: Localization.getString('Datepicker.Close', 'Закрыть'),\n prevText: \"\",\n nextText: \"\",\n currentText: Localization.getString('Datepicker.Today', 'СегоднÑ'),\n monthNames: [\n Localization.getString('Datepicker.January', 'Январь'),\n Localization.getString('Datepicker.February', 'Февраль'),\n Localization.getString('Datepicker.March', 'Март'),\n Localization.getString('Datepicker.April', 'Ðпрель'),\n Localization.getString('Datepicker.May', 'Май'),\n Localization.getString('Datepicker.June', ''),\n Localization.getString('Datepicker.July', ''),\n Localization.getString('Datepicker.August', ''),\n Localization.getString('Datepicker.September', ''),\n Localization.getString('Datepicker.October', ''),\n Localization.getString('Datepicker.November', ''),\n Localization.getString('Datepicker.December', '')\n ],\n monthNamesShort: [\n Localization.getString('Datepicker.JanuaryShort', 'Янв'),\n Localization.getString('Datepicker.FebruaryShort', 'Фев'),\n Localization.getString('Datepicker.MarchShort', 'Мар'),\n Localization.getString('Datepicker.AprilShort', 'Ðпр'),\n Localization.getString('Datepicker.MayShort', 'Май'),\n Localization.getString('Datepicker.JuneShort', 'Июн'),\n Localization.getString('Datepicker.JulyShort', 'Июл'),\n Localization.getString('Datepicker.AugustShort', 'Ðвг'),\n Localization.getString('Datepicker.SeptemberShort', 'Сен'),\n Localization.getString('Datepicker.OctoberShort', 'Окт'),\n Localization.getString('Datepicker.NovemberShort', 'ÐоÑ'),\n Localization.getString('Datepicker.DecemberShort', 'Дек')],\n dayNames: [\n Localization.getString('Datepicker.Sunday', 'ВоÑкреÑенье'),\n Localization.getString('Datepicker.Monday', 'Понедельник'),\n Localization.getString('Datepicker.Tuesday', 'Вторник'),\n Localization.getString('Datepicker.Wednesday', 'Среда'),\n Localization.getString('Datepicker.Thursday', 'Четверг'),\n Localization.getString('Datepicker.Friday', 'ПÑтница'),\n Localization.getString('Datepicker.Saturday', 'Суббота')\n ],\n dayNamesShort: [\n Localization.getString('Datepicker.SundayShort', 'вÑк'),\n Localization.getString('Datepicker.MondayShort', 'пнд'),\n Localization.getString('Datepicker.TuesdayShort', 'втр'),\n Localization.getString('Datepicker.WednesdayShort', 'Ñрд'),\n Localization.getString('Datepicker.ThursdayShort', 'чтв'),\n Localization.getString('Datepicker.FridayShort', 'птн'),\n Localization.getString('Datepicker.SaturdayShort', 'Ñбт')\n ],\n dayNamesMin: [\n Localization.getString('Datepicker.SundayMin', 'Ð’Ñ'),\n Localization.getString('Datepicker.MondayMin', 'Пн'),\n Localization.getString('Datepicker.TuesdayMin', 'Ð’Ñ‚'),\n Localization.getString('Datepicker.WednesdayMin', 'Ср'),\n Localization.getString('Datepicker.ThursdayMin', 'Чт'),\n Localization.getString('Datepicker.FridayMin', 'Пт'),\n Localization.getString('Datepicker.SaturdayMin', 'Сб')\n ],\n weekHeader: Localization.getString('Datepicker.WeekShort','Ðед'),\n dateFormat: Localization.getString('Datepicker.DateFormat','dd.mm.yy'),\n firstDay: 1,\n isRTL: false,\n showMonthAfterYear: false,\n yearSuffix: \"\"\n };\n datepicker.setDefaults(datepicker.regional);\n\n return datepicker.regional;\n\n }));\n}, 250);","/*! jQuery UI - v1.12.1 - 2018-02-06\n* http://jqueryui.com\n* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/datepicker.js, widgets/mouse.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js\n* Copyright jQuery Foundation and other contributors; Licensed MIT */\n\n(function (t) { \"function\" == typeof define && define.amd ? define([\"jquery\"], t) : t(jQuery) })(function (t) {\n function e(t) { for (var e = t.css(\"visibility\") ; \"inherit\" === e;) t = t.parent(), e = t.css(\"visibility\"); return \"hidden\" !== e } function i(t) { for (var e, i; t.length && t[0] !== document;) { if (e = t.css(\"position\"), (\"absolute\" === e || \"relative\" === e || \"fixed\" === e) && (i = parseInt(t.css(\"zIndex\"), 10), !isNaN(i) && 0 !== i)) return i; t = t.parent() } return 0 } function s() { this._curInst = null, this._keyEvent = !1, this._disabledInputs = [], this._datepickerShowing = !1, this._inDialog = !1, this._mainDivId = \"ui-datepicker-div\", this._inlineClass = \"ui-datepicker-inline\", this._appendClass = \"ui-datepicker-append\", this._triggerClass = \"ui-datepicker-trigger\", this._dialogClass = \"ui-datepicker-dialog\", this._disableClass = \"ui-datepicker-disabled\", this._unselectableClass = \"ui-datepicker-unselectable\", this._currentClass = \"ui-datepicker-current-day\", this._dayOverClass = \"ui-datepicker-days-cell-over\", this.regional = [], this.regional[\"\"] = { closeText: \"Done\", prevText: \"Prev\", nextText: \"Next\", currentText: \"Today\", monthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"], monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], dayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], weekHeader: \"Wk\", dateFormat: \"mm/dd/yy\", firstDay: 0, isRTL: !1, showMonthAfterYear: !1, yearSuffix: \"\" }, this._defaults = { showOn: \"focus\", showAnim: \"fadeIn\", showOptions: {}, defaultDate: null, appendText: \"\", buttonText: \"...\", buttonImage: \"\", buttonImageOnly: !1, hideIfNoPrevNext: !1, navigationAsDateFormat: !1, gotoCurrent: !1, changeMonth: !1, changeYear: !1, yearRange: \"c-10:c+10\", showOtherMonths: !1, selectOtherMonths: !1, showWeek: !1, calculateWeek: this.iso8601Week, shortYearCutoff: \"+10\", minDate: null, maxDate: null, duration: \"fast\", beforeShowDay: null, beforeShow: null, onSelect: null, onChangeMonthYear: null, onClose: null, numberOfMonths: 1, showCurrentAtPos: 0, stepMonths: 1, stepBigMonths: 12, altField: \"\", altFormat: \"\", constrainInput: !0, showButtonPanel: !1, autoSize: !1, disabled: !1 }, t.extend(this._defaults, this.regional[\"\"]), this.regional.en = t.extend(!0, {}, this.regional[\"\"]), this.regional[\"en-US\"] = t.extend(!0, {}, this.regional.en), this.dpDiv = n(t(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\")) } function n(e) { var i = \"button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a\"; return e.on(\"mouseout\", i, function () { t(this).removeClass(\"ui-state-hover\"), -1 !== this.className.indexOf(\"ui-datepicker-prev\") && t(this).removeClass(\"ui-datepicker-prev-hover\"), -1 !== this.className.indexOf(\"ui-datepicker-next\") && t(this).removeClass(\"ui-datepicker-next-hover\") }).on(\"mouseover\", i, o) } function o() { t.datepicker._isDisabledDatepicker(u.inline ? u.dpDiv.parent()[0] : u.input[0]) || (t(this).parents(\".ui-datepicker-calendar\").find(\"a\").removeClass(\"ui-state-hover\"), t(this).addClass(\"ui-state-hover\"), -1 !== this.className.indexOf(\"ui-datepicker-prev\") && t(this).addClass(\"ui-datepicker-prev-hover\"), -1 !== this.className.indexOf(\"ui-datepicker-next\") && t(this).addClass(\"ui-datepicker-next-hover\")) } function a(e, i) { t.extend(e, i); for (var s in i) null == i[s] && (e[s] = i[s]); return e } t.ui = t.ui || {}, t.ui.version = \"1.12.1\"; var r = 0, l = Array.prototype.slice; t.cleanData = function (e) { return function (i) { var s, n, o; for (o = 0; null != (n = i[o]) ; o++) try { s = t._data(n, \"events\"), s && s.remove && t(n).triggerHandler(\"remove\") } catch (a) { } e(i) } }(t.cleanData), t.widget = function (e, i, s) { var n, o, a, r = {}, l = e.split(\".\")[0]; e = e.split(\".\")[1]; var h = l + \"-\" + e; return s || (s = i, i = t.Widget), t.isArray(s) && (s = t.extend.apply(null, [{}].concat(s))), t.expr[\":\"][h.toLowerCase()] = function (e) { return !!t.data(e, h) }, t[l] = t[l] || {}, n = t[l][e], o = t[l][e] = function (t, e) { return this._createWidget ? (arguments.length && this._createWidget(t, e), void 0) : new o(t, e) }, t.extend(o, n, { version: s.version, _proto: t.extend({}, s), _childConstructors: [] }), a = new i, a.options = t.widget.extend({}, a.options), t.each(s, function (e, s) { return t.isFunction(s) ? (r[e] = function () { function t() { return i.prototype[e].apply(this, arguments) } function n(t) { return i.prototype[e].apply(this, t) } return function () { var e, i = this._super, o = this._superApply; return this._super = t, this._superApply = n, e = s.apply(this, arguments), this._super = i, this._superApply = o, e } }(), void 0) : (r[e] = s, void 0) }), o.prototype = t.widget.extend(a, { widgetEventPrefix: n ? a.widgetEventPrefix || e : e }, r, { constructor: o, namespace: l, widgetName: e, widgetFullName: h }), n ? (t.each(n._childConstructors, function (e, i) { var s = i.prototype; t.widget(s.namespace + \".\" + s.widgetName, o, i._proto) }), delete n._childConstructors) : i._childConstructors.push(o), t.widget.bridge(e, o), o }, t.widget.extend = function (e) { for (var i, s, n = l.call(arguments, 1), o = 0, a = n.length; a > o; o++) for (i in n[o]) s = n[o][i], n[o].hasOwnProperty(i) && void 0 !== s && (e[i] = t.isPlainObject(s) ? t.isPlainObject(e[i]) ? t.widget.extend({}, e[i], s) : t.widget.extend({}, s) : s); return e }, t.widget.bridge = function (e, i) { var s = i.prototype.widgetFullName || e; t.fn[e] = function (n) { var o = \"string\" == typeof n, a = l.call(arguments, 1), r = this; return o ? this.length || \"instance\" !== n ? this.each(function () { var i, o = t.data(this, s); return \"instance\" === n ? (r = o, !1) : o ? t.isFunction(o[n]) && \"_\" !== n.charAt(0) ? (i = o[n].apply(o, a), i !== o && void 0 !== i ? (r = i && i.jquery ? r.pushStack(i.get()) : i, !1) : void 0) : t.error(\"no such method '\" + n + \"' for \" + e + \" widget instance\") : t.error(\"cannot call methods on \" + e + \" prior to initialization; \" + \"attempted to call method '\" + n + \"'\") }) : r = void 0 : (a.length && (n = t.widget.extend.apply(null, [n].concat(a))), this.each(function () { var e = t.data(this, s); e ? (e.option(n || {}), e._init && e._init()) : t.data(this, s, new i(n, this)) })), r } }, t.Widget = function () { }, t.Widget._childConstructors = [], t.Widget.prototype = { widgetName: \"widget\", widgetEventPrefix: \"\", defaultElement: \"<div>\", options: { classes: {}, disabled: !1, create: null }, _createWidget: function (e, i) { i = t(i || this.defaultElement || this)[0], this.element = t(i), this.uuid = r++, this.eventNamespace = \".\" + this.widgetName + this.uuid, this.bindings = t(), this.hoverable = t(), this.focusable = t(), this.classesElementLookup = {}, i !== this && (t.data(i, this.widgetFullName, this), this._on(!0, this.element, { remove: function (t) { t.target === i && this.destroy() } }), this.document = t(i.style ? i.ownerDocument : i.document || i), this.window = t(this.document[0].defaultView || this.document[0].parentWindow)), this.options = t.widget.extend({}, this.options, this._getCreateOptions(), e), this._create(), this.options.disabled && this._setOptionDisabled(this.options.disabled), this._trigger(\"create\", null, this._getCreateEventData()), this._init() }, _getCreateOptions: function () { return {} }, _getCreateEventData: t.noop, _create: t.noop, _init: t.noop, destroy: function () { var e = this; this._destroy(), t.each(this.classesElementLookup, function (t, i) { e._removeClass(i, t) }), this.element.off(this.eventNamespace).removeData(this.widgetFullName), this.widget().off(this.eventNamespace).removeAttr(\"aria-disabled\"), this.bindings.off(this.eventNamespace) }, _destroy: t.noop, widget: function () { return this.element }, option: function (e, i) { var s, n, o, a = e; if (0 === arguments.length) return t.widget.extend({}, this.options); if (\"string\" == typeof e) if (a = {}, s = e.split(\".\"), e = s.shift(), s.length) { for (n = a[e] = t.widget.extend({}, this.options[e]), o = 0; s.length - 1 > o; o++) n[s[o]] = n[s[o]] || {}, n = n[s[o]]; if (e = s.pop(), 1 === arguments.length) return void 0 === n[e] ? null : n[e]; n[e] = i } else { if (1 === arguments.length) return void 0 === this.options[e] ? null : this.options[e]; a[e] = i } return this._setOptions(a), this }, _setOptions: function (t) { var e; for (e in t) this._setOption(e, t[e]); return this }, _setOption: function (t, e) { return \"classes\" === t && this._setOptionClasses(e), this.options[t] = e, \"disabled\" === t && this._setOptionDisabled(e), this }, _setOptionClasses: function (e) { var i, s, n; for (i in e) n = this.classesElementLookup[i], e[i] !== this.options.classes[i] && n && n.length && (s = t(n.get()), this._removeClass(n, i), s.addClass(this._classes({ element: s, keys: i, classes: e, add: !0 }))) }, _setOptionDisabled: function (t) { this._toggleClass(this.widget(), this.widgetFullName + \"-disabled\", null, !!t), t && (this._removeClass(this.hoverable, null, \"ui-state-hover\"), this._removeClass(this.focusable, null, \"ui-state-focus\")) }, enable: function () { return this._setOptions({ disabled: !1 }) }, disable: function () { return this._setOptions({ disabled: !0 }) }, _classes: function (e) { function i(i, o) { var a, r; for (r = 0; i.length > r; r++) a = n.classesElementLookup[i[r]] || t(), a = e.add ? t(t.unique(a.get().concat(e.element.get()))) : t(a.not(e.element).get()), n.classesElementLookup[i[r]] = a, s.push(i[r]), o && e.classes[i[r]] && s.push(e.classes[i[r]]) } var s = [], n = this; return e = t.extend({ element: this.element, classes: this.options.classes || {} }, e), this._on(e.element, { remove: \"_untrackClassesElement\" }), e.keys && i(e.keys.match(/\\S+/g) || [], !0), e.extra && i(e.extra.match(/\\S+/g) || []), s.join(\" \") }, _untrackClassesElement: function (e) { var i = this; t.each(i.classesElementLookup, function (s, n) { -1 !== t.inArray(e.target, n) && (i.classesElementLookup[s] = t(n.not(e.target).get())) }) }, _removeClass: function (t, e, i) { return this._toggleClass(t, e, i, !1) }, _addClass: function (t, e, i) { return this._toggleClass(t, e, i, !0) }, _toggleClass: function (t, e, i, s) { s = \"boolean\" == typeof s ? s : i; var n = \"string\" == typeof t || null === t, o = { extra: n ? e : i, keys: n ? t : e, element: n ? this.element : t, add: s }; return o.element.toggleClass(this._classes(o), s), this }, _on: function (e, i, s) { var n, o = this; \"boolean\" != typeof e && (s = i, i = e, e = !1), s ? (i = n = t(i), this.bindings = this.bindings.add(i)) : (s = i, i = this.element, n = this.widget()), t.each(s, function (s, a) { function r() { return e || o.options.disabled !== !0 && !t(this).hasClass(\"ui-state-disabled\") ? (\"string\" == typeof a ? o[a] : a).apply(o, arguments) : void 0 } \"string\" != typeof a && (r.guid = a.guid = a.guid || r.guid || t.guid++); var l = s.match(/^([\\w:-]*)\\s*(.*)$/), h = l[1] + o.eventNamespace, c = l[2]; c ? n.on(h, c, r) : i.on(h, r) }) }, _off: function (e, i) { i = (i || \"\").split(\" \").join(this.eventNamespace + \" \") + this.eventNamespace, e.off(i).off(i), this.bindings = t(this.bindings.not(e).get()), this.focusable = t(this.focusable.not(e).get()), this.hoverable = t(this.hoverable.not(e).get()) }, _delay: function (t, e) { function i() { return (\"string\" == typeof t ? s[t] : t).apply(s, arguments) } var s = this; return setTimeout(i, e || 0) }, _hoverable: function (e) { this.hoverable = this.hoverable.add(e), this._on(e, { mouseenter: function (e) { this._addClass(t(e.currentTarget), null, \"ui-state-hover\") }, mouseleave: function (e) { this._removeClass(t(e.currentTarget), null, \"ui-state-hover\") } }) }, _focusable: function (e) { this.focusable = this.focusable.add(e), this._on(e, { focusin: function (e) { this._addClass(t(e.currentTarget), null, \"ui-state-focus\") }, focusout: function (e) { this._removeClass(t(e.currentTarget), null, \"ui-state-focus\") } }) }, _trigger: function (e, i, s) { var n, o, a = this.options[e]; if (s = s || {}, i = t.Event(i), i.type = (e === this.widgetEventPrefix ? e : this.widgetEventPrefix + e).toLowerCase(), i.target = this.element[0], o = i.originalEvent) for (n in o) n in i || (i[n] = o[n]); return this.element.trigger(i, s), !(t.isFunction(a) && a.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented()) } }, t.each({ show: \"fadeIn\", hide: \"fadeOut\" }, function (e, i) { t.Widget.prototype[\"_\" + e] = function (s, n, o) { \"string\" == typeof n && (n = { effect: n }); var a, r = n ? n === !0 || \"number\" == typeof n ? i : n.effect || i : e; n = n || {}, \"number\" == typeof n && (n = { duration: n }), a = !t.isEmptyObject(n), n.complete = o, n.delay && s.delay(n.delay), a && t.effects && t.effects.effect[r] ? s[e](n) : r !== e && s[r] ? s[r](n.duration, n.easing, o) : s.queue(function (i) { t(this)[e](), o && o.call(s[0]), i() }) } }), t.widget, function () { function e(t, e, i) { return [parseFloat(t[0]) * (u.test(t[0]) ? e / 100 : 1), parseFloat(t[1]) * (u.test(t[1]) ? i / 100 : 1)] } function i(e, i) { return parseInt(t.css(e, i), 10) || 0 } function s(e) { var i = e[0]; return 9 === i.nodeType ? { width: e.width(), height: e.height(), offset: { top: 0, left: 0 } } : t.isWindow(i) ? { width: e.width(), height: e.height(), offset: { top: e.scrollTop(), left: e.scrollLeft() } } : i.preventDefault ? { width: 0, height: 0, offset: { top: i.pageY, left: i.pageX } } : { width: e.outerWidth(), height: e.outerHeight(), offset: e.offset() } } var n, o = Math.max, a = Math.abs, r = /left|center|right/, l = /top|center|bottom/, h = /[\\+\\-]\\d+(\\.[\\d]+)?%?/, c = /^\\w+/, u = /%$/, d = t.fn.position; t.position = { scrollbarWidth: function () { if (void 0 !== n) return n; var e, i, s = t(\"<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>\"), o = s.children()[0]; return t(\"body\").append(s), e = o.offsetWidth, s.css(\"overflow\", \"scroll\"), i = o.offsetWidth, e === i && (i = s[0].clientWidth), s.remove(), n = e - i }, getScrollInfo: function (e) { var i = e.isWindow || e.isDocument ? \"\" : e.element.css(\"overflow-x\"), s = e.isWindow || e.isDocument ? \"\" : e.element.css(\"overflow-y\"), n = \"scroll\" === i || \"auto\" === i && e.width < e.element[0].scrollWidth, o = \"scroll\" === s || \"auto\" === s && e.height < e.element[0].scrollHeight; return { width: o ? t.position.scrollbarWidth() : 0, height: n ? t.position.scrollbarWidth() : 0 } }, getWithinInfo: function (e) { var i = t(e || window), s = t.isWindow(i[0]), n = !!i[0] && 9 === i[0].nodeType, o = !s && !n; return { element: i, isWindow: s, isDocument: n, offset: o ? t(e).offset() : { left: 0, top: 0 }, scrollLeft: i.scrollLeft(), scrollTop: i.scrollTop(), width: i.outerWidth(), height: i.outerHeight() } } }, t.fn.position = function (n) { if (!n || !n.of) return d.apply(this, arguments); n = t.extend({}, n); var u, p, f, g, m, _, v = t(n.of), b = t.position.getWithinInfo(n.within), y = t.position.getScrollInfo(b), w = (n.collision || \"flip\").split(\" \"), k = {}; return _ = s(v), v[0].preventDefault && (n.at = \"left top\"), p = _.width, f = _.height, g = _.offset, m = t.extend({}, g), t.each([\"my\", \"at\"], function () { var t, e, i = (n[this] || \"\").split(\" \"); 1 === i.length && (i = r.test(i[0]) ? i.concat([\"center\"]) : l.test(i[0]) ? [\"center\"].concat(i) : [\"center\", \"center\"]), i[0] = r.test(i[0]) ? i[0] : \"center\", i[1] = l.test(i[1]) ? i[1] : \"center\", t = h.exec(i[0]), e = h.exec(i[1]), k[this] = [t ? t[0] : 0, e ? e[0] : 0], n[this] = [c.exec(i[0])[0], c.exec(i[1])[0]] }), 1 === w.length && (w[1] = w[0]), \"right\" === n.at[0] ? m.left += p : \"center\" === n.at[0] && (m.left += p / 2), \"bottom\" === n.at[1] ? m.top += f : \"center\" === n.at[1] && (m.top += f / 2), u = e(k.at, p, f), m.left += u[0], m.top += u[1], this.each(function () { var s, r, l = t(this), h = l.outerWidth(), c = l.outerHeight(), d = i(this, \"marginLeft\"), _ = i(this, \"marginTop\"), x = h + d + i(this, \"marginRight\") + y.width, C = c + _ + i(this, \"marginBottom\") + y.height, D = t.extend({}, m), T = e(k.my, l.outerWidth(), l.outerHeight()); \"right\" === n.my[0] ? D.left -= h : \"center\" === n.my[0] && (D.left -= h / 2), \"bottom\" === n.my[1] ? D.top -= c : \"center\" === n.my[1] && (D.top -= c / 2), D.left += T[0], D.top += T[1], s = { marginLeft: d, marginTop: _ }, t.each([\"left\", \"top\"], function (e, i) { t.ui.position[w[e]] && t.ui.position[w[e]][i](D, { targetWidth: p, targetHeight: f, elemWidth: h, elemHeight: c, collisionPosition: s, collisionWidth: x, collisionHeight: C, offset: [u[0] + T[0], u[1] + T[1]], my: n.my, at: n.at, within: b, elem: l }) }), n.using && (r = function (t) { var e = g.left - D.left, i = e + p - h, s = g.top - D.top, r = s + f - c, u = { target: { element: v, left: g.left, top: g.top, width: p, height: f }, element: { element: l, left: D.left, top: D.top, width: h, height: c }, horizontal: 0 > i ? \"left\" : e > 0 ? \"right\" : \"center\", vertical: 0 > r ? \"top\" : s > 0 ? \"bottom\" : \"middle\" }; h > p && p > a(e + i) && (u.horizontal = \"center\"), c > f && f > a(s + r) && (u.vertical = \"middle\"), u.important = o(a(e), a(i)) > o(a(s), a(r)) ? \"horizontal\" : \"vertical\", n.using.call(this, t, u) }), l.offset(t.extend(D, { using: r })) }) }, t.ui.position = { fit: { left: function (t, e) { var i, s = e.within, n = s.isWindow ? s.scrollLeft : s.offset.left, a = s.width, r = t.left - e.collisionPosition.marginLeft, l = n - r, h = r + e.collisionWidth - a - n; e.collisionWidth > a ? l > 0 && 0 >= h ? (i = t.left + l + e.collisionWidth - a - n, t.left += l - i) : t.left = h > 0 && 0 >= l ? n : l > h ? n + a - e.collisionWidth : n : l > 0 ? t.left += l : h > 0 ? t.left -= h : t.left = o(t.left - r, t.left) }, top: function (t, e) { var i, s = e.within, n = s.isWindow ? s.scrollTop : s.offset.top, a = e.within.height, r = t.top - e.collisionPosition.marginTop, l = n - r, h = r + e.collisionHeight - a - n; e.collisionHeight > a ? l > 0 && 0 >= h ? (i = t.top + l + e.collisionHeight - a - n, t.top += l - i) : t.top = h > 0 && 0 >= l ? n : l > h ? n + a - e.collisionHeight : n : l > 0 ? t.top += l : h > 0 ? t.top -= h : t.top = o(t.top - r, t.top) } }, flip: { left: function (t, e) { var i, s, n = e.within, o = n.offset.left + n.scrollLeft, r = n.width, l = n.isWindow ? n.scrollLeft : n.offset.left, h = t.left - e.collisionPosition.marginLeft, c = h - l, u = h + e.collisionWidth - r - l, d = \"left\" === e.my[0] ? -e.elemWidth : \"right\" === e.my[0] ? e.elemWidth : 0, p = \"left\" === e.at[0] ? e.targetWidth : \"right\" === e.at[0] ? -e.targetWidth : 0, f = -2 * e.offset[0]; 0 > c ? (i = t.left + d + p + f + e.collisionWidth - r - o, (0 > i || a(c) > i) && (t.left += d + p + f)) : u > 0 && (s = t.left - e.collisionPosition.marginLeft + d + p + f - l, (s > 0 || u > a(s)) && (t.left += d + p + f)) }, top: function (t, e) { var i, s, n = e.within, o = n.offset.top + n.scrollTop, r = n.height, l = n.isWindow ? n.scrollTop : n.offset.top, h = t.top - e.collisionPosition.marginTop, c = h - l, u = h + e.collisionHeight - r - l, d = \"top\" === e.my[1], p = d ? -e.elemHeight : \"bottom\" === e.my[1] ? e.elemHeight : 0, f = \"top\" === e.at[1] ? e.targetHeight : \"bottom\" === e.at[1] ? -e.targetHeight : 0, g = -2 * e.offset[1]; 0 > c ? (s = t.top + p + f + g + e.collisionHeight - r - o, (0 > s || a(c) > s) && (t.top += p + f + g)) : u > 0 && (i = t.top - e.collisionPosition.marginTop + p + f + g - l, (i > 0 || u > a(i)) && (t.top += p + f + g)) } }, flipfit: { left: function () { t.ui.position.flip.left.apply(this, arguments), t.ui.position.fit.left.apply(this, arguments) }, top: function () { t.ui.position.flip.top.apply(this, arguments), t.ui.position.fit.top.apply(this, arguments) } } } }(), t.ui.position, t.extend(t.expr[\":\"], { data: t.expr.createPseudo ? t.expr.createPseudo(function (e) { return function (i) { return !!t.data(i, e) } }) : function (e, i, s) { return !!t.data(e, s[3]) } }), t.fn.extend({ disableSelection: function () { var t = \"onselectstart\" in document.createElement(\"div\") ? \"selectstart\" : \"mousedown\"; return function () { return this.on(t + \".ui-disableSelection\", function (t) { t.preventDefault() }) } }(), enableSelection: function () { return this.off(\".ui-disableSelection\") } }), t.ui.focusable = function (i, s) { var n, o, a, r, l, h = i.nodeName.toLowerCase(); return \"area\" === h ? (n = i.parentNode, o = n.name, i.href && o && \"map\" === n.nodeName.toLowerCase() ? (a = t(\"img[usemap='#\" + o + \"']\"), a.length > 0 && a.is(\":visible\")) : !1) : (/^(input|select|textarea|button|object)$/.test(h) ? (r = !i.disabled, r && (l = t(i).closest(\"fieldset\")[0], l && (r = !l.disabled))) : r = \"a\" === h ? i.href || s : s, r && t(i).is(\":visible\") && e(t(i))) }, t.extend(t.expr[\":\"], { focusable: function (e) { return t.ui.focusable(e, null != t.attr(e, \"tabindex\")) } }), t.ui.focusable, t.fn.form = function () { return \"string\" == typeof this[0].form ? this.closest(\"form\") : t(this[0].form) }, t.ui.formResetMixin = { _formResetHandler: function () { var e = t(this); setTimeout(function () { var i = e.data(\"ui-form-reset-instances\"); t.each(i, function () { this.refresh() }) }) }, _bindFormResetHandler: function () { if (this.form = this.element.form(), this.form.length) { var t = this.form.data(\"ui-form-reset-instances\") || []; t.length || this.form.on(\"reset.ui-form-reset\", this._formResetHandler), t.push(this), this.form.data(\"ui-form-reset-instances\", t) } }, _unbindFormResetHandler: function () { if (this.form.length) { var e = this.form.data(\"ui-form-reset-instances\"); e.splice(t.inArray(this, e), 1), e.length ? this.form.data(\"ui-form-reset-instances\", e) : this.form.removeData(\"ui-form-reset-instances\").off(\"reset.ui-form-reset\") } } }, \"1.7\" === t.fn.jquery.substring(0, 3) && (t.each([\"Width\", \"Height\"], function (e, i) { function s(e, i, s, o) { return t.each(n, function () { i -= parseFloat(t.css(e, \"padding\" + this)) || 0, s && (i -= parseFloat(t.css(e, \"border\" + this + \"Width\")) || 0), o && (i -= parseFloat(t.css(e, \"margin\" + this)) || 0) }), i } var n = \"Width\" === i ? [\"Left\", \"Right\"] : [\"Top\", \"Bottom\"], o = i.toLowerCase(), a = { innerWidth: t.fn.innerWidth, innerHeight: t.fn.innerHeight, outerWidth: t.fn.outerWidth, outerHeight: t.fn.outerHeight }; t.fn[\"inner\" + i] = function (e) { return void 0 === e ? a[\"inner\" + i].call(this) : this.each(function () { t(this).css(o, s(this, e) + \"px\") }) }, t.fn[\"outer\" + i] = function (e, n) { return \"number\" != typeof e ? a[\"outer\" + i].call(this, e) : this.each(function () { t(this).css(o, s(this, e, !0, n) + \"px\") }) } }), t.fn.addBack = function (t) { return this.add(null == t ? this.prevObject : this.prevObject.filter(t)) }), t.ui.keyCode = { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 }, t.ui.escapeSelector = function () { var t = /([!\"#$%&'()*+,./:;<=>?@[\\]^`{|}~])/g; return function (e) { return e.replace(t, \"\\\\$1\") } }(), t.fn.labels = function () { var e, i, s, n, o; return this[0].labels && this[0].labels.length ? this.pushStack(this[0].labels) : (n = this.eq(0).parents(\"label\"), s = this.attr(\"id\"), s && (e = this.eq(0).parents().last(), o = e.add(e.length ? e.siblings() : this.siblings()), i = \"label[for='\" + t.ui.escapeSelector(s) + \"']\", n = n.add(o.find(i).addBack(i))), this.pushStack(n)) }, t.fn.scrollParent = function (e) { var i = this.css(\"position\"), s = \"absolute\" === i, n = e ? /(auto|scroll|hidden)/ : /(auto|scroll)/, o = this.parents().filter(function () { var e = t(this); return s && \"static\" === e.css(\"position\") ? !1 : n.test(e.css(\"overflow\") + e.css(\"overflow-y\") + e.css(\"overflow-x\")) }).eq(0); return \"fixed\" !== i && o.length ? o : t(this[0].ownerDocument || document) }, t.extend(t.expr[\":\"], { tabbable: function (e) { var i = t.attr(e, \"tabindex\"), s = null != i; return (!s || i >= 0) && t.ui.focusable(e, s) } }), t.fn.extend({ uniqueId: function () { var t = 0; return function () { return this.each(function () { this.id || (this.id = \"ui-id-\" + ++t) }) } }(), removeUniqueId: function () { return this.each(function () { /^ui-id-\\d+$/.test(this.id) && t(this).removeAttr(\"id\") }) } }), t.ui.ie = !!/msie [\\w.]+/.exec(navigator.userAgent.toLowerCase()); var h = !1; t(document).on(\"mouseup\", function () { h = !1 }), t.widget(\"ui.mouse\", { version: \"1.12.1\", options: { cancel: \"input, textarea, button, select, option\", distance: 1, delay: 0 }, _mouseInit: function () { var e = this; this.element.on(\"mousedown.\" + this.widgetName, function (t) { return e._mouseDown(t) }).on(\"click.\" + this.widgetName, function (i) { return !0 === t.data(i.target, e.widgetName + \".preventClickEvent\") ? (t.removeData(i.target, e.widgetName + \".preventClickEvent\"), i.stopImmediatePropagation(), !1) : void 0 }), this.started = !1 }, _mouseDestroy: function () { this.element.off(\".\" + this.widgetName), this._mouseMoveDelegate && this.document.off(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).off(\"mouseup.\" + this.widgetName, this._mouseUpDelegate) }, _mouseDown: function (e) { if (!h) { this._mouseMoved = !1, this._mouseStarted && this._mouseUp(e), this._mouseDownEvent = e; var i = this, s = 1 === e.which, n = \"string\" == typeof this.options.cancel && e.target.nodeName ? t(e.target).closest(this.options.cancel).length : !1; return s && !n && this._mouseCapture(e) ? (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () { i.mouseDelayMet = !0 }, this.options.delay)), this._mouseDistanceMet(e) && this._mouseDelayMet(e) && (this._mouseStarted = this._mouseStart(e) !== !1, !this._mouseStarted) ? (e.preventDefault(), !0) : (!0 === t.data(e.target, this.widgetName + \".preventClickEvent\") && t.removeData(e.target, this.widgetName + \".preventClickEvent\"), this._mouseMoveDelegate = function (t) { return i._mouseMove(t) }, this._mouseUpDelegate = function (t) { return i._mouseUp(t) }, this.document.on(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).on(\"mouseup.\" + this.widgetName, this._mouseUpDelegate), e.preventDefault(), h = !0, !0)) : !0 } }, _mouseMove: function (e) { if (this._mouseMoved) { if (t.ui.ie && (!document.documentMode || 9 > document.documentMode) && !e.button) return this._mouseUp(e); if (!e.which) if (e.originalEvent.altKey || e.originalEvent.ctrlKey || e.originalEvent.metaKey || e.originalEvent.shiftKey) this.ignoreMissingWhich = !0; else if (!this.ignoreMissingWhich) return this._mouseUp(e) } return (e.which || e.button) && (this._mouseMoved = !0), this._mouseStarted ? (this._mouseDrag(e), e.preventDefault()) : (this._mouseDistanceMet(e) && this._mouseDelayMet(e) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, e) !== !1, this._mouseStarted ? this._mouseDrag(e) : this._mouseUp(e)), !this._mouseStarted) }, _mouseUp: function (e) { this.document.off(\"mousemove.\" + this.widgetName, this._mouseMoveDelegate).off(\"mouseup.\" + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, e.target === this._mouseDownEvent.target && t.data(e.target, this.widgetName + \".preventClickEvent\", !0), this._mouseStop(e)), this._mouseDelayTimer && (clearTimeout(this._mouseDelayTimer), delete this._mouseDelayTimer), this.ignoreMissingWhich = !1, h = !1, e.preventDefault() }, _mouseDistanceMet: function (t) { return Math.max(Math.abs(this._mouseDownEvent.pageX - t.pageX), Math.abs(this._mouseDownEvent.pageY - t.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return !0 } }), t.ui.plugin = { add: function (e, i, s) { var n, o = t.ui[e].prototype; for (n in s) o.plugins[n] = o.plugins[n] || [], o.plugins[n].push([i, s[n]]) }, call: function (t, e, i, s) { var n, o = t.plugins[e]; if (o && (s || t.element[0].parentNode && 11 !== t.element[0].parentNode.nodeType)) for (n = 0; o.length > n; n++) t.options[o[n][0]] && o[n][1].apply(t.element, i) } }, t.ui.safeActiveElement = function (t) { var e; try { e = t.activeElement } catch (i) { e = t.body } return e || (e = t.body), e.nodeName || (e = t.body), e }, t.ui.safeBlur = function (e) { e && \"body\" !== e.nodeName.toLowerCase() && t(e).trigger(\"blur\") }, t.widget(\"ui.draggable\", t.ui.mouse, {\n version: \"1.12.1\", widgetEventPrefix: \"drag\", options: { addClasses: !0, appendTo: \"parent\", axis: !1, connectToSortable: !1, containment: !1, cursor: \"auto\", cursorAt: !1, grid: !1, handle: !1, helper: \"original\", iframeFix: !1, opacity: !1, refreshPositions: !1, revert: !1, revertDuration: 500, scope: \"default\", scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, snap: !1, snapMode: \"both\", snapTolerance: 20, stack: !1, zIndex: !1, drag: null, start: null, stop: null }, _create: function () { \"original\" === this.options.helper && this._setPositionRelative(), this.options.addClasses && this._addClass(\"ui-draggable\"), this._setHandleClassName(), this._mouseInit() }, _setOption: function (t, e) { this._super(t, e), \"handle\" === t && (this._removeHandleClassName(), this._setHandleClassName()) }, _destroy: function () { return (this.helper || this.element).is(\".ui-draggable-dragging\") ? (this.destroyOnClear = !0, void 0) : (this._removeHandleClassName(), this._mouseDestroy(), void 0) }, _mouseCapture: function (e) { var i = this.options; return this.helper || i.disabled || t(e.target).closest(\".ui-resizable-handle\").length > 0 ? !1 : (this.handle = this._getHandle(e), this.handle ? (this._blurActiveElement(e), this._blockFrames(i.iframeFix === !0 ? \"iframe\" : i.iframeFix), !0) : !1) }, _blockFrames: function (e) { this.iframeBlocks = this.document.find(e).map(function () { var e = t(this); return t(\"<div>\").css(\"position\", \"absolute\").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0] }) }, _unblockFrames: function () { this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks) }, _blurActiveElement: function (e) { var i = t.ui.safeActiveElement(this.document[0]), s = t(e.target); s.closest(i).length || t.ui.safeBlur(i) }, _mouseStart: function (e) { var i = this.options; return this.helper = this._createHelper(e), this._addClass(this.helper, \"ui-draggable-dragging\"), this._cacheHelperProportions(), t.ui.ddmanager && (t.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css(\"position\"), this.scrollParent = this.helper.scrollParent(!0), this.offsetParent = this.helper.offsetParent(), this.hasFixedAncestor = this.helper.parents().filter(function () { return \"fixed\" === t(this).css(\"position\") }).length > 0, this.positionAbs = this.element.offset(), this._refreshOffsets(e), this.originalPosition = this.position = this._generatePosition(e, !1), this.originalPageX = e.pageX, this.originalPageY = e.pageY, i.cursorAt && this._adjustOffsetFromHelper(i.cursorAt), this._setContainment(), this._trigger(\"start\", e) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), t.ui.ddmanager && !i.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e), this._mouseDrag(e, !0), t.ui.ddmanager && t.ui.ddmanager.dragStart(this, e), !0) }, _refreshOffsets: function (t) { this.offset = { top: this.positionAbs.top - this.margins.top, left: this.positionAbs.left - this.margins.left, scroll: !1, parent: this._getParentOffset(), relative: this._getRelativeOffset() }, this.offset.click = { left: t.pageX - this.offset.left, top: t.pageY - this.offset.top } }, _mouseDrag: function (e, i) { if (this.hasFixedAncestor && (this.offset.parent = this._getParentOffset()), this.position = this._generatePosition(e, !0), this.positionAbs = this._convertPositionTo(\"absolute\"), !i) { var s = this._uiHash(); if (this._trigger(\"drag\", e, s) === !1) return this._mouseUp(new t.Event(\"mouseup\", e)), !1; this.position = s.position } return this.helper[0].style.left = this.position.left + \"px\", this.helper[0].style.top = this.position.top + \"px\", t.ui.ddmanager && t.ui.ddmanager.drag(this, e), !1 }, _mouseStop: function (e) { var i = this, s = !1; return t.ui.ddmanager && !this.options.dropBehaviour && (s = t.ui.ddmanager.drop(this, e)), this.dropped && (s = this.dropped, this.dropped = !1), \"invalid\" === this.options.revert && !s || \"valid\" === this.options.revert && s || this.options.revert === !0 || t.isFunction(this.options.revert) && this.options.revert.call(this.element, s) ? t(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { i._trigger(\"stop\", e) !== !1 && i._clear() }) : this._trigger(\"stop\", e) !== !1 && this._clear(), !1 }, _mouseUp: function (e) { return this._unblockFrames(), t.ui.ddmanager && t.ui.ddmanager.dragStop(this, e), this.handleElement.is(e.target) && this.element.trigger(\"focus\"), t.ui.mouse.prototype._mouseUp.call(this, e) }, cancel: function () { return this.helper.is(\".ui-draggable-dragging\") ? this._mouseUp(new t.Event(\"mouseup\", { target: this.element[0] })) : this._clear(), this }, _getHandle: function (e) { return this.options.handle ? !!t(e.target).closest(this.element.find(this.options.handle)).length : !0 }, _setHandleClassName: function () { this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element, this._addClass(this.handleElement, \"ui-draggable-handle\") }, _removeHandleClassName: function () { this._removeClass(this.handleElement, \"ui-draggable-handle\") }, _createHelper: function (e) { var i = this.options, s = t.isFunction(i.helper), n = s ? t(i.helper.apply(this.element[0], [e])) : \"clone\" === i.helper ? this.element.clone().removeAttr(\"id\") : this.element; return n.parents(\"body\").length || n.appendTo(\"parent\" === i.appendTo ? this.element[0].parentNode : i.appendTo), s && n[0] === this.element[0] && this._setPositionRelative(), n[0] === this.element[0] || /(fixed|absolute)/.test(n.css(\"position\")) || n.css(\"position\", \"absolute\"), n }, _setPositionRelative: function () { /^(?:r|a|f)/.test(this.element.css(\"position\")) || (this.element[0].style.position = \"relative\") }, _adjustOffsetFromHelper: function (e) { \"string\" == typeof e && (e = e.split(\" \")), t.isArray(e) && (e = { left: +e[0], top: +e[1] || 0 }), \"left\" in e && (this.offset.click.left = e.left + this.margins.left), \"right\" in e && (this.offset.click.left = this.helperProportions.width - e.right + this.margins.left), \"top\" in e && (this.offset.click.top = e.top + this.margins.top), \"bottom\" in e && (this.offset.click.top = this.helperProportions.height - e.bottom + this.margins.top) }, _isRootNode: function (t) { return /(html|body)/i.test(t.tagName) || t === this.document[0] }, _getParentOffset: function () { var e = this.offsetParent.offset(), i = this.document[0]; return \"absolute\" === this.cssPosition && this.scrollParent[0] !== i && t.contains(this.scrollParent[0], this.offsetParent[0]) && (e.left += this.scrollParent.scrollLeft(), e.top += this.scrollParent.scrollTop()), this._isRootNode(this.offsetParent[0]) && (e = { top: 0, left: 0 }), { top: e.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"), 10) || 0), left: e.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"), 10) || 0) } }, _getRelativeOffset: function () { if (\"relative\" !== this.cssPosition) return { top: 0, left: 0 }; var t = this.element.position(), e = this._isRootNode(this.scrollParent[0]); return { top: t.top - (parseInt(this.helper.css(\"top\"), 10) || 0) + (e ? 0 : this.scrollParent.scrollTop()), left: t.left - (parseInt(this.helper.css(\"left\"), 10) || 0) + (e ? 0 : this.scrollParent.scrollLeft()) } }, _cacheMargins: function () { this.margins = { left: parseInt(this.element.css(\"marginLeft\"), 10) || 0, top: parseInt(this.element.css(\"marginTop\"), 10) || 0, right: parseInt(this.element.css(\"marginRight\"), 10) || 0, bottom: parseInt(this.element.css(\"marginBottom\"), 10) || 0 } }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() } }, _setContainment: function () {\n var e, i, s, n = this.options, o = this.document[0]; return this.relativeContainer = null, n.containment ? \"window\" === n.containment ? (this.containment = [t(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, t(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, t(window).scrollLeft() + t(window).width() - this.helperProportions.width - this.margins.left, t(window).scrollTop() + (t(window).height() || o.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], void 0) : \"document\" === n.containment ? (this.containment = [0, 0, t(o).width() - this.helperProportions.width - this.margins.left, (t(o).height() || o.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], void 0) : n.containment.constructor === Array ? (this.containment = n.containment, void 0) : (\"parent\" === n.containment && (n.containment = this.helper[0].parentNode), i = t(n.containment), s = i[0], s && (e = /(scroll|auto)/.test(i.css(\"overflow\")), this.containment = [(parseInt(i.css(\"borderLeftWidth\"), 10) || 0) + (parseInt(i.css(\"paddingLeft\"), 10) || 0), (parseInt(i.css(\"borderTopWidth\"), 10) || 0) + (parseInt(i.css(\"paddingTop\"), 10) || 0), (e ? Math.max(s.scrollWidth, s.offsetWidth) : s.offsetWidth) - (parseInt(i.css(\"borderRightWidth\"), 10) || 0) - (parseInt(i.css(\"paddingRight\"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (e ? Math.max(s.scrollHeight, s.offsetHeight) : s.offsetHeight) - (parseInt(i.css(\"borderBottomWidth\"), 10) || 0) - (parseInt(i.css(\"paddingBottom\"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relativeContainer = i), void 0) : (this.containment = null, void 0)\n }, _convertPositionTo: function (t, e) { e || (e = this.position); var i = \"absolute\" === t ? 1 : -1, s = this._isRootNode(this.scrollParent[0]); return { top: e.top + this.offset.relative.top * i + this.offset.parent.top * i - (\"fixed\" === this.cssPosition ? -this.offset.scroll.top : s ? 0 : this.offset.scroll.top) * i, left: e.left + this.offset.relative.left * i + this.offset.parent.left * i - (\"fixed\" === this.cssPosition ? -this.offset.scroll.left : s ? 0 : this.offset.scroll.left) * i } }, _generatePosition: function (t, e) { var i, s, n, o, a = this.options, r = this._isRootNode(this.scrollParent[0]), l = t.pageX, h = t.pageY; return r && this.offset.scroll || (this.offset.scroll = { top: this.scrollParent.scrollTop(), left: this.scrollParent.scrollLeft() }), e && (this.containment && (this.relativeContainer ? (s = this.relativeContainer.offset(), i = [this.containment[0] + s.left, this.containment[1] + s.top, this.containment[2] + s.left, this.containment[3] + s.top]) : i = this.containment, t.pageX - this.offset.click.left < i[0] && (l = i[0] + this.offset.click.left), t.pageY - this.offset.click.top < i[1] && (h = i[1] + this.offset.click.top), t.pageX - this.offset.click.left > i[2] && (l = i[2] + this.offset.click.left), t.pageY - this.offset.click.top > i[3] && (h = i[3] + this.offset.click.top)), a.grid && (n = a.grid[1] ? this.originalPageY + Math.round((h - this.originalPageY) / a.grid[1]) * a.grid[1] : this.originalPageY, h = i ? n - this.offset.click.top >= i[1] || n - this.offset.click.top > i[3] ? n : n - this.offset.click.top >= i[1] ? n - a.grid[1] : n + a.grid[1] : n, o = a.grid[0] ? this.originalPageX + Math.round((l - this.originalPageX) / a.grid[0]) * a.grid[0] : this.originalPageX, l = i ? o - this.offset.click.left >= i[0] || o - this.offset.click.left > i[2] ? o : o - this.offset.click.left >= i[0] ? o - a.grid[0] : o + a.grid[0] : o), \"y\" === a.axis && (l = this.originalPageX), \"x\" === a.axis && (h = this.originalPageY)), { top: h - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (\"fixed\" === this.cssPosition ? -this.offset.scroll.top : r ? 0 : this.offset.scroll.top), left: l - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (\"fixed\" === this.cssPosition ? -this.offset.scroll.left : r ? 0 : this.offset.scroll.left) } }, _clear: function () { this._removeClass(this.helper, \"ui-draggable-dragging\"), this.helper[0] === this.element[0] || this.cancelHelperRemoval || this.helper.remove(), this.helper = null, this.cancelHelperRemoval = !1, this.destroyOnClear && this.destroy() }, _trigger: function (e, i, s) { return s = s || this._uiHash(), t.ui.plugin.call(this, e, [i, s, this], !0), /^(drag|start|stop)/.test(e) && (this.positionAbs = this._convertPositionTo(\"absolute\"), s.offset = this.positionAbs), t.Widget.prototype._trigger.call(this, e, i, s) }, plugins: {}, _uiHash: function () { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs } }\n }), t.ui.plugin.add(\"draggable\", \"connectToSortable\", { start: function (e, i, s) { var n = t.extend({}, i, { item: s.element }); s.sortables = [], t(s.options.connectToSortable).each(function () { var i = t(this).sortable(\"instance\"); i && !i.options.disabled && (s.sortables.push(i), i.refreshPositions(), i._trigger(\"activate\", e, n)) }) }, stop: function (e, i, s) { var n = t.extend({}, i, { item: s.element }); s.cancelHelperRemoval = !1, t.each(s.sortables, function () { var t = this; t.isOver ? (t.isOver = 0, s.cancelHelperRemoval = !0, t.cancelHelperRemoval = !1, t._storedCSS = { position: t.placeholder.css(\"position\"), top: t.placeholder.css(\"top\"), left: t.placeholder.css(\"left\") }, t._mouseStop(e), t.options.helper = t.options._helper) : (t.cancelHelperRemoval = !0, t._trigger(\"deactivate\", e, n)) }) }, drag: function (e, i, s) { t.each(s.sortables, function () { var n = !1, o = this; o.positionAbs = s.positionAbs, o.helperProportions = s.helperProportions, o.offset.click = s.offset.click, o._intersectsWith(o.containerCache) && (n = !0, t.each(s.sortables, function () { return this.positionAbs = s.positionAbs, this.helperProportions = s.helperProportions, this.offset.click = s.offset.click, this !== o && this._intersectsWith(this.containerCache) && t.contains(o.element[0], this.element[0]) && (n = !1), n })), n ? (o.isOver || (o.isOver = 1, s._parent = i.helper.parent(), o.currentItem = i.helper.appendTo(o.element).data(\"ui-sortable-item\", !0), o.options._helper = o.options.helper, o.options.helper = function () { return i.helper[0] }, e.target = o.currentItem[0], o._mouseCapture(e, !0), o._mouseStart(e, !0, !0), o.offset.click.top = s.offset.click.top, o.offset.click.left = s.offset.click.left, o.offset.parent.left -= s.offset.parent.left - o.offset.parent.left, o.offset.parent.top -= s.offset.parent.top - o.offset.parent.top, s._trigger(\"toSortable\", e), s.dropped = o.element, t.each(s.sortables, function () { this.refreshPositions() }), s.currentItem = s.element, o.fromOutside = s), o.currentItem && (o._mouseDrag(e), i.position = o.position)) : o.isOver && (o.isOver = 0, o.cancelHelperRemoval = !0, o.options._revert = o.options.revert, o.options.revert = !1, o._trigger(\"out\", e, o._uiHash(o)), o._mouseStop(e, !0), o.options.revert = o.options._revert, o.options.helper = o.options._helper, o.placeholder && o.placeholder.remove(), i.helper.appendTo(s._parent), s._refreshOffsets(e), i.position = s._generatePosition(e, !0), s._trigger(\"fromSortable\", e), s.dropped = !1, t.each(s.sortables, function () { this.refreshPositions() })) }) } }), t.ui.plugin.add(\"draggable\", \"cursor\", { start: function (e, i, s) { var n = t(\"body\"), o = s.options; n.css(\"cursor\") && (o._cursor = n.css(\"cursor\")), n.css(\"cursor\", o.cursor) }, stop: function (e, i, s) { var n = s.options; n._cursor && t(\"body\").css(\"cursor\", n._cursor) } }), t.ui.plugin.add(\"draggable\", \"opacity\", { start: function (e, i, s) { var n = t(i.helper), o = s.options; n.css(\"opacity\") && (o._opacity = n.css(\"opacity\")), n.css(\"opacity\", o.opacity) }, stop: function (e, i, s) { var n = s.options; n._opacity && t(i.helper).css(\"opacity\", n._opacity) } }), t.ui.plugin.add(\"draggable\", \"scroll\", { start: function (t, e, i) { i.scrollParentNotHidden || (i.scrollParentNotHidden = i.helper.scrollParent(!1)), i.scrollParentNotHidden[0] !== i.document[0] && \"HTML\" !== i.scrollParentNotHidden[0].tagName && (i.overflowOffset = i.scrollParentNotHidden.offset()) }, drag: function (e, i, s) { var n = s.options, o = !1, a = s.scrollParentNotHidden[0], r = s.document[0]; a !== r && \"HTML\" !== a.tagName ? (n.axis && \"x\" === n.axis || (s.overflowOffset.top + a.offsetHeight - e.pageY < n.scrollSensitivity ? a.scrollTop = o = a.scrollTop + n.scrollSpeed : e.pageY - s.overflowOffset.top < n.scrollSensitivity && (a.scrollTop = o = a.scrollTop - n.scrollSpeed)), n.axis && \"y\" === n.axis || (s.overflowOffset.left + a.offsetWidth - e.pageX < n.scrollSensitivity ? a.scrollLeft = o = a.scrollLeft + n.scrollSpeed : e.pageX - s.overflowOffset.left < n.scrollSensitivity && (a.scrollLeft = o = a.scrollLeft - n.scrollSpeed))) : (n.axis && \"x\" === n.axis || (e.pageY - t(r).scrollTop() < n.scrollSensitivity ? o = t(r).scrollTop(t(r).scrollTop() - n.scrollSpeed) : t(window).height() - (e.pageY - t(r).scrollTop()) < n.scrollSensitivity && (o = t(r).scrollTop(t(r).scrollTop() + n.scrollSpeed))), n.axis && \"y\" === n.axis || (e.pageX - t(r).scrollLeft() < n.scrollSensitivity ? o = t(r).scrollLeft(t(r).scrollLeft() - n.scrollSpeed) : t(window).width() - (e.pageX - t(r).scrollLeft()) < n.scrollSensitivity && (o = t(r).scrollLeft(t(r).scrollLeft() + n.scrollSpeed)))), o !== !1 && t.ui.ddmanager && !n.dropBehaviour && t.ui.ddmanager.prepareOffsets(s, e) } }), t.ui.plugin.add(\"draggable\", \"snap\", { start: function (e, i, s) { var n = s.options; s.snapElements = [], t(n.snap.constructor !== String ? n.snap.items || \":data(ui-draggable)\" : n.snap).each(function () { var e = t(this), i = e.offset(); this !== s.element[0] && s.snapElements.push({ item: this, width: e.outerWidth(), height: e.outerHeight(), top: i.top, left: i.left }) }) }, drag: function (e, i, s) { var n, o, a, r, l, h, c, u, d, p, f = s.options, g = f.snapTolerance, m = i.offset.left, _ = m + s.helperProportions.width, v = i.offset.top, b = v + s.helperProportions.height; for (d = s.snapElements.length - 1; d >= 0; d--) l = s.snapElements[d].left - s.margins.left, h = l + s.snapElements[d].width, c = s.snapElements[d].top - s.margins.top, u = c + s.snapElements[d].height, l - g > _ || m > h + g || c - g > b || v > u + g || !t.contains(s.snapElements[d].item.ownerDocument, s.snapElements[d].item) ? (s.snapElements[d].snapping && s.options.snap.release && s.options.snap.release.call(s.element, e, t.extend(s._uiHash(), { snapItem: s.snapElements[d].item })), s.snapElements[d].snapping = !1) : (\"inner\" !== f.snapMode && (n = g >= Math.abs(c - b), o = g >= Math.abs(u - v), a = g >= Math.abs(l - _), r = g >= Math.abs(h - m), n && (i.position.top = s._convertPositionTo(\"relative\", { top: c - s.helperProportions.height, left: 0 }).top), o && (i.position.top = s._convertPositionTo(\"relative\", { top: u, left: 0 }).top), a && (i.position.left = s._convertPositionTo(\"relative\", { top: 0, left: l - s.helperProportions.width }).left), r && (i.position.left = s._convertPositionTo(\"relative\", { top: 0, left: h }).left)), p = n || o || a || r, \"outer\" !== f.snapMode && (n = g >= Math.abs(c - v), o = g >= Math.abs(u - b), a = g >= Math.abs(l - m), r = g >= Math.abs(h - _), n && (i.position.top = s._convertPositionTo(\"relative\", { top: c, left: 0 }).top), o && (i.position.top = s._convertPositionTo(\"relative\", { top: u - s.helperProportions.height, left: 0 }).top), a && (i.position.left = s._convertPositionTo(\"relative\", { top: 0, left: l }).left), r && (i.position.left = s._convertPositionTo(\"relative\", { top: 0, left: h - s.helperProportions.width }).left)), !s.snapElements[d].snapping && (n || o || a || r || p) && s.options.snap.snap && s.options.snap.snap.call(s.element, e, t.extend(s._uiHash(), { snapItem: s.snapElements[d].item })), s.snapElements[d].snapping = n || o || a || r || p) } }), t.ui.plugin.add(\"draggable\", \"stack\", { start: function (e, i, s) { var n, o = s.options, a = t.makeArray(t(o.stack)).sort(function (e, i) { return (parseInt(t(e).css(\"zIndex\"), 10) || 0) - (parseInt(t(i).css(\"zIndex\"), 10) || 0) }); a.length && (n = parseInt(t(a[0]).css(\"zIndex\"), 10) || 0, t(a).each(function (e) { t(this).css(\"zIndex\", n + e) }), this.css(\"zIndex\", n + a.length)) } }), t.ui.plugin.add(\"draggable\", \"zIndex\", { start: function (e, i, s) { var n = t(i.helper), o = s.options; n.css(\"zIndex\") && (o._zIndex = n.css(\"zIndex\")), n.css(\"zIndex\", o.zIndex) }, stop: function (e, i, s) { var n = s.options; n._zIndex && t(i.helper).css(\"zIndex\", n._zIndex) } }), t.ui.draggable, t.widget(\"ui.droppable\", { version: \"1.12.1\", widgetEventPrefix: \"drop\", options: { accept: \"*\", addClasses: !0, greedy: !1, scope: \"default\", tolerance: \"intersect\", activate: null, deactivate: null, drop: null, out: null, over: null }, _create: function () { var e, i = this.options, s = i.accept; this.isover = !1, this.isout = !0, this.accept = t.isFunction(s) ? s : function (t) { return t.is(s) }, this.proportions = function () { return arguments.length ? (e = arguments[0], void 0) : e ? e : e = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight } }, this._addToManager(i.scope), i.addClasses && this._addClass(\"ui-droppable\") }, _addToManager: function (e) { t.ui.ddmanager.droppables[e] = t.ui.ddmanager.droppables[e] || [], t.ui.ddmanager.droppables[e].push(this) }, _splice: function (t) { for (var e = 0; t.length > e; e++) t[e] === this && t.splice(e, 1) }, _destroy: function () { var e = t.ui.ddmanager.droppables[this.options.scope]; this._splice(e) }, _setOption: function (e, i) { if (\"accept\" === e) this.accept = t.isFunction(i) ? i : function (t) { return t.is(i) }; else if (\"scope\" === e) { var s = t.ui.ddmanager.droppables[this.options.scope]; this._splice(s), this._addToManager(i) } this._super(e, i) }, _activate: function (e) { var i = t.ui.ddmanager.current; this._addActiveClass(), i && this._trigger(\"activate\", e, this.ui(i)) }, _deactivate: function (e) { var i = t.ui.ddmanager.current; this._removeActiveClass(), i && this._trigger(\"deactivate\", e, this.ui(i)) }, _over: function (e) { var i = t.ui.ddmanager.current; i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this._addHoverClass(), this._trigger(\"over\", e, this.ui(i))) }, _out: function (e) { var i = t.ui.ddmanager.current; i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this._removeHoverClass(), this._trigger(\"out\", e, this.ui(i))) }, _drop: function (e, i) { var s = i || t.ui.ddmanager.current, n = !1; return s && (s.currentItem || s.element)[0] !== this.element[0] ? (this.element.find(\":data(ui-droppable)\").not(\".ui-draggable-dragging\").each(function () { var i = t(this).droppable(\"instance\"); return i.options.greedy && !i.options.disabled && i.options.scope === s.options.scope && i.accept.call(i.element[0], s.currentItem || s.element) && c(s, t.extend(i, { offset: i.element.offset() }), i.options.tolerance, e) ? (n = !0, !1) : void 0 }), n ? !1 : this.accept.call(this.element[0], s.currentItem || s.element) ? (this._removeActiveClass(), this._removeHoverClass(), this._trigger(\"drop\", e, this.ui(s)), this.element) : !1) : !1 }, ui: function (t) { return { draggable: t.currentItem || t.element, helper: t.helper, position: t.position, offset: t.positionAbs } }, _addHoverClass: function () { this._addClass(\"ui-droppable-hover\") }, _removeHoverClass: function () { this._removeClass(\"ui-droppable-hover\") }, _addActiveClass: function () { this._addClass(\"ui-droppable-active\") }, _removeActiveClass: function () { this._removeClass(\"ui-droppable-active\") } }); var c = t.ui.intersect = function () { function t(t, e, i) { return t >= e && e + i > t } return function (e, i, s, n) { if (!i.offset) return !1; var o = (e.positionAbs || e.position.absolute).left + e.margins.left, a = (e.positionAbs || e.position.absolute).top + e.margins.top, r = o + e.helperProportions.width, l = a + e.helperProportions.height, h = i.offset.left, c = i.offset.top, u = h + i.proportions().width, d = c + i.proportions().height; switch (s) { case \"fit\": return o >= h && u >= r && a >= c && d >= l; case \"intersect\": return o + e.helperProportions.width / 2 > h && u > r - e.helperProportions.width / 2 && a + e.helperProportions.height / 2 > c && d > l - e.helperProportions.height / 2; case \"pointer\": return t(n.pageY, c, i.proportions().height) && t(n.pageX, h, i.proportions().width); case \"touch\": return (a >= c && d >= a || l >= c && d >= l || c > a && l > d) && (o >= h && u >= o || r >= h && u >= r || h > o && r > u); default: return !1 } } }(); t.ui.ddmanager = { current: null, droppables: { \"default\": [] }, prepareOffsets: function (e, i) { var s, n, o = t.ui.ddmanager.droppables[e.options.scope] || [], a = i ? i.type : null, r = (e.currentItem || e.element).find(\":data(ui-droppable)\").addBack(); t: for (s = 0; o.length > s; s++) if (!(o[s].options.disabled || e && !o[s].accept.call(o[s].element[0], e.currentItem || e.element))) { for (n = 0; r.length > n; n++) if (r[n] === o[s].element[0]) { o[s].proportions().height = 0; continue t } o[s].visible = \"none\" !== o[s].element.css(\"display\"), o[s].visible && (\"mousedown\" === a && o[s]._activate.call(o[s], i), o[s].offset = o[s].element.offset(), o[s].proportions({ width: o[s].element[0].offsetWidth, height: o[s].element[0].offsetHeight })) } }, drop: function (e, i) { var s = !1; return t.each((t.ui.ddmanager.droppables[e.options.scope] || []).slice(), function () { this.options && (!this.options.disabled && this.visible && c(e, this, this.options.tolerance, i) && (s = this._drop.call(this, i) || s), !this.options.disabled && this.visible && this.accept.call(this.element[0], e.currentItem || e.element) && (this.isout = !0, this.isover = !1, this._deactivate.call(this, i))) }), s }, dragStart: function (e, i) { e.element.parentsUntil(\"body\").on(\"scroll.droppable\", function () { e.options.refreshPositions || t.ui.ddmanager.prepareOffsets(e, i) }) }, drag: function (e, i) { e.options.refreshPositions && t.ui.ddmanager.prepareOffsets(e, i), t.each(t.ui.ddmanager.droppables[e.options.scope] || [], function () { if (!this.options.disabled && !this.greedyChild && this.visible) { var s, n, o, a = c(e, this, this.options.tolerance, i), r = !a && this.isover ? \"isout\" : a && !this.isover ? \"isover\" : null; r && (this.options.greedy && (n = this.options.scope, o = this.element.parents(\":data(ui-droppable)\").filter(function () { return t(this).droppable(\"instance\").options.scope === n }), o.length && (s = t(o[0]).droppable(\"instance\"), s.greedyChild = \"isover\" === r)), s && \"isover\" === r && (s.isover = !1, s.isout = !0, s._out.call(s, i)), this[r] = !0, this[\"isout\" === r ? \"isover\" : \"isout\"] = !1, this[\"isover\" === r ? \"_over\" : \"_out\"].call(this, i), s && \"isout\" === r && (s.isout = !1, s.isover = !0, s._over.call(s, i))) } }) }, dragStop: function (e, i) { e.element.parentsUntil(\"body\").off(\"scroll.droppable\"), e.options.refreshPositions || t.ui.ddmanager.prepareOffsets(e, i) } }, t.uiBackCompat !== !1 && t.widget(\"ui.droppable\", t.ui.droppable, { options: { hoverClass: !1, activeClass: !1 }, _addActiveClass: function () { this._super(), this.options.activeClass && this.element.addClass(this.options.activeClass) }, _removeActiveClass: function () { this._super(), this.options.activeClass && this.element.removeClass(this.options.activeClass) }, _addHoverClass: function () { this._super(), this.options.hoverClass && this.element.addClass(this.options.hoverClass) }, _removeHoverClass: function () { this._super(), this.options.hoverClass && this.element.removeClass(this.options.hoverClass) } }), t.ui.droppable, t.widget(\"ui.resizable\", t.ui.mouse, { version: \"1.12.1\", widgetEventPrefix: \"resize\", options: { alsoResize: !1, animate: !1, animateDuration: \"slow\", animateEasing: \"swing\", aspectRatio: !1, autoHide: !1, classes: { \"ui-resizable-se\": \"ui-icon ui-icon-gripsmall-diagonal-se\" }, containment: !1, ghost: !1, grid: !1, handles: \"e,s,se\", helper: !1, maxHeight: null, maxWidth: null, minHeight: 10, minWidth: 10, zIndex: 90, resize: null, start: null, stop: null }, _num: function (t) { return parseFloat(t) || 0 }, _isNumber: function (t) { return !isNaN(parseFloat(t)) }, _hasScroll: function (e, i) { if (\"hidden\" === t(e).css(\"overflow\")) return !1; var s = i && \"left\" === i ? \"scrollLeft\" : \"scrollTop\", n = !1; return e[s] > 0 ? !0 : (e[s] = 1, n = e[s] > 0, e[s] = 0, n) }, _create: function () { var e, i = this.options, s = this; this._addClass(\"ui-resizable\"), t.extend(this, { _aspectRatio: !!i.aspectRatio, aspectRatio: i.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: i.helper || i.ghost || i.animate ? i.helper || \"ui-resizable-helper\" : null }), this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i) && (this.element.wrap(t(\"<div class='ui-wrapper' style='overflow: hidden;'></div>\").css({ position: this.element.css(\"position\"), width: this.element.outerWidth(), height: this.element.outerHeight(), top: this.element.css(\"top\"), left: this.element.css(\"left\") })), this.element = this.element.parent().data(\"ui-resizable\", this.element.resizable(\"instance\")), this.elementIsWrapper = !0, e = { marginTop: this.originalElement.css(\"marginTop\"), marginRight: this.originalElement.css(\"marginRight\"), marginBottom: this.originalElement.css(\"marginBottom\"), marginLeft: this.originalElement.css(\"marginLeft\") }, this.element.css(e), this.originalElement.css(\"margin\", 0), this.originalResizeStyle = this.originalElement.css(\"resize\"), this.originalElement.css(\"resize\", \"none\"), this._proportionallyResizeElements.push(this.originalElement.css({ position: \"static\", zoom: 1, display: \"block\" })), this.originalElement.css(e), this._proportionallyResize()), this._setupHandles(), i.autoHide && t(this.element).on(\"mouseenter\", function () { i.disabled || (s._removeClass(\"ui-resizable-autohide\"), s._handles.show()) }).on(\"mouseleave\", function () { i.disabled || s.resizing || (s._addClass(\"ui-resizable-autohide\"), s._handles.hide()) }), this._mouseInit() }, _destroy: function () { this._mouseDestroy(); var e, i = function (e) { t(e).removeData(\"resizable\").removeData(\"ui-resizable\").off(\".resizable\").find(\".ui-resizable-handle\").remove() }; return this.elementIsWrapper && (i(this.element), e = this.element, this.originalElement.css({ position: e.css(\"position\"), width: e.outerWidth(), height: e.outerHeight(), top: e.css(\"top\"), left: e.css(\"left\") }).insertAfter(e), e.remove()), this.originalElement.css(\"resize\", this.originalResizeStyle), i(this.originalElement), this }, _setOption: function (t, e) { switch (this._super(t, e), t) { case \"handles\": this._removeHandles(), this._setupHandles(); break; default: } }, _setupHandles: function () { var e, i, s, n, o, a = this.options, r = this; if (this.handles = a.handles || (t(\".ui-resizable-handle\", this.element).length ? { n: \".ui-resizable-n\", e: \".ui-resizable-e\", s: \".ui-resizable-s\", w: \".ui-resizable-w\", se: \".ui-resizable-se\", sw: \".ui-resizable-sw\", ne: \".ui-resizable-ne\", nw: \".ui-resizable-nw\" } : \"e,s,se\"), this._handles = t(), this.handles.constructor === String) for (\"all\" === this.handles && (this.handles = \"n,e,s,w,se,sw,ne,nw\"), s = this.handles.split(\",\"), this.handles = {}, i = 0; s.length > i; i++) e = t.trim(s[i]), n = \"ui-resizable-\" + e, o = t(\"<div>\"), this._addClass(o, \"ui-resizable-handle \" + n), o.css({ zIndex: a.zIndex }), this.handles[e] = \".ui-resizable-\" + e, this.element.append(o); this._renderAxis = function (e) { var i, s, n, o; e = e || this.element; for (i in this.handles) this.handles[i].constructor === String ? this.handles[i] = this.element.children(this.handles[i]).first().show() : (this.handles[i].jquery || this.handles[i].nodeType) && (this.handles[i] = t(this.handles[i]), this._on(this.handles[i], { mousedown: r._mouseDown })), this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i) && (s = t(this.handles[i], this.element), o = /sw|ne|nw|se|n|s/.test(i) ? s.outerHeight() : s.outerWidth(), n = [\"padding\", /ne|nw|n/.test(i) ? \"Top\" : /se|sw|s/.test(i) ? \"Bottom\" : /^e$/.test(i) ? \"Right\" : \"Left\"].join(\"\"), e.css(n, o), this._proportionallyResize()), this._handles = this._handles.add(this.handles[i]) }, this._renderAxis(this.element), this._handles = this._handles.add(this.element.find(\".ui-resizable-handle\")), this._handles.disableSelection(), this._handles.on(\"mouseover\", function () { r.resizing || (this.className && (o = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), r.axis = o && o[1] ? o[1] : \"se\") }), a.autoHide && (this._handles.hide(), this._addClass(\"ui-resizable-autohide\")) }, _removeHandles: function () { this._handles.remove() }, _mouseCapture: function (e) { var i, s, n = !1; for (i in this.handles) s = t(this.handles[i])[0], (s === e.target || t.contains(s, e.target)) && (n = !0); return !this.options.disabled && n }, _mouseStart: function (e) { var i, s, n, o = this.options, a = this.element; return this.resizing = !0, this._renderProxy(), i = this._num(this.helper.css(\"left\")), s = this._num(this.helper.css(\"top\")), o.containment && (i += t(o.containment).scrollLeft() || 0, s += t(o.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = { left: i, top: s }, this.size = this._helper ? { width: this.helper.width(), height: this.helper.height() } : { width: a.width(), height: a.height() }, this.originalSize = this._helper ? { width: a.outerWidth(), height: a.outerHeight() } : { width: a.width(), height: a.height() }, this.sizeDiff = { width: a.outerWidth() - a.width(), height: a.outerHeight() - a.height() }, this.originalPosition = { left: i, top: s }, this.originalMousePosition = { left: e.pageX, top: e.pageY }, this.aspectRatio = \"number\" == typeof o.aspectRatio ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1, n = t(\".ui-resizable-\" + this.axis).css(\"cursor\"), t(\"body\").css(\"cursor\", \"auto\" === n ? this.axis + \"-resize\" : n), this._addClass(\"ui-resizable-resizing\"), this._propagate(\"start\", e), !0 }, _mouseDrag: function (e) { var i, s, n = this.originalMousePosition, o = this.axis, a = e.pageX - n.left || 0, r = e.pageY - n.top || 0, l = this._change[o]; return this._updatePrevProperties(), l ? (i = l.apply(this, [e, a, r]), this._updateVirtualBoundaries(e.shiftKey), (this._aspectRatio || e.shiftKey) && (i = this._updateRatio(i, e)), i = this._respectSize(i, e), this._updateCache(i), this._propagate(\"resize\", e), s = this._applyChanges(), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), t.isEmptyObject(s) || (this._updatePrevProperties(), this._trigger(\"resize\", e, this.ui()), this._applyChanges()), !1) : !1 }, _mouseStop: function (e) { this.resizing = !1; var i, s, n, o, a, r, l, h = this.options, c = this; return this._helper && (i = this._proportionallyResizeElements, s = i.length && /textarea/i.test(i[0].nodeName), n = s && this._hasScroll(i[0], \"left\") ? 0 : c.sizeDiff.height, o = s ? 0 : c.sizeDiff.width, a = { width: c.helper.width() - o, height: c.helper.height() - n }, r = parseFloat(c.element.css(\"left\")) + (c.position.left - c.originalPosition.left) || null, l = parseFloat(c.element.css(\"top\")) + (c.position.top - c.originalPosition.top) || null, h.animate || this.element.css(t.extend(a, { top: l, left: r })), c.helper.height(c.size.height), c.helper.width(c.size.width), this._helper && !h.animate && this._proportionallyResize()), t(\"body\").css(\"cursor\", \"auto\"), this._removeClass(\"ui-resizable-resizing\"), this._propagate(\"stop\", e), this._helper && this.helper.remove(), !1 }, _updatePrevProperties: function () { this.prevPosition = { top: this.position.top, left: this.position.left }, this.prevSize = { width: this.size.width, height: this.size.height } }, _applyChanges: function () { var t = {}; return this.position.top !== this.prevPosition.top && (t.top = this.position.top + \"px\"), this.position.left !== this.prevPosition.left && (t.left = this.position.left + \"px\"), this.size.width !== this.prevSize.width && (t.width = this.size.width + \"px\"), this.size.height !== this.prevSize.height && (t.height = this.size.height + \"px\"), this.helper.css(t), t }, _updateVirtualBoundaries: function (t) { var e, i, s, n, o, a = this.options; o = { minWidth: this._isNumber(a.minWidth) ? a.minWidth : 0, maxWidth: this._isNumber(a.maxWidth) ? a.maxWidth : 1 / 0, minHeight: this._isNumber(a.minHeight) ? a.minHeight : 0, maxHeight: this._isNumber(a.maxHeight) ? a.maxHeight : 1 / 0 }, (this._aspectRatio || t) && (e = o.minHeight * this.aspectRatio, s = o.minWidth / this.aspectRatio, i = o.maxHeight * this.aspectRatio, n = o.maxWidth / this.aspectRatio, e > o.minWidth && (o.minWidth = e), s > o.minHeight && (o.minHeight = s), o.maxWidth > i && (o.maxWidth = i), o.maxHeight > n && (o.maxHeight = n)), this._vBoundaries = o }, _updateCache: function (t) { this.offset = this.helper.offset(), this._isNumber(t.left) && (this.position.left = t.left), this._isNumber(t.top) && (this.position.top = t.top), this._isNumber(t.height) && (this.size.height = t.height), this._isNumber(t.width) && (this.size.width = t.width) }, _updateRatio: function (t) { var e = this.position, i = this.size, s = this.axis; return this._isNumber(t.height) ? t.width = t.height * this.aspectRatio : this._isNumber(t.width) && (t.height = t.width / this.aspectRatio), \"sw\" === s && (t.left = e.left + (i.width - t.width), t.top = null), \"nw\" === s && (t.top = e.top + (i.height - t.height), t.left = e.left + (i.width - t.width)), t }, _respectSize: function (t) { var e = this._vBoundaries, i = this.axis, s = this._isNumber(t.width) && e.maxWidth && e.maxWidth < t.width, n = this._isNumber(t.height) && e.maxHeight && e.maxHeight < t.height, o = this._isNumber(t.width) && e.minWidth && e.minWidth > t.width, a = this._isNumber(t.height) && e.minHeight && e.minHeight > t.height, r = this.originalPosition.left + this.originalSize.width, l = this.originalPosition.top + this.originalSize.height, h = /sw|nw|w/.test(i), c = /nw|ne|n/.test(i); return o && (t.width = e.minWidth), a && (t.height = e.minHeight), s && (t.width = e.maxWidth), n && (t.height = e.maxHeight), o && h && (t.left = r - e.minWidth), s && h && (t.left = r - e.maxWidth), a && c && (t.top = l - e.minHeight), n && c && (t.top = l - e.maxHeight), t.width || t.height || t.left || !t.top ? t.width || t.height || t.top || !t.left || (t.left = null) : t.top = null, t }, _getPaddingPlusBorderDimensions: function (t) { for (var e = 0, i = [], s = [t.css(\"borderTopWidth\"), t.css(\"borderRightWidth\"), t.css(\"borderBottomWidth\"), t.css(\"borderLeftWidth\")], n = [t.css(\"paddingTop\"), t.css(\"paddingRight\"), t.css(\"paddingBottom\"), t.css(\"paddingLeft\")]; 4 > e; e++) i[e] = parseFloat(s[e]) || 0, i[e] += parseFloat(n[e]) || 0; return { height: i[0] + i[2], width: i[1] + i[3] } }, _proportionallyResize: function () { if (this._proportionallyResizeElements.length) for (var t, e = 0, i = this.helper || this.element; this._proportionallyResizeElements.length > e; e++) t = this._proportionallyResizeElements[e], this.outerDimensions || (this.outerDimensions = this._getPaddingPlusBorderDimensions(t)), t.css({ height: i.height() - this.outerDimensions.height || 0, width: i.width() - this.outerDimensions.width || 0 }) }, _renderProxy: function () { var e = this.element, i = this.options; this.elementOffset = e.offset(), this._helper ? (this.helper = this.helper || t(\"<div style='overflow:hidden;'></div>\"), this._addClass(this.helper, this._helper), this.helper.css({ width: this.element.outerWidth(), height: this.element.outerHeight(), position: \"absolute\", left: this.elementOffset.left + \"px\", top: this.elementOffset.top + \"px\", zIndex: ++i.zIndex }), this.helper.appendTo(\"body\").disableSelection()) : this.helper = this.element }, _change: { e: function (t, e) { return { width: this.originalSize.width + e } }, w: function (t, e) { var i = this.originalSize, s = this.originalPosition; return { left: s.left + e, width: i.width - e } }, n: function (t, e, i) { var s = this.originalSize, n = this.originalPosition; return { top: n.top + i, height: s.height - i } }, s: function (t, e, i) { return { height: this.originalSize.height + i } }, se: function (e, i, s) { return t.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [e, i, s])) }, sw: function (e, i, s) { return t.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [e, i, s])) }, ne: function (e, i, s) { return t.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [e, i, s])) }, nw: function (e, i, s) { return t.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [e, i, s])) } }, _propagate: function (e, i) { t.ui.plugin.call(this, e, [i, this.ui()]), \"resize\" !== e && this._trigger(e, i, this.ui()) }, plugins: {}, ui: function () { return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, originalSize: this.originalSize, originalPosition: this.originalPosition } } }), t.ui.plugin.add(\"resizable\", \"animate\", { stop: function (e) { var i = t(this).resizable(\"instance\"), s = i.options, n = i._proportionallyResizeElements, o = n.length && /textarea/i.test(n[0].nodeName), a = o && i._hasScroll(n[0], \"left\") ? 0 : i.sizeDiff.height, r = o ? 0 : i.sizeDiff.width, l = { width: i.size.width - r, height: i.size.height - a }, h = parseFloat(i.element.css(\"left\")) + (i.position.left - i.originalPosition.left) || null, c = parseFloat(i.element.css(\"top\")) + (i.position.top - i.originalPosition.top) || null; i.element.animate(t.extend(l, c && h ? { top: c, left: h } : {}), { duration: s.animateDuration, easing: s.animateEasing, step: function () { var s = { width: parseFloat(i.element.css(\"width\")), height: parseFloat(i.element.css(\"height\")), top: parseFloat(i.element.css(\"top\")), left: parseFloat(i.element.css(\"left\")) }; n && n.length && t(n[0]).css({ width: s.width, height: s.height }), i._updateCache(s), i._propagate(\"resize\", e) } }) } }), t.ui.plugin.add(\"resizable\", \"containment\", { start: function () { var e, i, s, n, o, a, r, l = t(this).resizable(\"instance\"), h = l.options, c = l.element, u = h.containment, d = u instanceof t ? u.get(0) : /parent/.test(u) ? c.parent().get(0) : u; d && (l.containerElement = t(d), /document/.test(u) || u === document ? (l.containerOffset = { left: 0, top: 0 }, l.containerPosition = { left: 0, top: 0 }, l.parentData = { element: t(document), left: 0, top: 0, width: t(document).width(), height: t(document).height() || document.body.parentNode.scrollHeight }) : (e = t(d), i = [], t([\"Top\", \"Right\", \"Left\", \"Bottom\"]).each(function (t, s) { i[t] = l._num(e.css(\"padding\" + s)) }), l.containerOffset = e.offset(), l.containerPosition = e.position(), l.containerSize = { height: e.innerHeight() - i[3], width: e.innerWidth() - i[1] }, s = l.containerOffset, n = l.containerSize.height, o = l.containerSize.width, a = l._hasScroll(d, \"left\") ? d.scrollWidth : o, r = l._hasScroll(d) ? d.scrollHeight : n, l.parentData = { element: d, left: s.left, top: s.top, width: a, height: r })) }, resize: function (e) { var i, s, n, o, a = t(this).resizable(\"instance\"), r = a.options, l = a.containerOffset, h = a.position, c = a._aspectRatio || e.shiftKey, u = { top: 0, left: 0 }, d = a.containerElement, p = !0; d[0] !== document && /static/.test(d.css(\"position\")) && (u = l), h.left < (a._helper ? l.left : 0) && (a.size.width = a.size.width + (a._helper ? a.position.left - l.left : a.position.left - u.left), c && (a.size.height = a.size.width / a.aspectRatio, p = !1), a.position.left = r.helper ? l.left : 0), h.top < (a._helper ? l.top : 0) && (a.size.height = a.size.height + (a._helper ? a.position.top - l.top : a.position.top), c && (a.size.width = a.size.height * a.aspectRatio, p = !1), a.position.top = a._helper ? l.top : 0), n = a.containerElement.get(0) === a.element.parent().get(0), o = /relative|absolute/.test(a.containerElement.css(\"position\")), n && o ? (a.offset.left = a.parentData.left + a.position.left, a.offset.top = a.parentData.top + a.position.top) : (a.offset.left = a.element.offset().left, a.offset.top = a.element.offset().top), i = Math.abs(a.sizeDiff.width + (a._helper ? a.offset.left - u.left : a.offset.left - l.left)), s = Math.abs(a.sizeDiff.height + (a._helper ? a.offset.top - u.top : a.offset.top - l.top)), i + a.size.width >= a.parentData.width && (a.size.width = a.parentData.width - i, c && (a.size.height = a.size.width / a.aspectRatio, p = !1)), s + a.size.height >= a.parentData.height && (a.size.height = a.parentData.height - s, c && (a.size.width = a.size.height * a.aspectRatio, p = !1)), p || (a.position.left = a.prevPosition.left, a.position.top = a.prevPosition.top, a.size.width = a.prevSize.width, a.size.height = a.prevSize.height) }, stop: function () { var e = t(this).resizable(\"instance\"), i = e.options, s = e.containerOffset, n = e.containerPosition, o = e.containerElement, a = t(e.helper), r = a.offset(), l = a.outerWidth() - e.sizeDiff.width, h = a.outerHeight() - e.sizeDiff.height; e._helper && !i.animate && /relative/.test(o.css(\"position\")) && t(this).css({ left: r.left - n.left - s.left, width: l, height: h }), e._helper && !i.animate && /static/.test(o.css(\"position\")) && t(this).css({ left: r.left - n.left - s.left, width: l, height: h }) } }), t.ui.plugin.add(\"resizable\", \"alsoResize\", {\n start: function () { var e = t(this).resizable(\"instance\"), i = e.options; t(i.alsoResize).each(function () { var e = t(this); e.data(\"ui-resizable-alsoresize\", { width: parseFloat(e.width()), height: parseFloat(e.height()), left: parseFloat(e.css(\"left\")), top: parseFloat(e.css(\"top\")) }) }) }, resize: function (e, i) {\n var s = t(this).resizable(\"instance\"), n = s.options, o = s.originalSize, a = s.originalPosition, r = { height: s.size.height - o.height || 0, width: s.size.width - o.width || 0, top: s.position.top - a.top || 0, left: s.position.left - a.left || 0 };\n t(n.alsoResize).each(function () { var e = t(this), s = t(this).data(\"ui-resizable-alsoresize\"), n = {}, o = e.parents(i.originalElement[0]).length ? [\"width\", \"height\"] : [\"width\", \"height\", \"top\", \"left\"]; t.each(o, function (t, e) { var i = (s[e] || 0) + (r[e] || 0); i && i >= 0 && (n[e] = i || null) }), e.css(n) })\n }, stop: function () { t(this).removeData(\"ui-resizable-alsoresize\") }\n }), t.ui.plugin.add(\"resizable\", \"ghost\", { start: function () { var e = t(this).resizable(\"instance\"), i = e.size; e.ghost = e.originalElement.clone(), e.ghost.css({ opacity: .25, display: \"block\", position: \"relative\", height: i.height, width: i.width, margin: 0, left: 0, top: 0 }), e._addClass(e.ghost, \"ui-resizable-ghost\"), t.uiBackCompat !== !1 && \"string\" == typeof e.options.ghost && e.ghost.addClass(this.options.ghost), e.ghost.appendTo(e.helper) }, resize: function () { var e = t(this).resizable(\"instance\"); e.ghost && e.ghost.css({ position: \"relative\", height: e.size.height, width: e.size.width }) }, stop: function () { var e = t(this).resizable(\"instance\"); e.ghost && e.helper && e.helper.get(0).removeChild(e.ghost.get(0)) } }), t.ui.plugin.add(\"resizable\", \"grid\", { resize: function () { var e, i = t(this).resizable(\"instance\"), s = i.options, n = i.size, o = i.originalSize, a = i.originalPosition, r = i.axis, l = \"number\" == typeof s.grid ? [s.grid, s.grid] : s.grid, h = l[0] || 1, c = l[1] || 1, u = Math.round((n.width - o.width) / h) * h, d = Math.round((n.height - o.height) / c) * c, p = o.width + u, f = o.height + d, g = s.maxWidth && p > s.maxWidth, m = s.maxHeight && f > s.maxHeight, _ = s.minWidth && s.minWidth > p, v = s.minHeight && s.minHeight > f; s.grid = l, _ && (p += h), v && (f += c), g && (p -= h), m && (f -= c), /^(se|s|e)$/.test(r) ? (i.size.width = p, i.size.height = f) : /^(ne)$/.test(r) ? (i.size.width = p, i.size.height = f, i.position.top = a.top - d) : /^(sw)$/.test(r) ? (i.size.width = p, i.size.height = f, i.position.left = a.left - u) : ((0 >= f - c || 0 >= p - h) && (e = i._getPaddingPlusBorderDimensions(this)), f - c > 0 ? (i.size.height = f, i.position.top = a.top - d) : (f = c - e.height, i.size.height = f, i.position.top = a.top + o.height - f), p - h > 0 ? (i.size.width = p, i.position.left = a.left - u) : (p = h - e.width, i.size.width = p, i.position.left = a.left + o.width - p)) } }), t.ui.resizable, t.widget(\"ui.selectable\", t.ui.mouse, { version: \"1.12.1\", options: { appendTo: \"body\", autoRefresh: !0, distance: 0, filter: \"*\", tolerance: \"touch\", selected: null, selecting: null, start: null, stop: null, unselected: null, unselecting: null }, _create: function () { var e = this; this._addClass(\"ui-selectable\"), this.dragged = !1, this.refresh = function () { e.elementPos = t(e.element[0]).offset(), e.selectees = t(e.options.filter, e.element[0]), e._addClass(e.selectees, \"ui-selectee\"), e.selectees.each(function () { var i = t(this), s = i.offset(), n = { left: s.left - e.elementPos.left, top: s.top - e.elementPos.top }; t.data(this, \"selectable-item\", { element: this, $element: i, left: n.left, top: n.top, right: n.left + i.outerWidth(), bottom: n.top + i.outerHeight(), startselected: !1, selected: i.hasClass(\"ui-selected\"), selecting: i.hasClass(\"ui-selecting\"), unselecting: i.hasClass(\"ui-unselecting\") }) }) }, this.refresh(), this._mouseInit(), this.helper = t(\"<div>\"), this._addClass(this.helper, \"ui-selectable-helper\") }, _destroy: function () { this.selectees.removeData(\"selectable-item\"), this._mouseDestroy() }, _mouseStart: function (e) { var i = this, s = this.options; this.opos = [e.pageX, e.pageY], this.elementPos = t(this.element[0]).offset(), this.options.disabled || (this.selectees = t(s.filter, this.element[0]), this._trigger(\"start\", e), t(s.appendTo).append(this.helper), this.helper.css({ left: e.pageX, top: e.pageY, width: 0, height: 0 }), s.autoRefresh && this.refresh(), this.selectees.filter(\".ui-selected\").each(function () { var s = t.data(this, \"selectable-item\"); s.startselected = !0, e.metaKey || e.ctrlKey || (i._removeClass(s.$element, \"ui-selected\"), s.selected = !1, i._addClass(s.$element, \"ui-unselecting\"), s.unselecting = !0, i._trigger(\"unselecting\", e, { unselecting: s.element })) }), t(e.target).parents().addBack().each(function () { var s, n = t.data(this, \"selectable-item\"); return n ? (s = !e.metaKey && !e.ctrlKey || !n.$element.hasClass(\"ui-selected\"), i._removeClass(n.$element, s ? \"ui-unselecting\" : \"ui-selected\")._addClass(n.$element, s ? \"ui-selecting\" : \"ui-unselecting\"), n.unselecting = !s, n.selecting = s, n.selected = s, s ? i._trigger(\"selecting\", e, { selecting: n.element }) : i._trigger(\"unselecting\", e, { unselecting: n.element }), !1) : void 0 })) }, _mouseDrag: function (e) { if (this.dragged = !0, !this.options.disabled) { var i, s = this, n = this.options, o = this.opos[0], a = this.opos[1], r = e.pageX, l = e.pageY; return o > r && (i = r, r = o, o = i), a > l && (i = l, l = a, a = i), this.helper.css({ left: o, top: a, width: r - o, height: l - a }), this.selectees.each(function () { var i = t.data(this, \"selectable-item\"), h = !1, c = {}; i && i.element !== s.element[0] && (c.left = i.left + s.elementPos.left, c.right = i.right + s.elementPos.left, c.top = i.top + s.elementPos.top, c.bottom = i.bottom + s.elementPos.top, \"touch\" === n.tolerance ? h = !(c.left > r || o > c.right || c.top > l || a > c.bottom) : \"fit\" === n.tolerance && (h = c.left > o && r > c.right && c.top > a && l > c.bottom), h ? (i.selected && (s._removeClass(i.$element, \"ui-selected\"), i.selected = !1), i.unselecting && (s._removeClass(i.$element, \"ui-unselecting\"), i.unselecting = !1), i.selecting || (s._addClass(i.$element, \"ui-selecting\"), i.selecting = !0, s._trigger(\"selecting\", e, { selecting: i.element }))) : (i.selecting && ((e.metaKey || e.ctrlKey) && i.startselected ? (s._removeClass(i.$element, \"ui-selecting\"), i.selecting = !1, s._addClass(i.$element, \"ui-selected\"), i.selected = !0) : (s._removeClass(i.$element, \"ui-selecting\"), i.selecting = !1, i.startselected && (s._addClass(i.$element, \"ui-unselecting\"), i.unselecting = !0), s._trigger(\"unselecting\", e, { unselecting: i.element }))), i.selected && (e.metaKey || e.ctrlKey || i.startselected || (s._removeClass(i.$element, \"ui-selected\"), i.selected = !1, s._addClass(i.$element, \"ui-unselecting\"), i.unselecting = !0, s._trigger(\"unselecting\", e, { unselecting: i.element }))))) }), !1 } }, _mouseStop: function (e) { var i = this; return this.dragged = !1, t(\".ui-unselecting\", this.element[0]).each(function () { var s = t.data(this, \"selectable-item\"); i._removeClass(s.$element, \"ui-unselecting\"), s.unselecting = !1, s.startselected = !1, i._trigger(\"unselected\", e, { unselected: s.element }) }), t(\".ui-selecting\", this.element[0]).each(function () { var s = t.data(this, \"selectable-item\"); i._removeClass(s.$element, \"ui-selecting\")._addClass(s.$element, \"ui-selected\"), s.selecting = !1, s.selected = !0, s.startselected = !0, i._trigger(\"selected\", e, { selected: s.element }) }), this._trigger(\"stop\", e), this.helper.remove(), !1 } }), t.widget(\"ui.sortable\", t.ui.mouse, { version: \"1.12.1\", widgetEventPrefix: \"sort\", ready: !1, options: { appendTo: \"parent\", axis: !1, connectWith: !1, containment: !1, cursor: \"auto\", cursorAt: !1, dropOnEmpty: !0, forcePlaceholderSize: !1, forceHelperSize: !1, grid: !1, handle: !1, helper: \"original\", items: \"> *\", opacity: !1, placeholder: !1, revert: !1, scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, scope: \"default\", tolerance: \"intersect\", zIndex: 1e3, activate: null, beforeStop: null, change: null, deactivate: null, out: null, over: null, receive: null, remove: null, sort: null, start: null, stop: null, update: null }, _isOverAxis: function (t, e, i) { return t >= e && e + i > t }, _isFloating: function (t) { return /left|right/.test(t.css(\"float\")) || /inline|table-cell/.test(t.css(\"display\")) }, _create: function () { this.containerCache = {}, this._addClass(\"ui-sortable\"), this.refresh(), this.offset = this.element.offset(), this._mouseInit(), this._setHandleClassName(), this.ready = !0 }, _setOption: function (t, e) { this._super(t, e), \"handle\" === t && this._setHandleClassName() }, _setHandleClassName: function () { var e = this; this._removeClass(this.element.find(\".ui-sortable-handle\"), \"ui-sortable-handle\"), t.each(this.items, function () { e._addClass(this.instance.options.handle ? this.item.find(this.instance.options.handle) : this.item, \"ui-sortable-handle\") }) }, _destroy: function () { this._mouseDestroy(); for (var t = this.items.length - 1; t >= 0; t--) this.items[t].item.removeData(this.widgetName + \"-item\"); return this }, _mouseCapture: function (e, i) { var s = null, n = !1, o = this; return this.reverting ? !1 : this.options.disabled || \"static\" === this.options.type ? !1 : (this._refreshItems(e), t(e.target).parents().each(function () { return t.data(this, o.widgetName + \"-item\") === o ? (s = t(this), !1) : void 0 }), t.data(e.target, o.widgetName + \"-item\") === o && (s = t(e.target)), s ? !this.options.handle || i || (t(this.options.handle, s).find(\"*\").addBack().each(function () { this === e.target && (n = !0) }), n) ? (this.currentItem = s, this._removeCurrentsFromItems(), !0) : !1 : !1) }, _mouseStart: function (e, i, s) { var n, o, a = this.options; if (this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(e), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, t.extend(this.offset, { click: { left: e.pageX - this.offset.left, top: e.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.helper.css(\"position\", \"absolute\"), this.cssPosition = this.helper.css(\"position\"), this.originalPosition = this._generatePosition(e), this.originalPageX = e.pageX, this.originalPageY = e.pageY, a.cursorAt && this._adjustOffsetFromHelper(a.cursorAt), this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), a.containment && this._setContainment(), a.cursor && \"auto\" !== a.cursor && (o = this.document.find(\"body\"), this.storedCursor = o.css(\"cursor\"), o.css(\"cursor\", a.cursor), this.storedStylesheet = t(\"<style>*{ cursor: \" + a.cursor + \" !important; }</style>\").appendTo(o)), a.opacity && (this.helper.css(\"opacity\") && (this._storedOpacity = this.helper.css(\"opacity\")), this.helper.css(\"opacity\", a.opacity)), a.zIndex && (this.helper.css(\"zIndex\") && (this._storedZIndex = this.helper.css(\"zIndex\")), this.helper.css(\"zIndex\", a.zIndex)), this.scrollParent[0] !== this.document[0] && \"HTML\" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger(\"start\", e, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !s) for (n = this.containers.length - 1; n >= 0; n--) this.containers[n]._trigger(\"activate\", e, this._uiHash(this)); return t.ui.ddmanager && (t.ui.ddmanager.current = this), t.ui.ddmanager && !a.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e), this.dragging = !0, this._addClass(this.helper, \"ui-sortable-helper\"), this._mouseDrag(e), !0 }, _mouseDrag: function (e) { var i, s, n, o, a = this.options, r = !1; for (this.position = this._generatePosition(e), this.positionAbs = this._convertPositionTo(\"absolute\"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== this.document[0] && \"HTML\" !== this.scrollParent[0].tagName ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - e.pageY < a.scrollSensitivity ? this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop + a.scrollSpeed : e.pageY - this.overflowOffset.top < a.scrollSensitivity && (this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop - a.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - e.pageX < a.scrollSensitivity ? this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft + a.scrollSpeed : e.pageX - this.overflowOffset.left < a.scrollSensitivity && (this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft - a.scrollSpeed)) : (e.pageY - this.document.scrollTop() < a.scrollSensitivity ? r = this.document.scrollTop(this.document.scrollTop() - a.scrollSpeed) : this.window.height() - (e.pageY - this.document.scrollTop()) < a.scrollSensitivity && (r = this.document.scrollTop(this.document.scrollTop() + a.scrollSpeed)), e.pageX - this.document.scrollLeft() < a.scrollSensitivity ? r = this.document.scrollLeft(this.document.scrollLeft() - a.scrollSpeed) : this.window.width() - (e.pageX - this.document.scrollLeft()) < a.scrollSensitivity && (r = this.document.scrollLeft(this.document.scrollLeft() + a.scrollSpeed))), r !== !1 && t.ui.ddmanager && !a.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e)), this.positionAbs = this._convertPositionTo(\"absolute\"), this.options.axis && \"y\" === this.options.axis || (this.helper[0].style.left = this.position.left + \"px\"), this.options.axis && \"x\" === this.options.axis || (this.helper[0].style.top = this.position.top + \"px\"), i = this.items.length - 1; i >= 0; i--) if (s = this.items[i], n = s.item[0], o = this._intersectsWithPointer(s), o && s.instance === this.currentContainer && n !== this.currentItem[0] && this.placeholder[1 === o ? \"next\" : \"prev\"]()[0] !== n && !t.contains(this.placeholder[0], n) && (\"semi-dynamic\" === this.options.type ? !t.contains(this.element[0], n) : !0)) { if (this.direction = 1 === o ? \"down\" : \"up\", \"pointer\" !== this.options.tolerance && !this._intersectsWithSides(s)) break; this._rearrange(e, s), this._trigger(\"change\", e, this._uiHash()); break } return this._contactContainers(e), t.ui.ddmanager && t.ui.ddmanager.drag(this, e), this._trigger(\"sort\", e, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1 }, _mouseStop: function (e, i) { if (e) { if (t.ui.ddmanager && !this.options.dropBehaviour && t.ui.ddmanager.drop(this, e), this.options.revert) { var s = this, n = this.placeholder.offset(), o = this.options.axis, a = {}; o && \"x\" !== o || (a.left = n.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft)), o && \"y\" !== o || (a.top = n.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop)), this.reverting = !0, t(this.helper).animate(a, parseInt(this.options.revert, 10) || 500, function () { s._clear(e) }) } else this._clear(e, i); return !1 } }, cancel: function () { if (this.dragging) { this._mouseUp(new t.Event(\"mouseup\", { target: null })), \"original\" === this.options.helper ? (this.currentItem.css(this._storedCSS), this._removeClass(this.currentItem, \"ui-sortable-helper\")) : this.currentItem.show(); for (var e = this.containers.length - 1; e >= 0; e--) this.containers[e]._trigger(\"deactivate\", null, this._uiHash(this)), this.containers[e].containerCache.over && (this.containers[e]._trigger(\"out\", null, this._uiHash(this)), this.containers[e].containerCache.over = 0) } return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), \"original\" !== this.options.helper && this.helper && this.helper[0].parentNode && this.helper.remove(), t.extend(this, { helper: null, dragging: !1, reverting: !1, _noFinalSort: null }), this.domPosition.prev ? t(this.domPosition.prev).after(this.currentItem) : t(this.domPosition.parent).prepend(this.currentItem)), this }, serialize: function (e) { var i = this._getItemsAsjQuery(e && e.connected), s = []; return e = e || {}, t(i).each(function () { var i = (t(e.item || this).attr(e.attribute || \"id\") || \"\").match(e.expression || /(.+)[\\-=_](.+)/); i && s.push((e.key || i[1] + \"[]\") + \"=\" + (e.key && e.expression ? i[1] : i[2])) }), !s.length && e.key && s.push(e.key + \"=\"), s.join(\"&\") }, toArray: function (e) { var i = this._getItemsAsjQuery(e && e.connected), s = []; return e = e || {}, i.each(function () { s.push(t(e.item || this).attr(e.attribute || \"id\") || \"\") }), s }, _intersectsWith: function (t) { var e = this.positionAbs.left, i = e + this.helperProportions.width, s = this.positionAbs.top, n = s + this.helperProportions.height, o = t.left, a = o + t.width, r = t.top, l = r + t.height, h = this.offset.click.top, c = this.offset.click.left, u = \"x\" === this.options.axis || s + h > r && l > s + h, d = \"y\" === this.options.axis || e + c > o && a > e + c, p = u && d; return \"pointer\" === this.options.tolerance || this.options.forcePointerForContainers || \"pointer\" !== this.options.tolerance && this.helperProportions[this.floating ? \"width\" : \"height\"] > t[this.floating ? \"width\" : \"height\"] ? p : e + this.helperProportions.width / 2 > o && a > i - this.helperProportions.width / 2 && s + this.helperProportions.height / 2 > r && l > n - this.helperProportions.height / 2 }, _intersectsWithPointer: function (t) { var e, i, s = \"x\" === this.options.axis || this._isOverAxis(this.positionAbs.top + this.offset.click.top, t.top, t.height), n = \"y\" === this.options.axis || this._isOverAxis(this.positionAbs.left + this.offset.click.left, t.left, t.width), o = s && n; return o ? (e = this._getDragVerticalDirection(), i = this._getDragHorizontalDirection(), this.floating ? \"right\" === i || \"down\" === e ? 2 : 1 : e && (\"down\" === e ? 2 : 1)) : !1 }, _intersectsWithSides: function (t) { var e = this._isOverAxis(this.positionAbs.top + this.offset.click.top, t.top + t.height / 2, t.height), i = this._isOverAxis(this.positionAbs.left + this.offset.click.left, t.left + t.width / 2, t.width), s = this._getDragVerticalDirection(), n = this._getDragHorizontalDirection(); return this.floating && n ? \"right\" === n && i || \"left\" === n && !i : s && (\"down\" === s && e || \"up\" === s && !e) }, _getDragVerticalDirection: function () { var t = this.positionAbs.top - this.lastPositionAbs.top; return 0 !== t && (t > 0 ? \"down\" : \"up\") }, _getDragHorizontalDirection: function () { var t = this.positionAbs.left - this.lastPositionAbs.left; return 0 !== t && (t > 0 ? \"right\" : \"left\") }, refresh: function (t) { return this._refreshItems(t), this._setHandleClassName(), this.refreshPositions(), this }, _connectWith: function () { var t = this.options; return t.connectWith.constructor === String ? [t.connectWith] : t.connectWith }, _getItemsAsjQuery: function (e) { function i() { r.push(this) } var s, n, o, a, r = [], l = [], h = this._connectWith(); if (h && e) for (s = h.length - 1; s >= 0; s--) for (o = t(h[s], this.document[0]), n = o.length - 1; n >= 0; n--) a = t.data(o[n], this.widgetFullName), a && a !== this && !a.options.disabled && l.push([t.isFunction(a.options.items) ? a.options.items.call(a.element) : t(a.options.items, a.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), a]); for (l.push([t.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : t(this.options.items, this.element).not(\".ui-sortable-helper\").not(\".ui-sortable-placeholder\"), this]), s = l.length - 1; s >= 0; s--) l[s][0].each(i); return t(r) }, _removeCurrentsFromItems: function () { var e = this.currentItem.find(\":data(\" + this.widgetName + \"-item)\"); this.items = t.grep(this.items, function (t) { for (var i = 0; e.length > i; i++) if (e[i] === t.item[0]) return !1; return !0 }) }, _refreshItems: function (e) { this.items = [], this.containers = [this]; var i, s, n, o, a, r, l, h, c = this.items, u = [[t.isFunction(this.options.items) ? this.options.items.call(this.element[0], e, { item: this.currentItem }) : t(this.options.items, this.element), this]], d = this._connectWith(); if (d && this.ready) for (i = d.length - 1; i >= 0; i--) for (n = t(d[i], this.document[0]), s = n.length - 1; s >= 0; s--) o = t.data(n[s], this.widgetFullName), o && o !== this && !o.options.disabled && (u.push([t.isFunction(o.options.items) ? o.options.items.call(o.element[0], e, { item: this.currentItem }) : t(o.options.items, o.element), o]), this.containers.push(o)); for (i = u.length - 1; i >= 0; i--) for (a = u[i][1], r = u[i][0], s = 0, h = r.length; h > s; s++) l = t(r[s]), l.data(this.widgetName + \"-item\", a), c.push({ item: l, instance: a, width: 0, height: 0, left: 0, top: 0 }) }, refreshPositions: function (e) { this.floating = this.items.length ? \"x\" === this.options.axis || this._isFloating(this.items[0].item) : !1, this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset()); var i, s, n, o; for (i = this.items.length - 1; i >= 0; i--) s = this.items[i], s.instance !== this.currentContainer && this.currentContainer && s.item[0] !== this.currentItem[0] || (n = this.options.toleranceElement ? t(this.options.toleranceElement, s.item) : s.item, e || (s.width = n.outerWidth(), s.height = n.outerHeight()), o = n.offset(), s.left = o.left, s.top = o.top); if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (i = this.containers.length - 1; i >= 0; i--) o = this.containers[i].element.offset(), this.containers[i].containerCache.left = o.left, this.containers[i].containerCache.top = o.top, this.containers[i].containerCache.width = this.containers[i].element.outerWidth(), this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); return this }, _createPlaceholder: function (e) { e = e || this; var i, s = e.options; s.placeholder && s.placeholder.constructor !== String || (i = s.placeholder, s.placeholder = { element: function () { var s = e.currentItem[0].nodeName.toLowerCase(), n = t(\"<\" + s + \">\", e.document[0]); return e._addClass(n, \"ui-sortable-placeholder\", i || e.currentItem[0].className)._removeClass(n, \"ui-sortable-helper\"), \"tbody\" === s ? e._createTrPlaceholder(e.currentItem.find(\"tr\").eq(0), t(\"<tr>\", e.document[0]).appendTo(n)) : \"tr\" === s ? e._createTrPlaceholder(e.currentItem, n) : \"img\" === s && n.attr(\"src\", e.currentItem.attr(\"src\")), i || n.css(\"visibility\", \"hidden\"), n }, update: function (t, n) { (!i || s.forcePlaceholderSize) && (n.height() || n.height(e.currentItem.innerHeight() - parseInt(e.currentItem.css(\"paddingTop\") || 0, 10) - parseInt(e.currentItem.css(\"paddingBottom\") || 0, 10)), n.width() || n.width(e.currentItem.innerWidth() - parseInt(e.currentItem.css(\"paddingLeft\") || 0, 10) - parseInt(e.currentItem.css(\"paddingRight\") || 0, 10))) } }), e.placeholder = t(s.placeholder.element.call(e.element, e.currentItem)), e.currentItem.after(e.placeholder), s.placeholder.update(e, e.placeholder) }, _createTrPlaceholder: function (e, i) { var s = this; e.children().each(function () { t(\"<td> </td>\", s.document[0]).attr(\"colspan\", t(this).attr(\"colspan\") || 1).appendTo(i) }) }, _contactContainers: function (e) { var i, s, n, o, a, r, l, h, c, u, d = null, p = null; for (i = this.containers.length - 1; i >= 0; i--) if (!t.contains(this.currentItem[0], this.containers[i].element[0])) if (this._intersectsWith(this.containers[i].containerCache)) { if (d && t.contains(this.containers[i].element[0], d.element[0])) continue; d = this.containers[i], p = i } else this.containers[i].containerCache.over && (this.containers[i]._trigger(\"out\", e, this._uiHash(this)), this.containers[i].containerCache.over = 0); if (d) if (1 === this.containers.length) this.containers[p].containerCache.over || (this.containers[p]._trigger(\"over\", e, this._uiHash(this)), this.containers[p].containerCache.over = 1); else { for (n = 1e4, o = null, c = d.floating || this._isFloating(this.currentItem), a = c ? \"left\" : \"top\", r = c ? \"width\" : \"height\", u = c ? \"pageX\" : \"pageY\", s = this.items.length - 1; s >= 0; s--) t.contains(this.containers[p].element[0], this.items[s].item[0]) && this.items[s].item[0] !== this.currentItem[0] && (l = this.items[s].item.offset()[a], h = !1, e[u] - l > this.items[s][r] / 2 && (h = !0), n > Math.abs(e[u] - l) && (n = Math.abs(e[u] - l), o = this.items[s], this.direction = h ? \"up\" : \"down\")); if (!o && !this.options.dropOnEmpty) return; if (this.currentContainer === this.containers[p]) return this.currentContainer.containerCache.over || (this.containers[p]._trigger(\"over\", e, this._uiHash()), this.currentContainer.containerCache.over = 1), void 0; o ? this._rearrange(e, o, null, !0) : this._rearrange(e, null, this.containers[p].element, !0), this._trigger(\"change\", e, this._uiHash()), this.containers[p]._trigger(\"change\", e, this._uiHash(this)), this.currentContainer = this.containers[p], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[p]._trigger(\"over\", e, this._uiHash(this)), this.containers[p].containerCache.over = 1 } }, _createHelper: function (e) { var i = this.options, s = t.isFunction(i.helper) ? t(i.helper.apply(this.element[0], [e, this.currentItem])) : \"clone\" === i.helper ? this.currentItem.clone() : this.currentItem; return s.parents(\"body\").length || t(\"parent\" !== i.appendTo ? i.appendTo : this.currentItem[0].parentNode)[0].appendChild(s[0]), s[0] === this.currentItem[0] && (this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css(\"position\"), top: this.currentItem.css(\"top\"), left: this.currentItem.css(\"left\") }), (!s[0].style.width || i.forceHelperSize) && s.width(this.currentItem.width()), (!s[0].style.height || i.forceHelperSize) && s.height(this.currentItem.height()), s }, _adjustOffsetFromHelper: function (e) { \"string\" == typeof e && (e = e.split(\" \")), t.isArray(e) && (e = { left: +e[0], top: +e[1] || 0 }), \"left\" in e && (this.offset.click.left = e.left + this.margins.left), \"right\" in e && (this.offset.click.left = this.helperProportions.width - e.right + this.margins.left), \"top\" in e && (this.offset.click.top = e.top + this.margins.top), \"bottom\" in e && (this.offset.click.top = this.helperProportions.height - e.bottom + this.margins.top) }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var e = this.offsetParent.offset(); return \"absolute\" === this.cssPosition && this.scrollParent[0] !== this.document[0] && t.contains(this.scrollParent[0], this.offsetParent[0]) && (e.left += this.scrollParent.scrollLeft(), e.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === this.document[0].body || this.offsetParent[0].tagName && \"html\" === this.offsetParent[0].tagName.toLowerCase() && t.ui.ie) && (e = { top: 0, left: 0 }), { top: e.top + (parseInt(this.offsetParent.css(\"borderTopWidth\"), 10) || 0), left: e.left + (parseInt(this.offsetParent.css(\"borderLeftWidth\"), 10) || 0) } }, _getRelativeOffset: function () { if (\"relative\" === this.cssPosition) { var t = this.currentItem.position(); return { top: t.top - (parseInt(this.helper.css(\"top\"), 10) || 0) + this.scrollParent.scrollTop(), left: t.left - (parseInt(this.helper.css(\"left\"), 10) || 0) + this.scrollParent.scrollLeft() } } return { top: 0, left: 0 } }, _cacheMargins: function () { this.margins = { left: parseInt(this.currentItem.css(\"marginLeft\"), 10) || 0, top: parseInt(this.currentItem.css(\"marginTop\"), 10) || 0 } }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() } }, _setContainment: function () { var e, i, s, n = this.options; \"parent\" === n.containment && (n.containment = this.helper[0].parentNode), (\"document\" === n.containment || \"window\" === n.containment) && (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, \"document\" === n.containment ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, (\"document\" === n.containment ? this.document.height() || document.body.parentNode.scrollHeight : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]), /^(document|window|parent)$/.test(n.containment) || (e = t(n.containment)[0], i = t(n.containment).offset(), s = \"hidden\" !== t(e).css(\"overflow\"), this.containment = [i.left + (parseInt(t(e).css(\"borderLeftWidth\"), 10) || 0) + (parseInt(t(e).css(\"paddingLeft\"), 10) || 0) - this.margins.left, i.top + (parseInt(t(e).css(\"borderTopWidth\"), 10) || 0) + (parseInt(t(e).css(\"paddingTop\"), 10) || 0) - this.margins.top, i.left + (s ? Math.max(e.scrollWidth, e.offsetWidth) : e.offsetWidth) - (parseInt(t(e).css(\"borderLeftWidth\"), 10) || 0) - (parseInt(t(e).css(\"paddingRight\"), 10) || 0) - this.helperProportions.width - this.margins.left, i.top + (s ? Math.max(e.scrollHeight, e.offsetHeight) : e.offsetHeight) - (parseInt(t(e).css(\"borderTopWidth\"), 10) || 0) - (parseInt(t(e).css(\"paddingBottom\"), 10) || 0) - this.helperProportions.height - this.margins.top]) }, _convertPositionTo: function (e, i) { i || (i = this.position); var s = \"absolute\" === e ? 1 : -1, n = \"absolute\" !== this.cssPosition || this.scrollParent[0] !== this.document[0] && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, o = /(html|body)/i.test(n[0].tagName); return { top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollTop() : o ? 0 : n.scrollTop()) * s, left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollLeft() : o ? 0 : n.scrollLeft()) * s } }, _generatePosition: function (e) { var i, s, n = this.options, o = e.pageX, a = e.pageY, r = \"absolute\" !== this.cssPosition || this.scrollParent[0] !== this.document[0] && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, l = /(html|body)/i.test(r[0].tagName); return \"relative\" !== this.cssPosition || this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0] || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (e.pageX - this.offset.click.left < this.containment[0] && (o = this.containment[0] + this.offset.click.left), e.pageY - this.offset.click.top < this.containment[1] && (a = this.containment[1] + this.offset.click.top), e.pageX - this.offset.click.left > this.containment[2] && (o = this.containment[2] + this.offset.click.left), e.pageY - this.offset.click.top > this.containment[3] && (a = this.containment[3] + this.offset.click.top)), n.grid && (i = this.originalPageY + Math.round((a - this.originalPageY) / n.grid[1]) * n.grid[1], a = this.containment ? i - this.offset.click.top >= this.containment[1] && i - this.offset.click.top <= this.containment[3] ? i : i - this.offset.click.top >= this.containment[1] ? i - n.grid[1] : i + n.grid[1] : i, s = this.originalPageX + Math.round((o - this.originalPageX) / n.grid[0]) * n.grid[0], o = this.containment ? s - this.offset.click.left >= this.containment[0] && s - this.offset.click.left <= this.containment[2] ? s : s - this.offset.click.left >= this.containment[0] ? s - n.grid[0] : s + n.grid[0] : s)), { top: a - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollTop() : l ? 0 : r.scrollTop()), left: o - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (\"fixed\" === this.cssPosition ? -this.scrollParent.scrollLeft() : l ? 0 : r.scrollLeft()) } }, _rearrange: function (t, e, i, s) { i ? i[0].appendChild(this.placeholder[0]) : e.item[0].parentNode.insertBefore(this.placeholder[0], \"down\" === this.direction ? e.item[0] : e.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1; var n = this.counter; this._delay(function () { n === this.counter && this.refreshPositions(!s) }) }, _clear: function (t, e) { function i(t, e, i) { return function (s) { i._trigger(t, s, e._uiHash(e)) } } this.reverting = !1; var s, n = []; if (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null, this.helper[0] === this.currentItem[0]) { for (s in this._storedCSS) (\"auto\" === this._storedCSS[s] || \"static\" === this._storedCSS[s]) && (this._storedCSS[s] = \"\"); this.currentItem.css(this._storedCSS), this._removeClass(this.currentItem, \"ui-sortable-helper\") } else this.currentItem.show(); for (this.fromOutside && !e && n.push(function (t) { this._trigger(\"receive\", t, this._uiHash(this.fromOutside)) }), !this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(\".ui-sortable-helper\")[0] && this.domPosition.parent === this.currentItem.parent()[0] || e || n.push(function (t) { this._trigger(\"update\", t, this._uiHash()) }), this !== this.currentContainer && (e || (n.push(function (t) { this._trigger(\"remove\", t, this._uiHash()) }), n.push(function (t) { return function (e) { t._trigger(\"receive\", e, this._uiHash(this)) } }.call(this, this.currentContainer)), n.push(function (t) { return function (e) { t._trigger(\"update\", e, this._uiHash(this)) } }.call(this, this.currentContainer)))), s = this.containers.length - 1; s >= 0; s--) e || n.push(i(\"deactivate\", this, this.containers[s])), this.containers[s].containerCache.over && (n.push(i(\"out\", this, this.containers[s])), this.containers[s].containerCache.over = 0); if (this.storedCursor && (this.document.find(\"body\").css(\"cursor\", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css(\"opacity\", this._storedOpacity), this._storedZIndex && this.helper.css(\"zIndex\", \"auto\" === this._storedZIndex ? \"\" : this._storedZIndex), this.dragging = !1, e || this._trigger(\"beforeStop\", t, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.cancelHelperRemoval || (this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null), !e) { for (s = 0; n.length > s; s++) n[s].call(this, t); this._trigger(\"stop\", t, this._uiHash()) } return this.fromOutside = !1, !this.cancelHelperRemoval }, _trigger: function () { t.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel() }, _uiHash: function (e) { var i = e || this; return { helper: i.helper, placeholder: i.placeholder || t([]), position: i.position, originalPosition: i.originalPosition, offset: i.positionAbs, item: i.currentItem, sender: e ? e.element : null } } }), t.extend(t.ui, { datepicker: { version: \"1.12.1\" } }); var u; t.extend(s.prototype, {\n markerClassName: \"hasDatepicker\", maxRows: 4, _widgetDatepicker: function () { return this.dpDiv }, setDefaults: function (t) { return a(this._defaults, t || {}), this }, _attachDatepicker: function (e, i) { var s, n, o; s = e.nodeName.toLowerCase(), n = \"div\" === s || \"span\" === s, e.id || (this.uuid += 1, e.id = \"dp\" + this.uuid), o = this._newInst(t(e), n), o.settings = t.extend({}, i || {}), \"input\" === s ? this._connectDatepicker(e, o) : n && this._inlineDatepicker(e, o) }, _newInst: function (e, i) { var s = e[0].id.replace(/([^A-Za-z0-9_\\-])/g, \"\\\\\\\\$1\"); return { id: s, input: e, selectedDay: 0, selectedMonth: 0, selectedYear: 0, drawMonth: 0, drawYear: 0, inline: i, dpDiv: i ? n(t(\"<div class='\" + this._inlineClass + \" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\")) : this.dpDiv } }, _connectDatepicker: function (e, i) { var s = t(e); i.append = t([]), i.trigger = t([]), s.hasClass(this.markerClassName) || (this._attachments(s, i), s.addClass(this.markerClassName).on(\"keydown\", this._doKeyDown).on(\"keypress\", this._doKeyPress).on(\"keyup\", this._doKeyUp), this._autoSize(i), t.data(e, \"datepicker\", i), i.settings.disabled && this._disableDatepicker(e)) }, _attachments: function (e, i) {\n var s, n, o, a = this._get(i, \"appendText\"), r = this._get(i, \"isRTL\"); i.append && i.append.remove(), a && (i.append = t(\"<span class='\" + this._appendClass + \"'>\" + a + \"</span>\"), e[r ? \"before\" : \"after\"](i.append)), e.off(\"focus\", this._showDatepicker), i.trigger && i.trigger.remove(), s = this._get(i, \"showOn\"), (\"focus\" === s || \"both\" === s) && e.on(\"focus\", this._showDatepicker), (\"button\" === s || \"both\" === s) && (n = this._get(i, \"buttonText\"), o = this._get(i, \"buttonImage\"), i.trigger = t(this._get(i, \"buttonImageOnly\") ? t(\"<img/>\").addClass(this._triggerClass).attr({ src: o, alt: n, title: n }) : t(\"<button type='button'></button>\").addClass(this._triggerClass).html(o ? t(\"<img/>\").attr({ src: o, alt: n, title: n }) : n)), e[r ? \"before\" : \"after\"](i.trigger), i.trigger.on(\"click\", function () {\n return t.datepicker._datepickerShowing && t.datepicker._lastInput === e[0] ? t.datepicker._hideDatepicker() : t.datepicker._datepickerShowing && t.datepicker._lastInput !== e[0] ? (t.datepicker._hideDatepicker(), t.datepicker._showDatepicker(e[0])) : t.datepicker._showDatepicker(e[0]), !1\n }))\n }, _autoSize: function (t) { if (this._get(t, \"autoSize\") && !t.inline) { var e, i, s, n, o = new Date(2009, 11, 20), a = this._get(t, \"dateFormat\"); a.match(/[DM]/) && (e = function (t) { for (i = 0, s = 0, n = 0; t.length > n; n++) t[n].length > i && (i = t[n].length, s = n); return s }, o.setMonth(e(this._get(t, a.match(/MM/) ? \"monthNames\" : \"monthNamesShort\"))), o.setDate(e(this._get(t, a.match(/DD/) ? \"dayNames\" : \"dayNamesShort\")) + 20 - o.getDay())), t.input.attr(\"size\", this._formatDate(t, o).length) } }, _inlineDatepicker: function (e, i) { var s = t(e); s.hasClass(this.markerClassName) || (s.addClass(this.markerClassName).append(i.dpDiv), t.data(e, \"datepicker\", i), this._setDate(i, this._getDefaultDate(i), !0), this._updateDatepicker(i), this._updateAlternate(i), i.settings.disabled && this._disableDatepicker(e), i.dpDiv.css(\"display\", \"block\")) }, _dialogDatepicker: function (e, i, s, n, o) { var r, l, h, c, u, d = this._dialogInst; return d || (this.uuid += 1, r = \"dp\" + this.uuid, this._dialogInput = t(\"<input type='text' id='\" + r + \"' style='position: absolute; top: -100px; width: 0px;'/>\"), this._dialogInput.on(\"keydown\", this._doKeyDown), t(\"body\").append(this._dialogInput), d = this._dialogInst = this._newInst(this._dialogInput, !1), d.settings = {}, t.data(this._dialogInput[0], \"datepicker\", d)), a(d.settings, n || {}), i = i && i.constructor === Date ? this._formatDate(d, i) : i, this._dialogInput.val(i), this._pos = o ? o.length ? o : [o.pageX, o.pageY] : null, this._pos || (l = document.documentElement.clientWidth, h = document.documentElement.clientHeight, c = document.documentElement.scrollLeft || document.body.scrollLeft, u = document.documentElement.scrollTop || document.body.scrollTop, this._pos = [l / 2 - 100 + c, h / 2 - 150 + u]), this._dialogInput.css(\"left\", this._pos[0] + 20 + \"px\").css(\"top\", this._pos[1] + \"px\"), d.settings.onSelect = s, this._inDialog = !0, this.dpDiv.addClass(this._dialogClass), this._showDatepicker(this._dialogInput[0]), t.blockUI && t.blockUI(this.dpDiv), t.data(this._dialogInput[0], \"datepicker\", d), this }, _destroyDatepicker: function (e) { var i, s = t(e), n = t.data(e, \"datepicker\"); s.hasClass(this.markerClassName) && (i = e.nodeName.toLowerCase(), t.removeData(e, \"datepicker\"), \"input\" === i ? (n.append.remove(), n.trigger.remove(), s.removeClass(this.markerClassName).off(\"focus\", this._showDatepicker).off(\"keydown\", this._doKeyDown).off(\"keypress\", this._doKeyPress).off(\"keyup\", this._doKeyUp)) : (\"div\" === i || \"span\" === i) && s.removeClass(this.markerClassName).empty(), u === n && (u = null)) }, _enableDatepicker: function (e) { var i, s, n = t(e), o = t.data(e, \"datepicker\"); n.hasClass(this.markerClassName) && (i = e.nodeName.toLowerCase(), \"input\" === i ? (e.disabled = !1, o.trigger.filter(\"button\").each(function () { this.disabled = !1 }).end().filter(\"img\").css({ opacity: \"1.0\", cursor: \"\" })) : (\"div\" === i || \"span\" === i) && (s = n.children(\".\" + this._inlineClass), s.children().removeClass(\"ui-state-disabled\"), s.find(\"select.ui-datepicker-month, select.ui-datepicker-year\").prop(\"disabled\", !1)), this._disabledInputs = t.map(this._disabledInputs, function (t) { return t === e ? null : t })) }, _disableDatepicker: function (e) { var i, s, n = t(e), o = t.data(e, \"datepicker\"); n.hasClass(this.markerClassName) && (i = e.nodeName.toLowerCase(), \"input\" === i ? (e.disabled = !0, o.trigger.filter(\"button\").each(function () { this.disabled = !0 }).end().filter(\"img\").css({ opacity: \"0.5\", cursor: \"default\" })) : (\"div\" === i || \"span\" === i) && (s = n.children(\".\" + this._inlineClass), s.children().addClass(\"ui-state-disabled\"), s.find(\"select.ui-datepicker-month, select.ui-datepicker-year\").prop(\"disabled\", !0)), this._disabledInputs = t.map(this._disabledInputs, function (t) { return t === e ? null : t }), this._disabledInputs[this._disabledInputs.length] = e) }, _isDisabledDatepicker: function (t) { if (!t) return !1; for (var e = 0; this._disabledInputs.length > e; e++) if (this._disabledInputs[e] === t) return !0; return !1 }, _getInst: function (e) { try { return t.data(e, \"datepicker\") } catch (i) { throw \"Missing instance data for this datepicker\" } }, _optionDatepicker: function (e, i, s) { var n, o, r, l, h = this._getInst(e); return 2 === arguments.length && \"string\" == typeof i ? \"defaults\" === i ? t.extend({}, t.datepicker._defaults) : h ? \"all\" === i ? t.extend({}, h.settings) : this._get(h, i) : null : (n = i || {}, \"string\" == typeof i && (n = {}, n[i] = s), h && (this._curInst === h && this._hideDatepicker(), o = this._getDateDatepicker(e, !0), r = this._getMinMaxDate(h, \"min\"), l = this._getMinMaxDate(h, \"max\"), a(h.settings, n), null !== r && void 0 !== n.dateFormat && void 0 === n.minDate && (h.settings.minDate = this._formatDate(h, r)), null !== l && void 0 !== n.dateFormat && void 0 === n.maxDate && (h.settings.maxDate = this._formatDate(h, l)), \"disabled\" in n && (n.disabled ? this._disableDatepicker(e) : this._enableDatepicker(e)), this._attachments(t(e), h), this._autoSize(h), this._setDate(h, o), this._updateAlternate(h), this._updateDatepicker(h)), void 0) }, _changeDatepicker: function (t, e, i) { this._optionDatepicker(t, e, i) }, _refreshDatepicker: function (t) { var e = this._getInst(t); e && this._updateDatepicker(e) }, _setDateDatepicker: function (t, e) { var i = this._getInst(t); i && (this._setDate(i, e), this._updateDatepicker(i), this._updateAlternate(i)) }, _getDateDatepicker: function (t, e) { var i = this._getInst(t); return i && !i.inline && this._setDateFromField(i, e), i ? this._getDate(i) : null }, _doKeyDown: function (e) { var i, s, n, o = t.datepicker._getInst(e.target), a = !0, r = o.dpDiv.is(\".ui-datepicker-rtl\"); if (o._keyEvent = !0, t.datepicker._datepickerShowing) switch (e.keyCode) { case 9: t.datepicker._hideDatepicker(), a = !1; break; case 13: return n = t(\"td.\" + t.datepicker._dayOverClass + \":not(.\" + t.datepicker._currentClass + \")\", o.dpDiv), n[0] && t.datepicker._selectDay(e.target, o.selectedMonth, o.selectedYear, n[0]), i = t.datepicker._get(o, \"onSelect\"), i ? (s = t.datepicker._formatDate(o), i.apply(o.input ? o.input[0] : null, [s, o])) : t.datepicker._hideDatepicker(), !1; case 27: t.datepicker._hideDatepicker(); break; case 33: t.datepicker._adjustDate(e.target, e.ctrlKey ? -t.datepicker._get(o, \"stepBigMonths\") : -t.datepicker._get(o, \"stepMonths\"), \"M\"); break; case 34: t.datepicker._adjustDate(e.target, e.ctrlKey ? +t.datepicker._get(o, \"stepBigMonths\") : +t.datepicker._get(o, \"stepMonths\"), \"M\"); break; case 35: (e.ctrlKey || e.metaKey) && t.datepicker._clearDate(e.target), a = e.ctrlKey || e.metaKey; break; case 36: (e.ctrlKey || e.metaKey) && t.datepicker._gotoToday(e.target), a = e.ctrlKey || e.metaKey; break; case 37: (e.ctrlKey || e.metaKey) && t.datepicker._adjustDate(e.target, r ? 1 : -1, \"D\"), a = e.ctrlKey || e.metaKey, e.originalEvent.altKey && t.datepicker._adjustDate(e.target, e.ctrlKey ? -t.datepicker._get(o, \"stepBigMonths\") : -t.datepicker._get(o, \"stepMonths\"), \"M\"); break; case 38: (e.ctrlKey || e.metaKey) && t.datepicker._adjustDate(e.target, -7, \"D\"), a = e.ctrlKey || e.metaKey; break; case 39: (e.ctrlKey || e.metaKey) && t.datepicker._adjustDate(e.target, r ? -1 : 1, \"D\"), a = e.ctrlKey || e.metaKey, e.originalEvent.altKey && t.datepicker._adjustDate(e.target, e.ctrlKey ? +t.datepicker._get(o, \"stepBigMonths\") : +t.datepicker._get(o, \"stepMonths\"), \"M\"); break; case 40: (e.ctrlKey || e.metaKey) && t.datepicker._adjustDate(e.target, 7, \"D\"), a = e.ctrlKey || e.metaKey; break; default: a = !1 } else 36 === e.keyCode && e.ctrlKey ? t.datepicker._showDatepicker(this) : a = !1; a && (e.preventDefault(), e.stopPropagation()) }, _doKeyPress: function (e) { var i, s, n = t.datepicker._getInst(e.target); return t.datepicker._get(n, \"constrainInput\") ? (i = t.datepicker._possibleChars(t.datepicker._get(n, \"dateFormat\")), s = String.fromCharCode(null == e.charCode ? e.keyCode : e.charCode), e.ctrlKey || e.metaKey || \" \" > s || !i || i.indexOf(s) > -1) : void 0 }, _doKeyUp: function (e) { var i, s = t.datepicker._getInst(e.target); if (s.input.val() !== s.lastVal) try { i = t.datepicker.parseDate(t.datepicker._get(s, \"dateFormat\"), s.input ? s.input.val() : null, t.datepicker._getFormatConfig(s)), i && (t.datepicker._setDateFromField(s), t.datepicker._updateAlternate(s), t.datepicker._updateDatepicker(s)) } catch (n) { } return !0 }, _showDatepicker: function (e) { if (e = e.target || e, \"input\" !== e.nodeName.toLowerCase() && (e = t(\"input\", e.parentNode)[0]), !t.datepicker._isDisabledDatepicker(e) && t.datepicker._lastInput !== e) { var s, n, o, r, l, h, c; s = t.datepicker._getInst(e), t.datepicker._curInst && t.datepicker._curInst !== s && (t.datepicker._curInst.dpDiv.stop(!0, !0), s && t.datepicker._datepickerShowing && t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])), n = t.datepicker._get(s, \"beforeShow\"), o = n ? n.apply(e, [e, s]) : {}, o !== !1 && (a(s.settings, o), s.lastVal = null, t.datepicker._lastInput = e, t.datepicker._setDateFromField(s), t.datepicker._inDialog && (e.value = \"\"), t.datepicker._pos || (t.datepicker._pos = t.datepicker._findPos(e), t.datepicker._pos[1] += e.offsetHeight), r = !1, t(e).parents().each(function () { return r |= \"fixed\" === t(this).css(\"position\"), !r }), l = { left: t.datepicker._pos[0], top: t.datepicker._pos[1] }, t.datepicker._pos = null, s.dpDiv.empty(), s.dpDiv.css({ position: \"absolute\", display: \"block\", top: \"-1000px\" }), t.datepicker._updateDatepicker(s), l = t.datepicker._checkOffset(s, l, r), s.dpDiv.css({ position: t.datepicker._inDialog && t.blockUI ? \"static\" : r ? \"fixed\" : \"absolute\", display: \"none\", left: l.left + \"px\", top: l.top + \"px\" }), s.inline || (h = t.datepicker._get(s, \"showAnim\"), c = t.datepicker._get(s, \"duration\"), s.dpDiv.css(\"z-index\", i(t(e)) + 1), t.datepicker._datepickerShowing = !0, t.effects && t.effects.effect[h] ? s.dpDiv.show(h, t.datepicker._get(s, \"showOptions\"), c) : s.dpDiv[h || \"show\"](h ? c : null), t.datepicker._shouldFocusInput(s) && s.input.trigger(\"focus\"), t.datepicker._curInst = s)) } }, _updateDatepicker: function (e) { this.maxRows = 4, u = e, e.dpDiv.empty().append(this._generateHTML(e)), this._attachHandlers(e); var i, s = this._getNumberOfMonths(e), n = s[1], a = 17, r = e.dpDiv.find(\".\" + this._dayOverClass + \" a\"); r.length > 0 && o.apply(r.get(0)), e.dpDiv.removeClass(\"ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4\").width(\"\"), n > 1 && e.dpDiv.addClass(\"ui-datepicker-multi-\" + n).css(\"width\", a * n + \"em\"), e.dpDiv[(1 !== s[0] || 1 !== s[1] ? \"add\" : \"remove\") + \"Class\"](\"ui-datepicker-multi\"), e.dpDiv[(this._get(e, \"isRTL\") ? \"add\" : \"remove\") + \"Class\"](\"ui-datepicker-rtl\"), e === t.datepicker._curInst && t.datepicker._datepickerShowing && t.datepicker._shouldFocusInput(e) && e.input.trigger(\"focus\"), e.yearshtml && (i = e.yearshtml, setTimeout(function () { i === e.yearshtml && e.yearshtml && e.dpDiv.find(\"select.ui-datepicker-year:first\").replaceWith(e.yearshtml), i = e.yearshtml = null }, 0)) }, _shouldFocusInput: function (t) { return t.input && t.input.is(\":visible\") && !t.input.is(\":disabled\") && !t.input.is(\":focus\") }, _checkOffset: function (e, i, s) { var n = e.dpDiv.outerWidth(), o = e.dpDiv.outerHeight(), a = e.input ? e.input.outerWidth() : 0, r = e.input ? e.input.outerHeight() : 0, l = document.documentElement.clientWidth + (s ? 0 : t(document).scrollLeft()), h = document.documentElement.clientHeight + (s ? 0 : t(document).scrollTop()); return i.left -= this._get(e, \"isRTL\") ? n - a : 0, i.left -= s && i.left === e.input.offset().left ? t(document).scrollLeft() : 0, i.top -= s && i.top === e.input.offset().top + r ? t(document).scrollTop() : 0, i.left -= Math.min(i.left, i.left + n > l && l > n ? Math.abs(i.left + n - l) : 0), i.top -= Math.min(i.top, i.top + o > h && h > o ? Math.abs(o + r) : 0), i }, _findPos: function (e) { for (var i, s = this._getInst(e), n = this._get(s, \"isRTL\") ; e && (\"hidden\" === e.type || 1 !== e.nodeType || t.expr.filters.hidden(e)) ;) e = e[n ? \"previousSibling\" : \"nextSibling\"]; return i = t(e).offset(), [i.left, i.top] }, _hideDatepicker: function (e) { var i, s, n, o, a = this._curInst; !a || e && a !== t.data(e, \"datepicker\") || this._datepickerShowing && (i = this._get(a, \"showAnim\"), s = this._get(a, \"duration\"), n = function () { t.datepicker._tidyDialog(a) }, t.effects && (t.effects.effect[i] || t.effects[i]) ? a.dpDiv.hide(i, t.datepicker._get(a, \"showOptions\"), s, n) : a.dpDiv[\"slideDown\" === i ? \"slideUp\" : \"fadeIn\" === i ? \"fadeOut\" : \"hide\"](i ? s : null, n), i || n(), this._datepickerShowing = !1, o = this._get(a, \"onClose\"), o && o.apply(a.input ? a.input[0] : null, [a.input ? a.input.val() : \"\", a]), this._lastInput = null, this._inDialog && (this._dialogInput.css({ position: \"absolute\", left: \"0\", top: \"-100px\" }), t.blockUI && (t.unblockUI(), t(\"body\").append(this.dpDiv))), this._inDialog = !1) }, _tidyDialog: function (t) { t.dpDiv.removeClass(this._dialogClass).off(\".ui-datepicker-calendar\") }, _checkExternalClick: function (e) { if (t.datepicker._curInst) { var i = t(e.target), s = t.datepicker._getInst(i[0]); (i[0].id !== t.datepicker._mainDivId && 0 === i.parents(\"#\" + t.datepicker._mainDivId).length && !i.hasClass(t.datepicker.markerClassName) && !i.closest(\".\" + t.datepicker._triggerClass).length && t.datepicker._datepickerShowing && (!t.datepicker._inDialog || !t.blockUI) || i.hasClass(t.datepicker.markerClassName) && t.datepicker._curInst !== s) && t.datepicker._hideDatepicker() } }, _adjustDate: function (e, i, s) { var n = t(e), o = this._getInst(n[0]); this._isDisabledDatepicker(n[0]) || (this._adjustInstDate(o, i + (\"M\" === s ? this._get(o, \"showCurrentAtPos\") : 0), s), this._updateDatepicker(o)) }, _gotoToday: function (e) { var i, s = t(e), n = this._getInst(s[0]); this._get(n, \"gotoCurrent\") && n.currentDay ? (n.selectedDay = n.currentDay, n.drawMonth = n.selectedMonth = n.currentMonth, n.drawYear = n.selectedYear = n.currentYear) : (i = new Date, n.selectedDay = i.getDate(), n.drawMonth = n.selectedMonth = i.getMonth(), n.drawYear = n.selectedYear = i.getFullYear()), this._notifyChange(n), this._adjustDate(s) }, _selectMonthYear: function (e, i, s) { var n = t(e), o = this._getInst(n[0]); o[\"selected\" + (\"M\" === s ? \"Month\" : \"Year\")] = o[\"draw\" + (\"M\" === s ? \"Month\" : \"Year\")] = parseInt(i.options[i.selectedIndex].value, 10), this._notifyChange(o), this._adjustDate(n) }, _selectDay: function (e, i, s, n) { var o, a = t(e); t(n).hasClass(this._unselectableClass) || this._isDisabledDatepicker(a[0]) || (o = this._getInst(a[0]), o.selectedDay = o.currentDay = t(\"a\", n).html(), o.selectedMonth = o.currentMonth = i, o.selectedYear = o.currentYear = s, this._selectDate(e, this._formatDate(o, o.currentDay, o.currentMonth, o.currentYear))) }, _clearDate: function (e) { var i = t(e); this._selectDate(i, \"\") }, _selectDate: function (e, i) { var s, n = t(e), o = this._getInst(n[0]); i = null != i ? i : this._formatDate(o), o.input && o.input.val(i), this._updateAlternate(o), s = this._get(o, \"onSelect\"), s ? s.apply(o.input ? o.input[0] : null, [i, o]) : o.input && o.input.trigger(\"change\"), o.inline ? this._updateDatepicker(o) : (this._hideDatepicker(), this._lastInput = o.input[0], \"object\" != typeof o.input[0] && o.input.trigger(\"focus\"), this._lastInput = null) }, _updateAlternate: function (e) { var i, s, n, o = this._get(e, \"altField\"); o && (i = this._get(e, \"altFormat\") || this._get(e, \"dateFormat\"), s = this._getDate(e), n = this.formatDate(i, s, this._getFormatConfig(e)), t(o).val(n)) }, noWeekends: function (t) { var e = t.getDay(); return [e > 0 && 6 > e, \"\"] }, iso8601Week: function (t) { var e, i = new Date(t.getTime()); return i.setDate(i.getDate() + 4 - (i.getDay() || 7)), e = i.getTime(), i.setMonth(0), i.setDate(1), Math.floor(Math.round((e - i) / 864e5) / 7) + 1 }, parseDate: function (e, i, s) { if (null == e || null == i) throw \"Invalid arguments\"; if (i = \"object\" == typeof i ? \"\" + i : i + \"\", \"\" === i) return null; var n, o, a, r, l = 0, h = (s ? s.shortYearCutoff : null) || this._defaults.shortYearCutoff, c = \"string\" != typeof h ? h : (new Date).getFullYear() % 100 + parseInt(h, 10), u = (s ? s.dayNamesShort : null) || this._defaults.dayNamesShort, d = (s ? s.dayNames : null) || this._defaults.dayNames, p = (s ? s.monthNamesShort : null) || this._defaults.monthNamesShort, f = (s ? s.monthNames : null) || this._defaults.monthNames, g = -1, m = -1, _ = -1, v = -1, b = !1, y = function (t) { var i = e.length > n + 1 && e.charAt(n + 1) === t; return i && n++, i }, w = function (t) { var e = y(t), s = \"@\" === t ? 14 : \"!\" === t ? 20 : \"y\" === t && e ? 4 : \"o\" === t ? 3 : 2, n = \"y\" === t ? s : 1, o = RegExp(\"^\\\\d{\" + n + \",\" + s + \"}\"), a = i.substring(l).match(o); if (!a) throw \"Missing number at position \" + l; return l += a[0].length, parseInt(a[0], 10) }, k = function (e, s, n) { var o = -1, a = t.map(y(e) ? n : s, function (t, e) { return [[e, t]] }).sort(function (t, e) { return -(t[1].length - e[1].length) }); if (t.each(a, function (t, e) { var s = e[1]; return i.substr(l, s.length).toLowerCase() === s.toLowerCase() ? (o = e[0], l += s.length, !1) : void 0 }), -1 !== o) return o + 1; throw \"Unknown name at position \" + l }, x = function () { if (i.charAt(l) !== e.charAt(n)) throw \"Unexpected literal at position \" + l; l++ }; for (n = 0; e.length > n; n++) if (b) \"'\" !== e.charAt(n) || y(\"'\") ? x() : b = !1; else switch (e.charAt(n)) { case \"d\": _ = w(\"d\"); break; case \"D\": k(\"D\", u, d); break; case \"o\": v = w(\"o\"); break; case \"m\": m = w(\"m\"); break; case \"M\": m = k(\"M\", p, f); break; case \"y\": g = w(\"y\"); break; case \"@\": r = new Date(w(\"@\")), g = r.getFullYear(), m = r.getMonth() + 1, _ = r.getDate(); break; case \"!\": r = new Date((w(\"!\") - this._ticksTo1970) / 1e4), g = r.getFullYear(), m = r.getMonth() + 1, _ = r.getDate(); break; case \"'\": y(\"'\") ? x() : b = !0; break; default: x() } if (i.length > l && (a = i.substr(l), !/^\\s+/.test(a))) throw \"Extra/unparsed characters found in date: \" + a; if (-1 === g ? g = (new Date).getFullYear() : 100 > g && (g += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (c >= g ? 0 : -100)), v > -1) for (m = 1, _ = v; ;) { if (o = this._getDaysInMonth(g, m - 1), o >= _) break; m++, _ -= o } if (r = this._daylightSavingAdjust(new Date(g, m - 1, _)), r.getFullYear() !== g || r.getMonth() + 1 !== m || r.getDate() !== _) throw \"Invalid date\"; return r }, ATOM: \"yy-mm-dd\", COOKIE: \"D, dd M yy\", ISO_8601: \"yy-mm-dd\", RFC_822: \"D, d M y\", RFC_850: \"DD, dd-M-y\", RFC_1036: \"D, d M y\", RFC_1123: \"D, d M yy\", RFC_2822: \"D, d M yy\", RSS: \"D, d M y\", TICKS: \"!\", TIMESTAMP: \"@\", W3C: \"yy-mm-dd\", _ticksTo1970: 1e7 * 60 * 60 * 24 * (718685 + Math.floor(492.5) - Math.floor(19.7) + Math.floor(4.925)), formatDate: function (t, e, i) { if (!e) return \"\"; var s, n = (i ? i.dayNamesShort : null) || this._defaults.dayNamesShort, o = (i ? i.dayNames : null) || this._defaults.dayNames, a = (i ? i.monthNamesShort : null) || this._defaults.monthNamesShort, r = (i ? i.monthNames : null) || this._defaults.monthNames, l = function (e) { var i = t.length > s + 1 && t.charAt(s + 1) === e; return i && s++, i }, h = function (t, e, i) { var s = \"\" + e; if (l(t)) for (; i > s.length;) s = \"0\" + s; return s }, c = function (t, e, i, s) { return l(t) ? s[e] : i[e] }, u = \"\", d = !1; if (e) for (s = 0; t.length > s; s++) if (d) \"'\" !== t.charAt(s) || l(\"'\") ? u += t.charAt(s) : d = !1; else switch (t.charAt(s)) { case \"d\": u += h(\"d\", e.getDate(), 2); break; case \"D\": u += c(\"D\", e.getDay(), n, o); break; case \"o\": u += h(\"o\", Math.round((new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime() - new Date(e.getFullYear(), 0, 0).getTime()) / 864e5), 3); break; case \"m\": u += h(\"m\", e.getMonth() + 1, 2); break; case \"M\": u += c(\"M\", e.getMonth(), a, r); break; case \"y\": u += l(\"y\") ? e.getFullYear() : (10 > e.getFullYear() % 100 ? \"0\" : \"\") + e.getFullYear() % 100; break; case \"@\": u += e.getTime(); break; case \"!\": u += 1e4 * e.getTime() + this._ticksTo1970; break; case \"'\": l(\"'\") ? u += \"'\" : d = !0; break; default: u += t.charAt(s) } return u }, _possibleChars: function (t) { var e, i = \"\", s = !1, n = function (i) { var s = t.length > e + 1 && t.charAt(e + 1) === i; return s && e++, s }; for (e = 0; t.length > e; e++) if (s) \"'\" !== t.charAt(e) || n(\"'\") ? i += t.charAt(e) : s = !1; else switch (t.charAt(e)) { case \"d\": case \"m\": case \"y\": case \"@\": i += \"0123456789\"; break; case \"D\": case \"M\": return null; case \"'\": n(\"'\") ? i += \"'\" : s = !0; break; default: i += t.charAt(e) } return i }, _get: function (t, e) { return void 0 !== t.settings[e] ? t.settings[e] : this._defaults[e] }, _setDateFromField: function (t, e) { if (t.input.val() !== t.lastVal) { var i = this._get(t, \"dateFormat\"), s = t.lastVal = t.input ? t.input.val() : null, n = this._getDefaultDate(t), o = n, a = this._getFormatConfig(t); try { o = this.parseDate(i, s, a) || n } catch (r) { s = e ? \"\" : s } t.selectedDay = o.getDate(), t.drawMonth = t.selectedMonth = o.getMonth(), t.drawYear = t.selectedYear = o.getFullYear(), t.currentDay = s ? o.getDate() : 0, t.currentMonth = s ? o.getMonth() : 0, t.currentYear = s ? o.getFullYear() : 0, this._adjustInstDate(t) } }, _getDefaultDate: function (t) { return this._restrictMinMax(t, this._determineDate(t, this._get(t, \"defaultDate\"), new Date)) }, _determineDate: function (e, i, s) { var n = function (t) { var e = new Date; return e.setDate(e.getDate() + t), e }, o = function (i) { try { return t.datepicker.parseDate(t.datepicker._get(e, \"dateFormat\"), i, t.datepicker._getFormatConfig(e)) } catch (s) { } for (var n = (i.toLowerCase().match(/^c/) ? t.datepicker._getDate(e) : null) || new Date, o = n.getFullYear(), a = n.getMonth(), r = n.getDate(), l = /([+\\-]?[0-9]+)\\s*(d|D|w|W|m|M|y|Y)?/g, h = l.exec(i) ; h;) { switch (h[2] || \"d\") { case \"d\": case \"D\": r += parseInt(h[1], 10); break; case \"w\": case \"W\": r += 7 * parseInt(h[1], 10); break; case \"m\": case \"M\": a += parseInt(h[1], 10), r = Math.min(r, t.datepicker._getDaysInMonth(o, a)); break; case \"y\": case \"Y\": o += parseInt(h[1], 10), r = Math.min(r, t.datepicker._getDaysInMonth(o, a)) } h = l.exec(i) } return new Date(o, a, r) }, a = null == i || \"\" === i ? s : \"string\" == typeof i ? o(i) : \"number\" == typeof i ? isNaN(i) ? s : n(i) : new Date(i.getTime()); return a = a && \"Invalid Date\" == \"\" + a ? s : a, a && (a.setHours(0), a.setMinutes(0), a.setSeconds(0), a.setMilliseconds(0)), this._daylightSavingAdjust(a) }, _daylightSavingAdjust: function (t) { return t ? (t.setHours(t.getHours() > 12 ? t.getHours() + 2 : 0), t) : null }, _setDate: function (t, e, i) { var s = !e, n = t.selectedMonth, o = t.selectedYear, a = this._restrictMinMax(t, this._determineDate(t, e, new Date)); t.selectedDay = t.currentDay = a.getDate(), t.drawMonth = t.selectedMonth = t.currentMonth = a.getMonth(), t.drawYear = t.selectedYear = t.currentYear = a.getFullYear(), n === t.selectedMonth && o === t.selectedYear || i || this._notifyChange(t), this._adjustInstDate(t), t.input && t.input.val(s ? \"\" : this._formatDate(t)) }, _getDate: function (t) { var e = !t.currentYear || t.input && \"\" === t.input.val() ? null : this._daylightSavingAdjust(new Date(t.currentYear, t.currentMonth, t.currentDay)); return e }, _attachHandlers: function (e) { var i = this._get(e, \"stepMonths\"), s = \"#\" + e.id.replace(/\\\\\\\\/g, \"\\\\\"); e.dpDiv.find(\"[data-handler]\").map(function () { var e = { prev: function () { t.datepicker._adjustDate(s, -i, \"M\") }, next: function () { t.datepicker._adjustDate(s, +i, \"M\") }, hide: function () { t.datepicker._hideDatepicker() }, today: function () { t.datepicker._gotoToday(s) }, selectDay: function () { return t.datepicker._selectDay(s, +this.getAttribute(\"data-month\"), +this.getAttribute(\"data-year\"), this), !1 }, selectMonth: function () { return t.datepicker._selectMonthYear(s, this, \"M\"), !1 }, selectYear: function () { return t.datepicker._selectMonthYear(s, this, \"Y\"), !1 } }; t(this).on(this.getAttribute(\"data-event\"), e[this.getAttribute(\"data-handler\")]) }) }, _generateHTML: function (t) { var e, i, s, n, o, a, r, l, h, c, u, d, p, f, g, m, _, v, b, y, w, k, x, C, D, T, I, M, P, S, N, H, z, A, O, E, W, F, L, R = new Date, Y = this._daylightSavingAdjust(new Date(R.getFullYear(), R.getMonth(), R.getDate())), B = this._get(t, \"isRTL\"), j = this._get(t, \"showButtonPanel\"), q = this._get(t, \"hideIfNoPrevNext\"), K = this._get(t, \"navigationAsDateFormat\"), U = this._getNumberOfMonths(t), V = this._get(t, \"showCurrentAtPos\"), X = this._get(t, \"stepMonths\"), $ = 1 !== U[0] || 1 !== U[1], G = this._daylightSavingAdjust(t.currentDay ? new Date(t.currentYear, t.currentMonth, t.currentDay) : new Date(9999, 9, 9)), J = this._getMinMaxDate(t, \"min\"), Q = this._getMinMaxDate(t, \"max\"), Z = t.drawMonth - V, te = t.drawYear; if (0 > Z && (Z += 12, te--), Q) for (e = this._daylightSavingAdjust(new Date(Q.getFullYear(), Q.getMonth() - U[0] * U[1] + 1, Q.getDate())), e = J && J > e ? J : e; this._daylightSavingAdjust(new Date(te, Z, 1)) > e;) Z--, 0 > Z && (Z = 11, te--); for (t.drawMonth = Z, t.drawYear = te, i = this._get(t, \"prevText\"), i = K ? this.formatDate(i, this._daylightSavingAdjust(new Date(te, Z - X, 1)), this._getFormatConfig(t)) : i, s = this._canAdjustMonth(t, -1, te, Z) ? \"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='\" + i + \"'><span class='ui-icon ui-icon-circle-triangle-\" + (B ? \"e\" : \"w\") + \"'>\" + i + \"</span></a>\" : q ? \"\" : \"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='\" + i + \"'><span class='ui-icon ui-icon-circle-triangle-\" + (B ? \"e\" : \"w\") + \"'>\" + i + \"</span></a>\", n = this._get(t, \"nextText\"), n = K ? this.formatDate(n, this._daylightSavingAdjust(new Date(te, Z + X, 1)), this._getFormatConfig(t)) : n, o = this._canAdjustMonth(t, 1, te, Z) ? \"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='\" + n + \"'><span class='ui-icon ui-icon-circle-triangle-\" + (B ? \"w\" : \"e\") + \"'>\" + n + \"</span></a>\" : q ? \"\" : \"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='\" + n + \"'><span class='ui-icon ui-icon-circle-triangle-\" + (B ? \"w\" : \"e\") + \"'>\" + n + \"</span></a>\", a = this._get(t, \"currentText\"), r = this._get(t, \"gotoCurrent\") && t.currentDay ? G : Y, a = K ? this.formatDate(a, r, this._getFormatConfig(t)) : a, l = t.inline ? \"\" : \"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>\" + this._get(t, \"closeText\") + \"</button>\", h = j ? \"<div class='ui-datepicker-buttonpane ui-widget-content'>\" + (B ? l : \"\") + (this._isInRange(t, r) ? \"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>\" + a + \"</button>\" : \"\") + (B ? \"\" : l) + \"</div>\" : \"\", c = parseInt(this._get(t, \"firstDay\"), 10), c = isNaN(c) ? 0 : c, u = this._get(t, \"showWeek\"), d = this._get(t, \"dayNames\"), p = this._get(t, \"dayNamesMin\"), f = this._get(t, \"monthNames\"), g = this._get(t, \"monthNamesShort\"), m = this._get(t, \"beforeShowDay\"), _ = this._get(t, \"showOtherMonths\"), v = this._get(t, \"selectOtherMonths\"), b = this._getDefaultDate(t), y = \"\", k = 0; U[0] > k; k++) { for (x = \"\", this.maxRows = 4, C = 0; U[1] > C; C++) { if (D = this._daylightSavingAdjust(new Date(te, Z, t.selectedDay)), T = \" ui-corner-all\", I = \"\", $) { if (I += \"<div class='ui-datepicker-group\", U[1] > 1) switch (C) { case 0: I += \" ui-datepicker-group-first\", T = \" ui-corner-\" + (B ? \"right\" : \"left\"); break; case U[1] - 1: I += \" ui-datepicker-group-last\", T = \" ui-corner-\" + (B ? \"left\" : \"right\"); break; default: I += \" ui-datepicker-group-middle\", T = \"\" } I += \"'>\" } for (I += \"<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix\" + T + \"'>\" + (/all|left/.test(T) && 0 === k ? B ? o : s : \"\") + (/all|right/.test(T) && 0 === k ? B ? s : o : \"\") + this._generateMonthYearHeader(t, Z, te, J, Q, k > 0 || C > 0, f, g) + \"</div><table class='ui-datepicker-calendar'><thead>\" + \"<tr>\", M = u ? \"<th class='ui-datepicker-week-col'>\" + this._get(t, \"weekHeader\") + \"</th>\" : \"\", w = 0; 7 > w; w++) P = (w + c) % 7, M += \"<th scope='col'\" + ((w + c + 6) % 7 >= 5 ? \" class='ui-datepicker-week-end'\" : \"\") + \">\" + \"<span title='\" + d[P] + \"'>\" + p[P] + \"</span></th>\"; for (I += M + \"</tr></thead><tbody>\", S = this._getDaysInMonth(te, Z), te === t.selectedYear && Z === t.selectedMonth && (t.selectedDay = Math.min(t.selectedDay, S)), N = (this._getFirstDayOfMonth(te, Z) - c + 7) % 7, H = Math.ceil((N + S) / 7), z = $ ? this.maxRows > H ? this.maxRows : H : H, this.maxRows = z, A = this._daylightSavingAdjust(new Date(te, Z, 1 - N)), O = 0; z > O; O++) { for (I += \"<tr>\", E = u ? \"<td class='ui-datepicker-week-col'>\" + this._get(t, \"calculateWeek\")(A) + \"</td>\" : \"\", w = 0; 7 > w; w++) W = m ? m.apply(t.input ? t.input[0] : null, [A]) : [!0, \"\"], F = A.getMonth() !== Z, L = F && !v || !W[0] || J && J > A || Q && A > Q, E += \"<td class='\" + ((w + c + 6) % 7 >= 5 ? \" ui-datepicker-week-end\" : \"\") + (F ? \" ui-datepicker-other-month\" : \"\") + (A.getTime() === D.getTime() && Z === t.selectedMonth && t._keyEvent || b.getTime() === A.getTime() && b.getTime() === D.getTime() ? \" \" + this._dayOverClass : \"\") + (L ? \" \" + this._unselectableClass + \" ui-state-disabled\" : \"\") + (F && !_ ? \"\" : \" \" + W[1] + (A.getTime() === G.getTime() ? \" \" + this._currentClass : \"\") + (A.getTime() === Y.getTime() ? \" ui-datepicker-today\" : \"\")) + \"'\" + (F && !_ || !W[2] ? \"\" : \" title='\" + W[2].replace(/'/g, \"'\") + \"'\") + (L ? \"\" : \" data-handler='selectDay' data-event='click' data-month='\" + A.getMonth() + \"' data-year='\" + A.getFullYear() + \"'\") + \">\" + (F && !_ ? \" \" : L ? \"<span class='ui-state-default'>\" + A.getDate() + \"</span>\" : \"<a class='ui-state-default\" + (A.getTime() === Y.getTime() ? \" ui-state-highlight\" : \"\") + (A.getTime() === G.getTime() ? \" ui-state-active\" : \"\") + (F ? \" ui-priority-secondary\" : \"\") + \"' href='#'>\" + A.getDate() + \"</a>\") + \"</td>\", A.setDate(A.getDate() + 1), A = this._daylightSavingAdjust(A); I += E + \"</tr>\" } Z++, Z > 11 && (Z = 0, te++), I += \"</tbody></table>\" + ($ ? \"</div>\" + (U[0] > 0 && C === U[1] - 1 ? \"<div class='ui-datepicker-row-break'></div>\" : \"\") : \"\"), x += I } y += x } return y += h, t._keyEvent = !1, y }, _generateMonthYearHeader: function (t, e, i, s, n, o, a, r) { var l, h, c, u, d, p, f, g, m = this._get(t, \"changeMonth\"), _ = this._get(t, \"changeYear\"), v = this._get(t, \"showMonthAfterYear\"), b = \"<div class='ui-datepicker-title'>\", y = \"\"; if (o || !m) y += \"<span class='ui-datepicker-month'>\" + a[e] + \"</span>\"; else { for (l = s && s.getFullYear() === i, h = n && n.getFullYear() === i, y += \"<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>\", c = 0; 12 > c; c++) (!l || c >= s.getMonth()) && (!h || n.getMonth() >= c) && (y += \"<option value='\" + c + \"'\" + (c === e ? \" selected='selected'\" : \"\") + \">\" + r[c] + \"</option>\"); y += \"</select>\" } if (v || (b += y + (!o && m && _ ? \"\" : \" \")), !t.yearshtml) if (t.yearshtml = \"\", o || !_) b += \"<span class='ui-datepicker-year'>\" + i + \"</span>\"; else { for (u = this._get(t, \"yearRange\").split(\":\"), d = (new Date).getFullYear(), p = function (t) { var e = t.match(/c[+\\-].*/) ? i + parseInt(t.substring(1), 10) : t.match(/[+\\-].*/) ? d + parseInt(t, 10) : parseInt(t, 10); return isNaN(e) ? d : e }, f = p(u[0]), g = Math.max(f, p(u[1] || \"\")), f = s ? Math.max(f, s.getFullYear()) : f, g = n ? Math.min(g, n.getFullYear()) : g, t.yearshtml += \"<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>\"; g >= f; f++) t.yearshtml += \"<option value='\" + f + \"'\" + (f === i ? \" selected='selected'\" : \"\") + \">\" + f + \"</option>\"; t.yearshtml += \"</select>\", b += t.yearshtml, t.yearshtml = null } return b += this._get(t, \"yearSuffix\"), v && (b += (!o && m && _ ? \"\" : \" \") + y), b += \"</div>\" }, _adjustInstDate: function (t, e, i) { var s = t.selectedYear + (\"Y\" === i ? e : 0), n = t.selectedMonth + (\"M\" === i ? e : 0), o = Math.min(t.selectedDay, this._getDaysInMonth(s, n)) + (\"D\" === i ? e : 0), a = this._restrictMinMax(t, this._daylightSavingAdjust(new Date(s, n, o))); t.selectedDay = a.getDate(), t.drawMonth = t.selectedMonth = a.getMonth(), t.drawYear = t.selectedYear = a.getFullYear(), (\"M\" === i || \"Y\" === i) && this._notifyChange(t) }, _restrictMinMax: function (t, e) { var i = this._getMinMaxDate(t, \"min\"), s = this._getMinMaxDate(t, \"max\"), n = i && i > e ? i : e; return s && n > s ? s : n }, _notifyChange: function (t) { var e = this._get(t, \"onChangeMonthYear\"); e && e.apply(t.input ? t.input[0] : null, [t.selectedYear, t.selectedMonth + 1, t]) }, _getNumberOfMonths: function (t) { var e = this._get(t, \"numberOfMonths\"); return null == e ? [1, 1] : \"number\" == typeof e ? [1, e] : e }, _getMinMaxDate: function (t, e) { return this._determineDate(t, this._get(t, e + \"Date\"), null) }, _getDaysInMonth: function (t, e) { return 32 - this._daylightSavingAdjust(new Date(t, e, 32)).getDate() }, _getFirstDayOfMonth: function (t, e) { return new Date(t, e, 1).getDay() }, _canAdjustMonth: function (t, e, i, s) { var n = this._getNumberOfMonths(t), o = this._daylightSavingAdjust(new Date(i, s + (0 > e ? e : n[0] * n[1]), 1)); return 0 > e && o.setDate(this._getDaysInMonth(o.getFullYear(), o.getMonth())), this._isInRange(t, o) }, _isInRange: function (t, e) { var i, s, n = this._getMinMaxDate(t, \"min\"), o = this._getMinMaxDate(t, \"max\"), a = null, r = null, l = this._get(t, \"yearRange\"); return l && (i = l.split(\":\"), s = (new Date).getFullYear(), a = parseInt(i[0], 10), r = parseInt(i[1], 10), i[0].match(/[+\\-].*/) && (a += s), i[1].match(/[+\\-].*/) && (r += s)), (!n || e.getTime() >= n.getTime()) && (!o || e.getTime() <= o.getTime()) && (!a || e.getFullYear() >= a) && (!r || r >= e.getFullYear()) }, _getFormatConfig: function (t) { var e = this._get(t, \"shortYearCutoff\"); return e = \"string\" != typeof e ? e : (new Date).getFullYear() % 100 + parseInt(e, 10), { shortYearCutoff: e, dayNamesShort: this._get(t, \"dayNamesShort\"), dayNames: this._get(t, \"dayNames\"), monthNamesShort: this._get(t, \"monthNamesShort\"), monthNames: this._get(t, \"monthNames\") } }, _formatDate: function (t, e, i, s) { e || (t.currentDay = t.selectedDay, t.currentMonth = t.selectedMonth, t.currentYear = t.selectedYear); var n = e ? \"object\" == typeof e ? e : this._daylightSavingAdjust(new Date(s, i, e)) : this._daylightSavingAdjust(new Date(t.currentYear, t.currentMonth, t.currentDay)); return this.formatDate(this._get(t, \"dateFormat\"), n, this._getFormatConfig(t)) }\n }), t.fn.datepicker = function (e) { if (!this.length) return this; t.datepicker.initialized || (t(document).on(\"mousedown\", t.datepicker._checkExternalClick), t.datepicker.initialized = !0), 0 === t(\"#\" + t.datepicker._mainDivId).length && t(\"body\").append(t.datepicker.dpDiv); var i = Array.prototype.slice.call(arguments, 1); return \"string\" != typeof e || \"isDisabled\" !== e && \"getDate\" !== e && \"widget\" !== e ? \"option\" === e && 2 === arguments.length && \"string\" == typeof arguments[1] ? t.datepicker[\"_\" + e + \"Datepicker\"].apply(t.datepicker, [this[0]].concat(i)) : this.each(function () { \"string\" == typeof e ? t.datepicker[\"_\" + e + \"Datepicker\"].apply(t.datepicker, [this].concat(i)) : t.datepicker._attachDatepicker(this, e) }) : t.datepicker[\"_\" + e + \"Datepicker\"].apply(t.datepicker, [this[0]].concat(i)) }, t.datepicker = new s, t.datepicker.initialized = !1, t.datepicker.uuid = (new Date).getTime(), t.datepicker.version = \"1.12.1\", t.datepicker; var d = \"ui-effects-\", p = \"ui-effects-style\", f = \"ui-effects-animated\", g = t; t.effects = { effect: {} }, function (t, e) {\n function i(t, e, i) { var s = u[e.type] || {}; return null == t ? i || !e.def ? null : e.def : (t = s.floor ? ~~t : parseFloat(t), isNaN(t) ? e.def : s.mod ? (t + s.mod) % s.mod : 0 > t ? 0 : t > s.max ? s.max : t) } function s(i) { var s = h(), n = s._rgba = []; return i = i.toLowerCase(), f(l, function (t, o) { var a, r = o.re.exec(i), l = r && o.parse(r), h = o.space || \"rgba\"; return l ? (a = s[h](l), s[c[h].cache] = a[c[h].cache], n = s._rgba = a._rgba, !1) : e }), n.length ? (\"0,0,0,0\" === n.join() && t.extend(n, o.transparent), s) : o[i] } function n(t, e, i) { return i = (i + 1) % 1, 1 > 6 * i ? t + 6 * (e - t) * i : 1 > 2 * i ? e : 2 > 3 * i ? t + 6 * (e - t) * (2 / 3 - i) : t } var o, a = \"backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor\", r = /^([\\-+])=\\s*(\\d+\\.?\\d*)/, l = [{ re: /rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/, parse: function (t) { return [t[1], t[2], t[3], t[4]] } }, {\n re: /rgba?\\(\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/, parse: function (t) {\n return [2.55 * t[1], 2.55 * t[2], 2.55 * t[3], t[4]]\n }\n }, { re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, parse: function (t) { return [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16)] } }, { re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, parse: function (t) { return [parseInt(t[1] + t[1], 16), parseInt(t[2] + t[2], 16), parseInt(t[3] + t[3], 16)] } }, { re: /hsla?\\(\\s*(\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/, space: \"hsla\", parse: function (t) { return [t[1], t[2] / 100, t[3] / 100, t[4]] } }], h = t.Color = function (e, i, s, n) { return new t.Color.fn.parse(e, i, s, n) }, c = { rgba: { props: { red: { idx: 0, type: \"byte\" }, green: { idx: 1, type: \"byte\" }, blue: { idx: 2, type: \"byte\" } } }, hsla: { props: { hue: { idx: 0, type: \"degrees\" }, saturation: { idx: 1, type: \"percent\" }, lightness: { idx: 2, type: \"percent\" } } } }, u = { \"byte\": { floor: !0, max: 255 }, percent: { max: 1 }, degrees: { mod: 360, floor: !0 } }, d = h.support = {}, p = t(\"<p>\")[0], f = t.each; p.style.cssText = \"background-color:rgba(1,1,1,.5)\", d.rgba = p.style.backgroundColor.indexOf(\"rgba\") > -1, f(c, function (t, e) { e.cache = \"_\" + t, e.props.alpha = { idx: 3, type: \"percent\", def: 1 } }), h.fn = t.extend(h.prototype, { parse: function (n, a, r, l) { if (n === e) return this._rgba = [null, null, null, null], this; (n.jquery || n.nodeType) && (n = t(n).css(a), a = e); var u = this, d = t.type(n), p = this._rgba = []; return a !== e && (n = [n, a, r, l], d = \"array\"), \"string\" === d ? this.parse(s(n) || o._default) : \"array\" === d ? (f(c.rgba.props, function (t, e) { p[e.idx] = i(n[e.idx], e) }), this) : \"object\" === d ? (n instanceof h ? f(c, function (t, e) { n[e.cache] && (u[e.cache] = n[e.cache].slice()) }) : f(c, function (e, s) { var o = s.cache; f(s.props, function (t, e) { if (!u[o] && s.to) { if (\"alpha\" === t || null == n[t]) return; u[o] = s.to(u._rgba) } u[o][e.idx] = i(n[t], e, !0) }), u[o] && 0 > t.inArray(null, u[o].slice(0, 3)) && (u[o][3] = 1, s.from && (u._rgba = s.from(u[o]))) }), this) : e }, is: function (t) { var i = h(t), s = !0, n = this; return f(c, function (t, o) { var a, r = i[o.cache]; return r && (a = n[o.cache] || o.to && o.to(n._rgba) || [], f(o.props, function (t, i) { return null != r[i.idx] ? s = r[i.idx] === a[i.idx] : e })), s }), s }, _space: function () { var t = [], e = this; return f(c, function (i, s) { e[s.cache] && t.push(i) }), t.pop() }, transition: function (t, e) { var s = h(t), n = s._space(), o = c[n], a = 0 === this.alpha() ? h(\"transparent\") : this, r = a[o.cache] || o.to(a._rgba), l = r.slice(); return s = s[o.cache], f(o.props, function (t, n) { var o = n.idx, a = r[o], h = s[o], c = u[n.type] || {}; null !== h && (null === a ? l[o] = h : (c.mod && (h - a > c.mod / 2 ? a += c.mod : a - h > c.mod / 2 && (a -= c.mod)), l[o] = i((h - a) * e + a, n))) }), this[n](l) }, blend: function (e) { if (1 === this._rgba[3]) return this; var i = this._rgba.slice(), s = i.pop(), n = h(e)._rgba; return h(t.map(i, function (t, e) { return (1 - s) * n[e] + s * t })) }, toRgbaString: function () { var e = \"rgba(\", i = t.map(this._rgba, function (t, e) { return null == t ? e > 2 ? 1 : 0 : t }); return 1 === i[3] && (i.pop(), e = \"rgb(\"), e + i.join() + \")\" }, toHslaString: function () { var e = \"hsla(\", i = t.map(this.hsla(), function (t, e) { return null == t && (t = e > 2 ? 1 : 0), e && 3 > e && (t = Math.round(100 * t) + \"%\"), t }); return 1 === i[3] && (i.pop(), e = \"hsl(\"), e + i.join() + \")\" }, toHexString: function (e) { var i = this._rgba.slice(), s = i.pop(); return e && i.push(~~(255 * s)), \"#\" + t.map(i, function (t) { return t = (t || 0).toString(16), 1 === t.length ? \"0\" + t : t }).join(\"\") }, toString: function () { return 0 === this._rgba[3] ? \"transparent\" : this.toRgbaString() } }), h.fn.parse.prototype = h.fn, c.hsla.to = function (t) { if (null == t[0] || null == t[1] || null == t[2]) return [null, null, null, t[3]]; var e, i, s = t[0] / 255, n = t[1] / 255, o = t[2] / 255, a = t[3], r = Math.max(s, n, o), l = Math.min(s, n, o), h = r - l, c = r + l, u = .5 * c; return e = l === r ? 0 : s === r ? 60 * (n - o) / h + 360 : n === r ? 60 * (o - s) / h + 120 : 60 * (s - n) / h + 240, i = 0 === h ? 0 : .5 >= u ? h / c : h / (2 - c), [Math.round(e) % 360, i, u, null == a ? 1 : a] }, c.hsla.from = function (t) { if (null == t[0] || null == t[1] || null == t[2]) return [null, null, null, t[3]]; var e = t[0] / 360, i = t[1], s = t[2], o = t[3], a = .5 >= s ? s * (1 + i) : s + i - s * i, r = 2 * s - a; return [Math.round(255 * n(r, a, e + 1 / 3)), Math.round(255 * n(r, a, e)), Math.round(255 * n(r, a, e - 1 / 3)), o] }, f(c, function (s, n) { var o = n.props, a = n.cache, l = n.to, c = n.from; h.fn[s] = function (s) { if (l && !this[a] && (this[a] = l(this._rgba)), s === e) return this[a].slice(); var n, r = t.type(s), u = \"array\" === r || \"object\" === r ? s : arguments, d = this[a].slice(); return f(o, function (t, e) { var s = u[\"object\" === r ? t : e.idx]; null == s && (s = d[e.idx]), d[e.idx] = i(s, e) }), c ? (n = h(c(d)), n[a] = d, n) : h(d) }, f(o, function (e, i) { h.fn[e] || (h.fn[e] = function (n) { var o, a = t.type(n), l = \"alpha\" === e ? this._hsla ? \"hsla\" : \"rgba\" : s, h = this[l](), c = h[i.idx]; return \"undefined\" === a ? c : (\"function\" === a && (n = n.call(this, c), a = t.type(n)), null == n && i.empty ? this : (\"string\" === a && (o = r.exec(n), o && (n = c + parseFloat(o[2]) * (\"+\" === o[1] ? 1 : -1))), h[i.idx] = n, this[l](h))) }) }) }), h.hook = function (e) { var i = e.split(\" \"); f(i, function (e, i) { t.cssHooks[i] = { set: function (e, n) { var o, a, r = \"\"; if (\"transparent\" !== n && (\"string\" !== t.type(n) || (o = s(n)))) { if (n = h(o || n), !d.rgba && 1 !== n._rgba[3]) { for (a = \"backgroundColor\" === i ? e.parentNode : e; (\"\" === r || \"transparent\" === r) && a && a.style;) try { r = t.css(a, \"backgroundColor\"), a = a.parentNode } catch (l) { } n = n.blend(r && \"transparent\" !== r ? r : \"_default\") } n = n.toRgbaString() } try { e.style[i] = n } catch (l) { } } }, t.fx.step[i] = function (e) { e.colorInit || (e.start = h(e.elem, i), e.end = h(e.end), e.colorInit = !0), t.cssHooks[i].set(e.elem, e.start.transition(e.end, e.pos)) } }) }, h.hook(a), t.cssHooks.borderColor = { expand: function (t) { var e = {}; return f([\"Top\", \"Right\", \"Bottom\", \"Left\"], function (i, s) { e[\"border\" + s + \"Color\"] = t }), e } }, o = t.Color.names = { aqua: \"#00ffff\", black: \"#000000\", blue: \"#0000ff\", fuchsia: \"#ff00ff\", gray: \"#808080\", green: \"#008000\", lime: \"#00ff00\", maroon: \"#800000\", navy: \"#000080\", olive: \"#808000\", purple: \"#800080\", red: \"#ff0000\", silver: \"#c0c0c0\", teal: \"#008080\", white: \"#ffffff\", yellow: \"#ffff00\", transparent: [null, null, null, 0], _default: \"#ffffff\" }\n }(g), function () { function e(e) { var i, s, n = e.ownerDocument.defaultView ? e.ownerDocument.defaultView.getComputedStyle(e, null) : e.currentStyle, o = {}; if (n && n.length && n[0] && n[n[0]]) for (s = n.length; s--;) i = n[s], \"string\" == typeof n[i] && (o[t.camelCase(i)] = n[i]); else for (i in n) \"string\" == typeof n[i] && (o[i] = n[i]); return o } function i(e, i) { var s, o, a = {}; for (s in i) o = i[s], e[s] !== o && (n[s] || (t.fx.step[s] || !isNaN(parseFloat(o))) && (a[s] = o)); return a } var s = [\"add\", \"remove\", \"toggle\"], n = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; t.each([\"borderLeftStyle\", \"borderRightStyle\", \"borderBottomStyle\", \"borderTopStyle\"], function (e, i) { t.fx.step[i] = function (t) { (\"none\" !== t.end && !t.setAttr || 1 === t.pos && !t.setAttr) && (g.style(t.elem, i, t.end), t.setAttr = !0) } }), t.fn.addBack || (t.fn.addBack = function (t) { return this.add(null == t ? this.prevObject : this.prevObject.filter(t)) }), t.effects.animateClass = function (n, o, a, r) { var l = t.speed(o, a, r); return this.queue(function () { var o, a = t(this), r = a.attr(\"class\") || \"\", h = l.children ? a.find(\"*\").addBack() : a; h = h.map(function () { var i = t(this); return { el: i, start: e(this) } }), o = function () { t.each(s, function (t, e) { n[e] && a[e + \"Class\"](n[e]) }) }, o(), h = h.map(function () { return this.end = e(this.el[0]), this.diff = i(this.start, this.end), this }), a.attr(\"class\", r), h = h.map(function () { var e = this, i = t.Deferred(), s = t.extend({}, l, { queue: !1, complete: function () { i.resolve(e) } }); return this.el.animate(this.diff, s), i.promise() }), t.when.apply(t, h.get()).done(function () { o(), t.each(arguments, function () { var e = this.el; t.each(this.diff, function (t) { e.css(t, \"\") }) }), l.complete.call(a[0]) }) }) }, t.fn.extend({ addClass: function (e) { return function (i, s, n, o) { return s ? t.effects.animateClass.call(this, { add: i }, s, n, o) : e.apply(this, arguments) } }(t.fn.addClass), removeClass: function (e) { return function (i, s, n, o) { return arguments.length > 1 ? t.effects.animateClass.call(this, { remove: i }, s, n, o) : e.apply(this, arguments) } }(t.fn.removeClass), toggleClass: function (e) { return function (i, s, n, o, a) { return \"boolean\" == typeof s || void 0 === s ? n ? t.effects.animateClass.call(this, s ? { add: i } : { remove: i }, n, o, a) : e.apply(this, arguments) : t.effects.animateClass.call(this, { toggle: i }, s, n, o) } }(t.fn.toggleClass), switchClass: function (e, i, s, n, o) { return t.effects.animateClass.call(this, { add: i, remove: e }, s, n, o) } }) }(), function () { function e(e, i, s, n) { return t.isPlainObject(e) && (i = e, e = e.effect), e = { effect: e }, null == i && (i = {}), t.isFunction(i) && (n = i, s = null, i = {}), (\"number\" == typeof i || t.fx.speeds[i]) && (n = s, s = i, i = {}), t.isFunction(s) && (n = s, s = null), i && t.extend(e, i), s = s || i.duration, e.duration = t.fx.off ? 0 : \"number\" == typeof s ? s : s in t.fx.speeds ? t.fx.speeds[s] : t.fx.speeds._default, e.complete = n || i.complete, e } function i(e) { return !e || \"number\" == typeof e || t.fx.speeds[e] ? !0 : \"string\" != typeof e || t.effects.effect[e] ? t.isFunction(e) ? !0 : \"object\" != typeof e || e.effect ? !1 : !0 : !0 } function s(t, e) { var i = e.outerWidth(), s = e.outerHeight(), n = /^rect\\((-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto)\\)$/, o = n.exec(t) || [\"\", 0, i, s, 0]; return { top: parseFloat(o[1]) || 0, right: \"auto\" === o[2] ? i : parseFloat(o[2]), bottom: \"auto\" === o[3] ? s : parseFloat(o[3]), left: parseFloat(o[4]) || 0 } } t.expr && t.expr.filters && t.expr.filters.animated && (t.expr.filters.animated = function (e) { return function (i) { return !!t(i).data(f) || e(i) } }(t.expr.filters.animated)), t.uiBackCompat !== !1 && t.extend(t.effects, { save: function (t, e) { for (var i = 0, s = e.length; s > i; i++) null !== e[i] && t.data(d + e[i], t[0].style[e[i]]) }, restore: function (t, e) { for (var i, s = 0, n = e.length; n > s; s++) null !== e[s] && (i = t.data(d + e[s]), t.css(e[s], i)) }, setMode: function (t, e) { return \"toggle\" === e && (e = t.is(\":hidden\") ? \"show\" : \"hide\"), e }, createWrapper: function (e) { if (e.parent().is(\".ui-effects-wrapper\")) return e.parent(); var i = { width: e.outerWidth(!0), height: e.outerHeight(!0), \"float\": e.css(\"float\") }, s = t(\"<div></div>\").addClass(\"ui-effects-wrapper\").css({ fontSize: \"100%\", background: \"transparent\", border: \"none\", margin: 0, padding: 0 }), n = { width: e.width(), height: e.height() }, o = document.activeElement; try { o.id } catch (a) { o = document.body } return e.wrap(s), (e[0] === o || t.contains(e[0], o)) && t(o).trigger(\"focus\"), s = e.parent(), \"static\" === e.css(\"position\") ? (s.css({ position: \"relative\" }), e.css({ position: \"relative\" })) : (t.extend(i, { position: e.css(\"position\"), zIndex: e.css(\"z-index\") }), t.each([\"top\", \"left\", \"bottom\", \"right\"], function (t, s) { i[s] = e.css(s), isNaN(parseInt(i[s], 10)) && (i[s] = \"auto\") }), e.css({ position: \"relative\", top: 0, left: 0, right: \"auto\", bottom: \"auto\" })), e.css(n), s.css(i).show() }, removeWrapper: function (e) { var i = document.activeElement; return e.parent().is(\".ui-effects-wrapper\") && (e.parent().replaceWith(e), (e[0] === i || t.contains(e[0], i)) && t(i).trigger(\"focus\")), e } }), t.extend(t.effects, { version: \"1.12.1\", define: function (e, i, s) { return s || (s = i, i = \"effect\"), t.effects.effect[e] = s, t.effects.effect[e].mode = i, s }, scaledDimensions: function (t, e, i) { if (0 === e) return { height: 0, width: 0, outerHeight: 0, outerWidth: 0 }; var s = \"horizontal\" !== i ? (e || 100) / 100 : 1, n = \"vertical\" !== i ? (e || 100) / 100 : 1; return { height: t.height() * n, width: t.width() * s, outerHeight: t.outerHeight() * n, outerWidth: t.outerWidth() * s } }, clipToBox: function (t) { return { width: t.clip.right - t.clip.left, height: t.clip.bottom - t.clip.top, left: t.clip.left, top: t.clip.top } }, unshift: function (t, e, i) { var s = t.queue(); e > 1 && s.splice.apply(s, [1, 0].concat(s.splice(e, i))), t.dequeue() }, saveStyle: function (t) { t.data(p, t[0].style.cssText) }, restoreStyle: function (t) { t[0].style.cssText = t.data(p) || \"\", t.removeData(p) }, mode: function (t, e) { var i = t.is(\":hidden\"); return \"toggle\" === e && (e = i ? \"show\" : \"hide\"), (i ? \"hide\" === e : \"show\" === e) && (e = \"none\"), e }, getBaseline: function (t, e) { var i, s; switch (t[0]) { case \"top\": i = 0; break; case \"middle\": i = .5; break; case \"bottom\": i = 1; break; default: i = t[0] / e.height } switch (t[1]) { case \"left\": s = 0; break; case \"center\": s = .5; break; case \"right\": s = 1; break; default: s = t[1] / e.width } return { x: s, y: i } }, createPlaceholder: function (e) { var i, s = e.css(\"position\"), n = e.position(); return e.css({ marginTop: e.css(\"marginTop\"), marginBottom: e.css(\"marginBottom\"), marginLeft: e.css(\"marginLeft\"), marginRight: e.css(\"marginRight\") }).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()), /^(static|relative)/.test(s) && (s = \"absolute\", i = t(\"<\" + e[0].nodeName + \">\").insertAfter(e).css({ display: /^(inline|ruby)/.test(e.css(\"display\")) ? \"inline-block\" : \"block\", visibility: \"hidden\", marginTop: e.css(\"marginTop\"), marginBottom: e.css(\"marginBottom\"), marginLeft: e.css(\"marginLeft\"), marginRight: e.css(\"marginRight\"), \"float\": e.css(\"float\") }).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass(\"ui-effects-placeholder\"), e.data(d + \"placeholder\", i)), e.css({ position: s, left: n.left, top: n.top }), i }, removePlaceholder: function (t) { var e = d + \"placeholder\", i = t.data(e); i && (i.remove(), t.removeData(e)) }, cleanUp: function (e) { t.effects.restoreStyle(e), t.effects.removePlaceholder(e) }, setTransition: function (e, i, s, n) { return n = n || {}, t.each(i, function (t, i) { var o = e.cssUnit(i); o[0] > 0 && (n[i] = o[0] * s + o[1]) }), n } }), t.fn.extend({ effect: function () { function i(e) { function i() { r.removeData(f), t.effects.cleanUp(r), \"hide\" === s.mode && r.hide(), a() } function a() { t.isFunction(l) && l.call(r[0]), t.isFunction(e) && e() } var r = t(this); s.mode = c.shift(), t.uiBackCompat === !1 || o ? \"none\" === s.mode ? (r[h](), a()) : n.call(r[0], s, i) : (r.is(\":hidden\") ? \"hide\" === h : \"show\" === h) ? (r[h](), a()) : n.call(r[0], s, a) } var s = e.apply(this, arguments), n = t.effects.effect[s.effect], o = n.mode, a = s.queue, r = a || \"fx\", l = s.complete, h = s.mode, c = [], u = function (e) { var i = t(this), s = t.effects.mode(i, h) || o; i.data(f, !0), c.push(s), o && (\"show\" === s || s === o && \"hide\" === s) && i.show(), o && \"none\" === s || t.effects.saveStyle(i), t.isFunction(e) && e() }; return t.fx.off || !n ? h ? this[h](s.duration, l) : this.each(function () { l && l.call(this) }) : a === !1 ? this.each(u).each(i) : this.queue(r, u).queue(r, i) }, show: function (t) { return function (s) { if (i(s)) return t.apply(this, arguments); var n = e.apply(this, arguments); return n.mode = \"show\", this.effect.call(this, n) } }(t.fn.show), hide: function (t) { return function (s) { if (i(s)) return t.apply(this, arguments); var n = e.apply(this, arguments); return n.mode = \"hide\", this.effect.call(this, n) } }(t.fn.hide), toggle: function (t) { return function (s) { if (i(s) || \"boolean\" == typeof s) return t.apply(this, arguments); var n = e.apply(this, arguments); return n.mode = \"toggle\", this.effect.call(this, n) } }(t.fn.toggle), cssUnit: function (e) { var i = this.css(e), s = []; return t.each([\"em\", \"px\", \"%\", \"pt\"], function (t, e) { i.indexOf(e) > 0 && (s = [parseFloat(i), e]) }), s }, cssClip: function (t) { return t ? this.css(\"clip\", \"rect(\" + t.top + \"px \" + t.right + \"px \" + t.bottom + \"px \" + t.left + \"px)\") : s(this.css(\"clip\"), this) }, transfer: function (e, i) { var s = t(this), n = t(e.to), o = \"fixed\" === n.css(\"position\"), a = t(\"body\"), r = o ? a.scrollTop() : 0, l = o ? a.scrollLeft() : 0, h = n.offset(), c = { top: h.top - r, left: h.left - l, height: n.innerHeight(), width: n.innerWidth() }, u = s.offset(), d = t(\"<div class='ui-effects-transfer'></div>\").appendTo(\"body\").addClass(e.className).css({ top: u.top - r, left: u.left - l, height: s.innerHeight(), width: s.innerWidth(), position: o ? \"fixed\" : \"absolute\" }).animate(c, e.duration, e.easing, function () { d.remove(), t.isFunction(i) && i() }) } }), t.fx.step.clip = function (e) { e.clipInit || (e.start = t(e.elem).cssClip(), \"string\" == typeof e.end && (e.end = s(e.end, e.elem)), e.clipInit = !0), t(e.elem).cssClip({ top: e.pos * (e.end.top - e.start.top) + e.start.top, right: e.pos * (e.end.right - e.start.right) + e.start.right, bottom: e.pos * (e.end.bottom - e.start.bottom) + e.start.bottom, left: e.pos * (e.end.left - e.start.left) + e.start.left }) } }(), function () { var e = {}; t.each([\"Quad\", \"Cubic\", \"Quart\", \"Quint\", \"Expo\"], function (t, i) { e[i] = function (e) { return Math.pow(e, t + 2) } }), t.extend(e, { Sine: function (t) { return 1 - Math.cos(t * Math.PI / 2) }, Circ: function (t) { return 1 - Math.sqrt(1 - t * t) }, Elastic: function (t) { return 0 === t || 1 === t ? t : -Math.pow(2, 8 * (t - 1)) * Math.sin((80 * (t - 1) - 7.5) * Math.PI / 15) }, Back: function (t) { return t * t * (3 * t - 2) }, Bounce: function (t) { for (var e, i = 4; ((e = Math.pow(2, --i)) - 1) / 11 > t;); return 1 / Math.pow(4, 3 - i) - 7.5625 * Math.pow((3 * e - 2) / 22 - t, 2) } }), t.each(e, function (e, i) { t.easing[\"easeIn\" + e] = i, t.easing[\"easeOut\" + e] = function (t) { return 1 - i(1 - t) }, t.easing[\"easeInOut\" + e] = function (t) { return .5 > t ? i(2 * t) / 2 : 1 - i(-2 * t + 2) / 2 } }) }(); var m = t.effects; t.effects.define(\"blind\", \"hide\", function (e, i) { var s = { up: [\"bottom\", \"top\"], vertical: [\"bottom\", \"top\"], down: [\"top\", \"bottom\"], left: [\"right\", \"left\"], horizontal: [\"right\", \"left\"], right: [\"left\", \"right\"] }, n = t(this), o = e.direction || \"up\", a = n.cssClip(), r = { clip: t.extend({}, a) }, l = t.effects.createPlaceholder(n); r.clip[s[o][0]] = r.clip[s[o][1]], \"show\" === e.mode && (n.cssClip(r.clip), l && l.css(t.effects.clipToBox(r)), r.clip = a), l && l.animate(t.effects.clipToBox(r), e.duration, e.easing), n.animate(r, { queue: !1, duration: e.duration, easing: e.easing, complete: i }) }), t.effects.define(\"bounce\", function (e, i) { var s, n, o, a = t(this), r = e.mode, l = \"hide\" === r, h = \"show\" === r, c = e.direction || \"up\", u = e.distance, d = e.times || 5, p = 2 * d + (h || l ? 1 : 0), f = e.duration / p, g = e.easing, m = \"up\" === c || \"down\" === c ? \"top\" : \"left\", _ = \"up\" === c || \"left\" === c, v = 0, b = a.queue().length; for (t.effects.createPlaceholder(a), o = a.css(m), u || (u = a[\"top\" === m ? \"outerHeight\" : \"outerWidth\"]() / 3), h && (n = { opacity: 1 }, n[m] = o, a.css(\"opacity\", 0).css(m, _ ? 2 * -u : 2 * u).animate(n, f, g)), l && (u /= Math.pow(2, d - 1)), n = {}, n[m] = o; d > v; v++) s = {}, s[m] = (_ ? \"-=\" : \"+=\") + u, a.animate(s, f, g).animate(n, f, g), u = l ? 2 * u : u / 2; l && (s = { opacity: 0 }, s[m] = (_ ? \"-=\" : \"+=\") + u, a.animate(s, f, g)), a.queue(i), t.effects.unshift(a, b, p + 1) }), t.effects.define(\"clip\", \"hide\", function (e, i) { var s, n = {}, o = t(this), a = e.direction || \"vertical\", r = \"both\" === a, l = r || \"horizontal\" === a, h = r || \"vertical\" === a; s = o.cssClip(), n.clip = { top: h ? (s.bottom - s.top) / 2 : s.top, right: l ? (s.right - s.left) / 2 : s.right, bottom: h ? (s.bottom - s.top) / 2 : s.bottom, left: l ? (s.right - s.left) / 2 : s.left }, t.effects.createPlaceholder(o), \"show\" === e.mode && (o.cssClip(n.clip), n.clip = s), o.animate(n, { queue: !1, duration: e.duration, easing: e.easing, complete: i }) }), t.effects.define(\"drop\", \"hide\", function (e, i) { var s, n = t(this), o = e.mode, a = \"show\" === o, r = e.direction || \"left\", l = \"up\" === r || \"down\" === r ? \"top\" : \"left\", h = \"up\" === r || \"left\" === r ? \"-=\" : \"+=\", c = \"+=\" === h ? \"-=\" : \"+=\", u = { opacity: 0 }; t.effects.createPlaceholder(n), s = e.distance || n[\"top\" === l ? \"outerHeight\" : \"outerWidth\"](!0) / 2, u[l] = h + s, a && (n.css(u), u[l] = c + s, u.opacity = 1), n.animate(u, { queue: !1, duration: e.duration, easing: e.easing, complete: i }) }), t.effects.define(\"explode\", \"hide\", function (e, i) { function s() { b.push(this), b.length === u * d && n() } function n() { p.css({ visibility: \"visible\" }), t(b).remove(), i() } var o, a, r, l, h, c, u = e.pieces ? Math.round(Math.sqrt(e.pieces)) : 3, d = u, p = t(this), f = e.mode, g = \"show\" === f, m = p.show().css(\"visibility\", \"hidden\").offset(), _ = Math.ceil(p.outerWidth() / d), v = Math.ceil(p.outerHeight() / u), b = []; for (o = 0; u > o; o++) for (l = m.top + o * v, c = o - (u - 1) / 2, a = 0; d > a; a++) r = m.left + a * _, h = a - (d - 1) / 2, p.clone().appendTo(\"body\").wrap(\"<div></div>\").css({ position: \"absolute\", visibility: \"visible\", left: -a * _, top: -o * v }).parent().addClass(\"ui-effects-explode\").css({ position: \"absolute\", overflow: \"hidden\", width: _, height: v, left: r + (g ? h * _ : 0), top: l + (g ? c * v : 0), opacity: g ? 0 : 1 }).animate({ left: r + (g ? 0 : h * _), top: l + (g ? 0 : c * v), opacity: g ? 1 : 0 }, e.duration || 500, e.easing, s) }), t.effects.define(\"fade\", \"toggle\", function (e, i) { var s = \"show\" === e.mode; t(this).css(\"opacity\", s ? 0 : 1).animate({ opacity: s ? 1 : 0 }, { queue: !1, duration: e.duration, easing: e.easing, complete: i }) }), t.effects.define(\"fold\", \"hide\", function (e, i) { var s = t(this), n = e.mode, o = \"show\" === n, a = \"hide\" === n, r = e.size || 15, l = /([0-9]+)%/.exec(r), h = !!e.horizFirst, c = h ? [\"right\", \"bottom\"] : [\"bottom\", \"right\"], u = e.duration / 2, d = t.effects.createPlaceholder(s), p = s.cssClip(), f = { clip: t.extend({}, p) }, g = { clip: t.extend({}, p) }, m = [p[c[0]], p[c[1]]], _ = s.queue().length; l && (r = parseInt(l[1], 10) / 100 * m[a ? 0 : 1]), f.clip[c[0]] = r, g.clip[c[0]] = r, g.clip[c[1]] = 0, o && (s.cssClip(g.clip), d && d.css(t.effects.clipToBox(g)), g.clip = p), s.queue(function (i) { d && d.animate(t.effects.clipToBox(f), u, e.easing).animate(t.effects.clipToBox(g), u, e.easing), i() }).animate(f, u, e.easing).animate(g, u, e.easing).queue(i), t.effects.unshift(s, _, 4) }), t.effects.define(\"highlight\", \"show\", function (e, i) { var s = t(this), n = { backgroundColor: s.css(\"backgroundColor\") }; \"hide\" === e.mode && (n.opacity = 0), t.effects.saveStyle(s), s.css({ backgroundImage: \"none\", backgroundColor: e.color || \"#ffff99\" }).animate(n, { queue: !1, duration: e.duration, easing: e.easing, complete: i }) }), t.effects.define(\"size\", function (e, i) { var s, n, o, a = t(this), r = [\"fontSize\"], l = [\"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], h = [\"borderLeftWidth\", \"borderRightWidth\", \"paddingLeft\", \"paddingRight\"], c = e.mode, u = \"effect\" !== c, d = e.scale || \"both\", p = e.origin || [\"middle\", \"center\"], f = a.css(\"position\"), g = a.position(), m = t.effects.scaledDimensions(a), _ = e.from || m, v = e.to || t.effects.scaledDimensions(a, 0); t.effects.createPlaceholder(a), \"show\" === c && (o = _, _ = v, v = o), n = { from: { y: _.height / m.height, x: _.width / m.width }, to: { y: v.height / m.height, x: v.width / m.width } }, (\"box\" === d || \"both\" === d) && (n.from.y !== n.to.y && (_ = t.effects.setTransition(a, l, n.from.y, _), v = t.effects.setTransition(a, l, n.to.y, v)), n.from.x !== n.to.x && (_ = t.effects.setTransition(a, h, n.from.x, _), v = t.effects.setTransition(a, h, n.to.x, v))), (\"content\" === d || \"both\" === d) && n.from.y !== n.to.y && (_ = t.effects.setTransition(a, r, n.from.y, _), v = t.effects.setTransition(a, r, n.to.y, v)), p && (s = t.effects.getBaseline(p, m), _.top = (m.outerHeight - _.outerHeight) * s.y + g.top, _.left = (m.outerWidth - _.outerWidth) * s.x + g.left, v.top = (m.outerHeight - v.outerHeight) * s.y + g.top, v.left = (m.outerWidth - v.outerWidth) * s.x + g.left), a.css(_), (\"content\" === d || \"both\" === d) && (l = l.concat([\"marginTop\", \"marginBottom\"]).concat(r), h = h.concat([\"marginLeft\", \"marginRight\"]), a.find(\"*[width]\").each(function () { var i = t(this), s = t.effects.scaledDimensions(i), o = { height: s.height * n.from.y, width: s.width * n.from.x, outerHeight: s.outerHeight * n.from.y, outerWidth: s.outerWidth * n.from.x }, a = { height: s.height * n.to.y, width: s.width * n.to.x, outerHeight: s.height * n.to.y, outerWidth: s.width * n.to.x }; n.from.y !== n.to.y && (o = t.effects.setTransition(i, l, n.from.y, o), a = t.effects.setTransition(i, l, n.to.y, a)), n.from.x !== n.to.x && (o = t.effects.setTransition(i, h, n.from.x, o), a = t.effects.setTransition(i, h, n.to.x, a)), u && t.effects.saveStyle(i), i.css(o), i.animate(a, e.duration, e.easing, function () { u && t.effects.restoreStyle(i) }) })), a.animate(v, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { var e = a.offset(); 0 === v.opacity && a.css(\"opacity\", _.opacity), u || (a.css(\"position\", \"static\" === f ? \"relative\" : f).offset(e), t.effects.saveStyle(a)), i() } }) }), t.effects.define(\"scale\", function (e, i) { var s = t(this), n = e.mode, o = parseInt(e.percent, 10) || (0 === parseInt(e.percent, 10) ? 0 : \"effect\" !== n ? 0 : 100), a = t.extend(!0, { from: t.effects.scaledDimensions(s), to: t.effects.scaledDimensions(s, o, e.direction || \"both\"), origin: e.origin || [\"middle\", \"center\"] }, e); e.fade && (a.from.opacity = 1, a.to.opacity = 0), t.effects.effect.size.call(this, a, i) }), t.effects.define(\"puff\", \"hide\", function (e, i) { var s = t.extend(!0, {}, e, { fade: !0, percent: parseInt(e.percent, 10) || 150 }); t.effects.effect.scale.call(this, s, i) }), t.effects.define(\"pulsate\", \"show\", function (e, i) { var s = t(this), n = e.mode, o = \"show\" === n, a = \"hide\" === n, r = o || a, l = 2 * (e.times || 5) + (r ? 1 : 0), h = e.duration / l, c = 0, u = 1, d = s.queue().length; for ((o || !s.is(\":visible\")) && (s.css(\"opacity\", 0).show(), c = 1) ; l > u; u++) s.animate({ opacity: c }, h, e.easing), c = 1 - c; s.animate({ opacity: c }, h, e.easing), s.queue(i), t.effects.unshift(s, d, l + 1) }), t.effects.define(\"shake\", function (e, i) { var s = 1, n = t(this), o = e.direction || \"left\", a = e.distance || 20, r = e.times || 3, l = 2 * r + 1, h = Math.round(e.duration / l), c = \"up\" === o || \"down\" === o ? \"top\" : \"left\", u = \"up\" === o || \"left\" === o, d = {}, p = {}, f = {}, g = n.queue().length; for (t.effects.createPlaceholder(n), d[c] = (u ? \"-=\" : \"+=\") + a, p[c] = (u ? \"+=\" : \"-=\") + 2 * a, f[c] = (u ? \"-=\" : \"+=\") + 2 * a, n.animate(d, h, e.easing) ; r > s; s++) n.animate(p, h, e.easing).animate(f, h, e.easing); n.animate(p, h, e.easing).animate(d, h / 2, e.easing).queue(i), t.effects.unshift(n, g, l + 1) }), t.effects.define(\"slide\", \"show\", function (e, i) { var s, n, o = t(this), a = { up: [\"bottom\", \"top\"], down: [\"top\", \"bottom\"], left: [\"right\", \"left\"], right: [\"left\", \"right\"] }, r = e.mode, l = e.direction || \"left\", h = \"up\" === l || \"down\" === l ? \"top\" : \"left\", c = \"up\" === l || \"left\" === l, u = e.distance || o[\"top\" === h ? \"outerHeight\" : \"outerWidth\"](!0), d = {}; t.effects.createPlaceholder(o), s = o.cssClip(), n = o.position()[h], d[h] = (c ? -1 : 1) * u + n, d.clip = o.cssClip(), d.clip[a[l][1]] = d.clip[a[l][0]], \"show\" === r && (o.cssClip(d.clip), o.css(h, d[h]), d.clip = s, d[h] = n), o.animate(d, { queue: !1, duration: e.duration, easing: e.easing, complete: i }) }); var m; t.uiBackCompat !== !1 && (m = t.effects.define(\"transfer\", function (e, i) { t(this).transfer(e, i) }))\n});\n","/* jQuery Nice Select - v1.0\n https://github.com/hernansartorio/jquery-nice-select\n Made by Hernán Sartorio */\n!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e(\"<div></div>\").addClass(\"nice-select\").addClass(t.attr(\"class\")||\"\").addClass(t.attr(\"disabled\")?\"disabled\":\"\").attr(\"tabindex\",t.attr(\"disabled\")?null:\"0\").html('<span class=\"current\"></span><ul class=\"list\"></ul>'));var s=t.next(),n=t.find(\"option\"),i=t.find(\"option:selected\");s.find(\".current\").html(i.data(\"display\")||i.text()),n.each(function(t){var n=e(this),i=n.data(\"display\");s.find(\"ul\").append(e(\"<li></li>\").attr(\"data-value\",n.val()).attr(\"data-display\",i||null).addClass(\"option\"+(n.is(\":selected\")?\" selected\":\"\")+(n.is(\":disabled\")?\" disabled\":\"\")).html(n.text()))})}if(\"string\"==typeof t)return\"update\"==t?this.each(function(){var t=e(this),n=e(this).next(\".nice-select\"),i=n.hasClass(\"open\");n.length&&(n.remove(),s(t),i&&t.next().trigger(\"click\"))}):\"destroy\"==t?(this.each(function(){var t=e(this),s=e(this).next(\".nice-select\");s.length&&(s.remove(),t.css(\"display\",\"\"))}),0==e(\".nice-select\").length&&e(document).off(\".nice_select\")):console.log('Method \"'+t+'\" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass(\"nice-select\")||s(t)}),e(document).off(\".nice_select\"),e(document).on(\"click.nice_select\",\".nice-select\",function(t){var s=e(this);e(\".nice-select\").not(s).removeClass(\"open\"),s.toggleClass(\"open\"),s.hasClass(\"open\")?(s.find(\".option\"),s.find(\".focus\").removeClass(\"focus\"),s.find(\".selected\").addClass(\"focus\")):s.focus()}),e(document).on(\"click.nice_select\",function(t){0===e(t.target).closest(\".nice-select\").length&&e(\".nice-select\").removeClass(\"open\").find(\".option\")}),e(document).on(\"click.nice_select\",\".nice-select .option:not(.disabled)\",function(t){var s=e(this),n=s.closest(\".nice-select\");n.find(\".selected\").removeClass(\"selected\"),s.addClass(\"selected\");var i=s.data(\"display\")||s.text();n.find(\".current\").text(i),n.prev(\"select\").val(s.data(\"value\")).trigger(\"change\")}),e(document).on(\"keydown.nice_select\",\".nice-select\",function(t){var s=e(this),n=e(s.find(\".focus\")||s.find(\".list .option.selected\"));if(32==t.keyCode||13==t.keyCode)return s.hasClass(\"open\")?n.trigger(\"click\"):s.trigger(\"click\"),!1;if(40==t.keyCode){if(s.hasClass(\"open\")){var i=n.nextAll(\".option:not(.disabled)\").first();i.length>0&&(s.find(\".focus\").removeClass(\"focus\"),i.addClass(\"focus\"))}else s.trigger(\"click\");return!1}if(38==t.keyCode){if(s.hasClass(\"open\")){var l=n.prevAll(\".option:not(.disabled)\").first();l.length>0&&(s.find(\".focus\").removeClass(\"focus\"),l.addClass(\"focus\"))}else s.trigger(\"click\");return!1}if(27==t.keyCode)s.hasClass(\"open\")&&s.trigger(\"click\");else if(9==t.keyCode&&s.hasClass(\"open\"))return!1});var n=document.createElement(\"a\").style;return n.cssText=\"pointer-events:auto\",\"auto\"!==n.pointerEvents&&e(\"html\").addClass(\"no-csspointerevents\"),this}}(jQuery);","/*!\n * @fileOverview TouchSwipe - jQuery Plugin\n * @version 1.6.18\n *\n * @author Matt Bryson http://www.github.com/mattbryson\n * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin\n * @see http://labs.rampinteractive.co.uk/touchSwipe/\n * @see http://plugins.jquery.com/project/touchSwipe\n * @license\n * Copyright (c) 2010-2015 Matt Bryson\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n */\n\n!function(factory){\"function\"==typeof define&&define.amd&&define.amd.jQuery?define([\"jquery\"],factory):factory(\"undefined\"!=typeof module&&module.exports?require(\"jquery\"):jQuery)}(function($){\"use strict\";function init(options){return!options||void 0!==options.allowPageScroll||void 0===options.swipe&&void 0===options.swipeStatus||(options.allowPageScroll=NONE),void 0!==options.click&&void 0===options.tap&&(options.tap=options.click),options||(options={}),options=$.extend({},$.fn.swipe.defaults,options),this.each(function(){var $this=$(this),plugin=$this.data(PLUGIN_NS);plugin||(plugin=new TouchSwipe(this,options),$this.data(PLUGIN_NS,plugin))})}function TouchSwipe(element,options){function touchStart(jqEvent){if(!(getTouchInProgress()||$(jqEvent.target).closest(options.excludedElements,$element).length>0)){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(!event.pointerType||\"mouse\"!=event.pointerType||0!=options.fallbackToMouseEvents){var ret,touches=event.touches,evt=touches?touches[0]:event;return phase=PHASE_START,touches?fingerCount=touches.length:options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),distance=0,direction=null,currentDirection=null,pinchDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,maximumsMap=createMaximumsData(),cancelMultiFingerRelease(),createFingerData(0,evt),!touches||fingerCount===options.fingers||options.fingers===ALL_FINGERS||hasPinches()?(startTime=getTimeStamp(),2==fingerCount&&(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)),(options.swipeStatus||options.pinchStatus)&&(ret=triggerHandler(event,phase))):ret=!1,ret===!1?(phase=PHASE_CANCEL,triggerHandler(event,phase),ret):(options.hold&&(holdTimeout=setTimeout($.proxy(function(){$element.trigger(\"hold\",[event.target]),options.hold&&(ret=options.hold.call($element,event,event.target))},this),options.longTapThreshold)),setTouchInProgress(!0),null)}}}function touchMove(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(phase!==PHASE_END&&phase!==PHASE_CANCEL&&!inMultiFingerRelease()){var ret,touches=event.touches,evt=touches?touches[0]:event,currentFinger=updateFingerData(evt);if(endTime=getTimeStamp(),touches&&(fingerCount=touches.length),options.hold&&clearTimeout(holdTimeout),phase=PHASE_MOVE,2==fingerCount&&(0==startTouchesDistance?(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)):(updateFingerData(touches[1]),endTouchesDistance=calculateTouchesDistance(fingerData[0].end,fingerData[1].end),pinchDirection=calculatePinchDirection(fingerData[0].end,fingerData[1].end)),pinchZoom=calculatePinchZoom(startTouchesDistance,endTouchesDistance),pinchDistance=Math.abs(startTouchesDistance-endTouchesDistance)),fingerCount===options.fingers||options.fingers===ALL_FINGERS||!touches||hasPinches()){if(direction=calculateDirection(currentFinger.start,currentFinger.end),currentDirection=calculateDirection(currentFinger.last,currentFinger.end),validateDefaultEvent(jqEvent,currentDirection),distance=calculateDistance(currentFinger.start,currentFinger.end),duration=calculateDuration(),setMaxDistance(direction,distance),ret=triggerHandler(event,phase),!options.triggerOnTouchEnd||options.triggerOnTouchLeave){var inBounds=!0;if(options.triggerOnTouchLeave){var bounds=getbounds(this);inBounds=isInBounds(currentFinger.end,bounds)}!options.triggerOnTouchEnd&&inBounds?phase=getNextPhase(PHASE_MOVE):options.triggerOnTouchLeave&&!inBounds&&(phase=getNextPhase(PHASE_END)),phase!=PHASE_CANCEL&&phase!=PHASE_END||triggerHandler(event,phase)}}else phase=PHASE_CANCEL,triggerHandler(event,phase);ret===!1&&(phase=PHASE_CANCEL,triggerHandler(event,phase))}}function touchEnd(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent,touches=event.touches;if(touches){if(touches.length&&!inMultiFingerRelease())return startMultiFingerRelease(event),!0;if(touches.length&&inMultiFingerRelease())return!0}return inMultiFingerRelease()&&(fingerCount=fingerCountAtRelease),endTime=getTimeStamp(),duration=calculateDuration(),didSwipeBackToCancel()||!validateSwipeDistance()?(phase=PHASE_CANCEL,triggerHandler(event,phase)):options.triggerOnTouchEnd||options.triggerOnTouchEnd===!1&&phase===PHASE_MOVE?(options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),phase=PHASE_END,triggerHandler(event,phase)):!options.triggerOnTouchEnd&&hasTap()?(phase=PHASE_END,triggerHandlerForGesture(event,phase,TAP)):phase===PHASE_MOVE&&(phase=PHASE_CANCEL,triggerHandler(event,phase)),setTouchInProgress(!1),null}function touchCancel(){fingerCount=0,endTime=0,startTime=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,cancelMultiFingerRelease(),setTouchInProgress(!1)}function touchLeave(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;options.triggerOnTouchLeave&&(phase=getNextPhase(PHASE_END),triggerHandler(event,phase))}function removeListeners(){$element.unbind(START_EV,touchStart),$element.unbind(CANCEL_EV,touchCancel),$element.unbind(MOVE_EV,touchMove),$element.unbind(END_EV,touchEnd),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave),setTouchInProgress(!1)}function getNextPhase(currentPhase){var nextPhase=currentPhase,validTime=validateSwipeTime(),validDistance=validateSwipeDistance(),didCancel=didSwipeBackToCancel();return!validTime||didCancel?nextPhase=PHASE_CANCEL:!validDistance||currentPhase!=PHASE_MOVE||options.triggerOnTouchEnd&&!options.triggerOnTouchLeave?!validDistance&¤tPhase==PHASE_END&&options.triggerOnTouchLeave&&(nextPhase=PHASE_CANCEL):nextPhase=PHASE_END,nextPhase}function triggerHandler(event,phase){var ret,touches=event.touches;return(didSwipe()||hasSwipes())&&(ret=triggerHandlerForGesture(event,phase,SWIPE)),(didPinch()||hasPinches())&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,PINCH)),didDoubleTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,DOUBLE_TAP):didLongTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,LONG_TAP):didTap()&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,TAP)),phase===PHASE_CANCEL&&touchCancel(event),phase===PHASE_END&&(touches?touches.length||touchCancel(event):touchCancel(event)),ret}function triggerHandlerForGesture(event,phase,gesture){var ret;if(gesture==SWIPE){if($element.trigger(\"swipeStatus\",[phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection]),options.swipeStatus&&(ret=options.swipeStatus.call($element,event,phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection),ret===!1))return!1;if(phase==PHASE_END&&validateSwipe()){if(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),$element.trigger(\"swipe\",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipe&&(ret=options.swipe.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection),ret===!1))return!1;switch(direction){case LEFT:$element.trigger(\"swipeLeft\",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeLeft&&(ret=options.swipeLeft.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case RIGHT:$element.trigger(\"swipeRight\",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeRight&&(ret=options.swipeRight.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case UP:$element.trigger(\"swipeUp\",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeUp&&(ret=options.swipeUp.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case DOWN:$element.trigger(\"swipeDown\",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeDown&&(ret=options.swipeDown.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection))}}}if(gesture==PINCH){if($element.trigger(\"pinchStatus\",[phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchStatus&&(ret=options.pinchStatus.call($element,event,phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData),ret===!1))return!1;if(phase==PHASE_END&&validatePinch())switch(pinchDirection){case IN:$element.trigger(\"pinchIn\",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchIn&&(ret=options.pinchIn.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData));break;case OUT:$element.trigger(\"pinchOut\",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchOut&&(ret=options.pinchOut.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData))}}return gesture==TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),hasDoubleTap()&&!inDoubleTap()?(doubleTapStartTime=getTimeStamp(),singleTapTimeout=setTimeout($.proxy(function(){doubleTapStartTime=null,$element.trigger(\"tap\",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target))},this),options.doubleTapThreshold)):(doubleTapStartTime=null,$element.trigger(\"tap\",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target)))):gesture==DOUBLE_TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),doubleTapStartTime=null,$element.trigger(\"doubletap\",[event.target]),options.doubleTap&&(ret=options.doubleTap.call($element,event,event.target))):gesture==LONG_TAP&&(phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),doubleTapStartTime=null,$element.trigger(\"longtap\",[event.target]),options.longTap&&(ret=options.longTap.call($element,event,event.target)))),ret}function validateSwipeDistance(){var valid=!0;return null!==options.threshold&&(valid=distance>=options.threshold),valid}function didSwipeBackToCancel(){var cancelled=!1;return null!==options.cancelThreshold&&null!==direction&&(cancelled=getMaxDistance(direction)-distance>=options.cancelThreshold),cancelled}function validatePinchDistance(){return null===options.pinchThreshold||pinchDistance>=options.pinchThreshold}function validateSwipeTime(){var result;return result=!options.maxTimeThreshold||!(duration>=options.maxTimeThreshold)}function validateDefaultEvent(jqEvent,direction){if(options.preventDefaultEvents!==!1)if(options.allowPageScroll===NONE)jqEvent.preventDefault();else{var auto=options.allowPageScroll===AUTO;switch(direction){case LEFT:(options.swipeLeft&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case RIGHT:(options.swipeRight&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case UP:(options.swipeUp&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case DOWN:(options.swipeDown&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case NONE:}}}function validatePinch(){var hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),hasCorrectDistance=validatePinchDistance();return hasCorrectFingerCount&&hasEndPoint&&hasCorrectDistance}function hasPinches(){return!!(options.pinchStatus||options.pinchIn||options.pinchOut)}function didPinch(){return!(!validatePinch()||!hasPinches())}function validateSwipe(){var hasValidTime=validateSwipeTime(),hasValidDistance=validateSwipeDistance(),hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),didCancel=didSwipeBackToCancel(),valid=!didCancel&&hasEndPoint&&hasCorrectFingerCount&&hasValidDistance&&hasValidTime;return valid}function hasSwipes(){return!!(options.swipe||options.swipeStatus||options.swipeLeft||options.swipeRight||options.swipeUp||options.swipeDown)}function didSwipe(){return!(!validateSwipe()||!hasSwipes())}function validateFingers(){return fingerCount===options.fingers||options.fingers===ALL_FINGERS||!SUPPORTS_TOUCH}function validateEndPoint(){return 0!==fingerData[0].end.x}function hasTap(){return!!options.tap}function hasDoubleTap(){return!!options.doubleTap}function hasLongTap(){return!!options.longTap}function validateDoubleTap(){if(null==doubleTapStartTime)return!1;var now=getTimeStamp();return hasDoubleTap()&&now-doubleTapStartTime<=options.doubleTapThreshold}function inDoubleTap(){return validateDoubleTap()}function validateTap(){return(1===fingerCount||!SUPPORTS_TOUCH)&&(isNaN(distance)||distance<options.threshold)}function validateLongTap(){return duration>options.longTapThreshold&&distance<DOUBLE_TAP_THRESHOLD}function didTap(){return!(!validateTap()||!hasTap())}function didDoubleTap(){return!(!validateDoubleTap()||!hasDoubleTap())}function didLongTap(){return!(!validateLongTap()||!hasLongTap())}function startMultiFingerRelease(event){previousTouchEndTime=getTimeStamp(),fingerCountAtRelease=event.touches.length+1}function cancelMultiFingerRelease(){previousTouchEndTime=0,fingerCountAtRelease=0}function inMultiFingerRelease(){var withinThreshold=!1;if(previousTouchEndTime){var diff=getTimeStamp()-previousTouchEndTime;diff<=options.fingerReleaseThreshold&&(withinThreshold=!0)}return withinThreshold}function getTouchInProgress(){return!($element.data(PLUGIN_NS+\"_intouch\")!==!0)}function setTouchInProgress(val){$element&&(val===!0?($element.bind(MOVE_EV,touchMove),$element.bind(END_EV,touchEnd),LEAVE_EV&&$element.bind(LEAVE_EV,touchLeave)):($element.unbind(MOVE_EV,touchMove,!1),$element.unbind(END_EV,touchEnd,!1),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave,!1)),$element.data(PLUGIN_NS+\"_intouch\",val===!0))}function createFingerData(id,evt){var f={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return f.start.x=f.last.x=f.end.x=evt.pageX||evt.clientX,f.start.y=f.last.y=f.end.y=evt.pageY||evt.clientY,fingerData[id]=f,f}function updateFingerData(evt){var id=void 0!==evt.identifier?evt.identifier:0,f=getFingerData(id);return null===f&&(f=createFingerData(id,evt)),f.last.x=f.end.x,f.last.y=f.end.y,f.end.x=evt.pageX||evt.clientX,f.end.y=evt.pageY||evt.clientY,f}function getFingerData(id){return fingerData[id]||null}function setMaxDistance(direction,distance){direction!=NONE&&(distance=Math.max(distance,getMaxDistance(direction)),maximumsMap[direction].distance=distance)}function getMaxDistance(direction){if(maximumsMap[direction])return maximumsMap[direction].distance}function createMaximumsData(){var maxData={};return maxData[LEFT]=createMaximumVO(LEFT),maxData[RIGHT]=createMaximumVO(RIGHT),maxData[UP]=createMaximumVO(UP),maxData[DOWN]=createMaximumVO(DOWN),maxData}function createMaximumVO(dir){return{direction:dir,distance:0}}function calculateDuration(){return endTime-startTime}function calculateTouchesDistance(startPoint,endPoint){var diffX=Math.abs(startPoint.x-endPoint.x),diffY=Math.abs(startPoint.y-endPoint.y);return Math.round(Math.sqrt(diffX*diffX+diffY*diffY))}function calculatePinchZoom(startDistance,endDistance){var percent=endDistance/startDistance*1;return percent.toFixed(2)}function calculatePinchDirection(){return pinchZoom<1?OUT:IN}function calculateDistance(startPoint,endPoint){return Math.round(Math.sqrt(Math.pow(endPoint.x-startPoint.x,2)+Math.pow(endPoint.y-startPoint.y,2)))}function calculateAngle(startPoint,endPoint){var x=startPoint.x-endPoint.x,y=endPoint.y-startPoint.y,r=Math.atan2(y,x),angle=Math.round(180*r/Math.PI);return angle<0&&(angle=360-Math.abs(angle)),angle}function calculateDirection(startPoint,endPoint){if(comparePoints(startPoint,endPoint))return NONE;var angle=calculateAngle(startPoint,endPoint);return angle<=45&&angle>=0?LEFT:angle<=360&&angle>=315?LEFT:angle>=135&&angle<=225?RIGHT:angle>45&&angle<135?DOWN:UP}function getTimeStamp(){var now=new Date;return now.getTime()}function getbounds(el){el=$(el);var offset=el.offset(),bounds={left:offset.left,right:offset.left+el.outerWidth(),top:offset.top,bottom:offset.top+el.outerHeight()};return bounds}function isInBounds(point,bounds){return point.x>bounds.left&&point.x<bounds.right&&point.y>bounds.top&&point.y<bounds.bottom}function comparePoints(pointA,pointB){return pointA.x==pointB.x&&pointA.y==pointB.y}var options=$.extend({},options),useTouchEvents=SUPPORTS_TOUCH||SUPPORTS_POINTER||!options.fallbackToMouseEvents,START_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?\"MSPointerDown\":\"pointerdown\":\"touchstart\":\"mousedown\",MOVE_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?\"MSPointerMove\":\"pointermove\":\"touchmove\":\"mousemove\",END_EV=useTouchEvents?SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?\"MSPointerUp\":\"pointerup\":\"touchend\":\"mouseup\",LEAVE_EV=useTouchEvents?SUPPORTS_POINTER?\"mouseleave\":null:\"mouseleave\",CANCEL_EV=SUPPORTS_POINTER?SUPPORTS_POINTER_IE10?\"MSPointerCancel\":\"pointercancel\":\"touchcancel\",distance=0,direction=null,currentDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,pinchDirection=0,maximumsMap=null,$element=$(element),phase=\"start\",fingerCount=0,fingerData={},startTime=0,endTime=0,previousTouchEndTime=0,fingerCountAtRelease=0,doubleTapStartTime=0,singleTapTimeout=null,holdTimeout=null;try{$element.bind(START_EV,touchStart),$element.bind(CANCEL_EV,touchCancel)}catch(e){$.error(\"events not supported \"+START_EV+\",\"+CANCEL_EV+\" on jQuery.swipe\")}this.enable=function(){return this.disable(),$element.bind(START_EV,touchStart),$element.bind(CANCEL_EV,touchCancel),$element},this.disable=function(){return removeListeners(),$element},this.destroy=function(){removeListeners(),$element.data(PLUGIN_NS,null),$element=null},this.option=function(property,value){if(\"object\"==typeof property)options=$.extend(options,property);else if(void 0!==options[property]){if(void 0===value)return options[property];options[property]=value}else{if(!property)return options;$.error(\"Option \"+property+\" does not exist on jQuery.swipe.options\")}return null}}var VERSION=\"1.6.18\",LEFT=\"left\",RIGHT=\"right\",UP=\"up\",DOWN=\"down\",IN=\"in\",OUT=\"out\",NONE=\"none\",AUTO=\"auto\",SWIPE=\"swipe\",PINCH=\"pinch\",TAP=\"tap\",DOUBLE_TAP=\"doubletap\",LONG_TAP=\"longtap\",HORIZONTAL=\"horizontal\",VERTICAL=\"vertical\",ALL_FINGERS=\"all\",DOUBLE_TAP_THRESHOLD=10,PHASE_START=\"start\",PHASE_MOVE=\"move\",PHASE_END=\"end\",PHASE_CANCEL=\"cancel\",SUPPORTS_TOUCH=\"ontouchstart\"in window,SUPPORTS_POINTER_IE10=window.navigator.msPointerEnabled&&!window.PointerEvent&&!SUPPORTS_TOUCH,SUPPORTS_POINTER=(window.PointerEvent||window.navigator.msPointerEnabled)&&!SUPPORTS_TOUCH,PLUGIN_NS=\"TouchSwipe\",defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:\"auto\",fallbackToMouseEvents:!0,excludedElements:\".noSwipe\",preventDefaultEvents:!0};$.fn.swipe=function(method){var $this=$(this),plugin=$this.data(PLUGIN_NS);if(plugin&&\"string\"==typeof method){if(plugin[method])return plugin[method].apply(plugin,Array.prototype.slice.call(arguments,1));$.error(\"Method \"+method+\" does not exist on jQuery.swipe\")}else if(plugin&&\"object\"==typeof method)plugin.option.apply(plugin,arguments);else if(!(plugin||\"object\"!=typeof method&&method))return init.apply(this,arguments);return $this},$.fn.swipe.version=VERSION,$.fn.swipe.defaults=defaults,$.fn.swipe.phases={PHASE_START:PHASE_START,PHASE_MOVE:PHASE_MOVE,PHASE_END:PHASE_END,PHASE_CANCEL:PHASE_CANCEL},$.fn.swipe.directions={LEFT:LEFT,RIGHT:RIGHT,UP:UP,DOWN:DOWN,IN:IN,OUT:OUT},$.fn.swipe.pageScroll={NONE:NONE,HORIZONTAL:HORIZONTAL,VERTICAL:VERTICAL,AUTO:AUTO},$.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:ALL_FINGERS}});\n\n","/*!\n * jQuery UI Touch Punch 0.2.3\n *\n * Copyright 2011–2014, Dave Furfero\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n * Depends:\n * jquery.ui.widget.js\n * jquery.ui.mouse.js\n */\n!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent(\"MouseEvents\");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch=\"ontouchend\"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,\"mouseover\"),f(a,\"mousemove\"),f(a,\"mousedown\"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,\"mousemove\"))},b._touchEnd=function(a){e&&(f(a,\"mouseup\"),f(a,\"mouseout\"),this._touchMoved||f(a,\"click\"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,\"_touchStart\"),touchmove:a.proxy(b,\"_touchMove\"),touchend:a.proxy(b,\"_touchEnd\")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,\"_touchStart\"),touchmove:a.proxy(b,\"_touchMove\"),touchend:a.proxy(b,\"_touchEnd\")}),d.call(b)}}}(jQuery);","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"signalR\"] = factory();\n\telse\n\t\troot[\"signalR\"] = factory();\n})(self, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.\r\n/** Indicates the severity of a log message.\r\n *\r\n * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.\r\n */\r\nexport enum LogLevel {\r\n /** Log level for very low severity diagnostic messages. */\r\n Trace = 0,\r\n /** Log level for low severity diagnostic messages. */\r\n Debug = 1,\r\n /** Log level for informational diagnostic messages. */\r\n Information = 2,\r\n /** Log level for diagnostic messages that indicate a non-fatal problem. */\r\n Warning = 3,\r\n /** Log level for diagnostic messages that indicate a failure in the current operation. */\r\n Error = 4,\r\n /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */\r\n Critical = 5,\r\n /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */\r\n None = 6,\r\n}\r\n\r\n/** An abstraction that provides a sink for diagnostic messages. */\r\nexport interface ILogger {\r\n /** Called by the framework to emit a diagnostic message.\r\n *\r\n * @param {LogLevel} logLevel The severity level of the message.\r\n * @param {string} message The message.\r\n */\r\n log(logLevel: LogLevel, message: string): void;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HttpTransportType } from \"./ITransport\";\r\n\r\n/** Error thrown when an HTTP request fails. */\r\nexport class HttpError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The HTTP status code represented by this error. */\r\n public statusCode: number;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n * @param {number} statusCode The HTTP status code represented by this error.\r\n */\r\n constructor(errorMessage: string, statusCode: number) {\r\n const trueProto = new.target.prototype;\r\n super(`${errorMessage}: Status code '${statusCode}'`);\r\n this.statusCode = statusCode;\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when a timeout elapses. */\r\nexport class TimeoutError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage: string = \"A timeout occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when an action is aborted. */\r\nexport class AbortError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** Constructs a new instance of {@link AbortError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage: string = \"An abort occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the selected transport is unsupported by the browser. */\r\n/** @private */\r\nexport class UnsupportedTransportError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r\n public transport: HttpTransportType;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message: string, transport: HttpTransportType) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'UnsupportedTransportError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the selected transport is disabled by the browser. */\r\n/** @private */\r\nexport class DisabledTransportError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r\n public transport: HttpTransportType;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message: string, transport: HttpTransportType) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'DisabledTransportError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the selected transport cannot be started. */\r\n/** @private */\r\nexport class FailedToStartTransportError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r\n public transport: HttpTransportType;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message: string, transport: HttpTransportType) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'FailedToStartTransportError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the negotiation with the server failed to complete. */\r\n/** @private */\r\nexport class FailedToNegotiateWithServerError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n */\r\n constructor(message: string) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.errorType = 'FailedToNegotiateWithServerError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when multiple errors have occurred. */\r\n/** @private */\r\nexport class AggregateErrors extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The collection of errors this error is aggregating. */\r\n public innerErrors: Error[];\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {Error[]} innerErrors The collection of errors this error is aggregating.\r\n */\r\n constructor(message: string, innerErrors: Error[]) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n\r\n this.innerErrors = innerErrors;\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortSignal } from \"./AbortController\";\r\nimport { MessageHeaders } from \"./IHubProtocol\";\r\n\r\n/** Represents an HTTP request. */\r\nexport interface HttpRequest {\r\n /** The HTTP method to use for the request. */\r\n method?: string;\r\n\r\n /** The URL for the request. */\r\n url?: string;\r\n\r\n /** The body content for the request. May be a string or an ArrayBuffer (for binary data). */\r\n content?: string | ArrayBuffer;\r\n\r\n /** An object describing headers to apply to the request. */\r\n headers?: MessageHeaders;\r\n\r\n /** The XMLHttpRequestResponseType to apply to the request. */\r\n responseType?: XMLHttpRequestResponseType;\r\n\r\n /** An AbortSignal that can be monitored for cancellation. */\r\n abortSignal?: AbortSignal;\r\n\r\n /** The time to wait for the request to complete before throwing a TimeoutError. Measured in milliseconds. */\r\n timeout?: number;\r\n\r\n /** This controls whether credentials such as cookies are sent in cross-site requests. */\r\n withCredentials?: boolean;\r\n}\r\n\r\n/** Represents an HTTP response. */\r\nexport class HttpResponse {\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n */\r\n constructor(statusCode: number);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code and message.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n */\r\n constructor(statusCode: number, statusText: string);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and string content.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n * @param {string} content The content of the response.\r\n */\r\n constructor(statusCode: number, statusText: string, content: string);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and binary content.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n * @param {ArrayBuffer} content The content of the response.\r\n */\r\n constructor(statusCode: number, statusText: string, content: ArrayBuffer);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and binary content.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n * @param {string | ArrayBuffer} content The content of the response.\r\n */\r\n constructor(statusCode: number, statusText: string, content: string | ArrayBuffer);\r\n constructor(\r\n public readonly statusCode: number,\r\n public readonly statusText?: string,\r\n public readonly content?: string | ArrayBuffer) {\r\n }\r\n}\r\n\r\n/** Abstraction over an HTTP client.\r\n *\r\n * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.\r\n */\r\nexport abstract class HttpClient {\r\n /** Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public get(url: string): Promise<HttpResponse>;\r\n\r\n /** Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public get(url: string, options: HttpRequest): Promise<HttpResponse>;\r\n public get(url: string, options?: HttpRequest): Promise<HttpResponse> {\r\n return this.send({\r\n ...options,\r\n method: \"GET\",\r\n url,\r\n });\r\n }\r\n\r\n /** Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public post(url: string): Promise<HttpResponse>;\r\n\r\n /** Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public post(url: string, options: HttpRequest): Promise<HttpResponse>;\r\n public post(url: string, options?: HttpRequest): Promise<HttpResponse> {\r\n return this.send({\r\n ...options,\r\n method: \"POST\",\r\n url,\r\n });\r\n }\r\n\r\n /** Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public delete(url: string): Promise<HttpResponse>;\r\n\r\n /** Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public delete(url: string, options: HttpRequest): Promise<HttpResponse>;\r\n public delete(url: string, options?: HttpRequest): Promise<HttpResponse> {\r\n return this.send({\r\n ...options,\r\n method: \"DELETE\",\r\n url,\r\n });\r\n }\r\n\r\n /** Issues an HTTP request to the specified URL, returning a {@link Promise} that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {HttpRequest} request An {@link @microsoft/signalr.HttpRequest} describing the request to send.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an HttpResponse describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public abstract send(request: HttpRequest): Promise<HttpResponse>;\r\n\r\n /** Gets all cookies that apply to the specified URL.\r\n *\r\n * @param url The URL that the cookies are valid for.\r\n * @returns {string} A string containing all the key-value cookie pairs for the specified URL.\r\n */\r\n // @ts-ignore\r\n public getCookieString(url: string): string {\r\n return \"\";\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\n\r\n/** A logger that does nothing when log messages are sent to it. */\r\nexport class NullLogger implements ILogger {\r\n /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */\r\n public static instance: ILogger = new NullLogger();\r\n\r\n private constructor() {}\r\n\r\n /** @inheritDoc */\r\n // eslint-disable-next-line\r\n public log(_logLevel: LogLevel, _message: string): void {\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { IStreamSubscriber, ISubscription } from \"./Stream\";\r\nimport { Subject } from \"./Subject\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\n\r\n// Version token that will be replaced by the prepack command\r\n/** The version of the SignalR client. */\r\n\r\nexport const VERSION: string = \"0.0.0-DEV_BUILD\";\r\n/** @private */\r\nexport class Arg {\r\n public static isRequired(val: any, name: string): void {\r\n if (val === null || val === undefined) {\r\n throw new Error(`The '${name}' argument is required.`);\r\n }\r\n }\r\n public static isNotEmpty(val: string, name: string): void {\r\n if (!val || val.match(/^\\s*$/)) {\r\n throw new Error(`The '${name}' argument should not be empty.`);\r\n }\r\n }\r\n\r\n public static isIn(val: any, values: any, name: string): void {\r\n // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.\r\n if (!(val in values)) {\r\n throw new Error(`Unknown ${name} value: ${val}.`);\r\n }\r\n }\r\n}\r\n\r\n/** @private */\r\nexport class Platform {\r\n // react-native has a window but no document so we should check both\r\n public static get isBrowser(): boolean {\r\n return !Platform.isNode && typeof window === \"object\" && typeof window.document === \"object\";\r\n }\r\n\r\n // WebWorkers don't have a window object so the isBrowser check would fail\r\n public static get isWebWorker(): boolean {\r\n return !Platform.isNode && typeof self === \"object\" && \"importScripts\" in self;\r\n }\r\n\r\n // react-native has a window but no document\r\n static get isReactNative(): boolean {\r\n return !Platform.isNode && typeof window === \"object\" && typeof window.document === \"undefined\";\r\n }\r\n\r\n // Node apps shouldn't have a window object, but WebWorkers don't either\r\n // so we need to check for both WebWorker and window\r\n public static get isNode(): boolean {\r\n return typeof process !== \"undefined\" && process.release && process.release.name === \"node\";\r\n }\r\n}\r\n\r\n/** @private */\r\nexport function getDataDetail(data: any, includeContent: boolean): string {\r\n let detail = \"\";\r\n if (isArrayBuffer(data)) {\r\n detail = `Binary data of length ${data.byteLength}`;\r\n if (includeContent) {\r\n detail += `. Content: '${formatArrayBuffer(data)}'`;\r\n }\r\n } else if (typeof data === \"string\") {\r\n detail = `String data of length ${data.length}`;\r\n if (includeContent) {\r\n detail += `. Content: '${data}'`;\r\n }\r\n }\r\n return detail;\r\n}\r\n\r\n/** @private */\r\nexport function formatArrayBuffer(data: ArrayBuffer): string {\r\n const view = new Uint8Array(data);\r\n\r\n // Uint8Array.map only supports returning another Uint8Array?\r\n let str = \"\";\r\n view.forEach((num) => {\r\n const pad = num < 16 ? \"0\" : \"\";\r\n str += `0x${pad}${num.toString(16)} `;\r\n });\r\n\r\n // Trim of trailing space.\r\n return str.substr(0, str.length - 1);\r\n}\r\n\r\n// Also in signalr-protocol-msgpack/Utils.ts\r\n/** @private */\r\nexport function isArrayBuffer(val: any): val is ArrayBuffer {\r\n return val && typeof ArrayBuffer !== \"undefined\" &&\r\n (val instanceof ArrayBuffer ||\r\n // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof\r\n (val.constructor && val.constructor.name === \"ArrayBuffer\"));\r\n}\r\n\r\n/** @private */\r\nexport async function sendMessage(logger: ILogger, transportName: string, httpClient: HttpClient, url: string,\r\n content: string | ArrayBuffer, options: IHttpConnectionOptions): Promise<void> {\r\n const headers: {[k: string]: string} = {};\r\n\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n logger.log(LogLevel.Trace, `(${transportName} transport) sending data. ${getDataDetail(content, options.logMessageContent!)}.`);\r\n\r\n const responseType = isArrayBuffer(content) ? \"arraybuffer\" : \"text\";\r\n const response = await httpClient.post(url, {\r\n content,\r\n headers: { ...headers, ...options.headers},\r\n responseType,\r\n timeout: options.timeout,\r\n withCredentials: options.withCredentials,\r\n });\r\n\r\n logger.log(LogLevel.Trace, `(${transportName} transport) request complete. Response status: ${response.statusCode}.`);\r\n}\r\n\r\n/** @private */\r\nexport function createLogger(logger?: ILogger | LogLevel): ILogger {\r\n if (logger === undefined) {\r\n return new ConsoleLogger(LogLevel.Information);\r\n }\r\n\r\n if (logger === null) {\r\n return NullLogger.instance;\r\n }\r\n\r\n if ((logger as ILogger).log !== undefined) {\r\n return logger as ILogger;\r\n }\r\n\r\n return new ConsoleLogger(logger as LogLevel);\r\n}\r\n\r\n/** @private */\r\nexport class SubjectSubscription<T> implements ISubscription<T> {\r\n private _subject: Subject<T>;\r\n private _observer: IStreamSubscriber<T>;\r\n\r\n constructor(subject: Subject<T>, observer: IStreamSubscriber<T>) {\r\n this._subject = subject;\r\n this._observer = observer;\r\n }\r\n\r\n public dispose(): void {\r\n const index: number = this._subject.observers.indexOf(this._observer);\r\n if (index > -1) {\r\n this._subject.observers.splice(index, 1);\r\n }\r\n\r\n if (this._subject.observers.length === 0 && this._subject.cancelCallback) {\r\n this._subject.cancelCallback().catch((_) => { });\r\n }\r\n }\r\n}\r\n\r\n/** @private */\r\nexport class ConsoleLogger implements ILogger {\r\n private readonly _minLevel: LogLevel;\r\n\r\n // Public for testing purposes.\r\n public out: {\r\n error(message: any): void,\r\n warn(message: any): void,\r\n info(message: any): void,\r\n log(message: any): void,\r\n };\r\n\r\n constructor(minimumLogLevel: LogLevel) {\r\n this._minLevel = minimumLogLevel;\r\n this.out = console;\r\n }\r\n\r\n public log(logLevel: LogLevel, message: string): void {\r\n if (logLevel >= this._minLevel) {\r\n const msg = `[${new Date().toISOString()}] ${LogLevel[logLevel]}: ${message}`;\r\n switch (logLevel) {\r\n case LogLevel.Critical:\r\n case LogLevel.Error:\r\n this.out.error(msg);\r\n break;\r\n case LogLevel.Warning:\r\n this.out.warn(msg);\r\n break;\r\n case LogLevel.Information:\r\n this.out.info(msg);\r\n break;\r\n default:\r\n // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug\r\n this.out.log(msg);\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** @private */\r\nexport function getUserAgentHeader(): [string, string] {\r\n let userAgentHeaderName = \"X-SignalR-User-Agent\";\r\n if (Platform.isNode) {\r\n userAgentHeaderName = \"User-Agent\";\r\n }\r\n return [ userAgentHeaderName, constructUserAgent(VERSION, getOsName(), getRuntime(), getRuntimeVersion()) ];\r\n}\r\n\r\n/** @private */\r\nexport function constructUserAgent(version: string, os: string, runtime: string, runtimeVersion: string | undefined): string {\r\n // Microsoft SignalR/[Version] ([Detailed Version]; [Operating System]; [Runtime]; [Runtime Version])\r\n let userAgent: string = \"Microsoft SignalR/\";\r\n\r\n const majorAndMinor = version.split(\".\");\r\n userAgent += `${majorAndMinor[0]}.${majorAndMinor[1]}`;\r\n userAgent += ` (${version}; `;\r\n\r\n if (os && os !== \"\") {\r\n userAgent += `${os}; `;\r\n } else {\r\n userAgent += \"Unknown OS; \";\r\n }\r\n\r\n userAgent += `${runtime}`;\r\n\r\n if (runtimeVersion) {\r\n userAgent += `; ${runtimeVersion}`;\r\n } else {\r\n userAgent += \"; Unknown Runtime Version\";\r\n }\r\n\r\n userAgent += \")\";\r\n return userAgent;\r\n}\r\n\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getOsName(): string {\r\n if (Platform.isNode) {\r\n switch (process.platform) {\r\n case \"win32\":\r\n return \"Windows NT\";\r\n case \"darwin\":\r\n return \"macOS\";\r\n case \"linux\":\r\n return \"Linux\";\r\n default:\r\n return process.platform;\r\n }\r\n } else {\r\n return \"\";\r\n }\r\n}\r\n\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getRuntimeVersion(): string | undefined {\r\n if (Platform.isNode) {\r\n return process.versions.node;\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction getRuntime(): string {\r\n if (Platform.isNode) {\r\n return \"NodeJS\";\r\n } else {\r\n return \"Browser\";\r\n }\r\n}\r\n\r\n/** @private */\r\nexport function getErrorString(e: any): string {\r\n if (e.stack) {\r\n return e.stack;\r\n } else if (e.message) {\r\n return e.message;\r\n }\r\n return `${e}`;\r\n}\r\n\r\n/** @private */\r\nexport function getGlobalThis(): unknown {\r\n // globalThis is semi-new and not available in Node until v12\r\n if (typeof globalThis !== \"undefined\") {\r\n return globalThis;\r\n }\r\n if (typeof self !== \"undefined\") {\r\n return self;\r\n }\r\n if (typeof window !== \"undefined\") {\r\n return window;\r\n }\r\n if (typeof global !== \"undefined\") {\r\n return global;\r\n }\r\n throw new Error(\"could not find global\");\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// @ts-ignore: This will be removed from built files and is here to make the types available during dev work\r\nimport { CookieJar } from \"@types/tough-cookie\";\r\n\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { Platform, getGlobalThis, isArrayBuffer } from \"./Utils\";\r\nimport { configureAbortController, configureFetch } from \"./DynamicImports\";\r\n\r\nexport class FetchHttpClient extends HttpClient {\r\n private readonly _abortControllerType: { prototype: AbortController, new(): AbortController };\r\n private readonly _fetchType: (input: RequestInfo, init?: RequestInit) => Promise<Response>;\r\n private readonly _jar?: CookieJar;\r\n\r\n private readonly _logger: ILogger;\r\n\r\n public constructor(logger: ILogger) {\r\n super();\r\n this._logger = logger;\r\n\r\n // This is how you do \"reference\" arguments\r\n const fetchObj = { _fetchType: undefined, _jar: undefined };\r\n if (configureFetch(fetchObj)) {\r\n this._fetchType = fetchObj._fetchType!;\r\n this._jar = fetchObj._jar;\r\n } else {\r\n this._fetchType = fetch.bind(getGlobalThis());\r\n }\r\n\r\n this._abortControllerType = AbortController;\r\n const abortObj = { _abortControllerType: this._abortControllerType };\r\n if (configureAbortController(abortObj)) {\r\n this._abortControllerType = abortObj._abortControllerType;\r\n }\r\n }\r\n\r\n /** @inheritDoc */\r\n public async send(request: HttpRequest): Promise<HttpResponse> {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n throw new AbortError();\r\n }\r\n\r\n if (!request.method) {\r\n throw new Error(\"No method defined.\");\r\n }\r\n if (!request.url) {\r\n throw new Error(\"No url defined.\");\r\n }\r\n\r\n const abortController = new this._abortControllerType();\r\n\r\n let error: any;\r\n // Hook our abortSignal into the abort controller\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n abortController.abort();\r\n error = new AbortError();\r\n };\r\n }\r\n\r\n // If a timeout has been passed in, setup a timeout to call abort\r\n // Type needs to be any to fit window.setTimeout and NodeJS.setTimeout\r\n let timeoutId: any = null;\r\n if (request.timeout) {\r\n const msTimeout = request.timeout!;\r\n timeoutId = setTimeout(() => {\r\n abortController.abort();\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n error = new TimeoutError();\r\n }, msTimeout);\r\n }\r\n\r\n if (request.content === \"\") {\r\n request.content = undefined;\r\n }\r\n if (request.content) {\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n request.headers = request.headers || {};\r\n if (isArrayBuffer(request.content)) {\r\n request.headers[\"Content-Type\"] = \"application/octet-stream\";\r\n } else {\r\n request.headers[\"Content-Type\"] = \"text/plain;charset=UTF-8\";\r\n }\r\n }\r\n\r\n let response: Response;\r\n try {\r\n response = await this._fetchType(request.url!, {\r\n body: request.content,\r\n cache: \"no-cache\",\r\n credentials: request.withCredentials === true ? \"include\" : \"same-origin\",\r\n headers: {\r\n \"X-Requested-With\": \"XMLHttpRequest\",\r\n ...request.headers,\r\n },\r\n method: request.method!,\r\n mode: \"cors\",\r\n redirect: \"follow\",\r\n signal: abortController.signal,\r\n });\r\n } catch (e) {\r\n if (error) {\r\n throw error;\r\n }\r\n this._logger.log(\r\n LogLevel.Warning,\r\n `Error from HTTP request. ${e}.`,\r\n );\r\n throw e;\r\n } finally {\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n }\r\n\r\n if (!response.ok) {\r\n const errorMessage = await deserializeContent(response, \"text\") as string;\r\n throw new HttpError(errorMessage || response.statusText, response.status);\r\n }\r\n\r\n const content = deserializeContent(response, request.responseType);\r\n const payload = await content;\r\n\r\n return new HttpResponse(\r\n response.status,\r\n response.statusText,\r\n payload,\r\n );\r\n }\r\n\r\n public getCookieString(url: string): string {\r\n let cookies: string = \"\";\r\n if (Platform.isNode && this._jar) {\r\n // @ts-ignore: unused variable\r\n this._jar.getCookies(url, (e, c) => cookies = c.join(\"; \"));\r\n }\r\n return cookies;\r\n }\r\n}\r\n\r\nfunction deserializeContent(response: Response, responseType?: XMLHttpRequestResponseType): Promise<string | ArrayBuffer> {\r\n let content;\r\n switch (responseType) {\r\n case \"arraybuffer\":\r\n content = response.arrayBuffer();\r\n break;\r\n case \"text\":\r\n content = response.text();\r\n break;\r\n case \"blob\":\r\n case \"document\":\r\n case \"json\":\r\n throw new Error(`${responseType} is not supported.`);\r\n default:\r\n content = response.text();\r\n break;\r\n }\r\n\r\n return content;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n\r\nexport class XhrHttpClient extends HttpClient {\r\n private readonly _logger: ILogger;\r\n\r\n public constructor(logger: ILogger) {\r\n super();\r\n this._logger = logger;\r\n }\r\n\r\n /** @inheritDoc */\r\n public send(request: HttpRequest): Promise<HttpResponse> {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n\r\n return new Promise<HttpResponse>((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n\r\n xhr.open(request.method!, request.url!, true);\r\n xhr.withCredentials = request.withCredentials === undefined ? true : request.withCredentials;\r\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n if (request.content === \"\") {\r\n request.content = undefined;\r\n }\r\n if (request.content) {\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n if (isArrayBuffer(request.content)) {\r\n xhr.setRequestHeader(\"Content-Type\", \"application/octet-stream\");\r\n } else {\r\n xhr.setRequestHeader(\"Content-Type\", \"text/plain;charset=UTF-8\");\r\n }\r\n }\r\n\r\n const headers = request.headers;\r\n if (headers) {\r\n Object.keys(headers)\r\n .forEach((header) => {\r\n xhr.setRequestHeader(header, headers[header]);\r\n });\r\n }\r\n\r\n if (request.responseType) {\r\n xhr.responseType = request.responseType;\r\n }\r\n\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n xhr.abort();\r\n reject(new AbortError());\r\n };\r\n }\r\n\r\n if (request.timeout) {\r\n xhr.timeout = request.timeout;\r\n }\r\n\r\n xhr.onload = () => {\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));\r\n } else {\r\n reject(new HttpError(xhr.response || xhr.responseText || xhr.statusText, xhr.status));\r\n }\r\n };\r\n\r\n xhr.onerror = () => {\r\n this._logger.log(LogLevel.Warning, `Error from HTTP request. ${xhr.status}: ${xhr.statusText}.`);\r\n reject(new HttpError(xhr.statusText, xhr.status));\r\n };\r\n\r\n xhr.ontimeout = () => {\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n reject(new TimeoutError());\r\n };\r\n\r\n xhr.send(request.content);\r\n });\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortError } from \"./Errors\";\r\nimport { FetchHttpClient } from \"./FetchHttpClient\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\nimport { ILogger } from \"./ILogger\";\r\nimport { Platform } from \"./Utils\";\r\nimport { XhrHttpClient } from \"./XhrHttpClient\";\r\n\r\n/** Default implementation of {@link @microsoft/signalr.HttpClient}. */\r\nexport class DefaultHttpClient extends HttpClient {\r\n private readonly _httpClient: HttpClient;\r\n\r\n /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */\r\n public constructor(logger: ILogger) {\r\n super();\r\n\r\n if (typeof fetch !== \"undefined\" || Platform.isNode) {\r\n this._httpClient = new FetchHttpClient(logger);\r\n } else if (typeof XMLHttpRequest !== \"undefined\") {\r\n this._httpClient = new XhrHttpClient(logger);\r\n } else {\r\n throw new Error(\"No usable HttpClient found.\");\r\n }\r\n }\r\n\r\n /** @inheritDoc */\r\n public send(request: HttpRequest): Promise<HttpResponse> {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n\r\n return this._httpClient.send(request);\r\n }\r\n\r\n public getCookieString(url: string): string {\r\n return this._httpClient.getCookieString(url);\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Not exported from index\r\n/** @private */\r\nexport class TextMessageFormat {\r\n public static RecordSeparatorCode = 0x1e;\r\n public static RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\n\r\n public static write(output: string): string {\r\n return `${output}${TextMessageFormat.RecordSeparator}`;\r\n }\r\n\r\n public static parse(input: string): string[] {\r\n if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n const messages = input.split(TextMessageFormat.RecordSeparator);\r\n messages.pop();\r\n return messages;\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n\r\n/** @private */\r\nexport interface HandshakeRequestMessage {\r\n readonly protocol: string;\r\n readonly version: number;\r\n}\r\n\r\n/** @private */\r\nexport interface HandshakeResponseMessage {\r\n readonly error: string;\r\n readonly minorVersion: number;\r\n}\r\n\r\n/** @private */\r\nexport class HandshakeProtocol {\r\n // Handshake request is always JSON\r\n public writeHandshakeRequest(handshakeRequest: HandshakeRequestMessage): string {\r\n return TextMessageFormat.write(JSON.stringify(handshakeRequest));\r\n }\r\n\r\n public parseHandshakeResponse(data: any): [any, HandshakeResponseMessage] {\r\n let messageData: string;\r\n let remainingData: any;\r\n\r\n if (isArrayBuffer(data)) {\r\n // Format is binary but still need to read JSON text from handshake response\r\n const binaryData = new Uint8Array(data);\r\n const separatorIndex = binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));\r\n remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;\r\n } else {\r\n const textData: string = data;\r\n const separatorIndex = textData.indexOf(TextMessageFormat.RecordSeparator);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = textData.substring(0, responseLength);\r\n remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null;\r\n }\r\n\r\n // At this point we should have just the single handshake message\r\n const messages = TextMessageFormat.parse(messageData);\r\n const response = JSON.parse(messages[0]);\r\n if (response.type) {\r\n throw new Error(\"Expected a handshake response from the server.\");\r\n }\r\n const responseMessage: HandshakeResponseMessage = response;\r\n\r\n // multiple messages could have arrived with handshake\r\n // return additional data to be parsed as usual, or null if all parsed\r\n return [remainingData, responseMessage];\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { ILogger } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\n\r\n/** Defines the type of a Hub Message. */\r\nexport enum MessageType {\r\n /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */\r\n Invocation = 1,\r\n /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */\r\n StreamItem = 2,\r\n /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */\r\n Completion = 3,\r\n /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */\r\n StreamInvocation = 4,\r\n /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */\r\n CancelInvocation = 5,\r\n /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */\r\n Ping = 6,\r\n /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */\r\n Close = 7,\r\n Ack = 8,\r\n Sequence = 9\r\n}\r\n\r\n/** Defines a dictionary of string keys and string values representing headers attached to a Hub message. */\r\nexport interface MessageHeaders {\r\n /** Gets or sets the header with the specified key. */\r\n [key: string]: string;\r\n}\r\n\r\n/** Union type of all known Hub messages. */\r\nexport type HubMessage =\r\n InvocationMessage |\r\n StreamInvocationMessage |\r\n StreamItemMessage |\r\n CompletionMessage |\r\n CancelInvocationMessage |\r\n PingMessage |\r\n CloseMessage |\r\n AckMessage |\r\n SequenceMessage;\r\n\r\n/** Defines properties common to all Hub messages. */\r\nexport interface HubMessageBase {\r\n /** A {@link @microsoft/signalr.MessageType} value indicating the type of this message. */\r\n readonly type: MessageType;\r\n}\r\n\r\n/** Defines properties common to all Hub messages relating to a specific invocation. */\r\nexport interface HubInvocationMessage extends HubMessageBase {\r\n /** A {@link @microsoft/signalr.MessageHeaders} dictionary containing headers attached to the message. */\r\n readonly headers?: MessageHeaders;\r\n /** The ID of the invocation relating to this message.\r\n *\r\n * This is expected to be present for {@link @microsoft/signalr.StreamInvocationMessage} and {@link @microsoft/signalr.CompletionMessage}. It may\r\n * be 'undefined' for an {@link @microsoft/signalr.InvocationMessage} if the sender does not expect a response.\r\n */\r\n readonly invocationId?: string;\r\n}\r\n\r\n/** A hub message representing a non-streaming invocation. */\r\nexport interface InvocationMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Invocation;\r\n /** The target method name. */\r\n readonly target: string;\r\n /** The target method arguments. */\r\n readonly arguments: any[];\r\n /** The target methods stream IDs. */\r\n readonly streamIds?: string[];\r\n}\r\n\r\n/** A hub message representing a streaming invocation. */\r\nexport interface StreamInvocationMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.StreamInvocation;\r\n\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n /** The target method name. */\r\n readonly target: string;\r\n /** The target method arguments. */\r\n readonly arguments: any[];\r\n /** The target methods stream IDs. */\r\n readonly streamIds?: string[];\r\n}\r\n\r\n/** A hub message representing a single item produced as part of a result stream. */\r\nexport interface StreamItemMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.StreamItem;\r\n\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n\r\n /** The item produced by the server. */\r\n readonly item?: any;\r\n}\r\n\r\n/** A hub message representing the result of an invocation. */\r\nexport interface CompletionMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Completion;\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n /** The error produced by the invocation, if any.\r\n *\r\n * Either {@link @microsoft/signalr.CompletionMessage.error} or {@link @microsoft/signalr.CompletionMessage.result} must be defined, but not both.\r\n */\r\n readonly error?: string;\r\n /** The result produced by the invocation, if any.\r\n *\r\n * Either {@link @microsoft/signalr.CompletionMessage.error} or {@link @microsoft/signalr.CompletionMessage.result} must be defined, but not both.\r\n */\r\n readonly result?: any;\r\n}\r\n\r\n/** A hub message indicating that the sender is still active. */\r\nexport interface PingMessage extends HubMessageBase {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Ping;\r\n}\r\n\r\n/** A hub message indicating that the sender is closing the connection.\r\n *\r\n * If {@link @microsoft/signalr.CloseMessage.error} is defined, the sender is closing the connection due to an error.\r\n */\r\nexport interface CloseMessage extends HubMessageBase {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Close;\r\n /** The error that triggered the close, if any.\r\n *\r\n * If this property is undefined, the connection was closed normally and without error.\r\n */\r\n readonly error?: string;\r\n\r\n /** If true, clients with automatic reconnects enabled should attempt to reconnect after receiving the CloseMessage. Otherwise, they should not. */\r\n readonly allowReconnect?: boolean;\r\n}\r\n\r\n/** A hub message sent to request that a streaming invocation be canceled. */\r\nexport interface CancelInvocationMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.CancelInvocation;\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n}\r\n\r\nexport interface AckMessage extends HubMessageBase\r\n{\r\n readonly type: MessageType.Ack;\r\n\r\n readonly sequenceId: number;\r\n}\r\n\r\nexport interface SequenceMessage extends HubMessageBase\r\n{\r\n readonly type: MessageType.Sequence;\r\n\r\n readonly sequenceId: number;\r\n}\r\n\r\n/** A protocol abstraction for communicating with SignalR Hubs. */\r\nexport interface IHubProtocol {\r\n /** The name of the protocol. This is used by SignalR to resolve the protocol between the client and server. */\r\n readonly name: string;\r\n /** The version of the protocol. */\r\n readonly version: number;\r\n /** The {@link @microsoft/signalr.TransferFormat} of the protocol. */\r\n readonly transferFormat: TransferFormat;\r\n\r\n /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * If {@link @microsoft/signalr.IHubProtocol.transferFormat} is 'Text', the `input` parameter must be a string, otherwise it must be an ArrayBuffer.\r\n *\r\n * @param {string | ArrayBuffer} input A string or ArrayBuffer containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n parseMessages(input: string | ArrayBuffer, logger: ILogger): HubMessage[];\r\n\r\n /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string or ArrayBuffer and returns it.\r\n *\r\n * If {@link @microsoft/signalr.IHubProtocol.transferFormat} is 'Text', the result of this method will be a string, otherwise it will be an ArrayBuffer.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string | ArrayBuffer} A string or ArrayBuffer containing the serialized representation of the message.\r\n */\r\n writeMessage(message: HubMessage): string | ArrayBuffer;\r\n}","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HandshakeProtocol, HandshakeRequestMessage, HandshakeResponseMessage } from \"./HandshakeProtocol\";\r\nimport { IConnection } from \"./IConnection\";\r\nimport { AbortError } from \"./Errors\";\r\nimport { CancelInvocationMessage, CloseMessage, CompletionMessage, IHubProtocol, InvocationMessage, MessageType, StreamInvocationMessage, StreamItemMessage } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { IRetryPolicy } from \"./IRetryPolicy\";\r\nimport { IStreamResult } from \"./Stream\";\r\nimport { Subject } from \"./Subject\";\r\nimport { Arg, getErrorString, Platform } from \"./Utils\";\r\nimport { MessageBuffer } from \"./MessageBuffer\";\r\n\r\nconst DEFAULT_TIMEOUT_IN_MS: number = 30 * 1000;\r\nconst DEFAULT_PING_INTERVAL_IN_MS: number = 15 * 1000;\r\nconst DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE = 100_000;\r\n\r\n/** Describes the current state of the {@link HubConnection} to the server. */\r\nexport enum HubConnectionState {\r\n /** The hub connection is disconnected. */\r\n Disconnected = \"Disconnected\",\r\n /** The hub connection is connecting. */\r\n Connecting = \"Connecting\",\r\n /** The hub connection is connected. */\r\n Connected = \"Connected\",\r\n /** The hub connection is disconnecting. */\r\n Disconnecting = \"Disconnecting\",\r\n /** The hub connection is reconnecting. */\r\n Reconnecting = \"Reconnecting\",\r\n}\r\n\r\n/** Represents a connection to a SignalR Hub. */\r\nexport class HubConnection {\r\n private readonly _cachedPingMessage: string | ArrayBuffer;\r\n // Needs to not start with _ for tests\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private readonly connection: IConnection;\r\n private readonly _logger: ILogger;\r\n private readonly _reconnectPolicy?: IRetryPolicy;\r\n private readonly _statefulReconnectBufferSize: number;\r\n private _protocol: IHubProtocol;\r\n private _handshakeProtocol: HandshakeProtocol;\r\n private _callbacks: { [invocationId: string]: (invocationEvent: StreamItemMessage | CompletionMessage | null, error?: Error) => void };\r\n private _methods: { [name: string]: (((...args: any[]) => void) | ((...args: any[]) => any))[] };\r\n private _invocationId: number;\r\n private _messageBuffer?: MessageBuffer;\r\n\r\n private _closedCallbacks: ((error?: Error) => void)[];\r\n private _reconnectingCallbacks: ((error?: Error) => void)[];\r\n private _reconnectedCallbacks: ((connectionId?: string) => void)[];\r\n\r\n private _receivedHandshakeResponse: boolean;\r\n private _handshakeResolver!: (value?: PromiseLike<{}>) => void;\r\n private _handshakeRejecter!: (reason?: any) => void;\r\n private _stopDuringStartError?: Error;\r\n\r\n private _connectionState: HubConnectionState;\r\n // connectionStarted is tracked independently from connectionState, so we can check if the\r\n // connection ever did successfully transition from connecting to connected before disconnecting.\r\n private _connectionStarted: boolean;\r\n private _startPromise?: Promise<void>;\r\n private _stopPromise?: Promise<void>;\r\n private _nextKeepAlive: number = 0;\r\n\r\n // The type of these a) doesn't matter and b) varies when building in browser and node contexts\r\n // Since we're building the WebPack bundle directly from the TypeScript, this matters (previously\r\n // we built the bundle from the compiled JavaScript).\r\n private _reconnectDelayHandle?: any;\r\n private _timeoutHandle?: any;\r\n private _pingServerHandle?: any;\r\n\r\n private _freezeEventListener = () =>\r\n {\r\n this._logger.log(LogLevel.Warning, \"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep\");\r\n };\r\n\r\n /** The server timeout in milliseconds.\r\n *\r\n * If this timeout elapses without receiving any messages from the server, the connection will be terminated with an error.\r\n * The default timeout value is 30,000 milliseconds (30 seconds).\r\n */\r\n public serverTimeoutInMilliseconds: number;\r\n\r\n /** Default interval at which to ping the server.\r\n *\r\n * The default value is 15,000 milliseconds (15 seconds).\r\n * Allows the server to detect hard disconnects (like when a client unplugs their computer).\r\n * The ping will happen at most as often as the server pings.\r\n * If the server pings every 5 seconds, a value lower than 5 will ping every 5 seconds.\r\n */\r\n public keepAliveIntervalInMilliseconds: number;\r\n\r\n /** @internal */\r\n // Using a public static factory method means we can have a private constructor and an _internal_\r\n // create method that can be used by HubConnectionBuilder. An \"internal\" constructor would just\r\n // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a\r\n // public parameter-less constructor.\r\n public static create(\r\n connection: IConnection,\r\n logger: ILogger,\r\n protocol: IHubProtocol,\r\n reconnectPolicy?: IRetryPolicy,\r\n serverTimeoutInMilliseconds?: number,\r\n keepAliveIntervalInMilliseconds?: number,\r\n statefulReconnectBufferSize?: number): HubConnection {\r\n return new HubConnection(connection, logger, protocol, reconnectPolicy,\r\n serverTimeoutInMilliseconds, keepAliveIntervalInMilliseconds, statefulReconnectBufferSize);\r\n }\r\n\r\n private constructor(\r\n connection: IConnection,\r\n logger: ILogger,\r\n protocol: IHubProtocol,\r\n reconnectPolicy?: IRetryPolicy,\r\n serverTimeoutInMilliseconds?: number,\r\n keepAliveIntervalInMilliseconds?: number,\r\n statefulReconnectBufferSize?: number) {\r\n Arg.isRequired(connection, \"connection\");\r\n Arg.isRequired(logger, \"logger\");\r\n Arg.isRequired(protocol, \"protocol\");\r\n\r\n this.serverTimeoutInMilliseconds = serverTimeoutInMilliseconds ?? DEFAULT_TIMEOUT_IN_MS;\r\n this.keepAliveIntervalInMilliseconds = keepAliveIntervalInMilliseconds ?? DEFAULT_PING_INTERVAL_IN_MS;\r\n\r\n this._statefulReconnectBufferSize = statefulReconnectBufferSize ?? DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE;\r\n\r\n this._logger = logger;\r\n this._protocol = protocol;\r\n this.connection = connection;\r\n this._reconnectPolicy = reconnectPolicy;\r\n this._handshakeProtocol = new HandshakeProtocol();\r\n\r\n this.connection.onreceive = (data: any) => this._processIncomingData(data);\r\n this.connection.onclose = (error?: Error) => this._connectionClosed(error);\r\n\r\n this._callbacks = {};\r\n this._methods = {};\r\n this._closedCallbacks = [];\r\n this._reconnectingCallbacks = [];\r\n this._reconnectedCallbacks = [];\r\n this._invocationId = 0;\r\n this._receivedHandshakeResponse = false;\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n\r\n this._cachedPingMessage = this._protocol.writeMessage({ type: MessageType.Ping });\r\n }\r\n\r\n /** Indicates the state of the {@link HubConnection} to the server. */\r\n get state(): HubConnectionState {\r\n return this._connectionState;\r\n }\r\n\r\n /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either\r\n * in the disconnected state or if the negotiation step was skipped.\r\n */\r\n get connectionId(): string | null {\r\n return this.connection ? (this.connection.connectionId || null) : null;\r\n }\r\n\r\n /** Indicates the url of the {@link HubConnection} to the server. */\r\n get baseUrl(): string {\r\n return this.connection.baseUrl || \"\";\r\n }\r\n\r\n /**\r\n * Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or\r\n * Reconnecting states.\r\n * @param {string} url The url to connect to.\r\n */\r\n set baseUrl(url: string) {\r\n if (this._connectionState !== HubConnectionState.Disconnected && this._connectionState !== HubConnectionState.Reconnecting) {\r\n throw new Error(\"The HubConnection must be in the Disconnected or Reconnecting state to change the url.\");\r\n }\r\n\r\n if (!url) {\r\n throw new Error(\"The HubConnection url must be a valid url.\");\r\n }\r\n\r\n this.connection.baseUrl = url;\r\n }\r\n\r\n /** Starts the connection.\r\n *\r\n * @returns {Promise<void>} A Promise that resolves when the connection has been successfully established, or rejects with an error.\r\n */\r\n public start(): Promise<void> {\r\n this._startPromise = this._startWithStateTransitions();\r\n return this._startPromise;\r\n }\r\n\r\n private async _startWithStateTransitions(): Promise<void> {\r\n if (this._connectionState !== HubConnectionState.Disconnected) {\r\n return Promise.reject(new Error(\"Cannot start a HubConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n\r\n this._connectionState = HubConnectionState.Connecting;\r\n this._logger.log(LogLevel.Debug, \"Starting HubConnection.\");\r\n\r\n try {\r\n await this._startInternal();\r\n\r\n if (Platform.isBrowser) {\r\n // Log when the browser freezes the tab so users know why their connection unexpectedly stopped working\r\n window.document.addEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n\r\n this._connectionState = HubConnectionState.Connected;\r\n this._connectionStarted = true;\r\n this._logger.log(LogLevel.Debug, \"HubConnection connected successfully.\");\r\n } catch (e) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._logger.log(LogLevel.Debug, `HubConnection failed to start successfully because of error '${e}'.`);\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n private async _startInternal() {\r\n this._stopDuringStartError = undefined;\r\n this._receivedHandshakeResponse = false;\r\n // Set up the promise before any connection is (re)started otherwise it could race with received messages\r\n const handshakePromise = new Promise((resolve, reject) => {\r\n this._handshakeResolver = resolve;\r\n this._handshakeRejecter = reject;\r\n });\r\n\r\n await this.connection.start(this._protocol.transferFormat);\r\n\r\n try {\r\n let version = this._protocol.version;\r\n if (!this.connection.features.reconnect) {\r\n // Stateful Reconnect starts with HubProtocol version 2, newer clients connecting to older servers will fail to connect due to\r\n // the handshake only supporting version 1, so we will try to send version 1 during the handshake to keep old servers working.\r\n version = 1;\r\n }\r\n\r\n const handshakeRequest: HandshakeRequestMessage = {\r\n protocol: this._protocol.name,\r\n version,\r\n };\r\n\r\n this._logger.log(LogLevel.Debug, \"Sending handshake request.\");\r\n\r\n await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(handshakeRequest));\r\n\r\n this._logger.log(LogLevel.Information, `Using HubProtocol '${this._protocol.name}'.`);\r\n\r\n // defensively cleanup timeout in case we receive a message from the server before we finish start\r\n this._cleanupTimeout();\r\n this._resetTimeoutPeriod();\r\n this._resetKeepAliveInterval();\r\n\r\n await handshakePromise;\r\n\r\n // It's important to check the stopDuringStartError instead of just relying on the handshakePromise\r\n // being rejected on close, because this continuation can run after both the handshake completed successfully\r\n // and the connection was closed.\r\n if (this._stopDuringStartError) {\r\n // It's important to throw instead of returning a rejected promise, because we don't want to allow any state\r\n // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise\r\n // will cause the calling continuation to get scheduled to run later.\r\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\r\n throw this._stopDuringStartError;\r\n }\r\n\r\n const useStatefulReconnect = this.connection.features.reconnect || false;\r\n if (useStatefulReconnect) {\r\n this._messageBuffer = new MessageBuffer(this._protocol, this.connection, this._statefulReconnectBufferSize);\r\n this.connection.features.disconnected = this._messageBuffer._disconnected.bind(this._messageBuffer);\r\n this.connection.features.resend = () => {\r\n if (this._messageBuffer) {\r\n return this._messageBuffer._resend();\r\n }\r\n }\r\n }\r\n\r\n if (!this.connection.features.inherentKeepAlive) {\r\n await this._sendMessage(this._cachedPingMessage);\r\n }\r\n } catch (e) {\r\n this._logger.log(LogLevel.Debug, `Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`);\r\n\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n\r\n // HttpConnection.stop() should not complete until after the onclose callback is invoked.\r\n // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes.\r\n await this.connection.stop(e);\r\n throw e;\r\n }\r\n }\r\n\r\n /** Stops the connection.\r\n *\r\n * @returns {Promise<void>} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.\r\n */\r\n public async stop(): Promise<void> {\r\n // Capture the start promise before the connection might be restarted in an onclose callback.\r\n const startPromise = this._startPromise;\r\n this.connection.features.reconnect = false;\r\n\r\n this._stopPromise = this._stopInternal();\r\n await this._stopPromise;\r\n\r\n try {\r\n // Awaiting undefined continues immediately\r\n await startPromise;\r\n } catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n }\r\n\r\n private _stopInternal(error?: Error): Promise<void> {\r\n if (this._connectionState === HubConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HubConnection.stop(${error}) ignored because it is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise!;\r\n }\r\n\r\n const state = this._connectionState;\r\n this._connectionState = HubConnectionState.Disconnecting;\r\n\r\n this._logger.log(LogLevel.Debug, \"Stopping HubConnection.\");\r\n\r\n if (this._reconnectDelayHandle) {\r\n // We're in a reconnect delay which means the underlying connection is currently already stopped.\r\n // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and\r\n // fire the onclose callbacks.\r\n this._logger.log(LogLevel.Debug, \"Connection stopped during reconnect delay. Done reconnecting.\");\r\n\r\n clearTimeout(this._reconnectDelayHandle);\r\n this._reconnectDelayHandle = undefined;\r\n\r\n this._completeClose();\r\n return Promise.resolve();\r\n }\r\n\r\n if (state === HubConnectionState.Connected) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._sendCloseMessage();\r\n }\r\n\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n this._stopDuringStartError = error || new AbortError(\"The connection was stopped before the hub handshake could complete.\");\r\n\r\n // HttpConnection.stop() should not complete until after either HttpConnection.start() fails\r\n // or the onclose callback is invoked. The onclose callback will transition the HubConnection\r\n // to the disconnected state if need be before HttpConnection.stop() completes.\r\n return this.connection.stop(error);\r\n }\r\n\r\n private async _sendCloseMessage() {\r\n try {\r\n await this._sendWithProtocol(this._createCloseMessage());\r\n } catch {\r\n // Ignore, this is a best effort attempt to let the server know the client closed gracefully.\r\n }\r\n }\r\n\r\n /** Invokes a streaming hub method on the server using the specified name and arguments.\r\n *\r\n * @typeparam T The type of the items returned by the server.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {IStreamResult<T>} An object that yields results from the server as they are received.\r\n */\r\n public stream<T = any>(methodName: string, ...args: any[]): IStreamResult<T> {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createStreamInvocation(methodName, args, streamIds);\r\n\r\n // eslint-disable-next-line prefer-const\r\n let promiseQueue: Promise<void>;\r\n\r\n const subject = new Subject<T>();\r\n subject.cancelCallback = () => {\r\n const cancelInvocation: CancelInvocationMessage = this._createCancelInvocation(invocationDescriptor.invocationId);\r\n\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n\r\n return promiseQueue.then(() => {\r\n return this._sendWithProtocol(cancelInvocation);\r\n });\r\n };\r\n\r\n this._callbacks[invocationDescriptor.invocationId] = (invocationEvent: CompletionMessage | StreamItemMessage | null, error?: Error) => {\r\n if (error) {\r\n subject.error(error);\r\n return;\r\n } else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n subject.error(new Error(invocationEvent.error));\r\n } else {\r\n subject.complete();\r\n }\r\n } else {\r\n subject.next((invocationEvent.item) as T);\r\n }\r\n }\r\n };\r\n\r\n promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n subject.error(e);\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n });\r\n\r\n this._launchStreams(streams, promiseQueue);\r\n\r\n return subject;\r\n }\r\n\r\n private _sendMessage(message: any) {\r\n this._resetKeepAliveInterval();\r\n return this.connection.send(message);\r\n }\r\n\r\n /**\r\n * Sends a js object to the server.\r\n * @param message The js object to serialize and send.\r\n */\r\n private _sendWithProtocol(message: any) {\r\n if (this._messageBuffer) {\r\n return this._messageBuffer._send(message);\r\n } else {\r\n return this._sendMessage(this._protocol.writeMessage(message));\r\n }\r\n }\r\n\r\n /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.\r\n *\r\n * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still\r\n * be processing the invocation.\r\n *\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise<void>} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.\r\n */\r\n public send(methodName: string, ...args: any[]): Promise<void> {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const sendPromise = this._sendWithProtocol(this._createInvocation(methodName, args, true, streamIds));\r\n\r\n this._launchStreams(streams, sendPromise);\r\n\r\n return sendPromise;\r\n }\r\n\r\n /** Invokes a hub method on the server using the specified name and arguments.\r\n *\r\n * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise\r\n * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of\r\n * resolving the Promise.\r\n *\r\n * @typeparam T The expected return type.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise<T>} A Promise that resolves with the result of the server method (if any), or rejects with an error.\r\n */\r\n public invoke<T = any>(methodName: string, ...args: any[]): Promise<T> {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createInvocation(methodName, args, false, streamIds);\r\n\r\n const p = new Promise<any>((resolve, reject) => {\r\n // invocationId will always have a value for a non-blocking invocation\r\n this._callbacks[invocationDescriptor.invocationId!] = (invocationEvent: StreamItemMessage | CompletionMessage | null, error?: Error) => {\r\n if (error) {\r\n reject(error);\r\n return;\r\n } else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n reject(new Error(invocationEvent.error));\r\n } else {\r\n resolve(invocationEvent.result);\r\n }\r\n } else {\r\n reject(new Error(`Unexpected message type: ${invocationEvent.type}`));\r\n }\r\n }\r\n };\r\n\r\n const promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n reject(e);\r\n // invocationId will always have a value for a non-blocking invocation\r\n delete this._callbacks[invocationDescriptor.invocationId!];\r\n });\r\n\r\n this._launchStreams(streams, promiseQueue);\r\n });\r\n\r\n return p;\r\n }\r\n\r\n /** Registers a handler that will be invoked when the hub method with the specified method name is invoked.\r\n *\r\n * @param {string} methodName The name of the hub method to define.\r\n * @param {Function} newMethod The handler that will be raised when the hub method is invoked.\r\n */\r\n public on(methodName: string, newMethod: (...args: any[]) => any): void\r\n public on(methodName: string, newMethod: (...args: any[]) => void): void {\r\n if (!methodName || !newMethod) {\r\n return;\r\n }\r\n\r\n methodName = methodName.toLowerCase();\r\n if (!this._methods[methodName]) {\r\n this._methods[methodName] = [];\r\n }\r\n\r\n // Preventing adding the same handler multiple times.\r\n if (this._methods[methodName].indexOf(newMethod) !== -1) {\r\n return;\r\n }\r\n\r\n this._methods[methodName].push(newMethod);\r\n }\r\n\r\n /** Removes all handlers for the specified hub method.\r\n *\r\n * @param {string} methodName The name of the method to remove handlers for.\r\n */\r\n public off(methodName: string): void;\r\n\r\n /** Removes the specified handler for the specified hub method.\r\n *\r\n * You must pass the exact same Function instance as was previously passed to {@link @microsoft/signalr.HubConnection.on}. Passing a different instance (even if the function\r\n * body is the same) will not remove the handler.\r\n *\r\n * @param {string} methodName The name of the method to remove handlers for.\r\n * @param {Function} method The handler to remove. This must be the same Function instance as the one passed to {@link @microsoft/signalr.HubConnection.on}.\r\n */\r\n public off(methodName: string, method: (...args: any[]) => void): void;\r\n public off(methodName: string, method?: (...args: any[]) => void): void {\r\n if (!methodName) {\r\n return;\r\n }\r\n\r\n methodName = methodName.toLowerCase();\r\n const handlers = this._methods[methodName];\r\n if (!handlers) {\r\n return;\r\n }\r\n if (method) {\r\n const removeIdx = handlers.indexOf(method);\r\n if (removeIdx !== -1) {\r\n handlers.splice(removeIdx, 1);\r\n if (handlers.length === 0) {\r\n delete this._methods[methodName];\r\n }\r\n }\r\n } else {\r\n delete this._methods[methodName];\r\n }\r\n\r\n }\r\n\r\n /** Registers a handler that will be invoked when the connection is closed.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).\r\n */\r\n public onclose(callback: (error?: Error) => void): void {\r\n if (callback) {\r\n this._closedCallbacks.push(callback);\r\n }\r\n }\r\n\r\n /** Registers a handler that will be invoked when the connection starts reconnecting.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any).\r\n */\r\n public onreconnecting(callback: (error?: Error) => void): void {\r\n if (callback) {\r\n this._reconnectingCallbacks.push(callback);\r\n }\r\n }\r\n\r\n /** Registers a handler that will be invoked when the connection successfully reconnects.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection successfully reconnects.\r\n */\r\n public onreconnected(callback: (connectionId?: string) => void): void {\r\n if (callback) {\r\n this._reconnectedCallbacks.push(callback);\r\n }\r\n }\r\n\r\n private _processIncomingData(data: any) {\r\n this._cleanupTimeout();\r\n\r\n if (!this._receivedHandshakeResponse) {\r\n data = this._processHandshakeResponse(data);\r\n this._receivedHandshakeResponse = true;\r\n }\r\n\r\n // Data may have all been read when processing handshake response\r\n if (data) {\r\n // Parse the messages\r\n const messages = this._protocol.parseMessages(data, this._logger);\r\n\r\n for (const message of messages) {\r\n if (this._messageBuffer && !this._messageBuffer._shouldProcessMessage(message)) {\r\n // Don't process the message, we are either waiting for a SequenceMessage or received a duplicate message\r\n continue;\r\n }\r\n\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._invokeClientMethod(message);\r\n break;\r\n case MessageType.StreamItem:\r\n case MessageType.Completion: {\r\n const callback = this._callbacks[message.invocationId];\r\n if (callback) {\r\n if (message.type === MessageType.Completion) {\r\n delete this._callbacks[message.invocationId];\r\n }\r\n try {\r\n callback(message);\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream callback threw error: ${getErrorString(e)}`);\r\n }\r\n }\r\n break;\r\n }\r\n case MessageType.Ping:\r\n // Don't care about pings\r\n break;\r\n case MessageType.Close: {\r\n this._logger.log(LogLevel.Information, \"Close message received from server.\");\r\n\r\n const error = message.error ? new Error(\"Server returned an error on close: \" + message.error) : undefined;\r\n\r\n if (message.allowReconnect === true) {\r\n // It feels wrong not to await connection.stop() here, but processIncomingData is called as part of an onreceive callback which is not async,\r\n // this is already the behavior for serverTimeout(), and HttpConnection.Stop() should catch and log all possible exceptions.\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(error);\r\n } else {\r\n // We cannot await stopInternal() here, but subsequent calls to stop() will await this if stopInternal() is still ongoing.\r\n this._stopPromise = this._stopInternal(error);\r\n }\r\n\r\n break;\r\n }\r\n case MessageType.Ack:\r\n if (this._messageBuffer) {\r\n this._messageBuffer._ack(message);\r\n }\r\n break;\r\n case MessageType.Sequence:\r\n if (this._messageBuffer) {\r\n this._messageBuffer._resetSequence(message);\r\n }\r\n break;\r\n default:\r\n this._logger.log(LogLevel.Warning, `Invalid message type: ${message.type}.`);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this._resetTimeoutPeriod();\r\n }\r\n\r\n private _processHandshakeResponse(data: any): any {\r\n let responseMessage: HandshakeResponseMessage;\r\n let remainingData: any;\r\n\r\n try {\r\n [remainingData, responseMessage] = this._handshakeProtocol.parseHandshakeResponse(data);\r\n } catch (e) {\r\n const message = \"Error parsing handshake response: \" + e;\r\n this._logger.log(LogLevel.Error, message);\r\n\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n }\r\n if (responseMessage.error) {\r\n const message = \"Server returned handshake error: \" + responseMessage.error;\r\n this._logger.log(LogLevel.Error, message);\r\n\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n } else {\r\n this._logger.log(LogLevel.Debug, \"Server handshake complete.\");\r\n }\r\n\r\n this._handshakeResolver();\r\n return remainingData;\r\n }\r\n\r\n private _resetKeepAliveInterval() {\r\n if (this.connection.features.inherentKeepAlive) {\r\n return;\r\n }\r\n\r\n // Set the time we want the next keep alive to be sent\r\n // Timer will be setup on next message receive\r\n this._nextKeepAlive = new Date().getTime() + this.keepAliveIntervalInMilliseconds;\r\n\r\n this._cleanupPingTimer();\r\n }\r\n\r\n private _resetTimeoutPeriod() {\r\n if (!this.connection.features || !this.connection.features.inherentKeepAlive) {\r\n // Set the timeout timer\r\n this._timeoutHandle = setTimeout(() => this.serverTimeout(), this.serverTimeoutInMilliseconds);\r\n\r\n // Set keepAlive timer if there isn't one\r\n if (this._pingServerHandle === undefined)\r\n {\r\n let nextPing = this._nextKeepAlive - new Date().getTime();\r\n if (nextPing < 0) {\r\n nextPing = 0;\r\n }\r\n\r\n // The timer needs to be set from a networking callback to avoid Chrome timer throttling from causing timers to run once a minute\r\n this._pingServerHandle = setTimeout(async () => {\r\n if (this._connectionState === HubConnectionState.Connected) {\r\n try {\r\n await this._sendMessage(this._cachedPingMessage);\r\n } catch {\r\n // We don't care about the error. It should be seen elsewhere in the client.\r\n // The connection is probably in a bad or closed state now, cleanup the timer so it stops triggering\r\n this._cleanupPingTimer();\r\n }\r\n }\r\n }, nextPing);\r\n }\r\n }\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private serverTimeout() {\r\n // The server hasn't talked to us in a while. It doesn't like us anymore ... :(\r\n // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(new Error(\"Server timeout elapsed without receiving a message from the server.\"));\r\n }\r\n\r\n private async _invokeClientMethod(invocationMessage: InvocationMessage) {\r\n const methodName = invocationMessage.target.toLowerCase();\r\n const methods = this._methods[methodName];\r\n if (!methods) {\r\n this._logger.log(LogLevel.Warning, `No client method with the name '${methodName}' found.`);\r\n\r\n // No handlers provided by client but the server is expecting a response still, so we send an error\r\n if (invocationMessage.invocationId) {\r\n this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r\n await this._sendWithProtocol(this._createCompletionMessage(invocationMessage.invocationId, \"Client didn't provide a result.\", null));\r\n }\r\n return;\r\n }\r\n\r\n // Avoid issues with handlers removing themselves thus modifying the list while iterating through it\r\n const methodsCopy = methods.slice();\r\n\r\n // Server expects a response\r\n const expectsResponse = invocationMessage.invocationId ? true : false;\r\n // We preserve the last result or exception but still call all handlers\r\n let res;\r\n let exception;\r\n let completionMessage;\r\n for (const m of methodsCopy) {\r\n try {\r\n const prevRes = res;\r\n res = await m.apply(this, invocationMessage.arguments);\r\n if (expectsResponse && res && prevRes) {\r\n this._logger.log(LogLevel.Error, `Multiple results provided for '${methodName}'. Sending error to server.`);\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, `Client provided multiple results.`, null);\r\n }\r\n // Ignore exception if we got a result after, the exception will be logged\r\n exception = undefined;\r\n } catch (e) {\r\n exception = e;\r\n this._logger.log(LogLevel.Error, `A callback for the method '${methodName}' threw error '${e}'.`);\r\n }\r\n }\r\n if (completionMessage) {\r\n await this._sendWithProtocol(completionMessage);\r\n } else if (expectsResponse) {\r\n // If there is an exception that means either no result was given or a handler after a result threw\r\n if (exception) {\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, `${exception}`, null);\r\n } else if (res !== undefined) {\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, null, res);\r\n } else {\r\n this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r\n // Client didn't provide a result or throw from a handler, server expects a response so we send an error\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, \"Client didn't provide a result.\", null);\r\n }\r\n await this._sendWithProtocol(completionMessage);\r\n } else {\r\n if (res) {\r\n this._logger.log(LogLevel.Error, `Result given for '${methodName}' method but server is not expecting a result.`);\r\n }\r\n }\r\n }\r\n\r\n private _connectionClosed(error?: Error) {\r\n this._logger.log(LogLevel.Debug, `HubConnection.connectionClosed(${error}) called while in state ${this._connectionState}.`);\r\n\r\n // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet.\r\n this._stopDuringStartError = this._stopDuringStartError || error || new AbortError(\"The underlying connection was closed before the hub handshake could complete.\");\r\n\r\n // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it.\r\n // If it has already completed, this should just noop.\r\n if (this._handshakeResolver) {\r\n this._handshakeResolver();\r\n }\r\n\r\n this._cancelCallbacksWithError(error || new Error(\"Invocation canceled due to the underlying connection being closed.\"));\r\n\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._completeClose(error);\r\n } else if (this._connectionState === HubConnectionState.Connected && this._reconnectPolicy) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._reconnect(error);\r\n } else if (this._connectionState === HubConnectionState.Connected) {\r\n this._completeClose(error);\r\n }\r\n\r\n // If none of the above if conditions were true were called the HubConnection must be in either:\r\n // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it.\r\n // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt\r\n // and potentially continue the reconnect() loop.\r\n // 3. The Disconnected state in which case we're already done.\r\n }\r\n\r\n private _completeClose(error?: Error) {\r\n if (this._connectionStarted) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n if (this._messageBuffer) {\r\n this._messageBuffer._dispose(error ?? new Error(\"Connection closed.\"));\r\n this._messageBuffer = undefined;\r\n }\r\n\r\n if (Platform.isBrowser) {\r\n window.document.removeEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n\r\n try {\r\n this._closedCallbacks.forEach((c) => c.apply(this, [error]));\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `An onclose callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n\r\n private async _reconnect(error?: Error) {\r\n const reconnectStartTime = Date.now();\r\n let previousReconnectAttempts = 0;\r\n let retryError = error !== undefined ? error : new Error(\"Attempting to reconnect due to a unknown error.\");\r\n\r\n let nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, 0, retryError);\r\n\r\n if (nextRetryDelay === null) {\r\n this._logger.log(LogLevel.Debug, \"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.\");\r\n this._completeClose(error);\r\n return;\r\n }\r\n\r\n this._connectionState = HubConnectionState.Reconnecting;\r\n\r\n if (error) {\r\n this._logger.log(LogLevel.Information, `Connection reconnecting because of error '${error}'.`);\r\n } else {\r\n this._logger.log(LogLevel.Information, \"Connection reconnecting.\");\r\n }\r\n\r\n if (this._reconnectingCallbacks.length !== 0) {\r\n try {\r\n this._reconnectingCallbacks.forEach((c) => c.apply(this, [error]));\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnecting callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n\r\n // Exit early if an onreconnecting callback called connection.stop().\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.\");\r\n return;\r\n }\r\n }\r\n\r\n while (nextRetryDelay !== null) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt number ${previousReconnectAttempts} will start in ${nextRetryDelay} ms.`);\r\n\r\n await new Promise((resolve) => {\r\n this._reconnectDelayHandle = setTimeout(resolve, nextRetryDelay!);\r\n });\r\n this._reconnectDelayHandle = undefined;\r\n\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state during reconnect delay. Done reconnecting.\");\r\n return;\r\n }\r\n\r\n try {\r\n await this._startInternal();\r\n\r\n this._connectionState = HubConnectionState.Connected;\r\n this._logger.log(LogLevel.Information, \"HubConnection reconnected successfully.\");\r\n\r\n if (this._reconnectedCallbacks.length !== 0) {\r\n try {\r\n this._reconnectedCallbacks.forEach((c) => c.apply(this, [this.connection.connectionId]));\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`);\r\n }\r\n }\r\n\r\n return;\r\n } catch (e) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt failed because of error '${e}'.`);\r\n\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, `Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`);\r\n // The TypeScript compiler thinks that connectionState must be Connected here. The TypeScript compiler is wrong.\r\n if (this._connectionState as any === HubConnectionState.Disconnecting) {\r\n this._completeClose();\r\n }\r\n return;\r\n }\r\n\r\n retryError = e instanceof Error ? e : new Error((e as any).toString());\r\n nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime, retryError);\r\n }\r\n }\r\n\r\n this._logger.log(LogLevel.Information, `Reconnect retries have been exhausted after ${Date.now() - reconnectStartTime} ms and ${previousReconnectAttempts} failed attempts. Connection disconnecting.`);\r\n\r\n this._completeClose();\r\n }\r\n\r\n private _getNextRetryDelay(previousRetryCount: number, elapsedMilliseconds: number, retryReason: Error) {\r\n try {\r\n return this._reconnectPolicy!.nextRetryDelayInMilliseconds({\r\n elapsedMilliseconds,\r\n previousRetryCount,\r\n retryReason,\r\n });\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `IRetryPolicy.nextRetryDelayInMilliseconds(${previousRetryCount}, ${elapsedMilliseconds}) threw error '${e}'.`);\r\n return null;\r\n }\r\n }\r\n\r\n private _cancelCallbacksWithError(error: Error) {\r\n const callbacks = this._callbacks;\r\n this._callbacks = {};\r\n\r\n Object.keys(callbacks)\r\n .forEach((key) => {\r\n const callback = callbacks[key];\r\n try {\r\n callback(null, error);\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream 'error' callback called with '${error}' threw error: ${getErrorString(e)}`);\r\n }\r\n });\r\n }\r\n\r\n private _cleanupPingTimer(): void {\r\n if (this._pingServerHandle) {\r\n clearTimeout(this._pingServerHandle);\r\n this._pingServerHandle = undefined;\r\n }\r\n }\r\n\r\n private _cleanupTimeout(): void {\r\n if (this._timeoutHandle) {\r\n clearTimeout(this._timeoutHandle);\r\n }\r\n }\r\n\r\n private _createInvocation(methodName: string, args: any[], nonblocking: boolean, streamIds: string[]): InvocationMessage {\r\n if (nonblocking) {\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n } else {\r\n return {\r\n arguments: args,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n } else {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n } else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n }\r\n }\r\n\r\n private _launchStreams(streams: IStreamResult<any>[], promiseQueue: Promise<void>): void {\r\n if (streams.length === 0) {\r\n return;\r\n }\r\n\r\n // Synchronize stream data so they arrive in-order on the server\r\n if (!promiseQueue) {\r\n promiseQueue = Promise.resolve();\r\n }\r\n\r\n // We want to iterate over the keys, since the keys are the stream ids\r\n // eslint-disable-next-line guard-for-in\r\n for (const streamId in streams) {\r\n streams[streamId].subscribe({\r\n complete: () => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId)));\r\n },\r\n error: (err) => {\r\n let message: string;\r\n if (err instanceof Error) {\r\n message = err.message;\r\n } else if (err && err.toString) {\r\n message = err.toString();\r\n } else {\r\n message = \"Unknown error\";\r\n }\r\n\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId, message)));\r\n },\r\n next: (item) => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createStreamItemMessage(streamId, item)));\r\n },\r\n });\r\n }\r\n }\r\n\r\n private _replaceStreamingParams(args: any[]): [IStreamResult<any>[], string[]] {\r\n const streams: IStreamResult<any>[] = [];\r\n const streamIds: string[] = [];\r\n for (let i = 0; i < args.length; i++) {\r\n const argument = args[i];\r\n if (this._isObservable(argument)) {\r\n const streamId = this._invocationId;\r\n this._invocationId++;\r\n // Store the stream for later use\r\n streams[streamId] = argument;\r\n streamIds.push(streamId.toString());\r\n\r\n // remove stream from args\r\n args.splice(i, 1);\r\n }\r\n }\r\n\r\n return [streams, streamIds];\r\n }\r\n\r\n private _isObservable(arg: any): arg is IStreamResult<any> {\r\n // This allows other stream implementations to just work (like rxjs)\r\n return arg && arg.subscribe && typeof arg.subscribe === \"function\";\r\n }\r\n\r\n private _createStreamInvocation(methodName: string, args: any[], streamIds: string[]): StreamInvocationMessage {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n } else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n }\r\n }\r\n\r\n private _createCancelInvocation(id: string): CancelInvocationMessage {\r\n return {\r\n invocationId: id,\r\n type: MessageType.CancelInvocation,\r\n };\r\n }\r\n\r\n private _createStreamItemMessage(id: string, item: any): StreamItemMessage {\r\n return {\r\n invocationId: id,\r\n item,\r\n type: MessageType.StreamItem,\r\n };\r\n }\r\n\r\n private _createCompletionMessage(id: string, error?: any, result?: any): CompletionMessage {\r\n if (error) {\r\n return {\r\n error,\r\n invocationId: id,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n\r\n return {\r\n invocationId: id,\r\n result,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n\r\n private _createCloseMessage(): CloseMessage {\r\n return { type: MessageType.Close };\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IStreamResult, IStreamSubscriber, ISubscription } from \"./Stream\";\r\nimport { SubjectSubscription } from \"./Utils\";\r\n\r\n/** Stream implementation to stream items to the server. */\r\nexport class Subject<T> implements IStreamResult<T> {\r\n /** @internal */\r\n public observers: IStreamSubscriber<T>[];\r\n\r\n /** @internal */\r\n public cancelCallback?: () => Promise<void>;\r\n\r\n constructor() {\r\n this.observers = [];\r\n }\r\n\r\n public next(item: T): void {\r\n for (const observer of this.observers) {\r\n observer.next(item);\r\n }\r\n }\r\n\r\n public error(err: any): void {\r\n for (const observer of this.observers) {\r\n if (observer.error) {\r\n observer.error(err);\r\n }\r\n }\r\n }\r\n\r\n public complete(): void {\r\n for (const observer of this.observers) {\r\n if (observer.complete) {\r\n observer.complete();\r\n }\r\n }\r\n }\r\n\r\n public subscribe(observer: IStreamSubscriber<T>): ISubscription<T> {\r\n this.observers.push(observer);\r\n return new SubjectSubscription(this, observer);\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IConnection } from \"./IConnection\";\r\nimport { AckMessage, HubMessage, IHubProtocol, MessageType, SequenceMessage } from \"./IHubProtocol\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n\r\n/** @private */\r\nexport class MessageBuffer {\r\n private readonly _protocol: IHubProtocol;\r\n private readonly _connection: IConnection;\r\n\r\n private readonly _bufferSize: number = 100_000;\r\n\r\n private _messages: BufferedItem[] = [];\r\n private _totalMessageCount: number = 0;\r\n private _waitForSequenceMessage: boolean = false;\r\n\r\n // Message IDs start at 1 and always increment by 1\r\n private _nextReceivingSequenceId = 1;\r\n private _latestReceivedSequenceId = 0;\r\n private _bufferedByteCount: number = 0;\r\n private _reconnectInProgress: boolean = false;\r\n\r\n private _ackTimerHandle?: any;\r\n\r\n constructor(protocol: IHubProtocol, connection: IConnection, bufferSize: number) {\r\n this._protocol = protocol;\r\n this._connection = connection;\r\n this._bufferSize = bufferSize;\r\n }\r\n\r\n public async _send(message: HubMessage): Promise<void> {\r\n const serializedMessage = this._protocol.writeMessage(message);\r\n\r\n let backpressurePromise: Promise<void> = Promise.resolve();\r\n\r\n // Only count invocation messages. Acks, pings, etc. don't need to be resent on reconnect\r\n if (this._isInvocationMessage(message)) {\r\n this._totalMessageCount++;\r\n let backpressurePromiseResolver: (value: void) => void = () => {};\r\n let backpressurePromiseRejector: (value?: void) => void = () => {};\r\n\r\n if (isArrayBuffer(serializedMessage)) {\r\n this._bufferedByteCount += serializedMessage.byteLength;\r\n } else {\r\n this._bufferedByteCount += serializedMessage.length;\r\n }\r\n\r\n if (this._bufferedByteCount >= this._bufferSize) {\r\n backpressurePromise = new Promise((resolve, reject) => {\r\n backpressurePromiseResolver = resolve;\r\n backpressurePromiseRejector = reject;\r\n });\r\n }\r\n\r\n this._messages.push(new BufferedItem(serializedMessage, this._totalMessageCount,\r\n backpressurePromiseResolver, backpressurePromiseRejector));\r\n }\r\n\r\n try {\r\n // If this is set it means we are reconnecting or resending\r\n // We don't want to send on a disconnected connection\r\n // And we don't want to send if resend is running since that would mean sending\r\n // this message twice\r\n if (!this._reconnectInProgress) {\r\n await this._connection.send(serializedMessage);\r\n }\r\n } catch {\r\n this._disconnected();\r\n }\r\n await backpressurePromise;\r\n }\r\n\r\n public _ack(ackMessage: AckMessage): void {\r\n let newestAckedMessage = -1;\r\n\r\n // Find index of newest message being acked\r\n for (let index = 0; index < this._messages.length; index++) {\r\n const element = this._messages[index];\r\n if (element._id <= ackMessage.sequenceId) {\r\n newestAckedMessage = index;\r\n if (isArrayBuffer(element._message)) {\r\n this._bufferedByteCount -= element._message.byteLength;\r\n } else {\r\n this._bufferedByteCount -= element._message.length;\r\n }\r\n // resolve items that have already been sent and acked\r\n element._resolver();\r\n } else if (this._bufferedByteCount < this._bufferSize) {\r\n // resolve items that now fall under the buffer limit but haven't been acked\r\n element._resolver();\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n if (newestAckedMessage !== -1) {\r\n // We're removing everything including the message pointed to, so add 1\r\n this._messages = this._messages.slice(newestAckedMessage + 1);\r\n }\r\n }\r\n\r\n public _shouldProcessMessage(message: HubMessage): boolean {\r\n if (this._waitForSequenceMessage) {\r\n if (message.type !== MessageType.Sequence) {\r\n return false;\r\n } else {\r\n this._waitForSequenceMessage = false;\r\n return true;\r\n }\r\n }\r\n\r\n // No special processing for acks, pings, etc.\r\n if (!this._isInvocationMessage(message)) {\r\n return true;\r\n }\r\n\r\n const currentId = this._nextReceivingSequenceId;\r\n this._nextReceivingSequenceId++;\r\n if (currentId <= this._latestReceivedSequenceId) {\r\n if (currentId === this._latestReceivedSequenceId) {\r\n // Should only hit this if we just reconnected and the server is sending\r\n // Messages it has buffered, which would mean it hasn't seen an Ack for these messages\r\n this._ackTimer();\r\n }\r\n // Ignore, this is a duplicate message\r\n return false;\r\n }\r\n\r\n this._latestReceivedSequenceId = currentId;\r\n\r\n // Only start the timer for sending an Ack message when we have a message to ack. This also conveniently solves\r\n // timer throttling by not having a recursive timer, and by starting the timer via a network call (recv)\r\n this._ackTimer();\r\n return true;\r\n }\r\n\r\n public _resetSequence(message: SequenceMessage): void {\r\n if (message.sequenceId > this._nextReceivingSequenceId) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._connection.stop(new Error(\"Sequence ID greater than amount of messages we've received.\"));\r\n return;\r\n }\r\n\r\n this._nextReceivingSequenceId = message.sequenceId;\r\n }\r\n\r\n public _disconnected(): void {\r\n this._reconnectInProgress = true;\r\n this._waitForSequenceMessage = true;\r\n }\r\n\r\n public async _resend(): Promise<void> {\r\n const sequenceId = this._messages.length !== 0\r\n ? this._messages[0]._id\r\n : this._totalMessageCount + 1;\r\n await this._connection.send(this._protocol.writeMessage({ type: MessageType.Sequence, sequenceId }));\r\n\r\n // Get a local variable to the _messages, just in case messages are acked while resending\r\n // Which would slice the _messages array (which creates a new copy)\r\n const messages = this._messages;\r\n for (const element of messages) {\r\n await this._connection.send(element._message);\r\n }\r\n\r\n this._reconnectInProgress = false;\r\n }\r\n\r\n public _dispose(error?: Error): void {\r\n error ??= new Error(\"Unable to reconnect to server.\")\r\n\r\n // Unblock backpressure if any\r\n for (const element of this._messages) {\r\n element._rejector(error);\r\n }\r\n }\r\n\r\n private _isInvocationMessage(message: HubMessage): boolean {\r\n // There is no way to check if something implements an interface.\r\n // So we individually check the messages in a switch statement.\r\n // To make sure we don't miss any message types we rely on the compiler\r\n // seeing the function returns a value and it will do the\r\n // exhaustive check for us on the switch statement, since we don't use 'case default'\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n case MessageType.StreamItem:\r\n case MessageType.Completion:\r\n case MessageType.StreamInvocation:\r\n case MessageType.CancelInvocation:\r\n return true;\r\n case MessageType.Close:\r\n case MessageType.Sequence:\r\n case MessageType.Ping:\r\n case MessageType.Ack:\r\n return false;\r\n }\r\n }\r\n\r\n private _ackTimer(): void {\r\n if (this._ackTimerHandle === undefined) {\r\n this._ackTimerHandle = setTimeout(async () => {\r\n try {\r\n if (!this._reconnectInProgress) {\r\n await this._connection.send(this._protocol.writeMessage({ type: MessageType.Ack, sequenceId: this._latestReceivedSequenceId }))\r\n }\r\n // Ignore errors, that means the connection is closed and we don't care about the Ack message anymore.\r\n } catch { }\r\n\r\n clearTimeout(this._ackTimerHandle);\r\n this._ackTimerHandle = undefined;\r\n // 1 second delay so we don't spam Ack messages if there are many messages being received at once.\r\n }, 1000);\r\n }\r\n }\r\n}\r\n\r\nclass BufferedItem {\r\n constructor(message: string | ArrayBuffer, id: number, resolver: (value: void) => void, rejector: (value?: any) => void) {\r\n this._message = message;\r\n this._id = id;\r\n this._resolver = resolver;\r\n this._rejector = rejector;\r\n }\r\n\r\n _message: string | ArrayBuffer;\r\n _id: number;\r\n _resolver: (value: void) => void;\r\n _rejector: (value?: any) => void;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IRetryPolicy, RetryContext } from \"./IRetryPolicy\";\r\n\r\n// 0, 2, 10, 30 second delays before reconnect attempts.\r\nconst DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\n\r\n/** @private */\r\nexport class DefaultReconnectPolicy implements IRetryPolicy {\r\n private readonly _retryDelays: (number | null)[];\r\n\r\n constructor(retryDelays?: number[]) {\r\n this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r\n }\r\n\r\n public nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null {\r\n return this._retryDelays[retryContext.previousRetryCount];\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nexport abstract class HeaderNames {\r\n static readonly Authorization = \"Authorization\";\r\n static readonly Cookie = \"Cookie\";\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\n\r\n/** @private */\r\nexport class AccessTokenHttpClient extends HttpClient {\r\n private _innerClient: HttpClient;\r\n _accessToken: string | undefined;\r\n _accessTokenFactory: (() => string | Promise<string>) | undefined;\r\n\r\n constructor(innerClient: HttpClient, accessTokenFactory: (() => string | Promise<string>) | undefined) {\r\n super();\r\n\r\n this._innerClient = innerClient;\r\n this._accessTokenFactory = accessTokenFactory;\r\n }\r\n\r\n public async send(request: HttpRequest): Promise<HttpResponse> {\r\n let allowRetry = true;\r\n if (this._accessTokenFactory && (!this._accessToken || (request.url && request.url.indexOf(\"/negotiate?\") > 0))) {\r\n // don't retry if the request is a negotiate or if we just got a potentially new token from the access token factory\r\n allowRetry = false;\r\n this._accessToken = await this._accessTokenFactory();\r\n }\r\n this._setAuthorizationHeader(request);\r\n const response = await this._innerClient.send(request);\r\n\r\n if (allowRetry && response.statusCode === 401 && this._accessTokenFactory) {\r\n this._accessToken = await this._accessTokenFactory();\r\n this._setAuthorizationHeader(request);\r\n return await this._innerClient.send(request);\r\n }\r\n return response;\r\n }\r\n\r\n private _setAuthorizationHeader(request: HttpRequest) {\r\n if (!request.headers) {\r\n request.headers = {};\r\n }\r\n if (this._accessToken) {\r\n request.headers[HeaderNames.Authorization] = `Bearer ${this._accessToken}`\r\n }\r\n // don't remove the header if there isn't an access token factory, the user manually added the header in this case\r\n else if (this._accessTokenFactory) {\r\n if (request.headers[HeaderNames.Authorization]) {\r\n delete request.headers[HeaderNames.Authorization];\r\n }\r\n }\r\n }\r\n\r\n public getCookieString(url: string): string {\r\n return this._innerClient.getCookieString(url);\r\n }\r\n}","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// This will be treated as a bit flag in the future, so we keep it using power-of-two values.\r\n/** Specifies a specific HTTP transport type. */\r\nexport enum HttpTransportType {\r\n /** Specifies no transport preference. */\r\n None = 0,\r\n /** Specifies the WebSockets transport. */\r\n WebSockets = 1,\r\n /** Specifies the Server-Sent Events transport. */\r\n ServerSentEvents = 2,\r\n /** Specifies the Long Polling transport. */\r\n LongPolling = 4,\r\n}\r\n\r\n/** Specifies the transfer format for a connection. */\r\nexport enum TransferFormat {\r\n /** Specifies that only text data will be transmitted over the connection. */\r\n Text = 1,\r\n /** Specifies that binary data will be transmitted over the connection. */\r\n Binary = 2,\r\n}\r\n\r\n/** An abstraction over the behavior of transports. This is designed to support the framework and not intended for use by applications. */\r\nexport interface ITransport {\r\n connect(url: string, transferFormat: TransferFormat): Promise<void>;\r\n send(data: any): Promise<void>;\r\n stop(): Promise<void>;\r\n onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n onclose: ((error?: Error) => void) | null;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r\n// We don't actually ever use the API being polyfilled, we always use the polyfill because\r\n// it's a very new API right now.\r\n\r\n// Not exported from index.\r\n/** @private */\r\nexport class AbortController implements AbortSignal {\r\n private _isAborted: boolean = false;\r\n public onabort: (() => void) | null = null;\r\n\r\n public abort(): void {\r\n if (!this._isAborted) {\r\n this._isAborted = true;\r\n if (this.onabort) {\r\n this.onabort();\r\n }\r\n }\r\n }\r\n\r\n get signal(): AbortSignal {\r\n return this;\r\n }\r\n\r\n get aborted(): boolean {\r\n return this._isAborted;\r\n }\r\n}\r\n\r\n/** Represents a signal that can be monitored to determine if a request has been aborted. */\r\nexport interface AbortSignal {\r\n /** Indicates if the request has been aborted. */\r\n aborted: boolean;\r\n /** Set this to a handler that will be invoked when the request is aborted. */\r\n onabort: (() => void) | null;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortController } from \"./AbortController\";\r\nimport { HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpRequest } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { ITransport, TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, sendMessage } from \"./Utils\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\n\r\n// Not exported from 'index', this type is internal.\r\n/** @private */\r\nexport class LongPollingTransport implements ITransport {\r\n private readonly _httpClient: HttpClient;\r\n private readonly _logger: ILogger;\r\n private readonly _options: IHttpConnectionOptions;\r\n private readonly _pollAbort: AbortController;\r\n\r\n private _url?: string;\r\n private _running: boolean;\r\n private _receiving?: Promise<void>;\r\n private _closeError?: Error | unknown;\r\n\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((error?: Error | unknown) => void) | null;\r\n\r\n // This is an internal type, not exported from 'index' so this is really just internal.\r\n public get pollAborted(): boolean {\r\n return this._pollAbort.aborted;\r\n }\r\n\r\n constructor(httpClient: HttpClient, logger: ILogger, options: IHttpConnectionOptions) {\r\n this._httpClient = httpClient;\r\n this._logger = logger;\r\n this._pollAbort = new AbortController();\r\n this._options = options;\r\n\r\n this._running = false;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n\r\n public async connect(url: string, transferFormat: TransferFormat): Promise<void> {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n\r\n this._url = url;\r\n\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Connecting.\");\r\n\r\n // Allow binary format on Node and Browsers that support binary content (indicated by the presence of responseType property)\r\n if (transferFormat === TransferFormat.Binary &&\r\n (typeof XMLHttpRequest !== \"undefined\" && typeof new XMLHttpRequest().responseType !== \"string\")) {\r\n throw new Error(\"Binary protocols over XmlHttpRequest not implementing advanced features are not supported.\");\r\n }\r\n\r\n const [name, value] = getUserAgentHeader();\r\n const headers = { [name]: value, ...this._options.headers };\r\n\r\n const pollOptions: HttpRequest = {\r\n abortSignal: this._pollAbort.signal,\r\n headers,\r\n timeout: 100000,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n\r\n if (transferFormat === TransferFormat.Binary) {\r\n pollOptions.responseType = \"arraybuffer\";\r\n }\r\n\r\n // Make initial long polling request\r\n // Server uses first long polling request to finish initializing connection and it returns without data\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n\r\n // Mark running as false so that the poll immediately ends and runs the close logic\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n } else {\r\n this._running = true;\r\n }\r\n\r\n this._receiving = this._poll(this._url, pollOptions);\r\n }\r\n\r\n private async _poll(url: string, pollOptions: HttpRequest): Promise<void> {\r\n try {\r\n while (this._running) {\r\n try {\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n\r\n if (response.statusCode === 204) {\r\n this._logger.log(LogLevel.Information, \"(LongPolling transport) Poll terminated by server.\");\r\n\r\n this._running = false;\r\n } else if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n\r\n // Unexpected status code\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n } else {\r\n // Process the response\r\n if (response.content) {\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) data received. ${getDataDetail(response.content, this._options.logMessageContent!)}.`);\r\n if (this.onreceive) {\r\n this.onreceive(response.content);\r\n }\r\n } else {\r\n // This is another way timeout manifest.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n }\r\n } catch (e) {\r\n if (!this._running) {\r\n // Log but disregard errors that occur after stopping\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) Poll errored after shutdown: ${(e as any).message}`);\r\n } else {\r\n if (e instanceof TimeoutError) {\r\n // Ignore timeouts and reissue the poll.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n } else {\r\n // Close the connection with the error as the result.\r\n this._closeError = e;\r\n this._running = false;\r\n }\r\n }\r\n }\r\n }\r\n } finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Polling complete.\");\r\n\r\n // We will reach here with pollAborted==false when the server returned a response causing the transport to stop.\r\n // If pollAborted==true then client initiated the stop and the stop method will raise the close event after DELETE is sent.\r\n if (!this.pollAborted) {\r\n this._raiseOnClose();\r\n }\r\n }\r\n }\r\n\r\n public async send(data: any): Promise<void> {\r\n if (!this._running) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"LongPolling\", this._httpClient, this._url!, data, this._options);\r\n }\r\n\r\n public async stop(): Promise<void> {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stopping polling.\");\r\n\r\n // Tell receiving loop to stop, abort any current request, and then wait for it to finish\r\n this._running = false;\r\n this._pollAbort.abort();\r\n\r\n try {\r\n await this._receiving;\r\n\r\n // Send DELETE to clean up long polling on the server\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);\r\n\r\n const headers: {[k: string]: string} = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n const deleteOptions: HttpRequest = {\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n\r\n let error;\r\n try {\r\n await this._httpClient.delete(this._url!, deleteOptions);\r\n } catch (err) {\r\n error = err;\r\n }\r\n\r\n if (error) {\r\n if (error instanceof HttpError) {\r\n if (error.statusCode === 404) {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) A 404 response was returned from sending a DELETE request.\");\r\n } else {\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) Error sending a DELETE request: ${error}`);\r\n }\r\n }\r\n } else {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) DELETE request accepted.\");\r\n }\r\n\r\n } finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stop finished.\");\r\n\r\n // Raise close event here instead of in polling\r\n // It needs to happen after the DELETE request is sent\r\n this._raiseOnClose();\r\n }\r\n }\r\n\r\n private _raiseOnClose() {\r\n if (this.onclose) {\r\n let logMessage = \"(LongPolling transport) Firing onclose event.\";\r\n if (this._closeError) {\r\n logMessage += \" Error: \" + this._closeError;\r\n }\r\n this._logger.log(LogLevel.Trace, logMessage);\r\n this.onclose(this._closeError);\r\n }\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { MessageHeaders } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { ITransport, TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform, sendMessage } from \"./Utils\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\n\r\n/** @private */\r\nexport class ServerSentEventsTransport implements ITransport {\r\n private readonly _httpClient: HttpClient;\r\n private readonly _accessToken: string | undefined;\r\n private readonly _logger: ILogger;\r\n private readonly _options: IHttpConnectionOptions;\r\n private _eventSource?: EventSource;\r\n private _url?: string;\r\n\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((error?: Error | unknown) => void) | null;\r\n\r\n constructor(httpClient: HttpClient, accessToken: string | undefined, logger: ILogger,\r\n options: IHttpConnectionOptions) {\r\n this._httpClient = httpClient;\r\n this._accessToken = accessToken;\r\n this._logger = logger;\r\n this._options = options;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n\r\n public async connect(url: string, transferFormat: TransferFormat): Promise<void> {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n\r\n this._logger.log(LogLevel.Trace, \"(SSE transport) Connecting.\");\r\n\r\n // set url before accessTokenFactory because this._url is only for send and we set the auth header instead of the query string for send\r\n this._url = url;\r\n\r\n if (this._accessToken) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(this._accessToken)}`;\r\n }\r\n\r\n return new Promise<void>((resolve, reject) => {\r\n let opened = false;\r\n if (transferFormat !== TransferFormat.Text) {\r\n reject(new Error(\"The Server-Sent Events transport only supports the 'Text' transfer format\"));\r\n return;\r\n }\r\n\r\n let eventSource: EventSource;\r\n if (Platform.isBrowser || Platform.isWebWorker) {\r\n eventSource = new this._options.EventSource!(url, { withCredentials: this._options.withCredentials });\r\n } else {\r\n // Non-browser passes cookies via the dictionary\r\n const cookies = this._httpClient.getCookieString(url);\r\n const headers: MessageHeaders = {};\r\n headers.Cookie = cookies;\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n eventSource = new this._options.EventSource!(url, { withCredentials: this._options.withCredentials, headers: { ...headers, ...this._options.headers} } as EventSourceInit);\r\n }\r\n\r\n try {\r\n eventSource.onmessage = (e: MessageEvent) => {\r\n if (this.onreceive) {\r\n try {\r\n this._logger.log(LogLevel.Trace, `(SSE transport) data received. ${getDataDetail(e.data, this._options.logMessageContent!)}.`);\r\n this.onreceive(e.data);\r\n } catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n\r\n // @ts-ignore: not using event on purpose\r\n eventSource.onerror = (e: Event) => {\r\n // EventSource doesn't give any useful information about server side closes.\r\n if (opened) {\r\n this._close();\r\n } else {\r\n reject(new Error(\"EventSource failed to connect. The connection could not be found on the server,\"\r\n + \" either the connection ID is not present on the server, or a proxy is refusing/buffering the connection.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\"));\r\n }\r\n };\r\n\r\n eventSource.onopen = () => {\r\n this._logger.log(LogLevel.Information, `SSE connected to ${this._url}`);\r\n this._eventSource = eventSource;\r\n opened = true;\r\n resolve();\r\n };\r\n } catch (e) {\r\n reject(e);\r\n return;\r\n }\r\n });\r\n }\r\n\r\n public async send(data: any): Promise<void> {\r\n if (!this._eventSource) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"SSE\", this._httpClient, this._url!, data, this._options);\r\n }\r\n\r\n public stop(): Promise<void> {\r\n this._close();\r\n return Promise.resolve();\r\n }\r\n\r\n private _close(e?: Error | unknown) {\r\n if (this._eventSource) {\r\n this._eventSource.close();\r\n this._eventSource = undefined;\r\n\r\n if (this.onclose) {\r\n this.onclose(e);\r\n }\r\n }\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { MessageHeaders } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { ITransport, TransferFormat } from \"./ITransport\";\r\nimport { WebSocketConstructor } from \"./Polyfills\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform } from \"./Utils\";\r\n\r\n/** @private */\r\nexport class WebSocketTransport implements ITransport {\r\n private readonly _logger: ILogger;\r\n private readonly _accessTokenFactory: (() => string | Promise<string>) | undefined;\r\n private readonly _logMessageContent: boolean;\r\n private readonly _webSocketConstructor: WebSocketConstructor;\r\n private readonly _httpClient: HttpClient;\r\n private _webSocket?: WebSocket;\r\n private _headers: MessageHeaders;\r\n\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((error?: Error) => void) | null;\r\n\r\n constructor(httpClient: HttpClient, accessTokenFactory: (() => string | Promise<string>) | undefined, logger: ILogger,\r\n logMessageContent: boolean, webSocketConstructor: WebSocketConstructor, headers: MessageHeaders) {\r\n this._logger = logger;\r\n this._accessTokenFactory = accessTokenFactory;\r\n this._logMessageContent = logMessageContent;\r\n this._webSocketConstructor = webSocketConstructor;\r\n this._httpClient = httpClient;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n this._headers = headers;\r\n }\r\n\r\n public async connect(url: string, transferFormat: TransferFormat): Promise<void> {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) Connecting.\");\r\n\r\n let token: string;\r\n if (this._accessTokenFactory) {\r\n token = await this._accessTokenFactory();\r\n }\r\n\r\n return new Promise<void>((resolve, reject) => {\r\n url = url.replace(/^http/, \"ws\");\r\n let webSocket: WebSocket | undefined;\r\n const cookies = this._httpClient.getCookieString(url);\r\n let opened = false;\r\n\r\n if (Platform.isNode || Platform.isReactNative) {\r\n const headers: {[k: string]: string} = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n if (token) {\r\n headers[HeaderNames.Authorization] = `Bearer ${token}`;\r\n }\r\n\r\n if (cookies) {\r\n headers[HeaderNames.Cookie] = cookies;\r\n }\r\n\r\n // Only pass headers when in non-browser environments\r\n webSocket = new this._webSocketConstructor(url, undefined, {\r\n headers: { ...headers, ...this._headers },\r\n });\r\n }\r\n else\r\n {\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(token)}`;\r\n }\r\n }\r\n\r\n if (!webSocket) {\r\n // Chrome is not happy with passing 'undefined' as protocol\r\n webSocket = new this._webSocketConstructor(url);\r\n }\r\n\r\n if (transferFormat === TransferFormat.Binary) {\r\n webSocket.binaryType = \"arraybuffer\";\r\n }\r\n\r\n webSocket.onopen = (_event: Event) => {\r\n this._logger.log(LogLevel.Information, `WebSocket connected to ${url}.`);\r\n this._webSocket = webSocket;\r\n opened = true;\r\n resolve();\r\n };\r\n\r\n webSocket.onerror = (event: Event) => {\r\n let error: any = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n } else {\r\n error = \"There was an error with the transport\";\r\n }\r\n\r\n this._logger.log(LogLevel.Information, `(WebSockets transport) ${error}.`);\r\n };\r\n\r\n webSocket.onmessage = (message: MessageEvent) => {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) data received. ${getDataDetail(message.data, this._logMessageContent)}.`);\r\n if (this.onreceive) {\r\n try {\r\n this.onreceive(message.data);\r\n } catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n\r\n webSocket.onclose = (event: CloseEvent) => {\r\n // Don't call close handler if connection was never established\r\n // We'll reject the connect call instead\r\n if (opened) {\r\n this._close(event);\r\n } else {\r\n let error: any = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n } else {\r\n error = \"WebSocket failed to connect. The connection could not be found on the server,\"\r\n + \" either the endpoint may not be a SignalR endpoint,\"\r\n + \" the connection ID is not present on the server, or there is a proxy blocking WebSockets.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\";\r\n }\r\n\r\n reject(new Error(error));\r\n }\r\n };\r\n });\r\n }\r\n\r\n public send(data: any): Promise<void> {\r\n if (this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN) {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) sending data. ${getDataDetail(data, this._logMessageContent)}.`);\r\n this._webSocket.send(data);\r\n return Promise.resolve();\r\n }\r\n\r\n return Promise.reject(\"WebSocket is not in the OPEN state\");\r\n }\r\n\r\n public stop(): Promise<void> {\r\n if (this._webSocket) {\r\n // Manually invoke onclose callback inline so we know the HttpConnection was closed properly before returning\r\n // This also solves an issue where websocket.onclose could take 18+ seconds to trigger during network disconnects\r\n this._close(undefined);\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n private _close(event: CloseEvent | Error | unknown): void {\r\n // webSocket will be null if the transport did not start successfully\r\n if (this._webSocket) {\r\n // Clear websocket handlers because we are considering the socket closed now\r\n this._webSocket.onclose = () => {};\r\n this._webSocket.onmessage = () => {};\r\n this._webSocket.onerror = () => {};\r\n this._webSocket.close();\r\n this._webSocket = undefined;\r\n }\r\n\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) socket closed.\");\r\n\r\n if (this.onclose) {\r\n if (this._isCloseEvent(event) && (event.wasClean === false || event.code !== 1000)) {\r\n this.onclose(new Error(`WebSocket closed with status code: ${event.code} (${event.reason || \"no reason given\"}).`));\r\n } else if (event instanceof Error) {\r\n this.onclose(event);\r\n } else {\r\n this.onclose();\r\n }\r\n }\r\n }\r\n\r\n private _isCloseEvent(event?: any): event is CloseEvent {\r\n return event && typeof event.wasClean === \"boolean\" && typeof event.code === \"number\";\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AccessTokenHttpClient } from \"./AccessTokenHttpClient\";\r\nimport { DefaultHttpClient } from \"./DefaultHttpClient\";\r\nimport { getEventSource, getWS } from \"./DynamicImports\";\r\nimport { AggregateErrors, DisabledTransportError, FailedToNegotiateWithServerError, FailedToStartTransportError, HttpError, UnsupportedTransportError, AbortError } from \"./Errors\";\r\nimport { IConnection } from \"./IConnection\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { HttpTransportType, ITransport, TransferFormat } from \"./ITransport\";\r\nimport { LongPollingTransport } from \"./LongPollingTransport\";\r\nimport { ServerSentEventsTransport } from \"./ServerSentEventsTransport\";\r\nimport { Arg, createLogger, getUserAgentHeader, Platform } from \"./Utils\";\r\nimport { WebSocketTransport } from \"./WebSocketTransport\";\r\n\r\n/** @private */\r\nconst enum ConnectionState {\r\n Connecting = \"Connecting\",\r\n Connected = \"Connected\",\r\n Disconnected = \"Disconnected\",\r\n Disconnecting = \"Disconnecting\",\r\n}\r\n\r\n/** @private */\r\nexport interface INegotiateResponse {\r\n connectionId?: string;\r\n connectionToken?: string;\r\n negotiateVersion?: number;\r\n availableTransports?: IAvailableTransport[];\r\n url?: string;\r\n accessToken?: string;\r\n error?: string;\r\n useStatefulReconnect?: boolean;\r\n}\r\n\r\n/** @private */\r\nexport interface IAvailableTransport {\r\n transport: keyof typeof HttpTransportType;\r\n transferFormats: (keyof typeof TransferFormat)[];\r\n}\r\n\r\nconst MAX_REDIRECTS = 100;\r\n\r\n/** @private */\r\nexport class HttpConnection implements IConnection {\r\n private _connectionState: ConnectionState;\r\n // connectionStarted is tracked independently from connectionState, so we can check if the\r\n // connection ever did successfully transition from connecting to connected before disconnecting.\r\n private _connectionStarted: boolean;\r\n private readonly _httpClient: AccessTokenHttpClient;\r\n private readonly _logger: ILogger;\r\n private readonly _options: IHttpConnectionOptions;\r\n // Needs to not start with _ to be available for tests\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private transport?: ITransport;\r\n private _startInternalPromise?: Promise<void>;\r\n private _stopPromise?: Promise<void>;\r\n private _stopPromiseResolver: (value?: PromiseLike<void>) => void = () => {};\r\n private _stopError?: Error;\r\n private _accessTokenFactory?: () => string | Promise<string>;\r\n private _sendQueue?: TransportSendQueue;\r\n\r\n public readonly features: any = {};\r\n public baseUrl: string;\r\n public connectionId?: string;\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((e?: Error) => void) | null;\r\n\r\n private readonly _negotiateVersion: number = 1;\r\n\r\n constructor(url: string, options: IHttpConnectionOptions = {}) {\r\n Arg.isRequired(url, \"url\");\r\n\r\n this._logger = createLogger(options.logger);\r\n this.baseUrl = this._resolveUrl(url);\r\n\r\n options = options || {};\r\n options.logMessageContent = options.logMessageContent === undefined ? false : options.logMessageContent;\r\n if (typeof options.withCredentials === \"boolean\" || options.withCredentials === undefined) {\r\n options.withCredentials = options.withCredentials === undefined ? true : options.withCredentials;\r\n } else {\r\n throw new Error(\"withCredentials option was not a 'boolean' or 'undefined' value\");\r\n }\r\n options.timeout = options.timeout === undefined ? 100 * 1000 : options.timeout;\r\n\r\n let webSocketModule: any = null;\r\n let eventSourceModule: any = null;\r\n\r\n if (Platform.isNode && typeof require !== \"undefined\") {\r\n webSocketModule = getWS();\r\n eventSourceModule = getEventSource();\r\n }\r\n\r\n if (!Platform.isNode && typeof WebSocket !== \"undefined\" && !options.WebSocket) {\r\n options.WebSocket = WebSocket;\r\n } else if (Platform.isNode && !options.WebSocket) {\r\n if (webSocketModule) {\r\n options.WebSocket = webSocketModule;\r\n }\r\n }\r\n\r\n if (!Platform.isNode && typeof EventSource !== \"undefined\" && !options.EventSource) {\r\n options.EventSource = EventSource;\r\n } else if (Platform.isNode && !options.EventSource) {\r\n if (typeof eventSourceModule !== \"undefined\") {\r\n options.EventSource = eventSourceModule;\r\n }\r\n }\r\n\r\n this._httpClient = new AccessTokenHttpClient(options.httpClient || new DefaultHttpClient(this._logger), options.accessTokenFactory);\r\n this._connectionState = ConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n this._options = options;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n\r\n public start(): Promise<void>;\r\n public start(transferFormat: TransferFormat): Promise<void>;\r\n public async start(transferFormat?: TransferFormat): Promise<void> {\r\n transferFormat = transferFormat || TransferFormat.Binary;\r\n\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n\r\n this._logger.log(LogLevel.Debug, `Starting connection with transfer format '${TransferFormat[transferFormat]}'.`);\r\n\r\n if (this._connectionState !== ConnectionState.Disconnected) {\r\n return Promise.reject(new Error(\"Cannot start an HttpConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n\r\n this._connectionState = ConnectionState.Connecting;\r\n\r\n this._startInternalPromise = this._startInternal(transferFormat);\r\n await this._startInternalPromise;\r\n\r\n // The TypeScript compiler thinks that connectionState must be Connecting here. The TypeScript compiler is wrong.\r\n if (this._connectionState as any === ConnectionState.Disconnecting) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"Failed to start the HttpConnection before stop() was called.\";\r\n this._logger.log(LogLevel.Error, message);\r\n\r\n // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise.\r\n await this._stopPromise;\r\n\r\n return Promise.reject(new AbortError(message));\r\n } else if (this._connectionState as any !== ConnectionState.Connected) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!\";\r\n this._logger.log(LogLevel.Error, message);\r\n return Promise.reject(new AbortError(message));\r\n }\r\n\r\n this._connectionStarted = true;\r\n }\r\n\r\n public send(data: string | ArrayBuffer): Promise<void> {\r\n if (this._connectionState !== ConnectionState.Connected) {\r\n return Promise.reject(new Error(\"Cannot send data if the connection is not in the 'Connected' State.\"));\r\n }\r\n\r\n if (!this._sendQueue) {\r\n this._sendQueue = new TransportSendQueue(this.transport!);\r\n }\r\n\r\n // Transport will not be null if state is connected\r\n return this._sendQueue.send(data);\r\n }\r\n\r\n public async stop(error?: Error): Promise<void> {\r\n if (this._connectionState === ConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Disconnecting) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise;\r\n }\r\n\r\n this._connectionState = ConnectionState.Disconnecting;\r\n\r\n this._stopPromise = new Promise((resolve) => {\r\n // Don't complete stop() until stopConnection() completes.\r\n this._stopPromiseResolver = resolve;\r\n });\r\n\r\n // stopInternal should never throw so just observe it.\r\n await this._stopInternal(error);\r\n await this._stopPromise;\r\n }\r\n\r\n private async _stopInternal(error?: Error): Promise<void> {\r\n // Set error as soon as possible otherwise there is a race between\r\n // the transport closing and providing an error and the error from a close message\r\n // We would prefer the close message error.\r\n this._stopError = error;\r\n\r\n try {\r\n await this._startInternalPromise;\r\n } catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n\r\n // The transport's onclose will trigger stopConnection which will run our onclose event.\r\n // The transport should always be set if currently connected. If it wasn't set, it's likely because\r\n // stop was called during start() and start() failed.\r\n if (this.transport) {\r\n try {\r\n await this.transport.stop();\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.transport.stop() threw error '${e}'.`);\r\n this._stopConnection();\r\n }\r\n\r\n this.transport = undefined;\r\n } else {\r\n this._logger.log(LogLevel.Debug, \"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.\");\r\n }\r\n }\r\n\r\n private async _startInternal(transferFormat: TransferFormat): Promise<void> {\r\n // Store the original base url and the access token factory since they may change\r\n // as part of negotiating\r\n let url = this.baseUrl;\r\n this._accessTokenFactory = this._options.accessTokenFactory;\r\n this._httpClient._accessTokenFactory = this._accessTokenFactory;\r\n\r\n try {\r\n if (this._options.skipNegotiation) {\r\n if (this._options.transport === HttpTransportType.WebSockets) {\r\n // No need to add a connection ID in this case\r\n this.transport = this._constructTransport(HttpTransportType.WebSockets);\r\n // We should just call connect directly in this case.\r\n // No fallback or negotiate in this case.\r\n await this._startTransport(url, transferFormat);\r\n } else {\r\n throw new Error(\"Negotiation can only be skipped when using the WebSocket transport directly.\");\r\n }\r\n } else {\r\n let negotiateResponse: INegotiateResponse | null = null;\r\n let redirects = 0;\r\n\r\n do {\r\n negotiateResponse = await this._getNegotiationResponse(url);\r\n // the user tries to stop the connection when it is being started\r\n if (this._connectionState === ConnectionState.Disconnecting || this._connectionState === ConnectionState.Disconnected) {\r\n throw new AbortError(\"The connection was stopped during negotiation.\");\r\n }\r\n\r\n if (negotiateResponse.error) {\r\n throw new Error(negotiateResponse.error);\r\n }\r\n\r\n if ((negotiateResponse as any).ProtocolVersion) {\r\n throw new Error(\"Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.\");\r\n }\r\n\r\n if (negotiateResponse.url) {\r\n url = negotiateResponse.url;\r\n }\r\n\r\n if (negotiateResponse.accessToken) {\r\n // Replace the current access token factory with one that uses\r\n // the returned access token\r\n const accessToken = negotiateResponse.accessToken;\r\n this._accessTokenFactory = () => accessToken;\r\n // set the factory to undefined so the AccessTokenHttpClient won't retry with the same token, since we know it won't change until a connection restart\r\n this._httpClient._accessToken = accessToken;\r\n this._httpClient._accessTokenFactory = undefined;\r\n }\r\n\r\n redirects++;\r\n }\r\n while (negotiateResponse.url && redirects < MAX_REDIRECTS);\r\n\r\n if (redirects === MAX_REDIRECTS && negotiateResponse.url) {\r\n throw new Error(\"Negotiate redirection limit exceeded.\");\r\n }\r\n\r\n await this._createTransport(url, this._options.transport, negotiateResponse, transferFormat);\r\n }\r\n\r\n if (this.transport instanceof LongPollingTransport) {\r\n this.features.inherentKeepAlive = true;\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Connecting) {\r\n // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise.\r\n // start() will handle the case when stop was called and startInternal exits still in the disconnecting state.\r\n this._logger.log(LogLevel.Debug, \"The HttpConnection connected successfully.\");\r\n this._connectionState = ConnectionState.Connected;\r\n }\r\n\r\n // stop() is waiting on us via this.startInternalPromise so keep this.transport around so it can clean up.\r\n // This is the only case startInternal can exit in neither the connected nor disconnected state because stopConnection()\r\n // will transition to the disconnected state. start() will wait for the transition using the stopPromise.\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, \"Failed to start the connection: \" + e);\r\n this._connectionState = ConnectionState.Disconnected;\r\n this.transport = undefined;\r\n\r\n // if start fails, any active calls to stop assume that start will complete the stop promise\r\n this._stopPromiseResolver();\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n private async _getNegotiationResponse(url: string): Promise<INegotiateResponse> {\r\n const headers: {[k: string]: string} = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n const negotiateUrl = this._resolveNegotiateUrl(url);\r\n this._logger.log(LogLevel.Debug, `Sending negotiation request: ${negotiateUrl}.`);\r\n try {\r\n const response = await this._httpClient.post(negotiateUrl, {\r\n content: \"\",\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n });\r\n\r\n if (response.statusCode !== 200) {\r\n return Promise.reject(new Error(`Unexpected status code returned from negotiate '${response.statusCode}'`));\r\n }\r\n\r\n const negotiateResponse = JSON.parse(response.content as string) as INegotiateResponse;\r\n if (!negotiateResponse.negotiateVersion || negotiateResponse.negotiateVersion < 1) {\r\n // Negotiate version 0 doesn't use connectionToken\r\n // So we set it equal to connectionId so all our logic can use connectionToken without being aware of the negotiate version\r\n negotiateResponse.connectionToken = negotiateResponse.connectionId;\r\n }\r\n\r\n if (negotiateResponse.useStatefulReconnect && this._options._useStatefulReconnect !== true) {\r\n return Promise.reject(new FailedToNegotiateWithServerError(\"Client didn't negotiate Stateful Reconnect but the server did.\"));\r\n }\r\n\r\n return negotiateResponse;\r\n } catch (e) {\r\n let errorMessage = \"Failed to complete negotiation with the server: \" + e;\r\n if (e instanceof HttpError) {\r\n if (e.statusCode === 404) {\r\n errorMessage = errorMessage + \" Either this is not a SignalR endpoint or there is a proxy blocking the connection.\";\r\n }\r\n }\r\n this._logger.log(LogLevel.Error, errorMessage);\r\n\r\n return Promise.reject(new FailedToNegotiateWithServerError(errorMessage));\r\n }\r\n }\r\n\r\n private _createConnectUrl(url: string, connectionToken: string | null | undefined) {\r\n if (!connectionToken) {\r\n return url;\r\n }\r\n\r\n return url + (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + `id=${connectionToken}`;\r\n }\r\n\r\n private async _createTransport(url: string, requestedTransport: HttpTransportType | ITransport | undefined, negotiateResponse: INegotiateResponse, requestedTransferFormat: TransferFormat): Promise<void> {\r\n let connectUrl = this._createConnectUrl(url, negotiateResponse.connectionToken);\r\n if (this._isITransport(requestedTransport)) {\r\n this._logger.log(LogLevel.Debug, \"Connection was provided an instance of ITransport, using that directly.\");\r\n this.transport = requestedTransport;\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n\r\n this.connectionId = negotiateResponse.connectionId;\r\n return;\r\n }\r\n\r\n const transportExceptions: any[] = [];\r\n const transports = negotiateResponse.availableTransports || [];\r\n let negotiate: INegotiateResponse | undefined = negotiateResponse;\r\n for (const endpoint of transports) {\r\n const transportOrError = this._resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat,\r\n negotiate?.useStatefulReconnect === true);\r\n if (transportOrError instanceof Error) {\r\n // Store the error and continue, we don't want to cause a re-negotiate in these cases\r\n transportExceptions.push(`${endpoint.transport} failed:`);\r\n transportExceptions.push(transportOrError);\r\n } else if (this._isITransport(transportOrError)) {\r\n this.transport = transportOrError;\r\n if (!negotiate) {\r\n try {\r\n negotiate = await this._getNegotiationResponse(url);\r\n } catch (ex) {\r\n return Promise.reject(ex);\r\n }\r\n connectUrl = this._createConnectUrl(url, negotiate.connectionToken);\r\n }\r\n try {\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n this.connectionId = negotiate.connectionId;\r\n return;\r\n } catch (ex) {\r\n this._logger.log(LogLevel.Error, `Failed to start the transport '${endpoint.transport}': ${ex}`);\r\n negotiate = undefined;\r\n transportExceptions.push(new FailedToStartTransportError(`${endpoint.transport} failed: ${ex}`, HttpTransportType[endpoint.transport]));\r\n\r\n if (this._connectionState !== ConnectionState.Connecting) {\r\n const message = \"Failed to select transport before stop() was called.\";\r\n this._logger.log(LogLevel.Debug, message);\r\n return Promise.reject(new AbortError(message));\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (transportExceptions.length > 0) {\r\n return Promise.reject(new AggregateErrors(`Unable to connect to the server with any of the available transports. ${transportExceptions.join(\" \")}`, transportExceptions));\r\n }\r\n return Promise.reject(new Error(\"None of the transports supported by the client are supported by the server.\"));\r\n }\r\n\r\n private _constructTransport(transport: HttpTransportType): ITransport {\r\n switch (transport) {\r\n case HttpTransportType.WebSockets:\r\n if (!this._options.WebSocket) {\r\n throw new Error(\"'WebSocket' is not supported in your environment.\");\r\n }\r\n return new WebSocketTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent!,\r\n this._options.WebSocket, this._options.headers || {});\r\n case HttpTransportType.ServerSentEvents:\r\n if (!this._options.EventSource) {\r\n throw new Error(\"'EventSource' is not supported in your environment.\");\r\n }\r\n return new ServerSentEventsTransport(this._httpClient, this._httpClient._accessToken, this._logger, this._options);\r\n case HttpTransportType.LongPolling:\r\n return new LongPollingTransport(this._httpClient, this._logger, this._options);\r\n default:\r\n throw new Error(`Unknown transport: ${transport}.`);\r\n }\r\n }\r\n\r\n private _startTransport(url: string, transferFormat: TransferFormat): Promise<void> {\r\n this.transport!.onreceive = this.onreceive;\r\n if (this.features.reconnect) {\r\n this.transport!.onclose = async (e) => {\r\n let callStop = false;\r\n if (this.features.reconnect) {\r\n try {\r\n this.features.disconnected();\r\n await this.transport!.connect(url, transferFormat);\r\n await this.features.resend();\r\n } catch {\r\n callStop = true;\r\n }\r\n } else {\r\n this._stopConnection(e);\r\n return;\r\n }\r\n\r\n if (callStop) {\r\n this._stopConnection(e);\r\n }\r\n };\r\n } else {\r\n this.transport!.onclose = (e) => this._stopConnection(e);\r\n }\r\n return this.transport!.connect(url, transferFormat);\r\n }\r\n\r\n private _resolveTransportOrError(endpoint: IAvailableTransport, requestedTransport: HttpTransportType | undefined,\r\n requestedTransferFormat: TransferFormat, useStatefulReconnect: boolean): ITransport | Error | unknown {\r\n const transport = HttpTransportType[endpoint.transport];\r\n if (transport === null || transport === undefined) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n return new Error(`Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n } else {\r\n if (transportMatches(requestedTransport, transport)) {\r\n const transferFormats = endpoint.transferFormats.map((s) => TransferFormat[s]);\r\n if (transferFormats.indexOf(requestedTransferFormat) >= 0) {\r\n if ((transport === HttpTransportType.WebSockets && !this._options.WebSocket) ||\r\n (transport === HttpTransportType.ServerSentEvents && !this._options.EventSource)) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it is not supported in your environment.'`);\r\n return new UnsupportedTransportError(`'${HttpTransportType[transport]}' is not supported in your environment.`, transport);\r\n } else {\r\n this._logger.log(LogLevel.Debug, `Selecting transport '${HttpTransportType[transport]}'.`);\r\n try {\r\n this.features.reconnect = transport === HttpTransportType.WebSockets ? useStatefulReconnect : undefined;\r\n return this._constructTransport(transport);\r\n } catch (ex) {\r\n return ex;\r\n }\r\n }\r\n } else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it does not support the requested transfer format '${TransferFormat[requestedTransferFormat]}'.`);\r\n return new Error(`'${HttpTransportType[transport]}' does not support ${TransferFormat[requestedTransferFormat]}.`);\r\n }\r\n } else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it was disabled by the client.`);\r\n return new DisabledTransportError(`'${HttpTransportType[transport]}' is disabled by the client.`, transport);\r\n }\r\n }\r\n }\r\n\r\n private _isITransport(transport: any): transport is ITransport {\r\n return transport && typeof (transport) === \"object\" && \"connect\" in transport;\r\n }\r\n\r\n private _stopConnection(error?: Error): void {\r\n this._logger.log(LogLevel.Debug, `HttpConnection.stopConnection(${error}) called while in state ${this._connectionState}.`);\r\n\r\n this.transport = undefined;\r\n\r\n // If we have a stopError, it takes precedence over the error from the transport\r\n error = this._stopError || error;\r\n this._stopError = undefined;\r\n\r\n if (this._connectionState === ConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is already in the disconnected state.`);\r\n return;\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Connecting) {\r\n this._logger.log(LogLevel.Warning, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is still in the connecting state.`);\r\n throw new Error(`HttpConnection.stopConnection(${error}) was called while the connection is still in the connecting state.`);\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Disconnecting) {\r\n // A call to stop() induced this call to stopConnection and needs to be completed.\r\n // Any stop() awaiters will be scheduled to continue after the onclose callback fires.\r\n this._stopPromiseResolver();\r\n }\r\n\r\n if (error) {\r\n this._logger.log(LogLevel.Error, `Connection disconnected with error '${error}'.`);\r\n } else {\r\n this._logger.log(LogLevel.Information, \"Connection disconnected.\");\r\n }\r\n\r\n if (this._sendQueue) {\r\n this._sendQueue.stop().catch((e) => {\r\n this._logger.log(LogLevel.Error, `TransportSendQueue.stop() threw error '${e}'.`);\r\n });\r\n this._sendQueue = undefined;\r\n }\r\n\r\n this.connectionId = undefined;\r\n this._connectionState = ConnectionState.Disconnected;\r\n\r\n if (this._connectionStarted) {\r\n this._connectionStarted = false;\r\n try {\r\n if (this.onclose) {\r\n this.onclose(error);\r\n }\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.onclose(${error}) threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n\r\n private _resolveUrl(url: string): string {\r\n // startsWith is not supported in IE\r\n if (url.lastIndexOf(\"https://\", 0) === 0 || url.lastIndexOf(\"http://\", 0) === 0) {\r\n return url;\r\n }\r\n\r\n if (!Platform.isBrowser) {\r\n throw new Error(`Cannot resolve '${url}'.`);\r\n }\r\n\r\n // Setting the url to the href propery of an anchor tag handles normalization\r\n // for us. There are 3 main cases.\r\n // 1. Relative path normalization e.g \"b\" -> \"http://localhost:5000/a/b\"\r\n // 2. Absolute path normalization e.g \"/a/b\" -> \"http://localhost:5000/a/b\"\r\n // 3. Networkpath reference normalization e.g \"//localhost:5000/a/b\" -> \"http://localhost:5000/a/b\"\r\n const aTag = window.document.createElement(\"a\");\r\n aTag.href = url;\r\n\r\n this._logger.log(LogLevel.Information, `Normalizing '${url}' to '${aTag.href}'.`);\r\n return aTag.href;\r\n }\r\n\r\n private _resolveNegotiateUrl(url: string): string {\r\n const negotiateUrl = new URL(url);\r\n\r\n if (negotiateUrl.pathname.endsWith('/')) {\r\n negotiateUrl.pathname += \"negotiate\";\r\n } else {\r\n negotiateUrl.pathname += \"/negotiate\";\r\n }\r\n const searchParams = new URLSearchParams(negotiateUrl.searchParams);\r\n\r\n if (!searchParams.has(\"negotiateVersion\")) {\r\n searchParams.append(\"negotiateVersion\", this._negotiateVersion.toString());\r\n }\r\n\r\n if (searchParams.has(\"useStatefulReconnect\")) {\r\n if (searchParams.get(\"useStatefulReconnect\") === \"true\") {\r\n this._options._useStatefulReconnect = true;\r\n }\r\n } else if (this._options._useStatefulReconnect === true) {\r\n searchParams.append(\"useStatefulReconnect\", \"true\");\r\n }\r\n\r\n negotiateUrl.search = searchParams.toString();\r\n\r\n return negotiateUrl.toString();\r\n }\r\n}\r\n\r\nfunction transportMatches(requestedTransport: HttpTransportType | undefined, actualTransport: HttpTransportType) {\r\n return !requestedTransport || ((actualTransport & requestedTransport) !== 0);\r\n}\r\n\r\n/** @private */\r\nexport class TransportSendQueue {\r\n private _buffer: any[] = [];\r\n private _sendBufferedData: PromiseSource;\r\n private _executing: boolean = true;\r\n private _transportResult?: PromiseSource;\r\n private _sendLoopPromise: Promise<void>;\r\n\r\n constructor(private readonly _transport: ITransport) {\r\n this._sendBufferedData = new PromiseSource();\r\n this._transportResult = new PromiseSource();\r\n\r\n this._sendLoopPromise = this._sendLoop();\r\n }\r\n\r\n public send(data: string | ArrayBuffer): Promise<void> {\r\n this._bufferData(data);\r\n if (!this._transportResult) {\r\n this._transportResult = new PromiseSource();\r\n }\r\n return this._transportResult.promise;\r\n }\r\n\r\n public stop(): Promise<void> {\r\n this._executing = false;\r\n this._sendBufferedData.resolve();\r\n return this._sendLoopPromise;\r\n }\r\n\r\n private _bufferData(data: string | ArrayBuffer): void {\r\n if (this._buffer.length && typeof(this._buffer[0]) !== typeof(data)) {\r\n throw new Error(`Expected data to be of type ${typeof(this._buffer)} but was of type ${typeof(data)}`);\r\n }\r\n\r\n this._buffer.push(data);\r\n this._sendBufferedData.resolve();\r\n }\r\n\r\n private async _sendLoop(): Promise<void> {\r\n while (true) {\r\n await this._sendBufferedData.promise;\r\n\r\n if (!this._executing) {\r\n if (this._transportResult) {\r\n this._transportResult.reject(\"Connection stopped.\");\r\n }\r\n\r\n break;\r\n }\r\n\r\n this._sendBufferedData = new PromiseSource();\r\n\r\n const transportResult = this._transportResult!;\r\n this._transportResult = undefined;\r\n\r\n const data = typeof(this._buffer[0]) === \"string\" ?\r\n this._buffer.join(\"\") :\r\n TransportSendQueue._concatBuffers(this._buffer);\r\n\r\n this._buffer.length = 0;\r\n\r\n try {\r\n await this._transport.send(data);\r\n transportResult.resolve();\r\n } catch (error) {\r\n transportResult.reject(error);\r\n }\r\n }\r\n }\r\n\r\n private static _concatBuffers(arrayBuffers: ArrayBuffer[]): ArrayBuffer {\r\n const totalLength = arrayBuffers.map((b) => b.byteLength).reduce((a, b) => a + b);\r\n const result = new Uint8Array(totalLength);\r\n let offset = 0;\r\n for (const item of arrayBuffers) {\r\n result.set(new Uint8Array(item), offset);\r\n offset += item.byteLength;\r\n }\r\n\r\n return result.buffer;\r\n }\r\n}\r\n\r\nclass PromiseSource {\r\n private _resolver?: () => void;\r\n private _rejecter!: (reason?: any) => void;\r\n public promise: Promise<void>;\r\n\r\n constructor() {\r\n this.promise = new Promise((resolve, reject) => [this._resolver, this._rejecter] = [resolve, reject]);\r\n }\r\n\r\n public resolve(): void {\r\n this._resolver!();\r\n }\r\n\r\n public reject(reason?: any): void {\r\n this._rejecter!(reason);\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n/** @private */\r\nexport function configureFetch(): boolean {\r\n return false;\r\n}\r\n\r\n/** @private */\r\nexport function configureAbortController(): boolean {\r\n return false;\r\n}\r\n\r\n/** @private */\r\nexport function getWS(): any {\r\n throw new Error(\"Trying to import 'ws' in the browser.\");\r\n}\r\n\r\n/** @private */\r\nexport function getEventSource(): any {\r\n throw new Error(\"Trying to import 'eventsource' in the browser.\");\r\n}","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AckMessage, CompletionMessage, HubMessage, IHubProtocol, InvocationMessage, MessageType, SequenceMessage, StreamItemMessage } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\n\r\nconst JSON_HUB_PROTOCOL_NAME: string = \"json\";\r\n\r\n/** Implements the JSON Hub Protocol. */\r\nexport class JsonHubProtocol implements IHubProtocol {\r\n\r\n /** @inheritDoc */\r\n public readonly name: string = JSON_HUB_PROTOCOL_NAME;\r\n /** @inheritDoc */\r\n public readonly version: number = 2;\r\n\r\n /** @inheritDoc */\r\n public readonly transferFormat: TransferFormat = TransferFormat.Text;\r\n\r\n /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * @param {string} input A string containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n public parseMessages(input: string, logger: ILogger): HubMessage[] {\r\n // The interface does allow \"ArrayBuffer\" to be passed in, but this implementation does not. So let's throw a useful error.\r\n if (typeof input !== \"string\") {\r\n throw new Error(\"Invalid input for JSON hub protocol. Expected a string.\");\r\n }\r\n\r\n if (!input) {\r\n return [];\r\n }\r\n\r\n if (logger === null) {\r\n logger = NullLogger.instance;\r\n }\r\n\r\n // Parse the messages\r\n const messages = TextMessageFormat.parse(input);\r\n\r\n const hubMessages = [];\r\n for (const message of messages) {\r\n const parsedMessage = JSON.parse(message) as HubMessage;\r\n if (typeof parsedMessage.type !== \"number\") {\r\n throw new Error(\"Invalid payload.\");\r\n }\r\n switch (parsedMessage.type) {\r\n case MessageType.Invocation:\r\n this._isInvocationMessage(parsedMessage);\r\n break;\r\n case MessageType.StreamItem:\r\n this._isStreamItemMessage(parsedMessage);\r\n break;\r\n case MessageType.Completion:\r\n this._isCompletionMessage(parsedMessage);\r\n break;\r\n case MessageType.Ping:\r\n // Single value, no need to validate\r\n break;\r\n case MessageType.Close:\r\n // All optional values, no need to validate\r\n break;\r\n case MessageType.Ack:\r\n this._isAckMessage(parsedMessage);\r\n break;\r\n case MessageType.Sequence:\r\n this._isSequenceMessage(parsedMessage);\r\n break;\r\n default:\r\n // Future protocol changes can add message types, old clients can ignore them\r\n logger.log(LogLevel.Information, \"Unknown message type '\" + parsedMessage.type + \"' ignored.\");\r\n continue;\r\n }\r\n hubMessages.push(parsedMessage);\r\n }\r\n\r\n return hubMessages;\r\n }\r\n\r\n /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string} A string containing the serialized representation of the message.\r\n */\r\n public writeMessage(message: HubMessage): string {\r\n return TextMessageFormat.write(JSON.stringify(message));\r\n }\r\n\r\n private _isInvocationMessage(message: InvocationMessage): void {\r\n this._assertNotEmptyString(message.target, \"Invalid payload for Invocation message.\");\r\n\r\n if (message.invocationId !== undefined) {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Invocation message.\");\r\n }\r\n }\r\n\r\n private _isStreamItemMessage(message: StreamItemMessage): void {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for StreamItem message.\");\r\n\r\n if (message.item === undefined) {\r\n throw new Error(\"Invalid payload for StreamItem message.\");\r\n }\r\n }\r\n\r\n private _isCompletionMessage(message: CompletionMessage): void {\r\n if (message.result && message.error) {\r\n throw new Error(\"Invalid payload for Completion message.\");\r\n }\r\n\r\n if (!message.result && message.error) {\r\n this._assertNotEmptyString(message.error, \"Invalid payload for Completion message.\");\r\n }\r\n\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Completion message.\");\r\n }\r\n\r\n private _isAckMessage(message: AckMessage): void {\r\n if (typeof message.sequenceId !== 'number') {\r\n throw new Error(\"Invalid SequenceId for Ack message.\");\r\n }\r\n }\r\n\r\n private _isSequenceMessage(message: SequenceMessage): void {\r\n if (typeof message.sequenceId !== 'number') {\r\n throw new Error(\"Invalid SequenceId for Sequence message.\");\r\n }\r\n }\r\n\r\n private _assertNotEmptyString(value: any, errorMessage: string): void {\r\n if (typeof value !== \"string\" || value === \"\") {\r\n throw new Error(errorMessage);\r\n }\r\n }\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { DefaultReconnectPolicy } from \"./DefaultReconnectPolicy\";\r\nimport { HttpConnection } from \"./HttpConnection\";\r\nimport { HubConnection } from \"./HubConnection\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\nimport { IHubProtocol } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { IRetryPolicy } from \"./IRetryPolicy\";\r\nimport { IStatefulReconnectOptions } from \"./IStatefulReconnectOptions\";\r\nimport { HttpTransportType } from \"./ITransport\";\r\nimport { JsonHubProtocol } from \"./JsonHubProtocol\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { Arg, ConsoleLogger } from \"./Utils\";\r\n\r\nconst LogLevelNameMapping: {[k: string]: LogLevel} = {\r\n trace: LogLevel.Trace,\r\n debug: LogLevel.Debug,\r\n info: LogLevel.Information,\r\n information: LogLevel.Information,\r\n warn: LogLevel.Warning,\r\n warning: LogLevel.Warning,\r\n error: LogLevel.Error,\r\n critical: LogLevel.Critical,\r\n none: LogLevel.None,\r\n};\r\n\r\nfunction parseLogLevel(name: string): LogLevel {\r\n // Case-insensitive matching via lower-casing\r\n // Yes, I know case-folding is a complicated problem in Unicode, but we only support\r\n // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse.\r\n const mapping = LogLevelNameMapping[name.toLowerCase()];\r\n if (typeof mapping !== \"undefined\") {\r\n return mapping;\r\n } else {\r\n throw new Error(`Unknown log level: ${name}`);\r\n }\r\n}\r\n\r\n/** A builder for configuring {@link @microsoft/signalr.HubConnection} instances. */\r\nexport class HubConnectionBuilder {\r\n private _serverTimeoutInMilliseconds?: number;\r\n private _keepAliveIntervalInMilliseconds ?: number;\r\n\r\n /** @internal */\r\n public protocol?: IHubProtocol;\r\n /** @internal */\r\n public httpConnectionOptions?: IHttpConnectionOptions;\r\n /** @internal */\r\n public url?: string;\r\n /** @internal */\r\n public logger?: ILogger;\r\n\r\n /** If defined, this indicates the client should automatically attempt to reconnect if the connection is lost. */\r\n /** @internal */\r\n public reconnectPolicy?: IRetryPolicy;\r\n\r\n private _statefulReconnectBufferSize?: number;\r\n\r\n /** Configures console logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {LogLevel} logLevel The minimum level of messages to log. Anything at this level, or a more severe level, will be logged.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public configureLogging(logLevel: LogLevel): HubConnectionBuilder;\r\n\r\n /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {ILogger} logger An object implementing the {@link @microsoft/signalr.ILogger} interface, which will be used to write all log messages.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public configureLogging(logger: ILogger): HubConnectionBuilder;\r\n\r\n /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {string} logLevel A string representing a LogLevel setting a minimum level of messages to log.\r\n * See {@link https://learn.microsoft.com/aspnet/core/signalr/configuration#configure-logging|the documentation for client logging configuration} for more details.\r\n */\r\n public configureLogging(logLevel: string): HubConnectionBuilder;\r\n\r\n /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {LogLevel | string | ILogger} logging A {@link @microsoft/signalr.LogLevel}, a string representing a LogLevel, or an object implementing the {@link @microsoft/signalr.ILogger} interface.\r\n * See {@link https://learn.microsoft.com/aspnet/core/signalr/configuration#configure-logging|the documentation for client logging configuration} for more details.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public configureLogging(logging: LogLevel | string | ILogger): HubConnectionBuilder;\r\n public configureLogging(logging: LogLevel | string | ILogger): HubConnectionBuilder {\r\n Arg.isRequired(logging, \"logging\");\r\n\r\n if (isLogger(logging)) {\r\n this.logger = logging;\r\n } else if (typeof logging === \"string\") {\r\n const logLevel = parseLogLevel(logging);\r\n this.logger = new ConsoleLogger(logLevel);\r\n } else {\r\n this.logger = new ConsoleLogger(logging);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use HTTP-based transports to connect to the specified URL.\r\n *\r\n * The transport will be selected automatically based on what the server and client support.\r\n *\r\n * @param {string} url The URL the connection will use.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withUrl(url: string): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified HTTP-based transport to connect to the specified URL.\r\n *\r\n * @param {string} url The URL the connection will use.\r\n * @param {HttpTransportType} transportType The specific transport to use.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withUrl(url: string, transportType: HttpTransportType): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use HTTP-based transports to connect to the specified URL.\r\n *\r\n * @param {string} url The URL the connection will use.\r\n * @param {IHttpConnectionOptions} options An options object used to configure the connection.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withUrl(url: string, options: IHttpConnectionOptions): HubConnectionBuilder;\r\n public withUrl(url: string, transportTypeOrOptions?: IHttpConnectionOptions | HttpTransportType): HubConnectionBuilder {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isNotEmpty(url, \"url\");\r\n\r\n this.url = url;\r\n\r\n // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed\r\n // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called.\r\n if (typeof transportTypeOrOptions === \"object\") {\r\n this.httpConnectionOptions = { ...this.httpConnectionOptions, ...transportTypeOrOptions };\r\n } else {\r\n this.httpConnectionOptions = {\r\n ...this.httpConnectionOptions,\r\n transport: transportTypeOrOptions,\r\n };\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.\r\n *\r\n * @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.\r\n */\r\n public withHubProtocol(protocol: IHubProtocol): HubConnectionBuilder {\r\n Arg.isRequired(protocol, \"protocol\");\r\n\r\n this.protocol = protocol;\r\n return this;\r\n }\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r\n * By default, the client will wait 0, 2, 10 and 30 seconds respectively before trying up to 4 reconnect attempts.\r\n */\r\n public withAutomaticReconnect(): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r\n *\r\n * @param {number[]} retryDelays An array containing the delays in milliseconds before trying each reconnect attempt.\r\n * The length of the array represents how many failed reconnect attempts it takes before the client will stop attempting to reconnect.\r\n */\r\n public withAutomaticReconnect(retryDelays: number[]): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r\n *\r\n * @param {IRetryPolicy} reconnectPolicy An {@link @microsoft/signalR.IRetryPolicy} that controls the timing and number of reconnect attempts.\r\n */\r\n public withAutomaticReconnect(reconnectPolicy: IRetryPolicy): HubConnectionBuilder;\r\n public withAutomaticReconnect(retryDelaysOrReconnectPolicy?: number[] | IRetryPolicy): HubConnectionBuilder {\r\n if (this.reconnectPolicy) {\r\n throw new Error(\"A reconnectPolicy has already been set.\");\r\n }\r\n\r\n if (!retryDelaysOrReconnectPolicy) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy();\r\n } else if (Array.isArray(retryDelaysOrReconnectPolicy)) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy(retryDelaysOrReconnectPolicy);\r\n } else {\r\n this.reconnectPolicy = retryDelaysOrReconnectPolicy;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Configures {@link @microsoft/signalr.HubConnection.serverTimeoutInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withServerTimeout(milliseconds: number): HubConnectionBuilder {\r\n Arg.isRequired(milliseconds, \"milliseconds\");\r\n\r\n this._serverTimeoutInMilliseconds = milliseconds;\r\n\r\n return this;\r\n }\r\n\r\n /** Configures {@link @microsoft/signalr.HubConnection.keepAliveIntervalInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withKeepAliveInterval(milliseconds: number): HubConnectionBuilder {\r\n Arg.isRequired(milliseconds, \"milliseconds\");\r\n\r\n this._keepAliveIntervalInMilliseconds = milliseconds;\r\n\r\n return this;\r\n }\r\n\r\n /** Enables and configures options for the Stateful Reconnect feature.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withStatefulReconnect(options?: IStatefulReconnectOptions): HubConnectionBuilder {\r\n if (this.httpConnectionOptions === undefined) {\r\n this.httpConnectionOptions = {};\r\n }\r\n this.httpConnectionOptions._useStatefulReconnect = true;\r\n\r\n this._statefulReconnectBufferSize = options?.bufferSize;\r\n\r\n return this;\r\n }\r\n\r\n /** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.\r\n *\r\n * @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.\r\n */\r\n public build(): HubConnection {\r\n // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one\r\n // provided to configureLogger\r\n const httpConnectionOptions = this.httpConnectionOptions || {};\r\n\r\n // If it's 'null', the user **explicitly** asked for null, don't mess with it.\r\n if (httpConnectionOptions.logger === undefined) {\r\n // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it.\r\n httpConnectionOptions.logger = this.logger;\r\n }\r\n\r\n // Now create the connection\r\n if (!this.url) {\r\n throw new Error(\"The 'HubConnectionBuilder.withUrl' method must be called before building the connection.\");\r\n }\r\n const connection = new HttpConnection(this.url, httpConnectionOptions);\r\n\r\n return HubConnection.create(\r\n connection,\r\n this.logger || NullLogger.instance,\r\n this.protocol || new JsonHubProtocol(),\r\n this.reconnectPolicy,\r\n this._serverTimeoutInMilliseconds,\r\n this._keepAliveIntervalInMilliseconds,\r\n this._statefulReconnectBufferSize);\r\n }\r\n}\r\n\r\nfunction isLogger(logger: any): logger is ILogger {\r\n return logger.log !== undefined;\r\n}\r\n","// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// This is where we add any polyfills we'll need for the browser. It is the entry module for browser-specific builds.\r\n\r\n// Copy from Array.prototype into Uint8Array to polyfill on IE. It's OK because the implementations of indexOf and slice use properties\r\n// that exist on Uint8Array with the same name, and JavaScript is magic.\r\n// We make them 'writable' because the Buffer polyfill messes with it as well.\r\nif (!Uint8Array.prototype.indexOf) {\r\n Object.defineProperty(Uint8Array.prototype, \"indexOf\", {\r\n value: Array.prototype.indexOf,\r\n writable: true,\r\n });\r\n}\r\nif (!Uint8Array.prototype.slice) {\r\n Object.defineProperty(Uint8Array.prototype, \"slice\", {\r\n // wrap the slice in Uint8Array so it looks like a Uint8Array.slice call\r\n // eslint-disable-next-line object-shorthand\r\n value: function(start?: number, end?: number) { return new Uint8Array(Array.prototype.slice.call(this, start, end)); },\r\n writable: true,\r\n });\r\n}\r\nif (!Uint8Array.prototype.forEach) {\r\n Object.defineProperty(Uint8Array.prototype, \"forEach\", {\r\n value: Array.prototype.forEach,\r\n writable: true,\r\n });\r\n}\r\n\r\nexport * from \"./index\";\r\n","if (!String.prototype.startsWith) {\n Object.defineProperty(String.prototype, 'startsWith', {\n enumerable: false,\n configurable: false,\n writable: false,\n value: function (searchString, position) {\n position = position || 0;\n return this.indexOf(searchString, position) === position;\n }\n });\n}\n\n$(document).ready(function ()\n{\n Controls.configure(window.controlsOptions || {});\n Ajax.addAjaxViewParser(function (view)\n {\n Controls.parse(view);\n });\n});\n\ndocument.addEventListener('triggerSuperexpressPagerBehaviour', ()=> {\n Controls.parseOne(document, new Behaviours.PagerTriggerBehaviour());\n})","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.amdO = {};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","/* виджеты Ñобраны как ÑÑ‚Ð°Ñ‚Ð¸Ñ‡Ð½Ð°Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñ‚ÐµÐºÐ° в wwwroot/static/libs/widgets.js\n при модификации желательно не затрагивать ts файлы во избежание проблем Ñо Ñборкой */\n// import './Shared/Infrastructure/Behaviours/Widgets/WidgetBehavior';\n// import './Shared/Widgets/WidgetController';\n// import './Shared/Widgets/HotEvents/HotEventsWidgetController';\n// import './Shared/Widgets/Reviews/ReviewWidgetController';\n// import './Shared/Widgets/Interesting/InterestingWidgetController';\n\nimport './Shared/libs/jquery/jquery-ui.min.js';\nimport './Shared/libs/jquery/jquery.ui.touch-punch.min.js';\nimport './Shared/libs/jquery/jquery.touchSwipe.min.js';\nimport './Shared/libs/jquery.powertip/jquery.powertip.js';\nimport './Shared/libs/jquery/jquery.nice-select.min.js';\nimport './Shared/libs/jquery.timepicker/jquery-ui-timepicker-addon.js';\nimport './Shared/libs/blockUI/jquery.blockUI.js';\nimport './Shared/libs/inputmask/inputmask.js';\nimport './Shared/libs/inputmask/jquery.inputmask.js';\nimport './Shared/libs/jquery.validate/jquery.validate.js';\nimport './Shared/libs/jquery.validate/jquery.validate.unobtrusive.js';\nimport './Shared/libs/microsoft/signalr/dist/browser/signalr.min.js';\nimport './Shared/Infrastructure/Localization';\nimport './Shared/libs/jquery/jquery-ui-datepicker-settings.js';\n\nimport './Shared/Infrastructure/LanguageSelector';\nimport './Shared/Infrastructure/UiBlock';\nimport './Shared/Infrastructure/Utils';\nimport './Shared/Infrastructure/Ajax';\nimport './Shared/Infrastructure/Popup';\nimport './Shared/Infrastructure/Validators';\nimport './Shared/Infrastructure/Behaviours/BaseControlBehaviour';\nimport './Shared/Infrastructure/Behaviours/AjaxActionBehavior';\nimport './Shared/Infrastructure/Behaviours/EnterBehaviour';\nimport './Shared/Infrastructure/Behaviours/AutoFocusBehaviour';\nimport './Shared/Infrastructure/Behaviours/DatePickerBehaviour';\nimport './Shared/Infrastructure/Behaviours/InputMaskBehaviour';\nimport './Shared/Infrastructure/Behaviours/InputTrimBehaviour';\nimport './Shared/Infrastructure/Behaviours/PagerBehaviour';\nimport './Shared/Infrastructure/Behaviours/ReplaceTagBehaviour';\nimport './Shared/Infrastructure/Behaviours/TooltipsBehaviour';\nimport './Shared/Infrastructure/Behaviours/RecaptchaBehaviour';\nimport './Shared/Infrastructure/Behaviours/PasswordPreviewBehaviour';\nimport './Shared/Infrastructure/Behaviours/SortableBehaviour';\nimport './Shared/Infrastructure/Behaviours/CustomSelectsBehaviour';\nimport './Shared/Infrastructure/Behaviours/ChangablesBehaviour';\nimport './Shared/Infrastructure/Behaviours/TabsBehaviour';\nimport './Shared/Infrastructure/Behaviours/ToggleBehaviour';\nimport './Shared/Infrastructure/Behaviours/Component/ComponentBehavior';\nimport './Shared/Infrastructure/Behaviours/ScrollbarBehaviour';\nimport './Shared/Infrastructure/Behaviours/PaymentChannelAmountBehaviour';\nimport './Shared/Infrastructure/Behaviours/VoximplantCallBehaviour';\nimport './Shared/Infrastructure/Behaviours/CustomFileBehaviour';\nimport './Shared/Infrastructure/Behaviours/FileControlsBehaviour';\nimport './Shared/Infrastructure/SRLiveAdapter';\nimport './Shared/Infrastructure/Behaviours/Reviews/UseBettingCartBehaviour';\nimport './Shared/Infrastructure/Behaviours/AddressesTableBehaviour';\nimport './Shared/Infrastructure/Controls';\nimport './Shared/Infrastructure/LocalStorageProvider';\nimport './Shared/Infrastructure/Metrics';\nimport './Shared/Infrastructure/Behaviours/NotificationBehaviour';\nimport './Shared/Sports/Sports';\nimport './Shared/SignalR/SignalRConfigBuilder';\nimport './Shared/SignalR/SignalR';\nimport './Shared/startup.js';\n"],"names":[],"sourceRoot":""}