implemented frontend including separate message system; started to implement backend

This commit is contained in:
User
2026-03-10 14:48:48 +01:00
committed by Jannik Luboeinski
parent 4275cbd795
commit 78d5352a48
1058 changed files with 101527 additions and 1 deletions

171
yjs-poll/node_modules/lib0/dist/aes-gcm.cjs generated vendored Normal file
View File

@@ -0,0 +1,171 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var encoding = require('./encoding-1a745c43.cjs');
var decoding = require('./decoding-76e75827.cjs');
var webcrypto = require('lib0/webcrypto');
var string = require('./string-fddc5f8b.cjs');
var common = require('./common.cjs');
require('./math-96d5e8c4.cjs');
require('./number-1fb57bba.cjs');
require('./binary-ac8e39e2.cjs');
require('./array-78849c95.cjs');
require('./set-5b47859e.cjs');
require('./error-0c1f634f.cjs');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var webcrypto__namespace = /*#__PURE__*/_interopNamespace(webcrypto);
/**
* AES-GCM is a symmetric key for encryption
*/
/**
* @typedef {Array<'encrypt'|'decrypt'>} Usages
*/
/**
* @type {Usages}
*/
const defaultUsages = ['encrypt', 'decrypt'];
/**
* @param {CryptoKey} key
* @param {Uint8Array<ArrayBuffer>} data
*/
const encrypt = (key, data) => {
const iv = webcrypto__namespace.getRandomValues(new Uint8Array(16)); // 92bit is enough. 128bit is recommended if space is not an issue.
return webcrypto__namespace.subtle.encrypt(
{
name: 'AES-GCM',
iv
},
key,
data
).then(cipher => {
const encryptedDataEncoder = encoding.createEncoder();
// iv may be sent in the clear to the other peers
encoding.writeUint8Array(encryptedDataEncoder, iv);
encoding.writeVarUint8Array(encryptedDataEncoder, new Uint8Array(cipher));
return encoding.toUint8Array(encryptedDataEncoder)
})
};
/**
* @experimental The API is not final!
*
* Decrypt some data using AES-GCM method.
*
* @param {CryptoKey} key
* @param {Uint8Array<ArrayBuffer>} data
* @return {PromiseLike<Uint8Array>} decrypted buffer
*/
const decrypt = (key, data) => {
const dataDecoder = decoding.createDecoder(data);
const iv = decoding.readUint8Array(dataDecoder, 16);
const cipher = decoding.readVarUint8Array(dataDecoder);
return webcrypto__namespace.subtle.decrypt(
{
name: 'AES-GCM',
iv
},
key,
cipher
).then(data => new Uint8Array(data))
};
const aesAlgDef = {
name: 'AES-GCM',
length: 256
};
/**
* @param {any} jwk
* @param {Object} opts
* @param {Usages} [opts.usages]
* @param {boolean} [opts.extractable]
*/
const importKeyJwk = (jwk, { usages, extractable = false } = {}) => {
if (usages == null) {
/* c8 ignore next */
usages = jwk.key_ops || defaultUsages;
}
return webcrypto__namespace.subtle.importKey('jwk', jwk, 'AES-GCM', extractable, /** @type {Usages} */ (usages))
};
/**
* Only suited for importing public keys.
*
* @param {Uint8Array<ArrayBuffer>} raw
* @param {Object} opts
* @param {Usages} [opts.usages]
* @param {boolean} [opts.extractable]
*/
const importKeyRaw = (raw, { usages = defaultUsages, extractable = false } = {}) =>
webcrypto__namespace.subtle.importKey('raw', raw, aesAlgDef, extractable, /** @type {Usages} */ (usages));
/**
* @param {Uint8Array<ArrayBuffer> | string} data
*/
/* c8 ignore next */
const toBinary = data => typeof data === 'string' ? string.encodeUtf8(data) : data;
/**
* @experimental The API is not final!
*
* Derive an symmetric key using the Password-Based-Key-Derivation-Function-2.
*
* @param {Uint8Array<ArrayBuffer>|string} secret
* @param {Uint8Array<ArrayBuffer>|string} salt
* @param {Object} opts
* @param {boolean} [opts.extractable]
* @param {Usages} [opts.usages]
*/
const deriveKey = (secret, salt, { extractable = false, usages = defaultUsages } = {}) =>
webcrypto__namespace.subtle.importKey(
'raw',
toBinary(secret),
'PBKDF2',
false,
['deriveKey']
).then(keyMaterial =>
webcrypto__namespace.subtle.deriveKey(
{
name: 'PBKDF2',
salt: toBinary(salt), // NIST recommends at least 64 bits
iterations: 600000, // OWASP recommends 600k iterations
hash: 'SHA-256'
},
keyMaterial,
aesAlgDef,
extractable,
usages
)
);
exports.exportKeyJwk = common.exportKeyJwk;
exports.exportKeyRaw = common.exportKeyRaw;
exports.decrypt = decrypt;
exports.deriveKey = deriveKey;
exports.encrypt = encrypt;
exports.importKeyJwk = importKeyJwk;
exports.importKeyRaw = importKeyRaw;
//# sourceMappingURL=aes-gcm.cjs.map

1
yjs-poll/node_modules/lib0/dist/aes-gcm.cjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

260
yjs-poll/node_modules/lib0/dist/array-78849c95.cjs generated vendored Normal file
View File

@@ -0,0 +1,260 @@
'use strict';
var set = require('./set-5b47859e.cjs');
/**
* Utility module to work with Arrays.
*
* @module array
*/
/**
* Return the last element of an array. The element must exist
*
* @template L
* @param {ArrayLike<L>} arr
* @return {L}
*/
const last = arr => arr[arr.length - 1];
/**
* @template C
* @return {Array<C>}
*/
const create = () => /** @type {Array<C>} */ ([]);
/**
* @template D
* @param {Array<D>} a
* @return {Array<D>}
*/
const copy = a => /** @type {Array<D>} */ (a.slice());
/**
* Append elements from src to dest
*
* @template M
* @param {Array<M>} dest
* @param {Array<M>} src
*/
const appendTo = (dest, src) => {
for (let i = 0; i < src.length; i++) {
dest.push(src[i]);
}
};
/**
* Transforms something array-like to an actual Array.
*
* @function
* @template T
* @param {ArrayLike<T>|Iterable<T>} arraylike
* @return {T}
*/
const from = Array.from;
/**
* True iff condition holds on every element in the Array.
*
* @function
* @template {ArrayLike<any>} ARR
*
* @param {ARR} arr
* @param {ARR extends ArrayLike<infer S> ? ((value:S, index:number, arr:ARR) => boolean) : any} f
* @return {boolean}
*/
const every = (arr, f) => {
for (let i = 0; i < arr.length; i++) {
if (!f(arr[i], i, arr)) {
return false
}
}
return true
};
/**
* True iff condition holds on some element in the Array.
*
* @function
* @template {ArrayLike<any>} ARR
*
* @param {ARR} arr
* @param {ARR extends ArrayLike<infer S> ? ((value:S, index:number, arr:ARR) => boolean) : never} f
* @return {boolean}
*/
const some = (arr, f) => {
for (let i = 0; i < arr.length; i++) {
if (f(arr[i], i, arr)) {
return true
}
}
return false
};
/**
* @template ELEM
*
* @param {ArrayLike<ELEM>} a
* @param {ArrayLike<ELEM>} b
* @return {boolean}
*/
const equalFlat = (a, b) => a.length === b.length && every(a, (item, index) => item === b[index]);
/**
* @template ELEM
* @param {Array<Array<ELEM>>} arr
* @return {Array<ELEM>}
*/
const flatten = arr => fold(arr, /** @type {Array<ELEM>} */ ([]), (acc, val) => acc.concat(val));
/**
* @template T
* @param {number} len
* @param {function(number, Array<T>):T} f
* @return {Array<T>}
*/
const unfold = (len, f) => {
const array = new Array(len);
for (let i = 0; i < len; i++) {
array[i] = f(i, array);
}
return array
};
/**
* @template T
* @template RESULT
* @param {Array<T>} arr
* @param {RESULT} seed
* @param {function(RESULT, T, number):RESULT} folder
*/
const fold = (arr, seed, folder) => arr.reduce(folder, seed);
const isArray = Array.isArray;
/**
* @template T
* @param {Array<T>} arr
* @return {Array<T>}
*/
const unique = arr => from(set.from(arr));
/**
* @template T
* @template M
* @param {ArrayLike<T>} arr
* @param {function(T):M} mapper
* @return {Array<T>}
*/
const uniqueBy = (arr, mapper) => {
/**
* @type {Set<M>}
*/
const happened = set.create();
/**
* @type {Array<T>}
*/
const result = [];
for (let i = 0; i < arr.length; i++) {
const el = arr[i];
const mapped = mapper(el);
if (!happened.has(mapped)) {
happened.add(mapped);
result.push(el);
}
}
return result
};
/**
* @template {ArrayLike<any>} ARR
* @template {function(ARR extends ArrayLike<infer T> ? T : never, number, ARR):any} MAPPER
* @param {ARR} arr
* @param {MAPPER} mapper
* @return {Array<MAPPER extends function(...any): infer M ? M : never>}
*/
const map = (arr, mapper) => {
/**
* @type {Array<any>}
*/
const res = Array(arr.length);
for (let i = 0; i < arr.length; i++) {
res[i] = mapper(/** @type {any} */ (arr[i]), i, /** @type {any} */ (arr));
}
return /** @type {any} */ (res)
};
/**
* This function bubble-sorts a single item to the correct position. The sort happens in-place and
* might be useful to ensure that a single item is at the correct position in an otherwise sorted
* array.
*
* @example
* const arr = [3, 2, 5]
* arr.sort((a, b) => a - b)
* arr // => [2, 3, 5]
* arr.splice(1, 0, 7)
* array.bubbleSortItem(arr, 1, (a, b) => a - b)
* arr // => [2, 3, 5, 7]
*
* @template T
* @param {Array<T>} arr
* @param {number} i
* @param {(a:T,b:T) => number} compareFn
*/
const bubblesortItem = (arr, i, compareFn) => {
const n = arr[i];
let j = i;
// try to sort to the right
while (j + 1 < arr.length && compareFn(n, arr[j + 1]) > 0) {
arr[j] = arr[j + 1];
arr[++j] = n;
}
if (i === j && j > 0) { // no change yet
// sort to the left
while (j > 0 && compareFn(arr[j - 1], n) > 0) {
arr[j] = arr[j - 1];
arr[--j] = n;
}
}
return j
};
var array = /*#__PURE__*/Object.freeze({
__proto__: null,
last: last,
create: create,
copy: copy,
appendTo: appendTo,
from: from,
every: every,
some: some,
equalFlat: equalFlat,
flatten: flatten,
unfold: unfold,
fold: fold,
isArray: isArray,
unique: unique,
uniqueBy: uniqueBy,
map: map,
bubblesortItem: bubblesortItem
});
exports.appendTo = appendTo;
exports.array = array;
exports.bubblesortItem = bubblesortItem;
exports.copy = copy;
exports.create = create;
exports.equalFlat = equalFlat;
exports.every = every;
exports.flatten = flatten;
exports.fold = fold;
exports.from = from;
exports.isArray = isArray;
exports.last = last;
exports.map = map;
exports.some = some;
exports.unfold = unfold;
exports.unique = unique;
exports.uniqueBy = uniqueBy;
//# sourceMappingURL=array-78849c95.cjs.map

File diff suppressed because one or more lines are too long

26
yjs-poll/node_modules/lib0/dist/array.cjs generated vendored Normal file
View File

@@ -0,0 +1,26 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
require('./set-5b47859e.cjs');
var array = require('./array-78849c95.cjs');
exports.appendTo = array.appendTo;
exports.bubblesortItem = array.bubblesortItem;
exports.copy = array.copy;
exports.create = array.create;
exports.equalFlat = array.equalFlat;
exports.every = array.every;
exports.flatten = array.flatten;
exports.fold = array.fold;
exports.from = array.from;
exports.isArray = array.isArray;
exports.last = array.last;
exports.map = array.map;
exports.some = array.some;
exports.unfold = array.unfold;
exports.unique = array.unique;
exports.uniqueBy = array.uniqueBy;
//# sourceMappingURL=array.cjs.map

1
yjs-poll/node_modules/lib0/dist/array.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"array.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}

30
yjs-poll/node_modules/lib0/dist/array.d.ts generated vendored Normal file
View File

@@ -0,0 +1,30 @@
export function last<L>(arr: ArrayLike<L>): L;
export function create<C>(): Array<C>;
export function copy<D>(a: Array<D>): Array<D>;
export function appendTo<M>(dest: Array<M>, src: Array<M>): void;
/**
* Transforms something array-like to an actual Array.
*
* @function
* @template T
* @param {ArrayLike<T>|Iterable<T>} arraylike
* @return {T}
*/
export const from: {
<T_1>(arrayLike: ArrayLike<T_1>): T_1[];
<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
<T_1>(iterable: Iterable<T_1> | ArrayLike<T_1>): T_1[];
<T_1, U>(iterable: Iterable<T_1> | ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
};
export function every<ARR extends ArrayLike<any>>(arr: ARR, f: ARR extends ArrayLike<infer S> ? ((value: S, index: number, arr: ARR) => boolean) : any): boolean;
export function some<ARR extends ArrayLike<any>>(arr: ARR, f: ARR extends ArrayLike<infer S> ? ((value: S, index: number, arr: ARR) => boolean) : never): boolean;
export function equalFlat<ELEM>(a: ArrayLike<ELEM>, b: ArrayLike<ELEM>): boolean;
export function flatten<ELEM>(arr: Array<Array<ELEM>>): Array<ELEM>;
export function unfold<T_1>(len: number, f: (arg0: number, arg1: Array<T_1>) => T_1): Array<T_1>;
export function fold<T_1, RESULT>(arr: Array<T_1>, seed: RESULT, folder: (arg0: RESULT, arg1: T_1, arg2: number) => RESULT): RESULT;
export const isArray: (arg: any) => arg is any[];
export function unique<T_1>(arr: Array<T_1>): Array<T_1>;
export function uniqueBy<T_1, M>(arr: ArrayLike<T_1>, mapper: (arg0: T_1) => M): Array<T_1>;
export function map<ARR extends ArrayLike<any>, MAPPER extends (arg0: ARR extends ArrayLike<infer T_1> ? T_1 : never, arg1: number, arg2: ARR) => any>(arr: ARR, mapper: MAPPER): Array<MAPPER extends (...args: any[]) => infer M ? M : never>;
export function bubblesortItem<T_1>(arr: Array<T_1>, i: number, compareFn: (a: T_1, b: T_1) => number): number;
//# sourceMappingURL=array.d.ts.map

1
yjs-poll/node_modules/lib0/dist/array.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../array.js"],"names":[],"mappings":"AAeO,qBAJM,CAAC,OACH,SAAS,CAAC,CAAC,CAAC,GACX,CAAC,CAEiC;AAMvC,uBAHM,CAAC,KACF,KAAK,CAAC,CAAC,CAAC,CAEoC;AAOjD,qBAJM,CAAC,KACH,KAAK,CAAC,CAAC,CAAC,GACP,KAAK,CAAC,CAAC,CAAC,CAEwC;AASrD,yBAJM,CAAC,QACH,KAAK,CAAC,CAAC,CAAC,OACR,KAAK,CAAC,CAAC,CAAC,QAMlB;AAED;;;;;;;GAOG;AACH;;;;;EAA8B;AAYvB,sBANuB,GAAG,SAAnB,SAAS,CAAC,GAAG,CAAE,OAElB,GAAG,KACH,GAAG,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAC,CAAC,EAAE,KAAK,EAAC,MAAM,EAAE,GAAG,EAAC,GAAG,KAAK,OAAO,CAAC,GAAG,GAAG,GACnF,OAAO,CASlB;AAYM,qBANuB,GAAG,SAAnB,SAAS,CAAC,GAAG,CAAE,OAElB,GAAG,KACH,GAAG,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAC,CAAC,EAAE,KAAK,EAAC,MAAM,EAAE,GAAG,EAAC,GAAG,KAAK,OAAO,CAAC,GAAG,KAAK,GACrF,OAAO,CASlB;AASM,0BANM,IAAI,KAEN,SAAS,CAAC,IAAI,CAAC,KACf,SAAS,CAAC,IAAI,CAAC,GACd,OAAO,CAEqF;AAOjG,wBAJM,IAAI,OACN,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GACjB,KAAK,CAAC,IAAI,CAAC,CAEgF;AAQhG,iCAJI,MAAM,KACN,CAAS,IAAM,EAAN,MAAM,EAAE,IAAQ,EAAR,KAAK,CAAC,GAAC,CAAC,KAAE,GAAC,GAC3B,KAAK,CAAC,GAAC,CAAC,CAQnB;AASM,0BALM,MAAM,OACR,KAAK,CAAC,GAAC,CAAC,QACR,MAAM,UACN,CAAS,IAAM,EAAN,MAAM,EAAE,IAAC,EAAD,GAAC,EAAE,IAAM,EAAN,MAAM,KAAE,MAAM,UAEsB;AAEnE,iDAAoC;AAO7B,iCAHI,KAAK,CAAC,GAAC,CAAC,GACP,KAAK,CAAC,GAAC,CAAC,CAE4B;AASzC,8BALM,CAAC,OACH,SAAS,CAAC,GAAC,CAAC,UACZ,CAAS,IAAC,EAAD,GAAC,KAAE,CAAC,GACZ,KAAK,CAAC,GAAC,CAAC,CAoBnB;AASM,oBANuB,GAAG,SAAnB,SAAS,CAAC,GAAG,CAAE,EACwD,MAAM,SAA9E,CAAU,IAA0C,EAA1C,GAAG,SAAS,SAAS,CAAC,MAAM,GAAC,CAAC,GAAG,GAAC,GAAG,KAAK,EAAE,IAAM,EAAN,MAAM,EAAE,IAAG,EAAH,GAAG,KAAE,GAAI,OACzE,GAAG,UACH,MAAM,GACL,KAAK,CAAC,MAAM,SAAS,IAAS,IAAM,EAAH,GAAG,EAAA,KAAG,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAWtE;AAoBM,yCAJI,KAAK,CAAC,GAAC,CAAC,KACR,MAAM,aACN,CAAC,CAAC,EAAC,GAAC,EAAC,CAAC,EAAC,GAAC,KAAK,MAAM,UAkB7B"}

13
yjs-poll/node_modules/lib0/dist/array.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
export function testIsarrayPerformance(_tc: t.TestCase): void;
export function testAppend(_tc: t.TestCase): void;
export function testBasic(_tc: t.TestCase): void;
export function testflatten(_tc: t.TestCase): void;
export function testFolding(_tc: t.TestCase): void;
export function testEvery(_tc: t.TestCase): void;
export function testIsArray(_tc: t.TestCase): void;
export function testUnique(_tc: t.TestCase): void;
export function testBubblesortItemEdgeCases(tc: t.TestCase): void;
export function testRepeatBubblesortItem(tc: t.TestCase): void;
export function testRepeatBubblesort(tc: t.TestCase): void;
import * as t from './testing.js';
//# sourceMappingURL=array.test.d.ts.map

1
yjs-poll/node_modules/lib0/dist/array.test.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"array.test.d.ts","sourceRoot":"","sources":["../array.test.js"],"names":[],"mappings":"AAOO,4CAFI,CAAC,CAAC,QAAQ,QAkCpB;AAKM,gCAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,+BAFI,CAAC,CAAC,QAAQ,QAMpB;AAKM,iCAFI,CAAC,CAAC,QAAQ,QAKpB;AAKM,iCAFI,CAAC,CAAC,QAAQ,QAkBpB;AAKM,+BAFI,CAAC,CAAC,QAAQ,QAQpB;AAKM,iCAFI,CAAC,CAAC,QAAQ,QASpB;AAKM,gCAFI,CAAC,CAAC,QAAQ,QAOpB;AAKM,gDAFI,CAAC,CAAC,QAAQ,QAOpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,yCAFI,CAAC,CAAC,QAAQ,QASpB;mBA1JkB,cAAc"}

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
export {};
//# sourceMappingURL=0ecdsa-generate-keypair.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"0ecdsa-generate-keypair.d.ts","sourceRoot":"","sources":["../../bin/0ecdsa-generate-keypair.js"],"names":[],"mappings":""}

3
yjs-poll/node_modules/lib0/dist/bin/0serve.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
export {};
//# sourceMappingURL=0serve.d.ts.map

1
yjs-poll/node_modules/lib0/dist/bin/0serve.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"0serve.d.ts","sourceRoot":"","sources":["../../bin/0serve.js"],"names":[],"mappings":""}

3
yjs-poll/node_modules/lib0/dist/bin/gendocs.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
export {};
//# sourceMappingURL=gendocs.d.ts.map

1
yjs-poll/node_modules/lib0/dist/bin/gendocs.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"gendocs.d.ts","sourceRoot":"","sources":["../../bin/gendocs.js"],"names":[],"mappings":""}

3
yjs-poll/node_modules/lib0/dist/bin/gentesthtml.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env node
export {};
//# sourceMappingURL=gentesthtml.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"gentesthtml.d.ts","sourceRoot":"","sources":["../../bin/gentesthtml.js"],"names":[],"mappings":""}

