@openpresentation/cli 0.16.0 → 0.17.1

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/package.json CHANGED
@@ -1,17 +1,13 @@
1
1
  {
2
2
  "name": "@openpresentation/cli",
3
- "version": "0.16.0",
4
- "description": "Local OPF CLI for agents and the library API @openpresentation/cli/api: create, validate, edit, paginate, render, export to PPTX/PDF, import PPTX, and inspect presentation JSON.",
3
+ "version": "0.17.1",
4
+ "description": "The opf command for agents and scripts: create, validate, edit, paginate, render, export to PPTX/PDF, convert, import PPTX, and inspect presentation files. Applications use @openpresentation/opf/node.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "opf": "./dist/index.js"
9
9
  },
10
10
  "exports": {
11
- "./api": {
12
- "types": "./dist/api.d.ts",
13
- "import": "./dist/api.js"
14
- },
15
11
  "./package.json": "./package.json"
16
12
  },
17
13
  "scripts": {
@@ -24,7 +20,7 @@
24
20
  "prepack": "pnpm build"
25
21
  },
26
22
  "dependencies": {
27
- "@openpresentation/opf": "^0.16.0"
23
+ "@openpresentation/opf": "^0.17.0"
28
24
  },
29
25
  "devDependencies": {
30
26
  "@expo-google-fonts/arimo": "0.4.3",
@@ -35,8 +31,8 @@
35
31
  "@expo-google-fonts/roboto": "0.4.3",
36
32
  "@expo-google-fonts/roboto-mono": "0.4.2",
37
33
  "@expo-google-fonts/tinos": "0.4.2",
38
- "@openpresentation/opf-pptx": "0.16.0",
39
- "@openpresentation/opf-render": "0.16.0",
34
+ "@openpresentation/opf-pptx": "0.17.0",
35
+ "@openpresentation/opf-render": "0.17.0",
40
36
  "@resvg/resvg-js": "2.6.2",
41
37
  "@types/node": "^24.13.4",
42
38
  "pdf-lib": "1.17.1",
@@ -50,8 +46,8 @@
50
46
  "LICENSE"
51
47
  ],
52
48
  "peerDependencies": {
53
- "@openpresentation/opf-pptx": "^0.16.0",
54
- "@openpresentation/opf-render": "^0.16.0"
49
+ "@openpresentation/opf-pptx": "^0.17.0",
50
+ "@openpresentation/opf-render": "^0.17.0"
55
51
  },
