vue-data-ui 3.25.4 → 3.25.5

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 (159) hide show
  1. package/README.md +13 -13
  2. package/dist/{ColorPicker-ZJrR3Olp.js → ColorPicker-Bn3MY7eL.js} +101 -99
  3. package/dist/{NonSvgPenAndPaper-DS84BAOx.js → NonSvgPenAndPaper-KXRhcsxM.js} +1 -1
  4. package/dist/{PackageVersion-5SWftabm.js → PackageVersion-M2Ws-VwJ.js} +1 -1
  5. package/dist/{PenAndPaper-B_SdRSKH.js → PenAndPaper-BgH3m_LP.js} +19 -3
  6. package/dist/components/vue-ui-3d-bar.js +1 -1
  7. package/dist/components/vue-ui-accordion.js +1 -1
  8. package/dist/components/vue-ui-age-pyramid.js +1 -1
  9. package/dist/components/vue-ui-annotator.js +1 -1
  10. package/dist/components/vue-ui-bullet.js +1 -1
  11. package/dist/components/vue-ui-bump.js +1 -1
  12. package/dist/components/vue-ui-candlestick.js +1 -1
  13. package/dist/components/vue-ui-carousel-table.js +1 -1
  14. package/dist/components/vue-ui-chestnut.js +1 -1
  15. package/dist/components/vue-ui-chord.js +1 -1
  16. package/dist/components/vue-ui-circle-pack.js +1 -1
  17. package/dist/components/vue-ui-cursor.js +1 -1
  18. package/dist/components/vue-ui-dag.js +1 -1
  19. package/dist/components/vue-ui-dashboard.js +1 -1
  20. package/dist/components/vue-ui-digits.js +1 -1
  21. package/dist/components/vue-ui-donut-evolution.js +1 -1
  22. package/dist/components/vue-ui-donut.js +1 -1
  23. package/dist/components/vue-ui-dumbbell.js +1 -1
  24. package/dist/components/vue-ui-flow.js +1 -1
  25. package/dist/components/vue-ui-funnel.js +1 -1
  26. package/dist/components/vue-ui-galaxy.js +1 -1
  27. package/dist/components/vue-ui-gauge.js +1 -1
  28. package/dist/components/vue-ui-geo.js +1 -1
  29. package/dist/components/vue-ui-gizmo.js +1 -1
  30. package/dist/components/vue-ui-heatmap.js +1 -1
  31. package/dist/components/vue-ui-hill.js +1 -1
  32. package/dist/components/vue-ui-history-plot.js +1 -1
  33. package/dist/components/vue-ui-horizontal-bar.js +1 -1
  34. package/dist/components/vue-ui-kpi.js +1 -1
  35. package/dist/components/vue-ui-label.js +1 -1
  36. package/dist/components/vue-ui-mini-loader.js +1 -1
  37. package/dist/components/vue-ui-molecule.js +1 -1
  38. package/dist/components/vue-ui-mood-radar.js +1 -1
  39. package/dist/components/vue-ui-nested-donuts.js +1 -1
  40. package/dist/components/vue-ui-onion.js +1 -1
  41. package/dist/components/vue-ui-parallel-coordinate-plot.js +1 -1
  42. package/dist/components/vue-ui-quadrant.js +1 -1
  43. package/dist/components/vue-ui-quick-chart.js +1 -1
  44. package/dist/components/vue-ui-radar.js +1 -1
  45. package/dist/components/vue-ui-rating.js +1 -1
  46. package/dist/components/vue-ui-relation-circle.js +1 -1
  47. package/dist/components/vue-ui-ridgeline.js +1 -1
  48. package/dist/components/vue-ui-rings.js +1 -1
  49. package/dist/components/vue-ui-scatter.js +1 -1
  50. package/dist/components/vue-ui-skeleton.js +1 -1
  51. package/dist/components/vue-ui-smiley.js +1 -1
  52. package/dist/components/vue-ui-spark-trend.js +1 -1
  53. package/dist/components/vue-ui-sparkbar.js +1 -1
  54. package/dist/components/vue-ui-sparkgauge.js +1 -1
  55. package/dist/components/vue-ui-sparkhistogram.js +1 -1
  56. package/dist/components/vue-ui-sparkline.js +1 -1
  57. package/dist/components/vue-ui-sparkstackbar.js +1 -1
  58. package/dist/components/vue-ui-stackbar.js +1 -1
  59. package/dist/components/vue-ui-stackline.js +1 -1
  60. package/dist/components/vue-ui-strip-plot.js +1 -1
  61. package/dist/components/vue-ui-table-heatmap.js +1 -1
  62. package/dist/components/vue-ui-table-sparkline.js +1 -1
  63. package/dist/components/vue-ui-table.js +1 -1
  64. package/dist/components/vue-ui-thermometer.js +1 -1
  65. package/dist/components/vue-ui-timer.js +1 -1
  66. package/dist/components/vue-ui-tiremarks.js +1 -1
  67. package/dist/components/vue-ui-treemap.js +1 -1
  68. package/dist/components/vue-ui-vertical-bar.js +1 -1
  69. package/dist/components/vue-ui-waffle.js +1 -1
  70. package/dist/components/vue-ui-wheel.js +1 -1
  71. package/dist/components/vue-ui-word-cloud.js +1 -1
  72. package/dist/components/vue-ui-world.js +1 -1
  73. package/dist/components/vue-ui-xy-canvas.js +1 -1
  74. package/dist/components/vue-ui-xy.js +1 -1
  75. package/dist/{package-DmsdiyeS.js → package-ta2JoIjx.js} +1 -1
  76. package/dist/{render-common-zoPh9a78.js → render-common-bvOuxfN3.js} +1 -1
  77. package/dist/ssr/vue-ui-donut.js +1 -1
  78. package/dist/ssr/vue-ui-xy.js +1 -1
  79. package/dist/ssr.js +2 -2
  80. package/dist/style.css +1 -1
  81. package/dist/types/vue-data-ui.d.ts +70 -1
  82. package/dist/types/vue-ui-annotator.d.ts +58 -2
  83. package/dist/{useConfig-CyCVHo81.js → useConfig-C_mX5pOZ.js} +1329 -1313
  84. package/dist/{useObjectBindings-ByORl1rV.js → useObjectBindings-uXpBcVyo.js} +1 -1
  85. package/dist/utils.js +1 -1
  86. package/dist/{vue-data-ui-DTj71yB7.js → vue-data-ui-BjdCpsRV.js} +69 -69
  87. package/dist/vue-data-ui.js +70 -70
  88. package/dist/{vue-ui-3d-bar-CH8SpxS2.js → vue-ui-3d-bar-C0aLR6lw.js} +6 -4
  89. package/dist/{vue-ui-accordion-D4zsdacF.js → vue-ui-accordion-DRf3NQyH.js} +1 -1
  90. package/dist/{vue-ui-age-pyramid-B9MUVi75.js → vue-ui-age-pyramid-DUcB3lYs.js} +6 -4
  91. package/dist/vue-ui-annotator-DZ0O8Xa5.js +3325 -0
  92. package/dist/{vue-ui-bullet-n8KNnDwh.js → vue-ui-bullet-DIOCMF2H.js} +6 -4
  93. package/dist/{vue-ui-bump-BkOtQNWe.js → vue-ui-bump-DoHnD1Xy.js} +6 -4
  94. package/dist/{vue-ui-candlestick-Bxlvqk49.js → vue-ui-candlestick-Cf8TYPl5.js} +6 -4
  95. package/dist/{vue-ui-carousel-table-CRgbs7jR.js → vue-ui-carousel-table-k1cBJ1i1.js} +2 -2
  96. package/dist/{vue-ui-chestnut-ByDKbkG9.js → vue-ui-chestnut-BMAuaeif.js} +7 -5
  97. package/dist/{vue-ui-chord-DQRBgVOx.js → vue-ui-chord-DCe2iPjk.js} +7 -5
  98. package/dist/{vue-ui-circle-pack-CBBc0HOe.js → vue-ui-circle-pack-Eb5hS_z3.js} +7 -5
  99. package/dist/{vue-ui-cursor-BHyXRadA.js → vue-ui-cursor-CQWLyEx0.js} +2 -2
  100. package/dist/{vue-ui-dag-CyVqaLbF.js → vue-ui-dag-BqlsutMj.js} +6 -4
  101. package/dist/{vue-ui-dashboard-7I-7wvCP.js → vue-ui-dashboard-Be3MmkgS.js} +73 -71
  102. package/dist/{vue-ui-digits-BBL8uERO.js → vue-ui-digits-BqdfbcKX.js} +2 -2
  103. package/dist/{vue-ui-donut-DfiocufT.js → vue-ui-donut-CuQVKuZa.js} +6 -4
  104. package/dist/{vue-ui-donut-evolution-BoqO8By2.js → vue-ui-donut-evolution-DckruxZ9.js} +6 -4
  105. package/dist/{vue-ui-donut-DcgUuefk.js → vue-ui-donut-gzGZ42uH.js} +2 -2
  106. package/dist/{vue-ui-dumbbell-7M_oUQdi.js → vue-ui-dumbbell-BYU-hh2E.js} +6 -4
  107. package/dist/{vue-ui-flow-CoylrfnO.js → vue-ui-flow-DLRcNDLc.js} +7 -5
  108. package/dist/{vue-ui-funnel-DaBYHWIC.js → vue-ui-funnel-DjoqNN1U.js} +7 -5
  109. package/dist/{vue-ui-galaxy-BIebStQ3.js → vue-ui-galaxy-BhR4IOra.js} +6 -4
  110. package/dist/{vue-ui-gauge-CwdTmiRP.js → vue-ui-gauge-Cq161Kwp.js} +6 -4
  111. package/dist/{vue-ui-geo-jR4P4pbt.js → vue-ui-geo-Ca8kPYr-.js} +6 -4
  112. package/dist/{vue-ui-gizmo-D6W86s9o.js → vue-ui-gizmo-wUqHJICb.js} +2 -2
  113. package/dist/{vue-ui-heatmap-DXYlGwqR.js → vue-ui-heatmap-Bl5ymvi9.js} +8 -6
  114. package/dist/{vue-ui-hill-fFq7pm-g.js → vue-ui-hill-D6Y9Xy2K.js} +6 -4
  115. package/dist/{vue-ui-history-plot-CgIELoD2.js → vue-ui-history-plot-CvVjsdCL.js} +6 -4
  116. package/dist/{vue-ui-horizontal-bar-D3Sft4kp.js → vue-ui-horizontal-bar-3on3-H3B.js} +8 -6
  117. package/dist/{vue-ui-kpi-fzLsKlyE.js → vue-ui-kpi-CUpRRIUf.js} +2 -2
  118. package/dist/{vue-ui-label-BSgLalWD.js → vue-ui-label-DR2qUZOG.js} +1 -1
  119. package/dist/{vue-ui-mini-loader-BL2odRfu.js → vue-ui-mini-loader-D8W-fERs.js} +1 -1
  120. package/dist/{vue-ui-molecule-DeHWkkhy.js → vue-ui-molecule-BExVLLgE.js} +2 -2
  121. package/dist/{vue-ui-mood-radar-bvGx6XgG.js → vue-ui-mood-radar-TW251icr.js} +6 -4
  122. package/dist/{vue-ui-nested-donuts-CeAV2xPk.js → vue-ui-nested-donuts-CWzJKr3S.js} +6 -4
  123. package/dist/{vue-ui-onion-B7oFulsQ.js → vue-ui-onion-VaYZQK5i.js} +6 -4
  124. package/dist/{vue-ui-parallel-coordinate-plot-B_QJ4N9o.js → vue-ui-parallel-coordinate-plot-RM25bxtf.js} +6 -4
  125. package/dist/{vue-ui-quadrant-DrKnz37q.js → vue-ui-quadrant-Dmtwow7n.js} +6 -4
  126. package/dist/{vue-ui-quick-chart-BFscCR59.js → vue-ui-quick-chart-Cswm3_eI.js} +6 -4
  127. package/dist/{vue-ui-radar-Bzx69q8f.js → vue-ui-radar-C3GYthqu.js} +6 -4
  128. package/dist/{vue-ui-rating-CimC9FQ9.js → vue-ui-rating-CBdDXL80.js} +1 -1
  129. package/dist/{vue-ui-relation-circle-DIQYyDGb.js → vue-ui-relation-circle-BA0qy0kp.js} +9 -7
  130. package/dist/{vue-ui-ridgeline-CPEnM45x.js → vue-ui-ridgeline-C5skjBTe.js} +468 -459
  131. package/dist/{vue-ui-rings-qPL5Iwji.js → vue-ui-rings-BJ8yEQMw.js} +6 -4
  132. package/dist/{vue-ui-scatter-BB0ClTsU.js → vue-ui-scatter-DXg8ESgr.js} +6 -4
  133. package/dist/{vue-ui-skeleton-zmbcOVEf.js → vue-ui-skeleton-D_u8EWeW.js} +2 -2
  134. package/dist/{vue-ui-smiley-DzPkCMN-.js → vue-ui-smiley-DQOp87rr.js} +1 -1
  135. package/dist/{vue-ui-spark-trend-Ciq7-k_q.js → vue-ui-spark-trend-CjCufXof.js} +2 -2
  136. package/dist/{vue-ui-sparkbar-D1M7-naP.js → vue-ui-sparkbar-BniEM15a.js} +2 -2
  137. package/dist/{vue-ui-sparkgauge-rsqaeR_n.js → vue-ui-sparkgauge-BtyCrqTQ.js} +2 -2
  138. package/dist/{vue-ui-sparkhistogram-C4WXt2Ni.js → vue-ui-sparkhistogram-DQdn3PW1.js} +2 -2
  139. package/dist/{vue-ui-sparkline-Dv7XrEzO.js → vue-ui-sparkline-9qkNNZG6.js} +2 -2
  140. package/dist/{vue-ui-sparkstackbar-DDOXdeV-.js → vue-ui-sparkstackbar-BXQlOdOk.js} +2 -2
  141. package/dist/{vue-ui-stackbar-C_hMnOLb.js → vue-ui-stackbar-CkjicNDv.js} +6 -4
  142. package/dist/{vue-ui-stackline-BHGi63lD.js → vue-ui-stackline-BB1IZta8.js} +6 -4
  143. package/dist/{vue-ui-strip-plot-Cygpn-l8.js → vue-ui-strip-plot-DGLGuH6e.js} +6 -4
  144. package/dist/{vue-ui-table-BQna1wL6.js → vue-ui-table-BXz_HY2g.js} +3 -3
  145. package/dist/{vue-ui-table-heatmap-Dv_ZKKm3.js → vue-ui-table-heatmap-XmDK1aHJ.js} +1 -1
  146. package/dist/{vue-ui-table-sparkline-BCuimtk6.js → vue-ui-table-sparkline-MTEw3imE.js} +2 -2
  147. package/dist/{vue-ui-thermometer-DytlLJ32.js → vue-ui-thermometer-CLx3SPRv.js} +9 -7
  148. package/dist/{vue-ui-timer-CvHP4HoW.js → vue-ui-timer-BDWUNb6t.js} +2 -2
  149. package/dist/{vue-ui-tiremarks-BvjdZwgh.js → vue-ui-tiremarks-DoaypTC-.js} +6 -4
  150. package/dist/{vue-ui-treemap-C5OpqzSc.js → vue-ui-treemap-Bv7PgpiC.js} +7 -5
  151. package/dist/{vue-ui-waffle-B7T_Zzan.js → vue-ui-waffle-z2DhvSAx.js} +6 -4
  152. package/dist/{vue-ui-wheel-D1B0k7IW.js → vue-ui-wheel-DYLBJuFb.js} +9 -7
  153. package/dist/{vue-ui-word-cloud-C4pX6jop.js → vue-ui-word-cloud-CbpEhSdL.js} +6 -4
  154. package/dist/{vue-ui-world-D0_2upjg.js → vue-ui-world-C2atz4Xm.js} +6 -4
  155. package/dist/{vue-ui-xy-Ck41KYqF.js → vue-ui-xy-B3DQ6t46.js} +7 -5
  156. package/dist/{vue-ui-xy-D_5FfaH-.js → vue-ui-xy-CpA0W6zM.js} +2 -2
  157. package/dist/{vue-ui-xy-canvas-B_8Mu19r.js → vue-ui-xy-canvas-CJefORWc.js} +3 -3
  158. package/package.json +1 -1
  159. package/dist/vue-ui-annotator-CmlcWPIm.js +0 -2886
