@rspack/dev-server 0.0.21 → 0.0.22

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 (100) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +1 -1
  3. package/dist/config.d.ts +19 -14
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +0 -52
  6. package/dist/config.js.map +1 -1
  7. package/dist/server.d.ts +14 -41
  8. package/dist/server.d.ts.map +1 -1
  9. package/dist/server.js +308 -257
  10. package/dist/server.js.map +1 -1
  11. package/jest.config.js +3 -1
  12. package/package.json +10 -9
  13. package/src/config.ts +21 -67
  14. package/src/server.ts +350 -311
  15. package/tests/__snapshots__/normalizeOptions.test.ts.snap +223 -24
  16. package/tests/e2e/hot-reaload.test.ts +35 -39
  17. package/tests/e2e-fixtures/react/node_modules/react/LICENSE +21 -0
  18. package/tests/e2e-fixtures/react/node_modules/react/README.md +37 -0
  19. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.development.js +1296 -0
  20. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +10 -0
  21. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +10 -0
  22. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.development.js +1314 -0
  23. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.production.min.js +11 -0
  24. package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +11 -0
  25. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.development.js +2739 -0
  26. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.production.min.js +26 -0
  27. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.development.js +20 -0
  28. package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.production.min.js +10 -0
  29. package/tests/e2e-fixtures/react/node_modules/react/index.js +7 -0
  30. package/tests/e2e-fixtures/react/node_modules/react/jsx-dev-runtime.js +7 -0
  31. package/tests/e2e-fixtures/react/node_modules/react/jsx-runtime.js +7 -0
  32. package/tests/e2e-fixtures/react/node_modules/react/package.json +47 -0
  33. package/tests/e2e-fixtures/react/node_modules/react/react.shared-subset.js +7 -0
  34. package/tests/e2e-fixtures/react/node_modules/react/umd/react.development.js +3342 -0
  35. package/tests/e2e-fixtures/react/node_modules/react/umd/react.production.min.js +31 -0
  36. package/tests/e2e-fixtures/react/node_modules/react/umd/react.profiling.min.js +31 -0
  37. package/tests/e2e-fixtures/react/node_modules/react-dom/LICENSE +21 -0
  38. package/tests/e2e-fixtures/react/node_modules/react-dom/README.md +60 -0
  39. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +7018 -0
  40. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +93 -0
  41. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js +7078 -0
  42. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.js +101 -0
  43. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.development.js +7003 -0
  44. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +96 -0
  45. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.development.js +7059 -0
  46. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +102 -0
  47. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.development.js +1741 -0
  48. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +40 -0
  49. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.development.js +29868 -0
  50. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.production.min.js +323 -0
  51. package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.profiling.min.js +367 -0
  52. package/tests/e2e-fixtures/react/node_modules/react-dom/client.js +25 -0
  53. package/tests/e2e-fixtures/react/node_modules/react-dom/index.js +38 -0
  54. package/tests/e2e-fixtures/react/node_modules/react-dom/package.json +62 -0
  55. package/tests/e2e-fixtures/react/node_modules/react-dom/profiling.js +38 -0
  56. package/tests/e2e-fixtures/react/node_modules/react-dom/server.browser.js +17 -0
  57. package/tests/e2e-fixtures/react/node_modules/react-dom/server.js +3 -0
  58. package/tests/e2e-fixtures/react/node_modules/react-dom/server.node.js +17 -0
  59. package/tests/e2e-fixtures/react/node_modules/react-dom/test-utils.js +7 -0
  60. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.development.js +7015 -0
  61. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.production.min.js +75 -0
  62. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.development.js +7000 -0
  63. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +76 -0
  64. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.development.js +1737 -0
  65. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +33 -0
  66. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.development.js +29869 -0
  67. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.production.min.js +267 -0
  68. package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.profiling.min.js +285 -0
  69. package/tests/e2e-fixtures/react/node_modules/scheduler/LICENSE +21 -0
  70. package/tests/e2e-fixtures/react/node_modules/scheduler/README.md +9 -0
  71. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +700 -0
  72. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_mock.production.min.js +20 -0
  73. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +207 -0
  74. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.min.js +14 -0
  75. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.development.js +634 -0
  76. package/tests/e2e-fixtures/react/node_modules/scheduler/cjs/scheduler.production.min.js +19 -0
  77. package/tests/e2e-fixtures/react/node_modules/scheduler/index.js +7 -0
  78. package/tests/e2e-fixtures/react/node_modules/scheduler/package.json +36 -0
  79. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.development.js +699 -0
  80. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler-unstable_mock.production.min.js +19 -0
  81. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.development.js +152 -0
  82. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.production.min.js +146 -0
  83. package/tests/e2e-fixtures/react/node_modules/scheduler/umd/scheduler.profiling.min.js +146 -0
  84. package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_mock.js +7 -0
  85. package/tests/e2e-fixtures/react/node_modules/scheduler/unstable_post_task.js +7 -0
  86. package/tests/e2e-fixtures/react/package.json +2 -0
  87. package/tests/e2e-fixtures/react/webpack.config.js +6 -2
  88. package/tests/helpers/emitFile.ts +58 -4
  89. package/tests/normalizeOptions.test.ts +58 -16
  90. package/tsconfig.tsbuildinfo +1 -1
  91. package/dist/logger.d.ts +0 -7
  92. package/dist/logger.d.ts.map +0 -1
  93. package/dist/logger.js +0 -28
  94. package/dist/logger.js.map +0 -1
  95. package/dist/ws.d.ts +0 -13
  96. package/dist/ws.d.ts.map +0 -1
  97. package/dist/ws.js +0 -12
  98. package/dist/ws.js.map +0 -1
  99. package/src/logger.ts +0 -30
  100. package/src/ws.ts +0 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # rspack-dev-server