56
52
  "peerDependenciesMeta": {
57
53
  "@openpresentation/opf-pptx": {
package/dist/api.d.ts DELETED
@@ -1,191 +0,0 @@
1
- import { Finding, Catalog, Presentation } from '@openpresentation/opf';
2
- export { Catalog, DeckFormat, Finding, OPFValidationError, Presentation, ReadDeckOptions, ReadDeckResult, ValidateOptions, ValidationReport, WriteDeckOptions, assertValid, readDeck, validate, writeDeck } from '@openpresentation/opf';
3
- export { defaultCatalog } from '@openpresentation/opf/catalog';
4
-
5
- declare class OPFApiError extends Error {
6
- readonly code: string;
7
- readonly details: Record<string, unknown>;
8
- readonly findings: Finding[];
9
- constructor(message: string, code: string, extra?: {
10
- details?: Record<string, unknown>;
11
- findings?: Finding[];
12
- cause?: unknown;
13
- });
14
- }
15
- /** Thrown by `exportDeck`: `peer-not-installed`, `peer-too-old`, `peer-load-failed`, `invalid-option`, `invalid-presentation`, `no-slides`, `all-slides-hidden`, `font-failed`, `export-failed`. */
16
- declare class OPFExportError extends OPFApiError {
17
- }
18
- /** Thrown by `importDeck`: `peer-not-installed`, `peer-too-old`, `peer-load-failed`, `invalid-option`, `invalid-presentation`, `import-failed`. */
19
- declare class OPFImportError extends OPFApiError {
20
- }
21
-
22
- interface EmbeddedFace {
23
- family: string;
24
- weight: number;
25
- italic?: boolean;
26
- dataUrl: string;
27
- }
28
- /** What the renderer's deck-level functions read from `{ fonts }` (opf-render `RenderFonts`). */
29
- interface RenderFonts {
30
- textMeasurement?: unknown;
31
- embeddedFonts?: readonly EmbeddedFace[];
32
- fontFiles?: readonly string[];
33
- useBundledFonts?: boolean;
34
- loadSystemFonts?: boolean;
35
- }
36
- interface FontRegistry {
37
- scriptSelection?: {
38
- detected: string[];
39
- scripts: string[];
40
- unavailable: string[];
41
- packages?: string[];
42
- notInstalled?: string[];
43
- uncovered?: string[];
44
- };
45
- }
46
- /** The handle `loadFonts()` of opf-render `/fonts-node` returns: pass it as `{ fonts }` to every deck-level call. */
47
- interface FontsHandle extends RenderFonts {
48
- textMeasurement: unknown;
49
- embeddedFonts: EmbeddedFace[];
50
- fontFiles: string[];
51
- useBundledFonts: false;
52
- loadSystemFonts: false;
53
- registry: FontRegistry;
54
- substitutions: {
55
- requestedFamily: string;
56
- resolvedFamily: string;
57
- compatibility: string;
58
- substitute: boolean;
59
- }[];
60
- }
61
-
62
- type ExportFormat = "svg" | "png" | "pdf" | "pptx";
63
- interface ExportOptions {
64
- /** What to write. `svg` and `png` give one file per slide (or one zip), `pdf` and `pptx` one file. */
65
- format: ExportFormat;
66
- /** A prepared fonts handle (`loadFonts()` of `@openpresentation/opf-render/fonts-node`), reused across calls. Omitted: the bundled open font pack plus `fontDirs`. */
67
- fonts?: FontsHandle;
68
- /** Directories of `.ttf` and `.otf` files to load before the bundled pack (not recursive). Ignored when `fonts` is given. */
69
- fontDirs?: readonly string[];
70
- /** The catalogs the presentation's references resolve in. Omitted: core's default catalog. */
71
- catalogs?: readonly Catalog[];
72
- /** The slides to write, one-based: numbers or a selection such as `"1,3-5"`. Omitted: every slide that is not hidden. Not for `pptx`. */
73
- slides?: readonly number[] | string;
74
- /** Write hidden slides too (`svg`, `png`, `pdf`). */
75
- includeHidden?: boolean;
76
- /** Split overflowing slides with the same fonts before drawing, as `opf paginate` does. */
77
- paginate?: boolean;
78
- /** Pixel scale of `png` and of a raster `pdf` (0.1 to 8; 1 draws the 1280 x 720 reference slide at 1280 x 720 pixels). */
79
- scale?: number;
80
- /** `pdf`: `vector` (selectable text, the default) or `raster`. */
81
- pdfMode?: "vector" | "raster";
82
- /** `svg`: embed the faces the slide's text uses (`used`, the default) or none (`none`). */
83
- svgFonts?: "used" | "none";
84
- /** `pptx`: native charts (`native`), picture fallbacks (`fallback`) or opf-pptx's choice (`auto`). */
85
- chartex?: "auto" | "native" | "fallback";
86
- /** `pptx`: what the file records about where media came from. */
87
- provenance?: "full" | "references-only" | "none";
88
- /** `pptx`: keep images as they are (`preserve`) or convert them for older PowerPoint (`compatible`). */
89
- imageFormat?: "compatible" | "preserve";
90
- /** `YYYY-MM-DD`, for date fields that show today's date. Nothing reads a clock: without it such a field reports `date-needs-value`. */
91
- date?: string;
92
- /** The directory a presentation's relative image paths resolve against. Omitted: no local file is read (data URIs and remote references work as the engines handle them). */
93
- assetDir?: string;
94
- /** `svg` and `png`: one zip of the slides instead of one file per slide. */
95
- zip?: boolean;
96
- /** The source file name, for naming the output when the presentation has no `filename` or `name`. */
97
- filename?: string;
98
- }
99
- interface ExportFile {
100
- /** The file name: the presentation's `filename`, else its slugified `name`, else the source name, then `-001.png` for slide 1 and so on. */
101
- name: string;
102
- /** The media type. */
103
- type: string;
104
- bytes: Uint8Array;
105
- /** `svg` and `png`: the slide number (one-based) and its id. */
106
- slide?: number;
107
- id?: string;
108
- /** `svg` and `png`: the picture's size in pixels. */
109
- width?: number;
110
- height?: number;
111
- /** `pdf`: the number of pages and the slide numbers they show. */
112
- pages?: number;
113
- slides?: number[];
114
- /** `zip`: the names of the entries. */
115
- entries?: string[];
116
- }
117
- interface ExportFontSummary {
118
- pack: "office";
119
- substitutionPolicy: "visual";
120
- /** The `fontDirs` files, in load order. */
121
- userFonts: string[];
122
- substitutions: {
123
- requested: string;
124
- resolved: string;
125
- compatibility: string;
126
- }[];
127
- scripts?: unknown;
128
- }
129
-
130
- interface ExportResult {
131
- /** The files, in slide order: one per slide for `svg` and `png`, otherwise one. */
132
- files: ExportFile[];
133
- /** The findings of the format and references check (warnings and notes; errors throw) and the diagnostics of the engines: fonts, layout, SVG, PDF and PPTX, each with a `render/`, `pptx/`, `pdf/`, `fonts/` or `cli/` rule prefix. */
134
- findings: Finding[];
135
- /** The bundled fonts and font files used, and the substitutions made. */
136
- fonts: ExportFontSummary;
137
- /** Slide numbers left out because they are hidden (`svg`, `png`, `pdf` without `includeHidden` or `slides`). */
138
- skippedHidden: number[];
139
- /** With `paginate`: the pages the slides were split into. */
140
- pagination?: {
141
- pages: unknown;
142
- };
143
- /** `pdf`: the mode used. */
144
- pdf?: {
145
- mode: "vector" | "raster";
146
- };
147
- /** The engines that drew the files. */
148
- renderer: {
149
- package: string;
150
- version: string;
151
- };
152
- pptx?: {
153
- package: string;
154
- version: string;
155
- };
156
- }
157
- /**
158
- * Draw a presentation as PDF, PNG, SVG or PPTX with the bundled open fonts. Throws `OPFExportError`: `peer-not-installed`,
159
- * `peer-too-old` or `peer-load-failed` for the engines, `invalid-option`, `invalid-presentation` (its `findings` are the
160
- * errors of the check), `no-slides`, `all-slides-hidden`, `export-failed` (a drawing error; `findings` hold it) or a font code.
161
- */
162
- declare function exportDeck(presentation: Presentation, options: ExportOptions): Promise<ExportResult>;
163
- interface ImportOptions {
164
- /** The catalogs the imported presentation's references resolve in. Omitted: core's default catalog. */
165
- catalogs?: readonly Catalog[];
166
- /** Also return the raw per-shape layout and style signals of the file (`signals`). */
167
- signals?: boolean;
168
- }
169
- interface ImportResult {
170
- /** The presentation. It passed the format and references check. */
171
- presentation: Presentation;
172
- /** What the conversion could not keep or had to change, and the findings of the check. */
173
- findings: Finding[];
174
- /** With `signals: true`. */
175
- signals?: {
176
- version?: number;
177
- };
178
- /** The importer that read the file. */
179
- pptx: {
180
- package: string;
181
- version: string;
182
- };
183
- }
184
- /**
185
- * Read a PowerPoint file into an OPF presentation. Import is a conversion, not a lossless round trip for arbitrary decks:
186
- * what it cannot keep is reported in `findings`. Throws `OPFImportError`: `peer-not-installed`, `peer-too-old`,
187
- * `peer-load-failed`, `import-failed` (opf-pptx could not read the file; `findings` hold the error) or `invalid-presentation`.
188
- */
189
- declare function importDeck(input: Uint8Array | ArrayBuffer, options?: ImportOptions): Promise<ImportResult>;
190
-
191
- export { type ExportFile, type ExportFontSummary, type ExportFormat, type ExportOptions, type ExportResult, type FontsHandle, type ImportOptions, type ImportResult, OPFApiError, OPFExportError, OPFImportError, exportDeck, importDeck };
package/dist/api.js DELETED
@@ -1,80 +0,0 @@
1
- import {
2
- CLI_CATALOGS,
3
- OPFApiError,
4
- OPFExportError,
5
- OPFImportError,
6
- PPTX_PACKAGE,
7
- Reporter,
8
- VERSIONS,
9
- asApiError,
10
- listFontDirectories,
11
- loadPptx,
12
- loadRenderer,
13
- resolveExportOptions,
14
- runExport,
15
- runImport
16
- } from "./chunk-Z2XWARO7.js";
17
-
18
- // src/api.ts
19
- import { validate } from "@openpresentation/opf";
20
- import { OPFValidationError, assertValid, readDeck, validate as validate2, writeDeck } from "@openpresentation/opf";
21
- import { defaultCatalog } from "@openpresentation/opf/catalog";
22
- var checkOptions = (catalogs) => ({ only: ["format", "references"], catalogs });
23
- async function exportDeck(presentation, options) {
24
- try {
25
- const resolved = resolveExportOptions(options);
26
- if (!presentation || typeof presentation !== "object" || Array.isArray(presentation)) throw new OPFApiError("exportDeck takes a presentation object; read JSON, YAML or Markdown text with readDeck first.", "invalid-option");
27
- const renderer = await loadRenderer();
28
- const pptx = resolved.format === "pptx" ? await loadPptx() : void 0;
29
- const userFonts = resolved.fonts ? [] : await listFontDirectories([...resolved.fontDirs ?? []], "fontDirs");
30
- const check = validate(presentation, checkOptions(resolved.catalogs ?? CLI_CATALOGS));
31
- if (!check.valid) throw new OPFApiError(`The presentation is not valid OPF: ${firstError(check.findings)}`, "invalid-presentation", { findings: check.findings });
32
- const reporter = new Reporter(check.findings);
33
- const run = await runExport(presentation, resolved, { reporter, renderer, ...pptx ? { pptx } : {}, userFonts });
34
- if (run.failure) throw new OPFApiError(run.failure.message, "export-failed", { details: { reason: run.failure.code }, findings: reporter.findings });
35
- return {
36
- files: run.files,
37
- findings: reporter.findings,
38
- fonts: run.fonts,
39
- skippedHidden: run.skippedHidden,
40
- ...run.pagination ? { pagination: run.pagination } : {},
41
- ...run.pdf ? { pdf: run.pdf } : {},
42
- ...VERSIONS(renderer, pptx)
43
- };
44
- } catch (error) {
45
- throw asApiError(OPFExportError, error, "export-failed");
46
- }
47
- }
48
- async function importDeck(input, options = {}) {
49
- try {
50
- if (!(input instanceof Uint8Array) && !(input instanceof ArrayBuffer)) throw new OPFApiError("importDeck takes the bytes of a .pptx file (a Uint8Array, a Buffer or an ArrayBuffer).", "invalid-option");
51
- const pptx = await loadPptx();
52
- const reporter = new Reporter();
53
- const run = await runImport(input instanceof Uint8Array ? input : new Uint8Array(input), { signals: options.signals === true }, reporter, pptx);
54
- if (run.failure || !run.presentation) throw new OPFApiError(run.failure?.message ?? "The file could not be read.", "import-failed", { details: { reason: run.failure?.code }, findings: reporter.findings });
55
- const check = validate(run.presentation, checkOptions(options.catalogs ?? CLI_CATALOGS));
56
- for (const found of check.findings) reporter.addFinding(found);
57
- if (!check.valid) throw new OPFApiError(`The imported presentation is not valid OPF: ${firstError(check.findings)}`, "invalid-presentation", { findings: reporter.findings });
58
- return { presentation: run.presentation, findings: reporter.findings, ...run.signals ? { signals: run.signals } : {}, pptx: { package: PPTX_PACKAGE, version: pptx.version } };
59
- } catch (error) {
60
- throw asApiError(OPFImportError, error, "import-failed");
61
- }
62
- }
63
- var firstError = (findings) => {
64
- const first = findings.find((found) => found.severity === "error");
65
- return first ? `${first.message} [${first.ruleId}]` : "see findings.";
66
- };
67
- export {
68
- OPFApiError,
69
- OPFExportError,
70
- OPFImportError,
71
- OPFValidationError,
72
- assertValid,
73
- defaultCatalog,
74
- exportDeck,
75
- importDeck,
76
- readDeck,
77
- validate2 as validate,
78
- writeDeck
79
- };
80
- //# sourceMappingURL=api.js.map
package/dist/api.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/api.ts"],"sourcesContent":["// `@openpresentation/cli/api`: the format-oriented library API of the CLI package. Core reads and writes the text formats\n// (`readDeck`, `writeDeck`, `validate`, re-exported here from the one core this package depends on); this entry reads and\n// writes files (`exportDeck`: PDF, PNG, SVG and PPTX; `importDeck`: PPTX to a presentation). The two engines behind them,\n// `@openpresentation/opf-render` and `@openpresentation/opf-pptx`, are optional peers, loaded the first time a function needs\n// them; a missing one throws a typed error that carries the install command. The `opf render`, `opf export` and\n// `opf import` commands run the same code (export.ts, convert.ts).\n//\n// Output is deterministic: no network, no system fonts, no clock unless `date` is passed.\nimport { type Catalog, type Finding, type Presentation, type ValidateOptions, validate } from \"@openpresentation/opf\";\nimport { CLI_CATALOGS } from \"./catalogs.js\";\nimport { runImport } from \"./convert.js\";\nimport { OPFApiError, OPFExportError, OPFImportError, asApiError } from \"./errors.js\";\nimport { type ExportFile, type ExportFontSummary, type ExportOptions, VERSIONS, resolveExportOptions, runExport } from \"./export.js\";\nimport { listFontDirectories } from \"./fonts.js\";\nimport { PPTX_PACKAGE, loadPptx, loadRenderer } from \"./peers.js\";\nimport { Reporter } from \"./reporter.js\";\n\nexport { OPFValidationError, assertValid, readDeck, validate, writeDeck } from \"@openpresentation/opf\";\nexport type { DeckFormat, Finding, Presentation, ReadDeckOptions, ReadDeckResult, ValidateOptions, ValidationReport, WriteDeckOptions } from \"@openpresentation/opf\";\nexport { defaultCatalog } from \"@openpresentation/opf/catalog\";\nexport type { Catalog } from \"@openpresentation/opf\";\nexport { OPFApiError, OPFExportError, OPFImportError } from \"./errors.js\";\nexport type { ExportFile, ExportFontSummary, ExportFormat, ExportOptions } from \"./export.js\";\nexport type { FontsHandle } from \"./peers.js\";\n\n/** The check a presentation passes before it is exported or after it is imported: format and references, so a contrast warning never blocks a write. */\nconst checkOptions = (catalogs: readonly Catalog[]): ValidateOptions => ({ only: [\"format\", \"references\"], catalogs });\n\nexport interface ExportResult {\n\t/** The files, in slide order: one per slide for `svg` and `png`, otherwise one. */\n\tfiles: ExportFile[];\n\t/** The findings of the format and references check (warnings and notes; errors throw) and the diagnostics of the engines: fonts, layout, SVG, PDF and PPTX, each with a `render/`, `pptx/`, `pdf/`, `fonts/` or `cli/` rule prefix. */\n\tfindings: Finding[];\n\t/** The bundled fonts and font files used, and the substitutions made. */\n\tfonts: ExportFontSummary;\n\t/** Slide numbers left out because they are hidden (`svg`, `png`, `pdf` without `includeHidden` or `slides`). */\n\tskippedHidden: number[];\n\t/** With `paginate`: the pages the slides were split into. */\n\tpagination?: { pages: unknown };\n\t/** `pdf`: the mode used. */\n\tpdf?: { mode: \"vector\" | \"raster\" };\n\t/** The engines that drew the files. */\n\trenderer: { package: string; version: string };\n\tpptx?: { package: string; version: string };\n}\n\n/**\n * Draw a presentation as PDF, PNG, SVG or PPTX with the bundled open fonts. Throws `OPFExportError`: `peer-not-installed`,\n * `peer-too-old` or `peer-load-failed` for the engines, `invalid-option`, `invalid-presentation` (its `findings` are the\n * errors of the check), `no-slides`, `all-slides-hidden`, `export-failed` (a drawing error; `findings` hold it) or a font code.\n */\nexport async function exportDeck(presentation: Presentation, options: ExportOptions): Promise<ExportResult> {\n\ttry {\n\t\tconst resolved = resolveExportOptions(options);\n\t\tif (!presentation || typeof presentation !== \"object\" || Array.isArray(presentation)) throw new OPFApiError(\"exportDeck takes a presentation object; read JSON, YAML or Markdown text with readDeck first.\", \"invalid-option\");\n\t\t// Engines and font directories first, so a missing install is reported before the document is looked at.\n\t\tconst renderer = await loadRenderer();\n\t\tconst pptx = resolved.format === \"pptx\" ? await loadPptx() : undefined;\n\t\tconst userFonts = resolved.fonts ? [] : await listFontDirectories([...(resolved.fontDirs ?? [])], \"fontDirs\");\n\t\tconst check = validate(presentation, checkOptions(resolved.catalogs ?? CLI_CATALOGS));\n\t\tif (!check.valid) throw new OPFApiError(`The presentation is not valid OPF: ${firstError(check.findings)}`, \"invalid-presentation\", { findings: check.findings });\n\t\tconst reporter = new Reporter(check.findings);\n\t\tconst run = await runExport(presentation, resolved, { reporter, renderer, ...(pptx ? { pptx } : {}), userFonts });\n\t\tif (run.failure) throw new OPFApiError(run.failure.message, \"export-failed\", { details: { reason: run.failure.code }, findings: reporter.findings });\n\t\treturn {\n\t\t\tfiles: run.files,\n\t\t\tfindings: reporter.findings,\n\t\t\tfonts: run.fonts as ExportFontSummary,\n\t\t\tskippedHidden: run.skippedHidden,\n\t\t\t...(run.pagination ? { pagination: run.pagination } : {}),\n\t\t\t...(run.pdf ? { pdf: run.pdf } : {}),\n\t\t\t...VERSIONS(renderer, pptx),\n\t\t};\n\t} catch (error) {\n\t\tthrow asApiError(OPFExportError, error, \"export-failed\");\n\t}\n}\n\nexport interface ImportOptions {\n\t/** The catalogs the imported presentation's references resolve in. Omitted: core's default catalog. */\n\tcatalogs?: readonly Catalog[];\n\t/** Also return the raw per-shape layout and style signals of the file (`signals`). */\n\tsignals?: boolean;\n}\n\nexport interface ImportResult {\n\t/** The presentation. It passed the format and references check. */\n\tpresentation: Presentation;\n\t/** What the conversion could not keep or had to change, and the findings of the check. */\n\tfindings: Finding[];\n\t/** With `signals: true`. */\n\tsignals?: { version?: number };\n\t/** The importer that read the file. */\n\tpptx: { package: string; version: string };\n}\n\n/**\n * Read a PowerPoint file into an OPF presentation. Import is a conversion, not a lossless round trip for arbitrary decks:\n * what it cannot keep is reported in `findings`. Throws `OPFImportError`: `peer-not-installed`, `peer-too-old`,\n * `peer-load-failed`, `import-failed` (opf-pptx could not read the file; `findings` hold the error) or `invalid-presentation`.\n */\nexport async function importDeck(input: Uint8Array | ArrayBuffer, options: ImportOptions = {}): Promise<ImportResult> {\n\ttry {\n\t\tif (!(input instanceof Uint8Array) && !(input instanceof ArrayBuffer)) throw new OPFApiError(\"importDeck takes the bytes of a .pptx file (a Uint8Array, a Buffer or an ArrayBuffer).\", \"invalid-option\");\n\t\tconst pptx = await loadPptx();\n\t\tconst reporter = new Reporter();\n\t\tconst run = await runImport(input instanceof Uint8Array ? input : new Uint8Array(input), { signals: options.signals === true }, reporter, pptx);\n\t\tif (run.failure || !run.presentation) throw new OPFApiError(run.failure?.message ?? \"The file could not be read.\", \"import-failed\", { details: { reason: run.failure?.code }, findings: reporter.findings });\n\t\t// The deck is checked in its JSON form, so a located finding points into the document that would be written.\n\t\tconst check = validate(run.presentation, checkOptions(options.catalogs ?? CLI_CATALOGS));\n\t\tfor (const found of check.findings) reporter.addFinding(found);\n\t\tif (!check.valid) throw new OPFApiError(`The imported presentation is not valid OPF: ${firstError(check.findings)}`, \"invalid-presentation\", { findings: reporter.findings });\n\t\treturn { presentation: run.presentation as unknown as Presentation, findings: reporter.findings, ...(run.signals ? { signals: run.signals } : {}), pptx: { package: PPTX_PACKAGE, version: pptx.version } };\n\t} catch (error) {\n\t\tthrow asApiError(OPFImportError, error, \"import-failed\");\n\t}\n}\n\nconst firstError = (findings: readonly Finding[]) => {\n\tconst first = findings.find((found) => found.severity === \"error\");\n\treturn first ? `${first.message} [${first.ruleId}]` : \"see findings.\";\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,SAA8E,gBAAgB;AAS9F,SAAS,oBAAoB,aAAa,UAAU,YAAAA,WAAU,iBAAiB;AAE/E,SAAS,sBAAsB;AAO/B,IAAM,eAAe,CAAC,cAAmD,EAAE,MAAM,CAAC,UAAU,YAAY,GAAG,SAAS;AAyBpH,eAAsB,WAAW,cAA4B,SAA+C;AAC3G,MAAI;AACH,UAAM,WAAW,qBAAqB,OAAO;AAC7C,QAAI,CAAC,gBAAgB,OAAO,iBAAiB,YAAY,MAAM,QAAQ,YAAY,EAAG,OAAM,IAAI,YAAY,iGAAiG,gBAAgB;AAE7N,UAAM,WAAW,MAAM,aAAa;AACpC,UAAM,OAAO,SAAS,WAAW,SAAS,MAAM,SAAS,IAAI;AAC7D,UAAM,YAAY,SAAS,QAAQ,CAAC,IAAI,MAAM,oBAAoB,CAAC,GAAI,SAAS,YAAY,CAAC,CAAE,GAAG,UAAU;AAC5G,UAAM,QAAQ,SAAS,cAAc,aAAa,SAAS,YAAY,YAAY,CAAC;AACpF,QAAI,CAAC,MAAM,MAAO,OAAM,IAAI,YAAY,sCAAsC,WAAW,MAAM,QAAQ,CAAC,IAAI,wBAAwB,EAAE,UAAU,MAAM,SAAS,CAAC;AAChK,UAAM,WAAW,IAAI,SAAS,MAAM,QAAQ;AAC5C,UAAM,MAAM,MAAM,UAAU,cAAc,UAAU,EAAE,UAAU,UAAU,GAAI,OAAO,EAAE,KAAK,IAAI,CAAC,GAAI,UAAU,CAAC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