@fluidframework/sequence 2.0.0-internal.8.0.0 → 2.0.0-internal.8.0.2

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.
Files changed (263) hide show
  1. package/dist/{defaultMap.js → defaultMap.cjs} +2 -2
  2. package/dist/defaultMap.cjs.map +1 -0
  3. package/{lib/intervalIndex/intervalIndex.js → dist/defaultMapInterfaces.cjs} +1 -1
  4. package/dist/defaultMapInterfaces.cjs.map +1 -0
  5. package/{lib/index.js → dist/index.cjs} +11 -11
  6. package/dist/index.cjs.map +1 -0
  7. package/dist/{intervalCollection.js → intervalCollection.cjs} +3 -3
  8. package/dist/intervalCollection.cjs.map +1 -0
  9. package/dist/intervalIndex/{endpointInRangeIndex.js → endpointInRangeIndex.cjs} +3 -3
  10. package/dist/intervalIndex/endpointInRangeIndex.cjs.map +1 -0
  11. package/{lib/intervalIndex/endpointIndex.js → dist/intervalIndex/endpointIndex.cjs} +2 -2
  12. package/dist/intervalIndex/endpointIndex.cjs.map +1 -0
  13. package/dist/intervalIndex/{idIntervalIndex.js → idIntervalIndex.cjs} +1 -1
  14. package/dist/intervalIndex/idIntervalIndex.cjs.map +1 -0
  15. package/{lib/intervalIndex/index.js → dist/intervalIndex/index.cjs} +7 -7
  16. package/dist/intervalIndex/index.cjs.map +1 -0
  17. package/dist/intervalIndex/{intervalIndex.js → intervalIndex.cjs} +1 -1
  18. package/dist/intervalIndex/intervalIndex.cjs.map +1 -0
  19. package/{lib/intervalIndex/intervalIndexUtils.js → dist/intervalIndex/intervalIndexUtils.cjs} +1 -1
  20. package/dist/intervalIndex/intervalIndexUtils.cjs.map +1 -0
  21. package/{lib/intervalIndex/overlappingIntervalsIndex.js → dist/intervalIndex/overlappingIntervalsIndex.cjs} +4 -4
  22. package/dist/intervalIndex/overlappingIntervalsIndex.cjs.map +1 -0
  23. package/{lib/intervalIndex/overlappingSequenceIntervalsIndex.js → dist/intervalIndex/overlappingSequenceIntervalsIndex.cjs} +3 -3
  24. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.cjs.map +1 -0
  25. package/dist/intervalIndex/{sequenceIntervalIndexes.js → sequenceIntervalIndexes.cjs} +1 -1
  26. package/dist/intervalIndex/sequenceIntervalIndexes.cjs.map +1 -0
  27. package/{lib/intervalIndex/startpointInRangeIndex.js → dist/intervalIndex/startpointInRangeIndex.cjs} +3 -3
  28. package/dist/intervalIndex/startpointInRangeIndex.cjs.map +1 -0
  29. package/{lib/intervalTree.js → dist/intervalTree.cjs} +1 -1
  30. package/dist/intervalTree.cjs.map +1 -0
  31. package/{lib/intervals/index.js → dist/intervals/index.cjs} +4 -4
  32. package/dist/intervals/index.cjs.map +1 -0
  33. package/dist/intervals/{interval.js → interval.cjs} +1 -1
  34. package/dist/intervals/interval.cjs.map +1 -0
  35. package/{lib/intervals/intervalUtils.js → dist/intervals/intervalUtils.cjs} +1 -1
  36. package/dist/intervals/intervalUtils.cjs.map +1 -0
  37. package/{lib/intervals/sequenceInterval.js → dist/intervals/sequenceInterval.cjs} +3 -3
  38. package/dist/intervals/sequenceInterval.cjs.map +1 -0
  39. package/dist/{localValues.js → localValues.cjs} +1 -1
  40. package/dist/localValues.cjs.map +1 -0
  41. package/{lib/packageVersion.js → dist/packageVersion.cjs} +2 -2
  42. package/dist/packageVersion.cjs.map +1 -0
  43. package/dist/packageVersion.d.ts +1 -1
  44. package/{lib/revertibles.js → dist/revertibles.cjs} +3 -3
  45. package/dist/revertibles.cjs.map +1 -0
  46. package/dist/{sequence.js → sequence.cjs} +4 -4
  47. package/dist/sequence.cjs.map +1 -0
  48. package/dist/{sequenceDeltaEvent.js → sequenceDeltaEvent.cjs} +1 -1
  49. package/dist/sequenceDeltaEvent.cjs.map +1 -0
  50. package/dist/{sequenceFactory.js → sequenceFactory.cjs} +3 -3
  51. package/dist/sequenceFactory.cjs.map +1 -0
  52. package/{lib/sharedIntervalCollection.js → dist/sharedIntervalCollection.cjs} +4 -4
  53. package/dist/sharedIntervalCollection.cjs.map +1 -0
  54. package/{lib/sharedSequence.js → dist/sharedSequence.cjs} +2 -2
  55. package/dist/sharedSequence.cjs.map +1 -0
  56. package/dist/{sharedString.js → sharedString.cjs} +3 -3
  57. package/dist/sharedString.cjs.map +1 -0
  58. package/lib/{defaultMap.d.ts → defaultMap.d.mts} +1 -1
  59. package/lib/defaultMap.d.mts.map +1 -0
  60. package/lib/{defaultMap.js → defaultMap.mjs} +19 -23
  61. package/lib/defaultMap.mjs.map +1 -0
  62. package/lib/{defaultMapInterfaces.d.ts → defaultMapInterfaces.d.mts} +1 -1
  63. package/lib/defaultMapInterfaces.d.mts.map +1 -0
  64. package/lib/defaultMapInterfaces.mjs +6 -0
  65. package/lib/{defaultMapInterfaces.js.map → defaultMapInterfaces.mjs.map} +1 -1
  66. package/lib/{index.d.ts → index.d.mts} +11 -23
  67. package/lib/index.d.mts.map +1 -0
  68. package/lib/index.mjs +16 -0
  69. package/lib/index.mjs.map +1 -0
  70. package/lib/{intervalCollection.d.ts → intervalCollection.d.mts} +3 -3
  71. package/lib/intervalCollection.d.mts.map +1 -0
  72. package/lib/{intervalCollection.js → intervalCollection.mjs} +118 -133
  73. package/lib/intervalCollection.mjs.map +1 -0
  74. package/lib/intervalIndex/{endpointInRangeIndex.d.ts → endpointInRangeIndex.d.mts} +3 -3
  75. package/lib/intervalIndex/endpointInRangeIndex.d.mts.map +1 -0
  76. package/lib/intervalIndex/{endpointInRangeIndex.js → endpointInRangeIndex.mjs} +13 -18
  77. package/lib/intervalIndex/endpointInRangeIndex.mjs.map +1 -0
  78. package/lib/intervalIndex/{endpointIndex.d.ts → endpointIndex.d.mts} +3 -3
  79. package/lib/intervalIndex/endpointIndex.d.mts.map +1 -0
  80. package/{dist/intervalIndex/endpointIndex.js → lib/intervalIndex/endpointIndex.mjs} +9 -14
  81. package/lib/intervalIndex/endpointIndex.mjs.map +1 -0
  82. package/lib/intervalIndex/{idIntervalIndex.d.ts → idIntervalIndex.d.mts} +2 -2
  83. package/lib/intervalIndex/idIntervalIndex.d.mts.map +1 -0
  84. package/lib/intervalIndex/{idIntervalIndex.js → idIntervalIndex.mjs} +5 -9
  85. package/lib/intervalIndex/idIntervalIndex.mjs.map +1 -0
  86. package/lib/intervalIndex/{index.d.ts → index.d.mts} +8 -8
  87. package/lib/intervalIndex/index.d.mts.map +1 -0
  88. package/lib/intervalIndex/index.mjs +11 -0
  89. package/{dist/intervalIndex/index.js.map → lib/intervalIndex/index.mjs.map} +1 -1
  90. package/lib/intervalIndex/{intervalIndex.d.ts → intervalIndex.d.mts} +1 -1
  91. package/lib/intervalIndex/intervalIndex.d.mts.map +1 -0
  92. package/lib/intervalIndex/intervalIndex.mjs +6 -0
  93. package/{dist/intervalIndex/intervalIndex.js.map → lib/intervalIndex/intervalIndex.mjs.map} +1 -1
  94. package/{dist/intervalIndex/intervalIndexUtils.js → lib/intervalIndex/intervalIndexUtils.mjs} +5 -9
  95. package/lib/intervalIndex/intervalIndexUtils.mjs.map +1 -0
  96. package/lib/intervalIndex/{overlappingIntervalsIndex.d.ts → overlappingIntervalsIndex.d.mts} +5 -5
  97. package/lib/intervalIndex/overlappingIntervalsIndex.d.mts.map +1 -0
  98. package/{dist/intervalIndex/overlappingIntervalsIndex.js → lib/intervalIndex/overlappingIntervalsIndex.mjs} +11 -16
  99. package/lib/intervalIndex/overlappingIntervalsIndex.mjs.map +1 -0
  100. package/lib/intervalIndex/{overlappingSequenceIntervalsIndex.d.ts → overlappingSequenceIntervalsIndex.d.mts} +2 -2
  101. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.mts.map +1 -0
  102. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs +37 -0
  103. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.mjs.map +1 -0
  104. package/lib/intervalIndex/{sequenceIntervalIndexes.d.ts → sequenceIntervalIndexes.d.mts} +2 -2
  105. package/lib/intervalIndex/sequenceIntervalIndexes.d.mts.map +1 -0
  106. package/lib/intervalIndex/sequenceIntervalIndexes.mjs +6 -0
  107. package/{dist/intervalIndex/sequenceIntervalIndexes.js.map → lib/intervalIndex/sequenceIntervalIndexes.mjs.map} +1 -1
  108. package/lib/intervalIndex/{startpointInRangeIndex.d.ts → startpointInRangeIndex.d.mts} +3 -3
  109. package/lib/intervalIndex/startpointInRangeIndex.d.mts.map +1 -0
  110. package/{dist/intervalIndex/startpointInRangeIndex.js → lib/intervalIndex/startpointInRangeIndex.mjs} +13 -18
  111. package/lib/intervalIndex/startpointInRangeIndex.mjs.map +1 -0
  112. package/lib/{intervalTree.d.ts → intervalTree.d.mts} +1 -1
  113. package/lib/intervalTree.d.mts.map +1 -0
  114. package/{dist/intervalTree.js → lib/intervalTree.mjs} +4 -8
  115. package/lib/intervalTree.mjs.map +1 -0
  116. package/lib/intervals/{index.d.ts → index.d.mts} +3 -3
  117. package/lib/intervals/index.d.mts.map +1 -0
  118. package/lib/intervals/index.mjs +8 -0
  119. package/lib/intervals/index.mjs.map +1 -0
  120. package/lib/intervals/{interval.d.ts → interval.d.mts} +2 -2
  121. package/lib/intervals/{interval.d.ts.map → interval.d.mts.map} +1 -1
  122. package/lib/intervals/{interval.js → interval.mjs} +13 -18
  123. package/lib/intervals/interval.mjs.map +1 -0
  124. package/lib/intervals/{intervalUtils.d.ts → intervalUtils.d.mts} +1 -1
  125. package/lib/intervals/intervalUtils.d.mts.map +1 -0
  126. package/{dist/intervals/intervalUtils.js → lib/intervals/intervalUtils.mjs} +14 -20
  127. package/lib/intervals/intervalUtils.mjs.map +1 -0
  128. package/lib/intervals/{sequenceInterval.d.ts → sequenceInterval.d.mts} +2 -2
  129. package/lib/intervals/sequenceInterval.d.mts.map +1 -0
  130. package/{dist/intervals/sequenceInterval.js → lib/intervals/sequenceInterval.mjs} +56 -64
  131. package/lib/intervals/sequenceInterval.mjs.map +1 -0
  132. package/lib/{localValues.d.ts → localValues.d.mts} +2 -2
  133. package/lib/localValues.d.mts.map +1 -0
  134. package/lib/{localValues.js → localValues.mjs} +5 -10
  135. package/lib/localValues.mjs.map +1 -0
  136. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +1 -1
  137. package/lib/packageVersion.mjs +9 -0
  138. package/lib/packageVersion.mjs.map +1 -0
  139. package/lib/{revertibles.d.ts → revertibles.d.mts} +3 -3
  140. package/lib/revertibles.d.mts.map +1 -0
  141. package/{dist/revertibles.js → lib/revertibles.mjs} +62 -71
  142. package/lib/revertibles.mjs.map +1 -0
  143. package/lib/{sequence.d.ts → sequence.d.mts} +4 -4
  144. package/lib/sequence.d.mts.map +1 -0
  145. package/lib/{sequence.js → sequence.mjs} +47 -48
  146. package/lib/sequence.mjs.map +1 -0
  147. package/lib/sequenceDeltaEvent.d.mts.map +1 -0
  148. package/lib/{sequenceDeltaEvent.js → sequenceDeltaEvent.mjs} +10 -14
  149. package/lib/sequenceDeltaEvent.mjs.map +1 -0
  150. package/lib/{sequenceFactory.d.ts → sequenceFactory.d.mts} +1 -1
  151. package/lib/sequenceFactory.d.mts.map +1 -0
  152. package/lib/{sequenceFactory.js → sequenceFactory.mjs} +10 -14
  153. package/lib/sequenceFactory.mjs.map +1 -0
  154. package/lib/{sharedIntervalCollection.d.ts → sharedIntervalCollection.d.mts} +2 -2
  155. package/lib/sharedIntervalCollection.d.mts.map +1 -0
  156. package/{dist/sharedIntervalCollection.js → lib/sharedIntervalCollection.mjs} +14 -19
  157. package/lib/sharedIntervalCollection.mjs.map +1 -0
  158. package/lib/{sharedSequence.d.ts → sharedSequence.d.mts} +1 -1
  159. package/lib/sharedSequence.d.mts.map +1 -0
  160. package/{dist/sharedSequence.js → lib/sharedSequence.mjs} +7 -12
  161. package/lib/sharedSequence.mjs.map +1 -0
  162. package/lib/{sharedString.d.ts → sharedString.d.mts} +2 -2
  163. package/lib/sharedString.d.mts.map +1 -0
  164. package/lib/{sharedString.js → sharedString.mjs} +17 -22
  165. package/lib/sharedString.mjs.map +1 -0
  166. package/package.json +38 -22
  167. package/sequence.test-files.tar +0 -0
  168. package/src/packageVersion.ts +1 -1
  169. package/tsc-multi.test.json +10 -0
  170. package/dist/defaultMap.js.map +0 -1
  171. package/dist/defaultMapInterfaces.js +0 -7
  172. package/dist/defaultMapInterfaces.js.map +0 -1
  173. package/dist/index.js +0 -60
  174. package/dist/index.js.map +0 -1
  175. package/dist/intervalCollection.js.map +0 -1
  176. package/dist/intervalIndex/endpointInRangeIndex.js.map +0 -1
  177. package/dist/intervalIndex/endpointIndex.js.map +0 -1
  178. package/dist/intervalIndex/idIntervalIndex.js.map +0 -1
  179. package/dist/intervalIndex/index.js +0 -24
  180. package/dist/intervalIndex/intervalIndexUtils.js.map +0 -1
  181. package/dist/intervalIndex/overlappingIntervalsIndex.js.map +0 -1
  182. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js +0 -41
  183. package/dist/intervalIndex/overlappingSequenceIntervalsIndex.js.map +0 -1
  184. package/dist/intervalIndex/startpointInRangeIndex.js.map +0 -1
  185. package/dist/intervalTree.js.map +0 -1
  186. package/dist/intervals/index.js +0 -23
  187. package/dist/intervals/index.js.map +0 -1
  188. package/dist/intervals/interval.js.map +0 -1
  189. package/dist/intervals/intervalUtils.js.map +0 -1
  190. package/dist/intervals/sequenceInterval.js.map +0 -1
  191. package/dist/localValues.js.map +0 -1
  192. package/dist/packageVersion.js +0 -12
  193. package/dist/packageVersion.js.map +0 -1
  194. package/dist/revertibles.js.map +0 -1
  195. package/dist/sequence.js.map +0 -1
  196. package/dist/sequenceDeltaEvent.js.map +0 -1
  197. package/dist/sequenceFactory.js.map +0 -1
  198. package/dist/sharedIntervalCollection.js.map +0 -1
  199. package/dist/sharedSequence.js.map +0 -1
  200. package/dist/sharedString.js.map +0 -1
  201. package/lib/defaultMap.d.ts.map +0 -1
  202. package/lib/defaultMap.js.map +0 -1
  203. package/lib/defaultMapInterfaces.d.ts.map +0 -1
  204. package/lib/defaultMapInterfaces.js +0 -7
  205. package/lib/index.d.ts.map +0 -1
  206. package/lib/index.js.map +0 -1
  207. package/lib/intervalCollection.d.ts.map +0 -1
  208. package/lib/intervalCollection.js.map +0 -1
  209. package/lib/intervalIndex/endpointInRangeIndex.d.ts.map +0 -1
  210. package/lib/intervalIndex/endpointInRangeIndex.js.map +0 -1
  211. package/lib/intervalIndex/endpointIndex.d.ts.map +0 -1
  212. package/lib/intervalIndex/endpointIndex.js.map +0 -1
  213. package/lib/intervalIndex/idIntervalIndex.d.ts.map +0 -1
  214. package/lib/intervalIndex/idIntervalIndex.js.map +0 -1
  215. package/lib/intervalIndex/index.d.ts.map +0 -1
  216. package/lib/intervalIndex/index.js.map +0 -1
  217. package/lib/intervalIndex/intervalIndex.d.ts.map +0 -1
  218. package/lib/intervalIndex/intervalIndex.js.map +0 -1
  219. package/lib/intervalIndex/intervalIndexUtils.js.map +0 -1
  220. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +0 -1
  221. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +0 -1
  222. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.d.ts.map +0 -1
  223. package/lib/intervalIndex/overlappingSequenceIntervalsIndex.js.map +0 -1
  224. package/lib/intervalIndex/sequenceIntervalIndexes.d.ts.map +0 -1
  225. package/lib/intervalIndex/sequenceIntervalIndexes.js +0 -7
  226. package/lib/intervalIndex/sequenceIntervalIndexes.js.map +0 -1
  227. package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +0 -1
  228. package/lib/intervalIndex/startpointInRangeIndex.js.map +0 -1
  229. package/lib/intervalTree.d.ts.map +0 -1
  230. package/lib/intervalTree.js.map +0 -1
  231. package/lib/intervals/index.d.ts.map +0 -1
  232. package/lib/intervals/index.js.map +0 -1
  233. package/lib/intervals/interval.js.map +0 -1
  234. package/lib/intervals/intervalUtils.d.ts.map +0 -1
  235. package/lib/intervals/intervalUtils.js.map +0 -1
  236. package/lib/intervals/sequenceInterval.d.ts.map +0 -1
  237. package/lib/intervals/sequenceInterval.js.map +0 -1
  238. package/lib/localValues.d.ts.map +0 -1
  239. package/lib/localValues.js.map +0 -1
  240. package/lib/packageVersion.js.map +0 -1
  241. package/lib/revertibles.d.ts.map +0 -1
  242. package/lib/revertibles.js.map +0 -1
  243. package/lib/sequence.d.ts.map +0 -1
  244. package/lib/sequence.js.map +0 -1
  245. package/lib/sequenceDeltaEvent.d.ts.map +0 -1
  246. package/lib/sequenceDeltaEvent.js.map +0 -1
  247. package/lib/sequenceFactory.d.ts.map +0 -1
  248. package/lib/sequenceFactory.js.map +0 -1
  249. package/lib/sharedIntervalCollection.d.ts.map +0 -1
  250. package/lib/sharedIntervalCollection.js.map +0 -1
  251. package/lib/sharedSequence.d.ts.map +0 -1
  252. package/lib/sharedSequence.js.map +0 -1
  253. package/lib/sharedString.d.ts.map +0 -1
  254. package/lib/sharedString.js.map +0 -1
  255. package/tsconfig.esnext.json +0 -6
  256. /package/lib/intervalIndex/{intervalIndexUtils.d.ts → intervalIndexUtils.d.mts} +0 -0
  257. /package/lib/intervalIndex/{intervalIndexUtils.d.ts.map → intervalIndexUtils.d.mts.map} +0 -0
  258. /package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +0 -0
  259. /package/lib/{sequence-alpha.d.ts → sequence-alpha.d.mts} +0 -0
  260. /package/lib/{sequence-beta.d.ts → sequence-beta.d.mts} +0 -0
  261. /package/lib/{sequence-public.d.ts → sequence-public.d.mts} +0 -0
  262. /package/lib/{sequence-untrimmed.d.ts → sequence-untrimmed.d.mts} +0 -0
  263. /package/lib/{sequenceDeltaEvent.d.ts → sequenceDeltaEvent.d.mts} +0 -0