229
yjs-poll/node_modules/lib0/dist/binary-ac8e39e2.cjs generated vendored Normal file
View File

@@ -0,0 +1,229 @@
'use strict';
/* eslint-env browser */
/**
* Binary data constants.
*
* @module binary
*/
/**
* n-th bit activated.
*
* @type {number}
*/
const BIT1 = 1;
const BIT2 = 2;
const BIT3 = 4;
const BIT4 = 8;
const BIT5 = 16;
const BIT6 = 32;
const BIT7 = 64;
const BIT8 = 128;
const BIT9 = 256;
const BIT10 = 512;
const BIT11 = 1024;
const BIT12 = 2048;
const BIT13 = 4096;
const BIT14 = 8192;
const BIT15 = 16384;
const BIT16 = 32768;
const BIT17 = 65536;
const BIT18 = 1 << 17;
const BIT19 = 1 << 18;
const BIT20 = 1 << 19;
const BIT21 = 1 << 20;
const BIT22 = 1 << 21;
const BIT23 = 1 << 22;
const BIT24 = 1 << 23;
const BIT25 = 1 << 24;
const BIT26 = 1 << 25;
const BIT27 = 1 << 26;
const BIT28 = 1 << 27;
const BIT29 = 1 << 28;
const BIT30 = 1 << 29;
const BIT31 = 1 << 30;
const BIT32 = 1 << 31;
/**
* First n bits activated.
*
* @type {number}
*/
const BITS0 = 0;
const BITS1 = 1;
const BITS2 = 3;
const BITS3 = 7;
const BITS4 = 15;
const BITS5 = 31;
const BITS6 = 63;
const BITS7 = 127;
const BITS8 = 255;
const BITS9 = 511;
const BITS10 = 1023;
const BITS11 = 2047;
const BITS12 = 4095;
const BITS13 = 8191;
const BITS14 = 16383;
const BITS15 = 32767;
const BITS16 = 65535;
const BITS17 = BIT18 - 1;
const BITS18 = BIT19 - 1;
const BITS19 = BIT20 - 1;
const BITS20 = BIT21 - 1;
const BITS21 = BIT22 - 1;
const BITS22 = BIT23 - 1;
const BITS23 = BIT24 - 1;
const BITS24 = BIT25 - 1;
const BITS25 = BIT26 - 1;
const BITS26 = BIT27 - 1;
const BITS27 = BIT28 - 1;
const BITS28 = BIT29 - 1;
const BITS29 = BIT30 - 1;
const BITS30 = BIT31 - 1;
/**
* @type {number}
*/
const BITS31 = 0x7FFFFFFF;
/**
* @type {number}
*/
const BITS32 = 0xFFFFFFFF;
var binary = /*#__PURE__*/Object.freeze({
__proto__: null,
BIT1: BIT1,
BIT2: BIT2,
BIT3: BIT3,
BIT4: BIT4,
BIT5: BIT5,
BIT6: BIT6,
BIT7: BIT7,
BIT8: BIT8,
BIT9: BIT9,
BIT10: BIT10,
BIT11: BIT11,
BIT12: BIT12,
BIT13: BIT13,
BIT14: BIT14,
BIT15: BIT15,
BIT16: BIT16,
BIT17: BIT17,
BIT18: BIT18,
BIT19: BIT19,
BIT20: BIT20,
BIT21: BIT21,
BIT22: BIT22,
BIT23: BIT23,
BIT24: BIT24,
BIT25: BIT25,
BIT26: BIT26,
BIT27: BIT27,
BIT28: BIT28,
BIT29: BIT29,
BIT30: BIT30,
BIT31: BIT31,
BIT32: BIT32,
BITS0: BITS0,
BITS1: BITS1,
BITS2: BITS2,
BITS3: BITS3,
BITS4: BITS4,
BITS5: BITS5,
BITS6: BITS6,
BITS7: BITS7,
BITS8: BITS8,
BITS9: BITS9,
BITS10: BITS10,
BITS11: BITS11,
BITS12: BITS12,
BITS13: BITS13,
BITS14: BITS14,
BITS15: BITS15,
BITS16: BITS16,
BITS17: BITS17,
BITS18: BITS18,
BITS19: BITS19,
BITS20: BITS20,
BITS21: BITS21,
BITS22: BITS22,
BITS23: BITS23,
BITS24: BITS24,
BITS25: BITS25,
BITS26: BITS26,
BITS27: BITS27,
BITS28: BITS28,
BITS29: BITS29,
BITS30: BITS30,
BITS31: BITS31,
BITS32: BITS32
});
exports.BIT1 = BIT1;
exports.BIT10 = BIT10;
exports.BIT11 = BIT11;
exports.BIT12 = BIT12;
exports.BIT13 = BIT13;
exports.BIT14 = BIT14;
exports.BIT15 = BIT15;
exports.BIT16 = BIT16;
exports.BIT17 = BIT17;
exports.BIT18 = BIT18;
exports.BIT19 = BIT19;
exports.BIT2 = BIT2;
exports.BIT20 = BIT20;
exports.BIT21 = BIT21;
exports.BIT22 = BIT22;
exports.BIT23 = BIT23;
exports.BIT24 = BIT24;
exports.BIT25 = BIT25;
exports.BIT26 = BIT26;
exports.BIT27 = BIT27;
exports.BIT28 = BIT28;
exports.BIT29 = BIT29;
exports.BIT3 = BIT3;
exports.BIT30 = BIT30;
exports.BIT31 = BIT31;
exports.BIT32 = BIT32;
exports.BIT4 = BIT4;
exports.BIT5 = BIT5;
exports.BIT6 = BIT6;
exports.BIT7 = BIT7;
exports.BIT8 = BIT8;
exports.BIT9 = BIT9;
exports.BITS0 = BITS0;
exports.BITS1 = BITS1;
exports.BITS10 = BITS10;
exports.BITS11 = BITS11;
exports.BITS12 = BITS12;
exports.BITS13 = BITS13;
exports.BITS14 = BITS14;
exports.BITS15 = BITS15;
exports.BITS16 = BITS16;
exports.BITS17 = BITS17;
exports.BITS18 = BITS18;
exports.BITS19 = BITS19;
exports.BITS2 = BITS2;
exports.BITS20 = BITS20;
exports.BITS21 = BITS21;
exports.BITS22 = BITS22;
exports.BITS23 = BITS23;
exports.BITS24 = BITS24;
exports.BITS25 = BITS25;
exports.BITS26 = BITS26;
exports.BITS27 = BITS27;
exports.BITS28 = BITS28;
exports.BITS29 = BITS29;
exports.BITS3 = BITS3;
exports.BITS30 = BITS30;
exports.BITS31 = BITS31;
exports.BITS32 = BITS32;
exports.BITS4 = BITS4;
exports.BITS5 = BITS5;
exports.BITS6 = BITS6;
exports.BITS7 = BITS7;
exports.BITS8 = BITS8;
exports.BITS9 = BITS9;
exports.binary = binary;
//# sourceMappingURL=binary-ac8e39e2.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"binary-ac8e39e2.cjs","sources":["../binary.js"],"sourcesContent":["/* eslint-env browser */\n\n/**\n * Binary data constants.\n *\n * @module binary\n */\n\n/**\n * n-th bit activated.\n *\n * @type {number}\n */\nexport const BIT1 = 1\nexport const BIT2 = 2\nexport const BIT3 = 4\nexport const BIT4 = 8\nexport const BIT5 = 16\nexport const BIT6 = 32\nexport const BIT7 = 64\nexport const BIT8 = 128\nexport const BIT9 = 256\nexport const BIT10 = 512\nexport const BIT11 = 1024\nexport const BIT12 = 2048\nexport const BIT13 = 4096\nexport const BIT14 = 8192\nexport const BIT15 = 16384\nexport const BIT16 = 32768\nexport const BIT17 = 65536\nexport const BIT18 = 1 << 17\nexport const BIT19 = 1 << 18\nexport const BIT20 = 1 << 19\nexport const BIT21 = 1 << 20\nexport const BIT22 = 1 << 21\nexport const BIT23 = 1 << 22\nexport const BIT24 = 1 << 23\nexport const BIT25 = 1 << 24\nexport const BIT26 = 1 << 25\nexport const BIT27 = 1 << 26\nexport const BIT28 = 1 << 27\nexport const BIT29 = 1 << 28\nexport const BIT30 = 1 << 29\nexport const BIT31 = 1 << 30\nexport const BIT32 = 1 << 31\n\n/**\n * First n bits activated.\n *\n * @type {number}\n */\nexport const BITS0 = 0\nexport const BITS1 = 1\nexport const BITS2 = 3\nexport const BITS3 = 7\nexport const BITS4 = 15\nexport const BITS5 = 31\nexport const BITS6 = 63\nexport const BITS7 = 127\nexport const BITS8 = 255\nexport const BITS9 = 511\nexport const BITS10 = 1023\nexport const BITS11 = 2047\nexport const BITS12 = 4095\nexport const BITS13 = 8191\nexport const BITS14 = 16383\nexport const BITS15 = 32767\nexport const BITS16 = 65535\nexport const BITS17 = BIT18 - 1\nexport const BITS18 = BIT19 - 1\nexport const BITS19 = BIT20 - 1\nexport const BITS20 = BIT21 - 1\nexport const BITS21 = BIT22 - 1\nexport const BITS22 = BIT23 - 1\nexport const BITS23 = BIT24 - 1\nexport const BITS24 = BIT25 - 1\nexport const BITS25 = BIT26 - 1\nexport const BITS26 = BIT27 - 1\nexport const BITS27 = BIT28 - 1\nexport const BITS28 = BIT29 - 1\nexport const BITS29 = BIT30 - 1\nexport const BITS30 = BIT31 - 1\n/**\n * @type {number}\n */\nexport const BITS31 = 0x7FFFFFFF\n/**\n * @type {number}\n */\nexport const BITS32 = 0xFFFFFFFF\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAG,EAAC;AACT,MAAC,IAAI,GAAG,EAAC;AACT,MAAC,IAAI,GAAG,EAAC;AACT,MAAC,IAAI,GAAG,EAAC;AACT,MAAC,IAAI,GAAG,GAAE;AACV,MAAC,IAAI,GAAG,GAAE;AACV,MAAC,IAAI,GAAG,GAAE;AACV,MAAC,IAAI,GAAG,IAAG;AACX,MAAC,IAAI,GAAG,IAAG;AACX,MAAC,KAAK,GAAG,IAAG;AACZ,MAAC,KAAK,GAAG,KAAI;AACb,MAAC,KAAK,GAAG,KAAI;AACb,MAAC,KAAK,GAAG,KAAI;AACb,MAAC,KAAK,GAAG,KAAI;AACb,MAAC,KAAK,GAAG,MAAK;AACd,MAAC,KAAK,GAAG,MAAK;AACd,MAAC,KAAK,GAAG,MAAK;AACd,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAChB,MAAC,KAAK,GAAG,CAAC,IAAI,GAAE;AAC5B;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,KAAK,GAAG,EAAC;AACV,MAAC,KAAK,GAAG,EAAC;AACV,MAAC,KAAK,GAAG,EAAC;AACV,MAAC,KAAK,GAAG,EAAC;AACV,MAAC,KAAK,GAAG,GAAE;AACX,MAAC,KAAK,GAAG,GAAE;AACX,MAAC,KAAK,GAAG,GAAE;AACX,MAAC,KAAK,GAAG,IAAG;AACZ,MAAC,KAAK,GAAG,IAAG;AACZ,MAAC,KAAK,GAAG,IAAG;AACZ,MAAC,MAAM,GAAG,KAAI;AACd,MAAC,MAAM,GAAG,KAAI;AACd,MAAC,MAAM,GAAG,KAAI;AACd,MAAC,MAAM,GAAG,KAAI;AACd,MAAC,MAAM,GAAG,MAAK;AACf,MAAC,MAAM,GAAG,MAAK;AACf,MAAC,MAAM,GAAG,MAAK;AACf,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AACnB,MAAC,MAAM,GAAG,KAAK,GAAG,EAAC;AAC/B;AACA;AACA;AACY,MAAC,MAAM,GAAG,WAAU;AAChC;AACA;AACA;AACY,MAAC,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

74
yjs-poll/node_modules/lib0/dist/binary.cjs generated vendored Normal file
View File

@@ -0,0 +1,74 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var binary = require('./binary-ac8e39e2.cjs');
exports.BIT1 = binary.BIT1;
exports.BIT10 = binary.BIT10;
exports.BIT11 = binary.BIT11;
exports.BIT12 = binary.BIT12;
exports.BIT13 = binary.BIT13;
exports.BIT14 = binary.BIT14;
exports.BIT15 = binary.BIT15;
exports.BIT16 = binary.BIT16;
exports.BIT17 = binary.BIT17;
exports.BIT18 = binary.BIT18;
exports.BIT19 = binary.BIT19;
exports.BIT2 = binary.BIT2;
exports.BIT20 = binary.BIT20;
exports.BIT21 = binary.BIT21;
exports.BIT22 = binary.BIT22;
exports.BIT23 = binary.BIT23;
exports.BIT24 = binary.BIT24;
exports.BIT25 = binary.BIT25;
exports.BIT26 = binary.BIT26;
exports.BIT27 = binary.BIT27;
exports.BIT28 = binary.BIT28;
exports.BIT29 = binary.BIT29;
exports.BIT3 = binary.BIT3;
exports.BIT30 = binary.BIT30;
exports.BIT31 = binary.BIT31;
exports.BIT32 = binary.BIT32;
exports.BIT4 = binary.BIT4;
exports.BIT5 = binary.BIT5;
exports.BIT6 = binary.BIT6;
exports.BIT7 = binary.BIT7;
exports.BIT8 = binary.BIT8;
exports.BIT9 = binary.BIT9;
exports.BITS0 = binary.BITS0;
exports.BITS1 = binary.BITS1;
exports.BITS10 = binary.BITS10;
exports.BITS11 = binary.BITS11;
exports.BITS12 = binary.BITS12;
exports.BITS13 = binary.BITS13;
exports.BITS14 = binary.BITS14;
exports.BITS15 = binary.BITS15;
exports.BITS16 = binary.BITS16;
exports.BITS17 = binary.BITS17;
exports.BITS18 = binary.BITS18;
exports.BITS19 = binary.BITS19;
exports.BITS2 = binary.BITS2;
exports.BITS20 = binary.BITS20;
exports.BITS21 = binary.BITS21;
exports.BITS22 = binary.BITS22;
exports.BITS23 = binary.BITS23;
exports.BITS24 = binary.BITS24;
exports.BITS25 = binary.BITS25;
exports.BITS26 = binary.BITS26;
exports.BITS27 = binary.BITS27;
exports.BITS28 = binary.BITS28;
exports.BITS29 = binary.BITS29;
exports.BITS3 = binary.BITS3;
exports.BITS30 = binary.BITS30;
exports.BITS31 = binary.BITS31;
exports.BITS32 = binary.BITS32;
exports.BITS4 = binary.BITS4;
exports.BITS5 = binary.BITS5;
exports.BITS6 = binary.BITS6;
exports.BITS7 = binary.BITS7;
exports.BITS8 = binary.BITS8;
exports.BITS9 = binary.BITS9;
//# sourceMappingURL=binary.cjs.map

1
yjs-poll/node_modules/lib0/dist/binary.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"binary.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

87
yjs-poll/node_modules/lib0/dist/binary.d.ts generated vendored Normal file
View File

@@ -0,0 +1,87 @@
/**
* Binary data constants.
*
* @module binary
*/
/**
* n-th bit activated.
*
* @type {number}
*/
export const BIT1: number;
export const BIT2: 2;
export const BIT3: 4;
export const BIT4: 8;
export const BIT5: 16;
export const BIT6: 32;
export const BIT7: 64;
export const BIT8: 128;
export const BIT9: 256;
export const BIT10: 512;
export const BIT11: 1024;
export const BIT12: 2048;
export const BIT13: 4096;
export const BIT14: 8192;
export const BIT15: 16384;
export const BIT16: 32768;
export const BIT17: 65536;
export const BIT18: number;
export const BIT19: number;
export const BIT20: number;
export const BIT21: number;
export const BIT22: number;
export const BIT23: number;
export const BIT24: number;
export const BIT25: number;
export const BIT26: number;
export const BIT27: number;
export const BIT28: number;
export const BIT29: number;
export const BIT30: number;
export const BIT31: number;
export const BIT32: number;
/**
* First n bits activated.
*
* @type {number}
*/
export const BITS0: number;
export const BITS1: 1;
export const BITS2: 3;
export const BITS3: 7;
export const BITS4: 15;
export const BITS5: 31;
export const BITS6: 63;
export const BITS7: 127;
export const BITS8: 255;
export const BITS9: 511;
export const BITS10: 1023;
export const BITS11: 2047;
export const BITS12: 4095;
export const BITS13: 8191;
export const BITS14: 16383;
export const BITS15: 32767;
export const BITS16: 65535;
export const BITS17: number;
export const BITS18: number;
export const BITS19: number;
export const BITS20: number;
export const BITS21: number;
export const BITS22: number;
export const BITS23: number;
export const BITS24: number;
export const BITS25: number;
export const BITS26: number;
export const BITS27: number;
export const BITS28: number;
export const BITS29: number;
export const BITS30: number;
/**
* @type {number}
*/
export const BITS31: number;
/**
* @type {number}
*/
export const BITS32: number;
//# sourceMappingURL=binary.d.ts.map

1
yjs-poll/node_modules/lib0/dist/binary.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../binary.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;GAIG;AACH,mBAFU,MAAM,CAEK;AACrB,mBAAoB,CAAC,CAAA;AACrB,mBAAoB,CAAC,CAAA;AACrB,mBAAoB,CAAC,CAAA;AACrB,mBAAoB,EAAE,CAAA;AACtB,mBAAoB,EAAE,CAAA;AACtB,mBAAoB,EAAE,CAAA;AACtB,mBAAoB,GAAG,CAAA;AACvB,mBAAoB,GAAG,CAAA;AACvB,oBAAqB,GAAG,CAAA;AACxB,oBAAqB,IAAI,CAAA;AACzB,oBAAqB,IAAI,CAAA;AACzB,oBAAqB,IAAI,CAAA;AACzB,oBAAqB,IAAI,CAAA;AACzB,oBAAqB,KAAK,CAAA;AAC1B,oBAAqB,KAAK,CAAA;AAC1B,oBAAqB,KAAK,CAAA;AAC1B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAC5B,2BAA4B;AAE5B;;;;GAIG;AACH,oBAFU,MAAM,CAEM;AACtB,oBAAqB,CAAC,CAAA;AACtB,oBAAqB,CAAC,CAAA;AACtB,oBAAqB,CAAC,CAAA;AACtB,oBAAqB,EAAE,CAAA;AACvB,oBAAqB,EAAE,CAAA;AACvB,oBAAqB,EAAE,CAAA;AACvB,oBAAqB,GAAG,CAAA;AACxB,oBAAqB,GAAG,CAAA;AACxB,oBAAqB,GAAG,CAAA;AACxB,qBAAsB,IAAI,CAAA;AAC1B,qBAAsB,IAAI,CAAA;AAC1B,qBAAsB,IAAI,CAAA;AAC1B,qBAAsB,IAAI,CAAA;AAC1B,qBAAsB,KAAK,CAAA;AAC3B,qBAAsB,KAAK,CAAA;AAC3B,qBAAsB,KAAK,CAAA;AAC3B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B,4BAA+B;AAC/B;;GAEG;AACH,qBAFU,MAAM,CAEgB;AAChC;;GAEG;AACH,qBAFU,MAAM,CAEgB"}

4
yjs-poll/node_modules/lib0/dist/binary.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export function testBitx(tc: t.TestCase): void;
export function testBitsx(tc: t.TestCase): void;
import * as t from './testing.js';
//# sourceMappingURL=binary.test.d.ts.map

1
yjs-poll/node_modules/lib0/dist/binary.test.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"binary.test.d.ts","sourceRoot":"","sources":["../binary.test.js"],"names":[],"mappings":"AAMO,6BAFI,CAAC,CAAC,QAAQ,QAOpB;AAKM,8BAFI,CAAC,CAAC,QAAQ,QAWpB;mBAxBkB,cAAc"}

484
yjs-poll/node_modules/lib0/dist/binding.cjs generated vendored Normal file
View File

