@liveblocks/core 2.25.0-aiprivatebeta6 → 2.25.0-aiprivatebeta7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +95 -94
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -13
- package/dist/index.d.ts +10 -13
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/version.ts
|
|
8
8
|
var PKG_NAME = "@liveblocks/core";
|
|
9
|
-
var PKG_VERSION = "2.25.0-
|
|
9
|
+
var PKG_VERSION = "2.25.0-aiprivatebeta7";
|
|
10
10
|
var PKG_FORMAT = "cjs";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -3999,7 +3999,7 @@ function createStore_forUserAiChats() {
|
|
|
3999
3999
|
SortedList.with((x, y) => y.createdAt < x.createdAt)
|
|
4000
4000
|
);
|
|
4001
4001
|
const chats\u03A3 = DerivedSignal.from(
|
|
4002
|
-
() => Array.from(mutable\u03A3.get()).filter((c) => !c.
|
|
4002
|
+
() => Array.from(mutable\u03A3.get()).filter((c) => !c.deletedAt)
|
|
4003
4003
|
);
|
|
4004
4004
|
function upsertMany(chats) {
|
|
4005
4005
|
mutable\u03A3.mutate((list) => {
|
|
@@ -4143,7 +4143,7 @@ function createAi(config) {
|
|
|
4143
4143
|
case "get-chats":
|
|
4144
4144
|
context.chatsStore.upsertMany(msg.chats);
|
|
4145
4145
|
break;
|
|
4146
|
-
case "create-chat":
|
|
4146
|
+
case "get-or-create-chat":
|
|
4147
4147
|
context.chatsStore.upsert(msg.chat);
|
|
4148
4148
|
break;
|
|
4149
4149
|
case "delete-chat":
|
|
@@ -4218,13 +4218,14 @@ function createAi(config) {
|
|
|
4218
4218
|
cursor: options.cursor
|
|
4219
4219
|
});
|
|
4220
4220
|
}
|
|
4221
|
-
function
|
|
4221
|
+
function getOrCreateChat(id, title, options) {
|
|
4222
4222
|
return sendClientMsgWithResponse({
|
|
4223
|
-
cmd: "create-chat",
|
|
4223
|
+
cmd: "get-or-create-chat",
|
|
4224
4224
|
id,
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4225
|
+
options: {
|
|
4226
|
+
title,
|
|
4227
|
+
metadata: _optionalChain([options, 'optionalAccess', _65 => _65.metadata])
|
|
4228
|
+
}
|
|
4228
4229
|
});
|
|
4229
4230
|
}
|
|
4230
4231
|
function getMessageTree(chatId) {
|
|
@@ -4256,9 +4257,9 @@ function createAi(config) {
|
|
|
4256
4257
|
"assistant",
|
|
4257
4258
|
messageId
|
|
4258
4259
|
);
|
|
4259
|
-
const copilotId = _optionalChain([options, 'optionalAccess',
|
|
4260
|
-
const stream = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4261
|
-
const timeout = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4260
|
+
const copilotId = _optionalChain([options, 'optionalAccess', _66 => _66.copilotId]);
|
|
4261
|
+
const stream = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _67 => _67.stream]), () => ( false));
|
|
4262
|
+
const timeout = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _68 => _68.timeout]), () => ( DEFAULT_AI_TIMEOUT));
|
|
4262
4263
|
const knowledge = context.knowledgeByChatId.get(chatId);
|
|
4263
4264
|
return sendClientMsgWithResponse({
|
|
4264
4265
|
cmd: "ask-in-chat",
|
|
@@ -4288,7 +4289,7 @@ function createAi(config) {
|
|
|
4288
4289
|
reconnect: () => managedSocket.reconnect(),
|
|
4289
4290
|
disconnect: () => managedSocket.disconnect(),
|
|
4290
4291
|
getChats,
|
|
4291
|
-
|
|
4292
|
+
getOrCreateChat,
|
|
4292
4293
|
deleteChat: (chatId) => {
|
|
4293
4294
|
return sendClientMsgWithResponse({
|
|
4294
4295
|
cmd: "delete-chat",
|
|
@@ -4320,9 +4321,9 @@ function createAi(config) {
|
|
|
4320
4321
|
"assistant",
|
|
4321
4322
|
newMessageId
|
|
4322
4323
|
);
|
|
4323
|
-
const copilotId = _optionalChain([options, 'optionalAccess',
|
|
4324
|
-
const stream = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4325
|
-
const timeout = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4324
|
+
const copilotId = _optionalChain([options, 'optionalAccess', _69 => _69.copilotId]);
|
|
4325
|
+
const stream = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _70 => _70.stream]), () => ( false));
|
|
4326
|
+
const timeout = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _71 => _71.timeout]), () => ( DEFAULT_AI_TIMEOUT));
|
|
4326
4327
|
const knowledge = context.knowledgeByChatId.get(chatId);
|
|
4327
4328
|
return sendClientMsgWithResponse({
|
|
4328
4329
|
cmd: "ask-in-chat",
|
|
@@ -4433,7 +4434,7 @@ function createAuthManager(authOptions, onAuthenticate) {
|
|
|
4433
4434
|
return void 0;
|
|
4434
4435
|
}
|
|
4435
4436
|
async function makeAuthRequest(options) {
|
|
4436
|
-
const fetcher = _nullishCoalesce(_optionalChain([authOptions, 'access',
|
|
4437
|
+
const fetcher = _nullishCoalesce(_optionalChain([authOptions, 'access', _72 => _72.polyfills, 'optionalAccess', _73 => _73.fetch]), () => ( (typeof window === "undefined" ? void 0 : window.fetch)));
|
|
4437
4438
|
if (authentication.type === "private") {
|
|
4438
4439
|
if (fetcher === void 0) {
|
|
4439
4440
|
throw new StopRetrying(
|
|
@@ -4449,7 +4450,7 @@ function createAuthManager(authOptions, onAuthenticate) {
|
|
|
4449
4450
|
"The same Liveblocks auth token was issued from the backend before. Caching Liveblocks tokens is not supported."
|
|
4450
4451
|
);
|
|
4451
4452
|
}
|
|
4452
|
-
_optionalChain([onAuthenticate, 'optionalCall',
|
|
4453
|
+
_optionalChain([onAuthenticate, 'optionalCall', _74 => _74(parsed.parsed)]);
|
|
4453
4454
|
return parsed;
|
|
4454
4455
|
}
|
|
4455
4456
|
if (authentication.type === "custom") {
|
|
@@ -4457,7 +4458,7 @@ function createAuthManager(authOptions, onAuthenticate) {
|
|
|
4457
4458
|
if (response && typeof response === "object") {
|
|
4458
4459
|
if (typeof response.token === "string") {
|
|
4459
4460
|
const parsed = parseAuthToken(response.token);
|
|
4460
|
-
_optionalChain([onAuthenticate, 'optionalCall',
|
|
4461
|
+
_optionalChain([onAuthenticate, 'optionalCall', _75 => _75(parsed.parsed)]);
|
|
4461
4462
|
return parsed;
|
|
4462
4463
|
} else if (typeof response.error === "string") {
|
|
4463
4464
|
const reason = `Authentication failed: ${"reason" in response && typeof response.reason === "string" ? response.reason : "Forbidden"}`;
|
|
@@ -4615,7 +4616,7 @@ function sendToPanel(message, options) {
|
|
|
4615
4616
|
...message,
|
|
4616
4617
|
source: "liveblocks-devtools-client"
|
|
4617
4618
|
};
|
|
4618
|
-
if (!(_optionalChain([options, 'optionalAccess',
|
|
4619
|
+
if (!(_optionalChain([options, 'optionalAccess', _76 => _76.force]) || _bridgeActive)) {
|
|
4619
4620
|
return;
|
|
4620
4621
|
}
|
|
4621
4622
|
window.postMessage(fullMsg, "*");
|
|
@@ -4623,7 +4624,7 @@ function sendToPanel(message, options) {
|
|
|
4623
4624
|
var eventSource = makeEventSource();
|
|
4624
4625
|
if (process.env.NODE_ENV !== "production" && typeof window !== "undefined") {
|
|
4625
4626
|
window.addEventListener("message", (event) => {
|
|
4626
|
-
if (event.source === window && _optionalChain([event, 'access',
|
|
4627
|
+
if (event.source === window && _optionalChain([event, 'access', _77 => _77.data, 'optionalAccess', _78 => _78.source]) === "liveblocks-devtools-panel") {
|
|
4627
4628
|
eventSource.notify(event.data);
|
|
4628
4629
|
} else {
|
|
4629
4630
|
}
|
|
@@ -4765,7 +4766,7 @@ function fullSync(room) {
|
|
|
4765
4766
|
msg: "room::sync::full",
|
|
4766
4767
|
roomId: room.id,
|
|
4767
4768
|
status: room.getStatus(),
|
|
4768
|
-
storage: _nullishCoalesce(_optionalChain([root, 'optionalAccess',
|
|
4769
|
+
storage: _nullishCoalesce(_optionalChain([root, 'optionalAccess', _79 => _79.toTreeNode, 'call', _80 => _80("root"), 'access', _81 => _81.payload]), () => ( null)),
|
|
4769
4770
|
me,
|
|
4770
4771
|
others
|
|
4771
4772
|
});
|
|
@@ -5056,7 +5057,7 @@ function createManagedPool(roomId, options) {
|
|
|
5056
5057
|
generateId: () => `${getCurrentConnectionId()}:${clock++}`,
|
|
5057
5058
|
generateOpId: () => `${getCurrentConnectionId()}:${opClock++}`,
|
|
5058
5059
|
dispatch(ops, reverse, storageUpdates) {
|
|
5059
|
-
_optionalChain([onDispatch, 'optionalCall',
|
|
5060
|
+
_optionalChain([onDispatch, 'optionalCall', _82 => _82(ops, reverse, storageUpdates)]);
|
|
5060
5061
|
},
|
|
5061
5062
|
assertStorageIsWritable: () => {
|
|
5062
5063
|
if (!isStorageWritable()) {
|
|
@@ -5283,7 +5284,7 @@ var LiveRegister = class _LiveRegister extends AbstractCrdt {
|
|
|
5283
5284
|
return [
|
|
5284
5285
|
{
|
|
5285
5286
|
type: 8 /* CREATE_REGISTER */,
|
|
5286
|
-
opId: _optionalChain([pool, 'optionalAccess',
|
|
5287
|
+
opId: _optionalChain([pool, 'optionalAccess', _83 => _83.generateOpId, 'call', _84 => _84()]),
|
|
5287
5288
|
id: this._id,
|
|
5288
5289
|
parentId,
|
|
5289
5290
|
parentKey,
|
|
@@ -5389,7 +5390,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5389
5390
|
const ops = [];
|
|
5390
5391
|
const op = {
|
|
5391
5392
|
id: this._id,
|
|
5392
|
-
opId: _optionalChain([pool, 'optionalAccess',
|
|
5393
|
+
opId: _optionalChain([pool, 'optionalAccess', _85 => _85.generateOpId, 'call', _86 => _86()]),
|
|
5393
5394
|
type: 2 /* CREATE_LIST */,
|
|
5394
5395
|
parentId,
|
|
5395
5396
|
parentKey
|
|
@@ -5660,7 +5661,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5660
5661
|
#applyInsertUndoRedo(op) {
|
|
5661
5662
|
const { id, parentKey: key } = op;
|
|
5662
5663
|
const child = creationOpToLiveNode(op);
|
|
5663
|
-
if (_optionalChain([this, 'access',
|
|
5664
|
+
if (_optionalChain([this, 'access', _87 => _87._pool, 'optionalAccess', _88 => _88.getNode, 'call', _89 => _89(id)]) !== void 0) {
|
|
5664
5665
|
return { modified: false };
|
|
5665
5666
|
}
|
|
5666
5667
|
child._attach(id, nn(this._pool));
|
|
@@ -5668,8 +5669,8 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5668
5669
|
const existingItemIndex = this._indexOfPosition(key);
|
|
5669
5670
|
let newKey = key;
|
|
5670
5671
|
if (existingItemIndex !== -1) {
|
|
5671
|
-
const before2 = _optionalChain([this, 'access',
|
|
5672
|
-
const after2 = _optionalChain([this, 'access',
|
|
5672
|
+
const before2 = _optionalChain([this, 'access', _90 => _90.#items, 'access', _91 => _91[existingItemIndex], 'optionalAccess', _92 => _92._parentPos]);
|
|
5673
|
+
const after2 = _optionalChain([this, 'access', _93 => _93.#items, 'access', _94 => _94[existingItemIndex + 1], 'optionalAccess', _95 => _95._parentPos]);
|
|
5673
5674
|
newKey = makePosition(before2, after2);
|
|
5674
5675
|
child._setParentLink(this, newKey);
|
|
5675
5676
|
}
|
|
@@ -5683,7 +5684,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5683
5684
|
#applySetUndoRedo(op) {
|
|
5684
5685
|
const { id, parentKey: key } = op;
|
|
5685
5686
|
const child = creationOpToLiveNode(op);
|
|
5686
|
-
if (_optionalChain([this, 'access',
|
|
5687
|
+
if (_optionalChain([this, 'access', _96 => _96._pool, 'optionalAccess', _97 => _97.getNode, 'call', _98 => _98(id)]) !== void 0) {
|
|
5687
5688
|
return { modified: false };
|
|
5688
5689
|
}
|
|
5689
5690
|
this.#unacknowledgedSets.set(key, nn(op.opId));
|
|
@@ -5804,7 +5805,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5804
5805
|
} else {
|
|
5805
5806
|
this.#items[existingItemIndex]._setParentLink(
|
|
5806
5807
|
this,
|
|
5807
|
-
makePosition(newKey, _optionalChain([this, 'access',
|
|
5808
|
+
makePosition(newKey, _optionalChain([this, 'access', _99 => _99.#items, 'access', _100 => _100[existingItemIndex + 1], 'optionalAccess', _101 => _101._parentPos]))
|
|
5808
5809
|
);
|
|
5809
5810
|
const previousIndex = this.#items.indexOf(child);
|
|
5810
5811
|
child._setParentLink(this, newKey);
|
|
@@ -5829,7 +5830,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5829
5830
|
if (existingItemIndex !== -1) {
|
|
5830
5831
|
this.#items[existingItemIndex]._setParentLink(
|
|
5831
5832
|
this,
|
|
5832
|
-
makePosition(newKey, _optionalChain([this, 'access',
|
|
5833
|
+
makePosition(newKey, _optionalChain([this, 'access', _102 => _102.#items, 'access', _103 => _103[existingItemIndex + 1], 'optionalAccess', _104 => _104._parentPos]))
|
|
5833
5834
|
);
|
|
5834
5835
|
}
|
|
5835
5836
|
child._setParentLink(this, newKey);
|
|
@@ -5848,7 +5849,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5848
5849
|
if (existingItemIndex !== -1) {
|
|
5849
5850
|
this.#items[existingItemIndex]._setParentLink(
|
|
5850
5851
|
this,
|
|
5851
|
-
makePosition(newKey, _optionalChain([this, 'access',
|
|
5852
|
+
makePosition(newKey, _optionalChain([this, 'access', _105 => _105.#items, 'access', _106 => _106[existingItemIndex + 1], 'optionalAccess', _107 => _107._parentPos]))
|
|
5852
5853
|
);
|
|
5853
5854
|
}
|
|
5854
5855
|
child._setParentLink(this, newKey);
|
|
@@ -5875,7 +5876,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5875
5876
|
if (existingItemIndex !== -1) {
|
|
5876
5877
|
this.#items[existingItemIndex]._setParentLink(
|
|
5877
5878
|
this,
|
|
5878
|
-
makePosition(newKey, _optionalChain([this, 'access',
|
|
5879
|
+
makePosition(newKey, _optionalChain([this, 'access', _108 => _108.#items, 'access', _109 => _109[existingItemIndex + 1], 'optionalAccess', _110 => _110._parentPos]))
|
|
5879
5880
|
);
|
|
5880
5881
|
}
|
|
5881
5882
|
child._setParentLink(this, newKey);
|
|
@@ -5933,7 +5934,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5933
5934
|
* @param element The element to add to the end of the LiveList.
|
|
5934
5935
|
*/
|
|
5935
5936
|
push(element) {
|
|
5936
|
-
_optionalChain([this, 'access',
|
|
5937
|
+
_optionalChain([this, 'access', _111 => _111._pool, 'optionalAccess', _112 => _112.assertStorageIsWritable, 'call', _113 => _113()]);
|
|
5937
5938
|
return this.insert(element, this.length);
|
|
5938
5939
|
}
|
|
5939
5940
|
/**
|
|
@@ -5942,7 +5943,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5942
5943
|
* @param index The index at which you want to insert the element.
|
|
5943
5944
|
*/
|
|
5944
5945
|
insert(element, index) {
|
|
5945
|
-
_optionalChain([this, 'access',
|
|
5946
|
+
_optionalChain([this, 'access', _114 => _114._pool, 'optionalAccess', _115 => _115.assertStorageIsWritable, 'call', _116 => _116()]);
|
|
5946
5947
|
if (index < 0 || index > this.#items.length) {
|
|
5947
5948
|
throw new Error(
|
|
5948
5949
|
`Cannot insert list item at index "${index}". index should be between 0 and ${this.#items.length}`
|
|
@@ -5972,7 +5973,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5972
5973
|
* @param targetIndex The index where the element should be after moving.
|
|
5973
5974
|
*/
|
|
5974
5975
|
move(index, targetIndex) {
|
|
5975
|
-
_optionalChain([this, 'access',
|
|
5976
|
+
_optionalChain([this, 'access', _117 => _117._pool, 'optionalAccess', _118 => _118.assertStorageIsWritable, 'call', _119 => _119()]);
|
|
5976
5977
|
if (targetIndex < 0) {
|
|
5977
5978
|
throw new Error("targetIndex cannot be less than 0");
|
|
5978
5979
|
}
|
|
@@ -6030,7 +6031,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6030
6031
|
* @param index The index of the element to delete
|
|
6031
6032
|
*/
|
|
6032
6033
|
delete(index) {
|
|
6033
|
-
_optionalChain([this, 'access',
|
|
6034
|
+
_optionalChain([this, 'access', _120 => _120._pool, 'optionalAccess', _121 => _121.assertStorageIsWritable, 'call', _122 => _122()]);
|
|
6034
6035
|
if (index < 0 || index >= this.#items.length) {
|
|
6035
6036
|
throw new Error(
|
|
6036
6037
|
`Cannot delete list item at index "${index}". index should be between 0 and ${this.#items.length - 1}`
|
|
@@ -6063,7 +6064,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6063
6064
|
}
|
|
6064
6065
|
}
|
|
6065
6066
|
clear() {
|
|
6066
|
-
_optionalChain([this, 'access',
|
|
6067
|
+
_optionalChain([this, 'access', _123 => _123._pool, 'optionalAccess', _124 => _124.assertStorageIsWritable, 'call', _125 => _125()]);
|
|
6067
6068
|
if (this._pool) {
|
|
6068
6069
|
const ops = [];
|
|
6069
6070
|
const reverseOps = [];
|
|
@@ -6097,7 +6098,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6097
6098
|
}
|
|
6098
6099
|
}
|
|
6099
6100
|
set(index, item) {
|
|
6100
|
-
_optionalChain([this, 'access',
|
|
6101
|
+
_optionalChain([this, 'access', _126 => _126._pool, 'optionalAccess', _127 => _127.assertStorageIsWritable, 'call', _128 => _128()]);
|
|
6101
6102
|
if (index < 0 || index >= this.#items.length) {
|
|
6102
6103
|
throw new Error(
|
|
6103
6104
|
`Cannot set list item at index "${index}". index should be between 0 and ${this.#items.length - 1}`
|
|
@@ -6243,7 +6244,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6243
6244
|
#shiftItemPosition(index, key) {
|
|
6244
6245
|
const shiftedPosition = makePosition(
|
|
6245
6246
|
key,
|
|
6246
|
-
this.#items.length > index + 1 ? _optionalChain([this, 'access',
|
|
6247
|
+
this.#items.length > index + 1 ? _optionalChain([this, 'access', _129 => _129.#items, 'access', _130 => _130[index + 1], 'optionalAccess', _131 => _131._parentPos]) : void 0
|
|
6247
6248
|
);
|
|
6248
6249
|
this.#items[index]._setParentLink(this, shiftedPosition);
|
|
6249
6250
|
}
|
|
@@ -6368,7 +6369,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
|
|
|
6368
6369
|
const ops = [];
|
|
6369
6370
|
const op = {
|
|
6370
6371
|
id: this._id,
|
|
6371
|
-
opId: _optionalChain([pool, 'optionalAccess',
|
|
6372
|
+
opId: _optionalChain([pool, 'optionalAccess', _132 => _132.generateOpId, 'call', _133 => _133()]),
|
|
6372
6373
|
type: 7 /* CREATE_MAP */,
|
|
6373
6374
|
parentId,
|
|
6374
6375
|
parentKey
|
|
@@ -6503,7 +6504,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
|
|
|
6503
6504
|
* @param value The value of the element to add. Should be serializable to JSON.
|
|
6504
6505
|
*/
|
|
6505
6506
|
set(key, value) {
|
|
6506
|
-
_optionalChain([this, 'access',
|
|
6507
|
+
_optionalChain([this, 'access', _134 => _134._pool, 'optionalAccess', _135 => _135.assertStorageIsWritable, 'call', _136 => _136()]);
|
|
6507
6508
|
const oldValue = this.#map.get(key);
|
|
6508
6509
|
if (oldValue) {
|
|
6509
6510
|
oldValue._detach();
|
|
@@ -6549,7 +6550,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
|
|
|
6549
6550
|
* @returns true if an element existed and has been removed, or false if the element does not exist.
|
|
6550
6551
|
*/
|
|
6551
6552
|
delete(key) {
|
|
6552
|
-
_optionalChain([this, 'access',
|
|
6553
|
+
_optionalChain([this, 'access', _137 => _137._pool, 'optionalAccess', _138 => _138.assertStorageIsWritable, 'call', _139 => _139()]);
|
|
6553
6554
|
const item = this.#map.get(key);
|
|
6554
6555
|
if (item === void 0) {
|
|
6555
6556
|
return false;
|
|
@@ -6728,7 +6729,7 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
|
|
|
6728
6729
|
if (this._id === void 0) {
|
|
6729
6730
|
throw new Error("Cannot serialize item is not attached");
|
|
6730
6731
|
}
|
|
6731
|
-
const opId = _optionalChain([pool, 'optionalAccess',
|
|
6732
|
+
const opId = _optionalChain([pool, 'optionalAccess', _140 => _140.generateOpId, 'call', _141 => _141()]);
|
|
6732
6733
|
const ops = [];
|
|
6733
6734
|
const op = {
|
|
6734
6735
|
type: 4 /* CREATE_OBJECT */,
|
|
@@ -7000,7 +7001,7 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
|
|
|
7000
7001
|
* @param value The value of the property to add
|
|
7001
7002
|
*/
|
|
7002
7003
|
set(key, value) {
|
|
7003
|
-
_optionalChain([this, 'access',
|
|
7004
|
+
_optionalChain([this, 'access', _142 => _142._pool, 'optionalAccess', _143 => _143.assertStorageIsWritable, 'call', _144 => _144()]);
|
|
7004
7005
|
this.update({ [key]: value });
|
|
7005
7006
|
}
|
|
7006
7007
|
/**
|
|
@@ -7015,7 +7016,7 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
|
|
|
7015
7016
|
* @param key The key of the property to delete
|
|
7016
7017
|
*/
|
|
7017
7018
|
delete(key) {
|
|
7018
|
-
_optionalChain([this, 'access',
|
|
7019
|
+
_optionalChain([this, 'access', _145 => _145._pool, 'optionalAccess', _146 => _146.assertStorageIsWritable, 'call', _147 => _147()]);
|
|
7019
7020
|
const keyAsString = key;
|
|
7020
7021
|
const oldValue = this.#map.get(keyAsString);
|
|
7021
7022
|
if (oldValue === void 0) {
|
|
@@ -7068,7 +7069,7 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
|
|
|
7068
7069
|
* @param patch The object used to overrides properties
|
|
7069
7070
|
*/
|
|
7070
7071
|
update(patch) {
|
|
7071
|
-
_optionalChain([this, 'access',
|
|
7072
|
+
_optionalChain([this, 'access', _148 => _148._pool, 'optionalAccess', _149 => _149.assertStorageIsWritable, 'call', _150 => _150()]);
|
|
7072
7073
|
if (this._pool === void 0 || this._id === void 0) {
|
|
7073
7074
|
for (const key in patch) {
|
|
7074
7075
|
const newValue = patch[key];
|
|
@@ -7791,15 +7792,15 @@ function installBackgroundTabSpy() {
|
|
|
7791
7792
|
const doc = typeof document !== "undefined" ? document : void 0;
|
|
7792
7793
|
const inBackgroundSince = { current: null };
|
|
7793
7794
|
function onVisibilityChange() {
|
|
7794
|
-
if (_optionalChain([doc, 'optionalAccess',
|
|
7795
|
+
if (_optionalChain([doc, 'optionalAccess', _151 => _151.visibilityState]) === "hidden") {
|
|
7795
7796
|
inBackgroundSince.current = _nullishCoalesce(inBackgroundSince.current, () => ( Date.now()));
|
|
7796
7797
|
} else {
|
|
7797
7798
|
inBackgroundSince.current = null;
|
|
7798
7799
|
}
|
|
7799
7800
|
}
|
|
7800
|
-
_optionalChain([doc, 'optionalAccess',
|
|
7801
|
+
_optionalChain([doc, 'optionalAccess', _152 => _152.addEventListener, 'call', _153 => _153("visibilitychange", onVisibilityChange)]);
|
|
7801
7802
|
const unsub = () => {
|
|
7802
|
-
_optionalChain([doc, 'optionalAccess',
|
|
7803
|
+
_optionalChain([doc, 'optionalAccess', _154 => _154.removeEventListener, 'call', _155 => _155("visibilitychange", onVisibilityChange)]);
|
|
7803
7804
|
};
|
|
7804
7805
|
return [inBackgroundSince, unsub];
|
|
7805
7806
|
}
|
|
@@ -7979,7 +7980,7 @@ function createRoom(options, config) {
|
|
|
7979
7980
|
}
|
|
7980
7981
|
}
|
|
7981
7982
|
function isStorageWritable() {
|
|
7982
|
-
const scopes = _optionalChain([context, 'access',
|
|
7983
|
+
const scopes = _optionalChain([context, 'access', _156 => _156.dynamicSessionInfoSig, 'access', _157 => _157.get, 'call', _158 => _158(), 'optionalAccess', _159 => _159.scopes]);
|
|
7983
7984
|
return scopes !== void 0 ? canWriteStorage(scopes) : true;
|
|
7984
7985
|
}
|
|
7985
7986
|
const eventHub = {
|
|
@@ -8096,7 +8097,7 @@ function createRoom(options, config) {
|
|
|
8096
8097
|
}
|
|
8097
8098
|
case "experimental-fallback-to-http": {
|
|
8098
8099
|
warn("Message is too large for websockets, so sending over HTTP instead");
|
|
8099
|
-
const nonce = _nullishCoalesce(_optionalChain([context, 'access',
|
|
8100
|
+
const nonce = _nullishCoalesce(_optionalChain([context, 'access', _160 => _160.dynamicSessionInfoSig, 'access', _161 => _161.get, 'call', _162 => _162(), 'optionalAccess', _163 => _163.nonce]), () => ( raise("Session is not authorized to send message over HTTP")));
|
|
8100
8101
|
void httpClient.sendMessages({ roomId, nonce, messages }).then((resp) => {
|
|
8101
8102
|
if (!resp.ok && resp.status === 403) {
|
|
8102
8103
|
managedSocket.reconnect();
|
|
@@ -8147,7 +8148,7 @@ function createRoom(options, config) {
|
|
|
8147
8148
|
} else {
|
|
8148
8149
|
context.root = LiveObject._fromItems(message.items, context.pool);
|
|
8149
8150
|
}
|
|
8150
|
-
const canWrite = _nullishCoalesce(_optionalChain([self, 'access',
|
|
8151
|
+
const canWrite = _nullishCoalesce(_optionalChain([self, 'access', _164 => _164.get, 'call', _165 => _165(), 'optionalAccess', _166 => _166.canWrite]), () => ( true));
|
|
8151
8152
|
const stackSizeBefore = context.undoStack.length;
|
|
8152
8153
|
for (const key in context.initialStorage) {
|
|
8153
8154
|
if (context.root.get(key) === void 0) {
|
|
@@ -8350,7 +8351,7 @@ function createRoom(options, config) {
|
|
|
8350
8351
|
}
|
|
8351
8352
|
context.myPresence.patch(patch);
|
|
8352
8353
|
if (context.activeBatch) {
|
|
8353
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
8354
|
+
if (_optionalChain([options2, 'optionalAccess', _167 => _167.addToHistory])) {
|
|
8354
8355
|
context.activeBatch.reverseOps.pushLeft({
|
|
8355
8356
|
type: "presence",
|
|
8356
8357
|
data: oldValues
|
|
@@ -8359,7 +8360,7 @@ function createRoom(options, config) {
|
|
|
8359
8360
|
context.activeBatch.updates.presence = true;
|
|
8360
8361
|
} else {
|
|
8361
8362
|
flushNowOrSoon();
|
|
8362
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
8363
|
+
if (_optionalChain([options2, 'optionalAccess', _168 => _168.addToHistory])) {
|
|
8363
8364
|
addToUndoStack([{ type: "presence", data: oldValues }]);
|
|
8364
8365
|
}
|
|
8365
8366
|
notify({ presence: true });
|
|
@@ -8556,7 +8557,7 @@ function createRoom(options, config) {
|
|
|
8556
8557
|
if (process.env.NODE_ENV !== "production") {
|
|
8557
8558
|
const traces = /* @__PURE__ */ new Set();
|
|
8558
8559
|
for (const opId of message.opIds) {
|
|
8559
|
-
const trace = _optionalChain([context, 'access',
|
|
8560
|
+
const trace = _optionalChain([context, 'access', _169 => _169.opStackTraces, 'optionalAccess', _170 => _170.get, 'call', _171 => _171(opId)]);
|
|
8560
8561
|
if (trace) {
|
|
8561
8562
|
traces.add(trace);
|
|
8562
8563
|
}
|
|
@@ -8690,7 +8691,7 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
8690
8691
|
const unacknowledgedOps = new Map(context.unacknowledgedOps);
|
|
8691
8692
|
createOrUpdateRootFromMessage(message);
|
|
8692
8693
|
applyAndSendOps(unacknowledgedOps);
|
|
8693
|
-
_optionalChain([_resolveStoragePromise, 'optionalCall',
|
|
8694
|
+
_optionalChain([_resolveStoragePromise, 'optionalCall', _172 => _172()]);
|
|
8694
8695
|
notifyStorageStatus();
|
|
8695
8696
|
eventHub.storageDidLoad.notify();
|
|
8696
8697
|
}
|
|
@@ -8913,8 +8914,8 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
8913
8914
|
async function getThreads(options2) {
|
|
8914
8915
|
return httpClient.getThreads({
|
|
8915
8916
|
roomId,
|
|
8916
|
-
query: _optionalChain([options2, 'optionalAccess',
|
|
8917
|
-
cursor: _optionalChain([options2, 'optionalAccess',
|
|
8917
|
+
query: _optionalChain([options2, 'optionalAccess', _173 => _173.query]),
|
|
8918
|
+
cursor: _optionalChain([options2, 'optionalAccess', _174 => _174.cursor])
|
|
8918
8919
|
});
|
|
8919
8920
|
}
|
|
8920
8921
|
async function getThread(threadId) {
|
|
@@ -9021,7 +9022,7 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
9021
9022
|
function getSubscriptionSettings(options2) {
|
|
9022
9023
|
return httpClient.getSubscriptionSettings({
|
|
9023
9024
|
roomId,
|
|
9024
|
-
signal: _optionalChain([options2, 'optionalAccess',
|
|
9025
|
+
signal: _optionalChain([options2, 'optionalAccess', _175 => _175.signal])
|
|
9025
9026
|
});
|
|
9026
9027
|
}
|
|
9027
9028
|
function updateSubscriptionSettings(settings) {
|
|
@@ -9043,7 +9044,7 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
9043
9044
|
{
|
|
9044
9045
|
[kInternal]: {
|
|
9045
9046
|
get presenceBuffer() {
|
|
9046
|
-
return deepClone(_nullishCoalesce(_optionalChain([context, 'access',
|
|
9047
|
+
return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _176 => _176.buffer, 'access', _177 => _177.presenceUpdates, 'optionalAccess', _178 => _178.data]), () => ( null)));
|
|
9047
9048
|
},
|
|
9048
9049
|
// prettier-ignore
|
|
9049
9050
|
get undoStack() {
|
|
@@ -9058,9 +9059,9 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
9058
9059
|
return context.yjsProvider;
|
|
9059
9060
|
},
|
|
9060
9061
|
setYjsProvider(newProvider) {
|
|
9061
|
-
_optionalChain([context, 'access',
|
|
9062
|
+
_optionalChain([context, 'access', _179 => _179.yjsProvider, 'optionalAccess', _180 => _180.off, 'call', _181 => _181("status", yjsStatusDidChange)]);
|
|
9062
9063
|
context.yjsProvider = newProvider;
|
|
9063
|
-
_optionalChain([newProvider, 'optionalAccess',
|
|
9064
|
+
_optionalChain([newProvider, 'optionalAccess', _182 => _182.on, 'call', _183 => _183("status", yjsStatusDidChange)]);
|
|
9064
9065
|
context.yjsProviderDidChange.notify();
|
|
9065
9066
|
},
|
|
9066
9067
|
yjsProviderDidChange: context.yjsProviderDidChange.observable,
|
|
@@ -9106,7 +9107,7 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
9106
9107
|
source.dispose();
|
|
9107
9108
|
}
|
|
9108
9109
|
eventHub.roomWillDestroy.notify();
|
|
9109
|
-
_optionalChain([context, 'access',
|
|
9110
|
+
_optionalChain([context, 'access', _184 => _184.yjsProvider, 'optionalAccess', _185 => _185.off, 'call', _186 => _186("status", yjsStatusDidChange)]);
|
|
9110
9111
|
syncSourceForStorage.destroy();
|
|
9111
9112
|
syncSourceForYjs.destroy();
|
|
9112
9113
|
uninstallBgTabSpy();
|
|
@@ -9256,7 +9257,7 @@ function makeClassicSubscribeFn(roomId, events, errorEvents) {
|
|
|
9256
9257
|
}
|
|
9257
9258
|
if (isLiveNode(first)) {
|
|
9258
9259
|
const node = first;
|
|
9259
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
9260
|
+
if (_optionalChain([options, 'optionalAccess', _187 => _187.isDeep])) {
|
|
9260
9261
|
const storageCallback = second;
|
|
9261
9262
|
return subscribeToLiveStructureDeeply(node, storageCallback);
|
|
9262
9263
|
} else {
|
|
@@ -9335,8 +9336,8 @@ function createClient(options) {
|
|
|
9335
9336
|
const userId = token.k === "sec-legacy" /* SECRET_LEGACY */ ? token.id : token.uid;
|
|
9336
9337
|
currentUserId.set(() => userId);
|
|
9337
9338
|
});
|
|
9338
|
-
const fetchPolyfill = _optionalChain([clientOptions, 'access',
|
|
9339
|
-
_optionalChain([globalThis, 'access',
|
|
9339
|
+
const fetchPolyfill = _optionalChain([clientOptions, 'access', _188 => _188.polyfills, 'optionalAccess', _189 => _189.fetch]) || /* istanbul ignore next */
|
|
9340
|
+
_optionalChain([globalThis, 'access', _190 => _190.fetch, 'optionalAccess', _191 => _191.bind, 'call', _192 => _192(globalThis)]);
|
|
9340
9341
|
const httpClient = createApiClient({
|
|
9341
9342
|
baseUrl,
|
|
9342
9343
|
fetchPolyfill,
|
|
@@ -9354,7 +9355,7 @@ function createClient(options) {
|
|
|
9354
9355
|
delegates: {
|
|
9355
9356
|
createSocket: makeCreateSocketDelegateForAi(
|
|
9356
9357
|
baseUrl,
|
|
9357
|
-
_optionalChain([clientOptions, 'access',
|
|
9358
|
+
_optionalChain([clientOptions, 'access', _193 => _193.polyfills, 'optionalAccess', _194 => _194.WebSocket])
|
|
9358
9359
|
),
|
|
9359
9360
|
authenticate: makeAuthDelegateForRoom("default", authManager),
|
|
9360
9361
|
canZombie: () => true
|
|
@@ -9404,7 +9405,7 @@ function createClient(options) {
|
|
|
9404
9405
|
createSocket: makeCreateSocketDelegateForRoom(
|
|
9405
9406
|
roomId,
|
|
9406
9407
|
baseUrl,
|
|
9407
|
-
_optionalChain([clientOptions, 'access',
|
|
9408
|
+
_optionalChain([clientOptions, 'access', _195 => _195.polyfills, 'optionalAccess', _196 => _196.WebSocket])
|
|
9408
9409
|
),
|
|
9409
9410
|
authenticate: makeAuthDelegateForRoom(roomId, authManager)
|
|
9410
9411
|
})),
|
|
@@ -9427,7 +9428,7 @@ function createClient(options) {
|
|
|
9427
9428
|
const shouldConnect = _nullishCoalesce(options2.autoConnect, () => ( true));
|
|
9428
9429
|
if (shouldConnect) {
|
|
9429
9430
|
if (typeof atob === "undefined") {
|
|
9430
|
-
if (_optionalChain([clientOptions, 'access',
|
|
9431
|
+
if (_optionalChain([clientOptions, 'access', _197 => _197.polyfills, 'optionalAccess', _198 => _198.atob]) === void 0) {
|
|
9431
9432
|
throw new Error(
|
|
9432
9433
|
"You need to polyfill atob to use the client in your environment. Please follow the instructions at https://liveblocks.io/docs/errors/liveblocks-client/atob-polyfill"
|
|
9433
9434
|
);
|
|
@@ -9439,7 +9440,7 @@ function createClient(options) {
|
|
|
9439
9440
|
return leaseRoom(newRoomDetails);
|
|
9440
9441
|
}
|
|
9441
9442
|
function getRoom(roomId) {
|
|
9442
|
-
const room = _optionalChain([roomsById, 'access',
|
|
9443
|
+
const room = _optionalChain([roomsById, 'access', _199 => _199.get, 'call', _200 => _200(roomId), 'optionalAccess', _201 => _201.room]);
|
|
9443
9444
|
return room ? room : null;
|
|
9444
9445
|
}
|
|
9445
9446
|
function logout() {
|
|
@@ -9459,7 +9460,7 @@ function createClient(options) {
|
|
|
9459
9460
|
const batchedResolveUsers = new Batch(
|
|
9460
9461
|
async (batchedUserIds) => {
|
|
9461
9462
|
const userIds = batchedUserIds.flat();
|
|
9462
|
-
const users = await _optionalChain([resolveUsers, 'optionalCall',
|
|
9463
|
+
const users = await _optionalChain([resolveUsers, 'optionalCall', _202 => _202({ userIds })]);
|
|
9463
9464
|
warnIfNoResolveUsers();
|
|
9464
9465
|
return _nullishCoalesce(users, () => ( userIds.map(() => void 0)));
|
|
9465
9466
|
},
|
|
@@ -9477,7 +9478,7 @@ function createClient(options) {
|
|
|
9477
9478
|
const batchedResolveRoomsInfo = new Batch(
|
|
9478
9479
|
async (batchedRoomIds) => {
|
|
9479
9480
|
const roomIds = batchedRoomIds.flat();
|
|
9480
|
-
const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall',
|
|
9481
|
+
const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall', _203 => _203({ roomIds })]);
|
|
9481
9482
|
warnIfNoResolveRoomsInfo();
|
|
9482
9483
|
return _nullishCoalesce(roomsInfo, () => ( roomIds.map(() => void 0)));
|
|
9483
9484
|
},
|
|
@@ -9530,7 +9531,7 @@ function createClient(options) {
|
|
|
9530
9531
|
}
|
|
9531
9532
|
};
|
|
9532
9533
|
const win = typeof window !== "undefined" ? window : void 0;
|
|
9533
|
-
_optionalChain([win, 'optionalAccess',
|
|
9534
|
+
_optionalChain([win, 'optionalAccess', _204 => _204.addEventListener, 'call', _205 => _205("beforeunload", maybePreventClose)]);
|
|
9534
9535
|
}
|
|
9535
9536
|
async function getNotificationSettings(options2) {
|
|
9536
9537
|
const plainSettings = await httpClient.getNotificationSettings(options2);
|
|
@@ -9669,7 +9670,7 @@ var commentBodyElementsTypes = {
|
|
|
9669
9670
|
mention: "inline"
|
|
9670
9671
|
};
|
|
9671
9672
|
function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
|
|
9672
|
-
if (!body || !_optionalChain([body, 'optionalAccess',
|
|
9673
|
+
if (!body || !_optionalChain([body, 'optionalAccess', _206 => _206.content])) {
|
|
9673
9674
|
return;
|
|
9674
9675
|
}
|
|
9675
9676
|
const element = typeof elementOrVisitor === "string" ? elementOrVisitor : void 0;
|
|
@@ -9679,13 +9680,13 @@ function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
|
|
|
9679
9680
|
for (const block of body.content) {
|
|
9680
9681
|
if (type === "all" || type === "block") {
|
|
9681
9682
|
if (guard(block)) {
|
|
9682
|
-
_optionalChain([visitor, 'optionalCall',
|
|
9683
|
+
_optionalChain([visitor, 'optionalCall', _207 => _207(block)]);
|
|
9683
9684
|
}
|
|
9684
9685
|
}
|
|
9685
9686
|
if (type === "all" || type === "inline") {
|
|
9686
9687
|
for (const inline of block.children) {
|
|
9687
9688
|
if (guard(inline)) {
|
|
9688
|
-
_optionalChain([visitor, 'optionalCall',
|
|
9689
|
+
_optionalChain([visitor, 'optionalCall', _208 => _208(inline)]);
|
|
9689
9690
|
}
|
|
9690
9691
|
}
|
|
9691
9692
|
}
|
|
@@ -9710,7 +9711,7 @@ async function resolveUsersInCommentBody(body, resolveUsers) {
|
|
|
9710
9711
|
userIds
|
|
9711
9712
|
});
|
|
9712
9713
|
for (const [index, userId] of userIds.entries()) {
|
|
9713
|
-
const user = _optionalChain([users, 'optionalAccess',
|
|
9714
|
+
const user = _optionalChain([users, 'optionalAccess', _209 => _209[index]]);
|
|
9714
9715
|
if (user) {
|
|
9715
9716
|
resolvedUsers.set(userId, user);
|
|
9716
9717
|
}
|
|
@@ -9837,7 +9838,7 @@ var stringifyCommentBodyPlainElements = {
|
|
|
9837
9838
|
text: ({ element }) => element.text,
|
|
9838
9839
|
link: ({ element }) => _nullishCoalesce(element.text, () => ( element.url)),
|
|
9839
9840
|
mention: ({ element, user }) => {
|
|
9840
|
-
return `@${_nullishCoalesce(_optionalChain([user, 'optionalAccess',
|
|
9841
|
+
return `@${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _210 => _210.name]), () => ( element.id))}`;
|
|
9841
9842
|
}
|
|
9842
9843
|
};
|
|
9843
9844
|
var stringifyCommentBodyHtmlElements = {
|
|
@@ -9867,7 +9868,7 @@ var stringifyCommentBodyHtmlElements = {
|
|
|
9867
9868
|
return html`<a href="${href}" target="_blank" rel="noopener noreferrer">${element.text ? html`${element.text}` : element.url}</a>`;
|
|
9868
9869
|
},
|
|
9869
9870
|
mention: ({ element, user }) => {
|
|
9870
|
-
return html`<span data-mention>@${_optionalChain([user, 'optionalAccess',
|
|
9871
|
+
return html`<span data-mention>@${_optionalChain([user, 'optionalAccess', _211 => _211.name]) ? html`${_optionalChain([user, 'optionalAccess', _212 => _212.name])}` : element.id}</span>`;
|
|
9871
9872
|
}
|
|
9872
9873
|
};
|
|
9873
9874
|
var stringifyCommentBodyMarkdownElements = {
|
|
@@ -9897,19 +9898,19 @@ var stringifyCommentBodyMarkdownElements = {
|
|
|
9897
9898
|
return markdown`[${_nullishCoalesce(element.text, () => ( element.url))}](${href})`;
|
|
9898
9899
|
},
|
|
9899
9900
|
mention: ({ element, user }) => {
|
|
9900
|
-
return markdown`@${_nullishCoalesce(_optionalChain([user, 'optionalAccess',
|
|
9901
|
+
return markdown`@${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _213 => _213.name]), () => ( element.id))}`;
|
|
9901
9902
|
}
|
|
9902
9903
|
};
|
|
9903
9904
|
async function stringifyCommentBody(body, options) {
|
|
9904
|
-
const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
9905
|
-
const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
9905
|
+
const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _214 => _214.format]), () => ( "plain"));
|
|
9906
|
+
const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _215 => _215.separator]), () => ( (format === "markdown" ? "\n\n" : "\n")));
|
|
9906
9907
|
const elements = {
|
|
9907
9908
|
...format === "html" ? stringifyCommentBodyHtmlElements : format === "markdown" ? stringifyCommentBodyMarkdownElements : stringifyCommentBodyPlainElements,
|
|
9908
|
-
..._optionalChain([options, 'optionalAccess',
|
|
9909
|
+
..._optionalChain([options, 'optionalAccess', _216 => _216.elements])
|
|
9909
9910
|
};
|
|
9910
9911
|
const resolvedUsers = await resolveUsersInCommentBody(
|
|
9911
9912
|
body,
|
|
9912
|
-
_optionalChain([options, 'optionalAccess',
|
|
9913
|
+
_optionalChain([options, 'optionalAccess', _217 => _217.resolveUsers])
|
|
9913
9914
|
);
|
|
9914
9915
|
const blocks = body.content.flatMap((block, blockIndex) => {
|
|
9915
9916
|
switch (block.type) {
|
|
@@ -10200,12 +10201,12 @@ function legacy_patchImmutableNode(state, path, update) {
|
|
|
10200
10201
|
}
|
|
10201
10202
|
const newState = Object.assign({}, state);
|
|
10202
10203
|
for (const key in update.updates) {
|
|
10203
|
-
if (_optionalChain([update, 'access',
|
|
10204
|
+
if (_optionalChain([update, 'access', _218 => _218.updates, 'access', _219 => _219[key], 'optionalAccess', _220 => _220.type]) === "update") {
|
|
10204
10205
|
const val = update.node.get(key);
|
|
10205
10206
|
if (val !== void 0) {
|
|
10206
10207
|
newState[key] = lsonToJson(val);
|
|
10207
10208
|
}
|
|
10208
|
-
} else if (_optionalChain([update, 'access',
|
|
10209
|
+
} else if (_optionalChain([update, 'access', _221 => _221.updates, 'access', _222 => _222[key], 'optionalAccess', _223 => _223.type]) === "delete") {
|
|
10209
10210
|
delete newState[key];
|
|
10210
10211
|
}
|
|
10211
10212
|
}
|
|
@@ -10266,12 +10267,12 @@ function legacy_patchImmutableNode(state, path, update) {
|
|
|
10266
10267
|
}
|
|
10267
10268
|
const newState = Object.assign({}, state);
|
|
10268
10269
|
for (const key in update.updates) {
|
|
10269
|
-
if (_optionalChain([update, 'access',
|
|
10270
|
+
if (_optionalChain([update, 'access', _224 => _224.updates, 'access', _225 => _225[key], 'optionalAccess', _226 => _226.type]) === "update") {
|
|
10270
10271
|
const value = update.node.get(key);
|
|
10271
10272
|
if (value !== void 0) {
|
|
10272
10273
|
newState[key] = lsonToJson(value);
|
|
10273
10274
|
}
|
|
10274
|
-
} else if (_optionalChain([update, 'access',
|
|
10275
|
+
} else if (_optionalChain([update, 'access', _227 => _227.updates, 'access', _228 => _228[key], 'optionalAccess', _229 => _229.type]) === "delete") {
|
|
10275
10276
|
delete newState[key];
|
|
10276
10277
|
}
|
|
10277
10278
|
}
|
|
@@ -10351,9 +10352,9 @@ function makePoller(callback, intervalMs, options) {
|
|
|
10351
10352
|
const startTime = performance.now();
|
|
10352
10353
|
const doc = typeof document !== "undefined" ? document : void 0;
|
|
10353
10354
|
const win = typeof window !== "undefined" ? window : void 0;
|
|
10354
|
-
const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
10355
|
+
const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _230 => _230.maxStaleTimeMs]), () => ( Number.POSITIVE_INFINITY));
|
|
10355
10356
|
const context = {
|
|
10356
|
-
inForeground: _optionalChain([doc, 'optionalAccess',
|
|
10357
|
+
inForeground: _optionalChain([doc, 'optionalAccess', _231 => _231.visibilityState]) !== "hidden",
|
|
10357
10358
|
lastSuccessfulPollAt: startTime,
|
|
10358
10359
|
count: 0,
|
|
10359
10360
|
backoff: 0
|
|
@@ -10434,11 +10435,11 @@ function makePoller(callback, intervalMs, options) {
|
|
|
10434
10435
|
pollNowIfStale();
|
|
10435
10436
|
}
|
|
10436
10437
|
function onVisibilityChange() {
|
|
10437
|
-
setInForeground(_optionalChain([doc, 'optionalAccess',
|
|
10438
|
+
setInForeground(_optionalChain([doc, 'optionalAccess', _232 => _232.visibilityState]) !== "hidden");
|
|
10438
10439
|
}
|
|
10439
|
-
_optionalChain([doc, 'optionalAccess',
|
|
10440
|
-
_optionalChain([win, 'optionalAccess',
|
|
10441
|
-
_optionalChain([win, 'optionalAccess',
|
|
10440
|
+
_optionalChain([doc, 'optionalAccess', _233 => _233.addEventListener, 'call', _234 => _234("visibilitychange", onVisibilityChange)]);
|
|
10441
|
+
_optionalChain([win, 'optionalAccess', _235 => _235.addEventListener, 'call', _236 => _236("online", onVisibilityChange)]);
|
|
10442
|
+
_optionalChain([win, 'optionalAccess', _237 => _237.addEventListener, 'call', _238 => _238("focus", pollNowIfStale)]);
|
|
10442
10443
|
fsm.start();
|
|
10443
10444
|
return {
|
|
10444
10445
|
inc,
|