@@ -1,26 +1,27 @@
1
- "use strict";
2
1
  /*!
3
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
3
  * Licensed under the MIT License.
5
4
  */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.resetReentrancyLogCounter = exports.SharedSegmentSequence = void 0;
8
- const core_utils_1 = require("@fluidframework/core-utils");
9
- const client_utils_1 = require("@fluid-internal/client-utils");
10
- const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
11
- const protocol_definitions_1 = require("@fluidframework/protocol-definitions");
12
- const merge_tree_1 = require("@fluidframework/merge-tree");
13
- const runtime_utils_1 = require("@fluidframework/runtime-utils");
14
- const shared_object_base_1 = require("@fluidframework/shared-object-base");
15
- const defaultMap_1 = require("./defaultMap");
16
- const intervalCollection_1 = require("./intervalCollection");
17
- const sequenceDeltaEvent_1 = require("./sequenceDeltaEvent");
5
+ import { assert, Deferred } from "@fluidframework/core-utils";
6
+ import { bufferToString } from "@fluid-internal/client-utils";
7
+ import { LoggingError, createChildLogger } from "@fluidframework/telemetry-utils";
8
+ import { MessageType } from "@fluidframework/protocol-definitions";
9
+ import {
10
+ // eslint-disable-next-line import/no-deprecated
11
+ Client, createAnnotateRangeOp,
12
+ // eslint-disable-next-line import/no-deprecated
13
+ createGroupOp, createInsertOp, createRemoveRangeOp, matchProperties, MergeTreeDeltaType, createObliterateRangeOp, } from "@fluidframework/merge-tree";
14
+ import { ObjectStoragePartition, SummaryTreeBuilder } from "@fluidframework/runtime-utils";
15
+ import { makeHandlesSerializable, parseHandles, SharedObject, } from "@fluidframework/shared-object-base";
16
+ import { DefaultMap } from "./defaultMap.mjs";
17
+ import { SequenceIntervalCollectionValueType, } from "./intervalCollection.mjs";
18
+ import { SequenceDeltaEvent, SequenceMaintenanceEvent } from "./sequenceDeltaEvent.mjs";
18
19
  const snapshotFileName = "header";
19
20
  const contentPath = "content";
20
21
  /**
21
22
  * @alpha
22
23
  */