@@ -0,0 +1,484 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var observable = require('./observable.cjs');
var delta = require('./delta.cjs');
require('./testing.cjs');
var schema = require('./schema.cjs');
var dom = require('./dom-7e625b09.cjs');
var set = require('./set-5b47859e.cjs');
var map = require('./map-24d263c0.cjs');
var error = require('./error-0c1f634f.cjs');
var math = require('./math-96d5e8c4.cjs');
var mutex = require('./mutex-63f09c81.cjs');
require('./array-78849c95.cjs');
require('./list.cjs');
require('./function-314580f7.cjs');
require('./object-c0c9435b.cjs');
require('./equality.cjs');
require('./fingerprint.cjs');
require('./encoding-1a745c43.cjs');
require('./number-1fb57bba.cjs');
require('./binary-ac8e39e2.cjs');
require('./string-fddc5f8b.cjs');
require('./rabin.cjs');
require('./buffer-3e750729.cjs');
require('./environment-1c97264d.cjs');
require('./conditions-f5c0c102.cjs');
require('./storage.cjs');
require('./decoding-76e75827.cjs');
require('./patience.cjs');
require('./prng-37d48618.cjs');
require('lib0/logging');
require('./diff-9d236524.cjs');
require('./random.cjs');
require('lib0/webcrypto');
require('./statistics-65f6114b.cjs');
require('./json-092190a1.cjs');
require('./time-d8438852.cjs');
require('./metric.cjs');
require('./promise-cda7b9bb.cjs');
require('lib0/performance');
require('./pair-ab022bc3.cjs');
/* eslint-disable */
/**
* @template {delta.Delta?} DeltaA
* @template {delta.Delta?} DeltaB
* @typedef {{ a: DeltaA?, b: DeltaB? }} TransformResult
*/
/**
* @template {delta.DeltaBuilder?} DeltaA
* @template {delta.DeltaBuilder?} DeltaB
* @param {DeltaA} a
* @param {DeltaB} b
* @return {TransformResult<DeltaA?,DeltaB?>}
*/
const transformResult = (a, b) => ({ a, b });
transformResult(delta.create('x'), null);
/**
* @template {delta.DeltaAny} DeltaA
* @template {delta.DeltaAny} DeltaB
* @typedef {(t:{a:DeltaA?,b:DeltaB?})=>({a:DeltaA?,b:DeltaB?})} DeltaTransformer
*/
/**
* @template {delta.Delta<string,any,any,any>} A
* @template {(A extends delta.Delta<infer NodeName,infer Attrs,infer Children,infer Text> ? delta.Delta<`x-${NodeName}`,Attrs,Children,Text> : never)} B
* @param {TransformResult<A,B>} t
* @return {TransformResult<A,B>}
*/
const rename = t => {
/**
* @type {any}
*/
const tout = /** @type {any} */ (transformResult(null, null));
if (t.a) {
const c = /** @type {delta.Delta} */ (t.a.clone());
c.name = 'x-' + c.name;
// @ts-ignore
tout.b = c;
}
if (t.b) {
const c = /** @type {delta.Delta} */ (t.b.clone());
c.name = c.name.slice(2);
// @ts-ignore
tout.a = c;
}
return tout
};
delta.create('x', { x: 'dtrn' });
rename({ a: delta.create('x', { x: 'dtrn' }), b: null });
//
// /**
// * @template {delta.Delta} D
// * @param {s.Schema<D>} $d
// * @return {Transformer<D,D>}
// */
// const id = ($d) => /** @type {Transformer<D,D>} */ (new Transformer($d))
//
// const q = id(delta.$delta({ name: 'div' }))
// const q2 = id(delta.$delta({ name: 'div', attrs: { a: s.$string } })).pipe(t.delta('h1', { color: t => query('a')(t), name:'mystuff' }, t => [query('b')(t)]))
// const q3 = t.delta('h1', { color: t => query('a')(t), name:'mystuff' }, t => [query('b')(t)])(id(delta.$delta({ name: 'div', attrs: { a: s.$string } }))))
//
//
// /**
// * @param {Transformer<delta.Delta<any,{ a: string, name: string }>>} t
// */
// const dataToH1 = t => t.delta('h1', { color: t => query('a')(t), name:'mystuff' }, t => [query('b')(t)])(t)
// const q4 = dataToH1(id(delta.$delta({ name: 'div', attrs: { a: s.$string } })))
//
// const dataToH1_2 = t => rename('h1')(renameAttr({ a: 'color' })(static(delta.create('h1', { name: 'mystuff' }, 'some content!'))(t)))
/* eslint-disable */
/**
* @template T
* @typedef {import('../schema.js').Schema<T>} Schema
*/
/**
* @template {delta.AbstractDelta} DeltaA
* @template {delta.AbstractDelta} DeltaB
*/
class Binding {
/**
* @param {RDT<DeltaA>} a
* @param {RDT<DeltaB>} b
* @param {dt.Template<any,DeltaA,DeltaB>} template
*/
constructor (a, b, template) {
/**
* @type {dt.Transformer<any,DeltaA,DeltaB>}
*/
this.t = template.init();
this.a = a;
this.b = b;
this._mux = mutex.createMutex();
this._achanged = this.a.on('change', d => this._mux(() => {
const tres = this.t.applyA(d);
if (tres.a) {
a.update(tres.a);
}
if (tres.b) {
b.update(tres.b);
}
}));
this._bchanged = this.b.on('change', d => this._mux(() => {
const tres = this.t.applyB(d);
if (tres.b) {
this.b.update(tres.b);
}
if (tres.a) {
a.update(tres.a);
}
}));
}
destroy = () => {
this.a.off('destroy', this.destroy);
this.b.off('destroy', this.destroy);
this.a.off('change', this._achanged);
this.b.off('change', this._bchanged);
}
}
/**
* Abstract Interface for a delta-based Replicated Data Type.
*
* @template {delta.AbstractDelta} Delta
* @typedef {ObservableV2<{ 'change': (delta: Delta) => void, 'destroy': (rdt:RDT<Delta>)=>void }> & { update: (delta: Delta) => any, destroy: () => void }} RDT
*/
/**
* @template {delta.AbstractDelta} DeltaA
* @template {dt.Template<any,DeltaA,any>} Transformer
* @param {RDT<DeltaA>} a
* @param {RDT<Transformer extends dt.Template<any,DeltaA,infer DeltaB> ? DeltaB : never>} b
* @param {dt.Template<any,DeltaA,any>} template
*/
const bind = (a, b, template) => new Binding(a, b, template);
/**
* @template {delta.AbstractDelta} Delta
* @implements RDT<Delta>
* @extends {ObservableV2<{ change: (delta: Delta) => void, 'destroy': (rdt:DeltaRDT<Delta>)=>void }>}
*/
class DeltaRDT extends observable.ObservableV2 {
/**
* @param {Schema<Delta>} $delta
*/
constructor ($delta) {
super();
this.$delta = $delta;
/**
* @type {Delta?}
*/
this.state = null;
this._mux = mutex.createMutex();
}
/**
* @param {Delta} delta
*/
update = delta => delta.isEmpty() || this._mux(() => {
if (this.state != null) {
this.state.apply(delta);
} else {
this.state = delta;
}
this.emit('change', [delta]);
})
destroy () {
this.emit('destroy', [this]);
super.destroy();
}
}
/**
* @template {delta.AbstractDelta} Delta
* @param {Schema<Delta>} $delta
*/
const deltaRDT = $delta => new DeltaRDT($delta);
/**
* @param {Node} domNode
*/
const domToDelta = domNode => {
if (dom.$element.check(domNode)) {
const d = undefined(domNode.nodeName.toLowerCase());
for (let i = 0; i < domNode.attributes.length; i++) {
const attr = /** @type {Attr} */ (domNode.attributes.item(i));
d.attributes.set(attr.nodeName, attr.value);
}
domNode.childNodes.forEach(child => {
d.children.insert(dom.$text.check(child) ? child.textContent : [domToDelta(child)]);
});
return d
}
error.unexpectedCase();
};
/**
* @param {DomDelta} d
*/
const deltaToDom = d => {
if (undefined(d)) {
const n = dom.element(d.name);
d.attributes.forEach(change => {
if (delta.$insertOp.check(change)) {
n.setAttribute(change.key, change.value);
}
});
d.children.forEach(child => {
if (delta.$insertOp.check(child)) {
n.append(...child.insert.map(deltaToDom));
} else if (delta.$textOp.check(child)) {
n.append(dom.text(child.insert));
}
});
return n
}
error.unexpectedCase();
};
/**
* @param {Element} el
* @param {delta.Node<string,any,any,any>} d
*/
const applyDeltaToDom = (el, d) => {
d.attributes.forEach(change => {
if (delta.$deleteOp.check(change)) {
el.removeAttribute(change.key);
} else {
el.setAttribute(change.key, change.value);
}
});
let childIndex = 0;
let childOffset = 0;
d.children.forEach(change => {
let child = el.childNodes[childIndex] || null;
if (delta.$deleteOp.check(change)) {
let len = change.length;
while (len > 0) {
if (dom.$element.check(child)) {
child.remove();
len--;
} else if (dom.$text.check(child)) {
const childLen = child.length;
if (childOffset === 0 && childLen <= len) {
child.remove();
len -= childLen;
} else {
const spliceLen = math.min(len, childLen - childOffset);
child.deleteData(childOffset, spliceLen);
if (child.length <= childOffset) {
childOffset = 0;
childIndex++;
}
}
}
}
} else if (delta.$insertOp.check(change)) {
if (childOffset > 0) {
const tchild = dom.$text.cast(child);
child = tchild.splitText(childOffset);
childIndex++;
childOffset = 0;
}
el.insertBefore(dom.fragment(change.insert.map(deltaToDom)), child);
} else if (delta.$modifyOp.check(change)) {
applyDeltaToDom(dom.$element.cast(child), change.modify);
} else if (delta.$textOp.check(change)) {
el.insertBefore(dom.text(change.insert), child);
} else {
error.unexpectedCase();
}
});
};
const $domDelta = undefined(schema.$string, schema.$record(schema.$string, schema.$string), schema.$never, { recursive: true, withText: true });
/**
* @param {Element} observedNode
* @param {MutationRecord[]} mutations
* @param {any} origin assign this origin to the generated delta
*/
const _mutationsToDelta = (observedNode, mutations, origin) => {
/**
* @typedef {{ removedBefore: Map<Node?,number>, added: Set<Node>, modified: number, d: delta.Node }} ChangedNodeInfo
*/
/**
* Compute all deltas without recursion.
*
* 1. mark all changed parents in parentsChanged
* 2. fill out necessary information for each changed parent ()
*/
//
/**
* @type {Map<Node,ChangedNodeInfo>}
*/
const changedNodes = map.create();
/**
* @param {Node} node
* @return {ChangedNodeInfo}
*/
const getChangedNodeInfo = node => map.setIfUndefined(changedNodes, node, () => ({ removedBefore: map.create(), added: set.create(), modified: 0, d: undefined(node.nodeName.toLowerCase()) }));
const observedNodeInfo = getChangedNodeInfo(observedNode);
mutations.forEach(mutation => {
const target = /** @type {HTMLElement} */ (mutation.target);
const parent = target.parentNode;
const attrName = /** @type {string} */ (mutation.attributeName);
const newVal = target.getAttribute(attrName);
const info = getChangedNodeInfo(target);
const d = info.d;
// go up the tree and mark that a child has been modified
for (let changedParent = parent; changedParent != null && getChangedNodeInfo(changedParent).modified++ > 1 && changedParent !== observedNode; changedParent = changedParent.parentNode) {
// nop
}
switch (mutation.type) {
case 'attributes': {
const attrs = /** @type {delta.Node<any,any,any>} */ (d).attributes;
if (newVal == null) {
attrs.delete(attrName);
} else {
attrs.set(/** @type {string} */ (attrName), newVal);
}
break
}
case 'characterData': {
error.methodUnimplemented();
break
}
case 'childList': {
const targetInfo = getChangedNodeInfo(target);
mutation.addedNodes.forEach(node => {
targetInfo.added.add(node);
});
const removed = mutation.removedNodes.length;
if (removed > 0) {
// @todo this can't work because next can be null
targetInfo.removedBefore.set(mutation.nextSibling, removed);
}
break
}
}
});
changedNodes.forEach((info, node) => {
const numOfChildChanges = info.modified + info.removedBefore.size + info.added.size;
const d = /** @type {delta.Node<any,any,any>} */ (info.d);
if (numOfChildChanges > 0) {
node.childNodes.forEach(nchild => {
if (info.removedBefore.has(nchild)) { // can happen separately
d.children.delete(/** @type {number} */ (info.removedBefore.get(nchild)));
}
if (info.added.has(nchild)) {
d.children.insert(dom.$text.check(nchild) ? nchild.textContent : [domToDelta(nchild)]);
} else if (changedNodes.has(nchild)) {
d.children.modify(getChangedNodeInfo(nchild).d);
}
});
// remove items to the end, if necessary
d.children.delete(info.removedBefore.get(null) ?? 0);
}
d.done();
});
observedNodeInfo.d.origin = origin;
return observedNodeInfo.d
};
/**
* @typedef {delta.RecursiveNode<string, { [key:string]: string }, never, true>} DomDelta
*/
/**
* @template {DomDelta} [D=DomDelta]
* @implements RDT<D>
* @extends {ObservableV2<{ change: (delta: D)=>void, destroy: (rdt:DomRDT<D>)=>void }>}>}
*/
class DomRDT extends observable.ObservableV2 {
/**
* @param {Element} observedNode
*/
constructor (observedNode) {
super();
this.observedNode = observedNode;
this._mux = mutex.createMutex();
this.observer = new MutationObserver(this._mutationHandler);
this.observer.observe(observedNode, {
subtree: true,
childList: true,
attributes: true,
characterDataOldValue: true
});
}
/**
* @param {MutationRecord[]} mutations
*/
_mutationHandler = mutations =>
mutations.length > 0 && this._mux(() => {
this.emit('change', [/** @type {D} */(_mutationsToDelta(this.observedNode, mutations, this))]);
})
/**
* @param {D} delta
*/
update = delta => {
if (delta.origin !== this) {
// @todo the retrieved changes must be transformed agains the updated changes. need a proper
// transaction system
this._mutationHandler(this.observer.takeRecords());
this._mux(() => {
applyDeltaToDom(this.observedNode, delta);
const mutations = this.observer.takeRecords();
this.emit('change', [/** @type {D} */(_mutationsToDelta(this.observedNode, mutations, delta.origin))]);
});
}
}
destroy () {
this.emit('destroy', [this]);
super.destroy();
this.observer.disconnect();
}
}
/**
* @param {Element} dom
*/
const domRDT = dom => new DomRDT(dom);
exports.$domDelta = $domDelta;
exports.Binding = Binding;
exports.bind = bind;
exports.deltaRDT = deltaRDT;
exports.domRDT = domRDT;
//# sourceMappingURL=binding.cjs.map

1
yjs-poll/node_modules/lib0/dist/binding.cjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,128 @@
'use strict';
var map = require('./map-24d263c0.cjs');
var set = require('./set-5b47859e.cjs');
var buffer = require('./buffer-3e750729.cjs');
var storage = require('./storage.cjs');
/* eslint-env browser */
/**
* @typedef {Object} Channel
* @property {Set<function(any, any):any>} Channel.subs
* @property {any} Channel.bc
*/
/**
* @type {Map<string, Channel>}
*/
const channels = new Map();
/* c8 ignore start */
class LocalStoragePolyfill {
/**
* @param {string} room
*/
constructor (room) {
this.room = room;
/**
* @type {null|function({data:Uint8Array}):void}
*/
this.onmessage = null;
/**
* @param {any} e
*/
this._onChange = e => e.key === room && this.onmessage !== null && this.onmessage({ data: buffer.fromBase64(e.newValue || '') });
storage.onChange(this._onChange);
}
/**
* @param {ArrayBuffer} buf
*/
postMessage (buf) {
storage.varStorage.setItem(this.room, buffer.toBase64(buffer.createUint8ArrayFromArrayBuffer(buf)));
}
close () {
storage.offChange(this._onChange);
}
}
/* c8 ignore stop */
// Use BroadcastChannel or Polyfill
/* c8 ignore next */
const BC = typeof BroadcastChannel === 'undefined' ? LocalStoragePolyfill : BroadcastChannel;
/**
* @param {string} room
* @return {Channel}
*/
const getChannel = room =>
map.setIfUndefined(channels, room, () => {
const subs = set.create();
const bc = new BC(room);
/**
* @param {{data:ArrayBuffer}} e
*/
/* c8 ignore next */
bc.onmessage = e => subs.forEach(sub => sub(e.data, 'broadcastchannel'));
return {
bc, subs
}
});
/**
* Subscribe to global `publish` events.
*
* @function
* @param {string} room
* @param {function(any, any):any} f
*/
const subscribe = (room, f) => {
getChannel(room).subs.add(f);
return f
};
/**
* Unsubscribe from `publish` global events.
*
* @function
* @param {string} room
* @param {function(any, any):any} f
*/
const unsubscribe = (room, f) => {
const channel = getChannel(room);
const unsubscribed = channel.subs.delete(f);
if (unsubscribed && channel.subs.size === 0) {
channel.bc.close();
channels.delete(room);
}
return unsubscribed
};
/**
* Publish data to all subscribers (including subscribers on this tab)
*
* @function
* @param {string} room
* @param {any} data
* @param {any} [origin]
*/
const publish = (room, data, origin = null) => {
const c = getChannel(room);
c.bc.postMessage(data);
c.subs.forEach(sub => sub(data, origin));
};
var broadcastchannel = /*#__PURE__*/Object.freeze({
__proto__: null,
subscribe: subscribe,
unsubscribe: unsubscribe,
publish: publish
});
exports.broadcastchannel = broadcastchannel;
exports.publish = publish;
exports.subscribe = subscribe;
exports.unsubscribe = unsubscribe;
//# sourceMappingURL=broadcastchannel-aca4f606.cjs.map

File diff suppressed because one or more lines are too long

29
yjs-poll/node_modules/lib0/dist/broadcastchannel.cjs generated vendored Normal file
View File

@@ -0,0 +1,29 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
require('./map-24d263c0.cjs');
require('./set-5b47859e.cjs');
require('./buffer-3e750729.cjs');
require('./storage.cjs');
var broadcastchannel = require('./broadcastchannel-aca4f606.cjs');
require('./string-fddc5f8b.cjs');
require('./array-78849c95.cjs');
require('./environment-1c97264d.cjs');
require('./conditions-f5c0c102.cjs');
require('./function-314580f7.cjs');
require('./object-c0c9435b.cjs');
require('./equality.cjs');
require('./math-96d5e8c4.cjs');
require('./encoding-1a745c43.cjs');
require('./number-1fb57bba.cjs');
require('./binary-ac8e39e2.cjs');
require('./decoding-76e75827.cjs');
require('./error-0c1f634f.cjs');
exports.publish = broadcastchannel.publish;
exports.subscribe = broadcastchannel.subscribe;
exports.unsubscribe = broadcastchannel.unsubscribe;
//# sourceMappingURL=broadcastchannel.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"broadcastchannel.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,8 @@
export function subscribe(room: string, f: (arg0: any, arg1: any) => any): (arg0: any, arg1: any) => any;
export function unsubscribe(room: string, f: (arg0: any, arg1: any) => any): boolean;
export function publish(room: string, data: any, origin?: any): void;
export type Channel = {
subs: Set<(arg0: any, arg1: any) => any>;
bc: any;
};
//# sourceMappingURL=broadcastchannel.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"broadcastchannel.d.ts","sourceRoot":"","sources":["../broadcastchannel.js"],"names":[],"mappings":"AA+FO,gCAHI,MAAM,KACN,CAAS,IAAG,EAAH,GAAG,EAAE,IAAG,EAAH,GAAG,KAAE,GAAG,UAAb,GAAG,QAAE,GAAG,KAAE,GAAG,CAKhC;AASM,kCAHI,MAAM,KACN,CAAS,IAAG,EAAH,GAAG,EAAE,IAAG,EAAH,GAAG,KAAE,GAAG,WAUhC;AAUM,8BAJI,MAAM,QACN,GAAG,WACH,GAAG,QAMb;;UAvGa,GAAG,CAAC,CAAS,IAAG,EAAH,GAAG,EAAE,IAAG,EAAH,GAAG,KAAE,GAAG,CAAC;QAC3B,GAAG"}

View File

@@ -0,0 +1,3 @@
export function testBroadcastChannel(tc: t.TestCase): void;
import * as t from './testing.js';
//# sourceMappingURL=broadcastchannel.test.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"broadcastchannel.test.d.ts","sourceRoot":"","sources":["../broadcastchannel.test.js"],"names":[],"mappings":"AAMO,yCAFI,CAAC,CAAC,QAAQ,QAkBpB;mBAtBkB,cAAc"}

198
yjs-poll/node_modules/lib0/dist/buffer-3e750729.cjs generated vendored Normal file
View File

