This commit is contained in:
marlon-erler
2024-07-09 04:43:05 +02:00
parent 53a309b02c
commit 464fc54a0b
6 changed files with 15 additions and 72 deletions
+4 -58
View File
@@ -1,57 +1,5 @@
(() => {
// node_modules/uuid/dist/esm-browser/stringify.js
var byteToHex = [];
for (i = 0; i < 256; ++i) {
byteToHex.push((i + 256).toString(16).slice(1));
}
var i;
function unsafeStringify(arr, offset = 0) {
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
}
// node_modules/uuid/dist/esm-browser/rng.js
var getRandomValues;
var rnds8 = new Uint8Array(16);
function rng() {
if (!getRandomValues) {
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
if (!getRandomValues) {
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
}
}
return getRandomValues(rnds8);
}
// node_modules/uuid/dist/esm-browser/native.js
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
var native_default = {
randomUUID
};
// node_modules/uuid/dist/esm-browser/v4.js
function v4(options, buf, offset) {
if (native_default.randomUUID && !buf && !options) {
return native_default.randomUUID();
}
options = options || {};
var rnds = options.random || (options.rng || rng)();
rnds[6] = rnds[6] & 15 | 64;
rnds[8] = rnds[8] & 63 | 128;
if (buf) {
offset = offset || 0;
for (var i = 0; i < 16; ++i) {
buf[offset + i] = rnds[i];
}
return buf;
}
return unsafeStringify(rnds);
}
var v4_default = v4;
// node_modules/bloatless-react/index.ts
function UUID() {
return v4_default();
}
var State = class {
_value;
_bindings = /* @__PURE__ */ new Set();
@@ -99,10 +47,9 @@
remove(...items) {
items.forEach((item) => {
this.value.delete(item);
const id = item.id;
if (!this.removalHandlers.has(id)) return;
this.removalHandlers.get(id)(item);
this.removalHandlers.delete(id);
if (!this.removalHandlers.has(item)) return;
this.removalHandlers.get(item)(item);
this.removalHandlers.delete(item);
});
this.callSubscriptions();
}
@@ -115,7 +62,7 @@
[...this.value.values()].forEach(handler);
}
handleRemoval(item, handler) {
this.removalHandlers.set(item.id, handler);
this.removalHandlers.set(item, handler);
}
// stringification
toString() {
@@ -425,7 +372,6 @@
this.channel = channel;
this.body = body;
}
id = UUID();
};
var isDisconnected = new State(true);
var mailboxId = restoreState("mailbox-id", "");