xypriss 2.2.0 → 2.2.2

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.md +85 -30
  2. package/dist/cjs/src/file-upload.js +311 -0
  3. package/dist/cjs/src/file-upload.js.map +1 -0
  4. package/dist/cjs/src/index.js +8 -0
  5. package/dist/cjs/src/index.js.map +1 -1
  6. package/dist/cjs/src/plugins/modules/network/builtin/CompressionPlugin.js +2 -110
  7. package/dist/cjs/src/plugins/modules/network/builtin/CompressionPlugin.js.map +1 -1
  8. package/dist/cjs/src/plugins/modules/network/builtin/ConnectionPlugin.js.map +1 -1
  9. package/dist/cjs/src/plugins/modules/network/core/NetworkPlugin.js.map +1 -1
  10. package/dist/cjs/src/plugins/modules/network/types/NetworkTypes.js.map +1 -1
  11. package/dist/cjs/src/server/FastServer.js +64 -23
  12. package/dist/cjs/src/server/FastServer.js.map +1 -1
  13. package/dist/cjs/src/server/components/fastapi/FileUploadManager.js +13 -4
  14. package/dist/cjs/src/server/components/fastapi/FileUploadManager.js.map +1 -1
  15. package/dist/cjs/src/server/components/fastapi/RouteManager.js.map +1 -1
  16. package/dist/cjs/src/server/components/fastapi/smart-routes.js.map +1 -1
  17. package/dist/cjs/src/server/core/HttpServer.js +13 -0
  18. package/dist/cjs/src/server/core/HttpServer.js.map +1 -1
  19. package/dist/cjs/src/server/core/XyprissApp.js.map +1 -1
  20. package/dist/cjs/src/server/handlers/NotFoundHandler.js.map +1 -1
  21. package/dist/cjs/src/server/optimization/RequestPreCompiler.js +1 -0
  22. package/dist/cjs/src/server/optimization/RequestPreCompiler.js.map +1 -1
  23. package/dist/cjs/src/server/utils/ConfigLoader.js +245 -148
  24. package/dist/cjs/src/server/utils/ConfigLoader.js.map +1 -1
  25. package/dist/esm/src/file-upload.js +304 -0
  26. package/dist/esm/src/file-upload.js.map +1 -0
  27. package/dist/esm/src/index.js +1 -0
  28. package/dist/esm/src/index.js.map +1 -1
  29. package/dist/esm/src/plugins/modules/network/builtin/CompressionPlugin.js +2 -110
  30. package/dist/esm/src/plugins/modules/network/builtin/CompressionPlugin.js.map +1 -1
  31. package/dist/esm/src/plugins/modules/network/builtin/ConnectionPlugin.js.map +1 -1
  32. package/dist/esm/src/plugins/modules/network/core/NetworkPlugin.js.map +1 -1
  33. package/dist/esm/src/plugins/modules/network/types/NetworkTypes.js.map +1 -1
  34. package/dist/esm/src/server/FastServer.js +64 -23
  35. package/dist/esm/src/server/FastServer.js.map +1 -1
  36. package/dist/esm/src/server/components/fastapi/FileUploadManager.js +13 -4
  37. package/dist/esm/src/server/components/fastapi/FileUploadManager.js.map +1 -1
  38. package/dist/esm/src/server/components/fastapi/RouteManager.js.map +1 -1
  39. package/dist/esm/src/server/components/fastapi/smart-routes.js.map +1 -1
  40. package/dist/esm/src/server/core/HttpServer.js +13 -0
  41. package/dist/esm/src/server/core/HttpServer.js.map +1 -1
  42. package/dist/esm/src/server/core/XyprissApp.js.map +1 -1
  43. package/dist/esm/src/server/handlers/NotFoundHandler.js.map +1 -1
  44. package/dist/esm/src/server/optimization/RequestPreCompiler.js +1 -0
  45. package/dist/esm/src/server/optimization/RequestPreCompiler.js.map +1 -1
  46. package/dist/esm/src/server/utils/ConfigLoader.js +227 -151
  47. package/dist/esm/src/server/utils/ConfigLoader.js.map +1 -1
  48. package/dist/index.d.ts +3854 -3734
  49. package/package.json +1 -2