@@ -0,0 +1,198 @@
'use strict';
var string = require('./string-fddc5f8b.cjs');
var environment = require('./environment-1c97264d.cjs');
var array = require('./array-78849c95.cjs');
var math = require('./math-96d5e8c4.cjs');
var encoding = require('./encoding-1a745c43.cjs');
var decoding = require('./decoding-76e75827.cjs');
/**
* Utility functions to work with buffers (Uint8Array).
*
* @module buffer
*/
/**
* @param {number} len
*/
const createUint8ArrayFromLen = len => new Uint8Array(len);
/**
* Create Uint8Array with initial content from buffer
*
* @param {ArrayBuffer} buffer
* @param {number} byteOffset
* @param {number} length
*/
const createUint8ArrayViewFromArrayBuffer = (buffer, byteOffset, length) => new Uint8Array(buffer, byteOffset, length);
/**
* Create Uint8Array with initial content from buffer
*
* @param {ArrayBuffer} buffer
*/
const createUint8ArrayFromArrayBuffer = buffer => new Uint8Array(buffer);
/* c8 ignore start */
/**
* @param {Uint8Array} bytes
* @return {string}
*/
const toBase64Browser = bytes => {
let s = '';
for (let i = 0; i < bytes.byteLength; i++) {
s += string.fromCharCode(bytes[i]);
}
// eslint-disable-next-line no-undef
return btoa(s)
};
/* c8 ignore stop */
/**
* @param {Uint8Array} bytes
* @return {string}
*/
const toBase64Node = bytes => Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString('base64');
/* c8 ignore start */
/**
* @param {string} s
* @return {Uint8Array<ArrayBuffer>}
*/
const fromBase64Browser = s => {
// eslint-disable-next-line no-undef
const a = atob(s);
const bytes = createUint8ArrayFromLen(a.length);
for (let i = 0; i < a.length; i++) {
bytes[i] = a.charCodeAt(i);
}
return bytes
};
/* c8 ignore stop */
/**
* @param {string} s
*/
const fromBase64Node = s => {
const buf = Buffer.from(s, 'base64');
return createUint8ArrayViewFromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength)
};
/* c8 ignore next */
const toBase64 = environment.isBrowser ? toBase64Browser : toBase64Node;
/* c8 ignore next */
const fromBase64 = environment.isBrowser ? fromBase64Browser : fromBase64Node;
/**
* Implements base64url - see https://datatracker.ietf.org/doc/html/rfc4648#section-5
* @param {Uint8Array} buf
*/
const toBase64UrlEncoded = buf => toBase64(buf).replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '');
/**
* @param {string} base64
*/
const fromBase64UrlEncoded = base64 => fromBase64(base64.replaceAll('-', '+').replaceAll('_', '/'));
/**
* Base64 is always a more efficient choice. This exists for utility purposes only.
*
* @param {Uint8Array} buf
*/
const toHexString = buf => array.map(buf, b => b.toString(16).padStart(2, '0')).join('');
/**
* Note: This function expects that the hex doesn't start with 0x..
*
* @param {string} hex
*/
const fromHexString = hex => {
const hlen = hex.length;
const buf = new Uint8Array(math.ceil(hlen / 2));
for (let i = 0; i < hlen; i += 2) {
buf[buf.length - i / 2 - 1] = Number.parseInt(hex.slice(hlen - i - 2, hlen - i), 16);
}
return buf
};
/**
* Copy the content of an Uint8Array view to a new ArrayBuffer.
*
* @param {Uint8Array} uint8Array
* @return {Uint8Array}
*/
const copyUint8Array = uint8Array => {
const newBuf = createUint8ArrayFromLen(uint8Array.byteLength);
newBuf.set(uint8Array);
return newBuf
};
/**
* Encode anything as a UInt8Array. It's a pun on typescripts's `any` type.
* See encoding.writeAny for more information.
*
* @param {any} data
* @return {Uint8Array}
*/
const encodeAny = data =>
encoding.encode(encoder => encoding.writeAny(encoder, data));
/**
* Decode an any-encoded value.
*
* @param {Uint8Array} buf
* @return {any}
*/
const decodeAny = buf => decoding.readAny(decoding.createDecoder(buf));
/**
* Shift Byte Array {N} bits to the left. Does not expand byte array.
*
* @param {Uint8Array} bs
* @param {number} N should be in the range of [0-7]
*/
const shiftNBitsLeft = (bs, N) => {
if (N === 0) return bs
bs = new Uint8Array(bs);
bs[0] <<= N;
for (let i = 1; i < bs.length; i++) {
bs[i - 1] |= bs[i] >>> (8 - N);
bs[i] <<= N;
}
return bs
};
var buffer = /*#__PURE__*/Object.freeze({
__proto__: null,
createUint8ArrayFromLen: createUint8ArrayFromLen,
createUint8ArrayViewFromArrayBuffer: createUint8ArrayViewFromArrayBuffer,
createUint8ArrayFromArrayBuffer: createUint8ArrayFromArrayBuffer,
toBase64: toBase64,
fromBase64: fromBase64,
toBase64UrlEncoded: toBase64UrlEncoded,
fromBase64UrlEncoded: fromBase64UrlEncoded,
toHexString: toHexString,
fromHexString: fromHexString,
copyUint8Array: copyUint8Array,
encodeAny: encodeAny,
decodeAny: decodeAny,
shiftNBitsLeft: shiftNBitsLeft
});
exports.buffer = buffer;
exports.copyUint8Array = copyUint8Array;
exports.createUint8ArrayFromArrayBuffer = createUint8ArrayFromArrayBuffer;
exports.createUint8ArrayFromLen = createUint8ArrayFromLen;
exports.createUint8ArrayViewFromArrayBuffer = createUint8ArrayViewFromArrayBuffer;
exports.decodeAny = decodeAny;
exports.encodeAny = encodeAny;
exports.fromBase64 = fromBase64;
exports.fromBase64UrlEncoded = fromBase64UrlEncoded;
exports.fromHexString = fromHexString;
exports.shiftNBitsLeft = shiftNBitsLeft;
exports.toBase64 = toBase64;
exports.toBase64UrlEncoded = toBase64UrlEncoded;
exports.toHexString = toHexString;
//# sourceMappingURL=buffer-3e750729.cjs.map

File diff suppressed because one or more lines are too long

38
yjs-poll/node_modules/lib0/dist/buffer.cjs generated vendored Normal file
View File

@@ -0,0 +1,38 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
require('./string-fddc5f8b.cjs');
require('./environment-1c97264d.cjs');
require('./array-78849c95.cjs');
require('./math-96d5e8c4.cjs');
require('./encoding-1a745c43.cjs');
require('./decoding-76e75827.cjs');
var buffer = require('./buffer-3e750729.cjs');
require('./map-24d263c0.cjs');
require('./conditions-f5c0c102.cjs');
require('./storage.cjs');
require('./function-314580f7.cjs');
require('./object-c0c9435b.cjs');
require('./equality.cjs');
require('./set-5b47859e.cjs');
require('./number-1fb57bba.cjs');
require('./binary-ac8e39e2.cjs');
require('./error-0c1f634f.cjs');
exports.copyUint8Array = buffer.copyUint8Array;
exports.createUint8ArrayFromArrayBuffer = buffer.createUint8ArrayFromArrayBuffer;
exports.createUint8ArrayFromLen = buffer.createUint8ArrayFromLen;
exports.createUint8ArrayViewFromArrayBuffer = buffer.createUint8ArrayViewFromArrayBuffer;
exports.decodeAny = buffer.decodeAny;
exports.encodeAny = buffer.encodeAny;
exports.fromBase64 = buffer.fromBase64;
exports.fromBase64UrlEncoded = buffer.fromBase64UrlEncoded;
exports.fromHexString = buffer.fromHexString;
exports.shiftNBitsLeft = buffer.shiftNBitsLeft;
exports.toBase64 = buffer.toBase64;
exports.toBase64UrlEncoded = buffer.toBase64UrlEncoded;
exports.toHexString = buffer.toHexString;
//# sourceMappingURL=buffer.cjs.map

1
yjs-poll/node_modules/lib0/dist/buffer.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"buffer.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

22
yjs-poll/node_modules/lib0/dist/buffer.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
export function createUint8ArrayFromLen(len: number): Uint8Array<ArrayBuffer>;
export function createUint8ArrayViewFromArrayBuffer(buffer: ArrayBuffer, byteOffset: number, length: number): Uint8Array<ArrayBuffer>;
export function createUint8ArrayFromArrayBuffer(buffer: ArrayBuffer): Uint8Array<ArrayBuffer>;
/**
* @param {Uint8Array} bytes
* @return {string}
*/
export function toBase64(bytes: Uint8Array): string;
/**
* @param {string} s
* @return {Uint8Array<ArrayBuffer>}
*/
export function fromBase64(s: string): Uint8Array<ArrayBuffer>;
export function toBase64UrlEncoded(buf: Uint8Array): string;
export function fromBase64UrlEncoded(base64: string): Uint8Array<ArrayBuffer>;
export function toHexString(buf: Uint8Array): string;
export function fromHexString(hex: string): Uint8Array<ArrayBuffer>;
export function copyUint8Array(uint8Array: Uint8Array): Uint8Array;
export function encodeAny(data: any): Uint8Array;
export function decodeAny(buf: Uint8Array): any;
export function shiftNBitsLeft(bs: Uint8Array, N: number): Uint8Array<ArrayBufferLike>;
//# sourceMappingURL=buffer.d.ts.map

1
yjs-poll/node_modules/lib0/dist/buffer.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../buffer.js"],"names":[],"mappings":"AAgBO,6CAFI,MAAM,2BAEgD;AAS1D,4DAJI,WAAW,cACX,MAAM,UACN,MAAM,2BAE4G;AAOtH,wDAFI,WAAW,2BAEyD;AAG/E;;;GAGG;AACH,gCAHW,UAAU,GACT,MAAM,CASjB;AAUD;;;GAGG;AACH,8BAHW,MAAM,GACL,UAAU,CAAC,WAAW,CAAC,CAUlC;AAqBM,wCAFI,UAAU,UAE+F;AAK7G,6CAFI,MAAM,2BAEyF;AAOnG,iCAFI,UAAU,UAE0E;AAOxF,mCAFI,MAAM,2BAShB;AAQM,2CAHI,UAAU,GACT,UAAU,CAMrB;AASM,gCAHI,GAAG,GACF,UAAU,CAGwC;AAQvD,+BAHI,UAAU,GACT,GAAG,CAE8D;AAQtE,mCAHI,UAAU,KACV,MAAM,+BAWhB"}

6
yjs-poll/node_modules/lib0/dist/buffer.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export function testRepeatBase64urlEncoding(tc: t.TestCase): void;
export function testRepeatBase64Encoding(tc: t.TestCase): void;
export function testRepeatHexEncoding(tc: t.TestCase): void;
export function testAnyEncoding(_tc: t.TestCase): void;
import * as t from './testing.js';
//# sourceMappingURL=buffer.test.d.ts.map

1
yjs-poll/node_modules/lib0/dist/buffer.test.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"buffer.test.d.ts","sourceRoot":"","sources":["../buffer.test.js"],"names":[],"mappings":"AA2BO,gDAFI,CAAC,CAAC,QAAQ,QAIpB;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAIpB;AAKM,0CAFI,CAAC,CAAC,QAAQ,QAIpB;AAKM,qCAFI,CAAC,CAAC,QAAQ,QAMpB;mBApDkB,cAAc"}

223
yjs-poll/node_modules/lib0/dist/cache.cjs generated vendored Normal file
View File

@@ -0,0 +1,223 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var list = require('./list.cjs');
var map = require('./map-24d263c0.cjs');
var time = require('./time-d8438852.cjs');
require('./function-314580f7.cjs');
require('./array-78849c95.cjs');
require('./set-5b47859e.cjs');
require('./object-c0c9435b.cjs');
require('./equality.cjs');
require('./error-0c1f634f.cjs');
require('./metric.cjs');
require('./math-96d5e8c4.cjs');
/* eslint-env browser */
/**
* @template K, V
*
* @implements {list.ListNode}
*/
class Entry {
/**
* @param {K} key
* @param {V | Promise<V>} val
*/
constructor (key, val) {
/**
* @type {this | null}
*/
this.prev = null;
/**
* @type {this | null}
*/
this.next = null;
this.created = time.getUnixTime();
this.val = val;
this.key = key;
}
}
/**
* @template K, V
*/
class Cache {
/**
* @param {number} timeout
*/
constructor (timeout) {
this.timeout = timeout;
/**
* @type list.List<Entry<K, V>>
*/
this._q = list.create();
/**
* @type {Map<K, Entry<K, V>>}
*/
this._map = map.create();
}
}
/**
* @template K, V
*
* @param {Cache<K, V>} cache
* @return {number} Returns the current timestamp
*/
const removeStale = cache => {
const now = time.getUnixTime();
const q = cache._q;
while (q.start && now - q.start.created > cache.timeout) {
cache._map.delete(q.start.key);
list.popFront(q);
}
return now
};
/**
* @template K, V
*
* @param {Cache<K, V>} cache
* @param {K} key
* @param {V} value
*/
const set = (cache, key, value) => {
const now = removeStale(cache);
const q = cache._q;
const n = cache._map.get(key);
if (n) {
list.removeNode(q, n);
list.pushEnd(q, n);
n.created = now;
n.val = value;
} else {
const node = new Entry(key, value);
list.pushEnd(q, node);
cache._map.set(key, node);
}
};
/**
* @template K, V
*
* @param {Cache<K, V>} cache
* @param {K} key
* @return {Entry<K, V> | undefined}
*/
const getNode = (cache, key) => {
removeStale(cache);
const n = cache._map.get(key);
if (n) {
return n
}
};
/**
* @template K, V
*
* @param {Cache<K, V>} cache
* @param {K} key
* @return {V | undefined}
*/
const get = (cache, key) => {
const n = getNode(cache, key);
return n && !(n.val instanceof Promise) ? n.val : undefined
};
/**
* @template K, V
*
* @param {Cache<K, V>} cache
* @param {K} key
*/
const refreshTimeout = (cache, key) => {
const now = time.getUnixTime();
const q = cache._q;
const n = cache._map.get(key);
if (n) {
list.removeNode(q, n);
list.pushEnd(q, n);
n.created = now;
}
};
/**
* Works well in conjunktion with setIfUndefined which has an async init function.
* Using getAsync & setIfUndefined ensures that the init function is only called once.
*
* @template K, V
*
* @param {Cache<K, V>} cache
* @param {K} key
* @return {V | Promise<V> | undefined}
*/
const getAsync = (cache, key) => {
const n = getNode(cache, key);
return n ? n.val : undefined
};
/**
* @template K, V
*
* @param {Cache<K, V>} cache
* @param {K} key
*/
const remove = (cache, key) => {
const n = cache._map.get(key);
if (n) {
list.removeNode(cache._q, n);
cache._map.delete(key);
return n.val && !(n.val instanceof Promise) ? n.val : undefined
}
};
/**
* @template K, V
*
* @param {Cache<K, V>} cache
* @param {K} key
* @param {function():Promise<V>} init
* @param {boolean} removeNull Optional argument that automatically removes values that resolve to null/undefined from the cache.
* @return {Promise<V> | V}
*/
const setIfUndefined = (cache, key, init, removeNull = false) => {
removeStale(cache);
const q = cache._q;
const n = cache._map.get(key);
if (n) {
return n.val
} else {
const p = init();
const node = new Entry(key, p);
list.pushEnd(q, node);
cache._map.set(key, node);
p.then(v => {
if (p === node.val) {
node.val = v;
}
if (removeNull && v == null) {
remove(cache, key);
}
});
return p
}
};
/**
* @param {number} timeout
*/
const create = timeout => new Cache(timeout);
exports.Cache = Cache;
exports.create = create;
exports.get = get;
exports.getAsync = getAsync;
exports.refreshTimeout = refreshTimeout;
exports.remove = remove;
exports.removeStale = removeStale;
exports.set = set;
exports.setIfUndefined = setIfUndefined;
//# sourceMappingURL=cache.cjs.map

1
yjs-poll/node_modules/lib0/dist/cache.cjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

52
yjs-poll/node_modules/lib0/dist/cache.d.ts generated vendored Normal file
View File

@@ -0,0 +1,52 @@
/**
* @template K, V
*/
export class Cache<K, V> {
/**
* @param {number} timeout
*/
constructor(timeout: number);
timeout: number;
/**
* @type list.List<Entry<K, V>>
*/
_q: list.List<Entry<K, V>>;
/**
* @type {Map<K, Entry<K, V>>}
*/
_map: Map<K, Entry<K, V>>;
}
export function removeStale<K, V>(cache: Cache<K, V>): number;
export function set<K, V>(cache: Cache<K, V>, key: K, value: V): void;
export function get<K, V>(cache: Cache<K, V>, key: K): V | undefined;
export function refreshTimeout<K, V>(cache: Cache<K, V>, key: K): void;
export function getAsync<K, V>(cache: Cache<K, V>, key: K): V | Promise<V> | undefined;
export function remove<K, V>(cache: Cache<K, V>, key: K): NonNullable<V> | undefined;
export function setIfUndefined<K, V>(cache: Cache<K, V>, key: K, init: () => Promise<V>, removeNull?: boolean): Promise<V> | V;
export function create(timeout: number): Cache<any, any>;
import * as list from './list.js';
/**
* @template K, V
*
* @implements {list.ListNode}
*/
declare class Entry<K, V> implements list.ListNode {
/**
* @param {K} key
* @param {V | Promise<V>} val
*/
constructor(key: K, val: V | Promise<V>);
/**
* @type {this | null}
*/
prev: this | null;
/**
* @type {this | null}
*/
next: this | null;
created: number;
val: V | Promise<V>;
key: K;
}
export {};
//# sourceMappingURL=cache.d.ts.map

1
yjs-poll/node_modules/lib0/dist/cache.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../cache.js"],"names":[],"mappings":"AAqCA;;GAEG;AACH,mBAFa,CAAC,EAAE,CAAC;IAGf;;OAEG;IACH,qBAFW,MAAM,EAYhB;IATC,gBAAsB;IACtB;;OAEG;IACH,IAFS,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAER;IACvB;;OAEG;IACH,MAFU,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAEL;CAE3B;AAQM,4BALM,CAAC,EAAE,CAAC,SAEN,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GACV,MAAM,CAUjB;AASM,oBANM,CAAC,EAAE,CAAC,SAEN,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,OACX,CAAC,SACD,CAAC,QAgBX;AAwBM,oBANM,CAAC,EAAE,CAAC,SAEN,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,OACX,CAAC,GACA,CAAC,GAAG,SAAS,CAKxB;AAQM,+BALM,CAAC,EAAE,CAAC,SAEN,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,OACX,CAAC,QAWX;AAYM,yBANM,CAAC,EAAE,CAAC,SAEN,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,OACX,CAAC,GACA,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAKrC;AAQM,uBALM,CAAC,EAAE,CAAC,SAEN,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,OACX,CAAC,8BASX;AAWM,+BARM,CAAC,EAAE,CAAC,SAEN,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,OACX,CAAC,QACD,MAAW,OAAO,CAAC,CAAC,CAAC,eACrB,OAAO,GACN,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAuBzB;AAKM,gCAFI,MAAM,mBAEkC;sBArM7B,WAAW;AAIjC;;;;GAIG;AACH,oBAJa,CAAC,EAAE,CAAC,aAED,IAAI,CAAC,QAAQ;IAG3B;;;OAGG;IACH,iBAHW,CAAC,OACD,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAcxB;IAXC;;OAEG;IACH,MAFU,IAAI,GAAG,IAAI,CAEL;IAChB;;OAEG;IACH,MAFU,IAAI,GAAG,IAAI,CAEL;IAChB,gBAAiC;IACjC,oBAAc;IACd,OAAc;CAEjB"}

3
yjs-poll/node_modules/lib0/dist/cache.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export function testCache(tc: t.TestCase): Promise<void>;
import * as t from './testing.js';
//# sourceMappingURL=cache.test.d.ts.map

1
yjs-poll/node_modules/lib0/dist/cache.test.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"cache.test.d.ts","sourceRoot":"","sources":["../cache.test.js"],"names":[],"mappings":"AAOO,8BAFI,CAAC,CAAC,QAAQ,iBA6EpB;mBAlFkB,cAAc"}

47
yjs-poll/node_modules/lib0/dist/common.cjs generated vendored Normal file
View File

@@ -0,0 +1,47 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var webcrypto = require('lib0/webcrypto');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var webcrypto__namespace = /*#__PURE__*/_interopNamespace(webcrypto);
/**
* @param {CryptoKey} key
*/
const exportKeyJwk = async key => {
const jwk = await webcrypto__namespace.subtle.exportKey('jwk', key);
jwk.key_ops = key.usages;
return jwk
};
/**
* Only suited for exporting public keys.
*
* @param {CryptoKey} key
* @return {Promise<Uint8Array<ArrayBuffer>>}
*/
const exportKeyRaw = key =>
webcrypto__namespace.subtle.exportKey('raw', key).then(key => new Uint8Array(key));
exports.exportKeyJwk = exportKeyJwk;
exports.exportKeyRaw = exportKeyRaw;
//# sourceMappingURL=common.cjs.map

