| @@ -1,4 +1,5 @@ | ||
| 1 | +(function() { | |
| 1 | 2 | "use strict"; |
| 2 | 3 | var wp; |
| 3 | 4 | (wp ||= {}).annotations = (() => { |
| 4 | 5 | var __create = Object.create; |
| @@ -353,47 +354,43 @@ | ||
| 353 | 354 | __experimentalRemoveAnnotationsBySource: () => __experimentalRemoveAnnotationsBySource, |
| 354 | 355 | __experimentalUpdateAnnotationRange: () => __experimentalUpdateAnnotationRange |
| 355 | 356 | }); |
| 356 | 357 | |
| 357 | - // node_modules/uuid/dist/esm-browser/rng.js | |
| 358 | - var getRandomValues; | |
| 359 | - var rnds8 = new Uint8Array(16); | |
| 360 | - function rng() { | |
| 361 | - if (!getRandomValues) { | |
| 362 | - getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); | |
| 363 | - if (!getRandomValues) { | |
| 364 | - throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); | |
| 365 | - } | |
| 366 | - } | |
| 367 | - return getRandomValues(rnds8); | |
| 368 | - } | |
| 369 | - | |
| 370 | - // node_modules/uuid/dist/esm-browser/stringify.js | |
| 358 | + // node_modules/uuid/dist/stringify.js | |
| 371 | 359 | var byteToHex = []; |
| 372 | 360 | for (let i = 0; i < 256; ++i) { |
| 373 | 361 | byteToHex.push((i + 256).toString(16).slice(1)); |
| 374 | 362 | } |
| 375 | 363 | function unsafeStringify(arr, offset = 0) { |
| 376 | - 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]]; | |
| 364 | + 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(); | |
| 377 | 365 | } |
| 378 | 366 | |
| 379 | - // node_modules/uuid/dist/esm-browser/native.js | |
| 380 | - var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); | |
| 381 | - var native_default = { | |
| 382 | - randomUUID | |
| 383 | - }; | |
| 367 | + // node_modules/uuid/dist/rng.js | |
| 368 | + var rnds8 = new Uint8Array(16); | |
| 369 | + function rng() { | |
| 370 | + return crypto.getRandomValues(rnds8); | |
| 371 | + } | |
| 384 | 372 | |
| 385 | - // node_modules/uuid/dist/esm-browser/v4.js | |
| 373 | + // node_modules/uuid/dist/v4.js | |
| 386 | 374 | function v4(options, buf, offset) { |
| 387 | - if (native_default.randomUUID && !buf && !options) { | |
| 388 | - return native_default.randomUUID(); | |
| 375 | + if (!buf && !options && crypto.randomUUID) { | |
| 376 | + return crypto.randomUUID(); | |
| 389 | 377 | } |
| 378 | + return _v4(options, buf, offset); | |
| 379 | + } | |
| 380 | + function _v4(options, buf, offset) { | |
| 390 | 381 | options = options || {}; |
| 391 | - const rnds = options.random || (options.rng || rng)(); | |
| 382 | + const rnds = options.random ?? options.rng?.() ?? rng(); | |
| 383 | + if (rnds.length < 16) { | |
| 384 | + throw new Error("Random bytes length must be >= 16"); | |
| 385 | + } | |
| 392 | 386 | rnds[6] = rnds[6] & 15 | 64; |
| 393 | 387 | rnds[8] = rnds[8] & 63 | 128; |
| 394 | 388 | if (buf) { |
| 395 | 389 | offset = offset || 0; |
| 390 | + if (offset < 0 || offset + 16 > buf.length) { | |
| 391 | + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); | |
| 392 | + } | |
| 396 | 393 | for (let i = 0; i < 16; ++i) { |
| 397 | 394 | buf[offset + i] = rnds[i]; |
| 398 | 395 | } |
| 399 | 396 | return buf; |
| @@ -470,6 +467,8 @@ | ||
| 470 | 467 | "core/annotations", |
| 471 | 468 | addAnnotationClassName |
| 472 | 469 | ); |
| 473 | 470 | return __toCommonJS(index_exports); |
| 471 | +})(); | |
| 472 | +(window.wp ||= {}).annotations = wp.annotations; | |
| 474 | 473 | })(); |
| 475 | 474 | //# sourceMappingURL=index.js.map |