@@ -3,207 +3,304 @@
3
3
  var fs = require('fs');
4
4
  var path = require('path');
5
5
 
6
+ function _interopNamespaceDefault(e) {
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
24
+ var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
25
+
26
+ /**
27
+ * XyPriss Configuration Loader
28
+ *
29
+ * Automatically loads configuration from external files (TypeScript or JSON)
30
+ * Supports xypriss.config.ts, xypriss.config.js, and xypriss.config.json files
31
+ *
32
+ * @fileoverview Configuration loader for external config files
33
+ * @version 1.0.0
34
+ * @author XyPriss Team
35
+ * @since 2025-01-01
36
+ */
6
37
  /**
7
- * Configuration Loader for XyPrissJS
8
- * Loads configuration from various sources with priority order
38
+ * Configuration file names to search for (in order of preference)
39
+ */
40
+ const CONFIG_FILES = [
41
+ "xypriss.config.ts",
42
+ "xypriss.config.js",
43
+ "xypriss.config.json",
44
+ "xypriss.config.cjs",
45
+ "xypriss.config.mjs",
46
+ ];
47
+ /**
48
+ * Configuration loader class
49
+ * Handles loading and validation of external configuration files
9
50
  */
10
51
  class ConfigLoader {
11
52
  /**
12
- * Load configuration from file system
53
+ * Load configuration from external files (synchronous - JSON only)
54
+ *
55
+ * Searches for JSON configuration files in the current working directory
56
+ * and loads the first one found. This is a synchronous version for use in constructors.
57
+ *
58
+ * @param cwd - Current working directory (defaults to process.cwd())
59
+ * @returns Loaded configuration or null if no config found
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * const configLoader = new ConfigLoader();
64
+ * const config = configLoader.loadConfigSync();
65
+ * if (config) {
66
+ * console.log("Loaded config from:", config._source);
67
+ * }
68
+ * ```
13
69
  */
14
- static loadConfig(options = {}) {
15
- const { configFile, searchPaths = ConfigLoader.DEFAULT_SEARCH_PATHS, allowedExtensions = [".js", ".ts", ".json", ".mjs"], } = options;
16
- if (configFile &&
17
- !allowedExtensions.some((ext) => configFile.endsWith(ext))) {
18
- console.warn(`Config file ${configFile} has unsupported extension. Allowed extensions: ${allowedExtensions.join(", ")}`);
19
- return null;
20
- }
21
- // If specific config file is provided, try to load it
22
- if (configFile) {
23
- const config = ConfigLoader.loadConfigFile(configFile);
24
- if (config) {
25
- console.log(`✔Loaded configuration from: ${configFile}`);
26
- return config;
70
+ loadConfigSync(cwd = process.cwd()) {
71
+ // Only load JSON files synchronously for constructor use
72
+ const jsonConfigPath = path__namespace.resolve(cwd, "xypriss.config.json");
73
+ if (fs__namespace.existsSync(jsonConfigPath)) {
74
+ try {
75
+ const config = this.loadJsonConfig(jsonConfigPath);
76
+ if (config && typeof config === "object") {
77
+ // Add source information for debugging
78
+ config._source = jsonConfigPath;
79
+ return config;
80
+ }
81
+ }
82
+ catch (error) {
83
+ // Silently fail in constructor - config loading errors should not break initialization
84
+ console.warn(`Warning: Failed to load JSON config from ${jsonConfigPath}:`, error);
27
85
  }
28
86
  }
29
- // Search for config files in search paths
30
- for (const searchPath of searchPaths) {
31
- for (const configFileName of ConfigLoader.DEFAULT_CONFIG_FILES) {
32
- const configPath = path.join(searchPath, configFileName);
33
- if (fs.existsSync(configPath)) {
34
- const config = ConfigLoader.loadConfigFile(configPath);
35
- if (config) {
36
- console.log(`✔Loaded configuration from: ${configPath}`);
87
+ return null;
88
+ }
89
+ /**
90
+ * Load configuration from external files (asynchronous)
91
+ *
92
+ * Searches for configuration files in the current working directory
93
+ * and loads the first one found. Supports TypeScript, JavaScript, and JSON files.
94
+ *
95
+ * @param cwd - Current working directory (defaults to process.cwd())
96
+ * @returns Promise resolving to loaded configuration or null if no config found
97
+ *
98
+ * @example
99
+ * ```typescript
100
+ * const configLoader = new ConfigLoader();
101
+ * const config = await configLoader.loadConfig();
102
+ * if (config) {
103
+ * console.log("Loaded config from:", config._source);
104
+ * }
105
+ * ```
106
+ */
107
+ async loadConfig(cwd = process.cwd()) {
108
+ for (const configFile of CONFIG_FILES) {
109
+ const configPath = path__namespace.resolve(cwd, configFile);
110
+ if (fs__namespace.existsSync(configPath)) {
111
+ try {
112
+ const config = await this.loadConfigFile(configPath);
113
+ if (config && typeof config === "object") {
114
+ // Add source information for debugging
115
+ config._source = configPath;
37
116
  return config;
38
117
  }
39
118
  }
119
+ catch (error) {
120
+ console.warn(`Warning: Failed to load config from ${configPath}:`, error);
121
+ // Continue to next file instead of failing
122
+ }
40
123
  }
41
124
  }
42
- return null;
125
+ return null; // No configuration file found
43
126
  }
44
127
  /**
45
128
  * Load configuration from a specific file
129
+ *
130
+ * @param configPath - Absolute path to the configuration file
131
+ * @returns Promise resolving to the loaded configuration
132
+ * @private
46
133
  */
47
- static loadConfigFile(filePath) {
48
- try {
49
- if (!fs.existsSync(filePath)) {
50
- return null;
51
- }
52
- const ext = filePath.split(".").pop()?.toLowerCase();
53
- switch (ext) {
54
- case "json":
55
- return ConfigLoader.loadJsonConfig(filePath);
56
- case "js":
57
- case "mjs":
58
- return ConfigLoader.loadJsConfig(filePath);
59
- case "ts":
60
- return ConfigLoader.loadTsConfig(filePath);
61
- default:
62
- // Try to parse as JSON for .XyPrissrc files
63
- return ConfigLoader.loadJsonConfig(filePath);
64
- }
65
- }
66
- catch (error) {
67
- console.warn(` Failed to load config from ${filePath}: ${error.message}`);
68
- return null;
134
+ async loadConfigFile(configPath) {
135
+ const ext = path__namespace.extname(configPath).toLowerCase();
136
+ switch (ext) {
137
+ case ".json":
138
+ return this.loadJsonConfig(configPath);
139
+ case ".js":
140
+ case ".cjs":
141
+ return this.loadJsConfig(configPath);
142
+ case ".mjs":
143
+ return this.loadMjsConfig(configPath);
144
+ case ".ts":
145
+ return this.loadTsConfig(configPath);
146
+ default:
147
+ throw new Error(`Unsupported config file extension: ${ext}`);
69
148
  }
70
149
  }
71
150
  /**
72
- * Load JSON configuration
151
+ * Load JSON configuration file
152
+ *
153
+ * @param configPath - Path to JSON config file
154
+ * @returns Parsed JSON configuration
155
+ * @private
156
+ */
157
+ loadJsonConfig(configPath) {
158
+ const content = fs__namespace.readFileSync(configPath, "utf-8");
159
+ return JSON.parse(content);
160
+ }
161
+ /**
162
+ * Load JavaScript configuration file
163
+ *
164
+ * @param configPath - Path to JS config file
165
+ * @returns Configuration object exported by the JS file
166
+ * @private
73
167
  */
74
- static loadJsonConfig(filePath) {
168
+ async loadJsConfig(configPath) {
169
+ // For CommonJS and ESM files, we need dynamic import which works for both
75
170
  try {
76
- const content = fs.readFileSync(filePath, "utf8");
77
- return JSON.parse(content);
171
+ // Use dynamic import which works for both CommonJS and ESM
172
+ const config = await import(configPath);
173
+ // Handle both default export and named exports
174
+ return config.default || config;
78
175
  }
79
176
  catch (error) {
80
- console.warn(` Failed to parse JSON config ${filePath}: ${error.message}`);
81
- return null;
177
+ // Fallback to require for CommonJS in environments where dynamic import fails
178
+ try {
179
+ // Clear require cache to allow reloading
180
+ delete require.cache[require.resolve(configPath)];
181
+ const config = require(configPath);
182
+ // Handle both default export and module.exports
183
+ return config.default || config;
184
+ }
185
+ catch (fallbackError) {
186
+ throw new Error(`Failed to load JS config: ${error}. Fallback also failed: ${fallbackError}`);
187
+ }
82
188
  }
83
189
  }
84
190
  /**
85
- * Load JavaScript configuration
191
+ * Load ES Module configuration file
192
+ *
193
+ * @param configPath - Path to MJS config file
194
+ * @returns Configuration object exported by the MJS file
195
+ * @private
86
196
  */
87
- static loadJsConfig(filePath) {
197
+ async loadMjsConfig(configPath) {
198
+ // For ES modules, we need dynamic import
88
199
  try {
89
- // Clear require cache to allow hot reloading
90
- delete require.cache[require.resolve(filePath)];
91
- const config = require(filePath);
92
- // Handle both default export and named export
200
+ const config = await import(configPath);
93
201
  return config.default || config;
94
202
  }
95
203
  catch (error) {
96
- console.warn(` Failed to load JS config ${filePath}: ${error.message}`);
97
- return null;
204
+ throw new Error(`Failed to load MJS config: ${error}`);
98
205
  }
99
206
  }
100
207
  /**
101
- * Load TypeScript configuration (requires ts-node or similar)
208
+ * Load TypeScript configuration file
209
+ *
210
+ * @param configPath - Path to TS config file
211
+ * @returns Configuration object exported by the TS file
212
+ * @private
102
213
  */
103
- static loadTsConfig(filePath) {
214
+ async loadTsConfig(configPath) {
104
215
  try {
105
- // Try to register TypeScript if not already registered
106
- try {
107
- require("ts-node/register");
216
+ // First, try to load as JavaScript (if user compiled it)
217
+ const jsPath = configPath.replace(/\.ts$/, ".js");
218
+ if (fs__namespace.existsSync(jsPath)) {
219
+ return this.loadJsConfig(jsPath);
108
220
  }
109
- catch {
110
- // ts-node not available, try tsx
111
- try {
112
- require("tsx/cjs");
113
- }
114
- catch {
115
- console.warn(` TypeScript config found but no TypeScript loader available. Install ts-node or tsx.`);
116
- return null;
117
- }
118
- }
119
- // Clear require cache
120
- delete require.cache[require.resolve(filePath)];
121
- const config = require(filePath);
122
- // Handle both default export and named export
221
+ // Try dynamic import directly (works if ts-node or similar is available)
222
+ const config = await import(configPath);
123
223
  return config.default || config;
124
224
  }
125
225
  catch (error) {
126
- console.warn(` Failed to load TS config ${filePath}: ${error.message}`);
127
- return null;
128
- }
129
- }
130
- /**
131
- * Merge configurations with priority order
132
- */
133
- static mergeConfigs(baseConfig, ...configs) {
134
- let merged = { ...baseConfig };
135
- for (const config of configs) {
136
- if (config) {
137
- merged = ConfigLoader.deepMerge(merged, config);
226
+ // If direct import fails, try to compile with ts-node if available
227
+ try {
228
+ // Check if ts-node is available
229
+ require.resolve("ts-node");
230
+ // Register ts-node for TypeScript compilation
231
+ require("ts-node/register");
232
+ // Clear require cache and load the TypeScript file
233
+ delete require.cache[require.resolve(configPath)];
234
+ const config = require(configPath);
235
+ return config.default || config;
236
+ }
237
+ catch (tsNodeError) {
238
+ // If ts-node is not available or fails, provide helpful error message
239
+ throw new Error(`Failed to load TS config from ${configPath}. ` +
240
+ `Please ensure ts-node is installed (npm install ts-node) or compile to JS first. ` +
241
+ `Original error: ${error.message}`);
138
242
  }
139
243
  }
140
- return merged;
141
244
  }
142
245
  /**
143
- * Deep merge two configuration objects
246
+ * Validate configuration object
247
+ *
248
+ * Performs basic validation on the loaded configuration
249
+ *
250
+ * @param config - Configuration object to validate
251
+ * @returns True if configuration is valid
252
+ *
253
+ * @example
254
+ * ```typescript
255
+ * const loader = new ConfigLoader();
256
+ * const config = await loader.loadConfig();
257
+ * if (config && loader.validateConfig(config)) {
258
+ * console.log("Config is valid");
259
+ * }
260
+ * ```
144
261
  */
145
- static deepMerge(target, source) {
146
- const result = { ...target };
147
- for (const key in source) {
148
- if (source.hasOwnProperty(key)) {
149
- if (typeof source[key] === "object" &&
150
- source[key] !== null &&
151
- !Array.isArray(source[key]) &&
152
- typeof target[key] === "object" &&
153
- target[key] !== null &&
154
- !Array.isArray(target[key])) {
155
- result[key] = ConfigLoader.deepMerge(target[key], source[key]);
156
- }
157
- else {
158
- result[key] = source[key];
159
- }
160
- }
262
+ validateConfig(config) {
263
+ // Basic validation - check if it's an object
264
+ if (!config || typeof config !== "object") {
265
+ return false;
161
266
  }
162
- return result;
267
+ // Check for required structure (at least one valid property)
268
+ const validKeys = [
269
+ "env", "server", "security", "performance", "monitoring",
270
+ "cache", "cluster", "plugins", "requestManagement", "fileUpload"
271
+ ];
272
+ return validKeys.some(key => key in config);
163
273
  }
164
274
  /**
165
- * Validate configuration
275
+ * Get list of available configuration files in a directory
276
+ *
277
+ * @param cwd - Directory to search (defaults to process.cwd())
278
+ * @returns Array of available configuration file names
279
+ *
280
+ * @example
281
+ * ```typescript
282
+ * const loader = new ConfigLoader();
283
+ * const files = loader.getAvailableConfigFiles();
284
+ * console.log("Available config files:", files);
285
+ * ```
166
286
  */
167
- static validateConfig(config) {
168
- const errors = [];
169
- // Validate file watcher configuration
170
- if (config.fileWatcher) {
171
- const fw = config.fileWatcher;
172
- if (fw.typescript?.runner &&
173
- typeof fw.typescript.runner !== "string") {
174
- errors.push("fileWatcher.typescript.runner must be a string");
175
- }
176
- if (fw.typescript?.runnerArgs &&
177
- !Array.isArray(fw.typescript.runnerArgs)) {
178
- errors.push("fileWatcher.typescript.runnerArgs must be an array");
179
- }
180
- if (fw.extensions && !Array.isArray(fw.extensions)) {
181
- errors.push("fileWatcher.extensions must be an array");
182
- }
183
- if (fw.watchPaths && !Array.isArray(fw.watchPaths)) {
184
- errors.push("fileWatcher.watchPaths must be an array");
287
+ getAvailableConfigFiles(cwd = process.cwd()) {
288
+ const available = [];
289
+ for (const configFile of CONFIG_FILES) {
290
+ const configPath = path__namespace.resolve(cwd, configFile);
291
+ if (fs__namespace.existsSync(configPath)) {
292
+ available.push(configFile);
185
293
  }
186
294
  }
187
- return {
188
- valid: errors.length === 0,
189
- errors,
190
- };
295
+ return available;
191
296
  }
192
297
  }
193
- ConfigLoader.DEFAULT_CONFIG_FILES = [
194
- "XyPriss.config.js",
195
- "XyPriss.config.ts",
196
- "XyPriss.config.json",
197
- "XyPriss.config.mjs",
198
- ".XyPrissrc",
199
- ".XyPrissrc.json",
200
- ".XyPrissrc.js",
201
- ];
202
- ConfigLoader.DEFAULT_SEARCH_PATHS = [
203
- process.cwd(),
204
- path.join(process.cwd(), "config"),
205
- path.join(process.cwd(), ".config"),
206
- ];
298
+ /**
299
+ * Default configuration loader instance
300
+ * Can be used directly without creating a new instance
301
+ */
302
+ const configLoader = new ConfigLoader();
207
303
 
208
304
  exports.ConfigLoader = ConfigLoader;
305
+ exports.configLoader = configLoader;
209
306
  //# sourceMappingURL=ConfigLoader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigLoader.js","sources":["../../../../../src/server/utils/ConfigLoader.ts"],"sourcesContent":[null],"names":["join","existsSync","readFileSync"],"mappings":";;;;;AAAA;;;AAGG;MAYU,YAAY,CAAA;AAiBrB;;AAEG;AACI,IAAA,OAAO,UAAU,CACpB,OAAA,GAA+B,EAAE,EAAA;QAEjC,MAAM,EACF,UAAU,EACV,WAAW,GAAG,YAAY,CAAC,oBAAoB,EAC/C,iBAAiB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,GACtD,GAAG,OAAO,CAAC;AAEZ,QAAA,IACI,UAAU;AACV,YAAA,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAC5D;AACE,YAAA,OAAO,CAAC,IAAI,CACR,CAAA,YAAA,EAAe,UAAU,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AC,UAAU,CAAC,EAC1C;AACE,gBAAA,MAAM,CAAC,IAAI,CACP,oDAAoD,CACvD,CAAC;aACL;AAED,YAAA,IAAI,EAAE,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE;AAChD,gBAAA,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;aAC1D;AAED,YAAA,IAAI,EAAE,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE;AAChD,gBAAA,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;aAC1D;SACJ;QAED,OAAO;AACH,YAAA,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM;SACT,CAAC;KACL;;AA9QuB,YAAA,CAAA,oBAAoB,GAAG;IAC3C,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,oBAAoB;IACpB,YAAY;IACZ,iBAAiB;IACjB,eAAe;CAClB,CAAC;AAEsB,YAAA,CAAA,oBAAoB,GAAG;IAC3C,OAAO,CAAC,GAAG,EAAE;AACb,IAAAF,SAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC;AAC7B,IAAAA,SAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC;CACjC;;;;"}
1
+ {"version":3,"file":"ConfigLoader.js","sources":["../../../../../src/server/utils/ConfigLoader.ts"],"sourcesContent":[null],"names":["path","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;AAUG;AAMH;;AAEG;AACH,MAAM,YAAY,GAAG;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,oBAAoB;IACpB,oBAAoB;CACrB,CAAC;AAEF;;;AAGG;MACU,YAAY,CAAA;AACvB;;;;;;;;;;;;;;;;;AAiBG;AACH,IAAA,cAAc,CAAC,GAAA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