1
yjs-poll/node_modules/lib0/dist/common.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"common.cjs","sources":["../crypto/common.js"],"sourcesContent":["import * as webcrypto from 'lib0/webcrypto'\n\n/**\n * @param {CryptoKey} key\n */\nexport const exportKeyJwk = async key => {\n const jwk = await webcrypto.subtle.exportKey('jwk', key)\n jwk.key_ops = key.usages\n return jwk\n}\n\n/**\n * Only suited for exporting public keys.\n *\n * @param {CryptoKey} key\n * @return {Promise<Uint8Array<ArrayBuffer>>}\n */\nexport const exportKeyRaw = key =>\n webcrypto.subtle.exportKey('raw', key).then(key => new Uint8Array(key))\n"],"names":["webcrypto"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACY,MAAC,YAAY,GAAG,MAAM,GAAG,IAAI;AACzC,EAAE,MAAM,GAAG,GAAG,MAAMA,oBAAS,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,EAAC;AAC1D,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAM;AAC1B,EAAE,OAAO,GAAG;AACZ,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,YAAY,GAAG,GAAG;AAC/B,EAAEA,oBAAS,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC;;;;;"}

437
yjs-poll/node_modules/lib0/dist/component.cjs generated vendored Normal file
View File

@@ -0,0 +1,437 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var dom = require('./dom-7e625b09.cjs');
var diff = require('./diff-9d236524.cjs');
var object = require('./object-c0c9435b.cjs');
var json = require('./json-092190a1.cjs');
var string = require('./string-fddc5f8b.cjs');
var array = require('./array-78849c95.cjs');
var number = require('./number-1fb57bba.cjs');
var _function = require('./function-314580f7.cjs');
require('./pair-ab022bc3.cjs');
require('./map-24d263c0.cjs');
require('./schema.cjs');
require('./error-0c1f634f.cjs');
require('./environment-1c97264d.cjs');
require('./conditions-f5c0c102.cjs');
require('./storage.cjs');
require('./equality.cjs');
require('./prng-37d48618.cjs');
require('./binary-ac8e39e2.cjs');
require('./math-96d5e8c4.cjs');
require('./buffer-3e750729.cjs');
require('./encoding-1a745c43.cjs');
require('./decoding-76e75827.cjs');
require('./set-5b47859e.cjs');
/* eslint-env browser */
/**
* @type {CustomElementRegistry}
*/
const registry = customElements;
/**
* @param {string} name
* @param {any} constr
* @param {ElementDefinitionOptions} [opts]
*/
const define = (name, constr, opts) => registry.define(name, constr, opts);
/**
* @param {string} name
* @return {Promise<CustomElementConstructor>}
*/
const whenDefined = name => registry.whenDefined(name);
const upgradedEventName = 'upgraded';
const connectedEventName = 'connected';
const disconnectedEventName = 'disconnected';
/**
* @template S
*/
class Lib0Component extends HTMLElement {
/**
* @param {S} [state]
*/
constructor (state) {
super();
/**
* @type {S|null}
*/
this.state = /** @type {any} */ (state);
/**
* @type {any}
*/
this._internal = {};
}
/**
* @param {S} _state
* @param {boolean} [_forceStateUpdate] Force that the state is rerendered even if state didn't change
*/
setState (_state, _forceStateUpdate = true) {}
/**
* @param {any} _stateUpdate
*/
updateState (_stateUpdate) { }
}
/**
* @param {any} val
* @param {"json"|"string"|"number"} type
* @return {string}
*/
const encodeAttrVal = (val, type) => {
if (type === 'json') {
val = json.stringify(val);
}
return val + ''
};
/**
* @param {any} val
* @param {"json"|"string"|"number"|"bool"} type
* @return {any}
*/
const parseAttrVal = (val, type) => {
switch (type) {
case 'json':
return json.parse(val)
case 'number':
return Number.parseFloat(val)
case 'string':
return val
case 'bool':
return val != null
default:
return null
}
};
/**
* @template S
* @typedef {Object} CONF
* @property {string?} [CONF.template] Template for the shadow dom.
* @property {string} [CONF.style] shadow dom style. Is only used when
* `CONF.template` is defined
* @property {S} [CONF.state] Initial component state.
* @property {function(S,S|null,Lib0Component<S>):void} [CONF.onStateChange] Called when
* the state changes.
* @property {Object<string,function(any, any):Object>} [CONF.childStates] maps from
* CSS-selector to transformer function. The first element that matches the
* CSS-selector receives state updates via the transformer function.
* @property {Object<string,"json"|"number"|"string"|"bool">} [CONF.attrs]
* attrs-keys and state-keys should be camelCase, but the DOM uses kebap-case. I.e.
* `attrs = { myAttr: 4 }` is represeted as `<my-elem my-attr="4" />` in the DOM
* @property {Object<string, function(CustomEvent, Lib0Component<any>):boolean|void>} [CONF.listeners] Maps from dom-event-name
* to event listener.
* @property {function(S, S, Lib0Component<S>):Object<string,string>} [CONF.slots] Fill slots
* automatically when state changes. Maps from slot-name to slot-html.
*/
/**
* @template T
* @param {string} name
* @param {CONF<T>} cnf
* @return {typeof Lib0Component}
*/
const createComponent = (name, { template, style = '', state: defaultState, onStateChange = () => {}, childStates = { }, attrs = {}, listeners = {}, slots = () => ({}) }) => {
/**
* Maps from camelCase attribute name to kebap-case attribute name.
* @type {Object<string,string>}
*/
const normalizedAttrs = {};
for (const key in attrs) {
normalizedAttrs[string.fromCamelCase(key, '-')] = key;
}
const templateElement = template
? /** @type {HTMLTemplateElement} */ (dom.parseElement(`
<template>
<style>${style}</style>
${template}
</template>
`))
: null;
class _Lib0Component extends HTMLElement {
/**
* @param {T} [state]
*/
constructor (state) {
super();
/**
* @type {Array<{d:Lib0Component<T>, s:function(any, any):Object}>}
*/
this._childStates = [];
/**
* @type {Object<string,string>}
*/
this._slots = {};
this._init = false;
/**
* @type {any}
*/
this._internal = {};
/**
* @type {any}
*/
this.state = state || null;
this.connected = false;
// init shadow dom
if (templateElement) {
const shadow = /** @type {ShadowRoot} */ (this.attachShadow({ mode: 'open' }));
shadow.appendChild(templateElement.content.cloneNode(true));
// fill child states
for (const key in childStates) {
this._childStates.push({
d: /** @type {Lib0Component<T>} */ (dom.querySelector(/** @type {any} */ (shadow), key)),
s: childStates[key]
});
}
}
dom.emitCustomEvent(this, upgradedEventName, { bubbles: true });
}
connectedCallback () {
this.connected = true;
if (!this._init) {
this._init = true;
const shadow = this.shadowRoot;
if (shadow) {
dom.addEventListener(shadow, upgradedEventName, event => {
this.setState(this.state, true);
event.stopPropagation();
});
}
/**
* @type {Object<string, any>}
*/
const startState = this.state || object.assign({}, defaultState);
if (attrs) {
for (const key in attrs) {
const normalizedKey = string.fromCamelCase(key, '-');
const val = parseAttrVal(this.getAttribute(normalizedKey), attrs[key]);
if (val) {
startState[key] = val;
}
}
}
// add event listeners
for (const key in listeners) {
dom.addEventListener(shadow || this, key, event => {
if (listeners[key](/** @type {CustomEvent} */ (event), this) !== false) {
event.stopPropagation();
event.preventDefault();
return false
}
});
}
// first setState call
this.state = null;
this.setState(startState);
}
dom.emitCustomEvent(/** @type {any} */ (this.shadowRoot || this), connectedEventName, { bubbles: true });
}
disconnectedCallback () {
this.connected = false;
dom.emitCustomEvent(/** @type {any} */ (this.shadowRoot || this), disconnectedEventName, { bubbles: true });
this.setState(null);
}
static get observedAttributes () {
return object.keys(normalizedAttrs)
}
/**
* @param {string} name
* @param {string} oldVal
* @param {string} newVal
*
* @private
*/
attributeChangedCallback (name, oldVal, newVal) {
const curState = /** @type {any} */ (this.state);
const camelAttrName = normalizedAttrs[name];
const type = attrs[camelAttrName];
const parsedVal = parseAttrVal(newVal, type);
if (curState && (type !== 'json' || json.stringify(curState[camelAttrName]) !== newVal) && curState[camelAttrName] !== parsedVal && !number.isNaN(parsedVal)) {
this.updateState({ [camelAttrName]: parsedVal });
}
}
/**
* @param {any} stateUpdate
*/
updateState (stateUpdate) {
this.setState(object.assign({}, this.state, stateUpdate));
}
/**
* @param {any} state
*/
setState (state, forceStateUpdates = false) {
const prevState = this.state;
this.state = state;
if (this._init && (!_function.equalityFlat(state, prevState) || forceStateUpdates)) {
// fill slots
if (state) {
const slotElems = slots(state, prevState, this);
for (const key in slotElems) {
const slotContent = slotElems[key];
if (this._slots[key] !== slotContent) {
this._slots[key] = slotContent;
const currentSlots = /** @type {Array<any>} */ (key !== 'default' ? array.from(dom.querySelectorAll(this, `[slot="${key}"]`)) : array.from(this.childNodes).filter(/** @param {any} child */ child => !dom.checkNodeType(child, dom.ELEMENT_NODE) || !child.hasAttribute('slot')));
currentSlots.slice(1).map(dom.remove);
const nextSlot = dom.parseFragment(slotContent);
if (key !== 'default') {
array.from(nextSlot.children).forEach(c => c.setAttribute('slot', key));
}
if (currentSlots.length > 0) {
dom.replaceWith(currentSlots[0], nextSlot);
} else {
dom.appendChild(this, nextSlot);
}
}
}
}
onStateChange(state, prevState, this);
if (state != null) {
this._childStates.forEach(cnf => {
const d = cnf.d;
if (d.updateState) {
d.updateState(cnf.s(state, this));
}
});
}
for (const key in attrs) {
const normalizedKey = string.fromCamelCase(key, '-');
if (state == null) {
this.removeAttribute(normalizedKey);
} else {
const stateVal = state[key];
const attrsType = attrs[key];
if (!prevState || prevState[key] !== stateVal) {
if (attrsType === 'bool') {
if (stateVal) {
this.setAttribute(normalizedKey, '');
} else {
this.removeAttribute(normalizedKey);
}
} else if (stateVal == null && (attrsType === 'string' || attrsType === 'number')) {
this.removeAttribute(normalizedKey);
} else {
this.setAttribute(normalizedKey, encodeAttrVal(stateVal, attrsType));
}
}
}
}
}
}
}
define(name, _Lib0Component);
// @ts-ignore
return _Lib0Component
};
/**
* @param {function} definer function that defines a component when executed
*/
const createComponentDefiner = definer => {
/**
* @type {any}
*/
let defined = null;
return () => {
if (!defined) {
defined = definer();
}
return defined
}
};
const defineListComponent = createComponentDefiner(() => {
const ListItem = createComponent('lib0-list-item', {
template: '<slot name="content"></slot>',
slots: state => ({
content: `<div>${state}</div>`
})
});
return createComponent('lib0-list', {
state: { list: /** @type {Array<string>} */ ([]), Item: ListItem },
onStateChange: (state, prevState, component) => {
if (state == null) {
return
}
const { list = /** @type {Array<any>} */ ([]), Item = ListItem } = state;
// @todo deep compare here by providing another parameter to simpleDiffArray
let { index, remove, insert } = diff.simpleDiffArray(prevState ? prevState.list : [], list, _function.equalityFlat);
if (remove === 0 && insert.length === 0) {
return
}
let child = /** @type {Lib0Component<any>} */ (component.firstChild);
while (index-- > 0) {
child = /** @type {Lib0Component<any>} */ (child.nextElementSibling);
}
let insertStart = 0;
while (insertStart < insert.length && remove-- > 0) {
// update existing state
child.setState(insert[insertStart++]);
child = /** @type {Lib0Component<any>} */ (child.nextElementSibling);
}
while (remove-- > 0) {
// remove remaining
const prevChild = child;
child = /** @type {Lib0Component<any>} */ (child.nextElementSibling);
component.removeChild(prevChild);
}
// insert remaining
component.insertBefore(dom.fragment(insert.slice(insertStart).map(/** @param {any} insState */ insState => {
const el = new Item();
el.setState(insState);
return el
})), child);
}
})
});
const defineLazyLoadingComponent = createComponentDefiner(() => createComponent('lib0-lazy', {
state: /** @type {{component:null|String,import:null|function():Promise<any>,state:null|object}} */ ({
component: null, import: null, state: null
}),
attrs: {
component: 'string'
},
onStateChange: ({ component, state, import: getImport }, prevState, componentEl) => {
if (component !== null) {
if (getImport) {
getImport();
}
if (!prevState || component !== prevState.component) {
const el = /** @type {any} */ (dom.createElement(component));
componentEl.innerHTML = '';
componentEl.insertBefore(el, null);
}
const el = /** @type {any} */ (componentEl.firstElementChild);
// @todo generalize setting state and check if setState is defined
if (el.setState) {
el.setState(state);
}
}
}
}));
exports.Lib0Component = Lib0Component;
exports.createComponent = createComponent;
exports.createComponentDefiner = createComponentDefiner;
exports.define = define;
exports.defineLazyLoadingComponent = defineLazyLoadingComponent;
exports.defineListComponent = defineListComponent;
exports.registry = registry;
exports.whenDefined = whenDefined;
//# sourceMappingURL=component.cjs.map

1
yjs-poll/node_modules/lib0/dist/component.cjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

86
yjs-poll/node_modules/lib0/dist/component.d.ts generated vendored Normal file
View File

@@ -0,0 +1,86 @@
/**
* @type {CustomElementRegistry}
*/
export const registry: CustomElementRegistry;
export function define(name: string, constr: any, opts?: ElementDefinitionOptions): void;
export function whenDefined(name: string): Promise<CustomElementConstructor>;
/**
* @template S
*/
export class Lib0Component<S> extends HTMLElement {
/**
* @param {S} [state]
*/
constructor(state?: S);
/**
* @type {S|null}
*/
state: S | null;
/**
* @type {any}
*/
_internal: any;
/**
* @param {S} _state
* @param {boolean} [_forceStateUpdate] Force that the state is rerendered even if state didn't change
*/
setState(_state: S, _forceStateUpdate?: boolean): void;
/**
* @param {any} _stateUpdate
*/
updateState(_stateUpdate: any): void;
}
export function createComponent<T>(name: string, { template, style, state: defaultState, onStateChange, childStates, attrs, listeners, slots }: CONF<T>): typeof Lib0Component;
export function createComponentDefiner(definer: Function): () => any;
export function defineListComponent(): any;
export function defineLazyLoadingComponent(): any;
export type CONF<S> = {
/**
* Template for the shadow dom.
*/
template?: string | null | undefined;
/**
* shadow dom style. Is only used when
* `CONF.template` is defined
*/
style?: string | undefined;
/**
* Initial component state.
*/
state?: S | undefined;
/**
* Called when
* the state changes.
*/
onStateChange?: ((arg0: S, arg1: S | null, arg2: Lib0Component<S>) => void) | undefined;
/**
* maps from
* CSS-selector to transformer function. The first element that matches the
* CSS-selector receives state updates via the transformer function.
*/
childStates?: {
[x: string]: (arg0: any, arg1: any) => Object;
} | undefined;
/**
* attrs-keys and state-keys should be camelCase, but the DOM uses kebap-case. I.e.
* `attrs = { myAttr: 4 }` is represeted as `<my-elem my-attr="4" />` in the DOM
*/
attrs?: {
[x: string]: "string" | "number" | "json" | "bool";
} | undefined;
/**
* Maps from dom-event-name
* to event listener.
*/
listeners?: {
[x: string]: (arg0: CustomEvent, arg1: Lib0Component<any>) => boolean | void;
} | undefined;
/**
* Fill slots
* automatically when state changes. Maps from slot-name to slot-html.
*/
slots?: ((arg0: S, arg1: S, arg2: Lib0Component<S>) => {
[x: string]: string;
}) | undefined;
};
//# sourceMappingURL=component.d.ts.map

1
yjs-poll/node_modules/lib0/dist/component.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../component.js"],"names":[],"mappings":"AAiBA;;GAEG;AACH,uBAFU,qBAAqB,CAEO;AAO/B,6BAJI,MAAM,UACN,GAAG,SACH,wBAAwB,QAE8C;AAM1E,kCAHI,MAAM,GACL,OAAO,CAAC,wBAAwB,CAAC,CAEgB;AAM7D;;GAEG;AACH,2BAFa,CAAC;IAGZ;;OAEG;IACH,oBAFW,CAAC,EAYX;IARC;;OAEG;IACH,OAFU,CAAC,GAAC,IAAI,CAEuB;IACvC;;OAEG;IACH,WAFU,GAAG,CAEM;IAGrB;;;OAGG;IACH,iBAHW,CAAC,sBACD,OAAO,QAE4B;IAE9C;;QAEI;IACJ,0BAFY,GAAG,QAEe;CAC/B;AA6DM,gCALM,CAAC,QACH,MAAM,iGACN,IAAI,CAAC,CAAC,CAAC,GACN,OAAO,aAAa,CAuM/B;AAKM,qEAWN;AANQ,2CAKN;AALM,kDAKN;iBA9OU,CAAC;;;;;;;;;;;;;;;;;;4BAMS,CAAC,QAAC,CAAC,GAAC,IAAI,QAAC,aAAa,CAAC,CAAC,CAAC,KAAE,IAAI;;;;;;;4BAEjB,GAAG,QAAE,GAAG,KAAE,MAAM;;;;;;;;;;;;;;4BAMf,WAAW,QAAE,aAAa,CAAC,GAAG,CAAC,KAAE,OAAO,GAAC,IAAI;;;;;;oBAE5D,CAAC,QAAE,CAAC,QAAE,aAAa,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,24 @@
'use strict';
/**
* Often used conditions.
*
* @module conditions
*/
/**
* @template T
* @param {T|null|undefined} v
* @return {T|null}
*/
/* c8 ignore next */
const undefinedToNull = v => v === undefined ? null : v;
var conditions = /*#__PURE__*/Object.freeze({
__proto__: null,
undefinedToNull: undefinedToNull
});
exports.conditions = conditions;
exports.undefinedToNull = undefinedToNull;
//# sourceMappingURL=conditions-f5c0c102.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"conditions-f5c0c102.cjs","sources":["../conditions.js"],"sourcesContent":["/**\n * Often used conditions.\n *\n * @module conditions\n */\n\n/**\n * @template T\n * @param {T|null|undefined} v\n * @return {T|null}\n */\n/* c8 ignore next */\nexport const undefinedToNull = v => v === undefined ? null : v\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,eAAe,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,GAAG,IAAI,GAAG;;;;;;;;;;"}

10
yjs-poll/node_modules/lib0/dist/conditions.cjs generated vendored Normal file
View File

@@ -0,0 +1,10 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var conditions = require('./conditions-f5c0c102.cjs');
exports.undefinedToNull = conditions.undefinedToNull;
//# sourceMappingURL=conditions.cjs.map

1
yjs-poll/node_modules/lib0/dist/conditions.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"conditions.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}

2
yjs-poll/node_modules/lib0/dist/conditions.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export function undefinedToNull<T>(v: T | null | undefined): T | null;
//# sourceMappingURL=conditions.d.ts.map

1
yjs-poll/node_modules/lib0/dist/conditions.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../conditions.js"],"names":[],"mappings":"AAYO,gCALM,CAAC,KACH,CAAC,GAAC,IAAI,GAAC,SAAS,GACf,CAAC,GAAC,IAAI,CAG4C"}

9
yjs-poll/node_modules/lib0/dist/crypto.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export function testJwt(_tc: t.TestCase): Promise<void>;
export function testEncryption(tc: t.TestCase): Promise<void>;
export function testReapeatEncryption(tc: t.TestCase): Promise<void>;
export function testImportExport(tc: t.TestCase): Promise<void>;
export function testEncryptionPerformance(tc: t.TestCase): Promise<void>;
export function testConsistentKeyGeneration(_tc: t.TestCase): Promise<void>;
export function testSigning(tc: t.TestCase): Promise<void>;
import * as t from './testing.js';
//# sourceMappingURL=crypto.test.d.ts.map

1
yjs-poll/node_modules/lib0/dist/crypto.test.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"crypto.test.d.ts","sourceRoot":"","sources":["../crypto.test.js"],"names":[],"mappings":"AAYO,6BAFI,CAAC,CAAC,QAAQ,iBA8BpB;AAKM,mCAFI,CAAC,CAAC,QAAQ,iBAoCpB;AAKM,0CAFI,CAAC,CAAC,QAAQ,iBA8BpB;AAKM,qCAFI,CAAC,CAAC,QAAQ,iBAgDpB;AAKM,8CAFI,CAAC,CAAC,QAAQ,iBAwCpB;AAKM,iDAFI,CAAC,CAAC,QAAQ,iBA2EpB;AAKM,gCAFI,CAAC,CAAC,QAAQ,iBAapB;mBAvSkB,cAAc"}

