@remnawave/xtls-sdk 0.12.5 → 0.14.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 (44) hide show
  1. package/README.md +3 -1
  2. package/build/src/router/interfaces/index.d.ts +0 -1
  3. package/build/src/router/interfaces/index.d.ts.map +1 -1
  4. package/build/src/router/interfaces/index.js +0 -1
  5. package/build/src/router/models/index.d.ts +0 -1
  6. package/build/src/router/models/index.d.ts.map +1 -1
  7. package/build/src/router/models/index.js +0 -1
  8. package/build/src/router/router.service.d.ts +2 -12
  9. package/build/src/router/router.service.d.ts.map +1 -1
  10. package/build/src/router/router.service.js +1 -57
  11. package/build/src/xray-protos/app/geodata/config.d.ts +30 -0
  12. package/build/src/xray-protos/app/geodata/config.d.ts.map +1 -0
  13. package/build/src/xray-protos/app/geodata/config.js +172 -0
  14. package/build/src/xray-protos/app/proxyman/config.d.ts +3 -1
  15. package/build/src/xray-protos/app/proxyman/config.d.ts.map +1 -1
  16. package/build/src/xray-protos/app/proxyman/config.js +27 -6
  17. package/build/src/xray-protos/common/geodata/geodat.d.ts +111 -0
  18. package/build/src/xray-protos/common/geodata/geodat.d.ts.map +1 -0
  19. package/build/src/xray-protos/common/geodata/geodat.js +1027 -0
  20. package/build/src/xray-protos/proxy/dns/config.d.ts +19 -7
  21. package/build/src/xray-protos/proxy/dns/config.d.ts.map +1 -1
  22. package/build/src/xray-protos/proxy/dns/config.js +161 -52
  23. package/build/src/xray-protos/proxy/freedom/config.d.ts +26 -0
  24. package/build/src/xray-protos/proxy/freedom/config.d.ts.map +1 -1
  25. package/build/src/xray-protos/proxy/freedom/config.js +272 -1
  26. package/build/src/xray-protos/proxy/tun/config.d.ts +4 -0
  27. package/build/src/xray-protos/proxy/tun/config.d.ts.map +1 -1
  28. package/build/src/xray-protos/proxy/tun/config.js +80 -3
  29. package/build/src/xray-protos/transport/internet/config.d.ts +0 -2
  30. package/build/src/xray-protos/transport/internet/config.d.ts.map +1 -1
  31. package/build/src/xray-protos/transport/internet/config.js +0 -65
  32. package/package.json +3 -4
  33. package/build/src/router/interfaces/add-source-ip-rule.interface.d.ts +0 -7
  34. package/build/src/router/interfaces/add-source-ip-rule.interface.d.ts.map +0 -1
  35. package/build/src/router/interfaces/add-source-ip-rule.interface.js +0 -2
  36. package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.d.ts +0 -5
  37. package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.d.ts.map +0 -1
  38. package/build/src/router/models/add-source-ip-rule/add-source-ip-rule.response.model.js +0 -9
  39. package/build/src/router/models/add-source-ip-rule/index.d.ts +0 -2
  40. package/build/src/router/models/add-source-ip-rule/index.d.ts.map +0 -1
  41. package/build/src/router/models/add-source-ip-rule/index.js +0 -17
  42. package/build/src/xray-protos/app/router/config.d.ts +0 -193
  43. package/build/src/xray-protos/app/router/config.d.ts.map +0 -1
  44. package/build/src/xray-protos/app/router/config.js +0 -1797
@@ -1,17 +1,29 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { DomainRule } from "../../common/geodata/geodat";
2
3
  import { Endpoint } from "../../common/net/destination";
3
4
  export declare const protobufPackage = "xray.proxy.dns";