@@ -1,2886 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { C as t, It as n, Zt as r, q as i } from "./lib-Dql7cqyA.js";
3
- import { n as a, t as o } from "./useHints-Dq_w2E8B.js";
4
- import { t as s } from "./useConfig-CyCVHo81.js";
5
- import { t as ee } from "./usePrinter-DISD7q5m.js";
6
- import { t as c } from "./dom-to-png-C6cQJ5Hq.js";
7
- import { t as l } from "./_plugin-vue_export-helper-B3ysoDQm.js";
8
- import { t as u } from "./BaseIcon-t83PDe9k.js";
9
- import { t as te } from "./vue-ui-accordion-D4zsdacF.js";
10
- import { t as ne } from "./ColorPicker-ZJrR3Olp.js";
11
- import { Fragment as re, Teleport as ie, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, nextTick as ae, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as oe, onMounted as se, openBlock as b, ref as x, renderList as ce, renderSlot as le, toDisplayString as S, unref as ue, vModelCheckbox as de, vModelText as fe, watch as pe, withCtx as C, withDirectives as me, withModifiers as he } from "vue";
12
- //#region src/registerAnnotatorShortcuts.js
13
- function ge(e) {
14
- let t = (t) => e.isMacLike.value ? t.metaKey : t.ctrlKey, n = (e) => {
15
- let t = e;
16
- if (!t) return !1;
17
- let n = (t.tagName || "").toLowerCase();
18
- return t.isContentEditable || n === "input" || n === "textarea" || n === "select";
19
- }, r = (t) => !!(!e.isSummaryOpen.value || n(t.target) || e.isWriting.value), i = () => {
20
- e.isDeleteMode.value = !1, e.isMoveMode.value = !1, e.isResizeMode.value = !1, e.isSelectMode.value = !1, e.isDrawMode.value = !1, e.isTextMode.value = !1, e.activeShape.value = void 0, e.showCaret.value = !1;
21
- }, a = (t) => {
22
- switch (i(), t) {
23
- case "m":
24
- e.isMoveMode.value = !0;
25
- break;
26
- case "r":
27
- e.isResizeMode.value = !0;
28
- break;
29
- case "d":
30
- e.isDeleteMode.value = !0;
31
- break;
32
- case "g":
33
- e.isSelectMode.value = !0, e.setShapeTo("group"), e.activeShape.value = "group";
34
- break;
35
- case "t": e.isTextMode.value = !0, e.isWriting.value = !1, e.showCaret.value = !1;
36
- }
37
- }, o = (t) => {
38
- switch (t) {
39
- case "c":
40
- e.setShapeTo("circle");
41
- break;
42
- case "s":
43
- e.setShapeTo("rect");
44
- break;
45
- case "a":
46
- e.setShapeTo("arrow");
47
- break;
48
- case "l": e.setShapeTo("line");
49
- }
50
- }, s = (t, n) => {
51
- let r = e.lastSelectedShape.value;
52
- if (!r) return;
53
- let i = (e, t) => {
54
- typeof r[e] == "number" && (r[e] += t);
55
- };
56
- switch (r.type) {
57
- case "rect":
58
- case "circle":
59
- case "text":
60
- i("x", t), i("y", n);
61
- break;
62
- case "arrow": i("x", t), i("y", n), i("endX", t), i("endY", n);
63
- }
64
- }, ee = () => {
65
- let t = e.lastSelectedShape.value;
66
- t && (e.shapes.value = e.shapes.value.filter((e) => e.id !== t.id), e.lastSelectedShape.value = void 0);
67
- }, c = !1, l = null, u = () => {
68
- c || (c = !0, e.history?.value?.begin?.("nudge"));
69
- }, te = () => {
70
- c && (clearTimeout(l), l = setTimeout(() => {
71
- c = !1, e.history?.value?.end?.();
72
- }, 160));
73
- }, ne = () => {
74
- clearTimeout(l), c && e.history?.value?.end?.(), c = !1;
75
- }, re = (n) => {
76
- if (t(n) && !n.shiftKey && n.key.toLowerCase() === "z") {
77
- if (r(n)) return;
78
- n.preventDefault(), e.undoLastShape?.();
79
- return;
80
- }
81
- if (t(n) && n.shiftKey && n.key.toLowerCase() === "z" || t(n) && n.key.toLowerCase() === "y") {
82
- if (r(n)) return;
83
- n.preventDefault(), typeof e.redoLastShape == "function" ? e.redoLastShape() : e.history?.value?.redo?.();
84
- return;
85
- }
86
- if (r(n)) return;
87
- let c = n.key.toLowerCase();
88
- if (c === "escape") {
89
- n.preventDefault(), i();
90
- return;
91
- }
92
- if (c === "delete" || c === "backspace") {
93
- n.preventDefault(), ee();
94
- return;
95
- }
96
- if ([
97
- "m",
98
- "r",
99
- "d",
100
- "g",
101
- "t"
102
- ].includes(c)) {
103
- n.preventDefault(), a(c);
104
- return;
105
- }
106
- if ([
107
- "c",
108
- "a",
109
- "l",
110
- "s"
111
- ].includes(c)) {
112
- n.preventDefault(), o(c);
113
- return;
114
- }
115
- if (n.key === "ArrowUp" || n.key === "ArrowDown" || n.key === "ArrowLeft" || n.key === "ArrowRight") {
116
- n.preventDefault(), u();
117
- let e = n.shiftKey ? 10 : 1;
118
- n.key === "ArrowUp" && s(0, -e), n.key === "ArrowDown" && s(0, e), n.key === "ArrowLeft" && s(-e, 0), n.key === "ArrowRight" && s(e, 0), te();
119
- }
120
- }, ie = (e) => {
121
- e.key.startsWith("Arrow") && te();
122
- };
123
- return window.addEventListener("keydown", re), window.addEventListener("keyup", ie), function() {
124
- window.removeEventListener("keydown", re), window.removeEventListener("keyup", ie), ne();
125
- };
126
- }
127
- //#endregion
128
- //#region src/atoms/TeleportedTooltip.vue
129
- var _e = { class: "teleport-tooltip__inner" }, w = /*#__PURE__*/ l({
130
- __name: "TeleportedTooltip",
131
- props: {
132
- show: {
133
- type: Boolean,
134
- default: !1
135
- },
136
- x: {
137
- type: Number,
138
- required: !0
139
- },
140
- y: {
141
- type: Number,
142
- required: !0
143
- },
144
- placement: {
145
- type: String,
146
- default: "top"
147
- },
148
- styleObject: {
149
- type: Object,
150
- default() {
151
- return {};
152
- }
153
- },
154
- delay: {
155
- type: Number,
156
- default: 0
157
- },
158
- delayIn: {
159
- type: Number,
160
- default: 300
161
- },
162
- delayOut: {
163
- type: Number,
164
- default: 0
165
- }
166
- },
167
- setup(e) {
168
- let t = e, n = d(() => t.delayIn ?? t.delay), r = d(() => t.delayOut ?? t.delay), i = x(!1), a = null, o = null;
169
- function s() {
170
- a &&= (clearTimeout(a), null), o &&= (clearTimeout(o), null);
171
- }
172
- function ee() {
173
- s();
174
- let e = Math.max(0, n.value || 0);
175
- e === 0 ? i.value = !0 : a = setTimeout(() => {
176
- i.value = !0, a = null;
177
- }, e);
178
- }
179
- function c() {
180
- s();
181
- let e = Math.max(0, r.value || 0);
182
- e === 0 ? i.value = !1 : o = setTimeout(() => {
183
- i.value = !1, o = null;
184
- }, e);
185
- }
186
- pe(() => t.show, (e) => {
187
- e ? ee() : c();
188
- }, { immediate: !0 }), se(() => {
189
- t.show && ee();
190
- }), oe(() => {
191
- s();
192
- });
193
- let l = d(() => ({
194
- position: "fixed",
195
- zIndex: 2147483647,
196
- top: `${t.y}px`,
197
- left: `${t.x}px`,
198
- transform: t.placement === "bottom" ? "translate(-50%, 8px)" : "translate(-50%, -100%)",
199
- pointerEvents: "none",
200
- ...t.styleObject
201
- }));
202
- return (t, n) => (b(), f(ie, { to: "body" }, [i.value ? (b(), m("div", {
203
- key: 0,
204
- class: v(["teleport-tooltip", e.placement]),
205
- style: y(l.value),
206
- role: "tooltip",
207
- "aria-hidden": "false"
208
- }, [h("div", _e, [le(t.$slots, "default", {}, void 0, !0)])], 6)) : p("", !0)]));
209
- }
210
- }, [["__scopeId", "data-v-c292996f"]]), ve = /* @__PURE__ */ e({ default: () => yt }), ye = { class: "vue-data-ui-component vue-ui-annotator" }, be = { "data-dom-to-png-ignore": "" }, xe = ["disabled"], Se = ["disabled"], Ce = ["disabled"], we = ["disabled"], Te = ["disabled"], Ee = ["disabled"], De = ["disabled"], Oe = ["disabled"], ke = ["disabled"], Ae = {
211
- class: "tool-selection",
212
- style: { "margin-top": "6px" }
213
- }, je = {
214
- viewBox: "0 0 12 12",
215
- style: { width: "100%" }
216
- }, Me = ["fill"], Ne = { key: 0 }, Pe = { class: "tool-input" }, Fe = ["checked"], Ie = {
217
- viewBox: "0 0 12 12",
218
- style: { width: "100%" }
219
- }, Le = ["fill"], Re = { key: 1 }, ze = { class: "tool-input" }, Be = ["checked"], Ve = {
220
- viewBox: "0 0 24 24",
221
- style: { width: "100%" }
222
- }, He = ["stroke"], Ue = { key: 2 }, We = { style: {
223
- display: "flex",
224
- "flex-direction": "column",
225
- "align-items": "center",
226
- "justify-content": "center"
227
- } }, Ge = { class: "tool-input" }, Ke = { key: 3 }, qe = { style: {
228
- display: "flex",
229
- "flex-direction": "column",
230
- "align-items": "center",
231
- "justify-content": "center"
232
- } }, Je = { class: "tool-input" }, Ye = {
233
- viewBox: "0 0 24 24",
234
- height: "24",
235
- width: "24",
236
- style: {
237
- "margin-bottom": "-5px",
238
- "margin-top": "-10px"
239
- }
240
- }, Xe = ["checked"], Ze = { key: 4 }, Qe = { style: {
241
- display: "flex",
242
- "flex-direction": "column",
243
- "align-items": "center",
244
- "justify-content": "center"
245
- } }, $e = { class: "tool-input" }, et = { key: 5 }, tt = { key: 6 }, nt = ["disabled"], rt = { key: 7 }, it = ["disabled"], at = { key: 8 }, ot = { key: 9 }, st = { key: 10 }, ct = { key: 11 }, lt = {
246
- style: {
247
- display: "flex",
248
- "flex-direction": "column",
249
- "align-items": "center",
250
- "justify-content": "center"
251
- },
252
- class: "tooltip"
253
- }, ut = { style: {
254
- display: "flex",
255
- "flex-direction": "column",
256
- "align-items": "start",
257
- "justify-content": "center"
258
- } }, dt = {
259
- class: "tool-input",
260
- style: { "font-variant-numeric": "tabular-nums" }
261
- }, ft = ["id"], pt = [
262
- "viewBox",
263
- "width",
264
- "height"
265
- ], mt = [
266
- "width",
267
- "height",
268
- "pointer-events"
269
- ], ht = ["innerHTML"], gt = [
270
- "height",
271
- "viewBox",
272
- "width"
273
- ], _t = ["cx", "cy"], vt = "annotations", yt = /*#__PURE__*/ l({
274
- __name: "vue-ui-annotator",
275
- props: {
276
- config: {
277
- type: Object,
278
- default() {
279
- return {};
280
- }
281
- },
282
- dataset: {
283
- type: Object,
284
- default() {
285
- return {
286
- shapes: [],
287
- lastSelectedShape: void 0
288
- };
289
- }
290
- }
291
- },
292
- emits: ["toggleOpenState", "saveAnnotations"],
293
- setup(e, { emit: l }) {
294
- let ie = e, _e = l, ve = x(i()), { isImaging: yt, generateImage: bt } = ee({
295
- elementId: ve.value,
296
- fileName: vt
297
- }), T = x(void 0), xt = x(1), E = x({
298
- start: {
299
- x: 0,
300
- y: 0
301
- },
302
- end: {
303
- x: 0,
304
- y: 0
305
- }
306
- }), D = x(void 0), O = x(void 0), St = x(!1), k = x(!1), Ct = x(!1), A = x(!1), wt = x(!1), Tt = x(!0), j = x(!1), Et = x(!1), Dt = x(!1), M = x(!1), Ot = x(!1), N = x(!1), P = x(!1), kt = x(!1), F = x(!1), At = x(!1), I = x(!1), L = x(ie.dataset?.lastSelectedShape ?? void 0), R = x({
307
- x: 0,
308
- y: 0
309
- }), jt = x(!0), z = x([]), B = x(ie.dataset?.shapes || []);
310
- x([]);
311
- let Mt = x(Math.round(Math.random()) * 1e5), Nt = x(1e3), Pt = x(1e3), V = x({
312
- arrow: {
313
- color: "grey",
314
- filled: !0
315
- },
316
- circle: {
317
- color: "grey",
318
- filled: !1,
319
- radius: 3,
320
- strokeWidth: 2
321
- },
322
- rect: {
323
- color: "grey",
324
- filled: !1,
325
- strokeWidth: 2,
326
- height: 12,
327
- width: 12
328
- }
329
- }), Ft = x("#1A1A1A"), H = x(!1), It = x(1), Lt = x(void 0), Rt = x(1), zt = x(1), U = x("start"), Bt = x(20), Vt = x(100), Ht = n, Ut = x(null), W = x(!1), G = x(null), K = x({
330
- x: 0,
331
- y: 0
332
- }), Wt = x(null), q = x([]), Gt = x(!1), Kt = x(null), qt = x({
333
- undo: 0,
334
- redo: 0
335
- }), Jt = x(null);
336
- x(null), x(null);
337
- let Yt = x(null), J = d(() => {
338
- let e = s().vue_ui_annotator;
339
- if (!Object.keys(ie.config || {}).length) return e;
340
- let n = r({
341
- defaultConfig: e,
342
- userConfig: ie.config
343
- });
344
- return t(n);
345
- });
346
- a({
347
- config: () => J.value,
348
- dataset: () => [],
349
- component: "VueUiAnnotator",
350
- rules: [o.noHint]
351
- });
352
- let Y = d(() => J.value.useCursorPointer), X = d(() => {
353
- let e = J.value.style.tooltips;
354
- return {
355
- backgroundColor: e.backgroundColor,
356
- color: e.color,
357
- border: e.border,
358
- borderRadius: `${e.borderRadius}px`,
359
- boxShadow: e.boxShadow
360
- };
361
- }), Xt = d(() => B.value.filter((e) => !["line", "group"].includes(e.type)).length > 1), Zt = d(() => Ht[Vt.value > 98 ? 98 : Vt.value]), Qt = d(() => {
362
- switch (!0) {
363
- case A.value: return "default";
364
- case M.value: return "move";
365
- case F.value: return "text";
366
- case N.value: return "se-resize";
367
- default: return "";
368
- }
369
- }), $t = d(() => B.value), en = x(null);
370
- function tn(e) {
371
- if (e) switch (!0) {
372
- case e.type === "rect": return `
373
- <rect
374
- id="${e.id}"
375
- style="stroke-dasharray: 10; display:${O.value && O.value === e.id ? "initial" : "none"}"
376
- x="${e.x - 20}"
377
- y="${e.y - 20}"
378
- height="${e.rectHeight + 40}"
379
- width="${e.rectWidth + 40}"
380
- fill="transparent"
381
- stroke="grey"
382
- />
383
- `;
384
- case e.type === "circle": return `
385
- <rect
386
- id="${e.id}"
387
- style="stroke-dasharray: 10; display:${O.value && O.value === e.id ? "initial" : "none"}"
388
- x="${e.x - e.circleRadius - 20}"
389
- y="${e.y - e.circleRadius - 20}"
390
- height="${e.circleRadius * 2 + 40}"
391
- width="${e.circleRadius * 2 + 40}"
392
- fill="transparent"
393
- stroke="grey"
394
- />
395
- `;
396
- case e.type === "arrow":
397
- let t = e.endX - e.x > 0, n = e.endY - e.y > 0;
398
- return `
399
- <rect
400
- id="${e.id}"
401
- style="stroke-dasharray: 10; display:${O.value && O.value === e.id ? "initial" : "none"}"
402
- x="${t ? e.x - 20 : e.endX - 20}"
403
- y="${n ? e.y - 20 : e.endY - 20}"
404
- height="${n ? e.endY - e.y + 40 : e.y - e.endY + 40}"
405
- width="${t ? e.endX - e.x + 40 : e.x - e.endX + 40}"
406
- fill="transparent"
407
- stroke="grey"
408
- />
409
- `;
410
- case e.type === "text":
411
- let r = en.value ? Array.from(en.value.getElementsByTagName("text")).find((t) => t.id === e.id) : null;
412
- if (!r) return;
413
- let { x: i, y: a, width: o, height: s } = r.getBBox();
414
- return `
415
- <rect
416
- id="${e.id}"
417
- style="stroke-dasharray: 10; display:${O.value && O.value === e.id ? "initial" : "none"}"
418
- x="${i - 20}"
419
- y="${a - 20}"
420
- height="${s + 40}"
421
- width="${o + 40}"
422
- fill="transparent"
423
- stroke="grey"
424
- />
425
- `;
426
- default: return "";
427
- }
428
- }
429
- function nn(e, t = !1) {
430
- switch (!0) {
431
- case e.type === "circle": return `
432
- <g id="${e.id}" style="display:${A.value ? "initial" : "none"};">
433
- <circle id="${e.id}" cx="${e.x}" cy="${e.y}" r="12" fill="red"/>
434
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x - 4}" y1="${e.y - 4}" x2="${e.x + 4}" y2="${e.y + 4}"/>
435
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x + 4}" y1="${e.y - 4}" x2="${e.x - 4}" y2="${e.y + 4}"/>
436
- </g>
437
- `;
438
- case e.type === "text":
439
- let n, r = [
440
- -8,
441
- -12,
442
- -4,
443
- -12,
444
- -4
445
- ];
446
- switch (!0) {
447
- case e.textAlign === "start":
448
- n = t ? [
449
- -20,
450
- -24,
451
- -16,
452
- -16,
453
- -24
454
- ] : [
455
- -16,
456
- -20,
457
- -12,
458
- -12,
459
- -20
460
- ];
461
- break;
462
- case e.textAlign === "middle":
463
- n = [
464
- 0,
465
- -4,
466
- 4,
467
- 4,
468
- -4
469
- ], r = [
470
- -32,
471
- -36,
472
- -28,
473
- -36,
474
- -28
475
- ];
476
- break;
477
- case e.textAlign === "end":
478
- n = [
479
- 16,
480
- 20,
481
- 12,
482
- 12,
483
- 20
484
- ];
485
- break;
486
- default: n = [
487
- 0,
488
- 0,
489
- 0
490
- ];
491
- }
492
- return `
493
- <g id="${e.id}" style="display:${A.value ? "initial" : "none"};">
494
- <circle id="${e.id}" cx="${e.x + n[0]}" cy="${e.y + r[0]}" r="12" fill="red"/>
495
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x + n[1]}" y1="${e.y + r[1]}" x2="${e.x + n[2]}" y2="${e.y + r[2]}"/>
496
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x + n[3]}" y1="${e.y + r[3]}" x2="${e.x + n[4]}" y2="${e.y + r[4]}"/>
497
- </g>
498
- `;
499
- default: return `
500
- <g id="${e.id}" style="display:${A.value ? "initial" : "none"};">
501
- <circle id="${e.id}" cx="${e.x - 4}" cy="${e.y - 4}" r="12" fill="red"/>
502
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x - 8}" y1="${e.y - 8}" x2="${e.x}" y2="${e.y}"/>
503
- <line stroke="white" stroke-width="2" id="${e.id}" x1="${e.x}" y1="${e.y - 8}" x2="${e.x - 8}" y2="${e.y}"/>
504
- </g>
505
- `;
506
- }
507
- }
508
- function rn(e) {
509
- switch (!0) {
510
- case e.textAlign === "middle": return `<path class="vue-ui-annotator-caret" stroke="black" stroke-width="2" d="M${e.x},${e.y - e.fontSize} ${e.x},${e.y - e.fontSize - 15}" /> <path class="vue-ui-annotator-caret" stroke="black" stroke-width="2" d="M${e.x - 3},${e.y - e.fontSize - 5} ${e.x},${e.y - e.fontSize} ${e.x + 3},${e.y - e.fontSize - 5}"/>`;
511
- case e.textAlign === "start":
512
- let t = e.isBulletTextMode ? e.fontSize : 0;
513
- return `<path class="vue-ui-annotator-caret" d="M${e.x - 20 - t},${e.y - e.fontSize / 6} ${e.x - 5 - t},${e.y - e.fontSize / 6}" stroke="black" stroke-width="2" />
514
- <path class="vue-ui-annotator-caret" d="M${e.x - 10 - t},${e.y - e.fontSize / 3} ${e.x - 5 - t},${e.y - e.fontSize / 6} ${e.x - 10 - t},${e.y}" stroke="black" stroke-width="2">`;
515
- case e.textAlign === "end": return `<path class="vue-ui-annotator-caret" d="M${e.x + 20},${e.y - e.fontSize / 6} ${e.x + 5},${e.y - e.fontSize / 6}" stroke="black" stroke-width="2" />
516
- <path class="vue-ui-annotator-caret" d="M${e.x + 10},${e.y - e.fontSize / 3} ${e.x + 5},${e.y - e.fontSize / 6} ${e.x + 10},${e.y}" stroke="black" stroke-width="2">`;
517
- default: return "";
518
- }
519
- }
520
- function an(e, t, n = !1) {
521
- switch (!0) {
522
- case e.textAlign === "start": return `
523
- <g id="${e.id}">
524
- <rect
525
- id="${e.id}"
526
- style="display:${L.value && L.value.id === e.id ? "initial" : "none"};"
527
- x="${e.x}"
528
- y="${e.y - 50}"
529
- height="${e.lines === 0 || e.lines === 1 ? e.fontSize * 4 : e.fontSize * 2 * e.lines}"
530
- width="100"
531
- fill="rgba(0,0,0,0)"
532
- />
533
- <text
534
- style="user-select:none; height:100px;"
535
- id="${e.id}"
536
- x="${e.x}"
537
- y="${e.y}"
538
- text-anchor="${e.textAlign}"
539
- font-size="${e.fontSize}"
540
- fill="${e.color}"
541
- font-weight="${e.isBold ? "bold" : "normal"}"
542
- font-style="${e.isItalic ? "italic" : "normal"}"
543
- text-decoration="${e.isUnderline ? "underline" : "none"}"
544
- >
545
- ${t.join("")}
546
- </text>
547
- ${H.value && L.value && L.value.id === e.id ? rn(e) : ""}
548
- ${nn(e, n)}
549
- </g>
550
- `;
551
- case e.textAlign === "middle": return `
552
- <g id="${e.id}">
553
- <rect
554
- id="${e.id}"
555
- style="display:${L.value && L.value.id === e.id ? "initial" : "none"};"
556
- x="${e.x - 50}"
557
- y="${e.y - 50}"
558
- height="${e.lines === 0 || e.lines === 1 ? e.fontSize * 4 : e.fontSize * 2 * e.lines}"
559
- width="100"
560
- fill="rgba(0,0,0,0)"
561
- />
562
- <text
563
- style="user-select:none; height:100px;"
564
- id="${e.id}"
565
- x="${e.x}"
566
- y="${e.y}"
567
- text-anchor="${e.textAlign}"
568
- font-size="${e.fontSize}"
569
- fill="${e.color}"
570
- font-weight="${e.isBold ? "bold" : "normal"}"
571
- font-style="${e.isItalic ? "italic" : "normal"}"
572
- text-decoration="${e.isUnderline ? "underline" : "none"}"
573
- >
574
- ${t.join("")}
575
- </text>
576
- ${H.value && L.value && L.value.id === e.id ? rn(e) : ""}
577
- ${nn(e)}
578
- </g>
579
- `;
580
- case e.textAlign === "end": return `
581
- <g id="${e.id}">
582
- <rect
583
- id="${e.id}"
584
- style="display:${L.value && L.value.id === e.id ? "initial" : "none"};"
585
- x="${e.x - 100}"
586
- y="${e.y - 50}"
587
- height="${e.lines === 0 || e.lines === 1 ? e.fontSize * 4 : e.fontSize * 2 * e.lines}"
588
- width="100"
589
- fill="rgba(0,0,0,0)"
590
- />
591
- <text
592
- style="user-select:none; height:100px;"
593
- id="${e.id}"
594
- x="${e.x}"
595
- y="${e.y}"
596
- text-anchor="${e.textAlign}"
597
- font-size="${e.fontSize}"
598
- fill="${e.color}"
599
- font-weight="${e.isBold ? "bold" : "normal"}"
600
- font-style="${e.isItalic ? "italic" : "normal"}"
601
- text-decoration="${e.isUnderline ? "underline" : "none"}"
602
- >
603
- ${t.join("")}
604
- </text>
605
- ${H.value && L.value && L.value.id === e.id ? rn(e) : ""}
606
- ${nn(e)}
607
- </g>
608
- `;
609
- default: return "";
610
- }
611
- }
612
- let on = d(() => $t.value.map((e) => {
613
- switch (!0) {
614
- case e && e.type === "arrow":
615
- let t = e.strokeWidth > 3 ? 5 : 10, n = e.strokeWidth > 3 ? 2.5 : 5;
616
- return {
617
- html: `
618
- <defs>
619
- <marker
620
- id="${e.id}"
621
- markerWidth="${t}"
622
- markerHeight="${t}"
623
- refX="0"
624
- refY="${n}"
625
- orient="auto"
626
- >
627
- <polygon
628
- points="0 0,${t} ${n}, 0 ${t}"
629
- fill="${e.color}"
630
- />
631
- </marker>
632
- </defs>
633
- ${tn(e)}
634
- <g id="${e.id}">
635
- <path
636
- style="stroke-linecap: round !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
637
- stroke="${e.color}"
638
- id="${e.id}"
639
- d="M${e.x},${e.y} ${e.endX},${e.endY}"
640
- stroke-width="${e.strokeWidth}"
641
- marker-end="url(#${e.id})"
642
- />
643
- </g>
644
- <g id="${e.id}">
645
- <rect
646
- id="${e.id}"
647
- x="${e.x - 10}"
648
- y="${e.y - 10}"
649
- height="20"
650
- width="20"
651
- fill="rgba(0,0,0,0.3)"
652
- style="display:${N.value || M.value ? "initial" : "none"}; rx:1 !important; ry:1 !important;"
653
- />
654
- </g>
655
- ${nn(e)}
656
- </g>
657
- `,
658
- id: e.id
659
- };
660
- case e && e.type === "circle": return {
661
- html: `
662
- <g id="${e.id}">
663
- ${tn(e)}
664
- <circle
665
- id="${e.id}"
666
- cx="${e.x}"
667
- cy="${e.y}"
668
- r="${e.circleRadius ? e.circleRadius : Number.MIN_VALUE}"
669
- fill="${e.isFilled ? e.color + e.alpha : "rgba(255,255,255,0.001)"}"
670
- stroke="${e.color + e.alpha}"
671
- stroke-width="${e.strokeWidth}"
672
- style="${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
673
- >
674
- </circle>
675
- </g>
676
-
677
- ${nn(e)}`,
678
- id: e.id
679
- };
680
- case e && e.type === "group": return {
681
- html: `<g id="${e.id}">
682
- <rect
683
- id="${N.value ? "" : e.id}"
684
- x="${e.x}"
685
- y="${e.y}"
686
- fill="transparent"
687
- height="${e.rectHeight}"
688
- width="${e.rectWidth}"
689
- stroke="grey"
690
- stroke-width="1"
691
- style="rx:1 !important; ry:1 !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}; display:${P.value || A.value || O.value && O.value === e.id ? "initial" : "none"};"
692
- />
693
- <g id="${e.id}">
694
- ${e.content ? e.content : ""}
695
- </g>
696
- ${nn(e)}
697
- </g> `,
698
- id: e.id
699
- };
700
- case e && e.type === "rect": return {
701
- html: `<g id="${e.id}">
702
- ${tn(e)}
703
- <rect
704
- id="${N.value ? "" : e.id}"
705
- x="${e.x}"
706
- y="${e.y}"
707
- fill="${e.isFilled ? e.color + e.alpha : "rgba(255,255,255,0.001)"}"
708
- height="${e.rectHeight}"
709
- width="${e.rectWidth}"
710
- stroke="${e.color + e.alpha}"
711
- stroke-width="${e.strokeWidth}"
712
- style="rx:1 !important; ry:1 !important; ${e.isDash ? `stroke-dasharray: ${e.strokeWidth * 3}` : ""}"
713
- />
714
- <rect id="${e.id}"
715
- x="${e.x + e.rectWidth}"
716
- y="${e.y + e.rectHeight}"
717
- height="20"
718
- width="20"
719
- fill="rgba(0,0,0,0.3)"
720
- style="display:${N.value ? "initial" : "none"}; rx:1 !important; ry:1 !important;"
721
- />
722
- ${nn(e)}
723
- </g> `,
724
- id: e.id
725
- };
726
- case e && e.type === "line": return {
727
- html: `
728
- <g id="${e.id}">
729
- <path
730
- id="${e.id}"
731
- d="M${e.path ? e.path : ""}"
732
- style="stroke:${e.color + e.alpha} !important; fill:none; stroke-width:${e.strokeWidth} !important; stroke-linecap: round !important; stroke-linejoin: round !important;"
733
- />
734
- ${nn(e)}
735
- </g>
736
- `,
737
- id: e.id
738
- };
739
- case e && e.type === "text":
740
- let r = e.textContent.split("‎"), i = [];
741
- for (let t = 0; t < r.length; t += 1) i.push(`
742
- ${e.isBulletTextMode ? `<tspan x="${e.x - e.fontSize}" y="${e.y + e.fontSize * t}" id="${e.id}" font-size="${e.fontSize / 2}">⬤</tspan>` : ""}
743
- <tspan id="${e.id}" x="${e.x}" y="${e.y + e.fontSize * t}">
744
- ${r[t]}
745
- </tspan>`);
746
- return {
747
- html: `
748
- ${tn(e)}
749
- ${an(e, i, e.isBulletTextMode)}
750
- `,
751
- id: e.id
752
- };
753
- }
754
- }));
755
- function Z(e) {
756
- if (e == null) return e;
757
- try {
758
- return typeof structuredClone == "function" ? structuredClone(e) : JSON.parse(JSON.stringify(e));
759
- } catch {
760
- return Array.isArray(e) ? e.map((e) => Z(e)) : typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, Z(t)])) : e;
761
- }
762
- }
763
- function sn(e = !1) {
764
- if (!T.value || !wt.value) return;
765
- E.value.end = {
766
- x: R.value.x,
767
- y: R.value.y
768
- };
769
- let t;
770
- B.value.length > 0 && D.value && (t = [...B.value].find((e) => e.id === D.value.id));
771
- let n, r, i;
772
- t && (n = t.x - E.value.end.x, r = t.y - E.value.end.y, i = Math.sqrt(n * n + r * r));
773
- let a, o;
774
- switch (e ? (a = Math.max(E.value.end.x, t.x), o = Math.min(E.value.end.x, t.x), Math.max(E.value.end.y, t.y), Math.min(E.value.end.y, t.y)) : (a = Math.max(E.value.end.x, E.value.start.x), o = Math.min(E.value.end.x, E.value.start.x), Math.max(E.value.end.y, E.value.start.y), Math.min(E.value.end.y, E.value.start.y)), !0) {
775
- case T.value === "arrow":
776
- B.value.at(-1).endX = E.value.end.x, B.value.at(-1).endY = E.value.end.y;
777
- break;
778
- case T.value === "circle":
779
- B.value.at(-1).circleRadius = Tt.value ? Z(a - o) + 20 : i + 20;
780
- break;
781
- case T.value === "line":
782
- B.value.at(-1).path += ` ${R.value.x} ${R.value.y} `;
783
- break;
784
- case ["rect", "group"].includes(T.value): B.value.at(-1).rectWidth = Z(E.value.end.x - B.value.at(-1).x) > 0 ? Z(E.value.end.x - B.value.at(-1).x) : 20, B.value.at(-1).rectHeight = Z(E.value.end.y - B.value.at(-1).y) > 0 ? Z(E.value.end.y - B.value.at(-1).y) : 20;
785
- }
786
- }
787
- function cn() {
788
- if (!wt.value) {
789
- Jt.value = null;
790
- return;
791
- }
792
- sn(), Jt.value = requestAnimationFrame(cn);
793
- }
794
- function ln(e) {
795
- let t = B.value.findIndex((t) => t.id === e);
796
- if (t > -1 && t !== B.value.length - 1) {
797
- let [e] = B.value.splice(t, 1);
798
- B.value.push(e);
799
- }
800
- }
801
- function un(e) {
802
- let t = (e) => !!e && B.value.some((t) => t.id === e);
803
- if (t(e?.target?.id)) return e.target.id;
804
- let n = en.value?.querySelector(".annotator__glass");
805
- if (!n) return null;
806
- let r = n.style.pointerEvents;
807
- n.style.pointerEvents = "none";
808
- let i = document.elementFromPoint(e.clientX, e.clientY);
809
- return n.style.pointerEvents = r || "all", t(i?.id) ? i.id : null;
810
- }
811
- function dn(e = {}) {
812
- let { maxEntries: t = 200, maxBytes: n = 2e6 } = e, r = {
813
- open: !1,
814
- before: null,
815
- undo: [],
816
- redo: []
817
- }, i = {
818
- undo: 0,
819
- redo: 0
820
- }, a = (e) => typeof e == "string" ? e.length * 2 : 0, o = () => JSON.stringify({
821
- shapes: Z(B.value),
822
- lastSelectedShape: Z(L.value)
823
- }), s = (e) => {
824
- let t = JSON.parse(e);
825
- B.value = t.shapes, L.value = t.lastSelectedShape;
826
- }, ee = () => {
827
- qt.value.undo = r.undo.length, qt.value.redo = r.redo.length;
828
- }, c = (e, o) => {
829
- let s = r[e];
830
- for (s.push(o), i[e] += a(o); s.length > t || i[e] > n;) {
831
- let t = s.shift();
832
- i[e] -= a(t);
833
- }
834
- };
835
- return {
836
- begin() {
837
- r.open || (r.open = !0, r.before = o());
838
- },
839
- end() {
840
- r.open && (r.open = !1, o() !== r.before && (c("undo", r.before), r.redo.length = 0, i.redo = 0), r.before = null, ee());
841
- },
842
- undo() {
843
- let e = r.undo.pop();
844
- if (!e) return;
845
- i.undo -= a(e);
846
- let t = o();
847
- c("redo", t), s(e), ee();
848
- },
849
- redo() {
850
- let e = r.redo.pop();
851
- if (!e) return;
852
- i.redo -= a(e);
853
- let t = o();
854
- c("undo", t), s(e), ee();
855
- },
856
- size() {
857
- return {
858
- undo: r.undo.length,
859
- redo: r.redo.length,
860
- approxBytes: {
861
- undo: i.undo,
862
- redo: i.redo
863
- }
864
- };
865
- }
866
- };
867
- }
868
- function fn() {
869
- if (!Wt.value) return;
870
- let e = Wt.value.getBoundingClientRect();
871
- K.value = {
872
- x: e.left + e.width / 2,
873
- y: e.top
874
- };
875
- }
876
- function Q(e, t, n = "top") {
877
- G.value = e, Wt.value = t.currentTarget || t.target, fn(), W.value = !0, window.addEventListener("scroll", fn, !0), window.addEventListener("resize", fn, { passive: !0 });
878
- }
879
- function $() {
880
- W.value = !1, G.value = null, Wt.value = null, window.removeEventListener("scroll", fn, !0), window.removeEventListener("resize", fn);
881
- }
882
- function pn(e) {
883
- let t = e?.target && e.target.id || D.value && D.value.id, n = B.value.find((e) => e.id === t);
884
- if (!n) {
885
- Ut.value = null;
886
- return;
887
- }
888
- L.value = n;
889
- let r = R.value.x, i = R.value.y;
890
- switch (n.type) {
891
- case "rect":
892
- case "circle":
893
- case "text":
894
- Ut.value = {
895
- dx: r - n.x,
896
- dy: i - n.y
897
- };
898
- break;
899
- case "arrow":
900
- Ut.value = {
901
- dx: r - n.x,
902
- dy: i - n.y,
903
- endDx: r - n.endX,
904
- endDy: i - n.endY
905
- };
906
- break;
907
- case "group":
908
- Ut.value = {
909
- dx: r - (n.x || 0),
910
- dy: i - (n.y || 0)
911
- };
912
- break;
913
- default: Ut.value = {
914
- dx: 0,
915
- dy: 0
916
- };
917
- }
918
- }
919
- function mn(e) {
920
- let t = B.value.find((e) => e.id === L.value.id);
921
- switch (!0) {
922
- case e === "front":
923
- B.value = B.value.filter((e) => e.id !== t.id), B.value.push(t);
924
- break;
925
- case e === "back":
926
- B.value = B.value.filter((e) => e.id !== t.id), B.value = [t, ...B.value];
927
- break;
928
- default: return;
929
- }
930
- }
931
- function hn() {
932
- if (!L.value?.id) return;
933
- let e = {
934
- ...L.value,
935
- id: `${L.value.id}_copy_${i()}`,
936
- x: L.value.x - 100 < 0 ? 1 : L.value.x - 100,
937
- y: L.value.y - 100 < 0 ? 1 : L.value.y - 100
938
- };
939
- B.value.push(e);
940
- }
941
- function gn(e) {
942
- e.preventDefault(), jt.value = !1, e.target && e.target.id && (O.value = e.target.id);
943
- }
944
- function _n() {
945
- !L.value || !L.value.id.includes("text") || L.value.textContent === "" && (B.value = B.value.filter((e) => e.id !== L.value.id), L.value = B.value.at(-1));
946
- }
947
- function vn(e) {
948
- if (A.value) return;
949
- e.preventDefault(), e.stopPropagation(), _n(), F.value ? (I.value = !0, H.value = !0) : (I.value = !1, H.value = !1, F.value = !1);
950
- let t = `text_${i()}`;
951
- if (I.value) {
952
- q.value?.begin(), B.value.push({
953
- id: t,
954
- type: "text",
955
- lines: 0,
956
- x: R.value.x,
957
- y: R.value.y,
958
- textContent: "",
959
- fontSize: Z(Bt.value),
960
- textAlign: Z(U.value),
961
- isBold: Z(St.value),
962
- isItalic: Z(Et.value),
963
- isUnderline: Z(At.value),
964
- color: Z(Ft.value),
965
- isBulletTextMode: Z(k.value)
966
- }), D.value = B.value.at(-1), L.value = B.value.at(-1), q.value?.end();
967
- return;
968
- }
969
- let n = () => {
970
- Ct.value = B.value.find((t) => t.id === e.target.id).isDash;
971
- }, r = () => {
972
- xt.value = B.value.find((t) => t.id === e.target.id).strokeWidth;
973
- };
974
- if (P.value = !1, e.target.id.includes("arrow")) {
975
- T.value = "arrow", n(), r();
976
- return;
977
- }
978
- if (e.target.id.includes("circle")) {
979
- T.value = "circle", V.value.circle.filled = B.value.find((t) => t.id === e.target.id).isFilled, n(), r();
980
- return;
981
- }
982
- if (e.target.id.includes("rect")) {
983
- T.value = "rect", V.value.rect.filled = B.value.find((t) => t.id === e.target.id).isFilled, n(), r();
984
- return;
985
- }
986
- if (e.target.id.includes("line")) {
987
- T.value = "line", r();
988
- return;
989
- }
990
- if (e.target.id.includes("text")) {
991
- F.value = !0, I.value = !0, H.value = !0;
992
- let t = B.value.find((t) => t.id === e.target.id);
993
- t && t.textAlign && (U.value = B.value.find((t) => t.id === e.target.id).textAlign), t && (k.value = B.value.find((t) => t.id === e.target.id).isBulletTextMode);
994
- return;
995
- }
996
- }
997
- function yn(e) {
998
- !L.value || L.value.type !== "text" || (L.value.textAlign = e);
999
- }
1000
- function bn() {
1001
- q.value?.undo?.();
1002
- }
1003
- function xn() {
1004
- q.value?.redo?.();
1005
- }
1006
- let Sn = [
1007
- 16,
1008
- 17,
1009
- 18,
1010
- 20,
1011
- 27,
1012
- 33,
1013
- 34,
1014
- 35,
1015
- 36,
1016
- 37,
1017
- 38,
1018
- 39,
1019
- 40,
1020
- 45,
1021
- 91,
1022
- 112,
1023
- 113,
1024
- 114,
1025
- 115,
1026
- 116,
1027
- 117,
1028
- 118,
1029
- 119,
1030
- 120,
1031
- 121,
1032
- 122,
1033
- 123,
1034
- 221,
1035
- 255,
1036
- "Unidentified"
1037
- ];
1038
- function Cn(e) {
1039
- if (jt.value) return;
1040
- e.preventDefault();
1041
- let t = e.keyCode;
1042
- if (!I.value) return;
1043
- H.value = !0;
1044
- let n;
1045
- if (n = L.value.type === "text" ? B.value.find((e) => e.id === L.value.id) : B.value.at(-1), D.value = n, n.type === "text") switch (D.value.isBold = Z(St.value), D.value.isItalic = Z(Et.value), D.value.isUnderline = Z(At.value), !0) {
1046
- case [8, 46].includes(t):
1047
- n.textContent = n.textContent.slice(0, -1);
1048
- break;
1049
- case t === 9:
1050
- n.textContent += "&nbsp; &nbsp; &nbsp; &nbsp;";
1051
- break;
1052
- case t === 13:
1053
- n.lines += 1, n.textContent += "‎";
1054
- return;
1055
- case Sn.includes(t): return;
1056
- default: n.textContent += e.key;
1057
- }
1058
- }
1059
- function wn() {
1060
- if (z.value = [], T.value !== "group") {
1061
- P.value = !1, B.value = B.value.filter((e) => e.type !== "group");
1062
- return;
1063
- }
1064
- let e = B.value.at(-1);
1065
- if (B.value.forEach((t) => {
1066
- if (t.type !== "group") switch (!0) {
1067
- case t.type === "arrow":
1068
- let n = t.x <= t.endX && t.y <= t.endY && e.x <= t.x && e.y <= t.y && e.x + e.rectWidth >= t.endX && e.y + e.rectHeight >= t.endY, r = t.endY < t.y && t.x < t.endX && e.x <= t.x && e.y <= t.y && e.x + e.rectWidth >= t.endX && e.y + e.rectHeight >= t.y, i = t.x > t.endX && t.y < t.endY && e.x <= t.endX && e.y <= t.endY && e.x + e.rectWidth >= t.x && e.y + e.rectHeight >= t.endY, a = t.x > t.endX && t.y > t.endY && e.x <= t.endX && e.y <= t.endY && e.x + e.rectWidth >= t.x && e.y + e.rectHeight >= t.y;
1069
- (n || r || i || a) && z.value.push(t);
1070
- break;
1071
- case t.type === "circle":
1072
- e.x <= t.x + t.circleRadius && e.y <= t.y + t.circleRadius && t.x + t.circleRadius <= e.x + e.rectWidth && t.y + t.circleRadius <= e.y + e.rectHeight && z.value.push(t);
1073
- break;
1074
- case t.type === "rect":
1075
- e.x <= t.x && e.y <= t.y && t.x <= e.x + e.rectWidth && t.y <= e.y + e.rectHeight && t.x + t.rectWidth <= e.x + e.rectWidth && t.y + t.rectHeight <= e.y + e.rectHeight && t.rectWidth <= e.rectWidth && t.rectHeight <= e.rectHeight && z.value.push(t);
1076
- break;
1077
- case t.type === "text": e.x <= t.x && e.y <= t.y && z.value.push(t);
1078
- }
1079
- }), z.value = z.value.map((t) => ({
1080
- ...t,
1081
- id: e.id,
1082
- oldId: t.id,
1083
- diffX: t.x - e.x,
1084
- diffY: t.y - e.y,
1085
- diffEndX: t.endX ? t.endX - e.x : 0,
1086
- diffEndY: t.endY ? t.endY - e.y : 0
1087
- })), e.source = z.value, z.value.length > 1) {
1088
- let t = Z(z.value).map((e) => e.oldId);
1089
- B.value = B.value.filter((e) => !t.includes(e.id)), z.value.forEach((t) => {
1090
- switch (!0) {
1091
- case t.type === "circle":
1092
- e.content += `
1093
- <circle
1094
- id="${t.id}"
1095
- cx="${t.x}"
1096
- cy="${t.y}"
1097
- r="${t.circleRadius ? t.circleRadius : Number.MIN_VALUE}"
1098
- fill="${t.isFilled ? t.color + t.alpha : "rgba(255,255,255,0.001)"}"
1099
- stroke="${t.color + t.alpha}"
1100
- stroke-width="${t.strokeWidth}"
1101
- style="${t.isDash ? `stroke-dasharray: ${t.strokeWidth * 3}` : ""}"
1102
- />
1103
- `;
1104
- break;
1105
- case t.type === "rect":
1106
- e.content += `
1107
- <rect
1108
- id="${N.value ? "" : t.id}"
1109
- x="${t.x}"
1110
- y="${t.y}"
1111
- fill="${t.isFilled ? t.color + t.alpha : "rgba(255,255,255,0.001)"}"
1112
- height="${t.rectHeight}"
1113
- width="${t.rectWidth}"
1114
- stroke="${t.color + t.alpha}"
1115
- stroke-width="${t.strokeWidth}"
1116
- style="rx:1 !important; ry:1 !important; ${t.isDash ? `stroke-dasharray: ${t.strokeWidth * 3}` : ""}"
1117
- />
1118
- `;
1119
- break;
1120
- case t.type === "arrow":
1121
- let n = t.strokeWidth > 3 ? 5 : 10, r = t.strokeWidth > 3 ? 2.5 : 5, a = i();
1122
- e.content += `
1123
- <g id="${t.id}">
1124
- <defs>
1125
- <marker
1126
- id="${a}"
1127
- markerWidth="${n}"
1128
- markerHeight="${n}"
1129
- refX="0"
1130
- refY="${r}"
1131
- orient="auto"
1132
- >
1133
- <polygon
1134
- points="0 0,${n} ${r}, 0 ${n}"
1135
- fill="${t.color}"
1136
- />
1137
- </marker>
1138
- </defs>
1139
-
1140
- <path
1141
- style="stroke-linecap: round !important; ${t.isDash ? `stroke-dasharray: ${t.strokeWidth * 3}` : ""}"
1142
- stroke="${t.color}"
1143
- id="${t.id}"
1144
- d="M${t.x},${t.y} ${t.endX},${t.endY}"
1145
- stroke-width="${t.strokeWidth}"
1146
- marker-end="url(#${a})"
1147
- />
1148
- </g>
1149
- `;
1150
- break;
1151
- case t.type === "text":
1152
- let o = t.textContent.split("‎"), s = [];
1153
- for (let e = 0; e < o.length; e += 1) s.push(`
1154
- ${t.isBulletTextMode ? `<tspan x="${t.x - t.fontSize}" y="${t.y + t.fontSize * e}" id="${t.id}" font-size="${t.fontSize / 2}">⬤</tspan>` : ""}
1155
- <tspan id="${t.id}" x="${t.x}" y="${t.y + t.fontSize * e}">
1156
- ${o[e]}
1157
- </tspan>`);
1158
- e.content += `
1159
- ${an(t, s, t.isBulletTextMode)}
1160
- `;
1161
- }
1162
- });
1163
- } else B.value = B.value.filter((t) => t.id !== e.id);
1164
- }
1165
- function Tn(e) {
1166
- e.content = "";
1167
- let t = e.x || 0, n = e.y || 0;
1168
- (e.source || []).forEach((r) => {
1169
- switch (r.type) {
1170
- case "circle": {
1171
- let i = t + r.diffX, a = n + r.diffY;
1172
- e.content += `
1173
- <circle
1174
- id="${r.id}"
1175
- cx="${i}"
1176
- cy="${a}"
1177
- r="${r.circleRadius ? r.circleRadius : Number.MIN_VALUE}"
1178
- fill="${r.isFilled ? r.color + r.alpha : "rgba(255,255,255,0.001)"}"
1179
- stroke="${r.color + r.alpha}"
1180
- stroke-width="${r.strokeWidth}"
1181
- style="${r.isDash ? `stroke-dasharray: ${r.strokeWidth * 3}` : ""}"
1182
- />
1183
- `;
1184
- break;
1185
- }
1186
- case "rect": {
1187
- let i = t + r.diffX, a = n + r.diffY;
1188
- e.content += `
1189
- <rect
1190
- id="${N.value ? "" : r.id}"
1191
- x="${i}"
1192
- y="${a}"
1193
- fill="${r.isFilled ? r.color + r.alpha : "rgba(255,255,255,0.001)"}"
1194
- height="${r.rectHeight}"
1195
- width="${r.rectWidth}"
1196
- stroke="${r.color + r.alpha}"
1197
- stroke-width="${r.strokeWidth}"
1198
- style="rx:1 !important; ry:1 !important; ${r.isDash ? `stroke-dasharray: ${r.strokeWidth * 3}` : ""}"
1199
- />
1200
- `;
1201
- break;
1202
- }
1203
- case "arrow": {
1204
- let a = t + r.diffX, o = n + r.diffY, s = t + r.diffEndX, ee = n + r.diffEndY, c = r.strokeWidth > 3 ? 5 : 10, l = r.strokeWidth > 3 ? 2.5 : 5, u = `m_${r.id}_${i()}`;
1205
- e.content += `
1206
- <g id="${r.id}">
1207
- <defs>
1208
- <marker
1209
- id="${u}"
1210
- markerWidth="${c}"
1211
- markerHeight="${c}"
1212
- refX="0"
1213
- refY="${l}"
1214
- orient="auto">
1215
- <polygon points="0 0,${c} ${l}, 0 ${c}" fill="${r.color}" />
1216
- </marker>
1217
- </defs>
1218
- <path
1219
- style="stroke-linecap: round !important; ${r.isDash ? `stroke-dasharray: ${r.strokeWidth * 3}` : ""}"
1220
- stroke="${r.color}"
1221
- id="${r.id}"
1222
- d="M${a},${o} ${s},${ee}"
1223
- stroke-width="${r.strokeWidth}"
1224
- marker-end="url(#${u})"
1225
- />
1226
- </g>
1227
- `;
1228
- break;
1229
- }
1230
- case "text": {
1231
- let i = (r.textContent || "").split("‎").map((e, i) => `
1232
- ${r.isBulletTextMode ? `<tspan x="${t + r.diffX - r.fontSize}" y="${n + r.diffY + r.fontSize * i}" id="${r.id}" font-size="${r.fontSize / 2}">⬤</tspan>` : ""}
1233
- <tspan id="${r.id}" x="${t + r.diffX}" y="${n + r.diffY + r.fontSize * i}">
1234
- ${e}
1235
- </tspan>
1236
- `).join("");
1237
- e.content += `
1238
- <g id="${r.id}">
1239
- <text
1240
- style="user-select:none; height:100px;"
1241
- id="${r.id}"
1242
- x="${t + r.diffX}"
1243
- y="${n + r.diffY}"
1244
- text-anchor="${r.textAlign}"
1245
- font-size="${r.fontSize}"
1246
- fill="${r.color}"
1247
- font-weight="${r.isBold ? "bold" : "normal"}"
1248
- font-style="${r.isItalic ? "italic" : "normal"}"
1249
- text-decoration="${r.isUnderline ? "underline" : "none"}">
1250
- ${i}
1251
- </text>
1252
- </g>
1253
- `;
1254
- break;
1255
- }
1256
- }
1257
- });
1258
- }
1259
- function En(e) {
1260
- e.relatedTarget && en.value && en.value.contains(e.relatedTarget) || (jt.value = !0, O.value = void 0);
1261
- }
1262
- function Dn() {
1263
- if (wt.value = !0, !T.value && !P.value || !wt.value) return;
1264
- Tt.value = !0, E.value.start = {
1265
- x: R.value.x,
1266
- y: R.value.y
1267
- };
1268
- let e = `${P.value ? "group" : T.value}_${i()}`;
1269
- switch (!0) {
1270
- case T.value === "arrow":
1271
- B.value.push({
1272
- id: e,
1273
- x: R.value.x,
1274
- y: R.value.y,
1275
- endX: R.value.x,
1276
- endY: R.value.y,
1277
- type: T.value,
1278
- color: Z(Ft.value),
1279
- strokeWidth: Z(Math.abs(xt.value)),
1280
- isDash: Z(Ct.value)
1281
- }), L.value = B.value.at(-1);
1282
- break;
1283
- case T.value === "circle":
1284
- B.value.push({
1285
- alpha: V.value.circle.filled ? Zt.value : "",
1286
- id: e,
1287
- color: Z(Ft.value),
1288
- isFilled: Z(V.value.circle.filled),
1289
- circleRadius: Z(V.value.circle.radius),
1290
- circleStrokeWidth: Z(V.value.circle.strokeWidth),
1291
- type: T.value,
1292
- x: R.value.x,
1293
- y: R.value.y,
1294
- strokeWidth: Z(Math.abs(xt.value)),
1295
- isDash: Z(Ct.value)
1296
- }), L.value = B.value.at(-1);
1297
- break;
1298
- case T.value === "line":
1299
- B.value.push({
1300
- alpha: Z(Zt.value),
1301
- id: e,
1302
- x: R.value.x,
1303
- y: R.value.y,
1304
- type: T.value,
1305
- color: Z(Ft.value),
1306
- strokeWidth: Z(Math.abs(xt.value)),
1307
- isDash: Z(Ct.value),
1308
- path: `${R.value.x} ${R.value.y}`
1309
- }), L.value = B.value.at(-1);
1310
- break;
1311
- case T.value === "rect":
1312
- B.value.push({
1313
- alpha: V.value.rect.filled ? Zt.value : "",
1314
- id: e,
1315
- color: Z(Ft.value),
1316
- isFilled: Z(V.value.rect.filled),
1317
- rectStrokeWidth: Z(V.value.rect.strokeWidth),
1318
- rectHeight: Z(V.value.rect.height),
1319
- rectWidth: Z(V.value.rect.width),
1320
- type: T.value,
1321
- x: R.value.x,
1322
- y: R.value.y,
1323
- strokeWidth: Z(Math.abs(xt.value)),
1324
- isDash: Z(Ct.value)
1325
- }), L.value = B.value.at(-1);
1326
- break;
1327
- case T.value === "group": B.value.push({
1328
- alpha: 1,
1329
- id: `group_${i()}`,
1330
- x: R.value.x,
1331
- y: R.value.y,
1332
- isFilled: !1,
1333
- rectHeight: Z(V.value.rect.height),
1334
- rectWidth: Z(V.value.rect.width),
1335
- rectStrokeWidth: 1,
1336
- type: "group",
1337
- color: "grey",
1338
- strokeWidth: 1,
1339
- isDash: !0,
1340
- content: ""
1341
- });
1342
- }
1343
- Jt.value ||= requestAnimationFrame(cn);
1344
- }
1345
- function On(e) {
1346
- if (A.value) {
1347
- Dt.value = !1;
1348
- return;
1349
- }
1350
- if (e.preventDefault(), e.stopPropagation(), Dt.value = !0, e.pointerId != null) {
1351
- try {
1352
- en.value?.setPointerCapture?.(e.pointerId);
1353
- } catch {}
1354
- Yt.value = e.pointerId;
1355
- } else Yt.value = null;
1356
- if ((j.value || M.value || N.value || P.value) && q.value?.begin?.(), j.value) {
1357
- Dn();
1358
- return;
1359
- }
1360
- if (M.value) {
1361
- let t = un(e) || O.value || L.value?.id;
1362
- t && (ln(t), D.value = { id: t }), pn(e);
1363
- }
1364
- }
1365
- function kn(e) {
1366
- if (!e || !e.id || e.type === "line" || !Ut.value && (pn({ target: { id: e.id } }), !Ut.value)) return;
1367
- let { dx: t, dy: n, endDx: r, endDy: i } = Ut.value, a = R.value.x, o = R.value.y;
1368
- switch (L.value = e, e.type) {
1369
- case "arrow":
1370
- e.x = a - t, e.y = o - n, e.endX = a - (r ?? t), e.endY = o - (i ?? n);
1371
- break;
1372
- case "circle":
1373
- e.x = a - t, e.y = o - n;
1374
- break;
1375
- case "rect":
1376
- e.x = a - t, e.y = o - n;
1377
- break;
1378
- case "text":
1379
- e.x = a - t, e.y = o - n;
1380
- break;
1381
- case "group": e.x = a - t, e.y = o - n, Tn(e);
1382
- }
1383
- }
1384
- function An() {
1385
- let e = D.value?.id || O.value;
1386
- if (!e) return;
1387
- let t = B.value.find((t) => t.id === e);
1388
- t && kn(t);
1389
- }
1390
- function jn() {
1391
- Tt.value = !1;
1392
- let e = D.value.id;
1393
- if (!e) return;
1394
- wt.value = !0;
1395
- let t = B.value.find((t) => t.id === e);
1396
- T.value = t.type, B.value = B.value.filter((t) => t.id !== e), B.value.push(t), sn(!0);
1397
- }
1398
- function Mn(e) {
1399
- A.value || (e.preventDefault(), e.stopPropagation(), e.target.localName !== "svg" && (D.value = e.target), M.value && Dt.value ? An() : N.value && Dt.value && jn());
1400
- }
1401
- function Nn(e) {
1402
- let t = e.target.id;
1403
- switch (!0) {
1404
- case A.value:
1405
- q.value?.begin(), B.value = [...B.value].filter((e) => e.id !== t), L.value = void 0, q.value?.end();
1406
- return;
1407
- default: L.value = B.value.find((e) => e.id === t);
1408
- }
1409
- }
1410
- let Pn = x(null);
1411
- function Fn(e, t) {
1412
- for (t(e), e = e.firstChild; e;) Fn(e, t), e = e.nextSibling;
1413
- }
1414
- function In() {
1415
- Ot.value = !0, A.value = !1, M.value = !1, N.value = !1, F.value = !1, I.value = !1, P.value = !1, T.value = void 0, H.value = !1, ae(async () => {
1416
- let e = Pn.value;
1417
- if (e) {
1418
- Fn(e, (e) => {
1419
- e && e.nodeType === 1 && (e.setAttribute("font-family", "Helvetica"), e.style.fontFamily = "Helvetica");
1420
- });
1421
- try {
1422
- let t;
1423
- try {
1424
- t = (await import("jspdf")).default;
1425
- } catch {
1426
- throw Error("jspdf is not installed. Run npm install jspdf");
1427
- }
1428
- let n = await c({
1429
- container: e,
1430
- scale: 2
1431
- }), r = new Image();
1432
- r.src = n, r.onload = () => {
1433
- let e = {
1434
- width: 595.28,
1435
- height: 841.89
1436
- }, i = r.width, a = r.height, o = i / e.width * e.height, s = e.width, ee = s / i * a, c = new t("", "pt", "a4"), l = 0, u = a;
1437
- if (u < o) c.addImage(n, "PNG", 0, 0, s, ee, "", "FAST");
1438
- else for (; u > 0;) c.addImage(n, "PNG", 0, l, s, ee, "", "FAST"), u -= o, l -= e.height, u > 0 && c.addPage();
1439
- c.save(`${(/* @__PURE__ */ new Date()).toLocaleDateString()}_annotations.pdf`);
1440
- };
1441
- } catch (e) {
1442
- console.error("Error generating image:", e);
1443
- } finally {
1444
- Ot.value = !1, Fn(e, (e) => {
1445
- e && e.nodeType === 1 && (e.setAttribute("font-family", J.value.style.fontFamily), e.style.fontFamily = J.value.style.fontFamily);
1446
- });
1447
- }
1448
- }
1449
- });
1450
- }
1451
- function Ln(e) {
1452
- if (!A.value && e && (e.preventDefault(), e.stopPropagation()), wt.value = !1, Dt.value = !1, Ut.value = null, Yt.value != null) {
1453
- try {
1454
- en.value?.releasePointerCapture?.(Yt.value);
1455
- } catch {}
1456
- Yt.value = null;
1457
- }
1458
- Jt.value &&= (cancelAnimationFrame(Jt.value), null), P.value && wn(), q.value?.end();
1459
- }
1460
- function Rn() {
1461
- !L.value || !L.value.id.includes("rect") || (L.value.isFilled = !L.value.isFilled);
1462
- }
1463
- function zn() {
1464
- !L.value || !L.value.id.includes("circle") || (L.value.isFilled = !L.value.isFilled);
1465
- }
1466
- function Bn() {
1467
- !L.value || L.value.type === "text" || (L.value.isDash = Z(Ct.value));
1468
- }
1469
- function Vn() {
1470
- !L.value || ["arrow", "text"].includes(L.value.id) || (L.value.alpha = Z(Zt.value));
1471
- }
1472
- function Hn() {
1473
- !L.value || ![
1474
- "arrow",
1475
- "circle",
1476
- "rect",
1477
- "line"
1478
- ].includes(L.value.type) || (L.value.strokeWidth = Z(Math.abs(xt.value)));
1479
- }
1480
- function Un() {
1481
- !L.value || L.value.type !== "text" || (L.value.isBold = Z(St.value), L.value.isItalic = Z(Et.value), L.value.isUnderline = Z(At.value), L.value.fontSize = Z(Bt.value), L.value.isBulletTextMode = Z(k.value));
1482
- }
1483
- function Wn(e) {
1484
- if (e.preventDefault(), !en.value) return;
1485
- let t = en.value.getBoundingClientRect(), n, r;
1486
- e.touches && e.touches.length > 0 ? (n = e.touches[0].clientX, r = e.touches[0].clientY) : (n = e.clientX, r = e.clientY), R.value.x = (n - t.left) / t.width * Pt.value, R.value.y = (r - t.top) / t.height * Nt.value;
1487
- }
1488
- function Gn(e) {
1489
- if (H.value = !1, _n(), e === T.value) {
1490
- T.value = void 0, j.value = !1;
1491
- return;
1492
- }
1493
- j.value = !0, A.value = !1, M.value = !1, N.value = !1, F.value = !1, T.value = e;
1494
- }
1495
- function Kn() {
1496
- kt.value = !kt.value, kt.value || (M.value = !1, N.value = !1, F.value = !1, I.value = !1, T.value = void 0, H.value = !1, A.value = !1, I.value = !1), _e("toggleOpenState", { isOpen: kt.value });
1497
- }
1498
- function qn() {
1499
- _e("saveAnnotations", {
1500
- shapes: B.value,
1501
- lastSelectedShape: L.value
1502
- });
1503
- }
1504
- let Jn = null;
1505
- return se(() => {
1506
- if (Pn.value) {
1507
- let e = !1;
1508
- Fn(Pn.value, (t) => {
1509
- if (!e && [
1510
- "DIV",
1511
- "svg",
1512
- "section",
1513
- "canvas"
1514
- ].includes(t.tagName)) {
1515
- Lt.value = t, e = !0;
1516
- return;
1517
- }
1518
- });
1519
- }
1520
- Gt.value = (() => {
1521
- if (typeof navigator > "u") return !1;
1522
- let e = navigator.userAgentData?.platform ?? "";
1523
- if (e) return /mac|ios/i.test(e);
1524
- let t = navigator.userAgent ?? "";
1525
- return /(Mac|iPhone|iPad|iPod)/i.test(t);
1526
- })();
1527
- let e = Lt?.value.getBoundingClientRect();
1528
- if (It.value = e.height / e.width, Pt.value = 1e3, Nt.value = It.value * 1e3, Rt.value = e.width, zt.value = e.height, new ResizeObserver((e) => {
1529
- e.forEach((e) => {
1530
- Rt.value = e.contentRect.width, zt.value = e.contentRect.height, It.value = e.contentRect.height / e.contentRect.width, Nt.value = It.value * 1e3;
1531
- });
1532
- }).observe(Lt.value), Kt.value = (e) => Cn(e), window.addEventListener("keydown", Kt.value), q.value = dn(), q.value.size) {
1533
- let e = q.value.size();
1534
- qt.value.undo = e.undo, qt.value.redo = e.redo;
1535
- }
1536
- Jn = ge({
1537
- isMacLike: Gt,
1538
- isSummaryOpen: kt,
1539
- isWriting: I,
1540
- isDeleteMode: A,
1541
- isMoveMode: M,
1542
- isResizeMode: N,
1543
- isSelectMode: P,
1544
- isDrawMode: j,
1545
- isTextMode: F,
1546
- activeShape: T,
1547
- showCaret: H,
1548
- lastSelectedShape: L,
1549
- shapes: B,
1550
- history: q,
1551
- setShapeTo: Gn,
1552
- undoLastShape: bn,
1553
- redoLastShape: xn
1554
- });
1555
- }), oe(() => {
1556
- $(), Jt.value && cancelAnimationFrame(Jt.value), Kt.value && window.removeEventListener("keydown", Kt.value), Jn && Jn(), window.removeEventListener("keydown", Cn);
1557
- }), pe(B, (e) => {
1558
- e.length === 0 && (L.value = void 0);
1559
- }), pe(F, (e) => {
1560
- H.value = e;
1561
- }), (e, t) => (b(), m("div", ye, [h("div", be, [_(te, {
1562
- config: {
1563
- maxHeight: 1e3,
1564
- useCursorPointer: Y.value,
1565
- head: {
1566
- backgroundColor: J.value.style.backgroundColor,
1567
- color: J.value.style.color,
1568
- iconColor: J.value.style.color,
1569
- iconSize: 20,
1570
- icon: kt.value ? "close" : "annotator",
1571
- padding: "6px"
1572
- },
1573
- body: {
1574
- backgroundColor: J.value.style.backgroundColor,
1575
- color: J.value.style.color
1576
- }
1577
- },
1578
- onToggle: Kn
1579
- }, {
1580
- title: C(({ color: e }) => [h("div", { style: y({ color: e }) }, S(J.value.translations.title), 5)]),
1581
- content: C(({ backgroundColor: e }) => [h("div", {
1582
- class: "tool-selection",
1583
- style: y({ backgroundColor: e })
1584
- }, [
1585
- h("button", {
1586
- disabled: B.value.length === 0,
1587
- style: y({
1588
- background: M.value ? J.value.style.buttons.controls.selected.backgroundColor : J.value.style.buttons.controls.backgroundColor,
1589
- border: M.value ? J.value.style.buttons.controls.selected.border : J.value.style.buttons.controls.border,
1590
- color: M.value ? J.value.style.buttons.controls.selected.color : J.value.style.buttons.controls.color,
1591
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1592
- cursor: Y.value ? "pointer" : "default"
1593
- }),
1594
- class: v({
1595
- "button-tool": !0,
1596
- "button-tool--selected": M.value,
1597
- tooltip: !0
1598
- }),
1599
- onClick: t[0] ||= (e) => {
1600
- _n(), M.value = !M.value, T.value = void 0, A.value = !1, j.value = !1, N.value = !1, P.value = !1, F.value = !1, I.value = !1, H.value = !1;
1601
- },
1602
- onMouseenter: t[1] ||= (e) => J.value.style.showTooltips && Q("move", e, "top"),
1603
- onMouseleave: $,
1604
- onFocus: t[2] ||= (e) => J.value.style.showTooltips && Q("move", e, "top"),
1605
- onBlur: $
1606
- }, [_(u, {
1607
- name: "move",
1608
- stroke: M.value ? J.value.style.buttons.controls.selected.color : J.value.style.buttons.controls.color
1609
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1610
- key: 0,
1611
- show: W.value && G.value === "move",
1612
- x: K.value.x,
1613
- y: K.value.y - 6,
1614
- placement: "top",
1615
- styleObject: X.value
1616
- }, {
1617
- default: C(() => [g(S(J.value.translations.tooltipMove) + " ", 1), t[91] ||= h("kbd", null, "M", -1)]),
1618
- _: 1
1619
- }, 8, [
1620
- "show",
1621
- "x",
1622
- "y",
1623
- "styleObject"
1624
- ])) : p("", !0)], 46, xe),
1625
- h("button", {
1626
- disabled: B.value.length === 0 || T.value === "line",
1627
- style: y({
1628
- background: N.value ? J.value.style.buttons.controls.selected.backgroundColor : J.value.style.buttons.controls.backgroundColor,
1629
- border: N.value ? J.value.style.buttons.controls.selected.border : J.value.style.buttons.controls.border,
1630
- color: N.value ? J.value.style.buttons.controls.selected.color : J.value.style.buttons.controls.color,
1631
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1632
- cursor: Y.value ? "pointer" : "default"
1633
- }),
1634
- class: v({
1635
- "button-tool": !0,
1636
- "button-tool--selected": N.value,
1637
- tooltip: !0
1638
- }),
1639
- onClick: t[3] ||= (e) => {
1640
- _n(), N.value = !N.value, M.value = !1, A.value = !1, j.value = !1, P.value = !1, F.value = !1, I.value = !1, T.value = void 0, H.value = !1;
1641
- },
1642
- onMouseenter: t[4] ||= (e) => J.value.style.showTooltips && Q("resize", e, "top"),
1643
- onMouseleave: $,
1644
- onFocus: t[5] ||= (e) => J.value.style.showTooltips && Q("resize", e, "top"),
1645
- onBlur: $
1646
- }, [_(u, {
1647
- name: "resize",
1648
- stroke: N.value ? J.value.style.buttons.controls.selected.color : J.value.style.buttons.controls.color
1649
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1650
- key: 0,
1651
- show: W.value && G.value === "resize",
1652
- x: K.value.x,
1653
- y: K.value.y - 6,
1654
- placement: "top",
1655
- styleObject: X.value
1656
- }, {
1657
- default: C(() => [g(S(J.value.translations.tooltipResize) + " ", 1), t[92] ||= h("kbd", null, "R", -1)]),
1658
- _: 1
1659
- }, 8, [
1660
- "show",
1661
- "x",
1662
- "y",
1663
- "styleObject"
1664
- ])) : p("", !0)], 46, Se),
1665
- h("button", {
1666
- disabled: B.value.length === 0,
1667
- style: y({
1668
- background: A.value ? J.value.style.buttons.controls.selected.backgroundColor : J.value.style.buttons.controls.backgroundColor,
1669
- border: A.value ? J.value.style.buttons.controls.selected.border : J.value.style.buttons.controls.border,
1670
- color: A.value ? J.value.style.buttons.controls.selected.color : J.value.style.buttons.controls.color,
1671
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1672
- cursor: Y.value ? "pointer" : "default"
1673
- }),
1674
- class: v({
1675
- "button-tool": !0,
1676
- "button-tool--selected": A.value,
1677
- tooltip: !0
1678
- }),
1679
- onClick: t[6] ||= (e) => {
1680
- _n(), A.value = !A.value, M.value = !1, N.value = !1, P.value = !1, F.value = !1, I.value = !1, T.value = void 0, H.value = !1;
1681
- },
1682
- onMouseenter: t[7] ||= (e) => J.value.style.showTooltips && Q("delete", e, "top"),
1683
- onMouseleave: $,
1684
- onFocus: t[8] ||= (e) => J.value.style.showTooltips && Q("delete", e, "top"),
1685
- onBlur: $
1686
- }, [_(u, {
1687
- name: "trash",
1688
- stroke: A.value ? J.value.style.buttons.controls.selected.color : J.value.style.buttons.controls.color
1689
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1690
- key: 0,
1691
- show: W.value && G.value === "delete",
1692
- x: K.value.x,
1693
- y: K.value.y - 6,
1694
- placement: "top",
1695
- styleObject: X.value
1696
- }, {
1697
- default: C(() => [g(S(J.value.translations.tooltipDelete) + " ", 1), t[93] ||= h("kbd", null, "D", -1)]),
1698
- _: 1
1699
- }, 8, [
1700
- "show",
1701
- "x",
1702
- "y",
1703
- "styleObject"
1704
- ])) : p("", !0)], 46, Ce),
1705
- h("button", {
1706
- disabled: !Xt.value,
1707
- style: y({
1708
- background: P.value ? J.value.style.buttons.controls.selected.backgroundColor : J.value.style.buttons.controls.backgroundColor,
1709
- border: P.value ? J.value.style.buttons.controls.selected.border : J.value.style.buttons.controls.border,
1710
- color: P.value ? J.value.style.buttons.controls.selected.color : J.value.style.buttons.controls.color,
1711
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1712
- cursor: Y.value ? "pointer" : "default"
1713
- }),
1714
- class: v({
1715
- "button-tool": !0,
1716
- "button-tool--selected": P.value,
1717
- tooltip: !0
1718
- }),
1719
- onClick: t[9] ||= (e) => {
1720
- _n(), Gn("group"), P.value = !P.value, A.value = !1, M.value = !1, N.value = !1, F.value = !1, I.value = !1, T.value = "group", H.value = !1;
1721
- },
1722
- onMouseenter: t[10] ||= (e) => J.value.style.showTooltips && Q("selectAndGroup", e, "top"),
1723
- onMouseleave: $,
1724
- onFocus: t[11] ||= (e) => J.value.style.showTooltips && Q("selectAndGroup", e, "top"),
1725
- onBlur: $
1726
- }, [_(u, {
1727
- name: "selectAndGroup",
1728
- stroke: P.value ? J.value.style.buttons.controls.selected.color : J.value.style.buttons.controls.color
1729
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1730
- key: 0,
1731
- show: W.value && G.value === "selectAndGroup",
1732
- x: K.value.x,
1733
- y: K.value.y - 6,
1734
- placement: "top",
1735
- styleObject: X.value
1736
- }, {
1737
- default: C(() => [g(S(J.value.translations.tooltipGroup) + " ", 1), t[94] ||= h("kbd", null, "G", -1)]),
1738
- _: 1
1739
- }, 8, [
1740
- "show",
1741
- "x",
1742
- "y",
1743
- "styleObject"
1744
- ])) : p("", !0)], 46, we),
1745
- h("button", {
1746
- disabled: B.value.length === 0,
1747
- style: y({
1748
- background: J.value.style.buttons.controls.backgroundColor,
1749
- border: J.value.style.buttons.controls.border,
1750
- color: J.value.style.buttons.controls.color,
1751
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1752
- cursor: Y.value ? "pointer" : "default"
1753
- }),
1754
- class: v({
1755
- "button-tool": !0,
1756
- tooltip: !0
1757
- }),
1758
- onClick: t[12] ||= (e) => {
1759
- N.value = !1, M.value = !0, A.value = !1, j.value = !1, P.value = !1, F.value = !1, I.value = !1, H.value = !1, mn("front");
1760
- },
1761
- onMouseenter: t[13] ||= (e) => J.value.style.showTooltips && Q("bringToFront", e, "top"),
1762
- onMouseleave: $,
1763
- onFocus: t[14] ||= (e) => J.value.style.showTooltips && Q("bringToFront", e, "top"),
1764
- onBlur: $
1765
- }, [_(u, {
1766
- name: "bringToFront",
1767
- stroke: J.value.style.buttons.controls.color
1768
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1769
- key: 0,
1770
- show: W.value && G.value === "bringToFront",
1771
- x: K.value.x,
1772
- y: K.value.y - 6,
1773
- placement: "top",
1774
- styleObject: X.value
1775
- }, {
1776
- default: C(() => [g(S(J.value.translations.tooltipBringToFront), 1)]),
1777
- _: 1
1778
- }, 8, [
1779
- "show",
1780
- "x",
1781
- "y",
1782
- "styleObject"
1783
- ])) : p("", !0)], 44, Te),
1784
- h("button", {
1785
- disabled: B.value.length === 0,
1786
- style: y({
1787
- background: J.value.style.buttons.controls.backgroundColor,
1788
- border: J.value.style.buttons.controls.border,
1789
- color: J.value.style.buttons.controls.color,
1790
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1791
- cursor: Y.value ? "pointer" : "default"
1792
- }),
1793
- class: v({
1794
- "button-tool": !0,
1795
- tooltip: !0
1796
- }),
1797
- onClick: t[15] ||= (e) => {
1798
- N.value = !1, M.value = !0, A.value = !1, j.value = !1, P.value = !1, F.value = !1, I.value = !1, H.value = !1, mn("back");
1799
- },
1800
- onMouseenter: t[16] ||= (e) => J.value.style.showTooltips && Q("bringToBack", e, "top"),
1801
- onMouseleave: $,
1802
- onFocus: t[17] ||= (e) => J.value.style.showTooltips && Q("bringToBack", e, "top"),
1803
- onBlur: $
1804
- }, [_(u, {
1805
- name: "bringToBack",
1806
- stroke: J.value.style.buttons.controls.color
1807
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1808
- key: 0,
1809
- show: W.value && G.value === "bringToBack",
1810
- x: K.value.x,
1811
- y: K.value.y - 6,
1812
- placement: "top",
1813
- styleObject: X.value
1814
- }, {
1815
- default: C(() => [g(S(J.value.translations.tooltipBringToBack), 1)]),
1816
- _: 1
1817
- }, 8, [
1818
- "show",
1819
- "x",
1820
- "y",
1821
- "styleObject"
1822
- ])) : p("", !0)], 44, Ee),
1823
- h("button", {
1824
- disabled: B.value.length === 0 || T.value === "line",
1825
- style: y({
1826
- background: J.value.style.buttons.controls.backgroundColor,
1827
- border: J.value.style.buttons.controls.border,
1828
- color: J.value.style.buttons.controls.color,
1829
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1830
- cursor: Y.value ? "pointer" : "default"
1831
- }),
1832
- class: v({
1833
- "button-tool": !0,
1834
- tooltip: !0
1835
- }),
1836
- onClick: t[18] ||= (e) => {
1837
- _n(), N.value = !1, M.value = !0, A.value = !1, j.value = !1, P.value = !1, F.value = !1, I.value = !1, H.value = !1, hn();
1838
- },
1839
- onMouseenter: t[19] ||= (e) => J.value.style.showTooltips && Q("duplicate", e, "top"),
1840
- onMouseleave: $,
1841
- onFocus: t[20] ||= (e) => J.value.style.showTooltips && Q("duplicate", e, "top"),
1842
- onBlur: $
1843
- }, [_(u, {
1844
- name: "copy",
1845
- stroke: J.value.style.buttons.controls.color,
1846
- size: 18
1847
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1848
- key: 0,
1849
- show: W.value && G.value === "duplicate",
1850
- x: K.value.x,
1851
- y: K.value.y - 6,
1852
- placement: "top",
1853
- styleObject: X.value
1854
- }, {
1855
- default: C(() => [g(S(J.value.translations.tooltipDuplicate), 1)]),
1856
- _: 1
1857
- }, 8, [
1858
- "show",
1859
- "x",
1860
- "y",
1861
- "styleObject"
1862
- ])) : p("", !0)], 44, De),
1863
- h("button", {
1864
- disabled: qt.value.undo === 0,
1865
- style: y({
1866
- background: J.value.style.buttons.controls.backgroundColor,
1867
- border: J.value.style.buttons.controls.border,
1868
- color: J.value.style.buttons.controls.color,
1869
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1870
- cursor: Y.value ? "pointer" : "default"
1871
- }),
1872
- class: v({
1873
- "button-tool": !0,
1874
- "button-tool--one-shot": !0,
1875
- tooltip: !0
1876
- }),
1877
- onClick: t[21] ||= (e) => {
1878
- N.value = !1, M.value = !1, A.value = !1, j.value = !1, P.value = !1, F.value = !1, I.value = !1, T.value = void 0, H.value = !1, bn();
1879
- },
1880
- onMouseenter: t[22] ||= (e) => J.value.style.showTooltips && Q("undoLast", e, "top"),
1881
- onMouseleave: $,
1882
- onFocus: t[23] ||= (e) => J.value.style.showTooltips && Q("undoLast", e, "top"),
1883
- onBlur: $
1884
- }, [_(u, {
1885
- name: "refresh",
1886
- stroke: J.value.style.buttons.controls.color,
1887
- size: 20
1888
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1889
- key: 0,
1890
- show: W.value && G.value === "undoLast",
1891
- x: K.value.x,
1892
- y: K.value.y - 6,
1893
- placement: "top",
1894
- styleObject: X.value
1895
- }, {
1896
- default: C(() => [
1897
- g(S(J.value.translations.tooltipUndo) + " ", 1),
1898
- h("kbd", null, S(Gt.value ? "⌘" : "Ctrl"), 1),
1899
- t[95] ||= h("kbd", null, "Z", -1)
1900
- ]),
1901
- _: 1
1902
- }, 8, [
1903
- "show",
1904
- "x",
1905
- "y",
1906
- "styleObject"
1907
- ])) : p("", !0)], 44, Oe),
1908
- h("button", {
1909
- disabled: qt.value.redo === 0,
1910
- style: y({
1911
- background: J.value.style.buttons.controls.backgroundColor,
1912
- border: J.value.style.buttons.controls.border,
1913
- color: J.value.style.buttons.controls.color,
1914
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1915
- cursor: Y.value ? "pointer" : "default"
1916
- }),
1917
- class: v({
1918
- "button-tool": !0,
1919
- "button-tool--one-shot": !0,
1920
- tooltip: !0
1921
- }),
1922
- onClick: t[24] ||= (e) => {
1923
- N.value = !1, M.value = !1, A.value = !1, j.value = !1, P.value = !1, F.value = !1, I.value = !1, T.value = void 0, H.value = !1, xn();
1924
- },
1925
- onMouseenter: t[25] ||= (e) => J.value.style.showTooltips && Q("redoLast", e, "top"),
1926
- onMouseleave: $,
1927
- onFocus: t[26] ||= (e) => J.value.style.showTooltips && Q("redoLast", e, "top"),
1928
- onBlur: $
1929
- }, [_(u, {
1930
- name: "refresh",
1931
- stroke: J.value.style.buttons.controls.color,
1932
- size: 20,
1933
- style: { transform: "rotateX(0deg) rotateY(180deg)" }
1934
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1935
- key: 0,
1936
- show: W.value && G.value === "redoLast",
1937
- x: K.value.x,
1938
- y: K.value.y - 6,
1939
- placement: "top",
1940
- styleObject: X.value
1941
- }, {
1942
- default: C(() => [
1943
- g(S(J.value.translations.tooltipRedo) + " ", 1),
1944
- h("kbd", null, S(Gt.value ? "⌘" : "Ctrl"), 1),
1945
- t[96] ||= h("kbd", null, "Y", -1)
1946
- ]),
1947
- _: 1
1948
- }, 8, [
1949
- "show",
1950
- "x",
1951
- "y",
1952
- "styleObject"
1953
- ])) : p("", !0)], 44, ke),
1954
- J.value.style.showPrint ? (b(), m("button", {
1955
- key: 0,
1956
- style: y({
1957
- background: J.value.style.buttons.controls.backgroundColor,
1958
- border: J.value.style.buttons.controls.border,
1959
- color: J.value.style.buttons.controls.color,
1960
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1961
- cursor: Y.value ? "pointer" : "default"
1962
- }),
1963
- class: v({
1964
- "button-tool": !0,
1965
- tooltip: !0
1966
- }),
1967
- onClick: In,
1968
- onMouseenter: t[27] ||= (e) => J.value.style.showTooltips && Q("printPdf", e, "top"),
1969
- onMouseleave: $,
1970
- onFocus: t[28] ||= (e) => J.value.style.showTooltips && Q("printPdf", e, "top"),
1971
- onBlur: $
1972
- }, [_(u, {
1973
- name: "printer",
1974
- stroke: J.value.style.buttons.controls.color
1975
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
1976
- key: 0,
1977
- show: W.value && G.value === "printPdf",
1978
- x: K.value.x,
1979
- y: K.value.y - 6,
1980
- placement: "top",
1981
- styleObject: X.value
1982
- }, {
1983
- default: C(() => [g(S(J.value.translations.tooltipPdf), 1)]),
1984
- _: 1
1985
- }, 8, [
1986
- "show",
1987
- "x",
1988
- "y",
1989
- "styleObject"
1990
- ])) : p("", !0)], 36)) : p("", !0),
1991
- J.value.style.showImage ? (b(), m("button", {
1992
- key: 1,
1993
- style: y({
1994
- background: J.value.style.buttons.controls.backgroundColor,
1995
- border: J.value.style.buttons.controls.border,
1996
- color: J.value.style.buttons.controls.color,
1997
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
1998
- cursor: Y.value ? "pointer" : "default"
1999
- }),
2000
- class: v({
2001
- "button-tool": !0,
2002
- tooltip: !0
2003
- }),
2004
- onClick: t[29] ||= (...e) => ue(bt) && ue(bt)(...e),
2005
- onMouseenter: t[30] ||= (e) => J.value.style.showTooltips && Q("printImage", e, "top"),
2006
- onMouseleave: $,
2007
- onFocus: t[31] ||= (e) => J.value.style.showTooltips && Q("printImage", e, "top"),
2008
- onBlur: $
2009
- }, [_(u, {
2010
- name: "image",
2011
- stroke: J.value.style.buttons.controls.color,
2012
- size: 20
2013
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
2014
- key: 0,
2015
- show: W.value && G.value === "printImage",
2016
- x: K.value.x,
2017
- y: K.value.y - 6,
2018
- placement: "top",
2019
- styleObject: X.value
2020
- }, {
2021
- default: C(() => [g(S(J.value.translations.tooltipImage), 1)]),
2022
- _: 1
2023
- }, 8, [
2024
- "show",
2025
- "x",
2026
- "y",
2027
- "styleObject"
2028
- ])) : p("", !0)], 36)) : p("", !0),
2029
- J.value.style.showSave ? (b(), m("button", {
2030
- key: 2,
2031
- style: y({
2032
- background: J.value.style.buttons.controls.backgroundColor,
2033
- border: J.value.style.buttons.controls.border,
2034
- color: J.value.style.buttons.controls.color,
2035
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2036
- cursor: Y.value ? "pointer" : "default"
2037
- }),
2038
- class: v({
2039
- "button-tool": !0,
2040
- tooltip: !0
2041
- }),
2042
- onClick: qn,
2043
- onMouseenter: t[32] ||= (e) => J.value.style.showTooltips && Q("saveAction", e, "top"),
2044
- onMouseleave: $,
2045
- onFocus: t[33] ||= (e) => J.value.style.showTooltips && Q("saveAction", e, "top"),
2046
- onBlur: $
2047
- }, [_(u, {
2048
- name: "save",
2049
- stroke: J.value.style.buttons.controls.color
2050
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
2051
- key: 0,
2052
- show: W.value && G.value === "saveAction",
2053
- x: K.value.x,
2054
- y: K.value.y - 6,
2055
- placement: "top",
2056
- styleObject: X.value
2057
- }, {
2058
- default: C(() => [g(S(J.value.translations.tooltipSave), 1)]),
2059
- _: 1
2060
- }, 8, [
2061
- "show",
2062
- "x",
2063
- "y",
2064
- "styleObject"
2065
- ])) : p("", !0)], 36)) : p("", !0)
2066
- ], 4), h("div", Ae, [
2067
- h("button", {
2068
- class: v({
2069
- "button-tool": !0,
2070
- "button-tool--selected": T.value === "circle",
2071
- tooltip: !0
2072
- }),
2073
- style: y({
2074
- background: T.value === "circle" ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2075
- border: T.value === "circle" ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2076
- color: T.value === "circle" ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2077
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2078
- cursor: Y.value ? "pointer" : "default"
2079
- }),
2080
- onClick: t[34] ||= (e) => {
2081
- Gn("circle"), P.value = !1;
2082
- },
2083
- onMouseenter: t[35] ||= (e) => J.value.style.showTooltips && Q("setCircle", e, "top"),
2084
- onMouseleave: $,
2085
- onFocus: t[36] ||= (e) => J.value.style.showTooltips && Q("setCircle", e, "top"),
2086
- onBlur: $
2087
- }, [(b(), m("svg", je, [h("circle", {
2088
- cx: 6,
2089
- cy: 6,
2090
- r: "4",
2091
- fill: V.value.circle.filled ? (T.value, Ft.value + Zt.value) : "none",
2092
- stroke: "currentColor"
2093
- }, null, 8, Me)])), J.value.style.showTooltips ? (b(), f(w, {
2094
- key: 0,
2095
- show: W.value && G.value === "setCircle",
2096
- x: K.value.x,
2097
- y: K.value.y - 6,
2098
- placement: "top",
2099
- styleObject: X.value
2100
- }, {
2101
- default: C(() => [g(S(J.value.translations.tooltipShapeCircle) + " ", 1), t[97] ||= h("kbd", null, "C", -1)]),
2102
- _: 1
2103
- }, 8, [
2104
- "show",
2105
- "x",
2106
- "y",
2107
- "styleObject"
2108
- ])) : p("", !0)], 38),
2109
- T.value === "circle" ? (b(), m("div", Ne, [h("label", Pe, [g(S(J.value.translations.filled) + " ", 1), me(h("input", {
2110
- type: "checkbox",
2111
- "onUpdate:modelValue": t[37] ||= (e) => V.value.circle.filled = e,
2112
- onChange: zn,
2113
- checked: V.value.circle.filled,
2114
- style: y({
2115
- all: "revert",
2116
- appearance: "auto",
2117
- "-webkit-appearance": "auto",
2118
- accentColor: J.value.style.color + " !important"
2119
- })
2120
- }, null, 44, Fe), [[de, V.value.circle.filled]])])])) : p("", !0),
2121
- h("button", {
2122
- class: v({
2123
- "button-tool": !0,
2124
- "button-tool--selected": T.value === "rect",
2125
- tooltip: !0
2126
- }),
2127
- style: y({
2128
- background: T.value === "rect" ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2129
- border: T.value === "rect" ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2130
- color: T.value === "rect" ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2131
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2132
- cursor: Y.value ? "pointer" : "default"
2133
- }),
2134
- onClick: t[38] ||= (e) => {
2135
- Gn("rect"), P.value = !1;
2136
- },
2137
- onMouseenter: t[39] ||= (e) => J.value.style.showTooltips && Q("setRect", e, "top"),
2138
- onMouseleave: $,
2139
- onFocus: t[40] ||= (e) => J.value.style.showTooltips && Q("setRect", e, "top"),
2140
- onBlur: $
2141
- }, [(b(), m("svg", Ie, [h("rect", {
2142
- x: "3",
2143
- y: "3",
2144
- style: {
2145
- rx: "0 !important",
2146
- ry: "0 !important"
2147
- },
2148
- height: "6",
2149
- width: "6",
2150
- fill: V.value.rect.filled ? (T.value, Ft.value + Zt.value) : "none",
2151
- stroke: "currentColor"
2152
- }, null, 8, Le)])), J.value.style.showTooltips ? (b(), f(w, {
2153
- key: 0,
2154
- show: W.value && G.value === "setRect",
2155
- x: K.value.x,
2156
- y: K.value.y - 6,
2157
- placement: "top",
2158
- styleObject: X.value
2159
- }, {
2160
- default: C(() => [g(S(J.value.translations.tooltipShapeRect) + " ", 1), t[98] ||= h("kbd", null, "S", -1)]),
2161
- _: 1
2162
- }, 8, [
2163
- "show",
2164
- "x",
2165
- "y",
2166
- "styleObject"
2167
- ])) : p("", !0)], 38),
2168
- T.value === "rect" ? (b(), m("div", Re, [h("label", ze, [g(S(J.value.translations.filled) + " ", 1), me(h("input", {
2169
- type: "checkbox",
2170
- "onUpdate:modelValue": t[41] ||= (e) => V.value.rect.filled = e,
2171
- onChange: Rn,
2172
- checked: V.value.rect.filled,
2173
- style: y({
2174
- all: "revert",
2175
- appearance: "auto",
2176
- "-webkit-appearance": "auto",
2177
- accentColor: J.value.style.color + " !important"
2178
- })
2179
- }, null, 44, Be), [[de, V.value.rect.filled]])])])) : p("", !0),
2180
- h("button", {
2181
- class: v({
2182
- "button-tool": !0,
2183
- "button-tool--selected": T.value === "arrow",
2184
- tooltip: !0
2185
- }),
2186
- style: y({
2187
- background: T.value === "arrow" ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2188
- border: T.value === "arrow" ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2189
- color: T.value === "arrow" ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2190
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2191
- cursor: Y.value ? "pointer" : "default"
2192
- }),
2193
- onClick: t[42] ||= (e) => {
2194
- Gn("arrow"), P.value = !1;
2195
- },
2196
- onMouseenter: t[43] ||= (e) => J.value.style.showTooltips && Q("setArrow", e, "top"),
2197
- onMouseleave: $,
2198
- onFocus: t[44] ||= (e) => J.value.style.showTooltips && Q("setArrow", e, "top"),
2199
- onBlur: $
2200
- }, [(b(), m("svg", Ve, [h("path", {
2201
- stroke: V.value.arrow.filled ? T.value === "arrow" ? "white" : "grey" : "none",
2202
- "stroke-width": "2",
2203
- d: "M5,19 19,5 14,5 19,10.5 19,5",
2204
- fill: "none",
2205
- "stroke-linecap": "round",
2206
- "stroke-linejoin": "round"
2207
- }, null, 8, He)])), J.value.style.showTooltips ? (b(), f(w, {
2208
- key: 0,
2209
- show: W.value && G.value === "setArrow",
2210
- x: K.value.x,
2211
- y: K.value.y - 6,
2212
- placement: "top",
2213
- styleObject: X.value
2214
- }, {
2215
- default: C(() => [g(S(J.value.translations.tooltipShapeArrow) + " ", 1), t[99] ||= h("kbd", null, "A", -1)]),
2216
- _: 1
2217
- }, 8, [
2218
- "show",
2219
- "x",
2220
- "y",
2221
- "styleObject"
2222
- ])) : p("", !0)], 38),
2223
- h("button", {
2224
- class: v({
2225
- "button-tool": !0,
2226
- "button-tool--selected": T.value === "line",
2227
- tooltip: !0
2228
- }),
2229
- style: y({
2230
- background: T.value === "line" ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2231
- border: T.value === "line" ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2232
- color: T.value === "line" ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2233
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2234
- cursor: Y.value ? "pointer" : "default"
2235
- }),
2236
- onClick: t[45] ||= (e) => {
2237
- Gn("line"), P.value = !1;
2238
- },
2239
- onMouseenter: t[46] ||= (e) => J.value.style.showTooltips && Q("setFreehand", e, "top"),
2240
- onMouseleave: $,
2241
- onFocus: t[47] ||= (e) => J.value.style.showTooltips && Q("setFreehand", e, "top"),
2242
- onBlur: $
2243
- }, [t[101] ||= h("svg", {
2244
- width: "80%",
2245
- viewBox: "0 0 24 24",
2246
- "stroke-width": "2",
2247
- stroke: "currentColor",
2248
- fill: "none",
2249
- "stroke-linecap": "round",
2250
- "stroke-linejoin": "round"
2251
- }, [h("path", {
2252
- stroke: "none",
2253
- d: "M0 0h24v24H0z",
2254
- fill: "none"
2255
- }), h("path", { d: "M3 15c2 3 4 4 7 4s7 -3 7 -7s-3 -7 -6 -7s-5 1.5 -5 4s2 5 6 5s8.408 -2.453 10 -5" })], -1), J.value.style.showTooltips ? (b(), f(w, {
2256
- key: 0,
2257
- show: W.value && G.value === "setFreehand",
2258
- x: K.value.x,
2259
- y: K.value.y - 6,
2260
- placement: "top",
2261
- styleObject: X.value
2262
- }, {
2263
- default: C(() => [g(S(J.value.translations.tooltipShapeFreehand) + " ", 1), t[100] ||= h("kbd", null, "L", -1)]),
2264
- _: 1
2265
- }, 8, [
2266
- "show",
2267
- "x",
2268
- "y",
2269
- "styleObject"
2270
- ])) : p("", !0)], 38),
2271
- [
2272
- "arrow",
2273
- "circle",
2274
- "rect",
2275
- "line"
2276
- ].includes(T.value) ? (b(), m("div", Ue, [h("div", We, [h("label", Ge, [g(S(J.value.translations.thickness) + " ", 1), me(h("input", {
2277
- type: "number",
2278
- "onUpdate:modelValue": t[48] ||= (e) => xt.value = e,
2279
- onInput: Hn,
2280
- min: 1,
2281
- style: {
2282
- padding: "0 4px",
2283
- width: "40px",
2284
- border: "1px solid #dadada",
2285
- "border-radius": "3px"
2286
- }
2287
- }, null, 544), [[fe, xt.value]])])])])) : p("", !0),
2288
- [
2289
- "arrow",
2290
- "circle",
2291
- "rect"
2292
- ].includes(T.value) ? (b(), m("div", Ke, [h("div", qe, [h("label", Je, [
2293
- g(S(J.value.translations.dashedLines) + " ", 1),
2294
- (b(), m("svg", Ye, [...t[102] ||= [h("line", {
2295
- x1: "0",
2296
- x2: "24",
2297
- y1: "12",
2298
- y2: "12",
2299
- "stroke-width": "2",
2300
- stroke: "black",
2301
- "stroke-dasharray": "3"
2302
- }, null, -1)]])),
2303
- me(h("input", {
2304
- name: "dashStyle",
2305
- type: "checkbox",
2306
- "onUpdate:modelValue": t[49] ||= (e) => Ct.value = e,
2307
- onChange: Bn,
2308
- checked: Ct.value,
2309
- style: y({
2310
- all: "revert",
2311
- appearance: "auto",
2312
- "-webkit-appearance": "auto",
2313
- accentColor: J.value.style.color + " !important"
2314
- })
2315
- }, null, 44, Xe), [[de, Ct.value]])
2316
- ])])])) : p("", !0),
2317
- h("button", {
2318
- class: v({
2319
- "button-tool": !0,
2320
- "button-tool--selected": F.value,
2321
- tooltip: !0
2322
- }),
2323
- style: y({
2324
- background: F.value ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2325
- border: F.value ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2326
- color: F.value ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2327
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2328
- cursor: Y.value ? "pointer" : "default"
2329
- }),
2330
- onClick: t[50] ||= (e) => {
2331
- _n(), F.value = !F.value, A.value = !1, M.value = !1, N.value = !1, P.value = !1, j.value = !1, T.value = void 0;
2332
- },
2333
- onMouseenter: t[51] ||= (e) => J.value.style.showTooltips && Q("setText", e, "top"),
2334
- onMouseleave: $,
2335
- onFocus: t[52] ||= (e) => J.value.style.showTooltips && Q("setText", e, "top"),
2336
- onBlur: $
2337
- }, [_(u, {
2338
- name: "text",
2339
- stroke: F.value ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color
2340
- }, null, 8, ["stroke"]), J.value.style.showTooltips ? (b(), f(w, {
2341
- key: 0,
2342
- show: W.value && G.value === "setText",
2343
- x: K.value.x,
2344
- y: K.value.y - 6,
2345
- placement: "top",
2346
- styleObject: X.value
2347
- }, {
2348
- default: C(() => [g(S(J.value.translations.tooltipShapeText) + " ", 1), t[103] ||= h("kbd", null, "T", -1)]),
2349
- _: 1
2350
- }, 8, [
2351
- "show",
2352
- "x",
2353
- "y",
2354
- "styleObject"
2355
- ])) : p("", !0)], 38),
2356
- F.value ? (b(), m("div", Ze, [h("div", Qe, [h("label", $e, [g(S(J.value.translations.fontSize) + " ", 1), me(h("input", {
2357
- type: "number",
2358
- "onUpdate:modelValue": t[53] ||= (e) => Bt.value = e,
2359
- onInput: Un,
2360
- style: {
2361
- padding: "0 4px",
2362
- width: "40px",
2363
- border: "1px solid #dadada",
2364
- "border-radius": "3px"
2365
- }
2366
- }, null, 544), [[fe, Bt.value]])])])])) : p("", !0),
2367
- F.value ? (b(), m("div", et, [h("button", {
2368
- class: v({
2369
- "button-tool": !0,
2370
- "button-tool--selected": U.value === "start",
2371
- tooltip: !0
2372
- }),
2373
- style: y({
2374
- background: U.value === "start" ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2375
- border: U.value === "start" ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2376
- color: U.value === "start" ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2377
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2378
- cursor: Y.value ? "pointer" : "default"
2379
- }),
2380
- onClick: t[54] ||= (e) => {
2381
- A.value = !1, M.value = !1, N.value = !1, j.value = !1, P.value = !1, T.value = void 0, U.value = "start", yn("start");
2382
- },
2383
- onMouseenter: t[55] ||= (e) => J.value.style.showTooltips && Q("setAlignStart", e, "top"),
2384
- onMouseleave: $,
2385
- onFocus: t[56] ||= (e) => J.value.style.showTooltips && Q("setAlignStart", e, "top"),
2386
- onBlur: $
2387
- }, [t[104] ||= h("svg", {
2388
- width: "80%",
2389
- viewBox: "0 0 24 24",
2390
- "stroke-width": "2",
2391
- stroke: "currentColor",
2392
- fill: "none",
2393
- "stroke-linecap": "round",
2394
- "stroke-linejoin": "round"
2395
- }, [
2396
- h("path", {
2397
- stroke: "none",
2398
- d: "M0 0h24v24H0z",
2399
- fill: "none"
2400
- }),
2401
- h("path", { d: "M4 6l16 0" }),
2402
- h("path", { d: "M4 12l10 0" }),
2403
- h("path", { d: "M4 18l14 0" })
2404
- ], -1), J.value.style.showTooltips ? (b(), f(w, {
2405
- key: 0,
2406
- show: W.value && G.value === "setAlignStart",
2407
- x: K.value.x,
2408
- y: K.value.y - 6,
2409
- placement: "top",
2410
- styleObject: X.value
2411
- }, {
2412
- default: C(() => [g(S(J.value.translations.tooltipShapeTextLeft), 1)]),
2413
- _: 1
2414
- }, 8, [
2415
- "show",
2416
- "x",
2417
- "y",
2418
- "styleObject"
2419
- ])) : p("", !0)], 38)])) : p("", !0),
2420
- F.value ? (b(), m("div", tt, [h("button", {
2421
- class: v({
2422
- "button-tool": !0,
2423
- "button-tool--selected": U.value === "middle",
2424
- tooltip: !0
2425
- }),
2426
- style: y({
2427
- background: U.value === "middle" ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2428
- border: U.value === "middle" ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2429
- color: U.value === "middle" ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2430
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2431
- cursor: Y.value ? "pointer" : "default"
2432
- }),
2433
- disabled: k.value,
2434
- onClick: t[57] ||= (e) => {
2435
- A.value = !1, M.value = !1, N.value = !1, j.value = !1, P.value = !1, T.value = void 0, U.value = "middle", yn("middle");
2436
- },
2437
- onMouseenter: t[58] ||= (e) => J.value.style.showTooltips && Q("setAlignMiddle", e, "top"),
2438
- onMouseleave: $,
2439
- onFocus: t[59] ||= (e) => J.value.style.showTooltips && Q("setAlignMiddle", e, "top"),
2440
- onBlur: $
2441
- }, [t[105] ||= h("svg", {
2442
- width: "80%",
2443
- viewBox: "0 0 24 24",
2444
- "stroke-width": "2",
2445
- stroke: "currentColor",
2446
- fill: "none",
2447
- "stroke-linecap": "round",
2448
- "stroke-linejoin": "round"
2449
- }, [
2450
- h("path", {
2451
- stroke: "none",
2452
- d: "M0 0h24v24H0z",
2453
- fill: "none"
2454
- }),
2455
- h("path", { d: "M4 6l16 0" }),
2456
- h("path", { d: "M8 12l8 0" }),
2457
- h("path", { d: "M6 18l12 0" })
2458
- ], -1), J.value.style.showTooltips ? (b(), f(w, {
2459
- key: 0,
2460
- show: W.value && G.value === "setAlignMiddle",
2461
- x: K.value.x,
2462
- y: K.value.y - 6,
2463
- placement: "top",
2464
- styleObject: X.value
2465
- }, {
2466
- default: C(() => [g(S(J.value.translations.tooltipShapeTextCenter), 1)]),
2467
- _: 1
2468
- }, 8, [
2469
- "show",
2470
- "x",
2471
- "y",
2472
- "styleObject"
2473
- ])) : p("", !0)], 46, nt)])) : p("", !0),
2474
- F.value ? (b(), m("div", rt, [h("button", {
2475
- class: v({
2476
- "button-tool": !0,
2477
- "button-tool--selected": U.value === "end",
2478
- tooltip: !0
2479
- }),
2480
- style: y({
2481
- background: U.value === "end" ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2482
- border: U.value === "end" ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2483
- color: U.value === "end" ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2484
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2485
- cursor: Y.value ? "pointer" : "default"
2486
- }),
2487
- disabled: k.value,
2488
- onClick: t[60] ||= (e) => {
2489
- A.value = !1, M.value = !1, N.value = !1, j.value = !1, P.value = !1, T.value = void 0, U.value = "end", yn("end");
2490
- },
2491
- onMouseenter: t[61] ||= (e) => J.value.style.showTooltips && Q("setAlignEnd", e, "top"),
2492
- onMouseleave: $,
2493
- onFocus: t[62] ||= (e) => J.value.style.showTooltips && Q("setAlignEnd", e, "top"),
2494
- onBlur: $
2495
- }, [t[106] ||= h("svg", {
2496
- width: "80%",
2497
- viewBox: "0 0 24 24",
2498
- "stroke-width": "2",
2499
- stroke: "currentColor",
2500
- fill: "none",
2501
- "stroke-linecap": "round",
2502
- "stroke-linejoin": "round"
2503
- }, [
2504
- h("path", {
2505
- stroke: "none",
2506
- d: "M0 0h24v24H0z",
2507
- fill: "none"
2508
- }),
2509
- h("path", { d: "M4 6l16 0" }),
2510
- h("path", { d: "M10 12l10 0" }),
2511
- h("path", { d: "M6 18l14 0" })
2512
- ], -1), J.value.style.showTooltips ? (b(), f(w, {
2513
- key: 0,
2514
- show: W.value && G.value === "setAlignEnd",
2515
- x: K.value.x,
2516
- y: K.value.y - 6,
2517
- placement: "top",
2518
- styleObject: X.value
2519
- }, {
2520
- default: C(() => [g(S(J.value.translations.tooltipShapeTextRight), 1)]),
2521
- _: 1
2522
- }, 8, [
2523
- "show",
2524
- "x",
2525
- "y",
2526
- "styleObject"
2527
- ])) : p("", !0)], 46, it)])) : p("", !0),
2528
- F.value ? (b(), m("div", at, [h("button", {
2529
- class: v({
2530
- "button-tool": !0,
2531
- "button-tool--selected": k.value,
2532
- tooltip: !0
2533
- }),
2534
- style: y({
2535
- background: k.value ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2536
- border: k.value ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2537
- color: k.value ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2538
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2539
- cursor: Y.value ? "pointer" : "default"
2540
- }),
2541
- onClick: t[63] ||= (e) => {
2542
- A.value = !1, M.value = !1, N.value = !1, j.value = !1, P.value = !1, T.value = void 0, k.value = !k.value, U.value = "start", yn("start"), Un();
2543
- },
2544
- onMouseenter: t[64] ||= (e) => J.value.style.showTooltips && Q("setBulletMode", e, "top"),
2545
- onMouseleave: $,
2546
- onFocus: t[65] ||= (e) => J.value.style.showTooltips && Q("setBulletMode", e, "top"),
2547
- onBlur: $
2548
- }, [t[107] ||= h("svg", {
2549
- width: "100%",
2550
- viewBox: "0 0 24 24",
2551
- "stroke-width": "2",
2552
- stroke: "currentColor",
2553
- fill: "none",
2554
- "stroke-linecap": "round",
2555
- "stroke-linejoin": "round"
2556
- }, [
2557
- h("path", {
2558
- stroke: "none",
2559
- d: "M0 0h24v24H0z",
2560
- fill: "none"
2561
- }),
2562
- h("path", { d: "M9 6l11 0" }),
2563
- h("path", { d: "M9 12l11 0" }),
2564
- h("path", { d: "M9 18l11 0" }),
2565
- h("path", { d: "M5 6l0 .01" }),
2566
- h("path", { d: "M5 12l0 .01" }),
2567
- h("path", { d: "M5 18l0 .01" })
2568
- ], -1), J.value.style.showTooltips ? (b(), f(w, {
2569
- key: 0,
2570
- show: W.value && G.value === "setBulletMode",
2571
- x: K.value.x,
2572
- y: K.value.y - 6,
2573
- placement: "top",
2574
- styleObject: X.value
2575
- }, {
2576
- default: C(() => [g(S(J.value.translations.tooltipShapeTextBullet), 1)]),
2577
- _: 1
2578
- }, 8, [
2579
- "show",
2580
- "x",
2581
- "y",
2582
- "styleObject"
2583
- ])) : p("", !0)], 38)])) : p("", !0),
2584
- F.value ? (b(), m("div", ot, [h("button", {
2585
- class: v({
2586
- "button-tool": !0,
2587
- "button-tool--selected": St.value,
2588
- tooltip: !0
2589
- }),
2590
- style: y({
2591
- background: St.value ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2592
- border: St.value ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2593
- color: St.value ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2594
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2595
- cursor: Y.value ? "pointer" : "default"
2596
- }),
2597
- onClick: t[66] ||= (e) => {
2598
- A.value = !1, M.value = !1, N.value = !1, j.value = !1, P.value = !1, T.value = void 0, St.value = !St.value, Un();
2599
- },
2600
- onMouseenter: t[67] ||= (e) => J.value.style.showTooltips && Q("setBold", e, "top"),
2601
- onMouseleave: $,
2602
- onFocus: t[68] ||= (e) => J.value.style.showTooltips && Q("setBold", e, "top"),
2603
- onBlur: $
2604
- }, [t[108] ||= h("svg", {
2605
- width: "100%",
2606
- viewBox: "0 0 24 24",
2607
- "stroke-width": "3",
2608
- stroke: "currentColor",
2609
- fill: "none",
2610
- "stroke-linecap": "round",
2611
- "stroke-linejoin": "round"
2612
- }, [
2613
- h("path", {
2614
- stroke: "none",
2615
- d: "M0 0h24v24H0z",
2616
- fill: "none"
2617
- }),
2618
- h("path", { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" }),
2619
- h("path", { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" })
2620
- ], -1), J.value.style.showTooltips ? (b(), f(w, {
2621
- key: 0,
2622
- show: W.value && G.value === "setBold",
2623
- x: K.value.x,
2624
- y: K.value.y - 6,
2625
- placement: "top",
2626
- styleObject: X.value
2627
- }, {
2628
- default: C(() => [g(S(J.value.translations.tooltipShapeTextBold), 1)]),
2629
- _: 1
2630
- }, 8, [
2631
- "show",
2632
- "x",
2633
- "y",
2634
- "styleObject"
2635
- ])) : p("", !0)], 38)])) : p("", !0),
2636
- F.value ? (b(), m("div", st, [h("button", {
2637
- class: v({
2638
- "button-tool": !0,
2639
- "button-tool--selected": Et.value,
2640
- tooltip: !0
2641
- }),
2642
- style: y({
2643
- background: Et.value ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2644
- border: Et.value ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2645
- color: Et.value ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2646
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2647
- cursor: Y.value ? "pointer" : "default"
2648
- }),
2649
- onClick: t[69] ||= (e) => {
2650
- A.value = !1, M.value = !1, N.value = !1, j.value = !1, P.value = !1, T.value = void 0, Et.value = !Et.value, Un();
2651
- },
2652
- onMouseenter: t[70] ||= (e) => J.value.style.showTooltips && Q("setItalic", e, "top"),
2653
- onMouseleave: $,
2654
- onFocus: t[71] ||= (e) => J.value.style.showTooltips && Q("setItalic", e, "top"),
2655
- onBlur: $
2656
- }, [t[109] ||= h("svg", {
2657
- width: "100%",
2658
- height: "44",
2659
- viewBox: "0 0 24 24",
2660
- "stroke-width": "2",
2661
- stroke: "currentColor",
2662
- fill: "none",
2663
- "stroke-linecap": "round",
2664
- "stroke-linejoin": "round"
2665
- }, [
2666
- h("path", {
2667
- stroke: "none",
2668
- d: "M0 0h24v24H0z",
2669
- fill: "none"
2670
- }),
2671
- h("path", { d: "M11 5l6 0" }),
2672
- h("path", { d: "M7 19l6 0" }),
2673
- h("path", { d: "M14 5l-4 14" })
2674
- ], -1), J.value.style.showTooltips ? (b(), f(w, {
2675
- key: 0,
2676
- show: W.value && G.value === "setItalic",
2677
- x: K.value.x,
2678
- y: K.value.y - 6,
2679
- placement: "top",
2680
- styleObject: X.value
2681
- }, {
2682
- default: C(() => [g(S(J.value.translations.tooltipShapeTextItalic), 1)]),
2683
- _: 1
2684
- }, 8, [
2685
- "show",
2686
- "x",
2687
- "y",
2688
- "styleObject"
2689
- ])) : p("", !0)], 38)])) : p("", !0),
2690
- F.value ? (b(), m("div", ct, [h("button", {
2691
- class: v({
2692
- "button-tool": !0,
2693
- "button-tool--selected": At.value,
2694
- tooltip: !0
2695
- }),
2696
- style: y({
2697
- background: At.value ? J.value.style.buttons.shapes.selected.backgroundColor : J.value.style.buttons.shapes.backgroundColor,
2698
- border: At.value ? J.value.style.buttons.shapes.selected.border : J.value.style.buttons.shapes.border,
2699
- color: At.value ? J.value.style.buttons.shapes.selected.color : J.value.style.buttons.shapes.color,
2700
- borderRadius: `${J.value.style.buttons.borderRadius}px`,
2701
- cursor: Y.value ? "pointer" : "default"
2702
- }),
2703
- onClick: t[72] ||= (e) => {
2704
- A.value = !1, M.value = !1, N.value = !1, j.value = !1, P.value = !1, T.value = void 0, At.value = !At.value, Un();
2705
- },
2706
- onMouseenter: t[73] ||= (e) => J.value.style.showTooltips && Q("setUnderline", e, "top"),
2707
- onMouseleave: $,
2708
- onFocus: t[74] ||= (e) => J.value.style.showTooltips && Q("setUnderline", e, "top"),
2709
- onBlur: $
2710
- }, [t[110] ||= h("svg", {
2711
- width: "100%",
2712
- viewBox: "0 0 24 24",
2713
- "stroke-width": "2",
2714
- stroke: "currentColor",
2715
- fill: "none",
2716
- "stroke-linecap": "round",
2717
- "stroke-linejoin": "round"
2718
- }, [
2719
- h("path", {
2720
- stroke: "none",
2721
- d: "M0 0h24v24H0z",
2722
- fill: "none"
2723
- }),
2724
- h("path", { d: "M7 5v5a5 5 0 0 0 10 0v-5" }),
2725
- h("path", { d: "M5 19h14" })
2726
- ], -1), J.value.style.showTooltips ? (b(), f(w, {
2727
- key: 0,
2728
- show: W.value && G.value === "setUnderline",
2729
- x: K.value.x,
2730
- y: K.value.y - 6,
2731
- placement: "top",
2732
- styleObject: X.value
2733
- }, {
2734
- default: C(() => [g(S(J.value.translations.tooltipShapeTextUnderline), 1)]),
2735
- _: 1
2736
- }, 8, [
2737
- "show",
2738
- "x",
2739
- "y",
2740
- "styleObject"
2741
- ])) : p("", !0)], 38)])) : p("", !0),
2742
- h("div", lt, [h("button", {
2743
- class: v({
2744
- "button-tool": !0,
2745
- tooltip: !0
2746
- }),
2747
- style: { borderRadius: "6px" },
2748
- onMouseenter: t[76] ||= (e) => J.value.style.showTooltips && Q("setColor", e, "top"),
2749
- onMouseleave: $,
2750
- onFocus: t[77] ||= (e) => J.value.style.showTooltips && Q("setColor", e, "top"),
2751
- onBlur: $
2752
- }, [_(ne, {
2753
- value: Ft.value,
2754
- "onUpdate:value": t[75] ||= (e) => Ft.value = e,
2755
- backgroundColor: J.value.style.backgroundColor,
2756
- buttonBorderColor: J.value.style.color,
2757
- isCursorPointer: Y.value,
2758
- teleported: ""
2759
- }, null, 8, [
2760
- "value",
2761
- "backgroundColor",
2762
- "buttonBorderColor",
2763
- "isCursorPointer"
2764
- ])], 32), J.value.style.showTooltips ? (b(), f(w, {
2765
- key: 0,
2766
- show: W.value && G.value === "setColor",
2767
- x: K.value.x,
2768
- y: K.value.y - 6,
2769
- placement: "top",
2770
- styleObject: X.value
2771
- }, {
2772
- default: C(() => [g(S(J.value.translations.tooltipShapeColor), 1)]),
2773
- _: 1
2774
- }, 8, [
2775
- "show",
2776
- "x",
2777
- "y",
2778
- "styleObject"
2779
- ])) : p("", !0)]),
2780
- h("div", ut, [h("label", dt, [g(S(J.value.translations.colorAlpha) + ": " + S(Vt.value > 98 ? 100 : Vt.value) + " % ", 1), me(h("input", {
2781
- name: "colorTransparency",
2782
- type: "range",
2783
- "onUpdate:modelValue": t[78] ||= (e) => Vt.value = e,
2784
- onInput: Vn,
2785
- min: 0,
2786
- max: 100,
2787
- style: y({
2788
- width: "100%",
2789
- accentColor: J.value.style.color + " !important"
2790
- })
2791
- }, null, 36), [[fe, Vt.value]])])])
2792
- ])]),
2793
- _: 1
2794
- }, 8, ["config"])]), h("div", {
2795
- class: "annotator annotator__wrapper",
2796
- ref_key: "drawSvgContainer",
2797
- ref: Pn,
2798
- style: { position: "relative" },
2799
- id: ve.value,
2800
- "data-annotator-content": ""
2801
- }, [
2802
- h("div", {
2803
- class: "annotator__content-layer",
2804
- style: y(`${kt.value ? "pointer-events: none;" : ""}`)
2805
- }, [le(e.$slots, "default", {}, void 0, !0)], 4),
2806
- kt.value || J.value.alwaysVisible ? (b(), m("svg", {
2807
- id: "annotatorSvg",
2808
- key: Mt.value,
2809
- ref_key: "mainSvg",
2810
- ref: en,
2811
- class: v({
2812
- annotator__overlay: !0,
2813
- draw: !0,
2814
- "draw--free": T.value === "line"
2815
- }),
2816
- viewBox: `0 0 ${Pt.value} ${Nt.value}`,
2817
- width: Rt.value,
2818
- height: zt.value,
2819
- onPointerdown: t[83] ||= (e) => On(e),
2820
- onPointerup: t[84] ||= (e) => Ln(e),
2821
- onTouchend: t[85] ||= (e) => Ln(e),
2822
- onTouchstart: t[86] ||= (e) => {
2823
- Wn(e), vn(e);
2824
- },
2825
- onPointermove: t[87] ||= (e) => {
2826
- Wn(e), Mn(e);
2827
- },
2828
- onPointerout: t[88] ||= (e) => En(e),
2829
- onPointerover: t[89] ||= (e) => gn(e),
2830
- onClick: t[90] ||= (e) => vn(e),
2831
- style: y({
2832
- position: "absolute",
2833
- top: 0,
2834
- left: 0,
2835
- cursor: Qt.value,
2836
- fontFamily: "Helvetica",
2837
- zIndex: 1e8,
2838
- pointerEvents: kt.value ? "all" : "none"
2839
- })
2840
- }, [h("rect", {
2841
- class: "annotator__glass",
2842
- x: "0",
2843
- y: "0",
2844
- width: Pt.value,
2845
- height: Nt.value,
2846
- fill: "transparent",
2847
- "pointer-events": kt.value ? "all" : "none",
2848
- style: { cursor: "inherit" },
2849
- onPointerdown: t[79] ||= he((e) => On(e), ["stop", "prevent"]),
2850
- onPointermove: t[80] ||= he((e) => {
2851
- Wn(e), Mn(e);
2852
- }, ["stop", "prevent"]),
2853
- onPointerup: he(Ln, ["stop", "prevent"]),
2854
- onClick: t[81] ||= he(() => {}, ["stop", "prevent"])
2855
- }, null, 40, mt), (b(!0), m(re, null, ce(on.value, (e) => (b(), m("g", {
2856
- key: e.id,
2857
- innerHTML: e.html,
2858
- onClick: t[82] ||= (e) => {
2859
- Nn(e), M.value = !1;
2860
- }
2861
- }, null, 8, ht))), 128))], 46, pt)) : p("", !0),
2862
- Ot.value || ue(yt) ? (b(), m("svg", {
2863
- key: 1,
2864
- style: {
2865
- position: "absolute",
2866
- top: "0",
2867
- left: "0"
2868
- },
2869
- height: zt.value,
2870
- viewBox: `0 0 ${Pt.value} ${Nt.value}`,
2871
- width: Rt.value,
2872
- "data-dom-to-png-ignore": ""
2873
- }, [h("circle", {
2874
- class: "animated-circle-print",
2875
- cx: Pt.value / 2,
2876
- cy: Nt.value / 2,
2877
- r: "50",
2878
- stroke: "#6376DD",
2879
- "stroke-width": "10",
2880
- fill: "none"
2881
- }, null, 8, _t)], 8, gt)) : p("", !0)
2882
- ], 8, ft)]));
2883
- }
2884
- }, [["__scopeId", "data-v-16880eff"]]);
2885
- //#endregion
2886
- export { ve as n, yt as t };