@fluojs/testing 1.0.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.ko.md +98 -16
  2. package/README.md +100 -16
  3. package/dist/babel-decorators-plugin.d.ts +1 -0
  4. package/dist/babel-decorators-plugin.d.ts.map +1 -1
  5. package/dist/babel-decorators-plugin.js +1 -0
  6. package/dist/byte-range-portability-consumer.test-fixture.d.ts +2 -0
  7. package/dist/byte-range-portability-consumer.test-fixture.d.ts.map +1 -0
  8. package/dist/byte-range-portability-consumer.test-fixture.js +11 -0
  9. package/dist/conformance/fetch-style-websocket-conformance.d.ts +1 -0
  10. package/dist/conformance/fetch-style-websocket-conformance.d.ts.map +1 -1
  11. package/dist/conformance/fetch-style-websocket-conformance.js +1 -1
  12. package/dist/conformance/platform-shell-lifecycle-conformance.d.ts +30 -0
  13. package/dist/conformance/platform-shell-lifecycle-conformance.d.ts.map +1 -0
  14. package/dist/conformance/platform-shell-lifecycle-conformance.js +259 -0
  15. package/dist/http.d.ts +2 -1
  16. package/dist/http.d.ts.map +1 -1
  17. package/dist/http.js +8 -3
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +1 -2
  21. package/dist/mock-types.d.ts +2 -0
  22. package/dist/mock-types.d.ts.map +1 -0
  23. package/dist/mock-types.js +1 -0
  24. package/dist/mock.d.ts +3 -2
  25. package/dist/mock.d.ts.map +1 -1
  26. package/dist/mock.js +1 -1
  27. package/dist/module.d.ts.map +1 -1
  28. package/dist/module.js +103 -113
  29. package/dist/portability/error-representation-abort-portability.d.ts +36 -0
  30. package/dist/portability/error-representation-abort-portability.d.ts.map +1 -0
  31. package/dist/portability/error-representation-abort-portability.js +190 -0
  32. package/dist/portability/error-representation-portability-fixture.d.ts +58 -0
  33. package/dist/portability/error-representation-portability-fixture.d.ts.map +1 -0
  34. package/dist/portability/error-representation-portability-fixture.js +202 -0
  35. package/dist/portability/error-representation-portability.d.ts +50 -0
  36. package/dist/portability/error-representation-portability.d.ts.map +1 -0
  37. package/dist/portability/error-representation-portability.js +153 -0
  38. package/dist/portability/http-adapter-portability.d.ts +25 -8
  39. package/dist/portability/http-adapter-portability.d.ts.map +1 -1
  40. package/dist/portability/http-adapter-portability.js +446 -69
  41. package/dist/portability/response-cookie-portability.d.ts +16 -0
  42. package/dist/portability/response-cookie-portability.d.ts.map +1 -0
  43. package/dist/portability/response-cookie-portability.js +81 -0
  44. package/dist/portability/web-runtime-adapter-portability.d.ts +24 -8
  45. package/dist/portability/web-runtime-adapter-portability.d.ts.map +1 -1
  46. package/dist/portability/web-runtime-adapter-portability.js +356 -31
  47. package/dist/types.d.ts +68 -4
  48. package/dist/types.d.ts.map +1 -1
  49. package/package.json +19 -15
