@embedpdf/plugin-annotation 2.13.0 → 2.14.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.
Files changed (53) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +522 -7
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/annotation-plugin.d.ts +25 -0
  6. package/dist/lib/handlers/callout-free-text.handler.d.ts +3 -0
  7. package/dist/lib/handlers/index.d.ts +1 -0
  8. package/dist/lib/handlers/types.d.ts +7 -1
  9. package/dist/lib/helpers.d.ts +8 -0
  10. package/dist/lib/patching/patch-utils.d.ts +38 -1
  11. package/dist/lib/patching/patches/callout-freetext.patch.d.ts +3 -0
  12. package/dist/lib/patching/patches/index.d.ts +1 -0
  13. package/dist/lib/tools/default-tools.d.ts +35 -0
  14. package/dist/lib/types.d.ts +21 -2
  15. package/dist/preact/index.cjs +1 -1
  16. package/dist/preact/index.cjs.map +1 -1
  17. package/dist/preact/index.js +422 -32
  18. package/dist/preact/index.js.map +1 -1
  19. package/dist/react/index.cjs +1 -1
  20. package/dist/react/index.cjs.map +1 -1
  21. package/dist/react/index.js +422 -32
  22. package/dist/react/index.js.map +1 -1
  23. package/dist/shared/components/annotation-container.d.ts +13 -1
  24. package/dist/shared/components/annotations/callout-free-text-preview.d.ts +15 -0
  25. package/dist/shared/components/annotations/callout-free-text.d.ts +15 -0
  26. package/dist/shared/components/types.d.ts +12 -0
  27. package/dist/shared-preact/components/annotation-container.d.ts +13 -1
  28. package/dist/shared-preact/components/annotations/callout-free-text-preview.d.ts +15 -0
  29. package/dist/shared-preact/components/annotations/callout-free-text.d.ts +15 -0
  30. package/dist/shared-preact/components/types.d.ts +12 -0
  31. package/dist/shared-react/components/annotation-container.d.ts +13 -1
  32. package/dist/shared-react/components/annotations/callout-free-text-preview.d.ts +15 -0
  33. package/dist/shared-react/components/annotations/callout-free-text.d.ts +15 -0
  34. package/dist/shared-react/components/types.d.ts +12 -0
  35. package/dist/svelte/components/annotations/CalloutFreeText.svelte.d.ts +15 -0
  36. package/dist/svelte/components/annotations/CalloutFreeTextPreview.svelte.d.ts +10 -0
  37. package/dist/svelte/components/renderers/CalloutFreeTextRenderer.svelte.d.ts +5 -0
  38. package/dist/svelte/components/types.d.ts +12 -0
  39. package/dist/svelte/index.cjs +1 -1
  40. package/dist/svelte/index.cjs.map +1 -1
  41. package/dist/svelte/index.js +528 -106
  42. package/dist/svelte/index.js.map +1 -1
  43. package/dist/svelte/types.d.ts +12 -0
  44. package/dist/vue/components/annotation-container.vue.d.ts +12 -0
  45. package/dist/vue/components/annotations/callout-free-text-preview.vue.d.ts +10 -0
  46. package/dist/vue/components/annotations/callout-free-text.vue.d.ts +25 -0
  47. package/dist/vue/components/renderers/callout-free-text-renderer.vue.d.ts +6 -0
  48. package/dist/vue/index.cjs +1 -1
  49. package/dist/vue/index.cjs.map +1 -1
  50. package/dist/vue/index.js +601 -211
  51. package/dist/vue/index.js.map +1 -1
  52. package/dist/vue/types.d.ts +12 -0
  53. package/package.json +12 -12
@@ -1,5 +1,5 @@
1
1
  import { createPluginPackage } from "@embedpdf/core";
2
- import { AnnotationPlugin, initialDocumentState, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, LockModeType, getAnnotationsByPageIndex, getSelectedAnnotationIds, resolveInteractionProp, getAnnotationCategories, hasLockedFlag, isCategoryLocked, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
2
+ import { AnnotationPlugin, initialDocumentState, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, LockModeType, getAnnotationsByPageIndex, getSelectedAnnotationIds, resolveInteractionProp, hasNoViewFlag, hasHiddenFlag, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
3
3
  export * from "@embedpdf/plugin-annotation";
4
4
  import "svelte/internal/disclose-version";
5
5
  import * as $ from "svelte/internal/client";
@@ -161,7 +161,7 @@ function AnnotationNavigationHandler($$anchor, $$props) {
161
161
  });
162
162
  $.pop();
163
163
  }