2
2
 
3
+ ## 0.0.22
4
+
5
+ ### Patch Changes
6
+
7
+ - 59edc2cb4: fix watch options
8
+ - ac02a096e: fix: getRspackMemoryAssets failed to get index.html when request path is /
9
+ feat: extends webpack-dev-server
10
+ - 290bf7fb5: feat: add devServer.historyApiFallback options
11
+ - d88ffa666: feat: support devServer.client.webSocketUrl
12
+ - Updated dependencies [ce31cd029]
13
+ - Updated dependencies [59edc2cb4]
14
+ - Updated dependencies [ac02a096e]
15
+ - Updated dependencies [290bf7fb5]
16
+ - Updated dependencies [d88ffa666]
17
+ - Updated dependencies [0269ff40d]
18
+ - @rspack/dev-middleware@0.0.22
19
+ - @rspack/dev-client@0.0.22
20
+ - @rspack/dev-server@0.0.22
21
+
3
22
  ## 0.0.21
4
23
 
5
24
  ### Patch Changes
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Rspack
3
+ Copyright (c) 2022-present Rspack Authors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/config.d.ts CHANGED
@@ -1,19 +1,24 @@
1
- import type { Dev, WebSocketServerOptions, RspackOptionsNormalized } from "@rspack/core";
2
- import type { WatchOptions } from "chokidar";
3
- import { ProxyOptions } from "@rspack/core/src/config/devServer";
4
- export interface ResolvedDev {
5
- host: string;
1
+ import WebpackDevServer from "webpack-dev-server";
2
+ import type { DevServer } from "@rspack/core";
3
+ export type { DevServer };
4
+ export interface ResolvedDevServer extends DevServer {
6
5
  port: number | string;
7
- static: {
8
- directory: string;
9
- watch: false | WatchOptions;
10
- };
11
- devMiddleware: {};
6
+ static: false | Array<WebpackDevServer.NormalizedStatic>;
7
+ devMiddleware: DevServer["devMiddleware"];
12
8
  hot: boolean;
13
- open: boolean;
9
+ open: WebpackDevServer.Open[];
10
+ magicHtml: boolean;
14
11
  liveReload: boolean;
15
- webSocketServer: false | WebSocketServerOptions;
16
- proxy: ProxyOptions;
12
+ webSocketServer: false | WebpackDevServer.WebSocketServerConfiguration;
13
+ proxy: WebpackDevServer.ProxyConfigArray;
14
+ client: WebpackDevServer.ClientConfiguration;
15
+ allowedHosts: "auto" | string[] | "all";
16
+ bonjour: false | Record<string, never> | WebpackDevServer.BonjourOptions;
17
+ compress: boolean;
18
+ historyApiFallback: false | WebpackDevServer.ConnectHistoryApiFallbackOptions;
19
+ server: WebpackDevServer.ServerConfiguration;
20
+ ipc: string | undefined;
21
+ setupExitSignals: boolean;
22
+ watchFiles: WebpackDevServer.WatchFiles[];
17
23
  }
18
- export declare function resolveDevOptions(devConfig: Dev, compilerOptions: RspackOptionsNormalized): ResolvedDev;
19
24
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,GAAG,EACH,sBAAsB,EACtB,uBAAuB,EACvB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,KAAK,GAAG,YAAY,CAAC;KAC5B,CAAC;IACF,aAAa,EAAE,EAAE,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,KAAK,GAAG,sBAAsB,CAAC;IAChD,KAAK,EAAE,YAAY,CAAC;CACpB;AAED,wBAAgB,iBAAiB,CAChC,SAAS,EAAE,GAAG,EACd,eAAe,EAAE,uBAAuB,GACtC,WAAW,CA2Cb"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IACnD,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACzD,aAAa,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAE1C,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,KAAK,GAAG,gBAAgB,CAAC,4BAA4B,CAAC;IACvE,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IACzC,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAC7C,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,gBAAgB,CAAC,cAAc,CAAC;IACzE,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,KAAK,GAAG,gBAAgB,CAAC,gCAAgC,CAAC;IAC9E,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAC7C,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,gBAAgB,CAAC,UAAU,EAAE,CAAC;CAC1C"}
package/dist/config.js CHANGED
@@ -1,55 +1,3 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.resolveDevOptions = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const core_1 = require("@rspack/core");
9
- function resolveDevOptions(devConfig, compilerOptions) {
10
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
11
- const open = true;
12
- const proxy = devConfig.proxy;
13
- const hot = (_a = devConfig.hot) !== null && _a !== void 0 ? _a : true;
14
- // --- static
15
- const directory = (_c = (_b = devConfig.static) === null || _b === void 0 ? void 0 : _b.directory) !== null && _c !== void 0 ? _c : path_1.default.resolve(compilerOptions.context, compilerOptions.output.path);
16
- let watch = {};
17
- if (((_d = devConfig.static) === null || _d === void 0 ? void 0 : _d.watch) === false) {
18
- watch = false;
19
- }
20
- else if (((_e = devConfig.static) === null || _e === void 0 ? void 0 : _e.watch) === true) {
21
- watch = (0, core_1.resolveWatchOption)({});
22
- }
23
- else if ((_f = devConfig.static) === null || _f === void 0 ? void 0 : _f.watch) {
24
- watch = (_g = devConfig.static) === null || _g === void 0 ? void 0 : _g.watch;
25
- }
26
- // ---
27
- const devMiddleware = (_h = devConfig.devMiddleware) !== null && _h !== void 0 ? _h : {};
28
- const liveReload = (_j = devConfig.liveReload) !== null && _j !== void 0 ? _j : true;
29
- let webSocketServer = {};
30
- if (devConfig.webSocketServer === false) {
31
- webSocketServer = false;
32
- }
33
- else if (devConfig.webSocketServer === true) {
34
- webSocketServer = {};
35
- }
36
- else if (devConfig.webSocketServer) {
37
- webSocketServer = devConfig.webSocketServer;
38
- }
39
- return {
40
- host: devConfig.host,
41
- port: devConfig.port ? Number(devConfig.port) : undefined,
42
- static: {
43
- directory,
44
- watch
45
- },
46
- devMiddleware,
47
- open,
48
- hot,
49
- liveReload,
50
- webSocketServer,
51
- proxy
52
- };
53
- }
54
- exports.resolveDevOptions = resolveDevOptions;
55
3
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;AAMA,gDAAwB;A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5C;IAED,OAAO;QACN,IAAI,EAAE,SAAS,CAAC,IAAI;QACpB,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QACzD,MAAM,EAAE;YACP,SAAS;YACT,KAAK;SACL;QACD,aAAa;QACb,IAAI;QACJ,GAAG;QACH,UAAU;QACV,eAAe;QACf,KAAK;KACL,CAAC;AACH,CAAC;AA9CD,8CA8CC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":""}
package/dist/server.d.ts CHANGED
@@ -1,55 +1,28 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import type { Compiler, Dev } from "@rspack/core";
4
- import type { Logger } from "./logger";
3
+ import { Compiler, MultiCompiler } from "@rspack/core";
5
4
  import type { Socket } from "net";