5
+ export declare enum RuleAction {
6
+ Direct = 0,
7
+ Drop = 1,
8
+ Reject = 2,
9
+ Hijack = 3,
10
+ UNRECOGNIZED = -1
11
+ }
12
+ export declare function ruleActionFromJSON(object: any): RuleAction;
13
+ export declare function ruleActionToJSON(object: RuleAction): string;
14
+ export interface DNSRuleConfig {
15
+ $type: "xray.proxy.dns.DNSRuleConfig";
16
+ action: RuleAction;
17
+ qtype: number[];
18
+ domain: DomainRule[];
19
+ }
4
20
  export interface Config {
5
21
  $type: "xray.proxy.dns.Config";
6
- /**
7
- * Server is the DNS server address. If specified, this address overrides the
8
- * original one.
9
- */
10
- server: Endpoint | undefined;
11
22
  userLevel: number;
12
- nonIPQuery: string;
13
- blockTypes: number[];
23
+ rule: DNSRuleConfig[];
24
+ server: Endpoint | undefined;
14
25
  }
26
+ export declare const DNSRuleConfig: MessageFns<DNSRuleConfig, "xray.proxy.dns.DNSRuleConfig">;
15
27
  export declare const Config: MessageFns<Config, "xray.proxy.dns.Config">;
16
28
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
17
29
  export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/dns/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAEhD,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,uBAAuB,CAAC;IAC/B;;;OAGG;IACH,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAMD,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,uBAAuB,CAmI9D,CAAC;AAIF,KAAK,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEpF,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,CAAC,GAC9C,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACtE,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAA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,SAAS,MAAM;IAC7C,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
@@ -5,32 +5,168 @@
5
5
  // protoc v6.33.4
6
6
  // source: proxy/dns/config.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Config = exports.protobufPackage = void 0;
8
+ exports.Config = exports.DNSRuleConfig = exports.RuleAction = exports.protobufPackage = void 0;
9
+ exports.ruleActionFromJSON = ruleActionFromJSON;
10
+ exports.ruleActionToJSON = ruleActionToJSON;
9
11
  /* eslint-disable */
10
12
  const wire_1 = require("@bufbuild/protobuf/wire");
13
+ const geodat_1 = require("../../common/geodata/geodat");
11
14
  const destination_1 = require("../../common/net/destination");
12
15
  const typeRegistry_1 = require("../../typeRegistry");
13
16
  exports.protobufPackage = "xray.proxy.dns";
