{"version":3,"sources":["bootstrap.min.js","svg-replace.js","jquery.circliful.min.js","custom.js","bootstrap-select.js","fileinput.js","ro.js","jquery.mobile.custom.js","jquery-ui-spinner.min.js","jquery-ui-datepicker.js","jquery.form.js"],"names":[],"mappings":"AAAA;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;AC7BA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC3SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AC5tIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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/7BA;AACA;AACA;AACA;AACA;AACA;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACrnEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"script.js","sourcesContent":["/*!\r\n * Bootstrap v3.3.7 (http://getbootstrap.com)\r\n * Copyright 2011-2016 Twitter, Inc.\r\n * Licensed under the MIT license\r\n */\r\nif(\"undefined\"==typeof jQuery)throw new Error(\"Bootstrap's JavaScript requires jQuery\");+function(a){\"use strict\";var b=a.fn.jquery.split(\" \")[0].split(\".\");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error(\"Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4\")}(jQuery),+function(a){\"use strict\";function b(){var a=document.createElement(\"bootstrap\"),b={WebkitTransition:\"webkitTransitionEnd\",MozTransition:\"transitionend\",OTransition:\"oTransitionEnd otransitionend\",transition:\"transitionend\"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(\"bsTransitionEnd\",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var c=a(this),e=c.data(\"bs.alert\");e||c.data(\"bs.alert\",e=new d(this)),\"string\"==typeof b&&e[b].call(c)})}var c='[data-dismiss=\"alert\"]',d=function(b){a(b).on(\"click\",c,this.close)};d.VERSION=\"3.3.7\",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger(\"closed.bs.alert\").remove()}var e=a(this),f=e.attr(\"data-target\");f||(f=e.attr(\"href\"),f=f&&f.replace(/.*(?=#[^\\s]*$)/,\"\"));var g=a(\"#\"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(\".alert\")),g.trigger(b=a.Event(\"close.bs.alert\")),b.isDefaultPrevented()||(g.removeClass(\"in\"),a.support.transition&&g.hasClass(\"fade\")?g.one(\"bsTransitionEnd\",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on(\"click.bs.alert.data-api\",c,d.prototype.close)}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.button\"),f=\"object\"==typeof b&&b;e||d.data(\"bs.button\",e=new c(this,f)),\"toggle\"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION=\"3.3.7\",c.DEFAULTS={loadingText:\"loading...\"},c.prototype.setState=function(b){var c=\"disabled\",d=this.$element,e=d.is(\"input\")?\"val\":\"html\",f=d.data();b+=\"Text\",null==f.resetText&&d.data(\"resetText\",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),\"loadingText\"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle=\"buttons\"]');if(b.length){var c=this.$element.find(\"input\");\"radio\"==c.prop(\"type\")?(c.prop(\"checked\")&&(a=!1),b.find(\".active\").removeClass(\"active\"),this.$element.addClass(\"active\")):\"checkbox\"==c.prop(\"type\")&&(c.prop(\"checked\")!==this.$element.hasClass(\"active\")&&(a=!1),this.$element.toggleClass(\"active\")),c.prop(\"checked\",this.$element.hasClass(\"active\")),a&&c.trigger(\"change\")}else this.$element.attr(\"aria-pressed\",!this.$element.hasClass(\"active\")),this.$element.toggleClass(\"active\")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on(\"click.bs.button.data-api\",'[data-toggle^=\"button\"]',function(c){var d=a(c.target).closest(\".btn\");b.call(d,\"toggle\"),a(c.target).is('input[type=\"radio\"], input[type=\"checkbox\"]')||(c.preventDefault(),d.is(\"input,button\")?d.trigger(\"focus\"):d.find(\"input:visible,button:visible\").first().trigger(\"focus\"))}).on(\"focus.bs.button.data-api blur.bs.button.data-api\",'[data-toggle^=\"button\"]',function(b){a(b.target).closest(\".btn\").toggleClass(\"focus\",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.carousel\"),f=a.extend({},c.DEFAULTS,d.data(),\"object\"==typeof b&&b),g=\"string\"==typeof b?b:f.slide;e||d.data(\"bs.carousel\",e=new c(this,f)),\"number\"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(\".carousel-indicators\"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on(\"keydown.bs.carousel\",a.proxy(this.keydown,this)),\"hover\"==this.options.pause&&!(\"ontouchstart\"in document.documentElement)&&this.$element.on(\"mouseenter.bs.carousel\",a.proxy(this.pause,this)).on(\"mouseleave.bs.carousel\",a.proxy(this.cycle,this))};c.VERSION=\"3.3.7\",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:\"hover\",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(\".item\"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d=\"prev\"==a&&0===c||\"next\"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e=\"prev\"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(\".item.active\"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one(\"slid.bs.carousel\",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?\"next\":\"prev\",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(\".next, .prev\").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide(\"next\")},c.prototype.prev=function(){if(!this.sliding)return this.slide(\"prev\")},c.prototype.slide=function(b,d){var e=this.$element.find(\".item.active\"),f=d||this.getItemForDirection(b,e),g=this.interval,h=\"next\"==b?\"left\":\"right\",i=this;if(f.hasClass(\"active\"))return this.sliding=!1;var j=f[0],k=a.Event(\"slide.bs.carousel\",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(\".active\").removeClass(\"active\");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass(\"active\")}var m=a.Event(\"slid.bs.carousel\",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass(\"slide\")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one(\"bsTransitionEnd\",function(){f.removeClass([b,h].join(\" \")).addClass(\"active\"),e.removeClass([\"active\",h].join(\" \")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass(\"active\"),f.addClass(\"active\"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr(\"data-target\")||(d=e.attr(\"href\"))&&d.replace(/.*(?=#[^\\s]+$)/,\"\"));if(f.hasClass(\"carousel\")){var g=a.extend({},f.data(),e.data()),h=e.attr(\"data-slide-to\");h&&(g.interval=!1),b.call(f,g),h&&f.data(\"bs.carousel\").to(h),c.preventDefault()}};a(document).on(\"click.bs.carousel.data-api\",\"[data-slide]\",e).on(\"click.bs.carousel.data-api\",\"[data-slide-to]\",e),a(window).on(\"load\",function(){a('[data-ride=\"carousel\"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){\"use strict\";function b(b){var c,d=b.attr(\"data-target\")||(c=b.attr(\"href\"))&&c.replace(/.*(?=#[^\\s]+$)/,\"\");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data(\"bs.collapse\"),f=a.extend({},d.DEFAULTS,c.data(),\"object\"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data(\"bs.collapse\",e=new d(this,f)),\"string\"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle=\"collapse\"][href=\"#'+b.id+'\"],[data-toggle=\"collapse\"][data-target=\"#'+b.id+'\"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION=\"3.3.7\",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass(\"width\");return a?\"width\":\"height\"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass(\"in\")){var b,e=this.$parent&&this.$parent.children(\".panel\").children(\".in, .collapsing\");if(!(e&&e.length&&(b=e.data(\"bs.collapse\"),b&&b.transitioning))){var f=a.Event(\"show.bs.collapse\");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,\"hide\"),b||e.data(\"bs.collapse\",null));var g=this.dimension();this.$element.removeClass(\"collapse\").addClass(\"collapsing\")[g](0).attr(\"aria-expanded\",!0),this.$trigger.removeClass(\"collapsed\").attr(\"aria-expanded\",!0),this.transitioning=1;var h=function(){this.$element.removeClass(\"collapsing\").addClass(\"collapse in\")[g](\"\"),this.transitioning=0,this.$element.trigger(\"shown.bs.collapse\")};if(!a.support.transition)return h.call(this);var i=a.camelCase([\"scroll\",g].join(\"-\"));this.$element.one(\"bsTransitionEnd\",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass(\"in\")){var b=a.Event(\"hide.bs.collapse\");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass(\"collapsing\").removeClass(\"collapse in\").attr(\"aria-expanded\",!1),this.$trigger.addClass(\"collapsed\").attr(\"aria-expanded\",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass(\"collapsing\").addClass(\"collapse\").trigger(\"hidden.bs.collapse\")};return a.support.transition?void this.$element[c](0).one(\"bsTransitionEnd\",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass(\"in\")?\"hide\":\"show\"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle=\"collapse\"][data-parent=\"'+this.options.parent+'\"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass(\"in\");a.attr(\"aria-expanded\",c),b.toggleClass(\"collapsed\",!c).attr(\"aria-expanded\",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on(\"click.bs.collapse.data-api\",'[data-toggle=\"collapse\"]',function(d){var e=a(this);e.attr(\"data-target\")||d.preventDefault();var f=b(e),g=f.data(\"bs.collapse\"),h=g?\"toggle\":e.data();c.call(f,h)})}(jQuery),+function(a){\"use strict\";function b(b){var c=b.attr(\"data-target\");c||(c=b.attr(\"href\"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\\s]*$)/,\"\"));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass(\"open\")&&(c&&\"click\"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event(\"hide.bs.dropdown\",f)),c.isDefaultPrevented()||(d.attr(\"aria-expanded\",\"false\"),e.removeClass(\"open\").trigger(a.Event(\"hidden.bs.dropdown\",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data(\"bs.dropdown\");d||c.data(\"bs.dropdown\",d=new g(this)),\"string\"==typeof b&&d[b].call(c)})}var e=\".dropdown-backdrop\",f='[data-toggle=\"dropdown\"]',g=function(b){a(b).on(\"click.bs.dropdown\",this.toggle)};g.VERSION=\"3.3.7\",g.prototype.toggle=function(d){var e=a(this);if(!e.is(\".disabled, :disabled\")){var f=b(e),g=f.hasClass(\"open\");if(c(),!g){\"ontouchstart\"in document.documentElement&&!f.closest(\".navbar-nav\").length&&a(document.createElement(\"div\")).addClass(\"dropdown-backdrop\").insertAfter(a(this)).on(\"click\",c);var h={relatedTarget:this};if(f.trigger(d=a.Event(\"show.bs.dropdown\",h)),d.isDefaultPrevented())return;e.trigger(\"focus\").attr(\"aria-expanded\",\"true\"),f.toggleClass(\"open\").trigger(a.Event(\"shown.bs.dropdown\",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(\".disabled, :disabled\")){var e=b(d),g=e.hasClass(\"open\");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger(\"focus\"),d.trigger(\"click\");var h=\" li:not(.disabled):visible a\",i=e.find(\".dropdown-menu\"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:\"\",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:\"\"})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:\"\",paddingRight:\"\"})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:\"hover focus\",title:\"\",delay:0,html:!1,container:!1,viewport:{selector:\"body\",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error(\"`selector` option must be specified when initializing \"+this.type+\" on the window.document object!\");for(var e=this.options.trigger.split(\" \"),f=e.length;f--;){var g=e[f];if(\"click\"==g)this.$element.on(\"click.\"+this.type,this.options.selector,a.proxy(this.toggle,this));else if(\"manual\"!=g){var h=\"hover\"==g?\"mouseenter\":\"focusin\",i=\"hover\"==g?\"mouseleave\":\"focusout\";this.$element.on(h+\".\"+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+\".\"+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:\"manual\",selector:\"\"}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&\"number\"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data(\"bs.\"+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data(\"bs.\"+this.type,c)),b instanceof a.Event&&(c.inState[\"focusin\"==b.type?\"focus\":\"hover\"]=!0),c.tip().hasClass(\"in\")||\"in\"==c.hoverState?void(c.hoverState=\"in\"):(clearTimeout(c.timeout),c.hoverState=\"in\",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){\"in\"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data(\"bs.\"+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data(\"bs.\"+this.type,c)),b instanceof a.Event&&(c.inState[\"focusout\"==b.type?\"focus\":\"hover\"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState=\"out\",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){\"out\"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event(\"show.bs.\"+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr(\"id\",g),this.$element.attr(\"aria-describedby\",g),this.options.animation&&f.addClass(\"fade\");var h=\"function\"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\\s?auto?\\s?/i,j=i.test(h);j&&(h=h.replace(i,\"\")||\"top\"),f.detach().css({top:0,left:0,display:\"block\"}).addClass(h).data(\"bs.\"+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger(\"inserted.bs.\"+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h=\"bottom\"==h&&k.bottom+m>o.bottom?\"top\":\"top\"==h&&k.top-mo.width?\"left\":\"left\"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr(\"data-original-title\")||(\"function\"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+\" `template` option must consist of exactly 1 top-level element!\");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(\".tooltip-arrow\")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data(\"bs.\"+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data(\"bs.\"+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass(\"in\")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off(\".\"+a.type).removeData(\"bs.\"+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.popover\"),f=\"object\"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data(\"bs.popover\",e=new c(this,f)),\"string\"==typeof b&&e[b]())})}var c=function(a,b){this.init(\"popover\",a,b)};if(!a.fn.tooltip)throw new Error(\"Popover requires tooltip.js\");c.VERSION=\"3.3.7\",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:\"right\",trigger:\"click\",content:\"\",template:'

'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(\".popover-title\")[this.options.html?\"html\":\"text\"](b),a.find(\".popover-content\").children().detach().end()[this.options.html?\"string\"==typeof c?\"html\":\"append\":\"text\"](c),a.removeClass(\"fade top bottom left right in\"),a.find(\".popover-title\").html()||a.find(\".popover-title\").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr(\"data-content\")||(\"function\"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(\".arrow\")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){\"use strict\";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||\"\")+\" .nav li > a\",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on(\"scroll.bs.scrollspy\",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data(\"bs.scrollspy\"),f=\"object\"==typeof c&&c;e||d.data(\"bs.scrollspy\",e=new b(this,f)),\"string\"==typeof c&&e[c]()})}b.VERSION=\"3.3.7\",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c=\"offset\",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c=\"position\",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data(\"target\")||b.attr(\"href\"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(\":visible\")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active\").removeClass(\"active\").end().find('[data-toggle=\"tab\"]').attr(\"aria-expanded\",!1),b.addClass(\"active\").find('[data-toggle=\"tab\"]').attr(\"aria-expanded\",!0),h?(b[0].offsetWidth,b.addClass(\"in\")):b.removeClass(\"fade\"),b.parent(\".dropdown-menu\").length&&b.closest(\"li.dropdown\").addClass(\"active\").end().find('[data-toggle=\"tab\"]').attr(\"aria-expanded\",!0),e&&e()}var g=d.find(\"> .active\"),h=e&&a.support.transition&&(g.length&&g.hasClass(\"fade\")||!!d.find(\"> .fade\").length);g.length&&h?g.one(\"bsTransitionEnd\",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass(\"in\")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),\"show\")};a(document).on(\"click.bs.tab.data-api\",'[data-toggle=\"tab\"]',e).on(\"click.bs.tab.data-api\",'[data-toggle=\"pill\"]',e)}(jQuery),+function(a){\"use strict\";function b(b){return this.each(function(){var d=a(this),e=d.data(\"bs.affix\"),f=\"object\"==typeof b&&b;e||d.data(\"bs.affix\",e=new c(this,f)),\"string\"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on(\"scroll.bs.affix.data-api\",a.proxy(this.checkPosition,this)).on(\"click.bs.affix.data-api\",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION=\"3.3.7\",c.RESET=\"affix affix-top affix-bottom\",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&\"top\"==this.affixed)return e=a-d&&\"bottom\"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass(\"affix\");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(\":visible\")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());\"object\"!=typeof d&&(f=e=d),\"function\"==typeof e&&(e=d.top(this.$element)),\"function\"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css(\"top\",\"\");var i=\"affix\"+(h?\"-\"+h:\"\"),j=a.Event(i+\".bs.affix\");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin=\"bottom\"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace(\"affix\",\"affixed\")+\".bs.affix\")}\"bottom\"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on(\"load\",function(){a('[data-spy=\"affix\"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);","/*\r\n * Replace all SVG images with inline SVG\r\n */\r\njQuery(\"img.svg\").each(function () {\r\n var $img = jQuery(this);\r\n var imgID = $img.attr(\"id\");\r\n var imgClass = $img.attr(\"class\");\r\n var imgURL = $img.attr(\"src\");\r\n\r\n jQuery.get(imgURL, function (data) {\r\n // Get the SVG tag, ignore the rest\r\n var $svg = jQuery(data).find(\"svg\");\r\n\r\n // Add replaced images ID to the new SVG\r\n if (typeof imgID !== \"undefined\") {\r\n $svg = $svg.attr(\"id\", imgID);\r\n }\r\n // Add replaced images classes to the new SVG\r\n if (typeof imgClass !== \"undefined\") {\r\n $svg = $svg.attr(\"class\", imgClass + \" replaced-svg\");\r\n }\r\n // Remove any invalid XML tags as per http://validator.w3.org\r\n $svg = $svg.removeAttr(\"xmlns:a\");\r\n\r\n // Replace image with new SVG\r\n $img.replaceWith($svg);\r\n\r\n }, \"xml\");\r\n});\r\n","\"use strict\";!function(e){e.fn.circliful=function(t,r){var n=e.extend({foregroundColor:\"#3498DB\",backgroundColor:\"#ccc\",pointColor:\"none\",fillColor:\"none\",foregroundBorderWidth:15,backgroundBorderWidth:15,pointSize:28.5,fontColor:\"#aaa\",percent:75,animation:1,animationStep:5,icon:\"none\",iconSize:\"30\",iconColor:\"#ccc\",iconPosition:\"top\",target:0,start:0,showPercent:1,percentageTextSize:22,percentageX:100,percentageY:113,textAdditionalCss:\"\",targetPercent:0,targetTextSize:17,targetColor:\"#2980B9\",text:null,textStyle:null,textColor:\"#666\",textY:null,textX:null,multiPercentage:0,percentages:[],multiPercentageLegend:0,textBelow:!1,noPercentageSign:!1,replacePercentageByText:null,halfCircle:!1,animateInView:!1,decimals:0,alwaysDecimals:!1,title:\"Circle Chart\",description:\"\",progressColor:null},t);return this.each(function(){function t(){var e=P,t=W;if(1===n.multiPercentage){var r,l,a=n.percentages,c=360;for(r=0;r0&&(c+=62.5,t=c/100*l),o(e,t,c,l)}else o(e,t,360,l)}function o(t,o,l,a){var c=window.setInterval(function(){B>=o?(window.clearInterval(c),S=1,\"function\"==typeof r&&r.call(this)):(B+=T,z+=X),n.halfCircle?2*B/(l/100)>=a&&1===S&&(B=l/100*a/2):B/(l/100)>=a&&1===S&&(B=l/100*a),z>n.target&&1===S&&(z=n.target),null===n.replacePercentageByText&&(Y=n.halfCircle?parseFloat(100*B/l*2):parseFloat(100*B/l),Y=Y.toFixed(n.decimals),!n.alwaysDecimals&&(0===a||a>1&&1!==S)&&(Y=parseInt(Y))),t.attr(\"stroke-dasharray\",B+\", 20000\"),1!==n.multiPercentage?1===n.showPercent?b.find(\".number\").text(Y):(b.find(\".number\").text(z),b.find(\".percent\").text(\"\")):(b.find(\".number\").text(\"\"),b.find(\".percent\").text(\"\")),null!==w&&e.each(w,function(e,r){n.halfCircle&&(e/=2),B>=e*(l/100)&&t.css({stroke:r,transition:\"stroke 0.1s linear\"})})}.bind(t),v)}function l(){var t=-1!==navigator.userAgent.toLowerCase().indexOf(\"webkit\")?\"body\":\"html\",r=e(t).scrollTop(),n=r+e(window).height(),o=Math.round(P.offset().top),l=o+P.height();return n>o&&l>r}function a(){P.hasClass(\"start\")||l(P)&&(P.addClass(\"start\"),setTimeout(t,250))}function c(t,r){e.each(t,function(e,n){e.toLowerCase()in r&&(t[e]=r[e.toLowerCase()])})}function i(){if(1===n.multiPercentage){var t,r,o,l,a,c=n.percentages,i=47,p=360,u=-90;for(t=0;t0&&(p+=62.5,r=p/100*o),i+=10,a+='';d.addClass(\"svg-container\").append(e(''+(\"undefined\"!=typeof f?f:\"\")+a+g+''+(null===n.replacePercentageByText?0:n.replacePercentageByText)+''+(n.noPercentageSign||null!==n.replacePercentageByText?\"\":\"%\")+\"\")),1===n.multiPercentageLegend&&s()}else d.addClass(\"svg-container\").append(e(''+(\"undefined\"!=typeof f?f:\"\")+''+g+''+(null===n.replacePercentageByText?0:n.replacePercentageByText)+''+(n.noPercentageSign||null!==n.replacePercentageByText?\"\":\"%\")+\"\"))}function s(){var t,r=d.height(),o=d.width(),l=n.percentages,a=\"\";for(t=0;t'+c+\", \"+s+\"%\"}d.append(e(\"
\").append(a).attr(\"style\",\"position:absolute;top:\"+r/3+\"px;left:\"+(o+20)+\"px\").attr(\"class\",\"legend-line\"))}var d=e(this);c(n,d.data());var x,f,g,p=n.percent,u=83,h=100,y=n.percentageY,C=n.percentageX,m=n.backgroundBorderWidth,w=n.progressColor;if(n.halfCircle?\"left\"===n.iconPosition?(h=80,u=100,C=117,y=100):n.halfCircle&&(u=80,y=100):\"bottom\"===n.iconPosition?(u=124,y=95):\"left\"===n.iconPosition?(h=80,u=110,C=117):\"middle\"===n.iconPosition?(1!==n.multiPercentage&&(f='',f+='',C=170,y=35),u=110):\"right\"===n.iconPosition?(h=120,u=110,C=80):\"top\"===n.iconPosition&&\"none\"!==n.icon&&(y=120),n.targetPercent>0&&n.halfCircle!==!0&&(y=95,f='',f+=''+n.targetPercent+(n.noPercentageSign&&null===n.replacePercentageByText?\"\":\"%\")+\"\",f+='',f+=''),null!==n.text&&(f+=n.halfCircle?n.textBelow?''+n.text+\"\":''+n.text+\"\":n.textBelow?''+n.text+\"\":''+n.text+\"\"),\"none\"!==n.icon&&(g='&#x'+n.icon+\"\"),n.halfCircle){var k='transform=\"rotate(-180,100,100)\"';d.addClass(\"svg-container\").append(e(''+(\"undefined\"!=typeof f?f:\"\")+' '+g+''+(null===n.replacePercentageByText?0:n.replacePercentageByText)+''+(n.noPercentageSign||null!==n.replacePercentageByText?\"\":\"%\")+\"\"))}else i();var P=d.find(\".circle\"),b=d.find(\".timer\"),v=30,B=0,T=n.animationStep,S=0,z=0,X=0,Y=p,W=3.6*p;n.halfCircle&&(W=3.6*p/2),null!==n.replacePercentageByText&&(Y=n.replacePercentageByText),n.start>0&&n.target>0&&(p=n.start/(n.target/100),X=n.target/100),1===n.animation?n.animateInView?e(window).scroll(function(){a()}):t():1!==n.multiPercentage?(P.attr(\"stroke-dasharray\",W+\", 20000\"),1===n.showPercent?b.find(\".number\").text(Y):(b.find(\".number\").text(n.target),b.find(\".percent\").text(\"\"))):null!==n.replacePercentageByText&&(b.find(\".number\").text(n.replacePercentageByText),b.find(\".percent\").text(\"\"))})}}(jQuery);","jQuery(document).ready(function ($) {\r\n \r\n var wW = $(window).width();\r\n \r\n // collapsible dashboard side menu\r\n var burger = $('.sidebar .burger-menu');\r\n var sidenav = $('.dashboard .sidebar');\r\n\r\n burger.on('click', function () {\r\n sidenav.toggleClass('collapsed');\r\n// $('body').toggleClass('locked');\r\n });\r\n\r\n $(window).on('resize', function () {\r\n var wW = $(window).width();\r\n if (wW < 992) {\r\n sidenav.addClass('collapsed');\r\n } else {\r\n sidenav.removeClass('collapsed');\r\n }\r\n });\r\n \r\n sidenav.addClass('has-transition');\r\n\r\n\r\n // initialize tooltips\r\n $('[data-toggle=\"tooltip\"]').tooltip()\r\n\r\n //show new data form on admin dashboard, show desfasurator leasing\r\n\r\n $('.show-next-section').on(\"click\", function () {\r\n var sectionToShow = $(this).attr('href');\r\n if (!sectionToShow){\r\n var sectionToShow = '#desfasuratorCalculator';\r\n }else{\r\n $(this).addClass('hidden');\r\n }\r\n $(sectionToShow).addClass(\"opened\");\r\n });\r\n\r\n\r\n $(\".bootstrap-file-upload\").fileinput({\r\n 'language': 'ro',\r\n 'showUpload': false,\r\n 'showCaption': true,\r\n 'previewFileType': 'false'\r\n });\r\n\r\n // add new file upload field\r\n\r\n $(\".contul-meu-date-firma #insertInput\").on(\"click\", function () {\r\n var counter = $('#solicitareSchimbareDate .input-line').length + 1;\r\n initFileUpload('admin', counter);\r\n });\r\n\r\n $(\".contul-meu-date-persoana-fizica #insertInput\").on(\"click\", function () {\r\n var counter = $('#solicitareSchimbareDate .input-line').length + 1;\r\n initFileUpload('pf', counter);\r\n });\r\n\r\n\r\n // dashboard navbar toggler\r\n $(\".mobile-toggle\").on('click', function () {\r\n $(this).parents('.navbar').toggleClass('open');\r\n });\r\n\r\n $(\".dashboard-content .navbar .navbar-nav li.active\").on('click', function (e) {\r\n e.preventDefault();\r\n $(this).parents('.navbar').removeClass('open');\r\n });\r\n\r\n // cerere Documente\r\n $(\"#cerereDocumente\").fileinput({\r\n 'language': 'ro',\r\n 'showUpload': 'false',\r\n 'showCaption': 'true',\r\n 'previewFileType': 'true',\r\n 'browseOnZoneClick': 'true',\r\n 'uploadUrl': 'uploads',\r\n 'showBrowse': 'true'\r\n });\r\n $(\"#facturaProforma\").fileinput({\r\n 'language': 'ro',\r\n 'showUpload': 'false',\r\n 'showCaption': 'true',\r\n 'previewFileType': 'true',\r\n 'browseOnZoneClick': 'true',\r\n 'uploadUrl': 'uploads',\r\n 'showBrowse': 'true'\r\n });\r\n $(\"#reclamatieDocumenteModal\").fileinput({\r\n 'language': 'ro',\r\n 'showUpload': 'false',\r\n 'showCaption': 'true',\r\n 'previewFileType': 'true',\r\n 'browseOnZoneClick': 'true',\r\n 'uploadUrl': 'uploads',\r\n 'showBrowse': 'true'\r\n });\r\n $(\"#cerereDocumenteModal\").fileinput({\r\n 'language': 'ro',\r\n 'showUpload': 'false',\r\n 'showCaption': 'true',\r\n 'previewFileType': 'true',\r\n 'browseOnZoneClick': 'true',\r\n 'uploadUrl': 'uploads',\r\n 'showBrowse': 'true'\r\n });\r\n\r\n // aplicatie leasing - date bun - fotografie alt bun\r\n $(\"#aplicatieLeasingFotografieAltBun\").fileinput({\r\n 'language': 'ro',\r\n 'showUpload': 'false',\r\n 'showCaption': 'true',\r\n 'previewFileType': 'true',\r\n 'browseOnZoneClick': 'true',\r\n 'uploadUrl': 'images',\r\n 'showBrowse': 'true',\r\n });\r\n\r\n // aplicatie leasing - date bun - fotografie echipament\r\n $(\"#aplicatieLeasingFotografieEchipament\").fileinput({\r\n 'language': 'ro',\r\n 'showUpload': 'false',\r\n 'showCaption': 'true',\r\n 'previewFileType': 'true',\r\n 'browseOnZoneClick': 'true',\r\n 'uploadUrl': 'images',\r\n 'showBrowse': 'true',\r\n });\r\n\r\n\r\n // aplicatie leasing - date bun - fotografie imobil\r\n $(\"#aplicatieLeasingFotografieImobil\").fileinput({\r\n 'language': 'ro',\r\n 'showUpload': 'false',\r\n 'showCaption': 'true',\r\n 'previewFileType': 'true',\r\n 'browseOnZoneClick': 'true',\r\n 'uploadUrl': 'images',\r\n 'showBrowse': 'true',\r\n });\r\n\r\n // aplicatie leasing persoana expusa politic - show hide position\r\n\r\n $(\".persoana-politica\").on('click', function () {\r\n var parent = $(this);\r\n\r\n if (parent.find('.radio-yes').is(':checked')) {\r\n $(parent.attr('data-target')).addClass('opened').find('input').attr('required', true);\r\n } else {\r\n $(parent.attr('data-target')).removeClass('opened').find('input').removeAttr('required');\r\n }\r\n\r\n });\r\n\r\n // aplicatie leasing beneficiar real - show hide name and cnp\r\n\r\n $(\".beneficiar-real\").on('click', function () {\r\n var parent = $(this);\r\n\r\n if (parent.find('.radio-yes').is(':checked')) {\r\n $(parent.attr('data-target')).removeClass('opened').find('input').removeAttr('required');\r\n } else {\r\n $(parent.attr('data-target')).addClass('opened').find('input').attr('required', true);\r\n }\r\n\r\n });\r\n\r\n //check before submit if persoana - expusa politic and beficiar - real, if it is store value, else remove\r\n $('input[type=\"submit\"]').on('click', function () {\r\n var parent_beneficiar = $(\".beneficiar-real\");\r\n if (parent_beneficiar.find('.radio-yes').is(':checked')) {\r\n $(\"#numeBeneficiarReal\").val(\"\");\r\n $(\"#cnpBeneficiarReal\").val(\"\");\r\n }\r\n\r\n var parent_persoana = $(\".persoana-politica\");\r\n if (!parent_persoana.find('.radio-yes').is(':checked')) {\r\n $(\"#functiePolitica\").val(\"\");\r\n }\r\n });\r\n\r\n // init charts\r\n $('.chart').circliful();\r\n\r\n // show / hide notifications list on mobile toggler click\r\n// $(\".show-hide-notfications\").on('click', function () {\r\n// $('.notifications-list').toggleClass('opened');\r\n// });\r\n\r\n\r\n // collapase/uncollaspe bunuri dropdown\r\n\r\n $(\".management-button\").on('click', function () {\r\n $(\".responsive-item\").not($(this).parents('.responsive-item')).removeClass('opened');\r\n $(this).parents('.responsive-item').toggleClass(\"opened\");\r\n if (wW < 768) {\r\n $(\"body\").toggleClass(\"locked\");\r\n }\r\n });\r\n\r\n\r\n\r\n function initFileUpload(page, counter) {\r\n var dataHTML = \"
\";\r\n\r\n $(\"#solicitareSchimbareDate .inserted-inputs\").append(dataHTML);\r\n\r\n $(\"#file-upload-\" + page + \"-\" + counter).fileinput({\r\n 'language': 'ro',\r\n 'showUpload': false,\r\n 'showCaption': true,\r\n 'previewFileType': 'false'\r\n });\r\n\r\n }\r\n\r\n // detalii bun automobil, clone service inputs\r\n\r\n\r\n function clone() {\r\n var parentEl = $(this).parents(\"form\").find(\".auto-service\");\r\n var clone = parentEl.find(\".clone-item:last-of-type\").clone();\r\n clone.appendTo(parentEl);\r\n clone.on('click', '.clone-add', clone);\r\n clone.on('click', '.clone-remove', remove);\r\n clone.find('input').val('');\r\n clone.find('select').val('notSelected');\r\n clone.find('.input-datepicker').removeAttr('id').removeClass('hasDatepicker').datepicker({ dateFormat: 'dd-mm-yy' });\r\n }\r\n\r\n function remove(element) {\r\n element.parents(\".service-list\").remove();\r\n }\r\n $(document).on(\"click\", \".clone-add\", clone);\r\n\r\n $(document).on(\"click\", \".clone-remove\", function(){\r\n if (!$(this).attr('id')) {\r\n remove($(this));\r\n }\r\n });\r\n\r\n // don't permit special characters in phone number\r\n $('#telefonFirma').on('change keyup', function() {\r\n var phone_nr = $('#telefonFirma').val();\r\n var sanitized = $(this).val().replace(/[^0-9]/g, '');\r\n if (phone_nr.charAt(0) == \"+\"){\r\n $(this).val(\"+\" + sanitized);\r\n } else {\r\n $(this).val(sanitized);\r\n }\r\n });\r\n\r\n // admin vizionare solicitare modals\r\n $('.admin-view-request .modal').on('hidden.bs.modal', function () {\r\n var currentButton = $(this).attr('id');\r\n if ($(this).find('textarea').val().trim().length > 1) {\r\n $('[data-target=\"#' + currentButton + '\"]').addClass('edited');\r\n } else {\r\n $('[data-target=\"#' + currentButton + '\"]').removeClass('edited');\r\n }\r\n });\r\n\r\n // init date picker\r\n\r\n $('.input-datepicker').datepicker({ dateFormat: 'dd-mm-yy' });\r\n \r\n $('.modal').on('scroll', function(){\r\n// hideDatepicker();\r\n });\r\n \r\n $(window).on('scroll', function(){\r\n// hideDatepicker();\r\n });\r\n\r\n $('.input-datepicker').focusout(function() {\r\n // hideDatepicker();\r\n });\r\n \r\n function hideDatepicker() {\r\n if ($(\"#ui-datepicker-div\").length != 0) {\r\n $(\".hasDatepicker\").datepicker('hide').blur(); \r\n }\r\n }\r\n \r\n $('.checkbox-wrapper.input-visible label').on('click', function(){\r\n if ($(this).find('input').is(':checked')) {\r\n $(this).addClass('checked');\r\n } else {\r\n $(this).removeClass('checked');\r\n }\r\n });\r\n\r\n $('.submit-once').on('submit', function(e) {\r\n $('button[type=\"submit\"]').attr('disabled', true);\r\n });\r\n\r\n});\r\n","(function ($) {\r\n 'use strict';\r\n\r\n //\r\n if (!String.prototype.includes) {\r\n (function () {\r\n 'use strict'; // needed to support `apply`/`call` with `undefined`/`null`\r\n var toString = {}.toString;\r\n var defineProperty = (function () {\r\n // IE 8 only supports `Object.defineProperty` on DOM elements\r\n try {\r\n var object = {};\r\n var $defineProperty = Object.defineProperty;\r\n var result = $defineProperty(object, object, object) && $defineProperty;\r\n } catch (error) {\r\n }\r\n return result;\r\n }());\r\n var indexOf = ''.indexOf;\r\n var includes = function (search) {\r\n if (this == null) {\r\n throw new TypeError();\r\n }\r\n var string = String(this);\r\n if (search && toString.call(search) == '[object RegExp]') {\r\n throw new TypeError();\r\n }\r\n var stringLength = string.length;\r\n var searchString = String(search);\r\n var searchLength = searchString.length;\r\n var position = arguments.length > 1 ? arguments[1] : undefined;\r\n // `ToInteger`\r\n var pos = position ? Number(position) : 0;\r\n if (pos != pos) { // better `isNaN`\r\n pos = 0;\r\n }\r\n var start = Math.min(Math.max(pos, 0), stringLength);\r\n // Avoid the `indexOf` call if no match is possible\r\n if (searchLength + start > stringLength) {\r\n return false;\r\n }\r\n return indexOf.call(string, searchString, pos) != -1;\r\n };\r\n if (defineProperty) {\r\n defineProperty(String.prototype, 'includes', {\r\n 'value': includes,\r\n 'configurable': true,\r\n 'writable': true\r\n });\r\n } else {\r\n String.prototype.includes = includes;\r\n }\r\n }());\r\n }\r\n\r\n if (!String.prototype.startsWith) {\r\n (function () {\r\n 'use strict'; // needed to support `apply`/`call` with `undefined`/`null`\r\n var defineProperty = (function () {\r\n // IE 8 only supports `Object.defineProperty` on DOM elements\r\n try {\r\n var object = {};\r\n var $defineProperty = Object.defineProperty;\r\n var result = $defineProperty(object, object, object) && $defineProperty;\r\n } catch (error) {\r\n }\r\n return result;\r\n }());\r\n var toString = {}.toString;\r\n var startsWith = function (search) {\r\n if (this == null) {\r\n throw new TypeError();\r\n }\r\n var string = String(this);\r\n if (search && toString.call(search) == '[object RegExp]') {\r\n throw new TypeError();\r\n }\r\n var stringLength = string.length;\r\n var searchString = String(search);\r\n var searchLength = searchString.length;\r\n var position = arguments.length > 1 ? arguments[1] : undefined;\r\n // `ToInteger`\r\n var pos = position ? Number(position) : 0;\r\n if (pos != pos) { // better `isNaN`\r\n pos = 0;\r\n }\r\n var start = Math.min(Math.max(pos, 0), stringLength);\r\n // Avoid the `indexOf` call if no match is possible\r\n if (searchLength + start > stringLength) {\r\n return false;\r\n }\r\n var index = -1;\r\n while (++index < searchLength) {\r\n if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n if (defineProperty) {\r\n defineProperty(String.prototype, 'startsWith', {\r\n 'value': startsWith,\r\n 'configurable': true,\r\n 'writable': true\r\n });\r\n } else {\r\n String.prototype.startsWith = startsWith;\r\n }\r\n }());\r\n }\r\n\r\n if (!Object.keys) {\r\n Object.keys = function (\r\n o, // object\r\n k, // key\r\n r // result array\r\n ){\r\n // initialize object and result\r\n r=[];\r\n // iterate over object keys\r\n for (k in o)\r\n // fill result array with non-prototypical keys\r\n r.hasOwnProperty.call(o, k) && r.push(k);\r\n // return result\r\n return r;\r\n };\r\n }\r\n\r\n // set data-selected on select element if the value has been programmatically selected\r\n // prior to initialization of bootstrap-select\r\n // * consider removing or replacing an alternative method *\r\n var valHooks = {\r\n useDefault: false,\r\n _set: $.valHooks.select.set\r\n };\r\n\r\n $.valHooks.select.set = function(elem, value) {\r\n if (value && !valHooks.useDefault) $(elem).data('selected', true);\r\n\r\n return valHooks._set.apply(this, arguments);\r\n };\r\n\r\n var changed_arguments = null;\r\n\r\n var EventIsSupported = (function() {\r\n try {\r\n new Event('change');\r\n return true;\r\n } catch (e) {\r\n return false;\r\n }\r\n })();\r\n\r\n $.fn.triggerNative = function (eventName) {\r\n var el = this[0],\r\n event;\r\n\r\n if (el.dispatchEvent) { // for modern browsers & IE9+\r\n if (EventIsSupported) {\r\n // For modern browsers\r\n event = new Event(eventName, {\r\n bubbles: true\r\n });\r\n } else {\r\n // For IE since it doesn't support Event constructor\r\n event = document.createEvent('Event');\r\n event.initEvent(eventName, true, false);\r\n }\r\n\r\n el.dispatchEvent(event);\r\n } else if (el.fireEvent) { // for IE8\r\n event = document.createEventObject();\r\n event.eventType = eventName;\r\n el.fireEvent('on' + eventName, event);\r\n } else {\r\n // fall back to jQuery.trigger\r\n this.trigger(eventName);\r\n }\r\n };\r\n //\r\n\r\n // Case insensitive contains search\r\n $.expr.pseudos.icontains = function (obj, index, meta) {\r\n var $obj = $(obj).find('a');\r\n var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase();\r\n return haystack.includes(meta[3].toUpperCase());\r\n };\r\n\r\n // Case insensitive begins search\r\n $.expr.pseudos.ibegins = function (obj, index, meta) {\r\n var $obj = $(obj).find('a');\r\n var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase();\r\n return haystack.startsWith(meta[3].toUpperCase());\r\n };\r\n\r\n // Case and accent insensitive contains search\r\n $.expr.pseudos.aicontains = function (obj, index, meta) {\r\n var $obj = $(obj).find('a');\r\n var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase();\r\n return haystack.includes(meta[3].toUpperCase());\r\n };\r\n\r\n // Case and accent insensitive begins search\r\n $.expr.pseudos.aibegins = function (obj, index, meta) {\r\n var $obj = $(obj).find('a');\r\n var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase();\r\n return haystack.startsWith(meta[3].toUpperCase());\r\n };\r\n\r\n /**\r\n * Remove all diatrics from the given text.\r\n * @access private\r\n * @param {String} text\r\n * @returns {String}\r\n */\r\n function normalizeToBase(text) {\r\n var rExps = [\r\n {re: /[\\xC0-\\xC6]/g, ch: \"A\"},\r\n {re: /[\\xE0-\\xE6]/g, ch: \"a\"},\r\n {re: /[\\xC8-\\xCB]/g, ch: \"E\"},\r\n {re: /[\\xE8-\\xEB]/g, ch: \"e\"},\r\n {re: /[\\xCC-\\xCF]/g, ch: \"I\"},\r\n {re: /[\\xEC-\\xEF]/g, ch: \"i\"},\r\n {re: /[\\xD2-\\xD6]/g, ch: \"O\"},\r\n {re: /[\\xF2-\\xF6]/g, ch: \"o\"},\r\n {re: /[\\xD9-\\xDC]/g, ch: \"U\"},\r\n {re: /[\\xF9-\\xFC]/g, ch: \"u\"},\r\n {re: /[\\xC7-\\xE7]/g, ch: \"c\"},\r\n {re: /[\\xD1]/g, ch: \"N\"},\r\n {re: /[\\xF1]/g, ch: \"n\"}\r\n ];\r\n $.each(rExps, function () {\r\n text = text ? text.replace(this.re, this.ch) : '';\r\n });\r\n return text;\r\n }\r\n\r\n\r\n // List of HTML entities for escaping.\r\n var escapeMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n \"'\": ''',\r\n '`': '`'\r\n };\r\n \r\n var unescapeMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '"': '\"',\r\n ''': \"'\",\r\n '`': '`'\r\n };\r\n\r\n // Functions for escaping and unescaping strings to/from HTML interpolation.\r\n var createEscaper = function(map) {\r\n var escaper = function(match) {\r\n return map[match];\r\n };\r\n // Regexes for identifying a key that needs to be escaped.\r\n var source = '(?:' + Object.keys(map).join('|') + ')';\r\n var testRegexp = RegExp(source);\r\n var replaceRegexp = RegExp(source, 'g');\r\n return function(string) {\r\n string = string == null ? '' : '' + string;\r\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\r\n };\r\n };\r\n\r\n var htmlEscape = createEscaper(escapeMap);\r\n var htmlUnescape = createEscaper(unescapeMap);\r\n\r\n var Selectpicker = function (element, options) {\r\n // bootstrap-select has been initialized - revert valHooks.select.set back to its original function\r\n if (!valHooks.useDefault) {\r\n $.valHooks.select.set = valHooks._set;\r\n valHooks.useDefault = true;\r\n }\r\n\r\n this.$element = $(element);\r\n this.$newElement = null;\r\n this.$button = null;\r\n this.$menu = null;\r\n this.$lis = null;\r\n this.options = options;\r\n\r\n // If we have no title yet, try to pull it from the html title attribute (jQuery doesnt' pick it up as it's not a\r\n // data-attribute)\r\n if (this.options.title === null) {\r\n this.options.title = this.$element.attr('title');\r\n }\r\n\r\n // Format window padding\r\n var winPad = this.options.windowPadding;\r\n if (typeof winPad === 'number') {\r\n this.options.windowPadding = [winPad, winPad, winPad, winPad];\r\n }\r\n\r\n //Expose public methods\r\n this.val = Selectpicker.prototype.val;\r\n this.render = Selectpicker.prototype.render;\r\n this.refresh = Selectpicker.prototype.refresh;\r\n this.setStyle = Selectpicker.prototype.setStyle;\r\n this.selectAll = Selectpicker.prototype.selectAll;\r\n this.deselectAll = Selectpicker.prototype.deselectAll;\r\n this.destroy = Selectpicker.prototype.destroy;\r\n this.remove = Selectpicker.prototype.remove;\r\n this.show = Selectpicker.prototype.show;\r\n this.hide = Selectpicker.prototype.hide;\r\n\r\n this.init();\r\n };\r\n\r\n Selectpicker.VERSION = '1.12.4';\r\n\r\n // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both.\r\n Selectpicker.DEFAULTS = {\r\n noneSelectedText: 'Nothing selected',\r\n noneResultsText: 'No results matched {0}',\r\n countSelectedText: function (numSelected, numTotal) {\r\n return (numSelected == 1) ? \"{0} item selected\" : \"{0} items selected\";\r\n },\r\n maxOptionsText: function (numAll, numGroup) {\r\n return [\r\n (numAll == 1) ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)',\r\n (numGroup == 1) ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)'\r\n ];\r\n },\r\n selectAllText: 'Select All',\r\n deselectAllText: 'Deselect All',\r\n doneButton: false,\r\n doneButtonText: 'Close',\r\n multipleSeparator: ', ',\r\n styleBase: 'btn',\r\n style: 'btn-default',\r\n size: 'auto',\r\n title: null,\r\n selectedTextFormat: 'values',\r\n width: false,\r\n container: false,\r\n hideDisabled: false,\r\n showSubtext: false,\r\n showIcon: true,\r\n showContent: true,\r\n dropupAuto: true,\r\n header: false,\r\n liveSearch: false,\r\n liveSearchPlaceholder: null,\r\n liveSearchNormalize: false,\r\n liveSearchStyle: 'contains',\r\n actionsBox: false,\r\n iconBase: 'glyphicon',\r\n tickIcon: 'glyphicon-ok',\r\n showTick: false,\r\n template: {\r\n caret: ''\r\n },\r\n maxOptions: false,\r\n mobile: false,\r\n selectOnTab: false,\r\n dropdownAlignRight: false,\r\n windowPadding: 0\r\n };\r\n\r\n Selectpicker.prototype = {\r\n\r\n constructor: Selectpicker,\r\n\r\n init: function () {\r\n var that = this,\r\n id = this.$element.attr('id');\r\n\r\n this.$element.addClass('bs-select-hidden');\r\n\r\n // store originalIndex (key) and newIndex (value) in this.liObj for fast accessibility\r\n // allows us to do this.$lis.eq(that.liObj[index]) instead of this.$lis.filter('[data-original-index=\"' + index + '\"]')\r\n this.liObj = {};\r\n this.multiple = this.$element.prop('multiple');\r\n this.autofocus = this.$element.prop('autofocus');\r\n this.$newElement = this.createView();\r\n this.$element\r\n .after(this.$newElement)\r\n .appendTo(this.$newElement);\r\n this.$button = this.$newElement.children('button');\r\n this.$menu = this.$newElement.children('.dropdown-menu');\r\n this.$menuInner = this.$menu.children('.inner');\r\n this.$searchbox = this.$menu.find('input');\r\n\r\n this.$element.removeClass('bs-select-hidden');\r\n\r\n if (this.options.dropdownAlignRight === true) this.$menu.addClass('dropdown-menu-right');\r\n\r\n if (typeof id !== 'undefined') {\r\n this.$button.attr('data-id', id);\r\n $('label[for=\"' + id + '\"]').click(function (e) {\r\n e.preventDefault();\r\n that.$button.focus();\r\n });\r\n }\r\n\r\n this.checkDisabled();\r\n this.clickListener();\r\n if (this.options.liveSearch) this.liveSearchListener();\r\n this.render();\r\n this.setStyle();\r\n this.setWidth();\r\n if (this.options.container) this.selectPosition();\r\n this.$menu.data('this', this);\r\n this.$newElement.data('this', this);\r\n if (this.options.mobile) this.mobile();\r\n\r\n this.$newElement.on({\r\n 'hide.bs.dropdown': function (e) {\r\n that.$menuInner.attr('aria-expanded', false);\r\n that.$element.trigger('hide.bs.select', e);\r\n },\r\n 'hidden.bs.dropdown': function (e) {\r\n that.$element.trigger('hidden.bs.select', e);\r\n },\r\n 'show.bs.dropdown': function (e) {\r\n that.$menuInner.attr('aria-expanded', true);\r\n that.$element.trigger('show.bs.select', e);\r\n },\r\n 'shown.bs.dropdown': function (e) {\r\n that.$element.trigger('shown.bs.select', e);\r\n }\r\n });\r\n\r\n if (that.$element[0].hasAttribute('required')) {\r\n this.$element.on('invalid', function () {\r\n that.$button.addClass('bs-invalid');\r\n\r\n that.$element.on({\r\n 'focus.bs.select': function () {\r\n that.$button.focus();\r\n that.$element.off('focus.bs.select');\r\n },\r\n 'shown.bs.select': function () {\r\n that.$element\r\n .val(that.$element.val()) // set the value to hide the validation message in Chrome when menu is opened\r\n .off('shown.bs.select');\r\n },\r\n 'rendered.bs.select': function () {\r\n // if select is no longer invalid, remove the bs-invalid class\r\n if (this.validity.valid) that.$button.removeClass('bs-invalid');\r\n that.$element.off('rendered.bs.select');\r\n }\r\n });\r\n\r\n that.$button.on('blur.bs.select', function() {\r\n that.$element.focus().blur();\r\n that.$button.off('blur.bs.select');\r\n });\r\n });\r\n }\r\n\r\n setTimeout(function () {\r\n that.$element.trigger('loaded.bs.select');\r\n });\r\n },\r\n\r\n createDropdown: function () {\r\n // Options\r\n // If we are multiple or showTick option is set, then add the show-tick class\r\n var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '',\r\n inputGroup = this.$element.parent().hasClass('input-group') ? ' input-group-btn' : '',\r\n autofocus = this.autofocus ? ' autofocus' : '';\r\n // Elements\r\n var header = this.options.header ? '
' + this.options.header + '
' : '';\r\n var searchbox = this.options.liveSearch ?\r\n '
' +\r\n '' +\r\n '
'\r\n : '';\r\n var actionsbox = this.multiple && this.options.actionsBox ?\r\n '
' +\r\n '
' +\r\n '' +\r\n '' +\r\n '
' +\r\n '
'\r\n : '';\r\n var donebutton = this.multiple && this.options.doneButton ?\r\n '
' +\r\n '
' +\r\n '' +\r\n '
' +\r\n '
'\r\n : '';\r\n var drop =\r\n '
' +\r\n '' +\r\n '
' +\r\n header +\r\n searchbox +\r\n actionsbox +\r\n '
    ' +\r\n '
' +\r\n donebutton +\r\n '
' +\r\n '
';\r\n\r\n return $(drop);\r\n },\r\n\r\n createView: function () {\r\n var $drop = this.createDropdown(),\r\n li = this.createLi();\r\n\r\n $drop.find('ul')[0].innerHTML = li;\r\n return $drop;\r\n },\r\n\r\n reloadLi: function () {\r\n // rebuild\r\n var li = this.createLi();\r\n this.$menuInner[0].innerHTML = li;\r\n },\r\n\r\n createLi: function () {\r\n var that = this,\r\n _li = [],\r\n optID = 0,\r\n titleOption = document.createElement('option'),\r\n liIndex = -1; // increment liIndex whenever a new
  • element is created to ensure liObj is correct\r\n\r\n // Helper functions\r\n /**\r\n * @param content\r\n * @param [index]\r\n * @param [classes]\r\n * @param [optgroup]\r\n * @returns {string}\r\n */\r\n var generateLI = function (content, index, classes, optgroup) {\r\n return '' + content + '
  • ';\r\n };\r\n\r\n /**\r\n * @param text\r\n * @param [classes]\r\n * @param [inline]\r\n * @param [tokens]\r\n * @returns {string}\r\n */\r\n var generateA = function (text, classes, inline, tokens) {\r\n return '' + text +\r\n '' +\r\n '';\r\n };\r\n\r\n if (this.options.title && !this.multiple) {\r\n // this option doesn't create a new
  • element, but does add a new option, so liIndex is decreased\r\n // since liObj is recalculated on every refresh, liIndex needs to be decreased even if the titleOption is already appended\r\n liIndex--;\r\n\r\n if (!this.$element.find('.bs-title-option').length) {\r\n // Use native JS to prepend option (faster)\r\n var element = this.$element[0];\r\n titleOption.className = 'bs-title-option';\r\n titleOption.innerHTML = this.options.title;\r\n titleOption.value = '';\r\n element.insertBefore(titleOption, element.firstChild);\r\n // Check if selected or data-selected attribute is already set on an option. If not, select the titleOption option.\r\n // the selected item may have been changed by user or programmatically before the bootstrap select plugin runs,\r\n // if so, the select will have the data-selected attribute\r\n var $opt = $(element.options[element.selectedIndex]);\r\n if ($opt.attr('selected') === undefined && this.$element.data('selected') === undefined) {\r\n titleOption.selected = true;\r\n }\r\n }\r\n }\r\n\r\n var $selectOptions = this.$element.find('option');\r\n\r\n $selectOptions.each(function (index) {\r\n var $this = $(this);\r\n\r\n liIndex++;\r\n\r\n if ($this.hasClass('bs-title-option')) return;\r\n\r\n // Get the class and text for the option\r\n var optionClass = this.className || '',\r\n inline = htmlEscape(this.style.cssText),\r\n text = $this.data('content') ? $this.data('content') : $this.html(),\r\n tokens = $this.data('tokens') ? $this.data('tokens') : null,\r\n subtext = typeof $this.data('subtext') !== 'undefined' ? '' + $this.data('subtext') + '' : '',\r\n icon = typeof $this.data('icon') !== 'undefined' ? ' ' : '',\r\n $parent = $this.parent(),\r\n isOptgroup = $parent[0].tagName === 'OPTGROUP',\r\n isOptgroupDisabled = isOptgroup && $parent[0].disabled,\r\n isDisabled = this.disabled || isOptgroupDisabled,\r\n prevHiddenIndex;\r\n\r\n if (icon !== '' && isDisabled) {\r\n icon = '' + icon + '';\r\n }\r\n\r\n if (that.options.hideDisabled && (isDisabled && !isOptgroup || isOptgroupDisabled)) {\r\n // set prevHiddenIndex - the index of the first hidden option in a group of hidden options\r\n // used to determine whether or not a divider should be placed after an optgroup if there are\r\n // hidden options between the optgroup and the first visible option\r\n prevHiddenIndex = $this.data('prevHiddenIndex');\r\n $this.next().data('prevHiddenIndex', (prevHiddenIndex !== undefined ? prevHiddenIndex : index));\r\n\r\n liIndex--;\r\n return;\r\n }\r\n\r\n if (!$this.data('content')) {\r\n // Prepend any icon and append any subtext to the main text.\r\n text = icon + '' + text + subtext + '';\r\n }\r\n\r\n if (isOptgroup && $this.data('divider') !== true) {\r\n if (that.options.hideDisabled && isDisabled) {\r\n if ($parent.data('allOptionsDisabled') === undefined) {\r\n var $options = $parent.children();\r\n $parent.data('allOptionsDisabled', $options.filter(':disabled').length === $options.length);\r\n }\r\n\r\n if ($parent.data('allOptionsDisabled')) {\r\n liIndex--;\r\n return;\r\n }\r\n }\r\n\r\n var optGroupClass = ' ' + $parent[0].className || '';\r\n\r\n if ($this.index() === 0) { // Is it the first option of the optgroup?\r\n optID += 1;\r\n\r\n // Get the opt group label\r\n var label = $parent[0].label,\r\n labelSubtext = typeof $parent.data('subtext') !== 'undefined' ? '' + $parent.data('subtext') + '' : '',\r\n labelIcon = $parent.data('icon') ? ' ' : '';\r\n\r\n label = labelIcon + '' + htmlEscape(label) + labelSubtext + '';\r\n\r\n if (index !== 0 && _li.length > 0) { // Is it NOT the first option of the select && are there elements in the dropdown?\r\n liIndex++;\r\n _li.push(generateLI('', null, 'divider', optID + 'div'));\r\n }\r\n liIndex++;\r\n _li.push(generateLI(label, null, 'dropdown-header' + optGroupClass, optID));\r\n }\r\n\r\n if (that.options.hideDisabled && isDisabled) {\r\n liIndex--;\r\n return;\r\n }\r\n\r\n _li.push(generateLI(generateA(text, 'opt ' + optionClass + optGroupClass, inline, tokens), index, '', optID));\r\n } else if ($this.data('divider') === true) {\r\n _li.push(generateLI('', index, 'divider'));\r\n } else if ($this.data('hidden') === true) {\r\n // set prevHiddenIndex - the index of the first hidden option in a group of hidden options\r\n // used to determine whether or not a divider should be placed after an optgroup if there are\r\n // hidden options between the optgroup and the first visible option\r\n prevHiddenIndex = $this.data('prevHiddenIndex');\r\n $this.next().data('prevHiddenIndex', (prevHiddenIndex !== undefined ? prevHiddenIndex : index));\r\n\r\n _li.push(generateLI(generateA(text, optionClass, inline, tokens), index, 'hidden is-hidden'));\r\n } else {\r\n var showDivider = this.previousElementSibling && this.previousElementSibling.tagName === 'OPTGROUP';\r\n\r\n // if previous element is not an optgroup and hideDisabled is true\r\n if (!showDivider && that.options.hideDisabled) {\r\n prevHiddenIndex = $this.data('prevHiddenIndex');\r\n\r\n if (prevHiddenIndex !== undefined) {\r\n // select the element **before** the first hidden element in the group\r\n var prevHidden = $selectOptions.eq(prevHiddenIndex)[0].previousElementSibling;\r\n \r\n if (prevHidden && prevHidden.tagName === 'OPTGROUP' && !prevHidden.disabled) {\r\n showDivider = true;\r\n }\r\n }\r\n }\r\n\r\n if (showDivider) {\r\n liIndex++;\r\n _li.push(generateLI('', null, 'divider', optID + 'div'));\r\n }\r\n _li.push(generateLI(generateA(text, optionClass, inline, tokens), index));\r\n }\r\n\r\n that.liObj[index] = liIndex;\r\n });\r\n\r\n //If we are not multiple, we don't have a selected item, and we don't have a title, select the first element so something is set in the button\r\n if (!this.multiple && this.$element.find('option:selected').length === 0 && !this.options.title) {\r\n this.$element.find('option').eq(0).prop('selected', true).attr('selected', 'selected');\r\n }\r\n\r\n return _li.join('');\r\n },\r\n\r\n findLis: function () {\r\n if (this.$lis == null) this.$lis = this.$menu.find('li');\r\n return this.$lis;\r\n },\r\n\r\n /**\r\n * @param [updateLi] defaults to true\r\n */\r\n render: function (updateLi) {\r\n var that = this,\r\n notDisabled,\r\n $selectOptions = this.$element.find('option');\r\n\r\n //Update the LI to match the SELECT\r\n if (updateLi !== false) {\r\n $selectOptions.each(function (index) {\r\n var $lis = that.findLis().eq(that.liObj[index]);\r\n\r\n that.setDisabled(index, this.disabled || this.parentNode.tagName === 'OPTGROUP' && this.parentNode.disabled, $lis);\r\n that.setSelected(index, this.selected, $lis);\r\n });\r\n }\r\n\r\n this.togglePlaceholder();\r\n\r\n this.tabIndex();\r\n\r\n var selectedItems = $selectOptions.map(function () {\r\n if (this.selected) {\r\n if (that.options.hideDisabled && (this.disabled || this.parentNode.tagName === 'OPTGROUP' && this.parentNode.disabled)) return;\r\n\r\n var $this = $(this),\r\n icon = $this.data('icon') && that.options.showIcon ? ' ' : '',\r\n subtext;\r\n\r\n if (that.options.showSubtext && $this.data('subtext') && !that.multiple) {\r\n subtext = ' ' + $this.data('subtext') + '';\r\n } else {\r\n subtext = '';\r\n }\r\n if (typeof $this.attr('title') !== 'undefined') {\r\n return $this.attr('title');\r\n } else if ($this.data('content') && that.options.showContent) {\r\n return $this.data('content').toString();\r\n } else {\r\n return icon + $this.html() + subtext;\r\n }\r\n }\r\n }).toArray();\r\n\r\n //Fixes issue in IE10 occurring when no default option is selected and at least one option is disabled\r\n //Convert all the values into a comma delimited string\r\n var title = !this.multiple ? selectedItems[0] : selectedItems.join(this.options.multipleSeparator);\r\n\r\n //If this is multi select, and the selectText type is count, the show 1 of 2 selected etc..\r\n if (this.multiple && this.options.selectedTextFormat.indexOf('count') > -1) {\r\n var max = this.options.selectedTextFormat.split('>');\r\n if ((max.length > 1 && selectedItems.length > max[1]) || (max.length == 1 && selectedItems.length >= 2)) {\r\n notDisabled = this.options.hideDisabled ? ', [disabled]' : '';\r\n var totalCount = $selectOptions.not('[data-divider=\"true\"], [data-hidden=\"true\"]' + notDisabled).length,\r\n tr8nText = (typeof this.options.countSelectedText === 'function') ? this.options.countSelectedText(selectedItems.length, totalCount) : this.options.countSelectedText;\r\n title = tr8nText.replace('{0}', selectedItems.length.toString()).replace('{1}', totalCount.toString());\r\n }\r\n }\r\n\r\n if (this.options.title == undefined) {\r\n this.options.title = this.$element.attr('title');\r\n }\r\n\r\n if (this.options.selectedTextFormat == 'static') {\r\n title = this.options.title;\r\n }\r\n\r\n //If we dont have a title, then use the default, or if nothing is set at all, use the not selected text\r\n if (!title) {\r\n title = typeof this.options.title !== 'undefined' ? this.options.title : this.options.noneSelectedText;\r\n }\r\n\r\n //strip all HTML tags and trim the result, then unescape any escaped tags\r\n this.$button.attr('title', htmlUnescape($.trim(title.replace(/<[^>]*>?/g, ''))));\r\n this.$button.children('.filter-option').html(title);\r\n\r\n this.$element.trigger('rendered.bs.select');\r\n },\r\n\r\n /**\r\n * @param [style]\r\n * @param [status]\r\n */\r\n setStyle: function (style, status) {\r\n if (this.$element.attr('class')) {\r\n this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\\[.*\\]/gi, ''));\r\n }\r\n\r\n var buttonClass = style ? style : this.options.style;\r\n\r\n if (status == 'add') {\r\n this.$button.addClass(buttonClass);\r\n } else if (status == 'remove') {\r\n this.$button.removeClass(buttonClass);\r\n } else {\r\n this.$button.removeClass(this.options.style);\r\n this.$button.addClass(buttonClass);\r\n }\r\n },\r\n\r\n liHeight: function (refresh) {\r\n if (!refresh && (this.options.size === false || this.sizeInfo)) return;\r\n\r\n var newElement = document.createElement('div'),\r\n menu = document.createElement('div'),\r\n menuInner = document.createElement('ul'),\r\n divider = document.createElement('li'),\r\n li = document.createElement('li'),\r\n a = document.createElement('a'),\r\n text = document.createElement('span'),\r\n header = this.options.header && this.$menu.find('.popover-title').length > 0 ? this.$menu.find('.popover-title')[0].cloneNode(true) : null,\r\n search = this.options.liveSearch ? document.createElement('div') : null,\r\n actions = this.options.actionsBox && this.multiple && this.$menu.find('.bs-actionsbox').length > 0 ? this.$menu.find('.bs-actionsbox')[0].cloneNode(true) : null,\r\n doneButton = this.options.doneButton && this.multiple && this.$menu.find('.bs-donebutton').length > 0 ? this.$menu.find('.bs-donebutton')[0].cloneNode(true) : null;\r\n\r\n text.className = 'text';\r\n newElement.className = this.$menu[0].parentNode.className + ' open';\r\n menu.className = 'dropdown-menu open';\r\n menuInner.className = 'dropdown-menu inner';\r\n divider.className = 'divider';\r\n\r\n text.appendChild(document.createTextNode('Inner text'));\r\n a.appendChild(text);\r\n li.appendChild(a);\r\n menuInner.appendChild(li);\r\n menuInner.appendChild(divider);\r\n if (header) menu.appendChild(header);\r\n if (search) {\r\n var input = document.createElement('input');\r\n search.className = 'bs-searchbox';\r\n input.className = 'form-control';\r\n search.appendChild(input);\r\n menu.appendChild(search);\r\n }\r\n if (actions) menu.appendChild(actions);\r\n menu.appendChild(menuInner);\r\n if (doneButton) menu.appendChild(doneButton);\r\n newElement.appendChild(menu);\r\n\r\n document.body.appendChild(newElement);\r\n\r\n var liHeight = a.offsetHeight,\r\n headerHeight = header ? header.offsetHeight : 0,\r\n searchHeight = search ? search.offsetHeight : 0,\r\n actionsHeight = actions ? actions.offsetHeight : 0,\r\n doneButtonHeight = doneButton ? doneButton.offsetHeight : 0,\r\n dividerHeight = $(divider).outerHeight(true),\r\n // fall back to jQuery if getComputedStyle is not supported\r\n menuStyle = typeof getComputedStyle === 'function' ? getComputedStyle(menu) : false,\r\n $menu = menuStyle ? null : $(menu),\r\n menuPadding = {\r\n vert: parseInt(menuStyle ? menuStyle.paddingTop : $menu.css('paddingTop')) +\r\n parseInt(menuStyle ? menuStyle.paddingBottom : $menu.css('paddingBottom')) +\r\n parseInt(menuStyle ? menuStyle.borderTopWidth : $menu.css('borderTopWidth')) +\r\n parseInt(menuStyle ? menuStyle.borderBottomWidth : $menu.css('borderBottomWidth')),\r\n horiz: parseInt(menuStyle ? menuStyle.paddingLeft : $menu.css('paddingLeft')) +\r\n parseInt(menuStyle ? menuStyle.paddingRight : $menu.css('paddingRight')) +\r\n parseInt(menuStyle ? menuStyle.borderLeftWidth : $menu.css('borderLeftWidth')) +\r\n parseInt(menuStyle ? menuStyle.borderRightWidth : $menu.css('borderRightWidth'))\r\n },\r\n menuExtras = {\r\n vert: menuPadding.vert +\r\n parseInt(menuStyle ? menuStyle.marginTop : $menu.css('marginTop')) +\r\n parseInt(menuStyle ? menuStyle.marginBottom : $menu.css('marginBottom')) + 2,\r\n horiz: menuPadding.horiz +\r\n parseInt(menuStyle ? menuStyle.marginLeft : $menu.css('marginLeft')) +\r\n parseInt(menuStyle ? menuStyle.marginRight : $menu.css('marginRight')) + 2\r\n }\r\n\r\n document.body.removeChild(newElement);\r\n\r\n this.sizeInfo = {\r\n liHeight: liHeight,\r\n headerHeight: headerHeight,\r\n searchHeight: searchHeight,\r\n actionsHeight: actionsHeight,\r\n doneButtonHeight: doneButtonHeight,\r\n dividerHeight: dividerHeight,\r\n menuPadding: menuPadding,\r\n menuExtras: menuExtras\r\n };\r\n },\r\n\r\n setSize: function () {\r\n this.findLis();\r\n this.liHeight();\r\n\r\n if (this.options.header) this.$menu.css('padding-top', 0);\r\n if (this.options.size === false) return;\r\n\r\n var that = this,\r\n $menu = this.$menu,\r\n $menuInner = this.$menuInner,\r\n $window = $(window),\r\n selectHeight = this.$newElement[0].offsetHeight,\r\n selectWidth = this.$newElement[0].offsetWidth,\r\n liHeight = this.sizeInfo['liHeight'],\r\n headerHeight = this.sizeInfo['headerHeight'],\r\n searchHeight = this.sizeInfo['searchHeight'],\r\n actionsHeight = this.sizeInfo['actionsHeight'],\r\n doneButtonHeight = this.sizeInfo['doneButtonHeight'],\r\n divHeight = this.sizeInfo['dividerHeight'],\r\n menuPadding = this.sizeInfo['menuPadding'],\r\n menuExtras = this.sizeInfo['menuExtras'],\r\n notDisabled = this.options.hideDisabled ? '.disabled' : '',\r\n menuHeight,\r\n menuWidth,\r\n getHeight,\r\n getWidth,\r\n selectOffsetTop,\r\n selectOffsetBot,\r\n selectOffsetLeft,\r\n selectOffsetRight,\r\n getPos = function() {\r\n var pos = that.$newElement.offset(),\r\n $container = $(that.options.container),\r\n containerPos;\r\n\r\n if (that.options.container && !$container.is('body')) {\r\n containerPos = $container.offset();\r\n containerPos.top += parseInt($container.css('borderTopWidth'));\r\n containerPos.left += parseInt($container.css('borderLeftWidth'));\r\n } else {\r\n containerPos = { top: 0, left: 0 };\r\n }\r\n\r\n var winPad = that.options.windowPadding;\r\n selectOffsetTop = pos.top - containerPos.top - $window.scrollTop();\r\n selectOffsetBot = $window.height() - selectOffsetTop - selectHeight - containerPos.top - winPad[2];\r\n selectOffsetLeft = pos.left - containerPos.left - $window.scrollLeft();\r\n selectOffsetRight = $window.width() - selectOffsetLeft - selectWidth - containerPos.left - winPad[1];\r\n selectOffsetTop -= winPad[0];\r\n selectOffsetLeft -= winPad[3];\r\n };\r\n\r\n getPos();\r\n\r\n if (this.options.size === 'auto') {\r\n var getSize = function () {\r\n var minHeight,\r\n hasClass = function (className, include) {\r\n return function (element) {\r\n if (include) {\r\n return (element.classList ? element.classList.contains(className) : $(element).hasClass(className));\r\n } else {\r\n return !(element.classList ? element.classList.contains(className) : $(element).hasClass(className));\r\n }\r\n };\r\n },\r\n lis = that.$menuInner[0].getElementsByTagName('li'),\r\n lisVisible = Array.prototype.filter ? Array.prototype.filter.call(lis, hasClass('hidden', false)) : that.$lis.not('.hidden'),\r\n optGroup = Array.prototype.filter ? Array.prototype.filter.call(lisVisible, hasClass('dropdown-header', true)) : lisVisible.filter('.dropdown-header');\r\n\r\n getPos();\r\n menuHeight = selectOffsetBot - menuExtras.vert;\r\n menuWidth = selectOffsetRight - menuExtras.horiz;\r\n\r\n if (that.options.container) {\r\n if (!$menu.data('height')) $menu.data('height', $menu.height());\r\n getHeight = $menu.data('height');\r\n\r\n if (!$menu.data('width')) $menu.data('width', $menu.width());\r\n getWidth = $menu.data('width');\r\n } else {\r\n getHeight = $menu.height();\r\n getWidth = $menu.width();\r\n }\r\n\r\n if (that.options.dropupAuto) {\r\n that.$newElement.toggleClass('dropup', selectOffsetTop > selectOffsetBot && (menuHeight - menuExtras.vert) < getHeight);\r\n }\r\n\r\n if (that.$newElement.hasClass('dropup')) {\r\n menuHeight = selectOffsetTop - menuExtras.vert;\r\n }\r\n\r\n if (that.options.dropdownAlignRight === 'auto') {\r\n $menu.toggleClass('dropdown-menu-right', selectOffsetLeft > selectOffsetRight && (menuWidth - menuExtras.horiz) < (getWidth - selectWidth));\r\n }\r\n\r\n if ((lisVisible.length + optGroup.length) > 3) {\r\n minHeight = liHeight * 3 + menuExtras.vert - 2;\r\n } else {\r\n minHeight = 0;\r\n }\r\n\r\n $menu.css({\r\n 'max-height': menuHeight + 'px',\r\n 'overflow': 'hidden',\r\n 'min-height': minHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight + 'px'\r\n });\r\n $menuInner.css({\r\n 'max-height': menuHeight - headerHeight - searchHeight - actionsHeight - doneButtonHeight - menuPadding.vert + 'px',\r\n 'overflow-y': 'auto',\r\n 'min-height': Math.max(minHeight - menuPadding.vert, 0) + 'px'\r\n });\r\n };\r\n getSize();\r\n this.$searchbox.off('input.getSize propertychange.getSize').on('input.getSize propertychange.getSize', getSize);\r\n $window.off('resize.getSize scroll.getSize').on('resize.getSize scroll.getSize', getSize);\r\n } else if (this.options.size && this.options.size != 'auto' && this.$lis.not(notDisabled).length > this.options.size) {\r\n var optIndex = this.$lis.not('.divider').not(notDisabled).children().slice(0, this.options.size).last().parent().index(),\r\n divLength = this.$lis.slice(0, optIndex + 1).filter('.divider').length;\r\n menuHeight = liHeight * this.options.size + divLength * divHeight + menuPadding.vert;\r\n\r\n if (that.options.container) {\r\n if (!$menu.data('height')) $menu.data('height', $menu.height());\r\n getHeight = $menu.data('height');\r\n } else {\r\n getHeight = $menu.height();\r\n }\r\n\r\n if (that.options.dropupAuto) {\r\n //noinspection JSUnusedAssignment\r\n this.$newElement.toggleClass('dropup', selectOffsetTop > selectOffsetBot && (menuHeight - menuExtras.vert) < getHeight);\r\n }\r\n $menu.css({\r\n 'max-height': menuHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight + 'px',\r\n 'overflow': 'hidden',\r\n 'min-height': ''\r\n });\r\n $menuInner.css({\r\n 'max-height': menuHeight - menuPadding.vert + 'px',\r\n 'overflow-y': 'auto',\r\n 'min-height': ''\r\n });\r\n }\r\n },\r\n\r\n setWidth: function () {\r\n if (this.options.width === 'auto') {\r\n this.$menu.css('min-width', '0');\r\n\r\n // Get correct width if element is hidden\r\n var $selectClone = this.$menu.parent().clone().appendTo('body'),\r\n $selectClone2 = this.options.container ? this.$newElement.clone().appendTo('body') : $selectClone,\r\n ulWidth = $selectClone.children('.dropdown-menu').outerWidth(),\r\n btnWidth = $selectClone2.css('width', 'auto').children('button').outerWidth();\r\n\r\n $selectClone.remove();\r\n $selectClone2.remove();\r\n\r\n // Set width to whatever's larger, button title or longest option\r\n this.$newElement.css('width', Math.max(ulWidth, btnWidth) + 'px');\r\n } else if (this.options.width === 'fit') {\r\n // Remove inline min-width so width can be changed from 'auto'\r\n this.$menu.css('min-width', '');\r\n this.$newElement.css('width', '').addClass('fit-width');\r\n } else if (this.options.width) {\r\n // Remove inline min-width so width can be changed from 'auto'\r\n this.$menu.css('min-width', '');\r\n this.$newElement.css('width', this.options.width);\r\n } else {\r\n // Remove inline min-width/width so width can be changed\r\n this.$menu.css('min-width', '');\r\n this.$newElement.css('width', '');\r\n }\r\n // Remove fit-width class if width is changed programmatically\r\n if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') {\r\n this.$newElement.removeClass('fit-width');\r\n }\r\n },\r\n\r\n selectPosition: function () {\r\n this.$bsContainer = $('
    ');\r\n\r\n var that = this,\r\n $container = $(this.options.container),\r\n pos,\r\n containerPos,\r\n actualHeight,\r\n getPlacement = function ($element) {\r\n that.$bsContainer.addClass($element.attr('class').replace(/form-control|fit-width/gi, '')).toggleClass('dropup', $element.hasClass('dropup'));\r\n pos = $element.offset();\r\n\r\n if (!$container.is('body')) {\r\n containerPos = $container.offset();\r\n containerPos.top += parseInt($container.css('borderTopWidth')) - $container.scrollTop();\r\n containerPos.left += parseInt($container.css('borderLeftWidth')) - $container.scrollLeft();\r\n } else {\r\n containerPos = { top: 0, left: 0 };\r\n }\r\n\r\n actualHeight = $element.hasClass('dropup') ? 0 : $element[0].offsetHeight;\r\n\r\n that.$bsContainer.css({\r\n 'top': pos.top - containerPos.top + actualHeight,\r\n 'left': pos.left - containerPos.left,\r\n 'width': $element[0].offsetWidth\r\n });\r\n };\r\n\r\n this.$button.on('click', function () {\r\n var $this = $(this);\r\n\r\n if (that.isDisabled()) {\r\n return;\r\n }\r\n\r\n getPlacement(that.$newElement);\r\n\r\n that.$bsContainer\r\n .appendTo(that.options.container)\r\n .toggleClass('open', !$this.hasClass('open'))\r\n .append(that.$menu);\r\n });\r\n\r\n $(window).on('resize scroll', function () {\r\n getPlacement(that.$newElement);\r\n });\r\n\r\n this.$element.on('hide.bs.select', function () {\r\n that.$menu.data('height', that.$menu.height());\r\n that.$bsContainer.detach();\r\n });\r\n },\r\n\r\n /**\r\n * @param {number} index - the index of the option that is being changed\r\n * @param {boolean} selected - true if the option is being selected, false if being deselected\r\n * @param {JQuery} $lis - the 'li' element that is being modified\r\n */\r\n setSelected: function (index, selected, $lis) {\r\n if (!$lis) {\r\n this.togglePlaceholder(); // check if setSelected is being called by changing the value of the select\r\n $lis = this.findLis().eq(this.liObj[index]);\r\n }\r\n\r\n $lis.toggleClass('selected', selected).find('a').attr('aria-selected', selected);\r\n },\r\n\r\n /**\r\n * @param {number} index - the index of the option that is being disabled\r\n * @param {boolean} disabled - true if the option is being disabled, false if being enabled\r\n * @param {JQuery} $lis - the 'li' element that is being modified\r\n */\r\n setDisabled: function (index, disabled, $lis) {\r\n if (!$lis) {\r\n $lis = this.findLis().eq(this.liObj[index]);\r\n }\r\n\r\n if (disabled) {\r\n $lis.addClass('disabled').children('a').attr('href', '#').attr('tabindex', -1).attr('aria-disabled', true);\r\n } else {\r\n $lis.removeClass('disabled').children('a').removeAttr('href').attr('tabindex', 0).attr('aria-disabled', false);\r\n }\r\n },\r\n\r\n isDisabled: function () {\r\n return this.$element[0].disabled;\r\n },\r\n\r\n checkDisabled: function () {\r\n var that = this;\r\n\r\n if (this.isDisabled()) {\r\n this.$newElement.addClass('disabled');\r\n this.$button.addClass('disabled').attr('tabindex', -1).attr('aria-disabled', true);\r\n } else {\r\n if (this.$button.hasClass('disabled')) {\r\n this.$newElement.removeClass('disabled');\r\n this.$button.removeClass('disabled').attr('aria-disabled', false);\r\n }\r\n\r\n if (this.$button.attr('tabindex') == -1 && !this.$element.data('tabindex')) {\r\n this.$button.removeAttr('tabindex');\r\n }\r\n }\r\n\r\n this.$button.click(function () {\r\n return !that.isDisabled();\r\n });\r\n },\r\n\r\n togglePlaceholder: function () {\r\n var value = this.$element.val();\r\n this.$button.toggleClass('bs-placeholder', value === null || value === '' || (value.constructor === Array && value.length === 0));\r\n },\r\n\r\n tabIndex: function () {\r\n if (this.$element.data('tabindex') !== this.$element.attr('tabindex') && \r\n (this.$element.attr('tabindex') !== -98 && this.$element.attr('tabindex') !== '-98')) {\r\n this.$element.data('tabindex', this.$element.attr('tabindex'));\r\n this.$button.attr('tabindex', this.$element.data('tabindex'));\r\n }\r\n\r\n this.$element.attr('tabindex', -98);\r\n },\r\n\r\n clickListener: function () {\r\n var that = this,\r\n $document = $(document);\r\n\r\n $document.data('spaceSelect', false);\r\n\r\n this.$button.on('keyup', function (e) {\r\n if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) {\r\n e.preventDefault();\r\n $document.data('spaceSelect', false);\r\n }\r\n });\r\n\r\n this.$button.on('click', function () {\r\n that.setSize();\r\n });\r\n\r\n this.$element.on('shown.bs.select', function () {\r\n if (!that.options.liveSearch && !that.multiple) {\r\n that.$menuInner.find('.selected a').focus();\r\n } else if (!that.multiple) {\r\n var selectedIndex = that.liObj[that.$element[0].selectedIndex];\r\n\r\n if (typeof selectedIndex !== 'number' || that.options.size === false) return;\r\n\r\n // scroll to selected option\r\n var offset = that.$lis.eq(selectedIndex)[0].offsetTop - that.$menuInner[0].offsetTop;\r\n offset = offset - that.$menuInner[0].offsetHeight/2 + that.sizeInfo.liHeight/2;\r\n that.$menuInner[0].scrollTop = offset;\r\n }\r\n });\r\n\r\n this.$menuInner.on('click', 'li a', function (e) {\r\n var $this = $(this),\r\n clickedIndex = $this.parent().data('originalIndex'),\r\n prevValue = that.$element.val(),\r\n prevIndex = that.$element.prop('selectedIndex'),\r\n triggerChange = true;\r\n\r\n // Don't close on multi choice menu\r\n if (that.multiple && that.options.maxOptions !== 1) {\r\n e.stopPropagation();\r\n }\r\n\r\n e.preventDefault();\r\n\r\n //Don't run if we have been disabled\r\n if (!that.isDisabled() && !$this.parent().hasClass('disabled')) {\r\n var $options = that.$element.find('option'),\r\n $option = $options.eq(clickedIndex),\r\n state = $option.prop('selected'),\r\n $optgroup = $option.parent('optgroup'),\r\n maxOptions = that.options.maxOptions,\r\n maxOptionsGrp = $optgroup.data('maxOptions') || false;\r\n\r\n if (!that.multiple) { // Deselect all others if not multi select box\r\n $options.prop('selected', false);\r\n $option.prop('selected', true);\r\n that.$menuInner.find('.selected').removeClass('selected').find('a').attr('aria-selected', false);\r\n that.setSelected(clickedIndex, true);\r\n } else { // Toggle the one we have chosen if we are multi select.\r\n $option.prop('selected', !state);\r\n that.setSelected(clickedIndex, !state);\r\n $this.blur();\r\n\r\n if (maxOptions !== false || maxOptionsGrp !== false) {\r\n var maxReached = maxOptions < $options.filter(':selected').length,\r\n maxReachedGrp = maxOptionsGrp < $optgroup.find('option:selected').length;\r\n\r\n if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) {\r\n if (maxOptions && maxOptions == 1) {\r\n $options.prop('selected', false);\r\n $option.prop('selected', true);\r\n that.$menuInner.find('.selected').removeClass('selected');\r\n that.setSelected(clickedIndex, true);\r\n } else if (maxOptionsGrp && maxOptionsGrp == 1) {\r\n $optgroup.find('option:selected').prop('selected', false);\r\n $option.prop('selected', true);\r\n var optgroupID = $this.parent().data('optgroup');\r\n that.$menuInner.find('[data-optgroup=\"' + optgroupID + '\"]').removeClass('selected');\r\n that.setSelected(clickedIndex, true);\r\n } else {\r\n var maxOptionsText = typeof that.options.maxOptionsText === 'string' ? [that.options.maxOptionsText, that.options.maxOptionsText] : that.options.maxOptionsText,\r\n maxOptionsArr = typeof maxOptionsText === 'function' ? maxOptionsText(maxOptions, maxOptionsGrp) : maxOptionsText,\r\n maxTxt = maxOptionsArr[0].replace('{n}', maxOptions),\r\n maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp),\r\n $notify = $('
    ');\r\n // If {var} is set in array, replace it\r\n /** @deprecated */\r\n if (maxOptionsArr[2]) {\r\n maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]);\r\n maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]);\r\n }\r\n\r\n $option.prop('selected', false);\r\n\r\n that.$menu.append($notify);\r\n\r\n if (maxOptions && maxReached) {\r\n $notify.append($('
    ' + maxTxt + '
    '));\r\n triggerChange = false;\r\n that.$element.trigger('maxReached.bs.select');\r\n }\r\n\r\n if (maxOptionsGrp && maxReachedGrp) {\r\n $notify.append($('
    ' + maxTxtGrp + '
    '));\r\n triggerChange = false;\r\n that.$element.trigger('maxReachedGrp.bs.select');\r\n }\r\n\r\n setTimeout(function () {\r\n that.setSelected(clickedIndex, false);\r\n }, 10);\r\n\r\n $notify.delay(750).fadeOut(300, function () {\r\n $(this).remove();\r\n });\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!that.multiple || (that.multiple && that.options.maxOptions === 1)) {\r\n that.$button.focus();\r\n } else if (that.options.liveSearch) {\r\n that.$searchbox.focus();\r\n }\r\n\r\n // Trigger select 'change'\r\n if (triggerChange) {\r\n if ((prevValue != that.$element.val() && that.multiple) || (prevIndex != that.$element.prop('selectedIndex') && !that.multiple)) {\r\n // $option.prop('selected') is current option state (selected/unselected). state is previous option state.\r\n changed_arguments = [clickedIndex, $option.prop('selected'), state];\r\n that.$element\r\n .triggerNative('change');\r\n }\r\n }\r\n }\r\n });\r\n\r\n this.$menu.on('click', 'li.disabled a, .popover-title, .popover-title :not(.close)', function (e) {\r\n if (e.currentTarget == this) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n if (that.options.liveSearch && !$(e.target).hasClass('close')) {\r\n that.$searchbox.focus();\r\n } else {\r\n that.$button.focus();\r\n }\r\n }\r\n });\r\n\r\n this.$menuInner.on('click', '.divider, .dropdown-header', function (e) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n if (that.options.liveSearch) {\r\n that.$searchbox.focus();\r\n } else {\r\n that.$button.focus();\r\n }\r\n });\r\n\r\n this.$menu.on('click', '.popover-title .close', function () {\r\n that.$button.click();\r\n });\r\n\r\n this.$searchbox.on('click', function (e) {\r\n e.stopPropagation();\r\n });\r\n\r\n this.$menu.on('click', '.actions-btn', function (e) {\r\n if (that.options.liveSearch) {\r\n that.$searchbox.focus();\r\n } else {\r\n that.$button.focus();\r\n }\r\n\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n if ($(this).hasClass('bs-select-all')) {\r\n that.selectAll();\r\n } else {\r\n that.deselectAll();\r\n }\r\n });\r\n\r\n this.$element.change(function () {\r\n that.render(false);\r\n that.$element.trigger('changed.bs.select', changed_arguments);\r\n changed_arguments = null;\r\n });\r\n },\r\n\r\n liveSearchListener: function () {\r\n var that = this,\r\n $no_results = $('
  • ');\r\n\r\n this.$button.on('click.dropdown.data-api', function () {\r\n that.$menuInner.find('.active').removeClass('active');\r\n if (!!that.$searchbox.val()) {\r\n that.$searchbox.val('');\r\n that.$lis.not('.is-hidden').removeClass('hidden');\r\n if (!!$no_results.parent().length) $no_results.remove();\r\n }\r\n if (!that.multiple) that.$menuInner.find('.selected').addClass('active');\r\n setTimeout(function () {\r\n that.$searchbox.focus();\r\n }, 10);\r\n });\r\n\r\n this.$searchbox.on('click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api', function (e) {\r\n e.stopPropagation();\r\n });\r\n\r\n this.$searchbox.on('input propertychange', function () {\r\n that.$lis.not('.is-hidden').removeClass('hidden');\r\n that.$lis.filter('.active').removeClass('active');\r\n $no_results.remove();\r\n\r\n if (that.$searchbox.val()) {\r\n var $searchBase = that.$lis.not('.is-hidden, .divider, .dropdown-header'),\r\n $hideItems;\r\n if (that.options.liveSearchNormalize) {\r\n $hideItems = $searchBase.not(':a' + that._searchStyle() + '(\"' + normalizeToBase(that.$searchbox.val()) + '\")');\r\n } else {\r\n $hideItems = $searchBase.not(':' + that._searchStyle() + '(\"' + that.$searchbox.val() + '\")');\r\n }\r\n\r\n if ($hideItems.length === $searchBase.length) {\r\n $no_results.html(that.options.noneResultsText.replace('{0}', '\"' + htmlEscape(that.$searchbox.val()) + '\"'));\r\n that.$menuInner.append($no_results);\r\n that.$lis.addClass('hidden');\r\n } else {\r\n $hideItems.addClass('hidden');\r\n\r\n var $lisVisible = that.$lis.not('.hidden'),\r\n $foundDiv;\r\n\r\n // hide divider if first or last visible, or if followed by another divider\r\n $lisVisible.each(function (index) {\r\n var $this = $(this);\r\n\r\n if ($this.hasClass('divider')) {\r\n if ($foundDiv === undefined) {\r\n $this.addClass('hidden');\r\n } else {\r\n if ($foundDiv) $foundDiv.addClass('hidden');\r\n $foundDiv = $this;\r\n }\r\n } else if ($this.hasClass('dropdown-header') && $lisVisible.eq(index + 1).data('optgroup') !== $this.data('optgroup')) {\r\n $this.addClass('hidden');\r\n } else {\r\n $foundDiv = null;\r\n }\r\n });\r\n if ($foundDiv) $foundDiv.addClass('hidden');\r\n\r\n $searchBase.not('.hidden').first().addClass('active');\r\n that.$menuInner.scrollTop(0);\r\n }\r\n }\r\n });\r\n },\r\n\r\n _searchStyle: function () {\r\n var styles = {\r\n begins: 'ibegins',\r\n startsWith: 'ibegins'\r\n };\r\n\r\n return styles[this.options.liveSearchStyle] || 'icontains';\r\n },\r\n\r\n val: function (value) {\r\n if (typeof value !== 'undefined') {\r\n this.$element.val(value);\r\n this.render();\r\n\r\n return this.$element;\r\n } else {\r\n return this.$element.val();\r\n }\r\n },\r\n\r\n changeAll: function (status) {\r\n if (!this.multiple) return;\r\n if (typeof status === 'undefined') status = true;\r\n\r\n this.findLis();\r\n\r\n var $options = this.$element.find('option'),\r\n $lisVisible = this.$lis.not('.divider, .dropdown-header, .disabled, .hidden'),\r\n lisVisLen = $lisVisible.length,\r\n selectedOptions = [];\r\n \r\n if (status) {\r\n if ($lisVisible.filter('.selected').length === $lisVisible.length) return;\r\n } else {\r\n if ($lisVisible.filter('.selected').length === 0) return;\r\n }\r\n \r\n $lisVisible.toggleClass('selected', status);\r\n\r\n for (var i = 0; i < lisVisLen; i++) {\r\n var origIndex = $lisVisible[i].getAttribute('data-original-index');\r\n selectedOptions[selectedOptions.length] = $options.eq(origIndex)[0];\r\n }\r\n\r\n $(selectedOptions).prop('selected', status);\r\n\r\n this.render(false);\r\n\r\n this.togglePlaceholder();\r\n\r\n this.$element\r\n .triggerNative('change');\r\n },\r\n\r\n selectAll: function () {\r\n return this.changeAll(true);\r\n },\r\n\r\n deselectAll: function () {\r\n return this.changeAll(false);\r\n },\r\n\r\n toggle: function (e) {\r\n e = e || window.event;\r\n\r\n if (e) e.stopPropagation();\r\n\r\n this.$button.trigger('click');\r\n },\r\n\r\n keydown: function (e) {\r\n var $this = $(this),\r\n $parent = $this.is('input') ? $this.parent().parent() : $this.parent(),\r\n $items,\r\n that = $parent.data('this'),\r\n index,\r\n prevIndex,\r\n isActive,\r\n selector = ':not(.disabled, .hidden, .dropdown-header, .divider)',\r\n keyCodeMap = {\r\n 32: ' ',\r\n 48: '0',\r\n 49: '1',\r\n 50: '2',\r\n 51: '3',\r\n 52: '4',\r\n 53: '5',\r\n 54: '6',\r\n 55: '7',\r\n 56: '8',\r\n 57: '9',\r\n 59: ';',\r\n 65: 'a',\r\n 66: 'b',\r\n 67: 'c',\r\n 68: 'd',\r\n 69: 'e',\r\n 70: 'f',\r\n 71: 'g',\r\n 72: 'h',\r\n 73: 'i',\r\n 74: 'j',\r\n 75: 'k',\r\n 76: 'l',\r\n 77: 'm',\r\n 78: 'n',\r\n 79: 'o',\r\n 80: 'p',\r\n 81: 'q',\r\n 82: 'r',\r\n 83: 's',\r\n 84: 't',\r\n 85: 'u',\r\n 86: 'v',\r\n 87: 'w',\r\n 88: 'x',\r\n 89: 'y',\r\n 90: 'z',\r\n 96: '0',\r\n 97: '1',\r\n 98: '2',\r\n 99: '3',\r\n 100: '4',\r\n 101: '5',\r\n 102: '6',\r\n 103: '7',\r\n 104: '8',\r\n 105: '9'\r\n };\r\n\r\n\r\n isActive = that.$newElement.hasClass('open');\r\n\r\n if (!isActive && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode >= 65 && e.keyCode <= 90)) {\r\n if (!that.options.container) {\r\n that.setSize();\r\n that.$menu.parent().addClass('open');\r\n isActive = true;\r\n } else {\r\n that.$button.trigger('click');\r\n }\r\n that.$searchbox.focus();\r\n return;\r\n }\r\n\r\n if (that.options.liveSearch) {\r\n if (/(^9$|27)/.test(e.keyCode.toString(10)) && isActive) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n that.$menuInner.click();\r\n that.$button.focus();\r\n }\r\n }\r\n\r\n if (/(38|40)/.test(e.keyCode.toString(10))) {\r\n $items = that.$lis.filter(selector);\r\n if (!$items.length) return;\r\n\r\n if (!that.options.liveSearch) {\r\n index = $items.index($items.find('a').filter(':focus').parent());\r\n\t } else {\r\n index = $items.index($items.filter('.active'));\r\n }\r\n\r\n prevIndex = that.$menuInner.data('prevIndex');\r\n\r\n if (e.keyCode == 38) {\r\n if ((that.options.liveSearch || index == prevIndex) && index != -1) index--;\r\n if (index < 0) index += $items.length;\r\n } else if (e.keyCode == 40) {\r\n if (that.options.liveSearch || index == prevIndex) index++;\r\n index = index % $items.length;\r\n }\r\n\r\n that.$menuInner.data('prevIndex', index);\r\n\r\n if (!that.options.liveSearch) {\r\n $items.eq(index).children('a').focus();\r\n } else {\r\n e.preventDefault();\r\n if (!$this.hasClass('dropdown-toggle')) {\r\n $items.removeClass('active').eq(index).addClass('active').children('a').focus();\r\n $this.focus();\r\n }\r\n }\r\n\r\n } else if (!$this.is('input')) {\r\n var keyIndex = [],\r\n count,\r\n prevKey;\r\n\r\n $items = that.$lis.filter(selector);\r\n $items.each(function (i) {\r\n if ($.trim($(this).children('a').text().toLowerCase()).substring(0, 1) == keyCodeMap[e.keyCode]) {\r\n keyIndex.push(i);\r\n }\r\n });\r\n\r\n count = $(document).data('keycount');\r\n count++;\r\n $(document).data('keycount', count);\r\n\r\n prevKey = $.trim($(':focus').text().toLowerCase()).substring(0, 1);\r\n\r\n if (prevKey != keyCodeMap[e.keyCode]) {\r\n count = 1;\r\n $(document).data('keycount', count);\r\n } else if (count >= keyIndex.length) {\r\n $(document).data('keycount', 0);\r\n if (count > keyIndex.length) count = 1;\r\n }\r\n\r\n $items.eq(keyIndex[count - 1]).children('a').focus();\r\n }\r\n\r\n // Select focused option if \"Enter\", \"Spacebar\" or \"Tab\" (when selectOnTab is true) are pressed inside the menu.\r\n if ((/(13|32)/.test(e.keyCode.toString(10)) || (/(^9$)/.test(e.keyCode.toString(10)) && that.options.selectOnTab)) && isActive) {\r\n if (!/(32)/.test(e.keyCode.toString(10))) e.preventDefault();\r\n if (!that.options.liveSearch) {\r\n var elem = $(':focus');\r\n elem.click();\r\n // Bring back focus for multiselects\r\n elem.focus();\r\n // Prevent screen from scrolling if the user hit the spacebar\r\n e.preventDefault();\r\n // Fixes spacebar selection of dropdown items in FF & IE\r\n $(document).data('spaceSelect', true);\r\n } else if (!/(32)/.test(e.keyCode.toString(10))) {\r\n that.$menuInner.find('.active a').click();\r\n $this.focus();\r\n }\r\n $(document).data('keycount', 0);\r\n }\r\n\r\n if ((/(^9$|27)/.test(e.keyCode.toString(10)) && isActive && (that.multiple || that.options.liveSearch)) || (/(27)/.test(e.keyCode.toString(10)) && !isActive)) {\r\n that.$menu.parent().removeClass('open');\r\n if (that.options.container) that.$newElement.removeClass('open');\r\n that.$button.focus();\r\n }\r\n },\r\n\r\n mobile: function () {\r\n this.$element.addClass('mobile-device');\r\n },\r\n\r\n refresh: function () {\r\n this.$lis = null;\r\n this.liObj = {};\r\n this.reloadLi();\r\n this.render();\r\n this.checkDisabled();\r\n this.liHeight(true);\r\n this.setStyle();\r\n this.setWidth();\r\n if (this.$lis) this.$searchbox.trigger('propertychange');\r\n\r\n this.$element.trigger('refreshed.bs.select');\r\n },\r\n\r\n hide: function () {\r\n this.$newElement.hide();\r\n },\r\n\r\n show: function () {\r\n this.$newElement.show();\r\n },\r\n\r\n remove: function () {\r\n this.$newElement.remove();\r\n this.$element.remove();\r\n },\r\n\r\n destroy: function () {\r\n this.$newElement.before(this.$element).remove();\r\n\r\n if (this.$bsContainer) {\r\n this.$bsContainer.remove();\r\n } else {\r\n this.$menu.remove();\r\n }\r\n\r\n this.$element\r\n .off('.bs.select')\r\n .removeData('selectpicker')\r\n .removeClass('bs-select-hidden selectpicker');\r\n }\r\n };\r\n\r\n // SELECTPICKER PLUGIN DEFINITION\r\n // ==============================\r\n function Plugin(option) {\r\n // get the args of the outer function..\r\n var args = arguments;\r\n // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them\r\n // to get lost/corrupted in android 2.3 and IE9 #715 #775\r\n var _option = option;\r\n\r\n [].shift.apply(args);\r\n\r\n var value;\r\n var chain = this.each(function () {\r\n var $this = $(this);\r\n if ($this.is('select')) {\r\n var data = $this.data('selectpicker'),\r\n options = typeof _option == 'object' && _option;\r\n\r\n if (!data) {\r\n var config = $.extend({}, Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, $this.data(), options);\r\n config.template = $.extend({}, Selectpicker.DEFAULTS.template, ($.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.template : {}), $this.data().template, options.template);\r\n $this.data('selectpicker', (data = new Selectpicker(this, config)));\r\n } else if (options) {\r\n for (var i in options) {\r\n if (options.hasOwnProperty(i)) {\r\n data.options[i] = options[i];\r\n }\r\n }\r\n }\r\n\r\n if (typeof _option == 'string') {\r\n if (data[_option] instanceof Function) {\r\n value = data[_option].apply(data, args);\r\n } else {\r\n value = data.options[_option];\r\n }\r\n }\r\n }\r\n });\r\n\r\n if (typeof value !== 'undefined') {\r\n //noinspection JSUnusedAssignment\r\n return value;\r\n } else {\r\n return chain;\r\n }\r\n }\r\n\r\n var old = $.fn.selectpicker;\r\n $.fn.selectpicker = Plugin;\r\n $.fn.selectpicker.Constructor = Selectpicker;\r\n\r\n // SELECTPICKER NO CONFLICT\r\n // ========================\r\n $.fn.selectpicker.noConflict = function () {\r\n $.fn.selectpicker = old;\r\n return this;\r\n };\r\n\r\n $(document)\r\n .data('keycount', 0)\r\n .on('keydown.bs.select', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=\"listbox\"], .bs-searchbox input', Selectpicker.prototype.keydown)\r\n .on('focusin.modal', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=\"listbox\"], .bs-searchbox input', function (e) {\r\n e.stopPropagation();\r\n });\r\n\r\n // SELECTPICKER DATA-API\r\n // =====================\r\n $(window).on('load.bs.select.data-api', function () {\r\n $('.selectpicker').each(function () {\r\n var $selectpicker = $(this);\r\n Plugin.call($selectpicker, $selectpicker.data());\r\n })\r\n });\r\n})(jQuery);\r\n","/*!\r\n * bootstrap-fileinput v4.4.7\r\n * http://plugins.krajee.com/file-input\r\n *\r\n * Author: Kartik Visweswaran\r\n * Copyright: 2014 - 2017, Kartik Visweswaran, Krajee.com\r\n *\r\n * Licensed under the BSD 3-Clause\r\n * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md\r\n */\r\n(function (factory) {\r\n \"use strict\";\r\n //noinspection JSUnresolvedVariable\r\n if (typeof define === 'function' && define.amd) { // jshint ignore:line\r\n // AMD. Register as an anonymous module.\r\n define(['jquery'], factory); // jshint ignore:line\r\n } else { // noinspection JSUnresolvedVariable\r\n if (typeof module === 'object' && module.exports) { // jshint ignore:line\r\n // Node/CommonJS\r\n // noinspection JSUnresolvedVariable\r\n module.exports = factory(require('jquery')); // jshint ignore:line\r\n } else {\r\n // Browser globals\r\n factory(window.jQuery);\r\n }\r\n }\r\n}(function ($) {\r\n \"use strict\";\r\n\r\n $.fn.fileinputLocales = {};\r\n $.fn.fileinputThemes = {};\r\n\r\n String.prototype.setTokens = function (replacePairs) {\r\n var str = this.toString(), key, re;\r\n for (key in replacePairs) {\r\n if (replacePairs.hasOwnProperty(key)) {\r\n re = new RegExp(\"\\{\" + key + \"\\}\", \"g\");\r\n str = str.replace(re, replacePairs[key]);\r\n }\r\n }\r\n return str;\r\n };\r\n\r\n var $h, FileInput;\r\n\r\n // fileinput helper object for all global variables and internal helper methods\r\n //noinspection JSUnresolvedVariable\r\n $h = {\r\n FRAMES: '.kv-preview-thumb',\r\n SORT_CSS: 'file-sortable',\r\n OBJECT_PARAMS: '\\n' +\r\n '\\n' +\r\n '\\n' +\r\n '\\n' +\r\n '\\n' +\r\n '\\n',\r\n DEFAULT_PREVIEW: '
    \\n' +\r\n '{previewFileIcon}\\n' +\r\n '
    ',\r\n MODAL_ID: 'kvFileinputModal',\r\n MODAL_EVENTS: ['show', 'shown', 'hide', 'hidden', 'loaded'],\r\n objUrl: window.URL || window.webkitURL,\r\n compare: function (input, str, exact) {\r\n return input !== undefined && (exact ? input === str : input.match(str));\r\n },\r\n isIE: function (ver) {\r\n // check for IE versions < 11\r\n if (navigator.appName !== 'Microsoft Internet Explorer') {\r\n return false;\r\n }\r\n if (ver === 10) {\r\n return new RegExp('msie\\\\s' + ver, 'i').test(navigator.userAgent);\r\n }\r\n var div = document.createElement(\"div\"), status;\r\n div.innerHTML = \"\";\r\n status = div.getElementsByTagName(\"i\").length;\r\n document.body.appendChild(div);\r\n div.parentNode.removeChild(div);\r\n return status;\r\n },\r\n initModal: function ($modal) {\r\n var $body = $('body');\r\n if ($body.length) {\r\n $modal.appendTo($body);\r\n }\r\n },\r\n isEmpty: function (value, trim) {\r\n return value === undefined || value === null || value.length === 0 || (trim && $.trim(value) === '');\r\n },\r\n isArray: function (a) {\r\n return Array.isArray(a) || Object.prototype.toString.call(a) === '[object Array]';\r\n },\r\n ifSet: function (needle, haystack, def) {\r\n def = def || '';\r\n return (haystack && typeof haystack === 'object' && needle in haystack) ? haystack[needle] : def;\r\n },\r\n cleanArray: function (arr) {\r\n if (!(arr instanceof Array)) {\r\n arr = [];\r\n }\r\n return arr.filter(function (e) {\r\n return (e !== undefined && e !== null);\r\n });\r\n },\r\n spliceArray: function (arr, index) {\r\n var i, j = 0, out = [];\r\n if (!(arr instanceof Array)) {\r\n return [];\r\n }\r\n for (i = 0; i < arr.length; i++) {\r\n if (i !== index) {\r\n out[j] = arr[i];\r\n j++;\r\n }\r\n }\r\n return out;\r\n },\r\n getNum: function (num, def) {\r\n def = def || 0;\r\n if (typeof num === \"number\") {\r\n return num;\r\n }\r\n if (typeof num === \"string\") {\r\n num = parseFloat(num);\r\n }\r\n return isNaN(num) ? def : num;\r\n },\r\n hasFileAPISupport: function () {\r\n return !!(window.File && window.FileReader);\r\n },\r\n hasDragDropSupport: function () {\r\n var div = document.createElement('div');\r\n /** @namespace div.draggable */\r\n /** @namespace div.ondragstart */\r\n /** @namespace div.ondrop */\r\n return !$h.isIE(9) &&\r\n (div.draggable !== undefined || (div.ondragstart !== undefined && div.ondrop !== undefined));\r\n },\r\n hasFileUploadSupport: function () {\r\n return $h.hasFileAPISupport() && window.FormData;\r\n },\r\n hasBlobSupport: function () {\r\n try {\r\n return !!window.Blob && Boolean(new Blob());\r\n } catch (e) {\r\n return false;\r\n }\r\n },\r\n hasArrayBufferViewSupport: function () {\r\n try {\r\n return new Blob([new Uint8Array(100)]).size === 100;\r\n } catch (e) {\r\n return false;\r\n }\r\n },\r\n dataURI2Blob: function (dataURI) {\r\n //noinspection JSUnresolvedVariable\r\n var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder ||\r\n window.MSBlobBuilder, canBlob = $h.hasBlobSupport(), byteStr, arrayBuffer, intArray, i, mimeStr, bb,\r\n canProceed = (canBlob || BlobBuilder) && window.atob && window.ArrayBuffer && window.Uint8Array;\r\n if (!canProceed) {\r\n return null;\r\n }\r\n if (dataURI.split(',')[0].indexOf('base64') >= 0) {\r\n byteStr = atob(dataURI.split(',')[1]);\r\n } else {\r\n byteStr = decodeURIComponent(dataURI.split(',')[1]);\r\n }\r\n arrayBuffer = new ArrayBuffer(byteStr.length);\r\n intArray = new Uint8Array(arrayBuffer);\r\n for (i = 0; i < byteStr.length; i += 1) {\r\n intArray[i] = byteStr.charCodeAt(i);\r\n }\r\n mimeStr = dataURI.split(',')[0].split(':')[1].split(';')[0];\r\n if (canBlob) {\r\n return new Blob([$h.hasArrayBufferViewSupport() ? intArray : arrayBuffer], {type: mimeStr});\r\n }\r\n bb = new BlobBuilder();\r\n bb.append(arrayBuffer);\r\n return bb.getBlob(mimeStr);\r\n },\r\n arrayBuffer2String: function (buffer) {\r\n //noinspection JSUnresolvedVariable\r\n if (window.TextDecoder) {\r\n // noinspection JSUnresolvedFunction\r\n return new TextDecoder(\"utf-8\").decode(buffer);\r\n }\r\n var array = Array.prototype.slice.apply(new Uint8Array(buffer)), out = '', i = 0, len, c, char2, char3;\r\n len = array.length;\r\n while (i < len) {\r\n c = array[i++];\r\n switch (c >> 4) { // jshint ignore:line\r\n case 0:\r\n case 1:\r\n case 2:\r\n case 3:\r\n case 4:\r\n case 5:\r\n case 6:\r\n case 7:\r\n // 0xxxxxxx\r\n out += String.fromCharCode(c);\r\n break;\r\n case 12:\r\n case 13:\r\n // 110x xxxx 10xx xxxx\r\n char2 = array[i++];\r\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F)); // jshint ignore:line\r\n break;\r\n case 14:\r\n // 1110 xxxx 10xx xxxx 10xx xxxx\r\n char2 = array[i++];\r\n char3 = array[i++];\r\n out += String.fromCharCode(((c & 0x0F) << 12) | // jshint ignore:line\r\n ((char2 & 0x3F) << 6) | // jshint ignore:line\r\n ((char3 & 0x3F) << 0)); // jshint ignore:line\r\n break;\r\n }\r\n }\r\n return out;\r\n },\r\n isHtml: function (str) {\r\n var a = document.createElement('div');\r\n a.innerHTML = str;\r\n for (var c = a.childNodes, i = c.length; i--;) {\r\n if (c[i].nodeType === 1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n isSvg: function (str) {\r\n return str.match(/^\\s*<\\?xml/i) && (str.match(//g, '>')\r\n .replace(/\"/g, '"')\r\n .replace(/'/g, ''');\r\n },\r\n replaceTags: function (str, tags) {\r\n var out = str;\r\n if (!tags) {\r\n return out;\r\n }\r\n $.each(tags, function (key, value) {\r\n if (typeof value === \"function\") {\r\n value = value();\r\n }\r\n out = out.split(key).join(value);\r\n });\r\n return out;\r\n },\r\n cleanMemory: function ($thumb) {\r\n var data = $thumb.is('img') ? $thumb.attr('src') : $thumb.find('source').attr('src');\r\n /** @namespace $h.objUrl.revokeObjectURL */\r\n $h.objUrl.revokeObjectURL(data);\r\n },\r\n findFileName: function (filePath) {\r\n var sepIndex = filePath.lastIndexOf('/');\r\n if (sepIndex === -1) {\r\n sepIndex = filePath.lastIndexOf('\\\\');\r\n }\r\n return filePath.split(filePath.substring(sepIndex, sepIndex + 1)).pop();\r\n },\r\n checkFullScreen: function () {\r\n //noinspection JSUnresolvedVariable\r\n return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement ||\r\n document.msFullscreenElement;\r\n },\r\n toggleFullScreen: function (maximize) {\r\n var doc = document, de = doc.documentElement;\r\n if (de && maximize && !$h.checkFullScreen()) {\r\n /** @namespace document.requestFullscreen */\r\n /** @namespace document.msRequestFullscreen */\r\n /** @namespace document.mozRequestFullScreen */\r\n /** @namespace document.webkitRequestFullscreen */\r\n /** @namespace Element.ALLOW_KEYBOARD_INPUT */\r\n if (de.requestFullscreen) {\r\n de.requestFullscreen();\r\n } else if (de.msRequestFullscreen) {\r\n de.msRequestFullscreen();\r\n } else if (de.mozRequestFullScreen) {\r\n de.mozRequestFullScreen();\r\n } else if (de.webkitRequestFullscreen) {\r\n de.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);\r\n }\r\n } else {\r\n /** @namespace document.exitFullscreen */\r\n /** @namespace document.msExitFullscreen */\r\n /** @namespace document.mozCancelFullScreen */\r\n /** @namespace document.webkitExitFullscreen */\r\n if (doc.exitFullscreen) {\r\n doc.exitFullscreen();\r\n } else if (doc.msExitFullscreen) {\r\n doc.msExitFullscreen();\r\n } else if (doc.mozCancelFullScreen) {\r\n doc.mozCancelFullScreen();\r\n } else if (doc.webkitExitFullscreen) {\r\n doc.webkitExitFullscreen();\r\n }\r\n }\r\n },\r\n moveArray: function (arr, oldIndex, newIndex) {\r\n if (newIndex >= arr.length) {\r\n var k = newIndex - arr.length;\r\n while ((k--) + 1) {\r\n arr.push(undefined);\r\n }\r\n }\r\n arr.splice(newIndex, 0, arr.splice(oldIndex, 1)[0]);\r\n return arr;\r\n },\r\n cleanZoomCache: function ($el) {\r\n var $cache = $el.closest('.kv-zoom-cache-theme');\r\n if (!$cache.length) {\r\n $cache = $el.closest('.kv-zoom-cache');\r\n }\r\n $cache.remove();\r\n },\r\n setOrientation: function (buffer, callback) {\r\n var scanner = new DataView(buffer), idx = 0, value = 1, // Non-rotated is the default\r\n maxBytes, uInt16, exifLength;\r\n if (scanner.getUint16(idx) !== 0xFFD8 || buffer.length < 2) { // not a proper JPEG\r\n if (callback) {\r\n callback();\r\n }\r\n return;\r\n }\r\n idx += 2;\r\n maxBytes = scanner.byteLength;\r\n while (idx < maxBytes - 2) {\r\n uInt16 = scanner.getUint16(idx);\r\n idx += 2;\r\n switch (uInt16) {\r\n case 0xFFE1: // Start of EXIF\r\n exifLength = scanner.getUint16(idx);\r\n maxBytes = exifLength - idx;\r\n idx += 2;\r\n break;\r\n case 0x0112: // Orientation tag\r\n value = scanner.getUint16(idx + 6, false);\r\n maxBytes = 0; // Stop scanning\r\n break;\r\n }\r\n }\r\n if (callback) {\r\n callback(value);\r\n }\r\n },\r\n validateOrientation: function (file, callback) {\r\n if (!window.FileReader || !window.DataView) {\r\n return; // skip orientation if pre-requisite libraries not supported by browser\r\n }\r\n var reader = new FileReader(), buffer;\r\n reader.onloadend = function () {\r\n buffer = reader.result;\r\n $h.setOrientation(buffer, callback);\r\n };\r\n reader.readAsArrayBuffer(file);\r\n },\r\n adjustOrientedImage: function ($img, isZoom) {\r\n var offsetContTop, offsetTop, newTop;\r\n if (!$img.hasClass('is-portrait-gt4')) {\r\n return;\r\n }\r\n if (isZoom) {\r\n $img.css({width: $img.parent().height()});\r\n return;\r\n } else {\r\n $img.css({height: 'auto', width: $img.height()});\r\n }\r\n offsetContTop = $img.parent().offset().top;\r\n offsetTop = $img.offset().top;\r\n newTop = offsetContTop - offsetTop;\r\n $img.css('margin-top', newTop);\r\n },\r\n closeButton: function (css) {\r\n css = css ? 'close ' + css : 'close';\r\n return '';\r\n }\r\n };\r\n FileInput = function (element, options) {\r\n var self = this;\r\n self.$element = $(element);\r\n self.$parent = self.$element.parent();\r\n if (!self._validate()) {\r\n return;\r\n }\r\n self.isPreviewable = $h.hasFileAPISupport();\r\n self.isIE9 = $h.isIE(9);\r\n self.isIE10 = $h.isIE(10);\r\n if (self.isPreviewable || self.isIE9) {\r\n self._init(options);\r\n self._listen();\r\n }\r\n self.$element.removeClass('file-loading');\r\n };\r\n //noinspection JSUnusedGlobalSymbols\r\n FileInput.prototype = {\r\n constructor: FileInput,\r\n _cleanup: function () {\r\n var self = this;\r\n self.reader = null;\r\n self.formdata = {};\r\n self.uploadCount = 0;\r\n self.uploadStatus = {};\r\n self.uploadLog = [];\r\n self.uploadAsyncCount = 0;\r\n self.loadedImages = [];\r\n self.totalImagesCount = 0;\r\n self.ajaxRequests = [];\r\n self.clearStack();\r\n self.fileInputCleared = false;\r\n self.fileBatchCompleted = true;\r\n if (!self.isPreviewable) {\r\n self.showPreview = false;\r\n }\r\n self.isError = false;\r\n self.ajaxAborted = false;\r\n self.cancelling = false;\r\n },\r\n _init: function (options, refreshMode) {\r\n var self = this, f, $el = self.$element, $cont, t, tmp;\r\n self.options = options;\r\n $.each(options, function (key, value) {\r\n switch (key) {\r\n case 'minFileCount':\r\n case 'maxFileCount':\r\n case 'minFileSize':\r\n case 'maxFileSize':\r\n case 'maxFilePreviewSize':\r\n case 'resizeImageQuality':\r\n case 'resizeIfSizeMoreThan':\r\n case 'progressUploadThreshold':\r\n case 'initialPreviewCount':\r\n case 'zoomModalHeight':\r\n case 'minImageHeight':\r\n case 'maxImageHeight':\r\n case 'minImageWidth':\r\n case 'maxImageWidth':\r\n self[key] = $h.getNum(value);\r\n break;\r\n default:\r\n self[key] = value;\r\n break;\r\n }\r\n });\r\n if (self.rtl) { // swap buttons for rtl\r\n tmp = self.previewZoomButtonIcons.prev;\r\n self.previewZoomButtonIcons.prev = self.previewZoomButtonIcons.next;\r\n self.previewZoomButtonIcons.next = tmp;\r\n }\r\n if (!refreshMode) {\r\n self._cleanup();\r\n }\r\n self.$form = $el.closest('form');\r\n self._initTemplateDefaults();\r\n self.uploadFileAttr = !$h.isEmpty($el.attr('name')) ? $el.attr('name') : 'file_data';\r\n t = self._getLayoutTemplate('progress');\r\n self.progressTemplate = t.replace('{class}', self.progressClass);\r\n self.progressCompleteTemplate = t.replace('{class}', self.progressCompleteClass);\r\n self.progressErrorTemplate = t.replace('{class}', self.progressErrorClass);\r\n self.dropZoneEnabled = $h.hasDragDropSupport() && self.dropZoneEnabled;\r\n self.isDisabled = $el.attr('disabled') || $el.attr('readonly');\r\n if (self.isDisabled) {\r\n $el.attr('disabled', true);\r\n }\r\n self.isAjaxUpload = $h.hasFileUploadSupport() && !$h.isEmpty(self.uploadUrl);\r\n self.isClickable = self.browseOnZoneClick && self.showPreview &&\r\n (self.isAjaxUpload && self.dropZoneEnabled || !$h.isEmpty(self.defaultPreviewContent));\r\n self.slug = typeof options.slugCallback === \"function\" ? options.slugCallback : self._slugDefault;\r\n self.mainTemplate = self.showCaption ? self._getLayoutTemplate('main1') : self._getLayoutTemplate('main2');\r\n self.captionTemplate = self._getLayoutTemplate('caption');\r\n self.previewGenericTemplate = self._getPreviewTemplate('generic');\r\n if (!self.imageCanvas && self.resizeImage && (self.maxImageWidth || self.maxImageHeight)) {\r\n self.imageCanvas = document.createElement('canvas');\r\n self.imageCanvasContext = self.imageCanvas.getContext('2d');\r\n }\r\n if ($h.isEmpty($el.attr('id'))) {\r\n $el.attr('id', $h.uniqId());\r\n }\r\n self.namespace = '.fileinput_' + $el.attr('id').replace(/-/g, '_');\r\n if (self.$container === undefined) {\r\n self.$container = self._createContainer();\r\n } else {\r\n self._refreshContainer();\r\n }\r\n $cont = self.$container;\r\n self.$dropZone = $cont.find('.file-drop-zone');\r\n self.$progress = $cont.find('.kv-upload-progress');\r\n self.$btnUpload = $cont.find('.fileinput-upload');\r\n self.$captionContainer = $h.getElement(options, 'elCaptionContainer', $cont.find('.file-caption'));\r\n self.$caption = $h.getElement(options, 'elCaptionText', $cont.find('.file-caption-name'));\r\n if (!$h.isEmpty(self.msgPlaceholder)) {\r\n f = $el.attr('multiple') ? self.filePlural : self.fileSingle;\r\n self.$caption.attr('placeholder', self.msgPlaceholder.replace('{files}', f));\r\n }\r\n self.$captionIcon = self.$captionContainer.find('.file-caption-icon');\r\n if (self.mainClass.indexOf('input-group-lg') > -1) {\r\n $h.addCss(self.$captionIcon, 'icon-lg');\r\n } else {\r\n self.$captionIcon.removeClass('icon-lg');\r\n }\r\n self.$previewContainer = $h.getElement(options, 'elPreviewContainer', $cont.find('.file-preview'));\r\n self.$preview = $h.getElement(options, 'elPreviewImage', $cont.find('.file-preview-thumbnails'));\r\n self.$previewStatus = $h.getElement(options, 'elPreviewStatus', $cont.find('.file-preview-status'));\r\n self.$errorContainer = $h.getElement(options, 'elErrorContainer', self.$previewContainer.find('.kv-fileinput-error'));\r\n self._validateDisabled();\r\n if (!$h.isEmpty(self.msgErrorClass)) {\r\n $h.addCss(self.$errorContainer, self.msgErrorClass);\r\n }\r\n if (!refreshMode) {\r\n self.$errorContainer.hide();\r\n self.previewInitId = \"preview-\" + $h.uniqId();\r\n self._initPreviewCache();\r\n self._initPreview(true);\r\n self._initPreviewActions();\r\n self._setFileDropZoneTitle();\r\n if (self.$parent.hasClass('file-loading')) {\r\n self.$container.insertBefore(self.$parent);\r\n self.$parent.remove();\r\n }\r\n }\r\n if ($el.attr('disabled')) {\r\n self.disable();\r\n }\r\n self._initZoom();\r\n if (self.hideThumbnailContent) {\r\n $h.addCss(self.$preview, 'hide-content');\r\n }\r\n },\r\n _initTemplateDefaults: function () {\r\n var self = this, tMain1, tMain2, tPreview, tFileIcon, tClose, tCaption, tBtnDefault, tBtnLink, tBtnBrowse,\r\n tModalMain, tModal, tProgress, tSize, tFooter, tActions, tActionDelete, tActionUpload, tActionDownload,\r\n tActionZoom, tActionDrag, tIndicator, tTagBef, tTagBef1, tTagBef2, tTagAft, tGeneric, tHtml, tImage,\r\n tText, tOffice, tVideo, tAudio, tFlash, tObject, tPdf, tOther, tZoomCache, vDefaultDim;\r\n tMain1 = '{preview}\\n' +\r\n '
    \\n' +\r\n '
    \\n' +\r\n ' {caption}\\n' +\r\n '
    \\n' +\r\n ' {remove}\\n' +\r\n ' {cancel}\\n' +\r\n ' {upload}\\n' +\r\n ' {browse}\\n' +\r\n '
    \\n' +\r\n '
    ';\r\n tMain2 = '{preview}\\n
    \\n
    \\n{remove}\\n{cancel}\\n{upload}\\n{browse}\\n';\r\n tPreview = '
    \\n' +\r\n ' {close}' +\r\n '
    \\n' +\r\n '
    \\n' +\r\n '
    \\n' +\r\n '
    ' +\r\n '
    \\n' +\r\n '
    \\n' +\r\n '
    \\n' +\r\n '
    ';\r\n tClose = $h.closeButton('fileinput-remove');\r\n tFileIcon = '';\r\n tCaption = '
    \\n' +\r\n ' \\n' +\r\n ' \\n' +\r\n '
    ';\r\n //noinspection HtmlUnknownAttribute\r\n tBtnDefault = '';\r\n //noinspection HtmlUnknownAttribute\r\n tBtnLink = '{icon} {label}';\r\n //noinspection HtmlUnknownAttribute\r\n tBtnBrowse = '
    {icon} {label}
    ';\r\n tModalMain = '
    ';\r\n tModal = '
    \\n' +\r\n '
    \\n' +\r\n '
    \\n' +\r\n '
    {heading}
    \\n' +\r\n ' \\n' +\r\n '
    {toggleheader}{fullscreen}{borderless}{close}
    \\n' +\r\n '
    \\n' +\r\n '
    \\n' +\r\n '
    \\n' +\r\n '
    \\n' + '{prev} {next}\\n' +\r\n '
    \\n' +\r\n '
    \\n' +\r\n '
    \\n';\r\n tProgress = '
    \\n' +\r\n '
    \\n' +\r\n ' {status}\\n' +\r\n '
    \\n' +\r\n '
    ';\r\n tSize = ' ({sizeText})';\r\n tFooter = '
    \\n' +\r\n ' \\n' +\r\n ' {progress}\\n{indicator}\\n{actions}\\n' +\r\n '
    ';\r\n tActions = '
    \\n' +\r\n ' \\n' +\r\n '
    \\n' +\r\n '{drag}\\n' +\r\n '
    ';\r\n //noinspection HtmlUnknownAttribute\r\n tActionDelete = '\\n';\r\n tActionUpload = '';\r\n tActionDownload = '{downloadIcon}';\r\n tActionZoom = '';\r\n tActionDrag = '{dragIcon}';\r\n tIndicator = '
    {indicator}
    ';\r\n tTagBef = '
    \\n';\r\n tTagBef2 = tTagBef + ' title=\"{caption}\">
    \\n';\r\n tTagAft = '
    {footer}\\n
    \\n';\r\n tGeneric = '{content}\\n';\r\n tHtml = '
    {data}
    \\n';\r\n tImage = '\\n';\r\n tText = '\\n';\r\n tOffice = '';\r\n tVideo = '\\n';\r\n tAudio = '\\n';\r\n tFlash = '\\n';\r\n tPdf = '\\n';\r\n tObject = '\\n' + '\\n' +\r\n $h.OBJECT_PARAMS + ' ' + $h.DEFAULT_PREVIEW + '\\n\\n';\r\n tOther = '
    \\n' + $h.DEFAULT_PREVIEW + '\\n
    \\n';\r\n tZoomCache = '
    {zoomContent}
    ';\r\n vDefaultDim = {width: \"100%\", height: \"100%\", 'min-height': \"480px\"};\r\n self.defaults = {\r\n layoutTemplates: {\r\n main1: tMain1,\r\n main2: tMain2,\r\n preview: tPreview,\r\n close: tClose,\r\n fileIcon: tFileIcon,\r\n caption: tCaption,\r\n modalMain: tModalMain,\r\n modal: tModal,\r\n progress: tProgress,\r\n size: tSize,\r\n footer: tFooter,\r\n indicator: tIndicator,\r\n actions: tActions,\r\n actionDelete: tActionDelete,\r\n actionUpload: tActionUpload,\r\n actionDownload: tActionDownload,\r\n actionZoom: tActionZoom,\r\n actionDrag: tActionDrag,\r\n btnDefault: tBtnDefault,\r\n btnLink: tBtnLink,\r\n btnBrowse: tBtnBrowse,\r\n zoomCache: tZoomCache\r\n },\r\n previewMarkupTags: {\r\n tagBefore1: tTagBef1,\r\n tagBefore2: tTagBef2,\r\n tagAfter: tTagAft\r\n },\r\n previewContentTemplates: {\r\n generic: tGeneric,\r\n html: tHtml,\r\n image: tImage,\r\n text: tText,\r\n office: tOffice,\r\n video: tVideo,\r\n audio: tAudio,\r\n flash: tFlash,\r\n object: tObject,\r\n pdf: tPdf,\r\n other: tOther\r\n },\r\n allowedPreviewTypes: ['image', 'html', 'text', 'video', 'audio', 'flash', 'pdf', 'object'],\r\n previewTemplates: {},\r\n previewSettings: {\r\n image: {width: \"auto\", height: \"auto\", 'max-width': \"100%\", 'max-height': \"100%\"},\r\n html: {width: \"213px\", height: \"160px\"},\r\n text: {width: \"213px\", height: \"160px\"},\r\n office: {width: \"213px\", height: \"160px\"},\r\n video: {width: \"213px\", height: \"160px\"},\r\n audio: {width: \"100%\", height: \"30px\"},\r\n flash: {width: \"213px\", height: \"160px\"},\r\n object: {width: \"213px\", height: \"160px\"},\r\n pdf: {width: \"213px\", height: \"160px\"},\r\n other: {width: \"213px\", height: \"160px\"}\r\n },\r\n previewSettingsSmall: {\r\n image: {width: \"auto\", height: \"auto\", 'max-width': \"100%\", 'max-height': \"100%\"},\r\n html: {width: \"100%\", height: \"160px\"},\r\n text: {width: \"100%\", height: \"160px\"},\r\n office: {width: \"100%\", height: \"160px\"},\r\n video: {width: \"100%\", height: \"auto\"},\r\n audio: {width: \"100%\", height: \"30px\"},\r\n flash: {width: \"100%\", height: \"auto\"},\r\n object: {width: \"100%\", height: \"auto\"},\r\n pdf: {width: \"100%\", height: \"160px\"},\r\n other: {width: \"100%\", height: \"160px\"}\r\n },\r\n previewZoomSettings: {\r\n image: {width: \"auto\", height: \"auto\", 'max-width': \"100%\", 'max-height': \"100%\"},\r\n html: vDefaultDim,\r\n text: vDefaultDim,\r\n office: {width: \"100%\", height: \"100%\", 'max-width': \"100%\", 'min-height': \"480px\"},\r\n video: {width: \"auto\", height: \"100%\", 'max-width': \"100%\"},\r\n audio: {width: \"100%\", height: \"30px\"},\r\n flash: {width: \"auto\", height: \"480px\"},\r\n object: {width: \"auto\", height: \"100%\", 'max-width': \"100%\", 'min-height': \"480px\"},\r\n pdf: vDefaultDim,\r\n other: {width: \"auto\", height: \"100%\", 'min-height': \"480px\"}\r\n },\r\n fileTypeSettings: {\r\n image: function (vType, vName) {\r\n return ($h.compare(vType, 'image.*') && !$h.compare(vType, /(tiff?|wmf)$/i) ||\r\n $h.compare(vName, /\\.(gif|png|jpe?g)$/i));\r\n },\r\n html: function (vType, vName) {\r\n return $h.compare(vType, 'text/html') || $h.compare(vName, /\\.(htm|html)$/i);\r\n },\r\n office: function (vType, vName) {\r\n return $h.compare(vType, /(word|excel|powerpoint|office|iwork-pages|tiff?)$/i) ||\r\n $h.compare(vName, /\\.(rtf|docx?|xlsx?|pptx?|pps|potx?|ods|odt|pages|ai|dxf|ttf|tiff?|wmf|e?ps)$/i);\r\n },\r\n text: function (vType, vName) {\r\n return $h.compare(vType, 'text.*') || $h.compare(vName, /\\.(xml|javascript)$/i) ||\r\n $h.compare(vName, /\\.(txt|md|csv|nfo|ini|json|php|js|css)$/i);\r\n },\r\n video: function (vType, vName) {\r\n return $h.compare(vType, 'video.*') && ($h.compare(vType, /(ogg|mp4|mp?g|mov|webm|3gp)$/i) ||\r\n $h.compare(vName, /\\.(og?|mp4|webm|mp?g|mov|3gp)$/i));\r\n },\r\n audio: function (vType, vName) {\r\n return $h.compare(vType, 'audio.*') && ($h.compare(vName, /(ogg|mp3|mp?g|wav)$/i) ||\r\n $h.compare(vName, /\\.(og?|mp3|mp?g|wav)$/i));\r\n },\r\n flash: function (vType, vName) {\r\n return $h.compare(vType, 'application/x-shockwave-flash', true) || $h.compare(vName, /\\.(swf)$/i);\r\n },\r\n pdf: function (vType, vName) {\r\n return $h.compare(vType, 'application/pdf', true) || $h.compare(vName, /\\.(pdf)$/i);\r\n },\r\n object: function () {\r\n return true;\r\n },\r\n other: function () {\r\n return true;\r\n }\r\n },\r\n fileActionSettings: {\r\n showRemove: true,\r\n showUpload: true,\r\n showDownload: true,\r\n showZoom: true,\r\n showDrag: true,\r\n removeIcon: '',\r\n removeClass: 'btn btn-kv btn-default btn-outline-secondary',\r\n removeErrorClass: 'btn btn-kv btn-danger',\r\n removeTitle: 'Remove file',\r\n uploadIcon: '',\r\n uploadClass: 'btn btn-kv btn-default btn-outline-secondary',\r\n uploadTitle: 'Upload file',\r\n uploadRetryIcon: '',\r\n uploadRetryTitle: 'Retry upload',\r\n downloadIcon: '',\r\n downloadClass: 'btn btn-kv btn-default btn-outline-secondary',\r\n downloadTitle: 'Download file',\r\n zoomIcon: '',\r\n zoomClass: 'btn btn-kv btn-default btn-outline-secondary',\r\n zoomTitle: 'View Details',\r\n dragIcon: '',\r\n dragClass: 'text-info',\r\n dragTitle: 'Move / Rearrange',\r\n dragSettings: {},\r\n indicatorNew: '',\r\n indicatorSuccess: '',\r\n indicatorError: '',\r\n indicatorLoading: '',\r\n indicatorNewTitle: 'Not uploaded yet',\r\n indicatorSuccessTitle: 'Uploaded',\r\n indicatorErrorTitle: 'Upload Error',\r\n indicatorLoadingTitle: 'Uploading ...'\r\n }\r\n };\r\n $.each(self.defaults, function (key, setting) {\r\n if (key === 'allowedPreviewTypes') {\r\n if (self.allowedPreviewTypes === undefined) {\r\n self.allowedPreviewTypes = setting;\r\n }\r\n return;\r\n }\r\n self[key] = $.extend(true, {}, setting, self[key]);\r\n });\r\n self._initPreviewTemplates();\r\n },\r\n _initPreviewTemplates: function () {\r\n var self = this, cfg = self.defaults, tags = self.previewMarkupTags, tagBef, tagAft = tags.tagAfter;\r\n $.each(cfg.previewContentTemplates, function (key, value) {\r\n if ($h.isEmpty(self.previewTemplates[key])) {\r\n tagBef = tags.tagBefore2;\r\n if (key === 'generic' || key === 'image' || key === 'html' || key === 'text') {\r\n tagBef = tags.tagBefore1;\r\n }\r\n self.previewTemplates[key] = tagBef + value + tagAft;\r\n }\r\n });\r\n },\r\n _initPreviewCache: function () {\r\n var self = this;\r\n self.previewCache = {\r\n data: {},\r\n init: function () {\r\n var content = self.initialPreview;\r\n if (content.length > 0 && !$h.isArray(content)) {\r\n content = content.split(self.initialPreviewDelimiter);\r\n }\r\n self.previewCache.data = {\r\n content: content,\r\n config: self.initialPreviewConfig,\r\n tags: self.initialPreviewThumbTags\r\n };\r\n },\r\n count: function () {\r\n return !!self.previewCache.data && !!self.previewCache.data.content ?\r\n self.previewCache.data.content.length : 0;\r\n },\r\n get: function (i, isDisabled) {\r\n var ind = 'init_' + i, data = self.previewCache.data, config = data.config[i],\r\n content = data.content[i], previewId = self.previewInitId + '-' + ind, out, $tmp, cat, ftr,\r\n fname, ftype, frameClass, asData = $h.ifSet('previewAsData', config, self.initialPreviewAsData),\r\n parseTemplate = function (cat, dat, fn, ft, id, ftr, ind, fc, t) {\r\n fc = ' file-preview-initial ' + $h.SORT_CSS + (fc ? ' ' + fc : '');\r\n return self._generatePreviewTemplate(cat, dat, fn, ft, id, false, null, fc, ftr, ind, t);\r\n };\r\n if (!content) {\r\n return '';\r\n }\r\n isDisabled = isDisabled === undefined ? true : isDisabled;\r\n cat = $h.ifSet('type', config, self.initialPreviewFileType || 'generic');\r\n fname = $h.ifSet('filename', config, $h.ifSet('caption', config));\r\n ftype = $h.ifSet('filetype', config, cat);\r\n ftr = self.previewCache.footer(i, isDisabled, (config && config.size || null));\r\n frameClass = $h.ifSet('frameClass', config);\r\n if (asData) {\r\n out = parseTemplate(cat, content, fname, ftype, previewId, ftr, ind, frameClass);\r\n } else {\r\n out = parseTemplate('generic', content, fname, ftype, previewId, ftr, ind, frameClass, cat)\r\n .setTokens({'content': data.content[i]});\r\n }\r\n if (data.tags.length && data.tags[i]) {\r\n out = $h.replaceTags(out, data.tags[i]);\r\n }\r\n /** @namespace config.frameAttr */\r\n if (!$h.isEmpty(config) && !$h.isEmpty(config.frameAttr)) {\r\n $tmp = $(document.createElement('div')).html(out);\r\n $tmp.find('.file-preview-initial').attr(config.frameAttr);\r\n out = $tmp.html();\r\n $tmp.remove();\r\n }\r\n return out;\r\n },\r\n add: function (content, config, tags, append) {\r\n var data = self.previewCache.data, index;\r\n if (!$h.isArray(content)) {\r\n content = content.split(self.initialPreviewDelimiter);\r\n }\r\n if (append) {\r\n index = data.content.push(content) - 1;\r\n data.config[index] = config;\r\n data.tags[index] = tags;\r\n } else {\r\n index = content.length - 1;\r\n data.content = content;\r\n data.config = config;\r\n data.tags = tags;\r\n }\r\n self.previewCache.data = data;\r\n return index;\r\n },\r\n set: function (content, config, tags, append) {\r\n var data = self.previewCache.data, i, chk;\r\n if (!content || !content.length) {\r\n return;\r\n }\r\n if (!$h.isArray(content)) {\r\n content = content.split(self.initialPreviewDelimiter);\r\n }\r\n chk = content.filter(function (n) {\r\n return n !== null;\r\n });\r\n if (!chk.length) {\r\n return;\r\n }\r\n if (data.content === undefined) {\r\n data.content = [];\r\n }\r\n if (data.config === undefined) {\r\n data.config = [];\r\n }\r\n if (data.tags === undefined) {\r\n data.tags = [];\r\n }\r\n if (append) {\r\n for (i = 0; i < content.length; i++) {\r\n if (content[i]) {\r\n data.content.push(content[i]);\r\n }\r\n }\r\n for (i = 0; i < config.length; i++) {\r\n if (config[i]) {\r\n data.config.push(config[i]);\r\n }\r\n }\r\n for (i = 0; i < tags.length; i++) {\r\n if (tags[i]) {\r\n data.tags.push(tags[i]);\r\n }\r\n }\r\n } else {\r\n data.content = content;\r\n data.config = config;\r\n data.tags = tags;\r\n }\r\n self.previewCache.data = data;\r\n },\r\n unset: function (index) {\r\n var chk = self.previewCache.count();\r\n if (!chk) {\r\n return;\r\n }\r\n if (chk === 1) {\r\n self.previewCache.data.content = [];\r\n self.previewCache.data.config = [];\r\n self.previewCache.data.tags = [];\r\n self.initialPreview = [];\r\n self.initialPreviewConfig = [];\r\n self.initialPreviewThumbTags = [];\r\n return;\r\n }\r\n self.previewCache.data.content = $h.spliceArray(self.previewCache.data.content, index);\r\n self.previewCache.data.config = $h.spliceArray(self.previewCache.data.config, index);\r\n self.previewCache.data.tags = $h.spliceArray(self.previewCache.data.tags, index);\r\n },\r\n out: function () {\r\n var html = '', caption, len = self.previewCache.count(), i;\r\n if (len === 0) {\r\n return {content: '', caption: ''};\r\n }\r\n for (i = 0; i < len; i++) {\r\n html += self.previewCache.get(i);\r\n }\r\n caption = self._getMsgSelected(len);\r\n return {content: html, caption: caption};\r\n },\r\n footer: function (i, isDisabled, size) {\r\n var data = self.previewCache.data || {};\r\n if ($h.isEmpty(data.content)) {\r\n return '';\r\n }\r\n if ($h.isEmpty(data.config) || $h.isEmpty(data.config[i])) {\r\n data.config[i] = {};\r\n }\r\n isDisabled = isDisabled === undefined ? true : isDisabled;\r\n var config = data.config[i], caption = $h.ifSet('caption', config), a,\r\n width = $h.ifSet('width', config, 'auto'), url = $h.ifSet('url', config, false),\r\n key = $h.ifSet('key', config, null), fs = self.fileActionSettings,\r\n initPreviewShowDel = self.initialPreviewShowDelete || false,\r\n dUrl = config.downloadUrl || self.initialPreviewDownloadUrl || '',\r\n dFil = config.filename || config.caption || '',\r\n initPreviewShowDwl = !!(dUrl),\r\n sDel = $h.ifSet('showDelete', config, $h.ifSet('showDelete', fs, initPreviewShowDel)),\r\n sDwl = $h.ifSet('showDownload', config, $h.ifSet('showDownload', fs, initPreviewShowDwl)),\r\n sZm = $h.ifSet('showZoom', config, $h.ifSet('showZoom', fs, true)),\r\n sDrg = $h.ifSet('showDrag', config, $h.ifSet('showDrag', fs, true)),\r\n dis = (url === false) && isDisabled;\r\n sDwl = sDwl && config.downloadUrl !== false && !!dUrl;\r\n a = self._renderFileActions(false, sDwl, sDel, sZm, sDrg, dis, url, key, true, dUrl, dFil);\r\n return self._getLayoutTemplate('footer').setTokens({\r\n 'progress': self._renderThumbProgress(),\r\n 'actions': a,\r\n 'caption': caption,\r\n 'size': self._getSize(size),\r\n 'width': width,\r\n 'indicator': ''\r\n });\r\n }\r\n };\r\n self.previewCache.init();\r\n },\r\n _handler: function ($el, event, callback) {\r\n var self = this, ns = self.namespace, ev = event.split(' ').join(ns + ' ') + ns;\r\n if (!$el || !$el.length) {\r\n return;\r\n }\r\n $el.off(ev).on(ev, callback);\r\n },\r\n _log: function (msg) {\r\n var self = this, id = self.$element.attr('id');\r\n if (id) {\r\n msg = '\"' + id + '\": ' + msg;\r\n }\r\n if (typeof window.console.log !== \"undefined\") {\r\n window.console.log(msg);\r\n } else {\r\n window.alert(msg);\r\n }\r\n },\r\n _validate: function () {\r\n var self = this, status = self.$element.attr('type') === 'file';\r\n if (!status) {\r\n self._log('The input \"type\" must be set to \"file\" for initializing the \"bootstrap-fileinput\" plugin.');\r\n }\r\n return status;\r\n },\r\n _errorsExist: function () {\r\n var self = this, $err, $errList = self.$errorContainer.find('li');\r\n if ($errList.length) {\r\n return true;\r\n }\r\n $err = $(document.createElement('div')).html(self.$errorContainer.html());\r\n $err.find('.kv-error-close').remove();\r\n $err.find('ul').remove();\r\n return !!$.trim($err.text()).length;\r\n },\r\n _errorHandler: function (evt, caption) {\r\n var self = this, err = evt.target.error, showError = function (msg) {\r\n self._showError(msg.replace('{name}', caption));\r\n };\r\n /** @namespace err.NOT_FOUND_ERR */\r\n /** @namespace err.SECURITY_ERR */\r\n /** @namespace err.NOT_READABLE_ERR */\r\n if (err.code === err.NOT_FOUND_ERR) {\r\n showError(self.msgFileNotFound);\r\n } else if (err.code === err.SECURITY_ERR) {\r\n showError(self.msgFileSecured);\r\n } else if (err.code === err.NOT_READABLE_ERR) {\r\n showError(self.msgFileNotReadable);\r\n } else if (err.code === err.ABORT_ERR) {\r\n showError(self.msgFilePreviewAborted);\r\n } else {\r\n showError(self.msgFilePreviewError);\r\n }\r\n },\r\n _addError: function (msg) {\r\n var self = this, $error = self.$errorContainer;\r\n if (msg && $error.length) {\r\n $error.html(self.errorCloseButton + msg);\r\n self._handler($error.find('.kv-error-close'), 'click', function () {\r\n setTimeout(function() {\r\n if (self.showPreview && !self.getFrames().length) {\r\n self.clear();\r\n }\r\n $error.fadeOut('slow'); \r\n }, 10);\r\n });\r\n }\r\n },\r\n _setValidationError: function (css) {\r\n var self = this;\r\n css = (css ? css + ' ' : '') + 'has-error';\r\n self.$container.removeClass(css).addClass('has-error');\r\n $h.addCss(self.$captionContainer, 'is-invalid');\r\n },\r\n _resetErrors: function (fade) {\r\n var self = this, $error = self.$errorContainer;\r\n self.isError = false;\r\n self.$container.removeClass('has-error');\r\n self.$captionContainer.removeClass('is-invalid');\r\n $error.html('');\r\n if (fade) {\r\n $error.fadeOut('slow');\r\n } else {\r\n $error.hide();\r\n }\r\n },\r\n _showFolderError: function (folders) {\r\n var self = this, $error = self.$errorContainer, msg;\r\n if (!folders) {\r\n return;\r\n }\r\n msg = self.msgFoldersNotAllowed.replace('{n}', folders);\r\n self._addError(msg);\r\n self._setValidationError();\r\n $error.fadeIn(800);\r\n self._raise('filefoldererror', [folders, msg]);\r\n },\r\n _showUploadError: function (msg, params, event) {\r\n var self = this, $error = self.$errorContainer, ev = event || 'fileuploaderror', e = params && params.id ?\r\n '
  • ' + msg + '
  • ' : '
  • ' + msg + '
  • ';\r\n if ($error.find('ul').length === 0) {\r\n self._addError('
      ' + e + '
    ');\r\n } else {\r\n $error.find('ul').append(e);\r\n }\r\n $error.fadeIn(800);\r\n self._raise(ev, [params, msg]);\r\n self._setValidationError('file-input-new');\r\n return true;\r\n },\r\n _showError: function (msg, params, event) {\r\n var self = this, $error = self.$errorContainer, ev = event || 'fileerror';\r\n params = params || {};\r\n params.reader = self.reader;\r\n self._addError(msg);\r\n $error.fadeIn(800);\r\n self._raise(ev, [params, msg]);\r\n if (!self.isAjaxUpload) {\r\n self._clearFileInput();\r\n }\r\n self._setValidationError('file-input-new');\r\n self.$btnUpload.attr('disabled', true);\r\n return true;\r\n },\r\n _noFilesError: function (params) {\r\n var self = this, label = self.minFileCount > 1 ? self.filePlural : self.fileSingle,\r\n msg = self.msgFilesTooLess.replace('{n}', self.minFileCount).replace('{files}', label),\r\n $error = self.$errorContainer;\r\n self._addError(msg);\r\n self.isError = true;\r\n self._updateFileDetails(0);\r\n $error.fadeIn(800);\r\n self._raise('fileerror', [params, msg]);\r\n self._clearFileInput();\r\n self._setValidationError();\r\n },\r\n _parseError: function (operation, jqXHR, errorThrown, fileName) {\r\n /** @namespace jqXHR.responseJSON */\r\n var self = this, errMsg = $.trim(errorThrown + ''), textPre,\r\n text = jqXHR.responseJSON !== undefined && jqXHR.responseJSON.error !== undefined ?\r\n jqXHR.responseJSON.error : jqXHR.responseText;\r\n if (self.cancelling && self.msgUploadAborted) {\r\n errMsg = self.msgUploadAborted;\r\n }\r\n if (self.showAjaxErrorDetails && text) {\r\n text = $.trim(text.replace(/\\n\\s*\\n/g, '\\n'));\r\n textPre = text.length ? '
    ' + text + '
    ' : '';\r\n errMsg += errMsg ? textPre : text;\r\n }\r\n if (!errMsg) {\r\n errMsg = self.msgAjaxError.replace('{operation}', operation);\r\n }\r\n self.cancelling = false;\r\n return fileName ? '' + fileName + ': ' + errMsg : errMsg;\r\n },\r\n _parseFileType: function (type, name) {\r\n var self = this, isValid, vType, cat, i, types = self.allowedPreviewTypes || [];\r\n if (type === 'application/text-plain') {\r\n return 'text';\r\n }\r\n for (i = 0; i < types.length; i++) {\r\n cat = types[i];\r\n isValid = self.fileTypeSettings[cat];\r\n vType = isValid(type, name) ? cat : '';\r\n if (!$h.isEmpty(vType)) {\r\n return vType;\r\n }\r\n }\r\n return 'other';\r\n },\r\n _getPreviewIcon: function (fname) {\r\n var self = this, ext, out = null;\r\n if (fname && fname.indexOf('.') > -1) {\r\n ext = fname.split('.').pop();\r\n if (self.previewFileIconSettings) {\r\n out = self.previewFileIconSettings[ext] || self.previewFileIconSettings[ext.toLowerCase()] || null;\r\n }\r\n if (self.previewFileExtSettings) {\r\n $.each(self.previewFileExtSettings, function (key, func) {\r\n if (self.previewFileIconSettings[key] && func(ext)) {\r\n out = self.previewFileIconSettings[key];\r\n //noinspection UnnecessaryReturnStatementJS\r\n return;\r\n }\r\n });\r\n }\r\n }\r\n return out;\r\n },\r\n _parseFilePreviewIcon: function (content, fname) {\r\n var self = this, icn = self._getPreviewIcon(fname) || self.previewFileIcon, out = content;\r\n if (out.indexOf('{previewFileIcon}') > -1) {\r\n out = out.setTokens({'previewFileIconClass': self.previewFileIconClass, 'previewFileIcon': icn});\r\n }\r\n return out;\r\n },\r\n _raise: function (event, params) {\r\n var self = this, e = $.Event(event);\r\n if (params !== undefined) {\r\n self.$element.trigger(e, params);\r\n } else {\r\n self.$element.trigger(e);\r\n }\r\n if (e.isDefaultPrevented() || e.result === false) {\r\n return false;\r\n }\r\n switch (event) {\r\n // ignore these events\r\n case 'filebatchuploadcomplete':\r\n case 'filebatchuploadsuccess':\r\n case 'fileuploaded':\r\n case 'fileclear':\r\n case 'filecleared':\r\n case 'filereset':\r\n case 'fileerror':\r\n case 'filefoldererror':\r\n case 'fileuploaderror':\r\n case 'filebatchuploaderror':\r\n case 'filedeleteerror':\r\n case 'filecustomerror':\r\n case 'filesuccessremove':\r\n break;\r\n // receive data response via `filecustomerror` event`\r\n default:\r\n if (!self.ajaxAborted) {\r\n self.ajaxAborted = e.result;\r\n }\r\n break;\r\n }\r\n return true;\r\n },\r\n _listenFullScreen: function (isFullScreen) {\r\n var self = this, $modal = self.$modal, $btnFull, $btnBord;\r\n if (!$modal || !$modal.length) {\r\n return;\r\n }\r\n $btnFull = $modal && $modal.find('.btn-fullscreen');\r\n $btnBord = $modal && $modal.find('.btn-borderless');\r\n if (!$btnFull.length || !$btnBord.length) {\r\n return;\r\n }\r\n $btnFull.removeClass('active').attr('aria-pressed', 'false');\r\n $btnBord.removeClass('active').attr('aria-pressed', 'false');\r\n if (isFullScreen) {\r\n $btnFull.addClass('active').attr('aria-pressed', 'true');\r\n } else {\r\n $btnBord.addClass('active').attr('aria-pressed', 'true');\r\n }\r\n if ($modal.hasClass('file-zoom-fullscreen')) {\r\n self._maximizeZoomDialog();\r\n } else {\r\n if (isFullScreen) {\r\n self._maximizeZoomDialog();\r\n } else {\r\n $btnBord.removeClass('active').attr('aria-pressed', 'false');\r\n }\r\n }\r\n },\r\n _listen: function () {\r\n var self = this, $el = self.$element, $form = self.$form, $cont = self.$container, fullScreenEvents;\r\n self._handler($el, 'change', $.proxy(self._change, self));\r\n if (self.showBrowse) {\r\n self._handler(self.$btnFile, 'click', $.proxy(self._browse, self));\r\n }\r\n self._handler($cont.find('.fileinput-remove:not([disabled])'), 'click', $.proxy(self.clear, self));\r\n self._handler($cont.find('.fileinput-cancel'), 'click', $.proxy(self.cancel, self));\r\n self._initDragDrop();\r\n self._handler($form, 'reset', $.proxy(self.clear, self));\r\n if (!self.isAjaxUpload) {\r\n self._handler($form, 'submit', $.proxy(self._submitForm, self));\r\n }\r\n self._handler(self.$container.find('.fileinput-upload'), 'click', $.proxy(self._uploadClick, self));\r\n self._handler($(window), 'resize', function () {\r\n self._listenFullScreen(screen.width === window.innerWidth && screen.height === window.innerHeight);\r\n });\r\n fullScreenEvents = 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange';\r\n self._handler($(document), fullScreenEvents, function () {\r\n self._listenFullScreen($h.checkFullScreen());\r\n });\r\n self._autoFitContent();\r\n self._initClickable();\r\n },\r\n _autoFitContent: function () {\r\n var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,\r\n self = this, config = width < 400 ? (self.previewSettingsSmall || self.defaults.previewSettingsSmall) :\r\n (self.previewSettings || self.defaults.previewSettings), sel;\r\n $.each(config, function (cat, settings) {\r\n sel = '.file-preview-frame .file-preview-' + cat;\r\n self.$preview.find(sel + '.kv-preview-data,' + sel + ' .kv-preview-data').css(settings);\r\n });\r\n },\r\n _initClickable: function () {\r\n var self = this, $zone;\r\n if (!self.isClickable) {\r\n return;\r\n }\r\n $zone = self.isAjaxUpload ? self.$dropZone : self.$preview.find('.file-default-preview');\r\n $h.addCss($zone, 'clickable');\r\n $zone.attr('tabindex', -1);\r\n self._handler($zone, 'click', function (e) {\r\n var $tar = $(e.target);\r\n if (!$zone.find('.kv-fileinput-error:visible').length && \r\n (!$tar.parents('.file-preview-thumbnails').length || $tar.parents('.file-default-preview').length)) {\r\n self.$element.trigger('click');\r\n $zone.blur();\r\n }\r\n });\r\n },\r\n _initDragDrop: function () {\r\n var self = this, $zone = self.$dropZone;\r\n if (self.isAjaxUpload && self.dropZoneEnabled && self.showPreview) {\r\n self._handler($zone, 'dragenter dragover', $.proxy(self._zoneDragEnter, self));\r\n self._handler($zone, 'dragleave', $.proxy(self._zoneDragLeave, self));\r\n self._handler($zone, 'drop', $.proxy(self._zoneDrop, self));\r\n self._handler($(document), 'dragenter dragover drop', self._zoneDragDropInit);\r\n }\r\n },\r\n _zoneDragDropInit: function (e) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n },\r\n _zoneDragEnter: function (e) {\r\n var self = this, hasFiles = $.inArray('Files', e.originalEvent.dataTransfer.types) > -1;\r\n self._zoneDragDropInit(e);\r\n if (self.isDisabled || !hasFiles) {\r\n e.originalEvent.dataTransfer.effectAllowed = 'none';\r\n e.originalEvent.dataTransfer.dropEffect = 'none';\r\n return;\r\n }\r\n $h.addCss(self.$dropZone, 'file-highlighted');\r\n },\r\n _zoneDragLeave: function (e) {\r\n var self = this;\r\n self._zoneDragDropInit(e);\r\n if (self.isDisabled) {\r\n return;\r\n }\r\n self.$dropZone.removeClass('file-highlighted');\r\n },\r\n _zoneDrop: function (e) {\r\n var self = this;\r\n e.preventDefault();\r\n /** @namespace e.originalEvent.dataTransfer */\r\n if (self.isDisabled || $h.isEmpty(e.originalEvent.dataTransfer.files)) {\r\n return;\r\n }\r\n self._change(e, 'dragdrop');\r\n self.$dropZone.removeClass('file-highlighted');\r\n },\r\n _uploadClick: function (e) {\r\n var self = this, $btn = self.$container.find('.fileinput-upload'), $form,\r\n isEnabled = !$btn.hasClass('disabled') && $h.isEmpty($btn.attr('disabled'));\r\n if (e && e.isDefaultPrevented()) {\r\n return;\r\n }\r\n if (!self.isAjaxUpload) {\r\n if (isEnabled && $btn.attr('type') !== 'submit') {\r\n $form = $btn.closest('form');\r\n // downgrade to normal form submit if possible\r\n if ($form.length) {\r\n $form.trigger('submit');\r\n }\r\n e.preventDefault();\r\n }\r\n return;\r\n }\r\n e.preventDefault();\r\n if (isEnabled) {\r\n self.upload();\r\n }\r\n },\r\n _submitForm: function () {\r\n var self = this;\r\n return self._isFileSelectionValid() && !self._abort({});\r\n },\r\n _clearPreview: function () {\r\n var self = this, $p = self.$preview,\r\n $thumbs = self.showUploadedThumbs ? self.getFrames(':not(.file-preview-success)') : self.getFrames();\r\n $thumbs.each(function () {\r\n var $thumb = $(this);\r\n $thumb.remove();\r\n $h.cleanZoomCache($p.find('#zoom-' + $thumb.attr('id')));\r\n });\r\n if (!self.getFrames().length || !self.showPreview) {\r\n self._resetUpload();\r\n }\r\n self._validateDefaultPreview();\r\n },\r\n _initSortable: function () {\r\n var self = this, $el = self.$preview, settings, selector = '.' + $h.SORT_CSS;\r\n if (!window.KvSortable || $el.find(selector).length === 0) {\r\n return;\r\n }\r\n //noinspection JSUnusedGlobalSymbols\r\n settings = {\r\n handle: '.drag-handle-init',\r\n dataIdAttr: 'data-preview-id',\r\n scroll: false,\r\n draggable: selector,\r\n onSort: function (e) {\r\n var oldIndex = e.oldIndex, newIndex = e.newIndex, $frame, $dragEl, i = 0;\r\n self.initialPreview = $h.moveArray(self.initialPreview, oldIndex, newIndex);\r\n self.initialPreviewConfig = $h.moveArray(self.initialPreviewConfig, oldIndex, newIndex);\r\n self.previewCache.init();\r\n self.getFrames('.file-preview-initial').each(function() {\r\n $(this).attr('data-fileindex', 'init_' + i);\r\n i++;\r\n });\r\n self._raise('filesorted', {\r\n previewId: $(e.item).attr('id'),\r\n 'oldIndex': oldIndex,\r\n 'newIndex': newIndex,\r\n stack: self.initialPreviewConfig\r\n });\r\n }\r\n };\r\n if ($el.data('kvsortable')) {\r\n $el.kvsortable('destroy');\r\n }\r\n $.extend(true, settings, self.fileActionSettings.dragSettings);\r\n $el.kvsortable(settings);\r\n },\r\n _setPreviewContent: function (content) {\r\n var self = this;\r\n self.$preview.html(content);\r\n self._autoFitContent();\r\n },\r\n _initPreview: function (isInit) {\r\n var self = this, cap = self.initialCaption || '', out;\r\n if (!self.previewCache.count()) {\r\n self._clearPreview();\r\n if (isInit) {\r\n self._setCaption(cap);\r\n } else {\r\n self._initCaption();\r\n }\r\n return;\r\n }\r\n out = self.previewCache.out();\r\n cap = isInit && self.initialCaption ? self.initialCaption : out.caption;\r\n self._setPreviewContent(out.content);\r\n self._setInitThumbAttr();\r\n self._setCaption(cap);\r\n self._initSortable();\r\n if (!$h.isEmpty(out.content)) {\r\n self.$container.removeClass('file-input-new');\r\n }\r\n },\r\n _getZoomButton: function (type) {\r\n var self = this, label = self.previewZoomButtonIcons[type], css = self.previewZoomButtonClasses[type],\r\n title = ' title=\"' + (self.previewZoomButtonTitles[type] || '') + '\" ',\r\n params = title + (type === 'close' ? ' data-dismiss=\"modal\" aria-hidden=\"true\"' : '');\r\n if (type === 'fullscreen' || type === 'borderless' || type === 'toggleheader') {\r\n params += ' data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\"';\r\n }\r\n return '';\r\n },\r\n _getModalContent: function () {\r\n var self = this;\r\n return self._getLayoutTemplate('modal').setTokens({\r\n 'rtl': self.rtl ? ' kv-rtl' : '',\r\n 'zoomFrameClass': self.frameClass,\r\n 'heading': self.msgZoomModalHeading,\r\n 'prev': self._getZoomButton('prev'),\r\n 'next': self._getZoomButton('next'),\r\n 'toggleheader': self._getZoomButton('toggleheader'),\r\n 'fullscreen': self._getZoomButton('fullscreen'),\r\n 'borderless': self._getZoomButton('borderless'),\r\n 'close': self._getZoomButton('close')\r\n });\r\n },\r\n _listenModalEvent: function (event) {\r\n var self = this, $modal = self.$modal, getParams = function (e) {\r\n return {\r\n sourceEvent: e,\r\n previewId: $modal.data('previewId'),\r\n modal: $modal\r\n };\r\n };\r\n $modal.on(event + '.bs.modal', function (e) {\r\n var $btnFull = $modal.find('.btn-fullscreen'), $btnBord = $modal.find('.btn-borderless');\r\n self._raise('filezoom' + event, getParams(e));\r\n if (event === 'shown') {\r\n $btnBord.removeClass('active').attr('aria-pressed', 'false');\r\n $btnFull.removeClass('active').attr('aria-pressed', 'false');\r\n if ($modal.hasClass('file-zoom-fullscreen')) {\r\n self._maximizeZoomDialog();\r\n if ($h.checkFullScreen()) {\r\n $btnFull.addClass('active').attr('aria-pressed', 'true');\r\n } else {\r\n $btnBord.addClass('active').attr('aria-pressed', 'true');\r\n }\r\n }\r\n }\r\n });\r\n },\r\n _initZoom: function () {\r\n var self = this, $dialog, modalMain = self._getLayoutTemplate('modalMain'), modalId = '#' + $h.MODAL_ID;\r\n if (!self.showPreview) {\r\n return;\r\n }\r\n self.$modal = $(modalId);\r\n if (!self.$modal || !self.$modal.length) {\r\n $dialog = $(document.createElement('div')).html(modalMain).insertAfter(self.$container);\r\n self.$modal = $(modalId).insertBefore($dialog);\r\n $dialog.remove();\r\n }\r\n $h.initModal(self.$modal);\r\n self.$modal.html(self._getModalContent());\r\n $.each($h.MODAL_EVENTS, function (key, event) {\r\n self._listenModalEvent(event);\r\n });\r\n },\r\n _initZoomButtons: function () {\r\n var self = this, previewId = self.$modal.data('previewId') || '', $first, $last,\r\n thumbs = self.getFrames().toArray(), len = thumbs.length, $prev = self.$modal.find('.btn-prev'),\r\n $next = self.$modal.find('.btn-next');\r\n if (thumbs.length < 2) {\r\n $prev.hide();\r\n $next.hide();\r\n return;\r\n } else {\r\n $prev.show();\r\n $next.show();\r\n }\r\n if (!len) {\r\n return;\r\n }\r\n $first = $(thumbs[0]);\r\n $last = $(thumbs[len - 1]);\r\n $prev.removeAttr('disabled');\r\n $next.removeAttr('disabled');\r\n if ($first.length && $first.attr('id') === previewId) {\r\n $prev.attr('disabled', true);\r\n }\r\n if ($last.length && $last.attr('id') === previewId) {\r\n $next.attr('disabled', true);\r\n }\r\n },\r\n _maximizeZoomDialog: function () {\r\n var self = this, $modal = self.$modal, $head = $modal.find('.modal-header:visible'),\r\n $foot = $modal.find('.modal-footer:visible'), $body = $modal.find('.modal-body'),\r\n h = $(window).height(), diff = 0;\r\n $modal.addClass('file-zoom-fullscreen');\r\n if ($head && $head.length) {\r\n h -= $head.outerHeight(true);\r\n }\r\n if ($foot && $foot.length) {\r\n h -= $foot.outerHeight(true);\r\n }\r\n if ($body && $body.length) {\r\n diff = $body.outerHeight(true) - $body.height();\r\n h -= diff;\r\n }\r\n $modal.find('.kv-zoom-body').height(h);\r\n },\r\n _resizeZoomDialog: function (fullScreen) {\r\n var self = this, $modal = self.$modal, $btnFull = $modal.find('.btn-fullscreen'),\r\n $btnBord = $modal.find('.btn-borderless');\r\n if ($modal.hasClass('file-zoom-fullscreen')) {\r\n $h.toggleFullScreen(false);\r\n if (!fullScreen) {\r\n if (!$btnFull.hasClass('active')) {\r\n $modal.removeClass('file-zoom-fullscreen');\r\n self.$modal.find('.kv-zoom-body').css('height', self.zoomModalHeight);\r\n } else {\r\n $btnFull.removeClass('active').attr('aria-pressed', 'false');\r\n }\r\n } else {\r\n if (!$btnFull.hasClass('active')) {\r\n $modal.removeClass('file-zoom-fullscreen');\r\n self._resizeZoomDialog(true);\r\n if ($btnBord.hasClass('active')) {\r\n $btnBord.removeClass('active').attr('aria-pressed', 'false');\r\n }\r\n }\r\n }\r\n } else {\r\n if (!fullScreen) {\r\n self._maximizeZoomDialog();\r\n return;\r\n }\r\n $h.toggleFullScreen(true);\r\n }\r\n $modal.focus();\r\n },\r\n _setZoomContent: function ($frame, animate) {\r\n var self = this, $content, tmplt, body, title, $body, $dataEl, config, pid = $frame.attr('id'),\r\n $modal = self.$modal, $prev = $modal.find('.btn-prev'), $next = $modal.find('.btn-next'), $tmp,\r\n $btnFull = $modal.find('.btn-fullscreen'), $btnBord = $modal.find('.btn-borderless'), cap, size,\r\n $btnTogh = $modal.find('.btn-toggleheader'), $zoomPreview = self.$preview.find('#zoom-' + pid);\r\n tmplt = $zoomPreview.attr('data-template') || 'generic';\r\n $content = $zoomPreview.find('.kv-file-content');\r\n body = $content.length ? $content.html() : '';\r\n cap = $frame.data('caption') || '';\r\n size = $frame.data('size') || '';\r\n title = cap + ' ' + size;\r\n $modal.find('.kv-zoom-title').attr('title', $('
    ').html(title).text()).html(title);\r\n $body = $modal.find('.kv-zoom-body');\r\n $modal.removeClass('kv-single-content');\r\n if (animate) {\r\n $tmp = $body.addClass('file-thumb-loading').clone().insertAfter($body);\r\n $body.html(body).hide();\r\n $tmp.fadeOut('fast', function () {\r\n $body.fadeIn('fast', function () {\r\n $body.removeClass('file-thumb-loading');\r\n });\r\n $tmp.remove();\r\n });\r\n } else {\r\n $body.html(body);\r\n }\r\n config = self.previewZoomSettings[tmplt];\r\n if (config) {\r\n $dataEl = $body.find('.kv-preview-data');\r\n $h.addCss($dataEl, 'file-zoom-detail');\r\n $.each(config, function (key, value) {\r\n $dataEl.css(key, value);\r\n if (($dataEl.attr('width') && key === 'width') || ($dataEl.attr('height') && key === 'height')) {\r\n $dataEl.removeAttr(key);\r\n }\r\n });\r\n }\r\n $modal.data('previewId', pid);\r\n var $img = $body.find('img');\r\n if ($img.length) {\r\n $h.adjustOrientedImage($img, true);\r\n }\r\n self._handler($prev, 'click', function () {\r\n self._zoomSlideShow('prev', pid);\r\n });\r\n self._handler($next, 'click', function () {\r\n self._zoomSlideShow('next', pid);\r\n });\r\n self._handler($btnFull, 'click', function () {\r\n self._resizeZoomDialog(true);\r\n });\r\n self._handler($btnBord, 'click', function () {\r\n self._resizeZoomDialog(false);\r\n });\r\n self._handler($btnTogh, 'click', function () {\r\n var $header = $modal.find('.modal-header'), $floatBar = $modal.find('.modal-body .floating-buttons'),\r\n ht, $actions = $header.find('.kv-zoom-actions'), resize = function (height) {\r\n var $body = self.$modal.find('.kv-zoom-body'), h = self.zoomModalHeight;\r\n if ($modal.hasClass('file-zoom-fullscreen')) {\r\n h = $body.outerHeight(true);\r\n if (!height) {\r\n h = h - $header.outerHeight(true);\r\n }\r\n }\r\n $body.css('height', height ? h + height : h);\r\n };\r\n if ($header.is(':visible')) {\r\n ht = $header.outerHeight(true);\r\n $header.slideUp('slow', function () {\r\n $actions.find('.btn').appendTo($floatBar);\r\n resize(ht);\r\n });\r\n } else {\r\n $floatBar.find('.btn').appendTo($actions);\r\n $header.slideDown('slow', function () {\r\n resize();\r\n });\r\n }\r\n $modal.focus();\r\n });\r\n self._handler($modal, 'keydown', function (e) {\r\n var key = e.which || e.keyCode;\r\n if (key === 37 && !$prev.attr('disabled')) {\r\n self._zoomSlideShow('prev', pid);\r\n }\r\n if (key === 39 && !$next.attr('disabled')) {\r\n self._zoomSlideShow('next', pid);\r\n }\r\n });\r\n },\r\n _zoomPreview: function ($btn) {\r\n var self = this, $frame, $modal = self.$modal;\r\n if (!$btn.length) {\r\n throw 'Cannot zoom to detailed preview!';\r\n }\r\n $h.initModal($modal);\r\n $modal.html(self._getModalContent());\r\n $frame = $btn.closest($h.FRAMES);\r\n self._setZoomContent($frame);\r\n $modal.modal('show');\r\n self._initZoomButtons();\r\n },\r\n _zoomSlideShow: function (dir, previewId) {\r\n var self = this, $btn = self.$modal.find('.kv-zoom-actions .btn-' + dir), $targFrame, i,\r\n thumbs = self.getFrames().toArray(), len = thumbs.length, out;\r\n if ($btn.attr('disabled')) {\r\n return;\r\n }\r\n for (i = 0; i < len; i++) {\r\n if ($(thumbs[i]).attr('id') === previewId) {\r\n out = dir === 'prev' ? i - 1 : i + 1;\r\n break;\r\n }\r\n }\r\n if (out < 0 || out >= len || !thumbs[out]) {\r\n return;\r\n }\r\n $targFrame = $(thumbs[out]);\r\n if ($targFrame.length) {\r\n self._setZoomContent($targFrame, true);\r\n }\r\n self._initZoomButtons();\r\n self._raise('filezoom' + dir, {'previewId': previewId, modal: self.$modal});\r\n },\r\n _initZoomButton: function () {\r\n var self = this;\r\n self.$preview.find('.kv-file-zoom').each(function () {\r\n var $el = $(this);\r\n self._handler($el, 'click', function () {\r\n self._zoomPreview($el);\r\n });\r\n });\r\n },\r\n _clearObjects: function ($el) {\r\n $el.find('video audio').each(function () {\r\n this.pause();\r\n $(this).remove();\r\n });\r\n $el.find('img object div').each(function () {\r\n $(this).remove();\r\n });\r\n },\r\n _clearFileInput: function () {\r\n var self = this, $el = self.$element, $srcFrm, $tmpFrm, $tmpEl;\r\n self.fileInputCleared = true;\r\n if ($h.isEmpty($el.val())) {\r\n return;\r\n }\r\n // Fix for IE ver < 11, that does not clear file inputs. Requires a sequence of steps to prevent IE\r\n // crashing but still allow clearing of the file input.\r\n if (self.isIE9 || self.isIE10) {\r\n $srcFrm = $el.closest('form');\r\n $tmpFrm = $(document.createElement('form'));\r\n $tmpEl = $(document.createElement('div'));\r\n $el.before($tmpEl);\r\n if ($srcFrm.length) {\r\n $srcFrm.after($tmpFrm);\r\n } else {\r\n $tmpEl.after($tmpFrm);\r\n }\r\n $tmpFrm.append($el).trigger('reset');\r\n $tmpEl.before($el).remove();\r\n $tmpFrm.remove();\r\n } else { // normal input clear behavior for other sane browsers\r\n $el.val('');\r\n }\r\n },\r\n _resetUpload: function () {\r\n var self = this;\r\n self.uploadCache = {content: [], config: [], tags: [], append: true};\r\n self.uploadCount = 0;\r\n self.uploadStatus = {};\r\n self.uploadLog = [];\r\n self.uploadAsyncCount = 0;\r\n self.loadedImages = [];\r\n self.totalImagesCount = 0;\r\n self.$btnUpload.removeAttr('disabled');\r\n self._setProgress(0);\r\n self.$progress.hide();\r\n self._resetErrors(false);\r\n self.ajaxAborted = false;\r\n self.ajaxRequests = [];\r\n self._resetCanvas();\r\n self.cacheInitialPreview = {};\r\n if (self.overwriteInitial) {\r\n self.initialPreview = [];\r\n self.initialPreviewConfig = [];\r\n self.initialPreviewThumbTags = [];\r\n self.previewCache.data = {\r\n content: [],\r\n config: [],\r\n tags: []\r\n };\r\n }\r\n },\r\n _resetCanvas: function () {\r\n var self = this;\r\n if (self.canvas && self.imageCanvasContext) {\r\n self.imageCanvasContext.clearRect(0, 0, self.canvas.width, self.canvas.height);\r\n }\r\n },\r\n _hasInitialPreview: function () {\r\n var self = this;\r\n return !self.overwriteInitial && self.previewCache.count();\r\n },\r\n _resetPreview: function () {\r\n var self = this, out, cap;\r\n if (self.previewCache.count()) {\r\n out = self.previewCache.out();\r\n self._setPreviewContent(out.content);\r\n self._setInitThumbAttr();\r\n cap = self.initialCaption ? self.initialCaption : out.caption;\r\n self._setCaption(cap);\r\n } else {\r\n self._clearPreview();\r\n self._initCaption();\r\n }\r\n if (self.showPreview) {\r\n self._initZoom();\r\n self._initSortable();\r\n }\r\n },\r\n _clearDefaultPreview: function () {\r\n var self = this;\r\n self.$preview.find('.file-default-preview').remove();\r\n },\r\n _validateDefaultPreview: function () {\r\n var self = this;\r\n if (!self.showPreview || $h.isEmpty(self.defaultPreviewContent)) {\r\n return;\r\n }\r\n self._setPreviewContent('
    ' + self.defaultPreviewContent + '
    ');\r\n self.$container.removeClass('file-input-new');\r\n self._initClickable();\r\n },\r\n _resetPreviewThumbs: function (isAjax) {\r\n var self = this, out;\r\n if (isAjax) {\r\n self._clearPreview();\r\n self.clearStack();\r\n return;\r\n }\r\n if (self._hasInitialPreview()) {\r\n out = self.previewCache.out();\r\n self._setPreviewContent(out.content);\r\n self._setInitThumbAttr();\r\n self._setCaption(out.caption);\r\n self._initPreviewActions();\r\n } else {\r\n self._clearPreview();\r\n }\r\n },\r\n _getLayoutTemplate: function (t) {\r\n var self = this, template = self.layoutTemplates[t];\r\n if ($h.isEmpty(self.customLayoutTags)) {\r\n return template;\r\n }\r\n return $h.replaceTags(template, self.customLayoutTags);\r\n },\r\n _getPreviewTemplate: function (t) {\r\n var self = this, template = self.previewTemplates[t];\r\n if ($h.isEmpty(self.customPreviewTags)) {\r\n return template;\r\n }\r\n return $h.replaceTags(template, self.customPreviewTags);\r\n },\r\n _getOutData: function (jqXHR, responseData, filesData) {\r\n var self = this;\r\n jqXHR = jqXHR || {};\r\n responseData = responseData || {};\r\n filesData = filesData || self.filestack.slice(0) || {};\r\n return {\r\n form: self.formdata,\r\n files: filesData,\r\n filenames: self.filenames,\r\n filescount: self.getFilesCount(),\r\n extra: self._getExtraData(),\r\n response: responseData,\r\n reader: self.reader,\r\n jqXHR: jqXHR\r\n };\r\n },\r\n _getMsgSelected: function (n) {\r\n var self = this, strFiles = n === 1 ? self.fileSingle : self.filePlural;\r\n return n > 0 ? self.msgSelected.replace('{n}', n).replace('{files}', strFiles) : self.msgNoFilesSelected;\r\n },\r\n _getFrame: function (id) {\r\n var self = this, $frame = $('#' + id);\r\n if (!$frame.length) {\r\n self._log('Invalid thumb frame with id: \"' + id + '\".');\r\n return null;\r\n }\r\n return $frame;\r\n },\r\n _getThumbs: function (css) {\r\n css = css || '';\r\n return this.getFrames(':not(.file-preview-initial)' + css);\r\n },\r\n _getExtraData: function (previewId, index) {\r\n var self = this, data = self.uploadExtraData;\r\n if (typeof self.uploadExtraData === \"function\") {\r\n data = self.uploadExtraData(previewId, index);\r\n }\r\n return data;\r\n },\r\n _initXhr: function (xhrobj, previewId, fileCount) {\r\n var self = this;\r\n if (xhrobj.upload) {\r\n xhrobj.upload.addEventListener('progress', function (event) {\r\n var pct = 0, total = event.total, position = event.loaded || event.position;\r\n /** @namespace event.lengthComputable */\r\n if (event.lengthComputable) {\r\n pct = Math.floor(position / total * 100);\r\n }\r\n if (previewId) {\r\n self._setAsyncUploadStatus(previewId, pct, fileCount);\r\n } else {\r\n self._setProgress(pct);\r\n }\r\n }, false);\r\n }\r\n return xhrobj;\r\n },\r\n _mergeAjaxCallback: function (funcName, srcFunc, type) {\r\n var self = this, settings = self.ajaxSettings, flag = self.mergeAjaxCallbacks, targFunc;\r\n if (type === 'delete') {\r\n settings = self.ajaxDeleteSettings;\r\n flag = self.mergeAjaxDeleteCallbacks;\r\n }\r\n targFunc = settings[funcName];\r\n if (flag && typeof targFunc === \"function\") {\r\n if (flag === 'before') {\r\n settings[funcName] = function () {\r\n targFunc.apply(this, arguments);\r\n srcFunc.apply(this, arguments);\r\n };\r\n } else {\r\n settings[funcName] = function () {\r\n srcFunc.apply(this, arguments);\r\n targFunc.apply(this, arguments);\r\n };\r\n }\r\n } else {\r\n settings[funcName] = srcFunc;\r\n }\r\n if (type === 'delete') {\r\n self.ajaxDeleteSettings = settings;\r\n } else {\r\n self.ajaxSettings = settings;\r\n }\r\n },\r\n _ajaxSubmit: function (fnBefore, fnSuccess, fnComplete, fnError, previewId, index) {\r\n var self = this, settings;\r\n if (!self._raise('filepreajax', [previewId, index])) {\r\n return;\r\n }\r\n self._uploadExtra(previewId, index);\r\n self._mergeAjaxCallback('beforeSend', fnBefore);\r\n self._mergeAjaxCallback('success', fnSuccess);\r\n self._mergeAjaxCallback('complete', fnComplete);\r\n self._mergeAjaxCallback('error', fnError);\r\n settings = $.extend(true, {}, {\r\n xhr: function () {\r\n var xhrobj = $.ajaxSettings.xhr();\r\n return self._initXhr(xhrobj, previewId, self.getFileStack().length);\r\n },\r\n url: index && self.uploadUrlThumb ? self.uploadUrlThumb : self.uploadUrl,\r\n type: 'POST',\r\n dataType: 'json',\r\n data: self.formdata,\r\n cache: false,\r\n processData: false,\r\n contentType: false\r\n }, self.ajaxSettings);\r\n self.ajaxRequests.push($.ajax(settings));\r\n },\r\n _mergeArray: function (prop, content) {\r\n var self = this, arr1 = $h.cleanArray(self[prop]), arr2 = $h.cleanArray(content);\r\n self[prop] = arr1.concat(arr2);\r\n },\r\n _initUploadSuccess: function (out, $thumb, allFiles) {\r\n var self = this, append, data, index, $div, $newCache, content, config, tags, i;\r\n if (!self.showPreview || typeof out !== 'object' || $.isEmptyObject(out)) {\r\n return;\r\n }\r\n if (out.initialPreview !== undefined && out.initialPreview.length > 0) {\r\n self.hasInitData = true;\r\n content = out.initialPreview || [];\r\n config = out.initialPreviewConfig || [];\r\n tags = out.initialPreviewThumbTags || [];\r\n append = out.append === undefined || out.append;\r\n if (content.length > 0 && !$h.isArray(content)) {\r\n content = content.split(self.initialPreviewDelimiter);\r\n }\r\n self._mergeArray('initialPreview', content);\r\n self._mergeArray('initialPreviewConfig', config);\r\n self._mergeArray('initialPreviewThumbTags', tags);\r\n if ($thumb !== undefined) {\r\n if (!allFiles) {\r\n index = self.previewCache.add(content, config[0], tags[0], append);\r\n data = self.previewCache.get(index, false);\r\n $div = $(document.createElement('div')).html(data).hide().insertAfter($thumb);\r\n $newCache = $div.find('.kv-zoom-cache');\r\n if ($newCache && $newCache.length) {\r\n $newCache.insertAfter($thumb);\r\n }\r\n $thumb.fadeOut('slow', function () {\r\n var $newThumb = $div.find('.file-preview-frame');\r\n if ($newThumb && $newThumb.length) {\r\n $newThumb.insertBefore($thumb).fadeIn('slow').css('display:inline-block');\r\n }\r\n self._initPreviewActions();\r\n self._clearFileInput();\r\n $h.cleanZoomCache(self.$preview.find('#zoom-' + $thumb.attr('id')));\r\n $thumb.remove();\r\n $div.remove();\r\n self._initSortable();\r\n });\r\n } else {\r\n i = $thumb.attr('data-fileindex');\r\n self.uploadCache.content[i] = content[0];\r\n self.uploadCache.config[i] = config[0] || [];\r\n self.uploadCache.tags[i] = tags[0] || [];\r\n self.uploadCache.append = append;\r\n }\r\n } else {\r\n self.previewCache.set(content, config, tags, append);\r\n self._initPreview();\r\n self._initPreviewActions();\r\n }\r\n }\r\n },\r\n _initSuccessThumbs: function () {\r\n var self = this;\r\n if (!self.showPreview) {\r\n return;\r\n }\r\n self._getThumbs($h.FRAMES + '.file-preview-success').each(function () {\r\n var $thumb = $(this), $preview = self.$preview, $remove = $thumb.find('.kv-file-remove');\r\n $remove.removeAttr('disabled');\r\n self._handler($remove, 'click', function () {\r\n var id = $thumb.attr('id'),\r\n out = self._raise('filesuccessremove', [id, $thumb.attr('data-fileindex')]);\r\n $h.cleanMemory($thumb);\r\n if (out === false) {\r\n return;\r\n }\r\n $thumb.fadeOut('slow', function () {\r\n $h.cleanZoomCache($preview.find('#zoom-' + id));\r\n $thumb.remove();\r\n if (!self.getFrames().length) {\r\n self.reset();\r\n }\r\n });\r\n });\r\n });\r\n },\r\n _checkAsyncComplete: function () {\r\n var self = this, previewId, i;\r\n for (i = 0; i < self.filestack.length; i++) {\r\n if (self.filestack[i]) {\r\n previewId = self.previewInitId + \"-\" + i;\r\n if ($.inArray(previewId, self.uploadLog) === -1) {\r\n return false;\r\n }\r\n }\r\n }\r\n return (self.uploadAsyncCount === self.uploadLog.length);\r\n },\r\n _uploadExtra: function (previewId, index) {\r\n var self = this, data = self._getExtraData(previewId, index);\r\n if (data.length === 0) {\r\n return;\r\n }\r\n $.each(data, function (key, value) {\r\n self.formdata.append(key, value);\r\n });\r\n },\r\n _uploadSingle: function (i, isBatch) {\r\n var self = this, total = self.getFileStack().length, formdata = new FormData(), outData,\r\n previewId = self.previewInitId + \"-\" + i, $thumb, chkComplete, $btnUpload, $btnDelete,\r\n hasPostData = self.filestack.length > 0 || !$.isEmptyObject(self.uploadExtraData), uploadFailed,\r\n $prog = $('#' + previewId).find('.file-thumb-progress'), fnBefore, fnSuccess, fnComplete, fnError,\r\n updateUploadLog, params = {id: previewId, index: i};\r\n self.formdata = formdata;\r\n if (self.showPreview) {\r\n $thumb = $('#' + previewId + ':not(.file-preview-initial)');\r\n $btnUpload = $thumb.find('.kv-file-upload');\r\n $btnDelete = $thumb.find('.kv-file-remove');\r\n $prog.show();\r\n }\r\n if (total === 0 || !hasPostData || ($btnUpload && $btnUpload.hasClass('disabled')) || self._abort(params)) {\r\n return;\r\n }\r\n updateUploadLog = function (i, previewId) {\r\n if (!uploadFailed) {\r\n self.updateStack(i, undefined);\r\n }\r\n self.uploadLog.push(previewId);\r\n if (self._checkAsyncComplete()) {\r\n self.fileBatchCompleted = true;\r\n }\r\n };\r\n chkComplete = function () {\r\n var u = self.uploadCache, $initThumbs, i, j, len = 0, data = self.cacheInitialPreview;\r\n if (!self.fileBatchCompleted) {\r\n return;\r\n }\r\n if (data && data.content) {\r\n len = data.content.length;\r\n }\r\n setTimeout(function () {\r\n var triggerReset = self.getFileStack(true).length === 0;\r\n if (self.showPreview) {\r\n self.previewCache.set(u.content, u.config, u.tags, u.append);\r\n if (len) {\r\n for (i = 0; i < u.content.length; i++) {\r\n j = i + len;\r\n data.content[j] = u.content[i];\r\n //noinspection JSUnresolvedVariable\r\n if (data.config.length) {\r\n data.config[j] = u.config[i];\r\n }\r\n if (data.tags.length) {\r\n data.tags[j] = u.tags[i];\r\n }\r\n }\r\n self.initialPreview = $h.cleanArray(data.content);\r\n self.initialPreviewConfig = $h.cleanArray(data.config);\r\n self.initialPreviewThumbTags = $h.cleanArray(data.tags);\r\n } else {\r\n self.initialPreview = u.content;\r\n self.initialPreviewConfig = u.config;\r\n self.initialPreviewThumbTags = u.tags;\r\n }\r\n self.cacheInitialPreview = {};\r\n if (self.hasInitData) {\r\n self._initPreview();\r\n self._initPreviewActions();\r\n }\r\n }\r\n self.unlock(triggerReset);\r\n if (triggerReset) {\r\n self._clearFileInput();\r\n }\r\n $initThumbs = self.$preview.find('.file-preview-initial');\r\n if (self.uploadAsync && $initThumbs.length) {\r\n $h.addCss($initThumbs, $h.SORT_CSS);\r\n self._initSortable();\r\n }\r\n self._raise('filebatchuploadcomplete', [self.filestack, self._getExtraData()]);\r\n self.uploadCount = 0;\r\n self.uploadStatus = {};\r\n self.uploadLog = [];\r\n self._setProgress(101);\r\n self.ajaxAborted = false;\r\n }, 100);\r\n };\r\n fnBefore = function (jqXHR) {\r\n outData = self._getOutData(jqXHR);\r\n self.fileBatchCompleted = false;\r\n if (!isBatch) {\r\n self.ajaxAborted = false;\r\n }\r\n if (self.showPreview) {\r\n if (!$thumb.hasClass('file-preview-success')) {\r\n self._setThumbStatus($thumb, 'Loading');\r\n $h.addCss($thumb, 'file-uploading');\r\n }\r\n $btnUpload.attr('disabled', true);\r\n $btnDelete.attr('disabled', true);\r\n }\r\n if (!isBatch) {\r\n self.lock();\r\n }\r\n self._raise('filepreupload', [outData, previewId, i]);\r\n $.extend(true, params, outData);\r\n if (self._abort(params)) {\r\n jqXHR.abort();\r\n if (!isBatch) {\r\n self._setThumbStatus($thumb, 'New');\r\n $thumb.removeClass('file-uploading');\r\n $btnUpload.removeAttr('disabled');\r\n $btnDelete.removeAttr('disabled');\r\n self.unlock();\r\n }\r\n self._setProgressCancelled();\r\n }\r\n };\r\n fnSuccess = function (data, textStatus, jqXHR) {\r\n var pid = self.showPreview && $thumb.attr('id') ? $thumb.attr('id') : previewId;\r\n outData = self._getOutData(jqXHR, data);\r\n $.extend(true, params, outData);\r\n setTimeout(function () {\r\n if ($h.isEmpty(data) || $h.isEmpty(data.error)) {\r\n if (self.showPreview) {\r\n self._setThumbStatus($thumb, 'Success');\r\n $btnUpload.hide();\r\n self._initUploadSuccess(data, $thumb, isBatch);\r\n self._setProgress(101, $prog);\r\n }\r\n self._raise('fileuploaded', [outData, pid, i]);\r\n if (!isBatch) {\r\n self.updateStack(i, undefined);\r\n } else {\r\n updateUploadLog(i, pid);\r\n }\r\n } else {\r\n uploadFailed = true;\r\n self._showUploadError(data.error, params);\r\n self._setPreviewError($thumb, i, self.filestack[i], self.retryErrorUploads);\r\n if (!self.retryErrorUploads) {\r\n $btnUpload.hide();\r\n }\r\n if (isBatch) {\r\n updateUploadLog(i, pid);\r\n }\r\n self._setProgress(101, $('#' + pid).find('.file-thumb-progress'), self.msgUploadError);\r\n }\r\n }, 100);\r\n };\r\n fnComplete = function () {\r\n setTimeout(function () {\r\n if (self.showPreview) {\r\n $btnUpload.removeAttr('disabled');\r\n $btnDelete.removeAttr('disabled');\r\n $thumb.removeClass('file-uploading');\r\n }\r\n if (!isBatch) {\r\n self.unlock(false);\r\n self._clearFileInput();\r\n } else {\r\n chkComplete();\r\n }\r\n self._initSuccessThumbs();\r\n }, 100);\r\n };\r\n fnError = function (jqXHR, textStatus, errorThrown) {\r\n var op = self.ajaxOperations.uploadThumb,\r\n errMsg = self._parseError(op, jqXHR, errorThrown, (isBatch && self.filestack[i].name ? self.filestack[i].name : null));\r\n uploadFailed = true;\r\n setTimeout(function () {\r\n if (isBatch) {\r\n updateUploadLog(i, previewId);\r\n }\r\n self.uploadStatus[previewId] = 100;\r\n self._setPreviewError($thumb, i, self.filestack[i], self.retryErrorUploads);\r\n if (!self.retryErrorUploads) {\r\n $btnUpload.hide();\r\n }\r\n $.extend(true, params, self._getOutData(jqXHR));\r\n self._setProgress(101, $prog, self.msgAjaxProgressError.replace('{operation}', op));\r\n self._setProgress(101, $('#' + previewId).find('.file-thumb-progress'), self.msgUploadError);\r\n self._showUploadError(errMsg, params);\r\n }, 100);\r\n };\r\n formdata.append(self.uploadFileAttr, self.filestack[i], self.filenames[i]);\r\n formdata.append('file_id', i);\r\n self._ajaxSubmit(fnBefore, fnSuccess, fnComplete, fnError, previewId, i);\r\n },\r\n _uploadBatch: function () {\r\n var self = this, files = self.filestack, total = files.length, params = {}, fnBefore, fnSuccess, fnError,\r\n fnComplete, hasPostData = self.filestack.length > 0 || !$.isEmptyObject(self.uploadExtraData),\r\n setAllUploaded;\r\n self.formdata = new FormData();\r\n if (total === 0 || !hasPostData || self._abort(params)) {\r\n return;\r\n }\r\n setAllUploaded = function () {\r\n $.each(files, function (key) {\r\n self.updateStack(key, undefined);\r\n });\r\n self._clearFileInput();\r\n };\r\n fnBefore = function (jqXHR) {\r\n self.lock();\r\n var outData = self._getOutData(jqXHR);\r\n self.ajaxAborted = false;\r\n if (self.showPreview) {\r\n self._getThumbs().each(function () {\r\n var $thumb = $(this), $btnUpload = $thumb.find('.kv-file-upload'),\r\n $btnDelete = $thumb.find('.kv-file-remove');\r\n if (!$thumb.hasClass('file-preview-success')) {\r\n self._setThumbStatus($thumb, 'Loading');\r\n $h.addCss($thumb, 'file-uploading');\r\n }\r\n $btnUpload.attr('disabled', true);\r\n $btnDelete.attr('disabled', true);\r\n });\r\n }\r\n self._raise('filebatchpreupload', [outData]);\r\n if (self._abort(outData)) {\r\n jqXHR.abort();\r\n self._getThumbs().each(function () {\r\n var $thumb = $(this), $btnUpload = $thumb.find('.kv-file-upload'),\r\n $btnDelete = $thumb.find('.kv-file-remove');\r\n if ($thumb.hasClass('file-preview-loading')) {\r\n self._setThumbStatus($thumb, 'New');\r\n $thumb.removeClass('file-uploading');\r\n }\r\n $btnUpload.removeAttr('disabled');\r\n $btnDelete.removeAttr('disabled');\r\n });\r\n self._setProgressCancelled();\r\n }\r\n };\r\n fnSuccess = function (data, textStatus, jqXHR) {\r\n /** @namespace data.errorkeys */\r\n var outData = self._getOutData(jqXHR, data), key = 0,\r\n $thumbs = self._getThumbs(':not(.file-preview-success)'),\r\n keys = $h.isEmpty(data) || $h.isEmpty(data.errorkeys) ? [] : data.errorkeys;\r\n\r\n if ($h.isEmpty(data) || $h.isEmpty(data.error)) {\r\n self._raise('filebatchuploadsuccess', [outData]);\r\n setAllUploaded();\r\n if (self.showPreview) {\r\n $thumbs.each(function () {\r\n var $thumb = $(this);\r\n self._setThumbStatus($thumb, 'Success');\r\n $thumb.removeClass('file-uploading');\r\n $thumb.find('.kv-file-upload').hide().removeAttr('disabled');\r\n });\r\n self._initUploadSuccess(data);\r\n } else {\r\n self.reset();\r\n }\r\n self._setProgress(101);\r\n } else {\r\n if (self.showPreview) {\r\n $thumbs.each(function () {\r\n var $thumb = $(this), i = $thumb.attr('data-fileindex');\r\n $thumb.removeClass('file-uploading');\r\n $thumb.find('.kv-file-upload').removeAttr('disabled');\r\n $thumb.find('.kv-file-remove').removeAttr('disabled');\r\n if (keys.length === 0 || $.inArray(key, keys) !== -1) {\r\n self._setPreviewError($thumb, i, self.filestack[i], self.retryErrorUploads);\r\n if (!self.retryErrorUploads) {\r\n $thumb.find('.kv-file-upload').hide();\r\n self.updateStack(i, undefined);\r\n }\r\n } else {\r\n $thumb.find('.kv-file-upload').hide();\r\n self._setThumbStatus($thumb, 'Success');\r\n self.updateStack(i, undefined);\r\n }\r\n if (!$thumb.hasClass('file-preview-error') || self.retryErrorUploads) {\r\n key++;\r\n }\r\n });\r\n self._initUploadSuccess(data);\r\n }\r\n self._showUploadError(data.error, outData, 'filebatchuploaderror');\r\n self._setProgress(101, self.$progress, self.msgUploadError);\r\n }\r\n };\r\n fnComplete = function () {\r\n self.unlock();\r\n self._initSuccessThumbs();\r\n self._clearFileInput();\r\n self._raise('filebatchuploadcomplete', [self.filestack, self._getExtraData()]);\r\n };\r\n fnError = function (jqXHR, textStatus, errorThrown) {\r\n var outData = self._getOutData(jqXHR), op = self.ajaxOperations.uploadBatch,\r\n errMsg = self._parseError(op, jqXHR, errorThrown);\r\n self._showUploadError(errMsg, outData, 'filebatchuploaderror');\r\n self.uploadFileCount = total - 1;\r\n if (!self.showPreview) {\r\n return;\r\n }\r\n self._getThumbs().each(function () {\r\n var $thumb = $(this), key = $thumb.attr('data-fileindex');\r\n $thumb.removeClass('file-uploading');\r\n if (self.filestack[key] !== undefined) {\r\n self._setPreviewError($thumb);\r\n }\r\n });\r\n self._getThumbs().removeClass('file-uploading');\r\n self._getThumbs(' .kv-file-upload').removeAttr('disabled');\r\n self._getThumbs(' .kv-file-delete').removeAttr('disabled');\r\n self._setProgress(101, self.$progress, self.msgAjaxProgressError.replace('{operation}', op));\r\n };\r\n $.each(files, function (key, data) {\r\n if (!$h.isEmpty(files[key])) {\r\n self.formdata.append(self.uploadFileAttr, data, self.filenames[key]);\r\n }\r\n });\r\n self._ajaxSubmit(fnBefore, fnSuccess, fnComplete, fnError);\r\n },\r\n _uploadExtraOnly: function () {\r\n var self = this, params = {}, fnBefore, fnSuccess, fnComplete, fnError;\r\n self.formdata = new FormData();\r\n if (self._abort(params)) {\r\n return;\r\n }\r\n fnBefore = function (jqXHR) {\r\n self.lock();\r\n var outData = self._getOutData(jqXHR);\r\n self._raise('filebatchpreupload', [outData]);\r\n self._setProgress(50);\r\n params.data = outData;\r\n params.xhr = jqXHR;\r\n if (self._abort(params)) {\r\n jqXHR.abort();\r\n self._setProgressCancelled();\r\n }\r\n };\r\n fnSuccess = function (data, textStatus, jqXHR) {\r\n var outData = self._getOutData(jqXHR, data);\r\n if ($h.isEmpty(data) || $h.isEmpty(data.error)) {\r\n self._raise('filebatchuploadsuccess', [outData]);\r\n self._clearFileInput();\r\n self._initUploadSuccess(data);\r\n self._setProgress(101);\r\n } else {\r\n self._showUploadError(data.error, outData, 'filebatchuploaderror');\r\n }\r\n };\r\n fnComplete = function () {\r\n self.unlock();\r\n self._clearFileInput();\r\n self._raise('filebatchuploadcomplete', [self.filestack, self._getExtraData()]);\r\n };\r\n fnError = function (jqXHR, textStatus, errorThrown) {\r\n var outData = self._getOutData(jqXHR), op = self.ajaxOperations.uploadExtra,\r\n errMsg = self._parseError(op, jqXHR, errorThrown);\r\n params.data = outData;\r\n self._showUploadError(errMsg, outData, 'filebatchuploaderror');\r\n self._setProgress(101, self.$progress, self.msgAjaxProgressError.replace('{operation}', op));\r\n };\r\n self._ajaxSubmit(fnBefore, fnSuccess, fnComplete, fnError);\r\n },\r\n _deleteFileIndex: function ($frame) {\r\n var self = this, ind = $frame.attr('data-fileindex');\r\n if (ind.substring(0, 5) === 'init_') {\r\n ind = parseInt(ind.replace('init_', ''));\r\n self.initialPreview = $h.spliceArray(self.initialPreview, ind);\r\n self.initialPreviewConfig = $h.spliceArray(self.initialPreviewConfig, ind);\r\n self.initialPreviewThumbTags = $h.spliceArray(self.initialPreviewThumbTags, ind);\r\n self.getFrames().each(function () {\r\n var $nFrame = $(this), nInd = $nFrame.attr('data-fileindex');\r\n if (nInd.substring(0, 5) === 'init_') {\r\n nInd = parseInt(nInd.replace('init_', ''));\r\n if (nInd > ind) {\r\n nInd--;\r\n $nFrame.attr('data-fileindex', 'init_' + nInd);\r\n }\r\n }\r\n });\r\n if (self.uploadAsync) {\r\n self.cacheInitialPreview = self.getPreview();\r\n }\r\n }\r\n },\r\n _initFileActions: function () {\r\n var self = this, $preview = self.$preview;\r\n if (!self.showPreview) {\r\n return;\r\n }\r\n self._initZoomButton();\r\n self.getFrames(' .kv-file-remove').each(function () {\r\n var $el = $(this), $frame = $el.closest($h.FRAMES), hasError, id = $frame.attr('id'),\r\n ind = $frame.attr('data-fileindex'), n, cap, status;\r\n self._handler($el, 'click', function () {\r\n status = self._raise('filepreremove', [id, ind]);\r\n if (status === false || !self._validateMinCount()) {\r\n return false;\r\n }\r\n hasError = $frame.hasClass('file-preview-error');\r\n $h.cleanMemory($frame);\r\n $frame.fadeOut('slow', function () {\r\n $h.cleanZoomCache($preview.find('#zoom-' + id));\r\n self.updateStack(ind, undefined);\r\n self._clearObjects($frame);\r\n $frame.remove();\r\n if (id && hasError) {\r\n self.$errorContainer.find('li[data-file-id=\"' + id + '\"]').fadeOut('fast', function () {\r\n $(this).remove();\r\n if (!self._errorsExist()) {\r\n self._resetErrors();\r\n }\r\n });\r\n }\r\n self._clearFileInput();\r\n var filestack = self.getFileStack(true), chk = self.previewCache.count(),\r\n len = filestack.length, hasThumb = self.showPreview && self.getFrames().length;\r\n if (len === 0 && chk === 0 && !hasThumb) {\r\n self.reset();\r\n } else {\r\n n = chk + len;\r\n cap = n > 1 ? self._getMsgSelected(n) : (filestack[0] ? self._getFileNames()[0] : '');\r\n self._setCaption(cap);\r\n }\r\n self._raise('fileremoved', [id, ind]);\r\n });\r\n });\r\n });\r\n self.getFrames(' .kv-file-upload').each(function () {\r\n var $el = $(this);\r\n self._handler($el, 'click', function () {\r\n var $frame = $el.closest($h.FRAMES), ind = $frame.attr('data-fileindex');\r\n self.$progress.hide();\r\n if ($frame.hasClass('file-preview-error') && !self.retryErrorUploads) {\r\n return;\r\n }\r\n self._uploadSingle(ind, false);\r\n });\r\n });\r\n },\r\n _initPreviewActions: function () {\r\n var self = this, $preview = self.$preview, deleteExtraData = self.deleteExtraData || {},\r\n btnRemove = $h.FRAMES + ' .kv-file-remove', settings = self.fileActionSettings,\r\n origClass = settings.removeClass, errClass = settings.removeErrorClass,\r\n resetProgress = function () {\r\n var hasFiles = self.isAjaxUpload ? self.previewCache.count() : self.$element.get(0).files.length;\r\n if (!$preview.find($h.FRAMES).length && !hasFiles) {\r\n self._setCaption('');\r\n self.reset();\r\n self.initialCaption = '';\r\n }\r\n };\r\n self._initZoomButton();\r\n $preview.find(btnRemove).each(function () {\r\n var $el = $(this), vUrl = $el.data('url') || self.deleteUrl, vKey = $el.data('key'),\r\n fnBefore, fnSuccess, fnError;\r\n if ($h.isEmpty(vUrl) || vKey === undefined) {\r\n return;\r\n }\r\n var $frame = $el.closest($h.FRAMES), cache = self.previewCache.data,\r\n settings, params, index = $frame.attr('data-fileindex'), config, extraData;\r\n index = parseInt(index.replace('init_', ''));\r\n config = $h.isEmpty(cache.config) && $h.isEmpty(cache.config[index]) ? null : cache.config[index];\r\n extraData = $h.isEmpty(config) || $h.isEmpty(config.extra) ? deleteExtraData : config.extra;\r\n if (typeof extraData === \"function\") {\r\n extraData = extraData();\r\n }\r\n params = {id: $el.attr('id'), key: vKey, extra: extraData};\r\n fnBefore = function (jqXHR) {\r\n self.ajaxAborted = false;\r\n self._raise('filepredelete', [vKey, jqXHR, extraData]);\r\n if (self._abort()) {\r\n jqXHR.abort();\r\n } else {\r\n $el.removeClass(errClass);\r\n $h.addCss($frame, 'file-uploading');\r\n $h.addCss($el, 'disabled ' + origClass);\r\n }\r\n };\r\n fnSuccess = function (data, textStatus, jqXHR) {\r\n var n, cap;\r\n if (!$h.isEmpty(data) && !$h.isEmpty(data.error)) {\r\n params.jqXHR = jqXHR;\r\n params.response = data;\r\n self._showError(data.error, params, 'filedeleteerror');\r\n $frame.removeClass('file-uploading');\r\n $el.removeClass('disabled ' + origClass).addClass(errClass);\r\n resetProgress();\r\n return;\r\n }\r\n $frame.removeClass('file-uploading').addClass('file-deleted');\r\n $frame.fadeOut('slow', function () {\r\n index = parseInt(($frame.attr('data-fileindex')).replace('init_', ''));\r\n self.previewCache.unset(index);\r\n self._deleteFileIndex($frame);\r\n n = self.previewCache.count();\r\n cap = n > 0 ? self._getMsgSelected(n) : '';\r\n self._setCaption(cap);\r\n self._raise('filedeleted', [vKey, jqXHR, extraData]);\r\n $h.cleanZoomCache($preview.find('#zoom-' + $frame.attr('id')));\r\n self._clearObjects($frame);\r\n $frame.remove();\r\n resetProgress();\r\n });\r\n };\r\n fnError = function (jqXHR, textStatus, errorThrown) {\r\n var op = self.ajaxOperations.deleteThumb, errMsg = self._parseError(op, jqXHR, errorThrown);\r\n params.jqXHR = jqXHR;\r\n params.response = {};\r\n self._showError(errMsg, params, 'filedeleteerror');\r\n $frame.removeClass('file-uploading');\r\n $el.removeClass('disabled ' + origClass).addClass(errClass);\r\n resetProgress();\r\n };\r\n self._mergeAjaxCallback('beforeSend', fnBefore, 'delete');\r\n self._mergeAjaxCallback('success', fnSuccess, 'delete');\r\n self._mergeAjaxCallback('error', fnError, 'delete');\r\n settings = $.extend(true, {}, {\r\n url: vUrl,\r\n type: 'POST',\r\n dataType: 'json',\r\n data: $.extend(true, {}, {key: vKey}, extraData)\r\n }, self.ajaxDeleteSettings);\r\n self._handler($el, 'click', function () {\r\n if (!self._validateMinCount()) {\r\n return false;\r\n }\r\n self.ajaxAborted = false;\r\n self._raise('filebeforedelete', [vKey, extraData]);\r\n //noinspection JSUnresolvedVariable,JSHint\r\n if (self.ajaxAborted instanceof Promise) {\r\n self.ajaxAborted.then(function (result) {\r\n if (!result) {\r\n $.ajax(settings);\r\n }\r\n });\r\n } else {\r\n if (!self.ajaxAborted) {\r\n $.ajax(settings);\r\n }\r\n }\r\n });\r\n });\r\n },\r\n _hideFileIcon: function () {\r\n var self = this;\r\n if (self.overwriteInitial) {\r\n self.$captionContainer.removeClass('icon-visible');\r\n }\r\n },\r\n _showFileIcon: function () {\r\n var self = this;\r\n $h.addCss(self.$captionContainer, 'icon-visible');\r\n },\r\n _getSize: function (bytes) {\r\n var self = this, size = parseFloat(bytes), i, func = self.fileSizeGetter, sizes, out;\r\n if (!$.isNumeric(bytes) || !$.isNumeric(size)) {\r\n return '';\r\n }\r\n if (typeof func === 'function') {\r\n out = func(size);\r\n } else {\r\n if (size === 0) {\r\n out = '0.00 B';\r\n } else {\r\n i = Math.floor(Math.log(size) / Math.log(1024));\r\n sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\r\n out = (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + sizes[i];\r\n }\r\n }\r\n return self._getLayoutTemplate('size').replace('{sizeText}', out);\r\n },\r\n _generatePreviewTemplate: function (cat, data, fname, ftype, previewId, isError, size, frameClass, foot, ind, templ) {\r\n var self = this, caption = self.slug(fname), prevContent, zoomContent = '', styleAttribs = '',\r\n screenW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,\r\n config = screenW < 400 ? (self.previewSettingsSmall[cat] || self.defaults.previewSettingsSmall[cat]) :\r\n (self.previewSettings[cat] || self.defaults.previewSettings[cat]),\r\n footer = foot || self._renderFileFooter(caption, size, 'auto', isError),\r\n hasIconSetting = self._getPreviewIcon(fname), typeCss = 'type-default',\r\n forcePrevIcon = hasIconSetting && self.preferIconicPreview,\r\n forceZoomIcon = hasIconSetting && self.preferIconicZoomPreview, getContent;\r\n if (config) {\r\n $.each(config, function (key, val) {\r\n styleAttribs += key + ':' + val + ';';\r\n });\r\n }\r\n getContent = function (c, d, zoom, frameCss) {\r\n var id = zoom ? 'zoom-' + previewId : previewId, tmplt = self._getPreviewTemplate(c),\r\n css = (frameClass || '') + ' ' + frameCss;\r\n if (self.frameClass) {\r\n css = self.frameClass + ' ' + css;\r\n }\r\n if (zoom) {\r\n css = css.replace(' ' + $h.SORT_CSS, '');\r\n }\r\n tmplt = self._parseFilePreviewIcon(tmplt, fname);\r\n if (c === 'text') {\r\n d = $h.htmlEncode(d);\r\n }\r\n if (cat === 'object' && !ftype) {\r\n $.each(self.defaults.fileTypeSettings, function (key, func) {\r\n if (key === 'object' || key === 'other') {\r\n return;\r\n }\r\n if (func(fname, ftype)) {\r\n typeCss = 'type-' + key;\r\n }\r\n });\r\n }\r\n return tmplt.setTokens({\r\n 'previewId': id,\r\n 'caption': caption,\r\n 'frameClass': css,\r\n 'type': ftype,\r\n 'fileindex': ind,\r\n 'typeCss': typeCss,\r\n 'footer': footer,\r\n 'data': d,\r\n 'template': templ || cat,\r\n 'style': styleAttribs ? 'style=\"' + styleAttribs + '\"' : ''\r\n });\r\n };\r\n ind = ind || previewId.slice(previewId.lastIndexOf('-') + 1);\r\n if (self.fileActionSettings.showZoom) {\r\n zoomContent = getContent((forceZoomIcon ? 'other' : cat), data, true, 'kv-zoom-thumb');\r\n }\r\n zoomContent = '\\n' + self._getLayoutTemplate('zoomCache').replace('{zoomContent}', zoomContent);\r\n prevContent = getContent((forcePrevIcon ? 'other' : cat), data, false, 'kv-preview-thumb');\r\n return prevContent + zoomContent;\r\n },\r\n _previewDefault: function (file, previewId, isDisabled) {\r\n var self = this, $preview = self.$preview;\r\n if (!self.showPreview) {\r\n return;\r\n }\r\n var fname = file ? file.name : '', ftype = file ? file.type : '', content, size = file.size || 0,\r\n caption = self.slug(fname), isError = isDisabled === true && !self.isAjaxUpload,\r\n data = $h.objUrl.createObjectURL(file);\r\n self._clearDefaultPreview();\r\n content = self._generatePreviewTemplate('other', data, fname, ftype, previewId, isError, size);\r\n $preview.append(\"\\n\" + content);\r\n self._setThumbAttr(previewId, caption, size);\r\n if (isDisabled === true && self.isAjaxUpload) {\r\n self._setThumbStatus($('#' + previewId), 'Error');\r\n }\r\n },\r\n _previewFile: function (i, file, theFile, previewId, data, fileInfo) {\r\n if (!this.showPreview) {\r\n return;\r\n }\r\n var self = this, fname = file ? file.name : '', ftype = fileInfo.type, caption = fileInfo.name,\r\n cat = self._parseFileType(ftype, fname), types = self.allowedPreviewTypes, content,\r\n mimes = self.allowedPreviewMimeTypes, $preview = self.$preview, fsize = file.size || 0,\r\n chkTypes = types && types.indexOf(cat) >= 0, chkMimes = mimes && mimes.indexOf(ftype) !== -1,\r\n iData = (cat === 'text' || cat === 'html' || cat === 'image') ? theFile.target.result : data;\r\n /** @namespace window.DOMPurify */\r\n if (cat === 'html' && self.purifyHtml && window.DOMPurify) {\r\n iData = window.DOMPurify.sanitize(iData);\r\n }\r\n if (chkTypes || chkMimes) {\r\n content = self._generatePreviewTemplate(cat, iData, fname, ftype, previewId, false, fsize);\r\n self._clearDefaultPreview();\r\n $preview.append(\"\\n\" + content);\r\n var $img = $preview.find('#' + previewId + ' img');\r\n if ($img.length && self.autoOrientImage) {\r\n $h.validateOrientation(file, function (value) {\r\n if (!value) {\r\n self._validateImage(previewId, caption, ftype, fsize, iData);\r\n return;\r\n }\r\n var $zoomImg = $preview.find('#zoom-' + previewId + ' img'), css = 'rotate-' + value;\r\n if (value > 4) {\r\n css += ($img.width() > $img.height() ? ' is-portrait-gt4' : ' is-landscape-gt4');\r\n }\r\n $h.addCss($img, css);\r\n $h.addCss($zoomImg, css);\r\n self._raise('fileimageoriented', {'$img': $img, 'file': file});\r\n self._validateImage(previewId, caption, ftype, fsize, iData);\r\n $h.adjustOrientedImage($img);\r\n });\r\n } else {\r\n self._validateImage(previewId, caption, ftype, fsize, iData);\r\n }\r\n } else {\r\n self._previewDefault(file, previewId);\r\n }\r\n self._setThumbAttr(previewId, caption, fsize);\r\n self._initSortable();\r\n },\r\n _setThumbAttr: function (id, caption, size) {\r\n var self = this, $frame = $('#' + id);\r\n if ($frame.length) {\r\n size = size && size > 0 ? self._getSize(size) : '';\r\n $frame.data({'caption': caption, 'size': size});\r\n }\r\n },\r\n _setInitThumbAttr: function () {\r\n var self = this, data = self.previewCache.data, len = self.previewCache.count(), config,\r\n caption, size, previewId;\r\n if (len === 0) {\r\n return;\r\n }\r\n for (var i = 0; i < len; i++) {\r\n config = data.config[i];\r\n previewId = self.previewInitId + '-' + 'init_' + i;\r\n caption = $h.ifSet('caption', config, $h.ifSet('filename', config));\r\n size = $h.ifSet('size', config);\r\n self._setThumbAttr(previewId, caption, size);\r\n }\r\n },\r\n _slugDefault: function (text) {\r\n return $h.isEmpty(text) ? '' : String(text).replace(/[^- 0-9a-z_.]/gi, '_');\r\n },\r\n _updateFileDetails: function (numFiles) {\r\n var self = this, $el = self.$element, fileStack = self.getFileStack(),\r\n name = ($h.isIE(9) && $h.findFileName($el.val())) ||\r\n ($el[0].files[0] && $el[0].files[0].name) || (fileStack.length && fileStack[0].name) || '',\r\n label = self.slug(name), n = self.isAjaxUpload ? fileStack.length : numFiles,\r\n nFiles = self.previewCache.count() + n, log = n === 1 ? label : self._getMsgSelected(nFiles);\r\n if (self.isError) {\r\n self.$previewContainer.removeClass('file-thumb-loading');\r\n self.$previewStatus.html('');\r\n self.$captionContainer.removeClass('icon-visible');\r\n } else {\r\n self._showFileIcon();\r\n }\r\n self._setCaption(log, self.isError);\r\n self.$container.removeClass('file-input-new file-input-ajax-new');\r\n if (arguments.length === 1) {\r\n self._raise('fileselect', [numFiles, label]);\r\n }\r\n if (self.previewCache.count()) {\r\n self._initPreviewActions();\r\n }\r\n },\r\n _setThumbStatus: function ($thumb, status) {\r\n var self = this;\r\n if (!self.showPreview) {\r\n return;\r\n }\r\n var icon = 'indicator' + status, msg = icon + 'Title',\r\n css = 'file-preview-' + status.toLowerCase(),\r\n $indicator = $thumb.find('.file-upload-indicator'),\r\n config = self.fileActionSettings;\r\n $thumb.removeClass('file-preview-success file-preview-error file-preview-loading');\r\n if (status === 'Success') {\r\n $thumb.find('.file-drag-handle').remove();\r\n }\r\n $indicator.html(config[icon]);\r\n $indicator.attr('title', config[msg]);\r\n $thumb.addClass(css);\r\n if (status === 'Error' && !self.retryErrorUploads) {\r\n $thumb.find('.kv-file-upload').attr('disabled', true);\r\n }\r\n },\r\n _setProgressCancelled: function () {\r\n var self = this;\r\n self._setProgress(101, self.$progress, self.msgCancelled);\r\n },\r\n _setProgress: function (p, $el, error) {\r\n var self = this, pct = Math.min(p, 100), out, pctLimit = self.progressUploadThreshold,\r\n t = p <= 100 ? self.progressTemplate : self.progressCompleteTemplate,\r\n template = pct < 100 ? self.progressTemplate : (error ? self.progressErrorTemplate : t);\r\n $el = $el || self.$progress;\r\n if (!$h.isEmpty(template)) {\r\n if (pctLimit && pct > pctLimit && p <= 100) {\r\n out = template.setTokens({'percent': pctLimit, 'status': self.msgUploadThreshold});\r\n } else {\r\n out = template.setTokens({'percent': pct, 'status': (p > 100 ? self.msgUploadEnd : pct + '%')});\r\n }\r\n $el.html(out);\r\n if (error) {\r\n $el.find('[role=\"progressbar\"]').html(error);\r\n }\r\n }\r\n },\r\n _setFileDropZoneTitle: function () {\r\n var self = this, $zone = self.$container.find('.file-drop-zone'), title = self.dropZoneTitle, strFiles;\r\n if (self.isClickable) {\r\n strFiles = $h.isEmpty(self.$element.attr('multiple')) ? self.fileSingle : self.filePlural;\r\n title += self.dropZoneClickTitle.replace('{files}', strFiles);\r\n }\r\n $zone.find('.' + self.dropZoneTitleClass).remove();\r\n if (!self.isAjaxUpload || !self.showPreview || $zone.length === 0 || self.getFileStack().length > 0 || !self.dropZoneEnabled) {\r\n return;\r\n }\r\n if ($zone.find($h.FRAMES).length === 0 && $h.isEmpty(self.defaultPreviewContent)) {\r\n $zone.prepend('
    ' + title + '
    ');\r\n }\r\n self.$container.removeClass('file-input-new');\r\n $h.addCss(self.$container, 'file-input-ajax-new');\r\n },\r\n _setAsyncUploadStatus: function (previewId, pct, total) {\r\n var self = this, sum = 0;\r\n self._setProgress(pct, $('#' + previewId).find('.file-thumb-progress'));\r\n self.uploadStatus[previewId] = pct;\r\n $.each(self.uploadStatus, function (key, value) {\r\n sum += value;\r\n });\r\n self._setProgress(Math.floor(sum / total));\r\n },\r\n _validateMinCount: function () {\r\n var self = this, len = self.isAjaxUpload ? self.getFileStack().length : self.$element.get(0).files.length;\r\n if (self.validateInitialCount && self.minFileCount > 0 && self._getFileCount(len - 1) < self.minFileCount) {\r\n self._noFilesError({});\r\n return false;\r\n }\r\n return true;\r\n },\r\n _getFileCount: function (fileCount) {\r\n var self = this, addCount = 0;\r\n if (self.validateInitialCount && !self.overwriteInitial) {\r\n addCount = self.previewCache.count();\r\n fileCount += addCount;\r\n }\r\n return fileCount;\r\n },\r\n _getFileId: function (file) {\r\n var self = this, custom = self.generateFileId, relativePath;\r\n if (typeof custom === 'function') {\r\n return custom(file, event);\r\n }\r\n if (!file) {\r\n return null;\r\n }\r\n /** @namespace file.webkitRelativePath */\r\n relativePath = String(file.webkitRelativePath || file.fileName || file.name || null);\r\n if (!relativePath) {\r\n return null;\r\n }\r\n return (file.size + '-' + relativePath.replace(/[^0-9a-zA-Z_-]/img, ''));\r\n },\r\n _getFileName: function (file) {\r\n return file && file.name ? this.slug(file.name) : undefined;\r\n },\r\n _getFileIds: function (skipNull) {\r\n var self = this;\r\n return self.fileids.filter(function (n) {\r\n return (skipNull ? n !== undefined : n !== undefined && n !== null);\r\n });\r\n },\r\n _getFileNames: function (skipNull) {\r\n var self = this;\r\n return self.filenames.filter(function (n) {\r\n return (skipNull ? n !== undefined : n !== undefined && n !== null);\r\n });\r\n },\r\n _setPreviewError: function ($thumb, i, val, repeat) {\r\n var self = this;\r\n if (i !== undefined) {\r\n self.updateStack(i, val);\r\n }\r\n if (!self.showPreview) {\r\n return;\r\n }\r\n if (self.removeFromPreviewOnError && !repeat) {\r\n $thumb.remove();\r\n return;\r\n } else {\r\n self._setThumbStatus($thumb, 'Error');\r\n }\r\n self._refreshUploadButton($thumb, repeat);\r\n },\r\n _refreshUploadButton: function ($thumb, repeat) {\r\n var self = this, $btn = $thumb.find('.kv-file-upload'), cfg = self.fileActionSettings,\r\n icon = cfg.uploadIcon, title = cfg.uploadTitle;\r\n if (!$btn.length) {\r\n return;\r\n }\r\n if (repeat) {\r\n icon = cfg.uploadRetryIcon;\r\n title = cfg.uploadRetryTitle;\r\n }\r\n $btn.attr('title', title).html(icon);\r\n },\r\n _checkDimensions: function (i, chk, $img, $thumb, fname, type, params) {\r\n var self = this, msg, dim, tag = chk === 'Small' ? 'min' : 'max', limit = self[tag + 'Image' + type],\r\n $imgEl, isValid;\r\n if ($h.isEmpty(limit) || !$img.length) {\r\n return;\r\n }\r\n $imgEl = $img[0];\r\n dim = (type === 'Width') ? $imgEl.naturalWidth || $imgEl.width : $imgEl.naturalHeight || $imgEl.height;\r\n isValid = chk === 'Small' ? dim >= limit : dim <= limit;\r\n if (isValid) {\r\n return;\r\n }\r\n msg = self['msgImage' + type + chk].setTokens({'name': fname, 'size': limit});\r\n self._showUploadError(msg, params);\r\n self._setPreviewError($thumb, i, null);\r\n },\r\n _validateImage: function (previewId, fname, ftype, fsize, iData) {\r\n var self = this, $preview = self.$preview, params, w1, w2, $thumb = $preview.find(\"#\" + previewId),\r\n i = $thumb.attr('data-fileindex'), $img = $thumb.find('img'), exifObject;\r\n fname = fname || 'Untitled';\r\n $img.one('load', function () {\r\n w1 = $thumb.width();\r\n w2 = $preview.width();\r\n if (w1 > w2) {\r\n $img.css('width', '100%');\r\n }\r\n params = {ind: i, id: previewId};\r\n self._checkDimensions(i, 'Small', $img, $thumb, fname, 'Width', params);\r\n self._checkDimensions(i, 'Small', $img, $thumb, fname, 'Height', params);\r\n if (!self.resizeImage) {\r\n self._checkDimensions(i, 'Large', $img, $thumb, fname, 'Width', params);\r\n self._checkDimensions(i, 'Large', $img, $thumb, fname, 'Height', params);\r\n }\r\n self._raise('fileimageloaded', [previewId]);\r\n try {\r\n exifObject = window.piexif ? window.piexif.load(iData) : null;\r\n } catch (err) {\r\n exifObject = null;\r\n }\r\n self.loadedImages.push({\r\n ind: i,\r\n img: $img,\r\n thumb: $thumb,\r\n pid: previewId,\r\n typ: ftype,\r\n siz: fsize,\r\n validated: false,\r\n imgData: iData,\r\n exifObj: exifObject\r\n });\r\n $thumb.data('exif', exifObject);\r\n self._validateAllImages();\r\n }).one('error', function () {\r\n self._raise('fileimageloaderror', [previewId]);\r\n }).each(function () {\r\n if (this.complete) {\r\n $(this).trigger('load');\r\n } else {\r\n if (this.error) {\r\n $(this).trigger('error');\r\n }\r\n }\r\n });\r\n },\r\n _validateAllImages: function () {\r\n var self = this, i, counter = {val: 0}, numImgs = self.loadedImages.length, config,\r\n fsize, minSize = self.resizeIfSizeMoreThan;\r\n if (numImgs !== self.totalImagesCount) {\r\n return;\r\n }\r\n self._raise('fileimagesloaded');\r\n if (!self.resizeImage) {\r\n return;\r\n }\r\n for (i = 0; i < self.loadedImages.length; i++) {\r\n config = self.loadedImages[i];\r\n if (config.validated) {\r\n continue;\r\n }\r\n fsize = config.siz;\r\n if (fsize && fsize > minSize * 1000) {\r\n self._getResizedImage(config, counter, numImgs);\r\n }\r\n self.loadedImages[i].validated = true;\r\n }\r\n },\r\n _getResizedImage: function (config, counter, numImgs) {\r\n var self = this, img = $(config.img)[0], width = img.naturalWidth, height = img.naturalHeight, blob,\r\n ratio = 1, maxWidth = self.maxImageWidth || width, maxHeight = self.maxImageHeight || height,\r\n isValidImage = !!(width && height), chkWidth, chkHeight, canvas = self.imageCanvas, dataURI,\r\n context = self.imageCanvasContext, type = config.typ, pid = config.pid, ind = config.ind,\r\n $thumb = config.thumb, throwError, msg, exifObj = config.exifObj, exifStr;\r\n throwError = function (msg, params, ev) {\r\n if (self.isAjaxUpload) {\r\n self._showUploadError(msg, params, ev);\r\n } else {\r\n self._showError(msg, params, ev);\r\n }\r\n self._setPreviewError($thumb, ind);\r\n };\r\n if (!self.filestack[ind] || !isValidImage || (width <= maxWidth && height <= maxHeight)) {\r\n if (isValidImage && self.filestack[ind]) {\r\n self._raise('fileimageresized', [pid, ind]);\r\n }\r\n counter.val++;\r\n if (counter.val === numImgs) {\r\n self._raise('fileimagesresized');\r\n }\r\n if (!isValidImage) {\r\n throwError(self.msgImageResizeError, {id: pid, 'index': ind}, 'fileimageresizeerror');\r\n return;\r\n }\r\n }\r\n type = type || self.resizeDefaultImageType;\r\n chkWidth = width > maxWidth;\r\n chkHeight = height > maxHeight;\r\n if (self.resizePreference === 'width') {\r\n ratio = chkWidth ? maxWidth / width : (chkHeight ? maxHeight / height : 1);\r\n } else {\r\n ratio = chkHeight ? maxHeight / height : (chkWidth ? maxWidth / width : 1);\r\n }\r\n self._resetCanvas();\r\n width *= ratio;\r\n height *= ratio;\r\n canvas.width = width;\r\n canvas.height = height;\r\n try {\r\n context.drawImage(img, 0, 0, width, height);\r\n dataURI = canvas.toDataURL(type, self.resizeQuality);\r\n if (exifObj) {\r\n exifStr = window.piexif.dump(exifObj);\r\n dataURI = window.piexif.insert(exifStr, dataURI);\r\n }\r\n blob = $h.dataURI2Blob(dataURI);\r\n self.filestack[ind] = blob;\r\n self._raise('fileimageresized', [pid, ind]);\r\n counter.val++;\r\n if (counter.val === numImgs) {\r\n self._raise('fileimagesresized', [undefined, undefined]);\r\n }\r\n if (!(blob instanceof Blob)) {\r\n throwError(self.msgImageResizeError, {id: pid, 'index': ind}, 'fileimageresizeerror');\r\n }\r\n }\r\n catch (err) {\r\n counter.val++;\r\n if (counter.val === numImgs) {\r\n self._raise('fileimagesresized', [undefined, undefined]);\r\n }\r\n msg = self.msgImageResizeException.replace('{errors}', err.message);\r\n throwError(msg, {id: pid, 'index': ind}, 'fileimageresizeexception');\r\n }\r\n },\r\n _initBrowse: function ($container) {\r\n var self = this;\r\n if (self.showBrowse) {\r\n self.$btnFile = $container.find('.btn-file');\r\n self.$btnFile.append(self.$element);\r\n } else {\r\n self.$element.hide();\r\n }\r\n },\r\n _initCaption: function () {\r\n var self = this, cap = self.initialCaption || '';\r\n if (self.overwriteInitial || $h.isEmpty(cap)) {\r\n self.$caption.val('');\r\n return false;\r\n }\r\n self._setCaption(cap);\r\n return true;\r\n },\r\n _setCaption: function (content, isError) {\r\n var self = this, title, out, icon, n, cap, stack = self.getFileStack();\r\n if (!self.$caption.length) {\r\n return;\r\n }\r\n self.$captionContainer.removeClass('icon-visible');\r\n if (isError) {\r\n title = $('
    ' + self.msgValidationError + '
    ').text();\r\n n = stack.length;\r\n if (n) {\r\n cap = n === 1 && stack[0] ? self._getFileNames()[0] : self._getMsgSelected(n);\r\n } else {\r\n cap = self._getMsgSelected(self.msgNo);\r\n }\r\n out = $h.isEmpty(content) ? cap : content;\r\n icon = '' + self.msgValidationErrorIcon + '';\r\n } else {\r\n if ($h.isEmpty(content)) {\r\n return;\r\n }\r\n title = $('
    ' + content + '
    ').text();\r\n out = title;\r\n icon = self._getLayoutTemplate('fileIcon');\r\n }\r\n self.$captionContainer.addClass('icon-visible');\r\n self.$caption.attr('title', title).val(out);\r\n self.$captionIcon.html(icon);\r\n },\r\n _createContainer: function () {\r\n var self = this, attribs = {\"class\": 'file-input file-input-new' + (self.rtl ? ' kv-rtl' : '')},\r\n $container = $(document.createElement(\"div\")).attr(attribs).html(self._renderMain());\r\n self.$element.before($container);\r\n self._initBrowse($container);\r\n if (self.theme) {\r\n $container.addClass('theme-' + self.theme);\r\n }\r\n return $container;\r\n },\r\n _refreshContainer: function () {\r\n var self = this, $container = self.$container;\r\n $container.before(self.$element);\r\n $container.html(self._renderMain());\r\n self._initBrowse($container);\r\n self._validateDisabled();\r\n },\r\n _validateDisabled: function () {\r\n var self = this;\r\n self.$caption.attr({readonly: self.isDisabled});\r\n },\r\n _renderMain: function () {\r\n var self = this,\r\n dropCss = (self.isAjaxUpload && self.dropZoneEnabled) ? ' file-drop-zone' : 'file-drop-disabled',\r\n close = !self.showClose ? '' : self._getLayoutTemplate('close'),\r\n preview = !self.showPreview ? '' : self._getLayoutTemplate('preview')\r\n .setTokens({'class': self.previewClass, 'dropClass': dropCss}),\r\n css = self.isDisabled ? self.captionClass + ' file-caption-disabled' : self.captionClass,\r\n caption = self.captionTemplate.setTokens({'class': css + ' kv-fileinput-caption'});\r\n return self.mainTemplate.setTokens({\r\n 'class': self.mainClass + (!self.showBrowse && self.showCaption ? ' no-browse' : ''),\r\n 'preview': preview,\r\n 'close': close,\r\n 'caption': caption,\r\n 'upload': self._renderButton('upload'),\r\n 'remove': self._renderButton('remove'),\r\n 'cancel': self._renderButton('cancel'),\r\n 'browse': self._renderButton('browse')\r\n });\r\n\r\n },\r\n _renderButton: function (type) {\r\n var self = this, tmplt = self._getLayoutTemplate('btnDefault'), css = self[type + 'Class'],\r\n title = self[type + 'Title'], icon = self[type + 'Icon'], label = self[type + 'Label'],\r\n status = self.isDisabled ? ' disabled' : '', btnType = 'button';\r\n switch (type) {\r\n case 'remove':\r\n if (!self.showRemove) {\r\n return '';\r\n }\r\n break;\r\n case 'cancel':\r\n if (!self.showCancel) {\r\n return '';\r\n }\r\n css += ' kv-hidden';\r\n break;\r\n case 'upload':\r\n if (!self.showUpload) {\r\n return '';\r\n }\r\n if (self.isAjaxUpload && !self.isDisabled) {\r\n tmplt = self._getLayoutTemplate('btnLink').replace('{href}', self.uploadUrl);\r\n } else {\r\n btnType = 'submit';\r\n }\r\n break;\r\n case 'browse':\r\n if (!self.showBrowse) {\r\n return '';\r\n }\r\n tmplt = self._getLayoutTemplate('btnBrowse');\r\n break;\r\n default:\r\n return '';\r\n }\r\n\r\n css += type === 'browse' ? ' btn-file' : ' fileinput-' + type + ' fileinput-' + type + '-button';\r\n if (!$h.isEmpty(label)) {\r\n label = ' ' + label + '';\r\n }\r\n return tmplt.setTokens({\r\n 'type': btnType, 'css': css, 'title': title, 'status': status, 'icon': icon, 'label': label\r\n });\r\n },\r\n _renderThumbProgress: function () {\r\n var self = this;\r\n return '
    ' +\r\n self.progressTemplate.setTokens({'percent': '0', 'status': self.msgUploadBegin}) +\r\n '
    ';\r\n },\r\n _renderFileFooter: function (caption, size, width, isError) {\r\n var self = this, config = self.fileActionSettings, rem = config.showRemove, drg = config.showDrag,\r\n upl = config.showUpload, zoom = config.showZoom, out,\r\n template = self._getLayoutTemplate('footer'), tInd = self._getLayoutTemplate('indicator'),\r\n ind = isError ? config.indicatorError : config.indicatorNew,\r\n title = isError ? config.indicatorErrorTitle : config.indicatorNewTitle,\r\n indicator = tInd.setTokens({'indicator': ind, 'indicatorTitle': title});\r\n size = self._getSize(size);\r\n if (self.isAjaxUpload) {\r\n out = template.setTokens({\r\n 'actions': self._renderFileActions(upl, false, rem, zoom, drg, false, false, false),\r\n 'caption': caption,\r\n 'size': size,\r\n 'width': width,\r\n 'progress': self._renderThumbProgress(),\r\n 'indicator': indicator\r\n });\r\n } else {\r\n out = template.setTokens({\r\n 'actions': self._renderFileActions(false, false, false, zoom, drg, false, false, false),\r\n 'caption': caption,\r\n 'size': size,\r\n 'width': width,\r\n 'progress': '',\r\n 'indicator': indicator\r\n });\r\n }\r\n out = $h.replaceTags(out, self.previewThumbTags);\r\n return out;\r\n },\r\n _renderFileActions: function (showUpl, showDwn, showDel, showZoom, showDrag, disabled, url, key, isInit, dUrl, dFile) {\r\n if (!showUpl && !showDwn && !showDel && !showZoom && !showDrag) {\r\n return '';\r\n }\r\n var self = this, vUrl = url === false ? '' : ' data-url=\"' + url + '\"',\r\n vKey = key === false ? '' : ' data-key=\"' + key + '\"', btnDelete = '', btnUpload = '', btnDownload = '',\r\n btnZoom = '', btnDrag = '', css, template = self._getLayoutTemplate('actions'),\r\n config = self.fileActionSettings,\r\n otherButtons = self.otherActionButtons.setTokens({'dataKey': vKey, 'key': key}),\r\n removeClass = disabled ? config.removeClass + ' disabled' : config.removeClass;\r\n if (showDel) {\r\n btnDelete = self._getLayoutTemplate('actionDelete').setTokens({\r\n 'removeClass': removeClass,\r\n 'removeIcon': config.removeIcon,\r\n 'removeTitle': config.removeTitle,\r\n 'dataUrl': vUrl,\r\n 'dataKey': vKey,\r\n 'key': key\r\n });\r\n }\r\n if (showUpl) {\r\n btnUpload = self._getLayoutTemplate('actionUpload').setTokens({\r\n 'uploadClass': config.uploadClass,\r\n 'uploadIcon': config.uploadIcon,\r\n 'uploadTitle': config.uploadTitle\r\n });\r\n }\r\n if (showDwn) {\r\n btnDownload = self._getLayoutTemplate('actionDownload').setTokens({\r\n 'downloadClass': config.downloadClass,\r\n 'downloadIcon': config.downloadIcon,\r\n 'downloadTitle': config.downloadTitle,\r\n 'downloadUrl': dUrl || self.initialPreviewDownloadUrl\r\n });\r\n btnDownload = btnDownload.setTokens({'filename': dFile, 'key': key});\r\n }\r\n if (showZoom) {\r\n btnZoom = self._getLayoutTemplate('actionZoom').setTokens({\r\n 'zoomClass': config.zoomClass,\r\n 'zoomIcon': config.zoomIcon,\r\n 'zoomTitle': config.zoomTitle\r\n });\r\n }\r\n if (showDrag && isInit) {\r\n css = 'drag-handle-init ' + config.dragClass;\r\n btnDrag = self._getLayoutTemplate('actionDrag').setTokens({\r\n 'dragClass': css,\r\n 'dragTitle': config.dragTitle,\r\n 'dragIcon': config.dragIcon\r\n });\r\n }\r\n return template.setTokens({\r\n 'delete': btnDelete,\r\n 'upload': btnUpload,\r\n 'download': btnDownload,\r\n 'zoom': btnZoom,\r\n 'drag': btnDrag,\r\n 'other': otherButtons\r\n });\r\n },\r\n _browse: function (e) {\r\n var self = this;\r\n self._raise('filebrowse');\r\n if (e && e.isDefaultPrevented()) {\r\n return;\r\n }\r\n if (self.isError && !self.isAjaxUpload) {\r\n self.clear();\r\n }\r\n self.$captionContainer.focus();\r\n },\r\n _filterDuplicate: function (file, files, fileIds) {\r\n var self = this, fileId = self._getFileId(file);\r\n if (fileId && fileIds && fileIds.indexOf(fileId) > -1) {\r\n return;\r\n }\r\n if (!fileIds) {\r\n fileIds = [];\r\n }\r\n files.push(file);\r\n fileIds.push(fileId);\r\n },\r\n _change: function (e) {\r\n var self = this, $el = self.$element;\r\n if (!self.isAjaxUpload && $h.isEmpty($el.val()) && self.fileInputCleared) { // IE 11 fix\r\n self.fileInputCleared = false;\r\n return;\r\n }\r\n self.fileInputCleared = false;\r\n var tfiles = [], msg, total, isDragDrop = arguments.length > 1, isAjaxUpload = self.isAjaxUpload, n, len,\r\n files = isDragDrop ? e.originalEvent.dataTransfer.files : $el.get(0).files, ctr = self.filestack.length,\r\n isSingleUpload = $h.isEmpty($el.attr('multiple')), flagSingle = (isSingleUpload && ctr > 0),\r\n folders = 0, fileIds = self._getFileIds(), throwError = function (mesg, file, previewId, index) {\r\n var p1 = $.extend(true, {}, self._getOutData({}, {}, files), {id: previewId, index: index}),\r\n p2 = {id: previewId, index: index, file: file, files: files};\r\n return self.isAjaxUpload ? self._showUploadError(mesg, p1) : self._showError(mesg, p2);\r\n };\r\n self.reader = null;\r\n self._resetUpload();\r\n self._hideFileIcon();\r\n if (self.isAjaxUpload) {\r\n self.$container.find('.file-drop-zone .' + self.dropZoneTitleClass).remove();\r\n }\r\n if (isDragDrop) {\r\n $.each(files, function (i, f) {\r\n if (f && !f.type && f.size !== undefined && f.size % 4096 === 0) {\r\n folders++;\r\n } else {\r\n self._filterDuplicate(f, tfiles, fileIds);\r\n }\r\n });\r\n } else {\r\n if (e.target && e.target.files === undefined) {\r\n files = e.target.value ? [{name: e.target.value.replace(/^.+\\\\/, '')}] : [];\r\n } else {\r\n files = e.target.files || {};\r\n }\r\n if (isAjaxUpload) {\r\n $.each(files, function (i, f) {\r\n self._filterDuplicate(f, tfiles, fileIds);\r\n });\r\n } else {\r\n tfiles = files;\r\n }\r\n }\r\n if ($h.isEmpty(tfiles) || tfiles.length === 0) {\r\n if (!isAjaxUpload) {\r\n self.clear();\r\n }\r\n self._showFolderError(folders);\r\n self._raise('fileselectnone');\r\n return;\r\n }\r\n self._resetErrors();\r\n len = tfiles.length;\r\n total = self._getFileCount(self.isAjaxUpload ? (self.getFileStack().length + len) : len);\r\n if (self.maxFileCount > 0 && total > self.maxFileCount) {\r\n if (!self.autoReplace || len > self.maxFileCount) {\r\n n = (self.autoReplace && len > self.maxFileCount) ? len : total;\r\n msg = self.msgFilesTooMany.replace('{m}', self.maxFileCount).replace('{n}', n);\r\n self.isError = throwError(msg, null, null, null);\r\n self.$captionContainer.removeClass('icon-visible');\r\n self._setCaption('', true);\r\n self.$container.removeClass('file-input-new file-input-ajax-new');\r\n return;\r\n }\r\n if (total > self.maxFileCount) {\r\n self._resetPreviewThumbs(isAjaxUpload);\r\n }\r\n } else {\r\n if (!isAjaxUpload || flagSingle) {\r\n self._resetPreviewThumbs(false);\r\n if (flagSingle) {\r\n self.clearStack();\r\n }\r\n } else {\r\n if (isAjaxUpload && ctr === 0 && (!self.previewCache.count() || self.overwriteInitial)) {\r\n self._resetPreviewThumbs(true);\r\n }\r\n }\r\n }\r\n if (self.isPreviewable) {\r\n self.readFiles(tfiles);\r\n } else {\r\n self._updateFileDetails(1);\r\n }\r\n self._showFolderError(folders);\r\n },\r\n _abort: function (params) {\r\n var self = this, data;\r\n if (self.ajaxAborted && typeof self.ajaxAborted === \"object\" && self.ajaxAborted.message !== undefined) {\r\n data = $.extend(true, {}, self._getOutData(), params);\r\n data.abortData = self.ajaxAborted.data || {};\r\n data.abortMessage = self.ajaxAborted.message;\r\n self._setProgress(101, self.$progress, self.msgCancelled);\r\n self._showUploadError(self.ajaxAborted.message, data, 'filecustomerror');\r\n self.cancel();\r\n return true;\r\n }\r\n return !!self.ajaxAborted;\r\n },\r\n _resetFileStack: function () {\r\n var self = this, i = 0, newstack = [], newnames = [], newids = [];\r\n self._getThumbs().each(function () {\r\n var $thumb = $(this), ind = $thumb.attr('data-fileindex'), file = self.filestack[ind],\r\n pid = $thumb.attr('id'), newId;\r\n if (ind === '-1' || ind === -1) {\r\n return;\r\n }\r\n if (file !== undefined) {\r\n newstack[i] = file;\r\n newnames[i] = self._getFileName(file);\r\n newids[i] = self._getFileId(file);\r\n $thumb.attr({'id': self.previewInitId + '-' + i, 'data-fileindex': i});\r\n i++;\r\n } else {\r\n newId = 'uploaded-' + $h.uniqId();\r\n $thumb.attr({'id': newId, 'data-fileindex': '-1'});\r\n self.$preview.find('#zoom-' + pid).attr('id', 'zoom-' + newId);\r\n }\r\n });\r\n self.filestack = newstack;\r\n self.filenames = newnames;\r\n self.fileids = newids;\r\n },\r\n _isFileSelectionValid: function (cnt) {\r\n var self = this;\r\n cnt = cnt || 0;\r\n if (self.required && !self.getFilesCount()) {\r\n self.$errorContainer.html('');\r\n self._showUploadError(self.msgFileRequired);\r\n return false;\r\n }\r\n if (self.minFileCount > 0 && self._getFileCount(cnt) < self.minFileCount) {\r\n self._noFilesError({});\r\n return false;\r\n }\r\n return true;\r\n },\r\n clearStack: function () {\r\n var self = this;\r\n self.filestack = [];\r\n self.filenames = [];\r\n self.fileids = [];\r\n return self.$element;\r\n },\r\n updateStack: function (i, file) {\r\n var self = this;\r\n self.filestack[i] = file;\r\n self.filenames[i] = self._getFileName(file);\r\n self.fileids[i] = file && self._getFileId(file) || null;\r\n return self.$element;\r\n },\r\n addToStack: function (file) {\r\n var self = this;\r\n self.filestack.push(file);\r\n self.filenames.push(self._getFileName(file));\r\n self.fileids.push(self._getFileId(file));\r\n return self.$element;\r\n },\r\n getFileStack: function (skipNull) {\r\n var self = this;\r\n return self.filestack.filter(function (n) {\r\n return (skipNull ? n !== undefined : n !== undefined && n !== null);\r\n });\r\n },\r\n getFilesCount: function () {\r\n var self = this, len = self.isAjaxUpload ? self.getFileStack().length : self.$element.get(0).files.length;\r\n return self._getFileCount(len);\r\n },\r\n readFiles: function (files) {\r\n this.reader = new FileReader();\r\n var self = this, $el = self.$element, $preview = self.$preview, reader = self.reader,\r\n $container = self.$previewContainer, $status = self.$previewStatus, msgLoading = self.msgLoading,\r\n msgProgress = self.msgProgress, previewInitId = self.previewInitId, numFiles = files.length,\r\n settings = self.fileTypeSettings, ctr = self.filestack.length, readFile,\r\n fileTypes = self.allowedFileTypes, typLen = fileTypes ? fileTypes.length : 0,\r\n fileExt = self.allowedFileExtensions, strExt = $h.isEmpty(fileExt) ? '' : fileExt.join(', '),\r\n maxPreviewSize = self.maxFilePreviewSize && parseFloat(self.maxFilePreviewSize),\r\n canPreview = $preview.length && (!maxPreviewSize || isNaN(maxPreviewSize)),\r\n throwError = function (msg, file, previewId, index) {\r\n var p1 = $.extend(true, {}, self._getOutData({}, {}, files), {id: previewId, index: index}),\r\n p2 = {id: previewId, index: index, file: file, files: files}, $thumb;\r\n self._previewDefault(file, previewId, true);\r\n if (self.isAjaxUpload) {\r\n self.addToStack(undefined);\r\n setTimeout(function () {\r\n readFile(index + 1);\r\n }, 100);\r\n } else {\r\n numFiles = 0;\r\n }\r\n self._initFileActions();\r\n $thumb = $('#' + previewId);\r\n $thumb.find('.kv-file-upload').hide();\r\n if (self.removeFromPreviewOnError) {\r\n $thumb.remove();\r\n }\r\n self.isError = self.isAjaxUpload ? self._showUploadError(msg, p1) : self._showError(msg, p2);\r\n self._updateFileDetails(numFiles);\r\n };\r\n\r\n self.loadedImages = [];\r\n self.totalImagesCount = 0;\r\n\r\n $.each(files, function (key, file) {\r\n var func = self.fileTypeSettings.image;\r\n if (func && func(file.type)) {\r\n self.totalImagesCount++;\r\n }\r\n });\r\n readFile = function (i) {\r\n if ($h.isEmpty($el.attr('multiple'))) {\r\n numFiles = 1;\r\n }\r\n if (i >= numFiles) {\r\n if (self.isAjaxUpload && self.filestack.length > 0) {\r\n self._raise('filebatchselected', [self.getFileStack()]);\r\n } else {\r\n self._raise('filebatchselected', [files]);\r\n }\r\n $container.removeClass('file-thumb-loading');\r\n $status.html('');\r\n return;\r\n }\r\n var node = ctr + i, previewId = previewInitId + \"-\" + node, file = files[i], fSizeKB, j, msg,\r\n fnText = settings.text, fnImage = settings.image, fnHtml = settings.html, typ, chk, typ1, typ2,\r\n caption = file.name ? self.slug(file.name) : '', fileSize = (file.size || 0) / 1000,\r\n fileExtExpr = '', previewData = $h.objUrl.createObjectURL(file), fileCount = 0, strTypes = '',\r\n func, knownTypes = 0, isText, isHtml, isImage, txtFlag, processFileLoaded = function () {\r\n var msg = msgProgress.setTokens({\r\n 'index': i + 1,\r\n 'files': numFiles,\r\n 'percent': 50,\r\n 'name': caption\r\n });\r\n setTimeout(function () {\r\n $status.html(msg);\r\n self._updateFileDetails(numFiles);\r\n readFile(i + 1);\r\n }, 100);\r\n self._raise('fileloaded', [file, previewId, i, reader]);\r\n };\r\n if (typLen > 0) {\r\n for (j = 0; j < typLen; j++) {\r\n typ1 = fileTypes[j];\r\n typ2 = self.msgFileTypes[typ1] || typ1;\r\n strTypes += j === 0 ? typ2 : ', ' + typ2;\r\n }\r\n }\r\n if (caption === false) {\r\n readFile(i + 1);\r\n return;\r\n }\r\n if (caption.length === 0) {\r\n msg = self.msgInvalidFileName.replace('{name}', $h.htmlEncode(file.name));\r\n throwError(msg, file, previewId, i);\r\n return;\r\n }\r\n if (!$h.isEmpty(fileExt)) {\r\n fileExtExpr = new RegExp('\\\\.(' + fileExt.join('|') + ')$', 'i');\r\n }\r\n fSizeKB = fileSize.toFixed(2);\r\n if (self.maxFileSize > 0 && fileSize > self.maxFileSize) {\r\n msg = self.msgSizeTooLarge.setTokens({\r\n 'name': caption,\r\n 'size': fSizeKB,\r\n 'maxSize': self.maxFileSize\r\n });\r\n throwError(msg, file, previewId, i);\r\n return;\r\n }\r\n if (self.minFileSize !== null && fileSize <= $h.getNum(self.minFileSize)) {\r\n msg = self.msgSizeTooSmall.setTokens({\r\n 'name': caption,\r\n 'size': fSizeKB,\r\n 'minSize': self.minFileSize\r\n });\r\n throwError(msg, file, previewId, i);\r\n return;\r\n }\r\n if (!$h.isEmpty(fileTypes) && $h.isArray(fileTypes)) {\r\n for (j = 0; j < fileTypes.length; j += 1) {\r\n typ = fileTypes[j];\r\n func = settings[typ];\r\n fileCount += !func || (typeof func !== 'function') ? 0 : (func(file.type, file.name) ? 1 : 0);\r\n }\r\n if (fileCount === 0) {\r\n msg = self.msgInvalidFileType.setTokens({'name': caption, 'types': strTypes});\r\n throwError(msg, file, previewId, i);\r\n return;\r\n }\r\n }\r\n if (fileCount === 0 && !$h.isEmpty(fileExt) && $h.isArray(fileExt) && !$h.isEmpty(fileExtExpr)) {\r\n chk = $h.compare(caption, fileExtExpr);\r\n fileCount += $h.isEmpty(chk) ? 0 : chk.length;\r\n if (fileCount === 0) {\r\n msg = self.msgInvalidFileExtension.setTokens({'name': caption, 'extensions': strExt});\r\n throwError(msg, file, previewId, i);\r\n return;\r\n }\r\n }\r\n if (!self.showPreview) {\r\n if (self.isAjaxUpload) {\r\n self.addToStack(file);\r\n }\r\n setTimeout(function () {\r\n readFile(i + 1);\r\n self._updateFileDetails(numFiles);\r\n }, 100);\r\n self._raise('fileloaded', [file, previewId, i, reader]);\r\n return;\r\n }\r\n if (!canPreview && fileSize > maxPreviewSize) {\r\n self.addToStack(file);\r\n $container.addClass('file-thumb-loading');\r\n self._previewDefault(file, previewId);\r\n self._initFileActions();\r\n self._updateFileDetails(numFiles);\r\n readFile(i + 1);\r\n return;\r\n }\r\n if ($preview.length && FileReader !== undefined) {\r\n isText = fnText(file.type, caption);\r\n isHtml = fnHtml(file.type, caption);\r\n isImage = fnImage(file.type, caption);\r\n $status.html(msgLoading.replace('{index}', i + 1).replace('{files}', numFiles));\r\n $container.addClass('file-thumb-loading');\r\n reader.onerror = function (evt) {\r\n self._errorHandler(evt, caption);\r\n };\r\n reader.onload = function (theFile) {\r\n var hex, fileInfo, uint, byte, bytes = [], contents, mime, readTextImage = function (textFlag) {\r\n var newReader = new FileReader();\r\n newReader.onerror = function (theFileNew) {\r\n self._errorHandler(theFileNew, caption);\r\n };\r\n newReader.onload = function (theFileNew) {\r\n self._previewFile(i, file, theFileNew, previewId, previewData, fileInfo);\r\n self._initFileActions();\r\n processFileLoaded();\r\n };\r\n if (textFlag) {\r\n newReader.readAsText(file, self.textEncoding);\r\n } else {\r\n newReader.readAsDataURL(file);\r\n }\r\n };\r\n fileInfo = {'name': caption, 'type': file.type};\r\n $.each(settings, function (key, func) {\r\n if (key !== 'object' && key !== 'other' && func(file.type, caption)) {\r\n knownTypes++;\r\n }\r\n });\r\n if (knownTypes === 0) {// auto detect mime types from content if no known file types detected\r\n uint = new Uint8Array(theFile.target.result);\r\n for (j = 0; j < uint.length; j++) {\r\n byte = uint[j].toString(16);\r\n bytes.push(byte);\r\n }\r\n hex = bytes.join('').toLowerCase().substring(0, 8);\r\n mime = $h.getMimeType(hex, '', '');\r\n if ($h.isEmpty(mime)) { // look for ascii text content\r\n contents = $h.arrayBuffer2String(reader.result);\r\n mime = $h.isSvg(contents) ? 'image/svg+xml' : $h.getMimeType(hex, contents, file.type);\r\n }\r\n fileInfo = {'name': caption, 'type': mime};\r\n isText = fnText(mime, '');\r\n isHtml = fnHtml(mime, '');\r\n isImage = fnImage(mime, '');\r\n txtFlag = isText || isHtml;\r\n if (txtFlag || isImage) {\r\n readTextImage(txtFlag);\r\n return;\r\n }\r\n }\r\n self._previewFile(i, file, theFile, previewId, previewData, fileInfo);\r\n self._initFileActions();\r\n processFileLoaded();\r\n };\r\n reader.onprogress = function (data) {\r\n if (data.lengthComputable) {\r\n var fact = (data.loaded / data.total) * 100, progress = Math.ceil(fact);\r\n msg = msgProgress.setTokens({\r\n 'index': i + 1,\r\n 'files': numFiles,\r\n 'percent': progress,\r\n 'name': caption\r\n });\r\n setTimeout(function () {\r\n $status.html(msg);\r\n }, 100);\r\n }\r\n };\r\n\r\n if (isText || isHtml) {\r\n reader.readAsText(file, self.textEncoding);\r\n } else {\r\n if (isImage) {\r\n reader.readAsDataURL(file);\r\n } else {\r\n reader.readAsArrayBuffer(file);\r\n }\r\n }\r\n } else {\r\n self._previewDefault(file, previewId);\r\n setTimeout(function () {\r\n readFile(i + 1);\r\n self._updateFileDetails(numFiles);\r\n }, 100);\r\n self._raise('fileloaded', [file, previewId, i, reader]);\r\n }\r\n self.addToStack(file);\r\n };\r\n\r\n readFile(0);\r\n self._updateFileDetails(numFiles, false);\r\n },\r\n lock: function () {\r\n var self = this;\r\n self._resetErrors();\r\n self.disable();\r\n if (self.showRemove) {\r\n self.$container.find('.fileinput-remove').hide();\r\n }\r\n if (self.showCancel) {\r\n self.$container.find('.fileinput-cancel').show();\r\n }\r\n self._raise('filelock', [self.filestack, self._getExtraData()]);\r\n return self.$element;\r\n },\r\n unlock: function (reset) {\r\n var self = this;\r\n if (reset === undefined) {\r\n reset = true;\r\n }\r\n self.enable();\r\n if (self.showCancel) {\r\n self.$container.find('.fileinput-cancel').hide();\r\n }\r\n if (self.showRemove) {\r\n self.$container.find('.fileinput-remove').show();\r\n }\r\n if (reset) {\r\n self._resetFileStack();\r\n }\r\n self._raise('fileunlock', [self.filestack, self._getExtraData()]);\r\n return self.$element;\r\n },\r\n cancel: function () {\r\n var self = this, xhr = self.ajaxRequests, len = xhr.length, i;\r\n if (len > 0) {\r\n for (i = 0; i < len; i += 1) {\r\n self.cancelling = true;\r\n xhr[i].abort();\r\n }\r\n }\r\n self._setProgressCancelled();\r\n self._getThumbs().each(function () {\r\n var $thumb = $(this), ind = $thumb.attr('data-fileindex');\r\n $thumb.removeClass('file-uploading');\r\n if (self.filestack[ind] !== undefined) {\r\n $thumb.find('.kv-file-upload').removeClass('disabled').removeAttr('disabled');\r\n $thumb.find('.kv-file-remove').removeClass('disabled').removeAttr('disabled');\r\n }\r\n self.unlock();\r\n });\r\n return self.$element;\r\n },\r\n clear: function () {\r\n var self = this, cap;\r\n if (!self._raise('fileclear')) {\r\n return;\r\n }\r\n self.$btnUpload.removeAttr('disabled');\r\n self._getThumbs().find('video,audio,img').each(function () {\r\n $h.cleanMemory($(this));\r\n });\r\n self._resetUpload();\r\n self.clearStack();\r\n self._clearFileInput();\r\n self._resetErrors(true);\r\n if (self._hasInitialPreview()) {\r\n self._showFileIcon();\r\n self._resetPreview();\r\n self._initPreviewActions();\r\n self.$container.removeClass('file-input-new');\r\n } else {\r\n self._getThumbs().each(function () {\r\n self._clearObjects($(this));\r\n });\r\n if (self.isAjaxUpload) {\r\n self.previewCache.data = {};\r\n }\r\n self.$preview.html('');\r\n cap = (!self.overwriteInitial && self.initialCaption.length > 0) ? self.initialCaption : '';\r\n self.$caption.attr('title', '').val(cap);\r\n $h.addCss(self.$container, 'file-input-new');\r\n self._validateDefaultPreview();\r\n }\r\n if (self.$container.find($h.FRAMES).length === 0) {\r\n if (!self._initCaption()) {\r\n self.$captionContainer.removeClass('icon-visible');\r\n }\r\n }\r\n self._hideFileIcon();\r\n self._raise('filecleared');\r\n self.$captionContainer.focus();\r\n self._setFileDropZoneTitle();\r\n return self.$element;\r\n },\r\n reset: function () {\r\n var self = this;\r\n if (!self._raise('filereset')) {\r\n return;\r\n }\r\n self._resetPreview();\r\n self.$container.find('.fileinput-filename').text('');\r\n $h.addCss(self.$container, 'file-input-new');\r\n if (self.getFrames().length || self.isAjaxUpload && self.dropZoneEnabled) {\r\n self.$container.removeClass('file-input-new');\r\n }\r\n self.clearStack();\r\n self.formdata = {};\r\n self._setFileDropZoneTitle();\r\n return self.$element;\r\n },\r\n disable: function () {\r\n var self = this;\r\n self.isDisabled = true;\r\n self._raise('filedisabled');\r\n self.$element.attr('disabled', 'disabled');\r\n self.$container.find(\".kv-fileinput-caption\").addClass(\"file-caption-disabled\");\r\n self.$container.find(\".fileinput-remove, .fileinput-upload, .file-preview-frame button\")\r\n .attr(\"disabled\", true);\r\n $h.addCss(self.$container.find('.btn-file'), 'disabled');\r\n self._initDragDrop();\r\n return self.$element;\r\n },\r\n enable: function () {\r\n var self = this;\r\n self.isDisabled = false;\r\n self._raise('fileenabled');\r\n self.$element.removeAttr('disabled');\r\n self.$container.find(\".kv-fileinput-caption\").removeClass(\"file-caption-disabled\");\r\n self.$container.find(\".fileinput-remove, .fileinput-upload, .file-preview-frame button\")\r\n .removeAttr(\"disabled\");\r\n self.$container.find('.btn-file').removeClass('disabled');\r\n self._initDragDrop();\r\n return self.$element;\r\n },\r\n upload: function () {\r\n var self = this, totLen = self.getFileStack().length, i, outData, len,\r\n hasExtraData = !$.isEmptyObject(self._getExtraData());\r\n if (!self.isAjaxUpload || self.isDisabled || !self._isFileSelectionValid(totLen)) {\r\n return;\r\n }\r\n self._resetUpload();\r\n if (totLen === 0 && !hasExtraData) {\r\n self._showUploadError(self.msgUploadEmpty);\r\n return;\r\n }\r\n self.$progress.show();\r\n self.uploadCount = 0;\r\n self.uploadStatus = {};\r\n self.uploadLog = [];\r\n self.lock();\r\n self._setProgress(2);\r\n if (totLen === 0 && hasExtraData) {\r\n self._uploadExtraOnly();\r\n return;\r\n }\r\n len = self.filestack.length;\r\n self.hasInitData = false;\r\n if (self.uploadAsync) {\r\n outData = self._getOutData();\r\n self._raise('filebatchpreupload', [outData]);\r\n self.fileBatchCompleted = false;\r\n self.uploadCache = {content: [], config: [], tags: [], append: true};\r\n self.uploadAsyncCount = self.getFileStack().length;\r\n for (i = 0; i < len; i++) {\r\n self.uploadCache.content[i] = null;\r\n self.uploadCache.config[i] = null;\r\n self.uploadCache.tags[i] = null;\r\n }\r\n self.$preview.find('.file-preview-initial').removeClass($h.SORT_CSS);\r\n self._initSortable();\r\n self.cacheInitialPreview = self.getPreview();\r\n\r\n for (i = 0; i < len; i++) {\r\n if (self.filestack[i]) {\r\n self._uploadSingle(i, true);\r\n }\r\n }\r\n return;\r\n }\r\n self._uploadBatch();\r\n return self.$element;\r\n },\r\n destroy: function () {\r\n var self = this, $form = self.$form, $cont = self.$container, $el = self.$element, ns = self.namespace;\r\n $(document).off(ns);\r\n $(window).off(ns);\r\n if ($form && $form.length) {\r\n $form.off(ns);\r\n }\r\n if (self.isAjaxUpload) {\r\n self._clearFileInput();\r\n }\r\n self._cleanup();\r\n self._initPreviewCache();\r\n $el.insertBefore($cont).off(ns).removeData();\r\n $cont.off().remove();\r\n return $el;\r\n },\r\n refresh: function (options, triggerChange) {\r\n var self = this, $el = self.$element;\r\n if (typeof options !== 'object' || $h.isEmpty(options)) {\r\n options = self.options;\r\n } else {\r\n options = $.extend(true, {}, self.options, options);\r\n }\r\n self._init(options, true);\r\n self._listen();\r\n if (triggerChange) {\r\n $el.trigger('change' + self.namespace);\r\n }\r\n return $el;\r\n },\r\n zoom: function (frameId) {\r\n var self = this, $frame = self._getFrame(frameId), $modal = self.$modal;\r\n if (!$frame) {\r\n return;\r\n }\r\n $h.initModal($modal);\r\n $modal.html(self._getModalContent());\r\n self._setZoomContent($frame);\r\n $modal.modal('show');\r\n self._initZoomButtons();\r\n },\r\n getExif: function (frameId) {\r\n var self = this, $frame = self._getFrame(frameId);\r\n return $frame && $frame.data('exif') || null;\r\n },\r\n getFrames: function (cssFilter) {\r\n var self = this;\r\n cssFilter = cssFilter || '';\r\n return self.$preview.find($h.FRAMES + cssFilter);\r\n },\r\n getPreview: function () {\r\n var self = this;\r\n return {\r\n content: self.initialPreview,\r\n config: self.initialPreviewConfig,\r\n tags: self.initialPreviewThumbTags\r\n };\r\n }\r\n };\r\n\r\n $.fn.fileinput = function (option) {\r\n if (!$h.hasFileAPISupport() && !$h.isIE(9)) {\r\n return;\r\n }\r\n var args = Array.apply(null, arguments), retvals = [];\r\n args.shift();\r\n this.each(function () {\r\n var self = $(this), data = self.data('fileinput'), options = typeof option === 'object' && option,\r\n theme = options.theme || self.data('theme'), l = {}, t = {},\r\n lang = options.language || self.data('language') || $.fn.fileinput.defaults.language || 'en', opt;\r\n if (!data) {\r\n if (theme) {\r\n t = $.fn.fileinputThemes[theme] || {};\r\n }\r\n if (lang !== 'en' && !$h.isEmpty($.fn.fileinputLocales[lang])) {\r\n l = $.fn.fileinputLocales[lang] || {};\r\n }\r\n opt = $.extend(true, {}, $.fn.fileinput.defaults, t, $.fn.fileinputLocales.en, l, options, self.data());\r\n data = new FileInput(this, opt);\r\n self.data('fileinput', data);\r\n }\r\n\r\n if (typeof option === 'string') {\r\n retvals.push(data[option].apply(data, args));\r\n }\r\n });\r\n switch (retvals.length) {\r\n case 0:\r\n return this;\r\n case 1:\r\n return retvals[0];\r\n default:\r\n return retvals;\r\n }\r\n };\r\n\r\n $.fn.fileinput.defaults = {\r\n language: 'en',\r\n showCaption: true,\r\n showBrowse: true,\r\n showPreview: true,\r\n showRemove: true,\r\n showUpload: true,\r\n showCancel: true,\r\n showClose: true,\r\n showUploadedThumbs: true,\r\n browseOnZoneClick: false,\r\n autoReplace: false,\r\n autoOrientImage: true, // for JPEG images based on EXIF orientation tag\r\n required: false,\r\n rtl: false,\r\n hideThumbnailContent: false,\r\n generateFileId: null,\r\n previewClass: '',\r\n captionClass: '',\r\n frameClass: 'krajee-default',\r\n mainClass: 'file-caption-main',\r\n mainTemplate: null,\r\n purifyHtml: true,\r\n fileSizeGetter: null,\r\n initialCaption: '',\r\n initialPreview: [],\r\n initialPreviewDelimiter: '*$$*',\r\n initialPreviewAsData: false,\r\n initialPreviewFileType: 'image',\r\n initialPreviewConfig: [],\r\n initialPreviewThumbTags: [],\r\n previewThumbTags: {},\r\n initialPreviewShowDelete: true,\r\n initialPreviewDownloadUrl: '',\r\n removeFromPreviewOnError: false,\r\n deleteUrl: '',\r\n deleteExtraData: {},\r\n overwriteInitial: true,\r\n previewZoomButtonIcons: {\r\n prev: '',\r\n next: '',\r\n toggleheader: '',\r\n fullscreen: '',\r\n borderless: '',\r\n close: ''\r\n },\r\n previewZoomButtonClasses: {\r\n prev: 'btn btn-navigate',\r\n next: 'btn btn-navigate',\r\n toggleheader: 'btn btn-kv btn-outline-secondary',\r\n fullscreen: 'btn btn-kv btn-outline-secondary',\r\n borderless: 'btn btn-kv btn-outline-secondary',\r\n close: 'btn btn-kv btn-outline-secondary'\r\n },\r\n preferIconicPreview: false,\r\n preferIconicZoomPreview: false,\r\n allowedPreviewTypes: undefined,\r\n allowedPreviewMimeTypes: null,\r\n allowedFileTypes: null,\r\n allowedFileExtensions: null,\r\n defaultPreviewContent: null,\r\n customLayoutTags: {},\r\n customPreviewTags: {},\r\n previewFileIcon: '',\r\n previewFileIconClass: 'file-other-icon',\r\n previewFileIconSettings: {},\r\n previewFileExtSettings: {},\r\n buttonLabelClass: 'hidden-xs',\r\n browseIcon: ' ',\r\n browseClass: 'btn btn-primary',\r\n removeIcon: '',\r\n removeClass: 'btn btn-secondary',\r\n cancelIcon: '',\r\n cancelClass: 'btn btn-secondary',\r\n uploadIcon: '',\r\n uploadClass: 'btn btn-secondary',\r\n uploadUrl: null,\r\n uploadUrlThumb: null,\r\n uploadAsync: true,\r\n uploadExtraData: {},\r\n zoomModalHeight: 480,\r\n minImageWidth: null,\r\n minImageHeight: null,\r\n maxImageWidth: null,\r\n maxImageHeight: null,\r\n resizeImage: false,\r\n resizePreference: 'width',\r\n resizeQuality: 0.92,\r\n resizeDefaultImageType: 'image/jpeg',\r\n resizeIfSizeMoreThan: 0, // in KB\r\n minFileSize: 0,\r\n maxFileSize: 0,\r\n maxFilePreviewSize: 25600, // 25 MB\r\n minFileCount: 0,\r\n maxFileCount: 0,\r\n validateInitialCount: false,\r\n msgValidationErrorClass: 'text-danger',\r\n msgValidationErrorIcon: ' ',\r\n msgErrorClass: 'file-error-message',\r\n progressThumbClass: \"progress-bar bg-success progress-bar-success progress-bar-striped active\",\r\n progressClass: \"progress-bar bg-success progress-bar-success progress-bar-striped active\",\r\n progressCompleteClass: \"progress-bar bg-success progress-bar-success\",\r\n progressErrorClass: \"progress-bar bg-danger progress-bar-danger\",\r\n progressUploadThreshold: 99,\r\n previewFileType: 'image',\r\n elCaptionContainer: null,\r\n elCaptionText: null,\r\n elPreviewContainer: null,\r\n elPreviewImage: null,\r\n elPreviewStatus: null,\r\n elErrorContainer: null,\r\n errorCloseButton: $h.closeButton('kv-error-close'),\r\n slugCallback: null,\r\n dropZoneEnabled: true,\r\n dropZoneTitleClass: 'file-drop-zone-title',\r\n fileActionSettings: {},\r\n otherActionButtons: '',\r\n textEncoding: 'UTF-8',\r\n ajaxSettings: {},\r\n ajaxDeleteSettings: {},\r\n showAjaxErrorDetails: true,\r\n mergeAjaxCallbacks: false,\r\n mergeAjaxDeleteCallbacks: false,\r\n retryErrorUploads: true\r\n };\r\n\r\n $.fn.fileinputLocales.en = {\r\n fileSingle: 'file',\r\n filePlural: 'files',\r\n browseLabel: 'Browse …',\r\n removeLabel: 'Remove',\r\n removeTitle: 'Clear selected files',\r\n cancelLabel: 'Cancel',\r\n cancelTitle: 'Abort ongoing upload',\r\n uploadLabel: 'Upload',\r\n uploadTitle: 'Upload selected files',\r\n msgNo: 'No',\r\n msgNoFilesSelected: 'No files selected',\r\n msgCancelled: 'Cancelled',\r\n msgPlaceholder: 'Select {files}...',\r\n msgZoomModalHeading: 'Detailed Preview',\r\n msgFileRequired: 'You must select a file to upload.',\r\n msgSizeTooSmall: 'File \"{name}\" ({size} KB) is too small and must be larger than {minSize} KB.',\r\n msgSizeTooLarge: 'File \"{name}\" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB.',\r\n msgFilesTooLess: 'You must select at least {n} {files} to upload.',\r\n msgFilesTooMany: 'Number of files selected for upload ({n}) exceeds maximum allowed limit of {m}.',\r\n msgFileNotFound: 'File \"{name}\" not found!',\r\n msgFileSecured: 'Security restrictions prevent reading the file \"{name}\".',\r\n msgFileNotReadable: 'File \"{name}\" is not readable.',\r\n msgFilePreviewAborted: 'File preview aborted for \"{name}\".',\r\n msgFilePreviewError: 'An error occurred while reading the file \"{name}\".',\r\n msgInvalidFileName: 'Invalid or unsupported characters in file name \"{name}\".',\r\n msgInvalidFileType: 'Invalid type for file \"{name}\". Only \"{types}\" files are supported.',\r\n msgInvalidFileExtension: 'Invalid extension for file \"{name}\". Only \"{extensions}\" files are supported.',\r\n msgFileTypes: {\r\n 'image': 'image',\r\n 'html': 'HTML',\r\n 'text': 'text',\r\n 'video': 'video',\r\n 'audio': 'audio',\r\n 'flash': 'flash',\r\n 'pdf': 'PDF',\r\n 'object': 'object'\r\n },\r\n msgUploadAborted: 'The file upload was aborted',\r\n msgUploadThreshold: 'Processing...',\r\n msgUploadBegin: 'Initializing...',\r\n msgUploadEnd: 'Done',\r\n msgUploadEmpty: 'No valid data available for upload.',\r\n msgUploadError: 'Error',\r\n msgValidationError: 'Validation Error',\r\n msgLoading: 'Loading file {index} of {files} …',\r\n msgProgress: 'Loading file {index} of {files} - {name} - {percent}% completed.',\r\n msgSelected: '{n} {files} selected',\r\n msgFoldersNotAllowed: 'Drag & drop files only! {n} folder(s) dropped were skipped.',\r\n msgImageWidthSmall: 'Width of image file \"{name}\" must be at least {size} px.',\r\n msgImageHeightSmall: 'Height of image file \"{name}\" must be at least {size} px.',\r\n msgImageWidthLarge: 'Width of image file \"{name}\" cannot exceed {size} px.',\r\n msgImageHeightLarge: 'Height of image file \"{name}\" cannot exceed {size} px.',\r\n msgImageResizeError: 'Could not get the image dimensions to resize.',\r\n msgImageResizeException: 'Error while resizing the image.
    {errors}
    ',\r\n msgAjaxError: 'Something went wrong with the {operation} operation. Please try again later!',\r\n msgAjaxProgressError: '{operation} failed',\r\n ajaxOperations: {\r\n deleteThumb: 'file delete',\r\n uploadThumb: 'file upload',\r\n uploadBatch: 'batch file upload',\r\n uploadExtra: 'form data upload'\r\n },\r\n dropZoneTitle: 'Drag & drop files here …',\r\n dropZoneClickTitle: '
    (or click to select {files})',\r\n previewZoomButtonTitles: {\r\n prev: 'View previous file',\r\n next: 'View next file',\r\n toggleheader: 'Toggle header',\r\n fullscreen: 'Toggle full screen',\r\n borderless: 'Toggle borderless mode',\r\n close: 'Close detailed preview'\r\n }\r\n };\r\n\r\n $.fn.fileinput.Constructor = FileInput;\r\n\r\n /**\r\n * Convert automatically file inputs with class 'file' into a bootstrap fileinput control.\r\n */\r\n $(document).ready(function () {\r\n var $input = $('input.file[type=file]');\r\n if ($input.length) {\r\n $input.fileinput();\r\n }\r\n });\r\n}));","/*!\r\n * FileInput Romanian Translations\r\n *\r\n * This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or\r\n * any HTML markup tags in the messages must not be converted or translated.\r\n *\r\n * @see http://github.com/kartik-v/bootstrap-fileinput\r\n * @author Ciprian Voicu \r\n *\r\n * NOTE: this file must be saved in UTF-8 encoding.\r\n */\r\n(function ($) {\r\n \"use strict\";\r\n\r\n $.fn.fileinputLocales['ro'] = {\r\n fileSingle: 'fiÈ™ier',\r\n filePlural: 'fiÈ™iere',\r\n browseLabel: ' Incarca documentul',\r\n removeLabel: 'Șterge',\r\n removeTitle: 'Curăță fiÈ™ierele selectate',\r\n cancelLabel: 'Renunță',\r\n cancelTitle: 'Anulează încărcarea curentă',\r\n uploadLabel: 'ÃŽncarcă',\r\n uploadTitle: 'ÃŽncarcă fiÈ™ierele selectate',\r\n msgNo: 'Nu',\r\n msgNoFilesSelected: '',\r\n msgCancelled: 'Anulat',\r\n msgPlaceholder: 'Select {files}...',\r\n msgZoomModalHeading: 'Previzualizare detaliată',\r\n msgFileRequired: 'You must select a file to upload.',\r\n msgSizeTooSmall: 'File \"{name}\" ({size} KB) is too small and must be larger than {minSize} KB.',\r\n msgSizeTooLarge: 'FiÈ™ierul \"{name}\" ({size} KB) depășeÈ™te limita maximă de încărcare de {maxSize} KB.',\r\n msgFilesTooLess: 'Trebuie să selectezi cel puÈ›in {n} {files} pentru a încărca.',\r\n msgFilesTooMany: 'Numărul fiÈ™ierelor pentru încărcare ({n}) depășeÈ™te limita maximă de {m}.',\r\n msgFileNotFound: 'FiÈ™ierul \"{name}\" nu a fost găsit!',\r\n msgFileSecured: 'RestricÈ›ii de securitate previn citirea fiÈ™ierului \"{name}\".',\r\n msgFileNotReadable: 'FiÈ™ierul \"{name}\" nu se poate citi.',\r\n msgFilePreviewAborted: 'FiÈ™ierului \"{name}\" nu poate fi previzualizat.',\r\n msgFilePreviewError: 'A intervenit o eroare în încercarea de citire a fiÈ™ierului \"{name}\".',\r\n msgInvalidFileName: 'Invalid or unsupported characters in file name \"{name}\".',\r\n msgInvalidFileType: 'Tip de fiÈ™ier incorect pentru \"{name}\". Sunt suportate doar fiÈ™iere de tipurile \"{types}\".',\r\n msgInvalidFileExtension: 'Extensie incorectă pentru \"{name}\". Sunt suportate doar extensiile \"{extensions}\".',\r\n msgFileTypes: {\r\n 'image': 'image',\r\n 'html': 'HTML',\r\n 'text': 'text',\r\n 'video': 'video',\r\n 'audio': 'audio',\r\n 'flash': 'flash',\r\n 'pdf': 'PDF',\r\n 'object': 'object'\r\n },\r\n msgUploadAborted: 'FiÈ™ierul ÃŽncărcarea a fost întrerupt',\r\n msgUploadThreshold: 'Processing...',\r\n msgUploadBegin: 'Initializing...',\r\n msgUploadEnd: 'Done',\r\n msgUploadEmpty: 'No valid data available for upload.',\r\n msgUploadError: 'Error',\r\n msgValidationError: 'Eroare de validare',\r\n msgLoading: 'Se încarcă fiÈ™ierul {index} din {files} …',\r\n msgProgress: 'Se încarcă fiÈ™ierul {index} din {files} - {name} - {percent}% încărcat.',\r\n msgSelected: '{n} {files} încărcate',\r\n msgFoldersNotAllowed: 'Se poate doar trăgând fiÈ™ierele! Se renunță la {n} dosar(e).',\r\n msgImageWidthSmall: 'Lățimea de fiÈ™ier de imagine \"{name}\" trebuie să fie de cel puÈ›in {size} px.',\r\n msgImageHeightSmall: 'ÃŽnălÈ›imea fiÈ™ier imagine \"{name}\" trebuie să fie de cel puÈ›in {size} px.',\r\n msgImageWidthLarge: 'Lățimea de fiÈ™ier de imagine \"{name}\" nu poate depăși {size} px.',\r\n msgImageHeightLarge: 'ÃŽnălÈ›imea fiÈ™ier imagine \"{name}\" nu poate depăși {size} px.',\r\n msgImageResizeError: 'Nu a putut obÈ›ine dimensiunile imaginii pentru a redimensiona.',\r\n msgImageResizeException: 'Eroare la redimensionarea imaginii.
    {errors}
    ',\r\n msgAjaxError: 'Something went wrong with the {operation} operation. Please try again later!',\r\n msgAjaxProgressError: '{operation} failed',\r\n ajaxOperations: {\r\n deleteThumb: 'file delete',\r\n uploadThumb: 'file upload',\r\n uploadBatch: 'batch file upload',\r\n uploadExtra: 'form data upload'\r\n },\r\n dropZoneTitle: 'Plasati fișierele aici pentru incarcare',\r\n dropZoneClickTitle: '
    sau Selectati din computer',\r\n fileActionSettings: {\r\n removeTitle: 'Scoateți fișier',\r\n uploadTitle: 'Incarca fisier',\r\n uploadRetryTitle: 'Retry upload',\r\n downloadTitle: 'Download file',\r\n zoomTitle: 'Vezi detalii',\r\n dragTitle: 'Move / Rearrange',\r\n indicatorNewTitle: 'Nu a încărcat încă',\r\n indicatorSuccessTitle: 'încărcat',\r\n indicatorErrorTitle: 'Încărcați eroare',\r\n indicatorLoadingTitle: 'Se încarcă ...'\r\n },\r\n previewZoomButtonTitles: {\r\n prev: 'View previous file',\r\n next: 'View next file',\r\n toggleheader: 'Toggle header',\r\n fullscreen: 'Toggle full screen',\r\n borderless: 'Toggle borderless mode',\r\n close: 'Close detailed preview'\r\n }\r\n };\r\n})(window.jQuery);\r\n","/*\r\n* jQuery Mobile v1.5.0-alpha.1\r\n* http://jquerymobile.com\r\n*\r\n* Copyright jQuery Foundation, Inc. and other contributors\r\n* Released under the MIT license.\r\n* http://jquery.org/license\r\n*\r\n*/\r\n\r\n(function ( root, doc, factory ) {\r\n\tif ( typeof define === \"function\" && define.amd ) {\r\n\t\t// AMD. Register as an anonymous module.\r\n\t\tdefine( [ \"jquery\" ], function ( $ ) {\r\n\t\t\tfactory( $, root, doc );\r\n\t\t\treturn $.mobile;\r\n\t\t});\r\n\t} else {\r\n\t\t// Browser globals\r\n\t\tfactory( root.jQuery, root, doc );\r\n\t}\r\n}( this, document, function ( jQuery, window, document, undefined ) {/*!\r\n * jQuery Mobile Virtual Mouse @VERSION\r\n * http://jquerymobile.com\r\n *\r\n * Copyright jQuery Foundation and other contributors\r\n * Released under the MIT license.\r\n * http://jquery.org/license\r\n */\r\n\r\n//>>label: Virtual Mouse (vmouse) Bindings\r\n//>>group: Core\r\n//>>description: Normalizes touch/mouse events.\r\n//>>docs: http://api.jquerymobile.com/?s=vmouse\r\n\r\n// This plugin is an experiment for abstracting away the touch and mouse\r\n// events so that developers don't have to worry about which method of input\r\n// the device their document is loaded on supports.\r\n//\r\n// The idea here is to allow the developer to register listeners for the\r\n// basic mouse events, such as mousedown, mousemove, mouseup, and click,\r\n// and the plugin will take care of registering the correct listeners\r\n// behind the scenes to invoke the listener at the fastest possible time\r\n// for that device, while still retaining the order of event firing in\r\n// the traditional mouse environment, should multiple handlers be registered\r\n// on the same element for different events.\r\n//\r\n// The current version exposes the following virtual events to jQuery bind methods:\r\n// \"vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel\"\r\n\r\n( function( factory ) {\r\n\tif ( typeof define === \"function\" && define.amd ) {\r\n\r\n\t\t// AMD. Register as an anonymous module.\r\n\t\tdefine( 'vmouse',[ \"jquery\" ], factory );\r\n\t} else {\r\n\r\n\t\t// Browser globals\r\n\t\tfactory( jQuery );\r\n\t}\r\n} )( function( $ ) {\r\n\r\nvar dataPropertyName = \"virtualMouseBindings\",\r\n\ttouchTargetPropertyName = \"virtualTouchID\",\r\n\ttouchEventProps = \"clientX clientY pageX pageY screenX screenY\".split( \" \" ),\r\n\tvirtualEventNames = \"vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel\".split( \" \" ),\r\n\tgeneralProps = ( \"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase \" +\r\n\t\t\"metaKey relatedTarget shiftKey target timeStamp view which\" ).split( \" \" ),\r\n\tmouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [],\r\n\tmouseEventProps = generalProps.concat( mouseHookProps ),\r\n\tactiveDocHandlers = {},\r\n\tresetTimerID = 0,\r\n\tstartX = 0,\r\n\tstartY = 0,\r\n\tdidScroll = false,\r\n\tclickBlockList = [],\r\n\tblockMouseTriggers = false,\r\n\tblockTouchTriggers = false,\r\n\teventCaptureSupported = \"addEventListener\" in document,\r\n\t$document = $( document ),\r\n\tnextTouchID = 1,\r\n\tlastTouchID = 0, threshold,\r\n\ti;\r\n\r\n$.vmouse = {\r\n\tmoveDistanceThreshold: 10,\r\n\tclickDistanceThreshold: 10,\r\n\tresetTimerDuration: 1500,\r\n\tmaximumTimeBetweenTouches: 100\r\n};\r\n\r\nfunction getNativeEvent( event ) {\r\n\r\n\twhile ( event && typeof event.originalEvent !== \"undefined\" ) {\r\n\t\tevent = event.originalEvent;\r\n\t}\r\n\treturn event;\r\n}\r\n\r\nfunction createVirtualEvent( event, eventType ) {\r\n\r\n\tvar t = event.type,\r\n\t\toe, props, ne, prop, ct, touch, i, j, len;\r\n\r\n\tevent = $.Event( event );\r\n\tevent.type = eventType;\r\n\r\n\toe = event.originalEvent;\r\n\tprops = generalProps;\r\n\r\n\t// addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280\r\n\t// https://github.com/jquery/jquery-mobile/issues/3280\r\n\tif ( t.search( /^(mouse|click)/ ) > -1 ) {\r\n\t\tprops = mouseEventProps;\r\n\t}\r\n\r\n\t// copy original event properties over to the new event\r\n\t// this would happen if we could call $.event.fix instead of $.Event\r\n\t// but we don't have a way to force an event to be fixed multiple times\r\n\tif ( oe ) {\r\n\t\tfor ( i = props.length; i; ) {\r\n\t\t\tprop = props[ --i ];\r\n\t\t\tevent[ prop ] = oe[ prop ];\r\n\t\t}\r\n\t}\r\n\r\n\t// make sure that if the mouse and click virtual events are generated\r\n\t// without a .which one is defined\r\n\tif ( t.search( /mouse(down|up)|click/ ) > -1 && !event.which ) {\r\n\t\tevent.which = 1;\r\n\t}\r\n\r\n\tif ( t.search( /^touch/ ) !== -1 ) {\r\n\t\tne = getNativeEvent( oe );\r\n\t\tt = ne.touches;\r\n\t\tct = ne.changedTouches;\r\n\t\ttouch = ( t && t.length ) ? t[ 0 ] : ( ( ct && ct.length ) ? ct[ 0 ] : undefined );\r\n\r\n\t\tif ( touch ) {\r\n\t\t\tfor ( j = 0, len = touchEventProps.length; j < len; j++ ) {\r\n\t\t\t\tprop = touchEventProps[ j ];\r\n\t\t\t\tevent[ prop ] = touch[ prop ];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn event;\r\n}\r\n\r\nfunction getVirtualBindingFlags( element ) {\r\n\r\n\tvar flags = {},\r\n\t\tb, k;\r\n\r\n\twhile ( element ) {\r\n\r\n\t\tb = $.data( element, dataPropertyName );\r\n\r\n\t\tfor ( k in b ) {\r\n\t\t\tif ( b[ k ] ) {\r\n\t\t\t\tflags[ k ] = flags.hasVirtualBinding = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\telement = element.parentNode;\r\n\t}\r\n\treturn flags;\r\n}\r\n\r\nfunction getClosestElementWithVirtualBinding( element, eventType ) {\r\n\tvar b;\r\n\twhile ( element ) {\r\n\r\n\t\tb = $.data( element, dataPropertyName );\r\n\r\n\t\tif ( b && ( !eventType || b[ eventType ] ) ) {\r\n\t\t\treturn element;\r\n\t\t}\r\n\t\telement = element.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\nfunction enableTouchBindings() {\r\n\tblockTouchTriggers = false;\r\n}\r\n\r\nfunction disableTouchBindings() {\r\n\tblockTouchTriggers = true;\r\n}\r\n\r\nfunction enableMouseBindings() {\r\n\tlastTouchID = 0;\r\n\tclickBlockList.length = 0;\r\n\tblockMouseTriggers = false;\r\n\r\n\t// When mouse bindings are enabled, our\r\n\t// touch bindings are disabled.\r\n\tdisableTouchBindings();\r\n}\r\n\r\nfunction disableMouseBindings() {\r\n\t// When mouse bindings are disabled, our\r\n\t// touch bindings are enabled.\r\n\tenableTouchBindings();\r\n}\r\n\r\nfunction clearResetTimer() {\r\n\tif ( resetTimerID ) {\r\n\t\tclearTimeout( resetTimerID );\r\n\t\tresetTimerID = 0;\r\n\t}\r\n}\r\n\r\nfunction startResetTimer() {\r\n\tclearResetTimer();\r\n\tresetTimerID = setTimeout( function() {\r\n\t\tresetTimerID = 0;\r\n\t\tenableMouseBindings();\r\n\t}, $.vmouse.resetTimerDuration );\r\n}\r\n\r\nfunction triggerVirtualEvent( eventType, event, flags ) {\r\n\tvar ve;\r\n\r\n\tif ( ( flags && flags[ eventType ] ) ||\r\n\t\t\t( !flags && getClosestElementWithVirtualBinding( event.target, eventType ) ) ) {\r\n\r\n\t\tve = createVirtualEvent( event, eventType );\r\n\r\n\t\t$( event.target ).trigger( ve );\r\n\t}\r\n\r\n\treturn ve;\r\n}\r\n\r\nfunction mouseEventCallback( event ) {\r\n\tvar touchID = $.data( event.target, touchTargetPropertyName ),\r\n\t\tve;\r\n\r\n\t// It is unexpected if a click event is received before a touchend\r\n\t// or touchmove event, however this is a known behavior in Mobile\r\n\t// Safari when Mobile VoiceOver (as of iOS 8) is enabled and the user\r\n\t// double taps to activate a link element. In these cases if a touch\r\n\t// event is not received within the maximum time between touches,\r\n\t// re-enable mouse bindings and call the mouse event handler again.\r\n\tif ( event.type === \"click\" && $.data( event.target, \"lastTouchType\" ) === \"touchstart\" ) {\r\n\t\tsetTimeout( function() {\r\n\t\t\tif ( $.data( event.target, \"lastTouchType\" ) === \"touchstart\" ) {\r\n\t\t\t\tenableMouseBindings();\r\n\t\t\t\tdelete $.data( event.target ).lastTouchType;\r\n\t\t\t\tmouseEventCallback( event );\r\n\t\t\t}\r\n\t\t}, $.vmouse.maximumTimeBetweenTouches );\r\n\t}\r\n\r\n\tif ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ) {\r\n\t\tve = triggerVirtualEvent( \"v\" + event.type, event );\r\n\t\tif ( ve ) {\r\n\t\t\tif ( ve.isDefaultPrevented() ) {\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t}\r\n\t\t\tif ( ve.isPropagationStopped() ) {\r\n\t\t\t\tevent.stopPropagation();\r\n\t\t\t}\r\n\t\t\tif ( ve.isImmediatePropagationStopped() ) {\r\n\t\t\t\tevent.stopImmediatePropagation();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction handleTouchStart( event ) {\r\n\r\n\tvar touches = getNativeEvent( event ).touches,\r\n\t\ttarget, flags, t;\r\n\r\n\tif ( touches && touches.length === 1 ) {\r\n\r\n\t\ttarget = event.target;\r\n\t\tflags = getVirtualBindingFlags( target );\r\n\r\n\t\t$.data( event.target, \"lastTouchType\", event.type );\r\n\r\n\t\tif ( flags.hasVirtualBinding ) {\r\n\r\n\t\t\tlastTouchID = nextTouchID++;\r\n\t\t\t$.data( target, touchTargetPropertyName, lastTouchID );\r\n\r\n\t\t\tclearResetTimer();\r\n\r\n\t\t\tdisableMouseBindings();\r\n\t\t\tdidScroll = false;\r\n\r\n\t\t\tt = getNativeEvent( event ).touches[ 0 ];\r\n\t\t\tstartX = t.pageX;\r\n\t\t\tstartY = t.pageY;\r\n\r\n\t\t\ttriggerVirtualEvent( \"vmouseover\", event, flags );\r\n\t\t\ttriggerVirtualEvent( \"vmousedown\", event, flags );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction handleScroll( event ) {\r\n\tif ( blockTouchTriggers ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif ( !didScroll ) {\r\n\t\ttriggerVirtualEvent( \"vmousecancel\", event, getVirtualBindingFlags( event.target ) );\r\n\t}\r\n\r\n\t$.data( event.target, \"lastTouchType\", event.type );\r\n\r\n\tdidScroll = true;\r\n\tstartResetTimer();\r\n}\r\n\r\nfunction handleTouchMove( event ) {\r\n\tif ( blockTouchTriggers ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar t = getNativeEvent( event ).touches[ 0 ],\r\n\t\tdidCancel = didScroll,\r\n\t\tmoveThreshold = $.vmouse.moveDistanceThreshold,\r\n\t\tflags = getVirtualBindingFlags( event.target );\r\n\r\n\t$.data( event.target, \"lastTouchType\", event.type );\r\n\r\n\tdidScroll = didScroll ||\r\n\t\t( Math.abs( t.pageX - startX ) > moveThreshold ||\r\n\t\tMath.abs( t.pageY - startY ) > moveThreshold );\r\n\r\n\tif ( didScroll && !didCancel ) {\r\n\t\ttriggerVirtualEvent( \"vmousecancel\", event, flags );\r\n\t}\r\n\r\n\ttriggerVirtualEvent( \"vmousemove\", event, flags );\r\n\tstartResetTimer();\r\n}\r\n\r\nfunction handleTouchEnd( event ) {\r\n\tif ( blockTouchTriggers || $.data( event.target, \"lastTouchType\" ) === undefined ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tdisableTouchBindings();\r\n\tdelete $.data( event.target ).lastTouchType;\r\n\r\n\tvar flags = getVirtualBindingFlags( event.target ),\r\n\t\tve, t;\r\n\ttriggerVirtualEvent( \"vmouseup\", event, flags );\r\n\r\n\tif ( !didScroll ) {\r\n\t\tve = triggerVirtualEvent( \"vclick\", event, flags );\r\n\t\tif ( ve && ve.isDefaultPrevented() ) {\r\n\t\t\t// The target of the mouse events that follow the touchend\r\n\t\t\t// event don't necessarily match the target used during the\r\n\t\t\t// touch. This means we need to rely on coordinates for blocking\r\n\t\t\t// any click that is generated.\r\n\t\t\tt = getNativeEvent( event ).changedTouches[ 0 ];\r\n\t\t\tclickBlockList.push( {\r\n\t\t\t\ttouchID: lastTouchID,\r\n\t\t\t\tx: t.clientX,\r\n\t\t\t\ty: t.clientY\r\n\t\t\t} );\r\n\r\n\t\t\t// Prevent any mouse events that follow from triggering\r\n\t\t\t// virtual event notifications.\r\n\t\t\tblockMouseTriggers = true;\r\n\t\t}\r\n\t}\r\n\ttriggerVirtualEvent( \"vmouseout\", event, flags );\r\n\tdidScroll = false;\r\n\r\n\tstartResetTimer();\r\n}\r\n\r\nfunction hasVirtualBindings( ele ) {\r\n\tvar bindings = $.data( ele, dataPropertyName ),\r\n\t\tk;\r\n\r\n\tif ( bindings ) {\r\n\t\tfor ( k in bindings ) {\r\n\t\t\tif ( bindings[ k ] ) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction dummyMouseHandler() {\r\n}\r\n\r\nfunction getSpecialEventObject( eventType ) {\r\n\tvar realType = eventType.substr( 1 );\r\n\r\n\treturn {\r\n\t\tsetup: function( /* data, namespace */ ) {\r\n\t\t\t// If this is the first virtual mouse binding for this element,\r\n\t\t\t// add a bindings object to its data.\r\n\r\n\t\t\tif ( !hasVirtualBindings( this ) ) {\r\n\t\t\t\t$.data( this, dataPropertyName, {} );\r\n\t\t\t}\r\n\r\n\t\t\t// If setup is called, we know it is the first binding for this\r\n\t\t\t// eventType, so initialize the count for the eventType to zero.\r\n\t\t\tvar bindings = $.data( this, dataPropertyName );\r\n\t\t\tbindings[ eventType ] = true;\r\n\r\n\t\t\t// If this is the first virtual mouse event for this type,\r\n\t\t\t// register a global handler on the document.\r\n\r\n\t\t\tactiveDocHandlers[ eventType ] = ( activeDocHandlers[ eventType ] || 0 ) + 1;\r\n\r\n\t\t\tif ( activeDocHandlers[ eventType ] === 1 ) {\r\n\t\t\t\t$document.bind( realType, mouseEventCallback );\r\n\t\t\t}\r\n\r\n\t\t\t// Some browsers, like Opera Mini, won't dispatch mouse/click events\r\n\t\t\t// for elements unless they actually have handlers registered on them.\r\n\t\t\t// To get around this, we register dummy handlers on the elements.\r\n\r\n\t\t\t$( this ).bind( realType, dummyMouseHandler );\r\n\r\n\t\t\t// For now, if event capture is not supported, we rely on mouse handlers.\r\n\t\t\tif ( eventCaptureSupported ) {\r\n\t\t\t\t// If this is the first virtual mouse binding for the document,\r\n\t\t\t\t// register our touchstart handler on the document.\r\n\r\n\t\t\t\tactiveDocHandlers[ \"touchstart\" ] = ( activeDocHandlers[ \"touchstart\" ] || 0 ) + 1;\r\n\r\n\t\t\t\tif ( activeDocHandlers[ \"touchstart\" ] === 1 ) {\r\n\t\t\t\t\t$document.bind( \"touchstart\", handleTouchStart )\r\n\t\t\t\t\t\t.bind( \"touchend\", handleTouchEnd )\r\n\r\n\t\t\t\t\t\t// On touch platforms, touching the screen and then dragging your finger\r\n\t\t\t\t\t\t// causes the window content to scroll after some distance threshold is\r\n\t\t\t\t\t\t// exceeded. On these platforms, a scroll prevents a click event from being\r\n\t\t\t\t\t\t// dispatched, and on some platforms, even the touchend is suppressed. To\r\n\t\t\t\t\t\t// mimic the suppression of the click event, we need to watch for a scroll\r\n\t\t\t\t\t\t// event. Unfortunately, some platforms like iOS don't dispatch scroll\r\n\t\t\t\t\t\t// events until *AFTER* the user lifts their finger (touchend). This means\r\n\t\t\t\t\t\t// we need to watch both scroll and touchmove events to figure out whether\r\n\t\t\t\t\t\t// or not a scroll happenens before the touchend event is fired.\r\n\r\n\t\t\t\t\t\t.bind( \"touchmove\", handleTouchMove )\r\n\t\t\t\t\t\t.bind( \"scroll\", handleScroll );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tteardown: function( /* data, namespace */ ) {\r\n\t\t\t// If this is the last virtual binding for this eventType,\r\n\t\t\t// remove its global handler from the document.\r\n\r\n\t\t\t--activeDocHandlers[eventType];\r\n\r\n\t\t\tif ( !activeDocHandlers[ eventType ] ) {\r\n\t\t\t\t$document.unbind( realType, mouseEventCallback );\r\n\t\t\t}\r\n\r\n\t\t\tif ( eventCaptureSupported ) {\r\n\t\t\t\t// If this is the last virtual mouse binding in existence,\r\n\t\t\t\t// remove our document touchstart listener.\r\n\r\n\t\t\t\t--activeDocHandlers[\"touchstart\"];\r\n\r\n\t\t\t\tif ( !activeDocHandlers[ \"touchstart\" ] ) {\r\n\t\t\t\t\t$document.unbind( \"touchstart\", handleTouchStart )\r\n\t\t\t\t\t\t.unbind( \"touchmove\", handleTouchMove )\r\n\t\t\t\t\t\t.unbind( \"touchend\", handleTouchEnd )\r\n\t\t\t\t\t\t.unbind( \"scroll\", handleScroll );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar $this = $( this ),\r\n\t\t\t\tbindings = $.data( this, dataPropertyName );\r\n\r\n\t\t\t// teardown may be called when an element was\r\n\t\t\t// removed from the DOM. If this is the case,\r\n\t\t\t// jQuery core may have already stripped the element\r\n\t\t\t// of any data bindings so we need to check it before\r\n\t\t\t// using it.\r\n\t\t\tif ( bindings ) {\r\n\t\t\t\tbindings[ eventType ] = false;\r\n\t\t\t}\r\n\r\n\t\t\t// Unregister the dummy event handler.\r\n\r\n\t\t\t$this.unbind( realType, dummyMouseHandler );\r\n\r\n\t\t\t// If this is the last virtual mouse binding on the\r\n\t\t\t// element, remove the binding data from the element.\r\n\r\n\t\t\tif ( !hasVirtualBindings( this ) ) {\r\n\t\t\t\t$this.removeData( dataPropertyName );\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}\r\n\r\n// Expose our custom events to the jQuery bind/unbind mechanism.\r\n\r\nfor ( i = 0; i < virtualEventNames.length; i++ ) {\r\n\t$.event.special[ virtualEventNames[ i ] ] = getSpecialEventObject( virtualEventNames[ i ] );\r\n}\r\n\r\n// Add a capture click handler to block clicks.\r\n// Note that we require event capture support for this so if the device\r\n// doesn't support it, we punt for now and rely solely on mouse events.\r\nif ( eventCaptureSupported ) {\r\n\tdocument.addEventListener( \"click\", function( e ) {\r\n\t\tvar cnt = clickBlockList.length,\r\n\t\t\ttarget = e.target,\r\n\t\t\tx, y, ele, i, o, touchID;\r\n\r\n\t\tif ( cnt ) {\r\n\t\t\tx = e.clientX;\r\n\t\t\ty = e.clientY;\r\n\t\t\tthreshold = $.vmouse.clickDistanceThreshold;\r\n\r\n\t\t\t// The idea here is to run through the clickBlockList to see if\r\n\t\t\t// the current click event is in the proximity of one of our\r\n\t\t\t// vclick events that had preventDefault() called on it. If we find\r\n\t\t\t// one, then we block the click.\r\n\t\t\t//\r\n\t\t\t// Why do we have to rely on proximity?\r\n\t\t\t//\r\n\t\t\t// Because the target of the touch event that triggered the vclick\r\n\t\t\t// can be different from the target of the click event synthesized\r\n\t\t\t// by the browser. The target of a mouse/click event that is synthesized\r\n\t\t\t// from a touch event seems to be implementation specific. For example,\r\n\t\t\t// some browsers will fire mouse/click events for a link that is near\r\n\t\t\t// a touch event, even though the target of the touchstart/touchend event\r\n\t\t\t// says the user touched outside the link. Also, it seems that with most\r\n\t\t\t// browsers, the target of the mouse/click event is not calculated until the\r\n\t\t\t// time it is dispatched, so if you replace an element that you touched\r\n\t\t\t// with another element, the target of the mouse/click will be the new\r\n\t\t\t// element underneath that point.\r\n\t\t\t//\r\n\t\t\t// Aside from proximity, we also check to see if the target and any\r\n\t\t\t// of its ancestors were the ones that blocked a click. This is necessary\r\n\t\t\t// because of the strange mouse/click target calculation done in the\r\n\t\t\t// Android 2.1 browser, where if you click on an element, and there is a\r\n\t\t\t// mouse/click handler on one of its ancestors, the target will be the\r\n\t\t\t// innermost child of the touched element, even if that child is no where\r\n\t\t\t// near the point of touch.\r\n\r\n\t\t\tele = target;\r\n\r\n\t\t\twhile ( ele ) {\r\n\t\t\t\tfor ( i = 0; i < cnt; i++ ) {\r\n\t\t\t\t\to = clickBlockList[ i ];\r\n\t\t\t\t\ttouchID = 0;\r\n\r\n\t\t\t\t\tif ( ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) ||\r\n\t\t\t\t\t\t\t$.data( ele, touchTargetPropertyName ) === o.touchID ) {\r\n\t\t\t\t\t\t// XXX: We may want to consider removing matches from the block list\r\n\t\t\t\t\t\t// instead of waiting for the reset timer to fire.\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tele = ele.parentNode;\r\n\t\t\t}\r\n\t\t}\r\n\t}, true );\r\n}\r\n} );\r\n\r\n/*!\r\n * jQuery Mobile Namespace @VERSION\r\n * http://jquerymobile.com\r\n *\r\n * Copyright jQuery Foundation and other contributors\r\n * Released under the MIT license.\r\n * http://jquery.org/license\r\n */\r\n\r\n//>>label: Namespace\r\n//>>group: Core\r\n//>>description: The mobile namespace on the jQuery object\r\n\r\n( function( factory ) {\r\n\tif ( typeof define === \"function\" && define.amd ) {\r\n\r\n\t\t// AMD. Register as an anonymous module.\r\n\t\tdefine( 'ns',[ \"jquery\" ], factory );\r\n\t} else {\r\n\r\n\t\t// Browser globals\r\n\t\tfactory( jQuery );\r\n\t}\r\n} )( function( $ ) {\r\n\r\n$.mobile = { version: \"@VERSION\" };\r\n\r\nreturn $.mobile;\r\n} );\r\n\r\n/*!\r\n * jQuery Mobile Touch Support Test @VERSION\r\n * http://jquerymobile.com\r\n *\r\n * Copyright jQuery Foundation and other contributors\r\n * Released under the MIT license.\r\n * http://jquery.org/license\r\n */\r\n\r\n//>>label: Touch support test\r\n//>>group: Core\r\n//>>description: Touch feature test\r\n\r\n( function( factory ) {\r\n\tif ( typeof define === \"function\" && define.amd ) {\r\n\r\n\t\t// AMD. Register as an anonymous module.\r\n\t\tdefine( 'support/touch',[\r\n\t\t\t\"jquery\",\r\n\t\t\t\"../ns\" ], factory );\r\n\t} else {\r\n\r\n\t\t// Browser globals\r\n\t\tfactory( jQuery );\r\n\t}\r\n} )( function( $ ) {\r\n\r\nvar support = {\r\n\ttouch: \"ontouchend\" in document\r\n};\r\n\r\n$.mobile.support = $.mobile.support || {};\r\n$.extend( $.support, support );\r\n$.extend( $.mobile.support, support );\r\n\r\nreturn $.support;\r\n} );\r\n\r\n/*!\r\n * jQuery Mobile Touch Events @VERSION\r\n * http://jquerymobile.com\r\n *\r\n * Copyright jQuery Foundation and other contributors\r\n * Released under the MIT license.\r\n * http://jquery.org/license\r\n */\r\n\r\n//>>label: Touch\r\n//>>group: Events\r\n//>>description: Touch events including: touchstart, touchmove, touchend, tap, taphold, swipe, swipeleft, swiperight\r\n\r\n( function( factory ) {\r\n\tif ( typeof define === \"function\" && define.amd ) {\r\n\r\n\t\t// AMD. Register as an anonymous module.\r\n\t\tdefine( 'events/touch',[\r\n\t\t\t\"jquery\",\r\n\t\t\t\"../vmouse\",\r\n\t\t\t\"../support/touch\" ], factory );\r\n\t} else {\r\n\r\n\t\t// Browser globals\r\n\t\tfactory( jQuery );\r\n\t}\r\n} )( function( $ ) {\r\nvar $document = $( document ),\r\n\tsupportTouch = $.mobile.support.touch,\r\n\ttouchStartEvent = supportTouch ? \"touchstart\" : \"mousedown\",\r\n\ttouchStopEvent = supportTouch ? \"touchend\" : \"mouseup\",\r\n\ttouchMoveEvent = supportTouch ? \"touchmove\" : \"mousemove\";\r\n\r\n// setup new event shortcuts\r\n$.each( ( \"touchstart touchmove touchend \" +\r\n\"tap taphold \" +\r\n\"swipe swipeleft swiperight\" ).split( \" \" ), function( i, name ) {\r\n\r\n\t$.fn[ name ] = function( fn ) {\r\n\t\treturn fn ? this.bind( name, fn ) : this.trigger( name );\r\n\t};\r\n\r\n\t// jQuery < 1.8\r\n\tif ( $.attrFn ) {\r\n\t\t$.attrFn[ name ] = true;\r\n\t}\r\n} );\r\n\r\nfunction triggerCustomEvent( obj, eventType, event, bubble ) {\r\n\tvar originalType = event.type;\r\n\tevent.type = eventType;\r\n\tif ( bubble ) {\r\n\t\t$.event.trigger( event, undefined, obj );\r\n\t} else {\r\n\t\t$.event.dispatch.call( obj, event );\r\n\t}\r\n\tevent.type = originalType;\r\n}\r\n\r\n// also handles taphold\r\n$.event.special.tap = {\r\n\ttapholdThreshold: 750,\r\n\temitTapOnTaphold: true,\r\n\tsetup: function() {\r\n\t\tvar thisObject = this,\r\n\t\t\t$this = $( thisObject ),\r\n\t\t\tisTaphold = false;\r\n\r\n\t\t$this.bind( \"vmousedown\", function( event ) {\r\n\t\t\tisTaphold = false;\r\n\t\t\tif ( event.which && event.which !== 1 ) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tvar origTarget = event.target,\r\n\t\t\t\ttimer, clickHandler;\r\n\r\n\t\t\tfunction clearTapTimer() {\r\n\t\t\t\tif ( timer ) {\r\n\t\t\t\t\t$this.bind( \"vclick\", clickHandler );\r\n\t\t\t\t\tclearTimeout( timer );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction clearTapHandlers() {\r\n\t\t\t\tclearTapTimer();\r\n\r\n\t\t\t\t$this.unbind( \"vclick\", clickHandler )\r\n\t\t\t\t\t.unbind( \"vmouseup\", clearTapTimer );\r\n\t\t\t\t$document.unbind( \"vmousecancel\", clearTapHandlers );\r\n\t\t\t}\r\n\r\n\t\t\tclickHandler = function( event ) {\r\n\t\t\t\tclearTapHandlers();\r\n\r\n\t\t\t\t// ONLY trigger a 'tap' event if the start target is\r\n\t\t\t\t// the same as the stop target.\r\n\t\t\t\tif ( !isTaphold && origTarget === event.target ) {\r\n\t\t\t\t\ttriggerCustomEvent( thisObject, \"tap\", event );\r\n\t\t\t\t} else if ( isTaphold ) {\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\t$this.bind( \"vmouseup\", clearTapTimer );\r\n\r\n\t\t\t$document.bind( \"vmousecancel\", clearTapHandlers );\r\n\r\n\t\t\ttimer = setTimeout( function() {\r\n\t\t\t\tif ( !$.event.special.tap.emitTapOnTaphold ) {\r\n\t\t\t\t\tisTaphold = true;\r\n\t\t\t\t}\r\n\t\t\t\ttimer = 0;\r\n\t\t\t\ttriggerCustomEvent( thisObject, \"taphold\", $.Event( \"taphold\", { target: origTarget } ) );\r\n\t\t\t}, $.event.special.tap.tapholdThreshold );\r\n\t\t} );\r\n\t},\r\n\tteardown: function() {\r\n\t\t$( this ).unbind( \"vmousedown\" ).unbind( \"vclick\" ).unbind( \"vmouseup\" );\r\n\t\t$document.unbind( \"vmousecancel\" );\r\n\t}\r\n};\r\n\r\n// Also handles swipeleft, swiperight\r\n$.event.special.swipe = {\r\n\r\n\t// More than this horizontal displacement, and we will suppress scrolling.\r\n\tscrollSupressionThreshold: 30,\r\n\r\n\t// More time than this, and it isn't a swipe.\r\n\tdurationThreshold: 1000,\r\n\r\n\t// Swipe horizontal displacement must be more than this.\r\n\thorizontalDistanceThreshold: window.devicePixelRatio >= 2 ? 15 : 30,\r\n\r\n\t// Swipe vertical displacement must be less than this.\r\n\tverticalDistanceThreshold: window.devicePixelRatio >= 2 ? 15 : 30,\r\n\r\n\tgetLocation: function( event ) {\r\n\t\tvar winPageX = window.pageXOffset,\r\n\t\t\twinPageY = window.pageYOffset,\r\n\t\t\tx = event.clientX,\r\n\t\t\ty = event.clientY;\r\n\r\n\t\tif ( event.pageY === 0 && Math.floor( y ) > Math.floor( event.pageY ) ||\r\n\t\t\t\tevent.pageX === 0 && Math.floor( x ) > Math.floor( event.pageX ) ) {\r\n\r\n\t\t\t// iOS4 clientX/clientY have the value that should have been\r\n\t\t\t// in pageX/pageY. While pageX/page/ have the value 0\r\n\t\t\tx = x - winPageX;\r\n\t\t\ty = y - winPageY;\r\n\t\t} else if ( y < ( event.pageY - winPageY ) || x < ( event.pageX - winPageX ) ) {\r\n\r\n\t\t\t// Some Android browsers have totally bogus values for clientX/Y\r\n\t\t\t// when scrolling/zooming a page. Detectable since clientX/clientY\r\n\t\t\t// should never be smaller than pageX/pageY minus page scroll\r\n\t\t\tx = event.pageX - winPageX;\r\n\t\t\ty = event.pageY - winPageY;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tx: x,\r\n\t\t\ty: y\r\n\t\t};\r\n\t},\r\n\r\n\tstart: function( event ) {\r\n\t\tvar data = event.originalEvent.touches ?\r\n\t\t\t\tevent.originalEvent.touches[ 0 ] : event,\r\n\t\t\tlocation = $.event.special.swipe.getLocation( data );\r\n\t\treturn {\r\n\t\t\ttime: ( new Date() ).getTime(),\r\n\t\t\tcoords: [ location.x, location.y ],\r\n\t\t\torigin: $( event.target )\r\n\t\t};\r\n\t},\r\n\r\n\tstop: function( event ) {\r\n\t\tvar data = event.originalEvent.touches ?\r\n\t\t\t\tevent.originalEvent.touches[ 0 ] : event,\r\n\t\t\tlocation = $.event.special.swipe.getLocation( data );\r\n\t\treturn {\r\n\t\t\ttime: ( new Date() ).getTime(),\r\n\t\t\tcoords: [ location.x, location.y ]\r\n\t\t};\r\n\t},\r\n\r\n\thandleSwipe: function( start, stop, thisObject, origTarget ) {\r\n\t\tif ( stop.time - start.time < $.event.special.swipe.durationThreshold &&\r\n\t\t\t\tMath.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&\r\n\t\t\t\tMath.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {\r\n\t\t\tvar direction = start.coords[ 0 ] > stop.coords[ 0 ] ? \"swipeleft\" : \"swiperight\";\r\n\r\n\t\t\ttriggerCustomEvent( thisObject, \"swipe\", $.Event( \"swipe\", { target: origTarget, swipestart: start, swipestop: stop } ), true );\r\n\t\t\ttriggerCustomEvent( thisObject, direction, $.Event( direction, { target: origTarget, swipestart: start, swipestop: stop } ), true );\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t},\r\n\r\n\t// This serves as a flag to ensure that at most one swipe event event is\r\n\t// in work at any given time\r\n\teventInProgress: false,\r\n\r\n\tsetup: function() {\r\n\t\tvar events,\r\n\t\t\tthisObject = this,\r\n\t\t\t$this = $( thisObject ),\r\n\t\t\tcontext = {};\r\n\r\n\t\t// Retrieve the events data for this element and add the swipe context\r\n\t\tevents = $.data( this, \"mobile-events\" );\r\n\t\tif ( !events ) {\r\n\t\t\tevents = { length: 0 };\r\n\t\t\t$.data( this, \"mobile-events\", events );\r\n\t\t}\r\n\t\tevents.length++;\r\n\t\tevents.swipe = context;\r\n\r\n\t\tcontext.start = function( event ) {\r\n\r\n\t\t\t// Bail if we're already working on a swipe event\r\n\t\t\tif ( $.event.special.swipe.eventInProgress ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t$.event.special.swipe.eventInProgress = true;\r\n\r\n\t\t\tvar stop,\r\n\t\t\t\tstart = $.event.special.swipe.start( event ),\r\n\t\t\t\torigTarget = event.target,\r\n\t\t\t\temitted = false;\r\n\r\n\t\t\tcontext.move = function( event ) {\r\n\t\t\t\tif ( !start || event.isDefaultPrevented() ) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstop = $.event.special.swipe.stop( event );\r\n\t\t\t\tif ( !emitted ) {\r\n\t\t\t\t\temitted = $.event.special.swipe.handleSwipe( start, stop, thisObject, origTarget );\r\n\t\t\t\t\tif ( emitted ) {\r\n\r\n\t\t\t\t\t\t// Reset the context to make way for the next swipe event\r\n\t\t\t\t\t\t$.event.special.swipe.eventInProgress = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// prevent scrolling\r\n\t\t\t\tif ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tcontext.stop = function() {\r\n\t\t\t\temitted = true;\r\n\r\n\t\t\t\t// Reset the context to make way for the next swipe event\r\n\t\t\t\t$.event.special.swipe.eventInProgress = false;\r\n\t\t\t\t$document.off( touchMoveEvent, context.move );\r\n\t\t\t\tcontext.move = null;\r\n\t\t\t};\r\n\r\n\t\t\t$document.on( touchMoveEvent, context.move )\r\n\t\t\t\t.one( touchStopEvent, context.stop );\r\n\t\t};\r\n\t\t$this.on( touchStartEvent, context.start );\r\n\t},\r\n\r\n\tteardown: function() {\r\n\t\tvar events, context;\r\n\r\n\t\tevents = $.data( this, \"mobile-events\" );\r\n\t\tif ( events ) {\r\n\t\t\tcontext = events.swipe;\r\n\t\t\tdelete events.swipe;\r\n\t\t\tevents.length--;\r\n\t\t\tif ( events.length === 0 ) {\r\n\t\t\t\t$.removeData( this, \"mobile-events\" );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( context ) {\r\n\t\t\tif ( context.start ) {\r\n\t\t\t\t$( this ).off( touchStartEvent, context.start );\r\n\t\t\t}\r\n\t\t\tif ( context.move ) {\r\n\t\t\t\t$document.off( touchMoveEvent, context.move );\r\n\t\t\t}\r\n\t\t\tif ( context.stop ) {\r\n\t\t\t\t$document.off( touchStopEvent, context.stop );\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n$.each( {\r\n\ttaphold: \"tap\",\r\n\tswipeleft: \"swipe.left\",\r\n\tswiperight: \"swipe.right\"\r\n}, function( event, sourceEvent ) {\r\n\r\n\t$.event.special[ event ] = {\r\n\t\tsetup: function() {\r\n\t\t\t$( this ).bind( sourceEvent, $.noop );\r\n\t\t},\r\n\t\tteardown: function() {\r\n\t\t\t$( this ).unbind( sourceEvent );\r\n\t\t}\r\n\t};\r\n} );\r\n\r\nreturn $.event.special;\r\n} );\r\n\r\n\r\n\r\n}));\r\n","/*! jQuery UI - v1.12.1 - 2018-02-14\r\n* http://jqueryui.com\r\n* Includes: widget.js, form-reset-mixin.js, keycode.js, labels.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/spinner.js\r\n* Copyright jQuery Foundation and other contributors; Licensed MIT */\r\n\r\n(function(t){\"function\"==typeof define&&define.amd?define([\"jquery\"],t):t(jQuery)})(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger(\"change\")}}t.ui=t.ui||{},t.ui.version=\"1.12.1\";var i=0,s=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,n,o=s.call(arguments,1),a=0,r=o.length;r>a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a=\"string\"==typeof o,r=s.call(arguments,1),l=this;return a?this.length||\"instance\"!==o?this.each(function(){var i,s=t.data(this,n);return\"instance\"===o?(l=s,!1):s?t.isFunction(s[o])&&\"_\"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error(\"no such method '\"+o+\"' for \"+e+\" widget instance\"):t.error(\"cannot call methods on \"+e+\" prior to initialization; \"+\"attempted to call method '\"+o+\"'\")}):l=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:\"widget\",widgetEventPrefix:\"\",defaultElement:\"
    \",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace=\".\"+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),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,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\")}}},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))};var n=/ui-corner-([a-z]){2,6}/g;t.widget(\"ui.controlgroup\",{version:\"1.12.1\",defaultElement:\"
    \",options:{direction:\"horizontal\",disabled:null,onlyVisible:!0,items:{button:\"input[type=button], input[type=submit], input[type=reset], button, a\",controlgroupLabel:\".ui-controlgroup-label\",checkboxradio:\"input[type='checkbox'], input[type='radio']\",selectmenu:\"select\",spinner:\".ui-spinner-input\"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr(\"role\",\"toolbar\"),this.refresh()},_destroy:function(){this._callChildMethod(\"destroy\"),this.childWidgets.removeData(\"ui-controlgroup-data\"),this.element.removeAttr(\"role\"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(\".ui-controlgroup-label-contents\").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,n){var o,a={};return n?\"controlgroupLabel\"===s?(o=e.element.find(n),o.each(function(){var e=t(this);e.children(\".ui-controlgroup-label-contents\").length||e.contents().wrapAll(\"\")}),e._addClass(o,null,\"ui-widget ui-widget-content ui-state-default\"),i=i.concat(o.get()),void 0):(t.fn[s]&&(a=e[\"_\"+s+\"Options\"]?e[\"_\"+s+\"Options\"](\"middle\"):{classes:{}},e.element.find(n).each(function(){var n=t(this),o=n[s](\"instance\"),r=t.widget.extend({},a);if(\"button\"!==s||!n.parent(\".ui-spinner\").length){o||(o=n[s]()[s](\"instance\")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var l=n[s](\"widget\");t.data(l[0],\"ui-controlgroup-data\",o?o:n[s](\"instance\")),i.push(l[0])}})),void 0):void 0}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,\"ui-controlgroup-item\")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),s=i.data(\"ui-controlgroup-data\");s&&s[e]&&s[e]()})},_updateCornerClass:function(t,e){var i=\"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all\",s=this._buildSimpleOptions(e,\"label\").classes.label;this._removeClass(t,null,i),this._addClass(t,null,s)},_buildSimpleOptions:function(t,e){var i=\"vertical\"===this.options.direction,s={classes:{}};return s.classes[e]={middle:\"\",first:\"ui-corner-\"+(i?\"top\":\"left\"),last:\"ui-corner-\"+(i?\"bottom\":\"right\"),only:\"ui-corner-all\"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,\"ui-spinner\");return e.classes[\"ui-spinner-up\"]=\"\",e.classes[\"ui-spinner-down\"]=\"\",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,\"ui-button\")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,\"ui-checkboxradio-label\")},_selectmenuOptions:function(t){var e=\"vertical\"===this.options.direction;return{width:e?\"auto\":!1,classes:{middle:{\"ui-selectmenu-button-open\":\"\",\"ui-selectmenu-button-closed\":\"\"},first:{\"ui-selectmenu-button-open\":\"ui-corner-\"+(e?\"top\":\"tl\"),\"ui-selectmenu-button-closed\":\"ui-corner-\"+(e?\"top\":\"left\")},last:{\"ui-selectmenu-button-open\":e?\"\":\"ui-corner-tr\",\"ui-selectmenu-button-closed\":\"ui-corner-\"+(e?\"bottom\":\"right\")},only:{\"ui-selectmenu-button-open\":\"ui-corner-top\",\"ui-selectmenu-button-closed\":\"ui-corner-all\"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(o){var a=i.options.classes[o]||\"\";a=t.trim(a.replace(n,\"\")),s[o]=(a+\" \"+e[o]).replace(/\\s+/g,\" \")}),s},_setOption:function(t,e){return\"direction\"===t&&this._removeClass(\"ui-controlgroup-\"+this.options.direction),this._super(t,e),\"disabled\"===t?(this._callChildMethod(e?\"disable\":\"enable\"),void 0):(this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass(\"ui-controlgroup ui-controlgroup-\"+this.options.direction),\"horizontal\"===this.options.direction&&this._addClass(null,\"ui-helper-clearfix\"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(\":visible\")),e.length&&(t.each([\"first\",\"last\"],function(t,s){var n=e[s]().data(\"ui-controlgroup-data\");if(n&&i[\"_\"+n.widgetName+\"Options\"]){var o=i[\"_\"+n.widgetName+\"Options\"](1===e.length?\"only\":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod(\"refresh\"))}}),t.widget(\"ui.checkboxradio\",[t.ui.formResetMixin,{version:\"1.12.1\",options:{disabled:null,label:null,icon:!0,classes:{\"ui-checkboxradio-label\":\"ui-corner-all\",\"ui-checkboxradio-icon\":\"ui-corner-all\"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error(\"No label found for checkboxradio widget\"),this.originalLabel=\"\",this.label.contents().not(this.element[0]).each(function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption(\"disabled\",this.options.disabled),this._addClass(\"ui-checkboxradio\",\"ui-helper-hidden-accessible\"),this._addClass(this.label,\"ui-checkboxradio-label\",\"ui-button ui-widget\"),\"radio\"===this.type&&this._addClass(this.label,\"ui-checkboxradio-radio-label\"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,\"ui-checkboxradio-checked\",\"ui-state-active\"),this.icon&&this._addClass(this.icon,null,\"ui-state-hover\")),this._on({change:\"_toggleClasses\",focus:function(){this._addClass(this.label,null,\"ui-state-focus ui-visual-focus\")},blur:function(){this._removeClass(this.label,null,\"ui-state-focus ui-visual-focus\")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,\"input\"===e&&/radio|checkbox/.test(this.type)||t.error(\"Can't create checkboxradio on element.nodeName=\"+e+\" and element.type=\"+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s=\"input[name='\"+t.ui.escapeSelector(i)+\"']\";return i?(e=this.form.length?t(this.form[0].elements).filter(s):t(s).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,\"ui-checkboxradio-checked\",\"ui-state-active\",e),this.options.icon&&\"checkbox\"===this.type&&this._toggleClass(this.icon,null,\"ui-icon-check ui-state-checked\",e)._toggleClass(this.icon,null,\"ui-icon-blank\",!e),\"radio\"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio(\"instance\");e&&e._removeClass(e.label,\"ui-checkboxradio-checked\",\"ui-state-active\")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return\"label\"!==t||e?(this._super(t,e),\"disabled\"===t?(this._toggleClass(this.label,null,\"ui-state-disabled\",e),this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(e){var i=\"ui-icon ui-icon-background \";this.options.icon?(this.icon||(this.icon=t(\"\"),this.iconSpace=t(\" \"),this._addClass(this.iconSpace,\"ui-checkboxradio-icon-space\")),\"checkbox\"===this.type?(i+=e?\"ui-icon-check ui-state-checked\":\"ui-icon-blank\",this._removeClass(this.icon,null,e?\"ui-icon-blank\":\"ui-icon-check\")):i+=\"ui-icon-blank\",this._addClass(this.icon,\"ui-checkboxradio-icon\",i),e||this._removeClass(this.icon,null,\"ui-icon-check ui-state-checked\"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,\"ui-checkboxradio-checked\",\"ui-state-active\",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget(\"ui.button\",{version:\"1.12.1\",defaultElement:\"\" ).addClass( this._triggerClass ).\r\n\t\t\t\t\thtml( !buttonImage ? buttonText : $( \"\" ).attr(\r\n\t\t\t\t\t{ src:buttonImage, alt:buttonText, title:buttonText } ) ) );\r\n\t\t\tinput[ isRTL ? \"before\" : \"after\" ]( inst.trigger );\r\n\t\t\tinst.trigger.on( \"click\", function() {\r\n\t\t\t\tif ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {\r\n\t\t\t\t\t$.datepicker._hideDatepicker();\r\n\t\t\t\t} else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) {\r\n\t\t\t\t\t$.datepicker._hideDatepicker();\r\n\t\t\t\t\t$.datepicker._showDatepicker( input[ 0 ] );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$.datepicker._showDatepicker( input[ 0 ] );\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t} );\r\n\t\t}\r\n\t},\r\n\r\n\t/* Apply the maximum length for the date format. */\r\n\t_autoSize: function( inst ) {\r\n\t\tif ( this._get( inst, \"autoSize\" ) && !inst.inline ) {\r\n\t\t\tvar findMax, max, maxI, i,\r\n\t\t\t\tdate = new Date( 2009, 12 - 1, 20 ), // Ensure double digits\r\n\t\t\t\tdateFormat = this._get( inst, \"dateFormat\" );\r\n\r\n\t\t\tif ( dateFormat.match( /[DM]/ ) ) {\r\n\t\t\t\tfindMax = function( names ) {\r\n\t\t\t\t\tmax = 0;\r\n\t\t\t\t\tmaxI = 0;\r\n\t\t\t\t\tfor ( i = 0; i < names.length; i++ ) {\r\n\t\t\t\t\t\tif ( names[ i ].length > max ) {\r\n\t\t\t\t\t\t\tmax = names[ i ].length;\r\n\t\t\t\t\t\t\tmaxI = i;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn maxI;\r\n\t\t\t\t};\r\n\t\t\t\tdate.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ?\r\n\t\t\t\t\t\"monthNames\" : \"monthNamesShort\" ) ) ) );\r\n\t\t\t\tdate.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ?\r\n\t\t\t\t\t\"dayNames\" : \"dayNamesShort\" ) ) ) + 20 - date.getDay() );\r\n\t\t\t}\r\n\t\t\tinst.input.attr( \"size\", this._formatDate( inst, date ).length );\r\n\t\t}\r\n\t},\r\n\r\n\t/* Attach an inline date picker to a div. */\r\n\t_inlineDatepicker: function( target, inst ) {\r\n\t\tvar divSpan = $( target );\r\n\t\tif ( divSpan.hasClass( this.markerClassName ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tdivSpan.addClass( this.markerClassName ).append( inst.dpDiv );\r\n\t\t$.data( target, \"datepicker\", inst );\r\n\t\tthis._setDate( inst, this._getDefaultDate( inst ), true );\r\n\t\tthis._updateDatepicker( inst );\r\n\t\tthis._updateAlternate( inst );\r\n\r\n\t\t//If disabled option is true, disable the datepicker before showing it (see ticket #5665)\r\n\t\tif ( inst.settings.disabled ) {\r\n\t\t\tthis._disableDatepicker( target );\r\n\t\t}\r\n\r\n\t\t// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements\r\n\t\t// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height\r\n\t\tinst.dpDiv.css( \"display\", \"block\" );\r\n\t},\r\n\r\n\t/* Pop-up the date picker in a \"dialog\" box.\r\n\t * @param input element - ignored\r\n\t * @param date\tstring or Date - the initial date to display\r\n\t * @param onSelect function - the function to call when a date is selected\r\n\t * @param settings object - update the dialog date picker instance's settings (anonymous object)\r\n\t * @param pos int[2] - coordinates for the dialog's position within the screen or\r\n\t *\t\t\t\t\tevent - with x/y coordinates or\r\n\t *\t\t\t\t\tleave empty for default (screen centre)\r\n\t * @return the manager object\r\n\t */\r\n\t_dialogDatepicker: function( input, date, onSelect, settings, pos ) {\r\n\t\tvar id, browserWidth, browserHeight, scrollX, scrollY,\r\n\t\t\tinst = this._dialogInst; // internal instance\r\n\r\n\t\tif ( !inst ) {\r\n\t\t\tthis.uuid += 1;\r\n\t\t\tid = \"dp\" + this.uuid;\r\n\t\t\tthis._dialogInput = $( \"\" );\r\n\t\t\tthis._dialogInput.on( \"keydown\", this._doKeyDown );\r\n\t\t\t$( \"body\" ).append( this._dialogInput );\r\n\t\t\tinst = this._dialogInst = this._newInst( this._dialogInput, false );\r\n\t\t\tinst.settings = {};\r\n\t\t\t$.data( this._dialogInput[ 0 ], \"datepicker\", inst );\r\n\t\t}\r\n\t\tdatepicker_extendRemove( inst.settings, settings || {} );\r\n\t\tdate = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date );\r\n\t\tthis._dialogInput.val( date );\r\n\r\n\t\tthis._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null );\r\n\t\tif ( !this._pos ) {\r\n\t\t\tbrowserWidth = document.documentElement.clientWidth;\r\n\t\t\tbrowserHeight = document.documentElement.clientHeight;\r\n\t\t\tscrollX = document.documentElement.scrollLeft || document.body.scrollLeft;\r\n\t\t\tscrollY = document.documentElement.scrollTop || document.body.scrollTop;\r\n\t\t\tthis._pos = // should use actual width/height below\r\n\t\t\t\t[ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ];\r\n\t\t}\r\n\r\n\t\t// Move input on screen for focus, but hidden behind dialog\r\n\t\tthis._dialogInput.css( \"left\", ( this._pos[ 0 ] + 20 ) + \"px\" ).css( \"top\", this._pos[ 1 ] + \"px\" );\r\n\t\tinst.settings.onSelect = onSelect;\r\n\t\tthis._inDialog = true;\r\n\t\tthis.dpDiv.addClass( this._dialogClass );\r\n\t\tthis._showDatepicker( this._dialogInput[ 0 ] );\r\n\t\tif ( $.blockUI ) {\r\n\t\t\t$.blockUI( this.dpDiv );\r\n\t\t}\r\n\t\t$.data( this._dialogInput[ 0 ], \"datepicker\", inst );\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/* Detach a datepicker from its control.\r\n\t * @param target\telement - the target input field or division or span\r\n\t */\r\n\t_destroyDatepicker: function( target ) {\r\n\t\tvar nodeName,\r\n\t\t\t$target = $( target ),\r\n\t\t\tinst = $.data( target, \"datepicker\" );\r\n\r\n\t\tif ( !$target.hasClass( this.markerClassName ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tnodeName = target.nodeName.toLowerCase();\r\n\t\t$.removeData( target, \"datepicker\" );\r\n\t\tif ( nodeName === \"input\" ) {\r\n\t\t\tinst.append.remove();\r\n\t\t\tinst.trigger.remove();\r\n\t\t\t$target.removeClass( this.markerClassName ).\r\n\t\t\t\toff( \"focus\", this._showDatepicker ).\r\n\t\t\t\toff( \"keydown\", this._doKeyDown ).\r\n\t\t\t\toff( \"keypress\", this._doKeyPress ).\r\n\t\t\t\toff( \"keyup\", this._doKeyUp );\r\n\t\t} else if ( nodeName === \"div\" || nodeName === \"span\" ) {\r\n\t\t\t$target.removeClass( this.markerClassName ).empty();\r\n\t\t}\r\n\r\n\t\tif ( datepicker_instActive === inst ) {\r\n\t\t\tdatepicker_instActive = null;\r\n\t\t}\r\n\t},\r\n\r\n\t/* Enable the date picker to a jQuery selection.\r\n\t * @param target\telement - the target input field or division or span\r\n\t */\r\n\t_enableDatepicker: function( target ) {\r\n\t\tvar nodeName, inline,\r\n\t\t\t$target = $( target ),\r\n\t\t\tinst = $.data( target, \"datepicker\" );\r\n\r\n\t\tif ( !$target.hasClass( this.markerClassName ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tnodeName = target.nodeName.toLowerCase();\r\n\t\tif ( nodeName === \"input\" ) {\r\n\t\t\ttarget.disabled = false;\r\n\t\t\tinst.trigger.filter( \"button\" ).\r\n\t\t\t\teach( function() { this.disabled = false; } ).end().\r\n\t\t\t\tfilter( \"img\" ).css( { opacity: \"1.0\", cursor: \"\" } );\r\n\t\t} else if ( nodeName === \"div\" || nodeName === \"span\" ) {\r\n\t\t\tinline = $target.children( \".\" + this._inlineClass );\r\n\t\t\tinline.children().removeClass( \"ui-state-disabled\" );\r\n\t\t\tinline.find( \"select.ui-datepicker-month, select.ui-datepicker-year\" ).\r\n\t\t\t\tprop( \"disabled\", false );\r\n\t\t}\r\n\t\tthis._disabledInputs = $.map( this._disabledInputs,\r\n\t\t\tfunction( value ) { return ( value === target ? null : value ); } ); // delete entry\r\n\t},\r\n\r\n\t/* Disable the date picker to a jQuery selection.\r\n\t * @param target\telement - the target input field or division or span\r\n\t */\r\n\t_disableDatepicker: function( target ) {\r\n\t\tvar nodeName, inline,\r\n\t\t\t$target = $( target ),\r\n\t\t\tinst = $.data( target, \"datepicker\" );\r\n\r\n\t\tif ( !$target.hasClass( this.markerClassName ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tnodeName = target.nodeName.toLowerCase();\r\n\t\tif ( nodeName === \"input\" ) {\r\n\t\t\ttarget.disabled = true;\r\n\t\t\tinst.trigger.filter( \"button\" ).\r\n\t\t\t\teach( function() { this.disabled = true; } ).end().\r\n\t\t\t\tfilter( \"img\" ).css( { opacity: \"0.5\", cursor: \"default\" } );\r\n\t\t} else if ( nodeName === \"div\" || nodeName === \"span\" ) {\r\n\t\t\tinline = $target.children( \".\" + this._inlineClass );\r\n\t\t\tinline.children().addClass( \"ui-state-disabled\" );\r\n\t\t\tinline.find( \"select.ui-datepicker-month, select.ui-datepicker-year\" ).\r\n\t\t\t\tprop( \"disabled\", true );\r\n\t\t}\r\n\t\tthis._disabledInputs = $.map( this._disabledInputs,\r\n\t\t\tfunction( value ) { return ( value === target ? null : value ); } ); // delete entry\r\n\t\tthis._disabledInputs[ this._disabledInputs.length ] = target;\r\n\t},\r\n\r\n\t/* Is the first field in a jQuery collection disabled as a datepicker?\r\n\t * @param target\telement - the target input field or division or span\r\n\t * @return boolean - true if disabled, false if enabled\r\n\t */\r\n\t_isDisabledDatepicker: function( target ) {\r\n\t\tif ( !target ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tfor ( var i = 0; i < this._disabledInputs.length; i++ ) {\r\n\t\t\tif ( this._disabledInputs[ i ] === target ) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t/* Retrieve the instance data for the target control.\r\n\t * @param target element - the target input field or division or span\r\n\t * @return object - the associated instance data\r\n\t * @throws error if a jQuery problem getting data\r\n\t */\r\n\t_getInst: function( target ) {\r\n\t\ttry {\r\n\t\t\treturn $.data( target, \"datepicker\" );\r\n\t\t}\r\n\t\tcatch ( err ) {\r\n\t\t\tthrow \"Missing instance data for this datepicker\";\r\n\t\t}\r\n\t},\r\n\r\n\t/* Update or retrieve the settings for a date picker attached to an input field or division.\r\n\t * @param target element - the target input field or division or span\r\n\t * @param name\tobject - the new settings to update or\r\n\t *\t\t\t\tstring - the name of the setting to change or retrieve,\r\n\t *\t\t\t\twhen retrieving also \"all\" for all instance settings or\r\n\t *\t\t\t\t\"defaults\" for all global defaults\r\n\t * @param value any - the new value for the setting\r\n\t *\t\t\t\t(omit if above is an object or to retrieve a value)\r\n\t */\r\n\t_optionDatepicker: function( target, name, value ) {\r\n\t\tvar settings, date, minDate, maxDate,\r\n\t\t\tinst = this._getInst( target );\r\n\r\n\t\tif ( arguments.length === 2 && typeof name === \"string\" ) {\r\n\t\t\treturn ( name === \"defaults\" ? $.extend( {}, $.datepicker._defaults ) :\r\n\t\t\t\t( inst ? ( name === \"all\" ? $.extend( {}, inst.settings ) :\r\n\t\t\t\tthis._get( inst, name ) ) : null ) );\r\n\t\t}\r\n\r\n\t\tsettings = name || {};\r\n\t\tif ( typeof name === \"string\" ) {\r\n\t\t\tsettings = {};\r\n\t\t\tsettings[ name ] = value;\r\n\t\t}\r\n\r\n\t\tif ( inst ) {\r\n\t\t\tif ( this._curInst === inst ) {\r\n\t\t\t\tthis._hideDatepicker();\r\n\t\t\t}\r\n\r\n\t\t\tdate = this._getDateDatepicker( target, true );\r\n\t\t\tminDate = this._getMinMaxDate( inst, \"min\" );\r\n\t\t\tmaxDate = this._getMinMaxDate( inst, \"max\" );\r\n\t\t\tdatepicker_extendRemove( inst.settings, settings );\r\n\r\n\t\t\t// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided\r\n\t\t\tif ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) {\r\n\t\t\t\tinst.settings.minDate = this._formatDate( inst, minDate );\r\n\t\t\t}\r\n\t\t\tif ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) {\r\n\t\t\t\tinst.settings.maxDate = this._formatDate( inst, maxDate );\r\n\t\t\t}\r\n\t\t\tif ( \"disabled\" in settings ) {\r\n\t\t\t\tif ( settings.disabled ) {\r\n\t\t\t\t\tthis._disableDatepicker( target );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._enableDatepicker( target );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis._attachments( $( target ), inst );\r\n\t\t\tthis._autoSize( inst );\r\n\t\t\tthis._setDate( inst, date );\r\n\t\t\tthis._updateAlternate( inst );\r\n\t\t\tthis._updateDatepicker( inst );\r\n\t\t}\r\n\t},\r\n\r\n\t// Change method deprecated\r\n\t_changeDatepicker: function( target, name, value ) {\r\n\t\tthis._optionDatepicker( target, name, value );\r\n\t},\r\n\r\n\t/* Redraw the date picker attached to an input field or division.\r\n\t * @param target element - the target input field or division or span\r\n\t */\r\n\t_refreshDatepicker: function( target ) {\r\n\t\tvar inst = this._getInst( target );\r\n\t\tif ( inst ) {\r\n\t\t\tthis._updateDatepicker( inst );\r\n\t\t}\r\n\t},\r\n\r\n\t/* Set the dates for a jQuery selection.\r\n\t * @param target element - the target input field or division or span\r\n\t * @param date\tDate - the new date\r\n\t */\r\n\t_setDateDatepicker: function( target, date ) {\r\n\t\tvar inst = this._getInst( target );\r\n\t\tif ( inst ) {\r\n\t\t\tthis._setDate( inst, date );\r\n\t\t\tthis._updateDatepicker( inst );\r\n\t\t\tthis._updateAlternate( inst );\r\n\t\t}\r\n\t},\r\n\r\n\t/* Get the date(s) for the first entry in a jQuery selection.\r\n\t * @param target element - the target input field or division or span\r\n\t * @param noDefault boolean - true if no default date is to be used\r\n\t * @return Date - the current date\r\n\t */\r\n\t_getDateDatepicker: function( target, noDefault ) {\r\n\t\tvar inst = this._getInst( target );\r\n\t\tif ( inst && !inst.inline ) {\r\n\t\t\tthis._setDateFromField( inst, noDefault );\r\n\t\t}\r\n\t\treturn ( inst ? this._getDate( inst ) : null );\r\n\t},\r\n\r\n\t/* Handle keystrokes. */\r\n\t_doKeyDown: function( event ) {\r\n\t\tvar onSelect, dateStr, sel,\r\n\t\t\tinst = $.datepicker._getInst( event.target ),\r\n\t\t\thandled = true,\r\n\t\t\tisRTL = inst.dpDiv.is( \".ui-datepicker-rtl\" );\r\n\r\n\t\tinst._keyEvent = true;\r\n\t\tif ( $.datepicker._datepickerShowing ) {\r\n\t\t\tswitch ( event.keyCode ) {\r\n\t\t\t\tcase 9: $.datepicker._hideDatepicker();\r\n\t\t\t\t\t\thandled = false;\r\n\t\t\t\t\t\tbreak; // hide on tab out\r\n\t\t\t\tcase 13: sel = $( \"td.\" + $.datepicker._dayOverClass + \":not(.\" +\r\n\t\t\t\t\t\t\t\t\t$.datepicker._currentClass + \")\", inst.dpDiv );\r\n\t\t\t\t\t\tif ( sel[ 0 ] ) {\r\n\t\t\t\t\t\t\t$.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] );\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tonSelect = $.datepicker._get( inst, \"onSelect\" );\r\n\t\t\t\t\t\tif ( onSelect ) {\r\n\t\t\t\t\t\t\tdateStr = $.datepicker._formatDate( inst );\r\n\r\n\t\t\t\t\t\t\t// Trigger custom callback\r\n\t\t\t\t\t\t\tonSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$.datepicker._hideDatepicker();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn false; // don't submit the form\r\n\t\t\t\tcase 27: $.datepicker._hideDatepicker();\r\n\t\t\t\t\t\tbreak; // hide on escape\r\n\t\t\t\tcase 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?\r\n\t\t\t\t\t\t\t-$.datepicker._get( inst, \"stepBigMonths\" ) :\r\n\t\t\t\t\t\t\t-$.datepicker._get( inst, \"stepMonths\" ) ), \"M\" );\r\n\t\t\t\t\t\tbreak; // previous month/year on page up/+ ctrl\r\n\t\t\t\tcase 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?\r\n\t\t\t\t\t\t\t+$.datepicker._get( inst, \"stepBigMonths\" ) :\r\n\t\t\t\t\t\t\t+$.datepicker._get( inst, \"stepMonths\" ) ), \"M\" );\r\n\t\t\t\t\t\tbreak; // next month/year on page down/+ ctrl\r\n\t\t\t\tcase 35: if ( event.ctrlKey || event.metaKey ) {\r\n\t\t\t\t\t\t\t$.datepicker._clearDate( event.target );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\r\n\t\t\t\t\t\tbreak; // clear on ctrl or command +end\r\n\t\t\t\tcase 36: if ( event.ctrlKey || event.metaKey ) {\r\n\t\t\t\t\t\t\t$.datepicker._gotoToday( event.target );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\r\n\t\t\t\t\t\tbreak; // current on ctrl or command +home\r\n\t\t\t\tcase 37: if ( event.ctrlKey || event.metaKey ) {\r\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), \"D\" );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\r\n\r\n\t\t\t\t\t\t// -1 day on ctrl or command +left\r\n\t\t\t\t\t\tif ( event.originalEvent.altKey ) {\r\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, ( event.ctrlKey ?\r\n\t\t\t\t\t\t\t\t-$.datepicker._get( inst, \"stepBigMonths\" ) :\r\n\t\t\t\t\t\t\t\t-$.datepicker._get( inst, \"stepMonths\" ) ), \"M\" );\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// next month/year on alt +left on Mac\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 38: if ( event.ctrlKey || event.metaKey ) {\r\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, -7, \"D\" );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\r\n\t\t\t\t\t\tbreak; // -1 week on ctrl or command +up\r\n\t\t\t\tcase 39: if ( event.ctrlKey || event.metaKey ) {\r\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), \"D\" );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\r\n\r\n\t\t\t\t\t\t// +1 day on ctrl or command +right\r\n\t\t\t\t\t\tif ( event.originalEvent.altKey ) {\r\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, ( event.ctrlKey ?\r\n\t\t\t\t\t\t\t\t+$.datepicker._get( inst, \"stepBigMonths\" ) :\r\n\t\t\t\t\t\t\t\t+$.datepicker._get( inst, \"stepMonths\" ) ), \"M\" );\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// next month/year on alt +right\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\tcase 40: if ( event.ctrlKey || event.metaKey ) {\r\n\t\t\t\t\t\t\t$.datepicker._adjustDate( event.target, +7, \"D\" );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\thandled = event.ctrlKey || event.metaKey;\r\n\t\t\t\t\t\tbreak; // +1 week on ctrl or command +down\r\n\t\t\t\tdefault: handled = false;\r\n\t\t\t}\r\n\t\t} else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home\r\n\t\t\t$.datepicker._showDatepicker( this );\r\n\t\t} else {\r\n\t\t\thandled = false;\r\n\t\t}\r\n\r\n\t\tif ( handled ) {\r\n\t\t\tevent.preventDefault();\r\n\t\t\tevent.stopPropagation();\r\n\t\t}\r\n\t},\r\n\r\n\t/* Filter entered characters - based on date format. */\r\n\t_doKeyPress: function( event ) {\r\n\t\tvar chars, chr,\r\n\t\t\tinst = $.datepicker._getInst( event.target );\r\n\r\n\t\tif ( $.datepicker._get( inst, \"constrainInput\" ) ) {\r\n\t\t\tchars = $.datepicker._possibleChars( $.datepicker._get( inst, \"dateFormat\" ) );\r\n\t\t\tchr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode );\r\n\t\t\treturn event.ctrlKey || event.metaKey || ( chr < \" \" || !chars || chars.indexOf( chr ) > -1 );\r\n\t\t}\r\n\t},\r\n\r\n\t/* Synchronise manual entry and field/alternate field. */\r\n\t_doKeyUp: function( event ) {\r\n\t\tvar date,\r\n\t\t\tinst = $.datepicker._getInst( event.target );\r\n\r\n\t\tif ( inst.input.val() !== inst.lastVal ) {\r\n\t\t\ttry {\r\n\t\t\t\tdate = $.datepicker.parseDate( $.datepicker._get( inst, \"dateFormat\" ),\r\n\t\t\t\t\t( inst.input ? inst.input.val() : null ),\r\n\t\t\t\t\t$.datepicker._getFormatConfig( inst ) );\r\n\r\n\t\t\t\tif ( date ) { // only if valid\r\n\t\t\t\t\t$.datepicker._setDateFromField( inst );\r\n\t\t\t\t\t$.datepicker._updateAlternate( inst );\r\n\t\t\t\t\t$.datepicker._updateDatepicker( inst );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch ( err ) {\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* Pop-up the date picker for a given input field.\r\n\t * If false returned from beforeShow event handler do not show.\r\n\t * @param input element - the input field attached to the date picker or\r\n\t *\t\t\t\t\tevent - if triggered by focus\r\n\t */\r\n\t_showDatepicker: function( input ) {\r\n\t\tinput = input.target || input;\r\n\t\tif ( input.nodeName.toLowerCase() !== \"input\" ) { // find from button/image trigger\r\n\t\t\tinput = $( \"input\", input.parentNode )[ 0 ];\r\n\t\t}\r\n\r\n\t\tif ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar inst, beforeShow, beforeShowSettings, isFixed,\r\n\t\t\toffset, showAnim, duration;\r\n\r\n\t\tinst = $.datepicker._getInst( input );\r\n\t\tif ( $.datepicker._curInst && $.datepicker._curInst !== inst ) {\r\n\t\t\t$.datepicker._curInst.dpDiv.stop( true, true );\r\n\t\t\tif ( inst && $.datepicker._datepickerShowing ) {\r\n\t\t\t\t$.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tbeforeShow = $.datepicker._get( inst, \"beforeShow\" );\r\n\t\tbeforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {};\r\n\t\tif ( beforeShowSettings === false ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tdatepicker_extendRemove( inst.settings, beforeShowSettings );\r\n\r\n\t\tinst.lastVal = null;\r\n\t\t$.datepicker._lastInput = input;\r\n\t\t$.datepicker._setDateFromField( inst );\r\n\r\n\t\tif ( $.datepicker._inDialog ) { // hide cursor\r\n\t\t\tinput.value = \"\";\r\n\t\t}\r\n\t\tif ( !$.datepicker._pos ) { // position below input\r\n\t\t\t$.datepicker._pos = $.datepicker._findPos( input );\r\n\t\t\t$.datepicker._pos[ 1 ] += input.offsetHeight; // add the height\r\n\t\t}\r\n\r\n\t\tisFixed = false;\r\n\t\t$( input ).parents().each( function() {\r\n\t\t\tisFixed |= $( this ).css( \"position\" ) === \"fixed\";\r\n\t\t\treturn !isFixed;\r\n\t\t} );\r\n\r\n\t\toffset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };\r\n\t\t$.datepicker._pos = null;\r\n\r\n\t\t//to avoid flashes on Firefox\r\n\t\tinst.dpDiv.empty();\r\n\r\n\t\t// determine sizing offscreen\r\n\t\tinst.dpDiv.css( { position: \"absolute\", display: \"block\", top: \"-1000px\" } );\r\n\t\t$.datepicker._updateDatepicker( inst );\r\n\r\n\t\t// fix width for dynamic number of date pickers\r\n\t\t// and adjust position before showing\r\n\t\toffset = $.datepicker._checkOffset( inst, offset, isFixed );\r\n\t\tinst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?\r\n\t\t\t\"static\" : ( isFixed ? \"fixed\" : \"absolute\" ) ), display: \"none\",\r\n\t\t\tleft: offset.left + \"px\", top: offset.top + \"px\" } );\r\n\r\n\t\tif ( !inst.inline ) {\r\n\t\t\tshowAnim = $.datepicker._get( inst, \"showAnim\" );\r\n\t\t\tduration = $.datepicker._get( inst, \"duration\" );\r\n\t\t\tinst.dpDiv.css( \"z-index\", datepicker_getZindex( $( input ) ) + 1 );\r\n\t\t\t$.datepicker._datepickerShowing = true;\r\n\r\n\t\t\tif ( $.effects && $.effects.effect[ showAnim ] ) {\r\n\t\t\t\tinst.dpDiv.show( showAnim, $.datepicker._get( inst, \"showOptions\" ), duration );\r\n\t\t\t} else {\r\n\t\t\t\tinst.dpDiv[ showAnim || \"show\" ]( showAnim ? duration : null );\r\n\t\t\t}\r\n\r\n\t\t\tif ( $.datepicker._shouldFocusInput( inst ) ) {\r\n\t\t\t\tinst.input.trigger( \"focus\" );\r\n\t\t\t}\r\n\r\n\t\t\t$.datepicker._curInst = inst;\r\n\t\t}\r\n\t},\r\n\r\n\t/* Generate the date picker content. */\r\n\t_updateDatepicker: function( inst ) {\r\n\t\tthis.maxRows = 4; //Reset the max number of rows being displayed (see #7043)\r\n\t\tdatepicker_instActive = inst; // for delegate hover events\r\n\t\tinst.dpDiv.empty().append( this._generateHTML( inst ) );\r\n\t\tthis._attachHandlers( inst );\r\n\r\n\t\tvar origyearshtml,\r\n\t\t\tnumMonths = this._getNumberOfMonths( inst ),\r\n\t\t\tcols = numMonths[ 1 ],\r\n\t\t\twidth = 17,\r\n\t\t\tactiveCell = inst.dpDiv.find( \".\" + this._dayOverClass + \" a\" );\r\n\r\n\t\tif ( activeCell.length > 0 ) {\r\n\t\t\tdatepicker_handleMouseover.apply( activeCell.get( 0 ) );\r\n\t\t}\r\n\r\n\t\tinst.dpDiv.removeClass( \"ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4\" ).width( \"\" );\r\n\t\tif ( cols > 1 ) {\r\n\t\t\tinst.dpDiv.addClass( \"ui-datepicker-multi-\" + cols ).css( \"width\", ( width * cols ) + \"em\" );\r\n\t\t}\r\n\t\tinst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? \"add\" : \"remove\" ) +\r\n\t\t\t\"Class\" ]( \"ui-datepicker-multi\" );\r\n\t\tinst.dpDiv[ ( this._get( inst, \"isRTL\" ) ? \"add\" : \"remove\" ) +\r\n\t\t\t\"Class\" ]( \"ui-datepicker-rtl\" );\r\n\r\n\t\tif ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {\r\n\t\t\tinst.input.trigger( \"focus\" );\r\n\t\t}\r\n\r\n\t\t// Deffered render of the years select (to avoid flashes on Firefox)\r\n\t\tif ( inst.yearshtml ) {\r\n\t\t\torigyearshtml = inst.yearshtml;\r\n\t\t\tsetTimeout( function() {\r\n\r\n\t\t\t\t//assure that inst.yearshtml didn't change.\r\n\t\t\t\tif ( origyearshtml === inst.yearshtml && inst.yearshtml ) {\r\n\t\t\t\t\tinst.dpDiv.find( \"select.ui-datepicker-year:first\" ).replaceWith( inst.yearshtml );\r\n\t\t\t\t}\r\n\t\t\t\torigyearshtml = inst.yearshtml = null;\r\n\t\t\t}, 0 );\r\n\t\t}\r\n\t},\r\n\r\n\t// #6694 - don't focus the input if it's already focused\r\n\t// this breaks the change event in IE\r\n\t// Support: IE and jQuery <1.9\r\n\t_shouldFocusInput: function( inst ) {\r\n\t\treturn inst.input && inst.input.is( \":visible\" ) && !inst.input.is( \":disabled\" ) && !inst.input.is( \":focus\" );\r\n\t},\r\n\r\n\t/* Check positioning to remain on screen. */\r\n\t_checkOffset: function( inst, offset, isFixed ) {\r\n\t\tvar dpWidth = inst.dpDiv.outerWidth(),\r\n\t\t\tdpHeight = inst.dpDiv.outerHeight(),\r\n\t\t\tinputWidth = inst.input ? inst.input.outerWidth() : 0,\r\n\t\t\tinputHeight = inst.input ? inst.input.outerHeight() : 0,\r\n\t\t\tviewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ),\r\n\t\t\tviewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() );\r\n\r\n\t\toffset.left -= ( this._get( inst, \"isRTL\" ) ? ( dpWidth - inputWidth ) : 0 );\r\n\t\toffset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0;\r\n\t\toffset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0;\r\n\r\n\t\t// Now check if datepicker is showing outside window viewport - move to a better place if so.\r\n\t\toffset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ?\r\n\t\t\tMath.abs( offset.left + dpWidth - viewWidth ) : 0 );\r\n\t\toffset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ?\r\n\t\t\tMath.abs( dpHeight + inputHeight ) : 0 );\r\n\r\n\t\treturn offset;\r\n\t},\r\n\r\n\t/* Find an object's position on the screen. */\r\n\t_findPos: function( obj ) {\r\n\t\tvar position,\r\n\t\t\tinst = this._getInst( obj ),\r\n\t\t\tisRTL = this._get( inst, \"isRTL\" );\r\n\r\n\t\twhile ( obj && ( obj.type === \"hidden\" || obj.nodeType !== 1 || $.expr.filters.hidden( obj ) ) ) {\r\n\t\t\tobj = obj[ isRTL ? \"previousSibling\" : \"nextSibling\" ];\r\n\t\t}\r\n\r\n\t\tposition = $( obj ).offset();\r\n\t\treturn [ position.left, position.top ];\r\n\t},\r\n\r\n\t/* Hide the date picker from view.\r\n\t * @param input element - the input field attached to the date picker\r\n\t */\r\n\t_hideDatepicker: function( input ) {\r\n\t\tvar showAnim, duration, postProcess, onClose,\r\n\t\t\tinst = this._curInst;\r\n\r\n\t\tif ( !inst || ( input && inst !== $.data( input, \"datepicker\" ) ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ( this._datepickerShowing ) {\r\n\t\t\tshowAnim = this._get( inst, \"showAnim\" );\r\n\t\t\tduration = this._get( inst, \"duration\" );\r\n\t\t\tpostProcess = function() {\r\n\t\t\t\t$.datepicker._tidyDialog( inst );\r\n\t\t\t};\r\n\r\n\t\t\t// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed\r\n\t\t\tif ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {\r\n\t\t\t\tinst.dpDiv.hide( showAnim, $.datepicker._get( inst, \"showOptions\" ), duration, postProcess );\r\n\t\t\t} else {\r\n\t\t\t\tinst.dpDiv[ ( showAnim === \"slideDown\" ? \"slideUp\" :\r\n\t\t\t\t\t( showAnim === \"fadeIn\" ? \"fadeOut\" : \"hide\" ) ) ]( ( showAnim ? duration : null ), postProcess );\r\n\t\t\t}\r\n\r\n\t\t\tif ( !showAnim ) {\r\n\t\t\t\tpostProcess();\r\n\t\t\t}\r\n\t\t\tthis._datepickerShowing = false;\r\n\r\n\t\t\tonClose = this._get( inst, \"onClose\" );\r\n\t\t\tif ( onClose ) {\r\n\t\t\t\tonClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : \"\" ), inst ] );\r\n\t\t\t}\r\n\r\n\t\t\tthis._lastInput = null;\r\n\t\t\tif ( this._inDialog ) {\r\n\t\t\t\tthis._dialogInput.css( { position: \"absolute\", left: \"0\", top: \"-100px\" } );\r\n\t\t\t\tif ( $.blockUI ) {\r\n\t\t\t\t\t$.unblockUI();\r\n\t\t\t\t\t$( \"body\" ).append( this.dpDiv );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis._inDialog = false;\r\n\t\t}\r\n\t},\r\n\r\n\t/* Tidy up after a dialog display. */\r\n\t_tidyDialog: function( inst ) {\r\n\t\tinst.dpDiv.removeClass( this._dialogClass ).off( \".ui-datepicker-calendar\" );\r\n\t},\r\n\r\n\t/* Close date picker if clicked elsewhere. */\r\n\t_checkExternalClick: function( event ) {\r\n\t\tif ( !$.datepicker._curInst ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar $target = $( event.target ),\r\n\t\t\tinst = $.datepicker._getInst( $target[ 0 ] );\r\n\r\n\t\tif ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId &&\r\n\t\t\t\t$target.parents( \"#\" + $.datepicker._mainDivId ).length === 0 &&\r\n\t\t\t\t!$target.hasClass( $.datepicker.markerClassName ) &&\r\n\t\t\t\t!$target.closest( \".\" + $.datepicker._triggerClass ).length &&\r\n\t\t\t\t$.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) ||\r\n\t\t\t( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) {\r\n\t\t\t\t$.datepicker._hideDatepicker();\r\n\t\t}\r\n\t},\r\n\r\n\t/* Adjust one of the date sub-fields. */\r\n\t_adjustDate: function( id, offset, period ) {\r\n\t\tvar target = $( id ),\r\n\t\t\tinst = this._getInst( target[ 0 ] );\r\n\r\n\t\tif ( this._isDisabledDatepicker( target[ 0 ] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._adjustInstDate( inst, offset +\r\n\t\t\t( period === \"M\" ? this._get( inst, \"showCurrentAtPos\" ) : 0 ), // undo positioning\r\n\t\t\tperiod );\r\n\t\tthis._updateDatepicker( inst );\r\n\t},\r\n\r\n\t/* Action for current link. */\r\n\t_gotoToday: function( id ) {\r\n\t\tvar date,\r\n\t\t\ttarget = $( id ),\r\n\t\t\tinst = this._getInst( target[ 0 ] );\r\n\r\n\t\tif ( this._get( inst, \"gotoCurrent\" ) && inst.currentDay ) {\r\n\t\t\tinst.selectedDay = inst.currentDay;\r\n\t\t\tinst.drawMonth = inst.selectedMonth = inst.currentMonth;\r\n\t\t\tinst.drawYear = inst.selectedYear = inst.currentYear;\r\n\t\t} else {\r\n\t\t\tdate = new Date();\r\n\t\t\tinst.selectedDay = date.getDate();\r\n\t\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\r\n\t\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\r\n\t\t}\r\n\t\tthis._notifyChange( inst );\r\n\t\tthis._adjustDate( target );\r\n\t},\r\n\r\n\t/* Action for selecting a new month/year. */\r\n\t_selectMonthYear: function( id, select, period ) {\r\n\t\tvar target = $( id ),\r\n\t\t\tinst = this._getInst( target[ 0 ] );\r\n\r\n\t\tinst[ \"selected\" + ( period === \"M\" ? \"Month\" : \"Year\" ) ] =\r\n\t\tinst[ \"draw\" + ( period === \"M\" ? \"Month\" : \"Year\" ) ] =\r\n\t\t\tparseInt( select.options[ select.selectedIndex ].value, 10 );\r\n\r\n\t\tthis._notifyChange( inst );\r\n\t\tthis._adjustDate( target );\r\n\t},\r\n\r\n\t/* Action for selecting a day. */\r\n\t_selectDay: function( id, month, year, td ) {\r\n\t\tvar inst,\r\n\t\t\ttarget = $( id );\r\n\r\n\t\tif ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tinst = this._getInst( target[ 0 ] );\r\n\t\tinst.selectedDay = inst.currentDay = $( \"a\", td ).html();\r\n\t\tinst.selectedMonth = inst.currentMonth = month;\r\n\t\tinst.selectedYear = inst.currentYear = year;\r\n\t\tthis._selectDate( id, this._formatDate( inst,\r\n\t\t\tinst.currentDay, inst.currentMonth, inst.currentYear ) );\r\n\t},\r\n\r\n\t/* Erase the input field and hide the date picker. */\r\n\t_clearDate: function( id ) {\r\n\t\tvar target = $( id );\r\n\t\tthis._selectDate( target, \"\" );\r\n\t},\r\n\r\n\t/* Update the input field with the selected date. */\r\n\t_selectDate: function( id, dateStr ) {\r\n\t\tvar onSelect,\r\n\t\t\ttarget = $( id ),\r\n\t\t\tinst = this._getInst( target[ 0 ] );\r\n\r\n\t\tdateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) );\r\n\t\tif ( inst.input ) {\r\n\t\t\tinst.input.val( dateStr );\r\n\t\t}\r\n\t\tthis._updateAlternate( inst );\r\n\r\n\t\tonSelect = this._get( inst, \"onSelect\" );\r\n\t\tif ( onSelect ) {\r\n\t\t\tonSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); // trigger custom callback\r\n\t\t} else if ( inst.input ) {\r\n\t\t\tinst.input.trigger( \"change\" ); // fire the change event\r\n\t\t}\r\n\r\n\t\tif ( inst.inline ) {\r\n\t\t\tthis._updateDatepicker( inst );\r\n\t\t} else {\r\n\t\t\tthis._hideDatepicker();\r\n\t\t\tthis._lastInput = inst.input[ 0 ];\r\n\t\t\tif ( typeof( inst.input[ 0 ] ) !== \"object\" ) {\r\n\t\t\t\tinst.input.trigger( \"focus\" ); // restore focus\r\n\t\t\t}\r\n\t\t\tthis._lastInput = null;\r\n\t\t}\r\n\t},\r\n\r\n\t/* Update any alternate field to synchronise with the main field. */\r\n\t_updateAlternate: function( inst ) {\r\n\t\tvar altFormat, date, dateStr,\r\n\t\t\taltField = this._get( inst, \"altField\" );\r\n\r\n\t\tif ( altField ) { // update alternate field too\r\n\t\t\taltFormat = this._get( inst, \"altFormat\" ) || this._get( inst, \"dateFormat\" );\r\n\t\t\tdate = this._getDate( inst );\r\n\t\t\tdateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );\r\n\t\t\t$( altField ).val( dateStr );\r\n\t\t}\r\n\t},\r\n\r\n\t/* Set as beforeShowDay function to prevent selection of weekends.\r\n\t * @param date Date - the date to customise\r\n\t * @return [boolean, string] - is this date selectable?, what is its CSS class?\r\n\t */\r\n\tnoWeekends: function( date ) {\r\n\t\tvar day = date.getDay();\r\n\t\treturn [ ( day > 0 && day < 6 ), \"\" ];\r\n\t},\r\n\r\n\t/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.\r\n\t * @param date Date - the date to get the week for\r\n\t * @return number - the number of the week within the year that contains this date\r\n\t */\r\n\tiso8601Week: function( date ) {\r\n\t\tvar time,\r\n\t\t\tcheckDate = new Date( date.getTime() );\r\n\r\n\t\t// Find Thursday of this week starting on Monday\r\n\t\tcheckDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) );\r\n\r\n\t\ttime = checkDate.getTime();\r\n\t\tcheckDate.setMonth( 0 ); // Compare with Jan 1\r\n\t\tcheckDate.setDate( 1 );\r\n\t\treturn Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1;\r\n\t},\r\n\r\n\t/* Parse a string value into a date object.\r\n\t * See formatDate below for the possible formats.\r\n\t *\r\n\t * @param format string - the expected format of the date\r\n\t * @param value string - the date in the above format\r\n\t * @param settings Object - attributes include:\r\n\t *\t\t\t\t\tshortYearCutoff number - the cutoff year for determining the century (optional)\r\n\t *\t\t\t\t\tdayNamesShort\tstring[7] - abbreviated names of the days from Sunday (optional)\r\n\t *\t\t\t\t\tdayNames\t\tstring[7] - names of the days from Sunday (optional)\r\n\t *\t\t\t\t\tmonthNamesShort string[12] - abbreviated names of the months (optional)\r\n\t *\t\t\t\t\tmonthNames\t\tstring[12] - names of the months (optional)\r\n\t * @return Date - the extracted date value or null if value is blank\r\n\t */\r\n\tparseDate: function( format, value, settings ) {\r\n\t\tif ( format == null || value == null ) {\r\n\t\t\tthrow \"Invalid arguments\";\r\n\t\t}\r\n\r\n\t\tvalue = ( typeof value === \"object\" ? value.toString() : value + \"\" );\r\n\t\tif ( value === \"\" ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tvar iFormat, dim, extra,\r\n\t\t\tiValue = 0,\r\n\t\t\tshortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff,\r\n\t\t\tshortYearCutoff = ( typeof shortYearCutoffTemp !== \"string\" ? shortYearCutoffTemp :\r\n\t\t\t\tnew Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ),\r\n\t\t\tdayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,\r\n\t\t\tdayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,\r\n\t\t\tmonthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,\r\n\t\t\tmonthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,\r\n\t\t\tyear = -1,\r\n\t\t\tmonth = -1,\r\n\t\t\tday = -1,\r\n\t\t\tdoy = -1,\r\n\t\t\tliteral = false,\r\n\t\t\tdate,\r\n\r\n\t\t\t// Check whether a format character is doubled\r\n\t\t\tlookAhead = function( match ) {\r\n\t\t\t\tvar matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );\r\n\t\t\t\tif ( matches ) {\r\n\t\t\t\t\tiFormat++;\r\n\t\t\t\t}\r\n\t\t\t\treturn matches;\r\n\t\t\t},\r\n\r\n\t\t\t// Extract a number from the string value\r\n\t\t\tgetNumber = function( match ) {\r\n\t\t\t\tvar isDoubled = lookAhead( match ),\r\n\t\t\t\t\tsize = ( match === \"@\" ? 14 : ( match === \"!\" ? 20 :\r\n\t\t\t\t\t( match === \"y\" && isDoubled ? 4 : ( match === \"o\" ? 3 : 2 ) ) ) ),\r\n\t\t\t\t\tminSize = ( match === \"y\" ? size : 1 ),\r\n\t\t\t\t\tdigits = new RegExp( \"^\\\\d{\" + minSize + \",\" + size + \"}\" ),\r\n\t\t\t\t\tnum = value.substring( iValue ).match( digits );\r\n\t\t\t\tif ( !num ) {\r\n\t\t\t\t\tthrow \"Missing number at position \" + iValue;\r\n\t\t\t\t}\r\n\t\t\t\tiValue += num[ 0 ].length;\r\n\t\t\t\treturn parseInt( num[ 0 ], 10 );\r\n\t\t\t},\r\n\r\n\t\t\t// Extract a name from the string value and convert to an index\r\n\t\t\tgetName = function( match, shortNames, longNames ) {\r\n\t\t\t\tvar index = -1,\r\n\t\t\t\t\tnames = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) {\r\n\t\t\t\t\t\treturn [ [ k, v ] ];\r\n\t\t\t\t\t} ).sort( function( a, b ) {\r\n\t\t\t\t\t\treturn -( a[ 1 ].length - b[ 1 ].length );\r\n\t\t\t\t\t} );\r\n\r\n\t\t\t\t$.each( names, function( i, pair ) {\r\n\t\t\t\t\tvar name = pair[ 1 ];\r\n\t\t\t\t\tif ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) {\r\n\t\t\t\t\t\tindex = pair[ 0 ];\r\n\t\t\t\t\t\tiValue += name.length;\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} );\r\n\t\t\t\tif ( index !== -1 ) {\r\n\t\t\t\t\treturn index + 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow \"Unknown name at position \" + iValue;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// Confirm that a literal character matches the string value\r\n\t\t\tcheckLiteral = function() {\r\n\t\t\t\tif ( value.charAt( iValue ) !== format.charAt( iFormat ) ) {\r\n\t\t\t\t\tthrow \"Unexpected literal at position \" + iValue;\r\n\t\t\t\t}\r\n\t\t\t\tiValue++;\r\n\t\t\t};\r\n\r\n\t\tfor ( iFormat = 0; iFormat < format.length; iFormat++ ) {\r\n\t\t\tif ( literal ) {\r\n\t\t\t\tif ( format.charAt( iFormat ) === \"'\" && !lookAhead( \"'\" ) ) {\r\n\t\t\t\t\tliteral = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcheckLiteral();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tswitch ( format.charAt( iFormat ) ) {\r\n\t\t\t\t\tcase \"d\":\r\n\t\t\t\t\t\tday = getNumber( \"d\" );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"D\":\r\n\t\t\t\t\t\tgetName( \"D\", dayNamesShort, dayNames );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"o\":\r\n\t\t\t\t\t\tdoy = getNumber( \"o\" );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"m\":\r\n\t\t\t\t\t\tmonth = getNumber( \"m\" );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"M\":\r\n\t\t\t\t\t\tmonth = getName( \"M\", monthNamesShort, monthNames );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"y\":\r\n\t\t\t\t\t\tyear = getNumber( \"y\" );\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"@\":\r\n\t\t\t\t\t\tdate = new Date( getNumber( \"@\" ) );\r\n\t\t\t\t\t\tyear = date.getFullYear();\r\n\t\t\t\t\t\tmonth = date.getMonth() + 1;\r\n\t\t\t\t\t\tday = date.getDate();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"!\":\r\n\t\t\t\t\t\tdate = new Date( ( getNumber( \"!\" ) - this._ticksTo1970 ) / 10000 );\r\n\t\t\t\t\t\tyear = date.getFullYear();\r\n\t\t\t\t\t\tmonth = date.getMonth() + 1;\r\n\t\t\t\t\t\tday = date.getDate();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"'\":\r\n\t\t\t\t\t\tif ( lookAhead( \"'\" ) ) {\r\n\t\t\t\t\t\t\tcheckLiteral();\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tliteral = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tcheckLiteral();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( iValue < value.length ) {\r\n\t\t\textra = value.substr( iValue );\r\n\t\t\tif ( !/^\\s+/.test( extra ) ) {\r\n\t\t\t\tthrow \"Extra/unparsed characters found in date: \" + extra;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( year === -1 ) {\r\n\t\t\tyear = new Date().getFullYear();\r\n\t\t} else if ( year < 100 ) {\r\n\t\t\tyear += new Date().getFullYear() - new Date().getFullYear() % 100 +\r\n\t\t\t\t( year <= shortYearCutoff ? 0 : -100 );\r\n\t\t}\r\n\r\n\t\tif ( doy > -1 ) {\r\n\t\t\tmonth = 1;\r\n\t\t\tday = doy;\r\n\t\t\tdo {\r\n\t\t\t\tdim = this._getDaysInMonth( year, month - 1 );\r\n\t\t\t\tif ( day <= dim ) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tmonth++;\r\n\t\t\t\tday -= dim;\r\n\t\t\t} while ( true );\r\n\t\t}\r\n\r\n\t\tdate = this._daylightSavingAdjust( new Date( year, month - 1, day ) );\r\n\t\tif ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) {\r\n\t\t\tthrow \"Invalid date\"; // E.g. 31/02/00\r\n\t\t}\r\n\t\treturn date;\r\n\t},\r\n\r\n\t/* Standard date formats. */\r\n\tATOM: \"yy-mm-dd\", // RFC 3339 (ISO 8601)\r\n\tCOOKIE: \"D, dd M yy\",\r\n\tISO_8601: \"yy-mm-dd\",\r\n\tRFC_822: \"D, d M y\",\r\n\tRFC_850: \"DD, dd-M-y\",\r\n\tRFC_1036: \"D, d M y\",\r\n\tRFC_1123: \"D, d M yy\",\r\n\tRFC_2822: \"D, d M yy\",\r\n\tRSS: \"D, d M y\", // RFC 822\r\n\tTICKS: \"!\",\r\n\tTIMESTAMP: \"@\",\r\n\tW3C: \"yy-mm-dd\", // ISO 8601\r\n\r\n\t_ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) +\r\n\t\tMath.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ),\r\n\r\n\t/* Format a date object into a string value.\r\n\t * The format can be combinations of the following:\r\n\t * d - day of month (no leading zero)\r\n\t * dd - day of month (two digit)\r\n\t * o - day of year (no leading zeros)\r\n\t * oo - day of year (three digit)\r\n\t * D - day name short\r\n\t * DD - day name long\r\n\t * m - month of year (no leading zero)\r\n\t * mm - month of year (two digit)\r\n\t * M - month name short\r\n\t * MM - month name long\r\n\t * y - year (two digit)\r\n\t * yy - year (four digit)\r\n\t * @ - Unix timestamp (ms since 01/01/1970)\r\n\t * ! - Windows ticks (100ns since 01/01/0001)\r\n\t * \"...\" - literal text\r\n\t * '' - single quote\r\n\t *\r\n\t * @param format string - the desired format of the date\r\n\t * @param date Date - the date value to format\r\n\t * @param settings Object - attributes include:\r\n\t *\t\t\t\t\tdayNamesShort\tstring[7] - abbreviated names of the days from Sunday (optional)\r\n\t *\t\t\t\t\tdayNames\t\tstring[7] - names of the days from Sunday (optional)\r\n\t *\t\t\t\t\tmonthNamesShort string[12] - abbreviated names of the months (optional)\r\n\t *\t\t\t\t\tmonthNames\t\tstring[12] - names of the months (optional)\r\n\t * @return string - the date in the above format\r\n\t */\r\n\tformatDate: function( format, date, settings ) {\r\n\t\tif ( !date ) {\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t\tvar iFormat,\r\n\t\t\tdayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,\r\n\t\t\tdayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,\r\n\t\t\tmonthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,\r\n\t\t\tmonthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,\r\n\r\n\t\t\t// Check whether a format character is doubled\r\n\t\t\tlookAhead = function( match ) {\r\n\t\t\t\tvar matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );\r\n\t\t\t\tif ( matches ) {\r\n\t\t\t\t\tiFormat++;\r\n\t\t\t\t}\r\n\t\t\t\treturn matches;\r\n\t\t\t},\r\n\r\n\t\t\t// Format a number, with leading zero if necessary\r\n\t\t\tformatNumber = function( match, value, len ) {\r\n\t\t\t\tvar num = \"\" + value;\r\n\t\t\t\tif ( lookAhead( match ) ) {\r\n\t\t\t\t\twhile ( num.length < len ) {\r\n\t\t\t\t\t\tnum = \"0\" + num;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn num;\r\n\t\t\t},\r\n\r\n\t\t\t// Format a name, short or long as requested\r\n\t\t\tformatName = function( match, value, shortNames, longNames ) {\r\n\t\t\t\treturn ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] );\r\n\t\t\t},\r\n\t\t\toutput = \"\",\r\n\t\t\tliteral = false;\r\n\r\n\t\tif ( date ) {\r\n\t\t\tfor ( iFormat = 0; iFormat < format.length; iFormat++ ) {\r\n\t\t\t\tif ( literal ) {\r\n\t\t\t\t\tif ( format.charAt( iFormat ) === \"'\" && !lookAhead( \"'\" ) ) {\r\n\t\t\t\t\t\tliteral = false;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\toutput += format.charAt( iFormat );\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tswitch ( format.charAt( iFormat ) ) {\r\n\t\t\t\t\t\tcase \"d\":\r\n\t\t\t\t\t\t\toutput += formatNumber( \"d\", date.getDate(), 2 );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"D\":\r\n\t\t\t\t\t\t\toutput += formatName( \"D\", date.getDay(), dayNamesShort, dayNames );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"o\":\r\n\t\t\t\t\t\t\toutput += formatNumber( \"o\",\r\n\t\t\t\t\t\t\t\tMath.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"m\":\r\n\t\t\t\t\t\t\toutput += formatNumber( \"m\", date.getMonth() + 1, 2 );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"M\":\r\n\t\t\t\t\t\t\toutput += formatName( \"M\", date.getMonth(), monthNamesShort, monthNames );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"y\":\r\n\t\t\t\t\t\t\toutput += ( lookAhead( \"y\" ) ? date.getFullYear() :\r\n\t\t\t\t\t\t\t\t( date.getFullYear() % 100 < 10 ? \"0\" : \"\" ) + date.getFullYear() % 100 );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"@\":\r\n\t\t\t\t\t\t\toutput += date.getTime();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"!\":\r\n\t\t\t\t\t\t\toutput += date.getTime() * 10000 + this._ticksTo1970;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"'\":\r\n\t\t\t\t\t\t\tif ( lookAhead( \"'\" ) ) {\r\n\t\t\t\t\t\t\t\toutput += \"'\";\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tliteral = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\toutput += format.charAt( iFormat );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t/* Extract all possible characters from the date format. */\r\n\t_possibleChars: function( format ) {\r\n\t\tvar iFormat,\r\n\t\t\tchars = \"\",\r\n\t\t\tliteral = false,\r\n\r\n\t\t\t// Check whether a format character is doubled\r\n\t\t\tlookAhead = function( match ) {\r\n\t\t\t\tvar matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );\r\n\t\t\t\tif ( matches ) {\r\n\t\t\t\t\tiFormat++;\r\n\t\t\t\t}\r\n\t\t\t\treturn matches;\r\n\t\t\t};\r\n\r\n\t\tfor ( iFormat = 0; iFormat < format.length; iFormat++ ) {\r\n\t\t\tif ( literal ) {\r\n\t\t\t\tif ( format.charAt( iFormat ) === \"'\" && !lookAhead( \"'\" ) ) {\r\n\t\t\t\t\tliteral = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tchars += format.charAt( iFormat );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tswitch ( format.charAt( iFormat ) ) {\r\n\t\t\t\t\tcase \"d\": case \"m\": case \"y\": case \"@\":\r\n\t\t\t\t\t\tchars += \"0123456789\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"D\": case \"M\":\r\n\t\t\t\t\t\treturn null; // Accept anything\r\n\t\t\t\t\tcase \"'\":\r\n\t\t\t\t\t\tif ( lookAhead( \"'\" ) ) {\r\n\t\t\t\t\t\t\tchars += \"'\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tliteral = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tchars += format.charAt( iFormat );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn chars;\r\n\t},\r\n\r\n\t/* Get a setting value, defaulting if necessary. */\r\n\t_get: function( inst, name ) {\r\n\t\treturn inst.settings[ name ] !== undefined ?\r\n\t\t\tinst.settings[ name ] : this._defaults[ name ];\r\n\t},\r\n\r\n\t/* Parse existing date and initialise date picker. */\r\n\t_setDateFromField: function( inst, noDefault ) {\r\n\t\tif ( inst.input.val() === inst.lastVal ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar dateFormat = this._get( inst, \"dateFormat\" ),\r\n\t\t\tdates = inst.lastVal = inst.input ? inst.input.val() : null,\r\n\t\t\tdefaultDate = this._getDefaultDate( inst ),\r\n\t\t\tdate = defaultDate,\r\n\t\t\tsettings = this._getFormatConfig( inst );\r\n\r\n\t\ttry {\r\n\t\t\tdate = this.parseDate( dateFormat, dates, settings ) || defaultDate;\r\n\t\t} catch ( event ) {\r\n\t\t\tdates = ( noDefault ? \"\" : dates );\r\n\t\t}\r\n\t\tinst.selectedDay = date.getDate();\r\n\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\r\n\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\r\n\t\tinst.currentDay = ( dates ? date.getDate() : 0 );\r\n\t\tinst.currentMonth = ( dates ? date.getMonth() : 0 );\r\n\t\tinst.currentYear = ( dates ? date.getFullYear() : 0 );\r\n\t\tthis._adjustInstDate( inst );\r\n\t},\r\n\r\n\t/* Retrieve the default date shown on opening. */\r\n\t_getDefaultDate: function( inst ) {\r\n\t\treturn this._restrictMinMax( inst,\r\n\t\t\tthis._determineDate( inst, this._get( inst, \"defaultDate\" ), new Date() ) );\r\n\t},\r\n\r\n\t/* A date may be specified as an exact value or a relative one. */\r\n\t_determineDate: function( inst, date, defaultDate ) {\r\n\t\tvar offsetNumeric = function( offset ) {\r\n\t\t\t\tvar date = new Date();\r\n\t\t\t\tdate.setDate( date.getDate() + offset );\r\n\t\t\t\treturn date;\r\n\t\t\t},\r\n\t\t\toffsetString = function( offset ) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\treturn $.datepicker.parseDate( $.datepicker._get( inst, \"dateFormat\" ),\r\n\t\t\t\t\t\toffset, $.datepicker._getFormatConfig( inst ) );\r\n\t\t\t\t}\r\n\t\t\t\tcatch ( e ) {\r\n\r\n\t\t\t\t\t// Ignore\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar date = ( offset.toLowerCase().match( /^c/ ) ?\r\n\t\t\t\t\t$.datepicker._getDate( inst ) : null ) || new Date(),\r\n\t\t\t\t\tyear = date.getFullYear(),\r\n\t\t\t\t\tmonth = date.getMonth(),\r\n\t\t\t\t\tday = date.getDate(),\r\n\t\t\t\t\tpattern = /([+\\-]?[0-9]+)\\s*(d|D|w|W|m|M|y|Y)?/g,\r\n\t\t\t\t\tmatches = pattern.exec( offset );\r\n\r\n\t\t\t\twhile ( matches ) {\r\n\t\t\t\t\tswitch ( matches[ 2 ] || \"d\" ) {\r\n\t\t\t\t\t\tcase \"d\" : case \"D\" :\r\n\t\t\t\t\t\t\tday += parseInt( matches[ 1 ], 10 ); break;\r\n\t\t\t\t\t\tcase \"w\" : case \"W\" :\r\n\t\t\t\t\t\t\tday += parseInt( matches[ 1 ], 10 ) * 7; break;\r\n\t\t\t\t\t\tcase \"m\" : case \"M\" :\r\n\t\t\t\t\t\t\tmonth += parseInt( matches[ 1 ], 10 );\r\n\t\t\t\t\t\t\tday = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"y\": case \"Y\" :\r\n\t\t\t\t\t\t\tyear += parseInt( matches[ 1 ], 10 );\r\n\t\t\t\t\t\t\tday = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmatches = pattern.exec( offset );\r\n\t\t\t\t}\r\n\t\t\t\treturn new Date( year, month, day );\r\n\t\t\t},\r\n\t\t\tnewDate = ( date == null || date === \"\" ? defaultDate : ( typeof date === \"string\" ? offsetString( date ) :\r\n\t\t\t\t( typeof date === \"number\" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) );\r\n\r\n\t\tnewDate = ( newDate && newDate.toString() === \"Invalid Date\" ? defaultDate : newDate );\r\n\t\tif ( newDate ) {\r\n\t\t\tnewDate.setHours( 0 );\r\n\t\t\tnewDate.setMinutes( 0 );\r\n\t\t\tnewDate.setSeconds( 0 );\r\n\t\t\tnewDate.setMilliseconds( 0 );\r\n\t\t}\r\n\t\treturn this._daylightSavingAdjust( newDate );\r\n\t},\r\n\r\n\t/* Handle switch to/from daylight saving.\r\n\t * Hours may be non-zero on daylight saving cut-over:\r\n\t * > 12 when midnight changeover, but then cannot generate\r\n\t * midnight datetime, so jump to 1AM, otherwise reset.\r\n\t * @param date (Date) the date to check\r\n\t * @return (Date) the corrected date\r\n\t */\r\n\t_daylightSavingAdjust: function( date ) {\r\n\t\tif ( !date ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tdate.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 );\r\n\t\treturn date;\r\n\t},\r\n\r\n\t/* Set the date(s) directly. */\r\n\t_setDate: function( inst, date, noChange ) {\r\n\t\tvar clear = !date,\r\n\t\t\torigMonth = inst.selectedMonth,\r\n\t\t\torigYear = inst.selectedYear,\r\n\t\t\tnewDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) );\r\n\r\n\t\tinst.selectedDay = inst.currentDay = newDate.getDate();\r\n\t\tinst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();\r\n\t\tinst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();\r\n\t\tif ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) {\r\n\t\t\tthis._notifyChange( inst );\r\n\t\t}\r\n\t\tthis._adjustInstDate( inst );\r\n\t\tif ( inst.input ) {\r\n\t\t\tinst.input.val( clear ? \"\" : this._formatDate( inst ) );\r\n\t\t}\r\n\t},\r\n\r\n\t/* Retrieve the date(s) directly. */\r\n\t_getDate: function( inst ) {\r\n\t\tvar startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === \"\" ) ? null :\r\n\t\t\tthis._daylightSavingAdjust( new Date(\r\n\t\t\tinst.currentYear, inst.currentMonth, inst.currentDay ) ) );\r\n\t\t\treturn startDate;\r\n\t},\r\n\r\n\t/* Attach the onxxx handlers. These are declared statically so\r\n\t * they work with static code transformers like Caja.\r\n\t */\r\n\t_attachHandlers: function( inst ) {\r\n\t\tvar stepMonths = this._get( inst, \"stepMonths\" ),\r\n\t\t\tid = \"#\" + inst.id.replace( /\\\\\\\\/g, \"\\\\\" );\r\n\t\tinst.dpDiv.find( \"[data-handler]\" ).map( function() {\r\n\t\t\tvar handler = {\r\n\t\t\t\tprev: function() {\r\n\t\t\t\t\t$.datepicker._adjustDate( id, -stepMonths, \"M\" );\r\n\t\t\t\t},\r\n\t\t\t\tnext: function() {\r\n\t\t\t\t\t$.datepicker._adjustDate( id, +stepMonths, \"M\" );\r\n\t\t\t\t},\r\n\t\t\t\thide: function() {\r\n\t\t\t\t\t$.datepicker._hideDatepicker();\r\n\t\t\t\t},\r\n\t\t\t\ttoday: function() {\r\n\t\t\t\t\t$.datepicker._gotoToday( id );\r\n\t\t\t\t},\r\n\t\t\t\tselectDay: function() {\r\n\t\t\t\t\t$.datepicker._selectDay( id, +this.getAttribute( \"data-month\" ), +this.getAttribute( \"data-year\" ), this );\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t},\r\n\t\t\t\tselectMonth: function() {\r\n\t\t\t\t\t$.datepicker._selectMonthYear( id, this, \"M\" );\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t},\r\n\t\t\t\tselectYear: function() {\r\n\t\t\t\t\t$.datepicker._selectMonthYear( id, this, \"Y\" );\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\t$( this ).on( this.getAttribute( \"data-event\" ), handler[ this.getAttribute( \"data-handler\" ) ] );\r\n\t\t} );\r\n\t},\r\n\r\n\t/* Generate the HTML for the current state of the date picker. */\r\n\t_generateHTML: function( inst ) {\r\n\t\tvar maxDraw, prevText, prev, nextText, next, currentText, gotoDate,\r\n\t\t\tcontrols, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,\r\n\t\t\tmonthNames, monthNamesShort, beforeShowDay, showOtherMonths,\r\n\t\t\tselectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,\r\n\t\t\tcornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,\r\n\t\t\tprintDate, dRow, tbody, daySettings, otherMonth, unselectable,\r\n\t\t\ttempDate = new Date(),\r\n\t\t\ttoday = this._daylightSavingAdjust(\r\n\t\t\t\tnew Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time\r\n\t\t\tisRTL = this._get( inst, \"isRTL\" ),\r\n\t\t\tshowButtonPanel = this._get( inst, \"showButtonPanel\" ),\r\n\t\t\thideIfNoPrevNext = this._get( inst, \"hideIfNoPrevNext\" ),\r\n\t\t\tnavigationAsDateFormat = this._get( inst, \"navigationAsDateFormat\" ),\r\n\t\t\tnumMonths = this._getNumberOfMonths( inst ),\r\n\t\t\tshowCurrentAtPos = this._get( inst, \"showCurrentAtPos\" ),\r\n\t\t\tstepMonths = this._get( inst, \"stepMonths\" ),\r\n\t\t\tisMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ),\r\n\t\t\tcurrentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) :\r\n\t\t\t\tnew Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ),\r\n\t\t\tminDate = this._getMinMaxDate( inst, \"min\" ),\r\n\t\t\tmaxDate = this._getMinMaxDate( inst, \"max\" ),\r\n\t\t\tdrawMonth = inst.drawMonth - showCurrentAtPos,\r\n\t\t\tdrawYear = inst.drawYear;\r\n\r\n\t\tif ( drawMonth < 0 ) {\r\n\t\t\tdrawMonth += 12;\r\n\t\t\tdrawYear--;\r\n\t\t}\r\n\t\tif ( maxDate ) {\r\n\t\t\tmaxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(),\r\n\t\t\t\tmaxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) );\r\n\t\t\tmaxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw );\r\n\t\t\twhile ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) {\r\n\t\t\t\tdrawMonth--;\r\n\t\t\t\tif ( drawMonth < 0 ) {\r\n\t\t\t\t\tdrawMonth = 11;\r\n\t\t\t\t\tdrawYear--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tinst.drawMonth = drawMonth;\r\n\t\tinst.drawYear = drawYear;\r\n\r\n\t\tprevText = this._get( inst, \"prevText\" );\r\n\t\tprevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText,\r\n\t\t\tthis._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ),\r\n\t\t\tthis._getFormatConfig( inst ) ) );\r\n\r\n\t\tprev = ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ?\r\n\t\t\t\"\" + prevText + \"\" :\r\n\t\t\t( hideIfNoPrevNext ? \"\" : \"\" + prevText + \"\" ) );\r\n\r\n\t\tnextText = this._get( inst, \"nextText\" );\r\n\t\tnextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText,\r\n\t\t\tthis._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ),\r\n\t\t\tthis._getFormatConfig( inst ) ) );\r\n\r\n\t\tnext = ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ?\r\n\t\t\t\"\" + nextText + \"\" :\r\n\t\t\t( hideIfNoPrevNext ? \"\" : \"\" + nextText + \"\" ) );\r\n\r\n\t\tcurrentText = this._get( inst, \"currentText\" );\r\n\t\tgotoDate = ( this._get( inst, \"gotoCurrent\" ) && inst.currentDay ? currentDate : today );\r\n\t\tcurrentText = ( !navigationAsDateFormat ? currentText :\r\n\t\t\tthis.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) );\r\n\r\n\t\tcontrols = ( !inst.inline ? \"\" : \"\" );\r\n\r\n\t\tbuttonPanel = ( showButtonPanel ) ? \"
    \" + ( isRTL ? controls : \"\" ) +\r\n\t\t\t( this._isInRange( inst, gotoDate ) ? \"\" : \"\" ) + ( isRTL ? \"\" : controls ) + \"
    \" : \"\";\r\n\r\n\t\tfirstDay = parseInt( this._get( inst, \"firstDay\" ), 10 );\r\n\t\tfirstDay = ( isNaN( firstDay ) ? 0 : firstDay );\r\n\r\n\t\tshowWeek = this._get( inst, \"showWeek\" );\r\n\t\tdayNames = this._get( inst, \"dayNames\" );\r\n\t\tdayNamesMin = this._get( inst, \"dayNamesMin\" );\r\n\t\tmonthNames = this._get( inst, \"monthNames\" );\r\n\t\tmonthNamesShort = this._get( inst, \"monthNamesShort\" );\r\n\t\tbeforeShowDay = this._get( inst, \"beforeShowDay\" );\r\n\t\tshowOtherMonths = this._get( inst, \"showOtherMonths\" );\r\n\t\tselectOtherMonths = this._get( inst, \"selectOtherMonths\" );\r\n\t\tdefaultDate = this._getDefaultDate( inst );\r\n\t\thtml = \"\";\r\n\r\n\t\tfor ( row = 0; row < numMonths[ 0 ]; row++ ) {\r\n\t\t\tgroup = \"\";\r\n\t\t\tthis.maxRows = 4;\r\n\t\t\tfor ( col = 0; col < numMonths[ 1 ]; col++ ) {\r\n\t\t\t\tselectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) );\r\n\t\t\t\tcornerClass = \" ui-corner-all\";\r\n\t\t\t\tcalender = \"\";\r\n\t\t\t\tif ( isMultiMonth ) {\r\n\t\t\t\t\tcalender += \"
    \";\r\n\t\t\t\t}\r\n\t\t\t\tcalender += \"
    \" +\r\n\t\t\t\t\t( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : \"\" ) +\r\n\t\t\t\t\t( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : \"\" ) +\r\n\t\t\t\t\tthis._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate,\r\n\t\t\t\t\trow > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers\r\n\t\t\t\t\t\"
    \" +\r\n\t\t\t\t\t\"\";\r\n\t\t\t\tthead = ( showWeek ? \"\" : \"\" );\r\n\t\t\t\tfor ( dow = 0; dow < 7; dow++ ) { // days of the week\r\n\t\t\t\t\tday = ( dow + firstDay ) % 7;\r\n\t\t\t\t\tthead += \"\";\r\n\t\t\t\t}\r\n\t\t\t\tcalender += thead + \"\";\r\n\t\t\t\tdaysInMonth = this._getDaysInMonth( drawYear, drawMonth );\r\n\t\t\t\tif ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) {\r\n\t\t\t\t\tinst.selectedDay = Math.min( inst.selectedDay, daysInMonth );\r\n\t\t\t\t}\r\n\t\t\t\tleadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7;\r\n\t\t\t\tcurRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate\r\n\t\t\t\tnumRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043)\r\n\t\t\t\tthis.maxRows = numRows;\r\n\t\t\t\tprintDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) );\r\n\t\t\t\tfor ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows\r\n\t\t\t\t\tcalender += \"\";\r\n\t\t\t\t\ttbody = ( !showWeek ? \"\" : \"\" );\r\n\t\t\t\t\tfor ( dow = 0; dow < 7; dow++ ) { // create date picker days\r\n\t\t\t\t\t\tdaySettings = ( beforeShowDay ?\r\n\t\t\t\t\t\t\tbeforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, \"\" ] );\r\n\t\t\t\t\t\totherMonth = ( printDate.getMonth() !== drawMonth );\r\n\t\t\t\t\t\tunselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] ||\r\n\t\t\t\t\t\t\t( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate );\r\n\t\t\t\t\t\ttbody += \"\"; // display selectable date\r\n\t\t\t\t\t\tprintDate.setDate( printDate.getDate() + 1 );\r\n\t\t\t\t\t\tprintDate = this._daylightSavingAdjust( printDate );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcalender += tbody + \"\";\r\n\t\t\t\t}\r\n\t\t\t\tdrawMonth++;\r\n\t\t\t\tif ( drawMonth > 11 ) {\r\n\t\t\t\t\tdrawMonth = 0;\r\n\t\t\t\t\tdrawYear++;\r\n\t\t\t\t}\r\n\t\t\t\tcalender += \"
    \" + this._get( inst, \"weekHeader\" ) + \"= 5 ? \" class='ui-datepicker-week-end'\" : \"\" ) + \">\" +\r\n\t\t\t\t\t\t\"\" + dayNamesMin[ day ] + \"
    \" +\r\n\t\t\t\t\t\tthis._get( inst, \"calculateWeek\" )( printDate ) + \"\" + // actions\r\n\t\t\t\t\t\t\t( otherMonth && !showOtherMonths ? \" \" : // display for other months\r\n\t\t\t\t\t\t\t( unselectable ? \"\" + printDate.getDate() + \"\" : \"\" + printDate.getDate() + \"\" ) ) + \"
    \" + ( isMultiMonth ? \"
    \" +\r\n\t\t\t\t\t\t\t( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? \"
    \" : \"\" ) : \"\" );\r\n\t\t\t\tgroup += calender;\r\n\t\t\t}\r\n\t\t\thtml += group;\r\n\t\t}\r\n\t\thtml += buttonPanel;\r\n\t\tinst._keyEvent = false;\r\n\t\treturn html;\r\n\t},\r\n\r\n\t/* Generate the month and year header. */\r\n\t_generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate,\r\n\t\t\tsecondary, monthNames, monthNamesShort ) {\r\n\r\n\t\tvar inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,\r\n\t\t\tchangeMonth = this._get( inst, \"changeMonth\" ),\r\n\t\t\tchangeYear = this._get( inst, \"changeYear\" ),\r\n\t\t\tshowMonthAfterYear = this._get( inst, \"showMonthAfterYear\" ),\r\n\t\t\thtml = \"
    \",\r\n\t\t\tmonthHtml = \"\";\r\n\r\n\t\t// Month selection\r\n\t\tif ( secondary || !changeMonth ) {\r\n\t\t\tmonthHtml += \"\" + monthNames[ drawMonth ] + \"\";\r\n\t\t} else {\r\n\t\t\tinMinYear = ( minDate && minDate.getFullYear() === drawYear );\r\n\t\t\tinMaxYear = ( maxDate && maxDate.getFullYear() === drawYear );\r\n\t\t\tmonthHtml += \"\";\r\n\t\t}\r\n\r\n\t\tif ( !showMonthAfterYear ) {\r\n\t\t\thtml += monthHtml + ( secondary || !( changeMonth && changeYear ) ? \" \" : \"\" );\r\n\t\t}\r\n\r\n\t\t// Year selection\r\n\t\tif ( !inst.yearshtml ) {\r\n\t\t\tinst.yearshtml = \"\";\r\n\t\t\tif ( secondary || !changeYear ) {\r\n\t\t\t\thtml += \"\" + drawYear + \"\";\r\n\t\t\t} else {\r\n\r\n\t\t\t\t// determine range of years to display\r\n\t\t\t\tyears = this._get( inst, \"yearRange\" ).split( \":\" );\r\n\t\t\t\tthisYear = new Date().getFullYear();\r\n\t\t\t\tdetermineYear = function( value ) {\r\n\t\t\t\t\tvar year = ( value.match( /c[+\\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) :\r\n\t\t\t\t\t\t( value.match( /[+\\-].*/ ) ? thisYear + parseInt( value, 10 ) :\r\n\t\t\t\t\t\tparseInt( value, 10 ) ) );\r\n\t\t\t\t\treturn ( isNaN( year ) ? thisYear : year );\r\n\t\t\t\t};\r\n\t\t\t\tyear = determineYear( years[ 0 ] );\r\n\t\t\t\tendYear = Math.max( year, determineYear( years[ 1 ] || \"\" ) );\r\n\t\t\t\tyear = ( minDate ? Math.max( year, minDate.getFullYear() ) : year );\r\n\t\t\t\tendYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear );\r\n\t\t\t\tinst.yearshtml += \"\";\r\n\r\n\t\t\t\thtml += inst.yearshtml;\r\n\t\t\t\tinst.yearshtml = null;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\thtml += this._get( inst, \"yearSuffix\" );\r\n\t\tif ( showMonthAfterYear ) {\r\n\t\t\thtml += ( secondary || !( changeMonth && changeYear ) ? \" \" : \"\" ) + monthHtml;\r\n\t\t}\r\n\t\thtml += \"
    \"; // Close datepicker_header\r\n\t\treturn html;\r\n\t},\r\n\r\n\t/* Adjust one of the date sub-fields. */\r\n\t_adjustInstDate: function( inst, offset, period ) {\r\n\t\tvar year = inst.selectedYear + ( period === \"Y\" ? offset : 0 ),\r\n\t\t\tmonth = inst.selectedMonth + ( period === \"M\" ? offset : 0 ),\r\n\t\t\tday = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === \"D\" ? offset : 0 ),\r\n\t\t\tdate = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) );\r\n\r\n\t\tinst.selectedDay = date.getDate();\r\n\t\tinst.drawMonth = inst.selectedMonth = date.getMonth();\r\n\t\tinst.drawYear = inst.selectedYear = date.getFullYear();\r\n\t\tif ( period === \"M\" || period === \"Y\" ) {\r\n\t\t\tthis._notifyChange( inst );\r\n\t\t}\r\n\t},\r\n\r\n\t/* Ensure a date is within any min/max bounds. */\r\n\t_restrictMinMax: function( inst, date ) {\r\n\t\tvar minDate = this._getMinMaxDate( inst, \"min\" ),\r\n\t\t\tmaxDate = this._getMinMaxDate( inst, \"max\" ),\r\n\t\t\tnewDate = ( minDate && date < minDate ? minDate : date );\r\n\t\treturn ( maxDate && newDate > maxDate ? maxDate : newDate );\r\n\t},\r\n\r\n\t/* Notify change of month/year. */\r\n\t_notifyChange: function( inst ) {\r\n\t\tvar onChange = this._get( inst, \"onChangeMonthYear\" );\r\n\t\tif ( onChange ) {\r\n\t\t\tonChange.apply( ( inst.input ? inst.input[ 0 ] : null ),\r\n\t\t\t\t[ inst.selectedYear, inst.selectedMonth + 1, inst ] );\r\n\t\t}\r\n\t},\r\n\r\n\t/* Determine the number of months to show. */\r\n\t_getNumberOfMonths: function( inst ) {\r\n\t\tvar numMonths = this._get( inst, \"numberOfMonths\" );\r\n\t\treturn ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === \"number\" ? [ 1, numMonths ] : numMonths ) );\r\n\t},\r\n\r\n\t/* Determine the current maximum date - ensure no time components are set. */\r\n\t_getMinMaxDate: function( inst, minMax ) {\r\n\t\treturn this._determineDate( inst, this._get( inst, minMax + \"Date\" ), null );\r\n\t},\r\n\r\n\t/* Find the number of days in a given month. */\r\n\t_getDaysInMonth: function( year, month ) {\r\n\t\treturn 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate();\r\n\t},\r\n\r\n\t/* Find the day of the week of the first of a month. */\r\n\t_getFirstDayOfMonth: function( year, month ) {\r\n\t\treturn new Date( year, month, 1 ).getDay();\r\n\t},\r\n\r\n\t/* Determines if we should allow a \"next/prev\" month display change. */\r\n\t_canAdjustMonth: function( inst, offset, curYear, curMonth ) {\r\n\t\tvar numMonths = this._getNumberOfMonths( inst ),\r\n\t\t\tdate = this._daylightSavingAdjust( new Date( curYear,\r\n\t\t\tcurMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) );\r\n\r\n\t\tif ( offset < 0 ) {\r\n\t\t\tdate.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) );\r\n\t\t}\r\n\t\treturn this._isInRange( inst, date );\r\n\t},\r\n\r\n\t/* Is the given date in the accepted range? */\r\n\t_isInRange: function( inst, date ) {\r\n\t\tvar yearSplit, currentYear,\r\n\t\t\tminDate = this._getMinMaxDate( inst, \"min\" ),\r\n\t\t\tmaxDate = this._getMinMaxDate( inst, \"max\" ),\r\n\t\t\tminYear = null,\r\n\t\t\tmaxYear = null,\r\n\t\t\tyears = this._get( inst, \"yearRange\" );\r\n\t\t\tif ( years ) {\r\n\t\t\t\tyearSplit = years.split( \":\" );\r\n\t\t\t\tcurrentYear = new Date().getFullYear();\r\n\t\t\t\tminYear = parseInt( yearSplit[ 0 ], 10 );\r\n\t\t\t\tmaxYear = parseInt( yearSplit[ 1 ], 10 );\r\n\t\t\t\tif ( yearSplit[ 0 ].match( /[+\\-].*/ ) ) {\r\n\t\t\t\t\tminYear += currentYear;\r\n\t\t\t\t}\r\n\t\t\t\tif ( yearSplit[ 1 ].match( /[+\\-].*/ ) ) {\r\n\t\t\t\t\tmaxYear += currentYear;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn ( ( !minDate || date.getTime() >= minDate.getTime() ) &&\r\n\t\t\t( !maxDate || date.getTime() <= maxDate.getTime() ) &&\r\n\t\t\t( !minYear || date.getFullYear() >= minYear ) &&\r\n\t\t\t( !maxYear || date.getFullYear() <= maxYear ) );\r\n\t},\r\n\r\n\t/* Provide the configuration settings for formatting/parsing. */\r\n\t_getFormatConfig: function( inst ) {\r\n\t\tvar shortYearCutoff = this._get( inst, \"shortYearCutoff\" );\r\n\t\tshortYearCutoff = ( typeof shortYearCutoff !== \"string\" ? shortYearCutoff :\r\n\t\t\tnew Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) );\r\n\t\treturn { shortYearCutoff: shortYearCutoff,\r\n\t\t\tdayNamesShort: this._get( inst, \"dayNamesShort\" ), dayNames: this._get( inst, \"dayNames\" ),\r\n\t\t\tmonthNamesShort: this._get( inst, \"monthNamesShort\" ), monthNames: this._get( inst, \"monthNames\" ) };\r\n\t},\r\n\r\n\t/* Format the given date for display. */\r\n\t_formatDate: function( inst, day, month, year ) {\r\n\t\tif ( !day ) {\r\n\t\t\tinst.currentDay = inst.selectedDay;\r\n\t\t\tinst.currentMonth = inst.selectedMonth;\r\n\t\t\tinst.currentYear = inst.selectedYear;\r\n\t\t}\r\n\t\tvar date = ( day ? ( typeof day === \"object\" ? day :\r\n\t\t\tthis._daylightSavingAdjust( new Date( year, month, day ) ) ) :\r\n\t\t\tthis._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) );\r\n\t\treturn this.formatDate( this._get( inst, \"dateFormat\" ), date, this._getFormatConfig( inst ) );\r\n\t}\r\n} );\r\n\r\n/*\r\n * Bind hover events for datepicker elements.\r\n * Done via delegate so the binding only occurs once in the lifetime of the parent div.\r\n * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.\r\n */\r\nfunction datepicker_bindHover( dpDiv ) {\r\n\tvar selector = \"button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a\";\r\n\treturn dpDiv.on( \"mouseout\", selector, function() {\r\n\t\t\t$( this ).removeClass( \"ui-state-hover\" );\r\n\t\t\tif ( this.className.indexOf( \"ui-datepicker-prev\" ) !== -1 ) {\r\n\t\t\t\t$( this ).removeClass( \"ui-datepicker-prev-hover\" );\r\n\t\t\t}\r\n\t\t\tif ( this.className.indexOf( \"ui-datepicker-next\" ) !== -1 ) {\r\n\t\t\t\t$( this ).removeClass( \"ui-datepicker-next-hover\" );\r\n\t\t\t}\r\n\t\t} )\r\n\t\t.on( \"mouseover\", selector, datepicker_handleMouseover );\r\n}\r\n\r\nfunction datepicker_handleMouseover() {\r\n\tif ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) {\r\n\t\t$( this ).parents( \".ui-datepicker-calendar\" ).find( \"a\" ).removeClass( \"ui-state-hover\" );\r\n\t\t$( this ).addClass( \"ui-state-hover\" );\r\n\t\tif ( this.className.indexOf( \"ui-datepicker-prev\" ) !== -1 ) {\r\n\t\t\t$( this ).addClass( \"ui-datepicker-prev-hover\" );\r\n\t\t}\r\n\t\tif ( this.className.indexOf( \"ui-datepicker-next\" ) !== -1 ) {\r\n\t\t\t$( this ).addClass( \"ui-datepicker-next-hover\" );\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/* jQuery extend now ignores nulls! */\r\nfunction datepicker_extendRemove( target, props ) {\r\n\t$.extend( target, props );\r\n\tfor ( var name in props ) {\r\n\t\tif ( props[ name ] == null ) {\r\n\t\t\ttarget[ name ] = props[ name ];\r\n\t\t}\r\n\t}\r\n\treturn target;\r\n}\r\n\r\n/* Invoke the datepicker functionality.\r\n @param options string - a command, optionally followed by additional parameters or\r\n\t\t\t\t\tObject - settings for attaching new datepicker functionality\r\n @return jQuery object */\r\n$.fn.datepicker = function( options ) {\r\n\r\n\t/* Verify an empty collection wasn't passed - Fixes #6976 */\r\n\tif ( !this.length ) {\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/* Initialise the date picker. */\r\n\tif ( !$.datepicker.initialized ) {\r\n\t\t$( document ).on( \"mousedown\", $.datepicker._checkExternalClick );\r\n\t\t$.datepicker.initialized = true;\r\n\t}\r\n\r\n\t/* Append datepicker main container to body if not exist. */\r\n\tif ( $( \"#\" + $.datepicker._mainDivId ).length === 0 ) {\r\n\t\t$( \"body\" ).append( $.datepicker.dpDiv );\r\n\t}\r\n\r\n\tvar otherArgs = Array.prototype.slice.call( arguments, 1 );\r\n\tif ( typeof options === \"string\" && ( options === \"isDisabled\" || options === \"getDate\" || options === \"widget\" ) ) {\r\n\t\treturn $.datepicker[ \"_\" + options + \"Datepicker\" ].\r\n\t\t\tapply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );\r\n\t}\r\n\tif ( options === \"option\" && arguments.length === 2 && typeof arguments[ 1 ] === \"string\" ) {\r\n\t\treturn $.datepicker[ \"_\" + options + \"Datepicker\" ].\r\n\t\t\tapply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );\r\n\t}\r\n\treturn this.each( function() {\r\n\t\ttypeof options === \"string\" ?\r\n\t\t\t$.datepicker[ \"_\" + options + \"Datepicker\" ].\r\n\t\t\t\tapply( $.datepicker, [ this ].concat( otherArgs ) ) :\r\n\t\t\t$.datepicker._attachDatepicker( this, options );\r\n\t} );\r\n};\r\n\r\n$.datepicker = new Datepicker(); // singleton instance\r\n$.datepicker.initialized = false;\r\n$.datepicker.uuid = new Date().getTime();\r\n$.datepicker.version = \"1.12.1\";\r\n\r\nvar widgetsDatepicker = $.datepicker;\r\n\r\n\r\n\r\n\r\n}));","/*!\r\n * jQuery Form Plugin\r\n * version: 4.2.2\r\n * Requires jQuery v1.7.2 or later\r\n * Project repository: https://github.com/jquery-form/form\r\n\r\n * Copyright 2017 Kevin Morris\r\n * Copyright 2006 M. Alsup\r\n\r\n * Dual licensed under the LGPL-2.1+ or MIT licenses\r\n * https://github.com/jquery-form/form#license\r\n\r\n * This library is free software; you can redistribute it and/or\r\n * modify it under the terms of the GNU Lesser General Public\r\n * License as published by the Free Software Foundation; either\r\n * version 2.1 of the License, or (at your option) any later version.\r\n * This library is distributed in the hope that it will be useful,\r\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r\n * Lesser General Public License for more details.\r\n */\r\n/* global ActiveXObject */\r\n\r\n/* eslint-disable */\r\n(function (factory) {\r\n\tif (typeof define === 'function' && define.amd) {\r\n\t\t// AMD. Register as an anonymous module.\r\n\t\tdefine(['jquery'], factory);\r\n\t} else if (typeof module === 'object' && module.exports) {\r\n\t\t// Node/CommonJS\r\n\t\tmodule.exports = function( root, jQuery ) {\r\n\t\t\tif (typeof jQuery === 'undefined') {\r\n\t\t\t\t// require('jQuery') returns a factory that requires window to build a jQuery instance, we normalize how we use modules\r\n\t\t\t\t// that require this pattern but the window provided is a noop if it's defined (how jquery works)\r\n\t\t\t\tif (typeof window !== 'undefined') {\r\n\t\t\t\t\tjQuery = require('jquery');\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tjQuery = require('jquery')(root);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfactory(jQuery);\r\n\t\t\treturn jQuery;\r\n\t\t};\r\n\t} else {\r\n\t\t// Browser globals\r\n\t\tfactory(jQuery);\r\n\t}\r\n\r\n}(function ($) {\r\n/* eslint-enable */\r\n\t'use strict';\r\n\r\n\t/*\r\n\t\tUsage Note:\r\n\t\t-----------\r\n\t\tDo not use both ajaxSubmit and ajaxForm on the same form. These\r\n\t\tfunctions are mutually exclusive. Use ajaxSubmit if you want\r\n\t\tto bind your own submit handler to the form. For example,\r\n\r\n\t\t$(document).ready(function() {\r\n\t\t\t$('#myForm').on('submit', function(e) {\r\n\t\t\t\te.preventDefault(); // <-- important\r\n\t\t\t\t$(this).ajaxSubmit({\r\n\t\t\t\t\ttarget: '#output'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tUse ajaxForm when you want the plugin to manage all the event binding\r\n\t\tfor you. For example,\r\n\r\n\t\t$(document).ready(function() {\r\n\t\t\t$('#myForm').ajaxForm({\r\n\t\t\t\ttarget: '#output'\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tYou can also use ajaxForm with delegation (requires jQuery v1.7+), so the\r\n\t\tform does not have to exist when you invoke ajaxForm:\r\n\r\n\t\t$('#myForm').ajaxForm({\r\n\t\t\tdelegation: true,\r\n\t\t\ttarget: '#output'\r\n\t\t});\r\n\r\n\t\tWhen using ajaxForm, the ajaxSubmit function will be invoked for you\r\n\t\tat the appropriate time.\r\n\t*/\r\n\r\n\tvar rCRLF = /\\r?\\n/g;\r\n\r\n\t/**\r\n\t * Feature detection\r\n\t */\r\n\tvar feature = {};\r\n\r\n\tfeature.fileapi = $('').get(0).files !== undefined;\r\n\tfeature.formdata = (typeof window.FormData !== 'undefined');\r\n\r\n\tvar hasProp = !!$.fn.prop;\r\n\r\n\t// attr2 uses prop when it can but checks the return type for\r\n\t// an expected string. This accounts for the case where a form\r\n\t// contains inputs with names like \"action\" or \"method\"; in those\r\n\t// cases \"prop\" returns the element\r\n\t$.fn.attr2 = function() {\r\n\t\tif (!hasProp) {\r\n\t\t\treturn this.attr.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar val = this.prop.apply(this, arguments);\r\n\r\n\t\tif ((val && val.jquery) || typeof val === 'string') {\r\n\t\t\treturn val;\r\n\t\t}\r\n\r\n\t\treturn this.attr.apply(this, arguments);\r\n\t};\r\n\r\n\t/**\r\n\t * ajaxSubmit() provides a mechanism for immediately submitting\r\n\t * an HTML form using AJAX.\r\n\t *\r\n\t * @param\t{object|string}\toptions\t\tjquery.form.js parameters or custom url for submission\r\n\t * @param\t{object}\t\tdata\t\textraData\r\n\t * @param\t{string}\t\tdataType\tajax dataType\r\n\t * @param\t{function}\t\tonSuccess\tajax success callback function\r\n\t */\r\n\t$.fn.ajaxSubmit = function(options, data, dataType, onSuccess) {\r\n\t\t// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)\r\n\t\tif (!this.length) {\r\n\t\t\tlog('ajaxSubmit: skipping submit process - no element selected');\r\n\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\t/* eslint consistent-this: [\"error\", \"$form\"] */\r\n\t\tvar method, action, url, $form = this;\r\n\r\n\t\tif (typeof options === 'function') {\r\n\t\t\toptions = {success: options};\r\n\r\n\t\t} else if (typeof options === 'string' || (options === false && arguments.length > 0)) {\r\n\t\t\toptions = {\r\n\t\t\t\t'url' : options,\r\n\t\t\t\t'data' : data,\r\n\t\t\t\t'dataType' : dataType\r\n\t\t\t};\r\n\r\n\t\t\tif (typeof onSuccess === 'function') {\r\n\t\t\t\toptions.success = onSuccess;\r\n\t\t\t}\r\n\r\n\t\t} else if (typeof options === 'undefined') {\r\n\t\t\toptions = {};\r\n\t\t}\r\n\r\n\t\tmethod = options.method || options.type || this.attr2('method');\r\n\t\taction = options.url || this.attr2('action');\r\n\r\n\t\turl = (typeof action === 'string') ? $.trim(action) : '';\r\n\t\turl = url || window.location.href || '';\r\n\t\tif (url) {\r\n\t\t\t// clean url (don't include hash vaue)\r\n\t\t\turl = (url.match(/^([^#]+)/) || [])[1];\r\n\t\t}\r\n\r\n\t\toptions = $.extend(true, {\r\n\t\t\turl : url,\r\n\t\t\tsuccess : $.ajaxSettings.success,\r\n\t\t\ttype : method || $.ajaxSettings.type,\r\n\t\t\tiframeSrc : /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'\t\t// eslint-disable-line no-script-url\r\n\t\t}, options);\r\n\r\n\t\t// hook for manipulating the form data before it is extracted;\r\n\t\t// convenient for use with rich editors like tinyMCE or FCKEditor\r\n\t\tvar veto = {};\r\n\r\n\t\tthis.trigger('form-pre-serialize', [this, options, veto]);\r\n\r\n\t\tif (veto.veto) {\r\n\t\t\tlog('ajaxSubmit: submit vetoed via form-pre-serialize trigger');\r\n\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\t// provide opportunity to alter form data before it is serialized\r\n\t\tif (options.beforeSerialize && options.beforeSerialize(this, options) === false) {\r\n\t\t\tlog('ajaxSubmit: submit aborted via beforeSerialize callback');\r\n\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar traditional = options.traditional;\r\n\r\n\t\tif (typeof traditional === 'undefined') {\r\n\t\t\ttraditional = $.ajaxSettings.traditional;\r\n\t\t}\r\n\r\n\t\tvar elements = [];\r\n\t\tvar qx, a = this.formToArray(options.semantic, elements, options.filtering);\r\n\r\n\t\tif (options.data) {\r\n\t\t\tvar optionsData = $.isFunction(options.data) ? options.data(a) : options.data;\r\n\r\n\t\t\toptions.extraData = optionsData;\r\n\t\t\tqx = $.param(optionsData, traditional);\r\n\t\t}\r\n\r\n\t\t// give pre-submit callback an opportunity to abort the submit\r\n\t\tif (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {\r\n\t\t\tlog('ajaxSubmit: submit aborted via beforeSubmit callback');\r\n\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\t// fire vetoable 'validate' event\r\n\t\tthis.trigger('form-submit-validate', [a, this, options, veto]);\r\n\t\tif (veto.veto) {\r\n\t\t\tlog('ajaxSubmit: submit vetoed via form-submit-validate trigger');\r\n\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar q = $.param(a, traditional);\r\n\r\n\t\tif (qx) {\r\n\t\t\tq = (q ? (q + '&' + qx) : qx);\r\n\t\t}\r\n\r\n\t\tif (options.type.toUpperCase() === 'GET') {\r\n\t\t\toptions.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;\r\n\t\t\toptions.data = null;\t// data is null for 'get'\r\n\t\t} else {\r\n\t\t\toptions.data = q;\t\t// data is the query string for 'post'\r\n\t\t}\r\n\r\n\t\tvar callbacks = [];\r\n\r\n\t\tif (options.resetForm) {\r\n\t\t\tcallbacks.push(function() {\r\n\t\t\t\t$form.resetForm();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (options.clearForm) {\r\n\t\t\tcallbacks.push(function() {\r\n\t\t\t\t$form.clearForm(options.includeHidden);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// perform a load on the target only if dataType is not provided\r\n\t\tif (!options.dataType && options.target) {\r\n\t\t\tvar oldSuccess = options.success || function(){};\r\n\r\n\t\t\tcallbacks.push(function(data, textStatus, jqXHR) {\r\n\t\t\t\tvar successArguments = arguments,\r\n\t\t\t\t\tfn = options.replaceTarget ? 'replaceWith' : 'html';\r\n\r\n\t\t\t\t$(options.target)[fn](data).each(function(){\r\n\t\t\t\t\toldSuccess.apply(this, successArguments);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t} else if (options.success) {\r\n\t\t\tif ($.isArray(options.success)) {\r\n\t\t\t\t$.merge(callbacks, options.success);\r\n\t\t\t} else {\r\n\t\t\t\tcallbacks.push(options.success);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\toptions.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg\r\n\t\t\tvar context = options.context || this;\t\t// jQuery 1.4+ supports scope context\r\n\r\n\t\t\tfor (var i = 0, max = callbacks.length; i < max; i++) {\r\n\t\t\t\tcallbacks[i].apply(context, [data, status, xhr || $form, $form]);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif (options.error) {\r\n\t\t\tvar oldError = options.error;\r\n\r\n\t\t\toptions.error = function(xhr, status, error) {\r\n\t\t\t\tvar context = options.context || this;\r\n\r\n\t\t\t\toldError.apply(context, [xhr, status, error, $form]);\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif (options.complete) {\r\n\t\t\tvar oldComplete = options.complete;\r\n\r\n\t\t\toptions.complete = function(xhr, status) {\r\n\t\t\t\tvar context = options.context || this;\r\n\r\n\t\t\t\toldComplete.apply(context, [xhr, status, $form]);\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\t// are there files to upload?\r\n\r\n\t\t// [value] (issue #113), also see comment:\r\n\t\t// https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219\r\n\t\tvar fileInputs = $('input[type=file]:enabled', this).filter(function() {\r\n\t\t\treturn $(this).val() !== '';\r\n\t\t});\r\n\t\tvar hasFileInputs = fileInputs.length > 0;\r\n\t\tvar mp = 'multipart/form-data';\r\n\t\tvar multipart = ($form.attr('enctype') === mp || $form.attr('encoding') === mp);\r\n\t\tvar fileAPI = feature.fileapi && feature.formdata;\r\n\r\n\t\tlog('fileAPI :' + fileAPI);\r\n\r\n\t\tvar shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;\r\n\t\tvar jqxhr;\r\n\r\n\t\t// options.iframe allows user to force iframe mode\r\n\t\t// 06-NOV-09: now defaulting to iframe mode if file input is detected\r\n\t\tif (options.iframe !== false && (options.iframe || shouldUseFrame)) {\r\n\t\t\t// hack to fix Safari hang (thanks to Tim Molendijk for this)\r\n\t\t\t// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d\r\n\t\t\tif (options.closeKeepAlive) {\r\n\t\t\t\t$.get(options.closeKeepAlive, function() {\r\n\t\t\t\t\tjqxhr = fileUploadIframe(a);\r\n\t\t\t\t});\r\n\r\n\t\t\t} else {\r\n\t\t\t\tjqxhr = fileUploadIframe(a);\r\n\t\t\t}\r\n\r\n\t\t} else if ((hasFileInputs || multipart) && fileAPI) {\r\n\t\t\tjqxhr = fileUploadXhr(a);\r\n\r\n\t\t} else {\r\n\t\t\tjqxhr = $.ajax(options);\r\n\t\t}\r\n\r\n\t\t$form.removeData('jqxhr').data('jqxhr', jqxhr);\r\n\r\n\t\t// clear element array\r\n\t\tfor (var k = 0; k < elements.length; k++) {\r\n\t\t\telements[k] = null;\r\n\t\t}\r\n\r\n\t\t// fire 'notify' event\r\n\t\tthis.trigger('form-submit-notify', [this, options]);\r\n\r\n\t\treturn this;\r\n\r\n\t\t// utility fn for deep serialization\r\n\t\tfunction deepSerialize(extraData) {\r\n\t\t\tvar serialized = $.param(extraData, options.traditional).split('&');\r\n\t\t\tvar len = serialized.length;\r\n\t\t\tvar result = [];\r\n\t\t\tvar i, part;\r\n\r\n\t\t\tfor (i = 0; i < len; i++) {\r\n\t\t\t\t// #252; undo param space replacement\r\n\t\t\t\tserialized[i] = serialized[i].replace(/\\+/g, ' ');\r\n\t\t\t\tpart = serialized[i].split('=');\r\n\t\t\t\t// #278; use array instead of object storage, favoring array serializations\r\n\t\t\t\tresult.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\t// XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)\r\n\t\tfunction fileUploadXhr(a) {\r\n\t\t\tvar formdata = new FormData();\r\n\r\n\t\t\tfor (var i = 0; i < a.length; i++) {\r\n\t\t\t\tformdata.append(a[i].name, a[i].value);\r\n\t\t\t}\r\n\r\n\t\t\tif (options.extraData) {\r\n\t\t\t\tvar serializedData = deepSerialize(options.extraData);\r\n\r\n\t\t\t\tfor (i = 0; i < serializedData.length; i++) {\r\n\t\t\t\t\tif (serializedData[i]) {\r\n\t\t\t\t\t\tformdata.append(serializedData[i][0], serializedData[i][1]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\toptions.data = null;\r\n\r\n\t\t\tvar s = $.extend(true, {}, $.ajaxSettings, options, {\r\n\t\t\t\tcontentType : false,\r\n\t\t\t\tprocessData : false,\r\n\t\t\t\tcache : false,\r\n\t\t\t\ttype : method || 'POST'\r\n\t\t\t});\r\n\r\n\t\t\tif (options.uploadProgress) {\r\n\t\t\t\t// workaround because jqXHR does not expose upload property\r\n\t\t\t\ts.xhr = function() {\r\n\t\t\t\t\tvar xhr = $.ajaxSettings.xhr();\r\n\r\n\t\t\t\t\tif (xhr.upload) {\r\n\t\t\t\t\t\txhr.upload.addEventListener('progress', function(event) {\r\n\t\t\t\t\t\t\tvar percent = 0;\r\n\t\t\t\t\t\t\tvar position = event.loaded || event.position;\t\t\t/* event.position is deprecated */\r\n\t\t\t\t\t\t\tvar total = event.total;\r\n\r\n\t\t\t\t\t\t\tif (event.lengthComputable) {\r\n\t\t\t\t\t\t\t\tpercent = Math.ceil(position / total * 100);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\toptions.uploadProgress(event, position, total, percent);\r\n\t\t\t\t\t\t}, false);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn xhr;\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\ts.data = null;\r\n\r\n\t\t\tvar beforeSend = s.beforeSend;\r\n\r\n\t\t\ts.beforeSend = function(xhr, o) {\r\n\t\t\t\t// Send FormData() provided by user\r\n\t\t\t\tif (options.formData) {\r\n\t\t\t\t\to.data = options.formData;\r\n\t\t\t\t} else {\r\n\t\t\t\t\to.data = formdata;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (beforeSend) {\r\n\t\t\t\t\tbeforeSend.call(this, xhr, o);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\treturn $.ajax(s);\r\n\t\t}\r\n\r\n\t\t// private function for handling file uploads (hat tip to YAHOO!)\r\n\t\tfunction fileUploadIframe(a) {\r\n\t\t\tvar form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;\r\n\t\t\tvar deferred = $.Deferred();\r\n\r\n\t\t\t// #341\r\n\t\t\tdeferred.abort = function(status) {\r\n\t\t\t\txhr.abort(status);\r\n\t\t\t};\r\n\r\n\t\t\tif (a) {\r\n\t\t\t\t// ensure that every serialized input is still enabled\r\n\t\t\t\tfor (i = 0; i < elements.length; i++) {\r\n\t\t\t\t\tel = $(elements[i]);\r\n\t\t\t\t\tif (hasProp) {\r\n\t\t\t\t\t\tel.prop('disabled', false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tel.removeAttr('disabled');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\ts = $.extend(true, {}, $.ajaxSettings, options);\r\n\t\t\ts.context = s.context || s;\r\n\t\t\tid = 'jqFormIO' + new Date().getTime();\r\n\t\t\tvar ownerDocument = form.ownerDocument;\r\n\t\t\tvar $body = $form.closest('body');\r\n\r\n\t\t\tif (s.iframeTarget) {\r\n\t\t\t\t$io = $(s.iframeTarget, ownerDocument);\r\n\t\t\t\tn = $io.attr2('name');\r\n\t\t\t\tif (!n) {\r\n\t\t\t\t\t$io.attr2('name', id);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tid = n;\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$io = $('