164
- var root_1$f = $.from_html(`<img alt="" draggable="false"/>`);
164
+ var root_1$h = $.from_html(`<img alt="" draggable="false"/>`);
165
165
  function AppearanceImage($$anchor, $$props) {
166
166
  $.push($$props, true);
167
167
  let imageUrl = $.state(null);
@@ -187,7 +187,7 @@ function AppearanceImage($$anchor, $$props) {
187
187
  var node = $.first_child(fragment);
188
188
  {
189
189
  var consequent = ($$anchor2) => {
190
- var img = root_1$f();
190
+ var img = root_1$h();
191
191
  $.template_effect(() => {
192
192
  $.set_attribute(img, "src", $.get(imageUrl));
193
193
  $.set_style(img, `position: absolute; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; ${$$props.style ?? "" ?? ""}`);
@@ -203,17 +203,17 @@ function AppearanceImage($$anchor, $$props) {
203
203
  $.append($$anchor, fragment);
204
204
  $.pop();
205
205
  }
206
- var root_4$7 = $.from_html(`<div></div> <div></div> <div></div>`, 1);
206
+ var root_4$8 = $.from_html(`<div></div> <div></div> <div></div>`, 1);
207
207
  var root_6$2 = $.from_html(`<div style="display: contents;"><!></div>`);
208
208
  var root_8$1 = $.from_html(`<div></div>`);
209
209
  var root_7 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
210
210
  var root_12 = $.from_html(`<div></div>`);
211
211
  var root_16 = $.from_html(`<div></div>`);
212
212
  var root_23 = $.from_html(`<div><div> </div></div>`);
213
- var root$i = $.from_html(`<div data-no-interaction=""><div><div><!> <!></div></div> <div><!> <!> <div><!> <!></div></div> <!> <!></div>`);
213
+ var root$j = $.from_html(`<div data-no-interaction=""><div><div><!> <!></div></div> <div><!> <!> <div><!> <!></div></div> <!> <!></div>`);
214
214
  function AnnotationContainer($$anchor, $$props) {
215
215
  $.push($$props, true);
216
- let isEditing = $.prop($$props, "isEditing", 3, false), isMultiSelected = $.prop($$props, "isMultiSelected", 3, false), isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), propsClass = $.prop($$props, "class", 3, ""), outlineOffset = $.prop($$props, "outlineOffset", 3, 1), zIndex = $.prop($$props, "zIndex", 3, 1), restProps = $.rest_props($$props, [
216
+ let isEditing = $.prop($$props, "isEditing", 3, false), isMultiSelected = $.prop($$props, "isMultiSelected", 3, false), isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), propsClass = $.prop($$props, "class", 3, ""), structurallyLocked = $.prop($$props, "structurallyLocked", 3, false), contentLocked = $.prop($$props, "contentLocked", 3, false), outlineOffset = $.prop($$props, "outlineOffset", 3, 1), zIndex = $.prop($$props, "zIndex", 3, 1), restProps = $.rest_props($$props, [
217
217
  "$$slots",
218
218
  "$$events",
219
219
  "$$legacy",
@@ -238,6 +238,8 @@ function AnnotationContainer($$anchor, $$props) {
238
238
  "vertexConfig",
239
239
  "selectionMenu",
240
240
  "selectionMenuSnippet",
241
+ "structurallyLocked",
242
+ "contentLocked",
241
243
  "outlineOffset",
242
244
  "onDoubleClick",
243
245
  "onSelect",
@@ -545,7 +547,9 @@ function AnnotationContainer($$anchor, $$props) {
545
547
  return {
546
548
  type: "annotation",
547
549
  annotation: $$props.trackedAnnotation,
548
- pageIndex: $$props.pageIndex
550
+ pageIndex: $$props.pageIndex,
551
+ structurallyLocked: structurallyLocked(),
552
+ contentLocked: contentLocked()
549
553
  };
550
554
  }
551
555
  function buildMenuProps(rect, menuWrapperProps) {
@@ -569,7 +573,7 @@ function AnnotationContainer($$anchor, $$props) {
569
573
  }
570
574
  };
571
575
  }
572
- var div = root$i();
576
+ var div = root$j();
573
577
  var div_1 = $.child(div);
574
578
  let styles;
575
579
  var div_2 = $.child(div_1);
@@ -644,7 +648,7 @@ function AnnotationContainer($$anchor, $$props) {
644
648
  var node_5 = $.child(div_3);
645
649
  {
646
650
  var consequent_2 = ($$anchor2) => {
647
- var fragment_3 = root_4$7();
651
+ var fragment_3 = root_4$8();
648
652
  var div_4 = $.first_child(fragment_3);
649
653
  let styles_2;
650
654
  var div_5 = $.sibling(div_4, 2);
@@ -1101,13 +1105,13 @@ function getAnnotationScreenBounds(annotation, scale, rotation) {
1101
1105
  bottom: top + maxY
1102
1106
  };
1103
1107
  }
1104
- var root_2$a = $.from_html(`<div></div> <div></div> <div></div>`, 1);
1105
- var root_4$6 = $.from_html(`<div style="display: contents;"><!></div>`);
1108
+ var root_2$c = $.from_html(`<div></div> <div></div> <div></div>`, 1);
1109
+ var root_4$7 = $.from_html(`<div style="display: contents;"><!></div>`);
1106
1110
  var root_6$1 = $.from_html(`<div></div>`);
1107
- var root_5$5 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
1111
+ var root_5$6 = $.from_html(`<div style="display: contents;"><!> <div><svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path></svg></div></div>`);
1108
1112
  var root_10 = $.from_html(`<div></div>`);
1109
1113
  var root_11 = $.from_html(`<div><div> </div></div>`);
1110
- var root_1$e = $.from_html(`<div data-group-selection-box="" data-no-interaction=""><div><!> <!> <div><!></div></div> <!> <!></div>`);
1114
+ var root_1$g = $.from_html(`<div data-group-selection-box="" data-no-interaction=""><div><!> <!> <div><!></div></div> <!> <!></div>`);
1111
1115
  function GroupSelectionBox($$anchor, $$props) {
1112
1116
  $.push($$props, true);
1113
1117
  let isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), zIndex = $.prop($$props, "zIndex", 3, 2);
@@ -1390,13 +1394,13 @@ function GroupSelectionBox($$anchor, $$props) {
1390
1394
  var node_1 = $.first_child(fragment);
1391
1395
  {
1392
1396
  var consequent_11 = ($$anchor2) => {
1393
- var div = root_1$e();
1397
+ var div = root_1$g();
1394
1398
  var div_1 = $.child(div);
1395
1399
  let styles;
1396
1400
  var node_2 = $.child(div_1);
1397
1401
  {
1398
1402
  var consequent = ($$anchor3) => {
1399
- var fragment_1 = root_2$a();
1403
+ var fragment_1 = root_2$c();
1400
1404
  var div_2 = $.first_child(fragment_1);
1401
1405
  let styles_1;
1402
1406
  var div_3 = $.sibling(div_2, 2);
@@ -1450,7 +1454,7 @@ function GroupSelectionBox($$anchor, $$props) {
1450
1454
  var node_4 = $.first_child(fragment_2);
1451
1455
  {
1452
1456
  var consequent_1 = ($$anchor4) => {
1453
- var div_5 = root_4$6();
1457
+ var div_5 = root_4$7();
1454
1458
  div_5.__pointermove = (e) => {
1455
1459
  if (!$.get(rotationActive)) $.set(cursorScreen, { x: e.clientX, y: e.clientY }, true);
1456
1460
  };
@@ -1480,7 +1484,7 @@ function GroupSelectionBox($$anchor, $$props) {
1480
1484
  $.append($$anchor4, div_5);
1481
1485
  };
1482
1486
  var alternate = ($$anchor4) => {
1483
- var div_6 = root_5$5();
1487
+ var div_6 = root_5$6();
1484
1488
  div_6.__pointermove = (e) => {
1485
1489
  if (!$.get(rotationActive)) $.set(cursorScreen, { x: e.clientX, y: e.clientY }, true);
1486
1490
  };
@@ -1735,7 +1739,7 @@ function GroupSelectionBox($$anchor, $$props) {
1735
1739
  $.pop();
1736
1740
  }
1737
1741
  $.delegate(["pointermove"]);
1738
- var root$h = $.from_html(`<div role="link" tabindex="-1"></div>`);
1742
+ var root$i = $.from_html(`<div role="link" tabindex="-1"></div>`);
1739
1743
  function LinkLockedMode($$anchor, $$props) {
1740
1744
  $.push($$props, true);
1741
1745
  const { provides } = useAnnotationCapability();
@@ -1744,7 +1748,7 @@ function LinkLockedMode($$anchor, $$props) {
1744
1748
  if (!target || !provides) return;
1745
1749
  provides.forDocument($$props.documentId).navigateTarget(target);
1746
1750
  }
1747
- var div = root$h();
1751
+ var div = root$i();
1748
1752
  div.__click = handleClick;
1749
1753
  div.__keydown = (e) => {
1750
1754
  if (e.key === "Enter") handleClick();
@@ -1759,10 +1763,10 @@ function LinkLockedMode($$anchor, $$props) {
1759
1763
  $.pop();
1760
1764
  }
1761
1765
  $.delegate(["click", "keydown"]);
1762
- var root$g = $.from_html(`<div></div>`);
1766
+ var root$h = $.from_html(`<div></div>`);
1763
1767
  function LinkPreview($$anchor, $$props) {
1764
1768
  $.push($$props, true);
1765
- var div = root$g();
1769
+ var div = root$h();
1766
1770
  let styles;
1767
1771
  $.template_effect(() => styles = $.set_style(div, "", styles, {
1768
1772
  position: "absolute",
@@ -1777,9 +1781,9 @@ function LinkPreview($$anchor, $$props) {
1777
1781
  $.append($$anchor, div);
1778
1782
  $.pop();
1779
1783
  }
1780
- var root_1$d = $.from_svg(`<path fill="none" stroke="transparent"></path>`);
1781
- var root_3$3 = $.from_svg(`<path fill="none"></path>`);
1782
- var root$f = $.from_svg(`<svg><!><!></svg>`);
1784
+ var root_1$f = $.from_svg(`<path fill="none" stroke="transparent"></path>`);
1785
+ var root_3$5 = $.from_svg(`<path fill="none"></path>`);
1786
+ var root$g = $.from_svg(`<svg><!><!></svg>`);
1783
1787
  function Ink($$anchor, $$props) {
1784
1788
  $.push($$props, true);
1785
1789
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -1798,11 +1802,11 @@ function Ink($$anchor, $$props) {
1798
1802
  const width = $.derived(() => $$props.rect.size.width * $$props.scale);
1799
1803
  const height = $.derived(() => $$props.rect.size.height * $$props.scale);
1800
1804
  const hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
1801
- var svg = root$f();
1805
+ var svg = root$g();
1802
1806
  let styles;
1803
1807
  var node = $.child(svg);
1804
1808
  $.each(node, 19, () => $.get(paths), (d, i) => `hit-${i}`, ($$anchor2, d) => {
1805
- var path = root_1$d();
1809
+ var path = root_1$f();
1806
1810
  path.__pointerdown = function(...$$args) {
1807
1811
  var _a;
1808
1812
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -1826,7 +1830,7 @@ function Ink($$anchor, $$props) {
1826
1830
  var fragment = $.comment();
1827
1831
  var node_2 = $.first_child(fragment);
1828
1832
  $.each(node_2, 19, () => $.get(paths), (d, i) => `vis-${i}`, ($$anchor3, d) => {
1829
- var path_1 = root_3$3();
1833
+ var path_1 = root_3$5();
1830
1834
  let styles_2;
1831
1835
  $.template_effect(() => {
1832
1836
  $.set_attribute(path_1, "d", $.get(d));
@@ -1869,11 +1873,11 @@ function InkPreview($$anchor, $$props) {
1869
1873
  () => $$props.data
1870
1874
  ));
1871
1875
  }
1872
- var root_1$c = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
1873
- var root_2$9 = $.from_svg(`<rect fill="transparent" stroke="transparent"></rect>`);
1874
- var root_4$5 = $.from_svg(`<path stroke-linejoin="round"></path>`);
1875
- var root_5$4 = $.from_svg(`<rect></rect>`);
1876
- var root$e = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
1876
+ var root_1$e = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
1877
+ var root_2$b = $.from_svg(`<rect fill="transparent" stroke="transparent"></rect>`);
1878
+ var root_4$6 = $.from_svg(`<path stroke-linejoin="round"></path>`);
1879
+ var root_5$5 = $.from_svg(`<rect></rect>`);
1880
+ var root$f = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
1877
1881
  function Square($$anchor, $$props) {
1878
1882
  $.push($$props, true);
1879
1883
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -1912,12 +1916,12 @@ function Square($$anchor, $$props) {
1912
1916
  var _a;
1913
1917
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
1914
1918
  });
1915
- var svg = root$e();
1919
+ var svg = root$f();
1916
1920
  let styles;
1917
1921
  var node = $.child(svg);
1918
1922
  {
1919
1923
  var consequent = ($$anchor2) => {
1920
- var path = root_1$c();
1924
+ var path = root_1$e();
1921
1925
  path.__pointerdown = function(...$$args) {
1922
1926
  var _a;
1923
1927
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -1934,7 +1938,7 @@ function Square($$anchor, $$props) {
1934
1938
  $.append($$anchor2, path);
1935
1939
  };
1936
1940
  var alternate = ($$anchor2) => {
1937
- var rect_1 = root_2$9();
1941
+ var rect_1 = root_2$b();
1938
1942
  rect_1.__pointerdown = function(...$$args) {
1939
1943
  var _a;
1940
1944
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -1965,7 +1969,7 @@ function Square($$anchor, $$props) {
1965
1969
  var node_2 = $.first_child(fragment);
1966
1970
  {
1967
1971
  var consequent_1 = ($$anchor3) => {
1968
- var path_1 = root_4$5();
1972
+ var path_1 = root_4$6();
1969
1973
  let styles_3;
1970
1974
  $.template_effect(() => {
1971
1975
  $.set_attribute(path_1, "d", $.get(cloudyPath).path);
@@ -1980,7 +1984,7 @@ function Square($$anchor, $$props) {
1980
1984
  $.append($$anchor3, path_1);
1981
1985
  };
1982
1986
  var alternate_1 = ($$anchor3) => {
1983
- var rect_2 = root_5$4();
1987
+ var rect_2 = root_5$5();
1984
1988
  let styles_4;
1985
1989
  $.template_effect(() => {
1986
1990
  $.set_attribute(rect_2, "x", $.get(x));
@@ -2034,11 +2038,11 @@ function SquarePreview($$anchor, $$props) {
2034
2038
  () => $$props.data
2035
2039
  ));
2036
2040
  }
2037
- var root_1$b = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2038
- var root_2$8 = $.from_svg(`<ellipse fill="transparent" stroke="transparent"></ellipse>`);
2039
- var root_4$4 = $.from_svg(`<path stroke-linejoin="round"></path>`);
2040
- var root_5$3 = $.from_svg(`<ellipse></ellipse>`);
2041
- var root$d = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
2041
+ var root_1$d = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2042
+ var root_2$a = $.from_svg(`<ellipse fill="transparent" stroke="transparent"></ellipse>`);
2043
+ var root_4$5 = $.from_svg(`<path stroke-linejoin="round"></path>`);
2044
+ var root_5$4 = $.from_svg(`<ellipse></ellipse>`);
2045
+ var root$e = $.from_svg(`<svg overflow="visible"><!><!></svg>`);
2042
2046
  function Circle($$anchor, $$props) {
2043
2047
  $.push($$props, true);
2044
2048
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -2076,12 +2080,12 @@ function Circle($$anchor, $$props) {
2076
2080
  let svgHeight = $.derived(() => $.get(height) * $$props.scale);
2077
2081
  let hitStrokeWidth = $.derived(() => Math.max($$props.strokeWidth, MIN_HIT_AREA_SCREEN_PX / $$props.scale));
2078
2082
  let peValue = $.derived(() => !$$props.onClick ? "none" : $$props.isSelected ? "none" : color() === "transparent" ? "visibleStroke" : "visible");
2079
- var svg = root$d();
2083
+ var svg = root$e();
2080
2084
  let styles;
2081
2085
  var node = $.child(svg);
2082
2086
  {
2083
2087
  var consequent = ($$anchor2) => {
2084
- var path = root_1$b();
2088
+ var path = root_1$d();
2085
2089
  path.__pointerdown = (e) => {
2086
2090
  var _a;
2087
2091
  return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
@@ -2098,7 +2102,7 @@ function Circle($$anchor, $$props) {
2098
2102
  $.append($$anchor2, path);
2099
2103
  };
2100
2104
  var alternate = ($$anchor2) => {
2101
- var ellipse = root_2$8();
2105
+ var ellipse = root_2$a();
2102
2106
  ellipse.__pointerdown = (e) => {
2103
2107
  var _a;
2104
2108
  return (_a = $$props.onClick) == null ? void 0 : _a.call($$props, e);
@@ -2129,7 +2133,7 @@ function Circle($$anchor, $$props) {
2129
2133
  var node_2 = $.first_child(fragment);
2130
2134
  {
2131
2135
  var consequent_1 = ($$anchor3) => {
2132
- var path_1 = root_4$4();
2136
+ var path_1 = root_4$5();
2133
2137
  $.set_style(path_1, "", {}, { "pointer-events": "none" });
2134
2138
  $.template_effect(() => {
2135
2139
  $.set_attribute(path_1, "d", $.get(cloudyPath).path);
@@ -2141,7 +2145,7 @@ function Circle($$anchor, $$props) {
2141
2145
  $.append($$anchor3, path_1);
2142
2146
  };
2143
2147
  var alternate_1 = ($$anchor3) => {
2144
- var ellipse_1 = root_5$3();
2148
+ var ellipse_1 = root_5$4();
2145
2149
  $.set_style(ellipse_1, "", {}, { "pointer-events": "none" });
2146
2150
  $.template_effect(
2147
2151
  ($0) => {
@@ -2203,12 +2207,12 @@ function CirclePreview($$anchor, $$props) {
2203
2207
  () => $$props.data
2204
2208
  ));
2205
2209
  }
2206
- var root_1$a = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2207
- var root_2$7 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2208
- var root_4$3 = $.from_svg(`<path></path>`);
2209
- var root_5$2 = $.from_svg(`<path></path>`);
2210
- var root_3$2 = $.from_svg(`<line></line><!><!>`, 1);
2211
- var root$c = $.from_svg(`<svg><line stroke="transparent"></line><!><!><!></svg>`);
2210
+ var root_1$c = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2211
+ var root_2$9 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2212
+ var root_4$4 = $.from_svg(`<path></path>`);
2213
+ var root_5$3 = $.from_svg(`<path></path>`);
2214
+ var root_3$4 = $.from_svg(`<line></line><!><!>`, 1);
2215
+ var root$d = $.from_svg(`<svg><line stroke="transparent"></line><!><!><!></svg>`);
2212
2216
  function Line($$anchor, $$props) {
2213
2217
  $.push($$props, true);
2214
2218
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -2232,7 +2236,7 @@ function Line($$anchor, $$props) {
2232
2236
  var _a;
2233
2237
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
2234
2238
  });
2235
- var svg = root$c();
2239
+ var svg = root$d();
2236
2240
  let styles;
2237
2241
  var line = $.child(svg);
2238
2242
  line.__pointerdown = function(...$$args) {
@@ -2243,7 +2247,7 @@ function Line($$anchor, $$props) {
2243
2247
  var node = $.sibling(line);
2244
2248
  {
2245
2249
  var consequent = ($$anchor2) => {
2246
- var path = root_1$a();
2250
+ var path = root_1$c();
2247
2251
  path.__pointerdown = function(...$$args) {
2248
2252
  var _a;
2249
2253
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -2268,7 +2272,7 @@ function Line($$anchor, $$props) {
2268
2272
  var node_1 = $.sibling(node);
2269
2273
  {
2270
2274
  var consequent_1 = ($$anchor2) => {
2271
- var path_1 = root_2$7();
2275
+ var path_1 = root_2$9();
2272
2276
  path_1.__pointerdown = function(...$$args) {
2273
2277
  var _a;
2274
2278
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -2293,13 +2297,13 @@ function Line($$anchor, $$props) {
2293
2297
  var node_2 = $.sibling(node_1);
2294
2298
  {
2295
2299
  var consequent_4 = ($$anchor2) => {
2296
- var fragment = root_3$2();
2300
+ var fragment = root_3$4();
2297
2301
  var line_1 = $.first_child(fragment);
2298
2302
  let styles_4;
2299
2303
  var node_3 = $.sibling(line_1);
2300
2304
  {
2301
2305
  var consequent_2 = ($$anchor3) => {
2302
- var path_2 = root_4$3();
2306
+ var path_2 = root_4$4();
2303
2307
  let styles_5;
2304
2308
  $.template_effect(() => {
2305
2309
  $.set_attribute(path_2, "d", $.get(endings).start.d);
@@ -2322,7 +2326,7 @@ function Line($$anchor, $$props) {
2322
2326
  var node_4 = $.sibling(node_3);
2323
2327
  {
2324
2328
  var consequent_3 = ($$anchor3) => {
2325
- var path_3 = root_5$2();
2329
+ var path_3 = root_5$3();
2326
2330
  let styles_6;
2327
2331
  $.template_effect(() => {
2328
2332
  $.set_attribute(path_3, "d", $.get(endings).end.d);
@@ -2394,12 +2398,12 @@ function LinePreview($$anchor, $$props) {
2394
2398
  () => $$props.data
2395
2399
  ));
2396
2400
  }
2397
- var root_1$9 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2398
- var root_2$6 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2399
- var root_4$2 = $.from_svg(`<path></path>`);
2400
- var root_5$1 = $.from_svg(`<path></path>`);
2401
- var root_3$1 = $.from_svg(`<path></path><!><!>`, 1);
2402
- var root$b = $.from_svg(`<svg><path fill="none" stroke="transparent"></path><!><!><!></svg>`);
2401
+ var root_1$b = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2402
+ var root_2$8 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
2403
+ var root_4$3 = $.from_svg(`<path></path>`);
2404
+ var root_5$2 = $.from_svg(`<path></path>`);
2405
+ var root_3$3 = $.from_svg(`<path></path><!><!>`, 1);
2406
+ var root$c = $.from_svg(`<svg><path fill="none" stroke="transparent"></path><!><!><!></svg>`);
2403
2407
  function Polyline($$anchor, $$props) {
2404
2408
  $.push($$props, true);
2405
2409
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -2427,7 +2431,7 @@ function Polyline($$anchor, $$props) {
2427
2431
  var _a;
2428
2432
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
2429
2433
  });
2430
- var svg = root$b();
2434
+ var svg = root$c();
2431
2435
  let styles;
2432
2436
  var path = $.child(svg);
2433
2437
  path.__pointerdown = function(...$$args) {
@@ -2438,7 +2442,7 @@ function Polyline($$anchor, $$props) {
2438
2442
  var node = $.sibling(path);
2439
2443
  {
2440
2444
  var consequent = ($$anchor2) => {
2441
- var path_1 = root_1$9();
2445
+ var path_1 = root_1$b();
2442
2446
  path_1.__pointerdown = function(...$$args) {
2443
2447
  var _a;
2444
2448
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -2463,7 +2467,7 @@ function Polyline($$anchor, $$props) {
2463
2467
  var node_1 = $.sibling(node);
2464
2468
  {
2465
2469
  var consequent_1 = ($$anchor2) => {
2466
- var path_2 = root_2$6();
2470
+ var path_2 = root_2$8();
2467
2471
  path_2.__pointerdown = function(...$$args) {
2468
2472
  var _a;
2469
2473
  (_a = $$props.onClick) == null ? void 0 : _a.apply(this, $$args);
@@ -2488,13 +2492,13 @@ function Polyline($$anchor, $$props) {
2488
2492
  var node_2 = $.sibling(node_1);
2489
2493
  {
2490
2494
  var consequent_4 = ($$anchor2) => {
2491
- var fragment = root_3$1();
2495
+ var fragment = root_3$3();
2492
2496
  var path_3 = $.first_child(fragment);
2493
2497
  let styles_4;
2494
2498
  var node_3 = $.sibling(path_3);
2495
2499
  {
2496
2500
  var consequent_2 = ($$anchor3) => {
2497
- var path_4 = root_4$2();
2501
+ var path_4 = root_4$3();
2498
2502
  let styles_5;
2499
2503
  $.template_effect(() => {
2500
2504
  $.set_attribute(path_4, "d", $.get(endings).start.d);
@@ -2517,7 +2521,7 @@ function Polyline($$anchor, $$props) {
2517
2521
  var node_4 = $.sibling(node_3);
2518
2522
  {
2519
2523
  var consequent_3 = ($$anchor3) => {
2520
- var path_5 = root_5$1();
2524
+ var path_5 = root_5$2();
2521
2525
  let styles_6;
2522
2526
  $.template_effect(() => {
2523
2527
  $.set_attribute(path_5, "d", $.get(endings).end.d);
@@ -2586,11 +2590,11 @@ function PolylinePreview($$anchor, $$props) {
2586
2590
  () => $$props.data
2587
2591
  ));
2588
2592
  }
2589
- var root_2$5 = $.from_svg(`<path></path>`);
2590
- var root_4$1 = $.from_svg(`<path fill="none"></path>`);
2591
- var root_5 = $.from_svg(`<rect></rect>`);
2592
- var root_3 = $.from_svg(`<path></path><!><!>`, 1);
2593
- var root$a = $.from_svg(`<svg><path fill="transparent" stroke="transparent"></path><!></svg>`);
2593
+ var root_2$7 = $.from_svg(`<path></path>`);
2594
+ var root_4$2 = $.from_svg(`<path fill="none"></path>`);
2595
+ var root_5$1 = $.from_svg(`<rect></rect>`);
2596
+ var root_3$2 = $.from_svg(`<path></path><!><!>`, 1);
2597
+ var root$b = $.from_svg(`<svg><path fill="transparent" stroke="transparent"></path><!></svg>`);
2594
2598
  function Polygon($$anchor, $$props) {
2595
2599
  $.push($$props, true);
2596
2600
  const MIN_HIT_AREA_SCREEN_PX = 20;
@@ -2616,7 +2620,7 @@ function Polygon($$anchor, $$props) {
2616
2620
  var _a;
2617
2621
  return strokeStyle() === PdfAnnotationBorderStyle.DASHED ? (_a = $$props.strokeDashArray) == null ? void 0 : _a.join(",") : void 0;
2618
2622
  });
2619
- var svg = root$a();
2623
+ var svg = root$b();
2620
2624
  let styles;
2621
2625
  var path = $.child(svg);
2622
2626
  path.__pointerdown = function(...$$args) {
@@ -2631,7 +2635,7 @@ function Polygon($$anchor, $$props) {
2631
2635
  var node_1 = $.first_child(fragment);
2632
2636
  {
2633
2637
  var consequent = ($$anchor3) => {
2634
- var path_1 = root_2$5();
2638
+ var path_1 = root_2$7();
2635
2639
  let styles_2;
2636
2640
  $.template_effect(() => {
2637
2641
  $.set_attribute(path_1, "d", $.get(cloudyPath).path);
@@ -2647,13 +2651,13 @@ function Polygon($$anchor, $$props) {
2647
2651
  $.append($$anchor3, path_1);
2648
2652
  };
2649
2653
  var alternate = ($$anchor3) => {
2650
- var fragment_1 = root_3();
2654
+ var fragment_1 = root_3$2();
2651
2655
  var path_2 = $.first_child(fragment_1);
2652
2656
  let styles_3;
2653
2657
  var node_2 = $.sibling(path_2);
2654
2658
  {
2655
2659
  var consequent_1 = ($$anchor4) => {
2656
- var path_3 = root_4$1();
2660
+ var path_3 = root_4$2();
2657
2661
  let styles_4;
2658
2662
  $.template_effect(() => {
2659
2663
  $.set_attribute(path_3, "d", `M ${$.get(localPts)[$.get(localPts).length - 1].x} ${$.get(localPts)[$.get(localPts).length - 1].y} L ${$.get(localPts)[0].x} ${$.get(localPts)[0].y}`);
@@ -2674,7 +2678,7 @@ function Polygon($$anchor, $$props) {
2674
2678
  var node_3 = $.sibling(node_2);
2675
2679
  {
2676
2680
  var consequent_2 = ($$anchor4) => {
2677
- var rect_1 = root_5();
2681
+ var rect_1 = root_5$1();
2678
2682
  $.set_attribute(rect_1, "opacity", 0.4);
2679
2683
  $.set_style(rect_1, "", {}, { "pointer-events": "none" });
2680
2684
  $.template_effect(() => {
@@ -2748,10 +2752,10 @@ function PolygonPreview($$anchor, $$props) {
2748
2752
  () => $$props.data
2749
2753
  ));
2750
2754
  }
2751
- var root$9 = $.from_html(`<div></div>`);
2755
+ var root$a = $.from_html(`<div></div>`);
2752
2756
  function FreeTextPreview($$anchor, $$props) {
2753
2757
  $.push($$props, true);
2754
- var div = root$9();
2758
+ var div = root$a();
2755
2759
  let styles;
2756
2760
  $.template_effect(() => styles = $.set_style(div, "", styles, {
2757
2761
  width: "100%",
@@ -2762,11 +2766,108 @@ function FreeTextPreview($$anchor, $$props) {
2762
2766
  $.append($$anchor, div);
2763
2767
  $.pop();
2764
2768
  }
2765
- var root$8 = $.from_html(`<img alt=""/>`);
2769
+ var root_2$6 = $.from_svg(`<path></path>`);
2770
+ var root_3$1 = $.from_svg(`<rect></rect>`);
2771
+ var root_1$a = $.from_svg(`<svg><polyline fill="none"></polyline><!><!></svg>`);
2772
+ function CalloutFreeTextPreview($$anchor, $$props) {
2773
+ $.push($$props, true);
2774
+ const cl = $.derived(() => $$props.data.calloutLine);
2775
+ const sw = $.derived(() => $$props.data.strokeWidth ?? 1);
2776
+ const sc = $.derived(() => $$props.data.strokeColor ?? "#000000");
2777
+ const op = $.derived(() => $$props.data.opacity ?? 1);
2778
+ const w = $.derived(() => $$props.bounds.size.width);
2779
+ const h = $.derived(() => $$props.bounds.size.height);
2780
+ const ox = $.derived(() => $$props.bounds.origin.x);
2781
+ const oy = $.derived(() => $$props.bounds.origin.y);
2782
+ const lineCoords = $.derived(() => {
2783
+ if (!$.get(cl) || $.get(cl).length < 2) return null;
2784
+ return $.get(cl).map((p) => ({ x: p.x - $.get(ox), y: p.y - $.get(oy) }));
2785
+ });
2786
+ const ending = $.derived(() => {
2787
+ if (!$.get(lineCoords) || $.get(lineCoords).length < 2) return null;
2788
+ const angle = Math.atan2($.get(lineCoords)[1].y - $.get(lineCoords)[0].y, $.get(lineCoords)[1].x - $.get(lineCoords)[0].x);
2789
+ return patching.createEnding($$props.data.lineEnding, $.get(sw), angle + Math.PI, $.get(lineCoords)[0].x, $.get(lineCoords)[0].y);
2790
+ });
2791
+ const halfSw = $.derived(() => $.get(sw) / 2);
2792
+ const tb = $.derived(() => $$props.data.textBox);
2793
+ var fragment = $.comment();
2794
+ var node = $.first_child(fragment);
2795
+ {
2796
+ var consequent_2 = ($$anchor2) => {
2797
+ var svg = root_1$a();
2798
+ let styles;
2799
+ var polyline = $.child(svg);
2800
+ var node_1 = $.sibling(polyline);
2801
+ {
2802
+ var consequent = ($$anchor3) => {
2803
+ var path = root_2$6();
2804
+ $.template_effect(() => {
2805
+ $.set_attribute(path, "d", $.get(ending).d);
2806
+ $.set_attribute(path, "transform", $.get(ending).transform);
2807
+ $.set_attribute(path, "stroke", $.get(sc));
2808
+ $.set_attribute(path, "fill", $.get(ending).filled ? $$props.data.color ?? "transparent" : "none");
2809
+ $.set_attribute(path, "stroke-width", $.get(sw));
2810
+ $.set_attribute(path, "opacity", $.get(op));
2811
+ });
2812
+ $.append($$anchor3, path);
2813
+ };
2814
+ $.if(node_1, ($$render) => {
2815
+ if ($.get(ending)) $$render(consequent);
2816
+ });
2817
+ }
2818
+ var node_2 = $.sibling(node_1);
2819
+ {
2820
+ var consequent_1 = ($$anchor3) => {
2821
+ var rect = root_3$1();
2822
+ $.template_effect(() => {
2823
+ $.set_attribute(rect, "x", $.get(tb).origin.x - $.get(ox) + $.get(halfSw));
2824
+ $.set_attribute(rect, "y", $.get(tb).origin.y - $.get(oy) + $.get(halfSw));
2825
+ $.set_attribute(rect, "width", $.get(tb).size.width - $.get(sw));
2826
+ $.set_attribute(rect, "height", $.get(tb).size.height - $.get(sw));
2827
+ $.set_attribute(rect, "fill", $$props.data.color ?? $$props.data.backgroundColor ?? "transparent");
2828
+ $.set_attribute(rect, "stroke", $.get(sc));
2829
+ $.set_attribute(rect, "stroke-width", $.get(sw));
2830
+ $.set_attribute(rect, "opacity", $.get(op));
2831
+ });
2832
+ $.append($$anchor3, rect);
2833
+ };
2834
+ $.if(node_2, ($$render) => {
2835
+ if ($.get(tb)) $$render(consequent_1);
2836
+ });
2837
+ }
2838
+ $.reset(svg);
2839
+ $.template_effect(
2840
+ ($0) => {
2841
+ styles = $.set_style(svg, "position: absolute; pointer-events: none; overflow: visible;", styles, {
2842
+ width: `${$.get(w) * $$props.scale}px`,
2843
+ height: `${$.get(h) * $$props.scale}px`
2844
+ });
2845
+ $.set_attribute(svg, "width", $.get(w) * $$props.scale);
2846
+ $.set_attribute(svg, "height", $.get(h) * $$props.scale);
2847
+ $.set_attribute(svg, "viewBox", `0 0 ${$.get(w)} ${$.get(h)}`);
2848
+ $.set_attribute(polyline, "points", $0);
2849
+ $.set_attribute(polyline, "stroke", $.get(sc));
2850
+ $.set_attribute(polyline, "stroke-width", $.get(sw));
2851
+ $.set_attribute(polyline, "opacity", $.get(op));
2852
+ },
2853
+ [
2854
+ () => $.get(lineCoords).map((p) => `${p.x},${p.y}`).join(" ")
2855
+ ]
2856
+ );
2857
+ $.append($$anchor2, svg);
2858
+ };
2859
+ $.if(node, ($$render) => {
2860
+ if ($.get(lineCoords)) $$render(consequent_2);
2861
+ });
2862
+ }
2863
+ $.append($$anchor, fragment);
2864
+ $.pop();
2865
+ }
2866
+ var root$9 = $.from_html(`<img alt=""/>`);
2766
2867
  function StampPreview($$anchor, $$props) {
2767
2868
  $.push($$props, true);
2768
2869
  const rotationDeg = $.derived(() => (4 - $$props.data.pageRotation) % 4 * 90);
2769
- var img = root$8();
2870
+ var img = root$9();
2770
2871
  let styles;
2771
2872
  $.template_effect(() => {
2772
2873
  $.set_attribute(img, "src", $$props.data.ghostUrl);
@@ -2878,7 +2979,7 @@ function PolygonRenderer($$anchor, $$props) {
2878
2979
  }
2879
2980
  }));
2880
2981
  }
2881
- var root$7 = $.from_html(`<div role="button"><span role="textbox" tabindex="0"> </span></div>`);
2982
+ var root$8 = $.from_html(`<div role="button"><span role="textbox" tabindex="0"> </span></div>`);
2882
2983
  function FreeText($$anchor, $$props) {
2883
2984
  $.push($$props, true);
2884
2985
  let appearanceActive = $.prop($$props, "appearanceActive", 3, false);
@@ -2915,7 +3016,7 @@ function FreeText($$anchor, $$props) {
2915
3016
  const outerH = $.derived(() => $$props.annotation.object.rect.size.height * $$props.scale);
2916
3017
  const justify = $.derived(() => $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : $$props.annotation.object.verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end");
2917
3018
  const fontCss = $.derived(() => standardFontCssProperties($$props.annotation.object.fontFamily));
2918
- var div = root$7();
3019
+ var div = root$8();
2919
3020
  $.set_attribute(div, "tabindex", -1);
2920
3021
  div.__pointerdown = function(...$$args) {
2921
3022
  var _a;
@@ -3003,6 +3104,309 @@ function FreeTextRenderer($$anchor, $$props) {
3003
3104
  });
3004
3105
  }
3005
3106
  }
3107
+ var root_2$5 = $.from_svg(`<path fill="transparent" stroke="transparent"></path>`);
3108
+ var root_1$9 = $.from_svg(`<polyline fill="none" stroke="transparent"></polyline><!>`, 1);
3109
+ var root_5 = $.from_svg(`<path></path>`);
3110
+ var root_4$1 = $.from_svg(`<polyline fill="none"></polyline><!>`, 1);
3111
+ var root_3 = $.from_svg(`<!><rect></rect>`, 1);
3112
+ var root$7 = $.from_html(`<div><svg><!><!></svg> <div></div> <span role="textbox" tabindex="0"> </span></div>`);
3113
+ function CalloutFreeText($$anchor, $$props) {
3114
+ $.push($$props, true);
3115
+ const MIN_HIT_AREA_SCREEN_PX = 20;
3116
+ let appearanceActive = $.prop($$props, "appearanceActive", 3, false);
3117
+ const annotationCapability = useAnnotationCapability();
3118
+ const annotationProvides = $.derived(() => annotationCapability.provides ? annotationCapability.provides.forDocument($$props.documentId) : null);
3119
+ let editorRef = null;
3120
+ let editingRef = false;
3121
+ const obj = $.derived(() => $$props.annotation.object);
3122
+ const rect = $.derived(() => $.get(obj).rect);
3123
+ const strokeWidth = $.derived(() => $.get(obj).strokeWidth ?? 1);
3124
+ const strokeColor = $.derived(() => $.get(obj).strokeColor ?? "#000000");
3125
+ const textBox = $.derived(() => patching.computeTextBoxFromRD($.get(rect), $.get(obj).rectangleDifferences));
3126
+ const textBoxRelative = $.derived(() => ({
3127
+ left: ($.get(textBox).origin.x - $.get(rect).origin.x + $.get(strokeWidth) / 2) * $$props.scale,
3128
+ top: ($.get(textBox).origin.y - $.get(rect).origin.y + $.get(strokeWidth) / 2) * $$props.scale,
3129
+ width: ($.get(textBox).size.width - $.get(strokeWidth)) * $$props.scale,
3130
+ height: ($.get(textBox).size.height - $.get(strokeWidth)) * $$props.scale
3131
+ }));
3132
+ const lineCoords = $.derived(() => {
3133
+ const cl = $.get(obj).calloutLine;
3134
+ if (!cl || cl.length < 3) return null;
3135
+ return cl.map((p) => ({ x: p.x - $.get(rect).origin.x, y: p.y - $.get(rect).origin.y }));
3136
+ });
3137
+ const ending = $.derived(() => {
3138
+ if (!$.get(lineCoords) || $.get(lineCoords).length < 2) return null;
3139
+ const angle = Math.atan2($.get(lineCoords)[1].y - $.get(lineCoords)[0].y, $.get(lineCoords)[1].x - $.get(lineCoords)[0].x);
3140
+ return patching.createEnding($.get(obj).lineEnding, $.get(strokeWidth), angle + Math.PI, $.get(lineCoords)[0].x, $.get(lineCoords)[0].y);
3141
+ });
3142
+ const visualLineCoords = $.derived(() => {
3143
+ if (!$.get(lineCoords) || $.get(lineCoords).length < 2) return $.get(lineCoords);
3144
+ const pts = $.get(lineCoords).map((p) => ({ ...p }));
3145
+ const last = pts.length - 1;
3146
+ const prev = last - 1;
3147
+ const dx = pts[last].x - pts[prev].x;
3148
+ const dy = pts[last].y - pts[prev].y;
3149
+ const len = Math.sqrt(dx * dx + dy * dy);
3150
+ if (len > 0) {
3151
+ const halfBw = $.get(strokeWidth) / 2;
3152
+ pts[last].x += dx / len * halfBw;
3153
+ pts[last].y += dy / len * halfBw;
3154
+ }
3155
+ return pts;
3156
+ });
3157
+ const ios = useIOSZoomPrevention(() => $.get(obj).fontSize * $$props.scale, () => $$props.isEditing);
3158
+ const width = $.derived(() => $.get(rect).size.width * $$props.scale);
3159
+ const height = $.derived(() => $.get(rect).size.height * $$props.scale);
3160
+ const hitStrokeWidth = $.derived(() => Math.max($.get(strokeWidth), MIN_HIT_AREA_SCREEN_PX / $$props.scale));
3161
+ const fontCss = $.derived(() => standardFontCssProperties($.get(obj).fontFamily));
3162
+ const justify = $.derived(() => $.get(obj).verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : $.get(obj).verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end");
3163
+ $.user_effect(() => {
3164
+ var _a, _b, _c;
3165
+ if (!$$props.isEditing || !editorRef) return;
3166
+ editingRef = true;
3167
+ editorRef.focus();
3168
+ const tool = (_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation($.get(obj));
3169
+ const isDefaultContent = ((_b = tool == null ? void 0 : tool.defaults) == null ? void 0 : _b.contents) != null && $.get(obj).contents === tool.defaults.contents;
3170
+ const selection = (_c = window.getSelection) == null ? void 0 : _c.call(window);
3171
+ if (!selection) return;
3172
+ const range = document.createRange();
3173
+ range.selectNodeContents(editorRef);
3174
+ if (!isDefaultContent) {
3175
+ range.collapse(false);
3176
+ }
3177
+ selection.removeAllRanges();
3178
+ selection.addRange(range);
3179
+ });
3180
+ function handleBlur() {
3181
+ if (!editingRef) return;
3182
+ editingRef = false;
3183
+ if (!$.get(annotationProvides) || !editorRef) return;
3184
+ $.get(annotationProvides).updateAnnotation($$props.pageIndex, $.get(obj).id, { contents: editorRef.innerText.replace(/\u00A0/g, " ") });
3185
+ }
3186
+ var div = root$7();
3187
+ let styles;
3188
+ var svg = $.child(div);
3189
+ let styles_1;
3190
+ var node = $.child(svg);
3191
+ {
3192
+ var consequent_1 = ($$anchor2) => {
3193
+ var fragment = root_1$9();
3194
+ var polyline = $.first_child(fragment);
3195
+ polyline.__pointerdown = function(...$$args) {
3196
+ var _a;
3197
+ (_a = $$props.onClick ? (e) => $$props.onClick(e) : void 0) == null ? void 0 : _a.apply(this, $$args);
3198
+ };
3199
+ let styles_2;
3200
+ var node_1 = $.sibling(polyline);
3201
+ {
3202
+ var consequent = ($$anchor3) => {
3203
+ var path = root_2$5();
3204
+ path.__pointerdown = function(...$$args) {
3205
+ var _a;
3206
+ (_a = $$props.onClick ? (e) => $$props.onClick(e) : void 0) == null ? void 0 : _a.apply(this, $$args);
3207
+ };
3208
+ let styles_3;
3209
+ $.template_effect(() => {
3210
+ $.set_attribute(path, "d", $.get(ending).d);
3211
+ $.set_attribute(path, "transform", $.get(ending).transform);
3212
+ $.set_attribute(path, "stroke-width", $.get(hitStrokeWidth));
3213
+ styles_3 = $.set_style(path, "", styles_3, {
3214
+ cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
3215
+ "pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : $.get(ending).filled ? "visible" : "visibleStroke"
3216
+ });
3217
+ });
3218
+ $.append($$anchor3, path);
3219
+ };
3220
+ $.if(node_1, ($$render) => {
3221
+ if ($.get(ending)) $$render(consequent);
3222
+ });
3223
+ }
3224
+ $.template_effect(
3225
+ ($0) => {
3226
+ $.set_attribute(polyline, "points", $0);
3227
+ $.set_attribute(polyline, "stroke-width", $.get(hitStrokeWidth));
3228
+ styles_2 = $.set_style(polyline, "", styles_2, {
3229
+ cursor: $$props.isSelected ? "move" : $$props.onClick ? "pointer" : "default",
3230
+ "pointer-events": !$$props.onClick ? "none" : $$props.isSelected ? "none" : "visibleStroke"
3231
+ });
3232
+ },
3233
+ [
3234
+ () => $.get(lineCoords).map((p) => `${p.x},${p.y}`).join(" ")
3235
+ ]
3236
+ );
3237
+ $.append($$anchor2, fragment);
3238
+ };
3239
+ $.if(node, ($$render) => {
3240
+ if ($.get(lineCoords)) $$render(consequent_1);
3241
+ });
3242
+ }
3243
+ var node_2 = $.sibling(node);
3244
+ {
3245
+ var consequent_4 = ($$anchor2) => {
3246
+ var fragment_1 = root_3();
3247
+ var node_3 = $.first_child(fragment_1);
3248
+ {
3249
+ var consequent_3 = ($$anchor3) => {
3250
+ var fragment_2 = root_4$1();
3251
+ var polyline_1 = $.first_child(fragment_2);
3252
+ $.set_style(polyline_1, "", {}, { "pointer-events": "none" });
3253
+ var node_4 = $.sibling(polyline_1);
3254
+ {
3255
+ var consequent_2 = ($$anchor4) => {
3256
+ var path_1 = root_5();
3257
+ $.set_style(path_1, "", {}, { "pointer-events": "none" });
3258
+ $.template_effect(() => {
3259
+ $.set_attribute(path_1, "d", $.get(ending).d);
3260
+ $.set_attribute(path_1, "transform", $.get(ending).transform);
3261
+ $.set_attribute(path_1, "stroke", $.get(strokeColor));
3262
+ $.set_attribute(path_1, "fill", $.get(ending).filled ? $.get(obj).color ?? "transparent" : "none");
3263
+ $.set_attribute(path_1, "stroke-width", $.get(strokeWidth));
3264
+ $.set_attribute(path_1, "opacity", $.get(obj).opacity);
3265
+ });
3266
+ $.append($$anchor4, path_1);
3267
+ };
3268
+ $.if(node_4, ($$render) => {
3269
+ if ($.get(ending)) $$render(consequent_2);
3270
+ });
3271
+ }
3272
+ $.template_effect(
3273
+ ($0) => {
3274
+ $.set_attribute(polyline_1, "points", $0);
3275
+ $.set_attribute(polyline_1, "stroke", $.get(strokeColor));
3276
+ $.set_attribute(polyline_1, "stroke-width", $.get(strokeWidth));
3277
+ $.set_attribute(polyline_1, "opacity", $.get(obj).opacity);
3278
+ },
3279
+ [
3280
+ () => $.get(visualLineCoords).map((p) => `${p.x},${p.y}`).join(" ")
3281
+ ]
3282
+ );
3283
+ $.append($$anchor3, fragment_2);
3284
+ };
3285
+ $.if(node_3, ($$render) => {
3286
+ if ($.get(visualLineCoords)) $$render(consequent_3);
3287
+ });
3288
+ }
3289
+ var rect_1 = $.sibling(node_3);
3290
+ $.set_style(rect_1, "", {}, { "pointer-events": "none" });
3291
+ $.template_effect(() => {
3292
+ $.set_attribute(rect_1, "x", $.get(textBox).origin.x - $.get(rect).origin.x + $.get(strokeWidth) / 2);
3293
+ $.set_attribute(rect_1, "y", $.get(textBox).origin.y - $.get(rect).origin.y + $.get(strokeWidth) / 2);
3294
+ $.set_attribute(rect_1, "width", $.get(textBox).size.width - $.get(strokeWidth));
3295
+ $.set_attribute(rect_1, "height", $.get(textBox).size.height - $.get(strokeWidth));
3296
+ $.set_attribute(rect_1, "fill", $.get(obj).color ?? $.get(obj).backgroundColor ?? "transparent");
3297
+ $.set_attribute(rect_1, "stroke", $.get(strokeColor));
3298
+ $.set_attribute(rect_1, "stroke-width", $.get(strokeWidth));
3299
+ $.set_attribute(rect_1, "opacity", $.get(obj).opacity);
3300
+ });
3301
+ $.append($$anchor2, fragment_1);
3302
+ };
3303
+ $.if(node_2, ($$render) => {
3304
+ if (!appearanceActive()) $$render(consequent_4);
3305
+ });
3306
+ }
3307
+ $.reset(svg);
3308
+ var div_1 = $.sibling(svg, 2);
3309
+ div_1.__pointerdown = function(...$$args) {
3310
+ var _a;
3311
+ (_a = $$props.onClick ? (e) => $$props.onClick(e) : void 0) == null ? void 0 : _a.apply(this, $$args);
3312
+ };
3313
+ let styles_4;
3314
+ var span = $.sibling(div_1, 2);
3315
+ let styles_5;
3316
+ var text = $.child(span, true);
3317
+ $.reset(span);
3318
+ $.bind_this(span, ($$value) => editorRef = $$value, () => editorRef);
3319
+ $.reset(div);
3320
+ $.template_effect(
3321
+ ($0) => {
3322
+ styles = $.set_style(div, "", styles, {
3323
+ position: "absolute",
3324
+ width: `${$.get(width)}px`,
3325
+ height: `${$.get(height)}px`,
3326
+ cursor: $$props.isSelected && !$$props.isEditing ? "move" : "default",
3327
+ "pointer-events": "none",
3328
+ "z-index": 2,
3329
+ opacity: appearanceActive() ? 0 : 1
3330
+ });
3331
+ styles_1 = $.set_style(svg, "position: absolute; pointer-events: none; overflow: visible;", styles_1, { width: `${$.get(width)}px`, height: `${$.get(height)}px` });
3332
+ $.set_attribute(svg, "width", $.get(width));
3333
+ $.set_attribute(svg, "height", $.get(height));
3334
+ $.set_attribute(svg, "viewBox", `0 0 ${$.get(rect).size.width} ${$.get(rect).size.height}`);
3335
+ styles_4 = $.set_style(div_1, "", styles_4, {
3336
+ position: "absolute",
3337
+ left: `${($.get(textBox).origin.x - $.get(rect).origin.x) * $$props.scale}px`,
3338
+ top: `${($.get(textBox).origin.y - $.get(rect).origin.y) * $$props.scale}px`,
3339
+ width: `${$.get(textBox).size.width * $$props.scale}px`,
3340
+ height: `${$.get(textBox).size.height * $$props.scale}px`,
3341
+ cursor: $$props.isSelected && !$$props.isEditing ? "move" : $$props.onClick ? "pointer" : "default",
3342
+ "pointer-events": !$$props.onClick ? "none" : $$props.isSelected && !$$props.isEditing ? "none" : "auto"
3343
+ });
3344
+ $.set_attribute(span, "contenteditable", $$props.isEditing);
3345
+ styles_5 = $.set_style(span, "", styles_5, $0);
3346
+ $.set_text(text, $.get(obj).contents);
3347
+ },
3348
+ [
3349
+ () => ({
3350
+ position: "absolute",
3351
+ left: `${$.get(textBoxRelative).left}px`,
3352
+ top: `${$.get(textBoxRelative).top}px`,
3353
+ width: `${$.get(textBoxRelative).width}px`,
3354
+ height: `${$.get(textBoxRelative).height}px`,
3355
+ color: $.get(obj).fontColor,
3356
+ "font-size": `${ios.adjustedFontPx}px`,
3357
+ "font-family": $.get(fontCss).fontFamily,
3358
+ "font-weight": $.get(fontCss).fontWeight,
3359
+ "font-style": $.get(fontCss).fontStyle,
3360
+ "text-align": textAlignmentToCss($.get(obj).textAlign),
3361
+ "flex-direction": "column",
3362
+ "justify-content": $.get(justify),
3363
+ display: "flex",
3364
+ padding: `${$.get(strokeWidth) * $$props.scale / 2 + 2 * $$props.scale}px`,
3365
+ opacity: $.get(obj).opacity,
3366
+ "line-height": "1.18",
3367
+ overflow: "hidden",
3368
+ cursor: $$props.isEditing ? "text" : "default",
3369
+ outline: "none",
3370
+ "pointer-events": $$props.isEditing ? "auto" : "none"
3371
+ })
3372
+ ]
3373
+ );
3374
+ $.event("blur", span, handleBlur);
3375
+ $.append($$anchor, div);
3376
+ $.pop();
3377
+ }
3378
+ $.delegate(["pointerdown"]);
3379
+ function CalloutFreeTextRenderer($$anchor, $$props) {
3380
+ {
3381
+ let $0 = $.derived(() => ({ ...$$props.annotation, object: $$props.currentObject }));
3382
+ CalloutFreeText($$anchor, {
3383
+ get documentId() {
3384
+ return $$props.documentId;
3385
+ },
3386
+ get isSelected() {
3387
+ return $$props.isSelected;
3388
+ },
3389
+ get isEditing() {
3390
+ return $$props.isEditing;
3391
+ },
3392
+ get annotation() {
3393
+ return $.get($0);
3394
+ },
3395
+ get pageIndex() {
3396
+ return $$props.pageIndex;
3397
+ },
3398
+ get scale() {
3399
+ return $$props.scale;
3400
+ },
3401
+ get onClick() {
3402
+ return $$props.onClick;
3403
+ },
3404
+ get appearanceActive() {
3405
+ return $$props.appearanceActive;
3406
+ }
3407
+ });
3408
+ }
3409
+ }
3006
3410
  var root_1$8 = $.from_html(`<img/>`);
3007
3411
  function RenderAnnotation($$anchor, $$props) {
3008
3412
  $.push($$props, true);
@@ -3805,10 +4209,21 @@ const builtInRenderers = [
3805
4209
  component: CaretRenderer,
3806
4210
  interactionDefaults: { isDraggable: false, isResizable: false, isRotatable: false }
3807
4211
  }),
4212
+ createRenderer({
4213
+ id: "freeTextCallout",
4214
+ matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT && a.intent === "FreeTextCallout",
4215
+ matchesPreview: (p) => p.type === PdfAnnotationSubtype.FREETEXT && !!p.data.calloutLine,
4216
+ component: CalloutFreeTextRenderer,
4217
+ renderPreview: CalloutFreeTextPreview,
4218
+ vertexConfig: patching.calloutVertexConfig,
4219
+ interactionDefaults: { isDraggable: true, isResizable: false, isRotatable: false },
4220
+ isDraggable: (toolDraggable, { isEditing }) => toolDraggable && !isEditing,
4221
+ onDoubleClick: (id, setEditingId) => setEditingId(id)
4222
+ }),
3808
4223
  createRenderer({
3809
4224
  id: "freeText",
3810
- matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT,
3811
- matchesPreview: (p) => p.type === PdfAnnotationSubtype.FREETEXT,
4225
+ matches: (a) => a.type === PdfAnnotationSubtype.FREETEXT && a.intent !== "FreeTextCallout",
4226
+ matchesPreview: (p) => p.type === PdfAnnotationSubtype.FREETEXT && !p.data.calloutLine,
3812
4227
  component: FreeTextRenderer,
3813
4228
  renderPreview: FreeTextPreview,
3814
4229
  interactionDefaults: { isDraggable: true, isResizable: true, isRotatable: true },
@@ -4010,21 +4425,22 @@ function Annotations($$anchor, $$props) {
4010
4425
  var _a;
4011
4426
  return ((_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation($.get(annotation).object)) ?? null;
4012
4427
  });
4013
- const categories = $.derived(() => getAnnotationCategories($.get(tool)));
4014
- const locked = $.derived(() => hasLockedFlag($.get(annotation).object) || isCategoryLocked($.get(categories), $.get(lockedMode)));
4428
+ const nonInteractive = $.derived(() => $.get(annotationProvides) ? !$.get(annotationProvides).isAnnotationInteractive($.get(annotation).object) : false);
4429
+ const structurallyLocked = $.derived(() => $.get(annotationProvides) ? $.get(annotationProvides).isAnnotationStructurallyLocked($.get(annotation).object) : false);
4430
+ const contentLocked = $.derived(() => $.get(annotationProvides) ? $.get(annotationProvides).isAnnotationContentLocked($.get(annotation).object) : false);
4015
4431
  var fragment_2 = $.comment();
4016
4432
  var node_2 = $.first_child(fragment_2);
4017
4433
  {
4018
4434
  var consequent = ($$anchor4) => {
4019
- const hasRenderLocked = $.derived(() => $.get(locked) && !!$.get(renderer).renderLocked);
4020
- const isSelected = $.derived(() => $.get(locked) ? false : $.get(allSelectedIds).includes($.get(annotation).object.id));
4021
- const isEditing = $.derived(() => $.get(locked) ? false : $.get(editingId) === $.get(annotation).object.id);
4435
+ const hasRenderLocked = $.derived(() => $.get(nonInteractive) && !!$.get(renderer).renderLocked);
4436
+ const isSelected = $.derived(() => $.get(nonInteractive) ? false : $.get(allSelectedIds).includes($.get(annotation).object.id));
4437
+ const isEditing = $.derived(() => $.get(nonInteractive) ? false : $.get(editingId) === $.get(annotation).object.id);
4022
4438
  const defaults = $.derived(() => $.get(renderer).interactionDefaults);
4023
4439
  const resolvedDraggable = $.derived(() => {
4024
4440
  var _a, _b;
4025
4441
  return resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isDraggable) ?? true);
4026
4442
  });
4027
- const finalDraggable = $.derived(() => $.get(locked) ? false : $.get(renderer).isDraggable ? $.get(renderer).isDraggable($.get(resolvedDraggable), { isEditing: $.get(isEditing) }) : $.get(resolvedDraggable));
4443
+ const finalDraggable = $.derived(() => $.get(structurallyLocked) ? false : $.get(renderer).isDraggable ? $.get(renderer).isDraggable($.get(resolvedDraggable), { isEditing: $.get(isEditing) }) : $.get(resolvedDraggable));
4028
4444
  const useAP = $.derived(() => {
4029
4445
  var _a, _b;
4030
4446
  return ((_b = (_a = $.get(tool)) == null ? void 0 : _a.behavior) == null ? void 0 : _b.useAppearanceStream) ?? $.get(renderer).useAppearanceStream ?? true;
@@ -4046,7 +4462,7 @@ function Annotations($$anchor, $$props) {
4046
4462
  const noopSelect = $.derived(() => (e) => {
4047
4463
  e.stopPropagation();
4048
4464
  });
4049
- const onSelect = $.derived(() => $.get(locked) ? $.get(noopSelect) : $.get(renderer).selectOverride ? (e) => $.get(renderer).selectOverride(e, $.get(annotation), $.get(selectHelpers)) : (e) => handleClick(e, $.get(annotation)));
4465
+ const onSelect = $.derived(() => $.get(nonInteractive) ? $.get(noopSelect) : $.get(renderer).selectOverride ? (e) => $.get(renderer).selectOverride(e, $.get(annotation), $.get(selectHelpers)) : (e) => handleClick(e, $.get(annotation)));
4050
4466
  const RendererComponent = $.derived(() => $.get(hasRenderLocked) ? $.get(renderer).renderLocked : $.get(renderer).component);
4051
4467
  {
4052
4468
  const children = ($$anchor5, currentObject = $.noop, $$arg1) => {
@@ -4054,7 +4470,7 @@ function Annotations($$anchor, $$props) {
4054
4470
  var fragment_4 = $.comment();
4055
4471
  var node_3 = $.first_child(fragment_4);
4056
4472
  {
4057
- let $02 = $.derived(() => $.get(locked) ? void 0 : $.get(onSelect));
4473
+ let $02 = $.derived(() => $.get(nonInteractive) ? void 0 : $.get(onSelect));
4058
4474
  $.component(node_3, () => $.get(RendererComponent), ($$anchor6, RendererComponent_1) => {
4059
4475
  RendererComponent_1($$anchor6, {
4060
4476
  get annotation() {
@@ -4089,10 +4505,10 @@ function Annotations($$anchor, $$props) {
4089
4505
  }
4090
4506
  $.append($$anchor5, fragment_4);
4091
4507
  };
4092
- let $0 = $.derived(() => $.get(locked) ? false : $.get(isMultiSelected));
4508
+ let $0 = $.derived(() => $.get(nonInteractive) ? false : $.get(isMultiSelected));
4093
4509
  let $1 = $.derived(() => {
4094
4510
  var _a, _b;
4095
- return $.get(locked) ? false : resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isResizable) ?? false);
4511
+ return $.get(structurallyLocked) ? false : resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isResizable) ?? false);
4096
4512
  });
4097
4513
  let $2 = $.derived(() => {
4098
4514
  var _a, _b;
@@ -4100,18 +4516,18 @@ function Annotations($$anchor, $$props) {
4100
4516
  });
4101
4517
  let $3 = $.derived(() => {
4102
4518
  var _a, _b;
4103
- return $.get(locked) ? false : resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isRotatable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isRotatable) ?? false);
4519
+ return $.get(structurallyLocked) ? false : resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isRotatable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isRotatable) ?? false);
4104
4520
  });
4105
- let $4 = $.derived(() => $.get(locked) ? void 0 : $.get(renderer).vertexConfig);
4521
+ let $4 = $.derived(() => $.get(structurallyLocked) ? void 0 : $.get(renderer).vertexConfig);
4106
4522
  let $5 = $.derived(() => {
4107
4523
  var _a, _b;
4108
- return $.get(locked) ? void 0 : ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenu;
4524
+ return $.get(nonInteractive) ? void 0 : ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenu;
4109
4525
  });
4110
4526
  let $6 = $.derived(() => {
4111
4527
  var _a, _b;
4112
- return $.get(locked) ? void 0 : ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet;
4528
+ return $.get(nonInteractive) ? void 0 : ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet;
4113
4529
  });
4114
- let $7 = $.derived(() => $.get(locked) ? void 0 : $.get(renderer).onDoubleClick ? (e) => {
4530
+ let $7 = $.derived(() => $.get(nonInteractive) || $.get(contentLocked) ? void 0 : $.get(renderer).onDoubleClick ? (e) => {
4115
4531
  e.stopPropagation();
4116
4532
  $.get(renderer).onDoubleClick($.get(annotation).object.id, setEditingId);
4117
4533
  } : void 0);
@@ -4155,6 +4571,12 @@ function Annotations($$anchor, $$props) {
4155
4571
  get selectionMenuSnippet() {
4156
4572
  return $.get($6);
4157
4573
  },
4574
+ get structurallyLocked() {
4575
+ return $.get(structurallyLocked);
4576
+ },
4577
+ get contentLocked() {
4578
+ return $.get(contentLocked);
4579
+ },
4158
4580
  get onSelect() {
4159
4581
  return $.get(onSelect);
4160
4582
  },
@@ -4180,13 +4602,13 @@ function Annotations($$anchor, $$props) {
4180
4602
  }
4181
4603
  };
4182
4604
  $.if(node_2, ($$render) => {
4183
- if (!($.get(locked) && $.get(renderer).hiddenWhenLocked)) $$render(consequent);
4605
+ if (!($.get(nonInteractive) && $.get(renderer).hiddenWhenLocked)) $$render(consequent);
4184
4606
  });
4185
4607
  }
4186
4608
  $.append($$anchor3, fragment_2);
4187
4609
  };
4188
4610
  $.if(node_1, ($$render) => {
4189
- if ($.get(renderer)) $$render(consequent_1);
4611
+ if ($.get(renderer) && !hasNoViewFlag($.get(annotation).object) && !hasHiddenFlag($.get(annotation).object)) $$render(consequent_1);
4190
4612
  });
4191
4613
  }
4192
4614
  $.append($$anchor2, fragment_1);