17
+ var RuleAction;
18
+ (function (RuleAction) {
19
+ RuleAction[RuleAction["Direct"] = 0] = "Direct";
20
+ RuleAction[RuleAction["Drop"] = 1] = "Drop";
21
+ RuleAction[RuleAction["Reject"] = 2] = "Reject";
22
+ RuleAction[RuleAction["Hijack"] = 3] = "Hijack";
23
+ RuleAction[RuleAction["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
24
+ })(RuleAction || (exports.RuleAction = RuleAction = {}));
25
+ function ruleActionFromJSON(object) {
26
+ switch (object) {
27
+ case 0:
28
+ case "Direct":
29
+ return RuleAction.Direct;
30
+ case 1:
31
+ case "Drop":
32
+ return RuleAction.Drop;
33
+ case 2:
34
+ case "Reject":
35
+ return RuleAction.Reject;
36
+ case 3:
37
+ case "Hijack":
38
+ return RuleAction.Hijack;
39
+ case -1:
40
+ case "UNRECOGNIZED":
41
+ default:
42
+ return RuleAction.UNRECOGNIZED;
43
+ }
44
+ }
45
+ function ruleActionToJSON(object) {
46
+ switch (object) {
47
+ case RuleAction.Direct:
48
+ return "Direct";
49
+ case RuleAction.Drop:
50
+ return "Drop";
51
+ case RuleAction.Reject:
52
+ return "Reject";
53
+ case RuleAction.Hijack:
54
+ return "Hijack";
55
+ case RuleAction.UNRECOGNIZED:
56
+ default:
57
+ return "UNRECOGNIZED";
58
+ }
59
+ }
60
+ function createBaseDNSRuleConfig() {
61
+ return { $type: "xray.proxy.dns.DNSRuleConfig", action: 0, qtype: [], domain: [] };
62
+ }
63
+ exports.DNSRuleConfig = {
64
+ $type: "xray.proxy.dns.DNSRuleConfig",
65
+ encode(message, writer = new wire_1.BinaryWriter()) {
66
+ if (message.action !== 0) {
67
+ writer.uint32(8).int32(message.action);
68
+ }
69
+ writer.uint32(18).fork();
70
+ for (const v of message.qtype) {
71
+ writer.int32(v);
72
+ }
73
+ writer.join();
74
+ for (const v of message.domain) {
75
+ geodat_1.DomainRule.encode(v, writer.uint32(26).fork()).join();
76
+ }
77
+ return writer;
78
+ },
79
+ decode(input, length) {
80
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
81
+ const end = length === undefined ? reader.len : reader.pos + length;
82
+ const message = createBaseDNSRuleConfig();
83
+ while (reader.pos < end) {
84
+ const tag = reader.uint32();
85
+ switch (tag >>> 3) {
86
+ case 1: {
87
+ if (tag !== 8) {
88
+ break;
89
+ }
90
+ message.action = reader.int32();
91
+ continue;
92
+ }
93
+ case 2: {
94
+ if (tag === 16) {
95
+ message.qtype.push(reader.int32());
96
+ continue;
97
+ }
98
+ if (tag === 18) {
99
+ const end2 = reader.uint32() + reader.pos;
100
+ while (reader.pos < end2) {
101
+ message.qtype.push(reader.int32());
102
+ }
103
+ continue;
104
+ }
105
+ break;
106
+ }
107
+ case 3: {
108
+ if (tag !== 26) {
109
+ break;
110
+ }
111
+ message.domain.push(geodat_1.DomainRule.decode(reader, reader.uint32()));
112
+ continue;
113
+ }
114
+ }
115
+ if ((tag & 7) === 4 || tag === 0) {
116
+ break;
117
+ }
118
+ reader.skip(tag & 7);
119
+ }
120
+ return message;
121
+ },
122
+ fromJSON(object) {
123
+ return {
124
+ $type: exports.DNSRuleConfig.$type,
125
+ action: isSet(object.action) ? ruleActionFromJSON(object.action) : 0,
126
+ qtype: globalThis.Array.isArray(object?.qtype) ? object.qtype.map((e) => globalThis.Number(e)) : [],
127
+ domain: globalThis.Array.isArray(object?.domain) ? object.domain.map((e) => geodat_1.DomainRule.fromJSON(e)) : [],
128
+ };
129
+ },
130
+ toJSON(message) {
131
+ const obj = {};
132
+ if (message.action !== 0) {
133
+ obj.action = ruleActionToJSON(message.action);
134
+ }
135
+ if (message.qtype?.length) {
136
+ obj.qtype = message.qtype.map((e) => Math.round(e));
137
+ }
138
+ if (message.domain?.length) {
139
+ obj.domain = message.domain.map((e) => geodat_1.DomainRule.toJSON(e));
140
+ }
141
+ return obj;
142
+ },
143
+ create(base) {
144
+ return exports.DNSRuleConfig.fromPartial(base ?? {});
145
+ },
146
+ fromPartial(object) {
147
+ const message = createBaseDNSRuleConfig();
148
+ message.action = object.action ?? 0;
149
+ message.qtype = object.qtype?.map((e) => e) || [];
150
+ message.domain = object.domain?.map((e) => geodat_1.DomainRule.fromPartial(e)) || [];
151
+ return message;
152
+ },
153
+ };
154
+ typeRegistry_1.messageTypeRegistry.set(exports.DNSRuleConfig.$type, exports.DNSRuleConfig);
14
155
  function createBaseConfig() {
15
- return { $type: "xray.proxy.dns.Config", server: undefined, userLevel: 0, nonIPQuery: "", blockTypes: [] };
156
+ return { $type: "xray.proxy.dns.Config", userLevel: 0, rule: [], server: undefined };
16
157
  }
17
158
  exports.Config = {
18
159
  $type: "xray.proxy.dns.Config",
19
160
  encode(message, writer = new wire_1.BinaryWriter()) {
20
- if (message.server !== undefined) {
21
- destination_1.Endpoint.encode(message.server, writer.uint32(10).fork()).join();
22
- }
23
161
  if (message.userLevel !== 0) {
24
- writer.uint32(16).uint32(message.userLevel);
162
+ writer.uint32(8).uint32(message.userLevel);
25
163
  }
26
- if (message.nonIPQuery !== "") {
27
- writer.uint32(26).string(message.nonIPQuery);
164
+ for (const v of message.rule) {
165
+ exports.DNSRuleConfig.encode(v, writer.uint32(18).fork()).join();
28
166
  }
29
- writer.uint32(34).fork();
30
- for (const v of message.blockTypes) {
31
- writer.int32(v);
167
+ if (message.server !== undefined) {
168
+ destination_1.Endpoint.encode(message.server, writer.uint32(26).fork()).join();
32
169
  }
33
- writer.join();
34
170
  return writer;
35
171
  },
36
172
  decode(input, length) {
@@ -41,40 +177,26 @@ exports.Config = {
41
177
  const tag = reader.uint32();
42
178
  switch (tag >>> 3) {
43
179
  case 1: {
44
- if (tag !== 10) {
180
+ if (tag !== 8) {
45
181
  break;
46
182
  }
47
- message.server = destination_1.Endpoint.decode(reader, reader.uint32());
183
+ message.userLevel = reader.uint32();
48
184
  continue;
49
185
  }
50
186
  case 2: {
51
- if (tag !== 16) {
187
+ if (tag !== 18) {
52
188
  break;
53
189
  }
54
- message.userLevel = reader.uint32();
190
+ message.rule.push(exports.DNSRuleConfig.decode(reader, reader.uint32()));
55
191
  continue;
56
192
  }
57
193
  case 3: {
58
194
  if (tag !== 26) {
59
195
  break;
60
196
  }
61
- message.nonIPQuery = reader.string();
197
+ message.server = destination_1.Endpoint.decode(reader, reader.uint32());
62
198
  continue;
63
199
  }
64
- case 4: {
65
- if (tag === 32) {
66
- message.blockTypes.push(reader.int32());
67
- continue;
68
- }
69
- if (tag === 34) {
70
- const end2 = reader.uint32() + reader.pos;
71
- while (reader.pos < end2) {
72
- message.blockTypes.push(reader.int32());
73
- }
74
- continue;
75
- }
76
- break;
77
- }
78
200
  }
79
201
  if ((tag & 7) === 4 || tag === 0) {
80
202
  break;
@@ -86,37 +208,25 @@ exports.Config = {
86
208
  fromJSON(object) {
87
209
  return {
88
210
  $type: exports.Config.$type,
89
- server: isSet(object.server) ? destination_1.Endpoint.fromJSON(object.server) : undefined,
90
211
  userLevel: isSet(object.userLevel)
91
212
  ? globalThis.Number(object.userLevel)
92
213
  : isSet(object.user_level)
93
214
  ? globalThis.Number(object.user_level)
94
215
  : 0,
95
- nonIPQuery: isSet(object.nonIPQuery)
96
- ? globalThis.String(object.nonIPQuery)
97
- : isSet(object.non_IP_query)
98
- ? globalThis.String(object.non_IP_query)
99
- : "",
100
- blockTypes: globalThis.Array.isArray(object?.blockTypes)
101
- ? object.blockTypes.map((e) => globalThis.Number(e))
102
- : globalThis.Array.isArray(object?.block_types)
103
- ? object.block_types.map((e) => globalThis.Number(e))
104
- : [],
216
+ rule: globalThis.Array.isArray(object?.rule) ? object.rule.map((e) => exports.DNSRuleConfig.fromJSON(e)) : [],
217
+ server: isSet(object.server) ? destination_1.Endpoint.fromJSON(object.server) : undefined,
105
218
  };
106
219
  },
107
220
  toJSON(message) {
108
221
  const obj = {};
109
- if (message.server !== undefined) {
110
- obj.server = destination_1.Endpoint.toJSON(message.server);
111
- }
112
222
  if (message.userLevel !== 0) {
113
223
  obj.userLevel = Math.round(message.userLevel);
114
224
  }
115
- if (message.nonIPQuery !== "") {
116
- obj.nonIPQuery = message.nonIPQuery;
225
+ if (message.rule?.length) {
226
+ obj.rule = message.rule.map((e) => exports.DNSRuleConfig.toJSON(e));
117
227
  }
118
- if (message.blockTypes?.length) {
119
- obj.blockTypes = message.blockTypes.map((e) => Math.round(e));
228
+ if (message.server !== undefined) {
229
+ obj.server = destination_1.Endpoint.toJSON(message.server);
120
230
  }
121
231
  return obj;
122
232
  },
@@ -125,12 +235,11 @@ exports.Config = {
125
235
  },
126
236
  fromPartial(object) {
127
237
  const message = createBaseConfig();
238
+ message.userLevel = object.userLevel ?? 0;
239
+ message.rule = object.rule?.map((e) => exports.DNSRuleConfig.fromPartial(e)) || [];
128
240
  message.server = (object.server !== undefined && object.server !== null)
129
241
  ? destination_1.Endpoint.fromPartial(object.server)
130
242
  : undefined;
131
- message.userLevel = object.userLevel ?? 0;
132
- message.nonIPQuery = object.nonIPQuery ?? "";
133
- message.blockTypes = object.blockTypes?.map((e) => e) || [];
134
243
  return message;
135
244
  },
136
245
  };
@@ -1,7 +1,17 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { IPRule } from "../../common/geodata/geodat";
3
+ import { Network } from "../../common/net/network";
4
+ import { PortList } from "../../common/net/port";
2
5
  import { ServerEndpoint } from "../../common/protocol/server_spec";
3
6
  import { DomainStrategy } from "../../transport/internet/config";
4
7
  export declare const protobufPackage = "xray.proxy.freedom";
8
+ export declare enum RuleAction {
9
+ Allow = 0,
10
+ Block = 1,
11
+ UNRECOGNIZED = -1
12
+ }
13
+ export declare function ruleActionFromJSON(object: any): RuleAction;
14
+ export declare function ruleActionToJSON(object: RuleAction): string;
5
15
  export interface DestinationOverride {
6
16
  $type: "xray.proxy.freedom.DestinationOverride";
7
17
  server: ServerEndpoint | undefined;
@@ -26,6 +36,19 @@ export interface Noise {
26
36
  packet: Uint8Array;
27
37
  applyTo: string;
28
38
  }
39
+ export interface Range {
40
+ $type: "xray.proxy.freedom.Range";
41
+ min: number;
42
+ max: number;
43
+ }
44
+ export interface FinalRuleConfig {
45
+ $type: "xray.proxy.freedom.FinalRuleConfig";
46
+ action: RuleAction;
47
+ networks: Network[];
48
+ portList: PortList | undefined;
49
+ ip: IPRule[];
50
+ blockDelay: Range | undefined;
51
+ }
29
52
  export interface Config {
30
53
  $type: "xray.proxy.freedom.Config";
31
54
  domainStrategy: DomainStrategy;
@@ -34,10 +57,13 @@ export interface Config {
34
57
  fragment: Fragment | undefined;
35
58
  proxyProtocol: number;
36
59
  noises: Noise[];
60
+ finalRules: FinalRuleConfig[];
37
61
  }
38
62
  export declare const DestinationOverride: MessageFns<DestinationOverride, "xray.proxy.freedom.DestinationOverride">;
39
63
  export declare const Fragment: MessageFns<Fragment, "xray.proxy.freedom.Fragment">;
40
64
  export declare const Noise: MessageFns<Noise, "xray.proxy.freedom.Noise">;
65
+ export declare const Range: MessageFns<Range, "xray.proxy.freedom.Range">;
66
+ export declare const FinalRuleConfig: MessageFns<FinalRuleConfig, "xray.proxy.freedom.FinalRuleConfig">;
41
67
  export declare const Config: MessageFns<Config, "xray.proxy.freedom.Config">;
42
68
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
43
69
  export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/proxy/freedom/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAgD,MAAM,iCAAiC,CAAC;AAG/G,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,wCAAwC,CAAC;IAChD,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,6BAA6B,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;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