pretext-pdf 2.0.2 → 2.0.13
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/CHANGELOG.md +227 -0
- package/dist/assets/loaders/images.d.ts.map +1 -1
- package/dist/assets/loaders/images.js +4 -1
- package/dist/assets/loaders/images.js.map +1 -1
- package/dist/assets/security/path-allowlist.d.ts.map +1 -1
- package/dist/assets/security/path-allowlist.js +10 -1
- package/dist/assets/security/path-allowlist.js.map +1 -1
- package/dist/assets/svg/resolve-content.d.ts.map +1 -1
- package/dist/assets/svg/resolve-content.js +4 -1
- package/dist/assets/svg/resolve-content.js.map +1 -1
- package/dist/builder.js +1 -1
- package/dist/builder.js.map +1 -1
- package/dist/compat/normalize.d.ts +13 -0
- package/dist/compat/normalize.d.ts.map +1 -0
- package/dist/compat/normalize.js +146 -0
- package/dist/compat/normalize.js.map +1 -0
- package/dist/compat/pdfmake-types.d.ts +91 -0
- package/dist/compat/pdfmake-types.d.ts.map +1 -0
- package/dist/compat/pdfmake-types.js +8 -0
- package/dist/compat/pdfmake-types.js.map +1 -0
- package/dist/compat/translate.d.ts +7 -0
- package/dist/compat/translate.d.ts.map +1 -0
- package/dist/compat/translate.js +205 -0
- package/dist/compat/translate.js.map +1 -0
- package/dist/compat.d.ts +6 -161
- package/dist/compat.d.ts.map +1 -1
- package/dist/compat.js +13 -404
- package/dist/compat.js.map +1 -1
- package/dist/fonts/bundled-paths.d.ts +13 -0
- package/dist/fonts/bundled-paths.d.ts.map +1 -0
- package/dist/fonts/bundled-paths.js +43 -0
- package/dist/fonts/bundled-paths.js.map +1 -0
- package/dist/fonts/collect-needed.d.ts +10 -0
- package/dist/fonts/collect-needed.d.ts.map +1 -0
- package/dist/fonts/collect-needed.js +85 -0
- package/dist/fonts/collect-needed.js.map +1 -0
- package/dist/fonts/collect-text.d.ts +9 -0
- package/dist/fonts/collect-text.d.ts.map +1 -0
- package/dist/fonts/collect-text.js +162 -0
- package/dist/fonts/collect-text.js.map +1 -0
- package/dist/fonts/load-bytes.d.ts +10 -0
- package/dist/fonts/load-bytes.d.ts.map +1 -0
- package/dist/fonts/load-bytes.js +56 -0
- package/dist/fonts/load-bytes.js.map +1 -0
- package/dist/fonts.d.ts +11 -10
- package/dist/fonts.d.ts.map +1 -1
- package/dist/fonts.js +17 -421
- package/dist/fonts.js.map +1 -1
- package/dist/pipeline-footnotes.d.ts +2 -2
- package/dist/pipeline-footnotes.d.ts.map +1 -1
- package/dist/pipeline-footnotes.js +5 -2
- package/dist/pipeline-footnotes.js.map +1 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +9 -5
- package/dist/pipeline.js.map +1 -1
- package/dist/render-utils.d.ts +1 -7
- package/dist/render-utils.d.ts.map +1 -1
- package/dist/render-utils.js +9 -30
- package/dist/render-utils.js.map +1 -1
- package/dist/schema/document.d.ts +2115 -0
- package/dist/schema/document.d.ts.map +1 -0
- package/dist/schema/document.js +275 -0
- package/dist/schema/document.js.map +1 -0
- package/dist/schema/elements-block.d.ts +481 -0
- package/dist/schema/elements-block.d.ts.map +1 -0
- package/dist/schema/elements-block.js +155 -0
- package/dist/schema/elements-block.js.map +1 -0
- package/dist/schema/elements-media.d.ts +282 -0
- package/dist/schema/elements-media.d.ts.map +1 -0
- package/dist/schema/elements-media.js +83 -0
- package/dist/schema/elements-media.js.map +1 -0
- package/dist/schema/elements-table.d.ts +134 -0
- package/dist/schema/elements-table.d.ts.map +1 -0
- package/dist/schema/elements-table.js +60 -0
- package/dist/schema/elements-table.js.map +1 -0
- package/dist/schema/elements-text.d.ts +782 -0
- package/dist/schema/elements-text.d.ts.map +1 -0
- package/dist/schema/elements-text.js +260 -0
- package/dist/schema/elements-text.js.map +1 -0
- package/dist/schema/shared.d.ts +84 -0
- package/dist/schema/shared.d.ts.map +1 -0
- package/dist/schema/shared.js +29 -0
- package/dist/schema/shared.js.map +1 -0
- package/dist/schema.d.ts +10 -2116
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +10 -852
- package/dist/schema.js.map +1 -1
- package/dist/types-public/document.d.ts +99 -101
- package/dist/types-public/document.d.ts.map +1 -1
- package/dist/validate/document.d.ts.map +1 -1
- package/dist/validate/document.js +5 -1
- package/dist/validate/document.js.map +1 -1
- package/dist/validate/elements/media.d.ts.map +1 -1
- package/dist/validate/elements/media.js +14 -0
- package/dist/validate/elements/media.js.map +1 -1
- package/dist/validate/helpers.d.ts +6 -6
- package/dist/validate/helpers.d.ts.map +1 -1
- package/dist/validate/helpers.js +7 -7
- package/dist/validate/helpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/schema/document.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Rc,CAAA"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { alignSchema, alignNoJustify, fontWeightSchema, colorSchema, spaceSchema } from './shared.js';
|
|
2
|
+
import { paragraphSchema, headingSchema, blockquoteSchema, codeSchema, calloutSchema, richParagraphSchema, listSchema, tocSchema, footnoteDefSchema } from './elements-text.js';
|
|
3
|
+
import { imageSchema, svgSchema, qrCodeSchema, barcodeSchema, chartSchema } from './elements-media.js';
|
|
4
|
+
import { spacerSchema, hrSchema, pageBreakSchema, commentSchema, formFieldSchema, floatGroupSchema } from './elements-block.js';
|
|
5
|
+
import { tableSchema } from './elements-table.js';
|
|
6
|
+
export const pdfDocumentSchema = {
|
|
7
|
+
$schema: 'https://json-schema.org/draft/2020-12/schema',
|
|
8
|
+
title: 'PdfDocument',
|
|
9
|
+
description: 'Top-level descriptor for a pretext-pdf document.',
|
|
10
|
+
type: 'object',
|
|
11
|
+
required: ['content'],
|
|
12
|
+
properties: {
|
|
13
|
+
content: {
|
|
14
|
+
type: 'array',
|
|
15
|
+
description: 'Document content elements rendered top-to-bottom.',
|
|
16
|
+
items: {
|
|
17
|
+
oneOf: [
|
|
18
|
+
paragraphSchema,
|
|
19
|
+
headingSchema,
|
|
20
|
+
spacerSchema,
|
|
21
|
+
hrSchema,
|
|
22
|
+
pageBreakSchema,
|
|
23
|
+
imageSchema,
|
|
24
|
+
svgSchema,
|
|
25
|
+
tableSchema,
|
|
26
|
+
listSchema,
|
|
27
|
+
blockquoteSchema,
|
|
28
|
+
codeSchema,
|
|
29
|
+
calloutSchema,
|
|
30
|
+
richParagraphSchema,
|
|
31
|
+
tocSchema,
|
|
32
|
+
footnoteDefSchema,
|
|
33
|
+
qrCodeSchema,
|
|
34
|
+
barcodeSchema,
|
|
35
|
+
commentSchema,
|
|
36
|
+
formFieldSchema,
|
|
37
|
+
floatGroupSchema,
|
|
38
|
+
chartSchema,
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
pageSize: {
|
|
43
|
+
description: 'Page size. Default: A4 (595×842 pt). Custom: [width, height] in pt.',
|
|
44
|
+
oneOf: [
|
|
45
|
+
{
|
|
46
|
+
type: 'string',
|
|
47
|
+
enum: ['A4', 'Letter', 'Legal', 'A3', 'A5', 'Tabloid'],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: 'array',
|
|
51
|
+
items: { type: 'number' },
|
|
52
|
+
minItems: 2,
|
|
53
|
+
maxItems: 2,
|
|
54
|
+
description: '[width, height] in points',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
margins: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
description: 'Page margins in pt. Default: all 72pt (1 inch).',
|
|
61
|
+
properties: {
|
|
62
|
+
top: { type: 'number' },
|
|
63
|
+
bottom: { type: 'number' },
|
|
64
|
+
left: { type: 'number' },
|
|
65
|
+
right: { type: 'number' },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
defaultFont: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
description: 'Default font family for body text. Default: Inter',
|
|
71
|
+
},
|
|
72
|
+
defaultFontSize: {
|
|
73
|
+
type: 'number',
|
|
74
|
+
description: 'Default font size in pt. Default: 12',
|
|
75
|
+
},
|
|
76
|
+
defaultLineHeight: {
|
|
77
|
+
type: 'number',
|
|
78
|
+
description: 'Default line height in pt. Default: fontSize * 1.5',
|
|
79
|
+
},
|
|
80
|
+
fonts: {
|
|
81
|
+
type: 'array',
|
|
82
|
+
description: 'Custom fonts to load and embed.',
|
|
83
|
+
items: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
required: ['family', 'src'],
|
|
86
|
+
properties: {
|
|
87
|
+
family: { type: 'string' },
|
|
88
|
+
weight: fontWeightSchema,
|
|
89
|
+
style: { type: 'string', enum: ['normal', 'italic'] },
|
|
90
|
+
src: { type: 'string', description: 'Absolute file path to a TTF/OTF font file' },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
header: {
|
|
95
|
+
type: 'object',
|
|
96
|
+
description: 'Header rendered at top of every page. Supports {{pageNumber}} and {{totalPages}}.',
|
|
97
|
+
required: ['text'],
|
|
98
|
+
properties: {
|
|
99
|
+
text: { type: 'string', description: 'Use {{pageNumber}} and {{totalPages}} as tokens' },
|
|
100
|
+
fontSize: { type: 'number' },
|
|
101
|
+
align: alignNoJustify,
|
|
102
|
+
fontFamily: { type: 'string' },
|
|
103
|
+
fontWeight: fontWeightSchema,
|
|
104
|
+
color: colorSchema,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
footer: {
|
|
108
|
+
type: 'object',
|
|
109
|
+
description: 'Footer rendered at bottom of every page. Supports {{pageNumber}} and {{totalPages}}.',
|
|
110
|
+
required: ['text'],
|
|
111
|
+
properties: {
|
|
112
|
+
text: { type: 'string', description: 'Use {{pageNumber}} and {{totalPages}} as tokens' },
|
|
113
|
+
fontSize: { type: 'number' },
|
|
114
|
+
align: alignNoJustify,
|
|
115
|
+
fontFamily: { type: 'string' },
|
|
116
|
+
fontWeight: fontWeightSchema,
|
|
117
|
+
color: colorSchema,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
sections: {
|
|
121
|
+
type: 'array',
|
|
122
|
+
description: 'Page-range overrides for header/footer. First matching section wins. Falls back to doc.header/footer.',
|
|
123
|
+
items: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
properties: {
|
|
126
|
+
fromPage: { type: 'number', description: 'First page (1-based, inclusive). Default: 1' },
|
|
127
|
+
toPage: { type: 'number', description: 'Last page (1-based, inclusive). Default: Infinity' },
|
|
128
|
+
header: {
|
|
129
|
+
type: 'object',
|
|
130
|
+
properties: {
|
|
131
|
+
text: { type: 'string' },
|
|
132
|
+
fontSize: { type: 'number' },
|
|
133
|
+
align: alignNoJustify,
|
|
134
|
+
fontFamily: { type: 'string' },
|
|
135
|
+
fontWeight: fontWeightSchema,
|
|
136
|
+
color: colorSchema,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
footer: {
|
|
140
|
+
type: 'object',
|
|
141
|
+
properties: {
|
|
142
|
+
text: { type: 'string' },
|
|
143
|
+
fontSize: { type: 'number' },
|
|
144
|
+
align: alignNoJustify,
|
|
145
|
+
fontFamily: { type: 'string' },
|
|
146
|
+
fontWeight: fontWeightSchema,
|
|
147
|
+
color: colorSchema,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
watermark: {
|
|
154
|
+
type: 'object',
|
|
155
|
+
description: 'Watermark overlay rendered on every page behind content.',
|
|
156
|
+
properties: {
|
|
157
|
+
text: { type: 'string' },
|
|
158
|
+
fontFamily: { type: 'string' },
|
|
159
|
+
fontWeight: fontWeightSchema,
|
|
160
|
+
fontSize: { type: 'number' },
|
|
161
|
+
color: colorSchema,
|
|
162
|
+
opacity: { type: 'number', minimum: 0, maximum: 1 },
|
|
163
|
+
rotation: { type: 'number', description: 'Rotation in degrees (counter-clockwise). Default: -45' },
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
encryption: {
|
|
167
|
+
type: 'object',
|
|
168
|
+
description: 'Password protection and permission control for the output PDF.',
|
|
169
|
+
properties: {
|
|
170
|
+
userPassword: { type: 'string', description: 'Password required to open the document.' },
|
|
171
|
+
ownerPassword: { type: 'string', description: 'Password for full unrestricted access.' },
|
|
172
|
+
permissions: {
|
|
173
|
+
type: 'object',
|
|
174
|
+
properties: {
|
|
175
|
+
printing: { type: 'boolean' },
|
|
176
|
+
copying: { type: 'boolean' },
|
|
177
|
+
modifying: { type: 'boolean' },
|
|
178
|
+
annotating: { type: 'boolean' },
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
metadata: {
|
|
184
|
+
type: 'object',
|
|
185
|
+
description: 'PDF document metadata written into file properties.',
|
|
186
|
+
properties: {
|
|
187
|
+
title: { type: 'string' },
|
|
188
|
+
author: { type: 'string' },
|
|
189
|
+
subject: { type: 'string' },
|
|
190
|
+
keywords: { type: 'array', items: { type: 'string' } },
|
|
191
|
+
creator: { type: 'string' },
|
|
192
|
+
language: { type: 'string', description: "BCP47 language tag e.g. 'en-US', 'hi', 'ar'" },
|
|
193
|
+
producer: { type: 'string' },
|
|
194
|
+
accessibility: { type: 'object', description: 'Reserved for PDF/UA and WCAG accessibility metadata (v1.8+). No render-time effect in v1.x.' },
|
|
195
|
+
semantic: { type: 'object', description: 'Reserved for semantic document structure metadata (v1.8+). No render-time effect in v1.x.' },
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
defaultParagraphStyle: {
|
|
199
|
+
type: 'object',
|
|
200
|
+
description: 'Default style applied to every paragraph and heading that does not set the field explicitly.',
|
|
201
|
+
properties: {
|
|
202
|
+
fontSize: { type: 'number' },
|
|
203
|
+
lineHeight: { type: 'number' },
|
|
204
|
+
fontFamily: { type: 'string' },
|
|
205
|
+
fontWeight: fontWeightSchema,
|
|
206
|
+
color: colorSchema,
|
|
207
|
+
align: alignSchema,
|
|
208
|
+
letterSpacing: { type: 'number' },
|
|
209
|
+
spaceBefore: spaceSchema,
|
|
210
|
+
spaceAfter: spaceSchema,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
bookmarks: {
|
|
214
|
+
description: 'PDF bookmark outline. Set to false to disable, or provide config object.',
|
|
215
|
+
oneOf: [
|
|
216
|
+
{ type: 'boolean', const: false },
|
|
217
|
+
{
|
|
218
|
+
type: 'object',
|
|
219
|
+
properties: {
|
|
220
|
+
minLevel: { type: 'number', enum: [1, 2, 3, 4] },
|
|
221
|
+
maxLevel: { type: 'number', enum: [1, 2, 3, 4] },
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
},
|
|
226
|
+
hyphenation: {
|
|
227
|
+
type: 'object',
|
|
228
|
+
description: 'Automatic word hyphenation. Requires installing the matching hyphenation.XX npm package.',
|
|
229
|
+
required: ['language'],
|
|
230
|
+
properties: {
|
|
231
|
+
language: { type: 'string', description: "Language code e.g. 'en-us', 'de', 'fr'" },
|
|
232
|
+
minWordLength: { type: 'number' },
|
|
233
|
+
leftMin: { type: 'number' },
|
|
234
|
+
rightMin: { type: 'number' },
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
signature: {
|
|
238
|
+
type: 'object',
|
|
239
|
+
description: 'Signature applied to the rendered PDF. Providing p12 enables PKCS#7 cryptographic signing (requires @signpdf/* peer deps); without p12 a visual-only placeholder box is drawn.',
|
|
240
|
+
properties: {
|
|
241
|
+
p12: { type: 'string', description: 'Absolute path to a .p12/.pfx certificate file, or base64-encoded cert bytes. Triggers PKCS#7/CMS digital signing. Requires @signpdf/signpdf, @signpdf/placeholder-pdf-lib, @signpdf/signer-p12, and pdf-lib peer deps.' },
|
|
242
|
+
passphrase: { type: 'string', description: 'Passphrase to decrypt the P12 certificate. Omit if the certificate has no passphrase.' },
|
|
243
|
+
contactInfo: { type: 'string', description: 'Contact info (e.g. email address) embedded in the PDF signature dictionary. Default: empty string.' },
|
|
244
|
+
signerName: { type: 'string' },
|
|
245
|
+
reason: { type: 'string' },
|
|
246
|
+
location: { type: 'string' },
|
|
247
|
+
x: { type: 'number' },
|
|
248
|
+
y: { type: 'number' },
|
|
249
|
+
width: { type: 'number' },
|
|
250
|
+
height: { type: 'number' },
|
|
251
|
+
page: { type: 'number', description: 'Page index (0-based). Default: last page.' },
|
|
252
|
+
borderColor: colorSchema,
|
|
253
|
+
fontSize: { type: 'number' },
|
|
254
|
+
invisible: { type: 'boolean', description: 'If true, skip the visual signature box — crypto-only invisible signing. Default: false.' },
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
flattenForms: {
|
|
258
|
+
type: 'boolean',
|
|
259
|
+
description: 'If true, flatten all form fields into static content. Default: false',
|
|
260
|
+
},
|
|
261
|
+
allowedFileDirs: {
|
|
262
|
+
type: 'array',
|
|
263
|
+
items: { type: 'string' },
|
|
264
|
+
description: 'Restrict filesystem access to these absolute directory paths.',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
// additionalProperties: false on the root object catches unknown top-level keys
|
|
268
|
+
// in AI-agent and MCP code-generation contexts, where an LLM might hallucinate
|
|
269
|
+
// a property that doesn't exist. Element schemas (content items) are intentionally
|
|
270
|
+
// not locked down here — they use runtime validation in validate/index.ts which
|
|
271
|
+
// produces precise per-property VALIDATION_ERROR messages for better DX than
|
|
272
|
+
// JSON Schema's generic "additional property" error.
|
|
273
|
+
additionalProperties: false,
|
|
274
|
+
};
|
|
275
|
+
//# sourceMappingURL=document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/schema/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACrG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAA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