The code was adapted from https://lnurl.fiatjaf.com/codec/ (bundle.js).
Thanks to @fiatjaf!
reply