@etrepum/lexical-builder-core 0.0.28-nightly.20240708.0 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/definePlan.d.ts +5 -4
- package/dist/definePlan.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -6
- package/dist/internal.d.ts.map +1 -1
- package/dist/shallowMergeConfig.d.ts +2 -2
- package/dist/types.d.ts +42 -30
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/definePlan.d.ts
CHANGED
@@ -5,7 +5,7 @@ import { AnyLexicalPlan, LexicalPlan, LexicalPlanConfig, NormalizedLexicalPlanAr
|
|
5
5
|
* infer Config and Name in most cases, but you may want to use
|
6
6
|
* {@link safeCast} for config if there are default fields or varying types.
|
7
7
|
*
|
8
|
-
* @param plan The LexicalPlan
|
8
|
+
* @param plan - The LexicalPlan
|
9
9
|
* @returns The unmodified plan argument (this is only an inference helper)
|
10
10
|
*
|
11
11
|
* @example Basic example
|
@@ -42,7 +42,7 @@ export declare function definePlan<Config extends PlanConfigBase, Name extends s
|
|
42
42
|
* plan.mergeConfig(plan, config) or {@link shallowMergeConfig} if
|
43
43
|
* this is not directly implemented by the Plan.
|
44
44
|
*
|
45
|
-
* @param args A plan followed by one or more config partials for that plan
|
45
|
+
* @param args - A plan followed by one or more config partials for that plan
|
46
46
|
* @returns [plan, config, ...configs]
|
47
47
|
*
|
48
48
|
* @example
|
@@ -112,8 +112,8 @@ export declare const OutputTypeId: unique symbol;
|
|
112
112
|
* is to avoid a direct import dependency, so you would want to use a
|
113
113
|
* type import or the import type (shown in below examples).
|
114
114
|
*
|
115
|
-
* @param name The plan's name
|
116
|
-
* @param config An optional config override
|
115
|
+
* @param name - The plan's name
|
116
|
+
* @param config - An optional config override
|
117
117
|
* @returns NormalizedPeerDependency
|
118
118
|
*
|
119
119
|
* @example
|
@@ -125,6 +125,7 @@ export declare const OutputTypeId: unique symbol;
|
|
125
125
|
* declarePeerDependency<typeof import("bar").BarPlan>("bar", {config: "bar"}),
|
126
126
|
* ],
|
127
127
|
* });
|
128
|
+
* ```
|
128
129
|
*/
|
129
130
|
export declare function declarePeerDependency<Plan extends AnyLexicalPlan = never>(name: Plan["name"], config?: Partial<LexicalPlanConfig<Plan>>): NormalizedPeerDependency<Plan>;
|
130
131
|
//# sourceMappingURL=definePlan.d.ts.map
|
package/dist/definePlan.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"definePlan.d.ts","sourceRoot":"","sources":["../src/definePlan.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,EACd,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,UAAU,CACxB,MAAM,SAAS,cAAc,EAC7B,IAAI,SAAS,MAAM,EACnB,MAAM,EACN,IAAI,EAEJ,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,GAC5C,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAEzC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,UAAU,CACxB,MAAM,SAAS,cAAc,EAC7B,IAAI,SAAS,MAAM,EACnB,MAAM,EACN,IAAI,EAEJ,GAAG,IAAI,EAAE,6BAA6B,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,GACjE,6BAA6B,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAE3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAClC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE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;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,SAAS,cAAc,GAAG,KAAK,EACvE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAClB,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,GACxC,wBAAwB,CAAC,IAAI,CAAC,CAEhC"}
|
package/dist/index.d.ts
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
*/
|
8
8
|
export declare const PACKAGE_VERSION: string;
|
9
9
|
export { configPlan, definePlan, provideOutput, declarePeerDependency, } from './definePlan';
|
10
|
-
export { type AnyLexicalPlan, type AnyLexicalPlanArgument, type LexicalEditorWithDispose, type InitialEditorConfig, type InitialEditorStateType, type LexicalPlan, type LexicalPlanArgument, type LexicalPlanConfig, type LexicalPlanInit, type LexicalPlanName, type LexicalPlanOutput, type OutputComponentPlan, type LexicalPlanDependency, type NormalizedLexicalPlanArgument, type PlanConfigBase, type
|
10
|
+
export { type AnyLexicalPlan, type AnyLexicalPlanArgument, type LexicalEditorWithDispose, type InitialEditorConfig, type InitialEditorStateType, type LexicalPlan, type LexicalPlanArgument, type LexicalPlanConfig, type LexicalPlanInit, type LexicalPlanName, type LexicalPlanOutput, type OutputComponentPlan, type LexicalPlanDependency, type PlanRegisterState as NormalizedLexicalPlanArgument, type PlanConfigBase, type PlanInitState, type PlanRegisterState, type RegisterCleanup, type NormalizedPeerDependency, } from './types';
|
11
11
|
export { type LexicalPlanInternal, type initTypeSymbol, type configTypeSymbol, type outputTypeSymbol, } from './internal';
|
12
12
|
export { safeCast } from './safeCast';
|
13
13
|
export { shallowMergeConfig } from './shallowMergeConfig';
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,OAAO,EACL,UAAU,EACV,UAAU,EACV,aAAa,EACb,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,IAAI,6BAA6B,EACvD,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,wBAAwB,GAC9B,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
@@ -5,15 +5,20 @@ function r(...n) {
|
|
5
5
|
return n;
|
6
6
|
}
|
7
7
|
function f(n, t) {
|
8
|
-
return Object.assign(
|
8
|
+
return Object.assign(
|
9
|
+
() => {
|
10
|
+
t && t();
|
11
|
+
},
|
12
|
+
{ output: n }
|
13
|
+
);
|
9
14
|
}
|
10
15
|
function c(n, t) {
|
11
16
|
return [n, t];
|
12
17
|
}
|
13
|
-
function
|
18
|
+
function a(n) {
|
14
19
|
return n;
|
15
20
|
}
|
16
|
-
function
|
21
|
+
function i(n, t) {
|
17
22
|
if (!t || n === t)
|
18
23
|
return n;
|
19
24
|
for (const u in t)
|
@@ -21,13 +26,13 @@ function a(n, t) {
|
|
21
26
|
return { ...n, ...t };
|
22
27
|
return n;
|
23
28
|
}
|
24
|
-
const o = "0.0.28
|
29
|
+
const o = "0.0.28";
|
25
30
|
export {
|
26
31
|
o as PACKAGE_VERSION,
|
27
32
|
r as configPlan,
|
28
33
|
c as declarePeerDependency,
|
29
34
|
e as definePlan,
|
30
35
|
f as provideOutput,
|
31
|
-
|
32
|
-
|
36
|
+
a as safeCast,
|
37
|
+
i as shallowMergeConfig
|
33
38
|
};
|
package/dist/internal.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AACA,gBAAgB;AAChB,MAAM,CAAC,OAAO,CAAC,MAAM,oBAAoB,EAAE,OAAO,MAAM,CAAC;AACzD,gBAAgB;AAChB,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC;AAC/D,gBAAgB;AAChB,MAAM,CAAC,OAAO,CAAC,MAAM,gBAAgB,EAAE,OAAO,MAAM,CAAC;AACrD,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC;AACvD,gBAAgB;AAChB,MAAM,CAAC,OAAO,CAAC,MAAM,gBAAgB,EAAE,OAAO,MAAM,CAAC;AACrD,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC;AACvD,gBAAgB;AAChB,MAAM,CAAC,OAAO,CAAC,MAAM,cAAc,EAAE,OAAO,MAAM,CAAC;AACnD,gBAAgB;AAChB,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AAEnD,gBAAgB;AAChB,MAAM,WAAW,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;IACnE,gBAAgB;IAChB,QAAQ,CAAC,CAAC,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC;IACrC,gBAAgB;IAChB,QAAQ,CAAC,CAAC,gBAAgB,CAAC,CAAC,EAAE,MAAM,CAAC;IACrC,gBAAgB;IAChB,QAAQ,CAAC,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,CAAC;CAClC"}
|
@@ -3,8 +3,8 @@ import { PlanConfigBase } from './types';
|
|
3
3
|
/**
|
4
4
|
* The default merge strategy for plan configuration is a shallow merge.
|
5
5
|
*
|
6
|
-
* @param config A full config
|
7
|
-
* @param overrides A partial config of overrides
|
6
|
+
* @param config - A full config
|
7
|
+
* @param overrides - A partial config of overrides
|
8
8
|
* @returns config if there are no overrides, otherwise `{...config, ...overrides}`
|
9
9
|
*/
|
10
10
|
export declare function shallowMergeConfig<T extends PlanConfigBase>(config: T, overrides?: Partial<T>): T;
|
package/dist/types.d.ts
CHANGED
@@ -20,50 +20,62 @@ export type NormalizedPeerDependency<Plan extends AnyLexicalPlan> = [
|
|
20
20
|
readonly [peerDependencySymbol]: Plan;
|
21
21
|
};
|
22
22
|
/**
|
23
|
-
* A tuple of [plan,
|
23
|
+
* A tuple of [plan, ...configOverrides]
|
24
24
|
*/
|
25
|
-
export type NormalizedLexicalPlanArgument<in out Config extends PlanConfigBase, out Name extends string, in out Output
|
26
|
-
LexicalPlan<Config, Name, Output, Init>,
|
27
|
-
Partial<Config>,
|
28
|
-
...Partial<Config>[]
|
29
|
-
];
|
25
|
+
export type NormalizedLexicalPlanArgument<in out Config extends PlanConfigBase, out Name extends string, in out Output, in out Init> = [LexicalPlan<Config, Name, Output, Init>, ...Partial<Config>[]];
|
30
26
|
/**
|
31
27
|
* An object that the register method can use to detect unmount and access the
|
32
28
|
* configuration for plan dependencies
|
33
29
|
*/
|
34
|
-
export interface
|
30
|
+
export interface PlanInitState {
|
35
31
|
/** An AbortSignal that is aborted when the LexicalEditor is disposed */
|
36
32
|
signal: AbortSignal;
|
37
33
|
/**
|
38
34
|
* Get the result of a peerDependency by name, if it exists
|
39
35
|
* (must be a peerDependency of this plan)
|
40
36
|
*/
|
41
|
-
getPeer<Dependency extends AnyLexicalPlan = never>(name: Dependency["name"])
|
37
|
+
getPeer: <Dependency extends AnyLexicalPlan = never>(name: Dependency["name"]) => undefined | Omit<LexicalPlanDependency<Dependency>, "output">;
|
42
38
|
/**
|
43
39
|
* Get the configuration of a dependency by plan
|
44
40
|
* (must be a direct dependency of this plan)
|
45
41
|
*/
|
46
|
-
getDependency<Dependency extends AnyLexicalPlan>(dep: Dependency)
|
42
|
+
getDependency: <Dependency extends AnyLexicalPlan>(dep: Dependency) => Omit<LexicalPlanDependency<Dependency>, "output">;
|
47
43
|
/**
|
48
44
|
* Get the names of any direct dependents of this
|
49
45
|
* Plan, typically only used for error messages.
|
50
46
|
*/
|
51
|
-
getDirectDependentNames()
|
47
|
+
getDirectDependentNames: () => ReadonlySet<string>;
|
52
48
|
/**
|
53
49
|
* Get the names of all peer dependencies of this
|
54
50
|
* Plan, even if they do not exist in the builder,
|
55
51
|
* typically only used for devtools.
|
56
52
|
*/
|
57
|
-
getPeerNameSet()
|
53
|
+
getPeerNameSet: () => ReadonlySet<string>;
|
54
|
+
}
|
55
|
+
/**
|
56
|
+
* An object that the register method can use to detect unmount and access the
|
57
|
+
* configuration for plan dependencies
|
58
|
+
*/
|
59
|
+
export interface PlanRegisterState<Init> extends Omit<PlanInitState, "getPeer" | "getDependency"> {
|
60
|
+
/**
|
61
|
+
* Get the result of a peerDependency by name, if it exists
|
62
|
+
* (must be a peerDependency of this plan)
|
63
|
+
*/
|
64
|
+
getPeer: <Dependency extends AnyLexicalPlan = never>(name: Dependency["name"]) => undefined | LexicalPlanDependency<Dependency>;
|
65
|
+
/**
|
66
|
+
* Get the configuration of a dependency by plan
|
67
|
+
* (must be a direct dependency of this plan)
|
68
|
+
*/
|
69
|
+
getDependency: <Dependency extends AnyLexicalPlan>(dep: Dependency) => LexicalPlanDependency<Dependency>;
|
58
70
|
/**
|
59
71
|
* The result of the init function
|
60
72
|
*/
|
61
|
-
getInitResult()
|
73
|
+
getInitResult: () => Init;
|
62
74
|
}
|
63
75
|
/**
|
64
76
|
* A {@link LexicalPlan} or {@link NormalizedLexicalPlanArgument} (plan with config overrides)
|
65
77
|
*/
|
66
|
-
export type LexicalPlanArgument<Config extends PlanConfigBase, Name extends string, Output
|
78
|
+
export type LexicalPlanArgument<Config extends PlanConfigBase, Name extends string, Output, Init> = LexicalPlan<Config, Name, Output, Init> | NormalizedLexicalPlanArgument<Config, Name, Output, Init>;
|
67
79
|
export interface LexicalPlanDependency<out Dependency extends AnyLexicalPlan> {
|
68
80
|
config: LexicalPlanConfig<Dependency>;
|
69
81
|
output: LexicalPlanOutput<Dependency>;
|
@@ -81,7 +93,7 @@ export type RegisterCleanup<Output> = (() => void) & (unknown extends Output ? {
|
|
81
93
|
* A Plan may depend on other Plans, and provide functionality to other
|
82
94
|
* plans through its config.
|
83
95
|
*/
|
84
|
-
export interface LexicalPlan<in out Config extends PlanConfigBase, out Name extends string, in out Output
|
96
|
+
export interface LexicalPlan<in out Config extends PlanConfigBase, out Name extends string, in out Output, in out Init> extends InitialEditorConfig, LexicalPlanInternal<Config, Output, Init> {
|
85
97
|
/** The name of the Plan, must be unique */
|
86
98
|
readonly name: Name;
|
87
99
|
/** Plan names that must not be loaded with this Plan */
|
@@ -120,8 +132,8 @@ export interface LexicalPlan<in out Config extends PlanConfigBase, out Name exte
|
|
120
132
|
* });
|
121
133
|
* ```
|
122
134
|
*
|
123
|
-
* @param config The current configuration
|
124
|
-
* @param overrides The partial configuration to merge
|
135
|
+
* @param config - The current configuration
|
136
|
+
* @param overrides - The partial configuration to merge
|
125
137
|
* @returns The merged configuration
|
126
138
|
*/
|
127
139
|
mergeConfig?: (config: Config, overrides: Partial<Config>) => Config;
|
@@ -131,39 +143,39 @@ export interface LexicalPlan<in out Config extends PlanConfigBase, out Name exte
|
|
131
143
|
* this plan have been merged. May be used validate the editor
|
132
144
|
* configuration.
|
133
145
|
*
|
134
|
-
* @param editorConfig The in-progress editor configuration (mutable)
|
135
|
-
* @param config The merged configuration specific to this plan (mutable)
|
136
|
-
* @param state An object containing an AbortSignal that can be
|
146
|
+
* @param editorConfig - The in-progress editor configuration (mutable)
|
147
|
+
* @param config - The merged configuration specific to this plan (mutable)
|
148
|
+
* @param state - An object containing an AbortSignal that can be
|
137
149
|
* used, and methods for accessing the merged configuration of
|
138
150
|
* dependencies and peerDependencies
|
139
151
|
*/
|
140
|
-
init?: (editorConfig: InitialEditorConfig, config: Config, state:
|
152
|
+
init?: (editorConfig: InitialEditorConfig, config: Config, state: PlanInitState) => Init;
|
141
153
|
/**
|
142
154
|
* Add behavior to the editor (register transforms, listeners, etc.) after
|
143
155
|
* the Editor is created, but before its initial state is set.
|
144
156
|
* The register function may also mutate the config
|
145
157
|
* in-place to expose data to other plans that use it as a dependency.
|
146
158
|
*
|
147
|
-
* @param editor The editor this Plan is being registered with
|
148
|
-
* @param config The merged configuration specific to this Plan
|
149
|
-
* @param state An object containing an AbortSignal that can be
|
159
|
+
* @param editor - The editor this Plan is being registered with
|
160
|
+
* @param config - The merged configuration specific to this Plan
|
161
|
+
* @param state - An object containing an AbortSignal that can be
|
150
162
|
* used, and methods for accessing the merged configuration of
|
151
163
|
* dependencies and peerDependencies
|
152
164
|
* @returns A clean-up function
|
153
165
|
*/
|
154
|
-
register?: (editor: LexicalEditor, config: Config, state:
|
166
|
+
register?: (editor: LexicalEditor, config: Config, state: PlanRegisterState<Init>) => RegisterCleanup<Output>;
|
155
167
|
/**
|
156
168
|
* Run any code that must happen after initialization of the
|
157
169
|
* editor state (which happens after all register calls).
|
158
170
|
*
|
159
|
-
* @param editor The editor this Plan is being registered with
|
160
|
-
* @param config The merged configuration specific to this Plan
|
161
|
-
* @param state An object containing an AbortSignal that can be
|
171
|
+
* @param editor - The editor this Plan is being registered with
|
172
|
+
* @param config - The merged configuration specific to this Plan
|
173
|
+
* @param state - An object containing an AbortSignal that can be
|
162
174
|
* used, and methods for accessing the merged configuration of
|
163
175
|
* dependencies and peerDependencies
|
164
176
|
* @returns A clean-up function
|
165
177
|
*/
|
166
|
-
afterInitialization?: (editor: LexicalEditor, config: Config, state:
|
178
|
+
afterInitialization?: (editor: LexicalEditor, config: Config, state: PlanRegisterState<Init>) => () => void;
|
167
179
|
}
|
168
180
|
/**
|
169
181
|
* Extract the Config type from a Plan
|
@@ -243,8 +255,8 @@ export interface InitialEditorConfig {
|
|
243
255
|
* reconciliation and call this. It defaults to
|
244
256
|
* `(error) => { throw error }`.
|
245
257
|
*
|
246
|
-
* @param error The Error object
|
247
|
-
* @param editor The editor that this error came from
|
258
|
+
* @param error - The Error object
|
259
|
+
* @param editor - The editor that this error came from
|
248
260
|
*/
|
249
261
|
onError?: (error: Error, editor: LexicalEditor) => void;
|
250
262
|
/**
|
package/dist/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,cA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