@agoric/store 0.9.3-other-dev-8f8782b.0 → 0.9.3-other-dev-fbe72e7.0.fbe72e7
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/README.md +3 -33
- package/exported.js +1 -1
- package/package.json +23 -16
- package/src/index.d.ts +14 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +24 -8
- package/src/legacy/legacyMap.d.ts +3 -0
- package/src/legacy/legacyMap.d.ts.map +1 -0
- package/src/legacy/legacyMap.js +23 -20
- package/src/legacy/legacyWeakMap.d.ts +3 -0
- package/src/legacy/legacyWeakMap.d.ts.map +1 -0
- package/src/legacy/legacyWeakMap.js +6 -4
- package/src/stores/scalarMapStore.d.ts +8 -0
- package/src/stores/scalarMapStore.d.ts.map +1 -0
- package/src/stores/scalarMapStore.js +19 -14
- package/src/stores/scalarSetStore.d.ts +7 -0
- package/src/stores/scalarSetStore.d.ts.map +1 -0
- package/src/stores/scalarSetStore.js +13 -9
- package/src/stores/scalarWeakMapStore.d.ts +8 -0
- package/src/stores/scalarWeakMapStore.d.ts.map +1 -0
- package/src/stores/scalarWeakMapStore.js +32 -17
- package/src/stores/scalarWeakSetStore.d.ts +7 -0
- package/src/stores/scalarWeakSetStore.d.ts.map +1 -0
- package/src/stores/scalarWeakSetStore.js +26 -13
- package/src/stores/store-utils.d.ts +24 -0
- package/src/stores/store-utils.d.ts.map +1 -0
- package/src/stores/store-utils.js +36 -51
- package/src/types.d.ts +212 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.js +139 -223
- package/CHANGELOG.md +0 -690
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function makeCurrentKeysKit<K extends Key, V extends Passable>(getRawKeys: () => Iterable<K>, checkHas: (k: K) => boolean, compare: RankCompare, assertOkToAdd: (k: K, v?: V) => void, assertOkToDelete?: (k: K) => void, keyName?: string): CurrentKeysKit<K, V>;
|
|
2
|
+
export function provideLazy<K extends Key, V extends Passable>(mapStore: WeakMapStore<K, V>, key: K, makeValue: (key: K) => V): V;
|
|
3
|
+
export function makeAtomicProvider<K extends Key, V extends Passable>(store: WeakMapStore<K, V>): {
|
|
4
|
+
provideAsync: (key: K, makeValue: (key: K) => Promise<V>, finishValue?: (key: K, value: V) => Promise<void>) => Promise<V>;
|
|
5
|
+
};
|
|
6
|
+
export function appendToStoredArray<K extends Key, V extends Passable>(mapStore: MapStore<K, V[]>, key: K, item: V): void;
|
|
7
|
+
export type CurrentKeysKit<K extends Key, V extends Passable> = {
|
|
8
|
+
assertUpdateOnAdd: (k: K, v?: V) => void;
|
|
9
|
+
assertUpdateOnDelete: (k: K) => void;
|
|
10
|
+
iterableKeys: Iterable<K>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* <K, V>
|
|
14
|
+
*/
|
|
15
|
+
export type AtomicProvider<K extends Key, V extends Passable> = ReturnType<typeof makeAtomicProvider<K, V>>;
|
|
16
|
+
import { isCopyMap } from '@endo/patterns';
|
|
17
|
+
import { isCopySet } from '@endo/patterns';
|
|
18
|
+
import type { Key } from '@endo/patterns';
|
|
19
|
+
import type { Passable } from '@endo/pass-style';
|
|
20
|
+
import type { RankCompare } from '@endo/marshal';
|
|
21
|
+
import type { WeakMapStore } from '../types.js';
|
|
22
|
+
import type { MapStore } from '../types.js';
|
|
23
|
+
export { isCopyMap, isCopySet };
|
|
24
|
+
//# sourceMappingURL=store-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-utils.d.ts","sourceRoot":"","sources":["store-utils.js"],"names":[],"mappings":"AAiCO,mCAVY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,cACZ,MAAM,QAAQ,CAAC,CAAC,CAAC,YACjB,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,WACjB,WAAW,iBACX,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,qBACrB,CAAC,CAAC,E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q } = assert;
|
|
3
|
+
import { isCopyMap, isCopySet } from '@endo/patterns';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* reimplementation here.
|
|
12
|
-
*
|
|
13
|
-
* @param {Passable} s
|
|
14
|
-
* @returns {s is CopySet}
|
|
6
|
+
* @import {RankCompare} from '@endo/marshal';
|
|
7
|
+
* @import {MapStore, WeakMapStore} from '../types.js';
|
|
8
|
+
* @import {Passable} from '@endo/pass-style';
|
|
9
|
+
* @import {Key} from '@endo/patterns';
|
|
15
10
|
*/
|
|
16
|
-
export const isCopySet = s => matches(s, M.set());
|
|
17
11
|
|
|
18
|
-
|
|
19
|
-
* Should behave identically to the one in `@endo/patterns`, but
|
|
20
|
-
* reimplemented for now because `@endo/patterns` forgot to export this one.
|
|
21
|
-
* This one is simple enough that I prefer a reimplementation to a deep import.
|
|
22
|
-
* TODO: Undate `@endo/patterns` to export the original, and delete the
|
|
23
|
-
* reimplementation here.
|
|
24
|
-
*
|
|
25
|
-
* @param {Passable} m
|
|
26
|
-
* @returns {m is CopyMap}
|
|
27
|
-
*/
|
|
28
|
-
export const isCopyMap = m => matches(m, M.map());
|
|
12
|
+
export { isCopyMap, isCopySet };
|
|
29
13
|
|
|
30
14
|
/**
|
|
31
|
-
* @template K
|
|
15
|
+
* @template {Key} K
|
|
16
|
+
* @template {Passable} V
|
|
32
17
|
* @typedef {object} CurrentKeysKit
|
|
33
18
|
* @property {(k: K, v?: V) => void} assertUpdateOnAdd
|
|
34
19
|
* @property {(k: K) => void} assertUpdateOnDelete
|
|
@@ -36,14 +21,15 @@ export const isCopyMap = m => matches(m, M.map());
|
|
|
36
21
|
*/
|
|
37
22
|
|
|
38
23
|
/**
|
|
39
|
-
* @template K
|
|
24
|
+
* @template {Key} K
|
|
25
|
+
* @template {Passable} V
|
|
40
26
|
* @param {() => Iterable<K>} getRawKeys
|
|
41
27
|
* @param {(k: K) => boolean} checkHas
|
|
42
28
|
* @param {RankCompare} compare
|
|
43
29
|
* @param {(k: K, v?: V) => void} assertOkToAdd
|
|
44
30
|
* @param {(k: K) => void} [assertOkToDelete]
|
|
45
31
|
* @param {string} [keyName]
|
|
46
|
-
* @returns {CurrentKeysKit<K,V>}
|
|
32
|
+
* @returns {CurrentKeysKit<K, V>}
|
|
47
33
|
*/
|
|
48
34
|
export const makeCurrentKeysKit = (
|
|
49
35
|
getRawKeys,
|
|
@@ -107,13 +93,13 @@ export const makeCurrentKeysKit = (
|
|
|
107
93
|
harden(makeCurrentKeysKit);
|
|
108
94
|
|
|
109
95
|
/**
|
|
110
|
-
* Call `provideLazy` to get or make the value associated with the key.
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* that key, and return it.
|
|
96
|
+
* Call `provideLazy` to get or make the value associated with the key. If there
|
|
97
|
+
* already is one, return that. Otherwise, call `makeValue(key)`, remember it as
|
|
98
|
+
* the value for that key, and return it.
|
|
114
99
|
*
|
|
115
|
-
* @template K
|
|
116
|
-
* @
|
|
100
|
+
* @template {Key} K
|
|
101
|
+
* @template {Passable} V
|
|
102
|
+
* @param {WeakMapStore<K, V>} mapStore
|
|
117
103
|
* @param {K} key
|
|
118
104
|
* @param {(key: K) => V} makeValue
|
|
119
105
|
* @returns {V}
|
|
@@ -127,19 +113,18 @@ export const provideLazy = (mapStore, key, makeValue) => {
|
|
|
127
113
|
harden(provideLazy);
|
|
128
114
|
|
|
129
115
|
/**
|
|
130
|
-
* Helper for use cases in which the maker function is async.
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* for the maker in an ephemeral store.
|
|
116
|
+
* Helper for use cases in which the maker function is async. For two
|
|
117
|
+
* provideLazy calls with the same key, one may be making when the other call
|
|
118
|
+
* starts and it would make again. (Then there'd be a collision when the second
|
|
119
|
+
* tries to store the key.) This prevents that race condition by immediately
|
|
120
|
+
* storing a Promise for the maker in an ephemeral store.
|
|
136
121
|
*
|
|
137
122
|
* When the `store` argument is durable storage, note that it's possible for
|
|
138
123
|
* termination to happen after the make completes and before it reaches durable
|
|
139
124
|
* storage.
|
|
140
125
|
*
|
|
141
|
-
* @template K
|
|
142
|
-
* @template V
|
|
126
|
+
* @template {Key} K
|
|
127
|
+
* @template {Passable} V
|
|
143
128
|
* @param {WeakMapStore<K, V>} store
|
|
144
129
|
*/
|
|
145
130
|
export const makeAtomicProvider = store => {
|
|
@@ -147,17 +132,16 @@ export const makeAtomicProvider = store => {
|
|
|
147
132
|
const pending = new Map();
|
|
148
133
|
|
|
149
134
|
/**
|
|
150
|
-
* Call `provideAsync` to get or make the value associated with the key,
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* that key, and return it.
|
|
135
|
+
* Call `provideAsync` to get or make the value associated with the key, when
|
|
136
|
+
* the maker is asynchronous. If there already is one, return that. Otherwise,
|
|
137
|
+
* call `makeValue(key)`, remember it as the value for that key, and return
|
|
138
|
+
* it.
|
|
155
139
|
*
|
|
156
140
|
* @param {K} key
|
|
157
|
-
* @param {(key: K) => Promise<V>} makeValue make the value for the store
|
|
158
|
-
*
|
|
141
|
+
* @param {(key: K) => Promise<V>} makeValue make the value for the store if
|
|
142
|
+
* it hasn't been made yet or the last make failed
|
|
159
143
|
* @param {(key: K, value: V) => Promise<void>} [finishValue] runs exactly
|
|
160
|
-
*
|
|
144
|
+
* once after a new value is added to the store
|
|
161
145
|
* @returns {Promise<V>}
|
|
162
146
|
*/
|
|
163
147
|
const provideAsync = (key, makeValue, finishValue) => {
|
|
@@ -190,13 +174,14 @@ export const makeAtomicProvider = store => {
|
|
|
190
174
|
};
|
|
191
175
|
harden(makeAtomicProvider);
|
|
192
176
|
/**
|
|
193
|
-
* @template K
|
|
194
|
-
* @template V
|
|
177
|
+
* @template {Key} K
|
|
178
|
+
* @template {Passable} V
|
|
195
179
|
* @typedef {ReturnType<typeof makeAtomicProvider<K, V>>} AtomicProvider<K, V>
|
|
196
180
|
*/
|
|
197
181
|
|
|
198
182
|
/**
|
|
199
|
-
* @template K
|
|
183
|
+
* @template {Key} K
|
|
184
|
+
* @template {Passable} V
|
|
200
185
|
* @param {MapStore<K, V[]>} mapStore
|
|
201
186
|
* @param {K} key
|
|
202
187
|
* @param {V} item
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Of the dimensions on which KeyedStores can
|
|
3
|
+
* differ, we only represent a few of them as standard options. A given store
|
|
4
|
+
* maker should document which options it supports, as well as its positions
|
|
5
|
+
* on dimensions for which it does not support options.
|
|
6
|
+
*/
|
|
7
|
+
export type StoreOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Which way to optimize a weak store. True
|
|
10
|
+
* means that we expect this weak store to outlive most of its keys, in which
|
|
11
|
+
* case we internally may use a JavaScript `WeakMap`. Otherwise we internally
|
|
12
|
+
* may use a JavaScript `Map`. Defaults to true, so please mark short lived
|
|
13
|
+
* stores explicitly.
|
|
14
|
+
*/
|
|
15
|
+
longLived?: boolean | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The contents of this store survive termination
|
|
18
|
+
* of its containing process, allowing for restart or upgrade but at the cost
|
|
19
|
+
* of forbidding storage of references to ephemeral data. Defaults to false.
|
|
20
|
+
*/
|
|
21
|
+
durable?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* This store pretends to be a durable store
|
|
24
|
+
* but does not enforce that the things stored in it actually be themselves
|
|
25
|
+
* durable (whereas an actual durable store would forbid storage of such
|
|
26
|
+
* items). This is in service of allowing incremental transition to use of
|
|
27
|
+
* durable stores, to enable normal operation and testing when some stuff
|
|
28
|
+
* intended to eventually be durable has not yet been made durable. A store
|
|
29
|
+
* marked as fakeDurable will appear to operate normally but any attempt to
|
|
30
|
+
* upgrade its containing vat will fail with an error. Defaults to false.
|
|
31
|
+
*/
|
|
32
|
+
fakeDurable?: boolean | undefined;
|
|
33
|
+
keyShape?: Pattern;
|
|
34
|
+
valueShape?: Pattern;
|
|
35
|
+
};
|
|
36
|
+
export type WeakSetStoreMethods<K> = {
|
|
37
|
+
/**
|
|
38
|
+
* Check if a key exists. The key can be any
|
|
39
|
+
* JavaScript value, though the answer will always be false for keys that
|
|
40
|
+
* cannot be found in this store.
|
|
41
|
+
*/
|
|
42
|
+
has: (key: K) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Add the key to the set if it is not already
|
|
45
|
+
* there. Do nothing silently if already there. The key must be one allowed by
|
|
46
|
+
* this store. For example a scalar store only allows primitives and
|
|
47
|
+
* remotables.
|
|
48
|
+
*/
|
|
49
|
+
add: (key: K) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Remove the key. Throws if not found.
|
|
52
|
+
*/
|
|
53
|
+
delete: (key: K) => void;
|
|
54
|
+
addAll: (keys: CopySet<any> | Iterable<K>) => void;
|
|
55
|
+
};
|
|
56
|
+
export type WeakSetStore<K> = RemotableObject & WeakSetStoreMethods<K>;
|
|
57
|
+
export type SetStoreMethods<K> = {
|
|
58
|
+
/**
|
|
59
|
+
* Check if a key exists. The key can be any
|
|
60
|
+
* JavaScript value, though the answer will always be false for keys that
|
|
61
|
+
* cannot be found in this store.
|
|
62
|
+
*/
|
|
63
|
+
has: (key: K) => boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Add the key to the set if it is not already
|
|
66
|
+
* there. Do nothing silently if already there. The key must be one allowed by
|
|
67
|
+
* this store. For example a scalar store only allows primitives and
|
|
68
|
+
* remotables.
|
|
69
|
+
*/
|
|
70
|
+
add: (key: K) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Remove the key. Throws if not found.
|
|
73
|
+
*/
|
|
74
|
+
delete: (key: K) => void;
|
|
75
|
+
addAll: (keys: CopySet<any> | Iterable<K>) => void;
|
|
76
|
+
keys: (keyPatt?: Pattern) => Iterable<K>;
|
|
77
|
+
values: (keyPatt?: Pattern) => Iterable<K>;
|
|
78
|
+
snapshot: (keyPatt?: Pattern) => CopySet<any>;
|
|
79
|
+
getSize: (keyPatt?: Pattern) => number;
|
|
80
|
+
clear: (keyPatt?: Pattern) => void;
|
|
81
|
+
};
|
|
82
|
+
export type SetStore<K> = RemotableObject & SetStoreMethods<K>;
|
|
83
|
+
export type WeakMapStore<K, V> = {
|
|
84
|
+
/**
|
|
85
|
+
* Check if a key exists. The key can be any
|
|
86
|
+
* JavaScript value, though the answer will always be false for keys that
|
|
87
|
+
* cannot be found in this store.
|
|
88
|
+
*/
|
|
89
|
+
has: (key: K) => boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Return a value for the key. Throws if not
|
|
92
|
+
* found.
|
|
93
|
+
*/
|
|
94
|
+
get: (key: K) => V;
|
|
95
|
+
/**
|
|
96
|
+
* Initialize the key only if it
|
|
97
|
+
* doesn't already exist. The key must be one allowed by this store. For
|
|
98
|
+
* example a scalar store only allows primitives and remotables.
|
|
99
|
+
*/
|
|
100
|
+
init: (key: K, value: V) => void;
|
|
101
|
+
/**
|
|
102
|
+
* Set the key. Throws if not found.
|
|
103
|
+
*/
|
|
104
|
+
set: (key: K, value: V) => void;
|
|
105
|
+
/**
|
|
106
|
+
* Remove the key. Throws if not found.
|
|
107
|
+
*/
|
|
108
|
+
delete: (key: K) => void;
|
|
109
|
+
addAll: (entries: CopyMap<any, any> | Iterable<[K, V]>) => void;
|
|
110
|
+
};
|
|
111
|
+
export type MapStoreMethods<K, V> = {
|
|
112
|
+
/**
|
|
113
|
+
* Check if a key exists. The key can be any
|
|
114
|
+
* JavaScript value, though the answer will always be false for keys that
|
|
115
|
+
* cannot be found in this map
|
|
116
|
+
*/
|
|
117
|
+
has: (key: K) => boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Return a value for the key. Throws if not
|
|
120
|
+
* found.
|
|
121
|
+
*/
|
|
122
|
+
get: (key: K) => V;
|
|
123
|
+
/**
|
|
124
|
+
* Initialize the key only if it
|
|
125
|
+
* doesn't already exist. The key must be one allowed by this store. For
|
|
126
|
+
* example a scalar store only allows primitives and remotables.
|
|
127
|
+
*/
|
|
128
|
+
init: (key: K, value: V) => void;
|
|
129
|
+
/**
|
|
130
|
+
* Set the key. Throws if not found.
|
|
131
|
+
*/
|
|
132
|
+
set: (key: K, value: V) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Remove the key. Throws if not found.
|
|
135
|
+
*/
|
|
136
|
+
delete: (key: K) => void;
|
|
137
|
+
addAll: (entries: CopyMap<any, Passable> | Iterable<[K, V]>) => void;
|
|
138
|
+
keys: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<K>;
|
|
139
|
+
values: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<V>;
|
|
140
|
+
entries: (keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<[K, V]>;
|
|
141
|
+
snapshot: (keyPatt?: Pattern, valuePatt?: Pattern) => CopyMap<any, Passable>;
|
|
142
|
+
getSize: (keyPatt?: Pattern, valuePatt?: Pattern) => number;
|
|
143
|
+
clear: (keyPatt?: Pattern, valuePatt?: Pattern) => void;
|
|
144
|
+
};
|
|
145
|
+
export type MapStore<K = any, V = any> = RemotableObject & MapStoreMethods<K, V>;
|
|
146
|
+
/**
|
|
147
|
+
* LegacyWeakMap is deprecated. Use WeakMapStore
|
|
148
|
+
* instead if possible.
|
|
149
|
+
*/
|
|
150
|
+
export type LegacyWeakMap<K, V> = {
|
|
151
|
+
/**
|
|
152
|
+
* Check if a key exists
|
|
153
|
+
*/
|
|
154
|
+
has: (key: K) => boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Return a value for the key. Throws if not
|
|
157
|
+
* found.
|
|
158
|
+
*/
|
|
159
|
+
get: (key: K) => V;
|
|
160
|
+
/**
|
|
161
|
+
* Initialize the key only if it
|
|
162
|
+
* doesn't already exist
|
|
163
|
+
*/
|
|
164
|
+
init: (key: K, value: V) => void;
|
|
165
|
+
/**
|
|
166
|
+
* Set the key. Throws if not found.
|
|
167
|
+
*/
|
|
168
|
+
set: (key: K, value: V) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Remove the key. Throws if not found.
|
|
171
|
+
*/
|
|
172
|
+
delete: (key: K) => void;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* LegacyMap is deprecated. Use MapStore instead if
|
|
176
|
+
* possible.
|
|
177
|
+
*/
|
|
178
|
+
export type LegacyMap<K, V> = {
|
|
179
|
+
/**
|
|
180
|
+
* Check if a key exists
|
|
181
|
+
*/
|
|
182
|
+
has: (key: K) => boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Return a value for the key. Throws if not
|
|
185
|
+
* found.
|
|
186
|
+
*/
|
|
187
|
+
get: (key: K) => V;
|
|
188
|
+
/**
|
|
189
|
+
* Initialize the key only if it
|
|
190
|
+
* doesn't already exist
|
|
191
|
+
*/
|
|
192
|
+
init: (key: K, value: V) => void;
|
|
193
|
+
/**
|
|
194
|
+
* Set the key. Throws if not found.
|
|
195
|
+
*/
|
|
196
|
+
set: (key: K, value: V) => void;
|
|
197
|
+
/**
|
|
198
|
+
* Remove the key. Throws if not found.
|
|
199
|
+
*/
|
|
200
|
+
delete: (key: K) => void;
|
|
201
|
+
keys: () => Iterable<K>;
|
|
202
|
+
values: () => Iterable<V>;
|
|
203
|
+
entries: () => Iterable<[K, V]>;
|
|
204
|
+
getSize: () => number;
|
|
205
|
+
clear: () => void;
|
|
206
|
+
};
|
|
207
|
+
import type { Pattern } from '@endo/patterns';
|
|
208
|
+
import type { CopySet } from '@endo/patterns';
|
|
209
|
+
import type { RemotableObject } from '@endo/pass-style';
|
|
210
|
+
import type { CopyMap } from '@endo/patterns';
|
|
211
|
+
import type { Passable } from '@endo/pass-style';
|
|
212
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAkCc,OAAO;iBACP,OAAO;;gCAkBR,CAAC;;;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