17
yjs-poll/node_modules/lib0/dist/crypto/aes-gcm.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
export function encrypt(key: CryptoKey, data: Uint8Array<ArrayBuffer>): Promise<Uint8Array<ArrayBuffer>>;
export function decrypt(key: CryptoKey, data: Uint8Array<ArrayBuffer>): PromiseLike<Uint8Array>;
export function importKeyJwk(jwk: any, { usages, extractable }?: {
usages?: Usages | undefined;
extractable?: boolean | undefined;
}): Promise<CryptoKey>;
export function importKeyRaw(raw: Uint8Array<ArrayBuffer>, { usages, extractable }?: {
usages?: Usages | undefined;
extractable?: boolean | undefined;
}): Promise<CryptoKey>;
export function deriveKey(secret: Uint8Array<ArrayBuffer> | string, salt: Uint8Array<ArrayBuffer> | string, { extractable, usages }?: {
extractable?: boolean | undefined;
usages?: Usages | undefined;
}): Promise<CryptoKey>;
export type Usages = Array<"encrypt" | "decrypt">;
export { exportKeyJwk, exportKeyRaw } from "./common.js";
//# sourceMappingURL=aes-gcm.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"aes-gcm.d.ts","sourceRoot":"","sources":["../../crypto/aes-gcm.js"],"names":[],"mappings":"AAuBO,6BAHI,SAAS,QACT,UAAU,CAAC,WAAW,CAAC,oCAkBjC;AAWM,6BAJI,SAAS,QACT,UAAU,CAAC,WAAW,CAAC,GACtB,WAAW,CAAC,UAAU,CAAC,CAclC;AAaM,kCALI,GAAG,4BAEX;IAAsB,MAAM;IACL,WAAW;CAAC,sBAQrC;AAUM,kCALI,UAAU,CAAC,WAAW,CAAC,4BAE/B;IAAsB,MAAM;IACL,WAAW;CAAC,sBAG0D;AAmBzF,kCANI,UAAU,CAAC,WAAW,CAAC,GAAC,MAAM,QAC9B,UAAU,CAAC,WAAW,CAAC,GAAC,MAAM,4BAEtC;IAAuB,WAAW;IACZ,MAAM;CAAC,sBAsB7B;qBAxHU,KAAK,CAAC,SAAS,GAAC,SAAS,CAAC"}

3
yjs-poll/node_modules/lib0/dist/crypto/common.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export function exportKeyJwk(key: CryptoKey): Promise<JsonWebKey>;
export function exportKeyRaw(key: CryptoKey): Promise<Uint8Array<ArrayBuffer>>;
//# sourceMappingURL=common.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../crypto/common.js"],"names":[],"mappings":"AAKO,kCAFI,SAAS,uBAMnB;AAQM,kCAHI,SAAS,GACR,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAG6B"}

17
yjs-poll/node_modules/lib0/dist/crypto/ecdsa.d.ts generated vendored Normal file
View File

@@ -0,0 +1,17 @@
export function sign(key: CryptoKey, data: Uint8Array<ArrayBuffer>): PromiseLike<Uint8Array<ArrayBuffer>>;
export function verify(key: CryptoKey, signature: Uint8Array<ArrayBuffer>, data: Uint8Array<ArrayBuffer>): PromiseLike<boolean>;
export function generateKeyPair({ extractable, usages }?: {
extractable?: boolean | undefined;
usages?: Usages | undefined;
}): Promise<CryptoKeyPair>;
export function importKeyJwk(jwk: any, { extractable, usages }?: {
extractable?: boolean | undefined;
usages?: Usages | undefined;
}): Promise<CryptoKey>;
export function importKeyRaw(raw: any, { extractable, usages }?: {
extractable?: boolean | undefined;
usages?: Usages | undefined;
}): Promise<CryptoKey>;
export type Usages = Array<"sign" | "verify">;
export { exportKeyJwk, exportKeyRaw } from "./common.js";
//# sourceMappingURL=ecdsa.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ecdsa.d.ts","sourceRoot":"","sources":["../../crypto/ecdsa.js"],"names":[],"mappings":"AA8BO,0BAJI,SAAS,QACT,UAAU,CAAC,WAAW,CAAC,GACtB,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAOA;AAYzC,4BALI,SAAS,aACT,UAAU,CAAC,WAAW,CAAC,QACvB,UAAU,CAAC,WAAW,CAAC,GACtB,WAAW,CAAC,OAAO,CAAC,CAQ7B;AAaI,0DAHJ;IAAuB,WAAW;IACZ,MAAM;CAAC,0BAO7B;AAQI,kCALI,GAAG,4BAEX;IAAuB,WAAW;IACZ,MAAM;CAAC,sBAQ/B;AAUM,kCALI,GAAG,4BAEX;IAAuB,WAAW;IACZ,MAAM;CAAC,sBAGkD;qBAxFrE,KAAK,CAAC,MAAM,GAAC,QAAQ,CAAC"}

10
yjs-poll/node_modules/lib0/dist/crypto/jwt.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
export function encodeJwt(privateKey: CryptoKey, payload: Object): PromiseLike<string>;
export function verifyJwt(publicKey: CryptoKey, jwt: string): Promise<{
header: any;
payload: any;
}>;
export function unsafeDecode(jwt: string): {
header: any;
payload: any;
};
//# sourceMappingURL=jwt.d.ts.map

1
yjs-poll/node_modules/lib0/dist/crypto/jwt.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../crypto/jwt.js"],"names":[],"mappings":"AAqBO,sCAHI,SAAS,WACT,MAAM,uBAgBhB;AAMM,qCAHI,SAAS,OACT,MAAM;;;GAiBhB;AAOM,kCAFI,MAAM;;;EAQhB"}

13
yjs-poll/node_modules/lib0/dist/crypto/rsa-oaep.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
export { exportKeyJwk } from "./common.js";
export function encrypt(key: CryptoKey, data: Uint8Array<ArrayBuffer>): PromiseLike<Uint8Array<ArrayBuffer>>;
export function decrypt(key: CryptoKey, data: Uint8Array<ArrayBuffer>): PromiseLike<Uint8Array>;
export function generateKeyPair({ extractable, usages }?: {
extractable?: boolean | undefined;
usages?: Usages | undefined;
}): Promise<CryptoKeyPair>;
export function importKeyJwk(jwk: any, { extractable, usages }?: {
extractable?: boolean | undefined;
usages?: Usages | undefined;
}): Promise<CryptoKey>;
export type Usages = Array<"encrypt" | "decrypt">;
//# sourceMappingURL=rsa-oaep.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"rsa-oaep.d.ts","sourceRoot":"","sources":["../../crypto/rsa-oaep.js"],"names":[],"mappings":";AAuBO,6BAJI,SAAS,QACT,UAAU,CAAC,WAAW,CAAC,GACtB,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CASZ;AAW7B,6BAJI,SAAS,QACT,UAAU,CAAC,WAAW,CAAC,GACtB,WAAW,CAAC,UAAU,CAAC,CASG;AAQ/B,0DAJJ;IAAuB,WAAW;IACZ,MAAM;CAC5B,GAAS,OAAO,CAAC,aAAa,CAAC,CAY/B;AAQI,kCALI,GAAG,4BAEX;IAAuB,WAAW;IACZ,MAAM;CAAC,sBAQ/B;qBAxEY,KAAK,CAAC,SAAS,GAAC,SAAS,CAAC"}

795
yjs-poll/node_modules/lib0/dist/decoding-76e75827.cjs generated vendored Normal file
View File

@@ -0,0 +1,795 @@
'use strict';
var binary = require('./binary-ac8e39e2.cjs');
var math = require('./math-96d5e8c4.cjs');
var number = require('./number-1fb57bba.cjs');
var string = require('./string-fddc5f8b.cjs');
var error = require('./error-0c1f634f.cjs');
var encoding = require('./encoding-1a745c43.cjs');
/**
* Efficient schema-less binary decoding with support for variable length encoding.
*
* Use [lib0/decoding] with [lib0/encoding]. Every encoding function has a corresponding decoding function.
*
* Encodes numbers in little-endian order (least to most significant byte order)
* and is compatible with Golang's binary encoding (https://golang.org/pkg/encoding/binary/)
* which is also used in Protocol Buffers.
*
* ```js
* // encoding step
* const encoder = encoding.createEncoder()
* encoding.writeVarUint(encoder, 256)
* encoding.writeVarString(encoder, 'Hello world!')
* const buf = encoding.toUint8Array(encoder)
* ```
*
* ```js
* // decoding step
* const decoder = decoding.createDecoder(buf)
* decoding.readVarUint(decoder) // => 256
* decoding.readVarString(decoder) // => 'Hello world!'
* decoding.hasContent(decoder) // => false - all data is read
* ```
*
* @module decoding
*/
const errorUnexpectedEndOfArray = error.create('Unexpected end of array');
const errorIntegerOutOfRange = error.create('Integer out of Range');
/**
* A Decoder handles the decoding of an Uint8Array.
* @template {ArrayBufferLike} [Buf=ArrayBufferLike]
*/
class Decoder {
/**
* @param {Uint8Array<Buf>} uint8Array Binary data to decode
*/
constructor (uint8Array) {
/**
* Decoding target.
*
* @type {Uint8Array<Buf>}
*/
this.arr = uint8Array;
/**
* Current decoding position.
*
* @type {number}
*/
this.pos = 0;
}
}
/**
* @function
* @template {ArrayBufferLike} Buf
* @param {Uint8Array<Buf>} uint8Array
* @return {Decoder<Buf>}
*/
const createDecoder = uint8Array => new Decoder(uint8Array);
/**
* @function
* @param {Decoder} decoder
* @return {boolean}
*/
const hasContent = decoder => decoder.pos !== decoder.arr.length;
/**
* Clone a decoder instance.
* Optionally set a new position parameter.
*
* @function
* @param {Decoder} decoder The decoder instance
* @param {number} [newPos] Defaults to current position
* @return {Decoder} A clone of `decoder`
*/
const clone = (decoder, newPos = decoder.pos) => {
const _decoder = createDecoder(decoder.arr);
_decoder.pos = newPos;
return _decoder
};
/**
* Create an Uint8Array view of the next `len` bytes and advance the position by `len`.
*
* Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.
* Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.
*
* @function
* @template {ArrayBufferLike} Buf
* @param {Decoder<Buf>} decoder The decoder instance
* @param {number} len The length of bytes to read
* @return {Uint8Array<Buf>}
*/
const readUint8Array = (decoder, len) => {
const view = new Uint8Array(decoder.arr.buffer, decoder.pos + decoder.arr.byteOffset, len);
decoder.pos += len;
return view
};
/**
* Read variable length Uint8Array.
*
* Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.
* Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.
*
* @function
* @template {ArrayBufferLike} Buf
* @param {Decoder<Buf>} decoder
* @return {Uint8Array<Buf>}
*/
const readVarUint8Array = decoder => readUint8Array(decoder, readVarUint(decoder));
/**
* Read the rest of the content as an ArrayBuffer
* @function
* @param {Decoder} decoder
* @return {Uint8Array}
*/
const readTailAsUint8Array = decoder => readUint8Array(decoder, decoder.arr.length - decoder.pos);
/**
* Skip one byte, jump to the next position.
* @function
* @param {Decoder} decoder The decoder instance
* @return {number} The next position
*/
const skip8 = decoder => decoder.pos++;
/**
* Read one byte as unsigned integer.
* @function
* @param {Decoder} decoder The decoder instance
* @return {number} Unsigned 8-bit integer
*/
const readUint8 = decoder => decoder.arr[decoder.pos++];
/**
* Read 2 bytes as unsigned integer.
*
* @function
* @param {Decoder} decoder
* @return {number} An unsigned integer.
*/
const readUint16 = decoder => {
const uint =
decoder.arr[decoder.pos] +
(decoder.arr[decoder.pos + 1] << 8);
decoder.pos += 2;
return uint
};
/**
* Read 4 bytes as unsigned integer.
*
* @function
* @param {Decoder} decoder
* @return {number} An unsigned integer.
*/
const readUint32 = decoder => {
const uint =
(decoder.arr[decoder.pos] +
(decoder.arr[decoder.pos + 1] << 8) +
(decoder.arr[decoder.pos + 2] << 16) +
(decoder.arr[decoder.pos + 3] << 24)) >>> 0;
decoder.pos += 4;
return uint
};
/**
* Read 4 bytes as unsigned integer in big endian order.
* (most significant byte first)
*
* @function
* @param {Decoder} decoder
* @return {number} An unsigned integer.
*/
const readUint32BigEndian = decoder => {
const uint =
(decoder.arr[decoder.pos + 3] +
(decoder.arr[decoder.pos + 2] << 8) +
(decoder.arr[decoder.pos + 1] << 16) +
(decoder.arr[decoder.pos] << 24)) >>> 0;
decoder.pos += 4;
return uint
};
/**
* Look ahead without incrementing the position
* to the next byte and read it as unsigned integer.
*
* @function
* @param {Decoder} decoder
* @return {number} An unsigned integer.
*/
const peekUint8 = decoder => decoder.arr[decoder.pos];
/**
* Look ahead without incrementing the position
* to the next byte and read it as unsigned integer.
*
* @function
* @param {Decoder} decoder
* @return {number} An unsigned integer.
*/
const peekUint16 = decoder =>
decoder.arr[decoder.pos] +
(decoder.arr[decoder.pos + 1] << 8);
/**
* Look ahead without incrementing the position
* to the next byte and read it as unsigned integer.
*
* @function
* @param {Decoder} decoder
* @return {number} An unsigned integer.
*/
const peekUint32 = decoder => (
decoder.arr[decoder.pos] +
(decoder.arr[decoder.pos + 1] << 8) +
(decoder.arr[decoder.pos + 2] << 16) +
(decoder.arr[decoder.pos + 3] << 24)
) >>> 0;
/**
* Read unsigned integer (32bit) with variable length.
* 1/8th of the storage is used as encoding overhead.
* * numbers < 2^7 is stored in one bytlength
* * numbers < 2^14 is stored in two bylength
*
* @function
* @param {Decoder} decoder
* @return {number} An unsigned integer.length
*/
const readVarUint = decoder => {
let num = 0;
let mult = 1;
const len = decoder.arr.length;
while (decoder.pos < len) {
const r = decoder.arr[decoder.pos++];
// num = num | ((r & binary.BITS7) << len)
num = num + (r & binary.BITS7) * mult; // shift $r << (7*#iterations) and add it to num
mult *= 128; // next iteration, shift 7 "more" to the left
if (r < binary.BIT8) {
return num
}
/* c8 ignore start */
if (num > number.MAX_SAFE_INTEGER) {
throw errorIntegerOutOfRange
}
/* c8 ignore stop */
}
throw errorUnexpectedEndOfArray
};
/**
* Read signed integer (32bit) with variable length.
* 1/8th of the storage is used as encoding overhead.
* * numbers < 2^7 is stored in one bytlength
* * numbers < 2^14 is stored in two bylength
* @todo This should probably create the inverse ~num if number is negative - but this would be a breaking change.
*
* @function
* @param {Decoder} decoder
* @return {number} An unsigned integer.length
*/
const readVarInt = decoder => {
let r = decoder.arr[decoder.pos++];
let num = r & binary.BITS6;
let mult = 64;
const sign = (r & binary.BIT7) > 0 ? -1 : 1;
if ((r & binary.BIT8) === 0) {
// don't continue reading
return sign * num
}
const len = decoder.arr.length;
while (decoder.pos < len) {
r = decoder.arr[decoder.pos++];
// num = num | ((r & binary.BITS7) << len)
num = num + (r & binary.BITS7) * mult;
mult *= 128;
if (r < binary.BIT8) {
return sign * num
}
/* c8 ignore start */
if (num > number.MAX_SAFE_INTEGER) {
throw errorIntegerOutOfRange
}
/* c8 ignore stop */
}
throw errorUnexpectedEndOfArray
};
/**
* Look ahead and read varUint without incrementing position
*
* @function
* @param {Decoder} decoder
* @return {number}
*/
const peekVarUint = decoder => {
const pos = decoder.pos;
const s = readVarUint(decoder);
decoder.pos = pos;
return s
};
/**
* Look ahead and read varUint without incrementing position
*
* @function
* @param {Decoder} decoder
* @return {number}
*/
const peekVarInt = decoder => {
const pos = decoder.pos;
const s = readVarInt(decoder);
decoder.pos = pos;
return s
};
/**
* We don't test this function anymore as we use native decoding/encoding by default now.
* Better not modify this anymore..
*
* Transforming utf8 to a string is pretty expensive. The code performs 10x better
* when String.fromCodePoint is fed with all characters as arguments.
* But most environments have a maximum number of arguments per functions.
* For effiency reasons we apply a maximum of 10000 characters at once.
*
* @function
* @param {Decoder} decoder
* @return {String} The read String.
*/
/* c8 ignore start */
const _readVarStringPolyfill = decoder => {
let remainingLen = readVarUint(decoder);
if (remainingLen === 0) {
return ''
} else {
let encodedString = String.fromCodePoint(readUint8(decoder)); // remember to decrease remainingLen
if (--remainingLen < 100) { // do not create a Uint8Array for small strings
while (remainingLen--) {
encodedString += String.fromCodePoint(readUint8(decoder));
}
} else {
while (remainingLen > 0) {
const nextLen = remainingLen < 10000 ? remainingLen : 10000;
// this is dangerous, we create a fresh array view from the existing buffer
const bytes = decoder.arr.subarray(decoder.pos, decoder.pos + nextLen);
decoder.pos += nextLen;
// Starting with ES5.1 we can supply a generic array-like object as arguments
encodedString += String.fromCodePoint.apply(null, /** @type {any} */ (bytes));
remainingLen -= nextLen;
}
}
return decodeURIComponent(escape(encodedString))
}
};
/* c8 ignore stop */
/**
* @function
* @param {Decoder} decoder
* @return {String} The read String
*/
const _readVarStringNative = decoder =>
/** @type any */ (string.utf8TextDecoder).decode(readVarUint8Array(decoder));
/**
* Read string of variable length
* * varUint is used to store the length of the string
*
* @function
* @param {Decoder} decoder
* @return {String} The read String
*
*/
/* c8 ignore next */
const readVarString = string.utf8TextDecoder ? _readVarStringNative : _readVarStringPolyfill;
/**
* @param {Decoder} decoder
* @return {Uint8Array}
*/
const readTerminatedUint8Array = decoder => {
const encoder = encoding.createEncoder();
let b;
while (true) {
b = readUint8(decoder);
if (b === 0) {
return encoding.toUint8Array(encoder)
}
if (b === 1) {
b = readUint8(decoder);
}
encoding.write(encoder, b);
}
};
/**
* @param {Decoder} decoder
* @return {string}
*/
const readTerminatedString = decoder => string.decodeUtf8(readTerminatedUint8Array(decoder));
/**
* Look ahead and read varString without incrementing position
*
* @function
* @param {Decoder} decoder
* @return {string}
*/
const peekVarString = decoder => {
const pos = decoder.pos;
const s = readVarString(decoder);
decoder.pos = pos;
return s
};
/**
* @param {Decoder} decoder
* @param {number} len
* @return {DataView}
*/
const readFromDataView = (decoder, len) => {
const dv = new DataView(decoder.arr.buffer, decoder.arr.byteOffset + decoder.pos, len);
decoder.pos += len;
return dv
};
/**
* @param {Decoder} decoder
*/
const readFloat32 = decoder => readFromDataView(decoder, 4).getFloat32(0, false);
/**
* @param {Decoder} decoder
*/
const readFloat64 = decoder => readFromDataView(decoder, 8).getFloat64(0, false);
/**
* @param {Decoder} decoder
*/
const readBigInt64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigInt64(0, false);
/**
* @param {Decoder} decoder
*/
const readBigUint64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigUint64(0, false);
/**
* @type {Array<function(Decoder):any>}
*/
const readAnyLookupTable = [
decoder => undefined, // CASE 127: undefined
decoder => null, // CASE 126: null
readVarInt, // CASE 125: integer
readFloat32, // CASE 124: float32
readFloat64, // CASE 123: float64
readBigInt64, // CASE 122: bigint
decoder => false, // CASE 121: boolean (false)
decoder => true, // CASE 120: boolean (true)
readVarString, // CASE 119: string
decoder => { // CASE 118: object<string,any>
const len = readVarUint(decoder);
/**
* @type {Object<string,any>}
*/
const obj = {};
for (let i = 0; i < len; i++) {
const key = readVarString(decoder);
obj[key] = readAny(decoder);
}
return obj
},
decoder => { // CASE 117: array<any>
const len = readVarUint(decoder);
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(readAny(decoder));
}
return arr
},
readVarUint8Array // CASE 116: Uint8Array
];
/**
* @param {Decoder} decoder
*/
const readAny = decoder => readAnyLookupTable[127 - readUint8(decoder)](decoder);
/**
* T must not be null.
*
* @template T
*/
class RleDecoder extends Decoder {
/**
* @param {Uint8Array} uint8Array
* @param {function(Decoder):T} reader
*/
constructor (uint8Array, reader) {
super(uint8Array);
/**
* The reader
*/
this.reader = reader;
/**
* Current state
* @type {T|null}
*/
this.s = null;
this.count = 0;
}
read () {
if (this.count === 0) {
this.s = this.reader(this);
if (hasContent(this)) {
this.count = readVarUint(this) + 1; // see encoder implementation for the reason why this is incremented
} else {
this.count = -1; // read the current value forever
}
}
this.count--;
return /** @type {T} */ (this.s)
}
}
class IntDiffDecoder extends Decoder {
/**
* @param {Uint8Array} uint8Array
* @param {number} start
*/
constructor (uint8Array, start) {
super(uint8Array);
/**
* Current state
* @type {number}
*/
this.s = start;
}
/**
* @return {number}
*/
read () {
this.s += readVarInt(this);
return this.s
}
}
class RleIntDiffDecoder extends Decoder {
/**
* @param {Uint8Array} uint8Array
* @param {number} start
*/
constructor (uint8Array, start) {
super(uint8Array);
/**
* Current state
* @type {number}
*/
this.s = start;
this.count = 0;
}
/**
* @return {number}
*/
read () {
if (this.count === 0) {
this.s += readVarInt(this);
if (hasContent(this)) {
this.count = readVarUint(this) + 1; // see encoder implementation for the reason why this is incremented
} else {
this.count = -1; // read the current value forever
}
}
this.count--;
return /** @type {number} */ (this.s)
}
}
class UintOptRleDecoder extends Decoder {
/**
* @param {Uint8Array} uint8Array
*/
constructor (uint8Array) {
super(uint8Array);
/**
* @type {number}
*/
this.s = 0;
this.count = 0;
}
read () {
if (this.count === 0) {
this.s = readVarInt(this);
// if the sign is negative, we read the count too, otherwise count is 1
const isNegative = math.isNegativeZero(this.s);
this.count = 1;
if (isNegative) {
this.s = -this.s;
this.count = readVarUint(this) + 2;
}
}
this.count--;
return /** @type {number} */ (this.s)
}
}
class IncUintOptRleDecoder extends Decoder {
/**
* @param {Uint8Array} uint8Array
*/
constructor (uint8Array) {
super(uint8Array);
/**
* @type {number}
*/
this.s = 0;
this.count = 0;
}
read () {
if (this.count === 0) {
this.s = readVarInt(this);
// if the sign is negative, we read the count too, otherwise count is 1
const isNegative = math.isNegativeZero(this.s);
this.count = 1;
if (isNegative) {
this.s = -this.s;
this.count = readVarUint(this) + 2;
}
}
this.count--;
return /** @type {number} */ (this.s++)
}
}
class IntDiffOptRleDecoder extends Decoder {
/**
* @param {Uint8Array} uint8Array
*/
constructor (uint8Array) {
super(uint8Array);
/**
* @type {number}
*/
this.s = 0;
this.count = 0;
this.diff = 0;
}
/**
* @return {number}
*/
read () {
if (this.count === 0) {
const diff = readVarInt(this);
// if the first bit is set, we read more data
const hasCount = diff & 1;
this.diff = math.floor(diff / 2); // shift >> 1
this.count = 1;
if (hasCount) {
this.count = readVarUint(this) + 2;
}
}
this.s += this.diff;
this.count--;
return this.s
}
}
class StringDecoder {
/**
* @param {Uint8Array} uint8Array
*/
constructor (uint8Array) {
this.decoder = new UintOptRleDecoder(uint8Array);
this.str = readVarString(this.decoder);
/**
* @type {number}
*/
this.spos = 0;
}
/**
* @return {string}
*/
read () {
const end = this.spos + this.decoder.read();
const res = this.str.slice(this.spos, end);
this.spos = end;
return res
}
}
var decoding = /*#__PURE__*/Object.freeze({
__proto__: null,
Decoder: Decoder,
createDecoder: createDecoder,
hasContent: hasContent,
clone: clone,
readUint8Array: readUint8Array,
readVarUint8Array: readVarUint8Array,
readTailAsUint8Array: readTailAsUint8Array,
skip8: skip8,
readUint8: readUint8,
readUint16: readUint16,
readUint32: readUint32,
readUint32BigEndian: readUint32BigEndian,
peekUint8: peekUint8,
peekUint16: peekUint16,
peekUint32: peekUint32,
readVarUint: readVarUint,
readVarInt: readVarInt,
peekVarUint: peekVarUint,
peekVarInt: peekVarInt,
_readVarStringPolyfill: _readVarStringPolyfill,
_readVarStringNative: _readVarStringNative,
readVarString: readVarString,
readTerminatedUint8Array: readTerminatedUint8Array,
readTerminatedString: readTerminatedString,
peekVarString: peekVarString,
readFromDataView: readFromDataView,
readFloat32: readFloat32,
readFloat64: readFloat64,
readBigInt64: readBigInt64,
readBigUint64: readBigUint64,
readAny: readAny,
RleDecoder: RleDecoder,
IntDiffDecoder: IntDiffDecoder,
RleIntDiffDecoder: RleIntDiffDecoder,
UintOptRleDecoder: UintOptRleDecoder,
IncUintOptRleDecoder: IncUintOptRleDecoder,
IntDiffOptRleDecoder: IntDiffOptRleDecoder,
StringDecoder: StringDecoder
});
exports.Decoder = Decoder;
exports.IncUintOptRleDecoder = IncUintOptRleDecoder;
exports.IntDiffDecoder = IntDiffDecoder;
exports.IntDiffOptRleDecoder = IntDiffOptRleDecoder;
exports.RleDecoder = RleDecoder;
exports.RleIntDiffDecoder = RleIntDiffDecoder;
exports.StringDecoder = StringDecoder;
exports.UintOptRleDecoder = UintOptRleDecoder;
exports._readVarStringNative = _readVarStringNative;
exports._readVarStringPolyfill = _readVarStringPolyfill;
exports.clone = clone;
exports.createDecoder = createDecoder;
exports.decoding = decoding;
exports.hasContent = hasContent;
exports.peekUint16 = peekUint16;
exports.peekUint32 = peekUint32;
exports.peekUint8 = peekUint8;
exports.peekVarInt = peekVarInt;
exports.peekVarString = peekVarString;
exports.peekVarUint = peekVarUint;
exports.readAny = readAny;
exports.readBigInt64 = readBigInt64;
exports.readBigUint64 = readBigUint64;
exports.readFloat32 = readFloat32;
exports.readFloat64 = readFloat64;
exports.readFromDataView = readFromDataView;
exports.readTailAsUint8Array = readTailAsUint8Array;
exports.readTerminatedString = readTerminatedString;
exports.readTerminatedUint8Array = readTerminatedUint8Array;
exports.readUint16 = readUint16;
exports.readUint32 = readUint32;
exports.readUint32BigEndian = readUint32BigEndian;
exports.readUint8 = readUint8;
exports.readUint8Array = readUint8Array;
exports.readVarInt = readVarInt;
exports.readVarString = readVarString;
exports.readVarUint = readVarUint;
exports.readVarUint8Array = readVarUint8Array;
exports.skip8 = skip8;
//# sourceMappingURL=decoding-76e75827.cjs.map

