import { __esm } from "../../../../../../_virtual/rolldown_runtime.mjs";
import stringify_default, { init_stringify } from "./stringify.mjs";
import parse_default, { init_parse } from "./parse.mjs";

//#region ../../node_modules/samlify/node_modules/uuid/dist/esm-browser/v35.js
function stringToBytes(str) {
	str = unescape(encodeURIComponent(str));
	var bytes = [];
	for (var i = 0; i < str.length; ++i) bytes.push(str.charCodeAt(i));
	return bytes;
}
function v35_default(name, version, hashfunc) {
	function generateUUID(value, namespace, buf, offset) {
		if (typeof value === "string") value = stringToBytes(value);
		if (typeof namespace === "string") namespace = parse_default(namespace);
		if (namespace.length !== 16) throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
		var bytes = new Uint8Array(16 + value.length);
		bytes.set(namespace);
		bytes.set(value, namespace.length);
		bytes = hashfunc(bytes);
		bytes[6] = bytes[6] & 15 | version;
		bytes[8] = bytes[8] & 63 | 128;
		if (buf) {
			offset = offset || 0;
			for (var i = 0; i < 16; ++i) buf[offset + i] = bytes[i];
			return buf;
		}
		return stringify_default(bytes);
	}
	try {
		generateUUID.name = name;
	} catch (err) {}
	generateUUID.DNS = DNS;
	generateUUID.URL = URL;
	return generateUUID;
}
var DNS, URL;
var init_v35 = __esm({ "../../node_modules/samlify/node_modules/uuid/dist/esm-browser/v35.js": (() => {
	init_stringify();
	init_parse();
	DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
	URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
}) });

//#endregion
init_v35();
export { v35_default as default, init_v35 };
//# sourceMappingURL=v35.mjs.map