@nanocollective/get-md 1.0.1 → 1.0.3
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/README.md +25 -3
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/extractors/metadata-extractor.js +1 -1
- package/dist/extractors/metadata-extractor.js.map +1 -1
- package/dist/extractors/metadata-extractor.spec.d.ts +2 -0
- package/dist/extractors/metadata-extractor.spec.d.ts.map +1 -0
- package/dist/extractors/metadata-extractor.spec.js +486 -0
- package/dist/extractors/metadata-extractor.spec.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.spec.d.ts +2 -0
- package/dist/index.spec.d.ts.map +1 -0
- package/dist/index.spec.js +518 -0
- package/dist/index.spec.js.map +1 -0
- package/dist/optimizers/html-cleaner.js +1 -1
- package/dist/optimizers/html-cleaner.js.map +1 -1
- package/dist/optimizers/html-cleaner.spec.d.ts +2 -0
- package/dist/optimizers/html-cleaner.spec.d.ts.map +1 -0
- package/dist/optimizers/html-cleaner.spec.js +351 -0
- package/dist/optimizers/html-cleaner.spec.js.map +1 -0
- package/dist/optimizers/llm-formatter.js +2 -2
- package/dist/optimizers/llm-formatter.js.map +1 -1
- package/dist/optimizers/llm-formatter.spec.d.ts +2 -0
- package/dist/optimizers/llm-formatter.spec.d.ts.map +1 -0
- package/dist/optimizers/llm-formatter.spec.js +276 -0
- package/dist/optimizers/llm-formatter.spec.js.map +1 -0
- package/dist/optimizers/structure-enhancer.js +3 -3
- package/dist/optimizers/structure-enhancer.js.map +1 -1
- package/dist/optimizers/structure-enhancer.spec.d.ts +2 -0
- package/dist/optimizers/structure-enhancer.spec.d.ts.map +1 -0
- package/dist/optimizers/structure-enhancer.spec.js +331 -0
- package/dist/optimizers/structure-enhancer.spec.js.map +1 -0
- package/dist/parsers/markdown-parser.d.ts +1 -1
- package/dist/parsers/markdown-parser.d.ts.map +1 -1
- package/dist/parsers/markdown-parser.js +58 -37
- package/dist/parsers/markdown-parser.js.map +1 -1
- package/dist/parsers/markdown-parser.spec.js +106 -98
- package/dist/parsers/markdown-parser.spec.js.map +1 -1
- package/dist/utils/url-fetcher.d.ts.map +1 -1
- package/dist/utils/url-fetcher.js +1 -1
- package/dist/utils/url-fetcher.js.map +1 -1
- package/dist/utils/url-fetcher.spec.d.ts +2 -0
- package/dist/utils/url-fetcher.spec.d.ts.map +1 -0
- package/dist/utils/url-fetcher.spec.js +206 -0
- package/dist/utils/url-fetcher.spec.js.map +1 -0
- package/dist/utils/validators.js +1 -1
- package/dist/utils/validators.js.map +1 -1
- package/dist/utils/validators.spec.d.ts +2 -0
- package/dist/utils/validators.spec.d.ts.map +1 -0
- package/dist/utils/validators.spec.js +290 -0
- package/dist/utils/validators.spec.js.map +1 -0
- package/package.json +8 -14
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
// src/optimizers/html-cleaner.spec.ts
|
|
2
|
+
import test from "ava";
|
|
3
|
+
import { cleanHTML } from "./html-cleaner.js";
|
|
4
|
+
test("removes script tags", (t) => {
|
|
5
|
+
const html = `
|
|
6
|
+
<div>
|
|
7
|
+
<p>Content</p>
|
|
8
|
+
<script>alert('test');</script>
|
|
9
|
+
</div>
|
|
10
|
+
`;
|
|
11
|
+
const result = cleanHTML(html);
|
|
12
|
+
t.false(result.includes("<script>"));
|
|
13
|
+
t.true(result.includes("Content"));
|
|
14
|
+
});
|
|
15
|
+
test("removes style tags", (t) => {
|
|
16
|
+
const html = `
|
|
17
|
+
<div>
|
|
18
|
+
<p>Content</p>
|
|
19
|
+
<style>.test { color: red; }</style>
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
22
|
+
const result = cleanHTML(html);
|
|
23
|
+
t.false(result.includes("<style>"));
|
|
24
|
+
t.true(result.includes("Content"));
|
|
25
|
+
});
|
|
26
|
+
test("removes noscript tags", (t) => {
|
|
27
|
+
const html = `
|
|
28
|
+
<div>
|
|
29
|
+
<p>Content</p>
|
|
30
|
+
<noscript>No JS support</noscript>
|
|
31
|
+
</div>
|
|
32
|
+
`;
|
|
33
|
+
const result = cleanHTML(html);
|
|
34
|
+
t.false(result.includes("<noscript>"));
|
|
35
|
+
t.true(result.includes("Content"));
|
|
36
|
+
});
|
|
37
|
+
test("removes HTML comments", (t) => {
|
|
38
|
+
const html = `
|
|
39
|
+
<div>
|
|
40
|
+
<p>Content</p>
|
|
41
|
+
<!-- This is a comment -->
|
|
42
|
+
</div>
|
|
43
|
+
`;
|
|
44
|
+
const result = cleanHTML(html);
|
|
45
|
+
t.false(result.includes("<!-- This is a comment -->"));
|
|
46
|
+
t.true(result.includes("Content"));
|
|
47
|
+
});
|
|
48
|
+
test("removes navigation elements by role", (t) => {
|
|
49
|
+
const html = `
|
|
50
|
+
<div>
|
|
51
|
+
<nav role="navigation">Nav content</nav>
|
|
52
|
+
<div role="banner">Banner content</div>
|
|
53
|
+
<div role="complementary">Sidebar</div>
|
|
54
|
+
<footer role="contentinfo">Footer</footer>
|
|
55
|
+
<p>Main content</p>
|
|
56
|
+
</div>
|
|
57
|
+
`;
|
|
58
|
+
const result = cleanHTML(html);
|
|
59
|
+
t.false(result.includes("Nav content"));
|
|
60
|
+
t.false(result.includes("Banner content"));
|
|
61
|
+
t.false(result.includes("Sidebar"));
|
|
62
|
+
t.false(result.includes("Footer"));
|
|
63
|
+
t.true(result.includes("Main content"));
|
|
64
|
+
});
|
|
65
|
+
test("removes navigation elements by tag and class", (t) => {
|
|
66
|
+
const html = `
|
|
67
|
+
<div>
|
|
68
|
+
<nav class="navbar">Nav</nav>
|
|
69
|
+
<div class="navbar">Nav2</div>
|
|
70
|
+
<p>Content</p>
|
|
71
|
+
</div>
|
|
72
|
+
`;
|
|
73
|
+
const result = cleanHTML(html);
|
|
74
|
+
t.false(result.includes("Nav"));
|
|
75
|
+
t.false(result.includes("Nav2"));
|
|
76
|
+
t.true(result.includes("Content"));
|
|
77
|
+
});
|
|
78
|
+
test("removes aside elements", (t) => {
|
|
79
|
+
const html = `
|
|
80
|
+
<div>
|
|
81
|
+
<aside>Sidebar content</aside>
|
|
82
|
+
<p>Main content</p>
|
|
83
|
+
</div>
|
|
84
|
+
`;
|
|
85
|
+
const result = cleanHTML(html);
|
|
86
|
+
t.false(result.includes("Sidebar content"));
|
|
87
|
+
t.true(result.includes("Main content"));
|
|
88
|
+
});
|
|
89
|
+
test("removes ad elements", (t) => {
|
|
90
|
+
const html = `
|
|
91
|
+
<div>
|
|
92
|
+
<div class="ad">Advertisement</div>
|
|
93
|
+
<div class="ads">More ads</div>
|
|
94
|
+
<div class="advertisement">Yet more ads</div>
|
|
95
|
+
<p>Content</p>
|
|
96
|
+
</div>
|
|
97
|
+
`;
|
|
98
|
+
const result = cleanHTML(html);
|
|
99
|
+
t.false(result.includes("Advertisement"));
|
|
100
|
+
t.false(result.includes("More ads"));
|
|
101
|
+
t.false(result.includes("Yet more ads"));
|
|
102
|
+
t.true(result.includes("Content"));
|
|
103
|
+
});
|
|
104
|
+
test("removes social media elements", (t) => {
|
|
105
|
+
const html = `
|
|
106
|
+
<div>
|
|
107
|
+
<div class="social-share">Share this</div>
|
|
108
|
+
<div class="share-buttons">Share buttons</div>
|
|
109
|
+
<p>Content</p>
|
|
110
|
+
</div>
|
|
111
|
+
`;
|
|
112
|
+
const result = cleanHTML(html);
|
|
113
|
+
t.false(result.includes("Share this"));
|
|
114
|
+
t.false(result.includes("Share buttons"));
|
|
115
|
+
t.true(result.includes("Content"));
|
|
116
|
+
});
|
|
117
|
+
test("removes comment sections", (t) => {
|
|
118
|
+
const html = `
|
|
119
|
+
<div>
|
|
120
|
+
<div class="comments">Comments section</div>
|
|
121
|
+
<div id="comments">More comments</div>
|
|
122
|
+
<p>Content</p>
|
|
123
|
+
</div>
|
|
124
|
+
`;
|
|
125
|
+
const result = cleanHTML(html);
|
|
126
|
+
t.false(result.includes("Comments section"));
|
|
127
|
+
t.false(result.includes("More comments"));
|
|
128
|
+
t.true(result.includes("Content"));
|
|
129
|
+
});
|
|
130
|
+
test("removes cookie notices", (t) => {
|
|
131
|
+
const html = `
|
|
132
|
+
<div>
|
|
133
|
+
<div class="cookie-notice">We use cookies</div>
|
|
134
|
+
<p>Content</p>
|
|
135
|
+
</div>
|
|
136
|
+
`;
|
|
137
|
+
const result = cleanHTML(html);
|
|
138
|
+
t.false(result.includes("We use cookies"));
|
|
139
|
+
t.true(result.includes("Content"));
|
|
140
|
+
});
|
|
141
|
+
test("removes elements with noise text (short content)", (t) => {
|
|
142
|
+
const html = `
|
|
143
|
+
<div>
|
|
144
|
+
<div>Accept cookies now</div>
|
|
145
|
+
<div>Sign up for our newsletter</div>
|
|
146
|
+
<div>Follow us on social media</div>
|
|
147
|
+
</div>
|
|
148
|
+
`;
|
|
149
|
+
const result = cleanHTML(html);
|
|
150
|
+
// These short elements with noise keywords should be removed
|
|
151
|
+
t.false(result.includes("Accept cookies"));
|
|
152
|
+
t.false(result.includes("Sign up for"));
|
|
153
|
+
t.false(result.includes("Follow us"));
|
|
154
|
+
});
|
|
155
|
+
test("preserves elements with noise keywords if content is long", (t) => {
|
|
156
|
+
const html = `
|
|
157
|
+
<div>
|
|
158
|
+
<p>${"This article discusses cookie policy and how it affects your browsing. ".repeat(10)}</p>
|
|
159
|
+
</div>
|
|
160
|
+
`;
|
|
161
|
+
const result = cleanHTML(html);
|
|
162
|
+
t.true(result.includes("cookie policy"));
|
|
163
|
+
});
|
|
164
|
+
test("cleans attributes but keeps essential ones", (t) => {
|
|
165
|
+
const html = `
|
|
166
|
+
<div id="test" class="container" data-value="123">
|
|
167
|
+
<a href="https://example.com" target="_blank" rel="noopener">Link</a>
|
|
168
|
+
<img src="image.jpg" alt="Test" class="img-fluid" />
|
|
169
|
+
</div>
|
|
170
|
+
`;
|
|
171
|
+
const result = cleanHTML(html);
|
|
172
|
+
t.false(result.includes('id="test"'));
|
|
173
|
+
t.false(result.includes('class="container"'));
|
|
174
|
+
t.false(result.includes('target="_blank"'));
|
|
175
|
+
t.true(result.includes('href="https://example.com"'));
|
|
176
|
+
t.true(result.includes('src="image.jpg"'));
|
|
177
|
+
t.true(result.includes('alt="Test"'));
|
|
178
|
+
});
|
|
179
|
+
test("preserves data attributes on code elements", (t) => {
|
|
180
|
+
const html = `
|
|
181
|
+
<div>
|
|
182
|
+
<pre data-language="javascript"><code data-line="1">const x = 1;</code></pre>
|
|
183
|
+
</div>
|
|
184
|
+
`;
|
|
185
|
+
const result = cleanHTML(html);
|
|
186
|
+
t.true(result.includes('data-language="javascript"'));
|
|
187
|
+
t.true(result.includes('data-line="1"'));
|
|
188
|
+
});
|
|
189
|
+
test("preserves table attributes", (t) => {
|
|
190
|
+
const html = `
|
|
191
|
+
<table>
|
|
192
|
+
<tr>
|
|
193
|
+
<td colspan="2" rowspan="3" align="center">Cell</td>
|
|
194
|
+
</tr>
|
|
195
|
+
</table>
|
|
196
|
+
`;
|
|
197
|
+
const result = cleanHTML(html);
|
|
198
|
+
t.true(result.includes("colspan"));
|
|
199
|
+
t.true(result.includes("rowspan"));
|
|
200
|
+
t.true(result.includes("align"));
|
|
201
|
+
});
|
|
202
|
+
test("removes empty elements", (t) => {
|
|
203
|
+
const html = `
|
|
204
|
+
<div>
|
|
205
|
+
<p></p>
|
|
206
|
+
<div></div>
|
|
207
|
+
<h1>Title</h1>
|
|
208
|
+
<p>Content</p>
|
|
209
|
+
</div>
|
|
210
|
+
`;
|
|
211
|
+
const result = cleanHTML(html);
|
|
212
|
+
t.true(result.includes("<h1>Title</h1>"));
|
|
213
|
+
t.true(result.includes("<p>Content</p>"));
|
|
214
|
+
// Empty p and div should be removed
|
|
215
|
+
t.false(result.includes("<p></p>"));
|
|
216
|
+
});
|
|
217
|
+
test("removes elements with only punctuation", (t) => {
|
|
218
|
+
const html = `
|
|
219
|
+
<div>
|
|
220
|
+
<p>| - .</p>
|
|
221
|
+
<p>Real content</p>
|
|
222
|
+
</div>
|
|
223
|
+
`;
|
|
224
|
+
const result = cleanHTML(html);
|
|
225
|
+
t.true(result.includes("Real content"));
|
|
226
|
+
// Punctuation-only paragraph should be removed
|
|
227
|
+
const emptyPTags = (result.match(/<p>[\s|_.:;-]+<\/p>/g) || []).length;
|
|
228
|
+
t.is(emptyPTags, 0);
|
|
229
|
+
});
|
|
230
|
+
test("preserves images and iframes", (t) => {
|
|
231
|
+
const html = `
|
|
232
|
+
<div>
|
|
233
|
+
<img src="test.jpg" alt="Test" />
|
|
234
|
+
<iframe src="video.html"></iframe>
|
|
235
|
+
</div>
|
|
236
|
+
`;
|
|
237
|
+
const result = cleanHTML(html);
|
|
238
|
+
t.true(result.includes("<img"));
|
|
239
|
+
t.true(result.includes("<iframe"));
|
|
240
|
+
});
|
|
241
|
+
test("resolves relative URLs when baseUrl is provided", (t) => {
|
|
242
|
+
const html = `
|
|
243
|
+
<div>
|
|
244
|
+
<img src="/images/test.jpg" />
|
|
245
|
+
<a href="/page">Link</a>
|
|
246
|
+
</div>
|
|
247
|
+
`;
|
|
248
|
+
const result = cleanHTML(html, { baseUrl: "https://example.com" });
|
|
249
|
+
t.true(result.includes('src="https://example.com/images/test.jpg"'));
|
|
250
|
+
t.true(result.includes('href="https://example.com/page"'));
|
|
251
|
+
});
|
|
252
|
+
test("does not resolve absolute URLs", (t) => {
|
|
253
|
+
const html = `
|
|
254
|
+
<div>
|
|
255
|
+
<img src="https://other.com/image.jpg" />
|
|
256
|
+
<a href="https://other.com/page">Link</a>
|
|
257
|
+
</div>
|
|
258
|
+
`;
|
|
259
|
+
const result = cleanHTML(html, { baseUrl: "https://example.com" });
|
|
260
|
+
t.true(result.includes('src="https://other.com/image.jpg"'));
|
|
261
|
+
t.true(result.includes('href="https://other.com/page"'));
|
|
262
|
+
});
|
|
263
|
+
test("does not resolve data URLs", (t) => {
|
|
264
|
+
const html = `
|
|
265
|
+
<div>
|
|
266
|
+
<img src="data:image/png;base64,ABC123" />
|
|
267
|
+
</div>
|
|
268
|
+
`;
|
|
269
|
+
const result = cleanHTML(html, { baseUrl: "https://example.com" });
|
|
270
|
+
t.true(result.includes('src="data:image/png;base64,ABC123"'));
|
|
271
|
+
});
|
|
272
|
+
test("does not resolve anchor links", (t) => {
|
|
273
|
+
const html = `
|
|
274
|
+
<div>
|
|
275
|
+
<a href="#section">Jump to section</a>
|
|
276
|
+
</div>
|
|
277
|
+
`;
|
|
278
|
+
const result = cleanHTML(html, { baseUrl: "https://example.com" });
|
|
279
|
+
t.true(result.includes('href="#section"'));
|
|
280
|
+
});
|
|
281
|
+
test("does not resolve mailto links", (t) => {
|
|
282
|
+
const html = `
|
|
283
|
+
<div>
|
|
284
|
+
<a href="mailto:test@example.com">Email</a>
|
|
285
|
+
</div>
|
|
286
|
+
`;
|
|
287
|
+
const result = cleanHTML(html, { baseUrl: "https://example.com" });
|
|
288
|
+
t.true(result.includes('href="mailto:test@example.com"'));
|
|
289
|
+
});
|
|
290
|
+
test("skips aggressive cleaning when aggressive is false", (t) => {
|
|
291
|
+
const html = `
|
|
292
|
+
<div>
|
|
293
|
+
<nav role="navigation">Nav content</nav>
|
|
294
|
+
<aside>Sidebar</aside>
|
|
295
|
+
<p>Content</p>
|
|
296
|
+
</div>
|
|
297
|
+
`;
|
|
298
|
+
const result = cleanHTML(html, { aggressive: false });
|
|
299
|
+
t.true(result.includes("Nav content"));
|
|
300
|
+
t.true(result.includes("Sidebar"));
|
|
301
|
+
t.true(result.includes("Content"));
|
|
302
|
+
});
|
|
303
|
+
test("handles invalid URLs gracefully", (t) => {
|
|
304
|
+
const html = `
|
|
305
|
+
<div>
|
|
306
|
+
<img src="::invalid::" />
|
|
307
|
+
<a href="::invalid::">Link</a>
|
|
308
|
+
</div>
|
|
309
|
+
`;
|
|
310
|
+
t.notThrows(() => {
|
|
311
|
+
cleanHTML(html, { baseUrl: "https://example.com" });
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
test("handles complex nested structures", (t) => {
|
|
315
|
+
const html = `
|
|
316
|
+
<div>
|
|
317
|
+
<header role="banner">
|
|
318
|
+
<nav class="navbar">
|
|
319
|
+
<div class="social-share">Share</div>
|
|
320
|
+
</nav>
|
|
321
|
+
</header>
|
|
322
|
+
<main>
|
|
323
|
+
<article>
|
|
324
|
+
<h1>Title</h1>
|
|
325
|
+
<p>Content</p>
|
|
326
|
+
</article>
|
|
327
|
+
<aside>Sidebar</aside>
|
|
328
|
+
</main>
|
|
329
|
+
<footer role="contentinfo">Footer</footer>
|
|
330
|
+
</div>
|
|
331
|
+
`;
|
|
332
|
+
const result = cleanHTML(html);
|
|
333
|
+
t.true(result.includes("<h1>Title</h1>"));
|
|
334
|
+
t.true(result.includes("<p>Content</p>"));
|
|
335
|
+
t.false(result.includes("Share"));
|
|
336
|
+
t.false(result.includes("Sidebar"));
|
|
337
|
+
t.false(result.includes("Footer"));
|
|
338
|
+
});
|
|
339
|
+
test("preserves content in pre and code tags", (t) => {
|
|
340
|
+
const html = `
|
|
341
|
+
<div>
|
|
342
|
+
<pre data-lang="js"><code>const x = 1;</code></pre>
|
|
343
|
+
<p>Text</p>
|
|
344
|
+
</div>
|
|
345
|
+
`;
|
|
346
|
+
const result = cleanHTML(html);
|
|
347
|
+
t.true(result.includes("<pre"));
|
|
348
|
+
t.true(result.includes("<code>"));
|
|
349
|
+
t.true(result.includes("const x = 1;"));
|
|
350
|
+
});
|
|
351
|
+
//# sourceMappingURL=html-cleaner.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-cleaner.spec.js","sourceRoot":"","sources":["../../src/optimizers/html-cleaner.spec.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,IAAI,MAAM,KAAK,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,IAAI,CAAC,qBAAqB,EAAE,CAAC,CAAC,EAAE,EAAE;IAChC,MAAM,IAAI,GAAG;;;;;GAKZ,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,IA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Level + 2);
|
|
33
33
|
currentLevel = normalizedLevel;
|
|
34
|
-
result.push("#".repeat(normalizedLevel)
|
|
34
|
+
result.push(`${"#".repeat(normalizedLevel)} ${title}`);
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
37
|
result.push(line);
|
|
@@ -53,7 +53,7 @@ function normalizeListFormatting(markdown) {
|
|
|
53
53
|
if (/^(\s*)[-*+]\s+/.test(line)) {
|
|
54
54
|
const indent = line.match(/^(\s*)/)?.[1].length || 0;
|
|
55
55
|
const depth = Math.floor(indent / 2);
|
|
56
|
-
return " ".repeat(depth)
|
|
56
|
+
return `${" ".repeat(depth)}- ${line.trim().replace(/^[-*+]\s+/, "")}`;
|
|
57
57
|
}
|
|
58
58
|
return line;
|
|
59
59
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-formatter.js","sourceRoot":"","sources":["../../src/optimizers/llm-formatter.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,IAAI,SAAS,GAAG,QAAQ,CAAC;IAEzB,yDAAyD;IACzD,SAAS,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAE9C,8BAA8B;IAC9B,SAAS,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAE/C,4DAA4D;IAC5D,SAAS,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAE7C,2CAA2C;IAC3C,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAEzC,sCAAsC;IACtC,SAAS,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAE9C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,sBAAsB,CAAC,QAAgB;IAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,YAAY,GAAG,CAAC,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