@sovereignbase/convergent-replicated-list 0.0.0 → 1.0.1

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/LICENSE CHANGED
@@ -1,201 +1,201 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/dist/index.cjs CHANGED
@@ -15,9 +15,6 @@
15
15
  */
16
16
 
17
17
 
18
- // src/core/crud/create/index.ts
19
- var _utils = require('@sovereignbase/utils');
20
-
21
18
  // src/.helpers/assertListIndices/index.ts
22
19
  function assertListIndices(crListReplica) {
23
20
  if (!crListReplica.cursor) return;
@@ -138,7 +135,7 @@ function flattenAndLinkTrustedState(crListReplica) {
138
135
  }
139
136
 
140
137
  // src/.helpers/snapshotValueToLinkedListValue/index.ts
141
-
138
+ var _utils = require('@sovereignbase/utils');
142
139
  function snapshotValueToLinkedListValue(valueEntry, crListReplica) {
143
140
  if (!_utils.isUuidV7.call(void 0, valueEntry.uuidv7) || crListReplica.tombstones.has(valueEntry.uuidv7) || crListReplica.parentMap.has(valueEntry.uuidv7) || !_utils.isUuidV7.call(void 0, valueEntry.predecessor) && valueEntry.predecessor !== "\0" && !crListReplica.tombstones.has(valueEntry.predecessor))
144
141
  return void 0;
@@ -218,6 +215,7 @@ function indexFromPropertyKey(index) {
218
215
  }
219
216
 
220
217
  // src/core/crud/create/index.ts
218
+
221
219
  function __create(snapshot) {
222
220
  const crListReplica = {
223
221
  size: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["c:\\Users\\jorts\\convergent-replicated-list\\dist\\index.cjs"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAAuE;AACvE;AACA;AACA,SAAS,iBAAiB,CAAC,aAAa,EAAE;AAC1C,EAAE,GAAG,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;AACnC,EAAE,IAAI,MAAM,EAAE,aAAa,CAAC,IAAI;AAChC,EAAE,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI;AAClC,IAAI,aAAa,CAAC,OAAO,EAAE,aAAa,C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AAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,kBAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,UAAA;AACA,YAAA;AACA,YAAA;AACA,YAAA;AACA,YAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,YAAA;AACA,cAAA;AACA,cAAA;AACA,cAAA;AACA,cAAA;AACA,YAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,wBAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,QAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,YAAA;AACA,cAAA;AACA,cAAA;AACA,cAAA;AACA,cAAA;AACA,YAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,YAAA;AACA,YAAA;AACA,YAAA;AACA,YAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,YAAA;AACA,cAAA;AACA,YAAA;AACA,UAAA;AACA,YAAA;AACA,cAAA;AACA,YAAA;AACA,UAAA;AACA,QAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACA,YAAA;AACA,cAAA;AACA,YAAA;AACA,UAAA;AACA,UAAA;AACA,YAAA;AACA,cAAA;AACA,YAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;AACA,MAAA;AACA,MAAA;AACA,QAAA;AACA,QAAA;AACA,UAAA;AACA,YAAA;AACA,YAAA;AACA,YAAA;AACA,YAAA;AACA,UAAA;AACA,QAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,uBAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,IAAA;AACA,MAAA;AACA,QAAA;AACA,MAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA;AACA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"C:\\Users\\jorts\\convergent-replicated-list\\dist\\index.cjs","sourcesContent":[null]}
1
+ {"version":3,"sources":["/home/runner/work/convergent-replicated-list/convergent-replicated-list/dist/index.cjs","../src/.helpers/assertListIndices/index.ts","../src/.errors/class.ts","../src/.helpers/walkToIndex/index.ts","../src/.helpers/insertBetween/index.ts","../src/.helpers/flattenAndLinkTrustedState/index.ts","../src/.helpers/snapshotValueToLinkedListValue/index.ts","../src/.helpers/updateEntryToMaps/index.ts","../src/.helpers/deleteEntryFromMaps/index.ts","../src/.helpers/deleteLinkedEntry/index.ts","../src/.helpers/moveEntryToPredecessor/index.ts","../src/.helpers/indexFromPropertyKey/index.ts","../src/core/crud/create/index.ts","../src/core/crud/read/index.ts","../src/core/crud/update/index.ts","../src/core/crud/delete/index.ts","../src/core/mags/merge/index.ts","../src/core/mags/acknowledge/index.ts","../src/core/mags/garbageCollect/index.ts","../src/core/mags/snapshot/index.ts","../src/CRList/class.ts"],"names":["isUuidV7"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACfO,SAAS,iBAAA,CAAqB,aAAA,EAAqC;AACxE,EAAA,GAAA,CAAI,CAAC,aAAA,CAAc,MAAA,EAAQ,MAAA;AAC3B,EAAA,IAAI,MAAA,EAAQ,aAAA,CAAc,IAAA;AAC1B,EAAA,MAAA,CAAO,aAAA,CAAc,MAAA,CAAO,IAAA;AAC1B,IAAA,aAAA,CAAc,OAAA,EAAS,aAAA,CAAc,MAAA,CAAO,IAAA;AAE9C,EAAA,MAAA,CAAO,MAAA,GAAS,CAAA,EAAG;AACjB,IAAA,KAAA,EAAA;AACA,IAAA,aAAA,CAAc,MAAA,CAAO,MAAA,EAAQ,KAAA;AAC7B,IAAA,GAAA,CAAI,aAAA,CAAc,MAAA,CAAO,KAAA,IAAS,KAAA,CAAA,EAAW,KAAA;AAC7C,IAAA,aAAA,CAAc,OAAA,EAAS,aAAA,CAAc,MAAA,CAAO,IAAA;AAAA,EAC9C;AACF;ADgBA;AACA;AElBO,IAAM,YAAA,EAAN,MAAA,QAA0B,MAAM;AAAA;AAAA;AAAA;AAAA,EAI5B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQT,WAAA,CAAY,IAAA,EAAuB,OAAA,EAAkB;AACnD,IAAA,MAAM,OAAA,mBAAS,OAAA,UAAW,MAAA;AAC1B,IAAA,KAAA,CAAM,CAAA,4CAAA,EAA+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ggBgE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/convergent-replicated-list/convergent-replicated-list/dist/index.cjs","sourcesContent":[null,"import type { CRListState } from '../../.types/index.js'\n\nexport function assertListIndices<T>(crListReplica: CRListState<T>): void {\n if (!crListReplica.cursor) return\n let index = crListReplica.size\n while (crListReplica.cursor.next)\n crListReplica.cursor = crListReplica.cursor.next\n\n while (index >= 1) {\n index--\n crListReplica.cursor.index = index\n if (crListReplica.cursor.prev === undefined) break\n crListReplica.cursor = crListReplica.cursor.prev\n }\n}\n","/**\n * Error codes thrown by {@link CRList}.\n */\nexport type CRListErrorCode =\n | 'VALUE_NOT_CLONEABLE'\n | 'INDEX_OUT_OF_BOUNDS'\n | 'LIST_EMPTY'\n | 'LIST_INTEGRITY_VIOLATION'\n | 'UPDATE_EXPECTED_AN_ARRAY'\n\n/**\n * Represents a typed CRList runtime error.\n */\nexport class CRListError extends Error {\n /**\n * The semantic error code for the failure.\n */\n readonly code: CRListErrorCode\n\n /**\n * Creates a typed CRList error.\n *\n * @param code - The semantic error code.\n * @param message - An optional human-readable detail message.\n */\n constructor(code: CRListErrorCode, message?: string) {\n const detail = message ?? code\n super(`{@sovereignbase/convergent-replicated-list} ${detail}`)\n this.code = code\n this.name = 'CRListError'\n }\n}\n","import type { CRListState } from '../../.types/index.js'\nimport { CRListError } from '../../.errors/class.js'\n\nexport function walkToIndex<T>(\n targetIndex: number,\n crListReplica: CRListState<T>\n): void {\n if (targetIndex < 0 || targetIndex >= crListReplica.size)\n throw new CRListError('INDEX_OUT_OF_BOUNDS', 'Index out of bounds')\n if (!crListReplica.cursor)\n throw new CRListError('LIST_EMPTY', 'List is empty')\n const direction = crListReplica.cursor.index > targetIndex ? 'prev' : 'next'\n while (crListReplica.cursor && crListReplica.cursor.index !== targetIndex) {\n crListReplica.cursor = crListReplica.cursor[direction]\n }\n}\n","import type { CRListStateEntry } from '../../.types/index.js'\n\nexport function insertBetween<T>(\n prev: CRListStateEntry<T>,\n linkedListEntry: NonNullable<CRListStateEntry<T>>,\n next: CRListStateEntry<T>\n): void {\n linkedListEntry.prev = prev\n linkedListEntry.next = next\n if (prev) prev.next = linkedListEntry\n if (next) next.prev = linkedListEntry\n}\n","import type { CRListState, CRListStateEntry } from '../../.types/index.js'\nimport { insertBetween } from '../insertBetween/index.js'\nexport function flattenAndLinkTrustedState<T>(crListReplica: CRListState<T>) {\n crListReplica.cursor = undefined\n const resolvedSiblingPredecessors = new Set<string>()\n for (const entry of crListReplica.parentMap.values()) {\n if (!entry) continue\n entry.prev = undefined\n entry.next = undefined\n }\n const keys = [...crListReplica.childrenMap.keys()].sort((a, b) =>\n a > b ? 1 : -1\n )\n let hasProgress = true\n while (hasProgress) {\n hasProgress = false\n for (const predecessorIdentifier of keys) {\n if (resolvedSiblingPredecessors.has(predecessorIdentifier)) continue\n const siblings = crListReplica.childrenMap.get(predecessorIdentifier)\n if (!siblings) continue\n\n if (siblings.length > 1)\n siblings.sort((a, b) => (a.uuidv7 > b.uuidv7 ? 1 : -1))\n\n const predecessor =\n predecessorIdentifier === '\\0'\n ? undefined\n : crListReplica.parentMap.get(predecessorIdentifier)\n if (\n predecessor &&\n !predecessor.prev &&\n !predecessor.next &&\n crListReplica.cursor !== predecessor\n )\n continue\n let prev: CRListStateEntry<T> = predecessor ?? crListReplica.cursor\n const predecessorNext = predecessor?.next\n if (siblings.length === 1) {\n const sibling = siblings[0]\n insertBetween<T>(prev, sibling, sibling.next)\n prev = sibling\n if (predecessorNext && predecessorNext !== sibling) {\n prev.next = predecessorNext\n predecessorNext.prev = prev\n } else {\n prev.next = undefined\n }\n if (!predecessorNext) crListReplica.cursor = prev\n resolvedSiblingPredecessors.add(predecessorIdentifier)\n hasProgress = true\n continue\n }\n const siblingSet = new Set(siblings)\n for (let index = 0; index < siblings.length; index++) {\n const sibling = siblings[index]\n const next = siblings[index + 1]\n\n insertBetween<T>(prev, sibling, sibling.next)\n prev = sibling\n\n if (next) {\n prev.next = next\n next.prev = prev\n } else if (predecessorNext && !siblingSet.has(predecessorNext)) {\n prev.next = predecessorNext\n predecessorNext.prev = prev\n } else {\n prev.next = undefined\n }\n }\n if (!predecessorNext) crListReplica.cursor = prev\n resolvedSiblingPredecessors.add(predecessorIdentifier)\n hasProgress = true\n }\n }\n crListReplica.size = crListReplica.parentMap.size\n}\n","import type {\n CRListState,\n CRListSnapshotEntry,\n CRListStateEntry,\n} from '../../.types/index.js'\nimport { isUuidV7, safeStructuredClone } from '@sovereignbase/utils'\nexport function snapshotValueToLinkedListValue<T>(\n valueEntry: CRListSnapshotEntry<T>,\n crListReplica: CRListState<T>\n): CRListStateEntry<T> {\n if (\n !isUuidV7(valueEntry.uuidv7) ||\n crListReplica.tombstones.has(valueEntry.uuidv7) ||\n crListReplica.parentMap.has(valueEntry.uuidv7) ||\n (!isUuidV7(valueEntry.predecessor) &&\n valueEntry.predecessor !== '\\0' &&\n !crListReplica.tombstones.has(valueEntry.predecessor))\n )\n return undefined\n\n const [cloned, copiedValue] = safeStructuredClone(valueEntry.value)\n\n if (!cloned) return undefined\n return {\n uuidv7: valueEntry.uuidv7,\n value: copiedValue,\n predecessor: valueEntry.predecessor,\n index: 0,\n next: undefined,\n prev: undefined,\n }\n}\n","import type {\n CRListState,\n CRListStateEntry,\n CRListDelta,\n} from '../../.types/index.js'\nexport function updateEntryToMaps<T>(\n crListReplica: CRListState<T>,\n linkedListEntry: NonNullable<CRListStateEntry<T>>,\n deltaBuf?: CRListDelta<T>\n): void {\n crListReplica.parentMap.set(linkedListEntry.uuidv7, linkedListEntry)\n const siblings = crListReplica.childrenMap.get(linkedListEntry.predecessor)\n if (siblings) {\n siblings.push(linkedListEntry)\n } else {\n crListReplica.childrenMap.set(linkedListEntry.predecessor, [\n linkedListEntry,\n ])\n }\n if (deltaBuf && !Array.isArray(deltaBuf.values)) deltaBuf.values = []\n if (deltaBuf?.values)\n deltaBuf.values.push({\n uuidv7: linkedListEntry.uuidv7,\n value: linkedListEntry.value,\n predecessor: linkedListEntry.predecessor,\n })\n}\n","import type { CRListState, CRListStateEntry } from '../../.types/index.js'\nexport function deleteEntryFromMaps<T>(\n crListReplica: CRListState<T>,\n linkedListEntry: NonNullable<CRListStateEntry<T>>\n): void {\n crListReplica.parentMap.delete(linkedListEntry.uuidv7)\n const siblings = crListReplica.childrenMap.get(linkedListEntry.predecessor)\n if (!siblings) return\n const index = siblings.indexOf(linkedListEntry)\n if (index !== -1) siblings.splice(index, 1)\n}\n","import type {\n CRListDelta,\n CRListState,\n CRListStateEntry,\n} from '../../.types/index.js'\nimport { deleteEntryFromMaps } from '../deleteEntryFromMaps/index.js'\n\nexport function deleteLinkedEntry<T>(\n crListReplica: CRListState<T>,\n linkedListEntry: NonNullable<CRListStateEntry<T>>,\n deltaBuf?: CRListDelta<T>\n): void {\n const prev = linkedListEntry.prev\n const next = linkedListEntry.next\n crListReplica.tombstones.add(linkedListEntry.uuidv7)\n if (deltaBuf && !Array.isArray(deltaBuf.tombstones)) deltaBuf.tombstones = []\n deltaBuf?.tombstones?.push(linkedListEntry.uuidv7)\n if (prev) prev.next = next\n if (next) {\n next.prev = prev\n }\n void deleteEntryFromMaps<T>(crListReplica, linkedListEntry)\n if (crListReplica.cursor === linkedListEntry)\n crListReplica.cursor = next ?? prev\n linkedListEntry.prev = undefined\n linkedListEntry.next = undefined\n crListReplica.size = crListReplica.parentMap.size\n}\n","import type {\n CRListDelta,\n CRListState,\n CRListStateEntry,\n} from '../../.types/index.js'\nimport { deleteEntryFromMaps } from '../deleteEntryFromMaps/index.js'\nimport { updateEntryToMaps } from '../updateEntryToMaps/index.js'\n\nexport function moveEntryToPredecessor<T>(\n crListReplica: CRListState<T>,\n linkedListEntry: NonNullable<CRListStateEntry<T>>,\n predecessor: string,\n deltaBuf?: CRListDelta<T>\n): void {\n void deleteEntryFromMaps<T>(crListReplica, linkedListEntry)\n linkedListEntry.predecessor = predecessor\n void updateEntryToMaps<T>(crListReplica, linkedListEntry, deltaBuf)\n}\n","export function indexFromPropertyKey(\n index: string | symbol\n): number | undefined {\n if (typeof index !== 'string' || !/^(0|[1-9]\\d*)$/.test(index))\n return undefined\n const listIndex = Number(index)\n return Number.isSafeInteger(listIndex) ? listIndex : undefined\n}\n","import { isUuidV7, prototype } from '@sovereignbase/utils'\nimport {\n CRListSnapshot,\n CRListState,\n CRListStateEntry,\n} from '../../../.types/index.js'\nimport {\n flattenAndLinkTrustedState,\n assertListIndices,\n snapshotValueToLinkedListValue,\n updateEntryToMaps,\n} from '../../../.helpers/index.js'\n\n/**\n * Creates a local CRList replica from an optional snapshot.\n *\n * Invalid snapshot records are ignored. Accepted values are cloned, indexed by\n * UUIDv7, linked through their predecessor buckets, and exposed as a live\n * doubly-linked list.\n *\n * @param snapshot Optional serializable CRList state.\n * @returns A hydrated CRList replica.\n *\n * Time complexity: O(n log n + t + c), worst case O(n^2 + t + c)\n * - n = snapshot value entry count\n * - t = snapshot tombstone count\n * - c = cloned value payload\n *\n * Space complexity: O(n + t + c)\n */\nexport function __create<T>(snapshot?: CRListSnapshot<T>): CRListState<T> {\n const crListReplica: CRListState<T> = {\n size: 0,\n cursor: undefined,\n tombstones: new Set<string>(),\n parentMap: new Map<string, NonNullable<CRListStateEntry<T>>>(),\n childrenMap: new Map<string, Array<NonNullable<CRListStateEntry<T>>>>(),\n }\n if (!snapshot || prototype(snapshot) !== 'record') return crListReplica\n\n /** Hydrate tombstone entries. */\n if (\n Object.hasOwn(snapshot, 'tombstones') &&\n Array.isArray(snapshot.tombstones)\n ) {\n for (const tombstone of snapshot.tombstones) {\n if (crListReplica.tombstones.has(tombstone) || !isUuidV7(tombstone))\n continue\n crListReplica.tombstones.add(tombstone)\n }\n }\n\n /** Hydrate value entries. */\n if (!Object.hasOwn(snapshot, 'values') || !Array.isArray(snapshot.values))\n return crListReplica\n // Build predecessor tree.\n for (const valueEntry of snapshot.values) {\n const linkedListEntry = snapshotValueToLinkedListValue<T>(\n valueEntry,\n crListReplica\n )\n if (!linkedListEntry) continue\n void updateEntryToMaps<T>(crListReplica, linkedListEntry)\n }\n // Flatten tree into a doubly linked list.\n void flattenAndLinkTrustedState<T>(crListReplica)\n // Write live-view indexes.\n void assertListIndices<T>(crListReplica)\n\n return crListReplica\n}\n","import { walkToIndex } from '../../../.helpers/index.js'\nimport { CRListState } from '../../../.types/index.js'\n\n/**\n * Reads the value at an index in the replica live view.\n *\n * The replica cursor is moved as part of the lookup. Out-of-bounds and empty\n * list reads resolve to `undefined` instead of throwing.\n *\n * @param targetIndex Index in the live list.\n * @param crListReplica Replica to read from.\n * @returns The value at `targetIndex`, or `undefined` when no value is present.\n *\n * Time complexity: O(d), worst case O(n)\n * - d = distance from cursor to target index\n * - n = list size\n *\n * Space complexity: O(1)\n */\nexport function __read<T>(\n targetIndex: number,\n crListReplica: CRListState<T>\n): T | undefined {\n try {\n void walkToIndex<T>(targetIndex, crListReplica)\n return crListReplica?.cursor?.value\n } catch {\n return undefined\n }\n}\n","import { CRListError } from '../../../.errors/class.js'\nimport { safeStructuredClone } from '@sovereignbase/utils'\nimport {\n updateEntryToMaps,\n deleteEntryFromMaps,\n walkToIndex,\n moveEntryToPredecessor,\n insertBetween,\n} from '../../../.helpers/index.js'\nimport { v7 as uuidv7 } from 'uuid'\nimport {\n CRListChange,\n CRListDelta,\n CRListState,\n CRListStateEntry,\n} from '../../../.types/index.js'\n/**\n * Applies a local value mutation to the replica live view.\n *\n * The update can replace a range starting at the target entry, insert values\n * before it, or insert values after it. The returned delta is suitable for\n * gossip and the returned change describes the local live-view patch.\n *\n * @param listIndex Target index in the live list.\n * @param listValues Values to insert or overwrite.\n * @param crListReplica Replica to mutate.\n * @param mode Mutation mode relative to `listIndex`.\n * @returns A local change and gossip delta, or `false` if no mutation occurred.\n *\n * Time complexity: O(d + v + r + vk + c), worst case O(vn + c)\n * - d = distance from cursor to target index\n * - v = amount of input values\n * - r = amount of nodes after inserted values whose indexes must be shifted\n * - k = sibling bucket size when predecessor bucket is updated\n * - c = cloned value payload size across all input values\n *\n * Space complexity: O(v + c)\n */\nexport function __update<T>(\n listIndex: number,\n listValues: Array<T>,\n crListReplica: CRListState<T>,\n mode: 'overwrite' | 'before' | 'after'\n): { change: CRListChange<T>; delta: CRListDelta<T> } | false {\n if (listIndex < 0 || listIndex > crListReplica.size)\n throw new CRListError('INDEX_OUT_OF_BOUNDS')\n if (!Array.isArray(listValues))\n throw new CRListError(\n 'UPDATE_EXPECTED_AN_ARRAY',\n '`listValues` must be an Array'\n )\n if (listValues.length === 0) return false\n const change: CRListChange<T> = {}\n const delta: CRListDelta<T> = { values: [], tombstones: [] }\n let shiftCursor: CRListStateEntry<T>\n for (const listValue of listValues) {\n const [cloned, copiedValue] = safeStructuredClone(listValue)\n\n if (!cloned) throw new CRListError('VALUE_NOT_CLONEABLE')\n\n const v7 = uuidv7()\n\n const linkedListEntry: NonNullable<CRListStateEntry<T>> = {\n uuidv7: v7,\n value: copiedValue,\n predecessor: '\\0',\n index: 0,\n next: undefined,\n prev: undefined,\n }\n\n switch (mode) {\n case 'overwrite': {\n if (listIndex === crListReplica.size) {\n if (crListReplica.size === 0) {\n crListReplica.cursor = linkedListEntry\n void updateEntryToMaps<T>(crListReplica, linkedListEntry, delta)\n change[linkedListEntry.index] = linkedListEntry.value\n break\n }\n void walkToIndex<T>(crListReplica.size - 1, crListReplica)\n if (!crListReplica.cursor) return false\n linkedListEntry.index = crListReplica.cursor.index + 1\n linkedListEntry.predecessor = crListReplica.cursor.uuidv7\n insertBetween<T>(crListReplica.cursor, linkedListEntry, undefined)\n void updateEntryToMaps<T>(crListReplica, linkedListEntry, delta)\n crListReplica.cursor = linkedListEntry\n change[linkedListEntry.index] = linkedListEntry.value\n break\n }\n void walkToIndex<T>(listIndex, crListReplica)\n if (!crListReplica.cursor) return false\n const entryToOverwrite = crListReplica.cursor\n\n linkedListEntry.predecessor = entryToOverwrite.predecessor\n linkedListEntry.index = entryToOverwrite.index\n insertBetween<T>(\n entryToOverwrite.prev,\n linkedListEntry,\n entryToOverwrite.next\n )\n if (entryToOverwrite.next) {\n if (entryToOverwrite.next.predecessor === entryToOverwrite.uuidv7) {\n void moveEntryToPredecessor<T>(\n crListReplica,\n entryToOverwrite.next,\n linkedListEntry.uuidv7,\n delta\n )\n }\n }\n void updateEntryToMaps<T>(crListReplica, linkedListEntry, delta)\n crListReplica.tombstones.add(entryToOverwrite.uuidv7)\n delta.tombstones?.push(entryToOverwrite.uuidv7)\n void deleteEntryFromMaps<T>(crListReplica, entryToOverwrite)\n entryToOverwrite.next = undefined\n entryToOverwrite.prev = undefined\n crListReplica.cursor = linkedListEntry\n change[linkedListEntry.index] = linkedListEntry.value\n break\n }\n case 'after': {\n if (crListReplica.size === 0 && listIndex === 0) {\n crListReplica.cursor = linkedListEntry\n void updateEntryToMaps<T>(crListReplica, linkedListEntry, delta)\n change[linkedListEntry.index] = linkedListEntry.value\n break\n }\n if (listIndex === crListReplica.size) {\n void walkToIndex<T>(crListReplica.size - 1, crListReplica)\n } else {\n void walkToIndex<T>(listIndex, crListReplica)\n }\n if (!crListReplica.cursor) return false\n const next =\n listIndex === crListReplica.size\n ? undefined\n : crListReplica.cursor.next\n shiftCursor = next\n linkedListEntry.index = crListReplica.cursor.index + 1\n linkedListEntry.predecessor = crListReplica.cursor.uuidv7\n insertBetween<T>(crListReplica.cursor, linkedListEntry, next)\n if (next) {\n if (next.predecessor === crListReplica.cursor.uuidv7) {\n void moveEntryToPredecessor<T>(\n crListReplica,\n next,\n linkedListEntry.uuidv7,\n delta\n )\n }\n }\n void updateEntryToMaps<T>(crListReplica, linkedListEntry, delta)\n crListReplica.cursor = linkedListEntry\n change[linkedListEntry.index] = linkedListEntry.value\n break\n }\n case 'before': {\n if (crListReplica.size === 0 && listIndex === 0) {\n crListReplica.cursor = linkedListEntry\n void updateEntryToMaps<T>(crListReplica, linkedListEntry, delta)\n change[linkedListEntry.index] = linkedListEntry.value\n mode = 'after'\n listIndex = linkedListEntry.index - 1\n break\n }\n void walkToIndex<T>(listIndex, crListReplica)\n if (!crListReplica.cursor) return false\n const prev = crListReplica.cursor.prev\n shiftCursor = crListReplica.cursor\n linkedListEntry.index = crListReplica.cursor.index\n linkedListEntry.predecessor = prev?.uuidv7 ?? '\\0'\n insertBetween<T>(prev, linkedListEntry, crListReplica.cursor)\n if (crListReplica.cursor.predecessor === linkedListEntry.predecessor) {\n void moveEntryToPredecessor<T>(\n crListReplica,\n crListReplica.cursor,\n linkedListEntry.uuidv7,\n delta\n )\n }\n void updateEntryToMaps<T>(crListReplica, linkedListEntry, delta)\n crListReplica.cursor = linkedListEntry\n change[linkedListEntry.index] = linkedListEntry.value\n mode = 'after'\n listIndex = linkedListEntry.index - 1\n\n break\n }\n }\n crListReplica.size = crListReplica.parentMap.size\n listIndex++\n }\n if (mode !== 'overwrite')\n while (shiftCursor) {\n shiftCursor.index += listValues.length\n shiftCursor = shiftCursor.next\n }\n return { change, delta }\n}\n","import { deleteLinkedEntry, walkToIndex } from '../../../.helpers/index.js'\nimport { CRListError } from '../../../.errors/class.js'\nimport type {\n CRListChange,\n CRListDelta,\n CRListState,\n CRListStateEntry,\n} from '../../../.types/index.js'\n\n/**\n * Deletes a range from the replica live view.\n *\n * With no indexes, the full list is deleted. With only `startIndex`, all entries\n * from `startIndex` onward are deleted. With both indexes, the deleted range is\n * `[startIndex, endIndex)`.\n *\n * @param crListReplica Replica to mutate.\n * @param startIndex Inclusive start index. Defaults to `0`.\n * @param endIndex Exclusive end index. Defaults to the current list size.\n * @returns A local change and gossip delta, or `false` if nothing was deleted.\n *\n * Time complexity: O(d + qk + r), worst case O(n^2)\n * - d = distance from cursor to target index\n * - q = amount of deleted nodes\n * - r = amount of nodes after the deleted range whose indexes must be shifted\n * - k = sibling bucket size when deleted entries are removed from buckets\n *\n * Space complexity: O(q)\n */\nexport function __delete<T>(\n crListReplica: CRListState<T>,\n startIndex?: number,\n endIndex?: number\n): { change: CRListChange<T>; delta: CRListDelta<T> } | false {\n const change: CRListChange<T> = {}\n const delta: CRListDelta<T> = { values: [], tombstones: [] }\n const listIndex = startIndex ?? 0\n const targetEndIndex = endIndex ?? crListReplica.size\n if (\n listIndex < 0 ||\n targetEndIndex < listIndex ||\n listIndex > crListReplica.size\n )\n throw new CRListError('INDEX_OUT_OF_BOUNDS')\n const deleteCount = Math.min(targetEndIndex, crListReplica.size) - listIndex\n if (deleteCount <= 0) return false\n\n void walkToIndex<T>(listIndex, crListReplica)\n if (!crListReplica.cursor) return false\n\n let current: CRListStateEntry<T> = crListReplica.cursor\n let deleted = 0\n\n while (current && deleted < deleteCount) {\n const next: CRListStateEntry<T> = current.next\n change[current.index] = undefined\n void deleteLinkedEntry<T>(crListReplica, current, delta)\n current = next\n deleted++\n }\n\n crListReplica.size = crListReplica.parentMap.size\n\n while (current) {\n current.index -= deleted\n current = current.next\n }\n\n return { change, delta }\n}\n","import type {\n CRListChange,\n CRListDelta,\n CRListState,\n CRListStateEntry,\n} from '../../../.types/index.js'\nimport {\n snapshotValueToLinkedListValue,\n updateEntryToMaps,\n flattenAndLinkTrustedState,\n assertListIndices,\n deleteLinkedEntry,\n moveEntryToPredecessor,\n} from '../../../.helpers/index.js'\nimport { prototype, isUuidV7 } from '@sovereignbase/utils'\n\n/**\n * Merges a remote CRList delta into the local replica.\n *\n * Accepted tombstones update the local live view and accepted values are attached\n * to the predecessor tree. Tail-append deltas are linked incrementally; deltas\n * that can affect ordering fall back to deterministic relinking.\n *\n * @param crListReplica Replica to mutate.\n * @param crListDelta Remote gossip delta.\n * @returns A minimal local change patch, or `false` when the delta is ignored.\n *\n * Time complexity: O(v + t + c) for tail-append deltas; O(n + t + qk) for tombstone-only deletes; otherwise O(n log n + v + t + m*k + c)\n * Worst case: O(n^2 + (v + t)n + c)\n * - n = replica value entry count after merge\n * - v = delta value entry count\n * - t = delta tombstone count\n * - q = amount of live entries deleted by tombstones\n * - m = entries moved between predecessor buckets\n * - k = sibling bucket size when entries are removed from buckets\n * - c = cloned delta value payload size\n *\n * Space complexity: O(n + v + t + c)\n */\nexport function __merge<T>(\n crListReplica: CRListState<T>,\n crListDelta: CRListDelta<T>\n): CRListChange<T> | false {\n if (!crListDelta || prototype(crListDelta) !== 'record') return false\n const newVals: Array<NonNullable<CRListStateEntry<T>>> = []\n const newTombsIndices: Array<number> = []\n const change: CRListChange<T> = {}\n let needsRelink = false\n\n /** Apply tombstone entries. */\n if (\n Object.hasOwn(crListDelta, 'tombstones') &&\n Array.isArray(crListDelta.tombstones)\n ) {\n for (const tombstone of crListDelta.tombstones) {\n if (crListReplica.tombstones.has(tombstone) || !isUuidV7(tombstone))\n continue\n crListReplica.tombstones.add(tombstone)\n const linkedListEntry = crListReplica.parentMap.get(tombstone)\n if (linkedListEntry) {\n void newTombsIndices.push(linkedListEntry.index)\n void deleteLinkedEntry<T>(crListReplica, linkedListEntry)\n needsRelink = true\n }\n }\n }\n\n /** Apply value entries. */\n if (\n !Object.hasOwn(crListDelta, 'values') ||\n !Array.isArray(crListDelta.values)\n ) {\n if (newTombsIndices.length === 0) return false\n void assertListIndices<T>(crListReplica)\n for (const index of newTombsIndices) {\n change[index] = undefined\n }\n return change\n }\n // Attach accepted values to the predecessor tree.\n for (const valueEntry of crListDelta.values) {\n const existingEntry = crListReplica.parentMap.get(valueEntry.uuidv7)\n if (existingEntry) {\n if (\n crListReplica.tombstones.has(valueEntry.uuidv7) ||\n (!isUuidV7(valueEntry.predecessor) && valueEntry.predecessor !== '\\0')\n )\n continue\n if (existingEntry.predecessor >= valueEntry.predecessor) continue\n void moveEntryToPredecessor<T>(\n crListReplica,\n existingEntry,\n valueEntry.predecessor\n )\n needsRelink = true\n void newVals.push(existingEntry)\n continue\n }\n const linkedListEntry = snapshotValueToLinkedListValue<T>(\n valueEntry,\n crListReplica\n )\n if (!linkedListEntry) continue\n const predecessor =\n linkedListEntry.predecessor === '\\0'\n ? undefined\n : crListReplica.parentMap.get(linkedListEntry.predecessor)\n void updateEntryToMaps<T>(crListReplica, linkedListEntry)\n void newVals.push(linkedListEntry)\n if (!needsRelink && linkedListEntry.predecessor === '\\0') {\n if (crListReplica.size === 0) {\n crListReplica.cursor = linkedListEntry\n crListReplica.size = crListReplica.parentMap.size\n } else {\n needsRelink = true\n }\n } else if (!needsRelink && predecessor && !predecessor.next) {\n linkedListEntry.prev = predecessor\n linkedListEntry.index = predecessor.index + 1\n predecessor.next = linkedListEntry\n crListReplica.cursor = linkedListEntry\n crListReplica.size = crListReplica.parentMap.size\n } else {\n needsRelink = true\n }\n }\n if (needsRelink) {\n // Flatten tree into a doubly linked list.\n void flattenAndLinkTrustedState<T>(crListReplica)\n // Write live-view indexes.\n void assertListIndices<T>(crListReplica)\n }\n\n if (newTombsIndices.length === 0 && newVals.length === 0) return false\n\n for (const index of newTombsIndices) {\n change[index] = undefined\n }\n for (const val of newVals) {\n change[val.index] = val.value\n }\n\n return change\n}\n","import type { CRListAck, CRListState } from '../../../.types/index.js'\n\n/**\n * Returns the replica tombstone acknowledgement frontier.\n *\n * The frontier is the greatest tombstone identifier currently retained by the\n * replica. Peers can use it as input for tombstone garbage collection.\n *\n * @param crListReplica Replica to acknowledge.\n * @returns The acknowledgement frontier, or `false` when there are no tombstones.\n *\n * Time complexity: O(t)\n * - t = replica tombstone count\n *\n * Space complexity: O(1)\n */\nexport function __acknowledge<T>(\n crListReplica: CRListState<T>\n): CRListAck | false {\n let frontier: CRListAck | false = false\n crListReplica.tombstones.forEach((tombstone) => {\n if (frontier === false || frontier < tombstone) frontier = tombstone\n })\n if (typeof frontier === 'string') return frontier\n return false\n}\n","import { CRListAck, CRListState } from '../../../.types/index.js'\n\n/**\n * Removes tombstones acknowledged by all supplied frontiers.\n *\n * The minimum frontier is used as the safe collection boundary. Tombstones less\n * than or equal to that boundary are removed from the local replica.\n *\n * @param frontiers Acknowledgement frontiers received from peers.\n * @param crListReplica Replica whose tombstones will be collected.\n *\n * Time complexity: O(f log f + t)\n * - f = frontier count\n * - t = replica tombstone count\n *\n * Space complexity: O(1)\n */\nexport function __garbageCollect<T>(\n frontiers: Array<CRListAck>,\n crListReplica: CRListState<T>\n): void {\n if (!Array.isArray(frontiers)) return\n const frontier = frontiers.sort().shift()\n if (typeof frontier !== 'string') return\n crListReplica.tombstones.forEach((tombstone, __, tombstones) => {\n if (tombstone <= frontier) {\n tombstones.delete(tombstone)\n }\n })\n}\n","import { CRListError } from '../../../.errors/class.js'\nimport { CRListState, CRListSnapshot } from '../../../.types/index.js'\n\n/**\n * Creates a full serializable CRList snapshot from the current replica state.\n *\n * The snapshot contains every live value entry and all retained tombstones. Value\n * payloads are cloned so callers cannot mutate the replica through the snapshot.\n *\n * @param crListReplica Replica to snapshot.\n * @returns A full snapshot suitable for hydration or transport.\n *\n * Time complexity: O(n + t + c)\n * - n = replica value entry count\n * - t = replica tombstone count\n * - c = cloned value payload size\n *\n * Space complexity: O(n + t + c)\n */\nexport function __snapshot<T>(\n crListReplica: CRListState<T>\n): CRListSnapshot<T> {\n return {\n values: Array.from(crListReplica.parentMap.values()).map(\n (linkedListEntry) => {\n if (!linkedListEntry) throw new CRListError('LIST_INTEGRITY_VIOLATION')\n return {\n uuidv7: linkedListEntry.uuidv7,\n value: structuredClone(linkedListEntry.value),\n predecessor: linkedListEntry.predecessor,\n }\n }\n ),\n tombstones: Array.from(crListReplica.tombstones),\n }\n}\n","import { indexFromPropertyKey } from '../.helpers/index.js'\nimport type {\n CRListState,\n CRListSnapshot,\n CRListEventListenerFor,\n CRListEventMap,\n CRListDelta,\n CRListAck,\n} from '../.types/index.js'\nimport { __create, __read, __update, __delete } from '../core/crud/index.js'\nimport {\n __merge,\n __acknowledge,\n __garbageCollect,\n __snapshot,\n} from '../core/mags/index.js'\n\n/**\n * A convergent replicated list.\n *\n * Numeric property access reads and mutates the live list projection:\n * `list[0]` reads an entry, `list[0] = value` writes an entry, and `delete\n * list[0]` removes one entry. Local mutations emit `delta` and `change` events;\n * remote merges emit `change` events.\n *\n * @typeParam T - The value type stored in the list.\n */\nexport class CRList<T> {\n /**\n * Reads or overwrites an entry in the live list projection by index.\n */\n [index: number]: T\n declare private readonly state: CRListState<T>\n declare private readonly eventTarget: EventTarget\n\n /**\n * Creates a replicated list from an optional serializable snapshot.\n *\n * @param snapshot - A previously emitted CRList snapshot.\n */\n constructor(snapshot?: CRListSnapshot<T>) {\n Object.defineProperties(this, {\n state: {\n value: __create(snapshot),\n enumerable: false,\n configurable: false,\n writable: false,\n },\n eventTarget: {\n value: new EventTarget(),\n enumerable: false,\n configurable: false,\n writable: false,\n },\n })\n\n return new Proxy(this, {\n get(target, index, receiver) {\n const listIndex = indexFromPropertyKey(index)\n // Preserve normal property access for non-index keys.\n if (listIndex === undefined) return Reflect.get(target, index, receiver)\n return __read(listIndex, target.state)\n },\n has(target, index) {\n const listIndex = indexFromPropertyKey(index)\n // Preserve normal property checks for non-index keys.\n if (listIndex === undefined) return Reflect.has(target, index)\n return listIndex >= 0 && listIndex < target.state.size\n },\n set(target, index, value) {\n const listIndex = indexFromPropertyKey(index)\n if (listIndex === undefined) return false\n try {\n const result = __update(listIndex, [value], target.state, 'overwrite')\n if (!result) return false\n const { delta, change } = result\n if (delta)\n void target.eventTarget.dispatchEvent(\n new CustomEvent('delta', { detail: delta })\n )\n if (change)\n void target.eventTarget.dispatchEvent(\n new CustomEvent('change', { detail: change })\n )\n return true\n } catch {\n return false\n }\n },\n deleteProperty(target, index) {\n const listIndex = indexFromPropertyKey(index)\n if (listIndex === undefined) return false\n try {\n const result = __delete(target.state, listIndex, listIndex + 1)\n if (!result) return false\n const { delta, change } = result\n if (delta) {\n void target.eventTarget.dispatchEvent(\n new CustomEvent('delta', { detail: delta })\n )\n }\n if (change) {\n void target.eventTarget.dispatchEvent(\n new CustomEvent('change', { detail: change })\n )\n }\n return true\n } catch {\n return false\n }\n },\n ownKeys(target) {\n return [\n ...Reflect.ownKeys(target),\n ...Array.from({ length: target.size }, (_, index) => String(index)),\n ]\n },\n\n getOwnPropertyDescriptor(target, index) {\n const listIndex = indexFromPropertyKey(index)\n\n if (listIndex !== undefined && listIndex < target.size) {\n return {\n value: __read(listIndex, target.state),\n writable: true,\n enumerable: true,\n configurable: true,\n }\n }\n\n return Reflect.getOwnPropertyDescriptor(target, index)\n },\n })\n }\n /**\n * The current number of live entries.\n */\n get size(): number {\n return this.state.size\n }\n /**\n * Inserts a value before an index.\n *\n * If `beforeIndex` is omitted, the value is inserted at the start of the list.\n *\n * @param value - The value to insert.\n * @param beforeIndex - The index to insert before.\n */\n prepend(value: T, beforeIndex?: number): void {\n const result = __update<T>(beforeIndex ?? 0, [value], this.state, 'before')\n if (!result) return\n const { delta, change } = result\n if (delta)\n void this.eventTarget.dispatchEvent(\n new CustomEvent('delta', { detail: delta })\n )\n if (change)\n void this.eventTarget.dispatchEvent(\n new CustomEvent('change', { detail: change })\n )\n }\n /**\n * Inserts a value after an index.\n *\n * If `afterIndex` is omitted, the value is appended at the end of the list.\n *\n * @param value - The value to insert.\n * @param afterIndex - The index to insert after.\n */\n append(value: T, afterIndex?: number): void {\n const result = __update<T>(\n afterIndex ?? this.state.size,\n [value],\n this.state,\n 'after'\n )\n if (!result) return\n const { delta, change } = result\n if (delta)\n void this.eventTarget.dispatchEvent(\n new CustomEvent('delta', { detail: delta })\n )\n if (change)\n void this.eventTarget.dispatchEvent(\n new CustomEvent('change', { detail: change })\n )\n }\n /**\n * Removes the entry at an index.\n *\n * @param index - The index to remove.\n */\n remove(index: number): void {\n const result = __delete(this.state, index, index + 1)\n if (!result) return\n const { delta, change } = result\n if (delta)\n void this.eventTarget.dispatchEvent(\n new CustomEvent('delta', { detail: delta })\n )\n if (change)\n void this.eventTarget.dispatchEvent(\n new CustomEvent('change', { detail: change })\n )\n }\n /**\n * Applies a remote gossip delta to this list.\n *\n * Emits a `change` event when the merge changes the live projection.\n *\n * @param delta - The remote CRList delta to merge.\n */\n merge(delta: CRListDelta<T>): void {\n const change = __merge(this.state, delta)\n if (change)\n void this.eventTarget.dispatchEvent(\n new CustomEvent('change', { detail: change })\n )\n }\n /**\n * Emits an acknowledgement frontier for currently retained tombstones.\n */\n acknowledge(): void {\n const ack = __acknowledge(this.state)\n if (ack)\n void this.eventTarget.dispatchEvent(\n new CustomEvent('ack', { detail: ack })\n )\n }\n /**\n * Garbage-collects tombstones that are covered by acknowledgement frontiers.\n *\n * @param frontiers - Replica acknowledgement frontiers.\n */\n garbageCollect(frontiers: Array<CRListAck>): void {\n void __garbageCollect(frontiers, this.state)\n }\n /**\n * Emits the current serializable list snapshot.\n */\n snapshot(): void {\n const snapshot = __snapshot(this.state)\n if (snapshot)\n void this.eventTarget.dispatchEvent(\n new CustomEvent('snapshot', { detail: snapshot })\n )\n }\n /**\n * Registers an event listener.\n *\n * @param type - The event type to listen for.\n * @param listener - The listener to register.\n * @param options - Listener registration options.\n */\n addEventListener<K extends keyof CRListEventMap<T>>(\n type: K,\n listener: CRListEventListenerFor<T, K> | null,\n options?: boolean | AddEventListenerOptions\n ): void {\n this.eventTarget.addEventListener(\n type,\n listener as EventListenerOrEventListenerObject | null,\n options\n )\n }\n\n /**\n * Removes an event listener.\n *\n * @param type - The event type to stop listening for.\n * @param listener - The listener to remove.\n * @param options - Listener removal options.\n */\n removeEventListener<K extends keyof CRListEventMap<T>>(\n type: K,\n listener: CRListEventListenerFor<T, K> | null,\n options?: boolean | EventListenerOptions\n ): void {\n this.eventTarget.removeEventListener(\n type,\n listener as EventListenerOrEventListenerObject | null,\n options\n )\n }\n /**\n * Returns a serializable snapshot representation of this list.\n *\n * Called automatically by `JSON.stringify`.\n */\n toJSON(): CRListSnapshot<T> {\n return __snapshot<T>(this.state)\n }\n /**\n * Returns this list as a JSON string.\n */\n toString(): string {\n return JSON.stringify(this)\n }\n /**\n * Returns the Node.js console inspection representation.\n */\n [Symbol.for('nodejs.util.inspect.custom')](): CRListSnapshot<T> {\n return this.toJSON()\n }\n /**\n * Returns the Deno console inspection representation.\n */\n [Symbol.for('Deno.customInspect')](): CRListSnapshot<T> {\n return this.toJSON()\n }\n /**\n * Iterates over the current live values in index order.\n */\n *[Symbol.iterator](): IterableIterator<T> {\n for (let index = 0; index < this.size; index++) {\n const value = this[index]\n yield value\n }\n }\n /**\n * Calls a function once for each live value in index order.\n *\n * @param callback - Function to call for each value.\n * @param thisArg - Optional `this` value for the callback.\n */\n forEach(\n callback: (value: T, index: number, list: this) => void,\n thisArg?: unknown\n ): void {\n for (let index = 0; index < this.size; index++) {\n callback.call(thisArg, this[index], index, this)\n }\n }\n}\n"]}