@serwist/vite 9.5.6 → 9.5.8
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/dist/chunks/schema-CF26pDQI.js +77 -0
- package/dist/chunks/schema-CF26pDQI.js.map +1 -0
- package/dist/index.d.mts +228 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +393 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.schema.d.mts +126 -0
- package/dist/index.schema.d.mts.map +1 -0
- package/dist/index.schema.mjs +2 -0
- package/dist/index.worker.d.mts +13 -0
- package/dist/index.worker.d.mts.map +1 -0
- package/dist/index.worker.mjs +108 -0
- package/dist/index.worker.mjs.map +1 -0
- package/package.json +30 -26
- package/src/lib/modules.ts +1 -0
- package/dist/chunks/schema.js +0 -80
- package/dist/index.d.ts +0 -19
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -400
- package/dist/index.schema.d.ts +0 -3
- package/dist/index.schema.d.ts.map +0 -1
- package/dist/index.schema.js +0 -3
- package/dist/index.worker.d.ts +0 -9
- package/dist/index.worker.d.ts.map +0 -1
- package/dist/index.worker.js +0 -118
- package/dist/lib/api.d.ts +0 -4
- package/dist/lib/api.d.ts.map +0 -1
- package/dist/lib/constants.d.ts +0 -3
- package/dist/lib/constants.d.ts.map +0 -1
- package/dist/lib/context.d.ts +0 -33
- package/dist/lib/context.d.ts.map +0 -1
- package/dist/lib/log.d.ts +0 -4
- package/dist/lib/log.d.ts.map +0 -1
- package/dist/lib/modules.d.ts +0 -10
- package/dist/lib/modules.d.ts.map +0 -1
- package/dist/lib/options.d.ts +0 -4
- package/dist/lib/options.d.ts.map +0 -1
- package/dist/lib/schema.d.ts +0 -122
- package/dist/lib/schema.d.ts.map +0 -1
- package/dist/lib/types.d.ts +0 -130
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/utils.d.ts +0 -24
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/validator.d.ts +0 -3
- package/dist/lib/validator.d.ts.map +0 -1
- package/dist/plugins/build.d.ts +0 -12
- package/dist/plugins/build.d.ts.map +0 -1
- package/dist/plugins/dev.d.ts +0 -12
- package/dist/plugins/dev.d.ts.map +0 -1
- package/dist/plugins/main.d.ts +0 -12
- package/dist/plugins/main.d.ts.map +0 -1
- package/src/rollup.js +0 -23
- /package/{typings.d.ts → typings.d.mts} +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { asyncFn, basePartial, fn, globPartial, injectPartial, requiredGlobDirectoryPartial, requiredSwDestPartial } from "@serwist/build/schema";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region \0rolldown/runtime.js
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __exportAll = (all, no_symbols) => {
|
|
7
|
+
let target = {};
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/lib/schema.ts
|
|
18
|
+
var schema_exports = /* @__PURE__ */ __exportAll({
|
|
19
|
+
devOptions: () => devOptions,
|
|
20
|
+
hooks: () => hooks,
|
|
21
|
+
injectManifestOptions: () => injectManifestOptions,
|
|
22
|
+
injectManifestPartial: () => injectManifestPartial
|
|
23
|
+
});
|
|
24
|
+
const hooks = z.object({
|
|
25
|
+
beforeBuildServiceWorker: z.union([fn({
|
|
26
|
+
input: [z.any()],
|
|
27
|
+
output: z.void()
|
|
28
|
+
}), asyncFn({
|
|
29
|
+
input: [z.any()],
|
|
30
|
+
output: z.void()
|
|
31
|
+
})]).optional(),
|
|
32
|
+
closeBundleOrder: z.union([
|
|
33
|
+
z.literal("pre"),
|
|
34
|
+
z.literal("post"),
|
|
35
|
+
z.null()
|
|
36
|
+
]).optional(),
|
|
37
|
+
configureOptions: z.union([fn({
|
|
38
|
+
input: [z.any(), z.any()],
|
|
39
|
+
output: z.void()
|
|
40
|
+
}), asyncFn({
|
|
41
|
+
input: [z.any(), z.any()],
|
|
42
|
+
output: z.void()
|
|
43
|
+
})]).optional()
|
|
44
|
+
});
|
|
45
|
+
const devOptions = z.object({
|
|
46
|
+
bundle: z.boolean().default(true),
|
|
47
|
+
minify: z.union([
|
|
48
|
+
z.boolean(),
|
|
49
|
+
z.literal("terser"),
|
|
50
|
+
z.literal("esbuild")
|
|
51
|
+
]).default(false)
|
|
52
|
+
});
|
|
53
|
+
const injectManifestPartial = z.object({
|
|
54
|
+
mode: z.union([z.literal("development"), z.literal("production")]),
|
|
55
|
+
type: z.union([z.literal("classic"), z.literal("module")]).default("classic"),
|
|
56
|
+
scope: z.string(),
|
|
57
|
+
base: z.string(),
|
|
58
|
+
disable: z.boolean().default(false),
|
|
59
|
+
integration: hooks.default({}),
|
|
60
|
+
swUrl: z.string().default("/sw.js"),
|
|
61
|
+
plugins: z.array(z.any()).default([]),
|
|
62
|
+
rollupFormat: z.union([z.literal("es"), z.literal("iife")]).default("es"),
|
|
63
|
+
rollupOptions: z.record(z.string(), z.any()).default({}),
|
|
64
|
+
devOptions: devOptions.prefault({})
|
|
65
|
+
});
|
|
66
|
+
const injectManifestOptions = z.strictObject({
|
|
67
|
+
...basePartial.shape,
|
|
68
|
+
...globPartial.shape,
|
|
69
|
+
...injectPartial.shape,
|
|
70
|
+
...requiredSwDestPartial.shape,
|
|
71
|
+
...requiredGlobDirectoryPartial.shape,
|
|
72
|
+
...injectManifestPartial.shape
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { schema_exports as a, injectManifestPartial as i, hooks as n, __require as o, injectManifestOptions as r, devOptions as t };
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=schema-CF26pDQI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-CF26pDQI.js","names":[],"sources":["../../src/lib/schema.ts"],"sourcesContent":["import { asyncFn, basePartial, fn, globPartial, injectPartial, requiredGlobDirectoryPartial, requiredSwDestPartial } from \"@serwist/build/schema\";\nimport { z } from \"zod\";\n\nexport const hooks = z.object({\n beforeBuildServiceWorker: z\n .union([\n fn({\n input: [z.any()],\n output: z.void(),\n }),\n asyncFn({\n input: [z.any()],\n output: z.void(),\n }),\n ])\n .optional(),\n closeBundleOrder: z.union([z.literal(\"pre\"), z.literal(\"post\"), z.null()]).optional(),\n configureOptions: z\n .union([\n fn({\n input: [z.any(), z.any()],\n output: z.void(),\n }),\n asyncFn({\n input: [z.any(), z.any()],\n output: z.void(),\n }),\n ])\n .optional(),\n});\n\nexport const devOptions = z.object({\n bundle: z.boolean().default(true),\n minify: z.union([z.boolean(), z.literal(\"terser\"), z.literal(\"esbuild\")]).default(false),\n});\n\nexport const injectManifestPartial = z.object({\n mode: z.union([z.literal(\"development\"), z.literal(\"production\")]),\n type: z.union([z.literal(\"classic\"), z.literal(\"module\")]).default(\"classic\"),\n scope: z.string(),\n base: z.string(),\n disable: z.boolean().default(false),\n integration: hooks.default({}),\n swUrl: z.string().default(\"/sw.js\"),\n plugins: z.array(z.any()).default([]),\n rollupFormat: z.union([z.literal(\"es\"), z.literal(\"iife\")]).default(\"es\"),\n rollupOptions: z.record(z.string(), z.any()).default({}),\n devOptions: devOptions.prefault({}),\n});\n\nexport const injectManifestOptions = z.strictObject({\n ...basePartial.shape,\n ...globPartial.shape,\n ...injectPartial.shape,\n ...requiredSwDestPartial.shape,\n ...requiredGlobDirectoryPartial.shape,\n ...injectManifestPartial.shape,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAa,QAAQ,EAAE,OAAO;CAC5B,0BAA0B,EACvB,MAAM,CACL,GAAG;EACD,OAAO,CAAC,EAAE,KAAK,CAAC;EAChB,QAAQ,EA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,KAAK,EAAE,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC,QAAQ,KAAK;CACzE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;CACxD,YAAY,WAAW,SAAS,EAAE,CAAC;CACpC,CAAC;AAEF,MAAa,wBAAwB,EAAE,aAAa;CAClD,GAAG,YAAY;CACf,GAAG,YAAY;CACf,GAAG,cAAc;CACjB,GAAG,sBAAsB;CACzB,GAAG,6BAA6B;CAChC,GAAG,sBAAsB;CAC1B,CAAC"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { BasePartial, BaseResolved, GlobPartial, GlobResolved, InjectPartial, InjectResolved, ManifestEntry, RequiredGlobDirectoryPartial, RequiredGlobDirectoryResolved, RequiredSwDestPartial, RequiredSwDestResolved } from "@serwist/build";
|
|
2
|
+
import { BuildOptions, Plugin, ResolvedConfig } from "vite";
|
|
3
|
+
import { Require } from "@serwist/utils";
|
|
4
|
+
import { RollupOptions } from "rollup";
|
|
5
|
+
|
|
6
|
+
//#region src/lib/types.d.ts
|
|
7
|
+
interface InjectPartial$1 {
|
|
8
|
+
/**
|
|
9
|
+
* The mode in which your service worker should be built.
|
|
10
|
+
*
|
|
11
|
+
* @default
|
|
12
|
+
* process.env.NODE_ENV // or "production" if undefined
|
|
13
|
+
*/
|
|
14
|
+
mode?: "development" | "production";
|
|
15
|
+
/**
|
|
16
|
+
* The module type with which the service worker should be registered. Usually used alongside
|
|
17
|
+
* `rollupFormat`.
|
|
18
|
+
*
|
|
19
|
+
* @default "classic"
|
|
20
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#type
|
|
21
|
+
*/
|
|
22
|
+
type?: WorkerType;
|
|
23
|
+
/**
|
|
24
|
+
* The service worker's URL scope. Set to `"/foo/"` so that paths under "/foo/"
|
|
25
|
+
* are under the service worker's control while others are not.
|
|
26
|
+
*
|
|
27
|
+
* @default viteOptions.base
|
|
28
|
+
* @see https://vitejs.dev/config/shared-options.html#base
|
|
29
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#scope
|
|
30
|
+
*/
|
|
31
|
+
scope?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The base from which Serwist resolves URLs.
|
|
34
|
+
*
|
|
35
|
+
* @default viteOptions.base
|
|
36
|
+
* @see https://vitejs.dev/config/shared-options.html#base
|
|
37
|
+
*/
|
|
38
|
+
base?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether Serwist should be disabled.
|
|
41
|
+
*
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
disable?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Hooks of the build lifecycle.
|
|
47
|
+
*/
|
|
48
|
+
integration?: Hooks;
|
|
49
|
+
/**
|
|
50
|
+
* The URL to the service worker.
|
|
51
|
+
*
|
|
52
|
+
* @default "/sw.js"
|
|
53
|
+
*/
|
|
54
|
+
swUrl?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Rollup/Vite plugins used to build the service worker.
|
|
57
|
+
*/
|
|
58
|
+
plugins?: Plugin[];
|
|
59
|
+
/**
|
|
60
|
+
* The format used to build the service worker.
|
|
61
|
+
*
|
|
62
|
+
* @default "es"
|
|
63
|
+
*/
|
|
64
|
+
rollupFormat?: "es" | "iife";
|
|
65
|
+
/**
|
|
66
|
+
* Custom Rollup options used to build the service worker.
|
|
67
|
+
*/
|
|
68
|
+
rollupOptions?: Omit<RollupOptions, "plugins" | "output">;
|
|
69
|
+
/**
|
|
70
|
+
* Development-specific options.
|
|
71
|
+
*/
|
|
72
|
+
devOptions?: DevOptions;
|
|
73
|
+
}
|
|
74
|
+
interface InjectResolved$1 extends Require<InjectPartial$1, "mode" | "type" | "scope" | "base" | "disable" | "swUrl" | "rollupFormat"> {
|
|
75
|
+
devOptions: Required<DevOptions>;
|
|
76
|
+
}
|
|
77
|
+
interface InjectManifestOptions extends Omit<BasePartial, "disablePrecacheManifest">, GlobPartial, InjectPartial, RequiredSwDestPartial, RequiredGlobDirectoryPartial, InjectPartial$1 {}
|
|
78
|
+
interface InjectManifestOptionsComplete extends BaseResolved, GlobResolved, InjectResolved, RequiredSwDestResolved, RequiredGlobDirectoryResolved, InjectResolved$1 {}
|
|
79
|
+
interface Hooks {
|
|
80
|
+
/**
|
|
81
|
+
* Allows you to run some logic before the service worker is built.
|
|
82
|
+
* @param options
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
85
|
+
beforeBuildServiceWorker?: (options: PluginOptionsComplete) => void | Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Adjusts the application order of `@serwist/vite`'s `closeBundle` hook.
|
|
88
|
+
*/
|
|
89
|
+
closeBundleOrder?: "pre" | "post" | null;
|
|
90
|
+
/**
|
|
91
|
+
* Allows you to configure the options of Serwist and Vite. Useful when there is a dependency between the two.
|
|
92
|
+
* @param viteOptions
|
|
93
|
+
* @param options
|
|
94
|
+
* @returns
|
|
95
|
+
*/
|
|
96
|
+
configureOptions?: (viteOptions: ResolvedConfig, options: PluginOptions) => void | Promise<void>;
|
|
97
|
+
}
|
|
98
|
+
interface DevOptions {
|
|
99
|
+
/**
|
|
100
|
+
* Whether the service worker should be bundled in development mode.
|
|
101
|
+
*
|
|
102
|
+
* @default true
|
|
103
|
+
*/
|
|
104
|
+
bundle?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Whether the service worker should be minified in development mode.
|
|
107
|
+
*
|
|
108
|
+
* @default false
|
|
109
|
+
*/
|
|
110
|
+
minify?: BuildOptions["minify"];
|
|
111
|
+
}
|
|
112
|
+
interface PluginOptions extends InjectManifestOptions {}
|
|
113
|
+
interface PluginOptionsComplete extends InjectResolved$1 {
|
|
114
|
+
injectManifest: Omit<InjectManifestOptionsComplete, keyof InjectResolved$1>;
|
|
115
|
+
}
|
|
116
|
+
interface SerwistViteApi {
|
|
117
|
+
/**
|
|
118
|
+
* Whether the plugin is disabled.
|
|
119
|
+
*/
|
|
120
|
+
disabled: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Extends the precache manifest.
|
|
123
|
+
* @param fn
|
|
124
|
+
*/
|
|
125
|
+
extendManifestEntries(fn: ExtendManifestEntriesHook): void;
|
|
126
|
+
generateSW(): Promise<void>;
|
|
127
|
+
}
|
|
128
|
+
type ExtendManifestEntriesHook = (manifestEntries: (string | ManifestEntry)[]) => (string | ManifestEntry)[] | undefined;
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/lib/context.d.ts
|
|
131
|
+
type SerwistViteFrameworks = "nuxt";
|
|
132
|
+
interface SerwistViteContext {
|
|
133
|
+
/**
|
|
134
|
+
* Resolved Vite config.
|
|
135
|
+
*
|
|
136
|
+
* Note: This value is set by our main plugin, located at plugins/main.ts.
|
|
137
|
+
*/
|
|
138
|
+
viteConfig: ResolvedConfig;
|
|
139
|
+
/**
|
|
140
|
+
* Provided options.
|
|
141
|
+
*/
|
|
142
|
+
userOptions: PluginOptions;
|
|
143
|
+
/**
|
|
144
|
+
* Resolved options.
|
|
145
|
+
*
|
|
146
|
+
* Note: this is different from `userOptions` in that it has been parsed, whereas
|
|
147
|
+
* `userOptions` is the raw configuration that the user provides us.
|
|
148
|
+
*/
|
|
149
|
+
options: PluginOptionsComplete;
|
|
150
|
+
useImportRegister: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Is the plugin running on dev?
|
|
153
|
+
*
|
|
154
|
+
* Note: This value is set by our dev plugin, located at plugins/dev.ts.
|
|
155
|
+
*/
|
|
156
|
+
devEnvironment: boolean;
|
|
157
|
+
/** To tailor our APIs to these frameworks. */
|
|
158
|
+
framework: SerwistViteFrameworks | undefined;
|
|
159
|
+
}
|
|
160
|
+
declare const createContext: (userOptions: PluginOptions, framework: SerwistViteFrameworks | undefined) => SerwistViteContext;
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/lib/api.d.ts
|
|
163
|
+
declare const createApi: (ctx: SerwistViteContext) => SerwistViteApi;
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/lib/utils.d.ts
|
|
166
|
+
/**
|
|
167
|
+
* Internal function used by `@serwist/vite`.
|
|
168
|
+
* Resolves a file path without extension. Also handles `/index` if the path
|
|
169
|
+
* actually points to a directory.
|
|
170
|
+
* @internal
|
|
171
|
+
* @param ctx
|
|
172
|
+
* @param api
|
|
173
|
+
* @returns
|
|
174
|
+
*/
|
|
175
|
+
declare const resolveEntry: (entry: string) => string | null;
|
|
176
|
+
/**
|
|
177
|
+
* Internal function used by `@serwist/vite`.
|
|
178
|
+
* Converts a filesystem path to a Vite `@fs` URL.
|
|
179
|
+
* @internal
|
|
180
|
+
* @param ctx
|
|
181
|
+
* @param api
|
|
182
|
+
* @returns
|
|
183
|
+
*/
|
|
184
|
+
declare const toFs: (str: string) => string;
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/lib/validator.d.ts
|
|
187
|
+
declare const validateInjectManifestOptions: (input: unknown) => Promise<InjectManifestOptionsComplete>;
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/plugins/build.d.ts
|
|
190
|
+
/**
|
|
191
|
+
* Internal build plugin used by `@serwist/vite`.
|
|
192
|
+
* @internal
|
|
193
|
+
* @param ctx
|
|
194
|
+
* @param api
|
|
195
|
+
* @returns
|
|
196
|
+
*/
|
|
197
|
+
declare const buildPlugin: (ctx: SerwistViteContext, api: SerwistViteApi) => Plugin;
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/plugins/dev.d.ts
|
|
200
|
+
/**
|
|
201
|
+
* Internal dev plugin used by `@serwist/vite`.
|
|
202
|
+
* @internal
|
|
203
|
+
* @param ctx
|
|
204
|
+
* @param api
|
|
205
|
+
* @returns
|
|
206
|
+
*/
|
|
207
|
+
declare const devPlugin: (ctx: SerwistViteContext, api: SerwistViteApi) => Plugin;
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/plugins/main.d.ts
|
|
210
|
+
/**
|
|
211
|
+
* Internal plugin used by `@serwist/vite`.
|
|
212
|
+
* @internal
|
|
213
|
+
* @param ctx
|
|
214
|
+
* @param api
|
|
215
|
+
* @returns
|
|
216
|
+
*/
|
|
217
|
+
declare const mainPlugin: (ctx: SerwistViteContext, api: SerwistViteApi) => Plugin;
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/index.d.ts
|
|
220
|
+
/**
|
|
221
|
+
* Integrates Serwist into your Vite app.
|
|
222
|
+
* @param userOptions
|
|
223
|
+
* @returns
|
|
224
|
+
*/
|
|
225
|
+
declare const serwist: (userOptions: PluginOptions) => Plugin[];
|
|
226
|
+
//#endregion
|
|
227
|
+
export { type DevOptions, type ExtendManifestEntriesHook, type Hooks, type PluginOptions, type PluginOptionsComplete, type SerwistViteApi, type SerwistViteContext, buildPlugin as build, createApi, createContext, devPlugin as dev, mainPlugin as main, resolveEntry, serwist, toFs, validateInjectManifestOptions };
|
|
228
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/types.ts","../src/lib/context.ts","../src/lib/api.ts","../src/lib/utils.ts","../src/lib/validator.ts","../src/plugins/build.ts","../src/plugins/dev.ts","../src/plugins/main.ts","../src/index.ts"],"mappings":";;;;;;UAiBiB,eAAA;;AAAjB;;;;;EAOE,IAAA;EAsDqB;;;;;;;EA9CrB,IAAA,GAAO,UAAA;EASP;;;;;;;;EAAA,KAAA;EAqCA;;;;;;EA9BA,IAAA;EAqCe;;;;;EA/Bf,OAAA;EA+BsC;;;EA3BtC,WAAA,GAAc,KAAA;EA2BgC;;;;;EArB9C,KAAA;EAyBe;;;EArBf,OAAA,GAAU,MAAA;EAsBF;;;;;EAhBR,YAAA;EAqBe;;;EAjBf,aAAA,GAAgB,IAAA,CAAK,aAAA;EAanB;;;EATF,UAAA,GAAa,UAAA;AAAA;AAAA,UAGE,gBAAA,SAAuB,OAAA,CAAQ,eAAA;EAC9C,UAAA,EA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