{"version":3,"file":"vendors-22d858f7.9729664bca28a8e6916d.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAeA","sources":["webpack://www.zeusteam.com/./node_modules/ag-charts-community/dist/package/main.esm.mjs"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __reflectGet = Reflect.get;\nvar __knownSymbol = (name, symbol) => {\n return (symbol = Symbol[name]) ? symbol : Symbol.for(\"Symbol.\" + name);\n};\nvar __pow = Math.pow;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __decorateClass = (decorators, target, key, kind) => {\n var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;\n for (var i = decorators.length - 1, decorator; i >= 0; i--)\n if (decorator = decorators[i])\n result = (kind ? decorator(target, key, result) : decorator(result)) || result;\n if (kind && result)\n __defProp(target, key, result);\n return result;\n};\nvar __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);\nvar __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n};\nvar __await = function(promise, isYieldStar) {\n this[0] = promise;\n this[1] = isYieldStar;\n};\nvar __yieldStar = (value) => {\n var obj = value[__knownSymbol(\"asyncIterator\")];\n var isAwait = false;\n var method;\n var it = {};\n if (obj == null) {\n obj = value[__knownSymbol(\"iterator\")]();\n method = (k) => it[k] = (x) => obj[k](x);\n } else {\n obj = obj.call(value);\n method = (k) => it[k] = (v) => {\n if (isAwait) {\n isAwait = false;\n if (k === \"throw\")\n throw v;\n return v;\n }\n isAwait = true;\n return {\n done: false,\n value: new __await(new Promise((resolve) => {\n var x = obj[k](v);\n if (!(x instanceof Object))\n throw TypeError(\"Object expected\");\n resolve(x);\n }), 1)\n };\n };\n }\n return it[__knownSymbol(\"iterator\")] = () => it, method(\"next\"), \"throw\" in obj ? method(\"throw\") : it.throw = (x) => {\n throw x;\n }, \"return\" in obj && method(\"return\"), it;\n};\n\n// packages/ag-charts-community/src/options/chart/errorBarOptions.ts\nvar AgErrorBarSupportedSeriesTypes = [\"bar\", \"line\", \"scatter\"];\n\n// packages/ag-charts-community/src/options/chart/navigatorOptions.ts\nvar __MINI_CHART_SERIES_OPTIONS = {};\nvar __VERIFY_MINI_CHART_SERIES_OPTIONS = void 0;\n__VERIFY_MINI_CHART_SERIES_OPTIONS = __MINI_CHART_SERIES_OPTIONS;\n\n// packages/ag-charts-community/src/options/chart/tooltipOptions.ts\nvar AgTooltipPositionType = /* @__PURE__ */ ((AgTooltipPositionType2) => {\n AgTooltipPositionType2[\"POINTER\"] = \"pointer\";\n AgTooltipPositionType2[\"NODE\"] = \"node\";\n AgTooltipPositionType2[\"TOP\"] = \"top\";\n AgTooltipPositionType2[\"RIGHT\"] = \"right\";\n AgTooltipPositionType2[\"BOTTOM\"] = \"bottom\";\n AgTooltipPositionType2[\"LEFT\"] = \"left\";\n AgTooltipPositionType2[\"TOP_LEFT\"] = \"top-left\";\n AgTooltipPositionType2[\"TOP_RIGHT\"] = \"top-right\";\n AgTooltipPositionType2[\"BOTTOM_RIGHT\"] = \"bottom-right\";\n AgTooltipPositionType2[\"BOTTOM_LEFT\"] = \"bottom-left\";\n return AgTooltipPositionType2;\n})(AgTooltipPositionType || {});\n\n// packages/ag-charts-community/src/options/chart/themeOptions.ts\nvar __THEME_OVERRIDES = {};\nvar __VERIFY_THEME_OVERRIDES = void 0;\n__VERIFY_THEME_OVERRIDES = __THEME_OVERRIDES;\n\n// packages/ag-charts-community/src/options/agChartOptions.ts\nvar __FORCE_MODULE_DETECTION = 0;\n\n// packages/ag-charts-community/src/util/time/index.ts\nvar time_exports = {};\n__export(time_exports, {\n day: () => day,\n friday: () => friday,\n hour: () => hour,\n millisecond: () => millisecond,\n minute: () => minute,\n monday: () => monday,\n month: () => month,\n saturday: () => saturday,\n second: () => second,\n sunday: () => sunday,\n thursday: () => thursday,\n tuesday: () => tuesday,\n utcDay: () => utcDay,\n utcHour: () => utcHour,\n utcMinute: () => utcMinute,\n utcMonth: () => utcMonth,\n utcYear: () => utcYear,\n wednesday: () => wednesday,\n year: () => year\n});\n\n// packages/ag-charts-community/src/util/function.ts\nvar doOnceState = /* @__PURE__ */ new Map();\nfunction doOnce(func, key) {\n if (doOnceState.has(key))\n return;\n doOnceState.set(key, true);\n func();\n}\ndoOnce.clear = () => doOnceState.clear();\nfunction identity(x) {\n return x;\n}\nfunction* iterate(...iterators) {\n for (const iterator of iterators) {\n yield* __yieldStar(iterator);\n }\n}\nfunction* iterateReverseArray(array) {\n for (let j = array.length - 1; j >= 0; j--) {\n yield array[j];\n }\n}\nfunction throttle(callback, waitMs = 0, options) {\n const { leading = true, trailing = true } = options != null ? options : {};\n let timerId;\n let lastArgs;\n let shouldWait = false;\n function timeoutHandler() {\n if (trailing && lastArgs) {\n timerId = setTimeout(timeoutHandler, waitMs);\n callback(...lastArgs);\n } else {\n shouldWait = false;\n }\n lastArgs = null;\n }\n function throttleCallback(...args) {\n if (shouldWait) {\n lastArgs = args;\n } else {\n shouldWait = true;\n timerId = setTimeout(timeoutHandler, waitMs);\n if (leading) {\n callback(...args);\n } else {\n lastArgs = args;\n }\n }\n }\n return Object.assign(throttleCallback, {\n cancel() {\n clearTimeout(timerId);\n shouldWait = false;\n lastArgs = null;\n }\n });\n}\nfunction joinFunctions(...fns) {\n return () => {\n for (const fn of fns) {\n fn();\n }\n };\n}\n\n// packages/ag-charts-community/src/util/logger.ts\nvar Logger = {\n log(...logContent) {\n console.log(...logContent);\n },\n warn(message, ...logContent) {\n console.warn(`AG Charts - ${message}`, ...logContent);\n },\n error(message, ...logContent) {\n if (typeof message === \"object\") {\n console.error(`AG Charts error`, message, ...logContent);\n } else {\n console.error(`AG Charts - ${message}`, ...logContent);\n }\n },\n table(...logContent) {\n console.table(...logContent);\n },\n warnOnce(message, ...logContent) {\n doOnce(() => Logger.warn(message, ...logContent), `Logger.warn: ${message}`);\n },\n errorOnce(message, ...logContent) {\n doOnce(() => Logger.error(message, ...logContent), `Logger.error: ${message}`);\n }\n};\n\n// packages/ag-charts-community/src/util/time/interval.ts\nvar TimeInterval = class {\n constructor(_encode, _decode, _rangeCallback) {\n this._encode = _encode;\n this._decode = _decode;\n this._rangeCallback = _rangeCallback;\n }\n /**\n * Returns a new date representing the latest interval boundary date before or equal to date.\n * For example, `day.floor(date)` typically returns 12:00 AM local time on the given date.\n * @param date\n */\n floor(date) {\n const d = new Date(date);\n const e = this._encode(d);\n return this._decode(e);\n }\n /**\n * Returns a new date representing the earliest interval boundary date after or equal to date.\n * @param date\n */\n ceil(date) {\n const d = new Date(Number(date) - 1);\n const e = this._encode(d);\n return this._decode(e + 1);\n }\n /**\n * Returns an array of dates representing every interval boundary after or equal to start (inclusive) and before stop (exclusive).\n * @param start Range start.\n * @param stop Range end.\n * @param extend If specified, the requested range will be extended to the closest \"nice\" values.\n */\n range(start, stop, extend) {\n var _a;\n const rangeCallback = (_a = this._rangeCallback) == null ? void 0 : _a.call(this, start, stop);\n const e0 = this._encode(extend ? this.floor(start) : this.ceil(start));\n const e1 = this._encode(extend ? this.ceil(stop) : this.floor(stop));\n if (e1 < e0) {\n return [];\n }\n const range3 = [];\n for (let e = e0; e <= e1; e++) {\n const d = this._decode(e);\n range3.push(d);\n }\n rangeCallback == null ? void 0 : rangeCallback();\n return range3;\n }\n};\nvar CountableTimeInterval = class extends TimeInterval {\n getOffset(snapTo, step) {\n const s = typeof snapTo === \"number\" || snapTo instanceof Date ? this._encode(new Date(snapTo)) : 0;\n return Math.floor(s) % step;\n }\n /**\n * Returns a filtered view of this interval representing every step'th date.\n * It can be a number of minutes, hours, days etc.\n * Must be a positive integer.\n * @param step\n */\n every(step, options) {\n let offset4 = 0;\n let rangeCallback;\n const unsafeStep = step;\n step = Math.max(1, Math.round(step));\n if (unsafeStep !== step) {\n Logger.warnOnce(`interval step of [${unsafeStep}] rounded to [${step}].`);\n }\n const { snapTo = \"start\" } = options != null ? options : {};\n if (typeof snapTo === \"string\") {\n const initialOffset = offset4;\n rangeCallback = (start, stop) => {\n const s = snapTo === \"start\" ? start : stop;\n offset4 = this.getOffset(s, step);\n return () => offset4 = initialOffset;\n };\n } else if (typeof snapTo === \"number\") {\n offset4 = this.getOffset(new Date(snapTo), step);\n } else if (snapTo instanceof Date) {\n offset4 = this.getOffset(snapTo, step);\n }\n const encode13 = (date) => {\n const e = this._encode(date);\n return Math.floor((e - offset4) / step);\n };\n const decode13 = (encoded) => {\n return this._decode(encoded * step + offset4);\n };\n return new TimeInterval(encode13, decode13, rangeCallback);\n }\n};\n\n// packages/ag-charts-community/src/util/time/millisecond.ts\nfunction encode(date) {\n return date.getTime();\n}\nfunction decode(encoded) {\n return new Date(encoded);\n}\nvar millisecond = new CountableTimeInterval(encode, decode);\nvar millisecond_default = millisecond;\n\n// packages/ag-charts-community/src/util/time/duration.ts\nvar epochYear = (/* @__PURE__ */ new Date(0)).getFullYear();\nvar durationSecond = 1e3;\nvar durationMinute = durationSecond * 60;\nvar durationHour = durationMinute * 60;\nvar durationDay = durationHour * 24;\nvar durationWeek = durationDay * 7;\nvar durationMonth = durationDay * 30;\nvar durationYear = durationDay * 365;\n\n// packages/ag-charts-community/src/util/time/second.ts\nvar offset = (/* @__PURE__ */ new Date()).getTimezoneOffset() * durationMinute;\nfunction encode2(date) {\n return Math.floor((date.getTime() - offset) / durationSecond);\n}\nfunction decode2(encoded) {\n return new Date(offset + encoded * durationSecond);\n}\nvar second = new CountableTimeInterval(encode2, decode2);\nvar second_default = second;\n\n// packages/ag-charts-community/src/util/time/minute.ts\nvar offset2 = (/* @__PURE__ */ new Date()).getTimezoneOffset() * durationMinute;\nfunction encode3(date) {\n return Math.floor((date.getTime() - offset2) / durationMinute);\n}\nfunction decode3(encoded) {\n return new Date(offset2 + encoded * durationMinute);\n}\nvar minute = new CountableTimeInterval(encode3, decode3);\nvar minute_default = minute;\n\n// packages/ag-charts-community/src/util/time/hour.ts\nvar offset3 = (/* @__PURE__ */ new Date()).getTimezoneOffset() * durationMinute;\nfunction encode4(date) {\n return Math.floor((date.getTime() - offset3) / durationHour);\n}\nfunction decode4(encoded) {\n return new Date(offset3 + encoded * durationHour);\n}\nvar hour = new CountableTimeInterval(encode4, decode4);\nvar hour_default = hour;\n\n// packages/ag-charts-community/src/util/time/day.ts\nfunction encode5(date) {\n const tzOffsetMs = date.getTimezoneOffset() * durationMinute;\n return Math.floor((date.getTime() - tzOffsetMs) / durationDay);\n}\nfunction decode5(encoded) {\n const d = new Date(1970, 0, 1);\n d.setDate(d.getDate() + encoded);\n return d;\n}\nvar day = new CountableTimeInterval(encode5, decode5);\nvar day_default = day;\n\n// packages/ag-charts-community/src/util/time/week.ts\nfunction weekday(weekStart) {\n const thursday2 = 4;\n const dayShift = (7 + weekStart - thursday2) % 7;\n function encode13(date) {\n const tzOffsetMs = date.getTimezoneOffset() * durationMinute;\n return Math.floor((date.getTime() - tzOffsetMs) / durationWeek - dayShift / 7);\n }\n function decode13(encoded) {\n const d = new Date(1970, 0, 1);\n d.setDate(d.getDate() + encoded * 7 + dayShift);\n return d;\n }\n return new CountableTimeInterval(encode13, decode13);\n}\nvar sunday = weekday(0);\nvar monday = weekday(1);\nvar tuesday = weekday(2);\nvar wednesday = weekday(3);\nvar thursday = weekday(4);\nvar friday = weekday(5);\nvar saturday = weekday(6);\nvar week_default = sunday;\n\n// packages/ag-charts-community/src/util/time/month.ts\nfunction encode6(date) {\n return date.getFullYear() * 12 + date.getMonth();\n}\nfunction decode6(encoded) {\n const year2 = Math.floor(encoded / 12);\n const month2 = encoded - year2 * 12;\n return new Date(year2, month2, 1);\n}\nvar month = new CountableTimeInterval(encode6, decode6);\nvar month_default = month;\n\n// packages/ag-charts-community/src/util/time/year.ts\nfunction encode7(date) {\n return date.getFullYear();\n}\nfunction decode7(encoded) {\n const d = /* @__PURE__ */ new Date();\n d.setFullYear(encoded);\n d.setMonth(0, 1);\n d.setHours(0, 0, 0, 0);\n return d;\n}\nvar year = new CountableTimeInterval(encode7, decode7);\nvar year_default = year;\n\n// packages/ag-charts-community/src/util/time/utcMinute.ts\nfunction encode8(date) {\n return Math.floor(date.getTime() / durationMinute);\n}\nfunction decode8(encoded) {\n return new Date(encoded * durationMinute);\n}\nvar utcMinute = new CountableTimeInterval(encode8, decode8);\n\n// packages/ag-charts-community/src/util/time/utcHour.ts\nfunction encode9(date) {\n return Math.floor(date.getTime() / durationHour);\n}\nfunction decode9(encoded) {\n return new Date(encoded * durationHour);\n}\nvar utcHour = new CountableTimeInterval(encode9, decode9);\n\n// packages/ag-charts-community/src/util/time/utcDay.ts\nfunction encode10(date) {\n return Math.floor(date.getTime() / durationDay);\n}\nfunction decode10(encoded) {\n const d = /* @__PURE__ */ new Date(0);\n d.setUTCDate(d.getUTCDate() + encoded);\n d.setUTCHours(0, 0, 0, 0);\n return d;\n}\nvar utcDay = new CountableTimeInterval(encode10, decode10);\n\n// packages/ag-charts-community/src/util/time/utcMonth.ts\nfunction encode11(date) {\n return date.getUTCFullYear() * 12 + date.getUTCMonth();\n}\nfunction decode11(encoded) {\n const year2 = Math.floor(encoded / 12);\n const month2 = encoded - year2 * 12;\n return new Date(Date.UTC(year2, month2, 1));\n}\nvar utcMonth = new CountableTimeInterval(encode11, decode11);\n\n// packages/ag-charts-community/src/util/time/utcYear.ts\nfunction encode12(date) {\n return date.getUTCFullYear();\n}\nfunction decode12(encoded) {\n const d = /* @__PURE__ */ new Date();\n d.setUTCFullYear(encoded);\n d.setUTCMonth(0, 1);\n d.setUTCHours(0, 0, 0, 0);\n return d;\n}\nvar utcYear = new CountableTimeInterval(encode12, decode12);\n\n// packages/ag-charts-community/src/module/enterpriseModule.ts\nvar enterpriseModule = {\n isEnterprise: false\n};\n\n// packages/ag-charts-community/src/module/module.ts\nvar BaseModuleInstance = class {\n constructor() {\n this.destroyFns = [];\n }\n destroy() {\n for (const destroyFn of this.destroyFns) {\n destroyFn();\n }\n }\n};\nvar ModuleRegistry = class {\n constructor() {\n this.modules = [];\n this.dependencies = /* @__PURE__ */ new Set();\n this.dependents = /* @__PURE__ */ new Set();\n }\n register(...modules) {\n for (const module of modules) {\n this.registerDependencies(module);\n const otherModule = this.modules.find(\n (other) => module.type === other.type && module.optionsKey === other.optionsKey && module.identifier === other.identifier\n );\n if (otherModule) {\n if (module.packageType === \"enterprise\" && otherModule.packageType === \"community\") {\n const index = this.modules.indexOf(otherModule);\n this.modules.splice(index, 1, module);\n }\n } else {\n this.modules.push(module);\n }\n }\n }\n hasEnterpriseModules() {\n return this.modules.some((m) => m.packageType === \"enterprise\");\n }\n *byType(...types) {\n for (const module of this.modules) {\n if (types.includes(module.type) && this.dependencies.has(module.optionsKey)) {\n yield module;\n }\n }\n for (const module of this.modules) {\n if (types.includes(module.type) && !this.dependencies.has(module.optionsKey) && !this.dependents.has(module.optionsKey)) {\n yield module;\n }\n }\n for (const module of this.modules) {\n if (types.includes(module.type) && this.dependents.has(module.optionsKey)) {\n yield module;\n }\n }\n }\n registerDependencies(module) {\n if (module.dependencies == null || module.dependencies.length === 0)\n return;\n if (this.dependencies.has(module.optionsKey)) {\n throw new Error(\n `Module [${module.optionsKey}] can not both be depended upon by any module and have dependencies of [${module.dependencies}].`\n );\n }\n for (const dep of module.dependencies) {\n if (this.dependents.has(dep)) {\n throw new Error(\n `Module [${dep}] can not both be depended upon by any module and have dependencies of [${module.optionsKey}].`\n );\n }\n this.dependencies.add(dep);\n }\n this.dependents.add(module.optionsKey);\n }\n};\nvar moduleRegistry = new ModuleRegistry();\n\n// packages/ag-charts-community/src/chart/factory/axisRegistry.ts\nvar AxisRegistry = class {\n constructor() {\n this.axesMap = /* @__PURE__ */ new Map();\n this.hidden = /* @__PURE__ */ new Set();\n this.themeTemplates = /* @__PURE__ */ new Map();\n }\n register(axisType, module) {\n this.axesMap.set(axisType, module.instanceConstructor);\n if (module.themeTemplate) {\n this.setThemeTemplate(axisType, module.themeTemplate);\n }\n if (module.hidden) {\n this.hidden.add(axisType);\n }\n }\n create(axisType, moduleContext) {\n const AxisConstructor = this.axesMap.get(axisType);\n if (AxisConstructor) {\n return new AxisConstructor(moduleContext);\n }\n throw new Error(`AG Charts - unknown axis type: ${axisType}`);\n }\n has(axisType) {\n return this.axesMap.has(axisType);\n }\n keys() {\n return this.axesMap.keys();\n }\n publicKeys() {\n return [...this.keys()].filter((k) => !this.hidden.has(k));\n }\n setThemeTemplate(axisType, themeTemplate) {\n this.themeTemplates.set(axisType, themeTemplate);\n return this;\n }\n getThemeTemplate(axisType) {\n return this.themeTemplates.get(axisType);\n }\n};\nvar axisRegistry = new AxisRegistry();\n\n// packages/ag-charts-community/src/util/decorator.ts\nvar BREAK_TRANSFORM_CHAIN = Symbol(\"BREAK\");\nvar CONFIG_KEY = \"__decorator_config\";\nfunction initialiseConfig(target, propertyKeyOrSymbol) {\n if (Object.getOwnPropertyDescriptor(target, CONFIG_KEY) == null) {\n Object.defineProperty(target, CONFIG_KEY, { value: {} });\n }\n const config = target[CONFIG_KEY];\n const propertyKey = propertyKeyOrSymbol.toString();\n if (typeof config[propertyKey] !== \"undefined\") {\n return config[propertyKey];\n }\n const valuesMap = /* @__PURE__ */ new WeakMap();\n config[propertyKey] = { setters: [], getters: [], observers: [], valuesMap };\n const descriptor = Object.getOwnPropertyDescriptor(target, propertyKeyOrSymbol);\n const prevSet = descriptor == null ? void 0 : descriptor.set;\n const prevGet = descriptor == null ? void 0 : descriptor.get;\n const getter = function() {\n let value = prevGet ? prevGet.call(this) : valuesMap.get(this);\n for (const transformFn of config[propertyKey].getters) {\n value = transformFn(this, propertyKeyOrSymbol, value);\n if (value === BREAK_TRANSFORM_CHAIN) {\n return;\n }\n }\n return value;\n };\n const setter = function(value) {\n const { setters, observers } = config[propertyKey];\n let oldValue;\n if (setters.some((f) => f.length > 2)) {\n oldValue = prevGet ? prevGet.call(this) : valuesMap.get(this);\n }\n for (const transformFn of setters) {\n value = transformFn(this, propertyKeyOrSymbol, value, oldValue);\n if (value === BREAK_TRANSFORM_CHAIN) {\n return;\n }\n }\n if (prevSet) {\n prevSet.call(this, value);\n } else {\n valuesMap.set(this, value);\n }\n for (const observerFn of observers) {\n observerFn(this, value, oldValue);\n }\n };\n Object.defineProperty(target, propertyKeyOrSymbol, {\n set: setter,\n get: getter,\n enumerable: true,\n configurable: false\n });\n return config[propertyKey];\n}\nfunction addTransformToInstanceProperty(setTransform, getTransform, configMetadata) {\n return (target, propertyKeyOrSymbol) => {\n const config = initialiseConfig(target, propertyKeyOrSymbol);\n config.setters.push(setTransform);\n if (getTransform) {\n config.getters.unshift(getTransform);\n }\n if (configMetadata) {\n Object.assign(config, configMetadata);\n }\n };\n}\nfunction addObserverToInstanceProperty(setObserver) {\n return (target, propertyKeyOrSymbol) => {\n initialiseConfig(target, propertyKeyOrSymbol).observers.push(setObserver);\n };\n}\nfunction isDecoratedObject(target) {\n return typeof target !== \"undefined\" && CONFIG_KEY in target;\n}\nfunction listDecoratedProperties(target) {\n const targets = /* @__PURE__ */ new Set();\n while (isDecoratedObject(target)) {\n targets.add(target == null ? void 0 : target[CONFIG_KEY]);\n target = Object.getPrototypeOf(target);\n }\n return Array.from(targets).flatMap((configMap) => Object.keys(configMap));\n}\nfunction extractDecoratedProperties(target) {\n return listDecoratedProperties(target).reduce((result, key) => {\n var _a;\n result[key] = (_a = target[key]) != null ? _a : null;\n return result;\n }, {});\n}\nfunction extractDecoratedPropertyMetadata(target, propertyKeyOrSymbol) {\n const propertyKey = propertyKeyOrSymbol.toString();\n while (isDecoratedObject(target)) {\n const config = target[CONFIG_KEY];\n if (Object.hasOwn(config, propertyKey)) {\n return config[propertyKey];\n }\n target = Object.getPrototypeOf(target);\n }\n}\n\n// packages/ag-charts-community/src/util/type-guards.ts\nfunction isDefined(val) {\n return val != null;\n}\nfunction isArray(value) {\n return Array.isArray(value);\n}\nfunction isBoolean(value) {\n return typeof value === \"boolean\";\n}\nfunction isDate(value) {\n return value instanceof Date;\n}\nfunction isValidDate(value) {\n return isDate(value) && !isNaN(Number(value));\n}\nfunction isRegExp(value) {\n return value instanceof RegExp;\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\nfunction isObject(value) {\n return typeof value === \"object\" && value !== null && !isArray(value);\n}\nfunction isObjectLike(value) {\n return isArray(value) || isPlainObject(value);\n}\nfunction isPlainObject(value) {\n return typeof value === \"object\" && value !== null && value.constructor === Object;\n}\nfunction isString(value) {\n return typeof value === \"string\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isFiniteNumber(value) {\n return isNumber(value) && Number.isFinite(value);\n}\nfunction isHtmlElement(value) {\n return typeof window !== \"undefined\" && value instanceof HTMLElement;\n}\nfunction isEnumKey(enumObject, enumKey) {\n return isString(enumKey) && Object.keys(enumObject).includes(enumKey);\n}\nfunction isEnumValue(enumObject, enumValue) {\n return Object.values(enumObject).includes(enumValue);\n}\nfunction isSymbol(value) {\n return typeof value === \"symbol\";\n}\n\n// packages/ag-charts-community/src/util/object.ts\nfunction deepMerge(...sources) {\n return mergeDefaults(...sources.reverse());\n}\nfunction mergeDefaults(...sources) {\n var _a;\n const target = {};\n for (const source of sources) {\n if (!isObject(source))\n continue;\n const keys = isDecoratedObject(source) ? listDecoratedProperties(source) : Object.keys(source);\n for (const key of keys) {\n if (isPlainObject(target[key]) && isPlainObject(source[key])) {\n target[key] = mergeDefaults(target[key], source[key]);\n } else {\n (_a = target[key]) != null ? _a : target[key] = source[key];\n }\n }\n }\n return target;\n}\nfunction mergeArrayDefaults(dataArray, ...itemDefaults) {\n if (itemDefaults && isArray(dataArray)) {\n return dataArray.map((item) => mergeDefaults(item, ...itemDefaults));\n }\n return dataArray;\n}\nfunction mapValues(object, mapper) {\n return Object.entries(object).reduce(\n (result, [key, value]) => {\n result[key] = mapper(value, key, object);\n return result;\n },\n {}\n );\n}\nfunction without(object, keys) {\n const clone = __spreadValues({}, object);\n for (const key of keys) {\n delete clone[key];\n }\n return clone;\n}\nfunction getPath(object, path) {\n const pathArray = isArray(path) ? path : path.split(\".\");\n return pathArray.reduce((value, pathKey) => value[pathKey], object);\n}\nfunction setPath(object, path, newValue) {\n const pathArray = isArray(path) ? path.slice() : path.split(\".\");\n const lastKey = pathArray.pop();\n const lastObject = pathArray.reduce((value, pathKey) => value[pathKey], object);\n lastObject[lastKey] = newValue;\n}\nfunction partialAssign(keysToCopy, target, source) {\n if (source === void 0) {\n return target;\n }\n for (const key of keysToCopy) {\n const value = source[key];\n if (value !== void 0) {\n target[key] = value;\n }\n }\n return target;\n}\n\n// packages/ag-charts-community/src/chart/factory/chartTypes.ts\nvar ChartTypes = class extends Map {\n get(seriesType) {\n var _a;\n return (_a = super.get(seriesType)) != null ? _a : \"unknown\";\n }\n isCartesian(seriesType) {\n return this.get(seriesType) === \"cartesian\";\n }\n isPolar(seriesType) {\n return this.get(seriesType) === \"polar\";\n }\n isHierarchy(seriesType) {\n return this.get(seriesType) === \"hierarchy\";\n }\n isTopology(seriesType) {\n return this.get(seriesType) === \"topology\";\n }\n get seriesTypes() {\n return Array.from(this.keys());\n }\n get cartesianTypes() {\n return this.seriesTypes.filter((t) => this.isCartesian(t));\n }\n get polarTypes() {\n return this.seriesTypes.filter((t) => this.isPolar(t));\n }\n get hierarchyTypes() {\n return this.seriesTypes.filter((t) => this.isHierarchy(t));\n }\n get topologyTypes() {\n return this.seriesTypes.filter((t) => this.isTopology(t));\n }\n};\nvar ChartDefaults = class extends Map {\n set(chartType2, defaults) {\n return super.set(chartType2, mergeDefaults(defaults, this.get(chartType2)));\n }\n};\nvar chartTypes = new ChartTypes();\nvar publicChartTypes = new ChartTypes();\nvar chartDefaults = new ChartDefaults();\n\n// packages/ag-charts-community/src/chart/factory/expectedEnterpriseModules.ts\nvar EXPECTED_ENTERPRISE_MODULES = [\n { type: \"root\", optionsKey: \"animation\", chartTypes: [\"cartesian\", \"polar\", \"hierarchy\", \"topology\"] },\n { type: \"root\", optionsKey: \"annotations\", chartTypes: [\"cartesian\"] },\n {\n type: \"root\",\n optionsKey: \"background\",\n chartTypes: [\"cartesian\", \"polar\", \"hierarchy\", \"topology\"],\n optionsInnerKey: \"image\"\n },\n { type: \"root\", optionsKey: \"contextMenu\", chartTypes: [\"cartesian\", \"polar\", \"hierarchy\", \"topology\"] },\n { type: \"root\", optionsKey: \"dataSource\", chartTypes: [\"cartesian\", \"polar\", \"hierarchy\", \"topology\"] },\n { type: \"root\", optionsKey: \"sync\", chartTypes: [\"cartesian\"] },\n { type: \"root\", optionsKey: \"zoom\", chartTypes: [\"cartesian\", \"topology\"] },\n {\n type: \"legend\",\n optionsKey: \"gradientLegend\",\n chartTypes: [\"cartesian\", \"polar\", \"hierarchy\", \"topology\"],\n identifier: \"gradient\"\n },\n { type: \"root\", optionsKey: \"navigator\", chartTypes: [\"cartesian\"], optionsInnerKey: \"miniChart\" },\n { type: \"axis\", optionsKey: \"axes[]\", chartTypes: [\"polar\"], identifier: \"angle-category\" },\n { type: \"axis\", optionsKey: \"axes[]\", chartTypes: [\"polar\"], identifier: \"angle-number\" },\n { type: \"axis\", optionsKey: \"axes[]\", chartTypes: [\"polar\"], identifier: \"radius-category\" },\n { type: \"axis\", optionsKey: \"axes[]\", chartTypes: [\"polar\"], identifier: \"radius-number\" },\n { type: \"axis\", optionsKey: \"axes[]\", chartTypes: [\"cartesian\"], identifier: \"ordinal-time\" },\n { type: \"axis-option\", optionsKey: \"crosshair\", chartTypes: [\"cartesian\"] },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"cartesian\"], identifier: \"box-plot\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"cartesian\"], identifier: \"candlestick\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"cartesian\"], identifier: \"ohlc\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"cartesian\"], identifier: \"bullet\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"cartesian\"], identifier: \"heatmap\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"cartesian\"], identifier: \"range-area\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"cartesian\"], identifier: \"range-bar\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"cartesian\"], identifier: \"waterfall\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"polar\"], identifier: \"nightingale\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"polar\"], identifier: \"radar-area\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"polar\"], identifier: \"radar-line\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"polar\"], identifier: \"radial-bar\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"polar\"], identifier: \"radial-column\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"hierarchy\"], identifier: \"sunburst\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"hierarchy\"], identifier: \"treemap\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"topology\"], identifier: \"map-shape\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"topology\"], identifier: \"map-line\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"topology\"], identifier: \"map-marker\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"topology\"], identifier: \"map-shape-background\" },\n { type: \"series\", optionsKey: \"series[]\", chartTypes: [\"topology\"], identifier: \"map-line-background\" },\n { type: \"series-option\", optionsKey: \"errorBar\", chartTypes: [\"cartesian\"], identifier: \"error-bars\" }\n];\nfunction isEnterpriseSeriesType(type) {\n return EXPECTED_ENTERPRISE_MODULES.some((s) => s.type === \"series\" && s.identifier === type);\n}\nfunction getEnterpriseSeriesChartTypes(type) {\n var _a;\n return (_a = EXPECTED_ENTERPRISE_MODULES.find((s) => s.type === \"series\" && s.identifier === type)) == null ? void 0 : _a.chartTypes;\n}\nfunction isEnterpriseCartesian(seriesType) {\n var _a;\n const type = (_a = getEnterpriseSeriesChartTypes(seriesType)) == null ? void 0 : _a.find((v) => v === \"cartesian\");\n return type === \"cartesian\";\n}\nfunction isEnterprisePolar(seriesType) {\n var _a;\n const type = (_a = getEnterpriseSeriesChartTypes(seriesType)) == null ? void 0 : _a.find((v) => v === \"polar\");\n return type === \"polar\";\n}\nfunction isEnterpriseHierarchy(seriesType) {\n var _a;\n const type = (_a = getEnterpriseSeriesChartTypes(seriesType)) == null ? void 0 : _a.find((v) => v === \"hierarchy\");\n return type === \"hierarchy\";\n}\nfunction isEnterpriseTopology(seriesType) {\n var _a;\n const type = (_a = getEnterpriseSeriesChartTypes(seriesType)) == null ? void 0 : _a.find((v) => v === \"topology\");\n return type === \"topology\";\n}\nfunction isEnterpriseModule(module) {\n return module.packageType === \"enterprise\";\n}\nfunction verifyIfModuleExpected(module) {\n var _a;\n if (!isEnterpriseModule(module)) {\n throw new Error(\"AG Charts - internal configuration error, only enterprise modules need verification.\");\n }\n const stub = EXPECTED_ENTERPRISE_MODULES.find((s) => {\n return s.type === module.type && s.optionsKey === module.optionsKey && s.identifier === module.identifier && module.chartTypes.every((t) => s.chartTypes.includes(t));\n });\n if (stub) {\n (_a = stub.useCount) != null ? _a : stub.useCount = 0;\n stub.useCount++;\n }\n return stub != null;\n}\nfunction getUnusedExpectedModules() {\n return EXPECTED_ENTERPRISE_MODULES.filter(({ useCount }) => useCount == null || useCount === 0);\n}\n\n// packages/ag-charts-community/src/chart/mapping/types.ts\nfunction optionsType(input) {\n var _a, _b, _c;\n return (_c = (_b = (_a = input.series) == null ? void 0 : _a[0]) == null ? void 0 : _b.type) != null ? _c : \"line\";\n}\nfunction isAgCartesianChartOptions(input) {\n const specifiedType = optionsType(input);\n if (specifiedType == null) {\n return true;\n }\n if (specifiedType === \"cartesian\") {\n Logger.warnOnce(`type '${specifiedType}' is deprecated, use a series type instead`);\n return true;\n }\n return chartTypes.isCartesian(specifiedType) || isEnterpriseCartesian(specifiedType);\n}\nfunction isAgPolarChartOptions(input) {\n const specifiedType = optionsType(input);\n if (specifiedType == null) {\n return false;\n }\n if (specifiedType === \"polar\") {\n Logger.warnOnce(`type '${specifiedType}' is deprecated, use a series type instead`);\n return true;\n }\n return chartTypes.isPolar(specifiedType) || isEnterprisePolar(specifiedType);\n}\nfunction isAgHierarchyChartOptions(input) {\n const specifiedType = optionsType(input);\n if (specifiedType == null) {\n return false;\n }\n if (specifiedType === \"hierarchy\") {\n Logger.warnOnce(`type '${specifiedType}' is deprecated, use a series type instead`);\n return true;\n }\n return chartTypes.isHierarchy(specifiedType) || isEnterpriseHierarchy(specifiedType);\n}\nfunction isAgTopologyChartOptions(input) {\n const specifiedType = optionsType(input);\n if (specifiedType == null) {\n return false;\n }\n if (specifiedType === \"topology\") {\n Logger.warnOnce(`type '${specifiedType}' is deprecated, use a series type instead`);\n return true;\n }\n return chartTypes.isTopology(specifiedType) || isEnterpriseTopology(specifiedType);\n}\nfunction isAgPolarChartOptionsWithSeriesBasedLegend(input) {\n const specifiedType = optionsType(input);\n return isAgPolarChartOptions(input) && specifiedType !== \"pie\" && specifiedType !== \"donut\";\n}\nfunction isSeriesOptionType(input) {\n if (input == null) {\n return false;\n }\n return chartTypes.has(input);\n}\nfunction isAxisOptionType(input) {\n if (input == null) {\n return false;\n }\n return axisRegistry.has(input);\n}\n\n// packages/ag-charts-community/src/chart/factory/processEnterpriseOptions.ts\nfunction removeUsedEnterpriseOptions(options) {\n var _a, _b, _c, _d;\n const usedOptions = [];\n const optionsChartType = chartTypes.get(optionsType(options));\n for (const {\n type,\n chartTypes: moduleChartTypes,\n optionsKey,\n optionsInnerKey,\n identifier\n } of EXPECTED_ENTERPRISE_MODULES) {\n if (optionsChartType !== \"unknown\" && !moduleChartTypes.includes(optionsChartType))\n continue;\n if (type === \"root\" || type === \"legend\") {\n const optionValue = options[optionsKey];\n if (optionValue == null)\n continue;\n if (!optionsInnerKey) {\n usedOptions.push(optionsKey);\n delete options[optionsKey];\n } else if (optionValue[optionsInnerKey]) {\n usedOptions.push(`${optionsKey}.${optionsInnerKey}`);\n delete optionValue[optionsInnerKey];\n }\n } else if (type === \"axis\") {\n if (!(\"axes\" in options) || !((_a = options.axes) == null ? void 0 : _a.some((axis) => axis.type === identifier)))\n continue;\n usedOptions.push(`axis[type=${identifier}]`);\n options.axes = options.axes.filter((axis) => axis.type !== identifier);\n } else if (type === \"axis-option\") {\n if (!(\"axes\" in options) || !((_b = options.axes) == null ? void 0 : _b.some((axis) => axis[optionsKey])))\n continue;\n usedOptions.push(`axis.${optionsKey}`);\n options.axes.forEach((axis) => {\n if (axis[optionsKey]) {\n delete axis[optionsKey];\n }\n });\n } else if (type === \"series\") {\n if (!((_c = options.series) == null ? void 0 : _c.some((series) => series.type === identifier)))\n continue;\n usedOptions.push(`series[type=${identifier}]`);\n options.series = options.series.filter((series) => series.type !== identifier);\n } else if (type === \"series-option\") {\n if (!((_d = options.series) == null ? void 0 : _d.some((series) => series[optionsKey])))\n continue;\n usedOptions.push(`series.${optionsKey}`);\n options.series.forEach((series) => {\n if (series[optionsKey]) {\n delete series[optionsKey];\n }\n });\n }\n }\n if (usedOptions.length) {\n let enterprisePackageName = \"ag-charts-enterprise\";\n let enterpriseReferenceUrl = \"https://charts.ag-grid.com/javascript/installation/\";\n if (options.mode === \"integrated\") {\n enterprisePackageName = \"ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise\";\n enterpriseReferenceUrl = \"https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/\";\n }\n Logger.warnOnce(\n [\n `unable to use these enterprise features as '${enterprisePackageName}' has not been loaded:`,\n \"\",\n ...usedOptions,\n \"\",\n `See: ${enterpriseReferenceUrl}`\n ].join(\"\\n\")\n );\n }\n}\n\n// packages/ag-charts-community/src/util/properties.ts\nvar BaseProperties = class {\n set(properties) {\n const { className = this.constructor.name } = this.constructor;\n if (typeof properties !== \"object\") {\n Logger.warn(`unable to set ${className} - expecting a properties object`);\n return this;\n }\n const keys = new Set(Object.keys(properties));\n for (const propertyKey of listDecoratedProperties(this)) {\n if (keys.has(propertyKey)) {\n const value = properties[propertyKey];\n const self = this;\n if (isProperties(self[propertyKey])) {\n self[propertyKey] = self[propertyKey] instanceof PropertiesArray ? self[propertyKey].reset(value) : self[propertyKey].set(value);\n } else {\n self[propertyKey] = value;\n }\n keys.delete(propertyKey);\n }\n }\n for (const unknownKey of keys) {\n Logger.warn(`unable to set [${unknownKey}] in ${className} - property is unknown`);\n }\n return this;\n }\n isValid() {\n return listDecoratedProperties(this).every((propertyKey) => {\n const { optional } = extractDecoratedPropertyMetadata(this, propertyKey);\n const valid = optional || typeof this[propertyKey] !== \"undefined\";\n if (!valid) {\n Logger.warnOnce(`[${propertyKey}] is required.`);\n }\n return valid;\n });\n }\n toJson() {\n return listDecoratedProperties(this).reduce((object, propertyKey) => {\n const propertyValue = this[propertyKey];\n object[propertyKey] = isProperties(propertyValue) ? propertyValue.toJson() : propertyValue;\n return object;\n }, {});\n }\n};\nvar PropertiesArray = class _PropertiesArray extends Array {\n constructor(itemFactory, ...properties) {\n super(properties.length);\n Object.defineProperty(this, \"itemFactory\", { value: itemFactory, enumerable: false, configurable: false });\n this.set(properties);\n }\n set(properties) {\n if (isArray(properties)) {\n this.length = properties.length;\n for (let i = 0; i < properties.length; i++) {\n this[i] = new this.itemFactory().set(properties[i]);\n }\n }\n return this;\n }\n reset(properties) {\n return new _PropertiesArray(this.itemFactory, ...properties);\n }\n toJson() {\n return this.map((value) => {\n var _a, _b;\n return (_b = (_a = value == null ? void 0 : value.toJson) == null ? void 0 : _a.call(value)) != null ? _b : value;\n });\n }\n};\nfunction isProperties(value) {\n return value instanceof BaseProperties || value instanceof PropertiesArray;\n}\n\n// packages/ag-charts-community/src/util/json.ts\nvar CLASS_INSTANCE_TYPE = \"class-instance\";\nfunction jsonDiff(source, target, skip) {\n if (isArray(target)) {\n if (!isArray(source) || source.length !== target.length || target.some((v, i) => jsonDiff(source[i], v) != null)) {\n return target;\n }\n } else if (isPlainObject(target)) {\n if (!isPlainObject(source)) {\n return target;\n }\n const result = {};\n const allKeys = /* @__PURE__ */ new Set([\n ...Object.keys(source),\n ...Object.keys(target)\n ]);\n for (const key of allKeys) {\n if (source[key] === target[key] || (skip == null ? void 0 : skip.includes(key))) {\n continue;\n }\n if (typeof source[key] === typeof target[key]) {\n const diff2 = jsonDiff(source[key], target[key]);\n if (diff2 !== null) {\n result[key] = diff2;\n }\n } else {\n result[key] = target[key];\n }\n }\n return Object.keys(result).length ? result : null;\n } else if (source !== target) {\n return target;\n }\n return null;\n}\nfunction deepClone(source, options) {\n if (isArray(source)) {\n return source.map((item) => deepClone(item, options));\n }\n if (isPlainObject(source)) {\n return mapValues(\n source,\n (value, key) => {\n var _a;\n return ((_a = options == null ? void 0 : options.shallow) == null ? void 0 : _a.includes(key)) ? shallowClone(value) : deepClone(value, options);\n }\n );\n }\n return shallowClone(source);\n}\nfunction shallowClone(source) {\n if (isArray(source)) {\n return [...source];\n }\n if (isPlainObject(source)) {\n return __spreadValues({}, source);\n }\n if (isDate(source)) {\n return new Date(source);\n }\n if (isRegExp(source)) {\n return new RegExp(source.source, source.flags);\n }\n return source;\n}\nfunction jsonWalk(json, visit, opts, ...jsons) {\n var _a;\n if (isArray(json)) {\n visit(json, ...jsons);\n json.forEach((node, index) => {\n jsonWalk(node, visit, opts, ...keyMapper(jsons, index));\n });\n } else if (isPlainObject(json)) {\n visit(json, ...jsons);\n for (const key of Object.keys(json)) {\n if ((_a = opts == null ? void 0 : opts.skip) == null ? void 0 : _a.includes(key)) {\n continue;\n }\n const value = json[key];\n if (isArray(value) || isPlainObject(value)) {\n jsonWalk(value, visit, opts, ...keyMapper(jsons, key));\n }\n }\n }\n}\nfunction jsonApply(target, source, params = {}) {\n const { path, constructedArrays, matcherPath = path == null ? void 0 : path.replace(/(\\[[0-9+]+])/i, \"[]\"), skip = [] } = params;\n if (target == null) {\n throw new Error(`AG Charts - target is uninitialised: ${path != null ? path : \"\"}`);\n }\n if (source == null) {\n return target;\n }\n if (isProperties(target)) {\n return target.set(source);\n }\n const targetAny = target;\n const targetType = classify(target);\n for (const property in source) {\n const propertyMatcherPath = `${matcherPath ? matcherPath + \".\" : \"\"}${property}`;\n if (skip.includes(propertyMatcherPath))\n continue;\n const newValue = source[property];\n const propertyPath = `${path ? path + \".\" : \"\"}${property}`;\n const targetClass = targetAny.constructor;\n const currentValue = targetAny[property];\n let ctr;\n try {\n const currentValueType = classify(currentValue);\n const newValueType = classify(newValue);\n if (targetType === CLASS_INSTANCE_TYPE && !(property in target)) {\n Logger.warn(`unable to set [${propertyPath}] in ${targetClass == null ? void 0 : targetClass.name} - property is unknown`);\n continue;\n }\n if (currentValueType != null && newValueType != null && newValueType !== currentValueType && (currentValueType !== CLASS_INSTANCE_TYPE || newValueType !== \"object\")) {\n Logger.warn(\n `unable to set [${propertyPath}] in ${targetClass == null ? void 0 : targetClass.name} - can't apply type of [${newValueType}], allowed types are: [${currentValueType}]`\n );\n continue;\n }\n if (isProperties(currentValue)) {\n targetAny[property].set(newValue);\n } else if (newValueType === \"array\") {\n ctr != null ? ctr : ctr = constructedArrays == null ? void 0 : constructedArrays.get(currentValue);\n if (ctr == null) {\n targetAny[property] = newValue;\n } else {\n const newValueArray = newValue;\n targetAny[property] = newValueArray.map(\n (v) => jsonApply(new ctr(), v, __spreadProps(__spreadValues({}, params), {\n path: propertyPath,\n matcherPath: propertyMatcherPath + \"[]\"\n }))\n );\n }\n } else if (newValueType === CLASS_INSTANCE_TYPE) {\n targetAny[property] = newValue;\n } else if (newValueType === \"object\") {\n if (currentValue != null) {\n jsonApply(currentValue, newValue, __spreadProps(__spreadValues({}, params), {\n path: propertyPath,\n matcherPath: propertyMatcherPath\n }));\n } else if (ctr == null) {\n targetAny[property] = {};\n jsonApply(targetAny[property], newValue, __spreadProps(__spreadValues({}, params), {\n path: propertyPath,\n matcherPath: propertyMatcherPath\n }));\n } else {\n targetAny[property] = jsonApply(new ctr(), newValue, __spreadProps(__spreadValues({}, params), {\n path: propertyPath,\n matcherPath: propertyMatcherPath\n }));\n }\n } else {\n targetAny[property] = newValue;\n }\n } catch (error) {\n Logger.warn(`unable to set [${propertyPath}] in [${targetClass == null ? void 0 : targetClass.name}]; nested error is: ${error.message}`);\n }\n }\n return target;\n}\nfunction keyMapper(data, key) {\n return data.map((dataObject) => dataObject == null ? void 0 : dataObject[key]);\n}\nfunction classify(value) {\n if (value == null) {\n return null;\n }\n if (isHtmlElement(value) || isDate(value)) {\n return \"primitive\";\n }\n if (isArray(value)) {\n return \"array\";\n }\n if (isObject(value)) {\n return isPlainObject(value) ? \"object\" : CLASS_INSTANCE_TYPE;\n }\n if (isFunction(value)) {\n return \"function\";\n }\n return \"primitive\";\n}\n\n// packages/ag-charts-community/src/chart/factory/seriesRegistry.ts\nvar SeriesRegistry = class {\n constructor() {\n this.seriesMap = /* @__PURE__ */ new Map();\n this.themeTemplates = /* @__PURE__ */ new Map();\n }\n register(seriesType, {\n chartTypes: [chartType2],\n instanceConstructor,\n defaultAxes,\n themeTemplate,\n enterpriseThemeTemplate,\n paletteFactory,\n solo,\n stackable,\n groupable,\n stackedByDefault,\n swapDefaultAxesCondition,\n hidden\n }) {\n this.setThemeTemplate(seriesType, themeTemplate, enterpriseThemeTemplate);\n this.seriesMap.set(seriesType, {\n instanceConstructor,\n defaultAxes,\n paletteFactory,\n solo,\n stackable,\n groupable,\n stackedByDefault,\n swapDefaultAxesCondition\n });\n chartTypes.set(seriesType, chartType2);\n if (!hidden) {\n publicChartTypes.set(seriesType, chartType2);\n }\n }\n create(seriesType, moduleContext) {\n var _a;\n const SeriesConstructor = (_a = this.seriesMap.get(seriesType)) == null ? void 0 : _a.instanceConstructor;\n if (SeriesConstructor) {\n return new SeriesConstructor(moduleContext);\n }\n throw new Error(`AG Charts - unknown series type: ${seriesType}`);\n }\n cloneDefaultAxes(seriesType) {\n var _a;\n const defaultAxes = (_a = this.seriesMap.get(seriesType)) == null ? void 0 : _a.defaultAxes;\n return defaultAxes ? { axes: deepClone(defaultAxes) } : null;\n }\n setThemeTemplate(seriesType, themeTemplate, enterpriseThemeTemplate = {}) {\n const currentTemplate = this.themeTemplates.get(seriesType);\n this.themeTemplates.set(seriesType, {\n community: mergeDefaults(themeTemplate, currentTemplate == null ? void 0 : currentTemplate.community),\n enterprise: mergeDefaults(enterpriseThemeTemplate, themeTemplate, currentTemplate == null ? void 0 : currentTemplate.community)\n });\n }\n getThemeTemplate(seriesType) {\n const themeTemplate = this.themeTemplates.get(seriesType);\n return enterpriseModule.isEnterprise ? themeTemplate == null ? void 0 : themeTemplate.enterprise : themeTemplate == null ? void 0 : themeTemplate.community;\n }\n getPaletteFactory(seriesType) {\n var _a;\n return (_a = this.seriesMap.get(seriesType)) == null ? void 0 : _a.paletteFactory;\n }\n isSolo(seriesType) {\n var _a, _b;\n return (_b = (_a = this.seriesMap.get(seriesType)) == null ? void 0 : _a.solo) != null ? _b : false;\n }\n isGroupable(seriesType) {\n var _a, _b;\n return (_b = (_a = this.seriesMap.get(seriesType)) == null ? void 0 : _a.groupable) != null ? _b : false;\n }\n isStackable(seriesType) {\n var _a, _b;\n return (_b = (_a = this.seriesMap.get(seriesType)) == null ? void 0 : _a.stackable) != null ? _b : false;\n }\n isStackedByDefault(seriesType) {\n var _a, _b;\n return (_b = (_a = this.seriesMap.get(seriesType)) == null ? void 0 : _a.stackedByDefault) != null ? _b : false;\n }\n isDefaultAxisSwapNeeded(options) {\n var _a, _b, _c;\n let result;\n for (const series of (_a = options.series) != null ? _a : []) {\n const { type = \"line\" } = series;\n const isDefaultAxisSwapped = (_c = (_b = this.seriesMap.get(type)) == null ? void 0 : _b.swapDefaultAxesCondition) == null ? void 0 : _c.call(_b, series);\n if (isDefaultAxisSwapped != null) {\n if (result != null && result != isDefaultAxisSwapped) {\n throw new Error(\"AG Charts - The provided series have incompatible directions\");\n }\n result = isDefaultAxisSwapped;\n }\n }\n return result;\n }\n};\nvar seriesRegistry = new SeriesRegistry();\n\n// packages/ag-charts-community/src/chart/factory/legendRegistry.ts\nvar LegendRegistry = class {\n constructor() {\n this.legendMap = /* @__PURE__ */ new Map();\n this.themeTemplates = /* @__PURE__ */ new Map();\n }\n register(legendType, { optionsKey, instanceConstructor, themeTemplate }) {\n this.legendMap.set(legendType, { optionsKey, instanceConstructor });\n this.themeTemplates.set(optionsKey, themeTemplate);\n }\n create(legendType, moduleContext) {\n var _a;\n const LegendConstructor = (_a = this.legendMap.get(legendType)) == null ? void 0 : _a.instanceConstructor;\n if (LegendConstructor) {\n return new LegendConstructor(moduleContext);\n }\n throw new Error(`AG Charts - unknown legend type: ${legendType}`);\n }\n getThemeTemplates() {\n return Object.fromEntries(this.themeTemplates);\n }\n getKeys() {\n return Array.from(this.legendMap.entries()).reduce(\n (result, [legendType, record]) => {\n result[legendType] = record.optionsKey;\n return result;\n },\n {}\n );\n }\n};\nvar legendRegistry = new LegendRegistry();\n\n// packages/ag-charts-community/src/chart/themes/constants.ts\nvar FONT_SIZE = /* @__PURE__ */ ((FONT_SIZE2) => {\n FONT_SIZE2[FONT_SIZE2[\"SMALL\"] = 12] = \"SMALL\";\n FONT_SIZE2[FONT_SIZE2[\"MEDIUM\"] = 13] = \"MEDIUM\";\n FONT_SIZE2[FONT_SIZE2[\"LARGE\"] = 17] = \"LARGE\";\n return FONT_SIZE2;\n})(FONT_SIZE || {});\nvar FONT_WEIGHT = /* @__PURE__ */ ((FONT_WEIGHT3) => {\n FONT_WEIGHT3[\"NORMAL\"] = \"normal\";\n FONT_WEIGHT3[\"BOLD\"] = \"bold\";\n FONT_WEIGHT3[\"BOLDER\"] = \"bolder\";\n FONT_WEIGHT3[\"LIGHTER\"] = \"lighter\";\n return FONT_WEIGHT3;\n})(FONT_WEIGHT || {});\nvar POSITION = /* @__PURE__ */ ((POSITION3) => {\n POSITION3[\"TOP\"] = \"top\";\n POSITION3[\"RIGHT\"] = \"right\";\n POSITION3[\"BOTTOM\"] = \"bottom\";\n POSITION3[\"LEFT\"] = \"left\";\n return POSITION3;\n})(POSITION || {});\nvar CARTESIAN_AXIS_TYPE = /* @__PURE__ */ ((CARTESIAN_AXIS_TYPE2) => {\n CARTESIAN_AXIS_TYPE2[\"CATEGORY\"] = \"category\";\n CARTESIAN_AXIS_TYPE2[\"ORDINAL_TIME\"] = \"ordinal-time\";\n CARTESIAN_AXIS_TYPE2[\"NUMBER\"] = \"number\";\n CARTESIAN_AXIS_TYPE2[\"TIME\"] = \"time\";\n CARTESIAN_AXIS_TYPE2[\"LOG\"] = \"log\";\n return CARTESIAN_AXIS_TYPE2;\n})(CARTESIAN_AXIS_TYPE || {});\nvar POLAR_AXIS_TYPE = /* @__PURE__ */ ((POLAR_AXIS_TYPE2) => {\n POLAR_AXIS_TYPE2[\"ANGLE_CATEGORY\"] = \"angle-category\";\n POLAR_AXIS_TYPE2[\"ANGLE_NUMBER\"] = \"angle-number\";\n POLAR_AXIS_TYPE2[\"RADIUS_CATEGORY\"] = \"radius-category\";\n POLAR_AXIS_TYPE2[\"RADIUS_NUMBER\"] = \"radius-number\";\n return POLAR_AXIS_TYPE2;\n})(POLAR_AXIS_TYPE || {});\nvar POLAR_AXIS_SHAPE = /* @__PURE__ */ ((POLAR_AXIS_SHAPE2) => {\n POLAR_AXIS_SHAPE2[\"CIRCLE\"] = \"circle\";\n POLAR_AXIS_SHAPE2[\"POLYGON\"] = \"polygon\";\n return POLAR_AXIS_SHAPE2;\n})(POLAR_AXIS_SHAPE || {});\n\n// packages/ag-charts-community/src/chart/themes/defaultColors.ts\nvar DEFAULT_FILLS = {\n BLUE: \"#5090dc\",\n ORANGE: \"#ffa03a\",\n GREEN: \"#459d55\",\n CYAN: \"#34bfe1\",\n YELLOW: \"#e1cc00\",\n VIOLET: \"#9669cb\",\n GRAY: \"#b5b5b5\",\n MAGENTA: \"#bd5aa7\",\n BROWN: \"#8a6224\",\n RED: \"#ef5452\"\n};\nvar DEFAULT_STROKES = {\n BLUE: \"#2b5c95\",\n ORANGE: \"#cc6f10\",\n GREEN: \"#1e652e\",\n CYAN: \"#18859e\",\n YELLOW: \"#a69400\",\n VIOLET: \"#603c88\",\n GRAY: \"#575757\",\n MAGENTA: \"#7d2f6d\",\n BROWN: \"#4f3508\",\n RED: \"#a82529\"\n};\n\n// packages/ag-charts-community/src/chart/themes/symbols.ts\nvar IS_DARK_THEME = Symbol(\"is-dark-theme\");\nvar EXTENDS_AXES_DEFAULTS = Symbol(\"extends-axes-defaults\");\nvar EXTENDS_AXES_LINE_DEFAULTS = Symbol(\"extends-axes-line-defaults\");\nvar EXTENDS_AXES_TICK_DEFAULTS = Symbol(\"extends-axes-tick-defaults\");\nvar EXTENDS_AXES_GRID_LINE_DEFAULTS = Symbol(\"extends-axes-grid-line-defaults\");\nvar EXTENDS_SERIES_DEFAULTS = Symbol(\"extends-series-defaults\");\nvar EXTENDS_CARTESIAN_MARKER_DEFAULTS = Symbol(\"extends-cartesian-marker-defaults\");\nvar DEFAULT_FONT_FAMILY = Symbol(\"default-font\");\nvar DEFAULT_LABEL_COLOUR = Symbol(\"default-label-colour\");\nvar DEFAULT_INVERTED_LABEL_COLOUR = Symbol(\"default-inverted-label-colour\");\nvar DEFAULT_INSIDE_SERIES_LABEL_COLOUR = Symbol(\"default-inside-series-label-colour\");\nvar DEFAULT_MUTED_LABEL_COLOUR = Symbol(\"default-muted-label-colour\");\nvar DEFAULT_AXIS_GRID_COLOUR = Symbol(\"default-axis-grid-colour\");\nvar DEFAULT_AXIS_LINE_COLOUR = Symbol(\"default-axis-line-colour\");\nvar DEFAULT_CROSS_LINES_COLOUR = Symbol(\"default-cross-lines-colour\");\nvar DEFAULT_BACKGROUND_COLOUR = Symbol(\"default-background-colour\");\nvar DEFAULT_SHADOW_COLOUR = Symbol(\"default-shadow-colour\");\nvar DEFAULT_COLOURS = Symbol(\"default-colours\");\nvar DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS = Symbol(\n \"default-waterfall-series-positive-colors\"\n);\nvar DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS = Symbol(\n \"default-waterfall-series-negative-colors\"\n);\nvar DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS = Symbol(\n \"default-waterfall-series-total-colors\"\n);\nvar DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE = Symbol(\n \"default-waterfall-series-connector-line-stroke\"\n);\nvar DEFAULT_POLAR_SERIES_STROKE = Symbol(\"default-polar-series-stroke\");\nvar DEFAULT_DIVERGING_SERIES_COLOUR_RANGE = Symbol(\n \"default-diverging-series-colour-range\"\n);\nvar DEFAULT_HIERARCHY_FILLS = Symbol(\"default-hierarchy-fills\");\nvar DEFAULT_HIERARCHY_STROKES = Symbol(\"default-hierarchy-strokes\");\nvar DEFAULT_ANNOTATION_STROKE = Symbol(\"default-annotation-stroke\");\nvar DEFAULT_ANNOTATION_BACKGROUND_FILL = Symbol(\"default-annotation-background-fill\");\nvar DEFAULT_ANNOTATION_HANDLE_FILL = Symbol(\"default-annotation-handle-fill\");\n\n// packages/ag-charts-community/src/chart/themes/chartTheme.ts\nvar DEFAULT_BACKGROUND_FILL = \"white\";\nvar DEFAULT_PALETTE = {\n fills: Object.values(DEFAULT_FILLS),\n strokes: Object.values(DEFAULT_STROKES)\n};\nvar CHART_TYPE_CONFIG = {\n get cartesian() {\n return { seriesTypes: chartTypes.cartesianTypes, commonOptions: [\"zoom\", \"navigator\"] };\n },\n get polar() {\n return { seriesTypes: chartTypes.polarTypes, commonOptions: [] };\n },\n get hierarchy() {\n return { seriesTypes: chartTypes.hierarchyTypes, commonOptions: [] };\n },\n get topology() {\n return { seriesTypes: chartTypes.topologyTypes, commonOptions: [] };\n }\n};\nvar CHART_TYPE_SPECIFIC_COMMON_OPTIONS = Object.values(CHART_TYPE_CONFIG).reduce((r, { commonOptions }) => r.concat(commonOptions), []);\nvar _ChartTheme = class _ChartTheme {\n getPalette() {\n return DEFAULT_PALETTE;\n }\n static getAxisDefaults(overrideDefaults) {\n return mergeDefaults(overrideDefaults, {\n title: {\n enabled: false,\n text: \"Axis Title\",\n spacing: 25,\n fontWeight: \"normal\" /* NORMAL */,\n fontSize: 13 /* MEDIUM */,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_LABEL_COLOUR\n },\n label: {\n fontSize: 12 /* SMALL */,\n fontFamily: DEFAULT_FONT_FAMILY,\n padding: 5,\n color: DEFAULT_LABEL_COLOUR,\n avoidCollisions: true\n },\n line: {\n enabled: true,\n width: 1,\n color: DEFAULT_AXIS_LINE_COLOUR\n },\n tick: {\n enabled: false,\n width: 1,\n color: DEFAULT_AXIS_LINE_COLOUR\n },\n gridLine: {\n enabled: true,\n style: [{ stroke: DEFAULT_AXIS_GRID_COLOUR, lineDash: [] }]\n },\n crossLines: {\n enabled: false,\n fill: DEFAULT_CROSS_LINES_COLOUR,\n stroke: DEFAULT_CROSS_LINES_COLOUR,\n fillOpacity: 0.1,\n strokeWidth: 1,\n label: {\n enabled: false,\n fontSize: 12 /* SMALL */,\n fontFamily: DEFAULT_FONT_FAMILY,\n padding: 5,\n color: DEFAULT_LABEL_COLOUR\n }\n }\n });\n }\n static getSeriesDefaults() {\n return {\n visible: true,\n showInLegend: true,\n highlightStyle: {\n item: { fill: \"#ffffff54\", stroke: `#0006`, strokeWidth: 2 },\n series: { dimOpacity: 1 }\n },\n nodeClickRange: \"exact\",\n tooltip: { enabled: true }\n };\n }\n static getCartesianSeriesMarkerDefaults() {\n return { enabled: true, shape: \"circle\", size: 7, strokeWidth: 1 };\n }\n static getChartDefaults() {\n return {\n background: { visible: true, fill: DEFAULT_BACKGROUND_COLOUR },\n padding: { top: 20, right: 20, bottom: 20, left: 20 },\n keyboard: { enabled: true },\n title: {\n enabled: false,\n text: \"Title\",\n fontWeight: \"normal\" /* NORMAL */,\n fontSize: 17 /* LARGE */,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_LABEL_COLOUR,\n wrapping: \"hyphenate\"\n },\n subtitle: {\n enabled: false,\n text: \"Subtitle\",\n spacing: 20,\n fontSize: 13 /* MEDIUM */,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_MUTED_LABEL_COLOUR,\n wrapping: \"hyphenate\"\n },\n footnote: {\n enabled: false,\n text: \"Footnote\",\n spacing: 20,\n fontSize: 13 /* MEDIUM */,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: \"rgb(140, 140, 140)\",\n wrapping: \"hyphenate\"\n },\n legend: {\n position: \"bottom\" /* BOTTOM */,\n spacing: 30,\n listeners: {},\n item: {\n paddingX: 16,\n paddingY: 8,\n marker: { size: 15, padding: 8 },\n toggleSeriesVisible: true,\n label: {\n color: DEFAULT_LABEL_COLOUR,\n fontSize: 12 /* SMALL */,\n fontFamily: DEFAULT_FONT_FAMILY\n }\n },\n reverseOrder: false,\n pagination: {\n marker: { size: 12 },\n activeStyle: { fill: DEFAULT_LABEL_COLOUR },\n inactiveStyle: { fill: DEFAULT_MUTED_LABEL_COLOUR },\n highlightStyle: { fill: DEFAULT_LABEL_COLOUR },\n label: { color: DEFAULT_LABEL_COLOUR }\n }\n },\n tooltip: {\n enabled: true,\n darkTheme: IS_DARK_THEME,\n range: \"nearest\",\n delay: 0\n },\n overlays: {\n loading: { darkTheme: IS_DARK_THEME },\n noData: { darkTheme: IS_DARK_THEME },\n noVisibleSeries: { darkTheme: IS_DARK_THEME }\n },\n listeners: {}\n };\n }\n constructor(options = {}) {\n const { overrides, palette: palette10 } = deepClone(options);\n const defaults = this.createChartConfigPerChartType(this.getDefaults());\n if (overrides) {\n this.mergeOverrides(defaults, overrides);\n }\n this.config = Object.freeze(this.templateTheme(defaults));\n this.palette = mergeDefaults(palette10, this.getPalette());\n }\n mergeOverrides(defaults, overrides) {\n for (const { seriesTypes, commonOptions } of Object.values(CHART_TYPE_CONFIG)) {\n const cleanedCommon = __spreadValues({}, overrides.common);\n for (const commonKey of CHART_TYPE_SPECIFIC_COMMON_OPTIONS) {\n if (!commonOptions.includes(commonKey)) {\n delete cleanedCommon[commonKey];\n }\n }\n if (!cleanedCommon)\n continue;\n for (const s of seriesTypes) {\n const seriesType = s;\n defaults[seriesType] = mergeDefaults(cleanedCommon, defaults[seriesType]);\n }\n }\n chartTypes.seriesTypes.forEach((s) => {\n const seriesType = s;\n if (overrides[seriesType]) {\n defaults[seriesType] = mergeDefaults(overrides[seriesType], defaults[seriesType]);\n }\n });\n }\n createChartConfigPerChartType(config) {\n for (const [nextType, { seriesTypes }] of Object.entries(CHART_TYPE_CONFIG)) {\n const typeDefaults = chartDefaults.get(nextType);\n for (const seriesType of seriesTypes) {\n config[seriesType] || (config[seriesType] = deepClone(typeDefaults));\n }\n }\n return config;\n }\n getDefaults() {\n const getOverridesByType = (chartType2, seriesTypes) => {\n var _a;\n const result = {};\n const chartTypeDefaults = __spreadValues(__spreadValues(__spreadValues({\n axes: {}\n }, legendRegistry.getThemeTemplates()), _ChartTheme.getChartDefaults()), chartDefaults.get(chartType2));\n for (const seriesType of seriesTypes) {\n result[seriesType] = mergeDefaults(\n seriesRegistry.getThemeTemplate(seriesType),\n (_a = result[seriesType]) != null ? _a : deepClone(chartTypeDefaults)\n );\n const { axes } = result[seriesType];\n for (const axisType of axisRegistry.keys()) {\n axes[axisType] = mergeDefaults(\n axes[axisType],\n axisRegistry.getThemeTemplate(axisType),\n chartType2 === \"cartesian\" && _ChartTheme.cartesianAxisDefault[axisType]\n );\n }\n }\n return result;\n };\n return mergeDefaults(\n getOverridesByType(\"cartesian\", chartTypes.cartesianTypes),\n getOverridesByType(\"polar\", chartTypes.polarTypes),\n getOverridesByType(\"hierarchy\", chartTypes.hierarchyTypes),\n getOverridesByType(\"topology\", chartTypes.topologyTypes)\n );\n }\n templateTheme(themeTemplate) {\n const themeInstance = deepClone(themeTemplate);\n const { extensions, properties } = this.getTemplateParameters();\n jsonWalk(themeInstance, (node) => {\n if (node[\"__extends__\"]) {\n const extendsValue = node[\"__extends__\"];\n const source = extensions.get(extendsValue);\n if (source == null) {\n throw new Error(`AG Charts - no template variable provided for: ${extendsValue}`);\n }\n Object.keys(source).forEach((key) => {\n if (!(key in node)) {\n node[key] = source[key];\n } else if (isObject(node[key])) {\n node[key] = mergeDefaults(node[key], source[key]);\n }\n });\n delete node[\"__extends__\"];\n }\n if (isArray(node)) {\n for (let i = 0; i < node.length; i++) {\n const symbol = node[i];\n if (properties.has(symbol)) {\n node[i] = properties.get(symbol);\n }\n }\n } else {\n for (const [name, value] of Object.entries(node)) {\n if (properties.has(value)) {\n node[name] = properties.get(value);\n }\n }\n }\n });\n return deepClone(themeInstance);\n }\n static getDefaultColors() {\n return {\n fills: DEFAULT_FILLS,\n strokes: DEFAULT_STROKES\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: DEFAULT_FILLS.BLUE,\n stroke: DEFAULT_STROKES.BLUE,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: DEFAULT_FILLS.ORANGE,\n stroke: DEFAULT_STROKES.ORANGE,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: DEFAULT_FILLS.GRAY,\n stroke: DEFAULT_STROKES.GRAY,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n getTemplateParameters() {\n const extensions = /* @__PURE__ */ new Map();\n extensions.set(EXTENDS_AXES_DEFAULTS, _ChartTheme.getAxisDefaults());\n extensions.set(EXTENDS_AXES_LINE_DEFAULTS, _ChartTheme.getAxisDefaults().line);\n extensions.set(EXTENDS_AXES_TICK_DEFAULTS, _ChartTheme.getAxisDefaults().tick);\n extensions.set(EXTENDS_AXES_GRID_LINE_DEFAULTS, _ChartTheme.getAxisDefaults().gridLine);\n extensions.set(EXTENDS_SERIES_DEFAULTS, _ChartTheme.getSeriesDefaults());\n extensions.set(EXTENDS_CARTESIAN_MARKER_DEFAULTS, _ChartTheme.getCartesianSeriesMarkerDefaults());\n const properties = /* @__PURE__ */ new Map();\n properties.set(IS_DARK_THEME, false);\n properties.set(DEFAULT_FONT_FAMILY, \"Verdana, sans-serif\");\n properties.set(DEFAULT_LABEL_COLOUR, \"rgb(70, 70, 70)\");\n properties.set(DEFAULT_INVERTED_LABEL_COLOUR, \"white\");\n properties.set(DEFAULT_MUTED_LABEL_COLOUR, \"rgb(140, 140, 140)\");\n properties.set(DEFAULT_AXIS_GRID_COLOUR, \"rgb(224,234,241)\");\n properties.set(DEFAULT_AXIS_LINE_COLOUR, \"rgb(195, 195, 195)\");\n properties.set(DEFAULT_CROSS_LINES_COLOUR, \"rgb(70, 70, 70)\");\n properties.set(DEFAULT_INSIDE_SERIES_LABEL_COLOUR, DEFAULT_BACKGROUND_FILL);\n properties.set(DEFAULT_BACKGROUND_COLOUR, DEFAULT_BACKGROUND_FILL);\n properties.set(DEFAULT_SHADOW_COLOUR, \"rgba(0, 0, 0, 0.5)\");\n properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n DEFAULT_FILLS.ORANGE,\n DEFAULT_FILLS.YELLOW,\n DEFAULT_FILLS.GREEN\n ]);\n properties.set(DEFAULT_HIERARCHY_FILLS, [\"#ffffff\", \"#e0e5ea\", \"#c1ccd5\", \"#a3b4c1\", \"#859cad\"]);\n properties.set(DEFAULT_HIERARCHY_STROKES, [\"#ffffff\", \"#c5cbd1\", \"#a4b1bd\", \"#8498a9\", \"#648096\"]);\n properties.set(DEFAULT_POLAR_SERIES_STROKE, DEFAULT_BACKGROUND_FILL);\n properties.set(DEFAULT_COLOURS, _ChartTheme.getDefaultColors());\n properties.set(DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS, _ChartTheme.getWaterfallSeriesDefaultPositiveColors());\n properties.set(DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS, _ChartTheme.getWaterfallSeriesDefaultNegativeColors());\n properties.set(DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS, _ChartTheme.getWaterfallSeriesDefaultTotalColors());\n properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _ChartTheme.getWaterfallSeriesDefaultTotalColors().stroke\n );\n properties.set(DEFAULT_ANNOTATION_STROKE, DEFAULT_STROKES.BLUE);\n properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, DEFAULT_FILLS.BLUE);\n properties.set(DEFAULT_ANNOTATION_HANDLE_FILL, DEFAULT_BACKGROUND_FILL);\n return {\n extensions,\n properties\n };\n }\n};\n_ChartTheme.cartesianAxisDefault = {\n [\"number\" /* NUMBER */]: _ChartTheme.getAxisDefaults({ line: { enabled: false } }),\n [\"log\" /* LOG */]: _ChartTheme.getAxisDefaults({ base: 10, line: { enabled: false } }),\n [\"category\" /* CATEGORY */]: _ChartTheme.getAxisDefaults({\n groupPaddingInner: 0.1,\n label: { autoRotate: true },\n gridLine: { enabled: false }\n }),\n [\"time\" /* TIME */]: _ChartTheme.getAxisDefaults({ gridLine: { enabled: false } }),\n \"grouped-category\": _ChartTheme.getAxisDefaults()\n};\nvar ChartTheme = _ChartTheme;\n\n// packages/ag-charts-community/src/chart/themes/darkTheme.ts\nvar DEFAULT_DARK_BACKGROUND_FILL = \"#192232\";\nvar DEFAULT_DARK_FILLS = {\n BLUE: \"#5090dc\",\n ORANGE: \"#ffa03a\",\n GREEN: \"#459d55\",\n CYAN: \"#34bfe1\",\n YELLOW: \"#e1cc00\",\n VIOLET: \"#9669cb\",\n GRAY: \"#b5b5b5\",\n MAGENTA: \"#bd5aa7\",\n BROWN: \"#8a6224\",\n RED: \"#ef5452\"\n};\nvar DEFAULT_DARK_STROKES = {\n BLUE: \"#74a8e6\",\n ORANGE: \"#ffbe70\",\n GREEN: \"#6cb176\",\n CYAN: \"#75d4ef\",\n YELLOW: \"#f6e559\",\n VIOLET: \"#aa86d8\",\n GRAY: \"#a1a1a1\",\n MAGENTA: \"#ce7ab9\",\n BROWN: \"#997b52\",\n RED: \"#ff7872\"\n};\nvar palette = {\n fills: Object.values(DEFAULT_DARK_FILLS),\n strokes: Object.values(DEFAULT_DARK_STROKES)\n};\nvar DarkTheme = class _DarkTheme extends ChartTheme {\n static getDefaultColors() {\n return {\n fills: DEFAULT_DARK_FILLS,\n strokes: DEFAULT_DARK_STROKES\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: DEFAULT_DARK_FILLS.BLUE,\n stroke: DEFAULT_DARK_STROKES.BLUE,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: DEFAULT_DARK_FILLS.ORANGE,\n stroke: DEFAULT_DARK_STROKES.ORANGE,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: DEFAULT_DARK_FILLS.GRAY,\n stroke: DEFAULT_DARK_STROKES.GRAY,\n label: {\n color: \"white\"\n }\n };\n }\n getTemplateParameters() {\n const result = super.getTemplateParameters();\n result.properties.set(IS_DARK_THEME, true);\n result.properties.set(DEFAULT_COLOURS, _DarkTheme.getDefaultColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n _DarkTheme.getWaterfallSeriesDefaultPositiveColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n _DarkTheme.getWaterfallSeriesDefaultNegativeColors()\n );\n result.properties.set(DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS, _DarkTheme.getWaterfallSeriesDefaultTotalColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _DarkTheme.getWaterfallSeriesDefaultTotalColors().stroke\n );\n result.properties.set(DEFAULT_POLAR_SERIES_STROKE, DEFAULT_DARK_BACKGROUND_FILL);\n result.properties.set(DEFAULT_LABEL_COLOUR, \"white\");\n result.properties.set(DEFAULT_MUTED_LABEL_COLOUR, \"#7D91A0\");\n result.properties.set(DEFAULT_AXIS_GRID_COLOUR, \"#545A6E\");\n result.properties.set(DEFAULT_CROSS_LINES_COLOUR, \"white\");\n result.properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n DEFAULT_DARK_FILLS.ORANGE,\n DEFAULT_DARK_FILLS.YELLOW,\n DEFAULT_DARK_FILLS.GREEN\n ]);\n result.properties.set(DEFAULT_HIERARCHY_FILLS, [\"#192834\", \"#253746\", \"#324859\", \"#3f596c\", \"#4d6a80\"]);\n result.properties.set(DEFAULT_HIERARCHY_STROKES, [\"#192834\", \"#3b5164\", \"#496275\", \"#577287\", \"#668399\"]);\n result.properties.set(DEFAULT_BACKGROUND_COLOUR, DEFAULT_DARK_BACKGROUND_FILL);\n result.properties.set(DEFAULT_INSIDE_SERIES_LABEL_COLOUR, DEFAULT_DARK_BACKGROUND_FILL);\n result.properties.set(DEFAULT_ANNOTATION_STROKE, DEFAULT_DARK_STROKES.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, DEFAULT_DARK_FILLS.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_HANDLE_FILL, DEFAULT_DARK_BACKGROUND_FILL);\n return result;\n }\n getPalette() {\n return palette;\n }\n constructor(options) {\n super(options);\n }\n};\n\n// packages/ag-charts-community/src/chart/themes/materialDark.ts\nvar MATERIAL_DARK_FILLS = {\n BLUE: \"#2196F3\",\n ORANGE: \"#FF9800\",\n GREEN: \"#4CAF50\",\n CYAN: \"#00BCD4\",\n YELLOW: \"#FFEB3B\",\n VIOLET: \"#7E57C2\",\n GRAY: \"#9E9E9E\",\n MAGENTA: \"#F06292\",\n BROWN: \"#795548\",\n RED: \"#F44336\"\n};\nvar MATERIAL_DARK_STROKES = {\n BLUE: \"#90CAF9\",\n ORANGE: \"#FFCC80\",\n GREEN: \"#A5D6A7\",\n CYAN: \"#80DEEA\",\n YELLOW: \"#FFF9C4\",\n VIOLET: \"#B39DDB\",\n GRAY: \"#E0E0E0\",\n MAGENTA: \"#F48FB1\",\n BROWN: \"#A1887F\",\n RED: \"#EF9A9A\"\n};\nvar palette2 = {\n fills: Object.values(MATERIAL_DARK_FILLS),\n strokes: Object.values(MATERIAL_DARK_STROKES)\n};\nvar MaterialDark = class _MaterialDark extends DarkTheme {\n static getDefaultColors() {\n return {\n fills: MATERIAL_DARK_FILLS,\n strokes: MATERIAL_DARK_STROKES\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: MATERIAL_DARK_FILLS.BLUE,\n stroke: MATERIAL_DARK_STROKES.BLUE,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: MATERIAL_DARK_FILLS.RED,\n stroke: MATERIAL_DARK_STROKES.RED,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: MATERIAL_DARK_FILLS.GRAY,\n stroke: MATERIAL_DARK_STROKES.GRAY,\n label: {\n color: \"white\"\n }\n };\n }\n getTemplateParameters() {\n const result = super.getTemplateParameters();\n result.properties.set(DEFAULT_COLOURS, _MaterialDark.getDefaultColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n _MaterialDark.getWaterfallSeriesDefaultPositiveColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n _MaterialDark.getWaterfallSeriesDefaultNegativeColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS,\n _MaterialDark.getWaterfallSeriesDefaultTotalColors()\n );\n result.properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n MATERIAL_DARK_FILLS.ORANGE,\n MATERIAL_DARK_FILLS.YELLOW,\n MATERIAL_DARK_FILLS.GREEN\n ]);\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _MaterialDark.getWaterfallSeriesDefaultTotalColors().stroke\n );\n result.properties.set(DEFAULT_ANNOTATION_STROKE, MATERIAL_DARK_STROKES.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, MATERIAL_DARK_FILLS.BLUE);\n return result;\n }\n getPalette() {\n return palette2;\n }\n};\n\n// packages/ag-charts-community/src/chart/themes/materialLight.ts\nvar MATERIAL_LIGHT_FILLS = {\n BLUE: \"#2196F3\",\n ORANGE: \"#FF9800\",\n GREEN: \"#4CAF50\",\n CYAN: \"#00BCD4\",\n YELLOW: \"#FFEB3B\",\n VIOLET: \"#7E57C2\",\n GRAY: \"#9E9E9E\",\n MAGENTA: \"#F06292\",\n BROWN: \"#795548\",\n RED: \"#F44336\"\n};\nvar MATERIAL_LIGHT_STROKES = {\n BLUE: \"#1565C0\",\n ORANGE: \"#E65100\",\n GREEN: \"#2E7D32\",\n CYAN: \"#00838F\",\n YELLOW: \"#F9A825\",\n VIOLET: \"#4527A0\",\n GRAY: \"#616161\",\n MAGENTA: \"#C2185B\",\n BROWN: \"#4E342E\",\n RED: \"#B71C1C\"\n};\nvar palette3 = {\n fills: Object.values(MATERIAL_LIGHT_FILLS),\n strokes: Object.values(MATERIAL_LIGHT_STROKES)\n};\nvar MaterialLight = class _MaterialLight extends ChartTheme {\n static getDefaultColors() {\n return {\n fills: MATERIAL_LIGHT_FILLS,\n strokes: MATERIAL_LIGHT_STROKES\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: MATERIAL_LIGHT_FILLS.BLUE,\n stroke: MATERIAL_LIGHT_STROKES.BLUE,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: MATERIAL_LIGHT_FILLS.RED,\n stroke: MATERIAL_LIGHT_STROKES.RED,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: MATERIAL_LIGHT_FILLS.GRAY,\n stroke: MATERIAL_LIGHT_STROKES.GRAY,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n getTemplateParameters() {\n const result = super.getTemplateParameters();\n result.properties.set(DEFAULT_COLOURS, _MaterialLight.getDefaultColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n _MaterialLight.getWaterfallSeriesDefaultPositiveColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n _MaterialLight.getWaterfallSeriesDefaultNegativeColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS,\n _MaterialLight.getWaterfallSeriesDefaultTotalColors()\n );\n result.properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n MATERIAL_LIGHT_FILLS.ORANGE,\n MATERIAL_LIGHT_FILLS.YELLOW,\n MATERIAL_LIGHT_FILLS.GREEN\n ]);\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _MaterialLight.getWaterfallSeriesDefaultTotalColors().stroke\n );\n result.properties.set(DEFAULT_ANNOTATION_STROKE, MATERIAL_LIGHT_STROKES.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, MATERIAL_LIGHT_FILLS.BLUE);\n return result;\n }\n getPalette() {\n return palette3;\n }\n};\n\n// packages/ag-charts-community/src/chart/themes/polychromaDark.ts\nvar POLYCHROMA_DARK_FILLS = {\n BLUE: \"#436ff4\",\n PURPLE: \"#9a7bff\",\n MAGENTA: \"#d165d2\",\n PINK: \"#f0598b\",\n RED: \"#f47348\",\n ORANGE: \"#f2a602\",\n YELLOW: \"#e9e201\",\n GREEN: \"#21b448\",\n CYAN: \"#00b9a2\",\n MODERATE_BLUE: \"#00aee4\"\n};\nvar POLYCHROMA_DARK_STROKES = {\n BLUE: \"#6698ff\",\n PURPLE: \"#c0a3ff\",\n MAGENTA: \"#fc8dfc\",\n PINK: \"#ff82b1\",\n RED: \"#ff9b70\",\n ORANGE: \"#ffcf4e\",\n YELLOW: \"#ffff58\",\n GREEN: \"#58dd70\",\n CYAN: \"#51e2c9\",\n MODERATE_BLUE: \"#4fd7ff\"\n};\nvar POLYCHROMA_DARK_FILL_GRAY = \"#bbbbbb\";\nvar POLYCHROMA_DARK_STROKE_GRAY = \"#eeeeee\";\nvar palette4 = {\n fills: Object.values(POLYCHROMA_DARK_FILLS),\n strokes: Object.values(POLYCHROMA_DARK_STROKES)\n};\nvar PolychromaDark = class _PolychromaDark extends DarkTheme {\n static getDefaultColors() {\n return {\n fills: POLYCHROMA_DARK_FILLS,\n strokes: POLYCHROMA_DARK_STROKES\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: POLYCHROMA_DARK_FILLS.BLUE,\n stroke: POLYCHROMA_DARK_STROKES.BLUE,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: POLYCHROMA_DARK_FILLS.RED,\n stroke: POLYCHROMA_DARK_STROKES.RED,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: POLYCHROMA_DARK_FILL_GRAY,\n stroke: POLYCHROMA_DARK_STROKE_GRAY,\n label: {\n color: \"white\"\n }\n };\n }\n getTemplateParameters() {\n const result = super.getTemplateParameters();\n result.properties.set(DEFAULT_COLOURS, _PolychromaDark.getDefaultColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n _PolychromaDark.getWaterfallSeriesDefaultPositiveColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n _PolychromaDark.getWaterfallSeriesDefaultNegativeColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS,\n _PolychromaDark.getWaterfallSeriesDefaultTotalColors()\n );\n result.properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n POLYCHROMA_DARK_FILLS.BLUE,\n POLYCHROMA_DARK_FILLS.RED\n ]);\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _PolychromaDark.getWaterfallSeriesDefaultTotalColors().stroke\n );\n result.properties.set(DEFAULT_ANNOTATION_STROKE, POLYCHROMA_DARK_STROKES.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, POLYCHROMA_DARK_FILLS.BLUE);\n return result;\n }\n getPalette() {\n return palette4;\n }\n};\n\n// packages/ag-charts-community/src/chart/themes/polychromaLight.ts\nvar POLYCHROMA_LIGHT_FILLS = {\n BLUE: \"#436ff4\",\n PURPLE: \"#9a7bff\",\n MAGENTA: \"#d165d2\",\n PINK: \"#f0598b\",\n RED: \"#f47348\",\n ORANGE: \"#f2a602\",\n YELLOW: \"#e9e201\",\n GREEN: \"#21b448\",\n CYAN: \"#00b9a2\",\n MODERATE_BLUE: \"#00aee4\"\n};\nvar POLYCHROMA_LIGHT_STROKES = {\n BLUE: \"#2346c9\",\n PURPLE: \"#7653d4\",\n MAGENTA: \"#a73da9\",\n PINK: \"#c32d66\",\n RED: \"#c84b1c\",\n ORANGE: \"#c87f00\",\n YELLOW: \"#c1b900\",\n GREEN: \"#008c1c\",\n CYAN: \"#00927c\",\n MODERATE_BLUE: \"#0087bb\"\n};\nvar POLYCHROMA_LIGHT_FILL_GRAY = \"#bbbbbb\";\nvar POLYCHROMA_LIGHT_STROKE_GRAY = \"#888888\";\nvar palette5 = {\n fills: Object.values(POLYCHROMA_LIGHT_FILLS),\n strokes: Object.values(POLYCHROMA_LIGHT_STROKES)\n};\nvar PolychromaLight = class _PolychromaLight extends ChartTheme {\n static getDefaultColors() {\n return {\n fills: POLYCHROMA_LIGHT_FILLS,\n strokes: POLYCHROMA_LIGHT_STROKES\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: POLYCHROMA_LIGHT_FILLS.BLUE,\n stroke: POLYCHROMA_LIGHT_STROKES.BLUE,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: POLYCHROMA_LIGHT_FILLS.RED,\n stroke: POLYCHROMA_LIGHT_STROKES.RED,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: POLYCHROMA_LIGHT_FILL_GRAY,\n stroke: POLYCHROMA_LIGHT_STROKE_GRAY,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n getTemplateParameters() {\n const result = super.getTemplateParameters();\n result.properties.set(DEFAULT_COLOURS, _PolychromaLight.getDefaultColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n _PolychromaLight.getWaterfallSeriesDefaultPositiveColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n _PolychromaLight.getWaterfallSeriesDefaultNegativeColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS,\n _PolychromaLight.getWaterfallSeriesDefaultTotalColors()\n );\n result.properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n POLYCHROMA_LIGHT_FILLS.BLUE,\n POLYCHROMA_LIGHT_FILLS.RED\n ]);\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _PolychromaLight.getWaterfallSeriesDefaultTotalColors().stroke\n );\n result.properties.set(DEFAULT_ANNOTATION_STROKE, POLYCHROMA_LIGHT_STROKES.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, POLYCHROMA_LIGHT_FILLS.BLUE);\n return result;\n }\n getPalette() {\n return palette5;\n }\n};\n\n// packages/ag-charts-community/src/chart/themes/sheetsDark.ts\nvar SHEETS_DARK_FILLS = {\n BLUE: \"#4472C4\",\n ORANGE: \"#ED7D31\",\n GRAY: \"#A5A5A5\",\n YELLOW: \"#FFC000\",\n MODERATE_BLUE: \"#5B9BD5\",\n GREEN: \"#70AD47\",\n DARK_GRAY: \"#7B7B7B\",\n DARK_BLUE: \"#264478\",\n VERY_DARK_GRAY: \"#636363\",\n DARK_YELLOW: \"#997300\"\n};\nvar SHEETS_DARK_STROKES = {\n BLUE: \"#6899ee\",\n ORANGE: \"#ffa55d\",\n GRAY: \"#cdcdcd\",\n YELLOW: \"#ffea53\",\n MODERATE_BLUE: \"#82c3ff\",\n GREEN: \"#96d56f\",\n DARK_GRAY: \"#a1a1a1\",\n DARK_BLUE: \"#47689f\",\n VERY_DARK_GRAY: \"#878787\",\n DARK_YELLOW: \"#c0993d\"\n};\nvar palette6 = {\n fills: Object.values(SHEETS_DARK_FILLS),\n strokes: Object.values(SHEETS_DARK_STROKES)\n};\nvar SheetsDark = class _SheetsDark extends DarkTheme {\n static getDefaultColors() {\n return {\n fills: __spreadProps(__spreadValues({}, SHEETS_DARK_FILLS), { RED: SHEETS_DARK_FILLS.ORANGE }),\n strokes: __spreadProps(__spreadValues({}, SHEETS_DARK_STROKES), { RED: SHEETS_DARK_STROKES.ORANGE })\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: SHEETS_DARK_FILLS.BLUE,\n stroke: SHEETS_DARK_STROKES.BLUE,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: SHEETS_DARK_FILLS.ORANGE,\n stroke: SHEETS_DARK_STROKES.ORANGE,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: SHEETS_DARK_FILLS.GRAY,\n stroke: SHEETS_DARK_STROKES.GRAY,\n label: {\n color: \"white\"\n }\n };\n }\n getTemplateParameters() {\n const result = super.getTemplateParameters();\n result.properties.set(DEFAULT_COLOURS, _SheetsDark.getDefaultColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n _SheetsDark.getWaterfallSeriesDefaultPositiveColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n _SheetsDark.getWaterfallSeriesDefaultNegativeColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS,\n _SheetsDark.getWaterfallSeriesDefaultTotalColors()\n );\n result.properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n SHEETS_DARK_FILLS.ORANGE,\n SHEETS_DARK_FILLS.YELLOW,\n SHEETS_DARK_FILLS.GREEN\n ]);\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _SheetsDark.getWaterfallSeriesDefaultTotalColors().stroke\n );\n result.properties.set(DEFAULT_ANNOTATION_STROKE, SHEETS_DARK_STROKES.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, SHEETS_DARK_FILLS.BLUE);\n return result;\n }\n getPalette() {\n return palette6;\n }\n};\n\n// packages/ag-charts-community/src/chart/themes/sheetsLight.ts\nvar SHEETS_LIGHT_FILLS = {\n BLUE: \"#5281d5\",\n ORANGE: \"#ff8d44\",\n GRAY: \"#b5b5b5\",\n YELLOW: \"#ffd02f\",\n MODERATE_BLUE: \"#6aabe6\",\n GREEN: \"#7fbd57\",\n DARK_GRAY: \"#8a8a8a\",\n DARK_BLUE: \"#335287\",\n VERY_DARK_GRAY: \"#717171\",\n DARK_YELLOW: \"#a98220\"\n};\nvar SHEETS_LIGHT_STROKES = {\n BLUE: \"#214d9b\",\n ORANGE: \"#c25600\",\n GRAY: \"#7f7f7f\",\n YELLOW: \"#d59800\",\n MODERATE_BLUE: \"#3575ac\",\n GREEN: \"#4b861a\",\n DARK_GRAY: \"#575757\",\n DARK_BLUE: \"#062253\",\n VERY_DARK_GRAY: \"#414141\",\n DARK_YELLOW: \"#734f00\"\n};\nvar palette7 = {\n fills: Object.values(SHEETS_LIGHT_FILLS),\n strokes: Object.values(SHEETS_LIGHT_STROKES)\n};\nvar SheetsLight = class _SheetsLight extends ChartTheme {\n static getDefaultColors() {\n return {\n fills: __spreadProps(__spreadValues({}, SHEETS_LIGHT_FILLS), { RED: SHEETS_LIGHT_FILLS.ORANGE }),\n strokes: __spreadProps(__spreadValues({}, SHEETS_LIGHT_STROKES), { RED: SHEETS_LIGHT_STROKES.ORANGE })\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: SHEETS_LIGHT_FILLS.BLUE,\n stroke: SHEETS_LIGHT_STROKES.BLUE,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: SHEETS_LIGHT_FILLS.ORANGE,\n stroke: SHEETS_LIGHT_STROKES.ORANGE,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: SHEETS_LIGHT_FILLS.GRAY,\n stroke: SHEETS_LIGHT_STROKES.GRAY,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n getTemplateParameters() {\n const result = super.getTemplateParameters();\n result.properties.set(DEFAULT_COLOURS, _SheetsLight.getDefaultColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n _SheetsLight.getWaterfallSeriesDefaultPositiveColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n _SheetsLight.getWaterfallSeriesDefaultNegativeColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS,\n _SheetsLight.getWaterfallSeriesDefaultTotalColors()\n );\n result.properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n SHEETS_LIGHT_FILLS.ORANGE,\n SHEETS_LIGHT_FILLS.YELLOW,\n SHEETS_LIGHT_FILLS.GREEN\n ]);\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _SheetsLight.getWaterfallSeriesDefaultTotalColors().stroke\n );\n result.properties.set(DEFAULT_ANNOTATION_STROKE, SHEETS_LIGHT_STROKES.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, SHEETS_LIGHT_FILLS.BLUE);\n return result;\n }\n getPalette() {\n return palette7;\n }\n};\n\n// packages/ag-charts-community/src/chart/themes/vividDark.ts\nvar VIVID_DARK_FILLS = {\n BLUE: \"#0083ff\",\n ORANGE: \"#ff6600\",\n GREEN: \"#00af00\",\n CYAN: \"#00ccff\",\n YELLOW: \"#f7c700\",\n VIOLET: \"#ac26ff\",\n GRAY: \"#a7a7b7\",\n MAGENTA: \"#e800c5\",\n BROWN: \"#b54300\",\n RED: \"#ff0000\"\n};\nvar VIVID_DARK_STROKES = {\n BLUE: \"#67b7ff\",\n ORANGE: \"#ffc24d\",\n GREEN: \"#5cc86f\",\n CYAN: \"#54ebff\",\n VIOLET: \"#c18aff\",\n YELLOW: \"#fff653\",\n GRAY: \"#aeaeae\",\n MAGENTA: \"#f078d4\",\n BROWN: \"#ba8438\",\n RED: \"#ff726e\"\n};\nvar palette8 = {\n fills: Object.values(VIVID_DARK_FILLS),\n strokes: Object.values(VIVID_DARK_STROKES)\n};\nvar VividDark = class _VividDark extends DarkTheme {\n static getDefaultColors() {\n return {\n fills: VIVID_DARK_FILLS,\n strokes: VIVID_DARK_STROKES\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: VIVID_DARK_FILLS.BLUE,\n stroke: VIVID_DARK_STROKES.BLUE,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: VIVID_DARK_FILLS.ORANGE,\n stroke: VIVID_DARK_STROKES.ORANGE,\n label: {\n color: \"white\"\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: VIVID_DARK_FILLS.GRAY,\n stroke: VIVID_DARK_STROKES.GRAY,\n label: {\n color: \"white\"\n }\n };\n }\n getTemplateParameters() {\n const result = super.getTemplateParameters();\n result.properties.set(DEFAULT_COLOURS, _VividDark.getDefaultColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n _VividDark.getWaterfallSeriesDefaultPositiveColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n _VividDark.getWaterfallSeriesDefaultNegativeColors()\n );\n result.properties.set(DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS, _VividDark.getWaterfallSeriesDefaultTotalColors());\n result.properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n VIVID_DARK_FILLS.ORANGE,\n VIVID_DARK_FILLS.YELLOW,\n VIVID_DARK_FILLS.GREEN\n ]);\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _VividDark.getWaterfallSeriesDefaultTotalColors().stroke\n );\n result.properties.set(DEFAULT_ANNOTATION_STROKE, VIVID_DARK_STROKES.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, VIVID_DARK_FILLS.BLUE);\n return result;\n }\n getPalette() {\n return palette8;\n }\n};\n\n// packages/ag-charts-community/src/chart/themes/vividLight.ts\nvar VIVID_FILLS = {\n BLUE: \"#0083ff\",\n ORANGE: \"#ff6600\",\n GREEN: \"#00af00\",\n CYAN: \"#00ccff\",\n YELLOW: \"#f7c700\",\n VIOLET: \"#ac26ff\",\n GRAY: \"#a7a7b7\",\n MAGENTA: \"#e800c5\",\n BROWN: \"#b54300\",\n RED: \"#ff0000\"\n};\nvar VIVID_STROKES = {\n BLUE: \"#0f68c0\",\n ORANGE: \"#d47100\",\n GREEN: \"#007922\",\n CYAN: \"#009ac2\",\n VIOLET: \"#bca400\",\n YELLOW: \"#753cac\",\n GRAY: \"#646464\",\n MAGENTA: \"#9b2685\",\n BROWN: \"#6c3b00\",\n RED: \"#cb0021\"\n};\nvar palette9 = {\n fills: Object.values(VIVID_FILLS),\n strokes: Object.values(VIVID_STROKES)\n};\nvar VividLight = class _VividLight extends ChartTheme {\n static getDefaultColors() {\n return {\n fills: VIVID_FILLS,\n strokes: VIVID_STROKES\n };\n }\n static getWaterfallSeriesDefaultPositiveColors() {\n return {\n fill: VIVID_FILLS.BLUE,\n stroke: VIVID_STROKES.BLUE,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultNegativeColors() {\n return {\n fill: VIVID_FILLS.ORANGE,\n stroke: VIVID_STROKES.ORANGE,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n static getWaterfallSeriesDefaultTotalColors() {\n return {\n fill: VIVID_FILLS.GRAY,\n stroke: VIVID_STROKES.GRAY,\n label: {\n color: DEFAULT_LABEL_COLOUR\n }\n };\n }\n getTemplateParameters() {\n const result = super.getTemplateParameters();\n result.properties.set(DEFAULT_COLOURS, _VividLight.getDefaultColors());\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n _VividLight.getWaterfallSeriesDefaultPositiveColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n _VividLight.getWaterfallSeriesDefaultNegativeColors()\n );\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS,\n _VividLight.getWaterfallSeriesDefaultTotalColors()\n );\n result.properties.set(DEFAULT_DIVERGING_SERIES_COLOUR_RANGE, [\n VIVID_FILLS.ORANGE,\n VIVID_FILLS.YELLOW,\n VIVID_FILLS.GREEN\n ]);\n result.properties.set(\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n _VividLight.getWaterfallSeriesDefaultTotalColors().stroke\n );\n result.properties.set(DEFAULT_ANNOTATION_STROKE, VIVID_STROKES.BLUE);\n result.properties.set(DEFAULT_ANNOTATION_BACKGROUND_FILL, VIVID_FILLS.BLUE);\n return result;\n }\n getPalette() {\n return palette9;\n }\n};\n\n// packages/ag-charts-community/src/chart/mapping/themes.ts\nvar lightTheme = () => new ChartTheme();\nvar darkTheme = () => new DarkTheme();\nvar lightThemes = {\n undefined: lightTheme,\n null: lightTheme,\n \"ag-default\": lightTheme,\n \"ag-sheets\": () => new SheetsLight(),\n \"ag-polychroma\": () => new PolychromaLight(),\n \"ag-vivid\": () => new VividLight(),\n \"ag-material\": () => new MaterialLight()\n};\nvar darkThemes = {\n undefined: darkTheme,\n null: darkTheme,\n \"ag-default-dark\": darkTheme,\n \"ag-sheets-dark\": () => new SheetsDark(),\n \"ag-polychroma-dark\": () => new PolychromaDark(),\n \"ag-vivid-dark\": () => new VividDark(),\n \"ag-material-dark\": () => new MaterialDark()\n};\nvar themes = __spreadValues(__spreadValues({}, darkThemes), lightThemes);\nfunction validateChartThemeObject(unknownObject) {\n if (unknownObject === null) {\n return;\n }\n let valid = true;\n const { baseTheme, palette: palette10, overrides } = unknownObject;\n if (baseTheme !== void 0 && typeof baseTheme !== \"string\" && typeof baseTheme !== \"object\") {\n Logger.warn(`invalid theme.baseTheme type ${typeof baseTheme}, expected (string | object).`);\n valid = false;\n }\n if (overrides !== void 0 && typeof overrides !== \"object\") {\n Logger.warn(`invalid theme.overrides type ${typeof overrides}, expected object.`);\n valid = false;\n }\n if (typeof palette10 === \"object\") {\n if (palette10 !== null) {\n const { fills, strokes } = palette10;\n if (fills !== void 0 && !Array.isArray(fills)) {\n Logger.warn(`theme.overrides.fills must be undefined or an array`);\n valid = false;\n }\n if (strokes !== void 0 && !Array.isArray(strokes)) {\n Logger.warn(`theme.overrides.strokes must be undefined or an array`);\n valid = false;\n }\n }\n } else if (palette10 !== void 0) {\n Logger.warn(`invalid theme.palette type ${typeof palette10}, expected object.`);\n valid = false;\n }\n if (valid) {\n return unknownObject;\n }\n}\nfunction validateChartTheme(value) {\n if (value === void 0 || typeof value === \"string\" || value instanceof ChartTheme) {\n return value;\n }\n if (typeof value === \"object\") {\n return validateChartThemeObject(value);\n }\n Logger.warn(`invalid theme value type ${typeof value}, expected object or string.`);\n}\nfunction getChartTheme(unvalidatedValue) {\n let value = validateChartTheme(unvalidatedValue);\n if (value instanceof ChartTheme) {\n return value;\n }\n if (value == null || typeof value === \"string\") {\n const stockTheme = themes[value];\n if (stockTheme) {\n return stockTheme();\n }\n Logger.warnOnce(`the theme [${value}] is invalid, using [ag-default] instead.`);\n return lightTheme();\n }\n const overrides = [];\n let palette10;\n while (typeof value === \"object\") {\n overrides.push(value.overrides);\n palette10 != null ? palette10 : palette10 = value.palette;\n value = value.baseTheme;\n }\n const flattenedTheme = {\n baseTheme: value,\n overrides: mergeDefaults(...overrides),\n palette: palette10\n };\n const baseTheme = flattenedTheme.baseTheme ? getChartTheme(flattenedTheme.baseTheme) : lightTheme();\n return new baseTheme.constructor(flattenedTheme);\n}\n\n// packages/ag-charts-community/src/util/array.ts\nfunction extent(values) {\n if (values.length === 0) {\n return;\n }\n let min = Infinity;\n let max = -Infinity;\n for (let n of values) {\n if (n instanceof Date) {\n n = n.getTime();\n }\n if (typeof n !== \"number\") {\n continue;\n }\n if (n < min) {\n min = n;\n }\n if (n > max) {\n max = n;\n }\n }\n const result = [min, max];\n if (result.every(isFinite)) {\n return result;\n }\n}\nfunction normalisedExtent(d, min, max) {\n return normalisedExtentWithMetadata(d, min, max).extent;\n}\nfunction normalisedExtentWithMetadata(d, min, max) {\n var _a;\n let clipped = false;\n if (d.length > 2) {\n d = (_a = extent(d)) != null ? _a : [NaN, NaN];\n }\n if (!isNaN(min)) {\n clipped || (clipped = min > d[0]);\n d = [min, d[1]];\n }\n if (!isNaN(max)) {\n clipped || (clipped = max < d[1]);\n d = [d[0], max];\n }\n if (d[0] > d[1]) {\n d = [];\n }\n return { extent: d, clipped };\n}\nfunction arraysEqual(a, b) {\n if (a == null || b == null || a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (Array.isArray(a[i]) && Array.isArray(b[i])) {\n if (!arraysEqual(a[i], b[i])) {\n return false;\n }\n } else if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\nfunction toArray(value) {\n if (typeof value === \"undefined\") {\n return [];\n }\n return Array.isArray(value) ? value : [value];\n}\nfunction unique(array) {\n return Array.from(new Set(array));\n}\nfunction groupBy(array, iteratee) {\n return array.reduce((result, item) => {\n var _a;\n const groupKey = iteratee(item);\n (_a = result[groupKey]) != null ? _a : result[groupKey] = [];\n result[groupKey].push(item);\n return result;\n }, {});\n}\nfunction circularSliceArray(data, size, offset4 = 0) {\n if (data.length === 0) {\n return [];\n }\n const result = [];\n for (let i = 0; i < size; i++) {\n result.push(data.at((i + offset4) % data.length));\n }\n return result;\n}\nfunction bifurcate(isLeft, array) {\n return array.reduce(\n ([left, right], value) => isLeft(value) ? [[...left, value], right] : [left, [...right, value]],\n [[], []]\n );\n}\nfunction* mapIterable(src, predicate) {\n for (const e of src) {\n yield predicate(e);\n }\n}\nfunction constStringsIncludes(array, value) {\n const casting = array;\n return casting.includes(value);\n}\nfunction isInStringUnion(unionValues, value) {\n return constStringsIncludes(unionValues, value);\n}\nfunction allInStringUnion(unionValues, values) {\n return !values.some((v) => !isInStringUnion(unionValues, v));\n}\n\n// packages/ag-charts-community/src/util/dom.ts\nvar verifiedGlobals = {};\nvar injectCache = /* @__PURE__ */ new WeakMap();\nif (typeof window !== \"undefined\") {\n verifiedGlobals.window = window;\n} else if (typeof global !== \"undefined\") {\n verifiedGlobals.window = global.window;\n}\nif (typeof document !== \"undefined\") {\n verifiedGlobals.document = document;\n} else if (typeof global !== \"undefined\") {\n verifiedGlobals.document = global.document;\n}\nfunction getDocument(propertyName) {\n var _a;\n return propertyName ? (_a = verifiedGlobals.document) == null ? void 0 : _a[propertyName] : verifiedGlobals.document;\n}\nfunction getWindow(propertyName) {\n var _a;\n return propertyName ? (_a = verifiedGlobals.window) == null ? void 0 : _a[propertyName] : verifiedGlobals.window;\n}\nfunction createElement(tagName, className, style) {\n const element2 = getDocument().createElement(tagName);\n if (typeof className === \"object\") {\n style = className;\n className = void 0;\n }\n if (className) {\n element2.classList.add(className);\n }\n if (style) {\n Object.assign(element2.style, style);\n }\n return element2;\n}\nfunction downloadUrl(dataUrl, fileName) {\n const { body } = getDocument();\n const element2 = createElement(\"a\", { display: \"none\" });\n element2.href = dataUrl;\n element2.download = fileName;\n body.appendChild(element2);\n element2.click();\n setTimeout(() => body.removeChild(element2));\n}\nfunction injectStyle(cssStyle, uniqueId) {\n var _a, _b;\n const document2 = getDocument();\n if (uniqueId && ((_a = injectCache.get(document2)) == null ? void 0 : _a.has(uniqueId)))\n return;\n const styleElement = createElement(\"style\");\n styleElement.innerHTML = cssStyle;\n document2.head.insertBefore(styleElement, document2.head.querySelector(\"style\"));\n if (uniqueId && !injectCache.has(document2)) {\n injectCache.set(document2, /* @__PURE__ */ new Set([uniqueId]));\n } else if (uniqueId) {\n (_b = injectCache.get(document2)) == null ? void 0 : _b.add(uniqueId);\n }\n}\nfunction setDocument(document2) {\n verifiedGlobals.document = document2;\n}\nfunction setWindow(window2) {\n verifiedGlobals.window = window2;\n}\n\n// packages/ag-charts-community/src/util/debug.ts\nvar LONG_TIME_PERIOD_THRESHOLD = 2e3;\nvar timeOfLastLog = Date.now();\nvar logTimeGap = () => {\n const timeSinceLastLog = Date.now() - timeOfLastLog;\n if (timeSinceLastLog > LONG_TIME_PERIOD_THRESHOLD) {\n const prettyDuration = (Math.floor(timeSinceLastLog / 100) / 10).toFixed(1);\n Logger.log(`**** ${prettyDuration}s since last log message ****`);\n }\n timeOfLastLog = Date.now();\n};\nvar Debug = {\n create(...debugSelectors) {\n const resultFn = (...logContent) => {\n if (Debug.check(...debugSelectors)) {\n if (typeof logContent[0] === \"function\") {\n logContent = toArray(logContent[0]());\n }\n logTimeGap();\n Logger.log(...logContent);\n }\n };\n return Object.assign(resultFn, { check: () => Debug.check(...debugSelectors) });\n },\n check(...debugSelectors) {\n if (debugSelectors.length === 0) {\n debugSelectors.push(true);\n }\n const chartDebug = toArray(getWindow(\"agChartsDebug\"));\n return chartDebug.some((selector) => debugSelectors.includes(selector));\n }\n};\n\n// packages/ag-charts-community/src/module/optionsModule.ts\nvar unthemedSeries = /* @__PURE__ */ new Set([\"map-shape-background\", \"map-line-background\"]);\nvar ChartOptions = class {\n constructor(userOptions, specialOverrides) {\n var _b, _c, _d;\n const cloneOptions = { shallow: [\"data\"] };\n const options = deepClone(userOptions, cloneOptions);\n const chartType2 = this.optionsType(options);\n this.sanityCheckAndCleanup(options);\n this.userOptions = options;\n this.activeTheme = getChartTheme(options.theme);\n this.defaultAxes = this.getDefaultAxes(options);\n this.specialOverrides = this.specialOverridesDefaults(__spreadValues({}, specialOverrides));\n const _a = this.getSeriesThemeConfig(chartType2), {\n axes: axesThemes = {},\n annotations: annotationsThemes = {},\n series: _\n } = _a, themeDefaults = __objRest(_a, [\n \"axes\",\n \"annotations\",\n \"series\"\n ]);\n this.processedOptions = deepClone(\n mergeDefaults(this.userOptions, themeDefaults, this.defaultAxes),\n cloneOptions\n );\n this.processAxesOptions(this.processedOptions, axesThemes);\n this.processSeriesOptions(this.processedOptions);\n this.processMiniChartSeriesOptions(this.processedOptions);\n this.processAnnotationsOptions(this.processedOptions, annotationsThemes);\n if ((isAgCartesianChartOptions(this.processedOptions) || isAgPolarChartOptionsWithSeriesBasedLegend(this.processedOptions)) && ((_b = this.processedOptions.legend) == null ? void 0 : _b.enabled) == null) {\n (_d = (_c = this.processedOptions).legend) != null ? _d : _c.legend = {};\n this.processedOptions.legend.enabled = this.processedOptions.series.length > 1;\n }\n this.enableConfiguredOptions(this.processedOptions);\n if (!enterpriseModule.isEnterprise) {\n removeUsedEnterpriseOptions(this.processedOptions);\n }\n }\n getOptions() {\n var _a;\n return (_a = this.processedOptions) != null ? _a : {};\n }\n diffOptions(options) {\n return jsonDiff(options, this.processedOptions);\n }\n getSeriesThemeConfig(seriesType) {\n var _a, _b;\n return deepClone((_b = (_a = this.activeTheme) == null ? void 0 : _a.config[seriesType]) != null ? _b : {});\n }\n getDefaultAxes(options) {\n const optionsType2 = this.optionsType(options);\n const axesDefaults = seriesRegistry.cloneDefaultAxes(optionsType2);\n if (seriesRegistry.isDefaultAxisSwapNeeded(options)) {\n this.swapAxesPosition(axesDefaults);\n }\n return axesDefaults;\n }\n optionsType(options) {\n var _a, _b, _c;\n return (_c = (_b = (_a = options.series) == null ? void 0 : _a[0]) == null ? void 0 : _b.type) != null ? _c : \"line\";\n }\n sanityCheckAndCleanup(options) {\n var _a;\n this.deprecationWarnings(options);\n this.axesTypeIntegrity(options);\n this.seriesTypeIntegrity(options);\n this.soloSeriesIntegrity(options);\n this.removeDisabledOptions(options);\n this.removeLeftoverSymbols(options);\n if (((_a = options.series) == null ? void 0 : _a.some((s) => s.type === \"bullet\")) && options.sync != null && options.sync.enabled !== false) {\n Logger.warnOnce(\"bullet series cannot be synced, disabling synchronization.\");\n delete options.sync;\n }\n }\n swapAxesPosition(options) {\n var _a;\n if (isAgCartesianChartOptions(options)) {\n const [axis0, axis1] = (_a = options.axes) != null ? _a : [];\n options.axes = [\n __spreadProps(__spreadValues({}, axis0), { position: axis1.position }),\n __spreadProps(__spreadValues({}, axis1), { position: axis0.position })\n ];\n }\n }\n processAxesOptions(options, axesThemes) {\n if (!(\"axes\" in options))\n return;\n options.axes = options.axes.map((axis) => {\n var _a, _c, _d;\n const _b = mergeDefaults(\n (_a = axesThemes[axis.type]) == null ? void 0 : _a[axis.position],\n axesThemes[axis.type]\n ), { crossLines: crossLinesTheme } = _b, axisTheme = __objRest(_b, [\"crossLines\"]);\n if (axis.crossLines) {\n axis.crossLines = mergeArrayDefaults(axis.crossLines, crossLinesTheme);\n }\n const gridLineStyle = (_c = axisTheme.gridLine) == null ? void 0 : _c.style;\n if (((_d = axis.gridLine) == null ? void 0 : _d.style) && (gridLineStyle == null ? void 0 : gridLineStyle.length)) {\n axis.gridLine.style = axis.gridLine.style.map(\n (style, index) => style.stroke != null || style.lineDash != null ? mergeDefaults(style, gridLineStyle.at(index % gridLineStyle.length)) : style\n );\n }\n const _e = mergeDefaults(axis, axisTheme), { top: _1, right: _2, bottom: _3, left: _4 } = _e, axisOptions = __objRest(_e, [\"top\", \"right\", \"bottom\", \"left\"]);\n return axisOptions;\n });\n }\n processSeriesOptions(options) {\n const defaultSeriesType = this.getDefaultSeriesType(options);\n const defaultTooltipPosition = this.getTooltipPositionDefaults(options);\n const userPalette = Boolean(isObject(options.theme) && options.theme.palette);\n const paletteOptions = {\n colourIndex: 0,\n userPalette\n };\n const processedSeries = options.series.map((series) => {\n var _a, _b;\n (_a = series.type) != null ? _a : series.type = defaultSeriesType;\n const _c = (_b = this.getSeriesThemeConfig(series.type).series) != null ? _b : {}, { innerLabels: innerLabelsTheme } = _c, seriesTheme = __objRest(_c, [\"innerLabels\"]);\n const seriesPaletteOptions = unthemedSeries.has(series.type) ? { colourIndex: 0, userPalette } : paletteOptions;\n const palette10 = this.getSeriesPalette(series.type, seriesPaletteOptions);\n const seriesOptions = mergeDefaults(\n this.getSeriesGroupingOptions(series),\n series,\n defaultTooltipPosition,\n seriesTheme,\n palette10\n );\n if (seriesOptions.innerLabels) {\n seriesOptions.innerLabels = mergeArrayDefaults(seriesOptions.innerLabels, innerLabelsTheme);\n }\n return this.activeTheme.templateTheme(seriesOptions);\n });\n options.series = this.setSeriesGroupingOptions(processedSeries);\n }\n processMiniChartSeriesOptions(options) {\n var _a, _b;\n let miniChartSeries = (_b = (_a = options.navigator) == null ? void 0 : _a.miniChart) == null ? void 0 : _b.series;\n if (miniChartSeries == null)\n return;\n const paletteOptions = {\n colourIndex: 0,\n userPalette: Boolean(isObject(options.theme) && options.theme.palette)\n };\n miniChartSeries = miniChartSeries.map((series) => {\n var _a2, _b2;\n (_a2 = series.type) != null ? _a2 : series.type = \"line\";\n const _c = (_b2 = this.getSeriesThemeConfig(series.type).series) != null ? _b2 : {}, { innerLabels: _ } = _c, seriesTheme = __objRest(_c, [\"innerLabels\"]);\n const seriesOptions = mergeDefaults(\n this.getSeriesGroupingOptions(series),\n series,\n seriesTheme,\n this.getSeriesPalette(series.type, paletteOptions)\n );\n return this.activeTheme.templateTheme(seriesOptions);\n });\n options.navigator.miniChart.series = this.setSeriesGroupingOptions(miniChartSeries);\n }\n processAnnotationsOptions(options, _annotationsThemes) {\n if (!isAgCartesianChartOptions(options))\n return;\n }\n getSeriesPalette(seriesType, options) {\n const paletteFactory = seriesRegistry.getPaletteFactory(seriesType);\n const { colourIndex: colourOffset, userPalette } = options;\n const { fills = [], strokes = [] } = this.activeTheme.palette;\n return paletteFactory == null ? void 0 : paletteFactory({\n userPalette,\n colorsCount: Math.max(fills.length, strokes.length),\n themeTemplateParameters: this.activeTheme.getTemplateParameters(),\n takeColors(count) {\n options.colourIndex += count;\n return {\n fills: circularSliceArray(fills, count, colourOffset),\n strokes: circularSliceArray(strokes, count, colourOffset)\n };\n }\n });\n }\n getSeriesGroupingOptions(series) {\n const groupable = seriesRegistry.isGroupable(series.type);\n const stackable = seriesRegistry.isStackable(series.type);\n const stackedByDefault = seriesRegistry.isStackedByDefault(series.type);\n if (series.grouped && !groupable) {\n Logger.warnOnce(`unsupported grouping of series type \"${series.type}\".`);\n }\n if ((series.stacked || series.stackGroup) && !stackable) {\n Logger.warnOnce(`unsupported stacking of series type \"${series.type}\".`);\n }\n let { grouped, stacked } = series;\n stacked != null ? stacked : stacked = (stackedByDefault || series.stackGroup != null) && !(groupable && grouped);\n grouped != null ? grouped : grouped = true;\n return {\n stacked: stackable && stacked,\n grouped: groupable && grouped && !(stackable && stacked)\n };\n }\n setSeriesGroupingOptions(allSeries) {\n const seriesGroups = this.getSeriesGrouping(allSeries);\n Debug.create(true, \"opts\")(\"setSeriesGroupingOptions() - series grouping: \", seriesGroups);\n const groupIdx = {};\n const groupCount2 = seriesGroups.reduce((countMap, seriesGroup) => {\n var _a, _b;\n if (seriesGroup.groupType === \"default\" /* DEFAULT */) {\n return countMap;\n }\n (_b = countMap[_a = seriesGroup.seriesType]) != null ? _b : countMap[_a] = 0;\n countMap[seriesGroup.seriesType] += seriesGroup.groupType === \"stack\" /* STACK */ ? 1 : seriesGroup.series.length;\n return countMap;\n }, {});\n return seriesGroups.flatMap((seriesGroup) => {\n var _a, _b;\n (_b = groupIdx[_a = seriesGroup.seriesType]) != null ? _b : groupIdx[_a] = 0;\n switch (seriesGroup.groupType) {\n case \"stack\" /* STACK */:\n const groupIndex = groupIdx[seriesGroup.seriesType]++;\n return seriesGroup.series.map(\n (series, stackIndex) => Object.assign(series, {\n seriesGrouping: {\n groupIndex,\n groupCount: groupCount2[seriesGroup.seriesType],\n stackIndex,\n stackCount: seriesGroup.series.length\n }\n })\n );\n case \"group\" /* GROUP */:\n return seriesGroup.series.map(\n (series) => Object.assign(series, {\n seriesGrouping: {\n groupIndex: groupIdx[seriesGroup.seriesType]++,\n groupCount: groupCount2[seriesGroup.seriesType],\n stackIndex: 0,\n stackCount: 0\n }\n })\n );\n }\n return seriesGroup.series;\n }).map((_a) => {\n var _b = _a, { stacked: _, grouped: __ } = _b, seriesOptions = __objRest(_b, [\"stacked\", \"grouped\"]);\n return seriesOptions;\n });\n }\n getSeriesGroupId(series) {\n var _a;\n return [series.type, series.xKey, series.stacked ? (_a = series.stackGroup) != null ? _a : \"stacked\" : \"grouped\"].filter(Boolean).join(\"-\");\n }\n getSeriesGrouping(allSeries) {\n const groupMap = /* @__PURE__ */ new Map();\n return allSeries.reduce((result, series) => {\n const seriesType = series.type;\n if (!series.stacked && !series.grouped) {\n result.push({ groupType: \"default\" /* DEFAULT */, seriesType, series: [series] });\n } else {\n const groupId = this.getSeriesGroupId(series);\n if (!groupMap.has(groupId)) {\n const groupType = series.stacked ? \"stack\" /* STACK */ : \"group\" /* GROUP */;\n const record = { groupType, seriesType, series: [] };\n groupMap.set(groupId, record);\n result.push(record);\n }\n groupMap.get(groupId).series.push(series);\n }\n return result;\n }, []);\n }\n getDefaultSeriesType(options) {\n if (isAgCartesianChartOptions(options)) {\n return \"line\";\n } else if (isAgPolarChartOptions(options)) {\n return \"pie\";\n } else if (isAgHierarchyChartOptions(options)) {\n return \"treemap\";\n } else if (isAgTopologyChartOptions(options)) {\n return \"map-shape\";\n }\n throw new Error(\"Invalid chart options type detected.\");\n }\n getTooltipPositionDefaults(options) {\n var _a;\n const position = (_a = options.tooltip) == null ? void 0 : _a.position;\n if (!isPlainObject(position)) {\n return;\n }\n const { type, xOffset, yOffset } = position;\n const result = {};\n if (isString(type) && isEnumValue(AgTooltipPositionType, type)) {\n result.type = type;\n }\n if (isFiniteNumber(xOffset)) {\n result.xOffset = xOffset;\n }\n if (isFiniteNumber(yOffset)) {\n result.yOffset = yOffset;\n }\n return { tooltip: { position: result } };\n }\n deprecationWarnings(options) {\n const deprecatedArrayProps = { yKeys: \"yKey\", yNames: \"yName\" };\n Object.entries(deprecatedArrayProps).forEach(([oldProp, newProp]) => {\n var _a;\n if ((_a = options.series) == null ? void 0 : _a.some((s) => s[oldProp] != null)) {\n Logger.warnOnce(\n `Property [series.${oldProp}] is deprecated, please use [series.${newProp}] and multiple series instead.`\n );\n }\n });\n }\n axesTypeIntegrity(options) {\n var _a;\n if (\"axes\" in options) {\n const axes = (_a = options.axes) != null ? _a : [];\n for (const { type } of axes) {\n if (!isAxisOptionType(type)) {\n delete options.axes;\n const expectedTypes = Array.from(axisRegistry.publicKeys()).join(\", \");\n Logger.warnOnce(`unknown axis type: ${type}; expected one of: ${expectedTypes}`);\n }\n }\n }\n }\n seriesTypeIntegrity(options) {\n var _a;\n const series = (_a = options.series) != null ? _a : [];\n options.series = series.filter(({ type }) => {\n if (type == null || isSeriesOptionType(type) || isEnterpriseSeriesType(type)) {\n return true;\n }\n Logger.warnOnce(\n `unknown series type: ${type}; expected one of: ${publicChartTypes.seriesTypes.join(\", \")}`\n );\n });\n }\n soloSeriesIntegrity(options) {\n const allSeries = options.series;\n if (allSeries && allSeries.length > 1 && allSeries.some((series) => seriesRegistry.isSolo(series.type))) {\n const mainSeriesType = this.optionsType(options);\n if (seriesRegistry.isSolo(mainSeriesType)) {\n Logger.warn(\n `series[0] of type '${mainSeriesType}' is incompatible with other series types. Only processing series[0]`\n );\n options.series = allSeries.slice(0, 1);\n } else {\n const { solo, nonSolo } = groupBy(\n allSeries,\n (s) => seriesRegistry.isSolo(s.type) ? \"solo\" : \"nonSolo\"\n );\n const rejects = unique(solo.map((s) => s.type)).join(\", \");\n Logger.warn(`Unable to mix these series types with the lead series type: ${rejects}`);\n options.series = nonSolo;\n }\n }\n }\n enableConfiguredOptions(options) {\n jsonWalk(\n this.userOptions,\n (visitingUserOpts, visitingMergedOpts) => {\n if (visitingMergedOpts && \"enabled\" in visitingMergedOpts && !visitingMergedOpts._enabledFromTheme && visitingUserOpts.enabled == null) {\n visitingMergedOpts.enabled = true;\n }\n },\n { skip: [\"data\", \"theme\"] },\n options\n );\n jsonWalk(\n options,\n (visitingMergedOpts) => {\n if (visitingMergedOpts._enabledFromTheme != null) {\n delete visitingMergedOpts._enabledFromTheme;\n }\n },\n { skip: [\"data\", \"theme\"] }\n );\n }\n removeDisabledOptions(options) {\n jsonWalk(\n options,\n (optionsNode) => {\n if (\"enabled\" in optionsNode && optionsNode.enabled === false) {\n Object.keys(optionsNode).forEach((key) => {\n if (key === \"enabled\")\n return;\n delete optionsNode[key];\n });\n }\n },\n { skip: [\"data\", \"theme\"] }\n );\n }\n removeLeftoverSymbols(options) {\n jsonWalk(\n options,\n (optionsNode) => {\n if (!optionsNode || !isObject(optionsNode))\n return;\n for (const [key, value] of Object.entries(optionsNode)) {\n if (isSymbol(value)) {\n delete optionsNode[key];\n }\n }\n },\n { skip: [\"data\"] }\n );\n }\n specialOverridesDefaults(options) {\n if (options.window != null) {\n setWindow(options.window);\n } else if (typeof window !== \"undefined\") {\n options.window = window;\n } else if (typeof global !== \"undefined\") {\n options.window = global.window;\n }\n if (options.document != null) {\n setDocument(options.document);\n } else if (typeof document !== \"undefined\") {\n options.document = document;\n } else if (typeof global !== \"undefined\") {\n options.document = global.document;\n }\n if (options.window == null) {\n throw new Error(\"AG Charts - unable to resolve global window\");\n }\n if (options.document == null) {\n throw new Error(\"AG Charts - unable to resolve global document\");\n }\n return options;\n }\n};\n\n// packages/ag-charts-community/src/util/deprecation.ts\nfunction createDeprecationWarning() {\n return (key, message) => {\n const msg = [`Property [${key}] is deprecated.`, message].filter(Boolean).join(\" \");\n Logger.warnOnce(msg);\n };\n}\nfunction Deprecated(message, opts) {\n const warnDeprecated = createDeprecationWarning();\n const def = opts == null ? void 0 : opts.default;\n return addTransformToInstanceProperty((_, key, value) => {\n if (value !== def) {\n warnDeprecated(key.toString(), message);\n }\n return value;\n });\n}\nfunction DeprecatedAndRenamedTo(newPropName, mapValue) {\n const warnDeprecated = createDeprecationWarning();\n return addTransformToInstanceProperty(\n (target, key, value) => {\n if (value !== target[newPropName]) {\n warnDeprecated(key.toString(), `Use [${newPropName}] instead.`);\n setPath(target, newPropName, mapValue ? mapValue(value) : value);\n }\n return BREAK_TRANSFORM_CHAIN;\n },\n (target, key) => {\n warnDeprecated(key.toString(), `Use [${newPropName}] instead.`);\n return getPath(target, newPropName);\n }\n );\n}\n\n// packages/ag-charts-community/src/motion/fromToMotion.ts\nvar fromToMotion_exports = {};\n__export(fromToMotion_exports, {\n NODE_UPDATE_STATE_TO_PHASE_MAPPING: () => NODE_UPDATE_STATE_TO_PHASE_MAPPING,\n fromToMotion: () => fromToMotion,\n staticFromToMotion: () => staticFromToMotion\n});\n\n// packages/ag-charts-community/src/util/id.ts\nvar ID_MAP = /* @__PURE__ */ new Map();\nfunction resetIds() {\n ID_MAP.clear();\n}\nfunction createId(instance) {\n var _a;\n const constructor = instance.constructor;\n const className = Object.hasOwn(constructor, \"className\") ? constructor.className : constructor.name;\n if (!className) {\n throw new Error(`The ${constructor} is missing the 'className' property.`);\n }\n const nextId = ((_a = ID_MAP.get(className)) != null ? _a : 0) + 1;\n ID_MAP.set(className, nextId);\n return `${className}-${nextId}`;\n}\n\n// packages/ag-charts-community/src/util/interpolating.ts\nvar interpolate = \"$interpolate\";\nvar isInterpolating = (x) => x[interpolate] != null;\n\n// packages/ag-charts-community/src/util/number.ts\nfunction clamp(min, value, max) {\n return Math.min(max, Math.max(min, value));\n}\nfunction clampArray(value, array) {\n const [min, max] = findMinMax(array);\n return clamp(min, value, max);\n}\nfunction findMinMax(array) {\n return array.length ? [Math.min(...array), Math.max(...array)] : [];\n}\nfunction findRangeExtent(array) {\n const [min, max] = findMinMax(array);\n return max - min;\n}\nfunction isEqual(a, b, epsilon2 = 1e-10) {\n return Math.abs(a - b) < epsilon2;\n}\nfunction isNegative(value) {\n return Math.sign(value) === -1 || Object.is(value, -0);\n}\nfunction round(value, decimals = 2) {\n const base = __pow(10, decimals);\n return Math.round(value * base) / base;\n}\nfunction toFixed(value, fractionOrSignificantDigits = 2) {\n const power = Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n if (power >= 0 || !isFinite(power)) {\n return value.toFixed(fractionOrSignificantDigits);\n }\n return value.toFixed(Math.abs(power) - 1 + fractionOrSignificantDigits);\n}\nfunction mod(n, m) {\n return Math.floor(n % m + (n < 0 ? m : 0));\n}\nfunction countFractionDigits(value, maximumFractionDigits = 10) {\n const [, decimal = \"\"] = (Math.abs(value) % 1).toLocaleString(\"en-GB\", { minimumFractionDigits: 0, maximumFractionDigits }).split(\".\");\n return decimal.length;\n}\n\n// packages/ag-charts-community/src/scene/nearest.ts\nfunction nearestSquared(x, y, objects, maxDistanceSquared = Infinity) {\n const result = { nearest: void 0, distanceSquared: maxDistanceSquared };\n for (const obj of objects) {\n const thisDistance = obj.distanceSquared(x, y);\n if (thisDistance === 0) {\n return { nearest: obj, distanceSquared: 0 };\n } else if (thisDistance < result.distanceSquared) {\n result.nearest = obj;\n result.distanceSquared = thisDistance;\n }\n }\n return result;\n}\nfunction nearestSquaredInContainer(x, y, container, maxDistanceSquared = Infinity) {\n const { x: tx, y: ty } = container.transformPoint(x, y);\n const result = { nearest: void 0, distanceSquared: maxDistanceSquared };\n for (const child of container.children) {\n const { nearest, distanceSquared: distanceSquared2 } = child.nearestSquared(tx, ty, result.distanceSquared);\n if (distanceSquared2 === 0) {\n return { nearest, distanceSquared: distanceSquared2 };\n } else if (distanceSquared2 < result.distanceSquared) {\n result.nearest = nearest;\n result.distanceSquared = distanceSquared2;\n }\n }\n return result;\n}\n\n// packages/ag-charts-community/src/scene/bbox.ts\nvar _BBox = class _BBox {\n constructor(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n clone() {\n const { x, y, width, height } = this;\n return new _BBox(x, y, width, height);\n }\n equals(other) {\n return this.x === other.x && this.y === other.y && this.width === other.width && this.height === other.height;\n }\n containsPoint(x, y) {\n return x >= this.x && x <= this.x + this.width && y >= this.y && y <= this.y + this.height;\n }\n collidesBBox(other) {\n return this.x < other.x + other.width && this.x + this.width > other.x && this.y < other.y + other.height && this.y + this.height > other.y;\n }\n computeCenter() {\n return { x: this.x + this.width / 2, y: this.y + this.height / 2 };\n }\n isFinite() {\n return Number.isFinite(this.x) && Number.isFinite(this.y) && Number.isFinite(this.width) && Number.isFinite(this.height);\n }\n distanceSquared(x, y) {\n if (this.containsPoint(x, y)) {\n return 0;\n }\n const dx = x - clamp(this.x, x, this.x + this.width);\n const dy = y - clamp(this.y, y, this.y + this.height);\n return dx * dx + dy * dy;\n }\n static nearestBox(x, y, boxes) {\n return nearestSquared(x, y, boxes);\n }\n clip(clipRect) {\n if (clipRect === void 0)\n return this;\n const x1 = Math.max(this.x, clipRect.x);\n const y1 = Math.max(this.y, clipRect.y);\n const x2 = Math.min(this.x + this.width, clipRect.x + clipRect.width);\n const y2 = Math.min(this.y + this.height, clipRect.y + clipRect.height);\n this.x = x1;\n this.y = y1;\n this.width = Math.max(0, x2 - x1);\n this.height = Math.max(0, y2 - y1);\n return this;\n }\n shrink(amount, position) {\n const apply = (pos, amt) => {\n switch (pos) {\n case \"top\":\n this.y += amt;\n case \"bottom\":\n this.height -= amt;\n break;\n case \"left\":\n this.x += amt;\n case \"right\":\n this.width -= amt;\n break;\n case \"vertical\":\n this.y += amt;\n this.height -= amt * 2;\n break;\n case \"horizontal\":\n this.x += amt;\n this.width -= amt * 2;\n break;\n case void 0:\n this.x += amt;\n this.width -= amt * 2;\n this.y += amt;\n this.height -= amt * 2;\n break;\n default:\n }\n };\n if (typeof amount === \"number\") {\n apply(position, amount);\n } else if (typeof amount === \"object\") {\n Object.entries(amount).forEach(([pos, amt]) => apply(pos, amt));\n }\n return this;\n }\n grow(amount, position) {\n if (typeof amount === \"number\") {\n this.shrink(-amount, position);\n } else {\n const paddingCopy = __spreadValues({}, amount);\n for (const key in paddingCopy) {\n paddingCopy[key] *= -1;\n }\n this.shrink(paddingCopy);\n }\n return this;\n }\n combine(other) {\n const { x, y, width, height } = this;\n this.x = Math.min(x, other.x);\n this.y = Math.min(y, other.y);\n this.width = Math.max(x + width, other.x + other.width) - this.x;\n this.height = Math.max(y + height, other.y + other.height) - this.y;\n }\n static merge(boxes) {\n let left = Infinity;\n let top = Infinity;\n let right = -Infinity;\n let bottom = -Infinity;\n for (const box of boxes) {\n if (box.x < left) {\n left = box.x;\n }\n if (box.y < top) {\n top = box.y;\n }\n if (box.x + box.width > right) {\n right = box.x + box.width;\n }\n if (box.y + box.height > bottom) {\n bottom = box.y + box.height;\n }\n }\n return new _BBox(left, top, right - left, bottom - top);\n }\n [interpolate](other, d) {\n return new _BBox(\n this.x * (1 - d) + other.x * d,\n this.y * (1 - d) + other.y * d,\n this.width * (1 - d) + other.width * d,\n this.height * (1 - d) + other.height * d\n );\n }\n};\n_BBox.zero = new _BBox(0, 0, 0, 0);\n_BBox.NaN = new _BBox(NaN, NaN, NaN, NaN);\nvar BBox = _BBox;\n\n// packages/ag-charts-community/src/scene/changeDetectable.ts\nvar RedrawType = /* @__PURE__ */ ((RedrawType2) => {\n RedrawType2[RedrawType2[\"NONE\"] = 0] = \"NONE\";\n RedrawType2[RedrawType2[\"TRIVIAL\"] = 1] = \"TRIVIAL\";\n RedrawType2[RedrawType2[\"MINOR\"] = 2] = \"MINOR\";\n RedrawType2[RedrawType2[\"MAJOR\"] = 3] = \"MAJOR\";\n return RedrawType2;\n})(RedrawType || {});\nfunction functionConstructorAvailable() {\n try {\n new Function(\"return true\");\n return true;\n } catch (e) {\n return false;\n }\n}\nvar STRING_FUNCTION_USEABLE = functionConstructorAvailable();\nfunction SceneChangeDetection(opts) {\n const { changeCb, convertor } = opts != null ? opts : {};\n return function(target, key) {\n const privateKey = `__${key}`;\n if (target[key]) {\n return;\n }\n if (STRING_FUNCTION_USEABLE && changeCb == null && convertor == null) {\n prepareFastGetSet(target, key, privateKey, opts);\n } else {\n prepareSlowGetSet(target, key, privateKey, opts);\n }\n };\n}\nfunction prepareFastGetSet(target, key, privateKey, opts) {\n const { redraw = 1 /* TRIVIAL */, type = \"normal\", checkDirtyOnAssignment = false } = opts != null ? opts : {};\n const setterJs = new Function(\n \"value\",\n `\n const oldValue = this.${privateKey};\n if (value !== oldValue) {\n this.${privateKey} = value;\n ${type === \"normal\" ? `this.markDirty(this, ${redraw});` : \"\"}\n ${type === \"transform\" ? `this.markDirtyTransform(${redraw});` : \"\"}\n ${type === \"path\" ? `if (!this._dirtyPath) { this._dirtyPath = true; this.markDirty(this, ${redraw}); }` : \"\"}\n ${type === \"font\" ? `if (!this._dirtyFont) { this._dirtyFont = true; this.markDirty(this, ${redraw}); }` : \"\"}\n }\n ${checkDirtyOnAssignment ? `if (value != null && value._dirty > ${0 /* NONE */}) { this.markDirty(value, value._dirty); }` : \"\"}\n`\n );\n const getterJs = new Function(`return this.${privateKey};`);\n Object.defineProperty(target, key, {\n set: setterJs,\n get: getterJs,\n enumerable: true,\n configurable: true\n });\n}\nfunction prepareSlowGetSet(target, key, privateKey, opts) {\n const {\n redraw = 1 /* TRIVIAL */,\n type = \"normal\",\n changeCb,\n convertor,\n checkDirtyOnAssignment = false\n } = opts != null ? opts : {};\n const setter = function(value) {\n const oldValue = this[privateKey];\n value = convertor ? convertor(value) : value;\n if (value !== oldValue) {\n this[privateKey] = value;\n if (type === \"normal\")\n this.markDirty(this, redraw);\n if (type === \"transform\")\n this.markDirtyTransform(redraw);\n if (type === \"path\" && !this._dirtyPath) {\n this._dirtyPath = true;\n this.markDirty(this, redraw);\n }\n if (type === \"font\" && !this._dirtyFont) {\n this._dirtyFont = true;\n this.markDirty(this, redraw);\n }\n changeCb == null ? void 0 : changeCb(this);\n }\n if (checkDirtyOnAssignment && value != null && value._dirty > 0 /* NONE */)\n this.markDirty(value, value._dirty);\n };\n const getter = function() {\n return this[privateKey];\n };\n Object.defineProperty(target, key, {\n set: setter,\n get: getter,\n enumerable: true,\n configurable: true\n });\n}\nvar ChangeDetectable = class {\n constructor() {\n this._dirty = 3 /* MAJOR */;\n }\n markDirty(_source, type = 1 /* TRIVIAL */) {\n if (this._dirty < type) {\n this._dirty = type;\n }\n }\n markClean(_opts) {\n this._dirty = 0 /* NONE */;\n }\n isDirty() {\n return this._dirty > 0 /* NONE */;\n }\n};\n\n// packages/ag-charts-community/src/scene/matrix.ts\nvar _Matrix = class _Matrix {\n get e() {\n return [...this.elements];\n }\n constructor(elements3 = [1, 0, 0, 1, 0, 0]) {\n this.elements = elements3;\n }\n setElements(elements3) {\n const e = this.elements;\n e[0] = elements3[0];\n e[1] = elements3[1];\n e[2] = elements3[2];\n e[3] = elements3[3];\n e[4] = elements3[4];\n e[5] = elements3[5];\n return this;\n }\n get identity() {\n const e = this.elements;\n return e[0] === 1 && e[1] === 0 && e[2] === 0 && e[3] === 1 && e[4] === 0 && e[5] === 0;\n }\n /**\n * Performs the AxB matrix multiplication and saves the result\n * to `C`, if given, or to `A` otherwise.\n */\n AxB(A, B, C) {\n const a = A[0] * B[0] + A[2] * B[1], b = A[1] * B[0] + A[3] * B[1], c = A[0] * B[2] + A[2] * B[3], d = A[1] * B[2] + A[3] * B[3], e = A[0] * B[4] + A[2] * B[5] + A[4], f = A[1] * B[4] + A[3] * B[5] + A[5];\n C = C != null ? C : A;\n C[0] = a;\n C[1] = b;\n C[2] = c;\n C[3] = d;\n C[4] = e;\n C[5] = f;\n }\n /**\n * The `other` matrix gets post-multiplied to the current matrix.\n * Returns the current matrix.\n * @param other\n */\n multiplySelf(other) {\n this.AxB(this.elements, other.elements);\n return this;\n }\n /**\n * The `other` matrix gets post-multiplied to the current matrix.\n * Returns a new matrix.\n * @param other\n */\n multiply(other) {\n const elements3 = new Array(6);\n this.AxB(this.elements, other.elements, elements3);\n return new _Matrix(elements3);\n }\n preMultiplySelf(other) {\n this.AxB(other.elements, this.elements, this.elements);\n return this;\n }\n /**\n * Returns the inverse of this matrix as a new matrix.\n */\n inverse() {\n const el = this.elements;\n let a = el[0], b = el[1], c = el[2], d = el[3];\n const e = el[4], f = el[5];\n const rD = 1 / (a * d - b * c);\n a *= rD;\n b *= rD;\n c *= rD;\n d *= rD;\n return new _Matrix([d, -b, -c, a, c * f - d * e, b * e - a * f]);\n }\n /**\n * Save the inverse of this matrix to the given matrix.\n */\n inverseTo(other) {\n const el = this.elements;\n let a = el[0], b = el[1], c = el[2], d = el[3];\n const e = el[4], f = el[5];\n const rD = 1 / (a * d - b * c);\n a *= rD;\n b *= rD;\n c *= rD;\n d *= rD;\n other.setElements([d, -b, -c, a, c * f - d * e, b * e - a * f]);\n return this;\n }\n invertSelf() {\n const el = this.elements;\n let a = el[0], b = el[1], c = el[2], d = el[3];\n const e = el[4], f = el[5];\n const rD = 1 / (a * d - b * c);\n a *= rD;\n b *= rD;\n c *= rD;\n d *= rD;\n el[0] = d;\n el[1] = -b;\n el[2] = -c;\n el[3] = a;\n el[4] = c * f - d * e;\n el[5] = b * e - a * f;\n return this;\n }\n transformPoint(x, y) {\n const e = this.elements;\n return {\n x: x * e[0] + y * e[2] + e[4],\n y: x * e[1] + y * e[3] + e[5]\n };\n }\n transformBBox(bbox, target) {\n const elements3 = this.elements;\n const xx = elements3[0];\n const xy = elements3[1];\n const yx = elements3[2];\n const yy = elements3[3];\n const h_w = bbox.width * 0.5;\n const h_h = bbox.height * 0.5;\n const cx = bbox.x + h_w;\n const cy = bbox.y + h_h;\n const w = Math.abs(h_w * xx) + Math.abs(h_h * yx);\n const h = Math.abs(h_w * xy) + Math.abs(h_h * yy);\n if (!target) {\n target = new BBox(0, 0, 0, 0);\n }\n target.x = cx * xx + cy * yx + elements3[4] - w;\n target.y = cx * xy + cy * yy + elements3[5] - h;\n target.width = w + w;\n target.height = h + h;\n return target;\n }\n toContext(ctx) {\n if (this.identity) {\n return;\n }\n const e = this.elements;\n ctx.transform(e[0], e[1], e[2], e[3], e[4], e[5]);\n }\n static flyweight(sourceMatrix) {\n return _Matrix.instance.setElements(sourceMatrix.elements);\n }\n static updateTransformMatrix(matrix, scalingX, scalingY, rotation, translationX, translationY, opts) {\n const [bbcx, bbcy] = [0, 0];\n const sx = scalingX;\n const sy = scalingY;\n let scx;\n let scy;\n if (sx === 1 && sy === 1) {\n scx = 0;\n scy = 0;\n } else {\n scx = (opts == null ? void 0 : opts.scalingCenterX) == null ? bbcx : opts == null ? void 0 : opts.scalingCenterX;\n scy = (opts == null ? void 0 : opts.scalingCenterY) == null ? bbcy : opts == null ? void 0 : opts.scalingCenterY;\n }\n const r = rotation;\n const cos = Math.cos(r);\n const sin = Math.sin(r);\n let rcx;\n let rcy;\n if (r === 0) {\n rcx = 0;\n rcy = 0;\n } else {\n rcx = (opts == null ? void 0 : opts.rotationCenterX) == null ? bbcx : opts == null ? void 0 : opts.rotationCenterX;\n rcy = (opts == null ? void 0 : opts.rotationCenterY) == null ? bbcy : opts == null ? void 0 : opts.rotationCenterY;\n }\n const tx = translationX;\n const ty = translationY;\n const tx4 = scx * (1 - sx) - rcx;\n const ty4 = scy * (1 - sy) - rcy;\n matrix.setElements([\n cos * sx,\n sin * sx,\n -sin * sy,\n cos * sy,\n cos * tx4 - sin * ty4 + rcx + tx,\n sin * tx4 + cos * ty4 + rcy + ty\n ]);\n return matrix;\n }\n static fromContext(ctx) {\n const domMatrix = ctx.getTransform();\n return new _Matrix([domMatrix.a, domMatrix.b, domMatrix.c, domMatrix.d, domMatrix.e, domMatrix.f]);\n }\n};\n_Matrix.instance = new _Matrix();\nvar Matrix = _Matrix;\n\n// packages/ag-charts-community/src/scene/node.ts\nvar PointerEvents = /* @__PURE__ */ ((PointerEvents2) => {\n PointerEvents2[PointerEvents2[\"All\"] = 0] = \"All\";\n PointerEvents2[PointerEvents2[\"None\"] = 1] = \"None\";\n return PointerEvents2;\n})(PointerEvents || {});\nvar _Node = class _Node extends ChangeDetectable {\n constructor({ isVirtual, tag, zIndex } = {}) {\n super();\n /** Unique number to allow creation order to be easily determined. */\n this.serialNumber = _Node._nextSerialNumber++;\n /**\n * Unique node ID in the form `ClassName-NaturalNumber`.\n */\n this.id = createId(this);\n /**\n * To simplify the type system (especially in Selections) we don't have the `Parent` node\n * (one that has children). Instead, we mimic HTML DOM, where any node can have children.\n * But we still need to distinguish regular leaf nodes from container leafs somehow.\n */\n this.isContainerNode = false;\n this._virtualChildren = [];\n this._children = [];\n // Used to check for duplicate nodes.\n this.childSet = {};\n // These matrices may need to have package level visibility\n // for performance optimization purposes.\n this.matrix = new Matrix();\n this.dirtyTransform = false;\n this.scalingX = 1;\n this.scalingY = 1;\n this.scalingCenterX = null;\n this.scalingCenterY = null;\n this.rotationCenterX = null;\n this.rotationCenterY = null;\n this.rotation = 0;\n this.translationX = 0;\n this.translationY = 0;\n this._childNodeCounts = {\n groups: 0,\n nonGroups: 0\n };\n this.visible = true;\n this.dirtyZIndex = false;\n this.zIndex = 0;\n /** Discriminators for render order within a zIndex. */\n this.zIndexSubOrder = void 0;\n this.pointerEvents = 0 /* All */;\n this.isVirtual = isVirtual != null ? isVirtual : false;\n this.tag = tag != null ? tag : NaN;\n this.zIndex = zIndex != null ? zIndex : 0;\n }\n /**\n * Some arbitrary data bound to the node.\n */\n get datum() {\n var _a, _b;\n return (_b = this._datum) != null ? _b : (_a = this._parent) == null ? void 0 : _a.datum;\n }\n get previousDatum() {\n return this._previousDatum;\n }\n set datum(datum) {\n if (this._datum !== datum) {\n this._previousDatum = this._datum;\n }\n this._datum = datum;\n }\n _setLayerManager(value) {\n this._layerManager = value;\n this._debug = value == null ? void 0 : value.debug;\n for (const child of this._children) {\n child._setLayerManager(value);\n }\n for (const child of this._virtualChildren) {\n child._setLayerManager(value);\n }\n }\n get layerManager() {\n return this._layerManager;\n }\n *ancestors() {\n let node = this;\n while (node = node.parent) {\n yield node;\n }\n }\n *traverseUp() {\n yield this;\n yield* __yieldStar(this.ancestors());\n }\n get parent() {\n return this._parent;\n }\n get children() {\n return this._virtualChildren.length ? this._children.concat(this._virtualChildren.flatMap((next) => next.children)) : this._children;\n }\n get virtualChildren() {\n return this._virtualChildren;\n }\n hasVirtualChildren() {\n return this._virtualChildren.length > 0;\n }\n // new Set()\n setProperties(styles, pickKeys) {\n const keys = pickKeys != null ? pickKeys : Object.keys(styles);\n for (const key of keys) {\n this[key] = styles[key];\n }\n return this;\n }\n /**\n * Appends one or more new node instances to this parent.\n * If one needs to:\n * - move a child to the end of the list of children\n * - move a child from one parent to another (including parents in other scenes)\n * one should use the {@link insertBefore} method instead.\n * @param nodes A node or nodes to append.\n */\n append(nodes) {\n if (!Array.isArray(nodes)) {\n nodes = [nodes];\n }\n for (const node of nodes) {\n if (node.parent) {\n throw new Error(`${node} already belongs to another parent: ${node.parent}.`);\n }\n if (node.layerManager) {\n throw new Error(`${node} already belongs to a scene: ${node.layerManager}.`);\n }\n if (this.childSet[node.id]) {\n throw new Error(`Duplicate ${node.constructor.name} node: ${node}`);\n }\n if (node.isVirtual) {\n this._virtualChildren.push(node);\n } else {\n this._children.push(node);\n }\n this.childSet[node.id] = true;\n node._parent = this;\n node._setLayerManager(this.layerManager);\n }\n this.dirtyZIndex = true;\n this.markDirty(this, 3 /* MAJOR */);\n }\n appendChild(node) {\n this.append(node);\n return node;\n }\n removeChild(node) {\n const error = () => {\n throw new Error(`The node to be removed is not a child of this node.`);\n };\n if (node.parent !== this) {\n error();\n }\n if (node.isVirtual) {\n const i = this._virtualChildren.indexOf(node);\n if (i < 0)\n error();\n this._virtualChildren.splice(i, 1);\n } else {\n const i = this._children.indexOf(node);\n if (i < 0)\n error();\n this._children.splice(i, 1);\n }\n delete this.childSet[node.id];\n node._parent = void 0;\n node._setLayerManager();\n this.dirtyZIndex = true;\n this.markDirty(node, 3 /* MAJOR */);\n return node;\n }\n calculateCumulativeMatrix() {\n this.computeTransformMatrix();\n const matrix = Matrix.flyweight(this.matrix);\n for (const parent of this.ancestors()) {\n parent.computeTransformMatrix();\n matrix.preMultiplySelf(parent.matrix);\n }\n return matrix;\n }\n transformPoint(x, y) {\n const matrix = this.calculateCumulativeMatrix();\n return matrix.invertSelf().transformPoint(x, y);\n }\n inverseTransformPoint(x, y) {\n const matrix = this.calculateCumulativeMatrix();\n return matrix.transformPoint(x, y);\n }\n transformBBox(bbox) {\n const matrix = this.calculateCumulativeMatrix();\n return matrix.invertSelf().transformBBox(bbox);\n }\n inverseTransformBBox(bbox) {\n const matrix = this.calculateCumulativeMatrix();\n return matrix.transformBBox(bbox);\n }\n markDirtyTransform() {\n this.dirtyTransform = true;\n this.markDirty(this, 3 /* MAJOR */);\n }\n containsPoint(_x, _y) {\n return false;\n }\n /**\n * Hit testing method.\n * Recursively checks if the given point is inside this node or any of its children.\n * Returns the first matching node or `undefined`.\n * Nodes that render later (show on top) are hit tested first.\n */\n pickNode(x, y) {\n var _a;\n if (!this.visible || this.pointerEvents === 1 /* None */ || !this.containsPoint(x, y)) {\n return;\n }\n const { children } = this;\n if (children.length > 1e3) {\n for (let i = children.length - 1; i >= 0; i--) {\n const child = children[i];\n const containsPoint = (_a = child.computeTransformedBBox()) == null ? void 0 : _a.containsPoint(x, y);\n const hit = containsPoint ? child.pickNode(x, y) : void 0;\n if (hit) {\n return hit;\n }\n }\n } else if (children.length) {\n for (let i = children.length - 1; i >= 0; i--) {\n const hit = children[i].pickNode(x, y);\n if (hit) {\n return hit;\n }\n }\n } else if (!this.isContainerNode) {\n return this;\n }\n }\n getCachedBBox() {\n var _a;\n return (_a = this.cachedBBox) != null ? _a : BBox.zero;\n }\n computeBBox() {\n return;\n }\n computeTransformedBBox() {\n const bbox = this.computeBBox();\n if (!bbox) {\n return;\n }\n this.computeTransformMatrix();\n const matrix = Matrix.flyweight(this.matrix);\n for (const parent of this.ancestors()) {\n parent.computeTransformMatrix();\n matrix.preMultiplySelf(parent.matrix);\n }\n matrix.transformBBox(bbox, bbox);\n return bbox;\n }\n computeTransformMatrix() {\n if (!this.dirtyTransform) {\n return;\n }\n const {\n matrix,\n scalingX,\n scalingY,\n rotation,\n translationX,\n translationY,\n scalingCenterX,\n scalingCenterY,\n rotationCenterX,\n rotationCenterY\n } = this;\n Matrix.updateTransformMatrix(matrix, scalingX, scalingY, rotation, translationX, translationY, {\n scalingCenterX,\n scalingCenterY,\n rotationCenterX,\n rotationCenterY\n });\n this.dirtyTransform = false;\n }\n /** Perform any pre-rendering initialization. */\n preRender() {\n this._childNodeCounts.groups = 0;\n this._childNodeCounts.nonGroups = 1;\n for (const child of this.children) {\n const childCounts = child.preRender();\n this._childNodeCounts.groups += childCounts.groups;\n this._childNodeCounts.nonGroups += childCounts.nonGroups;\n }\n return this._childNodeCounts;\n }\n render(renderCtx) {\n const { stats } = renderCtx;\n this._dirty = 0 /* NONE */;\n this.cachedBBox = this.computeBBox();\n if (stats) {\n stats.nodesRendered++;\n }\n }\n markDirty(_source, type = 1 /* TRIVIAL */, parentType = type) {\n if (this._dirty > type || this._dirty === type && type === parentType) {\n return;\n }\n this._dirty = type;\n if (this.parent) {\n this.parent.markDirty(this, parentType);\n } else if (this.layerManager) {\n this.layerManager.markDirty();\n }\n }\n get dirty() {\n return this._dirty;\n }\n markClean(opts) {\n const { force = false, recursive = true } = opts != null ? opts : {};\n if (this._dirty === 0 /* NONE */ && !force) {\n return;\n }\n this._dirty = 0 /* NONE */;\n if (recursive !== false) {\n for (const child of this._virtualChildren) {\n child.markClean({ force });\n }\n }\n if (recursive === true) {\n for (const child of this._children) {\n child.markClean({ force });\n }\n }\n }\n onVisibleChange() {\n }\n get nodeCount() {\n let count = 1;\n let dirtyCount = this._dirty >= 0 /* NONE */ || this.dirtyTransform ? 1 : 0;\n let visibleCount = this.visible ? 1 : 0;\n const countChild = (child) => {\n const { count: childCount, visibleCount: childVisibleCount, dirtyCount: childDirtyCount } = child.nodeCount;\n count += childCount;\n visibleCount += childVisibleCount;\n dirtyCount += childDirtyCount;\n };\n for (const child of this._children) {\n countChild(child);\n }\n for (const child of this._virtualChildren) {\n countChild(child);\n }\n return { count, visibleCount, dirtyCount };\n }\n onZIndexChange() {\n if (this.parent) {\n this.parent.dirtyZIndex = true;\n }\n }\n};\n_Node._nextSerialNumber = 0;\n__decorateClass([\n SceneChangeDetection({ type: \"transform\" })\n], _Node.prototype, \"scalingX\", 2);\n__decorateClass([\n SceneChangeDetection({ type: \"transform\" })\n], _Node.prototype, \"scalingY\", 2);\n__decorateClass([\n SceneChangeDetection({ type: \"transform\" })\n], _Node.prototype, \"scalingCenterX\", 2);\n__decorateClass([\n SceneChangeDetection({ type: \"transform\" })\n], _Node.prototype, \"scalingCenterY\", 2);\n__decorateClass([\n SceneChangeDetection({ type: \"transform\" })\n], _Node.prototype, \"rotationCenterX\", 2);\n__decorateClass([\n SceneChangeDetection({ type: \"transform\" })\n], _Node.prototype, \"rotationCenterY\", 2);\n__decorateClass([\n SceneChangeDetection({ type: \"transform\" })\n], _Node.prototype, \"rotation\", 2);\n__decorateClass([\n SceneChangeDetection({ type: \"transform\" })\n], _Node.prototype, \"translationX\", 2);\n__decorateClass([\n SceneChangeDetection({ type: \"transform\" })\n], _Node.prototype, \"translationY\", 2);\n__decorateClass([\n SceneChangeDetection({\n redraw: 3 /* MAJOR */,\n changeCb: (target) => target.onVisibleChange()\n })\n], _Node.prototype, \"visible\", 2);\n__decorateClass([\n SceneChangeDetection({\n redraw: 1 /* TRIVIAL */,\n changeCb: (target) => target.onZIndexChange()\n })\n], _Node.prototype, \"zIndex\", 2);\n__decorateClass([\n SceneChangeDetection({\n redraw: 1 /* TRIVIAL */,\n changeCb: (target) => target.onZIndexChange()\n })\n], _Node.prototype, \"zIndexSubOrder\", 2);\nvar Node = _Node;\n\n// packages/ag-charts-community/src/util/color.ts\nvar srgbToLinear = (value) => {\n const sign = value < 0 ? -1 : 1;\n const abs = Math.abs(value);\n if (abs <= 0.04045)\n return value / 12.92;\n return sign * __pow((abs + 0.055) / 1.055, 2.4);\n};\nvar srgbFromLinear = (value) => {\n const sign = value < 0 ? -1 : 1;\n const abs = Math.abs(value);\n if (abs > 31308e-7) {\n return sign * (1.055 * __pow(abs, 1 / 2.4) - 0.055);\n }\n return 12.92 * value;\n};\nvar _Color = class _Color {\n /**\n * Every color component should be in the [0, 1] range.\n * Some easing functions (such as elastic easing) can overshoot the target value by some amount.\n * So, when animating colors, if the source or target color components are already near\n * or at the edge of the allowed [0, 1] range, it is possible for the intermediate color\n * component value to end up outside of that range mid-animation. For this reason the constructor\n * performs range checking/constraining.\n * @param r Red component.\n * @param g Green component.\n * @param b Blue component.\n * @param a Alpha (opacity) component.\n */\n constructor(r, g, b, a = 1) {\n this.r = clamp(0, r || 0, 1);\n this.g = clamp(0, g || 0, 1);\n this.b = clamp(0, b || 0, 1);\n this.a = clamp(0, a || 0, 1);\n }\n /**\n * A color string can be in one of the following formats to be valid:\n * - #rgb\n * - #rrggbb\n * - rgb(r, g, b)\n * - rgba(r, g, b, a)\n * - CSS color name such as 'white', 'orange', 'cyan', etc.\n */\n static validColorString(str) {\n if (str.indexOf(\"#\") >= 0) {\n return !!_Color.parseHex(str);\n }\n if (str.indexOf(\"rgb\") >= 0) {\n return !!_Color.stringToRgba(str);\n }\n return !!_Color.nameToHex[str.toLowerCase()];\n }\n /**\n * The given string can be in one of the following formats:\n * - #rgb\n * - #rrggbb\n * - rgb(r, g, b)\n * - rgba(r, g, b, a)\n * - CSS color name such as 'white', 'orange', 'cyan', etc.\n * @param str\n */\n static fromString(str) {\n if (str.indexOf(\"#\") >= 0) {\n return _Color.fromHexString(str);\n }\n const hex = _Color.nameToHex[str.toLowerCase()];\n if (hex) {\n return _Color.fromHexString(hex);\n }\n if (str.indexOf(\"rgb\") >= 0) {\n return _Color.fromRgbaString(str);\n }\n throw new Error(`Invalid color string: '${str}'`);\n }\n static tryParseFromString(str) {\n try {\n return _Color.fromString(str);\n } catch (e) {\n Logger.warnOnce(`invalid color string: '${str}'.`);\n return _Color.fromArray([0, 0, 0]);\n }\n }\n // See https://drafts.csswg.org/css-color/#hex-notation\n static parseHex(input) {\n input = input.replace(/ /g, \"\").slice(1);\n let parts;\n switch (input.length) {\n case 6:\n case 8:\n parts = [];\n for (let i = 0; i < input.length; i += 2) {\n parts.push(parseInt(`${input[i]}${input[i + 1]}`, 16));\n }\n break;\n case 3:\n case 4:\n parts = input.split(\"\").map((p) => parseInt(p, 16)).map((p) => p + p * 16);\n break;\n }\n if ((parts == null ? void 0 : parts.length) >= 3 && parts.every((p) => p >= 0)) {\n if (parts.length === 3) {\n parts.push(255);\n }\n return parts;\n }\n }\n static fromHexString(str) {\n const values = _Color.parseHex(str);\n if (values) {\n const [r, g, b, a] = values;\n return new _Color(r / 255, g / 255, b / 255, a / 255);\n }\n throw new Error(`Malformed hexadecimal color string: '${str}'`);\n }\n static stringToRgba(str) {\n let [po, pc] = [NaN, NaN];\n for (let i = 0; i < str.length; i++) {\n const c = str[i];\n if (!po && c === \"(\") {\n po = i;\n } else if (c === \")\") {\n pc = i;\n break;\n }\n }\n const contents = po && pc && str.substring(po + 1, pc);\n if (!contents) {\n return;\n }\n const parts = contents.split(\",\");\n const rgba = [];\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i];\n let value = parseFloat(part);\n if (isNaN(value)) {\n return;\n }\n if (part.indexOf(\"%\") >= 0) {\n value = clamp(0, value, 100);\n value /= 100;\n } else if (i === 3) {\n value = clamp(0, value, 1);\n } else {\n value = clamp(0, value, 255);\n value /= 255;\n }\n rgba.push(value);\n }\n return rgba;\n }\n static fromRgbaString(str) {\n const rgba = _Color.stringToRgba(str);\n if (rgba) {\n if (rgba.length === 3) {\n return new _Color(rgba[0], rgba[1], rgba[2]);\n } else if (rgba.length === 4) {\n return new _Color(rgba[0], rgba[1], rgba[2], rgba[3]);\n }\n }\n throw new Error(`Malformed rgb/rgba color string: '${str}'`);\n }\n static fromArray(arr) {\n if (arr.length === 4) {\n return new _Color(arr[0], arr[1], arr[2], arr[3]);\n }\n if (arr.length === 3) {\n return new _Color(arr[0], arr[1], arr[2]);\n }\n throw new Error(\"The given array should contain 3 or 4 color components (numbers).\");\n }\n static fromHSB(h, s, b, alpha = 1) {\n const rgb = _Color.HSBtoRGB(h, s, b);\n return new _Color(rgb[0], rgb[1], rgb[2], alpha);\n }\n static fromHSL(h, s, l, alpha = 1) {\n const rgb = _Color.HSLtoRGB(h, s, l);\n return new _Color(rgb[0], rgb[1], rgb[2], alpha);\n }\n static fromOKLCH(l, c, h, alpha = 1) {\n const rgb = _Color.OKLCHtoRGB(l, c, h);\n return new _Color(rgb[0], rgb[1], rgb[2], alpha);\n }\n static padHex(str) {\n return str.length === 1 ? \"0\" + str : str;\n }\n toHexString() {\n let hex = \"#\" + _Color.padHex(Math.round(this.r * 255).toString(16)) + _Color.padHex(Math.round(this.g * 255).toString(16)) + _Color.padHex(Math.round(this.b * 255).toString(16));\n if (this.a < 1) {\n hex += _Color.padHex(Math.round(this.a * 255).toString(16));\n }\n return hex;\n }\n toRgbaString(fractionDigits = 3) {\n const components = [Math.round(this.r * 255), Math.round(this.g * 255), Math.round(this.b * 255)];\n const k = Math.pow(10, fractionDigits);\n if (this.a !== 1) {\n components.push(Math.round(this.a * k) / k);\n return `rgba(${components.join(\", \")})`;\n }\n return `rgb(${components.join(\", \")})`;\n }\n toString() {\n if (this.a === 1) {\n return this.toHexString();\n }\n return this.toRgbaString();\n }\n toHSB() {\n return _Color.RGBtoHSB(this.r, this.g, this.b);\n }\n static RGBtoOKLCH(r, g, b) {\n const LSRGB0 = srgbToLinear(r);\n const LSRGB1 = srgbToLinear(g);\n const LSRGB2 = srgbToLinear(b);\n const LMS0 = Math.cbrt(0.4122214708 * LSRGB0 + 0.5363325363 * LSRGB1 + 0.0514459929 * LSRGB2);\n const LMS1 = Math.cbrt(0.2119034982 * LSRGB0 + 0.6806995451 * LSRGB1 + 0.1073969566 * LSRGB2);\n const LMS2 = Math.cbrt(0.0883024619 * LSRGB0 + 0.2817188376 * LSRGB1 + 0.6299787005 * LSRGB2);\n const OKLAB0 = 0.2104542553 * LMS0 + 0.793617785 * LMS1 - 0.0040720468 * LMS2;\n const OKLAB1 = 1.9779984951 * LMS0 - 2.428592205 * LMS1 + 0.4505937099 * LMS2;\n const OKLAB2 = 0.0259040371 * LMS0 + 0.7827717662 * LMS1 - 0.808675766 * LMS2;\n const hue = Math.atan2(OKLAB2, OKLAB1) * 180 / Math.PI;\n const OKLCH0 = OKLAB0;\n const OKLCH1 = Math.hypot(OKLAB1, OKLAB2);\n const OKLCH2 = hue >= 0 ? hue : hue + 360;\n return [OKLCH0, OKLCH1, OKLCH2];\n }\n static OKLCHtoRGB(l, c, h) {\n const OKLAB0 = l;\n const OKLAB1 = c * Math.cos(h * Math.PI / 180);\n const OKLAB2 = c * Math.sin(h * Math.PI / 180);\n const LMS0 = __pow(OKLAB0 + 0.3963377774 * OKLAB1 + 0.2158037573 * OKLAB2, 3);\n const LMS1 = __pow(OKLAB0 - 0.1055613458 * OKLAB1 - 0.0638541728 * OKLAB2, 3);\n const LMS2 = __pow(OKLAB0 - 0.0894841775 * OKLAB1 - 1.291485548 * OKLAB2, 3);\n const LSRGB0 = 4.0767416621 * LMS0 - 3.3077115913 * LMS1 + 0.2309699292 * LMS2;\n const LSRGB1 = -1.2684380046 * LMS0 + 2.6097574011 * LMS1 - 0.3413193965 * LMS2;\n const LSRGB2 = -0.0041960863 * LMS0 - 0.7034186147 * LMS1 + 1.707614701 * LMS2;\n const SRGB0 = srgbFromLinear(LSRGB0);\n const SRGB1 = srgbFromLinear(LSRGB1);\n const SRGB2 = srgbFromLinear(LSRGB2);\n return [SRGB0, SRGB1, SRGB2];\n }\n static RGBtoHSL(r, g, b) {\n const min = Math.min(r, g, b);\n const max = Math.max(r, g, b);\n const l = (max + min) / 2;\n let h;\n let s;\n if (max === min) {\n h = NaN;\n s = 0;\n } else {\n const delta2 = max - min;\n s = l > 0.5 ? delta2 / (2 - max - min) : delta2 / (max + min);\n if (max === r) {\n h = (g - b) / delta2 + (g < b ? 6 : 0);\n } else if (max === g) {\n h = (b - r) / delta2 + 2;\n } else {\n h = (r - g) / delta2 + 4;\n }\n h *= 360 / 6;\n }\n return [h, s, l];\n }\n static HSLtoRGB(h, s, l) {\n if (s === 0) {\n return [l, l, l];\n }\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n function hueToRgb(t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n const r = hueToRgb(h / 360 + 1 / 3);\n const g = hueToRgb(h / 360);\n const b = hueToRgb(h / 360 - 1 / 3);\n return [r, g, b];\n }\n /**\n * Converts the given RGB triple to an array of HSB (HSV) components.\n * The hue component will be `NaN` for achromatic colors.\n */\n static RGBtoHSB(r, g, b) {\n const min = Math.min(r, g, b);\n const max = Math.max(r, g, b);\n const S = max === 0 ? 0 : (max - min) / max;\n let H = NaN;\n if (min !== max) {\n const delta2 = max - min;\n const rc = (max - r) / delta2;\n const gc = (max - g) / delta2;\n const bc = (max - b) / delta2;\n if (r === max) {\n H = bc - gc;\n } else if (g === max) {\n H = 2 + rc - bc;\n } else {\n H = 4 + gc - rc;\n }\n H /= 6;\n if (H < 0) {\n H = H + 1;\n }\n }\n return [H * 360, S, max];\n }\n /**\n * Converts the given HSB (HSV) triple to an array of RGB components.\n */\n static HSBtoRGB(H, S, B) {\n if (isNaN(H)) {\n H = 0;\n }\n H = (H % 360 + 360) % 360 / 360;\n let r = 0;\n let g = 0;\n let b = 0;\n if (S === 0) {\n r = g = b = B;\n } else {\n const h = (H - Math.floor(H)) * 6;\n const f = h - Math.floor(h);\n const p = B * (1 - S);\n const q = B * (1 - S * f);\n const t = B * (1 - S * (1 - f));\n switch (h >> 0) {\n case 0:\n r = B;\n g = t;\n b = p;\n break;\n case 1:\n r = q;\n g = B;\n b = p;\n break;\n case 2:\n r = p;\n g = B;\n b = t;\n break;\n case 3:\n r = p;\n g = q;\n b = B;\n break;\n case 4:\n r = t;\n g = p;\n b = B;\n break;\n case 5:\n r = B;\n g = p;\n b = q;\n break;\n }\n }\n return [r, g, b];\n }\n derive(hueShift, saturationFactor, brightnessFactor, opacityFactor) {\n const hsb = _Color.RGBtoHSB(this.r, this.g, this.b);\n let b = hsb[2];\n if (b == 0 && brightnessFactor > 1) {\n b = 0.05;\n }\n const h = ((hsb[0] + hueShift) % 360 + 360) % 360;\n const s = clamp(0, hsb[1] * saturationFactor, 1);\n b = clamp(0, b * brightnessFactor, 1);\n const a = clamp(0, this.a * opacityFactor, 1);\n const rgba = _Color.HSBtoRGB(h, s, b);\n rgba.push(a);\n return _Color.fromArray(rgba);\n }\n brighter() {\n return this.derive(0, 1, 1 / 0.7, 1);\n }\n darker() {\n return this.derive(0, 1, 0.7, 1);\n }\n static interpolate(color, other) {\n const c0 = _Color.tryParseFromString(color);\n const c1 = _Color.tryParseFromString(other);\n return (t) => {\n const i = (x, y) => x * (1 - t) + y * t;\n const c = new _Color(i(c0.r, c1.r), i(c0.g, c1.g), i(c0.b, c1.b), i(c0.a, c1.a));\n return c.toString();\n };\n }\n};\n_Color.didDebug = false;\n/**\n * CSS Color Module Level 4:\n * https://drafts.csswg.org/css-color/#named-colors\n */\n_Color.nameToHex = Object.freeze({\n aliceblue: \"#F0F8FF\",\n antiquewhite: \"#FAEBD7\",\n aqua: \"#00FFFF\",\n aquamarine: \"#7FFFD4\",\n azure: \"#F0FFFF\",\n beige: \"#F5F5DC\",\n bisque: \"#FFE4C4\",\n black: \"#000000\",\n blanchedalmond: \"#FFEBCD\",\n blue: \"#0000FF\",\n blueviolet: \"#8A2BE2\",\n brown: \"#A52A2A\",\n burlywood: \"#DEB887\",\n cadetblue: \"#5F9EA0\",\n chartreuse: \"#7FFF00\",\n chocolate: \"#D2691E\",\n coral: \"#FF7F50\",\n cornflowerblue: \"#6495ED\",\n cornsilk: \"#FFF8DC\",\n crimson: \"#DC143C\",\n cyan: \"#00FFFF\",\n darkblue: \"#00008B\",\n darkcyan: \"#008B8B\",\n darkgoldenrod: \"#B8860B\",\n darkgray: \"#A9A9A9\",\n darkgreen: \"#006400\",\n darkgrey: \"#A9A9A9\",\n darkkhaki: \"#BDB76B\",\n darkmagenta: \"#8B008B\",\n darkolivegreen: \"#556B2F\",\n darkorange: \"#FF8C00\",\n darkorchid: \"#9932CC\",\n darkred: \"#8B0000\",\n darksalmon: \"#E9967A\",\n darkseagreen: \"#8FBC8F\",\n darkslateblue: \"#483D8B\",\n darkslategray: \"#2F4F4F\",\n darkslategrey: \"#2F4F4F\",\n darkturquoise: \"#00CED1\",\n darkviolet: \"#9400D3\",\n deeppink: \"#FF1493\",\n deepskyblue: \"#00BFFF\",\n dimgray: \"#696969\",\n dimgrey: \"#696969\",\n dodgerblue: \"#1E90FF\",\n firebrick: \"#B22222\",\n floralwhite: \"#FFFAF0\",\n forestgreen: \"#228B22\",\n fuchsia: \"#FF00FF\",\n gainsboro: \"#DCDCDC\",\n ghostwhite: \"#F8F8FF\",\n gold: \"#FFD700\",\n goldenrod: \"#DAA520\",\n gray: \"#808080\",\n green: \"#008000\",\n greenyellow: \"#ADFF2F\",\n grey: \"#808080\",\n honeydew: \"#F0FFF0\",\n hotpink: \"#FF69B4\",\n indianred: \"#CD5C5C\",\n indigo: \"#4B0082\",\n ivory: \"#FFFFF0\",\n khaki: \"#F0E68C\",\n lavender: \"#E6E6FA\",\n lavenderblush: \"#FFF0F5\",\n lawngreen: \"#7CFC00\",\n lemonchiffon: \"#FFFACD\",\n lightblue: \"#ADD8E6\",\n lightcoral: \"#F08080\",\n lightcyan: \"#E0FFFF\",\n lightgoldenrodyellow: \"#FAFAD2\",\n lightgray: \"#D3D3D3\",\n lightgreen: \"#90EE90\",\n lightgrey: \"#D3D3D3\",\n lightpink: \"#FFB6C1\",\n lightsalmon: \"#FFA07A\",\n lightseagreen: \"#20B2AA\",\n lightskyblue: \"#87CEFA\",\n lightslategray: \"#778899\",\n lightslategrey: \"#778899\",\n lightsteelblue: \"#B0C4DE\",\n lightyellow: \"#FFFFE0\",\n lime: \"#00FF00\",\n limegreen: \"#32CD32\",\n linen: \"#FAF0E6\",\n magenta: \"#FF00FF\",\n maroon: \"#800000\",\n mediumaquamarine: \"#66CDAA\",\n mediumblue: \"#0000CD\",\n mediumorchid: \"#BA55D3\",\n mediumpurple: \"#9370DB\",\n mediumseagreen: \"#3CB371\",\n mediumslateblue: \"#7B68EE\",\n mediumspringgreen: \"#00FA9A\",\n mediumturquoise: \"#48D1CC\",\n mediumvioletred: \"#C71585\",\n midnightblue: \"#191970\",\n mintcream: \"#F5FFFA\",\n mistyrose: \"#FFE4E1\",\n moccasin: \"#FFE4B5\",\n navajowhite: \"#FFDEAD\",\n navy: \"#000080\",\n oldlace: \"#FDF5E6\",\n olive: \"#808000\",\n olivedrab: \"#6B8E23\",\n orange: \"#FFA500\",\n orangered: \"#FF4500\",\n orchid: \"#DA70D6\",\n palegoldenrod: \"#EEE8AA\",\n palegreen: \"#98FB98\",\n paleturquoise: \"#AFEEEE\",\n palevioletred: \"#DB7093\",\n papayawhip: \"#FFEFD5\",\n peachpuff: \"#FFDAB9\",\n peru: \"#CD853F\",\n pink: \"#FFC0CB\",\n plum: \"#DDA0DD\",\n powderblue: \"#B0E0E6\",\n purple: \"#800080\",\n rebeccapurple: \"#663399\",\n red: \"#FF0000\",\n rosybrown: \"#BC8F8F\",\n royalblue: \"#4169E1\",\n saddlebrown: \"#8B4513\",\n salmon: \"#FA8072\",\n sandybrown: \"#F4A460\",\n seagreen: \"#2E8B57\",\n seashell: \"#FFF5EE\",\n sienna: \"#A0522D\",\n silver: \"#C0C0C0\",\n skyblue: \"#87CEEB\",\n slateblue: \"#6A5ACD\",\n slategray: \"#708090\",\n slategrey: \"#708090\",\n snow: \"#FFFAFA\",\n springgreen: \"#00FF7F\",\n steelblue: \"#4682B4\",\n tan: \"#D2B48C\",\n teal: \"#008080\",\n thistle: \"#D8BFD8\",\n tomato: \"#FF6347\",\n transparent: \"#00000000\",\n turquoise: \"#40E0D0\",\n violet: \"#EE82EE\",\n wheat: \"#F5DEB3\",\n white: \"#FFFFFF\",\n whitesmoke: \"#F5F5F5\",\n yellow: \"#FFFF00\",\n yellowgreen: \"#9ACD32\"\n});\nvar Color = _Color;\n\n// packages/ag-charts-community/src/util/interpolate.ts\nfunction interpolateNumber(a, b) {\n return (d) => Number(a) * (1 - d) + Number(b) * d;\n}\nfunction interpolateColor(a, b) {\n if (typeof a === \"string\") {\n try {\n a = Color.fromString(a);\n } catch (e) {\n a = Color.fromArray([0, 0, 0]);\n }\n }\n if (typeof b === \"string\") {\n try {\n b = Color.fromString(b);\n } catch (e) {\n b = Color.fromArray([0, 0, 0]);\n }\n }\n const red = interpolateNumber(a.r, b.r);\n const green = interpolateNumber(a.g, b.g);\n const blue = interpolateNumber(a.b, b.b);\n const alpha = interpolateNumber(a.a, b.a);\n return (d) => Color.fromArray([red(d), green(d), blue(d), alpha(d)]).toRgbaString();\n}\n\n// packages/ag-charts-community/src/motion/easing.ts\nvar easing_exports = {};\n__export(easing_exports, {\n easeIn: () => easeIn,\n easeInOut: () => easeInOut,\n easeInOutQuad: () => easeInOutQuad,\n easeInQuad: () => easeInQuad,\n easeOut: () => easeOut,\n easeOutQuad: () => easeOutQuad,\n inverseEaseOut: () => inverseEaseOut,\n linear: () => linear\n});\nvar linear = (n) => n;\nvar easeIn = (n) => 1 - Math.cos(n * Math.PI / 2);\nvar easeOut = (n) => Math.sin(n * Math.PI / 2);\nvar easeInOut = (n) => -(Math.cos(n * Math.PI) - 1) / 2;\nvar easeInQuad = (n) => n * n;\nvar easeOutQuad = (n) => 1 - __pow(1 - n, 2);\nvar easeInOutQuad = (n) => n < 0.5 ? 2 * n * n : 1 - __pow(-2 * n + 2, 2) / 2;\nvar inverseEaseOut = (x) => 2 * Math.asin(x) / Math.PI;\n\n// packages/ag-charts-community/src/motion/animation.ts\nvar QUICK_TRANSITION = 0.2;\nvar PHASE_ORDER = [\"initial\", \"remove\", \"update\", \"add\", \"trailing\", \"end\", \"none\"];\nvar PHASE_METADATA = {\n initial: {\n animationDuration: 1,\n animationDelay: 0\n },\n add: {\n animationDuration: 0.25,\n animationDelay: 0.75\n },\n remove: {\n animationDuration: 0.25,\n animationDelay: 0\n },\n update: {\n animationDuration: 0.5,\n animationDelay: 0.25\n },\n trailing: {\n animationDuration: QUICK_TRANSITION,\n animationDelay: 1,\n skipIfNoEarlierAnimations: true\n },\n end: {\n animationDelay: 1 + QUICK_TRANSITION,\n animationDuration: 0,\n skipIfNoEarlierAnimations: true\n },\n none: {\n animationDuration: 0,\n animationDelay: 0\n }\n};\nvar RepeatType = /* @__PURE__ */ ((RepeatType2) => {\n RepeatType2[\"Loop\"] = \"loop\";\n RepeatType2[\"Reverse\"] = \"reverse\";\n return RepeatType2;\n})(RepeatType || {});\nfunction isNodeArray(array) {\n return array.every((n) => n instanceof Node);\n}\nfunction deconstructSelectionsOrNodes(selectionsOrNodes) {\n return isNodeArray(selectionsOrNodes) ? { nodes: selectionsOrNodes, selections: [] } : { nodes: [], selections: selectionsOrNodes };\n}\nvar Animation = class {\n constructor(opts) {\n this.isComplete = false;\n this.elapsed = 0;\n this.iteration = 0;\n this.isPlaying = false;\n this.isReverse = false;\n var _a, _b, _c, _d, _e, _f, _g;\n this.id = opts.id;\n this.groupId = opts.groupId;\n this.autoplay = (_a = opts.autoplay) != null ? _a : true;\n this.ease = (_b = opts.ease) != null ? _b : linear;\n this.phase = opts.phase;\n const durationProportion = (_c = opts.duration) != null ? _c : PHASE_METADATA[this.phase].animationDuration;\n this.duration = durationProportion * opts.defaultDuration;\n this.delay = ((_d = opts.delay) != null ? _d : 0) * opts.defaultDuration;\n this.onComplete = opts.onComplete;\n this.onPlay = opts.onPlay;\n this.onStop = opts.onStop;\n this.onUpdate = opts.onUpdate;\n this.interpolate = this.createInterpolator(opts.from, opts.to);\n this.from = opts.from;\n if (opts.skip === true) {\n (_e = this.onUpdate) == null ? void 0 : _e.call(this, opts.to, false, this);\n (_f = this.onStop) == null ? void 0 : _f.call(this, this);\n (_g = this.onComplete) == null ? void 0 : _g.call(this, this);\n this.isComplete = true;\n }\n if (opts.collapsable !== false) {\n this.duration = this.checkCollapse(opts, this.duration);\n }\n }\n checkCollapse(opts, calculatedDuration) {\n if (opts.from === opts.to)\n return 0;\n const diff2 = typeof opts.from === \"object\" ? jsonDiff(opts.from, opts.to) : null;\n if (diff2) {\n return calculatedDuration;\n }\n return 0;\n }\n play(initialUpdate = false) {\n var _a, _b;\n if (this.isPlaying || this.isComplete)\n return;\n this.isPlaying = true;\n (_a = this.onPlay) == null ? void 0 : _a.call(this, this);\n if (!this.autoplay)\n return;\n this.autoplay = false;\n if (!initialUpdate)\n return;\n (_b = this.onUpdate) == null ? void 0 : _b.call(this, this.from, true, this);\n }\n pause() {\n this.isPlaying = false;\n }\n stop() {\n var _a;\n this.isPlaying = false;\n if (!this.isComplete) {\n this.isComplete = true;\n (_a = this.onStop) == null ? void 0 : _a.call(this, this);\n }\n }\n update(time2) {\n var _a, _b;\n if (this.isComplete)\n return time2;\n if (!this.isPlaying && this.autoplay) {\n this.play(true);\n }\n const previousElapsed = this.elapsed;\n this.elapsed += time2;\n if (this.delay > this.elapsed)\n return 0;\n const value = this.interpolate(this.isReverse ? 1 - this.delta : this.delta);\n (_a = this.onUpdate) == null ? void 0 : _a.call(this, value, false, this);\n const totalDuration = this.delay + this.duration;\n if (this.elapsed >= totalDuration) {\n this.stop();\n this.isComplete = true;\n (_b = this.onComplete) == null ? void 0 : _b.call(this, this);\n return time2 - (totalDuration - previousElapsed);\n }\n return 0;\n }\n get delta() {\n return this.ease(clamp(0, (this.elapsed - this.delay) / this.duration, 1));\n }\n createInterpolator(from, to) {\n if (typeof to !== \"object\" || isInterpolating(to)) {\n return this.interpolateValue(from, to);\n }\n const interpolatorEntries = [];\n for (const key in to) {\n const interpolator = this.interpolateValue(from[key], to[key]);\n if (interpolator != null) {\n interpolatorEntries.push([key, interpolator]);\n }\n }\n return (d) => {\n const result = {};\n for (const [key, interpolator] of interpolatorEntries) {\n result[key] = interpolator(d);\n }\n return result;\n };\n }\n interpolateValue(a, b) {\n if (a === void 0 || b === void 0) {\n return;\n } else if (isInterpolating(a)) {\n return (d) => a[interpolate](b, d);\n }\n try {\n switch (typeof a) {\n case \"number\":\n return interpolateNumber(a, b);\n case \"string\":\n return interpolateColor(a, b);\n case \"boolean\":\n if (a === b)\n return () => a;\n break;\n }\n } catch (e) {\n }\n throw new Error(`Unable to interpolate values: ${a}, ${b}`);\n }\n};\n\n// packages/ag-charts-community/src/motion/fromToMotion.ts\nvar NODE_UPDATE_STATE_TO_PHASE_MAPPING = {\n added: \"add\",\n updated: \"update\",\n removed: \"remove\",\n unknown: \"initial\",\n \"no-op\": \"none\"\n};\nfunction fromToMotion(groupId, subId, animationManager, selectionsOrNodes, fns, getDatumId, diff2) {\n const { fromFn, toFn, intermediateFn } = fns;\n const { nodes, selections } = deconstructSelectionsOrNodes(selectionsOrNodes);\n const processNodes = (liveNodes, subNodes) => {\n var _c;\n let prevFromProps;\n let liveNodeIndex = 0;\n let nodeIndex = 0;\n for (const node of subNodes) {\n const isLive = liveNodes[liveNodeIndex] === node;\n const ctx = {\n last: nodeIndex >= subNodes.length - 1,\n lastLive: liveNodeIndex >= liveNodes.length - 1,\n prev: subNodes[nodeIndex - 1],\n prevFromProps,\n prevLive: liveNodes[liveNodeIndex - 1],\n next: subNodes[nodeIndex + 1],\n nextLive: liveNodes[liveNodeIndex + (isLive ? 1 : 0)]\n };\n const animationId = `${groupId}_${subId}_${node.id}`;\n animationManager.stopByAnimationId(animationId);\n let status = \"unknown\";\n if (!isLive) {\n status = \"removed\";\n } else if (getDatumId && diff2) {\n status = calculateStatus(node, node.datum, getDatumId, diff2);\n }\n const _a = fromFn(node, node.datum, status, ctx), { phase, start, finish, delay, duration } = _a, from = __objRest(_a, [\"phase\", \"start\", \"finish\", \"delay\", \"duration\"]);\n const _b = toFn(node, node.datum, status, ctx), {\n phase: toPhase,\n start: toStart,\n finish: toFinish,\n delay: toDelay,\n duration: toDuration\n } = _b, to = __objRest(_b, [\n \"phase\",\n \"start\",\n \"finish\",\n \"delay\",\n \"duration\"\n ]);\n const collapsable = finish == null && toFinish == null;\n animationManager.animate({\n id: animationId,\n groupId,\n phase: (_c = phase != null ? phase : toPhase) != null ? _c : \"update\",\n duration: duration != null ? duration : toDuration,\n delay: delay != null ? delay : toDelay,\n from,\n to,\n ease: easeOut,\n collapsable,\n onPlay: () => {\n node.setProperties(__spreadValues(__spreadValues({}, start), toStart));\n },\n onUpdate(props) {\n node.setProperties(props);\n if (intermediateFn) {\n node.setProperties(intermediateFn(node, node.datum, status, ctx));\n }\n },\n onStop: () => {\n node.setProperties(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, start), toStart), from), to), finish), toFinish));\n }\n });\n if (isLive) {\n liveNodeIndex++;\n }\n nodeIndex++;\n prevFromProps = from;\n }\n };\n let selectionIndex = 0;\n for (const selection of selections) {\n const selectionNodes = selection.nodes();\n const liveNodes = selectionNodes.filter((n) => !selection.isGarbage(n));\n processNodes(liveNodes, selectionNodes);\n animationManager.animate({\n id: `${groupId}_${subId}_selection_${selectionIndex}`,\n groupId,\n phase: \"end\",\n from: 0,\n to: 1,\n ease: easeOut,\n onStop() {\n selection.cleanup();\n }\n });\n selectionIndex++;\n }\n processNodes(nodes, nodes);\n}\nfunction staticFromToMotion(groupId, subId, animationManager, selectionsOrNodes, from, to, extraOpts) {\n const { nodes, selections } = deconstructSelectionsOrNodes(selectionsOrNodes);\n const { start, finish, phase } = extraOpts;\n const collapsable = finish == null;\n animationManager.animate({\n id: `${groupId}_${subId}`,\n groupId,\n phase: phase != null ? phase : \"update\",\n from,\n to,\n ease: easeOut,\n collapsable,\n onPlay: () => {\n if (!start)\n return;\n for (const node of nodes) {\n node.setProperties(start);\n }\n for (const selection of selections) {\n for (const node of selection.nodes()) {\n node.setProperties(start);\n }\n }\n },\n onUpdate(props) {\n for (const node of nodes) {\n node.setProperties(props);\n }\n for (const selection of selections) {\n for (const node of selection.nodes()) {\n node.setProperties(props);\n }\n }\n },\n onStop: () => {\n for (const node of nodes) {\n node.setProperties(__spreadValues(__spreadValues({}, to), finish));\n }\n for (const selection of selections) {\n for (const node of selection.nodes()) {\n node.setProperties(__spreadValues(__spreadValues({}, to), finish));\n }\n }\n }\n });\n}\nfunction calculateStatus(node, datum, getDatumId, diff2) {\n const id = getDatumId(node, datum);\n if (diff2.added.has(id)) {\n return \"added\";\n }\n if (diff2.removed.has(id)) {\n return \"removed\";\n }\n return \"updated\";\n}\n\n// packages/ag-charts-community/src/util/angle.ts\nvar twoPi = Math.PI * 2;\nfunction normalizeAngle360(radians) {\n radians %= twoPi;\n radians += twoPi;\n radians %= twoPi;\n return radians;\n}\nfunction normalizeAngle360Inclusive(radians) {\n radians %= twoPi;\n radians += twoPi;\n if (radians !== twoPi) {\n radians %= twoPi;\n }\n return radians;\n}\nfunction normalizeAngle180(radians) {\n radians %= twoPi;\n if (radians < -Math.PI) {\n radians += twoPi;\n } else if (radians >= Math.PI) {\n radians -= twoPi;\n }\n return radians;\n}\nfunction isBetweenAngles(targetAngle, startAngle, endAngle) {\n const t = normalizeAngle360(targetAngle);\n const a0 = normalizeAngle360(startAngle);\n const a1 = normalizeAngle360Inclusive(endAngle);\n if (a0 <= a1) {\n return a0 <= t && t <= a1;\n } else {\n return a0 <= t || t <= a1;\n }\n}\nfunction toRadians(degrees) {\n return degrees / 180 * Math.PI;\n}\nfunction toDegrees(radians) {\n return radians / Math.PI * 180;\n}\nfunction angleBetween(angle0, angle1) {\n angle0 = normalizeAngle360(angle0);\n angle1 = normalizeAngle360(angle1);\n return angle1 - angle0 + (angle0 > angle1 ? 2 * Math.PI : 0);\n}\nfunction displacePointFromVector(centerX, centerY, radius, angle) {\n const x = centerX + radius * Math.cos(angle);\n const y = centerY + radius * Math.sin(angle);\n return { x, y };\n}\n\n// packages/ag-charts-community/src/scale/invalidating.ts\nvar Invalidating = (target, propertyKey) => {\n const mappedProperty = Symbol(String(propertyKey));\n target[mappedProperty] = void 0;\n Object.defineProperty(target, propertyKey, {\n get() {\n return this[mappedProperty];\n },\n set(newValue) {\n const oldValue = this[mappedProperty];\n if (oldValue !== newValue) {\n this[mappedProperty] = newValue;\n this.invalid = true;\n }\n },\n enumerable: true,\n configurable: false\n });\n};\n\n// packages/ag-charts-community/src/scale/bandScale.ts\nvar _BandScale = class _BandScale {\n constructor() {\n this.type = \"band\";\n this.invalid = true;\n this.interval = void 0;\n /**\n * Maps datum to its index in the {@link domain} array.\n * Used to check for duplicate datums (not allowed).\n */\n this.index = /* @__PURE__ */ new Map();\n /**\n * The output range values for datum at each index.\n */\n this.ordinalRange = [];\n /**\n * Contains unique datums only. Since `{}` is used in place of `Map`\n * for IE11 compatibility, the datums are converted `toString` before\n * the uniqueness check.\n */\n this._domain = [];\n this.range = [0, 1];\n this._bandwidth = 1;\n this._step = 1;\n this._rawBandwidth = 1;\n /**\n * The ratio of the range that is reserved for space between bands.\n */\n this._paddingInner = 0;\n /**\n * The ratio of the range that is reserved for space before the first\n * and after the last band.\n */\n this._paddingOuter = 0;\n this.round = false;\n }\n static is(value) {\n return value instanceof _BandScale;\n }\n refresh() {\n if (!this.invalid)\n return;\n this.invalid = false;\n this.update();\n if (this.invalid) {\n Logger.warnOnce(\"Expected update to not invalidate scale\");\n }\n }\n set domain(values) {\n this.invalid = true;\n const domain = [];\n this.index = /* @__PURE__ */ new Map();\n const index = this.index;\n values.forEach((value) => {\n if (this.getIndex(value) === void 0) {\n index.set(value, domain.push(value) - 1);\n }\n });\n this._domain = domain;\n }\n get domain() {\n return this._domain;\n }\n ticks() {\n this.refresh();\n let { interval = 1 } = this;\n if (typeof interval !== \"number\") {\n interval = Number(interval);\n }\n const step = Math.abs(Math.round(interval));\n return this._domain.filter((_, i) => i % step === 0);\n }\n convert(d) {\n this.refresh();\n const i = this.getIndex(d);\n if (i === void 0) {\n return NaN;\n }\n const r = this.ordinalRange[i];\n if (r === void 0) {\n return NaN;\n }\n return r;\n }\n invert(position) {\n this.refresh();\n const index = this.ordinalRange.findIndex((p) => p === position);\n return this.domain[index];\n }\n invertNearest(position) {\n var _a;\n this.refresh();\n let nearest = -1;\n let minDistance = Infinity;\n const index = this.ordinalRange.findIndex((p, i) => {\n if (p === position)\n return true;\n const distance2 = Math.abs(position - p);\n if (distance2 < minDistance) {\n minDistance = distance2;\n nearest = i;\n }\n return false;\n });\n return (_a = this.domain[index]) != null ? _a : this.domain[nearest];\n }\n get bandwidth() {\n this.refresh();\n return this._bandwidth;\n }\n get step() {\n this.refresh();\n return this._step;\n }\n get rawBandwidth() {\n this.refresh();\n return this._rawBandwidth;\n }\n set padding(value) {\n value = clamp(0, value, 1);\n this._paddingInner = value;\n this._paddingOuter = value;\n }\n get padding() {\n return this._paddingInner;\n }\n set paddingInner(value) {\n this._paddingInner = clamp(0, value, 1);\n }\n get paddingInner() {\n return this._paddingInner;\n }\n set paddingOuter(value) {\n this._paddingOuter = clamp(0, value, 1);\n }\n get paddingOuter() {\n return this._paddingOuter;\n }\n update() {\n const count = this._domain.length;\n if (count === 0) {\n return;\n }\n const round3 = this.round;\n const paddingInner = this._paddingInner;\n const paddingOuter = this._paddingOuter;\n const [r0, r1] = this.range;\n const width = r1 - r0;\n const rawStep = width / Math.max(1, count + 2 * paddingOuter - paddingInner);\n const step = round3 ? Math.floor(rawStep) : rawStep;\n const fullBandWidth = step * (count - paddingInner);\n const x0 = r0 + (width - fullBandWidth) / 2;\n const start = round3 ? Math.round(x0) : x0;\n const bw = step * (1 - paddingInner);\n const bandwidth = round3 ? Math.round(bw) : bw;\n const rawBandwidth = rawStep * (1 - paddingInner);\n const values = [];\n for (let i = 0; i < count; i++) {\n values.push(start + step * i);\n }\n this._bandwidth = bandwidth;\n this._rawBandwidth = rawBandwidth;\n this._step = step;\n this.ordinalRange = values;\n }\n getIndex(value) {\n if (!(value instanceof Date)) {\n return this.index.get(value);\n }\n const valueOf = value.valueOf();\n let index = 0;\n for (const key of this.index.keys()) {\n if (key instanceof Date && key.valueOf() === valueOf) {\n return index;\n }\n index++;\n }\n }\n};\n__decorateClass([\n Invalidating\n], _BandScale.prototype, \"interval\", 2);\n__decorateClass([\n Invalidating\n], _BandScale.prototype, \"range\", 2);\n__decorateClass([\n Invalidating\n], _BandScale.prototype, \"round\", 2);\nvar BandScale = _BandScale;\n\n// packages/ag-charts-community/src/util/default.ts\nfunction Default(defaultValue, replaces = [void 0]) {\n return addTransformToInstanceProperty((_, __, v) => {\n if (replaces.includes(v)) {\n return isFunction(defaultValue) ? defaultValue(v) : defaultValue;\n }\n return v;\n });\n}\n\n// packages/ag-charts-community/src/util/validation.ts\nfunction Validate(predicate, options = {}) {\n const { optional = false, property: overrideProperty } = options;\n return addTransformToInstanceProperty(\n (target, property, value) => {\n var _a;\n const context = __spreadProps(__spreadValues({}, options), { target, property });\n if (optional && typeof value === \"undefined\" || predicate(value, context)) {\n if (isProperties(target[property]) && !isProperties(value)) {\n target[property].set(value);\n return target[property];\n }\n return value;\n }\n const cleanKey = overrideProperty != null ? overrideProperty : String(property).replace(/^_*/, \"\");\n const targetName = (_a = target.constructor.className) != null ? _a : target.constructor.name.replace(/Properties$/, \"\");\n let valueString = stringify(value);\n const maxLength = 50;\n if (valueString != null && valueString.length > maxLength) {\n const excessCharacters = valueString.length - maxLength;\n valueString = valueString.slice(0, maxLength) + `... (+${excessCharacters} characters)`;\n }\n Logger.warn(\n `Property [${cleanKey}] of [${targetName}] cannot be set to [${valueString}]${predicate.message ? `; expecting ${getPredicateMessage(predicate, context)}` : \"\"}, ignoring.`\n );\n return BREAK_TRANSFORM_CHAIN;\n },\n void 0,\n { optional }\n );\n}\nvar AND = (...predicates) => {\n const messages = [];\n return predicateWithMessage(\n (value, ctx) => {\n messages.length = 0;\n return predicates.every((predicate) => {\n const isValid = predicate(value, ctx);\n if (!isValid) {\n messages.push(getPredicateMessage(predicate, ctx));\n }\n return isValid;\n });\n },\n () => messages.filter(Boolean).join(\" AND \")\n );\n};\nvar OR = (...predicates) => predicateWithMessage(\n (value, ctx) => predicates.some((predicate) => predicate(value, ctx)),\n (ctx) => predicates.map(getPredicateMessageMapper(ctx)).filter(Boolean).join(\" OR \")\n);\nvar OBJECT = attachObjectRestrictions(\n predicateWithMessage(\n (value, ctx) => isProperties(value) || isObject(value) && isProperties(ctx.target[ctx.property]),\n \"a properties object\"\n )\n);\nvar PLAIN_OBJECT = attachObjectRestrictions(predicateWithMessage((value) => isObject(value), \"an object\"));\nvar BOOLEAN = predicateWithMessage(isBoolean, \"a boolean\");\nvar FUNCTION = predicateWithMessage(isFunction, \"a function\");\nvar STRING = predicateWithMessage(isString, \"a string\");\nvar NUMBER = attachNumberRestrictions(predicateWithMessage(isFiniteNumber, \"a number\"));\nvar NAN = predicateWithMessage((value) => isNumber(value) && isNaN(value), \"NaN\");\nvar POSITIVE_NUMBER = NUMBER.restrict({ min: 0 });\nvar RATIO = NUMBER.restrict({ min: 0, max: 1 });\nvar DEGREE = NUMBER.restrict({ min: -360, max: 360 });\nvar NUMBER_OR_NAN = OR(NUMBER, NAN);\nvar ARRAY = attachArrayRestrictions(predicateWithMessage(isArray, \"an array\"));\nvar ARRAY_OF = (predicate, message) => predicateWithMessage(\n (value, ctx) => isArray(value) && value.every((item) => predicate(item, ctx)),\n (ctx) => {\n var _a;\n const arrayMessage = (_a = getPredicateMessage(ARRAY, ctx)) != null ? _a : \"\";\n return message ? `${arrayMessage} of ${message}` : arrayMessage;\n }\n);\nvar isComparable = (value) => isFiniteNumber(value) || isValidDate(value);\nvar LESS_THAN = (otherField) => predicateWithMessage(\n (v, ctx) => !isComparable(v) || !isComparable(ctx.target[otherField]) || v < ctx.target[otherField],\n `to be less than ${otherField}`\n);\nvar GREATER_THAN = (otherField) => predicateWithMessage(\n (v, ctx) => !isComparable(v) || !isComparable(ctx.target[otherField]) || v > ctx.target[otherField],\n `to be greater than ${otherField}`\n);\nvar DATE = predicateWithMessage(isValidDate, \"Date object\");\nvar DATE_OR_DATETIME_MS = OR(DATE, POSITIVE_NUMBER);\nvar colorMessage = `A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc`;\nvar COLOR_STRING = predicateWithMessage(\n (v) => isString(v) && Color.validColorString(v),\n `color String. ${colorMessage}`\n);\nvar COLOR_STRING_ARRAY = predicateWithMessage(ARRAY_OF(COLOR_STRING), `color strings. ${colorMessage}`);\nvar BOOLEAN_ARRAY = ARRAY_OF(BOOLEAN, \"boolean values\");\nvar NUMBER_ARRAY = ARRAY_OF(NUMBER, \"numbers\");\nvar STRING_ARRAY = ARRAY_OF(STRING, \"strings\");\nvar DATE_ARRAY = predicateWithMessage(ARRAY_OF(DATE), \"Date objects\");\nvar OBJECT_ARRAY = predicateWithMessage(ARRAY_OF(OBJECT), \"objects\");\nvar LINE_CAP = UNION([\"butt\", \"round\", \"square\"], \"a line cap\");\nvar LINE_JOIN = UNION([\"round\", \"bevel\", \"miter\"], \"a line join\");\nvar LINE_DASH = predicateWithMessage(\n ARRAY_OF(POSITIVE_NUMBER),\n \"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels.\"\n);\nvar POSITION2 = UNION([\"top\", \"right\", \"bottom\", \"left\"], \"a position\");\nvar FONT_STYLE = UNION([\"normal\", \"italic\", \"oblique\"], \"a font style\");\nvar FONT_WEIGHT2 = OR(\n UNION([\"normal\", \"bold\", \"bolder\", \"lighter\"], \"a font weight\"),\n NUMBER.restrict({ min: 1, max: 1e3 })\n);\nvar TEXT_WRAP = UNION([\"never\", \"always\", \"hyphenate\", \"on-space\"], \"a text wrap strategy\");\nvar TEXT_ALIGN = UNION([\"left\", \"center\", \"right\"], \"a text align\");\nvar VERTICAL_ALIGN = UNION([\"top\", \"middle\", \"bottom\"], \"a vertical align\");\nvar OVERFLOW_STRATEGY = UNION([\"ellipsis\", \"hide\"], \"an overflow strategy\");\nvar DIRECTION = UNION([\"horizontal\", \"vertical\"], \"a direction\");\nvar PLACEMENT = UNION([\"inside\", \"outside\"], \"a placement\");\nvar INTERACTION_RANGE = OR(UNION([\"exact\", \"nearest\"], \"interaction range\"), NUMBER);\nvar LABEL_PLACEMENT = UNION([\"top\", \"bottom\", \"left\", \"right\"]);\nfunction UNION(options, message = \"a\") {\n return predicateWithMessage(\n (v) => options.includes(v),\n `${message} keyword such as ${joinUnionOptions(options)}`\n );\n}\nvar MIN_SPACING = OR(AND(NUMBER.restrict({ min: 1 }), LESS_THAN(\"maxSpacing\")), NAN);\nvar MAX_SPACING = OR(AND(NUMBER.restrict({ min: 1 }), GREATER_THAN(\"minSpacing\")), NAN);\nfunction predicateWithMessage(predicate, message) {\n predicate.message = message;\n return predicate;\n}\nfunction joinUnionOptions(options) {\n const values = options.map((option) => `'${option}'`);\n if (values.length === 1) {\n return values[0];\n }\n const lastValue = values.pop();\n return `${values.join(\", \")} or ${lastValue}`;\n}\nfunction getPredicateMessage(predicate, ctx) {\n return isFunction(predicate.message) ? predicate.message(ctx) : predicate.message;\n}\nfunction getPredicateMessageMapper(ctx) {\n return (predicate) => getPredicateMessage(predicate, ctx);\n}\nfunction attachArrayRestrictions(predicate) {\n return Object.assign(predicate, {\n restrict({ length, minLength } = {}) {\n let message = \"an array\";\n if (isNumber(minLength) && minLength > 0) {\n message = \"a non-empty array\";\n } else if (isNumber(length)) {\n message = `an array of length ${length}`;\n }\n return predicateWithMessage(\n (value) => isArray(value) && (isNumber(length) ? value.length === length : true) && (isNumber(minLength) ? value.length >= minLength : true),\n message\n );\n }\n });\n}\nfunction attachNumberRestrictions(predicate) {\n return Object.assign(predicate, {\n restrict({ min, max } = {}) {\n const message = [\"a number\"];\n const hasMin = isNumber(min);\n const hasMax = isNumber(max);\n if (hasMin && hasMax) {\n message.push(`between ${min} and ${max} inclusive`);\n } else if (hasMin) {\n message.push(`greater than or equal to ${min}`);\n } else if (hasMax) {\n message.push(`less than or equal to ${max}`);\n }\n return predicateWithMessage(\n (value) => isFiniteNumber(value) && (hasMin ? value >= min : true) && (hasMax ? value <= max : true),\n message.join(\" \")\n );\n }\n });\n}\nfunction attachObjectRestrictions(predicate) {\n return Object.assign(predicate, {\n restrict(objectType) {\n return predicateWithMessage(\n (value) => value instanceof objectType,\n (ctx) => {\n var _a;\n return (_a = getPredicateMessage(predicate, ctx)) != null ? _a : `an instance of ${objectType.name}`;\n }\n );\n }\n });\n}\nfunction stringify(value) {\n if (typeof value === \"number\") {\n if (isNaN(value))\n return \"NaN\";\n if (value === Infinity)\n return \"Infinity\";\n if (value === -Infinity)\n return \"-Infinity\";\n }\n return JSON.stringify(value);\n}\n\n// packages/ag-charts-community/src/chart/axis/axisTick.ts\nvar TICK_INTERVAL = predicateWithMessage(\n (value) => isFiniteNumber(value) && value > 0 || value instanceof TimeInterval,\n `a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'`\n);\nvar AxisTick = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.enabled = true;\n this.width = 1;\n this.size = 6;\n this.color = void 0;\n this.interval = void 0;\n this.values = void 0;\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], AxisTick.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], AxisTick.prototype, \"width\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], AxisTick.prototype, \"size\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], AxisTick.prototype, \"color\", 2);\n__decorateClass([\n Validate(TICK_INTERVAL, { optional: true })\n], AxisTick.prototype, \"interval\", 2);\n__decorateClass([\n Validate(ARRAY, { optional: true })\n], AxisTick.prototype, \"values\", 2);\n\n// packages/ag-charts-community/src/chart/chartAxisDirection.ts\nvar ChartAxisDirection = /* @__PURE__ */ ((ChartAxisDirection2) => {\n ChartAxisDirection2[\"X\"] = \"x\";\n ChartAxisDirection2[\"Y\"] = \"y\";\n return ChartAxisDirection2;\n})(ChartAxisDirection || {});\n\n// packages/ag-charts-community/src/chart/chartOptions.ts\nvar JSON_APPLY_PLUGINS = {\n constructedArrays: /* @__PURE__ */ new WeakMap()\n};\nfunction assignJsonApplyConstructedArray(array, ctor) {\n var _a;\n (_a = JSON_APPLY_PLUGINS.constructedArrays) == null ? void 0 : _a.set(array, ctor);\n}\n\n// packages/ag-charts-community/src/scale/continuousScale.ts\nvar _ContinuousScale = class _ContinuousScale {\n constructor(domain, range3) {\n this.invalid = true;\n this.nice = false;\n this.interval = void 0;\n this.tickCount = _ContinuousScale.defaultTickCount;\n this.minTickCount = 0;\n this.maxTickCount = Infinity;\n this.niceDomain = [];\n this.defaultClampMode = \"raw\";\n this.domain = domain;\n this.range = range3;\n }\n static is(value) {\n return value instanceof _ContinuousScale;\n }\n transform(x) {\n return x;\n }\n transformInvert(x) {\n return x;\n }\n calcBandwidth(smallestInterval = 1) {\n const { range: range3 } = this;\n const domain = this.getDomain();\n const rangeDistance = Math.abs(range3[1] - range3[0]);\n const intervals = Math.abs(domain[1] - domain[0]) / smallestInterval + 1;\n const maxBands = Math.floor(rangeDistance);\n const bands = Math.min(intervals, maxBands);\n return rangeDistance / Math.max(1, bands);\n }\n getDomain() {\n if (this.nice) {\n this.refresh();\n if (this.niceDomain.length) {\n return this.niceDomain;\n }\n }\n return this.domain;\n }\n convert(x, opts) {\n var _a;\n const clampMode = (_a = opts == null ? void 0 : opts.clampMode) != null ? _a : this.defaultClampMode;\n if (!this.domain || this.domain.length < 2) {\n return NaN;\n }\n this.refresh();\n const domain = this.getDomain().map((d) => this.transform(d));\n const [d0, d1] = domain;\n const { range: range3 } = this;\n const [r0, r1] = range3;\n x = this.transform(x);\n if (clampMode === \"clamped\") {\n const [start, stop] = findMinMax(domain.map(Number));\n if (Number(x) < start) {\n return r0;\n } else if (Number(x) > stop) {\n return r1;\n }\n }\n if (d0 === d1) {\n return (r0 + r1) / 2;\n } else if (x === d0) {\n return r0;\n } else if (x === d1) {\n return r1;\n }\n return r0 + (Number(x) - Number(d0)) / (Number(d1) - Number(d0)) * (r1 - r0);\n }\n invert(x) {\n this.refresh();\n const domain = this.getDomain().map((d2) => this.transform(d2));\n const [d0, d1] = domain;\n const { range: range3 } = this;\n const [r0, r1] = range3;\n const isReversed = r0 > r1;\n const rMin = isReversed ? r1 : r0;\n const rMax = isReversed ? r0 : r1;\n let d;\n if (x < rMin) {\n return isReversed ? d1 : d0;\n } else if (x > rMax) {\n return isReversed ? d0 : d1;\n } else if (r0 === r1) {\n d = this.toDomain((Number(d0) + Number(d1)) / 2);\n } else {\n d = this.toDomain(Number(d0) + (x - r0) / (r1 - r0) * (Number(d1) - Number(d0)));\n }\n return this.transformInvert(d);\n }\n refresh() {\n if (!this.invalid)\n return;\n this.invalid = false;\n this.update();\n if (this.invalid) {\n Logger.warnOnce(\"Expected update to not invalidate scale\");\n }\n }\n getPixelRange() {\n const [a, b] = this.range;\n return Math.abs(b - a);\n }\n};\n_ContinuousScale.defaultTickCount = 5;\n_ContinuousScale.defaultMaxTickCount = 6;\n__decorateClass([\n Invalidating\n], _ContinuousScale.prototype, \"domain\", 2);\n__decorateClass([\n Invalidating\n], _ContinuousScale.prototype, \"range\", 2);\n__decorateClass([\n Invalidating\n], _ContinuousScale.prototype, \"nice\", 2);\n__decorateClass([\n Invalidating\n], _ContinuousScale.prototype, \"interval\", 2);\n__decorateClass([\n Invalidating\n], _ContinuousScale.prototype, \"tickCount\", 2);\n__decorateClass([\n Invalidating\n], _ContinuousScale.prototype, \"minTickCount\", 2);\n__decorateClass([\n Invalidating\n], _ContinuousScale.prototype, \"maxTickCount\", 2);\nvar ContinuousScale = _ContinuousScale;\n\n// packages/ag-charts-community/src/util/timeFormat.ts\nvar CONSTANTS = {\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n ],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n};\nfunction dayOfYear(date, startOfYear = new Date(date.getFullYear(), 0, 1)) {\n const startOffset = date.getTimezoneOffset() - startOfYear.getTimezoneOffset();\n const timeDiff = date.getTime() - startOfYear.getTime() + startOffset * 6e4;\n const timeOneDay = 36e5 * 24;\n return Math.floor(timeDiff / timeOneDay);\n}\nfunction weekOfYear(date, startDay) {\n const startOfYear = new Date(date.getFullYear(), 0, 1);\n const startOfYearDay = startOfYear.getDay();\n const firstWeekStartOffset = (startDay - startOfYearDay + 7) % 7;\n const startOffset = new Date(date.getFullYear(), 0, firstWeekStartOffset + 1);\n if (startOffset <= date) {\n return Math.floor(dayOfYear(date, startOffset) / 7) + 1;\n }\n return 0;\n}\nvar SUNDAY = 0;\nvar MONDAY = 1;\nvar THURSDAY = 4;\nfunction isoWeekOfYear(date, year2 = date.getFullYear()) {\n const firstOfYear = new Date(year2, 0, 1);\n const firstOfYearDay = firstOfYear.getDay();\n const firstThursdayOffset = (THURSDAY - firstOfYearDay + 7) % 7;\n const startOffset = new Date(year2, 0, firstThursdayOffset - (THURSDAY - MONDAY) + 1);\n if (startOffset <= date) {\n return Math.floor(dayOfYear(date, startOffset) / 7) + 1;\n }\n return isoWeekOfYear(date, year2 - 1);\n}\nfunction timezone(date) {\n const offset4 = date.getTimezoneOffset();\n const unsignedOffset = Math.abs(offset4);\n const sign = offset4 > 0 ? \"-\" : \"+\";\n return `${sign}${pad(Math.floor(unsignedOffset / 60), 2, \"0\")}${pad(Math.floor(unsignedOffset % 60), 2, \"0\")}`;\n}\nvar FORMATTERS = {\n a: (d) => CONSTANTS.shortDays[d.getDay()],\n A: (d) => CONSTANTS.days[d.getDay()],\n b: (d) => CONSTANTS.shortMonths[d.getMonth()],\n B: (d) => CONSTANTS.months[d.getMonth()],\n c: \"%x, %X\",\n d: (d, p) => pad(d.getDate(), 2, p != null ? p : \"0\"),\n e: \"%_d\",\n f: (d, p) => pad(d.getMilliseconds() * 1e3, 6, p != null ? p : \"0\"),\n H: (d, p) => pad(d.getHours(), 2, p != null ? p : \"0\"),\n I: (d, p) => {\n const hours = d.getHours() % 12;\n return hours === 0 ? \"12\" : pad(hours, 2, p != null ? p : \"0\");\n },\n j: (d, p) => pad(dayOfYear(d) + 1, 3, p != null ? p : \"0\"),\n m: (d, p) => pad(d.getMonth() + 1, 2, p != null ? p : \"0\"),\n M: (d, p) => pad(d.getMinutes(), 2, p != null ? p : \"0\"),\n L: (d, p) => pad(d.getMilliseconds(), 3, p != null ? p : \"0\"),\n p: (d) => d.getHours() < 12 ? \"AM\" : \"PM\",\n Q: (d) => String(d.getTime()),\n s: (d) => String(Math.floor(d.getTime() / 1e3)),\n S: (d, p) => pad(d.getSeconds(), 2, p != null ? p : \"0\"),\n u: (d) => {\n let day2 = d.getDay();\n if (day2 < 1)\n day2 += 7;\n return String(day2 % 7);\n },\n U: (d, p) => pad(weekOfYear(d, SUNDAY), 2, p != null ? p : \"0\"),\n V: (d, p) => pad(isoWeekOfYear(d), 2, p != null ? p : \"0\"),\n w: (d, p) => pad(d.getDay(), 2, p != null ? p : \"0\"),\n W: (d, p) => pad(weekOfYear(d, MONDAY), 2, p != null ? p : \"0\"),\n x: \"%-m/%-d/%Y\",\n X: \"%-I:%M:%S %p\",\n y: (d, p) => pad(d.getFullYear() % 100, 2, p != null ? p : \"0\"),\n Y: (d, p) => pad(d.getFullYear(), 4, p != null ? p : \"0\"),\n Z: (d) => timezone(d),\n \"%\": () => \"%\"\n};\nvar PADS = {\n _: \" \",\n \"0\": \"0\",\n \"-\": \"\"\n};\nfunction pad(value, size, padChar) {\n const output = String(Math.floor(value));\n if (output.length >= size) {\n return output;\n }\n return `${padChar.repeat(size - output.length)}${output}`;\n}\nfunction buildFormatter(formatString) {\n const formatParts = [];\n while (formatString.length > 0) {\n let nextEscapeIdx = formatString.indexOf(\"%\");\n if (nextEscapeIdx !== 0) {\n const literalPart = nextEscapeIdx > 0 ? formatString.substring(0, nextEscapeIdx) : formatString;\n formatParts.push(literalPart);\n }\n if (nextEscapeIdx < 0)\n break;\n const maybePadSpecifier = formatString[nextEscapeIdx + 1];\n const maybePad = PADS[maybePadSpecifier];\n if (maybePad != null) {\n nextEscapeIdx++;\n }\n const maybeFormatterSpecifier = formatString[nextEscapeIdx + 1];\n const maybeFormatter = FORMATTERS[maybeFormatterSpecifier];\n if (typeof maybeFormatter === \"function\") {\n formatParts.push([maybeFormatter, maybePad]);\n } else if (typeof maybeFormatter === \"string\") {\n const formatter = buildFormatter(maybeFormatter);\n formatParts.push([formatter, maybePad]);\n } else {\n formatParts.push(`${maybePad != null ? maybePad : \"\"}${maybeFormatterSpecifier}`);\n }\n formatString = formatString.substring(nextEscapeIdx + 2);\n }\n return (dateTime) => {\n const dateTimeAsDate = typeof dateTime === \"number\" ? new Date(dateTime) : dateTime;\n return formatParts.map((c) => typeof c === \"string\" ? c : c[0](dateTimeAsDate, c[1])).join(\"\");\n };\n}\n\n// packages/ag-charts-community/src/util/timeFormatDefaults.ts\nfunction dateToNumber(x) {\n return x instanceof Date ? x.getTime() : x;\n}\nfunction defaultTimeTickFormat(ticks, domain) {\n const formatString = calculateDefaultTimeTickFormat(ticks, domain);\n return (date) => buildFormatter(formatString)(date);\n}\nfunction calculateDefaultTimeTickFormat(ticks = [], domain = ticks) {\n let defaultTimeFormat = 8 /* YEAR */;\n const updateFormat = (format2) => {\n if (format2 < defaultTimeFormat) {\n defaultTimeFormat = format2;\n }\n };\n for (const value of ticks) {\n const format2 = getLowestGranularityFormat(value);\n updateFormat(format2);\n }\n const startDomain = dateToNumber(domain[0]);\n const endDomain = dateToNumber(domain.at(-1));\n const startYear = new Date(startDomain).getFullYear();\n const stopYear = new Date(endDomain).getFullYear();\n const yearChange = stopYear - startYear > 0;\n return formatStringBuilder(defaultTimeFormat, yearChange, ticks);\n}\nfunction getLowestGranularityFormat(value) {\n if (second_default.floor(value) < value) {\n return 0 /* MILLISECOND */;\n } else if (minute_default.floor(value) < value) {\n return 1 /* SECOND */;\n } else if (hour_default.floor(value) < value) {\n return 2 /* MINUTE */;\n } else if (day_default.floor(value) < value) {\n return 3 /* HOUR */;\n } else if (month_default.floor(value) < value) {\n if (week_default.floor(value) < value) {\n return 4 /* WEEK_DAY */;\n }\n return 5 /* SHORT_MONTH */;\n } else if (year_default.floor(value) < value) {\n return 6 /* MONTH */;\n }\n return 8 /* YEAR */;\n}\nfunction formatStringBuilder(defaultTimeFormat, yearChange, ticks) {\n const firstTick = dateToNumber(ticks[0]);\n const lastTick = dateToNumber(ticks.at(-1));\n const extent2 = Math.abs(lastTick - firstTick);\n const activeYear = yearChange || defaultTimeFormat === 8 /* YEAR */;\n const activeDate = extent2 === 0;\n const parts = [\n [\"hour\", 6 * durationHour, 14 * durationDay, 3 /* HOUR */, \"%I %p\"],\n [\"hour\", durationMinute, 6 * durationHour, 3 /* HOUR */, \"%I:%M\"],\n [\"second\", 1e3, 6 * durationHour, 1 /* SECOND */, \":%S\"],\n [\"ms\", 0, 6 * durationHour, 0 /* MILLISECOND */, \".%L\"],\n [\"am/pm\", durationMinute, 6 * durationHour, 3 /* HOUR */, \"%p\"],\n \" \",\n [\"day\", durationDay, 1 * durationWeek, 4 /* WEEK_DAY */, \"%a\"],\n [\"month\", activeDate ? 0 : durationWeek, 52 * durationWeek, 5 /* SHORT_MONTH */, \"%b %d\"],\n [\"month\", 5 * durationWeek, 10 * durationYear, 6 /* MONTH */, \"%B\"],\n \" \",\n [\"year\", activeYear ? 0 : durationYear, Infinity, 8 /* YEAR */, \"%Y\"]\n ];\n const formatParts = parts.filter((v) => {\n if (typeof v === \"string\")\n return true;\n const [_, min, max, format2] = v;\n return format2 >= defaultTimeFormat && min <= extent2 && extent2 < max;\n }).reduce(\n (r, next) => {\n if (typeof next === \"string\") {\n r.result.push(next);\n } else if (!r.used.has(next[0])) {\n r.result.push(next);\n r.used.add(next[0]);\n }\n return r;\n },\n { result: [], used: /* @__PURE__ */ new Set() }\n ).result;\n const firstFormat = formatParts.findIndex((v) => typeof v !== \"string\");\n const lastFormat = formatParts.length - [...formatParts].reverse().findIndex((v) => typeof v !== \"string\");\n return formatParts.slice(firstFormat, lastFormat).map((v) => typeof v === \"string\" ? v : v[4]).join(\"\").replaceAll(/\\s+/g, \" \").trim();\n}\n\n// packages/ag-charts-community/src/util/ticks.ts\nvar createNumericTicks = (fractionDigits, takingValues = []) => Object.assign(takingValues, { fractionDigits });\nfunction ticks_default(start, stop, count, minCount, maxCount) {\n if (count < 2) {\n return range(start, stop, stop - start);\n }\n const step = tickStep(start, stop, count, minCount, maxCount);\n if (isNaN(step)) {\n return createNumericTicks(0);\n }\n start = Math.ceil(start / step) * step;\n stop = Math.floor(stop / step) * step;\n return range(start, stop, step);\n}\nvar tickMultipliers = [1, 2, 5, 10];\nfunction tickStep(a, b, count, minCount = 0, maxCount = Infinity) {\n const extent2 = Math.abs(b - a);\n const rawStep = extent2 / count;\n const power = Math.floor(Math.log10(rawStep));\n const step = Math.pow(10, power);\n const m = tickMultipliers.map((multiplier) => {\n const s = multiplier * step;\n const c = Math.ceil(extent2 / s);\n const isWithinBounds = c >= minCount && c <= maxCount;\n const diffCount = Math.abs(c - count);\n return { multiplier, isWithinBounds, diffCount };\n }).sort((a2, b2) => {\n if (a2.isWithinBounds !== b2.isWithinBounds) {\n return a2.isWithinBounds ? -1 : 1;\n }\n return a2.diffCount - b2.diffCount;\n })[0].multiplier;\n if (!m || isNaN(m)) {\n return NaN;\n }\n return m * step;\n}\nfunction singleTickDomain(a, b) {\n const extent2 = Math.abs(b - a);\n const power = Math.floor(Math.log10(extent2));\n const step = Math.pow(10, power);\n const roundStart = a > b ? Math.ceil : Math.floor;\n const roundStop = b < a ? Math.floor : Math.ceil;\n return tickMultipliers.map((multiplier) => {\n const s = multiplier * step;\n const start = roundStart(a / s) * s;\n const end = roundStop(b / s) * s;\n const error = 1 - extent2 / Math.abs(end - start);\n const domain = [start, end];\n return { error, domain };\n }).sort((a2, b2) => a2.error - b2.error)[0].domain;\n}\nfunction range(start, stop, step) {\n const d0 = Math.min(start, stop);\n const d1 = Math.max(start, stop);\n const fractionalDigits = countFractionDigits(step);\n const f = Math.pow(10, fractionalDigits);\n const n = Math.ceil((d1 - d0) / step);\n const values = createNumericTicks(fractionalDigits);\n for (let i = 0; i <= n; i++) {\n const value = d0 + step * i;\n values.push(Math.round(value * f) / f);\n }\n return values;\n}\nfunction isDenseInterval({\n start,\n stop,\n interval,\n count,\n availableRange\n}) {\n const domain = stop - start;\n const step = typeof interval === \"number\" ? interval : 1;\n count != null ? count : count = domain / step;\n if (count >= availableRange) {\n Logger.warnOnce(\n `the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration`\n );\n return true;\n }\n return false;\n}\n\n// packages/ag-charts-community/src/scale/timeScale.ts\nvar _TimeScale = class _TimeScale extends ContinuousScale {\n constructor() {\n super([], [0, 1]);\n this.type = \"time\";\n }\n toDomain(d) {\n return new Date(d);\n }\n /**\n * @param options Tick interval options.\n * @param options.start The start time (timestamp).\n * @param options.stop The end time (timestamp).\n * @param options.count Number of intervals between ticks.\n */\n static getTickInterval({\n start,\n stop,\n count,\n minCount,\n maxCount,\n target\n }) {\n let countableTimeInterval;\n let step;\n const tickCount = count != null ? count : ContinuousScale.defaultTickCount;\n const targetInterval = target != null ? target : Math.abs(stop - start) / Math.max(tickCount, 1);\n const i = _TimeScale.getIntervalIndex(targetInterval);\n if (i === 0) {\n step = Math.max(tickStep(start, stop, tickCount, minCount, maxCount), 1);\n countableTimeInterval = millisecond_default;\n } else if (i === _TimeScale.tickIntervals.length) {\n const y0 = start / durationYear;\n const y1 = stop / durationYear;\n step = target === void 0 ? tickStep(y0, y1, tickCount, minCount, maxCount) : 1;\n countableTimeInterval = year_default;\n } else {\n const diff0 = targetInterval - _TimeScale.tickIntervals[i - 1][2];\n const diff1 = _TimeScale.tickIntervals[i][2] - targetInterval;\n const index = diff0 < diff1 ? i - 1 : i;\n [countableTimeInterval, step] = _TimeScale.tickIntervals[index];\n }\n return countableTimeInterval.every(step);\n }\n static getIntervalIndex(target) {\n let i = 0;\n while (i < _TimeScale.tickIntervals.length && target > _TimeScale.tickIntervals[i][2]) {\n i++;\n }\n return i;\n }\n invert(y) {\n return new Date(super.invert(y));\n }\n /**\n * Returns uniformly-spaced dates that represent the scale's domain.\n */\n ticks() {\n if (!this.domain || this.domain.length < 2) {\n return [];\n }\n this.refresh();\n const [t0, t1] = this.getDomain().map(dateToNumber);\n const start = Math.min(t0, t1);\n const stop = Math.max(t0, t1);\n const { interval, nice, tickCount, minTickCount, maxTickCount } = this;\n if (interval !== void 0) {\n const availableRange = this.getPixelRange();\n const ticks = _TimeScale.getTicksForInterval({ start, stop, interval, availableRange });\n return ticks != null ? ticks : _TimeScale.getDefaultTicks({ start, stop, tickCount, minTickCount, maxTickCount });\n }\n if (nice) {\n if (tickCount === 2) {\n return this.niceDomain;\n }\n if (tickCount === 1) {\n return this.niceDomain.slice(0, 1);\n }\n }\n return _TimeScale.getDefaultTicks({ start, stop, tickCount, minTickCount, maxTickCount });\n }\n static getDefaultTicks({\n start,\n stop,\n tickCount,\n minTickCount,\n maxTickCount\n }) {\n const t = _TimeScale.getTickInterval({\n start,\n stop,\n count: tickCount,\n minCount: minTickCount,\n maxCount: maxTickCount\n });\n return t ? t.range(new Date(start), new Date(stop)) : [];\n }\n static getTicksForInterval({\n start,\n stop,\n interval,\n availableRange\n }) {\n if (!interval) {\n return [];\n }\n if (interval instanceof TimeInterval) {\n const ticks2 = interval.range(new Date(start), new Date(stop));\n if (isDenseInterval({ start, stop, interval, count: ticks2.length, availableRange })) {\n return;\n }\n return ticks2;\n }\n const absInterval = Math.abs(interval);\n if (isDenseInterval({ start, stop, interval: absInterval, availableRange })) {\n return;\n }\n const reversedInterval = [..._TimeScale.tickIntervals];\n reversedInterval.reverse();\n const timeInterval = reversedInterval.find((tickInterval) => absInterval % tickInterval[2] === 0);\n if (timeInterval) {\n const i = timeInterval[0].every(absInterval / (timeInterval[2] / timeInterval[1]));\n return i.range(new Date(start), new Date(stop));\n }\n let date = new Date(start);\n const stopDate = new Date(stop);\n const ticks = [];\n while (date <= stopDate) {\n ticks.push(date);\n date = new Date(date);\n date.setMilliseconds(date.getMilliseconds() + absInterval);\n }\n return ticks;\n }\n /**\n * Returns a time format function suitable for displaying tick values.\n * @param specifier If the specifier string is provided, this method is equivalent to\n * the {@link TimeLocaleObject.format} method.\n * If no specifier is provided, this method returns the default time format function.\n */\n tickFormat({\n ticks,\n domain,\n specifier\n }) {\n return specifier == null ? defaultTimeTickFormat(ticks, domain) : buildFormatter(specifier);\n }\n update() {\n if (!this.domain || this.domain.length < 2) {\n return;\n }\n if (this.nice) {\n this.updateNiceDomain();\n }\n }\n /**\n * Extends the domain so that it starts and ends on nice round values.\n * This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value.\n */\n updateNiceDomain() {\n const maxAttempts = 4;\n let [d0, d1] = this.domain;\n for (let i = 0; i < maxAttempts; i++) {\n this.updateNiceDomainIteration(d0, d1);\n const [n0, n1] = this.niceDomain;\n if (dateToNumber(d0) === dateToNumber(n0) && dateToNumber(d1) === dateToNumber(n1)) {\n break;\n }\n d0 = n0;\n d1 = n1;\n }\n }\n updateNiceDomainIteration(d0, d1) {\n const start = Math.min(dateToNumber(d0), dateToNumber(d1));\n const stop = Math.max(dateToNumber(d0), dateToNumber(d1));\n const isReversed = d0 > d1;\n const { interval } = this;\n let i;\n if (interval instanceof TimeInterval) {\n i = interval;\n } else {\n const tickCount = typeof interval === \"number\" ? (stop - start) / Math.max(interval, 1) : this.tickCount;\n i = _TimeScale.getTickInterval({\n start,\n stop,\n count: tickCount,\n minCount: this.minTickCount,\n maxCount: this.maxTickCount\n });\n }\n if (i) {\n const intervalRange = i.range(new Date(start), new Date(stop), true);\n const domain = isReversed ? [...intervalRange].reverse() : intervalRange;\n const n0 = domain[0];\n const n1 = domain.at(-1);\n this.niceDomain = [n0, n1];\n }\n }\n};\n/**\n * Array of default tick intervals in the following format:\n *\n * [\n * interval (unit of time),\n * number of units (step),\n * the length of that number of units in milliseconds\n * ]\n */\n_TimeScale.tickIntervals = [\n [second_default, 1, durationSecond],\n [second_default, 5, 5 * durationSecond],\n [second_default, 15, 15 * durationSecond],\n [second_default, 30, 30 * durationSecond],\n [minute_default, 1, durationMinute],\n [minute_default, 5, 5 * durationMinute],\n [minute_default, 15, 15 * durationMinute],\n [minute_default, 30, 30 * durationMinute],\n [hour_default, 1, durationHour],\n [hour_default, 3, 3 * durationHour],\n [hour_default, 6, 6 * durationHour],\n [hour_default, 12, 12 * durationHour],\n [day_default, 1, durationDay],\n [day_default, 2, 2 * durationDay],\n [week_default, 1, durationWeek],\n [week_default, 2, 2 * durationWeek],\n [week_default, 3, 3 * durationWeek],\n [month_default, 1, durationMonth],\n [month_default, 2, 2 * durationMonth],\n [month_default, 3, 3 * durationMonth],\n [month_default, 4, 4 * durationMonth],\n [month_default, 6, 6 * durationMonth],\n [year_default, 1, durationYear]\n];\nvar TimeScale = _TimeScale;\n\n// packages/ag-charts-community/src/scale/ordinalTimeScale.ts\nvar _OrdinalTimeScale = class _OrdinalTimeScale extends BandScale {\n constructor() {\n super(...arguments);\n this.type = \"ordinal-time\";\n this.tickCount = ContinuousScale.defaultTickCount;\n this.minTickCount = 0;\n this.maxTickCount = Infinity;\n this.interval = void 0;\n this.index = /* @__PURE__ */ new Map();\n /**\n * Contains unique datums only. Since `{}` is used in place of `Map`\n * for IE11 compatibility, the datums are converted `toString` before\n * the uniqueness check.\n */\n this._domain = [];\n }\n static is(value) {\n return value instanceof _OrdinalTimeScale;\n }\n toDomain(d) {\n return new Date(d);\n }\n set domain(values) {\n this.invalid = true;\n if (values.length === 0) {\n this._domain = [];\n return;\n }\n const domain = this.updateIndex(values);\n this._domain = domain;\n }\n get domain() {\n return this._domain;\n }\n updateIndex(values) {\n this.index = /* @__PURE__ */ new Map();\n const { index } = this;\n const domain = [];\n const extents = [];\n const isReversed = values[0] > values.at(-1);\n const indexShift = isReversed ? 0 : 1;\n values.forEach((value, i2) => {\n const nextValue = values[i2 + 1];\n const e02 = isReversed ? value : this.toDomain(dateToNumber(value) + 1);\n const e12 = isReversed ? this.toDomain(dateToNumber(nextValue) + 1) : nextValue;\n const dateRange2 = isReversed ? [e12, e02] : [e02, e12];\n domain.push(value);\n if (nextValue !== void 0 && index.get(dateRange2) === void 0) {\n extents.push(Math.abs(dateToNumber(e12) - dateToNumber(e02)));\n index.set(dateRange2, i2 + indexShift);\n }\n });\n extents.sort((a, b) => a - b);\n const bands = extents.length;\n const middleIndex = Math.floor(bands / 2);\n this.medianInterval = bands > 2 && bands % 2 === 0 ? (extents[middleIndex - 1] + extents[middleIndex + 1]) / 2 : extents[middleIndex];\n const intervalIndex = Math.max(0, TimeScale.getIntervalIndex(this.medianInterval) - 1);\n const [countableTimeInterval, step] = TimeScale.tickIntervals[intervalIndex];\n const interval = countableTimeInterval.every(step);\n const i = isReversed ? values.length - 1 : 0;\n const e1 = values[i];\n const e0 = interval.floor(values[i]);\n const dateRange = [e0, e1];\n index.set(dateRange, i);\n return domain;\n }\n ticks() {\n if (!this.domain) {\n return [];\n }\n this.refresh();\n const [t0, t1] = [dateToNumber(this.domain[0]), dateToNumber(this.domain.at(-1))];\n const start = Math.min(t0, t1);\n const stop = Math.max(t0, t1);\n const isReversed = t0 > t1;\n let ticks;\n if (this.interval !== void 0) {\n ticks = this.getTicksForInterval({ start, stop, interval: this.interval });\n }\n const n = this.domain.length;\n const { maxTickCount, tickCount } = this;\n let { minTickCount } = this;\n let medianInterval;\n if (isFinite(maxTickCount) && n <= maxTickCount) {\n minTickCount = Math.max(1, n);\n medianInterval = this.medianInterval;\n }\n ticks != null ? ticks : ticks = this.getDefaultTicks({\n start,\n stop,\n tickCount,\n minTickCount,\n maxTickCount,\n isReversed,\n interval: medianInterval\n });\n const tickPositions = /* @__PURE__ */ new Set();\n return ticks.filter((tick) => {\n const position = this.convert(tick);\n if (isNaN(position) || tickPositions.has(position)) {\n return false;\n }\n tickPositions.add(position);\n return true;\n });\n }\n getDefaultTicks({\n start,\n stop,\n tickCount,\n minTickCount,\n maxTickCount,\n isReversed,\n interval\n }) {\n const tickInterval = TimeScale.getTickInterval({\n start,\n stop,\n count: tickCount,\n minCount: minTickCount,\n maxCount: maxTickCount,\n target: interval\n });\n if (!tickInterval) {\n return [];\n }\n const tickEvery = Math.ceil(this.domain.length / maxTickCount);\n const ticks = [];\n for (const [dateRange, index] of this.index.entries()) {\n if (index % tickEvery > 0) {\n continue;\n }\n const tick = isReversed ? tickInterval.ceil(dateRange[0]) : tickInterval.floor(dateRange[1]);\n ticks.splice(index, 0, tick);\n }\n return ticks;\n }\n getTicksForInterval({\n start,\n stop,\n interval\n }) {\n var _a;\n const [r0, r1] = this.range;\n const availableRange = Math.abs(r1 - r0);\n return (_a = TimeScale.getTicksForInterval({ start, stop, interval, availableRange })) != null ? _a : [];\n }\n convert(d) {\n if (typeof d === \"number\") {\n d = new Date(d);\n }\n if (!(d instanceof Date)) {\n return NaN;\n }\n this.refresh();\n let i;\n for (const [dateRange, index] of this.index.entries()) {\n if (d >= dateRange[0] && d <= dateRange[1]) {\n i = index;\n break;\n }\n }\n if (i === void 0) {\n return NaN;\n }\n const r = this.ordinalRange[i];\n if (r === void 0) {\n return NaN;\n }\n return r;\n }\n /**\n * Returns a time format function suitable for displaying tick values.\n * @param specifier If the specifier string is provided, this method is equivalent to\n * the {@link TimeLocaleObject.format} method.\n * If no specifier is provided, this method returns the default time format function.\n */\n tickFormat({\n ticks,\n domain,\n specifier\n }) {\n return specifier == null ? defaultTimeTickFormat(ticks, domain) : buildFormatter(specifier);\n }\n invert(y) {\n return new Date(super.invert(y));\n }\n invertNearest(y) {\n return new Date(super.invertNearest(y));\n }\n};\n__decorateClass([\n Invalidating\n], _OrdinalTimeScale.prototype, \"tickCount\", 2);\n__decorateClass([\n Invalidating\n], _OrdinalTimeScale.prototype, \"minTickCount\", 2);\n__decorateClass([\n Invalidating\n], _OrdinalTimeScale.prototype, \"maxTickCount\", 2);\n__decorateClass([\n Invalidating\n], _OrdinalTimeScale.prototype, \"interval\", 2);\nvar OrdinalTimeScale = _OrdinalTimeScale;\n\n// packages/ag-charts-community/src/util/compare.ts\nfunction ascendingStringNumberUndefined(a, b) {\n if (typeof a === \"number\" && typeof b === \"number\") {\n return a - b;\n } else if (typeof a === \"string\" && typeof b === \"string\") {\n return a.localeCompare(b);\n } else if (a == null && b == null) {\n return 0;\n } else if (a == null) {\n return -1;\n } else if (b == null) {\n return 1;\n }\n return String(a).localeCompare(String(b));\n}\nfunction toLiteral(v) {\n return typeof v === \"function\" ? v() : v;\n}\nfunction compoundAscending(a, b, comparator) {\n for (const idx in a) {\n const diff2 = comparator(toLiteral(a[idx]), toLiteral(b[idx]));\n if (diff2 !== 0) {\n return diff2;\n }\n }\n return 0;\n}\n\n// packages/ag-charts-community/src/scene/group.ts\nvar _Group = class _Group extends Node {\n constructor(opts) {\n var _a;\n super({ isVirtual: opts == null ? void 0 : opts.isVirtual });\n this.opts = opts;\n this.opacity = 1;\n this.lastBBox = void 0;\n const { zIndex, zIndexSubOrder } = opts != null ? opts : {};\n this.isContainerNode = true;\n if (zIndex !== void 0) {\n this.zIndex = zIndex;\n }\n if (zIndexSubOrder !== void 0) {\n this.zIndexSubOrder = zIndexSubOrder;\n }\n this.name = (_a = this.opts) == null ? void 0 : _a.name;\n }\n static is(value) {\n return value instanceof _Group;\n }\n onZIndexChange() {\n var _a;\n super.onZIndexChange();\n if (this.layer) {\n (_a = this._layerManager) == null ? void 0 : _a.moveLayer(this.layer, this.zIndex, this.zIndexSubOrder);\n }\n }\n isLayer() {\n return this.layer != null;\n }\n _setLayerManager(layersManager) {\n if (this._layerManager && this.layer) {\n this._layerManager.removeLayer(this.layer);\n this.layer = void 0;\n }\n if (this.layer) {\n throw new Error(\"AG Charts - unable to deregister scene rendering layer!\");\n }\n super._setLayerManager(layersManager);\n }\n initialiseLayer() {\n var _a;\n if (this.layer)\n return;\n if (!this._layerManager || ((_a = this.opts) == null ? void 0 : _a.layer) !== true)\n return;\n this.layer = this._layerManager.addLayer({\n name: this.name,\n zIndex: this.zIndex,\n zIndexSubOrder: this.zIndexSubOrder,\n getComputedOpacity: () => this.getComputedOpacity(),\n getVisibility: () => this.getVisibility()\n });\n }\n getComputedOpacity() {\n let opacity = 1;\n for (const node of this.traverseUp()) {\n if (node instanceof _Group) {\n opacity *= node.opacity;\n }\n }\n return opacity;\n }\n getVisibility() {\n for (const node of this.traverseUp()) {\n if (!node.visible) {\n return false;\n }\n }\n return true;\n }\n onVisibleChange() {\n if (this.layer) {\n this.layer.enabled = this.visible;\n }\n }\n markDirty(source, type = 1 /* TRIVIAL */) {\n if (this.isVirtual) {\n super.markDirty(source, type);\n return;\n }\n let parentType = type;\n if (type < 2 /* MINOR */ || this.layer != null) {\n parentType = 1 /* TRIVIAL */;\n }\n super.markDirty(source, type, parentType);\n }\n // We consider a group to be boundless, thus any point belongs to it.\n containsPoint(_x, _y) {\n return true;\n }\n computeBBox() {\n this.computeTransformMatrix();\n return _Group.computeBBox(this.children);\n }\n computeTransformedBBox() {\n return this.computeBBox();\n }\n preRender() {\n var _a, _b;\n const counts = super.preRender();\n counts.groups += 1;\n counts.nonGroups -= 1;\n if (((_a = this.opts) == null ? void 0 : _a.layer) !== true || this.layer != null)\n return counts;\n if (counts.nonGroups > 0) {\n this.initialiseLayer();\n }\n if (((_b = this.opts) == null ? void 0 : _b.nonEmptyChildDerivedZIndex) && counts.nonGroups > 0) {\n this.deriveZIndexFromChildren();\n }\n return counts;\n }\n deriveZIndexFromChildren() {\n var _a;\n const children = this.children.filter((c) => c._childNodeCounts.nonGroups > 0);\n this.sortChildren(children);\n const lastChild = children.at(-1);\n this.zIndex = (_a = lastChild == null ? void 0 : lastChild.zIndex) != null ? _a : -Infinity;\n this.zIndexSubOrder = lastChild == null ? void 0 : lastChild.zIndexSubOrder;\n }\n render(renderCtx) {\n var _a, _b;\n const { opts: { name = void 0 } = {}, _debug: debug3 } = this;\n const { dirty, dirtyZIndex, layer, children, clipRect, dirtyTransform } = this;\n let { ctx, forceRender, clipBBox } = renderCtx;\n const { resized, stats } = renderCtx;\n const canvasCtxTransform = ctx.getTransform();\n const isDirty = dirty >= 2 /* MINOR */ || dirtyZIndex || resized;\n let isChildDirty = isDirty;\n let isChildLayerDirty = false;\n for (const child of children) {\n isChildDirty || (isChildDirty = child.layerManager == null && child.dirty >= 1 /* TRIVIAL */);\n isChildLayerDirty || (isChildLayerDirty = child.layerManager != null && child.dirty >= 1 /* TRIVIAL */);\n if (isChildDirty) {\n break;\n }\n }\n if (name) {\n debug3 == null ? void 0 : debug3({ name, group: this, isDirty, isChildDirty, dirtyTransform, renderCtx, forceRender });\n }\n if (dirtyTransform) {\n forceRender = \"dirtyTransform\";\n } else if (layer) {\n const currentBBox = this.computeBBox();\n if (this.lastBBox === void 0 || !this.lastBBox.equals(currentBBox)) {\n forceRender = \"dirtyTransform\";\n this.lastBBox = currentBBox;\n }\n }\n if (!isDirty && !isChildDirty && !isChildLayerDirty && !forceRender) {\n if (name && stats) {\n debug3 == null ? void 0 : debug3({ name, result: \"skipping\", renderCtx, counts: this.nodeCount, group: this });\n }\n if (layer && stats) {\n stats.layersSkipped++;\n stats.nodesSkipped += this.nodeCount.count;\n }\n this.markClean({ recursive: false });\n return;\n }\n const groupVisible = this.visible;\n if (layer) {\n ctx = layer.context;\n ctx.save();\n ctx.setTransform(layer.pixelRatio, 0, 0, layer.pixelRatio, 0, 0);\n if (forceRender !== \"dirtyTransform\") {\n forceRender = isChildDirty || dirtyZIndex;\n }\n if (forceRender)\n layer.clear();\n if (clipBBox) {\n const { width, height, x, y } = clipBBox;\n debug3 == null ? void 0 : debug3(() => ({\n name,\n clipBBox,\n ctxTransform: ctx.getTransform(),\n renderCtx,\n group: this\n }));\n ctx.beginPath();\n ctx.rect(x, y, width, height);\n ctx.clip();\n }\n ctx.setTransform(canvasCtxTransform);\n } else {\n ctx.globalAlpha *= this.opacity;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n if (clipRect) {\n const { x, y, width, height } = clipRect;\n ctx.save();\n debug3 == null ? void 0 : debug3(() => ({ name, clipRect, ctxTransform: ctx.getTransform(), renderCtx, group: this }));\n ctx.beginPath();\n ctx.rect(x, y, width, height);\n ctx.clip();\n clipBBox = this.matrix.transformBBox(clipRect);\n }\n const hasVirtualChildren = this.hasVirtualChildren();\n if (dirtyZIndex) {\n this.sortChildren(children);\n if (forceRender !== \"dirtyTransform\")\n forceRender = true;\n } else if (hasVirtualChildren) {\n this.sortChildren(children);\n }\n const renderContextChanged = forceRender !== renderCtx.forceRender || clipBBox !== renderCtx.clipBBox || ctx !== renderCtx.ctx;\n const childRenderContext = renderContextChanged ? __spreadProps(__spreadValues({}, renderCtx), { ctx, forceRender, clipBBox }) : renderCtx;\n let skipped = 0;\n for (const child of children) {\n if (!child.visible || !groupVisible) {\n child.markClean();\n if (stats)\n skipped += child.nodeCount.count;\n continue;\n }\n if (!forceRender && child.dirty === 0 /* NONE */) {\n if (stats)\n skipped += child.nodeCount.count;\n continue;\n }\n ctx.save();\n child.render(childRenderContext);\n ctx.restore();\n }\n if (stats)\n stats.nodesSkipped += skipped;\n super.render(renderCtx);\n if (clipRect) {\n ctx.restore();\n }\n if (hasVirtualChildren) {\n for (const child of this.virtualChildren) {\n child.markClean({ recursive: \"virtual\" });\n }\n }\n if (layer) {\n if (stats)\n stats.layersRendered++;\n ctx.restore();\n if (forceRender)\n layer.snapshot();\n (_b = (_a = layer.context).verifyDepthZero) == null ? void 0 : _b.call(_a);\n }\n if (name && stats) {\n debug3 == null ? void 0 : debug3({ name, result: \"rendered\", skipped, renderCtx, counts: this.nodeCount, group: this });\n }\n }\n sortChildren(children) {\n this.dirtyZIndex = false;\n children.sort(\n (a, b) => {\n var _a, _b;\n return compoundAscending(\n [a.zIndex, ...(_a = a.zIndexSubOrder) != null ? _a : [void 0, void 0], a.serialNumber],\n [b.zIndex, ...(_b = b.zIndexSubOrder) != null ? _b : [void 0, void 0], b.serialNumber],\n ascendingStringNumberUndefined\n );\n }\n );\n }\n static computeBBox(nodes) {\n let left = Infinity;\n let right = -Infinity;\n let top = Infinity;\n let bottom = -Infinity;\n for (const n of nodes) {\n if (!n.visible)\n continue;\n const bbox = n.computeTransformedBBox();\n if (!bbox)\n continue;\n const { x, y, width, height } = bbox;\n if (x < left) {\n left = x;\n }\n if (y < top) {\n top = y;\n }\n if (x + width > right) {\n right = x + width;\n }\n if (y + height > bottom) {\n bottom = y + height;\n }\n }\n return new BBox(left, top, right - left, bottom - top);\n }\n /**\n * Transforms bbox given in the canvas coordinate space to bbox in this group's coordinate space and\n * sets this group's clipRect to the transformed bbox.\n * @param bbox clipRect bbox in the canvas coordinate space.\n */\n setClipRectInGroupCoordinateSpace(bbox) {\n this.clipRect = bbox ? this.transformBBox(bbox) : void 0;\n }\n};\n_Group.className = \"Group\";\n__decorateClass([\n SceneChangeDetection({\n redraw: 3 /* MAJOR */,\n convertor: (v) => clamp(0, v, 1)\n })\n], _Group.prototype, \"opacity\", 2);\nvar Group = _Group;\n\n// packages/ag-charts-community/src/scene/gradient/gradient.ts\nvar Gradient = class {\n constructor(stops = []) {\n this.stops = stops;\n }\n};\n\n// packages/ag-charts-community/src/scene/gradient/linearGradient.ts\nvar LinearGradient = class extends Gradient {\n constructor(stops, angle = 0) {\n super(stops);\n this.angle = angle;\n }\n createGradient(ctx, bbox) {\n const angleOffset = 90;\n const { stops, angle } = this;\n const radians = normalizeAngle360(toRadians(angle + angleOffset));\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n const w = bbox.width;\n const h = bbox.height;\n const cx = bbox.x + w * 0.5;\n const cy = bbox.y + h * 0.5;\n if (w > 0 && h > 0) {\n const diagonal = Math.sqrt(h * h + w * w) / 2;\n const diagonalAngle = Math.atan2(h, w);\n let quarteredAngle;\n if (radians < Math.PI / 2) {\n quarteredAngle = radians;\n } else if (radians < Math.PI) {\n quarteredAngle = Math.PI - radians;\n } else if (radians < 1.5 * Math.PI) {\n quarteredAngle = radians - Math.PI;\n } else {\n quarteredAngle = 2 * Math.PI - radians;\n }\n const l = diagonal * Math.abs(Math.cos(quarteredAngle - diagonalAngle));\n const gradient = ctx.createLinearGradient(cx + cos * l, cy + sin * l, cx - cos * l, cy - sin * l);\n for (const stop of stops) {\n gradient.addColorStop(stop.offset, stop.color);\n }\n return gradient;\n }\n return \"black\";\n }\n};\n\n// packages/ag-charts-community/src/scene/shape/shape.ts\nvar LINEAR_GRADIENT_REGEXP = /^linear-gradient\\((.*?)deg,\\s*(.*?)\\s*\\)$/i;\nvar _Shape = class _Shape extends Node {\n constructor() {\n super(...arguments);\n this.fillOpacity = 1;\n this.strokeOpacity = 1;\n this.fill = _Shape.defaultStyles.fill;\n this.stroke = _Shape.defaultStyles.stroke;\n this.strokeWidth = _Shape.defaultStyles.strokeWidth;\n this.lineDash = _Shape.defaultStyles.lineDash;\n this.lineDashOffset = _Shape.defaultStyles.lineDashOffset;\n this.lineCap = _Shape.defaultStyles.lineCap;\n this.lineJoin = _Shape.defaultStyles.lineJoin;\n this.opacity = _Shape.defaultStyles.opacity;\n this.fillShadow = _Shape.defaultStyles.fillShadow;\n }\n /**\n * Restores the default styles introduced by this subclass.\n */\n restoreOwnStyles() {\n const { defaultStyles } = this.constructor;\n Object.assign(this, defaultStyles);\n }\n onFillChange() {\n const { fill } = this;\n let linearGradientMatch;\n if ((fill == null ? void 0 : fill.startsWith(\"linear-gradient\")) && (linearGradientMatch = LINEAR_GRADIENT_REGEXP.exec(fill))) {\n const angle = parseFloat(linearGradientMatch[1]);\n const colors = [];\n const colorsPart = linearGradientMatch[2];\n const colorRegex = /(#[0-9a-f]+)|(rgba?\\(.+?\\))|([a-z]+)/gi;\n let c;\n while (c = colorRegex.exec(colorsPart)) {\n colors.push(c[0]);\n }\n this.gradient = new LinearGradient(\n colors.map((color, index) => ({ color, offset: index / (colors.length - 1) })),\n angle\n );\n } else {\n this.gradient = void 0;\n }\n }\n /**\n * Returns a device-pixel aligned coordinate (or length if length is supplied).\n *\n * NOTE: Not suitable for strokes, since the stroke needs to be offset to the middle\n * of a device pixel.\n */\n align(start, length) {\n var _a, _b, _c;\n const pixelRatio = (_c = (_b = (_a = this.layerManager) == null ? void 0 : _a.canvas) == null ? void 0 : _b.pixelRatio) != null ? _c : 1;\n const alignedStart = Math.round(start * pixelRatio) / pixelRatio;\n if (length == null) {\n return alignedStart;\n } else if (length === 0) {\n return 0;\n } else if (length < 1) {\n return Math.ceil(length * pixelRatio) / pixelRatio;\n }\n return Math.round((length + start) * pixelRatio) / pixelRatio - alignedStart;\n }\n fillStroke(ctx, path) {\n this.renderFill(ctx, path);\n this.renderStroke(ctx, path);\n }\n renderFill(ctx, path) {\n if (this.fill) {\n const { globalAlpha } = ctx;\n this.applyFill(ctx);\n this.applyFillAlpha(ctx);\n this.applyShadow(ctx);\n this.executeFill(ctx, path);\n ctx.globalAlpha = globalAlpha;\n }\n ctx.shadowColor = \"rgba(0, 0, 0, 0)\";\n }\n executeFill(ctx, path) {\n path ? ctx.fill(path) : ctx.fill();\n }\n applyFill(ctx) {\n var _a, _b;\n ctx.fillStyle = (_b = (_a = this.gradient) == null ? void 0 : _a.createGradient(ctx, this.computeBBox())) != null ? _b : this.fill;\n }\n applyFillAlpha(ctx) {\n ctx.globalAlpha *= this.opacity * this.fillOpacity;\n }\n applyShadow(ctx) {\n var _a, _b;\n const pixelRatio = (_b = (_a = this.layerManager) == null ? void 0 : _a.canvas.pixelRatio) != null ? _b : 1;\n const fillShadow = this.fillShadow;\n if (fillShadow == null ? void 0 : fillShadow.enabled) {\n ctx.shadowColor = fillShadow.color;\n ctx.shadowOffsetX = fillShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = fillShadow.yOffset * pixelRatio;\n ctx.shadowBlur = fillShadow.blur * pixelRatio;\n }\n }\n renderStroke(ctx, path) {\n if (this.stroke && this.strokeWidth) {\n const { globalAlpha } = ctx;\n ctx.strokeStyle = this.stroke;\n ctx.globalAlpha *= this.opacity * this.strokeOpacity;\n ctx.lineWidth = this.strokeWidth;\n if (this.lineDash) {\n ctx.setLineDash(this.lineDash);\n }\n if (this.lineDashOffset) {\n ctx.lineDashOffset = this.lineDashOffset;\n }\n if (this.lineCap) {\n ctx.lineCap = this.lineCap;\n }\n if (this.lineJoin) {\n ctx.lineJoin = this.lineJoin;\n }\n this.executeStroke(ctx, path);\n ctx.globalAlpha = globalAlpha;\n }\n }\n executeStroke(ctx, path) {\n path ? ctx.stroke(path) : ctx.stroke();\n }\n containsPoint(x, y) {\n return this.isPointInPath(x, y);\n }\n};\n/**\n * Defaults for style properties. Note that properties that affect the position\n * and shape of the node are not considered style properties, for example:\n * `x`, `y`, `width`, `height`, `radius`, `rotation`, etc.\n * Can be used to reset to the original styling after some custom styling\n * has been applied (using the `restoreOwnStyles` method).\n * These static defaults are meant to be inherited by subclasses.\n */\n_Shape.defaultStyles = {\n fill: \"black\",\n stroke: void 0,\n strokeWidth: 0,\n lineDash: void 0,\n lineDashOffset: 0,\n lineCap: void 0,\n lineJoin: void 0,\n opacity: 1,\n fillShadow: void 0\n};\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], _Shape.prototype, \"fillOpacity\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], _Shape.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */, changeCb: (s) => s.onFillChange() })\n], _Shape.prototype, \"fill\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], _Shape.prototype, \"stroke\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], _Shape.prototype, \"strokeWidth\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], _Shape.prototype, \"lineDash\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], _Shape.prototype, \"lineDashOffset\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], _Shape.prototype, \"lineCap\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], _Shape.prototype, \"lineJoin\", 2);\n__decorateClass([\n SceneChangeDetection({\n redraw: 2 /* MINOR */,\n convertor: (v) => clamp(0, v, 1)\n })\n], _Shape.prototype, \"opacity\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */, checkDirtyOnAssignment: true })\n], _Shape.prototype, \"fillShadow\", 2);\nvar Shape = _Shape;\n\n// packages/ag-charts-community/src/scene/shape/range.ts\nvar Range = class extends Shape {\n constructor(opts = {}) {\n super(opts);\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.startLine = false;\n this.endLine = false;\n this.isRange = false;\n this.restoreOwnStyles();\n }\n computeBBox() {\n return new BBox(this.x1, this.y1, this.x2 - this.x1, this.y2 - this.y1);\n }\n isPointInPath(_x, _y) {\n return false;\n }\n render(renderCtx) {\n var _a;\n const { ctx, forceRender, stats } = renderCtx;\n if (this.dirty === 0 /* NONE */ && !forceRender) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n let { x1, y1, x2, y2 } = this;\n x1 = this.align(x1);\n y1 = this.align(y1);\n x2 = this.align(x2);\n y2 = this.align(y2);\n const { fill, opacity, isRange } = this;\n const fillActive = !!(isRange && fill);\n if (fillActive) {\n const { fillOpacity } = this;\n ctx.fillStyle = fill;\n ctx.globalAlpha = opacity * fillOpacity;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y1);\n ctx.lineTo(x2, y2);\n ctx.lineTo(x1, y2);\n ctx.closePath();\n ctx.fill();\n }\n const { stroke, strokeWidth, startLine, endLine } = this;\n const strokeActive = !!((startLine || endLine) && stroke && strokeWidth);\n if (strokeActive) {\n const { strokeOpacity, lineDash, lineDashOffset, lineCap, lineJoin } = this;\n ctx.strokeStyle = stroke;\n ctx.globalAlpha = opacity * strokeOpacity;\n ctx.lineWidth = strokeWidth;\n if (lineDash) {\n ctx.setLineDash(lineDash);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineCap) {\n ctx.lineCap = lineCap;\n }\n if (lineJoin) {\n ctx.lineJoin = lineJoin;\n }\n ctx.beginPath();\n if (startLine) {\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y1);\n }\n if (endLine) {\n ctx.moveTo(x2, y2);\n ctx.lineTo(x1, y2);\n }\n ctx.stroke();\n }\n (_a = this.fillShadow) == null ? void 0 : _a.markClean();\n super.render(renderCtx);\n }\n};\nRange.className = \"Range\";\nRange.defaultStyles = __spreadProps(__spreadValues({}, Shape.defaultStyles), {\n strokeWidth: 1\n});\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], Range.prototype, \"x1\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], Range.prototype, \"y1\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], Range.prototype, \"x2\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], Range.prototype, \"y2\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], Range.prototype, \"startLine\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], Range.prototype, \"endLine\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 2 /* MINOR */ })\n], Range.prototype, \"isRange\", 2);\n\n// packages/ag-charts-community/src/util/memo.ts\nvar memorizedFns = /* @__PURE__ */ new WeakMap();\nvar memorizedMap = /* @__PURE__ */ new WeakMap();\nfunction memo(params, fnGenerator) {\n var _a, _b, _c;\n const serialisedParams = JSON.stringify(params, null, 0);\n if (!memorizedFns.has(fnGenerator)) {\n memorizedFns.set(fnGenerator, /* @__PURE__ */ new Map());\n }\n if (!((_a = memorizedFns.get(fnGenerator)) == null ? void 0 : _a.has(serialisedParams))) {\n (_b = memorizedFns.get(fnGenerator)) == null ? void 0 : _b.set(serialisedParams, fnGenerator(params));\n }\n return (_c = memorizedFns.get(fnGenerator)) == null ? void 0 : _c.get(serialisedParams);\n}\nfunction memoizeFunction(baseFn) {\n return (params, ...rest) => {\n var _a, _b, _c;\n const serialisedParams = JSON.stringify(params, null, 0);\n if (!memorizedMap.has(baseFn)) {\n memorizedMap.set(baseFn, /* @__PURE__ */ new Map());\n }\n if (!((_a = memorizedMap.get(baseFn)) == null ? void 0 : _a.has(serialisedParams))) {\n (_b = memorizedMap.get(baseFn)) == null ? void 0 : _b.set(serialisedParams, baseFn(params, ...rest));\n }\n return (_c = memorizedMap.get(baseFn)) == null ? void 0 : _c.get(serialisedParams);\n };\n}\n\n// packages/ag-charts-community/src/scene/shape/text.ts\nvar ellipsis = \"\\u2026\";\nfunction SceneFontChangeDetection(opts) {\n const { redraw = 3 /* MAJOR */, changeCb } = opts != null ? opts : {};\n return SceneChangeDetection({ redraw, type: \"font\", changeCb });\n}\nvar _Text = class _Text extends Shape {\n constructor() {\n super(...arguments);\n this.x = 0;\n this.y = 0;\n this.lines = [];\n this.text = void 0;\n this._dirtyFont = true;\n this.fontSize = 10;\n this.fontFamily = \"sans-serif\";\n this.textAlign = _Text.defaultStyles.textAlign;\n this.textBaseline = _Text.defaultStyles.textBaseline;\n }\n onTextChange() {\n var _a, _b;\n this.lines = (_b = (_a = this.text) == null ? void 0 : _a.split(\"\\n\").map((s) => s.trim())) != null ? _b : [];\n }\n get font() {\n if (this._font == null || this._dirtyFont) {\n this._dirtyFont = false;\n this._font = getFont(this);\n }\n return this._font;\n }\n computeBBox() {\n const { x, y, lines, lineHeight, textBaseline, textAlign } = this;\n const { top, left, width, height } = _Text.getTextSizeMultiline(\n lines,\n getFont(this),\n textBaseline,\n textAlign,\n lineHeight\n );\n return new BBox(x - left, y - top, width, height);\n }\n getLineHeight(line) {\n var _a, _b;\n if (this.lineHeight) {\n return this.lineHeight;\n }\n const metrics = _Text.measureText(line, this.font, this.textBaseline, this.textAlign);\n return (\n // Fallback to emHeightAscent + emHeightDescent is needed for server-side rendering.\n ((_a = metrics.fontBoundingBoxAscent) != null ? _a : metrics.emHeightAscent) + ((_b = metrics.fontBoundingBoxDescent) != null ? _b : metrics.emHeightDescent)\n );\n }\n isPointInPath(x, y) {\n const point = this.transformPoint(x, y);\n const bbox = this.computeBBox();\n return bbox ? bbox.containsPoint(point.x, point.y) : false;\n }\n render(renderCtx) {\n const { ctx, forceRender, stats } = renderCtx;\n if (this.dirty === 0 /* NONE */ && !forceRender) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n if (!this.lines.length || !this.layerManager) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n const { fill, stroke, strokeWidth } = this;\n ctx.font = this.font;\n ctx.textAlign = this.textAlign;\n ctx.textBaseline = this.textBaseline;\n const pixelRatio = this.layerManager.canvas.pixelRatio || 1;\n const { globalAlpha } = ctx;\n if (fill) {\n ctx.fillStyle = fill;\n ctx.globalAlpha = globalAlpha * this.opacity * this.fillOpacity;\n const { fillShadow } = this;\n if (fillShadow == null ? void 0 : fillShadow.enabled) {\n ctx.shadowColor = fillShadow.color;\n ctx.shadowOffsetX = fillShadow.xOffset * pixelRatio;\n ctx.shadowOffsetY = fillShadow.yOffset * pixelRatio;\n ctx.shadowBlur = fillShadow.blur * pixelRatio;\n }\n this.renderLines((line, x, y) => ctx.fillText(line, x, y));\n }\n if (stroke && strokeWidth) {\n ctx.strokeStyle = stroke;\n ctx.lineWidth = strokeWidth;\n ctx.globalAlpha = globalAlpha * this.opacity * this.strokeOpacity;\n const { lineDash, lineDashOffset, lineCap, lineJoin } = this;\n if (lineDash) {\n ctx.setLineDash(lineDash);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineCap) {\n ctx.lineCap = lineCap;\n }\n if (lineJoin) {\n ctx.lineJoin = lineJoin;\n }\n this.renderLines((line, x, y) => ctx.strokeText(line, x, y));\n }\n super.render(renderCtx);\n }\n renderLines(renderCallback) {\n const { lines, x, y } = this;\n const lineHeights = lines.map((line) => this.getLineHeight(line));\n const totalHeight = lineHeights.reduce((a, b) => a + b, 0);\n let offsetY = (lineHeights[0] - totalHeight) * _Text.getVerticalModifier(this.textBaseline);\n for (let i = 0; i < lines.length; i++) {\n renderCallback(lines[i], x, y + offsetY);\n offsetY += lineHeights[i];\n }\n }\n static wrapLines(text, maxWidth, maxHeight, textProps, wrapping, overflow) {\n const canOverflow = overflow !== \"hide\";\n const measurer = new TextMeasurer(textProps);\n const lines = text.split(/\\r?\\n/g);\n if (lines.length === 0) {\n return { lines: void 0, truncated: false };\n }\n if (wrapping === \"never\") {\n const { text: truncText, truncated: truncated2 } = _Text.truncateLine(\n lines[0],\n maxWidth,\n measurer,\n canOverflow ? \"auto\" : \"never\"\n );\n return { lines: truncText != null ? [truncText] : void 0, truncated: truncated2 };\n }\n const wrappedLines = [];\n let cumulativeHeight = 0;\n let truncated = false;\n for (const line of lines) {\n const wrappedLine = _Text.wrapLine(\n line,\n maxWidth,\n maxHeight,\n measurer,\n textProps,\n wrapping,\n cumulativeHeight,\n canOverflow\n );\n if (wrappedLine == null) {\n return { lines: void 0, truncated: false };\n }\n wrappedLines.push(...wrappedLine.result);\n cumulativeHeight = wrappedLine.cumulativeHeight;\n if (wrappedLine.truncated) {\n truncated = true;\n break;\n }\n }\n return { lines: wrappedLines, truncated };\n }\n static wrap(text, maxWidth, maxHeight, textProps, wrapping, overflow = \"ellipsis\") {\n var _a;\n const { lines, truncated } = _Text.wrapLines(text, maxWidth, maxHeight, textProps, wrapping, overflow);\n return { text: (_a = lines == null ? void 0 : lines.join(\"\\n\").trim()) != null ? _a : \"\", truncated };\n }\n static wrapLine(text, maxWidth, maxHeight, measurer, textProps, wrapping, cumulativeHeight, canOverflow) {\n text = text.trim();\n if (!text) {\n return { result: [], truncated: false, cumulativeHeight };\n }\n const initialSize = measurer.size(text);\n if (initialSize.width <= maxWidth) {\n return {\n result: [text],\n truncated: false,\n cumulativeHeight: cumulativeHeight + initialSize.height\n };\n }\n if (initialSize.height > maxHeight || measurer.width(\"W\") > maxWidth) {\n return canOverflow ? { result: [], truncated: true, cumulativeHeight } : void 0;\n }\n const words = text.split(/\\s+/g);\n const wrapResult = _Text.wrapLineSequentially(\n words,\n maxWidth,\n maxHeight,\n measurer,\n textProps,\n wrapping,\n cumulativeHeight,\n canOverflow\n );\n if (wrapResult == null) {\n return;\n }\n cumulativeHeight = wrapResult.cumulativeHeight;\n let { lines } = wrapResult;\n if (!(wrapResult.wordsBrokenOrTruncated || wrapResult.linesTruncated)) {\n const linesCount = wrapResult.lines.length;\n const balanced = _Text.wrapLineBalanced(words, maxWidth, measurer, linesCount);\n if (balanced.length === lines.length) {\n lines = balanced;\n }\n }\n const wrappedText = lines.map((ln) => ln.join(\" \"));\n return { result: wrappedText, truncated: wrapResult.linesTruncated, cumulativeHeight };\n }\n static breakWord(word, firstLineWidth, maxWidth, hyphens, measurer) {\n const isPunctuationAt = (index) => _Text.punctuationMarks.includes(word[index]);\n const h = hyphens ? measurer.width(\"-\") : 0;\n const breaks = [];\n let partWidth = 0;\n let p = 0;\n for (let i = 0; i < word.length; i++) {\n const c = word[i];\n const w = measurer.width(c);\n const limit = p === 0 ? firstLineWidth : maxWidth;\n if (partWidth + w + h > limit) {\n breaks.push(i);\n partWidth = 0;\n p++;\n }\n partWidth += w;\n }\n const parts = [];\n let start = 0;\n for (const index of breaks) {\n let part = word.substring(start, index);\n if (hyphens && part.length > 0 && !isPunctuationAt(index - 1) && !isPunctuationAt(index)) {\n part += \"-\";\n }\n parts.push(part);\n start = index;\n }\n parts.push(word.substring(start));\n return parts;\n }\n static truncateLine(text, maxWidth, measurer, ellipsisMode) {\n text = text.trimEnd();\n const lineWidth = measurer.width(text);\n if (lineWidth > maxWidth && ellipsisMode === \"never\") {\n return { text: void 0, truncated: false };\n } else if (lineWidth <= maxWidth && ellipsisMode !== \"force\") {\n return { text, truncated: false };\n }\n const ellipsisWidth = measurer.width(ellipsis);\n let trunc = text;\n let truncWidth = lineWidth;\n while (trunc.length > 0 && truncWidth + ellipsisWidth > maxWidth) {\n trunc = trunc.slice(0, -1).trimEnd();\n truncWidth = measurer.width(trunc);\n }\n if (truncWidth + ellipsisWidth <= maxWidth) {\n return { text: `${trunc}${ellipsis}`, truncated: true };\n } else {\n return { text: void 0, truncated: false };\n }\n }\n static wrapLineSequentially(words, maxWidth, maxHeight, measurer, textProps, wrapping, cumulativeHeight, canOverflow) {\n const { fontSize = 0, lineHeight = fontSize * _Text.defaultLineHeightRatio } = textProps;\n const breakWord = wrapping === \"always\" || wrapping === \"hyphenate\";\n const hyphenate = wrapping === \"hyphenate\";\n const spaceWidth = measurer.width(\" \");\n let wordsBrokenOrTruncated = false;\n let linesTruncated = false;\n const lines = [];\n let currentLine = [];\n let lineWidth = 0;\n const getReturnValue = () => ({\n lines,\n linesTruncated,\n wordsBrokenOrTruncated,\n cumulativeHeight\n });\n const truncateLastLine = () => {\n if (!canOverflow) {\n return;\n }\n const lastLine = currentLine.join(\" \");\n const { text } = _Text.truncateLine(lastLine, maxWidth, measurer, \"force\");\n if (text == null) {\n return;\n }\n currentLine.splice(0, currentLine.length, text);\n linesTruncated = true;\n return getReturnValue();\n };\n const addNewLine = () => {\n const expectedHeight = cumulativeHeight + lineHeight;\n if (expectedHeight >= maxHeight) {\n return false;\n }\n currentLine = [];\n lineWidth = 0;\n cumulativeHeight = expectedHeight;\n lines.push(currentLine);\n return true;\n };\n if (!addNewLine()) {\n return truncateLastLine();\n }\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n const wordWidth = measurer.width(word);\n const expectedSpaceWidth = currentLine.length === 0 ? 0 : spaceWidth;\n const expectedLineWidth = lineWidth + expectedSpaceWidth + wordWidth;\n if (expectedLineWidth <= maxWidth) {\n currentLine.push(word);\n lineWidth = expectedLineWidth;\n continue;\n }\n if (wordWidth <= maxWidth) {\n if (!addNewLine()) {\n return truncateLastLine();\n }\n currentLine.push(word);\n lineWidth = wordWidth;\n continue;\n }\n wordsBrokenOrTruncated = true;\n if (breakWord) {\n const availWidth = maxWidth - lineWidth - expectedSpaceWidth;\n const parts = _Text.breakWord(word, availWidth, maxWidth, hyphenate, measurer);\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p];\n part && currentLine.push(part);\n if (p === parts.length - 1) {\n lineWidth = measurer.width(part);\n } else if (!addNewLine()) {\n return truncateLastLine();\n }\n }\n } else if (canOverflow) {\n if (!addNewLine()) {\n return truncateLastLine();\n }\n const { text } = _Text.truncateLine(word, maxWidth, measurer, \"force\");\n if (text == null) {\n return;\n }\n currentLine.push(text);\n if (i < words.length - 1) {\n linesTruncated = true;\n }\n break;\n } else {\n return;\n }\n }\n return getReturnValue();\n }\n static wrapLineBalanced(words, maxWidth, measurer, linesCount) {\n const totalWordsWidth = words.reduce((sum2, w) => sum2 + measurer.width(w), 0);\n const spaceWidth = measurer.width(\" \");\n const totalSpaceWidth = spaceWidth * (words.length - linesCount - 2);\n const averageLineWidth = (totalWordsWidth + totalSpaceWidth) / linesCount;\n const lines = [];\n let currentLine = [];\n let lineWidth = measurer.width(words[0]);\n let newLine = true;\n for (const word of words) {\n const width = measurer.width(word);\n if (newLine) {\n currentLine = [];\n currentLine.push(word);\n lineWidth = width;\n newLine = false;\n lines.push(currentLine);\n continue;\n }\n const expectedLineWidth = lineWidth + spaceWidth + width;\n if (expectedLineWidth <= averageLineWidth) {\n currentLine.push(word);\n lineWidth = expectedLineWidth;\n } else if (expectedLineWidth <= maxWidth) {\n currentLine.push(word);\n newLine = true;\n } else {\n currentLine = [word];\n lineWidth = width;\n lines.push(currentLine);\n }\n }\n return lines;\n }\n setFont(props) {\n this.fontFamily = props.fontFamily;\n this.fontSize = props.fontSize;\n this.fontStyle = props.fontStyle;\n this.fontWeight = props.fontWeight;\n }\n setAlign(props) {\n this.textAlign = props.textAlign;\n this.textBaseline = props.textBaseline;\n }\n static getVerticalModifier(textBaseline) {\n switch (textBaseline) {\n case \"top\":\n case \"hanging\":\n return 0;\n case \"bottom\":\n case \"alphabetic\":\n case \"ideographic\":\n return 1;\n case \"middle\":\n return 0.5;\n }\n }\n static get textContext() {\n if (!this._textContext) {\n const canvasElement = createElement(\"canvas\");\n canvasElement.width = 0;\n canvasElement.height = 0;\n this._textContext = canvasElement.getContext(\"2d\");\n }\n return this._textContext;\n }\n static measureText(text, font, textBaseline, textAlign) {\n return this._measureText({ text, font, textBaseline, textAlign });\n }\n /**\n * Returns the width and height of the measured text.\n * @param text The single-line text to measure.\n * @param font The font shorthand string.\n */\n static getTextSize(text, font) {\n return this._getTextSize({ text, font });\n }\n static getTextSizeMultiline(lines, font, textBaseline = _Text.defaultStyles.textBaseline, textAlign = _Text.defaultStyles.textAlign, lineHeight) {\n var _a, _b;\n let top = 0;\n let left = 0;\n let width = 0;\n let height = 0;\n let baselineDistance = 0;\n for (const [i, text] of lines.entries()) {\n const metrics = this._measureText({ text, font, textBaseline, textAlign });\n left = Math.max(left, metrics.actualBoundingBoxLeft);\n width = Math.max(width, metrics.width);\n if (i == 0) {\n top += metrics.actualBoundingBoxAscent;\n height += metrics.actualBoundingBoxAscent;\n } else {\n baselineDistance += (_a = metrics.fontBoundingBoxAscent) != null ? _a : metrics.emHeightAscent;\n }\n if (i == lines.length - 1) {\n height += metrics.actualBoundingBoxDescent;\n } else {\n baselineDistance += (_b = metrics.fontBoundingBoxDescent) != null ? _b : metrics.emHeightDescent;\n }\n }\n if (lineHeight != null) {\n baselineDistance = (lines.length - 1) * lineHeight;\n }\n height += baselineDistance;\n top += baselineDistance * _Text.getVerticalModifier(textBaseline);\n return { top, left, width, height };\n }\n};\n_Text.className = \"Text\";\n// The default line spacing for document editors is usually 1.15\n_Text.defaultLineHeightRatio = 1.15;\n_Text.defaultStyles = Object.assign({}, Shape.defaultStyles, {\n textAlign: \"start\",\n fontStyle: void 0,\n fontWeight: void 0,\n fontSize: 10,\n fontFamily: \"sans-serif\",\n textBaseline: \"alphabetic\"\n});\n_Text.ellipsis = ellipsis;\n_Text.punctuationMarks = [\".\", \",\", \"-\", \":\", \";\", \"!\", \"?\", `'`, '\"', \"(\", \")\"];\n_Text._measureText = memoizeFunction(\n ({\n text,\n font,\n textBaseline,\n textAlign\n }) => {\n const ctx = _Text.textContext;\n if (ctx.font !== font) {\n ctx.font = font;\n }\n if (ctx.textBaseline !== textBaseline) {\n ctx.textBaseline = textBaseline;\n }\n if (ctx.textAlign !== textAlign) {\n ctx.textAlign = textAlign;\n }\n return ctx.measureText(text);\n }\n);\n_Text._getTextSize = memoizeFunction(({ text, font }) => {\n const ctx = _Text.textContext;\n if (ctx.font !== font) {\n ctx.font = font;\n }\n const metrics = ctx.measureText(text);\n return {\n width: metrics.width,\n height: metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent\n };\n});\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], _Text.prototype, \"x\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], _Text.prototype, \"y\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */, changeCb: (o) => o.onTextChange() })\n], _Text.prototype, \"text\", 2);\n__decorateClass([\n SceneFontChangeDetection()\n], _Text.prototype, \"fontStyle\", 2);\n__decorateClass([\n SceneFontChangeDetection()\n], _Text.prototype, \"fontWeight\", 2);\n__decorateClass([\n SceneFontChangeDetection()\n], _Text.prototype, \"fontSize\", 2);\n__decorateClass([\n SceneFontChangeDetection()\n], _Text.prototype, \"fontFamily\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], _Text.prototype, \"textAlign\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], _Text.prototype, \"textBaseline\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], _Text.prototype, \"lineHeight\", 2);\nvar Text = _Text;\nvar TextMeasurer = class {\n constructor(font) {\n this.font = isString(font) ? font : getFont(font);\n }\n size(text) {\n return text.includes(\"\\n\") ? Text.getTextSizeMultiline(\n text.split(\"\\n\").map((s) => s.trim()),\n this.font\n ) : Text.getTextSize(text, this.font);\n }\n width(text) {\n const { width } = this.size(text);\n return width;\n }\n};\nfunction getFont(fontProps) {\n const { fontFamily, fontSize, fontStyle, fontWeight } = fontProps;\n return [fontStyle != null ? fontStyle : \"\", fontWeight != null ? fontWeight : \"\", fontSize + \"px\", fontFamily].join(\" \").trim();\n}\n\n// packages/ag-charts-community/src/chart/label.ts\nvar Label = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.enabled = true;\n this.fontSize = 12;\n this.fontFamily = \"Verdana, sans-serif\";\n }\n getFont() {\n return getFont(this);\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], Label.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], Label.prototype, \"color\", 2);\n__decorateClass([\n Validate(FONT_STYLE, { optional: true })\n], Label.prototype, \"fontStyle\", 2);\n__decorateClass([\n Validate(FONT_WEIGHT2, { optional: true })\n], Label.prototype, \"fontWeight\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], Label.prototype, \"fontSize\", 2);\n__decorateClass([\n Validate(STRING)\n], Label.prototype, \"fontFamily\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], Label.prototype, \"formatter\", 2);\nfunction calculateLabelRotation(opts) {\n const { parallelFlipRotation = 0, regularFlipRotation = 0 } = opts;\n const configuredRotation = opts.rotation ? normalizeAngle360(toRadians(opts.rotation)) : 0;\n const parallelFlipFlag = !configuredRotation && parallelFlipRotation >= 0 && parallelFlipRotation <= Math.PI ? -1 : 1;\n const regularFlipFlag = !configuredRotation && regularFlipRotation >= 0 && regularFlipRotation <= Math.PI ? -1 : 1;\n let defaultRotation = 0;\n if (opts.parallel) {\n defaultRotation = parallelFlipFlag * Math.PI / 2;\n } else if (regularFlipFlag === -1) {\n defaultRotation = Math.PI;\n }\n return { configuredRotation, defaultRotation, parallelFlipFlag, regularFlipFlag };\n}\nfunction getLabelSpacing(minSpacing, rotated) {\n if (!isNaN(minSpacing)) {\n return minSpacing;\n }\n return rotated ? 0 : 10;\n}\nfunction getTextBaseline(parallel, labelRotation, sideFlag, parallelFlipFlag) {\n if (parallel && !labelRotation) {\n return sideFlag * parallelFlipFlag === -1 ? \"hanging\" : \"bottom\";\n }\n return \"middle\";\n}\nfunction getTextAlign(parallel, labelRotation, labelAutoRotation, sideFlag, regularFlipFlag) {\n const labelRotated = labelRotation > 0 && labelRotation <= Math.PI;\n const labelAutoRotated = labelAutoRotation > 0 && labelAutoRotation <= Math.PI;\n const alignFlag = labelRotated || labelAutoRotated ? -1 : 1;\n if (parallel) {\n if (labelRotation || labelAutoRotation) {\n if (sideFlag * alignFlag === -1) {\n return \"end\";\n }\n } else {\n return \"center\";\n }\n } else if (sideFlag * regularFlipFlag === -1) {\n return \"end\";\n }\n return \"start\";\n}\nfunction calculateLabelBBox(text, bbox, labelX, labelY, labelMatrix) {\n const { width, height } = bbox;\n const translatedBBox = new BBox(labelX, labelY, 0, 0);\n labelMatrix.transformBBox(translatedBBox, bbox);\n const { x, y } = bbox;\n bbox.width = width;\n bbox.height = height;\n return {\n point: { x, y },\n label: { text, width, height }\n };\n}\n\n// packages/ag-charts-community/src/chart/layers.ts\nvar Layers = /* @__PURE__ */ ((Layers2) => {\n Layers2[Layers2[\"SERIES_BACKGROUND_ZINDEX\"] = 0] = \"SERIES_BACKGROUND_ZINDEX\";\n Layers2[Layers2[\"AXIS_GRID_ZINDEX\"] = 1] = \"AXIS_GRID_ZINDEX\";\n Layers2[Layers2[\"AXIS_ZINDEX\"] = 2] = \"AXIS_ZINDEX\";\n Layers2[Layers2[\"SERIES_CROSSLINE_RANGE_ZINDEX\"] = 3] = \"SERIES_CROSSLINE_RANGE_ZINDEX\";\n Layers2[Layers2[\"SERIES_LAYER_ZINDEX\"] = 4] = \"SERIES_LAYER_ZINDEX\";\n Layers2[Layers2[\"SERIES_HIGHLIGHT_ZINDEX\"] = 5] = \"SERIES_HIGHLIGHT_ZINDEX\";\n Layers2[Layers2[\"AXIS_FOREGROUND_ZINDEX\"] = 6] = \"AXIS_FOREGROUND_ZINDEX\";\n Layers2[Layers2[\"SERIES_CROSSHAIR_ZINDEX\"] = 7] = \"SERIES_CROSSHAIR_ZINDEX\";\n Layers2[Layers2[\"SERIES_LABEL_ZINDEX\"] = 8] = \"SERIES_LABEL_ZINDEX\";\n Layers2[Layers2[\"SERIES_CROSSLINE_LINE_ZINDEX\"] = 9] = \"SERIES_CROSSLINE_LINE_ZINDEX\";\n Layers2[Layers2[\"SERIES_ANNOTATION_ZINDEX\"] = 10] = \"SERIES_ANNOTATION_ZINDEX\";\n Layers2[Layers2[\"LEGEND_ZINDEX\"] = 11] = \"LEGEND_ZINDEX\";\n Layers2[Layers2[\"NAVIGATOR_ZINDEX\"] = 12] = \"NAVIGATOR_ZINDEX\";\n return Layers2;\n})(Layers || {});\n\n// packages/ag-charts-community/src/util/value.ts\nfunction isStringObject(value) {\n return value != null && Object.hasOwn(value, \"toString\") && isString(value.toString());\n}\nfunction isNumberObject(value) {\n return value != null && Object.hasOwn(value, \"valueOf\") && isFiniteNumber(value.valueOf());\n}\nfunction isContinuous(value) {\n return isFiniteNumber(value) || isValidDate(value) || isNumberObject(value);\n}\nfunction checkDatum(value, isContinuousScale) {\n return value != null && (!isContinuousScale || isContinuous(value));\n}\nfunction transformIntegratedCategoryValue(value) {\n if (isStringObject(value) && Object.hasOwn(value, \"id\")) {\n return value.id;\n }\n return value;\n}\n\n// packages/ag-charts-community/src/chart/crossline/crossLine.ts\nvar MATCHING_CROSSLINE_TYPE = (property) => {\n return property === \"value\" ? predicateWithMessage(\n (_, ctx) => ctx.target[\"type\"] === \"line\",\n (ctx) => ctx.target[\"type\"] === \"range\" ? `crossLine type 'range' to have a 'range' property instead of 'value'` : `crossLine property 'type' to be 'line'`\n ) : predicateWithMessage(\n (_, ctx) => ctx.target[\"type\"] === \"range\",\n (ctx) => ctx.target.type === \"line\" ? `crossLine type 'line' to have a 'value' property instead of 'range'` : `crossLine property 'type' to be 'range'`\n );\n};\nvar validateCrossLineValues = (type, value, range3, scale2) => {\n const lineCrossLine = type === \"line\" && value !== void 0;\n const rangeCrossLine = type === \"range\" && range3 !== void 0;\n if (!lineCrossLine && !rangeCrossLine) {\n return true;\n }\n const [start, end] = range3 != null ? range3 : [value, void 0];\n const isContinuous2 = ContinuousScale.is(scale2) || OrdinalTimeScale.is(scale2);\n const validStart = checkDatum(start, isContinuous2) && !isNaN(scale2.convert(start));\n const validEnd = checkDatum(end, isContinuous2) && !isNaN(scale2.convert(end));\n if (lineCrossLine && validStart || rangeCrossLine && validStart && validEnd) {\n return true;\n }\n const message = [`Expecting crossLine`];\n if (rangeCrossLine) {\n if (!validStart) {\n message.push(`range start ${stringify(start)}`);\n }\n if (!validEnd) {\n message.push(`${validStart ? \"\" : \"and \"}range end ${stringify(end)}`);\n }\n } else {\n message.push(`value ${stringify(start)}`);\n }\n message.push(`to match the axis scale domain.`);\n Logger.warnOnce(message.join(\" \"));\n return false;\n};\n\n// packages/ag-charts-community/src/chart/crossline/crossLineLabelPosition.ts\nvar horizontalCrosslineTranslationDirections = {\n top: { xTranslationDirection: 0, yTranslationDirection: -1 },\n bottom: { xTranslationDirection: 0, yTranslationDirection: 1 },\n left: { xTranslationDirection: -1, yTranslationDirection: 0 },\n right: { xTranslationDirection: 1, yTranslationDirection: 0 },\n topLeft: { xTranslationDirection: 1, yTranslationDirection: -1 },\n topRight: { xTranslationDirection: -1, yTranslationDirection: -1 },\n bottomLeft: { xTranslationDirection: 1, yTranslationDirection: 1 },\n bottomRight: { xTranslationDirection: -1, yTranslationDirection: 1 },\n inside: { xTranslationDirection: 0, yTranslationDirection: 0 },\n insideLeft: { xTranslationDirection: 1, yTranslationDirection: 0 },\n insideRight: { xTranslationDirection: -1, yTranslationDirection: 0 },\n insideTop: { xTranslationDirection: 0, yTranslationDirection: 1 },\n insideBottom: { xTranslationDirection: 0, yTranslationDirection: -1 },\n insideTopLeft: { xTranslationDirection: 1, yTranslationDirection: 1 },\n insideBottomLeft: { xTranslationDirection: 1, yTranslationDirection: -1 },\n insideTopRight: { xTranslationDirection: -1, yTranslationDirection: 1 },\n insideBottomRight: { xTranslationDirection: -1, yTranslationDirection: -1 }\n};\nvar verticalCrossLineTranslationDirections = {\n top: { xTranslationDirection: 1, yTranslationDirection: 0 },\n bottom: { xTranslationDirection: -1, yTranslationDirection: 0 },\n left: { xTranslationDirection: 0, yTranslationDirection: -1 },\n right: { xTranslationDirection: 0, yTranslationDirection: 1 },\n topLeft: { xTranslationDirection: -1, yTranslationDirection: -1 },\n topRight: { xTranslationDirection: -1, yTranslationDirection: 1 },\n bottomLeft: { xTranslationDirection: 1, yTranslationDirection: -1 },\n bottomRight: { xTranslationDirection: 1, yTranslationDirection: 1 },\n inside: { xTranslationDirection: 0, yTranslationDirection: 0 },\n insideLeft: { xTranslationDirection: 0, yTranslationDirection: 1 },\n insideRight: { xTranslationDirection: 0, yTranslationDirection: -1 },\n insideTop: { xTranslationDirection: -1, yTranslationDirection: 0 },\n insideBottom: { xTranslationDirection: 1, yTranslationDirection: 0 },\n insideTopLeft: { xTranslationDirection: -1, yTranslationDirection: 1 },\n insideBottomLeft: { xTranslationDirection: 1, yTranslationDirection: 1 },\n insideTopRight: { xTranslationDirection: -1, yTranslationDirection: -1 },\n insideBottomRight: { xTranslationDirection: 1, yTranslationDirection: -1 }\n};\nfunction calculateLabelTranslation({\n yDirection,\n padding = 0,\n position = \"top\",\n bbox\n}) {\n const crossLineTranslationDirections = yDirection ? horizontalCrosslineTranslationDirections : verticalCrossLineTranslationDirections;\n const { xTranslationDirection, yTranslationDirection } = crossLineTranslationDirections[position];\n const w = yDirection ? bbox.width : bbox.height;\n const h = yDirection ? bbox.height : bbox.width;\n const xTranslation = xTranslationDirection * (padding + w / 2);\n const yTranslation = yTranslationDirection * (padding + h / 2);\n return {\n xTranslation,\n yTranslation\n };\n}\nfunction calculateLabelChartPadding({\n yDirection,\n bbox,\n padding = 0,\n position = \"top\"\n}) {\n const chartPadding = {};\n if (position.startsWith(\"inside\"))\n return chartPadding;\n if (position === \"top\" && !yDirection) {\n chartPadding.top = padding + bbox.height;\n } else if (position === \"bottom\" && !yDirection) {\n chartPadding.bottom = padding + bbox.height;\n } else if (position === \"left\" && yDirection) {\n chartPadding.left = padding + bbox.width;\n } else if (position === \"right\" && yDirection) {\n chartPadding.right = padding + bbox.width;\n }\n return chartPadding;\n}\nvar POSITION_TOP_COORDINATES = ({ yDirection, xEnd, yStart, yEnd }) => {\n if (yDirection) {\n return { x: xEnd / 2, y: yStart };\n } else {\n return { x: xEnd, y: isNaN(yEnd) ? yStart : (yStart + yEnd) / 2 };\n }\n};\nvar POSITION_LEFT_COORDINATES = ({ yDirection, xStart, xEnd, yStart, yEnd }) => {\n if (yDirection) {\n return { x: xStart, y: isNaN(yEnd) ? yStart : (yStart + yEnd) / 2 };\n } else {\n return { x: xEnd / 2, y: yStart };\n }\n};\nvar POSITION_RIGHT_COORDINATES = ({ yDirection, xEnd, yStart, yEnd }) => {\n if (yDirection) {\n return { x: xEnd, y: isNaN(yEnd) ? yStart : (yStart + yEnd) / 2 };\n } else {\n return { x: xEnd / 2, y: isNaN(yEnd) ? yStart : yEnd };\n }\n};\nvar POSITION_BOTTOM_COORDINATES = ({ yDirection, xStart, xEnd, yStart, yEnd }) => {\n if (yDirection) {\n return { x: xEnd / 2, y: isNaN(yEnd) ? yStart : yEnd };\n } else {\n return { x: xStart, y: isNaN(yEnd) ? yStart : (yStart + yEnd) / 2 };\n }\n};\nvar POSITION_INSIDE_COORDINATES = ({ xEnd, yStart, yEnd }) => {\n return { x: xEnd / 2, y: isNaN(yEnd) ? yStart : (yStart + yEnd) / 2 };\n};\nvar POSITION_TOP_LEFT_COORDINATES = ({ yDirection, xStart, xEnd, yStart }) => {\n if (yDirection) {\n return { x: xStart / 2, y: yStart };\n } else {\n return { x: xEnd, y: yStart };\n }\n};\nvar POSITION_BOTTOM_LEFT_COORDINATES = ({ yDirection, xStart, yStart, yEnd }) => {\n if (yDirection) {\n return { x: xStart, y: isNaN(yEnd) ? yStart : yEnd };\n } else {\n return { x: xStart, y: yStart };\n }\n};\nvar POSITION_TOP_RIGHT_COORDINATES = ({ yDirection, xEnd, yStart, yEnd }) => {\n if (yDirection) {\n return { x: xEnd, y: yStart };\n } else {\n return { x: xEnd, y: isNaN(yEnd) ? yStart : yEnd };\n }\n};\nvar POSITION_BOTTOM_RIGHT_COORDINATES = ({ yDirection, xStart, xEnd, yStart, yEnd }) => {\n if (yDirection) {\n return { x: xEnd, y: isNaN(yEnd) ? yStart : yEnd };\n } else {\n return { x: xStart, y: isNaN(yEnd) ? yStart : yEnd };\n }\n};\nvar labelDirectionHandling = {\n top: { c: POSITION_TOP_COORDINATES },\n bottom: { c: POSITION_BOTTOM_COORDINATES },\n left: { c: POSITION_LEFT_COORDINATES },\n right: { c: POSITION_RIGHT_COORDINATES },\n topLeft: { c: POSITION_TOP_LEFT_COORDINATES },\n topRight: { c: POSITION_TOP_RIGHT_COORDINATES },\n bottomLeft: { c: POSITION_BOTTOM_LEFT_COORDINATES },\n bottomRight: { c: POSITION_BOTTOM_RIGHT_COORDINATES },\n inside: { c: POSITION_INSIDE_COORDINATES },\n insideLeft: { c: POSITION_LEFT_COORDINATES },\n insideRight: { c: POSITION_RIGHT_COORDINATES },\n insideTop: { c: POSITION_TOP_COORDINATES },\n insideBottom: { c: POSITION_BOTTOM_COORDINATES },\n insideTopLeft: { c: POSITION_TOP_LEFT_COORDINATES },\n insideBottomLeft: { c: POSITION_BOTTOM_LEFT_COORDINATES },\n insideTopRight: { c: POSITION_TOP_RIGHT_COORDINATES },\n insideBottomRight: { c: POSITION_BOTTOM_RIGHT_COORDINATES }\n};\n\n// packages/ag-charts-community/src/chart/crossline/cartesianCrossLine.ts\nvar CROSSLINE_LABEL_POSITION = UNION(\n [\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n \"topLeft\",\n \"topRight\",\n \"bottomLeft\",\n \"bottomRight\",\n \"inside\",\n \"insideLeft\",\n \"insideRight\",\n \"insideTop\",\n \"insideBottom\",\n \"insideTopLeft\",\n \"insideBottomLeft\",\n \"insideTopRight\",\n \"insideBottomRight\"\n ],\n \"crossLine label position\"\n);\nvar CartesianCrossLineLabel = class {\n constructor() {\n this.enabled = void 0;\n this.text = void 0;\n this.fontStyle = void 0;\n this.fontWeight = void 0;\n this.fontSize = 14;\n this.fontFamily = \"Verdana, sans-serif\";\n this.padding = 5;\n this.color = \"rgba(87, 87, 87, 1)\";\n this.position = void 0;\n this.rotation = void 0;\n this.parallel = void 0;\n }\n};\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], CartesianCrossLineLabel.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], CartesianCrossLineLabel.prototype, \"text\", 2);\n__decorateClass([\n Validate(FONT_STYLE, { optional: true })\n], CartesianCrossLineLabel.prototype, \"fontStyle\", 2);\n__decorateClass([\n Validate(FONT_WEIGHT2, { optional: true })\n], CartesianCrossLineLabel.prototype, \"fontWeight\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], CartesianCrossLineLabel.prototype, \"fontSize\", 2);\n__decorateClass([\n Validate(STRING)\n], CartesianCrossLineLabel.prototype, \"fontFamily\", 2);\n__decorateClass([\n Validate(NUMBER)\n], CartesianCrossLineLabel.prototype, \"padding\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], CartesianCrossLineLabel.prototype, \"color\", 2);\n__decorateClass([\n Validate(CROSSLINE_LABEL_POSITION, { optional: true })\n], CartesianCrossLineLabel.prototype, \"position\", 2);\n__decorateClass([\n Validate(DEGREE, { optional: true })\n], CartesianCrossLineLabel.prototype, \"rotation\", 2);\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], CartesianCrossLineLabel.prototype, \"parallel\", 2);\nvar _CartesianCrossLine = class _CartesianCrossLine {\n constructor() {\n this.id = createId(this);\n this.enabled = void 0;\n this.type = void 0;\n this.range = void 0;\n this.value = void 0;\n this.fill = void 0;\n this.fillOpacity = void 0;\n this.stroke = void 0;\n this.strokeWidth = void 0;\n this.strokeOpacity = void 0;\n this.lineDash = void 0;\n this.label = new CartesianCrossLineLabel();\n this.scale = void 0;\n this.clippedRange = [-Infinity, Infinity];\n this.gridLength = 0;\n this.sideFlag = -1;\n this.parallelFlipRotation = 0;\n this.regularFlipRotation = 0;\n this.direction = \"x\" /* X */;\n this.group = new Group({ name: `${this.id}`, layer: true, zIndex: _CartesianCrossLine.LINE_LAYER_ZINDEX });\n this.labelGroup = new Group({ name: `${this.id}`, layer: true, zIndex: _CartesianCrossLine.LABEL_LAYER_ZINDEX });\n this.crossLineRange = new Range();\n this.crossLineLabel = new Text();\n this.labelPoint = void 0;\n this.data = [];\n this.startLine = false;\n this.endLine = false;\n this.isRange = false;\n const { group: group2, labelGroup, crossLineRange, crossLineLabel } = this;\n group2.append(crossLineRange);\n labelGroup.append(crossLineLabel);\n crossLineRange.pointerEvents = 1 /* None */;\n }\n update(visible) {\n const { enabled, data, type, value, range: range3, scale: scale2 } = this;\n if (!type || !scale2 || !enabled || !visible || !validateCrossLineValues(type, value, range3, scale2) || data.length === 0) {\n this.group.visible = false;\n this.labelGroup.visible = false;\n return;\n }\n this.group.visible = visible;\n this.labelGroup.visible = visible;\n this.group.zIndex = this.getZIndex(this.isRange);\n this.updateNodes();\n }\n calculateLayout(visible, reversedAxis) {\n if (!visible) {\n return;\n }\n const dataCreated = this.createNodeData(reversedAxis);\n if (!dataCreated) {\n return;\n }\n const { sideFlag, gridLength, data } = this;\n const boxes = [];\n const x1 = 0;\n const x2 = sideFlag * gridLength;\n const y1 = data[0];\n const y2 = data[1];\n const crossLineBox = new BBox(Math.min(x1, x2), Math.min(y1, y2), Math.abs(x1 - x2), Math.abs(y1 - y2));\n boxes.push(crossLineBox);\n const labelBox = this.computeLabelBBox();\n if (labelBox) {\n boxes.push(labelBox);\n }\n return BBox.merge(boxes);\n }\n updateNodes() {\n this.updateRangeNode();\n if (this.label.enabled) {\n this.updateLabel();\n this.positionLabel();\n }\n }\n createNodeData(reversedAxis) {\n var _a, _b, _c;\n const {\n scale: scale2,\n gridLength,\n sideFlag,\n direction,\n label: { position = \"top\" },\n clippedRange,\n strokeWidth = 0\n } = this;\n this.data = [];\n if (!scale2) {\n return false;\n }\n const bandwidth = (_a = scale2.bandwidth) != null ? _a : 0;\n const step = (_b = scale2.step) != null ? _b : 0;\n const padding = (reversedAxis ? -1 : 1) * (scale2 instanceof BandScale ? (step - bandwidth) / 2 : 0);\n const [xStart, xEnd] = [0, sideFlag * gridLength];\n let [yStart, yEnd] = this.getRange();\n const ordinalTimeScalePadding = yEnd === void 0 && OrdinalTimeScale.is(scale2) ? bandwidth / 2 + padding : 0;\n let [clampedYStart, clampedYEnd] = [\n Number(scale2.convert(yStart, { clampMode: \"clamped\" })) - padding + ordinalTimeScalePadding,\n scale2.convert(yEnd, { clampMode: \"clamped\" }) + bandwidth + padding\n ];\n clampedYStart = clampArray(clampedYStart, clippedRange);\n clampedYEnd = clampArray(clampedYEnd, clippedRange);\n [yStart, yEnd] = [Number(scale2.convert(yStart)) + ordinalTimeScalePadding, scale2.convert(yEnd) + bandwidth];\n const validRange = (yStart === clampedYStart || yEnd === clampedYEnd || clampedYStart !== clampedYEnd) && Math.abs(clampedYEnd - clampedYStart) > 0;\n if (validRange && clampedYStart > clampedYEnd) {\n [clampedYStart, clampedYEnd] = [clampedYEnd, clampedYStart];\n [yStart, yEnd] = [yEnd, yStart];\n }\n if (yStart - padding >= clampedYStart)\n yStart -= padding;\n if (yEnd + padding <= clampedYEnd)\n yEnd += padding;\n this.isRange = validRange;\n this.startLine = strokeWidth > 0 && yStart >= clampedYStart && yStart <= clampedYStart + padding;\n this.endLine = strokeWidth > 0 && yEnd >= clampedYEnd - bandwidth - padding && yEnd <= clampedYEnd;\n if (!validRange && !this.startLine && !this.endLine) {\n return false;\n }\n this.data = [clampedYStart, clampedYEnd];\n if (this.label.enabled) {\n const yDirection = direction === \"y\" /* Y */;\n const { c = POSITION_TOP_COORDINATES } = (_c = labelDirectionHandling[position]) != null ? _c : {};\n const { x: labelX, y: labelY } = c({\n yDirection,\n xStart,\n xEnd,\n yStart: clampedYStart,\n yEnd: clampedYEnd\n });\n this.labelPoint = {\n x: labelX,\n y: labelY\n };\n }\n return true;\n }\n updateRangeNode() {\n var _a;\n const {\n crossLineRange,\n sideFlag,\n gridLength,\n data,\n startLine,\n endLine,\n isRange,\n fill,\n fillOpacity,\n stroke,\n strokeWidth,\n lineDash\n } = this;\n crossLineRange.x1 = 0;\n crossLineRange.x2 = sideFlag * gridLength;\n crossLineRange.y1 = data[0];\n crossLineRange.y2 = data[1];\n crossLineRange.startLine = startLine;\n crossLineRange.endLine = endLine;\n crossLineRange.isRange = isRange;\n crossLineRange.fill = fill;\n crossLineRange.fillOpacity = fillOpacity != null ? fillOpacity : 1;\n crossLineRange.stroke = stroke;\n crossLineRange.strokeWidth = strokeWidth != null ? strokeWidth : 1;\n crossLineRange.strokeOpacity = (_a = this.strokeOpacity) != null ? _a : 1;\n crossLineRange.lineDash = lineDash;\n }\n updateLabel() {\n const { crossLineLabel, label } = this;\n if (!label.text) {\n return;\n }\n crossLineLabel.fontStyle = label.fontStyle;\n crossLineLabel.fontWeight = label.fontWeight;\n crossLineLabel.fontSize = label.fontSize;\n crossLineLabel.fontFamily = label.fontFamily;\n crossLineLabel.fill = label.color;\n crossLineLabel.text = label.text;\n }\n positionLabel() {\n const {\n crossLineLabel,\n labelPoint: { x = void 0, y = void 0 } = {},\n label: { parallel, rotation, position = \"top\", padding = 0 },\n direction,\n parallelFlipRotation,\n regularFlipRotation\n } = this;\n if (x === void 0 || y === void 0) {\n return;\n }\n const { defaultRotation, configuredRotation } = calculateLabelRotation({\n rotation,\n parallel,\n regularFlipRotation,\n parallelFlipRotation\n });\n crossLineLabel.rotation = defaultRotation + configuredRotation;\n crossLineLabel.textBaseline = \"middle\";\n crossLineLabel.textAlign = \"center\";\n const bbox = crossLineLabel.computeTransformedBBox();\n if (!bbox) {\n return;\n }\n const yDirection = direction === \"y\" /* Y */;\n const { xTranslation, yTranslation } = calculateLabelTranslation({\n yDirection,\n padding,\n position,\n bbox\n });\n crossLineLabel.translationX = x + xTranslation;\n crossLineLabel.translationY = y + yTranslation;\n }\n getZIndex(isRange = false) {\n if (isRange) {\n return _CartesianCrossLine.RANGE_LAYER_ZINDEX;\n }\n return _CartesianCrossLine.LINE_LAYER_ZINDEX;\n }\n getRange() {\n var _a;\n const { value, range: range3, scale: scale2 } = this;\n const isContinuous2 = ContinuousScale.is(scale2) || OrdinalTimeScale.is(scale2);\n const start = (_a = range3 == null ? void 0 : range3[0]) != null ? _a : value;\n let end = range3 == null ? void 0 : range3[1];\n if (!isContinuous2 && end === void 0) {\n end = start;\n }\n if (isContinuous2 && start === end) {\n end = void 0;\n }\n return [start, end];\n }\n computeLabelBBox() {\n const { label } = this;\n if (!label.enabled) {\n return;\n }\n const tempText = new Text();\n tempText.fontFamily = label.fontFamily;\n tempText.fontSize = label.fontSize;\n tempText.fontStyle = label.fontStyle;\n tempText.fontWeight = label.fontWeight;\n tempText.text = label.text;\n const {\n labelPoint: { x = void 0, y = void 0 } = {},\n label: { parallel, rotation, position = \"top\", padding = 0 },\n direction,\n parallelFlipRotation,\n regularFlipRotation\n } = this;\n if (x === void 0 || y === void 0) {\n return;\n }\n const { configuredRotation } = calculateLabelRotation({\n rotation,\n parallel,\n regularFlipRotation,\n parallelFlipRotation\n });\n tempText.rotation = configuredRotation;\n tempText.textBaseline = \"middle\";\n tempText.textAlign = \"center\";\n const bbox = tempText.computeTransformedBBox();\n if (!bbox) {\n return;\n }\n const yDirection = direction === \"y\" /* Y */;\n const { xTranslation, yTranslation } = calculateLabelTranslation({\n yDirection,\n padding,\n position,\n bbox\n });\n tempText.translationX = x + xTranslation;\n tempText.translationY = y + yTranslation;\n return tempText.computeTransformedBBox();\n }\n calculatePadding(padding) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n const {\n isRange,\n startLine,\n endLine,\n direction,\n label: { padding: labelPadding = 0, position = \"top\" }\n } = this;\n if (!isRange && !startLine && !endLine) {\n return;\n }\n const crossLineLabelBBox = this.computeLabelBBox();\n if ((crossLineLabelBBox == null ? void 0 : crossLineLabelBBox.x) == null || (crossLineLabelBBox == null ? void 0 : crossLineLabelBBox.y) == null) {\n return;\n }\n const chartPadding = calculateLabelChartPadding({\n yDirection: direction === \"y\" /* Y */,\n padding: labelPadding,\n position,\n bbox: crossLineLabelBBox\n });\n padding.left = Math.max((_a = padding.left) != null ? _a : 0, (_b = chartPadding.left) != null ? _b : 0);\n padding.right = Math.max((_c = padding.right) != null ? _c : 0, (_d = chartPadding.right) != null ? _d : 0);\n padding.top = Math.max((_e = padding.top) != null ? _e : 0, (_f = chartPadding.top) != null ? _f : 0);\n padding.bottom = Math.max((_g = padding.bottom) != null ? _g : 0, (_h = chartPadding.bottom) != null ? _h : 0);\n }\n};\n_CartesianCrossLine.LINE_LAYER_ZINDEX = 9 /* SERIES_CROSSLINE_LINE_ZINDEX */;\n_CartesianCrossLine.RANGE_LAYER_ZINDEX = 3 /* SERIES_CROSSLINE_RANGE_ZINDEX */;\n_CartesianCrossLine.LABEL_LAYER_ZINDEX = 8 /* SERIES_LABEL_ZINDEX */;\n_CartesianCrossLine.className = \"CrossLine\";\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], _CartesianCrossLine.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(UNION([\"range\", \"line\"], \"a crossLine type\"), { optional: true })\n], _CartesianCrossLine.prototype, \"type\", 2);\n__decorateClass([\n Validate(AND(MATCHING_CROSSLINE_TYPE(\"range\"), ARRAY.restrict({ length: 2 })), {\n optional: true\n })\n], _CartesianCrossLine.prototype, \"range\", 2);\n__decorateClass([\n Validate(MATCHING_CROSSLINE_TYPE(\"value\"), { optional: true })\n], _CartesianCrossLine.prototype, \"value\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], _CartesianCrossLine.prototype, \"fill\", 2);\n__decorateClass([\n Validate(RATIO, { optional: true })\n], _CartesianCrossLine.prototype, \"fillOpacity\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], _CartesianCrossLine.prototype, \"stroke\", 2);\n__decorateClass([\n Validate(NUMBER, { optional: true })\n], _CartesianCrossLine.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(RATIO, { optional: true })\n], _CartesianCrossLine.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n Validate(LINE_DASH, { optional: true })\n], _CartesianCrossLine.prototype, \"lineDash\", 2);\nvar CartesianCrossLine = _CartesianCrossLine;\n\n// packages/ag-charts-community/src/module/moduleMap.ts\nvar ModuleMap = class {\n constructor() {\n this.moduleMap = /* @__PURE__ */ new Map();\n }\n *modules() {\n for (const m of this.moduleMap.values()) {\n yield m.moduleInstance;\n }\n }\n addModule(module, moduleFactory) {\n if (this.moduleMap.has(module.optionsKey)) {\n throw new Error(`AG Charts - module already initialised: ${module.optionsKey}`);\n }\n this.moduleMap.set(module.optionsKey, { module, moduleInstance: moduleFactory(module) });\n }\n removeModule(module) {\n var _a;\n const moduleKey = isString(module) ? module : module.optionsKey;\n (_a = this.moduleMap.get(moduleKey)) == null ? void 0 : _a.moduleInstance.destroy();\n this.moduleMap.delete(moduleKey);\n }\n getModule(module) {\n var _a;\n return (_a = this.moduleMap.get(isString(module) ? module : module.optionsKey)) == null ? void 0 : _a.moduleInstance;\n }\n isEnabled(module) {\n return this.moduleMap.has(isString(module) ? module : module.optionsKey);\n }\n mapModules(callback) {\n return Array.from(this.moduleMap.values(), (m, i) => callback(m.moduleInstance, i));\n }\n destroy() {\n var _a;\n for (const moduleKey of this.moduleMap.keys()) {\n (_a = this.moduleMap.get(moduleKey)) == null ? void 0 : _a.moduleInstance.destroy();\n }\n this.moduleMap.clear();\n }\n};\n\n// packages/ag-charts-community/src/motion/resetMotion.ts\nvar resetMotion_exports = {};\n__export(resetMotion_exports, {\n resetMotion: () => resetMotion\n});\nfunction resetMotion(selectionsOrNodes, propsFn) {\n const { nodes, selections } = deconstructSelectionsOrNodes(selectionsOrNodes);\n for (const selection of selections) {\n for (const node of selection.nodes()) {\n const from = propsFn(node, node.datum);\n node.setProperties(from);\n }\n selection.cleanup();\n }\n for (const node of nodes) {\n const from = propsFn(node, node.datum);\n node.setProperties(from);\n }\n}\n\n// packages/ag-charts-community/src/motion/states.ts\nvar StateMachine = class {\n constructor(initialState, states, preTransitionCb) {\n this.states = states;\n this.preTransitionCb = preTransitionCb;\n this.debug = Debug.create(true, \"animation\");\n this.state = initialState;\n this.debug(`%c${this.constructor.name} | init -> ${initialState}`, \"color: green\");\n }\n transition(event, data) {\n var _a, _b;\n const currentStateConfig = this.states[this.state];\n const destinationTransition = currentStateConfig == null ? void 0 : currentStateConfig[event];\n if (!destinationTransition) {\n this.debug(`%c${this.constructor.name} | ${this.state} -> ${event} -> ${this.state}`, \"color: grey\");\n return;\n }\n let destinationState = this.state;\n if (typeof destinationTransition === \"string\") {\n destinationState = destinationTransition;\n } else if (typeof destinationTransition === \"object\") {\n destinationState = destinationTransition.target;\n }\n this.debug(`%c${this.constructor.name} | ${this.state} -> ${event} -> ${destinationState}`, \"color: green\");\n (_a = this.preTransitionCb) == null ? void 0 : _a.call(this, this.state, destinationState);\n this.state = destinationState;\n if (typeof destinationTransition === \"function\") {\n destinationTransition(data);\n } else if (typeof destinationTransition === \"object\") {\n (_b = destinationTransition.action) == null ? void 0 : _b.call(destinationTransition, data);\n }\n return this.state;\n }\n};\n\n// packages/ag-charts-community/src/util/numberFormat.ts\nvar group = (content) => `(${content})`;\nvar optionalGroup = (content) => `${group(content)}?`;\nvar nonCapturingGroup = (content) => optionalGroup(`?:${content}`);\nvar formatRegEx = (() => {\n const fill = \".\";\n const align = \"[<>=^]\";\n const sign = \"[+\\\\-( ]\";\n const symbol = \"[$\\u20AC\\xA3\\xA5\\u20A3\\u20B9#]\";\n const zero = \"0\";\n const width = \"\\\\d+\";\n const comma = \",\";\n const precision = \"\\\\d+\";\n const tilde = \"~\";\n const type = \"[%a-z]\";\n return new RegExp(\n [\n \"^\",\n nonCapturingGroup(`${optionalGroup(fill)}${group(align)}`),\n optionalGroup(sign),\n optionalGroup(symbol),\n optionalGroup(zero),\n optionalGroup(width),\n optionalGroup(comma),\n nonCapturingGroup(`\\\\.${group(precision)}`),\n optionalGroup(tilde),\n optionalGroup(type),\n \"$\"\n ].join(\"\"),\n \"i\"\n );\n})();\nvar surroundedRegEx = (() => {\n const prefix = \".*?\";\n const content = \".+?\";\n const suffix = \".*?\";\n return new RegExp([\"^\", group(prefix), `#\\\\{${group(content)}\\\\}`, group(suffix), \"$\"].join(\"\"));\n})();\nfunction parseFormatter(formatter) {\n let prefix;\n let suffix;\n const surrounded = surroundedRegEx.exec(formatter);\n if (surrounded) {\n [, prefix, formatter, suffix] = surrounded;\n }\n const match = formatRegEx.exec(formatter);\n if (!match) {\n throw new Error(`The number formatter is invalid: ${formatter}`);\n }\n const [, fill, align, sign, symbol, zero, width, comma, precision, trim, type] = match;\n return {\n fill,\n align,\n sign,\n symbol,\n zero,\n width: parseInt(width),\n comma,\n precision: parseInt(precision),\n trim: Boolean(trim),\n type,\n prefix,\n suffix\n };\n}\nfunction format(formatter) {\n const options = typeof formatter === \"string\" ? parseFormatter(formatter) : formatter;\n const { fill, align, sign = \"-\", symbol, zero, width, comma, type, prefix = \"\", suffix = \"\", precision } = options;\n let { trim } = options;\n const precisionIsNaN = precision === void 0 || isNaN(precision);\n let formatBody;\n if (!type) {\n formatBody = decimalTypes[\"g\"];\n trim = true;\n } else if (type in decimalTypes && type in integerTypes) {\n formatBody = precisionIsNaN ? integerTypes[type] : decimalTypes[type];\n } else if (type in decimalTypes) {\n formatBody = decimalTypes[type];\n } else if (type in integerTypes) {\n formatBody = integerTypes[type];\n } else {\n throw new Error(`The number formatter type is invalid: ${type}`);\n }\n let formatterPrecision;\n if (precision == null || precisionIsNaN) {\n formatterPrecision = type ? 6 : 12;\n } else {\n formatterPrecision = precision;\n }\n return (n) => {\n let result = formatBody(n, formatterPrecision);\n if (trim) {\n result = removeTrailingZeros(result);\n }\n if (comma) {\n result = insertSeparator(result, comma);\n }\n result = addSign(n, result, sign);\n if (symbol && symbol !== \"#\") {\n result = `${symbol}${result}`;\n }\n if (symbol === \"#\" && type === \"x\") {\n result = `0x${result}`;\n }\n if (type === \"s\") {\n result = `${result}${getSIPrefix(n)}`;\n }\n if (type === \"%\" || type === \"p\") {\n result = `${result}%`;\n }\n if (width != null && !isNaN(width)) {\n result = addPadding(result, width, fill != null ? fill : zero, align);\n }\n result = `${prefix}${result}${suffix}`;\n return result;\n };\n}\nvar absFloor = (n) => Math.floor(Math.abs(n));\nvar integerTypes = {\n b: (n) => absFloor(n).toString(2),\n c: (n) => String.fromCharCode(n),\n d: (n) => Math.round(Math.abs(n)).toFixed(0),\n o: (n) => absFloor(n).toString(8),\n x: (n) => absFloor(n).toString(16),\n X: (n) => integerTypes.x(n).toUpperCase(),\n n: (n) => integerTypes.d(n),\n \"%\": (n) => `${absFloor(n * 100).toFixed(0)}`\n};\nvar decimalTypes = {\n e: (n, f) => Math.abs(n).toExponential(f),\n E: (n, f) => decimalTypes.e(n, f).toUpperCase(),\n f: (n, f) => Math.abs(n).toFixed(f),\n F: (n, f) => decimalTypes.f(n, f).toUpperCase(),\n g: (n, f) => {\n if (n === 0) {\n return \"0\";\n }\n const a = Math.abs(n);\n const p = Math.floor(Math.log10(a));\n if (p >= -4 && p < f) {\n return a.toFixed(f - 1 - p);\n }\n return a.toExponential(f - 1);\n },\n G: (n, f) => decimalTypes.g(n, f).toUpperCase(),\n n: (n, f) => decimalTypes.g(n, f),\n p: (n, f) => decimalTypes.r(n * 100, f),\n r: (n, f) => {\n if (n === 0) {\n return \"0\";\n }\n const a = Math.abs(n);\n const p = Math.floor(Math.log10(a));\n const q = p - (f - 1);\n if (q <= 0) {\n return a.toFixed(-q);\n }\n const x = Math.pow(10, q);\n return (Math.round(a / x) * x).toFixed();\n },\n s: (n, f) => {\n const p = getSIPrefixPower(n);\n return decimalTypes.r(n / Math.pow(10, p), f);\n },\n \"%\": (n, f) => decimalTypes.f(n * 100, f)\n};\nfunction removeTrailingZeros(numString) {\n return numString.replace(/\\.0+$/, \"\").replace(/(\\.[1-9])0+$/, \"$1\");\n}\nfunction insertSeparator(numString, separator) {\n let dotIndex = numString.indexOf(\".\");\n if (dotIndex < 0) {\n dotIndex = numString.length;\n }\n const integerChars = numString.substring(0, dotIndex).split(\"\");\n const fractionalPart = numString.substring(dotIndex);\n for (let i = integerChars.length - 3; i > 0; i -= 3) {\n integerChars.splice(i, 0, separator);\n }\n return `${integerChars.join(\"\")}${fractionalPart}`;\n}\nfunction getSIPrefix(n) {\n return siPrefixes[getSIPrefixPower(n)];\n}\nfunction getSIPrefixPower(n) {\n return clamp(minSIPrefix, n ? Math.floor(Math.log10(Math.abs(n)) / 3) * 3 : 0, maxSIPrefix);\n}\nvar minSIPrefix = -24;\nvar maxSIPrefix = 24;\nvar siPrefixes = {\n [minSIPrefix]: \"y\",\n [-21]: \"z\",\n [-18]: \"a\",\n [-15]: \"f\",\n [-12]: \"p\",\n [-9]: \"n\",\n [-6]: \"\\xB5\",\n [-3]: \"m\",\n [0]: \"\",\n [3]: \"k\",\n [6]: \"M\",\n [9]: \"G\",\n [12]: \"T\",\n [15]: \"P\",\n [18]: \"E\",\n [21]: \"Z\",\n [maxSIPrefix]: \"Y\"\n};\nvar minusSign = \"\\u2212\";\nfunction addSign(num, numString, signType = \"\") {\n if (signType === \"(\") {\n return num >= 0 ? numString : `(${numString})`;\n }\n const plusSign = signType === \"+\" ? \"+\" : \"\";\n return `${num >= 0 ? plusSign : minusSign}${numString}`;\n}\nfunction addPadding(numString, width, fill = \" \", align = \">\") {\n let result = numString;\n if (align === \">\" || !align) {\n result = result.padStart(width, fill);\n } else if (align === \"<\") {\n result = result.padEnd(width, fill);\n } else if (align === \"^\") {\n const padWidth = Math.max(0, width - result.length);\n const padLeft = Math.ceil(padWidth / 2);\n const padRight = Math.floor(padWidth / 2);\n result = result.padStart(padLeft + result.length, fill);\n result = result.padEnd(padRight + result.length, fill);\n }\n return result;\n}\nfunction tickFormat(ticks, formatter) {\n const options = parseFormatter(formatter != null ? formatter : \",f\");\n const { precision } = options;\n if (precision == null || isNaN(precision)) {\n if (options.type === \"f\" || options.type === \"%\") {\n options.precision = Math.max(\n ...ticks.map((x) => {\n if (typeof x !== \"number\" || x === 0) {\n return 0;\n }\n const l = Math.floor(Math.log10(Math.abs(x)));\n const digits = options.type ? 6 : 12;\n const exp = x.toExponential(digits - 1).replace(/\\.?0+e/, \"e\");\n const dotIndex = exp.indexOf(\".\");\n if (dotIndex < 0) {\n return l >= 0 ? 0 : -l;\n }\n const s = exp.indexOf(\"e\") - dotIndex;\n return Math.max(0, s - l - 1);\n })\n );\n } else if (!options.type || options.type in decimalTypes) {\n options.precision = Math.max(\n ...ticks.map((x) => {\n if (typeof x !== \"number\") {\n return 0;\n }\n const exp = x.toExponential((options.type ? 6 : 12) - 1).replace(/\\.?0+e/, \"e\");\n return exp.substring(0, exp.indexOf(\"e\")).replace(\".\", \"\").length;\n })\n );\n }\n }\n const f = format(options);\n return (n) => f(Number(n));\n}\n\n// packages/ag-charts-community/src/scale/logScale.ts\nvar _LogScale = class _LogScale extends ContinuousScale {\n constructor() {\n super([1, 10], [0, 1]);\n this.type = \"log\";\n this.base = 10;\n this.baseLog = identity;\n this.basePow = identity;\n this.log = (x) => {\n const start = Math.min(...this.domain);\n return start >= 0 ? this.baseLog(x) : -this.baseLog(-x);\n };\n this.pow = (x) => {\n const start = Math.min(...this.domain);\n return start >= 0 ? this.basePow(x) : -this.basePow(-x);\n };\n this.defaultClampMode = \"clamped\";\n }\n toDomain(d) {\n return d;\n }\n transform(x) {\n const start = Math.min(...this.domain);\n return start >= 0 ? Math.log(x) : -Math.log(-x);\n }\n transformInvert(x) {\n const start = Math.min(...this.domain);\n return start >= 0 ? Math.exp(x) : -Math.exp(-x);\n }\n refresh() {\n if (this.base <= 0) {\n this.base = 0;\n Logger.warnOnce(\"expecting a finite Number greater than to 0\");\n }\n super.refresh();\n }\n update() {\n if (!this.domain || this.domain.length < 2) {\n return;\n }\n this.baseLog = _LogScale.getBaseLogMethod(this.base);\n this.basePow = _LogScale.getBasePowerMethod(this.base);\n if (this.nice) {\n this.updateNiceDomain();\n }\n }\n updateNiceDomain() {\n const [d0, d1] = this.domain;\n const roundStart = d0 > d1 ? Math.ceil : Math.floor;\n const roundStop = d0 > d1 ? Math.floor : Math.ceil;\n const n0 = this.pow(roundStart(this.log(d0)));\n const n1 = this.pow(roundStop(this.log(d1)));\n this.niceDomain = [n0, n1];\n }\n ticks() {\n var _a;\n const count = (_a = this.tickCount) != null ? _a : 10;\n if (!this.domain || this.domain.length < 2 || count < 1) {\n return [];\n }\n this.refresh();\n const base = this.base;\n const [d0, d1] = this.getDomain();\n const start = Math.min(d0, d1);\n const stop = Math.max(d0, d1);\n let p0 = this.log(start);\n let p1 = this.log(stop);\n if (this.interval) {\n const step = Math.abs(this.interval);\n const absDiff = Math.abs(p1 - p0);\n let ticks2 = range(p0, p1, Math.min(absDiff, step));\n ticks2 = createNumericTicks(\n ticks2.fractionDigits,\n ticks2.map((x) => this.pow(x)).filter((t) => t >= start && t <= stop)\n );\n const availableRange = this.getPixelRange();\n if (!isDenseInterval({ start, stop, interval: step, count: ticks2.length, availableRange })) {\n return ticks2;\n }\n }\n const isBaseInteger = base % 1 === 0;\n const isDiffLarge = p1 - p0 >= count;\n if (!isBaseInteger || isDiffLarge) {\n let ticks2 = ticks_default(p0, p1, Math.min(p1 - p0, count));\n ticks2 = createNumericTicks(\n ticks2.fractionDigits,\n ticks2.map((x) => this.pow(x))\n );\n return ticks2;\n }\n const ticks = [];\n const isPositive = start > 0;\n p0 = Math.floor(p0) - 1;\n p1 = Math.round(p1) + 1;\n const availableSpacing = findRangeExtent(this.range) / count;\n let lastTickPosition = Infinity;\n for (let p = p0; p <= p1; p++) {\n const nextMagnitudeTickPosition = this.convert(this.pow(p + 1));\n for (let k = 1; k < base; k++) {\n const q = isPositive ? k : base - k + 1;\n const t = this.pow(p) * q;\n const tickPosition = this.convert(t);\n const prevSpacing = Math.abs(lastTickPosition - tickPosition);\n const nextSpacing = Math.abs(tickPosition - nextMagnitudeTickPosition);\n const fits = prevSpacing >= availableSpacing && nextSpacing >= availableSpacing;\n if (t >= start && t <= stop && (k === 1 || fits || ticks.length === 0)) {\n ticks.push(t);\n lastTickPosition = tickPosition;\n }\n }\n }\n return ticks;\n }\n tickFormat({\n count,\n ticks,\n specifier\n }) {\n if (count !== Infinity && ticks == null) {\n this.ticks();\n }\n specifier != null ? specifier : specifier = this.base === 10 ? \".0e\" : \",\";\n return isString(specifier) ? format(specifier) : specifier;\n }\n static getBaseLogMethod(base) {\n switch (base) {\n case 10:\n return Math.log10;\n case Math.E:\n return Math.log;\n case 2:\n return Math.log2;\n default:\n const logBase = Math.log(base);\n return (x) => Math.log(x) / logBase;\n }\n }\n static getBasePowerMethod(base) {\n switch (base) {\n case 10:\n return (x) => x >= 0 ? __pow(10, x) : 1 / __pow(10, -x);\n case Math.E:\n return Math.exp;\n default:\n return (x) => __pow(base, x);\n }\n }\n};\n__decorateClass([\n Invalidating\n], _LogScale.prototype, \"base\", 2);\nvar LogScale = _LogScale;\n\n// packages/ag-charts-community/src/scene/selection.ts\nvar Selection = class _Selection {\n constructor(parentNode, classOrFactory, autoCleanup = true) {\n this.parentNode = parentNode;\n this.autoCleanup = autoCleanup;\n this.garbageBin = /* @__PURE__ */ new Set();\n this._nodesMap = /* @__PURE__ */ new Map();\n this._nodes = [];\n this.data = [];\n this.debug = Debug.create(true, \"scene\", \"scene:selections\");\n this.nodeFactory = Object.prototype.isPrototypeOf.call(Node, classOrFactory) ? () => new classOrFactory() : classOrFactory;\n }\n static select(parent, classOrFactory, garbageCollection = true) {\n return new _Selection(parent, classOrFactory, garbageCollection);\n }\n static selectAll(parent, predicate) {\n const results = [];\n const traverse = (node) => {\n if (predicate(node)) {\n results.push(node);\n }\n node.children.forEach(traverse);\n };\n traverse(parent);\n return results;\n }\n static selectByClass(node, Class, ...ExtraClasses) {\n return _Selection.selectAll(node, (n) => {\n return n instanceof Class || ExtraClasses.some((C) => n instanceof C);\n });\n }\n static selectByTag(node, tag) {\n return _Selection.selectAll(node, (n) => n.tag === tag);\n }\n createNode(datum, initializer, idx) {\n const node = this.nodeFactory(datum);\n node.datum = datum;\n initializer == null ? void 0 : initializer(node);\n if (idx == null) {\n this._nodes.push(node);\n } else {\n this._nodes.splice(idx, 0, node);\n }\n this.parentNode.appendChild(node);\n return node;\n }\n /**\n * Update the data in a selection. If an `getDatumId()` function is provided, maintain a list of ids related to\n * the nodes. Otherwise, take the more efficient route of simply creating and destroying nodes at the end\n * of the array.\n */\n update(data, initializer, getDatumId) {\n if (this.garbageBin.size > 0) {\n this.debug(`Selection - update() called with pending garbage: ${data}`);\n }\n if (getDatumId) {\n const dataMap = new Map(\n data.map((datum, idx) => [getDatumId(datum), [datum, idx]])\n );\n for (const [node, datumId] of this._nodesMap.entries()) {\n if (dataMap.has(datumId)) {\n const [newDatum] = dataMap.get(datumId);\n node.datum = newDatum;\n this.garbageBin.delete(node);\n dataMap.delete(datumId);\n } else {\n this.garbageBin.add(node);\n }\n }\n for (const [datumId, [datum, idx]] of dataMap.entries()) {\n this._nodesMap.set(this.createNode(datum, initializer, idx), datumId);\n }\n } else {\n const maxLength = Math.max(data.length, this.data.length);\n for (let i = 0; i < maxLength; i++) {\n if (i >= data.length) {\n this.garbageBin.add(this._nodes[i]);\n } else if (i >= this._nodes.length) {\n this.createNode(data[i], initializer);\n } else {\n this._nodes[i].datum = data[i];\n this.garbageBin.delete(this._nodes[i]);\n }\n }\n }\n this.data = data.slice();\n if (this.autoCleanup) {\n this.cleanup();\n }\n return this;\n }\n cleanup() {\n if (this.garbageBin.size === 0) {\n return this;\n }\n this._nodes = this._nodes.filter((node) => {\n if (this.garbageBin.has(node)) {\n this._nodesMap.delete(node);\n this.garbageBin.delete(node);\n this.parentNode.removeChild(node);\n return false;\n }\n return true;\n });\n return this;\n }\n clear() {\n this.update([]);\n return this;\n }\n isGarbage(node) {\n return this.garbageBin.has(node);\n }\n hasGarbage() {\n return this.garbageBin.size > 0;\n }\n each(iterate2) {\n for (const entry of this._nodes.entries()) {\n iterate2(entry[1], entry[1].datum, entry[0]);\n }\n return this;\n }\n *[Symbol.iterator]() {\n for (let index = 0; index < this._nodes.length; index++) {\n const node = this._nodes[index];\n const datum = this._nodes[index].datum;\n yield { node, datum, index };\n }\n }\n select(predicate) {\n return _Selection.selectAll(this.parentNode, predicate);\n }\n selectByClass(Class) {\n return _Selection.selectByClass(this.parentNode, Class);\n }\n selectByTag(tag) {\n return _Selection.selectByTag(this.parentNode, tag);\n }\n nodes() {\n return this._nodes;\n }\n};\n\n// packages/ag-charts-community/src/util/distance.ts\nfunction pointsDistanceSquared(x1, y1, x2, y2) {\n const dx = x1 - x2;\n const dy = y1 - y2;\n return dx * dx + dy * dy;\n}\nfunction lineDistanceSquared(x, y, x1, y1, x2, y2, best) {\n if (x1 === x2 && y1 === y2) {\n return Math.min(best, pointsDistanceSquared(x, y, x1, y1));\n }\n const dx = x2 - x1;\n const dy = y2 - y1;\n const t = Math.max(0, Math.min(1, ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy)));\n const ix = x1 + t * dx;\n const iy = y1 + t * dy;\n return Math.min(best, pointsDistanceSquared(x, y, ix, iy));\n}\nfunction arcDistanceSquared(x, y, cx, cy, radius, startAngle, endAngle, counterClockwise, best) {\n if (counterClockwise) {\n [endAngle, startAngle] = [startAngle, endAngle];\n }\n const angle = Math.atan2(y - cy, x - cx);\n if (!isBetweenAngles(angle, startAngle, endAngle)) {\n const startX = cx + Math.cos(startAngle) * radius;\n const startY = cy + Math.sin(startAngle) * radius;\n const endX = cx + Math.cos(startAngle) * radius;\n const endY = cy + Math.sin(startAngle) * radius;\n return Math.min(best, pointsDistanceSquared(x, y, startX, startY), pointsDistanceSquared(x, y, endX, endY));\n }\n const distToArc = radius - Math.sqrt(pointsDistanceSquared(x, y, cx, cy));\n return Math.min(best, distToArc * distToArc);\n}\n\n// packages/ag-charts-community/src/scene/shape/line.ts\nvar Line = class extends Shape {\n constructor(opts = {}) {\n super(opts);\n this.x1 = 0;\n this.y1 = 0;\n this.x2 = 0;\n this.y2 = 0;\n this.restoreOwnStyles();\n }\n set x(value) {\n this.x1 = value;\n this.x2 = value;\n }\n set y(value) {\n this.y1 = value;\n this.y2 = value;\n }\n computeBBox() {\n return new BBox(\n Math.min(this.x1, this.x2),\n Math.min(this.y1, this.y2),\n Math.abs(this.x2 - this.x1),\n Math.abs(this.y2 - this.y1)\n );\n }\n isPointInPath(px, py) {\n if (this.x1 === this.x2 || this.y1 === this.y2) {\n const { x, y } = this.transformPoint(px, py);\n return this.computeBBox().grow(this.strokeWidth / 2).containsPoint(x, y);\n }\n return false;\n }\n distanceSquared(px, py) {\n const { x1, y1, x2, y2 } = this;\n return lineDistanceSquared(px, py, x1, y1, x2, y2, Infinity);\n }\n render(renderCtx) {\n var _a;\n const { ctx, forceRender, stats, devicePixelRatio } = renderCtx;\n if (this.dirty === 0 /* NONE */ && !forceRender) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n let { x1, y1, x2, y2 } = this;\n if (x1 === x2) {\n const { strokeWidth } = this;\n const x = Math.round(x1 * devicePixelRatio) / devicePixelRatio + Math.trunc(strokeWidth * devicePixelRatio) % 2 / (devicePixelRatio * 2);\n x1 = x;\n x2 = x;\n } else if (y1 === y2) {\n const { strokeWidth } = this;\n const y = Math.round(y1 * devicePixelRatio) / devicePixelRatio + Math.trunc(strokeWidth * devicePixelRatio) % 2 / (devicePixelRatio * 2);\n y1 = y;\n y2 = y;\n }\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n this.fillStroke(ctx);\n (_a = this.fillShadow) == null ? void 0 : _a.markClean();\n super.render(renderCtx);\n }\n};\nLine.className = \"Line\";\nLine.defaultStyles = Object.assign({}, Shape.defaultStyles, {\n fill: void 0,\n strokeWidth: 1\n});\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], Line.prototype, \"x1\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], Line.prototype, \"y1\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], Line.prototype, \"x2\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], Line.prototype, \"y2\", 2);\n\n// packages/ag-charts-community/src/scene/util/labelPlacement.ts\nfunction circleRectOverlap(c, unitCenter, x, y, w, h) {\n if (c.size === 0)\n return false;\n let cx = c.x;\n let cy = c.y;\n if (unitCenter != null) {\n cx -= (unitCenter.x - 0.5) * c.size;\n cy -= (unitCenter.y - 0.5) * c.size;\n }\n let edgeX = cx;\n if (cx < x) {\n edgeX = x;\n } else if (cx > x + w) {\n edgeX = x + w;\n }\n let edgeY = cy;\n if (cy < y) {\n edgeY = y;\n } else if (cy > y + h) {\n edgeY = y + h;\n }\n const dx = cx - edgeX;\n const dy = cy - edgeY;\n const d = Math.sqrt(dx * dx + dy * dy);\n return d <= c.size * 0.5;\n}\nfunction rectRectOverlap(r1, x2, y2, w2, h2) {\n const xOverlap = r1.x + r1.width > x2 && r1.x < x2 + w2;\n const yOverlap = r1.y + r1.height > y2 && r1.y < y2 + h2;\n return xOverlap && yOverlap;\n}\nfunction rectContainsRect(r1, r2x, r2y, r2w, r2h) {\n return r2x + r2w < r1.x + r1.width && r2x > r1.x && r2y > r1.y && r2y + r2h < r1.y + r1.height;\n}\nfunction isPointLabelDatum(x) {\n return x != null && typeof x.point === \"object\" && typeof x.label === \"object\";\n}\nvar labelPlacements = {\n top: { x: 0, y: -1 },\n bottom: { x: 0, y: 1 },\n left: { x: -1, y: 0 },\n right: { x: 1, y: 0 }\n};\nfunction placeLabels(data, bounds, padding = 5) {\n var _a, _b;\n const result = [];\n data = data.map((d) => d.slice().sort((a, b) => b.point.size - a.point.size));\n for (let j = 0; j < data.length; j++) {\n const labels = result[j] = [];\n const datum = data[j];\n if (!((datum == null ? void 0 : datum.length) && datum[0].label)) {\n continue;\n }\n for (let i = 0, ln = datum.length; i < ln; i++) {\n const d = datum[i];\n const { point, label, marker } = d;\n const { text, width, height } = label;\n const r = point.size * 0.5;\n let dx = 0;\n let dy = 0;\n if (r > 0 && d.placement != null) {\n const placement = labelPlacements[d.placement];\n dx = (width * 0.5 + r + padding) * placement.x;\n dy = (height * 0.5 + r + padding) * placement.y;\n }\n const x = point.x - width * 0.5 + dx - (((_a = marker == null ? void 0 : marker.center.x) != null ? _a : 0.5) - 0.5) * point.size;\n const y = point.y - height * 0.5 + dy - (((_b = marker == null ? void 0 : marker.center.y) != null ? _b : 0.5) - 0.5) * point.size;\n const withinBounds = !bounds || rectContainsRect(bounds, x, y, width, height);\n if (!withinBounds) {\n continue;\n }\n const overlapPoints = data.some(\n (dataDatums) => dataDatums.some(\n (dataDatum) => {\n var _a2;\n return circleRectOverlap(dataDatum.point, (_a2 = dataDatum.marker) == null ? void 0 : _a2.center, x, y, width, height);\n }\n )\n );\n if (overlapPoints) {\n continue;\n }\n const overlapLabels = result.some((l2) => l2.some((l3) => rectRectOverlap(l3, x, y, width, height)));\n if (overlapLabels) {\n continue;\n }\n labels.push({\n index: i,\n text,\n x,\n y,\n width,\n height,\n datum: d\n });\n }\n }\n return result;\n}\nfunction axisLabelsOverlap(data, padding) {\n const result = [];\n for (let i = 0; i < data.length; i++) {\n const datum = data[i];\n const {\n point: { x, y },\n label: { text }\n } = datum;\n let {\n label: { width, height }\n } = datum;\n width += padding != null ? padding : 0;\n height += padding != null ? padding : 0;\n const overlapLabels = result.some((l) => {\n return rectRectOverlap(l, x, y, width, height);\n });\n if (overlapLabels) {\n return true;\n }\n result.push({\n index: i,\n text,\n x,\n y,\n width,\n height,\n datum\n });\n }\n return false;\n}\n\n// packages/ag-charts-community/src/util/equal.ts\nfunction areArrayItemsStrictlyEqual(arrA, arrB) {\n return arrA.length === arrB.length && arrA.every((a, i) => {\n const b = arrB[i];\n if (Array.isArray(a) && Array.isArray(b)) {\n return areArrayItemsStrictlyEqual(a, b);\n }\n return a === b;\n });\n}\nfunction areArrayNumbersEqual(arrA, arrB) {\n return arrA.length === arrB.length && arrA.every((item, i) => Number(item) === Number(arrB[i]));\n}\n\n// packages/ag-charts-community/src/util/proxy.ts\nfunction ProxyProperty(proxyPath) {\n const pathArray = isArray(proxyPath) ? proxyPath : proxyPath.split(\".\");\n if (pathArray.length === 1) {\n const [property] = pathArray;\n return addTransformToInstanceProperty(\n (target, _, value) => target[property] = value,\n (target) => target[property]\n );\n }\n return addTransformToInstanceProperty(\n (target, _, value) => setPath(target, pathArray, value),\n (target) => getPath(target, pathArray)\n );\n}\nfunction ProxyOnWrite(proxyProperty) {\n return addTransformToInstanceProperty((target, _, value) => target[proxyProperty] = value);\n}\nfunction ProxyPropertyOnWrite(childName, childProperty) {\n return addTransformToInstanceProperty((target, key, value) => target[childName][childProperty != null ? childProperty : key] = value);\n}\nfunction ActionOnSet(opts) {\n const { newValue: newValueFn, oldValue: oldValueFn, changeValue: changeValueFn } = opts;\n return addTransformToInstanceProperty((target, _, newValue, oldValue) => {\n if (newValue !== oldValue) {\n if (oldValue !== void 0) {\n oldValueFn == null ? void 0 : oldValueFn.call(target, oldValue);\n }\n if (newValue !== void 0) {\n newValueFn == null ? void 0 : newValueFn.call(target, newValue);\n }\n changeValueFn == null ? void 0 : changeValueFn.call(target, newValue, oldValue);\n }\n return newValue;\n });\n}\nfunction ObserveChanges(observerFn) {\n return addObserverToInstanceProperty(observerFn);\n}\n\n// packages/ag-charts-community/src/util/attributeUtil.ts\nfunction setAttribute(e, qualifiedName, value) {\n if (value === void 0 || value === \"\") {\n e == null ? void 0 : e.removeAttribute(qualifiedName);\n } else {\n e == null ? void 0 : e.setAttribute(qualifiedName, value.toString());\n }\n}\n\n// packages/ag-charts-community/src/util/placement.ts\nfunction calculatePlacement(naturalWidth, naturalHeight, containerWidth, containerHeight, bounds) {\n let { top, right, bottom, left, width, height } = bounds;\n if (left != null) {\n if (width != null) {\n right = containerWidth - left + width;\n } else if (right != null) {\n width = containerWidth - left - right;\n }\n } else if (right != null && width != null) {\n left = containerWidth - right - width;\n }\n if (top != null) {\n if (height != null) {\n bottom = containerHeight - top - height;\n } else if (bottom != null) {\n height = containerHeight - bottom - top;\n }\n } else if (bottom != null && height != null) {\n top = containerHeight - bottom - height;\n }\n if (width == null) {\n if (height == null) {\n width = naturalWidth;\n height = naturalHeight;\n } else {\n width = Math.ceil(naturalWidth * height / naturalHeight);\n }\n } else if (height == null) {\n height = Math.ceil(naturalHeight * width / naturalWidth);\n }\n if (left == null) {\n if (right == null) {\n left = Math.floor((containerWidth - width) / 2);\n } else {\n left = containerWidth - right - width;\n }\n }\n if (top == null) {\n if (bottom == null) {\n top = Math.floor((containerHeight - height) / 2);\n } else {\n top = containerHeight - height - bottom;\n }\n }\n return { x: left, y: top, width, height };\n}\n\n// packages/ag-charts-community/src/chart/tooltip/tooltip.ts\nvar DEFAULT_TOOLTIP_CLASS = \"ag-chart-tooltip\";\nvar DEFAULT_TOOLTIP_DARK_CLASS = \"ag-chart-dark-tooltip\";\nvar EMPTY_TOOLTIP_CONTENT = { html: \"\", ariaLabel: \"\" };\nfunction toAccessibleText(inputHtml) {\n const lineConverter = (_match, offset4, str) => {\n if (offset4 === 0 || str[offset4 - 1] !== \".\") {\n return \". \";\n }\n return \" \";\n };\n return inputHtml.replace(//g, lineConverter).replace(/<\\/p\\s+>/g, lineConverter).replace(/<\\/li\\s*\\/>/g, lineConverter).replace(/<[^>]+>/g, \"\");\n}\nfunction toTooltipHtml(input, defaults) {\n var _a, _b, _c;\n if (typeof input === \"string\") {\n return { html: input, ariaLabel: input };\n }\n const {\n content = (_a = defaults == null ? void 0 : defaults.content) != null ? _a : \"\",\n title = defaults == null ? void 0 : defaults.title,\n color = (_b = defaults == null ? void 0 : defaults.color) != null ? _b : \"white\",\n backgroundColor = (_c = defaults == null ? void 0 : defaults.backgroundColor) != null ? _c : \"#888\"\n } = input;\n const titleHtml = title ? `
${title}
` : \"\";\n const titleAria = title ? `${title}: ` : \"\";\n const contentHtml = content ? `
${content}
` : \"\";\n return {\n html: `${titleHtml}${contentHtml}`,\n ariaLabel: toAccessibleText(`${titleAria}${content}`)\n };\n}\nvar TooltipPosition = class extends BaseProperties {\n constructor() {\n super(...arguments);\n /** The type of positioning for the tooltip. By default, the tooltip follows the pointer. */\n this.type = \"pointer\";\n /** The horizontal offset in pixels for the position of the tooltip. */\n this.xOffset = 0;\n /** The vertical offset in pixels for the position of the tooltip. */\n this.yOffset = 0;\n }\n};\n__decorateClass([\n Validate(\n UNION(\n [\n \"pointer\",\n \"node\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"top-left\",\n \"top-right\",\n \"bottom-right\",\n \"bottom-left\"\n ],\n \"a position type\"\n )\n )\n], TooltipPosition.prototype, \"type\", 2);\n__decorateClass([\n Validate(NUMBER)\n], TooltipPosition.prototype, \"xOffset\", 2);\n__decorateClass([\n Validate(NUMBER)\n], TooltipPosition.prototype, \"yOffset\", 2);\nvar Tooltip = class extends BaseProperties {\n constructor() {\n super();\n this.enabled = true;\n this.delay = 0;\n this.range = \"nearest\";\n this.wrapping = \"hyphenate\";\n this.position = new TooltipPosition();\n this.darkTheme = false;\n this.enableInteraction = false;\n this.lastVisibilityChange = Date.now();\n this.wrapTypes = [\"always\", \"hyphenate\", \"on-space\", \"never\"];\n this.showTimeout = 0;\n this._showArrow = true;\n this.element = createElement(\"div\", DEFAULT_TOOLTIP_CLASS);\n setAttribute(this.element, \"aria-hidden\", true);\n this.root = getDocument(\"body\");\n this.root.appendChild(this.element);\n }\n destroy() {\n this.element.remove();\n }\n isVisible() {\n return !this.element.classList.contains(DEFAULT_TOOLTIP_CLASS + \"-hidden\");\n }\n /**\n * Shows tooltip at the given event's coordinates.\n * If the `html` parameter is missing, moves the existing tooltip to the new position.\n */\n show(canvasRect, meta, content, instantly = false) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i;\n const { element: element2 } = this;\n if (content != null) {\n element2.innerHTML = content.html;\n } else if (!element2.innerHTML) {\n this.toggle(false);\n return;\n }\n const positionType = (_b = (_a = meta.position) == null ? void 0 : _a.type) != null ? _b : this.position.type;\n const xOffset = (_d = (_c = meta.position) == null ? void 0 : _c.xOffset) != null ? _d : 0;\n const yOffset = (_f = (_e = meta.position) == null ? void 0 : _e.yOffset) != null ? _f : 0;\n const tooltipBounds = this.getTooltipBounds({ positionType, meta, yOffset, xOffset, canvasRect });\n const windowBounds = this.getWindowSize();\n const position = calculatePlacement(\n element2.clientWidth,\n element2.clientHeight,\n canvasRect.width,\n canvasRect.height,\n tooltipBounds\n );\n position.x += canvasRect.x;\n position.y += canvasRect.y;\n const left = clamp(0, position.x, windowBounds.width - element2.clientWidth - 1);\n const top = clamp(0, position.y, windowBounds.height - element2.clientHeight);\n const constrained = left !== position.x || top !== position.y;\n const defaultShowArrow = (positionType === \"node\" || positionType === \"pointer\") && !constrained && !xOffset && !yOffset;\n const showArrow = (_h = (_g = meta.showArrow) != null ? _g : this.showArrow) != null ? _h : defaultShowArrow;\n this.updateShowArrow(showArrow);\n element2.style.transform = `translate(${Math.round(left)}px, ${Math.round(top)}px)`;\n this.enableInteraction = (_i = meta.enableInteraction) != null ? _i : false;\n if (this.delay > 0 && !instantly) {\n this.toggle(false);\n this.showTimeout = setTimeout(() => {\n this.toggle(true);\n }, this.delay);\n } else {\n this.toggle(true);\n }\n }\n getWindowSize() {\n const { innerWidth, innerHeight } = getWindow();\n return { width: innerWidth, height: innerHeight };\n }\n toggle(visible) {\n const { classList } = this.element;\n const toggleClass = (name, include) => classList.toggle(`${DEFAULT_TOOLTIP_CLASS}-${name}`, include);\n const wasVisible = this.isVisible();\n let timeSinceLastVisibilityChangeMs = Infinity;\n if (!visible) {\n clearTimeout(this.showTimeout);\n }\n if (wasVisible !== visible) {\n const now = Date.now();\n timeSinceLastVisibilityChangeMs = now - this.lastVisibilityChange;\n this.lastVisibilityChange = now;\n }\n const animatedMoveThresholdMs = 100;\n const thrashingThresholdMs = 5;\n const noAnimation = !wasVisible && visible && timeSinceLastVisibilityChangeMs > animatedMoveThresholdMs;\n if (timeSinceLastVisibilityChangeMs > thrashingThresholdMs) {\n toggleClass(\"no-animation\", noAnimation);\n }\n toggleClass(\"no-interaction\", !this.enableInteraction);\n toggleClass(\"hidden\", !visible);\n toggleClass(\"arrow\", this._showArrow);\n classList.toggle(DEFAULT_TOOLTIP_DARK_CLASS, this.darkTheme);\n for (const wrapType of this.wrapTypes) {\n classList.toggle(`${DEFAULT_TOOLTIP_CLASS}-wrap-${wrapType}`, wrapType === this.wrapping);\n }\n }\n pointerLeftOntoTooltip(event) {\n var _a;\n if (!this.enableInteraction)\n return false;\n const classList = (_a = event.sourceEvent.relatedTarget) == null ? void 0 : _a.classList;\n const classes = [\"\", \"-title\", \"-content\"];\n const classListContains = Boolean(classes.filter((c) => classList == null ? void 0 : classList.contains(`${DEFAULT_TOOLTIP_CLASS}${c}`)));\n return classList !== void 0 && classListContains;\n }\n updateShowArrow(show) {\n this._showArrow = show;\n }\n getTooltipBounds({\n positionType,\n meta,\n yOffset,\n xOffset,\n canvasRect\n }) {\n const { clientWidth: tooltipWidth, clientHeight: tooltipHeight } = this.element;\n const bounds = { width: tooltipWidth, height: tooltipHeight };\n switch (positionType) {\n case \"node\":\n case \"pointer\": {\n bounds.top = meta.offsetY + yOffset - tooltipHeight - 8;\n bounds.left = meta.offsetX + xOffset - tooltipWidth / 2;\n return bounds;\n }\n case \"top\": {\n bounds.top = yOffset;\n bounds.left = canvasRect.width / 2 - tooltipWidth / 2 + xOffset;\n return bounds;\n }\n case \"right\": {\n bounds.top = canvasRect.height / 2 - tooltipHeight / 2 + yOffset;\n bounds.left = canvasRect.width - tooltipWidth / 2 + xOffset;\n return bounds;\n }\n case \"left\": {\n bounds.top = canvasRect.height / 2 - tooltipHeight / 2 + yOffset;\n bounds.left = xOffset;\n return bounds;\n }\n case \"bottom\": {\n bounds.top = canvasRect.height - tooltipHeight + yOffset;\n bounds.left = canvasRect.width / 2 - tooltipWidth / 2 + xOffset;\n return bounds;\n }\n case \"top-left\": {\n bounds.top = yOffset;\n bounds.left = xOffset;\n return bounds;\n }\n case \"top-right\": {\n bounds.top = yOffset;\n bounds.left = canvasRect.width - tooltipWidth + xOffset;\n return bounds;\n }\n case \"bottom-right\": {\n bounds.top = canvasRect.height - tooltipHeight + yOffset;\n bounds.left = canvasRect.width - tooltipWidth + xOffset;\n return bounds;\n }\n case \"bottom-left\": {\n bounds.top = canvasRect.height - tooltipHeight + yOffset;\n bounds.left = xOffset;\n return bounds;\n }\n }\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], Tooltip.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], Tooltip.prototype, \"showArrow\", 2);\n__decorateClass([\n ObserveChanges((target, newValue, oldValue) => {\n if (newValue) {\n target.element.classList.add(newValue);\n }\n if (oldValue) {\n target.element.classList.remove(oldValue);\n }\n }),\n Validate(STRING, { optional: true })\n], Tooltip.prototype, \"class\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], Tooltip.prototype, \"delay\", 2);\n__decorateClass([\n Validate(INTERACTION_RANGE)\n], Tooltip.prototype, \"range\", 2);\n__decorateClass([\n Validate(TEXT_WRAP)\n], Tooltip.prototype, \"wrapping\", 2);\n__decorateClass([\n Validate(OBJECT)\n], Tooltip.prototype, \"position\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], Tooltip.prototype, \"darkTheme\", 2);\n\n// packages/ag-charts-community/src/chart/caption.ts\nvar Caption = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.id = createId(this);\n this.node = new Text({ zIndex: 1 }).setProperties({\n textAlign: \"center\",\n pointerEvents: 1 /* None */\n });\n this.enabled = false;\n this.textAlign = \"center\";\n this.fontSize = 10;\n this.fontFamily = \"sans-serif\";\n this.wrapping = \"always\";\n this.truncated = false;\n }\n getOrAddRegion(moduleCtx, regionName) {\n if (regionName === \"root\") {\n return moduleCtx.regionManager.getRegion(\"root\");\n } else {\n return moduleCtx.regionManager.addRegionFromProperties({\n name: regionName,\n bboxproviders: [this.node],\n canInteraction: () => this.enabled && this.node.visible\n });\n }\n }\n registerInteraction(moduleCtx, regionName) {\n const region = this.getOrAddRegion(moduleCtx, regionName);\n const destroyFns = [\n region.addListener(\"hover\", (event) => this.handleMouseMove(moduleCtx, event)),\n region.addListener(\"leave\", (event) => this.handleMouseLeave(moduleCtx, event))\n ];\n return joinFunctions(...destroyFns);\n }\n computeTextWrap(containerWidth, containerHeight) {\n var _a, _b;\n const { text, wrapping } = this;\n const maxWidth = Math.min((_a = this.maxWidth) != null ? _a : Infinity, containerWidth);\n const maxHeight = (_b = this.maxHeight) != null ? _b : containerHeight;\n if (!isFinite(maxWidth) && !isFinite(maxHeight)) {\n this.node.text = text;\n return;\n }\n const { text: wrappedText, truncated } = Text.wrap(text != null ? text : \"\", maxWidth, maxHeight, this, wrapping);\n this.node.text = wrappedText;\n this.truncated = truncated;\n }\n updateTooltip(moduleCtx, event) {\n if (event !== void 0 && this.enabled && this.node.visible && this.truncated) {\n const { offsetX, offsetY } = event;\n moduleCtx.tooltipManager.updateTooltip(\n this.id,\n { offsetX, offsetY, lastPointerEvent: event, showArrow: false },\n toTooltipHtml({ content: this.text })\n );\n return true;\n }\n return false;\n }\n handleMouseMove(moduleCtx, event) {\n if (this.updateTooltip(moduleCtx, event)) {\n event.consume();\n }\n }\n handleMouseLeave(moduleCtx, _event) {\n moduleCtx.tooltipManager.removeTooltip(this.id);\n }\n};\nCaption.SMALL_PADDING = 10;\nCaption.LARGE_PADDING = 20;\n__decorateClass([\n Validate(BOOLEAN)\n], Caption.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(STRING, { optional: true }),\n ProxyPropertyOnWrite(\"node\")\n], Caption.prototype, \"text\", 2);\n__decorateClass([\n Validate(TEXT_ALIGN, { optional: true }),\n ProxyPropertyOnWrite(\"node\")\n], Caption.prototype, \"textAlign\", 2);\n__decorateClass([\n Validate(FONT_STYLE, { optional: true }),\n ProxyPropertyOnWrite(\"node\")\n], Caption.prototype, \"fontStyle\", 2);\n__decorateClass([\n Validate(FONT_WEIGHT2, { optional: true }),\n ProxyPropertyOnWrite(\"node\")\n], Caption.prototype, \"fontWeight\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER),\n ProxyPropertyOnWrite(\"node\")\n], Caption.prototype, \"fontSize\", 2);\n__decorateClass([\n Validate(STRING),\n ProxyPropertyOnWrite(\"node\")\n], Caption.prototype, \"fontFamily\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true }),\n ProxyPropertyOnWrite(\"node\", \"fill\")\n], Caption.prototype, \"color\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], Caption.prototype, \"spacing\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], Caption.prototype, \"lineHeight\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], Caption.prototype, \"maxWidth\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], Caption.prototype, \"maxHeight\", 2);\n__decorateClass([\n Validate(TEXT_WRAP)\n], Caption.prototype, \"wrapping\", 2);\n\n// packages/ag-charts-community/src/chart/axis/axisGridLine.ts\nvar GRID_STYLE_KEYS = [\"stroke\", \"lineDash\"];\nvar GRID_STYLE = ARRAY_OF(\n (value) => isObject(value) && Object.keys(value).every((key) => GRID_STYLE_KEYS.includes(key)),\n \"objects with gridline style properties such as 'stroke' or 'lineDash'\"\n);\nvar AxisGridLine = class {\n constructor() {\n this.enabled = true;\n this.width = 1;\n this.style = [\n {\n stroke: void 0,\n lineDash: []\n }\n ];\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], AxisGridLine.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], AxisGridLine.prototype, \"width\", 2);\n__decorateClass([\n Validate(GRID_STYLE)\n], AxisGridLine.prototype, \"style\", 2);\n\n// packages/ag-charts-community/src/chart/axis/axisLabel.ts\nvar AxisLabel = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.enabled = true;\n this.autoWrap = false;\n this.fontSize = 12;\n this.fontFamily = \"Verdana, sans-serif\";\n this.padding = 5;\n this.minSpacing = NaN;\n this.color = \"rgba(87, 87, 87, 1)\";\n this.avoidCollisions = true;\n this.mirrored = false;\n this.parallel = false;\n }\n /**\n * The side of the axis line to position the labels on.\n * -1 = left (default)\n * 1 = right\n */\n getSideFlag() {\n return this.mirrored ? 1 : -1;\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], AxisLabel.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], AxisLabel.prototype, \"autoWrap\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], AxisLabel.prototype, \"maxWidth\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], AxisLabel.prototype, \"maxHeight\", 2);\n__decorateClass([\n Validate(FONT_STYLE, { optional: true })\n], AxisLabel.prototype, \"fontStyle\", 2);\n__decorateClass([\n Validate(FONT_WEIGHT2, { optional: true })\n], AxisLabel.prototype, \"fontWeight\", 2);\n__decorateClass([\n Validate(NUMBER.restrict({ min: 1 }))\n], AxisLabel.prototype, \"fontSize\", 2);\n__decorateClass([\n Validate(STRING)\n], AxisLabel.prototype, \"fontFamily\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], AxisLabel.prototype, \"padding\", 2);\n__decorateClass([\n Validate(NUMBER_OR_NAN),\n Default(NaN)\n], AxisLabel.prototype, \"minSpacing\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], AxisLabel.prototype, \"color\", 2);\n__decorateClass([\n Validate(DEGREE, { optional: true })\n], AxisLabel.prototype, \"rotation\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], AxisLabel.prototype, \"avoidCollisions\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], AxisLabel.prototype, \"mirrored\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], AxisLabel.prototype, \"parallel\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], AxisLabel.prototype, \"formatter\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], AxisLabel.prototype, \"format\", 2);\n\n// packages/ag-charts-community/src/chart/axis/axisLine.ts\nvar AxisLine = class {\n constructor() {\n this.enabled = true;\n this.width = 1;\n this.color = void 0;\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], AxisLine.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], AxisLine.prototype, \"width\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], AxisLine.prototype, \"color\", 2);\n\n// packages/ag-charts-community/src/chart/axis/axisTitle.ts\nvar AxisTitle = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.enabled = false;\n this.spacing = Caption.SMALL_PADDING;\n this.fontSize = 10;\n this.fontFamily = \"sans-serif\";\n this.wrapping = \"always\";\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], AxisTitle.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], AxisTitle.prototype, \"text\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], AxisTitle.prototype, \"spacing\", 2);\n__decorateClass([\n Validate(FONT_STYLE, { optional: true })\n], AxisTitle.prototype, \"fontStyle\", 2);\n__decorateClass([\n Validate(FONT_WEIGHT2, { optional: true })\n], AxisTitle.prototype, \"fontWeight\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], AxisTitle.prototype, \"fontSize\", 2);\n__decorateClass([\n Validate(STRING)\n], AxisTitle.prototype, \"fontFamily\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], AxisTitle.prototype, \"color\", 2);\n__decorateClass([\n Validate(TEXT_WRAP)\n], AxisTitle.prototype, \"wrapping\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], AxisTitle.prototype, \"formatter\", 2);\n\n// packages/ag-charts-community/src/chart/axis/axisUtil.ts\nfunction prepareAxisAnimationContext(axis) {\n const [requestedRangeMin, requestedRangeMax] = findMinMax(axis.range);\n const min = Math.floor(requestedRangeMin);\n const max = Math.ceil(requestedRangeMax);\n return { min, max, visible: min !== max };\n}\nvar fullCircle = Math.PI * 2;\nvar halfCircle = fullCircle / 2;\nfunction normaliseEndRotation(start, end) {\n const directDistance = Math.abs(end - start);\n if (directDistance < halfCircle)\n return end;\n if (start > end)\n return end + fullCircle;\n return end - fullCircle;\n}\nfunction prepareAxisAnimationFunctions(ctx) {\n const outOfBounds = (y, range3) => {\n const [min = ctx.min, max = ctx.max] = findMinMax(range3 != null ? range3 : []);\n return y < min || y > max;\n };\n const tick = {\n fromFn(node, datum, status) {\n let y = node.y1 + node.translationY;\n let opacity = node.opacity;\n if (status === \"added\" || outOfBounds(node.datum.translationY, node.datum.range)) {\n y = datum.translationY;\n opacity = 0;\n }\n return { y: 0, translationY: y, opacity, phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[status] };\n },\n toFn(_node, datum, status) {\n const y = datum.translationY;\n let opacity = 1;\n if (status === \"removed\") {\n opacity = 0;\n }\n return {\n y: 0,\n translationY: y,\n opacity,\n finish: {\n // Set explicit y after animation so it's pixel aligned\n y,\n translationY: 0\n }\n };\n },\n intermediateFn(node, _datum, _status) {\n return { visible: !outOfBounds(node.y) };\n }\n };\n const label = {\n fromFn(node, newDatum, status) {\n var _a;\n const datum = (_a = node.previousDatum) != null ? _a : newDatum;\n const x = datum.x;\n const y = datum.y;\n const rotationCenterX = datum.rotationCenterX;\n let translationY = Math.round(node.translationY);\n let rotation = datum.rotation;\n let opacity = node.opacity;\n if (status === \"removed\" || outOfBounds(datum.y, datum.range)) {\n rotation = newDatum.rotation;\n } else if (status === \"added\" || outOfBounds(node.datum.y, node.datum.range)) {\n translationY = Math.round(datum.translationY);\n opacity = 0;\n rotation = newDatum.rotation;\n }\n return {\n x,\n y,\n rotationCenterX,\n translationY,\n rotation,\n opacity,\n phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[status]\n };\n },\n toFn(node, datum, status) {\n var _a, _b;\n const x = datum.x;\n const y = datum.y;\n const rotationCenterX = datum.rotationCenterX;\n const translationY = Math.round(datum.translationY);\n let rotation = 0;\n let opacity = 1;\n if (status === \"added\") {\n opacity = 1;\n rotation = datum.rotation;\n } else if (status === \"removed\") {\n opacity = 0;\n rotation = datum.rotation;\n } else {\n rotation = normaliseEndRotation((_b = (_a = node.previousDatum) == null ? void 0 : _a.rotation) != null ? _b : datum.rotation, datum.rotation);\n }\n return { x, y, rotationCenterX, translationY, rotation, opacity, finish: { rotation: datum.rotation } };\n }\n };\n const line = {\n fromFn(node, datum) {\n var _a;\n return __spreadProps(__spreadValues({}, (_a = node.previousDatum) != null ? _a : datum), {\n phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[\"updated\"]\n });\n },\n toFn(_node, datum) {\n return __spreadValues({}, datum);\n }\n };\n const group2 = {\n fromFn(node, _datum) {\n const { rotation, translationX, translationY } = node;\n return {\n rotation,\n translationX,\n translationY,\n phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[\"updated\"]\n };\n },\n toFn(_node, datum) {\n const { rotation, translationX, translationY } = datum;\n return {\n rotation,\n translationX,\n translationY\n };\n }\n };\n return { tick, line, label, group: group2 };\n}\nfunction resetAxisGroupFn() {\n return (_node, datum) => {\n return {\n rotation: datum.rotation,\n rotationCenterX: datum.rotationCenterX,\n rotationCenterY: datum.rotationCenterY,\n translationX: datum.translationX,\n translationY: datum.translationY\n };\n };\n}\nfunction resetAxisSelectionFn(ctx) {\n const { visible: rangeVisible, min, max } = ctx;\n return (_node, datum) => {\n const y = datum.translationY;\n const visible = rangeVisible && y >= min && y <= max;\n return {\n y,\n translationY: 0,\n opacity: 1,\n visible\n };\n };\n}\nfunction resetAxisLabelSelectionFn() {\n return (_node, datum) => {\n return {\n x: datum.x,\n y: datum.y,\n translationY: datum.translationY,\n rotation: datum.rotation,\n rotationCenterX: datum.rotationCenterX\n };\n };\n}\nfunction resetAxisLineSelectionFn() {\n return (_node, datum) => {\n return __spreadValues({}, datum);\n };\n}\n\n// packages/ag-charts-community/src/chart/axis/axis.ts\nvar _Axis = class _Axis {\n constructor(moduleCtx, scale2, options) {\n this.moduleCtx = moduleCtx;\n this.scale = scale2;\n this.id = createId(this);\n this.nice = true;\n this.reverse = false;\n this.keys = [];\n this.dataDomain = { domain: [], clipped: false };\n this.boundSeries = [];\n this.includeInvisibleDomains = false;\n this.interactionEnabled = true;\n this.axisGroup = new Group({ name: `${this.id}-axis`, zIndex: 2 /* AXIS_ZINDEX */ });\n this.lineNode = this.axisGroup.appendChild(new Line());\n this.tickLineGroup = this.axisGroup.appendChild(\n new Group({ name: `${this.id}-Axis-tick-lines`, zIndex: 2 /* AXIS_ZINDEX */ })\n );\n this.tickLabelGroup = this.axisGroup.appendChild(\n new Group({ name: `${this.id}-Axis-tick-labels`, zIndex: 2 /* AXIS_ZINDEX */ })\n );\n this.crossLineGroup = new Group({ name: `${this.id}-CrossLines` });\n this.gridGroup = new Group({ name: `${this.id}-Axis-grid` });\n this.gridLineGroup = this.gridGroup.appendChild(\n new Group({\n name: `${this.id}-gridLines`,\n zIndex: 1 /* AXIS_GRID_ZINDEX */\n })\n );\n this.tickLineGroupSelection = Selection.select(this.tickLineGroup, Line, false);\n this.tickLabelGroupSelection = Selection.select(this.tickLabelGroup, Text, false);\n this.gridLineGroupSelection = Selection.select(this.gridLineGroup, Line, false);\n this.line = new AxisLine();\n this.tick = this.createTick();\n this.gridLine = new AxisGridLine();\n this.label = this.createLabel();\n this.defaultTickMinSpacing = _Axis.defaultTickMinSpacing;\n this.translation = { x: 0, y: 0 };\n this.rotation = 0;\n // axis rotation angle in degrees\n this.layout = {\n label: {\n fractionDigits: 0,\n padding: this.label.padding,\n format: this.label.format\n }\n };\n this.destroyFns = [];\n this.range = [0, 1];\n this.visibleRange = [0, 1];\n this.title = new AxisTitle();\n this._titleCaption = new Caption();\n this.gridLength = 0;\n this.fractionDigits = 0;\n /**\n * The distance between the grid ticks and the axis ticks.\n */\n this.gridPadding = 0;\n /**\n * Is used to avoid collisions between axis labels and series.\n */\n this.seriesAreaPadding = 0;\n this.tickGenerationResult = void 0;\n this.maxThickness = Infinity;\n this.moduleMap = new ModuleMap();\n this.refreshScale();\n this.destroyFns.push(this._titleCaption.registerInteraction(this.moduleCtx, \"root\"));\n this._titleCaption.node.rotation = -Math.PI / 2;\n this.axisGroup.appendChild(this._titleCaption.node);\n this.destroyFns.push(\n moduleCtx.regionManager.getRegion(\"series\").addListener(\"hover\", (e) => this.checkAxisHover(e))\n );\n this.animationManager = moduleCtx.animationManager;\n this.animationState = new StateMachine(\"empty\", {\n empty: {\n update: {\n target: \"ready\",\n action: () => this.resetSelectionNodes()\n },\n reset: \"empty\"\n },\n ready: {\n update: (data) => this.animateReadyUpdate(data),\n resize: () => this.resetSelectionNodes(),\n reset: \"empty\"\n }\n });\n this._crossLines = [];\n this.assignCrossLineArrayConstructor(this._crossLines);\n let previousSize = void 0;\n this.destroyFns.push(\n moduleCtx.layoutService.addListener(\"layout-complete\", (e) => {\n if (previousSize != null && jsonDiff(e.chart, previousSize) != null) {\n this.animationState.transition(\"resize\");\n }\n previousSize = __spreadValues({}, e.chart);\n })\n );\n if ((options == null ? void 0 : options.respondsToZoom) !== false) {\n this.destroyFns.push(\n moduleCtx.updateService.addListener(\"update-complete\", (e) => {\n this.minRect = e.minRect;\n })\n );\n }\n }\n get type() {\n var _a;\n return (_a = this.constructor.type) != null ? _a : \"\";\n }\n set crossLines(value) {\n var _a, _b;\n (_a = this._crossLines) == null ? void 0 : _a.forEach((crossLine) => this.detachCrossLine(crossLine));\n if (value) {\n this.assignCrossLineArrayConstructor(value);\n }\n this._crossLines = value;\n (_b = this._crossLines) == null ? void 0 : _b.forEach((crossLine) => {\n this.attachCrossLine(crossLine);\n this.initCrossLine(crossLine);\n });\n }\n get crossLines() {\n return this._crossLines;\n }\n resetAnimation(phase) {\n if (phase === \"initial\") {\n this.animationState.transition(\"reset\");\n }\n }\n attachCrossLine(crossLine) {\n this.crossLineGroup.appendChild(crossLine.group);\n this.crossLineGroup.appendChild(crossLine.labelGroup);\n }\n detachCrossLine(crossLine) {\n this.crossLineGroup.removeChild(crossLine.group);\n this.crossLineGroup.removeChild(crossLine.labelGroup);\n }\n destroy() {\n this.moduleMap.destroy();\n this.destroyFns.forEach((f) => f());\n }\n refreshScale() {\n var _a;\n this.range = this.scale.range.slice();\n (_a = this.crossLines) == null ? void 0 : _a.forEach(this.initCrossLine, this);\n }\n updateRange() {\n var _a;\n const { range: rr, visibleRange: vr, scale: scale2 } = this;\n const span = (rr[1] - rr[0]) / (vr[1] - vr[0]);\n const shift = span * vr[0];\n const start = rr[0] - shift;\n scale2.range = [start, start + span];\n (_a = this.crossLines) == null ? void 0 : _a.forEach((crossLine) => {\n crossLine.clippedRange = [rr[0], rr[1]];\n });\n }\n setCrossLinesVisible(visible) {\n this.crossLineGroup.visible = visible;\n }\n attachAxis(axisNode, gridNode) {\n gridNode.appendChild(this.gridGroup);\n axisNode.appendChild(this.axisGroup);\n axisNode.appendChild(this.crossLineGroup);\n }\n detachAxis(axisNode, gridNode) {\n gridNode.removeChild(this.gridGroup);\n axisNode.removeChild(this.axisGroup);\n axisNode.removeChild(this.crossLineGroup);\n }\n /**\n * Checks if a point or an object is in range.\n * @param x A point (or object's starting point).\n * @param width Object's width.\n * @param tolerance Expands the range on both ends by this amount.\n */\n inRange(x, width = 0, tolerance = 0) {\n const [min, max] = findMinMax(this.range);\n return x + width >= min - tolerance && x <= max + tolerance;\n }\n onLabelFormatChange(ticks, _domain, format2) {\n const { scale: scale2, fractionDigits } = this;\n const logScale = scale2 instanceof LogScale;\n const defaultLabelFormatter = !logScale && fractionDigits > 0 ? (x) => typeof x === \"number\" ? x.toFixed(fractionDigits) : String(x) : (x) => String(x);\n if (format2 && scale2 && scale2.tickFormat) {\n try {\n this.labelFormatter = scale2.tickFormat({ ticks, specifier: format2 });\n } catch (e) {\n this.labelFormatter = defaultLabelFormatter;\n Logger.warnOnce(`the axis label format string ${format2} is invalid. No formatting will be applied`);\n }\n } else {\n this.labelFormatter = defaultLabelFormatter;\n }\n }\n setTickInterval(interval) {\n var _a;\n this.scale.interval = (_a = this.tick.interval) != null ? _a : interval;\n }\n setTickCount(count, minTickCount, maxTickCount) {\n const { scale: scale2 } = this;\n const continuous = ContinuousScale.is(scale2) || OrdinalTimeScale.is(scale2);\n if (!(count && continuous)) {\n return;\n }\n if (typeof count === \"number\") {\n scale2.tickCount = count;\n scale2.minTickCount = minTickCount != null ? minTickCount : 0;\n scale2.maxTickCount = maxTickCount != null ? maxTickCount : Infinity;\n return;\n }\n if (scale2 instanceof TimeScale) {\n this.setTickInterval(count);\n }\n }\n onGridLengthChange(value, prevValue) {\n var _a;\n if (prevValue && !value || !prevValue && value) {\n this.onGridVisibilityChange();\n }\n (_a = this.crossLines) == null ? void 0 : _a.forEach(this.initCrossLine, this);\n }\n onGridVisibilityChange() {\n this.gridLineGroupSelection.clear();\n }\n createLabel() {\n return new AxisLabel();\n }\n checkAxisHover(event) {\n if (!this.interactionEnabled)\n return;\n const bbox = this.computeBBox();\n const isInAxis = bbox.containsPoint(event.offsetX, event.offsetY);\n if (!isInAxis)\n return;\n this.moduleCtx.chartEventManager.axisHover(this.id, this.direction);\n }\n /**\n * Creates/removes/updates the scene graph nodes that constitute the axis.\n */\n update(_primaryTickCount = 0, animated = true) {\n if (!this.tickGenerationResult) {\n return;\n }\n const { rotation, parallelFlipRotation, regularFlipRotation } = this.calculateRotations();\n const sideFlag = this.label.getSideFlag();\n this.updatePosition();\n const lineData = this.getAxisLineCoordinates();\n const { tickData, combinedRotation, textBaseline, textAlign, primaryTickCount } = this.tickGenerationResult;\n const previousTicks = this.tickLabelGroupSelection.nodes().map((node) => node.datum.tickId);\n this.updateSelections(lineData, tickData.ticks, {\n combinedRotation,\n textAlign,\n textBaseline,\n range: this.scale.range\n });\n if (!animated || this.animationManager.isSkipped()) {\n this.resetSelectionNodes();\n } else {\n const diff2 = this.calculateUpdateDiff(previousTicks, tickData);\n this.animationState.transition(\"update\", diff2);\n }\n this.updateAxisLine();\n this.updateLabels();\n this.updateVisibility();\n this.updateGridLines(sideFlag);\n this.updateTickLines();\n this.updateTitle({ anyTickVisible: tickData.ticks.length > 0 });\n this.updateCrossLines({ rotation, parallelFlipRotation, regularFlipRotation });\n this.updateLayoutState();\n return primaryTickCount;\n }\n getAxisLineCoordinates() {\n const [min, max] = findMinMax(this.range);\n return { x: 0, y1: min, y2: max };\n }\n getTickLineCoordinates(datum) {\n const sideFlag = this.label.getSideFlag();\n const x = sideFlag * this.getTickSize();\n const x1 = Math.min(0, x);\n const x2 = x1 + Math.abs(x);\n const y = datum.translationY;\n return { x1, x2, y };\n }\n getTickLabelProps(datum, params) {\n const { label } = this;\n const { combinedRotation, textBaseline, textAlign, range: range3 } = params;\n const text = datum.tickLabel;\n const sideFlag = label.getSideFlag();\n const labelX = sideFlag * (this.getTickSize() + label.padding + this.seriesAreaPadding);\n const visible = text !== \"\" && text != null;\n return {\n tickId: datum.tickId,\n translationY: datum.translationY,\n fill: label.color,\n fontFamily: label.fontFamily,\n fontSize: label.fontSize,\n fontStyle: label.fontStyle,\n fontWeight: label.fontWeight,\n rotation: combinedRotation,\n rotationCenterX: labelX,\n text,\n textAlign,\n textBaseline,\n visible,\n x: labelX,\n y: 0,\n range: range3\n };\n }\n getTickSize() {\n return this.tick.enabled ? this.tick.size : this.createTick().size;\n }\n setTitleProps(caption, params) {\n var _a;\n const { title } = this;\n if (!title.enabled) {\n caption.enabled = false;\n return;\n }\n caption.color = title.color;\n caption.fontFamily = title.fontFamily;\n caption.fontSize = title.fontSize;\n caption.fontStyle = title.fontStyle;\n caption.fontWeight = title.fontWeight;\n caption.enabled = title.enabled;\n caption.wrapping = title.wrapping;\n if (title.enabled) {\n const titleNode = caption.node;\n const padding = ((_a = title.spacing) != null ? _a : 0) + params.spacing;\n const sideFlag = this.label.getSideFlag();\n const parallelFlipRotation = normalizeAngle360(this.rotation);\n const titleRotationFlag = sideFlag === -1 && parallelFlipRotation > Math.PI && parallelFlipRotation < Math.PI * 2 ? -1 : 1;\n const rotation = titleRotationFlag * sideFlag * Math.PI / 2;\n const textBaseline = titleRotationFlag === 1 ? \"bottom\" : \"top\";\n const { range: range3 } = this;\n const x = Math.floor(titleRotationFlag * sideFlag * (range3[0] + range3[1]) / 2);\n const y = sideFlag === -1 ? Math.floor(titleRotationFlag * -padding) : Math.floor(-padding);\n const { callbackCache } = this.moduleCtx;\n const { formatter = (p) => p.defaultValue } = title;\n const text = callbackCache.call(formatter, this.getTitleFormatterParams());\n titleNode.setProperties({\n rotation,\n text,\n textBaseline,\n visible: true,\n x,\n y\n });\n }\n }\n calculateLayout(primaryTickCount) {\n var _b, _c;\n const { rotation, parallelFlipRotation, regularFlipRotation } = this.calculateRotations();\n const sideFlag = this.label.getSideFlag();\n const labelX = sideFlag * (this.getTickSize() + this.label.padding + this.seriesAreaPadding);\n this.updateScale();\n this.tickGenerationResult = this.generateTicks({\n primaryTickCount,\n parallelFlipRotation,\n regularFlipRotation,\n labelX,\n sideFlag\n });\n this.updateLayoutState();\n const _a = this.tickGenerationResult, { tickData, combinedRotation, textBaseline, textAlign } = _a, ticksResult = __objRest(_a, [\"tickData\", \"combinedRotation\", \"textBaseline\", \"textAlign\"]);\n const boxes = [];\n const { x, y1, y2 } = this.getAxisLineCoordinates();\n const lineBox = new BBox(\n x + Math.min(sideFlag * this.seriesAreaPadding, 0),\n y1,\n this.seriesAreaPadding,\n y2 - y1\n );\n boxes.push(lineBox);\n if (this.tick.enabled) {\n tickData.ticks.forEach((datum) => {\n const { x1, x2, y } = this.getTickLineCoordinates(datum);\n const tickLineBox = new BBox(x1, y, x2 - x1, 0);\n boxes.push(tickLineBox);\n });\n }\n if (this.label.enabled) {\n const tempText = new Text();\n tickData.ticks.forEach((datum) => {\n const labelProps = this.getTickLabelProps(datum, {\n combinedRotation,\n textAlign,\n textBaseline,\n range: this.scale.range\n });\n if (!labelProps.visible) {\n return;\n }\n tempText.setProperties(__spreadProps(__spreadValues({}, labelProps), {\n translationY: Math.round(datum.translationY)\n }));\n const box = tempText.computeTransformedBBox();\n if (box) {\n boxes.push(box);\n }\n });\n }\n const getTransformBox = (bbox2) => {\n const matrix = new Matrix();\n const {\n rotation: axisRotation,\n translationX,\n translationY,\n rotationCenterX,\n rotationCenterY\n } = this.getAxisTransform();\n Matrix.updateTransformMatrix(matrix, 1, 1, axisRotation, translationX, translationY, {\n scalingCenterX: 0,\n scalingCenterY: 0,\n rotationCenterX,\n rotationCenterY\n });\n return matrix.transformBBox(bbox2);\n };\n if ((_b = this.title) == null ? void 0 : _b.enabled) {\n const caption = new Caption();\n const spacing = BBox.merge(boxes).width;\n this.setTitleProps(caption, { spacing });\n const titleNode = caption.node;\n const titleBox = titleNode.computeTransformedBBox();\n if (titleBox) {\n boxes.push(titleBox);\n }\n }\n const bbox = BBox.merge(boxes);\n const transformedBBox = getTransformBox(bbox);\n const anySeriesActive = this.isAnySeriesActive();\n (_c = this.crossLines) == null ? void 0 : _c.forEach((crossLine) => {\n var _a2;\n crossLine.sideFlag = -sideFlag;\n crossLine.direction = rotation === -Math.PI / 2 ? \"x\" /* X */ : \"y\" /* Y */;\n if (crossLine instanceof CartesianCrossLine) {\n crossLine.label.parallel = (_a2 = crossLine.label.parallel) != null ? _a2 : this.label.parallel;\n }\n crossLine.parallelFlipRotation = parallelFlipRotation;\n crossLine.regularFlipRotation = regularFlipRotation;\n crossLine.calculateLayout(anySeriesActive, this.reverse);\n });\n primaryTickCount = ticksResult.primaryTickCount;\n return { primaryTickCount, bbox: transformedBBox };\n }\n updateLayoutState() {\n this.layout.label = {\n fractionDigits: this.fractionDigits,\n padding: this.label.padding,\n format: this.label.format\n };\n }\n setDomain(domain) {\n this.dataDomain = this.normaliseDataDomain(domain);\n if (this.reverse) {\n this.dataDomain.domain.reverse();\n }\n this.scale.domain = this.dataDomain.domain;\n }\n updateScale() {\n this.updateRange();\n this.calculateDomain();\n this.setTickInterval(this.tick.interval);\n const { scale: scale2, nice } = this;\n if (!ContinuousScale.is(scale2)) {\n return;\n }\n scale2.nice = nice;\n scale2.update();\n }\n calculateRotations() {\n const rotation = toRadians(this.rotation);\n const parallelFlipRotation = normalizeAngle360(rotation);\n const regularFlipRotation = normalizeAngle360(rotation - Math.PI / 2);\n return { rotation, parallelFlipRotation, regularFlipRotation };\n }\n generateTicks({\n primaryTickCount,\n parallelFlipRotation,\n regularFlipRotation,\n labelX,\n sideFlag\n }) {\n var _a;\n const {\n scale: scale2,\n tick,\n label: { parallel, rotation, fontFamily, fontSize, fontStyle, fontWeight }\n } = this;\n const secondaryAxis = primaryTickCount !== void 0;\n const { defaultRotation, configuredRotation, parallelFlipFlag, regularFlipFlag } = calculateLabelRotation({\n rotation,\n parallel,\n regularFlipRotation,\n parallelFlipRotation\n });\n const initialRotation = configuredRotation + defaultRotation;\n const labelMatrix = new Matrix();\n const { maxTickCount } = this.estimateTickCount({\n minSpacing: tick.minSpacing,\n maxSpacing: (_a = tick.maxSpacing) != null ? _a : NaN\n });\n const continuous = ContinuousScale.is(scale2) || OrdinalTimeScale.is(scale2);\n const maxIterations = !continuous || isNaN(maxTickCount) ? 10 : maxTickCount;\n let textAlign = getTextAlign(parallel, configuredRotation, 0, sideFlag, regularFlipFlag);\n const textBaseline = getTextBaseline(parallel, configuredRotation, sideFlag, parallelFlipFlag);\n const textProps = {\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n textBaseline,\n textAlign\n };\n let tickData = {\n rawTicks: [],\n ticks: [],\n labelCount: 0\n };\n let index = 0;\n let autoRotation = 0;\n let labelOverlap = true;\n let terminate = false;\n while (labelOverlap && index <= maxIterations) {\n if (terminate) {\n break;\n }\n autoRotation = 0;\n textAlign = getTextAlign(parallel, configuredRotation, 0, sideFlag, regularFlipFlag);\n const tickStrategies = this.getTickStrategies({ secondaryAxis, index });\n for (const strategy of tickStrategies) {\n ({ tickData, index, autoRotation, terminate } = strategy({\n index,\n tickData,\n textProps,\n labelOverlap,\n terminate,\n primaryTickCount\n }));\n const rotated = configuredRotation !== 0 || autoRotation !== 0;\n const labelRotation = initialRotation + autoRotation;\n textAlign = getTextAlign(parallel, configuredRotation, autoRotation, sideFlag, regularFlipFlag);\n labelOverlap = this.label.avoidCollisions ? this.checkLabelOverlap(labelRotation, rotated, labelMatrix, tickData.ticks, labelX, __spreadProps(__spreadValues({}, textProps), {\n textAlign\n })) : false;\n }\n }\n const combinedRotation = defaultRotation + configuredRotation + autoRotation;\n if (!secondaryAxis && tickData.rawTicks.length > 0) {\n primaryTickCount = tickData.rawTicks.length;\n }\n return { tickData, primaryTickCount, combinedRotation, textBaseline, textAlign };\n }\n getTickStrategies({\n index: iteration,\n secondaryAxis\n }) {\n const { scale: scale2, label, tick } = this;\n const continuous = ContinuousScale.is(scale2) || OrdinalTimeScale.is(scale2);\n const avoidLabelCollisions = label.enabled && label.avoidCollisions;\n const filterTicks = !continuous && iteration !== 0 && avoidLabelCollisions;\n const autoRotate = label.autoRotate === true && label.rotation === void 0;\n const strategies = [];\n let tickGenerationType;\n if (this.tick.values) {\n tickGenerationType = 3 /* VALUES */;\n } else if (secondaryAxis) {\n tickGenerationType = 1 /* CREATE_SECONDARY */;\n } else if (filterTicks) {\n tickGenerationType = 2 /* FILTER */;\n } else {\n tickGenerationType = 0 /* CREATE */;\n }\n const tickGenerationStrategy = ({ index, tickData, primaryTickCount, terminate }) => this.createTickData(tickGenerationType, index, tickData, terminate, primaryTickCount);\n strategies.push(tickGenerationStrategy);\n if (!continuous && !isNaN(tick.minSpacing)) {\n const tickFilterStrategy = ({ index, tickData, primaryTickCount, terminate }) => this.createTickData(2 /* FILTER */, index, tickData, terminate, primaryTickCount);\n strategies.push(tickFilterStrategy);\n }\n if (!avoidLabelCollisions) {\n return strategies;\n }\n if (label.autoWrap) {\n const autoWrapStrategy = ({ index, tickData, textProps }) => this.wrapLabels(tickData, index, textProps);\n strategies.push(autoWrapStrategy);\n } else if (autoRotate) {\n const autoRotateStrategy = ({ index, tickData, labelOverlap, terminate }) => ({\n index,\n tickData,\n autoRotation: this.getAutoRotation(labelOverlap),\n terminate\n });\n strategies.push(autoRotateStrategy);\n }\n return strategies;\n }\n createTickData(tickGenerationType, index, tickData, terminate, primaryTickCount) {\n var _a;\n const { scale: scale2, tick } = this;\n const { maxTickCount, minTickCount, defaultTickCount } = this.estimateTickCount({\n minSpacing: tick.minSpacing,\n maxSpacing: (_a = tick.maxSpacing) != null ? _a : NaN\n });\n const continuous = ContinuousScale.is(scale2) || OrdinalTimeScale.is(scale2);\n const maxIterations = !continuous || isNaN(maxTickCount) ? 10 : maxTickCount;\n let tickCount = continuous ? Math.max(defaultTickCount - index, minTickCount) : maxTickCount;\n const regenerateTicks = tick.interval === void 0 && tick.values === void 0 && tickCount > minTickCount && (continuous || tickGenerationType === 2 /* FILTER */);\n let unchanged = true;\n while (unchanged && index <= maxIterations) {\n const prevTicks = tickData.rawTicks;\n tickCount = continuous ? Math.max(defaultTickCount - index, minTickCount) : maxTickCount;\n const { rawTicks, ticks, labelCount } = this.getTicks({\n tickGenerationType,\n previousTicks: prevTicks,\n tickCount,\n minTickCount,\n maxTickCount,\n primaryTickCount\n });\n tickData.rawTicks = rawTicks;\n tickData.ticks = ticks;\n tickData.labelCount = labelCount;\n unchanged = regenerateTicks ? areArrayNumbersEqual(rawTicks, prevTicks) : false;\n index++;\n }\n const shouldTerminate = tick.interval !== void 0 || tick.values !== void 0;\n terminate || (terminate = shouldTerminate);\n return { tickData, index, autoRotation: 0, terminate };\n }\n checkLabelOverlap(rotation, rotated, labelMatrix, tickData, labelX, textProps) {\n Matrix.updateTransformMatrix(labelMatrix, 1, 1, rotation, 0, 0);\n const labelData = this.createLabelData(tickData, labelX, textProps, labelMatrix);\n const labelSpacing = getLabelSpacing(this.label.minSpacing, rotated);\n return axisLabelsOverlap(labelData, labelSpacing);\n }\n createLabelData(tickData, labelX, textProps, labelMatrix) {\n const labelData = [];\n const measurer = new TextMeasurer(textProps);\n for (const { tickLabel, translationY } of tickData) {\n if (tickLabel === \"\" || tickLabel == null)\n continue;\n const { width, height } = measurer.size(tickLabel);\n const bbox = new BBox(labelX, translationY, width, height);\n const labelDatum = calculateLabelBBox(tickLabel, bbox, labelX, translationY, labelMatrix);\n labelData.push(labelDatum);\n }\n return labelData;\n }\n getAutoRotation(labelOverlap) {\n var _a;\n return labelOverlap ? normalizeAngle360(toRadians((_a = this.label.autoRotateAngle) != null ? _a : 0)) : 0;\n }\n getTicks({\n tickGenerationType,\n previousTicks,\n tickCount,\n minTickCount,\n maxTickCount,\n primaryTickCount\n }) {\n var _a;\n const { range: range3, scale: scale2, visibleRange } = this;\n let rawTicks;\n switch (tickGenerationType) {\n case 3 /* VALUES */:\n if (ContinuousScale.is(scale2)) {\n const [d0, d1] = findMinMax(scale2.getDomain().map(Number));\n rawTicks = this.tick.values.filter((value) => value >= d0 && value <= d1).sort((a, b) => a - b);\n } else {\n rawTicks = this.tick.values;\n }\n break;\n case 1 /* CREATE_SECONDARY */:\n if (ContinuousScale.is(scale2)) {\n rawTicks = this.updateSecondaryAxisTicks(primaryTickCount);\n } else {\n rawTicks = this.createTicks(tickCount, minTickCount, maxTickCount);\n }\n break;\n case 2 /* FILTER */:\n rawTicks = this.filterTicks(previousTicks, tickCount);\n break;\n default:\n rawTicks = this.createTicks(tickCount, minTickCount, maxTickCount);\n break;\n }\n this.fractionDigits = rawTicks.fractionDigits >= 0 ? rawTicks.fractionDigits : 0;\n const halfBandwidth = ((_a = scale2.bandwidth) != null ? _a : 0) / 2;\n const ticks = [];\n let labelCount = 0;\n const tickIdCounts = /* @__PURE__ */ new Map();\n const start = Math.max(0, Math.floor(visibleRange[0] * rawTicks.length));\n const end = Math.min(rawTicks.length, Math.ceil(visibleRange[1] * rawTicks.length));\n const filteredTicks = rawTicks.slice(start, end);\n this.onLabelFormatChange(filteredTicks, rawTicks, this.label.format);\n for (let i = 0; i < filteredTicks.length; i++) {\n const tick = filteredTicks[i];\n const translationY = scale2.convert(tick) + halfBandwidth;\n if (range3.length > 0 && !this.inRange(translationY, 0, 1e-3))\n continue;\n const tickLabel = this.formatTick(tick, start + i);\n let tickId = tickLabel;\n if (tickIdCounts.has(tickId)) {\n const count = tickIdCounts.get(tickId);\n tickIdCounts.set(tickId, count + 1);\n tickId = `${tickId}_${count}`;\n } else {\n tickIdCounts.set(tickId, 1);\n }\n ticks.push({ tick, tickId, tickLabel, translationY: Math.floor(translationY) });\n if (tickLabel === \"\" || tickLabel == null) {\n continue;\n }\n labelCount++;\n }\n return { rawTicks, ticks, labelCount };\n }\n filterTicks(ticks, tickCount) {\n var _a;\n const tickSpacing = !isNaN(this.tick.minSpacing) || !isNaN((_a = this.tick.maxSpacing) != null ? _a : NaN);\n const keepEvery = tickSpacing ? Math.ceil(ticks.length / tickCount) : 2;\n return ticks.filter((_, i) => i % keepEvery === 0);\n }\n createTicks(tickCount, minTickCount, maxTickCount) {\n var _a, _b, _c;\n this.setTickCount(tickCount, minTickCount, maxTickCount);\n return (_c = (_b = (_a = this.scale).ticks) == null ? void 0 : _b.call(_a)) != null ? _c : [];\n }\n estimateTickCount({ minSpacing, maxSpacing }) {\n const {\n minRect,\n label: { avoidCollisions }\n } = this;\n if (!avoidCollisions) {\n return {\n minTickCount: ContinuousScale.defaultMaxTickCount,\n maxTickCount: ContinuousScale.defaultMaxTickCount,\n defaultTickCount: ContinuousScale.defaultMaxTickCount\n };\n }\n const rangeWithBleed = this.calculateRangeWithBleed();\n const defaultMinSpacing = Math.max(\n this.defaultTickMinSpacing,\n rangeWithBleed / ContinuousScale.defaultMaxTickCount\n );\n let clampMaxTickCount = !isNaN(maxSpacing);\n if (isNaN(minSpacing)) {\n minSpacing = defaultMinSpacing;\n }\n if (isNaN(maxSpacing)) {\n maxSpacing = rangeWithBleed;\n }\n if (minSpacing > maxSpacing) {\n if (minSpacing === defaultMinSpacing) {\n minSpacing = maxSpacing;\n } else {\n maxSpacing = minSpacing;\n }\n }\n let minRectDistance = 1;\n if (minRect) {\n minRectDistance = this.direction === \"x\" /* X */ ? minRect.width : minRect.height;\n }\n clampMaxTickCount && (clampMaxTickCount = minRectDistance < defaultMinSpacing);\n const maxTickCount = clamp(\n 1,\n Math.floor(rangeWithBleed / minSpacing),\n clampMaxTickCount ? Math.min(Math.floor(rangeWithBleed / minRectDistance), 100) : 100\n );\n const minTickCount = Math.min(maxTickCount, Math.ceil(rangeWithBleed / maxSpacing));\n const defaultTickCount = clamp(minTickCount, ContinuousScale.defaultTickCount, maxTickCount);\n return { minTickCount, maxTickCount, defaultTickCount };\n }\n updateVisibility() {\n if (this.moduleCtx.animationManager.isSkipped()) {\n this.resetSelectionNodes();\n }\n this.tickLineGroup.visible = this.tick.enabled;\n this.gridLineGroup.visible = this.gridLine.enabled;\n this.tickLabelGroup.visible = this.label.enabled;\n }\n updateCrossLines({\n rotation,\n parallelFlipRotation,\n regularFlipRotation\n }) {\n var _a;\n const sideFlag = this.label.getSideFlag();\n const anySeriesActive = this.isAnySeriesActive();\n (_a = this.crossLines) == null ? void 0 : _a.forEach((crossLine) => {\n var _a2;\n crossLine.sideFlag = -sideFlag;\n crossLine.direction = rotation === -Math.PI / 2 ? \"x\" /* X */ : \"y\" /* Y */;\n if (crossLine instanceof CartesianCrossLine) {\n crossLine.label.parallel = (_a2 = crossLine.label.parallel) != null ? _a2 : this.label.parallel;\n }\n crossLine.parallelFlipRotation = parallelFlipRotation;\n crossLine.regularFlipRotation = regularFlipRotation;\n crossLine.update(anySeriesActive);\n });\n }\n updateTickLines() {\n const { tick, label } = this;\n const sideFlag = label.getSideFlag();\n this.tickLineGroupSelection.each((line) => {\n line.strokeWidth = tick.width;\n line.stroke = tick.color;\n line.x1 = sideFlag * this.getTickSize();\n line.x2 = 0;\n });\n }\n calculateAvailableRange() {\n return findRangeExtent(this.range);\n }\n /**\n * Calculates the available range with an additional \"bleed\" beyond the canvas that encompasses the full axis when\n * the visible range is only a portion of the axis.\n */\n calculateRangeWithBleed() {\n const visibleScale = 1 / findRangeExtent(this.visibleRange);\n return round(this.calculateAvailableRange() * visibleScale, 2);\n }\n calculateDomain() {\n const visibleSeries = this.boundSeries.filter((s) => this.includeInvisibleDomains || s.isEnabled());\n const domains = visibleSeries.flatMap((series) => series.getDomain(this.direction));\n this.setDomain(domains);\n }\n getAxisTransform() {\n return {\n rotation: toRadians(this.rotation),\n rotationCenterX: 0,\n rotationCenterY: 0,\n translationX: Math.floor(this.translation.x),\n translationY: Math.floor(this.translation.y)\n };\n }\n updatePosition() {\n const { crossLineGroup, axisGroup, gridGroup, translation, gridLineGroupSelection, gridPadding, gridLength } = this;\n const { rotation } = this.calculateRotations();\n const sideFlag = this.label.getSideFlag();\n const translationX = Math.floor(translation.x);\n const translationY = Math.floor(translation.y);\n crossLineGroup.setProperties({ rotation, translationX, translationY });\n gridGroup.setProperties({ rotation, translationX, translationY });\n axisGroup.datum = this.getAxisTransform();\n gridLineGroupSelection.each((line) => {\n line.x1 = gridPadding;\n line.x2 = -sideFlag * gridLength + gridPadding;\n });\n }\n updateSecondaryAxisTicks(_primaryTickCount) {\n throw new Error(\"AG Charts - unexpected call to updateSecondaryAxisTicks() - check axes configuration.\");\n }\n updateSelections(lineData, data, params) {\n this.lineNode.datum = lineData;\n this.gridLineGroupSelection.update(\n this.gridLength ? data : [],\n (group2) => group2.append(new Line()),\n (datum) => datum.tickId\n );\n this.tickLineGroupSelection.update(\n data,\n (group2) => group2.appendChild(new Line()),\n (datum) => datum.tickId\n );\n this.tickLabelGroupSelection.update(\n data.map((d) => this.getTickLabelProps(d, params)),\n (group2) => group2.appendChild(new Text()),\n (datum) => datum.tickId\n );\n }\n updateAxisLine() {\n const { line } = this;\n const strokeWidth = line.enabled ? line.width : 0;\n this.lineNode.setProperties({\n stroke: line.color,\n strokeWidth\n });\n }\n updateGridLines(sideFlag) {\n const {\n gridLine: { style, width },\n gridPadding,\n gridLength\n } = this;\n if (gridLength === 0 || style.length === 0) {\n return;\n }\n this.gridLineGroupSelection.each((line, _, index) => {\n const { stroke, lineDash } = style[index % style.length];\n line.setProperties({\n x1: gridPadding,\n x2: -sideFlag * gridLength + gridPadding,\n fill: void 0,\n stroke,\n strokeWidth: width,\n lineDash\n });\n });\n }\n updateLabels() {\n const { label } = this;\n if (!label.enabled) {\n return;\n }\n this.tickLabelGroupSelection.each((node, datum) => {\n node.setProperties(datum, [\n \"fill\",\n \"fontFamily\",\n \"fontSize\",\n \"fontStyle\",\n \"fontWeight\",\n \"text\",\n \"textAlign\",\n \"textBaseline\"\n ]);\n });\n }\n wrapLabels(tickData, index, labelProps) {\n const { parallel, maxWidth, maxHeight } = this.label;\n let defaultMaxWidth = this.maxThickness;\n let defaultMaxHeight = Math.round(this.calculateAvailableRange() / tickData.labelCount);\n if (parallel) {\n [defaultMaxWidth, defaultMaxHeight] = [defaultMaxHeight, defaultMaxWidth];\n }\n tickData.ticks.forEach((tickDatum) => {\n const { text } = Text.wrap(\n tickDatum.tickLabel,\n maxWidth != null ? maxWidth : defaultMaxWidth,\n maxHeight != null ? maxHeight : defaultMaxHeight,\n labelProps,\n \"hyphenate\"\n );\n tickDatum.tickLabel = text;\n });\n return { tickData, index, autoRotation: 0, terminate: true };\n }\n updateTitle(params) {\n const { rotation, title, _titleCaption, lineNode, tickLineGroup, tickLabelGroup } = this;\n if (!title) {\n _titleCaption.enabled = false;\n return;\n }\n let spacing = 0;\n if (title.enabled && params.anyTickVisible) {\n const tickBBox = Group.computeBBox([tickLineGroup, tickLabelGroup, lineNode]);\n const tickWidth = rotation === 0 ? tickBBox.width : tickBBox.height;\n spacing += tickWidth + (this.tickLabelGroup.visible ? 0 : this.seriesAreaPadding);\n }\n this.setTitleProps(_titleCaption, { spacing });\n }\n // For formatting (nice rounded) tick values.\n formatTick(datum, index) {\n return this.datumFormatter(index)(datum);\n }\n // For formatting arbitrary values between the ticks.\n formatDatum(datum) {\n return String(datum);\n }\n datumFormatter(index = 0) {\n const {\n label,\n labelFormatter,\n fractionDigits,\n moduleCtx: { callbackCache }\n } = this;\n if (label.formatter) {\n return (datum) => {\n var _a;\n return (_a = callbackCache.call(label.formatter, {\n value: fractionDigits > 0 ? datum : String(datum),\n index,\n fractionDigits,\n formatter: labelFormatter\n })) != null ? _a : datum;\n };\n } else if (labelFormatter) {\n return (datum) => {\n var _a;\n return (_a = callbackCache.call(labelFormatter, datum)) != null ? _a : String(datum);\n };\n }\n return (datum) => String(datum);\n }\n computeBBox() {\n return this.axisGroup.computeBBox();\n }\n initCrossLine(crossLine) {\n crossLine.scale = this.scale;\n crossLine.gridLength = this.gridLength;\n }\n isAnySeriesActive() {\n return this.boundSeries.some((s) => this.includeInvisibleDomains || s.isEnabled());\n }\n clipTickLines(x, y, width, height) {\n this.tickLineGroup.setClipRectInGroupCoordinateSpace(new BBox(x, y, width, height));\n }\n clipGrid(x, y, width, height) {\n this.gridGroup.setClipRectInGroupCoordinateSpace(new BBox(x, y, width, height));\n }\n calculatePadding(min, max) {\n const padding = Math.abs(this.reverse ? max : min) * 0.01;\n return [padding, padding];\n }\n getTitleFormatterParams() {\n var _a;\n const boundSeries = this.boundSeries.reduce((acc, next) => {\n const keys = next.getKeys(this.direction);\n const names = next.getNames(this.direction);\n for (let idx = 0; idx < keys.length; idx++) {\n acc.push({ key: keys[idx], name: names[idx] });\n }\n return acc;\n }, []);\n return {\n direction: this.direction,\n boundSeries,\n defaultValue: (_a = this.title) == null ? void 0 : _a.text\n };\n }\n normaliseDataDomain(d) {\n return { domain: [...d], clipped: false };\n }\n getLayoutState() {\n return __spreadValues({\n rect: this.computeBBox(),\n gridPadding: this.gridPadding,\n seriesAreaPadding: this.seriesAreaPadding,\n tickSize: this.getTickSize(),\n direction: this.direction,\n domain: this.dataDomain.domain,\n scale: this.scale\n }, this.layout);\n }\n getModuleMap() {\n return this.moduleMap;\n }\n createModuleContext() {\n var _a;\n (_a = this.axisContext) != null ? _a : this.axisContext = this.createAxisContext();\n return __spreadProps(__spreadValues({}, this.moduleCtx), { parent: this.axisContext });\n }\n createAxisContext() {\n return {\n axisId: this.id,\n direction: this.direction,\n continuous: ContinuousScale.is(this.scale),\n keys: () => this.boundSeries.flatMap((s) => s.getKeys(this.direction)),\n seriesKeyProperties: () => this.boundSeries.reduce((keys, series) => {\n const seriesKeys = series.getKeyProperties(this.direction);\n seriesKeys.forEach((key) => {\n if (keys.indexOf(key) < 0) {\n keys.push(key);\n }\n });\n return keys;\n }, []),\n scaleValueFormatter: (specifier) => {\n var _a, _b;\n return specifier ? (_b = (_a = this.scale).tickFormat) == null ? void 0 : _b.call(_a, { specifier }) : this.formatDatum;\n },\n scaleBandwidth: () => {\n var _a;\n return (_a = this.scale.bandwidth) != null ? _a : 0;\n },\n scaleConvert: (val) => this.scale.convert(val),\n scaleInvert: (val) => {\n var _a, _b;\n return (_b = (_a = this.scale).invert) == null ? void 0 : _b.call(_a, val);\n }\n };\n }\n animateReadyUpdate(diff2) {\n const { animationManager } = this.moduleCtx;\n const selectionCtx = prepareAxisAnimationContext(this);\n const fns = prepareAxisAnimationFunctions(selectionCtx);\n fromToMotion(this.id, \"axis-group\", animationManager, [this.axisGroup], fns.group);\n fromToMotion(this.id, \"line\", animationManager, [this.lineNode], fns.line);\n fromToMotion(\n this.id,\n \"line-paths\",\n animationManager,\n [this.gridLineGroupSelection, this.tickLineGroupSelection],\n fns.tick,\n (_, d) => d.tickId,\n diff2\n );\n fromToMotion(\n this.id,\n \"tick-labels\",\n animationManager,\n [this.tickLabelGroupSelection],\n fns.label,\n (_, d) => d.tickId,\n diff2\n );\n }\n resetSelectionNodes() {\n const { gridLineGroupSelection, tickLineGroupSelection, tickLabelGroupSelection, lineNode } = this;\n const selectionCtx = prepareAxisAnimationContext(this);\n resetMotion([this.axisGroup], resetAxisGroupFn());\n resetMotion([gridLineGroupSelection, tickLineGroupSelection], resetAxisSelectionFn(selectionCtx));\n resetMotion([tickLabelGroupSelection], resetAxisLabelSelectionFn());\n resetMotion([lineNode], resetAxisLineSelectionFn());\n }\n calculateUpdateDiff(previous, tickData) {\n const added = /* @__PURE__ */ new Set();\n const removed = /* @__PURE__ */ new Set();\n const tickMap = {};\n const tickCount = Math.max(previous.length, tickData.ticks.length);\n for (let i = 0; i < tickCount; i++) {\n const tickDatum = tickData.ticks[i];\n const prev = previous[i];\n const tick = tickDatum == null ? void 0 : tickDatum.tickId;\n tickMap[tick != null ? tick : prev] = tickDatum;\n if (prev === tick) {\n continue;\n }\n if (removed.has(tick)) {\n removed.delete(tick);\n } else if (tick) {\n added.add(tick);\n }\n if (added.has(prev)) {\n added.delete(prev);\n } else if (prev) {\n removed.add(prev);\n }\n }\n return { changed: added.size > 0 || removed.size > 0, added, removed };\n }\n isReversed() {\n return this.reverse;\n }\n};\n_Axis.defaultTickMinSpacing = 50;\n__decorateClass([\n Validate(BOOLEAN)\n], _Axis.prototype, \"nice\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], _Axis.prototype, \"reverse\", 2);\n__decorateClass([\n Validate(STRING_ARRAY)\n], _Axis.prototype, \"keys\", 2);\n__decorateClass([\n Validate(OBJECT, { optional: true })\n], _Axis.prototype, \"title\", 2);\n__decorateClass([\n ObserveChanges((target, value, oldValue) => target.onGridLengthChange(value, oldValue))\n], _Axis.prototype, \"gridLength\", 2);\nvar Axis = _Axis;\n\n// packages/ag-charts-community/src/chart/axis/cartesianAxisLabel.ts\nvar CartesianAxisLabel = class extends AxisLabel {\n constructor() {\n super(...arguments);\n this.autoRotateAngle = 335;\n }\n};\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], CartesianAxisLabel.prototype, \"autoRotate\", 2);\n__decorateClass([\n Validate(DEGREE)\n], CartesianAxisLabel.prototype, \"autoRotateAngle\", 2);\n\n// packages/ag-charts-community/src/chart/axis/cartesianAxis.ts\nvar _CartesianAxis = class _CartesianAxis extends Axis {\n constructor() {\n super(...arguments);\n this.thickness = 0;\n this.position = \"left\";\n }\n static is(value) {\n return value instanceof _CartesianAxis;\n }\n get direction() {\n return [\"top\", \"bottom\"].includes(this.position) ? \"x\" /* X */ : \"y\" /* Y */;\n }\n updateDirection() {\n switch (this.position) {\n case \"top\":\n this.rotation = -90;\n this.label.mirrored = true;\n this.label.parallel = true;\n break;\n case \"right\":\n this.rotation = 0;\n this.label.mirrored = true;\n this.label.parallel = false;\n break;\n case \"bottom\":\n this.rotation = -90;\n this.label.mirrored = false;\n this.label.parallel = true;\n break;\n case \"left\":\n this.rotation = 0;\n this.label.mirrored = false;\n this.label.parallel = false;\n break;\n }\n if (this.axisContext) {\n this.axisContext.position = this.position;\n this.axisContext.direction = this.direction;\n }\n }\n update(primaryTickCount, animated) {\n this.updateDirection();\n return super.update(primaryTickCount, animated);\n }\n calculateLayout(primaryTickCount) {\n this.updateDirection();\n return super.calculateLayout(primaryTickCount);\n }\n createAxisContext() {\n return __spreadProps(__spreadValues({}, super.createAxisContext()), {\n position: this.position\n });\n }\n assignCrossLineArrayConstructor(crossLines) {\n assignJsonApplyConstructedArray(crossLines, CartesianCrossLine);\n }\n createLabel() {\n return new CartesianAxisLabel();\n }\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], _CartesianAxis.prototype, \"thickness\", 2);\n__decorateClass([\n Validate(POSITION2)\n], _CartesianAxis.prototype, \"position\", 2);\nvar CartesianAxis = _CartesianAxis;\n\n// packages/ag-charts-community/src/chart/axis/categoryAxis.ts\nvar CategoryAxisTick = class extends AxisTick {\n constructor() {\n super(...arguments);\n this.minSpacing = NaN;\n }\n};\n__decorateClass([\n Validate(MIN_SPACING),\n Default(NaN)\n], CategoryAxisTick.prototype, \"minSpacing\", 2);\nvar CategoryAxis = class extends CartesianAxis {\n constructor(moduleCtx, scale2 = new BandScale()) {\n super(moduleCtx, scale2);\n this._paddingOverrideEnabled = false;\n this.groupPaddingInner = 0.1;\n this.includeInvisibleDomains = true;\n }\n set paddingInner(value) {\n this._paddingOverrideEnabled = true;\n this.scale.paddingInner = value;\n }\n get paddingInner() {\n this._paddingOverrideEnabled = true;\n return this.scale.paddingInner;\n }\n set paddingOuter(value) {\n this.scale.paddingOuter = value;\n }\n get paddingOuter() {\n return this.scale.paddingOuter;\n }\n createTick() {\n return new CategoryAxisTick();\n }\n normaliseDataDomain(d) {\n const domain = [];\n const uniqueValues = /* @__PURE__ */ new Set();\n for (const v of d) {\n const key = v instanceof Date ? v.getTime() : v;\n if (!uniqueValues.has(key)) {\n uniqueValues.add(key);\n domain.push(v);\n }\n }\n return { domain, clipped: false };\n }\n calculateDomain() {\n if (!this._paddingOverrideEnabled) {\n const paddings = this.boundSeries.map((s) => {\n var _a;\n return (_a = s.getBandScalePadding) == null ? void 0 : _a.call(s);\n }).filter((p) => p != null);\n if (paddings.length > 0) {\n this.scale.paddingInner = Math.min(...paddings.map((p) => p.inner));\n this.scale.paddingOuter = Math.max(...paddings.map((p) => p.outer));\n }\n }\n return super.calculateDomain();\n }\n};\nCategoryAxis.className = \"CategoryAxis\";\nCategoryAxis.type = \"category\";\n__decorateClass([\n Validate(RATIO)\n], CategoryAxis.prototype, \"groupPaddingInner\", 2);\n\n// packages/ag-charts-community/src/chart/axis/tree.ts\nvar TreeNode = class {\n // current number in sibling group (index)\n constructor(label = \"\", parent, number = 0) {\n this.x = 0;\n this.y = 0;\n this.subtreeLeft = NaN;\n this.subtreeRight = NaN;\n this.screenX = 0;\n this.screenY = 0;\n this.children = [];\n this.leafCount = 0;\n this.prelim = 0;\n this.mod = 0;\n this.ancestor = this;\n this.change = 0;\n this.shift = 0;\n this.label = label;\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n this.number = number;\n }\n getLeftSibling() {\n return this.number > 0 && this.parent ? this.parent.children[this.number - 1] : void 0;\n }\n getLeftmostSibling() {\n return this.number > 0 && this.parent ? this.parent.children[0] : void 0;\n }\n // traverse the left contour of a subtree, return the successor of v on this contour\n nextLeft() {\n return this.children ? this.children[0] : this.thread;\n }\n // traverse the right contour of a subtree, return the successor of v on this contour\n nextRight() {\n return this.children ? this.children[this.children.length - 1] : this.thread;\n }\n getSiblings() {\n return this.parent ? this.parent.children.filter((_, i) => i !== this.number) : [];\n }\n};\nfunction ticksToTree(ticks, pad2 = true) {\n const root = new TreeNode();\n let depth = 0;\n if (pad2) {\n ticks.forEach((tick) => depth = Math.max(depth, tick.labels.length));\n }\n ticks.forEach((tick) => {\n if (pad2) {\n while (tick.labels.length < depth) {\n tick.labels.unshift(\"\");\n }\n }\n insertTick(root, tick);\n });\n return root;\n}\nfunction insertTick(root, tick) {\n const pathParts = tick.labels.slice().reverse();\n const lastPartIndex = pathParts.length - 1;\n pathParts.forEach((pathPart, partIndex) => {\n const children = root.children;\n const existingNode = children.find((child) => child.label === pathPart);\n const isNotLeaf = partIndex !== lastPartIndex;\n if (existingNode && isNotLeaf) {\n root = existingNode;\n } else {\n const node = new TreeNode(pathPart, root);\n node.number = children.length;\n children.push(node);\n if (isNotLeaf) {\n root = node;\n }\n }\n });\n}\nfunction moveSubtree(wm, wp, shift) {\n const subtrees = wp.number - wm.number;\n const ratio = shift / subtrees;\n wp.change -= ratio;\n wp.shift += shift;\n wm.change += ratio;\n wp.prelim += shift;\n wp.mod += shift;\n}\nfunction ancestor(vim, v, defaultAncestor) {\n return v.getSiblings().indexOf(vim.ancestor) >= 0 ? vim.ancestor : defaultAncestor;\n}\nfunction executeShifts(v) {\n const children = v.children;\n if (children) {\n let shift = 0;\n let change = 0;\n for (let i = children.length - 1; i >= 0; i--) {\n const w = children[i];\n w.prelim += shift;\n w.mod += shift;\n change += w.change;\n shift += w.shift + change;\n }\n }\n}\nfunction apportion(v, defaultAncestor, distance2) {\n const w = v.getLeftSibling();\n if (w) {\n let vop = v;\n let vip = v;\n let vim = w;\n let vom = vip.getLeftmostSibling();\n let sip = vip.mod;\n let sop = vop.mod;\n let sim = vim.mod;\n let som = vom.mod;\n while (vim.nextRight() && vip.nextLeft()) {\n vim = vim.nextRight();\n vip = vip.nextLeft();\n vom = vom.nextLeft();\n vop = vop.nextRight();\n vop.ancestor = v;\n const shift = vim.prelim + sim - (vip.prelim + sip) + distance2;\n if (shift > 0) {\n moveSubtree(ancestor(vim, v, defaultAncestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.mod;\n sip += vip.mod;\n som += vom.mod;\n sop += vop.mod;\n }\n if (vim.nextRight() && !vop.nextRight()) {\n vop.thread = vim.nextRight();\n vop.mod += sim - sop;\n } else {\n if (vip.nextLeft() && !vom.nextLeft()) {\n vom.thread = vip.nextLeft();\n vom.mod += sip - som;\n }\n defaultAncestor = v;\n }\n }\n return defaultAncestor;\n}\nfunction firstWalk(node, distance2) {\n const children = node.children;\n if (children.length) {\n let defaultAncestor = children[0];\n children.forEach((child) => {\n firstWalk(child, distance2);\n defaultAncestor = apportion(child, defaultAncestor, distance2);\n });\n executeShifts(node);\n const midpoint = (children[0].prelim + children.at(-1).prelim) / 2;\n const leftSibling = node.getLeftSibling();\n if (leftSibling) {\n node.prelim = leftSibling.prelim + distance2;\n node.mod = node.prelim - midpoint;\n } else {\n node.prelim = midpoint;\n }\n } else {\n const leftSibling = node.getLeftSibling();\n node.prelim = leftSibling ? leftSibling.prelim + distance2 : 0;\n }\n}\nvar Dimensions = class {\n constructor() {\n this.top = Infinity;\n this.right = -Infinity;\n this.bottom = -Infinity;\n this.left = Infinity;\n }\n update(node, xy) {\n const { x, y } = xy(node);\n if (x > this.right) {\n this.right = x;\n }\n if (x < this.left) {\n this.left = x;\n }\n if (y > this.bottom) {\n this.bottom = y;\n }\n if (y < this.top) {\n this.top = y;\n }\n }\n};\nfunction secondWalk(v, m, layout) {\n v.x = v.prelim + m;\n v.y = v.depth;\n layout.update(v);\n v.children.forEach((w) => secondWalk(w, m + v.mod, layout));\n}\nfunction thirdWalk(v) {\n const children = v.children;\n let leafCount = 0;\n children.forEach((w) => {\n thirdWalk(w);\n if (w.children.length) {\n leafCount += w.leafCount;\n } else {\n leafCount++;\n }\n });\n v.leafCount = leafCount;\n if (children.length) {\n v.subtreeLeft = children[0].subtreeLeft;\n v.subtreeRight = children[v.children.length - 1].subtreeRight;\n v.x = (v.subtreeLeft + v.subtreeRight) / 2;\n } else {\n v.subtreeLeft = v.x;\n v.subtreeRight = v.x;\n }\n}\nfunction treeLayout(root) {\n const layout = new TreeLayout();\n firstWalk(root, 1);\n secondWalk(root, -root.prelim, layout);\n thirdWalk(root);\n return layout;\n}\nvar TreeLayout = class {\n constructor() {\n this.dimensions = new Dimensions();\n this.leafCount = 0;\n this.nodes = [];\n // One might want to process leaf nodes separately from the rest of the tree.\n // For example, position labels corresponding to leafs vertically, rather than horizontally.\n this.leafNodes = [];\n this.nonLeafNodes = [];\n this.depth = 0;\n }\n update(node) {\n this.dimensions.update(node, (n) => ({ x: n.x, y: n.y }));\n if (node.children.length) {\n this.nonLeafNodes.push(node);\n } else {\n this.leafCount++;\n this.leafNodes.push(node);\n }\n if (node.depth > this.depth) {\n this.depth = node.depth;\n }\n this.nodes.push(node);\n }\n resize(width, height, shiftX = 0, shiftY = 0, flipX = false) {\n const xSteps = this.leafCount - 1;\n const ySteps = this.depth;\n const dimensions = this.dimensions;\n let scalingX = 1;\n let scalingY = 1;\n if (width > 0 && xSteps) {\n const existingSpacingX = (dimensions.right - dimensions.left) / xSteps;\n const desiredSpacingX = width / xSteps;\n scalingX = desiredSpacingX / existingSpacingX;\n if (flipX) {\n scalingX = -scalingX;\n }\n }\n if (height > 0 && ySteps) {\n const existingSpacingY = (dimensions.bottom - dimensions.top) / ySteps;\n const desiredSpacingY = height / ySteps;\n scalingY = desiredSpacingY / existingSpacingY;\n }\n const screenDimensions = new Dimensions();\n this.nodes.forEach((node) => {\n node.screenX = node.x * scalingX;\n node.screenY = node.y * scalingY;\n screenDimensions.update(node, (n) => ({ x: n.screenX, y: n.screenY }));\n });\n const offsetX = -screenDimensions.left;\n const offsetY = -screenDimensions.top;\n this.nodes.forEach((node) => {\n node.screenX += offsetX + shiftX;\n node.screenY += offsetY + shiftY;\n });\n }\n};\n\n// packages/ag-charts-community/src/chart/axis/groupedCategoryAxis.ts\nvar GroupedCategoryAxisLabel = class extends AxisLabel {\n constructor() {\n super(...arguments);\n this.grid = false;\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], GroupedCategoryAxisLabel.prototype, \"grid\", 2);\nvar GroupedCategoryAxis = class extends CartesianAxis {\n constructor(moduleCtx) {\n super(moduleCtx, new BandScale());\n // Label scale (labels are positioned between ticks, tick count = label count + 1).\n // We don't call is `labelScale` for consistency with other axes.\n this.tickScale = new BandScale();\n this.line = new AxisLine();\n this.label = new GroupedCategoryAxisLabel();\n this.labelColor = \"rgba(87, 87, 87, 1)\";\n this.includeInvisibleDomains = true;\n const { tickLineGroup, tickLabelGroup, gridLineGroup, tickScale, scale: scale2 } = this;\n scale2.paddingOuter = 0.1;\n scale2.paddingInner = scale2.paddingOuter * 2;\n this.refreshScale();\n tickScale.paddingInner = 1;\n tickScale.paddingOuter = 0;\n this.gridLineSelection = Selection.select(gridLineGroup, Line);\n this.axisLineSelection = Selection.select(tickLineGroup, Line);\n this.separatorSelection = Selection.select(tickLineGroup, Line);\n this.labelSelection = Selection.select(tickLabelGroup, Text);\n }\n updateRange() {\n const { range: rr, visibleRange: vr, scale: scale2 } = this;\n const span = (rr[1] - rr[0]) / (vr[1] - vr[0]);\n const shift = span * vr[0];\n const start = rr[0] - shift;\n this.tickScale.range = scale2.range = [start, start + span];\n this.resizeTickTree();\n }\n resizeTickTree() {\n var _a;\n const s = this.scale;\n const range3 = s.domain.length ? [s.convert(s.domain[0]), s.convert(s.domain[s.domain.length - 1])] : s.range;\n const layout = this.tickTreeLayout;\n const lineHeight = this.lineHeight;\n if (layout) {\n layout.resize(\n Math.abs(range3[1] - range3[0]),\n layout.depth * lineHeight,\n (Math.min(range3[0], range3[1]) || 0) + ((_a = s.bandwidth) != null ? _a : 0) / 2,\n -layout.depth * lineHeight,\n range3[1] - range3[0] < 0\n );\n }\n }\n get lineHeight() {\n return this.label.fontSize * 1.5;\n }\n /**\n * The length of the grid. The grid is only visible in case of a non-zero value.\n */\n onGridVisibilityChange() {\n this.gridLineSelection.clear();\n this.labelSelection.clear();\n }\n createTick() {\n return new CategoryAxisTick();\n }\n calculateDomain() {\n var _a;\n const { direction } = this;\n let isNumericX = null;\n const flatDomains = this.boundSeries.filter((s) => s.visible).flatMap((series) => {\n if (direction === \"y\" /* Y */ || isNumericX) {\n return series.getDomain(direction);\n }\n if (isNumericX === null) {\n const domain2 = series.getDomain(direction);\n isNumericX = isNumber(domain2[0]);\n return domain2;\n }\n return [];\n });\n this.setDomain((_a = extent(flatDomains)) != null ? _a : unique(flatDomains));\n const { domain } = this.dataDomain;\n this.tickTreeLayout = treeLayout(ticksToTree(domain));\n this.tickScale.domain = domain.concat(\"\");\n this.resizeTickTree();\n }\n /**\n * Creates/removes/updates the scene graph nodes that constitute the axis.\n * Supposed to be called _manually_ after changing _any_ of the axis properties.\n * This allows to bulk set axis properties before updating the nodes.\n * The node changes made by this method are rendered on the next animation frame.\n * We could schedule this method call automatically on the next animation frame\n * when any of the axis properties change (the way we do when properties of scene graph's\n * nodes change), but this will mean that we first wait for the next animation\n * frame to make changes to the nodes of the axis, then wait for another animation\n * frame to render those changes. It's nice to have everything update automatically,\n * but this extra level of async indirection will not just introduce an unwanted delay,\n * it will also make it harder to reason about the program.\n */\n update() {\n if (!this.computedLayout) {\n return;\n }\n this.updatePosition();\n this.updateTitleCaption();\n this.updateCategoryLabels();\n this.updateSeparators();\n this.updateAxisLines();\n this.updateCategoryGridLines();\n this.resetSelectionNodes();\n }\n updateTitleCaption() {\n const { _titleCaption } = this;\n _titleCaption.node.visible = false;\n }\n updateCategoryLabels() {\n if (!this.computedLayout)\n return;\n const { tickLabelLayout } = this.computedLayout;\n const labelSelection = this.labelSelection.update(tickLabelLayout);\n labelSelection.each((node, datum) => {\n node.setProperties(datum);\n });\n }\n updateSeparators() {\n if (!this.computedLayout)\n return;\n const { separatorLayout } = this.computedLayout;\n const { range: range3 } = this;\n const epsilon2 = 1e-7;\n const separatorSelection = this.separatorSelection.update(separatorLayout);\n separatorSelection.each((line, datum) => {\n line.x1 = datum.x1;\n line.x2 = datum.x2;\n line.y1 = datum.y;\n line.y2 = datum.y;\n line.visible = datum.y >= range3[0] - epsilon2 && datum.y <= range3[1] + epsilon2;\n line.stroke = this.tick.color;\n line.fill = void 0;\n line.strokeWidth = 1;\n });\n }\n updateAxisLines() {\n if (!this.computedLayout)\n return;\n const { axisLineLayout } = this.computedLayout;\n const axisLineSelection = this.axisLineSelection.update(axisLineLayout);\n axisLineSelection.each((line, datum) => {\n line.setProperties(__spreadProps(__spreadValues({}, datum), {\n stroke: this.line.color,\n strokeWidth: this.line.width\n }));\n line.x1 = datum.x;\n line.x2 = datum.x;\n line.y1 = datum.y1;\n line.y2 = datum.y2;\n line.strokeWidth = this.line.width;\n line.stroke = this.line.color;\n });\n }\n updateCategoryGridLines() {\n const { gridLength, gridLine, label, range: range3, tickScale } = this;\n const ticks = tickScale.ticks();\n const sideFlag = label.getSideFlag();\n const gridSelection = this.gridLineSelection.update(gridLength ? ticks : []);\n if (gridLength) {\n const { width, style } = gridLine;\n const styleCount = style.length;\n gridSelection.each((line, datum, index) => {\n const y = Math.round(tickScale.convert(datum));\n line.x1 = 0;\n line.x2 = -sideFlag * gridLength;\n line.y1 = y;\n line.y2 = y;\n line.visible = y >= range3[0] && y <= range3[1];\n const { stroke, lineDash } = style[index % styleCount];\n line.stroke = stroke;\n line.strokeWidth = width;\n line.lineDash = lineDash;\n line.fill = void 0;\n });\n }\n }\n computeLayout() {\n this.updateDirection();\n this.calculateDomain();\n this.updateRange();\n const {\n scale: scale2,\n label,\n label: { parallel },\n moduleCtx: { callbackCache },\n range: range3,\n title,\n title: { formatter = (p) => p.defaultValue } = {}\n } = this;\n const rangeStart = scale2.range[0];\n const rangeEnd = scale2.range[1];\n const rangeLength = Math.abs(rangeEnd - rangeStart);\n const bandwidth = rangeLength / scale2.domain.length || 0;\n const keepEvery = Math.ceil(label.fontSize / bandwidth);\n const rotation = toRadians(this.rotation);\n const isHorizontal = Math.abs(Math.cos(rotation)) < 1e-8;\n const sideFlag = label.getSideFlag();\n const lineHeight = this.lineHeight;\n const tickTreeLayout = this.tickTreeLayout;\n const labels = scale2.ticks();\n const treeLabels = tickTreeLayout ? tickTreeLayout.nodes : [];\n const isLabelTree = tickTreeLayout ? tickTreeLayout.depth > 1 : false;\n const { defaultRotation, configuredRotation, parallelFlipFlag } = calculateLabelRotation({\n rotation: label.rotation,\n parallel,\n regularFlipRotation: normalizeAngle360(rotation - Math.PI / 2),\n parallelFlipRotation: normalizeAngle360(rotation)\n });\n const tickLabelLayout = [];\n const copyLabelProps = (node) => {\n return {\n fill: node.fill,\n fontFamily: node.fontFamily,\n fontSize: node.fontSize,\n fontStyle: node.fontStyle,\n fontWeight: node.fontWeight,\n rotation: node.rotation,\n rotationCenterX: node.rotationCenterX,\n rotationCenterY: node.rotationCenterY,\n text: node.text,\n textAlign: node.textAlign,\n textBaseline: node.textBaseline,\n translationX: node.translationX,\n translationY: node.translationY,\n visible: node.visible,\n x: node.x,\n y: node.y\n };\n };\n const labelBBoxes = /* @__PURE__ */ new Map();\n let maxLeafLabelWidth = 0;\n const tempText = new Text();\n const setLabelProps = (datum, index) => {\n var _a;\n tempText.setProperties({\n fill: label.color,\n fontFamily: label.fontFamily,\n fontSize: label.fontSize,\n fontStyle: label.fontStyle,\n fontWeight: label.fontWeight,\n textAlign: \"center\",\n textBaseline: parallelFlipFlag === -1 ? \"bottom\" : \"hanging\",\n translationX: datum.screenY - label.fontSize * 0.25,\n translationY: datum.screenX\n });\n if (index === 0) {\n const isCaptionEnabled = (title == null ? void 0 : title.enabled) && labels.length > 0;\n if (!isCaptionEnabled) {\n return false;\n }\n const text = callbackCache.call(formatter, this.getTitleFormatterParams());\n tempText.setProperties({\n fill: title.color,\n fontFamily: title.fontFamily,\n fontSize: title.fontSize,\n fontStyle: title.fontStyle,\n fontWeight: title.fontWeight,\n text,\n textBaseline: \"hanging\",\n translationX: datum.screenY - label.fontSize * 0.25,\n translationY: datum.screenX\n });\n } else if (index % keepEvery === 0) {\n const isInRange = datum.screenX >= range3[0] && datum.screenX <= range3[1];\n if (!isInRange) {\n return false;\n }\n if (label.formatter) {\n tempText.text = (_a = callbackCache.call(label.formatter, {\n value: String(datum.label),\n index\n })) != null ? _a : String(datum.label);\n } else {\n tempText.text = String(datum.label);\n }\n } else {\n return false;\n }\n return true;\n };\n treeLabels.forEach((datum, index) => {\n const isVisible = setLabelProps(datum, index);\n if (!isVisible)\n return;\n const bbox2 = tempText.computeTransformedBBox();\n if (!bbox2)\n return;\n labelBBoxes.set(index, bbox2);\n const isLeaf = !datum.children.length;\n if (isLeaf && bbox2.width > maxLeafLabelWidth) {\n maxLeafLabelWidth = bbox2.width;\n }\n });\n const labelX = sideFlag * label.padding;\n const labelGrid = this.label.grid;\n const separatorData = [];\n treeLabels.forEach((datum, index) => {\n let visible = setLabelProps(datum, index);\n const id = index;\n tempText.x = labelX;\n tempText.rotationCenterX = labelX;\n const isLeaf = !datum.children.length;\n if (isLeaf) {\n tempText.rotation = configuredRotation;\n tempText.textAlign = \"end\";\n tempText.textBaseline = \"middle\";\n } else {\n tempText.translationX -= maxLeafLabelWidth - lineHeight + this.label.padding;\n const availableRange = datum.leafCount * bandwidth;\n const bbox2 = labelBBoxes.get(id);\n if (bbox2 && bbox2.width > availableRange) {\n visible = false;\n labelBBoxes.delete(id);\n } else if (isHorizontal) {\n tempText.rotation = defaultRotation;\n } else {\n tempText.rotation = -Math.PI / 2;\n }\n }\n if (datum.parent && isLabelTree) {\n const y = isLeaf ? datum.screenX - bandwidth / 2 : datum.screenX - datum.leafCount * bandwidth / 2;\n if (isLeaf) {\n if (datum.number !== datum.children.length - 1 || labelGrid) {\n separatorData.push({\n y,\n x1: 0,\n x2: -maxLeafLabelWidth - this.label.padding * 2\n });\n }\n } else {\n const x = -maxLeafLabelWidth - this.label.padding * 2 + datum.screenY;\n separatorData.push({\n y,\n x1: x + lineHeight,\n x2: x\n });\n }\n }\n let props;\n if (visible) {\n const bbox2 = tempText.computeTransformedBBox();\n if (bbox2) {\n labelBBoxes.set(index, bbox2);\n }\n props = __spreadProps(__spreadValues({}, copyLabelProps(tempText)), { visible });\n } else {\n labelBBoxes.delete(index);\n props = { visible };\n }\n tickLabelLayout.push(props);\n });\n let minX = 0;\n separatorData.forEach((d) => minX = Math.min(minX, d.x2));\n separatorData.push({\n y: Math.max(rangeStart, rangeEnd),\n x1: 0,\n x2: minX\n });\n const separatorLayout = [];\n const separatorBoxes = [];\n const epsilon2 = 1e-7;\n separatorData.forEach((datum) => {\n if (datum.y >= range3[0] - epsilon2 && datum.y <= range3[1] + epsilon2) {\n const { x1, x2, y } = datum;\n const separatorBox = new BBox(Math.min(x1, x2), y, Math.abs(x1 - x2), 0);\n separatorBoxes.push(separatorBox);\n separatorLayout.push({ x1, x2, y });\n }\n });\n const axisLineLayout = [];\n const axisLineBoxes = [];\n const lineCount = tickTreeLayout ? tickTreeLayout.depth + 1 : 1;\n for (let i = 0; i < lineCount; i++) {\n const visible = labels.length > 0 && (i === 0 || labelGrid && isLabelTree);\n const x = i > 0 ? -maxLeafLabelWidth - this.label.padding * 2 - (i - 1) * lineHeight : 0;\n const lineBox = new BBox(x, Math.min(...range3), 0, Math.abs(range3[1] - range3[0]));\n axisLineBoxes.push(lineBox);\n axisLineLayout.push({ x, y1: range3[0], y2: range3[1], visible });\n }\n const getTransformBox = (bbox2) => {\n const matrix = new Matrix();\n const {\n rotation: axisRotation,\n translationX,\n translationY,\n rotationCenterX,\n rotationCenterY\n } = this.getAxisTransform();\n Matrix.updateTransformMatrix(matrix, 1, 1, axisRotation, translationX, translationY, {\n scalingCenterX: 0,\n scalingCenterY: 0,\n rotationCenterX,\n rotationCenterY\n });\n return matrix.transformBBox(bbox2);\n };\n const bbox = BBox.merge([...labelBBoxes.values(), ...separatorBoxes, ...axisLineBoxes]);\n const transformedBBox = getTransformBox(bbox);\n return {\n bbox: transformedBBox,\n tickLabelLayout,\n separatorLayout,\n axisLineLayout\n };\n }\n calculateLayout() {\n const { axisLineLayout, separatorLayout, tickLabelLayout, bbox } = this.computeLayout();\n this.computedLayout = {\n axisLineLayout,\n separatorLayout,\n tickLabelLayout\n };\n return { bbox, primaryTickCount: void 0 };\n }\n};\nGroupedCategoryAxis.className = \"GroupedCategoryAxis\";\nGroupedCategoryAxis.type = \"grouped-category\";\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], GroupedCategoryAxis.prototype, \"labelColor\", 2);\n\n// packages/ag-charts-community/src/util/userAgent.ts\nfunction hasConstrainedCanvasMemory() {\n if (typeof navigator === \"undefined\") {\n return false;\n }\n const iPhoneOSMatch = navigator.userAgent.match(/\\(iPhone; CPU iPhone OS (\\d+_\\d+_\\d+) like Mac OS X\\)/);\n if (iPhoneOSMatch == null) {\n return false;\n }\n const [major, minor] = iPhoneOSMatch[1].split(\"_\").map(Number);\n return major < 16 || major === 16 && minor < 6;\n}\n\n// packages/ag-charts-community/src/scene/canvas/hdpiCanvas.ts\nvar _HdpiCanvas = class _HdpiCanvas {\n constructor(options) {\n this.enabled = true;\n this.width = 600;\n this.height = 300;\n const { width, height, pixelRatio, position, insertAsFirstChild } = options;\n this.insertAsFirstChild = insertAsFirstChild != null ? insertAsFirstChild : false;\n this.pixelRatio = hasConstrainedCanvasMemory() ? 1 : pixelRatio != null ? pixelRatio : getWindow(\"devicePixelRatio\");\n this.element = createElement(\"canvas\");\n this.element.width = Math.round((width != null ? width : this.width) * this.pixelRatio);\n this.element.height = Math.round((height != null ? height : this.height) * this.pixelRatio);\n if (position) {\n this.element.style.position = position;\n }\n this.context = this.element.getContext(\"2d\");\n this.onEnabledChange();\n this.resize(width != null ? width : 0, height != null ? height : 0);\n _HdpiCanvas.debugContext(this.context);\n }\n static is(value) {\n return value instanceof _HdpiCanvas;\n }\n drawImage(context, dx = 0, dy = 0) {\n return context.drawImage(this.context.canvas, dx, dy);\n }\n toDataURL(type) {\n return this.element.toDataURL(type);\n }\n resize(width, height) {\n if (!(width > 0 && height > 0))\n return;\n const { element: element2, context, pixelRatio } = this;\n element2.width = Math.round(width * pixelRatio);\n element2.height = Math.round(height * pixelRatio);\n context.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n element2.style.width = width + \"px\";\n element2.style.height = height + \"px\";\n this.width = width;\n this.height = height;\n }\n snapshot() {\n }\n clear() {\n this.context.save();\n this.context.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n this.context.clearRect(0, 0, this.width, this.height);\n this.context.restore();\n }\n destroy() {\n this.element.remove();\n this.element.width = 0;\n this.element.height = 0;\n this.context.clearRect(0, 0, 0, 0);\n Object.freeze(this);\n }\n onContainerChange(newValue, oldValue) {\n var _a, _b, _c, _d;\n if (newValue === oldValue)\n return;\n (_a = this.element.parentNode) == null ? void 0 : _a.removeChild(this.element);\n if (this.insertAsFirstChild && ((_b = this.container) == null ? void 0 : _b.firstChild)) {\n (_c = this.container) == null ? void 0 : _c.insertBefore(this.element, this.container.firstChild);\n } else {\n (_d = this.container) == null ? void 0 : _d.appendChild(this.element);\n }\n }\n onEnabledChange() {\n if (this.element) {\n this.element.style.display = this.enabled ? \"block\" : \"none\";\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n static debugContext(ctx) {\n if (Debug.check(\"canvas\")) {\n const save = ctx.save.bind(ctx);\n const restore = ctx.restore.bind(ctx);\n let depth = 0;\n Object.assign(ctx, {\n save() {\n save();\n depth++;\n },\n restore() {\n if (depth === 0) {\n throw new Error(\"AG Charts - Unable to restore() past depth 0\");\n }\n restore();\n depth--;\n },\n verifyDepthZero() {\n if (depth !== 0) {\n throw new Error(`AG Charts - Save/restore depth is non-zero: ${depth}`);\n }\n }\n });\n }\n }\n};\n__decorateClass([\n ObserveChanges((target) => target.onEnabledChange())\n], _HdpiCanvas.prototype, \"enabled\", 2);\n__decorateClass([\n ObserveChanges((target, newValue, oldValue) => target.onContainerChange(newValue, oldValue))\n], _HdpiCanvas.prototype, \"container\", 2);\nvar HdpiCanvas = _HdpiCanvas;\n\n// packages/ag-charts-community/src/scene/layersManager.ts\nvar LayersManager = class _LayersManager {\n constructor(canvas, markDirty) {\n this.canvas = canvas;\n this.markDirty = markDirty;\n this.debug = Debug.create(true, \"scene\");\n this.layersMap = /* @__PURE__ */ new Map();\n this.nextZIndex = 0;\n this.nextLayerId = 0;\n }\n static sortLayers(a, b) {\n var _a, _b;\n return compoundAscending(\n [a.zIndex, ...(_a = a.zIndexSubOrder) != null ? _a : [void 0, void 0], a.id],\n [b.zIndex, ...(_b = b.zIndexSubOrder) != null ? _b : [void 0, void 0], b.id],\n ascendingStringNumberUndefined\n );\n }\n get size() {\n return this.layersMap.size;\n }\n forEach(callback) {\n Array.from(this.layersMap.values()).sort(_LayersManager.sortLayers).forEach(callback);\n }\n resize(width, height) {\n this.canvas.resize(width, height);\n this.layersMap.forEach(({ canvas }) => canvas.resize(width, height));\n }\n addLayer(opts) {\n const { width, height, pixelRatio } = this.canvas;\n const { zIndex = this.nextZIndex++, name, zIndexSubOrder, getComputedOpacity, getVisibility } = opts;\n const canvas = new HdpiCanvas({ width, height, pixelRatio, position: \"absolute\" });\n const newLayer = {\n id: this.nextLayerId++,\n name,\n canvas,\n zIndex,\n zIndexSubOrder,\n getComputedOpacity,\n getVisibility\n };\n if (zIndex >= this.nextZIndex) {\n this.nextZIndex = zIndex + 1;\n }\n this.layersMap.set(canvas, newLayer);\n this.debug(\"Scene.addLayer() - layers\", this.layersMap);\n return newLayer.canvas;\n }\n removeLayer(canvas) {\n if (this.layersMap.has(canvas)) {\n this.layersMap.delete(canvas);\n canvas.destroy();\n this.markDirty();\n this.debug(\"Scene.removeLayer() - layers\", this.layersMap);\n }\n }\n moveLayer(canvas, newZIndex, newZIndexSubOrder) {\n const layer = this.layersMap.get(canvas);\n if (layer) {\n layer.zIndex = newZIndex;\n layer.zIndexSubOrder = newZIndexSubOrder;\n this.markDirty();\n this.debug(\"Scene.moveLayer() - layers\", this.layersMap);\n }\n }\n clear() {\n this.layersMap.clear();\n }\n};\n\n// packages/ag-charts-community/src/scene/sceneDebug.ts\nfunction debugStats(layersManager, debugSplitTimes, ctx, renderCtxStats, extraDebugStats = {}) {\n if (!Debug.check(\"scene:stats\" /* SCENE_STATS */, \"scene:stats:verbose\" /* SCENE_STATS_VERBOSE */))\n return;\n const { layersRendered = 0, layersSkipped = 0, nodesRendered = 0, nodesSkipped = 0 } = renderCtxStats != null ? renderCtxStats : {};\n const end = performance.now();\n const _a = debugSplitTimes, { start } = _a, durations = __objRest(_a, [\"start\"]);\n const splits = Object.entries(durations).map(([n, t]) => {\n return time(n, t);\n }).filter((v) => v != null).join(\" + \");\n const extras = Object.entries(extraDebugStats).map(([k, v]) => `${k}: ${v}`).join(\" ; \");\n const detailedStats = Debug.check(\"scene:stats:verbose\" /* SCENE_STATS_VERBOSE */);\n const stats = [\n `${time(\"\\u23F1\\uFE0F\", start, end)} (${splits})`,\n `${extras}`,\n `Layers: ${detailedStats ? pct(layersRendered, layersSkipped) : layersManager.size}`,\n detailedStats ? `Nodes: ${pct(nodesRendered, nodesSkipped)}` : null\n ].filter(isString);\n const statsSize = new Map(stats.map((t) => [t, Text.getTextSize(t, ctx.font)]));\n const width = Math.max(...Array.from(statsSize.values(), (s) => s.width));\n const height = accumulate(statsSize.values(), (s) => s.height);\n ctx.save();\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, width, height);\n ctx.fillStyle = \"black\";\n let y = 0;\n for (const [stat, size] of statsSize.entries()) {\n y += size.height;\n ctx.fillText(stat, 2, y);\n }\n ctx.restore();\n}\nfunction debugSceneNodeHighlight(ctx, debugNodes) {\n ctx.save();\n for (const [name, node] of Object.entries(debugNodes)) {\n const bbox = node.computeTransformedBBox();\n if (!bbox) {\n Logger.log(`Scene.render() - no bbox for debugged node [${name}].`);\n continue;\n }\n ctx.globalAlpha = 0.8;\n ctx.strokeStyle = \"red\";\n ctx.lineWidth = 1;\n ctx.strokeRect(bbox.x, bbox.y, bbox.width, bbox.height);\n ctx.fillStyle = \"red\";\n ctx.strokeStyle = \"white\";\n ctx.font = \"16px sans-serif\";\n ctx.textBaseline = \"top\";\n ctx.textAlign = \"left\";\n ctx.lineWidth = 2;\n ctx.strokeText(name, bbox.x, bbox.y, bbox.width);\n ctx.fillText(name, bbox.x, bbox.y, bbox.width);\n }\n ctx.restore();\n}\nfunction buildTree(node) {\n var _a, _b;\n if (!Debug.check(true, \"scene\" /* SCENE */))\n return {};\n return __spreadValues(__spreadValues({\n node,\n name: (_a = node instanceof Group ? node.name : null) != null ? _a : node.id,\n dirty: RedrawType[node.dirty]\n }, ((_b = node.parent) == null ? void 0 : _b.isVirtual) ? {\n virtualParentDirty: RedrawType[node.parent.dirty],\n virtualParent: node.parent\n } : {}), node.children.map((c) => buildTree(c)).reduce((result, childTree) => {\n let { name: treeNodeName } = childTree;\n const {\n node: { visible, opacity, zIndex, zIndexSubOrder },\n node: childNode,\n virtualParent\n } = childTree;\n if (!visible || opacity <= 0) {\n treeNodeName = `(${treeNodeName})`;\n }\n if (childNode instanceof Group && childNode.isLayer()) {\n treeNodeName = `*${treeNodeName}*`;\n }\n const key = [\n `${treeNodeName != null ? treeNodeName : \"\"}`,\n `z: ${zIndex}`,\n zIndexSubOrder && `zo: ${zIndexSubOrder.map((v) => typeof v === \"function\" ? `${v()} (fn)` : v).join(\" / \")}`,\n virtualParent && `(virtual parent)`\n ].filter((v) => !!v).join(\" \");\n let selectedKey = key;\n let index = 1;\n while (result[selectedKey] != null && index < 100) {\n selectedKey = `${key} (${index++})`;\n }\n result[selectedKey] = childTree;\n return result;\n }, {}));\n}\nfunction buildDirtyTree(node) {\n var _a;\n if (node.dirty === 0 /* NONE */) {\n return { dirtyTree: {}, paths: [] };\n }\n const childrenDirtyTree = node.children.map((c) => buildDirtyTree(c)).filter((c) => c.paths.length > 0);\n const name = Group.is(node) ? (_a = node.name) != null ? _a : node.id : node.id;\n const paths = childrenDirtyTree.length ? childrenDirtyTree.flatMap((c) => c.paths).map((p) => `${name}.${p}`) : [name];\n return {\n dirtyTree: __spreadValues({\n name,\n node,\n dirty: RedrawType[node.dirty]\n }, childrenDirtyTree.map((c) => c.dirtyTree).filter((t) => t.dirty != null).reduce((result, childTree) => {\n var _a2;\n result[(_a2 = childTree.name) != null ? _a2 : \"\"] = childTree;\n return result;\n }, {})),\n paths\n };\n}\nfunction pct(rendered, skipped) {\n const total = rendered + skipped;\n return `${rendered} / ${total} (${Math.round(100 * rendered / total)}%)`;\n}\nfunction time(name, start, end) {\n const duration = end != null ? end - start : start;\n return `${name}: ${Math.round(duration * 100) / 100}ms`;\n}\nfunction accumulate(iterator, mapper) {\n let sum2 = 0;\n for (const item of iterator) {\n sum2 += mapper(item);\n }\n return sum2;\n}\n\n// packages/ag-charts-community/src/scene/scene.ts\nvar Scene = class {\n constructor({ width, height, pixelRatio, canvasPosition }) {\n this.debug = Debug.create(true, \"scene\" /* SCENE */);\n this.id = createId(this);\n this.root = null;\n this.isDirty = false;\n this.canvas = new HdpiCanvas({\n width,\n height,\n pixelRatio,\n position: canvasPosition,\n insertAsFirstChild: canvasPosition === \"absolute\"\n });\n this.layersManager = new LayersManager(this.canvas, () => {\n this.isDirty = true;\n });\n }\n get width() {\n var _a, _b;\n return (_b = (_a = this.pendingSize) == null ? void 0 : _a[0]) != null ? _b : this.canvas.width;\n }\n get height() {\n var _a, _b;\n return (_b = (_a = this.pendingSize) == null ? void 0 : _a[1]) != null ? _b : this.canvas.height;\n }\n setContainer(value) {\n this.canvas.container = value;\n return this;\n }\n setRoot(node) {\n var _a;\n if (this.root === node) {\n return this;\n }\n this.isDirty = true;\n (_a = this.root) == null ? void 0 : _a._setLayerManager();\n this.root = node;\n if (node) {\n node.visible = true;\n node._setLayerManager(this.layersManager);\n }\n return this;\n }\n attachNode(node) {\n var _a;\n (_a = this.root) == null ? void 0 : _a.appendChild(node);\n return () => this.removeChild(node);\n }\n appendChild(node) {\n var _a;\n (_a = this.root) == null ? void 0 : _a.appendChild(node);\n return this;\n }\n removeChild(node) {\n var _a;\n (_a = this.root) == null ? void 0 : _a.removeChild(node);\n return this;\n }\n download(fileName, fileFormat) {\n var _a;\n downloadUrl(this.canvas.toDataURL(fileFormat), (_a = fileName == null ? void 0 : fileName.trim()) != null ? _a : \"image\");\n }\n /** NOTE: Integrated Charts undocumented image download method. */\n getDataURL(fileFormat) {\n return this.canvas.toDataURL(fileFormat);\n }\n resize(width, height) {\n width = Math.round(width);\n height = Math.round(height);\n if (width > 0 && height > 0 && (width !== this.width || height !== this.height)) {\n this.pendingSize = [width, height];\n this.isDirty = true;\n return true;\n }\n return false;\n }\n render(opts) {\n return __async(this, null, function* () {\n var _a, _b;\n const { debugSplitTimes = { start: performance.now() }, extraDebugStats } = opts != null ? opts : {};\n const { canvas, canvas: { context: ctx } = {}, root, pendingSize } = this;\n if (!ctx) {\n return;\n }\n const renderStartTime = performance.now();\n if (pendingSize) {\n this.layersManager.resize(...pendingSize);\n this.pendingSize = void 0;\n }\n if (root && !root.visible) {\n this.isDirty = false;\n return;\n }\n if (root && !this.isDirty) {\n if (this.debug.check()) {\n this.debug(\"Scene.render() - no-op\", {\n redrawType: RedrawType[root.dirty],\n tree: buildTree(root)\n });\n }\n debugStats(this.layersManager, debugSplitTimes, ctx, void 0, extraDebugStats);\n return;\n }\n const renderCtx = {\n ctx,\n devicePixelRatio: (_a = this.canvas.pixelRatio) != null ? _a : 1,\n forceRender: true,\n resized: Boolean(pendingSize),\n debugNodes: {}\n };\n if (Debug.check(\"scene:stats:verbose\" /* SCENE_STATS_VERBOSE */)) {\n renderCtx.stats = { layersRendered: 0, layersSkipped: 0, nodesRendered: 0, nodesSkipped: 0 };\n }\n let canvasCleared = false;\n if (!root || root.dirty >= 1 /* TRIVIAL */) {\n canvasCleared = true;\n canvas.clear();\n }\n if (root && Debug.check(\"scene:dirtyTree\" /* SCENE_DIRTY_TREE */)) {\n const { dirtyTree, paths } = buildDirtyTree(root);\n Debug.create(\"scene:dirtyTree\" /* SCENE_DIRTY_TREE */)(\"Scene.render() - dirtyTree\", { dirtyTree, paths });\n }\n if (root && canvasCleared) {\n this.debug(\"Scene.render() - before\", {\n redrawType: RedrawType[root.dirty],\n canvasCleared,\n tree: buildTree(root)\n });\n if (root.visible) {\n root.preRender();\n ctx.save();\n root.render(renderCtx);\n ctx.restore();\n }\n }\n debugSplitTimes[\"\\u270D\\uFE0F\"] = performance.now() - renderStartTime;\n if (this.layersManager.size && canvasCleared) {\n const layerRenderStart = performance.now();\n ctx.save();\n ctx.resetTransform();\n this.layersManager.forEach((layer) => {\n if (layer.canvas.enabled && layer.getVisibility()) {\n ctx.globalAlpha = layer.getComputedOpacity();\n layer.canvas.drawImage(ctx);\n }\n });\n ctx.restore();\n debugSplitTimes[\"\\u26D9\"] = performance.now() - layerRenderStart;\n }\n (_b = ctx.verifyDepthZero) == null ? void 0 : _b.call(ctx);\n this.isDirty = false;\n debugStats(this.layersManager, debugSplitTimes, ctx, renderCtx.stats, extraDebugStats);\n debugSceneNodeHighlight(ctx, renderCtx.debugNodes);\n if (root && this.debug.check()) {\n this.debug(\"Scene.render() - after\", {\n redrawType: RedrawType[root.dirty],\n tree: buildTree(root),\n canvasCleared\n });\n }\n });\n }\n /** Alternative to destroy() that preserves re-usable resources. */\n strip() {\n const { context, pixelRatio } = this.canvas;\n context.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n this.layersManager.clear();\n this.setRoot(null);\n this.isDirty = false;\n }\n destroy() {\n this.canvas.container = void 0;\n this.strip();\n this.canvas.destroy();\n Object.assign(this, { canvas: void 0 });\n }\n};\nScene.className = \"Scene\";\n\n// packages/ag-charts-community/src/styles/icons.ts\nvar icons_default = `\n[class^='ag-charts-icon'] {\n display: block;\n /* speak: none; */\n mask-size: contain;\n mask-repeat: no-repeat;\n background-color: currentColor;\n}\n\n.ag-charts-icon-zoom-in {\n mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+);\n}\n\n.ag-charts-icon-zoom-out {\n mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-reset {\n mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXJvdGF0ZS1jY3ciPjxwYXRoIGQ9Ik0zIDEyYTkgOSAwIDEgMCA5LTkgOS43NSA5Ljc1IDAgMCAwLTYuNzQgMi43NEwzIDgiLz48cGF0aCBkPSJNMyAzdjVoNSIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-left {\n mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGVmdCI+PHBhdGggZD0ibTE1IDE4LTYtNiA2LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-right {\n mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQiPjxwYXRoIGQ9Im05IDE4IDYtNi02LTYiLz48L3N2Zz4=);\n}\n\n.ag-charts-icon-pan-start {\n mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tZmlyc3QiPjxwYXRoIGQ9Im0xNyAxOC02LTYgNi02Ii8+PHBhdGggZD0iTTcgNnYxMiIvPjwvc3ZnPg==);\n}\n\n.ag-charts-icon-pan-end {\n mask-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tbGFzdCI+PHBhdGggZD0ibTcgMTggNi02LTYtNiIvPjxwYXRoIGQ9Ik0xNyA2djEyIi8+PC9zdmc+);\n}\n\n`;\n\n// packages/ag-charts-community/src/styles/reset.ts\nvar reset_default = `\n[class^='ag-charts'],\n[class^='ag-charts']:focus,\n[class^='ag-charts']:after,\n[class^='ag-charts']:before {\n box-sizing: border-box;\n outline: none;\n}\n\nbutton[class^='ag-charts'] {\n background: none;\n border: 0;\n}\n\n`;\n\n// packages/ag-charts-community/src/styles/theme-default.ts\nvar theme_default_default = `\n.ag-charts-theme-default,\n.ag-charts-theme-default-dark {\n /* Colors */\n --ag-charts-active-color: var(--ag-active-color, #2196f3);\n --ag-charts-background-color: var(--ag-background-color, #fff);\n --ag-charts-foreground-color: var(--ag-foreground-color, #181d1f);\n --ag-charts-border-color: var(--ag-border-color, #dddddd);\n\n /* Sizing */\n --ag-charts-font-size: var(--ag-font-size, 14px);\n --ag-charts-size: var(--ag-grid-size, 8px);\n\n /* Borders */\n --ag-charts-border: var(--ag-borders, solid 1px);\n --ag-charts-border-critical: var(--ag-borders-critical, solid 1px);\n\n /* Toolbar */\n --ag-charts-toolbar-foreground-color: var(--ag-header-foreground-color, var(--ag-charts-foreground-color));\n --ag-charts-toolbar-background-color: var(\n --ag-header-background-color,\n color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 2%)\n );\n --ag-charts-toolbar-size: var(--ag-header-height, 48px);\n --ag-charts-toolbar-padding: calc(var(--ag-charts-size) * 2);\n --ag-charts-toolbar-border: var(--ag-charts-border, solid 1px) var(--ag-charts-border-color);\n --ag-charts-toolbar-border-critical: var(--ag-charts-border-critical, solid 1px) var(--ag-charts-border-color);\n --ag-charts-toolbar-hover-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 12%);\n --ag-charts-toolbar-disabled-foreground-color: var(\n --ag-disabled-foreground-color,\n color-mix(in srgb, transparent, var(--ag-charts-toolbar-foreground-color) 50%)\n );\n --ag-charts-toolbar-disabled-background-color: var(\n --ag-input-disabled-background-color,\n color-mix(in srgb, var(--ag-charts-toolbar-background-color), var(--ag-charts-toolbar-foreground-color) 6%)\n );\n --ag-charts-toolbar-gap: var(--ag-charts-size);\n\n /* Buttons */\n --ag-charts-button-padding: var(--ag-charts-size);\n --ag-charts-button-radius: var(--ag-border-radius, 4px);\n\n /* Focus Indicator */\n --ag-charts-focus-border: solid 2px var(--ag-input-focus-border-color, var(--ag-charts-active-color));\n --ag-charts-focus-border-shadow: var(--ag-input-focus-box-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-focus-border) 47%));\n\n /* Icons */\n --ag-charts-icon-font-family: 'agChartsDefault';\n --ag-charts-icon-font-weight: normal;\n --ag-charts-icon-font-color: color-mix(in srgb, transparent, var(--ag-charts-foreground-color), 90%);\n}\n\n`;\n\n// packages/ag-charts-community/src/styles/theme-default-dark.ts\nvar theme_default_dark_default = `\n.ag-charts-theme-default-dark {\n /* Colors */\n --ag-charts-background-color: var(--ag-background-color, color-mix(in srgb, #fff, #182230 97%));\n --ag-charts-foreground-color: var(--ag-foreground-color, #fff);\n --ag-charts-border-color: var(--ag-border-color, rgba(255, 255, 255, 0.16));\n --ag-charts-hover-color: var(\n --ag-row-hover-color,\n color-mix(in srgb, transparent, var(--ag-charts-active-color) 20%)\n );\n\n /* Toolbar */\n --ag-charts-toolbar-background-color: var(--ag-header-background-color, color-mix(in srgb, #fff, #182230 93%));\n}\n\n`;\n\n// packages/ag-charts-community/src/styles/styles.ts\nvar styles_default = `\n/* Reset */\n${reset_default}\n\n/* Icons */\n${icons_default}\n\n/* AG Charts Theme Default */\n${theme_default_default}\n\n/* AG Charts Theme Default Dark */\n${theme_default_dark_default}\n`;\n\n// packages/ag-charts-community/src/util/async.ts\nfunction sleep(sleepTimeoutMs) {\n return new Promise((resolve) => {\n setTimeout(() => resolve(void 0), sleepTimeoutMs);\n });\n}\n\n// packages/ag-charts-community/src/util/mutex.ts\nvar Mutex = class {\n constructor() {\n this.available = true;\n this.acquireQueue = [];\n }\n acquire(cb) {\n return new Promise((resolve) => {\n this.acquireQueue.push([cb, resolve]);\n if (this.available) {\n this.dispatchNext().catch((e) => Logger.errorOnce(e));\n }\n });\n }\n acquireImmediately(cb) {\n return __async(this, null, function* () {\n if (!this.available) {\n return false;\n }\n yield this.acquire(cb);\n return true;\n });\n }\n waitForClearAcquireQueue() {\n return __async(this, null, function* () {\n return this.acquire(() => __async(this, null, function* () {\n return void 0;\n }));\n });\n }\n dispatchNext() {\n return __async(this, null, function* () {\n var _a, _b;\n this.available = false;\n let [next, done] = (_a = this.acquireQueue.shift()) != null ? _a : [];\n while (next) {\n try {\n yield next();\n done == null ? void 0 : done();\n } catch (error) {\n Logger.error(\"mutex callback error\", error);\n done == null ? void 0 : done();\n }\n [next, done] = (_b = this.acquireQueue.shift()) != null ? _b : [];\n }\n this.available = true;\n });\n }\n};\n\n// packages/ag-charts-community/src/util/observable.ts\nvar Observable = class {\n constructor() {\n this.eventListeners = /* @__PURE__ */ new Map();\n }\n addEventListener(eventType, listener) {\n if (typeof listener !== \"function\") {\n throw new Error(\"AG Charts - listener must be a Function\");\n }\n const eventTypeListeners = this.eventListeners.get(eventType);\n if (eventTypeListeners) {\n eventTypeListeners.add(listener);\n } else {\n this.eventListeners.set(eventType, /* @__PURE__ */ new Set([listener]));\n }\n }\n removeEventListener(type, listener) {\n var _a;\n (_a = this.eventListeners.get(type)) == null ? void 0 : _a.delete(listener);\n if (this.eventListeners.size === 0) {\n this.eventListeners.delete(type);\n }\n }\n hasEventListener(type) {\n return this.eventListeners.has(type);\n }\n clearEventListeners() {\n this.eventListeners.clear();\n }\n fireEvent(event) {\n var _a;\n (_a = this.eventListeners.get(event.type)) == null ? void 0 : _a.forEach((listener) => listener(event));\n }\n};\n\n// packages/ag-charts-community/src/util/padding.ts\nvar Padding = class extends BaseProperties {\n constructor(top = 0, right = top, bottom = top, left = right) {\n super();\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n this.left = left;\n }\n clear() {\n this.top = this.right = this.bottom = this.left = 0;\n }\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], Padding.prototype, \"top\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], Padding.prototype, \"right\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], Padding.prototype, \"bottom\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], Padding.prototype, \"left\", 2);\n\n// packages/ag-charts-community/src/util/render.ts\nfunction debouncedAnimationFrame(cb) {\n return buildScheduler((innerCb, _delayMs) => requestAnimationFrame(innerCb), cb);\n}\nfunction debouncedCallback(cb) {\n return buildScheduler((innerCb, delayMs = 0) => setTimeout(innerCb, delayMs), cb);\n}\nfunction buildScheduler(scheduleFn, cb) {\n let scheduleCount = 0;\n let promiseRunning = false;\n let awaitingPromise;\n let awaitingDone;\n const busy = () => {\n return promiseRunning;\n };\n const done = () => {\n promiseRunning = false;\n awaitingDone == null ? void 0 : awaitingDone();\n awaitingDone = void 0;\n awaitingPromise = void 0;\n if (scheduleCount > 0) {\n scheduleFn(scheduleCb);\n }\n };\n const scheduleCb = () => {\n const count = scheduleCount;\n scheduleCount = 0;\n promiseRunning = true;\n const maybePromise = cb({ count });\n if (!maybePromise) {\n done();\n return;\n }\n maybePromise.then(done, done);\n };\n return {\n schedule(delayMs) {\n if (scheduleCount === 0 && !busy()) {\n scheduleFn(scheduleCb, delayMs);\n }\n scheduleCount++;\n },\n await() {\n return __async(this, null, function* () {\n if (!busy()) {\n return;\n }\n if (awaitingPromise == null) {\n awaitingPromise = new Promise((resolve) => {\n awaitingDone = resolve;\n });\n }\n while (busy()) {\n yield awaitingPromise;\n }\n });\n }\n };\n}\n\n// packages/ag-charts-community/src/util/sizeMonitor.ts\nvar SizeMonitor = class {\n constructor() {\n this.elements = /* @__PURE__ */ new Map();\n this.documentReady = false;\n this.queuedObserveRequests = [];\n this.onLoad = () => {\n this.documentReady = true;\n this.queuedObserveRequests.forEach(([el, cb]) => this.observe(el, cb));\n this.queuedObserveRequests = [];\n };\n var _a;\n if (typeof ResizeObserver === \"undefined\")\n return;\n this.resizeObserver = new ResizeObserver((entries) => {\n for (const { target, contentRect } of entries) {\n const { width, height } = contentRect;\n this.checkSize(this.elements.get(target), target, width, height);\n }\n });\n this.documentReady = getDocument(\"readyState\") === \"complete\";\n if (!this.documentReady) {\n (_a = getWindow()) == null ? void 0 : _a.addEventListener(\"load\", this.onLoad);\n }\n }\n destroy() {\n var _a, _b;\n (_a = getWindow()) == null ? void 0 : _a.removeEventListener(\"load\", this.onLoad);\n (_b = this.resizeObserver) == null ? void 0 : _b.disconnect();\n this.resizeObserver = null;\n }\n checkSize(entry, element2, width, height) {\n var _a, _b;\n if (!entry)\n return;\n if (width !== ((_a = entry.size) == null ? void 0 : _a.width) || height !== ((_b = entry.size) == null ? void 0 : _b.height)) {\n entry.size = { width, height };\n entry.cb(entry.size, element2);\n }\n }\n // Only a single callback is supported.\n observe(element2, cb) {\n var _a;\n if (!this.documentReady) {\n this.queuedObserveRequests.push([element2, cb]);\n return;\n }\n if (this.elements.has(element2)) {\n this.removeFromQueue(element2);\n } else {\n (_a = this.resizeObserver) == null ? void 0 : _a.observe(element2);\n }\n this.elements.set(element2, { cb });\n }\n unobserve(element2) {\n var _a;\n (_a = this.resizeObserver) == null ? void 0 : _a.unobserve(element2);\n this.elements.delete(element2);\n this.removeFromQueue(element2);\n if (!this.elements.size) {\n this.destroy();\n }\n }\n removeFromQueue(element2) {\n this.queuedObserveRequests = this.queuedObserveRequests.filter(([el]) => el !== element2);\n }\n};\n\n// packages/ag-charts-community/src/util/callbackCache.ts\nvar CallbackCache = class {\n constructor() {\n this.cache = /* @__PURE__ */ new WeakMap();\n }\n call(fn, ...params) {\n let serialisedParams;\n let paramCache = this.cache.get(fn);\n const invoke = () => {\n try {\n const result = fn(...params);\n if (paramCache && serialisedParams != null) {\n paramCache.set(serialisedParams, result);\n }\n return result;\n } catch (e) {\n Logger.warnOnce(`User callback errored, ignoring`, e);\n return;\n }\n };\n try {\n serialisedParams = JSON.stringify(params);\n } catch (e) {\n return invoke();\n }\n if (paramCache == null) {\n paramCache = /* @__PURE__ */ new Map();\n this.cache.set(fn, paramCache);\n }\n if (!paramCache.has(serialisedParams)) {\n return invoke();\n }\n return paramCache.get(serialisedParams);\n }\n invalidateCache() {\n this.cache = /* @__PURE__ */ new WeakMap();\n }\n};\n\n// packages/ag-charts-community/src/chart/annotation/annotationManager.ts\nvar AnnotationManager = class {\n constructor(annotationRoot) {\n this.annotationRoot = annotationRoot;\n }\n attachNode(node) {\n this.annotationRoot.append(node);\n return () => {\n var _a;\n (_a = this.annotationRoot) == null ? void 0 : _a.removeChild(node);\n return this;\n };\n }\n setAnnotationStyles(styles) {\n this.styles = styles;\n }\n getAnnotationTypeStyles(type) {\n var _a;\n return (_a = this.styles) == null ? void 0 : _a[type];\n }\n};\n\n// packages/ag-charts-community/src/util/listeners.ts\nvar Listeners = class {\n constructor() {\n this.registeredListeners = /* @__PURE__ */ new Map();\n }\n addListener(eventType, handler) {\n const record = { symbol: Symbol(eventType), handler };\n if (this.registeredListeners.has(eventType)) {\n this.registeredListeners.get(eventType).push(record);\n } else {\n this.registeredListeners.set(eventType, [record]);\n }\n return () => this.removeListener(record.symbol);\n }\n removeListener(eventSymbol) {\n for (const [type, listeners] of this.registeredListeners.entries()) {\n const matchIndex = listeners.findIndex((listener) => listener.symbol === eventSymbol);\n if (matchIndex >= 0) {\n listeners.splice(matchIndex, 1);\n if (listeners.length === 0) {\n this.registeredListeners.delete(type);\n }\n break;\n }\n }\n }\n dispatch(eventType, ...params) {\n for (const listener of this.getListenersByType(eventType)) {\n try {\n listener.handler(...params);\n } catch (e) {\n Logger.errorOnce(e);\n }\n }\n }\n dispatchWrapHandlers(eventType, wrapFn, ...params) {\n for (const listener of this.getListenersByType(eventType)) {\n try {\n wrapFn(listener.handler, ...params);\n } catch (e) {\n Logger.errorOnce(e);\n }\n }\n }\n getListenersByType(eventType) {\n var _a;\n return (_a = this.registeredListeners.get(eventType)) != null ? _a : [];\n }\n destroy() {\n this.registeredListeners.clear();\n }\n};\n\n// packages/ag-charts-community/src/chart/data/dataService.ts\nvar DataService = class extends Listeners {\n constructor(animationManager) {\n super();\n this.animationManager = animationManager;\n this.dispatchOnlyLatest = true;\n this.dispatchThrottle = 0;\n this.requestThrottle = 300;\n this.isLoadingInitialData = false;\n this.isLoadingData = false;\n this.freshRequests = [];\n this.requestCounter = 0;\n this.debug = Debug.create(true, \"data-model\", \"data-source\");\n this.throttledFetch = this.createThrottledFetch(this.requestThrottle);\n this.throttledDispatch = this.createThrottledDispatch(this.dispatchThrottle);\n }\n updateCallback(dataSourceCallback) {\n if (typeof dataSourceCallback !== \"function\")\n return;\n this.debug(\"DataService - updated data source callback\");\n this.dataSourceCallback = dataSourceCallback;\n this.isLoadingInitialData = true;\n this.animationManager.skip();\n this.dispatch(\"data-source-change\");\n }\n clearCallback() {\n this.dataSourceCallback = void 0;\n }\n load(params) {\n this.isLoadingData = true;\n this.throttledFetch(params);\n }\n isLazy() {\n return this.dataSourceCallback != null;\n }\n isLoading() {\n return this.isLazy() && (this.isLoadingInitialData || this.isLoadingData);\n }\n createThrottledFetch(requestThrottle) {\n return throttle((params) => this.fetch(params), requestThrottle, {\n leading: false,\n trailing: true\n });\n }\n createThrottledDispatch(dispatchThrottle) {\n return throttle(\n (id, data) => {\n this.debug(`DataService - dispatching 'data-load' | ${id}`);\n this.dispatch(\"data-load\", { type: \"data-load\", data });\n },\n dispatchThrottle,\n {\n leading: true,\n trailing: true\n }\n );\n }\n fetch(params) {\n return __async(this, null, function* () {\n if (!this.dataSourceCallback) {\n throw new Error(\"DataService - [dataSource.getData] callback not initialised\");\n }\n const start = performance.now();\n const id = this.requestCounter++;\n this.debug(`DataService - requesting | ${id}`);\n this.freshRequests.push(id);\n let response;\n try {\n response = yield this.dataSourceCallback(params);\n this.debug(`DataService - response | ${performance.now() - start}ms | ${id}`);\n } catch (error) {\n this.debug(`DataService - request failed | ${id}`);\n Logger.errorOnce(`DataService - request failed | [${error}]`);\n }\n this.isLoadingInitialData = false;\n const requestIndex = this.freshRequests.findIndex((rid) => rid === id);\n if (requestIndex === -1 || this.dispatchOnlyLatest && requestIndex !== this.freshRequests.length - 1) {\n this.debug(`DataService - discarding stale request | ${id}`);\n return;\n }\n this.freshRequests = this.freshRequests.slice(requestIndex + 1);\n if (this.freshRequests.length === 0) {\n this.isLoadingData = false;\n }\n if (Array.isArray(response)) {\n this.throttledDispatch(id, response);\n } else {\n this.dispatch(\"data-error\");\n }\n });\n }\n};\n__decorateClass([\n ActionOnSet({\n newValue(dispatchThrottle) {\n this.throttledDispatch = this.createThrottledDispatch(dispatchThrottle);\n }\n })\n], DataService.prototype, \"dispatchThrottle\", 2);\n__decorateClass([\n ActionOnSet({\n newValue(requestThrottle) {\n this.throttledFetch = this.createThrottledFetch(requestThrottle);\n }\n })\n], DataService.prototype, \"requestThrottle\", 2);\n\n// packages/ag-charts-community/src/chart/interaction/animationBatch.ts\nvar AnimationBatch = class {\n constructor(maxAnimationTime) {\n this.maxAnimationTime = maxAnimationTime;\n this.debug = Debug.create(true, \"animation\");\n this.controllers = /* @__PURE__ */ new Map();\n this.stoppedCbs = /* @__PURE__ */ new Set();\n this.currentPhase = 0;\n this.phases = new Map(PHASE_ORDER.map((p) => [p, []]));\n this.skipAnimations = false;\n this.animationTimeConsumed = 0;\n /** Guard against premature animation execution. */\n this.isReady = false;\n }\n get size() {\n return this.controllers.size;\n }\n get consumedTimeMs() {\n return this.animationTimeConsumed;\n }\n isActive() {\n return this.controllers.size > 0;\n }\n getActiveControllers() {\n var _a;\n return (_a = this.phases.get(PHASE_ORDER[this.currentPhase])) != null ? _a : [];\n }\n checkOverlappingId(id) {\n if (id != null && this.controllers.has(id)) {\n this.controllers.get(id).stop();\n this.debug(`Skipping animation batch due to update of existing animation: ${id}`);\n this.skip();\n }\n }\n addAnimation(animation) {\n var _a;\n if (animation.isComplete)\n return;\n const animationPhaseIdx = PHASE_ORDER.indexOf(animation.phase);\n if (animationPhaseIdx < this.currentPhase) {\n this.debug(`Skipping animation due to being for an earlier phase`, animation.id);\n animation.stop();\n return;\n }\n this.controllers.set(animation.id, animation);\n (_a = this.phases.get(animation.phase)) == null ? void 0 : _a.push(animation);\n }\n removeAnimation(animation) {\n this.controllers.delete(animation.id);\n const phase = this.phases.get(animation.phase);\n const index = phase == null ? void 0 : phase.indexOf(animation);\n if (index != null && index >= 0) {\n phase == null ? void 0 : phase.splice(index, 1);\n }\n }\n progress(deltaTime) {\n if (!this.isReady)\n return;\n let unusedTime = deltaTime === 0 ? 0.01 : deltaTime;\n const refresh = () => {\n const phase2 = PHASE_ORDER[this.currentPhase];\n return {\n phaseControllers: [...this.getActiveControllers()],\n phase: phase2,\n phaseMeta: PHASE_METADATA[phase2]\n };\n };\n let { phase, phaseControllers, phaseMeta } = refresh();\n const arePhasesComplete = () => PHASE_ORDER[this.currentPhase] == null;\n const progressPhase = () => {\n ({ phase, phaseControllers, phaseMeta } = refresh());\n while (!arePhasesComplete() && phaseControllers.length === 0) {\n this.currentPhase++;\n ({ phase, phaseControllers, phaseMeta } = refresh());\n this.debug(`AnimationBatch - phase changing to ${phase}`, { unusedTime }, phaseControllers);\n }\n };\n const total = this.controllers.size;\n this.debug(`AnimationBatch - ${deltaTime}ms; phase ${phase} with ${phaseControllers == null ? void 0 : phaseControllers.length} of ${total}`);\n do {\n const phaseDeltaTime = unusedTime;\n const skipPhase = phaseMeta.skipIfNoEarlierAnimations && this.animationTimeConsumed === 0;\n let completeCount = 0;\n for (const controller of phaseControllers) {\n if (skipPhase) {\n controller.stop();\n } else {\n unusedTime = Math.min(controller.update(phaseDeltaTime), unusedTime);\n }\n if (controller.isComplete) {\n completeCount++;\n this.removeAnimation(controller);\n }\n }\n this.animationTimeConsumed += phaseDeltaTime - unusedTime;\n this.debug(`AnimationBatch - updated ${phaseControllers.length} controllers; ${completeCount} completed`);\n this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`);\n progressPhase();\n } while (unusedTime > 0 && !arePhasesComplete());\n if (this.animationTimeConsumed > this.maxAnimationTime) {\n Logger.warnOnce(\n \"Animation batch exceeded max animation time, skipping.\",\n new Map(this.controllers.entries())\n );\n this.stop();\n }\n }\n ready() {\n if (this.isReady)\n return;\n this.isReady = true;\n this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`, [...this.controllers]);\n let skipAll = true;\n for (const [, controller] of this.controllers) {\n if (controller.duration > 0 && PHASE_METADATA[controller.phase].skipIfNoEarlierAnimations !== true) {\n skipAll = false;\n break;\n }\n }\n if (!skipAll) {\n for (const [, controller] of this.controllers) {\n if (controller.autoplay) {\n controller.play(true);\n }\n }\n }\n }\n skip(skip = true) {\n if (this.skipAnimations === false && skip === true) {\n for (const controller of this.controllers.values()) {\n controller.stop();\n }\n this.controllers.clear();\n }\n this.skipAnimations = skip;\n }\n play() {\n for (const controller of this.controllers.values()) {\n controller.play();\n }\n }\n pause() {\n for (const controller of this.controllers.values()) {\n controller.pause();\n }\n }\n stop() {\n for (const controller of this.controllers.values()) {\n try {\n controller.stop();\n this.removeAnimation(controller);\n } catch (error) {\n Logger.error(\"Error during animation stop\", error);\n }\n }\n this.dispatchStopped();\n }\n stopByAnimationId(id) {\n if (id != null && this.controllers.has(id)) {\n const controller = this.controllers.get(id);\n if (controller) {\n controller.stop();\n this.removeAnimation(controller);\n }\n }\n }\n stopByAnimationGroupId(id) {\n for (const controller of this.controllers.values()) {\n if (controller.groupId === id) {\n this.stopByAnimationId(controller.id);\n }\n }\n }\n dispatchStopped() {\n this.stoppedCbs.forEach((cb) => cb());\n this.stoppedCbs.clear();\n }\n isSkipped() {\n return this.skipAnimations;\n }\n destroy() {\n this.stop();\n this.controllers.clear();\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/baseManager.ts\nvar BaseManager = class {\n constructor() {\n this.listeners = new Listeners();\n this.destroyFns = [];\n }\n addListener(type, handler) {\n return this.listeners.addListener(type, handler);\n }\n removeListener(listenerSymbol) {\n this.listeners.removeListener(listenerSymbol);\n }\n destroy() {\n this.listeners.destroy();\n this.destroyFns.forEach((fn) => fn());\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/consumableEvent.ts\nfunction buildConsumable(obj) {\n const builtEvent = __spreadProps(__spreadValues({}, obj), {\n consumed: false,\n consume() {\n var _a, _b;\n builtEvent.consumed = true;\n if (obj.sourceEvent instanceof Event) {\n (_a = obj.sourceEvent) == null ? void 0 : _a.preventDefault();\n } else {\n (_b = obj.sourceEvent) == null ? void 0 : _b.consume();\n }\n }\n });\n return builtEvent;\n}\nfunction buildConsumptionHandler() {\n return (handler, e) => {\n if (!e.consumed) {\n handler(e);\n }\n };\n}\nfunction dispatchTypedConsumable(listeners, type, event) {\n listeners.dispatchWrapHandlers(type, buildConsumptionHandler(), event);\n}\n\n// packages/ag-charts-community/src/chart/interaction/interactionManager.ts\nvar POINTER_INTERACTION_TYPES = [\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"hover\",\n \"drag-start\",\n \"drag\",\n \"drag-end\",\n \"leave\",\n \"enter\",\n \"page-left\",\n \"wheel\"\n];\nvar FOCUS_INTERACTION_TYPES = [\"blur\", \"focus\"];\nvar KEY_INTERACTION_TYPES = [\"keydown\", \"keyup\"];\nvar WINDOW_EVENT_HANDLERS = [\"pagehide\", \"mousemove\", \"mouseup\"];\nvar EVENT_HANDLERS = [\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"mousedown\",\n \"mouseout\",\n \"mouseenter\",\n \"touchstart\",\n \"touchmove\",\n \"touchend\",\n \"touchcancel\",\n \"wheel\",\n \"blur\",\n \"focus\",\n \"keydown\",\n \"keyup\"\n];\nvar CSS = `\n.ag-chart-wrapper {\n touch-action: none;\n}\n`;\nvar InteractionState = /* @__PURE__ */ ((InteractionState2) => {\n InteractionState2[InteractionState2[\"Default\"] = 16] = \"Default\";\n InteractionState2[InteractionState2[\"ZoomDrag\"] = 8] = \"ZoomDrag\";\n InteractionState2[InteractionState2[\"Annotations\"] = 4] = \"Annotations\";\n InteractionState2[InteractionState2[\"ContextMenu\"] = 2] = \"ContextMenu\";\n InteractionState2[InteractionState2[\"Animation\"] = 1] = \"Animation\";\n InteractionState2[InteractionState2[\"All\"] = 31] = \"All\";\n return InteractionState2;\n})(InteractionState || {});\nvar _InteractionManager = class _InteractionManager extends BaseManager {\n constructor(keyboardOptions, element2) {\n super();\n this.keyboardOptions = keyboardOptions;\n this.debug = Debug.create(true, \"interaction\");\n this.eventHandler = (event) => this.processEvent(event);\n this.mouseDown = false;\n this.touchDown = false;\n this.clickHistory = [{ offsetX: NaN, offsetY: NaN, type: \"mousedown\" }];\n this.dblclickHistory = [\n { offsetX: NaN, offsetY: NaN, type: \"mousedown\" },\n { offsetX: NaN, offsetY: NaN, type: \"mouseup\" },\n { offsetX: NaN, offsetY: NaN, type: \"mousedown\" }\n ];\n this.stateQueue = 16 /* Default */ | 1 /* Animation */;\n this.rootElement = getDocument(\"body\");\n this.element = element2;\n for (const type of EVENT_HANDLERS) {\n if (type.startsWith(\"touch\")) {\n element2.addEventListener(type, this.eventHandler, { passive: true });\n } else if (type === \"wheel\") {\n element2.addEventListener(type, this.eventHandler, { passive: false });\n } else {\n element2.addEventListener(type, this.eventHandler);\n }\n }\n for (const type of WINDOW_EVENT_HANDLERS) {\n getWindow().addEventListener(type, this.eventHandler);\n }\n injectStyle(CSS, \"interactionManager\");\n }\n destroy() {\n super.destroy();\n for (const type of WINDOW_EVENT_HANDLERS) {\n getWindow().removeEventListener(type, this.eventHandler);\n }\n for (const type of EVENT_HANDLERS) {\n this.element.removeEventListener(type, this.eventHandler);\n }\n }\n // Wrapper to only broadcast events when the InteractionManager is a given state.\n addListener(type, handler, triggeringStates = 16 /* Default */) {\n return super.addListener(type, (e) => {\n const currentState = this.getState();\n if (currentState & triggeringStates) {\n handler(e);\n }\n });\n }\n pushState(state) {\n this.stateQueue |= state;\n }\n popState(state) {\n this.stateQueue &= ~state;\n }\n getState() {\n return this.stateQueue & -this.stateQueue;\n }\n processEvent(event) {\n const types = this.decideInteractionEventTypes(event);\n if (types.length > 0) {\n this.dispatchEvent(event, types).catch((e) => Logger.errorOnce(e));\n }\n }\n dispatchEvent(event, types) {\n return __async(this, null, function* () {\n if (allInStringUnion(POINTER_INTERACTION_TYPES, types)) {\n this.dispatchPointerEvent(event, types);\n } else if (allInStringUnion(FOCUS_INTERACTION_TYPES, types)) {\n for (const type of types) {\n dispatchTypedConsumable(\n this.listeners,\n type,\n buildConsumable({ type, sourceEvent: event })\n );\n }\n } else if (allInStringUnion(KEY_INTERACTION_TYPES, types)) {\n for (const type of types) {\n dispatchTypedConsumable(\n this.listeners,\n type,\n buildConsumable({ type, sourceEvent: event })\n );\n }\n }\n });\n }\n dispatchPointerEvent(event, types) {\n const coords = this.calculateCoordinates(event);\n if (coords == null) {\n return;\n }\n for (const type of types) {\n dispatchTypedConsumable(this.listeners, type, this.buildPointerEvent(__spreadValues({ type, event }, coords)));\n }\n }\n recordDown(event) {\n if (event instanceof MouseEvent) {\n partialAssign([\"offsetX\", \"offsetY\"], this.clickHistory[0], event);\n partialAssign([\"offsetX\", \"offsetY\"], this.dblclickHistory[2], this.dblclickHistory[0]);\n partialAssign([\"offsetX\", \"offsetY\"], this.dblclickHistory[0], event);\n }\n this.dragStartElement = event.target;\n }\n recordUp(event) {\n if (event instanceof MouseEvent) {\n partialAssign([\"offsetX\", \"offsetY\"], this.dblclickHistory[1], event);\n }\n this.dragStartElement = void 0;\n }\n decideInteractionEventTypes(event) {\n const dragStart = \"drag-start\";\n switch (event.type) {\n case \"blur\":\n case \"focus\":\n case \"keydown\":\n case \"keyup\":\n return this.keyboardOptions.enabled ? [event.type] : [];\n case \"click\":\n case \"dblclick\":\n case \"contextmenu\":\n case \"wheel\":\n return [event.type];\n case \"mousedown\":\n if (!this.isEventOverElement(event)) {\n return [];\n }\n this.mouseDown = true;\n this.recordDown(event);\n return [dragStart];\n case \"touchstart\":\n if (!this.isEventOverElement(event)) {\n return [];\n }\n this.touchDown = true;\n this.recordDown(event);\n return [dragStart];\n case \"touchmove\":\n case \"mousemove\":\n if (!this.mouseDown && !this.touchDown && !this.isEventOverElement(event)) {\n return [];\n }\n return this.mouseDown || this.touchDown ? [\"drag\"] : [\"hover\"];\n case \"mouseup\":\n if (!this.mouseDown && !this.isEventOverElement(event)) {\n return [];\n }\n this.mouseDown = false;\n this.recordUp(event);\n return [\"drag-end\"];\n case \"touchend\":\n if (!this.touchDown && !this.isEventOverElement(event)) {\n return [];\n }\n this.touchDown = false;\n this.recordUp(event);\n return [\"drag-end\"];\n case \"mouseout\":\n case \"touchcancel\":\n return [\"leave\"];\n case \"mouseenter\":\n const mouseButtonDown = event instanceof MouseEvent && (event.buttons & 1) === 1;\n if (this.mouseDown !== mouseButtonDown) {\n this.mouseDown = mouseButtonDown;\n return [mouseButtonDown ? dragStart : \"drag-end\"];\n }\n return [\"enter\"];\n case \"pagehide\":\n return [\"page-left\"];\n }\n return [];\n }\n isEventOverElement(event) {\n var _a, _b, _c;\n return event.target === this.element || ((_a = event.target) == null ? void 0 : _a.parentElement) === this.element || ((_c = (_b = event.target) == null ? void 0 : _b.parentElement) == null ? void 0 : _c.parentElement) === this.element;\n }\n calculateCoordinates(event) {\n var _a;\n if (event instanceof MouseEvent) {\n return this.getMouseEventCoords(event);\n } else if (typeof TouchEvent !== \"undefined\" && event instanceof TouchEvent) {\n const lastTouch = (_a = event.touches[0]) != null ? _a : event.changedTouches[0];\n const { clientX, clientY, pageX, pageY } = lastTouch;\n return __spreadProps(__spreadValues({}, _InteractionManager.NULL_COORDS), { clientX, clientY, pageX, pageY });\n } else if (event instanceof PageTransitionEvent) {\n if (event.persisted) {\n return;\n }\n return _InteractionManager.NULL_COORDS;\n }\n }\n getMouseEventCoords(event) {\n const { clientX, clientY, pageX, pageY } = event;\n let { offsetX, offsetY } = event;\n const offsets = (el) => {\n let x = 0;\n let y = 0;\n while (el) {\n x += el.offsetLeft;\n y += el.offsetTop;\n el = el.offsetParent;\n }\n return { x, y };\n };\n if (this.dragStartElement != null && event.target !== this.dragStartElement) {\n const offsetDragStart = offsets(this.dragStartElement);\n const offsetEvent = offsets(event.target);\n offsetX -= offsetDragStart.x - offsetEvent.x;\n offsetY -= offsetDragStart.y - offsetEvent.y;\n }\n return { clientX, clientY, pageX, pageY, offsetX, offsetY };\n }\n isWheelEvent(event) {\n return event.type === \"wheel\";\n }\n buildPointerEvent(opts) {\n const { type, event, clientX, clientY } = opts;\n let { offsetX, offsetY, pageX, pageY } = opts;\n if (!isFiniteNumber(offsetX) || !isFiniteNumber(offsetY)) {\n const rect = this.element.getBoundingClientRect();\n offsetX = clientX - rect.left;\n offsetY = clientY - rect.top;\n }\n if (!isFiniteNumber(pageX) || !isFiniteNumber(pageY)) {\n const pageRect = this.rootElement.getBoundingClientRect();\n pageX = clientX - pageRect.left;\n pageY = clientY - pageRect.top;\n }\n let [deltaX, deltaY] = [NaN, NaN];\n if (this.isWheelEvent(event)) {\n const factor = event.deltaMode === 0 ? 0.01 : 1;\n deltaX = event.deltaX * factor;\n deltaY = event.deltaY * factor;\n }\n let pointerHistory = [];\n if (event.type === \"click\") {\n pointerHistory = this.clickHistory;\n } else if (event.type === \"dblclick\") {\n pointerHistory = this.dblclickHistory;\n }\n const builtEvent = buildConsumable({\n type,\n offsetX,\n offsetY,\n pageX,\n pageY,\n deltaX,\n deltaY,\n pointerHistory,\n sourceEvent: event\n });\n this.debug(\"InteractionManager - builtEvent: \", builtEvent);\n return builtEvent;\n }\n};\n_InteractionManager.NULL_COORDS = {\n clientX: -Infinity,\n clientY: -Infinity,\n pageX: -Infinity,\n pageY: -Infinity,\n offsetX: -Infinity,\n offsetY: -Infinity\n};\nvar InteractionManager = _InteractionManager;\n\n// packages/ag-charts-community/src/chart/interaction/animationManager.ts\nfunction validAnimationDuration(testee) {\n if (testee == null)\n return true;\n return !isNaN(testee) && testee >= 0 && testee <= 2;\n}\nvar AnimationManager = class extends BaseManager {\n constructor(interactionManager, chartUpdateMutex) {\n super();\n this.interactionManager = interactionManager;\n this.chartUpdateMutex = chartUpdateMutex;\n this.defaultDuration = 1e3;\n this.batch = new AnimationBatch(this.defaultDuration * 1.5);\n this.debug = Debug.create(true, \"animation\");\n this.rafAvailable = typeof requestAnimationFrame !== \"undefined\";\n this.isPlaying = false;\n this.requestId = null;\n this.skipAnimations = false;\n }\n /**\n * Create an animation to tween a value between the `from` and `to` properties. If an animation already exists\n * with the same `id`, immediately stop it.\n */\n animate(_a) {\n var opts = __objRest(_a, []);\n var _a2;\n const batch = this.batch;\n try {\n batch.checkOverlappingId(opts.id);\n } catch (error) {\n this.failsafeOnError(error);\n return;\n }\n const id = (_a2 = opts.id) != null ? _a2 : Math.random().toString();\n const skip = this.isSkipped() || opts.phase === \"none\";\n if (skip) {\n this.debug(\"AnimationManager - skipping animation\");\n }\n const { delay, duration } = opts;\n if (!validAnimationDuration(delay)) {\n throw new Error(`Animation delay of ${delay} is unsupported (${id})`);\n }\n if (!validAnimationDuration(duration)) {\n throw new Error(`Animation duration of ${duration} is unsupported (${id})`);\n }\n const animation = new Animation(__spreadProps(__spreadValues({}, opts), {\n id,\n skip,\n autoplay: this.isPlaying ? opts.autoplay : false,\n phase: opts.phase,\n defaultDuration: this.defaultDuration\n }));\n if (this.forceTimeJump(animation, this.defaultDuration)) {\n return;\n }\n this.batch.addAnimation(animation);\n return animation;\n }\n play() {\n if (this.isPlaying) {\n return;\n }\n this.isPlaying = true;\n this.debug(\"AnimationManager.play()\");\n try {\n this.batch.play();\n } catch (error) {\n this.failsafeOnError(error);\n }\n this.requestAnimation();\n }\n pause() {\n if (!this.isPlaying) {\n return;\n }\n this.isPlaying = false;\n this.cancelAnimation();\n this.debug(\"AnimationManager.pause()\");\n try {\n this.batch.pause();\n } catch (error) {\n this.failsafeOnError(error);\n }\n }\n stop() {\n this.isPlaying = false;\n this.cancelAnimation();\n this.debug(\"AnimationManager.stop()\");\n this.batch.stop();\n }\n stopByAnimationId(id) {\n try {\n this.batch.stopByAnimationId(id);\n } catch (error) {\n this.failsafeOnError(error);\n }\n }\n stopByAnimationGroupId(id) {\n try {\n this.batch.stopByAnimationGroupId(id);\n } catch (error) {\n this.failsafeOnError(error);\n }\n }\n reset() {\n if (this.isPlaying) {\n this.stop();\n this.play();\n } else {\n this.stop();\n }\n }\n skip(skip = true) {\n this.skipAnimations = skip;\n }\n isSkipped() {\n return !this.rafAvailable || this.skipAnimations || this.batch.isSkipped();\n }\n isActive() {\n return this.isPlaying && this.batch.isActive();\n }\n skipCurrentBatch() {\n if (this.debug.check()) {\n this.debug(`AnimationManager - skipCurrentBatch()`, { stack: new Error().stack });\n }\n this.batch.skip();\n }\n /** Mocking point for tests to guarantee that animation updates happen. */\n isSkippingFrames() {\n return true;\n }\n /** Mocking point for tests to capture requestAnimationFrame callbacks. */\n scheduleAnimationFrame(cb) {\n this.requestId = requestAnimationFrame(cb);\n }\n /** Mocking point for tests to skip animations to a specific point in time. */\n forceTimeJump(_animation, _defaultDuration) {\n return false;\n }\n requestAnimation() {\n if (!this.rafAvailable)\n return;\n if (!this.batch.isActive() || this.requestId !== null)\n return;\n let prevTime;\n const onAnimationFrame = (time2) => __async(this, null, function* () {\n const executeAnimationFrame = () => __async(this, null, function* () {\n const deltaTime = time2 - (prevTime != null ? prevTime : time2);\n prevTime = time2;\n this.debug(\"AnimationManager - onAnimationFrame()\", {\n controllersCount: this.batch.size,\n deltaTime\n });\n this.interactionManager.pushState(1 /* Animation */);\n try {\n this.batch.progress(deltaTime);\n } catch (error) {\n this.failsafeOnError(error);\n }\n this.listeners.dispatch(\"animation-frame\", {\n type: \"animation-frame\",\n deltaMs: deltaTime\n });\n });\n if (this.isSkippingFrames()) {\n yield this.chartUpdateMutex.acquireImmediately(executeAnimationFrame);\n } else {\n yield this.chartUpdateMutex.acquire(executeAnimationFrame);\n }\n if (this.batch.isActive()) {\n this.scheduleAnimationFrame(onAnimationFrame);\n } else {\n this.batch.stop();\n this.listeners.dispatch(\"animation-stop\", {\n type: \"animation-stop\",\n deltaMs: this.batch.consumedTimeMs\n });\n }\n });\n this.listeners.dispatch(\"animation-start\", {\n type: \"animation-start\",\n deltaMs: 0\n });\n this.scheduleAnimationFrame(onAnimationFrame);\n }\n cancelAnimation() {\n if (this.requestId === null)\n return;\n cancelAnimationFrame(this.requestId);\n this.requestId = null;\n this.startBatch();\n }\n failsafeOnError(error, cancelAnimation = true) {\n Logger.error(\"Error during animation, skipping animations\", error);\n if (cancelAnimation) {\n this.cancelAnimation();\n }\n }\n startBatch(skipAnimations) {\n this.debug(`AnimationManager - startBatch() with skipAnimations=${skipAnimations}.`);\n this.reset();\n this.batch.stop();\n this.batch.destroy();\n this.batch = new AnimationBatch(this.defaultDuration * 1.5);\n if (skipAnimations === true) {\n this.batch.skip();\n }\n }\n endBatch() {\n if (this.batch.isActive()) {\n this.batch.ready();\n this.requestAnimation();\n } else {\n this.interactionManager.popState(1 /* Animation */);\n if (this.batch.isSkipped()) {\n this.batch.skip(false);\n }\n }\n }\n onBatchStop(cb) {\n this.batch.stoppedCbs.add(cb);\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/ariaAnnouncementServices.ts\nvar AriaAnnouncementService = class _AriaAnnouncementService {\n constructor(canvas) {\n this.canvas = canvas;\n this.debug = Debug.create(true, \"aria\");\n this.canvas.appendChild(this.liveElem = _AriaAnnouncementService.createAnnouncer());\n }\n static createAnnouncer() {\n const e = getDocument().createElement(\"div\");\n e.classList.add(\"ag-charts-aria-announcer\");\n setAttribute(e, \"role\", \"status\");\n setAttribute(e, \"aria-live\", \"assertive\");\n return e;\n }\n destroy() {\n this.canvas.removeChild(this.liveElem);\n }\n announceValue(value) {\n this.debug(`AriaAnnouncementService - announceValue: ${value}`);\n this.liveElem.textContent = value;\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/chartEventManager.ts\nvar ChartEventManager = class extends BaseManager {\n legendItemClick(series, itemId, enabled, legendItemName) {\n const event = {\n type: \"legend-item-click\",\n series,\n itemId,\n enabled,\n legendItemName\n };\n this.listeners.dispatch(\"legend-item-click\", event);\n }\n legendItemDoubleClick(series, itemId, enabled, numVisibleItems, legendItemName) {\n const event = {\n type: \"legend-item-double-click\",\n series,\n itemId,\n enabled,\n legendItemName,\n numVisibleItems\n };\n this.listeners.dispatch(\"legend-item-double-click\", event);\n }\n axisHover(axisId, direction) {\n const event = {\n type: \"axis-hover\",\n axisId,\n direction\n };\n this.listeners.dispatch(\"axis-hover\", event);\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/contextMenuRegistry.ts\nvar ContextMenuRegistry = class {\n constructor() {\n this.defaultActions = [];\n this.disabledActions = /* @__PURE__ */ new Set();\n }\n copyDefaultActions() {\n return [...this.defaultActions];\n }\n registerDefaultAction(action) {\n if (action.id && this.defaultActions.find(({ id }) => id === action.id)) {\n return;\n }\n this.defaultActions.push(action);\n }\n enableAction(actionId) {\n this.disabledActions.delete(actionId);\n }\n disableAction(actionId) {\n this.disabledActions.add(actionId);\n }\n isDisabled(actionId) {\n return this.disabledActions.has(actionId);\n }\n};\n\n// packages/ag-charts-community/src/util/stateTracker.ts\nvar StateTracker = class extends Map {\n constructor(defaultValue, defaultState) {\n super();\n this.defaultValue = defaultValue;\n this.defaultState = defaultState;\n }\n set(key, value) {\n this.delete(key);\n if (typeof value !== \"undefined\") {\n super.set(key, value);\n }\n return this;\n }\n stateId() {\n var _a;\n return (_a = Array.from(this.keys()).pop()) != null ? _a : this.defaultState;\n }\n stateValue() {\n var _a;\n return (_a = Array.from(this.values()).pop()) != null ? _a : this.defaultValue;\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/cursorManager.ts\nvar CursorManager = class {\n constructor(element2) {\n this.element = element2;\n this.stateTracker = new StateTracker(\"default\");\n }\n updateCursor(callerId, style) {\n this.stateTracker.set(callerId, style);\n this.element.style.cursor = this.stateTracker.stateValue();\n }\n getCursor() {\n return this.element.style.cursor;\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/gestureDetector.ts\nfunction distanceSquared(finger1, finger2) {\n const dx = finger1.screenX - finger2.screenX;\n const dy = finger1.screenY - finger2.screenY;\n return dx * dx + dy * dy;\n}\nfunction distance(finger1, finger2) {\n return Math.sqrt(distanceSquared(finger1, finger2));\n}\nvar MIN_DISTANCE_TO_START_PINCH = 1;\nvar GestureDetector = class extends BaseManager {\n constructor(element2) {\n super();\n this.touchstart = (event) => this.onTouchStart(event);\n this.touchmove = (event) => this.onTouchMove(event);\n this.touchend = (event) => this.onTouchEnd(event);\n this.touchcancel = (event) => this.onTouchCancel(event);\n this.pinch = {\n finger1: { identifier: NaN, screenX: NaN, screenY: NaN },\n finger2: { identifier: NaN, screenX: NaN, screenY: NaN },\n origin: { x: NaN, y: NaN },\n distance: NaN,\n status: 0 /* Off */\n };\n this.element = element2;\n element2.addEventListener(\"touchstart\", this.touchstart, { passive: true });\n element2.addEventListener(\"touchmove\", this.touchmove, { passive: true });\n element2.addEventListener(\"touchend\", this.touchend);\n element2.addEventListener(\"touchcancel\", this.touchcancel);\n }\n destroy() {\n const { element: element2 } = this;\n element2.removeEventListener(\"touchstart\", this.touchstart);\n element2.removeEventListener(\"touchmove\", this.touchmove);\n element2.removeEventListener(\"touchend\", this.touchend);\n element2.removeEventListener(\"touchcancel\", this.touchcancel);\n }\n findPinchTouches(moveEvent) {\n const { touches } = moveEvent;\n const { finger1, finger2 } = this.pinch;\n if (this.pinch.status !== 0 /* Off */ && touches.length === 2) {\n if (touches[0].identifier === finger1.identifier && touches[1].identifier === finger2.identifier) {\n return [touches[0], touches[1]];\n }\n if (touches[0].identifier === finger2.identifier && touches[1].identifier === finger1.identifier) {\n return [touches[1], touches[0]];\n }\n }\n }\n copyTouchData(event) {\n const keys = [\"identifier\", \"screenX\", \"screenY\"];\n partialAssign(keys, this.pinch.finger1, event.touches[0]);\n partialAssign(keys, this.pinch.finger2, event.touches[1]);\n this.pinch.distance = distance(this.pinch.finger1, this.pinch.finger2);\n }\n dispatchPinchEvent(type, deltaDistance) {\n const { finger1, finger2, origin } = this.pinch;\n const newEvent = { type, finger1, finger2, deltaDistance, origin };\n this.listeners.dispatch(type, newEvent);\n }\n onTouchStart(event) {\n this.stopPinchTracking();\n const { pinch } = this;\n if (event.touches.length === 2) {\n pinch.status = 1 /* Initialized */;\n this.copyTouchData(event);\n pinch.origin.x = (event.touches[0].clientX + event.touches[1].clientX) / 2;\n pinch.origin.y = (event.touches[0].clientY + event.touches[1].clientY) / 2;\n }\n }\n onTouchMove(event) {\n const pinchTouches = this.findPinchTouches(event);\n if (pinchTouches !== void 0) {\n const [touch1, touch2] = pinchTouches;\n const { pinch } = this;\n const newDistance = distance(touch1, touch2);\n const deltaDistance = newDistance - pinch.distance;\n if (pinch.status === 1 /* Initialized */) {\n if (Math.abs(deltaDistance) > MIN_DISTANCE_TO_START_PINCH) {\n pinch.status = 2 /* Running */;\n this.copyTouchData(event);\n this.dispatchPinchEvent(\"pinch-start\", 0);\n }\n } else if (pinch.status === 2 /* Running */) {\n pinch.distance = newDistance;\n this.copyTouchData(event);\n this.dispatchPinchEvent(\"pinch-move\", deltaDistance);\n } else {\n Logger.error(`unexpected pinch.status: ${pinch.status}`);\n }\n }\n }\n onTouchEnd(_event) {\n this.stopPinchTracking();\n }\n onTouchCancel(_event) {\n this.stopPinchTracking();\n }\n stopPinchTracking() {\n const { pinch } = this;\n if (pinch.status === 2 /* Running */) {\n this.dispatchPinchEvent(\"pinch-end\", 0);\n }\n this.pinch.status = 0 /* Off */;\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/highlightManager.ts\nvar HighlightManager = class extends BaseManager {\n constructor() {\n super(...arguments);\n this.highlightStates = new StateTracker();\n this.pickedStates = new StateTracker();\n }\n updateHighlight(callerId, highlightedDatum) {\n const { activeHighlight: previousHighlight } = this;\n this.highlightStates.set(callerId, highlightedDatum);\n this.activeHighlight = this.highlightStates.stateValue();\n if (!this.isEqual(this.activeHighlight, previousHighlight)) {\n this.listeners.dispatch(\"highlight-change\", {\n type: \"highlight-change\",\n currentHighlight: this.activeHighlight,\n previousHighlight\n });\n }\n }\n getActiveHighlight() {\n return this.activeHighlight;\n }\n updatePicked(callerId, clickableDatum) {\n this.pickedStates.set(callerId, clickableDatum);\n this.activePicked = this.pickedStates.stateValue();\n }\n getActivePicked() {\n return this.activePicked;\n }\n isEqual(a, b) {\n return a === b || (a == null ? void 0 : a.series) === (b == null ? void 0 : b.series) && (a == null ? void 0 : a.itemId) === (b == null ? void 0 : b.itemId) && (a == null ? void 0 : a.datum) === (b == null ? void 0 : b.datum);\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/keyNavManager.ts\nvar KeyNavManager = class extends BaseManager {\n constructor(interactionManager) {\n super();\n this.hasBrowserFocus = false;\n this.isMouseBlurred = false;\n this.isClicking = false;\n this.destroyFns.push(\n interactionManager.addListener(\"drag-start\", (e) => this.onClickStart(e), 31 /* All */),\n interactionManager.addListener(\"click\", (e) => this.onClickStop(e), 31 /* All */),\n interactionManager.addListener(\"drag-end\", (e) => this.onClickStop(e), 31 /* All */),\n interactionManager.addListener(\"wheel\", (e) => this.mouseBlur(e)),\n interactionManager.addListener(\"hover\", (e) => this.mouseBlur(e)),\n interactionManager.addListener(\"drag\", (e) => this.mouseBlur(e)),\n interactionManager.addListener(\"blur\", (e) => this.onBlur(e), 31 /* All */),\n interactionManager.addListener(\"focus\", (e) => this.onFocus(e), 31 /* All */),\n interactionManager.addListener(\"keydown\", (e) => this.onKeyDown(e), 31 /* All */)\n );\n }\n destroy() {\n super.destroy();\n }\n onClickStart(event) {\n this.isClicking = true;\n this.mouseBlur(event);\n }\n onClickStop(event) {\n this.isClicking = false;\n this.mouseBlur(event);\n }\n mouseBlur(event) {\n if (!this.hasBrowserFocus)\n return;\n if (!this.isMouseBlurred) {\n this.dispatch(\"blur\", 0, event);\n this.isMouseBlurred = true;\n }\n }\n onBlur(event) {\n this.hasBrowserFocus = false;\n this.isMouseBlurred = false;\n this.dispatch(\"blur\", 0, event);\n }\n onFocus(event) {\n this.hasBrowserFocus = true;\n if (this.isClicking) {\n this.isMouseBlurred = true;\n } else {\n this.dispatch(\"browserfocus\", 1, event);\n this.dispatch(\"tab\", 0, event);\n }\n }\n onKeyDown(event) {\n if (!this.hasBrowserFocus || this.isClicking)\n return;\n this.isMouseBlurred = false;\n switch (event.sourceEvent.code) {\n case \"Tab\":\n if (event.sourceEvent.shiftKey) {\n return this.dispatch(\"tab\", -1, event);\n } else {\n return this.dispatch(\"tab\", 1, event);\n }\n case \"ArrowDown\":\n return this.dispatch(\"nav-vert\", 1, event);\n case \"ArrowUp\":\n return this.dispatch(\"nav-vert\", -1, event);\n case \"ArrowLeft\":\n return this.dispatch(\"nav-hori\", -1, event);\n case \"ArrowRight\":\n return this.dispatch(\"nav-hori\", 1, event);\n case \"Space\":\n case \"Enter\":\n return this.dispatch(\"submit\", 0, event);\n }\n }\n dispatch(type, delta2, interactionEvent) {\n const event = buildConsumable({ type, delta: delta2, sourceEvent: interactionEvent });\n dispatchTypedConsumable(this.listeners, type, event);\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/focusStyles.ts\nvar focusStyles_exports = {};\n__export(focusStyles_exports, {\n block: () => block,\n css: () => css,\n elements: () => elements,\n modifiers: () => modifiers\n});\nvar block = \"ag-charts-focus\";\nvar elements = {\n wrapper: `${block}__wrapper`,\n indicator: `${block}__indicator`\n};\nvar modifiers = {\n hidden: `${block}--hidden`\n};\nvar css = `\n.${block}.${elements.wrapper} {\n position: relative;\n display: block;\n pointer-events: none;\n user-select: none;\n overflow: hidden;\n top: 0;\n left: 0;\n}\n\n.${block}.${elements.indicator} {\n position: absolute;\n display: block;\n pointer-events: none;\n user-select: none;\n border: var(--ag-charts-focus-border);\n box-shadow: var(--ag-charts-focus-border-shadow);\n}\n\n.${modifiers.hidden} {\n visibility: hidden;\n}\n`;\n\n// packages/ag-charts-community/src/chart/interaction/regionManager.ts\nvar REGION_TAB_ORDERING = [\"series\", \"legend\"];\nvar RegionListeners = class extends Listeners {\n};\nvar RegionManager = class {\n constructor(interactionManager, keyNavManager, canvasElement, element2) {\n this.interactionManager = interactionManager;\n this.keyNavManager = keyNavManager;\n this.canvasElement = canvasElement;\n this.currentTabIndex = 0;\n this.isDragging = false;\n this.leftCanvas = false;\n this.regions = /* @__PURE__ */ new Map();\n this.destroyFns = [];\n this.destroyFns.push(\n ...POINTER_INTERACTION_TYPES.map(\n (eventName) => interactionManager.addListener(eventName, this.processPointerEvent.bind(this), 31 /* All */)\n ),\n this.keyNavManager.addListener(\"blur\", this.onNav.bind(this)),\n this.keyNavManager.addListener(\"browserfocus\", this.onFocus.bind(this)),\n this.keyNavManager.addListener(\"tab\", this.onTab.bind(this)),\n this.keyNavManager.addListener(\"nav-vert\", this.onNav.bind(this)),\n this.keyNavManager.addListener(\"nav-hori\", this.onNav.bind(this)),\n this.keyNavManager.addListener(\"submit\", this.onNav.bind(this))\n );\n injectStyle(css, block);\n this.focusWrapper = getDocument().createElement(\"div\");\n this.focusIndicator = getDocument().createElement(\"div\");\n this.focusWrapper.appendChild(this.focusIndicator);\n element2.appendChild(this.focusWrapper);\n const { block: block3, elements: elements3, modifiers: modifiers3 } = focusStyles_exports;\n this.focusWrapper.classList.add(block3, elements3.wrapper);\n this.focusIndicator.classList.add(block3, elements3.indicator, modifiers3.hidden);\n }\n destroy() {\n this.destroyFns.forEach((fn) => fn());\n this.currentRegion = void 0;\n for (const region of this.regions.values()) {\n region.listeners.destroy();\n }\n this.focusWrapper.remove();\n this.regions.clear();\n }\n addRegionFromProperties(properties) {\n const region = { properties, listeners: new RegionListeners() };\n this.regions.set(properties.name, region);\n return this.makeObserver(region);\n }\n addRegion(name, bboxprovider, ...extraProviders) {\n return this.addRegionFromProperties({\n name,\n bboxproviders: [bboxprovider, ...extraProviders],\n canInteraction: () => true\n });\n }\n getRegion(name) {\n return this.makeObserver(this.regions.get(name));\n }\n find(x, y) {\n const matches = [];\n for (const [_name, region] of this.regions.entries()) {\n for (const provider of region.properties.bboxproviders) {\n const bbox = provider.getCachedBBox();\n if (bbox.containsPoint(x, y)) {\n matches.push([region, bbox.width * bbox.height]);\n }\n }\n }\n return matches.sort((a, b) => a[1] - b[1]).map((m) => m[0]);\n }\n // This method return a wrapper object that matches the interface of InteractionManager.addListener.\n // The intent is to allow the InteractionManager and RegionManager to be used almost interchangeably.\n makeObserver(region) {\n const { interactionManager } = this;\n class ObservableRegionImplementation {\n addListener(type, handler, triggeringStates = 16 /* Default */) {\n var _a;\n return (_a = region == null ? void 0 : region.listeners.addListener(type, (e) => {\n if (!e.consumed) {\n const currentState = interactionManager.getState();\n if (currentState & triggeringStates) {\n handler(e);\n }\n }\n })) != null ? _a : () => {\n };\n }\n }\n return new ObservableRegionImplementation();\n }\n checkPointerHistory(targetRegion, event) {\n for (const historyEvent of event.pointerHistory) {\n const historyRegion = this.pickRegion(historyEvent.offsetX, historyEvent.offsetY);\n if (targetRegion.properties.name !== (historyRegion == null ? void 0 : historyRegion.properties.name)) {\n return false;\n }\n }\n return true;\n }\n dispatch(region, event) {\n region == null ? void 0 : region.listeners.dispatch(event.type, event);\n }\n // Process events during a drag action. Returns false if this event should follow the standard\n // RegionManager.processEvent flow, or true if this event already processed by this function.\n handleDragging(event) {\n const { currentRegion } = this;\n switch (event.type) {\n case \"drag-start\":\n this.isDragging = true;\n this.leftCanvas = false;\n break;\n case \"leave\":\n this.leftCanvas = true;\n return this.isDragging;\n case \"enter\":\n this.leftCanvas = false;\n return this.isDragging;\n case \"drag\":\n if (this.isDragging) {\n this.dispatch(currentRegion, event);\n return true;\n }\n break;\n case \"drag-end\":\n if (this.isDragging) {\n this.isDragging = false;\n this.dispatch(currentRegion, event);\n if (this.leftCanvas) {\n this.dispatch(currentRegion, __spreadProps(__spreadValues({}, event), { type: \"leave\" }));\n }\n return true;\n }\n break;\n }\n return false;\n }\n processPointerEvent(event) {\n if (this.handleDragging(event)) {\n return;\n }\n const { currentRegion } = this;\n const newRegion = this.pickRegion(event.offsetX, event.offsetY);\n if (currentRegion !== void 0 && (newRegion == null ? void 0 : newRegion.properties.name) !== currentRegion.properties.name) {\n this.dispatch(currentRegion, __spreadProps(__spreadValues({}, event), { type: \"leave\" }));\n }\n if (newRegion !== void 0 && newRegion.properties.name !== (currentRegion == null ? void 0 : currentRegion.properties.name)) {\n this.dispatch(newRegion, __spreadProps(__spreadValues({}, event), { type: \"enter\" }));\n }\n if (newRegion !== void 0 && this.checkPointerHistory(newRegion, event)) {\n this.dispatch(newRegion, event);\n }\n this.currentRegion = newRegion;\n }\n pickRegion(x, y) {\n const matchingRegions = this.find(x, y);\n return matchingRegions.length > 0 ? matchingRegions[0] : void 0;\n }\n getTabRegion(tabIndex) {\n if (tabIndex !== void 0 && tabIndex >= 0 && tabIndex < REGION_TAB_ORDERING.length) {\n return this.regions.get(REGION_TAB_ORDERING[tabIndex]);\n }\n return void 0;\n }\n dispatchTabStart(event) {\n const { delta: delta2, sourceEvent } = event;\n const startEvent = buildConsumable({\n type: \"tab-start\",\n delta: delta2,\n sourceEvent\n });\n const focusedRegion = this.getTabRegion(this.currentTabIndex);\n this.dispatch(focusedRegion, startEvent);\n return !!startEvent.consumed;\n }\n getNextInteractableTabIndex(currentIndex, delta2) {\n const direction = delta2 < 0 ? -1 : 1;\n let i = currentIndex;\n while (delta2 !== 0) {\n const region = this.getTabRegion(i + direction);\n if (region === void 0) {\n return void 0;\n } else if (region.properties.canInteraction()) {\n delta2 = delta2 - direction;\n }\n i = i + direction;\n }\n return i;\n }\n validateCurrentTabIndex() {\n var _a;\n const focusedRegion = this.getTabRegion(this.currentTabIndex);\n if (focusedRegion !== void 0 && !focusedRegion.properties.canInteraction()) {\n this.currentTabIndex = (_a = this.getNextInteractableTabIndex(-1, 1)) != null ? _a : 0;\n }\n }\n onFocus(event) {\n const { delta: delta2, sourceEvent } = event;\n const newIndex = delta2 > 0 ? this.getNextInteractableTabIndex(-1, 1) : this.getNextInteractableTabIndex(REGION_TAB_ORDERING.length, -1);\n this.currentTabIndex = newIndex != null ? newIndex : 0;\n const focusedRegion = this.getTabRegion(this.currentTabIndex);\n if (focusedRegion) {\n this.dispatch(focusedRegion, buildConsumable({ type: \"tab\", delta: delta2, sourceEvent }));\n }\n }\n onTab(event) {\n const consumed = this.dispatchTabStart(event);\n if (consumed)\n return;\n this.validateCurrentTabIndex();\n const newTabIndex = this.getNextInteractableTabIndex(this.currentTabIndex, event.delta);\n const newRegion = this.getTabRegion(newTabIndex);\n const focusedRegion = this.getTabRegion(this.currentTabIndex);\n if (newTabIndex !== void 0) {\n this.currentTabIndex = newTabIndex;\n }\n if (focusedRegion !== void 0 && (newRegion == null ? void 0 : newRegion.properties.name) !== focusedRegion.properties.name) {\n const { delta: delta2, sourceEvent } = event;\n const blurEvent = buildConsumable({ type: \"blur\", delta: delta2, sourceEvent });\n this.dispatch(focusedRegion, blurEvent);\n }\n if (newRegion === void 0 || !newRegion.properties.canInteraction()) {\n this.updateFocusIndicatorRect(void 0);\n } else {\n this.dispatch(newRegion, event);\n }\n }\n onNav(event) {\n const focusedRegion = this.getTabRegion(this.currentTabIndex);\n this.dispatch(focusedRegion, event);\n }\n updateFocusWrapperRect() {\n this.focusWrapper.style.width = this.canvasElement.style.width;\n this.focusWrapper.style.height = this.canvasElement.style.height;\n }\n updateFocusIndicatorRect(rect) {\n if (rect == null) {\n this.focusIndicator.classList.add(modifiers.hidden);\n return;\n }\n this.updateFocusWrapperRect();\n this.focusIndicator.classList.remove(modifiers.hidden);\n this.focusIndicator.style.width = `${rect.width}px`;\n this.focusIndicator.style.height = `${rect.height}px`;\n this.focusIndicator.style.left = `${rect.x}px`;\n this.focusIndicator.style.top = `${rect.y}px`;\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/toolbarManager.ts\nvar ToolbarManager = class extends BaseManager {\n constructor(element2) {\n super();\n this.element = element2;\n }\n static isGroup(group2, event) {\n return event.group === group2;\n }\n pressButton(group2, value) {\n this.listeners.dispatch(\"button-pressed\", { type: \"button-pressed\", group: group2, value });\n }\n toggleGroup(group2, visible) {\n this.listeners.dispatch(\"group-toggled\", { type: \"group-toggled\", group: group2, visible });\n }\n toggleButton(group2, value, enabled) {\n this.listeners.dispatch(\"button-toggled\", { type: \"button-toggled\", group: group2, value, enabled });\n }\n proxyGroupOptions(group2, options) {\n this.listeners.dispatch(\"proxy-group-options\", { type: \"proxy-group-options\", group: group2, options });\n }\n};\n\n// packages/ag-charts-community/src/chart/interaction/tooltipManager.ts\nvar defaultTooltipCss = `\n.${DEFAULT_TOOLTIP_CLASS} {\n transition: transform 0.1s ease;\n max-width: 100%;\n position: fixed;\n left: 0px;\n top: 0px;\n z-index: 99999;\n font: 12px Verdana, sans-serif;\n color: rgb(70, 70, 70);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-wrap-always {\n overflow-wrap: break-word;\n word-break: break-word;\n hyphens: none;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-wrap-hyphenate {\n overflow-wrap: break-word;\n word-break: break-word;\n hyphens: auto;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-wrap-on-space {\n overflow-wrap: normal;\n word-break: normal;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-wrap-never {\n white-space: pre;\n text-overflow: ellipsis;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-no-interaction {\n pointer-events: none;\n user-select: none;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-no-animation {\n transition: none !important;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-hidden {\n visibility: hidden;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-title {\n overflow: hidden;\n position: relative;\n padding: 8px 14px;\n border-top-left-radius: 2px;\n border-top-right-radius: 2px;\n color: white;\n background-color: #888888;\n z-index: 1;\n text-overflow: inherit;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-title:only-child {\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-content {\n overflow: hidden;\n padding: 6px 14px;\n line-height: 1.7em;\n background: white;\n border-bottom-left-radius: 2px;\n border-bottom-right-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.15);\n overflow: hidden;\n text-overflow: inherit;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-arrow::before {\n content: \"\";\n\n position: absolute;\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n\n border: 5px solid #d9d9d9;\n\n border-left-color: transparent;\n border-right-color: transparent;\n border-bottom-color: transparent;\n\n width: 0;\n height: 0;\n\n margin: 0 auto;\n}\n\n.${DEFAULT_TOOLTIP_CLASS}-arrow::after {\n content: \"\";\n\n position: absolute;\n top: calc(100% - 1px);\n left: 50%;\n transform: translateX(-50%);\n\n border: 5px solid white;\n\n border-left-color: transparent;\n border-right-color: transparent;\n border-bottom-color: transparent;\n\n width: 0;\n height: 0;\n\n margin: 0 auto;\n}\n\n.ag-chart-wrapper {\n box-sizing: border-box;\n overflow: hidden;\n}\n`;\nvar TooltipManager = class {\n constructor(canvasElement, tooltip) {\n this.canvasElement = canvasElement;\n this.tooltip = tooltip;\n this.stateTracker = new StateTracker();\n this.appliedState = null;\n if (typeof IntersectionObserver !== \"undefined\") {\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.target === this.canvasElement && entry.intersectionRatio === 0) {\n this.tooltip.toggle(false);\n }\n }\n },\n { root: this.tooltip.root }\n );\n observer.observe(this.canvasElement);\n this.observer = observer;\n }\n injectStyle(defaultTooltipCss, \"tooltip\");\n }\n updateTooltip(callerId, meta, content) {\n var _a;\n if (!this.tooltip.enabled)\n return;\n content != null ? content : content = (_a = this.stateTracker.get(callerId)) == null ? void 0 : _a.content;\n this.stateTracker.set(callerId, { content, meta });\n this.applyStates();\n }\n removeTooltip(callerId) {\n if (!this.tooltip.enabled)\n return;\n this.stateTracker.delete(callerId);\n this.applyStates();\n }\n getTooltipMeta(callerId) {\n var _a;\n return (_a = this.stateTracker.get(callerId)) == null ? void 0 : _a.meta;\n }\n destroy() {\n var _a;\n (_a = this.observer) == null ? void 0 : _a.unobserve(this.canvasElement);\n }\n applyStates() {\n var _a;\n const id = this.stateTracker.stateId();\n const state = id ? this.stateTracker.get(id) : null;\n if ((state == null ? void 0 : state.meta) == null || (state == null ? void 0 : state.content) == null) {\n this.appliedState = null;\n this.tooltip.toggle(false);\n return;\n }\n const canvasRect = this.canvasElement.getBoundingClientRect();\n if (((_a = this.appliedState) == null ? void 0 : _a.content) === (state == null ? void 0 : state.content)) {\n const renderInstantly = this.tooltip.isVisible();\n this.tooltip.show(canvasRect, state == null ? void 0 : state.meta, null, renderInstantly);\n } else {\n this.tooltip.show(canvasRect, state == null ? void 0 : state.meta, state == null ? void 0 : state.content);\n }\n this.appliedState = state;\n }\n static makeTooltipMeta(event, datum) {\n var _a, _b, _c, _d, _e, _f, _g;\n const { offsetX, offsetY } = event;\n const { tooltip } = datum.series.properties;\n const meta = {\n offsetX,\n offsetY,\n enableInteraction: (_b = (_a = tooltip.interaction) == null ? void 0 : _a.enabled) != null ? _b : false,\n lastPointerEvent: { type: event.type, offsetX, offsetY },\n showArrow: tooltip.showArrow,\n position: {\n type: tooltip.position.type,\n xOffset: tooltip.position.xOffset,\n yOffset: tooltip.position.yOffset\n }\n };\n const refPoint = (_g = (_d = (_c = datum.yBar) == null ? void 0 : _c.upperPoint) != null ? _d : datum.midPoint) != null ? _g : (_f = (_e = datum.series).datumMidPoint) == null ? void 0 : _f.call(_e, datum);\n if (tooltip.position.type === \"node\" && refPoint) {\n const { x, y } = refPoint;\n const point = datum.series.contentGroup.inverseTransformPoint(x, y);\n return __spreadProps(__spreadValues({}, meta), {\n offsetX: Math.round(point.x),\n offsetY: Math.round(point.y)\n });\n }\n return meta;\n }\n};\n\n// packages/ag-charts-community/src/chart/layout/layoutService.ts\nvar LayoutService = class extends Listeners {\n constructor() {\n super(...arguments);\n this.layoutComplete = \"layout-complete\";\n }\n addListener(eventType, handler) {\n if (this.isLayoutStage(eventType) || this.isLayoutComplete(eventType)) {\n return super.addListener(eventType, handler);\n }\n throw new Error(`AG Charts - unsupported listener type: ${eventType}`);\n }\n dispatchPerformLayout(stage, ctx) {\n if (this.isLayoutStage(stage)) {\n return this.getListenersByType(stage).reduce((result, listener) => {\n try {\n return listener.handler(result);\n } catch (e) {\n Logger.errorOnce(e);\n return result;\n }\n }, ctx);\n }\n return ctx;\n }\n dispatchLayoutComplete(event) {\n this.dispatch(this.layoutComplete, event);\n }\n isLayoutStage(eventType) {\n return eventType !== this.layoutComplete;\n }\n isLayoutComplete(eventType) {\n return eventType === this.layoutComplete;\n }\n};\n\n// packages/ag-charts-community/src/chart/series/seriesStateManager.ts\nvar SeriesStateManager = class {\n constructor() {\n this.groups = {};\n }\n registerSeries({\n id,\n seriesGrouping,\n visible,\n type\n }) {\n var _a, _b;\n if (!seriesGrouping)\n return;\n (_b = (_a = this.groups)[type]) != null ? _b : _a[type] = {};\n this.groups[type][id] = { grouping: seriesGrouping, visible };\n }\n deregisterSeries({ id, type }) {\n if (this.groups[type]) {\n delete this.groups[type][id];\n }\n if (this.groups[type] && Object.keys(this.groups[type]).length === 0) {\n delete this.groups[type];\n }\n }\n getVisiblePeerGroupIndex({\n type,\n seriesGrouping,\n visible\n }) {\n var _a;\n if (!seriesGrouping)\n return { visibleGroupCount: visible ? 1 : 0, visibleSameStackCount: visible ? 1 : 0, index: 0 };\n const visibleGroupsSet = /* @__PURE__ */ new Set();\n const visibleSameStackSet = /* @__PURE__ */ new Set();\n for (const entry of Object.values((_a = this.groups[type]) != null ? _a : {})) {\n if (!entry.visible)\n continue;\n visibleGroupsSet.add(entry.grouping.groupIndex);\n if (entry.grouping.groupIndex === seriesGrouping.groupIndex) {\n visibleSameStackSet.add(entry.grouping.stackIndex);\n }\n }\n const visibleGroups = Array.from(visibleGroupsSet);\n visibleGroups.sort((a, b) => a - b);\n return {\n visibleGroupCount: visibleGroups.length,\n visibleSameStackCount: visibleSameStackSet.size,\n index: visibleGroups.indexOf(seriesGrouping.groupIndex)\n };\n }\n};\n\n// packages/ag-charts-community/src/chart/chartUpdateType.ts\nvar ChartUpdateType = /* @__PURE__ */ ((ChartUpdateType2) => {\n ChartUpdateType2[ChartUpdateType2[\"FULL\"] = 0] = \"FULL\";\n ChartUpdateType2[ChartUpdateType2[\"UPDATE_DATA\"] = 1] = \"UPDATE_DATA\";\n ChartUpdateType2[ChartUpdateType2[\"PROCESS_DATA\"] = 2] = \"PROCESS_DATA\";\n ChartUpdateType2[ChartUpdateType2[\"PERFORM_LAYOUT\"] = 3] = \"PERFORM_LAYOUT\";\n ChartUpdateType2[ChartUpdateType2[\"SERIES_UPDATE\"] = 4] = \"SERIES_UPDATE\";\n ChartUpdateType2[ChartUpdateType2[\"TOOLTIP_RECALCULATION\"] = 5] = \"TOOLTIP_RECALCULATION\";\n ChartUpdateType2[ChartUpdateType2[\"SCENE_RENDER\"] = 6] = \"SCENE_RENDER\";\n ChartUpdateType2[ChartUpdateType2[\"NONE\"] = 7] = \"NONE\";\n return ChartUpdateType2;\n})(ChartUpdateType || {});\n\n// packages/ag-charts-community/src/chart/updateService.ts\nvar UpdateService = class extends Listeners {\n constructor(updateCallback) {\n super();\n this.updateCallback = updateCallback;\n }\n update(type = 0 /* FULL */, options) {\n this.updateCallback(type, options);\n }\n dispatchUpdateComplete(rects) {\n this.dispatch(\"update-complete\", {\n type: \"update-complete\",\n minRect: rects == null ? void 0 : rects.minRect,\n minVisibleRect: rects == null ? void 0 : rects.minVisibleRect\n });\n }\n};\n\n// packages/ag-charts-community/src/chart/chartContext.ts\nvar ChartContext = class {\n constructor(chart, vars) {\n const { scene, syncManager, element: element2, updateCallback, updateMutex } = vars;\n this.chartService = chart;\n this.scene = scene;\n this.syncManager = syncManager;\n this.zoomManager = chart.zoomManager;\n this.annotationManager = new AnnotationManager(chart.annotationRoot);\n this.ariaAnnouncementService = new AriaAnnouncementService(scene.canvas.element);\n this.chartEventManager = new ChartEventManager();\n this.contextMenuRegistry = new ContextMenuRegistry();\n this.cursorManager = new CursorManager(element2);\n this.highlightManager = new HighlightManager();\n this.interactionManager = new InteractionManager(chart.keyboard, element2);\n this.keyNavManager = new KeyNavManager(this.interactionManager);\n this.regionManager = new RegionManager(\n this.interactionManager,\n this.keyNavManager,\n this.scene.canvas.element,\n element2\n );\n this.toolbarManager = new ToolbarManager(element2);\n this.gestureDetector = new GestureDetector(element2);\n this.layoutService = new LayoutService();\n this.updateService = new UpdateService(updateCallback);\n this.seriesStateManager = new SeriesStateManager();\n this.callbackCache = new CallbackCache();\n this.animationManager = new AnimationManager(this.interactionManager, updateMutex);\n this.animationManager.skip();\n this.animationManager.play();\n this.dataService = new DataService(this.animationManager);\n this.tooltipManager = new TooltipManager(this.scene.canvas.element, chart.tooltip);\n }\n destroy() {\n this.tooltipManager.destroy();\n this.regionManager.destroy();\n this.keyNavManager.destroy();\n this.interactionManager.destroy();\n this.animationManager.stop();\n this.animationManager.destroy();\n this.ariaAnnouncementService.destroy();\n this.chartEventManager.destroy();\n this.highlightManager.destroy();\n this.callbackCache.invalidateCache();\n this.animationManager.reset();\n this.syncManager.destroy();\n }\n};\n\n// packages/ag-charts-community/src/chart/chartHighlight.ts\nvar ChartHighlight = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.range = \"tooltip\";\n }\n};\n__decorateClass([\n Validate(UNION([\"tooltip\", \"node\"], \"a range\"))\n], ChartHighlight.prototype, \"range\", 2);\n\n// packages/ag-charts-community/src/chart/data/dataDomain.ts\nvar DiscreteDomain = class _DiscreteDomain {\n constructor() {\n this.domain = /* @__PURE__ */ new Set();\n }\n static is(value) {\n return value instanceof _DiscreteDomain;\n }\n extend(val) {\n this.domain.add(val);\n }\n getDomain() {\n return Array.from(this.domain);\n }\n};\nvar ContinuousDomain = class _ContinuousDomain {\n constructor() {\n this.domain = [Infinity, -Infinity];\n }\n static is(value) {\n return value instanceof _ContinuousDomain;\n }\n static extendDomain(values, domain = [Infinity, -Infinity]) {\n for (const value of values) {\n if (typeof value !== \"number\") {\n continue;\n }\n if (domain[0] > value) {\n domain[0] = value;\n }\n if (domain[1] < value) {\n domain[1] = value;\n }\n }\n return domain;\n }\n extend(value) {\n if (this.domain[0] > value) {\n this.domain[0] = value;\n }\n if (this.domain[1] < value) {\n this.domain[1] = value;\n }\n }\n getDomain() {\n return [...this.domain];\n }\n};\n\n// packages/ag-charts-community/src/chart/data/dataModel.ts\nfunction toKeyString(keys) {\n return keys.map((key) => isObject(key) ? JSON.stringify(key) : key).join(\"-\");\n}\nfunction round2(val) {\n const accuracy = 1e4;\n if (Number.isInteger(val)) {\n return val;\n } else if (Math.abs(val) > accuracy) {\n return Math.trunc(val);\n }\n return Math.round(val * accuracy) / accuracy;\n}\nfunction fixNumericExtentInternal(extent2) {\n if (extent2 == null) {\n return [];\n }\n let [min, max] = extent2.map(Number);\n if (min === 0 && max === 0) {\n return [0, 1];\n }\n if (min === Infinity && max === -Infinity) {\n return [];\n } else if (min === Infinity) {\n min = 0;\n } else if (max === -Infinity) {\n max = 0;\n }\n return isFiniteNumber(min) && isFiniteNumber(max) ? [min, max] : [];\n}\nfunction fixNumericExtent(extent2, axis) {\n var _a;\n const fixedExtent = fixNumericExtentInternal(extent2);\n if (fixedExtent.length === 0) {\n return fixedExtent;\n }\n let [min, max] = fixedExtent;\n if (min === max) {\n const [paddingMin, paddingMax] = (_a = axis == null ? void 0 : axis.calculatePadding(min, max)) != null ? _a : [1, 1];\n min -= paddingMin;\n max += paddingMax;\n }\n return [min, max];\n}\nfunction getMissCount(scopeProvider, missMap) {\n var _a;\n return (_a = missMap == null ? void 0 : missMap.get(scopeProvider.id)) != null ? _a : 0;\n}\nvar INVALID_VALUE = Symbol(\"invalid\");\nvar DataModel = class {\n constructor(opts, mode = \"standalone\") {\n this.opts = opts;\n this.mode = mode;\n this.debug = Debug.create(true, \"data-model\");\n this.scopeCache = /* @__PURE__ */ new Map();\n this.keys = [];\n this.values = [];\n this.aggregates = [];\n this.groupProcessors = [];\n this.propertyProcessors = [];\n this.reducers = [];\n this.processors = [];\n let keys = true;\n for (const next of opts.props) {\n if (next.type === \"key\" && !keys) {\n throw new Error(\"AG Charts - internal config error: keys must come before values.\");\n }\n if (next.type === \"value\" && keys) {\n keys = false;\n }\n }\n const verifyMatchGroupId = ({ matchGroupIds = [] }) => {\n for (const matchGroupId of matchGroupIds) {\n if (this.values.every((def) => def.groupId !== matchGroupId)) {\n throw new Error(\n `AG Charts - internal config error: matchGroupIds properties must match defined groups (${matchGroupId}).`\n );\n }\n }\n };\n for (const def of opts.props) {\n switch (def.type) {\n case \"key\":\n this.keys.push(__spreadProps(__spreadValues({}, def), { index: this.keys.length, missing: /* @__PURE__ */ new Map() }));\n break;\n case \"value\":\n if (def.property == null) {\n throw new Error(\n `AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(\n def\n )}`\n );\n }\n this.values.push(__spreadProps(__spreadValues({}, def), { index: this.values.length, missing: /* @__PURE__ */ new Map() }));\n break;\n case \"aggregate\":\n verifyMatchGroupId(def);\n this.aggregates.push(__spreadProps(__spreadValues({}, def), { index: this.aggregates.length }));\n break;\n case \"group-value-processor\":\n verifyMatchGroupId(def);\n this.groupProcessors.push(__spreadProps(__spreadValues({}, def), { index: this.groupProcessors.length }));\n break;\n case \"property-value-processor\":\n this.propertyProcessors.push(__spreadProps(__spreadValues({}, def), { index: this.propertyProcessors.length }));\n break;\n case \"reducer\":\n this.reducers.push(__spreadProps(__spreadValues({}, def), { index: this.reducers.length }));\n break;\n case \"processor\":\n this.processors.push(__spreadProps(__spreadValues({}, def), { index: this.processors.length }));\n break;\n }\n }\n }\n resolveProcessedDataDefById(scope, searchId) {\n var _a;\n const def = (_a = this.scopeCache.get(scope.id)) == null ? void 0 : _a.get(searchId);\n if (!def) {\n throw new Error(`AG Charts - didn't find property definition for [${searchId}, ${scope.id}]`);\n }\n return { index: def.index, def };\n }\n resolveProcessedDataIndexById(scope, searchId) {\n return this.resolveProcessedDataDefById(scope, searchId).index;\n }\n resolveProcessedDataDefsByIds(scope, searchIds) {\n return searchIds.map((searchId) => [searchId, this.resolveProcessedDataDefById(scope, searchId)]);\n }\n resolveProcessedDataDefsValues(defs, { keys, values }) {\n const result = {};\n for (const [searchId, { index, def }] of defs) {\n const processedData = def.type === \"key\" ? keys : values;\n result[searchId] = processedData[index];\n }\n return result;\n }\n getDomain(scope, searchId, type = \"value\", processedData) {\n var _a;\n const domains = this.getDomainsByType(type, processedData);\n return (_a = domains == null ? void 0 : domains[this.resolveProcessedDataIndexById(scope, searchId)]) != null ? _a : [];\n }\n getDomainsByType(type, processedData) {\n switch (type) {\n case \"key\":\n return processedData.domain.keys;\n case \"value\":\n return processedData.domain.values;\n case \"aggregate\":\n return processedData.domain.aggValues;\n case \"group-value-processor\":\n return processedData.domain.groups;\n default:\n return null;\n }\n }\n processData(data, sources) {\n var _a;\n const {\n opts: { groupByKeys, groupByFn },\n aggregates,\n groupProcessors,\n reducers,\n processors,\n propertyProcessors\n } = this;\n const start = performance.now();\n if (groupByKeys && this.keys.length === 0) {\n return;\n }\n let processedData = this.extractData(data, sources);\n if (groupByKeys) {\n processedData = this.groupData(processedData);\n } else if (groupByFn) {\n processedData = this.groupData(processedData, groupByFn(processedData));\n }\n if (groupProcessors.length > 0) {\n this.postProcessGroups(processedData);\n }\n if (aggregates.length > 0) {\n this.aggregateData(processedData);\n }\n if (propertyProcessors.length > 0) {\n this.postProcessProperties(processedData);\n }\n if (reducers.length > 0) {\n this.reduceData(processedData);\n }\n if (processors.length > 0) {\n this.postProcessData(processedData);\n }\n if (data.length > 0) {\n for (const def of iterate(this.keys, this.values)) {\n for (const [scope, missCount] of def.missing) {\n if (missCount >= data.length) {\n const scopeHint = scope == null ? \"\" : ` for ${scope}`;\n Logger.warnOnce(`the key '${def.property}' was not found in any data element${scopeHint}.`);\n }\n }\n }\n }\n const end = performance.now();\n processedData.time = end - start;\n if (this.debug.check()) {\n logProcessedData(processedData);\n }\n this.scopeCache.clear();\n for (const def of iterate(this.keys, this.values, this.aggregates)) {\n if (!def.idsMap)\n continue;\n for (const [scope, ids] of def.idsMap) {\n for (const id of ids) {\n if (!this.scopeCache.has(scope)) {\n this.scopeCache.set(scope, /* @__PURE__ */ new Map([[id, def]]));\n } else if ((_a = this.scopeCache.get(scope)) == null ? void 0 : _a.has(id)) {\n throw new Error(\"duplicate definition ids on the same scope are not allowed.\");\n } else {\n this.scopeCache.get(scope).set(id, def);\n }\n }\n }\n }\n return processedData;\n }\n valueGroupIdxLookup({ matchGroupIds }) {\n const result = [];\n for (const [index, def] of this.values.entries()) {\n if (!matchGroupIds || def.groupId && matchGroupIds.includes(def.groupId)) {\n result.push(index);\n }\n }\n return result;\n }\n valueIdxLookup(scopes, prop) {\n const noScopesToMatch = scopes == null || scopes.length === 0;\n const propId = typeof prop === \"string\" ? prop : prop.id;\n const hasMatchingScopeId = (def) => {\n if (def.idsMap) {\n for (const [scope, ids] of def.idsMap) {\n if ((scopes == null ? void 0 : scopes.includes(scope)) && ids.has(propId)) {\n return true;\n }\n }\n }\n return false;\n };\n const result = this.values.findIndex((def) => {\n const validDefScopes = def.scopes == null || noScopesToMatch && !def.scopes.length || def.scopes.some((s) => scopes == null ? void 0 : scopes.includes(s));\n return validDefScopes && (def.property === propId || def.id === propId || hasMatchingScopeId(def));\n });\n if (result === -1) {\n throw new Error(\n `AG Charts - configuration error, unknown property ${JSON.stringify(prop)} in scope(s) ${JSON.stringify(\n scopes\n )}`\n );\n }\n return result;\n }\n extractData(data, sources) {\n var _a, _b, _c, _d;\n const { dataDomain, processValue, scopes, allScopesHaveSameDefs } = this.initDataDomainProcessor();\n const sourcesById = new Map(sources == null ? void 0 : sources.map((s) => [s.id, s]));\n const { keys: keyDefs, values: valueDefs } = this;\n const resultData = new Array(data.length);\n let resultDataIdx = 0;\n let partialValidDataCount = 0;\n for (const [datumIdx, datum] of data.entries()) {\n const sourceDatums = {};\n const validScopes = scopes.size > 0 ? new Set(scopes) : void 0;\n const keys = new Array(keyDefs.length);\n let keyIdx = 0;\n let key;\n for (const def of keyDefs) {\n key = processValue(def, datum, key);\n if (key === INVALID_VALUE)\n break;\n if (keys) {\n keys[keyIdx++] = key;\n }\n }\n if (key === INVALID_VALUE)\n continue;\n const values = valueDefs.length > 0 ? new Array(valueDefs.length) : void 0;\n let value;\n for (const [valueDefIdx, def] of valueDefs.entries()) {\n for (const scope of (_a = def.scopes) != null ? _a : scopes) {\n const source = sourcesById.get(scope);\n const valueDatum = (_b = source == null ? void 0 : source.data[datumIdx]) != null ? _b : datum;\n value = processValue(def, valueDatum, value, scope);\n if (value === INVALID_VALUE || !values)\n continue;\n if (source != null && def.includeProperty !== false) {\n const property = def.includeProperty && def.id != null ? def.id : def.property;\n (_c = sourceDatums[scope]) != null ? _c : sourceDatums[scope] = {};\n sourceDatums[scope][property] = value;\n }\n values[valueDefIdx] = value;\n }\n if (value === INVALID_VALUE) {\n if (allScopesHaveSameDefs)\n break;\n for (const scope of (_d = def.scopes) != null ? _d : scopes) {\n validScopes == null ? void 0 : validScopes.delete(scope);\n }\n if ((validScopes == null ? void 0 : validScopes.size) === 0)\n break;\n }\n }\n if (value === INVALID_VALUE && allScopesHaveSameDefs)\n continue;\n if ((validScopes == null ? void 0 : validScopes.size) === 0)\n continue;\n const result = { datum: __spreadValues(__spreadValues({}, datum), sourceDatums), keys, values };\n if (!allScopesHaveSameDefs && validScopes && validScopes.size < scopes.size) {\n partialValidDataCount++;\n result.validScopes = new Set(validScopes);\n }\n resultData[resultDataIdx++] = result;\n }\n resultData.length = resultDataIdx;\n const propertyDomain = (def) => {\n const defDomain = dataDomain.get(def);\n const result = defDomain.getDomain();\n if (ContinuousDomain.is(defDomain) && result[0] > result[1]) {\n return [];\n }\n return result;\n };\n return {\n type: \"ungrouped\",\n input: { count: data.length },\n data: resultData,\n domain: {\n keys: keyDefs.map(propertyDomain),\n values: valueDefs.map(propertyDomain)\n },\n defs: {\n allScopesHaveSameDefs,\n keys: keyDefs,\n values: valueDefs\n },\n partialValidDataCount,\n time: 0\n };\n }\n groupData(data, groupingFn) {\n var _a;\n const processedData = /* @__PURE__ */ new Map();\n for (const dataEntry of data.data) {\n const { keys, values, datum, validScopes } = dataEntry;\n const group2 = (_a = groupingFn == null ? void 0 : groupingFn(dataEntry)) != null ? _a : keys;\n const groupStr = toKeyString(group2);\n if (processedData.has(groupStr)) {\n const existingData = processedData.get(groupStr);\n existingData.values.push(values);\n existingData.datum.push(datum);\n if (validScopes != null && existingData.validScopes != null) {\n for (const scope of existingData.validScopes) {\n if (!validScopes.has(scope)) {\n existingData.validScopes.delete(scope);\n }\n }\n }\n } else {\n processedData.set(groupStr, {\n keys: group2,\n values: [values],\n datum: [datum],\n validScopes\n });\n }\n }\n const resultData = new Array(processedData.size);\n const resultGroups = new Array(processedData.size);\n let dataIndex = 0;\n for (const { keys, values, datum, validScopes } of processedData.values()) {\n if ((validScopes == null ? void 0 : validScopes.size) === 0)\n continue;\n resultGroups[dataIndex] = keys;\n resultData[dataIndex++] = {\n keys,\n values,\n datum,\n validScopes\n };\n }\n return __spreadProps(__spreadValues({}, data), {\n type: \"grouped\",\n data: resultData,\n domain: __spreadProps(__spreadValues({}, data.domain), {\n groups: resultGroups\n })\n });\n }\n aggregateData(processedData) {\n var _a, _b, _c, _d, _e, _f, _g;\n const isUngrouped = processedData.type === \"ungrouped\";\n processedData.domain.aggValues = [];\n for (const [index, def] of this.aggregates.entries()) {\n const indices = this.valueGroupIdxLookup(def);\n const domain = [Infinity, -Infinity];\n for (const datum of processedData.data) {\n (_a = datum.aggValues) != null ? _a : datum.aggValues = new Array(this.aggregates.length);\n if (datum.validScopes)\n continue;\n const values = isUngrouped ? [datum.values] : datum.values;\n let groupAggValues = (_c = (_b = def.groupAggregateFunction) == null ? void 0 : _b.call(def)) != null ? _c : [Infinity, -Infinity];\n for (const distinctValues of values) {\n const valuesToAgg = indices.map((valueIdx) => distinctValues[valueIdx]);\n const valuesAgg = def.aggregateFunction(valuesToAgg, datum.keys);\n if (valuesAgg) {\n groupAggValues = (_e = (_d = def.groupAggregateFunction) == null ? void 0 : _d.call(def, valuesAgg, groupAggValues)) != null ? _e : ContinuousDomain.extendDomain(valuesAgg, groupAggValues);\n }\n }\n const finalValues = ((_g = (_f = def.finalFunction) == null ? void 0 : _f.call(def, groupAggValues)) != null ? _g : groupAggValues).map((v) => round2(v));\n datum.aggValues[index] = finalValues;\n ContinuousDomain.extendDomain(finalValues, domain);\n }\n processedData.domain.aggValues.push(domain);\n }\n }\n postProcessGroups(processedData) {\n var _a, _b;\n const { groupProcessors } = this;\n const affectedIndices = /* @__PURE__ */ new Set();\n const updatedDomains = /* @__PURE__ */ new Map();\n const groupProcessorIndices = /* @__PURE__ */ new Map();\n const groupProcessorInitFns = /* @__PURE__ */ new Map();\n for (const processor of groupProcessors) {\n const indices = this.valueGroupIdxLookup(processor);\n groupProcessorIndices.set(processor, indices);\n groupProcessorInitFns.set(processor, processor.adjust());\n for (const idx of indices) {\n const valueDef = this.values[idx];\n const isDiscrete = valueDef.valueType === \"category\";\n affectedIndices.add(idx);\n updatedDomains.set(idx, isDiscrete ? new DiscreteDomain() : new ContinuousDomain());\n }\n }\n const updateDomains = (values) => {\n var _a2;\n for (const valueIndex of affectedIndices) {\n (_a2 = updatedDomains.get(valueIndex)) == null ? void 0 : _a2.extend(values[valueIndex]);\n }\n };\n for (const group2 of processedData.data) {\n for (const processor of groupProcessors) {\n if (group2.validScopes)\n continue;\n const valueIndexes = (_a = groupProcessorIndices.get(processor)) != null ? _a : [];\n const adjustFn = (_b = groupProcessorInitFns.get(processor)) == null ? void 0 : _b();\n if (!adjustFn)\n continue;\n if (processedData.type === \"grouped\") {\n for (const values of group2.values) {\n if (values) {\n adjustFn(values, valueIndexes);\n }\n }\n } else if (group2.values) {\n adjustFn(group2.values, valueIndexes);\n }\n }\n if (processedData.type === \"grouped\") {\n for (const values of group2.values) {\n updateDomains(values);\n }\n } else {\n updateDomains(group2.values);\n }\n }\n for (const [idx, dataDomain] of updatedDomains) {\n processedData.domain.values[idx] = dataDomain.getDomain();\n }\n }\n postProcessProperties(processedData) {\n for (const { adjust, property, scopes } of this.propertyProcessors) {\n adjust()(processedData, this.valueIdxLookup(scopes, property));\n }\n }\n reduceData(processedData) {\n var _a, _b;\n (_a = processedData.reduced) != null ? _a : processedData.reduced = {};\n for (const def of this.reducers) {\n const reducer = def.reducer();\n let accValue = def.initialValue;\n for (const datum of processedData.data) {\n if (!datum.validScopes || ((_b = def.scopes) == null ? void 0 : _b.some((s) => {\n var _a2;\n return (_a2 = datum.validScopes) == null ? void 0 : _a2.has(s);\n }))) {\n accValue = reducer(accValue, datum);\n }\n }\n processedData.reduced[def.property] = accValue;\n }\n }\n postProcessData(processedData) {\n var _a;\n (_a = processedData.reduced) != null ? _a : processedData.reduced = {};\n for (const def of this.processors) {\n processedData.reduced[def.property] = def.calculate(processedData);\n }\n }\n initDataDomainProcessor() {\n const { keys: keyDefs, values: valueDefs } = this;\n const scopes = /* @__PURE__ */ new Set();\n for (const valueDef of valueDefs) {\n if (!valueDef.scopes)\n continue;\n for (const scope of valueDef.scopes) {\n scopes.add(scope);\n }\n }\n const dataDomain = /* @__PURE__ */ new Map();\n const processorFns = /* @__PURE__ */ new Map();\n let allScopesHaveSameDefs = true;\n const initDataDomain = () => {\n var _a;\n for (const def of iterate(keyDefs, valueDefs)) {\n if (def.valueType === \"category\") {\n dataDomain.set(def, new DiscreteDomain());\n } else {\n dataDomain.set(def, new ContinuousDomain());\n allScopesHaveSameDefs && (allScopesHaveSameDefs = ((_a = def.scopes) != null ? _a : []).length === scopes.size);\n }\n }\n };\n initDataDomain();\n const accessors = this.buildAccessors(iterate(keyDefs, valueDefs));\n const processValue = (def, datum, previousDatum, scope) => {\n var _a, _b, _c, _d, _e;\n let valueInDatum;\n let value;\n if (accessors.has(def.property)) {\n try {\n value = accessors.get(def.property)(datum);\n } catch (error) {\n }\n valueInDatum = value != null;\n } else {\n valueInDatum = def.property in datum;\n value = valueInDatum ? datum[def.property] : def.missingValue;\n }\n if (def.forceValue != null) {\n const valueNegative = valueInDatum && isNegative(value);\n value = valueNegative ? -1 * def.forceValue : def.forceValue;\n valueInDatum = true;\n }\n const missingValueDef = \"missingValue\" in def;\n if (!valueInDatum && !missingValueDef) {\n const missCount = (_a = def.missing.get(scope)) != null ? _a : 0;\n def.missing.set(scope, missCount + 1);\n }\n if (!dataDomain.has(def)) {\n initDataDomain();\n }\n if (valueInDatum && !((_c = (_b = def.validation) == null ? void 0 : _b.call(def, value, datum)) != null ? _c : true)) {\n if (\"invalidValue\" in def) {\n value = def.invalidValue;\n } else {\n if (this.mode !== \"integrated\") {\n Logger.warnOnce(`invalid value of type [${typeof value}] ignored:`, `[${value}]`);\n }\n return INVALID_VALUE;\n }\n }\n if (def.processor) {\n if (!processorFns.has(def)) {\n processorFns.set(def, def.processor());\n }\n value = (_d = processorFns.get(def)) == null ? void 0 : _d(value, previousDatum === INVALID_VALUE ? void 0 : previousDatum);\n }\n (_e = dataDomain.get(def)) == null ? void 0 : _e.extend(value);\n return value;\n };\n return { dataDomain, processValue, initDataDomain, scopes, allScopesHaveSameDefs };\n }\n buildAccessors(defs) {\n const result = /* @__PURE__ */ new Map();\n if (this.mode === \"integrated\") {\n return result;\n }\n for (const def of defs) {\n const isPath = def.property.includes(\".\") || def.property.includes(\"[\");\n if (!isPath)\n continue;\n let fnBody;\n if (def.property.startsWith(\"[\")) {\n fnBody = `return datum${def.property};`;\n } else {\n fnBody = `return datum.${def.property};`;\n }\n result.set(def.property, new Function(\"datum\", fnBody));\n }\n return result;\n }\n};\nfunction logProcessedData(processedData) {\n var _a, _b;\n const logValues = (name, data) => {\n if (data.length > 0) {\n Logger.log(`DataModel.processData() - ${name}`);\n Logger.table(data);\n }\n };\n Logger.log(\"DataModel.processData() - processedData\", processedData);\n logValues(\"Key Domains\", processedData.domain.keys);\n logValues(\"Group Domains\", (_a = processedData.domain.groups) != null ? _a : []);\n logValues(\"Value Domains\", processedData.domain.values);\n logValues(\"Aggregate Domains\", (_b = processedData.domain.aggValues) != null ? _b : []);\n if (processedData.type === \"grouped\") {\n const flattenedValues = processedData.data.reduce((acc, next) => {\n var _a2, _b2;\n const keys = (_a2 = next.keys) != null ? _a2 : [];\n const aggValues = (_b2 = next.aggValues) != null ? _b2 : [];\n const skipKeys = next.keys.map(() => void 0);\n const skipAggValues = aggValues == null ? void 0 : aggValues.map(() => void 0);\n acc.push(\n ...next.values.map((v, i) => [\n ...i === 0 ? keys : skipKeys,\n ...v != null ? v : [],\n ...i == 0 ? aggValues : skipAggValues\n ])\n );\n return acc;\n }, []);\n logValues(\"Values\", flattenedValues);\n } else {\n const flattenedValues = processedData.data.reduce((acc, next) => {\n var _a2;\n const aggValues = (_a2 = next.aggValues) != null ? _a2 : [];\n acc.push([...next.keys, ...next.values, ...aggValues]);\n return acc;\n }, []);\n logValues(\"Values\", flattenedValues);\n }\n}\n\n// packages/ag-charts-community/src/chart/data/dataController.ts\nvar _DataController = class _DataController {\n constructor(mode) {\n this.mode = mode;\n this.debug = Debug.create(true, \"data-model\");\n this.requested = [];\n this.status = \"setup\";\n }\n request(id, data, opts) {\n return __async(this, null, function* () {\n if (this.status !== \"setup\") {\n throw new Error(`AG Charts - data request after data setup phase.`);\n }\n return new Promise((resolve, reject) => {\n this.requested.push({ id, opts, data, resolve, reject });\n });\n });\n }\n execute() {\n if (this.status !== \"setup\") {\n throw new Error(`AG Charts - data request after data setup phase.`);\n }\n this.status = \"executed\";\n this.debug(\"DataController.execute() - requested\", this.requested);\n const valid = this.validateRequests(this.requested);\n this.debug(\"DataController.execute() - validated\", valid);\n const merged = this.mergeRequested(valid);\n this.debug(\"DataController.execute() - merged\", merged);\n if (this.debug.check()) {\n getWindow().processedData = [];\n }\n const scopes = this.requested.map(({ id }) => id);\n const needsValueExtraction = this.hasMultipleDataSources(valid);\n for (const { opts, data, resolves, rejects, ids } of merged) {\n try {\n const dataModel = new DataModel(opts, this.mode);\n const processedData = dataModel.processData(data, valid);\n if (this.debug.check()) {\n getWindow(\"processedData\").push(processedData);\n }\n if ((processedData == null ? void 0 : processedData.partialValidDataCount) === 0) {\n resolves.forEach(\n (resolve, requestIdx) => resolve({\n dataModel,\n processedData: this.processScopedData(\n ids[requestIdx],\n processedData,\n scopes,\n needsValueExtraction\n )\n })\n );\n } else if (processedData) {\n this.splitResult(dataModel, processedData, ids, resolves);\n } else {\n rejects.forEach((cb) => cb(new Error(`AG Charts - no processed data generated`)));\n }\n } catch (error) {\n rejects.forEach((cb) => cb(error));\n }\n }\n }\n hasMultipleDataSources(validRequests) {\n if (validRequests.length) {\n const [{ data }, ...restRequests] = validRequests;\n return restRequests.some((v) => data !== v.data);\n }\n return false;\n }\n processScopedData(id, processedData, ids, needsValueExtraction) {\n const extractDatum = (datum) => {\n if (Array.isArray(datum)) {\n return datum.map(extractDatum);\n }\n const extracted = needsValueExtraction ? __spreadValues(__spreadValues({}, datum), datum[id]) : datum;\n for (const otherId of ids) {\n delete extracted[otherId];\n }\n return extracted;\n };\n const extractValues = (values) => {\n var _a;\n if (Array.isArray(values)) {\n return values.map(extractValues);\n }\n return (_a = values == null ? void 0 : values[id]) != null ? _a : values;\n };\n return __spreadProps(__spreadValues({}, processedData), {\n data: processedData.data.map((datum) => {\n var _a;\n return __spreadProps(__spreadValues({}, datum), {\n datum: extractDatum(datum.datum),\n values: needsValueExtraction ? (_a = datum.values) == null ? void 0 : _a.map(extractValues) : datum.values\n });\n })\n });\n }\n validateRequests(requested) {\n const valid = [];\n for (const [index, request] of requested.entries()) {\n if (index > 0 && request.data.length !== requested[0].data.length && request.opts.groupByData === false) {\n request.reject(\n new Error(\"all series[].data arrays must be of the same length and have matching keys.\")\n );\n } else {\n valid.push(request);\n }\n }\n return valid;\n }\n mergeRequested(requested) {\n const grouped = [];\n for (const request of requested) {\n const match = grouped.find(_DataController.groupMatch(request));\n if (match) {\n match.push(request);\n } else {\n grouped.push([request]);\n }\n }\n return grouped.map(_DataController.mergeRequests);\n }\n splitResult(dataModel, processedData, scopes, resolves) {\n for (let i = 0; i < scopes.length; i++) {\n const scope = scopes[i];\n const resolve = resolves[i];\n resolve({\n dataModel,\n processedData: __spreadProps(__spreadValues({}, processedData), {\n data: processedData.data.filter(({ validScopes }) => {\n var _a;\n return (_a = validScopes == null ? void 0 : validScopes.has(scope)) != null ? _a : true;\n })\n })\n });\n }\n }\n static groupMatch({ data, opts }) {\n function keys(props) {\n return props.filter((p) => p.type === \"key\").map((p) => p.property).join(\";\");\n }\n return ([group2]) => (opts.groupByData === false || group2.data === data) && group2.opts.groupByKeys === opts.groupByKeys && group2.opts.groupByFn === opts.groupByFn && keys(group2.opts.props) === keys(opts.props);\n }\n static mergeRequests(requests) {\n return requests.reduce(\n (result, _a) => {\n var { id, data, resolve, reject, opts: _b } = _a, _c = _b, { props } = _c, opts = __objRest(_c, [\"props\"]);\n var _a2, _b2, _c2, _d, _e;\n result.ids.push(id);\n result.rejects.push(reject);\n result.resolves.push(resolve);\n (_a2 = result.data) != null ? _a2 : result.data = data;\n (_b2 = result.opts) != null ? _b2 : result.opts = __spreadProps(__spreadValues({}, opts), { props: [] });\n for (const prop of props) {\n const clone = __spreadProps(__spreadValues({}, prop), { scopes: [id] });\n _DataController.createIdsMap(id, clone);\n const match = result.opts.props.find(\n (existing) => existing.type === clone.type && _DataController.deepEqual(existing, clone)\n );\n if (!match) {\n result.opts.props.push(clone);\n continue;\n }\n (_c2 = match.scopes) != null ? _c2 : match.scopes = [];\n match.scopes.push(...(_d = clone.scopes) != null ? _d : []);\n if ((match.type === \"key\" || match.type === \"value\") && ((_e = clone.idsMap) == null ? void 0 : _e.size)) {\n _DataController.mergeIdsMap(clone.idsMap, match.idsMap);\n }\n }\n return result;\n },\n { ids: [], rejects: [], resolves: [], data: null, opts: null }\n );\n }\n static mergeIdsMap(fromMap, toMap) {\n for (const [scope, ids] of fromMap) {\n if (toMap.has(scope)) {\n for (const id of ids) {\n toMap.get(scope).add(id);\n }\n } else {\n toMap.set(scope, new Set(ids));\n }\n }\n }\n static createIdsMap(scope, prop) {\n var _a;\n if (prop.id == null)\n return;\n (_a = prop.idsMap) != null ? _a : prop.idsMap = /* @__PURE__ */ new Map();\n if (prop.idsMap.has(scope)) {\n prop.idsMap.get(scope).add(prop.id);\n } else {\n prop.idsMap.set(scope, /* @__PURE__ */ new Set([prop.id]));\n }\n }\n static deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (a && b && typeof a == \"object\" && typeof b == \"object\") {\n if (a.constructor !== b.constructor) {\n return false;\n }\n let i, length;\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n for (i = length - 1; i >= 0; i--) {\n if (!_DataController.deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n const keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length - 1; i >= 0; i--) {\n const key = keys[i];\n if (!_DataController.skipKeys.has(key) && (!Object.hasOwn(b, key) || !_DataController.deepEqual(a[key], b[key]))) {\n return false;\n }\n }\n return true;\n }\n return false;\n }\n};\n// optimized version of deep equality for `mergeRequests` which can potentially loop over 1M times\n_DataController.skipKeys = /* @__PURE__ */ new Set([\"id\", \"idsMap\", \"type\", \"scopes\"]);\nvar DataController = _DataController;\n\n// packages/ag-charts-community/src/chart/interaction/syncManager.ts\nvar _SyncManager = class _SyncManager extends BaseManager {\n constructor(chart) {\n super();\n this.chart = chart;\n }\n subscribe(groupId = _SyncManager.DEFAULT_GROUP) {\n let syncGroup = this.get(groupId);\n if (!syncGroup) {\n syncGroup = /* @__PURE__ */ new Set();\n _SyncManager.chartsGroups.set(groupId, syncGroup);\n }\n syncGroup.add(this.chart);\n return this;\n }\n unsubscribe(groupId = _SyncManager.DEFAULT_GROUP) {\n var _a;\n (_a = this.get(groupId)) == null ? void 0 : _a.delete(this.chart);\n return this;\n }\n getChart() {\n return this.chart;\n }\n getGroup(groupId = _SyncManager.DEFAULT_GROUP) {\n const syncGroup = this.get(groupId);\n return syncGroup ? Array.from(syncGroup) : [];\n }\n getGroupSiblings(groupId = _SyncManager.DEFAULT_GROUP) {\n return this.getGroup(groupId).filter((chart) => chart !== this.chart);\n }\n get(groupId) {\n return _SyncManager.chartsGroups.get(groupId);\n }\n};\n_SyncManager.chartsGroups = /* @__PURE__ */ new Map();\n_SyncManager.DEFAULT_GROUP = Symbol(\"sync-group-default\");\nvar SyncManager = _SyncManager;\n\n// packages/ag-charts-community/src/chart/interaction/zoomManager.ts\nvar ZoomManager = class extends BaseManager {\n constructor() {\n super(...arguments);\n this.axisZoomManagers = /* @__PURE__ */ new Map();\n this.state = new StateTracker(void 0, \"initial\");\n this.rejectCallbacks = /* @__PURE__ */ new Map();\n }\n updateAxes(axes) {\n var _a;\n const zoomManagers = new Map(axes.map((axis) => [axis.id, this.axisZoomManagers.get(axis.id)]));\n this.axisZoomManagers.clear();\n for (const axis of axes) {\n this.axisZoomManagers.set(axis.id, (_a = zoomManagers.get(axis.id)) != null ? _a : new AxisZoomManager(axis));\n }\n if (this.state.size > 0 && axes.length > 0) {\n this.updateZoom(this.state.stateId(), this.state.stateValue());\n }\n }\n updateZoom(callerId, newZoom, canChangeInitial = true, rejectCallback) {\n var _a;\n if (rejectCallback) {\n this.rejectCallbacks.set(callerId, rejectCallback);\n }\n if (this.axisZoomManagers.size === 0) {\n const stateId = this.state.stateId();\n if (stateId === \"initial\" || stateId === callerId || canChangeInitial) {\n this.state.set(callerId, newZoom);\n if (stateId !== callerId) {\n (_a = this.rejectCallbacks.get(stateId)) == null ? void 0 : _a(callerId);\n }\n } else {\n rejectCallback == null ? void 0 : rejectCallback(stateId);\n }\n return;\n }\n this.state.set(callerId, newZoom);\n this.axisZoomManagers.forEach((axis) => {\n axis.updateZoom(callerId, newZoom == null ? void 0 : newZoom[axis.getDirection()]);\n });\n this.applyChanges(callerId);\n }\n updateAxisZoom(callerId, axisId, newZoom) {\n var _a;\n (_a = this.axisZoomManagers.get(axisId)) == null ? void 0 : _a.updateZoom(callerId, newZoom);\n this.applyChanges(callerId);\n }\n // Fire this event to signal to listeners that the view is changing through a zoom and/or pan change.\n fireZoomPanStartEvent(callerId) {\n this.listeners.dispatch(\"zoom-pan-start\", { type: \"zoom-pan-start\", callerId });\n }\n getZoom() {\n let x;\n let y;\n this.axisZoomManagers.forEach((axis) => {\n if (axis.getDirection() === \"x\" /* X */) {\n x != null ? x : x = axis.getZoom();\n } else if (axis.getDirection() === \"y\" /* Y */) {\n y != null ? y : y = axis.getZoom();\n }\n });\n if (x || y) {\n return { x, y };\n }\n }\n getAxisZoom(axisId) {\n var _a, _b;\n return (_b = (_a = this.axisZoomManagers.get(axisId)) == null ? void 0 : _a.getZoom()) != null ? _b : { min: 0, max: 1 };\n }\n getAxisZooms() {\n const axes = {};\n for (const [axisId, axis] of this.axisZoomManagers.entries()) {\n axes[axisId] = {\n direction: axis.getDirection(),\n zoom: axis.getZoom()\n };\n }\n return axes;\n }\n applyChanges(callerId) {\n const changed = Array.from(this.axisZoomManagers.values(), (axis) => axis.applyChanges()).some(Boolean);\n if (!changed) {\n return;\n }\n const axes = {};\n for (const [axisId, axis] of this.axisZoomManagers.entries()) {\n axes[axisId] = axis.getZoom();\n }\n this.listeners.dispatch(\"zoom-change\", __spreadProps(__spreadValues({ type: \"zoom-change\" }, this.getZoom()), { axes, callerId }));\n }\n};\nvar AxisZoomManager = class {\n constructor(axis) {\n this.axis = axis;\n const [min = 0, max = 1] = axis.visibleRange;\n this.state = new StateTracker({ min, max });\n this.currentZoom = this.state.stateValue();\n }\n getDirection() {\n return this.axis.direction;\n }\n updateZoom(callerId, newZoom) {\n this.state.set(callerId, newZoom);\n }\n getZoom() {\n return deepClone(this.state.stateValue());\n }\n applyChanges() {\n const prevZoom = this.currentZoom;\n this.currentZoom = this.state.stateValue();\n return prevZoom.min !== this.currentZoom.min || prevZoom.max !== this.currentZoom.max;\n }\n};\n\n// packages/ag-charts-community/src/chart/keyboard.ts\nvar Keyboard = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.enabled = false;\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], Keyboard.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(NUMBER)\n], Keyboard.prototype, \"tabIndex\", 2);\n\n// packages/ag-charts-community/src/chart/keyboardUtil.ts\nfunction makeKeyboardPointerEvent(regionManager, pick) {\n const { bbox, showFocusBox } = pick;\n if (showFocusBox) {\n regionManager.updateFocusIndicatorRect(pick.bbox);\n }\n if (bbox !== void 0) {\n const { x: offsetX, y: offsetY } = bbox.computeCenter();\n return { type: \"keyboard\", offsetX, offsetY };\n }\n return void 0;\n}\n\n// packages/ag-charts-community/src/chart/mapping/prepareAxis.ts\nvar CARTESIAN_AXIS_POSITIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nvar CARTESIAN_AXIS_TYPES = [\n \"category\",\n \"grouped-category\",\n \"ordinal-time\",\n \"number\",\n \"log\",\n \"time\"\n];\nfunction hasCartesianAxisPosition(axis) {\n const allowedTypes = CARTESIAN_AXIS_TYPES;\n return allowedTypes.includes(axis.type);\n}\nfunction isCartesianAxisOptions(options) {\n const allowedTypes = CARTESIAN_AXIS_TYPES;\n return allowedTypes.includes(options.type);\n}\nfunction isAxisPosition(position) {\n const allowedPositions = CARTESIAN_AXIS_POSITIONS;\n return typeof position === \"string\" && allowedPositions.includes(position);\n}\nvar AxisPositionGuesser = class {\n constructor() {\n this.result = [];\n this.valid = [];\n this.invalid = [];\n }\n push(axis, options) {\n const { result, valid, invalid } = this;\n if (isCartesianAxisOptions(options)) {\n if (isAxisPosition(options.position)) {\n valid.push(axis);\n } else {\n invalid.push(axis);\n }\n }\n result.push(axis);\n }\n guessInvalidPositions() {\n const takenPosition = this.valid.filter((v) => hasCartesianAxisPosition(v)).map((v) => v.position).filter((v) => v !== void 0);\n const guesses = [\"top\", \"right\", \"bottom\", \"left\"];\n for (const invalidAxis of this.invalid) {\n let nextGuess = guesses.pop();\n while (takenPosition.includes(nextGuess) && nextGuess !== void 0) {\n nextGuess = guesses.pop();\n }\n if (nextGuess === void 0)\n break;\n invalidAxis.position = nextGuess;\n }\n return this.result;\n }\n};\n\n// packages/ag-charts-community/src/chart/mapping/prepareSeries.ts\nvar MATCHING_KEYS = [\n \"direction\",\n \"xKey\",\n \"yKey\",\n \"sizeKey\",\n \"angleKey\",\n \"radiusKey\",\n \"normalizedTo\",\n \"stacked\",\n \"grouped\",\n \"stackGroup\"\n];\nfunction matchSeriesOptions(series, optSeries, oldOptsSeries) {\n var _a, _b, _c, _d;\n const generateKey = (type, i) => {\n const result = [type];\n for (const key of MATCHING_KEYS) {\n if (key in i && i[key] != null)\n result.push(`${key}=${i[key]}`);\n }\n return result.join(\";\");\n };\n const seriesMap = /* @__PURE__ */ new Map();\n let idx = 0;\n for (const s of series) {\n const key = generateKey(s.type, s.properties);\n if (!seriesMap.has(key)) {\n seriesMap.set(key, []);\n }\n (_a = seriesMap.get(key)) == null ? void 0 : _a.push([s, idx++]);\n }\n const optsMap = /* @__PURE__ */ new Map();\n for (const o of optSeries) {\n const key = generateKey(o.type, o);\n if (!optsMap.has(key)) {\n optsMap.set(key, []);\n }\n (_b = optsMap.get(key)) == null ? void 0 : _b.push(o);\n }\n const overlap = [...seriesMap.keys()].some((k) => optsMap.has(k));\n if (!overlap) {\n return { status: \"no-overlap\", oldKeys: seriesMap.keys(), newKeys: optsMap.keys() };\n }\n const changes = [];\n let targetIdx = -1;\n for (const [key, optArray] of optsMap.entries()) {\n for (const opts of optArray) {\n targetIdx++;\n const seriesArray = seriesMap.get(key);\n if (seriesArray == null || seriesArray.length < 1) {\n changes.push({ opts, idx: targetIdx, status: \"add\" });\n seriesMap.delete(key);\n continue;\n }\n const [outputSeries, outputIdx] = seriesArray.shift();\n const previousOpts = (_c = oldOptsSeries == null ? void 0 : oldOptsSeries[outputIdx]) != null ? _c : {};\n const diff2 = jsonDiff(previousOpts, opts != null ? opts : {});\n const { groupIndex, stackIndex } = (_d = diff2 == null ? void 0 : diff2.seriesGrouping) != null ? _d : {};\n if (groupIndex != null || stackIndex != null) {\n changes.push({ opts, series: outputSeries, diff: diff2, idx: outputIdx, status: \"series-grouping\" });\n } else if (diff2) {\n changes.push({ opts, series: outputSeries, diff: diff2, idx: outputIdx, status: \"update\" });\n } else {\n changes.push({ opts, series: outputSeries, idx: outputIdx, status: \"no-op\" });\n }\n if (seriesArray.length === 0) {\n seriesMap.delete(key);\n }\n }\n }\n for (const seriesArray of seriesMap.values()) {\n for (const [outputSeries, outputIdx] of seriesArray) {\n changes.push({ series: outputSeries, idx: outputIdx, status: \"remove\" });\n }\n }\n return { status: \"overlap\", changes };\n}\n\n// packages/ag-charts-community/src/chart/modulesManager.ts\nvar ModulesManager = class extends ModuleMap {\n applyOptions(options) {\n for (const m of this.moduleMap.values()) {\n if (m.module.optionsKey in options && isProperties(m.moduleInstance)) {\n m.moduleInstance.set(options[m.module.optionsKey]);\n }\n }\n }\n *legends() {\n for (const { module, moduleInstance } of this.moduleMap.values()) {\n if (module.type !== \"legend\")\n continue;\n yield {\n legendType: module.identifier,\n legend: moduleInstance\n };\n }\n }\n};\n\n// packages/ag-charts-community/src/chart/overlay/overlay.ts\nvar DEFAULT_OVERLAY_CLASS = \"ag-chart-overlay\";\nvar DEFAULT_OVERLAY_DARK_CLASS = \"ag-chart-dark-overlay\";\nvar Overlay = class extends BaseProperties {\n constructor(className, defaultText) {\n super();\n this.className = className;\n this.defaultText = defaultText;\n this.darkTheme = false;\n }\n getText() {\n var _a;\n return (_a = this.text) != null ? _a : this.defaultText;\n }\n getElement(animationManager, rect) {\n var _a;\n (_a = this.element) != null ? _a : this.element = createElement(\"div\", DEFAULT_OVERLAY_CLASS, { position: \"absolute\" });\n this.element.classList.toggle(DEFAULT_OVERLAY_DARK_CLASS, this.darkTheme);\n this.focusBox = rect;\n const element2 = this.element;\n element2.style.left = `${rect.x}px`;\n element2.style.top = `${rect.y}px`;\n element2.style.width = `${rect.width}px`;\n element2.style.height = `${rect.height}px`;\n if (this.renderer) {\n const htmlContent = this.renderer();\n if (htmlContent instanceof HTMLElement) {\n element2.replaceChildren(htmlContent);\n } else {\n element2.innerHTML = htmlContent;\n }\n } else {\n const content = createElement(\"div\", {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n boxSizing: \"border-box\",\n height: \"100%\",\n margin: \"8px\",\n font: \"12px Verdana, sans-serif\"\n });\n content.innerText = this.getText();\n element2.replaceChildren(content);\n animationManager == null ? void 0 : animationManager.animate({\n from: 0,\n to: 1,\n id: \"overlay\",\n phase: \"add\",\n groupId: \"opacity\",\n onUpdate(value) {\n element2.style.opacity = String(value);\n },\n onStop() {\n element2.style.opacity = \"1\";\n }\n });\n }\n return this.element;\n }\n removeElement(animationManager) {\n if (!this.element)\n return;\n if (animationManager) {\n const { element: element2 } = this;\n animationManager.animate({\n from: 1,\n to: 0,\n phase: \"remove\",\n id: \"overlay\",\n groupId: \"opacity\",\n onUpdate(value) {\n element2.style.opacity = String(value);\n },\n onStop() {\n element2.remove();\n }\n });\n } else {\n this.element.remove();\n }\n this.element = void 0;\n this.focusBox = void 0;\n }\n};\n__decorateClass([\n Validate(STRING, { optional: true })\n], Overlay.prototype, \"text\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], Overlay.prototype, \"renderer\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], Overlay.prototype, \"darkTheme\", 2);\n\n// packages/ag-charts-community/src/chart/overlay/chartOverlays.ts\nvar ChartOverlays = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.loading = new Overlay(\"ag-chart-loading-overlay\", \"Loading data...\");\n this.noData = new Overlay(\"ag-chart-no-data-overlay\", \"No data to display\");\n this.noVisibleSeries = new Overlay(\"ag-chart-no-visible-series\", \"No visible series\");\n }\n getFocusInfo() {\n for (const overlay of [this.loading, this.noData, this.noVisibleSeries]) {\n if (overlay.focusBox !== void 0) {\n return { text: overlay.getText(), rect: overlay.focusBox };\n }\n }\n return void 0;\n }\n destroy() {\n this.loading.removeElement();\n this.noData.removeElement();\n this.noVisibleSeries.removeElement();\n }\n};\n__decorateClass([\n Validate(OBJECT)\n], ChartOverlays.prototype, \"loading\", 2);\n__decorateClass([\n Validate(OBJECT)\n], ChartOverlays.prototype, \"noData\", 2);\n__decorateClass([\n Validate(OBJECT)\n], ChartOverlays.prototype, \"noVisibleSeries\", 2);\n\n// packages/ag-charts-community/src/chart/overlay/loadingSpinner.ts\nvar defaultOverlayCss = `\n.${DEFAULT_OVERLAY_CLASS} {\n color: #181d1f;\n}\n\n.${DEFAULT_OVERLAY_CLASS}.${DEFAULT_OVERLAY_DARK_CLASS} {\n color: #ffffff;\n}\n\n.${DEFAULT_OVERLAY_CLASS}--loading {\n color: rgb(140, 140, 140); /* DEFAULT_MUTED_LABEL_COLOUR */\n}\n\n.${DEFAULT_OVERLAY_CLASS}__loading-background {\n background: white; /* DEFAULT_BACKGROUND_FILL */\n}\n\n.${DEFAULT_OVERLAY_CLASS}.${DEFAULT_OVERLAY_DARK_CLASS} .${DEFAULT_OVERLAY_CLASS}__loading-background {\n background: #192232; /* DEFAULT_DARK_BACKGROUND_FILL */\n}\n`;\nfunction getLoadingSpinner(text, defaultDuration) {\n const { animationDuration } = PHASE_METADATA[\"add\"];\n const duration = animationDuration * defaultDuration;\n const container = createElement(\"div\", `${DEFAULT_OVERLAY_CLASS}--loading`, {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n height: \"100%\",\n boxSizing: \"border-box\",\n font: \"13px Verdana, sans-serif\",\n // FONT_SIZE.MEDIUM\n userSelect: \"none\",\n animation: `ag-charts-loading ${duration}ms linear 50ms both`\n });\n const matrix = createElement(\"span\", {\n width: \"45px\",\n height: \"40px\",\n backgroundImage: [\n \"linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), \",\n \"linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), \",\n \"linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)\"\n ].join(\"\"),\n backgroundSize: \"10px 400%\",\n backgroundRepeat: \"no-repeat\",\n animation: \"ag-charts-loading-matrix 1s infinite linear\"\n });\n const label = createElement(\"p\", { marginTop: \"1em\" });\n label.innerText = text;\n const background = createElement(\"div\", `${DEFAULT_OVERLAY_CLASS}__loading-background`, {\n position: \"absolute\",\n inset: \"0\",\n opacity: \"0.5\",\n zIndex: \"-1\"\n });\n const animationStyles = createElement(\"style\");\n animationStyles.innerText = [\n \"@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }\",\n \"@keyframes ag-charts-loading-matrix {\",\n \"0% { background-position: 0% 0%, 50% 0%, 100% 0%; }\",\n \"100% { background-position: 0% 100%, 50% 100%, 100% 100%; }\",\n \"}\"\n ].join(\" \");\n container.replaceChildren(animationStyles, matrix, label, background);\n injectStyle(defaultOverlayCss, \"chartOverlays\");\n return container;\n}\n\n// packages/ag-charts-community/src/chart/data/aggregateFunctions.ts\nfunction sumValues(values, accumulator = [0, 0]) {\n for (const value of values) {\n if (typeof value !== \"number\") {\n continue;\n }\n if (value < 0) {\n accumulator[0] += value;\n }\n if (value > 0) {\n accumulator[1] += value;\n }\n }\n return accumulator;\n}\nfunction sum(id, matchGroupId) {\n const result = {\n id,\n matchGroupIds: [matchGroupId],\n type: \"aggregate\",\n aggregateFunction: (values) => sumValues(values)\n };\n return result;\n}\nfunction groupSum(id, matchGroupId) {\n return {\n id,\n type: \"aggregate\",\n matchGroupIds: matchGroupId ? [matchGroupId] : void 0,\n aggregateFunction: (values) => sumValues(values),\n groupAggregateFunction: (next, acc = [0, 0]) => {\n var _a, _b;\n acc[0] += (_a = next == null ? void 0 : next[0]) != null ? _a : 0;\n acc[1] += (_b = next == null ? void 0 : next[1]) != null ? _b : 0;\n return acc;\n }\n };\n}\nfunction range2(id, matchGroupId) {\n const result = {\n id,\n matchGroupIds: [matchGroupId],\n type: \"aggregate\",\n aggregateFunction: (values) => ContinuousDomain.extendDomain(values)\n };\n return result;\n}\nfunction groupCount(id) {\n return {\n id,\n type: \"aggregate\",\n aggregateFunction: () => [0, 1],\n groupAggregateFunction: (next, acc = [0, 0]) => {\n var _a, _b;\n acc[0] += (_a = next == null ? void 0 : next[0]) != null ? _a : 0;\n acc[1] += (_b = next == null ? void 0 : next[1]) != null ? _b : 0;\n return acc;\n }\n };\n}\nfunction groupAverage(id, matchGroupId) {\n const def = {\n id,\n matchGroupIds: matchGroupId ? [matchGroupId] : void 0,\n type: \"aggregate\",\n aggregateFunction: (values) => sumValues(values),\n groupAggregateFunction: (next, acc = [0, 0, -1]) => {\n var _a, _b;\n acc[0] += (_a = next == null ? void 0 : next[0]) != null ? _a : 0;\n acc[1] += (_b = next == null ? void 0 : next[1]) != null ? _b : 0;\n acc[2]++;\n return acc;\n },\n finalFunction: (acc = [0, 0, 0]) => {\n const result = acc[0] + acc[1];\n if (result >= 0) {\n return [0, result / acc[2]];\n }\n return [result / acc[2], 0];\n }\n };\n return def;\n}\nfunction area(id, aggFn, matchGroupId) {\n const result = {\n id,\n matchGroupIds: matchGroupId ? [matchGroupId] : void 0,\n type: \"aggregate\",\n aggregateFunction: (values, keyRange = []) => {\n const keyWidth = keyRange[1] - keyRange[0];\n return aggFn.aggregateFunction(values).map((v) => v / keyWidth);\n }\n };\n if (aggFn.groupAggregateFunction) {\n result.groupAggregateFunction = aggFn.groupAggregateFunction;\n }\n return result;\n}\nfunction accumulatedValue(onlyPositive) {\n return () => {\n let value = 0;\n return (datum) => {\n if (!isFiniteNumber(datum)) {\n return datum;\n }\n value += onlyPositive ? Math.max(0, datum) : datum;\n return value;\n };\n };\n}\nfunction trailingAccumulatedValue() {\n return () => {\n let value = 0;\n return (datum) => {\n if (!isFiniteNumber(datum)) {\n return datum;\n }\n const trailingValue = value;\n value += datum;\n return trailingValue;\n };\n };\n}\n\n// packages/ag-charts-community/src/chart/data/processors.ts\nvar SMALLEST_KEY_INTERVAL = {\n type: \"reducer\",\n property: \"smallestKeyInterval\",\n initialValue: Infinity,\n reducer: () => {\n let prevX = NaN;\n return (smallestSoFar = Infinity, next) => {\n const nextX = next.keys[0];\n const interval = Math.abs(nextX - prevX);\n prevX = nextX;\n if (!isNaN(interval) && interval > 0 && interval < smallestSoFar) {\n return interval;\n }\n return smallestSoFar;\n };\n }\n};\nvar SORT_DOMAIN_GROUPS = {\n type: \"processor\",\n property: \"sortedGroupDomain\",\n calculate: ({ domain: { groups } }) => groups == null ? void 0 : groups.slice().sort((a, b) => {\n for (let i = 0; i < a.length; i++) {\n const result = a[i] - b[i];\n if (result !== 0) {\n return result;\n }\n }\n return 0;\n })\n};\nfunction normaliseFnBuilder({ normaliseTo, mode }) {\n const normalise = (val, extent2) => {\n const result = val * normaliseTo / extent2;\n if (result >= 0) {\n return Math.min(normaliseTo, result);\n }\n return Math.max(-normaliseTo, result);\n };\n return () => () => (values, valueIndexes) => {\n const valuesExtent = [0, 0];\n for (const valueIdx of valueIndexes) {\n const value = values[valueIdx];\n const valIdx = value < 0 ? 0 : 1;\n if (mode === \"sum\") {\n valuesExtent[valIdx] += value;\n } else if (valIdx === 0) {\n valuesExtent[valIdx] = Math.min(valuesExtent[valIdx], value);\n } else {\n valuesExtent[valIdx] = Math.max(valuesExtent[valIdx], value);\n }\n }\n const extent2 = Math.max(Math.abs(valuesExtent[0]), valuesExtent[1]);\n for (const valueIdx of valueIndexes) {\n values[valueIdx] = normalise(values[valueIdx], extent2);\n }\n };\n}\nfunction normaliseGroupTo(matchGroupIds, normaliseTo, mode = \"sum\") {\n return {\n type: \"group-value-processor\",\n matchGroupIds,\n adjust: memo({ normaliseTo, mode }, normaliseFnBuilder)\n };\n}\nfunction normalisePropertyFnBuilder({\n normaliseTo,\n zeroDomain,\n rangeMin,\n rangeMax\n}) {\n const normaliseSpan = normaliseTo[1] - normaliseTo[0];\n const normalise = (val, start, span) => {\n const result = normaliseTo[0] + (val - start) / span * normaliseSpan;\n if (span === 0) {\n return zeroDomain;\n } else if (result >= normaliseTo[1]) {\n return normaliseTo[1];\n } else if (result < normaliseTo[0]) {\n return normaliseTo[0];\n }\n return result;\n };\n return () => (pData, pIdx) => {\n let [start, end] = pData.domain.values[pIdx];\n if (rangeMin != null)\n start = rangeMin;\n if (rangeMax != null)\n end = rangeMax;\n const span = end - start;\n pData.domain.values[pIdx] = [normaliseTo[0], normaliseTo[1]];\n for (const group2 of pData.data) {\n let groupValues = group2.values;\n if (pData.type === \"ungrouped\") {\n groupValues = [groupValues];\n }\n for (const values of groupValues) {\n values[pIdx] = normalise(values[pIdx], start, span);\n }\n }\n };\n}\nfunction normalisePropertyTo(property, normaliseTo, zeroDomain, rangeMin, rangeMax) {\n return {\n type: \"property-value-processor\",\n property,\n adjust: memo({ normaliseTo, rangeMin, rangeMax, zeroDomain }, normalisePropertyFnBuilder)\n };\n}\nfunction animationValidation(valueKeyIds) {\n return {\n type: \"processor\",\n property: \"animationValidation\",\n calculate(result) {\n const { keys, values } = result.defs;\n const { input, data } = result;\n let uniqueKeys = true;\n let orderedKeys = true;\n const valueKeys = [];\n for (let k = 0; k < values.length; k++) {\n if (!(valueKeyIds == null ? void 0 : valueKeyIds.includes(values[k].id)))\n continue;\n valueKeys.push([k, values[k]]);\n }\n const processKey = (idx, def, type) => {\n var _a;\n if (def.valueType === \"category\") {\n const keyValues = result.domain[type][idx];\n uniqueKeys && (uniqueKeys = keyValues.length === input.count);\n return;\n }\n let lastValue = (_a = data[0]) == null ? void 0 : _a[type][idx];\n for (let d = 1; (uniqueKeys || orderedKeys) && d < data.length; d++) {\n const keyValue = data[d][type][idx];\n orderedKeys && (orderedKeys = lastValue <= keyValue);\n uniqueKeys && (uniqueKeys = lastValue !== keyValue);\n lastValue = keyValue;\n }\n };\n for (let k = 0; (uniqueKeys || orderedKeys) && k < keys.length; k++) {\n processKey(k, keys[k], \"keys\");\n }\n for (let k = 0; (uniqueKeys || orderedKeys) && k < valueKeys.length; k++) {\n const [idx, key] = valueKeys[k];\n processKey(idx, key, \"values\");\n }\n return { uniqueKeys, orderedKeys };\n }\n };\n}\nfunction buildGroupAccFn({ mode, separateNegative }) {\n return () => () => (values, valueIndexes) => {\n const acc = [0, 0];\n for (const valueIdx of valueIndexes) {\n const currentVal = values[valueIdx];\n const accIndex = isNegative(currentVal) && separateNegative ? 0 : 1;\n if (!isFiniteNumber(currentVal))\n continue;\n if (mode === \"normal\")\n acc[accIndex] += currentVal;\n values[valueIdx] = acc[accIndex];\n if (mode === \"trailing\")\n acc[accIndex] += currentVal;\n }\n };\n}\nfunction buildGroupWindowAccFn({ mode, sum: sum2 }) {\n return () => {\n const lastValues = [];\n let firstRow = true;\n return () => {\n return (values, valueIndexes) => {\n let acc = 0;\n for (const valueIdx of valueIndexes) {\n const currentVal = values[valueIdx];\n const lastValue = firstRow && sum2 === \"current\" ? 0 : lastValues[valueIdx];\n lastValues[valueIdx] = currentVal;\n const sumValue = sum2 === \"current\" ? currentVal : lastValue;\n if (!isFiniteNumber(currentVal) || !isFiniteNumber(lastValue)) {\n values[valueIdx] = acc;\n continue;\n }\n if (mode === \"normal\") {\n acc += sumValue;\n }\n values[valueIdx] = acc;\n if (mode === \"trailing\") {\n acc += sumValue;\n }\n }\n firstRow = false;\n };\n };\n };\n}\nfunction accumulateGroup(matchGroupId, mode, sum2, separateNegative = false) {\n let adjust;\n if (mode.startsWith(\"window\")) {\n const modeParam = mode.endsWith(\"-trailing\") ? \"trailing\" : \"normal\";\n adjust = memo({ mode: modeParam, sum: sum2 }, buildGroupWindowAccFn);\n } else {\n adjust = memo({ mode, separateNegative }, buildGroupAccFn);\n }\n return {\n type: \"group-value-processor\",\n matchGroupIds: [matchGroupId],\n adjust\n };\n}\nfunction diff(previousData, updateMovedData = true) {\n return {\n type: \"processor\",\n property: \"diff\",\n calculate: (processedData) => {\n const moved = /* @__PURE__ */ new Map();\n const added = /* @__PURE__ */ new Map();\n const updated = /* @__PURE__ */ new Map();\n const removed = /* @__PURE__ */ new Map();\n const length = Math.max(previousData.data.length, processedData.data.length);\n for (let i = 0; i < length; i++) {\n const prev = previousData.data[i];\n const datum = processedData.data[i];\n const prevId = prev ? createDatumId(prev.keys) : \"\";\n const datumId = datum ? createDatumId(datum.keys) : \"\";\n if (datum && prev && prevId === datumId) {\n if (!arraysEqual(prev.values, datum.values)) {\n updated.set(datumId, datum);\n }\n continue;\n }\n if (removed.has(datumId)) {\n if (updateMovedData || !arraysEqual(removed.get(datumId).values, datum.values)) {\n updated.set(datumId, datum);\n moved.set(datumId, datum);\n }\n removed.delete(datumId);\n } else if (datum) {\n added.set(datumId, datum);\n }\n if (added.has(prevId)) {\n if (updateMovedData || !arraysEqual(added.get(prevId).values, prev.values)) {\n updated.set(prevId, prev);\n moved.set(prevId, prev);\n }\n added.delete(prevId);\n } else if (prev) {\n updated.delete(prevId);\n removed.set(prevId, prev);\n }\n }\n const changed = added.size > 0 || updated.size > 0 || removed.size > 0;\n return { changed, added, updated, removed, moved };\n }\n };\n}\nfunction createDatumId(keys, ...extraKeys) {\n let result;\n if (isArray(keys)) {\n result = keys.map((key) => transformIntegratedCategoryValue(key)).join(\"___\");\n } else {\n result = transformIntegratedCategoryValue(keys);\n }\n const primitiveType = typeof result === \"string\" || typeof result === \"number\" || result instanceof Date;\n if (primitiveType && extraKeys.length > 0) {\n result += `___${extraKeys.join(\"___\")}`;\n }\n return result;\n}\n\n// packages/ag-charts-community/src/chart/series/series.ts\nvar SeriesNodePickMode = /* @__PURE__ */ ((SeriesNodePickMode2) => {\n SeriesNodePickMode2[SeriesNodePickMode2[\"EXACT_SHAPE_MATCH\"] = 0] = \"EXACT_SHAPE_MATCH\";\n SeriesNodePickMode2[SeriesNodePickMode2[\"NEAREST_BY_MAIN_AXIS_FIRST\"] = 1] = \"NEAREST_BY_MAIN_AXIS_FIRST\";\n SeriesNodePickMode2[SeriesNodePickMode2[\"NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST\"] = 2] = \"NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST\";\n SeriesNodePickMode2[SeriesNodePickMode2[\"NEAREST_NODE\"] = 3] = \"NEAREST_NODE\";\n return SeriesNodePickMode2;\n})(SeriesNodePickMode || {});\nfunction basicContinuousCheckDatumValidation(value) {\n return value != null && isContinuous(value);\n}\nfunction basicDiscreteCheckDatumValidation(value) {\n return value != null;\n}\nfunction getValidationFn(scaleType) {\n switch (scaleType) {\n case \"number\":\n case \"log\":\n case \"ordinal-time\":\n case \"time\":\n case \"color\":\n return basicContinuousCheckDatumValidation;\n default:\n return basicDiscreteCheckDatumValidation;\n }\n}\nfunction getValueType(scaleType) {\n switch (scaleType) {\n case \"number\":\n case \"log\":\n case \"time\":\n case \"color\":\n return \"range\";\n default:\n return \"category\";\n }\n}\nfunction keyProperty(propName, scaleType, opts = {}) {\n const result = __spreadValues({\n property: propName,\n type: \"key\",\n valueType: getValueType(scaleType),\n validation: getValidationFn(scaleType)\n }, opts);\n return result;\n}\nfunction valueProperty(propName, scaleType, opts = {}) {\n const result = __spreadValues({\n property: propName,\n type: \"value\",\n valueType: getValueType(scaleType),\n validation: getValidationFn(scaleType)\n }, opts);\n return result;\n}\nfunction rangedValueProperty(propName, opts = {}) {\n const _a = opts, { min = -Infinity, max = Infinity } = _a, defOpts = __objRest(_a, [\"min\", \"max\"]);\n return __spreadValues({\n type: \"value\",\n property: propName,\n valueType: \"range\",\n validation: basicContinuousCheckDatumValidation,\n processor: () => (datum) => isFiniteNumber(datum) ? clamp(min, datum, max) : datum\n }, defOpts);\n}\nfunction accumulativeValueProperty(propName, scaleType, opts = {}) {\n const _a = opts, { onlyPositive } = _a, defOpts = __objRest(_a, [\"onlyPositive\"]);\n const result = __spreadProps(__spreadValues({}, valueProperty(propName, scaleType, defOpts)), {\n processor: accumulatedValue(onlyPositive)\n });\n return result;\n}\nfunction trailingAccumulatedValueProperty(propName, scaleType, opts = {}) {\n const result = __spreadProps(__spreadValues({}, valueProperty(propName, scaleType, opts)), {\n processor: trailingAccumulatedValue()\n });\n return result;\n}\nfunction groupAccumulativeValueProperty(propName, mode, sum2 = \"current\", opts, scaleType) {\n return [\n valueProperty(propName, scaleType, opts),\n accumulateGroup(opts.groupId, mode, sum2, opts.separateNegative),\n ...opts.rangeId != null ? [range2(opts.rangeId, opts.groupId)] : []\n ];\n}\nvar SeriesNodeEvent = class {\n constructor(type, event, { datum }, series) {\n this.type = type;\n this.event = event;\n this.datum = datum;\n this.seriesId = series.id;\n }\n};\nvar SeriesGroupingChangedEvent = class {\n constructor(series, seriesGrouping, oldGrouping) {\n this.series = series;\n this.seriesGrouping = seriesGrouping;\n this.oldGrouping = oldGrouping;\n this.type = \"groupingChanged\";\n }\n};\nvar Series = class extends Observable {\n constructor(seriesOpts) {\n super();\n this.destroyFns = [];\n this.seriesGrouping = void 0;\n this.NodeEvent = SeriesNodeEvent;\n this.internalId = createId(this);\n // The group node that contains all the nodes used to render this series.\n this.rootGroup = new Group({ name: \"seriesRoot\", isVirtual: true });\n this.axes = {\n [\"x\" /* X */]: void 0,\n [\"y\" /* Y */]: void 0\n };\n this.directions = [\"x\" /* X */, \"y\" /* Y */];\n // Flag to determine if we should recalculate node data.\n this.nodeDataRefresh = true;\n this.moduleMap = new ModuleMap();\n this._declarationOrder = -1;\n this.seriesListeners = new Listeners();\n const {\n moduleCtx,\n pickModes = [1 /* NEAREST_BY_MAIN_AXIS_FIRST */],\n directionKeys = {},\n directionNames = {},\n contentGroupVirtual = true,\n canHaveAxes = false\n } = seriesOpts;\n this.ctx = moduleCtx;\n this.directionKeys = directionKeys;\n this.directionNames = directionNames;\n this.canHaveAxes = canHaveAxes;\n this.contentGroup = this.rootGroup.appendChild(\n new Group({\n name: `${this.internalId}-content`,\n isVirtual: contentGroupVirtual,\n zIndex: 4 /* SERIES_LAYER_ZINDEX */,\n zIndexSubOrder: this.getGroupZIndexSubOrder(\"data\")\n })\n );\n this.highlightGroup = new Group({\n name: `${this.internalId}-highlight`,\n isVirtual: contentGroupVirtual,\n zIndex: 4 /* SERIES_LAYER_ZINDEX */,\n zIndexSubOrder: this.getGroupZIndexSubOrder(\"highlight\")\n });\n this.highlightNode = this.highlightGroup.appendChild(new Group({ name: \"highlightNode\", zIndex: 0 }));\n this.highlightLabel = this.highlightGroup.appendChild(new Group({ name: \"highlightLabel\", zIndex: 10 }));\n this.pickModes = pickModes;\n this.labelGroup = this.rootGroup.appendChild(\n new Group({\n name: `${this.internalId}-series-labels`,\n zIndex: 8 /* SERIES_LABEL_ZINDEX */\n })\n );\n this.annotationGroup = new Group({\n name: `${this.id}-annotation`,\n isVirtual: contentGroupVirtual,\n zIndex: 4 /* SERIES_LAYER_ZINDEX */,\n zIndexSubOrder: this.getGroupZIndexSubOrder(\"annotation\")\n });\n }\n get id() {\n var _a, _b;\n return (_b = (_a = this.properties) == null ? void 0 : _a.id) != null ? _b : this.internalId;\n }\n get type() {\n var _a;\n return (_a = this.constructor.type) != null ? _a : \"\";\n }\n get data() {\n var _a;\n return (_a = this._data) != null ? _a : this._chartData;\n }\n set visible(value) {\n this.properties.visible = value;\n this.visibleChanged();\n }\n get visible() {\n return this.properties.visible;\n }\n get hasData() {\n return this.data != null && this.data.length > 0;\n }\n get tooltipEnabled() {\n var _a, _b;\n return (_b = (_a = this.properties.tooltip) == null ? void 0 : _a.enabled) != null ? _b : false;\n }\n onDataChange() {\n this.nodeDataRefresh = true;\n }\n setOptionsData(input) {\n this._data = input;\n this.onDataChange();\n }\n setChartData(input) {\n this._chartData = input;\n if (this.data === input) {\n this.onDataChange();\n }\n }\n onSeriesGroupingChange(prev, next) {\n const { internalId, type, visible } = this;\n if (prev) {\n this.ctx.seriesStateManager.deregisterSeries({ id: internalId, type });\n }\n if (next) {\n this.ctx.seriesStateManager.registerSeries({ id: internalId, type, visible, seriesGrouping: next });\n }\n this.fireEvent(new SeriesGroupingChangedEvent(this, next, prev));\n }\n getBandScalePadding() {\n return { inner: 1, outer: 0 };\n }\n getGroupZIndexSubOrder(type, subIndex = 0) {\n let mainAdjust = 0;\n switch (type) {\n case \"data\":\n case \"paths\":\n break;\n case \"labels\":\n mainAdjust += 2e4;\n break;\n case \"marker\":\n mainAdjust += 1e4;\n break;\n case \"highlight\":\n subIndex += 15e3;\n break;\n case \"annotation\":\n mainAdjust += 15e3;\n break;\n }\n const main = () => this._declarationOrder + mainAdjust;\n return [main, subIndex];\n }\n addListener(type, listener) {\n return this.seriesListeners.addListener(type, listener);\n }\n dispatch(type, event) {\n this.seriesListeners.dispatch(type, event);\n }\n addChartEventListeners() {\n return;\n }\n destroy() {\n this.destroyFns.forEach((f) => f());\n this.destroyFns = [];\n this.ctx.seriesStateManager.deregisterSeries(this);\n }\n getDirectionValues(direction, properties) {\n const resolvedDirection = this.resolveKeyDirection(direction);\n const keys = properties == null ? void 0 : properties[resolvedDirection];\n const values = [];\n if (!keys) {\n return values;\n }\n const addValues = (...items) => {\n for (const value of items) {\n if (Array.isArray(value)) {\n addValues(...value);\n } else if (typeof value === \"object\") {\n addValues(...Object.values(value));\n } else {\n values.push(value);\n }\n }\n };\n addValues(...keys.map((key) => this.properties[key]));\n return values;\n }\n getKeys(direction) {\n return this.getDirectionValues(direction, this.directionKeys);\n }\n getKeyProperties(direction) {\n var _a;\n return (_a = this.directionKeys[this.resolveKeyDirection(direction)]) != null ? _a : [];\n }\n getNames(direction) {\n return this.getDirectionValues(direction, this.directionNames);\n }\n resolveKeyDirection(direction) {\n return direction;\n }\n // The union of the series domain ('community') and series-option domains ('enterprise').\n getDomain(direction) {\n const seriesDomain = this.getSeriesDomain(direction);\n const moduleDomains = this.moduleMap.mapModules((module) => module.getDomain(direction));\n return seriesDomain.concat(moduleDomains.flat());\n }\n // Indicate that something external changed and we should recalculate nodeData.\n markNodeDataDirty() {\n this.nodeDataRefresh = true;\n }\n visibleChanged() {\n this.ctx.seriesStateManager.registerSeries(this);\n }\n getOpacity() {\n const defaultOpacity = 1;\n const { dimOpacity = 1, enabled = true } = this.properties.highlightStyle.series;\n if (!enabled || dimOpacity === defaultOpacity) {\n return defaultOpacity;\n }\n switch (this.isItemIdHighlighted()) {\n case 0 /* None */:\n case 1 /* This */:\n return defaultOpacity;\n case 2 /* Other */:\n default:\n return dimOpacity;\n }\n }\n getStrokeWidth(defaultStrokeWidth) {\n const { strokeWidth, enabled = true } = this.properties.highlightStyle.series;\n if (!enabled || strokeWidth === void 0) {\n return defaultStrokeWidth;\n }\n switch (this.isItemIdHighlighted()) {\n case 1 /* This */:\n return strokeWidth;\n case 0 /* None */:\n case 2 /* Other */:\n return defaultStrokeWidth;\n }\n }\n isItemIdHighlighted() {\n var _a, _b;\n const series = (_b = (_a = this.ctx.highlightManager) == null ? void 0 : _a.getActiveHighlight()) == null ? void 0 : _b.series;\n if (series == null) {\n return 0 /* None */;\n }\n if (series !== this) {\n return 2 /* Other */;\n }\n return 1 /* This */;\n }\n getModuleTooltipParams() {\n return this.moduleMap.mapModules((module) => module.getTooltipParams()).reduce((total, current) => Object.assign(total, current), {});\n }\n pickNode(point, limitPickModes) {\n const { pickModes, visible, rootGroup } = this;\n if (!visible || !rootGroup.visible) {\n return;\n }\n for (const pickMode of pickModes) {\n if (limitPickModes && !limitPickModes.includes(pickMode)) {\n continue;\n }\n let match;\n switch (pickMode) {\n case 0 /* EXACT_SHAPE_MATCH */:\n match = this.pickNodeExactShape(point);\n break;\n case 1 /* NEAREST_BY_MAIN_AXIS_FIRST */:\n case 2 /* NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST */:\n match = this.pickNodeMainAxisFirst(\n point,\n pickMode === 2 /* NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST */\n );\n break;\n case 3 /* NEAREST_NODE */:\n match = this.pickNodeClosestDatum(point);\n break;\n }\n if (match) {\n return { pickMode, match: match.datum, distance: match.distance };\n }\n }\n }\n pickNodeExactShape(point) {\n const match = this.contentGroup.pickNode(point.x, point.y);\n if (match && match.datum.missing !== true) {\n return { datum: match.datum, distance: 0 };\n }\n return void 0;\n }\n pickNodeClosestDatum(_point) {\n throw new Error(\"AG Charts - Series.pickNodeClosestDatum() not implemented\");\n }\n pickNodeNearestDistantObject(point, items) {\n const match = nearestSquared(point.x, point.y, items);\n if (match.nearest !== void 0 && match.nearest.datum.missing !== true) {\n return { datum: match.nearest.datum, distance: Math.sqrt(match.distanceSquared) };\n }\n return void 0;\n }\n pickNodeMainAxisFirst(_point, _requireCategoryAxis) {\n throw new Error(\"AG Charts - Series.pickNodeMainAxisFirst() not implemented\");\n }\n fireNodeClickEvent(event, datum) {\n this.fireEvent(new this.NodeEvent(\"nodeClick\", event, datum, this));\n }\n fireNodeDoubleClickEvent(event, datum) {\n this.fireEvent(new this.NodeEvent(\"nodeDoubleClick\", event, datum, this));\n }\n createNodeContextMenuActionEvent(event, datum) {\n return new this.NodeEvent(\"nodeContextMenuAction\", event, datum, this);\n }\n toggleSeriesItem(itemId, enabled) {\n this.visible = enabled;\n this.nodeDataRefresh = true;\n this.dispatch(\"visibility-changed\", { itemId, enabled });\n }\n isEnabled() {\n return this.visible;\n }\n getModuleMap() {\n return this.moduleMap;\n }\n createModuleContext() {\n return __spreadProps(__spreadValues({}, this.ctx), { series: this });\n }\n getLabelText(label, params, defaultFormatter = String) {\n var _a;\n if (label.formatter) {\n return (_a = this.ctx.callbackCache.call(label.formatter, __spreadValues({ seriesId: this.id }, params))) != null ? _a : defaultFormatter(params.value);\n }\n return defaultFormatter(params.value);\n }\n getMarkerStyle(marker, params, defaultStyle = marker.getStyle()) {\n var _a, _b;\n const defaultSize = { size: (_b = (_a = params.datum.point) == null ? void 0 : _a.size) != null ? _b : 0 };\n const markerStyle = mergeDefaults(defaultSize, defaultStyle);\n if (marker.formatter) {\n const style = this.ctx.callbackCache.call(marker.formatter, __spreadProps(__spreadValues(__spreadValues({\n seriesId: this.id\n }, markerStyle), params), {\n datum: params.datum.datum\n }));\n return mergeDefaults(style, markerStyle);\n }\n return markerStyle;\n }\n updateMarkerStyle(markerNode, marker, params, defaultStyle = marker.getStyle(), { applyTranslation = true } = {}) {\n const { point } = params.datum;\n const activeStyle = this.getMarkerStyle(marker, params, defaultStyle);\n const visible = this.visible && activeStyle.size > 0 && point && !isNaN(point.x) && !isNaN(point.y);\n if (applyTranslation) {\n markerNode.setProperties(__spreadProps(__spreadValues({ visible }, activeStyle), { translationX: point == null ? void 0 : point.x, translationY: point == null ? void 0 : point.y }));\n } else {\n markerNode.setProperties(__spreadValues({ visible }, activeStyle));\n }\n if (typeof marker.shape === \"function\" && !markerNode.dirtyPath) {\n markerNode.path.clear(true);\n markerNode.updatePath();\n markerNode.checkPathDirty();\n }\n }\n getMinRects(_width, _height) {\n return;\n }\n get nodeDataDependencies() {\n var _a;\n return (_a = this._nodeDataDependencies) != null ? _a : { seriesRectWidth: NaN, seriesRectHeight: NaN };\n }\n checkResize(newSeriesRect) {\n const { width: seriesRectWidth, height: seriesRectHeight } = newSeriesRect != null ? newSeriesRect : { width: NaN, height: NaN };\n const newNodeDataDependencies = newSeriesRect ? { seriesRectWidth, seriesRectHeight } : void 0;\n const resize = jsonDiff(this.nodeDataDependencies, newNodeDataDependencies) != null;\n if (resize) {\n this._nodeDataDependencies = newNodeDataDependencies;\n this.markNodeDataDirty();\n }\n return resize;\n }\n pickFocus(_opts) {\n return void 0;\n }\n};\nSeries.highlightedZIndex = 1e12;\n__decorateClass([\n ActionOnSet({\n changeValue: function(newVal, oldVal) {\n this.onSeriesGroupingChange(oldVal, newVal);\n }\n })\n], Series.prototype, \"seriesGrouping\", 2);\n\n// packages/ag-charts-community/src/chart/series/seriesLayerManager.ts\nvar SERIES_THRESHOLD_FOR_AGGRESSIVE_LAYER_REDUCTION = 30;\nvar SeriesLayerManager = class {\n constructor(seriesRoot, highlightRoot, annotationRoot) {\n this.seriesRoot = seriesRoot;\n this.highlightRoot = highlightRoot;\n this.annotationRoot = annotationRoot;\n this.groups = {};\n this.series = {};\n this.expectedSeriesCount = 1;\n this.mode = \"normal\";\n }\n setSeriesCount(count) {\n this.expectedSeriesCount = count;\n }\n requestGroup(seriesConfig) {\n var _a, _b, _c, _d;\n const {\n internalId,\n type,\n rootGroup: seriesRootGroup,\n highlightGroup: seriesHighlightGroup,\n annotationGroup: seriesAnnotationGroup,\n seriesGrouping\n } = seriesConfig;\n const { groupIndex = internalId } = seriesGrouping != null ? seriesGrouping : {};\n if (this.series[internalId] != null) {\n throw new Error(`AG Charts - series already has an allocated layer: ${this.series[internalId]}`);\n }\n if (Object.keys(this.series).length === 0) {\n this.mode = this.expectedSeriesCount >= SERIES_THRESHOLD_FOR_AGGRESSIVE_LAYER_REDUCTION ? \"aggressive-grouping\" : \"normal\";\n }\n (_b = (_a = this.groups)[type]) != null ? _b : _a[type] = {};\n const lookupIndex = this.lookupIdx(groupIndex);\n let groupInfo = this.groups[type][lookupIndex];\n if (!groupInfo) {\n groupInfo = (_d = (_c = this.groups[type])[lookupIndex]) != null ? _d : _c[lookupIndex] = {\n seriesIds: [],\n group: this.seriesRoot.appendChild(\n new Group({\n name: `${type}-content`,\n layer: true,\n zIndex: 4 /* SERIES_LAYER_ZINDEX */,\n zIndexSubOrder: seriesConfig.getGroupZIndexSubOrder(\"data\")\n })\n ),\n highlight: this.highlightRoot.appendChild(\n new Group({\n name: `${type}-highlight`,\n zIndex: 4 /* SERIES_LAYER_ZINDEX */,\n zIndexSubOrder: seriesConfig.getGroupZIndexSubOrder(\"highlight\")\n })\n ),\n annotation: this.annotationRoot.appendChild(\n new Group({\n name: `${type}-annotation`,\n zIndex: 4 /* SERIES_LAYER_ZINDEX */,\n zIndexSubOrder: seriesConfig.getGroupZIndexSubOrder(\"annotation\")\n })\n )\n };\n }\n this.series[internalId] = { layerState: groupInfo, seriesConfig };\n groupInfo.seriesIds.push(internalId);\n groupInfo.group.appendChild(seriesRootGroup);\n groupInfo.highlight.appendChild(seriesHighlightGroup);\n groupInfo.annotation.appendChild(seriesAnnotationGroup);\n return groupInfo.group;\n }\n changeGroup(seriesConfig) {\n var _a, _b;\n const { internalId, seriesGrouping, type, rootGroup, highlightGroup, annotationGroup, oldGrouping } = seriesConfig;\n const { groupIndex = internalId } = seriesGrouping != null ? seriesGrouping : {};\n if ((_b = (_a = this.groups[type]) == null ? void 0 : _a[groupIndex]) == null ? void 0 : _b.seriesIds.includes(internalId)) {\n return;\n }\n if (this.series[internalId] != null) {\n this.releaseGroup({\n internalId,\n seriesGrouping: oldGrouping,\n type,\n rootGroup,\n highlightGroup,\n annotationGroup\n });\n }\n this.requestGroup(seriesConfig);\n }\n releaseGroup(seriesConfig) {\n var _a, _b, _c, _d, _e;\n const { internalId, seriesGrouping, rootGroup, highlightGroup, annotationGroup, type } = seriesConfig;\n const { groupIndex = internalId } = seriesGrouping != null ? seriesGrouping : {};\n if (this.series[internalId] == null) {\n throw new Error(`AG Charts - series doesn't have an allocated layer: ${internalId}`);\n }\n const lookupIndex = this.lookupIdx(groupIndex);\n const groupInfo = (_c = (_a = this.groups[type]) == null ? void 0 : _a[lookupIndex]) != null ? _c : (_b = this.series[internalId]) == null ? void 0 : _b.layerState;\n if (groupInfo) {\n groupInfo.seriesIds = groupInfo.seriesIds.filter((v) => v !== internalId);\n groupInfo.group.removeChild(rootGroup);\n groupInfo.highlight.removeChild(highlightGroup);\n groupInfo.annotation.removeChild(annotationGroup);\n }\n if ((groupInfo == null ? void 0 : groupInfo.seriesIds.length) === 0) {\n this.seriesRoot.removeChild(groupInfo.group);\n this.highlightRoot.removeChild(groupInfo.highlight);\n this.annotationRoot.removeChild(groupInfo.annotation);\n delete this.groups[type][lookupIndex];\n delete this.groups[type][internalId];\n } else if ((groupInfo == null ? void 0 : groupInfo.seriesIds.length) > 0) {\n const leadSeriesConfig = (_e = this.series[(_d = groupInfo == null ? void 0 : groupInfo.seriesIds) == null ? void 0 : _d[0]]) == null ? void 0 : _e.seriesConfig;\n groupInfo.group.zIndexSubOrder = leadSeriesConfig == null ? void 0 : leadSeriesConfig.getGroupZIndexSubOrder(\"data\");\n groupInfo.highlight.zIndexSubOrder = leadSeriesConfig == null ? void 0 : leadSeriesConfig.getGroupZIndexSubOrder(\"highlight\");\n groupInfo.annotation.zIndexSubOrder = leadSeriesConfig == null ? void 0 : leadSeriesConfig.getGroupZIndexSubOrder(\"annotation\");\n }\n delete this.series[internalId];\n }\n lookupIdx(groupIndex) {\n if (this.mode === \"normal\") {\n return groupIndex;\n }\n if (typeof groupIndex === \"string\") {\n groupIndex = Number(groupIndex.split(\"-\").slice(-1)[0]);\n if (!groupIndex) {\n return 0;\n }\n }\n return Math.floor(\n clamp(0, groupIndex / this.expectedSeriesCount, 1) * SERIES_THRESHOLD_FOR_AGGRESSIVE_LAYER_REDUCTION\n );\n }\n destroy() {\n for (const groups of Object.values(this.groups)) {\n for (const groupInfo of Object.values(groups)) {\n this.seriesRoot.removeChild(groupInfo.group);\n this.highlightRoot.removeChild(groupInfo.highlight);\n this.annotationRoot.removeChild(groupInfo.annotation);\n }\n }\n this.groups = {};\n this.series = {};\n }\n};\n\n// packages/ag-charts-community/src/chart/update/baseLayoutProcessor.ts\nvar BaseLayoutProcessor = class {\n constructor(chartLike, layoutService) {\n this.chartLike = chartLike;\n this.layoutService = layoutService;\n this.destroyFns = [];\n this.destroyFns.push(\n // eslint-disable-next-line sonarjs/no-duplicate-string\n this.layoutService.addListener(\"start-layout\", (e) => this.positionPadding(e.shrinkRect)),\n this.layoutService.addListener(\"start-layout\", (e) => this.positionCaptions(e.shrinkRect))\n );\n }\n destroy() {\n this.destroyFns.forEach((cb) => cb());\n }\n positionPadding(shrinkRect) {\n const { padding } = this.chartLike;\n shrinkRect.shrink(padding.left, \"left\");\n shrinkRect.shrink(padding.top, \"top\");\n shrinkRect.shrink(padding.right, \"right\");\n shrinkRect.shrink(padding.bottom, \"bottom\");\n return { shrinkRect };\n }\n positionCaptions(shrinkRect) {\n var _a, _b;\n const { title, subtitle, footnote } = this.chartLike;\n const newShrinkRect = shrinkRect.clone();\n const updateCaption = (caption) => {\n var _a2;\n const defaultCaptionHeight = shrinkRect.height / 10;\n const captionLineHeight = (_a2 = caption.lineHeight) != null ? _a2 : caption.fontSize * Text.defaultLineHeightRatio;\n const maxWidth = shrinkRect.width;\n const maxHeight = Math.max(captionLineHeight, defaultCaptionHeight);\n caption.computeTextWrap(maxWidth, maxHeight);\n };\n const computeX = (align) => {\n if (align === \"left\") {\n return newShrinkRect.x;\n } else if (align === \"right\") {\n return newShrinkRect.x + newShrinkRect.width;\n } else if (align !== \"center\") {\n Logger.error(`invalid textAlign value: ${align}`);\n }\n return newShrinkRect.x + newShrinkRect.width / 2;\n };\n const positionTopAndShrinkBBox = (caption, spacing) => {\n const baseY = newShrinkRect.y;\n caption.node.x = computeX(caption.textAlign);\n caption.node.y = baseY;\n caption.node.textBaseline = \"top\";\n updateCaption(caption);\n const bbox = caption.node.computeBBox();\n const bboxHeight = Math.ceil(bbox.y - baseY + bbox.height + spacing);\n newShrinkRect.shrink(bboxHeight, \"top\");\n };\n const positionBottomAndShrinkBBox = (caption, spacing) => {\n const baseY = newShrinkRect.y + newShrinkRect.height;\n caption.node.x = computeX(caption.textAlign);\n caption.node.y = baseY;\n caption.node.textBaseline = \"bottom\";\n updateCaption(caption);\n const bbox = caption.node.computeBBox();\n const bboxHeight = Math.ceil(baseY - bbox.y + spacing);\n newShrinkRect.shrink(bboxHeight, \"bottom\");\n };\n title.node.visible = title.enabled;\n subtitle.node.visible = subtitle.enabled;\n footnote.node.visible = footnote.enabled;\n if (title.enabled) {\n const { spacing = subtitle.enabled ? Caption.SMALL_PADDING : Caption.LARGE_PADDING } = title;\n positionTopAndShrinkBBox(title, spacing);\n }\n if (subtitle.enabled) {\n positionTopAndShrinkBBox(subtitle, (_a = subtitle.spacing) != null ? _a : 0);\n }\n if (footnote.enabled) {\n positionBottomAndShrinkBBox(footnote, (_b = footnote.spacing) != null ? _b : 0);\n }\n return { shrinkRect: newShrinkRect };\n }\n};\n\n// packages/ag-charts-community/src/chart/update/dataWindowProcessor.ts\nvar DataWindowProcessor = class {\n constructor(chart, dataService, updateService, zoomManager) {\n this.chart = chart;\n this.dataService = dataService;\n this.updateService = updateService;\n this.zoomManager = zoomManager;\n this.dirtyZoom = false;\n this.dirtyDataSource = false;\n this.lastAxisZooms = /* @__PURE__ */ new Map();\n this.destroyFns = [];\n this.destroyFns.push(\n this.dataService.addListener(\"data-source-change\", () => this.onDataSourceChange()),\n this.dataService.addListener(\"data-load\", () => this.onDataLoad()),\n this.dataService.addListener(\"data-error\", () => this.onDataError()),\n this.updateService.addListener(\"update-complete\", () => this.onUpdateComplete()),\n this.zoomManager.addListener(\"zoom-change\", () => this.onZoomChange())\n );\n }\n destroy() {\n this.destroyFns.forEach((cb) => cb());\n }\n onDataLoad() {\n this.updateService.update(1 /* UPDATE_DATA */);\n }\n onDataError() {\n this.updateService.update(3 /* PERFORM_LAYOUT */);\n }\n onDataSourceChange() {\n this.dirtyDataSource = true;\n }\n onUpdateComplete() {\n if (!this.dirtyZoom && !this.dirtyDataSource)\n return;\n this.updateWindow().catch((e) => Logger.errorOnce(e));\n }\n onZoomChange() {\n this.dirtyZoom = true;\n }\n updateWindow() {\n return __async(this, null, function* () {\n if (!this.dataService.isLazy())\n return;\n const axis = this.getValidAxis();\n let window2;\n let shouldRefresh = true;\n if (axis) {\n const zoom2 = this.zoomManager.getAxisZoom(axis.id);\n window2 = this.getAxisWindow(axis, zoom2);\n shouldRefresh = this.shouldRefresh(axis, zoom2);\n }\n this.dirtyZoom = false;\n this.dirtyDataSource = false;\n if (!shouldRefresh)\n return;\n this.dataService.load({ windowStart: window2 == null ? void 0 : window2.min, windowEnd: window2 == null ? void 0 : window2.max });\n });\n }\n getValidAxis() {\n return this.chart.axes.find((axis) => axis.type === \"time\");\n }\n shouldRefresh(axis, zoom2) {\n if (this.dirtyDataSource)\n return true;\n if (!this.dirtyZoom)\n return false;\n const lastZoom = this.lastAxisZooms.get(axis.id);\n if (lastZoom && zoom2.min === lastZoom.min && zoom2.max === lastZoom.max) {\n return false;\n }\n this.lastAxisZooms.set(axis.id, zoom2);\n return true;\n }\n getAxisWindow(axis, zoom2) {\n var _a, _b;\n const domain = (_b = (_a = axis.scale).getDomain) == null ? void 0 : _b.call(_a);\n if (!zoom2 || !domain || domain.length === 0 || isNaN(Number(domain[0])))\n return;\n const diff2 = Number(domain[1]) - Number(domain[0]);\n const min = new Date(Number(domain[0]) + diff2 * zoom2.min);\n const max = new Date(Number(domain[0]) + diff2 * zoom2.max);\n return { min, max };\n }\n};\n\n// packages/ag-charts-community/src/chart/update/overlaysProcessor.ts\nvar OverlaysProcessor = class {\n constructor(chartLike, overlays, dataService, layoutService, animationManager) {\n this.chartLike = chartLike;\n this.overlays = overlays;\n this.dataService = dataService;\n this.layoutService = layoutService;\n this.animationManager = animationManager;\n this.destroyFns = [];\n this.destroyFns.push(this.layoutService.addListener(\"layout-complete\", (e) => this.onLayoutComplete(e)));\n }\n destroy() {\n this.destroyFns.forEach((cb) => cb());\n }\n onLayoutComplete({ series: { rect } }) {\n const isLoading = this.dataService.isLoading();\n const hasData = this.chartLike.series.some((s) => s.hasData);\n const anySeriesVisible = this.chartLike.series.some((s) => s.visible);\n this.toggleOverlay(this.overlays.loading, rect, isLoading);\n this.toggleOverlay(this.overlays.noData, rect, !isLoading && !hasData);\n this.toggleOverlay(this.overlays.noVisibleSeries, rect, hasData && !anySeriesVisible);\n }\n toggleOverlay(overlay, seriesRect, visible) {\n if (visible) {\n const element2 = overlay.getElement(this.animationManager, seriesRect);\n this.chartLike.element.append(element2);\n } else {\n overlay.removeElement(this.animationManager);\n }\n }\n};\n\n// packages/ag-charts-community/src/chart/chart.ts\nvar debug = Debug.create(true, \"opts\");\nvar SeriesArea = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.padding = new Padding(0);\n }\n};\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], SeriesArea.prototype, \"clip\", 2);\n__decorateClass([\n Validate(OBJECT)\n], SeriesArea.prototype, \"padding\", 2);\nvar _Chart = class _Chart extends Observable {\n constructor(options, resources) {\n var _a, _b, _c;\n super();\n this.id = createId(this);\n this.seriesRoot = new Group({ name: `${this.id}-series-root` });\n this.highlightRoot = new Group({\n name: `${this.id}-highlight-root`,\n layer: true,\n zIndex: 5 /* SERIES_HIGHLIGHT_ZINDEX */,\n nonEmptyChildDerivedZIndex: true\n });\n this.annotationRoot = new Group({\n name: `${this.id}-annotation-root`,\n layer: true,\n zIndex: 10 /* SERIES_ANNOTATION_ZINDEX */\n });\n this.debug = Debug.create();\n this.extraDebugStats = {};\n this.data = [];\n this._firstAutoSize = true;\n this.padding = new Padding(20);\n this.seriesArea = new SeriesArea();\n this.title = new Caption();\n this.subtitle = new Caption();\n this.footnote = new Caption();\n this.keyboard = new Keyboard();\n this.mode = \"standalone\";\n this.destroyed = false;\n this._skipSync = false;\n this._destroyFns = [];\n this.chartAnimationPhase = \"initial\";\n this.modulesManager = new ModulesManager();\n // FIXME: zoomManager should be owned by ctx, but it can't because it is used by CartesianChart.onAxisChange before ctx is initialised\n this.zoomManager = new ZoomManager();\n this.processors = [];\n this.processedOptions = {};\n this.userOptions = {};\n this.queuedUserOptions = [];\n this._pendingFactoryUpdatesCount = 0;\n this._performUpdateNoRenderCount = 0;\n this._performUpdateSkipAnimations = false;\n this.performUpdateType = 7 /* NONE */;\n this.updateShortcutCount = 0;\n this.seriesToUpdate = /* @__PURE__ */ new Set();\n this.updateMutex = new Mutex();\n this.updateRequestors = {};\n this.performUpdateTrigger = debouncedCallback((_0) => __async(this, [_0], function* ({ count }) {\n if (this.destroyed)\n return;\n this.updateMutex.acquire(() => __async(this, null, function* () {\n try {\n yield this.performUpdate(count);\n } catch (error) {\n Logger.error(\"update error\", error);\n }\n })).catch((e) => Logger.errorOnce(e));\n }));\n this._performUpdateSplits = {};\n this.axes = [];\n this.series = [];\n this.focus = {\n hasFocus: false,\n series: void 0,\n seriesIndex: 0,\n datumIndex: 0,\n datum: void 0\n };\n this.pointerScheduler = debouncedAnimationFrame(() => {\n if (!this.lastInteractionEvent)\n return;\n if (this.performUpdateType <= 4 /* SERIES_UPDATE */) {\n this.pointerScheduler.schedule();\n return;\n }\n this.handlePointer(this.lastInteractionEvent, false);\n this.lastInteractionEvent = void 0;\n });\n this.onSeriesNodeClick = (event) => {\n const seriesNodeClickEvent = __spreadProps(__spreadValues({}, event), {\n type: \"seriesNodeClick\"\n });\n Object.defineProperty(seriesNodeClickEvent, \"series\", {\n enumerable: false,\n // Should display the deprecation warning\n get: () => event.series\n });\n this.fireEvent(seriesNodeClickEvent);\n };\n this.onSeriesNodeDoubleClick = (event) => {\n const seriesNodeDoubleClick = __spreadProps(__spreadValues({}, event), {\n type: \"seriesNodeDoubleClick\"\n });\n this.fireEvent(seriesNodeDoubleClick);\n };\n this.seriesGroupingChanged = (event) => {\n if (!(event instanceof SeriesGroupingChangedEvent))\n return;\n const { series, seriesGrouping, oldGrouping } = event;\n if (series.rootGroup.parent == null)\n return;\n this.seriesLayerManager.changeGroup({\n internalId: series.internalId,\n type: series.type,\n rootGroup: series.rootGroup,\n highlightGroup: series.highlightGroup,\n annotationGroup: series.annotationGroup,\n getGroupZIndexSubOrder: (type) => series.getGroupZIndexSubOrder(type),\n seriesGrouping,\n oldGrouping\n });\n };\n this.dataProcessListeners = /* @__PURE__ */ new Set();\n this.chartOptions = options;\n let scene = resources == null ? void 0 : resources.scene;\n const element2 = (_a = resources == null ? void 0 : resources.element) != null ? _a : createElement(\"div\", \"ag-chart-wrapper\", { position: \"relative\", userSelect: \"none\" });\n const container = resources == null ? void 0 : resources.container;\n this.element = element2;\n const root = new Group({ name: \"root\" });\n root.visible = false;\n root.append(this.seriesRoot);\n root.append(this.highlightRoot);\n root.append(this.annotationRoot);\n this.axisGridGroup = new Group({ name: \"Axes-Grids\", layer: true, zIndex: 1 /* AXIS_GRID_ZINDEX */ });\n root.appendChild(this.axisGridGroup);\n this.axisGroup = new Group({ name: \"Axes\", layer: true, zIndex: 2 /* AXIS_ZINDEX */ });\n root.appendChild(this.axisGroup);\n this.sizeMonitor = new SizeMonitor();\n this.sizeMonitor.observe(this.element, (size) => this.rawResize(size));\n const { overrideDevicePixelRatio } = options.specialOverrides;\n scene != null ? scene : scene = new Scene({ pixelRatio: overrideDevicePixelRatio, canvasPosition: \"absolute\" });\n scene.setRoot(root).setContainer(element2);\n this.autoSize = true;\n this.tooltip = new Tooltip();\n this.seriesLayerManager = new SeriesLayerManager(this.seriesRoot, this.highlightRoot, this.annotationRoot);\n const ctx = this.ctx = new ChartContext(this, {\n scene,\n syncManager: new SyncManager(this),\n element: element2,\n updateCallback: (type = 0 /* FULL */, opts) => this.update(type, opts),\n updateMutex: this.updateMutex\n });\n this.overlays = new ChartOverlays();\n (_c = (_b = this.overlays.loading).renderer) != null ? _c : _b.renderer = () => getLoadingSpinner(this.overlays.loading.getText(), ctx.animationManager.defaultDuration);\n this.processors = [\n new BaseLayoutProcessor(this, ctx.layoutService),\n new DataWindowProcessor(this, ctx.dataService, ctx.updateService, ctx.zoomManager),\n new OverlaysProcessor(this, this.overlays, ctx.dataService, ctx.layoutService, ctx.animationManager)\n ];\n this.highlight = new ChartHighlight();\n this.container = container;\n const { All } = InteractionState;\n const moduleContext = this.getModuleContext();\n const seriesRegion = ctx.regionManager.addRegion(\"series\", this.seriesRoot, this.axisGroup);\n ctx.regionManager.addRegion(\"root\", root);\n this._destroyFns.push(\n ctx.dataService.addListener(\"data-load\", (event) => {\n this.data = event.data;\n }),\n ctx.scene.attachNode(this.title.node),\n ctx.scene.attachNode(this.subtitle.node),\n ctx.scene.attachNode(this.footnote.node),\n this.title.registerInteraction(moduleContext, \"title\"),\n this.subtitle.registerInteraction(moduleContext, \"subtitle\"),\n this.footnote.registerInteraction(moduleContext, \"footnote\"),\n ctx.interactionManager.addListener(\"click\", (event) => this.onClick(event)),\n ctx.interactionManager.addListener(\"dblclick\", (event) => this.onDoubleClick(event)),\n seriesRegion.addListener(\"hover\", (event) => this.onMouseMove(event)),\n seriesRegion.addListener(\"leave\", (event) => this.onLeave(event)),\n seriesRegion.addListener(\"blur\", () => this.onBlur()),\n seriesRegion.addListener(\"tab\", (event) => this.onTab(event)),\n seriesRegion.addListener(\"nav-vert\", (event) => this.onNavVert(event)),\n seriesRegion.addListener(\"nav-hori\", (event) => this.onNavHori(event)),\n seriesRegion.addListener(\"submit\", (event) => this.onSubmit(event)),\n ctx.keyNavManager.addListener(\"browserfocus\", (event) => this.onBrowserFocus(event)),\n ctx.interactionManager.addListener(\"page-left\", () => this.destroy()),\n ctx.interactionManager.addListener(\"contextmenu\", (event) => this.onContextMenu(event), All),\n ctx.animationManager.addListener(\"animation-start\", () => this.onAnimationStart()),\n ctx.animationManager.addListener(\"animation-frame\", () => {\n this.update(6 /* SCENE_RENDER */);\n }),\n ctx.highlightManager.addListener(\"highlight-change\", (event) => this.changeHighlightDatum(event)),\n ctx.zoomManager.addListener(\"zoom-pan-start\", () => this.resetPointer()),\n ctx.zoomManager.addListener(\"zoom-change\", () => {\n this.resetPointer();\n this.series.map((s) => {\n var _a2;\n return (_a2 = s.animationState) == null ? void 0 : _a2.transition(\"updateData\");\n });\n const skipAnimations = this.chartAnimationPhase !== \"initial\";\n this.update(3 /* PERFORM_LAYOUT */, { forceNodeDataRefresh: true, skipAnimations });\n })\n );\n }\n static getInstance(element2) {\n return _Chart.chartsInstances.get(element2);\n }\n /** NOTE: This is exposed for use by Integrated charts only. */\n get canvasElement() {\n return this.ctx.scene.canvas.element;\n }\n /** NOTE: This is exposed for use by Integrated charts only. */\n getCanvasDataURL(fileFormat) {\n return this.ctx.scene.getDataURL(fileFormat);\n }\n onAutoSizeChange(value) {\n const { style } = this.element;\n if (value) {\n style.display = \"block\";\n style.width = \"100%\";\n style.height = \"100%\";\n if (!this._lastAutoSize) {\n return;\n }\n this.resize(void 0, void 0, \"autoSize option\");\n } else {\n style.display = \"inline-block\";\n style.width = \"auto\";\n style.height = \"auto\";\n }\n }\n download(fileName, fileFormat) {\n this.ctx.scene.download(fileName, fileFormat);\n }\n getOptions() {\n var _a;\n return (_a = this.queuedUserOptions.at(-1)) != null ? _a : this.userOptions;\n }\n getModuleContext() {\n return this.ctx;\n }\n getAriaLabel() {\n var _a;\n const captionText = [this.title, this.subtitle, this.footnote].filter((caption) => caption.enabled && caption.text).map((caption) => caption.text).join(\". \");\n const nSeries = (_a = this.series.length) != null ? _a : 0;\n return `chart, ${nSeries} series, ${captionText}`;\n }\n resetAnimations() {\n this.chartAnimationPhase = \"initial\";\n for (const series of this.series) {\n series.resetAnimation(this.chartAnimationPhase);\n }\n for (const axis of this.axes) {\n axis.resetAnimation(this.chartAnimationPhase);\n }\n this.animationRect = void 0;\n this.ctx.animationManager.reset();\n }\n skipAnimations() {\n this.ctx.animationManager.skipCurrentBatch();\n this._performUpdateSkipAnimations = true;\n }\n destroy(opts) {\n if (this.destroyed) {\n return;\n }\n const keepTransferableResources = opts == null ? void 0 : opts.keepTransferableResources;\n let result;\n this.performUpdateType = 7 /* NONE */;\n this._destroyFns.forEach((fn) => fn());\n this.processors.forEach((p) => p.destroy());\n this.tooltip.destroy();\n this.overlays.destroy();\n this.sizeMonitor.unobserve(this.element);\n this.modulesManager.destroy();\n if (keepTransferableResources) {\n this.ctx.scene.strip();\n result = { container: this.container, scene: this.ctx.scene, element: this.element };\n } else {\n this.ctx.scene.destroy();\n this.container = void 0;\n }\n this.destroySeries(this.series);\n this.seriesLayerManager.destroy();\n this.axes.forEach((a) => a.destroy());\n this.axes = [];\n this.animationRect = void 0;\n this.ctx.destroy();\n this.zoomManager.destroy();\n this.destroyed = true;\n Object.freeze(this);\n return result;\n }\n resetPointer(highlightOnly = false) {\n if (!highlightOnly) {\n this.ctx.tooltipManager.removeTooltip(this.id);\n }\n this.ctx.highlightManager.updateHighlight(this.id);\n this.lastInteractionEvent = void 0;\n }\n requestFactoryUpdate(cb) {\n if (this.destroyed)\n return;\n this._pendingFactoryUpdatesCount++;\n this.updateMutex.acquire(() => __async(this, null, function* () {\n if (this.destroyed)\n return;\n yield cb(this);\n if (this.destroyed)\n return;\n this._pendingFactoryUpdatesCount--;\n })).catch((e) => Logger.errorOnce(e));\n }\n update(type = 0 /* FULL */, opts) {\n var _a, _b;\n const {\n forceNodeDataRefresh = false,\n skipAnimations,\n seriesToUpdate = this.series,\n newAnimationBatch\n } = opts != null ? opts : {};\n if (forceNodeDataRefresh) {\n this.series.forEach((series) => series.markNodeDataDirty());\n }\n for (const series of seriesToUpdate) {\n this.seriesToUpdate.add(series);\n }\n if (skipAnimations) {\n this.ctx.animationManager.skipCurrentBatch();\n this._performUpdateSkipAnimations = true;\n }\n if (newAnimationBatch && this.ctx.animationManager.isActive()) {\n this._performUpdateSkipAnimations = true;\n }\n this._skipSync = (_a = opts == null ? void 0 : opts.skipSync) != null ? _a : false;\n if (this.debug.check()) {\n let stack = (_b = new Error().stack) != null ? _b : \"\";\n stack = stack.replace(/\\([^)]*/g, \"\");\n this.updateRequestors[stack] = type;\n }\n if (type < this.performUpdateType) {\n this.performUpdateType = type;\n this.performUpdateTrigger.schedule(opts == null ? void 0 : opts.backOffMs);\n }\n }\n performUpdate(count) {\n return __async(this, null, function* () {\n var _a;\n const { performUpdateType, extraDebugStats, _performUpdateSplits: splits, ctx } = this;\n const seriesToUpdate = [...this.seriesToUpdate];\n this.performUpdateType = 7 /* NONE */;\n this.seriesToUpdate.clear();\n if (this.updateShortcutCount === 0 && performUpdateType < 6 /* SCENE_RENDER */) {\n ctx.animationManager.startBatch(this._performUpdateSkipAnimations);\n ctx.animationManager.onBatchStop(() => this.chartAnimationPhase = \"ready\");\n }\n this.debug(\"Chart.performUpdate() - start\", ChartUpdateType[performUpdateType]);\n let previousSplit = performance.now();\n (_a = splits.start) != null ? _a : splits.start = previousSplit;\n const updateSplits = (splitName) => {\n var _a2;\n (_a2 = splits[splitName]) != null ? _a2 : splits[splitName] = 0;\n splits[splitName] += performance.now() - previousSplit;\n previousSplit = performance.now();\n };\n let updateDeferred = false;\n switch (performUpdateType) {\n case 0 /* FULL */:\n this.updateDOM();\n case 1 /* UPDATE_DATA */:\n yield this.updateData();\n updateSplits(\"\\u2B07\\uFE0F\");\n case 2 /* PROCESS_DATA */:\n yield this.processData();\n this.resetPointer(true);\n updateSplits(\"\\u{1F3ED}\");\n case 3 /* PERFORM_LAYOUT */:\n if (this.checkUpdateShortcut(3 /* PERFORM_LAYOUT */))\n break;\n if (!this.checkFirstAutoSize(seriesToUpdate)) {\n updateDeferred = true;\n break;\n }\n yield this.processLayout();\n updateSplits(\"\\u2316\");\n case 4 /* SERIES_UPDATE */:\n if (this.checkUpdateShortcut(4 /* SERIES_UPDATE */))\n break;\n const { seriesRect } = this;\n yield Promise.all(seriesToUpdate.map((series) => series.update({ seriesRect })));\n updateSplits(\"\\u{1F914}\");\n case 5 /* TOOLTIP_RECALCULATION */:\n if (this.checkUpdateShortcut(5 /* TOOLTIP_RECALCULATION */))\n break;\n const tooltipMeta = ctx.tooltipManager.getTooltipMeta(this.id);\n if (performUpdateType <= 4 /* SERIES_UPDATE */ && (tooltipMeta == null ? void 0 : tooltipMeta.lastPointerEvent) != null) {\n this.handlePointer(tooltipMeta.lastPointerEvent, true);\n }\n updateSplits(\"\\u2196\");\n case 6 /* SCENE_RENDER */:\n if (this.checkUpdateShortcut(6 /* SCENE_RENDER */))\n break;\n ctx.animationManager.endBatch();\n extraDebugStats[\"updateShortcutCount\"] = this.updateShortcutCount;\n yield ctx.scene.render({ debugSplitTimes: splits, extraDebugStats });\n this.ctx.regionManager.updateFocusWrapperRect();\n this.extraDebugStats = {};\n for (const key in splits) {\n delete splits[key];\n }\n case 7 /* NONE */:\n this.updateShortcutCount = 0;\n this.updateRequestors = {};\n this._performUpdateSkipAnimations = false;\n ctx.animationManager.endBatch();\n }\n if (!updateDeferred) {\n ctx.updateService.dispatchUpdateComplete(this.getMinRects());\n }\n const end = performance.now();\n this.debug(\"Chart.performUpdate() - end\", {\n chart: this,\n durationMs: Math.round((end - splits[\"start\"]) * 100) / 100,\n count,\n performUpdateType: ChartUpdateType[performUpdateType]\n });\n });\n }\n updateThemeClassName() {\n const {\n element: element2,\n processedOptions: { theme }\n } = this;\n const themeClassNamePrefix = \"ag-charts-theme-\";\n const validThemeClassNames = [`${themeClassNamePrefix}default`, `${themeClassNamePrefix}default-dark`];\n let themeClassName = validThemeClassNames[0];\n let isDark = false;\n if (typeof theme === \"string\") {\n themeClassName = theme.replace(\"ag-\", themeClassNamePrefix);\n isDark = theme.includes(\"-dark\");\n } else if (typeof (theme == null ? void 0 : theme.baseTheme) === \"string\") {\n themeClassName = theme.baseTheme.replace(\"ag-\", themeClassNamePrefix);\n isDark = theme.baseTheme.includes(\"-dark\");\n }\n if (!validThemeClassNames.includes(themeClassName)) {\n themeClassName = isDark ? validThemeClassNames[1] : validThemeClassNames[0];\n }\n element2.classList.forEach((className) => {\n if (className.startsWith(themeClassNamePrefix) && className !== themeClassName) {\n element2.classList.remove(className);\n }\n });\n element2.classList.add(themeClassName);\n }\n updateDOM() {\n this.updateThemeClassName();\n const { enabled, tabIndex } = this.keyboard;\n this.element.tabIndex = enabled ? tabIndex != null ? tabIndex : 0 : -1;\n setAttribute(this.ctx.scene.canvas.element, \"role\", \"figure\");\n setAttribute(this.ctx.scene.canvas.element, \"aria-label\", this.getAriaLabel());\n }\n checkUpdateShortcut(checkUpdateType) {\n const maxShortcuts = 3;\n if (this.updateShortcutCount > maxShortcuts) {\n Logger.warn(\n `exceeded the maximum number of simultaneous updates (${maxShortcuts + 1}), discarding changes and rendering`,\n this.updateRequestors\n );\n return false;\n }\n if (this.performUpdateType <= checkUpdateType) {\n this.updateShortcutCount++;\n return true;\n }\n return false;\n }\n checkFirstAutoSize(seriesToUpdate) {\n if (this.autoSize && !this._lastAutoSize) {\n const count = this._performUpdateNoRenderCount++;\n const backOffMs = __pow(count + 1, 2) * 40;\n if (count < 8) {\n this.update(3 /* PERFORM_LAYOUT */, { seriesToUpdate, backOffMs });\n this.debug(\"Chart.checkFirstAutoSize() - backing off until first size update\", backOffMs);\n return false;\n }\n this.debug(\"Chart.checkFirstAutoSize() - timeout for first size update.\");\n }\n this._performUpdateNoRenderCount = 0;\n return true;\n }\n onAxisChange(newValue, oldValue = []) {\n for (const axis of oldValue) {\n if (newValue.includes(axis))\n continue;\n axis.detachAxis(this.axisGroup, this.axisGridGroup);\n axis.destroy();\n }\n for (const axis of newValue) {\n if (oldValue == null ? void 0 : oldValue.includes(axis))\n continue;\n axis.attachAxis(this.axisGroup, this.axisGridGroup);\n }\n }\n onSeriesChange(newValue, oldValue) {\n var _a, _b;\n const seriesToDestroy = (_a = oldValue == null ? void 0 : oldValue.filter((series) => !newValue.includes(series))) != null ? _a : [];\n this.destroySeries(seriesToDestroy);\n (_b = this.seriesLayerManager) == null ? void 0 : _b.setSeriesCount(newValue.length);\n for (const series of newValue) {\n if (oldValue == null ? void 0 : oldValue.includes(series))\n continue;\n if (series.rootGroup.parent == null) {\n this.seriesLayerManager.requestGroup(series);\n }\n const chart = this;\n series.chart = {\n get mode() {\n return chart.mode;\n },\n get isMiniChart() {\n return false;\n },\n get seriesRect() {\n return chart.seriesRect;\n },\n placeLabels() {\n return chart.placeLabels();\n }\n };\n series.resetAnimation(this.chartAnimationPhase);\n this.addSeriesListeners(series);\n series.addChartEventListeners();\n }\n }\n destroySeries(allSeries) {\n allSeries == null ? void 0 : allSeries.forEach((series) => {\n series.removeEventListener(\"nodeClick\", this.onSeriesNodeClick);\n series.removeEventListener(\"nodeDoubleClick\", this.onSeriesNodeDoubleClick);\n series.removeEventListener(\"groupingChanged\", this.seriesGroupingChanged);\n series.destroy();\n this.seriesLayerManager.releaseGroup(series);\n series.chart = void 0;\n });\n }\n addSeriesListeners(series) {\n if (this.hasEventListener(\"seriesNodeClick\")) {\n series.addEventListener(\"nodeClick\", this.onSeriesNodeClick);\n }\n if (this.hasEventListener(\"seriesNodeDoubleClick\")) {\n series.addEventListener(\"nodeDoubleClick\", this.onSeriesNodeDoubleClick);\n }\n series.addEventListener(\"groupingChanged\", this.seriesGroupingChanged);\n }\n updateAllSeriesListeners() {\n this.series.forEach((series) => {\n series.removeEventListener(\"nodeClick\", this.onSeriesNodeClick);\n series.removeEventListener(\"nodeDoubleClick\", this.onSeriesNodeDoubleClick);\n this.addSeriesListeners(series);\n });\n }\n assignSeriesToAxes() {\n this.axes.forEach((axis) => {\n axis.boundSeries = this.series.filter((s) => {\n const seriesAxis = s.axes[axis.direction];\n return seriesAxis === axis;\n });\n });\n }\n assignAxesToSeries() {\n const directionToAxesMap = groupBy(this.axes, (axis) => axis.direction);\n this.series.forEach((series) => {\n series.directions.forEach((direction) => {\n const directionAxes = directionToAxesMap[direction];\n if (!directionAxes) {\n Logger.warnOnce(\n `no available axis for direction [${direction}]; check series and axes configuration.`\n );\n return;\n }\n const seriesKeys = series.getKeys(direction);\n const newAxis = directionAxes.find(\n (axis) => !axis.keys.length || seriesKeys.some((key) => axis.keys.includes(key))\n );\n if (!newAxis) {\n Logger.warnOnce(\n `no matching axis for direction [${direction}] and keys [${seriesKeys}]; check series and axes configuration.`\n );\n return;\n }\n series.axes[direction] = newAxis;\n });\n });\n }\n rawResize({ width, height }) {\n var _a;\n if (!this.autoSize)\n return;\n width = Math.floor(width);\n height = Math.floor(height);\n if (width === 0 && height === 0)\n return;\n const [autoWidth = 0, authHeight = 0] = (_a = this._lastAutoSize) != null ? _a : [];\n if (autoWidth === width && authHeight === height)\n return;\n this._lastAutoSize = [width, height];\n this.resize(void 0, void 0, \"SizeMonitor\");\n }\n resize(width, height, source) {\n var _a, _b, _c, _d;\n const { scene, animationManager } = this.ctx;\n width != null ? width : width = (_b = this.width) != null ? _b : this.autoSize ? (_a = this._lastAutoSize) == null ? void 0 : _a[0] : scene.canvas.width;\n height != null ? height : height = (_d = this.height) != null ? _d : this.autoSize ? (_c = this._lastAutoSize) == null ? void 0 : _c[1] : scene.canvas.height;\n this.debug(`Chart.resize() from ${source}`, { width, height, stack: new Error().stack });\n if (!width || !height || !isFiniteNumber(width) || !isFiniteNumber(height))\n return;\n if (scene.resize(width, height)) {\n this.resetPointer();\n animationManager.reset();\n let skipAnimations = true;\n if (this.autoSize && this._firstAutoSize) {\n skipAnimations = false;\n this._firstAutoSize = false;\n }\n this.update(3 /* PERFORM_LAYOUT */, { forceNodeDataRefresh: true, skipAnimations });\n }\n }\n updateData() {\n return __async(this, null, function* () {\n this.series.forEach((s) => s.setChartData(this.data));\n const modulePromises = this.modulesManager.mapModules((m) => {\n var _a;\n return (_a = m.updateData) == null ? void 0 : _a.call(m, { data: this.data });\n });\n yield Promise.all(modulePromises);\n });\n }\n processData() {\n return __async(this, null, function* () {\n if (this.series.some((s) => s.canHaveAxes)) {\n this.assignAxesToSeries();\n const syncModule = this.modulesManager.getModule(\"sync\");\n if (syncModule == null ? void 0 : syncModule.enabled) {\n syncModule.syncAxes(this._skipSync);\n } else {\n this.assignSeriesToAxes();\n }\n }\n const dataController = new DataController(this.mode);\n const seriesPromises = this.series.map((s) => s.processData(dataController));\n const modulePromises = this.modulesManager.mapModules((m) => {\n var _a;\n return (_a = m.processData) == null ? void 0 : _a.call(m, { dataController });\n });\n dataController.execute();\n yield Promise.all([...seriesPromises, ...modulePromises]);\n for (const { legendType, legend } of this.modulesManager.legends()) {\n legend.data = this.getLegendData(legendType, this.mode !== \"integrated\");\n }\n this.dataProcessListeners.forEach((resolve) => resolve());\n this.dataProcessListeners.clear();\n });\n }\n placeLabels() {\n const visibleSeries = [];\n const data = [];\n for (const series of this.series) {\n if (!series.visible)\n continue;\n const labelData = series.getLabelData();\n if (isPointLabelDatum(labelData == null ? void 0 : labelData[0])) {\n data.push(labelData);\n visibleSeries.push(series);\n }\n }\n const { seriesRect } = this;\n const { top, right, bottom, left } = this.seriesArea.padding;\n const labels = seriesRect && data.length > 0 ? placeLabels(data, {\n x: -left,\n y: -top,\n width: seriesRect.width + left + right,\n height: seriesRect.height + top + bottom\n }) : [];\n return new Map(labels.map((l, i) => [visibleSeries[i], l]));\n }\n getLegendData(legendType, warnConflicts) {\n var _a, _b, _c;\n const legendData = this.series.filter((s) => s.properties.showInLegend).flatMap((s) => s.getLegendData(legendType));\n const isCategoryLegendData = (data) => data.every((d) => d.legendType === \"category\");\n if (warnConflicts && isCategoryLegendData(legendData)) {\n const seriesMarkerFills = {};\n const seriesTypeMap = new Map(this.series.map((s) => [s.id, s.type]));\n for (const { seriesId, marker, label } of legendData) {\n if (marker.fill == null)\n continue;\n const seriesType = seriesTypeMap.get(seriesId);\n const markerFill = (_a = seriesMarkerFills[seriesType]) != null ? _a : seriesMarkerFills[seriesType] = {};\n (_c = markerFill[_b = label.text]) != null ? _c : markerFill[_b] = marker.fill;\n if (markerFill[label.text] !== marker.fill) {\n Logger.warnOnce(\n `legend item '${label.text}' has multiple fill colors, this may cause unexpected behaviour.`\n );\n }\n }\n }\n return legendData;\n }\n processLayout() {\n return __async(this, null, function* () {\n var _a;\n const oldRect = this.animationRect;\n yield this.performLayout();\n if (oldRect && !((_a = this.animationRect) == null ? void 0 : _a.equals(oldRect))) {\n this.ctx.animationManager.skipCurrentBatch();\n }\n this.debug(\"Chart.performUpdate() - seriesRect\", this.seriesRect);\n });\n }\n performLayout() {\n return __async(this, null, function* () {\n const { width, height } = this.ctx.scene;\n let ctx = { shrinkRect: new BBox(0, 0, width, height) };\n ctx = this.ctx.layoutService.dispatchPerformLayout(\"start-layout\", ctx);\n ctx = this.ctx.layoutService.dispatchPerformLayout(\"before-series\", ctx);\n const modulePromises = this.modulesManager.mapModules((m) => __async(this, null, function* () {\n if (m.performLayout != null) {\n ctx = yield m.performLayout(ctx);\n }\n }));\n yield Promise.all(modulePromises);\n return ctx.shrinkRect;\n });\n }\n // x/y are local canvas coordinates in CSS pixels, not actual pixels\n pickSeriesNode(point, exactMatchOnly, maxDistance) {\n var _a, _b;\n const start = performance.now();\n const pickModes = exactMatchOnly ? [0 /* EXACT_SHAPE_MATCH */] : void 0;\n const reverseSeries = [...this.series].reverse();\n let result;\n for (const series of reverseSeries) {\n if (!series.visible || !series.rootGroup.visible) {\n continue;\n }\n const { match, distance: distance2 } = (_a = series.pickNode(point, pickModes)) != null ? _a : {};\n if (!match || distance2 == null) {\n continue;\n }\n if ((!result || result.distance > distance2) && distance2 <= (maxDistance != null ? maxDistance : Infinity)) {\n result = { series, distance: distance2, datum: match };\n }\n if (distance2 === 0) {\n break;\n }\n }\n this.extraDebugStats[\"pickSeriesNode\"] = Math.round(\n ((_b = this.extraDebugStats[\"pickSeriesNode\"]) != null ? _b : 0) + (performance.now() - start)\n );\n return result;\n }\n onMouseMove(event) {\n this.lastInteractionEvent = event;\n this.pointerScheduler.schedule();\n this.extraDebugStats[\"mouseX\"] = event.offsetX;\n this.extraDebugStats[\"mouseY\"] = event.offsetY;\n this.update(6 /* SCENE_RENDER */);\n }\n onLeave(event) {\n if (!this.tooltip.pointerLeftOntoTooltip(event)) {\n this.resetPointer();\n this.update(6 /* SCENE_RENDER */);\n this.ctx.cursorManager.updateCursor(\"chart\");\n }\n }\n onBrowserFocus(event) {\n if (event.delta > 0) {\n this.focus.datum = void 0;\n this.focus.series = void 0;\n this.focus.datumIndex = 0;\n this.focus.seriesIndex = 0;\n } else {\n this.focus.datum = void 0;\n this.focus.series = void 0;\n this.focus.datumIndex = Infinity;\n this.focus.seriesIndex = Infinity;\n }\n }\n onAnimationStart() {\n if (this.focus.hasFocus) {\n this.onBlur();\n }\n }\n onBlur() {\n this.ctx.regionManager.updateFocusIndicatorRect(void 0);\n this.resetPointer();\n this.focus.hasFocus = false;\n }\n onTab(event) {\n this.handleFocus();\n event.consume();\n this.focus.hasFocus = true;\n }\n onNavVert(event) {\n this.focus.seriesIndex += event.delta;\n this.handleFocus();\n event.consume();\n }\n onNavHori(event) {\n this.focus.datumIndex += event.delta;\n this.handleFocus(event.delta);\n event.consume();\n }\n onSubmit(event) {\n const { series, datum } = this.focus;\n const sourceEvent = event.sourceEvent.sourceEvent;\n if (series !== void 0 && datum !== void 0) {\n series.fireNodeClickEvent(sourceEvent, datum);\n } else {\n this.fireEvent({\n type: \"click\",\n event: sourceEvent\n });\n }\n }\n onContextMenu(event) {\n this.ctx.tooltipManager.removeTooltip(this.id);\n const { Default: Default2, ContextMenu } = InteractionState;\n if (this.ctx.interactionManager.getState() & (Default2 | ContextMenu)) {\n this.checkSeriesNodeRange(event, () => {\n this.ctx.highlightManager.updateHighlight(this.id);\n });\n }\n }\n handleFocus(datumIndexDelta) {\n this.focus.hasFocus = true;\n const overlayFocus = this.overlays.getFocusInfo();\n if (overlayFocus == null) {\n this.handleSeriesFocus(datumIndexDelta != null ? datumIndexDelta : 0);\n } else {\n this.ctx.regionManager.updateFocusIndicatorRect(overlayFocus.rect);\n this.ctx.ariaAnnouncementService.announceValue(overlayFocus.text);\n }\n }\n handleSeriesFocus(datumIndexDelta) {\n const { series, seriesRect, focus } = this;\n const visibleSeries = series.filter((s) => s.visible);\n if (visibleSeries.length === 0)\n return;\n focus.seriesIndex = clamp(0, focus.seriesIndex, visibleSeries.length - 1);\n focus.series = visibleSeries[focus.seriesIndex];\n const pick = focus.series.pickFocus({ datumIndex: focus.datumIndex, datumIndexDelta, seriesRect });\n if (pick === void 0)\n return;\n const { datum, datumIndex } = pick;\n focus.datumIndex = datumIndex;\n focus.datum = datum;\n const keyboardEvent = makeKeyboardPointerEvent(this.ctx.regionManager, pick);\n if (keyboardEvent !== void 0) {\n this.lastInteractionEvent = keyboardEvent;\n const html = focus.series.getTooltipHtml(datum);\n const meta = TooltipManager.makeTooltipMeta(this.lastInteractionEvent, datum);\n this.ctx.highlightManager.updateHighlight(this.id, datum);\n this.ctx.tooltipManager.updateTooltip(this.id, meta, html);\n this.ctx.ariaAnnouncementService.announceValue(html.ariaLabel);\n }\n }\n static isHoverEvent(event) {\n return event !== void 0 && event.type === \"hover\";\n }\n handlePointer(event, redisplay) {\n if (this.ctx.interactionManager.getState() !== 16 /* Default */ || !_Chart.isHoverEvent(event)) {\n return;\n }\n const { lastPick, hoverRect } = this;\n const { offsetX, offsetY } = event;\n const disablePointer = (highlightOnly = false) => {\n if (lastPick) {\n this.resetPointer(highlightOnly);\n }\n };\n if (redisplay ? this.ctx.animationManager.isActive() : !(hoverRect == null ? void 0 : hoverRect.containsPoint(offsetX, offsetY))) {\n disablePointer();\n return;\n }\n this.handlePointerTooltip(event, disablePointer);\n this.handlePointerNode(event);\n }\n handlePointerTooltip(event, disablePointer) {\n const { lastPick, tooltip } = this;\n const { range: range3 } = tooltip;\n const { offsetX, offsetY } = event;\n let pixelRange;\n if (isFiniteNumber(range3)) {\n pixelRange = range3;\n }\n const pick = this.pickSeriesNode({ x: offsetX, y: offsetY }, range3 === \"exact\", pixelRange);\n if (!pick) {\n this.ctx.tooltipManager.removeTooltip(this.id);\n if (this.highlight.range === \"tooltip\") {\n disablePointer(true);\n }\n return;\n }\n const isNewDatum = this.highlight.range === \"node\" || !lastPick || lastPick !== pick.datum;\n let html;\n if (isNewDatum) {\n html = pick.series.getTooltipHtml(pick.datum);\n if (this.highlight.range === \"tooltip\") {\n this.ctx.highlightManager.updateHighlight(this.id, pick.datum);\n }\n }\n const isPixelRange = pixelRange != null;\n const tooltipEnabled = this.tooltip.enabled && pick.series.tooltipEnabled;\n const exactlyMatched = range3 === \"exact\" && pick.distance === 0;\n const rangeMatched = range3 === \"nearest\" || isPixelRange || exactlyMatched;\n const shouldUpdateTooltip = tooltipEnabled && rangeMatched && (!isNewDatum || html !== void 0);\n const meta = TooltipManager.makeTooltipMeta(event, pick.datum);\n if (shouldUpdateTooltip) {\n this.ctx.tooltipManager.updateTooltip(this.id, meta, html);\n }\n }\n handlePointerNode(event) {\n const found = this.checkSeriesNodeRange(event, (series, datum) => {\n if (series.hasEventListener(\"nodeClick\") || series.hasEventListener(\"nodeDoubleClick\")) {\n this.ctx.cursorManager.updateCursor(\"chart\", \"pointer\");\n }\n if (this.highlight.range === \"node\") {\n this.ctx.highlightManager.updateHighlight(this.id, datum);\n }\n });\n if (!found) {\n this.ctx.cursorManager.updateCursor(\"chart\");\n if (this.highlight.range === \"node\") {\n this.ctx.highlightManager.updateHighlight(this.id);\n }\n }\n }\n onClick(event) {\n if (this.checkSeriesNodeClick(event)) {\n this.update(4 /* SERIES_UPDATE */);\n return;\n }\n this.fireEvent({\n type: \"click\",\n event: event.sourceEvent\n });\n }\n onDoubleClick(event) {\n if (this.checkSeriesNodeDoubleClick(event)) {\n this.update(4 /* SERIES_UPDATE */);\n return;\n }\n this.fireEvent({\n type: \"doubleClick\",\n event: event.sourceEvent\n });\n }\n checkSeriesNodeClick(event) {\n return this.checkSeriesNodeRange(event, (series, datum) => series.fireNodeClickEvent(event.sourceEvent, datum));\n }\n checkSeriesNodeDoubleClick(event) {\n return this.checkSeriesNodeRange(\n event,\n (series, datum) => series.fireNodeDoubleClickEvent(event.sourceEvent, datum)\n );\n }\n checkSeriesNodeRange(event, callback) {\n var _a;\n const nearestNode = this.pickSeriesNode({ x: event.offsetX, y: event.offsetY }, false);\n const datum = nearestNode == null ? void 0 : nearestNode.datum;\n const nodeClickRange = datum == null ? void 0 : datum.series.properties.nodeClickRange;\n let pixelRange;\n if (isFiniteNumber(nodeClickRange)) {\n pixelRange = nodeClickRange;\n }\n let pickedNode = this.pickSeriesNode({ x: event.offsetX, y: event.offsetY }, true);\n if (pickedNode) {\n this.ctx.highlightManager.updatePicked(this.id, pickedNode.datum);\n } else {\n this.ctx.highlightManager.updatePicked(this.id);\n }\n if (datum && nodeClickRange === \"nearest\") {\n callback(datum.series, datum);\n return true;\n }\n if (nodeClickRange !== \"exact\") {\n pickedNode = this.pickSeriesNode({ x: event.offsetX, y: event.offsetY }, false, pixelRange);\n }\n if (!pickedNode)\n return false;\n const isPixelRange = pixelRange != null;\n const exactlyMatched = nodeClickRange === \"exact\" && pickedNode.distance === 0;\n if (isPixelRange || exactlyMatched) {\n const allMatch = event.pointerHistory === void 0 || ((_a = event.pointerHistory) == null ? void 0 : _a.every((pastEvent) => {\n const historyPoint = { x: pastEvent.offsetX, y: pastEvent.offsetY };\n const historyNode = this.pickSeriesNode(historyPoint, false, pixelRange);\n return (historyNode == null ? void 0 : historyNode.datum) === (pickedNode == null ? void 0 : pickedNode.datum);\n }));\n if (allMatch) {\n callback(pickedNode.series, pickedNode.datum);\n return true;\n }\n }\n return false;\n }\n changeHighlightDatum(event) {\n var _a, _b;\n const seriesToUpdate = /* @__PURE__ */ new Set();\n const { series: newSeries = void 0, datum: newDatum } = (_a = event.currentHighlight) != null ? _a : {};\n const { series: lastSeries = void 0, datum: lastDatum } = (_b = event.previousHighlight) != null ? _b : {};\n if (lastSeries) {\n seriesToUpdate.add(lastSeries);\n }\n if (newSeries) {\n seriesToUpdate.add(newSeries);\n }\n if ((lastSeries == null ? void 0 : lastSeries.properties.cursor) && lastDatum) {\n this.ctx.cursorManager.updateCursor(lastSeries.id);\n }\n if ((newSeries == null ? void 0 : newSeries.properties.cursor) && newDatum) {\n this.ctx.cursorManager.updateCursor(newSeries.id, newSeries.properties.cursor);\n }\n this.lastPick = event.currentHighlight;\n const updateAll = newSeries == null || lastSeries == null;\n if (updateAll) {\n this.update(4 /* SERIES_UPDATE */);\n } else {\n this.update(4 /* SERIES_UPDATE */, { seriesToUpdate });\n }\n }\n waitForUpdate(timeoutMs = 1e4, failOnTimeout = false) {\n return __async(this, null, function* () {\n const start = performance.now();\n if (this._pendingFactoryUpdatesCount > 0) {\n yield this.updateMutex.waitForClearAcquireQueue();\n }\n while (this.performUpdateType !== 7 /* NONE */) {\n if (performance.now() - start > timeoutMs) {\n const message = `Chart.waitForUpdate() timeout of ${timeoutMs} reached - first chart update taking too long.`;\n if (failOnTimeout) {\n throw new Error(message);\n } else {\n Logger.warnOnce(message);\n }\n }\n yield sleep(50);\n }\n yield this.updateMutex.waitForClearAcquireQueue();\n });\n }\n waitForDataProcess(timeout) {\n return new Promise((resolve) => {\n this.dataProcessListeners.add(resolve);\n if (isNumber(timeout)) {\n setTimeout(() => {\n if (this.dataProcessListeners.has(resolve)) {\n this.dataProcessListeners.delete(resolve);\n resolve();\n }\n }, timeout);\n }\n });\n }\n getMinRects() {\n const { width, height } = this.ctx.scene;\n const minRects = this.series.map((series) => series.getMinRects(width, height)).filter(isDefined);\n if (minRects.length === 0)\n return;\n let maxWidth = 0;\n let maxHeight = 0;\n let maxVisibleWidth = 0;\n let maxVisibleHeight = 0;\n for (const { minRect: minRect2, minVisibleRect: minVisibleRect2 } of minRects) {\n maxWidth = Math.max(maxWidth, minRect2.width);\n maxHeight = Math.max(maxHeight, minRect2.height);\n maxVisibleWidth = Math.max(maxVisibleWidth, minVisibleRect2.width);\n maxVisibleHeight = Math.max(maxVisibleHeight, minVisibleRect2.height);\n }\n const minRect = new BBox(0, 0, maxWidth, maxHeight);\n let minVisibleRect = minRect.clone();\n if (maxVisibleWidth > 0 && maxVisibleHeight > 0) {\n minVisibleRect = new BBox(0, 0, maxVisibleWidth, maxVisibleHeight);\n }\n return { minRect, minVisibleRect };\n }\n filterMiniChartSeries(series) {\n return series == null ? void 0 : series.filter((s) => s.showInMiniChart !== false);\n }\n applyOptions(chartOptions) {\n var _a, _b, _c, _d, _e;\n const oldOpts = this.processedOptions;\n const deltaOptions = chartOptions.diffOptions(oldOpts);\n const userOptions = chartOptions.userOptions;\n if (deltaOptions == null)\n return;\n debug(\"AgChartV2.updateDelta() - applying delta\", deltaOptions);\n const completeOptions = mergeDefaults(deltaOptions, oldOpts);\n const modulesChanged = this.applyModules(completeOptions);\n const skip = [\n \"type\",\n \"data\",\n \"series\",\n \"listeners\",\n \"theme\",\n \"legend.listeners\",\n \"navigator.miniChart.series\",\n \"navigator.miniChart.label\",\n \"axes\",\n \"topology\"\n ];\n if (deltaOptions.listeners) {\n this.registerListeners(this, deltaOptions.listeners);\n }\n jsonApply(this, deltaOptions, { skip });\n let forceNodeDataRefresh = false;\n let seriesStatus = \"no-op\";\n if ((_a = deltaOptions.series) == null ? void 0 : _a.length) {\n seriesStatus = this.applySeries(this, deltaOptions.series, oldOpts == null ? void 0 : oldOpts.series);\n forceNodeDataRefresh = true;\n }\n if (seriesStatus === \"replaced\") {\n this.resetAnimations();\n }\n if (this.applyAxes(this, completeOptions, oldOpts, seriesStatus)) {\n forceNodeDataRefresh = true;\n }\n if (deltaOptions.data) {\n this.data = deltaOptions.data;\n }\n if (((_b = deltaOptions.legend) == null ? void 0 : _b.listeners) && this.modulesManager.isEnabled(\"legend\")) {\n Object.assign(this.legend.listeners, deltaOptions.legend.listeners);\n }\n if (deltaOptions.listeners) {\n this.updateAllSeriesListeners();\n }\n this.chartOptions = chartOptions;\n this.processedOptions = completeOptions;\n this.userOptions = mergeDefaults(userOptions, this.userOptions);\n const navigatorModule = this.modulesManager.getModule(\"navigator\");\n const zoomModule = this.modulesManager.getModule(\"zoom\");\n if (!(navigatorModule == null ? void 0 : navigatorModule.enabled) && !(zoomModule == null ? void 0 : zoomModule.enabled)) {\n this.ctx.zoomManager.updateZoom(\"chart\");\n }\n const miniChart = navigatorModule == null ? void 0 : navigatorModule.miniChart;\n const miniChartSeries = (_e = (_d = (_c = completeOptions.navigator) == null ? void 0 : _c.miniChart) == null ? void 0 : _d.series) != null ? _e : completeOptions.series;\n if ((miniChart == null ? void 0 : miniChart.enabled) === true && miniChartSeries != null) {\n this.applyMiniChartOptions(miniChart, miniChartSeries, completeOptions, oldOpts);\n } else if ((miniChart == null ? void 0 : miniChart.enabled) === false) {\n miniChart.series = [];\n miniChart.axes = [];\n }\n injectStyle(styles_default, \"chart\");\n this.ctx.annotationManager.setAnnotationStyles(chartOptions.annotationThemes);\n forceNodeDataRefresh || (forceNodeDataRefresh = this.shouldForceNodeDataRefresh(deltaOptions, seriesStatus));\n const majorChange = forceNodeDataRefresh || modulesChanged;\n const updateType = majorChange ? 0 /* FULL */ : 3 /* PERFORM_LAYOUT */;\n this.maybeResetAnimations(seriesStatus);\n debug(\"AgChartV2.applyChartOptions() - update type\", ChartUpdateType[updateType], {\n seriesStatus,\n forceNodeDataRefresh\n });\n this.update(updateType, { forceNodeDataRefresh, newAnimationBatch: true });\n }\n maybeResetAnimations(seriesStatus) {\n if (this.mode !== \"standalone\")\n return;\n switch (seriesStatus) {\n case \"series-grouping-change\":\n case \"replaced\":\n this.resetAnimations();\n break;\n default:\n }\n }\n shouldForceNodeDataRefresh(deltaOptions, seriesStatus) {\n const seriesDataUpdate = !!deltaOptions.data || seriesStatus === \"data-change\" || seriesStatus === \"replaced\";\n const legendKeys = legendRegistry.getKeys();\n const optionsHaveLegend = Object.values(legendKeys).some(\n (legendKey) => deltaOptions[legendKey] != null\n );\n const otherRefreshUpdate = deltaOptions.title != null && deltaOptions.subtitle != null;\n return seriesDataUpdate || optionsHaveLegend || otherRefreshUpdate;\n }\n applyMiniChartOptions(miniChart, miniChartSeries, completeOptions, oldOpts) {\n var _a, _b, _c, _d, _e;\n const oldSeries = (_c = (_b = (_a = oldOpts == null ? void 0 : oldOpts.navigator) == null ? void 0 : _a.miniChart) == null ? void 0 : _b.series) != null ? _c : oldOpts == null ? void 0 : oldOpts.series;\n const miniChartSeriesStatus = this.applySeries(\n miniChart,\n this.filterMiniChartSeries(miniChartSeries),\n this.filterMiniChartSeries(oldSeries)\n );\n this.applyAxes(miniChart, completeOptions, oldOpts, miniChartSeriesStatus, [\n \"axes[].tick\",\n \"axes[].thickness\",\n \"axes[].title\",\n \"axes[].crosshair\",\n \"axes[].gridLine\",\n \"axes[].label\"\n ]);\n const axes = miniChart.axes;\n const horizontalAxis = axes.find((axis) => axis.direction === \"x\" /* X */);\n for (const axis of axes) {\n axis.gridLine.enabled = false;\n axis.label.enabled = axis === horizontalAxis;\n axis.tick.enabled = false;\n axis.interactionEnabled = false;\n }\n if (horizontalAxis != null) {\n const miniChartOpts = (_d = completeOptions.navigator) == null ? void 0 : _d.miniChart;\n const labelOptions = miniChartOpts == null ? void 0 : miniChartOpts.label;\n const intervalOptions = (_e = miniChartOpts == null ? void 0 : miniChartOpts.label) == null ? void 0 : _e.interval;\n horizontalAxis.line.enabled = false;\n horizontalAxis.label.set(\n without(labelOptions, [\"interval\", \"rotation\", \"minSpacing\", \"autoRotate\", \"autoRotateAngle\"])\n );\n horizontalAxis.tick.set(\n without(intervalOptions, [\"enabled\", \"width\", \"size\", \"color\", \"interval\", \"step\"])\n );\n const step = intervalOptions == null ? void 0 : intervalOptions.step;\n if (step != null) {\n horizontalAxis.tick.interval = step;\n }\n }\n }\n applyModules(options) {\n var _a;\n const { type: chartType2 } = this.constructor;\n let modulesChanged = false;\n for (const module of moduleRegistry.byType(\"root\", \"legend\")) {\n const isConfigured = options[module.optionsKey] != null;\n const shouldBeEnabled = isConfigured && module.chartTypes.includes(chartType2);\n if (shouldBeEnabled === this.modulesManager.isEnabled(module))\n continue;\n if (shouldBeEnabled) {\n this.modulesManager.addModule(module, (m) => new m.instanceConstructor(this.getModuleContext()));\n if (module.type === \"legend\") {\n (_a = this.modulesManager.getModule(module)) == null ? void 0 : _a.attachLegend(this.ctx.scene);\n }\n this[module.optionsKey] = this.modulesManager.getModule(module);\n } else {\n this.modulesManager.removeModule(module);\n delete this[module.optionsKey];\n }\n modulesChanged = true;\n }\n return modulesChanged;\n }\n applySeries(chart, optSeries, oldOptSeries) {\n var _a;\n if (!optSeries) {\n return \"no-change\";\n }\n const matchResult = matchSeriesOptions(chart.series, optSeries, oldOptSeries);\n if (matchResult.status === \"no-overlap\") {\n debug(\n `AgChartV2.applySeries() - creating new series instances, status: ${matchResult.status}`,\n matchResult\n );\n chart.series = optSeries.map((opts) => this.createSeries(opts));\n return \"replaced\";\n }\n debug(`AgChartV2.applySeries() - matchResult`, matchResult);\n const seriesInstances = [];\n let dataChanged = false;\n let groupingChanged = false;\n let isUpdated = false;\n for (const change of matchResult.changes) {\n groupingChanged || (groupingChanged = change.status === \"series-grouping\");\n dataChanged || (dataChanged = ((_a = change.diff) == null ? void 0 : _a.data) != null);\n isUpdated || (isUpdated = change.status !== \"no-op\");\n switch (change.status) {\n case \"add\":\n const newSeries = this.createSeries(change.opts);\n seriesInstances.push(newSeries);\n debug(`AgChartV2.applySeries() - created new series`, newSeries);\n break;\n case \"remove\":\n debug(`AgChartV2.applySeries() - removing series at previous idx ${change.idx}`, change.series);\n break;\n case \"no-op\":\n seriesInstances.push(change.series);\n debug(`AgChartV2.applySeries() - no change to series at previous idx ${change.idx}`, change.series);\n break;\n case \"series-grouping\":\n case \"update\":\n default:\n const { series, diff: diff2, idx } = change;\n debug(`AgChartV2.applySeries() - applying series diff previous idx ${idx}`, diff2, series);\n this.applySeriesValues(series, diff2);\n series.markNodeDataDirty();\n seriesInstances.push(series);\n }\n }\n for (let idx = 0; idx < seriesInstances.length; idx++) {\n seriesInstances[idx]._declarationOrder = idx;\n }\n debug(`AgChartV2.applySeries() - final series instances`, seriesInstances);\n chart.series = seriesInstances;\n if (groupingChanged) {\n return \"series-grouping-change\";\n }\n if (dataChanged) {\n return \"data-change\";\n }\n return isUpdated ? \"updated\" : \"no-op\";\n }\n applyAxes(chart, options, oldOpts, seriesStatus, skip = []) {\n if (!(\"axes\" in options) || !options.axes) {\n return false;\n }\n skip = [\"axes[].type\", ...skip];\n const { axes } = options;\n const forceRecreate = seriesStatus === \"replaced\";\n const matchingTypes = !forceRecreate && chart.axes.length === axes.length && chart.axes.every((a, i) => a.type === axes[i].type);\n if (matchingTypes && isAgCartesianChartOptions(oldOpts)) {\n chart.axes.forEach((axis, index) => {\n var _a, _b;\n const previousOpts = (_b = (_a = oldOpts.axes) == null ? void 0 : _a[index]) != null ? _b : {};\n const axisDiff = jsonDiff(previousOpts, axes[index]);\n debug(`AgChartV2.applyAxes() - applying axis diff idx ${index}`, axisDiff);\n const path = `axes[${index}]`;\n jsonApply(axis, axisDiff, __spreadProps(__spreadValues({}, JSON_APPLY_PLUGINS), { path, skip }));\n });\n return true;\n }\n debug(`AgChartV2.applyAxes() - creating new axes instances; seriesStatus: ${seriesStatus}`);\n chart.axes = this.createAxis(axes, skip);\n return true;\n }\n createSeries(seriesOptions) {\n const seriesInstance = seriesRegistry.create(seriesOptions.type, this.getModuleContext());\n this.applySeriesOptionModules(seriesInstance, seriesOptions);\n this.applySeriesValues(seriesInstance, seriesOptions);\n return seriesInstance;\n }\n applySeriesOptionModules(series, options) {\n const moduleContext = series.createModuleContext();\n const moduleMap = series.getModuleMap();\n for (const module of moduleRegistry.byType(\"series-option\")) {\n if (module.optionsKey in options && module.seriesTypes.includes(series.type)) {\n moduleMap.addModule(module, (m) => new m.instanceConstructor(moduleContext));\n }\n }\n }\n applySeriesValues(target, options) {\n const moduleMap = target.getModuleMap();\n const _a = options, { type: _, data, listeners, seriesGrouping, showInMiniChart: __ } = _a, seriesOptions = __objRest(_a, [\"type\", \"data\", \"listeners\", \"seriesGrouping\", \"showInMiniChart\"]);\n for (const moduleDef of EXPECTED_ENTERPRISE_MODULES) {\n if (moduleDef.type !== \"series-option\")\n continue;\n if (moduleDef.optionsKey in seriesOptions) {\n const module = moduleMap.getModule(moduleDef.optionsKey);\n const moduleOptions = seriesOptions[moduleDef.optionsKey];\n delete seriesOptions[moduleDef.optionsKey];\n module.properties.set(moduleOptions);\n }\n }\n target.properties.set(seriesOptions);\n if (\"data\" in options) {\n target.setOptionsData(data);\n }\n if (listeners) {\n this.registerListeners(target, listeners);\n }\n if (\"seriesGrouping\" in options) {\n if (seriesGrouping == null) {\n target.seriesGrouping = void 0;\n } else {\n target.seriesGrouping = __spreadValues(__spreadValues({}, target.seriesGrouping), seriesGrouping);\n }\n }\n }\n createAxis(options, skip) {\n const guesser = new AxisPositionGuesser();\n const moduleContext = this.getModuleContext();\n for (let index = 0; index < options.length; index++) {\n const axisOptions = options[index];\n const axis = axisRegistry.create(axisOptions.type, moduleContext);\n this.applyAxisModules(axis, axisOptions);\n jsonApply(axis, axisOptions, __spreadProps(__spreadValues({}, JSON_APPLY_PLUGINS), { path: `axes[${index}]`, skip }));\n guesser.push(axis, axisOptions);\n }\n return guesser.guessInvalidPositions();\n }\n applyAxisModules(axis, options) {\n const moduleContext = axis.createModuleContext();\n const moduleMap = axis.getModuleMap();\n for (const module of moduleRegistry.byType(\"axis-option\")) {\n const shouldBeEnabled = options[module.optionsKey] != null;\n if (shouldBeEnabled === moduleMap.isEnabled(module))\n continue;\n if (shouldBeEnabled) {\n moduleMap.addModule(module, (m) => new m.instanceConstructor(moduleContext));\n axis[module.optionsKey] = moduleMap.getModule(module);\n } else {\n moduleMap.removeModule(module);\n delete axis[module.optionsKey];\n }\n }\n }\n registerListeners(source, listeners) {\n source.clearEventListeners();\n for (const [property, listener] of Object.entries(listeners)) {\n if (isFunction(listener)) {\n source.addEventListener(property, listener);\n }\n }\n }\n};\n_Chart.chartsInstances = /* @__PURE__ */ new WeakMap();\n__decorateClass([\n ActionOnSet({\n newValue(value) {\n if (this.destroyed)\n return;\n value.setAttribute(\"data-ag-charts\", \"\");\n value.appendChild(this.element);\n _Chart.chartsInstances.set(value, this);\n },\n oldValue(value) {\n value.removeAttribute(\"data-ag-charts\");\n value.removeChild(this.element);\n _Chart.chartsInstances.delete(value);\n }\n })\n], _Chart.prototype, \"container\", 2);\n__decorateClass([\n ActionOnSet({\n newValue(value) {\n this.resize(value, void 0, \"width option\");\n }\n })\n], _Chart.prototype, \"width\", 2);\n__decorateClass([\n ActionOnSet({\n newValue(value) {\n this.resize(void 0, value, \"height option\");\n }\n })\n], _Chart.prototype, \"height\", 2);\n__decorateClass([\n ActionOnSet({\n newValue(value) {\n this.onAutoSizeChange(value);\n }\n }),\n Validate(BOOLEAN)\n], _Chart.prototype, \"autoSize\", 2);\n__decorateClass([\n Validate(OBJECT)\n], _Chart.prototype, \"padding\", 2);\n__decorateClass([\n Validate(OBJECT)\n], _Chart.prototype, \"seriesArea\", 2);\n__decorateClass([\n Validate(OBJECT)\n], _Chart.prototype, \"title\", 2);\n__decorateClass([\n Validate(OBJECT)\n], _Chart.prototype, \"subtitle\", 2);\n__decorateClass([\n Validate(OBJECT)\n], _Chart.prototype, \"footnote\", 2);\n__decorateClass([\n Validate(OBJECT)\n], _Chart.prototype, \"keyboard\", 2);\n__decorateClass([\n Validate(UNION([\"standalone\", \"integrated\"], \"a chart mode\"))\n], _Chart.prototype, \"mode\", 2);\n__decorateClass([\n ActionOnSet({\n changeValue(newValue, oldValue) {\n this.onAxisChange(newValue, oldValue);\n }\n })\n], _Chart.prototype, \"axes\", 2);\n__decorateClass([\n ActionOnSet({\n changeValue(newValue, oldValue) {\n this.onSeriesChange(newValue, oldValue);\n }\n })\n], _Chart.prototype, \"series\", 2);\nvar Chart = _Chart;\n\n// packages/ag-charts-community/src/scene/polyRoots.ts\nfunction linearRoot(a, b) {\n const t = -b / a;\n return a !== 0 && t >= 0 && t <= 1 ? [t] : [];\n}\nfunction quadraticRoots(a, b, c) {\n if (a === 0) {\n return linearRoot(b, c);\n }\n const D = b * b - 4 * a * c;\n const roots = [];\n if (D === 0) {\n const t = -b / (2 * a);\n if (t >= 0 && t <= 1) {\n roots.push(t);\n }\n } else if (D > 0) {\n const rD = Math.sqrt(D);\n const t1 = (-b - rD) / (2 * a);\n const t2 = (-b + rD) / (2 * a);\n if (t1 >= 0 && t1 <= 1) {\n roots.push(t1);\n }\n if (t2 >= 0 && t2 <= 1) {\n roots.push(t2);\n }\n }\n return roots;\n}\nfunction cubicRoots(a, b, c, d) {\n if (a === 0) {\n return quadraticRoots(b, c, d);\n }\n const A = b / a;\n const B = c / a;\n const C = d / a;\n const Q = (3 * B - A * A) / 9;\n const R = (9 * A * B - 27 * C - 2 * A * A * A) / 54;\n const D = Q * Q * Q + R * R;\n const third = 1 / 3;\n const roots = [];\n if (D >= 0) {\n const rD = Math.sqrt(D);\n const S = Math.sign(R + rD) * Math.pow(Math.abs(R + rD), third);\n const T = Math.sign(R - rD) * Math.pow(Math.abs(R - rD), third);\n const Im = Math.abs(Math.sqrt(3) * (S - T) / 2);\n const t = -third * A + (S + T);\n if (t >= 0 && t <= 1) {\n roots.push(t);\n }\n if (Im === 0) {\n const t2 = -third * A - (S + T) / 2;\n if (t2 >= 0 && t2 <= 1) {\n roots.push(t2);\n }\n }\n } else {\n const theta = Math.acos(R / Math.sqrt(-Q * Q * Q));\n const thirdA = third * A;\n const twoSqrtQ = 2 * Math.sqrt(-Q);\n const t1 = twoSqrtQ * Math.cos(third * theta) - thirdA;\n const t2 = twoSqrtQ * Math.cos(third * (theta + 2 * Math.PI)) - thirdA;\n const t3 = twoSqrtQ * Math.cos(third * (theta + 4 * Math.PI)) - thirdA;\n if (t1 >= 0 && t1 <= 1) {\n roots.push(t1);\n }\n if (t2 >= 0 && t2 <= 1) {\n roots.push(t2);\n }\n if (t3 >= 0 && t3 <= 1) {\n roots.push(t3);\n }\n }\n return roots;\n}\n\n// packages/ag-charts-community/src/scene/intersection.ts\nfunction segmentIntersection(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {\n const d = (ax2 - ax1) * (by2 - by1) - (ay2 - ay1) * (bx2 - bx1);\n if (d === 0) {\n return 0;\n }\n const ua = ((bx2 - bx1) * (ay1 - by1) - (ax1 - bx1) * (by2 - by1)) / d;\n const ub = ((ax2 - ax1) * (ay1 - by1) - (ay2 - ay1) * (ax1 - bx1)) / d;\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return 1;\n }\n return 0;\n}\nfunction cubicSegmentIntersections(px1, py1, px2, py2, px3, py3, px4, py4, x1, y1, x2, y2) {\n let intersections = 0;\n const A = y1 - y2;\n const B = x2 - x1;\n const C = x1 * (y2 - y1) - y1 * (x2 - x1);\n const bx = bezierCoefficients(px1, px2, px3, px4);\n const by = bezierCoefficients(py1, py2, py3, py4);\n const a = A * bx[0] + B * by[0];\n const b = A * bx[1] + B * by[1];\n const c = A * bx[2] + B * by[2];\n const d = A * bx[3] + B * by[3] + C;\n const roots = cubicRoots(a, b, c, d);\n for (const t of roots) {\n const tt = t * t;\n const ttt = t * tt;\n const x = bx[0] * ttt + bx[1] * tt + bx[2] * t + bx[3];\n const y = by[0] * ttt + by[1] * tt + by[2] * t + by[3];\n let s;\n if (x1 === x2) {\n s = (y - y1) / (y2 - y1);\n } else {\n s = (x - x1) / (x2 - x1);\n }\n if (s >= 0 && s <= 1) {\n intersections++;\n }\n }\n return intersections;\n}\nfunction bezierCoefficients(P1, P2, P3, P4) {\n return [\n // Bézier expressed as matrix operations:\n -P1 + 3 * P2 - 3 * P3 + P4,\n // |-1 3 -3 1| |P1|\n 3 * P1 - 6 * P2 + 3 * P3,\n // [t^3 t^2 t 1] | 3 -6 3 0| |P2|\n -3 * P1 + 3 * P2,\n // |-3 3 0 0| |P3|\n P1\n // | 1 0 0 0| |P4|\n ];\n}\nfunction arcIntersections(cx, cy, r, startAngle, endAngle, counterClockwise, x1, y1, x2, y2) {\n if (isNaN(cx) || isNaN(cy)) {\n return 0;\n }\n if (counterClockwise) {\n [endAngle, startAngle] = [startAngle, endAngle];\n }\n const k = (y2 - y1) / (x2 - x1);\n const y0 = y1 - k * x1;\n const a = Math.pow(k, 2) + 1;\n const b = 2 * (k * (y0 - cy) - cx);\n const c = Math.pow(cx, 2) + Math.pow(y0 - cy, 2) - Math.pow(r, 2);\n const d = Math.pow(b, 2) - 4 * a * c;\n if (d < 0) {\n return 0;\n }\n const i1x = (-b + Math.sqrt(d)) / 2 / a;\n const i2x = (-b - Math.sqrt(d)) / 2 / a;\n let intersections = 0;\n [i1x, i2x].forEach((x) => {\n const isXInsideLine = x >= Math.min(x1, x2) && x <= Math.max(x1, x2);\n if (!isXInsideLine) {\n return;\n }\n const y = k * x + y0;\n const adjacent = x - cx;\n const opposite = y - cy;\n const angle = Math.atan2(opposite, adjacent);\n if (isBetweenAngles(angle, startAngle, endAngle)) {\n intersections++;\n }\n });\n return intersections;\n}\n\n// packages/ag-charts-community/src/scene/extendedPath2D.ts\nvar ExtendedPath2D = class {\n constructor() {\n // The methods of this class will likely be called many times per animation frame,\n // and any allocation can trigger a GC cycle during animation, so we attempt\n // to minimize the number of allocations.\n this.path2d = new Path2D();\n this.previousCommands = [];\n this.previousParams = [];\n this.previousClosedPath = false;\n this.commands = [];\n this.params = [];\n this.openedPath = false;\n this.closedPath = false;\n }\n isDirty() {\n return this.closedPath !== this.previousClosedPath || this.previousCommands.length !== this.commands.length || this.previousParams.length !== this.params.length || this.previousCommands.toString() !== this.commands.toString() || this.previousParams.toString() !== this.params.toString();\n }\n getPath2D() {\n return this.path2d;\n }\n moveTo(x, y) {\n this.openedPath = true;\n this.path2d.moveTo(x, y);\n this.commands.push(0 /* Move */);\n this.params.push(x, y);\n }\n lineTo(x, y) {\n if (this.openedPath) {\n this.path2d.lineTo(x, y);\n this.commands.push(1 /* Line */);\n this.params.push(x, y);\n } else {\n this.moveTo(x, y);\n }\n }\n rect(x, y, width, height) {\n this.moveTo(x, y);\n this.lineTo(x + width, y);\n this.lineTo(x + width, y + height);\n this.lineTo(x, y + height);\n this.closePath();\n }\n roundRect(x, y, width, height, radii) {\n radii = Math.min(radii, width / 2, height / 2);\n this.moveTo(x, y + radii);\n this.arc(x + radii, y + radii, radii, Math.PI, 1.5 * Math.PI);\n this.lineTo(x + radii, y);\n this.lineTo(x + width - radii, y);\n this.arc(x + width - radii, y + radii, radii, 1.5 * Math.PI, 2 * Math.PI);\n this.lineTo(x + width, y + radii);\n this.lineTo(x + width, y + height - radii);\n this.arc(x + width - radii, y + height - radii, radii, 0, Math.PI / 2);\n this.lineTo(x + width - radii, y + height);\n this.lineTo(x + radii, y + height);\n this.arc(x + +radii, y + height - radii, radii, Math.PI / 2, Math.PI);\n this.lineTo(x, y + height - radii);\n this.closePath();\n }\n arc(x, y, r, sAngle, eAngle, counterClockwise) {\n this.openedPath = true;\n this.path2d.arc(x, y, r, sAngle, eAngle, counterClockwise);\n this.commands.push(2 /* Arc */);\n this.params.push(x, y, r, sAngle, eAngle, counterClockwise ? 1 : 0);\n }\n cubicCurveTo(cx1, cy1, cx2, cy2, x, y) {\n if (!this.openedPath) {\n this.moveTo(cx1, cy1);\n }\n this.path2d.bezierCurveTo(cx1, cy1, cx2, cy2, x, y);\n this.commands.push(3 /* Curve */);\n this.params.push(cx1, cy1, cx2, cy2, x, y);\n }\n closePath() {\n if (this.openedPath) {\n this.path2d.closePath();\n this.commands.push(4 /* ClosePath */);\n this.openedPath = false;\n this.closedPath = true;\n }\n }\n clear(trackChanges) {\n if (trackChanges) {\n this.previousCommands = this.commands;\n this.previousParams = this.params;\n this.previousClosedPath = this.closedPath;\n }\n this.path2d = new Path2D();\n this.openedPath = false;\n this.closedPath = false;\n this.commands = [];\n this.params = [];\n }\n isPointInPath(x, y) {\n const commands = this.commands;\n const params = this.params;\n const cn = commands.length;\n const ox = -1e4;\n const oy = -1e4;\n let sx = NaN;\n let sy = NaN;\n let px = 0;\n let py = 0;\n let intersectionCount = 0;\n for (let ci = 0, pi = 0; ci < cn; ci++) {\n switch (commands[ci]) {\n case 0 /* Move */:\n intersectionCount += segmentIntersection(sx, sy, px, py, ox, oy, x, y);\n px = params[pi++];\n sx = px;\n py = params[pi++];\n sy = py;\n break;\n case 1 /* Line */:\n intersectionCount += segmentIntersection(px, py, params[pi++], params[pi++], ox, oy, x, y);\n px = params[pi - 2];\n py = params[pi - 1];\n break;\n case 3 /* Curve */:\n intersectionCount += cubicSegmentIntersections(\n px,\n py,\n params[pi++],\n params[pi++],\n params[pi++],\n params[pi++],\n params[pi++],\n params[pi++],\n ox,\n oy,\n x,\n y\n );\n px = params[pi - 2];\n py = params[pi - 1];\n break;\n case 2 /* Arc */:\n const cx = params[pi++];\n const cy = params[pi++];\n const r = params[pi++];\n const startAngle = params[pi++];\n const endAngle = params[pi++];\n const counterClockwise = Boolean(params[pi++]);\n intersectionCount += arcIntersections(\n cx,\n cy,\n r,\n startAngle,\n endAngle,\n counterClockwise,\n ox,\n oy,\n x,\n y\n );\n if (!isNaN(sx)) {\n const startX = cx + Math.cos(startAngle) * r;\n const startY = cy + Math.sin(startAngle) * r;\n intersectionCount += segmentIntersection(px, py, startX, startY, ox, oy, x, y);\n }\n px = cx + Math.cos(endAngle) * r;\n py = cy + Math.sin(endAngle) * r;\n break;\n case 4 /* ClosePath */:\n intersectionCount += segmentIntersection(sx, sy, px, py, ox, oy, x, y);\n break;\n }\n }\n return intersectionCount % 2 === 1;\n }\n distanceSquared(x, y) {\n let best = Infinity;\n const commands = this.commands;\n const params = this.params;\n const cn = commands.length;\n let sx = NaN;\n let sy = NaN;\n let px = 0;\n let py = 0;\n for (let ci = 0, pi = 0; ci < cn; ci++) {\n switch (commands[ci]) {\n case 0 /* Move */:\n px = sx = params[pi++];\n py = sy = params[pi++];\n break;\n case 1 /* Line */: {\n const nx = params[pi++];\n const ny = params[pi++];\n best = lineDistanceSquared(x, y, px, py, nx, ny, best);\n break;\n }\n case 3 /* Curve */:\n Logger.error(\"Command.Curve distanceSquare not implemented\");\n break;\n case 2 /* Arc */: {\n const cx = params[pi++];\n const cy = params[pi++];\n const r = params[pi++];\n const startAngle = params[pi++];\n const endAngle = params[pi++];\n const startX = cx + Math.cos(startAngle) * r;\n const startY = cy + Math.sin(startAngle) * r;\n const counterClockwise = Boolean(params[pi++]);\n best = lineDistanceSquared(x, y, px, py, startX, startY, best);\n best = arcDistanceSquared(x, y, cx, cy, r, startAngle, endAngle, counterClockwise, best);\n px = cx + Math.cos(endAngle) * r;\n py = cy + Math.sin(endAngle) * r;\n break;\n }\n case 4 /* ClosePath */:\n best = lineDistanceSquared(x, y, px, py, sx, sy, best);\n break;\n }\n }\n return best;\n }\n getPoints() {\n const { commands, params } = this;\n const coords = [];\n let pi = 0;\n for (let ci = 0; ci < commands.length; ci++) {\n switch (commands[ci]) {\n case 0 /* Move */:\n case 1 /* Line */:\n coords.push({ x: params[pi++], y: params[pi++] });\n break;\n case 3 /* Curve */:\n pi += 4;\n coords.push({ x: params[pi++], y: params[pi++] });\n break;\n case 2 /* Arc */:\n coords.push({ x: params[pi++], y: params[pi++] });\n pi += 4;\n break;\n case 4 /* ClosePath */:\n break;\n }\n }\n return coords;\n }\n};\n\n// packages/ag-charts-community/src/scene/shape/path.ts\nfunction ScenePathChangeDetection(opts) {\n const { redraw = 3 /* MAJOR */, changeCb, convertor } = opts != null ? opts : {};\n return SceneChangeDetection({ redraw, type: \"path\", convertor, changeCb });\n}\nvar Path = class extends Shape {\n constructor() {\n super(...arguments);\n /**\n * Declare a path to retain for later rendering and hit testing\n * using custom Path2D class. Think of it as a TypeScript version\n * of the native Path2D (with some differences) that works in all browsers.\n */\n this.path = new ExtendedPath2D();\n this._clipX = NaN;\n this._clipY = NaN;\n /**\n * The path only has to be updated when certain attributes change.\n * For example, if transform attributes (such as `translationX`)\n * are changed, we don't have to update the path. The `dirtyPath` flag\n * is how we keep track if the path has to be updated or not.\n */\n this._dirtyPath = true;\n }\n set clipX(value) {\n this._clipX = value;\n this.dirtyPath = true;\n }\n set clipY(value) {\n this._clipY = value;\n this.dirtyPath = true;\n }\n set dirtyPath(value) {\n if (this._dirtyPath !== value) {\n this._dirtyPath = value;\n if (value) {\n this.markDirty(this, 3 /* MAJOR */);\n }\n }\n }\n get dirtyPath() {\n return this._dirtyPath;\n }\n checkPathDirty() {\n var _a, _b, _c, _d;\n if (this._dirtyPath) {\n return;\n }\n this.dirtyPath = this.path.isDirty() || ((_b = (_a = this.fillShadow) == null ? void 0 : _a.isDirty()) != null ? _b : false) || ((_d = (_c = this._clipPath) == null ? void 0 : _c.isDirty()) != null ? _d : false);\n }\n isPointInPath(x, y) {\n const point = this.transformPoint(x, y);\n return this.path.closedPath && this.path.isPointInPath(point.x, point.y);\n }\n distanceSquared(x, y) {\n const point = this.transformPoint(x, y);\n return this.path.distanceSquared(point.x, point.y);\n }\n isDirtyPath() {\n return false;\n }\n updatePath() {\n }\n render(renderCtx) {\n var _a, _b, _c, _d, _e;\n const { ctx, forceRender, stats } = renderCtx;\n if (this.dirty === 0 /* NONE */ && !forceRender) {\n if (stats)\n stats.nodesSkipped += this.nodeCount.count;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n if (this.dirtyPath || this.isDirtyPath()) {\n this.updatePath();\n this.dirtyPath = false;\n }\n if (!isNaN(this._clipX) && !isNaN(this._clipY) && this.clipMode != null) {\n ctx.save();\n const margin = this.strokeWidth / 2;\n (_a = this._clipPath) != null ? _a : this._clipPath = new ExtendedPath2D();\n this._clipPath.clear();\n this._clipPath.rect(-margin, -margin, this._clipX + margin, this._clipY + margin + margin);\n if (this.clipMode === \"normal\") {\n ctx.clip((_b = this._clipPath) == null ? void 0 : _b.getPath2D());\n }\n if (this._clipX > 0 && this._clipY > 0) {\n this.drawPath(ctx);\n }\n if (this.clipMode === \"punch-out\") {\n ctx.clip((_c = this._clipPath) == null ? void 0 : _c.getPath2D());\n const { x = -1e4, y = -1e4, width = 2e4, height = 2e4 } = (_d = this.computeBBox()) != null ? _d : {};\n ctx.clearRect(x, y, width, height);\n }\n ctx.restore();\n } else {\n this.drawPath(ctx);\n }\n (_e = this.fillShadow) == null ? void 0 : _e.markClean();\n super.render(renderCtx);\n }\n drawPath(ctx) {\n this.fillStroke(ctx, this.path.getPath2D());\n }\n};\nPath.className = \"Path\";\n__decorateClass([\n ScenePathChangeDetection()\n], Path.prototype, \"clipMode\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Path.prototype, \"clipX\", 1);\n__decorateClass([\n ScenePathChangeDetection()\n], Path.prototype, \"clipY\", 1);\n\n// packages/ag-charts-community/src/scene/util/quadtree.ts\nvar QuadtreeNearest = class {\n constructor(capacity, maxdepth, boundary) {\n this.root = new QuadtreeNodeNearest(capacity, maxdepth, boundary);\n }\n clear(boundary) {\n this.root.clear(boundary);\n }\n addValue(hitTester, value) {\n const elem = {\n hitTester,\n value,\n distanceSquared: (x, y) => {\n return hitTester.distanceSquared(x, y);\n }\n };\n this.root.addElem(elem);\n }\n find(x, y) {\n const arg = { best: { nearest: void 0, distanceSquared: Infinity } };\n this.root.find(x, y, arg);\n return arg.best;\n }\n};\nvar QuadtreeSubdivisions = class {\n constructor(nw, ne, sw, se) {\n this.nw = nw;\n this.ne = ne;\n this.sw = sw;\n this.se = se;\n }\n addElem(elem) {\n this.nw.addElem(elem);\n this.ne.addElem(elem);\n this.sw.addElem(elem);\n this.se.addElem(elem);\n }\n find(x, y, arg) {\n this.nw.find(x, y, arg);\n this.ne.find(x, y, arg);\n this.sw.find(x, y, arg);\n this.se.find(x, y, arg);\n }\n};\nvar QuadtreeNode = class {\n constructor(capacity, maxdepth, boundary) {\n this.capacity = capacity;\n this.maxdepth = maxdepth;\n this.boundary = boundary != null ? boundary : BBox.NaN;\n this.elems = [];\n this.subdivisions = void 0;\n }\n clear(boundary) {\n this.elems.length = 0;\n this.boundary = boundary;\n this.subdivisions = void 0;\n }\n addElem(e) {\n if (this.addCondition(e)) {\n if (this.subdivisions === void 0) {\n if (this.maxdepth === 0 || this.elems.length < this.capacity) {\n this.elems.push(e);\n } else {\n this.subdivide(e);\n }\n } else {\n this.subdivisions.addElem(e);\n }\n }\n }\n find(x, y, arg) {\n if (this.findCondition(x, y, arg)) {\n if (this.subdivisions === void 0) {\n this.findAction(x, y, arg);\n } else {\n this.subdivisions.find(x, y, arg);\n }\n }\n }\n subdivide(newElem) {\n this.subdivisions = this.makeSubdivisions();\n for (const e of this.elems) {\n this.subdivisions.addElem(e);\n }\n this.subdivisions.addElem(newElem);\n this.elems.length = 0;\n }\n makeSubdivisions() {\n const { x, y, width, height } = this.boundary;\n const { capacity } = this;\n const depth = this.maxdepth - 1;\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const nwBoundary = new BBox(x, y, halfWidth, halfHeight);\n const neBoundary = new BBox(x + halfWidth, y, halfWidth, halfHeight);\n const swBoundary = new BBox(x, y + halfHeight, halfWidth, halfHeight);\n const seBoundary = new BBox(x + halfWidth, y + halfHeight, halfWidth, halfHeight);\n return new QuadtreeSubdivisions(\n this.child(capacity, depth, nwBoundary),\n this.child(capacity, depth, neBoundary),\n this.child(capacity, depth, swBoundary),\n this.child(capacity, depth, seBoundary)\n );\n }\n};\nvar QuadtreeNodeNearest = class _QuadtreeNodeNearest extends QuadtreeNode {\n addCondition(e) {\n const { x, y } = e.hitTester.midPoint;\n return this.boundary.containsPoint(x, y);\n }\n findCondition(x, y, arg) {\n const { best } = arg;\n return best.distanceSquared !== 0 && this.boundary.distanceSquared(x, y) < best.distanceSquared;\n }\n findAction(x, y, arg) {\n const other = nearestSquared(x, y, this.elems, arg.best.distanceSquared);\n if (other.nearest !== void 0 && other.distanceSquared < arg.best.distanceSquared) {\n arg.best = other;\n }\n }\n child(capacity, depth, boundary) {\n return new _QuadtreeNodeNearest(capacity, depth, boundary);\n }\n};\n\n// packages/ag-charts-community/src/chart/marker/marker.ts\nvar Marker = class extends Path {\n constructor() {\n super(...arguments);\n this.x = 0;\n this.y = 0;\n this.size = 12;\n }\n computeBBox() {\n const { x, y, size } = this;\n const { center } = this.constructor;\n return new BBox(x - size * center.x, y - size * center.y, size, size);\n }\n applyPath(s, moves) {\n const { path } = this;\n let { x, y } = this;\n if (this.repeat != null) {\n x = 0;\n y = 0;\n }\n path.clear();\n for (const { x: mx, y: my, t } of moves) {\n x += mx * s;\n y += my * s;\n if (t === \"move\") {\n path.moveTo(x, y);\n } else {\n path.lineTo(x, y);\n }\n }\n path.closePath();\n }\n executeFill(ctx, path) {\n if (!path)\n return;\n if (this.repeat == null) {\n return super.executeFill(ctx, path);\n }\n ctx.save();\n let x = this.translationX;\n let y = this.translationY;\n for (const translation of this.repeat) {\n ctx.translate(translation.x - x, translation.y - y);\n ctx.fill(path);\n x = translation.x;\n y = translation.y;\n }\n ctx.restore();\n }\n executeStroke(ctx, path) {\n if (!path)\n return;\n if (this.repeat == null) {\n return super.executeStroke(ctx, path);\n }\n ctx.save();\n let x = this.translationX;\n let y = this.translationY;\n for (const translation of this.repeat) {\n ctx.translate(translation.x - x, translation.y - y);\n ctx.stroke(path);\n x = translation.x;\n y = translation.y;\n }\n ctx.restore();\n }\n};\nMarker.center = { x: 0.5, y: 0.5 };\n__decorateClass([\n ScenePathChangeDetection()\n], Marker.prototype, \"x\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Marker.prototype, \"y\", 2);\n__decorateClass([\n ScenePathChangeDetection({ convertor: Math.abs })\n], Marker.prototype, \"size\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Marker.prototype, \"repeat\", 2);\n\n// packages/ag-charts-community/src/chart/marker/circle.ts\nvar Circle = class extends Marker {\n updatePath() {\n const { x, y, path, size } = this;\n const r = size / 2;\n path.clear();\n path.arc(x, y, r, 0, Math.PI * 2);\n path.closePath();\n }\n};\nCircle.className = \"Circle\";\n\n// packages/ag-charts-community/src/chart/marker/cross.ts\nvar _Cross = class _Cross extends Marker {\n updatePath() {\n const s = this.size / 4.2;\n super.applyPath(s, _Cross.moves);\n }\n};\n_Cross.className = \"Cross\";\n_Cross.moves = [\n { x: -1, y: 0, t: \"move\" },\n { x: -1, y: -1 },\n { x: 1, y: -1 },\n { x: 1, y: 1 },\n { x: 1, y: -1 },\n { x: 1, y: 1 },\n { x: -1, y: 1 },\n { x: 1, y: 1 },\n { x: -1, y: 1 },\n { x: -1, y: -1 },\n { x: -1, y: 1 },\n { x: -1, y: -1 }\n];\nvar Cross = _Cross;\n\n// packages/ag-charts-community/src/chart/marker/diamond.ts\nvar _Diamond = class _Diamond extends Marker {\n updatePath() {\n const s = this.size / 2;\n super.applyPath(s, _Diamond.moves);\n }\n};\n_Diamond.className = \"Diamond\";\n_Diamond.moves = [\n { x: 0, y: -1, t: \"move\" },\n { x: 1, y: 1 },\n { x: -1, y: 1 },\n { x: -1, y: -1 },\n { x: 1, y: -1 }\n];\nvar Diamond = _Diamond;\n\n// packages/ag-charts-community/src/chart/marker/heart.ts\nvar Heart = class extends Marker {\n rad(degree) {\n return degree / 180 * Math.PI;\n }\n updatePath() {\n const { x, path, size, rad } = this;\n const r = size / 4;\n const y = this.y + r / 2;\n path.clear();\n path.arc(x - r, y - r, r, rad(130), rad(330));\n path.arc(x + r, y - r, r, rad(220), rad(50));\n path.lineTo(x, y + r);\n path.closePath();\n }\n};\nHeart.className = \"Heart\";\n\n// packages/ag-charts-community/src/chart/marker/pin.ts\nvar Pin = class extends Marker {\n updatePath() {\n const { path, x, y } = this;\n const s = this.size;\n const cx = 0.5;\n const cy = 1;\n path.clear();\n path.moveTo(x + (0.15625 - cx) * s, y + (0.34375 - cy) * s);\n path.cubicCurveTo(\n x + (0.15625 - cx) * s,\n y + (0.151491 - cy) * s,\n x + (0.307741 - cx) * s,\n y + (0 - cy) * s,\n x + (0.5 - cx) * s,\n y + (0 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.692259 - cx) * s,\n y + (0 - cy) * s,\n x + (0.84375 - cx) * s,\n y + (0.151491 - cy) * s,\n x + (0.84375 - cx) * s,\n y + (0.34375 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.84375 - cx) * s,\n y + (0.493824 - cy) * s,\n x + (0.784625 - cx) * s,\n y + (0.600181 - cy) * s,\n x + (0.716461 - cx) * s,\n y + (0.695393 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.699009 - cx) * s,\n y + (0.719769 - cy) * s,\n x + (0.681271 - cx) * s,\n y + (0.743104 - cy) * s,\n x + (0.663785 - cx) * s,\n y + (0.766105 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.611893 - cx) * s,\n y + (0.834367 - cy) * s,\n x + (0.562228 - cx) * s,\n y + (0.899699 - cy) * s,\n x + (0.528896 - cx) * s,\n y + (0.980648 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.524075 - cx) * s,\n y + (0.992358 - cy) * s,\n x + (0.512663 - cx) * s,\n y + (1 - cy) * s,\n x + (0.5 - cx) * s,\n y + (1 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.487337 - cx) * s,\n y + (1 - cy) * s,\n x + (0.475925 - cx) * s,\n y + (0.992358 - cy) * s,\n x + (0.471104 - cx) * s,\n y + (0.980648 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.487337 - cx) * s,\n y + (1 - cy) * s,\n x + (0.475925 - cx) * s,\n y + (0.992358 - cy) * s,\n x + (0.471104 - cx) * s,\n y + (0.980648 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.437772 - cx) * s,\n y + (0.899699 - cy) * s,\n x + (0.388107 - cx) * s,\n y + (0.834367 - cy) * s,\n x + (0.336215 - cx) * s,\n y + (0.766105 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.318729 - cx) * s,\n y + (0.743104 - cy) * s,\n x + (0.300991 - cx) * s,\n y + (0.719769 - cy) * s,\n x + (0.283539 - cx) * s,\n y + (0.695393 - cy) * s\n );\n path.cubicCurveTo(\n x + (0.215375 - cx) * s,\n y + (0.600181 - cy) * s,\n x + (0.15625 - cx) * s,\n y + (0.493824 - cy) * s,\n x + (0.15625 - cx) * s,\n y + (0.34375 - cy) * s\n );\n path.closePath();\n }\n};\nPin.className = \"MapPin\";\nPin.center = { x: 0.5, y: 1 };\n\n// packages/ag-charts-community/src/chart/marker/plus.ts\nvar _Plus = class _Plus extends Marker {\n updatePath() {\n const s = this.size / 3;\n super.applyPath(s, _Plus.moves);\n }\n};\n_Plus.className = \"Plus\";\n_Plus.moves = [\n { x: -0.5, y: -0.5, t: \"move\" },\n { x: 0, y: -1 },\n { x: 1, y: 0 },\n { x: 0, y: 1 },\n { x: 1, y: 0 },\n { x: 0, y: 1 },\n { x: -1, y: 0 },\n { x: 0, y: 1 },\n { x: -1, y: 0 },\n { x: 0, y: -1 },\n { x: -1, y: 0 },\n { x: 0, y: -1 }\n];\nvar Plus = _Plus;\n\n// packages/ag-charts-community/src/chart/marker/square.ts\nvar Square = class extends Marker {\n updatePath() {\n const { path, x, y } = this;\n const hs = this.size / 2;\n path.clear();\n path.moveTo(this.align(x - hs), this.align(y - hs));\n path.lineTo(this.align(x + hs), this.align(y - hs));\n path.lineTo(this.align(x + hs), this.align(y + hs));\n path.lineTo(this.align(x - hs), this.align(y + hs));\n path.closePath();\n }\n};\nSquare.className = \"Square\";\n\n// packages/ag-charts-community/src/chart/marker/star.ts\nvar Star = class extends Marker {\n updatePath() {\n const { x, y, path, size } = this;\n const spikes = 5;\n const innerRadius = size / 2;\n const rotation = Math.PI / 2;\n path.clear();\n for (let i = 0; i < spikes * 2; i++) {\n const radius = i % 2 === 0 ? size : innerRadius;\n const angle = i * Math.PI / spikes - rotation;\n const xCoordinate = x + Math.cos(angle) * radius;\n const yCoordinate = y + Math.sin(angle) * radius;\n path.lineTo(xCoordinate, yCoordinate);\n }\n path.closePath();\n }\n};\nStar.className = \"Star\";\n\n// packages/ag-charts-community/src/chart/marker/triangle.ts\nvar _Triangle = class _Triangle extends Marker {\n updatePath() {\n const s = this.size * 1.1;\n super.applyPath(s, _Triangle.moves);\n }\n};\n_Triangle.className = \"Triangle\";\n_Triangle.moves = [\n { x: 0, y: -0.48, t: \"move\" },\n { x: 0.5, y: 0.87 },\n { x: -1, y: 0 }\n];\nvar Triangle = _Triangle;\n\n// packages/ag-charts-community/src/chart/marker/util.ts\nvar MARKER_SHAPES = {\n circle: Circle,\n cross: Cross,\n diamond: Diamond,\n heart: Heart,\n pin: Pin,\n plus: Plus,\n square: Square,\n star: Star,\n triangle: Triangle\n};\nvar MARKER_SUPPORTED_SHAPES = Object.keys(MARKER_SHAPES);\nfunction isMarkerShape(shape) {\n return typeof shape === \"string\" && MARKER_SUPPORTED_SHAPES.includes(shape);\n}\nfunction getMarker(shape = Square) {\n if (isMarkerShape(shape)) {\n return MARKER_SHAPES[shape];\n }\n if (typeof shape === \"function\") {\n return shape;\n }\n return Square;\n}\n\n// packages/ag-charts-community/src/chart/series/dataModelSeries.ts\nvar DataModelSeries = class extends Series {\n constructor() {\n super(...arguments);\n this.showFocusBox = true;\n }\n getScaleInformation({\n xScale,\n yScale\n }) {\n const isContinuousX = ContinuousScale.is(xScale);\n const isContinuousY = ContinuousScale.is(yScale);\n return { isContinuousX, isContinuousY, xScaleType: xScale == null ? void 0 : xScale.type, yScaleType: yScale == null ? void 0 : yScale.type };\n }\n getModulePropertyDefinitions() {\n var _a, _b;\n const xScale = (_a = this.axes[\"x\" /* X */]) == null ? void 0 : _a.scale;\n const yScale = (_b = this.axes[\"y\" /* Y */]) == null ? void 0 : _b.scale;\n return this.moduleMap.mapModules((mod2) => mod2.getPropertyDefinitions(this.getScaleInformation({ xScale, yScale }))).flat();\n }\n // Request data, but with message dispatching to series-options (modules).\n requestDataModel(dataController, data, opts) {\n return __async(this, null, function* () {\n opts.props.push(...this.getModulePropertyDefinitions());\n const { dataModel, processedData } = yield dataController.request(this.id, data != null ? data : [], opts);\n this.dataModel = dataModel;\n this.processedData = processedData;\n this.dispatch(\"data-processed\", { dataModel, processedData });\n return { dataModel, processedData };\n });\n }\n isProcessedDataAnimatable() {\n var _a, _b;\n const validationResults = (_b = (_a = this.processedData) == null ? void 0 : _a.reduced) == null ? void 0 : _b.animationValidation;\n if (!validationResults) {\n return true;\n }\n const { orderedKeys, uniqueKeys } = validationResults;\n return orderedKeys && uniqueKeys;\n }\n checkProcessedDataAnimatable() {\n if (!this.isProcessedDataAnimatable()) {\n this.ctx.animationManager.skipCurrentBatch();\n }\n }\n pickFocus(opts) {\n return this.doPickFocus(opts, this);\n }\n // The legend behaves differently for Pie and Donut series. We need to use a seriesItemEnabled\n // array to determine whether a datum has been toggled on/off using the legend.\n doPickFocus(opts, derivedSeries) {\n const nodeData = this.getNodeData();\n if (nodeData === void 0 || nodeData.length === 0) {\n return void 0;\n }\n const { datumIndexDelta, seriesRect } = opts;\n const datumIndex = this.computeFocusDatumIndex(opts, nodeData, derivedSeries.seriesItemEnabled);\n if (datumIndex === void 0) {\n return void 0;\n }\n const { showFocusBox } = this;\n const datum = nodeData[datumIndex];\n const bbox = this.computeFocusBounds({ datumIndex, datumIndexDelta, seriesRect });\n if (bbox !== void 0) {\n return { bbox, showFocusBox, datum, datumIndex };\n }\n }\n computeFocusDatumIndex(opts, nodeData, seriesItemEnabled) {\n if (seriesItemEnabled && nodeData.length !== seriesItemEnabled.length) {\n Logger.error(\n `invalid state: nodeData.length (${nodeData.length} !== seriesItemEnabled.length (${seriesItemEnabled == null ? void 0 : seriesItemEnabled.length})`\n );\n }\n const isDatumEnabled = (datumIndex2) => {\n const nodeDatum = nodeData[datumIndex2];\n return (nodeDatum.missing === void 0 || nodeDatum.missing === false) && (seriesItemEnabled === void 0 || seriesItemEnabled[datumIndex2]);\n };\n const searchBackward = (datumIndex2) => {\n while (datumIndex2 >= 0 && !isDatumEnabled(datumIndex2)) {\n datumIndex2--;\n }\n return datumIndex2 === -1 ? void 0 : datumIndex2;\n };\n const searchForward = (datumIndex2) => {\n while (datumIndex2 < nodeData.length && !isDatumEnabled(datumIndex2)) {\n datumIndex2++;\n }\n return datumIndex2 === nodeData.length ? void 0 : datumIndex2;\n };\n let datumIndex;\n const clampedIndex = clamp(0, opts.datumIndex, nodeData.length - 1);\n if (opts.datumIndexDelta < 0) {\n datumIndex = searchBackward(clampedIndex);\n } else if (opts.datumIndexDelta > 0) {\n datumIndex = searchForward(clampedIndex);\n } else {\n datumIndex != null ? datumIndex : datumIndex = searchForward(clampedIndex);\n datumIndex != null ? datumIndex : datumIndex = searchBackward(clampedIndex);\n }\n if (datumIndex === void 0) {\n if (opts.datumIndexDelta === 0) {\n return void 0;\n } else {\n return opts.datumIndex - opts.datumIndexDelta;\n }\n } else {\n return datumIndex;\n }\n }\n};\n\n// packages/ag-charts-community/src/chart/series/seriesProperties.ts\nvar SeriesItemHighlightStyle = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.fill = \"rgba(255,255,255, 0.33)\";\n this.stroke = `rgba(0, 0, 0, 0.4)`;\n this.strokeWidth = 2;\n }\n};\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], SeriesItemHighlightStyle.prototype, \"fill\", 2);\n__decorateClass([\n Validate(RATIO, { optional: true })\n], SeriesItemHighlightStyle.prototype, \"fillOpacity\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], SeriesItemHighlightStyle.prototype, \"stroke\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], SeriesItemHighlightStyle.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(RATIO, { optional: true })\n], SeriesItemHighlightStyle.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n Validate(LINE_DASH, { optional: true })\n], SeriesItemHighlightStyle.prototype, \"lineDash\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], SeriesItemHighlightStyle.prototype, \"lineDashOffset\", 2);\nvar SeriesHighlightStyle = class extends BaseProperties {\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], SeriesHighlightStyle.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(RATIO, { optional: true })\n], SeriesHighlightStyle.prototype, \"dimOpacity\", 2);\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], SeriesHighlightStyle.prototype, \"enabled\", 2);\nvar TextHighlightStyle = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.color = \"black\";\n }\n};\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], TextHighlightStyle.prototype, \"color\", 2);\nvar HighlightStyle = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.item = new SeriesItemHighlightStyle();\n this.series = new SeriesHighlightStyle();\n this.text = new TextHighlightStyle();\n }\n};\n__decorateClass([\n Validate(OBJECT)\n], HighlightStyle.prototype, \"item\", 2);\n__decorateClass([\n Validate(OBJECT)\n], HighlightStyle.prototype, \"series\", 2);\n__decorateClass([\n Validate(OBJECT)\n], HighlightStyle.prototype, \"text\", 2);\nvar SeriesProperties = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.visible = true;\n this.showInLegend = true;\n this.cursor = \"default\";\n this.nodeClickRange = \"exact\";\n this.highlightStyle = new HighlightStyle();\n }\n};\n__decorateClass([\n Validate(STRING, { optional: true })\n], SeriesProperties.prototype, \"id\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], SeriesProperties.prototype, \"visible\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], SeriesProperties.prototype, \"showInLegend\", 2);\n__decorateClass([\n Validate(STRING)\n], SeriesProperties.prototype, \"cursor\", 2);\n__decorateClass([\n Validate(INTERACTION_RANGE)\n], SeriesProperties.prototype, \"nodeClickRange\", 2);\n__decorateClass([\n Validate(OBJECT)\n], SeriesProperties.prototype, \"highlightStyle\", 2);\n\n// packages/ag-charts-community/src/chart/series/cartesian/cartesianSeries.ts\nvar DEFAULT_CARTESIAN_DIRECTION_KEYS = {\n [\"x\" /* X */]: [\"xKey\"],\n [\"y\" /* Y */]: [\"yKey\"]\n};\nvar DEFAULT_CARTESIAN_DIRECTION_NAMES = {\n [\"x\" /* X */]: [\"xName\"],\n [\"y\" /* Y */]: [\"yName\"]\n};\nvar CartesianSeriesNodeEvent = class extends SeriesNodeEvent {\n constructor(type, nativeEvent, datum, series) {\n super(type, nativeEvent, datum, series);\n this.xKey = series.properties.xKey;\n this.yKey = series.properties.yKey;\n }\n};\nvar CartesianSeriesProperties = class extends SeriesProperties {\n};\n__decorateClass([\n Validate(STRING, { optional: true })\n], CartesianSeriesProperties.prototype, \"legendItemName\", 2);\nvar CartesianSeries = class extends DataModelSeries {\n constructor(_a) {\n var _b = _a, {\n pathsPerSeries = 1,\n hasMarkers = false,\n hasHighlightedLabels = false,\n pathsZIndexSubOrderOffset = [],\n datumSelectionGarbageCollection = true,\n markerSelectionGarbageCollection = true,\n animationAlwaysUpdateSelections = false,\n animationResetFns,\n directionKeys,\n directionNames\n } = _b, otherOpts = __objRest(_b, [\n \"pathsPerSeries\",\n \"hasMarkers\",\n \"hasHighlightedLabels\",\n \"pathsZIndexSubOrderOffset\",\n \"datumSelectionGarbageCollection\",\n \"markerSelectionGarbageCollection\",\n \"animationAlwaysUpdateSelections\",\n \"animationResetFns\",\n \"directionKeys\",\n \"directionNames\"\n ]);\n super(__spreadValues({\n directionKeys,\n directionNames,\n canHaveAxes: true\n }, otherOpts));\n this.NodeEvent = CartesianSeriesNodeEvent;\n this.dataNodeGroup = this.contentGroup.appendChild(\n new Group({\n name: `${this.id}-series-dataNodes`,\n zIndex: 4 /* SERIES_LAYER_ZINDEX */,\n zIndexSubOrder: this.getGroupZIndexSubOrder(\"data\")\n })\n );\n this.markerGroup = this.contentGroup.appendChild(\n new Group({\n name: `${this.id}-series-markers`,\n zIndex: 4 /* SERIES_LAYER_ZINDEX */,\n zIndexSubOrder: this.getGroupZIndexSubOrder(\"marker\")\n })\n );\n this.labelGroup = this.contentGroup.appendChild(\n new Group({\n name: `${this.id}-series-labels`,\n zIndex: 8 /* SERIES_LABEL_ZINDEX */,\n zIndexSubOrder: this.getGroupZIndexSubOrder(\"labels\")\n })\n );\n this.labelSelection = Selection.select(this.labelGroup, Text);\n this.highlightSelection = Selection.select(\n this.highlightNode,\n () => this.opts.hasMarkers ? this.markerFactory() : this.nodeFactory()\n );\n this.highlightLabelSelection = Selection.select(this.highlightLabel, Text);\n this.annotationSelections = /* @__PURE__ */ new Set();\n this.minRectsCache = {\n dirtyNodeData: true\n };\n this.debug = Debug.create();\n if (!directionKeys || !directionNames)\n throw new Error(`Unable to initialise series type ${this.type}`);\n this.opts = {\n pathsPerSeries,\n hasMarkers,\n hasHighlightedLabels,\n pathsZIndexSubOrderOffset,\n directionKeys,\n directionNames,\n animationResetFns,\n animationAlwaysUpdateSelections,\n datumSelectionGarbageCollection,\n markerSelectionGarbageCollection\n };\n this.paths = [];\n for (let index = 0; index < pathsPerSeries; index++) {\n this.paths[index] = new Path();\n this.paths[index].zIndex = 4 /* SERIES_LAYER_ZINDEX */;\n this.paths[index].zIndexSubOrder = this.getGroupZIndexSubOrder(\"paths\", index);\n this.contentGroup.appendChild(this.paths[index]);\n }\n this.datumSelection = Selection.select(\n this.dataNodeGroup,\n () => this.nodeFactory(),\n datumSelectionGarbageCollection\n );\n this.markerSelection = Selection.select(\n this.markerGroup,\n () => this.markerFactory(),\n markerSelectionGarbageCollection\n );\n this.animationState = new StateMachine(\n \"empty\",\n {\n empty: {\n update: {\n target: \"ready\",\n action: (data) => this.animateEmptyUpdateReady(data)\n },\n reset: \"empty\",\n skip: \"ready\",\n disable: \"disabled\"\n },\n ready: {\n updateData: \"waiting\",\n clear: \"clearing\",\n highlight: (data) => this.animateReadyHighlight(data),\n highlightMarkers: (data) => this.animateReadyHighlightMarkers(data),\n resize: (data) => this.animateReadyResize(data),\n reset: \"empty\",\n skip: \"ready\",\n disable: \"disabled\"\n },\n waiting: {\n update: {\n target: \"ready\",\n action: (data) => this.animateWaitingUpdateReady(data)\n },\n reset: \"empty\",\n skip: \"ready\",\n disable: \"disabled\"\n },\n disabled: {\n update: (data) => this.resetAllAnimation(data),\n reset: \"empty\"\n },\n clearing: {\n update: {\n target: \"empty\",\n action: (data) => this.animateClearingUpdateEmpty(data)\n },\n reset: \"empty\",\n skip: \"ready\"\n }\n },\n () => this.checkProcessedDataAnimatable()\n );\n }\n get contextNodeData() {\n return this._contextNodeData;\n }\n getNodeData() {\n var _a;\n return (_a = this.contextNodeData) == null ? void 0 : _a.nodeData;\n }\n resetAnimation(phase) {\n if (phase === \"initial\") {\n this.animationState.transition(\"reset\");\n } else if (phase === \"ready\") {\n this.animationState.transition(\"skip\");\n } else if (phase === \"disabled\") {\n this.animationState.transition(\"disable\");\n }\n }\n addChartEventListeners() {\n this.destroyFns.push(\n this.ctx.chartEventManager.addListener(\"legend-item-click\", (event) => this.onLegendItemClick(event)),\n this.ctx.chartEventManager.addListener(\n \"legend-item-double-click\",\n (event) => this.onLegendItemDoubleClick(event)\n )\n );\n }\n destroy() {\n super.destroy();\n this._contextNodeData = void 0;\n }\n update(_0) {\n return __async(this, arguments, function* ({ seriesRect }) {\n var _a, _b;\n const { visible, _contextNodeData: previousContextData } = this;\n const series = (_b = (_a = this.ctx.highlightManager) == null ? void 0 : _a.getActiveHighlight()) == null ? void 0 : _b.series;\n const seriesHighlighted = series === this;\n const resize = this.checkResize(seriesRect);\n const highlightItems = yield this.updateHighlightSelection(seriesHighlighted);\n yield this.updateSelections(visible);\n yield this.updateNodes(highlightItems, seriesHighlighted, visible);\n const animationData = this.getAnimationData(seriesRect, previousContextData);\n if (!animationData)\n return;\n if (resize) {\n this.animationState.transition(\"resize\", animationData);\n }\n this.animationState.transition(\"update\", animationData);\n });\n }\n updateSelections(anySeriesItemEnabled) {\n return __async(this, null, function* () {\n var _a, _b;\n const animationSkipUpdate = !this.opts.animationAlwaysUpdateSelections && this.ctx.animationManager.isSkipped();\n if (!anySeriesItemEnabled && animationSkipUpdate) {\n return;\n }\n if (!this.nodeDataRefresh && !this.isPathOrSelectionDirty()) {\n return;\n }\n if (this.nodeDataRefresh) {\n this.nodeDataRefresh = false;\n this.debug(`CartesianSeries.updateSelections() - calling createNodeData() for`, this.id);\n this.markQuadtreeDirty();\n this._contextNodeData = yield this.createNodeData();\n const animationValid = this.isProcessedDataAnimatable();\n if (this._contextNodeData) {\n (_b = (_a = this._contextNodeData).animationValid) != null ? _b : _a.animationValid = animationValid;\n }\n this.minRectsCache.dirtyNodeData = true;\n const { dataModel, processedData } = this;\n if (dataModel !== void 0 && processedData !== void 0) {\n this.dispatch(\"data-update\", { dataModel, processedData });\n }\n }\n yield this.updateSeriesSelections();\n });\n }\n updateSeriesSelections(seriesHighlighted) {\n return __async(this, null, function* () {\n const { datumSelection, labelSelection, markerSelection, paths } = this;\n const contextData = this._contextNodeData;\n if (!contextData)\n return;\n const { nodeData, labelData, itemId } = contextData;\n yield this.updatePaths({ seriesHighlighted, itemId, contextData, paths });\n this.datumSelection = yield this.updateDatumSelection({ nodeData, datumSelection });\n this.labelSelection = yield this.updateLabelSelection({ labelData, labelSelection });\n if (this.opts.hasMarkers) {\n this.markerSelection = yield this.updateMarkerSelection({ nodeData, markerSelection });\n }\n });\n }\n markerFactory() {\n const MarkerShape = getMarker();\n return new MarkerShape();\n }\n getGroupZIndexSubOrder(type, subIndex = 0) {\n var _a;\n const result = super.getGroupZIndexSubOrder(type, subIndex);\n if (type === \"paths\") {\n const [superFn] = result;\n const pathOffset = (_a = this.opts.pathsZIndexSubOrderOffset[subIndex]) != null ? _a : 0;\n result[0] = isFunction(superFn) ? () => Number(superFn()) + pathOffset : Number(superFn) + pathOffset;\n }\n return result;\n }\n updateNodes(highlightedItems, seriesHighlighted, anySeriesItemEnabled) {\n return __async(this, null, function* () {\n var _a;\n const {\n highlightSelection,\n highlightLabelSelection,\n opts: { hasMarkers, hasHighlightedLabels }\n } = this;\n const animationEnabled = !this.ctx.animationManager.isSkipped();\n const visible = this.visible && this._contextNodeData != null && anySeriesItemEnabled;\n this.rootGroup.visible = animationEnabled || visible;\n this.contentGroup.visible = animationEnabled || visible;\n this.highlightGroup.visible = (animationEnabled || visible) && seriesHighlighted;\n const opacity = this.getOpacity();\n if (hasMarkers) {\n yield this.updateMarkerNodes({\n markerSelection: highlightSelection,\n isHighlight: true\n });\n this.animationState.transition(\"highlightMarkers\", highlightSelection);\n } else {\n yield this.updateDatumNodes({\n datumSelection: highlightSelection,\n isHighlight: true\n });\n this.animationState.transition(\"highlight\", highlightSelection);\n }\n if (hasHighlightedLabels) {\n yield this.updateLabelNodes({ labelSelection: highlightLabelSelection });\n }\n const { dataNodeGroup, markerGroup, datumSelection, labelSelection, markerSelection, paths, labelGroup } = this;\n const { itemId } = (_a = this.contextNodeData) != null ? _a : {};\n dataNodeGroup.opacity = opacity;\n dataNodeGroup.visible = animationEnabled || visible;\n labelGroup.visible = visible;\n if (hasMarkers) {\n markerGroup.opacity = opacity;\n markerGroup.zIndex = dataNodeGroup.zIndex >= 4 /* SERIES_LAYER_ZINDEX */ ? dataNodeGroup.zIndex : dataNodeGroup.zIndex + 1;\n markerGroup.visible = visible;\n }\n if (labelGroup) {\n labelGroup.opacity = opacity;\n }\n yield this.updatePathNodes({\n seriesHighlighted,\n itemId,\n paths,\n opacity,\n visible,\n animationEnabled\n });\n if (!dataNodeGroup.visible) {\n return;\n }\n yield this.updateDatumNodes({ datumSelection, highlightedItems, isHighlight: false });\n yield this.updateLabelNodes({ labelSelection });\n if (hasMarkers) {\n yield this.updateMarkerNodes({ markerSelection, isHighlight: false });\n }\n });\n }\n getHighlightLabelData(labelData, highlightedItem) {\n const labelItems = labelData.filter(\n (ld) => ld.datum === highlightedItem.datum && ld.itemId === highlightedItem.itemId\n );\n return labelItems.length === 0 ? void 0 : labelItems;\n }\n getHighlightData(_nodeData, highlightedItem) {\n return highlightedItem ? [highlightedItem] : void 0;\n }\n updateHighlightSelection(seriesHighlighted) {\n return __async(this, null, function* () {\n var _a;\n const { highlightSelection, highlightLabelSelection, _contextNodeData: contextNodeData } = this;\n if (!contextNodeData)\n return;\n const highlightedDatum = (_a = this.ctx.highlightManager) == null ? void 0 : _a.getActiveHighlight();\n const item = seriesHighlighted && (highlightedDatum == null ? void 0 : highlightedDatum.datum) ? highlightedDatum : void 0;\n let labelItems;\n let highlightItems;\n if (item != null) {\n const labelsEnabled = this.isLabelEnabled();\n const { labelData, nodeData } = contextNodeData;\n highlightItems = this.getHighlightData(nodeData, item);\n labelItems = labelsEnabled ? this.getHighlightLabelData(labelData, item) : void 0;\n }\n this.highlightSelection = yield this.updateHighlightSelectionItem({\n items: highlightItems,\n highlightSelection\n });\n this.highlightLabelSelection = yield this.updateHighlightSelectionLabel({\n items: labelItems,\n highlightLabelSelection\n });\n return highlightItems;\n });\n }\n markQuadtreeDirty() {\n this.quadtree = void 0;\n }\n *datumNodesIter() {\n for (const { node } of this.datumSelection) {\n if (node.datum.missing === true)\n continue;\n yield node;\n }\n }\n getQuadTree() {\n if (this.quadtree === void 0) {\n const { width, height } = this.ctx.scene.canvas;\n const canvasRect = new BBox(0, 0, width, height);\n this.quadtree = new QuadtreeNearest(100, 10, canvasRect);\n this.initQuadTree(this.quadtree);\n }\n return this.quadtree;\n }\n initQuadTree(_quadtree) {\n }\n pickNodeExactShape(point) {\n var _a;\n const result = super.pickNodeExactShape(point);\n if (result) {\n return result;\n }\n const { x, y } = point;\n const {\n opts: { hasMarkers }\n } = this;\n let match;\n const { dataNodeGroup, markerGroup } = this;\n match = dataNodeGroup.pickNode(x, y);\n if (!match && hasMarkers) {\n match = markerGroup == null ? void 0 : markerGroup.pickNode(x, y);\n }\n if (match && match.datum.missing !== true) {\n return { datum: match.datum, distance: 0 };\n }\n for (const mod2 of this.moduleMap.modules()) {\n const { datum } = (_a = mod2.pickNodeExact(point)) != null ? _a : {};\n if (datum == null)\n continue;\n if ((datum == null ? void 0 : datum.missing) === true)\n continue;\n return { datum, distance: 0 };\n }\n }\n pickNodeClosestDatum(point) {\n var _a, _b;\n const { x, y } = point;\n const { axes, rootGroup, _contextNodeData: contextNodeData } = this;\n if (!contextNodeData)\n return;\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n const hitPoint = rootGroup.transformPoint(x, y);\n let minDistance = Infinity;\n let closestDatum;\n for (const datum of contextNodeData.nodeData) {\n const { point: { x: datumX = NaN, y: datumY = NaN } = {} } = datum;\n if (isNaN(datumX) || isNaN(datumY)) {\n continue;\n }\n const isInRange = (xAxis == null ? void 0 : xAxis.inRange(datumX)) && (yAxis == null ? void 0 : yAxis.inRange(datumY));\n if (!isInRange) {\n continue;\n }\n const distance2 = Math.max(__pow(hitPoint.x - datumX, 2) + __pow(hitPoint.y - datumY, 2), 0);\n if (distance2 < minDistance) {\n minDistance = distance2;\n closestDatum = datum;\n }\n }\n for (const mod2 of this.moduleMap.modules()) {\n const modPick = mod2.pickNodeNearest(point);\n if (modPick !== void 0 && modPick.distanceSquared < minDistance) {\n minDistance = modPick.distanceSquared;\n closestDatum = modPick.datum;\n break;\n }\n }\n if (closestDatum) {\n const distance2 = Math.max(Math.sqrt(minDistance) - ((_b = (_a = closestDatum.point) == null ? void 0 : _a.size) != null ? _b : 0), 0);\n return { datum: closestDatum, distance: distance2 };\n }\n }\n pickNodeMainAxisFirst(point, requireCategoryAxis) {\n var _a, _b, _c, _d;\n const { x, y } = point;\n const { axes, rootGroup, _contextNodeData: contextNodeData } = this;\n if (!contextNodeData)\n return;\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n const directions2 = [xAxis, yAxis].filter((a) => a instanceof CategoryAxis).map((a) => a.direction);\n if (requireCategoryAxis && directions2.length === 0) {\n return;\n }\n const [primaryDirection = \"x\" /* X */] = directions2;\n const hitPoint = rootGroup.transformPoint(x, y);\n const hitPointCoords = primaryDirection === \"x\" /* X */ ? [hitPoint.x, hitPoint.y] : [hitPoint.y, hitPoint.x];\n const minDistance = [Infinity, Infinity];\n let closestDatum;\n for (const datum of contextNodeData.nodeData) {\n const { x: datumX = NaN, y: datumY = NaN } = (_b = (_a = datum.point) != null ? _a : datum.midPoint) != null ? _b : {};\n if (isNaN(datumX) || isNaN(datumY) || datum.missing === true) {\n continue;\n }\n const isInRange = (xAxis == null ? void 0 : xAxis.inRange(datumX)) && (yAxis == null ? void 0 : yAxis.inRange(datumY));\n if (!isInRange) {\n continue;\n }\n const datumPoint = primaryDirection === \"x\" /* X */ ? [datumX, datumY] : [datumY, datumX];\n let newMinDistance = true;\n for (let i = 0; i < datumPoint.length; i++) {\n const dist = Math.abs(datumPoint[i] - hitPointCoords[i]);\n if (dist > minDistance[i]) {\n newMinDistance = false;\n break;\n }\n if (dist < minDistance[i]) {\n minDistance[i] = dist;\n minDistance.fill(Infinity, i + 1, minDistance.length);\n }\n }\n if (newMinDistance) {\n closestDatum = datum;\n }\n }\n if (closestDatum) {\n let closestDistanceSquared = Math.max(\n __pow(minDistance[0], 2) + __pow(minDistance[1], 2) - ((_d = (_c = closestDatum.point) == null ? void 0 : _c.size) != null ? _d : 0),\n 0\n );\n for (const mod2 of this.moduleMap.modules()) {\n const modPick = mod2.pickNodeMainAxisFirst(point);\n if (modPick !== void 0 && modPick.distanceSquared < closestDistanceSquared) {\n closestDatum = modPick.datum;\n closestDistanceSquared = modPick.distanceSquared;\n break;\n }\n }\n return { datum: closestDatum, distance: Math.sqrt(closestDistanceSquared) };\n }\n }\n onLegendItemClick(event) {\n const { legendItemName } = this.properties;\n const { enabled, itemId, series } = event;\n const matchedLegendItemName = legendItemName != null && legendItemName === event.legendItemName;\n if (series.id === this.id || matchedLegendItemName) {\n this.toggleSeriesItem(itemId, enabled);\n }\n }\n onLegendItemDoubleClick(event) {\n const { enabled, itemId, series, numVisibleItems } = event;\n const { legendItemName } = this.properties;\n const matchedLegendItemName = legendItemName != null && legendItemName === event.legendItemName;\n if (series.id === this.id || matchedLegendItemName) {\n this.toggleSeriesItem(itemId, true);\n } else if (enabled && numVisibleItems === 1) {\n this.toggleSeriesItem(itemId, true);\n } else {\n this.toggleSeriesItem(itemId, false);\n }\n }\n isPathOrSelectionDirty() {\n return false;\n }\n getLabelData() {\n return [];\n }\n shouldFlipXY() {\n return false;\n }\n /**\n * Get the minimum bounding box that contains any adjacent two nodes. The axes are treated independently, so this\n * may not represent the same two points for both directions. The dimensions represent the greatest distance\n * between any two adjacent nodes.\n */\n getMinRects(width, height) {\n const { dirtyNodeData, sizeCache, minRect, minVisibleRect } = this.minRectsCache;\n const newSizeCache = JSON.stringify({ width, height });\n const dirtySize = newSizeCache !== sizeCache;\n if (!dirtySize && !dirtyNodeData && minRect && minVisibleRect) {\n return { minRect, minVisibleRect };\n }\n const rects = this.computeMinRects(width, height);\n this.minRectsCache = {\n dirtyNodeData: false,\n sizeCache: newSizeCache,\n minRect: rects == null ? void 0 : rects.minRect,\n minVisibleRect: rects == null ? void 0 : rects.minVisibleRect\n };\n return rects;\n }\n computeMinRects(width, height) {\n var _a, _b;\n const context = this._contextNodeData;\n if (!(context == null ? void 0 : context.nodeData.length)) {\n return;\n }\n const { nodeData } = context;\n const minRectXs = Array(nodeData.length);\n const minRectYs = Array(nodeData.length);\n for (const [i, { midPoint }] of nodeData.entries()) {\n minRectXs[i] = (_a = midPoint == null ? void 0 : midPoint.x) != null ? _a : 0;\n minRectYs[i] = (_b = midPoint == null ? void 0 : midPoint.y) != null ? _b : 0;\n }\n minRectXs.sort((a, b) => a - b);\n minRectYs.sort((a, b) => a - b);\n let zeroX, widthX, zeroY, heightY;\n let maxWidth = 0;\n let maxHeight = 0;\n for (let i = 1; i < nodeData.length; i++) {\n if (minRectXs[i] >= 0)\n zeroX != null ? zeroX : zeroX = i;\n if (minRectXs[i] > width)\n widthX != null ? widthX : widthX = i;\n if (minRectYs[i] >= 0)\n zeroY != null ? zeroY : zeroY = i;\n if (minRectYs[i] > height)\n heightY != null ? heightY : heightY = i;\n maxWidth = Math.max(maxWidth, minRectXs[i] - minRectXs[i - 1]);\n maxHeight = Math.max(maxHeight, minRectYs[i] - minRectYs[i - 1]);\n }\n widthX != null ? widthX : widthX = nodeData.length;\n heightY != null ? heightY : heightY = nodeData.length;\n const minVisibleRectXs = zeroX != null && widthX != null ? minRectXs.slice(zeroX, widthX) : [];\n const minVisibleRectYs = zeroY != null && heightY != null ? minRectYs.slice(zeroY, heightY) : [];\n let maxVisibleWidth = 0;\n let maxVisibleHeight = 0;\n for (let i = 1; i < Math.max(minVisibleRectXs.length, minVisibleRectYs.length); i++) {\n const x1 = minVisibleRectXs[i];\n const x2 = minVisibleRectXs[i - 1];\n const y1 = minVisibleRectYs[i];\n const y2 = minVisibleRectYs[i - 1];\n if (x1 != null && x2 != null) {\n maxVisibleWidth = Math.max(maxVisibleWidth, x1 - x2);\n }\n if (y1 != null && y2 != null) {\n maxVisibleHeight = Math.max(maxVisibleHeight, y1 - y2);\n }\n }\n const minRect = new BBox(0, 0, maxWidth, maxHeight);\n const minVisibleRect = new BBox(0, 0, maxVisibleWidth, maxVisibleHeight);\n return { minRect, minVisibleRect };\n }\n updateHighlightSelectionItem(opts) {\n const {\n opts: { hasMarkers }\n } = this;\n const { items, highlightSelection } = opts;\n const nodeData = items != null ? items : [];\n if (hasMarkers) {\n const markerSelection = highlightSelection;\n return this.updateMarkerSelection({ nodeData, markerSelection });\n } else {\n return this.updateDatumSelection({\n nodeData,\n datumSelection: highlightSelection\n });\n }\n }\n updateHighlightSelectionLabel(opts) {\n var _a;\n return this.updateLabelSelection({\n labelData: (_a = opts.items) != null ? _a : [],\n labelSelection: opts.highlightLabelSelection\n });\n }\n updateDatumSelection(opts) {\n return __async(this, null, function* () {\n return opts.datumSelection;\n });\n }\n updateDatumNodes(_opts) {\n return __async(this, null, function* () {\n });\n }\n updateMarkerSelection(opts) {\n return __async(this, null, function* () {\n return opts.markerSelection;\n });\n }\n updateMarkerNodes(_opts) {\n return __async(this, null, function* () {\n });\n }\n updatePaths(opts) {\n return __async(this, null, function* () {\n opts.paths.forEach((p) => p.visible = false);\n });\n }\n updatePathNodes(opts) {\n return __async(this, null, function* () {\n const { paths, opacity, visible } = opts;\n for (const path of paths) {\n path.opacity = opacity;\n path.visible = visible;\n }\n });\n }\n resetAllAnimation(data) {\n var _a, _b, _c;\n const { path, datum, label, marker } = (_b = (_a = this.opts) == null ? void 0 : _a.animationResetFns) != null ? _b : {};\n this.ctx.animationManager.stopByAnimationGroupId(this.id);\n if (path) {\n data.paths.forEach((paths) => {\n resetMotion([paths], path);\n });\n }\n if (datum) {\n resetMotion([data.datumSelection], datum);\n }\n if (label) {\n resetMotion([data.labelSelection], label);\n }\n if (marker && this.opts.hasMarkers) {\n resetMotion([data.markerSelection], marker);\n }\n if (((_c = data.contextData) == null ? void 0 : _c.animationValid) === false) {\n this.ctx.animationManager.skipCurrentBatch();\n }\n }\n animateEmptyUpdateReady(data) {\n this.ctx.animationManager.skipCurrentBatch();\n this.resetAllAnimation(data);\n }\n animateWaitingUpdateReady(data) {\n this.ctx.animationManager.skipCurrentBatch();\n this.resetAllAnimation(data);\n }\n animateReadyHighlight(data) {\n var _a, _b;\n const { datum } = (_b = (_a = this.opts) == null ? void 0 : _a.animationResetFns) != null ? _b : {};\n if (datum) {\n resetMotion([data], datum);\n }\n }\n animateReadyHighlightMarkers(data) {\n var _a, _b;\n const { marker } = (_b = (_a = this.opts) == null ? void 0 : _a.animationResetFns) != null ? _b : {};\n if (marker) {\n resetMotion([data], marker);\n }\n }\n animateReadyResize(data) {\n this.resetAllAnimation(data);\n }\n animateClearingUpdateEmpty(data) {\n this.ctx.animationManager.skipCurrentBatch();\n this.resetAllAnimation(data);\n }\n animationTransitionClear() {\n const animationData = this.getAnimationData();\n if (!animationData)\n return;\n this.animationState.transition(\"clear\", animationData);\n }\n getAnimationData(seriesRect, previousContextData) {\n const { _contextNodeData: contextData } = this;\n if (!contextData)\n return;\n const animationData = {\n datumSelection: this.datumSelection,\n markerSelection: this.markerSelection,\n labelSelection: this.labelSelection,\n annotationSelections: [...this.annotationSelections],\n contextData,\n previousContextData,\n paths: this.paths,\n seriesRect\n };\n return animationData;\n }\n calculateScaling() {\n const result = {};\n for (const direction of Object.values(ChartAxisDirection)) {\n const axis = this.axes[direction];\n if (!axis)\n continue;\n if (axis.scale instanceof LogScale) {\n const { range: range3, domain } = axis.scale;\n result[direction] = {\n type: \"log\",\n convert: (d) => axis.scale.convert(d),\n domain: [domain[0], domain[1]],\n range: [range3[0], range3[1]]\n };\n } else if (axis.scale instanceof ContinuousScale) {\n const { range: range3 } = axis.scale;\n const domain = axis.scale.getDomain();\n result[direction] = {\n type: \"continuous\",\n domain: [domain[0], domain[1]],\n range: [range3[0], range3[1]]\n };\n } else if (axis.scale) {\n const { domain } = axis.scale;\n result[direction] = {\n type: \"category\",\n domain,\n range: domain.map((d) => axis.scale.convert(d))\n };\n }\n }\n return result;\n }\n};\n\n// packages/ag-charts-community/src/chart/cartesianChart.ts\nvar directions = [\"top\", \"right\", \"bottom\", \"left\"];\nvar _CartesianChart = class _CartesianChart extends Chart {\n constructor(options, resources) {\n super(options, resources);\n /** Integrated Charts feature state - not used in Standalone Charts. */\n this.paired = true;\n this.firstSeriesTranslation = true;\n this._lastCrossLineIds = void 0;\n this._lastAxisWidths = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n };\n this._lastClipSeries = false;\n this._lastVisibility = {\n crossLines: true,\n series: true\n };\n }\n onAxisChange(newValue, oldValue) {\n super.onAxisChange(newValue, oldValue);\n this.zoomManager.updateAxes(newValue);\n }\n destroySeries(series) {\n super.destroySeries(series);\n this.firstSeriesTranslation = true;\n }\n performLayout() {\n return __async(this, null, function* () {\n const shrinkRect = yield __superGet(_CartesianChart.prototype, this, \"performLayout\").call(this);\n const { firstSeriesTranslation, seriesRoot, annotationRoot, highlightRoot } = this;\n const { animationRect, seriesRect, visibility, clipSeries } = this.updateAxes(shrinkRect);\n this.seriesRoot.visible = visibility.series;\n this.seriesRect = seriesRect;\n this.animationRect = animationRect;\n const { x, y } = seriesRect;\n if (firstSeriesTranslation) {\n for (const group2 of [seriesRoot, annotationRoot, highlightRoot]) {\n group2.translationX = Math.floor(x);\n group2.translationY = Math.floor(y);\n }\n this.firstSeriesTranslation = false;\n } else {\n const { translationX, translationY } = seriesRoot;\n staticFromToMotion(\n this.id,\n \"seriesRect\",\n this.ctx.animationManager,\n [seriesRoot, highlightRoot, annotationRoot],\n { translationX, translationY },\n { translationX: Math.floor(x), translationY: Math.floor(y) },\n { phase: \"update\" }\n );\n }\n const seriesPaddedRect = seriesRect.clone().grow(this.seriesArea.padding);\n this.hoverRect = seriesPaddedRect;\n const clipRect = this.seriesArea.clip || clipSeries ? seriesPaddedRect : void 0;\n seriesRoot.setClipRectInGroupCoordinateSpace(clipRect);\n highlightRoot.setClipRectInGroupCoordinateSpace(clipRect);\n annotationRoot.setClipRectInGroupCoordinateSpace(clipRect);\n this.ctx.layoutService.dispatchLayoutComplete({\n type: \"layout-complete\",\n chart: { width: this.ctx.scene.width, height: this.ctx.scene.height },\n clipSeries,\n series: {\n rect: seriesRect,\n paddedRect: seriesPaddedRect,\n visible: visibility.series,\n shouldFlipXY: this.shouldFlipXY()\n },\n axes: this.axes.map((axis) => __spreadValues({ id: axis.id }, axis.getLayoutState()))\n });\n const modulePromises = this.modulesManager.mapModules((m) => {\n var _a;\n return (_a = m.performCartesianLayout) == null ? void 0 : _a.call(m, { seriesRect });\n });\n yield Promise.all(modulePromises);\n return shrinkRect;\n });\n }\n updateAxes(inputShrinkRect) {\n var _a;\n const crossLineIds = this.axes.flatMap((axis) => {\n var _a2;\n return (_a2 = axis.crossLines) != null ? _a2 : [];\n }).map((crossLine) => crossLine.id);\n const axesValid = this._lastCrossLineIds != null && this._lastCrossLineIds.length === crossLineIds.length && this._lastCrossLineIds.every((id, index) => crossLineIds[index] === id);\n let axisWidths;\n let clipSeries;\n let visibility;\n if (axesValid) {\n axisWidths = __spreadValues({}, this._lastAxisWidths);\n clipSeries = this._lastClipSeries;\n visibility = __spreadValues({}, this._lastVisibility);\n } else {\n axisWidths = { top: 0, bottom: 0, left: 0, right: 0 };\n clipSeries = false;\n visibility = { crossLines: true, series: true };\n this._lastCrossLineIds = crossLineIds;\n }\n const liveAxisWidths = new Set(this.axes.map((a) => a.position));\n for (const position of Object.keys(axisWidths)) {\n if (!liveAxisWidths.has(position)) {\n delete axisWidths[position];\n }\n }\n const stableOutputs = (otherAxisWidths, otherClipSeries, otherVisibility) => {\n if (Object.keys(otherAxisWidths).some((k) => axisWidths[k] == null)) {\n return false;\n }\n return visibility.crossLines === otherVisibility.crossLines && visibility.series === otherVisibility.series && // Check for existing axis positions and equality.\n Object.entries(axisWidths).every(([p, w]) => {\n const otherW = otherAxisWidths[p];\n if (w != null || otherW != null) {\n return w === otherW;\n }\n return true;\n }) && clipSeries === otherClipSeries;\n };\n const ceilValues = (records) => mapValues(records, (value) => {\n if (value && Math.abs(value) === Infinity) {\n return 0;\n }\n return value != null ? Math.ceil(value) : value;\n });\n let lastPassAxisWidths = {};\n let lastPassVisibility = {};\n let lastPassClipSeries = false;\n let seriesRect = (_a = this.seriesRect) == null ? void 0 : _a.clone();\n let count = 0;\n let primaryTickCounts = {};\n do {\n Object.assign(axisWidths, lastPassAxisWidths);\n clipSeries = lastPassClipSeries;\n Object.assign(visibility, lastPassVisibility);\n const result = this.updateAxesPass(axisWidths, inputShrinkRect.clone(), seriesRect);\n lastPassAxisWidths = ceilValues(result.axisWidths);\n lastPassVisibility = result.visibility;\n lastPassClipSeries = result.clipSeries;\n seriesRect = result.seriesRect;\n primaryTickCounts = result.primaryTickCounts;\n if (count++ > 10) {\n Logger.warn(\"unable to find stable axis layout.\");\n break;\n }\n } while (!stableOutputs(lastPassAxisWidths, lastPassClipSeries, lastPassVisibility));\n this.axes.forEach((axis) => {\n axis.update(primaryTickCounts[axis.direction]);\n });\n const clipRectPadding = 5;\n this.axes.forEach((axis) => {\n axis.setCrossLinesVisible(visibility.crossLines);\n if (!seriesRect) {\n return;\n }\n axis.clipGrid(\n seriesRect.x,\n seriesRect.y,\n seriesRect.width + clipRectPadding,\n seriesRect.height + clipRectPadding\n );\n switch (axis.position) {\n case \"left\":\n case \"right\":\n axis.clipTickLines(\n inputShrinkRect.x,\n seriesRect.y,\n inputShrinkRect.width + clipRectPadding,\n seriesRect.height + clipRectPadding\n );\n break;\n case \"top\":\n case \"bottom\":\n axis.clipTickLines(\n seriesRect.x,\n inputShrinkRect.y,\n seriesRect.width + clipRectPadding,\n inputShrinkRect.height + clipRectPadding\n );\n break;\n }\n });\n this._lastAxisWidths = axisWidths;\n this._lastVisibility = visibility;\n return { seriesRect, animationRect: inputShrinkRect, visibility, clipSeries };\n }\n updateAxesPass(axisWidths, bounds, lastPassSeriesRect) {\n const visited = {};\n const newAxisWidths = {};\n const visibility = {\n series: true,\n crossLines: true\n };\n let clipSeries = false;\n const primaryTickCounts = {};\n const paddedBounds = this.applySeriesPadding(bounds);\n const crossLinePadding = lastPassSeriesRect ? this.buildCrossLinePadding(axisWidths) : {};\n const axisBound = this.buildAxisBound(paddedBounds, axisWidths, crossLinePadding, visibility);\n const seriesRect = this.buildSeriesRect(axisBound, axisWidths);\n this.axes.forEach((axis) => {\n var _a, _b;\n const { position = \"left\" } = axis;\n const {\n clipSeries: newClipSeries,\n axisThickness,\n axisOffset\n } = this.calculateAxisDimensions({\n axis,\n seriesRect,\n paddedBounds,\n axisWidths,\n newAxisWidths,\n primaryTickCounts,\n clipSeries,\n addInterAxisPadding: ((_a = visited[position]) != null ? _a : 0) > 0\n });\n visited[position] = ((_b = visited[position]) != null ? _b : 0) + 1;\n clipSeries = clipSeries || newClipSeries;\n this.positionAxis({\n axis,\n axisBound,\n axisOffset,\n axisThickness,\n axisWidths,\n primaryTickCounts,\n seriesRect\n });\n });\n return { clipSeries, seriesRect, axisWidths: newAxisWidths, visibility, primaryTickCounts };\n }\n buildCrossLinePadding(axisWidths) {\n var _a;\n const crossLinePadding = {};\n this.axes.forEach((axis) => {\n if (axis.crossLines) {\n axis.crossLines.forEach((crossLine) => {\n var _a2;\n (_a2 = crossLine.calculatePadding) == null ? void 0 : _a2.call(crossLine, crossLinePadding);\n });\n }\n });\n for (const [side, padding = 0] of Object.entries(crossLinePadding)) {\n crossLinePadding[side] = Math.max(padding - ((_a = axisWidths[side]) != null ? _a : 0), 0);\n }\n return crossLinePadding;\n }\n applySeriesPadding(bounds) {\n const paddedRect = bounds.clone();\n const reversedAxes = this.axes.slice().reverse();\n directions.forEach((dir) => {\n const padding = this.seriesArea.padding[dir];\n const axis = reversedAxes.find((a) => a.position === dir);\n if (axis) {\n axis.seriesAreaPadding = padding;\n } else {\n paddedRect.shrink(padding, dir);\n }\n });\n return paddedRect;\n }\n buildAxisBound(bounds, axisWidths, crossLinePadding, visibility) {\n var _a, _b, _c, _d;\n const result = bounds.clone();\n const { top = 0, right = 0, bottom = 0, left = 0 } = crossLinePadding;\n const horizontalPadding = left + right;\n const verticalPadding = top + bottom;\n const totalWidth = ((_a = axisWidths.left) != null ? _a : 0) + ((_b = axisWidths.right) != null ? _b : 0) + horizontalPadding;\n const totalHeight = ((_c = axisWidths.top) != null ? _c : 0) + ((_d = axisWidths.bottom) != null ? _d : 0) + verticalPadding;\n if (result.width <= totalWidth || result.height <= totalHeight) {\n visibility.crossLines = false;\n visibility.series = false;\n return result;\n }\n result.x += left;\n result.y += top;\n result.width -= horizontalPadding;\n result.height -= verticalPadding;\n return result;\n }\n buildSeriesRect(axisBound, axisWidths) {\n const result = axisBound.clone();\n const { top, bottom, left, right } = axisWidths;\n result.x += left != null ? left : 0;\n result.y += top != null ? top : 0;\n result.width -= (left != null ? left : 0) + (right != null ? right : 0);\n result.height -= (top != null ? top : 0) + (bottom != null ? bottom : 0);\n result.width = Math.max(0, result.width);\n result.height = Math.max(0, result.height);\n return result;\n }\n clampToOutsideSeriesRect(seriesRect, value, dimension, direction) {\n const { x, y, width, height } = seriesRect;\n const clampBounds = [x, y, x + width, y + height];\n const compareTo = clampBounds[(dimension === \"x\" ? 0 : 1) + (direction === 1 ? 0 : 2)];\n const clampFn = direction === 1 ? Math.min : Math.max;\n return clampFn(value, compareTo);\n }\n calculateAxisDimensions(opts) {\n var _a, _b, _c, _d;\n const { axis, seriesRect, paddedBounds, axisWidths, newAxisWidths, primaryTickCounts, addInterAxisPadding } = opts;\n let { clipSeries } = opts;\n const { position = \"left\", direction } = axis;\n const isCategory = axis instanceof CategoryAxis || axis instanceof GroupedCategoryAxis;\n const isLeftRight = position === \"left\" || position === \"right\";\n const axisOffset = (_a = newAxisWidths[position]) != null ? _a : 0;\n const { min, max } = this.ctx.zoomManager.getAxisZoom(axis.id);\n if (isLeftRight) {\n if (isCategory) {\n axis.range = [0, seriesRect.height];\n axis.visibleRange = [1 - max, 1 - min];\n } else {\n axis.range = [seriesRect.height, 0];\n axis.visibleRange = [min, max];\n }\n axis.gridLength = seriesRect.width;\n } else {\n axis.range = [0, seriesRect.width];\n axis.visibleRange = [min, max];\n axis.gridLength = seriesRect.height;\n }\n let primaryTickCount = axis.nice ? primaryTickCounts[direction] : void 0;\n const isVertical = direction === \"y\" /* Y */;\n const paddedBoundsCoefficient = 0.3;\n if (axis.thickness) {\n axis.maxThickness = axis.thickness;\n } else {\n axis.maxThickness = (isVertical ? paddedBounds.width : paddedBounds.height) * paddedBoundsCoefficient;\n }\n const layout = axis.calculateLayout(primaryTickCount);\n primaryTickCount = layout.primaryTickCount;\n (_b = primaryTickCounts[direction]) != null ? _b : primaryTickCounts[direction] = primaryTickCount;\n clipSeries || (clipSeries = axis.dataDomain.clipped || axis.visibleRange[0] > 0 || axis.visibleRange[1] < 1);\n let axisThickness;\n if (axis.thickness != null && axis.thickness > 0) {\n axisThickness = axis.thickness;\n } else {\n const { bbox } = layout;\n axisThickness = isVertical ? bbox.width : bbox.height;\n }\n const axisPadding = 15;\n if (addInterAxisPadding) {\n axisThickness += axisPadding;\n }\n axisThickness = Math.ceil(axisThickness);\n newAxisWidths[position] = ((_c = newAxisWidths[position]) != null ? _c : 0) + axisThickness;\n axis.gridPadding = ((_d = axisWidths[position]) != null ? _d : 0) - newAxisWidths[position];\n return { clipSeries, axisThickness, axisOffset, primaryTickCount };\n }\n positionAxis(opts) {\n var _a, _b, _c, _d;\n const { axis, axisBound, axisWidths, seriesRect, axisOffset, axisThickness } = opts;\n const { position } = axis;\n switch (position) {\n case \"top\":\n axis.translation.x = axisBound.x + ((_a = axisWidths.left) != null ? _a : 0);\n axis.translation.y = this.clampToOutsideSeriesRect(\n seriesRect,\n axisBound.y + 1 + axisOffset + axisThickness,\n \"y\",\n 1\n );\n break;\n case \"bottom\":\n axis.translation.x = axisBound.x + ((_b = axisWidths.left) != null ? _b : 0);\n axis.translation.y = this.clampToOutsideSeriesRect(\n seriesRect,\n axisBound.y + axisBound.height + 1 - axisThickness - axisOffset,\n \"y\",\n -1\n );\n break;\n case \"left\":\n axis.translation.y = axisBound.y + ((_c = axisWidths.top) != null ? _c : 0);\n axis.translation.x = this.clampToOutsideSeriesRect(\n seriesRect,\n axisBound.x + axisOffset + axisThickness,\n \"x\",\n 1\n );\n break;\n case \"right\":\n axis.translation.y = axisBound.y + ((_d = axisWidths.top) != null ? _d : 0);\n axis.translation.x = this.clampToOutsideSeriesRect(\n seriesRect,\n axisBound.x + axisBound.width - axisThickness - axisOffset,\n \"x\",\n -1\n );\n break;\n }\n axis.updatePosition({ rotation: toRadians(axis.rotation), sideFlag: axis.label.getSideFlag() });\n }\n shouldFlipXY() {\n return !this.series.some((series) => !(series instanceof CartesianSeries && series.shouldFlipXY()));\n }\n};\n_CartesianChart.className = \"CartesianChart\";\n_CartesianChart.type = \"cartesian\";\nvar CartesianChart = _CartesianChart;\n\n// packages/ag-charts-community/src/chart/chartProxy.ts\nvar _AgChartInstanceProxy = class _AgChartInstanceProxy {\n static isInstance(x) {\n var _a;\n if (x instanceof _AgChartInstanceProxy) {\n return true;\n }\n if (((_a = x.constructor) == null ? void 0 : _a.name) === \"AgChartInstanceProxy\" && x.chart != null) {\n return true;\n }\n return x.chart != null && this.validateImplementation(x);\n }\n static validateImplementation(x) {\n var _a;\n const chartProps = [\"getOptions\", \"destroy\"];\n const signatureProps = Object.keys((_a = Object.getPrototypeOf(x)) != null ? _a : {});\n return chartProps.every((prop) => signatureProps.includes(prop));\n }\n constructor(chart) {\n this.chart = chart;\n }\n getOptions() {\n return deepClone(this.chart.getOptions());\n }\n resetAnimations() {\n this.chart.resetAnimations();\n }\n skipAnimations() {\n this.chart.skipAnimations();\n }\n destroy() {\n this.chart.destroy();\n }\n};\n_AgChartInstanceProxy.chartInstances = /* @__PURE__ */ new WeakMap();\n__decorateClass([\n ActionOnSet({\n oldValue(chart) {\n _AgChartInstanceProxy.chartInstances.delete(chart);\n },\n newValue(chart) {\n _AgChartInstanceProxy.chartInstances.set(chart, this);\n }\n })\n], _AgChartInstanceProxy.prototype, \"chart\", 2);\nvar AgChartInstanceProxy = _AgChartInstanceProxy;\n\n// packages/ag-charts-community/src/scale/linearScale.ts\nvar LinearScale = class extends ContinuousScale {\n constructor() {\n super([0, 1], [0, 1]);\n this.type = \"number\";\n }\n toDomain(d) {\n return d;\n }\n ticks() {\n var _a;\n const count = (_a = this.tickCount) != null ? _a : ContinuousScale.defaultTickCount;\n if (!this.domain || this.domain.length < 2 || count < 1 || this.domain.some((d) => !isFinite(d))) {\n return [];\n }\n this.refresh();\n const [d0, d1] = this.getDomain();\n const { interval } = this;\n if (interval) {\n const step = Math.abs(interval);\n const availableRange = this.getPixelRange();\n if (!isDenseInterval({ start: d0, stop: d1, interval: step, availableRange })) {\n return range(d0, d1, step);\n }\n }\n return ticks_default(d0, d1, count, this.minTickCount, this.maxTickCount);\n }\n update() {\n if (!this.domain || this.domain.length < 2) {\n return;\n }\n if (this.nice) {\n this.updateNiceDomain();\n }\n }\n getTickStep(start, stop) {\n var _a, _b;\n const count = (_a = this.tickCount) != null ? _a : ContinuousScale.defaultTickCount;\n return (_b = this.interval) != null ? _b : tickStep(start, stop, count, this.minTickCount, this.maxTickCount);\n }\n /**\n * Extends the domain so that it starts and ends on nice round values.\n */\n updateNiceDomain() {\n var _a;\n const count = (_a = this.tickCount) != null ? _a : ContinuousScale.defaultTickCount;\n if (count < 1) {\n this.niceDomain = [...this.domain];\n return;\n }\n let [start, stop] = this.domain;\n if (count === 1) {\n [start, stop] = singleTickDomain(start, stop);\n } else {\n const roundStart = start > stop ? Math.ceil : Math.floor;\n const roundStop = stop < start ? Math.floor : Math.ceil;\n const maxAttempts = 4;\n for (let i = 0; i < maxAttempts; i++) {\n const prev0 = start;\n const prev1 = stop;\n const step = this.getTickStep(start, stop);\n const [d0, d1] = this.domain;\n if (step >= 1) {\n start = roundStart(d0 / step) * step;\n stop = roundStop(d1 / step) * step;\n } else {\n const s = 1 / step;\n start = roundStart(d0 * s) / s;\n stop = roundStop(d1 * s) / s;\n }\n if (start === prev0 && stop === prev1) {\n break;\n }\n }\n }\n this.niceDomain = [start, stop];\n }\n tickFormat({ ticks: specifiedTicks, specifier }) {\n return tickFormat(specifiedTicks != null ? specifiedTicks : this.ticks(), specifier);\n }\n};\n\n// packages/ag-charts-community/src/util/secondaryAxisTicks.ts\nfunction calculateNiceSecondaryAxis(domain, primaryTickCount, reverse) {\n let [start, stop] = findMinMax(domain);\n start = calculateNiceStart(Math.floor(start), stop, primaryTickCount);\n const step = getTickStep(start, stop, primaryTickCount);\n const segments = primaryTickCount - 1;\n stop = start + segments * step;\n const d = reverse ? [stop, start] : [start, stop];\n const ticks = getTicks(start, step, primaryTickCount);\n return [d, ticks];\n}\nfunction calculateNiceStart(a, b, count) {\n const rawStep = Math.abs(b - a) / (count - 1);\n const order = Math.floor(Math.log10(rawStep));\n const magnitude = Math.pow(10, order);\n return Math.floor(a / magnitude) * magnitude;\n}\nfunction getTicks(start, step, count) {\n const stepPower = Math.floor(Math.log10(step));\n const fractionDigits = step > 0 && step < 1 ? Math.abs(stepPower) : 0;\n const f = Math.pow(10, fractionDigits);\n const ticks = createNumericTicks(fractionDigits);\n for (let i = 0; i < count; i++) {\n const tick = start + step * i;\n ticks[i] = Math.round(tick * f) / f;\n }\n return ticks;\n}\nfunction getTickStep(start, stop, count) {\n const segments = count - 1;\n const rawStep = (stop - start) / segments;\n return calculateNextNiceStep(rawStep);\n}\nfunction calculateNextNiceStep(rawStep) {\n const order = Math.floor(Math.log10(rawStep));\n const magnitude = Math.pow(10, order);\n const step = rawStep / magnitude * 10;\n if (step > 0 && step <= 1) {\n return magnitude / 10;\n }\n if (step > 1 && step <= 2) {\n return 2 * magnitude / 10;\n }\n if (step > 1 && step <= 5) {\n return 5 * magnitude / 10;\n }\n if (step > 5 && step <= 10) {\n return 10 * magnitude / 10;\n }\n if (step > 10 && step <= 20) {\n return 20 * magnitude / 10;\n }\n if (step > 20 && step <= 40) {\n return 40 * magnitude / 10;\n }\n if (step > 40 && step <= 50) {\n return 50 * magnitude / 10;\n }\n if (step > 50 && step <= 100) {\n return 100 * magnitude / 10;\n }\n return step;\n}\n\n// packages/ag-charts-community/src/chart/axis/numberAxis.ts\nvar NumberAxisTick = class extends AxisTick {\n constructor() {\n super(...arguments);\n this.minSpacing = NaN;\n this.maxSpacing = NaN;\n }\n};\n__decorateClass([\n Validate(MIN_SPACING),\n Default(NaN)\n], NumberAxisTick.prototype, \"minSpacing\", 2);\n__decorateClass([\n Validate(MAX_SPACING),\n Default(NaN)\n], NumberAxisTick.prototype, \"maxSpacing\", 2);\nvar NumberAxis = class extends CartesianAxis {\n constructor(moduleCtx, scale2 = new LinearScale()) {\n super(moduleCtx, scale2);\n this.min = NaN;\n this.max = NaN;\n }\n normaliseDataDomain(d) {\n const { min, max } = this;\n const { extent: extent2, clipped } = normalisedExtentWithMetadata(d, min, max);\n return { domain: extent2, clipped };\n }\n createTick() {\n return new NumberAxisTick();\n }\n updateSecondaryAxisTicks(primaryTickCount) {\n if (this.dataDomain == null) {\n throw new Error(\"AG Charts - dataDomain not calculated, cannot perform tick calculation.\");\n }\n if (this.dataDomain.domain.length === 0)\n return [];\n const [d, ticks] = calculateNiceSecondaryAxis(this.dataDomain.domain, primaryTickCount != null ? primaryTickCount : 0, this.reverse);\n this.scale.nice = false;\n this.scale.domain = d;\n this.scale.update();\n return ticks;\n }\n formatDatum(datum) {\n if (typeof datum === \"number\") {\n return datum.toFixed(2);\n } else {\n return String(datum);\n }\n }\n};\nNumberAxis.className = \"NumberAxis\";\nNumberAxis.type = \"number\";\n__decorateClass([\n Validate(AND(NUMBER_OR_NAN, LESS_THAN(\"max\"))),\n Default(NaN)\n], NumberAxis.prototype, \"min\", 2);\n__decorateClass([\n Validate(AND(NUMBER_OR_NAN, GREATER_THAN(\"min\"))),\n Default(NaN)\n], NumberAxis.prototype, \"max\", 2);\n\n// packages/ag-charts-community/src/chart/axis/logAxis.ts\nvar NON_ZERO_NUMBER = predicateWithMessage((value) => isNumber(value) && value !== 0, \"a non-zero number\");\nvar LogAxis = class extends NumberAxis {\n constructor(moduleCtx) {\n super(moduleCtx, new LogScale());\n this.min = NaN;\n this.max = NaN;\n }\n normaliseDataDomain(d) {\n const { min, max } = this;\n const { extent: extent2, clipped } = normalisedExtentWithMetadata(d, min, max);\n const isInverted = extent2[0] > extent2[1];\n const crossesZero = extent2[0] < 0 && extent2[1] > 0;\n const hasZeroExtent = extent2[0] === 0 && extent2[1] === 0;\n const invalidDomain = isInverted || crossesZero || hasZeroExtent;\n if (invalidDomain) {\n if (crossesZero) {\n Logger.warn(\n `the data domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information.`\n );\n } else if (hasZeroExtent) {\n Logger.warn(`the data domain has 0 extent, no data is rendered.`);\n }\n }\n if (extent2[0] === 0) {\n extent2[0] = 1;\n }\n if (extent2[1] === 0) {\n extent2[1] = -1;\n }\n return { domain: extent2, clipped };\n }\n set base(value) {\n this.scale.base = value;\n }\n get base() {\n return this.scale.base;\n }\n};\nLogAxis.className = \"LogAxis\";\nLogAxis.type = \"log\";\n__decorateClass([\n Validate(AND(NUMBER_OR_NAN, NON_ZERO_NUMBER, LESS_THAN(\"max\"))),\n Default(NaN)\n], LogAxis.prototype, \"min\", 2);\n__decorateClass([\n Validate(AND(NUMBER_OR_NAN, NON_ZERO_NUMBER, GREATER_THAN(\"min\"))),\n Default(NaN)\n], LogAxis.prototype, \"max\", 2);\n\n// packages/ag-charts-community/src/chart/axis/timeAxis.ts\nvar TimeAxisTick = class extends AxisTick {\n constructor() {\n super(...arguments);\n this.minSpacing = NaN;\n this.maxSpacing = NaN;\n }\n};\n__decorateClass([\n Validate(MIN_SPACING),\n Default(NaN)\n], TimeAxisTick.prototype, \"minSpacing\", 2);\n__decorateClass([\n Validate(MAX_SPACING),\n Default(NaN)\n], TimeAxisTick.prototype, \"maxSpacing\", 2);\nvar TimeAxis = class extends CartesianAxis {\n constructor(moduleCtx) {\n super(moduleCtx, new TimeScale());\n this.min = void 0;\n this.max = void 0;\n this.refreshScale();\n }\n normaliseDataDomain(d) {\n var _a;\n let { min, max } = this;\n let clipped = false;\n if (typeof min === \"number\") {\n min = new Date(min);\n }\n if (typeof max === \"number\") {\n max = new Date(max);\n }\n if (d.length > 2) {\n d = ((_a = extent(d)) != null ? _a : [0, 1e3]).map((x) => new Date(x));\n }\n if (min instanceof Date) {\n clipped || (clipped = min > d[0]);\n d = [min, d[1]];\n }\n if (max instanceof Date) {\n clipped || (clipped = max < d[1]);\n d = [d[0], max];\n }\n if (d[0] > d[1]) {\n d = [];\n }\n return { domain: d, clipped };\n }\n createTick() {\n return new TimeAxisTick();\n }\n onLabelFormatChange(ticks, domain, format2) {\n if (format2) {\n super.onLabelFormatChange(ticks, domain, format2);\n } else {\n this.labelFormatter = this.scale.tickFormat({ ticks, domain });\n }\n }\n calculatePadding() {\n return [0, 0];\n }\n formatDatum(datum) {\n var _a;\n const formatter = this.scale.tickFormat({\n specifier: \"%m/%d/%y, %H:%M:%S\"\n });\n return (_a = this.moduleCtx.callbackCache.call(formatter, datum)) != null ? _a : String(datum);\n }\n};\nTimeAxis.className = \"TimeAxis\";\nTimeAxis.type = \"time\";\n__decorateClass([\n Validate(AND(DATE_OR_DATETIME_MS, LESS_THAN(\"max\")), { optional: true })\n], TimeAxis.prototype, \"min\", 2);\n__decorateClass([\n Validate(AND(DATE_OR_DATETIME_MS, GREATER_THAN(\"min\")), { optional: true })\n], TimeAxis.prototype, \"max\", 2);\n\n// packages/ag-charts-community/src/scene/shape/rect.ts\nvar epsilon = 1e-6;\nvar cornerEdges = (leadingEdge, trailingEdge, leadingInset, trailingInset, cornerRadius) => {\n let leadingClipped = false;\n let trailingClipped = false;\n let leading0 = trailingInset - Math.sqrt(Math.max(__pow(cornerRadius, 2) - __pow(leadingInset, 2), 0));\n let leading1 = 0;\n let trailing0 = 0;\n let trailing1 = leadingInset - Math.sqrt(Math.max(__pow(cornerRadius, 2) - __pow(trailingInset, 2), 0));\n if (leading0 > leadingEdge) {\n leadingClipped = true;\n leading0 = leadingEdge;\n leading1 = leadingInset - Math.sqrt(Math.max(__pow(cornerRadius, 2) - __pow(trailingInset - leadingEdge, 2)));\n } else if (leading0 < epsilon) {\n leading0 = 0;\n }\n if (trailing1 > trailingEdge) {\n trailingClipped = true;\n trailing0 = trailingInset - Math.sqrt(Math.max(__pow(cornerRadius, 2) - __pow(leadingInset - trailingEdge, 2)));\n trailing1 = trailingEdge;\n } else if (trailing1 < epsilon) {\n trailing1 = 0;\n }\n return { leading0, leading1, trailing0, trailing1, leadingClipped, trailingClipped };\n};\nvar drawCorner = (path, { x0, y0, x1, y1, cx, cy }, cornerRadius, move) => {\n if (move) {\n path.moveTo(x0, y0);\n }\n if (x0 !== x1 || y0 !== y1) {\n const r0 = Math.atan2(y0 - cy, x0 - cx);\n const r1 = Math.atan2(y1 - cy, x1 - cx);\n path.arc(cx, cy, cornerRadius, r0, r1);\n } else {\n path.lineTo(x0, y0);\n }\n};\nvar insetCornerRadiusRect = (path, x, y, width, height, cornerRadii, clipBBox) => {\n let {\n topLeft: topLeftCornerRadius,\n topRight: topRightCornerRadius,\n bottomRight: bottomRightCornerRadius,\n bottomLeft: bottomLeftCornerRadius\n } = cornerRadii;\n const maxVerticalCornerRadius = Math.max(\n topLeftCornerRadius + bottomLeftCornerRadius,\n topRightCornerRadius + bottomRightCornerRadius\n );\n const maxHorizontalCornerRadius = Math.max(\n topLeftCornerRadius + topRightCornerRadius,\n bottomLeftCornerRadius + bottomRightCornerRadius\n );\n if (maxVerticalCornerRadius <= 0 && maxHorizontalCornerRadius <= 0) {\n if (clipBBox == null) {\n path.rect(x, y, width, height);\n } else {\n path.rect(clipBBox.x, clipBBox.y, clipBBox.width, clipBBox.height);\n }\n return;\n } else if (clipBBox == null && topLeftCornerRadius === topRightCornerRadius && topLeftCornerRadius === bottomRightCornerRadius && topLeftCornerRadius === bottomLeftCornerRadius) {\n path.roundRect(x, y, width, height, topLeftCornerRadius);\n return;\n }\n if (width < 0) {\n x += width;\n width = Math.abs(width);\n }\n if (height < 0) {\n y += height;\n height = Math.abs(height);\n }\n if (width <= 0 || height <= 0)\n return;\n if (clipBBox == null) {\n clipBBox = new BBox(x, y, width, height);\n } else {\n const x0 = Math.max(x, clipBBox.x);\n const x1 = Math.min(x + width, clipBBox.x + clipBBox.width);\n const y0 = Math.max(y, clipBBox.y);\n const y1 = Math.min(y + height, clipBBox.y + clipBBox.height);\n clipBBox = new BBox(x0, y0, x1 - x0, y1 - y0);\n }\n const borderScale = Math.max(maxVerticalCornerRadius / height, maxHorizontalCornerRadius / width, 1);\n if (borderScale > 1) {\n topLeftCornerRadius /= borderScale;\n topRightCornerRadius /= borderScale;\n bottomRightCornerRadius /= borderScale;\n bottomLeftCornerRadius /= borderScale;\n }\n let drawTopLeftCorner = true;\n let drawTopRightCorner = true;\n let drawBottomRightCorner = true;\n let drawBottomLeftCorner = true;\n let topLeftCorner;\n let topRightCorner;\n let bottomRightCorner;\n let bottomLeftCorner;\n if (drawTopLeftCorner) {\n const nodes = cornerEdges(\n clipBBox.height,\n clipBBox.width,\n Math.max(x + topLeftCornerRadius - clipBBox.x, 0),\n Math.max(y + topLeftCornerRadius - clipBBox.y, 0),\n topLeftCornerRadius\n );\n if (nodes.leadingClipped)\n drawBottomLeftCorner = false;\n if (nodes.trailingClipped)\n drawTopRightCorner = false;\n const x0 = Math.max(clipBBox.x + nodes.leading1, clipBBox.x);\n const y0 = Math.max(clipBBox.y + nodes.leading0, clipBBox.y);\n const x1 = Math.max(clipBBox.x + nodes.trailing1, clipBBox.x);\n const y1 = Math.max(clipBBox.y + nodes.trailing0, clipBBox.y);\n const cx = x + topLeftCornerRadius;\n const cy = y + topLeftCornerRadius;\n topLeftCorner = { x0, y0, x1, y1, cx, cy };\n }\n if (drawTopRightCorner) {\n const nodes = cornerEdges(\n clipBBox.width,\n clipBBox.height,\n Math.max(y + topRightCornerRadius - clipBBox.y, 0),\n Math.max(clipBBox.x + clipBBox.width - (x + width - topRightCornerRadius), 0),\n topRightCornerRadius\n );\n if (nodes.leadingClipped)\n drawTopLeftCorner = false;\n if (nodes.trailingClipped)\n drawBottomRightCorner = false;\n const x0 = Math.min(clipBBox.x + clipBBox.width - nodes.leading0, clipBBox.x + clipBBox.width);\n const y0 = Math.max(clipBBox.y + nodes.leading1, clipBBox.y);\n const x1 = Math.min(clipBBox.x + clipBBox.width - nodes.trailing0, clipBBox.x + clipBBox.width);\n const y1 = Math.max(clipBBox.y + nodes.trailing1, clipBBox.y);\n const cx = x + width - topRightCornerRadius;\n const cy = y + topRightCornerRadius;\n topRightCorner = { x0, y0, x1, y1, cx, cy };\n }\n if (drawBottomRightCorner) {\n const nodes = cornerEdges(\n clipBBox.height,\n clipBBox.width,\n Math.max(clipBBox.x + clipBBox.width - (x + width - bottomRightCornerRadius), 0),\n Math.max(clipBBox.y + clipBBox.height - (y + height - bottomRightCornerRadius), 0),\n bottomRightCornerRadius\n );\n if (nodes.leadingClipped)\n drawTopRightCorner = false;\n if (nodes.trailingClipped)\n drawBottomLeftCorner = false;\n const x0 = Math.min(clipBBox.x + clipBBox.width - nodes.leading1, clipBBox.x + clipBBox.width);\n const y0 = Math.min(clipBBox.y + clipBBox.height - nodes.leading0, clipBBox.y + clipBBox.height);\n const x1 = Math.min(clipBBox.x + clipBBox.width - nodes.trailing1, clipBBox.x + clipBBox.width);\n const y1 = Math.min(clipBBox.y + clipBBox.height - nodes.trailing0, clipBBox.y + clipBBox.height);\n const cx = x + width - bottomRightCornerRadius;\n const cy = y + height - bottomRightCornerRadius;\n bottomRightCorner = { x0, y0, x1, y1, cx, cy };\n }\n if (drawBottomLeftCorner) {\n const nodes = cornerEdges(\n clipBBox.width,\n clipBBox.height,\n Math.max(clipBBox.y + clipBBox.height - (y + height - bottomLeftCornerRadius), 0),\n Math.max(x + bottomLeftCornerRadius - clipBBox.x, 0),\n bottomLeftCornerRadius\n );\n if (nodes.leadingClipped)\n drawBottomRightCorner = false;\n if (nodes.trailingClipped)\n drawTopLeftCorner = false;\n const x0 = Math.max(clipBBox.x + nodes.leading0, clipBBox.x);\n const y0 = Math.min(clipBBox.y + clipBBox.height - nodes.leading1, clipBBox.y + clipBBox.height);\n const x1 = Math.max(clipBBox.x + nodes.trailing0, clipBBox.x);\n const y1 = Math.min(clipBBox.y + clipBBox.height - nodes.trailing1, clipBBox.y + clipBBox.height);\n const cx = x + bottomLeftCornerRadius;\n const cy = y + height - bottomLeftCornerRadius;\n bottomLeftCorner = { x0, y0, x1, y1, cx, cy };\n }\n let didMove = false;\n if (drawTopLeftCorner && topLeftCorner != null) {\n drawCorner(path, topLeftCorner, topLeftCornerRadius, !didMove);\n didMove || (didMove = true);\n }\n if (drawTopRightCorner && topRightCorner != null) {\n drawCorner(path, topRightCorner, topRightCornerRadius, !didMove);\n didMove || (didMove = true);\n }\n if (drawBottomRightCorner && bottomRightCorner != null) {\n drawCorner(path, bottomRightCorner, bottomRightCornerRadius, !didMove);\n didMove || (didMove = true);\n }\n if (drawBottomLeftCorner && bottomLeftCorner != null) {\n drawCorner(path, bottomLeftCorner, bottomLeftCornerRadius, !didMove);\n didMove || (didMove = true);\n }\n path.closePath();\n};\nvar Rect = class extends Path {\n constructor() {\n super(...arguments);\n this.borderPath = new ExtendedPath2D();\n this.x = 0;\n this.y = 0;\n this.width = 10;\n this.height = 10;\n this.topLeftCornerRadius = 0;\n this.topRightCornerRadius = 0;\n this.bottomRightCornerRadius = 0;\n this.bottomLeftCornerRadius = 0;\n this.clipBBox = void 0;\n this.crisp = false;\n this.lastUpdatePathStrokeWidth = Shape.defaultStyles.strokeWidth;\n this.effectiveStrokeWidth = Shape.defaultStyles.strokeWidth;\n this.hittester = super.isPointInPath;\n this.distanceCalculator = super.distanceSquared;\n /**\n * When the rectangle's width or height is less than a pixel\n * and crisp mode is on, the rectangle will still fit into the pixel,\n * but will be less opaque to make an effect of holding less space.\n */\n this.microPixelEffectOpacity = 1;\n }\n set cornerRadius(cornerRadius) {\n this.topLeftCornerRadius = cornerRadius;\n this.topRightCornerRadius = cornerRadius;\n this.bottomRightCornerRadius = cornerRadius;\n this.bottomLeftCornerRadius = cornerRadius;\n }\n isDirtyPath() {\n return this.lastUpdatePathStrokeWidth !== this.strokeWidth || Boolean(this.path.isDirty() || this.borderPath.isDirty());\n }\n updatePath() {\n var _a, _b, _c;\n const {\n path,\n borderPath,\n crisp,\n topLeftCornerRadius: topLeft,\n topRightCornerRadius: topRight,\n bottomRightCornerRadius: bottomRight,\n bottomLeftCornerRadius: bottomLeft\n } = this;\n let { x, y, width: w, height: h, strokeWidth, clipBBox } = this;\n const pixelRatio = (_b = (_a = this.layerManager) == null ? void 0 : _a.canvas.pixelRatio) != null ? _b : 1;\n const pixelSize = 1 / pixelRatio;\n let microPixelEffectOpacity = 1;\n path.clear(true);\n borderPath.clear(true);\n if (crisp) {\n if (w <= pixelSize) {\n microPixelEffectOpacity *= w / pixelSize;\n }\n if (h <= pixelSize) {\n microPixelEffectOpacity *= h / pixelSize;\n }\n w = this.align(x, w);\n h = this.align(y, h);\n x = this.align(x);\n y = this.align(y);\n clipBBox = clipBBox != null ? new BBox(\n this.align(clipBBox.x),\n this.align(clipBBox.y),\n this.align(clipBBox.x, clipBBox.width),\n this.align(clipBBox.y, clipBBox.height)\n ) : void 0;\n }\n if (strokeWidth) {\n if (w < pixelSize) {\n const lx = x + pixelSize / 2;\n borderPath.moveTo(lx, y);\n borderPath.lineTo(lx, y + h);\n strokeWidth = pixelSize;\n this.borderClipPath = void 0;\n } else if (h < pixelSize) {\n const ly = y + pixelSize / 2;\n borderPath.moveTo(x, ly);\n borderPath.lineTo(x + w, ly);\n strokeWidth = pixelSize;\n this.borderClipPath = void 0;\n } else if (strokeWidth < w && strokeWidth < h) {\n const halfStrokeWidth = strokeWidth / 2;\n x += halfStrokeWidth;\n y += halfStrokeWidth;\n w -= strokeWidth;\n h -= strokeWidth;\n const adjustedClipBBox = clipBBox == null ? void 0 : clipBBox.clone().shrink(halfStrokeWidth);\n const cornerRadii = {\n topLeft: topLeft > 0 ? topLeft - strokeWidth : 0,\n topRight: topRight > 0 ? topRight - strokeWidth : 0,\n bottomRight: bottomRight > 0 ? bottomRight - strokeWidth : 0,\n bottomLeft: bottomLeft > 0 ? bottomLeft - strokeWidth : 0\n };\n this.borderClipPath = void 0;\n if (w > 0 && h > 0 && (adjustedClipBBox == null || (adjustedClipBBox == null ? void 0 : adjustedClipBBox.width) > 0 && (adjustedClipBBox == null ? void 0 : adjustedClipBBox.height) > 0)) {\n insetCornerRadiusRect(path, x, y, w, h, cornerRadii, adjustedClipBBox);\n insetCornerRadiusRect(borderPath, x, y, w, h, cornerRadii, adjustedClipBBox);\n }\n } else {\n this.borderClipPath = (_c = this.borderClipPath) != null ? _c : new ExtendedPath2D();\n this.borderClipPath.clear(true);\n this.borderClipPath.rect(x, y, w, h);\n borderPath.rect(x, y, w, h);\n }\n } else {\n const cornerRadii = { topLeft, topRight, bottomRight, bottomLeft };\n this.borderClipPath = void 0;\n insetCornerRadiusRect(path, x, y, w, h, cornerRadii, clipBBox);\n }\n if ([topLeft, topRight, bottomRight, bottomLeft].every((r) => r === 0)) {\n this.hittester = (hitX, hitY) => {\n const point = this.transformPoint(hitX, hitY);\n return this.getCachedBBox().containsPoint(point.x, point.y);\n };\n this.distanceSquared = (hitX, hitY) => this.getCachedBBox().distanceSquared(hitX, hitY);\n } else {\n this.hittester = super.isPointInPath;\n this.distanceCalculator = super.distanceSquared;\n }\n this.effectiveStrokeWidth = strokeWidth;\n this.lastUpdatePathStrokeWidth = strokeWidth;\n this.microPixelEffectOpacity = microPixelEffectOpacity;\n }\n computeBBox() {\n var _a;\n const { x, y, width, height, clipBBox } = this;\n return (_a = clipBBox == null ? void 0 : clipBBox.clone()) != null ? _a : new BBox(x, y, width, height);\n }\n isPointInPath(x, y) {\n return this.hittester(x, y);\n }\n get midPoint() {\n return { x: this.x + this.width / 2, y: this.y + this.height / 2 };\n }\n distanceSquared(x, y) {\n return this.distanceCalculator(x, y);\n }\n applyFillAlpha(ctx) {\n const { fillOpacity, microPixelEffectOpacity, opacity } = this;\n ctx.globalAlpha *= opacity * fillOpacity * microPixelEffectOpacity;\n }\n renderStroke(ctx) {\n const { stroke, effectiveStrokeWidth } = this;\n if (stroke && effectiveStrokeWidth) {\n const { globalAlpha } = ctx;\n const {\n strokeOpacity,\n lineDash,\n lineDashOffset,\n lineCap,\n lineJoin,\n borderPath,\n borderClipPath,\n opacity,\n microPixelEffectOpacity\n } = this;\n if (borderClipPath) {\n ctx.clip(borderClipPath.getPath2D());\n }\n ctx.strokeStyle = stroke;\n ctx.globalAlpha *= opacity * strokeOpacity * microPixelEffectOpacity;\n ctx.lineWidth = effectiveStrokeWidth;\n if (lineDash) {\n ctx.setLineDash(lineDash);\n }\n if (lineDashOffset) {\n ctx.lineDashOffset = lineDashOffset;\n }\n if (lineCap) {\n ctx.lineCap = lineCap;\n }\n if (lineJoin) {\n ctx.lineJoin = lineJoin;\n }\n ctx.stroke(borderPath.getPath2D());\n ctx.globalAlpha = globalAlpha;\n }\n }\n};\nRect.className = \"Rect\";\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"x\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"y\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"width\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"height\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"topLeftCornerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"topRightCornerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"bottomRightCornerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"bottomLeftCornerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"clipBBox\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Rect.prototype, \"crisp\", 2);\n\n// packages/ag-charts-community/src/chart/background/background.ts\nvar Background = class extends BaseModuleInstance {\n constructor(ctx) {\n super();\n this.node = new Group({ name: \"background\", zIndex: 0 /* SERIES_BACKGROUND_ZINDEX */ });\n this.rectNode = new Rect();\n this.visible = true;\n this.fill = \"white\";\n this.node.appendChild(this.rectNode);\n this.destroyFns.push(\n ctx.scene.attachNode(this.node),\n ctx.layoutService.addListener(\"layout-complete\", (e) => this.onLayoutComplete(e))\n );\n }\n onLayoutComplete(e) {\n const { width, height } = e.chart;\n this.rectNode.width = width;\n this.rectNode.height = height;\n }\n};\n__decorateClass([\n Validate(BOOLEAN),\n ProxyPropertyOnWrite(\"node\", \"visible\")\n], Background.prototype, \"visible\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true }),\n ProxyPropertyOnWrite(\"rectNode\", \"fill\")\n], Background.prototype, \"fill\", 2);\n__decorateClass([\n Validate(OBJECT, { optional: true })\n], Background.prototype, \"image\", 2);\n\n// packages/ag-charts-community/src/chart/background/backgroundModule.ts\nvar BackgroundModule = {\n type: \"root\",\n optionsKey: \"background\",\n packageType: \"community\",\n chartTypes: [\"cartesian\", \"polar\", \"hierarchy\", \"topology\"],\n instanceConstructor: Background\n};\n\n// packages/ag-charts-community/src/chart/gridLayout.ts\nfunction gridLayout({\n orientation,\n bboxes,\n maxHeight,\n maxWidth,\n itemPaddingY = 0,\n itemPaddingX = 0,\n forceResult = false\n}) {\n const horizontal = orientation === \"horizontal\";\n const primary = {\n max: horizontal ? maxWidth : maxHeight,\n fn: horizontal ? (b) => b.width : (b) => b.height,\n padding: horizontal ? itemPaddingX : itemPaddingY\n };\n const secondary = {\n max: horizontal ? maxHeight : maxWidth,\n fn: horizontal ? (b) => b.height : (b) => b.width,\n padding: horizontal ? itemPaddingY : itemPaddingX\n };\n let processedBBoxCount = 0;\n const rawPages = [];\n while (processedBBoxCount < bboxes.length) {\n const unprocessedBBoxes = bboxes.slice(processedBBoxCount);\n const result = processBBoxes(unprocessedBBoxes, processedBBoxCount, primary, secondary, forceResult);\n if (!result) {\n return;\n }\n processedBBoxCount += result.processedBBoxCount;\n rawPages.push(result.pageIndices);\n }\n return buildPages(rawPages, orientation, bboxes, itemPaddingY, itemPaddingX);\n}\nfunction processBBoxes(bboxes, indexOffset, primary, secondary, forceResult) {\n const minGuess = 1;\n let startingGuess = estimateStartingGuess(bboxes, primary);\n if (startingGuess < minGuess) {\n if (!forceResult) {\n return;\n }\n startingGuess = minGuess;\n }\n let guess = startingGuess;\n while (guess >= minGuess) {\n const pageIndices = calculatePage(bboxes, indexOffset, guess, primary, secondary, forceResult);\n if (pageIndices == null && guess <= minGuess) {\n return;\n }\n if (pageIndices == null) {\n guess--;\n continue;\n }\n if (typeof pageIndices === \"number\") {\n if (pageIndices <= minGuess) {\n return;\n }\n guess = pageIndices < guess && pageIndices > minGuess ? pageIndices : guess;\n guess--;\n continue;\n }\n const processedBBoxCount = pageIndices.length * pageIndices[0].length;\n return { processedBBoxCount, pageIndices };\n }\n}\nfunction calculatePage(bboxes, indexOffset, primaryCount, primary, secondary, forceResult) {\n var _a;\n const result = [];\n let sumSecondary = 0;\n let currentMaxSecondary = 0;\n let currentPrimaryIndices = [];\n const maxPrimaryValues = [];\n for (let bboxIndex = 0; bboxIndex < bboxes.length; bboxIndex++) {\n const primaryValueIdx = (bboxIndex + primaryCount) % primaryCount;\n if (primaryValueIdx === 0) {\n sumSecondary += currentMaxSecondary;\n currentMaxSecondary = 0;\n if (currentPrimaryIndices.length > 0) {\n result.push(currentPrimaryIndices);\n }\n currentPrimaryIndices = [];\n }\n const primaryValue = primary.fn(bboxes[bboxIndex]) + primary.padding;\n maxPrimaryValues[primaryValueIdx] = Math.max((_a = maxPrimaryValues[primaryValueIdx]) != null ? _a : 0, primaryValue);\n currentMaxSecondary = Math.max(currentMaxSecondary, secondary.fn(bboxes[bboxIndex]) + secondary.padding);\n const currentSecondaryDimension = sumSecondary + currentMaxSecondary;\n const returnResult = !forceResult || result.length > 0;\n if (currentSecondaryDimension > secondary.max && returnResult) {\n currentPrimaryIndices = [];\n break;\n }\n const sumPrimary = maxPrimaryValues.reduce((sum2, next) => sum2 + next, 0);\n if (sumPrimary > primary.max && !forceResult) {\n if (maxPrimaryValues.length < primaryCount) {\n return maxPrimaryValues.length;\n }\n return;\n }\n currentPrimaryIndices.push(bboxIndex + indexOffset);\n }\n if (currentPrimaryIndices.length > 0) {\n result.push(currentPrimaryIndices);\n }\n return result.length > 0 ? result : void 0;\n}\nfunction buildPages(rawPages, orientation, bboxes, itemPaddingY, itemPaddingX) {\n let maxPageWidth = 0;\n let maxPageHeight = 0;\n const pages = rawPages.map((indices) => {\n if (orientation === \"horizontal\") {\n indices = transpose(indices);\n }\n let endIndex = 0;\n const columns = indices.map((colIndices) => {\n const colBBoxes = colIndices.map((bboxIndex) => {\n endIndex = Math.max(bboxIndex, endIndex);\n return bboxes[bboxIndex];\n });\n let columnHeight = 0;\n let columnWidth = 0;\n colBBoxes.forEach((bbox) => {\n columnHeight += bbox.height + itemPaddingY;\n columnWidth = Math.max(columnWidth, bbox.width + itemPaddingX);\n });\n return {\n indices: colIndices,\n bboxes: colBBoxes,\n columnHeight: Math.ceil(columnHeight),\n columnWidth: Math.ceil(columnWidth)\n };\n });\n let pageWidth = 0;\n let pageHeight = 0;\n columns.forEach((column) => {\n pageWidth += column.columnWidth;\n pageHeight = Math.max(pageHeight, column.columnHeight);\n });\n maxPageWidth = Math.max(pageWidth, maxPageWidth);\n maxPageHeight = Math.max(pageHeight, maxPageHeight);\n return {\n columns,\n startIndex: indices[0][0],\n endIndex,\n pageWidth,\n pageHeight\n };\n });\n return { pages, maxPageWidth, maxPageHeight };\n}\nfunction transpose(data) {\n const result = [];\n for (const _ of data[0]) {\n result.push([]);\n }\n data.forEach((innerData, dataIdx) => {\n innerData.forEach((item, itemIdx) => {\n result[itemIdx][dataIdx] = item;\n });\n });\n return result;\n}\nfunction estimateStartingGuess(bboxes, primary) {\n const n = bboxes.length;\n let primarySum = 0;\n for (let bboxIndex = 0; bboxIndex < n; bboxIndex++) {\n primarySum += primary.fn(bboxes[bboxIndex]) + primary.padding;\n if (primarySum > primary.max) {\n const ratio = n / bboxIndex;\n if (ratio < 2) {\n return Math.ceil(n / 2);\n }\n return bboxIndex;\n }\n }\n return n;\n}\n\n// packages/ag-charts-community/src/chart/markerLabel.ts\nvar MarkerLabel = class extends Group {\n constructor() {\n super({ name: \"markerLabelGroup\" });\n this.label = new Text();\n this.line = new Line();\n this._marker = new Square();\n this._markerSize = 15;\n this._spacing = 8;\n const { marker, label, line } = this;\n label.textBaseline = \"middle\";\n label.fontSize = 12;\n label.fontFamily = \"Verdana, sans-serif\";\n label.fill = \"black\";\n label.y = 1;\n this.append([line, marker, label]);\n this.update();\n }\n set marker(value) {\n if (this._marker !== value) {\n this.removeChild(this._marker);\n this._marker = value;\n this.appendChild(value);\n this.update();\n }\n }\n get marker() {\n return this._marker;\n }\n set markerSize(value) {\n if (this._markerSize !== value) {\n this._markerSize = value;\n this.update();\n }\n }\n get markerSize() {\n return this._markerSize;\n }\n set spacing(value) {\n if (this._spacing !== value) {\n this._spacing = value;\n this.update();\n }\n }\n get spacing() {\n return this._spacing;\n }\n setSeriesStrokeOffset(xOff) {\n const offset4 = this.marker.size / 2 + xOff;\n this.line.x1 = -offset4;\n this.line.x2 = offset4;\n this.line.y1 = 0;\n this.line.y2 = 0;\n this.line.markDirtyTransform();\n this.update();\n }\n update() {\n const { markerSize } = this;\n const center = this.marker.constructor.center;\n this.marker.size = markerSize;\n this.marker.x = (center.x - 0.5) * markerSize;\n this.marker.y = (center.y - 0.5) * markerSize;\n const lineEnd = this.line.visible ? this.line.x2 : -Infinity;\n const markerEnd = markerSize / 2;\n this.label.x = Math.max(lineEnd, markerEnd) + this.spacing;\n }\n render(renderCtx) {\n this.marker.opacity = this.opacity;\n this.label.opacity = this.opacity;\n this.line.opacity = this.opacity;\n super.render(renderCtx);\n }\n};\nMarkerLabel.className = \"MarkerLabel\";\n__decorateClass([\n ProxyPropertyOnWrite(\"label\")\n], MarkerLabel.prototype, \"text\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"label\")\n], MarkerLabel.prototype, \"fontStyle\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"label\")\n], MarkerLabel.prototype, \"fontWeight\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"label\")\n], MarkerLabel.prototype, \"fontSize\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"label\")\n], MarkerLabel.prototype, \"fontFamily\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"label\", \"fill\")\n], MarkerLabel.prototype, \"color\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"marker\", \"fill\")\n], MarkerLabel.prototype, \"markerFill\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"marker\", \"stroke\")\n], MarkerLabel.prototype, \"markerStroke\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"marker\", \"strokeWidth\")\n], MarkerLabel.prototype, \"markerStrokeWidth\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"marker\", \"fillOpacity\")\n], MarkerLabel.prototype, \"markerFillOpacity\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"marker\", \"strokeOpacity\")\n], MarkerLabel.prototype, \"markerStrokeOpacity\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"marker\", \"visible\")\n], MarkerLabel.prototype, \"markerVisible\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"line\", \"stroke\")\n], MarkerLabel.prototype, \"lineStroke\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"line\", \"strokeWidth\")\n], MarkerLabel.prototype, \"lineStrokeWidth\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"line\", \"strokeOpacity\")\n], MarkerLabel.prototype, \"lineStrokeOpacity\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"line\", \"lineDash\")\n], MarkerLabel.prototype, \"lineLineDash\", 2);\n__decorateClass([\n ProxyPropertyOnWrite(\"line\", \"visible\")\n], MarkerLabel.prototype, \"lineVisible\", 2);\n\n// packages/ag-charts-community/src/chart/pagination/pagination.ts\nvar PaginationLabel = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.color = \"black\";\n this.fontStyle = void 0;\n this.fontWeight = void 0;\n this.fontSize = 12;\n this.fontFamily = \"Verdana, sans-serif\";\n }\n};\n__decorateClass([\n Validate(COLOR_STRING)\n], PaginationLabel.prototype, \"color\", 2);\n__decorateClass([\n Validate(FONT_STYLE, { optional: true })\n], PaginationLabel.prototype, \"fontStyle\", 2);\n__decorateClass([\n Validate(FONT_WEIGHT2, { optional: true })\n], PaginationLabel.prototype, \"fontWeight\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PaginationLabel.prototype, \"fontSize\", 2);\n__decorateClass([\n Validate(STRING)\n], PaginationLabel.prototype, \"fontFamily\", 2);\nvar PaginationMarkerStyle = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.size = 15;\n this.fill = void 0;\n this.fillOpacity = void 0;\n this.stroke = void 0;\n this.strokeWidth = 1;\n this.strokeOpacity = 1;\n }\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PaginationMarkerStyle.prototype, \"size\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], PaginationMarkerStyle.prototype, \"fill\", 2);\n__decorateClass([\n Validate(RATIO, { optional: true })\n], PaginationMarkerStyle.prototype, \"fillOpacity\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], PaginationMarkerStyle.prototype, \"stroke\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PaginationMarkerStyle.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(RATIO)\n], PaginationMarkerStyle.prototype, \"strokeOpacity\", 2);\nvar PaginationMarker = class extends BaseProperties {\n constructor(parent) {\n super();\n this.parent = parent;\n this.shape = Triangle;\n this.size = 15;\n this.padding = 8;\n }\n};\n__decorateClass([\n ActionOnSet({\n changeValue() {\n if (this.parent.marker === this) {\n this.parent.onMarkerShapeChange();\n }\n }\n })\n], PaginationMarker.prototype, \"shape\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PaginationMarker.prototype, \"size\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PaginationMarker.prototype, \"padding\", 2);\nvar Pagination = class extends BaseProperties {\n constructor(chartUpdateCallback, pageUpdateCallback, regionManager, cursorManager) {\n super();\n this.chartUpdateCallback = chartUpdateCallback;\n this.pageUpdateCallback = pageUpdateCallback;\n this.regionManager = regionManager;\n this.cursorManager = cursorManager;\n this.id = createId(this);\n this.marker = new PaginationMarker(this);\n this.activeStyle = new PaginationMarkerStyle();\n this.inactiveStyle = new PaginationMarkerStyle();\n this.highlightStyle = new PaginationMarkerStyle();\n this.label = new PaginationLabel();\n this.group = new Group({ name: \"pagination\" });\n this.labelNode = new Text();\n this.destroyFns = [];\n this.totalPages = 0;\n this.currentPage = 0;\n this.translationX = 0;\n this.translationY = 0;\n this.nextButtonDisabled = false;\n this.previousButtonDisabled = false;\n this._visible = true;\n this._enabled = true;\n this._orientation = \"vertical\";\n this._nextButton = new Triangle();\n this._previousButton = new Triangle();\n this.labelNode.setProperties({\n textBaseline: \"middle\",\n fontSize: 12,\n fontFamily: \"Verdana, sans-serif\",\n fill: \"black\",\n y: 1\n });\n this.group.append([this.nextButton, this.previousButton, this.labelNode]);\n const region = this.regionManager.addRegion(\"pagination\", this.group);\n this.destroyFns.push(\n region.addListener(\"click\", (event) => this.onPaginationClick(event)),\n region.addListener(\"hover\", (event) => this.onPaginationMouseMove(event))\n );\n this.update();\n this.updateMarkers();\n }\n destroy() {\n this.destroyFns.forEach((f) => f());\n }\n set visible(value) {\n this._visible = value;\n this.updateGroupVisibility();\n }\n get visible() {\n return this._visible;\n }\n set enabled(value) {\n this._enabled = value;\n this.updateGroupVisibility();\n }\n get enabled() {\n return this._enabled;\n }\n updateGroupVisibility() {\n this.group.visible = this.enabled && this.visible;\n }\n set orientation(value) {\n this._orientation = value;\n switch (value) {\n case \"horizontal\": {\n this.previousButton.rotation = -Math.PI / 2;\n this.nextButton.rotation = Math.PI / 2;\n break;\n }\n case \"vertical\":\n default: {\n this.previousButton.rotation = 0;\n this.nextButton.rotation = Math.PI;\n }\n }\n }\n get orientation() {\n return this._orientation;\n }\n set nextButton(value) {\n if (this._nextButton !== value) {\n this.group.removeChild(this._nextButton);\n this._nextButton = value;\n this.group.appendChild(value);\n }\n }\n get nextButton() {\n return this._nextButton;\n }\n set previousButton(value) {\n if (this._previousButton !== value) {\n this.group.removeChild(this._previousButton);\n this._previousButton = value;\n this.group.appendChild(value);\n }\n }\n get previousButton() {\n return this._previousButton;\n }\n update() {\n this.updateLabel();\n this.updatePositions();\n this.enableOrDisableButtons();\n }\n updatePositions() {\n this.group.translationX = this.translationX;\n this.group.translationY = this.translationY;\n this.updateLabelPosition();\n this.updateNextButtonPosition();\n }\n updateLabelPosition() {\n const { size: markerSize, padding: markerPadding } = this.marker;\n this.nextButton.size = markerSize;\n this.previousButton.size = markerSize;\n this.labelNode.x = markerSize / 2 + markerPadding;\n }\n updateNextButtonPosition() {\n const labelBBox = this.labelNode.computeBBox();\n this.nextButton.translationX = labelBBox.x + labelBBox.width + this.marker.size / 2 + this.marker.padding;\n }\n updateLabel() {\n const {\n currentPage,\n totalPages: pages,\n labelNode,\n label: { color, fontStyle, fontWeight, fontSize, fontFamily }\n } = this;\n labelNode.text = `${currentPage + 1} / ${pages}`;\n labelNode.fill = color;\n labelNode.fontStyle = fontStyle;\n labelNode.fontWeight = fontWeight;\n labelNode.fontSize = fontSize;\n labelNode.fontFamily = fontFamily;\n }\n updateMarkers() {\n const {\n nextButton,\n previousButton,\n nextButtonDisabled,\n previousButtonDisabled,\n activeStyle,\n inactiveStyle,\n highlightStyle,\n highlightActive\n } = this;\n const buttonStyle = (button, disabled) => {\n if (disabled) {\n return inactiveStyle;\n } else if (button === highlightActive) {\n return highlightStyle;\n }\n return activeStyle;\n };\n this.updateMarker(nextButton, buttonStyle(\"next\", nextButtonDisabled));\n this.updateMarker(previousButton, buttonStyle(\"previous\", previousButtonDisabled));\n }\n updateMarker(marker, style) {\n var _a;\n const { size } = this.marker;\n marker.size = size;\n marker.fill = style.fill;\n marker.fillOpacity = (_a = style.fillOpacity) != null ? _a : 1;\n marker.stroke = style.stroke;\n marker.strokeWidth = style.strokeWidth;\n marker.strokeOpacity = style.strokeOpacity;\n }\n enableOrDisableButtons() {\n const { currentPage, totalPages } = this;\n const zeroPagesToDisplay = totalPages === 0;\n const onLastPage = currentPage === totalPages - 1;\n const onFirstPage = currentPage === 0;\n this.nextButtonDisabled = onLastPage || zeroPagesToDisplay;\n this.previousButtonDisabled = onFirstPage || zeroPagesToDisplay;\n }\n nextButtonContainsPoint(offsetX, offsetY) {\n return !this.nextButtonDisabled && this.nextButton.containsPoint(offsetX, offsetY);\n }\n previousButtonContainsPoint(offsetX, offsetY) {\n return !this.previousButtonDisabled && this.previousButton.containsPoint(offsetX, offsetY);\n }\n clickNext() {\n this.incrementPage();\n this.onPaginationChanged();\n }\n clickPrevious() {\n this.decrementPage();\n this.onPaginationChanged();\n }\n setPage(pageNumber) {\n pageNumber = clamp(0, pageNumber, this.totalPages - 1);\n if (this.currentPage !== pageNumber) {\n this.currentPage = pageNumber;\n this.onPaginationChanged();\n }\n }\n onPaginationClick(event) {\n const { offsetX, offsetY } = event;\n if (this.nextButtonContainsPoint(offsetX, offsetY)) {\n this.clickNext();\n event.consume();\n } else if (this.previousButtonContainsPoint(offsetX, offsetY)) {\n this.clickPrevious();\n event.consume();\n }\n }\n onPaginationMouseMove(event) {\n const { offsetX, offsetY } = event;\n if (this.nextButtonContainsPoint(offsetX, offsetY)) {\n this.cursorManager.updateCursor(this.id, \"pointer\");\n this.highlightActive = \"next\";\n } else if (this.previousButtonContainsPoint(offsetX, offsetY)) {\n this.cursorManager.updateCursor(this.id, \"pointer\");\n this.highlightActive = \"previous\";\n } else {\n this.cursorManager.updateCursor(this.id);\n this.highlightActive = void 0;\n }\n this.updateMarkers();\n this.chartUpdateCallback(6 /* SCENE_RENDER */);\n }\n onPaginationChanged() {\n this.pageUpdateCallback(this.currentPage);\n }\n incrementPage() {\n this.currentPage = Math.min(this.currentPage + 1, this.totalPages - 1);\n }\n decrementPage() {\n this.currentPage = Math.max(this.currentPage - 1, 0);\n }\n onMarkerShapeChange() {\n const Marker2 = getMarker(this.marker.shape || Triangle);\n this.previousButton = new Marker2();\n this.nextButton = new Marker2();\n this.updatePositions();\n this.updateMarkers();\n this.chartUpdateCallback(6 /* SCENE_RENDER */);\n }\n attachPagination(node) {\n node.append(this.group);\n }\n computeBBox() {\n return this.group.computeBBox();\n }\n};\nPagination.className = \"Pagination\";\n__decorateClass([\n Validate(OBJECT)\n], Pagination.prototype, \"marker\", 2);\n__decorateClass([\n Validate(OBJECT)\n], Pagination.prototype, \"activeStyle\", 2);\n__decorateClass([\n Validate(OBJECT)\n], Pagination.prototype, \"inactiveStyle\", 2);\n__decorateClass([\n Validate(OBJECT)\n], Pagination.prototype, \"highlightStyle\", 2);\n__decorateClass([\n Validate(OBJECT)\n], Pagination.prototype, \"label\", 2);\n\n// packages/ag-charts-community/src/chart/legend.ts\nvar LegendLabel = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.maxLength = void 0;\n this.color = \"black\";\n this.fontStyle = void 0;\n this.fontWeight = void 0;\n this.fontSize = 12;\n this.fontFamily = \"Verdana, sans-serif\";\n this.formatter = void 0;\n }\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], LegendLabel.prototype, \"maxLength\", 2);\n__decorateClass([\n Validate(COLOR_STRING)\n], LegendLabel.prototype, \"color\", 2);\n__decorateClass([\n Validate(FONT_STYLE, { optional: true })\n], LegendLabel.prototype, \"fontStyle\", 2);\n__decorateClass([\n Validate(FONT_WEIGHT2, { optional: true })\n], LegendLabel.prototype, \"fontWeight\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], LegendLabel.prototype, \"fontSize\", 2);\n__decorateClass([\n Validate(STRING)\n], LegendLabel.prototype, \"fontFamily\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], LegendLabel.prototype, \"formatter\", 2);\nvar LegendMarker = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.size = 15;\n this.padding = 8;\n this.enabled = true;\n }\n};\n__decorateClass([\n ObserveChanges((target) => {\n var _a;\n return (_a = target.parent) == null ? void 0 : _a.onMarkerShapeChange();\n })\n], LegendMarker.prototype, \"shape\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], LegendMarker.prototype, \"size\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], LegendMarker.prototype, \"padding\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], LegendMarker.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], LegendMarker.prototype, \"enabled\", 2);\nvar LegendLine = class extends BaseProperties {\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], LegendLine.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], LegendLine.prototype, \"length\", 2);\nvar LegendItem = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.paddingX = 16;\n this.paddingY = 8;\n this.toggleSeriesVisible = true;\n this.showSeriesStroke = false;\n this.marker = new LegendMarker();\n this.label = new LegendLabel();\n this.line = new LegendLine();\n }\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], LegendItem.prototype, \"maxWidth\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], LegendItem.prototype, \"paddingX\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], LegendItem.prototype, \"paddingY\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], LegendItem.prototype, \"toggleSeriesVisible\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], LegendItem.prototype, \"showSeriesStroke\", 2);\n__decorateClass([\n Validate(OBJECT)\n], LegendItem.prototype, \"marker\", 2);\n__decorateClass([\n Validate(OBJECT)\n], LegendItem.prototype, \"label\", 2);\n__decorateClass([\n Validate(OBJECT)\n], LegendItem.prototype, \"line\", 2);\nvar LegendListeners = class extends BaseProperties {\n};\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], LegendListeners.prototype, \"legendItemClick\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], LegendListeners.prototype, \"legendItemDoubleClick\", 2);\nvar Legend = class extends BaseProperties {\n constructor(ctx) {\n super();\n this.ctx = ctx;\n this.id = createId(this);\n this.group = new Group({ name: \"legend\", layer: true, zIndex: 11 /* LEGEND_ZINDEX */ });\n this.itemSelection = Selection.select(this.group, MarkerLabel);\n this.oldSize = [0, 0];\n this.pages = [];\n this.maxPageSize = [0, 0];\n /** Item index to track on re-pagination, so current page updates appropriately. */\n this.paginationTrackingIndex = 0;\n this.truncatedItems = /* @__PURE__ */ new Set();\n this._data = [];\n this.item = new LegendItem();\n this.listeners = new LegendListeners();\n this.enabled = true;\n this.position = \"bottom\";\n this.spacing = 20;\n this.characterWidths = /* @__PURE__ */ new Map();\n this.destroyFns = [];\n this.size = [0, 0];\n this._visible = true;\n this.focus = { mode: \"item\", index: 0 };\n this.item.marker.parent = this;\n this.pagination = new Pagination(\n (type) => ctx.updateService.update(type),\n (page) => this.updatePageNumber(page),\n ctx.regionManager,\n ctx.cursorManager\n );\n this.pagination.attachPagination(this.group);\n this.item.marker.parent = this;\n const animationState = 16 /* Default */ | 1 /* Animation */;\n const region = ctx.regionManager.addRegionFromProperties({\n name: \"legend\",\n bboxproviders: [this.group],\n canInteraction: () => this.enabled && this.group.visible\n });\n this.destroyFns.push(\n region.addListener(\"click\", (e) => this.checkLegendClick(e), animationState),\n region.addListener(\"dblclick\", (e) => this.checkLegendDoubleClick(e), animationState),\n region.addListener(\"hover\", (e) => this.handleLegendMouseMove(e)),\n region.addListener(\"leave\", (e) => this.handleLegendMouseExit(e), animationState),\n region.addListener(\"enter\", (e) => this.handleLegendMouseEnter(e), animationState),\n region.addListener(\"blur\", (e) => this.onBlur(e)),\n region.addListener(\"tab\", (e) => this.onTab(e)),\n region.addListener(\"tab-start\", (e) => this.onTabStart(e)),\n region.addListener(\"nav-vert\", (e) => this.onNav(e)),\n region.addListener(\"nav-hori\", (e) => this.onNav(e)),\n region.addListener(\"submit\", (e) => this.onSubmit(e)),\n ctx.layoutService.addListener(\"start-layout\", (e) => this.positionLegend(e.shrinkRect)),\n () => this.detachLegend()\n );\n }\n set data(value) {\n this._data = value;\n this.updateGroupVisibility();\n }\n get data() {\n return this._data;\n }\n destroy() {\n this.destroyFns.forEach((f) => f());\n this.pagination.destroy();\n }\n onMarkerShapeChange() {\n this.itemSelection.clear();\n this.group.markDirty(this.group, 2 /* MINOR */);\n }\n getOrientation() {\n if (this.orientation !== void 0) {\n return this.orientation;\n }\n switch (this.position) {\n case \"right\":\n case \"left\":\n return \"vertical\";\n case \"bottom\":\n case \"top\":\n return \"horizontal\";\n }\n }\n getCharacterWidths(font) {\n const { characterWidths } = this;\n if (characterWidths.has(font)) {\n return characterWidths.get(font);\n }\n const cw = {\n \"...\": Text.getTextSize(\"...\", font).width\n };\n characterWidths.set(font, cw);\n return cw;\n }\n set visible(value) {\n this._visible = value;\n this.updateGroupVisibility();\n }\n get visible() {\n return this._visible;\n }\n updateGroupVisibility() {\n this.group.visible = this.enabled && this.visible && this.data.length > 0;\n }\n attachLegend(scene) {\n scene.appendChild(this.group);\n }\n detachLegend() {\n var _a;\n (_a = this.group.parent) == null ? void 0 : _a.removeChild(this.group);\n }\n getItemLabel(datum) {\n const {\n ctx: { callbackCache }\n } = this;\n const { formatter } = this.item.label;\n if (formatter) {\n return callbackCache.call(formatter, {\n itemId: datum.itemId,\n value: datum.label.text,\n seriesId: datum.seriesId\n });\n }\n return datum.label.text;\n }\n /**\n * The method is given the desired size of the legend, which only serves as a hint.\n * The vertically oriented legend will take as much horizontal space as needed, but will\n * respect the height constraints, and the horizontal legend will take as much vertical\n * space as needed in an attempt not to exceed the given width.\n * After the layout is done, the {@link size} will contain the actual size of the legend.\n * If the actual size is not the same as the previous actual size, the legend will fire\n * the 'layoutChange' event to communicate that another layout is needed, and the above\n * process should be repeated.\n * @param width\n * @param height\n */\n calcLayout(width, height) {\n const {\n paddingX,\n paddingY,\n label,\n maxWidth,\n marker: { size: markerSize, padding: markerPadding, shape: markerShape },\n label: { maxLength = Infinity, fontStyle, fontWeight, fontSize, fontFamily },\n line: itemLine,\n showSeriesStroke\n } = this.item;\n const data = [...this.data];\n if (this.reverseOrder) {\n data.reverse();\n }\n this.itemSelection.update(data);\n const bboxes = [];\n const font = getFont(label);\n const itemMaxWidthPercentage = 0.8;\n const maxItemWidth = maxWidth != null ? maxWidth : width * itemMaxWidthPercentage;\n const paddedMarkerWidth = markerSize + markerPadding + paddingX;\n this.itemSelection.each((markerLabel, datum) => {\n var _a, _b, _c;\n const Marker2 = getMarker(markerShape != null ? markerShape : datum.marker.shape);\n const markerEnabled = (_a = datum.marker.enabled) != null ? _a : this.item.marker.enabled;\n if (!(markerLabel.marker && markerLabel.marker instanceof Marker2)) {\n markerLabel.marker = new Marker2();\n }\n markerLabel.markerSize = markerSize;\n markerLabel.spacing = markerPadding;\n markerLabel.fontStyle = fontStyle;\n markerLabel.fontWeight = fontWeight;\n markerLabel.fontSize = fontSize;\n markerLabel.fontFamily = fontFamily;\n const id = (_b = datum.itemId) != null ? _b : datum.id;\n const labelText = this.getItemLabel(datum);\n const text = (labelText != null ? labelText : \"\").replace(/\\r?\\n/g, \" \");\n markerLabel.text = this.truncate(text, maxLength, maxItemWidth, paddedMarkerWidth, font, id);\n if (showSeriesStroke && datum.line !== void 0) {\n markerLabel.lineVisible = true;\n markerLabel.markerVisible = markerEnabled;\n markerLabel.setSeriesStrokeOffset((_c = itemLine.length) != null ? _c : 5);\n } else {\n markerLabel.lineVisible = false;\n markerLabel.markerVisible = true;\n }\n bboxes.push(markerLabel.computeBBox());\n });\n width = Math.max(1, width);\n height = Math.max(1, height);\n if (!isFinite(width)) {\n return false;\n }\n const size = this.size;\n const oldSize = this.oldSize;\n size[0] = width;\n size[1] = height;\n if (size[0] !== oldSize[0] || size[1] !== oldSize[1]) {\n oldSize[0] = size[0];\n oldSize[1] = size[1];\n }\n const { pages, maxPageHeight, maxPageWidth } = this.updatePagination(bboxes, width, height);\n this.pages = pages;\n this.maxPageSize = [maxPageWidth - paddingX, maxPageHeight - paddingY];\n const pageNumber = this.pagination.currentPage;\n const page = this.pages[pageNumber];\n if (this.pages.length < 1 || !page) {\n this.visible = false;\n return;\n }\n this.visible = true;\n this.updatePositions(pageNumber);\n this.update();\n }\n truncate(text, maxCharLength, maxItemWidth, paddedMarkerWidth, font, id) {\n const ellipsis2 = `...`;\n const textChars = text.split(\"\");\n let addEllipsis = false;\n if (text.length > maxCharLength) {\n text = `${text.substring(0, maxCharLength)}`;\n addEllipsis = true;\n }\n const labelWidth = Math.floor(paddedMarkerWidth + Text.getTextSize(text, font).width);\n if (labelWidth > maxItemWidth) {\n let truncatedText = \"\";\n const characterWidths = this.getCharacterWidths(font);\n let cumulativeWidth = paddedMarkerWidth + characterWidths[ellipsis2];\n for (const char of textChars) {\n if (!characterWidths[char]) {\n characterWidths[char] = Text.getTextSize(char, font).width;\n }\n cumulativeWidth += characterWidths[char];\n if (cumulativeWidth > maxItemWidth) {\n break;\n }\n truncatedText += char;\n }\n text = truncatedText;\n addEllipsis = true;\n }\n if (addEllipsis) {\n text += ellipsis2;\n this.truncatedItems.add(id);\n } else {\n this.truncatedItems.delete(id);\n }\n return text;\n }\n updatePagination(bboxes, width, height) {\n const orientation = this.getOrientation();\n const trackingIndex = Math.min(this.paginationTrackingIndex, bboxes.length);\n this.pagination.orientation = orientation;\n this.pagination.translationX = 0;\n this.pagination.translationY = 0;\n const { pages, maxPageHeight, maxPageWidth, paginationBBox, paginationVertical } = this.calculatePagination(\n bboxes,\n width,\n height\n );\n const newCurrentPage = pages.findIndex((p) => p.endIndex >= trackingIndex);\n this.pagination.currentPage = clamp(0, newCurrentPage, pages.length - 1);\n const { paddingX: itemPaddingX, paddingY: itemPaddingY } = this.item;\n const paginationComponentPadding = 8;\n const legendItemsWidth = maxPageWidth - itemPaddingX;\n const legendItemsHeight = maxPageHeight - itemPaddingY;\n let paginationX = 0;\n let paginationY = -paginationBBox.y - this.item.marker.size / 2;\n if (paginationVertical) {\n paginationY += legendItemsHeight + paginationComponentPadding;\n } else {\n paginationX += -paginationBBox.x + legendItemsWidth + paginationComponentPadding;\n paginationY += (legendItemsHeight - paginationBBox.height) / 2;\n }\n this.pagination.translationX = paginationX;\n this.pagination.translationY = paginationY;\n this.pagination.update();\n this.pagination.updateMarkers();\n return {\n maxPageHeight,\n maxPageWidth,\n pages\n };\n }\n calculatePagination(bboxes, width, height) {\n var _a, _b, _c;\n const { paddingX: itemPaddingX, paddingY: itemPaddingY } = this.item;\n const orientation = this.getOrientation();\n const paginationVertical = [\"left\", \"right\"].includes(this.position);\n let paginationBBox = this.pagination.computeBBox();\n let lastPassPaginationBBox = new BBox(0, 0, 0, 0);\n let pages = [];\n let maxPageWidth = 0;\n let maxPageHeight = 0;\n let count = 0;\n const stableOutput = (bbox) => {\n return bbox.width === paginationBBox.width && bbox.height === paginationBBox.height;\n };\n const forceResult = this.maxWidth !== void 0 && this.maxHeight !== void 0;\n do {\n if (count++ > 10) {\n Logger.warn(\"unable to find stable legend layout.\");\n break;\n }\n paginationBBox = lastPassPaginationBBox;\n const maxWidth = width - (paginationVertical ? 0 : paginationBBox.width);\n const maxHeight = height - (paginationVertical ? paginationBBox.height : 0);\n const layout = gridLayout({\n orientation,\n bboxes,\n maxHeight,\n maxWidth,\n itemPaddingY,\n itemPaddingX,\n forceResult\n });\n pages = (_a = layout == null ? void 0 : layout.pages) != null ? _a : [];\n maxPageWidth = (_b = layout == null ? void 0 : layout.maxPageWidth) != null ? _b : 0;\n maxPageHeight = (_c = layout == null ? void 0 : layout.maxPageHeight) != null ? _c : 0;\n const totalPages = pages.length;\n this.pagination.visible = totalPages > 1;\n this.pagination.totalPages = totalPages;\n this.pagination.update();\n lastPassPaginationBBox = this.pagination.computeBBox();\n if (!this.pagination.visible) {\n break;\n }\n } while (!stableOutput(lastPassPaginationBBox));\n return { maxPageWidth, maxPageHeight, pages, paginationBBox, paginationVertical };\n }\n getPageItemCount(pageNumber) {\n let count = 0;\n for (const col of this.pages[pageNumber].columns) {\n count += col.indices.length;\n }\n return count;\n }\n getNodeIndexFromFocusIndex() {\n const { index } = this.focus;\n const page = this.pages[this.pagination.currentPage];\n let itemCount = 0;\n for (const col of page.columns) {\n if (index < itemCount + col.indices.length) {\n return col.indices[index - itemCount];\n } else {\n itemCount += col.indices.length;\n }\n }\n return -1;\n }\n updatePositions(pageNumber = 0) {\n const {\n item: { paddingY },\n itemSelection,\n pages\n } = this;\n if (pages.length < 1 || !pages[pageNumber]) {\n return;\n }\n const { columns, startIndex: visibleStart, endIndex: visibleEnd } = pages[pageNumber];\n let x = 0;\n let y = 0;\n const columnCount = columns.length;\n const rowCount = columns[0].indices.length;\n const horizontal = this.getOrientation() === \"horizontal\";\n const itemHeight = columns[0].bboxes[0].height + paddingY;\n const rowSumColumnWidths = [];\n itemSelection.each((markerLabel, _, i) => {\n var _a, _b;\n if (i < visibleStart || i > visibleEnd) {\n markerLabel.visible = false;\n return;\n }\n const pageIndex = i - visibleStart;\n let columnIndex = 0;\n let rowIndex = 0;\n if (horizontal) {\n columnIndex = pageIndex % columnCount;\n rowIndex = Math.floor(pageIndex / columnCount);\n } else {\n columnIndex = Math.floor(pageIndex / rowCount);\n rowIndex = pageIndex % rowCount;\n }\n markerLabel.visible = true;\n const column = columns[columnIndex];\n if (!column) {\n return;\n }\n y = itemHeight * rowIndex;\n x = (_a = rowSumColumnWidths[rowIndex]) != null ? _a : 0;\n rowSumColumnWidths[rowIndex] = ((_b = rowSumColumnWidths[rowIndex]) != null ? _b : 0) + column.columnWidth;\n markerLabel.translationX = Math.floor(x);\n markerLabel.translationY = Math.floor(y);\n });\n }\n updatePageNumber(pageNumber) {\n const { pages } = this;\n const { startIndex, endIndex } = pages[pageNumber];\n if (startIndex === 0) {\n this.paginationTrackingIndex = 0;\n } else if (pageNumber === pages.length - 1) {\n this.paginationTrackingIndex = endIndex;\n } else {\n this.paginationTrackingIndex = Math.floor((startIndex + endIndex) / 2);\n }\n this.pagination.update();\n this.pagination.updateMarkers();\n this.updatePositions(pageNumber);\n this.ctx.updateService.update(6 /* SCENE_RENDER */);\n }\n update() {\n const {\n label: { color },\n marker: itemMarker,\n line: itemLine,\n showSeriesStroke\n } = this.item;\n this.itemSelection.each((markerLabel, datum) => {\n var _a, _b;\n const marker = datum.marker;\n markerLabel.markerFill = marker.fill;\n markerLabel.markerStroke = marker.stroke;\n markerLabel.markerStrokeWidth = (_a = itemMarker.strokeWidth) != null ? _a : Math.min(2, marker.strokeWidth);\n markerLabel.markerFillOpacity = marker.fillOpacity;\n markerLabel.markerStrokeOpacity = marker.strokeOpacity;\n markerLabel.opacity = datum.enabled ? 1 : 0.5;\n markerLabel.color = color;\n const { line } = datum;\n if (showSeriesStroke && line !== void 0) {\n markerLabel.lineStroke = line.stroke;\n markerLabel.lineStrokeOpacity = line.strokeOpacity;\n markerLabel.lineStrokeWidth = (_b = itemLine.strokeWidth) != null ? _b : Math.min(2, line.strokeWidth);\n markerLabel.lineLineDash = line.lineDash;\n }\n });\n }\n getDatumForPoint(x, y) {\n const visibleChildBBoxes = [];\n const closestLeftTop = { dist: Infinity, datum: void 0 };\n for (const child of this.group.children) {\n if (!child.visible)\n continue;\n if (!(child instanceof MarkerLabel))\n continue;\n const childBBox = child.computeBBox();\n childBBox.grow(this.item.paddingX / 2, \"horizontal\");\n childBBox.grow(this.item.paddingY / 2, \"vertical\");\n if (childBBox.containsPoint(x, y)) {\n return child.datum;\n }\n const distX = x - childBBox.x - this.item.paddingX / 2;\n const distY = y - childBBox.y - this.item.paddingY / 2;\n const dist = __pow(distX, 2) + __pow(distY, 2);\n const toTheLeftTop = distX >= 0 && distY >= 0;\n if (toTheLeftTop && dist < closestLeftTop.dist) {\n closestLeftTop.dist = dist;\n closestLeftTop.datum = child.datum;\n }\n visibleChildBBoxes.push(childBBox);\n }\n const pageBBox = BBox.merge(visibleChildBBoxes);\n if (!pageBBox.containsPoint(x, y)) {\n return;\n }\n return closestLeftTop.datum;\n }\n computePagedBBox() {\n const actualBBox = this.group.computeBBox();\n if (this.pages.length <= 1) {\n return actualBBox;\n }\n const [maxPageWidth, maxPageHeight] = this.maxPageSize;\n actualBBox.height = Math.max(maxPageHeight, actualBBox.height);\n actualBBox.width = Math.max(maxPageWidth, actualBBox.width);\n return actualBBox;\n }\n checkLegendClick(event) {\n const datum = this.getDatumForPoint(event.offsetX, event.offsetY);\n if (this.doClick(datum)) {\n event.consume();\n }\n }\n doClick(datum) {\n const {\n listeners: { legendItemClick },\n ctx: { chartService, highlightManager },\n item: { toggleSeriesVisible },\n preventHidingAll\n } = this;\n if (!datum) {\n return false;\n }\n const { id, itemId, enabled } = datum;\n const series = chartService.series.find((s) => s.id === id);\n if (!series) {\n return false;\n }\n let newEnabled = enabled;\n if (toggleSeriesVisible) {\n newEnabled = !enabled;\n if (preventHidingAll && !newEnabled) {\n const numVisibleItems = chartService.series.flatMap((s) => s.getLegendData(\"category\")).filter((d) => d.enabled).length;\n if (numVisibleItems < 2) {\n newEnabled = true;\n }\n }\n const status = newEnabled ? \"visible\" : \"hidden\";\n this.ctx.ariaAnnouncementService.announceValue(`${status}`);\n this.ctx.chartEventManager.legendItemClick(series, itemId, newEnabled, datum.legendItemName);\n }\n if (newEnabled) {\n highlightManager.updateHighlight(this.id, {\n series,\n itemId,\n datum: void 0\n });\n } else {\n highlightManager.updateHighlight(this.id);\n }\n this.ctx.updateService.update(2 /* PROCESS_DATA */, { forceNodeDataRefresh: true });\n legendItemClick == null ? void 0 : legendItemClick({ type: \"click\", enabled: newEnabled, itemId, seriesId: series.id });\n return true;\n }\n checkLegendDoubleClick(event) {\n var _a;\n const {\n listeners: { legendItemDoubleClick },\n ctx: { chartService },\n item: { toggleSeriesVisible }\n } = this;\n if (chartService.mode === \"integrated\") {\n return;\n }\n const datum = this.getDatumForPoint(event.offsetX, event.offsetY);\n if (!datum) {\n return;\n }\n const { id, itemId, seriesId } = datum;\n const series = chartService.series.find((s) => s.id === id);\n if (!series) {\n return;\n }\n event.consume();\n if (toggleSeriesVisible) {\n const legendData = chartService.series.flatMap((s) => s.getLegendData(\"category\"));\n const numVisibleItems = legendData.filter((d) => d.enabled).length;\n const clickedItem = legendData.find((d) => d.itemId === itemId && d.seriesId === seriesId);\n this.ctx.chartEventManager.legendItemDoubleClick(\n series,\n itemId,\n (_a = clickedItem == null ? void 0 : clickedItem.enabled) != null ? _a : false,\n numVisibleItems,\n clickedItem == null ? void 0 : clickedItem.legendItemName\n );\n }\n this.ctx.updateService.update(2 /* PROCESS_DATA */, { forceNodeDataRefresh: true });\n legendItemDoubleClick == null ? void 0 : legendItemDoubleClick({ type: \"dblclick\", enabled: true, itemId, seriesId: series.id });\n }\n handleLegendMouseMove(event) {\n if (!this.enabled) {\n return;\n }\n const { offsetX, offsetY } = event;\n event.consume();\n const datum = this.getDatumForPoint(offsetX, offsetY);\n this.doHover(event, datum);\n }\n doHover(event, datum) {\n var _a;\n const {\n item: { toggleSeriesVisible },\n listeners\n } = this;\n if (event === void 0 || datum === void 0) {\n this.ctx.cursorManager.updateCursor(this.id);\n this.ctx.highlightManager.updateHighlight(this.id);\n return;\n }\n const series = datum ? this.ctx.chartService.series.find((s) => s.id === (datum == null ? void 0 : datum.id)) : void 0;\n if (datum && this.truncatedItems.has((_a = datum.itemId) != null ? _a : datum.id)) {\n const { offsetX, offsetY } = event;\n this.ctx.tooltipManager.updateTooltip(\n this.id,\n { offsetX, offsetY, lastPointerEvent: event, showArrow: false },\n toTooltipHtml({ content: this.getItemLabel(datum) })\n );\n } else {\n this.ctx.tooltipManager.removeTooltip(this.id);\n }\n if (toggleSeriesVisible || listeners.legendItemClick != null || listeners.legendItemDoubleClick != null) {\n this.ctx.cursorManager.updateCursor(this.id, \"pointer\");\n }\n if ((datum == null ? void 0 : datum.enabled) && series) {\n this.ctx.highlightManager.updateHighlight(this.id, {\n series,\n itemId: datum == null ? void 0 : datum.itemId,\n datum: void 0\n });\n } else {\n this.ctx.highlightManager.updateHighlight(this.id);\n }\n }\n handleLegendMouseExit(_event) {\n this.doMouseExit();\n }\n doMouseExit() {\n this.ctx.cursorManager.updateCursor(this.id);\n this.ctx.tooltipManager.removeTooltip(this.id);\n if (this.ctx.interactionManager.getState() === 16 /* Default */) {\n this.ctx.highlightManager.updateHighlight(this.id);\n }\n }\n handleLegendMouseEnter(event) {\n const {\n enabled,\n item: { toggleSeriesVisible: toggle },\n listeners: { legendItemClick: clickListener, legendItemDoubleClick: dblclickListener }\n } = this;\n const datum = this.getDatumForPoint(event.offsetX, event.offsetY);\n if (enabled && datum !== void 0 && (toggle || clickListener != null || dblclickListener != null)) {\n this.ctx.cursorManager.updateCursor(this.id, \"pointer\");\n }\n }\n onBlur(_event) {\n this.doMouseExit();\n this.focus.mode = \"item\";\n this.ctx.regionManager.updateFocusIndicatorRect(void 0);\n }\n onTab(event) {\n this.updateFocus();\n event.consume();\n }\n onTabStart(event) {\n if (!this.pagination.visible || !this.pagination.enabled)\n return;\n const consumeTabStart = (newMode) => {\n this.focus.mode = newMode;\n this.updateFocus();\n event.consume();\n };\n if (this.focus.mode === \"item\" && event.delta === 1) {\n this.focus.index = this.pagination.currentPage === 0 ? 1 : 0;\n consumeTabStart(\"page\");\n } else if (this.focus.mode === \"page\" && event.delta === -1) {\n this.focus.index = 0;\n consumeTabStart(\"item\");\n }\n }\n onNav(event) {\n if (this.focus.mode === \"item\") {\n const newIndex = this.focus.index + event.delta;\n const pageItemCount = this.getPageItemCount(this.pagination.currentPage);\n this.focus.index = clamp(-1, newIndex, pageItemCount);\n this.updateFocus();\n event.consume();\n } else if (this.focus.mode === \"page\") {\n if (event.delta < 0)\n this.focus.index = 0;\n if (event.delta > 0)\n this.focus.index = 1;\n this.updateFocus();\n event.consume();\n }\n }\n onSubmit(_event) {\n if (this.focus.mode === \"item\") {\n this.doClick(this.getFocusedItem().datum);\n } else if (this.focus.mode === \"page\") {\n if (this.focus.index === 0)\n this.pagination.clickPrevious();\n if (this.focus.index === 1)\n this.pagination.clickNext();\n this.ctx.ariaAnnouncementService.announceValue(\n `Legend page ${this.pagination.currentPage + 1} of ${this.pages.length}`\n );\n }\n }\n maybeChangeFocusPage() {\n const oldPage = this.pagination.currentPage;\n const oldPageItemCount = this.getPageItemCount(oldPage);\n if (this.focus.index === -1) {\n this.pagination.setPage(oldPage - 1);\n } else if (this.focus.index === oldPageItemCount) {\n this.pagination.setPage(oldPage + 1);\n } else {\n return;\n }\n const { currentPage } = this.pagination;\n if (oldPage === currentPage) {\n this.focus.index = clamp(0, this.focus.index, oldPageItemCount - 1);\n } else if (this.focus.index === -1) {\n this.focus.index = this.getPageItemCount(currentPage) - 1;\n } else {\n this.focus.index = 0;\n }\n }\n getFocusedItem() {\n if (this.focus.mode !== \"item\") {\n Logger.error(`getFocusedItem() should be called only when focus.mode is 'item'`);\n return { nodeIndex: -1, node: void 0, datum: void 0 };\n }\n this.maybeChangeFocusPage();\n const nodeIndex = this.getNodeIndexFromFocusIndex();\n if (nodeIndex < 0) {\n Logger.error(`Cannot access negative nodeIndex ${nodeIndex}`);\n return { nodeIndex: -1, node: void 0, datum: void 0 };\n }\n const node = this.itemSelection.nodes()[nodeIndex];\n const data = this.data;\n let datum;\n if (nodeIndex < data.length) {\n datum = this.data[nodeIndex];\n } else {\n Logger.error(`Cannot access datum[${nodeIndex}]`);\n }\n return { nodeIndex, node, datum };\n }\n updateFocus() {\n const { focus, pagination } = this;\n if (focus.mode === \"item\") {\n const { nodeIndex, node, datum } = this.getFocusedItem();\n if (datum === void 0)\n return;\n const bbox = node == null ? void 0 : node.computeTransformedBBox();\n this.doHover(makeKeyboardPointerEvent(this.ctx.regionManager, { bbox, showFocusBox: true }), datum);\n const label = datum && this.getItemLabel(datum);\n if (label) {\n const visibility = datum.enabled ? \"visible\" : \"hidden\";\n this.ctx.ariaAnnouncementService.announceValue(\n `Legend item ${nodeIndex + 1} of ${this.data.length}, ${label}, ${visibility}`\n );\n }\n } else if (focus.mode === \"page\") {\n const button = focus.index === 0 ? pagination.previousButton : pagination.nextButton;\n this.ctx.regionManager.updateFocusIndicatorRect(button.computeTransformedBBox());\n const value = [\"Previous legend page\", \"Next legend page\"][focus.index];\n this.ctx.ariaAnnouncementService.announceValue(`${value}, button`);\n }\n }\n positionLegend(shrinkRect) {\n const newShrinkRect = shrinkRect.clone();\n if (!this.enabled || !this.data.length) {\n return { shrinkRect: newShrinkRect };\n }\n const [legendWidth, legendHeight] = this.calculateLegendDimensions(shrinkRect);\n this.group.translationX = 0;\n this.group.translationY = 0;\n this.calcLayout(legendWidth, legendHeight);\n const legendBBox = this.computePagedBBox();\n const calculateTranslationPerpendicularDimension = () => {\n switch (this.position) {\n case \"top\":\n case \"left\":\n return 0;\n case \"bottom\":\n return shrinkRect.height - legendBBox.height;\n case \"right\":\n default:\n return shrinkRect.width - legendBBox.width;\n }\n };\n if (this.visible) {\n let translationX;\n let translationY;\n switch (this.position) {\n case \"top\":\n case \"bottom\":\n translationX = (shrinkRect.width - legendBBox.width) / 2;\n translationY = calculateTranslationPerpendicularDimension();\n newShrinkRect.shrink(legendBBox.height, this.position);\n break;\n case \"left\":\n case \"right\":\n default:\n translationX = calculateTranslationPerpendicularDimension();\n translationY = (shrinkRect.height - legendBBox.height) / 2;\n newShrinkRect.shrink(legendBBox.width, this.position);\n }\n this.group.translationX = Math.floor(-legendBBox.x + shrinkRect.x + translationX);\n this.group.translationY = Math.floor(-legendBBox.y + shrinkRect.y + translationY);\n }\n if (this.visible && this.enabled && this.data.length) {\n const legendPadding = this.spacing;\n newShrinkRect.shrink(legendPadding, this.position);\n const legendPositionedBBox = legendBBox.clone();\n legendPositionedBBox.x += this.group.translationX;\n legendPositionedBBox.y += this.group.translationY;\n }\n return { shrinkRect: newShrinkRect };\n }\n calculateLegendDimensions(shrinkRect) {\n const { width, height } = shrinkRect;\n const aspectRatio = width / height;\n const maxCoefficient = 0.5;\n const minHeightCoefficient = 0.2;\n const minWidthCoefficient = 0.25;\n let legendWidth, legendHeight;\n switch (this.position) {\n case \"top\":\n case \"bottom\":\n const heightCoefficient = aspectRatio < 1 ? Math.min(maxCoefficient, minHeightCoefficient * (1 / aspectRatio)) : minHeightCoefficient;\n legendWidth = this.maxWidth ? Math.min(this.maxWidth, width) : width;\n legendHeight = this.maxHeight ? Math.min(this.maxHeight, height) : Math.round(height * heightCoefficient);\n break;\n case \"left\":\n case \"right\":\n default:\n const widthCoefficient = aspectRatio > 1 ? Math.min(maxCoefficient, minWidthCoefficient * aspectRatio) : minWidthCoefficient;\n legendWidth = this.maxWidth ? Math.min(this.maxWidth, width) : Math.round(width * widthCoefficient);\n legendHeight = this.maxHeight ? Math.min(this.maxHeight, height) : height;\n }\n return [legendWidth, legendHeight];\n }\n};\nLegend.className = \"Legend\";\n__decorateClass([\n Validate(OBJECT)\n], Legend.prototype, \"pagination\", 2);\n__decorateClass([\n Validate(OBJECT)\n], Legend.prototype, \"item\", 2);\n__decorateClass([\n Validate(OBJECT)\n], Legend.prototype, \"listeners\", 2);\n__decorateClass([\n ObserveChanges((target) => target.updateGroupVisibility()),\n Validate(BOOLEAN)\n], Legend.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(POSITION2)\n], Legend.prototype, \"position\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], Legend.prototype, \"maxWidth\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], Legend.prototype, \"maxHeight\", 2);\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], Legend.prototype, \"reverseOrder\", 2);\n__decorateClass([\n Validate(UNION([\"horizontal\", \"vertical\"], \"an orientation\"), { optional: true })\n], Legend.prototype, \"orientation\", 2);\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], Legend.prototype, \"preventHidingAll\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], Legend.prototype, \"spacing\", 2);\n\n// packages/ag-charts-community/src/chart/legendModule.ts\nvar CommunityLegendModule = {\n type: \"legend\",\n optionsKey: \"legend\",\n identifier: \"category\",\n chartTypes: [\"cartesian\", \"polar\", \"hierarchy\", \"topology\"],\n instanceConstructor: Legend,\n packageType: \"community\"\n};\n\n// packages/ag-charts-community/src/chart/navigator/shapes/rangeHandle.ts\nvar RangeHandle = class extends Path {\n constructor() {\n super(...arguments);\n this.zIndex = 3;\n this._fill = \"#f2f2f2\";\n this._stroke = \"#999999\";\n this._strokeWidth = 1;\n this._lineCap = \"square\";\n this._centerX = 0;\n this._centerY = 0;\n this._width = 8;\n this._gripLineGap = 2;\n this._gripLineLength = 8;\n this._height = 16;\n }\n set centerX(value) {\n if (this._centerX !== value) {\n this._centerX = value;\n this.dirtyPath = true;\n }\n }\n get centerX() {\n return this._centerX;\n }\n set centerY(value) {\n if (this._centerY !== value) {\n this._centerY = value;\n this.dirtyPath = true;\n }\n }\n get centerY() {\n return this._centerY;\n }\n set width(value) {\n if (this._width !== value) {\n this._width = value;\n this.dirtyPath = true;\n }\n }\n get width() {\n return this._width;\n }\n set gripLineGap(value) {\n if (this._gripLineGap !== value) {\n this._gripLineGap = value;\n this.dirtyPath = true;\n }\n }\n get gripLineGap() {\n return this._gripLineGap;\n }\n set gripLineLength(value) {\n if (this._gripLineLength !== value) {\n this._gripLineLength = value;\n this.dirtyPath = true;\n }\n }\n get gripLineLength() {\n return this._gripLineLength;\n }\n set height(value) {\n if (this._height !== value) {\n this._height = value;\n this.dirtyPath = true;\n }\n }\n get height() {\n return this._height;\n }\n layout(x, y) {\n this.centerX = x;\n this.centerY = y;\n }\n static align(minHandle, maxHandle, x, y, width, height, min, max) {\n const handlePixelAlign = minHandle.strokeWidth / 2;\n const minHandleX = minHandle.align(x + width * min) + handlePixelAlign;\n const maxHandleX = minHandleX + minHandle.align(x + width * min, width * (max - min)) - 2 * handlePixelAlign;\n const handleY = minHandle.align(y + height / 2) + handlePixelAlign;\n minHandle.layout(minHandleX, handleY);\n maxHandle.layout(maxHandleX, handleY);\n }\n computeBBox() {\n const { centerX, centerY, width, height } = this;\n const x = centerX - width / 2;\n const y = centerY - height / 2;\n return new BBox(x, y, width, height);\n }\n isPointInPath(x, y) {\n const point = this.transformPoint(x, y);\n const bbox = this.computeBBox();\n return bbox.containsPoint(point.x, point.y);\n }\n updatePath() {\n var _a, _b, _c;\n const { centerX, centerY, path, strokeWidth, gripLineGap, gripLineLength } = this;\n const pixelRatio = (_c = (_b = (_a = this.layerManager) == null ? void 0 : _a.canvas) == null ? void 0 : _b.pixelRatio) != null ? _c : 1;\n path.clear();\n const halfWidth = Math.floor(this.width / 2 * pixelRatio) / pixelRatio;\n const halfHeight = Math.floor(this.height / 2 * pixelRatio) / pixelRatio;\n path.moveTo(centerX - halfWidth, centerY - halfHeight);\n path.lineTo(centerX + halfWidth, centerY - halfHeight);\n path.lineTo(centerX + halfWidth, centerY + halfHeight);\n path.lineTo(centerX - halfWidth, centerY + halfHeight);\n path.closePath();\n const dx = Math.floor((gripLineGap + strokeWidth) / 2 * pixelRatio) / pixelRatio;\n const dy = Math.floor(gripLineLength / 2 * pixelRatio) / pixelRatio;\n path.moveTo(centerX - dx, centerY - dy);\n path.lineTo(centerX - dx, centerY + dy);\n path.moveTo(centerX + dx, centerY - dy);\n path.lineTo(centerX + dx, centerY + dy);\n }\n};\nRangeHandle.className = \"RangeHandle\";\n__decorateClass([\n Validate(COLOR_STRING)\n], RangeHandle.prototype, \"_fill\", 2);\n__decorateClass([\n Validate(COLOR_STRING)\n], RangeHandle.prototype, \"_stroke\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], RangeHandle.prototype, \"_strokeWidth\", 2);\n__decorateClass([\n Validate(LINE_CAP)\n], RangeHandle.prototype, \"_lineCap\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], RangeHandle.prototype, \"_width\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], RangeHandle.prototype, \"_gripLineGap\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], RangeHandle.prototype, \"_gripLineLength\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], RangeHandle.prototype, \"_height\", 2);\n\n// packages/ag-charts-community/src/chart/navigator/shapes/rangeMask.ts\nvar RangeMask = class extends Path {\n constructor() {\n super(...arguments);\n this.zIndex = 2;\n this.x = 0;\n this.y = 0;\n this.width = 200;\n this.height = 30;\n this.min = 0;\n this.max = 1;\n }\n layout(x, y, width, height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.dirtyPath = true;\n }\n update(min, max) {\n this.min = isNaN(min) ? this.min : min;\n this.max = isNaN(max) ? this.max : max;\n this.dirtyPath = true;\n }\n computeBBox() {\n const { x, y, width, height } = this;\n return new BBox(x, y, width, height);\n }\n computeVisibleRangeBBox() {\n const { x, y, width, height, min, max } = this;\n const minX = x + width * min;\n const maxX = x + width * max;\n return new BBox(minX, y, maxX - minX, height);\n }\n updatePath() {\n const { path, x, y, width, height, min, max, strokeWidth } = this;\n const pixelAlign = strokeWidth / 2;\n path.clear();\n const ax = this.align(x) + pixelAlign;\n const ay = this.align(y) + pixelAlign;\n const axw = ax + this.align(x, width) - 2 * pixelAlign;\n const ayh = ay + this.align(y, height) - 2 * pixelAlign;\n path.moveTo(ax, ay);\n path.lineTo(axw, ay);\n path.lineTo(axw, ayh);\n path.lineTo(ax, ayh);\n path.closePath();\n const minX = this.align(x + width * min) + pixelAlign;\n const maxX = minX + this.align(x + width * min, width * (max - min)) - 2 * pixelAlign;\n path.moveTo(minX, ay);\n path.lineTo(minX, ayh);\n path.lineTo(maxX, ayh);\n path.lineTo(maxX, ay);\n path.closePath();\n }\n};\nRangeMask.className = \"RangeMask\";\n\n// packages/ag-charts-community/src/chart/navigator/shapes/rangeSelector.ts\nvar RangeSelector = class extends Group {\n constructor(children) {\n super({ name: \"rangeSelectorGroup\", layer: true, zIndex: 12 /* NAVIGATOR_ZINDEX */ });\n this.x = 0;\n this.y = 0;\n this.width = 200;\n this.height = 30;\n this.lOffset = 0;\n this.rOffset = 0;\n this.isContainerNode = true;\n this.background = new Group({ name: \"navigator-background\" });\n this.background.zIndex = 1;\n this.appendChild(this.background);\n this.append(children);\n }\n layout(x, y, width, height, lOffset, rOffset) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.lOffset = lOffset;\n this.rOffset = rOffset;\n this.background.translationX = x;\n this.background.translationY = y;\n }\n updateBackground(oldGroup, newGroup) {\n if (oldGroup != null) {\n this.background.removeChild(oldGroup);\n }\n if (newGroup != null) {\n this.background.appendChild(newGroup);\n }\n }\n computeBBox() {\n const { x, y, width, height, lOffset, rOffset } = this;\n return new BBox(x - lOffset, y, width + (lOffset + rOffset), height);\n }\n};\n\n// packages/ag-charts-community/src/chart/navigator/navigator.ts\nvar Navigator = class extends BaseModuleInstance {\n constructor(ctx) {\n super();\n this.ctx = ctx;\n this.miniChart = void 0;\n this.enabled = false;\n this.mask = new RangeMask();\n this.minHandle = new RangeHandle();\n this.maxHandle = new RangeHandle();\n this.height = 30;\n this.margin = 10;\n this.x = 0;\n this.y = 0;\n this.width = 0;\n this.rangeSelector = new RangeSelector([this.mask, this.minHandle, this.maxHandle]);\n this._min = 0;\n this._max = 1;\n this.minRange = 1e-3;\n const region = ctx.regionManager.addRegion(\"navigator\", this.rangeSelector);\n const dragStates = 16 /* Default */ | 1 /* Animation */ | 8 /* ZoomDrag */;\n this.destroyFns.push(\n ctx.scene.attachNode(this.rangeSelector),\n region.addListener(\"hover\", (event) => this.onHover(event), dragStates),\n region.addListener(\"drag-start\", (event) => this.onDragStart(event), dragStates),\n region.addListener(\"drag\", (event) => this.onDrag(event), dragStates),\n region.addListener(\"drag-end\", () => this.onDragEnd(), dragStates),\n region.addListener(\"leave\", (event) => this.onLeave(event), dragStates),\n ctx.zoomManager.addListener(\"zoom-change\", (event) => this.onZoomChange(event))\n );\n this.updateGroupVisibility();\n }\n updateBackground(oldGroup, newGroup) {\n var _a;\n (_a = this.rangeSelector) == null ? void 0 : _a.updateBackground(oldGroup, newGroup);\n }\n updateGroupVisibility() {\n const { enabled } = this;\n if (this.rangeSelector == null || enabled === this.rangeSelector.visible)\n return;\n this.rangeSelector.visible = enabled;\n if (enabled) {\n this.updateZoom();\n } else {\n this.ctx.zoomManager.updateZoom(\"navigator\");\n }\n }\n performLayout(_0) {\n return __async(this, arguments, function* ({ shrinkRect }) {\n if (this.enabled) {\n const navigatorTotalHeight = this.height + this.margin;\n shrinkRect.shrink(navigatorTotalHeight, \"bottom\");\n this.y = shrinkRect.y + shrinkRect.height + this.margin;\n } else {\n this.y = 0;\n }\n return { shrinkRect };\n });\n }\n performCartesianLayout(opts) {\n return __async(this, null, function* () {\n const { x, width } = opts.seriesRect;\n if (this.enabled) {\n const { y, height } = this;\n this.layoutNodes(x, y, width, height);\n }\n this.x = x;\n this.width = width;\n });\n }\n onHover(event) {\n if (!this.enabled)\n return;\n const { mask, minHandle, maxHandle } = this;\n const { offsetX, offsetY } = event;\n if (minHandle.containsPoint(offsetX, offsetY) || maxHandle.containsPoint(offsetX, offsetY)) {\n this.ctx.cursorManager.updateCursor(\"navigator\", \"ew-resize\");\n } else if (mask.computeVisibleRangeBBox().containsPoint(offsetX, offsetY)) {\n this.ctx.cursorManager.updateCursor(\"navigator\", \"grab\");\n } else {\n this.ctx.cursorManager.updateCursor(\"navigator\");\n }\n }\n onDragStart(event) {\n if (!this.enabled)\n return;\n const { mask, minHandle, maxHandle, x, width, _min: min } = this;\n const { offsetX, offsetY } = event;\n if (minHandle.zIndex < maxHandle.zIndex) {\n if (maxHandle.containsPoint(offsetX, offsetY)) {\n this.dragging = \"max\";\n } else if (minHandle.containsPoint(offsetX, offsetY)) {\n this.dragging = \"min\";\n }\n } else if (minHandle.containsPoint(offsetX, offsetY)) {\n this.dragging = \"min\";\n } else if (maxHandle.containsPoint(offsetX, offsetY)) {\n this.dragging = \"max\";\n }\n if (this.dragging == null && mask.computeVisibleRangeBBox().containsPoint(offsetX, offsetY)) {\n this.dragging = \"pan\";\n this.panStart = (offsetX - x) / width - min;\n }\n if (this.dragging != null) {\n this.ctx.zoomManager.fireZoomPanStartEvent(\"navigator\");\n }\n }\n onDrag(event) {\n if (!this.enabled || this.dragging == null)\n return;\n const { dragging, minRange, panStart, x, width } = this;\n let { _min: min, _max: max } = this;\n const { offsetX } = event;\n const ratio = (offsetX - x) / width;\n if (dragging === \"min\") {\n min = clamp(0, ratio, max - minRange);\n } else if (dragging === \"max\") {\n max = clamp(min + minRange, ratio, 1);\n } else if (dragging === \"pan\" && panStart != null) {\n const span = max - min;\n min = clamp(0, ratio - panStart, 1 - span);\n max = min + span;\n }\n this._min = min;\n this._max = max;\n this.updateZoom();\n }\n onDragEnd() {\n this.dragging = void 0;\n }\n onLeave(_event) {\n this.ctx.cursorManager.updateCursor(\"navigator\");\n }\n onZoomChange(event) {\n const { x } = event;\n if (!x)\n return;\n this._min = x.min;\n this._max = x.max;\n this.updateNodes(x.min, x.max);\n }\n layoutNodes(x, y, width, height) {\n const { rangeSelector, mask, minHandle, maxHandle, _min: min, _max: max } = this;\n rangeSelector.layout(x, y, width, height, minHandle.width / 2, maxHandle.width / 2);\n mask.layout(x, y, width, height);\n RangeHandle.align(minHandle, maxHandle, x, y, width, height, min, max);\n if (min + (max - min) / 2 < 0.5) {\n minHandle.zIndex = 3;\n maxHandle.zIndex = 4;\n } else {\n minHandle.zIndex = 4;\n maxHandle.zIndex = 3;\n }\n }\n updateNodes(min, max) {\n this.mask.update(min, max);\n }\n updateZoom() {\n if (!this.enabled)\n return;\n const { _min: min, _max: max } = this;\n const zoom2 = this.ctx.zoomManager.getZoom();\n if (min == null || max == null)\n return;\n const warnOnConflict = (stateId) => {\n if (this.min == null && this.max == null)\n return;\n Logger.warnOnce(\n `Could not apply [navigator.min] or [navigator.max] as [${stateId}] has modified the initial zoom state.`\n );\n };\n return this.ctx.zoomManager.updateZoom(\"navigator\", { x: { min, max }, y: zoom2 == null ? void 0 : zoom2.y }, false, warnOnConflict);\n }\n};\n__decorateClass([\n Validate(OBJECT, { optional: true })\n], Navigator.prototype, \"miniChart\", 2);\n__decorateClass([\n Validate(BOOLEAN),\n ObserveChanges((target) => target.updateGroupVisibility())\n], Navigator.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], Navigator.prototype, \"height\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], Navigator.prototype, \"margin\", 2);\n__decorateClass([\n ActionOnSet({\n newValue(min) {\n this._min = min;\n this.updateZoom();\n }\n }),\n Validate(AND(RATIO, LESS_THAN(\"max\")), { optional: true })\n], Navigator.prototype, \"min\", 2);\n__decorateClass([\n ActionOnSet({\n newValue(max) {\n this._max = max;\n this.updateZoom();\n }\n }),\n Validate(AND(RATIO, GREATER_THAN(\"min\")), { optional: true })\n], Navigator.prototype, \"max\", 2);\n\n// packages/ag-charts-community/src/chart/navigator/navigatorModule.ts\nvar NavigatorModule = {\n type: \"root\",\n optionsKey: \"navigator\",\n packageType: \"community\",\n chartTypes: [\"cartesian\"],\n instanceConstructor: Navigator,\n themeTemplate: {\n navigator: {\n enabled: false,\n height: 30,\n mask: {\n fill: \"#999999\",\n stroke: \"#999999\",\n strokeWidth: 1,\n fillOpacity: 0.2\n },\n minHandle: {\n fill: \"#f2f2f2\",\n stroke: \"#999999\",\n strokeWidth: 1,\n width: 9,\n height: 16,\n gripLineGap: 1,\n gripLineLength: 8\n },\n maxHandle: {\n fill: \"#f2f2f2\",\n stroke: \"#999999\",\n strokeWidth: 1,\n width: 9,\n height: 16,\n gripLineGap: 1,\n gripLineLength: 8\n }\n }\n }\n};\n\n// packages/ag-charts-community/src/module/theme.ts\nvar singleSeriesPaletteFactory = ({ takeColors }) => {\n const {\n fills: [fill],\n strokes: [stroke]\n } = takeColors(1);\n return { fill, stroke };\n};\nvar markerPaletteFactory = (params) => {\n const { fill, stroke } = singleSeriesPaletteFactory(params);\n return { marker: { fill, stroke } };\n};\n\n// packages/ag-charts-community/src/motion/pathMotion.ts\nfunction pathMotion(groupId, subId, animationManager, paths, fns) {\n const { addPhaseFn, updatePhaseFn, removePhaseFn } = fns;\n const animate = (phase, path, updateFn) => {\n animationManager.animate({\n id: `${groupId}_${subId}_${path.id}_${phase}`,\n groupId,\n from: 0,\n to: 1,\n ease: easeOut,\n collapsable: false,\n onUpdate(ratio, preInit) {\n if (preInit && phase !== \"removed\")\n return;\n path.path.clear(true);\n updateFn(ratio, path);\n path.checkPathDirty();\n },\n onStop() {\n if (phase !== \"added\")\n return;\n path.path.clear(true);\n updateFn(1, path);\n path.checkPathDirty();\n },\n phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[phase]\n });\n };\n for (const path of paths) {\n if (!animationManager.isSkipped()) {\n animate(\"removed\", path, removePhaseFn);\n animate(\"updated\", path, updatePhaseFn);\n }\n animate(\"added\", path, addPhaseFn);\n }\n}\n\n// packages/ag-charts-community/src/util/sanitize.ts\nvar element = null;\nfunction sanitizeHtml(text) {\n if (text == null) {\n return;\n } else if (text === \"\") {\n return \"\";\n }\n element != null ? element : element = createElement(\"div\");\n element.textContent = String(text);\n return element.innerHTML;\n}\n\n// packages/ag-charts-community/src/chart/series/seriesLabelUtil.ts\nfunction seriesLabelFadeInAnimation({ id }, subId, animationManager, ...labelSelections) {\n staticFromToMotion(\n id,\n subId,\n animationManager,\n labelSelections,\n { opacity: 0 },\n { opacity: 1 },\n { phase: \"trailing\" }\n );\n}\nfunction seriesLabelFadeOutAnimation({ id }, subId, animationManager, ...labelSelections) {\n staticFromToMotion(\n id,\n subId,\n animationManager,\n labelSelections,\n { opacity: 1 },\n { opacity: 0 },\n { phase: \"remove\" }\n );\n}\nfunction resetLabelFn(_node) {\n return { opacity: 1 };\n}\n\n// packages/ag-charts-community/src/scene/util/changeDetectableProperties.ts\nvar ChangeDetectableProperties = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this._dirty = 3 /* MAJOR */;\n }\n markDirty(_source, type = 1 /* TRIVIAL */) {\n if (this._dirty < type) {\n this._dirty = type;\n }\n }\n markClean(_opts) {\n this._dirty = 0 /* NONE */;\n }\n isDirty() {\n return this._dirty > 0 /* NONE */;\n }\n};\n\n// packages/ag-charts-community/src/scene/dropShadow.ts\nvar DropShadow = class extends ChangeDetectableProperties {\n constructor() {\n super(...arguments);\n this.enabled = true;\n this.color = \"rgba(0, 0, 0, 0.5)\";\n this.xOffset = 0;\n this.yOffset = 0;\n this.blur = 5;\n }\n};\n__decorateClass([\n Validate(BOOLEAN),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], DropShadow.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(COLOR_STRING),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], DropShadow.prototype, \"color\", 2);\n__decorateClass([\n Validate(NUMBER),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], DropShadow.prototype, \"xOffset\", 2);\n__decorateClass([\n Validate(NUMBER),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], DropShadow.prototype, \"yOffset\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], DropShadow.prototype, \"blur\", 2);\n\n// packages/ag-charts-community/src/chart/series/seriesMarker.ts\nvar MARKER_SHAPE = predicateWithMessage(\n (value) => isMarkerShape(value) || typeof Marker === \"function\" && Object.create(value.prototype) instanceof Marker,\n `a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class`\n);\nvar SeriesMarker = class extends ChangeDetectableProperties {\n constructor() {\n super(...arguments);\n this.enabled = true;\n this.shape = Circle;\n this.size = 6;\n this.fillOpacity = 1;\n this.strokeWidth = 1;\n this.strokeOpacity = 1;\n }\n getStyle() {\n const { size, fill, fillOpacity, stroke, strokeWidth, strokeOpacity } = this;\n return { size, fill, fillOpacity, stroke, strokeWidth, strokeOpacity };\n }\n getDiameter() {\n return this.size + this.strokeWidth;\n }\n};\n__decorateClass([\n Validate(BOOLEAN),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], SeriesMarker.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(MARKER_SHAPE),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], SeriesMarker.prototype, \"shape\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], SeriesMarker.prototype, \"size\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true }),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], SeriesMarker.prototype, \"fill\", 2);\n__decorateClass([\n Validate(RATIO),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], SeriesMarker.prototype, \"fillOpacity\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true }),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], SeriesMarker.prototype, \"stroke\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], SeriesMarker.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(RATIO),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], SeriesMarker.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true }),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], SeriesMarker.prototype, \"formatter\", 2);\n\n// packages/ag-charts-community/src/chart/series/seriesTooltip.ts\nvar SeriesTooltipInteraction = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.enabled = false;\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], SeriesTooltipInteraction.prototype, \"enabled\", 2);\nvar SeriesTooltip = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.enabled = true;\n this.interaction = new SeriesTooltipInteraction();\n this.position = new TooltipPosition();\n }\n toTooltipHtml(defaults, params) {\n if (this.renderer) {\n return toTooltipHtml(this.renderer(params), defaults);\n }\n return toTooltipHtml(defaults);\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], SeriesTooltip.prototype, \"enabled\", 2);\n__decorateClass([\n Validate(BOOLEAN, { optional: true })\n], SeriesTooltip.prototype, \"showArrow\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], SeriesTooltip.prototype, \"renderer\", 2);\n__decorateClass([\n Validate(OBJECT)\n], SeriesTooltip.prototype, \"interaction\", 2);\n__decorateClass([\n Validate(OBJECT)\n], SeriesTooltip.prototype, \"position\", 2);\n\n// packages/ag-charts-community/src/chart/series/cartesian/areaSeriesProperties.ts\nvar AreaSeriesProperties = class extends CartesianSeriesProperties {\n constructor() {\n super(...arguments);\n this.xName = void 0;\n this.fill = \"#c16068\";\n this.fillOpacity = 1;\n this.stroke = \"#874349\";\n this.strokeWidth = 2;\n this.strokeOpacity = 1;\n this.lineDash = [0];\n this.lineDashOffset = 0;\n this.shadow = new DropShadow();\n this.marker = new SeriesMarker();\n this.label = new Label();\n this.tooltip = new SeriesTooltip();\n this.connectMissingData = false;\n }\n};\n__decorateClass([\n Validate(STRING)\n], AreaSeriesProperties.prototype, \"xKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], AreaSeriesProperties.prototype, \"xName\", 2);\n__decorateClass([\n Validate(STRING)\n], AreaSeriesProperties.prototype, \"yKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], AreaSeriesProperties.prototype, \"yName\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], AreaSeriesProperties.prototype, \"normalizedTo\", 2);\n__decorateClass([\n Validate(COLOR_STRING)\n], AreaSeriesProperties.prototype, \"fill\", 2);\n__decorateClass([\n Validate(RATIO)\n], AreaSeriesProperties.prototype, \"fillOpacity\", 2);\n__decorateClass([\n Validate(COLOR_STRING)\n], AreaSeriesProperties.prototype, \"stroke\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], AreaSeriesProperties.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(RATIO)\n], AreaSeriesProperties.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n Validate(LINE_DASH)\n], AreaSeriesProperties.prototype, \"lineDash\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], AreaSeriesProperties.prototype, \"lineDashOffset\", 2);\n__decorateClass([\n Validate(OBJECT)\n], AreaSeriesProperties.prototype, \"shadow\", 2);\n__decorateClass([\n Validate(OBJECT)\n], AreaSeriesProperties.prototype, \"marker\", 2);\n__decorateClass([\n Validate(OBJECT)\n], AreaSeriesProperties.prototype, \"label\", 2);\n__decorateClass([\n Validate(OBJECT)\n], AreaSeriesProperties.prototype, \"tooltip\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], AreaSeriesProperties.prototype, \"connectMissingData\", 2);\n\n// packages/ag-charts-community/src/chart/series/cartesian/markerUtil.ts\nfunction markerFadeInAnimation({ id }, animationManager, status, ...markerSelections) {\n const params = { phase: status ? NODE_UPDATE_STATE_TO_PHASE_MAPPING[status] : \"trailing\" };\n staticFromToMotion(id, \"markers\", animationManager, markerSelections, { opacity: 0 }, { opacity: 1 }, params);\n markerSelections.forEach((s) => s.cleanup());\n}\nfunction markerScaleInAnimation({ id }, animationManager, ...markerSelections) {\n staticFromToMotion(\n id,\n \"markers\",\n animationManager,\n markerSelections,\n { scalingX: 0, scalingY: 0 },\n { scalingX: 1, scalingY: 1 },\n { phase: \"initial\" }\n );\n markerSelections.forEach((s) => s.cleanup());\n}\nfunction markerSwipeScaleInAnimation({ id, nodeDataDependencies }, animationManager, ...markerSelections) {\n const seriesWidth = nodeDataDependencies.seriesRectWidth;\n const fromFn = (_, datum) => {\n var _a, _b;\n const x = (_b = (_a = datum.midPoint) == null ? void 0 : _a.x) != null ? _b : seriesWidth;\n let delay = clamp(0, inverseEaseOut(x / seriesWidth), 1);\n if (isNaN(delay)) {\n delay = 0;\n }\n return { scalingX: 0, scalingY: 0, delay, duration: QUICK_TRANSITION, phase: \"initial\" };\n };\n const toFn = () => {\n return { scalingX: 1, scalingY: 1 };\n };\n fromToMotion(id, \"markers\", animationManager, markerSelections, { fromFn, toFn });\n}\nfunction resetMarkerFn(_node) {\n return { opacity: 1, scalingX: 1, scalingY: 1 };\n}\nfunction resetMarkerPositionFn(_node, datum) {\n var _a, _b, _c, _d;\n return {\n translationX: (_b = (_a = datum.point) == null ? void 0 : _a.x) != null ? _b : NaN,\n translationY: (_d = (_c = datum.point) == null ? void 0 : _c.y) != null ? _d : NaN\n };\n}\nfunction prepareMarkerAnimation(pairMap, parentStatus) {\n const readFirstPair = (xValue, type) => {\n const val = pairMap[type][xValue];\n return Array.isArray(val) ? val[0] : val;\n };\n const markerStatus = (datum) => {\n const { xValue } = datum;\n if (pairMap.moved[xValue]) {\n return { point: readFirstPair(xValue, \"moved\"), status: \"updated\" };\n } else if (pairMap.removed[xValue]) {\n return { point: readFirstPair(xValue, \"removed\"), status: \"removed\" };\n } else if (pairMap.added[xValue]) {\n return { point: readFirstPair(xValue, \"added\"), status: \"added\" };\n }\n return { status: \"unknown\" };\n };\n const fromFn = (marker, datum) => {\n var _a, _b, _c, _d, _e, _f;\n const { status, point } = markerStatus(datum);\n if (status === \"unknown\")\n return { opacity: 0 };\n const defaults = {\n translationX: (_b = (_a = point == null ? void 0 : point.from) == null ? void 0 : _a.x) != null ? _b : marker.translationX,\n translationY: (_d = (_c = point == null ? void 0 : point.from) == null ? void 0 : _c.y) != null ? _d : marker.translationY,\n opacity: marker.opacity,\n phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[status]\n };\n if (parentStatus === \"added\") {\n return __spreadProps(__spreadValues({}, defaults), {\n opacity: 0,\n translationX: (_e = point == null ? void 0 : point.to) == null ? void 0 : _e.x,\n translationY: (_f = point == null ? void 0 : point.to) == null ? void 0 : _f.y,\n phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[\"added\"]\n });\n }\n if (status === \"added\") {\n defaults.opacity = 0;\n }\n return defaults;\n };\n const toFn = (_marker, datum) => {\n var _a, _b;\n const { status, point } = markerStatus(datum);\n if (status === \"unknown\")\n return { opacity: 0 };\n const defaults = {\n translationX: datum.point.x,\n translationY: datum.point.y,\n opacity: 1,\n phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[status]\n };\n if (status === \"removed\" || parentStatus === \"removed\") {\n return __spreadProps(__spreadValues({}, defaults), {\n translationX: (_a = point == null ? void 0 : point.to) == null ? void 0 : _a.x,\n translationY: (_b = point == null ? void 0 : point.to) == null ? void 0 : _b.y,\n opacity: 0,\n phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[\"removed\"]\n });\n }\n return defaults;\n };\n return { fromFn, toFn };\n}\nfunction computeMarkerFocusBounds(series, { datumIndex }) {\n const nodeData = series.getNodeData();\n if (nodeData === void 0)\n return void 0;\n const datum = nodeData[datumIndex];\n if (datum === void 0 || datum.point === void 0)\n return void 0;\n const size = series.getFormattedMarkerStyle(datum).size;\n const radius = size / 2;\n const { x, y } = series.contentGroup.inverseTransformPoint(datum.point.x - radius, datum.point.y - radius);\n return new BBox(x, y, size, size);\n}\n\n// packages/ag-charts-community/src/chart/series/cartesian/pathUtil.ts\nfunction minMax(nodeData) {\n return nodeData.reduce(\n ({ min, max }, node) => {\n if (min == null || min.point.x > node.point.x) {\n min = node;\n }\n if (max == null || max.point.x < node.point.x) {\n max = node;\n }\n return { min, max };\n },\n {}\n );\n}\nfunction intersectionOnLine(a, b, targetX) {\n const m = (b.y - a.y) / (b.x - a.x);\n const y = (targetX - a.x) * m + a.y;\n return { x: targetX, y };\n}\nfunction backfillPathPoint(results, process, skip, processFn) {\n let prevMarkerIdx = -1, nextMarkerIdx = 0;\n const toProcess = [];\n while (nextMarkerIdx < results.length) {\n if (results[nextMarkerIdx].change === process) {\n toProcess.push(results[nextMarkerIdx]);\n nextMarkerIdx++;\n continue;\n }\n if (results[nextMarkerIdx].change === skip) {\n nextMarkerIdx++;\n continue;\n }\n if (toProcess.length > 0) {\n processFn(toProcess, prevMarkerIdx, nextMarkerIdx);\n toProcess.length = 0;\n }\n prevMarkerIdx = nextMarkerIdx;\n nextMarkerIdx++;\n }\n if (toProcess.length > 0) {\n processFn(toProcess, prevMarkerIdx, nextMarkerIdx);\n }\n}\nfunction backfillPathPointData(result, splitMode) {\n backfillPathPoint(result, \"out\", \"in\", (toProcess, sIdx, eIdx) => {\n var _a, _b;\n if (sIdx === -1 && result[eIdx]) {\n toProcess.forEach((d) => d.to = result[eIdx].from);\n } else if (eIdx === result.length && result[sIdx]) {\n toProcess.forEach((d) => d.to = result[sIdx].from);\n } else if (splitMode === \"intersect\" && ((_a = result[sIdx]) == null ? void 0 : _a.from) && ((_b = result[eIdx]) == null ? void 0 : _b.from)) {\n toProcess.forEach((d) => d.to = intersectionOnLine(result[sIdx].from, result[eIdx].from, d.from.x));\n } else {\n toProcess.forEach((d) => d.to = d.from);\n }\n });\n backfillPathPoint(result, \"in\", \"out\", (toProcess, sIdx, eIdx) => {\n var _a, _b;\n if (sIdx === -1 && result[eIdx]) {\n toProcess.forEach((d) => d.from = result[eIdx].to);\n } else if (eIdx === result.length && result[sIdx]) {\n toProcess.forEach((d) => d.from = result[sIdx].to);\n } else if (splitMode === \"intersect\" && ((_a = result[sIdx]) == null ? void 0 : _a.to) && ((_b = result[eIdx]) == null ? void 0 : _b.to)) {\n toProcess.forEach((d) => d.from = intersectionOnLine(result[sIdx].to, result[eIdx].to, d.to.x));\n } else {\n toProcess.forEach((d) => d.from = d.to);\n }\n });\n}\nfunction calculatePoint(from, to, ratio) {\n const x1 = isNaN(from.x) ? to.x : from.x;\n const y1 = isNaN(from.y) ? to.y : from.y;\n const xd = to.x - from.x;\n const yd = to.y - from.y;\n const xr = isNaN(xd) ? 0 : xd * ratio;\n const yr = isNaN(yd) ? 0 : yd * ratio;\n return {\n x: x1 + xr,\n y: y1 + yr\n };\n}\nfunction renderPartialPath(pairData, ratios, path) {\n const { path: linePath } = path;\n let previousTo;\n for (const data of pairData) {\n const { from, to } = data;\n const ratio = ratios[data.change];\n if (ratio == null || from == null || to == null)\n continue;\n const { x, y } = calculatePoint(from, to, ratio);\n if (data.moveTo === false) {\n linePath.lineTo(x, y);\n } else if (data.moveTo === true || !previousTo) {\n linePath.moveTo(x, y);\n } else if (previousTo) {\n const moveToRatio = data.moveTo === \"in\" ? ratio : 1 - ratio;\n const { x: midPointX, y: midPointY } = calculatePoint(previousTo, { x, y }, moveToRatio);\n linePath.lineTo(midPointX, midPointY);\n linePath.moveTo(x, y);\n }\n previousTo = { x, y };\n }\n}\nfunction pathSwipeInAnimation({ id, visible, nodeDataDependencies }, animationManager, ...paths) {\n const { seriesRectWidth: width, seriesRectHeight: height } = nodeDataDependencies;\n staticFromToMotion(\n id,\n \"path_properties\",\n animationManager,\n paths,\n { clipX: 0 },\n { clipX: width },\n {\n phase: \"initial\",\n start: { clipMode: \"normal\", clipY: height, visible },\n finish: { clipMode: void 0, visible }\n }\n );\n}\nfunction pathFadeInAnimation({ id }, subId, animationManager, phase = \"add\", ...selection) {\n staticFromToMotion(id, subId, animationManager, selection, { opacity: 0 }, { opacity: 1 }, { phase });\n}\nfunction pathFadeOutAnimation({ id }, subId, animationManager, ...selection) {\n staticFromToMotion(id, subId, animationManager, selection, { opacity: 1 }, { opacity: 0 }, { phase: \"remove\" });\n}\nfunction buildResetPathFn(opts) {\n return (_node) => {\n return { opacity: opts.getOpacity(), clipScalingX: 1, clipMode: void 0 };\n };\n}\nfunction updateClipPath({ nodeDataDependencies }, path) {\n const toFinite = (value) => isFinite(value) ? value : 0;\n path.clipX = toFinite(nodeDataDependencies.seriesRectWidth);\n path.clipY = toFinite(nodeDataDependencies.seriesRectHeight);\n}\n\n// packages/ag-charts-community/src/chart/series/cartesian/scaling.ts\nfunction isContinuousScaling(scaling) {\n return scaling.type === \"continuous\" || scaling.type === \"log\";\n}\nfunction isCategoryScaling(scaling) {\n return scaling.type === \"category\";\n}\nfunction areEqual(a, b) {\n return a.domain.length === b.domain.length && a.range.length === b.range.length && a.domain.every((val, index) => val === b.domain[index]) && a.range.every((val, index) => val === b.range[index]);\n}\nfunction areScalingEqual(a, b) {\n if (a === void 0 || b === void 0) {\n return a !== void 0 || b !== void 0;\n }\n if (isContinuousScaling(a) && isContinuousScaling(b)) {\n return a.type === b.type && areEqual(a, b);\n }\n if (isCategoryScaling(a) && isCategoryScaling(b)) {\n return areEqual(a, b);\n }\n return false;\n}\n\n// packages/ag-charts-community/src/chart/series/cartesian/lineUtil.ts\nfunction scale(val, scaling) {\n if (!scaling)\n return NaN;\n if (val instanceof Date) {\n val = val.getTime();\n }\n if (scaling.type === \"continuous\" && typeof val === \"number\") {\n const domainRatio = (val - scaling.domain[0]) / (scaling.domain[1] - scaling.domain[0]);\n return domainRatio * (scaling.range[1] - scaling.range[0]) + scaling.range[0];\n }\n if (scaling.type === \"log\" && typeof val === \"number\") {\n return scaling.convert(val);\n }\n const matchingIndex = scaling.domain.findIndex((d) => d === val);\n if (matchingIndex >= 0) {\n return scaling.range[matchingIndex];\n }\n return NaN;\n}\nfunction scalesChanged(newData, oldData) {\n return !areScalingEqual(newData.scales.x, oldData.scales.x) || !areScalingEqual(newData.scales.y, oldData.scales.y);\n}\nfunction closeMatch(a, b) {\n const an = Number(a);\n const bn = Number(b);\n if (!isNaN(an) && !isNaN(bn)) {\n return Math.abs(bn - an) < 0.25;\n }\n return a === b;\n}\nfunction calculateMoveTo(from = false, to = false) {\n if (from === to) {\n return Boolean(from);\n }\n return from ? \"in\" : \"out\";\n}\nfunction pairContinuousData(newData, oldData, opts = {}) {\n var _a, _b, _c, _d;\n const { backfillSplitMode = \"intersect\" } = opts;\n const toNewScale = (oldDatum) => {\n var _a2, _b2;\n return {\n x: scale((_a2 = oldDatum.xValue) != null ? _a2 : NaN, newData.scales.x),\n y: scale((_b2 = oldDatum.yValue) != null ? _b2 : NaN, newData.scales.y)\n };\n };\n const toOldScale = (newDatum) => {\n var _a2, _b2;\n return {\n x: scale((_a2 = newDatum.xValue) != null ? _a2 : NaN, oldData.scales.x),\n y: scale((_b2 = newDatum.yValue) != null ? _b2 : NaN, oldData.scales.y)\n };\n };\n const result = [];\n const resultMap = {\n added: {},\n moved: {},\n removed: {}\n };\n const pairUp = (from, to, xValue, change = \"move\") => {\n if (from && (isNaN(from.point.x) || isNaN(from.point.y))) {\n from = to;\n }\n const resultPoint = {\n from: from == null ? void 0 : from.point,\n to: to == null ? void 0 : to.point,\n moveTo: calculateMoveTo(from == null ? void 0 : from.point.moveTo, to == null ? void 0 : to.point.moveTo),\n change\n };\n if (change === \"move\") {\n resultMap.moved[xValue] = resultPoint;\n oldIdx++;\n newIdx++;\n } else if (change === \"in\") {\n resultMap.added[xValue] = resultPoint;\n newIdx++;\n } else if (change === \"out\") {\n resultMap.removed[xValue] = resultPoint;\n oldIdx++;\n }\n result.push(resultPoint);\n };\n const { min: minFromNode, max: maxFromNode } = minMax(oldData.nodeData);\n const { min: minToNode, max: maxToNode } = minMax(newData.nodeData);\n let oldIdx = 0;\n let newIdx = 0;\n while (oldIdx < oldData.nodeData.length || newIdx < newData.nodeData.length) {\n const from = oldData.nodeData[oldIdx];\n const to = newData.nodeData[newIdx];\n const fromShifted = from ? toNewScale(from) : void 0;\n const toUnshifted = to ? toOldScale(to) : void 0;\n const NA = void 0;\n if (fromShifted && closeMatch(fromShifted.x, to == null ? void 0 : to.point.x)) {\n pairUp(from, to, to.xValue, \"move\");\n } else if (fromShifted && fromShifted.x < ((_a = minToNode == null ? void 0 : minToNode.point.x) != null ? _a : -Infinity)) {\n pairUp(from, NA, from.xValue, \"out\");\n } else if (fromShifted && fromShifted.x > ((_b = maxToNode == null ? void 0 : maxToNode.point.x) != null ? _b : Infinity)) {\n pairUp(from, NA, from.xValue, \"out\");\n } else if (toUnshifted && toUnshifted.x < ((_c = minFromNode == null ? void 0 : minFromNode.point.x) != null ? _c : -Infinity)) {\n pairUp(NA, to, to.xValue, \"in\");\n } else if (toUnshifted && toUnshifted.x > ((_d = maxFromNode == null ? void 0 : maxFromNode.point.x) != null ? _d : Infinity)) {\n pairUp(NA, to, to.xValue, \"in\");\n } else if (fromShifted && fromShifted.x < (to == null ? void 0 : to.point.x)) {\n pairUp(from, NA, from.xValue, \"out\");\n } else if (toUnshifted && toUnshifted.x < (from == null ? void 0 : from.point.x)) {\n pairUp(NA, to, to.xValue, \"in\");\n } else if (from) {\n pairUp(from, NA, from.xValue, \"out\");\n } else if (to) {\n pairUp(NA, to, to.xValue, \"in\");\n } else {\n throw new Error(\"Unable to process points\");\n }\n }\n backfillPathPointData(result, backfillSplitMode);\n return { result, resultMap };\n}\nfunction pairCategoryData(newData, oldData, diff2, opts = {}) {\n var _a, _b, _c;\n const { backfillSplitMode = \"intersect\", multiDatum = false } = opts;\n const result = [];\n const resultMapSingle = {\n added: {},\n moved: {},\n removed: {}\n };\n const resultMapMulti = {\n added: {},\n moved: {},\n removed: {}\n };\n const pointResultMapping = {\n in: \"added\",\n move: \"moved\",\n out: \"removed\"\n };\n let previousResultPoint = void 0;\n let previousXValue = void 0;\n const addToResultMap = (xValue, newPoint) => {\n var _a2, _b2;\n const type = pointResultMapping[newPoint.change];\n if (multiDatum) {\n (_b2 = (_a2 = resultMapMulti[type])[xValue]) != null ? _b2 : _a2[xValue] = [];\n resultMapMulti[type][xValue].push(newPoint);\n } else {\n resultMapSingle[type][xValue] = newPoint;\n }\n previousResultPoint = newPoint;\n previousXValue = transformIntegratedCategoryValue(xValue);\n };\n let oldIndex = 0;\n let newIndex = 0;\n let isXUnordered = false;\n while (oldIndex < oldData.nodeData.length || newIndex < newData.nodeData.length) {\n const before = oldData.nodeData[oldIndex];\n const after = newData.nodeData[newIndex];\n const bXValue = transformIntegratedCategoryValue(before == null ? void 0 : before.xValue);\n const aXValue = transformIntegratedCategoryValue(after == null ? void 0 : after.xValue);\n let resultPoint;\n if (bXValue === aXValue) {\n resultPoint = {\n change: \"move\",\n moveTo: calculateMoveTo((_a = before.point.moveTo) != null ? _a : false, after.point.moveTo),\n from: before.point,\n to: after.point\n };\n addToResultMap(before == null ? void 0 : before.xValue, resultPoint);\n oldIndex++;\n newIndex++;\n } else if (diff2 == null ? void 0 : diff2.removed.has(String(bXValue))) {\n resultPoint = {\n change: \"out\",\n moveTo: (_b = before.point.moveTo) != null ? _b : false,\n from: before.point\n };\n addToResultMap(before == null ? void 0 : before.xValue, resultPoint);\n oldIndex++;\n } else if (diff2 == null ? void 0 : diff2.added.has(String(aXValue))) {\n resultPoint = {\n change: \"in\",\n moveTo: (_c = after.point.moveTo) != null ? _c : false,\n to: after.point\n };\n addToResultMap(after == null ? void 0 : after.xValue, resultPoint);\n newIndex++;\n } else if (multiDatum && previousResultPoint && previousXValue === bXValue) {\n resultPoint = __spreadValues({}, previousResultPoint);\n addToResultMap(before == null ? void 0 : before.xValue, resultPoint);\n oldIndex++;\n } else if (multiDatum && previousResultPoint && previousXValue === aXValue) {\n resultPoint = __spreadValues({}, previousResultPoint);\n addToResultMap(after == null ? void 0 : after.xValue, resultPoint);\n newIndex++;\n } else {\n isXUnordered = true;\n break;\n }\n result.push(resultPoint);\n }\n let previousX = -Infinity;\n isXUnordered || (isXUnordered = result.some((pathPoint) => {\n const { change: marker, to: { x = -Infinity } = {} } = pathPoint;\n if (marker === \"out\")\n return;\n const unordered = x < previousX;\n previousX = x;\n return unordered;\n }));\n if (isXUnordered) {\n return { result: void 0, resultMap: void 0 };\n }\n backfillPathPointData(result, backfillSplitMode);\n return { result, resultMap: multiDatum ? resultMapMulti : resultMapSingle };\n}\nfunction determinePathStatus(newData, oldData, pairData) {\n var _a, _b, _c, _d;\n let status = \"updated\";\n const visible = (data) => {\n return data.visible;\n };\n if (!visible(oldData) && visible(newData)) {\n status = \"added\";\n } else if (visible(oldData) && !visible(newData)) {\n status = \"removed\";\n } else {\n for (let i = 0; i < pairData.length; i++) {\n if (pairData[i].change !== \"move\")\n break;\n if (((_a = pairData[i].from) == null ? void 0 : _a.x) !== ((_b = pairData[i].to) == null ? void 0 : _b.x))\n break;\n if (((_c = pairData[i].from) == null ? void 0 : _c.y) !== ((_d = pairData[i].to) == null ? void 0 : _d.y))\n break;\n if (i === pairData.length - 1)\n return \"no-op\";\n }\n }\n return status;\n}\nfunction prepareLinePathPropertyAnimation(status, visibleToggleMode) {\n const phase = visibleToggleMode === \"none\" ? \"updated\" : status;\n const result = {\n fromFn: (_path) => {\n let mixin;\n if (status === \"removed\") {\n mixin = { finish: { visible: false } };\n } else if (status === \"added\") {\n mixin = { start: { visible: true } };\n } else {\n mixin = {};\n }\n return __spreadValues({ phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[phase] }, mixin);\n },\n toFn: (_path) => {\n return { phase: NODE_UPDATE_STATE_TO_PHASE_MAPPING[phase] };\n }\n };\n if (visibleToggleMode === \"fade\") {\n return {\n fromFn: (path) => {\n const opacity = status === \"added\" ? 0 : path.opacity;\n return __spreadValues({ opacity }, result.fromFn(path));\n },\n toFn: (path) => {\n const opacity = status === \"removed\" ? 0 : 1;\n return __spreadValues({ opacity }, result.toFn(path));\n }\n };\n }\n return result;\n}\nfunction prepareLinePathAnimationFns(newData, oldData, pairData, visibleToggleMode, render) {\n const status = determinePathStatus(newData, oldData, pairData);\n const removePhaseFn = (ratio, path) => {\n render(pairData, { move: 0, out: ratio }, path);\n };\n const updatePhaseFn = (ratio, path) => {\n render(pairData, { move: ratio }, path);\n };\n const addPhaseFn = (ratio, path) => {\n render(pairData, { move: 1, in: ratio }, path);\n };\n const pathProperties = prepareLinePathPropertyAnimation(status, visibleToggleMode);\n return { status, path: { addPhaseFn, updatePhaseFn, removePhaseFn }, pathProperties };\n}\nfunction prepareLinePathAnimation(newData, oldData, diff2) {\n var _a, _b, _c;\n const isCategoryBased = ((_a = newData.scales.x) == null ? void 0 : _a.type) === \"category\";\n const wasCategoryBased = ((_b = oldData.scales.x) == null ? void 0 : _b.type) === \"category\";\n if (isCategoryBased !== wasCategoryBased) {\n return;\n }\n const { result: pairData, resultMap: pairMap } = isCategoryBased ? pairCategoryData(newData, oldData, diff2) : pairContinuousData(newData, oldData);\n let status = \"updated\";\n if (oldData.visible && !newData.visible) {\n status = \"removed\";\n } else if (!oldData.visible && newData.visible) {\n status = \"added\";\n }\n if (pairData === void 0 || pairMap === void 0) {\n return;\n }\n const hasMotion = ((_c = diff2 == null ? void 0 : diff2.changed) != null ? _c : true) || scalesChanged(newData, oldData) || status !== \"updated\";\n const pathFns = prepareLinePathAnimationFns(newData, oldData, pairData, \"fade\", renderPartialPath);\n const marker = prepareMarkerAnimation(pairMap, status);\n return __spreadProps(__spreadValues({}, pathFns), { marker, hasMotion });\n}\n\n// packages/ag-charts-community/src/chart/series/cartesian/areaUtil.ts\nvar AreaSeriesTag = /* @__PURE__ */ ((AreaSeriesTag2) => {\n AreaSeriesTag2[AreaSeriesTag2[\"Fill\"] = 0] = \"Fill\";\n AreaSeriesTag2[AreaSeriesTag2[\"Stroke\"] = 1] = \"Stroke\";\n AreaSeriesTag2[AreaSeriesTag2[\"Marker\"] = 2] = \"Marker\";\n AreaSeriesTag2[AreaSeriesTag2[\"Label\"] = 3] = \"Label\";\n return AreaSeriesTag2;\n})(AreaSeriesTag || {});\nfunction splitFillPoints(context) {\n const { points, phantomPoints } = context.fillData;\n return { top: points, bottom: phantomPoints };\n}\nfunction prepPoints(key, ctx, points) {\n return {\n scales: ctx.scales,\n nodeData: points[key],\n visible: ctx.visible\n };\n}\nfunction pairFillCategoryData(newData, oldData, diff2) {\n const oldPoints = splitFillPoints(oldData);\n const newPoints = splitFillPoints(newData);\n const pairOpts = { multiDatum: true };\n return {\n top: pairCategoryData(\n prepPoints(\"top\", newData, newPoints),\n prepPoints(\"top\", oldData, oldPoints),\n diff2,\n pairOpts\n ),\n bottom: pairCategoryData(\n prepPoints(\"bottom\", newData, newPoints),\n prepPoints(\"bottom\", oldData, oldPoints),\n diff2,\n pairOpts\n )\n };\n}\nfunction pairFillContinuousData(newData, oldData) {\n const oldPoints = splitFillPoints(oldData);\n const newPoints = splitFillPoints(newData);\n return {\n top: pairContinuousData(prepPoints(\"top\", newData, newPoints), prepPoints(\"top\", oldData, oldPoints)),\n bottom: pairContinuousData(prepPoints(\"bottom\", newData, newPoints), prepPoints(\"bottom\", oldData, oldPoints))\n };\n}\nfunction prepareAreaPathAnimation(newData, oldData, diff2) {\n var _a, _b;\n const isCategoryBased = ((_a = newData.scales.x) == null ? void 0 : _a.type) === \"category\";\n const wasCategoryBased = ((_b = oldData.scales.x) == null ? void 0 : _b.type) === \"category\";\n if (isCategoryBased !== wasCategoryBased) {\n return;\n }\n let status = \"updated\";\n if (oldData.visible && !newData.visible) {\n status = \"removed\";\n } else if (!oldData.visible && newData.visible) {\n status = \"added\";\n }\n const prepareMarkerPairs = () => {\n if (isCategoryBased) {\n return pairCategoryData(newData, oldData, diff2, { backfillSplitMode: \"static\", multiDatum: true });\n }\n return pairContinuousData(newData, oldData, { backfillSplitMode: \"static\" });\n };\n const prepareFillPairs = () => {\n if (isCategoryBased) {\n return pairFillCategoryData(newData, oldData, diff2);\n }\n return pairFillContinuousData(newData, oldData);\n };\n const { resultMap: markerPairMap } = prepareMarkerPairs();\n const { top, bottom } = prepareFillPairs();\n if (markerPairMap === void 0 || top.result === void 0 || bottom.result === void 0) {\n return;\n }\n const pairData = [...top.result, ...bottom.result.reverse()];\n const stackVisible = oldData.stackVisible ? newData.stackVisible : false;\n const fadeMode = stackVisible ? \"none\" : \"fade\";\n const fill = prepareLinePathAnimationFns(newData, oldData, pairData, fadeMode, renderPartialPath);\n const marker = prepareMarkerAnimation(markerPairMap, status);\n return { status: fill.status, fill, marker };\n}\n\n// packages/ag-charts-community/src/chart/series/cartesian/areaSeries.ts\nvar AreaSeries = class extends CartesianSeries {\n constructor(moduleCtx) {\n super({\n moduleCtx,\n directionKeys: DEFAULT_CARTESIAN_DIRECTION_KEYS,\n directionNames: DEFAULT_CARTESIAN_DIRECTION_NAMES,\n pathsPerSeries: 2,\n pathsZIndexSubOrderOffset: [0, 1e3],\n hasMarkers: true,\n markerSelectionGarbageCollection: false,\n pickModes: [1 /* NEAREST_BY_MAIN_AXIS_FIRST */, 0 /* EXACT_SHAPE_MATCH */],\n animationResetFns: {\n path: buildResetPathFn({ getOpacity: () => this.getOpacity() }),\n label: resetLabelFn,\n marker: (node, datum) => __spreadValues(__spreadValues({}, resetMarkerFn(node)), resetMarkerPositionFn(node, datum))\n }\n });\n this.properties = new AreaSeriesProperties();\n }\n processData(dataController) {\n return __async(this, null, function* () {\n var _a, _b;\n if (this.data == null || !this.properties.isValid()) {\n return;\n }\n const { data, visible, seriesGrouping: { groupIndex = this.id, stackCount = 1 } = {} } = this;\n const { xKey, yKey, connectMissingData, normalizedTo } = this.properties;\n const animationEnabled = !this.ctx.animationManager.isSkipped();\n const xScale = (_a = this.axes[\"x\" /* X */]) == null ? void 0 : _a.scale;\n const yScale = (_b = this.axes[\"y\" /* Y */]) == null ? void 0 : _b.scale;\n const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });\n const ids = [\n `area-stack-${groupIndex}-yValues`,\n `area-stack-${groupIndex}-yValues-trailing`,\n `area-stack-${groupIndex}-yValues-prev`,\n `area-stack-${groupIndex}-yValues-trailing-prev`,\n `area-stack-${groupIndex}-yValues-marker`\n ];\n const extraProps = [];\n if (isDefined(normalizedTo)) {\n extraProps.push(normaliseGroupTo([ids[0], ids[1], ids[4]], normalizedTo, \"range\"));\n extraProps.push(normaliseGroupTo([ids[2], ids[3]], normalizedTo, \"range\"));\n }\n if (!isContinuousX && animationEnabled && this.processedData) {\n extraProps.push(diff(this.processedData));\n }\n if (animationEnabled) {\n extraProps.push(animationValidation());\n }\n const common = { invalidValue: null };\n if (connectMissingData && stackCount > 1) {\n common.invalidValue = 0;\n }\n if (!visible) {\n common.forceValue = 0;\n }\n yield this.requestDataModel(dataController, data, {\n props: [\n keyProperty(xKey, xScaleType, { id: \"xValue\" }),\n valueProperty(yKey, yScaleType, __spreadValues({ id: `yValueRaw` }, common)),\n ...groupAccumulativeValueProperty(\n yKey,\n \"window\",\n \"current\",\n __spreadProps(__spreadValues({\n id: `yValueEnd`\n }, common), {\n groupId: ids[0]\n }),\n yScaleType\n ),\n ...groupAccumulativeValueProperty(\n yKey,\n \"window-trailing\",\n \"current\",\n __spreadProps(__spreadValues({\n id: `yValueStart`\n }, common), {\n groupId: ids[1]\n }),\n yScaleType\n ),\n ...groupAccumulativeValueProperty(\n yKey,\n \"window\",\n \"last\",\n __spreadProps(__spreadValues({\n id: `yValuePreviousEnd`\n }, common), {\n groupId: ids[2]\n }),\n yScaleType\n ),\n ...groupAccumulativeValueProperty(\n yKey,\n \"window-trailing\",\n \"last\",\n __spreadProps(__spreadValues({\n id: `yValuePreviousStart`\n }, common), {\n groupId: ids[3]\n }),\n yScaleType\n ),\n ...groupAccumulativeValueProperty(\n yKey,\n \"normal\",\n \"current\",\n __spreadProps(__spreadValues({\n id: `yValueCumulative`\n }, common), {\n groupId: ids[4]\n }),\n yScaleType\n ),\n ...extraProps\n ],\n groupByKeys: true,\n groupByData: false\n });\n this.animationState.transition(\"updateData\");\n });\n }\n getSeriesDomain(direction) {\n const { processedData, dataModel, axes } = this;\n if (!processedData || !dataModel || processedData.data.length === 0)\n return [];\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);\n const keys = dataModel.getDomain(this, `xValue`, \"key\", processedData);\n const yExtent = dataModel.getDomain(this, `yValueEnd`, \"value\", processedData);\n if (direction === \"x\" /* X */) {\n if ((keyDef == null ? void 0 : keyDef.def.type) === \"key\" && keyDef.def.valueType === \"category\") {\n return keys;\n }\n return fixNumericExtent(extent(keys), xAxis);\n } else if (yAxis instanceof LogAxis || yAxis instanceof TimeAxis) {\n return fixNumericExtent(yExtent, yAxis);\n } else {\n const fixedYExtent = [yExtent[0] > 0 ? 0 : yExtent[0], yExtent[1] < 0 ? 0 : yExtent[1]];\n return fixNumericExtent(fixedYExtent, yAxis);\n }\n }\n createNodeData() {\n return __async(this, null, function* () {\n var _a;\n const { axes, data, processedData: { data: groupedData } = {}, dataModel } = this;\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n if (!xAxis || !yAxis || !data || !dataModel || !this.properties.isValid()) {\n return;\n }\n const {\n yKey,\n xKey,\n marker,\n label,\n fill: seriesFill,\n stroke: seriesStroke,\n connectMissingData\n } = this.properties;\n const { scale: xScale } = xAxis;\n const { scale: yScale } = yAxis;\n const { isContinuousY } = this.getScaleInformation({ xScale, yScale });\n const xOffset = ((_a = xScale.bandwidth) != null ? _a : 0) / 2;\n const defs = dataModel.resolveProcessedDataDefsByIds(this, [\n `yValueStart`,\n `yValueEnd`,\n `yValueRaw`,\n `yValuePreviousStart`,\n `yValuePreviousEnd`,\n `yValueCumulative`\n ]);\n const createMovePoint = (plainPoint) => __spreadProps(__spreadValues({}, plainPoint), {\n point: __spreadProps(__spreadValues({}, plainPoint.point), { moveTo: true })\n });\n const createPathCoordinates = (xValue, lastYEnd, yEnd) => {\n const x = xScale.convert(xValue) + xOffset;\n const prevYCoordinate = yScale.convert(lastYEnd);\n const currYCoordinate = yScale.convert(yEnd);\n return [\n { point: { x, y: currYCoordinate }, yValue: yEnd, xValue },\n { point: { x, y: prevYCoordinate }, yValue: lastYEnd, xValue }\n ];\n };\n const createMarkerCoordinate = (xDatum, yEnd, rawYDatum) => {\n let currY;\n if (isDefined(this.properties.normalizedTo) ? isContinuousY && isContinuous(rawYDatum) : !isNaN(rawYDatum)) {\n currY = yEnd;\n }\n return {\n x: xScale.convert(xDatum) + xOffset,\n y: yScale.convert(currY),\n size: marker.size\n };\n };\n const itemId = yKey;\n const labelData = [];\n const markerData = [];\n const { visibleSameStackCount } = this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);\n const context = {\n itemId,\n fillData: { itemId, points: [], phantomPoints: [] },\n strokeData: { itemId, points: [] },\n labelData,\n nodeData: markerData,\n scales: this.calculateScaling(),\n visible: this.visible,\n stackVisible: visibleSameStackCount > 0\n };\n const fillPoints = context.fillData.points;\n const fillPhantomPoints = context.fillData.phantomPoints;\n const strokePoints = context.strokeData.points;\n let datumIdx = -1;\n let lastXDatum;\n let lastYDatum = -Infinity;\n groupedData == null ? void 0 : groupedData.forEach((datumGroup) => {\n const {\n keys,\n keys: [xDatum],\n datum: datumArray,\n values: valuesArray\n } = datumGroup;\n valuesArray.forEach((values, valueIdx) => {\n var _a2, _b, _c;\n datumIdx++;\n const seriesDatum = datumArray[valueIdx];\n const dataValues = dataModel.resolveProcessedDataDefsValues(defs, { keys, values });\n const { yValueRaw: yDatum, yValueCumulative } = dataValues;\n let { yValueStart, yValueEnd, yValuePreviousStart, yValuePreviousEnd } = dataValues;\n const validPoint = yDatum != null;\n const point = createMarkerCoordinate(xDatum, +yValueCumulative, yDatum);\n if (validPoint && marker) {\n markerData.push({\n index: datumIdx,\n series: this,\n itemId,\n datum: seriesDatum,\n midPoint: { x: point.x, y: point.y },\n cumulativeValue: yValueEnd,\n yValue: yDatum,\n xValue: xDatum,\n yKey,\n xKey,\n point,\n fill: (_a2 = marker.fill) != null ? _a2 : seriesFill,\n stroke: (_b = marker.stroke) != null ? _b : seriesStroke,\n strokeWidth: (_c = marker.strokeWidth) != null ? _c : this.getStrokeWidth(this.properties.strokeWidth)\n });\n }\n if (validPoint && label) {\n const labelText = this.getLabelText(\n label,\n {\n value: yDatum,\n datum: seriesDatum,\n xKey,\n yKey,\n xName: this.properties.xName,\n yName: this.properties.yName\n },\n (value) => isFiniteNumber(value) ? value.toFixed(2) : String(value)\n );\n labelData.push({\n index: datumIdx,\n series: this,\n itemId: yKey,\n datum: seriesDatum,\n x: point.x,\n y: point.y,\n label: labelText ? {\n text: labelText,\n fontStyle: label.fontStyle,\n fontWeight: label.fontWeight,\n fontSize: label.fontSize,\n fontFamily: label.fontFamily,\n textAlign: \"center\",\n textBaseline: \"bottom\",\n fill: label.color\n } : void 0\n });\n }\n const xValid = lastXDatum != null && xDatum != null;\n const yValid = lastYDatum != null && validPoint;\n if (!yValid) {\n yValueStart = yValueStart != null ? yValueStart : 0;\n yValueEnd = yValueStart != null ? yValueStart : 0;\n yValuePreviousStart = yValuePreviousStart != null ? yValuePreviousStart : 0;\n yValuePreviousEnd = yValuePreviousStart != null ? yValuePreviousStart : 0;\n }\n const [prevTop, prevBottom] = createPathCoordinates(lastXDatum, yValuePreviousStart, yValuePreviousEnd);\n const [top, bottom] = createPathCoordinates(xDatum, yValueStart, yValueEnd);\n if (xValid && (!connectMissingData || yValid)) {\n fillPoints.push(prevTop, top);\n fillPhantomPoints.push(prevBottom, bottom);\n }\n if (yValid && datumIdx > 0) {\n strokePoints.push(createMovePoint(prevTop), top);\n }\n lastXDatum = xDatum;\n lastYDatum = yDatum;\n });\n });\n if (strokePoints.length > 0) {\n strokePoints[0] = createMovePoint(strokePoints[0]);\n }\n return context;\n });\n }\n isPathOrSelectionDirty() {\n return this.properties.marker.isDirty();\n }\n markerFactory() {\n const { shape } = this.properties.marker;\n const MarkerShape = getMarker(shape);\n return new MarkerShape();\n }\n updatePathNodes(opts) {\n return __async(this, null, function* () {\n const { opacity, visible, animationEnabled } = opts;\n const [fill, stroke] = opts.paths;\n const strokeWidth = this.getStrokeWidth(this.properties.strokeWidth);\n stroke.setProperties({\n tag: 1 /* Stroke */,\n fill: void 0,\n lineJoin: stroke.lineCap = \"round\",\n pointerEvents: 1 /* None */,\n stroke: this.properties.stroke,\n strokeWidth,\n strokeOpacity: this.properties.strokeOpacity,\n lineDash: this.properties.lineDash,\n lineDashOffset: this.properties.lineDashOffset,\n opacity,\n visible\n });\n fill.setProperties({\n tag: 0 /* Fill */,\n stroke: void 0,\n lineJoin: \"round\",\n pointerEvents: 1 /* None */,\n fill: this.properties.fill,\n fillOpacity: this.properties.fillOpacity,\n lineDash: this.properties.lineDash,\n lineDashOffset: this.properties.lineDashOffset,\n strokeOpacity: this.properties.strokeOpacity,\n fillShadow: this.properties.shadow,\n opacity,\n visible: visible || animationEnabled,\n strokeWidth\n });\n updateClipPath(this, stroke);\n updateClipPath(this, fill);\n });\n }\n updatePaths(opts) {\n return __async(this, null, function* () {\n this.updateAreaPaths(opts.paths, opts.contextData);\n });\n }\n updateAreaPaths(paths, contextData) {\n this.updateFillPath(paths, contextData);\n this.updateStrokePath(paths, contextData);\n }\n updateFillPath(paths, contextData) {\n const { fillData } = contextData;\n const [fill] = paths;\n const { path: fillPath } = fill;\n fillPath.clear(true);\n let lastPoint;\n for (const { point } of iterate(fillData.points, iterateReverseArray(fillData.phantomPoints))) {\n if (point.moveTo) {\n fillPath.moveTo(point.x, point.y);\n } else if ((lastPoint == null ? void 0 : lastPoint.y) !== point.y) {\n if (lastPoint) {\n fillPath.lineTo(lastPoint.x, lastPoint.y);\n }\n fillPath.lineTo(point.x, point.y);\n }\n lastPoint = point;\n }\n if (lastPoint) {\n fillPath.lineTo(lastPoint.x, lastPoint.y);\n }\n fillPath.closePath();\n fill.checkPathDirty();\n }\n updateStrokePath(paths, contextData) {\n const { strokeData } = contextData;\n const [, stroke] = paths;\n const { path: strokePath } = stroke;\n strokePath.clear(true);\n for (const { point } of strokeData.points) {\n if (point.moveTo) {\n strokePath.moveTo(point.x, point.y);\n } else {\n strokePath.lineTo(point.x, point.y);\n }\n }\n stroke.checkPathDirty();\n }\n updateMarkerSelection(opts) {\n return __async(this, null, function* () {\n const { nodeData, markerSelection } = opts;\n if (this.properties.marker.isDirty()) {\n markerSelection.clear();\n markerSelection.cleanup();\n }\n return markerSelection.update(this.properties.marker.enabled ? nodeData : []);\n });\n }\n updateMarkerNodes(opts) {\n return __async(this, null, function* () {\n const { markerSelection, isHighlight: highlighted } = opts;\n const { xKey, yKey, marker, fill, stroke, strokeWidth, fillOpacity, strokeOpacity, highlightStyle } = this.properties;\n const baseStyle = mergeDefaults(highlighted && highlightStyle.item, marker.getStyle(), {\n fill,\n stroke,\n strokeWidth,\n fillOpacity,\n strokeOpacity\n });\n markerSelection.each((node, datum) => {\n this.updateMarkerStyle(node, marker, { datum, highlighted, xKey, yKey }, baseStyle);\n });\n if (!highlighted) {\n this.properties.marker.markClean();\n }\n });\n }\n updateLabelSelection(opts) {\n return __async(this, null, function* () {\n const { labelData, labelSelection } = opts;\n return labelSelection.update(labelData, (text) => {\n text.tag = 3 /* Label */;\n });\n });\n }\n updateLabelNodes(opts) {\n return __async(this, null, function* () {\n const { labelSelection } = opts;\n const { enabled: labelEnabled, fontStyle, fontWeight, fontSize, fontFamily, color } = this.properties.label;\n labelSelection.each((text, datum) => {\n const { x, y, label } = datum;\n if (label && labelEnabled && this.visible) {\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.textAlign = label.textAlign;\n text.textBaseline = label.textBaseline;\n text.text = label.text;\n text.x = x;\n text.y = y - 10;\n text.fill = color;\n text.visible = true;\n } else {\n text.visible = false;\n }\n });\n });\n }\n getTooltipHtml(nodeDatum) {\n const { id: seriesId, axes, dataModel } = this;\n const { xKey, xName, yName, tooltip, marker } = this.properties;\n const { yKey, xValue, yValue, datum, itemId } = nodeDatum;\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n if (!this.properties.isValid() || !(xAxis && yAxis && isFiniteNumber(yValue)) || !dataModel) {\n return EMPTY_TOOLTIP_CONTENT;\n }\n const xString = xAxis.formatDatum(xValue);\n const yString = yAxis.formatDatum(yValue);\n const title = sanitizeHtml(yName);\n const content = sanitizeHtml(xString + \": \" + yString);\n const baseStyle = mergeDefaults({ fill: this.properties.fill }, marker.getStyle(), {\n stroke: this.properties.stroke,\n strokeWidth: this.properties.strokeWidth\n });\n const { fill: color } = this.getMarkerStyle(\n marker,\n { datum: nodeDatum, xKey, yKey, highlighted: false },\n baseStyle\n );\n return tooltip.toTooltipHtml(\n { title, content, backgroundColor: color },\n {\n datum,\n itemId,\n xKey,\n xName,\n yKey,\n yName,\n color,\n title,\n seriesId\n }\n );\n }\n getLegendData(legendType) {\n var _a, _b, _c, _d;\n if (!((_a = this.data) == null ? void 0 : _a.length) || !this.properties.isValid() || legendType !== \"category\") {\n return [];\n }\n const { yKey, yName, fill, stroke, fillOpacity, strokeOpacity, strokeWidth, lineDash, marker, visible } = this.properties;\n const useAreaFill = !marker.enabled || marker.fill === void 0;\n return [\n {\n legendType,\n id: this.id,\n itemId: yKey,\n seriesId: this.id,\n enabled: visible,\n label: {\n text: yName != null ? yName : yKey\n },\n marker: {\n shape: marker.shape,\n fill: useAreaFill ? fill : marker.fill,\n fillOpacity: useAreaFill ? fillOpacity : marker.fillOpacity,\n stroke: (_b = marker.stroke) != null ? _b : stroke,\n strokeOpacity: (_c = marker.strokeOpacity) != null ? _c : strokeOpacity,\n strokeWidth: (_d = marker.strokeWidth) != null ? _d : 0,\n enabled: marker.enabled || strokeWidth <= 0\n },\n line: {\n stroke,\n strokeOpacity,\n strokeWidth,\n lineDash\n }\n }\n ];\n }\n animateEmptyUpdateReady(animationData) {\n const { markerSelection, labelSelection, contextData, paths } = animationData;\n const { animationManager } = this.ctx;\n this.updateAreaPaths(paths, contextData);\n pathSwipeInAnimation(this, animationManager, ...paths);\n resetMotion([markerSelection], resetMarkerPositionFn);\n markerSwipeScaleInAnimation(this, animationManager, markerSelection);\n seriesLabelFadeInAnimation(this, \"labels\", animationManager, labelSelection);\n }\n animateReadyResize(animationData) {\n const { contextData, paths } = animationData;\n this.updateAreaPaths(paths, contextData);\n super.animateReadyResize(animationData);\n }\n animateWaitingUpdateReady(animationData) {\n var _a, _b;\n const { animationManager } = this.ctx;\n const { markerSelection, labelSelection, contextData, paths, previousContextData } = animationData;\n const [fill, stroke] = paths;\n if (fill == null && stroke == null)\n return;\n super.resetAllAnimation(animationData);\n const update = () => {\n this.updateAreaPaths(paths, contextData);\n this.updateStrokePath(paths, contextData);\n };\n const skip = () => {\n animationManager.skipCurrentBatch();\n update();\n };\n if (contextData == null || previousContextData == null) {\n update();\n markerFadeInAnimation(this, animationManager, \"added\", markerSelection);\n pathFadeInAnimation(this, \"fill_path_properties\", animationManager, \"add\", fill);\n pathFadeInAnimation(this, \"stroke\", animationManager, \"trailing\", stroke);\n seriesLabelFadeInAnimation(this, \"labels\", animationManager, labelSelection);\n return;\n }\n const fns = prepareAreaPathAnimation(contextData, previousContextData, (_b = (_a = this.processedData) == null ? void 0 : _a.reduced) == null ? void 0 : _b.diff);\n if (fns === void 0) {\n skip();\n return;\n } else if (fns.status === \"no-op\") {\n return;\n }\n markerFadeInAnimation(this, animationManager, void 0, markerSelection);\n fromToMotion(this.id, \"fill_path_properties\", animationManager, [fill], fns.fill.pathProperties);\n pathMotion(this.id, \"fill_path_update\", animationManager, [fill], fns.fill.path);\n this.updateStrokePath(paths, contextData);\n pathFadeInAnimation(this, \"stroke\", animationManager, \"trailing\", stroke);\n seriesLabelFadeInAnimation(this, \"labels\", animationManager, labelSelection);\n }\n isLabelEnabled() {\n return this.properties.label.enabled;\n }\n nodeFactory() {\n return new Group();\n }\n getFormattedMarkerStyle(datum) {\n const { xKey, yKey } = datum;\n return this.getMarkerStyle(this.properties.marker, { datum, xKey, yKey, highlighted: true });\n }\n computeFocusBounds(opts) {\n return computeMarkerFocusBounds(this, opts);\n }\n};\nAreaSeries.className = \"AreaSeries\";\nAreaSeries.type = \"area\";\n\n// packages/ag-charts-community/src/chart/series/cartesian/areaSeriesModule.ts\nvar AreaSeriesModule = {\n type: \"series\",\n optionsKey: \"series[]\",\n packageType: \"community\",\n chartTypes: [\"cartesian\"],\n identifier: \"area\",\n instanceConstructor: AreaSeries,\n stackable: true,\n defaultAxes: [\n {\n type: \"number\" /* NUMBER */,\n position: \"left\" /* LEFT */\n },\n {\n type: \"category\" /* CATEGORY */,\n position: \"bottom\" /* BOTTOM */\n }\n ],\n themeTemplate: {\n series: {\n __extends__: EXTENDS_SERIES_DEFAULTS,\n nodeClickRange: \"nearest\",\n tooltip: { position: { type: \"node\" } },\n fillOpacity: 0.8,\n strokeOpacity: 1,\n strokeWidth: 0,\n lineDash: [0],\n lineDashOffset: 0,\n shadow: {\n enabled: false,\n color: DEFAULT_SHADOW_COLOUR,\n xOffset: 3,\n yOffset: 3,\n blur: 5\n },\n marker: {\n __extends__: EXTENDS_CARTESIAN_MARKER_DEFAULTS,\n enabled: false,\n fillOpacity: 1,\n strokeOpacity: 1,\n strokeWidth: 0\n },\n label: {\n enabled: false,\n fontSize: 12,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_LABEL_COLOUR\n }\n }\n },\n paletteFactory: (params) => {\n const { marker } = markerPaletteFactory(params);\n return { fill: marker.fill, stroke: marker.stroke, marker };\n }\n};\n\n// packages/ag-charts-community/src/chart/series/cartesian/quadtreeUtil.ts\nfunction* childrenIter(parent) {\n for (const node of parent.children) {\n yield node;\n }\n}\nfunction addHitTestersToQuadtree(quadtree, hitTesters) {\n for (const node of hitTesters) {\n const datum = node.datum;\n if (datum === void 0) {\n Logger.error(\"undefined datum\");\n } else {\n quadtree.addValue(node, datum);\n }\n }\n}\nfunction findQuadtreeMatch(series, point) {\n const { x, y } = series.contentGroup.transformPoint(point.x, point.y);\n const { nearest, distanceSquared: distanceSquared2 } = series.getQuadTree().find(x, y);\n if (nearest !== void 0) {\n return { datum: nearest.value, distance: Math.sqrt(distanceSquared2) };\n }\n return void 0;\n}\n\n// packages/ag-charts-community/src/chart/series/cartesian/abstractBarSeries.ts\nvar AbstractBarSeriesProperties = class extends CartesianSeriesProperties {\n constructor() {\n super(...arguments);\n this.direction = \"vertical\";\n }\n};\n__decorateClass([\n Validate(DIRECTION)\n], AbstractBarSeriesProperties.prototype, \"direction\", 2);\nvar AbstractBarSeries = class extends CartesianSeries {\n constructor() {\n super(...arguments);\n /**\n * Used to get the position of bars within each group.\n */\n this.groupScale = new BandScale();\n this.smallestDataInterval = void 0;\n }\n getBandScalePadding() {\n return { inner: 0.2, outer: 0.1 };\n }\n shouldFlipXY() {\n return !this.isVertical();\n }\n isVertical() {\n return this.properties.direction === \"vertical\";\n }\n getBarDirection() {\n return this.shouldFlipXY() ? \"x\" /* X */ : \"y\" /* Y */;\n }\n getCategoryDirection() {\n return this.shouldFlipXY() ? \"y\" /* Y */ : \"x\" /* X */;\n }\n getValueAxis() {\n const direction = this.getBarDirection();\n return this.axes[direction];\n }\n getCategoryAxis() {\n const direction = this.getCategoryDirection();\n return this.axes[direction];\n }\n updateGroupScale(xAxis) {\n const {\n groupScale,\n smallestDataInterval,\n ctx: { seriesStateManager }\n } = this;\n const xScale = xAxis.scale;\n const xBandWidth = ContinuousScale.is(xScale) ? xScale.calcBandwidth(smallestDataInterval) : xScale.bandwidth;\n const domain = [];\n const { index: groupIndex, visibleGroupCount } = seriesStateManager.getVisiblePeerGroupIndex(this);\n for (let groupIdx = 0; groupIdx < visibleGroupCount; groupIdx++) {\n domain.push(String(groupIdx));\n }\n groupScale.domain = domain;\n groupScale.range = [0, xBandWidth != null ? xBandWidth : 0];\n if (xAxis instanceof CategoryAxis) {\n groupScale.paddingInner = xAxis.groupPaddingInner;\n } else if (xAxis instanceof GroupedCategoryAxis) {\n groupScale.padding = 0.1;\n } else {\n groupScale.padding = 0;\n }\n groupScale.round = groupScale.padding !== 0;\n const barWidth = groupScale.bandwidth >= 1 ? (\n // Pixel-rounded value for low-volume bar charts.\n groupScale.bandwidth\n ) : (\n // Handle high-volume bar charts gracefully.\n groupScale.rawBandwidth\n );\n return { barWidth, groupIndex };\n }\n resolveKeyDirection(direction) {\n if (this.getBarDirection() === \"x\" /* X */) {\n if (direction === \"x\" /* X */) {\n return \"y\" /* Y */;\n }\n return \"x\" /* X */;\n }\n return direction;\n }\n initQuadTree(quadtree) {\n addHitTestersToQuadtree(quadtree, this.datumNodesIter());\n }\n pickNodeClosestDatum(point) {\n return findQuadtreeMatch(this, point);\n }\n};\n\n// packages/ag-charts-community/src/chart/series/cartesian/barSeriesProperties.ts\nvar BarSeriesLabel = class extends Label {\n constructor() {\n super(...arguments);\n this.placement = \"inside\";\n }\n};\n__decorateClass([\n Validate(PLACEMENT)\n], BarSeriesLabel.prototype, \"placement\", 2);\nvar BarSeriesProperties = class extends AbstractBarSeriesProperties {\n constructor() {\n super(...arguments);\n this.fill = \"#c16068\";\n this.fillOpacity = 1;\n this.stroke = \"#874349\";\n this.strokeWidth = 1;\n this.strokeOpacity = 1;\n this.lineDash = [0];\n this.lineDashOffset = 0;\n this.cornerRadius = 0;\n this.shadow = new DropShadow();\n this.label = new BarSeriesLabel();\n this.tooltip = new SeriesTooltip();\n }\n};\n__decorateClass([\n Validate(STRING)\n], BarSeriesProperties.prototype, \"xKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BarSeriesProperties.prototype, \"xName\", 2);\n__decorateClass([\n Validate(STRING)\n], BarSeriesProperties.prototype, \"yKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BarSeriesProperties.prototype, \"yName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BarSeriesProperties.prototype, \"stackGroup\", 2);\n__decorateClass([\n Validate(NUMBER, { optional: true })\n], BarSeriesProperties.prototype, \"normalizedTo\", 2);\n__decorateClass([\n Validate(COLOR_STRING)\n], BarSeriesProperties.prototype, \"fill\", 2);\n__decorateClass([\n Validate(RATIO)\n], BarSeriesProperties.prototype, \"fillOpacity\", 2);\n__decorateClass([\n Validate(COLOR_STRING)\n], BarSeriesProperties.prototype, \"stroke\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], BarSeriesProperties.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(RATIO)\n], BarSeriesProperties.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n Validate(LINE_DASH)\n], BarSeriesProperties.prototype, \"lineDash\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], BarSeriesProperties.prototype, \"lineDashOffset\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], BarSeriesProperties.prototype, \"cornerRadius\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], BarSeriesProperties.prototype, \"formatter\", 2);\n__decorateClass([\n Validate(OBJECT, { optional: true })\n], BarSeriesProperties.prototype, \"shadow\", 2);\n__decorateClass([\n Validate(OBJECT)\n], BarSeriesProperties.prototype, \"label\", 2);\n__decorateClass([\n Validate(OBJECT)\n], BarSeriesProperties.prototype, \"tooltip\", 2);\n\n// packages/ag-charts-community/src/chart/series/cartesian/barUtil.ts\nfunction updateRect({ rect, config }) {\n const {\n crisp = true,\n fill,\n stroke,\n strokeWidth,\n fillOpacity,\n strokeOpacity,\n lineDash,\n lineDashOffset,\n fillShadow,\n cornerRadius = 0,\n topLeftCornerRadius = true,\n topRightCornerRadius = true,\n bottomRightCornerRadius = true,\n bottomLeftCornerRadius = true,\n visible = true\n } = config;\n rect.crisp = crisp;\n rect.fill = fill;\n rect.stroke = stroke;\n rect.strokeWidth = strokeWidth;\n rect.fillOpacity = fillOpacity;\n rect.strokeOpacity = strokeOpacity;\n rect.lineDash = lineDash;\n rect.lineDashOffset = lineDashOffset;\n rect.fillShadow = fillShadow;\n rect.topLeftCornerRadius = topLeftCornerRadius ? cornerRadius : 0;\n rect.topRightCornerRadius = topRightCornerRadius ? cornerRadius : 0;\n rect.bottomRightCornerRadius = bottomRightCornerRadius ? cornerRadius : 0;\n rect.bottomLeftCornerRadius = bottomLeftCornerRadius ? cornerRadius : 0;\n rect.visible = visible;\n}\nfunction getRectConfig(_a) {\n var _b = _a, {\n datum,\n isHighlighted,\n style,\n highlightStyle,\n formatter,\n seriesId,\n ctx: { callbackCache }\n } = _b, opts = __objRest(_b, [\n \"datum\",\n \"isHighlighted\",\n \"style\",\n \"highlightStyle\",\n \"formatter\",\n \"seriesId\",\n \"ctx\"\n ]);\n var _a2, _b2, _c, _d, _e, _f;\n const { fill, fillOpacity, stroke, strokeWidth } = mergeDefaults(isHighlighted && highlightStyle, style);\n const {\n strokeOpacity,\n fillShadow,\n lineDash,\n lineDashOffset,\n cornerRadius = 0,\n topLeftCornerRadius = true,\n topRightCornerRadius = true,\n bottomRightCornerRadius = true,\n bottomLeftCornerRadius = true\n } = style;\n let format2;\n if (formatter) {\n format2 = callbackCache.call(formatter, __spreadValues({\n datum: datum.datum,\n xKey: datum.xKey,\n fill,\n stroke,\n strokeWidth,\n cornerRadius,\n highlighted: isHighlighted,\n seriesId\n }, opts));\n }\n return {\n fill: (_a2 = format2 == null ? void 0 : format2.fill) != null ? _a2 : fill,\n stroke: (_b2 = format2 == null ? void 0 : format2.stroke) != null ? _b2 : stroke,\n strokeWidth: (_c = format2 == null ? void 0 : format2.strokeWidth) != null ? _c : strokeWidth,\n fillOpacity: (_d = format2 == null ? void 0 : format2.fillOpacity) != null ? _d : fillOpacity,\n strokeOpacity: (_e = format2 == null ? void 0 : format2.strokeOpacity) != null ? _e : strokeOpacity,\n lineDash,\n lineDashOffset,\n fillShadow,\n cornerRadius: (_f = format2 == null ? void 0 : format2.cornerRadius) != null ? _f : cornerRadius,\n topLeftCornerRadius,\n topRightCornerRadius,\n bottomRightCornerRadius,\n bottomLeftCornerRadius\n };\n}\nfunction checkCrisp(visibleRange = []) {\n const [visibleMin, visibleMax] = visibleRange;\n const isZoomed = visibleMin !== 0 || visibleMax !== 1;\n return !isZoomed;\n}\nvar isDatumNegative = (datum) => {\n var _a;\n return isNegative((_a = datum.yValue) != null ? _a : 0);\n};\nfunction collapsedStartingBarPosition(isVertical, axes, mode) {\n const { startingX, startingY } = getStartingValues(isVertical, axes);\n const calculate = (datum, prevDatum) => {\n let x = isVertical ? datum.x : startingX;\n let y = isVertical ? startingY : datum.y;\n let width = isVertical ? datum.width : 0;\n let height = isVertical ? 0 : datum.height;\n const { opacity } = datum;\n if (prevDatum && (isNaN(x) || isNaN(y))) {\n ({ x, y } = prevDatum);\n width = isVertical ? prevDatum.width : 0;\n height = isVertical ? 0 : prevDatum.height;\n if (isVertical && !isDatumNegative(prevDatum)) {\n y += prevDatum.height;\n } else if (!isVertical && isDatumNegative(prevDatum)) {\n x += prevDatum.width;\n }\n }\n let clipBBox;\n if (datum.clipBBox == null) {\n clipBBox = void 0;\n } else if (isDatumNegative(datum)) {\n clipBBox = isVertical ? new BBox(x, y - height, width, height) : new BBox(x - width, y, width, height);\n } else {\n clipBBox = new BBox(x, y, width, height);\n }\n return { x, y, width, height, clipBBox, opacity };\n };\n return { isVertical, calculate, mode };\n}\nfunction midpointStartingBarPosition(isVertical, mode) {\n return {\n isVertical,\n calculate: (datum) => {\n return {\n x: isVertical ? datum.x : datum.x + datum.width / 2,\n y: isVertical ? datum.y + datum.height / 2 : datum.y,\n width: isVertical ? datum.width : 0,\n height: isVertical ? 0 : datum.height,\n clipBBox: datum.clipBBox,\n opacity: datum.opacity\n };\n },\n mode\n };\n}\nfunction prepareBarAnimationFunctions(initPos) {\n const isRemoved = (datum) => datum == null || isNaN(datum.x) || isNaN(datum.y);\n const fromFn = (rect, datum, status) => {\n if (status === \"updated\" && isRemoved(datum)) {\n status = \"removed\";\n } else if (status === \"updated\" && isRemoved(rect.previousDatum)) {\n status = \"added\";\n }\n let source;\n if (status === \"added\" && rect.previousDatum == null && initPos.mode === \"fade\") {\n source = __spreadProps(__spreadValues({}, resetBarSelectionsFn(rect, datum)), { opacity: 0 });\n } else if (status === \"unknown\" || status === \"added\") {\n source = initPos.calculate(datum, rect.previousDatum);\n } else {\n source = {\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height,\n clipBBox: rect.clipBBox,\n opacity: rect.opacity\n };\n }\n const phase = NODE_UPDATE_STATE_TO_PHASE_MAPPING[status];\n return __spreadProps(__spreadValues({}, source), { phase });\n };\n const toFn = (rect, datum, status) => {\n let source;\n if (status === \"removed\" && rect.datum == null && initPos.mode === \"fade\") {\n source = __spreadProps(__spreadValues({}, resetBarSelectionsFn(rect, datum)), { opacity: 0 });\n } else if (status === \"removed\" || isRemoved(datum)) {\n source = initPos.calculate(datum, rect.previousDatum);\n } else {\n source = {\n x: datum.x,\n y: datum.y,\n width: datum.width,\n height: datum.height,\n clipBBox: datum.clipBBox,\n opacity: datum.opacity\n };\n }\n return source;\n };\n return { toFn, fromFn };\n}\nfunction getStartingValues(isVertical, axes) {\n const axis = axes[isVertical ? \"y\" /* Y */ : \"x\" /* X */];\n let startingX = Infinity;\n let startingY = 0;\n if (!axis) {\n return { startingX, startingY };\n }\n if (isVertical) {\n startingY = axis.scale.convert(ContinuousScale.is(axis.scale) ? 0 : Math.max(...axis.range));\n } else {\n startingX = axis.scale.convert(ContinuousScale.is(axis.scale) ? 0 : Math.min(...axis.range));\n }\n return { startingX, startingY };\n}\nfunction resetBarSelectionsFn(_node, { x, y, width, height, clipBBox, opacity }) {\n return { x, y, width, height, clipBBox, opacity };\n}\nfunction computeBarFocusBounds(datum, barGroup, seriesRect) {\n if (datum === void 0)\n return void 0;\n const { x, y, width, height } = datum;\n return barGroup.inverseTransformBBox(new BBox(x, y, width, height)).clip(seriesRect);\n}\n\n// packages/ag-charts-community/src/chart/series/cartesian/labelUtil.ts\nfunction updateLabelNode(textNode, label, labelDatum) {\n if (label.enabled && labelDatum) {\n const { x, y, text, textAlign, textBaseline } = labelDatum;\n const { color: fill, fontStyle, fontWeight, fontSize, fontFamily } = label;\n textNode.setProperties({\n visible: true,\n x,\n y,\n text,\n fill,\n fontStyle,\n fontWeight,\n fontSize,\n fontFamily,\n textAlign,\n textBaseline\n });\n } else {\n textNode.visible = false;\n }\n}\nfunction adjustLabelPlacement({\n isPositive,\n isVertical,\n placement,\n padding = 0,\n rect\n}) {\n let x = rect.x + rect.width / 2;\n let y = rect.y + rect.height / 2;\n let textAlign = \"center\";\n let textBaseline = \"middle\";\n switch (placement) {\n case \"start\": {\n if (isVertical) {\n y = isPositive ? rect.y + rect.height + padding : rect.y - padding;\n textBaseline = isPositive ? \"top\" : \"bottom\";\n } else {\n x = isPositive ? rect.x - padding : rect.x + rect.width + padding;\n textAlign = isPositive ? \"start\" : \"end\";\n }\n break;\n }\n case \"outside\":\n case \"end\": {\n if (isVertical) {\n y = isPositive ? rect.y - padding : rect.y + rect.height + padding;\n textBaseline = isPositive ? \"bottom\" : \"top\";\n } else {\n x = isPositive ? rect.x + rect.width + padding : rect.x - padding;\n textAlign = isPositive ? \"start\" : \"end\";\n }\n break;\n }\n }\n return { x, y, textAlign, textBaseline };\n}\n\n// packages/ag-charts-community/src/chart/series/cartesian/barSeries.ts\nvar BarSeries = class extends AbstractBarSeries {\n constructor(moduleCtx) {\n super({\n moduleCtx,\n directionKeys: DEFAULT_CARTESIAN_DIRECTION_KEYS,\n directionNames: DEFAULT_CARTESIAN_DIRECTION_NAMES,\n pickModes: [0 /* EXACT_SHAPE_MATCH */],\n pathsPerSeries: 0,\n hasHighlightedLabels: true,\n datumSelectionGarbageCollection: false,\n animationAlwaysUpdateSelections: true,\n animationResetFns: {\n datum: resetBarSelectionsFn,\n label: resetLabelFn\n }\n });\n this.properties = new BarSeriesProperties();\n }\n processData(dataController) {\n return __async(this, null, function* () {\n var _a, _b, _c;\n if (!this.properties.isValid() || !this.data) {\n return;\n }\n const { seriesGrouping: { groupIndex = this.id } = {}, data = [] } = this;\n const { xKey, yKey, normalizedTo } = this.properties;\n const animationEnabled = !this.ctx.animationManager.isSkipped();\n const xScale = (_a = this.getCategoryAxis()) == null ? void 0 : _a.scale;\n const yScale = (_b = this.getValueAxis()) == null ? void 0 : _b.scale;\n const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });\n const stackGroupName = `bar-stack-${groupIndex}-yValues`;\n const stackGroupTrailingName = `${stackGroupName}-trailing`;\n const extraProps = [];\n if (isFiniteNumber(normalizedTo)) {\n extraProps.push(\n normaliseGroupTo([stackGroupName, stackGroupTrailingName], Math.abs(normalizedTo), \"range\")\n );\n }\n if (animationEnabled && this.processedData) {\n extraProps.push(diff(this.processedData));\n }\n if (animationEnabled) {\n extraProps.push(animationValidation());\n }\n const visibleProps = this.visible ? {} : { forceValue: 0 };\n const { processedData } = yield this.requestDataModel(dataController, data, {\n props: [\n keyProperty(xKey, xScaleType, { id: \"xValue\" }),\n valueProperty(yKey, yScaleType, __spreadValues({ id: `yValue-raw`, invalidValue: null }, visibleProps)),\n ...groupAccumulativeValueProperty(\n yKey,\n \"normal\",\n \"current\",\n __spreadValues({\n id: `yValue-end`,\n rangeId: `yValue-range`,\n invalidValue: null,\n missingValue: 0,\n groupId: stackGroupName,\n separateNegative: true\n }, visibleProps),\n yScaleType\n ),\n ...groupAccumulativeValueProperty(\n yKey,\n \"trailing\",\n \"current\",\n __spreadValues({\n id: `yValue-start`,\n invalidValue: null,\n missingValue: 0,\n groupId: stackGroupTrailingName,\n separateNegative: true\n }, visibleProps),\n yScaleType\n ),\n ...isContinuousX ? [SMALLEST_KEY_INTERVAL] : [],\n ...extraProps\n ],\n groupByKeys: true,\n groupByData: false\n });\n this.smallestDataInterval = (_c = processedData.reduced) == null ? void 0 : _c.smallestKeyInterval;\n this.animationState.transition(\"updateData\");\n });\n }\n getSeriesDomain(direction) {\n var _a;\n const { processedData, dataModel, smallestDataInterval } = this;\n if (!processedData || !dataModel || processedData.data.length === 0)\n return [];\n const categoryAxis = this.getCategoryAxis();\n const valueAxis = this.getValueAxis();\n const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);\n const keys = dataModel.getDomain(this, `xValue`, \"key\", processedData);\n const yExtent = dataModel.getDomain(this, `yValue-end`, \"value\", processedData);\n if (direction === this.getCategoryDirection()) {\n if ((keyDef == null ? void 0 : keyDef.def.type) === \"key\" && keyDef.def.valueType === \"category\") {\n return keys;\n }\n const scalePadding = isFiniteNumber(smallestDataInterval) ? smallestDataInterval * 0.5 : 0;\n const keysExtent = (_a = extent(keys)) != null ? _a : [NaN, NaN];\n const d0 = keysExtent[0] + -scalePadding;\n const d1 = keysExtent[1] + scalePadding;\n return fixNumericExtent([d0, d1], categoryAxis);\n } else if (this.getValueAxis() instanceof LogAxis) {\n return fixNumericExtent(yExtent, valueAxis);\n } else {\n const fixedYExtent = [Math.min(0, yExtent[0]), Math.max(0, yExtent[1])];\n return fixNumericExtent(fixedYExtent, valueAxis);\n }\n }\n createNodeData() {\n return __async(this, null, function* () {\n const { dataModel } = this;\n const xAxis = this.getCategoryAxis();\n const yAxis = this.getValueAxis();\n if (!dataModel || !xAxis || !yAxis || !this.properties.isValid())\n return;\n const xScale = xAxis.scale;\n const yScale = yAxis.scale;\n const { xKey, yKey, xName, yName, fill, stroke, strokeWidth, cornerRadius, legendItemName, label } = this.properties;\n const yReversed = yAxis.isReversed();\n const { barWidth, groupIndex } = this.updateGroupScale(xAxis);\n const barOffset = ContinuousScale.is(xScale) ? barWidth * -0.5 : 0;\n const xIndex = dataModel.resolveProcessedDataIndexById(this, `xValue`);\n const yRawIndex = dataModel.resolveProcessedDataIndexById(this, `yValue-raw`);\n const yStartIndex = dataModel.resolveProcessedDataIndexById(this, `yValue-start`);\n const yEndIndex = dataModel.resolveProcessedDataIndexById(this, `yValue-end`);\n const yRangeIndex = dataModel.resolveProcessedDataIndexById(this, `yValue-range`);\n const animationEnabled = !this.ctx.animationManager.isSkipped();\n const context = {\n itemId: yKey,\n nodeData: [],\n labelData: [],\n scales: this.calculateScaling(),\n visible: this.visible || animationEnabled\n };\n const { groupScale, processedData } = this;\n processedData == null ? void 0 : processedData.data.forEach(({ keys, datum: seriesDatum, values, aggValues }) => {\n values.forEach((value, valueIndex) => {\n var _a;\n const xValue = keys[xIndex];\n const x = xScale.convert(xValue);\n const currY = +value[yEndIndex];\n const prevY = +value[yStartIndex];\n const yRawValue = value[yRawIndex];\n const isPositive = yRawValue >= 0 && !Object.is(yRawValue, -0);\n const isUpward = isPositive !== yReversed;\n const yRange = (_a = aggValues == null ? void 0 : aggValues[yRangeIndex][isPositive ? 1 : 0]) != null ? _a : 0;\n const barX = x + groupScale.convert(String(groupIndex)) + barOffset;\n if (isNaN(currY))\n return;\n const y = yScale.convert(currY);\n const bottomY = yScale.convert(prevY);\n const barAlongX = this.getBarDirection() === \"x\" /* X */;\n const bboxHeight = yScale.convert(yRange);\n const bboxBottom = yScale.convert(0);\n const rect = {\n x: barAlongX ? Math.min(y, bottomY) : barX,\n y: barAlongX ? barX : Math.min(y, bottomY),\n width: barAlongX ? Math.abs(bottomY - y) : barWidth,\n height: barAlongX ? barWidth : Math.abs(bottomY - y)\n };\n const clipBBox = new BBox(rect.x, rect.y, rect.width, rect.height);\n const barRect = {\n x: barAlongX ? Math.min(bboxBottom, bboxHeight) : barX,\n y: barAlongX ? barX : Math.min(bboxBottom, bboxHeight),\n width: barAlongX ? Math.abs(bboxBottom - bboxHeight) : barWidth,\n height: barAlongX ? barWidth : Math.abs(bboxBottom - bboxHeight),\n clipBBox\n };\n const {\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily,\n color: labelColor,\n placement\n } = label;\n const labelText = this.getLabelText(\n this.properties.label,\n {\n datum: seriesDatum[valueIndex],\n value: yRawValue,\n xKey,\n yKey,\n xName,\n yName,\n legendItemName\n },\n (v) => isFiniteNumber(v) ? v.toFixed(2) : String(v)\n );\n const labelDatum = labelText ? __spreadValues({\n text: labelText,\n fill: labelColor,\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily\n }, adjustLabelPlacement({\n isPositive,\n isVertical: !barAlongX,\n placement,\n rect\n })) : void 0;\n const lengthRatioMultiplier = this.shouldFlipXY() ? rect.height : rect.width;\n const nodeData = {\n series: this,\n itemId: yKey,\n datum: seriesDatum[valueIndex],\n valueIndex,\n cumulativeValue: currY,\n xValue,\n yValue: yRawValue,\n yKey,\n xKey,\n capDefaults: {\n lengthRatioMultiplier,\n lengthMax: lengthRatioMultiplier\n },\n x: barRect.x,\n y: barRect.y,\n width: barRect.width,\n height: barRect.height,\n midPoint: { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 },\n fill,\n stroke,\n opacity: 1,\n strokeWidth,\n cornerRadius,\n topLeftCornerRadius: barAlongX !== isUpward,\n topRightCornerRadius: isUpward,\n bottomRightCornerRadius: barAlongX === isUpward,\n bottomLeftCornerRadius: !isUpward,\n clipBBox,\n label: labelDatum,\n missing: yRawValue == null\n };\n context.nodeData.push(nodeData);\n context.labelData.push(nodeData);\n });\n });\n return context;\n });\n }\n nodeFactory() {\n return new Rect();\n }\n updateDatumSelection(opts) {\n return __async(this, null, function* () {\n return opts.datumSelection.update(\n opts.nodeData,\n (rect) => {\n rect.tag = 0 /* Bar */;\n },\n (datum) => createDatumId(datum.xValue, datum.valueIndex)\n );\n });\n }\n updateDatumNodes(opts) {\n return __async(this, null, function* () {\n if (!this.properties.isValid()) {\n return;\n }\n const {\n yKey,\n stackGroup,\n fill,\n fillOpacity,\n stroke,\n strokeWidth,\n strokeOpacity,\n lineDash,\n lineDashOffset,\n formatter,\n shadow,\n highlightStyle: { item: itemHighlightStyle }\n } = this.properties;\n const xAxis = this.axes[\"x\" /* X */];\n const crisp = checkCrisp(xAxis == null ? void 0 : xAxis.visibleRange);\n const categoryAlongX = this.getCategoryDirection() === \"x\" /* X */;\n opts.datumSelection.each((rect, datum) => {\n var _a, _b, _c, _d;\n const style = {\n fill,\n stroke,\n fillOpacity,\n strokeOpacity,\n lineDash,\n lineDashOffset,\n fillShadow: shadow,\n strokeWidth: this.getStrokeWidth(strokeWidth),\n cornerRadius: datum.cornerRadius,\n topLeftCornerRadius: datum.topLeftCornerRadius,\n topRightCornerRadius: datum.topRightCornerRadius,\n bottomRightCornerRadius: datum.bottomRightCornerRadius,\n bottomLeftCornerRadius: datum.bottomLeftCornerRadius\n };\n const visible = categoryAlongX ? ((_b = (_a = datum.clipBBox) == null ? void 0 : _a.width) != null ? _b : datum.width) > 0 : ((_d = (_c = datum.clipBBox) == null ? void 0 : _c.height) != null ? _d : datum.height) > 0;\n const config = getRectConfig({\n datum,\n ctx: this.ctx,\n seriesId: this.id,\n isHighlighted: opts.isHighlight,\n highlightStyle: itemHighlightStyle,\n yKey,\n style,\n formatter,\n stackGroup\n });\n config.crisp = crisp;\n config.visible = visible;\n updateRect({ rect, config });\n });\n });\n }\n updateLabelSelection(opts) {\n return __async(this, null, function* () {\n const data = this.isLabelEnabled() ? opts.labelData : [];\n return opts.labelSelection.update(data, (text) => {\n text.tag = 1 /* Label */;\n text.pointerEvents = 1 /* None */;\n });\n });\n }\n updateLabelNodes(opts) {\n return __async(this, null, function* () {\n opts.labelSelection.each((textNode, datum) => {\n updateLabelNode(textNode, this.properties.label, datum.label);\n });\n });\n }\n getTooltipHtml(nodeDatum) {\n var _a;\n const {\n id: seriesId,\n processedData,\n ctx: { callbackCache }\n } = this;\n const xAxis = this.getCategoryAxis();\n const yAxis = this.getValueAxis();\n if (!processedData || !this.properties.isValid() || !xAxis || !yAxis) {\n return EMPTY_TOOLTIP_CONTENT;\n }\n const { xKey, yKey, xName, yName, fill, stroke, strokeWidth, tooltip, formatter, stackGroup, legendItemName } = this.properties;\n const { xValue, yValue, datum, itemId } = nodeDatum;\n const xString = xAxis.formatDatum(xValue);\n const yString = yAxis.formatDatum(yValue);\n const title = sanitizeHtml(yName);\n const content = sanitizeHtml(xString + \": \" + yString);\n let format2;\n if (formatter) {\n format2 = callbackCache.call(formatter, {\n seriesId,\n datum,\n xKey,\n yKey,\n stackGroup,\n fill,\n stroke,\n strokeWidth: this.getStrokeWidth(strokeWidth),\n highlighted: false\n });\n }\n const color = (_a = format2 == null ? void 0 : format2.fill) != null ? _a : fill;\n return tooltip.toTooltipHtml(\n { title, content, backgroundColor: color },\n __spreadValues({\n seriesId,\n itemId,\n datum,\n xKey,\n yKey,\n xName,\n yName,\n stackGroup,\n title,\n color,\n legendItemName\n }, this.getModuleTooltipParams())\n );\n }\n getLegendData(legendType) {\n var _a, _b;\n const { showInLegend } = this.properties;\n if (legendType !== \"category\" || !((_a = this.data) == null ? void 0 : _a.length) || !this.properties.isValid() || !showInLegend) {\n return [];\n }\n const { yKey, yName, fill, stroke, strokeWidth, fillOpacity, strokeOpacity, legendItemName, visible } = this.properties;\n return [\n {\n legendType: \"category\",\n id: this.id,\n itemId: yKey,\n seriesId: this.id,\n enabled: visible,\n label: { text: (_b = legendItemName != null ? legendItemName : yName) != null ? _b : yKey },\n marker: { fill, fillOpacity, stroke, strokeWidth, strokeOpacity },\n legendItemName\n }\n ];\n }\n animateEmptyUpdateReady({ datumSelection, labelSelection, annotationSelections }) {\n const fns = prepareBarAnimationFunctions(collapsedStartingBarPosition(this.isVertical(), this.axes, \"normal\"));\n fromToMotion(this.id, \"nodes\", this.ctx.animationManager, [datumSelection], fns);\n seriesLabelFadeInAnimation(this, \"labels\", this.ctx.animationManager, labelSelection);\n seriesLabelFadeInAnimation(this, \"annotations\", this.ctx.animationManager, ...annotationSelections);\n }\n animateWaitingUpdateReady(data) {\n var _a, _b, _c;\n const { datumSelection, labelSelection, annotationSelections, previousContextData } = data;\n this.ctx.animationManager.stopByAnimationGroupId(this.id);\n const dataDiff = (_b = (_a = this.processedData) == null ? void 0 : _a.reduced) == null ? void 0 : _b.diff;\n const mode = previousContextData == null ? \"fade\" : \"normal\";\n const fns = prepareBarAnimationFunctions(collapsedStartingBarPosition(this.isVertical(), this.axes, mode));\n fromToMotion(\n this.id,\n \"nodes\",\n this.ctx.animationManager,\n [datumSelection],\n fns,\n (_, datum) => createDatumId(datum.xValue, datum.valueIndex),\n dataDiff\n );\n const hasMotion = (_c = dataDiff == null ? void 0 : dataDiff.changed) != null ? _c : true;\n if (hasMotion) {\n seriesLabelFadeInAnimation(this, \"labels\", this.ctx.animationManager, labelSelection);\n seriesLabelFadeInAnimation(this, \"annotations\", this.ctx.animationManager, ...annotationSelections);\n }\n }\n isLabelEnabled() {\n return this.properties.label.enabled;\n }\n computeFocusBounds({ datumIndex, seriesRect }) {\n var _a;\n const datumBox = (_a = this.contextNodeData) == null ? void 0 : _a.nodeData[datumIndex].clipBBox;\n return computeBarFocusBounds(datumBox, this.contentGroup, seriesRect);\n }\n};\nBarSeries.className = \"BarSeries\";\nBarSeries.type = \"bar\";\n\n// packages/ag-charts-community/src/chart/series/cartesian/barSeriesModule.ts\nvar BarSeriesModule = {\n type: \"series\",\n optionsKey: \"series[]\",\n packageType: \"community\",\n chartTypes: [\"cartesian\"],\n identifier: \"bar\",\n instanceConstructor: BarSeries,\n stackable: true,\n groupable: true,\n defaultAxes: [\n {\n type: \"number\" /* NUMBER */,\n position: \"left\" /* LEFT */\n },\n {\n type: \"category\" /* CATEGORY */,\n position: \"bottom\" /* BOTTOM */\n }\n ],\n swapDefaultAxesCondition: (series) => (series == null ? void 0 : series.direction) === \"horizontal\",\n themeTemplate: {\n series: {\n __extends__: EXTENDS_SERIES_DEFAULTS,\n direction: \"vertical\",\n fillOpacity: 1,\n strokeWidth: 0,\n lineDash: [0],\n lineDashOffset: 0,\n label: {\n enabled: false,\n fontWeight: \"normal\" /* NORMAL */,\n fontSize: 12,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_INSIDE_SERIES_LABEL_COLOUR,\n placement: \"inside\"\n },\n shadow: {\n enabled: false,\n color: DEFAULT_SHADOW_COLOUR,\n xOffset: 3,\n yOffset: 3,\n blur: 5\n }\n }\n },\n enterpriseThemeTemplate: {\n series: {\n errorBar: {\n cap: {\n lengthRatio: 0.3\n }\n }\n }\n },\n paletteFactory: singleSeriesPaletteFactory\n};\n\n// packages/ag-charts-community/src/scale/colorScale.ts\nvar convertColorStringToOklcha = (v) => {\n const color = Color.fromString(v);\n const [l, c, h] = Color.RGBtoOKLCH(color.r, color.g, color.b);\n return { l, c, h, a: color.a };\n};\nvar interpolateOklch = (x, y, d) => {\n d = clamp(0, d, 1);\n let h;\n let c;\n if (Number.isNaN(x.h) && Number.isNaN(y.h)) {\n h = 0;\n c = 0;\n } else if (Number.isNaN(x.h)) {\n h = y.h;\n c = y.c;\n } else if (Number.isNaN(y.h)) {\n h = x.h;\n c = x.c;\n } else {\n const xH = x.h;\n let yH = y.h;\n const deltaH = y.h - x.h;\n if (deltaH > 180) {\n yH -= 360;\n } else if (deltaH < -180) {\n yH += 360;\n }\n h = xH * (1 - d) + yH * d;\n c = x.c * (1 - d) + y.c * d;\n }\n const l = x.l * (1 - d) + y.l * d;\n const a = x.a * (1 - d) + y.a * d;\n return Color.fromOKLCH(l, c, h, a);\n};\nvar ColorScale = class {\n constructor() {\n this.type = \"color\";\n this.invalid = true;\n this.domain = [0, 1];\n this.range = [\"red\", \"blue\"];\n this.parsedRange = this.range.map(convertColorStringToOklcha);\n }\n update() {\n const { domain, range: range3 } = this;\n if (domain.length < 2) {\n Logger.warnOnce(\"`colorDomain` should have at least 2 values.\");\n if (domain.length === 0) {\n domain.push(0, 1);\n } else if (domain.length === 1) {\n domain.push(domain[0] + 1);\n }\n }\n for (let i = 1; i < domain.length; i++) {\n const a = domain[i - 1];\n const b = domain[i];\n if (a >= b) {\n Logger.warnOnce(\"`colorDomain` values should be supplied in ascending order.\");\n domain.sort((a2, b2) => a2 - b2);\n break;\n }\n }\n if (range3.length < domain.length) {\n for (let i = range3.length; i < domain.length; i++) {\n range3.push(range3.length > 0 ? range3[0] : \"black\");\n }\n }\n this.parsedRange = this.range.map(convertColorStringToOklcha);\n }\n convert(x) {\n this.refresh();\n const { domain, range: range3, parsedRange } = this;\n const d0 = domain[0];\n const d1 = domain.at(-1);\n const r0 = range3[0];\n const r1 = range3[range3.length - 1];\n if (x <= d0) {\n return r0;\n }\n if (x >= d1) {\n return r1;\n }\n let index;\n let q;\n if (domain.length === 2) {\n const t = (x - d0) / (d1 - d0);\n const step = 1 / (range3.length - 1);\n index = range3.length <= 2 ? 0 : Math.min(Math.floor(t * (range3.length - 1)), range3.length - 2);\n q = (t - index * step) / step;\n } else {\n for (index = 0; index < domain.length - 2; index++) {\n if (x < domain[index + 1]) {\n break;\n }\n }\n const a = domain[index];\n const b = domain[index + 1];\n q = (x - a) / (b - a);\n }\n const c0 = parsedRange[index];\n const c1 = parsedRange[index + 1];\n return interpolateOklch(c0, c1, q).toRgbaString();\n }\n refresh() {\n if (!this.invalid)\n return;\n this.invalid = false;\n this.update();\n if (this.invalid) {\n Logger.warnOnce(\"Expected update to not invalidate scale\");\n }\n }\n};\n__decorateClass([\n Invalidating\n], ColorScale.prototype, \"domain\", 2);\n__decorateClass([\n Invalidating\n], ColorScale.prototype, \"range\", 2);\n\n// packages/ag-charts-community/src/chart/series/cartesian/bubbleSeriesProperties.ts\nvar BubbleSeriesMarker = class extends SeriesMarker {\n constructor() {\n super(...arguments);\n this.maxSize = 30;\n }\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], BubbleSeriesMarker.prototype, \"maxSize\", 2);\n__decorateClass([\n Validate(NUMBER_ARRAY, { optional: true }),\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], BubbleSeriesMarker.prototype, \"domain\", 2);\nvar BubbleSeriesLabel = class extends Label {\n constructor() {\n super(...arguments);\n this.placement = \"top\";\n }\n};\n__decorateClass([\n Validate(LABEL_PLACEMENT)\n], BubbleSeriesLabel.prototype, \"placement\", 2);\nvar BubbleSeriesProperties = class extends CartesianSeriesProperties {\n constructor() {\n super(...arguments);\n this.colorRange = [\"#ffff00\", \"#00ff00\", \"#0000ff\"];\n this.marker = new BubbleSeriesMarker();\n this.label = new BubbleSeriesLabel();\n this.tooltip = new SeriesTooltip();\n }\n};\n__decorateClass([\n Validate(STRING)\n], BubbleSeriesProperties.prototype, \"xKey\", 2);\n__decorateClass([\n Validate(STRING)\n], BubbleSeriesProperties.prototype, \"yKey\", 2);\n__decorateClass([\n Validate(STRING)\n], BubbleSeriesProperties.prototype, \"sizeKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BubbleSeriesProperties.prototype, \"labelKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BubbleSeriesProperties.prototype, \"colorKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BubbleSeriesProperties.prototype, \"xName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BubbleSeriesProperties.prototype, \"yName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BubbleSeriesProperties.prototype, \"sizeName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BubbleSeriesProperties.prototype, \"labelName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BubbleSeriesProperties.prototype, \"colorName\", 2);\n__decorateClass([\n Validate(NUMBER_ARRAY, { optional: true })\n], BubbleSeriesProperties.prototype, \"colorDomain\", 2);\n__decorateClass([\n Validate(COLOR_STRING_ARRAY)\n], BubbleSeriesProperties.prototype, \"colorRange\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], BubbleSeriesProperties.prototype, \"title\", 2);\n__decorateClass([\n Validate(OBJECT)\n], BubbleSeriesProperties.prototype, \"marker\", 2);\n__decorateClass([\n Validate(OBJECT)\n], BubbleSeriesProperties.prototype, \"label\", 2);\n__decorateClass([\n Validate(OBJECT)\n], BubbleSeriesProperties.prototype, \"tooltip\", 2);\n\n// packages/ag-charts-community/src/chart/series/cartesian/bubbleSeries.ts\nvar BubbleSeriesNodeEvent = class extends CartesianSeriesNodeEvent {\n constructor(type, nativeEvent, datum, series) {\n super(type, nativeEvent, datum, series);\n this.sizeKey = series.properties.sizeKey;\n }\n};\nvar BubbleSeries = class extends CartesianSeries {\n constructor(moduleCtx) {\n super({\n moduleCtx,\n directionKeys: DEFAULT_CARTESIAN_DIRECTION_KEYS,\n directionNames: DEFAULT_CARTESIAN_DIRECTION_NAMES,\n pickModes: [\n 2 /* NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST */,\n 3 /* NEAREST_NODE */,\n 0 /* EXACT_SHAPE_MATCH */\n ],\n pathsPerSeries: 0,\n hasMarkers: true,\n markerSelectionGarbageCollection: false,\n animationResetFns: {\n label: resetLabelFn,\n marker: resetMarkerFn\n }\n });\n this.NodeEvent = BubbleSeriesNodeEvent;\n this.properties = new BubbleSeriesProperties();\n this.sizeScale = new LinearScale();\n this.colorScale = new ColorScale();\n }\n processData(dataController) {\n return __async(this, null, function* () {\n var _a, _b, _c, _d;\n if (!this.properties.isValid() || this.data == null || !this.visible)\n return;\n const xScale = (_a = this.axes[\"x\" /* X */]) == null ? void 0 : _a.scale;\n const yScale = (_b = this.axes[\"y\" /* Y */]) == null ? void 0 : _b.scale;\n const { xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });\n const colorScaleType = this.colorScale.type;\n const sizeScaleType = this.sizeScale.type;\n const { xKey, yKey, sizeKey, labelKey, colorDomain, colorRange, colorKey, marker } = this.properties;\n const { dataModel, processedData } = yield this.requestDataModel(dataController, this.data, {\n props: [\n keyProperty(xKey, xScaleType, { id: \"xKey-raw\" }),\n keyProperty(yKey, yScaleType, { id: \"yKey-raw\" }),\n ...labelKey ? [keyProperty(labelKey, \"band\", { id: `labelKey-raw` })] : [],\n valueProperty(xKey, xScaleType, { id: `xValue` }),\n valueProperty(yKey, yScaleType, { id: `yValue` }),\n valueProperty(sizeKey, sizeScaleType, { id: `sizeValue` }),\n ...colorKey ? [valueProperty(colorKey, colorScaleType, { id: `colorValue` })] : [],\n ...labelKey ? [valueProperty(labelKey, \"band\", { id: `labelValue` })] : []\n ]\n });\n const sizeKeyIdx = dataModel.resolveProcessedDataIndexById(this, `sizeValue`);\n const processedSize = (_c = processedData.domain.values[sizeKeyIdx]) != null ? _c : [];\n this.sizeScale.domain = marker.domain ? marker.domain : processedSize;\n if (colorKey) {\n const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, `colorValue`);\n this.colorScale.domain = (_d = colorDomain != null ? colorDomain : processedData.domain.values[colorKeyIdx]) != null ? _d : [];\n this.colorScale.range = colorRange;\n this.colorScale.update();\n }\n this.animationState.transition(\"updateData\");\n });\n }\n getSeriesDomain(direction) {\n const { dataModel, processedData } = this;\n if (!processedData || !dataModel)\n return [];\n const id = direction === \"x\" /* X */ ? `xValue` : `yValue`;\n const dataDef = dataModel.resolveProcessedDataDefById(this, id);\n const domain = dataModel.getDomain(this, id, \"value\", processedData);\n if ((dataDef == null ? void 0 : dataDef.def.type) === \"value\" && (dataDef == null ? void 0 : dataDef.def.valueType) === \"category\") {\n return domain;\n }\n const axis = this.axes[direction];\n return fixNumericExtent(extent(domain), axis);\n }\n createNodeData() {\n return __async(this, null, function* () {\n var _a, _b, _c;\n const { axes, dataModel, processedData, colorScale, sizeScale } = this;\n const { xKey, yKey, sizeKey, labelKey, xName, yName, sizeName, labelName, label, colorKey, marker, visible } = this.properties;\n const markerShape = getMarker(marker.shape);\n const { placement } = label;\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n if (!(dataModel && processedData && visible && xAxis && yAxis)) {\n return;\n }\n const xDataIdx = dataModel.resolveProcessedDataIndexById(this, `xValue`);\n const yDataIdx = dataModel.resolveProcessedDataIndexById(this, `yValue`);\n const sizeDataIdx = sizeKey ? dataModel.resolveProcessedDataIndexById(this, `sizeValue`) : -1;\n const colorDataIdx = colorKey ? dataModel.resolveProcessedDataIndexById(this, `colorValue`) : -1;\n const labelDataIdx = labelKey ? dataModel.resolveProcessedDataIndexById(this, `labelValue`) : -1;\n const xScale = xAxis.scale;\n const yScale = yAxis.scale;\n const xOffset = ((_a = xScale.bandwidth) != null ? _a : 0) / 2;\n const yOffset = ((_b = yScale.bandwidth) != null ? _b : 0) / 2;\n const nodeData = [];\n sizeScale.range = [marker.size, marker.maxSize];\n const font = label.getFont();\n for (const { values, datum } of (_c = processedData.data) != null ? _c : []) {\n const xDatum = values[xDataIdx];\n const yDatum = values[yDataIdx];\n const x = xScale.convert(xDatum) + xOffset;\n const y = yScale.convert(yDatum) + yOffset;\n const labelText = this.getLabelText(label, {\n value: labelKey ? values[labelDataIdx] : yDatum,\n datum,\n xKey,\n yKey,\n sizeKey,\n labelKey,\n xName,\n yName,\n sizeName,\n labelName\n });\n const size = Text.getTextSize(String(labelText), font);\n const markerSize = sizeKey ? sizeScale.convert(values[sizeDataIdx]) : marker.size;\n const fill = colorKey ? colorScale.convert(values[colorDataIdx]) : void 0;\n nodeData.push({\n series: this,\n itemId: yKey,\n yKey,\n xKey,\n datum,\n xValue: xDatum,\n yValue: yDatum,\n sizeValue: values[sizeDataIdx],\n point: { x, y, size: markerSize },\n midPoint: { x, y },\n fill,\n label: __spreadValues({ text: labelText }, size),\n marker: markerShape,\n placement\n });\n }\n return {\n itemId: yKey,\n nodeData,\n labelData: nodeData,\n scales: this.calculateScaling(),\n visible: this.visible\n };\n });\n }\n isPathOrSelectionDirty() {\n return this.properties.marker.isDirty();\n }\n getLabelData() {\n var _a, _b;\n return (_b = (_a = this.contextNodeData) == null ? void 0 : _a.labelData) != null ? _b : [];\n }\n markerFactory() {\n const { shape } = this.properties.marker;\n const MarkerShape = getMarker(shape);\n return new MarkerShape();\n }\n updateMarkerSelection(opts) {\n return __async(this, null, function* () {\n const { nodeData, markerSelection } = opts;\n if (this.properties.marker.isDirty()) {\n markerSelection.clear();\n markerSelection.cleanup();\n }\n const data = this.properties.marker.enabled ? nodeData : [];\n return markerSelection.update(\n data,\n void 0,\n (datum) => createDatumId([datum.xValue, datum.yValue, datum.label.text])\n );\n });\n }\n updateMarkerNodes(opts) {\n return __async(this, null, function* () {\n const { markerSelection, isHighlight: highlighted } = opts;\n const { xKey, yKey, sizeKey, labelKey, marker } = this.properties;\n const baseStyle = mergeDefaults(highlighted && this.properties.highlightStyle.item, marker.getStyle());\n this.sizeScale.range = [marker.size, marker.maxSize];\n markerSelection.each((node, datum) => {\n this.updateMarkerStyle(node, marker, { datum, highlighted, xKey, yKey, sizeKey, labelKey }, baseStyle);\n });\n if (!highlighted) {\n this.properties.marker.markClean();\n }\n });\n }\n updateLabelSelection(opts) {\n return __async(this, null, function* () {\n var _a, _b;\n const placedLabels = this.properties.label.enabled ? (_b = (_a = this.chart) == null ? void 0 : _a.placeLabels().get(this)) != null ? _b : [] : [];\n return opts.labelSelection.update(\n placedLabels.map((v) => __spreadProps(__spreadValues({}, v.datum), {\n point: {\n x: v.x,\n y: v.y,\n size: v.datum.point.size\n }\n }))\n );\n });\n }\n updateLabelNodes(opts) {\n return __async(this, null, function* () {\n const { label } = this.properties;\n opts.labelSelection.each((text, datum) => {\n var _a, _b, _c, _d;\n text.text = datum.label.text;\n text.fill = label.color;\n text.x = (_b = (_a = datum.point) == null ? void 0 : _a.x) != null ? _b : 0;\n text.y = (_d = (_c = datum.point) == null ? void 0 : _c.y) != null ? _d : 0;\n text.fontStyle = label.fontStyle;\n text.fontWeight = label.fontWeight;\n text.fontSize = label.fontSize;\n text.fontFamily = label.fontFamily;\n text.textAlign = \"left\";\n text.textBaseline = \"top\";\n });\n });\n }\n getTooltipHtml(nodeDatum) {\n var _a;\n const xAxis = this.axes[\"x\" /* X */];\n const yAxis = this.axes[\"y\" /* Y */];\n if (!this.properties.isValid() || !xAxis || !yAxis) {\n return EMPTY_TOOLTIP_CONTENT;\n }\n const { xKey, yKey, sizeKey, labelKey, xName, yName, sizeName, labelName, marker, tooltip } = this.properties;\n const title = (_a = this.properties.title) != null ? _a : yName;\n const baseStyle = mergeDefaults(\n { fill: nodeDatum.fill, strokeWidth: this.getStrokeWidth(marker.strokeWidth) },\n marker.getStyle()\n );\n const { fill: color = \"gray\" } = this.getMarkerStyle(\n marker,\n { datum: nodeDatum, highlighted: false, xKey, yKey, sizeKey, labelKey },\n baseStyle\n );\n const {\n datum,\n xValue,\n yValue,\n sizeValue,\n label: { text: labelText },\n itemId\n } = nodeDatum;\n const xString = sanitizeHtml(xAxis.formatDatum(xValue));\n const yString = sanitizeHtml(yAxis.formatDatum(yValue));\n let content = `${sanitizeHtml(xName != null ? xName : xKey)}: ${xString}
${sanitizeHtml(yName != null ? yName : yKey)}: ${yString}`;\n if (sizeKey) {\n content += `
${sanitizeHtml(sizeName != null ? sizeName : sizeKey)}: ${sanitizeHtml(String(sizeValue))}`;\n }\n if (labelKey) {\n content = `${sanitizeHtml(labelName != null ? labelName : labelKey)}: ${sanitizeHtml(labelText)}
` + content;\n }\n return tooltip.toTooltipHtml(\n { title, content, backgroundColor: color },\n {\n datum,\n itemId,\n xKey,\n xName,\n yKey,\n yName,\n sizeKey,\n sizeName,\n labelKey,\n labelName,\n title,\n color,\n seriesId: this.id\n }\n );\n }\n getLegendData() {\n var _a, _b;\n if (!((_a = this.data) == null ? void 0 : _a.length) || !this.properties.isValid()) {\n return [];\n }\n const { yKey, yName, title, marker, visible } = this.properties;\n const { shape, fill, stroke, fillOpacity, strokeOpacity, strokeWidth } = marker;\n return [\n {\n legendType: \"category\",\n id: this.id,\n itemId: yKey,\n seriesId: this.id,\n enabled: visible,\n label: {\n text: (_b = title != null ? title : yName) != null ? _b : yKey\n },\n marker: {\n shape,\n fill: fill != null ? fill : \"rgba(0, 0, 0, 0)\",\n stroke: stroke != null ? stroke : \"rgba(0, 0, 0, 0)\",\n fillOpacity: fillOpacity != null ? fillOpacity : 1,\n strokeOpacity: strokeOpacity != null ? strokeOpacity : 1,\n strokeWidth: strokeWidth != null ? strokeWidth : 0\n }\n }\n ];\n }\n animateEmptyUpdateReady({ markerSelection, labelSelection }) {\n markerScaleInAnimation(this, this.ctx.animationManager, markerSelection);\n seriesLabelFadeInAnimation(this, \"labels\", this.ctx.animationManager, labelSelection);\n }\n isLabelEnabled() {\n return this.properties.label.enabled;\n }\n nodeFactory() {\n return new Group();\n }\n getFormattedMarkerStyle(datum) {\n const { xKey, yKey, sizeKey, labelKey } = this.properties;\n return this.getMarkerStyle(this.properties.marker, {\n datum,\n xKey,\n yKey,\n sizeKey,\n labelKey,\n highlighted: false\n });\n }\n computeFocusBounds(opts) {\n return computeMarkerFocusBounds(this, opts);\n }\n};\nBubbleSeries.className = \"BubbleSeries\";\nBubbleSeries.type = \"bubble\";\n\n// packages/ag-charts-community/src/chart/series/cartesian/bubbleSeriesModule.ts\nvar BubbleSeriesModule = {\n type: \"series\",\n optionsKey: \"series[]\",\n packageType: \"community\",\n chartTypes: [\"cartesian\"],\n identifier: \"bubble\",\n instanceConstructor: BubbleSeries,\n defaultAxes: [\n {\n type: \"number\" /* NUMBER */,\n position: \"bottom\" /* BOTTOM */\n },\n {\n type: \"number\" /* NUMBER */,\n position: \"left\" /* LEFT */\n }\n ],\n themeTemplate: {\n series: {\n __extends__: EXTENDS_SERIES_DEFAULTS,\n tooltip: { position: { type: \"node\" } },\n marker: {\n __extends__: EXTENDS_CARTESIAN_MARKER_DEFAULTS,\n maxSize: 30,\n fillOpacity: 0.8\n },\n label: {\n enabled: false,\n fontSize: 12,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_LABEL_COLOUR\n }\n }\n },\n paletteFactory: markerPaletteFactory\n};\n\n// packages/ag-charts-community/src/chart/series/cartesian/histogramSeriesProperties.ts\nvar HistogramSeriesProperties = class extends CartesianSeriesProperties {\n constructor() {\n super(...arguments);\n this.fillOpacity = 1;\n this.strokeWidth = 1;\n this.strokeOpacity = 1;\n this.lineDash = [0];\n this.lineDashOffset = 0;\n this.cornerRadius = 0;\n this.areaPlot = false;\n this.aggregation = \"sum\";\n this.shadow = new DropShadow();\n this.label = new Label();\n this.tooltip = new SeriesTooltip();\n }\n};\n__decorateClass([\n Validate(STRING)\n], HistogramSeriesProperties.prototype, \"xKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], HistogramSeriesProperties.prototype, \"yKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], HistogramSeriesProperties.prototype, \"xName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], HistogramSeriesProperties.prototype, \"yName\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], HistogramSeriesProperties.prototype, \"fill\", 2);\n__decorateClass([\n Validate(RATIO)\n], HistogramSeriesProperties.prototype, \"fillOpacity\", 2);\n__decorateClass([\n Validate(COLOR_STRING, { optional: true })\n], HistogramSeriesProperties.prototype, \"stroke\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], HistogramSeriesProperties.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(RATIO)\n], HistogramSeriesProperties.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n Validate(LINE_DASH)\n], HistogramSeriesProperties.prototype, \"lineDash\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], HistogramSeriesProperties.prototype, \"lineDashOffset\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], HistogramSeriesProperties.prototype, \"cornerRadius\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], HistogramSeriesProperties.prototype, \"areaPlot\", 2);\n__decorateClass([\n Validate(ARRAY, { optional: true })\n], HistogramSeriesProperties.prototype, \"bins\", 2);\n__decorateClass([\n Validate(UNION([\"count\", \"sum\", \"mean\"], \"a histogram aggregation\"))\n], HistogramSeriesProperties.prototype, \"aggregation\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], HistogramSeriesProperties.prototype, \"binCount\", 2);\n__decorateClass([\n Validate(OBJECT)\n], HistogramSeriesProperties.prototype, \"shadow\", 2);\n__decorateClass([\n Validate(OBJECT)\n], HistogramSeriesProperties.prototype, \"label\", 2);\n__decorateClass([\n Validate(OBJECT)\n], HistogramSeriesProperties.prototype, \"tooltip\", 2);\n\n// packages/ag-charts-community/src/chart/series/cartesian/histogramSeries.ts\nvar defaultBinCount = 10;\nvar HistogramSeries = class extends CartesianSeries {\n constructor(moduleCtx) {\n super({\n moduleCtx,\n directionKeys: DEFAULT_CARTESIAN_DIRECTION_KEYS,\n directionNames: DEFAULT_CARTESIAN_DIRECTION_NAMES,\n pickModes: [0 /* EXACT_SHAPE_MATCH */],\n datumSelectionGarbageCollection: false,\n animationResetFns: {\n datum: resetBarSelectionsFn,\n label: resetLabelFn\n }\n });\n this.properties = new HistogramSeriesProperties();\n this.calculatedBins = [];\n }\n // During processData phase, used to unify different ways of the user specifying\n // the bins. Returns bins in format[[min1, max1], [min2, max2], ... ].\n deriveBins(xDomain) {\n const binStarts = ticks_default(xDomain[0], xDomain[1], defaultBinCount);\n const binSize = tickStep(xDomain[0], xDomain[1], defaultBinCount);\n const [firstBinEnd] = binStarts;\n const expandStartToBin = (n) => [n, n + binSize];\n return [[firstBinEnd - binSize, firstBinEnd], ...binStarts.map(expandStartToBin)];\n }\n calculateNiceBins(domain, binCount) {\n const startGuess = Math.floor(domain[0]);\n const stop = domain[1];\n const segments = binCount || 1;\n const { start, binSize } = this.calculateNiceStart(startGuess, stop, segments);\n return this.getBins(start, stop, binSize, segments);\n }\n getBins(start, stop, step, count) {\n const bins = [];\n const precision = this.calculatePrecision(step);\n for (let i = 0; i < count; i++) {\n const a = Math.round((start + i * step) * precision) / precision;\n let b = Math.round((start + (i + 1) * step) * precision) / precision;\n if (i === count - 1) {\n b = Math.max(b, stop);\n }\n bins[i] = [a, b];\n }\n return bins;\n }\n calculatePrecision(step) {\n let precision = 10;\n if (isFinite(step) && step > 0) {\n while (step < 1) {\n precision *= 10;\n step *= 10;\n }\n }\n return precision;\n }\n calculateNiceStart(a, b, segments) {\n const binSize = Math.abs(b - a) / segments;\n const order = Math.floor(Math.log10(binSize));\n const magnitude = Math.pow(10, order);\n const start = Math.floor(a / magnitude) * magnitude;\n return {\n start,\n binSize\n };\n }\n processData(dataController) {\n return __async(this, null, function* () {\n var _a, _b;\n if (!this.visible) {\n this.processedData = void 0;\n this.animationState.transition(\"updateData\");\n }\n const { xKey, yKey, areaPlot, aggregation } = this.properties;\n const xScale = (_a = this.axes[\"x\" /* X */]) == null ? void 0 : _a.scale;\n const yScale = (_b = this.axes[\"y\" /* Y */]) == null ? void 0 : _b.scale;\n const { xScaleType, yScaleType } = this.getScaleInformation({ yScale, xScale });\n const props = [keyProperty(xKey, xScaleType), SORT_DOMAIN_GROUPS];\n if (yKey) {\n let aggProp = groupCount(\"groupAgg\");\n if (aggregation === \"count\") {\n } else if (aggregation === \"sum\") {\n aggProp = groupSum(\"groupAgg\");\n } else if (aggregation === \"mean\") {\n aggProp = groupAverage(\"groupAgg\");\n }\n if (areaPlot) {\n aggProp = area(\"groupAgg\", aggProp);\n }\n props.push(valueProperty(yKey, yScaleType, { invalidValue: void 0 }), aggProp);\n } else {\n let aggProp = groupCount(\"groupAgg\");\n if (areaPlot) {\n aggProp = area(\"groupAgg\", aggProp);\n }\n props.push(aggProp);\n }\n const groupByFn = (dataSet) => {\n var _a2;\n const xExtent = fixNumericExtent(dataSet.domain.keys[0]);\n if (xExtent.length === 0) {\n dataSet.domain.groups = [];\n return () => [];\n }\n const bins = isNumber(this.properties.binCount) ? this.calculateNiceBins(xExtent, this.properties.binCount) : (_a2 = this.properties.bins) != null ? _a2 : this.deriveBins(xExtent);\n const binCount = bins.length;\n this.calculatedBins = [...bins];\n return (item) => {\n const xValue = item.keys[0];\n for (let i = 0; i < binCount; i++) {\n const nextBin = bins[i];\n if (xValue >= nextBin[0] && xValue < nextBin[1]) {\n return nextBin;\n }\n if (i === binCount - 1 && xValue <= nextBin[1]) {\n return nextBin;\n }\n }\n return [];\n };\n };\n if (!this.ctx.animationManager.isSkipped() && this.processedData) {\n props.push(diff(this.processedData, false));\n }\n yield this.requestDataModel(dataController, this.data, { props, groupByFn });\n this.animationState.transition(\"updateData\");\n });\n }\n getSeriesDomain(direction) {\n var _a, _b, _c, _d;\n const { processedData, dataModel } = this;\n if (!processedData || !dataModel || !this.calculatedBins.length)\n return [];\n const yDomain = dataModel.getDomain(this, `groupAgg`, \"aggregate\", processedData);\n const xDomainMin = (_a = this.calculatedBins) == null ? void 0 : _a[0][0];\n const xDomainMax = (_d = this.calculatedBins) == null ? void 0 : _d[((_c = (_b = this.calculatedBins) == null ? void 0 : _b.length) != null ? _c : 0) - 1][1];\n if (direction === \"x\" /* X */) {\n return fixNumericExtent([xDomainMin, xDomainMax]);\n }\n return fixNumericExtent(yDomain);\n }\n createNodeData() {\n return __async(this, null, function* () {\n var _a;\n const {\n id: seriesId,\n axes,\n processedData,\n ctx: { callbackCache }\n } = this;\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n if (!xAxis || !yAxis) {\n return;\n }\n const { scale: xScale } = xAxis;\n const { scale: yScale } = yAxis;\n const { xKey, yKey, xName, yName, fill, stroke, strokeWidth, cornerRadius } = this.properties;\n const {\n formatter: labelFormatter = (params) => String(params.value),\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily,\n color: labelColor\n } = this.properties.label;\n const nodeData = [];\n const context = {\n itemId: (_a = this.properties.yKey) != null ? _a : this.id,\n nodeData,\n labelData: nodeData,\n scales: this.calculateScaling(),\n animationValid: true,\n visible: this.visible\n };\n if (!this.visible || !processedData || processedData.type !== \"grouped\")\n return context;\n processedData.data.forEach((group2) => {\n var _a2;\n const {\n aggValues: [[negativeAgg, positiveAgg]] = [[0, 0]],\n datum,\n datum: { length: frequency },\n keys: domain,\n keys: [xDomainMin, xDomainMax]\n } = group2;\n const xMinPx = xScale.convert(xDomainMin);\n const xMaxPx = xScale.convert(xDomainMax);\n const total = negativeAgg + positiveAgg;\n const yZeroPx = yScale.convert(0);\n const yMaxPx = yScale.convert(total);\n const w = Math.abs(xMaxPx - xMinPx);\n const h = Math.abs(yMaxPx - yZeroPx);\n const x = Math.min(xMinPx, xMaxPx);\n const y = Math.min(yZeroPx, yMaxPx);\n let selectionDatumLabel = void 0;\n if (total !== 0) {\n selectionDatumLabel = {\n text: (_a2 = callbackCache.call(labelFormatter, {\n value: total,\n datum,\n seriesId,\n xKey,\n yKey,\n xName,\n yName\n })) != null ? _a2 : String(total),\n fontStyle: labelFontStyle,\n fontWeight: labelFontWeight,\n fontSize: labelFontSize,\n fontFamily: labelFontFamily,\n fill: labelColor,\n x: x + w / 2,\n y: y + h / 2\n };\n }\n const nodeMidPoint = {\n x: x + w / 2,\n y: y + h / 2\n };\n const yAxisReversed = yAxis.isReversed();\n nodeData.push({\n series: this,\n datum,\n // required by SeriesNodeDatum, but might not make sense here\n // since each selection is an aggregation of multiple data.\n aggregatedValue: total,\n frequency,\n domain,\n yKey,\n xKey,\n x,\n y,\n xValue: xMinPx,\n yValue: yMaxPx,\n width: w,\n height: h,\n midPoint: nodeMidPoint,\n fill,\n stroke,\n cornerRadius,\n topLeftCornerRadius: !yAxisReversed,\n topRightCornerRadius: !yAxisReversed,\n bottomRightCornerRadius: yAxisReversed,\n bottomLeftCornerRadius: yAxisReversed,\n opacity: 1,\n strokeWidth,\n label: selectionDatumLabel\n });\n });\n nodeData.sort((a, b) => a.x - b.x);\n return context;\n });\n }\n nodeFactory() {\n return new Rect();\n }\n updateDatumSelection(opts) {\n return __async(this, null, function* () {\n const { nodeData, datumSelection } = opts;\n return datumSelection.update(\n nodeData,\n (rect) => {\n rect.tag = 0 /* Bin */;\n rect.crisp = true;\n },\n (datum) => datum.domain.join(\"_\")\n );\n });\n }\n updateDatumNodes(opts) {\n return __async(this, null, function* () {\n const { isHighlight: isDatumHighlighted } = opts;\n const {\n fillOpacity: seriesFillOpacity,\n strokeOpacity,\n lineDash,\n lineDashOffset,\n shadow,\n highlightStyle: {\n item: {\n fill: highlightedFill,\n fillOpacity: highlightFillOpacity = seriesFillOpacity,\n stroke: highlightedStroke,\n strokeWidth: highlightedDatumStrokeWidth\n }\n }\n } = this.properties;\n opts.datumSelection.each((rect, datum, index) => {\n var _a, _b;\n const {\n cornerRadius,\n topLeftCornerRadius,\n topRightCornerRadius,\n bottomRightCornerRadius,\n bottomLeftCornerRadius\n } = datum;\n const strokeWidth = isDatumHighlighted && highlightedDatumStrokeWidth !== void 0 ? highlightedDatumStrokeWidth : datum.strokeWidth;\n const fillOpacity = isDatumHighlighted ? highlightFillOpacity : seriesFillOpacity;\n rect.fill = (_a = isDatumHighlighted ? highlightedFill : void 0) != null ? _a : datum.fill;\n rect.stroke = (_b = isDatumHighlighted ? highlightedStroke : void 0) != null ? _b : datum.stroke;\n rect.fillOpacity = fillOpacity;\n rect.strokeOpacity = strokeOpacity;\n rect.strokeWidth = strokeWidth;\n rect.lineDash = lineDash;\n rect.lineDashOffset = lineDashOffset;\n rect.topLeftCornerRadius = topLeftCornerRadius ? cornerRadius : 0;\n rect.topRightCornerRadius = topRightCornerRadius ? cornerRadius : 0;\n rect.bottomRightCornerRadius = bottomRightCornerRadius ? cornerRadius : 0;\n rect.bottomLeftCornerRadius = bottomLeftCornerRadius ? cornerRadius : 0;\n rect.fillShadow = shadow;\n rect.zIndex = isDatumHighlighted ? Series.highlightedZIndex : index;\n rect.visible = datum.height > 0;\n });\n });\n }\n updateLabelSelection(opts) {\n return __async(this, null, function* () {\n const { labelData, labelSelection } = opts;\n return labelSelection.update(labelData, (text) => {\n text.tag = 1 /* Label */;\n text.pointerEvents = 1 /* None */;\n text.textAlign = \"center\";\n text.textBaseline = \"middle\";\n });\n });\n }\n updateLabelNodes(opts) {\n return __async(this, null, function* () {\n const labelEnabled = this.isLabelEnabled();\n opts.labelSelection.each((text, datum) => {\n const label = datum.label;\n if (label && labelEnabled) {\n text.text = label.text;\n text.x = label.x;\n text.y = label.y;\n text.fontStyle = label.fontStyle;\n text.fontWeight = label.fontWeight;\n text.fontSize = label.fontSize;\n text.fontFamily = label.fontFamily;\n text.fill = label.fill;\n text.visible = true;\n } else {\n text.visible = false;\n }\n });\n });\n }\n initQuadTree(quadtree) {\n addHitTestersToQuadtree(quadtree, childrenIter(this.contentGroup.children[0]));\n }\n pickNodeClosestDatum(point) {\n return findQuadtreeMatch(this, point);\n }\n getTooltipHtml(nodeDatum) {\n const xAxis = this.axes[\"x\" /* X */];\n const yAxis = this.axes[\"y\" /* Y */];\n if (!this.properties.isValid() || !xAxis || !yAxis) {\n return EMPTY_TOOLTIP_CONTENT;\n }\n const { xKey, yKey, xName, yName, fill: color, aggregation, tooltip } = this.properties;\n const {\n aggregatedValue,\n frequency,\n domain: [rangeMin, rangeMax],\n itemId\n } = nodeDatum;\n const title = `${sanitizeHtml(xName != null ? xName : xKey)}: ${xAxis.formatDatum(rangeMin)} - ${xAxis.formatDatum(rangeMax)}`;\n let content = yKey ? `${sanitizeHtml(yName != null ? yName : yKey)} (${aggregation}): ${yAxis.formatDatum(aggregatedValue)}
` : \"\";\n content += `Frequency: ${frequency}`;\n const defaults = {\n title,\n backgroundColor: color,\n content\n };\n return tooltip.toTooltipHtml(defaults, {\n datum: {\n data: nodeDatum.datum,\n aggregatedValue: nodeDatum.aggregatedValue,\n domain: nodeDatum.domain,\n frequency: nodeDatum.frequency\n },\n itemId,\n xKey,\n xName,\n yKey,\n yName,\n color,\n title,\n seriesId: this.id\n });\n }\n getLegendData(legendType) {\n var _a, _b;\n if (!((_a = this.data) == null ? void 0 : _a.length) || legendType !== \"category\") {\n return [];\n }\n const { xKey, yName, fill, fillOpacity, stroke, strokeWidth, strokeOpacity, visible } = this.properties;\n return [\n {\n legendType: \"category\",\n id: this.id,\n itemId: xKey,\n seriesId: this.id,\n enabled: visible,\n label: {\n text: (_b = yName != null ? yName : xKey) != null ? _b : \"Frequency\"\n },\n marker: {\n fill: fill != null ? fill : \"rgba(0, 0, 0, 0)\",\n stroke: stroke != null ? stroke : \"rgba(0, 0, 0, 0)\",\n fillOpacity,\n strokeOpacity,\n strokeWidth\n }\n }\n ];\n }\n animateEmptyUpdateReady({ datumSelection, labelSelection }) {\n const fns = prepareBarAnimationFunctions(collapsedStartingBarPosition(true, this.axes, \"normal\"));\n fromToMotion(this.id, \"datums\", this.ctx.animationManager, [datumSelection], fns);\n seriesLabelFadeInAnimation(this, \"labels\", this.ctx.animationManager, labelSelection);\n }\n animateWaitingUpdateReady(data) {\n var _a, _b;\n const dataDiff = (_b = (_a = this.processedData) == null ? void 0 : _a.reduced) == null ? void 0 : _b.diff;\n const fns = prepareBarAnimationFunctions(collapsedStartingBarPosition(true, this.axes, \"normal\"));\n fromToMotion(\n this.id,\n \"datums\",\n this.ctx.animationManager,\n [data.datumSelection],\n fns,\n (_, datum) => createDatumId(datum.domain),\n dataDiff\n );\n seriesLabelFadeInAnimation(this, \"labels\", this.ctx.animationManager, data.labelSelection);\n }\n isLabelEnabled() {\n return this.properties.label.enabled;\n }\n computeFocusBounds({ datumIndex, seriesRect }) {\n var _a;\n return computeBarFocusBounds((_a = this.contextNodeData) == null ? void 0 : _a.nodeData[datumIndex], this.contentGroup, seriesRect);\n }\n};\nHistogramSeries.className = \"HistogramSeries\";\nHistogramSeries.type = \"histogram\";\n\n// packages/ag-charts-community/src/chart/series/cartesian/histogramSeriesModule.ts\nvar HistogramSeriesModule = {\n type: \"series\",\n optionsKey: \"series[]\",\n packageType: \"community\",\n chartTypes: [\"cartesian\"],\n identifier: \"histogram\",\n instanceConstructor: HistogramSeries,\n defaultAxes: [\n {\n type: \"number\" /* NUMBER */,\n position: \"bottom\" /* BOTTOM */\n },\n {\n type: \"number\" /* NUMBER */,\n position: \"left\" /* LEFT */\n }\n ],\n themeTemplate: {\n series: {\n __extends__: EXTENDS_SERIES_DEFAULTS,\n strokeWidth: 1,\n fillOpacity: 1,\n strokeOpacity: 1,\n lineDash: [0],\n lineDashOffset: 0,\n label: {\n enabled: false,\n fontSize: 12,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_INSIDE_SERIES_LABEL_COLOUR\n },\n shadow: {\n enabled: false,\n color: DEFAULT_SHADOW_COLOUR,\n xOffset: 3,\n yOffset: 3,\n blur: 5\n }\n }\n },\n paletteFactory: ({ takeColors }) => {\n const {\n fills: [fill],\n strokes: [stroke]\n } = takeColors(1);\n return { fill, stroke };\n }\n};\n\n// packages/ag-charts-community/src/chart/series/cartesian/lineSeriesProperties.ts\nvar LineSeriesProperties = class extends CartesianSeriesProperties {\n constructor() {\n super(...arguments);\n this.stroke = \"#874349\";\n this.strokeWidth = 2;\n this.strokeOpacity = 1;\n this.lineDash = [0];\n this.lineDashOffset = 0;\n this.marker = new SeriesMarker();\n this.label = new Label();\n this.tooltip = new SeriesTooltip();\n this.connectMissingData = false;\n }\n};\n__decorateClass([\n Validate(STRING)\n], LineSeriesProperties.prototype, \"xKey\", 2);\n__decorateClass([\n Validate(STRING)\n], LineSeriesProperties.prototype, \"yKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], LineSeriesProperties.prototype, \"xName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], LineSeriesProperties.prototype, \"yName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], LineSeriesProperties.prototype, \"title\", 2);\n__decorateClass([\n Validate(COLOR_STRING)\n], LineSeriesProperties.prototype, \"stroke\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], LineSeriesProperties.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(RATIO)\n], LineSeriesProperties.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n Validate(LINE_DASH)\n], LineSeriesProperties.prototype, \"lineDash\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], LineSeriesProperties.prototype, \"lineDashOffset\", 2);\n__decorateClass([\n Validate(OBJECT)\n], LineSeriesProperties.prototype, \"marker\", 2);\n__decorateClass([\n Validate(OBJECT)\n], LineSeriesProperties.prototype, \"label\", 2);\n__decorateClass([\n Validate(OBJECT)\n], LineSeriesProperties.prototype, \"tooltip\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], LineSeriesProperties.prototype, \"connectMissingData\", 2);\n\n// packages/ag-charts-community/src/chart/series/cartesian/lineSeries.ts\nvar LineSeries = class extends CartesianSeries {\n constructor(moduleCtx) {\n super({\n moduleCtx,\n directionKeys: DEFAULT_CARTESIAN_DIRECTION_KEYS,\n directionNames: DEFAULT_CARTESIAN_DIRECTION_NAMES,\n hasMarkers: true,\n pickModes: [\n 2 /* NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST */,\n 3 /* NEAREST_NODE */,\n 0 /* EXACT_SHAPE_MATCH */\n ],\n markerSelectionGarbageCollection: false,\n animationResetFns: {\n path: buildResetPathFn({ getOpacity: () => this.getOpacity() }),\n label: resetLabelFn,\n marker: (node, datum) => __spreadValues(__spreadValues({}, resetMarkerFn(node)), resetMarkerPositionFn(node, datum))\n }\n });\n this.properties = new LineSeriesProperties();\n }\n processData(dataController) {\n return __async(this, null, function* () {\n var _a, _b;\n if (!this.properties.isValid() || this.data == null) {\n return;\n }\n const { xKey, yKey } = this.properties;\n const animationEnabled = !this.ctx.animationManager.isSkipped();\n const xScale = (_a = this.axes[\"x\" /* X */]) == null ? void 0 : _a.scale;\n const yScale = (_b = this.axes[\"y\" /* Y */]) == null ? void 0 : _b.scale;\n const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });\n const props = [];\n if (!isContinuousX) {\n props.push(keyProperty(xKey, xScaleType, { id: \"xKey\" }));\n }\n if (animationEnabled) {\n props.push(animationValidation(isContinuousX ? [\"xValue\"] : void 0));\n if (this.processedData) {\n props.push(diff(this.processedData));\n }\n }\n props.push(\n valueProperty(xKey, xScaleType, { id: \"xValue\" }),\n valueProperty(yKey, yScaleType, { id: \"yValue\", invalidValue: void 0 })\n );\n yield this.requestDataModel(dataController, this.data, { props });\n this.animationState.transition(\"updateData\");\n });\n }\n getSeriesDomain(direction) {\n const { axes, dataModel, processedData } = this;\n if (!processedData || !dataModel)\n return [];\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n const xDef = dataModel.resolveProcessedDataDefById(this, `xValue`);\n if (direction === \"x\" /* X */) {\n const domain = dataModel.getDomain(this, `xValue`, \"value\", processedData);\n if ((xDef == null ? void 0 : xDef.def.type) === \"value\" && xDef.def.valueType === \"category\") {\n return domain;\n }\n return fixNumericExtent(extent(domain), xAxis);\n } else {\n const domain = dataModel.getDomain(this, `yValue`, \"value\", processedData);\n return fixNumericExtent(domain, yAxis);\n }\n }\n createNodeData() {\n return __async(this, null, function* () {\n var _a, _b, _c;\n const { processedData, dataModel, axes } = this;\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n if (!processedData || !dataModel || !xAxis || !yAxis) {\n return;\n }\n const { xKey, yKey, xName, yName, marker, label, connectMissingData, legendItemName } = this.properties;\n const xScale = xAxis.scale;\n const yScale = yAxis.scale;\n const xOffset = ((_a = xScale.bandwidth) != null ? _a : 0) / 2;\n const yOffset = ((_b = yScale.bandwidth) != null ? _b : 0) / 2;\n const nodeData = [];\n const size = marker.enabled ? marker.size : 0;\n const xIdx = dataModel.resolveProcessedDataIndexById(this, `xValue`);\n const yIdx = dataModel.resolveProcessedDataIndexById(this, `yValue`);\n let moveTo = true;\n let nextPoint;\n for (let i = 0; i < processedData.data.length; i++) {\n const { datum, values } = nextPoint != null ? nextPoint : processedData.data[i];\n const xDatum = values[xIdx];\n const yDatum = values[yIdx];\n if (yDatum === void 0) {\n moveTo = !connectMissingData;\n } else {\n const x = xScale.convert(xDatum) + xOffset;\n if (isNaN(x)) {\n moveTo = !connectMissingData;\n nextPoint = void 0;\n continue;\n }\n nextPoint = ((_c = processedData.data[i + 1]) == null ? void 0 : _c.values[yIdx]) === void 0 ? void 0 : processedData.data[i + 1];\n const y = yScale.convert(yDatum) + yOffset;\n const labelText = this.getLabelText(\n label,\n { value: yDatum, datum, xKey, yKey, xName, yName, legendItemName },\n (value) => isFiniteNumber(value) ? value.toFixed(2) : String(value)\n );\n nodeData.push({\n series: this,\n datum,\n yKey,\n xKey,\n point: { x, y, moveTo, size },\n midPoint: { x, y },\n yValue: yDatum,\n xValue: xDatum,\n capDefaults: { lengthRatioMultiplier: this.properties.marker.getDiameter(), lengthMax: Infinity },\n label: labelText ? {\n text: labelText,\n fontStyle: label.fontStyle,\n fontWeight: label.fontWeight,\n fontSize: label.fontSize,\n fontFamily: label.fontFamily,\n textAlign: \"center\",\n textBaseline: \"bottom\",\n fill: label.color\n } : void 0\n });\n moveTo = false;\n }\n }\n return {\n itemId: yKey,\n nodeData,\n labelData: nodeData,\n scales: this.calculateScaling(),\n visible: this.visible\n };\n });\n }\n isPathOrSelectionDirty() {\n return this.properties.marker.isDirty();\n }\n markerFactory() {\n const { shape } = this.properties.marker;\n const MarkerShape = getMarker(shape);\n return new MarkerShape();\n }\n updatePathNodes(opts) {\n return __async(this, null, function* () {\n const {\n paths: [lineNode],\n opacity,\n visible,\n animationEnabled\n } = opts;\n lineNode.setProperties({\n fill: void 0,\n lineJoin: \"round\",\n pointerEvents: 1 /* None */,\n opacity,\n stroke: this.properties.stroke,\n strokeWidth: this.getStrokeWidth(this.properties.strokeWidth),\n strokeOpacity: this.properties.strokeOpacity,\n lineDash: this.properties.lineDash,\n lineDashOffset: this.properties.lineDashOffset\n });\n if (!animationEnabled) {\n lineNode.visible = visible;\n }\n updateClipPath(this, lineNode);\n });\n }\n updateMarkerSelection(opts) {\n return __async(this, null, function* () {\n let { nodeData } = opts;\n const { markerSelection } = opts;\n const { shape, enabled } = this.properties.marker;\n nodeData = shape && enabled ? nodeData : [];\n if (this.properties.marker.isDirty()) {\n markerSelection.clear();\n markerSelection.cleanup();\n }\n return markerSelection.update(nodeData, void 0, (datum) => createDatumId(datum.xValue));\n });\n }\n updateMarkerNodes(opts) {\n return __async(this, null, function* () {\n const { markerSelection, isHighlight: highlighted } = opts;\n const { xKey, yKey, stroke, strokeWidth, strokeOpacity, marker, highlightStyle } = this.properties;\n const baseStyle = mergeDefaults(highlighted && highlightStyle.item, marker.getStyle(), {\n stroke,\n strokeWidth,\n strokeOpacity\n });\n const applyTranslation = this.ctx.animationManager.isSkipped();\n markerSelection.each((node, datum) => {\n this.updateMarkerStyle(node, marker, { datum, highlighted, xKey, yKey }, baseStyle, { applyTranslation });\n });\n if (!highlighted) {\n marker.markClean();\n }\n });\n }\n updateLabelSelection(opts) {\n return __async(this, null, function* () {\n return opts.labelSelection.update(this.isLabelEnabled() ? opts.labelData : []);\n });\n }\n updateLabelNodes(opts) {\n return __async(this, null, function* () {\n const { enabled, fontStyle, fontWeight, fontSize, fontFamily, color } = this.properties.label;\n opts.labelSelection.each((text, datum) => {\n const { point, label } = datum;\n if (datum && label && enabled) {\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.textAlign = label.textAlign;\n text.textBaseline = label.textBaseline;\n text.text = label.text;\n text.x = point.x;\n text.y = point.y - 10;\n text.fill = color;\n text.visible = true;\n } else {\n text.visible = false;\n }\n });\n });\n }\n getTooltipHtml(nodeDatum) {\n var _a;\n const xAxis = this.axes[\"x\" /* X */];\n const yAxis = this.axes[\"y\" /* Y */];\n if (!this.properties.isValid() || !xAxis || !yAxis) {\n return EMPTY_TOOLTIP_CONTENT;\n }\n const { xKey, yKey, xName, yName, strokeWidth, marker, tooltip } = this.properties;\n const { datum, xValue, yValue, itemId } = nodeDatum;\n const xString = xAxis.formatDatum(xValue);\n const yString = yAxis.formatDatum(yValue);\n const title = sanitizeHtml((_a = this.properties.title) != null ? _a : yName);\n const content = sanitizeHtml(xString + \": \" + yString);\n const baseStyle = mergeDefaults({ fill: marker.stroke }, marker.getStyle(), { strokeWidth });\n const { fill: color } = this.getMarkerStyle(\n marker,\n { datum: nodeDatum, xKey, yKey, highlighted: false },\n baseStyle\n );\n return tooltip.toTooltipHtml(\n { title, content, backgroundColor: color },\n __spreadValues({\n datum,\n itemId,\n xKey,\n xName,\n yKey,\n yName,\n title,\n color,\n seriesId: this.id\n }, this.getModuleTooltipParams())\n );\n }\n getLegendData(legendType) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;\n if (!(((_a = this.data) == null ? void 0 : _a.length) && this.properties.isValid() && legendType === \"category\")) {\n return [];\n }\n const { yKey, yName, stroke, strokeOpacity, strokeWidth, lineDash, title, marker, visible, legendItemName } = this.properties;\n const color0 = \"rgba(0, 0, 0, 0)\";\n return [\n {\n legendType: \"category\",\n id: this.id,\n itemId: yKey,\n legendItemName,\n seriesId: this.id,\n enabled: visible,\n label: {\n text: (_c = (_b = legendItemName != null ? legendItemName : title) != null ? _b : yName) != null ? _c : yKey\n },\n marker: {\n shape: marker.shape,\n fill: (_d = marker.fill) != null ? _d : color0,\n stroke: (_f = (_e = marker.stroke) != null ? _e : stroke) != null ? _f : color0,\n fillOpacity: (_g = marker.fillOpacity) != null ? _g : 1,\n strokeOpacity: (_i = (_h = marker.strokeOpacity) != null ? _h : strokeOpacity) != null ? _i : 1,\n strokeWidth: (_j = marker.strokeWidth) != null ? _j : 0,\n enabled: marker.enabled\n },\n line: {\n stroke: stroke != null ? stroke : color0,\n strokeOpacity,\n strokeWidth,\n lineDash\n }\n }\n ];\n }\n updatePaths(opts) {\n return __async(this, null, function* () {\n this.updateLinePaths(opts.paths, opts.contextData);\n });\n }\n updateLinePaths(paths, contextData) {\n const { nodeData } = contextData;\n const [lineNode] = paths;\n const { path: linePath } = lineNode;\n linePath.clear(true);\n for (const data of nodeData) {\n if (data.point.moveTo) {\n linePath.moveTo(data.point.x, data.point.y);\n } else {\n linePath.lineTo(data.point.x, data.point.y);\n }\n }\n lineNode.checkPathDirty();\n }\n animateEmptyUpdateReady(animationData) {\n const { markerSelection, labelSelection, annotationSelections, contextData, paths } = animationData;\n const { animationManager } = this.ctx;\n this.updateLinePaths(paths, contextData);\n pathSwipeInAnimation(this, animationManager, ...paths);\n resetMotion([markerSelection], resetMarkerPositionFn);\n markerSwipeScaleInAnimation(this, animationManager, markerSelection);\n seriesLabelFadeInAnimation(this, \"labels\", animationManager, labelSelection);\n seriesLabelFadeInAnimation(this, \"annotations\", animationManager, ...annotationSelections);\n }\n animateReadyResize(animationData) {\n const { contextData, paths } = animationData;\n this.updateLinePaths(paths, contextData);\n super.animateReadyResize(animationData);\n }\n animateWaitingUpdateReady(animationData) {\n var _a, _b;\n const { animationManager } = this.ctx;\n const {\n markerSelection: markerSelections,\n labelSelection: labelSelections,\n annotationSelections,\n contextData,\n paths,\n previousContextData\n } = animationData;\n const [path] = paths;\n super.resetAllAnimation(animationData);\n const update = () => {\n this.updateLinePaths(paths, contextData);\n };\n const skip = () => {\n animationManager.skipCurrentBatch();\n update();\n };\n if (contextData == null || previousContextData == null) {\n update();\n markerFadeInAnimation(this, animationManager, \"added\", markerSelections);\n pathFadeInAnimation(this, \"path_properties\", animationManager, \"add\", path);\n seriesLabelFadeInAnimation(this, \"labels\", animationManager, labelSelections);\n seriesLabelFadeInAnimation(this, \"annotations\", animationManager, ...annotationSelections);\n return;\n }\n const fns = prepareLinePathAnimation(contextData, previousContextData, (_b = (_a = this.processedData) == null ? void 0 : _a.reduced) == null ? void 0 : _b.diff);\n if (fns === void 0) {\n skip();\n return;\n } else if (fns.status === \"no-op\") {\n return;\n }\n markerFadeInAnimation(this, animationManager, void 0, markerSelections);\n fromToMotion(this.id, \"path_properties\", animationManager, [path], fns.pathProperties);\n pathMotion(this.id, \"path_update\", animationManager, [path], fns.path);\n if (fns.hasMotion) {\n seriesLabelFadeInAnimation(this, \"labels\", animationManager, labelSelections);\n seriesLabelFadeInAnimation(this, \"annotations\", animationManager, ...annotationSelections);\n }\n }\n isLabelEnabled() {\n return this.properties.label.enabled;\n }\n getBandScalePadding() {\n return { inner: 1, outer: 0.1 };\n }\n nodeFactory() {\n return new Group();\n }\n getFormattedMarkerStyle(datum) {\n const { xKey, yKey } = this.properties;\n return this.getMarkerStyle(this.properties.marker, { datum, xKey, yKey, highlighted: true });\n }\n computeFocusBounds(opts) {\n return computeMarkerFocusBounds(this, opts);\n }\n};\nLineSeries.className = \"LineSeries\";\nLineSeries.type = \"line\";\n\n// packages/ag-charts-community/src/chart/series/cartesian/lineSeriesModule.ts\nvar LineSeriesModule = {\n type: \"series\",\n optionsKey: \"series[]\",\n packageType: \"community\",\n chartTypes: [\"cartesian\"],\n identifier: \"line\",\n instanceConstructor: LineSeries,\n defaultAxes: [\n {\n type: \"number\" /* NUMBER */,\n position: \"left\" /* LEFT */\n },\n {\n type: \"category\" /* CATEGORY */,\n position: \"bottom\" /* BOTTOM */\n }\n ],\n themeTemplate: {\n series: {\n __extends__: EXTENDS_SERIES_DEFAULTS,\n tooltip: { position: { type: \"node\" } },\n strokeWidth: 2,\n strokeOpacity: 1,\n lineDash: [0],\n lineDashOffset: 0,\n marker: {\n __extends__: EXTENDS_CARTESIAN_MARKER_DEFAULTS,\n fillOpacity: 1,\n strokeOpacity: 1,\n strokeWidth: 0\n },\n label: {\n enabled: false,\n fontSize: 12,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_LABEL_COLOUR\n }\n }\n },\n enterpriseThemeTemplate: {\n series: {\n errorBar: {\n cap: {\n lengthRatio: 1\n }\n }\n }\n },\n paletteFactory: (params) => {\n const { marker } = markerPaletteFactory(params);\n return { stroke: marker.fill, marker };\n }\n};\n\n// packages/ag-charts-community/src/chart/series/cartesian/scatterSeriesProperties.ts\nvar ScatterSeriesLabel = class extends Label {\n constructor() {\n super(...arguments);\n this.placement = \"top\";\n }\n};\n__decorateClass([\n Validate(LABEL_PLACEMENT)\n], ScatterSeriesLabel.prototype, \"placement\", 2);\nvar ScatterSeriesProperties = class extends CartesianSeriesProperties {\n constructor() {\n super(...arguments);\n this.colorRange = [\"#ffff00\", \"#00ff00\", \"#0000ff\"];\n this.marker = new SeriesMarker();\n this.label = new ScatterSeriesLabel();\n this.tooltip = new SeriesTooltip();\n }\n};\n__decorateClass([\n Validate(STRING)\n], ScatterSeriesProperties.prototype, \"xKey\", 2);\n__decorateClass([\n Validate(STRING)\n], ScatterSeriesProperties.prototype, \"yKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], ScatterSeriesProperties.prototype, \"labelKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], ScatterSeriesProperties.prototype, \"colorKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], ScatterSeriesProperties.prototype, \"xName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], ScatterSeriesProperties.prototype, \"yName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], ScatterSeriesProperties.prototype, \"labelName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], ScatterSeriesProperties.prototype, \"colorName\", 2);\n__decorateClass([\n Validate(NUMBER_ARRAY, { optional: true })\n], ScatterSeriesProperties.prototype, \"colorDomain\", 2);\n__decorateClass([\n Validate(COLOR_STRING_ARRAY)\n], ScatterSeriesProperties.prototype, \"colorRange\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], ScatterSeriesProperties.prototype, \"title\", 2);\n__decorateClass([\n Validate(OBJECT)\n], ScatterSeriesProperties.prototype, \"marker\", 2);\n__decorateClass([\n Validate(OBJECT)\n], ScatterSeriesProperties.prototype, \"label\", 2);\n__decorateClass([\n Validate(OBJECT)\n], ScatterSeriesProperties.prototype, \"tooltip\", 2);\n\n// packages/ag-charts-community/src/chart/series/cartesian/scatterSeries.ts\nvar ScatterSeries = class extends CartesianSeries {\n constructor(moduleCtx) {\n super({\n moduleCtx,\n directionKeys: DEFAULT_CARTESIAN_DIRECTION_KEYS,\n directionNames: DEFAULT_CARTESIAN_DIRECTION_NAMES,\n pickModes: [\n 2 /* NEAREST_BY_MAIN_CATEGORY_AXIS_FIRST */,\n 3 /* NEAREST_NODE */,\n 0 /* EXACT_SHAPE_MATCH */\n ],\n pathsPerSeries: 0,\n hasMarkers: true,\n markerSelectionGarbageCollection: false,\n animationResetFns: {\n marker: resetMarkerFn,\n label: resetLabelFn\n }\n });\n this.properties = new ScatterSeriesProperties();\n this.colorScale = new ColorScale();\n }\n processData(dataController) {\n return __async(this, null, function* () {\n var _a, _b, _c;\n if (!this.properties.isValid() || this.data == null || !this.visible)\n return;\n const xScale = (_a = this.axes[\"x\" /* X */]) == null ? void 0 : _a.scale;\n const yScale = (_b = this.axes[\"y\" /* Y */]) == null ? void 0 : _b.scale;\n const { xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });\n const colorScaleType = this.colorScale.type;\n const { xKey, yKey, labelKey, colorKey, colorDomain, colorRange } = this.properties;\n const { dataModel, processedData } = yield this.requestDataModel(dataController, this.data, {\n props: [\n keyProperty(xKey, xScaleType, { id: \"xKey-raw\" }),\n keyProperty(yKey, yScaleType, { id: \"yKey-raw\" }),\n ...labelKey ? [keyProperty(labelKey, \"band\", { id: `labelKey-raw` })] : [],\n valueProperty(xKey, xScaleType, { id: `xValue` }),\n valueProperty(yKey, yScaleType, { id: `yValue` }),\n ...colorKey ? [valueProperty(colorKey, colorScaleType, { id: `colorValue` })] : [],\n ...labelKey ? [valueProperty(labelKey, \"band\", { id: `labelValue` })] : []\n ]\n });\n if (colorKey) {\n const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, `colorValue`);\n this.colorScale.domain = (_c = colorDomain != null ? colorDomain : processedData.domain.values[colorKeyIdx]) != null ? _c : [];\n this.colorScale.range = colorRange;\n this.colorScale.update();\n }\n this.animationState.transition(\"updateData\");\n });\n }\n getSeriesDomain(direction) {\n const { dataModel, processedData } = this;\n if (!processedData || !dataModel)\n return [];\n const id = direction === \"x\" /* X */ ? `xValue` : `yValue`;\n const dataDef = dataModel.resolveProcessedDataDefById(this, id);\n const domain = dataModel.getDomain(this, id, \"value\", processedData);\n if ((dataDef == null ? void 0 : dataDef.def.type) === \"value\" && (dataDef == null ? void 0 : dataDef.def.valueType) === \"category\") {\n return domain;\n }\n const axis = this.axes[direction];\n return fixNumericExtent(extent(domain), axis);\n }\n createNodeData() {\n return __async(this, null, function* () {\n var _a, _b, _c;\n const { axes, dataModel, processedData, colorScale } = this;\n const { xKey, yKey, labelKey, colorKey, xName, yName, labelName, marker, label, visible } = this.properties;\n const { placement } = label;\n const markerShape = getMarker(marker.shape);\n const xAxis = axes[\"x\" /* X */];\n const yAxis = axes[\"y\" /* Y */];\n if (!(dataModel && processedData && visible && xAxis && yAxis)) {\n return;\n }\n const xDataIdx = dataModel.resolveProcessedDataIndexById(this, `xValue`);\n const yDataIdx = dataModel.resolveProcessedDataIndexById(this, `yValue`);\n const colorDataIdx = colorKey ? dataModel.resolveProcessedDataIndexById(this, `colorValue`) : -1;\n const labelDataIdx = labelKey ? dataModel.resolveProcessedDataIndexById(this, `labelValue`) : -1;\n const xScale = xAxis.scale;\n const yScale = yAxis.scale;\n const xOffset = ((_a = xScale.bandwidth) != null ? _a : 0) / 2;\n const yOffset = ((_b = yScale.bandwidth) != null ? _b : 0) / 2;\n const nodeData = [];\n const font = label.getFont();\n for (const { values, datum } of (_c = processedData.data) != null ? _c : []) {\n const xDatum = values[xDataIdx];\n const yDatum = values[yDataIdx];\n const x = xScale.convert(xDatum) + xOffset;\n const y = yScale.convert(yDatum) + yOffset;\n const labelText = this.getLabelText(label, {\n value: labelKey ? values[labelDataIdx] : yDatum,\n datum,\n xKey,\n yKey,\n labelKey,\n xName,\n yName,\n labelName\n });\n const size = Text.getTextSize(labelText, font);\n const fill = colorKey ? colorScale.convert(values[colorDataIdx]) : void 0;\n nodeData.push({\n series: this,\n itemId: yKey,\n yKey,\n xKey,\n datum,\n xValue: xDatum,\n yValue: yDatum,\n capDefaults: { lengthRatioMultiplier: marker.getDiameter(), lengthMax: Infinity },\n point: { x, y, size: marker.size },\n midPoint: { x, y },\n fill,\n label: __spreadValues({ text: labelText }, size),\n marker: markerShape,\n placement\n });\n }\n return {\n itemId: yKey,\n nodeData,\n labelData: nodeData,\n scales: this.calculateScaling(),\n visible: this.visible\n };\n });\n }\n isPathOrSelectionDirty() {\n return this.properties.marker.isDirty();\n }\n getLabelData() {\n var _a, _b;\n return (_b = (_a = this.contextNodeData) == null ? void 0 : _a.labelData) != null ? _b : [];\n }\n markerFactory() {\n const { shape } = this.properties.marker;\n const MarkerShape = getMarker(shape);\n return new MarkerShape();\n }\n updateMarkerSelection(opts) {\n return __async(this, null, function* () {\n const { nodeData, markerSelection } = opts;\n if (this.properties.marker.isDirty()) {\n markerSelection.clear();\n markerSelection.cleanup();\n }\n return markerSelection.update(this.properties.marker.enabled ? nodeData : []);\n });\n }\n updateMarkerNodes(opts) {\n return __async(this, null, function* () {\n const { markerSelection, isHighlight: highlighted } = opts;\n const { xKey, yKey, labelKey, marker, highlightStyle } = this.properties;\n const baseStyle = mergeDefaults(highlighted && highlightStyle.item, marker.getStyle());\n markerSelection.each((node, datum) => {\n this.updateMarkerStyle(node, marker, { datum, highlighted, xKey, yKey, labelKey }, baseStyle);\n });\n if (!highlighted) {\n marker.markClean();\n }\n });\n }\n updateLabelSelection(opts) {\n return __async(this, null, function* () {\n var _a, _b;\n const placedLabels = this.isLabelEnabled() ? (_b = (_a = this.chart) == null ? void 0 : _a.placeLabels().get(this)) != null ? _b : [] : [];\n return opts.labelSelection.update(\n placedLabels.map(({ datum, x, y }) => __spreadProps(__spreadValues({}, datum), {\n point: { x, y, size: datum.point.size },\n placement: \"top\"\n })),\n (text) => {\n text.pointerEvents = 1 /* None */;\n }\n );\n });\n }\n updateLabelNodes(opts) {\n return __async(this, null, function* () {\n const { label } = this.properties;\n opts.labelSelection.each((text, datum) => {\n var _a, _b, _c, _d;\n text.text = datum.label.text;\n text.fill = label.color;\n text.x = (_b = (_a = datum.point) == null ? void 0 : _a.x) != null ? _b : 0;\n text.y = (_d = (_c = datum.point) == null ? void 0 : _c.y) != null ? _d : 0;\n text.fontStyle = label.fontStyle;\n text.fontWeight = label.fontWeight;\n text.fontSize = label.fontSize;\n text.fontFamily = label.fontFamily;\n text.textAlign = \"left\";\n text.textBaseline = \"top\";\n });\n });\n }\n getTooltipHtml(nodeDatum) {\n const xAxis = this.axes[\"x\" /* X */];\n const yAxis = this.axes[\"y\" /* Y */];\n if (!this.properties.isValid() || !xAxis || !yAxis) {\n return EMPTY_TOOLTIP_CONTENT;\n }\n const { xKey, yKey, labelKey, xName, yName, labelName, title = yName, marker, tooltip } = this.properties;\n const { datum, xValue, yValue, label, itemId } = nodeDatum;\n const baseStyle = mergeDefaults(\n { fill: nodeDatum.fill, strokeWidth: this.getStrokeWidth(marker.strokeWidth) },\n marker.getStyle()\n );\n const { fill: color = \"gray\" } = this.getMarkerStyle(\n marker,\n { datum: nodeDatum, highlighted: false, xKey, yKey, labelKey },\n baseStyle\n );\n const xString = sanitizeHtml(xAxis.formatDatum(xValue));\n const yString = sanitizeHtml(yAxis.formatDatum(yValue));\n let content = `${sanitizeHtml(xName != null ? xName : xKey)}: ${xString}
${sanitizeHtml(yName != null ? yName : yKey)}: ${yString}`;\n if (labelKey) {\n content = `${sanitizeHtml(labelName != null ? labelName : labelKey)}: ${sanitizeHtml(label.text)}
` + content;\n }\n return tooltip.toTooltipHtml(\n { title, content, backgroundColor: color },\n __spreadValues({\n datum,\n itemId,\n xKey,\n xName,\n yKey,\n yName,\n labelKey,\n labelName,\n title,\n color,\n seriesId: this.id\n }, this.getModuleTooltipParams())\n );\n }\n getLegendData(legendType) {\n var _a, _b, _c, _d, _e, _f;\n const { yKey, yName, title, marker, visible } = this.properties;\n const { fill, stroke, fillOpacity, strokeOpacity, strokeWidth } = marker;\n if (!((_a = this.data) == null ? void 0 : _a.length) || !this.properties.isValid() || legendType !== \"category\") {\n return [];\n }\n return [\n {\n legendType: \"category\",\n id: this.id,\n itemId: yKey,\n seriesId: this.id,\n enabled: visible,\n label: {\n text: (_b = title != null ? title : yName) != null ? _b : yKey\n },\n marker: {\n shape: marker.shape,\n fill: (_d = (_c = marker.fill) != null ? _c : fill) != null ? _d : \"rgba(0, 0, 0, 0)\",\n stroke: (_f = (_e = marker.stroke) != null ? _e : stroke) != null ? _f : \"rgba(0, 0, 0, 0)\",\n fillOpacity: fillOpacity != null ? fillOpacity : 1,\n strokeOpacity: strokeOpacity != null ? strokeOpacity : 1,\n strokeWidth: strokeWidth != null ? strokeWidth : 0\n }\n }\n ];\n }\n animateEmptyUpdateReady(data) {\n const { markerSelection, labelSelection, annotationSelections } = data;\n markerScaleInAnimation(this, this.ctx.animationManager, markerSelection);\n seriesLabelFadeInAnimation(this, \"labels\", this.ctx.animationManager, labelSelection);\n seriesLabelFadeInAnimation(this, \"annotations\", this.ctx.animationManager, ...annotationSelections);\n }\n isLabelEnabled() {\n return this.properties.label.enabled;\n }\n nodeFactory() {\n return new Group();\n }\n getFormattedMarkerStyle(datum) {\n const { xKey, yKey, labelKey } = this.properties;\n return this.getMarkerStyle(this.properties.marker, { datum, xKey, yKey, labelKey, highlighted: true });\n }\n computeFocusBounds(opts) {\n return computeMarkerFocusBounds(this, opts);\n }\n};\nScatterSeries.className = \"ScatterSeries\";\nScatterSeries.type = \"scatter\";\n\n// packages/ag-charts-community/src/chart/series/cartesian/scatterSeriesModule.ts\nvar ScatterSeriesModule = {\n type: \"series\",\n optionsKey: \"series[]\",\n packageType: \"community\",\n chartTypes: [\"cartesian\"],\n identifier: \"scatter\",\n instanceConstructor: ScatterSeries,\n defaultAxes: [\n {\n type: \"number\" /* NUMBER */,\n position: \"bottom\" /* BOTTOM */\n },\n {\n type: \"number\" /* NUMBER */,\n position: \"left\" /* LEFT */\n }\n ],\n themeTemplate: {\n series: {\n __extends__: EXTENDS_SERIES_DEFAULTS,\n tooltip: { position: { type: \"node\" } },\n marker: {\n __extends__: EXTENDS_CARTESIAN_MARKER_DEFAULTS,\n fillOpacity: 0.8\n },\n label: {\n enabled: false,\n fontSize: 12,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_LABEL_COLOUR\n }\n }\n },\n enterpriseThemeTemplate: {\n series: {\n errorBar: {\n cap: {\n lengthRatio: 1\n }\n }\n }\n },\n paletteFactory: markerPaletteFactory\n};\n\n// packages/ag-charts-community/src/scene/sectorBox.ts\nvar SectorBox = class _SectorBox {\n constructor(startAngle, endAngle, innerRadius, outerRadius) {\n this.startAngle = startAngle;\n this.endAngle = endAngle;\n this.innerRadius = innerRadius;\n this.outerRadius = outerRadius;\n }\n clone() {\n const { startAngle, endAngle, innerRadius, outerRadius } = this;\n return new _SectorBox(startAngle, endAngle, innerRadius, outerRadius);\n }\n [interpolate](other, d) {\n return new _SectorBox(\n this.startAngle * (1 - d) + other.startAngle * d,\n this.endAngle * (1 - d) + other.endAngle * d,\n this.innerRadius * (1 - d) + other.innerRadius * d,\n this.outerRadius * (1 - d) + other.outerRadius * d\n );\n }\n};\n\n// packages/ag-charts-community/src/scene/util/sector.ts\nfunction isPointInSector(x, y, sector) {\n const radius = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\n const { innerRadius, outerRadius } = sector;\n if (sector.startAngle === sector.endAngle || radius < Math.min(innerRadius, outerRadius) || radius > Math.max(innerRadius, outerRadius)) {\n return false;\n }\n const startAngle = normalizeAngle180(sector.startAngle);\n const endAngle = normalizeAngle180(sector.endAngle);\n const angle = Math.atan2(y, x);\n return startAngle < endAngle ? angle <= endAngle && angle >= startAngle : angle <= endAngle && angle >= -Math.PI || angle >= startAngle && angle <= Math.PI;\n}\nfunction lineCollidesSector(line, sector) {\n const { startAngle, endAngle, innerRadius, outerRadius } = sector;\n const outerStart = { x: outerRadius * Math.cos(startAngle), y: outerRadius * Math.sin(startAngle) };\n const outerEnd = { x: outerRadius * Math.cos(endAngle), y: outerRadius * Math.sin(endAngle) };\n const innerStart = innerRadius === 0 ? { x: 0, y: 0 } : { x: innerRadius * Math.cos(startAngle), y: innerRadius * Math.sin(startAngle) };\n const innerEnd = innerRadius === 0 ? { x: 0, y: 0 } : { x: innerRadius * Math.cos(endAngle), y: innerRadius * Math.sin(endAngle) };\n return segmentIntersection(\n line.start.x,\n line.start.y,\n line.end.x,\n line.end.y,\n outerStart.x,\n outerStart.y,\n innerStart.x,\n innerStart.y\n ) || segmentIntersection(\n line.start.x,\n line.start.y,\n line.end.x,\n line.end.y,\n outerEnd.x,\n outerEnd.y,\n innerEnd.x,\n innerEnd.y\n ) || arcIntersections(\n 0,\n 0,\n outerRadius,\n startAngle,\n endAngle,\n true,\n line.start.x,\n line.start.y,\n line.end.x,\n line.end.y\n );\n}\nfunction boxCollidesSector(box, sector) {\n const topLeft = { x: box.x, y: box.y };\n const topRight = { x: box.x + box.width, y: box.y };\n const bottomLeft = { x: box.x, y: box.y + box.height };\n const bottomRight = { x: box.x + box.width, y: box.y + box.height };\n return lineCollidesSector({ start: topLeft, end: topRight }, sector) || lineCollidesSector({ start: bottomLeft, end: bottomRight }, sector);\n}\nfunction radiiScalingFactor(r, sweep, a, b) {\n if (a === 0 && b === 0)\n return 0;\n const fs1 = Math.asin(Math.abs(1 * a) / (r + 1 * a)) + Math.asin(Math.abs(1 * b) / (r + 1 * b)) - sweep;\n if (fs1 < 0)\n return 1;\n let start = 0;\n let end = 1;\n for (let i = 0; i < 8; i += 1) {\n const s = (start + end) / 2;\n const fs = Math.asin(Math.abs(s * a) / (r + s * a)) + Math.asin(Math.abs(s * b) / (r + s * b)) - sweep;\n if (fs < 0) {\n start = s;\n } else {\n end = s;\n }\n }\n return start;\n}\nvar delta = 1e-6;\nfunction clockwiseAngle(angle, relativeToStartAngle) {\n if (angleBetween(angle, relativeToStartAngle) < delta) {\n return relativeToStartAngle;\n } else {\n return normalizeAngle360(angle - relativeToStartAngle) + relativeToStartAngle;\n }\n}\nfunction clockwiseAngles(startAngle, endAngle, relativeToStartAngle = 0) {\n const fullPie = Math.abs(endAngle - startAngle) >= 2 * Math.PI;\n const sweepAngle = fullPie ? 2 * Math.PI : normalizeAngle360(endAngle - startAngle);\n startAngle = clockwiseAngle(startAngle, relativeToStartAngle);\n endAngle = startAngle + sweepAngle;\n return { startAngle, endAngle };\n}\nfunction arcRadialLineIntersectionAngle(cx, cy, r, startAngle, endAngle, clipAngle) {\n const sinA = Math.sin(clipAngle);\n const cosA = Math.cos(clipAngle);\n const c = __pow(cx, 2) + __pow(cy, 2) - __pow(r, 2);\n let p0x = NaN;\n let p0y = NaN;\n let p1x = NaN;\n let p1y = NaN;\n if (cosA > 0.5) {\n const tanA = sinA / cosA;\n const a = 1 + __pow(tanA, 2);\n const b = -2 * (cx + cy * tanA);\n const d = __pow(b, 2) - 4 * a * c;\n if (d < 0)\n return;\n const x0 = (-b + Math.sqrt(d)) / (2 * a);\n const x1 = (-b - Math.sqrt(d)) / (2 * a);\n p0x = x0;\n p0y = x0 * tanA;\n p1x = x1;\n p1y = x1 * tanA;\n } else {\n const cotA = cosA / sinA;\n const a = 1 + __pow(cotA, 2);\n const b = -2 * (cy + cx * cotA);\n const d = __pow(b, 2) - 4 * a * c;\n if (d < 0)\n return;\n const y0 = (-b + Math.sqrt(d)) / (2 * a);\n const y1 = (-b - Math.sqrt(d)) / (2 * a);\n p0x = y0 * cotA;\n p0y = y0;\n p1x = y1 * cotA;\n p1y = y1;\n }\n const normalisedX = cosA;\n const normalisedY = sinA;\n const p0DotNormalized = p0x * normalisedX + p0y * normalisedY;\n const p1DotNormalized = p1x * normalisedX + p1y * normalisedY;\n const a0 = p0DotNormalized > 0 ? clockwiseAngle(Math.atan2(p0y - cy, p0x - cx), startAngle) : NaN;\n const a1 = p1DotNormalized > 0 ? clockwiseAngle(Math.atan2(p1y - cy, p1x - cx), startAngle) : NaN;\n if (a0 >= startAngle && a0 <= endAngle) {\n return a0;\n } else if (a1 >= startAngle && a1 <= endAngle) {\n return a1;\n }\n}\nfunction arcCircleIntersectionAngle(cx, cy, r, startAngle, endAngle, circleR) {\n const d = Math.hypot(cx, cy);\n const d1 = (__pow(d, 2) - __pow(r, 2) + __pow(circleR, 2)) / (2 * d);\n const d2 = d - d1;\n const theta = Math.atan2(cy, cx);\n const deltaTheta = Math.acos(-d2 / r);\n const a0 = clockwiseAngle(theta + deltaTheta, startAngle);\n const a1 = clockwiseAngle(theta - deltaTheta, startAngle);\n if (a0 >= startAngle && a0 <= endAngle) {\n return a0;\n } else if (a1 >= startAngle && a1 <= endAngle) {\n return a1;\n }\n}\n\n// packages/ag-charts-community/src/scene/shape/sector.ts\nvar Arc = class {\n constructor(cx, cy, r, a0, a1) {\n this.cx = cx;\n this.cy = cy;\n this.r = r;\n this.a0 = a0;\n this.a1 = a1;\n if (this.a0 >= this.a1) {\n this.a0 = NaN;\n this.a1 = NaN;\n }\n }\n isValid() {\n return Number.isFinite(this.a0) && Number.isFinite(this.a1);\n }\n pointAt(a) {\n return {\n x: this.cx + this.r * Math.cos(a),\n y: this.cy + this.r * Math.sin(a)\n };\n }\n clipStart(a) {\n if (a == null || !this.isValid() || a < this.a0)\n return;\n this.a0 = a;\n if (Number.isNaN(a) || this.a0 >= this.a1) {\n this.a0 = NaN;\n this.a1 = NaN;\n }\n }\n clipEnd(a) {\n if (a == null || !this.isValid() || a > this.a1)\n return;\n this.a1 = a;\n if (Number.isNaN(a) || this.a0 >= this.a1) {\n this.a0 = NaN;\n this.a1 = NaN;\n }\n }\n};\nvar Sector = class extends Path {\n constructor() {\n super(...arguments);\n this.centerX = 0;\n this.centerY = 0;\n this.innerRadius = 10;\n this.outerRadius = 20;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.clipSector = void 0;\n this.concentricEdgeInset = 0;\n this.radialEdgeInset = 0;\n this.startOuterCornerRadius = 0;\n this.endOuterCornerRadius = 0;\n this.startInnerCornerRadius = 0;\n this.endInnerCornerRadius = 0;\n }\n set inset(value) {\n this.concentricEdgeInset = value;\n this.radialEdgeInset = value;\n }\n set cornerRadius(value) {\n this.startOuterCornerRadius = value;\n this.endOuterCornerRadius = value;\n this.startInnerCornerRadius = value;\n this.endInnerCornerRadius = value;\n }\n computeBBox() {\n const radius = this.outerRadius;\n return new BBox(this.centerX - radius, this.centerY - radius, radius * 2, radius * 2);\n }\n normalizedRadii() {\n const { concentricEdgeInset } = this;\n return {\n innerRadius: Math.max(Math.min(this.innerRadius, this.outerRadius) + concentricEdgeInset, 0),\n outerRadius: Math.max(Math.max(this.innerRadius, this.outerRadius) - concentricEdgeInset, 0)\n };\n }\n normalizedClipSector() {\n const { clipSector } = this;\n if (clipSector == null)\n return;\n const { startAngle, endAngle } = clockwiseAngles(this.startAngle, this.endAngle);\n const { innerRadius, outerRadius } = this.normalizedRadii();\n const clipAngles = clockwiseAngles(clipSector.startAngle, clipSector.endAngle, startAngle);\n return new SectorBox(\n Math.max(startAngle, clipAngles.startAngle),\n Math.min(endAngle, clipAngles.endAngle),\n Math.max(innerRadius, clipSector.innerRadius),\n Math.min(outerRadius, clipSector.outerRadius)\n );\n }\n getAngleOffset(radius) {\n return radius > 0 ? this.radialEdgeInset / radius : 0;\n }\n arc(r, angleSweep, a0, a1, outerArc, innerArc, start, inner) {\n if (r <= 0)\n return;\n const { startAngle, endAngle } = clockwiseAngles(this.startAngle, this.endAngle);\n const { innerRadius, outerRadius } = this.normalizedRadii();\n const clipSector = this.normalizedClipSector();\n if (inner && innerRadius <= 0)\n return;\n const innerAngleOffset = this.getAngleOffset(innerRadius);\n const outerAngleOffset = this.getAngleOffset(outerRadius);\n const angleOffset = inner ? this.getAngleOffset(innerRadius + r) : this.getAngleOffset(outerRadius - r);\n const angle = start ? startAngle + angleOffset + angleSweep : endAngle - angleOffset - angleSweep;\n const radius = inner ? innerRadius + r : outerRadius - r;\n const cx = radius * Math.cos(angle);\n const cy = radius * Math.sin(angle);\n if (clipSector != null) {\n const delta2 = 1e-6;\n if (!start && !(angle >= startAngle - delta2 && angle <= clipSector.endAngle - delta2))\n return;\n if (start && !(angle >= clipSector.startAngle + delta2 && angle <= endAngle - delta2))\n return;\n if (inner && !(radius >= clipSector.innerRadius - delta2))\n return;\n if (!inner && !(radius <= clipSector.outerRadius + delta2))\n return;\n }\n const arc = new Arc(cx, cy, r, a0, a1);\n if (clipSector != null) {\n if (inner) {\n arc.clipStart(\n arcRadialLineIntersectionAngle(cx, cy, r, a0, a1, clipSector.endAngle - innerAngleOffset)\n );\n arc.clipEnd(\n arcRadialLineIntersectionAngle(cx, cy, r, a0, a1, clipSector.startAngle + innerAngleOffset)\n );\n } else {\n arc.clipStart(\n arcRadialLineIntersectionAngle(cx, cy, r, a0, a1, clipSector.startAngle + outerAngleOffset)\n );\n arc.clipEnd(arcRadialLineIntersectionAngle(cx, cy, r, a0, a1, clipSector.endAngle - outerAngleOffset));\n }\n let circleClipStart;\n let circleClipEnd;\n if (start) {\n circleClipStart = arcCircleIntersectionAngle(cx, cy, r, a0, a1, clipSector.innerRadius);\n circleClipEnd = arcCircleIntersectionAngle(cx, cy, r, a0, a1, clipSector.outerRadius);\n } else {\n circleClipStart = arcCircleIntersectionAngle(cx, cy, r, a0, a1, clipSector.outerRadius);\n circleClipEnd = arcCircleIntersectionAngle(cx, cy, r, a0, a1, clipSector.innerRadius);\n }\n arc.clipStart(circleClipStart);\n arc.clipEnd(circleClipEnd);\n if (circleClipStart != null) {\n const { x: x2, y: y2 } = arc.pointAt(circleClipStart);\n const theta2 = clockwiseAngle(Math.atan2(y2, x2), startAngle);\n if (start) {\n innerArc == null ? void 0 : innerArc.clipStart(theta2);\n } else {\n outerArc.clipEnd(theta2);\n }\n }\n if (circleClipEnd != null) {\n const { x: x2, y: y2 } = arc.pointAt(circleClipEnd);\n const theta2 = clockwiseAngle(Math.atan2(y2, x2), startAngle);\n if (start) {\n outerArc.clipStart(theta2);\n } else {\n innerArc == null ? void 0 : innerArc.clipEnd(theta2);\n }\n }\n }\n if (clipSector != null) {\n const { x: x2, y: y2 } = arc.pointAt((arc.a0 + arc.a1) / 2);\n if (!isPointInSector(x2, y2, clipSector))\n return;\n }\n const { x, y } = arc.pointAt(start === inner ? arc.a0 : arc.a1);\n const theta = clockwiseAngle(Math.atan2(y, x), startAngle);\n const radialArc = inner ? innerArc : outerArc;\n if (start) {\n radialArc == null ? void 0 : radialArc.clipStart(theta);\n } else {\n radialArc == null ? void 0 : radialArc.clipEnd(theta);\n }\n return arc;\n }\n updatePath() {\n var _a, _b, _c, _d, _e;\n const delta2 = 1e-6;\n const { path, centerX, centerY, concentricEdgeInset, radialEdgeInset } = this;\n let { startOuterCornerRadius, endOuterCornerRadius, startInnerCornerRadius, endInnerCornerRadius } = this;\n const { startAngle, endAngle } = clockwiseAngles(this.startAngle, this.endAngle);\n const { innerRadius, outerRadius } = this.normalizedRadii();\n const clipSector = this.normalizedClipSector();\n const sweepAngle = endAngle - startAngle;\n const fullPie = sweepAngle >= 2 * Math.PI - delta2;\n path.clear();\n if (((_a = clipSector == null ? void 0 : clipSector.startAngle) != null ? _a : startAngle) === ((_b = clipSector == null ? void 0 : clipSector.endAngle) != null ? _b : endAngle)) {\n return;\n } else if (fullPie && this.clipSector == null && startOuterCornerRadius === 0 && endOuterCornerRadius === 0 && startInnerCornerRadius === 0 && endInnerCornerRadius === 0) {\n path.moveTo(centerX + outerRadius * Math.cos(startAngle), centerY + outerRadius * Math.sin(startAngle));\n path.arc(centerX, centerY, outerRadius, startAngle, endAngle);\n if (innerRadius > concentricEdgeInset) {\n path.moveTo(centerX + innerRadius * Math.cos(endAngle), centerY + innerRadius * Math.sin(endAngle));\n path.arc(centerX, centerY, innerRadius, endAngle, startAngle, true);\n }\n path.closePath();\n return;\n }\n const innerAngleOffset = this.getAngleOffset(innerRadius);\n const outerAngleOffset = this.getAngleOffset(outerRadius);\n const outerAngleExceeded = sweepAngle < 2 * outerAngleOffset;\n if (outerAngleExceeded)\n return;\n const hasInnerSweep = ((_c = clipSector == null ? void 0 : clipSector.innerRadius) != null ? _c : innerRadius) > concentricEdgeInset;\n const innerAngleExceeded = innerRadius < concentricEdgeInset || sweepAngle < 2 * innerAngleOffset;\n const radialLength = outerRadius - innerRadius;\n const maxRadialLength = Math.max(\n startOuterCornerRadius,\n startInnerCornerRadius,\n endOuterCornerRadius,\n endInnerCornerRadius\n );\n const initialScalingFactor = maxRadialLength > 0 ? Math.min(radialLength / maxRadialLength, 1) : 1;\n startOuterCornerRadius *= initialScalingFactor;\n endOuterCornerRadius *= initialScalingFactor;\n startInnerCornerRadius *= initialScalingFactor;\n endInnerCornerRadius *= initialScalingFactor;\n const outerScalingFactor = radiiScalingFactor(\n outerRadius,\n sweepAngle - 2 * outerAngleOffset,\n -startOuterCornerRadius,\n -endOuterCornerRadius\n );\n startOuterCornerRadius *= outerScalingFactor;\n endOuterCornerRadius *= outerScalingFactor;\n if (!innerAngleExceeded && hasInnerSweep) {\n const innerScalingFactor = radiiScalingFactor(\n innerRadius,\n sweepAngle - 2 * innerAngleOffset,\n startInnerCornerRadius,\n endInnerCornerRadius\n );\n startInnerCornerRadius *= innerScalingFactor;\n endInnerCornerRadius *= innerScalingFactor;\n } else {\n startInnerCornerRadius = 0;\n endInnerCornerRadius = 0;\n }\n const maxCombinedRadialLength = Math.max(\n startOuterCornerRadius + startInnerCornerRadius,\n endOuterCornerRadius + endInnerCornerRadius\n );\n const edgesScalingFactor = maxCombinedRadialLength > 0 ? Math.min(radialLength / maxCombinedRadialLength, 1) : 1;\n startOuterCornerRadius *= edgesScalingFactor;\n endOuterCornerRadius *= edgesScalingFactor;\n startInnerCornerRadius *= edgesScalingFactor;\n endInnerCornerRadius *= edgesScalingFactor;\n let startOuterCornerRadiusAngleSweep = 0;\n let endOuterCornerRadiusAngleSweep = 0;\n const startOuterCornerRadiusSweep = startOuterCornerRadius / (outerRadius - startOuterCornerRadius);\n const endOuterCornerRadiusSweep = endOuterCornerRadius / (outerRadius - endOuterCornerRadius);\n if (startOuterCornerRadiusSweep >= 0 && startOuterCornerRadiusSweep < 1 - delta2) {\n startOuterCornerRadiusAngleSweep = Math.asin(startOuterCornerRadiusSweep);\n } else {\n startOuterCornerRadiusAngleSweep = sweepAngle / 2;\n const maxStartOuterCornerRadius = outerRadius / (1 / Math.sin(startOuterCornerRadiusAngleSweep) + 1);\n startOuterCornerRadius = Math.min(maxStartOuterCornerRadius, startOuterCornerRadius);\n }\n if (endOuterCornerRadiusSweep >= 0 && endOuterCornerRadiusSweep < 1 - delta2) {\n endOuterCornerRadiusAngleSweep = Math.asin(endOuterCornerRadiusSweep);\n } else {\n endOuterCornerRadiusAngleSweep = sweepAngle / 2;\n const maxEndOuterCornerRadius = outerRadius / (1 / Math.sin(endOuterCornerRadiusAngleSweep) + 1);\n endOuterCornerRadius = Math.min(maxEndOuterCornerRadius, endOuterCornerRadius);\n }\n const startInnerCornerRadiusAngleSweep = Math.asin(\n startInnerCornerRadius / (innerRadius + startInnerCornerRadius)\n );\n const endInnerCornerRadiusAngleSweep = Math.asin(endInnerCornerRadius / (innerRadius + endInnerCornerRadius));\n const outerArcRadius = (_d = clipSector == null ? void 0 : clipSector.outerRadius) != null ? _d : outerRadius;\n const outerArcRadiusOffset = this.getAngleOffset(outerArcRadius);\n const outerArc = new Arc(\n 0,\n 0,\n outerArcRadius,\n startAngle + outerArcRadiusOffset,\n endAngle - outerArcRadiusOffset\n );\n const innerArcRadius = (_e = clipSector == null ? void 0 : clipSector.innerRadius) != null ? _e : innerRadius;\n const innerArcRadiusOffset = this.getAngleOffset(innerArcRadius);\n const innerArc = hasInnerSweep ? new Arc(0, 0, innerArcRadius, startAngle + innerArcRadiusOffset, endAngle - innerArcRadiusOffset) : void 0;\n if (clipSector != null) {\n outerArc.clipStart(clipSector.startAngle);\n outerArc.clipEnd(clipSector.endAngle);\n innerArc == null ? void 0 : innerArc.clipStart(clipSector.startAngle);\n innerArc == null ? void 0 : innerArc.clipEnd(clipSector.endAngle);\n }\n const startOuterArc = this.arc(\n startOuterCornerRadius,\n startOuterCornerRadiusAngleSweep,\n startAngle - Math.PI * 0.5,\n startAngle + startOuterCornerRadiusAngleSweep,\n outerArc,\n innerArc,\n true,\n false\n );\n const endOuterArc = this.arc(\n endOuterCornerRadius,\n endOuterCornerRadiusAngleSweep,\n endAngle - endOuterCornerRadiusAngleSweep,\n endAngle + Math.PI * 0.5,\n outerArc,\n innerArc,\n false,\n false\n );\n const endInnerArc = this.arc(\n endInnerCornerRadius,\n endInnerCornerRadiusAngleSweep,\n endAngle + Math.PI * 0.5,\n endAngle + Math.PI - endInnerCornerRadiusAngleSweep,\n outerArc,\n innerArc,\n false,\n true\n );\n const startInnerArc = this.arc(\n startInnerCornerRadius,\n startInnerCornerRadiusAngleSweep,\n startAngle + Math.PI + startInnerCornerRadiusAngleSweep,\n startAngle + Math.PI * 1.5,\n outerArc,\n innerArc,\n true,\n true\n );\n if (innerAngleExceeded) {\n const x = sweepAngle < Math.PI * 0.5 ? radialEdgeInset * (1 + Math.cos(sweepAngle)) / Math.sin(sweepAngle) : NaN;\n let r;\n if (x > 0 && x < outerRadius) {\n r = Math.max(Math.hypot(radialEdgeInset, x), innerRadius);\n } else {\n r = innerRadius;\n }\n const midAngle = startAngle + sweepAngle * 0.5;\n path.moveTo(centerX + r * Math.cos(midAngle), centerY + r * Math.sin(midAngle));\n } else if ((startInnerArc == null ? void 0 : startInnerArc.isValid()) === true) {\n const { x, y } = startInnerArc.pointAt(startInnerArc.a1);\n path.moveTo(centerX + x, centerY + y);\n } else if ((innerArc == null ? void 0 : innerArc.isValid()) === true) {\n const { x, y } = innerArc.pointAt(innerArc.a0);\n path.moveTo(centerX + x, centerY + y);\n } else {\n const midAngle = startAngle + sweepAngle / 2;\n const cx = innerRadius * Math.cos(midAngle);\n const cy = innerRadius * Math.sin(midAngle);\n path.moveTo(centerX + cx, centerY + cy);\n }\n if ((startOuterArc == null ? void 0 : startOuterArc.isValid()) === true) {\n const { cx, cy, r, a0, a1 } = startOuterArc;\n path.arc(centerX + cx, centerY + cy, r, a0, a1);\n }\n if (outerArc.isValid()) {\n const { r, a0, a1 } = outerArc;\n path.arc(centerX, centerY, r, a0, a1);\n }\n if ((endOuterArc == null ? void 0 : endOuterArc.isValid()) === true) {\n const { cx, cy, r, a0, a1 } = endOuterArc;\n path.arc(centerX + cx, centerY + cy, r, a0, a1);\n }\n if (!innerAngleExceeded) {\n if ((endInnerArc == null ? void 0 : endInnerArc.isValid()) === true) {\n const { cx, cy, r, a0, a1 } = endInnerArc;\n path.arc(centerX + cx, centerY + cy, r, a0, a1);\n }\n if ((innerArc == null ? void 0 : innerArc.isValid()) === true) {\n const { r, a0, a1 } = innerArc;\n path.arc(centerX, centerY, r, a1, a0, true);\n }\n if ((startInnerArc == null ? void 0 : startInnerArc.isValid()) === true) {\n const { cx, cy, r, a0, a1 } = startInnerArc;\n path.arc(centerX + cx, centerY + cy, r, a0, a1);\n }\n }\n path.closePath();\n }\n isPointInPath(x, y) {\n var _a;\n const point = this.transformPoint(x, y);\n const { startAngle, endAngle, innerRadius, outerRadius } = (_a = this.clipSector) != null ? _a : this;\n return isPointInSector(point.x, point.y, {\n startAngle,\n endAngle,\n innerRadius: Math.min(innerRadius, outerRadius),\n outerRadius: Math.max(innerRadius, outerRadius)\n });\n }\n};\nSector.className = \"Sector\";\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"centerX\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"centerY\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"innerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"outerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"startAngle\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"endAngle\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"clipSector\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"concentricEdgeInset\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"radialEdgeInset\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"startOuterCornerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"endOuterCornerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"startInnerCornerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Sector.prototype, \"endInnerCornerRadius\", 2);\n\n// packages/ag-charts-community/src/chart/series/polar/donutSeriesProperties.ts\nvar DonutTitle = class extends Caption {\n constructor() {\n super(...arguments);\n this.showInLegend = false;\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], DonutTitle.prototype, \"showInLegend\", 2);\nvar DonutInnerLabel = class extends Label {\n constructor() {\n super(...arguments);\n this.margin = 2;\n }\n set(properties, _reset) {\n return super.set(properties);\n }\n};\n__decorateClass([\n Validate(STRING)\n], DonutInnerLabel.prototype, \"text\", 2);\n__decorateClass([\n Validate(NUMBER)\n], DonutInnerLabel.prototype, \"margin\", 2);\nvar DonutInnerCircle = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.fill = \"transparent\";\n this.fillOpacity = 1;\n }\n};\n__decorateClass([\n Validate(COLOR_STRING)\n], DonutInnerCircle.prototype, \"fill\", 2);\n__decorateClass([\n Validate(RATIO)\n], DonutInnerCircle.prototype, \"fillOpacity\", 2);\nvar DonutSeriesCalloutLabel = class extends Label {\n constructor() {\n super(...arguments);\n this.offset = 3;\n this.minAngle = 0;\n this.minSpacing = 4;\n this.maxCollisionOffset = 50;\n this.avoidCollisions = true;\n }\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], DonutSeriesCalloutLabel.prototype, \"offset\", 2);\n__decorateClass([\n Validate(DEGREE)\n], DonutSeriesCalloutLabel.prototype, \"minAngle\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], DonutSeriesCalloutLabel.prototype, \"minSpacing\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], DonutSeriesCalloutLabel.prototype, \"maxCollisionOffset\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], DonutSeriesCalloutLabel.prototype, \"avoidCollisions\", 2);\nvar DonutSeriesSectorLabel = class extends Label {\n constructor() {\n super(...arguments);\n this.positionOffset = 0;\n this.positionRatio = 0.5;\n }\n};\n__decorateClass([\n Validate(NUMBER)\n], DonutSeriesSectorLabel.prototype, \"positionOffset\", 2);\n__decorateClass([\n Validate(RATIO)\n], DonutSeriesSectorLabel.prototype, \"positionRatio\", 2);\nvar DonutSeriesCalloutLine = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.length = 10;\n this.strokeWidth = 1;\n }\n};\n__decorateClass([\n Validate(COLOR_STRING_ARRAY, { optional: true })\n], DonutSeriesCalloutLine.prototype, \"colors\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], DonutSeriesCalloutLine.prototype, \"length\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], DonutSeriesCalloutLine.prototype, \"strokeWidth\", 2);\nvar DonutSeriesProperties = class extends SeriesProperties {\n constructor() {\n super(...arguments);\n this.fills = Object.values(DEFAULT_FILLS);\n this.strokes = Object.values(DEFAULT_STROKES);\n this.fillOpacity = 1;\n this.strokeOpacity = 1;\n this.lineDash = [0];\n this.lineDashOffset = 0;\n this.cornerRadius = 0;\n this.rotation = 0;\n this.outerRadiusOffset = 0;\n this.outerRadiusRatio = 1;\n this.strokeWidth = 1;\n this.sectorSpacing = void 0;\n this.innerLabels = new PropertiesArray(DonutInnerLabel);\n this.title = new DonutTitle();\n this.innerCircle = new DonutInnerCircle();\n this.shadow = new DropShadow();\n this.calloutLabel = new DonutSeriesCalloutLabel();\n this.sectorLabel = new DonutSeriesSectorLabel();\n this.calloutLine = new DonutSeriesCalloutLine();\n this.tooltip = new SeriesTooltip();\n this.__BACKGROUND_COLOR_DO_NOT_USE = void 0;\n }\n isValid() {\n const superIsValid = super.isValid();\n if (this.innerRadiusRatio == null && this.innerRadiusOffset == null) {\n Logger.warnOnce(\n \"Either an [innerRadiusRatio] or an [innerRadiusOffset] must be set to render a donut series.\"\n );\n return false;\n }\n return superIsValid;\n }\n};\n__decorateClass([\n Validate(STRING)\n], DonutSeriesProperties.prototype, \"angleKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], DonutSeriesProperties.prototype, \"angleName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], DonutSeriesProperties.prototype, \"radiusKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], DonutSeriesProperties.prototype, \"radiusName\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], DonutSeriesProperties.prototype, \"radiusMin\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], DonutSeriesProperties.prototype, \"radiusMax\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], DonutSeriesProperties.prototype, \"calloutLabelKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], DonutSeriesProperties.prototype, \"calloutLabelName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], DonutSeriesProperties.prototype, \"sectorLabelKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], DonutSeriesProperties.prototype, \"sectorLabelName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], DonutSeriesProperties.prototype, \"legendItemKey\", 2);\n__decorateClass([\n Validate(COLOR_STRING_ARRAY)\n], DonutSeriesProperties.prototype, \"fills\", 2);\n__decorateClass([\n Validate(COLOR_STRING_ARRAY)\n], DonutSeriesProperties.prototype, \"strokes\", 2);\n__decorateClass([\n Validate(RATIO)\n], DonutSeriesProperties.prototype, \"fillOpacity\", 2);\n__decorateClass([\n Validate(RATIO)\n], DonutSeriesProperties.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n Validate(LINE_DASH)\n], DonutSeriesProperties.prototype, \"lineDash\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], DonutSeriesProperties.prototype, \"lineDashOffset\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], DonutSeriesProperties.prototype, \"cornerRadius\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], DonutSeriesProperties.prototype, \"formatter\", 2);\n__decorateClass([\n Validate(DEGREE)\n], DonutSeriesProperties.prototype, \"rotation\", 2);\n__decorateClass([\n Validate(NUMBER)\n], DonutSeriesProperties.prototype, \"outerRadiusOffset\", 2);\n__decorateClass([\n Validate(RATIO)\n], DonutSeriesProperties.prototype, \"outerRadiusRatio\", 2);\n__decorateClass([\n Validate(NUMBER, { optional: true })\n], DonutSeriesProperties.prototype, \"innerRadiusOffset\", 2);\n__decorateClass([\n Validate(RATIO, { optional: true })\n], DonutSeriesProperties.prototype, \"innerRadiusRatio\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], DonutSeriesProperties.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], DonutSeriesProperties.prototype, \"sectorSpacing\", 2);\n__decorateClass([\n Validate(OBJECT_ARRAY)\n], DonutSeriesProperties.prototype, \"innerLabels\", 2);\n__decorateClass([\n Validate(OBJECT)\n], DonutSeriesProperties.prototype, \"title\", 2);\n__decorateClass([\n Validate(OBJECT)\n], DonutSeriesProperties.prototype, \"innerCircle\", 2);\n__decorateClass([\n Validate(OBJECT)\n], DonutSeriesProperties.prototype, \"shadow\", 2);\n__decorateClass([\n Validate(OBJECT)\n], DonutSeriesProperties.prototype, \"calloutLabel\", 2);\n__decorateClass([\n Validate(OBJECT)\n], DonutSeriesProperties.prototype, \"sectorLabel\", 2);\n__decorateClass([\n Validate(OBJECT)\n], DonutSeriesProperties.prototype, \"calloutLine\", 2);\n__decorateClass([\n Validate(OBJECT)\n], DonutSeriesProperties.prototype, \"tooltip\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], DonutSeriesProperties.prototype, \"__BACKGROUND_COLOR_DO_NOT_USE\", 2);\n\n// packages/ag-charts-community/src/chart/series/polar/pieUtil.ts\nfunction preparePieSeriesAnimationFunctions(initialLoad, rotationDegrees, scaleFn, oldScaleFn) {\n const scale2 = [scaleFn.convert(0), scaleFn.convert(1)];\n const oldScale = [oldScaleFn.convert(0), oldScaleFn.convert(1)];\n const rotation = Math.PI / -2 + toRadians(rotationDegrees);\n const phase = initialLoad ? \"initial\" : \"update\";\n const scaleToNewRadius = ({ radius }) => {\n return { innerRadius: scale2[0], outerRadius: scale2[0] + (scale2[1] - scale2[0]) * radius };\n };\n const scaleToOldRadius = ({ radius }) => {\n return { innerRadius: oldScale[0], outerRadius: oldScale[0] + (oldScale[1] - oldScale[0]) * radius };\n };\n const fromFn = (sect, datum, status, { prevFromProps }) => {\n var _a, _b, _c, _d, _e, _f;\n let { startAngle, endAngle, innerRadius, outerRadius } = sect;\n let { fill, stroke } = datum.sectorFormat;\n if (status === \"unknown\" || status === \"added\" && !prevFromProps) {\n startAngle = rotation;\n endAngle = rotation;\n innerRadius = datum.innerRadius;\n outerRadius = datum.outerRadius;\n } else if (status === \"added\" && prevFromProps) {\n startAngle = (_a = prevFromProps.endAngle) != null ? _a : rotation;\n endAngle = (_b = prevFromProps.endAngle) != null ? _b : rotation;\n innerRadius = (_c = prevFromProps.innerRadius) != null ? _c : datum.innerRadius;\n outerRadius = (_d = prevFromProps.outerRadius) != null ? _d : datum.outerRadius;\n }\n if (status === \"added\" && !initialLoad) {\n const radii = scaleToOldRadius(datum);\n innerRadius = radii.innerRadius;\n outerRadius = radii.outerRadius;\n }\n if (status === \"updated\") {\n fill = (_e = sect.fill) != null ? _e : fill;\n stroke = (_f = sect.stroke) != null ? _f : stroke;\n }\n return { startAngle, endAngle, innerRadius, outerRadius, fill, stroke, phase };\n };\n const toFn = (_sect, datum, status, { prevLive }) => {\n var _a, _b;\n let { startAngle, endAngle, innerRadius, outerRadius } = datum;\n const { stroke, fill } = datum.sectorFormat;\n if (status === \"removed\" && prevLive) {\n startAngle = (_a = prevLive.datum) == null ? void 0 : _a.endAngle;\n endAngle = (_b = prevLive.datum) == null ? void 0 : _b.endAngle;\n } else if (status === \"removed\" && !prevLive) {\n startAngle = rotation;\n endAngle = rotation;\n }\n if (status === \"removed\") {\n const radii = scaleToNewRadius(datum);\n innerRadius = radii.innerRadius;\n outerRadius = radii.outerRadius;\n }\n return { startAngle, endAngle, outerRadius, innerRadius, stroke, fill };\n };\n const innerCircleFromFn = (node, _) => {\n var _a, _b, _c;\n return { size: (_c = (_b = (_a = node.previousDatum) == null ? void 0 : _a.radius) != null ? _b : node.size) != null ? _c : 0, phase };\n };\n const innerCircleToFn = (_, datum) => {\n var _a;\n return { size: (_a = datum.radius) != null ? _a : 0 };\n };\n return { nodes: { toFn, fromFn }, innerCircle: { fromFn: innerCircleFromFn, toFn: innerCircleToFn } };\n}\nfunction resetPieSelectionsFn(_node, datum) {\n return {\n startAngle: datum.startAngle,\n endAngle: datum.endAngle,\n innerRadius: datum.innerRadius,\n outerRadius: datum.outerRadius,\n fill: datum.sectorFormat.fill,\n stroke: datum.sectorFormat.stroke\n };\n}\nfunction pickByMatchingAngle(series, point) {\n const dy = point.y - series.centerY;\n const dx = point.x - series.centerX;\n const angle = Math.atan2(dy, dx);\n const sectors = series.getItemNodes();\n for (const sector of sectors) {\n if (sector.datum.missing === true)\n continue;\n if (isBetweenAngles(angle, sector.startAngle, sector.endAngle)) {\n const radius = Math.sqrt(dx * dx + dy * dy);\n let distance2 = 0;\n if (radius < sector.innerRadius) {\n distance2 = sector.innerRadius - radius;\n } else if (radius > sector.outerRadius) {\n distance2 = radius - sector.outerRadius;\n }\n return { datum: sector.datum, distance: distance2 };\n }\n }\n return void 0;\n}\nfunction computeSectorFocusBounds(series, opts) {\n const nodeData = series.getNodeData();\n if (nodeData === void 0)\n return void 0;\n const { centerX, centerY } = series;\n const datum = nodeData[opts.datumIndex];\n const pointVars = [\n { radius: datum.innerRadius, angle: datum.startAngle },\n { radius: datum.innerRadius, angle: datum.endAngle },\n { radius: datum.outerRadius, angle: datum.startAngle },\n { radius: datum.outerRadius, angle: datum.endAngle }\n ];\n const rightAngles = [0, Math.PI / 2, Math.PI, 3 * Math.PI / 2];\n for (const rightAngle of rightAngles) {\n if (isBetweenAngles(rightAngle, datum.startAngle, datum.endAngle)) {\n pointVars.push({ radius: datum.outerRadius, angle: rightAngle });\n }\n }\n const points = pointVars.map(({ radius, angle }) => displacePointFromVector(centerX, centerY, radius, angle));\n const xs = points.map((p) => p.x);\n const ys = points.map((p) => p.y);\n const x = Math.min(...xs);\n const y = Math.min(...ys);\n const width = Math.max(...xs) - x;\n const height = Math.max(...ys) - y;\n return new BBox(x, y, width, height);\n}\n\n// packages/ag-charts-community/src/chart/series/polar/polarSeries.ts\nvar PolarSeries = class extends DataModelSeries {\n constructor(_a) {\n var _b = _a, {\n useLabelLayer = false,\n pickModes = [0 /* EXACT_SHAPE_MATCH */],\n canHaveAxes = false,\n animationResetFns\n } = _b, opts = __objRest(_b, [\n \"useLabelLayer\",\n \"pickModes\",\n \"canHaveAxes\",\n \"animationResetFns\"\n ]);\n super(__spreadProps(__spreadValues({}, opts), {\n useLabelLayer,\n pickModes,\n contentGroupVirtual: false,\n directionKeys: {\n [\"x\" /* X */]: [\"angleKey\"],\n [\"y\" /* Y */]: [\"radiusKey\"]\n },\n directionNames: {\n [\"x\" /* X */]: [\"angleName\"],\n [\"y\" /* Y */]: [\"radiusName\"]\n },\n canHaveAxes\n }));\n this.itemGroup = this.contentGroup.appendChild(new Group());\n this.nodeData = [];\n this.itemSelection = Selection.select(\n this.itemGroup,\n () => this.nodeFactory(),\n false\n );\n this.labelSelection = Selection.select(this.labelGroup, Text, false);\n this.highlightSelection = Selection.select(\n this.highlightGroup,\n () => this.nodeFactory()\n );\n /**\n * The center of the polar series (for example, the center of a pie).\n * If the polar chart has multiple series, all of them will have their\n * center set to the same value as a result of the polar chart layout.\n * The center coordinates are not supposed to be set by the user.\n */\n this.centerX = 0;\n this.centerY = 0;\n /**\n * The maximum radius the series can use.\n * This value is set automatically as a result of the polar chart layout\n * and is not supposed to be set by the user.\n */\n this.radius = 0;\n this.showFocusBox = false;\n this.itemGroup.zIndexSubOrder = [() => this._declarationOrder, 1];\n this.animationResetFns = animationResetFns;\n this.animationState = new StateMachine(\n \"empty\",\n {\n empty: {\n update: {\n target: \"ready\",\n action: (data) => this.animateEmptyUpdateReady(data)\n },\n reset: \"empty\",\n skip: \"ready\"\n },\n ready: {\n updateData: \"waiting\",\n clear: \"clearing\",\n highlight: (data) => this.animateReadyHighlight(data),\n highlightMarkers: (data) => this.animateReadyHighlightMarkers(data),\n resize: (data) => this.animateReadyResize(data),\n reset: \"empty\",\n skip: \"ready\"\n },\n waiting: {\n update: {\n target: \"ready\",\n action: (data) => this.animateWaitingUpdateReady(data)\n },\n reset: \"empty\",\n skip: \"ready\"\n },\n clearing: {\n update: {\n target: \"empty\",\n action: (data) => this.animateClearingUpdateEmpty(data)\n },\n reset: \"empty\",\n skip: \"ready\"\n }\n },\n () => this.checkProcessedDataAnimatable()\n );\n }\n getItemNodes() {\n return this.itemGroup.children;\n }\n getNodeData() {\n return this.nodeData;\n }\n resetAnimation(phase) {\n if (phase === \"initial\") {\n this.animationState.transition(\"reset\");\n } else if (phase === \"ready\") {\n this.animationState.transition(\"skip\");\n }\n }\n getLabelData() {\n return [];\n }\n computeLabelsBBox(_options, _seriesRect) {\n return null;\n }\n resetAllAnimation() {\n var _a;\n const { item, label } = (_a = this.animationResetFns) != null ? _a : {};\n this.ctx.animationManager.stopByAnimationGroupId(this.id);\n if (item) {\n resetMotion([this.itemSelection, this.highlightSelection], item);\n }\n if (label) {\n resetMotion([this.labelSelection], label);\n }\n this.itemSelection.cleanup();\n this.labelSelection.cleanup();\n this.highlightSelection.cleanup();\n }\n animateEmptyUpdateReady(_data) {\n this.ctx.animationManager.skipCurrentBatch();\n this.resetAllAnimation();\n }\n animateWaitingUpdateReady(_data) {\n this.ctx.animationManager.skipCurrentBatch();\n this.resetAllAnimation();\n }\n animateReadyHighlight(_data) {\n var _a;\n const { item } = (_a = this.animationResetFns) != null ? _a : {};\n if (item) {\n resetMotion([this.highlightSelection], item);\n }\n }\n animateReadyHighlightMarkers(_data) {\n }\n animateReadyResize(_data) {\n this.resetAllAnimation();\n }\n animateClearingUpdateEmpty(_data) {\n this.ctx.animationManager.skipCurrentBatch();\n this.resetAllAnimation();\n }\n animationTransitionClear() {\n this.animationState.transition(\"clear\", this.getAnimationData());\n }\n getAnimationData(seriesRect) {\n return { seriesRect };\n }\n};\n\n// packages/ag-charts-community/src/chart/series/polar/donutSeries.ts\nvar DonutSeriesNodeEvent = class extends SeriesNodeEvent {\n constructor(type, nativeEvent, datum, series) {\n super(type, nativeEvent, datum, series);\n this.angleKey = series.properties.angleKey;\n this.radiusKey = series.properties.radiusKey;\n this.calloutLabelKey = series.properties.calloutLabelKey;\n this.sectorLabelKey = series.properties.sectorLabelKey;\n }\n};\nvar DonutSeries = class extends PolarSeries {\n constructor(moduleCtx) {\n super({\n moduleCtx,\n pickModes: [0 /* EXACT_SHAPE_MATCH */],\n useLabelLayer: true,\n animationResetFns: { item: resetPieSelectionsFn, label: resetLabelFn }\n });\n this.properties = new DonutSeriesProperties();\n this.previousRadiusScale = new LinearScale();\n this.radiusScale = new LinearScale();\n // The group node that contains the background graphics.\n this.backgroundGroup = this.rootGroup.appendChild(\n new Group({\n name: `${this.id}-background`,\n layer: true,\n zIndex: 0 /* SERIES_BACKGROUND_ZINDEX */\n })\n );\n // AG-6193 If the sum of all datums is 0, then we'll draw 1 or 2 rings to represent the empty series.\n this.zerosumRingsGroup = this.backgroundGroup.appendChild(new Group({ name: `${this.id}-zerosumRings` }));\n this.zerosumOuterRing = this.zerosumRingsGroup.appendChild(new Circle());\n this.zerosumInnerRing = this.zerosumRingsGroup.appendChild(new Circle());\n this.innerCircleGroup = this.backgroundGroup.appendChild(new Group({ name: `${this.id}-innerCircle` }));\n // When a user toggles a series item (e.g. from the legend), its boolean state is recorded here.\n this.seriesItemEnabled = [];\n this.surroundingRadius = void 0;\n this.NodeEvent = DonutSeriesNodeEvent;\n this.angleScale = new LinearScale();\n this.angleScale.domain = [0, 1];\n this.angleScale.range = [-Math.PI, Math.PI].map((angle) => angle + Math.PI / 2);\n const pieCalloutLabels = new Group({ name: \"pieCalloutLabels\" });\n const pieSectorLabels = new Group({ name: \"pieSectorLabels\" });\n const innerLabels = new Group({ name: \"innerLabels\" });\n this.labelGroup.append(pieCalloutLabels);\n this.labelGroup.append(pieSectorLabels);\n this.labelGroup.append(innerLabels);\n this.calloutLabelSelection = Selection.select(pieCalloutLabels, Group);\n this.sectorLabelSelection = Selection.select(pieSectorLabels, Text);\n this.innerLabelsSelection = Selection.select(innerLabels, Text);\n this.innerCircleSelection = Selection.select(this.innerCircleGroup, Circle);\n }\n addChartEventListeners() {\n var _a;\n this.destroyFns.push(\n (_a = this.ctx.chartEventManager) == null ? void 0 : _a.addListener(\"legend-item-click\", (event) => this.onLegendItemClick(event))\n );\n }\n get visible() {\n return super.visible && (this.seriesItemEnabled.length === 0 || this.seriesItemEnabled.some((visible) => visible));\n }\n nodeFactory() {\n return new Sector();\n }\n getSeriesDomain(direction) {\n if (direction === \"x\" /* X */) {\n return this.angleScale.domain;\n } else {\n return this.radiusScale.domain;\n }\n }\n processData(dataController) {\n return __async(this, null, function* () {\n var _a, _b, _c, _d, _e;\n if (this.data == null || !this.properties.isValid()) {\n return;\n }\n let { data } = this;\n const { visible, seriesItemEnabled } = this;\n const { angleKey, radiusKey, calloutLabelKey, sectorLabelKey, legendItemKey } = this.properties;\n const animationEnabled = !this.ctx.animationManager.isSkipped();\n const extraKeyProps = [];\n const extraProps = [];\n if (legendItemKey) {\n extraKeyProps.push(keyProperty(legendItemKey, \"band\", { id: `legendItemKey` }));\n } else if (calloutLabelKey) {\n extraKeyProps.push(keyProperty(calloutLabelKey, \"band\", { id: `calloutLabelKey` }));\n } else if (sectorLabelKey) {\n extraKeyProps.push(keyProperty(sectorLabelKey, \"band\", { id: `sectorLabelKey` }));\n }\n const radiusScaleType = this.radiusScale.type;\n const angleScaleType = this.radiusScale.type;\n if (radiusKey) {\n extraProps.push(\n rangedValueProperty(radiusKey, {\n id: \"radiusValue\",\n min: (_a = this.properties.radiusMin) != null ? _a : 0,\n max: this.properties.radiusMax\n }),\n valueProperty(radiusKey, radiusScaleType, { id: `radiusRaw` }),\n // Raw value pass-through.\n normalisePropertyTo(\n { id: \"radiusValue\" },\n [0, 1],\n 1,\n (_b = this.properties.radiusMin) != null ? _b : 0,\n this.properties.radiusMax\n )\n );\n }\n if (calloutLabelKey) {\n extraProps.push(valueProperty(calloutLabelKey, \"band\", { id: `calloutLabelValue` }));\n }\n if (sectorLabelKey) {\n extraProps.push(valueProperty(sectorLabelKey, \"band\", { id: `sectorLabelValue` }));\n }\n if (legendItemKey) {\n extraProps.push(valueProperty(legendItemKey, \"band\", { id: `legendItemValue` }));\n }\n if (animationEnabled && this.processedData && extraKeyProps.length > 0) {\n extraProps.push(diff(this.processedData));\n }\n extraProps.push(animationValidation());\n data = data.map((d, idx) => visible && seriesItemEnabled[idx] ? d : __spreadProps(__spreadValues({}, d), { [angleKey]: 0 }));\n yield this.requestDataModel(dataController, data, {\n props: [\n ...extraKeyProps,\n accumulativeValueProperty(angleKey, angleScaleType, { id: `angleValue`, onlyPositive: true }),\n valueProperty(angleKey, angleScaleType, { id: `angleRaw` }),\n // Raw value pass-through.\n normalisePropertyTo({ id: \"angleValue\" }, [0, 1], 0, 0),\n ...extraProps\n ]\n });\n for (const valueDef of (_e = (_d = (_c = this.processedData) == null ? void 0 : _c.defs) == null ? void 0 : _d.values) != null ? _e : []) {\n const { id, missing, property } = valueDef;\n const missCount = getMissCount(this, missing);\n if (id !== \"angleRaw\" && missCount > 0) {\n Logger.warnOnce(\n `no value was found for the key '${String(property)}' on ${missCount} data element${missCount > 1 ? \"s\" : \"\"}`\n );\n }\n }\n this.animationState.transition(\"updateData\");\n });\n }\n maybeRefreshNodeData() {\n return __async(this, null, function* () {\n var _a;\n if (!this.nodeDataRefresh)\n return;\n const { nodeData = [] } = (_a = yield this.createNodeData()) != null ? _a : {};\n this.nodeData = nodeData;\n this.nodeDataRefresh = false;\n });\n }\n getProcessedDataIndexes(dataModel) {\n const angleIdx = dataModel.resolveProcessedDataIndexById(this, `angleValue`);\n const radiusIdx = this.properties.radiusKey ? dataModel.resolveProcessedDataIndexById(this, `radiusValue`) : -1;\n const calloutLabelIdx = this.properties.calloutLabelKey ? dataModel.resolveProcessedDataIndexById(this, `calloutLabelValue`) : -1;\n const sectorLabelIdx = this.properties.sectorLabelKey ? dataModel.resolveProcessedDataIndexById(this, `sectorLabelValue`) : -1;\n const legendItemIdx = this.properties.legendItemKey ? dataModel.resolveProcessedDataIndexById(this, `legendItemValue`) : -1;\n return { angleIdx, radiusIdx, calloutLabelIdx, sectorLabelIdx, legendItemIdx };\n }\n createNodeData() {\n return __async(this, null, function* () {\n const { id: seriesId, processedData, dataModel, angleScale } = this;\n const { rotation, innerRadiusRatio } = this.properties;\n if (!this.properties.isValid()) {\n this.zerosumOuterRing.visible = true;\n this.zerosumInnerRing.visible = true;\n return { itemId: seriesId, nodeData: [], labelData: [] };\n }\n if (!processedData || !dataModel || processedData.type !== \"ungrouped\")\n return;\n const { angleIdx, radiusIdx, calloutLabelIdx, sectorLabelIdx, legendItemIdx } = this.getProcessedDataIndexes(dataModel);\n let currentStart = 0;\n let sum2 = 0;\n const nodeData = processedData.data.map((group2, index) => {\n var _a;\n const { datum, values } = group2;\n const currentValue = values[angleIdx];\n const startAngle = angleScale.convert(currentStart) + toRadians(rotation);\n currentStart = currentValue;\n sum2 += currentValue;\n const endAngle = angleScale.convert(currentStart) + toRadians(rotation);\n const span = Math.abs(endAngle - startAngle);\n const midAngle = startAngle + span / 2;\n const angleValue = values[angleIdx + 1];\n const radius = radiusIdx >= 0 ? (_a = values[radiusIdx]) != null ? _a : 1 : 1;\n const radiusValue = radiusIdx >= 0 ? values[radiusIdx + 1] : void 0;\n const legendItemValue = legendItemIdx >= 0 ? values[legendItemIdx] : void 0;\n const labels = this.getLabels(\n datum,\n midAngle,\n span,\n true,\n values[calloutLabelIdx],\n values[sectorLabelIdx],\n legendItemValue\n );\n const sectorFormat = this.getSectorFormat(datum, index, false);\n return __spreadValues({\n itemId: index,\n series: this,\n datum,\n index,\n angleValue,\n midAngle,\n midCos: Math.cos(midAngle),\n midSin: Math.sin(midAngle),\n startAngle,\n endAngle,\n sectorFormat,\n radiusValue,\n radius,\n innerRadius: Math.max(this.radiusScale.convert(0), 0),\n outerRadius: Math.max(this.radiusScale.convert(radius), 0),\n legendItemValue\n }, labels);\n });\n this.zerosumOuterRing.visible = sum2 === 0;\n this.zerosumInnerRing.visible = sum2 === 0 && innerRadiusRatio != null && innerRadiusRatio !== 1 && innerRadiusRatio > 0;\n return { itemId: seriesId, nodeData, labelData: nodeData };\n });\n }\n getLabels(datum, midAngle, span, skipDisabled, calloutLabelValue, sectorLabelValue, legendItemValue) {\n const { calloutLabel, sectorLabel, legendItemKey } = this.properties;\n const calloutLabelKey = !skipDisabled || calloutLabel.enabled ? this.properties.calloutLabelKey : void 0;\n const sectorLabelKey = !skipDisabled || sectorLabel.enabled ? this.properties.sectorLabelKey : void 0;\n if (!calloutLabelKey && !sectorLabelKey && !legendItemKey) {\n return {};\n }\n const labelFormatterParams = {\n datum,\n angleKey: this.properties.angleKey,\n angleName: this.properties.angleName,\n radiusKey: this.properties.radiusKey,\n radiusName: this.properties.radiusName,\n calloutLabelKey: this.properties.calloutLabelKey,\n calloutLabelName: this.properties.calloutLabelName,\n sectorLabelKey: this.properties.sectorLabelKey,\n sectorLabelName: this.properties.sectorLabelName,\n legendItemKey: this.properties.legendItemKey\n };\n const result = {};\n if (calloutLabelKey && span > toRadians(calloutLabel.minAngle)) {\n result.calloutLabel = __spreadProps(__spreadValues({}, this.getTextAlignment(midAngle)), {\n text: this.getLabelText(calloutLabel, __spreadProps(__spreadValues({}, labelFormatterParams), {\n value: calloutLabelValue\n })),\n hidden: false,\n collisionTextAlign: void 0,\n collisionOffsetY: 0,\n box: void 0\n });\n }\n if (sectorLabelKey) {\n result.sectorLabel = {\n text: this.getLabelText(sectorLabel, __spreadProps(__spreadValues({}, labelFormatterParams), {\n value: sectorLabelValue\n }))\n };\n }\n if (legendItemKey != null && legendItemValue != null) {\n result.legendItem = { key: legendItemKey, text: legendItemValue };\n }\n return result;\n }\n getTextAlignment(midAngle) {\n const quadrantTextOpts = [\n { textAlign: \"center\", textBaseline: \"bottom\" },\n { textAlign: \"left\", textBaseline: \"middle\" },\n { textAlign: \"center\", textBaseline: \"hanging\" },\n { textAlign: \"right\", textBaseline: \"middle\" }\n ];\n const midAngle180 = normalizeAngle180(midAngle);\n const quadrantStart = -0.75 * Math.PI;\n const quadrantOffset = midAngle180 - quadrantStart;\n const quadrant = Math.floor(quadrantOffset / (Math.PI / 2));\n const quadrantIndex = mod(quadrant, quadrantTextOpts.length);\n return quadrantTextOpts[quadrantIndex];\n }\n getSectorFormat(datum, formatIndex, highlight) {\n var _a, _b, _c, _d, _e;\n const { callbackCache, highlightManager } = this.ctx;\n const { angleKey, radiusKey, fills, strokes, formatter, sectorSpacing, __BACKGROUND_COLOR_DO_NOT_USE } = this.properties;\n const highlightedDatum = highlightManager.getActiveHighlight();\n const isDatumHighlighted = highlight && (highlightedDatum == null ? void 0 : highlightedDatum.series) === this && formatIndex === highlightedDatum.itemId;\n let defaultStroke = strokes[formatIndex % strokes.length];\n if (sectorSpacing == null && defaultStroke == null) {\n defaultStroke = __BACKGROUND_COLOR_DO_NOT_USE;\n }\n const { fill, fillOpacity, stroke, strokeWidth, strokeOpacity } = mergeDefaults(\n isDatumHighlighted && this.properties.highlightStyle.item,\n {\n fill: fills.length > 0 ? fills[formatIndex % fills.length] : void 0,\n fillOpacity: this.properties.fillOpacity,\n stroke: defaultStroke,\n strokeWidth: this.getStrokeWidth(this.properties.strokeWidth),\n strokeOpacity: this.getOpacity()\n }\n );\n let format2;\n if (formatter) {\n format2 = callbackCache.call(formatter, {\n datum,\n angleKey,\n radiusKey,\n fill,\n stroke,\n fills,\n strokes,\n strokeWidth,\n highlighted: isDatumHighlighted,\n seriesId: this.id\n });\n }\n return {\n fill: (_a = format2 == null ? void 0 : format2.fill) != null ? _a : fill,\n fillOpacity: (_b = format2 == null ? void 0 : format2.fillOpacity) != null ? _b : fillOpacity,\n stroke: (_c = format2 == null ? void 0 : format2.stroke) != null ? _c : stroke,\n strokeWidth: (_d = format2 == null ? void 0 : format2.strokeWidth) != null ? _d : strokeWidth,\n strokeOpacity: (_e = format2 == null ? void 0 : format2.strokeOpacity) != null ? _e : strokeOpacity\n };\n }\n getInnerRadius() {\n const { radius } = this;\n const { innerRadiusRatio = 1, innerRadiusOffset = 0 } = this.properties;\n const innerRadius = radius * innerRadiusRatio + innerRadiusOffset;\n if (innerRadius === radius || innerRadius < 0) {\n return 0;\n }\n return innerRadius;\n }\n getOuterRadius() {\n const { outerRadiusRatio, outerRadiusOffset } = this.properties;\n return Math.max(this.radius * outerRadiusRatio + outerRadiusOffset, 0);\n }\n updateRadiusScale(resize) {\n const newRange = [this.getInnerRadius(), this.getOuterRadius()];\n this.radiusScale.range = newRange;\n if (resize) {\n this.previousRadiusScale.range = newRange;\n }\n this.nodeData = this.nodeData.map((_a) => {\n var _b = _a, { radius } = _b, d = __objRest(_b, [\"radius\"]);\n return __spreadProps(__spreadValues({}, d), {\n radius,\n innerRadius: Math.max(this.radiusScale.convert(0), 0),\n outerRadius: Math.max(this.radiusScale.convert(radius), 0)\n });\n });\n }\n getTitleTranslationY() {\n var _a, _b;\n const outerRadius = Math.max(0, this.radiusScale.range[1]);\n if (outerRadius === 0) {\n return NaN;\n }\n const spacing = (_b = (_a = this.properties.title) == null ? void 0 : _a.spacing) != null ? _b : 0;\n const titleOffset = 2 + spacing;\n const dy = Math.max(0, -outerRadius);\n return -outerRadius - titleOffset - dy;\n }\n update(_0) {\n return __async(this, arguments, function* ({ seriesRect }) {\n const { title } = this.properties;\n const newNodeDataDependencies = {\n seriesRectWidth: seriesRect == null ? void 0 : seriesRect.width,\n seriesRectHeight: seriesRect == null ? void 0 : seriesRect.height\n };\n const resize = jsonDiff(this.nodeDataDependencies, newNodeDataDependencies) != null;\n if (resize) {\n this._nodeDataDependencies = newNodeDataDependencies;\n }\n yield this.maybeRefreshNodeData();\n this.updateTitleNodes();\n this.updateRadiusScale(resize);\n this.contentGroup.translationX = this.centerX;\n this.contentGroup.translationY = this.centerY;\n this.highlightGroup.translationX = this.centerX;\n this.highlightGroup.translationY = this.centerY;\n this.backgroundGroup.translationX = this.centerX;\n this.backgroundGroup.translationY = this.centerY;\n if (this.labelGroup) {\n this.labelGroup.translationX = this.centerX;\n this.labelGroup.translationY = this.centerY;\n }\n if (title) {\n const dy = this.getTitleTranslationY();\n const titleBox = title.node.computeBBox();\n title.node.visible = title.enabled && isFinite(dy) && !this.bboxIntersectsSurroundingSeries(titleBox, 0, dy);\n title.node.translationY = isFinite(dy) ? dy : 0;\n }\n for (const circle of [this.zerosumInnerRing, this.zerosumOuterRing]) {\n circle.fillOpacity = 0;\n circle.stroke = this.properties.calloutLabel.color;\n circle.strokeWidth = 1;\n circle.strokeOpacity = 1;\n }\n this.updateNodeMidPoint();\n yield this.updateSelections();\n yield this.updateNodes(seriesRect);\n });\n }\n updateTitleNodes() {\n var _a, _b;\n const { oldTitle } = this;\n const { title } = this.properties;\n if (oldTitle !== title) {\n if (oldTitle) {\n (_a = this.labelGroup) == null ? void 0 : _a.removeChild(oldTitle.node);\n }\n if (title) {\n title.node.textBaseline = \"bottom\";\n (_b = this.labelGroup) == null ? void 0 : _b.appendChild(title.node);\n }\n this.oldTitle = title;\n }\n }\n updateNodeMidPoint() {\n this.nodeData.forEach((d) => {\n const radius = d.innerRadius + (d.outerRadius - d.innerRadius) / 2;\n d.midPoint = {\n x: d.midCos * Math.max(0, radius),\n y: d.midSin * Math.max(0, radius)\n };\n });\n }\n updateSelections() {\n return __async(this, null, function* () {\n yield this.updateGroupSelection();\n this.updateInnerCircleSelection();\n });\n }\n updateGroupSelection() {\n return __async(this, null, function* () {\n const { itemSelection, highlightSelection, calloutLabelSelection, sectorLabelSelection, innerLabelsSelection } = this;\n const update = (selection, clone) => {\n let nodeData = this.nodeData;\n if (clone) {\n nodeData = nodeData.map((datum) => __spreadProps(__spreadValues({}, datum), { sectorFormat: __spreadValues({}, datum.sectorFormat) }));\n }\n selection.update(nodeData, void 0, (datum) => this.getDatumId(datum));\n if (this.ctx.animationManager.isSkipped()) {\n selection.cleanup();\n }\n };\n update(itemSelection, false);\n update(highlightSelection, true);\n calloutLabelSelection.update(this.nodeData, (group2) => {\n const line = new Line();\n line.tag = 0 /* Callout */;\n line.pointerEvents = 1 /* None */;\n group2.appendChild(line);\n const text = new Text();\n text.tag = 1 /* Label */;\n text.pointerEvents = 1 /* None */;\n group2.appendChild(text);\n });\n sectorLabelSelection.update(this.nodeData, (node) => {\n node.pointerEvents = 1 /* None */;\n });\n innerLabelsSelection.update(this.properties.innerLabels, (node) => {\n node.pointerEvents = 1 /* None */;\n });\n });\n }\n updateInnerCircleSelection() {\n const { innerCircle } = this.properties;\n let radius = 0;\n const innerRadius = this.getInnerRadius();\n if (innerRadius > 0) {\n const circleRadius = Math.min(innerRadius, this.getOuterRadius());\n const antiAliasingPadding = 1;\n radius = Math.ceil(circleRadius * 2 + antiAliasingPadding);\n }\n const datums = innerCircle ? [{ radius }] : [];\n this.innerCircleSelection.update(datums);\n }\n updateNodes(seriesRect) {\n return __async(this, null, function* () {\n const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();\n const isVisible = this.visible && this.seriesItemEnabled.indexOf(true) >= 0;\n this.rootGroup.visible = isVisible;\n this.backgroundGroup.visible = isVisible;\n this.contentGroup.visible = isVisible;\n this.highlightGroup.visible = isVisible && (highlightedDatum == null ? void 0 : highlightedDatum.series) === this;\n if (this.labelGroup) {\n this.labelGroup.visible = isVisible;\n }\n this.contentGroup.opacity = this.getOpacity();\n this.innerCircleSelection.each((node, { radius }) => {\n var _a, _b;\n node.setProperties({\n fill: (_a = this.properties.innerCircle) == null ? void 0 : _a.fill,\n opacity: (_b = this.properties.innerCircle) == null ? void 0 : _b.fillOpacity,\n size: radius\n });\n });\n const updateSectorFn = (sector, datum, _index, isDatumHighlighted) => {\n const format2 = this.getSectorFormat(datum.datum, datum.itemId, isDatumHighlighted);\n datum.sectorFormat.fill = format2.fill;\n datum.sectorFormat.stroke = format2.stroke;\n const animationDisabled = this.ctx.animationManager.isSkipped();\n if (animationDisabled) {\n sector.startAngle = datum.startAngle;\n sector.endAngle = datum.endAngle;\n sector.innerRadius = datum.innerRadius;\n sector.outerRadius = datum.outerRadius;\n }\n if (isDatumHighlighted || animationDisabled) {\n sector.fill = format2.fill;\n sector.stroke = format2.stroke;\n }\n sector.strokeWidth = format2.strokeWidth;\n sector.fillOpacity = format2.fillOpacity;\n sector.strokeOpacity = this.properties.strokeOpacity;\n sector.lineDash = this.properties.lineDash;\n sector.lineDashOffset = this.properties.lineDashOffset;\n sector.fillShadow = this.properties.shadow;\n sector.cornerRadius = this.properties.cornerRadius;\n sector.inset = this.properties.sectorSpacing != null ? (this.properties.sectorSpacing + (format2.stroke != null ? format2.strokeWidth : 0)) / 2 : 0;\n sector.lineJoin = this.properties.sectorSpacing != null ? \"miter\" : \"round\";\n };\n this.itemSelection.each((node, datum, index) => updateSectorFn(node, datum, index, false));\n this.highlightSelection.each((node, datum, index) => {\n const isDatumHighlighted = (highlightedDatum == null ? void 0 : highlightedDatum.series) === this && node.datum.itemId === highlightedDatum.itemId;\n updateSectorFn(node, datum, index, true);\n node.visible = isDatumHighlighted;\n });\n this.updateCalloutLineNodes();\n this.updateCalloutLabelNodes(seriesRect);\n this.updateSectorLabelNodes();\n this.updateInnerLabelNodes();\n this.updateZerosumRings();\n this.animationState.transition(\"update\");\n });\n }\n updateCalloutLineNodes() {\n var _a;\n const { calloutLine } = this.properties;\n const calloutLength = calloutLine.length;\n const calloutStrokeWidth = calloutLine.strokeWidth;\n const calloutColors = (_a = calloutLine.colors) != null ? _a : this.properties.strokes;\n const { offset: offset4 } = this.properties.calloutLabel;\n this.calloutLabelSelection.selectByTag(0 /* Callout */).forEach((line, index) => {\n var _a2;\n const datum = line.datum;\n const { calloutLabel: label, outerRadius } = datum;\n if ((label == null ? void 0 : label.text) && !label.hidden && outerRadius !== 0) {\n line.visible = true;\n line.strokeWidth = calloutStrokeWidth;\n line.stroke = calloutColors[index % calloutColors.length];\n line.fill = void 0;\n const x1 = datum.midCos * outerRadius;\n const y1 = datum.midSin * outerRadius;\n let x2 = datum.midCos * (outerRadius + calloutLength);\n let y2 = datum.midSin * (outerRadius + calloutLength);\n const isMoved = (_a2 = label.collisionTextAlign) != null ? _a2 : label.collisionOffsetY !== 0;\n if (isMoved && label.box != null) {\n const box = label.box;\n let cx = x2;\n let cy = y2;\n if (x2 < box.x) {\n cx = box.x;\n } else if (x2 > box.x + box.width) {\n cx = box.x + box.width;\n }\n if (y2 < box.y) {\n cy = box.y;\n } else if (y2 > box.y + box.height) {\n cy = box.y + box.height;\n }\n const dx = cx - x2;\n const dy = cy - y2;\n const length = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));\n const paddedLength = length - offset4;\n if (paddedLength > 0) {\n x2 = x2 + dx * paddedLength / length;\n y2 = y2 + dy * paddedLength / length;\n }\n }\n line.x1 = x1;\n line.y1 = y1;\n line.x2 = x2;\n line.y2 = y2;\n } else {\n line.visible = false;\n }\n });\n }\n getLabelOverflow(text, box, seriesRect) {\n const seriesLeft = seriesRect.x - this.centerX;\n const seriesRight = seriesRect.x + seriesRect.width - this.centerX;\n const seriesTop = seriesRect.y - this.centerY;\n const seriesBottom = seriesRect.y + seriesRect.height - this.centerY;\n const errPx = 1;\n let visibleTextPart = 1;\n if (box.x + errPx < seriesLeft) {\n visibleTextPart = (box.x + box.width - seriesLeft) / box.width;\n } else if (box.x + box.width - errPx > seriesRight) {\n visibleTextPart = (seriesRight - box.x) / box.width;\n }\n const hasVerticalOverflow = box.y + errPx < seriesTop || box.y + box.height - errPx > seriesBottom;\n const textLength = visibleTextPart === 1 ? text.length : Math.floor(text.length * visibleTextPart) - 1;\n const hasSurroundingSeriesOverflow = this.bboxIntersectsSurroundingSeries(box);\n return { textLength, hasVerticalOverflow, hasSurroundingSeriesOverflow };\n }\n bboxIntersectsSurroundingSeries(box, dx = 0, dy = 0) {\n const { surroundingRadius } = this;\n if (surroundingRadius == null) {\n return false;\n }\n const corners = [\n { x: box.x + dx, y: box.y + dy },\n { x: box.x + box.width + dx, y: box.y + dy },\n { x: box.x + box.width + dx, y: box.y + box.height + dy },\n { x: box.x + dx, y: box.y + box.height + dy }\n ];\n const sur2 = __pow(surroundingRadius, 2);\n return corners.some((corner) => __pow(corner.x, 2) + __pow(corner.y, 2) > sur2);\n }\n computeCalloutLabelCollisionOffsets() {\n const { radiusScale } = this;\n const { calloutLabel, calloutLine } = this.properties;\n const { offset: offset4, minSpacing } = calloutLabel;\n const innerRadius = radiusScale.convert(0);\n const shouldSkip = (datum) => {\n const label = datum.calloutLabel;\n return !label || datum.outerRadius === 0;\n };\n const fullData = this.nodeData;\n const data = this.nodeData.filter((t) => !shouldSkip(t));\n data.forEach((datum) => {\n const label = datum.calloutLabel;\n if (label == null)\n return;\n label.hidden = false;\n label.collisionTextAlign = void 0;\n label.collisionOffsetY = 0;\n });\n if (data.length <= 1) {\n return;\n }\n const leftLabels = data.filter((d) => d.midCos < 0).sort((a, b) => a.midSin - b.midSin);\n const rightLabels = data.filter((d) => d.midCos >= 0).sort((a, b) => a.midSin - b.midSin);\n const topLabels = data.filter((d) => {\n var _a;\n return d.midSin < 0 && ((_a = d.calloutLabel) == null ? void 0 : _a.textAlign) === \"center\";\n }).sort((a, b) => a.midCos - b.midCos);\n const bottomLabels = data.filter((d) => {\n var _a;\n return d.midSin >= 0 && ((_a = d.calloutLabel) == null ? void 0 : _a.textAlign) === \"center\";\n }).sort((a, b) => a.midCos - b.midCos);\n const tempTextNode = new Text();\n const getTextBBox = (datum) => {\n var _a;\n const label = datum.calloutLabel;\n if (label == null)\n return new BBox(0, 0, 0, 0);\n const labelRadius = datum.outerRadius + calloutLine.length + offset4;\n const x = datum.midCos * labelRadius;\n const y = datum.midSin * labelRadius + label.collisionOffsetY;\n tempTextNode.text = label.text;\n tempTextNode.x = x;\n tempTextNode.y = y;\n tempTextNode.setFont(this.properties.calloutLabel);\n tempTextNode.setAlign({\n textAlign: (_a = label.collisionTextAlign) != null ? _a : label.textAlign,\n textBaseline: label.textBaseline\n });\n return tempTextNode.computeBBox();\n };\n const avoidNeighbourYCollision = (label, next, direction) => {\n const box = getTextBBox(label).grow(minSpacing / 2);\n const other = getTextBBox(next).grow(minSpacing / 2);\n const collidesOrBehind = box.x < other.x + other.width && box.x + box.width > other.x && (direction === \"to-top\" ? box.y < other.y + other.height : box.y + box.height > other.y);\n if (collidesOrBehind) {\n const dy = direction === \"to-top\" ? box.y - other.y - other.height : box.y + box.height - other.y;\n next.calloutLabel.collisionOffsetY = dy;\n }\n };\n const avoidYCollisions = (labels) => {\n const midLabel = labels.slice().sort((a, b) => Math.abs(a.midSin) - Math.abs(b.midSin))[0];\n const midIndex = labels.indexOf(midLabel);\n for (let i = midIndex - 1; i >= 0; i--) {\n const prev = labels[i + 1];\n const next = labels[i];\n avoidNeighbourYCollision(prev, next, \"to-top\");\n }\n for (let i = midIndex + 1; i < labels.length; i++) {\n const prev = labels[i - 1];\n const next = labels[i];\n avoidNeighbourYCollision(prev, next, \"to-bottom\");\n }\n };\n const avoidXCollisions = (labels) => {\n const labelsCollideLabelsByY = data.some((datum) => datum.calloutLabel.collisionOffsetY !== 0);\n const boxes = labels.map((label) => getTextBBox(label));\n const paddedBoxes = boxes.map((box) => box.clone().grow(minSpacing / 2));\n let labelsCollideLabelsByX = false;\n for (let i = 0; i < paddedBoxes.length && !labelsCollideLabelsByX; i++) {\n const box = paddedBoxes[i];\n for (let j = i + 1; j < labels.length; j++) {\n const other = paddedBoxes[j];\n if (box.collidesBBox(other)) {\n labelsCollideLabelsByX = true;\n break;\n }\n }\n }\n const sectors = fullData.map((datum) => {\n const { startAngle, endAngle, outerRadius } = datum;\n return { startAngle, endAngle, innerRadius, outerRadius };\n });\n const labelsCollideSectors = boxes.some((box) => {\n return sectors.some((sector) => boxCollidesSector(box, sector));\n });\n if (!labelsCollideLabelsByX && !labelsCollideLabelsByY && !labelsCollideSectors) {\n return;\n }\n labels.filter((d) => d.calloutLabel.textAlign === \"center\").forEach((d) => {\n const label = d.calloutLabel;\n if (d.midCos < 0) {\n label.collisionTextAlign = \"right\";\n } else if (d.midCos > 0) {\n label.collisionTextAlign = \"left\";\n } else {\n label.collisionTextAlign = \"center\";\n }\n });\n };\n avoidYCollisions(leftLabels);\n avoidYCollisions(rightLabels);\n avoidXCollisions(topLabels);\n avoidXCollisions(bottomLabels);\n }\n updateCalloutLabelNodes(seriesRect) {\n const { radiusScale } = this;\n const { calloutLabel, calloutLine } = this.properties;\n const calloutLength = calloutLine.length;\n const { offset: offset4, color } = calloutLabel;\n const tempTextNode = new Text();\n this.calloutLabelSelection.selectByTag(1 /* Label */).forEach((text) => {\n var _a;\n const { datum } = text;\n const label = datum.calloutLabel;\n const radius = radiusScale.convert(datum.radius);\n const outerRadius = Math.max(0, radius);\n if (!(label == null ? void 0 : label.text) || outerRadius === 0 || label.hidden) {\n text.visible = false;\n return;\n }\n const labelRadius = outerRadius + calloutLength + offset4;\n const x = datum.midCos * labelRadius;\n const y = datum.midSin * labelRadius + label.collisionOffsetY;\n const align = {\n textAlign: (_a = label.collisionTextAlign) != null ? _a : label.textAlign,\n textBaseline: label.textBaseline\n };\n tempTextNode.text = label.text;\n tempTextNode.x = x;\n tempTextNode.y = y;\n tempTextNode.setFont(this.properties.calloutLabel);\n tempTextNode.setAlign(align);\n const box = tempTextNode.computeBBox();\n let displayText = label.text;\n let visible = true;\n if (calloutLabel.avoidCollisions) {\n const { textLength, hasVerticalOverflow } = this.getLabelOverflow(label.text, box, seriesRect);\n displayText = label.text.length === textLength ? label.text : `${label.text.substring(0, textLength)}\\u2026`;\n visible = !hasVerticalOverflow;\n }\n text.text = displayText;\n text.x = x;\n text.y = y;\n text.setFont(this.properties.calloutLabel);\n text.setAlign(align);\n text.fill = color;\n text.visible = visible;\n });\n }\n computeLabelsBBox(options, seriesRect) {\n return __async(this, null, function* () {\n const { calloutLabel, calloutLine } = this.properties;\n const calloutLength = calloutLine.length;\n const { offset: offset4, maxCollisionOffset, minSpacing } = calloutLabel;\n if (!calloutLabel.avoidCollisions) {\n return null;\n }\n yield this.maybeRefreshNodeData();\n this.updateRadiusScale(false);\n this.computeCalloutLabelCollisionOffsets();\n const textBoxes = [];\n const text = new Text();\n let titleBox;\n const { title } = this.properties;\n if ((title == null ? void 0 : title.text) && title.enabled) {\n const dy = this.getTitleTranslationY();\n if (isFinite(dy)) {\n text.text = title.text;\n text.x = 0;\n text.y = dy;\n text.setFont(title);\n text.setAlign({\n textBaseline: \"bottom\",\n textAlign: \"center\"\n });\n titleBox = text.computeBBox();\n textBoxes.push(titleBox);\n }\n }\n this.nodeData.forEach((datum) => {\n var _a;\n const label = datum.calloutLabel;\n if (!label || datum.outerRadius === 0) {\n return null;\n }\n const labelRadius = datum.outerRadius + calloutLength + offset4;\n const x = datum.midCos * labelRadius;\n const y = datum.midSin * labelRadius + label.collisionOffsetY;\n text.text = label.text;\n text.x = x;\n text.y = y;\n text.setFont(this.properties.calloutLabel);\n text.setAlign({\n textAlign: (_a = label.collisionTextAlign) != null ? _a : label.textAlign,\n textBaseline: label.textBaseline\n });\n const box = text.computeBBox();\n label.box = box;\n if (Math.abs(label.collisionOffsetY) > maxCollisionOffset) {\n label.hidden = true;\n return;\n }\n if (titleBox) {\n const seriesTop = seriesRect.y - this.centerY;\n const titleCleanArea = new BBox(\n titleBox.x - minSpacing,\n seriesTop,\n titleBox.width + 2 * minSpacing,\n titleBox.y + titleBox.height + minSpacing - seriesTop\n );\n if (box.collidesBBox(titleCleanArea)) {\n label.hidden = true;\n return;\n }\n }\n if (options.hideWhenNecessary) {\n const { textLength, hasVerticalOverflow, hasSurroundingSeriesOverflow } = this.getLabelOverflow(\n label.text,\n box,\n seriesRect\n );\n const isTooShort = label.text.length > 2 && textLength < 2;\n if (hasVerticalOverflow || isTooShort || hasSurroundingSeriesOverflow) {\n label.hidden = true;\n return;\n }\n }\n label.hidden = false;\n textBoxes.push(box);\n });\n if (textBoxes.length === 0) {\n return null;\n }\n return BBox.merge(textBoxes);\n });\n }\n updateSectorLabelNodes() {\n const { radiusScale } = this;\n const innerRadius = radiusScale.convert(0);\n const { fontSize, fontStyle, fontWeight, fontFamily, positionOffset, positionRatio, color } = this.properties.sectorLabel;\n this.sectorLabelSelection.each((text, datum) => {\n const { sectorLabel, outerRadius } = datum;\n let isTextVisible = false;\n if (sectorLabel && outerRadius !== 0) {\n const labelRadius = innerRadius * (1 - positionRatio) + outerRadius * positionRatio + positionOffset;\n text.fill = color;\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.text = sectorLabel.text;\n text.x = datum.midCos * labelRadius;\n text.y = datum.midSin * labelRadius;\n text.textAlign = \"center\";\n text.textBaseline = \"middle\";\n const bbox = text.computeBBox();\n const corners = [\n [bbox.x, bbox.y],\n [bbox.x + bbox.width, bbox.y],\n [bbox.x + bbox.width, bbox.y + bbox.height],\n [bbox.x, bbox.y + bbox.height]\n ];\n const { startAngle, endAngle } = datum;\n const sectorBounds = { startAngle, endAngle, innerRadius, outerRadius };\n if (corners.every(([x, y]) => isPointInSector(x, y, sectorBounds))) {\n isTextVisible = true;\n }\n }\n text.visible = isTextVisible;\n });\n }\n updateInnerLabelNodes() {\n const textBBoxes = [];\n const margins = [];\n this.innerLabelsSelection.each((text, datum) => {\n const { fontStyle, fontWeight, fontSize, fontFamily, color } = datum;\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.text = datum.text;\n text.x = 0;\n text.y = 0;\n text.fill = color;\n text.textAlign = \"center\";\n text.textBaseline = \"alphabetic\";\n textBBoxes.push(text.computeBBox());\n margins.push(datum.margin);\n });\n const getMarginTop = (index) => index === 0 ? 0 : margins[index];\n const getMarginBottom = (index) => index === margins.length - 1 ? 0 : margins[index];\n const totalHeight = textBBoxes.reduce((sum2, bbox, i) => {\n return sum2 + bbox.height + getMarginTop(i) + getMarginBottom(i);\n }, 0);\n const totalWidth = Math.max(...textBBoxes.map((bbox) => bbox.width));\n const innerRadius = this.getInnerRadius();\n const labelRadius = Math.sqrt(Math.pow(totalWidth / 2, 2) + Math.pow(totalHeight / 2, 2));\n const labelsVisible = labelRadius <= (innerRadius > 0 ? innerRadius : this.getOuterRadius());\n const textBottoms = [];\n for (let i = 0, prev = -totalHeight / 2; i < textBBoxes.length; i++) {\n const bbox = textBBoxes[i];\n const bottom = bbox.height + prev + getMarginTop(i);\n textBottoms.push(bottom);\n prev = bottom + getMarginBottom(i);\n }\n this.innerLabelsSelection.each((text, _datum, index) => {\n text.y = textBottoms[index];\n text.visible = labelsVisible;\n });\n }\n updateZerosumRings() {\n this.zerosumOuterRing.size = this.getOuterRadius() * 2;\n this.zerosumInnerRing.size = this.getInnerRadius() * 2;\n }\n getDatumLegendName(nodeDatum) {\n const { angleKey, calloutLabelKey, sectorLabelKey, legendItemKey } = this.properties;\n const { sectorLabel, calloutLabel, legendItem } = nodeDatum;\n if (legendItemKey && legendItem !== void 0) {\n return legendItem.text;\n } else if (calloutLabelKey && calloutLabelKey !== angleKey && (calloutLabel == null ? void 0 : calloutLabel.text) !== void 0) {\n return calloutLabel.text;\n } else if (sectorLabelKey && sectorLabelKey !== angleKey && (sectorLabel == null ? void 0 : sectorLabel.text) !== void 0) {\n return sectorLabel.text;\n }\n }\n pickNodeClosestDatum(point) {\n return pickByMatchingAngle(this, point);\n }\n getTooltipHtml(nodeDatum) {\n var _a;\n if (!this.properties.isValid()) {\n return EMPTY_TOOLTIP_CONTENT;\n }\n const {\n datum,\n angleValue,\n sectorFormat: { fill: color },\n itemId\n } = nodeDatum;\n const title = sanitizeHtml((_a = this.properties.title) == null ? void 0 : _a.text);\n const content = isFiniteNumber(angleValue) ? toFixed(angleValue) : String(angleValue);\n const labelText = this.getDatumLegendName(nodeDatum);\n return this.properties.tooltip.toTooltipHtml(\n {\n title: title != null ? title : labelText,\n content: title && labelText ? `${labelText}: ${content}` : content,\n backgroundColor: color\n },\n {\n datum,\n itemId,\n title,\n color,\n seriesId: this.id,\n angleKey: this.properties.angleKey,\n angleName: this.properties.angleName,\n radiusKey: this.properties.radiusKey,\n radiusName: this.properties.radiusName,\n calloutLabelKey: this.properties.calloutLabelKey,\n calloutLabelName: this.properties.calloutLabelName,\n sectorLabelKey: this.properties.sectorLabelKey,\n sectorLabelName: this.properties.sectorLabelName,\n legendItemKey: this.properties.legendItemKey\n }\n );\n }\n getLegendData(legendType) {\n var _a, _b, _c, _d, _e;\n const { visible, processedData, dataModel } = this;\n if (!dataModel || !(processedData == null ? void 0 : processedData.data.length) || !this.properties.isValid() || legendType !== \"category\") {\n return [];\n }\n const { angleKey, calloutLabelKey, sectorLabelKey, legendItemKey } = this.properties;\n if (!legendItemKey && (!calloutLabelKey || calloutLabelKey === angleKey) && (!sectorLabelKey || sectorLabelKey === angleKey))\n return [];\n const { calloutLabelIdx, sectorLabelIdx, legendItemIdx } = this.getProcessedDataIndexes(dataModel);\n const titleText = ((_a = this.properties.title) == null ? void 0 : _a.showInLegend) && this.properties.title.text;\n const legendData = [];\n for (let index = 0; index < processedData.data.length; index++) {\n const { datum, values } = processedData.data[index];\n const labelParts = [];\n if (titleText) {\n labelParts.push(titleText);\n }\n const labels = this.getLabels(\n datum,\n 2 * Math.PI,\n 2 * Math.PI,\n false,\n values[calloutLabelIdx],\n values[sectorLabelIdx],\n values[legendItemIdx]\n );\n if (legendItemKey && labels.legendItem !== void 0) {\n labelParts.push(labels.legendItem.text);\n } else if (calloutLabelKey && calloutLabelKey !== angleKey && ((_b = labels.calloutLabel) == null ? void 0 : _b.text) !== void 0) {\n labelParts.push((_c = labels.calloutLabel) == null ? void 0 : _c.text);\n } else if (sectorLabelKey && sectorLabelKey !== angleKey && ((_d = labels.sectorLabel) == null ? void 0 : _d.text) !== void 0) {\n labelParts.push((_e = labels.sectorLabel) == null ? void 0 : _e.text);\n }\n if (labelParts.length === 0)\n continue;\n const sectorFormat = this.getSectorFormat(datum, index, false);\n legendData.push({\n legendType: \"category\",\n id: this.id,\n itemId: index,\n seriesId: this.id,\n enabled: visible && this.seriesItemEnabled[index],\n label: {\n text: labelParts.join(\" - \")\n },\n marker: {\n fill: sectorFormat.fill,\n stroke: sectorFormat.stroke,\n fillOpacity: this.properties.fillOpacity,\n strokeOpacity: this.properties.strokeOpacity,\n strokeWidth: this.properties.strokeWidth\n },\n legendItemName: legendItemKey != null ? datum[legendItemKey] : void 0\n });\n }\n return legendData;\n }\n onLegendItemClick(event) {\n const { enabled, itemId, series, legendItemName } = event;\n if (series.id === this.id) {\n this.toggleSeriesItem(itemId, enabled);\n } else if (legendItemName != null) {\n this.toggleOtherSeriesItems(legendItemName, enabled);\n }\n }\n toggleSeriesItem(itemId, enabled) {\n this.seriesItemEnabled[itemId] = enabled;\n this.nodeDataRefresh = true;\n }\n toggleOtherSeriesItems(legendItemName, enabled) {\n var _a;\n if (!this.properties.legendItemKey || !this.dataModel) {\n return;\n }\n const legendItemIdx = this.dataModel.resolveProcessedDataIndexById(this, `legendItemValue`);\n (_a = this.processedData) == null ? void 0 : _a.data.forEach(({ values }, datumItemId) => {\n if (values[legendItemIdx] === legendItemName) {\n this.toggleSeriesItem(datumItemId, enabled);\n }\n });\n }\n animateEmptyUpdateReady(_data) {\n const { animationManager } = this.ctx;\n const fns = preparePieSeriesAnimationFunctions(\n true,\n this.properties.rotation,\n this.radiusScale,\n this.previousRadiusScale\n );\n fromToMotion(this.id, \"nodes\", animationManager, [this.itemSelection, this.highlightSelection], fns.nodes);\n fromToMotion(this.id, `innerCircle`, animationManager, [this.innerCircleSelection], fns.innerCircle);\n seriesLabelFadeInAnimation(this, \"callout\", animationManager, this.calloutLabelSelection);\n seriesLabelFadeInAnimation(this, \"sector\", animationManager, this.sectorLabelSelection);\n seriesLabelFadeInAnimation(this, \"inner\", animationManager, this.innerLabelsSelection);\n this.previousRadiusScale.range = this.radiusScale.range;\n }\n animateWaitingUpdateReady() {\n var _a, _b, _c, _d, _e, _f;\n const { itemSelection, highlightSelection, processedData, radiusScale, previousRadiusScale } = this;\n const { animationManager } = this.ctx;\n const dataDiff = (_a = processedData == null ? void 0 : processedData.reduced) == null ? void 0 : _a.diff;\n this.ctx.animationManager.stopByAnimationGroupId(this.id);\n const supportedDiff = ((_b = dataDiff == null ? void 0 : dataDiff.moved.size) != null ? _b : 0) === 0;\n const hasKeys = ((_c = processedData == null ? void 0 : processedData.defs.keys.length) != null ? _c : 0) > 0;\n const hasUniqueKeys = (_f = (_e = (_d = processedData == null ? void 0 : processedData.reduced) == null ? void 0 : _d.animationValidation) == null ? void 0 : _e.uniqueKeys) != null ? _f : true;\n if (!supportedDiff || !hasKeys || !hasUniqueKeys) {\n this.ctx.animationManager.skipCurrentBatch();\n }\n const fns = preparePieSeriesAnimationFunctions(\n false,\n this.properties.rotation,\n radiusScale,\n previousRadiusScale\n );\n fromToMotion(\n this.id,\n \"nodes\",\n animationManager,\n [itemSelection, highlightSelection],\n fns.nodes,\n (_, datum) => this.getDatumId(datum),\n dataDiff\n );\n fromToMotion(this.id, `innerCircle`, animationManager, [this.innerCircleSelection], fns.innerCircle);\n seriesLabelFadeInAnimation(this, \"callout\", this.ctx.animationManager, this.calloutLabelSelection);\n seriesLabelFadeInAnimation(this, \"sector\", this.ctx.animationManager, this.sectorLabelSelection);\n seriesLabelFadeInAnimation(this, \"inner\", this.ctx.animationManager, this.innerLabelsSelection);\n this.previousRadiusScale.range = this.radiusScale.range;\n }\n animateClearingUpdateEmpty() {\n const { itemSelection, highlightSelection, radiusScale, previousRadiusScale } = this;\n const { animationManager } = this.ctx;\n const fns = preparePieSeriesAnimationFunctions(\n false,\n this.properties.rotation,\n radiusScale,\n previousRadiusScale\n );\n fromToMotion(this.id, \"nodes\", animationManager, [itemSelection, highlightSelection], fns.nodes);\n fromToMotion(this.id, `innerCircle`, animationManager, [this.innerCircleSelection], fns.innerCircle);\n seriesLabelFadeOutAnimation(this, \"callout\", this.ctx.animationManager, this.calloutLabelSelection);\n seriesLabelFadeOutAnimation(this, \"sector\", this.ctx.animationManager, this.sectorLabelSelection);\n seriesLabelFadeOutAnimation(this, \"inner\", this.ctx.animationManager, this.innerLabelsSelection);\n this.previousRadiusScale.range = this.radiusScale.range;\n }\n getDatumIdFromData(datum) {\n var _a, _b, _c;\n const { calloutLabelKey, sectorLabelKey, legendItemKey } = this.properties;\n if (!((_c = (_b = (_a = this.processedData) == null ? void 0 : _a.reduced) == null ? void 0 : _b.animationValidation) == null ? void 0 : _c.uniqueKeys)) {\n return;\n }\n if (legendItemKey) {\n return datum[legendItemKey];\n } else if (calloutLabelKey) {\n return datum[calloutLabelKey];\n } else if (sectorLabelKey) {\n return datum[sectorLabelKey];\n }\n }\n getDatumId(datum) {\n const { index } = datum;\n const datumId = this.getDatumIdFromData(datum.datum);\n return datumId != null ? String(datumId) : `${index}`;\n }\n onDataChange() {\n var _a;\n const { data, seriesItemEnabled } = this;\n this.seriesItemEnabled = (_a = data == null ? void 0 : data.map((_, index) => {\n var _a2;\n return (_a2 = seriesItemEnabled[index]) != null ? _a2 : true;\n })) != null ? _a : [];\n }\n computeFocusBounds(opts) {\n return computeSectorFocusBounds(this, opts);\n }\n};\nDonutSeries.className = \"DonutSeries\";\nDonutSeries.type = \"donut\";\n\n// packages/ag-charts-community/src/chart/series/polar/pieTheme.ts\nvar pieTheme = {\n series: {\n __extends__: EXTENDS_SERIES_DEFAULTS,\n title: {\n enabled: true,\n fontStyle: void 0,\n fontWeight: \"normal\" /* NORMAL */,\n fontSize: 14,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_MUTED_LABEL_COLOUR,\n spacing: 5\n },\n calloutLabel: {\n enabled: true,\n fontStyle: void 0,\n fontWeight: void 0,\n fontSize: 12,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_LABEL_COLOUR,\n offset: 3,\n minAngle: 0\n },\n sectorLabel: {\n enabled: true,\n fontStyle: void 0,\n fontWeight: \"normal\" /* NORMAL */,\n fontSize: 12,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_INSIDE_SERIES_LABEL_COLOUR,\n positionOffset: 0,\n positionRatio: 0.5\n },\n calloutLine: {\n length: 10,\n strokeWidth: 2\n },\n fillOpacity: 1,\n strokeOpacity: 1,\n strokeWidth: 1,\n lineDash: [0],\n lineDashOffset: 0,\n rotation: 0,\n // @todo(AG-10275) Uncomment this\n // sectorSpacing: 1,\n shadow: {\n enabled: false,\n color: DEFAULT_SHADOW_COLOUR,\n xOffset: 3,\n yOffset: 3,\n blur: 5\n },\n innerLabels: {\n fontStyle: void 0,\n fontWeight: void 0,\n fontSize: 12,\n fontFamily: DEFAULT_FONT_FAMILY,\n color: DEFAULT_LABEL_COLOUR,\n margin: 2\n },\n // @todo(AG-10275) Remove this\n // @ts-expect-error\n __BACKGROUND_COLOR_DO_NOT_USE: DEFAULT_BACKGROUND_COLOUR\n }\n};\nvar piePaletteFactory = ({ takeColors, colorsCount, userPalette }) => {\n const { fills, strokes } = takeColors(colorsCount);\n return {\n fills,\n strokes: userPalette ? strokes : [],\n calloutLine: {\n colors: strokes\n }\n };\n};\n\n// packages/ag-charts-community/src/chart/series/polar/donutSeriesModule.ts\nvar DonutSeriesModule = {\n type: \"series\",\n optionsKey: \"series[]\",\n packageType: \"community\",\n chartTypes: [\"polar\"],\n identifier: \"donut\",\n instanceConstructor: DonutSeries,\n themeTemplate: pieTheme,\n paletteFactory: piePaletteFactory\n};\n\n// packages/ag-charts-community/src/chart/series/polar/pieSeriesProperties.ts\nvar PieTitle = class extends Caption {\n constructor() {\n super(...arguments);\n this.showInLegend = false;\n }\n};\n__decorateClass([\n Validate(BOOLEAN)\n], PieTitle.prototype, \"showInLegend\", 2);\nvar DonutInnerLabel2 = class extends Label {\n set(properties, _reset) {\n return super.set(properties);\n }\n};\n__decorateClass([\n Deprecated(\"Use a Donut Series instead\"),\n Validate(STRING, { optional: true })\n], DonutInnerLabel2.prototype, \"text\", 2);\n__decorateClass([\n Deprecated(\"Use a Donut Series instead\"),\n Validate(NUMBER, { optional: true })\n], DonutInnerLabel2.prototype, \"margin\", 2);\nvar DonutInnerCircle2 = class extends BaseProperties {\n};\n__decorateClass([\n Deprecated(\"Use a Donut Series instead\"),\n Validate(COLOR_STRING, { optional: true })\n], DonutInnerCircle2.prototype, \"fill\", 2);\n__decorateClass([\n Deprecated(\"Use a Donut Series instead\"),\n Validate(RATIO, { optional: true })\n], DonutInnerCircle2.prototype, \"fillOpacity\", 2);\nvar PieSeriesCalloutLabel = class extends Label {\n constructor() {\n super(...arguments);\n this.offset = 3;\n this.minAngle = 0;\n this.minSpacing = 4;\n this.maxCollisionOffset = 50;\n this.avoidCollisions = true;\n }\n};\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PieSeriesCalloutLabel.prototype, \"offset\", 2);\n__decorateClass([\n Validate(DEGREE)\n], PieSeriesCalloutLabel.prototype, \"minAngle\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PieSeriesCalloutLabel.prototype, \"minSpacing\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PieSeriesCalloutLabel.prototype, \"maxCollisionOffset\", 2);\n__decorateClass([\n Validate(BOOLEAN)\n], PieSeriesCalloutLabel.prototype, \"avoidCollisions\", 2);\nvar PieSeriesSectorLabel = class extends Label {\n constructor() {\n super(...arguments);\n this.positionOffset = 0;\n this.positionRatio = 0.5;\n }\n};\n__decorateClass([\n Validate(NUMBER)\n], PieSeriesSectorLabel.prototype, \"positionOffset\", 2);\n__decorateClass([\n Validate(RATIO)\n], PieSeriesSectorLabel.prototype, \"positionRatio\", 2);\nvar PieSeriesCalloutLine = class extends BaseProperties {\n constructor() {\n super(...arguments);\n this.length = 10;\n this.strokeWidth = 1;\n }\n};\n__decorateClass([\n Validate(COLOR_STRING_ARRAY, { optional: true })\n], PieSeriesCalloutLine.prototype, \"colors\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PieSeriesCalloutLine.prototype, \"length\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PieSeriesCalloutLine.prototype, \"strokeWidth\", 2);\nvar PieSeriesProperties = class extends SeriesProperties {\n constructor() {\n super(...arguments);\n this.fills = Object.values(DEFAULT_FILLS);\n this.strokes = Object.values(DEFAULT_STROKES);\n this.fillOpacity = 1;\n this.strokeOpacity = 1;\n this.lineDash = [0];\n this.lineDashOffset = 0;\n this.cornerRadius = 0;\n this.rotation = 0;\n this.outerRadiusOffset = 0;\n this.outerRadiusRatio = 1;\n this.strokeWidth = 1;\n this.sectorSpacing = void 0;\n this.innerLabels = new PropertiesArray(DonutInnerLabel2);\n this.title = new PieTitle();\n this.innerCircle = new DonutInnerCircle2();\n this.shadow = new DropShadow();\n this.calloutLabel = new PieSeriesCalloutLabel();\n this.sectorLabel = new PieSeriesSectorLabel();\n this.calloutLine = new PieSeriesCalloutLine();\n this.tooltip = new SeriesTooltip();\n this.__BACKGROUND_COLOR_DO_NOT_USE = void 0;\n }\n};\n__decorateClass([\n Validate(STRING)\n], PieSeriesProperties.prototype, \"angleKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], PieSeriesProperties.prototype, \"angleName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], PieSeriesProperties.prototype, \"radiusKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], PieSeriesProperties.prototype, \"radiusName\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], PieSeriesProperties.prototype, \"radiusMin\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], PieSeriesProperties.prototype, \"radiusMax\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], PieSeriesProperties.prototype, \"calloutLabelKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], PieSeriesProperties.prototype, \"calloutLabelName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], PieSeriesProperties.prototype, \"sectorLabelKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], PieSeriesProperties.prototype, \"sectorLabelName\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], PieSeriesProperties.prototype, \"legendItemKey\", 2);\n__decorateClass([\n Validate(COLOR_STRING_ARRAY)\n], PieSeriesProperties.prototype, \"fills\", 2);\n__decorateClass([\n Validate(COLOR_STRING_ARRAY)\n], PieSeriesProperties.prototype, \"strokes\", 2);\n__decorateClass([\n Validate(RATIO)\n], PieSeriesProperties.prototype, \"fillOpacity\", 2);\n__decorateClass([\n Validate(RATIO)\n], PieSeriesProperties.prototype, \"strokeOpacity\", 2);\n__decorateClass([\n Validate(LINE_DASH)\n], PieSeriesProperties.prototype, \"lineDash\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PieSeriesProperties.prototype, \"lineDashOffset\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PieSeriesProperties.prototype, \"cornerRadius\", 2);\n__decorateClass([\n Validate(FUNCTION, { optional: true })\n], PieSeriesProperties.prototype, \"formatter\", 2);\n__decorateClass([\n Validate(DEGREE)\n], PieSeriesProperties.prototype, \"rotation\", 2);\n__decorateClass([\n Validate(NUMBER)\n], PieSeriesProperties.prototype, \"outerRadiusOffset\", 2);\n__decorateClass([\n Validate(RATIO)\n], PieSeriesProperties.prototype, \"outerRadiusRatio\", 2);\n__decorateClass([\n Deprecated(\"Use a Donut Series instead\"),\n Validate(NUMBER, { optional: true })\n], PieSeriesProperties.prototype, \"innerRadiusOffset\", 2);\n__decorateClass([\n Deprecated(\"Use a Donut Series instead\"),\n Validate(RATIO, { optional: true })\n], PieSeriesProperties.prototype, \"innerRadiusRatio\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER)\n], PieSeriesProperties.prototype, \"strokeWidth\", 2);\n__decorateClass([\n Validate(POSITIVE_NUMBER, { optional: true })\n], PieSeriesProperties.prototype, \"sectorSpacing\", 2);\n__decorateClass([\n Validate(OBJECT_ARRAY)\n], PieSeriesProperties.prototype, \"innerLabels\", 2);\n__decorateClass([\n Validate(OBJECT)\n], PieSeriesProperties.prototype, \"title\", 2);\n__decorateClass([\n Validate(OBJECT)\n], PieSeriesProperties.prototype, \"innerCircle\", 2);\n__decorateClass([\n Validate(OBJECT)\n], PieSeriesProperties.prototype, \"shadow\", 2);\n__decorateClass([\n Validate(OBJECT)\n], PieSeriesProperties.prototype, \"calloutLabel\", 2);\n__decorateClass([\n Validate(OBJECT)\n], PieSeriesProperties.prototype, \"sectorLabel\", 2);\n__decorateClass([\n Validate(OBJECT)\n], PieSeriesProperties.prototype, \"calloutLine\", 2);\n__decorateClass([\n Validate(OBJECT)\n], PieSeriesProperties.prototype, \"tooltip\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], PieSeriesProperties.prototype, \"__BACKGROUND_COLOR_DO_NOT_USE\", 2);\n\n// packages/ag-charts-community/src/chart/series/polar/pieSeries.ts\nvar PieSeriesNodeEvent = class extends SeriesNodeEvent {\n constructor(type, nativeEvent, datum, series) {\n super(type, nativeEvent, datum, series);\n this.angleKey = series.properties.angleKey;\n this.radiusKey = series.properties.radiusKey;\n this.calloutLabelKey = series.properties.calloutLabelKey;\n this.sectorLabelKey = series.properties.sectorLabelKey;\n }\n};\nvar PieSeries = class extends PolarSeries {\n constructor(moduleCtx) {\n super({\n moduleCtx,\n pickModes: [0 /* EXACT_SHAPE_MATCH */],\n useLabelLayer: true,\n animationResetFns: { item: resetPieSelectionsFn, label: resetLabelFn }\n });\n this.properties = new PieSeriesProperties();\n this.previousRadiusScale = new LinearScale();\n this.radiusScale = new LinearScale();\n // The group node that contains the background graphics.\n this.backgroundGroup = this.rootGroup.appendChild(\n new Group({\n name: `${this.id}-background`,\n layer: true,\n zIndex: 0 /* SERIES_BACKGROUND_ZINDEX */\n })\n );\n // AG-6193 If the sum of all datums is 0, then we'll draw 1 or 2 rings to represent the empty series.\n this.zerosumRingsGroup = this.backgroundGroup.appendChild(new Group({ name: `${this.id}-zerosumRings` }));\n this.zerosumOuterRing = this.zerosumRingsGroup.appendChild(new Circle());\n this.zerosumInnerRing = this.zerosumRingsGroup.appendChild(new Circle());\n this.innerCircleGroup = this.backgroundGroup.appendChild(new Group({ name: `${this.id}-innerCircle` }));\n // When a user toggles a series item (e.g. from the legend), its boolean state is recorded here.\n this.seriesItemEnabled = [];\n this.surroundingRadius = void 0;\n this.NodeEvent = PieSeriesNodeEvent;\n this.angleScale = new LinearScale();\n this.angleScale.domain = [0, 1];\n this.angleScale.range = [-Math.PI, Math.PI].map((angle) => angle + Math.PI / 2);\n const pieCalloutLabels = new Group({ name: \"pieCalloutLabels\" });\n const pieSectorLabels = new Group({ name: \"pieSectorLabels\" });\n const innerLabels = new Group({ name: \"innerLabels\" });\n this.labelGroup.append(pieCalloutLabels);\n this.labelGroup.append(pieSectorLabels);\n this.labelGroup.append(innerLabels);\n this.calloutLabelSelection = Selection.select(pieCalloutLabels, Group);\n this.sectorLabelSelection = Selection.select(pieSectorLabels, Text);\n this.innerLabelsSelection = Selection.select(innerLabels, Text);\n this.innerCircleSelection = Selection.select(this.innerCircleGroup, Circle);\n }\n addChartEventListeners() {\n var _a;\n this.destroyFns.push(\n (_a = this.ctx.chartEventManager) == null ? void 0 : _a.addListener(\"legend-item-click\", (event) => this.onLegendItemClick(event))\n );\n }\n get visible() {\n return super.visible && (this.seriesItemEnabled.length === 0 || this.seriesItemEnabled.some((visible) => visible));\n }\n nodeFactory() {\n return new Sector();\n }\n getSeriesDomain(direction) {\n if (direction === \"x\" /* X */) {\n return this.angleScale.domain;\n } else {\n return this.radiusScale.domain;\n }\n }\n processData(dataController) {\n return __async(this, null, function* () {\n var _a, _b, _c, _d, _e;\n if (this.data == null || !this.properties.isValid()) {\n return;\n }\n let { data } = this;\n const { visible, seriesItemEnabled } = this;\n const { angleKey, radiusKey, calloutLabelKey, sectorLabelKey, legendItemKey } = this.properties;\n const animationEnabled = !this.ctx.animationManager.isSkipped();\n const extraKeyProps = [];\n const extraProps = [];\n if (legendItemKey) {\n extraKeyProps.push(keyProperty(legendItemKey, \"band\", { id: `legendItemKey` }));\n } else if (calloutLabelKey) {\n extraKeyProps.push(keyProperty(calloutLabelKey, \"band\", { id: `calloutLabelKey` }));\n } else if (sectorLabelKey) {\n extraKeyProps.push(keyProperty(sectorLabelKey, \"band\", { id: `sectorLabelKey` }));\n }\n const radiusScaleType = this.radiusScale.type;\n const angleScaleType = this.radiusScale.type;\n if (radiusKey) {\n extraProps.push(\n rangedValueProperty(radiusKey, {\n id: \"radiusValue\",\n min: (_a = this.properties.radiusMin) != null ? _a : 0,\n max: this.properties.radiusMax\n }),\n valueProperty(radiusKey, radiusScaleType, { id: `radiusRaw` }),\n // Raw value pass-through.\n normalisePropertyTo(\n { id: \"radiusValue\" },\n [0, 1],\n 1,\n (_b = this.properties.radiusMin) != null ? _b : 0,\n this.properties.radiusMax\n )\n );\n }\n if (calloutLabelKey) {\n extraProps.push(valueProperty(calloutLabelKey, \"band\", { id: `calloutLabelValue` }));\n }\n if (sectorLabelKey) {\n extraProps.push(valueProperty(sectorLabelKey, \"band\", { id: `sectorLabelValue` }));\n }\n if (legendItemKey) {\n extraProps.push(valueProperty(legendItemKey, \"band\", { id: `legendItemValue` }));\n }\n if (animationEnabled && this.processedData && extraKeyProps.length > 0) {\n extraProps.push(diff(this.processedData));\n }\n extraProps.push(animationValidation());\n data = data.map((d, idx) => visible && seriesItemEnabled[idx] ? d : __spreadProps(__spreadValues({}, d), { [angleKey]: 0 }));\n yield this.requestDataModel(dataController, data, {\n props: [\n ...extraKeyProps,\n accumulativeValueProperty(angleKey, angleScaleType, { id: `angleValue`, onlyPositive: true }),\n valueProperty(angleKey, angleScaleType, { id: `angleRaw` }),\n // Raw value pass-through.\n normalisePropertyTo({ id: \"angleValue\" }, [0, 1], 0, 0),\n ...extraProps\n ]\n });\n for (const valueDef of (_e = (_d = (_c = this.processedData) == null ? void 0 : _c.defs) == null ? void 0 : _d.values) != null ? _e : []) {\n const { id, missing, property } = valueDef;\n const missCount = getMissCount(this, missing);\n if (id !== \"angleRaw\" && missCount > 0) {\n Logger.warnOnce(\n `no value was found for the key '${String(property)}' on ${missCount} data element${missCount > 1 ? \"s\" : \"\"}`\n );\n }\n }\n this.animationState.transition(\"updateData\");\n });\n }\n maybeRefreshNodeData() {\n return __async(this, null, function* () {\n var _a;\n if (!this.nodeDataRefresh)\n return;\n const { nodeData = [] } = (_a = yield this.createNodeData()) != null ? _a : {};\n this.nodeData = nodeData;\n this.nodeDataRefresh = false;\n });\n }\n getProcessedDataIndexes(dataModel) {\n const angleIdx = dataModel.resolveProcessedDataIndexById(this, `angleValue`);\n const radiusIdx = this.properties.radiusKey ? dataModel.resolveProcessedDataIndexById(this, `radiusValue`) : -1;\n const calloutLabelIdx = this.properties.calloutLabelKey ? dataModel.resolveProcessedDataIndexById(this, `calloutLabelValue`) : -1;\n const sectorLabelIdx = this.properties.sectorLabelKey ? dataModel.resolveProcessedDataIndexById(this, `sectorLabelValue`) : -1;\n const legendItemIdx = this.properties.legendItemKey ? dataModel.resolveProcessedDataIndexById(this, `legendItemValue`) : -1;\n return { angleIdx, radiusIdx, calloutLabelIdx, sectorLabelIdx, legendItemIdx };\n }\n createNodeData() {\n return __async(this, null, function* () {\n const { id: seriesId, processedData, dataModel, angleScale } = this;\n const { rotation } = this.properties;\n if (!processedData || !dataModel || processedData.type !== \"ungrouped\")\n return;\n const { angleIdx, radiusIdx, calloutLabelIdx, sectorLabelIdx, legendItemIdx } = this.getProcessedDataIndexes(dataModel);\n let currentStart = 0;\n let sum2 = 0;\n const nodeData = processedData.data.map((group2, index) => {\n var _a;\n const { datum, values } = group2;\n const currentValue = values[angleIdx];\n const startAngle = angleScale.convert(currentStart) + toRadians(rotation);\n currentStart = currentValue;\n sum2 += currentValue;\n const endAngle = angleScale.convert(currentStart) + toRadians(rotation);\n const span = Math.abs(endAngle - startAngle);\n const midAngle = startAngle + span / 2;\n const angleValue = values[angleIdx + 1];\n const radius = radiusIdx >= 0 ? (_a = values[radiusIdx]) != null ? _a : 1 : 1;\n const radiusValue = radiusIdx >= 0 ? values[radiusIdx + 1] : void 0;\n const legendItemValue = legendItemIdx >= 0 ? values[legendItemIdx] : void 0;\n const labels = this.getLabels(\n datum,\n midAngle,\n span,\n true,\n values[calloutLabelIdx],\n values[sectorLabelIdx],\n legendItemValue\n );\n const sectorFormat = this.getSectorFormat(datum, index, false);\n return __spreadValues({\n itemId: index,\n series: this,\n datum,\n index,\n angleValue,\n midAngle,\n midCos: Math.cos(midAngle),\n midSin: Math.sin(midAngle),\n startAngle,\n endAngle,\n sectorFormat,\n radiusValue,\n radius,\n innerRadius: Math.max(this.radiusScale.convert(0), 0),\n outerRadius: Math.max(this.radiusScale.convert(radius), 0),\n legendItemValue\n }, labels);\n });\n this.zerosumOuterRing.visible = sum2 === 0;\n const { innerRadiusRatio = 1 } = this.properties;\n this.zerosumInnerRing.visible = sum2 === 0 && innerRadiusRatio !== 1 && innerRadiusRatio > 0;\n return { itemId: seriesId, nodeData, labelData: nodeData };\n });\n }\n getLabels(datum, midAngle, span, skipDisabled, calloutLabelValue, sectorLabelValue, legendItemValue) {\n const { calloutLabel, sectorLabel, legendItemKey } = this.properties;\n const calloutLabelKey = !skipDisabled || calloutLabel.enabled ? this.properties.calloutLabelKey : void 0;\n const sectorLabelKey = !skipDisabled || sectorLabel.enabled ? this.properties.sectorLabelKey : void 0;\n if (!calloutLabelKey && !sectorLabelKey && !legendItemKey) {\n return {};\n }\n const labelFormatterParams = {\n datum,\n angleKey: this.properties.angleKey,\n angleName: this.properties.angleName,\n radiusKey: this.properties.radiusKey,\n radiusName: this.properties.radiusName,\n calloutLabelKey: this.properties.calloutLabelKey,\n calloutLabelName: this.properties.calloutLabelName,\n sectorLabelKey: this.properties.sectorLabelKey,\n sectorLabelName: this.properties.sectorLabelName,\n legendItemKey: this.properties.legendItemKey\n };\n const result = {};\n if (calloutLabelKey && span > toRadians(calloutLabel.minAngle)) {\n result.calloutLabel = __spreadProps(__spreadValues({}, this.getTextAlignment(midAngle)), {\n text: this.getLabelText(calloutLabel, __spreadProps(__spreadValues({}, labelFormatterParams), {\n value: calloutLabelValue\n })),\n hidden: false,\n collisionTextAlign: void 0,\n collisionOffsetY: 0,\n box: void 0\n });\n }\n if (sectorLabelKey) {\n result.sectorLabel = {\n text: this.getLabelText(sectorLabel, __spreadProps(__spreadValues({}, labelFormatterParams), {\n value: sectorLabelValue\n }))\n };\n }\n if (legendItemKey != null && legendItemValue != null) {\n result.legendItem = { key: legendItemKey, text: legendItemValue };\n }\n return result;\n }\n getTextAlignment(midAngle) {\n const quadrantTextOpts = [\n { textAlign: \"center\", textBaseline: \"bottom\" },\n { textAlign: \"left\", textBaseline: \"middle\" },\n { textAlign: \"center\", textBaseline: \"hanging\" },\n { textAlign: \"right\", textBaseline: \"middle\" }\n ];\n const midAngle180 = normalizeAngle180(midAngle);\n const quadrantStart = -0.75 * Math.PI;\n const quadrantOffset = midAngle180 - quadrantStart;\n const quadrant = Math.floor(quadrantOffset / (Math.PI / 2));\n const quadrantIndex = mod(quadrant, quadrantTextOpts.length);\n return quadrantTextOpts[quadrantIndex];\n }\n getSectorFormat(datum, formatIndex, highlight) {\n var _a, _b, _c, _d, _e;\n const { callbackCache, highlightManager } = this.ctx;\n const { angleKey, radiusKey, fills, strokes, formatter, sectorSpacing, __BACKGROUND_COLOR_DO_NOT_USE } = this.properties;\n const highlightedDatum = highlightManager.getActiveHighlight();\n const isDatumHighlighted = highlight && (highlightedDatum == null ? void 0 : highlightedDatum.series) === this && formatIndex === highlightedDatum.itemId;\n let defaultStroke = strokes[formatIndex % strokes.length];\n if (sectorSpacing != null) {\n defaultStroke != null ? defaultStroke : defaultStroke = __BACKGROUND_COLOR_DO_NOT_USE;\n }\n const { fill, fillOpacity, stroke, strokeWidth, strokeOpacity } = mergeDefaults(\n isDatumHighlighted && this.properties.highlightStyle.item,\n {\n fill: fills.length > 0 ? fills[formatIndex % fills.length] : void 0,\n fillOpacity: this.properties.fillOpacity,\n stroke: defaultStroke,\n strokeWidth: this.getStrokeWidth(this.properties.strokeWidth),\n strokeOpacity: this.getOpacity()\n }\n );\n let format2;\n if (formatter) {\n format2 = callbackCache.call(formatter, {\n datum,\n angleKey,\n radiusKey,\n fill,\n stroke,\n fills,\n strokes,\n strokeWidth,\n highlighted: isDatumHighlighted,\n seriesId: this.id\n });\n }\n return {\n fill: (_a = format2 == null ? void 0 : format2.fill) != null ? _a : fill,\n fillOpacity: (_b = format2 == null ? void 0 : format2.fillOpacity) != null ? _b : fillOpacity,\n stroke: (_c = format2 == null ? void 0 : format2.stroke) != null ? _c : stroke,\n strokeWidth: (_d = format2 == null ? void 0 : format2.strokeWidth) != null ? _d : strokeWidth,\n strokeOpacity: (_e = format2 == null ? void 0 : format2.strokeOpacity) != null ? _e : strokeOpacity\n };\n }\n getInnerRadius() {\n const { radius } = this;\n const { innerRadiusRatio = 1, innerRadiusOffset = 0 } = this.properties;\n const innerRadius = radius * innerRadiusRatio + innerRadiusOffset;\n if (innerRadius === radius || innerRadius < 0) {\n return 0;\n }\n return innerRadius;\n }\n getOuterRadius() {\n return Math.max(this.radius * this.properties.outerRadiusRatio + this.properties.outerRadiusOffset, 0);\n }\n updateRadiusScale(resize) {\n const newRange = [this.getInnerRadius(), this.getOuterRadius()];\n this.radiusScale.range = newRange;\n if (resize) {\n this.previousRadiusScale.range = newRange;\n }\n this.nodeData = this.nodeData.map((_a) => {\n var _b = _a, { radius } = _b, d = __objRest(_b, [\"radius\"]);\n return __spreadProps(__spreadValues({}, d), {\n radius,\n innerRadius: Math.max(this.radiusScale.convert(0), 0),\n outerRadius: Math.max(this.radiusScale.convert(radius), 0)\n });\n });\n }\n getTitleTranslationY() {\n var _a, _b;\n const outerRadius = Math.max(0, this.radiusScale.range[1]);\n if (outerRadius === 0) {\n return NaN;\n }\n const spacing = (_b = (_a = this.properties.title) == null ? void 0 : _a.spacing) != null ? _b : 0;\n const titleOffset = 2 + spacing;\n const dy = Math.max(0, -outerRadius);\n return -outerRadius - titleOffset - dy;\n }\n update(_0) {\n return __async(this, arguments, function* ({ seriesRect }) {\n const { title } = this.properties;\n const newNodeDataDependencies = {\n seriesRectWidth: seriesRect == null ? void 0 : seriesRect.width,\n seriesRectHeight: seriesRect == null ? void 0 : seriesRect.height\n };\n const resize = jsonDiff(this.nodeDataDependencies, newNodeDataDependencies) != null;\n if (resize) {\n this._nodeDataDependencies = newNodeDataDependencies;\n }\n yield this.maybeRefreshNodeData();\n this.updateTitleNodes();\n this.updateRadiusScale(resize);\n this.contentGroup.translationX = this.centerX;\n this.contentGroup.translationY = this.centerY;\n this.highlightGroup.translationX = this.centerX;\n this.highlightGroup.translationY = this.centerY;\n this.backgroundGroup.translationX = this.centerX;\n this.backgroundGroup.translationY = this.centerY;\n if (this.labelGroup) {\n this.labelGroup.translationX = this.centerX;\n this.labelGroup.translationY = this.centerY;\n }\n if (title) {\n const dy = this.getTitleTranslationY();\n const titleBox = title.node.computeBBox();\n title.node.visible = title.enabled && isFinite(dy) && !this.bboxIntersectsSurroundingSeries(titleBox, 0, dy);\n title.node.translationY = isFinite(dy) ? dy : 0;\n }\n for (const circle of [this.zerosumInnerRing, this.zerosumOuterRing]) {\n circle.fillOpacity = 0;\n circle.stroke = this.properties.calloutLabel.color;\n circle.strokeWidth = 1;\n circle.strokeOpacity = 1;\n }\n this.updateNodeMidPoint();\n yield this.updateSelections();\n yield this.updateNodes(seriesRect);\n });\n }\n updateTitleNodes() {\n var _a, _b;\n const { oldTitle } = this;\n const { title } = this.properties;\n if (oldTitle !== title) {\n if (oldTitle) {\n (_a = this.labelGroup) == null ? void 0 : _a.removeChild(oldTitle.node);\n }\n if (title) {\n title.node.textBaseline = \"bottom\";\n (_b = this.labelGroup) == null ? void 0 : _b.appendChild(title.node);\n }\n this.oldTitle = title;\n }\n }\n updateNodeMidPoint() {\n this.nodeData.forEach((d) => {\n const radius = d.innerRadius + (d.outerRadius - d.innerRadius) / 2;\n d.midPoint = {\n x: d.midCos * Math.max(0, radius),\n y: d.midSin * Math.max(0, radius)\n };\n });\n }\n updateSelections() {\n return __async(this, null, function* () {\n yield this.updateGroupSelection();\n this.updateInnerCircleSelection();\n });\n }\n updateGroupSelection() {\n return __async(this, null, function* () {\n const { itemSelection, highlightSelection, calloutLabelSelection, sectorLabelSelection, innerLabelsSelection } = this;\n const update = (selection, clone) => {\n let nodeData = this.nodeData;\n if (clone) {\n nodeData = nodeData.map((datum) => __spreadProps(__spreadValues({}, datum), { sectorFormat: __spreadValues({}, datum.sectorFormat) }));\n }\n selection.update(nodeData, void 0, (datum) => this.getDatumId(datum));\n if (this.ctx.animationManager.isSkipped()) {\n selection.cleanup();\n }\n };\n update(itemSelection, false);\n update(highlightSelection, true);\n calloutLabelSelection.update(this.nodeData, (group2) => {\n const line = new Line();\n line.tag = 0 /* Callout */;\n line.pointerEvents = 1 /* None */;\n group2.appendChild(line);\n const text = new Text();\n text.tag = 1 /* Label */;\n text.pointerEvents = 1 /* None */;\n group2.appendChild(text);\n });\n sectorLabelSelection.update(this.nodeData, (node) => {\n node.pointerEvents = 1 /* None */;\n });\n innerLabelsSelection.update(this.properties.innerLabels, (node) => {\n node.pointerEvents = 1 /* None */;\n });\n });\n }\n updateInnerCircleSelection() {\n const { innerCircle } = this.properties;\n let radius = 0;\n const innerRadius = this.getInnerRadius();\n if (innerRadius > 0) {\n const circleRadius = Math.min(innerRadius, this.getOuterRadius());\n const antiAliasingPadding = 1;\n radius = Math.ceil(circleRadius * 2 + antiAliasingPadding);\n }\n const datums = innerCircle ? [{ radius }] : [];\n this.innerCircleSelection.update(datums);\n }\n updateNodes(seriesRect) {\n return __async(this, null, function* () {\n const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();\n const isVisible = this.visible && this.seriesItemEnabled.indexOf(true) >= 0;\n this.rootGroup.visible = isVisible;\n this.backgroundGroup.visible = isVisible;\n this.contentGroup.visible = isVisible;\n this.highlightGroup.visible = isVisible && (highlightedDatum == null ? void 0 : highlightedDatum.series) === this;\n if (this.labelGroup) {\n this.labelGroup.visible = isVisible;\n }\n this.contentGroup.opacity = this.getOpacity();\n this.innerCircleSelection.each((node, { radius }) => {\n var _a, _b;\n node.setProperties({\n fill: (_a = this.properties.innerCircle) == null ? void 0 : _a.fill,\n opacity: (_b = this.properties.innerCircle) == null ? void 0 : _b.fillOpacity,\n size: radius\n });\n });\n const updateSectorFn = (sector, datum, _index, isDatumHighlighted) => {\n const format2 = this.getSectorFormat(datum.datum, datum.itemId, isDatumHighlighted);\n datum.sectorFormat.fill = format2.fill;\n datum.sectorFormat.stroke = format2.stroke;\n const animationDisabled = this.ctx.animationManager.isSkipped();\n if (animationDisabled) {\n sector.startAngle = datum.startAngle;\n sector.endAngle = datum.endAngle;\n sector.innerRadius = datum.innerRadius;\n sector.outerRadius = datum.outerRadius;\n }\n if (isDatumHighlighted || animationDisabled) {\n sector.fill = format2.fill;\n sector.stroke = format2.stroke;\n }\n sector.strokeWidth = format2.strokeWidth;\n sector.fillOpacity = format2.fillOpacity;\n sector.strokeOpacity = this.properties.strokeOpacity;\n sector.lineDash = this.properties.lineDash;\n sector.lineDashOffset = this.properties.lineDashOffset;\n sector.fillShadow = this.properties.shadow;\n sector.cornerRadius = this.properties.cornerRadius;\n sector.inset = this.properties.sectorSpacing != null ? (this.properties.sectorSpacing + (format2.stroke != null ? format2.strokeWidth : 0)) / 2 : 0;\n sector.lineJoin = this.properties.sectorSpacing != null ? \"miter\" : \"round\";\n };\n this.itemSelection.each((node, datum, index) => updateSectorFn(node, datum, index, false));\n this.highlightSelection.each((node, datum, index) => {\n const isDatumHighlighted = (highlightedDatum == null ? void 0 : highlightedDatum.series) === this && node.datum.itemId === highlightedDatum.itemId;\n updateSectorFn(node, datum, index, true);\n node.visible = isDatumHighlighted;\n });\n this.updateCalloutLineNodes();\n this.updateCalloutLabelNodes(seriesRect);\n this.updateSectorLabelNodes();\n this.updateInnerLabelNodes();\n this.updateZerosumRings();\n this.animationState.transition(\"update\");\n });\n }\n updateCalloutLineNodes() {\n var _a;\n const { calloutLine } = this.properties;\n const calloutLength = calloutLine.length;\n const calloutStrokeWidth = calloutLine.strokeWidth;\n const calloutColors = (_a = calloutLine.colors) != null ? _a : this.properties.strokes;\n const { offset: offset4 } = this.properties.calloutLabel;\n this.calloutLabelSelection.selectByTag(0 /* Callout */).forEach((line, index) => {\n var _a2;\n const datum = line.datum;\n const { calloutLabel: label, outerRadius } = datum;\n if ((label == null ? void 0 : label.text) && !label.hidden && outerRadius !== 0) {\n line.visible = true;\n line.strokeWidth = calloutStrokeWidth;\n line.stroke = calloutColors[index % calloutColors.length];\n line.fill = void 0;\n const x1 = datum.midCos * outerRadius;\n const y1 = datum.midSin * outerRadius;\n let x2 = datum.midCos * (outerRadius + calloutLength);\n let y2 = datum.midSin * (outerRadius + calloutLength);\n const isMoved = (_a2 = label.collisionTextAlign) != null ? _a2 : label.collisionOffsetY !== 0;\n if (isMoved && label.box != null) {\n const box = label.box;\n let cx = x2;\n let cy = y2;\n if (x2 < box.x) {\n cx = box.x;\n } else if (x2 > box.x + box.width) {\n cx = box.x + box.width;\n }\n if (y2 < box.y) {\n cy = box.y;\n } else if (y2 > box.y + box.height) {\n cy = box.y + box.height;\n }\n const dx = cx - x2;\n const dy = cy - y2;\n const length = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));\n const paddedLength = length - offset4;\n if (paddedLength > 0) {\n x2 = x2 + dx * paddedLength / length;\n y2 = y2 + dy * paddedLength / length;\n }\n }\n line.x1 = x1;\n line.y1 = y1;\n line.x2 = x2;\n line.y2 = y2;\n } else {\n line.visible = false;\n }\n });\n }\n getLabelOverflow(text, box, seriesRect) {\n const seriesLeft = seriesRect.x - this.centerX;\n const seriesRight = seriesRect.x + seriesRect.width - this.centerX;\n const seriesTop = seriesRect.y - this.centerY;\n const seriesBottom = seriesRect.y + seriesRect.height - this.centerY;\n const errPx = 1;\n let visibleTextPart = 1;\n if (box.x + errPx < seriesLeft) {\n visibleTextPart = (box.x + box.width - seriesLeft) / box.width;\n } else if (box.x + box.width - errPx > seriesRight) {\n visibleTextPart = (seriesRight - box.x) / box.width;\n }\n const hasVerticalOverflow = box.y + errPx < seriesTop || box.y + box.height - errPx > seriesBottom;\n const textLength = visibleTextPart === 1 ? text.length : Math.floor(text.length * visibleTextPart) - 1;\n const hasSurroundingSeriesOverflow = this.bboxIntersectsSurroundingSeries(box);\n return { textLength, hasVerticalOverflow, hasSurroundingSeriesOverflow };\n }\n bboxIntersectsSurroundingSeries(box, dx = 0, dy = 0) {\n const { surroundingRadius } = this;\n if (surroundingRadius == null) {\n return false;\n }\n const corners = [\n { x: box.x + dx, y: box.y + dy },\n { x: box.x + box.width + dx, y: box.y + dy },\n { x: box.x + box.width + dx, y: box.y + box.height + dy },\n { x: box.x + dx, y: box.y + box.height + dy }\n ];\n const sur2 = __pow(surroundingRadius, 2);\n return corners.some((corner) => __pow(corner.x, 2) + __pow(corner.y, 2) > sur2);\n }\n computeCalloutLabelCollisionOffsets() {\n const { radiusScale } = this;\n const { calloutLabel, calloutLine } = this.properties;\n const { offset: offset4, minSpacing } = calloutLabel;\n const innerRadius = radiusScale.convert(0);\n const shouldSkip = (datum) => {\n const label = datum.calloutLabel;\n return !label || datum.outerRadius === 0;\n };\n const fullData = this.nodeData;\n const data = this.nodeData.filter((t) => !shouldSkip(t));\n data.forEach((datum) => {\n const label = datum.calloutLabel;\n if (label == null)\n return;\n label.hidden = false;\n label.collisionTextAlign = void 0;\n label.collisionOffsetY = 0;\n });\n if (data.length <= 1) {\n return;\n }\n const leftLabels = data.filter((d) => d.midCos < 0).sort((a, b) => a.midSin - b.midSin);\n const rightLabels = data.filter((d) => d.midCos >= 0).sort((a, b) => a.midSin - b.midSin);\n const topLabels = data.filter((d) => {\n var _a;\n return d.midSin < 0 && ((_a = d.calloutLabel) == null ? void 0 : _a.textAlign) === \"center\";\n }).sort((a, b) => a.midCos - b.midCos);\n const bottomLabels = data.filter((d) => {\n var _a;\n return d.midSin >= 0 && ((_a = d.calloutLabel) == null ? void 0 : _a.textAlign) === \"center\";\n }).sort((a, b) => a.midCos - b.midCos);\n const tempTextNode = new Text();\n const getTextBBox = (datum) => {\n var _a;\n const label = datum.calloutLabel;\n if (label == null)\n return new BBox(0, 0, 0, 0);\n const labelRadius = datum.outerRadius + calloutLine.length + offset4;\n const x = datum.midCos * labelRadius;\n const y = datum.midSin * labelRadius + label.collisionOffsetY;\n tempTextNode.text = label.text;\n tempTextNode.x = x;\n tempTextNode.y = y;\n tempTextNode.setFont(this.properties.calloutLabel);\n tempTextNode.setAlign({\n textAlign: (_a = label.collisionTextAlign) != null ? _a : label.textAlign,\n textBaseline: label.textBaseline\n });\n return tempTextNode.computeBBox();\n };\n const avoidNeighbourYCollision = (label, next, direction) => {\n const box = getTextBBox(label).grow(minSpacing / 2);\n const other = getTextBBox(next).grow(minSpacing / 2);\n const collidesOrBehind = box.x < other.x + other.width && box.x + box.width > other.x && (direction === \"to-top\" ? box.y < other.y + other.height : box.y + box.height > other.y);\n if (collidesOrBehind) {\n const dy = direction === \"to-top\" ? box.y - other.y - other.height : box.y + box.height - other.y;\n next.calloutLabel.collisionOffsetY = dy;\n }\n };\n const avoidYCollisions = (labels) => {\n const midLabel = labels.slice().sort((a, b) => Math.abs(a.midSin) - Math.abs(b.midSin))[0];\n const midIndex = labels.indexOf(midLabel);\n for (let i = midIndex - 1; i >= 0; i--) {\n const prev = labels[i + 1];\n const next = labels[i];\n avoidNeighbourYCollision(prev, next, \"to-top\");\n }\n for (let i = midIndex + 1; i < labels.length; i++) {\n const prev = labels[i - 1];\n const next = labels[i];\n avoidNeighbourYCollision(prev, next, \"to-bottom\");\n }\n };\n const avoidXCollisions = (labels) => {\n const labelsCollideLabelsByY = data.some((datum) => datum.calloutLabel.collisionOffsetY !== 0);\n const boxes = labels.map((label) => getTextBBox(label));\n const paddedBoxes = boxes.map((box) => box.clone().grow(minSpacing / 2));\n let labelsCollideLabelsByX = false;\n for (let i = 0; i < paddedBoxes.length && !labelsCollideLabelsByX; i++) {\n const box = paddedBoxes[i];\n for (let j = i + 1; j < labels.length; j++) {\n const other = paddedBoxes[j];\n if (box.collidesBBox(other)) {\n labelsCollideLabelsByX = true;\n break;\n }\n }\n }\n const sectors = fullData.map((datum) => {\n const { startAngle, endAngle, outerRadius } = datum;\n return { startAngle, endAngle, innerRadius, outerRadius };\n });\n const labelsCollideSectors = boxes.some((box) => {\n return sectors.some((sector) => boxCollidesSector(box, sector));\n });\n if (!labelsCollideLabelsByX && !labelsCollideLabelsByY && !labelsCollideSectors) {\n return;\n }\n labels.filter((d) => d.calloutLabel.textAlign === \"center\").forEach((d) => {\n const label = d.calloutLabel;\n if (d.midCos < 0) {\n label.collisionTextAlign = \"right\";\n } else if (d.midCos > 0) {\n label.collisionTextAlign = \"left\";\n } else {\n label.collisionTextAlign = \"center\";\n }\n });\n };\n avoidYCollisions(leftLabels);\n avoidYCollisions(rightLabels);\n avoidXCollisions(topLabels);\n avoidXCollisions(bottomLabels);\n }\n updateCalloutLabelNodes(seriesRect) {\n const { radiusScale } = this;\n const { calloutLabel, calloutLine } = this.properties;\n const calloutLength = calloutLine.length;\n const { offset: offset4, color } = calloutLabel;\n const tempTextNode = new Text();\n this.calloutLabelSelection.selectByTag(1 /* Label */).forEach((text) => {\n var _a;\n const { datum } = text;\n const label = datum.calloutLabel;\n const radius = radiusScale.convert(datum.radius);\n const outerRadius = Math.max(0, radius);\n if (!(label == null ? void 0 : label.text) || outerRadius === 0 || label.hidden) {\n text.visible = false;\n return;\n }\n const labelRadius = outerRadius + calloutLength + offset4;\n const x = datum.midCos * labelRadius;\n const y = datum.midSin * labelRadius + label.collisionOffsetY;\n const align = {\n textAlign: (_a = label.collisionTextAlign) != null ? _a : label.textAlign,\n textBaseline: label.textBaseline\n };\n tempTextNode.text = label.text;\n tempTextNode.x = x;\n tempTextNode.y = y;\n tempTextNode.setFont(this.properties.calloutLabel);\n tempTextNode.setAlign(align);\n const box = tempTextNode.computeBBox();\n let displayText = label.text;\n let visible = true;\n if (calloutLabel.avoidCollisions) {\n const { textLength, hasVerticalOverflow } = this.getLabelOverflow(label.text, box, seriesRect);\n displayText = label.text.length === textLength ? label.text : `${label.text.substring(0, textLength)}\\u2026`;\n visible = !hasVerticalOverflow;\n }\n text.text = displayText;\n text.x = x;\n text.y = y;\n text.setFont(this.properties.calloutLabel);\n text.setAlign(align);\n text.fill = color;\n text.visible = visible;\n });\n }\n computeLabelsBBox(options, seriesRect) {\n return __async(this, null, function* () {\n const { calloutLabel, calloutLine } = this.properties;\n const calloutLength = calloutLine.length;\n const { offset: offset4, maxCollisionOffset, minSpacing } = calloutLabel;\n if (!calloutLabel.avoidCollisions) {\n return null;\n }\n yield this.maybeRefreshNodeData();\n this.updateRadiusScale(false);\n this.computeCalloutLabelCollisionOffsets();\n const textBoxes = [];\n const text = new Text();\n let titleBox;\n const { title } = this.properties;\n if ((title == null ? void 0 : title.text) && title.enabled) {\n const dy = this.getTitleTranslationY();\n if (isFinite(dy)) {\n text.text = title.text;\n text.x = 0;\n text.y = dy;\n text.setFont(title);\n text.setAlign({\n textBaseline: \"bottom\",\n textAlign: \"center\"\n });\n titleBox = text.computeBBox();\n textBoxes.push(titleBox);\n }\n }\n this.nodeData.forEach((datum) => {\n var _a;\n const label = datum.calloutLabel;\n if (!label || datum.outerRadius === 0) {\n return null;\n }\n const labelRadius = datum.outerRadius + calloutLength + offset4;\n const x = datum.midCos * labelRadius;\n const y = datum.midSin * labelRadius + label.collisionOffsetY;\n text.text = label.text;\n text.x = x;\n text.y = y;\n text.setFont(this.properties.calloutLabel);\n text.setAlign({\n textAlign: (_a = label.collisionTextAlign) != null ? _a : label.textAlign,\n textBaseline: label.textBaseline\n });\n const box = text.computeBBox();\n label.box = box;\n if (Math.abs(label.collisionOffsetY) > maxCollisionOffset) {\n label.hidden = true;\n return;\n }\n if (titleBox) {\n const seriesTop = seriesRect.y - this.centerY;\n const titleCleanArea = new BBox(\n titleBox.x - minSpacing,\n seriesTop,\n titleBox.width + 2 * minSpacing,\n titleBox.y + titleBox.height + minSpacing - seriesTop\n );\n if (box.collidesBBox(titleCleanArea)) {\n label.hidden = true;\n return;\n }\n }\n if (options.hideWhenNecessary) {\n const { textLength, hasVerticalOverflow, hasSurroundingSeriesOverflow } = this.getLabelOverflow(\n label.text,\n box,\n seriesRect\n );\n const isTooShort = label.text.length > 2 && textLength < 2;\n if (hasVerticalOverflow || isTooShort || hasSurroundingSeriesOverflow) {\n label.hidden = true;\n return;\n }\n }\n label.hidden = false;\n textBoxes.push(box);\n });\n if (textBoxes.length === 0) {\n return null;\n }\n return BBox.merge(textBoxes);\n });\n }\n updateSectorLabelNodes() {\n const { radiusScale } = this;\n const innerRadius = radiusScale.convert(0);\n const { fontSize, fontStyle, fontWeight, fontFamily, positionOffset, positionRatio, color } = this.properties.sectorLabel;\n const isDonut = innerRadius > 0;\n const singleVisibleSector = this.seriesItemEnabled.filter(Boolean).length === 1;\n this.sectorLabelSelection.each((text, datum) => {\n const { sectorLabel, outerRadius } = datum;\n let isTextVisible = false;\n if (sectorLabel && outerRadius !== 0) {\n const labelRadius = innerRadius * (1 - positionRatio) + outerRadius * positionRatio + positionOffset;\n text.fill = color;\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.text = sectorLabel.text;\n const shouldPutTextInCenter = !isDonut && singleVisibleSector;\n if (shouldPutTextInCenter) {\n text.x = 0;\n text.y = 0;\n } else {\n text.x = datum.midCos * labelRadius;\n text.y = datum.midSin * labelRadius;\n }\n text.textAlign = \"center\";\n text.textBaseline = \"middle\";\n const bbox = text.computeBBox();\n const corners = [\n [bbox.x, bbox.y],\n [bbox.x + bbox.width, bbox.y],\n [bbox.x + bbox.width, bbox.y + bbox.height],\n [bbox.x, bbox.y + bbox.height]\n ];\n const { startAngle, endAngle } = datum;\n const sectorBounds = { startAngle, endAngle, innerRadius, outerRadius };\n if (corners.every(([x, y]) => isPointInSector(x, y, sectorBounds))) {\n isTextVisible = true;\n }\n }\n text.visible = isTextVisible;\n });\n }\n updateInnerLabelNodes() {\n const textBBoxes = [];\n const margins = [];\n this.innerLabelsSelection.each((text, datum) => {\n const { fontStyle, fontWeight, fontSize, fontFamily, color, margin = 2 } = datum;\n text.fontStyle = fontStyle;\n text.fontWeight = fontWeight;\n text.fontSize = fontSize;\n text.fontFamily = fontFamily;\n text.text = datum.text;\n text.x = 0;\n text.y = 0;\n text.fill = color;\n text.textAlign = \"center\";\n text.textBaseline = \"alphabetic\";\n textBBoxes.push(text.computeBBox());\n margins.push(margin);\n });\n const getMarginTop = (index) => index === 0 ? 0 : margins[index];\n const getMarginBottom = (index) => index === margins.length - 1 ? 0 : margins[index];\n const totalHeight = textBBoxes.reduce((sum2, bbox, i) => {\n return sum2 + bbox.height + getMarginTop(i) + getMarginBottom(i);\n }, 0);\n const totalWidth = Math.max(...textBBoxes.map((bbox) => bbox.width));\n const innerRadius = this.getInnerRadius();\n const labelRadius = Math.sqrt(Math.pow(totalWidth / 2, 2) + Math.pow(totalHeight / 2, 2));\n const labelsVisible = labelRadius <= (innerRadius > 0 ? innerRadius : this.getOuterRadius());\n const textBottoms = [];\n for (let i = 0, prev = -totalHeight / 2; i < textBBoxes.length; i++) {\n const bbox = textBBoxes[i];\n const bottom = bbox.height + prev + getMarginTop(i);\n textBottoms.push(bottom);\n prev = bottom + getMarginBottom(i);\n }\n this.innerLabelsSelection.each((text, _datum, index) => {\n text.y = textBottoms[index];\n text.visible = labelsVisible;\n });\n }\n updateZerosumRings() {\n this.zerosumOuterRing.size = this.getOuterRadius() * 2;\n this.zerosumInnerRing.size = this.getInnerRadius() * 2;\n }\n getDatumLegendName(nodeDatum) {\n const { angleKey, calloutLabelKey, sectorLabelKey, legendItemKey } = this.properties;\n const { sectorLabel, calloutLabel, legendItem } = nodeDatum;\n if (legendItemKey && legendItem !== void 0) {\n return legendItem.text;\n } else if (calloutLabelKey && calloutLabelKey !== angleKey && (calloutLabel == null ? void 0 : calloutLabel.text) !== void 0) {\n return calloutLabel.text;\n } else if (sectorLabelKey && sectorLabelKey !== angleKey && (sectorLabel == null ? void 0 : sectorLabel.text) !== void 0) {\n return sectorLabel.text;\n }\n }\n pickNodeClosestDatum(point) {\n return pickByMatchingAngle(this, point);\n }\n getTooltipHtml(nodeDatum) {\n var _a;\n if (!this.properties.isValid()) {\n return EMPTY_TOOLTIP_CONTENT;\n }\n const {\n datum,\n angleValue,\n sectorFormat: { fill: color },\n itemId\n } = nodeDatum;\n const title = sanitizeHtml((_a = this.properties.title) == null ? void 0 : _a.text);\n const content = isFiniteNumber(angleValue) ? toFixed(angleValue) : String(angleValue);\n const labelText = this.getDatumLegendName(nodeDatum);\n return this.properties.tooltip.toTooltipHtml(\n {\n title: title != null ? title : labelText,\n content: title && labelText ? `${labelText}: ${content}` : content,\n backgroundColor: color\n },\n {\n datum,\n itemId,\n title,\n color,\n seriesId: this.id,\n angleKey: this.properties.angleKey,\n angleName: this.properties.angleName,\n radiusKey: this.properties.radiusKey,\n radiusName: this.properties.radiusName,\n calloutLabelKey: this.properties.calloutLabelKey,\n calloutLabelName: this.properties.calloutLabelName,\n sectorLabelKey: this.properties.sectorLabelKey,\n sectorLabelName: this.properties.sectorLabelName,\n legendItemKey: this.properties.legendItemKey\n }\n );\n }\n getLegendData(legendType) {\n var _a, _b, _c, _d, _e;\n const { visible, processedData, dataModel } = this;\n if (!dataModel || !(processedData == null ? void 0 : processedData.data.length) || legendType !== \"category\") {\n return [];\n }\n const { angleKey, calloutLabelKey, sectorLabelKey, legendItemKey } = this.properties;\n if (!legendItemKey && (!calloutLabelKey || calloutLabelKey === angleKey) && (!sectorLabelKey || sectorLabelKey === angleKey)) {\n return [];\n }\n const { calloutLabelIdx, sectorLabelIdx, legendItemIdx } = this.getProcessedDataIndexes(dataModel);\n const titleText = ((_a = this.properties.title) == null ? void 0 : _a.showInLegend) && this.properties.title.text;\n const legendData = [];\n for (let index = 0; index < processedData.data.length; index++) {\n const { datum, values } = processedData.data[index];\n const labelParts = [];\n if (titleText) {\n labelParts.push(titleText);\n }\n const labels = this.getLabels(\n datum,\n 2 * Math.PI,\n 2 * Math.PI,\n false,\n values[calloutLabelIdx],\n values[sectorLabelIdx],\n values[legendItemIdx]\n );\n if (legendItemKey && labels.legendItem !== void 0) {\n labelParts.push(labels.legendItem.text);\n } else if (calloutLabelKey && calloutLabelKey !== angleKey && ((_b = labels.calloutLabel) == null ? void 0 : _b.text) !== void 0) {\n labelParts.push((_c = labels.calloutLabel) == null ? void 0 : _c.text);\n } else if (sectorLabelKey && sectorLabelKey !== angleKey && ((_d = labels.sectorLabel) == null ? void 0 : _d.text) !== void 0) {\n labelParts.push((_e = labels.sectorLabel) == null ? void 0 : _e.text);\n }\n if (labelParts.length === 0)\n continue;\n const sectorFormat = this.getSectorFormat(datum, index, false);\n legendData.push({\n legendType: \"category\",\n id: this.id,\n itemId: index,\n seriesId: this.id,\n enabled: visible && this.seriesItemEnabled[index],\n label: {\n text: labelParts.join(\" - \")\n },\n marker: {\n fill: sectorFormat.fill,\n stroke: sectorFormat.stroke,\n fillOpacity: this.properties.fillOpacity,\n strokeOpacity: this.properties.strokeOpacity,\n strokeWidth: this.properties.strokeWidth\n },\n legendItemName: legendItemKey != null ? datum[legendItemKey] : void 0\n });\n }\n return legendData;\n }\n onLegendItemClick(event) {\n const { enabled, itemId, series, legendItemName } = event;\n if (series.id === this.id) {\n this.toggleSeriesItem(itemId, enabled);\n } else if (legendItemName != null) {\n this.toggleOtherSeriesItems(legendItemName, enabled);\n }\n }\n toggleSeriesItem(itemId, enabled) {\n this.seriesItemEnabled[itemId] = enabled;\n this.nodeDataRefresh = true;\n }\n toggleOtherSeriesItems(legendItemName, enabled) {\n var _a;\n if (!this.properties.legendItemKey || !this.dataModel) {\n return;\n }\n const legendItemIdx = this.dataModel.resolveProcessedDataIndexById(this, `legendItemValue`);\n (_a = this.processedData) == null ? void 0 : _a.data.forEach(({ values }, datumItemId) => {\n if (values[legendItemIdx] === legendItemName) {\n this.toggleSeriesItem(datumItemId, enabled);\n }\n });\n }\n animateEmptyUpdateReady(_data) {\n const { animationManager } = this.ctx;\n const fns = preparePieSeriesAnimationFunctions(\n true,\n this.properties.rotation,\n this.radiusScale,\n this.previousRadiusScale\n );\n fromToMotion(this.id, \"nodes\", animationManager, [this.itemSelection, this.highlightSelection], fns.nodes);\n fromToMotion(this.id, `innerCircle`, animationManager, [this.innerCircleSelection], fns.innerCircle);\n seriesLabelFadeInAnimation(this, \"callout\", animationManager, this.calloutLabelSelection);\n seriesLabelFadeInAnimation(this, \"sector\", animationManager, this.sectorLabelSelection);\n seriesLabelFadeInAnimation(this, \"inner\", animationManager, this.innerLabelsSelection);\n this.previousRadiusScale.range = this.radiusScale.range;\n }\n animateWaitingUpdateReady() {\n var _a, _b, _c, _d, _e, _f;\n const { itemSelection, highlightSelection, processedData, radiusScale, previousRadiusScale } = this;\n const { animationManager } = this.ctx;\n const dataDiff = (_a = processedData == null ? void 0 : processedData.reduced) == null ? void 0 : _a.diff;\n this.ctx.animationManager.stopByAnimationGroupId(this.id);\n const supportedDiff = ((_b = dataDiff == null ? void 0 : dataDiff.moved.size) != null ? _b : 0) === 0;\n const hasKeys = ((_c = processedData == null ? void 0 : processedData.defs.keys.length) != null ? _c : 0) > 0;\n const hasUniqueKeys = (_f = (_e = (_d = processedData == null ? void 0 : processedData.reduced) == null ? void 0 : _d.animationValidation) == null ? void 0 : _e.uniqueKeys) != null ? _f : true;\n if (!supportedDiff || !hasKeys || !hasUniqueKeys) {\n this.ctx.animationManager.skipCurrentBatch();\n }\n const fns = preparePieSeriesAnimationFunctions(\n false,\n this.properties.rotation,\n radiusScale,\n previousRadiusScale\n );\n fromToMotion(\n this.id,\n \"nodes\",\n animationManager,\n [itemSelection, highlightSelection],\n fns.nodes,\n (_, datum) => this.getDatumId(datum),\n dataDiff\n );\n fromToMotion(this.id, `innerCircle`, animationManager, [this.innerCircleSelection], fns.innerCircle);\n seriesLabelFadeInAnimation(this, \"callout\", this.ctx.animationManager, this.calloutLabelSelection);\n seriesLabelFadeInAnimation(this, \"sector\", this.ctx.animationManager, this.sectorLabelSelection);\n seriesLabelFadeInAnimation(this, \"inner\", this.ctx.animationManager, this.innerLabelsSelection);\n this.previousRadiusScale.range = this.radiusScale.range;\n }\n animateClearingUpdateEmpty() {\n const { itemSelection, highlightSelection, radiusScale, previousRadiusScale } = this;\n const { animationManager } = this.ctx;\n const fns = preparePieSeriesAnimationFunctions(\n false,\n this.properties.rotation,\n radiusScale,\n previousRadiusScale\n );\n fromToMotion(this.id, \"nodes\", animationManager, [itemSelection, highlightSelection], fns.nodes);\n fromToMotion(this.id, `innerCircle`, animationManager, [this.innerCircleSelection], fns.innerCircle);\n seriesLabelFadeOutAnimation(this, \"callout\", this.ctx.animationManager, this.calloutLabelSelection);\n seriesLabelFadeOutAnimation(this, \"sector\", this.ctx.animationManager, this.sectorLabelSelection);\n seriesLabelFadeOutAnimation(this, \"inner\", this.ctx.animationManager, this.innerLabelsSelection);\n this.previousRadiusScale.range = this.radiusScale.range;\n }\n getDatumIdFromData(datum) {\n var _a, _b, _c;\n const { calloutLabelKey, sectorLabelKey, legendItemKey } = this.properties;\n if (!((_c = (_b = (_a = this.processedData) == null ? void 0 : _a.reduced) == null ? void 0 : _b.animationValidation) == null ? void 0 : _c.uniqueKeys)) {\n return;\n }\n if (legendItemKey) {\n return datum[legendItemKey];\n } else if (calloutLabelKey) {\n return datum[calloutLabelKey];\n } else if (sectorLabelKey) {\n return datum[sectorLabelKey];\n }\n }\n getDatumId(datum) {\n const { index } = datum;\n const datumId = this.getDatumIdFromData(datum.datum);\n return datumId != null ? String(datumId) : `${index}`;\n }\n onDataChange() {\n var _a;\n const { data, seriesItemEnabled } = this;\n this.seriesItemEnabled = (_a = data == null ? void 0 : data.map((_, index) => {\n var _a2;\n return (_a2 = seriesItemEnabled[index]) != null ? _a2 : true;\n })) != null ? _a : [];\n }\n computeFocusBounds(opts) {\n return computeSectorFocusBounds(this, opts);\n }\n};\nPieSeries.className = \"PieSeries\";\nPieSeries.type = \"pie\";\n\n// packages/ag-charts-community/src/chart/series/polar/pieSeriesModule.ts\nvar PieSeriesModule = {\n type: \"series\",\n optionsKey: \"series[]\",\n packageType: \"community\",\n chartTypes: [\"polar\"],\n identifier: \"pie\",\n instanceConstructor: PieSeries,\n themeTemplate: pieTheme,\n paletteFactory: piePaletteFactory\n};\n\n// packages/ag-charts-community/src/chart/toolbar/toolbarTypes.ts\nvar TOOLBAR_ALIGNMENTS = [\"start\", \"center\", \"end\"];\nvar TOOLBAR_GROUPS = [\"annotations\", \"ranges\", \"zoom\"];\nvar ToolbarPosition = /* @__PURE__ */ ((ToolbarPosition2) => {\n ToolbarPosition2[\"Top\"] = \"top\";\n ToolbarPosition2[\"Right\"] = \"right\";\n ToolbarPosition2[\"Bottom\"] = \"bottom\";\n ToolbarPosition2[\"Left\"] = \"left\";\n ToolbarPosition2[\"FloatingTop\"] = \"floating-top\";\n ToolbarPosition2[\"FloatingBottom\"] = \"floating-bottom\";\n return ToolbarPosition2;\n})(ToolbarPosition || {});\nvar TOOLBAR_POSITIONS = Object.values(ToolbarPosition);\n\n// packages/ag-charts-community/src/chart/toolbar/toolbarProperties.ts\nvar ToolbarGroupProperties = class extends BaseProperties {\n constructor(onChange, onButtonsChange) {\n super();\n this.onChange = onChange;\n this.onButtonsChange = onButtonsChange;\n this.align = \"start\";\n this.position = \"top\" /* Top */;\n }\n};\n__decorateClass([\n ObserveChanges((target) => {\n target.onChange(target.enabled);\n }),\n Validate(BOOLEAN)\n], ToolbarGroupProperties.prototype, \"enabled\", 2);\n__decorateClass([\n ObserveChanges((target) => {\n target.onChange(target.enabled);\n }),\n Validate(UNION([\"start\", \"center\", \"end\"]), { optional: true })\n], ToolbarGroupProperties.prototype, \"align\", 2);\n__decorateClass([\n ObserveChanges((target) => {\n target.onChange(target.enabled);\n }),\n Validate(UNION([\"top\", \"right\", \"bottom\", \"left\", \"floating-top\", \"floating-bottom\"]), { optional: true })\n], ToolbarGroupProperties.prototype, \"position\", 2);\n__decorateClass([\n ObserveChanges((target) => {\n target.onButtonsChange(target.buttons);\n }),\n Validate(ARRAY, { optional: true })\n], ToolbarGroupProperties.prototype, \"buttons\", 2);\n\n// packages/ag-charts-community/src/chart/toolbar/toolbarStyles.ts\nvar block2 = \"ag-charts-toolbar\";\nvar elements2 = {\n align: `${block2}__align`,\n button: `${block2}__button`,\n icon: `${block2}__icon`,\n label: `${block2}__label`\n};\nvar modifiers2 = {\n [\"top\" /* Top */]: `${block2}--top`,\n [\"right\" /* Right */]: `${block2}--right`,\n [\"bottom\" /* Bottom */]: `${block2}--bottom`,\n [\"left\" /* Left */]: `${block2}--left`,\n [\"floating-top\" /* FloatingTop */]: `${block2}--floating-top`,\n [\"floating-bottom\" /* FloatingBottom */]: `${block2}--floating-bottom`,\n hidden: `${block2}--hidden`,\n preventFlash: `${block2}--prevent-flash`,\n floatingHidden: `${block2}--floating-hidden`,\n align: {\n start: `${elements2.align}--start`,\n center: `${elements2.align}--center`,\n end: `${elements2.align}--end`\n },\n button: {\n hidden: `${elements2.button}--hidden`\n }\n};\nvar css2 = `\n.${block2} {\n align-items: center;\n background: var(--ag-charts-toolbar-background-color);\n border-bottom: var(--ag-charts-toolbar-border-critical);\n border-top: var(--ag-charts-toolbar-border-critical);\n border-left: var(--ag-charts-toolbar-border);\n border-right: var(--ag-charts-toolbar-border);\n display: flex;\n flex-wrap: nowrap;\n opacity: 1;\n position: absolute;\n transform: translateY(0);\n transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;\n}\n\n.${modifiers2.hidden},\n.${modifiers2.preventFlash} {\n visibility: hidden;\n}\n\n.${modifiers2.floatingHidden} {\n opacity: 0;\n transition: opacity 0.4s ease-in-out;\n}\n\n.${modifiers2[\"top\" /* Top */]},\n.${modifiers2[\"bottom\" /* Bottom */]} {\n flex-direction: row;\n height: var(--ag-charts-toolbar-size);\n padding: 0 var(--ag-charts-toolbar-padding);\n width: 100%;\n}\n\n.${modifiers2[\"left\" /* Left */]},\n.${modifiers2[\"right\" /* Right */]} {\n flex-direction: column;\n padding: var(--ag-charts-toolbar-padding) 0;\n width: var(--ag-charts-toolbar-size);\n}\n\n.${modifiers2[\"floating-top\" /* FloatingTop */]},\n.${modifiers2[\"floating-bottom\" /* FloatingBottom */]} {\n background: none;\n border: none;\n flex-direction: row;\n height: var(--ag-charts-toolbar-size);\n overflow: hidden;\n padding: 0 var(--ag-charts-toolbar-padding);\n pointer-events: none;\n width: 100%;\n}\n\n.${elements2.align} {\n display: flex;\n flex-direction: inherit;\n flex-wrap: inherit;\n max-width: 100%;\n}\n\n.${modifiers2.align.center},\n.${modifiers2.align.end} {\n margin-left: auto;\n}\n\n.${modifiers2[\"left\" /* Left */]} .${modifiers2.align.center},\n.${modifiers2[\"left\" /* Left */]} .${modifiers2.align.end},\n.${modifiers2[\"right\" /* Right */]} .${modifiers2.align.center},\n.${modifiers2[\"right\" /* Right */]} .${modifiers2.align.end} {\n margin-left: 0;\n margin-top: auto;\n}\n\n.${modifiers2[\"floating-top\" /* FloatingTop */]} .${elements2.align},\n.${modifiers2[\"floating-bottom\" /* FloatingBottom */]} .${elements2.align} {\n gap: var(--ag-charts-toolbar-gap);\n transition: transform 0.4s ease-in-out;\n}\n\n.${elements2.button} {\n align-items: center;\n border-radius: var(--ag-charts-button-radius);\n color: var(--ag-charts-toolbar-foreground-color);\n display: flex;\n font-size: 14px;\n font-weight: 500;\n justify-content: center;\n margin: 0;\n padding: var(--ag-charts-button-padding);\n pointer-events: all;\n transition: background-color .25s ease-in-out;\n}\n\n.${modifiers2[\"left\" /* Left */]} .${elements2.button},\n.${modifiers2[\"right\" /* Right */]} .${elements2.button} {\n height: var(--ag-charts-toolbar-size);\n max-width: 100%;\n overflow: hidden;\n}\n\n.${modifiers2[\"floating-top\" /* FloatingTop */]} .${elements2.button},\n.${modifiers2[\"floating-bottom\" /* FloatingBottom */]} .${elements2.button} {\n background: var(--ag-charts-toolbar-background-color);\n border: var(--ag-charts-toolbar-border-critical);\n}\n\n.${modifiers2.button.hidden} {\n display: none;\n}\n\n.${elements2.button}:hover {\n background: var(--ag-charts-toolbar-hover-color);\n}\n\n.${elements2.button}:disabled {\n background: var(--ag-charts-toolbar-disabled-background-color);\n color: var(--ag-charts-toolbar-disabled-foreground-color);\n}\n\n.${elements2.button}:not([disabled]) {\n cursor: pointer;\n}\n\n.${elements2.icon} {\n height: 1.2em;\n width: 1.2em;\n}\n\n.${elements2.icon} + .${elements2.label} {\n margin-left: var(--ag-charts-size);\n}\n\n.${elements2.icon},\n.${elements2.label} {\n pointer-events: none;\n}\n\n`;\n\n// packages/ag-charts-community/src/chart/toolbar/toolbar.ts\nvar Toolbar = class extends BaseModuleInstance {\n constructor(ctx) {\n super();\n this.ctx = ctx;\n this.enabled = true;\n this.annotations = new ToolbarGroupProperties(\n this.onGroupChanged.bind(this, \"annotations\"),\n this.onGroupButtonsChanged.bind(this, \"annotations\")\n );\n this.ranges = new ToolbarGroupProperties(\n this.onGroupChanged.bind(this, \"ranges\"),\n this.onGroupButtonsChanged.bind(this, \"ranges\")\n );\n this.zoom = new ToolbarGroupProperties(\n this.onGroupChanged.bind(this, \"zoom\"),\n this.onGroupButtonsChanged.bind(this, \"zoom\")\n );\n this.margin = 10;\n this.floatingDetectionRange = 28;\n this.positions = {\n [\"top\" /* Top */]: /* @__PURE__ */ new Set(),\n [\"right\" /* Right */]: /* @__PURE__ */ new Set(),\n [\"bottom\" /* Bottom */]: /* @__PURE__ */ new Set(),\n [\"left\" /* Left */]: /* @__PURE__ */ new Set(),\n [\"floating-top\" /* FloatingTop */]: /* @__PURE__ */ new Set(),\n [\"floating-bottom\" /* FloatingBottom */]: /* @__PURE__ */ new Set()\n };\n this.positionAlignments = {\n [\"top\" /* Top */]: {},\n [\"right\" /* Right */]: {},\n [\"bottom\" /* Bottom */]: {},\n [\"left\" /* Left */]: {},\n [\"floating-top\" /* FloatingTop */]: {},\n [\"floating-bottom\" /* FloatingBottom */]: {}\n };\n this.groupCallers = {\n annotations: 0,\n ranges: 0,\n zoom: 0\n };\n this.groupButtons = {\n annotations: [],\n ranges: [],\n zoom: []\n };\n this.pendingButtonToggledEvents = [];\n this.groupProxied = /* @__PURE__ */ new Set();\n this.container = ctx.toolbarManager.element;\n this.elements = {\n [\"top\" /* Top */]: this.container.appendChild(createElement(\"div\")),\n [\"right\" /* Right */]: this.container.appendChild(createElement(\"div\")),\n [\"bottom\" /* Bottom */]: this.container.appendChild(createElement(\"div\")),\n [\"left\" /* Left */]: this.container.appendChild(createElement(\"div\")),\n [\"floating-top\" /* FloatingTop */]: this.container.appendChild(createElement(\"div\")),\n [\"floating-bottom\" /* FloatingBottom */]: this.container.appendChild(createElement(\"div\"))\n };\n injectStyle(css2, block2);\n this.renderToolbar(\"top\" /* Top */);\n this.renderToolbar(\"right\" /* Right */);\n this.renderToolbar(\"bottom\" /* Bottom */);\n this.renderToolbar(\"left\" /* Left */);\n this.renderToolbar(\"floating-top\" /* FloatingTop */);\n this.renderToolbar(\"floating-bottom\" /* FloatingBottom */);\n this.toggleVisibilities();\n this.destroyFns.push(\n ctx.interactionManager.addListener(\"hover\", this.onHover.bind(this), 31 /* All */),\n ctx.interactionManager.addListener(\"leave\", this.onLeave.bind(this), 31 /* All */),\n ctx.toolbarManager.addListener(\"button-toggled\", this.onButtonToggled.bind(this)),\n ctx.toolbarManager.addListener(\"group-toggled\", this.onGroupToggled.bind(this)),\n ctx.toolbarManager.addListener(\"proxy-group-options\", this.onProxyGroupOptions.bind(this)),\n ctx.layoutService.addListener(\"layout-complete\", this.onLayoutComplete.bind(this)),\n () => this.destroyElements()\n );\n }\n destroyElements() {\n for (const element2 of Object.values(this.elements)) {\n element2.remove();\n }\n }\n onHover(event) {\n const {\n enabled,\n elements: elements3,\n floatingDetectionRange,\n ctx: { scene }\n } = this;\n const {\n offsetY,\n sourceEvent: { target }\n } = event;\n const { FloatingBottom, FloatingTop } = ToolbarPosition;\n if (!enabled)\n return;\n const bottom = elements3[FloatingBottom];\n const top = elements3[FloatingTop];\n const bottomDetectionY = bottom.offsetTop - floatingDetectionRange;\n const bottomVisible = offsetY > bottomDetectionY && offsetY < scene.canvas.element.offsetHeight || target === bottom;\n const topDetectionY = top.offsetTop + top.offsetHeight + floatingDetectionRange;\n const topVisible = offsetY > 0 && offsetY < topDetectionY || target === top;\n bottom.classList.toggle(modifiers2.floatingHidden, !bottomVisible);\n top.classList.toggle(modifiers2.floatingHidden, !topVisible);\n this.translateFloatingElements(FloatingBottom, bottomVisible);\n this.translateFloatingElements(FloatingTop, topVisible);\n }\n onLeave(event) {\n const {\n enabled,\n elements: elements3,\n ctx: { scene }\n } = this;\n const { relatedTarget, target } = event.sourceEvent;\n const { FloatingBottom, FloatingTop } = ToolbarPosition;\n if (!enabled || target !== scene.canvas.element)\n return;\n const isTargetButton = TOOLBAR_GROUPS.some(\n (group2) => this.groupButtons[group2].some((button) => button === relatedTarget)\n );\n if (isTargetButton)\n return;\n elements3[FloatingBottom].classList.add(modifiers2.floatingHidden);\n elements3[FloatingTop].classList.add(modifiers2.floatingHidden);\n this.translateFloatingElements(FloatingBottom, false);\n this.translateFloatingElements(FloatingTop, false);\n }\n onGroupChanged(group2) {\n if (this[group2] == null || this.groupProxied.has(group2))\n return;\n this.createGroup(group2);\n this.toggleVisibilities();\n }\n onGroupButtonsChanged(group2, buttons) {\n if (!this.enabled || this.groupProxied.has(group2))\n return;\n this.createGroupButtons(group2, buttons);\n this.toggleVisibilities();\n }\n onLayoutComplete() {\n for (const position of TOOLBAR_POSITIONS) {\n this.elements[position].classList.remove(modifiers2.preventFlash);\n }\n }\n onButtonToggled(event) {\n const { group: group2, value, enabled } = event;\n if (this.groupButtons[group2].length === 0) {\n this.pendingButtonToggledEvents.push(event);\n return;\n }\n for (const button of this.groupButtons[group2]) {\n if (button.dataset.toolbarValue !== `${value}`)\n continue;\n button.disabled = !enabled;\n }\n }\n onGroupToggled(event) {\n const { group: group2, visible } = event;\n this.toggleGroup(group2, visible);\n this.toggleVisibilities();\n }\n onProxyGroupOptions(event) {\n const { group: group2, options } = event;\n this.groupProxied.add(group2);\n this.createGroup(group2, options.enabled, options.position);\n this.createGroupButtons(group2, options.buttons);\n this.toggleGroup(group2, options.enabled);\n this[group2].set(options);\n }\n createGroup(group2, enabled, position) {\n enabled != null ? enabled : enabled = this[group2].enabled;\n position != null ? position : position = this[group2].position;\n for (const pos of TOOLBAR_POSITIONS) {\n if (enabled && position === pos) {\n this.positions[pos].add(group2);\n } else {\n this.positions[pos].delete(group2);\n }\n }\n }\n createGroupButtons(group2, buttons) {\n var _a, _b;\n for (const button of this.groupButtons[group2]) {\n button.remove();\n }\n this.groupButtons[group2] = [];\n const align = (_a = this[group2].align) != null ? _a : \"start\";\n const position = (_b = this[group2].position) != null ? _b : \"top\";\n const parent = this.positionAlignments[position][align];\n for (const options of buttons != null ? buttons : []) {\n const button = this.createButtonElement(group2, options);\n parent == null ? void 0 : parent.appendChild(button);\n this.groupButtons[group2].push(button);\n }\n }\n toggleGroup(group2, enabled) {\n if (enabled) {\n this.groupCallers[group2] += 1;\n } else {\n this.groupCallers[group2] = Math.max(0, this.groupCallers[group2] - 1);\n }\n }\n processPendingEvents() {\n var _a;\n const pendingButtonToggledEvents = ((_a = this.pendingButtonToggledEvents) != null ? _a : []).slice();\n for (const event of pendingButtonToggledEvents) {\n this.onButtonToggled(event);\n }\n this.pendingButtonToggledEvents = [];\n }\n performLayout(_0) {\n return __async(this, arguments, function* ({ shrinkRect }) {\n const { elements: elements3, margin } = this;\n if (!elements3.top.classList.contains(modifiers2.hidden)) {\n shrinkRect.shrink(elements3.top.offsetHeight + margin * 2, \"top\");\n }\n if (!elements3.right.classList.contains(modifiers2.hidden)) {\n shrinkRect.shrink(elements3.right.offsetWidth + margin, \"right\");\n }\n if (!elements3.bottom.classList.contains(modifiers2.hidden)) {\n shrinkRect.shrink(elements3.bottom.offsetHeight + margin * 2, \"bottom\");\n }\n if (!elements3.left.classList.contains(modifiers2.hidden)) {\n shrinkRect.shrink(elements3.left.offsetWidth + margin, \"left\");\n }\n return { shrinkRect };\n });\n }\n performCartesianLayout(opts) {\n return __async(this, null, function* () {\n const { elements: elements3, margin } = this;\n const { seriesRect } = opts;\n const { FloatingBottom, FloatingTop } = ToolbarPosition;\n elements3.top.style.top = `${seriesRect.y - elements3.top.offsetHeight - margin * 2}px`;\n elements3.top.style.left = `${margin}px`;\n elements3.top.style.width = `calc(100% - ${margin * 2}px)`;\n elements3.right.style.top = `${seriesRect.y + margin}px`;\n elements3.right.style.right = `${margin}px`;\n elements3.right.style.height = `calc(100% - ${seriesRect.y + margin * 2}px)`;\n elements3.bottom.style.bottom = `${margin}px`;\n elements3.bottom.style.left = `${margin}px`;\n elements3.bottom.style.width = `calc(100% - ${margin * 2}px)`;\n elements3.left.style.top = `${seriesRect.y}px`;\n elements3.left.style.left = `${margin}px`;\n elements3.left.style.height = `calc(100% - ${seriesRect.y + margin * 2}px)`;\n elements3[FloatingTop].style.top = `${seriesRect.y}px`;\n elements3[FloatingTop].style.paddingTop = `${margin}px`;\n elements3[FloatingBottom].style.top = `${seriesRect.y + seriesRect.height - elements3[FloatingBottom].offsetHeight}px`;\n elements3[FloatingBottom].style.paddingBottom = `${margin}px`;\n });\n }\n toggleVisibilities() {\n var _a;\n if (this.elements == null)\n return;\n const isGroupVisible = (group2) => this[group2].enabled && this.groupCallers[group2] > 0;\n const isButtonVisible = (element2) => (button) => typeof button.value !== \"string\" && typeof button.value !== \"number\" || `${button.value}` === element2.dataset.toolbarValue;\n for (const position of TOOLBAR_POSITIONS) {\n const visible = this.enabled && Array.from(this.positions[position].values()).some(isGroupVisible);\n this.elements[position].classList.toggle(modifiers2.hidden, !visible);\n }\n for (const group2 of TOOLBAR_GROUPS) {\n if (this[group2] == null)\n continue;\n const visible = isGroupVisible(group2);\n for (const button of this.groupButtons[group2]) {\n const buttonVisible = visible && ((_a = this[group2].buttons) == null ? void 0 : _a.some(isButtonVisible(button)));\n button.classList.toggle(modifiers2.button.hidden, !buttonVisible);\n }\n }\n }\n translateFloatingElements(position, visible) {\n const { elements: elements3, margin, positionAlignments } = this;\n const element2 = elements3[position];\n const alignments = Object.values(positionAlignments[position]);\n for (const align of alignments) {\n align.style.transform = visible && align.style.transform !== \"\" ? \"translateY(0)\" : `translateY(${element2.offsetHeight + margin}px)`;\n }\n }\n renderToolbar(position = \"top\" /* Top */) {\n const element2 = this.elements[position];\n element2.classList.add(block2, modifiers2[position], modifiers2.preventFlash);\n if (position === \"floating-top\" /* FloatingTop */ || position === \"floating-bottom\" /* FloatingBottom */) {\n element2.classList.add(modifiers2.floatingHidden);\n }\n for (const align of TOOLBAR_ALIGNMENTS) {\n const alignmentElement = createElement(\"div\");\n alignmentElement.classList.add(elements2.align, modifiers2.align[align]);\n element2.appendChild(alignmentElement);\n this.positionAlignments[position][align] = alignmentElement;\n }\n }\n createButtonElement(group2, options) {\n const button = createElement(\"button\");\n button.classList.add(elements2.button);\n button.dataset.toolbarGroup = group2;\n button.tabIndex = -1;\n if (typeof options.value === \"string\" || typeof options.value === \"number\") {\n button.dataset.toolbarValue = `${options.value}`;\n }\n if (options.tooltip) {\n button.title = options.tooltip;\n }\n let inner = \"\";\n if (options.icon != null) {\n inner = ``;\n }\n if (options.label != null) {\n inner = `${inner}${options.label}`;\n }\n button.innerHTML = inner;\n button.onclick = this.onButtonPress.bind(this, group2, options.value);\n this.destroyFns.push(() => button.remove());\n return button;\n }\n onButtonPress(group2, value) {\n this.ctx.toolbarManager.pressButton(group2, value);\n }\n};\n__decorateClass([\n ObserveChanges((target) => {\n target.processPendingEvents();\n target.toggleVisibilities();\n }),\n Validate(BOOLEAN)\n], Toolbar.prototype, \"enabled\", 2);\n\n// packages/ag-charts-community/src/chart/toolbar/toolbarModule.ts\nvar DAY = 1e3 * 60 * 60 * 24;\nvar MONTH = DAY * 30;\nvar YEAR = DAY * 365;\nvar annotations = {\n enabled: false,\n position: \"left\",\n align: \"start\",\n buttons: [\n { label: \"Li\", value: \"line\" },\n { label: \"PCh\", value: \"parallel-channel\" }\n ]\n};\nvar ranges = {\n enabled: false,\n position: \"top\",\n align: \"start\",\n buttons: [\n { label: \"1m\", value: MONTH },\n { label: \"3m\", value: 3 * MONTH },\n { label: \"6m\", value: 6 * MONTH },\n { label: \"YTD\", value: (_start, end) => [(/* @__PURE__ */ new Date(`${new Date(end).getFullYear()}-01-01`)).getTime(), end] },\n { label: \"1y\", value: YEAR },\n { label: \"All\", value: (start, end) => [start, end] }\n ]\n};\nvar zoom = {\n enabled: false,\n position: \"top\",\n align: \"end\",\n buttons: [\n {\n icon: \"zoom-out\",\n tooltip: \"Zoom out\",\n value: \"zoom-out\"\n },\n {\n icon: \"zoom-in\",\n tooltip: \"Zoom in\",\n value: \"zoom-in\"\n },\n {\n icon: \"pan-left\",\n tooltip: \"Pan left\",\n value: \"pan-left\"\n },\n {\n icon: \"pan-right\",\n tooltip: \"Pan right\",\n value: \"pan-right\"\n },\n {\n icon: \"pan-start\",\n tooltip: \"Pan to the start\",\n value: \"pan-start\"\n },\n {\n icon: \"pan-end\",\n tooltip: \"Pan to the end\",\n value: \"pan-end\"\n },\n {\n icon: \"reset\",\n tooltip: \"Reset the zoom\",\n value: \"reset\"\n }\n ]\n};\nvar ToolbarModule = {\n type: \"root\",\n optionsKey: \"toolbar\",\n packageType: \"community\",\n chartTypes: [\"cartesian\"],\n instanceConstructor: Toolbar,\n themeTemplate: {\n toolbar: {\n enabled: true,\n annotations,\n ranges,\n zoom\n }\n }\n};\n\n// packages/ag-charts-community/src/chart/factory/registerInbuiltModules.ts\nfunction registerInbuiltModules() {\n moduleRegistry.register(\n BackgroundModule,\n CommunityLegendModule,\n NavigatorModule,\n ToolbarModule,\n AreaSeriesModule,\n BarSeriesModule,\n BubbleSeriesModule,\n LineSeriesModule,\n ScatterSeriesModule,\n DonutSeriesModule,\n PieSeriesModule,\n HistogramSeriesModule\n );\n for (const AxisConstructor of [NumberAxis, CategoryAxis, TimeAxis, GroupedCategoryAxis, LogAxis]) {\n axisRegistry.register(AxisConstructor.type, {\n instanceConstructor: AxisConstructor,\n hidden: AxisConstructor === GroupedCategoryAxis\n });\n }\n}\n\n// packages/ag-charts-community/src/chart/factory/setupModules.ts\nfunction setupModules() {\n for (const m of moduleRegistry.modules) {\n if (m.packageType === \"enterprise\" && !verifyIfModuleExpected(m)) {\n Logger.errorOnce(\"Unexpected enterprise module registered: \" + m.identifier);\n }\n if (m.type === \"root\" && m.themeTemplate) {\n for (const chartType2 of m.chartTypes) {\n chartDefaults.set(chartType2, m.themeTemplate);\n }\n }\n if (m.type === \"series\") {\n if (m.chartTypes.length > 1) {\n throw new Error(`AG Charts - Module definition error: ${m.identifier}`);\n }\n seriesRegistry.register(m.identifier, m);\n }\n if (m.type === \"series-option\" && m.themeTemplate) {\n for (const seriesType of m.seriesTypes) {\n seriesRegistry.setThemeTemplate(seriesType, m.themeTemplate);\n }\n }\n if (m.type === \"axis-option\" && m.themeTemplate) {\n for (const axisType of m.axisTypes) {\n const axisTypeTheme = m.themeTemplate[axisType];\n const theme = __spreadValues(__spreadValues({}, m.themeTemplate), axisTypeTheme);\n for (const innerAxisType of m.axisTypes) {\n delete theme[innerAxisType];\n }\n axisRegistry.setThemeTemplate(axisType, theme);\n }\n }\n if (m.type === \"axis\") {\n axisRegistry.register(m.identifier, m);\n }\n if (m.type === \"legend\") {\n legendRegistry.register(m.identifier, m);\n }\n }\n if (moduleRegistry.hasEnterpriseModules()) {\n const expectedButUnused = getUnusedExpectedModules();\n if (expectedButUnused.length > 0) {\n Logger.errorOnce(\"Enterprise modules expected but not registered: \", expectedButUnused);\n }\n }\n}\n\n// packages/ag-charts-community/src/chart/hierarchyChart.ts\nvar _HierarchyChart = class _HierarchyChart extends Chart {\n constructor(options, resources) {\n super(options, resources);\n }\n performLayout() {\n return __async(this, null, function* () {\n const shrinkRect = yield __superGet(_HierarchyChart.prototype, this, \"performLayout\").call(this);\n const {\n seriesArea: { padding },\n seriesRoot,\n annotationRoot,\n highlightRoot\n } = this;\n const fullSeriesRect = shrinkRect.clone();\n shrinkRect.shrink(padding.left, \"left\");\n shrinkRect.shrink(padding.top, \"top\");\n shrinkRect.shrink(padding.right, \"right\");\n shrinkRect.shrink(padding.bottom, \"bottom\");\n this.seriesRect = shrinkRect;\n this.animationRect = shrinkRect;\n this.hoverRect = shrinkRect;\n for (const group2 of [seriesRoot, annotationRoot, highlightRoot]) {\n group2.translationX = Math.floor(shrinkRect.x);\n group2.translationY = Math.floor(shrinkRect.y);\n }\n yield Promise.all(\n this.series.map((series) => __async(this, null, function* () {\n yield series.update({ seriesRect: shrinkRect });\n }))\n );\n seriesRoot.visible = this.series[0].visible;\n seriesRoot.setClipRectInGroupCoordinateSpace(\n new BBox(shrinkRect.x, shrinkRect.y, shrinkRect.width, shrinkRect.height)\n );\n this.ctx.layoutService.dispatchLayoutComplete({\n type: \"layout-complete\",\n chart: { width: this.ctx.scene.width, height: this.ctx.scene.height },\n clipSeries: false,\n series: { rect: fullSeriesRect, paddedRect: shrinkRect, visible: true },\n axes: []\n });\n return shrinkRect;\n });\n }\n};\n_HierarchyChart.className = \"HierarchyChart\";\n_HierarchyChart.type = \"hierarchy\";\nvar HierarchyChart = _HierarchyChart;\n\n// packages/ag-charts-community/src/chart/axis/polarAxis.ts\nvar PolarAxis = class extends Axis {\n constructor() {\n super(...arguments);\n this.shape = \"polygon\";\n this.innerRadiusRatio = 0;\n this.defaultTickMinSpacing = 20;\n }\n computeLabelsBBox(_options, _seriesRect) {\n return null;\n }\n};\n__decorateClass([\n Validate(UNION([\"polygon\", \"circle\"], \"a polar axis shape\"))\n], PolarAxis.prototype, \"shape\", 2);\n__decorateClass([\n Validate(RATIO)\n], PolarAxis.prototype, \"innerRadiusRatio\", 2);\n\n// packages/ag-charts-community/src/chart/polarChart.ts\nvar _PolarChart = class _PolarChart extends Chart {\n constructor(options, resources) {\n super(options, resources);\n this.padding = new Padding(40);\n this.axisGroup.zIndex = 6 /* AXIS_FOREGROUND_ZINDEX */;\n }\n performLayout() {\n return __async(this, null, function* () {\n const shrinkRect = yield __superGet(_PolarChart.prototype, this, \"performLayout\").call(this);\n const fullSeriesRect = shrinkRect.clone();\n this.computeSeriesRect(shrinkRect);\n yield this.computeCircle(shrinkRect);\n this.axes.forEach((axis) => axis.update());\n this.hoverRect = shrinkRect;\n this.ctx.layoutService.dispatchLayoutComplete({\n type: \"layout-complete\",\n chart: { width: this.ctx.scene.width, height: this.ctx.scene.height },\n clipSeries: false,\n series: { rect: fullSeriesRect, paddedRect: shrinkRect, visible: true },\n axes: []\n });\n return shrinkRect;\n });\n }\n updateAxes(cx, cy, radius) {\n var _a, _b;\n const angleAxis = this.axes.find((axis) => axis.direction === \"x\" /* X */);\n const radiusAxis = this.axes.find((axis) => axis.direction === \"y\" /* Y */);\n if (!(angleAxis instanceof PolarAxis) || !(radiusAxis instanceof PolarAxis)) {\n return;\n }\n const angleScale = angleAxis.scale;\n const angles = (_a = angleScale.ticks) == null ? void 0 : _a.call(angleScale).map((value) => angleScale.convert(value));\n const innerRadiusRatio = radiusAxis.innerRadiusRatio;\n angleAxis.innerRadiusRatio = innerRadiusRatio;\n (_b = angleAxis.computeRange) == null ? void 0 : _b.call(angleAxis);\n angleAxis.gridLength = radius;\n radiusAxis.gridAngles = angles;\n radiusAxis.gridRange = angleAxis.range;\n radiusAxis.range = [radius, radius * innerRadiusRatio];\n [angleAxis, radiusAxis].forEach((axis) => {\n axis.translation.x = cx;\n axis.translation.y = cy;\n axis.calculateLayout();\n });\n }\n computeSeriesRect(shrinkRect) {\n const {\n seriesArea: { padding }\n } = this;\n shrinkRect.shrink(padding.left, \"left\");\n shrinkRect.shrink(padding.top, \"top\");\n shrinkRect.shrink(padding.right, \"right\");\n shrinkRect.shrink(padding.bottom, \"bottom\");\n this.seriesRect = shrinkRect;\n this.animationRect = shrinkRect;\n }\n computeCircle(seriesBox) {\n return __async(this, null, function* () {\n const polarSeries = this.series.filter((series) => {\n return series instanceof PolarSeries;\n });\n const polarAxes = this.axes.filter((axis) => {\n return axis instanceof PolarAxis;\n });\n const setSeriesCircle = (cx, cy, r) => {\n this.updateAxes(cx, cy, r);\n polarSeries.forEach((series) => {\n series.centerX = cx;\n series.centerY = cy;\n series.radius = r;\n });\n const pieSeries = polarSeries.filter((s) => {\n return s instanceof PieSeries || s instanceof DonutSeries;\n });\n if (pieSeries.length > 1) {\n const innerRadii = pieSeries.map((series) => {\n const innerRadius = series.getInnerRadius();\n return { series, innerRadius };\n }).sort((a, b) => a.innerRadius - b.innerRadius);\n innerRadii.at(-1).series.surroundingRadius = void 0;\n for (let i = 0; i < innerRadii.length - 1; i++) {\n innerRadii[i].series.surroundingRadius = innerRadii[i + 1].innerRadius;\n }\n }\n };\n const centerX = seriesBox.x + seriesBox.width / 2;\n const centerY = seriesBox.y + seriesBox.height / 2;\n const initialRadius = Math.max(0, Math.min(seriesBox.width, seriesBox.height) / 2);\n let radius = initialRadius;\n setSeriesCircle(centerX, centerY, radius);\n const shake = (..._0) => __async(this, [..._0], function* ({ hideWhenNecessary = false } = {}) {\n const labelBoxes = [];\n for (const series of [...polarAxes, ...polarSeries]) {\n const box = yield series.computeLabelsBBox({ hideWhenNecessary }, seriesBox);\n if (box) {\n labelBoxes.push(box);\n }\n }\n if (labelBoxes.length === 0) {\n setSeriesCircle(centerX, centerY, initialRadius);\n return;\n }\n const labelBox = BBox.merge(labelBoxes);\n const refined = this.refineCircle(labelBox, radius, seriesBox);\n setSeriesCircle(refined.centerX, refined.centerY, refined.radius);\n if (refined.radius === radius) {\n return;\n }\n radius = refined.radius;\n });\n yield shake();\n yield shake();\n yield shake();\n yield shake({ hideWhenNecessary: true });\n yield shake({ hideWhenNecessary: true });\n return { radius, centerX, centerY };\n });\n }\n refineCircle(labelsBox, radius, seriesBox) {\n const minCircleRatio = 0.5;\n const circleLeft = -radius;\n const circleTop = -radius;\n const circleRight = radius;\n const circleBottom = radius;\n let padLeft = Math.max(0, circleLeft - labelsBox.x);\n let padTop = Math.max(0, circleTop - labelsBox.y);\n let padRight = Math.max(0, labelsBox.x + labelsBox.width - circleRight);\n let padBottom = Math.max(0, labelsBox.y + labelsBox.height - circleBottom);\n padLeft = padRight = Math.max(padLeft, padRight);\n padTop = padBottom = Math.max(padTop, padBottom);\n const availCircleWidth = seriesBox.width - padLeft - padRight;\n const availCircleHeight = seriesBox.height - padTop - padBottom;\n let newRadius = Math.min(availCircleWidth, availCircleHeight) / 2;\n const minHorizontalRadius = minCircleRatio * seriesBox.width / 2;\n const minVerticalRadius = minCircleRatio * seriesBox.height / 2;\n const minRadius = Math.min(minHorizontalRadius, minVerticalRadius);\n if (newRadius < minRadius) {\n newRadius = minRadius;\n const horizontalPadding = padLeft + padRight;\n const verticalPadding = padTop + padBottom;\n if (2 * newRadius + verticalPadding > seriesBox.height) {\n const padHeight = seriesBox.height - 2 * newRadius;\n if (Math.min(padTop, padBottom) * 2 > padHeight) {\n padTop = padHeight / 2;\n padBottom = padHeight / 2;\n } else if (padTop > padBottom) {\n padTop = padHeight - padBottom;\n } else {\n padBottom = padHeight - padTop;\n }\n }\n if (2 * newRadius + horizontalPadding > seriesBox.width) {\n const padWidth = seriesBox.width - 2 * newRadius;\n if (Math.min(padLeft, padRight) * 2 > padWidth) {\n padLeft = padWidth / 2;\n padRight = padWidth / 2;\n } else if (padLeft > padRight) {\n padLeft = padWidth - padRight;\n } else {\n padRight = padWidth - padLeft;\n }\n }\n }\n const newWidth = padLeft + 2 * newRadius + padRight;\n const newHeight = padTop + 2 * newRadius + padBottom;\n return {\n centerX: seriesBox.x + (seriesBox.width - newWidth) / 2 + padLeft + newRadius,\n centerY: seriesBox.y + (seriesBox.height - newHeight) / 2 + padTop + newRadius,\n radius: newRadius\n };\n }\n};\n_PolarChart.className = \"PolarChart\";\n_PolarChart.type = \"polar\";\nvar PolarChart = _PolarChart;\n\n// packages/ag-charts-community/src/chart/series/topology/mercatorScale.ts\nvar radsInDeg = Math.PI / 180;\nvar lonX = (lon) => lon * radsInDeg;\nvar latY = (lat) => -Math.log(Math.tan(Math.PI * 0.25 + lat * radsInDeg * 0.5));\nvar xLon = (x) => x / radsInDeg;\nvar yLat = (y) => (Math.atan(Math.exp(-y)) - Math.PI * 0.25) / (radsInDeg * 0.5);\nvar MercatorScale = class _MercatorScale {\n constructor(domain, range3) {\n this.domain = domain;\n this.range = range3;\n this.type = \"mercator\";\n this.bounds = _MercatorScale.bounds(domain);\n }\n static bounds(domain) {\n const [[lon0, lat0], [lon1, lat1]] = domain;\n const x0 = lonX(lon0);\n const y0 = latY(lat0);\n const x1 = lonX(lon1);\n const y1 = latY(lat1);\n return new BBox(Math.min(x0, x1), Math.min(y0, y1), Math.abs(x1 - x0), Math.abs(y1 - y0));\n }\n static fixedScale() {\n return new _MercatorScale(\n [\n [xLon(0), yLat(0)],\n [xLon(1), yLat(1)]\n ],\n [\n [0, 0],\n [1, 1]\n ]\n );\n }\n convert([lon, lat]) {\n const [[x0, y0], [x1, y1]] = this.range;\n const xScale = (x1 - x0) / this.bounds.width;\n const yScale = (y1 - y0) / this.bounds.height;\n return [(lonX(lon) - this.bounds.x) * xScale + x0, (latY(lat) - this.bounds.y) * yScale + y0];\n }\n invert([x, y]) {\n const [[x0, y0], [x1, y1]] = this.range;\n const xScale = (x1 - x0) / this.bounds.width;\n const yScale = (y1 - y0) / this.bounds.height;\n return [xLon((x - x0) / xScale + this.bounds.x), yLat((y - y0) / yScale + this.bounds.y)];\n }\n};\n\n// packages/ag-charts-community/src/chart/topologyChart.ts\nfunction isTopologySeries(series) {\n return series.type === \"map-shape\" || series.type === \"map-line\" || series.type === \"map-marker\" || series.type === \"map-shape-background\" || series.type === \"map-line-background\";\n}\nvar _TopologyChart = class _TopologyChart extends Chart {\n constructor(options, resources) {\n super(options, resources);\n this.xAxis = new NumberAxis(this.getModuleContext());\n this.xAxis.position = \"bottom\";\n this.yAxis = new NumberAxis(this.getModuleContext());\n this.yAxis.position = \"left\";\n this.ctx.zoomManager.updateAxes([this.xAxis, this.yAxis]);\n }\n updateData() {\n return __async(this, null, function* () {\n yield __superGet(_TopologyChart.prototype, this, \"updateData\").call(this);\n const { topology } = this.getOptions();\n this.series.forEach((series) => {\n if (isTopologySeries(series)) {\n series.setChartTopology(topology);\n }\n });\n });\n }\n performLayout() {\n return __async(this, null, function* () {\n const shrinkRect = yield __superGet(_TopologyChart.prototype, this, \"performLayout\").call(this);\n const {\n seriesArea: { padding },\n seriesRoot,\n annotationRoot,\n highlightRoot\n } = this;\n const fullSeriesRect = shrinkRect.clone();\n shrinkRect.shrink(padding.left, \"left\");\n shrinkRect.shrink(padding.top, \"top\");\n shrinkRect.shrink(padding.right, \"right\");\n shrinkRect.shrink(padding.bottom, \"bottom\");\n this.seriesRect = shrinkRect;\n this.animationRect = shrinkRect;\n this.hoverRect = shrinkRect;\n const mapSeries = this.series.filter(isTopologySeries);\n const combinedBbox = mapSeries.reduce((combined, series) => {\n if (!series.visible)\n return combined;\n const bbox = series.topologyBounds;\n if (bbox == null)\n return combined;\n if (combined == null)\n return bbox;\n combined.merge(bbox);\n return combined;\n }, void 0);\n let scale2;\n if (combinedBbox != null) {\n const { lon0, lat0, lon1, lat1 } = combinedBbox;\n const domain = [\n [lon0, lat0],\n [lon1, lat1]\n ];\n const bounds = MercatorScale.bounds(domain);\n const { width, height } = shrinkRect;\n const viewBoxScale = Math.min(width / bounds.width, height / bounds.height);\n const viewBoxWidth = bounds.width * viewBoxScale;\n const viewBoxHeight = bounds.height * viewBoxScale;\n const viewBoxOriginX = (width - viewBoxWidth) / 2;\n const viewBoxOriginY = (height - viewBoxHeight) / 2;\n const x0 = viewBoxOriginX;\n const y0 = viewBoxOriginY;\n const x1 = viewBoxOriginX + viewBoxWidth;\n const y1 = viewBoxOriginY + viewBoxHeight;\n const xZoom = this.ctx.zoomManager.getAxisZoom(this.xAxis.id);\n const yZoom = this.ctx.zoomManager.getAxisZoom(this.yAxis.id);\n const xSpan = (x1 - x0) / (xZoom.max - xZoom.min);\n const xStart = x0 - xSpan * xZoom.min;\n const ySpan = (y1 - y0) / (1 - yZoom.min - (1 - yZoom.max));\n const yStart = y0 - ySpan * (1 - yZoom.max);\n scale2 = new MercatorScale(domain, [\n [xStart, yStart],\n [xStart + xSpan, yStart + ySpan]\n ]);\n }\n mapSeries.forEach((series) => {\n series.scale = scale2;\n });\n const seriesVisible = this.series.some((s) => s.visible);\n seriesRoot.visible = seriesVisible;\n for (const group2 of [seriesRoot, annotationRoot, highlightRoot]) {\n group2.translationX = Math.floor(shrinkRect.x);\n group2.translationY = Math.floor(shrinkRect.y);\n group2.setClipRectInGroupCoordinateSpace(\n new BBox(shrinkRect.x, shrinkRect.y, shrinkRect.width, shrinkRect.height)\n );\n }\n this.ctx.layoutService.dispatchLayoutComplete({\n type: \"layout-complete\",\n chart: { width: this.ctx.scene.width, height: this.ctx.scene.height },\n clipSeries: false,\n series: { rect: fullSeriesRect, paddedRect: shrinkRect, visible: seriesVisible },\n axes: []\n });\n return shrinkRect;\n });\n }\n};\n_TopologyChart.className = \"TopologyChart\";\n_TopologyChart.type = \"topology\";\nvar TopologyChart = _TopologyChart;\n\n// packages/ag-charts-community/src/chart/agChartV2.ts\nvar debug2 = Debug.create(true, \"opts\");\nfunction chartType(options) {\n if (isAgCartesianChartOptions(options)) {\n return \"cartesian\";\n } else if (isAgPolarChartOptions(options)) {\n return \"polar\";\n } else if (isAgHierarchyChartOptions(options)) {\n return \"hierarchy\";\n } else if (isAgTopologyChartOptions(options)) {\n return \"topology\";\n }\n throw new Error(`AG Chart - unknown type of chart for options with type: ${options.type}`);\n}\nvar _AgCharts = class _AgCharts {\n static licenseCheck(options) {\n var _a, _b, _c, _d;\n if (this.licenseChecked)\n return;\n this.licenseManager = (_b = (_a = enterpriseModule).licenseManager) == null ? void 0 : _b.call(_a, options);\n (_c = this.licenseManager) == null ? void 0 : _c.setLicenseKey(this.licenseKey, this.gridContext);\n (_d = this.licenseManager) == null ? void 0 : _d.validateLicense();\n this.licenseChecked = true;\n }\n static setLicenseKey(licenseKey) {\n this.licenseKey = licenseKey;\n }\n static setGridContext(gridContext) {\n this.gridContext = gridContext;\n }\n static getLicenseDetails(licenseKey) {\n var _a, _b;\n return (_b = (_a = enterpriseModule).licenseManager) == null ? void 0 : _b.call(_a, {}).getLicenseDetails(licenseKey);\n }\n /**\n * Returns the `AgChartInstance` for a DOM node, if there is one.\n */\n static getInstance(element2) {\n return AgChartsInternal.getInstance(element2);\n }\n /**\n * Create a new `AgChartInstance` based upon the given configuration options.\n */\n static create(options) {\n var _a, _b, _c;\n this.licenseCheck(options);\n const chart = AgChartsInternal.createOrUpdate(options);\n if ((_a = this.licenseManager) == null ? void 0 : _a.isDisplayWatermark()) {\n (_c = (_b = enterpriseModule).injectWatermark) == null ? void 0 : _c.call(_b, chart.chart.element, this.licenseManager.getWatermarkMessage());\n }\n return chart;\n }\n /**\n * Update an existing `AgChartInstance`. Options provided should be complete and not\n * partial.\n *\n * __NOTE__: As each call could trigger a chart redraw, multiple calls to update options in\n * quick succession could result in undesirable flickering, so callers should batch up and/or\n * debounce changes to avoid unintended partial update renderings.\n */\n static update(chart, options) {\n if (!AgChartInstanceProxy.isInstance(chart)) {\n throw new Error(_AgCharts.INVALID_CHART_REF_MESSAGE);\n }\n AgChartsInternal.createOrUpdate(options, chart);\n }\n /**\n * Update an existing `AgChartInstance` by applying a partial set of option changes.\n *\n * __NOTE__: As each call could trigger a chart redraw, each individual delta options update\n * should leave the chart in a valid options state. Also, multiple calls to update options in\n * quick succession could result in undesirable flickering, so callers should batch up and/or\n * debounce changes to avoid unintended partial update renderings.\n */\n static updateDelta(chart, deltaOptions) {\n if (!AgChartInstanceProxy.isInstance(chart)) {\n throw new Error(_AgCharts.INVALID_CHART_REF_MESSAGE);\n }\n AgChartsInternal.updateUserDelta(chart, deltaOptions);\n }\n /**\n * Starts a browser-based image download for the given `AgChartInstance`.\n */\n static download(chart, options) {\n if (!(chart instanceof AgChartInstanceProxy)) {\n throw new Error(_AgCharts.INVALID_CHART_REF_MESSAGE);\n }\n AgChartsInternal.download(chart, options).catch((e) => Logger.errorOnce(e));\n }\n /**\n * Returns a base64-encoded image data URL for the given `AgChartInstance`.\n */\n static getImageDataURL(chart, options) {\n if (!(chart instanceof AgChartInstanceProxy)) {\n throw new Error(_AgCharts.INVALID_CHART_REF_MESSAGE);\n }\n return AgChartsInternal.getImageDataURL(chart, options);\n }\n};\n_AgCharts.INVALID_CHART_REF_MESSAGE = \"AG Charts - invalid chart reference passed\";\n_AgCharts.licenseChecked = false;\n_AgCharts.gridContext = false;\nvar AgCharts = _AgCharts;\nvar AgChart = class {\n static warnDeprecated(memberName) {\n const warnDeprecated = createDeprecationWarning();\n warnDeprecated(`AgChart.${memberName}`, `Use AgCharts.${memberName} instead`);\n }\n static create(options) {\n this.warnDeprecated(\"create\");\n return AgCharts.create(options);\n }\n static update(chart, options) {\n this.warnDeprecated(\"update\");\n return AgCharts.update(chart, options);\n }\n static updateDelta(chart, deltaOptions) {\n this.warnDeprecated(\"updateDelta\");\n return AgCharts.updateDelta(chart, deltaOptions);\n }\n static download(chart, options) {\n this.warnDeprecated(\"download\");\n return AgCharts.download(chart, options);\n }\n static getImageDataURL(chart, options) {\n this.warnDeprecated(\"getImageDataURL\");\n return AgCharts.getImageDataURL(chart, options);\n }\n};\nvar _AgChartsInternal = class _AgChartsInternal {\n static getInstance(element2) {\n const chart = Chart.getInstance(element2);\n return chart ? AgChartInstanceProxy.chartInstances.get(chart) : void 0;\n }\n static initialiseModules() {\n if (_AgChartsInternal.initialised)\n return;\n registerInbuiltModules();\n setupModules();\n _AgChartsInternal.initialised = true;\n }\n static createOrUpdate(options, proxy) {\n var _b;\n _AgChartsInternal.initialiseModules();\n debug2(\">>> AgChartV2.createOrUpdate() user options\", options);\n const _a = options, { overrideDevicePixelRatio, document: document2, window: userWindow } = _a, userOptions = __objRest(_a, [\"overrideDevicePixelRatio\", \"document\", \"window\"]);\n const chartOptions = new ChartOptions(userOptions, { overrideDevicePixelRatio, document: document2, window: userWindow });\n let chart = proxy == null ? void 0 : proxy.chart;\n if (chart == null || chartType(userOptions) !== chartType(chart.processedOptions)) {\n chart = _AgChartsInternal.createChartInstance(chartOptions, chart);\n }\n if (proxy == null) {\n proxy = new AgChartInstanceProxy(chart);\n } else {\n proxy.chart = chart;\n }\n if (debug2.check() && typeof window !== \"undefined\") {\n (_b = window.agChartInstances) != null ? _b : window.agChartInstances = {};\n window.agChartInstances[chart.id] = chart;\n }\n chart.queuedUserOptions.push(userOptions);\n chart.requestFactoryUpdate((chartRef) => {\n chartRef.applyOptions(chartOptions);\n chartRef.queuedUserOptions.splice(0, chartRef.queuedUserOptions.indexOf(userOptions));\n });\n return proxy;\n }\n static updateUserDelta(proxy, deltaOptions) {\n deltaOptions = deepClone(deltaOptions, { shallow: [\"data\"] });\n jsonWalk(\n deltaOptions,\n (node) => {\n if (typeof node !== \"object\")\n return;\n for (const [key, value] of Object.entries(node)) {\n if (typeof value === \"undefined\") {\n Object.assign(node, { [key]: Symbol(\"UNSET\") });\n }\n }\n },\n { skip: [\"data\"] }\n );\n const { chart } = proxy;\n const lastUpdateOptions = chart.getOptions();\n const userOptions = mergeDefaults(deltaOptions, lastUpdateOptions);\n debug2(\">>> AgChartV2.updateUserDelta() user delta\", deltaOptions);\n debug2(\"AgChartV2.updateUserDelta() - base options\", lastUpdateOptions);\n _AgChartsInternal.createOrUpdate(userOptions, proxy);\n }\n /**\n * Returns the content of the current canvas as an image.\n */\n static download(proxy, opts) {\n return __async(this, null, function* () {\n try {\n const clone = yield _AgChartsInternal.prepareResizedChart(proxy, opts);\n clone.chart.ctx.scene.download(opts == null ? void 0 : opts.fileName, opts == null ? void 0 : opts.fileFormat);\n clone.destroy();\n } catch (error) {\n Logger.errorOnce(error);\n }\n });\n }\n static getImageDataURL(proxy, opts) {\n return __async(this, null, function* () {\n const clone = yield _AgChartsInternal.prepareResizedChart(proxy, opts);\n const result = clone.chart.ctx.scene.getDataURL(opts == null ? void 0 : opts.fileFormat);\n clone.destroy();\n return result;\n });\n }\n static prepareResizedChart(_0) {\n return __async(this, arguments, function* ({ chart }, opts = {}) {\n var _a, _b, _c, _d;\n const width = (_b = (_a = opts.width) != null ? _a : chart.width) != null ? _b : chart.ctx.scene.canvas.width;\n const height = (_d = (_c = opts.height) != null ? _c : chart.height) != null ? _d : chart.ctx.scene.canvas.height;\n const options = mergeDefaults(\n {\n container: document.createElement(\"div\"),\n overrideDevicePixelRatio: 1,\n autoSize: false,\n width,\n height\n },\n // Disable enterprise features that may interfere with image generation.\n moduleRegistry.hasEnterpriseModules() && { animation: { enabled: false } },\n chart.userOptions\n );\n const cloneProxy = _AgChartsInternal.createOrUpdate(options);\n cloneProxy.chart.ctx.zoomManager.updateZoom(\"agChartV2\", chart.ctx.zoomManager.getZoom());\n chart.series.forEach((series, index) => {\n if (!series.visible) {\n cloneProxy.chart.series[index].visible = false;\n }\n });\n chart.update(0 /* FULL */, { forceNodeDataRefresh: true });\n yield cloneProxy.chart.waitForUpdate();\n return cloneProxy;\n });\n }\n static createChartInstance(options, oldChart) {\n const transferableResource = oldChart == null ? void 0 : oldChart.destroy({ keepTransferableResources: true });\n const ChartConstructor = _AgChartsInternal.getChartByOptions(options.processedOptions);\n return new ChartConstructor(options, transferableResource);\n }\n static getChartByOptions(options) {\n if (isAgCartesianChartOptions(options)) {\n return CartesianChart;\n } else if (isAgHierarchyChartOptions(options)) {\n return HierarchyChart;\n } else if (isAgPolarChartOptions(options)) {\n return PolarChart;\n } else if (isAgTopologyChartOptions(options)) {\n return TopologyChart;\n }\n throw new Error(\n `AG Charts - couldn't apply configuration, check options are correctly structured and series types are specified`\n );\n }\n};\n_AgChartsInternal.initialised = false;\nvar AgChartsInternal = _AgChartsInternal;\n\n// packages/ag-charts-community/src/version.ts\nvar VERSION = \"9.3.1\";\n\n// packages/ag-charts-community/src/integrated-charts-scene.ts\nvar integrated_charts_scene_exports = {};\n__export(integrated_charts_scene_exports, {\n Arc: () => Arc2,\n BBox: () => BBox,\n BandScale: () => BandScale,\n Caption: () => Caption,\n ChangeDetectableProperties: () => ChangeDetectableProperties,\n Circle: () => Circle,\n ContinuousScale: () => ContinuousScale,\n Diamond: () => Diamond,\n DropShadow: () => DropShadow,\n ExtendedPath2D: () => ExtendedPath2D,\n Group: () => Group,\n HdpiCanvas: () => HdpiCanvas,\n Image: () => Image,\n Label: () => Label,\n Line: () => Line,\n LinearGradientFill: () => LinearGradientFill,\n LinearScale: () => LinearScale,\n Marker: () => Marker,\n Node: () => Node,\n OrdinalTimeScale: () => OrdinalTimeScale,\n Path: () => Path,\n PointerEvents: () => PointerEvents,\n RadialColumnShape: () => RadialColumnShape,\n Rect: () => Rect,\n RedrawType: () => RedrawType,\n Scene: () => Scene,\n SceneChangeDetection: () => SceneChangeDetection,\n ScenePathChangeDetection: () => ScenePathChangeDetection,\n Sector: () => Sector,\n SectorBox: () => SectorBox,\n Selection: () => Selection,\n Shape: () => Shape,\n Square: () => Square,\n Text: () => Text,\n Tooltip: () => Tooltip,\n Triangle: () => Triangle,\n easing: () => easing_exports,\n getFont: () => getFont,\n getMarker: () => getMarker,\n getRadialColumnWidth: () => getRadialColumnWidth,\n motion: () => motion,\n nearestSquared: () => nearestSquared,\n nearestSquaredInContainer: () => nearestSquaredInContainer,\n toRadians: () => toRadians,\n toTooltipHtml: () => toTooltipHtml\n});\n\n// packages/ag-charts-community/src/scene/shape/arc.ts\nvar Arc2 = class extends Path {\n constructor() {\n super();\n this.centerX = 0;\n this.centerY = 0;\n this.radius = 10;\n this.startAngle = 0;\n this.endAngle = Math.PI * 2;\n this.counterClockwise = false;\n this.type = 0 /* Open */;\n this.restoreOwnStyles();\n }\n get fullPie() {\n return isEqual(normalizeAngle360(this.startAngle), normalizeAngle360(this.endAngle));\n }\n updatePath() {\n const path = this.path;\n path.clear();\n path.arc(this.centerX, this.centerY, this.radius, this.startAngle, this.endAngle, this.counterClockwise);\n if (this.type === 1 /* Chord */) {\n path.closePath();\n } else if (this.type === 2 /* Round */ && !this.fullPie) {\n path.lineTo(this.centerX, this.centerY);\n path.closePath();\n }\n }\n computeBBox() {\n return new BBox(this.centerX - this.radius, this.centerY - this.radius, this.radius * 2, this.radius * 2);\n }\n isPointInPath(x, y) {\n const point = this.transformPoint(x, y);\n const bbox = this.computeBBox();\n return this.type !== 0 /* Open */ && bbox.containsPoint(point.x, point.y) && this.path.isPointInPath(point.x, point.y);\n }\n};\nArc2.className = \"Arc\";\nArc2.defaultStyles = Object.assign({}, Shape.defaultStyles, {\n lineWidth: 1,\n fillStyle: null\n});\n__decorateClass([\n ScenePathChangeDetection()\n], Arc2.prototype, \"centerX\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Arc2.prototype, \"centerY\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Arc2.prototype, \"radius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Arc2.prototype, \"startAngle\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Arc2.prototype, \"endAngle\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Arc2.prototype, \"counterClockwise\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], Arc2.prototype, \"type\", 2);\n\n// packages/ag-charts-community/src/scene/shape/linearGradientFill.ts\nvar LinearGradientFill = class extends Shape {\n constructor() {\n super(...arguments);\n this.direction = \"to-right\";\n this.stops = void 0;\n this._mask = void 0;\n }\n get mask() {\n return this._mask;\n }\n set mask(newMask) {\n if (this._mask != null) {\n this.removeChild(this._mask);\n }\n if (newMask != null) {\n this.appendChild(newMask);\n }\n this._mask = newMask;\n }\n isPointInPath(x, y) {\n var _a, _b;\n return (_b = (_a = this.mask) == null ? void 0 : _a.isPointInPath(x, y)) != null ? _b : false;\n }\n computeBBox() {\n var _a;\n return (_a = this.mask) == null ? void 0 : _a.computeBBox();\n }\n render(renderCtx) {\n const { mask, stops } = this;\n const { ctx, devicePixelRatio } = renderCtx;\n const pixelLength = 1 / devicePixelRatio;\n const maskBbox = mask == null ? void 0 : mask.computeTransformedBBox();\n if (mask == null || stops == null || maskBbox == null)\n return;\n if (mask.dirtyPath) {\n mask.updatePath();\n mask.dirtyPath = false;\n }\n ctx.save();\n ctx.clip(mask.path.getPath2D());\n ctx.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0);\n const x0 = Math.floor(maskBbox.x);\n const x1 = Math.ceil(maskBbox.x + maskBbox.width);\n const y0 = Math.floor(maskBbox.y);\n const y1 = Math.ceil(maskBbox.y + maskBbox.height);\n const colorScale = new ColorScale();\n const [i0, i1] = this.direction === \"to-right\" ? [x0, x1] : [y0, y1];\n colorScale.domain = stops.map((_, index) => {\n return i0 + (i1 - i0) * index / (stops.length - 1);\n });\n colorScale.range = stops;\n colorScale.update();\n if (this.direction === \"to-right\") {\n const height = y1 - y0;\n for (let x = x0; x <= x1; x += pixelLength) {\n ctx.fillStyle = colorScale.convert(x);\n ctx.fillRect(x, y0, pixelLength, height);\n }\n } else {\n const width = x1 - x0;\n for (let y = y0; y <= y1; y += pixelLength) {\n ctx.fillStyle = colorScale.convert(y);\n ctx.fillRect(x0, y, width, pixelLength);\n }\n }\n ctx.restore();\n }\n};\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], LinearGradientFill.prototype, \"direction\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], LinearGradientFill.prototype, \"stops\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], LinearGradientFill.prototype, \"_mask\", 2);\n\n// packages/ag-charts-community/src/scene/shape/radialColumnShape.ts\nfunction rotatePoint(x, y, rotation) {\n const radius = Math.sqrt(__pow(x, 2) + __pow(y, 2));\n const angle = Math.atan2(y, x);\n const rotated = angle + rotation;\n return {\n x: Math.cos(rotated) * radius,\n y: Math.sin(rotated) * radius\n };\n}\nvar RadialColumnShape = class extends Path {\n constructor() {\n super(...arguments);\n this.borderPath = new ExtendedPath2D();\n this.isBeveled = true;\n this.columnWidth = 0;\n this.startAngle = 0;\n this.endAngle = 0;\n this.outerRadius = 0;\n this.innerRadius = 0;\n this.axisInnerRadius = 0;\n this.axisOuterRadius = 0;\n this.isRadiusAxisReversed = false;\n }\n getRotation() {\n const { startAngle, endAngle } = this;\n const midAngle = angleBetween(startAngle, endAngle);\n return normalizeAngle360(startAngle + midAngle / 2 + Math.PI / 2);\n }\n updatePath() {\n const { isBeveled } = this;\n if (isBeveled) {\n this.updateBeveledPath();\n } else {\n this.updateRectangularPath();\n }\n this.checkPathDirty();\n }\n updateRectangularPath() {\n const { columnWidth, innerRadius, outerRadius, path } = this;\n const left = -columnWidth / 2;\n const right = columnWidth / 2;\n const top = -outerRadius;\n const bottom = -innerRadius;\n const rotation = this.getRotation();\n const points = [\n [left, bottom],\n [left, top],\n [right, top],\n [right, bottom],\n [left, bottom]\n ].map(([x, y]) => rotatePoint(x, y, rotation));\n path.clear(true);\n path.moveTo(points[0].x, points[0].y);\n path.lineTo(points[1].x, points[1].y);\n path.lineTo(points[2].x, points[2].y);\n path.lineTo(points[3].x, points[3].y);\n path.lineTo(points[0].x, points[0].y);\n path.closePath();\n }\n updateBeveledPath() {\n const { columnWidth, path, outerRadius, innerRadius, axisInnerRadius, axisOuterRadius, isRadiusAxisReversed } = this;\n const isStackBottom = isEqual(innerRadius, axisInnerRadius);\n const sideRotation = Math.asin(columnWidth / 2 / innerRadius);\n const pointRotation = this.getRotation();\n const rotate = (x, y) => rotatePoint(x, y, pointRotation);\n const getTriangleHypotenuse = (leg, otherLeg) => Math.sqrt(__pow(leg, 2) + __pow(otherLeg, 2));\n const getTriangleLeg = (hypotenuse, otherLeg) => {\n if (otherLeg > hypotenuse) {\n return 0;\n }\n return Math.sqrt(__pow(hypotenuse, 2) - __pow(otherLeg, 2));\n };\n const compare = (value, otherValue, lessThan) => lessThan ? value < otherValue : value > otherValue;\n const shouldConnectBottomCircle = isStackBottom && !isNaN(sideRotation) && sideRotation < Math.PI / 6;\n let left = -columnWidth / 2;\n let right = columnWidth / 2;\n const top = -outerRadius;\n const bottom = -innerRadius * (shouldConnectBottomCircle ? Math.cos(sideRotation) : 1);\n const hasBottomIntersection = compare(\n axisOuterRadius,\n getTriangleHypotenuse(innerRadius, columnWidth / 2),\n !isRadiusAxisReversed\n );\n if (hasBottomIntersection) {\n const bottomIntersectionX = getTriangleLeg(axisOuterRadius, innerRadius);\n left = -bottomIntersectionX;\n right = bottomIntersectionX;\n }\n path.clear(true);\n const bottomLeftPt = rotate(left, bottom);\n path.moveTo(bottomLeftPt.x, bottomLeftPt.y);\n const isEmpty = isEqual(innerRadius, outerRadius);\n const hasSideIntersection = compare(\n axisOuterRadius,\n getTriangleHypotenuse(outerRadius, columnWidth / 2),\n !isRadiusAxisReversed\n );\n if (isEmpty && shouldConnectBottomCircle) {\n path.arc(\n 0,\n 0,\n innerRadius,\n normalizeAngle360(-sideRotation - Math.PI / 2) + pointRotation,\n normalizeAngle360(sideRotation - Math.PI / 2) + pointRotation,\n false\n );\n } else if (hasSideIntersection) {\n const sideIntersectionY = -getTriangleLeg(axisOuterRadius, columnWidth / 2);\n const topIntersectionX = getTriangleLeg(axisOuterRadius, outerRadius);\n if (!hasBottomIntersection) {\n const topLeftPt = rotate(left, sideIntersectionY);\n path.lineTo(topLeftPt.x, topLeftPt.y);\n }\n path.arc(\n 0,\n 0,\n axisOuterRadius,\n Math.atan2(sideIntersectionY, left) + pointRotation,\n Math.atan2(top, -topIntersectionX) + pointRotation,\n false\n );\n if (!isEqual(topIntersectionX, 0)) {\n const topRightBevelPt = rotate(topIntersectionX, top);\n path.lineTo(topRightBevelPt.x, topRightBevelPt.y);\n }\n path.arc(\n 0,\n 0,\n axisOuterRadius,\n Math.atan2(top, topIntersectionX) + pointRotation,\n Math.atan2(sideIntersectionY, right) + pointRotation,\n false\n );\n } else {\n const topLeftPt = rotate(left, top);\n const topRightPt = rotate(right, top);\n path.lineTo(topLeftPt.x, topLeftPt.y);\n path.lineTo(topRightPt.x, topRightPt.y);\n }\n const bottomRightPt = rotate(right, bottom);\n path.lineTo(bottomRightPt.x, bottomRightPt.y);\n if (shouldConnectBottomCircle) {\n path.arc(\n 0,\n 0,\n innerRadius,\n normalizeAngle360(sideRotation - Math.PI / 2) + pointRotation,\n normalizeAngle360(-sideRotation - Math.PI / 2) + pointRotation,\n true\n );\n } else {\n const rotatedBottomLeftPt = rotate(left, bottom);\n path.lineTo(rotatedBottomLeftPt.x, rotatedBottomLeftPt.y);\n }\n path.closePath();\n }\n};\nRadialColumnShape.className = \"RadialColumnShape\";\n__decorateClass([\n ScenePathChangeDetection()\n], RadialColumnShape.prototype, \"isBeveled\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], RadialColumnShape.prototype, \"columnWidth\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], RadialColumnShape.prototype, \"startAngle\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], RadialColumnShape.prototype, \"endAngle\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], RadialColumnShape.prototype, \"outerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], RadialColumnShape.prototype, \"innerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], RadialColumnShape.prototype, \"axisInnerRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], RadialColumnShape.prototype, \"axisOuterRadius\", 2);\n__decorateClass([\n ScenePathChangeDetection()\n], RadialColumnShape.prototype, \"isRadiusAxisReversed\", 2);\nfunction getRadialColumnWidth(startAngle, endAngle, axisOuterRadius, columnWidthRatio, maxColumnWidthRatio) {\n const rotation = angleBetween(startAngle, endAngle);\n const pad2 = rotation * (1 - columnWidthRatio) / 2;\n startAngle += pad2;\n endAngle -= pad2;\n if (rotation < 1e-3) {\n return 2 * axisOuterRadius * maxColumnWidthRatio;\n }\n if (rotation >= 2 * Math.PI) {\n const midAngle = startAngle + rotation / 2;\n startAngle = midAngle - Math.PI;\n endAngle = midAngle + Math.PI;\n }\n const startX = axisOuterRadius * Math.cos(startAngle);\n const startY = axisOuterRadius * Math.sin(startAngle);\n const endX = axisOuterRadius * Math.cos(endAngle);\n const endY = axisOuterRadius * Math.sin(endAngle);\n const colWidth = Math.floor(Math.sqrt(__pow(startX - endX, 2) + __pow(startY - endY, 2)));\n const maxWidth = 2 * axisOuterRadius * maxColumnWidthRatio;\n return Math.max(1, Math.min(maxWidth, colWidth));\n}\n\n// packages/ag-charts-community/src/scene/image.ts\nvar Image = class extends Node {\n constructor(sourceImage) {\n super();\n this.x = 0;\n this.y = 0;\n this.width = 0;\n this.height = 0;\n this.opacity = 1;\n this.sourceImage = sourceImage;\n }\n render(renderCtx) {\n const { ctx, forceRender, stats } = renderCtx;\n if (this.dirty === 0 /* NONE */ && !forceRender) {\n if (stats)\n stats.nodesSkipped++;\n return;\n }\n this.computeTransformMatrix();\n this.matrix.toContext(ctx);\n const image = this.sourceImage;\n ctx.globalAlpha = this.opacity;\n ctx.drawImage(image, 0, 0, image.width, image.height, this.x, this.y, this.width, this.height);\n super.render(renderCtx);\n }\n};\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], Image.prototype, \"x\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], Image.prototype, \"y\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], Image.prototype, \"width\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], Image.prototype, \"height\", 2);\n__decorateClass([\n SceneChangeDetection({ redraw: 3 /* MAJOR */ })\n], Image.prototype, \"opacity\", 2);\n\n// packages/ag-charts-community/src/integrated-charts-scene.ts\nvar motion = __spreadValues(__spreadValues({}, fromToMotion_exports), resetMotion_exports);\n\n// packages/ag-charts-community/src/integrated-charts-theme.ts\nvar integrated_charts_theme_exports = {};\n__export(integrated_charts_theme_exports, {\n CARTESIAN_AXIS_TYPE: () => CARTESIAN_AXIS_TYPE,\n ChartTheme: () => ChartTheme,\n DEFAULT_ANNOTATION_BACKGROUND_FILL: () => DEFAULT_ANNOTATION_BACKGROUND_FILL,\n DEFAULT_ANNOTATION_HANDLE_FILL: () => DEFAULT_ANNOTATION_HANDLE_FILL,\n DEFAULT_ANNOTATION_STROKE: () => DEFAULT_ANNOTATION_STROKE,\n DEFAULT_AXIS_GRID_COLOUR: () => DEFAULT_AXIS_GRID_COLOUR,\n DEFAULT_AXIS_LINE_COLOUR: () => DEFAULT_AXIS_LINE_COLOUR,\n DEFAULT_BACKGROUND_COLOUR: () => DEFAULT_BACKGROUND_COLOUR,\n DEFAULT_COLOURS: () => DEFAULT_COLOURS,\n DEFAULT_CROSS_LINES_COLOUR: () => DEFAULT_CROSS_LINES_COLOUR,\n DEFAULT_DIVERGING_SERIES_COLOUR_RANGE: () => DEFAULT_DIVERGING_SERIES_COLOUR_RANGE,\n DEFAULT_FONT_FAMILY: () => DEFAULT_FONT_FAMILY,\n DEFAULT_HIERARCHY_FILLS: () => DEFAULT_HIERARCHY_FILLS,\n DEFAULT_HIERARCHY_STROKES: () => DEFAULT_HIERARCHY_STROKES,\n DEFAULT_INSIDE_SERIES_LABEL_COLOUR: () => DEFAULT_INSIDE_SERIES_LABEL_COLOUR,\n DEFAULT_INVERTED_LABEL_COLOUR: () => DEFAULT_INVERTED_LABEL_COLOUR,\n DEFAULT_LABEL_COLOUR: () => DEFAULT_LABEL_COLOUR,\n DEFAULT_MUTED_LABEL_COLOUR: () => DEFAULT_MUTED_LABEL_COLOUR,\n DEFAULT_POLAR_SERIES_STROKE: () => DEFAULT_POLAR_SERIES_STROKE,\n DEFAULT_SHADOW_COLOUR: () => DEFAULT_SHADOW_COLOUR,\n DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE: () => DEFAULT_WATERFALL_SERIES_CONNECTOR_LINE_STROKE,\n DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS: () => DEFAULT_WATERFALL_SERIES_NEGATIVE_COLOURS,\n DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS: () => DEFAULT_WATERFALL_SERIES_POSITIVE_COLOURS,\n DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS: () => DEFAULT_WATERFALL_SERIES_TOTAL_COLOURS,\n EXTENDS_AXES_DEFAULTS: () => EXTENDS_AXES_DEFAULTS,\n EXTENDS_AXES_GRID_LINE_DEFAULTS: () => EXTENDS_AXES_GRID_LINE_DEFAULTS,\n EXTENDS_AXES_LINE_DEFAULTS: () => EXTENDS_AXES_LINE_DEFAULTS,\n EXTENDS_AXES_TICK_DEFAULTS: () => EXTENDS_AXES_TICK_DEFAULTS,\n EXTENDS_CARTESIAN_MARKER_DEFAULTS: () => EXTENDS_CARTESIAN_MARKER_DEFAULTS,\n EXTENDS_SERIES_DEFAULTS: () => EXTENDS_SERIES_DEFAULTS,\n FONT_SIZE: () => FONT_SIZE,\n FONT_WEIGHT: () => FONT_WEIGHT,\n IS_DARK_THEME: () => IS_DARK_THEME,\n POLAR_AXIS_SHAPE: () => POLAR_AXIS_SHAPE,\n POLAR_AXIS_TYPE: () => POLAR_AXIS_TYPE,\n POSITION: () => POSITION,\n getChartTheme: () => getChartTheme,\n markerPaletteFactory: () => markerPaletteFactory,\n singleSeriesPaletteFactory: () => singleSeriesPaletteFactory,\n themes: () => themes2\n});\nvar themes2 = mapValues(themes, (themeFactory) => themeFactory == null ? void 0 : themeFactory());\n\n// packages/ag-charts-community/src/sparklines-scale.ts\nvar sparklines_scale_exports = {};\n__export(sparklines_scale_exports, {\n BandScale: () => BandScale,\n ColorScale: () => ColorScale,\n ContinuousScale: () => ContinuousScale,\n Invalidating: () => Invalidating,\n LinearScale: () => LinearScale,\n OrdinalTimeScale: () => OrdinalTimeScale,\n TimeScale: () => TimeScale\n});\n\n// packages/ag-charts-community/src/sparklines-util.ts\nvar sparklines_util_exports = {};\n__export(sparklines_util_exports, {\n Color: () => Color,\n Logger: () => Logger,\n Padding: () => Padding,\n angleBetween: () => angleBetween,\n areArrayItemsStrictlyEqual: () => areArrayItemsStrictlyEqual,\n areArrayNumbersEqual: () => areArrayNumbersEqual,\n bifurcate: () => bifurcate,\n checkDatum: () => checkDatum,\n clamp: () => clamp,\n clampArray: () => clampArray,\n countFractionDigits: () => countFractionDigits,\n createId: () => createId,\n deepClone: () => deepClone,\n displacePointFromVector: () => displacePointFromVector,\n extent: () => extent,\n findMinMax: () => findMinMax,\n findRangeExtent: () => findRangeExtent,\n isBetweenAngles: () => isBetweenAngles,\n isContinuous: () => isContinuous,\n isDate: () => isValidDate,\n isDenseInterval: () => isDenseInterval,\n isEqual: () => isEqual,\n isNegative: () => isNegative,\n isNumber: () => isFiniteNumber,\n isNumberEqual: () => isEqual,\n isNumberObject: () => isNumberObject,\n isString: () => isString,\n isStringObject: () => isStringObject,\n jsonApply: () => jsonApply,\n jsonDiff: () => jsonDiff,\n jsonWalk: () => jsonWalk,\n mod: () => mod,\n normalisedExtent: () => normalisedExtent,\n normalisedExtentWithMetadata: () => normalisedExtentWithMetadata,\n normalizeAngle180: () => normalizeAngle180,\n normalizeAngle360: () => normalizeAngle360,\n normalizeAngle360Inclusive: () => normalizeAngle360Inclusive,\n range: () => range,\n resetIds: () => resetIds,\n round: () => round,\n sanitizeHtml: () => sanitizeHtml,\n setAttribute: () => setAttribute,\n shallowClone: () => shallowClone,\n tickFormat: () => tickFormat,\n tickStep: () => tickStep,\n ticks: () => ticks_default,\n toDegrees: () => toDegrees,\n toFixed: () => toFixed,\n toRadians: () => toRadians,\n transformIntegratedCategoryValue: () => transformIntegratedCategoryValue,\n zipObject: () => zipObject\n});\n\n// packages/ag-charts-community/src/util/zip.ts\nfunction zipObject(keys, values) {\n const zipped = {};\n if (Array.isArray(values)) {\n for (let i = 0; i < keys.length; i++) {\n zipped[`${keys[i]}`] = values[i];\n }\n } else {\n for (let i = 0; i < keys.length; i++) {\n zipped[`${keys[i]}`] = values;\n }\n }\n return zipped;\n}\n\n// packages/ag-charts-community/src/module-support.ts\nvar module_support_exports = {};\n__export(module_support_exports, {\n AND: () => AND,\n ARRAY: () => ARRAY,\n ARRAY_OF: () => ARRAY_OF,\n AbstractBarSeries: () => AbstractBarSeries,\n AbstractBarSeriesProperties: () => AbstractBarSeriesProperties,\n ActionOnSet: () => ActionOnSet,\n Animation: () => Animation,\n AnimationManager: () => AnimationManager,\n AreaSeriesTag: () => AreaSeriesTag,\n Axis: () => Axis,\n AxisLabel: () => AxisLabel,\n AxisTick: () => AxisTick,\n BOOLEAN: () => BOOLEAN,\n BOOLEAN_ARRAY: () => BOOLEAN_ARRAY,\n Background: () => Background,\n BackgroundModule: () => BackgroundModule,\n BaseModuleInstance: () => BaseModuleInstance,\n BaseProperties: () => BaseProperties,\n COLOR_STRING: () => COLOR_STRING,\n COLOR_STRING_ARRAY: () => COLOR_STRING_ARRAY,\n CartesianAxis: () => CartesianAxis,\n CartesianSeries: () => CartesianSeries,\n CartesianSeriesNodeEvent: () => CartesianSeriesNodeEvent,\n CartesianSeriesProperties: () => CartesianSeriesProperties,\n CategoryAxis: () => CategoryAxis,\n CategoryAxisTick: () => CategoryAxisTick,\n ChartAxisDirection: () => ChartAxisDirection,\n ChartEventManager: () => ChartEventManager,\n ChartOptions: () => ChartOptions,\n ChartUpdateType: () => ChartUpdateType,\n ContextMenuRegistry: () => ContextMenuRegistry,\n CursorManager: () => CursorManager,\n DATE: () => DATE,\n DATE_ARRAY: () => DATE_ARRAY,\n DATE_OR_DATETIME_MS: () => DATE_OR_DATETIME_MS,\n DEFAULT_CARTESIAN_DIRECTION_KEYS: () => DEFAULT_CARTESIAN_DIRECTION_KEYS,\n DEFAULT_CARTESIAN_DIRECTION_NAMES: () => DEFAULT_CARTESIAN_DIRECTION_NAMES,\n DEFAULT_TOOLTIP_CLASS: () => DEFAULT_TOOLTIP_CLASS,\n DEFAULT_TOOLTIP_DARK_CLASS: () => DEFAULT_TOOLTIP_DARK_CLASS,\n DEGREE: () => DEGREE,\n DIRECTION: () => DIRECTION,\n DataController: () => DataController,\n DataModel: () => DataModel,\n DataModelSeries: () => DataModelSeries,\n DataService: () => DataService,\n Default: () => Default,\n Deprecated: () => Deprecated,\n DeprecatedAndRenamedTo: () => DeprecatedAndRenamedTo,\n EMPTY_TOOLTIP_CONTENT: () => EMPTY_TOOLTIP_CONTENT,\n FONT_STYLE: () => FONT_STYLE,\n FONT_WEIGHT: () => FONT_WEIGHT2,\n FUNCTION: () => FUNCTION,\n GREATER_THAN: () => GREATER_THAN,\n GestureDetector: () => GestureDetector,\n GroupedCategoryAxis: () => GroupedCategoryAxis,\n HierarchyNode: () => HierarchyNode,\n HierarchySeries: () => HierarchySeries,\n HierarchySeriesProperties: () => HierarchySeriesProperties,\n HighlightManager: () => HighlightManager,\n HighlightStyle: () => HighlightStyle,\n INTERACTION_RANGE: () => INTERACTION_RANGE,\n InteractionManager: () => InteractionManager,\n InteractionState: () => InteractionState,\n LABEL_PLACEMENT: () => LABEL_PLACEMENT,\n LESS_THAN: () => LESS_THAN,\n LINE_CAP: () => LINE_CAP,\n LINE_DASH: () => LINE_DASH,\n LINE_JOIN: () => LINE_JOIN,\n Layers: () => Layers,\n LayoutService: () => LayoutService,\n LonLatBBox: () => LonLatBBox,\n MARKER_SHAPE: () => MARKER_SHAPE,\n MATCHING_CROSSLINE_TYPE: () => MATCHING_CROSSLINE_TYPE,\n MAX_SPACING: () => MAX_SPACING,\n MIN_SPACING: () => MIN_SPACING,\n MercatorScale: () => MercatorScale,\n Motion: () => easing_exports,\n NAN: () => NAN,\n NODE_UPDATE_STATE_TO_PHASE_MAPPING: () => NODE_UPDATE_STATE_TO_PHASE_MAPPING,\n NUMBER: () => NUMBER,\n NUMBER_ARRAY: () => NUMBER_ARRAY,\n NUMBER_OR_NAN: () => NUMBER_OR_NAN,\n Navigator: () => Navigator,\n NavigatorModule: () => NavigatorModule,\n OBJECT: () => OBJECT,\n OBJECT_ARRAY: () => OBJECT_ARRAY,\n OR: () => OR,\n OVERFLOW_STRATEGY: () => OVERFLOW_STRATEGY,\n ObserveChanges: () => ObserveChanges,\n PHASE_METADATA: () => PHASE_METADATA,\n PHASE_ORDER: () => PHASE_ORDER,\n PLACEMENT: () => PLACEMENT,\n PLAIN_OBJECT: () => PLAIN_OBJECT,\n POINTER_INTERACTION_TYPES: () => POINTER_INTERACTION_TYPES,\n POSITION: () => POSITION2,\n POSITIVE_NUMBER: () => POSITIVE_NUMBER,\n PolarAxis: () => PolarAxis,\n PolarSeries: () => PolarSeries,\n PropertiesArray: () => PropertiesArray,\n ProxyOnWrite: () => ProxyOnWrite,\n ProxyProperty: () => ProxyProperty,\n ProxyPropertyOnWrite: () => ProxyPropertyOnWrite,\n QUICK_TRANSITION: () => QUICK_TRANSITION,\n RATIO: () => RATIO,\n RepeatType: () => RepeatType,\n SMALLEST_KEY_INTERVAL: () => SMALLEST_KEY_INTERVAL,\n SORT_DOMAIN_GROUPS: () => SORT_DOMAIN_GROUPS,\n STRING: () => STRING,\n STRING_ARRAY: () => STRING_ARRAY,\n Series: () => Series,\n SeriesGroupingChangedEvent: () => SeriesGroupingChangedEvent,\n SeriesItemHighlightStyle: () => SeriesItemHighlightStyle,\n SeriesMarker: () => SeriesMarker,\n SeriesNodeEvent: () => SeriesNodeEvent,\n SeriesNodePickMode: () => SeriesNodePickMode,\n SeriesProperties: () => SeriesProperties,\n SeriesTooltip: () => SeriesTooltip,\n StateMachine: () => StateMachine,\n TEXT_ALIGN: () => TEXT_ALIGN,\n TEXT_WRAP: () => TEXT_WRAP,\n ToolbarManager: () => ToolbarManager,\n Tooltip: () => Tooltip,\n TooltipManager: () => TooltipManager,\n TooltipPosition: () => TooltipPosition,\n UNION: () => UNION,\n UpdateService: () => UpdateService,\n VERTICAL_ALIGN: () => VERTICAL_ALIGN,\n Validate: () => Validate,\n ZoomManager: () => ZoomManager,\n __FORCE_MODULE_DETECTION: () => __FORCE_MODULE_DETECTION2,\n accumulateGroup: () => accumulateGroup,\n accumulatedValue: () => accumulatedValue,\n accumulativeValueProperty: () => accumulativeValueProperty,\n addHitTestersToQuadtree: () => addHitTestersToQuadtree,\n adjustLabelPlacement: () => adjustLabelPlacement,\n allInStringUnion: () => allInStringUnion,\n animationValidation: () => animationValidation,\n area: () => area,\n arraysEqual: () => arraysEqual,\n assignJsonApplyConstructedArray: () => assignJsonApplyConstructedArray,\n backfillPathPointData: () => backfillPathPointData,\n basicContinuousCheckDatumValidation: () => basicContinuousCheckDatumValidation,\n bifurcate: () => bifurcate,\n buildFormatter: () => buildFormatter,\n buildResetPathFn: () => buildResetPathFn,\n calculateDefaultTimeTickFormat: () => calculateDefaultTimeTickFormat,\n calculatePlacement: () => calculatePlacement,\n checkCrisp: () => checkCrisp,\n childrenIter: () => childrenIter,\n circularSliceArray: () => circularSliceArray,\n clamp: () => clamp,\n clampArray: () => clampArray,\n collapsedStartingBarPosition: () => collapsedStartingBarPosition,\n computeBarFocusBounds: () => computeBarFocusBounds,\n computeMarkerFocusBounds: () => computeMarkerFocusBounds,\n computeSectorFocusBounds: () => computeSectorFocusBounds,\n convertValuesToScaleByDefs: () => convertValuesToScaleByDefs,\n countFractionDigits: () => countFractionDigits,\n createDatumId: () => createDatumId,\n createDeprecationWarning: () => createDeprecationWarning,\n createElement: () => createElement,\n dateToNumber: () => dateToNumber,\n deconstructSelectionsOrNodes: () => deconstructSelectionsOrNodes,\n deepClone: () => deepClone,\n deepMerge: () => deepMerge,\n defaultTimeTickFormat: () => defaultTimeTickFormat,\n determinePathStatus: () => determinePathStatus,\n diff: () => diff,\n downloadUrl: () => downloadUrl,\n enterpriseModule: () => enterpriseModule,\n extent: () => extent,\n extractDecoratedProperties: () => extractDecoratedProperties,\n findMinMax: () => findMinMax,\n findQuadtreeMatch: () => findQuadtreeMatch,\n findRangeExtent: () => findRangeExtent,\n fixNumericExtent: () => fixNumericExtent,\n fromToMotion: () => fromToMotion,\n getDocument: () => getDocument,\n getMissCount: () => getMissCount,\n getPath: () => getPath,\n getRectConfig: () => getRectConfig,\n getWindow: () => getWindow,\n groupAccumulativeValueProperty: () => groupAccumulativeValueProperty,\n groupAverage: () => groupAverage,\n groupBy: () => groupBy,\n groupCount: () => groupCount,\n groupSum: () => groupSum,\n injectStyle: () => injectStyle,\n isArray: () => isArray,\n isBoolean: () => isBoolean,\n isDate: () => isDate,\n isDecoratedObject: () => isDecoratedObject,\n isDefined: () => isDefined,\n isEnumKey: () => isEnumKey,\n isEnumValue: () => isEnumValue,\n isEqual: () => isEqual,\n isFiniteNumber: () => isFiniteNumber,\n isFunction: () => isFunction,\n isHtmlElement: () => isHtmlElement,\n isNegative: () => isNegative,\n isNumber: () => isNumber,\n isObject: () => isObject,\n isObjectLike: () => isObjectLike,\n isPlainObject: () => isPlainObject,\n isProperties: () => isProperties,\n isRegExp: () => isRegExp,\n isString: () => isString,\n isSymbol: () => isSymbol,\n isValidDate: () => isValidDate,\n jsonApply: () => jsonApply,\n jsonDiff: () => jsonDiff,\n jsonWalk: () => jsonWalk,\n keyProperty: () => keyProperty,\n listDecoratedProperties: () => listDecoratedProperties,\n mapIterable: () => mapIterable,\n mapValues: () => mapValues,\n markerFadeInAnimation: () => markerFadeInAnimation,\n markerPaletteFactory: () => markerPaletteFactory,\n markerScaleInAnimation: () => markerScaleInAnimation,\n markerSwipeScaleInAnimation: () => markerSwipeScaleInAnimation,\n mergeArrayDefaults: () => mergeArrayDefaults,\n mergeDefaults: () => mergeDefaults,\n midpointStartingBarPosition: () => midpointStartingBarPosition,\n minMax: () => minMax,\n mod: () => mod,\n moduleRegistry: () => moduleRegistry,\n normaliseGroupTo: () => normaliseGroupTo,\n normalisePropertyTo: () => normalisePropertyTo,\n normalisedExtent: () => normalisedExtent,\n normalisedExtentWithMetadata: () => normalisedExtentWithMetadata,\n pairCategoryData: () => pairCategoryData,\n pairContinuousData: () => pairContinuousData,\n partialAssign: () => partialAssign,\n pathFadeInAnimation: () => pathFadeInAnimation,\n pathFadeOutAnimation: () => pathFadeOutAnimation,\n pathSwipeInAnimation: () => pathSwipeInAnimation,\n pickByMatchingAngle: () => pickByMatchingAngle,\n predicateWithMessage: () => predicateWithMessage,\n prepareAreaPathAnimation: () => prepareAreaPathAnimation,\n prepareAxisAnimationContext: () => prepareAxisAnimationContext,\n prepareAxisAnimationFunctions: () => prepareAxisAnimationFunctions,\n prepareBarAnimationFunctions: () => prepareBarAnimationFunctions,\n prepareLinePathAnimation: () => prepareLinePathAnimation,\n prepareLinePathAnimationFns: () => prepareLinePathAnimationFns,\n prepareMarkerAnimation: () => prepareMarkerAnimation,\n preparePieSeriesAnimationFunctions: () => preparePieSeriesAnimationFunctions,\n range: () => range2,\n rangedValueProperty: () => rangedValueProperty,\n renderPartialPath: () => renderPartialPath,\n resetAxisGroupFn: () => resetAxisGroupFn,\n resetAxisLabelSelectionFn: () => resetAxisLabelSelectionFn,\n resetAxisLineSelectionFn: () => resetAxisLineSelectionFn,\n resetAxisSelectionFn: () => resetAxisSelectionFn,\n resetBarSelectionsFn: () => resetBarSelectionsFn,\n resetIds: () => resetIds,\n resetLabelFn: () => resetLabelFn,\n resetMarkerFn: () => resetMarkerFn,\n resetMarkerPositionFn: () => resetMarkerPositionFn,\n resetMotion: () => resetMotion,\n resetPieSelectionsFn: () => resetPieSelectionsFn,\n round: () => round,\n seriesLabelFadeInAnimation: () => seriesLabelFadeInAnimation,\n seriesLabelFadeOutAnimation: () => seriesLabelFadeOutAnimation,\n setDocument: () => setDocument,\n setPath: () => setPath,\n setWindow: () => setWindow,\n shallowClone: () => shallowClone,\n singleSeriesPaletteFactory: () => singleSeriesPaletteFactory,\n staticFromToMotion: () => staticFromToMotion,\n stringify: () => stringify,\n sum: () => sum,\n sumValues: () => sumValues,\n toArray: () => toArray,\n toFixed: () => toFixed,\n toTooltipHtml: () => toTooltipHtml,\n trailingAccumulatedValue: () => trailingAccumulatedValue,\n trailingAccumulatedValueProperty: () => trailingAccumulatedValueProperty,\n unique: () => unique,\n updateClipPath: () => updateClipPath,\n updateLabelNode: () => updateLabelNode,\n updateRect: () => updateRect,\n validateCrossLineValues: () => validateCrossLineValues,\n valueProperty: () => valueProperty,\n without: () => without\n});\n\n// packages/ag-charts-community/src/chart/series/util.ts\nfunction convertValuesToScaleByDefs({\n defs,\n values,\n xAxis,\n yAxis\n}) {\n if (!(xAxis && yAxis)) {\n throw new Error(\"Axes must be defined\");\n }\n const result = {};\n for (const [searchId, { def }] of defs) {\n if (Object.hasOwn(values, searchId)) {\n const { scale: scale2 } = def.type === \"key\" ? xAxis : yAxis;\n result[searchId] = Math.round(scale2.convert(values[searchId]));\n }\n }\n return result;\n}\n\n// packages/ag-charts-community/src/chart/series/hierarchy/hierarchySeries.ts\nvar _HierarchyNode = class _HierarchyNode {\n constructor(series, index, datum, size, colorValue, fill, stroke, sumSize, depth, parent, children) {\n this.series = series;\n this.index = index;\n this.datum = datum;\n this.size = size;\n this.colorValue = colorValue;\n this.fill = fill;\n this.stroke = stroke;\n this.sumSize = sumSize;\n this.depth = depth;\n this.parent = parent;\n this.children = children;\n this.midPoint = { x: 0, y: 0 };\n }\n contains(other) {\n let current = other;\n while (current != null && current.index >= this.index) {\n if (current === this) {\n return true;\n }\n current = current.parent;\n }\n return false;\n }\n walk(callback, order = _HierarchyNode.Walk.PreOrder) {\n if (order === _HierarchyNode.Walk.PreOrder) {\n callback(this);\n }\n this.children.forEach((child) => {\n child.walk(callback, order);\n });\n if (order === _HierarchyNode.Walk.PostOrder) {\n callback(this);\n }\n }\n *[Symbol.iterator]() {\n yield this;\n for (const child of this.children) {\n yield* __yieldStar(child);\n }\n }\n};\n_HierarchyNode.Walk = {\n PreOrder: 0,\n PostOrder: 1\n};\nvar HierarchyNode = _HierarchyNode;\nvar HierarchySeries = class extends Series {\n constructor(moduleCtx) {\n super({\n moduleCtx,\n pickModes: [0 /* EXACT_SHAPE_MATCH */],\n contentGroupVirtual: false\n });\n this.rootNode = new HierarchyNode(\n this,\n 0,\n void 0,\n 0,\n void 0,\n void 0,\n void 0,\n 0,\n void 0,\n void 0,\n []\n );\n this.colorDomain = [0, 0];\n this.maxDepth = 0;\n this.animationState = new StateMachine(\n \"empty\",\n {\n empty: {\n update: {\n target: \"ready\",\n action: (data) => this.animateEmptyUpdateReady(data)\n },\n reset: \"empty\",\n skip: \"ready\"\n },\n ready: {\n updateData: \"waiting\",\n clear: \"clearing\",\n highlight: (data) => this.animateReadyHighlight(data),\n resize: (data) => this.animateReadyResize(data),\n reset: \"empty\",\n skip: \"ready\"\n },\n waiting: {\n update: {\n target: \"ready\",\n action: (data) => this.animateWaitingUpdateReady(data)\n },\n reset: \"empty\",\n skip: \"ready\"\n },\n clearing: {\n update: {\n target: \"empty\",\n action: (data) => this.animateClearingUpdateEmpty(data)\n },\n reset: \"empty\",\n skip: \"ready\"\n }\n },\n () => this.checkProcessedDataAnimatable()\n );\n }\n resetAnimation(phase) {\n if (phase === \"initial\") {\n this.animationState.transition(\"reset\");\n } else if (phase === \"ready\") {\n this.animationState.transition(\"skip\");\n }\n }\n processData() {\n return __async(this, null, function* () {\n var _a, _b;\n const { childrenKey, sizeKey, colorKey, fills, strokes, colorRange } = this.properties;\n let index = 0;\n const getIndex = () => {\n index += 1;\n return index;\n };\n let maxDepth = 0;\n let minColor = Infinity;\n let maxColor = -Infinity;\n const colors = new Array(((_b = (_a = this.data) == null ? void 0 : _a.length) != null ? _b : 0) + 1).fill(void 0);\n const createNode = (datum, parent) => {\n const nodeIndex = getIndex();\n const depth = parent.depth != null ? parent.depth + 1 : 0;\n const children = childrenKey != null ? datum[childrenKey] : void 0;\n const isLeaf = children == null || children.length === 0;\n let size = sizeKey != null ? datum[sizeKey] : void 0;\n if (Number.isFinite(size)) {\n size = Math.max(size, 0);\n } else {\n size = isLeaf ? 1 : 0;\n }\n const sumSize = size;\n maxDepth = Math.max(maxDepth, depth);\n const color = colorKey != null ? datum[colorKey] : void 0;\n if (typeof color === \"number\") {\n colors[nodeIndex] = color;\n minColor = Math.min(minColor, color);\n maxColor = Math.max(maxColor, color);\n }\n return appendChildren(\n new HierarchyNode(\n this,\n nodeIndex,\n datum,\n size,\n color,\n void 0,\n void 0,\n sumSize,\n depth,\n parent,\n []\n ),\n children\n );\n };\n const appendChildren = (node, data) => {\n data == null ? void 0 : data.forEach((datum) => {\n const child = createNode(datum, node);\n node.children.push(child);\n node.sumSize += child.sumSize;\n });\n return node;\n };\n const rootNode = appendChildren(\n new HierarchyNode(\n this,\n 0,\n void 0,\n 0,\n void 0,\n void 0,\n void 0,\n 0,\n void 0,\n void 0,\n []\n ),\n this.data\n );\n const colorDomain = [minColor, maxColor];\n let colorScale;\n if (colorRange != null && Number.isFinite(minColor) && Number.isFinite(maxColor)) {\n colorScale = new ColorScale();\n colorScale.domain = colorDomain;\n colorScale.range = colorRange;\n colorScale.update();\n }\n rootNode.children.forEach((child, childIndex) => {\n child.walk((node) => {\n let fill;\n const color = colors[node.index];\n if (color != null) {\n fill = colorScale == null ? void 0 : colorScale.convert(color);\n }\n fill != null ? fill : fill = fills == null ? void 0 : fills[childIndex % fills.length];\n node.fill = fill;\n node.stroke = colorScale == null ? strokes == null ? void 0 : strokes[childIndex % strokes.length] : \"rgba(0, 0, 0, 0.2)\";\n });\n });\n this.rootNode = rootNode;\n this.maxDepth = maxDepth;\n this.colorDomain = colorDomain;\n });\n }\n update(_0) {\n return __async(this, arguments, function* ({ seriesRect }) {\n yield this.updateSelections();\n yield this.updateNodes();\n const animationData = this.getAnimationData();\n const resize = this.checkResize(seriesRect);\n if (resize) {\n this.animationState.transition(\"resize\", animationData);\n }\n this.animationState.transition(\"update\", animationData);\n });\n }\n resetAllAnimation(data) {\n var _a;\n const datum = (_a = this.animationResetFns) == null ? void 0 : _a.datum;\n this.ctx.animationManager.stopByAnimationGroupId(this.id);\n if (datum != null) {\n resetMotion(data.datumSelections, datum);\n }\n }\n animateEmptyUpdateReady(data) {\n this.ctx.animationManager.skipCurrentBatch();\n this.resetAllAnimation(data);\n }\n animateWaitingUpdateReady(data) {\n this.ctx.animationManager.skipCurrentBatch();\n this.resetAllAnimation(data);\n }\n animateReadyHighlight(data) {\n var _a;\n const datum = (_a = this.animationResetFns) == null ? void 0 : _a.datum;\n if (datum != null) {\n resetMotion([data], datum);\n }\n }\n animateReadyResize(data) {\n this.resetAllAnimation(data);\n }\n animateClearingUpdateEmpty(data) {\n this.ctx.animationManager.skipCurrentBatch();\n this.resetAllAnimation(data);\n }\n animationTransitionClear() {\n this.animationState.transition(\"clear\", this.getAnimationData());\n }\n getAnimationData() {\n const animationData = {\n datumSelections: [this.groupSelection]\n };\n return animationData;\n }\n isProcessedDataAnimatable() {\n return true;\n }\n checkProcessedDataAnimatable() {\n if (!this.isProcessedDataAnimatable()) {\n this.ctx.animationManager.skipCurrentBatch();\n }\n }\n getLabelData() {\n return [];\n }\n getSeriesDomain() {\n return [NaN, NaN];\n }\n getLegendData(legendType) {\n const { colorKey, colorName, colorRange, visible } = this.properties;\n return legendType === \"gradient\" && colorKey != null && colorRange != null ? [\n {\n legendType: \"gradient\",\n enabled: visible,\n seriesId: this.id,\n colorName,\n colorRange,\n colorDomain: this.colorDomain\n }\n ] : [];\n }\n getDatumIdFromData(node) {\n return `${node.index}`;\n }\n getDatumId(node) {\n return this.getDatumIdFromData(node);\n }\n};\n\n// packages/ag-charts-community/src/chart/series/hierarchy/hierarchySeriesProperties.ts\nvar HierarchySeriesProperties = class extends SeriesProperties {\n constructor() {\n super(...arguments);\n this.childrenKey = \"children\";\n this.fills = Object.values(DEFAULT_FILLS);\n this.strokes = Object.values(DEFAULT_STROKES);\n }\n};\n__decorateClass([\n Validate(STRING)\n], HierarchySeriesProperties.prototype, \"childrenKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], HierarchySeriesProperties.prototype, \"sizeKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], HierarchySeriesProperties.prototype, \"colorKey\", 2);\n__decorateClass([\n Validate(STRING, { optional: true })\n], HierarchySeriesProperties.prototype, \"colorName\", 2);\n__decorateClass([\n Validate(COLOR_STRING_ARRAY)\n], HierarchySeriesProperties.prototype, \"fills\", 2);\n__decorateClass([\n Validate(COLOR_STRING_ARRAY)\n], HierarchySeriesProperties.prototype, \"strokes\", 2);\n__decorateClass([\n Validate(COLOR_STRING_ARRAY, { optional: true })\n], HierarchySeriesProperties.prototype, \"colorRange\", 2);\n\n// packages/ag-charts-community/src/chart/series/topology/lonLatBbox.ts\nvar LonLatBBox = class {\n constructor(lon0, lat0, lon1, lat1) {\n this.lon0 = lon0;\n this.lat0 = lat0;\n this.lon1 = lon1;\n this.lat1 = lat1;\n }\n merge(other) {\n this.lon0 = Math.min(this.lon0, other.lon0);\n this.lat0 = Math.min(this.lat0, other.lat0);\n this.lon1 = Math.max(this.lon1, other.lon1);\n this.lat1 = Math.max(this.lat1, other.lat1);\n }\n};\n\n// packages/ag-charts-community/src/chart/legendDatum.ts\nvar __FORCE_MODULE_DETECTION2 = 0;\nexport {\n AgChart,\n AgCharts,\n AgErrorBarSupportedSeriesTypes,\n AgTooltipPositionType,\n Marker,\n VERSION,\n module_support_exports as _ModuleSupport,\n sparklines_scale_exports as _Scale,\n integrated_charts_scene_exports as _Scene,\n integrated_charts_theme_exports as _Theme,\n sparklines_util_exports as _Util,\n __FORCE_MODULE_DETECTION,\n time_exports as time\n};\n"],"names":[],"sourceRoot":""}