"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const native = require("./dist-esm-browser-native.cjs");
const rng = require("./dist-esm-browser-rng.cjs");
const stringify = require("./dist-esm-browser-stringify.cjs");
function v4(options, buf, offset) {
  if (native.default.randomUUID && true && !options) {
    return native.default.randomUUID();
  }
  options = options || {};
  const rnds = options.random ?? options.rng?.() ?? rng.default();
  if (rnds.length < 16) {
    throw new Error("Random bytes length must be >= 16");
  }
  rnds[6] = rnds[6] & 15 | 64;
  rnds[8] = rnds[8] & 63 | 128;
  return stringify.unsafeStringify(rnds);
}
exports.default = v4;
//# sourceMappingURL=dist-esm-browser-v4.cjs.map
