'use strict'; // `any`: the page reads .value, .dataset and .onclick off whatever it looks up, and the // smoke test, not the type checker, is what makes sure a selector exists. const $ = (s: string, r: ParentNode = document): any => r.querySelector(s); const $$ = (s: string, r: ParentNode = document): any[] => [...r.querySelectorAll(s)]; const esc = s => (s??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); // Icons: Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com // License - https://fontawesome.com/license/free (Icons: CC BY 4.0). Embedded as SVG, only the // ones used, so there is no font to download and nothing is fetched from anyone else. Each takes // the button's own colour. To add one, copy the path from svgs/