23
- class SharedSegmentSequence extends shared_object_base_1.SharedObject {
24
+ export class SharedSegmentSequence extends SharedObject {
24
25
  get loaded() {
25
26
  return this.loadedDeferred.promise;
26
27
  }
@@ -28,7 +29,7 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
28
29
  const ops = [];
29
30
  for (const r of event.ranges) {
30
31
  switch (event.deltaOperation) {
31
- case merge_tree_1.MergeTreeDeltaType.ANNOTATE: {
32
+ case MergeTreeDeltaType.ANNOTATE: {
32
33
  const lastAnnotate = ops[ops.length - 1];
33
34
  const props = {};
34
35
  for (const key of Object.keys(r.propertyDeltas)) {
@@ -36,36 +37,36 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
36
37
  }
37
38
  if (lastAnnotate &&
38
39
  lastAnnotate.pos2 === r.position &&
39
- (0, merge_tree_1.matchProperties)(lastAnnotate.props, props)) {
40
+ matchProperties(lastAnnotate.props, props)) {
40
41
  lastAnnotate.pos2 += r.segment.cachedLength;
41
42
  }
42
43
  else {
43
- ops.push((0, merge_tree_1.createAnnotateRangeOp)(r.position, r.position + r.segment.cachedLength, props));
44
+ ops.push(createAnnotateRangeOp(r.position, r.position + r.segment.cachedLength, props));
44
45
  }
45
46
  break;
46
47
  }
47
- case merge_tree_1.MergeTreeDeltaType.INSERT:
48
- ops.push((0, merge_tree_1.createInsertOp)(r.position, r.segment.clone().toJSONObject()));
48
+ case MergeTreeDeltaType.INSERT:
49
+ ops.push(createInsertOp(r.position, r.segment.clone().toJSONObject()));
49
50
  break;
50
- case merge_tree_1.MergeTreeDeltaType.REMOVE: {
51
+ case MergeTreeDeltaType.REMOVE: {
51
52
  const lastRem = ops[ops.length - 1];
52
53
  if (lastRem?.pos1 === r.position) {
53
- (0, core_utils_1.assert)(lastRem.pos2 !== undefined, 0x3ff /* pos2 should not be undefined here */);
54
+ assert(lastRem.pos2 !== undefined, 0x3ff /* pos2 should not be undefined here */);
54
55
  lastRem.pos2 += r.segment.cachedLength;
55
56
  }
56
57
  else {
57
- ops.push((0, merge_tree_1.createRemoveRangeOp)(r.position, r.position + r.segment.cachedLength));
58
+ ops.push(createRemoveRangeOp(r.position, r.position + r.segment.cachedLength));
58
59
  }
59
60
  break;
60
61
  }
61
- case merge_tree_1.MergeTreeDeltaType.OBLITERATE: {
62
+ case MergeTreeDeltaType.OBLITERATE: {
62
63
  const lastRem = ops[ops.length - 1];
63
64
  if (lastRem?.pos1 === r.position) {
64
- (0, core_utils_1.assert)(lastRem.pos2 !== undefined, 0x874 /* pos2 should not be undefined here */);
65
+ assert(lastRem.pos2 !== undefined, 0x874 /* pos2 should not be undefined here */);
65
66
  lastRem.pos2 += r.segment.cachedLength;
66
67
  }
67
68
  else {
68
- ops.push((0, merge_tree_1.createObliterateRangeOp)(r.position, r.position + r.segment.cachedLength));
69
+ ops.push(createObliterateRangeOp(r.position, r.position + r.segment.cachedLength));
69
70
  }
70
71
  break;
71
72
  }
@@ -80,7 +81,7 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
80
81
  this.id = id;
81
82
  this.segmentFromSpec = segmentFromSpec;
82
83
  /** `Deferred` that triggers once the object is loaded */
83
- this.loadedDeferred = new core_utils_1.Deferred();
84
+ this.loadedDeferred = new Deferred();
84
85
  // cache out going ops created when partial loading
85
86
  this.loadedDeferredOutgoingOps = [];
86
87
  // cache incoming ops that arrive when partial loading
@@ -93,28 +94,28 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
93
94
  : createReentrancyDetector((depth) => {
94
95
  if (totalReentrancyLogs > 0) {
95
96
  totalReentrancyLogs--;
96
- this.logger.sendTelemetryEvent({ eventName: "LocalOpReentry", depth }, new telemetry_utils_1.LoggingError(reentrancyErrorMessage));
97
+ this.logger.sendTelemetryEvent({ eventName: "LocalOpReentry", depth }, new LoggingError(reentrancyErrorMessage));
97
98
  }
98
99
  });
99
100
  this.loadedDeferred.promise.catch((error) => {
100
101
  this.logger.sendErrorEvent({ eventName: "SequenceLoadFailed" }, error);
101
102
  });
102
103
  // eslint-disable-next-line import/no-deprecated
103
- this.client = new merge_tree_1.Client(segmentFromSpec, (0, telemetry_utils_1.createChildLogger)({
104
+ this.client = new Client(segmentFromSpec, createChildLogger({
104
105
  logger: this.logger,
105
106
  namespace: "SharedSegmentSequence.MergeTreeClient",
106
107
  }), dataStoreRuntime.options);
107
108
  this.client.prependListener("delta", (opArgs, deltaArgs) => {
108
- const event = new sequenceDeltaEvent_1.SequenceDeltaEvent(opArgs, deltaArgs, this.client);
109
+ const event = new SequenceDeltaEvent(opArgs, deltaArgs, this.client);
109
110
  if (opArgs.stashed !== true && event.isLocal) {
110
111
  this.submitSequenceMessage(opArgs.op);
111
112
  }
112
113
  this.emit("sequenceDelta", event, this);
113
114
  });
114
115
  this.client.on("maintenance", (args, opArgs) => {
115
- this.emit("maintenance", new sequenceDeltaEvent_1.SequenceMaintenanceEvent(opArgs, args, this.client), this);
116
+ this.emit("maintenance", new SequenceMaintenanceEvent(opArgs, args, this.client), this);
116
117
  });
117
- this.intervalCollections = new defaultMap_1.DefaultMap(this.serializer, this.handle, (op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata), new intervalCollection_1.SequenceIntervalCollectionValueType(), dataStoreRuntime.options);
118
+ this.intervalCollections = new DefaultMap(this.serializer, this.handle, (op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata), new SequenceIntervalCollectionValueType(), dataStoreRuntime.options);
118
119
  }
119
120
  /**
120
121
  * @param start - The inclusive start of the range to remove
@@ -224,8 +225,8 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
224
225
  if (!this.isAttached()) {
225
226
  return;
226
227
  }
227
- const translated = (0, shared_object_base_1.makeHandlesSerializable)(message, this.serializer, this.handle);
228
- const metadata = this.client.peekPendingSegmentGroups(message.type === merge_tree_1.MergeTreeDeltaType.GROUP ? message.ops.length : 1);
228
+ const translated = makeHandlesSerializable(message, this.serializer, this.handle);
229
+ const metadata = this.client.peekPendingSegmentGroups(message.type === MergeTreeDeltaType.GROUP ? message.ops.length : 1);
229
230
  // if loading isn't complete, we need to cache
230
231
  // local ops until loading is complete, and then
231
232
  // they will be present
@@ -311,7 +312,7 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
311
312
  * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
312
313
  */
313
314
  summarizeCore(serializer, telemetryContext) {
314
- const builder = new runtime_utils_1.SummaryTreeBuilder();
315
+ const builder = new SummaryTreeBuilder();
315
316
  // conditionally write the interval collection blob
316
317
  // only if it has entries
317
318
  if (this.intervalCollections.size > 0) {
@@ -375,14 +376,14 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
375
376
  async loadCore(storage) {
376
377
  if (await storage.contains(snapshotFileName)) {
377
378
  const blob = await storage.readBlob(snapshotFileName);
378
- const header = (0, client_utils_1.bufferToString)(blob, "utf8");
379
+ const header = bufferToString(blob, "utf8");
379
380
  this.intervalCollections.populate(header);
380
381
  }
381
382
  try {
382
383
  // this will load the header, and return a promise
383
384
  // that will resolve when the body is loaded
384
385
  // and the catchup ops are available.
385
- const { catchupOpsP } = await this.client.load(this.runtime, new runtime_utils_1.ObjectStoragePartition(storage, contentPath), this.serializer);
386
+ const { catchupOpsP } = await this.client.load(this.runtime, new ObjectStoragePartition(storage, contentPath), this.serializer);
386
387
  // setup a promise to process the
387
388
  // catch up ops, and finishing the loading process
388
389
  const loadCatchUpOps = catchupOpsP
@@ -430,11 +431,11 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
430
431
  // if loading isn't complete, we need to cache all
431
432
  // incoming ops to be applied after loading is complete
432
433
  if (this.deferIncomingOps) {
433
- (0, core_utils_1.assert)(!local, 0x072 /* "Unexpected local op when loading not finished" */);
434
+ assert(!local, 0x072 /* "Unexpected local op when loading not finished" */);
434
435
  this.loadedDeferredIncomingOps.push(message);
435
436
  }
436
437
  else {
437
- (0, core_utils_1.assert)(message.type === protocol_definitions_1.MessageType.Operation, 0x073 /* "Sequence message not operation" */);
438
+ assert(message.type === MessageType.Operation, 0x073 /* "Sequence message not operation" */);
438
439
  const handled = this.intervalCollections.tryProcessMessage(message.contents, local, message, localOpMetadata);
439
440
  if (!handled) {
440
441
  this.processMergeTreeMsg(message, local);
@@ -462,11 +463,11 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
462
463
  * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
463
464
  */
464
465
  applyStashedOp(content) {
465
- return this.client.applyStashedOp((0, shared_object_base_1.parseHandles)(content, this.serializer));
466
+ return this.client.applyStashedOp(parseHandles(content, this.serializer));
466
467
  }
467
468
  summarizeMergeTree(serializer) {
468
469
  // Are we fully loaded? If not, things will go south
469
- (0, core_utils_1.assert)(this.loadedDeferred.isCompleted, 0x074 /* "Snapshot called when not fully loaded" */);
470
+ assert(this.loadedDeferred.isCompleted, 0x074 /* "Snapshot called when not fully loaded" */);
470
471
  const minSeq = this.runtime.deltaManager.minimumSequenceNumber;
471
472
  this.processMinSequenceNumberChanged(minSeq);
472
473
  this.messagesSinceMSNChange.forEach((m) => {
@@ -475,7 +476,7 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
475
476
  return this.client.summarize(this.runtime, this.handle, serializer, this.messagesSinceMSNChange);
476
477
  }
477
478
  processMergeTreeMsg(rawMessage, local) {
478
- const message = (0, shared_object_base_1.parseHandles)(rawMessage, this.serializer);
479
+ const message = parseHandles(rawMessage, this.serializer);
479
480
  const ops = [];
480
481
  function transformOps(event) {
481
482
  ops.push(...SharedSegmentSequence.createOpsFromDelta(event));
@@ -497,7 +498,7 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
497
498
  ...message,
498
499
  referenceSequenceNumber: stashMessage.sequenceNumber - 1,
499
500
  // eslint-disable-next-line import/no-deprecated
500
- contents: ops.length !== 1 ? (0, merge_tree_1.createGroupOp)(...ops) : ops[0],
501
+ contents: ops.length !== 1 ? createGroupOp(...ops) : ops[0],
501
502
  };
502
503
  }
503
504
  this.messagesSinceMSNChange.push(stashMessage);
@@ -553,7 +554,7 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
553
554
  if (!intervalCollection.attached) {
554
555
  intervalCollection.attachGraph(this.client, key);
555
556
  }
556
- (0, core_utils_1.assert)(previousValue === undefined, 0x2c1 /* "Creating an interval collection that already exists?" */);
557
+ assert(previousValue === undefined, 0x2c1 /* "Creating an interval collection that already exists?" */);
557
558
  this.emit("createIntervalCollection", key, local, this);
558
559
  });
559
560
  // Initialize existing SharedIntervalCollections
@@ -563,7 +564,6 @@ class SharedSegmentSequence extends shared_object_base_1.SharedObject {
563
564
  }
564
565
  }
565
566
  }
566
- exports.SharedSegmentSequence = SharedSegmentSequence;
567
567
  function createReentrancyDetector(onReentrancy) {
568
568
  let depth = 0;
569
569
  function detectReentrancy(callback) {
@@ -589,12 +589,11 @@ let totalReentrancyLogs = 3;
589
589
  /**
590
590
  * Resets the reentrancy log counter. Test-only API.
591
591
  */
592
- function resetReentrancyLogCounter() {
592
+ export function resetReentrancyLogCounter() {
593
593
  totalReentrancyLogs = 3;
594
594
  }
595
- exports.resetReentrancyLogCounter = resetReentrancyLogCounter;
596
595
  const reentrancyErrorMessage = "Reentrancy detected in sequence local ops";
597
596
  const ensureNoReentrancy = createReentrancyDetector(() => {
598
- throw new telemetry_utils_1.LoggingError(reentrancyErrorMessage);
597
+ throw new LoggingError(reentrancyErrorMessage);
599
598
  });
600
- //# sourceMappingURL=sequence.js.map
599
+ //# sourceMappingURL=sequence.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequence.mjs","sourceRoot":"","sources":["../src/sequence.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B;OACtD,EAAE,cAAc,EAAE,MAAM,8BAA8B;OACtD,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC;OAC1E,EAA6B,WAAW,EAAE,MAAM,sCAAsC;OAMtF;AACN,gDAAgD;AAChD,MAAM,EACN,qBAAqB;AACrB,gDAAgD;AAChD,aAAa,EACb,cAAc,EACd,mBAAmB,EAWnB,eAAe,EACf,kBAAkB,EAOlB,uBAAuB,GAEvB,MAAM,4BAA4B;OAC5B,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B;OACnF,EAEN,uBAAuB,EACvB,YAAY,EACZ,YAAY,GAGZ,MAAM,oCAAoC;OAGpC,EAAE,UAAU,EAAiB;OAG7B,EAGN,mCAAmC,GACnC;OACM,EAAE,kBA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AI;YACH,OAAO,QAAQ,EAAE,CAAC;SAClB;gBAAS;YACT,KAAK,EAAE,CAAC;SACR;IACF,CAAC;IAED,OAAO,gBAAgB,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,IAAI,mBAAmB,GAAG,CAAC,CAAC;AAE5B;;GAEG;AACH,MAAM,UAAU,yBAAyB;IACxC,mBAAmB,GAAG,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,sBAAsB,GAAG,2CAA2C,CAAC;AAC3E,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,GAAG,EAAE;IACxD,MAAM,IAAI,YAAY,CAAC,sBAAsB,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Deferred } from \"@fluidframework/core-utils\";\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { LoggingError, createChildLogger } from \"@fluidframework/telemetry-utils\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tClient,\n\tcreateAnnotateRangeOp,\n\t// eslint-disable-next-line import/no-deprecated\n\tcreateGroupOp,\n\tcreateInsertOp,\n\tcreateRemoveRangeOp,\n\tIJSONSegment,\n\tIMergeTreeAnnotateMsg,\n\tIMergeTreeDeltaOp,\n\tIMergeTreeGroupMsg,\n\tIMergeTreeOp,\n\tIMergeTreeRemoveMsg,\n\tIRelativePosition,\n\tISegment,\n\tISegmentAction,\n\tLocalReferencePosition,\n\tmatchProperties,\n\tMergeTreeDeltaType,\n\tPropertySet,\n\tReferencePosition,\n\tReferenceType,\n\tMergeTreeRevertibleDriver,\n\tSegmentGroup,\n\tIMergeTreeObliterateMsg,\n\tcreateObliterateRangeOp,\n\tSlidingPreference,\n} from \"@fluidframework/merge-tree\";\nimport { ObjectStoragePartition, SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport {\n\tIFluidSerializer,\n\tmakeHandlesSerializable,\n\tparseHandles,\n\tSharedObject,\n\tISharedObjectEvents,\n\tSummarySerializer,\n} from \"@fluidframework/shared-object-base\";\nimport { IEventThisPlaceHolder } from \"@fluidframework/core-interfaces\";\nimport { ISummaryTreeWithStats, ITelemetryContext } from \"@fluidframework/runtime-definitions\";\nimport { DefaultMap, IMapOperation } from \"./defaultMap\";\nimport { IMapMessageLocalMetadata, IValueChanged } from \"./defaultMapInterfaces\";\nimport { SequenceInterval } from \"./intervals\";\nimport {\n\tIIntervalCollection,\n\tIntervalCollection,\n\tSequenceIntervalCollectionValueType,\n} from \"./intervalCollection\";\nimport { SequenceDeltaEvent, SequenceMaintenanceEvent } from \"./sequenceDeltaEvent\";\nimport { ISharedIntervalCollection } from \"./sharedIntervalCollection\";\n\nconst snapshotFileName = \"header\";\nconst contentPath = \"content\";\n\n/**\n * Events emitted in response to changes to the sequence data.\n *\n * @remarks\n *\n * The following is the list of events emitted.\n *\n * ### \"sequenceDelta\"\n *\n * The sequenceDelta event is emitted when segments are inserted, annotated, or removed.\n *\n * #### Listener signature\n *\n * ```typescript\n * (event: SequenceDeltaEvent, target: IEventThisPlaceHolder) => void\n * ```\n * - `event` - Various information on the segments that were modified.\n *\n * - `target` - The sequence itself.\n *\n * ### \"maintenance\"\n *\n * The maintenance event is emitted when segments are modified during merge-tree maintenance.\n *\n * #### Listener signature\n *\n * ```typescript\n * (event: SequenceMaintenanceEvent, target: IEventThisPlaceHolder) => void\n * ```\n * - `event` - Various information on the segments that were modified.\n *\n * - `target` - The sequence itself.\n * @alpha\n */\nexport interface ISharedSegmentSequenceEvents extends ISharedObjectEvents {\n\t(\n\t\tevent: \"createIntervalCollection\",\n\t\tlistener: (label: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t): void;\n\t(\n\t\tevent: \"sequenceDelta\",\n\t\tlistener: (event: SequenceDeltaEvent, target: IEventThisPlaceHolder) => void,\n\t): void;\n\t(\n\t\tevent: \"maintenance\",\n\t\tlistener: (event: SequenceMaintenanceEvent, target: IEventThisPlaceHolder) => void,\n\t): void;\n}\n\n/**\n * @alpha\n */\nexport abstract class SharedSegmentSequence<T extends ISegment>\n\textends SharedObject<ISharedSegmentSequenceEvents>\n\timplements ISharedIntervalCollection<SequenceInterval>, MergeTreeRevertibleDriver\n{\n\tget loaded(): Promise<void> {\n\t\treturn this.loadedDeferred.promise;\n\t}\n\n\t/**\n\t * This is a safeguard to avoid problematic reentrancy of local ops. This type of scenario occurs if the user of SharedString subscribes\n\t * to the `sequenceDelta` event and uses the callback for a local op to submit further local ops.\n\t * Historically (before 2.0.0-internal.6.1.0), doing so would result in eventual consistency issues or a corrupted document.\n\t * These issues were fixed in #16815 which makes such reentrancy no different from applying the ops in order but not from within the change events,\n\t * but there is still little test coverage for reentrant scenarios.\n\t * Additionally, applications submitting ops from inside change events need to take extreme care that their data models also support reentrancy.\n\t * Since this is likely not the case, by default SharedString throws when encountering reentrant ops.\n\t *\n\t * An application using SharedString which explicitly wants to opt in to allowing reentrancy anyway can set `sharedStringPreventReentrancy`\n\t * on the data store options to `false`.\n\t */\n\tprotected guardReentrancy: <TRet>(callback: () => TRet) => TRet;\n\n\tprivate static createOpsFromDelta(event: SequenceDeltaEvent): IMergeTreeDeltaOp[] {\n\t\tconst ops: IMergeTreeDeltaOp[] = [];\n\t\tfor (const r of event.ranges) {\n\t\t\tswitch (event.deltaOperation) {\n\t\t\t\tcase MergeTreeDeltaType.ANNOTATE: {\n\t\t\t\t\tconst lastAnnotate = ops[ops.length - 1] as IMergeTreeAnnotateMsg;\n\t\t\t\t\tconst props: PropertySet = {};\n\t\t\t\t\tfor (const key of Object.keys(r.propertyDeltas)) {\n\t\t\t\t\t\tprops[key] = r.segment.properties?.[key] ?? null;\n\t\t\t\t\t}\n\t\t\t\t\tif (\n\t\t\t\t\t\tlastAnnotate &&\n\t\t\t\t\t\tlastAnnotate.pos2 === r.position &&\n\t\t\t\t\t\tmatchProperties(lastAnnotate.props, props)\n\t\t\t\t\t) {\n\t\t\t\t\t\tlastAnnotate.pos2 += r.segment.cachedLength;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tops.push(\n\t\t\t\t\t\t\tcreateAnnotateRangeOp(\n\t\t\t\t\t\t\t\tr.position,\n\t\t\t\t\t\t\t\tr.position + r.segment.cachedLength,\n\t\t\t\t\t\t\t\tprops,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase MergeTreeDeltaType.INSERT:\n\t\t\t\t\tops.push(createInsertOp(r.position, r.segment.clone().toJSONObject()));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MergeTreeDeltaType.REMOVE: {\n\t\t\t\t\tconst lastRem = ops[ops.length - 1] as IMergeTreeRemoveMsg;\n\t\t\t\t\tif (lastRem?.pos1 === r.position) {\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tlastRem.pos2 !== undefined,\n\t\t\t\t\t\t\t0x3ff /* pos2 should not be undefined here */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlastRem.pos2 += r.segment.cachedLength;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tops.push(\n\t\t\t\t\t\t\tcreateRemoveRangeOp(r.position, r.position + r.segment.cachedLength),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase MergeTreeDeltaType.OBLITERATE: {\n\t\t\t\t\tconst lastRem = ops[ops.length - 1] as IMergeTreeObliterateMsg;\n\t\t\t\t\tif (lastRem?.pos1 === r.position) {\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tlastRem.pos2 !== undefined,\n\t\t\t\t\t\t\t0x874 /* pos2 should not be undefined here */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlastRem.pos2 += r.segment.cachedLength;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tops.push(\n\t\t\t\t\t\t\tcreateObliterateRangeOp(\n\t\t\t\t\t\t\t\tr.position,\n\t\t\t\t\t\t\t\tr.position + r.segment.cachedLength,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t\treturn ops;\n\t}\n\n\t// eslint-disable-next-line import/no-deprecated\n\tprotected client: Client;\n\t/** `Deferred` that triggers once the object is loaded */\n\tprotected loadedDeferred = new Deferred<void>();\n\t// cache out going ops created when partial loading\n\tprivate readonly loadedDeferredOutgoingOps: [IMergeTreeOp, SegmentGroup | SegmentGroup[]][] =\n\t\t[];\n\t// cache incoming ops that arrive when partial loading\n\tprivate deferIncomingOps = true;\n\tprivate readonly loadedDeferredIncomingOps: ISequencedDocumentMessage[] = [];\n\n\tprivate messagesSinceMSNChange: ISequencedDocumentMessage[] = [];\n\tprivate readonly intervalCollections: DefaultMap<IntervalCollection<SequenceInterval>>;\n\tconstructor(\n\t\tprivate readonly dataStoreRuntime: IFluidDataStoreRuntime,\n\t\tpublic id: string,\n\t\tattributes: IChannelAttributes,\n\t\tpublic readonly segmentFromSpec: (spec: IJSONSegment) => ISegment,\n\t) {\n\t\tsuper(id, dataStoreRuntime, attributes, \"fluid_sequence_\");\n\n\t\tthis.guardReentrancy =\n\t\t\tdataStoreRuntime.options.sharedStringPreventReentrancy ?? true\n\t\t\t\t? ensureNoReentrancy\n\t\t\t\t: createReentrancyDetector((depth) => {\n\t\t\t\t\t\tif (totalReentrancyLogs > 0) {\n\t\t\t\t\t\t\ttotalReentrancyLogs--;\n\t\t\t\t\t\t\tthis.logger.sendTelemetryEvent(\n\t\t\t\t\t\t\t\t{ eventName: \"LocalOpReentry\", depth },\n\t\t\t\t\t\t\t\tnew LoggingError(reentrancyErrorMessage),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t });\n\n\t\tthis.loadedDeferred.promise.catch((error) => {\n\t\t\tthis.logger.sendErrorEvent({ eventName: \"SequenceLoadFailed\" }, error);\n\t\t});\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tthis.client = new Client(\n\t\t\tsegmentFromSpec,\n\t\t\tcreateChildLogger({\n\t\t\t\tlogger: this.logger,\n\t\t\t\tnamespace: \"SharedSegmentSequence.MergeTreeClient\",\n\t\t\t}),\n\t\t\tdataStoreRuntime.options,\n\t\t);\n\n\t\tthis.client.prependListener(\"delta\", (opArgs, deltaArgs) => {\n\t\t\tconst event = new SequenceDeltaEvent(opArgs, deltaArgs, this.client);\n\t\t\tif (opArgs.stashed !== true && event.isLocal) {\n\t\t\t\tthis.submitSequenceMessage(opArgs.op);\n\t\t\t}\n\t\t\tthis.emit(\"sequenceDelta\", event, this);\n\t\t});\n\n\t\tthis.client.on(\"maintenance\", (args, opArgs) => {\n\t\t\tthis.emit(\"maintenance\", new SequenceMaintenanceEvent(opArgs, args, this.client), this);\n\t\t});\n\n\t\tthis.intervalCollections = new DefaultMap(\n\t\t\tthis.serializer,\n\t\t\tthis.handle,\n\t\t\t(op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata),\n\t\t\tnew SequenceIntervalCollectionValueType(),\n\t\t\tdataStoreRuntime.options,\n\t\t);\n\t}\n\n\t/**\n\t * @param start - The inclusive start of the range to remove\n\t * @param end - The exclusive end of the range to remove\n\t */\n\tpublic removeRange(start: number, end: number): void {\n\t\tthis.guardReentrancy(() => this.client.removeRangeLocal(start, end));\n\t}\n\n\t/**\n\t * Obliterate is similar to remove, but differs in that segments concurrently\n\t * inserted into an obliterated range will also be removed\n\t *\n\t * @param start - The inclusive start of the range to obliterate\n\t * @param end - The exclusive end of the range to obliterate\n\t */\n\tpublic obliterateRange(start: number, end: number): void {\n\t\tthis.guardReentrancy(() => this.client.obliterateRangeLocal(start, end));\n\t}\n\n\t/**\n\t * @deprecated The ability to create group ops will be removed in an upcoming\n\t * release, as group ops are redundant with the native batching capabilities\n\t * of the runtime\n\t */\n\tpublic groupOperation(groupOp: IMergeTreeGroupMsg) {\n\t\tthis.guardReentrancy(() => this.client.localTransaction(groupOp));\n\t}\n\n\t/**\n\t * Finds the segment information (i.e. segment + offset) corresponding to a character position in the SharedString.\n\t * If the position is past the end of the string, `segment` and `offset` on the returned object may be undefined.\n\t * @param pos - Character position (index) into the current local view of the SharedString.\n\t */\n\tpublic getContainingSegment(pos: number): {\n\t\tsegment: T | undefined;\n\t\toffset: number | undefined;\n\t} {\n\t\treturn this.client.getContainingSegment<T>(pos);\n\t}\n\n\t/**\n\t * Returns the length of the current sequence for the client\n\t */\n\tpublic getLength() {\n\t\treturn this.client.getLength();\n\t}\n\n\t/**\n\t * Returns the current position of a segment, and -1 if the segment\n\t * does not exist in this sequence\n\t * @param segment - The segment to get the position of\n\t */\n\tpublic getPosition(segment: ISegment): number {\n\t\treturn this.client.getPosition(segment);\n\t}\n\n\t/**\n\t * Annotates the range with the provided properties\n\t *\n\t * @param start - The inclusive start position of the range to annotate\n\t * @param end - The exclusive end position of the range to annotate\n\t * @param props - The properties to annotate the range with\n\t *\n\t */\n\tpublic annotateRange(start: number, end: number, props: PropertySet): void {\n\t\tthis.guardReentrancy(() => this.client.annotateRangeLocal(start, end, props));\n\t}\n\n\tpublic getPropertiesAtPosition(pos: number) {\n\t\treturn this.client.getPropertiesAtPosition(pos);\n\t}\n\n\tpublic getRangeExtentsOfPosition(pos: number) {\n\t\treturn this.client.getRangeExtentsOfPosition(pos);\n\t}\n\n\t/**\n\t * Creates a `LocalReferencePosition` on this SharedString. If the refType does not include\n\t * ReferenceType.Transient, the returned reference will be added to the localRefs on the provided segment.\n\t * @param segment - Segment to add the local reference on\n\t * @param offset - Offset on the segment at which to place the local reference\n\t * @param refType - ReferenceType for the created local reference\n\t * @param properties - PropertySet to place on the created local reference\n\t */\n\tpublic createLocalReferencePosition(\n\t\tsegment: T,\n\t\toffset: number,\n\t\trefType: ReferenceType,\n\t\tproperties: PropertySet | undefined,\n\t\tslidingPreference?: SlidingPreference,\n\t\tcanSlideToEndpoint?: boolean,\n\t): LocalReferencePosition {\n\t\treturn this.client.createLocalReferencePosition(\n\t\t\tsegment,\n\t\t\toffset,\n\t\t\trefType,\n\t\t\tproperties,\n\t\t\tslidingPreference,\n\t\t\tcanSlideToEndpoint,\n\t\t);\n\t}\n\n\t/**\n\t * Resolves a `ReferencePosition` into a character position using this client's perspective.\n\t */\n\tpublic localReferencePositionToPosition(lref: ReferencePosition): number {\n\t\treturn this.client.localReferencePositionToPosition(lref);\n\t}\n\n\t/**\n\t * Removes a `LocalReferencePosition` from this SharedString.\n\t */\n\tpublic removeLocalReferencePosition(lref: LocalReferencePosition) {\n\t\treturn this.client.removeLocalReferencePosition(lref);\n\t}\n\n\t/**\n\t * Resolves a remote client's position against the local sequence\n\t * and returns the remote client's position relative to the local\n\t * sequence. The client ref seq must be above the minimum sequence number\n\t * or the return value will be undefined.\n\t * Generally this method is used in conjunction with signals which provide\n\t * point in time values for the below parameters, and is useful for things\n\t * like displaying user position. It should not be used with persisted values\n\t * as persisted values will quickly become invalid as the remoteClientRefSeq\n\t * moves below the minimum sequence number\n\t * @param remoteClientPosition - The remote client's position to resolve\n\t * @param remoteClientRefSeq - The reference sequence number of the remote client\n\t * @param remoteClientId - The client id of the remote client\n\t */\n\tpublic resolveRemoteClientPosition(\n\t\tremoteClientPosition: number,\n\t\tremoteClientRefSeq: number,\n\t\tremoteClientId: string,\n\t): number | undefined {\n\t\treturn this.client.resolveRemoteClientPosition(\n\t\t\tremoteClientPosition,\n\t\t\tremoteClientRefSeq,\n\t\t\tremoteClientId,\n\t\t);\n\t}\n\n\tprivate submitSequenceMessage(message: IMergeTreeOp) {\n\t\tif (!this.isAttached()) {\n\t\t\treturn;\n\t\t}\n\t\tconst translated = makeHandlesSerializable(message, this.serializer, this.handle);\n\t\tconst metadata = this.client.peekPendingSegmentGroups(\n\t\t\tmessage.type === MergeTreeDeltaType.GROUP ? message.ops.length : 1,\n\t\t);\n\n\t\t// if loading isn't complete, we need to cache\n\t\t// local ops until loading is complete, and then\n\t\t// they will be present\n\t\tif (!this.loadedDeferred.isCompleted) {\n\t\t\tthis.loadedDeferredOutgoingOps.push(metadata ? [translated, metadata] : translated);\n\t\t} else {\n\t\t\tthis.submitLocalMessage(translated, metadata);\n\t\t}\n\t}\n\n\t/**\n\t * Given a position specified relative to a marker id, lookup the marker\n\t * and convert the position to a character position.\n\t * @param relativePos - Id of marker (may be indirect) and whether position is before or after marker.\n\t */\n\tpublic posFromRelativePos(relativePos: IRelativePosition) {\n\t\treturn this.client.posFromRelativePos(relativePos);\n\t}\n\n\t/**\n\t * Walk the underlying segments of the sequence.\n\t * The walked segments may extend beyond the range if the segments cross the\n\t * ranges start or end boundaries.\n\t *\n\t * Set split range to true to ensure only segments within the range are walked.\n\t *\n\t * @param handler - The function to handle each segment. Traversal ends if\n\t * this function returns true.\n\t * @param start - Optional. The start of range walk.\n\t * @param end - Optional. The end of range walk\n\t * @param accum - Optional. An object that will be passed to the handler for accumulation\n\t * @param splitRange - Optional. Splits boundary segments on the range boundaries\n\t */\n\tpublic walkSegments<TClientData>(\n\t\thandler: ISegmentAction<TClientData>,\n\t\tstart?: number,\n\t\tend?: number,\n\t\taccum?: TClientData,\n\t\tsplitRange: boolean = false,\n\t): void {\n\t\tthis.client.walkSegments(handler, start, end, accum as TClientData, splitRange);\n\t}\n\n\t/**\n\t * @returns The most recent sequence number which has been acked by the server and processed by this\n\t * SharedSegmentSequence.\n\t */\n\tpublic getCurrentSeq() {\n\t\treturn this.client.getCurrentSeq();\n\t}\n\n\t/**\n\t * Inserts a segment directly before a `ReferencePosition`.\n\t * @param refPos - The reference position to insert the segment at\n\t * @param segment - The segment to insert\n\t */\n\tpublic insertAtReferencePosition(pos: ReferencePosition, segment: T): void {\n\t\tthis.guardReentrancy(() => this.client.insertAtReferencePositionLocal(pos, segment));\n\t}\n\t/**\n\t * Inserts a segment\n\t * @param start - The position to insert the segment at\n\t * @param spec - The segment to inserts spec\n\t */\n\tpublic insertFromSpec(pos: number, spec: IJSONSegment): void {\n\t\tconst segment = this.segmentFromSpec(spec);\n\t\tthis.guardReentrancy(() => this.client.insertSegmentLocal(pos, segment));\n\t}\n\n\t/**\n\t * Retrieves the interval collection keyed on `label`. If no such interval collection exists,\n\t * creates one.\n\t */\n\tpublic getIntervalCollection(label: string): IIntervalCollection<SequenceInterval> {\n\t\treturn this.intervalCollections.get(label);\n\t}\n\n\t/**\n\t * @returns An iterable object that enumerates the IntervalCollection labels.\n\t *\n\t * @example\n\t *\n\t * ```typescript\n\t * const iter = this.getIntervalCollectionKeys();\n\t * for (key of iter)\n\t * const collection = this.getIntervalCollection(key);\n\t * ...\n\t * ```\n\t */\n\tpublic getIntervalCollectionLabels(): IterableIterator<string> {\n\t\treturn this.intervalCollections.keys();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\n\t\t// conditionally write the interval collection blob\n\t\t// only if it has entries\n\t\tif (this.intervalCollections.size > 0) {\n\t\t\tbuilder.addBlob(snapshotFileName, this.intervalCollections.serialize(serializer));\n\t\t}\n\n\t\tbuilder.addWithStats(contentPath, this.summarizeMergeTree(serializer));\n\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * Runs serializer over the GC data for this SharedMatrix.\n\t * All the IFluidHandle's represent routes to other objects.\n\t */\n\tprotected processGCDataCore(serializer: SummarySerializer) {\n\t\tif (this.intervalCollections.size > 0) {\n\t\t\tthis.intervalCollections.serialize(serializer);\n\t\t}\n\n\t\tthis.client.serializeGCData(this.handle, serializer);\n\t}\n\n\t/**\n\t * Replace the range specified from start to end with the provided segment\n\t * This is done by inserting the segment at the end of the range, followed\n\t * by removing the contents of the range\n\t * For a zero or reverse range (start \\>= end), insert at end do not remove anything\n\t * @param start - The start of the range to replace\n\t * @param end - The end of the range to replace\n\t * @param segment - The segment that will replace the range\n\t */\n\tprotected replaceRange(start: number, end: number, segment: ISegment): void {\n\t\t// Insert at the max end of the range when start > end, but still remove the range later\n\t\tconst insertIndex: number = Math.max(start, end);\n\n\t\t// Insert first, so local references can slide to the inserted seg if any\n\t\tconst insert = this.client.insertSegmentLocal(insertIndex, segment);\n\t\tif (insert) {\n\t\t\tif (start < end) {\n\t\t\t\tthis.client.removeRangeLocal(start, end);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onConnect}\n\t */\n\tprotected onConnect() {\n\t\t// Update merge tree collaboration information with new client ID and then resend pending ops\n\t\tthis.client.startOrUpdateCollaboration(this.runtime.clientId);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}\n\t */\n\tprotected reSubmitCore(content: any, localOpMetadata: unknown) {\n\t\tif (\n\t\t\t!this.intervalCollections.tryResubmitMessage(\n\t\t\t\tcontent,\n\t\t\t\tlocalOpMetadata as IMapMessageLocalMetadata,\n\t\t\t)\n\t\t) {\n\t\t\tthis.submitSequenceMessage(\n\t\t\t\tthis.client.regeneratePendingOp(\n\t\t\t\t\tcontent as IMergeTreeOp,\n\t\t\t\t\tlocalOpMetadata as SegmentGroup | SegmentGroup[],\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService) {\n\t\tif (await storage.contains(snapshotFileName)) {\n\t\t\tconst blob = await storage.readBlob(snapshotFileName);\n\t\t\tconst header = bufferToString(blob, \"utf8\");\n\t\t\tthis.intervalCollections.populate(header);\n\t\t}\n\n\t\ttry {\n\t\t\t// this will load the header, and return a promise\n\t\t\t// that will resolve when the body is loaded\n\t\t\t// and the catchup ops are available.\n\t\t\tconst { catchupOpsP } = await this.client.load(\n\t\t\t\tthis.runtime,\n\t\t\t\tnew ObjectStoragePartition(storage, contentPath),\n\t\t\t\tthis.serializer,\n\t\t\t);\n\n\t\t\t// setup a promise to process the\n\t\t\t// catch up ops, and finishing the loading process\n\t\t\tconst loadCatchUpOps = catchupOpsP\n\t\t\t\t.then((msgs) => {\n\t\t\t\t\tmsgs.forEach((m) => {\n\t\t\t\t\t\tconst collabWindow = this.client.getCollabWindow();\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tm.minimumSequenceNumber < collabWindow.minSeq ||\n\t\t\t\t\t\t\tm.referenceSequenceNumber < collabWindow.minSeq ||\n\t\t\t\t\t\t\tm.sequenceNumber <= collabWindow.minSeq ||\n\t\t\t\t\t\t\t// sequenceNumber could be the same if messages are part of a grouped batch\n\t\t\t\t\t\t\tm.sequenceNumber < collabWindow.currentSeq\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`Invalid catchup operations in snapshot: ${JSON.stringify({\n\t\t\t\t\t\t\t\t\top: {\n\t\t\t\t\t\t\t\t\t\tseq: m.sequenceNumber,\n\t\t\t\t\t\t\t\t\t\tminSeq: m.minimumSequenceNumber,\n\t\t\t\t\t\t\t\t\t\trefSeq: m.referenceSequenceNumber,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tcollabWindow: {\n\t\t\t\t\t\t\t\t\t\tseq: collabWindow.currentSeq,\n\t\t\t\t\t\t\t\t\t\tminSeq: collabWindow.minSeq,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.processMergeTreeMsg(m);\n\t\t\t\t\t});\n\t\t\t\t\tthis.loadFinished();\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tthis.loadFinished(error);\n\t\t\t\t});\n\t\t\tif (this.dataStoreRuntime.options?.sequenceInitializeFromHeaderOnly !== true) {\n\t\t\t\t// if we not doing partial load, await the catch up ops,\n\t\t\t\t// and the finalization of the load\n\t\t\t\tawait loadCatchUpOps;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.loadFinished(error);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t) {\n\t\t// if loading isn't complete, we need to cache all\n\t\t// incoming ops to be applied after loading is complete\n\t\tif (this.deferIncomingOps) {\n\t\t\tassert(!local, 0x072 /* \"Unexpected local op when loading not finished\" */);\n\t\t\tthis.loadedDeferredIncomingOps.push(message);\n\t\t} else {\n\t\t\tassert(\n\t\t\t\tmessage.type === MessageType.Operation,\n\t\t\t\t0x073 /* \"Sequence message not operation\" */,\n\t\t\t);\n\n\t\t\tconst handled = this.intervalCollections.tryProcessMessage(\n\t\t\t\tmessage.contents as IMapOperation,\n\t\t\t\tlocal,\n\t\t\t\tmessage,\n\t\t\t\tlocalOpMetadata,\n\t\t\t);\n\n\t\t\tif (!handled) {\n\t\t\t\tthis.processMergeTreeMsg(message, local);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.didAttach}\n\t */\n\tprotected didAttach() {\n\t\t// If we are not local, and we've attached we need to start generating and sending ops\n\t\t// so start collaboration and provide a default client id incase we are not connected\n\t\tif (this.isAttached()) {\n\t\t\tthis.client.startOrUpdateCollaboration(this.runtime.clientId ?? \"attached\");\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.initializeLocalCore}\n\t */\n\tprotected initializeLocalCore() {\n\t\tsuper.initializeLocalCore();\n\t\tthis.loadFinished();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n\t */\n\tprotected applyStashedOp(content: any): unknown {\n\t\treturn this.client.applyStashedOp(parseHandles(content, this.serializer));\n\t}\n\n\tprivate summarizeMergeTree(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\t// Are we fully loaded? If not, things will go south\n\t\tassert(\n\t\t\tthis.loadedDeferred.isCompleted,\n\t\t\t0x074 /* \"Snapshot called when not fully loaded\" */,\n\t\t);\n\t\tconst minSeq = this.runtime.deltaManager.minimumSequenceNumber;\n\n\t\tthis.processMinSequenceNumberChanged(minSeq);\n\n\t\tthis.messagesSinceMSNChange.forEach((m) => {\n\t\t\tm.minimumSequenceNumber = minSeq;\n\t\t});\n\n\t\treturn this.client.summarize(\n\t\t\tthis.runtime,\n\t\t\tthis.handle,\n\t\t\tserializer,\n\t\t\tthis.messagesSinceMSNChange,\n\t\t);\n\t}\n\n\tprivate processMergeTreeMsg(rawMessage: ISequencedDocumentMessage, local?: boolean) {\n\t\tconst message = parseHandles(rawMessage, this.serializer);\n\n\t\tconst ops: IMergeTreeDeltaOp[] = [];\n\t\tfunction transformOps(event: SequenceDeltaEvent) {\n\t\t\tops.push(...SharedSegmentSequence.createOpsFromDelta(event));\n\t\t}\n\t\tconst needsTransformation = message.referenceSequenceNumber !== message.sequenceNumber - 1;\n\t\tlet stashMessage: Readonly<ISequencedDocumentMessage> = message;\n\t\tif (this.runtime.options?.newMergeTreeSnapshotFormat !== true) {\n\t\t\tif (needsTransformation) {\n\t\t\t\tthis.on(\"sequenceDelta\", transformOps);\n\t\t\t}\n\t\t}\n\n\t\tthis.client.applyMsg(message, local);\n\n\t\tif (this.runtime.options?.newMergeTreeSnapshotFormat !== true) {\n\t\t\tif (needsTransformation) {\n\t\t\t\tthis.removeListener(\"sequenceDelta\", transformOps);\n\t\t\t\t// shallow clone the message as we only overwrite top level properties,\n\t\t\t\t// like referenceSequenceNumber and content only\n\t\t\t\tstashMessage = {\n\t\t\t\t\t...message,\n\t\t\t\t\treferenceSequenceNumber: stashMessage.sequenceNumber - 1,\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\tcontents: ops.length !== 1 ? createGroupOp(...ops) : ops[0],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tthis.messagesSinceMSNChange.push(stashMessage);\n\n\t\t\t// Do GC every once in a while...\n\t\t\tif (\n\t\t\t\tthis.messagesSinceMSNChange.length > 20 &&\n\t\t\t\tthis.messagesSinceMSNChange[20].sequenceNumber < message.minimumSequenceNumber\n\t\t\t) {\n\t\t\t\tthis.processMinSequenceNumberChanged(message.minimumSequenceNumber);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate processMinSequenceNumberChanged(minSeq: number) {\n\t\tlet index = 0;\n\t\tfor (; index < this.messagesSinceMSNChange.length; index++) {\n\t\t\tif (this.messagesSinceMSNChange[index].sequenceNumber > minSeq) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (index !== 0) {\n\t\t\tthis.messagesSinceMSNChange = this.messagesSinceMSNChange.slice(index);\n\t\t}\n\t}\n\n\tprivate loadFinished(error?: any) {\n\t\tif (!this.loadedDeferred.isCompleted) {\n\t\t\t// Initialize the interval collections\n\t\t\tthis.initializeIntervalCollections();\n\t\t\tif (error) {\n\t\t\t\tthis.loadedDeferred.reject(error);\n\t\t\t\tthrow error;\n\t\t\t} else {\n\t\t\t\t// it is important this series remains synchronous\n\t\t\t\t// first we stop deferring incoming ops, and apply then all\n\t\t\t\tthis.deferIncomingOps = false;\n\t\t\t\tfor (const message of this.loadedDeferredIncomingOps) {\n\t\t\t\t\tthis.processCore(message, false, undefined);\n\t\t\t\t}\n\t\t\t\tthis.loadedDeferredIncomingOps.length = 0;\n\n\t\t\t\t// then resolve the loaded promise\n\t\t\t\t// and resubmit all the outstanding ops, as the snapshot\n\t\t\t\t// is fully loaded, and all outstanding ops are applied\n\t\t\t\tthis.loadedDeferred.resolve();\n\n\t\t\t\tfor (const [messageContent, opMetadata] of this.loadedDeferredOutgoingOps) {\n\t\t\t\t\tthis.reSubmitCore(messageContent, opMetadata);\n\t\t\t\t}\n\t\t\t\tthis.loadedDeferredOutgoingOps.length = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate initializeIntervalCollections() {\n\t\t// Listen and initialize new SharedIntervalCollections\n\t\tthis.intervalCollections.eventEmitter.on(\n\t\t\t\"create\",\n\t\t\t({ key, previousValue }: IValueChanged, local: boolean) => {\n\t\t\t\tconst intervalCollection = this.intervalCollections.get(key);\n\t\t\t\tif (!intervalCollection.attached) {\n\t\t\t\t\tintervalCollection.attachGraph(this.client, key);\n\t\t\t\t}\n\t\t\t\tassert(\n\t\t\t\t\tpreviousValue === undefined,\n\t\t\t\t\t0x2c1 /* \"Creating an interval collection that already exists?\" */,\n\t\t\t\t);\n\t\t\t\tthis.emit(\"createIntervalCollection\", key, local, this);\n\t\t\t},\n\t\t);\n\n\t\t// Initialize existing SharedIntervalCollections\n\t\tfor (const key of this.intervalCollections.keys()) {\n\t\t\tconst intervalCollection = this.intervalCollections.get(key);\n\t\t\tintervalCollection.attachGraph(this.client, key);\n\t\t}\n\t}\n}\n\nfunction createReentrancyDetector(\n\tonReentrancy: (depth: number) => void,\n): <T>(callback: () => T) => T {\n\tlet depth = 0;\n\tfunction detectReentrancy<T>(callback: () => T): T {\n\t\tif (depth > 0) {\n\t\t\tonReentrancy(depth);\n\t\t}\n\t\tdepth++;\n\t\ttry {\n\t\t\treturn callback();\n\t\t} finally {\n\t\t\tdepth--;\n\t\t}\n\t}\n\n\treturn detectReentrancy;\n}\n\n/**\n * Apps which generate reentrant behavior may do so at a high frequency.\n * Logging even per-SharedSegmentSequence instance might be too noisy, and having a few logs from a session\n * is likely enough.\n */\nlet totalReentrancyLogs = 3;\n\n/**\n * Resets the reentrancy log counter. Test-only API.\n */\nexport function resetReentrancyLogCounter() {\n\ttotalReentrancyLogs = 3;\n}\n\nconst reentrancyErrorMessage = \"Reentrancy detected in sequence local ops\";\nconst ensureNoReentrancy = createReentrancyDetector(() => {\n\tthrow new LoggingError(reentrancyErrorMessage);\n});\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequenceDeltaEvent.d.ts","sourceRoot":"","sources":["../src/sequenceDeltaEvent.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAEN,MAAM,EACN,2BAA2B,EAC3B,qBAAqB,EACrB,iCAAiC,EACjC,QAAQ,EACR,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,WAAW,EAGX,MAAM,4BAA4B;AAEnC;;;;;;;GAOG;AACH,8BAAsB,aAAa,CAClC,UAAU,SAAS,4BAA4B,GAAG,4BAA4B;aAS7D,SAAS,EAAE,2BAA2B,CAAC,UAAU,CAAC;IAElE,OAAO,CAAC,QAAQ,CAAC,eAAe;IATjC,SAAgB,cAAc,EAAE,UAAU,CAAC;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA0D;IACvF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAC/D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwC;gBAG7C,SAAS,EAAE,2BAA2B,CAAC,UAAU,CAAC,EAEjD,eAAe,EAAE,MAAM;IAiCzC;;;OAGG;IACH,IAAW,MAAM,IAAI,SAAS,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,EAAE,CAExE;IAED;;OAEG;IACH,IAAW,QAAQ,IAAI,MAAM,GAAG,SAAS,CAExC;IAED;;OAEG;IACH,IAAW,KAAK,IAAI,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAE5D;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAE3D;CACD;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAmB,SAAQ,aAAa,CAAC,2BAA2B,CAAC;aAOhE,MAAM,EAAE,qBAAqB;IAN9C;;OAEG;IACH,SAAgB,OAAO,EAAE,OAAO,CAAC;gBAGhB,MAAM,EAAE,qBAAqB,EAC7C,SAAS,EAAE,2BAA2B,EAEtC,eAAe,EAAE,MAAM;CAKxB;AAED;;;;;;;GAOG;AACH,qBAAa,wBAAyB,SAAQ,aAAa,CAAC,wBAAwB,CAAC;aAEnE,MAAM,EAAE,qBAAqB,GAAG,SAAS;gBAAzC,MAAM,EAAE,qBAAqB,GAAG,SAAS,EACzD,SAAS,EAAE,iCAAiC,EAE5C,eAAe,EAAE,MAAM;CAIxB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB,CACnC,UAAU,SAAS,4BAA4B,GAAG,4BAA4B;IAE9E;;;;;OAKG;IACH,SAAS,EAAE,UAAU,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,QAAQ,CAAC;IAElB;;;;;;;;;;;;OAYG;IACH,cAAc,EAAE,WAAW,CAAC;CAC5B"}
@@ -1,12 +1,11 @@
1
- "use strict";
2
1
  /*!
3
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
3
  * Licensed under the MIT License.
5
4
  */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SequenceMaintenanceEvent = exports.SequenceDeltaEvent = exports.SequenceEvent = void 0;
8
- const core_utils_1 = require("@fluidframework/core-utils");
9
- const merge_tree_1 = require("@fluidframework/merge-tree");
5
+ import { assert } from "@fluidframework/core-utils";
6
+ import {
7
+ // eslint-disable-next-line import/no-deprecated
8
+ SortedSegmentSet, } from "@fluidframework/merge-tree";
10
9
  /**
11
10
  * Base class for SequenceDeltaEvent and SequenceMaintenanceEvent.
12
11
  *
@@ -15,18 +14,18 @@ const merge_tree_1 = require("@fluidframework/merge-tree");
15
14
  * They will not take into any future modifications performed to the underlying sequence and merge tree.
16
15
  * @alpha
17
16
  */
18
- class SequenceEvent {
17
+ export class SequenceEvent {
19
18
  constructor(deltaArgs,
20
19
  // eslint-disable-next-line import/no-deprecated
21
20
  mergeTreeClient) {
22
21
  this.deltaArgs = deltaArgs;
23
22
  this.mergeTreeClient = mergeTreeClient;
24
- (0, core_utils_1.assert)(deltaArgs.deltaSegments.length > 0, 0x2d8 /* "Empty change event should not be emitted." */);
23
+ assert(deltaArgs.deltaSegments.length > 0, 0x2d8 /* "Empty change event should not be emitted." */);
25
24
  this.deltaOperation = deltaArgs.operation;
26
25
  // eslint-disable-next-line import/no-deprecated
27
26
  this.sortedRanges = new Lazy(() => {
28
27
  // eslint-disable-next-line import/no-deprecated
29
- const set = new merge_tree_1.SortedSegmentSet();
28
+ const set = new SortedSegmentSet();
30
29
  this.deltaArgs.deltaSegments.forEach((delta) => {
31
30
  const newRange = {
32
31
  operation: this.deltaArgs.operation,
@@ -67,7 +66,6 @@ class SequenceEvent {
67
66
  return this.pLast.value;
68
67
  }
69
68
  }
70
- exports.SequenceEvent = SequenceEvent;
71
69
  /**
72
70
  * The event object returned on sequenceDelta events.
73
71
  *
@@ -80,7 +78,7 @@ exports.SequenceEvent = SequenceEvent;
80
78
  * Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.
81
79
  * @alpha
82
80
  */
83
- class SequenceDeltaEvent extends SequenceEvent {
81
+ export class SequenceDeltaEvent extends SequenceEvent {
84
82
  constructor(opArgs, deltaArgs,
85
83
  // eslint-disable-next-line import/no-deprecated
86
84
  mergeTreeClient) {
@@ -89,7 +87,6 @@ class SequenceDeltaEvent extends SequenceEvent {
89
87
  this.isLocal = opArgs.sequencedMessage === undefined;
90
88
  }
91
89
  }
92
- exports.SequenceDeltaEvent = SequenceDeltaEvent;
93
90
  /**
94
91
  * The event object returned on maintenance events.
95
92
  *
@@ -98,7 +95,7 @@ exports.SequenceDeltaEvent = SequenceDeltaEvent;
98
95
  * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.
99
96
  * @alpha
100
97
  */
101
- class SequenceMaintenanceEvent extends SequenceEvent {
98
+ export class SequenceMaintenanceEvent extends SequenceEvent {
102
99
  constructor(opArgs, deltaArgs,
103
100
  // eslint-disable-next-line import/no-deprecated
104
101
  mergeTreeClient) {
@@ -106,7 +103,6 @@ class SequenceMaintenanceEvent extends SequenceEvent {
106
103
  this.opArgs = opArgs;
107
104
  }
108
105
  }
109
- exports.SequenceMaintenanceEvent = SequenceMaintenanceEvent;
110
106
  class Lazy {
111
107
  constructor(valueGenerator) {
112
108
  this.valueGenerator = valueGenerator;
@@ -123,4 +119,4 @@ class Lazy {
123
119
  return this.pValue;
124
120
  }
125
121
  }
126
- //# sourceMappingURL=sequenceDeltaEvent.js.map
122
+ //# sourceMappingURL=sequenceDeltaEvent.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequenceDeltaEvent.mjs","sourceRoot":"","sources":["../src/sequenceDeltaEvent.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,MAAM,EAAE,MAAM,4BAA4B;OAC5C;AAWN,gDAAgD;AAChD,gBAAgB,GAChB,MAAM,4BAA4B;AAEnC;;;;;;;GAOG;AACH,MAAM,OAAgB,aAAa;IASlC,YACiB,SAAkD;IAClE,gDAAgD;IAC/B,eAAuB;QAFxB,cAAS,GAAT,SAAS,CAAyC;QAEjD,oBAAe,GAAf,eAAe,CAAQ;QAExC,MAAM,CACL,SAAS,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAClC,KAAK,CAAC,iDAAiD,CACvD,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC;QAE1C,gDAAgD;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAoD,GAAG,EAAE;YACpF,gDAAgD;YAChD,MAAM,GAAG,GAAG,IAAI,gBAAgB,EAAmC,CAAC;YACpE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,CA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IAChD,eAAuB;QAEvB,KAAK,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QALlB,WAAM,GAAN,MAAM,CAAuB;QAM7C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,gBAAgB,KAAK,SAAS,CAAC;IACtD,CAAC;CACD;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,wBAAyB,SAAQ,aAAuC;IACpF,YACiB,MAAyC,EACzD,SAA4C;IAC5C,gDAAgD;IAChD,eAAuB;QAEvB,KAAK,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QALlB,WAAM,GAAN,MAAM,CAAmC;IAM1D,CAAC;CACD;AA2CD,MAAM,IAAI;IAGT,YAA6B,cAAuB;QAAvB,mBAAc,GAAd,cAAc,CAAS;QACnD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,IAAW,KAAK;QACf,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACrB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;SACpC;QACD,OAAO,IAAI,CAAC,MAAW,CAAC;IACzB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tClient,\n\tIMergeTreeDeltaCallbackArgs,\n\tIMergeTreeDeltaOpArgs,\n\tIMergeTreeMaintenanceCallbackArgs,\n\tISegment,\n\tMergeTreeDeltaOperationType,\n\tMergeTreeDeltaOperationTypes,\n\tMergeTreeMaintenanceType,\n\tPropertySet,\n\t// eslint-disable-next-line import/no-deprecated\n\tSortedSegmentSet,\n} from \"@fluidframework/merge-tree\";\n\n/**\n * Base class for SequenceDeltaEvent and SequenceMaintenanceEvent.\n *\n * The properties of this object and its sub-objects represent the state of the sequence at the\n * point in time at which the operation was applied.\n * They will not take into any future modifications performed to the underlying sequence and merge tree.\n * @alpha\n */\nexport abstract class SequenceEvent<\n\tTOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes,\n> {\n\tpublic readonly deltaOperation: TOperation;\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly sortedRanges: Lazy<SortedSegmentSet<ISequenceDeltaRange<TOperation>>>;\n\tprivate readonly pFirst: Lazy<ISequenceDeltaRange<TOperation>>;\n\tprivate readonly pLast: Lazy<ISequenceDeltaRange<TOperation>>;\n\n\tconstructor(\n\t\tpublic readonly deltaArgs: IMergeTreeDeltaCallbackArgs<TOperation>,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tprivate readonly mergeTreeClient: Client,\n\t) {\n\t\tassert(\n\t\t\tdeltaArgs.deltaSegments.length > 0,\n\t\t\t0x2d8 /* \"Empty change event should not be emitted.\" */,\n\t\t);\n\t\tthis.deltaOperation = deltaArgs.operation;\n\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tthis.sortedRanges = new Lazy<SortedSegmentSet<ISequenceDeltaRange<TOperation>>>(() => {\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tconst set = new SortedSegmentSet<ISequenceDeltaRange<TOperation>>();\n\t\t\tthis.deltaArgs.deltaSegments.forEach((delta) => {\n\t\t\t\tconst newRange: ISequenceDeltaRange<TOperation> = {\n\t\t\t\t\toperation: this.deltaArgs.operation,\n\t\t\t\t\tposition: this.mergeTreeClient.getPosition(delta.segment),\n\t\t\t\t\tpropertyDeltas: delta.propertyDeltas ?? {},\n\t\t\t\t\tsegment: delta.segment,\n\t\t\t\t};\n\t\t\t\tset.addOrUpdate(newRange);\n\t\t\t});\n\t\t\treturn set;\n\t\t});\n\n\t\tthis.pFirst = new Lazy<ISequenceDeltaRange<TOperation>>(\n\t\t\t() => this.sortedRanges.value.items[0],\n\t\t);\n\n\t\tthis.pLast = new Lazy<ISequenceDeltaRange<TOperation>>(\n\t\t\t() => this.sortedRanges.value.items[this.sortedRanges.value.size - 1],\n\t\t);\n\t}\n\n\t/**\n\t * The in-order ranges affected by this delta.\n\t * These may not be continuous.\n\t */\n\tpublic get ranges(): readonly Readonly<ISequenceDeltaRange<TOperation>>[] {\n\t\treturn this.sortedRanges.value.items;\n\t}\n\n\t/**\n\t * The client id of the client that made the change which caused the delta event\n\t */\n\tpublic get clientId(): string | undefined {\n\t\treturn this.mergeTreeClient.longClientId;\n\t}\n\n\t/**\n\t * The first of the modified ranges.\n\t */\n\tpublic get first(): Readonly<ISequenceDeltaRange<TOperation>> {\n\t\treturn this.pFirst.value;\n\t}\n\n\t/**\n\t * The last of the modified ranges.\n\t */\n\tpublic get last(): Readonly<ISequenceDeltaRange<TOperation>> {\n\t\treturn this.pLast.value;\n\t}\n}\n\n/**\n * The event object returned on sequenceDelta events.\n *\n * The properties of this object and its sub-objects represent the state of the sequence at the\n * point in time at which the operation was applied.\n * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.\n *\n * For group ops, each op will get its own event, and the group op property will be set on the op args.\n *\n * Ops may get multiple events. For instance, an insert-replace will get a remove then an insert event.\n * @alpha\n */\nexport class SequenceDeltaEvent extends SequenceEvent<MergeTreeDeltaOperationType> {\n\t/**\n\t * Whether the event was caused by a locally-made change.\n\t */\n\tpublic readonly isLocal: boolean;\n\n\tconstructor(\n\t\tpublic readonly opArgs: IMergeTreeDeltaOpArgs,\n\t\tdeltaArgs: IMergeTreeDeltaCallbackArgs,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tmergeTreeClient: Client,\n\t) {\n\t\tsuper(deltaArgs, mergeTreeClient);\n\t\tthis.isLocal = opArgs.sequencedMessage === undefined;\n\t}\n}\n\n/**\n * The event object returned on maintenance events.\n *\n * The properties of this object and its sub-objects represent the state of the sequence at the\n * point in time at which the operation was applied.\n * They will not take into consideration any future modifications performed to the underlying sequence and merge tree.\n * @alpha\n */\nexport class SequenceMaintenanceEvent extends SequenceEvent<MergeTreeMaintenanceType> {\n\tconstructor(\n\t\tpublic readonly opArgs: IMergeTreeDeltaOpArgs | undefined,\n\t\tdeltaArgs: IMergeTreeMaintenanceCallbackArgs,\n\t\t// eslint-disable-next-line import/no-deprecated\n\t\tmergeTreeClient: Client,\n\t) {\n\t\tsuper(deltaArgs, mergeTreeClient);\n\t}\n}\n\n/**\n * A range that has changed corresponding to a segment modification.\n * @alpha\n */\nexport interface ISequenceDeltaRange<\n\tTOperation extends MergeTreeDeltaOperationTypes = MergeTreeDeltaOperationTypes,\n> {\n\t/**\n\t * The type of operation that changed this range.\n\t *\n\t * @remarks Consuming code should typically compare this to the enum values defined in\n\t * `MergeTreeDeltaOperationTypes`.\n\t */\n\toperation: TOperation;\n\n\t/**\n\t * The index of the start of the range.\n\t */\n\tposition: number;\n\n\t/**\n\t * The segment that corresponds to the range.\n\t */\n\tsegment: ISegment;\n\n\t/**\n\t * Deltas object which contains all modified properties with their previous values.\n\t * Since `undefined` doesn't survive a round-trip through JSON serialization, the old value being absent\n\t * is instead encoded with `null`.\n\t *\n\t * @remarks This object is motivated by undo/redo scenarios, and provides a convenient \"inverse op\" to apply to\n\t * undo a property change.\n\t *\n\t * @example\n\t *\n\t * If a segment initially had properties `{ foo: \"1\", bar: 2 }` and it was annotated with\n\t * `{ foo: 3, baz: 5 }`, the corresponding event would have a `propertyDeltas` of `{ foo: \"1\", baz: null }`.\n\t */\n\tpropertyDeltas: PropertySet;\n}\n\nclass Lazy<T> {\n\tprivate pValue: T | undefined;\n\tprivate pEvaluated: boolean;\n\tconstructor(private readonly valueGenerator: () => T) {\n\t\tthis.pEvaluated = false;\n\t}\n\n\tpublic get evaluated(): boolean {\n\t\treturn this.pEvaluated;\n\t}\n\n\tpublic get value(): T {\n\t\tif (!this.pEvaluated) {\n\t\t\tthis.pEvaluated = true;\n\t\t\tthis.pValue = this.valueGenerator();\n\t\t}\n\t\treturn this.pValue as T;\n\t}\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelFactory } from "@fluidframework/datastore-definitions";
6
- import { SharedString, SharedStringSegment } from "./sharedString";
6
+ import { SharedString, SharedStringSegment } from "./sharedString.mjs";
7
7
  /**
8
8
  * @alpha
9
9
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequenceFactory.d.ts","sourceRoot":"","sources":["../src/sequenceFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC;OAGvC,EAAE,YAAY,EAAE,mBAAmB,EAAE;AAE5C;;GAEG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IAG1D,OAAc,IAAI,SAAiD;IAEnE,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;WAEY,eAAe,CAAC,IAAI,EAAE,GAAG,GAAG,mBAAmB;IAc7D,IAAW,IAAI,WAEd;IAED,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,YAAY,CAAC;IAMjB,MAAM,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY;CAKzE"}
@@ -1,23 +1,20 @@
1
- "use strict";
2
1
  /*!
3
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
3
  * Licensed under the MIT License.
5
4
  */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.SharedStringFactory = void 0;
8
- const merge_tree_1 = require("@fluidframework/merge-tree");
9
- const packageVersion_1 = require("./packageVersion");
10
- const sharedString_1 = require("./sharedString");
5
+ import { Marker, TextSegment } from "@fluidframework/merge-tree";
6
+ import { pkgVersion } from "./packageVersion.mjs";
7
+ import { SharedString } from "./sharedString.mjs";
11
8
  /**
12
9
  * @alpha
13
10
  */
14
- class SharedStringFactory {
11
+ export class SharedStringFactory {
15
12
  static segmentFromSpec(spec) {
16
- const maybeText = merge_tree_1.TextSegment.fromJSONObject(spec);
13
+ const maybeText = TextSegment.fromJSONObject(spec);
17
14
  if (maybeText) {
18
15
  return maybeText;
19
16
  }
20
- const maybeMarker = merge_tree_1.Marker.fromJSONObject(spec);
17
+ const maybeMarker = Marker.fromJSONObject(spec);
21
18
  if (maybeMarker) {
22
19
  return maybeMarker;
23
20
  }
@@ -33,23 +30,22 @@ class SharedStringFactory {
33
30
  * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
34
31
  */
35
32
  async load(runtime, id, services, attributes) {
36
- const sharedString = new sharedString_1.SharedString(runtime, id, attributes);
33
+ const sharedString = new SharedString(runtime, id, attributes);
37
34
  await sharedString.load(services);
38
35
  return sharedString;
39
36
  }
40
37
  create(document, id) {
41
- const sharedString = new sharedString_1.SharedString(document, id, this.attributes);
38
+ const sharedString = new SharedString(document, id, this.attributes);
42
39
  sharedString.initializeLocal();
43
40
  return sharedString;
44
41
  }
45
42
  }
46
- exports.SharedStringFactory = SharedStringFactory;
47
43
  // TODO rename back to https://graph.microsoft.com/types/mergeTree/string once paparazzi is able to dynamically
48
44
  // load code (UPDATE: paparazzi is gone... anything to do here?)
49
45
  SharedStringFactory.Type = "https://graph.microsoft.com/types/mergeTree";
50
46
  SharedStringFactory.Attributes = {
51
47
  type: SharedStringFactory.Type,
52
48
  snapshotFormatVersion: "0.1",
53
- packageVersion: packageVersion_1.pkgVersion,
49
+ packageVersion: pkgVersion,
54
50
  };
55
- //# sourceMappingURL=sequenceFactory.js.map
51
+ //# sourceMappingURL=sequenceFactory.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequenceFactory.mjs","sourceRoot":"","sources":["../src/sequenceFactory.ts"],"names":[],"mappings":"AA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AAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { Marker, TextSegment } from \"@fluidframework/merge-tree\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedString, SharedStringSegment } from \"./sharedString\";\n\n/**\n * @alpha\n */\nexport class SharedStringFactory implements IChannelFactory {\n\t// TODO rename back to https://graph.microsoft.com/types/mergeTree/string once paparazzi is able to dynamically\n\t// load code (UPDATE: paparazzi is gone... anything to do here?)\n\tpublic static Type = \"https://graph.microsoft.com/types/mergeTree\";\n\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedStringFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\tpublic static segmentFromSpec(spec: any): SharedStringSegment {\n\t\tconst maybeText = TextSegment.fromJSONObject(spec);\n\t\tif (maybeText) {\n\t\t\treturn maybeText;\n\t\t}\n\n\t\tconst maybeMarker = Marker.fromJSONObject(spec);\n\t\tif (maybeMarker) {\n\t\t\treturn maybeMarker;\n\t\t}\n\n\t\tthrow new Error(`Unrecognized IJSONObject`);\n\t}\n\n\tpublic get type() {\n\t\treturn SharedStringFactory.Type;\n\t}\n\n\tpublic get attributes() {\n\t\treturn SharedStringFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<SharedString> {\n\t\tconst sharedString = new SharedString(runtime, id, attributes);\n\t\tawait sharedString.load(services);\n\t\treturn sharedString;\n\t}\n\n\tpublic create(document: IFluidDataStoreRuntime, id: string): SharedString {\n\t\tconst sharedString = new SharedString(document, id, this.attributes);\n\t\tsharedString.initializeLocal();\n\t\treturn sharedString;\n\t}\n}\n"]}
@@ -6,8 +6,8 @@ import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, ICh
6
6
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
7
7
  import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
8
8
  import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
9
- import { Interval, ISerializableInterval } from "./intervals";
10
- import { IIntervalCollection } from "./intervalCollection";
9
+ import { Interval, ISerializableInterval } from "./intervals/index.mjs";
10
+ import { IIntervalCollection } from "./intervalCollection.mjs";
11
11
  /**
12
12
  * The factory that defines the SharedIntervalCollection.
13
13
  * @deprecated `SharedIntervalCollection` is not maintained and is planned to be removed.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedIntervalCollection.d.ts","sourceRoot":"","sources":["../src/sharedIntervalCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,yBAAyB,EAAe,MAAM,sCAAsC;OACtF,EAAE,qBAAqB,EAAE,MAAM,qCAAqC;OACpE,EAEN,gBAAgB,EAChB,YAAY,EACZ,MAAM,oCAAoC;OACpC,EAAE,QAAQ,EAAE,qBAAqB,EAAE;OACnC,EAEN,mBAAmB,EAEnB;AAOD;;;;GAIG;AACH,qBAAa,+BAAgC,YAAW,eAAe;IACtE,gBAAuB,IAAI,gEAAgE;IAE3F,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF,IAAW,IAAI,WAEd;IAED,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,E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