export async function S256(e){const r=(new TextEncoder).encode(e),n=new Uint8Array(await crypto.subtle.digest("SHA-256",r));return btoa(n.reduce(((e,r)=>e+String.fromCodePoint(r)),"")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}export function newCodeVerifier(){const e=new Uint8Array(96);crypto.getRandomValues(e);let r="";for(let n=0;n<32;++n)r+=nextFourChars(e[3*n+0],e[3*n+1],e[3*n+2]);return r}function nextFourChars(e,r,n){return[e>>2,(3&e)<<4|r>>4,15&r|(192&n)>>2,63&n].map(unreservedCharacters).join("")}function unreservedCharacters(e){let r;return r=e<26?e+65:e<52?e-26+97:e<62?e-52+48:62===e?30:45,String.fromCharCode(r)}