@@ -0,0 +1,259 @@
1
+ import { PlatformLifecycleConflictError } from '@fluojs/runtime';
2
+ class Deferred {
3
+ promise;
4
+ settle = () => {
5
+ throw new Error('Deferred promise was not initialized.');
6
+ };
7
+ constructor() {
8
+ this.promise = new Promise(resolve => {
9
+ this.settle = resolve;
10
+ });
11
+ }
12
+ resolve() {
13
+ this.settle();
14
+ }
15
+ }
16
+ class ControlledPlatformComponent {
17
+ id = 'platform-shell-lifecycle-conformance';
18
+ kind = 'platform-shell-lifecycle-conformance';
19
+ entered = {
20
+ start: new Deferred(),
21
+ stop: new Deferred()
22
+ };
23
+ startCalls = 0;
24
+ stopCalls = 0;
25
+ currentState = 'created';
26
+ startFailuresRemaining;
27
+ stopFailuresRemaining;
28
+ constructor(options = {}) {
29
+ this.options = options;
30
+ this.startFailuresRemaining = options.failStartTimes ?? 0;
31
+ this.stopFailuresRemaining = options.failStopTimes ?? 0;
32
+ }
33
+ health() {
34
+ return Promise.resolve({
35
+ status: 'healthy'
36
+ });
37
+ }
38
+ ready() {
39
+ return Promise.resolve({
40
+ critical: true,
41
+ status: 'ready'
42
+ });
43
+ }
44
+ snapshot() {
45
+ return {
46
+ dependencies: [],
47
+ details: {},
48
+ health: {
49
+ status: 'healthy'
50
+ },
51
+ id: this.id,
52
+ kind: this.kind,
53
+ ownership: {
54
+ externallyManaged: false,
55
+ ownsResources: true
56
+ },
57
+ readiness: {
58
+ critical: true,
59
+ status: 'ready'
60
+ },
61
+ state: this.currentState,
62
+ telemetry: {
63
+ namespace: 'fluo.platform-shell-lifecycle-conformance',
64
+ tags: {}
65
+ }
66
+ };
67
+ }
68
+ async start() {
69
+ this.startCalls += 1;
70
+ this.entered.start.resolve();
71
+ await this.options.onStart?.();
72
+ await this.options.startGate;
73
+ if (this.startFailuresRemaining > 0) {
74
+ this.startFailuresRemaining -= 1;
75
+ throw new Error('controlled start failure');
76
+ }
77
+ this.currentState = 'ready';
78
+ }
79
+ state() {
80
+ return this.currentState;
81
+ }
82
+ async stop() {
83
+ this.stopCalls += 1;
84
+ this.entered.stop.resolve();
85
+ await this.options.onStop?.();
86
+ await this.options.stopGate;
87
+ if (this.stopFailuresRemaining > 0) {
88
+ this.stopFailuresRemaining -= 1;
89
+ throw new Error('controlled stop failure');
90
+ }
91
+ this.currentState = 'stopped';
92
+ }
93
+ validate() {
94
+ return Promise.resolve({
95
+ issues: [],
96
+ ok: true
97
+ });
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Describes the PlatformShell lifecycle conformance harness options contract.
103
+ */
104
+
105
+ /**
106
+ * Represents lifecycle exclusivity checks for a PlatformShell implementation.
107
+ */
108
+ export class PlatformShellLifecycleConformanceHarness {
109
+ constructor(options) {
110
+ this.options = options;
111
+ }
112
+ async assertAll() {
113
+ await this.assertOverlappingTransitionsRejectImmediately();
114
+ await this.assertCallbackReentryRejects();
115
+ await this.assertSettledTransitionsPermitRetries();
116
+ await this.assertSequentialTransitionsRemainIdempotent();
117
+ }
118
+ async assertOverlappingTransitionsRejectImmediately() {
119
+ const overlapPairs = [['start', 'start'], ['start', 'stop'], ['stop', 'start'], ['stop', 'stop']];
120
+ for (const [active, requested] of overlapPairs) {
121
+ const gate = new Deferred();
122
+ const component = new ControlledPlatformComponent(active === 'start' ? {
123
+ startGate: gate.promise
124
+ } : {
125
+ stopGate: gate.promise
126
+ });
127
+ const shell = this.options.createShell(component);
128
+ if (active === 'stop') {
129
+ await shell.start();
130
+ }
131
+ const activeTransition = shell[active]();
132
+ await component.entered[active].promise;
133
+ try {
134
+ await assertLifecycleConflict(shell[requested](), active, requested);
135
+ } finally {
136
+ gate.resolve();
137
+ }
138
+ await activeTransition;
139
+ if (active === 'start') {
140
+ await shell.stop();
141
+ }
142
+ }
143
+ }
144
+ async assertCallbackReentryRejects() {
145
+ await this.assertSynchronousStartCallbackReentryRejects();
146
+ await this.assertAwaitedStopCallbackReentryRejects();
147
+ }
148
+ async assertSettledTransitionsPermitRetries() {
149
+ await this.assertFailedTransitionPermitsRetry('start');
150
+ await this.assertFailedTransitionPermitsRetry('stop');
151
+ }
152
+ async assertSequentialTransitionsRemainIdempotent() {
153
+ const component = new ControlledPlatformComponent();
154
+ const shell = this.options.createShell(component);
155
+ await shell.start();
156
+ await shell.start();
157
+ await shell.stop();
158
+ await shell.stop();
159
+ if (component.startCalls !== 1 || component.stopCalls !== 1) {
160
+ throw new Error(`Settled lifecycle calls must be idempotent. Received ${component.startCalls} start() and ${component.stopCalls} stop() calls.`);
161
+ }
162
+ }
163
+ async assertSynchronousStartCallbackReentryRejects() {
164
+ let reenter;
165
+ const component = new ControlledPlatformComponent({
166
+ onStart: async () => {
167
+ if (!reenter) {
168
+ throw new Error('Lifecycle reentry was not initialized.');
169
+ }
170
+ await assertLifecycleConflict(reenter(), 'start', 'stop');
171
+ }
172
+ });
173
+ const shell = this.options.createShell(component);
174
+ reenter = () => shell.stop();
175
+ await shell.start();
176
+ await shell.stop();
177
+ }
178
+ async assertAwaitedStopCallbackReentryRejects() {
179
+ let reenter;
180
+ const component = new ControlledPlatformComponent({
181
+ onStop: async () => {
182
+ await Promise.resolve();
183
+ await Promise.resolve();
184
+ if (!reenter) {
185
+ throw new Error('Lifecycle reentry was not initialized.');
186
+ }
187
+ await assertLifecycleConflict(reenter(), 'stop', 'start');
188
+ }
189
+ });
190
+ const shell = this.options.createShell(component);
191
+ reenter = () => shell.start();
192
+ await shell.start();
193
+ await shell.stop();
194
+ }
195
+ async assertFailedTransitionPermitsRetry(operation) {
196
+ const component = new ControlledPlatformComponent(operation === 'start' ? {
197
+ failStartTimes: 1
198
+ } : {
199
+ failStopTimes: 1
200
+ });
201
+ const shell = this.options.createShell(component);
202
+ if (operation === 'stop') {
203
+ await shell.start();
204
+ }
205
+ await expectTransitionFailure(shell[operation](), operation);
206
+ await shell[operation]();
207
+ const callCount = operation === 'start' ? component.startCalls : component.stopCalls;
208
+ if (callCount !== 2) {
209
+ throw new Error(`Failed ${operation}() transitions must permit one explicit retry after settlement.`);
210
+ }
211
+ if (operation === 'start') {
212
+ await shell.stop();
213
+ }
214
+ }
215
+ }
216
+ async function assertLifecycleConflict(transition, active, requested) {
217
+ const outcome = await Promise.race([transition.then(() => ({
218
+ status: 'fulfilled'
219
+ }), error => ({
220
+ error,
221
+ status: 'rejected'
222
+ })), Promise.resolve().then(() => ({
223
+ status: 'pending'
224
+ }))]);
225
+ if (outcome.status === 'pending') {
226
+ throw new Error(`${requested}() must reject with PlatformLifecycleConflictError while ${active}() is active.`);
227
+ }
228
+ if (outcome.status === 'fulfilled') {
229
+ throw new Error(`${requested}() must reject while ${active}() is active.`);
230
+ }
231
+ if (!(outcome.error instanceof PlatformLifecycleConflictError)) {
232
+ throw new Error(`${requested}() must reject with PlatformLifecycleConflictError while ${active}() is active.`);
233
+ }
234
+ const {
235
+ error
236
+ } = outcome;
237
+ const metadata = error.meta;
238
+ if (error.code !== 'PLATFORM_LIFECYCLE_CONFLICT' || error.activeOperation !== active || error.requestedOperation !== requested || metadata?.['activeOperation'] !== active || metadata?.['requestedOperation'] !== requested) {
239
+ throw new Error(`${requested}() returned incorrect PlatformLifecycleConflictError metadata.`);
240
+ }
241
+ }
242
+ async function expectTransitionFailure(transition, operation) {
243
+ try {
244
+ await transition;
245
+ } catch {
246
+ return;
247
+ }
248
+ throw new Error(`The first ${operation}() transition must fail before retry conformance is checked.`);
249
+ }
250
+
251
+ /**
252
+ * Create PlatformShell lifecycle conformance harness.
253
+ *
254
+ * @param options The options.
255
+ * @returns The create PlatformShell lifecycle conformance harness result.
256
+ */
257
+ export function createPlatformShellLifecycleConformanceHarness(options) {
258
+ return new PlatformShellLifecycleConformanceHarness(options);
259
+ }
package/dist/http.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Dispatcher, Middleware } from '@fluojs/http';
1
+ import type { Dispatcher, FrameworkRequest, Middleware } from '@fluojs/http';
2
2
  /**
3
3
  * Principal payload used by testing request helpers.
4
4
  */
@@ -20,6 +20,7 @@ export interface TestRequest {
20
20
  body?: unknown;
21
21
  headers?: Record<string, string>;
22
22
  query?: Record<string, string | string[]>;
23
+ cookies?: FrameworkRequest['cookies'];
23
24
  principal?: TestPrincipal;
24
25
  }
25
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmD,UAAU,EAAa,MAAM,cAAc,CAAC;AAEvH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CA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AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC;IACtC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC;IACpC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAAC;IACrC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC;IACpD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC;IAC7D,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,cAAc,CAAC;IAChD,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;CAC/B;AA2ED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,sBAAsB,GAAG,cAAc,CAsD5G;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,IAAI,UAAU,CAa/D;AA4FD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,CAO5G"}
package/dist/http.js CHANGED
@@ -79,6 +79,9 @@ export function createRequestBuilder(dispatcher, request) {
79
79
  query: request.query ? {
80
80
  ...request.query
81
81
  } : undefined,
82
+ cookies: request.cookies ? {
83
+ ...request.cookies
84
+ } : undefined,
82
85
  principal: request.principal
83
86
  };
84
87
  return {
@@ -162,7 +165,7 @@ function buildFrameworkRequest(req) {
162
165
  url: req.path + queryString,
163
166
  headers: req.headers ?? {},
164
167
  query: req.query ?? {},
165
- cookies: {},
168
+ cookies: req.cookies ?? {},
166
169
  params: {},
167
170
  body: req.body,
168
171
  raw: req,
@@ -197,8 +200,10 @@ function buildFrameworkResponse() {
197
200
  const lowerName = name.toLowerCase();
198
201
  const responseHeaders = this.headers;
199
202
  if (lowerName === 'set-cookie') {
200
- result.headers[name] = mergeHeaderValue(result.headers[name], value);
201
- responseHeaders[name] = mergeHeaderValue(responseHeaders[name], value);
203
+ const existingHeaderName = Object.keys(result.headers).find(headerName => headerName.toLowerCase() === lowerName);
204
+ const canonicalHeaderName = existingHeaderName ?? name;
205
+ result.headers[canonicalHeaderName] = mergeHeaderValue(result.headers[canonicalHeaderName], value);
206
+ responseHeaders[canonicalHeaderName] = mergeHeaderValue(responseHeaders[canonicalHeaderName], value);
202
207
  return;
203
208
  }
204
209
  result.headers[name] = value;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './app.js';
2
2
  export { Test, createTestingModule, extractModuleProviders, extractModuleControllers, extractModuleImports } from './module.js';
3
- export * from './types.js';
3
+ export type { DeepMocked, OverrideProviderBuilder, TestApp, TestingApplicationOptions, TestingModuleBuilder, TestingModuleOptions, TestingModuleRef, TestRequestOptions, } from './types.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAChI,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAChI,YAAY,EACV,UAAU,EACV,uBAAuB,EACvB,OAAO,EACP,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from './app.js';
2
- export { Test, createTestingModule, extractModuleProviders, extractModuleControllers, extractModuleImports } from './module.js';
3
- export * from './types.js';
2
+ export { Test, createTestingModule, extractModuleProviders, extractModuleControllers, extractModuleImports } from './module.js';
@@ -0,0 +1,2 @@
1
+ export type { DeepMocked } from './types.js';
2
+ //# sourceMappingURL=mock-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-types.d.ts","sourceRoot":"","sources":["../src/mock-types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/dist/mock.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import type { Mock } from 'vitest';
2
1
  import type { Token } from '@fluojs/core';
3
2
  import type { ValueProvider } from '@fluojs/di';
4
- import type { DeepMocked } from './types.js';
3
+ import type { Mock } from 'vitest';
4
+ import type { DeepMocked } from './mock-types.js';
5
+ export type { DeepMocked } from './mock-types.js';
5
6
  /**
6
7
  * Defines the mocked methods type.
7
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../src/mock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;KAC5B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC/E,CAAC;AAEF;;;;;;GAMG;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,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC/E,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EACzC,OAAO,GAAE,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAM,EACvC,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,aAAa,CAAC,CAAC,CAAC,CAsBlB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAkBnG;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,GAAE,OAAO,CAAC,CAAC,CAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAExF"}
package/dist/mock.js CHANGED
@@ -38,7 +38,7 @@ export function createMock(partial = {}, options = {}) {
38
38
  * @returns The as mock result.
39
39
  */
40
40
  export function asMock(fn) {
41
- return vi.mocked(fn);
41
+ return fn;
42
42
  }
43
43
 
44
44
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EAKd,KAAK,QAAQ,EAEd,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAGV,UAAU,EACX,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAA2B,oBAAoB,EAAE,oBAAoB,EAAoB,MAAM,YAAY,CAAC;AAYx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