File diff suppressed because one or more lines are too long

55
yjs-poll/node_modules/lib0/dist/decoding.cjs generated vendored Normal file
View File

@@ -0,0 +1,55 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
require('./binary-ac8e39e2.cjs');
require('./math-96d5e8c4.cjs');
require('./number-1fb57bba.cjs');
require('./string-fddc5f8b.cjs');
require('./error-0c1f634f.cjs');
require('./encoding-1a745c43.cjs');
var decoding = require('./decoding-76e75827.cjs');
require('./array-78849c95.cjs');
require('./set-5b47859e.cjs');
exports.Decoder = decoding.Decoder;
exports.IncUintOptRleDecoder = decoding.IncUintOptRleDecoder;
exports.IntDiffDecoder = decoding.IntDiffDecoder;
exports.IntDiffOptRleDecoder = decoding.IntDiffOptRleDecoder;
exports.RleDecoder = decoding.RleDecoder;
exports.RleIntDiffDecoder = decoding.RleIntDiffDecoder;
exports.StringDecoder = decoding.StringDecoder;
exports.UintOptRleDecoder = decoding.UintOptRleDecoder;
exports._readVarStringNative = decoding._readVarStringNative;
exports._readVarStringPolyfill = decoding._readVarStringPolyfill;
exports.clone = decoding.clone;
exports.createDecoder = decoding.createDecoder;
exports.hasContent = decoding.hasContent;
exports.peekUint16 = decoding.peekUint16;
exports.peekUint32 = decoding.peekUint32;
exports.peekUint8 = decoding.peekUint8;
exports.peekVarInt = decoding.peekVarInt;
exports.peekVarString = decoding.peekVarString;
exports.peekVarUint = decoding.peekVarUint;
exports.readAny = decoding.readAny;
exports.readBigInt64 = decoding.readBigInt64;
exports.readBigUint64 = decoding.readBigUint64;
exports.readFloat32 = decoding.readFloat32;
exports.readFloat64 = decoding.readFloat64;
exports.readFromDataView = decoding.readFromDataView;
exports.readTailAsUint8Array = decoding.readTailAsUint8Array;
exports.readTerminatedString = decoding.readTerminatedString;
exports.readTerminatedUint8Array = decoding.readTerminatedUint8Array;
exports.readUint16 = decoding.readUint16;
exports.readUint32 = decoding.readUint32;
exports.readUint32BigEndian = decoding.readUint32BigEndian;
exports.readUint8 = decoding.readUint8;
exports.readUint8Array = decoding.readUint8Array;
exports.readVarInt = decoding.readVarInt;
exports.readVarString = decoding.readVarString;
exports.readVarUint = decoding.readVarUint;
exports.readVarUint8Array = decoding.readVarUint8Array;
exports.skip8 = decoding.skip8;
//# sourceMappingURL=decoding.cjs.map

1
yjs-poll/node_modules/lib0/dist/decoding.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"decoding.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

165
yjs-poll/node_modules/lib0/dist/decoding.d.ts generated vendored Normal file
View File

@@ -0,0 +1,165 @@
/**
* A Decoder handles the decoding of an Uint8Array.
* @template {ArrayBufferLike} [Buf=ArrayBufferLike]
*/
export class Decoder<Buf extends ArrayBufferLike = ArrayBufferLike> {
/**
* @param {Uint8Array<Buf>} uint8Array Binary data to decode
*/
constructor(uint8Array: Uint8Array<Buf>);
/**
* Decoding target.
*
* @type {Uint8Array<Buf>}
*/
arr: Uint8Array<Buf>;
/**
* Current decoding position.
*
* @type {number}
*/
pos: number;
}
export function createDecoder<Buf extends ArrayBufferLike>(uint8Array: Uint8Array<Buf>): Decoder<Buf>;
export function hasContent(decoder: Decoder): boolean;
export function clone(decoder: Decoder, newPos?: number): Decoder;
export function readUint8Array<Buf extends ArrayBufferLike>(decoder: Decoder<Buf>, len: number): Uint8Array<Buf>;
export function readVarUint8Array<Buf extends ArrayBufferLike>(decoder: Decoder<Buf>): Uint8Array<Buf>;
export function readTailAsUint8Array(decoder: Decoder): Uint8Array;
export function skip8(decoder: Decoder): number;
export function readUint8(decoder: Decoder): number;
export function readUint16(decoder: Decoder): number;
export function readUint32(decoder: Decoder): number;
export function readUint32BigEndian(decoder: Decoder): number;
export function peekUint8(decoder: Decoder): number;
export function peekUint16(decoder: Decoder): number;
export function peekUint32(decoder: Decoder): number;
export function readVarUint(decoder: Decoder): number;
export function readVarInt(decoder: Decoder): number;
export function peekVarUint(decoder: Decoder): number;
export function peekVarInt(decoder: Decoder): number;
export function _readVarStringPolyfill(decoder: Decoder): string;
export function _readVarStringNative(decoder: Decoder): string;
export function readVarString(decoder: Decoder): string;
export function readTerminatedUint8Array(decoder: Decoder): Uint8Array;
export function readTerminatedString(decoder: Decoder): string;
export function peekVarString(decoder: Decoder): string;
export function readFromDataView(decoder: Decoder, len: number): DataView;
export function readFloat32(decoder: Decoder): number;
export function readFloat64(decoder: Decoder): number;
export function readBigInt64(decoder: Decoder): any;
export function readBigUint64(decoder: Decoder): any;
export function readAny(decoder: Decoder): any;
/**
* T must not be null.
*
* @template T
*/
export class RleDecoder<T> extends Decoder<ArrayBufferLike> {
/**
* @param {Uint8Array} uint8Array
* @param {function(Decoder):T} reader
*/
constructor(uint8Array: Uint8Array, reader: (arg0: Decoder) => T);
/**
* The reader
*/
reader: (arg0: Decoder) => T;
/**
* Current state
* @type {T|null}
*/
s: T | null;
count: number;
read(): T;
}
export class IntDiffDecoder extends Decoder<ArrayBufferLike> {
/**
* @param {Uint8Array} uint8Array
* @param {number} start
*/
constructor(uint8Array: Uint8Array, start: number);
/**
* Current state
* @type {number}
*/
s: number;
/**
* @return {number}
*/
read(): number;
}
export class RleIntDiffDecoder extends Decoder<ArrayBufferLike> {
/**
* @param {Uint8Array} uint8Array
* @param {number} start
*/
constructor(uint8Array: Uint8Array, start: number);
/**
* Current state
* @type {number}
*/
s: number;
count: number;
/**
* @return {number}
*/
read(): number;
}
export class UintOptRleDecoder extends Decoder<ArrayBufferLike> {
/**
* @param {Uint8Array} uint8Array
*/
constructor(uint8Array: Uint8Array);
/**
* @type {number}
*/
s: number;
count: number;
read(): number;
}
export class IncUintOptRleDecoder extends Decoder<ArrayBufferLike> {
/**
* @param {Uint8Array} uint8Array
*/
constructor(uint8Array: Uint8Array);
/**
* @type {number}
*/
s: number;
count: number;
read(): number;
}
export class IntDiffOptRleDecoder extends Decoder<ArrayBufferLike> {
/**
* @param {Uint8Array} uint8Array
*/
constructor(uint8Array: Uint8Array);
/**
* @type {number}
*/
s: number;
count: number;
diff: number;
/**
* @return {number}
*/
read(): number;
}
export class StringDecoder {
/**
* @param {Uint8Array} uint8Array
*/
constructor(uint8Array: Uint8Array);
decoder: UintOptRleDecoder;
str: string;
/**
* @type {number}
*/
spos: number;
/**
* @return {string}
*/
read(): string;
}
//# sourceMappingURL=decoding.d.ts.map

1
yjs-poll/node_modules/lib0/dist/decoding.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"decoding.d.ts","sourceRoot":"","sources":["../decoding.js"],"names":[],"mappings":"AAsCA;;;GAGG;AACH,qBAFgC,GAAG,SAArB,eAAgB;IAG5B;;OAEG;IACH,wBAFW,UAAU,CAAC,GAAG,CAAC,EAezB;IAZC;;;;OAIG;IACH,KAFU,UAAU,CAAC,GAAG,CAAC,CAEJ;IACrB;;;;OAIG;IACH,KAFU,MAAM,CAEJ;CAEf;AAQM,8BAJwB,GAAG,SAApB,eAAgB,cACnB,UAAU,CAAC,GAAG,CAAC,GACd,OAAO,CAAC,GAAG,CAAC,CAE0C;AAO3D,oCAHI,OAAO,GACN,OAAO,CAEoD;AAWhE,+BAJI,OAAO,WACP,MAAM,GACL,OAAO,CAMlB;AAcM,+BALwB,GAAG,SAApB,eAAgB,WACnB,OAAO,CAAC,GAAG,CAAC,OACZ,MAAM,GACL,UAAU,CAAC,GAAG,CAAC,CAM1B;AAaM,kCAJwB,GAAG,SAApB,eAAgB,WACnB,OAAO,CAAC,GAAG,CAAC,GACX,UAAU,CAAC,GAAG,CAAC,CAE8D;AAQlF,8CAHI,OAAO,GACN,UAAU,CAEkF;AAQjG,+BAHI,OAAO,GACN,MAAM,CAE2B;AAQtC,mCAHI,OAAO,GACN,MAAM,CAE4C;AASvD,oCAHI,OAAO,GACN,MAAM,CAQjB;AASM,oCAHI,OAAO,GACN,MAAM,CAUjB;AAUM,6CAHI,OAAO,GACN,MAAM,CAUjB;AAUM,mCAHI,OAAO,GACN,MAAM,CAE0C;AAUrD,oCAHI,OAAO,GACN,MAAM,CAImB;AAU9B,oCAHI,OAAO,GACN,MAAM,CAOX;AAYA,qCAHI,OAAO,GACN,MAAM,CAqBjB;AAaM,oCAHI,OAAO,GACN,MAAM,CA2BjB;AASM,qCAHI,OAAO,GACN,MAAM,CAOjB;AASM,oCAHI,OAAO,GACN,MAAM,CAOjB;AAgBM,gDAJI,OAAO,UA2BjB;AAQM,8CAHI,OAAO,UAI4D;AAhCvE,uCAJI,OAAO,UA2BjB;AA2BM,kDAHI,OAAO,GACN,UAAU,CAerB;AAMM,8CAHI,OAAO,GACN,MAAM,CAEiF;AAS5F,uCAHI,OAAO,GACN,MAAM,CAOjB;AAOM,0CAJI,OAAO,OACP,MAAM,GACL,QAAQ,CAMnB;AAKM,qCAFI,OAAO,UAEqE;AAKhF,qCAFI,OAAO,UAEqE;AAKhF,sCAFI,OAAO,OAE4F;AAKvG,uCAFI,OAAO,OAE8F;AAyCzG,iCAFI,OAAO,OAEqE;AAEvF;;;;GAIG;AACH,wBAFa,CAAC;IAGZ;;;OAGG;IACH,wBAHW,UAAU,UACV,CAAS,IAAO,EAAP,OAAO,KAAE,CAAC,EAc7B;IAVC;;OAEG;IACH,eAPkB,OAAO,KAAE,CAAC,CAOR;IACpB;;;OAGG;IACH,GAFU,CAAC,GAAC,IAAI,CAEH;IACb,cAAc;IAGhB,QAUoB,CAAC,CACpB;CACF;AAED;IACE;;;OAGG;IACH,wBAHW,UAAU,SACV,MAAM,EAShB;IALC;;;OAGG;IACH,GAFU,MAAM,CAEF;IAGhB;;OAEG;IACH,QAFY,MAAM,CAKjB;CACF;AAED;IACE;;;OAGG;IACH,wBAHW,UAAU,SACV,MAAM,EAUhB;IANC;;;OAGG;IACH,GAFU,MAAM,CAEF;IACd,cAAc;IAGhB;;OAEG;IACH,QAFY,MAAM,CAajB;CACF;AAED;IACE;;OAEG;IACH,wBAFW,UAAU,EASpB;IALC;;OAEG;IACH,GAFU,MAAM,CAEN;IACV,cAAc;IAGhB,QAYoB,MAAM,CACzB;CACF;AAED;IACE;;OAEG;IACH,wBAFW,UAAU,EASpB;IALC;;OAEG;IACH,GAFU,MAAM,CAEN;IACV,cAAc;IAGhB,QAYoB,MAAM,CACzB;CACF;AAED;IACE;;OAEG;IACH,wBAFW,UAAU,EAUpB;IANC;;OAEG;IACH,GAFU,MAAM,CAEN;IACV,cAAc;IACd,aAAa;IAGf;;OAEG;IACH,QAFY,MAAM,CAgBjB;CACF;AAED;IACE;;OAEG;IACH,wBAFW,UAAU,EASpB;IANC,2BAAgD;IAChD,YAAsC;IACtC;;OAEG;IACH,MAFU,MAAM,CAEH;IAGf;;OAEG;IACH,QAFY,MAAM,CAOjB;CACF"}

2412
yjs-poll/node_modules/lib0/dist/delta.cjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
yjs-poll/node_modules/lib0/dist/delta.cjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

107
yjs-poll/node_modules/lib0/dist/delta/binding.d.ts generated vendored Normal file
View File

