"use strict";const e=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],t=e=>e.replace(/[+/]/g,(e=>"+"===e?"-":"_")).replace(/=+\$/m,""),n="function"==typeof btoa?e=>btoa(e):n=>{if(n.charCodeAt(0)>255)throw new RangeError("The string contains invalid characters.");return((n,r=!1)=>{let o="";for(let t=0,c=n.length;t<c;t+=3){const[r,c,a]=[n[t],n[t+1],n[t+2]],i=r<<16|c<<8|a;o+=e[i>>>18],o+=e[i>>>12&63],o+=void 0!==c?e[i>>>6&63]:"=",o+=void 0!==a?e[63&i]:"="}return r?t(o):o})(Uint8Array.from(n,(e=>e.charCodeAt(0))))};exports.encode=function(e,r=!1){const o=n((e=>unescape(encodeURIComponent(e)))(e));return r?t(o):o};
