@embedpdf/plugin-annotation 2.3.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -13
- package/dist/index.js.map +1 -1
- package/dist/lib/actions.d.ts +2 -1
- package/dist/lib/annotation-plugin.d.ts +1 -0
- package/dist/lib/helpers.d.ts +2 -1
- package/dist/lib/tools/types.d.ts +22 -10
- package/dist/lib/types.d.ts +13 -0
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +326 -50
- package/dist/preact/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +325 -49
- package/dist/react/index.js.map +1 -1
- package/dist/shared/components/annotation-container.d.ts +6 -2
- package/dist/shared/components/annotation-layer.d.ts +4 -2
- package/dist/shared/components/annotations.d.ts +3 -1
- package/dist/shared/components/types.d.ts +43 -1
- package/dist/shared/context/index.d.ts +1 -0
- package/dist/shared/context/renderer-registry.d.ts +21 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared-preact/components/annotation-container.d.ts +6 -2
- package/dist/shared-preact/components/annotation-layer.d.ts +4 -2
- package/dist/shared-preact/components/annotations.d.ts +3 -1
- package/dist/shared-preact/components/types.d.ts +43 -1
- package/dist/shared-preact/context/index.d.ts +1 -0
- package/dist/shared-preact/context/renderer-registry.d.ts +21 -0
- package/dist/shared-preact/index.d.ts +2 -0
- package/dist/shared-react/components/annotation-container.d.ts +6 -2
- package/dist/shared-react/components/annotation-layer.d.ts +4 -2
- package/dist/shared-react/components/annotations.d.ts +3 -1
- package/dist/shared-react/components/types.d.ts +43 -1
- package/dist/shared-react/context/index.d.ts +1 -0
- package/dist/shared-react/context/renderer-registry.d.ts +21 -0
- package/dist/shared-react/index.d.ts +2 -0
- package/dist/svelte/components/AnnotationLayer.svelte.d.ts +3 -0
- package/dist/svelte/components/Annotations.svelte.d.ts +3 -0
- package/dist/svelte/components/RendererRegistryProvider.svelte.d.ts +7 -0
- package/dist/svelte/components/index.d.ts +1 -0
- package/dist/svelte/context/index.d.ts +2 -0
- package/dist/svelte/context/renderer-registry.svelte.d.ts +20 -0
- package/dist/svelte/context/types.d.ts +33 -0
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.js +412 -241
- package/dist/svelte/index.js.map +1 -1
- package/dist/vue/components/annotation-container.vue.d.ts +1 -1
- package/dist/vue/components/annotation-layer.vue.d.ts +3 -0
- package/dist/vue/components/annotations/free-text.vue.d.ts +1 -1
- package/dist/vue/components/annotations/stamp.vue.d.ts +1 -1
- package/dist/vue/components/annotations.vue.d.ts +94 -60
- package/dist/vue/components/group-selection-box.vue.d.ts +1 -1
- package/dist/vue/components/index.d.ts +1 -0
- package/dist/vue/components/preview-renderer.vue.d.ts +1 -1
- package/dist/vue/components/renderer-registry-provider.vue.d.ts +13 -0
- package/dist/vue/context/index.d.ts +2 -0
- package/dist/vue/context/renderer-registry.d.ts +26 -0
- package/dist/vue/context/types.d.ts +33 -0
- package/dist/vue/hooks/use-annotation.d.ts +5 -5
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.ts +3 -1
- package/dist/vue/index.js +245 -120
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/types.d.ts +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/svelte/hooks/use-annotation.svelte.ts","../../src/svelte/components/AnnotationContainer.svelte","../../src/svelte/components/text-markup/Highlight.svelte","../../src/svelte/components/text-markup/Underline.svelte","../../src/svelte/components/text-markup/Strikeout.svelte","../../src/svelte/components/text-markup/Squiggly.svelte","../../src/svelte/components/annotations/Ink.svelte","../../src/svelte/components/annotations/Square.svelte","../../src/svelte/components/annotations/Circle.svelte","../../src/svelte/components/annotations/Line.svelte","../../src/svelte/components/annotations/Polyline.svelte","../../src/svelte/components/annotations/Polygon.svelte","../../src/svelte/components/annotations/FreeText.svelte","../../src/svelte/components/RenderAnnotation.svelte","../../src/svelte/components/annotations/Stamp.svelte","../../src/svelte/components/annotations/Link.svelte","../../src/svelte/components/GroupSelectionBox.svelte","../../src/svelte/components/Annotations.svelte","../../src/svelte/components/TextMarkup.svelte","../../src/svelte/components/PreviewRenderer.svelte","../../src/svelte/components/AnnotationPaintLayer.svelte","../../src/svelte/components/AnnotationLayer.svelte"],"sourcesContent":["import {\n AnnotationPlugin,\n AnnotationDocumentState,\n initialDocumentState,\n AnnotationScope,\n} from '@embedpdf/plugin-annotation';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useAnnotationCapability = () => useCapability<AnnotationPlugin>(AnnotationPlugin.id);\nexport const useAnnotationPlugin = () => usePlugin<AnnotationPlugin>(AnnotationPlugin.id);\n\n// Define the return type explicitly to maintain type safety\ninterface UseAnnotationReturn {\n provides: AnnotationScope | null;\n state: AnnotationDocumentState;\n}\n\n/**\n * Hook for annotation state for a specific document\n * @param getDocumentId Document ID getter function\n */\nexport const useAnnotation = (getDocumentId: () => string | null): UseAnnotationReturn => {\n const capability = useAnnotationCapability();\n\n let state = $state<AnnotationDocumentState>(initialDocumentState());\n\n // Reactive documentId\n const documentId = $derived(getDocumentId());\n\n // Scoped capability for current docId\n const scopedProvides = $derived(\n capability.provides && documentId ? capability.provides.forDocument(documentId) : null,\n );\n\n $effect(() => {\n const provides = capability.provides;\n const docId = documentId;\n\n if (!provides || !docId) {\n state = initialDocumentState();\n return;\n }\n\n const scope = provides.forDocument(docId);\n\n // Get initial state\n state = scope.getState();\n\n // Subscribe to state changes for THIS docId\n return scope.onStateChange((newState) => {\n state = newState;\n });\n });\n\n return {\n get provides() {\n return scopedProvides;\n },\n get state() {\n return state;\n },\n };\n};\n","<script lang=\"ts\" generics=\"T extends PdfAnnotationObject\">\n import type { PdfAnnotationObject, Rect } from '@embedpdf/models';\n import { useDocumentPermissions } from '@embedpdf/core/svelte';\n import { useAnnotationCapability, useAnnotationPlugin } from '../hooks';\n import type { AnnotationContainerProps } from './types';\n import {\n useInteractionHandles,\n doublePress,\n CounterRotate,\n deepToRaw,\n type SelectionMenuPlacement,\n type MenuWrapperProps,\n } from '@embedpdf/utils/svelte';\n import type { Snippet } from 'svelte';\n import { untrack } from 'svelte';\n import { type AnnotationSelectionContext, type AnnotationSelectionMenuProps } from '../types';\n\n let {\n documentId,\n scale,\n pageIndex,\n rotation,\n pageWidth,\n pageHeight,\n trackedAnnotation,\n children,\n isSelected,\n isMultiSelected = false,\n isDraggable,\n isResizable,\n lockAspectRatio = false,\n style,\n class: propsClass = '',\n vertexConfig,\n selectionMenu,\n selectionMenuSnippet,\n outlineOffset = 1,\n onDoubleClick,\n onSelect,\n zIndex = 20,\n resizeUI,\n vertexUI,\n selectionOutlineColor = '#007ACC',\n customAnnotationRenderer,\n ...restProps\n }: AnnotationContainerProps<T> = $props();\n\n let preview = $state<T>(trackedAnnotation.object);\n let annotationCapability = useAnnotationCapability();\n const annotationPlugin = useAnnotationPlugin();\n const permissions = useDocumentPermissions(() => documentId);\n let gestureBaseRef = $state<T | null>(null);\n let gestureBaseRectRef = $state<Rect | null>(null);\n\n // When multi-selected, disable individual drag/resize - GroupSelectionBox handles it\n const effectiveIsDraggable = $derived(\n permissions.canModifyAnnotations && isDraggable && !isMultiSelected,\n );\n const effectiveIsResizable = $derived(\n permissions.canModifyAnnotations && isResizable && !isMultiSelected,\n );\n\n // Wrap onDoubleClick to respect permissions\n const guardedOnDoubleClick = $derived(\n permissions.canModifyAnnotations && onDoubleClick ? onDoubleClick : undefined,\n );\n\n // Get scoped API for this document\n const annotationProvides = $derived(\n annotationCapability.provides ? annotationCapability.provides.forDocument(documentId) : null,\n );\n\n let currentObject = $derived<T>(\n preview ? { ...trackedAnnotation.object, ...preview } : trackedAnnotation.object,\n );\n\n // UI constants\n const HANDLE_COLOR = $derived(resizeUI?.color ?? '#007ACC');\n const VERTEX_COLOR = $derived(vertexUI?.color ?? '#007ACC');\n const HANDLE_SIZE = $derived(resizeUI?.size ?? 12);\n const VERTEX_SIZE = $derived(vertexUI?.size ?? 12);\n\n // Determine if we should show the outline\n // When multi-selected, don't show individual outlines - GroupSelectionBox shows the group outline\n const showOutline = $derived(isSelected && !isMultiSelected);\n\n // Sync preview with tracked annotation when it changes\n $effect(() => {\n if (trackedAnnotation.object) {\n preview = trackedAnnotation.object;\n }\n });\n\n // Subscribe to unified drag/resize changes - plugin sends pre-computed patches!\n // ALL preview updates come through here (primary, attached links, multi-select)\n $effect(() => {\n const plugin = annotationPlugin.plugin;\n if (!plugin) return;\n\n const id = trackedAnnotation.object.id;\n\n const handleEvent = (event: {\n documentId: string;\n type: string;\n previewPatches?: Record<string, any>;\n }) => {\n if (event.documentId !== documentId) return;\n const patch = event.previewPatches?.[id];\n if (event.type === 'update' && patch) {\n // Use untrack to prevent tracking the read of preview (like Vue's toRaw)\n preview = { ...untrack(() => preview), ...patch } as T;\n } else if (event.type === 'cancel') {\n preview = trackedAnnotation.object;\n }\n };\n\n const unsubs = [plugin.onDragChange(handleEvent), plugin.onResizeChange(handleEvent)];\n\n return () => unsubs.forEach((u) => u());\n });\n\n const interactionHandles = useInteractionHandles(() => ({\n controller: {\n element: currentObject.rect,\n vertices: vertexConfig?.extractVertices(currentObject),\n constraints: {\n minWidth: 10,\n minHeight: 10,\n boundingBox: { width: pageWidth, height: pageHeight },\n },\n maintainAspectRatio: lockAspectRatio,\n pageRotation: rotation,\n scale: scale,\n // Disable interaction handles when multi-selected\n enabled: isSelected && !isMultiSelected,\n onUpdate: (event) => {\n if (!event.transformData?.type || isMultiSelected) return;\n\n const plugin = annotationPlugin.plugin;\n if (!plugin) return;\n\n const { type, changes, metadata } = event.transformData;\n const id = trackedAnnotation.object.id;\n const pageSize = { width: pageWidth, height: pageHeight };\n\n // Gesture start - initialize plugin drag/resize\n if (event.state === 'start') {\n gestureBaseRectRef = trackedAnnotation.object.rect;\n gestureBaseRef = trackedAnnotation.object; // For vertex edit\n\n if (type === 'move') {\n plugin.startDrag(documentId, { annotationIds: [id], pageSize });\n } else if (type === 'resize') {\n plugin.startResize(documentId, {\n annotationIds: [id],\n pageSize,\n resizeHandle: metadata?.handle ?? 'se',\n });\n }\n }\n\n // Gesture update - call plugin, preview comes from subscription\n if (changes.rect && gestureBaseRectRef) {\n if (type === 'move') {\n const delta = {\n x: changes.rect.origin.x - gestureBaseRectRef.origin.x,\n y: changes.rect.origin.y - gestureBaseRectRef.origin.y,\n };\n plugin.updateDrag(documentId, delta);\n } else if (type === 'resize') {\n plugin.updateResize(documentId, changes.rect);\n }\n }\n\n // Vertex edit - handle directly (no attached link handling needed)\n if (type === 'vertex-edit' && changes.vertices && vertexConfig) {\n const base = gestureBaseRef ?? trackedAnnotation.object;\n const vertexChanges = vertexConfig.transformAnnotation(base, changes.vertices);\n const patched = annotationCapability.provides?.transformAnnotation<T>(base, {\n type,\n changes: vertexChanges as Partial<T>,\n metadata,\n });\n if (patched) {\n preview = { ...preview, ...patched };\n if (event.state === 'end') {\n const sanitized = deepToRaw(patched);\n annotationProvides?.updateAnnotation(pageIndex, id, sanitized);\n }\n }\n }\n\n // Gesture end - commit\n if (event.state === 'end') {\n gestureBaseRectRef = null;\n gestureBaseRef = null;\n if (type === 'move') plugin.commitDrag(documentId);\n else if (type === 'resize') plugin.commitResize(documentId);\n }\n },\n },\n resizeUI: {\n handleSize: HANDLE_SIZE,\n spacing: outlineOffset,\n offsetMode: 'outside',\n includeSides: lockAspectRatio ? false : true,\n zIndex: zIndex + 1,\n },\n vertexUI: {\n vertexSize: VERTEX_SIZE,\n zIndex: zIndex + 2,\n },\n includeVertices: vertexConfig ? true : false,\n }));\n\n // Derived accessors for template\n const resizeHandles = $derived(interactionHandles.resize);\n const vertexHandles = $derived(interactionHandles.vertices);\n\n // --- Selection Menu Logic ---\n\n // Check if we should show menu - hide when multi-selected\n const shouldShowMenu = $derived(\n isSelected && !isMultiSelected && (!!selectionMenu || !!selectionMenuSnippet),\n );\n\n // Build context object for selection menu\n function buildContext(): AnnotationSelectionContext {\n return {\n type: 'annotation',\n annotation: trackedAnnotation,\n pageIndex,\n };\n }\n\n // Placement hints\n const menuPlacement: SelectionMenuPlacement = {\n suggestTop: false,\n spaceAbove: 0,\n spaceBelow: 0,\n };\n\n // Build menu props\n function buildMenuProps(\n rect: Rect,\n menuWrapperProps: MenuWrapperProps,\n ): AnnotationSelectionMenuProps {\n return {\n context: buildContext(),\n selected: isSelected,\n rect,\n placement: menuPlacement,\n menuWrapperProps,\n };\n }\n</script>\n\n<div data-no-interaction>\n <div\n {...effectiveIsDraggable && isSelected ? interactionHandles.dragProps : {}}\n use:doublePress={{ onDouble: guardedOnDoubleClick }}\n style:position=\"absolute\"\n style:left=\"{currentObject.rect.origin.x * scale}px\"\n style:top=\"{currentObject.rect.origin.y * scale}px\"\n style:width=\"{currentObject.rect.size.width * scale}px\"\n style:height=\"{currentObject.rect.size.height * scale}px\"\n style:outline={showOutline ? `1px solid ${selectionOutlineColor}` : 'none'}\n style:outline-offset={showOutline ? `${outlineOffset}px` : '0px'}\n style:pointer-events={isSelected && !isMultiSelected ? 'auto' : 'none'}\n style:touch-action=\"none\"\n style:cursor={isSelected && effectiveIsDraggable ? 'move' : 'default'}\n style:z-index={zIndex}\n style={style || ''}\n class={propsClass}\n {...restProps}\n >\n {#if customAnnotationRenderer}\n {@render customAnnotationRenderer?.({\n annotation: currentObject,\n children: children as Snippet,\n isSelected,\n scale,\n rotation,\n pageWidth,\n pageHeight,\n pageIndex,\n onSelect,\n })}\n {:else}\n {@render children(currentObject)}\n {/if}\n\n <!-- Resize handles - only when single-selected -->\n {#if isSelected && effectiveIsResizable}\n {#each resizeHandles as { key, style: handleStyle, ...hProps } (key)}\n {#if resizeUI?.component}\n {@const Component = resizeUI.component}\n <Component {...hProps} backgroundColor={HANDLE_COLOR} />\n {:else}\n <div {...hProps} style=\"{handleStyle}; background-color: {HANDLE_COLOR};\"></div>\n {/if}\n {/each}\n {/if}\n\n <!-- Vertex handles - only when single-selected -->\n {#if isSelected && permissions.canModifyAnnotations && !isMultiSelected}\n {#each vertexHandles as { key, style: vertexStyle, ...vProps } (key)}\n {#if vertexUI?.component}\n {@const Component = vertexUI.component}\n <Component {...vProps} backgroundColor={VERTEX_COLOR} />\n {:else}\n <div {...vProps} style=\"{vertexStyle}; background-color: {VERTEX_COLOR};\"></div>\n {/if}\n {/each}\n {/if}\n </div>\n\n <!-- Selection Menu: Supports BOTH render function and snippet - hide when multi-selected -->\n {#if shouldShowMenu}\n <CounterRotate\n rect={{\n origin: {\n x: currentObject.rect.origin.x * scale,\n y: currentObject.rect.origin.y * scale,\n },\n size: {\n width: currentObject.rect.size.width * scale,\n height: currentObject.rect.size.height * scale,\n },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(rect, menuWrapperProps)}\n {#if selectionMenu}\n <!-- Priority 1: Render function (schema-driven) -->\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n <!-- Priority 2: Snippet (manual customization) -->\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n</div>\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface HighlightProps {\n /** Stroke/markup color */\n strokeColor?: string;\n opacity?: number;\n segmentRects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n strokeColor,\n opacity = 0.5,\n segmentRects,\n rect,\n scale,\n onClick,\n style,\n }: HighlightProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#FFFF00');\n</script>\n\n{#each segmentRects as b, i (i)}\n <div\n role=\"button\"\n tabindex={onClick ? 0 : -1}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{(rect ? b.origin.x - rect.origin.x : b.origin.x) * scale}px\"\n style:top=\"{(rect ? b.origin.y - rect.origin.y : b.origin.y) * scale}px\"\n style:width=\"{b.size.width * scale}px\"\n style:height=\"{b.size.height * scale}px\"\n style:background={resolvedColor}\n style:opacity\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? 1 : undefined}\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n ></div>\n{/each}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface UnderlineProps {\n /** Stroke/markup color */\n strokeColor?: string;\n opacity?: number;\n segmentRects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n strokeColor,\n opacity = 0.5,\n segmentRects,\n rect,\n scale,\n onClick,\n style,\n }: UnderlineProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#FFFF00');\n const thickness = $derived(2 * scale); // 2 CSS px at 100% zoom\n</script>\n\n{#each segmentRects as r, i (i)}\n <div\n role=\"button\"\n tabindex={onClick ? 0 : -1}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{(rect ? r.origin.x - rect.origin.x : r.origin.x) * scale}px\"\n style:top=\"{(rect ? r.origin.y - rect.origin.y : r.origin.y) * scale}px\"\n style:width=\"{r.size.width * scale}px\"\n style:height=\"{r.size.height * scale}px\"\n style:background=\"transparent\"\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? 1 : 0}\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n >\n <!-- Visual underline -->\n <div\n style:position=\"absolute\"\n style:left=\"0\"\n style:bottom=\"0\"\n style:width=\"100%\"\n style:height=\"{thickness}px\"\n style:background={resolvedColor}\n style:opacity\n style:pointer-events=\"none\"\n ></div>\n </div>\n{/each}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface StrikeoutProps {\n /** Stroke/markup color */\n strokeColor?: string;\n opacity?: number;\n segmentRects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n strokeColor,\n opacity = 0.5,\n segmentRects,\n rect,\n scale,\n onClick,\n style,\n }: StrikeoutProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#FFFF00');\n const thickness = $derived(2 * scale);\n</script>\n\n{#each segmentRects as r, i (i)}\n <div\n role=\"button\"\n tabindex={onClick ? 0 : -1}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{(rect ? r.origin.x - rect.origin.x : r.origin.x) * scale}px\"\n style:top=\"{(rect ? r.origin.y - rect.origin.y : r.origin.y) * scale}px\"\n style:width=\"{r.size.width * scale}px\"\n style:height=\"{r.size.height * scale}px\"\n style:background=\"transparent\"\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? 1 : 0}\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n >\n <!-- Visual strikeout line -->\n <div\n style:position=\"absolute\"\n style:left=\"0\"\n style:top=\"50%\"\n style:width=\"100%\"\n style:height=\"{thickness}px\"\n style:background={resolvedColor}\n style:opacity\n style:transform=\"translateY(-50%)\"\n style:pointer-events=\"none\"\n ></div>\n </div>\n{/each}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface SquigglyProps {\n /** Stroke/markup color */\n strokeColor?: string;\n opacity?: number;\n segmentRects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n strokeColor,\n opacity = 0.5,\n segmentRects,\n rect,\n scale,\n onClick,\n style,\n }: SquigglyProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#FFFF00');\n const amplitude = $derived(2 * scale); // wave height\n const period = $derived(6 * scale); // wave length\n\n const svg =\n $derived(`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${period}\" height=\"${amplitude * 2}\" viewBox=\"0 0 ${period} ${amplitude * 2}\">\n <path d=\"M0 ${amplitude} Q ${period / 4} 0 ${period / 2} ${amplitude} T ${period} ${amplitude}\"\n fill=\"none\" stroke=\"${resolvedColor}\" stroke-width=\"${amplitude}\" stroke-linecap=\"round\"/>\n </svg>`);\n\n // Completely escape the SVG markup\n const svgDataUri = $derived(`url(\"data:image/svg+xml;utf8,${encodeURIComponent(svg)}\")`);\n</script>\n\n{#each segmentRects as r, i (i)}\n <div\n role=\"button\"\n tabindex={onClick ? 0 : -1}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{(rect ? r.origin.x - rect.origin.x : r.origin.x) * scale}px\"\n style:top=\"{(rect ? r.origin.y - rect.origin.y : r.origin.y) * scale}px\"\n style:width=\"{r.size.width * scale}px\"\n style:height=\"{r.size.height * scale}px\"\n style:background=\"transparent\"\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? 1 : 0}\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n >\n <!-- Visual squiggly line -->\n <div\n style:position=\"absolute\"\n style:left=\"0\"\n style:bottom=\"0\"\n style:width=\"100%\"\n style:height=\"{amplitude * 2}px\"\n style:background-image={svgDataUri}\n style:background-repeat=\"repeat-x\"\n style:background-size=\"{period}px {amplitude * 2}px\"\n style:opacity\n style:pointer-events=\"none\"\n ></div>\n </div>\n{/each}\n","<script lang=\"ts\">\n import type { PdfInkListObject, Rect } from '@embedpdf/models';\n\n interface InkProps {\n isSelected: boolean;\n /** Stroke color */\n strokeColor?: string;\n opacity?: number;\n strokeWidth: number;\n inkList: PdfInkListObject[];\n rect: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n }\n\n let {\n isSelected,\n strokeColor,\n opacity = 1,\n strokeWidth,\n inkList,\n rect,\n scale,\n onClick,\n }: InkProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#000000');\n\n // derived SVG path data\n const paths = $derived.by(() =>\n inkList.map(({ points }) => {\n let d = '';\n for (let i = 0; i < points.length; i++) {\n const { x, y } = points[i];\n const lx = x - rect.origin.x;\n const ly = y - rect.origin.y;\n d += (i === 0 ? 'M' : 'L') + lx + ' ' + ly + ' ';\n }\n return d.trim();\n }),\n );\n\n const width = $derived(rect.size.width * scale);\n const height = $derived(rect.size.height * scale);\n</script>\n\n<svg\n style=\"position: absolute; z-index: 2; overflow: visible; pointer-events: none;\"\n style:width={`${width}px`}\n style:height={`${height}px`}\n {width}\n {height}\n viewBox={`0 0 ${rect.size.width} ${rect.size.height}`}\n>\n {#each paths as d, i (i)}\n <path\n {d}\n fill=\"none\"\n {opacity}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected ? 'none' : 'visibleStroke'}\n style:stroke={resolvedColor}\n style:stroke-width={strokeWidth}\n style:stroke-linecap=\"round\"\n style:stroke-linejoin=\"round\"\n />\n {/each}\n</svg>\n","<!-- Square.svelte -->\n<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n import { PdfAnnotationBorderStyle } from '@embedpdf/models';\n\n interface SquareProps {\n isSelected: boolean;\n color?: string; // fill color (defaults to black)\n strokeColor?: string; // stroke color (defaults to fill when omitted)\n opacity?: number; // 0–1\n strokeWidth: number; // PDF units\n strokeStyle?: PdfAnnotationBorderStyle;\n strokeDashArray?: number[];\n rect: Rect; // bbox includes stroke\n scale: number; // page zoom\n onClick?: (e: MouseEvent | TouchEvent) => void;\n }\n\n let {\n isSelected,\n color = '#000000',\n strokeColor,\n opacity = 1,\n strokeWidth,\n strokeStyle = PdfAnnotationBorderStyle.SOLID,\n strokeDashArray,\n rect,\n scale,\n onClick,\n }: SquareProps = $props();\n\n // Geometry helpers — compute inner rect so visual fill matches preview\n const { width, height, x, y } = $derived.by(() => {\n const outerW = rect.size.width;\n const outerH = rect.size.height;\n const innerW = Math.max(outerW - strokeWidth, 0);\n const innerH = Math.max(outerH - strokeWidth, 0);\n return {\n width: innerW,\n height: innerH,\n x: strokeWidth / 2,\n y: strokeWidth / 2,\n };\n });\n\n const svgWidth = $derived((width + strokeWidth) * scale);\n const svgHeight = $derived((height + strokeWidth) * scale);\n\n const dash = $derived(\n strokeStyle === PdfAnnotationBorderStyle.DASHED ? strokeDashArray?.join(',') : undefined,\n );\n</script>\n\n<svg\n style=\"position: absolute; pointer-events: none; z-index: 2;\"\n style:width={`${svgWidth}px`}\n style:height={`${svgHeight}px`}\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${width + strokeWidth} ${height + strokeWidth}`}\n>\n <rect\n {x}\n {y}\n {width}\n {height}\n fill={color}\n {opacity}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected\n ? 'none'\n : color === 'transparent'\n ? 'visibleStroke'\n : 'visible'}\n style:stroke={strokeColor ?? color}\n style:stroke-width={strokeWidth}\n style:stroke-dasharray={dash}\n />\n</svg>\n","<script lang=\"ts\">\n import { PdfAnnotationBorderStyle, type Rect } from '@embedpdf/models';\n\n interface CircleProps {\n /** Whether the annotation is selected */\n isSelected: boolean;\n /** Fill colour – defaults to PDFium’s black if omitted */\n color?: string;\n /** Stroke colour – defaults to same as fill when omitted */\n strokeColor?: string;\n /** 0 – 1 */\n opacity?: number;\n /** Stroke width in PDF units */\n strokeWidth: number;\n /** Stroke type – defaults to solid when omitted */\n strokeStyle?: PdfAnnotationBorderStyle;\n /** Stroke dash array – defaults to undefined when omitted */\n strokeDashArray?: number[];\n /** Bounding box of the annotation */\n rect: Rect;\n /** Current page zoom factor */\n scale: number;\n /** Pointer/touch handler (used for selection) */\n onClick?: (e: PointerEvent | TouchEvent) => void;\n }\n\n let {\n isSelected,\n color = '#000000',\n strokeColor,\n opacity = 1,\n strokeWidth,\n strokeStyle = PdfAnnotationBorderStyle.SOLID,\n strokeDashArray,\n rect,\n scale,\n onClick,\n }: CircleProps = $props();\n\n const { width, height, cx, cy, rx, ry } = $derived.by(() => {\n // Full bounding box *includes* stroke width.\n const outerW = rect.size.width;\n const outerH = rect.size.height;\n\n // Remove the stroke so the visible fill matches the preview.\n const innerW = Math.max(outerW - strokeWidth, 0);\n const innerH = Math.max(outerH - strokeWidth, 0);\n\n return {\n width: outerW,\n height: outerH,\n // Centre of the fill sits strokeWidth/2 in from the edges\n cx: strokeWidth / 2 + innerW / 2,\n cy: strokeWidth / 2 + innerH / 2,\n rx: innerW / 2,\n ry: innerH / 2,\n };\n });\n\n let svgWidth = $derived(width * scale);\n let svgHeight = $derived(height * scale);\n\n let peValue = $derived(\n isSelected ? 'none' : color === 'transparent' ? 'visibleStroke' : 'visible',\n );\n</script>\n\n<svg\n style:position=\"absolute\"\n style:width={`${svgWidth}px`}\n style:height={`${svgHeight}px`}\n style:pointer-events=\"none\"\n style:z-index=\"2\"\n {svgWidth}\n {svgHeight}\n viewBox={`0 0 ${width} ${height}`}\n>\n <ellipse\n {cx}\n {cy}\n {rx}\n {ry}\n fill={color}\n {opacity}\n onpointerdown={(e) => onClick?.(e)}\n ontouchstart={(e) => onClick?.(e)}\n style:cursor={isSelected ? 'move' : 'pointer'}\n pointer-events={peValue}\n stroke={strokeColor ?? color}\n stroke-width={strokeWidth}\n stroke-dasharray={strokeStyle === PdfAnnotationBorderStyle.DASHED\n ? strokeDashArray?.join(',')\n : undefined}\n />\n</svg>\n","<!-- Line.svelte -->\n<script lang=\"ts\">\n import type { Rect, LinePoints, LineEndings } from '@embedpdf/models';\n import { PdfAnnotationBorderStyle } from '@embedpdf/models';\n import { patching } from '@embedpdf/plugin-annotation';\n\n interface LineProps {\n color?: string; // interior color\n opacity?: number; // 0–1\n strokeWidth: number; // PDF units\n strokeColor?: string;\n strokeStyle?: PdfAnnotationBorderStyle;\n strokeDashArray?: number[];\n rect: Rect;\n linePoints: LinePoints;\n lineEndings?: LineEndings;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n isSelected: boolean;\n }\n\n let {\n color = 'transparent',\n opacity = 1,\n strokeWidth,\n strokeColor = '#000000',\n strokeStyle = PdfAnnotationBorderStyle.SOLID,\n strokeDashArray,\n rect,\n linePoints,\n lineEndings,\n scale,\n onClick,\n isSelected,\n }: LineProps = $props();\n\n // Localize endpoints into the annotation's bbox\n const x1 = $derived(linePoints.start.x - rect.origin.x);\n const y1 = $derived(linePoints.start.y - rect.origin.y);\n const x2 = $derived(linePoints.end.x - rect.origin.x);\n const y2 = $derived(linePoints.end.y - rect.origin.y);\n\n // Arrow-head / butt endings via shared factory\n const endings = $derived.by(() => {\n const angle = Math.atan2(y2 - y1, x2 - x1);\n return {\n start: patching.createEnding(lineEndings?.start, strokeWidth, angle + Math.PI, x1, y1),\n end: patching.createEnding(lineEndings?.end, strokeWidth, angle, x2, y2),\n };\n });\n\n // Absolute placement + scaling\n const width = $derived(rect.size.width * scale);\n const height = $derived(rect.size.height * scale);\n\n // Dashed stroke only when requested\n const dash = $derived(\n strokeStyle === PdfAnnotationBorderStyle.DASHED ? strokeDashArray?.join(',') : undefined,\n );\n</script>\n\n<svg\n style=\"position: absolute; z-index: 2; overflow: visible; pointer-events: none;\"\n style:width={`${width}px`}\n style:height={`${height}px`}\n {width}\n {height}\n viewBox={`0 0 ${rect.size.width} ${rect.size.height}`}\n>\n <!-- Main line -->\n <line\n {x1}\n {y1}\n {x2}\n {y2}\n {opacity}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected ? 'none' : 'visibleStroke'}\n style:stroke={strokeColor}\n style:stroke-width={strokeWidth}\n style:stroke-linecap=\"butt\"\n style:stroke-dasharray={dash}\n />\n\n <!-- Optional arrowheads / butt caps -->\n {#if endings.start}\n <path\n d={endings.start.d}\n transform={endings.start.transform}\n onpointerdown={onClick}\n ontouchstart={onClick}\n stroke={strokeColor}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:stroke-width={strokeWidth}\n style:stroke-linecap=\"butt\"\n style:pointer-events={isSelected\n ? 'none'\n : endings.start.filled\n ? 'visible'\n : 'visibleStroke'}\n style:stroke-dasharray={dash}\n fill={endings.start.filled ? color : 'none'}\n />\n {/if}\n\n {#if endings.end}\n <path\n d={endings.end.d}\n transform={endings.end.transform}\n stroke={strokeColor}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:stroke-width={strokeWidth}\n style:stroke-linecap=\"butt\"\n style:pointer-events={isSelected ? 'none' : endings.end.filled ? 'visible' : 'visibleStroke'}\n style:stroke-dasharray={dash}\n fill={endings.end.filled ? color : 'none'}\n />\n {/if}\n</svg>\n","<!-- Polyline.svelte -->\n<script lang=\"ts\">\n import type { Rect, Position, LineEndings } from '@embedpdf/models';\n import { patching } from '@embedpdf/plugin-annotation';\n\n interface PolylineProps {\n rect: Rect;\n vertices: Position[];\n color?: string;\n strokeColor?: string;\n opacity?: number;\n strokeWidth: number;\n scale: number;\n isSelected: boolean;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n /** Optional start & end endings */\n lineEndings?: LineEndings;\n }\n\n let {\n rect,\n vertices,\n color = 'transparent',\n strokeColor = '#000000',\n opacity = 1,\n strokeWidth,\n scale,\n isSelected,\n onClick,\n lineEndings,\n }: PolylineProps = $props();\n\n // Localize vertices to the annotation rect\n const localPts = $derived(\n vertices.map(({ x, y }) => ({ x: x - rect.origin.x, y: y - rect.origin.y })),\n );\n\n // Build path data: \"M x0 y0 L x1 y1 ...\"\n const pathData = $derived.by(() => {\n if (!localPts.length) return '';\n const [first, ...rest] = localPts;\n return (\n `M ${first.x} ${first.y} ` +\n rest\n .map((p) => `L ${p.x} ${p.y} `)\n .join('')\n .trim()\n );\n });\n\n // Compute endings (angles from first→second, last-1→last)\n const endings = $derived.by(() => {\n if (localPts.length < 2) return { start: null as any, end: null as any };\n const toAngle = (a: Position, b: Position) => Math.atan2(b.y - a.y, b.x - a.x);\n\n const startRad = toAngle(localPts[0], localPts[1]); // FROM first TO second\n const endRad = toAngle(localPts[localPts.length - 2], localPts[localPts.length - 1]); // FROM second-to-last TO last\n\n const start = patching.createEnding(\n lineEndings?.start,\n strokeWidth,\n startRad + Math.PI, // tip outward from start\n localPts[0].x,\n localPts[0].y,\n );\n const end = patching.createEnding(\n lineEndings?.end,\n strokeWidth,\n endRad, // tip in line direction\n localPts[localPts.length - 1].x,\n localPts[localPts.length - 1].y,\n );\n return { start, end };\n });\n\n const width = $derived(rect.size.width * scale);\n const height = $derived(rect.size.height * scale);\n</script>\n\n<svg\n style=\"position: absolute; width: var(--w); height: var(--h); pointer-events: none; z-index: 2; overflow: visible;\"\n style:--w={`${width}px`}\n style:--h={`${height}px`}\n {width}\n {height}\n viewBox={`0 0 ${rect.size.width} ${rect.size.height}`}\n>\n <path\n d={pathData}\n onpointerdown={onClick}\n ontouchstart={onClick}\n {opacity}\n style:fill=\"none\"\n style:stroke={strokeColor ?? color}\n style:stroke-width={strokeWidth}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected ? 'none' : 'visibleStroke'}\n style:stroke-linecap=\"butt\"\n style:stroke-linejoin=\"miter\"\n />\n\n {#if endings.start}\n <path\n d={endings.start.d}\n transform={endings.start.transform}\n stroke={strokeColor}\n fill={endings.start.filled ? color : 'none'}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:stroke-width={strokeWidth}\n style:pointer-events={isSelected\n ? 'none'\n : endings.start.filled\n ? 'visible'\n : 'visibleStroke'}\n style:stroke-linecap=\"butt\"\n />\n {/if}\n\n {#if endings.end}\n <path\n d={endings.end.d}\n transform={endings.end.transform}\n stroke={strokeColor}\n fill={endings.end.filled ? color : 'none'}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:stroke-width={strokeWidth}\n style:pointer-events={isSelected ? 'none' : endings.end.filled ? 'visible' : 'visibleStroke'}\n style:stroke-linecap=\"butt\"\n />\n {/if}\n</svg>\n","<!-- Polygon.svelte -->\n<script lang=\"ts\">\n import type { Rect, Position } from '@embedpdf/models';\n import { PdfAnnotationBorderStyle } from '@embedpdf/models';\n\n interface PolygonProps {\n rect: Rect;\n vertices: Position[];\n color?: string;\n strokeColor?: string;\n opacity?: number;\n strokeWidth: number;\n strokeStyle?: PdfAnnotationBorderStyle;\n strokeDashArray?: number[];\n scale: number;\n isSelected: boolean;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n // Preview-only\n currentVertex?: Position;\n handleSize?: number;\n }\n\n let {\n rect,\n vertices,\n color = 'transparent',\n strokeColor = '#000000',\n opacity = 1,\n strokeWidth,\n strokeStyle = PdfAnnotationBorderStyle.SOLID,\n strokeDashArray,\n scale,\n isSelected,\n onClick,\n currentVertex,\n handleSize = 14,\n }: PolygonProps = $props();\n\n // Combine vertices with preview point (if any)\n const allPoints = $derived(currentVertex ? [...vertices, currentVertex] : vertices);\n\n // Localize points to the annotation bbox\n const localPts = $derived(\n allPoints.map(({ x, y }) => ({ x: x - rect.origin.x, y: y - rect.origin.y })),\n );\n\n // Build path data; omit 'Z' when previewing\n const pathData = $derived.by(() => {\n if (!localPts.length) return '';\n const [first, ...rest] = localPts;\n const isPreview = !!currentVertex;\n return (\n `M ${first.x} ${first.y} ` +\n rest.map((p) => `L ${p.x} ${p.y}`).join(' ') +\n (isPreview ? '' : ' Z')\n ).trim();\n });\n\n const isPreviewing = $derived(!!currentVertex && vertices.length > 0);\n\n const width = $derived(rect.size.width * scale);\n const height = $derived(rect.size.height * scale);\n\n const dash = $derived(\n strokeStyle === PdfAnnotationBorderStyle.DASHED ? strokeDashArray?.join(',') : undefined,\n );\n</script>\n\n<svg\n style=\"position: absolute; z-index: 2; overflow: visible; pointer-events: none;\"\n style:width={`${width}px`}\n style:height={`${height}px`}\n {width}\n {height}\n viewBox={`0 0 ${rect.size.width} ${rect.size.height}`}\n>\n <path\n d={pathData}\n onpointerdown={onClick}\n ontouchstart={onClick}\n {opacity}\n style:fill={currentVertex ? 'none' : color}\n style:stroke={strokeColor ?? color}\n style:stroke-width={strokeWidth}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected\n ? 'none'\n : color === 'transparent'\n ? 'visibleStroke'\n : 'visible'}\n style:stroke-linecap=\"butt\"\n style:stroke-linejoin=\"miter\"\n style:stroke-dasharray={dash}\n />\n\n <!-- Preview-only elements -->\n {#if isPreviewing && vertices.length > 1}\n <path\n d={`M ${localPts[localPts.length - 1].x} ${localPts[localPts.length - 1].y} L ${localPts[0].x} ${localPts[0].y}`}\n fill=\"none\"\n style:stroke={strokeColor}\n style:stroke-width={strokeWidth}\n style:stroke-dasharray={'4,4'}\n style:opacity={0.7}\n />\n {/if}\n\n {#if isPreviewing && vertices.length >= 2}\n <rect\n x={localPts[0].x - handleSize / scale / 2}\n y={localPts[0].y - handleSize / scale / 2}\n width={handleSize / scale}\n height={handleSize / scale}\n fill={strokeColor}\n opacity={0.4}\n stroke={strokeColor}\n stroke-width={strokeWidth / 2}\n />\n {/if}\n</svg>\n","<!-- Free-text.svelte -->\n<script lang=\"ts\">\n import {\n type PdfFreeTextAnnoObject,\n PdfVerticalAlignment,\n standardFontCss,\n textAlignmentToCss,\n } from '@embedpdf/models';\n import type { TrackedAnnotation } from '@embedpdf/plugin-annotation';\n import { useAnnotationCapability } from '../../hooks';\n\n // ---------- props ----------\n interface FreeTextProps {\n documentId: string;\n isSelected: boolean;\n isEditing: boolean;\n annotation: TrackedAnnotation<PdfFreeTextAnnoObject>;\n pageIndex: number;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n onDoubleClick?: (e: MouseEvent) => void;\n }\n\n let { documentId, isSelected, isEditing, annotation, pageIndex, scale, onClick }: FreeTextProps =\n $props();\n\n // ---------- capabilities ----------\n const annotationCapability = useAnnotationCapability();\n\n // Get scoped API for this document\n const annotationProvides = $derived(\n annotationCapability.provides ? annotationCapability.provides.forDocument(documentId) : null,\n );\n\n // ---------- refs / state ----------\n let editorRef: HTMLSpanElement | null = null;\n let isIOS = $state(false);\n\n // Focus and move caret to end when entering edit mode\n $effect(() => {\n if (!isEditing || !editorRef) return;\n editorRef.focus();\n\n const selection = window.getSelection?.();\n if (!selection) return;\n\n const range = document.createRange();\n range.selectNodeContents(editorRef);\n range.collapse(false);\n selection.removeAllRanges();\n selection.addRange(range);\n });\n\n // One-time iOS detection (prevents zoom by font-size compensation)\n $effect.pre(() => {\n try {\n const nav = navigator as any;\n const ios =\n /iPad|iPhone|iPod/.test(navigator.userAgent) ||\n (navigator.platform === 'MacIntel' && nav?.maxTouchPoints > 1);\n isIOS = ios;\n } catch {\n isIOS = false;\n }\n });\n\n // Persist contents on blur\n function handleBlur() {\n if (!annotationProvides || !editorRef) return;\n annotationProvides.updateAnnotation(pageIndex, annotation.object.id, {\n contents: editorRef.innerText,\n });\n }\n\n // ---------- iOS zoom compensation ----------\n const computedFontPx = $derived(annotation.object.fontSize * scale);\n const MIN_IOS_FOCUS_FONT_PX = 16;\n const needsComp = $derived(\n isIOS && isEditing && computedFontPx > 0 && computedFontPx < MIN_IOS_FOCUS_FONT_PX,\n );\n const adjustedFontPx = $derived(needsComp ? MIN_IOS_FOCUS_FONT_PX : computedFontPx);\n const scaleComp = $derived(needsComp ? computedFontPx / MIN_IOS_FOCUS_FONT_PX : 1);\n const invScalePercent = $derived(needsComp ? 100 / scaleComp : 100);\n\n // ---------- derived sizes ----------\n const outerW = $derived(annotation.object.rect.size.width * scale);\n const outerH = $derived(annotation.object.rect.size.height * scale);\n\n const justify = $derived(\n annotation.object.verticalAlign === PdfVerticalAlignment.Top\n ? 'flex-start'\n : annotation.object.verticalAlign === PdfVerticalAlignment.Middle\n ? 'center'\n : 'flex-end',\n );\n</script>\n\n<!-- Outer positioned container -->\n<div\n style:position=\"absolute\"\n style:width={`${outerW}px`}\n style:height={`${outerH}px`}\n style:z-index={2}\n style:cursor={isSelected && !isEditing ? 'move' : 'default'}\n style:pointer-events={isSelected && !isEditing ? 'none' : 'auto'}\n onpointerdown={onClick}\n ontouchstart={onClick}\n>\n <!-- Editable span -->\n <span\n bind:this={editorRef}\n tabindex=\"0\"\n contenteditable={isEditing}\n onblur={handleBlur}\n style:display=\"flex\"\n style:flex-direction=\"column\"\n style:justify-content={justify}\n style:color={annotation.object.fontColor}\n style:font-size={`${adjustedFontPx}px`}\n style:font-family={standardFontCss(annotation.object.fontFamily)}\n style:text-align={textAlignmentToCss(annotation.object.textAlign)}\n style:background-color={annotation.object.color ?? annotation.object.backgroundColor}\n style:opacity={annotation.object.opacity}\n style:width={needsComp ? `${invScalePercent}%` : '100%'}\n style:height={needsComp ? `${invScalePercent}%` : '100%'}\n style:line-height=\"1.18\"\n style:overflow=\"hidden\"\n style:cursor={isEditing ? 'text' : 'pointer'}\n style:outline=\"none\"\n style:transform={needsComp ? `scale(${scaleComp})` : undefined}\n style:transform-origin=\"top left\">{annotation.object.contents}</span\n >\n</div>\n","<script lang=\"ts\">\n import { ignore, type PdfAnnotationObject, PdfErrorCode } from '@embedpdf/models';\n import type { HTMLImgAttributes } from 'svelte/elements';\n import { useAnnotationCapability } from '../hooks';\n import { deepToRaw } from '@embedpdf/utils/svelte';\n\n interface RenderAnnotationProps extends Omit<HTMLImgAttributes, 'style'> {\n documentId: string;\n pageIndex: number;\n annotation: PdfAnnotationObject;\n scaleFactor?: number;\n dpr?: number;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n documentId,\n pageIndex,\n annotation,\n scaleFactor = 1,\n style,\n ...restProps\n }: RenderAnnotationProps = $props();\n\n const annotationCapability = useAnnotationCapability();\n\n let imageUrl = $state<string | null>(null);\n let urlRef: string | null = null;\n\n const { width, height } = $derived(annotation.rect.size);\n\n // Get scoped API for this document\n const annotationProvides = $derived(\n annotationCapability.provides ? annotationCapability.provides.forDocument(documentId) : null,\n );\n\n // Effect to render annotation\n $effect(() => {\n if (annotationProvides) {\n const task = annotationProvides.renderAnnotation({\n pageIndex,\n annotation: deepToRaw(annotation),\n options: {\n scaleFactor,\n dpr: window.devicePixelRatio,\n },\n });\n\n task.wait((blob) => {\n const url = URL.createObjectURL(blob);\n imageUrl = url;\n urlRef = url;\n }, ignore);\n\n return () => {\n if (urlRef) {\n URL.revokeObjectURL(urlRef);\n urlRef = null;\n } else {\n task.abort({\n code: PdfErrorCode.Cancelled,\n message: 'canceled render task',\n });\n }\n };\n }\n });\n\n function handleImageLoad() {\n if (urlRef) {\n URL.revokeObjectURL(urlRef);\n urlRef = null;\n }\n }\n</script>\n\n{#if imageUrl}\n <img\n alt=\"\"\n src={imageUrl}\n onload={handleImageLoad}\n {...restProps}\n style:width=\"100%\"\n style:height=\"100%\"\n style:display=\"block\"\n {style}\n />\n{/if}\n","<script lang=\"ts\">\n import type { PdfStampAnnoObject } from '@embedpdf/models';\n import type { TrackedAnnotation } from '@embedpdf/plugin-annotation';\n import RenderAnnotation from '../RenderAnnotation.svelte';\n\n interface StampProps {\n documentId: string;\n isSelected: boolean;\n annotation: TrackedAnnotation<PdfStampAnnoObject>;\n pageIndex: number;\n scale: number;\n onClick: (e: MouseEvent | TouchEvent) => void;\n }\n\n let { documentId, isSelected, annotation, pageIndex, scale, onClick }: StampProps = $props();\n\n let annotationProp = $derived({ ...annotation.object, id: annotation.object.id });\n</script>\n\n<div\n style=\"position: absolute; width: 100%; height: 100%; z-index: 2;\"\n style:pointer-events={isSelected ? 'none' : 'auto'}\n style:cursor=\"pointer\"\n onpointerdown={onClick}\n ontouchstart={onClick}\n>\n <RenderAnnotation {documentId} {pageIndex} annotation={annotationProp} scaleFactor={scale} />\n</div>\n","<script lang=\"ts\">\n import { PdfAnnotationBorderStyle, type Rect } from '@embedpdf/models';\n\n interface LinkProps {\n /** Whether the annotation is selected */\n isSelected: boolean;\n /** Stroke colour – defaults to blue when omitted */\n strokeColor?: string;\n /** Stroke width in PDF units */\n strokeWidth?: number;\n /** Stroke type – defaults to underline when omitted */\n strokeStyle?: PdfAnnotationBorderStyle;\n /** Stroke dash array – for dashed style */\n strokeDashArray?: number[];\n /** Bounding box of the annotation (PDF units) */\n rect: Rect;\n /** Current page zoom factor */\n scale: number;\n /** Click handler (used for selection) */\n onClick?: (e: MouseEvent | TouchEvent) => void;\n /** Whether this link has an IRT (In Reply To) reference - disables direct interaction */\n hasIRT?: boolean;\n }\n\n let {\n isSelected,\n strokeColor = '#0000FF',\n strokeWidth = 2,\n strokeStyle = PdfAnnotationBorderStyle.UNDERLINE,\n strokeDashArray,\n rect,\n scale,\n onClick,\n hasIRT = false,\n }: LinkProps = $props();\n\n const width = $derived(rect.size.width);\n const height = $derived(rect.size.height);\n const svgWidth = $derived(width * scale);\n const svgHeight = $derived(height * scale);\n\n // Calculate dash array for SVG\n const dashArray = $derived.by(() => {\n if (strokeStyle === PdfAnnotationBorderStyle.DASHED) {\n return strokeDashArray?.join(',') ?? `${strokeWidth * 3},${strokeWidth}`;\n }\n return undefined;\n });\n\n // For underline style, render a line at the bottom\n // For solid/dashed, render a rectangle border\n const isUnderline = $derived(strokeStyle === PdfAnnotationBorderStyle.UNDERLINE);\n\n const hitAreaCursor = $derived(hasIRT ? 'default' : isSelected ? 'move' : 'pointer');\n const hitAreaPointerEvents = $derived(hasIRT ? 'none' : isSelected ? 'none' : 'visible');\n</script>\n\n<svg\n style=\"position: absolute; z-index: 2; pointer-events: none;\"\n style:width=\"{svgWidth}px\"\n style:height=\"{svgHeight}px\"\n width={svgWidth}\n height={svgHeight}\n viewBox=\"0 0 {width} {height}\"\n>\n <!-- Invisible hit area for the entire link region -->\n <!-- IRT links are not directly clickable - interaction goes through parent -->\n <rect\n x={0}\n y={0}\n {width}\n {height}\n fill=\"transparent\"\n onpointerdown={hasIRT ? undefined : onClick}\n ontouchstart={hasIRT ? undefined : onClick}\n style:cursor={hitAreaCursor}\n style:pointer-events={hitAreaPointerEvents}\n />\n\n {#if isUnderline}\n <!-- Underline style: line at bottom of rect -->\n <line\n x1={1}\n y1={height - 1}\n x2={width - 1}\n y2={height - 1}\n stroke={strokeColor}\n stroke-width={strokeWidth}\n stroke-dasharray={dashArray}\n style:pointer-events=\"none\"\n />\n {:else}\n <!-- Solid/Dashed style: rectangle border -->\n <rect\n x={strokeWidth / 2}\n y={strokeWidth / 2}\n width={Math.max(width - strokeWidth, 0)}\n height={Math.max(height - strokeWidth, 0)}\n fill=\"transparent\"\n stroke={strokeColor}\n stroke-width={strokeWidth}\n stroke-dasharray={dashArray}\n style:pointer-events=\"none\"\n />\n {/if}\n</svg>\n","<!-- GroupSelectionBox.svelte -->\n<script lang=\"ts\">\n import { boundingRectOrEmpty, type Rect } from '@embedpdf/models';\n import type { TrackedAnnotation } from '@embedpdf/plugin-annotation';\n import {\n useInteractionHandles,\n CounterRotate,\n type MenuWrapperProps,\n } from '@embedpdf/utils/svelte';\n import { useAnnotationPlugin } from '../hooks';\n import type {\n GroupSelectionContext,\n GroupSelectionMenuProps,\n GroupSelectionMenuRenderFn,\n ResizeHandleUI,\n } from '../types';\n import type { Snippet } from 'svelte';\n\n interface GroupSelectionBoxProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation: number;\n pageWidth: number;\n pageHeight: number;\n /** All selected annotations on this page */\n selectedAnnotations: TrackedAnnotation[];\n /** Whether the group is draggable (all annotations must be group-draggable) */\n isDraggable: boolean;\n /** Whether the group is resizable (all annotations must be group-resizable) */\n isResizable: boolean;\n /** Resize handle UI customization */\n resizeUI?: ResizeHandleUI;\n /** Selection outline color */\n selectionOutlineColor?: string;\n /** Outline offset */\n outlineOffset?: number;\n /** Z-index for the group box */\n zIndex?: number;\n /** Group selection menu render function */\n groupSelectionMenu?: GroupSelectionMenuRenderFn;\n /** Snippet for custom group selection menu (slot-based approach) */\n groupSelectionMenuSnippet?: Snippet<[GroupSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation,\n pageWidth,\n pageHeight,\n selectedAnnotations,\n isDraggable,\n isResizable,\n resizeUI,\n selectionOutlineColor = '#007ACC',\n outlineOffset = 2,\n zIndex = 100,\n groupSelectionMenu,\n groupSelectionMenuSnippet,\n }: GroupSelectionBoxProps = $props();\n\n const annotationPlugin = useAnnotationPlugin();\n let gestureBase = $state<Rect | null>(null);\n let isDraggingRef = $state(false);\n let isResizingRef = $state(false);\n\n // Helper to compute group box on demand\n function getGroupBox(): Rect {\n const rects = selectedAnnotations.map((ta) => ta.object.rect);\n return boundingRectOrEmpty(rects);\n }\n\n // Compute the group bounding box from all selected annotations (for reactive bindings)\n const groupBox = $derived.by(getGroupBox);\n\n // Preview state for the group box during drag/resize\n let previewGroupBox = $state<Rect>(getGroupBox());\n\n // Sync preview with actual group box when not dragging/resizing\n $effect(() => {\n if (!isDraggingRef && !isResizingRef) {\n const newBox = groupBox;\n // Only update if values actually changed (not just object reference)\n if (\n previewGroupBox.origin.x !== newBox.origin.x ||\n previewGroupBox.origin.y !== newBox.origin.y ||\n previewGroupBox.size.width !== newBox.size.width ||\n previewGroupBox.size.height !== newBox.size.height\n ) {\n previewGroupBox = newBox;\n }\n }\n });\n\n // UI constants\n const HANDLE_COLOR = $derived(resizeUI?.color ?? '#007ACC');\n const HANDLE_SIZE = $derived(resizeUI?.size ?? 12);\n\n // Use interaction handles for both drag and resize\n const interactionHandles = useInteractionHandles(() => ({\n controller: {\n element: previewGroupBox,\n constraints: {\n minWidth: 20,\n minHeight: 20,\n boundingBox: { width: pageWidth, height: pageHeight },\n },\n maintainAspectRatio: false,\n pageRotation: rotation,\n scale: scale,\n enabled: true,\n onUpdate: (event) => {\n if (!event.transformData?.type) return;\n if (!annotationPlugin.plugin) return;\n\n const plugin = annotationPlugin.plugin;\n const transformType = event.transformData.type;\n const isMove = transformType === 'move';\n const isResize = transformType === 'resize';\n\n // Skip drag operations if group is not draggable\n if (isMove && !isDraggable) return;\n\n if (event.state === 'start') {\n gestureBase = getGroupBox();\n\n if (isMove) {\n isDraggingRef = true;\n // Use unified drag API - plugin handles attached links automatically\n plugin.startDrag(documentId, {\n annotationIds: selectedAnnotations.map((ta) => ta.object.id),\n pageSize: { width: pageWidth, height: pageHeight },\n });\n } else if (isResize) {\n isResizingRef = true;\n // Use unified resize API - plugin handles attached links automatically\n plugin.startResize(documentId, {\n annotationIds: selectedAnnotations.map((ta) => ta.object.id),\n pageSize: { width: pageWidth, height: pageHeight },\n resizeHandle: event.transformData.metadata?.handle ?? 'se',\n });\n }\n }\n\n const base = gestureBase ?? getGroupBox();\n\n if (isMove && event.transformData.changes.rect) {\n // Calculate delta from original position\n const newRect = event.transformData.changes.rect;\n const rawDelta = {\n x: newRect.origin.x - base.origin.x,\n y: newRect.origin.y - base.origin.y,\n };\n\n // Plugin clamps delta and emits events (attached links receive updates too)\n const clampedDelta = plugin.updateDrag(documentId, rawDelta);\n\n // Update preview group box with clamped delta\n previewGroupBox = {\n ...base,\n origin: {\n x: base.origin.x + clampedDelta.x,\n y: base.origin.y + clampedDelta.y,\n },\n };\n } else if (isResize && event.transformData.changes.rect) {\n const newGroupBox = event.transformData.changes.rect;\n\n // Plugin computes rects for all participants and emits events\n plugin.updateResize(documentId, newGroupBox);\n\n // Update preview\n previewGroupBox = newGroupBox;\n }\n\n if (event.state === 'end') {\n gestureBase = null;\n\n if (isMove && isDraggingRef) {\n isDraggingRef = false;\n // Plugin commits all patches (selected + attached links) - no patch building needed!\n plugin.commitDrag(documentId);\n } else if (isResize && isResizingRef) {\n isResizingRef = false;\n // Plugin commits all patches (selected + attached links) - no patch building needed!\n plugin.commitResize(documentId);\n }\n }\n },\n },\n resizeUI: {\n handleSize: HANDLE_SIZE,\n spacing: outlineOffset,\n offsetMode: 'outside',\n includeSides: true,\n zIndex: zIndex + 1,\n },\n vertexUI: {\n vertexSize: 0,\n zIndex: zIndex,\n },\n includeVertices: false,\n }));\n\n // Derived accessors for template\n const resizeHandles = $derived(interactionHandles.resize);\n\n // --- Group Selection Menu Logic ---\n\n // Check if we should show menu\n const shouldShowMenu = $derived(!!groupSelectionMenu || !!groupSelectionMenuSnippet);\n\n // Build context object for group selection menu\n function buildContext(): GroupSelectionContext {\n return {\n type: 'group',\n annotations: selectedAnnotations,\n pageIndex,\n };\n }\n\n // Build menu props\n function buildMenuProps(rect: Rect, menuWrapperProps: MenuWrapperProps): GroupSelectionMenuProps {\n return {\n context: buildContext(),\n selected: true,\n rect,\n placement: { suggestTop: false },\n menuWrapperProps,\n };\n }\n</script>\n\n{#if selectedAnnotations.length >= 2}\n <div data-group-selection-box data-no-interaction>\n <!-- Group box - draggable only if isDraggable is true -->\n <div\n {...isDraggable\n ? interactionHandles.dragProps\n : { onpointerdown: (e: PointerEvent) => e.stopPropagation() }}\n style:position=\"absolute\"\n style:left=\"{previewGroupBox.origin.x * scale}px\"\n style:top=\"{previewGroupBox.origin.y * scale}px\"\n style:width=\"{previewGroupBox.size.width * scale}px\"\n style:height=\"{previewGroupBox.size.height * scale}px\"\n style:outline=\"2px dashed {selectionOutlineColor}\"\n style:outline-offset=\"{outlineOffset - 1}px\"\n style:cursor={isDraggable ? 'move' : 'default'}\n style:touch-action=\"none\"\n style:z-index={zIndex}\n >\n <!-- Resize handles -->\n {#if isResizable}\n {#each resizeHandles as { key, style: handleStyle, ...hProps } (key)}\n {#if resizeUI?.component}\n {@render resizeUI.component({ ...hProps, backgroundColor: HANDLE_COLOR })}\n {:else}\n <div {...hProps} style=\"{handleStyle}; background-color: {HANDLE_COLOR};\"></div>\n {/if}\n {/each}\n {/if}\n </div>\n\n <!-- Group selection menu -->\n {#if shouldShowMenu}\n <CounterRotate\n rect={{\n origin: {\n x: previewGroupBox.origin.x * scale,\n y: previewGroupBox.origin.y * scale,\n },\n size: {\n width: previewGroupBox.size.width * scale,\n height: previewGroupBox.size.height * scale,\n },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(rect, menuWrapperProps)}\n {#if groupSelectionMenu}\n <!-- Priority 1: Render function (schema-driven) -->\n {@const result = groupSelectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if groupSelectionMenuSnippet}\n <!-- Priority 2: Snippet (manual customization) -->\n {@render groupSelectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n </div>\n{/if}\n","<!-- Annotations.svelte -->\n<script lang=\"ts\">\n import { blendModeToCss, type PdfAnnotationObject, PdfBlendMode } from '@embedpdf/models';\n import {\n getAnnotationsByPageIndex,\n getSelectedAnnotationIds,\n isCircle,\n isFreeText,\n isHighlight,\n isInk,\n isLine,\n isLink,\n isPolygon,\n isPolyline,\n isSquare,\n isSquiggly,\n isStamp,\n isStrikeout,\n isUnderline,\n type TrackedAnnotation,\n } from '@embedpdf/plugin-annotation';\n import type { PdfLinkAnnoObject } from '@embedpdf/models';\n\n import {\n type PointerEventHandlersWithLifecycle,\n type EmbedPdfPointerEvent,\n } from '@embedpdf/plugin-interaction-manager';\n import { usePointerHandlers } from '@embedpdf/plugin-interaction-manager/svelte';\n import { useSelectionCapability } from '@embedpdf/plugin-selection/svelte';\n\n import { useAnnotationCapability } from '../hooks';\n\n import Highlight from './text-markup/Highlight.svelte';\n import Underline from './text-markup/Underline.svelte';\n import Strikeout from './text-markup/Strikeout.svelte';\n import Squiggly from './text-markup/Squiggly.svelte';\n import Ink from './annotations/Ink.svelte';\n import Square from './annotations/Square.svelte';\n import Circle from './annotations/Circle.svelte';\n import Line from './annotations/Line.svelte';\n import Polyline from './annotations/Polyline.svelte';\n import Polygon from './annotations/Polygon.svelte';\n import FreeText from './annotations/FreeText.svelte';\n import Stamp from './annotations/Stamp.svelte';\n import Link from './annotations/Link.svelte';\n import GroupSelectionBox from './GroupSelectionBox.svelte';\n import type {\n AnnotationSelectionMenuProps,\n AnnotationSelectionMenuRenderFn,\n GroupSelectionMenuProps,\n GroupSelectionMenuRenderFn,\n CustomAnnotationRenderer,\n ResizeHandleUI,\n VertexHandleUI,\n } from '../types';\n import AnnotationContainer from './AnnotationContainer.svelte';\n import type { Snippet } from 'svelte';\n\n // ---------- props ----------\n interface AnnotationsProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation: number;\n pageWidth: number;\n pageHeight: number;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: AnnotationSelectionMenuRenderFn;\n /** Snippet for custom selection menu (slot-based approach) */\n selectionMenuSnippet?: Snippet<[AnnotationSelectionMenuProps]>;\n /** Render function for group selection menu (schema-driven approach) */\n groupSelectionMenu?: GroupSelectionMenuRenderFn;\n /** Snippet for custom group selection menu (slot-based approach) */\n groupSelectionMenuSnippet?: Snippet<[GroupSelectionMenuProps]>;\n resizeUI?: ResizeHandleUI;\n vertexUI?: VertexHandleUI;\n selectionOutlineColor?: string;\n customAnnotationRenderer?: CustomAnnotationRenderer<PdfAnnotationObject>;\n }\n let annotationsProps: AnnotationsProps = $props();\n\n // ---------- capabilities / handlers ----------\n const annotationCapability = useAnnotationCapability();\n const selectionCapability = useSelectionCapability();\n const pointerHandlers = usePointerHandlers({\n documentId: annotationsProps.documentId,\n pageIndex: annotationsProps.pageIndex,\n });\n\n // ---------- local state ----------\n let annotations = $state<TrackedAnnotation[]>([]);\n let allSelectedIds = $state<string[]>([]);\n let editingId = $state<string | null>(null);\n\n // Get scoped API for this document\n const annotationProvides = $derived(\n annotationCapability.provides\n ? annotationCapability.provides.forDocument(annotationsProps.documentId)\n : null,\n );\n\n // Check if multiple annotations are selected\n const isMultiSelected = $derived(allSelectedIds.length > 1);\n\n // subscribe to annotation state\n $effect(() => {\n if (!annotationProvides) return;\n\n // Initialize with current state immediately\n const currentState = annotationProvides.getState();\n annotations = getAnnotationsByPageIndex(currentState, annotationsProps.pageIndex);\n allSelectedIds = getSelectedAnnotationIds(currentState);\n\n // Then subscribe to changes\n const off = annotationProvides.onStateChange((state) => {\n annotations = getAnnotationsByPageIndex(state, annotationsProps.pageIndex);\n allSelectedIds = getSelectedAnnotationIds(state);\n });\n return () => off?.();\n });\n\n // pointer handlers (capture-down to deselect when clicking empty layer)\n const handlers: PointerEventHandlersWithLifecycle<EmbedPdfPointerEvent<PointerEvent>> = {\n onPointerDown: (_, pe) => {\n if (pe.target === pe.currentTarget && annotationProvides) {\n annotationProvides.deselectAnnotation();\n editingId = null;\n }\n },\n };\n\n // register pointer handlers\n $effect(() => {\n return pointerHandlers.register(handlers, { documentId: annotationsProps.documentId });\n });\n\n // click/select logic shared across shapes\n function handleClick(e: MouseEvent | TouchEvent, annotation: TrackedAnnotation) {\n e.stopPropagation();\n if (annotationProvides && selectionCapability.provides) {\n selectionCapability.provides.clear();\n\n // Check for modifier key (Cmd on Mac, Ctrl on Windows/Linux)\n const isModifierPressed = 'metaKey' in e ? e.metaKey || e.ctrlKey : false;\n\n if (isModifierPressed) {\n // Toggle selection: add or remove from current selection\n annotationProvides.toggleSelection(annotationsProps.pageIndex, annotation.object.id);\n } else {\n // Exclusive select: clear and select only this one\n annotationProvides.selectAnnotation(annotationsProps.pageIndex, annotation.object.id);\n }\n\n if (annotation.object.id !== editingId) {\n editingId = null;\n }\n }\n }\n\n // Special handler for link annotations - if IRT exists, select the parent\n function handleLinkClick(\n e: MouseEvent | TouchEvent,\n annotation: TrackedAnnotation<PdfLinkAnnoObject>,\n ) {\n e.stopPropagation();\n if (!annotationProvides || !selectionCapability.provides) return;\n\n selectionCapability.provides.clear();\n\n // If link has IRT, select the parent annotation instead\n if (annotation.object.inReplyToId) {\n const parentId = annotation.object.inReplyToId;\n const parent = annotations.find((a) => a.object.id === parentId);\n if (parent) {\n annotationProvides.selectAnnotation(parent.object.pageIndex, parentId);\n return;\n }\n }\n\n // Standalone link - select it directly\n annotationProvides.selectAnnotation(annotationsProps.pageIndex, annotation.object.id);\n }\n\n // Get selected annotations that are on THIS page (for group selection box)\n const selectedAnnotationsOnPage = $derived(\n annotations.filter((anno) => allSelectedIds.includes(anno.object.id)),\n );\n\n // Check if all selected annotations on this page are draggable in group context\n const areAllSelectedDraggable = $derived.by(() => {\n if (selectedAnnotationsOnPage.length < 2) return false;\n\n return selectedAnnotationsOnPage.every((ta) => {\n const tool = annotationProvides?.findToolForAnnotation(ta.object);\n // Use group-specific property, falling back to single-annotation property\n return tool?.interaction.isGroupDraggable ?? tool?.interaction.isDraggable ?? true;\n });\n });\n\n // Check if all selected annotations on this page are resizable in group context\n const areAllSelectedResizable = $derived.by(() => {\n if (selectedAnnotationsOnPage.length < 2) return false;\n\n return selectedAnnotationsOnPage.every((ta) => {\n const tool = annotationProvides?.findToolForAnnotation(ta.object);\n // Use group-specific property, falling back to single-annotation property\n return tool?.interaction.isGroupResizable ?? tool?.interaction.isResizable ?? true;\n });\n });\n\n // Check if all selected annotations are on the same page (this page)\n const allSelectedOnSamePage = $derived.by(() => {\n if (!annotationProvides) return false;\n // Early return if not enough selections (also creates reactive dependency on allSelectedIds)\n if (allSelectedIds.length < 2) return false;\n const allSelected = annotationProvides.getSelectedAnnotations();\n return allSelected.every((ta) => ta.object.pageIndex === annotationsProps.pageIndex);\n });\n</script>\n\n{#each annotations as annotation (annotation.object.id)}\n {@const isSelected = allSelectedIds.includes(annotation.object.id)}\n {@const isEditing = editingId === annotation.object.id}\n {@const tool = annotationProvides?.findToolForAnnotation(annotation.object)}\n {@const mixBlendMode = blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)}\n\n {#if isInk(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? true) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? true) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Ink\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isSquare(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? true) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? true) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Square\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isCircle(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? true) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? true) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Circle\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: PointerEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isUnderline(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? false) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? false) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n zIndex={0}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Underline\n {...obj}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isStrikeout(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? false) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? false) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n zIndex={0}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Strikeout\n {...obj}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isSquiggly(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? false) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? false) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n zIndex={0}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Squiggly\n {...obj}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isHighlight(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? false) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? false) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n zIndex={0}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n style=\"mix-blend-mode: {blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Multiply)}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Highlight\n {...obj}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isLine(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? true) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? false) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n vertexConfig={{\n extractVertices: (a) => [a.linePoints.start, a.linePoints.end],\n transformAnnotation: (a, vertices) => ({\n ...a,\n linePoints: { start: vertices[0], end: vertices[1] },\n }),\n }}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Line\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isPolyline(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n isDraggable={(tool?.interaction.isDraggable ?? true) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? false) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n isSelected={isSelected && !isMultiSelected}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n vertexConfig={{\n extractVertices: (a) => a.vertices,\n transformAnnotation: (a, vertices) => ({ ...a, vertices }),\n }}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Polyline\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isPolygon(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? true) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? false) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n vertexConfig={{\n extractVertices: (a) => a.vertices,\n transformAnnotation: (a, vertices) => ({ ...a, vertices }),\n }}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Polygon\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isFreeText(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? true) && !isEditing && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? true) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)}\"\n onDoubleClick={(e) => {\n e.stopPropagation();\n editingId = annotation.object.id;\n }}\n {...annotationsProps}\n >\n {#snippet children(object)}\n <FreeText\n documentId={annotationsProps.documentId}\n {isSelected}\n {isEditing}\n annotation={{ ...annotation, object }}\n pageIndex={annotationsProps.pageIndex}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isStamp(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={(tool?.interaction.isDraggable ?? true) && !isMultiSelected}\n isResizable={(tool?.interaction.isResizable ?? true) && !isMultiSelected}\n lockAspectRatio={tool?.interaction.lockAspectRatio ?? false}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(_object)}\n <Stamp\n documentId={annotationsProps.documentId}\n {isSelected}\n {annotation}\n pageIndex={annotationsProps.pageIndex}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isLink(annotation)}\n {@const hasIRT = !!annotation.object.inReplyToId}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n {isMultiSelected}\n isDraggable={false}\n isResizable={false}\n lockAspectRatio={false}\n selectionMenu={hasIRT\n ? undefined\n : isMultiSelected\n ? undefined\n : annotationsProps.selectionMenu}\n selectionMenuSnippet={hasIRT\n ? undefined\n : isMultiSelected\n ? undefined\n : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleLinkClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Link\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleLinkClick(e, annotation)}\n {hasIRT}\n />\n {/snippet}\n </AnnotationContainer>\n {/if}\n{/each}\n\n<!-- Group Selection Box (shown when multiple annotations are selected on this page) -->\n{#if allSelectedOnSamePage && selectedAnnotationsOnPage.length >= 2}\n <GroupSelectionBox\n documentId={annotationsProps.documentId}\n pageIndex={annotationsProps.pageIndex}\n scale={annotationsProps.scale}\n rotation={annotationsProps.rotation}\n pageWidth={annotationsProps.pageWidth}\n pageHeight={annotationsProps.pageHeight}\n selectedAnnotations={selectedAnnotationsOnPage}\n isDraggable={areAllSelectedDraggable}\n isResizable={areAllSelectedResizable}\n resizeUI={annotationsProps.resizeUI}\n selectionOutlineColor={annotationsProps.selectionOutlineColor}\n groupSelectionMenu={annotationsProps.groupSelectionMenu}\n groupSelectionMenuSnippet={annotationsProps.groupSelectionMenuSnippet}\n />\n{/if}\n","<script lang=\"ts\">\n import { blendModeToCss, PdfAnnotationSubtype, PdfBlendMode, type Rect } from '@embedpdf/models';\n import type { AnnotationTool } from '@embedpdf/plugin-annotation';\n import { useSelectionCapability } from '@embedpdf/plugin-selection/svelte';\n\n import { useAnnotationCapability } from '../hooks';\n import Highlight from './text-markup/Highlight.svelte';\n import Squiggly from './text-markup/Squiggly.svelte';\n import Underline from './text-markup/Underline.svelte';\n import Strikeout from './text-markup/Strikeout.svelte';\n\n interface TextMarkupProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n }\n\n let { documentId, pageIndex, scale }: TextMarkupProps = $props();\n\n const selectionCapability = useSelectionCapability();\n const annotationCapability = useAnnotationCapability();\n\n let rects = $state<Rect[]>([]);\n let boundingRect = $state<Rect | null>(null);\n let activeTool = $state<AnnotationTool | null>(null);\n\n // Get scoped APIs for this document\n const selectionProvides = $derived(\n selectionCapability.provides ? selectionCapability.provides.forDocument(documentId) : null,\n );\n const annotationProvides = $derived(\n annotationCapability.provides ? annotationCapability.provides.forDocument(documentId) : null,\n );\n\n // Subscribe to selection changes\n $effect(() => {\n if (!selectionProvides) return;\n\n const off = selectionProvides.onSelectionChange(() => {\n rects = selectionProvides.getHighlightRectsForPage(pageIndex);\n boundingRect = selectionProvides.getBoundingRectForPage(pageIndex);\n });\n return off;\n });\n\n // Subscribe to active tool changes\n $effect(() => {\n if (!annotationProvides) return;\n\n // Initialize with current active tool\n activeTool = annotationProvides.getActiveTool();\n\n const off = annotationProvides.onActiveToolChange((tool) => {\n activeTool = tool;\n });\n return off;\n });\n\n const mixBlendMode = $derived(\n activeTool?.defaults?.blendMode\n ? blendModeToCss(activeTool.defaults.blendMode)\n : activeTool?.defaults?.type === PdfAnnotationSubtype.HIGHLIGHT\n ? blendModeToCss(PdfBlendMode.Multiply)\n : blendModeToCss(PdfBlendMode.Normal),\n );\n</script>\n\n{#if boundingRect && activeTool && activeTool.defaults}\n {#if activeTool.defaults.type === PdfAnnotationSubtype.UNDERLINE}\n <div\n style:mix-blend-mode={mixBlendMode}\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Underline\n strokeColor={activeTool.defaults?.strokeColor}\n opacity={activeTool.defaults?.opacity}\n segmentRects={rects}\n {scale}\n />\n </div>\n {:else if activeTool.defaults.type === PdfAnnotationSubtype.HIGHLIGHT}\n <div\n style:mix-blend-mode={mixBlendMode}\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Highlight\n strokeColor={activeTool.defaults?.strokeColor}\n opacity={activeTool.defaults?.opacity}\n segmentRects={rects}\n {scale}\n />\n </div>\n {:else if activeTool.defaults.type === PdfAnnotationSubtype.STRIKEOUT}\n <div\n style:mix-blend-mode={mixBlendMode}\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Strikeout\n strokeColor={activeTool.defaults?.strokeColor}\n opacity={activeTool.defaults?.opacity}\n segmentRects={rects}\n {scale}\n />\n </div>\n {:else if activeTool.defaults.type === PdfAnnotationSubtype.SQUIGGLY}\n <div\n style:mix-blend-mode={mixBlendMode}\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Squiggly\n strokeColor={activeTool.defaults?.strokeColor}\n opacity={activeTool.defaults?.opacity}\n segmentRects={rects}\n {scale}\n />\n </div>\n {/if}\n{/if}\n","<script lang=\"ts\">\n import type { AnyPreviewState } from '@embedpdf/plugin-annotation';\n import { PdfAnnotationSubtype } from '@embedpdf/models';\n import Circle from './annotations/Circle.svelte';\n import Square from './annotations/Square.svelte';\n import Polygon from './annotations/Polygon.svelte';\n import Polyline from './annotations/Polyline.svelte';\n import Line from './annotations/Line.svelte';\n import Ink from './annotations/Ink.svelte';\n\n interface PreviewRendererProps {\n preview: AnyPreviewState;\n scale: number;\n }\n\n let { preview, scale }: PreviewRendererProps = $props();\n\n const bounds = $derived(preview.bounds);\n\n const style = $derived({\n left: bounds.origin.x * scale,\n top: bounds.origin.y * scale,\n width: bounds.size.width * scale,\n height: bounds.size.height * scale,\n });\n</script>\n\n{#if preview.type === PdfAnnotationSubtype.CIRCLE}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Circle isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.SQUARE}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Square isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.POLYGON}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Polygon isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.POLYLINE}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Polyline isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.LINE}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Line isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.INK}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Ink isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.FREETEXT}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <!-- Render a simple dashed border preview -->\n <div\n style:width=\"100%\"\n style:height=\"100%\"\n style:border=\"1px dashed {preview.data.fontColor || '#000000'}\"\n style:background-color=\"transparent\"\n ></div>\n </div>\n{/if}\n","<script lang=\"ts\">\n import { useAnnotationPlugin } from '../hooks';\n import type { AnyPreviewState, HandlerServices } from '@embedpdf/plugin-annotation';\n import PreviewRenderer from './PreviewRenderer.svelte';\n\n interface AnnotationPaintLayerProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n }\n\n let { documentId, pageIndex, scale }: AnnotationPaintLayerProps = $props();\n\n const annotationPlugin = useAnnotationPlugin();\n let previews = $state<Map<string, AnyPreviewState>>(new Map());\n\n let fileInputRef: HTMLInputElement | null = $state(null);\n let canvasRef: HTMLCanvasElement | null = $state(null);\n\n const services: HandlerServices = {\n requestFile: ({ accept, onFile }) => {\n if (!fileInputRef) return;\n const input = fileInputRef;\n input.accept = accept;\n input.onchange = (e) => {\n const file = (e.target as HTMLInputElement).files?.[0];\n if (file) {\n onFile(file);\n input.value = '';\n }\n };\n input.click();\n },\n processImage: ({ source, maxWidth, maxHeight, onComplete }) => {\n const canvas = canvasRef;\n if (!canvas || !canvas.getContext) return;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n\n const img = new Image();\n img.crossOrigin = 'Anonymous';\n img.onload = () => {\n let { naturalWidth: width, naturalHeight: height } = img;\n\n // --- SCALING LOGIC ---\n // Calculate the scale factor to fit within maxWidth and maxHeight\n const scaleX = maxWidth ? maxWidth / width : 1;\n const scaleY = maxHeight ? maxHeight / height : 1;\n const scaleFactor = Math.min(scaleX, scaleY, 1); // Ensure we don't scale up\n\n const finalWidth = width * scaleFactor;\n const finalHeight = height * scaleFactor;\n\n canvas.width = finalWidth;\n canvas.height = finalHeight;\n ctx.drawImage(img, 0, 0, finalWidth, finalHeight);\n\n const imageData = ctx.getImageData(0, 0, finalWidth, finalHeight);\n if (typeof source !== 'string') URL.revokeObjectURL(img.src);\n\n onComplete({ imageData, width: finalWidth, height: finalHeight });\n };\n img.src = typeof source === 'string' ? source : URL.createObjectURL(source);\n },\n };\n\n $effect(() => {\n if (!annotationPlugin.plugin) return;\n\n return annotationPlugin.plugin.registerPageHandlers(documentId, pageIndex, scale, {\n services,\n onPreview: (toolId, state) => {\n previews = new Map(previews);\n if (state) {\n previews.set(toolId, state);\n } else {\n previews.delete(toolId);\n }\n },\n });\n });\n</script>\n\n<!-- Hidden DOM elements required by services -->\n<input bind:this={fileInputRef} type=\"file\" style:display=\"none\" />\n<canvas bind:this={canvasRef} style:display=\"none\"></canvas>\n\n<!-- Render any active previews from any tool -->\n{#each Array.from(previews.entries()) as [toolId, preview] (toolId)}\n <PreviewRenderer {preview} {scale} />\n{/each}\n","<script lang=\"ts\">\n import { Rotation, type PdfAnnotationObject } from '@embedpdf/models';\n import { useDocumentState } from '@embedpdf/core/svelte';\n import type { HTMLAttributes } from 'svelte/elements';\n import type {\n AnnotationSelectionMenuProps,\n AnnotationSelectionMenuRenderFn,\n GroupSelectionMenuProps,\n GroupSelectionMenuRenderFn,\n CustomAnnotationRenderer,\n ResizeHandleUI,\n VertexHandleUI,\n } from '../types';\n import Annotations from './Annotations.svelte';\n import TextMarkup from './TextMarkup.svelte';\n import AnnotationPaintLayer from './AnnotationPaintLayer.svelte';\n import type { Snippet } from 'svelte';\n\n type AnnotationLayerProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {\n /** The ID of the document that this layer displays annotations for */\n documentId: string;\n pageIndex: number;\n scale?: number;\n rotation?: number;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: AnnotationSelectionMenuRenderFn;\n /** Snippet for custom selection menu (slot-based approach) */\n selectionMenuSnippet?: Snippet<[AnnotationSelectionMenuProps]>;\n /** Render function for group selection menu (schema-driven approach) */\n groupSelectionMenu?: GroupSelectionMenuRenderFn;\n /** Snippet for custom group selection menu (slot-based approach) */\n groupSelectionMenuSnippet?: Snippet<[GroupSelectionMenuProps]>;\n style?: Record<string, string | number | undefined>;\n /** Customize resize handles */\n resizeUI?: ResizeHandleUI;\n /** Customize vertex handles */\n vertexUI?: VertexHandleUI;\n /** Customize selection outline color */\n selectionOutlineColor?: string;\n /** Customize annotation renderer */\n customAnnotationRenderer?: CustomAnnotationRenderer<PdfAnnotationObject>;\n };\n\n let {\n style,\n documentId,\n pageIndex,\n scale: overrideScale,\n rotation: overrideRotation,\n selectionMenu,\n selectionMenuSnippet,\n groupSelectionMenu,\n groupSelectionMenuSnippet,\n resizeUI,\n vertexUI,\n selectionOutlineColor,\n customAnnotationRenderer,\n ...restProps\n }: AnnotationLayerProps = $props();\n\n const documentState = useDocumentState(() => documentId);\n\n const page = $derived(documentState?.current?.document?.pages?.[pageIndex]);\n const pageWidth = $derived(page?.size?.width ?? 0);\n const pageHeight = $derived(page?.size?.height ?? 0);\n\n const actualScale = $derived(\n overrideScale !== undefined ? overrideScale : (documentState?.current?.scale ?? 1),\n );\n\n const actualRotation = $derived(\n overrideRotation !== undefined\n ? overrideRotation\n : (documentState?.current?.rotation ?? Rotation.Degree0),\n );\n</script>\n\n<div\n id=\"annotation-layer\"\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n {...restProps}\n>\n <Annotations\n {documentId}\n {selectionMenu}\n {selectionMenuSnippet}\n {groupSelectionMenu}\n {groupSelectionMenuSnippet}\n {pageIndex}\n scale={actualScale}\n rotation={actualRotation}\n {pageWidth}\n {pageHeight}\n {resizeUI}\n {vertexUI}\n {selectionOutlineColor}\n {customAnnotationRenderer}\n />\n <TextMarkup {documentId} {pageIndex} scale={actualScale} />\n <AnnotationPaintLayer {documentId} {pageIndex} scale={actualScale} />\n</div>\n"],"names":["useAnnotationCapability","useCapability","AnnotationPlugin","id","useAnnotationPlugin","usePlugin","isMultiSelected","lockAspectRatio","propsClass","outlineOffset","zIndex","selectionOutlineColor","restProps","$","rest_props","$$props","preview","state","proxy","trackedAnnotation","object","annotationCapability","annotationPlugin","permissions","useDocumentPermissions","documentId","gestureBaseRef","gestureBaseRectRef","effectiveIsDraggable","derived","canModifyAnnotations","effectiveIsResizable","guardedOnDoubleClick","annotationProvides","provides","forDocument","currentObject","HANDLE_COLOR","_a","resizeUI","color","VERTEX_COLOR","vertexUI","HANDLE_SIZE","size","VERTEX_SIZE","showOutline","user_effect","set","plugin","handleEvent","event","patch","previewPatches","type","untrack","get","unsubs","onDragChange","onResizeChange","forEach","u","interactionHandles","useInteractionHandles","controller","element","rect","vertices","vertexConfig","extractVertices","constraints","minWidth","minHeight","boundingBox","width","pageWidth","height","pageHeight","maintainAspectRatio","pageRotation","rotation","scale","enabled","onUpdate","transformData","changes","metadata","pageSize","startDrag","annotationIds","startResize","resizeHandle","handle","delta","x","origin","y","updateDrag","updateResize","base","vertexChanges","transformAnnotation","patched","_b","sanitized","deepToRaw","updateAnnotation","pageIndex","commitDrag","commitResize","handleSize","spacing","offsetMode","includeSides","vertexSize","includeVertices","resizeHandles","resize","vertexHandles","shouldShowMenu","selectionMenu","selectionMenuSnippet","menuPlacement","suggestTop","spaceAbove","spaceBelow","div","root","div_1","isSelected","dragProps","left","top","annotation","children","onSelect","key","style","handleStyle","hProps","$$anchor","$$item","exclude_from_object","Component","component","Component_1","div_2","root_6","consequent_1","$$render","alternate_1","consequent_2","vertexStyle","vProps","Component_2","div_3","root_10","consequent_3","alternate_2","consequent_4","$$node","$$action_arg","doublePress","onDouble","$$arg0","menuProps","menuWrapperProps","context","selected","placement","buildMenuProps","result","result_component","spread_props","props","consequent_5","CounterRotate","consequent_8","opacity","resolvedColor","b","root_1","tabindex","onClick","cursor","Object","fromEntries","entries","map","k","v","thickness","r","styles","amplitude","period","svg","svgDataUri","encodeURIComponent","paths","inkList","points","d","i","length","trim","index","path","__pointerdown","$$args","__touchstart","set_attribute","styles_1","strokeStyle","prop","PdfAnnotationBorderStyle","SOLID","$$d","outerW","outerH","Math","max","svgWidth","strokeWidth","svgHeight","dash","DASHED","strokeDashArray","join","rect_1","innerW","innerH","cx","cy","rx","ry","peValue","ellipse","e","$0","strokeColor","x1","start","y1","x2","end","y2","endings","angle","atan2","patching","createEnding","PI","lineEndings","line","transform","filled","styles_2","consequent","path_1","root_2","styles_3","localPts","pathData","first","rest","p","toAngle","a","startRad","endRad","path_2","stroke","allPoints","currentVertex","isPreview","isPreviewing","fill","editorRef","isIOS","focus","selection","getSelection","call","window","range","document","createRange","selectNodeContents","collapse","removeAllRanges","addRange","user_pre_effect","nav","navigator","ios","test","userAgent","platform","maxTouchPoints","computedFontPx","fontSize","needsComp","isEditing","adjustedFontPx","scaleComp","invScalePercent","justify","verticalAlign","PdfVerticalAlignment","Top","Middle","span","$$value","set_text","text","contents","fontColor","standardFontCss","fontFamily","textAlignmentToCss","textAlign","backgroundColor","innerText","scaleFactor","imageUrl","urlRef","handleImageLoad","URL","revokeObjectURL","task","renderAnnotation","options","dpr","devicePixelRatio","wait","blob","url","createObjectURL","ignore","abort","code","PdfErrorCode","Cancelled","message","img","annotationProp","RenderAnnotation","UNDERLINE","hasIRT","dashArray","isUnderline","hitAreaCursor","hitAreaPointerEvents","apply","this","rect_2","$1","alternate","gestureBase","isDraggingRef","isResizingRef","getGroupBox","rects","selectedAnnotations","ta","boundingRectOrEmpty","groupBox","previewGroupBox","newBox","transformType","isMove","isResize","isDraggable","newRect","rawDelta","clampedDelta","newGroupBox","groupSelectionMenu","groupSelectionMenuSnippet","onpointerdown","stopPropagation","root_5","annotations","consequent_6","annotationsProps","selectionCapability","useSelectionCapability","pointerHandlers","usePointerHandlers","allSelectedIds","editingId","currentState","getState","getAnnotationsByPageIndex","getSelectedAnnotationIds","off","onStateChange","handlers","onPointerDown","_","pe","target","currentTarget","deselectAnnotation","handleClick","clear","metaKey","ctrlKey","toggleSelection","selectAnnotation","handleLinkClick","inReplyToId","parentId","parent","find","register","selectedAnnotationsOnPage","filter","anno","includes","areAllSelectedDraggable","every","tool","findToolForAnnotation","interaction","isGroupDraggable","areAllSelectedResizable","isGroupResizable","isResizable","allSelectedOnSamePage","getSelectedAnnotations","mixBlendMode","blendModeToCss","blendMode","PdfBlendMode","Normal","obj","noop","Ink","$2","$3","AnnotationContainer","$$slots","default","Square","Circle","Underline","Strikeout","Squiggly","Highlight","Multiply","Line","linePoints","Polyline","$4","$5","Polygon","FreeText","onDoubleClick","_object","Stamp","Link","isLink","consequent_12","isStamp","consequent_11","isFreeText","consequent_10","isPolygon","consequent_9","isPolyline","alternate_3","isLine","consequent_7","alternate_4","isHighlight","alternate_5","isSquiggly","alternate_6","isStrikeout","alternate_7","alternate_8","isCircle","alternate_9","isSquare","alternate_10","isInk","alternate_11","GroupSelectionBox","consequent_13","boundingRect","activeTool","selectionProvides","onSelectionChange","getHighlightRectsForPage","getBoundingRectForPage","getActiveTool","onActiveToolChange","defaults","PdfAnnotationSubtype","HIGHLIGHT","node_2","root_4","node_4","node_6","root_8","node_8","SQUIGGLY","STRIKEOUT","bounds","data","root_3","root_7","div_4","root_9","styles_4","div_5","root_11","styles_5","div_6","root_13","div_7","styles_6","styles_7","FREETEXT","INK","LINE","POLYLINE","POLYGON","SQUARE","CIRCLE","previews","Map","fileInputRef","canvasRef","services","requestFile","accept","onFile","input","onchange","file","files","value","click","processImage","source","maxWidth","maxHeight","onComplete","canvas","getContext","ctx","Image","crossOrigin","onload","naturalWidth","naturalHeight","scaleX","scaleY","min","finalWidth","finalHeight","drawImage","imageData","getImageData","src","registerPageHandlers","onPreview","toolId","delete","input_1","first_child","fragment","display","canvas_1","Array","from","PreviewRenderer","$$array","documentState","useDocumentState","page","_c","current","pages","actualScale","actualRotation","Rotation","Degree0","attribute_effect","Annotations","node","TextMarkup","node_1","AnnotationPaintLayer","getDocumentId","capability","initialDocumentState","scopedProvides","docId","scope","newState"],"mappings":"8sBAQaA,EAAA,IAAgCC,gBAAgCC,EAAAA,iBAAiBC,IACjFC,EAAA,IAA4BC,YAA4BH,EAAAA,iBAAiBC,6KCkBlF,IAAAG,gCAAkB,GAGlBC,gCAAkB,GAEXC,qBAAa,IAIpBC,6BAAgB,GAGhBC,sBAAS,IAGTC,qCAAwB,WAErBC,EAAQC,EAAAC,WAAAC,EAAA,uZAGTC,EAAUH,EAAAI,MAAMJ,EAAAK,MAAAH,EAAAI,kBAAsBC,SACtCC,EAAuBrB,IACrB,MAAAsB,EAAmBlB,IACnBmB,EAAcC,EAAAA,uBAAsB,IAAAT,EAAAU,gBACtCC,EAAiBb,EAAAI,MAAiB,MAClCU,EAAqBd,EAAAI,MAAoB,MAGvC,MAAAW,EAAoBf,EAAAgB,QAAA,IACxBN,EAAYO,sCAAwCxB,KAEhDyB,EAAoBlB,EAAAgB,QAAA,IACxBN,EAAYO,sCAAwCxB,KAIhD0B,EAAoBnB,EAAAgB,QAAA,IACxBN,EAAYO,2DAAwD,GAIhEG,EAAkBpB,EAAAgB,QAAA,IACtBR,EAAqBa,SAAWb,EAAqBa,SAASC,YAAWpB,EAAAU,YAAe,MAGtF,IAAAW,sBACFpB,GAAiC,IAAAD,EAAAI,kBAAAC,gBAAWJ,wBAA8BI,cAItEiB,EAAYxB,EAAAgB,QAAA,WAAA,OAAA,OAAAS,EAAAvB,EAAAwB,mBAAsBC,QAAS,YAC3CC,EAAY5B,EAAAgB,QAAA,WAAA,OAAA,OAAAS,EAAAvB,EAAA2B,mBAAsBF,QAAS,YAC3CG,EAAW9B,EAAAgB,QAAA,WAAA,OAAA,OAAAS,EAAAv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C,EAAA,oGAAiCR,MAC3CS,kBAAoB,oGAAiCT,cAtBvD7c,cAAAA,UAFO,6ZrBtDsBud,IACtB,MAAAC,EAAatlB,QAEfiB,EAAQJ,EAAAI,MAAAJ,EAAAK,MAAgCqkB,EAAAA,yBAGtC,MAAA9jB,YAAsB4jB,GAGtBG,EAAA3kB,EAAAgB,QAAA,IACJyjB,EAAWpjB,gBAAYT,GAAa6jB,EAAWpjB,SAASC,kBAAYV,IAAc,aAGpFZ,EAAAkC,uBACQb,EAAWojB,EAAWpjB,SACtBujB,QAAQhkB,OAETS,IAAaujB,cAChB5kB,EAAAmC,IAAA/B,EAAQskB,EAAAA,wBAAA,GAIJ,MAAAG,EAAQxjB,EAASC,YAAYsjB,GAM5B,aAHPxkB,EAAQykB,EAAMjN,YAAA,GAGPiN,EAAM7M,cAAe8M,IAC1B9kB,EAAAmC,IAAA/B,EAAQ0kB,GAAA,QAKN,YAAAzjB,gBACKsjB,EACT,EACI,SAAAvkB,gBACKA,EACT"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/svelte/context/renderer-registry.svelte.ts","../../src/svelte/components/RendererRegistryProvider.svelte","../../src/svelte/hooks/use-annotation.svelte.ts","../../src/svelte/components/AnnotationContainer.svelte","../../src/svelte/components/text-markup/Highlight.svelte","../../src/svelte/components/text-markup/Underline.svelte","../../src/svelte/components/text-markup/Strikeout.svelte","../../src/svelte/components/text-markup/Squiggly.svelte","../../src/svelte/components/annotations/Ink.svelte","../../src/svelte/components/annotations/Square.svelte","../../src/svelte/components/annotations/Circle.svelte","../../src/svelte/components/annotations/Line.svelte","../../src/svelte/components/annotations/Polyline.svelte","../../src/svelte/components/annotations/Polygon.svelte","../../src/svelte/components/annotations/FreeText.svelte","../../src/svelte/components/RenderAnnotation.svelte","../../src/svelte/components/annotations/Stamp.svelte","../../src/svelte/components/annotations/Link.svelte","../../src/svelte/components/GroupSelectionBox.svelte","../../src/svelte/components/Annotations.svelte","../../src/svelte/components/TextMarkup.svelte","../../src/svelte/components/PreviewRenderer.svelte","../../src/svelte/components/AnnotationPaintLayer.svelte","../../src/svelte/index.ts","../../src/svelte/components/AnnotationLayer.svelte"],"sourcesContent":["import { getContext, setContext } from 'svelte';\nimport type {\n BoxedAnnotationRenderer,\n AnnotationRendererEntry,\n AnnotationRendererProps,\n} from './types';\nimport type { PdfAnnotationObject } from '@embedpdf/models';\nimport type { Component } from 'svelte';\n\n/**\n * Annotation Renderer Registry\n *\n * Allows external plugins to register custom annotation renderers\n * that integrate with the annotation layer.\n */\nexport interface AnnotationRendererRegistry {\n register(entries: BoxedAnnotationRenderer[]): () => void;\n getAll(): BoxedAnnotationRenderer[];\n}\n\nconst REGISTRY_KEY = Symbol('AnnotationRendererRegistry');\n\nexport function createRendererRegistry(): AnnotationRendererRegistry {\n let renderers = $state<BoxedAnnotationRenderer[]>([]);\n\n return {\n register(entries) {\n const ids = new Set(entries.map((e) => e.id));\n // Add new, replace existing by id\n renderers = [...renderers.filter((r) => !ids.has(r.id)), ...entries];\n // Return cleanup function\n return () => {\n renderers = renderers.filter((r) => !entries.some((e) => e.id === r.id));\n };\n },\n getAll() {\n return renderers;\n },\n };\n}\n\nexport function provideRendererRegistry(): AnnotationRendererRegistry {\n const registry = createRendererRegistry();\n setContext(REGISTRY_KEY, registry);\n return registry;\n}\n\nexport function getRendererRegistry(): AnnotationRendererRegistry | null {\n return getContext<AnnotationRendererRegistry>(REGISTRY_KEY) ?? null;\n}\n\n/**\n * Factory to create a boxed renderer from a typed entry.\n */\nexport function createRenderer<T extends PdfAnnotationObject>(\n entry: AnnotationRendererEntry<T>,\n): BoxedAnnotationRenderer {\n return {\n id: entry.id,\n matches: entry.matches,\n component: entry.component as Component<AnnotationRendererProps>,\n };\n}\n\n// Re-export types for convenience\nexport type { AnnotationRendererProps, AnnotationRendererEntry, BoxedAnnotationRenderer };\n","<script lang=\"ts\">\n import { provideRendererRegistry } from '../context';\n import type { Snippet } from 'svelte';\n\n let { children }: { children: Snippet } = $props();\n\n provideRendererRegistry();\n</script>\n\n{@render children()}\n","import {\n AnnotationPlugin,\n AnnotationDocumentState,\n initialDocumentState,\n AnnotationScope,\n} from '@embedpdf/plugin-annotation';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useAnnotationCapability = () => useCapability<AnnotationPlugin>(AnnotationPlugin.id);\nexport const useAnnotationPlugin = () => usePlugin<AnnotationPlugin>(AnnotationPlugin.id);\n\n// Define the return type explicitly to maintain type safety\ninterface UseAnnotationReturn {\n provides: AnnotationScope | null;\n state: AnnotationDocumentState;\n}\n\n/**\n * Hook for annotation state for a specific document\n * @param getDocumentId Document ID getter function\n */\nexport const useAnnotation = (getDocumentId: () => string | null): UseAnnotationReturn => {\n const capability = useAnnotationCapability();\n\n let state = $state<AnnotationDocumentState>(initialDocumentState());\n\n // Reactive documentId\n const documentId = $derived(getDocumentId());\n\n // Scoped capability for current docId\n const scopedProvides = $derived(\n capability.provides && documentId ? capability.provides.forDocument(documentId) : null,\n );\n\n $effect(() => {\n const provides = capability.provides;\n const docId = documentId;\n\n if (!provides || !docId) {\n state = initialDocumentState();\n return;\n }\n\n const scope = provides.forDocument(docId);\n\n // Get initial state\n state = scope.getState();\n\n // Subscribe to state changes for THIS docId\n return scope.onStateChange((newState) => {\n state = newState;\n });\n });\n\n return {\n get provides() {\n return scopedProvides;\n },\n get state() {\n return state;\n },\n };\n};\n","<script lang=\"ts\" generics=\"T extends PdfAnnotationObject\">\n import type { PdfAnnotationObject, Rect } from '@embedpdf/models';\n import { useDocumentPermissions } from '@embedpdf/core/svelte';\n import { useAnnotationCapability, useAnnotationPlugin } from '../hooks';\n import type { AnnotationContainerProps } from './types';\n import {\n useInteractionHandles,\n doublePress,\n CounterRotate,\n deepToRaw,\n type SelectionMenuPlacement,\n type MenuWrapperProps,\n } from '@embedpdf/utils/svelte';\n import type { Snippet } from 'svelte';\n import { untrack } from 'svelte';\n import { type AnnotationSelectionContext, type AnnotationSelectionMenuProps } from '../types';\n\n let {\n documentId,\n scale,\n pageIndex,\n rotation,\n pageWidth,\n pageHeight,\n trackedAnnotation,\n children,\n isSelected,\n isMultiSelected = false,\n isDraggable,\n isResizable,\n lockAspectRatio = false,\n style,\n class: propsClass = '',\n vertexConfig,\n selectionMenu,\n selectionMenuSnippet,\n outlineOffset = 1,\n onDoubleClick,\n onSelect,\n zIndex = 1,\n resizeUI,\n vertexUI,\n selectionOutlineColor = '#007ACC',\n customAnnotationRenderer,\n ...restProps\n }: AnnotationContainerProps<T> = $props();\n\n let preview = $state<T>(trackedAnnotation.object);\n let annotationCapability = useAnnotationCapability();\n const annotationPlugin = useAnnotationPlugin();\n const permissions = useDocumentPermissions(() => documentId);\n let gestureBaseRef = $state<T | null>(null);\n let gestureBaseRectRef = $state<Rect | null>(null);\n\n // When multi-selected, disable individual drag/resize - GroupSelectionBox handles it\n const effectiveIsDraggable = $derived(\n permissions.canModifyAnnotations && isDraggable && !isMultiSelected,\n );\n const effectiveIsResizable = $derived(\n permissions.canModifyAnnotations && isResizable && !isMultiSelected,\n );\n\n // Wrap onDoubleClick to respect permissions\n const guardedOnDoubleClick = $derived(\n permissions.canModifyAnnotations && onDoubleClick ? onDoubleClick : undefined,\n );\n\n // Get scoped API for this document\n const annotationProvides = $derived(\n annotationCapability.provides ? annotationCapability.provides.forDocument(documentId) : null,\n );\n\n let currentObject = $derived<T>(\n preview ? { ...trackedAnnotation.object, ...preview } : trackedAnnotation.object,\n );\n\n // UI constants\n const HANDLE_COLOR = $derived(resizeUI?.color ?? '#007ACC');\n const VERTEX_COLOR = $derived(vertexUI?.color ?? '#007ACC');\n const HANDLE_SIZE = $derived(resizeUI?.size ?? 12);\n const VERTEX_SIZE = $derived(vertexUI?.size ?? 12);\n\n // Determine if we should show the outline\n // When multi-selected, don't show individual outlines - GroupSelectionBox shows the group outline\n const showOutline = $derived(isSelected && !isMultiSelected);\n\n // Sync preview with tracked annotation when it changes\n $effect(() => {\n if (trackedAnnotation.object) {\n preview = trackedAnnotation.object;\n }\n });\n\n // Subscribe to unified drag/resize changes - plugin sends pre-computed patches!\n // ALL preview updates come through here (primary, attached links, multi-select)\n $effect(() => {\n const plugin = annotationPlugin.plugin;\n if (!plugin) return;\n\n const id = trackedAnnotation.object.id;\n\n const handleEvent = (event: {\n documentId: string;\n type: string;\n previewPatches?: Record<string, any>;\n }) => {\n if (event.documentId !== documentId) return;\n const patch = event.previewPatches?.[id];\n if (event.type === 'update' && patch) {\n // Use untrack to prevent tracking the read of preview (like Vue's toRaw)\n preview = { ...untrack(() => preview), ...patch } as T;\n } else if (event.type === 'cancel') {\n preview = trackedAnnotation.object;\n }\n };\n\n const unsubs = [plugin.onDragChange(handleEvent), plugin.onResizeChange(handleEvent)];\n\n return () => unsubs.forEach((u) => u());\n });\n\n const interactionHandles = useInteractionHandles(() => ({\n controller: {\n element: currentObject.rect,\n vertices: vertexConfig?.extractVertices(currentObject),\n constraints: {\n minWidth: 10,\n minHeight: 10,\n boundingBox: { width: pageWidth, height: pageHeight },\n },\n maintainAspectRatio: lockAspectRatio,\n pageRotation: rotation,\n scale: scale,\n // Disable interaction handles when multi-selected\n enabled: isSelected && !isMultiSelected,\n onUpdate: (event) => {\n if (!event.transformData?.type || isMultiSelected) return;\n\n const plugin = annotationPlugin.plugin;\n if (!plugin) return;\n\n const { type, changes, metadata } = event.transformData;\n const id = trackedAnnotation.object.id;\n const pageSize = { width: pageWidth, height: pageHeight };\n\n // Gesture start - initialize plugin drag/resize\n if (event.state === 'start') {\n gestureBaseRectRef = trackedAnnotation.object.rect;\n gestureBaseRef = trackedAnnotation.object; // For vertex edit\n\n if (type === 'move') {\n plugin.startDrag(documentId, { annotationIds: [id], pageSize });\n } else if (type === 'resize') {\n plugin.startResize(documentId, {\n annotationIds: [id],\n pageSize,\n resizeHandle: metadata?.handle ?? 'se',\n });\n }\n }\n\n // Gesture update - call plugin, preview comes from subscription\n if (changes.rect && gestureBaseRectRef) {\n if (type === 'move') {\n const delta = {\n x: changes.rect.origin.x - gestureBaseRectRef.origin.x,\n y: changes.rect.origin.y - gestureBaseRectRef.origin.y,\n };\n plugin.updateDrag(documentId, delta);\n } else if (type === 'resize') {\n plugin.updateResize(documentId, changes.rect);\n }\n }\n\n // Vertex edit - handle directly (no attached link handling needed)\n if (type === 'vertex-edit' && changes.vertices && vertexConfig) {\n const base = gestureBaseRef ?? trackedAnnotation.object;\n const vertexChanges = vertexConfig.transformAnnotation(base, changes.vertices);\n const patched = annotationCapability.provides?.transformAnnotation<T>(base, {\n type,\n changes: vertexChanges as Partial<T>,\n metadata,\n });\n if (patched) {\n preview = { ...preview, ...patched };\n if (event.state === 'end') {\n const sanitized = deepToRaw(patched);\n annotationProvides?.updateAnnotation(pageIndex, id, sanitized);\n }\n }\n }\n\n // Gesture end - commit\n if (event.state === 'end') {\n gestureBaseRectRef = null;\n gestureBaseRef = null;\n if (type === 'move') plugin.commitDrag(documentId);\n else if (type === 'resize') plugin.commitResize(documentId);\n }\n },\n },\n resizeUI: {\n handleSize: HANDLE_SIZE,\n spacing: outlineOffset,\n offsetMode: 'outside',\n includeSides: lockAspectRatio ? false : true,\n zIndex: zIndex + 1,\n },\n vertexUI: {\n vertexSize: VERTEX_SIZE,\n zIndex: zIndex + 2,\n },\n includeVertices: vertexConfig ? true : false,\n }));\n\n // Derived accessors for template\n const resizeHandles = $derived(interactionHandles.resize);\n const vertexHandles = $derived(interactionHandles.vertices);\n\n // --- Selection Menu Logic ---\n\n // Check if we should show menu - hide when multi-selected\n const shouldShowMenu = $derived(\n isSelected && !isMultiSelected && (!!selectionMenu || !!selectionMenuSnippet),\n );\n\n // Build context object for selection menu\n function buildContext(): AnnotationSelectionContext {\n return {\n type: 'annotation',\n annotation: trackedAnnotation,\n pageIndex,\n };\n }\n\n // Placement hints\n const menuPlacement: SelectionMenuPlacement = {\n suggestTop: false,\n spaceAbove: 0,\n spaceBelow: 0,\n };\n\n // Build menu props\n function buildMenuProps(\n rect: Rect,\n menuWrapperProps: MenuWrapperProps,\n ): AnnotationSelectionMenuProps {\n return {\n context: buildContext(),\n selected: isSelected,\n rect,\n placement: menuPlacement,\n menuWrapperProps,\n };\n }\n</script>\n\n<div data-no-interaction>\n <div\n {...effectiveIsDraggable && isSelected ? interactionHandles.dragProps : {}}\n use:doublePress={{ onDouble: guardedOnDoubleClick }}\n style:position=\"absolute\"\n style:left=\"{currentObject.rect.origin.x * scale}px\"\n style:top=\"{currentObject.rect.origin.y * scale}px\"\n style:width=\"{currentObject.rect.size.width * scale}px\"\n style:height=\"{currentObject.rect.size.height * scale}px\"\n style:outline={showOutline ? `1px solid ${selectionOutlineColor}` : 'none'}\n style:outline-offset={showOutline ? `${outlineOffset}px` : '0px'}\n style:pointer-events={isSelected && !isMultiSelected ? 'auto' : 'none'}\n style:touch-action=\"none\"\n style:cursor={isSelected && effectiveIsDraggable ? 'move' : 'default'}\n style:z-index={zIndex}\n style={style || ''}\n class={propsClass}\n {...restProps}\n >\n {#if customAnnotationRenderer}\n {@render customAnnotationRenderer?.({\n annotation: currentObject,\n children: children as Snippet,\n isSelected,\n scale,\n rotation,\n pageWidth,\n pageHeight,\n pageIndex,\n onSelect,\n })}\n {:else}\n {@render children(currentObject)}\n {/if}\n\n <!-- Resize handles - only when single-selected -->\n {#if isSelected && effectiveIsResizable}\n {#each resizeHandles as { key, style: handleStyle, ...hProps } (key)}\n {#if resizeUI?.component}\n {@const Component = resizeUI.component}\n <Component {...hProps} backgroundColor={HANDLE_COLOR} />\n {:else}\n <div {...hProps} style=\"{handleStyle}; background-color: {HANDLE_COLOR};\"></div>\n {/if}\n {/each}\n {/if}\n\n <!-- Vertex handles - only when single-selected -->\n {#if isSelected && permissions.canModifyAnnotations && !isMultiSelected}\n {#each vertexHandles as { key, style: vertexStyle, ...vProps } (key)}\n {#if vertexUI?.component}\n {@const Component = vertexUI.component}\n <Component {...vProps} backgroundColor={VERTEX_COLOR} />\n {:else}\n <div {...vProps} style=\"{vertexStyle}; background-color: {VERTEX_COLOR};\"></div>\n {/if}\n {/each}\n {/if}\n </div>\n\n <!-- Selection Menu: Supports BOTH render function and snippet - hide when multi-selected -->\n {#if shouldShowMenu}\n <CounterRotate\n rect={{\n origin: {\n x: currentObject.rect.origin.x * scale,\n y: currentObject.rect.origin.y * scale,\n },\n size: {\n width: currentObject.rect.size.width * scale,\n height: currentObject.rect.size.height * scale,\n },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(rect, menuWrapperProps)}\n {#if selectionMenu}\n <!-- Priority 1: Render function (schema-driven) -->\n {@const result = selectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if selectionMenuSnippet}\n <!-- Priority 2: Snippet (manual customization) -->\n {@render selectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n</div>\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface HighlightProps {\n /** Stroke/markup color */\n strokeColor?: string;\n opacity?: number;\n segmentRects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n strokeColor,\n opacity = 0.5,\n segmentRects,\n rect,\n scale,\n onClick,\n style,\n }: HighlightProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#FFFF00');\n</script>\n\n{#each segmentRects as b, i (i)}\n <div\n role=\"button\"\n tabindex={onClick ? 0 : -1}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{(rect ? b.origin.x - rect.origin.x : b.origin.x) * scale}px\"\n style:top=\"{(rect ? b.origin.y - rect.origin.y : b.origin.y) * scale}px\"\n style:width=\"{b.size.width * scale}px\"\n style:height=\"{b.size.height * scale}px\"\n style:background={resolvedColor}\n style:opacity\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? 1 : undefined}\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n ></div>\n{/each}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface UnderlineProps {\n /** Stroke/markup color */\n strokeColor?: string;\n opacity?: number;\n segmentRects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n strokeColor,\n opacity = 0.5,\n segmentRects,\n rect,\n scale,\n onClick,\n style,\n }: UnderlineProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#FFFF00');\n const thickness = $derived(2 * scale); // 2 CSS px at 100% zoom\n</script>\n\n{#each segmentRects as r, i (i)}\n <div\n role=\"button\"\n tabindex={onClick ? 0 : -1}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{(rect ? r.origin.x - rect.origin.x : r.origin.x) * scale}px\"\n style:top=\"{(rect ? r.origin.y - rect.origin.y : r.origin.y) * scale}px\"\n style:width=\"{r.size.width * scale}px\"\n style:height=\"{r.size.height * scale}px\"\n style:background=\"transparent\"\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? 1 : 0}\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n >\n <!-- Visual underline -->\n <div\n style:position=\"absolute\"\n style:left=\"0\"\n style:bottom=\"0\"\n style:width=\"100%\"\n style:height=\"{thickness}px\"\n style:background={resolvedColor}\n style:opacity\n style:pointer-events=\"none\"\n ></div>\n </div>\n{/each}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface StrikeoutProps {\n /** Stroke/markup color */\n strokeColor?: string;\n opacity?: number;\n segmentRects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n strokeColor,\n opacity = 0.5,\n segmentRects,\n rect,\n scale,\n onClick,\n style,\n }: StrikeoutProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#FFFF00');\n const thickness = $derived(2 * scale);\n</script>\n\n{#each segmentRects as r, i (i)}\n <div\n role=\"button\"\n tabindex={onClick ? 0 : -1}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{(rect ? r.origin.x - rect.origin.x : r.origin.x) * scale}px\"\n style:top=\"{(rect ? r.origin.y - rect.origin.y : r.origin.y) * scale}px\"\n style:width=\"{r.size.width * scale}px\"\n style:height=\"{r.size.height * scale}px\"\n style:background=\"transparent\"\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? 1 : 0}\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n >\n <!-- Visual strikeout line -->\n <div\n style:position=\"absolute\"\n style:left=\"0\"\n style:top=\"50%\"\n style:width=\"100%\"\n style:height=\"{thickness}px\"\n style:background={resolvedColor}\n style:opacity\n style:transform=\"translateY(-50%)\"\n style:pointer-events=\"none\"\n ></div>\n </div>\n{/each}\n","<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n\n interface SquigglyProps {\n /** Stroke/markup color */\n strokeColor?: string;\n opacity?: number;\n segmentRects: Rect[];\n rect?: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n strokeColor,\n opacity = 0.5,\n segmentRects,\n rect,\n scale,\n onClick,\n style,\n }: SquigglyProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#FFFF00');\n const amplitude = $derived(2 * scale); // wave height\n const period = $derived(6 * scale); // wave length\n\n const svg =\n $derived(`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${period}\" height=\"${amplitude * 2}\" viewBox=\"0 0 ${period} ${amplitude * 2}\">\n <path d=\"M0 ${amplitude} Q ${period / 4} 0 ${period / 2} ${amplitude} T ${period} ${amplitude}\"\n fill=\"none\" stroke=\"${resolvedColor}\" stroke-width=\"${amplitude}\" stroke-linecap=\"round\"/>\n </svg>`);\n\n // Completely escape the SVG markup\n const svgDataUri = $derived(`url(\"data:image/svg+xml;utf8,${encodeURIComponent(svg)}\")`);\n</script>\n\n{#each segmentRects as r, i (i)}\n <div\n role=\"button\"\n tabindex={onClick ? 0 : -1}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:position=\"absolute\"\n style:left=\"{(rect ? r.origin.x - rect.origin.x : r.origin.x) * scale}px\"\n style:top=\"{(rect ? r.origin.y - rect.origin.y : r.origin.y) * scale}px\"\n style:width=\"{r.size.width * scale}px\"\n style:height=\"{r.size.height * scale}px\"\n style:background=\"transparent\"\n style:pointer-events={onClick ? 'auto' : 'none'}\n style:cursor={onClick ? 'pointer' : 'default'}\n style:z-index={onClick ? 1 : 0}\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n >\n <!-- Visual squiggly line -->\n <div\n style:position=\"absolute\"\n style:left=\"0\"\n style:bottom=\"0\"\n style:width=\"100%\"\n style:height=\"{amplitude * 2}px\"\n style:background-image={svgDataUri}\n style:background-repeat=\"repeat-x\"\n style:background-size=\"{period}px {amplitude * 2}px\"\n style:opacity\n style:pointer-events=\"none\"\n ></div>\n </div>\n{/each}\n","<script lang=\"ts\">\n import type { PdfInkListObject, Rect } from '@embedpdf/models';\n\n interface InkProps {\n isSelected: boolean;\n /** Stroke color */\n strokeColor?: string;\n opacity?: number;\n strokeWidth: number;\n inkList: PdfInkListObject[];\n rect: Rect;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n }\n\n let {\n isSelected,\n strokeColor,\n opacity = 1,\n strokeWidth,\n inkList,\n rect,\n scale,\n onClick,\n }: InkProps = $props();\n\n const resolvedColor = $derived(strokeColor ?? '#000000');\n\n // derived SVG path data\n const paths = $derived.by(() =>\n inkList.map(({ points }) => {\n let d = '';\n for (let i = 0; i < points.length; i++) {\n const { x, y } = points[i];\n const lx = x - rect.origin.x;\n const ly = y - rect.origin.y;\n d += (i === 0 ? 'M' : 'L') + lx + ' ' + ly + ' ';\n }\n return d.trim();\n }),\n );\n\n const width = $derived(rect.size.width * scale);\n const height = $derived(rect.size.height * scale);\n</script>\n\n<svg\n style=\"position: absolute; z-index: 2; overflow: visible; pointer-events: none;\"\n style:width={`${width}px`}\n style:height={`${height}px`}\n {width}\n {height}\n viewBox={`0 0 ${rect.size.width} ${rect.size.height}`}\n>\n {#each paths as d, i (i)}\n <path\n {d}\n fill=\"none\"\n {opacity}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected ? 'none' : 'visibleStroke'}\n style:stroke={resolvedColor}\n style:stroke-width={strokeWidth}\n style:stroke-linecap=\"round\"\n style:stroke-linejoin=\"round\"\n />\n {/each}\n</svg>\n","<!-- Square.svelte -->\n<script lang=\"ts\">\n import type { Rect } from '@embedpdf/models';\n import { PdfAnnotationBorderStyle } from '@embedpdf/models';\n\n interface SquareProps {\n isSelected: boolean;\n color?: string; // fill color (defaults to black)\n strokeColor?: string; // stroke color (defaults to fill when omitted)\n opacity?: number; // 0–1\n strokeWidth: number; // PDF units\n strokeStyle?: PdfAnnotationBorderStyle;\n strokeDashArray?: number[];\n rect: Rect; // bbox includes stroke\n scale: number; // page zoom\n onClick?: (e: MouseEvent | TouchEvent) => void;\n }\n\n let {\n isSelected,\n color = '#000000',\n strokeColor,\n opacity = 1,\n strokeWidth,\n strokeStyle = PdfAnnotationBorderStyle.SOLID,\n strokeDashArray,\n rect,\n scale,\n onClick,\n }: SquareProps = $props();\n\n // Geometry helpers — compute inner rect so visual fill matches preview\n const { width, height, x, y } = $derived.by(() => {\n const outerW = rect.size.width;\n const outerH = rect.size.height;\n const innerW = Math.max(outerW - strokeWidth, 0);\n const innerH = Math.max(outerH - strokeWidth, 0);\n return {\n width: innerW,\n height: innerH,\n x: strokeWidth / 2,\n y: strokeWidth / 2,\n };\n });\n\n const svgWidth = $derived((width + strokeWidth) * scale);\n const svgHeight = $derived((height + strokeWidth) * scale);\n\n const dash = $derived(\n strokeStyle === PdfAnnotationBorderStyle.DASHED ? strokeDashArray?.join(',') : undefined,\n );\n</script>\n\n<svg\n style=\"position: absolute; pointer-events: none; z-index: 2;\"\n style:width={`${svgWidth}px`}\n style:height={`${svgHeight}px`}\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${width + strokeWidth} ${height + strokeWidth}`}\n>\n <rect\n {x}\n {y}\n {width}\n {height}\n fill={color}\n {opacity}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected\n ? 'none'\n : color === 'transparent'\n ? 'visibleStroke'\n : 'visible'}\n style:stroke={strokeColor ?? color}\n style:stroke-width={strokeWidth}\n style:stroke-dasharray={dash}\n />\n</svg>\n","<script lang=\"ts\">\n import { PdfAnnotationBorderStyle, type Rect } from '@embedpdf/models';\n\n interface CircleProps {\n /** Whether the annotation is selected */\n isSelected: boolean;\n /** Fill colour – defaults to PDFium’s black if omitted */\n color?: string;\n /** Stroke colour – defaults to same as fill when omitted */\n strokeColor?: string;\n /** 0 – 1 */\n opacity?: number;\n /** Stroke width in PDF units */\n strokeWidth: number;\n /** Stroke type – defaults to solid when omitted */\n strokeStyle?: PdfAnnotationBorderStyle;\n /** Stroke dash array – defaults to undefined when omitted */\n strokeDashArray?: number[];\n /** Bounding box of the annotation */\n rect: Rect;\n /** Current page zoom factor */\n scale: number;\n /** Pointer/touch handler (used for selection) */\n onClick?: (e: PointerEvent | TouchEvent) => void;\n }\n\n let {\n isSelected,\n color = '#000000',\n strokeColor,\n opacity = 1,\n strokeWidth,\n strokeStyle = PdfAnnotationBorderStyle.SOLID,\n strokeDashArray,\n rect,\n scale,\n onClick,\n }: CircleProps = $props();\n\n const { width, height, cx, cy, rx, ry } = $derived.by(() => {\n // Full bounding box *includes* stroke width.\n const outerW = rect.size.width;\n const outerH = rect.size.height;\n\n // Remove the stroke so the visible fill matches the preview.\n const innerW = Math.max(outerW - strokeWidth, 0);\n const innerH = Math.max(outerH - strokeWidth, 0);\n\n return {\n width: outerW,\n height: outerH,\n // Centre of the fill sits strokeWidth/2 in from the edges\n cx: strokeWidth / 2 + innerW / 2,\n cy: strokeWidth / 2 + innerH / 2,\n rx: innerW / 2,\n ry: innerH / 2,\n };\n });\n\n let svgWidth = $derived(width * scale);\n let svgHeight = $derived(height * scale);\n\n let peValue = $derived(\n isSelected ? 'none' : color === 'transparent' ? 'visibleStroke' : 'visible',\n );\n</script>\n\n<svg\n style:position=\"absolute\"\n style:width={`${svgWidth}px`}\n style:height={`${svgHeight}px`}\n style:pointer-events=\"none\"\n style:z-index=\"2\"\n {svgWidth}\n {svgHeight}\n viewBox={`0 0 ${width} ${height}`}\n>\n <ellipse\n {cx}\n {cy}\n {rx}\n {ry}\n fill={color}\n {opacity}\n onpointerdown={(e) => onClick?.(e)}\n ontouchstart={(e) => onClick?.(e)}\n style:cursor={isSelected ? 'move' : 'pointer'}\n pointer-events={peValue}\n stroke={strokeColor ?? color}\n stroke-width={strokeWidth}\n stroke-dasharray={strokeStyle === PdfAnnotationBorderStyle.DASHED\n ? strokeDashArray?.join(',')\n : undefined}\n />\n</svg>\n","<!-- Line.svelte -->\n<script lang=\"ts\">\n import type { Rect, LinePoints, LineEndings } from '@embedpdf/models';\n import { PdfAnnotationBorderStyle } from '@embedpdf/models';\n import { patching } from '@embedpdf/plugin-annotation';\n\n interface LineProps {\n color?: string; // interior color\n opacity?: number; // 0–1\n strokeWidth: number; // PDF units\n strokeColor?: string;\n strokeStyle?: PdfAnnotationBorderStyle;\n strokeDashArray?: number[];\n rect: Rect;\n linePoints: LinePoints;\n lineEndings?: LineEndings;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n isSelected: boolean;\n }\n\n let {\n color = 'transparent',\n opacity = 1,\n strokeWidth,\n strokeColor = '#000000',\n strokeStyle = PdfAnnotationBorderStyle.SOLID,\n strokeDashArray,\n rect,\n linePoints,\n lineEndings,\n scale,\n onClick,\n isSelected,\n }: LineProps = $props();\n\n // Localize endpoints into the annotation's bbox\n const x1 = $derived(linePoints.start.x - rect.origin.x);\n const y1 = $derived(linePoints.start.y - rect.origin.y);\n const x2 = $derived(linePoints.end.x - rect.origin.x);\n const y2 = $derived(linePoints.end.y - rect.origin.y);\n\n // Arrow-head / butt endings via shared factory\n const endings = $derived.by(() => {\n const angle = Math.atan2(y2 - y1, x2 - x1);\n return {\n start: patching.createEnding(lineEndings?.start, strokeWidth, angle + Math.PI, x1, y1),\n end: patching.createEnding(lineEndings?.end, strokeWidth, angle, x2, y2),\n };\n });\n\n // Absolute placement + scaling\n const width = $derived(rect.size.width * scale);\n const height = $derived(rect.size.height * scale);\n\n // Dashed stroke only when requested\n const dash = $derived(\n strokeStyle === PdfAnnotationBorderStyle.DASHED ? strokeDashArray?.join(',') : undefined,\n );\n</script>\n\n<svg\n style=\"position: absolute; z-index: 2; overflow: visible; pointer-events: none;\"\n style:width={`${width}px`}\n style:height={`${height}px`}\n {width}\n {height}\n viewBox={`0 0 ${rect.size.width} ${rect.size.height}`}\n>\n <!-- Main line -->\n <line\n {x1}\n {y1}\n {x2}\n {y2}\n {opacity}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected ? 'none' : 'visibleStroke'}\n style:stroke={strokeColor}\n style:stroke-width={strokeWidth}\n style:stroke-linecap=\"butt\"\n style:stroke-dasharray={dash}\n />\n\n <!-- Optional arrowheads / butt caps -->\n {#if endings.start}\n <path\n d={endings.start.d}\n transform={endings.start.transform}\n onpointerdown={onClick}\n ontouchstart={onClick}\n stroke={strokeColor}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:stroke-width={strokeWidth}\n style:stroke-linecap=\"butt\"\n style:pointer-events={isSelected\n ? 'none'\n : endings.start.filled\n ? 'visible'\n : 'visibleStroke'}\n style:stroke-dasharray={dash}\n fill={endings.start.filled ? color : 'none'}\n />\n {/if}\n\n {#if endings.end}\n <path\n d={endings.end.d}\n transform={endings.end.transform}\n stroke={strokeColor}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:stroke-width={strokeWidth}\n style:stroke-linecap=\"butt\"\n style:pointer-events={isSelected ? 'none' : endings.end.filled ? 'visible' : 'visibleStroke'}\n style:stroke-dasharray={dash}\n fill={endings.end.filled ? color : 'none'}\n />\n {/if}\n</svg>\n","<!-- Polyline.svelte -->\n<script lang=\"ts\">\n import type { Rect, Position, LineEndings } from '@embedpdf/models';\n import { patching } from '@embedpdf/plugin-annotation';\n\n interface PolylineProps {\n rect: Rect;\n vertices: Position[];\n color?: string;\n strokeColor?: string;\n opacity?: number;\n strokeWidth: number;\n scale: number;\n isSelected: boolean;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n /** Optional start & end endings */\n lineEndings?: LineEndings;\n }\n\n let {\n rect,\n vertices,\n color = 'transparent',\n strokeColor = '#000000',\n opacity = 1,\n strokeWidth,\n scale,\n isSelected,\n onClick,\n lineEndings,\n }: PolylineProps = $props();\n\n // Localize vertices to the annotation rect\n const localPts = $derived(\n vertices.map(({ x, y }) => ({ x: x - rect.origin.x, y: y - rect.origin.y })),\n );\n\n // Build path data: \"M x0 y0 L x1 y1 ...\"\n const pathData = $derived.by(() => {\n if (!localPts.length) return '';\n const [first, ...rest] = localPts;\n return (\n `M ${first.x} ${first.y} ` +\n rest\n .map((p) => `L ${p.x} ${p.y} `)\n .join('')\n .trim()\n );\n });\n\n // Compute endings (angles from first→second, last-1→last)\n const endings = $derived.by(() => {\n if (localPts.length < 2) return { start: null as any, end: null as any };\n const toAngle = (a: Position, b: Position) => Math.atan2(b.y - a.y, b.x - a.x);\n\n const startRad = toAngle(localPts[0], localPts[1]); // FROM first TO second\n const endRad = toAngle(localPts[localPts.length - 2], localPts[localPts.length - 1]); // FROM second-to-last TO last\n\n const start = patching.createEnding(\n lineEndings?.start,\n strokeWidth,\n startRad + Math.PI, // tip outward from start\n localPts[0].x,\n localPts[0].y,\n );\n const end = patching.createEnding(\n lineEndings?.end,\n strokeWidth,\n endRad, // tip in line direction\n localPts[localPts.length - 1].x,\n localPts[localPts.length - 1].y,\n );\n return { start, end };\n });\n\n const width = $derived(rect.size.width * scale);\n const height = $derived(rect.size.height * scale);\n</script>\n\n<svg\n style=\"position: absolute; width: var(--w); height: var(--h); pointer-events: none; z-index: 2; overflow: visible;\"\n style:--w={`${width}px`}\n style:--h={`${height}px`}\n {width}\n {height}\n viewBox={`0 0 ${rect.size.width} ${rect.size.height}`}\n>\n <path\n d={pathData}\n onpointerdown={onClick}\n ontouchstart={onClick}\n {opacity}\n style:fill=\"none\"\n style:stroke={strokeColor ?? color}\n style:stroke-width={strokeWidth}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected ? 'none' : 'visibleStroke'}\n style:stroke-linecap=\"butt\"\n style:stroke-linejoin=\"miter\"\n />\n\n {#if endings.start}\n <path\n d={endings.start.d}\n transform={endings.start.transform}\n stroke={strokeColor}\n fill={endings.start.filled ? color : 'none'}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:stroke-width={strokeWidth}\n style:pointer-events={isSelected\n ? 'none'\n : endings.start.filled\n ? 'visible'\n : 'visibleStroke'}\n style:stroke-linecap=\"butt\"\n />\n {/if}\n\n {#if endings.end}\n <path\n d={endings.end.d}\n transform={endings.end.transform}\n stroke={strokeColor}\n fill={endings.end.filled ? color : 'none'}\n onpointerdown={onClick}\n ontouchstart={onClick}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:stroke-width={strokeWidth}\n style:pointer-events={isSelected ? 'none' : endings.end.filled ? 'visible' : 'visibleStroke'}\n style:stroke-linecap=\"butt\"\n />\n {/if}\n</svg>\n","<!-- Polygon.svelte -->\n<script lang=\"ts\">\n import type { Rect, Position } from '@embedpdf/models';\n import { PdfAnnotationBorderStyle } from '@embedpdf/models';\n\n interface PolygonProps {\n rect: Rect;\n vertices: Position[];\n color?: string;\n strokeColor?: string;\n opacity?: number;\n strokeWidth: number;\n strokeStyle?: PdfAnnotationBorderStyle;\n strokeDashArray?: number[];\n scale: number;\n isSelected: boolean;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n // Preview-only\n currentVertex?: Position;\n handleSize?: number;\n }\n\n let {\n rect,\n vertices,\n color = 'transparent',\n strokeColor = '#000000',\n opacity = 1,\n strokeWidth,\n strokeStyle = PdfAnnotationBorderStyle.SOLID,\n strokeDashArray,\n scale,\n isSelected,\n onClick,\n currentVertex,\n handleSize = 14,\n }: PolygonProps = $props();\n\n // Combine vertices with preview point (if any)\n const allPoints = $derived(currentVertex ? [...vertices, currentVertex] : vertices);\n\n // Localize points to the annotation bbox\n const localPts = $derived(\n allPoints.map(({ x, y }) => ({ x: x - rect.origin.x, y: y - rect.origin.y })),\n );\n\n // Build path data; omit 'Z' when previewing\n const pathData = $derived.by(() => {\n if (!localPts.length) return '';\n const [first, ...rest] = localPts;\n const isPreview = !!currentVertex;\n return (\n `M ${first.x} ${first.y} ` +\n rest.map((p) => `L ${p.x} ${p.y}`).join(' ') +\n (isPreview ? '' : ' Z')\n ).trim();\n });\n\n const isPreviewing = $derived(!!currentVertex && vertices.length > 0);\n\n const width = $derived(rect.size.width * scale);\n const height = $derived(rect.size.height * scale);\n\n const dash = $derived(\n strokeStyle === PdfAnnotationBorderStyle.DASHED ? strokeDashArray?.join(',') : undefined,\n );\n</script>\n\n<svg\n style=\"position: absolute; z-index: 2; overflow: visible; pointer-events: none;\"\n style:width={`${width}px`}\n style:height={`${height}px`}\n {width}\n {height}\n viewBox={`0 0 ${rect.size.width} ${rect.size.height}`}\n>\n <path\n d={pathData}\n onpointerdown={onClick}\n ontouchstart={onClick}\n {opacity}\n style:fill={currentVertex ? 'none' : color}\n style:stroke={strokeColor ?? color}\n style:stroke-width={strokeWidth}\n style:cursor={isSelected ? 'move' : 'pointer'}\n style:pointer-events={isSelected\n ? 'none'\n : color === 'transparent'\n ? 'visibleStroke'\n : 'visible'}\n style:stroke-linecap=\"butt\"\n style:stroke-linejoin=\"miter\"\n style:stroke-dasharray={dash}\n />\n\n <!-- Preview-only elements -->\n {#if isPreviewing && vertices.length > 1}\n <path\n d={`M ${localPts[localPts.length - 1].x} ${localPts[localPts.length - 1].y} L ${localPts[0].x} ${localPts[0].y}`}\n fill=\"none\"\n style:stroke={strokeColor}\n style:stroke-width={strokeWidth}\n style:stroke-dasharray={'4,4'}\n style:opacity={0.7}\n />\n {/if}\n\n {#if isPreviewing && vertices.length >= 2}\n <rect\n x={localPts[0].x - handleSize / scale / 2}\n y={localPts[0].y - handleSize / scale / 2}\n width={handleSize / scale}\n height={handleSize / scale}\n fill={strokeColor}\n opacity={0.4}\n stroke={strokeColor}\n stroke-width={strokeWidth / 2}\n />\n {/if}\n</svg>\n","<!-- Free-text.svelte -->\n<script lang=\"ts\">\n import {\n type PdfFreeTextAnnoObject,\n PdfVerticalAlignment,\n standardFontCss,\n textAlignmentToCss,\n } from '@embedpdf/models';\n import type { TrackedAnnotation } from '@embedpdf/plugin-annotation';\n import { useAnnotationCapability } from '../../hooks';\n\n // ---------- props ----------\n interface FreeTextProps {\n documentId: string;\n isSelected: boolean;\n isEditing: boolean;\n annotation: TrackedAnnotation<PdfFreeTextAnnoObject>;\n pageIndex: number;\n scale: number;\n onClick?: (e: MouseEvent | TouchEvent) => void;\n onDoubleClick?: (e: MouseEvent) => void;\n }\n\n let { documentId, isSelected, isEditing, annotation, pageIndex, scale, onClick }: FreeTextProps =\n $props();\n\n // ---------- capabilities ----------\n const annotationCapability = useAnnotationCapability();\n\n // Get scoped API for this document\n const annotationProvides = $derived(\n annotationCapability.provides ? annotationCapability.provides.forDocument(documentId) : null,\n );\n\n // ---------- refs / state ----------\n let editorRef: HTMLSpanElement | null = null;\n let isIOS = $state(false);\n\n // Focus and move caret to end when entering edit mode\n $effect(() => {\n if (!isEditing || !editorRef) return;\n editorRef.focus();\n\n const selection = window.getSelection?.();\n if (!selection) return;\n\n const range = document.createRange();\n range.selectNodeContents(editorRef);\n range.collapse(false);\n selection.removeAllRanges();\n selection.addRange(range);\n });\n\n // One-time iOS detection (prevents zoom by font-size compensation)\n $effect.pre(() => {\n try {\n const nav = navigator as any;\n const ios =\n /iPad|iPhone|iPod/.test(navigator.userAgent) ||\n (navigator.platform === 'MacIntel' && nav?.maxTouchPoints > 1);\n isIOS = ios;\n } catch {\n isIOS = false;\n }\n });\n\n // Persist contents on blur\n function handleBlur() {\n if (!annotationProvides || !editorRef) return;\n annotationProvides.updateAnnotation(pageIndex, annotation.object.id, {\n contents: editorRef.innerText,\n });\n }\n\n // ---------- iOS zoom compensation ----------\n const computedFontPx = $derived(annotation.object.fontSize * scale);\n const MIN_IOS_FOCUS_FONT_PX = 16;\n const needsComp = $derived(\n isIOS && isEditing && computedFontPx > 0 && computedFontPx < MIN_IOS_FOCUS_FONT_PX,\n );\n const adjustedFontPx = $derived(needsComp ? MIN_IOS_FOCUS_FONT_PX : computedFontPx);\n const scaleComp = $derived(needsComp ? computedFontPx / MIN_IOS_FOCUS_FONT_PX : 1);\n const invScalePercent = $derived(needsComp ? 100 / scaleComp : 100);\n\n // ---------- derived sizes ----------\n const outerW = $derived(annotation.object.rect.size.width * scale);\n const outerH = $derived(annotation.object.rect.size.height * scale);\n\n const justify = $derived(\n annotation.object.verticalAlign === PdfVerticalAlignment.Top\n ? 'flex-start'\n : annotation.object.verticalAlign === PdfVerticalAlignment.Middle\n ? 'center'\n : 'flex-end',\n );\n</script>\n\n<!-- Outer positioned container -->\n<div\n style:position=\"absolute\"\n style:width={`${outerW}px`}\n style:height={`${outerH}px`}\n style:z-index={2}\n style:cursor={isSelected && !isEditing ? 'move' : 'default'}\n style:pointer-events={isSelected && !isEditing ? 'none' : 'auto'}\n onpointerdown={onClick}\n ontouchstart={onClick}\n>\n <!-- Editable span -->\n <span\n bind:this={editorRef}\n tabindex=\"0\"\n contenteditable={isEditing}\n onblur={handleBlur}\n style:display=\"flex\"\n style:flex-direction=\"column\"\n style:justify-content={justify}\n style:color={annotation.object.fontColor}\n style:font-size={`${adjustedFontPx}px`}\n style:font-family={standardFontCss(annotation.object.fontFamily)}\n style:text-align={textAlignmentToCss(annotation.object.textAlign)}\n style:background-color={annotation.object.color ?? annotation.object.backgroundColor}\n style:opacity={annotation.object.opacity}\n style:width={needsComp ? `${invScalePercent}%` : '100%'}\n style:height={needsComp ? `${invScalePercent}%` : '100%'}\n style:line-height=\"1.18\"\n style:overflow=\"hidden\"\n style:cursor={isEditing ? 'text' : 'pointer'}\n style:outline=\"none\"\n style:transform={needsComp ? `scale(${scaleComp})` : undefined}\n style:transform-origin=\"top left\">{annotation.object.contents}</span\n >\n</div>\n","<script lang=\"ts\">\n import { ignore, type PdfAnnotationObject, PdfErrorCode } from '@embedpdf/models';\n import type { HTMLImgAttributes } from 'svelte/elements';\n import { useAnnotationCapability } from '../hooks';\n import { deepToRaw } from '@embedpdf/utils/svelte';\n\n interface RenderAnnotationProps extends Omit<HTMLImgAttributes, 'style'> {\n documentId: string;\n pageIndex: number;\n annotation: PdfAnnotationObject;\n scaleFactor?: number;\n dpr?: number;\n style?: Record<string, string | number | undefined>;\n }\n\n let {\n documentId,\n pageIndex,\n annotation,\n scaleFactor = 1,\n style,\n ...restProps\n }: RenderAnnotationProps = $props();\n\n const annotationCapability = useAnnotationCapability();\n\n let imageUrl = $state<string | null>(null);\n let urlRef: string | null = null;\n\n const { width, height } = $derived(annotation.rect.size);\n\n // Get scoped API for this document\n const annotationProvides = $derived(\n annotationCapability.provides ? annotationCapability.provides.forDocument(documentId) : null,\n );\n\n // Effect to render annotation\n $effect(() => {\n if (annotationProvides) {\n const task = annotationProvides.renderAnnotation({\n pageIndex,\n annotation: deepToRaw(annotation),\n options: {\n scaleFactor,\n dpr: window.devicePixelRatio,\n },\n });\n\n task.wait((blob) => {\n const url = URL.createObjectURL(blob);\n imageUrl = url;\n urlRef = url;\n }, ignore);\n\n return () => {\n if (urlRef) {\n URL.revokeObjectURL(urlRef);\n urlRef = null;\n } else {\n task.abort({\n code: PdfErrorCode.Cancelled,\n message: 'canceled render task',\n });\n }\n };\n }\n });\n\n function handleImageLoad() {\n if (urlRef) {\n URL.revokeObjectURL(urlRef);\n urlRef = null;\n }\n }\n</script>\n\n{#if imageUrl}\n <img\n alt=\"\"\n src={imageUrl}\n onload={handleImageLoad}\n {...restProps}\n style:width=\"100%\"\n style:height=\"100%\"\n style:display=\"block\"\n {style}\n />\n{/if}\n","<script lang=\"ts\">\n import type { PdfStampAnnoObject } from '@embedpdf/models';\n import type { TrackedAnnotation } from '@embedpdf/plugin-annotation';\n import RenderAnnotation from '../RenderAnnotation.svelte';\n\n interface StampProps {\n documentId: string;\n isSelected: boolean;\n annotation: TrackedAnnotation<PdfStampAnnoObject>;\n pageIndex: number;\n scale: number;\n onClick: (e: MouseEvent | TouchEvent) => void;\n }\n\n let { documentId, isSelected, annotation, pageIndex, scale, onClick }: StampProps = $props();\n\n let annotationProp = $derived({ ...annotation.object, id: annotation.object.id });\n</script>\n\n<div\n style=\"position: absolute; width: 100%; height: 100%; z-index: 2;\"\n style:pointer-events={isSelected ? 'none' : 'auto'}\n style:cursor=\"pointer\"\n onpointerdown={onClick}\n ontouchstart={onClick}\n>\n <RenderAnnotation {documentId} {pageIndex} annotation={annotationProp} scaleFactor={scale} />\n</div>\n","<script lang=\"ts\">\n import { PdfAnnotationBorderStyle, type Rect } from '@embedpdf/models';\n\n interface LinkProps {\n /** Whether the annotation is selected */\n isSelected: boolean;\n /** Stroke colour – defaults to blue when omitted */\n strokeColor?: string;\n /** Stroke width in PDF units */\n strokeWidth?: number;\n /** Stroke type – defaults to underline when omitted */\n strokeStyle?: PdfAnnotationBorderStyle;\n /** Stroke dash array – for dashed style */\n strokeDashArray?: number[];\n /** Bounding box of the annotation (PDF units) */\n rect: Rect;\n /** Current page zoom factor */\n scale: number;\n /** Click handler (used for selection) */\n onClick?: (e: MouseEvent | TouchEvent) => void;\n /** Whether this link has an IRT (In Reply To) reference - disables direct interaction */\n hasIRT?: boolean;\n }\n\n let {\n isSelected,\n strokeColor = '#0000FF',\n strokeWidth = 2,\n strokeStyle = PdfAnnotationBorderStyle.UNDERLINE,\n strokeDashArray,\n rect,\n scale,\n onClick,\n hasIRT = false,\n }: LinkProps = $props();\n\n const width = $derived(rect.size.width);\n const height = $derived(rect.size.height);\n const svgWidth = $derived(width * scale);\n const svgHeight = $derived(height * scale);\n\n // Calculate dash array for SVG\n const dashArray = $derived.by(() => {\n if (strokeStyle === PdfAnnotationBorderStyle.DASHED) {\n return strokeDashArray?.join(',') ?? `${strokeWidth * 3},${strokeWidth}`;\n }\n return undefined;\n });\n\n // For underline style, render a line at the bottom\n // For solid/dashed, render a rectangle border\n const isUnderline = $derived(strokeStyle === PdfAnnotationBorderStyle.UNDERLINE);\n\n const hitAreaCursor = $derived(hasIRT ? 'default' : isSelected ? 'move' : 'pointer');\n const hitAreaPointerEvents = $derived(hasIRT ? 'none' : isSelected ? 'none' : 'visible');\n</script>\n\n<svg\n style=\"position: absolute; z-index: 2; pointer-events: none;\"\n style:width=\"{svgWidth}px\"\n style:height=\"{svgHeight}px\"\n width={svgWidth}\n height={svgHeight}\n viewBox=\"0 0 {width} {height}\"\n>\n <!-- Invisible hit area for the entire link region -->\n <!-- IRT links are not directly clickable - interaction goes through parent -->\n <rect\n x={0}\n y={0}\n {width}\n {height}\n fill=\"transparent\"\n onpointerdown={hasIRT ? undefined : onClick}\n ontouchstart={hasIRT ? undefined : onClick}\n style:cursor={hitAreaCursor}\n style:pointer-events={hitAreaPointerEvents}\n />\n\n {#if isUnderline}\n <!-- Underline style: line at bottom of rect -->\n <line\n x1={1}\n y1={height - 1}\n x2={width - 1}\n y2={height - 1}\n stroke={strokeColor}\n stroke-width={strokeWidth}\n stroke-dasharray={dashArray}\n style:pointer-events=\"none\"\n />\n {:else}\n <!-- Solid/Dashed style: rectangle border -->\n <rect\n x={strokeWidth / 2}\n y={strokeWidth / 2}\n width={Math.max(width - strokeWidth, 0)}\n height={Math.max(height - strokeWidth, 0)}\n fill=\"transparent\"\n stroke={strokeColor}\n stroke-width={strokeWidth}\n stroke-dasharray={dashArray}\n style:pointer-events=\"none\"\n />\n {/if}\n</svg>\n","<!-- GroupSelectionBox.svelte -->\n<script lang=\"ts\">\n import { boundingRectOrEmpty, type Rect } from '@embedpdf/models';\n import type { TrackedAnnotation } from '@embedpdf/plugin-annotation';\n import {\n useInteractionHandles,\n CounterRotate,\n type MenuWrapperProps,\n } from '@embedpdf/utils/svelte';\n import { useDocumentPermissions } from '@embedpdf/core/svelte';\n import { useAnnotationPlugin } from '../hooks';\n import type {\n GroupSelectionContext,\n GroupSelectionMenuProps,\n GroupSelectionMenuRenderFn,\n ResizeHandleUI,\n } from '../types';\n import type { Snippet } from 'svelte';\n\n interface GroupSelectionBoxProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation: number;\n pageWidth: number;\n pageHeight: number;\n /** All selected annotations on this page */\n selectedAnnotations: TrackedAnnotation[];\n /** Whether the group is draggable (all annotations must be group-draggable) */\n isDraggable: boolean;\n /** Whether the group is resizable (all annotations must be group-resizable) */\n isResizable: boolean;\n /** Resize handle UI customization */\n resizeUI?: ResizeHandleUI;\n /** Selection outline color */\n selectionOutlineColor?: string;\n /** Outline offset */\n outlineOffset?: number;\n /** Z-index for the group box */\n zIndex?: number;\n /** Group selection menu render function */\n groupSelectionMenu?: GroupSelectionMenuRenderFn;\n /** Snippet for custom group selection menu (slot-based approach) */\n groupSelectionMenuSnippet?: Snippet<[GroupSelectionMenuProps]>;\n }\n\n let {\n documentId,\n pageIndex,\n scale,\n rotation,\n pageWidth,\n pageHeight,\n selectedAnnotations,\n isDraggable,\n isResizable,\n resizeUI,\n selectionOutlineColor = '#007ACC',\n outlineOffset = 2,\n zIndex = 100,\n groupSelectionMenu,\n groupSelectionMenuSnippet,\n }: GroupSelectionBoxProps = $props();\n\n const annotationPlugin = useAnnotationPlugin();\n const permissions = useDocumentPermissions(() => documentId);\n let gestureBase = $state<Rect | null>(null);\n let isDraggingRef = $state(false);\n let isResizingRef = $state(false);\n\n // Check permissions before allowing drag/resize\n const effectiveIsDraggable = $derived(permissions.canModifyAnnotations && isDraggable);\n const effectiveIsResizable = $derived(permissions.canModifyAnnotations && isResizable);\n\n // Helper to compute group box on demand\n function getGroupBox(): Rect {\n const rects = selectedAnnotations.map((ta) => ta.object.rect);\n return boundingRectOrEmpty(rects);\n }\n\n // Compute the group bounding box from all selected annotations (for reactive bindings)\n const groupBox = $derived.by(getGroupBox);\n\n // Preview state for the group box during drag/resize\n let previewGroupBox = $state<Rect>(getGroupBox());\n\n // Sync preview with actual group box when not dragging/resizing\n $effect(() => {\n if (!isDraggingRef && !isResizingRef) {\n const newBox = groupBox;\n // Only update if values actually changed (not just object reference)\n if (\n previewGroupBox.origin.x !== newBox.origin.x ||\n previewGroupBox.origin.y !== newBox.origin.y ||\n previewGroupBox.size.width !== newBox.size.width ||\n previewGroupBox.size.height !== newBox.size.height\n ) {\n previewGroupBox = newBox;\n }\n }\n });\n\n // UI constants\n const HANDLE_COLOR = $derived(resizeUI?.color ?? '#007ACC');\n const HANDLE_SIZE = $derived(resizeUI?.size ?? 12);\n\n // Use interaction handles for both drag and resize\n const interactionHandles = useInteractionHandles(() => ({\n controller: {\n element: previewGroupBox,\n constraints: {\n minWidth: 20,\n minHeight: 20,\n boundingBox: { width: pageWidth, height: pageHeight },\n },\n maintainAspectRatio: false,\n pageRotation: rotation,\n scale: scale,\n enabled: true,\n onUpdate: (event) => {\n if (!event.transformData?.type) return;\n if (!annotationPlugin.plugin) return;\n\n const plugin = annotationPlugin.plugin;\n const transformType = event.transformData.type;\n const isMove = transformType === 'move';\n const isResize = transformType === 'resize';\n\n // Skip drag operations if group is not draggable\n if (isMove && !effectiveIsDraggable) return;\n\n if (event.state === 'start') {\n gestureBase = getGroupBox();\n\n if (isMove) {\n isDraggingRef = true;\n // Use unified drag API - plugin handles attached links automatically\n plugin.startDrag(documentId, {\n annotationIds: selectedAnnotations.map((ta) => ta.object.id),\n pageSize: { width: pageWidth, height: pageHeight },\n });\n } else if (isResize) {\n isResizingRef = true;\n // Use unified resize API - plugin handles attached links automatically\n plugin.startResize(documentId, {\n annotationIds: selectedAnnotations.map((ta) => ta.object.id),\n pageSize: { width: pageWidth, height: pageHeight },\n resizeHandle: event.transformData.metadata?.handle ?? 'se',\n });\n }\n }\n\n const base = gestureBase ?? getGroupBox();\n\n if (isMove && event.transformData.changes.rect) {\n // Calculate delta from original position\n const newRect = event.transformData.changes.rect;\n const rawDelta = {\n x: newRect.origin.x - base.origin.x,\n y: newRect.origin.y - base.origin.y,\n };\n\n // Plugin clamps delta and emits events (attached links receive updates too)\n const clampedDelta = plugin.updateDrag(documentId, rawDelta);\n\n // Update preview group box with clamped delta\n previewGroupBox = {\n ...base,\n origin: {\n x: base.origin.x + clampedDelta.x,\n y: base.origin.y + clampedDelta.y,\n },\n };\n } else if (isResize && event.transformData.changes.rect) {\n const newGroupBox = event.transformData.changes.rect;\n\n // Plugin computes rects for all participants and emits events\n plugin.updateResize(documentId, newGroupBox);\n\n // Update preview\n previewGroupBox = newGroupBox;\n }\n\n if (event.state === 'end') {\n gestureBase = null;\n\n if (isMove && isDraggingRef) {\n isDraggingRef = false;\n // Plugin commits all patches (selected + attached links) - no patch building needed!\n plugin.commitDrag(documentId);\n } else if (isResize && isResizingRef) {\n isResizingRef = false;\n // Plugin commits all patches (selected + attached links) - no patch building needed!\n plugin.commitResize(documentId);\n }\n }\n },\n },\n resizeUI: {\n handleSize: HANDLE_SIZE,\n spacing: outlineOffset,\n offsetMode: 'outside',\n includeSides: true,\n zIndex: zIndex + 1,\n },\n vertexUI: {\n vertexSize: 0,\n zIndex: zIndex,\n },\n includeVertices: false,\n }));\n\n // Derived accessors for template\n const resizeHandles = $derived(interactionHandles.resize);\n\n // --- Group Selection Menu Logic ---\n\n // Check if we should show menu\n const shouldShowMenu = $derived(!!groupSelectionMenu || !!groupSelectionMenuSnippet);\n\n // Build context object for group selection menu\n function buildContext(): GroupSelectionContext {\n return {\n type: 'group',\n annotations: selectedAnnotations,\n pageIndex,\n };\n }\n\n // Build menu props\n function buildMenuProps(rect: Rect, menuWrapperProps: MenuWrapperProps): GroupSelectionMenuProps {\n return {\n context: buildContext(),\n selected: true,\n rect,\n placement: { suggestTop: false },\n menuWrapperProps,\n };\n }\n</script>\n\n{#if selectedAnnotations.length >= 2}\n <div data-group-selection-box data-no-interaction>\n <!-- Group box - draggable only if effectiveIsDraggable is true -->\n <div\n {...effectiveIsDraggable\n ? interactionHandles.dragProps\n : { onpointerdown: (e: PointerEvent) => e.stopPropagation() }}\n style:position=\"absolute\"\n style:left=\"{previewGroupBox.origin.x * scale}px\"\n style:top=\"{previewGroupBox.origin.y * scale}px\"\n style:width=\"{previewGroupBox.size.width * scale}px\"\n style:height=\"{previewGroupBox.size.height * scale}px\"\n style:outline=\"2px dashed {selectionOutlineColor}\"\n style:outline-offset=\"{outlineOffset - 1}px\"\n style:cursor={effectiveIsDraggable ? 'move' : 'default'}\n style:touch-action=\"none\"\n style:z-index={zIndex}\n >\n <!-- Resize handles -->\n {#if effectiveIsResizable}\n {#each resizeHandles as { key, style: handleStyle, ...hProps } (key)}\n {#if resizeUI?.component}\n {@render resizeUI.component({ ...hProps, backgroundColor: HANDLE_COLOR })}\n {:else}\n <div {...hProps} style=\"{handleStyle}; background-color: {HANDLE_COLOR};\"></div>\n {/if}\n {/each}\n {/if}\n </div>\n\n <!-- Group selection menu -->\n {#if shouldShowMenu}\n <CounterRotate\n rect={{\n origin: {\n x: previewGroupBox.origin.x * scale,\n y: previewGroupBox.origin.y * scale,\n },\n size: {\n width: previewGroupBox.size.width * scale,\n height: previewGroupBox.size.height * scale,\n },\n }}\n {rotation}\n >\n {#snippet children({ rect, menuWrapperProps })}\n {@const menuProps = buildMenuProps(rect, menuWrapperProps)}\n {#if groupSelectionMenu}\n <!-- Priority 1: Render function (schema-driven) -->\n {@const result = groupSelectionMenu(menuProps)}\n {#if result}\n <result.component {...result.props} />\n {/if}\n {:else if groupSelectionMenuSnippet}\n <!-- Priority 2: Snippet (manual customization) -->\n {@render groupSelectionMenuSnippet(menuProps)}\n {/if}\n {/snippet}\n </CounterRotate>\n {/if}\n </div>\n{/if}\n","<!-- Annotations.svelte -->\n<script lang=\"ts\">\n import { blendModeToCss, type PdfAnnotationObject, PdfBlendMode } from '@embedpdf/models';\n import {\n getAnnotationsByPageIndex,\n getSelectedAnnotationIds,\n isCircle,\n isFreeText,\n isHighlight,\n isInk,\n isLine,\n isLink,\n isPolygon,\n isPolyline,\n isSquare,\n isSquiggly,\n isStamp,\n isStrikeout,\n isUnderline,\n type TrackedAnnotation,\n resolveInteractionProp,\n } from '@embedpdf/plugin-annotation';\n import type { PdfLinkAnnoObject } from '@embedpdf/models';\n\n import {\n type PointerEventHandlersWithLifecycle,\n type EmbedPdfPointerEvent,\n } from '@embedpdf/plugin-interaction-manager';\n import { usePointerHandlers } from '@embedpdf/plugin-interaction-manager/svelte';\n import { useSelectionCapability } from '@embedpdf/plugin-selection/svelte';\n\n import { useAnnotationCapability } from '../hooks';\n import type { BoxedAnnotationRenderer } from '../context';\n\n import Highlight from './text-markup/Highlight.svelte';\n import Underline from './text-markup/Underline.svelte';\n import Strikeout from './text-markup/Strikeout.svelte';\n import Squiggly from './text-markup/Squiggly.svelte';\n import Ink from './annotations/Ink.svelte';\n import Square from './annotations/Square.svelte';\n import Circle from './annotations/Circle.svelte';\n import Line from './annotations/Line.svelte';\n import Polyline from './annotations/Polyline.svelte';\n import Polygon from './annotations/Polygon.svelte';\n import FreeText from './annotations/FreeText.svelte';\n import Stamp from './annotations/Stamp.svelte';\n import Link from './annotations/Link.svelte';\n import GroupSelectionBox from './GroupSelectionBox.svelte';\n import type {\n AnnotationSelectionMenuProps,\n AnnotationSelectionMenuRenderFn,\n GroupSelectionMenuProps,\n GroupSelectionMenuRenderFn,\n CustomAnnotationRenderer,\n ResizeHandleUI,\n VertexHandleUI,\n } from '../types';\n import AnnotationContainer from './AnnotationContainer.svelte';\n import type { Snippet } from 'svelte';\n\n // ---------- props ----------\n interface AnnotationsProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n rotation: number;\n pageWidth: number;\n pageHeight: number;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: AnnotationSelectionMenuRenderFn;\n /** Snippet for custom selection menu (slot-based approach) */\n selectionMenuSnippet?: Snippet<[AnnotationSelectionMenuProps]>;\n /** Render function for group selection menu (schema-driven approach) */\n groupSelectionMenu?: GroupSelectionMenuRenderFn;\n /** Snippet for custom group selection menu (slot-based approach) */\n groupSelectionMenuSnippet?: Snippet<[GroupSelectionMenuProps]>;\n resizeUI?: ResizeHandleUI;\n vertexUI?: VertexHandleUI;\n selectionOutlineColor?: string;\n customAnnotationRenderer?: CustomAnnotationRenderer<PdfAnnotationObject>;\n /** Custom annotation renderers from registry/props */\n annotationRenderers?: BoxedAnnotationRenderer[];\n }\n let annotationsProps: AnnotationsProps = $props();\n\n // Helper to find custom renderer for an annotation\n function findCustomRenderer(annotation: TrackedAnnotation): BoxedAnnotationRenderer | undefined {\n return annotationsProps.annotationRenderers?.find((r) => r.matches(annotation.object));\n }\n\n // ---------- capabilities / handlers ----------\n const annotationCapability = useAnnotationCapability();\n const selectionCapability = useSelectionCapability();\n const pointerHandlers = usePointerHandlers({\n documentId: annotationsProps.documentId,\n pageIndex: annotationsProps.pageIndex,\n });\n\n // ---------- local state ----------\n let annotations = $state<TrackedAnnotation[]>([]);\n let allSelectedIds = $state<string[]>([]);\n let editingId = $state<string | null>(null);\n\n // Get scoped API for this document\n const annotationProvides = $derived(\n annotationCapability.provides\n ? annotationCapability.provides.forDocument(annotationsProps.documentId)\n : null,\n );\n\n // Check if multiple annotations are selected\n const isMultiSelected = $derived(allSelectedIds.length > 1);\n\n // subscribe to annotation state\n $effect(() => {\n if (!annotationProvides) return;\n\n // Initialize with current state immediately\n const currentState = annotationProvides.getState();\n annotations = getAnnotationsByPageIndex(currentState, annotationsProps.pageIndex);\n allSelectedIds = getSelectedAnnotationIds(currentState);\n\n // Then subscribe to changes\n const off = annotationProvides.onStateChange((state) => {\n annotations = getAnnotationsByPageIndex(state, annotationsProps.pageIndex);\n allSelectedIds = getSelectedAnnotationIds(state);\n });\n return () => off?.();\n });\n\n // pointer handlers (capture-down to deselect when clicking empty layer)\n const handlers: PointerEventHandlersWithLifecycle<EmbedPdfPointerEvent<PointerEvent>> = {\n onPointerDown: (_, pe) => {\n if (pe.target === pe.currentTarget && annotationProvides) {\n annotationProvides.deselectAnnotation();\n editingId = null;\n }\n },\n };\n\n // register pointer handlers\n $effect(() => {\n return pointerHandlers.register(handlers, { documentId: annotationsProps.documentId });\n });\n\n // click/select logic shared across shapes\n function handleClick(e: MouseEvent | TouchEvent, annotation: TrackedAnnotation) {\n e.stopPropagation();\n if (annotationProvides && selectionCapability.provides) {\n selectionCapability.provides.clear();\n\n // Check for modifier key (Cmd on Mac, Ctrl on Windows/Linux)\n const isModifierPressed = 'metaKey' in e ? e.metaKey || e.ctrlKey : false;\n\n if (isModifierPressed) {\n // Toggle selection: add or remove from current selection\n annotationProvides.toggleSelection(annotationsProps.pageIndex, annotation.object.id);\n } else {\n // Exclusive select: clear and select only this one\n annotationProvides.selectAnnotation(annotationsProps.pageIndex, annotation.object.id);\n }\n\n if (annotation.object.id !== editingId) {\n editingId = null;\n }\n }\n }\n\n // Special handler for link annotations - if IRT exists, select the parent\n function handleLinkClick(\n e: MouseEvent | TouchEvent,\n annotation: TrackedAnnotation<PdfLinkAnnoObject>,\n ) {\n e.stopPropagation();\n if (!annotationProvides || !selectionCapability.provides) return;\n\n selectionCapability.provides.clear();\n\n // If link has IRT, select the parent annotation instead\n if (annotation.object.inReplyToId) {\n const parentId = annotation.object.inReplyToId;\n const parent = annotations.find((a) => a.object.id === parentId);\n if (parent) {\n annotationProvides.selectAnnotation(parent.object.pageIndex, parentId);\n return;\n }\n }\n\n // Standalone link - select it directly\n annotationProvides.selectAnnotation(annotationsProps.pageIndex, annotation.object.id);\n }\n\n // Get selected annotations that are on THIS page (for group selection box)\n const selectedAnnotationsOnPage = $derived(\n annotations.filter((anno) => allSelectedIds.includes(anno.object.id)),\n );\n\n // Check if all selected annotations on this page are draggable in group context\n const areAllSelectedDraggable = $derived.by(() => {\n if (selectedAnnotationsOnPage.length < 2) return false;\n\n return selectedAnnotationsOnPage.every((ta) => {\n const tool = annotationProvides?.findToolForAnnotation(ta.object);\n // Use group-specific property, falling back to single-annotation property\n const groupDraggable = resolveInteractionProp(\n tool?.interaction.isGroupDraggable,\n ta.object,\n true,\n );\n const singleDraggable = resolveInteractionProp(\n tool?.interaction.isDraggable,\n ta.object,\n true,\n );\n return tool?.interaction.isGroupDraggable !== undefined ? groupDraggable : singleDraggable;\n });\n });\n\n // Check if all selected annotations on this page are resizable in group context\n const areAllSelectedResizable = $derived.by(() => {\n if (selectedAnnotationsOnPage.length < 2) return false;\n\n return selectedAnnotationsOnPage.every((ta) => {\n const tool = annotationProvides?.findToolForAnnotation(ta.object);\n // Use group-specific property, falling back to single-annotation property\n const groupResizable = resolveInteractionProp(\n tool?.interaction.isGroupResizable,\n ta.object,\n true,\n );\n const singleResizable = resolveInteractionProp(\n tool?.interaction.isResizable,\n ta.object,\n true,\n );\n return tool?.interaction.isGroupResizable !== undefined ? groupResizable : singleResizable;\n });\n });\n\n // Check if all selected annotations are on the same page (this page)\n const allSelectedOnSamePage = $derived.by(() => {\n if (!annotationProvides) return false;\n // Early return if not enough selections (also creates reactive dependency on allSelectedIds)\n if (allSelectedIds.length < 2) return false;\n const allSelected = annotationProvides.getSelectedAnnotations();\n return allSelected.every((ta) => ta.object.pageIndex === annotationsProps.pageIndex);\n });\n</script>\n\n{#each annotations as annotation (annotation.object.id)}\n {@const isSelected = allSelectedIds.includes(annotation.object.id)}\n {@const isEditing = editingId === annotation.object.id}\n {@const tool = annotationProvides?.findToolForAnnotation(annotation.object)}\n {@const mixBlendMode = blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)}\n {@const customRenderer = findCustomRenderer(annotation)}\n\n {#if customRenderer}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(tool?.interaction.isDraggable, annotation.object, true) &&\n !isMultiSelected}\n isResizable={resolveInteractionProp(tool?.interaction.isResizable, annotation.object, true) &&\n !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(_obj)}\n {@const CustomComponent = customRenderer.component}\n <CustomComponent\n {annotation}\n {isSelected}\n scale={annotationsProps.scale}\n pageIndex={annotationsProps.pageIndex}\n onClick={(e: PointerEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isInk(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(tool?.interaction.isDraggable, annotation.object, true) &&\n !isMultiSelected}\n isResizable={resolveInteractionProp(tool?.interaction.isResizable, annotation.object, true) &&\n !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Ink\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isSquare(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(tool?.interaction.isDraggable, annotation.object, true) &&\n !isMultiSelected}\n isResizable={resolveInteractionProp(tool?.interaction.isResizable, annotation.object, true) &&\n !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Square\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isCircle(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(tool?.interaction.isDraggable, annotation.object, true) &&\n !isMultiSelected}\n isResizable={resolveInteractionProp(tool?.interaction.isResizable, annotation.object, true) &&\n !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Circle\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: PointerEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isUnderline(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(\n tool?.interaction.isDraggable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n isResizable={resolveInteractionProp(\n tool?.interaction.isResizable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n zIndex={0}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Underline\n {...obj}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isStrikeout(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(\n tool?.interaction.isDraggable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n isResizable={resolveInteractionProp(\n tool?.interaction.isResizable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n zIndex={0}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Strikeout\n {...obj}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isSquiggly(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(\n tool?.interaction.isDraggable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n isResizable={resolveInteractionProp(\n tool?.interaction.isResizable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n zIndex={0}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Squiggly\n {...obj}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isHighlight(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(\n tool?.interaction.isDraggable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n isResizable={resolveInteractionProp(\n tool?.interaction.isResizable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n zIndex={0}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n style=\"mix-blend-mode: {blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Multiply)}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Highlight\n {...obj}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isLine(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(tool?.interaction.isDraggable, annotation.object, true) &&\n !isMultiSelected}\n isResizable={resolveInteractionProp(\n tool?.interaction.isResizable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n vertexConfig={{\n extractVertices: (a) => [a.linePoints.start, a.linePoints.end],\n transformAnnotation: (a, vertices) => ({\n ...a,\n linePoints: { start: vertices[0], end: vertices[1] },\n }),\n }}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Line\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isPolyline(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n isDraggable={resolveInteractionProp(tool?.interaction.isDraggable, annotation.object, true) &&\n !isMultiSelected}\n isResizable={resolveInteractionProp(\n tool?.interaction.isResizable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n isSelected={isSelected && !isMultiSelected}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n vertexConfig={{\n extractVertices: (a) => a.vertices,\n transformAnnotation: (a, vertices) => ({ ...a, vertices }),\n }}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Polyline\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isPolygon(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(tool?.interaction.isDraggable, annotation.object, true) &&\n !isMultiSelected}\n isResizable={resolveInteractionProp(\n tool?.interaction.isResizable,\n annotation.object,\n false,\n ) && !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n vertexConfig={{\n extractVertices: (a) => a.vertices,\n transformAnnotation: (a, vertices) => ({ ...a, vertices }),\n }}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Polygon\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isFreeText(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(tool?.interaction.isDraggable, annotation.object, true) &&\n !isEditing &&\n !isMultiSelected}\n isResizable={resolveInteractionProp(tool?.interaction.isResizable, annotation.object, true) &&\n !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)}\"\n onDoubleClick={(e) => {\n e.stopPropagation();\n editingId = annotation.object.id;\n }}\n {...annotationsProps}\n >\n {#snippet children(object)}\n <FreeText\n documentId={annotationsProps.documentId}\n {isSelected}\n {isEditing}\n annotation={{ ...annotation, object }}\n pageIndex={annotationsProps.pageIndex}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isStamp(annotation)}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n isDraggable={resolveInteractionProp(tool?.interaction.isDraggable, annotation.object, true) &&\n !isMultiSelected}\n isResizable={resolveInteractionProp(tool?.interaction.isResizable, annotation.object, true) &&\n !isMultiSelected}\n lockAspectRatio={resolveInteractionProp(\n tool?.interaction.lockAspectRatio,\n annotation.object,\n false,\n )}\n selectionMenu={isMultiSelected ? undefined : annotationsProps.selectionMenu}\n selectionMenuSnippet={isMultiSelected ? undefined : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(_object)}\n <Stamp\n documentId={annotationsProps.documentId}\n {isSelected}\n {annotation}\n pageIndex={annotationsProps.pageIndex}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleClick(e, annotation)}\n />\n {/snippet}\n </AnnotationContainer>\n {:else if isLink(annotation)}\n {@const hasIRT = !!annotation.object.inReplyToId}\n <AnnotationContainer\n trackedAnnotation={annotation}\n isSelected={isSelected && !isMultiSelected}\n {isMultiSelected}\n isDraggable={false}\n isResizable={false}\n lockAspectRatio={false}\n selectionMenu={hasIRT\n ? undefined\n : isMultiSelected\n ? undefined\n : annotationsProps.selectionMenu}\n selectionMenuSnippet={hasIRT\n ? undefined\n : isMultiSelected\n ? undefined\n : annotationsProps.selectionMenuSnippet}\n onSelect={(e: MouseEvent | TouchEvent) => handleLinkClick(e, annotation)}\n style=\"mix-blend-mode: {mixBlendMode}\"\n {...annotationsProps}\n >\n {#snippet children(obj)}\n <Link\n {...obj}\n {isSelected}\n scale={annotationsProps.scale}\n onClick={(e: MouseEvent | TouchEvent) => handleLinkClick(e, annotation)}\n {hasIRT}\n />\n {/snippet}\n </AnnotationContainer>\n {/if}\n{/each}\n\n<!-- Group Selection Box (shown when multiple annotations are selected on this page) -->\n{#if allSelectedOnSamePage && selectedAnnotationsOnPage.length >= 2}\n <GroupSelectionBox\n documentId={annotationsProps.documentId}\n pageIndex={annotationsProps.pageIndex}\n scale={annotationsProps.scale}\n rotation={annotationsProps.rotation}\n pageWidth={annotationsProps.pageWidth}\n pageHeight={annotationsProps.pageHeight}\n selectedAnnotations={selectedAnnotationsOnPage}\n isDraggable={areAllSelectedDraggable}\n isResizable={areAllSelectedResizable}\n resizeUI={annotationsProps.resizeUI}\n selectionOutlineColor={annotationsProps.selectionOutlineColor}\n groupSelectionMenu={annotationsProps.groupSelectionMenu}\n groupSelectionMenuSnippet={annotationsProps.groupSelectionMenuSnippet}\n />\n{/if}\n","<script lang=\"ts\">\n import { blendModeToCss, PdfAnnotationSubtype, PdfBlendMode, type Rect } from '@embedpdf/models';\n import type { AnnotationTool } from '@embedpdf/plugin-annotation';\n import { useSelectionCapability } from '@embedpdf/plugin-selection/svelte';\n\n import { useAnnotationCapability } from '../hooks';\n import Highlight from './text-markup/Highlight.svelte';\n import Squiggly from './text-markup/Squiggly.svelte';\n import Underline from './text-markup/Underline.svelte';\n import Strikeout from './text-markup/Strikeout.svelte';\n\n interface TextMarkupProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n }\n\n let { documentId, pageIndex, scale }: TextMarkupProps = $props();\n\n const selectionCapability = useSelectionCapability();\n const annotationCapability = useAnnotationCapability();\n\n let rects = $state<Rect[]>([]);\n let boundingRect = $state<Rect | null>(null);\n let activeTool = $state<AnnotationTool | null>(null);\n\n // Get scoped APIs for this document\n const selectionProvides = $derived(\n selectionCapability.provides ? selectionCapability.provides.forDocument(documentId) : null,\n );\n const annotationProvides = $derived(\n annotationCapability.provides ? annotationCapability.provides.forDocument(documentId) : null,\n );\n\n // Subscribe to selection changes\n $effect(() => {\n if (!selectionProvides) return;\n\n const off = selectionProvides.onSelectionChange(() => {\n rects = selectionProvides.getHighlightRectsForPage(pageIndex);\n boundingRect = selectionProvides.getBoundingRectForPage(pageIndex);\n });\n return off;\n });\n\n // Subscribe to active tool changes\n $effect(() => {\n if (!annotationProvides) return;\n\n // Initialize with current active tool\n activeTool = annotationProvides.getActiveTool();\n\n const off = annotationProvides.onActiveToolChange((tool) => {\n activeTool = tool;\n });\n return off;\n });\n\n const mixBlendMode = $derived(\n activeTool?.defaults?.blendMode\n ? blendModeToCss(activeTool.defaults.blendMode)\n : activeTool?.defaults?.type === PdfAnnotationSubtype.HIGHLIGHT\n ? blendModeToCss(PdfBlendMode.Multiply)\n : blendModeToCss(PdfBlendMode.Normal),\n );\n</script>\n\n{#if boundingRect && activeTool && activeTool.defaults}\n {#if activeTool.defaults.type === PdfAnnotationSubtype.UNDERLINE}\n <div\n style:mix-blend-mode={mixBlendMode}\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Underline\n strokeColor={activeTool.defaults?.strokeColor}\n opacity={activeTool.defaults?.opacity}\n segmentRects={rects}\n {scale}\n />\n </div>\n {:else if activeTool.defaults.type === PdfAnnotationSubtype.HIGHLIGHT}\n <div\n style:mix-blend-mode={mixBlendMode}\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Highlight\n strokeColor={activeTool.defaults?.strokeColor}\n opacity={activeTool.defaults?.opacity}\n segmentRects={rects}\n {scale}\n />\n </div>\n {:else if activeTool.defaults.type === PdfAnnotationSubtype.STRIKEOUT}\n <div\n style:mix-blend-mode={mixBlendMode}\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Strikeout\n strokeColor={activeTool.defaults?.strokeColor}\n opacity={activeTool.defaults?.opacity}\n segmentRects={rects}\n {scale}\n />\n </div>\n {:else if activeTool.defaults.type === PdfAnnotationSubtype.SQUIGGLY}\n <div\n style:mix-blend-mode={mixBlendMode}\n style:pointer-events=\"none\"\n style:position=\"absolute\"\n style:inset=\"0\"\n >\n <Squiggly\n strokeColor={activeTool.defaults?.strokeColor}\n opacity={activeTool.defaults?.opacity}\n segmentRects={rects}\n {scale}\n />\n </div>\n {/if}\n{/if}\n","<script lang=\"ts\">\n import type { AnyPreviewState } from '@embedpdf/plugin-annotation';\n import { PdfAnnotationSubtype } from '@embedpdf/models';\n import Circle from './annotations/Circle.svelte';\n import Square from './annotations/Square.svelte';\n import Polygon from './annotations/Polygon.svelte';\n import Polyline from './annotations/Polyline.svelte';\n import Line from './annotations/Line.svelte';\n import Ink from './annotations/Ink.svelte';\n\n interface PreviewRendererProps {\n preview: AnyPreviewState;\n scale: number;\n }\n\n let { preview, scale }: PreviewRendererProps = $props();\n\n const bounds = $derived(preview.bounds);\n\n const style = $derived({\n left: bounds.origin.x * scale,\n top: bounds.origin.y * scale,\n width: bounds.size.width * scale,\n height: bounds.size.height * scale,\n });\n</script>\n\n{#if preview.type === PdfAnnotationSubtype.CIRCLE}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Circle isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.SQUARE}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Square isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.POLYGON}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Polygon isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.POLYLINE}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Polyline isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.LINE}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Line isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.INK}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <Ink isSelected={false} {scale} {...preview.data} />\n </div>\n{:else if preview.type === PdfAnnotationSubtype.FREETEXT}\n <div\n style:position=\"absolute\"\n style:left=\"{style.left}px\"\n style:top=\"{style.top}px\"\n style:width=\"{style.width}px\"\n style:height=\"{style.height}px\"\n style:pointer-events=\"none\"\n style:z-index=\"10\"\n >\n <!-- Render a simple dashed border preview -->\n <div\n style:width=\"100%\"\n style:height=\"100%\"\n style:border=\"1px dashed {preview.data.fontColor || '#000000'}\"\n style:background-color=\"transparent\"\n ></div>\n </div>\n{/if}\n","<script lang=\"ts\">\n import { useAnnotationPlugin } from '../hooks';\n import type { AnyPreviewState, HandlerServices } from '@embedpdf/plugin-annotation';\n import PreviewRenderer from './PreviewRenderer.svelte';\n\n interface AnnotationPaintLayerProps {\n documentId: string;\n pageIndex: number;\n scale: number;\n }\n\n let { documentId, pageIndex, scale }: AnnotationPaintLayerProps = $props();\n\n const annotationPlugin = useAnnotationPlugin();\n let previews = $state<Map<string, AnyPreviewState>>(new Map());\n\n let fileInputRef: HTMLInputElement | null = $state(null);\n let canvasRef: HTMLCanvasElement | null = $state(null);\n\n const services: HandlerServices = {\n requestFile: ({ accept, onFile }) => {\n if (!fileInputRef) return;\n const input = fileInputRef;\n input.accept = accept;\n input.onchange = (e) => {\n const file = (e.target as HTMLInputElement).files?.[0];\n if (file) {\n onFile(file);\n input.value = '';\n }\n };\n input.click();\n },\n processImage: ({ source, maxWidth, maxHeight, onComplete }) => {\n const canvas = canvasRef;\n if (!canvas || !canvas.getContext) return;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n\n const img = new Image();\n img.crossOrigin = 'Anonymous';\n img.onload = () => {\n let { naturalWidth: width, naturalHeight: height } = img;\n\n // --- SCALING LOGIC ---\n // Calculate the scale factor to fit within maxWidth and maxHeight\n const scaleX = maxWidth ? maxWidth / width : 1;\n const scaleY = maxHeight ? maxHeight / height : 1;\n const scaleFactor = Math.min(scaleX, scaleY, 1); // Ensure we don't scale up\n\n const finalWidth = width * scaleFactor;\n const finalHeight = height * scaleFactor;\n\n canvas.width = finalWidth;\n canvas.height = finalHeight;\n ctx.drawImage(img, 0, 0, finalWidth, finalHeight);\n\n const imageData = ctx.getImageData(0, 0, finalWidth, finalHeight);\n if (typeof source !== 'string') URL.revokeObjectURL(img.src);\n\n onComplete({ imageData, width: finalWidth, height: finalHeight });\n };\n img.src = typeof source === 'string' ? source : URL.createObjectURL(source);\n },\n };\n\n $effect(() => {\n if (!annotationPlugin.plugin) return;\n\n return annotationPlugin.plugin.registerPageHandlers(documentId, pageIndex, scale, {\n services,\n onPreview: (toolId, state) => {\n previews = new Map(previews);\n if (state) {\n previews.set(toolId, state);\n } else {\n previews.delete(toolId);\n }\n },\n });\n });\n</script>\n\n<!-- Hidden DOM elements required by services -->\n<input bind:this={fileInputRef} type=\"file\" style:display=\"none\" />\n<canvas bind:this={canvasRef} style:display=\"none\"></canvas>\n\n<!-- Render any active previews from any tool -->\n{#each Array.from(previews.entries()) as [toolId, preview] (toolId)}\n <PreviewRenderer {preview} {scale} />\n{/each}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { AnnotationPluginPackage as BaseAnnotationPackage } from '@embedpdf/plugin-annotation';\nimport RendererRegistryProvider from './components/RendererRegistryProvider.svelte';\n\nexport * from './hooks';\nexport * from './components';\nexport * from './types';\nexport * from './context';\nexport * from '@embedpdf/plugin-annotation';\n\nexport const AnnotationPluginPackage = createPluginPackage(BaseAnnotationPackage)\n .addWrapper(RendererRegistryProvider)\n .build();\n","<script lang=\"ts\">\n import { Rotation, type PdfAnnotationObject } from '@embedpdf/models';\n import { useDocumentState } from '@embedpdf/core/svelte';\n import type { HTMLAttributes } from 'svelte/elements';\n import type {\n AnnotationSelectionMenuProps,\n AnnotationSelectionMenuRenderFn,\n GroupSelectionMenuProps,\n GroupSelectionMenuRenderFn,\n CustomAnnotationRenderer,\n ResizeHandleUI,\n VertexHandleUI,\n } from '../types';\n import { getRendererRegistry, type BoxedAnnotationRenderer } from '../context';\n import Annotations from './Annotations.svelte';\n import TextMarkup from './TextMarkup.svelte';\n import AnnotationPaintLayer from './AnnotationPaintLayer.svelte';\n import type { Snippet } from 'svelte';\n\n type AnnotationLayerProps = Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {\n /** The ID of the document that this layer displays annotations for */\n documentId: string;\n pageIndex: number;\n scale?: number;\n rotation?: number;\n /** Render function for selection menu (schema-driven approach) */\n selectionMenu?: AnnotationSelectionMenuRenderFn;\n /** Snippet for custom selection menu (slot-based approach) */\n selectionMenuSnippet?: Snippet<[AnnotationSelectionMenuProps]>;\n /** Render function for group selection menu (schema-driven approach) */\n groupSelectionMenu?: GroupSelectionMenuRenderFn;\n /** Snippet for custom group selection menu (slot-based approach) */\n groupSelectionMenuSnippet?: Snippet<[GroupSelectionMenuProps]>;\n style?: Record<string, string | number | undefined>;\n /** Customize resize handles */\n resizeUI?: ResizeHandleUI;\n /** Customize vertex handles */\n vertexUI?: VertexHandleUI;\n /** Customize selection outline color */\n selectionOutlineColor?: string;\n /** Customize annotation renderer */\n customAnnotationRenderer?: CustomAnnotationRenderer<PdfAnnotationObject>;\n /** Custom annotation renderers from props */\n annotationRenderers?: BoxedAnnotationRenderer[];\n };\n\n let {\n style,\n documentId,\n pageIndex,\n scale: overrideScale,\n rotation: overrideRotation,\n selectionMenu,\n selectionMenuSnippet,\n groupSelectionMenu,\n groupSelectionMenuSnippet,\n resizeUI,\n vertexUI,\n selectionOutlineColor,\n customAnnotationRenderer,\n annotationRenderers,\n ...restProps\n }: AnnotationLayerProps = $props();\n\n // Get registry and merge with props\n const registry = getRendererRegistry();\n\n const allRenderers = $derived.by(() => {\n const fromRegistry = registry?.getAll() ?? [];\n const fromProps = annotationRenderers ?? [];\n const merged = [...fromRegistry];\n for (const r of fromProps) {\n const idx = merged.findIndex((m) => m.id === r.id);\n if (idx >= 0) merged[idx] = r;\n else merged.push(r);\n }\n return merged;\n });\n\n const documentState = useDocumentState(() => documentId);\n\n const page = $derived(documentState?.current?.document?.pages?.[pageIndex]);\n const pageWidth = $derived(page?.size?.width ?? 0);\n const pageHeight = $derived(page?.size?.height ?? 0);\n\n const actualScale = $derived(\n overrideScale !== undefined ? overrideScale : (documentState?.current?.scale ?? 1),\n );\n\n const actualRotation = $derived(\n overrideRotation !== undefined\n ? overrideRotation\n : (documentState?.current?.rotation ?? Rotation.Degree0),\n );\n</script>\n\n<div\n id=\"annotation-layer\"\n {...style ? Object.fromEntries(Object.entries(style).map(([k, v]) => [`style:${k}`, v])) : {}}\n {...restProps}\n>\n <Annotations\n {documentId}\n {selectionMenu}\n {selectionMenuSnippet}\n {groupSelectionMenu}\n {groupSelectionMenuSnippet}\n {pageIndex}\n scale={actualScale}\n rotation={actualRotation}\n {pageWidth}\n {pageHeight}\n {resizeUI}\n {vertexUI}\n {selectionOutlineColor}\n {customAnnotationRenderer}\n annotationRenderers={allRenderers}\n />\n <TextMarkup {documentId} {pageIndex} scale={actualScale} />\n <AnnotationPaintLayer {documentId} {pageIndex} scale={actualScale} />\n</div>\n"],"names":["REGISTRY_KEY","Symbol","createRendererRegistry","renderers","$","state","proxy","register","entries","ids","Set","map","e","id","filter","r","has","set","some","getAll","provideRendererRegistry","registry","setContext","getRendererRegistry","getContext","useAnnotationCapability","useCapability","AnnotationPlugin","useAnnotationPlugin","usePlugin","isMultiSelected","lockAspectRatio","propsClass","outlineOffset","zIndex","selectionOutlineColor","restProps","rest_props","$$props","preview","trackedAnnotation","object","annotationCapability","annotationPlugin","permissions","useDocumentPermissions","documentId","gestureBaseRef","gestureBaseRectRef","effectiveIsDraggable","derived","canModifyAnnotations","effectiveIsResizable","guardedOnDoubleClick","annotationProvides","provides","forDocument","currentObject","HANDLE_COLOR","_a","resizeUI","color","VERTEX_COLOR","vertexUI","HANDLE_SIZE","size","VERTEX_SIZE","showOutline","user_effect","plugin","handleEvent","event","patch","previewPatches","type","untrack","get","unsubs","onDragChange","onResizeChange","forEach","u","interactionHandles","useInteractionHandles","controller","element","rect","vertices","vertexConfig","extractVertices","constraints","minWidth","minHeight","boundingBox","width","pageWidth","height","pageHeight","maintainAspectRatio","pageRotation","rotation","scale","enabled","onUpdate","transformData","changes","metadata","pageSize","startDrag","annotationIds","startResize","resizeHandle","handle","delta","x","origin","y","updateDrag","updateResize","base","vertexChanges","transformAnnotation","patched","_b","sanitized","deepToRaw","updateAnnotation","pageIndex","commitDrag","commitResize","handleSize","spacing","offsetMode","includeSides","vertexSize","includeVertices","resizeHandles","resize","vertexHandles","shouldShowMenu","selectionMenu","selectionMenuSnippet","menuPlacement","suggestTop","spaceAbove","spaceBelow","div","root","div_1","isSelected","dragProps","left","top","annotation","children","onSelect","key","style","handleStyle","hProps","$$anchor","$$item","exclude_from_object","Component","component","Component_1","div_2","root_6","consequent_1","$$render","alternate_1","consequent_2","vertexStyle","vProps","Component_2","div_3","root_10","consequent_3","alternate_2","consequent_4","$$node","$$action_arg","doublePress","onDouble","$$arg0","menuProps","menuWrapperProps","context","selected","placement","buildMenuProps","result","result_component","spread_props","props","consequent_5","CounterRotate","consequent_8","opacity","resolvedColor","b","root_1","tabindex","onClick","cursor","Object","fromEntries","k","v","thickness","styles","amplitude","period","svg","svgDataUri","encodeURIComponent","paths","inkList","points","d","i","length","trim","index","path","__pointerdown","$$args","__touchstart","set_attribute","styles_1","strokeStyle","prop","PdfAnnotationBorderStyle","SOLID","$$d","outerW","outerH","Math","max","svgWidth","strokeWidth","svgHeight","dash","DASHED","strokeDashArray","join","rect_1","innerW","innerH","cx","cy","rx","ry","peValue","ellipse","$0","strokeColor","x1","start","y1","x2","end","y2","endings","angle","atan2","patching","createEnding","PI","lineEndings","line","transform","filled","styles_2","consequent","path_1","root_2","styles_3","localPts","pathData","first","rest","p","toAngle","a","startRad","endRad","path_2","stroke","allPoints","currentVertex","isPreview","isPreviewing","fill","editorRef","isIOS","focus","selection","getSelection","call","window","range","document","createRange","selectNodeContents","collapse","removeAllRanges","addRange","user_pre_effect","nav","navigator","ios","test","userAgent","platform","maxTouchPoints","computedFontPx","fontSize","needsComp","isEditing","adjustedFontPx","scaleComp","invScalePercent","justify","verticalAlign","PdfVerticalAlignment","Top","Middle","span","$$value","set_text","text","contents","fontColor","standardFontCss","fontFamily","textAlignmentToCss","textAlign","backgroundColor","innerText","scaleFactor","imageUrl","urlRef","handleImageLoad","URL","revokeObjectURL","task","renderAnnotation","options","dpr","devicePixelRatio","wait","blob","url","createObjectURL","ignore","abort","code","PdfErrorCode","Cancelled","message","img","annotationProp","RenderAnnotation","UNDERLINE","hasIRT","dashArray","isUnderline","hitAreaCursor","hitAreaPointerEvents","apply","this","rect_2","$1","alternate","gestureBase","isDraggingRef","isResizingRef","isDraggable","isResizable","getGroupBox","rects","selectedAnnotations","ta","boundingRectOrEmpty","groupBox","previewGroupBox","newBox","transformType","isMove","isResize","newRect","rawDelta","clampedDelta","newGroupBox","groupSelectionMenu","groupSelectionMenuSnippet","onpointerdown","stopPropagation","root_5","annotations","consequent_6","annotationsProps","selectionCapability","useSelectionCapability","pointerHandlers","usePointerHandlers","allSelectedIds","editingId","currentState","getState","getAnnotationsByPageIndex","getSelectedAnnotationIds","off","onStateChange","handlers","onPointerDown","_","pe","target","currentTarget","deselectAnnotation","handleClick","clear","metaKey","ctrlKey","toggleSelection","selectAnnotation","handleLinkClick","inReplyToId","parentId","parent","find","selectedAnnotationsOnPage","anno","includes","areAllSelectedDraggable","every","tool","findToolForAnnotation","groupDraggable","resolveInteractionProp","interaction","isGroupDraggable","singleDraggable","areAllSelectedResizable","groupResizable","isGroupResizable","singleResizable","allSelectedOnSamePage","getSelectedAnnotations","mixBlendMode","blendModeToCss","blendMode","PdfBlendMode","Normal","customRenderer","annotationRenderers","matches","findCustomRenderer","_obj","noop","CustomComponent","CustomComponent_1","$2","AnnotationContainer","$$slots","default","obj","Ink","Square","Circle","Underline","Strikeout","Squiggly","Highlight","Multiply","Line","linePoints","Polyline","$3","$5","Polygon","FreeText","onDoubleClick","_object","Stamp","Link","isLink","consequent_13","isStamp","consequent_12","isFreeText","consequent_11","isPolygon","consequent_10","isPolyline","consequent_9","alternate_3","isLine","alternate_4","isHighlight","consequent_7","alternate_5","isSquiggly","alternate_6","isStrikeout","alternate_7","alternate_8","isCircle","alternate_9","isSquare","alternate_10","isInk","alternate_11","alternate_12","GroupSelectionBox","consequent_14","boundingRect","activeTool","selectionProvides","onSelectionChange","getHighlightRectsForPage","getBoundingRectForPage","getActiveTool","onActiveToolChange","defaults","PdfAnnotationSubtype","HIGHLIGHT","node_2","root_4","node_4","node_6","root_8","node_8","SQUIGGLY","STRIKEOUT","bounds","data","root_3","root_7","div_4","root_9","styles_4","div_5","root_11","styles_5","div_6","root_13","div_7","styles_6","styles_7","FREETEXT","INK","LINE","POLYLINE","POLYGON","SQUARE","CIRCLE","previews","Map","fileInputRef","canvasRef","services","requestFile","accept","onFile","input","onchange","file","files","value","click","processImage","source","maxWidth","maxHeight","onComplete","canvas","ctx","Image","crossOrigin","onload","naturalWidth","naturalHeight","scaleX","scaleY","min","finalWidth","finalHeight","drawImage","imageData","getImageData","src","registerPageHandlers","onPreview","toolId","delete","input_1","first_child","fragment","display","canvas_1","Array","from","PreviewRenderer","$$array","AnnotationPluginPackage","createPluginPackage","BaseAnnotationPackage","addWrapper","RendererRegistryProvider","build","allRenderers","fromRegistry","fromProps","merged","idx","findIndex","m","push","documentState","useDocumentState","page","_c","current","pages","actualScale","actualRotation","Rotation","Degree0","attribute_effect","Annotations","node","TextMarkup","node_1","AnnotationPaintLayer","entry","getDocumentId","capability","initialDocumentState","scopedProvides","docId","scope","newState"],"mappings":"0uBAoBMA,EAAeC,OAAO,8BAEZ,SAAAC,IACV,IAAAC,EAAYC,EAAAC,MAAAD,EAAAE,MAAA,YAGd,QAAAC,CAASC,SACDC,EAAA,IAAUC,IAAIF,EAAQG,IAAKC,GAAMA,EAAEC,kBAEzCV,YAAgBA,GAAUW,OAAQC,IAAON,EAAIO,IAAID,EAAEF,QAASL,YAG1DJ,EAAAa,IAAAd,QAAYA,GAAUW,OAAQC,IAAOP,EAAQU,KAAMN,GAAMA,EAAEC,KAAOE,EAAEF,MAAE,GAE1E,EACAM,OAAA,UACShB,GAGb,CAEgB,SAAAiB,IACR,MAAAC,EAAWnB,WACjBoB,EAAAA,WAAWtB,EAAcqB,GAClBA,CACT,CAEgB,SAAAE,WACPC,EAAAA,WAAuCxB,IAAiB,IACjE,8BC3CEoB,0FACM,CCCK,MAAAK,EAAA,IAAgCC,gBAAgCC,EAAAA,iBAAiBd,IACjFe,EAAA,IAA4BC,YAA4BF,EAAAA,iBAAiBd,6KCkBlF,IAAAiB,gCAAkB,GAGlBC,gCAAkB,GAEXC,qBAAa,IAIpBC,6BAAgB,GAGhBC,sBAA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