@@ -0,0 +1,107 @@
/**
* @template T
* @typedef {import('../schema.js').Schema<T>} Schema
*/
/**
* @template {delta.AbstractDelta} DeltaA
* @template {delta.AbstractDelta} DeltaB
*/
export class Binding<DeltaA extends delta.AbstractDelta, DeltaB extends delta.AbstractDelta> {
/**
* @param {RDT<DeltaA>} a
* @param {RDT<DeltaB>} b
* @param {dt.Template<any,DeltaA,DeltaB>} template
*/
constructor(a: RDT<DeltaA>, b: RDT<DeltaB>, template: dt.Template<any, DeltaA, DeltaB>);
/**
* @type {dt.Transformer<any,DeltaA,DeltaB>}
*/
t: dt.Transformer<any, DeltaA, DeltaB>;
a: RDT<DeltaA>;
b: RDT<DeltaB>;
_mux: mux.mutex;
_achanged: (delta: DeltaA) => void;
_bchanged: (delta: DeltaB) => void;
destroy: () => void;
}
export function bind<DeltaA extends delta.AbstractDelta, Transformer extends dt.Template<any, DeltaA, any>>(a: RDT<DeltaA>, b: RDT<Transformer extends dt.Template<any, DeltaA, infer DeltaB> ? DeltaB : never>, template: dt.Template<any, DeltaA, any>): Binding<DeltaA, Transformer extends dt.Template<any, DeltaA, infer DeltaB> ? DeltaB : never>;
export function deltaRDT<Delta extends delta.AbstractDelta>($delta: Schema<Delta>): DeltaRDT<Delta>;
export const $domDelta: any;
export function domRDT(dom: Element): DomRDT<delta.RecursiveNode<string, {
[key: string]: string;
}, never, true>>;
export type Schema<T> = import("../schema.js").Schema<T>;
/**
* Abstract Interface for a delta-based Replicated Data Type.
*/
export type RDT<Delta extends delta.AbstractDelta> = ObservableV2<{
"change": (delta: Delta) => void;
"destroy": (rdt: RDT<Delta>) => void;
}> & {
update: (delta: Delta) => any;
destroy: () => void;
};
export type DomDelta = delta.RecursiveNode<string, {
[key: string]: string;
}, never, true>;
import * as delta from './delta.js';
import * as dt from './t3.test.js';
import * as mux from '../mutex.js';
/**
* @template {delta.AbstractDelta} Delta
* @implements RDT<Delta>
* @extends {ObservableV2<{ change: (delta: Delta) => void, 'destroy': (rdt:DeltaRDT<Delta>)=>void }>}
*/
declare class DeltaRDT<Delta extends delta.AbstractDelta> extends ObservableV2<{
change: (delta: Delta) => void;
destroy: (rdt: DeltaRDT<Delta>) => void;
}> implements RDT<Delta> {
/**
* @param {Schema<Delta>} $delta
*/
constructor($delta: Schema<Delta>);
$delta: s.Schema<Delta>;
/**
* @type {Delta?}
*/
state: Delta | null;
_mux: mux.mutex;
/**
* @param {Delta} delta
*/
update: (delta: Delta) => any;
}
/**
* @typedef {delta.RecursiveNode<string, { [key:string]: string }, never, true>} DomDelta
*/
/**
* @template {DomDelta} [D=DomDelta]
* @implements RDT<D>
* @extends {ObservableV2<{ change: (delta: D)=>void, destroy: (rdt:DomRDT<D>)=>void }>}>}
*/
declare class DomRDT<D extends DomDelta = delta.RecursiveNode<string, {
[key: string]: string;
}, never, true>> extends ObservableV2<{
change: (delta: D) => void;
destroy: (rdt: DomRDT<D>) => void;
}> implements RDT<D> {
/**
* @param {Element} observedNode
*/
constructor(observedNode: Element);
observedNode: Element;
_mux: mux.mutex;
observer: MutationObserver;
/**
* @param {MutationRecord[]} mutations
*/
_mutationHandler: (mutations: MutationRecord[]) => any;
/**
* @param {D} delta
*/
update: (delta: D) => void;
}
import { ObservableV2 } from '../observable.js';
import * as s from '../schema.js';
export {};
//# sourceMappingURL=binding.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../../delta/binding.js"],"names":[],"mappings":"AAeA;;;GAGG;AAEH;;;GAGG;AACH,qBAHmC,MAAM,SAA3B,KAAK,CAAC,aAAc,EACC,MAAM,SAA3B,KAAK,CAAC,aAAc;IAGhC;;;;OAIG;IACH,eAJW,GAAG,CAAC,MAAM,CAAC,KACX,GAAG,CAAC,MAAM,CAAC,YACX,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAC,MAAM,EAAC,MAAM,CAAC,EA4BxC;IAzBC;;OAEG;IACH,GAFU,EAAE,CAAC,WAAW,CAAC,GAAG,EAAC,MAAM,EAAC,MAAM,CAAC,CAEnB;IACxB,eAAU;IACV,eAAU;IACV,gBAA6B;IAC7B,8BAgCoD,IAAI,CAxBrD;IACH,8BAuBoD,IAAI,CAfrD;IAGL,oBAKC;CACF;AAgBM,qBAN4B,MAAM,SAA3B,KAAK,CAAC,aAAc,EACS,WAAW,SAAxC,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAC,MAAM,EAAC,GAAG,CAAE,KAC/B,GAAG,CAAC,MAAM,CAAC,KACX,GAAG,CAAC,WAAW,SAAS,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAC,MAAM,EAAC,MAAM,MAAM,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,YAC9E,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAC,MAAM,EAAC,GAAG,CAAC,sEAD0B,MAAM,oBAGH;AA2C5D,yBAH4B,KAAK,SAA1B,KAAK,CAAC,aAAc,UACvB,MAAM,CAAC,KAAK,CAAC,mBAE8B;AAkGtD,4BAA+H;AAsJxH,4BAFI,OAAO;;iBAE0B;mBAnW/B,CAAC,IACD,OAAO,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;;;;gBAoDV,KAAK,SAA1B,KAAK,CAAC,aAAc,IACrB,YAAY,CAAC;IAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAAC,SAAS,EAAE,CAAC,GAAG,EAAC,GAAG,CAAC,KAAK,CAAC,KAAG,IAAI,CAAA;CAAE,CAAC,GAAG;IAAE,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE;uBAkP9I,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE;IAAE,CAAC,GAAG,EAAC,MAAM,GAAG,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,IAAI,CAAC;uBAnTxD,YAAY;oBACf,cAAc;qBAMb,aAAa;AAsElC;;;;GAIG;AACH,uBAJmC,KAAK,SAA1B,KAAK,CAAC,aAAc;YAEE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;aAAa,CAAC,GAAG,EAAC,QAAQ,CAAC,KAAK,CAAC,KAAG,IAAI;cADnF,GAAG,CAAC,KAAK;IAItB;;OAEG;IACH,oBAFW,MAAM,CAAC,KAAK,CAAC,EAUvB;IANC,wBAAoB;IACpB;;OAEG;IACH,OAFU,KAAK,OAAC,CAEC;IACjB,gBAA6B;IAG/B;;OAEG;IACH,SAAS,OAFE,KAEG,SAOZ;CAMH;AAkMD;;GAEG;AAEH;;;;GAIG;AACH,qBAJyB,CAAC,SAAZ,QAAS;;;YAEa,CAAC,KAAK,EAAE,CAAC,KAAG,IAAI;aAAW,CAAC,GAAG,EAAC,MAAM,CAAC,CAAC,CAAC,KAAG,IAAI;cADrE,GAAG,CAAC,CAAC;IAIlB;;OAEG;IACH,0BAFW,OAAO,EAajB;IATC,sBAAgC;IAChC,gBAA6B;IAC7B,2BAA2D;IAS7D;;OAEG;IACH,mBAAmB,WAFR,cAAc,EAEG,SAGxB;IAEJ;;OAEG;IACH,SAAS,OAFE,CAEG,UAWb;CAOF;6BA1W4B,kBAAkB;mBAS5B,cAAc"}

View File

@@ -0,0 +1,5 @@
export function testBinding(): void;
export function testDomBindingBasics(): void;
export function testDomBindingBackAndForth(): void;
export function testDataToDom(): void;
//# sourceMappingURL=binding.test.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"binding.test.d.ts","sourceRoot":"","sources":["../../delta/binding.test.js"],"names":[],"mappings":"AAUO,oCAcN;AAEM,6CAcN;AAEM,mDAkCN;AAEM,sCAiBN"}

View File

@@ -0,0 +1,5 @@
export function testDeltaBasics(_tc: t.TestCase): void;
export function testDeltaBasicSchema(_tc: t.TestCase): void;
export function testDeltaValues(_tc: t.TestCase): void;
import * as t from 'lib0/testing';
//# sourceMappingURL=delta-pitch.test.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"delta-pitch.test.d.ts","sourceRoot":"","sources":["../../delta/delta-pitch.test.js"],"names":[],"mappings":"AAmCO,qCAFI,CAAC,CAAC,QAAQ,QAWpB;AAmBM,0CAFI,CAAC,CAAC,QAAQ,QAWpB;AAYM,qCAFI,CAAC,CAAC,QAAQ,QAwBpB;mBAzGkB,cAAc"}

1008
yjs-poll/node_modules/lib0/dist/delta/delta.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
yjs-poll/node_modules/lib0/dist/delta/delta.d.ts.map generated vendored Normal file

File diff suppressed because one or more lines are too long

29
yjs-poll/node_modules/lib0/dist/delta/delta.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,29 @@
export function testDeltaBasicApi(_tc: t.TestCase): void;
export function testDeltaValues(_tc: t.TestCase): void;
export function testDeltaBasicCases(): void;
export function testDeltaArrayBasics(): void;
export function testAssignability(): void;
export function testText(): void;
export function testDelta(_tc: t.TestCase): void;
export function testDeltaMerging(_tc: t.TestCase): void;
export function testUseAttributes(_tc: t.TestCase): void;
export function testUseAttribution(_tc: t.TestCase): void;
export function testMapTyping(): void;
export function testMapDeltaBasics(_tc: t.TestCase): void;
export function testMapDeltaModify(_tc: t.TestCase): void;
export function testMapDelta(_tc: t.TestCase): void;
export function testRepeatRebaseMergeDeltas(tc: t.TestCase): void;
export function testNodeDelta(_tc: t.TestCase): void;
export function testRecursiveNode(): void;
export function testSimplifiedDeltaSchemaDefinition(): void;
export function testDiffing(): void;
export function testDiffingCommonPreSuffix(): void;
export function testSlice(): void;
export function testRepeatRandomListDiff(tc: t.TestCase): void;
export function testRepeatRandomMapDiff(tc: t.TestCase): void;
export function testDeltaAppend(_tc: t.TestCase): void;
export function testDeltaDiffWithFormatting(): void;
export function testDeltaDiffWithFormatting2(): void;
export function testDeltaDiffIssue1(): void;
import * as t from 'lib0/testing';
//# sourceMappingURL=delta.test.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"delta.test.d.ts","sourceRoot":"","sources":["../../delta/delta.test.js"],"names":[],"mappings":"AAqCO,uCAFI,CAAC,CAAC,QAAQ,QAWpB;AAYM,qCAFI,CAAC,CAAC,QAAQ,QAwBpB;AAEM,4CA2BN;AAEM,6CAMN;AAKM,0CAkJN;AAEM,iCAWN;AAKM,+BAFI,CAAC,CAAC,QAAQ,QAKpB;AAKM,sCAFI,CAAC,CAAC,QAAQ,QAYpB;AAKM,uCAFI,CAAC,CAAC,QAAQ,QAuBpB;AAKM,wCAFI,CAAC,CAAC,QAAQ,QAsBpB;AAEM,sCAaN;AAKM,wCAFI,CAAC,CAAC,QAAQ,QA4BpB;AAKM,wCAFI,CAAC,CAAC,QAAQ,QA2CpB;AAKM,kCAFI,CAAC,CAAC,QAAQ,QAqDpB;AAKM,gDAFI,CAAC,CAAC,QAAQ,QAoEpB;AAKM,mCAFI,CAAC,CAAC,QAAQ,QAiCpB;AAEM,0CAmBN;AAEM,4DAIN;AAEM,oCAMN;AAEM,mDAMN;AAEM,kCAGN;AAKM,6CAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,4CAFI,CAAC,CAAC,QAAQ,QAWpB;AAKM,qCAFI,CAAC,CAAC,QAAQ,QAQpB;AAEM,oDAKN;AAEM,qDAKN;AAEM,4CAQN;mBAjtBkB,cAAc"}

19
yjs-poll/node_modules/lib0/dist/delta/t3.test.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
export function transformResult<DeltaA extends delta.DeltaBuilder | null, DeltaB extends delta.DeltaBuilder | null>(a: DeltaA, b: DeltaB): TransformResult<DeltaA | null, DeltaB | null>;
export const transformResultEmpty: TransformResult<null, null>;
export type TransformResult<DeltaA extends delta.Delta | null, DeltaB extends delta.Delta | null> = {
a: DeltaA | null;
b: DeltaB | null;
};
export type DeltaTransformer<DeltaA extends delta.DeltaAny, DeltaB extends delta.DeltaAny> = (t: {
a: DeltaA | null;
b: DeltaB | null;
}) => ({
a: DeltaA | null;
b: DeltaB | null;
});
export type Transform<DeltaA extends delta.Delta, DeltaB extends delta.Delta> = {
applyA: (da: DeltaA) => TransformResult<DeltaA, DeltaB>;
applyB: (db: DeltaB) => TransformResult<DeltaA, DeltaB>;
};
import * as delta from './delta.js';
//# sourceMappingURL=t3.test.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"t3.test.d.ts","sourceRoot":"","sources":["../../delta/t3.test.js"],"names":[],"mappings":"AAoBO,gCAN4B,MAAM,SAA3B,KAAK,CAAC,YAAY,OAAE,EACC,MAAM,SAA3B,KAAK,CAAC,YAAY,OAAE,KACvB,MAAM,KACN,MAAM,GACL,eAAe,CAAC,MAAM,OAAC,EAAC,MAAM,OAAC,CAAC,CAEO;AACnD,+DAA+D;4BAbnC,MAAM,SAApB,KAAK,CAAC,KAAK,OAAE,EACC,MAAM,SAApB,KAAK,CAAC,KAAK,OAAE,IACd;IAAE,CAAC,EAAE,MAAM,OAAC,CAAC;IAAC,CAAC,EAAE,MAAM,OAAC,CAAA;CAAE;6BAiBT,MAAM,SAAtB,KAAK,CAAC,QAAS,EACC,MAAM,SAAtB,KAAK,CAAC,QAAS,IAChB,CAAC,CAAC,EAAC;IAAC,CAAC,EAAC,MAAM,OAAC,CAAC;IAAA,CAAC,EAAC,MAAM,OAAC,CAAA;CAAC,KAAG,CAAC;IAAC,CAAC,EAAC,MAAM,OAAC,CAAC;IAAA,CAAC,EAAC,MAAM,OAAC,CAAA;CAAC,CAAC;sBA2GpC,MAAM,SAAnB,KAAK,CAAC,KAAM,EACC,MAAM,SAAnB,KAAK,CAAC,KAAM,IACb;IAAE,MAAM,EAAE,CAAC,EAAE,EAAC,MAAM,KAAG,eAAe,CAAC,MAAM,EAAC,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,CAAC,EAAE,EAAC,MAAM,KAAG,eAAe,CAAC,MAAM,EAAC,MAAM,CAAC,CAAA;CAAE;uBAvIlG,YAAY"}

162
yjs-poll/node_modules/lib0/dist/diff-9d236524.cjs generated vendored Normal file
View File

@@ -0,0 +1,162 @@
'use strict';
var _function = require('./function-314580f7.cjs');
/**
* Efficient diffs.
*
* @module diff
*/
/**
* A SimpleDiff describes a change on a String.
*
* ```js
* console.log(a) // the old value
* console.log(b) // the updated value
* // Apply changes of diff (pseudocode)
* a.remove(diff.index, diff.remove) // Remove `diff.remove` characters
* a.insert(diff.index, diff.insert) // Insert `diff.insert`
* a === b // values match
* ```
*
* @template {string|Array<any>} T
* @typedef {Object} SimpleDiff
* @property {Number} index The index where changes were applied
* @property {Number} remove The number of characters to delete starting
* at `index`.
* @property {T} insert The new text to insert at `index` after applying
*/
const highSurrogateRegex = /[\uD800-\uDBFF]/;
const lowSurrogateRegex = /[\uDC00-\uDFFF]/;
/**
* Create a diff between two strings. This diff implementation is highly
* efficient, but not very sophisticated.
*
* @function
*
* @param {string} a The old version of the string
* @param {string} b The updated version of the string
* @return {SimpleDiff<string>} The diff description.
*/
const simpleDiffString = (a, b) => {
let left = 0; // number of same characters counting from left
let right = 0; // number of same characters counting from right
while (left < a.length && left < b.length && a[left] === b[left]) {
left++;
}
// If the last same character is a high surrogate, we need to rollback to the previous character
if (left > 0 && highSurrogateRegex.test(a[left - 1])) left--;
while (right + left < a.length && right + left < b.length && a[a.length - right - 1] === b[b.length - right - 1]) {
right++;
}
// If the last same character is a low surrogate, we need to rollback to the previous character
if (right > 0 && lowSurrogateRegex.test(a[a.length - right])) right--;
return {
index: left,
remove: a.length - left - right,
insert: b.slice(left, b.length - right)
}
};
/**
* @todo Remove in favor of simpleDiffString
* @deprecated
*/
const simpleDiff = simpleDiffString;
/**
* Create a diff between two arrays. This diff implementation is highly
* efficient, but not very sophisticated.
*
* Note: This is basically the same function as above. Another function was created so that the runtime
* can better optimize these function calls.
*
* @function
* @template T
*
* @param {Array<T>} a The old version of the array
* @param {Array<T>} b The updated version of the array
* @param {function(T, T):boolean} [compare]
* @return {SimpleDiff<Array<T>>} The diff description.
*/
const simpleDiffArray = (a, b, compare = _function.equalityStrict) => {
let left = 0; // number of same characters counting from left
let right = 0; // number of same characters counting from right
while (left < a.length && left < b.length && compare(a[left], b[left])) {
left++;
}
while (right + left < a.length && right + left < b.length && compare(a[a.length - right - 1], b[b.length - right - 1])) {
right++;
}
return {
index: left,
remove: a.length - left - right,
insert: b.slice(left, b.length - right)
}
};
/**
* Diff text and try to diff at the current cursor position.
*
* @param {string} a
* @param {string} b
* @param {number} cursor This should refer to the current left cursor-range position
*/
const simpleDiffStringWithCursor = (a, b, cursor) => {
let left = 0; // number of same characters counting from left
let right = 0; // number of same characters counting from right
// Iterate left to the right until we find a changed character
// First iteration considers the current cursor position
while (
left < a.length &&
left < b.length &&
a[left] === b[left] &&
left < cursor
) {
left++;
}
// If the last same character is a high surrogate, we need to rollback to the previous character
if (left > 0 && highSurrogateRegex.test(a[left - 1])) left--;
// Iterate right to the left until we find a changed character
while (
right + left < a.length &&
right + left < b.length &&
a[a.length - right - 1] === b[b.length - right - 1]
) {
right++;
}
// If the last same character is a low surrogate, we need to rollback to the previous character
if (right > 0 && lowSurrogateRegex.test(a[a.length - right])) right--;
// Try to iterate left further to the right without caring about the current cursor position
while (
right + left < a.length &&
right + left < b.length &&
a[left] === b[left]
) {
left++;
}
if (left > 0 && highSurrogateRegex.test(a[left - 1])) left--;
return {
index: left,
remove: a.length - left - right,
insert: b.slice(left, b.length - right)
}
};
var diff = /*#__PURE__*/Object.freeze({
__proto__: null,
simpleDiffString: simpleDiffString,
simpleDiff: simpleDiff,
simpleDiffArray: simpleDiffArray,
simpleDiffStringWithCursor: simpleDiffStringWithCursor
});
exports.diff = diff;
exports.simpleDiff = simpleDiff;
exports.simpleDiffArray = simpleDiffArray;
exports.simpleDiffString = simpleDiffString;
exports.simpleDiffStringWithCursor = simpleDiffStringWithCursor;
//# sourceMappingURL=diff-9d236524.cjs.map

File diff suppressed because one or more lines are too long

18
yjs-poll/node_modules/lib0/dist/diff.cjs generated vendored Normal file
View File

@@ -0,0 +1,18 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
require('./function-314580f7.cjs');
var diff = require('./diff-9d236524.cjs');
require('./array-78849c95.cjs');
require('./set-5b47859e.cjs');
require('./object-c0c9435b.cjs');
require('./equality.cjs');
exports.simpleDiff = diff.simpleDiff;
exports.simpleDiffArray = diff.simpleDiffArray;
exports.simpleDiffString = diff.simpleDiffString;
exports.simpleDiffStringWithCursor = diff.simpleDiffStringWithCursor;
//# sourceMappingURL=diff.cjs.map

1
yjs-poll/node_modules/lib0/dist/diff.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"diff.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}

36
yjs-poll/node_modules/lib0/dist/diff.d.ts generated vendored Normal file
View File

@@ -0,0 +1,36 @@
export function simpleDiffString(a: string, b: string): SimpleDiff<string>;
export function simpleDiff(a: string, b: string): SimpleDiff<string>;
export function simpleDiffArray<T>(a: Array<T>, b: Array<T>, compare?: (arg0: T, arg1: T) => boolean): SimpleDiff<Array<T>>;
export function simpleDiffStringWithCursor(a: string, b: string, cursor: number): {
index: number;
remove: number;
insert: string;
};
/**
* A SimpleDiff describes a change on a String.
*
* ```js
* console.log(a) // the old value
* console.log(b) // the updated value
* // Apply changes of diff (pseudocode)
* a.remove(diff.index, diff.remove) // Remove `diff.remove` characters
* a.insert(diff.index, diff.insert) // Insert `diff.insert`
* a === b // values match
* ```
*/
export type SimpleDiff<T extends string | Array<any>> = {
/**
* The index where changes were applied
*/
index: number;
/**
* The number of characters to delete starting
* at `index`.
*/
remove: number;
/**
* The new text to insert at `index` after applying
*/
insert: T;
};
//# sourceMappingURL=diff.d.ts.map

1
yjs-poll/node_modules/lib0/dist/diff.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../diff.js"],"names":[],"mappings":"AAyCO,oCAJI,MAAM,KACN,MAAM,GACL,UAAU,CAAC,MAAM,CAAC,CAoB7B;AAlBM,8BAJI,MAAM,KACN,MAAM,GACL,UAAU,CAAC,MAAM,CAAC,CAoB7B;AAuBM,gCAPM,CAAC,KAEH,KAAK,CAAC,CAAC,CAAC,KACR,KAAK,CAAC,CAAC,CAAC,YACR,CAAS,IAAC,EAAD,CAAC,EAAE,IAAC,EAAD,CAAC,KAAE,OAAO,GACrB,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAgB/B;AASM,8CAJI,MAAM,KACN,MAAM,UACN,MAAM;;;;EAyChB;;;;;;;;;;;;;uBA5HgC,CAAC,SAApB,MAAM,GAAC,KAAK,CAAC,GAAG,CAAE;;;;;;;;;;;;;YAKlB,CAAC"}

Some files were not shown because too many files have changed in this diff Show More