@ember-data/model 4.12.8 → 4.13.0-alpha.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/README.md +19 -0
- package/addon-main.cjs +5 -0
- package/blueprints/model/index.js +18 -5
- package/blueprints/model-test/index.js +16 -10
- package/blueprints/model-test/qunit-files/__root__/__path__/__test__.js +4 -5
- package/dist/-private.js +2 -0
- package/dist/-private.js.map +1 -0
- package/dist/has-many-CshPdrqR.js +842 -0
- package/dist/has-many-CshPdrqR.js.map +1 -0
- package/dist/hooks-DCYCaSEL.js +75 -0
- package/dist/hooks-DCYCaSEL.js.map +1 -0
- package/dist/hooks.js +2 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.js +4 -0
- package/{addon → dist}/index.js.map +1 -1
- package/{addon/has-many-d45aa09e.js → dist/legacy-relationships-support-D5m0xTYg.js} +5532 -5533
- package/dist/legacy-relationships-support-D5m0xTYg.js.map +1 -0
- package/dist/migration-support.js +210 -0
- package/dist/migration-support.js.map +1 -0
- package/dist/schema-provider-m94yB7iS.js +294 -0
- package/dist/schema-provider-m94yB7iS.js.map +1 -0
- package/ember-data-logo-dark.svg +12 -0
- package/ember-data-logo-light.svg +12 -0
- package/package.json +78 -44
- package/unstable-preview-types/-private/attr.d.ts +175 -0
- package/unstable-preview-types/-private/attr.d.ts.map +1 -0
- package/unstable-preview-types/-private/attr.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/attr.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/belongs-to.d.ts +180 -0
- package/unstable-preview-types/-private/belongs-to.d.ts.map +1 -0
- package/unstable-preview-types/-private/belongs-to.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/belongs-to.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts +8 -0
- package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts.map +1 -0
- package/unstable-preview-types/-private/deprecated-promise-proxy.d.ts +5 -0
- package/unstable-preview-types/-private/deprecated-promise-proxy.d.ts.map +1 -0
- package/unstable-preview-types/-private/errors.d.ts +303 -0
- package/unstable-preview-types/-private/errors.d.ts.map +1 -0
- package/unstable-preview-types/-private/has-many.d.ts +169 -0
- package/unstable-preview-types/-private/has-many.d.ts.map +1 -0
- package/unstable-preview-types/-private/has-many.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/has-many.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/hooks.d.ts +13 -0
- package/unstable-preview-types/-private/hooks.d.ts.map +1 -0
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts +60 -0
- package/unstable-preview-types/-private/legacy-relationships-support.d.ts.map +1 -0
- package/unstable-preview-types/-private/many-array.d.ts +196 -0
- package/unstable-preview-types/-private/many-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/model-for-mixin.d.ts +6 -0
- package/unstable-preview-types/-private/model-for-mixin.d.ts.map +1 -0
- package/unstable-preview-types/-private/model-methods.d.ts +37 -0
- package/unstable-preview-types/-private/model-methods.d.ts.map +1 -0
- package/unstable-preview-types/-private/model.d.ts +1305 -0
- package/unstable-preview-types/-private/model.d.ts.map +1 -0
- package/unstable-preview-types/-private/model.type-test.d.ts +4 -0
- package/unstable-preview-types/-private/model.type-test.d.ts.map +1 -0
- package/unstable-preview-types/-private/notify-changes.d.ts +8 -0
- package/unstable-preview-types/-private/notify-changes.d.ts.map +1 -0
- package/unstable-preview-types/-private/promise-belongs-to.d.ts +46 -0
- package/unstable-preview-types/-private/promise-belongs-to.d.ts.map +1 -0
- package/unstable-preview-types/-private/promise-many-array.d.ts +130 -0
- package/unstable-preview-types/-private/promise-many-array.d.ts.map +1 -0
- package/unstable-preview-types/-private/record-state.d.ts +90 -0
- package/unstable-preview-types/-private/record-state.d.ts.map +1 -0
- package/unstable-preview-types/-private/references/belongs-to.d.ts +503 -0
- package/unstable-preview-types/-private/references/belongs-to.d.ts.map +1 -0
- package/unstable-preview-types/-private/references/has-many.d.ts +515 -0
- package/unstable-preview-types/-private/references/has-many.d.ts.map +1 -0
- package/unstable-preview-types/-private/relationship-meta.d.ts +35 -0
- package/unstable-preview-types/-private/relationship-meta.d.ts.map +1 -0
- package/unstable-preview-types/-private/schema-provider.d.ts +64 -0
- package/unstable-preview-types/-private/schema-provider.d.ts.map +1 -0
- package/unstable-preview-types/-private/type-utils.d.ts +64 -0
- package/unstable-preview-types/-private/type-utils.d.ts.map +1 -0
- package/unstable-preview-types/-private/util.d.ts +8 -0
- package/unstable-preview-types/-private/util.d.ts.map +1 -0
- package/unstable-preview-types/-private.d.ts +13 -0
- package/unstable-preview-types/-private.d.ts.map +1 -0
- package/unstable-preview-types/hooks.d.ts +5 -0
- package/unstable-preview-types/hooks.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +78 -0
- package/unstable-preview-types/index.d.ts.map +1 -0
- package/unstable-preview-types/migration-support.d.ts +56 -0
- package/unstable-preview-types/migration-support.d.ts.map +1 -0
- package/addon/-private.js +0 -95
- package/addon/-private.js.map +0 -1
- package/addon/has-many-d45aa09e.js.map +0 -1
- package/addon/index.js +0 -1
- package/addon-main.js +0 -93
- package/blueprints/model-test/mocha-files/__root__/__path__/__test__.js +0 -18
- package/blueprints/model-test/mocha-rfc-232-files/__root__/__path__/__test__.js +0 -15
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
declare module '@ember-data/model/-private/many-array' {
|
|
2
|
+
import type Store from '@ember-data/store';
|
|
3
|
+
import type { CreateRecordProperties, NativeProxy } from '@ember-data/store/-private';
|
|
4
|
+
import { LiveArray, MUTATE } from '@ember-data/store/-private';
|
|
5
|
+
import type { BaseFinderOptions, ModelSchema } from '@ember-data/store/types';
|
|
6
|
+
import type { Signal } from '@ember-data/tracking/-private';
|
|
7
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
8
|
+
import type { Cache } from '@warp-drive/core-types/cache';
|
|
9
|
+
import type { TypedRecordInstance, TypeFromInstance, TypeFromInstanceOrString } from '@warp-drive/core-types/record';
|
|
10
|
+
import type { Links, PaginationLinks } from '@warp-drive/core-types/spec/json-api-raw';
|
|
11
|
+
import type { LegacySupport } from '@ember-data/model/-private/legacy-relationships-support';
|
|
12
|
+
export interface ManyArrayCreateArgs<T> {
|
|
13
|
+
identifiers: StableRecordIdentifier<TypeFromInstanceOrString<T>>[];
|
|
14
|
+
type: TypeFromInstanceOrString<T>;
|
|
15
|
+
store: Store;
|
|
16
|
+
allowMutation: boolean;
|
|
17
|
+
manager: LegacySupport;
|
|
18
|
+
identifier: StableRecordIdentifier;
|
|
19
|
+
cache: Cache;
|
|
20
|
+
meta: Record<string, unknown> | null;
|
|
21
|
+
links: Links | PaginationLinks | null;
|
|
22
|
+
key: string;
|
|
23
|
+
isPolymorphic: boolean;
|
|
24
|
+
isAsync: boolean;
|
|
25
|
+
_inverseIsAsync: boolean;
|
|
26
|
+
isLoaded: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
A `ManyArray` is a `MutableArray` that represents the contents of a has-many
|
|
30
|
+
relationship.
|
|
31
|
+
|
|
32
|
+
The `ManyArray` is instantiated lazily the first time the relationship is
|
|
33
|
+
requested.
|
|
34
|
+
|
|
35
|
+
This class is not intended to be directly instantiated by consuming applications.
|
|
36
|
+
|
|
37
|
+
### Inverses
|
|
38
|
+
|
|
39
|
+
Often, the relationships in Ember Data applications will have
|
|
40
|
+
an inverse. For example, imagine the following models are
|
|
41
|
+
defined:
|
|
42
|
+
|
|
43
|
+
```app/models/post.js
|
|
44
|
+
import Model, { hasMany } from '@ember-data/model';
|
|
45
|
+
|
|
46
|
+
export default class PostModel extends Model {
|
|
47
|
+
@hasMany('comment') comments;
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```app/models/comment.js
|
|
52
|
+
import Model, { belongsTo } from '@ember-data/model';
|
|
53
|
+
|
|
54
|
+
export default class CommentModel extends Model {
|
|
55
|
+
@belongsTo('post') post;
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
If you created a new instance of `Post` and added
|
|
60
|
+
a `Comment` record to its `comments` has-many
|
|
61
|
+
relationship, you would expect the comment's `post`
|
|
62
|
+
property to be set to the post that contained
|
|
63
|
+
the has-many.
|
|
64
|
+
|
|
65
|
+
We call the record to which a relationship belongs-to the
|
|
66
|
+
relationship's _owner_.
|
|
67
|
+
|
|
68
|
+
@class ManyArray
|
|
69
|
+
@public
|
|
70
|
+
*/
|
|
71
|
+
export class RelatedCollection<T = unknown> extends LiveArray<T> {
|
|
72
|
+
isAsync: boolean;
|
|
73
|
+
/**
|
|
74
|
+
The loading state of this array
|
|
75
|
+
|
|
76
|
+
@property {Boolean} isLoaded
|
|
77
|
+
@public
|
|
78
|
+
*/
|
|
79
|
+
isLoaded: boolean;
|
|
80
|
+
/**
|
|
81
|
+
`true` if the relationship is polymorphic, `false` otherwise.
|
|
82
|
+
|
|
83
|
+
@property {Boolean} isPolymorphic
|
|
84
|
+
@private
|
|
85
|
+
*/
|
|
86
|
+
isPolymorphic: boolean;
|
|
87
|
+
_inverseIsAsync: boolean;
|
|
88
|
+
/**
|
|
89
|
+
Metadata associated with the request for async hasMany relationships.
|
|
90
|
+
|
|
91
|
+
Example
|
|
92
|
+
|
|
93
|
+
Given that the server returns the following JSON payload when fetching a
|
|
94
|
+
hasMany relationship:
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
{
|
|
98
|
+
"comments": [{
|
|
99
|
+
"id": 1,
|
|
100
|
+
"comment": "This is the first comment",
|
|
101
|
+
}, {
|
|
102
|
+
// ...
|
|
103
|
+
}],
|
|
104
|
+
|
|
105
|
+
"meta": {
|
|
106
|
+
"page": 1,
|
|
107
|
+
"total": 5
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
You can then access the meta data via the `meta` property:
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
let comments = await post.comments;
|
|
116
|
+
let meta = comments.meta;
|
|
117
|
+
|
|
118
|
+
// meta.page => 1
|
|
119
|
+
// meta.total => 5
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
@property {Object | null} meta
|
|
123
|
+
@public
|
|
124
|
+
*/
|
|
125
|
+
meta: Record<string, unknown> | null;
|
|
126
|
+
/**
|
|
127
|
+
* Retrieve the links for this relationship
|
|
128
|
+
*
|
|
129
|
+
@property {Object | null} links
|
|
130
|
+
@public
|
|
131
|
+
*/
|
|
132
|
+
links: Links | PaginationLinks | null;
|
|
133
|
+
identifier: StableRecordIdentifier;
|
|
134
|
+
cache: Cache;
|
|
135
|
+
_manager: LegacySupport;
|
|
136
|
+
store: Store;
|
|
137
|
+
key: string;
|
|
138
|
+
type: ModelSchema;
|
|
139
|
+
modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
|
|
140
|
+
constructor(options: ManyArrayCreateArgs<T>);
|
|
141
|
+
[MUTATE](target: StableRecordIdentifier[], receiver: typeof NativeProxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
|
|
142
|
+
notify(): void;
|
|
143
|
+
/**
|
|
144
|
+
Reloads all of the records in the manyArray. If the manyArray
|
|
145
|
+
holds a relationship that was originally fetched using a links url
|
|
146
|
+
EmberData will revisit the original links url to repopulate the
|
|
147
|
+
relationship.
|
|
148
|
+
|
|
149
|
+
If the ManyArray holds the result of a `store.query()` reload will
|
|
150
|
+
re-run the original query.
|
|
151
|
+
|
|
152
|
+
Example
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
let user = store.peekRecord('user', '1')
|
|
156
|
+
await login(user);
|
|
157
|
+
|
|
158
|
+
let permissions = await user.permissions;
|
|
159
|
+
await permissions.reload();
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
@method reload
|
|
163
|
+
@public
|
|
164
|
+
*/
|
|
165
|
+
reload(options?: BaseFinderOptions): Promise<this>;
|
|
166
|
+
/**
|
|
167
|
+
Saves all of the records in the `ManyArray`.
|
|
168
|
+
|
|
169
|
+
Example
|
|
170
|
+
|
|
171
|
+
```javascript
|
|
172
|
+
let inbox = await store.findRecord('inbox', '1');
|
|
173
|
+
let messages = await inbox.messages;
|
|
174
|
+
messages.forEach((message) => {
|
|
175
|
+
message.isRead = true;
|
|
176
|
+
});
|
|
177
|
+
messages.save();
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
@method save
|
|
181
|
+
@public
|
|
182
|
+
@return {PromiseArray} promise
|
|
183
|
+
*/
|
|
184
|
+
/**
|
|
185
|
+
Create a child record within the owner
|
|
186
|
+
|
|
187
|
+
@method createRecord
|
|
188
|
+
@public
|
|
189
|
+
@param {Object} hash
|
|
190
|
+
@return {Model} record
|
|
191
|
+
*/
|
|
192
|
+
createRecord(hash: CreateRecordProperties<T>): T;
|
|
193
|
+
destroy(): void;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=many-array.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"many-array.d.ts","sourceRoot":"","sources":["../../src/-private/many-array.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAGL,SAAS,EACT,MAAM,EAIP,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAQ5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAEV,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE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C;IACnC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,CAAC,SAAS,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;gBAEpE,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAS3C,CAAC,MAAM,CAAC,CACN,MAAM,EAAE,sBAAsB,EAAE,EAChC,QAAQ,EAAE,OAAO,WAAW,CAAC,sBAAsB,EAAE,EAAE,CAAC,EAAE,CAAC,EAC3D,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,GACd,OAAO;IA6MV,MAAM;IAMN;;;;;;;;;;;;;;;;;;;;;MAqBE;IACF,MAAM,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD;;;;;;;;;;;;;;;;;MAiBE;IAEF;;;;;;;MAOE;IACF,YAAY,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,CAAC;IAShD,OAAO;CAGR"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare module '@ember-data/model/-private/model-for-mixin' {
|
|
2
|
+
import type Store from '@ember-data/store';
|
|
3
|
+
import { type ModelFactory } from '@ember-data/model/-private/model';
|
|
4
|
+
export default function modelForMixin(store: Store, normalizedModelName: string): ModelFactory | undefined;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=model-for-mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-for-mixin.d.ts","sourceRoot":"","sources":["../../src/-private/model-for-mixin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAkBnD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAYzG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare module '@ember-data/model/-private/model-methods' {
|
|
2
|
+
import type { Snapshot } from '@ember-data/legacy-compat/-private';
|
|
3
|
+
import type Store from '@ember-data/store';
|
|
4
|
+
import type { ChangedAttributesHash } from '@warp-drive/core-types/cache';
|
|
5
|
+
import { RecordStore } from '@warp-drive/core-types/symbols';
|
|
6
|
+
import type { Errors } from '@ember-data/model/-private/errors';
|
|
7
|
+
import type RecordState from '@ember-data/model/-private/record-state';
|
|
8
|
+
import type BelongsToReference from '@ember-data/model/-private/references/belongs-to';
|
|
9
|
+
import type HasManyReference from '@ember-data/model/-private/references/has-many';
|
|
10
|
+
import type { MaybeBelongsToFields, MaybeHasManyFields } from '@ember-data/model/-private/type-utils';
|
|
11
|
+
export interface MinimalLegacyRecord {
|
|
12
|
+
errors: Errors;
|
|
13
|
+
___recordState: RecordState;
|
|
14
|
+
currentState: RecordState;
|
|
15
|
+
isDestroyed: boolean;
|
|
16
|
+
isDestroying: boolean;
|
|
17
|
+
isReloading: boolean;
|
|
18
|
+
isValid: boolean;
|
|
19
|
+
[RecordStore]: Store;
|
|
20
|
+
deleteRecord(): void;
|
|
21
|
+
unloadRecord(): void;
|
|
22
|
+
save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<this>;
|
|
23
|
+
destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<this>;
|
|
24
|
+
}
|
|
25
|
+
export function rollbackAttributes<T extends MinimalLegacyRecord>(this: T): void;
|
|
26
|
+
export function unloadRecord<T extends MinimalLegacyRecord>(this: T): void;
|
|
27
|
+
export function belongsTo<T extends MinimalLegacyRecord, K extends MaybeBelongsToFields<T>>(this: T, prop: K): BelongsToReference<T, K>;
|
|
28
|
+
export function hasMany<T extends MinimalLegacyRecord, K extends MaybeHasManyFields<T>>(this: T, prop: K): HasManyReference<T, K>;
|
|
29
|
+
export function reload<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
|
|
30
|
+
export function changedAttributes<T extends MinimalLegacyRecord>(this: T): ChangedAttributesHash;
|
|
31
|
+
export function serialize<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): unknown;
|
|
32
|
+
export function deleteRecord<T extends MinimalLegacyRecord>(this: T): void;
|
|
33
|
+
export function save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
|
|
34
|
+
export function destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
|
|
35
|
+
export function createSnapshot<T extends MinimalLegacyRecord>(this: T): Snapshot<T>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=model-methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-methods.d.ts","sourceRoot":"","sources":["../../src/-private/model-methods.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAK3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE7E,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC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