var e=[];for(let t=0;t<256;++t)e.push((t+256).toString(16).slice(1));function t(t,n=0){return(e[t[n+0]]+e[t[n+1]]+e[t[n+2]]+e[t[n+3]]+`-`+e[t[n+4]]+e[t[n+5]]+`-`+e[t[n+6]]+e[t[n+7]]+`-`+e[t[n+8]]+e[t[n+9]]+`-`+e[t[n+10]]+e[t[n+11]]+e[t[n+12]]+e[t[n+13]]+e[t[n+14]]+e[t[n+15]]).toLowerCase()}var n=new Uint8Array(16);function r(){return crypto.getRandomValues(n)}function i(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():a(e,t,n)}function a(e,n,i){e||={};let a=e.random??e.rng?.()??r();if(a.length<16)throw Error(`Random bytes length must be >= 16`);if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,n){if(i||=0,i<0||i+16>n.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let e=0;e<16;++e)n[i+e]=a[e];return n}return t(a)}export{i as t};