@embedpdf/engine-core 3.0.0-next.13 → 3.0.0-next.15

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 (135) hide show
  1. package/dist/AnnotationList-CkijRHet.d.cts +27163 -0
  2. package/dist/AnnotationList-CkijRHet.d.ts +27163 -0
  3. package/dist/Change-CKoxfTNY.js +889 -0
  4. package/dist/Change-CKoxfTNY.js.map +1 -0
  5. package/dist/Change-CjImsrN0.cjs +1020 -0
  6. package/dist/Change-CjImsrN0.cjs.map +1 -0
  7. package/dist/DocumentRenderService-BfFdFSwI.cjs +120 -0
  8. package/dist/DocumentRenderService-BfFdFSwI.cjs.map +1 -0
  9. package/dist/DocumentRenderService-DV3J9lMz.js +85 -0
  10. package/dist/DocumentRenderService-DV3J9lMz.js.map +1 -0
  11. package/dist/{DocumentSecurityService-_JRjqvoI.d.ts → DocumentSecurityService-CU1M6Q7m.d.ts} +100 -112
  12. package/dist/{DocumentSecurityService-ClTZc0zO.d.cts → DocumentSecurityService-e6vp2de8.d.cts} +100 -112
  13. package/dist/LocalDocumentHandle-D02FMm-Z.cjs +53 -0
  14. package/dist/LocalDocumentHandle-D02FMm-Z.cjs.map +1 -0
  15. package/dist/LocalDocumentHandle-DAPdaOt_.js +30 -0
  16. package/dist/LocalDocumentHandle-DAPdaOt_.js.map +1 -0
  17. package/dist/LocalEngine-DFoBm4B3.d.cts +1565 -0
  18. package/dist/LocalEngine-DPriFujS.d.ts +1565 -0
  19. package/dist/PageInsertBlankInput-CXHAM7l6.cjs +17 -0
  20. package/dist/PageInsertBlankInput-CXHAM7l6.cjs.map +1 -0
  21. package/dist/PageInsertBlankInput-DhVYVJ_S.js +12 -0
  22. package/dist/PageInsertBlankInput-DhVYVJ_S.js.map +1 -0
  23. package/dist/authority-B3BklsB4.js +2239 -0
  24. package/dist/authority-B3BklsB4.js.map +1 -0
  25. package/dist/authority-DLMNR7ff.cjs +2676 -0
  26. package/dist/authority-DLMNR7ff.cjs.map +1 -0
  27. package/dist/builders-CNj0POeY.js +161 -0
  28. package/dist/builders-CNj0POeY.js.map +1 -0
  29. package/dist/builders-Cgdp_YCn.cjs +184 -0
  30. package/dist/builders-Cgdp_YCn.cjs.map +1 -0
  31. package/dist/calibrate-7T3fnP8-.js +2404 -0
  32. package/dist/calibrate-7T3fnP8-.js.map +1 -0
  33. package/dist/calibrate-DJBXnhLE.cjs +2919 -0
  34. package/dist/calibrate-DJBXnhLE.cjs.map +1 -0
  35. package/dist/charmap-Cprti1ta.js +239 -0
  36. package/dist/charmap-Cprti1ta.js.map +1 -0
  37. package/dist/charmap-aYlefQP9.cjs +304 -0
  38. package/dist/charmap-aYlefQP9.cjs.map +1 -0
  39. package/dist/conformance.cjs +16753 -5247
  40. package/dist/conformance.cjs.map +1 -1
  41. package/dist/conformance.d.cts +928 -165
  42. package/dist/conformance.d.ts +928 -165
  43. package/dist/conformance.js +16731 -5268
  44. package/dist/conformance.js.map +1 -1
  45. package/dist/format-Bp3QFSH1.cjs +574 -0
  46. package/dist/format-Bp3QFSH1.cjs.map +1 -0
  47. package/dist/format-Dgg428Kb.js +461 -0
  48. package/dist/format-Dgg428Kb.js.map +1 -0
  49. package/dist/index.cjs +330 -103
  50. package/dist/index.d.cts +2 -2
  51. package/dist/index.d.ts +2 -2
  52. package/dist/index.js +14 -5
  53. package/dist/pageRefs-B3ur7Ckm.cjs +51 -0
  54. package/dist/pageRefs-B3ur7Ckm.cjs.map +1 -0
  55. package/dist/pageRefs-DkbuxSCV.js +40 -0
  56. package/dist/pageRefs-DkbuxSCV.js.map +1 -0
  57. package/dist/public.cjs +57 -0
  58. package/dist/public.d.cts +5 -0
  59. package/dist/public.d.ts +5 -0
  60. package/dist/public.js +9 -0
  61. package/dist/resolveAnnotationDraft-7Ke4nV7F.cjs +3646 -0
  62. package/dist/resolveAnnotationDraft-7Ke4nV7F.cjs.map +1 -0
  63. package/dist/resolveAnnotationDraft-CUpf0SMh.js +3167 -0
  64. package/dist/resolveAnnotationDraft-CUpf0SMh.js.map +1 -0
  65. package/dist/{resolver-inAVzsWt.js → resolver-CzxmD9Ck.js} +294 -144
  66. package/dist/resolver-CzxmD9Ck.js.map +1 -0
  67. package/dist/{resolver-CYVNV4hn.cjs → resolver-D2OCtE8F.cjs} +347 -143
  68. package/dist/resolver-D2OCtE8F.cjs.map +1 -0
  69. package/dist/runtime-Cl0v56mm.d.ts +2032 -0
  70. package/dist/runtime-p1WDzDo4.d.cts +2032 -0
  71. package/dist/runtime.cjs +733 -284
  72. package/dist/runtime.cjs.map +1 -1
  73. package/dist/runtime.d.cts +5 -1348
  74. package/dist/runtime.d.ts +5 -1348
  75. package/dist/runtime.js +396 -179
  76. package/dist/runtime.js.map +1 -1
  77. package/dist/schema-C-gU4vj7.cjs +3034 -0
  78. package/dist/schema-C-gU4vj7.cjs.map +1 -0
  79. package/dist/schema-DzlUNk38.js +2081 -0
  80. package/dist/schema-DzlUNk38.js.map +1 -0
  81. package/dist/schemas-Berf1swF.cjs +2481 -0
  82. package/dist/schemas-Berf1swF.cjs.map +1 -0
  83. package/dist/schemas-D6xOGjqg.js +1654 -0
  84. package/dist/schemas-D6xOGjqg.js.map +1 -0
  85. package/dist/subtype-CG4WpIRj.js +129 -0
  86. package/dist/subtype-CG4WpIRj.js.map +1 -0
  87. package/dist/subtype-aDt5TFmK.cjs +158 -0
  88. package/dist/subtype-aDt5TFmK.cjs.map +1 -0
  89. package/dist/validation.cjs +578 -0
  90. package/dist/validation.cjs.map +1 -0
  91. package/dist/validation.d.cts +174 -0
  92. package/dist/validation.d.ts +174 -0
  93. package/dist/validation.js +571 -0
  94. package/dist/validation.js.map +1 -0
  95. package/dist/value-BFS1R8ek.cjs +435 -0
  96. package/dist/value-BFS1R8ek.cjs.map +1 -0
  97. package/dist/value-Dhc8eYcx.js +340 -0
  98. package/dist/value-Dhc8eYcx.js.map +1 -0
  99. package/dist/viewport-BJW13EGZ.js +540 -0
  100. package/dist/viewport-BJW13EGZ.js.map +1 -0
  101. package/dist/viewport-DlL5Bxbg.cjs +671 -0
  102. package/dist/viewport-DlL5Bxbg.cjs.map +1 -0
  103. package/dist/wire.cjs +1056 -379
  104. package/dist/wire.cjs.map +1 -1
  105. package/dist/wire.d.cts +15069 -725
  106. package/dist/wire.d.ts +15069 -725
  107. package/dist/wire.js +825 -239
  108. package/dist/wire.js.map +1 -1
  109. package/package.json +10 -1
  110. package/dist/AbortError-Cq2igpZ6.cjs +0 -38
  111. package/dist/AbortError-Cq2igpZ6.cjs.map +0 -1
  112. package/dist/AbortError-DHqPBnYc.js +0 -27
  113. package/dist/AbortError-DHqPBnYc.js.map +0 -1
  114. package/dist/AnnotationListSnapshot-D3mFut1e.d.cts +0 -6871
  115. package/dist/AnnotationListSnapshot-D3mFut1e.d.ts +0 -6871
  116. package/dist/Engine-Bx0NOfmd.d.cts +0 -1264
  117. package/dist/Engine-DxtpCYcP.d.ts +0 -1264
  118. package/dist/PageInsertBlankInput-CqXBmFhN.cjs +0 -449
  119. package/dist/PageInsertBlankInput-CqXBmFhN.cjs.map +0 -1
  120. package/dist/PageInsertBlankInput-cHq9-i-z.js +0 -378
  121. package/dist/PageInsertBlankInput-cHq9-i-z.js.map +0 -1
  122. package/dist/builders-Bqm8yTpi.cjs +0 -3564
  123. package/dist/builders-Bqm8yTpi.cjs.map +0 -1
  124. package/dist/builders-Dqo2X-dt.js +0 -3121
  125. package/dist/builders-Dqo2X-dt.js.map +0 -1
  126. package/dist/fold-2V29cxCV.cjs +0 -447
  127. package/dist/fold-2V29cxCV.cjs.map +0 -1
  128. package/dist/fold-CdEJTBTn.js +0 -334
  129. package/dist/fold-CdEJTBTn.js.map +0 -1
  130. package/dist/resolver-CYVNV4hn.cjs.map +0 -1
  131. package/dist/resolver-inAVzsWt.js.map +0 -1
  132. package/dist/schemas-BLARNCgx.js +0 -3113
  133. package/dist/schemas-BLARNCgx.js.map +0 -1
  134. package/dist/schemas-DIqFMmrC.cjs +0 -4468
  135. package/dist/schemas-DIqFMmrC.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas-D6xOGjqg.js","names":[],"sources":["../src/wire/renderFamilies.ts","../src/wire/schemas.ts"],"sourcesContent":["import type { DocCapability } from '../auth/scope';\nimport type { LayerScopePlane } from '../dto/LayerScopes';\nimport type { PageRenderLayers } from '../dto/PageRender';\nimport type { DocResourceId } from './resources';\n\n/**\n * The four page pictures, by what they draw beside the page content: nothing\n * (`pages`), the annotations (`annotations`), the form fields (`fields`), or\n * both (`all`). The family is in the path, never in the token. Who may see a\n * picture and which planes it depends on differ per family, and a CDN grant\n * is a path prefix.\n */\nexport type PageRenderFamily = 'pages' | 'annotations' | 'fields' | 'all';\n\n/** A page pin a picture's token carries. */\nexport type PageRenderPin = 'contentVersion' | 'annotationVersion' | 'widgetVersion';\n\nexport interface PageRenderFamilySpec {\n readonly family: PageRenderFamily;\n /** Its resource at the document's shared path, and at a layer's. */\n readonly resource: DocResourceId;\n readonly layerResource: DocResourceId;\n /** What the picture draws beside the page content. */\n readonly draws: PageRenderLayers;\n /** The path between the document and the page key: `render/annotations/pages`. */\n readonly path: string;\n /** What reading the picture needs. */\n readonly needs: ReadonlyArray<DocCapability>;\n /**\n * The planes the picture depends on. It's read at the document's shared\n * path while a layer inherits every one of them.\n */\n readonly planes: ReadonlyArray<LayerScopePlane>;\n /** The page pins a versioned request carries: each plane's own. */\n readonly pins: ReadonlyArray<PageRenderPin>;\n}\n\nexport const PAGE_RENDER_FAMILIES: Readonly<Record<PageRenderFamily, PageRenderFamilySpec>> = {\n pages: {\n family: 'pages',\n resource: 'page-render',\n layerResource: 'layer-page-render',\n draws: { includeAnnotations: false, includeFormFields: false },\n path: 'render/pages',\n needs: ['doc.render'],\n planes: ['content'],\n pins: ['contentVersion'],\n },\n annotations: {\n family: 'annotations',\n resource: 'page-render-annotations',\n layerResource: 'layer-page-render-annotations',\n draws: { includeAnnotations: true, includeFormFields: false },\n path: 'render/annotations/pages',\n needs: ['doc.render', 'doc.annotate.read'],\n planes: ['content', 'annotations'],\n pins: ['contentVersion', 'annotationVersion'],\n },\n fields: {\n family: 'fields',\n resource: 'page-render-fields',\n layerResource: 'layer-page-render-fields',\n draws: { includeAnnotations: false, includeFormFields: true },\n path: 'render/fields/pages',\n needs: ['doc.render', 'doc.forms.read'],\n planes: ['content', 'forms'],\n pins: ['contentVersion', 'widgetVersion'],\n },\n all: {\n family: 'all',\n resource: 'page-render-all',\n layerResource: 'layer-page-render-all',\n draws: { includeAnnotations: true, includeFormFields: true },\n path: 'render/all/pages',\n needs: ['doc.render', 'doc.annotate.read', 'doc.forms.read'],\n planes: ['content', 'annotations', 'forms'],\n pins: ['contentVersion', 'annotationVersion', 'widgetVersion'],\n },\n};\n\n/** The family of a picture that draws `layers`. */\nexport function pageRenderFamilyOf(layers: PageRenderLayers): PageRenderFamily {\n if (layers.includeAnnotations) return layers.includeFormFields ? 'all' : 'annotations';\n return layers.includeFormFields ? 'fields' : 'pages';\n}\n","import type { Identity } from '../auth/scope/types';\nimport { PageRefSchema } from '../identity/PageRef.schema';\nimport type { PageRef } from '../identity/PageRef';\nimport { z } from 'zod';\n\nimport { DateInputSchema, IsoDateTimeSchema } from '../dto/IsoDateTime.schema';\n\nimport type { AnnotationList } from '../annotation/AnnotationList';\nimport { AnnotationRefSchema } from '../annotation/base.schema';\nimport {\n AnnotationDraftSchema,\n AnnotationPatchSchema,\n AnnotationSchema,\n PdfLinkTargetSchema,\n PdfLinkTargetWritableSchema,\n} from '../annotation/kinds';\nimport { WidgetDTOSchema, WidgetPatchSchema } from '../annotation/kinds/widget';\nimport {\n ANNOTATION_APPEARANCE_MODES,\n type AnnotationAppearanceImageOptions,\n type AnnotationAppearanceBatch,\n type AnnotationAppearanceMode,\n type AnnotationAppearancesQuery,\n type WidgetAppearancesQuery,\n} from '../dto/AnnotationRender';\nimport { AttachmentRefSchema, AttachmentSchema } from '../dto/Attachment.schema';\nimport {\n AppearanceResourceKeysSchema,\n ImageResourceKeysSchema,\n SourceResourceKeysSchema,\n} from './resourceKeys';\nimport { PAGE_RENDER_FAMILIES, type PageRenderFamily, type PageRenderPin } from './renderFamilies';\nimport type { CachePins } from '../dto/CachePins';\nimport type { DocumentManifest, ManifestPage } from '../dto/DocumentManifest';\nimport type { LayerScopes } from '../dto/LayerScopes';\nimport type { CustomMetadata } from '../dto/CustomMetadata';\nimport type { CustomMetadataPatch } from '../dto/CustomMetadataPatch';\nimport type { DocumentMetadata } from '../dto/DocumentMetadata';\nimport type { MetadataPatch } from '../dto/MetadataPatch';\nimport type { AnalyzeInput, ChangeAnalysis } from '../signature/analysis/types';\nimport type {\n BaseVersionInfo,\n DocumentProtection,\n DocumentVersionRef,\n FieldLockSpec,\n PdfRevision,\n SignatureCancelResult,\n SignatureCompleteResult,\n SignatureDTO,\n SignaturePrepared,\n SignatureSeedValue,\n SignatureSnapshot,\n} from '../signature/types';\nimport type { PageGeometryRun, PageGeometrySnapshot } from '../dto/PageGeometrySnapshot';\nimport { charMapViolation } from '../text/charmap';\nimport type { PageBoxes, PageLayout } from '../dto/PageLayout';\nimport type { PageListSnapshot } from '../dto/PageListSnapshot';\nimport type { NamedPageEntry } from '../dto/NamedPage';\nimport type { PageImageOptions, PageNetworkRenderFormat, PageRenderQuery } from '../dto/PageRender';\nimport type { PageTextSnapshot } from '../dto/PageTextSnapshot';\nimport { PdfPageActionsSchema } from '../dto/PdfAction.schema';\nimport type { PdfSaveMode } from '../dto/PdfSaveMode';\nimport type { DocumentSecurityState, PdfPermissionInfo } from '../engine/DocumentSecurityService';\nimport type { SerializedEngineError } from '../errors/EngineError';\nimport { EngineErrorCode } from '../errors/EngineErrorCode';\nimport {\n FormFieldDraftSchema,\n FormFieldDTOSchema,\n FormFieldPatchSchema,\n FormFieldWidgetSchema,\n FormWidgetSchema,\n WidgetPlacementSchema,\n} from '../forms/schema';\nimport { FormFieldRefSchema, FormFieldValueSchema } from '../forms/schema';\nimport {\n PageBoxSchema,\n PageQuadSchema,\n PdfQuadSchema,\n PdfRectSchema,\n PdfRotationSchema,\n PdfSizeSchema,\n} from '../geometry/schemas';\nimport type { AppearanceOutcome } from '../annotation/appearance';\nimport type { AnnotationListMutationMeta } from '../mutation/AnnotationListMutationMeta';\nimport type {\n AnnotationCreateResult,\n AnnotationDeleteResult,\n AnnotationReorderResult,\n AnnotationUpdateResult,\n} from '../mutation/AnnotationMutationResults';\nimport type {\n AttachmentCreateResult,\n AttachmentDeleteResult,\n AttachmentMutationMeta,\n} from '../mutation/AttachmentMutationResults';\nimport type { AttachmentList } from '../dto/Attachment';\nimport type {\n FormFieldCreateResult,\n FormCalculationsReorderResult,\n FormFieldDeleteResult,\n FormFieldUpdateResult,\n FormRepairResult,\n FormMutationMeta,\n FormResetResult,\n FormSetValueResult,\n FormWidgetDeleteResult,\n FormWidgetLinkResult,\n FormWidgetRestoreResult,\n FormWidgetsReorderResult,\n FormWidgetUpdateResult,\n} from '../mutation/FormMutationResults';\nimport type { CustomMetadataUpdateResult } from '../mutation/CustomMetadataUpdateResult';\nimport type { MetadataUpdateResult } from '../mutation/MetadataUpdateResult';\nimport type { CacheDelta, MutationMeta } from '../mutation/MutationMeta';\nimport type { PageDeleteInput } from '../mutation/PageDeleteInput';\nimport type { PageDeleteResult } from '../mutation/PageDeleteResult';\nimport { PAGE_INSERT_BLANK_MAX_COUNT } from '../mutation/PageInsertBlankInput';\nimport type { PageInsertResult } from '../mutation/PageInsertResult';\nimport type { PageFlattenInput, PageFlattenResult } from '../mutation/PageFlattenResult';\nimport type { RedactionApplyResult, RedactionApplyScope } from '../mutation/RedactionApplyResult';\nimport type { ListPosition } from '../mutation/ListPosition';\nimport type { PageReorderInput } from '../mutation/PageReorderInput';\nimport type { PageReorderResult } from '../mutation/PageReorderResult';\nimport type {\n AnnotationAppearanceExportInput,\n AnnotationFlattenInput,\n AnnotationFlattenResult,\n} from '../mutation/AnnotationFlattenResult';\nimport type { PageNameInput, PageRemoveNameInput } from '../mutation/PageNameInput';\nimport type { PageNameResult } from '../mutation/PageNameResult';\nimport type { PageRotateInput } from '../mutation/PageRotateInput';\nimport type { PageRotateResult } from '../mutation/PageRotateResult';\nimport type {\n AnnotationImportBody,\n AnnotationImportOptions,\n AnnotationImportResult,\n} from '../transfer/annotationImport';\nimport type { FormExportSelection } from '../transfer/formExport';\nimport type {\n FormImportBody,\n FormImportOptions,\n FormImportResult,\n FormValuesImportBody,\n FormValuesImportOptions,\n FormValuesImportResult,\n} from '../transfer/formImport';\nimport type { AnnotationExportSelection } from '../transfer/exportSelection';\nimport { fromBase64, toBase64 } from '../resource/base64';\nimport type {\n SearchMatch,\n SearchQuery,\n SearchRequest,\n SearchSlice,\n SearchSnippet,\n} from '../search/types';\nimport type { PdfTextSegment } from '../text/layout';\nexport type { CacheDelta, MutationMeta } from '../mutation/MutationMeta';\n\n/** Who a session acts for; see `Identity` in `auth/scope/types.ts`. */\nexport const IdentitySchema: z.ZodType<Identity> = z\n .object({\n userId: z.string().min(1).max(256).optional(),\n displayName: z.string().min(1).max(256).optional(),\n email: z.string().min(1).max(256).optional(),\n title: z.string().min(1).max(256).optional(),\n organization: z.string().min(1).max(256).optional(),\n organizationalUnit: z.string().min(1).max(256).optional(),\n groupId: z.string().min(1).max(256).optional(),\n })\n .strict();\n\nexport const DocumentMetadataSchema: z.ZodType<DocumentMetadata> = z.object({\n title: z.string().nullable(),\n author: z.string().nullable(),\n subject: z.string().nullable(),\n keywords: z.string().nullable(),\n producer: z.string().nullable(),\n creator: z.string().nullable(),\n createdAt: IsoDateTimeSchema.nullable(),\n modifiedAt: IsoDateTimeSchema.nullable(),\n trapped: z.enum(['true', 'false', 'unknown']),\n});\n\n/**\n * Three-state metadata patch. Mirrors annotation patch semantics:\n * `undefined` leaves a field, `null` clears it, a value sets it.\n */\nexport const MetadataPatchSchema: z.ZodType<MetadataPatch> = z\n .object({\n title: z.string().nullable().optional(),\n author: z.string().nullable().optional(),\n subject: z.string().nullable().optional(),\n keywords: z.string().nullable().optional(),\n producer: z.string().nullable().optional(),\n creator: z.string().nullable().optional(),\n createdAt: DateInputSchema.nullable().optional(),\n modifiedAt: DateInputSchema.nullable().optional(),\n trapped: z.enum(['true', 'false', 'unknown']).optional(),\n })\n .strict();\n\n/** The Info dict's other keys, `{ key: value }`. */\nexport const CustomMetadataSchema: z.ZodType<CustomMetadata> = z.record(z.string(), z.string());\n\n/**\n * A custom-key patch: every key is a field (string sets, `null` removes, left\n * out stays). Which keys a PDF can hold is the engine's check, so a refusal\n * names the key the same way on both engines.\n */\nexport const CustomMetadataPatchSchema: z.ZodType<CustomMetadataPatch> = z.record(\n z.string(),\n z.string().nullable(),\n);\n\nexport const OpenDocumentResponseSchema = z.object({\n id: z.string(),\n});\nexport type OpenDocumentResponse = z.infer<typeof OpenDocumentResponseSchema>;\n\n/**\n * Wire shape of `GET /v1/docs/:docId/head`. Mirrors the server-side\n * `DocumentHead` interface; the schema is the source of truth so\n * older SDKs talking to newer servers degrade gracefully (extra\n * fields are accepted and ignored).\n *\n * `docVersion` is the single monotonic integer per doc; it bumps on\n * any mutation that could change the manifest's content (page list,\n * per-page content, per-page annotations), which\n * makes `/manifest@docVersion=N` fully content-addressed and cache-friendly.\n * The server's layer mutations bump it.\n */\nexport const DocumentHeadSchema = z.object({\n id: z.string(),\n baseSha: z.string(),\n storageSizeBytes: z.number().int().nonnegative(),\n docVersion: z.number().int().positive(),\n state: z.enum(['pending', 'ready', 'failed', 'deleting']),\n encryption: z.object({\n state: z.enum(['unknown', 'none', 'encrypted', 'unsupported']),\n requiresPassword: z.boolean().nullable(),\n }),\n permissions: z.object({\n known: z.boolean(),\n bits: z.number().int().nonnegative().nullable(),\n allAllowed: z.boolean().nullable(),\n openedAs: z.enum(['none', 'user', 'owner']).nullable(),\n securityHandlerRevision: z.number().int().nullable(),\n canUpgradeToOwner: z.boolean(),\n }),\n access: z.object({\n required: z.boolean(),\n reasons: z.array(z.enum(['password', 'cdn', 'permissions-unknown'])),\n endpoint: z.string().optional(),\n }),\n});\nexport type DocumentHead = z.infer<typeof DocumentHeadSchema>;\n\nexport const AccessRequestSchema = z.object({\n /** Deprecated: identity now rides the path\n * (`/v1/docs/:docId/layers/:layerName/access`). Kept optional for the\n * legacy `/v1/access` alias, which requires `docId` in the body. */\n docId: z.string().min(1).optional(),\n layerName: z.string().min(1).optional(),\n password: z.string().optional(),\n passwordGrant: z.string().optional(),\n mode: z.enum(['any', 'owner']).optional(),\n /**\n * How many object numbers the caller's editing session wants now, at\n * most 32: 8 for a new session when absent, 0 for a client that holds\n * enough.\n */\n objectNumbers: z.number().int().nonnegative().optional(),\n});\nexport type AccessRequest = z.infer<typeof AccessRequestSchema>;\n\n/** `first`, `first + 1`, …, `first + count - 1`. */\nexport const ObjectNumberRangeSchema = z.object({\n first: z.number().int().positive(),\n count: z.number().int().positive(),\n});\n\n/** See `EditSessionAccess`. */\nexport const EditSessionAccessSchema = z.object({\n session: z.enum(['new', 'revived', 'live']),\n expiresIn: z.number().int().nonnegative(),\n objectNumbers: z.array(ObjectNumberRangeSchema),\n});\n\n/** See `EditSessionStatus`: the event stream's `session` event. */\nexport const EditSessionStatusSchema = z.object({\n held: z.array(ObjectNumberRangeSchema),\n expiresIn: z.number().int().nonnegative(),\n});\n\n/** `POST …/object-numbers`: a bulk reservation. */\nexport const ObjectNumberReservationRequestSchema = z.object({\n count: z.number().int().positive(),\n});\n\nexport const ObjectNumberReservationResponseSchema = z.object({\n objectNumbers: z.array(ObjectNumberRangeSchema),\n expiresIn: z.number().int().nonnegative(),\n});\n\n/**\n * Typed boolean view of the PDF user-access permission word. Names\n * mirror the `PdfBits` shape in @embedpdf/engine-core/auth/scope; ISO\n * bit numbers (3, 4, 5, 6, 9, 10, 11, 12).\n */\nconst PdfBitsObjectSchema = z.object({\n bit3: z.boolean(),\n bit4: z.boolean(),\n bit5: z.boolean(),\n bit6: z.boolean(),\n bit9: z.boolean(),\n bit10: z.boolean(),\n bit11: z.boolean(),\n bit12: z.boolean(),\n});\n\n/**\n * Capability-shaped advisory for the client UI. Mirrors\n * `PdfPermissionAdvisory` in @embedpdf/engine-core/runtime; one\n * boolean per UI badge.\n */\nconst PdfPermissionAdvisoryObjectSchema = z.object({\n canPrint: z.boolean(),\n canPrintHigh: z.boolean(),\n canCopy: z.boolean(),\n canAnnotate: z.boolean(),\n canFillForms: z.boolean(),\n canModifyForms: z.boolean(),\n canModifyPages: z.boolean(),\n canAssemble: z.boolean(),\n});\n\nconst PdfPermissionInfoObjectSchema: z.ZodType<PdfPermissionInfo> = z.object({\n known: z.boolean(),\n allAllowed: z.boolean().nullable(),\n bits: z.number().int().nonnegative().nullable(),\n openedAs: z.enum(['none', 'user', 'owner']).nullable(),\n securityHandlerRevision: z.number().int().nullable(),\n // Enriched fields from /access (commit 14). Optional so /head, which\n // doesn't always populate them, stays valid against this schema too.\n flags: PdfBitsObjectSchema.optional(),\n advisory: PdfPermissionAdvisoryObjectSchema.optional(),\n});\n\nconst PdfPermissionInfoSchema = PdfPermissionInfoObjectSchema.nullable();\n\nexport const DocumentSecurityStateSchema: z.ZodType<DocumentSecurityState> = z.object({\n encryption: z.object({\n state: z.enum(['unknown', 'none', 'encrypted', 'unsupported']),\n requiresPassword: z.boolean().nullable(),\n }),\n permissions: z.object({\n known: z.boolean(),\n bits: z.number().int().nonnegative().nullable(),\n allAllowed: z.boolean().nullable(),\n openedAs: z.enum(['none', 'user', 'owner']).nullable(),\n securityHandlerRevision: z.number().int().nullable(),\n canUpgradeToOwner: z.boolean(),\n }),\n access: z.object({\n required: z.boolean(),\n reasons: z.array(z.enum(['password', 'cdn', 'permissions-unknown'])),\n endpoint: z.string().optional(),\n }),\n});\n\nconst positiveCount = z.number().int().positive();\n\n/** See `BundleLimits`. */\nexport const BundleLimitsSchema = z\n .object({\n bundleBytes: positiveCount,\n manifestBytes: positiveCount,\n items: positiveCount,\n pages: positiveCount,\n resources: positiveCount,\n resourceBytes: positiveCount,\n imagePixels: positiveCount,\n })\n .strict();\n\nexport const AccessResponseSchema = z.object({\n security: DocumentSecurityStateSchema,\n cdn: z.object({\n adapter: z.enum(['none', 'cloudfront', 'cloud-cdn', 'bunny', 'azure-fd', 'custom-hmac']),\n expiresAt: z.number().int().positive(),\n cache: z.object({\n scope: z.enum(['browser-private', 'edge-shared']),\n immutableVersionedReads: z.boolean(),\n }),\n baseUrlOverrides: z.record(z.string(), z.string()).nullable(),\n authHeader: z.object({ name: z.string(), value: z.string() }).nullable(),\n // Optional signing channels — each adapter populates the subset it uses\n signedQueryParams: z.record(z.string(), z.string()).nullable(),\n signedCookies: z\n .array(\n z.object({\n name: z.string(),\n value: z.string(),\n domain: z.string().optional(),\n path: z.string().optional(),\n expires: z.number().int().optional(),\n }),\n )\n .nullable(),\n signedPathPolicies: z\n .array(\n z.object({\n pathPrefix: z.string(),\n queryParams: z.record(z.string(), z.string()),\n }),\n )\n .nullable(),\n }),\n passwordGrant: z.string().nullable(),\n pdfPermissions: PdfPermissionInfoSchema,\n scope: z.array(z.string()),\n /**\n * Concrete capability set granted to this caller after expanding\n * `pdf.permissions` and applying resolver implication rules. Client\n * UI should drive feature visibility off this, not off raw `scope`.\n * Always present in /access responses (server populates from\n * `expandRawScope`). Sorted alphabetically for stable change\n * detection.\n */\n effectiveScope: z.array(z.string()),\n /** What the document's signatures forbid; `effectiveScope` already leaves it out. */\n protection: z.lazy(() => DocumentProtectionSchema).nullable(),\n identity: IdentitySchema,\n originPasswordPolicy: z.object({\n mode: z.enum(['not-needed', 'client-retry', 'server-session']),\n }),\n expiresAt: z.number().int().positive(),\n /**\n * The deployment's render lattice — the canonical parameter points the\n * server treats as durable, CDN-shared artifacts. Lives here and never in\n * the manifest: manifests are version-pinned immutable objects; the\n * lattice is mutable deployment policy. The SDK exposes it (and a pure\n * `snap` helper) but never conforms requests implicitly — the same render\n * call must not return different pixels on local vs cloud. When\n * `enforced` is true the server rejects off-lattice render tokens with\n * 400; when false, off-lattice renders are computed but not persisted.\n * Absent on older servers → treat as unenforced/unknown.\n */\n renderPolicy: z\n .object({\n /**\n * Full-page renders quantize on `viewport.width` — the bounded\n * quantity is output pixels, never zoom (PDF page space is\n * effectively unbounded, so a scale lattice bounds artifact count\n * but not size).\n */\n fullPage: z.object({\n widths: z.array(z.number().int().positive()),\n }),\n /**\n * Reserved for deep-zoom tile support: scale-based pyramid ×\n * fixed tile size, constant per-job cost. Absent until the tiling\n * plugin ships.\n */\n tiles: z\n .object({\n tileSizes: z.array(z.number().int().positive()),\n scales: z.array(z.number().positive()),\n })\n .optional(),\n /**\n * Annotation-appearance lattice — scale-based (appearances are sized\n * by `rect × scale` and must track the page's effective render scale\n * for crisp composites).\n */\n appearances: z\n .object({\n scales: z.array(z.number().positive()),\n })\n .optional(),\n /** Worker-side output budget for degenerate page geometry. */\n maxRenderPixels: z.number().int().positive().optional(),\n formats: z.array(z.enum(['webp', 'png'])),\n background: z.enum(['white']),\n enforced: z.boolean(),\n })\n .optional(),\n /** The deployment's limits for an annotation import (see `BundleLimits`). */\n bundleLimits: BundleLimitsSchema,\n /** The caller's editing session (see `DocumentAccessInfo.edit`). */\n edit: EditSessionAccessSchema.optional(),\n});\nexport type AccessResponse = z.infer<typeof AccessResponseSchema>;\nexport type RenderPolicy = NonNullable<AccessResponse['renderPolicy']>;\n\nexport const PdfSaveModeSchema: z.ZodType<PdfSaveMode> = z.enum(['incremental', 'rewrite']);\n\nconst engineErrorCodeValues = Object.values(EngineErrorCode) as [\n EngineErrorCode,\n ...EngineErrorCode[],\n];\n\nexport const EngineErrorPayloadSchema: z.ZodType<SerializedEngineError> = z.object({\n name: z.literal('EngineError'),\n code: z.enum(engineErrorCodeValues),\n message: z.string(),\n details: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const CachePinsSchema: z.ZodType<CachePins> = z.object({\n contentVersion: z.number().int().positive(),\n annotationVersion: z.number().int().positive(),\n widgetVersion: z.number().int().positive(),\n});\n\n/**\n * Plane scopes are derived from the version counters when a layer manifest\n * is built, never stored. Absent on base manifests: consumers treat absence\n * as all-'layer' (never wrong, only unshared).\n */\nconst LayerScopeValueSchema = z.enum(['base', 'layer']);\nexport const LayerScopesSchema: z.ZodType<LayerScopes> = z.object({\n content: LayerScopeValueSchema,\n annotations: LayerScopeValueSchema,\n forms: LayerScopeValueSchema,\n layout: LayerScopeValueSchema,\n attachments: LayerScopeValueSchema,\n metadata: LayerScopeValueSchema,\n actions: LayerScopeValueSchema,\n});\nexport type { LayerScopes, LayerScopePlane } from '../dto/LayerScopes';\n\n/**\n * Per-page envelope inside `DocumentManifest`: the page, plus the\n * cache-busting integers the SDK embeds in leaf URLs\n * (`/pages/:pon/text@contentVersion=N`, `/pages/:pon/annotations@annotationVersion=N`).\n *\n * `contentVersion` bumps when the page's content stream changes\n * (text, page reorder doesn't, the pon is durable). `annotationVersion`\n * bumps when /Annots gains/loses entries or when a tracked annotation\n * mutates. The server derives both from its per-layer page state.\n */\nexport const ManifestPageSchema: z.ZodType<ManifestPage> = z.object({\n page: PageRefSchema,\n cache: CachePinsSchema,\n});\nexport type { ManifestPage } from '../dto/DocumentManifest';\n\n/**\n * Wire shape of `GET /v1/docs/:docId/manifest@docVersion=N`. Content-addressed\n * by `docVersion`; safe to cache with `Cache-Control: public,\n * max-age=31536000, immutable`.\n */\nexport const DocumentManifestSchema = z.object({\n docVersion: z.number().int().positive(),\n layoutVersion: z.number().int().positive(),\n metadataVersion: z.number().int().positive(),\n actionsVersion: z.number().int().positive().default(1),\n attachmentsVersion: z.number().int().positive().default(1),\n annotationsVersion: z.number().int().positive().default(1),\n formsVersion: z.number().int().positive().default(1),\n auditHead: z.number().int().nonnegative(),\n baseSha: z.string(),\n // Signing fences (absent on pre-signature servers: unwritten, unknown length).\n layerVersion: z.number().int().nonnegative().default(0),\n working: z.boolean().default(false),\n baseByteLength: z.number().int().nonnegative().default(0),\n // Plane scopes: layer manifests only; absent = all-'layer'.\n scopes: LayerScopesSchema.optional(),\n // Defined further down; lazy so this schema can come first.\n protection: z.lazy(() => DocumentProtectionSchema).nullable(),\n pages: z.array(ManifestPageSchema),\n}) as unknown as z.ZodType<DocumentManifest>;\nexport type { DocumentManifest } from '../dto/DocumentManifest';\n\n/** What both engines' `annotations.list()` return, and the server's list endpoints send. */\nexport const AnnotationListSchema: z.ZodType<AnnotationList> = z.object({\n annotations: z.array(AnnotationSchema),\n pages: z.array(PageRefSchema),\n auditHead: z.number().int().nonnegative().optional(),\n});\n\n/**\n * Wire shape of `GET …/text/pages/:pon/data@<contentVersion>` and the\n * `pages.text` worker result: the UTF-16-faithful extraction, the character\n * space size (`charCount` — the space geometry runs tile; not `text.length`),\n * and the optional character→text anchor map. Malformed maps are rejected\n * here with the shared `charMapViolation` invariants — absent/empty map\n * requires `charCount === text.length` (identity).\n */\nexport const PageTextSnapshotSchema: z.ZodType<PageTextSnapshot> = z\n .object({\n text: z.string(),\n charCount: z.number().int().nonnegative(),\n charMap: z\n .array(z.tuple([z.number().int().nonnegative(), z.number().int().nonnegative()]))\n .optional(),\n })\n .superRefine((snapshot, ctx) => {\n const violation = charMapViolation(snapshot.charCount, snapshot.text.length, snapshot.charMap);\n if (violation !== null) {\n ctx.addIssue({ code: z.ZodIssueCode.custom, path: ['charMap'], message: violation });\n }\n });\n\nexport const PageGeometryGlyphSchema = z.object({\n loose: PageBoxSchema,\n tight: PageBoxSchema.optional(),\n space: z.literal(true).optional(),\n empty: z.literal(true).optional(),\n});\n\nexport const RotatedGeometryGlyphSchema = z.object({\n loose: PageQuadSchema,\n tight: PageQuadSchema.optional(),\n space: z.literal(true).optional(),\n empty: z.literal(true).optional(),\n});\n\nexport const UprightGeometryRunSchema = z.object({\n rect: PageBoxSchema,\n start: z.number().int().nonnegative(),\n glyphs: z.array(PageGeometryGlyphSchema),\n fontSize: z.number().optional(),\n});\n\nexport const RotatedGeometryRunSchema = z.object({\n rect: PageBoxSchema,\n start: z.number().int().nonnegative(),\n glyphs: z.array(RotatedGeometryGlyphSchema),\n rotation: z.number(),\n ascentFlip: z.boolean(),\n fontSize: z.number().optional(),\n});\n\n// Rotated first: in zod's default strip mode the upright shape would accept a\n// zero-glyph rotated run and silently drop its angle; the rotated shape can\n// never swallow an upright run (it requires `rotation`/`ascentFlip`).\nexport const PageGeometryRunSchema: z.ZodType<PageGeometryRun> = z.union([\n RotatedGeometryRunSchema,\n UprightGeometryRunSchema,\n]);\n\nexport const PageGeometrySnapshotSchema: z.ZodType<PageGeometrySnapshot> = z.object({\n runs: z.array(PageGeometryRunSchema),\n});\n\n/**\n * Search wire shapes: the request body of the layer search route and the\n * `search.query` worker/route result. The server re-validates the query\n * semantics (`validateSearchQuery`: regex dialect + flag combos) after\n * parse — the schema only checks structure.\n */\nconst searchQueryObject = z.object({\n text: z.string(),\n regex: z.boolean().optional(),\n matchCase: z.boolean().optional(),\n wholeWord: z.boolean().optional(),\n matchDiacritics: z.boolean().optional(),\n ignoreWhitespace: z.boolean().optional(),\n});\nexport const SearchQuerySchema: z.ZodType<SearchQuery> = searchQueryObject;\n\nexport const SearchRequestSchema: z.ZodType<SearchRequest> = searchQueryObject.extend({\n snippets: z.boolean().optional(),\n from: PageRefSchema.optional(),\n cursor: z.string().optional(),\n limit: z\n .object({\n matches: z.number().int().positive().optional(),\n pages: z.number().int().positive().optional(),\n })\n .optional(),\n});\n\nexport const SearchSnippetSchema: z.ZodType<SearchSnippet> = z.object({\n before: z.string(),\n match: z.string(),\n after: z.string(),\n});\n\nexport const PdfTextSegmentSchema: z.ZodType<PdfTextSegment> = z.object({\n quad: PageQuadSchema,\n rect: PageBoxSchema,\n advance: z.union([z.literal(1), z.literal(-1)]),\n});\n\nexport const SearchMatchSchema: z.ZodType<SearchMatch> = z.object({\n page: PageRefSchema,\n start: z.number().int().nonnegative(),\n count: z.number().int().positive(),\n segments: z.array(PdfTextSegmentSchema),\n snippet: SearchSnippetSchema.optional(),\n});\n\nexport const SearchSliceSchema: z.ZodType<SearchSlice> = z.object({\n matches: z.array(SearchMatchSchema),\n nextCursor: z.string().nullable(),\n pagesSearched: z.number().int().nonnegative(),\n pageCount: z.number().int().nonnegative(),\n});\n\nexport const PageNetworkRenderFormatSchema: z.ZodType<PageNetworkRenderFormat> = z.enum([\n 'png',\n 'webp',\n]);\n\n/**\n * Wire schema for the cloud render endpoints, applied to the **nested**\n * shape produced by `unflatten(...)` of the parsed token or query string.\n *\n * Adding a new render option is one change here (a new field plus any\n * cross-field rule in `superRefine`) plus one entry in\n * `RenderTokenSchema.fields`. The token codec, flatten/unflatten helpers,\n * route handlers, and SDK URL builder are all generic and pick the new\n * field up automatically.\n *\n * Coercion: token fields and query strings both arrive as strings, so every\n * scalar uses `z.coerce.*`. Discriminated unions on `viewport.kind` and\n * `target.kind` enforce viewport / rect coherence by construction — no\n * superRefine for \"fields must appear together\" rules.\n */\n\nconst RenderViewportSchema = z.discriminatedUnion('kind', [\n z\n .object({\n kind: z.literal('width'),\n width: z.coerce.number().positive().finite(),\n })\n .strict(),\n z\n .object({\n kind: z.literal('scale'),\n scale: z.coerce.number().positive().finite().optional(),\n })\n .strict(),\n]);\n\nconst RenderTargetSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('page') }).strict(),\n z\n .object({\n kind: z.literal('rect'),\n rect: z\n .object({\n x: z.coerce.number().finite(),\n y: z.coerce.number().finite(),\n width: z.coerce.number().positive().finite(),\n height: z.coerce.number().positive().finite(),\n })\n .strict(),\n })\n .strict(),\n]);\n\nconst RenderRotationSchema = z.preprocess(\n (raw) => (raw === undefined ? undefined : Number(raw)),\n z.number().refine((n) => n === 0 || n === 90 || n === 180 || n === 270, {\n message: 'render rotation must be 0, 90, 180, or 270',\n }),\n);\n\nconst RenderBackgroundSchema = z.enum(['white', 'transparent']);\n\n/** WebP quality, 0 (smallest) to 1 (best) — the `canvas.toBlob` scale. */\nconst RenderQualitySchema = z.coerce.number().min(0).max(1);\n\nconst AppearanceModeSchema = z.enum(['normal', 'rollover', 'down']);\n\n/**\n * A token's `modes`: the modes it asks for, in the engine's mode order,\n * joined by `-` (`normal-down`). Anything else is refused, so one set of\n * modes has one spelling and one URL.\n */\nconst AppearanceModesSchema = z.string().transform((value, ctx) => {\n const modes = value.split('-') as AnnotationAppearanceMode[];\n const canonical = ANNOTATION_APPEARANCE_MODES.filter((mode) => modes.includes(mode));\n if (\n canonical.length === 0 ||\n canonical.length === ANNOTATION_APPEARANCE_MODES.length ||\n canonical.join('-') !== value\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n 'modes must name some but not all of normal, rollover, down, in that order, joined by -',\n });\n return z.NEVER;\n }\n return canonical;\n});\n\n/**\n * The query/token schema of one picture family (`PAGE_RENDER_FAMILIES`).\n * What a picture draws is in its path, never its token, so each family has\n * its own schema, built from one shared base:\n *\n * - its pins are the family's own (`contentVersion`, plus\n * `annotationVersion` and `widgetVersion` for the planes it draws), and\n * `.strict()` refuses any other, so a pin the family doesn't depend on\n * is unrepresentable;\n * - a versioned request (one with `contentVersion`) carries every one of\n * them, since the picture changes with each.\n *\n * The transform stamps what the family draws onto the parsed options, so\n * the worker options downstream need no family.\n */\nfunction buildPageRenderQuerySchema(family: PageRenderFamily): z.ZodType<PageRenderQuery> {\n const { draws, pins } = PAGE_RENDER_FAMILIES[family];\n const pinFields: Record<string, z.ZodTypeAny> = {};\n for (const pin of pins) pinFields[pin] = z.coerce.number().int().positive().optional();\n return z\n .object({\n ...pinFields,\n format: PageNetworkRenderFormatSchema.optional(),\n viewport: RenderViewportSchema.optional(),\n target: RenderTargetSchema.optional(),\n rotation: RenderRotationSchema.optional(),\n background: RenderBackgroundSchema.optional(),\n quality: RenderQualitySchema.optional(),\n })\n .strict()\n .superRefine((v, ctx) => {\n const pinned = v as Partial<Record<PageRenderPin, number>>;\n if (pinned.contentVersion === undefined) {\n for (const pin of pins) {\n if (pinned[pin] === undefined) continue;\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [pin],\n message: `${pin} requires contentVersion`,\n });\n }\n return;\n }\n if (v.format === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['format'],\n message: 'versioned render requires format',\n });\n }\n for (const pin of pins) {\n if (pinned[pin] !== undefined) continue;\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [pin],\n message: `a versioned ${family} picture requires ${pin}`,\n });\n }\n })\n .transform((v) => {\n const pinned = v as Partial<Record<PageRenderPin, number>>;\n const options: PageImageOptions = {\n ...(v.target ? { target: v.target } : {}),\n ...(v.viewport ? { viewport: v.viewport } : {}),\n ...(v.rotation !== undefined ? { rotation: v.rotation } : {}),\n ...(v.background !== undefined ? { background: v.background } : {}),\n ...(v.quality !== undefined ? { quality: v.quality } : {}),\n ...(v.format !== undefined ? { format: v.format } : {}),\n ...draws,\n };\n const query: PageRenderQuery = { options };\n for (const pin of pins) {\n if (pinned[pin] !== undefined) query[pin] = pinned[pin];\n }\n return query;\n }) as unknown as z.ZodType<PageRenderQuery>;\n}\n\n/** Query/token schemas of the four picture families, by family. */\nexport const PageRenderQuerySchemas: Readonly<\n Record<PageRenderFamily, z.ZodType<PageRenderQuery>>\n> = {\n pages: buildPageRenderQuerySchema('pages'),\n annotations: buildPageRenderQuerySchema('annotations'),\n fields: buildPageRenderQuerySchema('fields'),\n all: buildPageRenderQuerySchema('all'),\n};\n\n/**\n * Query/token schema of an appearance batch, keyed by `pin`. Mirrors\n * `PageRenderQuerySchema` but without page target/background or\n * `includeAnnotations` (appearances are always annotation-derived), and keyed\n * by the page's pin for its family only — appearance bitmaps do not depend on\n * page base content, so `contentVersion` is not part of the cache key. The\n * endpoint renders every mode and state an annotation stores, or the `modes`\n * asked for.\n */\nfunction buildAppearancesQuerySchema<Pin extends 'annotationVersion' | 'widgetVersion'>(pin: Pin) {\n return z\n .object({\n [pin]: z.coerce.number().int().positive().optional(),\n format: PageNetworkRenderFormatSchema.optional(),\n modes: AppearanceModesSchema.optional(),\n rotation: RenderRotationSchema.optional(),\n viewport: RenderViewportSchema.optional(),\n quality: RenderQualitySchema.optional(),\n } as Record<string, z.ZodTypeAny>)\n .strict()\n .superRefine((v, ctx) => {\n // A versioned (cacheable) request pins its version and must declare\n // the encoded format so the cached URL is unambiguous.\n if (v[pin] !== undefined && v.format === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['format'],\n message: 'versioned appearance render requires format',\n });\n }\n })\n .transform((v) => {\n const options: AnnotationAppearanceImageOptions = {\n ...(v.rotation !== undefined ? { rotation: v.rotation } : {}),\n ...(v.viewport ? { viewport: v.viewport } : {}),\n ...(v.quality !== undefined ? { quality: v.quality } : {}),\n ...(v.format !== undefined ? { format: v.format } : {}),\n ...(v.modes !== undefined ? { modes: v.modes } : {}),\n };\n return { options, ...(v[pin] !== undefined ? { [pin]: v[pin] } : {}) };\n });\n}\n\n/** Query/token schema of a page's annotation images (`annotations/pages/{p}/appearances@`). */\nexport const AnnotationAppearancesQuerySchema = buildAppearancesQuerySchema(\n 'annotationVersion',\n) as unknown as z.ZodType<AnnotationAppearancesQuery>;\n\n/** Query/token schema of a page's widget images (`form/pages/{p}/appearances@`). */\nexport const WidgetAppearancesQuerySchema = buildAppearancesQuerySchema(\n 'widgetVersion',\n) as unknown as z.ZodType<WidgetAppearancesQuery>;\n\n/**\n * The `body` part of the appearance `multipart/form-data` response.\n * Wire-stable; the cloud client validates the parsed `body` part against\n * this before reconstructing image handles from the binary parts.\n */\nexport const AnnotationAppearanceBatchSchema: z.ZodType<AnnotationAppearanceBatch> = z.object({\n page: PageRefSchema,\n appearances: z.array(\n z.object({\n resources: ImageResourceKeysSchema,\n ref: AnnotationRefSchema,\n mode: AppearanceModeSchema,\n state: z.string().nullable(),\n rect: PageBoxSchema,\n width: z.number().int().positive(),\n height: z.number().int().positive(),\n format: PageNetworkRenderFormatSchema,\n contentType: z.string().min(1),\n }),\n ),\n});\n\nexport const CacheDeltaSchema: z.ZodType<CacheDelta> = z.object({\n previousDocVersion: z.number().int().nonnegative(),\n docVersion: z.number().int().positive(),\n annotationsVersion: z.number().int().positive().optional(),\n formsVersion: z.number().int().positive().optional(),\n layoutVersion: z.number().int().positive().optional(),\n metadataVersion: z.number().int().positive().optional(),\n attachmentsVersion: z.number().int().positive().optional(),\n layerVersion: z.number().int().nonnegative().optional(),\n working: z.boolean().optional(),\n pages: z.array(\n z.object({\n page: PageRefSchema,\n cache: CachePinsSchema,\n }),\n ),\n});\n\nexport const MutationMetaSchema: z.ZodType<MutationMeta> = z.object({\n affectedPages: z.array(PageRefSchema),\n cacheDelta: CacheDeltaSchema.nullable(),\n opId: z.string(),\n undoable: z.boolean(),\n});\n\n/**\n * Where rows go in their list, on the wire: `'start'`, `'end'`, or one\n * object naming exactly one neighbour (`before` or `after`).\n */\nfunction listPositionSchema<Ref>(ref: z.ZodType<Ref>): z.ZodType<ListPosition<Ref>> {\n return z.union([\n z.enum(['start', 'end']),\n z\n .object({ before: ref.optional(), after: ref.optional() })\n .strict()\n .refine((position) => (position.before === undefined) !== (position.after === undefined), {\n message: 'exactly one of before or after',\n }),\n ]) as unknown as z.ZodType<ListPosition<Ref>>;\n}\n\n/** Where pages go among the document's pages. */\nexport const PagePositionSchema = listPositionSchema(PageRefSchema);\n\n/** Where annotations go among their page's annotations, or widgets among its widgets. */\nexport const AnnotationPositionSchema = listPositionSchema(AnnotationRefSchema);\n\n/** Where fields go in the form's calculation order. */\nexport const FieldPositionSchema = listPositionSchema(FormFieldRefSchema);\n\n/**\n * Stable public component names for the models every part of the document\n * wire shares (page refs, a write's meta, the metadata), like\n * `AnnotationWireComponents`.\n */\nexport const DocumentWireComponents = {\n PageRef: PageRefSchema,\n PagePosition: PagePositionSchema,\n CacheDelta: CacheDeltaSchema,\n MutationMeta: MutationMetaSchema,\n DocumentMetadata: DocumentMetadataSchema,\n MetadataPatch: MetadataPatchSchema,\n} as const satisfies Record<string, z.ZodTypeAny>;\n\n/** Per-page side-effect envelope every annotation mutation returns. Mirrors `AnnotationListMutationMeta`. */\nexport const AnnotationListMutationMetaSchema: z.ZodType<AnnotationListMutationMeta> = z.object({\n affectedPages: z.array(PageRefSchema),\n cacheDelta: CacheDeltaSchema.nullable(),\n opId: z.string(),\n undoable: z.boolean(),\n changed: z.array(AnnotationRefSchema),\n});\n\nexport const AnnotationCreateResultSchema: z.ZodType<AnnotationCreateResult> = z.object({\n annotation: AnnotationSchema,\n meta: AnnotationListMutationMetaSchema,\n});\n\nexport const AnnotationImportResultSchema: z.ZodType<AnnotationImportResult> = z.object({\n annotations: z.array(AnnotationSchema),\n refMap: z.array(z.object({ from: AnnotationRefSchema, to: AnnotationRefSchema })),\n dropped: z.array(\n z.object({\n ref: AnnotationRefSchema,\n field: z.string().optional(),\n reason: z.enum([\n 'unsupported-kind',\n 'widget',\n 'geospatial',\n 'unknown-measure',\n 'unsupported-action',\n 'unsupported-value',\n 'name-conflict',\n 'parent-dropped',\n 'parent-missing',\n 'popup-taken',\n ]),\n }),\n ),\n meta: AnnotationListMutationMetaSchema,\n}) as z.ZodType<AnnotationImportResult>;\n\n/** The engine's `/AP` verdict riding every update result (see engine-core\n * `annotation/appearance.ts`). `changed` drives client raster invalidation. */\nexport const AppearanceOutcomeSchema: z.ZodType<AppearanceOutcome> = z.object({\n action: z.enum(['preserved', 'regenerated', 'generation-unavailable', 'restored']),\n changed: z.boolean(),\n});\n\nexport const AnnotationUpdateResultSchema: z.ZodType<AnnotationUpdateResult> = z.object({\n annotation: AnnotationSchema,\n appearance: AppearanceOutcomeSchema,\n meta: AnnotationListMutationMetaSchema,\n});\n\nexport const AnnotationDeleteResultSchema: z.ZodType<AnnotationDeleteResult> = z.object({\n meta: AnnotationListMutationMetaSchema,\n});\n\n/**\n * Stable public component names for the annotation wire model, so an OpenAPI\n * projection names each once (`Annotation`, not one type per response that\n * carries one), like `PdfActionWireComponents`.\n */\nexport const AnnotationWireComponents = {\n Annotation: AnnotationSchema,\n AnnotationRef: AnnotationRefSchema,\n AnnotationDraft: AnnotationDraftSchema,\n AnnotationPatch: AnnotationPatchSchema,\n PdfLinkTarget: PdfLinkTargetSchema,\n PdfLinkTargetWritable: PdfLinkTargetWritableSchema,\n AnnotationList: AnnotationListSchema,\n AnnotationMutationMeta: AnnotationListMutationMetaSchema,\n AnnotationPosition: AnnotationPositionSchema,\n} as const satisfies Record<string, z.ZodTypeAny>;\n\n/** What `page.annotations.reorder` takes on the wire. */\nexport const AnnotationReorderBodySchema = z\n .object({ refs: z.array(AnnotationRefSchema).min(1), position: AnnotationPositionSchema })\n .strict();\n\n/** A stacking-order change: the page's annotations in their new order, as refs. */\nexport const AnnotationReorderResultSchema: z.ZodType<AnnotationReorderResult> = z.object({\n order: z.array(AnnotationRefSchema),\n meta: AnnotationListMutationMetaSchema,\n});\n\n/** A single-field write's meta: the envelope plus the fields and widgets it changed. */\nexport const FormMutationMetaSchema: z.ZodType<FormMutationMeta> = z.object({\n affectedPages: z.array(PageRefSchema),\n cacheDelta: CacheDeltaSchema.nullable(),\n opId: z.string(),\n undoable: z.boolean(),\n changedFields: z.array(FormFieldRefSchema),\n changedWidgets: z.array(FormWidgetSchema),\n redrawnWidgets: z.array(FormWidgetSchema),\n});\n\n/**\n * Stable public component names for the form wire model, so an OpenAPI\n * projection names each once (`FormField`, not one type per response that\n * carries one), like `AnnotationWireComponents`.\n */\nexport const FormWireComponents = {\n FormFieldRef: FormFieldRefSchema,\n FormField: FormFieldDTOSchema,\n FormFieldValue: FormFieldValueSchema,\n FormWidget: FormWidgetSchema,\n FormFieldDraft: FormFieldDraftSchema,\n FormFieldPatch: FormFieldPatchSchema,\n FieldPosition: FieldPositionSchema,\n WidgetPlacement: WidgetPlacementSchema,\n WidgetAnnotation: WidgetDTOSchema,\n WidgetPatch: WidgetPatchSchema,\n FormMutationMeta: FormMutationMetaSchema,\n} as const satisfies Record<string, z.ZodTypeAny>;\n\nexport const FormSetValueResultSchema: z.ZodType<FormSetValueResult> = z.object({\n field: FormFieldDTOSchema,\n widgets: z.array(WidgetDTOSchema),\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormSetValueResult>;\n\nexport const FormResetResultSchema: z.ZodType<FormResetResult> = z.object({\n fields: z.array(FormFieldDTOSchema),\n widgets: z.array(WidgetDTOSchema),\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormResetResult>;\n\n/** What `reset` takes on the wire: the fields to reset, or none for the whole form. */\nexport const FormResetBodySchema = z\n .object({ refs: z.array(FormFieldRefSchema).optional() })\n .strict();\n\n/** What `updateWidget` takes on the wire: the widget patch (`PATCH …/form/widgets/{p}/{key}`). */\nexport const FormWidgetUpdateBodySchema = z.object({ patch: WidgetPatchSchema }).strict();\n\nexport const FormImportResultSchema: z.ZodType<FormImportResult> = z.object({\n fields: z.array(FormFieldDTOSchema),\n widgets: z.array(WidgetDTOSchema),\n refMap: z.array(z.object({ from: FormFieldRefSchema, to: FormFieldRefSchema })),\n dropped: z.array(\n z.object({\n ref: FormFieldRefSchema.nullable(),\n widget: AnnotationRefSchema.optional(),\n field: z.string().optional(),\n reason: z.enum([\n 'name-conflict',\n 'no-field',\n 'unsupported-family',\n 'script-not-allowed',\n 'unsupported-action',\n ]),\n }),\n ),\n calculationOrder: z.array(FormFieldRefSchema).optional(),\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormImportResult>;\n\nexport const FormValuesImportResultSchema: z.ZodType<FormValuesImportResult> = z.object({\n fields: z.array(FormFieldDTOSchema),\n widgets: z.array(WidgetDTOSchema),\n dropped: z.array(\n z.object({\n ref: FormFieldRefSchema,\n reason: z.enum([\n 'no-field',\n 'wrong-family',\n 'value-not-allowed',\n 'locked',\n 'fill-not-allowed',\n ]),\n }),\n ),\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormValuesImportResult>;\n\nexport const FormFieldCreateResultSchema: z.ZodType<FormFieldCreateResult> = z.object({\n field: FormFieldDTOSchema,\n widgets: z.array(WidgetDTOSchema),\n calculationOrder: z.array(FormFieldRefSchema).optional(),\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormFieldCreateResult>;\n\nexport const FormFieldUpdateResultSchema: z.ZodType<FormFieldUpdateResult> = z.object({\n field: FormFieldDTOSchema,\n widgets: z.array(WidgetDTOSchema),\n calculationOrder: z.array(FormFieldRefSchema).optional(),\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormFieldUpdateResult>;\n\nexport const FormWidgetUpdateResultSchema: z.ZodType<FormWidgetUpdateResult> = z.object({\n widget: WidgetDTOSchema,\n appearance: AppearanceOutcomeSchema,\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormWidgetUpdateResult>;\n\n/** What `forms.reorderWidgets` takes on the wire: the widgets of one page and where they go. */\nexport const FormWidgetsReorderBodySchema = z\n .object({ widgets: z.array(AnnotationRefSchema).min(1), position: AnnotationPositionSchema })\n .strict();\n\n/** A widget stacking-order change: the page's widgets in their new order, as refs. */\nexport const FormWidgetsReorderResultSchema: z.ZodType<FormWidgetsReorderResult> = z.object({\n page: PageRefSchema,\n order: z.array(AnnotationRefSchema),\n meta: FormMutationMetaSchema,\n});\n\nexport const FormFieldDeleteResultSchema: z.ZodType<FormFieldDeleteResult> = z.object({\n calculationOrder: z.array(FormFieldRefSchema).optional(),\n meta: FormMutationMetaSchema,\n});\n\n/** What `forms.reorderCalculations` takes on the wire: the fields and where they go. */\nexport const FormCalculationsReorderBodySchema = z\n .object({ fields: z.array(FormFieldRefSchema).min(1), position: FieldPositionSchema })\n .strict();\n\n/** A calculation-order change: the form's whole new order. */\nexport const FormCalculationsReorderResultSchema: z.ZodType<FormCalculationsReorderResult> =\n z.object({\n calculationOrder: z.array(FormFieldRefSchema),\n meta: FormMutationMetaSchema,\n });\n\nexport const FormWidgetLinkResultSchema: z.ZodType<FormWidgetLinkResult> = z.object({\n field: FormFieldDTOSchema,\n widgets: z.array(WidgetDTOSchema),\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormWidgetLinkResult>;\n\nexport const FormWidgetDeleteResultSchema: z.ZodType<FormWidgetDeleteResult> = z.object({\n widget: AnnotationRefSchema,\n page: PageRefSchema,\n field: FormFieldDTOSchema.nullable(),\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormWidgetDeleteResult>;\n\nexport const FormWidgetRestoreResultSchema: z.ZodType<FormWidgetRestoreResult> = z.object({\n field: FormFieldDTOSchema.nullable(),\n widgets: z.array(WidgetDTOSchema),\n meta: FormMutationMetaSchema,\n}) as unknown as z.ZodType<FormWidgetRestoreResult>;\n\nexport const FormRepairResultSchema: z.ZodType<FormRepairResult> = z.object({\n acroformCreated: z.boolean(),\n fieldsLinked: z.number().int().nonnegative(),\n widgetsLinked: z.number().int().nonnegative(),\n fieldsUnrepairable: z.number().int().nonnegative(),\n appearancesBaked: z.number().int().nonnegative(),\n needsAppearancesCleared: z.boolean(),\n meta: MutationMetaSchema,\n});\n\n/**\n * A PDF box in PDF user space as a `PdfRect` (`{ left, bottom, right, top }`,\n * y-up edges, un-rotated, not origin-normalized). Re-exported from the\n * canonical geometry schema so the wire and the runtime agree.\n */\nexport { PdfRectSchema };\n\n/** A page's five boxes in page space: measured from the top-left of the crop box. */\nexport const PageBoxesSchema: z.ZodType<PageBoxes> = z.object({\n media: PageBoxSchema,\n crop: PageBoxSchema,\n bleed: PageBoxSchema,\n trim: PageBoxSchema,\n art: PageBoxSchema,\n});\n\n/**\n * Pure geometry for one page (`pages.list()` element). No annotation\n * liveness — that lives on annotation reads and the manifest.\n */\nexport const PageLayoutSchema: z.ZodType<PageLayout> = z.object({\n index: z.number().int().nonnegative(),\n ref: PageRefSchema,\n label: z.string().nullable(),\n size: PdfSizeSchema,\n rotation: PdfRotationSchema,\n userUnit: z.number().positive(),\n tabOrder: z.enum(['rows', 'columns', 'structure', 'annotations', 'widgets']).nullable(),\n boxes: PageBoxesSchema,\n pdfCropBox: PdfRectSchema,\n actions: PdfPageActionsSchema.optional(),\n});\n\nexport const PageFlattenResultSchema: z.ZodType<PageFlattenResult> = z.object({\n pages: z.array(PageRefSchema),\n usage: z.enum(['display', 'print']),\n results: z.array(\n z.object({\n page: PageRefSchema,\n status: z.enum(['applied', 'unchanged']),\n }),\n ),\n meta: MutationMetaSchema,\n});\n\n/** See `AnnotationFlattenResult`. */\nexport const AnnotationFlattenResultSchema: z.ZodType<AnnotationFlattenResult> = z.object({\n page: PageRefSchema,\n usage: z.enum(['display', 'print']),\n results: z.array(\n z.object({\n ref: AnnotationRefSchema,\n status: z.enum(['applied', 'unchanged']),\n }),\n ),\n meta: MutationMetaSchema,\n});\n\n/** `annotations.flatten` input — see `AnnotationFlattenInput`. */\nexport const AnnotationFlattenInputSchema: z.ZodType<AnnotationFlattenInput> = z.object({\n refs: z.array(AnnotationRefSchema).min(1),\n usage: z.enum(['display', 'print']),\n});\n\n/** `annotations.exportAppearance` input — see `AnnotationAppearanceExportInput`. */\nexport const AnnotationAppearanceExportInputSchema: z.ZodType<AnnotationAppearanceExportInput> =\n z.object({\n refs: z.array(AnnotationRefSchema).min(1),\n });\n\n/** `doc.annotations.export` selection — see `AnnotationExportSelection`. */\nexport const AnnotationExportSelectionSchema: z.ZodType<AnnotationExportSelection> = z\n .object({\n refs: z.array(AnnotationRefSchema).optional(),\n pages: z.array(PageRefSchema).optional(),\n include: z.enum(['references', 'threads']).optional(),\n })\n .strict();\n\n/**\n * The body of a POST annotation export: the pins a GET's token carries and\n * the selection, for one a URL can't carry.\n */\nexport const AnnotationsExportRequestSchema = z\n .object({\n annotationsVersion: z.number().int().positive(),\n layoutVersion: z.number().int().positive(),\n selection: AnnotationExportSelectionSchema,\n })\n .strict();\n\n/** Where an import puts each page of a bundle — see `BundleImportPages`. */\nconst BundleImportPagesSchema = z.union([\n z.literal('same'),\n z.literal('by-position'),\n z.array(z.object({ from: PageRefSchema, to: PageRefSchema }).strict()),\n]);\n\n/** `doc.forms.export` selection — see `FormExportSelection`. */\nexport const FormExportSelectionSchema: z.ZodType<FormExportSelection> = z\n .object({\n fields: z.array(FormFieldRefSchema).optional(),\n pages: z.array(PageRefSchema).optional(),\n })\n .strict();\n\n/**\n * The body of a POST form export: the pins a GET's token carries and the\n * selection, for one a URL can't carry.\n */\nexport const FormExportRequestSchema = z\n .object({\n formsVersion: z.number().int().positive(),\n layoutVersion: z.number().int().positive(),\n selection: FormExportSelectionSchema,\n })\n .strict();\n\n/** `doc.forms.import` options on the wire; the `opId` is the `Idempotency-Key` header. */\nexport const FormImportOptionsSchema: z.ZodType<Omit<FormImportOptions, 'opId'>> = z\n .object({\n pages: BundleImportPagesSchema.optional(),\n attribution: z.enum(['restore', 'stamp']).optional(),\n values: z.boolean().optional(),\n })\n .strict();\n\n/** `doc.forms.importValues` options on the wire. */\nexport const FormValuesImportOptionsSchema: z.ZodType<Omit<FormValuesImportOptions, 'opId'>> = z\n .object({ attribution: z.enum(['restore', 'stamp']).optional() })\n .strict();\n\n/** A form bundle's envelope: its rows are the worker's to check, as an annotation bundle's. */\nconst FormBundleEnvelopeSchema = z\n .object({\n format: z.literal('embedpdf/form'),\n version: z.literal(1),\n pages: z.array(z.unknown()),\n fields: z.array(z.unknown()),\n widgets: z.array(z.unknown()),\n calculationOrder: z.array(z.unknown()),\n })\n .strict();\n\n/** The `body` part of a form import request. */\nexport const FormImportBodySchema: z.ZodType<FormImportBody> = z\n .object({ bundle: FormBundleEnvelopeSchema, options: FormImportOptionsSchema })\n .strict() as unknown as z.ZodType<FormImportBody>;\n\n/** The `body` part of a form values import request. */\nexport const FormValuesImportBodySchema: z.ZodType<FormValuesImportBody> = z\n .object({ bundle: FormBundleEnvelopeSchema, options: FormValuesImportOptionsSchema })\n .strict() as unknown as z.ZodType<FormValuesImportBody>;\n\n/** `doc.annotations.import` options on the wire; the `opId` is the `Idempotency-Key` header. */\nexport const AnnotationImportOptionsSchema: z.ZodType<Omit<AnnotationImportOptions, 'opId'>> = z\n .object({\n pages: BundleImportPagesSchema.optional(),\n attribution: z.enum(['restore', 'stamp']).optional(),\n })\n .strict();\n\n/**\n * The `body` part of an import request. Only its envelope is checked\n * here: the bundle's pages and items are the worker's to check, against the\n * limits and each kind's create schema.\n */\nexport const AnnotationImportBodySchema: z.ZodType<AnnotationImportBody> = z\n .object({\n bundle: z\n .object({\n format: z.literal('embedpdf/annotations'),\n version: z.literal(1),\n pages: z.array(z.unknown()),\n items: z.array(z.unknown()),\n })\n .strict(),\n options: AnnotationImportOptionsSchema,\n })\n .strict() as unknown as z.ZodType<AnnotationImportBody>;\n\nexport const PageFlattenInputSchema: z.ZodType<PageFlattenInput> = z.object({\n pages: z.array(PageRefSchema),\n usage: z.enum(['display', 'print']),\n});\n\n/**\n * `{ pages }` or `{ annotations }`: one object with exactly one of the two,\n * so the wire has no untagged union (the API reference labels variants by a\n * discriminating literal, and a scope has none to add).\n */\nexport const RedactionApplyScopeSchema: z.ZodType<RedactionApplyScope> = z\n .object({\n pages: z.array(PageRefSchema).optional(),\n annotations: z.array(AnnotationRefSchema).optional(),\n })\n .strict()\n .refine((scope) => (scope.pages === undefined) !== (scope.annotations === undefined), {\n message: 'exactly one of pages or annotations',\n }) as unknown as z.ZodType<RedactionApplyScope>;\n\nexport const RedactionApplyResultSchema: z.ZodType<RedactionApplyResult> = z.object({\n scope: RedactionApplyScopeSchema,\n results: z.array(\n z.object({\n page: PageRefSchema,\n status: z.enum(['applied', 'unchanged']),\n removedAnnotationCount: z.number().int().nonnegative(),\n }),\n ),\n removedAnnotationCount: z.number().int().nonnegative(),\n meta: MutationMetaSchema,\n});\n\n/**\n * Snapshot of every page in display order. Pages are addressed by\n * `pageObjectNumber` everywhere except the per-element `index`, which is\n * display order and intentionally not an identity. Carries geometry only.\n */\n/** See `NamedPageEntry`: decoded key + what it resolves to. */\nexport const NamedPageEntrySchema: z.ZodType<NamedPageEntry> = z.object({\n name: z.string(),\n target: z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('page'), page: PageRefSchema }),\n z.object({ kind: z.literal('template'), objectNumber: z.number().int().positive() }),\n z.object({ kind: z.literal('dangling') }),\n ]),\n});\n\nexport const PageListSnapshotSchema: z.ZodType<PageListSnapshot> = z.object({\n pageCount: z.number().int().nonnegative(),\n pages: z.array(PageLayoutSchema),\n namedPages: z.array(NamedPageEntrySchema),\n});\n\n/** `pages.setName` input — see `PageNameInput`. */\nexport const PageNameInputSchema: z.ZodType<PageNameInput> = z.object({\n name: z.string().min(1),\n page: PageRefSchema,\n replace: z.string().min(1).optional(),\n});\n\n/** `pages.removeName` input — see `PageRemoveNameInput`. */\nexport const PageRemoveNameInputSchema: z.ZodType<PageRemoveNameInput> = z.object({\n name: z.string().min(1),\n});\n\n/** Page reorder input: the pages, in their new order, and where they go. */\nexport const PageReorderInputSchema: z.ZodType<PageReorderInput> = z\n .object({\n pages: z.array(PageRefSchema).min(1),\n position: PagePositionSchema,\n })\n .strict();\n\n/**\n * Page reorder result. No per-page revision is bumped (they survive a page\n * reorder). The whole new order is returned so callers swap their snapshot.\n */\nexport const PageReorderResultSchema: z.ZodType<PageReorderResult> = z.object({\n pages: z.array(PageRefSchema),\n layout: PageListSnapshotSchema,\n meta: MutationMetaSchema,\n});\n\n/** Named-page mutation result — layout-shaped, see `PageNameResult`. */\nexport const PageNameResultSchema: z.ZodType<PageNameResult> = z.object({\n layout: PageListSnapshotSchema,\n meta: MutationMetaSchema,\n});\n\n/**\n * Page rotate input. Absolute rotation (idempotent — see `PageRotateInput`),\n * one value applied to every listed page.\n */\nexport const PageRotateInputSchema: z.ZodType<PageRotateInput> = z.object({\n pages: z.array(PageRefSchema),\n rotation: PdfRotationSchema,\n});\n\n/**\n * Page rotate result. Rotation is presentation metadata over normalized\n * content: nothing per-page invalidates; the new `layout` carries the\n * rotation values (see `PageRotateResult`).\n */\nexport const PageRotateResultSchema: z.ZodType<PageRotateResult> = z.object({\n layout: PageListSnapshotSchema,\n meta: MutationMetaSchema,\n});\n\n/** Page delete input. Deleting every page is rejected server/worker-side. */\nexport const PageDeleteInputSchema: z.ZodType<PageDeleteInput> = z.object({\n pages: z.array(PageRefSchema),\n});\n\n/**\n * Page delete result. Deleted page object numbers are retired (never recycled); surviving\n * pages keep identity + revisions (see `PageDeleteResult`).\n */\nexport const PageDeleteResultSchema: z.ZodType<PageDeleteResult> = z.object({\n layout: PageListSnapshotSchema,\n meta: MutationMetaSchema,\n});\n\n/**\n * Page insert (bytes) input — the `body` part of the multipart envelope;\n * the PDF rides the part `resources.source` names. `position` omitted →\n * `'end'`.\n */\nexport const PageInsertInputSchema: z.ZodType<{\n position?: ListPosition<PageRef>;\n resources: { source: string };\n}> = z\n .object({ position: PagePositionSchema.optional(), resources: SourceResourceKeysSchema })\n .strict();\n\n/**\n * Blank-page insert input — plain JSON, pages.insert minus the bytes.\n * `size` is in PDF points (un-rotated); `count` shares the contract cap\n * with the worker so a request the schema accepts cannot then fail the\n * worker's own guard.\n */\nexport const PageInsertBlankInputSchema: z.ZodType<{\n size: { width: number; height: number };\n count?: number;\n position?: ListPosition<PageRef>;\n}> = z.object({\n size: z.object({\n width: z.number().positive().finite(),\n height: z.number().positive().finite(),\n }),\n count: z.number().int().min(1).max(PAGE_INSERT_BLANK_MAX_COUNT).optional(),\n position: PagePositionSchema.optional(),\n});\n\n/** Page extract input: the pages to export, in the order they should appear. */\nexport const PageExtractInputSchema: z.ZodType<{ pages: PageRef[] }> = z.object({\n pages: z.array(PageRefSchema).min(1),\n});\n\n/**\n * Page insert result — shared by bytes-insert and blank-insert: the fresh\n * page object numbers in insertion order plus the full new layout (see `PageInsertResult`).\n */\nexport const PageInsertResultSchema: z.ZodType<PageInsertResult> = z.object({\n insertedPages: z.array(PageRefSchema),\n layout: PageListSnapshotSchema,\n meta: MutationMetaSchema,\n});\n\n/** See `AttachmentMutationMeta`. */\nexport const AttachmentMutationMetaSchema: z.ZodType<AttachmentMutationMeta> = z.object({\n affectedPages: z.array(PageRefSchema),\n cacheDelta: CacheDeltaSchema.nullable(),\n opId: z.string(),\n undoable: z.boolean(),\n changed: z.array(AttachmentRefSchema),\n});\n\nexport const AttachmentCreateResultSchema: z.ZodType<AttachmentCreateResult> = z.object({\n attachment: AttachmentSchema,\n meta: AttachmentMutationMetaSchema,\n});\n\nexport const AttachmentDeleteResultSchema: z.ZodType<AttachmentDeleteResult> = z.object({\n meta: AttachmentMutationMetaSchema,\n});\n\n/** See `AttachmentList`. */\nexport const AttachmentListSchema: z.ZodType<AttachmentList> = z.object({\n attachments: z.array(AttachmentSchema),\n});\n\n/**\n * Metadata write result: the re-read `metadata`. On the cloud,\n * `meta.cacheDelta` advances only `docVersion` and `metadataVersion`.\n */\nexport const MetadataUpdateResultSchema: z.ZodType<MetadataUpdateResult> = z.object({\n metadata: DocumentMetadataSchema,\n meta: MutationMetaSchema,\n});\n\nexport const CustomMetadataUpdateResultSchema: z.ZodType<CustomMetadataUpdateResult> = z.object({\n custom: CustomMetadataSchema,\n meta: MutationMetaSchema,\n});\n\n// ---------------------------------------------------------------------------\n// Digital signatures: the JSON forms of the two-phase signing DTOs.\n//\n// `SignaturePrepared.digest` and `SignatureCompleteInput.cms` are bytes;\n// `JSON.stringify` turns a typed array into an index-keyed object, which\n// the completion gate then rejects. These codecs are the one definition\n// the HTTP bodies and the server's durable `prepared_json` share.\n// ---------------------------------------------------------------------------\n\nexport { fromBase64, toBase64 };\n\nconst Base64Schema = z.string().regex(/^[A-Za-z0-9+/]*={0,2}$/, 'base64');\n\nexport const DocumentVersionRefSchema: z.ZodType<DocumentVersionRef> = z.object({\n baseSha256: z.string().regex(/^[0-9a-f]{64}$/),\n editsVersion: z.number().int().nonnegative(),\n});\n\nexport const ByteRangeSchema = z.tuple([\n z.number().int().nonnegative(),\n z.number().int().nonnegative(),\n z.number().int().nonnegative(),\n z.number().int().nonnegative(),\n]);\n\n/** `SignaturePrepared` with the digest as base64. */\nexport const SignaturePreparedWireSchema = z.object({\n signingId: z.string().min(1),\n digest: Base64Schema,\n algorithm: z.enum(['sha256', 'sha384', 'sha512']),\n byteRange: ByteRangeSchema,\n contentsSize: z.number().int().positive(),\n subFilter: z.string(),\n expectedVersion: DocumentVersionRefSchema,\n expiresAt: z.string().nullable(),\n});\nexport type SignaturePreparedWire = z.infer<typeof SignaturePreparedWireSchema>;\n\nexport function encodePrepared(prepared: SignaturePrepared): SignaturePreparedWire {\n return { ...prepared, digest: toBase64(prepared.digest) };\n}\n\nexport function decodePrepared(wire: SignaturePreparedWire): SignaturePrepared {\n return {\n ...wire,\n digest: fromBase64(wire.digest),\n subFilter: wire.subFilter as SignaturePrepared['subFilter'],\n };\n}\n\n/** The JSON body of a completion: the CMS as base64 beside the fence. */\nexport const SignatureCompleteBodySchema = z.object({\n cms: Base64Schema.refine((v) => v.length > 0, 'cms is required'),\n expectedVersion: DocumentVersionRefSchema,\n});\nexport type SignatureCompleteBody = z.infer<typeof SignatureCompleteBodySchema>;\n\n// ---------------------------------------------------------------------------\n// Digital signatures: the read-side DTOs, the prepare body, the analysis\n// query, and the version catalog.\n// ---------------------------------------------------------------------------\n\nconst DocMdpPermissionSchema = z.union([z.literal(1), z.literal(2), z.literal(3)]);\nconst ModificationLevelSchema = z.enum(['none', 'lta', 'fill', 'annotate']);\nconst DigestAlgorithmSchema = z.enum(['sha1', 'sha256', 'sha384', 'sha512']);\n\nexport const FieldLockSpecSchema: z.ZodType<FieldLockSpec> = z.object({\n action: z.enum(['all', 'include', 'exclude']),\n fields: z.array(z.string()),\n permission: DocMdpPermissionSchema.optional(),\n});\n\nexport const SignatureSeedValueSchema: z.ZodType<SignatureSeedValue> = z.object({\n requiredFlags: z.number().int(),\n presentFlags: z.number().int(),\n version: z.number().int().nullable(),\n mdp: z.union([z.literal(0), z.literal(1), z.literal(2), z.literal(3)]).nullable(),\n filter: z.string().nullable(),\n subFilters: z.array(z.string()),\n digestMethods: z.array(z.string()),\n reasons: z.array(z.string()),\n unsupportedRequired: z.boolean(),\n});\n\nexport const SignatureDTOSchema: z.ZodType<SignatureDTO> = z.object({\n index: z.number().int().nonnegative(),\n field: FormFieldRefSchema,\n fieldName: z.string(),\n widget: FormFieldWidgetSchema.nullable(),\n signed: z.boolean(),\n kind: z.enum(['signature', 'timestamp']),\n filter: z.string().nullable(),\n subFilter: z.string().nullable(),\n byteRange: ByteRangeSchema.nullable(),\n contentsSize: z.number().int().nonnegative(),\n coverage: z.enum(['whole-revision', 'partial', 'malformed']).nullable(),\n revisionIndex: z.number().int().nonnegative().nullable(),\n signer: z.object({\n name: z.string().nullable(),\n reason: z.string().nullable(),\n location: z.string().nullable(),\n contactInfo: z.string().nullable(),\n signedAt: IsoDateTimeSchema.nullable(),\n }),\n docMdp: DocMdpPermissionSchema.nullable(),\n catalogCertification: z.boolean(),\n fieldMdp: FieldLockSpecSchema.nullable(),\n lock: FieldLockSpecSchema.nullable(),\n seedValue: SignatureSeedValueSchema.nullable(),\n});\n\nexport const DocumentProtectionSchema: z.ZodType<DocumentProtection> = z.object({\n enforced: ModificationLevelSchema.nullable(),\n judged: ModificationLevelSchema.nullable(),\n certification: z\n .object({ signatureIndex: z.number().int().nonnegative(), permission: DocMdpPermissionSchema })\n .nullable(),\n fieldLocks: z.array(\n z.object({\n signatureIndex: z.number().int().nonnegative(),\n source: z.enum(['fieldmdp', 'lock']),\n spec: FieldLockSpecSchema,\n }),\n ),\n policyVersion: z.number().int(),\n});\n\nexport const PdfRevisionSchema: z.ZodType<PdfRevision> = z.object({\n index: z.number().int().nonnegative(),\n end: z.number().int().nonnegative(),\n xrefOffset: z.number().int().nonnegative(),\n signatureIndex: z.number().int().nonnegative().nullable(),\n});\n\nexport const SignatureSnapshotSchema: z.ZodType<SignatureSnapshot> = z.object({\n chainValid: z.boolean(),\n revisions: z.array(PdfRevisionSchema),\n signatures: z.array(SignatureDTOSchema),\n protection: DocumentProtectionSchema,\n});\n\nexport const BaseVersionInfoSchema: z.ZodType<BaseVersionInfo> = z.object({\n sha256: z.string().regex(/^[0-9a-f]{64}$/),\n byteLength: z.number().int().nonnegative(),\n});\n\nexport const SignatureCompleteResultSchema: z.ZodType<SignatureCompleteResult> = z.object({\n status: z.enum(['completed', 'already-completed']),\n signature: SignatureDTOSchema,\n version: BaseVersionInfoSchema,\n previous: DocumentVersionRefSchema,\n protection: DocumentProtectionSchema,\n meta: MutationMetaSchema,\n});\n\nexport const SignatureCancelResultSchema: z.ZodType<SignatureCancelResult> = z.object({\n status: z.enum(['cancelled', 'already-completed', 'unknown']),\n});\n\nconst ChangeFindingSchema = z.object({\n rule: z.string(),\n verdict: z.enum(['permitted', 'forbidden', 'incomplete']),\n objectNumber: z.number().int().nonnegative(),\n edge: z.string().optional(),\n detail: z.string().optional(),\n});\n\nconst AnalysisDetailSchema = z.enum(['summary', 'full']);\n\n/** The analysis: one verdict (`current`) with its findings, the restrictions it was judged under, and facts about the revisions in between. */\nexport const ChangeAnalysisSchema = z.object({\n mode: z.enum(['authoritative', 'exploratory']),\n policyVersion: z.number().int(),\n basis: z.object({\n version: BaseVersionInfoSchema,\n editsVersion: z.number().int().nonnegative(),\n source: z.enum(['persisted', 'working-copy']),\n }),\n since: z.object({\n revisionIndex: z.number().int().nonnegative(),\n signatureIndex: z.number().int().nonnegative().nullable(),\n }),\n until: z.object({ revisionIndex: z.number().int().nonnegative() }),\n restrictions: z.array(\n z.object({\n signatureIndex: z.number().int().nonnegative(),\n revisionIndex: z.number().int().nonnegative(),\n source: z.enum(['docmdp', 'fieldmdp', 'lock']),\n own: z.boolean(),\n permission: z.union([z.literal(1), z.literal(2), z.literal(3)]).optional(),\n fields: z.unknown().optional(),\n }),\n ),\n current: z.object({\n verdict: z.enum(['unchanged', 'permitted', 'forbidden', 'indeterminate']),\n complete: z.boolean(),\n primary: ChangeFindingSchema.optional(),\n findings: z.array(ChangeFindingSchema),\n method: z.enum(['net-state', 'net-state+replay']),\n }),\n later: z.object({\n revisionCount: z.number().int().nonnegative(),\n undoneObjectNumbers: z.array(z.number().int().nonnegative()),\n }),\n /** Equals `current.verdict`. */\n verdict: z.enum(['unchanged', 'permitted', 'forbidden', 'indeterminate']),\n /** The step DTOs are large and evolving; carried verbatim. */\n steps: z.array(z.unknown()),\n}) as unknown as z.ZodType<ChangeAnalysis>;\n\nconst SignatureSignerInputSchema = z.object({\n name: z.string().optional(),\n reason: z.string().optional(),\n location: z.string().optional(),\n contactInfo: z.string().optional(),\n signedAt: IsoDateTimeSchema.optional(),\n});\n\n/** The `body` part of a visual signature fill: which part holds the one-page PDF. */\nexport const SignatureAppearanceBodySchema = z.object({\n resources: AppearanceResourceKeysSchema,\n});\nexport type SignatureAppearanceBody = z.infer<typeof SignatureAppearanceBodySchema>;\n\n/**\n * The `body` part of a prepare: `SignaturePrepareInput` with the\n * appearance artwork named by the key of its part instead of inline bytes.\n */\nexport const SignaturePrepareBodySchema = z.object({\n field: FormFieldRefSchema,\n kind: z.enum(['signature', 'timestamp']).optional(),\n subFilter: z.enum(['adbe.pkcs7.detached', 'ETSI.CAdES.detached']).optional(),\n digest: z.enum(['sha256', 'sha384', 'sha512']).optional(),\n contentsSize: z.number().int().positive().optional(),\n signer: SignatureSignerInputSchema.optional(),\n certify: z.object({ permission: DocMdpPermissionSchema }).optional(),\n lock: FieldLockSpecSchema.optional(),\n resources: AppearanceResourceKeysSchema.optional(),\n});\nexport type SignaturePrepareBody = z.infer<typeof SignaturePrepareBodySchema>;\n\nconst optionalIndex = z.coerce.number().int().nonnegative().optional();\n\n/** Layer analysis query (the current form): exactly one `since.*`; the working copy is the end. */\nexport const LayerAnalysisQuerySchema = z\n .object({\n 'since.signature': optionalIndex,\n 'since.revision': optionalIndex,\n level: ModificationLevelSchema.optional(),\n detail: AnalysisDetailSchema.optional(),\n })\n .refine((q) => (q['since.signature'] === undefined) !== (q['since.revision'] === undefined), {\n message: 'exactly one of since.signature / since.revision is required',\n });\nexport type LayerAnalysisQuery = z.infer<typeof LayerAnalysisQuerySchema>;\n\n/** Version analysis query: as the layer's, plus `until` (a revision index; default the last). */\nexport const VersionAnalysisQuerySchema = z\n .object({\n 'since.signature': optionalIndex,\n 'since.revision': optionalIndex,\n until: optionalIndex,\n level: ModificationLevelSchema.optional(),\n detail: AnalysisDetailSchema.optional(),\n /** The judging policy version the caller expects — a cache key, not an input (version responses are immutable). */\n policy: optionalIndex,\n })\n .refine((q) => (q['since.signature'] === undefined) !== (q['since.revision'] === undefined), {\n message: 'exactly one of since.signature / since.revision is required',\n });\nexport type VersionAnalysisQuery = z.infer<typeof VersionAnalysisQuerySchema>;\n\nexport function analyzeInputFromQuery(\n query: LayerAnalysisQuery | VersionAnalysisQuery,\n until: AnalyzeInput['until'],\n): AnalyzeInput {\n const since =\n query['since.signature'] !== undefined\n ? { signatureIndex: query['since.signature'] }\n : { revisionIndex: query['since.revision'] ?? 0 };\n return {\n since,\n ...(until !== undefined ? { until } : {}),\n ...(query.level !== undefined ? { exploratoryLevel: query.level } : {}),\n ...(query.detail !== undefined ? { detail: query.detail } : {}),\n };\n}\n\n/** One row of the document's version catalog. */\nexport const DocumentVersionSchema = z.object({\n sha256: z.string().regex(/^[0-9a-f]{64}$/),\n byteLength: z.number().int().nonnegative(),\n number: z.number().int().positive(),\n parentSha256: z.string().nullable(),\n producer: z.enum(['upload', 'signature']),\n signingId: z.string().nullable(),\n createdAt: z.number().int(),\n});\nexport type DocumentVersion = z.infer<typeof DocumentVersionSchema>;\n\nexport const DocumentVersionsSchema = z.object({\n /** `documents.base_sha`: the version every layer is over, or behind. */\n head: z.string().regex(/^[0-9a-f]{64}$/),\n /** Oldest first. */\n versions: z.array(DocumentVersionSchema),\n});\nexport type DocumentVersions = z.infer<typeof DocumentVersionsSchema>;\n\nexport { DigestAlgorithmSchema, ModificationLevelSchema };\n\nexport const PageScaleResultSchema = z.object({\n page: PageRefSchema,\n meta: MutationMetaSchema,\n});\n"],"mappings":";;;;;;AAqCA,MAAa,uBAAiF;CAC5F,OAAO;EACL,QAAQ;EACR,UAAU;EACV,eAAe;EACf,OAAO;GAAE,oBAAoB;GAAO,mBAAmB;EAAM;EAC7D,MAAM;EACN,OAAO,CAAC,YAAY;EACpB,QAAQ,CAAC,SAAS;EAClB,MAAM,CAAC,gBAAgB;CACzB;CACA,aAAa;EACX,QAAQ;EACR,UAAU;EACV,eAAe;EACf,OAAO;GAAE,oBAAoB;GAAM,mBAAmB;EAAM;EAC5D,MAAM;EACN,OAAO,CAAC,cAAc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C;AAGD,MAAa,yBAAyB,EAAE,OAAO;;CAE7C,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,gBAAgB;;CAEvC,UAAU,EAAE,MAAM,qBAAqB;AACzC,CAAC;AAKD,MAAa,wBAAwB,EAAE,OAAO;CAC5C,MAAM;CACN,MAAM;AACR,CAAC"}
@@ -0,0 +1,129 @@
1
+ //#region src/annotation/subtype.ts
2
+ /**
3
+ * Closed-world string catalog of annotation subtypes the wire format knows
4
+ * about. The TypeScript discriminated union `Annotation` is keyed on this
5
+ * literal type. PDFium's integer subtype code is mapped onto these strings
6
+ * by the reader registry.
7
+ *
8
+ * `unsupported` is the forward-compat fallback for any PDF subtype the
9
+ * engine has no reader for. Unknown subtypes never
10
+ * silently disappear from the wire — they round-trip as
11
+ * `{ subtype: 'unsupported', rawSubtypeCode }`.
12
+ */
13
+ const ANNOTATION_SUBTYPES = [
14
+ "text",
15
+ "link",
16
+ "free-text",
17
+ "line",
18
+ "square",
19
+ "circle",
20
+ "polygon",
21
+ "polyline",
22
+ "highlight",
23
+ "underline",
24
+ "squiggly",
25
+ "strikeout",
26
+ "stamp",
27
+ "caret",
28
+ "ink",
29
+ "popup",
30
+ "file-attachment",
31
+ "redact",
32
+ "widget",
33
+ "unsupported"
34
+ ];
35
+ /**
36
+ * PDFium subtype codes from `FPDFAnnot_GetSubtype`. Mirrors
37
+ * `FPDF_ANNOTATION_SUBTYPE` in `public/fpdf_annot.h`. We keep this here
38
+ * (rather than importing from @embedpdf/engine-runtime) so the engine-core
39
+ * package has zero PDFium dependency.
40
+ */
41
+ const PdfAnnotationSubtypeCode = {
42
+ UNKNOWN: 0,
43
+ TEXT: 1,
44
+ LINK: 2,
45
+ FREETEXT: 3,
46
+ LINE: 4,
47
+ SQUARE: 5,
48
+ CIRCLE: 6,
49
+ POLYGON: 7,
50
+ POLYLINE: 8,
51
+ HIGHLIGHT: 9,
52
+ UNDERLINE: 10,
53
+ SQUIGGLY: 11,
54
+ STRIKEOUT: 12,
55
+ STAMP: 13,
56
+ CARET: 14,
57
+ INK: 15,
58
+ POPUP: 16,
59
+ FILEATTACHMENT: 17,
60
+ SOUND: 18,
61
+ MOVIE: 19,
62
+ WIDGET: 20,
63
+ SCREEN: 21,
64
+ PRINTERMARK: 22,
65
+ TRAPNET: 23,
66
+ WATERMARK: 24,
67
+ THREED: 25,
68
+ RICHMEDIA: 26,
69
+ XFAWIDGET: 27,
70
+ REDACT: 28
71
+ };
72
+ /**
73
+ * Map from PDFium codes to wire-stable string subtypes. A code missing here
74
+ * reads as 'unsupported'.
75
+ */
76
+ const PDF_CODE_TO_SUBTYPE = Object.freeze({
77
+ [PdfAnnotationSubtypeCode.TEXT]: "text",
78
+ [PdfAnnotationSubtypeCode.LINK]: "link",
79
+ [PdfAnnotationSubtypeCode.FREETEXT]: "free-text",
80
+ [PdfAnnotationSubtypeCode.LINE]: "line",
81
+ [PdfAnnotationSubtypeCode.SQUARE]: "square",
82
+ [PdfAnnotationSubtypeCode.CIRCLE]: "circle",
83
+ [PdfAnnotationSubtypeCode.POLYGON]: "polygon",
84
+ [PdfAnnotationSubtypeCode.POLYLINE]: "polyline",
85
+ [PdfAnnotationSubtypeCode.HIGHLIGHT]: "highlight",
86
+ [PdfAnnotationSubtypeCode.UNDERLINE]: "underline",
87
+ [PdfAnnotationSubtypeCode.SQUIGGLY]: "squiggly",
88
+ [PdfAnnotationSubtypeCode.STRIKEOUT]: "strikeout",
89
+ [PdfAnnotationSubtypeCode.STAMP]: "stamp",
90
+ [PdfAnnotationSubtypeCode.CARET]: "caret",
91
+ [PdfAnnotationSubtypeCode.INK]: "ink",
92
+ [PdfAnnotationSubtypeCode.POPUP]: "popup",
93
+ [PdfAnnotationSubtypeCode.FILEATTACHMENT]: "file-attachment",
94
+ [PdfAnnotationSubtypeCode.WIDGET]: "widget",
95
+ [PdfAnnotationSubtypeCode.REDACT]: "redact"
96
+ });
97
+ /**
98
+ * Reverse map for write paths that need to turn a wire subtype back into the
99
+ * PDFium integer code without importing the zod-backed annotation registry.
100
+ */
101
+ const PDF_SUBTYPE_TO_CODE = Object.freeze({
102
+ text: PdfAnnotationSubtypeCode.TEXT,
103
+ link: PdfAnnotationSubtypeCode.LINK,
104
+ "free-text": PdfAnnotationSubtypeCode.FREETEXT,
105
+ line: PdfAnnotationSubtypeCode.LINE,
106
+ square: PdfAnnotationSubtypeCode.SQUARE,
107
+ circle: PdfAnnotationSubtypeCode.CIRCLE,
108
+ polygon: PdfAnnotationSubtypeCode.POLYGON,
109
+ polyline: PdfAnnotationSubtypeCode.POLYLINE,
110
+ highlight: PdfAnnotationSubtypeCode.HIGHLIGHT,
111
+ underline: PdfAnnotationSubtypeCode.UNDERLINE,
112
+ squiggly: PdfAnnotationSubtypeCode.SQUIGGLY,
113
+ strikeout: PdfAnnotationSubtypeCode.STRIKEOUT,
114
+ stamp: PdfAnnotationSubtypeCode.STAMP,
115
+ caret: PdfAnnotationSubtypeCode.CARET,
116
+ ink: PdfAnnotationSubtypeCode.INK,
117
+ popup: PdfAnnotationSubtypeCode.POPUP,
118
+ "file-attachment": PdfAnnotationSubtypeCode.FILEATTACHMENT,
119
+ redact: PdfAnnotationSubtypeCode.REDACT,
120
+ widget: PdfAnnotationSubtypeCode.WIDGET,
121
+ unsupported: PdfAnnotationSubtypeCode.UNKNOWN
122
+ });
123
+ function subtypeFromCode(code) {
124
+ return PDF_CODE_TO_SUBTYPE[code] ?? "unsupported";
125
+ }
126
+ //#endregion
127
+ export { subtypeFromCode as a, PdfAnnotationSubtypeCode as i, PDF_CODE_TO_SUBTYPE as n, PDF_SUBTYPE_TO_CODE as r, ANNOTATION_SUBTYPES as t };
128
+
129
+ //# sourceMappingURL=subtype-CG4WpIRj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subtype-CG4WpIRj.js","names":[],"sources":["../src/annotation/subtype.ts"],"sourcesContent":["/**\n * Closed-world string catalog of annotation subtypes the wire format knows\n * about. The TypeScript discriminated union `Annotation` is keyed on this\n * literal type. PDFium's integer subtype code is mapped onto these strings\n * by the reader registry.\n *\n * `unsupported` is the forward-compat fallback for any PDF subtype the\n * engine has no reader for. Unknown subtypes never\n * silently disappear from the wire — they round-trip as\n * `{ subtype: 'unsupported', rawSubtypeCode }`.\n */\nexport const ANNOTATION_SUBTYPES = [\n 'text',\n 'link',\n 'free-text',\n 'line',\n 'square',\n 'circle',\n 'polygon',\n 'polyline',\n 'highlight',\n 'underline',\n 'squiggly',\n 'strikeout',\n 'stamp',\n 'caret',\n 'ink',\n 'popup',\n 'file-attachment',\n 'redact',\n 'widget',\n 'unsupported',\n] as const;\n\nexport type AnnotationSubtype = (typeof ANNOTATION_SUBTYPES)[number];\n\n/**\n * PDFium subtype codes from `FPDFAnnot_GetSubtype`. Mirrors\n * `FPDF_ANNOTATION_SUBTYPE` in `public/fpdf_annot.h`. We keep this here\n * (rather than importing from @embedpdf/engine-runtime) so the engine-core\n * package has zero PDFium dependency.\n */\nexport const PdfAnnotationSubtypeCode = {\n UNKNOWN: 0,\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n RICHMEDIA: 26,\n XFAWIDGET: 27,\n REDACT: 28,\n} as const;\n\nexport type PdfAnnotationSubtypeCode =\n (typeof PdfAnnotationSubtypeCode)[keyof typeof PdfAnnotationSubtypeCode];\n\n/**\n * Map from PDFium codes to wire-stable string subtypes. A code missing here\n * reads as 'unsupported'.\n */\nexport const PDF_CODE_TO_SUBTYPE: Readonly<Record<number, AnnotationSubtype>> = Object.freeze({\n [PdfAnnotationSubtypeCode.TEXT]: 'text',\n [PdfAnnotationSubtypeCode.LINK]: 'link',\n [PdfAnnotationSubtypeCode.FREETEXT]: 'free-text',\n [PdfAnnotationSubtypeCode.LINE]: 'line',\n [PdfAnnotationSubtypeCode.SQUARE]: 'square',\n [PdfAnnotationSubtypeCode.CIRCLE]: 'circle',\n [PdfAnnotationSubtypeCode.POLYGON]: 'polygon',\n [PdfAnnotationSubtypeCode.POLYLINE]: 'polyline',\n [PdfAnnotationSubtypeCode.HIGHLIGHT]: 'highlight',\n [PdfAnnotationSubtypeCode.UNDERLINE]: 'underline',\n [PdfAnnotationSubtypeCode.SQUIGGLY]: 'squiggly',\n [PdfAnnotationSubtypeCode.STRIKEOUT]: 'strikeout',\n [PdfAnnotationSubtypeCode.STAMP]: 'stamp',\n [PdfAnnotationSubtypeCode.CARET]: 'caret',\n [PdfAnnotationSubtypeCode.INK]: 'ink',\n [PdfAnnotationSubtypeCode.POPUP]: 'popup',\n [PdfAnnotationSubtypeCode.FILEATTACHMENT]: 'file-attachment',\n [PdfAnnotationSubtypeCode.WIDGET]: 'widget',\n [PdfAnnotationSubtypeCode.REDACT]: 'redact',\n});\n\n/**\n * Reverse map for write paths that need to turn a wire subtype back into the\n * PDFium integer code without importing the zod-backed annotation registry.\n */\nexport const PDF_SUBTYPE_TO_CODE: Readonly<Record<AnnotationSubtype, PdfAnnotationSubtypeCode>> =\n Object.freeze({\n text: PdfAnnotationSubtypeCode.TEXT,\n link: PdfAnnotationSubtypeCode.LINK,\n 'free-text': PdfAnnotationSubtypeCode.FREETEXT,\n line: PdfAnnotationSubtypeCode.LINE,\n square: PdfAnnotationSubtypeCode.SQUARE,\n circle: PdfAnnotationSubtypeCode.CIRCLE,\n polygon: PdfAnnotationSubtypeCode.POLYGON,\n polyline: PdfAnnotationSubtypeCode.POLYLINE,\n highlight: PdfAnnotationSubtypeCode.HIGHLIGHT,\n underline: PdfAnnotationSubtypeCode.UNDERLINE,\n squiggly: PdfAnnotationSubtypeCode.SQUIGGLY,\n strikeout: PdfAnnotationSubtypeCode.STRIKEOUT,\n stamp: PdfAnnotationSubtypeCode.STAMP,\n caret: PdfAnnotationSubtypeCode.CARET,\n ink: PdfAnnotationSubtypeCode.INK,\n popup: PdfAnnotationSubtypeCode.POPUP,\n 'file-attachment': PdfAnnotationSubtypeCode.FILEATTACHMENT,\n redact: PdfAnnotationSubtypeCode.REDACT,\n widget: PdfAnnotationSubtypeCode.WIDGET,\n unsupported: PdfAnnotationSubtypeCode.UNKNOWN,\n });\n\nexport function subtypeFromCode(code: number): AnnotationSubtype {\n return PDF_CODE_TO_SUBTYPE[code] ?? 'unsupported';\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;AAUA,MAAa,2BAA2B;CACtC,SAAS;CACT,MAAM;CACN,MAAM;CACN,UAAU;CACV,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,WAAW;CACX,WAAW;CACX,UAAU;CACV,WAAW;CACX,OAAO;CACP,OAAO;CACP,KAAK;CACL,OAAO;CACP,gBAAgB;CAChB,OAAO;CACP,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,SAAS;CACT,WAAW;CACX,QAAQ;CACR,WAAW;CACX,WAAW;CACX,QAAQ;AACV;;;;;AASA,MAAa,sBAAmE,OAAO,OAAO;EAC3F,yBAAyB,OAAO;EAChC,yBAAyB,OAAO;EAChC,yBAAyB,WAAW;EACpC,yBAAyB,OAAO;EAChC,yBAAyB,SAAS;EAClC,yBAAyB,SAAS;EAClC,yBAAyB,UAAU;EACnC,yBAAyB,WAAW;EACpC,yBAAyB,YAAY;EACrC,yBAAyB,YAAY;EACrC,yBAAyB,WAAW;EACpC,yBAAyB,YAAY;EACrC,yBAAyB,QAAQ;EACjC,yBAAyB,QAAQ;EACjC,yBAAyB,MAAM;EAC/B,yBAAyB,QAAQ;EACjC,yBAAyB,iBAAiB;EAC1C,yBAAyB,SAAS;EAClC,yBAAyB,SAAS;AACrC,CAAC;;;;;AAMD,MAAa,sBACX,OAAO,OAAO;CACZ,MAAM,yBAAyB;CAC/B,MAAM,yBAAyB;CAC/B,aAAa,yBAAyB;CACtC,MAAM,yBAAyB;CAC/B,QAAQ,yBAAyB;CACjC,QAAQ,yBAAyB;CACjC,SAAS,yBAAyB;CAClC,UAAU,yBAAyB;CACnC,WAAW,yBAAyB;CACpC,WAAW,yBAAyB;CACpC,UAAU,yBAAyB;CACnC,WAAW,yBAAyB;CACpC,OAAO,yBAAyB;CAChC,OAAO,yBAAyB;CAChC,KAAK,yBAAyB;CAC9B,OAAO,yBAAyB;CAChC,mBAAmB,yBAAyB;CAC5C,QAAQ,yBAAyB;CACjC,QAAQ,yBAAyB;CACjC,aAAa,yBAAyB;AACxC,CAAC;AAEH,SAAgB,gBAAgB,MAAiC;CAC/D,OAAO,oBAAoB,SAAS;AACtC"}
@@ -0,0 +1,158 @@
1
+ //#region src/annotation/subtype.ts
2
+ /**
3
+ * Closed-world string catalog of annotation subtypes the wire format knows
4
+ * about. The TypeScript discriminated union `Annotation` is keyed on this
5
+ * literal type. PDFium's integer subtype code is mapped onto these strings
6
+ * by the reader registry.
7
+ *
8
+ * `unsupported` is the forward-compat fallback for any PDF subtype the
9
+ * engine has no reader for. Unknown subtypes never
10
+ * silently disappear from the wire — they round-trip as
11
+ * `{ subtype: 'unsupported', rawSubtypeCode }`.
12
+ */
13
+ const ANNOTATION_SUBTYPES = [
14
+ "text",
15
+ "link",
16
+ "free-text",
17
+ "line",
18
+ "square",
19
+ "circle",
20
+ "polygon",
21
+ "polyline",
22
+ "highlight",
23
+ "underline",
24
+ "squiggly",
25
+ "strikeout",
26
+ "stamp",
27
+ "caret",
28
+ "ink",
29
+ "popup",
30
+ "file-attachment",
31
+ "redact",
32
+ "widget",
33
+ "unsupported"
34
+ ];
35
+ /**
36
+ * PDFium subtype codes from `FPDFAnnot_GetSubtype`. Mirrors
37
+ * `FPDF_ANNOTATION_SUBTYPE` in `public/fpdf_annot.h`. We keep this here
38
+ * (rather than importing from @embedpdf/engine-runtime) so the engine-core
39
+ * package has zero PDFium dependency.
40
+ */
41
+ const PdfAnnotationSubtypeCode = {
42
+ UNKNOWN: 0,
43
+ TEXT: 1,
44
+ LINK: 2,
45
+ FREETEXT: 3,
46
+ LINE: 4,
47
+ SQUARE: 5,
48
+ CIRCLE: 6,
49
+ POLYGON: 7,
50
+ POLYLINE: 8,
51
+ HIGHLIGHT: 9,
52
+ UNDERLINE: 10,
53
+ SQUIGGLY: 11,
54
+ STRIKEOUT: 12,
55
+ STAMP: 13,
56
+ CARET: 14,
57
+ INK: 15,
58
+ POPUP: 16,
59
+ FILEATTACHMENT: 17,
60
+ SOUND: 18,
61
+ MOVIE: 19,
62
+ WIDGET: 20,
63
+ SCREEN: 21,
64
+ PRINTERMARK: 22,
65
+ TRAPNET: 23,
66
+ WATERMARK: 24,
67
+ THREED: 25,
68
+ RICHMEDIA: 26,
69
+ XFAWIDGET: 27,
70
+ REDACT: 28
71
+ };
72
+ /**
73
+ * Map from PDFium codes to wire-stable string subtypes. A code missing here
74
+ * reads as 'unsupported'.
75
+ */
76
+ const PDF_CODE_TO_SUBTYPE = Object.freeze({
77
+ [PdfAnnotationSubtypeCode.TEXT]: "text",
78
+ [PdfAnnotationSubtypeCode.LINK]: "link",
79
+ [PdfAnnotationSubtypeCode.FREETEXT]: "free-text",
80
+ [PdfAnnotationSubtypeCode.LINE]: "line",
81
+ [PdfAnnotationSubtypeCode.SQUARE]: "square",
82
+ [PdfAnnotationSubtypeCode.CIRCLE]: "circle",
83
+ [PdfAnnotationSubtypeCode.POLYGON]: "polygon",
84
+ [PdfAnnotationSubtypeCode.POLYLINE]: "polyline",
85
+ [PdfAnnotationSubtypeCode.HIGHLIGHT]: "highlight",
86
+ [PdfAnnotationSubtypeCode.UNDERLINE]: "underline",
87
+ [PdfAnnotationSubtypeCode.SQUIGGLY]: "squiggly",
88
+ [PdfAnnotationSubtypeCode.STRIKEOUT]: "strikeout",
89
+ [PdfAnnotationSubtypeCode.STAMP]: "stamp",
90
+ [PdfAnnotationSubtypeCode.CARET]: "caret",
91
+ [PdfAnnotationSubtypeCode.INK]: "ink",
92
+ [PdfAnnotationSubtypeCode.POPUP]: "popup",
93
+ [PdfAnnotationSubtypeCode.FILEATTACHMENT]: "file-attachment",
94
+ [PdfAnnotationSubtypeCode.WIDGET]: "widget",
95
+ [PdfAnnotationSubtypeCode.REDACT]: "redact"
96
+ });
97
+ /**
98
+ * Reverse map for write paths that need to turn a wire subtype back into the
99
+ * PDFium integer code without importing the zod-backed annotation registry.
100
+ */
101
+ const PDF_SUBTYPE_TO_CODE = Object.freeze({
102
+ text: PdfAnnotationSubtypeCode.TEXT,
103
+ link: PdfAnnotationSubtypeCode.LINK,
104
+ "free-text": PdfAnnotationSubtypeCode.FREETEXT,
105
+ line: PdfAnnotationSubtypeCode.LINE,
106
+ square: PdfAnnotationSubtypeCode.SQUARE,
107
+ circle: PdfAnnotationSubtypeCode.CIRCLE,
108
+ polygon: PdfAnnotationSubtypeCode.POLYGON,
109
+ polyline: PdfAnnotationSubtypeCode.POLYLINE,
110
+ highlight: PdfAnnotationSubtypeCode.HIGHLIGHT,
111
+ underline: PdfAnnotationSubtypeCode.UNDERLINE,
112
+ squiggly: PdfAnnotationSubtypeCode.SQUIGGLY,
113
+ strikeout: PdfAnnotationSubtypeCode.STRIKEOUT,
114
+ stamp: PdfAnnotationSubtypeCode.STAMP,
115
+ caret: PdfAnnotationSubtypeCode.CARET,
116
+ ink: PdfAnnotationSubtypeCode.INK,
117
+ popup: PdfAnnotationSubtypeCode.POPUP,
118
+ "file-attachment": PdfAnnotationSubtypeCode.FILEATTACHMENT,
119
+ redact: PdfAnnotationSubtypeCode.REDACT,
120
+ widget: PdfAnnotationSubtypeCode.WIDGET,
121
+ unsupported: PdfAnnotationSubtypeCode.UNKNOWN
122
+ });
123
+ function subtypeFromCode(code) {
124
+ return PDF_CODE_TO_SUBTYPE[code] ?? "unsupported";
125
+ }
126
+ //#endregion
127
+ Object.defineProperty(exports, "ANNOTATION_SUBTYPES", {
128
+ enumerable: true,
129
+ get: function() {
130
+ return ANNOTATION_SUBTYPES;
131
+ }
132
+ });
133
+ Object.defineProperty(exports, "PDF_CODE_TO_SUBTYPE", {
134
+ enumerable: true,
135
+ get: function() {
136
+ return PDF_CODE_TO_SUBTYPE;
137
+ }
138
+ });
139
+ Object.defineProperty(exports, "PDF_SUBTYPE_TO_CODE", {
140
+ enumerable: true,
141
+ get: function() {
142
+ return PDF_SUBTYPE_TO_CODE;
143
+ }
144
+ });
145
+ Object.defineProperty(exports, "PdfAnnotationSubtypeCode", {
146
+ enumerable: true,
147
+ get: function() {
148
+ return PdfAnnotationSubtypeCode;
149
+ }
150
+ });
151
+ Object.defineProperty(exports, "subtypeFromCode", {
152
+ enumerable: true,
153
+ get: function() {
154
+ return subtypeFromCode;
155
+ }
156
+ });
157
+
158
+ //# sourceMappingURL=subtype-aDt5TFmK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subtype-aDt5TFmK.cjs","names":[],"sources":["../src/annotation/subtype.ts"],"sourcesContent":["/**\n * Closed-world string catalog of annotation subtypes the wire format knows\n * about. The TypeScript discriminated union `Annotation` is keyed on this\n * literal type. PDFium's integer subtype code is mapped onto these strings\n * by the reader registry.\n *\n * `unsupported` is the forward-compat fallback for any PDF subtype the\n * engine has no reader for. Unknown subtypes never\n * silently disappear from the wire — they round-trip as\n * `{ subtype: 'unsupported', rawSubtypeCode }`.\n */\nexport const ANNOTATION_SUBTYPES = [\n 'text',\n 'link',\n 'free-text',\n 'line',\n 'square',\n 'circle',\n 'polygon',\n 'polyline',\n 'highlight',\n 'underline',\n 'squiggly',\n 'strikeout',\n 'stamp',\n 'caret',\n 'ink',\n 'popup',\n 'file-attachment',\n 'redact',\n 'widget',\n 'unsupported',\n] as const;\n\nexport type AnnotationSubtype = (typeof ANNOTATION_SUBTYPES)[number];\n\n/**\n * PDFium subtype codes from `FPDFAnnot_GetSubtype`. Mirrors\n * `FPDF_ANNOTATION_SUBTYPE` in `public/fpdf_annot.h`. We keep this here\n * (rather than importing from @embedpdf/engine-runtime) so the engine-core\n * package has zero PDFium dependency.\n */\nexport const PdfAnnotationSubtypeCode = {\n UNKNOWN: 0,\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n RICHMEDIA: 26,\n XFAWIDGET: 27,\n REDACT: 28,\n} as const;\n\nexport type PdfAnnotationSubtypeCode =\n (typeof PdfAnnotationSubtypeCode)[keyof typeof PdfAnnotationSubtypeCode];\n\n/**\n * Map from PDFium codes to wire-stable string subtypes. A code missing here\n * reads as 'unsupported'.\n */\nexport const PDF_CODE_TO_SUBTYPE: Readonly<Record<number, AnnotationSubtype>> = Object.freeze({\n [PdfAnnotationSubtypeCode.TEXT]: 'text',\n [PdfAnnotationSubtypeCode.LINK]: 'link',\n [PdfAnnotationSubtypeCode.FREETEXT]: 'free-text',\n [PdfAnnotationSubtypeCode.LINE]: 'line',\n [PdfAnnotationSubtypeCode.SQUARE]: 'square',\n [PdfAnnotationSubtypeCode.CIRCLE]: 'circle',\n [PdfAnnotationSubtypeCode.POLYGON]: 'polygon',\n [PdfAnnotationSubtypeCode.POLYLINE]: 'polyline',\n [PdfAnnotationSubtypeCode.HIGHLIGHT]: 'highlight',\n [PdfAnnotationSubtypeCode.UNDERLINE]: 'underline',\n [PdfAnnotationSubtypeCode.SQUIGGLY]: 'squiggly',\n [PdfAnnotationSubtypeCode.STRIKEOUT]: 'strikeout',\n [PdfAnnotationSubtypeCode.STAMP]: 'stamp',\n [PdfAnnotationSubtypeCode.CARET]: 'caret',\n [PdfAnnotationSubtypeCode.INK]: 'ink',\n [PdfAnnotationSubtypeCode.POPUP]: 'popup',\n [PdfAnnotationSubtypeCode.FILEATTACHMENT]: 'file-attachment',\n [PdfAnnotationSubtypeCode.WIDGET]: 'widget',\n [PdfAnnotationSubtypeCode.REDACT]: 'redact',\n});\n\n/**\n * Reverse map for write paths that need to turn a wire subtype back into the\n * PDFium integer code without importing the zod-backed annotation registry.\n */\nexport const PDF_SUBTYPE_TO_CODE: Readonly<Record<AnnotationSubtype, PdfAnnotationSubtypeCode>> =\n Object.freeze({\n text: PdfAnnotationSubtypeCode.TEXT,\n link: PdfAnnotationSubtypeCode.LINK,\n 'free-text': PdfAnnotationSubtypeCode.FREETEXT,\n line: PdfAnnotationSubtypeCode.LINE,\n square: PdfAnnotationSubtypeCode.SQUARE,\n circle: PdfAnnotationSubtypeCode.CIRCLE,\n polygon: PdfAnnotationSubtypeCode.POLYGON,\n polyline: PdfAnnotationSubtypeCode.POLYLINE,\n highlight: PdfAnnotationSubtypeCode.HIGHLIGHT,\n underline: PdfAnnotationSubtypeCode.UNDERLINE,\n squiggly: PdfAnnotationSubtypeCode.SQUIGGLY,\n strikeout: PdfAnnotationSubtypeCode.STRIKEOUT,\n stamp: PdfAnnotationSubtypeCode.STAMP,\n caret: PdfAnnotationSubtypeCode.CARET,\n ink: PdfAnnotationSubtypeCode.INK,\n popup: PdfAnnotationSubtypeCode.POPUP,\n 'file-attachment': PdfAnnotationSubtypeCode.FILEATTACHMENT,\n redact: PdfAnnotationSubtypeCode.REDACT,\n widget: PdfAnnotationSubtypeCode.WIDGET,\n unsupported: PdfAnnotationSubtypeCode.UNKNOWN,\n });\n\nexport function subtypeFromCode(code: number): AnnotationSubtype {\n return PDF_CODE_TO_SUBTYPE[code] ?? 'unsupported';\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;AAUA,MAAa,2BAA2B;CACtC,SAAS;CACT,MAAM;CACN,MAAM;CACN,UAAU;CACV,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,WAAW;CACX,WAAW;CACX,UAAU;CACV,WAAW;CACX,OAAO;CACP,OAAO;CACP,KAAK;CACL,OAAO;CACP,gBAAgB;CAChB,OAAO;CACP,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,SAAS;CACT,WAAW;CACX,QAAQ;CACR,WAAW;CACX,WAAW;CACX,QAAQ;AACV;;;;;AASA,MAAa,sBAAmE,OAAO,OAAO;EAC3F,yBAAyB,OAAO;EAChC,yBAAyB,OAAO;EAChC,yBAAyB,WAAW;EACpC,yBAAyB,OAAO;EAChC,yBAAyB,SAAS;EAClC,yBAAyB,SAAS;EAClC,yBAAyB,UAAU;EACnC,yBAAyB,WAAW;EACpC,yBAAyB,YAAY;EACrC,yBAAyB,YAAY;EACrC,yBAAyB,WAAW;EACpC,yBAAyB,YAAY;EACrC,yBAAyB,QAAQ;EACjC,yBAAyB,QAAQ;EACjC,yBAAyB,MAAM;EAC/B,yBAAyB,QAAQ;EACjC,yBAAyB,iBAAiB;EAC1C,yBAAyB,SAAS;EAClC,yBAAyB,SAAS;AACrC,CAAC;;;;;AAMD,MAAa,sBACX,OAAO,OAAO;CACZ,MAAM,yBAAyB;CAC/B,MAAM,yBAAyB;CAC/B,aAAa,yBAAyB;CACtC,MAAM,yBAAyB;CAC/B,QAAQ,yBAAyB;CACjC,QAAQ,yBAAyB;CACjC,SAAS,yBAAyB;CAClC,UAAU,yBAAyB;CACn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