6
5
  import type { FSWatcher, WatchOptions } from "chokidar";
7
- import type { WebSocketServer, ClientConnection } from "./ws";
8
- import type { Application } from "express";
9
6
  import type { Server } from "http";
10
- import type { ResolvedDev } from "./config";
11
- declare type Host = "local-ip" | "local-ipv4" | "local-ipv6" | string;
12
- declare type Port = number | string | "auto";
13
- export declare class RspackDevServer {
14
- compiler: Compiler;
15
- options: ResolvedDev;
16
- logger: Logger;
7
+ import WebpackDevServer from "webpack-dev-server";
8
+ import type { ResolvedDevServer, DevServer } from "./config";
9
+ export declare class RspackDevServer extends WebpackDevServer {
10
+ /**
11
+ * resolved after `normalizedOptions`
12
+ */
13
+ options: ResolvedDevServer;
17
14
  staticWatchers: FSWatcher[];
18
15
  sockets: Socket[];
19
- app: Application;
20
16
  server: Server;
21
- private listeners;
22
- private currentHash;
23
- private middleware;
24
- webSocketServer: WebSocketServer | undefined;
25
- constructor(compiler: Compiler);
26
- normalizeOptions(dev?: Dev): ResolvedDev;
27
- rewriteCompilerOptions(): void;
28
- addAdditionEntires(): void;
29
- static isAbsoluteURL(URL: string): boolean;
30
- static findIp(gateway: string): string | undefined;
31
- static internalIP(family: "v6" | "v4"): Promise<string | undefined>;
32
- static internalIPSync(family: "v6" | "v4"): Promise<string | undefined>;
33
- static getHostname(hostname?: Host): Promise<string>;
34
- static getFreePort(port: Port, host: string): Promise<string | number>;
35
- static findCacheDir(): string;
36
- private getCompilerOptions;
37
- sendMessage(clients: ClientConnection[], type: string, data?: any, params?: any): void;
17
+ compiler: Compiler | MultiCompiler;
18
+ webSocketServer: WebpackDevServer.WebSocketServerImplementation | undefined;
19
+ constructor(options: DevServer, compiler: Compiler | MultiCompiler);
20
+ addAdditionEntires(compiler: Compiler): void;
38
21
  watchFiles(watchPath: string | string[], watchOptions?: WatchOptions): void;
39
- invalidate(callback?: () => void): void;
40
- start(): Promise<void>;
41
- startCallback(callback?: (err?: Error) => void): void;
42
- stopCallback(callback?: (err?: Error) => void): void;
43
- listen(port: Port, hostname: string, fn: (err?: Error) => void): void;
44
- close(callback?: (err?: Error) => void): void;
45
- stop(): Promise<void>;
46
- private setupApp;
47
- private setupWatchStaticFiles;
22
+ getClientTransport(): string;
23
+ initialize(): Promise<void>;
48
24
  private setupDevMiddleware;
49
- private createWebsocketServer;
50
25
  private setupMiddlewares;
51
- private createServer;
52
26
  private setupHooks;
53
27
  }
54
- export {};
55
28
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAA2B,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAC9D,OAAO,KA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