luo-image-annotator 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,72 +1,72 @@
1
- var Jt = Object.defineProperty;
2
- var jt = (f, t, i) => t in f ? Jt(f, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : f[t] = i;
3
- var S = (f, t, i) => jt(f, typeof t != "symbol" ? t + "" : t, i);
4
- import { defineComponent as tt, ref as M, watchEffect as Yt, openBlock as y, createElementBlock as x, normalizeClass as J, computed as D, onMounted as Xt, watch as Y, createElementVNode as g, toDisplayString as P, Fragment as B, renderList as F, normalizeStyle as V, createCommentVNode as T, createVNode as L, withModifiers as qt, createTextVNode as K, withDirectives as lt, vModelText as rt, createBlock as yt, nextTick as Gt } from "vue";
5
- const ct = (f, t) => Math.sqrt(Math.pow(f.x - t.x, 2) + Math.pow(f.y - t.y, 2)), Kt = (f, t) => {
6
- let i = !1;
7
- for (let e = 0, o = t.length - 1; e < t.length; o = e++) {
8
- const c = t[e].x, r = t[e].y, a = t[o].x, d = t[o].y;
9
- r > f.y != d > f.y && f.x < (a - c) * (f.y - r) / (d - r) + c && (i = !i);
1
+ var ae = Object.defineProperty;
2
+ var le = (w, t, n) => t in w ? ae(w, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : w[t] = n;
3
+ var T = (w, t, n) => le(w, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as ct, ref as M, watchEffect as ce, openBlock as v, createElementBlock as m, normalizeClass as X, computed as V, onMounted as kt, nextTick as at, watch as K, createElementVNode as h, toDisplayString as z, Fragment as N, renderList as J, normalizeStyle as U, createCommentVNode as B, createVNode as R, withModifiers as It, createBlock as vt, withDirectives as ft, vModelText as mt, createTextVNode as lt } from "vue";
5
+ const pt = (w, t) => Math.sqrt(Math.pow(w.x - t.x, 2) + Math.pow(w.y - t.y, 2)), re = (w, t) => {
6
+ let n = !1;
7
+ for (let e = 0, l = t.length - 1; e < t.length; l = e++) {
8
+ const o = t[e].x, c = t[e].y, g = t[l].x, u = t[l].y;
9
+ c > w.y != u > w.y && w.x < (g - o) * (w.y - c) / (u - c) + o && (n = !n);
10
10
  }
11
- return i;
12
- }, pt = (f, t, i) => {
13
- const e = i * (Math.PI / 180), o = Math.cos(e), c = Math.sin(e), r = f.x - t.x, a = f.y - t.y;
11
+ return n;
12
+ }, At = (w, t, n) => {
13
+ const e = n * (Math.PI / 180), l = Math.cos(e), o = Math.sin(e), c = w.x - t.x, g = w.y - t.y;
14
14
  return {
15
- x: t.x + (r * o - a * c),
16
- y: t.y + (r * c + a * o)
15
+ x: t.x + (c * l - g * o),
16
+ y: t.y + (c * o + g * l)
17
17
  };
18
18
  };
19
- class Zt {
19
+ class he {
20
20
  constructor(t) {
21
- S(this, "canvas");
22
- S(this, "ctx");
23
- S(this, "img");
24
- S(this, "annotations", []);
21
+ T(this, "canvas");
22
+ T(this, "ctx");
23
+ T(this, "img");
24
+ T(this, "annotations", []);
25
25
  // 状态
26
- S(this, "currentTool", null);
27
- S(this, "interactionMode", "none");
28
- S(this, "activeAnnotation", null);
29
- S(this, "hoverAnnotation", null);
30
- S(this, "isDrawing", !1);
31
- S(this, "isDragging", !1);
32
- S(this, "isPanning", !1);
26
+ T(this, "currentTool", null);
27
+ T(this, "interactionMode", "none");
28
+ T(this, "activeAnnotation", null);
29
+ T(this, "hoverAnnotation", null);
30
+ T(this, "isDrawing", !1);
31
+ T(this, "isDragging", !1);
32
+ T(this, "isPanning", !1);
33
33
  // 平移模式
34
- S(this, "panStartPoint", null);
34
+ T(this, "panStartPoint", null);
35
35
  // 平移起点
36
- S(this, "dragStartPoint", null);
37
- S(this, "dragStartAnnotation", null);
36
+ T(this, "dragStartPoint", null);
37
+ T(this, "dragStartAnnotation", null);
38
38
  // 快照用于撤销/diff
39
- S(this, "lastMouseMovePoint", null);
39
+ T(this, "lastMouseMovePoint", null);
40
40
  // 用于绘制辅助线
41
- S(this, "isHoveringStartPoint", !1);
41
+ T(this, "isHoveringStartPoint", !1);
42
42
  // 多边形闭合吸附状态
43
43
  // 设置
44
- S(this, "currentLabelColor", "#FF4081");
44
+ T(this, "currentLabelColor", "#FF4081");
45
45
  // 当前选中标签颜色
46
- S(this, "visibleLabels", /* @__PURE__ */ new Set());
46
+ T(this, "visibleLabels", /* @__PURE__ */ new Set());
47
47
  // 可见标签集合 (如果为空则全部可见,或者由外部控制渲染列表)
48
48
  // 交互
49
- S(this, "selectedHandleIndex", -1);
49
+ T(this, "selectedHandleIndex", -1);
50
50
  // -1: 主体, >=0: 顶点索引, -2: 旋转手柄
51
- S(this, "hoverHandleIndex", -1);
51
+ T(this, "hoverHandleIndex", -1);
52
52
  // 视口
53
- S(this, "scale", 1);
54
- S(this, "offset", { x: 0, y: 0 });
55
- S(this, "listeners", {});
56
- S(this, "imageUrl", "");
53
+ T(this, "scale", 1);
54
+ T(this, "offset", { x: 0, y: 0 });
55
+ T(this, "listeners", {});
56
+ T(this, "imageUrl", "");
57
57
  this.canvas = t;
58
- const i = t.getContext("2d");
59
- if (!i) throw new Error("Could not get 2d context");
60
- this.ctx = i, this.img = new Image(), this.img.crossOrigin = "Anonymous", this.img.onload = () => {
58
+ const n = t.getContext("2d");
59
+ if (!n) throw new Error("Could not get 2d context");
60
+ this.ctx = n, this.img = new Image(), this.img.crossOrigin = "Anonymous", this.img.onload = () => {
61
61
  this.fitImageToCanvas(), this.render();
62
62
  }, this.bindEvents();
63
63
  }
64
64
  // --- 公共 API ---
65
- on(t, i) {
66
- this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push(i);
65
+ on(t, n) {
66
+ this.listeners[t] || (this.listeners[t] = []), this.listeners[t].push(n);
67
67
  }
68
- emit(t, i) {
69
- this.listeners[t] && this.listeners[t].forEach((e) => e(i));
68
+ emit(t, n) {
69
+ this.listeners[t] && this.listeners[t].forEach((e) => e(n));
70
70
  }
71
71
  loadImage(t) {
72
72
  this.imageUrl = t, this.img.src = t, this.activeAnnotation = null, this.isDrawing = !1;
@@ -89,47 +89,49 @@ class Zt {
89
89
  zoom(t) {
90
90
  const e = t > 0 ? this.scale * 1.1 : this.scale / 1.1;
91
91
  if (e < 0.1 || e > 10) return;
92
- const o = this.canvas.width / 2, c = this.canvas.height / 2, r = this.toImageCoords(o, c);
93
- this.scale = e, this.offset.x = o - r.x * this.scale, this.offset.y = c - r.y * this.scale, this.clampViewportOffset(), this.render();
92
+ const l = this.canvas.width / 2, o = this.canvas.height / 2, c = this.toImageCoords(l, o);
93
+ this.scale = e, this.offset.x = l - c.x * this.scale, this.offset.y = o - c.y * this.scale, this.clampViewportOffset(), this.render();
94
94
  }
95
95
  resize() {
96
96
  this.fitImageToCanvas(), this.render();
97
97
  }
98
98
  // --- 坐标系统 ---
99
- toImageCoords(t, i) {
99
+ toImageCoords(t, n) {
100
100
  return {
101
101
  x: (t - this.offset.x) / this.scale,
102
- y: (i - this.offset.y) / this.scale
102
+ y: (n - this.offset.y) / this.scale
103
103
  };
104
104
  }
105
- toScreenCoords(t, i) {
105
+ toScreenCoords(t, n) {
106
106
  return {
107
107
  x: t * this.scale + this.offset.x,
108
- y: i * this.scale + this.offset.y
108
+ y: n * this.scale + this.offset.y
109
109
  };
110
110
  }
111
111
  fitImageToCanvas() {
112
112
  const t = this.canvas.parentElement;
113
113
  if (t) {
114
114
  if (this.canvas.width = t.clientWidth, this.canvas.height = t.clientHeight, this.img.width === 0) return;
115
- const i = this.canvas.width / this.img.width, e = this.canvas.height / this.img.height;
116
- this.scale = Math.min(i, e), this.offset.x = (this.canvas.width - this.img.width * this.scale) / 2, this.offset.y = (this.canvas.height - this.img.height * this.scale) / 2, this.clampViewportOffset();
115
+ const n = this.canvas.width / this.img.width, e = this.canvas.height / this.img.height;
116
+ this.scale = Math.min(n, e), this.offset.x = (this.canvas.width - this.img.width * this.scale) / 2, this.offset.y = (this.canvas.height - this.img.height * this.scale) / 2, this.clampViewportOffset();
117
117
  }
118
118
  }
119
119
  clampViewportOffset() {
120
120
  if (this.img.width === 0 || this.img.height === 0) return;
121
- const t = this.img.width * this.scale, i = this.img.height * this.scale;
122
- if (t <= this.canvas.width)
123
- this.offset.x = (this.canvas.width - t) / 2;
124
- else {
125
- const e = this.canvas.width - t, o = 0;
126
- this.offset.x = Math.min(o, Math.max(e, this.offset.x));
121
+ const t = this.img.width * this.scale, n = this.img.height * this.scale, e = 100;
122
+ if (t <= this.canvas.width) {
123
+ const l = -t + e, o = this.canvas.width - e;
124
+ this.offset.x = Math.min(o, Math.max(l, this.offset.x));
125
+ } else {
126
+ const l = this.canvas.width - t - e, o = e;
127
+ this.offset.x = Math.min(o, Math.max(l, this.offset.x));
127
128
  }
128
- if (i <= this.canvas.height)
129
- this.offset.y = (this.canvas.height - i) / 2;
130
- else {
131
- const e = this.canvas.height - i, o = 0;
132
- this.offset.y = Math.min(o, Math.max(e, this.offset.y));
129
+ if (n <= this.canvas.height) {
130
+ const l = -n + e, o = this.canvas.height - e;
131
+ this.offset.y = Math.min(o, Math.max(l, this.offset.y));
132
+ } else {
133
+ const l = this.canvas.height - n - e, o = e;
134
+ this.offset.y = Math.min(o, Math.max(l, this.offset.y));
133
135
  }
134
136
  }
135
137
  // --- 事件处理 ---
@@ -140,10 +142,10 @@ class Zt {
140
142
  this.interactionMode === "select" && (t.key === "Delete" || t.key === "Backspace") && this.activeAnnotation && this.deleteAnnotation(this.activeAnnotation.id);
141
143
  }
142
144
  deleteAnnotation(t) {
143
- const i = this.annotations.findIndex((e) => e.id === t);
144
- if (i > -1) {
145
- const e = this.annotations[i];
146
- this.annotations.splice(i, 1), this.activeAnnotation = null, this.emit("annotationChange", {
145
+ const n = this.annotations.findIndex((e) => e.id === t);
146
+ if (n > -1) {
147
+ const e = this.annotations[n];
148
+ this.annotations.splice(n, 1), this.activeAnnotation = null, this.emit("annotationChange", {
147
149
  action: "delete",
148
150
  changedItem: e,
149
151
  imageUrl: this.imageUrl
@@ -151,28 +153,28 @@ class Zt {
151
153
  }
152
154
  }
153
155
  handleMouseDown(t) {
154
- const i = this.canvas.getBoundingClientRect(), e = t.clientX - i.left, o = t.clientY - i.top, c = this.toImageCoords(e, o);
155
- if (this.canvas.style.cursor === "grab" || this.canvas.style.cursor === "grabbing") {
156
- this.isPanning = !0, this.panStartPoint = { x: e, y: o }, this.canvas.style.cursor = "grabbing";
156
+ const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left, l = t.clientY - n.top, o = this.toImageCoords(e, l);
157
+ if (this.interactionMode === "pan") {
158
+ this.isPanning = !0, this.panStartPoint = { x: e, y: l }, this.canvas.style.cursor = "grabbing";
157
159
  return;
158
160
  }
159
161
  if (this.interactionMode === "select" && this.activeAnnotation) {
160
- const d = this.getHitHandle(e, o, this.activeAnnotation);
161
- if (d !== -100) {
162
- this.isDragging = !0, this.dragStartPoint = c, this.selectedHandleIndex = d, this.dragStartAnnotation = JSON.parse(JSON.stringify(this.activeAnnotation));
162
+ const u = this.getHitHandle(e, l, this.activeAnnotation);
163
+ if (u !== -100) {
164
+ this.isDragging = !0, this.dragStartPoint = o, this.selectedHandleIndex = u, this.dragStartAnnotation = JSON.parse(JSON.stringify(this.activeAnnotation));
163
165
  return;
164
166
  }
165
167
  }
166
- const r = this.interactionMode === "select" ? this.getHitCategory(e, o) : null;
167
- if (r) {
168
- this.activeAnnotation = r, this.isDragging = !1, this.selectedHandleIndex = -1, this.emit("annotationChange", { action: "select", changedItem: r, imageUrl: this.imageUrl }), this.render();
168
+ const c = this.interactionMode === "select" ? this.getHitCategory(e, l) : null;
169
+ if (c) {
170
+ this.activeAnnotation = c, this.isDragging = !1, this.selectedHandleIndex = -1, this.emit("annotationChange", { action: "select", changedItem: c, imageUrl: this.imageUrl }), this.render();
169
171
  return;
170
172
  }
171
- const a = this.getHitAnnotation(c);
173
+ const g = this.getHitAnnotation(o);
172
174
  if (this.interactionMode === "select") {
173
- if (a) {
174
- if (!(this.visibleLabels.size > 0 && !this.visibleLabels.has(a.label))) {
175
- this.activeAnnotation = a, this.isDragging = !0, this.dragStartPoint = c, this.selectedHandleIndex = -1, this.dragStartAnnotation = JSON.parse(JSON.stringify(a)), this.emit("annotationChange", { action: "select", changedItem: a, imageUrl: this.imageUrl }), this.render();
175
+ if (g) {
176
+ if (!(this.visibleLabels.size > 0 && !this.visibleLabels.has(g.label))) {
177
+ this.activeAnnotation = g, this.isDragging = !0, this.dragStartPoint = o, this.selectedHandleIndex = -1, this.dragStartAnnotation = JSON.parse(JSON.stringify(g)), this.emit("annotationChange", { action: "select", changedItem: g, imageUrl: this.imageUrl }), this.render();
176
178
  return;
177
179
  }
178
180
  } else
@@ -181,43 +183,43 @@ class Zt {
181
183
  }
182
184
  if (this.interactionMode === "draw") {
183
185
  if (this.isDrawing && this.currentTool === "polygon" && this.activeAnnotation) {
184
- const d = this.activeAnnotation.coordinates;
185
- if (d.points.length > 2 && ct(c, d.points[0]) < 20 / this.scale) {
186
+ const u = this.activeAnnotation.coordinates;
187
+ if (u.points.length > 2 && pt(o, u.points[0]) < 20 / this.scale) {
186
188
  this.finishDrawing();
187
189
  return;
188
190
  }
189
- this.startDrawing(c);
191
+ this.startDrawing(o);
190
192
  return;
191
193
  }
192
194
  if (this.currentTool) {
193
195
  if (this.currentTool === "polygon" && !this.isDrawing) {
194
- this.startDrawing(c);
196
+ this.startDrawing(o);
195
197
  return;
196
198
  }
197
- this.startDrawing(c);
199
+ this.startDrawing(o);
198
200
  }
199
201
  return;
200
202
  }
201
203
  this.activeAnnotation = null, this.render();
202
204
  }
203
205
  handleMouseMove(t) {
204
- const i = this.canvas.getBoundingClientRect(), e = t.clientX - i.left, o = t.clientY - i.top, c = this.toImageCoords(e, o);
206
+ const n = this.canvas.getBoundingClientRect(), e = t.clientX - n.left, l = t.clientY - n.top, o = this.toImageCoords(e, l);
205
207
  if (this.isPanning && this.panStartPoint) {
206
- const r = e - this.panStartPoint.x, a = o - this.panStartPoint.y;
207
- this.offset.x += r, this.offset.y += a, this.clampViewportOffset(), this.panStartPoint = { x: e, y: o }, this.render();
208
+ const c = e - this.panStartPoint.x, g = l - this.panStartPoint.y;
209
+ this.offset.x += c, this.offset.y += g, this.clampViewportOffset(), this.panStartPoint = { x: e, y: l }, this.render();
208
210
  return;
209
211
  }
210
- if (this.lastMouseMovePoint = c, this.isDrawing) {
212
+ if (this.lastMouseMovePoint = o, this.isDrawing) {
211
213
  if (this.currentTool === "polygon" && this.activeAnnotation) {
212
- const r = this.activeAnnotation.coordinates;
213
- if (r.points.length > 2) {
214
- const a = r.points[0], d = ct(c, a);
215
- this.isHoveringStartPoint = d < 20 / this.scale;
214
+ const c = this.activeAnnotation.coordinates;
215
+ if (c.points.length > 2) {
216
+ const g = c.points[0], u = pt(o, g);
217
+ this.isHoveringStartPoint = u < 20 / this.scale;
216
218
  } else
217
219
  this.isHoveringStartPoint = !1;
218
220
  }
219
- this.updateDrawing(c);
220
- } else this.isDragging && this.activeAnnotation && this.dragStartPoint ? this.updateDragging(c) : this.checkHover(e, o, c);
221
+ this.updateDrawing(o);
222
+ } else this.isDragging && this.activeAnnotation && this.dragStartPoint ? this.updateDragging(o) : this.checkHover(e, l, o);
221
223
  this.render();
222
224
  }
223
225
  handleMouseUp(t) {
@@ -240,17 +242,17 @@ class Zt {
240
242
  }
241
243
  // --- 绘制逻辑 ---
242
244
  // 辅助函数:将 hex 转换为 rgba
243
- hexToRgba(t, i) {
245
+ hexToRgba(t, n) {
244
246
  if (!t.startsWith("#")) return t;
245
- const e = parseInt(t.slice(1, 3), 16), o = parseInt(t.slice(3, 5), 16), c = parseInt(t.slice(5, 7), 16);
246
- return `rgba(${e}, ${o}, ${c}, ${i})`;
247
+ const e = parseInt(t.slice(1, 3), 16), l = parseInt(t.slice(3, 5), 16), o = parseInt(t.slice(5, 7), 16);
248
+ return `rgba(${e}, ${l}, ${o}, ${n})`;
247
249
  }
248
250
  startDrawing(t) {
249
251
  if (!this.currentTool) return;
250
- const i = Date.now().toString();
252
+ const n = Date.now().toString();
251
253
  if (this.hexToRgba(this.currentLabelColor, 0.2), this.currentLabelColor, this.currentTool === "rectangle")
252
254
  this.isDrawing = !0, this.dragStartPoint = t, this.activeAnnotation = {
253
- id: i,
255
+ id: n,
254
256
  type: "rectangle",
255
257
  label: "",
256
258
  // 组件应填充此项
@@ -259,7 +261,7 @@ class Zt {
259
261
  };
260
262
  else if (this.currentTool === "point") {
261
263
  const e = {
262
- id: i,
264
+ id: n,
263
265
  type: "point",
264
266
  label: "",
265
267
  coordinates: { points: [t] },
@@ -268,7 +270,7 @@ class Zt {
268
270
  this.annotations.push(e), this.emit("annotationChange", { action: "add", changedItem: e, imageUrl: this.imageUrl }), this.activeAnnotation = e;
269
271
  } else if (this.currentTool === "polygon")
270
272
  this.activeAnnotation && this.activeAnnotation.type === "polygon" && this.isDrawing ? this.activeAnnotation.coordinates.points.push(t) : (this.isDrawing = !0, this.activeAnnotation = {
271
- id: i,
273
+ id: n,
272
274
  type: "polygon",
273
275
  label: "",
274
276
  coordinates: { points: [t] },
@@ -276,17 +278,16 @@ class Zt {
276
278
  });
277
279
  else if (this.currentTool === "category") {
278
280
  const e = {
279
- id: i,
281
+ id: n,
280
282
  type: "category",
281
283
  label: "",
282
284
  // 将被填充
283
- coordinates: null,
284
- // 或位置?
285
+ coordinates: { x: t.x, y: t.y },
285
286
  style: { strokeColor: this.currentLabelColor }
286
287
  };
287
288
  this.annotations.push(e), this.emit("annotationChange", { action: "add", changedItem: e, imageUrl: this.imageUrl }), this.activeAnnotation = e;
288
289
  } else this.currentTool === "rotatedRect" && (this.isDrawing = !0, this.dragStartPoint = t, this.activeAnnotation = {
289
- id: i,
290
+ id: n,
290
291
  type: "rotatedRect",
291
292
  label: "",
292
293
  coordinates: { x: t.x, y: t.y, width: 0, height: 0, angle: 0 },
@@ -296,11 +297,11 @@ class Zt {
296
297
  updateDrawing(t) {
297
298
  if (this.activeAnnotation)
298
299
  if (this.activeAnnotation.type === "rectangle" && this.dragStartPoint) {
299
- const i = this.activeAnnotation.coordinates;
300
- i.x2 = t.x, i.y2 = t.y;
300
+ const n = this.activeAnnotation.coordinates;
301
+ n.x2 = t.x, n.y2 = t.y;
301
302
  } else if (this.activeAnnotation.type === "rotatedRect" && this.dragStartPoint) {
302
- const i = this.activeAnnotation.coordinates, e = Math.abs(t.x - this.dragStartPoint.x), o = Math.abs(t.y - this.dragStartPoint.y);
303
- i.width = e * 2, i.height = o * 2;
303
+ const n = this.activeAnnotation.coordinates, e = Math.abs(t.x - this.dragStartPoint.x), l = Math.abs(t.y - this.dragStartPoint.y);
304
+ n.width = e * 2, n.height = l * 2;
304
305
  } else this.activeAnnotation.type;
305
306
  }
306
307
  finishDrawing() {
@@ -311,8 +312,8 @@ class Zt {
311
312
  this.activeAnnotation = null, this.isDrawing = !1;
312
313
  return;
313
314
  }
314
- const i = Math.min(t.x1, t.x2), e = Math.max(t.x1, t.x2), o = Math.min(t.y1, t.y2), c = Math.max(t.y1, t.y2);
315
- t.x1 = i, t.x2 = e, t.y1 = o, t.y2 = c, this.annotations.push(this.activeAnnotation), this.emit("annotationChange", { action: "add", changedItem: this.activeAnnotation, imageUrl: this.imageUrl });
315
+ const n = Math.min(t.x1, t.x2), e = Math.max(t.x1, t.x2), l = Math.min(t.y1, t.y2), o = Math.max(t.y1, t.y2);
316
+ t.x1 = n, t.x2 = e, t.y1 = l, t.y2 = o, this.annotations.push(this.activeAnnotation), this.emit("annotationChange", { action: "add", changedItem: this.activeAnnotation, imageUrl: this.imageUrl });
316
317
  } else if (this.activeAnnotation.type === "polygon") {
317
318
  if (this.activeAnnotation.coordinates.points.length < 3) {
318
319
  this.activeAnnotation = null, this.isDrawing = !1;
@@ -333,89 +334,92 @@ class Zt {
333
334
  }
334
335
  updateDragging(t) {
335
336
  if (!this.activeAnnotation || !this.dragStartPoint || !this.dragStartAnnotation) return;
336
- const i = t.x - this.dragStartPoint.x, e = t.y - this.dragStartPoint.y;
337
- this.selectedHandleIndex === -1 ? this.moveAnnotation(this.activeAnnotation, this.dragStartAnnotation, i, e) : this.resizeAnnotation(this.activeAnnotation, this.dragStartAnnotation, this.selectedHandleIndex, t);
337
+ const n = t.x - this.dragStartPoint.x, e = t.y - this.dragStartPoint.y;
338
+ this.selectedHandleIndex === -1 ? this.moveAnnotation(this.activeAnnotation, this.dragStartAnnotation, n, e) : this.resizeAnnotation(this.activeAnnotation, this.dragStartAnnotation, this.selectedHandleIndex, t);
338
339
  }
339
- moveAnnotation(t, i, e, o) {
340
+ moveAnnotation(t, n, e, l) {
340
341
  if (t.type === "rectangle") {
341
- const c = i.coordinates, r = t.coordinates;
342
- r.x1 = c.x1 + e, r.x2 = c.x2 + e, r.y1 = c.y1 + o, r.y2 = c.y2 + o;
342
+ const o = n.coordinates, c = t.coordinates;
343
+ c.x1 = o.x1 + e, c.x2 = o.x2 + e, c.y1 = o.y1 + l, c.y2 = o.y2 + l;
343
344
  } else if (t.type === "point") {
344
- const c = i.coordinates, r = t.coordinates;
345
- r.points = c.points.map((a) => ({ x: a.x + e, y: a.y + o }));
345
+ const o = n.coordinates, c = t.coordinates;
346
+ c.points = o.points.map((g) => ({ x: g.x + e, y: g.y + l }));
346
347
  } else if (t.type === "rotatedRect") {
347
- const c = i.coordinates, r = t.coordinates;
348
- r.x = c.x + e, r.y = c.y + o;
348
+ const o = n.coordinates, c = t.coordinates;
349
+ c.x = o.x + e, c.y = o.y + l;
349
350
  } else if (t.type === "polygon") {
350
- const c = i.coordinates, r = t.coordinates;
351
- r.points = c.points.map((a) => ({ x: a.x + e, y: a.y + o }));
351
+ const o = n.coordinates, c = t.coordinates;
352
+ c.points = o.points.map((g) => ({ x: g.x + e, y: g.y + l }));
353
+ } else if (t.type === "category") {
354
+ const o = n.coordinates, c = t.coordinates;
355
+ o && c && (c.x = o.x + e, c.y = o.y + l);
352
356
  }
353
357
  }
354
- resizeAnnotation(t, i, e, o) {
358
+ resizeAnnotation(t, n, e, l) {
355
359
  if (t.type === "rectangle") {
356
- const c = t.coordinates;
357
- e === 0 && (c.x1 = o.x, c.y1 = o.y), e === 1 && (c.x2 = o.x, c.y1 = o.y), e === 2 && (c.x2 = o.x, c.y2 = o.y), e === 3 && (c.x1 = o.x, c.y2 = o.y);
360
+ const o = t.coordinates;
361
+ e === 0 && (o.x1 = l.x, o.y1 = l.y), e === 1 && (o.x2 = l.x, o.y1 = l.y), e === 2 && (o.x2 = l.x, o.y2 = l.y), e === 3 && (o.x1 = l.x, o.y2 = l.y);
358
362
  } else if (t.type === "polygon") {
359
- const c = t.coordinates;
360
- e >= 0 && e < c.points.length && (c.points[e] = o);
363
+ const o = t.coordinates;
364
+ e >= 0 && e < o.points.length && (o.points[e] = l);
361
365
  } else if (t.type === "point") {
362
- const c = t.coordinates;
363
- e >= 0 && e < c.points.length && (c.points[e] = o);
366
+ const o = t.coordinates;
367
+ e >= 0 && e < o.points.length && (o.points[e] = l);
364
368
  } else if (t.type === "rotatedRect") {
365
- const c = t.coordinates;
369
+ const o = t.coordinates;
366
370
  if (e === -2) {
367
- const r = c.x, a = c.y, d = o.x - r, u = o.y - a;
368
- let w = Math.atan2(u, d) * 180 / Math.PI;
369
- w += 90, c.angle = w;
371
+ const c = o.x, g = o.y, u = l.x - c, r = l.y - g;
372
+ let k = Math.atan2(r, u) * 180 / Math.PI;
373
+ k += 90, o.angle = k;
370
374
  } else {
371
- const r = c.angle * Math.PI / 180, a = Math.cos(-r), d = Math.sin(-r), u = o.x - c.x, w = o.y - c.y, m = u * a - w * d, _ = u * d + w * a;
372
- (e === 0 || e === 3) && (c.width / 2, c.width = Math.abs(m) * 2), (e === 1 || e === 2) && (c.width = Math.abs(m) * 2), (e === 0 || e === 1) && (c.height = Math.abs(_) * 2), (e === 2 || e === 3) && (c.height = Math.abs(_) * 2);
375
+ const c = o.angle * Math.PI / 180, g = Math.cos(-c), u = Math.sin(-c), r = l.x - o.x, k = l.y - o.y, x = r * g - k * u, D = r * u + k * g;
376
+ (e === 0 || e === 3) && (o.width / 2, o.width = Math.abs(x) * 2), (e === 1 || e === 2) && (o.width = Math.abs(x) * 2), (e === 0 || e === 1) && (o.height = Math.abs(D) * 2), (e === 2 || e === 3) && (o.height = Math.abs(D) * 2);
373
377
  }
374
378
  }
375
379
  }
376
380
  // --- 命中测试和渲染辅助函数 ---
377
381
  getHitAnnotation(t) {
378
- for (let i = this.annotations.length - 1; i >= 0; i--) {
379
- const e = this.annotations[i];
382
+ for (let n = this.annotations.length - 1; n >= 0; n--) {
383
+ const e = this.annotations[n];
380
384
  if (this.isPointInAnnotation(t, e))
381
385
  return e;
382
386
  }
383
387
  return null;
384
388
  }
385
- isPointInAnnotation(t, i) {
386
- if (i.type === "rectangle") {
387
- const e = i.coordinates;
389
+ isPointInAnnotation(t, n) {
390
+ if (n.type === "rectangle") {
391
+ const e = n.coordinates;
388
392
  return t.x >= e.x1 && t.x <= e.x2 && t.y >= e.y1 && t.y <= e.y2;
389
- } else if (i.type === "polygon") {
390
- const e = i.coordinates;
391
- return Kt(t, e.points);
392
- } else if (i.type === "rotatedRect") {
393
- const e = i.coordinates, o = pt(t, { x: e.x, y: e.y }, -e.angle), c = e.width / 2, r = e.height / 2;
394
- return o.x >= e.x - c && o.x <= e.x + c && o.y >= e.y - r && o.y <= e.y + r;
395
- } else if (i.type === "point")
396
- return i.coordinates.points.some((o) => ct(t, o) < 10 / this.scale);
393
+ } else if (n.type === "polygon") {
394
+ const e = n.coordinates;
395
+ return re(t, e.points);
396
+ } else if (n.type === "rotatedRect") {
397
+ const e = n.coordinates, l = At(t, { x: e.x, y: e.y }, -e.angle), o = e.width / 2, c = e.height / 2;
398
+ return l.x >= e.x - o && l.x <= e.x + o && l.y >= e.y - c && l.y <= e.y + c;
399
+ } else if (n.type === "point")
400
+ return n.coordinates.points.some((l) => pt(t, l) < 10 / this.scale);
397
401
  return !1;
398
402
  }
399
- getHitHandle(t, i, e) {
400
- const o = this.getAnnotationHandles(e), c = 6;
401
- for (let r = 0; r < o.length; r++) {
402
- const a = o[r], d = this.toScreenCoords(a.x, a.y);
403
- if (Math.abs(t - d.x) < c && Math.abs(i - d.y) < c)
404
- return e.type === "rotatedRect" && r === 4 ? -2 : r;
403
+ getHitHandle(t, n, e) {
404
+ const l = this.getAnnotationHandles(e), o = 6;
405
+ for (let c = 0; c < l.length; c++) {
406
+ const g = l[c], u = this.toScreenCoords(g.x, g.y);
407
+ if (Math.abs(t - u.x) < o && Math.abs(n - u.y) < o)
408
+ return e.type === "rotatedRect" && c === 4 ? -2 : c;
405
409
  }
406
410
  return -100;
407
411
  }
408
412
  getAnnotationHandles(t) {
409
413
  if (t.type === "rectangle") {
410
- const i = t.coordinates;
414
+ const n = t.coordinates;
411
415
  return [
412
- { x: i.x1, y: i.y1 },
416
+ { x: n.x1, y: n.y1 },
413
417
  // 左上
414
- { x: i.x2, y: i.y1 },
418
+ { x: n.x2, y: n.y1 },
415
419
  // 右上
416
- { x: i.x2, y: i.y2 },
420
+ { x: n.x2, y: n.y2 },
417
421
  // 右下
418
- { x: i.x1, y: i.y2 }
422
+ { x: n.x1, y: n.y2 }
419
423
  // 左下
420
424
  ];
421
425
  } else {
@@ -424,24 +428,24 @@ class Zt {
424
428
  if (t.type === "point")
425
429
  return t.coordinates.points;
426
430
  if (t.type === "rotatedRect") {
427
- const i = t.coordinates, e = { x: i.x, y: i.y }, o = i.width / 2, c = i.height / 2, r = { x: i.x - o, y: i.y - c }, a = { x: i.x + o, y: i.y - c }, d = { x: i.x + o, y: i.y + c }, u = { x: i.x - o, y: i.y + c }, w = { x: i.x, y: i.y - c - 20 / this.scale };
428
- return [r, a, d, u, w].map((m) => pt(m, e, i.angle));
431
+ const n = t.coordinates, e = { x: n.x, y: n.y }, l = n.width / 2, o = n.height / 2, c = { x: n.x - l, y: n.y - o }, g = { x: n.x + l, y: n.y - o }, u = { x: n.x + l, y: n.y + o }, r = { x: n.x - l, y: n.y + o }, k = { x: n.x, y: n.y - o - 20 / this.scale };
432
+ return [c, g, u, r, k].map((x) => At(x, e, n.angle));
429
433
  }
430
434
  }
431
435
  return [];
432
436
  }
433
- checkHover(t, i, e) {
434
- const o = this.getHitCategory(t, i);
435
- if (o) {
436
- this.canvas.style.cursor = "pointer", this.hoverAnnotation = o;
437
+ checkHover(t, n, e) {
438
+ const l = this.getHitCategory(t, n);
439
+ if (l) {
440
+ this.canvas.style.cursor = "pointer", this.hoverAnnotation = l;
437
441
  return;
438
442
  }
439
- if (this.activeAnnotation && this.getHitHandle(t, i, this.activeAnnotation) !== -100) {
443
+ if (this.activeAnnotation && this.getHitHandle(t, n, this.activeAnnotation) !== -100) {
440
444
  this.canvas.style.cursor = "pointer";
441
445
  return;
442
446
  }
443
- const c = this.getHitAnnotation(e);
444
- c ? (this.canvas.style.cursor = "move", this.hoverAnnotation = c) : (this.canvas.style.cursor = "default", this.hoverAnnotation = null);
447
+ const o = this.getHitAnnotation(e);
448
+ o ? (this.canvas.style.cursor = "move", this.hoverAnnotation = o) : (this.canvas.style.cursor = "default", this.hoverAnnotation = null);
445
449
  }
446
450
  render() {
447
451
  this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), this.img.complete && this.img.width > 0 && this.ctx.drawImage(this.img, this.offset.x, this.offset.y, this.img.width * this.scale, this.img.height * this.scale), this.annotations.forEach((t) => {
@@ -449,172 +453,153 @@ class Zt {
449
453
  }), this.activeAnnotation && this.drawItem(this.activeAnnotation, !0), this.renderCategories();
450
454
  }
451
455
  renderCategories() {
452
- const t = this.annotations.filter((d) => d.type === "category");
456
+ const t = this.annotations.filter((e) => e.type === "category");
453
457
  if (t.length === 0) return;
454
- this.ctx.save(), this.ctx.font = "14px sans-serif", this.ctx.textBaseline = "top";
455
- let i = 10;
456
- const e = 10, o = 8, c = 4, r = 24, a = 8;
457
- t.forEach((d) => {
458
- const u = d.label || "Unlabeled", w = this.ctx.measureText(u).width + o * 2, m = this.activeAnnotation === d, _ = this.hoverAnnotation === d;
459
- this.ctx.fillStyle = m ? "#E3F2FD" : _ ? "#F5F5F5" : "rgba(255, 255, 255, 0.9)", this.ctx.strokeStyle = m ? "#2196F3" : "#666", this.ctx.lineWidth = m ? 2 : 1, this.ctx.beginPath(), this.ctx.rect(i, e, w, r), this.ctx.fill(), this.ctx.stroke(), this.ctx.fillStyle = m ? "#1976D2" : "#333", this.ctx.fillText(u, i + o, e + c), i += w + a;
458
+ this.ctx.save(), this.ctx.font = "14px sans-serif", this.ctx.textBaseline = "middle", this.ctx.textAlign = "center";
459
+ const n = 12;
460
+ t.forEach((e) => {
461
+ var _;
462
+ const l = e.label || "未命名分类", o = this.ctx.measureText(l).width + n * 2, c = 28, g = this.activeAnnotation === e, u = this.hoverAnnotation === e;
463
+ let r = { x: 20, y: 20 };
464
+ e.coordinates && typeof e.coordinates.x == "number" && typeof e.coordinates.y == "number" && (r = this.toScreenCoords(e.coordinates.x, e.coordinates.y));
465
+ const k = r.x - o / 2, x = r.y - c / 2, D = ((_ = e.style) == null ? void 0 : _.strokeColor) || "#2196F3";
466
+ this.ctx.fillStyle = g ? D : this.hexToRgba(D, 0.85), u && !g && (this.ctx.fillStyle = D), g ? (this.ctx.strokeStyle = "#ffffff", this.ctx.lineWidth = 2) : (this.ctx.strokeStyle = "transparent", this.ctx.lineWidth = 0), this.ctx.beginPath(), this.ctx.roundRect(k, x, o, c, 6), this.ctx.fill(), g && (this.ctx.stroke(), this.ctx.save(), this.ctx.strokeStyle = D, this.ctx.lineWidth = 2, this.ctx.strokeRect(k - 3, x - 3, o + 6, c + 6), this.ctx.restore()), this.ctx.fillStyle = "#ffffff", this.ctx.fillText(l, r.x, r.y);
460
467
  }), this.ctx.restore();
461
468
  }
462
- getHitCategory(t, i) {
463
- const e = this.annotations.filter((w) => w.type === "category");
469
+ getHitCategory(t, n) {
470
+ const e = this.annotations.filter((g) => g.type === "category");
464
471
  if (e.length === 0) return null;
465
472
  this.ctx.save(), this.ctx.font = "14px sans-serif";
466
- let o = 10;
467
- const c = 10, r = 8, a = 24, d = 8;
468
- let u = null;
469
- for (const w of e) {
470
- const m = w.label || "Unlabeled", _ = this.ctx.measureText(m).width + r * 2;
471
- if (t >= o && t <= o + _ && i >= c && i <= c + a) {
472
- u = w;
473
+ const l = 12, o = 28;
474
+ let c = null;
475
+ for (let g = e.length - 1; g >= 0; g--) {
476
+ const u = e[g], r = u.label || "未命名分类", k = this.ctx.measureText(r).width + l * 2;
477
+ let x = { x: 20, y: 20 };
478
+ u.coordinates && typeof u.coordinates.x == "number" && typeof u.coordinates.y == "number" && (x = this.toScreenCoords(u.coordinates.x, u.coordinates.y));
479
+ const D = x.x - k / 2, _ = x.y - o / 2;
480
+ if (t >= D && t <= D + k && n >= _ && n <= _ + o) {
481
+ c = u;
473
482
  break;
474
483
  }
475
- o += _ + d;
476
484
  }
477
- return this.ctx.restore(), u;
485
+ return this.ctx.restore(), c;
478
486
  }
479
- drawItem(t, i) {
480
- var c;
481
- if (this.visibleLabels.size > 0 && !this.visibleLabels.has(t.label) && !i)
487
+ drawItem(t, n) {
488
+ var o;
489
+ if (this.visibleLabels.size > 0 && !this.visibleLabels.has(t.label) && !n)
482
490
  return;
483
491
  this.ctx.save();
484
- const e = ((c = t.style) == null ? void 0 : c.strokeColor) || "#FF4081", o = i ? "#00E5FF" : e;
485
- if (this.ctx.strokeStyle = o, this.ctx.lineWidth = 2, i ? this.ctx.fillStyle = "rgba(0, 229, 255, 0.2)" : this.ctx.fillStyle = this.hexToRgba(e, 0.2), t.type === "rectangle") {
486
- const r = t.coordinates, a = this.toScreenCoords(r.x1, r.y1), d = this.toScreenCoords(r.x2, r.y2), u = Math.min(a.x, d.x), w = Math.min(a.y, d.y), m = Math.abs(a.x - d.x), _ = Math.abs(a.y - d.y);
487
- this.ctx.strokeRect(u, w, m, _), this.ctx.fillStyle = i ? "rgba(0, 229, 255, 0.2)" : "rgba(255, 64, 129, 0.2)", this.ctx.fillRect(u, w, m, _), i && this.drawHandles(this.getAnnotationHandles(t));
492
+ const e = ((o = t.style) == null ? void 0 : o.strokeColor) || "#FF4081", l = n ? "#00E5FF" : e;
493
+ if (this.ctx.strokeStyle = l, this.ctx.lineWidth = 2, t.type === "rectangle") {
494
+ const c = t.coordinates, g = this.toScreenCoords(c.x1, c.y1), u = this.toScreenCoords(c.x2, c.y2), r = Math.min(g.x, u.x), k = Math.min(g.y, u.y), x = Math.abs(g.x - u.x), D = Math.abs(g.y - u.y);
495
+ this.ctx.strokeRect(r, k, x, D), n && this.drawHandles(this.getAnnotationHandles(t));
488
496
  } else if (t.type === "polygon") {
489
- const r = t.coordinates;
490
- if (r.points.length === 0) {
497
+ const c = t.coordinates;
498
+ if (c.points.length === 0) {
491
499
  this.ctx.restore();
492
500
  return;
493
501
  }
494
502
  this.ctx.beginPath();
495
- const a = this.toScreenCoords(r.points[0].x, r.points[0].y);
496
- this.ctx.moveTo(a.x, a.y);
497
- for (let d = 1; d < r.points.length; d++) {
498
- const u = this.toScreenCoords(r.points[d].x, r.points[d].y);
499
- this.ctx.lineTo(u.x, u.y);
503
+ const g = this.toScreenCoords(c.points[0].x, c.points[0].y);
504
+ this.ctx.moveTo(g.x, g.y);
505
+ for (let u = 1; u < c.points.length; u++) {
506
+ const r = this.toScreenCoords(c.points[u].x, c.points[u].y);
507
+ this.ctx.lineTo(r.x, r.y);
500
508
  }
501
509
  if (!this.isDrawing || t !== this.activeAnnotation)
502
510
  this.ctx.closePath();
503
511
  else if (this.lastMouseMovePoint) {
504
- let d = this.lastMouseMovePoint;
505
- if (this.isHoveringStartPoint && r.points.length > 0) {
506
- d = r.points[0];
507
- const w = this.toScreenCoords(r.points[0].x, r.points[0].y);
508
- this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(w.x, w.y, 10, 0, Math.PI * 2), this.ctx.fillStyle = "rgba(255, 215, 0, 0.6)", this.ctx.strokeStyle = "#FFFFFF", this.ctx.lineWidth = 2, this.ctx.fill(), this.ctx.stroke(), this.ctx.restore();
512
+ let u = this.lastMouseMovePoint;
513
+ if (this.isHoveringStartPoint && c.points.length > 0) {
514
+ u = c.points[0];
515
+ const k = this.toScreenCoords(c.points[0].x, c.points[0].y);
516
+ this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(k.x, k.y, 10, 0, Math.PI * 2), this.ctx.fillStyle = "rgba(255, 215, 0, 0.6)", this.ctx.strokeStyle = "#FFFFFF", this.ctx.lineWidth = 2, this.ctx.fill(), this.ctx.stroke(), this.ctx.restore();
509
517
  }
510
- const u = this.toScreenCoords(d.x, d.y);
511
- this.ctx.lineTo(u.x, u.y);
518
+ const r = this.toScreenCoords(u.x, u.y);
519
+ this.ctx.lineTo(r.x, r.y);
512
520
  }
513
- this.ctx.stroke(), this.ctx.fillStyle = i ? "rgba(0, 229, 255, 0.2)" : "rgba(255, 64, 129, 0.2)", this.ctx.fill(), i && this.drawHandles(this.getAnnotationHandles(t));
521
+ this.ctx.stroke(), n && this.drawHandles(this.getAnnotationHandles(t));
514
522
  } else if (t.type === "rotatedRect") {
515
- const r = t.coordinates;
516
- this.ctx.translate(this.toScreenCoords(r.x, r.y).x, this.toScreenCoords(r.x, r.y).y), this.ctx.rotate(r.angle * Math.PI / 180);
517
- const a = r.width * this.scale, d = r.height * this.scale;
518
- this.ctx.strokeRect(-a / 2, -d / 2, a, d), this.ctx.fillStyle = i ? "rgba(0, 229, 255, 0.2)" : "rgba(255, 64, 129, 0.2)", this.ctx.fillRect(-a / 2, -d / 2, a, d), this.ctx.rotate(-r.angle * Math.PI / 180), this.ctx.translate(-this.toScreenCoords(r.x, r.y).x, -this.toScreenCoords(r.x, r.y).y), i && this.drawHandles(this.getAnnotationHandles(t));
519
- } else t.type === "point" && t.coordinates.points.forEach((a) => {
520
- const d = this.toScreenCoords(a.x, a.y);
521
- this.ctx.beginPath(), this.ctx.arc(d.x, d.y, 5, 0, Math.PI * 2), this.ctx.fillStyle = i ? "#00E5FF" : e, this.ctx.fill(), this.ctx.stroke();
523
+ const c = t.coordinates;
524
+ this.ctx.translate(this.toScreenCoords(c.x, c.y).x, this.toScreenCoords(c.x, c.y).y), this.ctx.rotate(c.angle * Math.PI / 180);
525
+ const g = c.width * this.scale, u = c.height * this.scale;
526
+ this.ctx.strokeRect(-g / 2, -u / 2, g, u), this.ctx.rotate(-c.angle * Math.PI / 180), this.ctx.translate(-this.toScreenCoords(c.x, c.y).x, -this.toScreenCoords(c.x, c.y).y), n && this.drawHandles(this.getAnnotationHandles(t));
527
+ } else t.type === "point" && t.coordinates.points.forEach((g) => {
528
+ const u = this.toScreenCoords(g.x, g.y);
529
+ this.ctx.beginPath(), this.ctx.arc(u.x, u.y, 5, 0, Math.PI * 2), this.ctx.fillStyle = n ? "#00E5FF" : e, this.ctx.fill(), this.ctx.stroke();
522
530
  });
523
531
  this.ctx.restore();
524
532
  }
525
533
  drawHandles(t) {
526
- this.ctx.fillStyle = "#FFFFFF", this.ctx.strokeStyle = "#000000", this.ctx.lineWidth = 1, t.forEach((i) => {
527
- const e = this.toScreenCoords(i.x, i.y);
534
+ this.ctx.fillStyle = "#FFFFFF", this.ctx.strokeStyle = "#000000", this.ctx.lineWidth = 1, t.forEach((n) => {
535
+ const e = this.toScreenCoords(n.x, n.y);
528
536
  this.ctx.fillRect(e.x - 4, e.y - 4, 8, 8), this.ctx.strokeRect(e.x - 4, e.y - 4, 8, 8);
529
537
  });
530
538
  }
531
539
  }
532
- const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
533
- <path d="M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z m0-320a64 64 0 1 0 0-128 64 64 0 0 0 0 128z m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256z" fill="currentColor"/>\r
534
- </svg>`, te = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
535
- <path d="M609.408 149.376l-277.76 277.76a96 96 0 0 0 0 135.68l277.76 277.76a32 32 0 1 0 45.248-45.248L376.96 512l277.76-277.76a32 32 0 0 0-45.248-45.248z" fill="currentColor"/>\r
536
- </svg>`, ee = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
537
- <path d="M704 192h160v160h-160z m-64-64v288h288V128H640zM160 672h160v160H160z m-64-64v288h288V608H96z m256-320h320v64H352z" fill="currentColor"/>\r
538
- </svg>`, ne = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
539
- <path d="M256 256h512v512H256z m-64-64v640h640V192H192z" fill="currentColor"/>\r
540
- </svg>`, se = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
541
- <path d="M160 256h704a32 32 0 1 1 0 64h-64v608a32 32 0 0 1-32 32H256a32 32 0 0 1-32-32V320h-64a32 32 0 1 1 0-64zm128 64v576h448V320H288z m128 0v512a32 32 0 1 1-64 0V320a32 32 0 1 1 64 0zm256 0v512a32 32 0 1 1-64 0V320a32 32 0 1 1 64 0zM352 128h320a32 32 0 0 1 32 32v64H320v-64a32 32 0 0 1 32-32z" fill="currentColor"/>\r
542
- </svg>`, ie = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
543
- <path d="M512 666.56l-186.88-186.88a32 32 0 0 0-45.248 45.248l209.536 209.536a96 96 0 0 0 135.68 0l209.536-209.536a32 32 0 1 0-45.248-45.248L544 666.56V128a32 32 0 0 0-64 0v538.56zM192 832h640a32 32 0 1 1 0 64H192a32 32 0 1 1 0-64z" fill="currentColor"/>\r
544
- </svg>`, oe = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
545
- <path d="M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z m-144-320l-480 480v160h160l480-480-160-160z m-114.56 480H256v-117.76L653.44 236.8l117.76 117.76L573.44 672z m208-208l-117.76-117.76 66.56-66.56a32 32 0 0 1 45.248 0l72.512 72.512a32 32 0 0 1 0 45.248l-66.56 66.56z" fill="currentColor"/>\r
546
- </svg>`, ae = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
547
- <path d="M940.48 876.16L148.16 83.84a32 32 0 1 0-45.12 45.12L236.8 262.4C163.52 337.28 107.52 429.12 82.56 528.96a32 32 0 0 0 0 20.48C144.384 727.68 314.88 840.96 512 840.96c103.04 0 199.36-30.72 283.52-83.84l99.84 99.84a32 32 0 1 0 45.12-45.12zM512 776.96c-176.64 0-333.44-98.56-402.56-248.96 25.6-56.32 63.36-107.52 110.08-151.04L364.8 522.24a128 128 0 0 0 147.2 147.2l123.52 123.52A445.44 445.44 0 0 1 512 776.96z m373.12-32.64l-64-64C857.6 627.84 879.616 572.16 879.616 512c0-176.64-156.8-328.96-367.616-328.96-58.24 0-113.6 11.52-164.48 32.64l-55.68-55.68C346.88 136.96 427.52 119.04 512 119.04c229.76 0 425.216 142.08 493.44 346.24a32 32 0 0 1 0 20.48 450.56 450.56 0 0 1-120.32 258.56z m-309.12-309.12l-128-128A128 128 0 0 1 576 435.2z" fill="currentColor"/>\r
548
- </svg>`, le = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
549
- <path d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 832a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm-48-384H320a32 32 0 0 1 0-64h144V304a32 32 0 1 1 64 0v144h144a32 32 0 1 1 0 64H528v144a32 32 0 1 1-64 0V512z" fill="currentColor"/>\r
550
- </svg>`, re = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
551
- <path d="M224 448a32 32 0 0 0 9.536 22.592l416 416a32 32 0 0 0 45.248 0l226.24-226.24a32 32 0 0 0 0-45.248l-416-416A32 32 0 0 0 482.432 192H256a64 64 0 0 0-64 64v192z m64-192h160l384 384-160 160-384-384V256z m64 128a64 64 0 1 0 0-128 64 64 0 0 0 0 128z" fill="currentColor"/>\r
552
- </svg>`, ce = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
553
- <path d="M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64zm0-704h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64zm0 352h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64z" fill="currentColor"/>\r
554
- </svg>`, he = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
555
- <path d="M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z" fill="currentColor"/>\r
556
- </svg>`, de = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
557
- <path d="M340.864 149.376a32 32 0 0 0-45.248 45.248L573.44 512l-277.76 317.376a32 32 0 0 0 45.248 45.248l277.76-277.76a96 96 0 0 0 0-135.68L340.864 149.376z" fill="currentColor"/>\r
558
- </svg>`, ge = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
559
- <path d="M512 192c229.76 0 425.216 142.08 493.44 346.24a32 32 0 0 1 0 20.48C937.216 762.88 741.76 904.96 512 904.96S86.784 762.88 18.56 558.72a32 32 0 0 1 0-20.48C86.784 334.08 282.24 192 512 192zm0 64c-197.12 0-367.616 120.32-428.16 296.32C144.384 727.68 314.88 840.96 512 840.96s367.616-113.28 428.16-288.64C879.616 376.32 709.12 256 512 256zm0 160a128 128 0 1 1 0 256 128 128 0 0 1 0-256zm0 64a64 64 0 1 0 0 128 64 64 0 0 0 0-128z" fill="currentColor"/>\r
560
- </svg>`, ue = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
561
- <path d="M637.12 693.376l182.208 182.208a32 32 0 1 1-45.248 45.248L591.872 738.624a352 352 0 1 1 45.248-45.248z m-45.248-45.248A288 288 0 1 0 183.872 240.128a288 288 0 0 0 408 408zM416 448h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64h96v-96a32 32 0 0 1 64 0v96z" fill="currentColor"/>\r
562
- </svg>`, ve = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="1em" height="1em">\r
563
- <path d="M637.12 693.376l182.208 182.208a32 32 0 1 1-45.248 45.248L591.872 738.624a352 352 0 1 1 45.248-45.248z m-45.248-45.248A288 288 0 1 0 183.872 240.128a288 288 0 0 0 408 408zM256 448h320a32 32 0 1 1 0 64H256a32 32 0 1 1 0-64z" fill="currentColor"/>\r
564
- </svg>`, me = ["innerHTML"], fe = /* @__PURE__ */ tt({
540
+ const de = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032114659" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21132" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 391.68c-66.56 0-120.32 54.187-120.32 120.32 0 66.56 53.76 120.32 120.32 120.32 66.133 0 120.32-53.76 120.32-120.32A120.747 120.747 0 0 0 512 391.68z" p-id="21133" fill="#515151"></path><path d="M512 113.493c-219.733 0-398.507 178.774-398.507 398.507S292.267 910.507 512 910.507 910.507 731.733 910.507 512 731.733 113.493 512 113.493z m0 720.214c-177.493 0-321.707-144.214-321.707-321.707S334.507 190.293 512 190.293 833.707 334.507 833.707 512 689.493 833.707 512 833.707z" p-id="21134" fill="#515151"></path></svg>', ge = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M15.7 4.3c.4.4.4 1 0 1.4L9.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', ue = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032015085" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16560" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M911.872 972.629333l-2.645333-1.621333-209.92-208.554667-91.306667 193.194667-147.029333-494.933333 486.4 179.968-177.834667 68.266666 201.472 200.362667a9.898667 9.898667 0 0 1 2.133333 4.608 10.069333 10.069333 0 0 1-1.024 4.778667l-2.389333 3.157333-47.786667 47.530667a9.813333 9.813333 0 0 1-4.522666 2.901333 12.544 12.544 0 0 1-2.56 0z m-657.066667-12.970666L0.256 501.248l97.109333-175.445333 64.256-115.456L254.805333 42.581333h510.208l259.328 466.858667h-100.608L714.325333 132.778667H305.322667l-204.8 368.384 204.8 368.725333H418.133333v90.026667z" fill="#515151" p-id="16561"></path></svg>', ve = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032973956" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6763" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M613.6 960H97.2c-17.7 0-32-14.3-32-32V98.5c0-17.7 14.3-32 32-32h829.5c17.7 0 32 14.3 32 32v518.2c0 17.7-14.3 32-32 32s-32-14.3-32-32V130.5H129.2V896h484.4c17.7 0 32 14.3 32 32s-14.3 32-32 32z" fill="#515151" p-id="6764"></path><path d="M711.3 694.9l120.3 46.9-100.7 80.7z" fill="#515151" p-id="6765"></path><path d="M707.6 882.1L671.3 645l223.6 87.1-187.3 150z m43.7-137.3l2.8 18 14.2-11.4-17-6.6z" fill="#515151" p-id="6766"></path><path d="M927 957.9c-8.2 0-16.4-3.1-22.6-9.4L723.2 767.2c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l181.2 181.2c12.5 12.5 12.5 32.8 0 45.3-6.3 6.3-14.5 9.5-22.7 9.5z" fill="#515151" p-id="6767"></path></svg>', fe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 6h-4V5c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v1H5c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM10 5h4v1h-4V5z"/><path fill="currentColor" d="M6 9v10c0 1.7 1.3 3 3 3h6c1.7 0 3-1.3 3-3V9H6zm4 9c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5zm4 0c0 .6-.4 1-1 1s-1-.4-1-1v-5c0-.6.4-1 1-1s1 .4 1 1v5z"/></svg>', me = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M19 15v4c0 1.1-.9 2-2 2H7c-1.1 0-2-.9-2-2v-4c0-.6.4-1 1-1s1 .4 1 1v4h10v-4c0-.6.4-1 1-1s1 .4 1 1zm-7.7 1.3c.2.2.4.3.7.3s.5-.1.7-.3l4.6-4.6c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0l-2.9 2.9V3c0-.6-.4-1-1-1s-1 .4-1 1v8.3l-2.9-2.9c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4l4.6 4.6z"/></svg>', pe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M3 17.2v4.3c0 .3.2.5.5.5h4.3c.1 0 .3-.1.4-.2l11.1-11.1-5.1-5.1L3.1 16.8c-.1.1-.1.3-.1.4zm18.8-10.9c.4-.4.4-1 0-1.4l-3.7-3.7c-.4-.4-1-.4-1.4 0l-2.3 2.3 5.1 5.1 2.3-2.3z"/></svg>', ye = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M18.7 4.3c.4.4.4 1 0 1.4L12.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/><path fill="currentColor" d="M10.7 4.3c.4.4.4 1 0 1.4L4.4 12l6.3 6.3c.4.4.4 1 0 1.4-.4.4-1 .4-1.4 0l-7-7c-.4-.4-.4-1 0-1.4l7-7c.4-.4 1-.4 1.4 0z"/></svg>', we = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032412624" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3527" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M870.2976 144.0256l51.2 51.2-122.88 122.88a514.304 514.304 0 0 1 170.7264 193.8688C885.0432 679.04 711.8848 793.6 512 793.6c-56.832 0-111.488-9.2672-162.56-26.3424L197.4016 919.296l-51.2-51.2L870.2976 144.0256z m-127.1552 229.5296l-76.6208 76.6208a166.4 166.4 0 0 1-216.32 216.3712l-38.6048 38.5792c29.5168 6.9632 60.032 10.9312 91.1872 11.5712L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a435.8144 435.8144 0 0 0-135.3216-133.9392zM512 230.4c49.664 0 97.664 7.0656 143.0528 20.2496l-63.8208 63.7696a436.4032 436.4032 0 0 0-70.016-7.1168L512 307.2a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a435.84 435.84 0 0 0 119.8848 123.776l-55.0912 55.04a514.2528 514.2528 0 0 1-155.648-183.296C138.9312 344.96 312.0896 230.4 512 230.4z m89.5488 284.8l-86.3744 86.2976 1.7408-0.0256a89.6 89.6 0 0 0 84.6336-86.272zM512 345.6a166.656 166.656 0 0 1 42.5728 5.504l-79.0272 79.0272a89.9328 89.9328 0 0 0-45.4144 45.4144l-79.0272 79.0272A166.4 166.4 0 0 1 512 345.6z" p-id="3528" fill="#515151"></path></svg>', xe = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M5.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/><path fill="currentColor" d="M13.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', be = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775031871732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12257" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M174.63 78.98c0.03-12.61 16.41-19.91 25.81-11.5l328.72 293.98 318.27 284.63c10.51 9.4 0.4 26.75-14.25 24.46L435.7 608.43c-6.23-0.97-12.72 1.92-16.16 7.2L199.96 952.72c-8.09 12.42-27.76 8.34-27.72-5.76l1.17-426.97 1.22-441.01z" fill="#515151" p-id="12258"></path></svg>', Ce = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032210611" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23146" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M543.487882 0.00128a161.919393 161.919393 0 0 0-114.55957 47.359822L47.553742 428.991671a162.111392 162.111392 0 0 0 0 229.119141l318.270806 318.398806a161.983393 161.983393 0 0 0 229.119141 0l381.630569-381.694569A162.111392 162.111392 0 0 0 1023.99808 480.255479V161.920673A161.919393 161.919393 0 0 0 861.886688 0.00128H543.487882z m0 90.55966l318.462806 0.064a71.295733 71.295733 0 0 1 71.487732 71.295733v318.270806c0 18.943929-7.615971 37.119861-21.055921 50.559811l-381.56657 381.758568a71.423732 71.423732 0 0 1-101.055621 0L111.489502 594.111052a71.487732 71.487732 0 0 1 0-101.119621l381.566569-381.566569c13.37595-13.37595 31.551882-20.863922 50.431811-20.863922z m112.447578 124.159535a153.023426 153.023426 0 1 0 0 306.046852 153.023426 153.023426 0 0 0 0-306.046852z m57.727784 129.151515a62.463766 62.463766 0 1 1-115.455567 47.807821 62.463766 62.463766 0 0 1 115.455567-47.807821z" p-id="23147" fill="#515151"></path></svg>', _e = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775096284335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4580" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M308.377435 102.251961C318.982967 47.176334 372.449479 0 448.66303 0c39.496466 0 68.314257 20.040799 85.063685 46.07921 11.995223 18.577967 17.919693 39.935315 20.040799 60.341823 13.384913-4.388496 27.35496-6.582744 41.398147-6.655886 38.911333 0 68.021691 19.455666 85.72196 44.616378 16.822569 23.990446 23.551596 53.100804 23.551596 79.724347v29.988058c0.146283 98.960589 0.292566 197.921178 0.658274 296.954909-0.073142 13.165489 1.097124 26.47726 3.510797 39.569608 8.484426-7.533585 16.237436-15.213453 24.795004-23.69788l13.165488-13.019205c13.970046-13.604338 30.353765-28.598367 49.809432-41.178723 42.056422-27.208676 93.694394-39.642749 162.813209-22.600755 27.574384 6.802169 44.982086 25.380136 54.344211 44.543236 8.776992 18.285401 11.117524 38.545625 10.386108 56.392176-1.38969 33.864562-14.920887 75.26271-43.738679 101.447404l-1.755398 1.755398c-37.375359 36.424518-75.335851 72.263904-113.881477 107.518157-31.450889 28.964075-63.486912 57.050451-96.327491 84.478552-29.037217 24.063587-58.293858 46.51806-80.967755 58.952132A491.511574 491.511574 0 0 1 421.527495 1023.982446a45.567219 45.567219 0 0 1-46.810626-44.25067c0-24.795004 20.699074-44.835803 46.225493-44.762661a395.403507 395.403507 0 0 0 215.036314-64.072045 49.955715 49.955715 0 0 1 4.022788-2.340531c13.458055-7.167877 37.009651-24.502437 67.363417-49.590007 31.597173-26.47726 62.609212-53.612795 92.889836-81.552888a5027.973235 5027.973235 0 0 0 111.687228-105.470192l1.755399-1.755398 0.585133-0.511991 1.682257-1.535974a42.056422 42.056422 0 0 0 9.362125-15.140312c3.291372-8.118718 5.119912-16.749427 5.631903-25.453278a46.07921 46.07921 0 0 0-1.023982-12.580356c-39.715891-8.557568-62.536071-0.658274-81.479746 11.556374a234.126272 234.126272 0 0 0-35.473678 29.841774l-10.386108 10.239824c-9.800975 9.654692-20.845357 20.699074-31.96288 30.500049l-0.146283 0.146283c-19.016817 16.603144-42.787838 31.597173-70.435364 32.182306a74.897002 74.897002 0 0 1-65.096027-35.54682 141.602144 141.602144 0 0 1-18.870534-51.930538 302.074822 302.074822 0 0 1-4.169071-50.613989c-0.365708-99.033731-0.511991-198.213745-0.511992-297.247476v-29.988058c0-13.311772-3.65708-24.136729-7.826151-30.13434a13.896905 13.896905 0 0 0-4.388496-4.388496 7.679868 7.679868 0 0 0-4.022789-0.804558 46.956909 46.956909 0 0 0-28.232658 10.532391 30.719473 30.719473 0 0 0-12.214648 24.721862v232.736582a45.567219 45.567219 0 0 1-46.591201 44.543236 45.567219 45.567219 0 0 1-46.51806-44.616378V124.340726c0-14.628321-3.364514-25.745844-7.094736-31.45089a10.093541 10.093541 0 0 0-2.925664-3.364514 1.901682 1.901682 0 0 0-0.511991-0.292566 9.435267 9.435267 0 0 0-2.340531-0.146283c-38.618767 0-49.443724 23.697879-49.078016 33.791421v1.682256l-0.292567 77.822666v3.876505l-1.023982 253.508797a45.567219 45.567219 0 0 1-46.810626 44.323812 45.567219 45.567219 0 0 1-46.298635-44.68952l1.023983-250.656274a32.036022 32.036022 0 0 0-7.75301-15.140312c-1.82854-1.682257-5.851328-4.827346-17.188277-4.827346a41.178723 41.178723 0 0 0-26.477261 9.069559c-5.558762 4.754204-10.678674 12.580356-10.678674 26.257835v296.589202a45.567219 45.567219 0 0 1-46.518059 44.543236 45.567219 45.567219 0 0 1-46.51806-44.616378v-169.688519a31.158323 31.158323 0 0 0-4.607921-5.705045 11.84894 11.84894 0 0 0-5.193054-3.218231c-1.023982-0.292566-4.681063-1.023982-12.653497 1.462832-17.700268 5.705045-26.111552 14.994029-30.792615 27.208676-5.48562 14.189471-6.582744 35.10797-1.097124 61.438947 42.202705 201.139409 64.949744 301.123981 83.162003 350.34828 16.091153 43.372971 47.615184 81.918596 90.915013 109.566122a43.372971 43.372971 0 0 1 12.872922 61.804654 47.834609 47.834609 0 0 1-64.510894 12.28779c-59.171557-37.741067-103.934218-91.500146-127.046965-153.963075C71.179216 755.406479 46.896203 647.449472 5.571197 449.601435-1.889246 414.127758-3.059512 375.216425 10.471685 340.108455 24.734297 302.806238 54.210364 273.330171 99.265591 258.921276c16.603144-5.558762 34.376554-7.460444 51.784255-5.631904v-29.256641c0-81.18718 67.655983-124.340726 130.265196-124.340726 9.435267 0 18.431684 0.877699 27.062393 2.486815z" p-id="4581" fill="#515151"></path></svg>', ke = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775033156525" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3463" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M694.4 960H195.2C131.7 960 80 908.4 80 845.1V462c0-63.4 51.7-114.9 115.2-114.9h499.2c63.5 0 115.2 51.6 115.2 114.9v383.1c0 63.3-51.7 114.9-115.2 114.9zM195.2 423.7c-21.2 0-38.4 17.2-38.4 38.3v383.1c0 21.1 17.2 38.3 38.4 38.3h499.2c21.2 0 38.4-17.2 38.4-38.3V462c0-21.1-17.2-38.3-38.4-38.3H195.2z" fill="#515151" p-id="3464"></path><path d="M905.6 450.3c-14.8 0-28.9-8.6-35.2-23C788.6 240.8 592.7 213 483.2 213c-21.2 0-38.4-17.2-38.4-38.3s17.2-38.3 38.4-38.3c218.2 0 385 94.9 457.6 260.3 8.5 19.4-0.4 42-19.8 50.5-5 2.1-10.3 3.1-15.4 3.1z" fill="#515151" p-id="3465"></path><path d="M473.6 285.4c-9.8 0-19.7-3.7-27.2-11.2l-72.5-72.4c-15-15-15-39.2 0-54.2l72.5-72.4c15-15 39.3-15 54.3 0s15 39.2 0 54.2l-45.4 45.3 45.4 45.3c15 15 15 39.2 0 54.2-7.4 7.4-17.3 11.2-27.1 11.2z" fill="#515151" p-id="3466"></path></svg>', Ie = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M8.3 19.7c-.4-.4-.4-1 0-1.4l6.3-6.3-6.3-6.3c-.4-.4-.4-1 0-1.4.4-.4 1-.4 1.4 0l7 7c.4.4.4 1 0 1.4l-7 7c-.4.4-1 .4-1.4 0z"/></svg>', Ae = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032400373" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3314" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 230.4c199.8848 0 373.0176 114.5344 457.344 281.5744C885.0432 679.04 711.8848 793.6 512 793.6c-199.8848 0-373.0176-114.5344-457.344-281.5744C138.9568 344.96 312.1152 230.4 512 230.4z m0 76.8a434.8928 434.8928 0 0 0-366.464 200.3456l-2.816 4.48 2.816 4.48a434.944 434.944 0 0 0 357.248 200.192L512 716.8c150.6816 0 287.488-77.2096 366.464-200.3456l2.816-4.48-2.816-4.48a434.944 434.944 0 0 0-357.248-200.192L512 307.2z m0 38.4a166.4 166.4 0 1 1 0 332.8 166.4 166.4 0 0 1 0-332.8z m0 76.8a89.6 89.6 0 1 0 0 179.2 89.6 89.6 0 0 0 0-179.2z" p-id="3315" fill="#515151"></path></svg>', Se = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032548251" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4695" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM460.8 460.8V358.4a51.2 51.2 0 1 1 102.4 0v102.4h102.4a51.2 51.2 0 0 1 0 102.4h-102.4v102.4a51.2 51.2 0 0 1-102.4 0v-102.4H358.4a51.2 51.2 0 0 1 0-102.4h102.4z m38.4 384a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2z" fill="#515151" p-id="4696"></path></svg>', Me = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1775032629657" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1933" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M849.7664 778.1376c1.9968 1.4848 3.84 3.072 5.632 4.864l72.3968 72.3968a51.2 51.2 0 1 1-72.3968 72.3968l-72.3968-72.3968a51.6096 51.6096 0 0 1-4.864-5.632 448 448 0 1 1 71.68-71.68zM499.2 844.8a345.6 345.6 0 1 0 0-691.2 345.6 345.6 0 0 0 0 691.2zM358.4 563.2a51.2 51.2 0 0 1 0-102.4h307.2a51.2 51.2 0 0 1 0 102.4H358.4z" fill="#666666" p-id="1934"></path></svg>', Te = ["innerHTML"], De = /* @__PURE__ */ ct({
565
541
  __name: "SvgIcon",
566
542
  props: {
567
543
  name: {},
568
544
  size: {}
569
545
  },
570
- setup(f) {
571
- const t = f, i = M(""), e = /* @__PURE__ */ Object.assign({ "../assets/svg/aim.svg": Qt, "../assets/svg/back.svg": te, "../assets/svg/connection.svg": ee, "../assets/svg/crop.svg": ne, "../assets/svg/delete.svg": se, "../assets/svg/download.svg": ie, "../assets/svg/edit.svg": oe, "../assets/svg/hide.svg": ae, "../assets/svg/pointer.svg": le, "../assets/svg/price-tag.svg": re, "../assets/svg/rank.svg": ce, "../assets/svg/refresh-right.svg": he, "../assets/svg/right.svg": de, "../assets/svg/view.svg": ge, "../assets/svg/zoom-in.svg": ue, "../assets/svg/zoom-out.svg": ve });
572
- return Yt(() => {
573
- const o = `../assets/svg/${t.name}.svg`, c = e[o];
574
- c ? i.value = c : (console.warn(`Icon ${t.name} not found at path ${o}`), i.value = "");
575
- }), (o, c) => (y(), x("i", {
576
- class: J(["svg-icon", [f.size ? `size-${f.size}` : ""]]),
577
- innerHTML: i.value
578
- }, null, 10, me));
546
+ setup(w) {
547
+ const t = w, n = M(""), e = /* @__PURE__ */ Object.assign({ "../assets/svg/aim.svg": de, "../assets/svg/back.svg": ge, "../assets/svg/connection.svg": ue, "../assets/svg/crop.svg": ve, "../assets/svg/delete.svg": fe, "../assets/svg/download.svg": me, "../assets/svg/edit.svg": pe, "../assets/svg/first.svg": ye, "../assets/svg/hide.svg": we, "../assets/svg/last.svg": xe, "../assets/svg/pointer.svg": be, "../assets/svg/price-tag.svg": Ce, "../assets/svg/rank.svg": _e, "../assets/svg/refresh-right.svg": ke, "../assets/svg/right.svg": Ie, "../assets/svg/view.svg": Ae, "../assets/svg/zoom-in.svg": Se, "../assets/svg/zoom-out.svg": Me });
548
+ return ce(() => {
549
+ const l = `../assets/svg/${t.name}.svg`, o = e[l];
550
+ o ? n.value = o : (console.warn(`Icon ${t.name} not found at path ${l}`), n.value = "");
551
+ }), (l, o) => (v(), m("i", {
552
+ class: X(["svg-icon", [w.size ? `size-${w.size}` : ""]]),
553
+ innerHTML: n.value
554
+ }, null, 10, Te));
579
555
  }
580
- }), et = (f, t) => {
581
- const i = f.__vccOpts || f;
582
- for (const [e, o] of t)
583
- i[e] = o;
584
- return i;
585
- }, H = /* @__PURE__ */ et(fe, [["__scopeId", "data-v-3928607b"]]), ye = {
556
+ }), rt = (w, t) => {
557
+ const n = w.__vccOpts || w;
558
+ for (const [e, l] of t)
559
+ n[e] = l;
560
+ return n;
561
+ }, L = /* @__PURE__ */ rt(De, [["__scopeId", "data-v-3928607b"]]), Pe = {
586
562
  key: 0,
587
563
  class: "image-list-sidebar"
588
- }, pe = { class: "image-list-title" }, xe = { class: "image-list-scroll" }, be = ["onClick"], we = { class: "image-list-stage" }, Ce = ["src", "alt"], Ae = {
564
+ }, ze = { class: "image-list-header" }, $e = ["onClick"], Le = { class: "image-list-stage" }, Be = ["src", "alt"], Re = {
589
565
  key: 0,
590
566
  class: "thumb-overlay-layer"
591
- }, _e = {
567
+ }, He = {
592
568
  key: 1,
593
569
  class: "thumb-overlay-svg",
594
570
  viewBox: "0 0 100 100",
595
571
  preserveAspectRatio: "none"
596
- }, Ie = ["points"], ke = { class: "image-list-text" }, Se = {
597
- key: 1,
572
+ }, Ee = ["points"], Ue = { class: "image-list-text" }, Ve = { class: "center-sidebar" }, Oe = {
573
+ key: 0,
598
574
  class: "left-sidebar"
599
- }, Me = ["onClick", "title"], ze = { class: "center-area" }, $e = {
575
+ }, Fe = ["onClick", "title"], Ne = {
576
+ key: 0,
577
+ class: "divider"
578
+ }, We = { class: "center-area" }, Ge = {
600
579
  key: 0,
601
- class: "top-bar"
602
- }, Te = { class: "label-selector" }, Pe = { class: "tags-row" }, He = ["onClick"], Le = {
580
+ class: "floating-label-selector"
581
+ }, Ye = {
603
582
  key: 0,
604
- class: "no-labels"
605
- }, Re = {
583
+ class: "current-label"
584
+ }, Je = { class: "label-name" }, je = {
606
585
  key: 1,
586
+ class: "current-label empty"
587
+ }, Xe = {
588
+ key: 0,
589
+ class: "selector-dropdown"
590
+ }, qe = {
591
+ key: 0,
592
+ class: "dropdown-empty"
593
+ }, Ke = ["onClick"], Ze = { class: "label-name" }, Qe = {
594
+ key: 0,
607
595
  class: "batch-nav"
608
- }, Be = ["disabled"], De = ["disabled"], Ue = {
609
- key: 2,
596
+ }, ts = ["disabled"], es = ["disabled"], ss = ["disabled"], is = ["disabled"], ns = {
597
+ key: 1,
610
598
  class: "right-sidebar"
611
- }, Fe = { class: "label-list" }, Oe = { class: "label-row" }, Ee = ["onUpdate:modelValue", "onChange"], Ve = ["title"], Ne = ["onClick"], We = { class: "action-icon more-actions" }, Je = ["onClick"], je = {
612
- key: 3,
613
- class: "modal-overlay"
614
- }, Ye = { class: "modal-content" }, Xe = { class: "form-group" }, qe = { class: "form-group" }, Ge = { class: "color-input-wrapper" }, Ke = /* @__PURE__ */ tt({
599
+ }, os = { class: "label-list" }, as = { class: "label-row" }, ls = ["onUpdate:modelValue", "onChange"], cs = ["title"], rs = ["onClick"], hs = { class: "action-icon more-actions" }, ds = ["onClick"], gs = { class: "modal-content" }, us = { class: "modal-body" }, vs = { class: "form-group" }, fs = { class: "form-group" }, ms = { class: "color-input-wrapper" }, ps = { class: "color-value" }, ys = { class: "modal-actions" }, ws = ["disabled"], xs = /* @__PURE__ */ ct({
615
600
  __name: "ImageAnnotator",
616
601
  props: {
617
- annotationTypes: { default: () => ["rectangle", "polygon", "point", "rotatedRect"] },
602
+ annotationTypes: { default: () => ["rectangle", "polygon", "point", "rotatedRect", "category"] },
618
603
  batchImages: { default: () => [] },
619
604
  labels: { default: () => [] },
620
605
  defaultActiveType: {},
@@ -628,581 +613,698 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
628
613
  maxZoom: {}
629
614
  },
630
615
  emits: ["annotationChange", "batchChange", "labelChange", "ready", "error", "tool:change", "viewport:change", "annotation:add", "annotation:update", "annotation:delete", "annotation:select", "prediction:loaded", "prediction:apply", "prediction:reject"],
631
- setup(f, { expose: t, emit: i }) {
632
- const e = f, o = i, c = M(null), r = M(null), a = M(null), d = M(null), u = M(0), w = M(""), m = M([]), _ = M(""), U = M(!1), k = M({ name: "", color: "#FF0000" }), I = M("none"), C = M([]), R = M({}), N = D(() => d.value === "select" && !!w.value), j = (n) => {
633
- if (!n || R.value[n]) return;
634
- const s = new Image();
635
- s.onload = () => {
636
- const l = s.naturalWidth || 1, h = s.naturalHeight || 1;
637
- R.value = {
638
- ...R.value,
639
- [n]: { width: l, height: h }
616
+ setup(w, { expose: t, emit: n }) {
617
+ const e = w, l = n, o = M(null), c = M(null), g = M(null), u = M([]), r = M(null), k = M(null), x = M(0), D = M(""), _ = M([]), $ = M(""), q = M(!1), C = M({ name: "", color: "#FF0000" }), S = M("none"), p = M([]), H = M({}), O = V(() => k.value === "select" && !!D.value), G = M(!1), Z = V(() => _.value.find((s) => s.id === $.value)), yt = (s) => {
618
+ s.stopPropagation(), G.value = !G.value;
619
+ }, wt = (s) => {
620
+ tt(s), G.value = !1;
621
+ };
622
+ kt(() => {
623
+ document.addEventListener("click", (s) => {
624
+ s.target.closest(".floating-label-selector") || (G.value = !1);
625
+ });
626
+ });
627
+ const it = (s) => {
628
+ if (!s || H.value[s]) return;
629
+ const i = new Image();
630
+ i.onload = () => {
631
+ const a = i.naturalWidth || 1, d = i.naturalHeight || 1;
632
+ H.value = {
633
+ ...H.value,
634
+ [s]: { width: a, height: d }
640
635
  };
641
- }, s.src = n;
642
- }, X = () => {
643
- e.batchImages.forEach((n) => {
644
- j(n.imageUrl);
636
+ }, i.src = s;
637
+ }, nt = () => {
638
+ e.batchImages.forEach((s) => {
639
+ it(s.imageUrl);
645
640
  });
646
- }, O = () => {
647
- var l, h, v, A;
648
- const n = e.batchImages[u.value], s = (n == null ? void 0 : n.imageUrl) || ((l = e.image) == null ? void 0 : l.url);
641
+ }, ht = (s, i) => {
642
+ u.value[i] = s;
643
+ }, Q = (s = x.value) => {
644
+ const i = g.value, a = u.value[s];
645
+ if (!i || !a) return;
646
+ const d = i.scrollTop, f = d + i.clientHeight, A = a.offsetTop, P = A + a.offsetHeight;
647
+ if (A < d) {
648
+ i.scrollTo({
649
+ top: Math.max(A - 8, 0),
650
+ behavior: "smooth"
651
+ });
652
+ return;
653
+ }
654
+ P > f && i.scrollTo({
655
+ top: P - i.clientHeight + 8,
656
+ behavior: "smooth"
657
+ });
658
+ }, j = () => {
659
+ var a, d, f, A;
660
+ const s = e.batchImages[x.value], i = (s == null ? void 0 : s.imageUrl) || ((a = e.image) == null ? void 0 : a.url);
649
661
  return {
650
662
  eventId: `${Date.now()}-${Math.random().toString(36).slice(2, 10)}`,
651
663
  timestamp: Date.now(),
652
664
  requestId: e.requestId,
653
- taskId: (h = e.session) == null ? void 0 : h.taskId,
654
- imageId: ((v = e.image) == null ? void 0 : v.id) || s,
665
+ taskId: (d = e.session) == null ? void 0 : d.taskId,
666
+ imageId: ((f = e.image) == null ? void 0 : f.id) || i,
655
667
  operator: (A = e.session) == null ? void 0 : A.userId
656
668
  };
657
- }, ht = (n) => {
658
- var h;
659
- const s = n == null ? void 0 : n.action;
660
- if (!s) return;
661
- const l = {
662
- meta: O(),
663
- action: s,
664
- current: n == null ? void 0 : n.changedItem,
665
- source: (h = n == null ? void 0 : n.changedItem) != null && h.predictionId ? "prediction" : "manual"
669
+ }, y = (s) => {
670
+ var d;
671
+ const i = s == null ? void 0 : s.action;
672
+ if (!i) return;
673
+ const a = {
674
+ meta: j(),
675
+ action: i,
676
+ current: s == null ? void 0 : s.changedItem,
677
+ source: (d = s == null ? void 0 : s.changedItem) != null && d.predictionId ? "prediction" : "manual"
666
678
  };
667
- s === "add" && o("annotation:add", l), s === "update" && o("annotation:update", l), s === "delete" && o("annotation:delete", l), s === "select" && o("annotation:select", l);
668
- }, nt = D(() => e.annotationTypes.filter((n) => n !== "category")), st = (n) => ({
679
+ i === "add" && l("annotation:add", a), i === "update" && l("annotation:update", a), i === "delete" && l("annotation:delete", a), i === "select" && l("annotation:select", a);
680
+ }, b = V(() => e.annotationTypes), I = (s) => ({
669
681
  rectangle: "crop",
670
682
  polygon: "connection",
671
683
  point: "aim",
672
684
  rotatedRect: "refresh-right",
673
685
  category: "price-tag"
674
- })[n] || n, it = (n) => ({
686
+ })[s] || s, F = (s) => ({
675
687
  rectangle: "矩形框",
676
688
  polygon: "多边形",
677
689
  point: "关键点",
678
690
  rotatedRect: "旋转矩形",
679
691
  category: "分类标签"
680
- })[n] || n;
681
- Xt(() => {
682
- if (X(), c.value) {
683
- a.value = new Zt(c.value), a.value.on("annotationChange", (s) => {
684
- var l, h;
685
- if (s.action === "add" && s.changedItem) {
686
- const v = m.value.find((A) => A.id === _.value);
687
- v && (s.changedItem.label = v.name, s.changedItem.labelId = v.id);
692
+ })[s] || s;
693
+ kt(() => {
694
+ if (nt(), o.value) {
695
+ r.value = new he(o.value), r.value.on("annotationChange", (i) => {
696
+ var a, d;
697
+ if (i.action === "add" && i.changedItem) {
698
+ const f = _.value.find((A) => A.id === $.value);
699
+ f && (i.changedItem.label = f.name, i.changedItem.labelId = f.id);
688
700
  }
689
- s.action === "select" ? w.value = ((l = s.changedItem) == null ? void 0 : l.id) || "" : s.action === "delete" && ((h = s.changedItem) == null ? void 0 : h.id) === w.value && (w.value = ""), o("annotationChange", s), ht(s);
701
+ i.action === "select" ? D.value = ((a = i.changedItem) == null ? void 0 : a.id) || "" : i.action === "delete" && ((d = i.changedItem) == null ? void 0 : d.id) === D.value && (D.value = ""), l("annotationChange", i), y(i);
690
702
  }), W(), E();
691
- const n = new ResizeObserver(() => {
692
- var s;
693
- (s = a.value) == null || s.resize();
703
+ const s = new ResizeObserver(() => {
704
+ var i;
705
+ (i = r.value) == null || i.resize();
694
706
  });
695
- r.value && n.observe(r.value), e.defaultActiveType && p(e.defaultActiveType), o("ready", { meta: O() });
707
+ c.value && s.observe(c.value), e.defaultActiveType && Y(e.defaultActiveType), at(() => Q()), l("ready", { meta: j() });
696
708
  }
697
709
  });
698
710
  const E = () => {
699
- if (!a.value) return;
700
- const n = m.value.find((l) => l.id === _.value);
701
- n && a.value.setLabelStyle(n.color);
702
- const s = m.value.filter((l) => l.visible).map((l) => l.name);
703
- a.value.setVisibleLabels(s);
711
+ if (!r.value) return;
712
+ const s = _.value.find((a) => a.id === $.value);
713
+ s && r.value.setLabelStyle(s.color);
714
+ const i = _.value.filter((a) => a.visible).map((a) => a.name);
715
+ r.value.setVisibleLabels(i);
704
716
  }, W = () => {
705
- var n;
706
- if (a.value)
707
- if (w.value = "", requestAnimationFrame(() => {
708
- var s;
709
- (s = a.value) == null || s.resize();
717
+ var s;
718
+ if (r.value)
719
+ if (D.value = "", requestAnimationFrame(() => {
720
+ var i;
721
+ (i = r.value) == null || i.resize();
710
722
  }), e.batchImages.length > 0) {
711
- const s = e.batchImages[u.value];
712
- a.value.loadImage(s.imageUrl), s.annotations ? a.value.setAnnotations(s.annotations) : a.value.setAnnotations([]);
713
- } else (n = e.image) != null && n.url && a.value.loadImage(e.image.url);
714
- }, p = (n) => {
715
- var s, l;
716
- if (d.value = n, w.value = "", n !== "pan" && n !== "select" && m.value.length === 0) {
723
+ const i = e.batchImages[x.value];
724
+ r.value.loadImage(i.imageUrl), i.annotations ? r.value.setAnnotations(i.annotations) : r.value.setAnnotations([]);
725
+ } else (s = e.image) != null && s.url && r.value.loadImage(e.image.url);
726
+ }, Y = (s) => {
727
+ var i, a;
728
+ if (k.value = s, D.value = "", s !== "pan" && s !== "select" && _.value.length === 0) {
717
729
  alert("请先创建标签!");
718
730
  return;
719
731
  }
720
- n === "pan" || n === "select" ? (s = a.value) == null || s.setTool(n) : (l = a.value) == null || l.setTool(n), o("tool:change", { meta: O(), tool: n });
721
- }, b = () => {
722
- var n;
723
- (n = a.value) != null && n.activeAnnotation && a.value.deleteAnnotation(a.value.activeAnnotation.id);
724
- }, z = () => {
725
- a.value && o("viewport:change", {
726
- meta: O(),
727
- scale: a.value.scale,
728
- offset: { ...a.value.offset }
732
+ s === "pan" || s === "select" ? (i = r.value) == null || i.setTool(s) : (a = r.value) == null || a.setTool(s), l("tool:change", { meta: j(), tool: s });
733
+ }, St = () => {
734
+ var s;
735
+ (s = r.value) != null && s.activeAnnotation && r.value.deleteAnnotation(r.value.activeAnnotation.id);
736
+ }, xt = () => {
737
+ r.value && l("viewport:change", {
738
+ meta: j(),
739
+ scale: r.value.scale,
740
+ offset: { ...r.value.offset }
729
741
  });
730
- }, q = () => {
731
- var n;
732
- (n = a.value) == null || n.zoom(1), z();
742
+ }, Mt = () => {
743
+ var s;
744
+ (s = r.value) == null || s.zoom(1), xt();
745
+ }, Tt = () => {
746
+ var s;
747
+ (s = r.value) == null || s.zoom(-1), xt();
748
+ }, Dt = () => {
749
+ C.value = { name: "", color: "#2196F3" }, q.value = !0;
733
750
  }, dt = () => {
734
- var n;
735
- (n = a.value) == null || n.zoom(-1), z();
736
- }, xt = () => {
737
- k.value = { name: "", color: "#2196F3" }, U.value = !0;
738
- }, gt = () => {
739
- U.value = !1;
740
- }, bt = () => {
741
- if (!k.value.name.trim()) {
751
+ q.value = !1;
752
+ }, Pt = () => {
753
+ if (!C.value.name.trim()) {
742
754
  alert("请输入标签名称");
743
755
  return;
744
756
  }
745
- const s = {
757
+ const i = {
746
758
  id: Date.now().toString(),
747
- name: k.value.name,
748
- color: k.value.color,
759
+ name: C.value.name,
760
+ color: C.value.color,
749
761
  visible: !0
750
762
  };
751
- m.value.push(s), o("labelChange", m.value), E(), m.value.length === 1 && G(s), gt();
752
- }, G = (n) => {
753
- var s;
754
- _.value = n.id, (s = a.value) == null || s.setLabelStyle(n.color);
755
- }, wt = (n, s) => {
756
- if (!n.startsWith("#")) return n;
757
- let l = 0, h = 0, v = 0;
758
- return n.length === 4 ? (l = parseInt(n[1] + n[1], 16), h = parseInt(n[2] + n[2], 16), v = parseInt(n[3] + n[3], 16)) : n.length === 7 && (l = parseInt(n.slice(1, 3), 16), h = parseInt(n.slice(3, 5), 16), v = parseInt(n.slice(5, 7), 16)), `rgba(${l}, ${h}, ${v}, ${s})`;
759
- }, Ct = (n) => {
760
- var s;
761
- if (n.id === _.value && ((s = a.value) == null || s.setLabelStyle(n.color)), a.value) {
762
- const l = a.value.getAnnotations();
763
- let h = !1;
764
- l.forEach((v) => {
765
- v.label === n.name && (v.style || (v.style = {}), v.style.strokeColor = n.color, v.style.fillColor = wt(n.color, 0.2), h = !0);
766
- }), h && a.value.render();
763
+ _.value.push(i), l("labelChange", _.value), E(), _.value.length === 1 && tt(i), dt();
764
+ }, tt = (s) => {
765
+ var i;
766
+ $.value = s.id, (i = r.value) == null || i.setLabelStyle(s.color);
767
+ }, zt = (s, i) => {
768
+ if (!s.startsWith("#")) return s;
769
+ let a = 0, d = 0, f = 0;
770
+ return s.length === 4 ? (a = parseInt(s[1] + s[1], 16), d = parseInt(s[2] + s[2], 16), f = parseInt(s[3] + s[3], 16)) : s.length === 7 && (a = parseInt(s.slice(1, 3), 16), d = parseInt(s.slice(3, 5), 16), f = parseInt(s.slice(5, 7), 16)), `rgba(${a}, ${d}, ${f}, ${i})`;
771
+ }, $t = (s) => {
772
+ var i;
773
+ if (s.id === $.value && ((i = r.value) == null || i.setLabelStyle(s.color)), r.value) {
774
+ const a = r.value.getAnnotations();
775
+ let d = !1;
776
+ a.forEach((f) => {
777
+ f.label === s.name && (f.style || (f.style = {}), f.style.strokeColor = s.color, f.style.fillColor = zt(s.color, 0.2), d = !0);
778
+ }), d && r.value.render();
767
779
  }
768
- o("labelChange", m.value), E();
769
- }, At = (n) => {
770
- n.visible = !n.visible, E();
771
- }, _t = (n) => {
772
- const s = m.value.findIndex((l) => l.id === n);
773
- s > -1 && (m.value.splice(s, 1), o("labelChange", m.value), _.value === n && (_.value = m.value.length > 0 ? m.value[0].id : "", _.value && G(m.value[0])), E());
780
+ l("labelChange", _.value), E();
781
+ }, Lt = (s) => {
782
+ s.visible = !s.visible, E();
783
+ }, Bt = (s) => {
784
+ const i = _.value.findIndex((a) => a.id === s);
785
+ i > -1 && (_.value.splice(i, 1), l("labelChange", _.value), $.value === s && ($.value = _.value.length > 0 ? _.value[0].id : "", $.value && tt(_.value[0])), E());
774
786
  };
775
- Y(() => e.labels, (n) => {
776
- const s = JSON.parse(JSON.stringify(n || []));
777
- if (m.value = s, m.value.length > 0)
778
- if (!_.value || !m.value.find((l) => l.id === _.value))
779
- G(m.value[0]);
787
+ K(() => e.labels, (s) => {
788
+ const i = JSON.parse(JSON.stringify(s || []));
789
+ if (_.value = i, _.value.length > 0)
790
+ if (!$.value || !_.value.find((a) => a.id === $.value))
791
+ tt(_.value[0]);
780
792
  else {
781
- const l = m.value.find((h) => h.id === _.value);
782
- l && G(l);
793
+ const a = _.value.find((d) => d.id === $.value);
794
+ a && tt(a);
783
795
  }
784
796
  else
785
- _.value = "";
797
+ $.value = "";
786
798
  E();
787
799
  }, { immediate: !0, deep: !0 });
788
- const It = () => {
789
- u.value > 0 && (ot(), u.value--, W(), at());
790
- }, kt = () => {
791
- u.value < e.batchImages.length - 1 && (ot(), u.value++, W(), at());
792
- }, ot = () => {
793
- if (a.value) {
794
- const n = a.value.getAnnotations();
795
- e.batchImages[u.value].annotations = n;
800
+ const Rt = () => {
801
+ x.value > 0 && (gt(), x.value--, W(), ut());
802
+ }, Ht = () => {
803
+ x.value < e.batchImages.length - 1 && (gt(), x.value++, W(), ut());
804
+ }, Et = () => {
805
+ x.value > 0 && ot(0);
806
+ }, Ut = () => {
807
+ x.value < e.batchImages.length - 1 && ot(e.batchImages.length - 1);
808
+ }, gt = () => {
809
+ if (r.value) {
810
+ const s = r.value.getAnnotations();
811
+ e.batchImages[x.value].annotations = s;
796
812
  }
797
- }, at = () => {
798
- const n = e.batchImages[u.value];
799
- o("batchChange", {
800
- currentIndex: u.value,
813
+ }, ut = () => {
814
+ const s = e.batchImages[x.value];
815
+ l("batchChange", {
816
+ currentIndex: x.value,
801
817
  total: e.batchImages.length,
802
- currentImageUrl: n.imageUrl,
803
- currentAnnotations: n.annotations || []
818
+ currentImageUrl: s.imageUrl,
819
+ currentAnnotations: s.annotations || []
804
820
  });
805
- }, ut = (n = []) => {
806
- var v;
807
- if (!a.value) return;
808
- if (C.value = JSON.parse(JSON.stringify(n)), C.value.length === 0) {
809
- I.value = "none";
821
+ }, bt = (s = []) => {
822
+ var f;
823
+ if (!r.value) return;
824
+ if (p.value = JSON.parse(JSON.stringify(s)), p.value.length === 0) {
825
+ S.value = "none";
810
826
  return;
811
827
  }
812
- I.value = "loaded";
813
- const l = (a.value.getAnnotations() || []).filter((A) => !A.predictionId), h = C.value.map((A) => {
814
- const $ = JSON.parse(JSON.stringify(A.annotation));
815
- return $.id = $.id || `pred-${A.id}`, $.predictionId = A.id, $.modelRunId = A.modelRunId || $.modelRunId, $.confidence = A.confidence ?? $.confidence, $.reviewStatus = $.reviewStatus || "draft", $;
828
+ S.value = "loaded";
829
+ const a = (r.value.getAnnotations() || []).filter((A) => !A.predictionId), d = p.value.map((A) => {
830
+ const P = JSON.parse(JSON.stringify(A.annotation));
831
+ return P.id = P.id || `pred-${A.id}`, P.predictionId = A.id, P.modelRunId = A.modelRunId || P.modelRunId, P.confidence = A.confidence ?? P.confidence, P.reviewStatus = P.reviewStatus || "draft", P;
816
832
  });
817
- a.value.setAnnotations([...l, ...h]), o("prediction:loaded", {
818
- meta: O(),
819
- modelRunId: (v = C.value[0]) == null ? void 0 : v.modelRunId,
820
- candidates: C.value
833
+ r.value.setAnnotations([...a, ...d]), l("prediction:loaded", {
834
+ meta: j(),
835
+ modelRunId: (f = p.value[0]) == null ? void 0 : f.modelRunId,
836
+ candidates: p.value
821
837
  });
822
- }, St = (n, s) => {
823
- var v;
824
- if (!a.value) return [];
825
- I.value = "applying";
826
- const h = (a.value.getAnnotations() || []).filter((A) => A.predictionId && n.includes(A.predictionId));
827
- return h.forEach((A) => {
838
+ }, Vt = (s, i) => {
839
+ var f;
840
+ if (!r.value) return [];
841
+ S.value = "applying";
842
+ const d = (r.value.getAnnotations() || []).filter((A) => A.predictionId && s.includes(A.predictionId));
843
+ return d.forEach((A) => {
828
844
  A.reviewStatus = "accepted";
829
- }), I.value = "applied", o("prediction:apply", {
830
- meta: O(),
831
- modelRunId: (v = h[0]) == null ? void 0 : v.modelRunId,
832
- candidateIds: n,
833
- threshold: s,
834
- acceptedAnnotations: h
835
- }), a.value.render(), h;
836
- }, Mt = (n, s) => {
837
- var v;
838
- if (!a.value) return;
839
- const l = a.value.getAnnotations() || [], h = l.filter((A) => !(A.predictionId && n.includes(A.predictionId)));
840
- a.value.setAnnotations(h), o("prediction:reject", {
841
- meta: O(),
842
- modelRunId: (v = l.find((A) => A.predictionId && n.includes(A.predictionId))) == null ? void 0 : v.modelRunId,
843
- candidateIds: n,
844
- reason: s
845
+ }), S.value = "applied", l("prediction:apply", {
846
+ meta: j(),
847
+ modelRunId: (f = d[0]) == null ? void 0 : f.modelRunId,
848
+ candidateIds: s,
849
+ threshold: i,
850
+ acceptedAnnotations: d
851
+ }), r.value.render(), d;
852
+ }, Ot = (s, i) => {
853
+ var f;
854
+ if (!r.value) return;
855
+ const a = r.value.getAnnotations() || [], d = a.filter((A) => !(A.predictionId && s.includes(A.predictionId)));
856
+ r.value.setAnnotations(d), l("prediction:reject", {
857
+ meta: j(),
858
+ modelRunId: (f = a.find((A) => A.predictionId && s.includes(A.predictionId))) == null ? void 0 : f.modelRunId,
859
+ candidateIds: s,
860
+ reason: i
845
861
  });
846
- }, zt = (n, s = []) => {
847
- a.value && (a.value.loadImage(n.url), a.value.setAnnotations(s));
848
- }, $t = (n) => {
862
+ }, Ft = (s, i = []) => {
863
+ r.value && (r.value.loadImage(s.url), r.value.setAnnotations(i));
864
+ }, Nt = (s) => {
865
+ var i;
866
+ (i = r.value) == null || i.setAnnotations(s);
867
+ }, Ct = () => {
849
868
  var s;
850
- (s = a.value) == null || s.setAnnotations(n);
851
- }, vt = () => {
852
- var n;
853
- return ((n = a.value) == null ? void 0 : n.getAnnotations()) || [];
854
- }, Tt = (n = "json") => {
855
- var l, h;
856
- const s = vt();
869
+ return ((s = r.value) == null ? void 0 : s.getAnnotations()) || [];
870
+ }, Wt = (s = "json") => {
871
+ var a, d;
872
+ const i = Ct();
857
873
  return {
858
- format: n,
859
- image: ((l = e.batchImages[u.value]) == null ? void 0 : l.imageUrl) || ((h = e.image) == null ? void 0 : h.url) || "",
860
- annotations: s
874
+ format: s,
875
+ image: ((a = e.batchImages[x.value]) == null ? void 0 : a.imageUrl) || ((d = e.image) == null ? void 0 : d.url) || "",
876
+ annotations: i
861
877
  };
862
- }, mt = (n) => {
863
- n >= 0 && n < e.batchImages.length && (ot(), u.value = n, W(), at());
864
- }, Pt = (n) => {
865
- var s;
866
- return n === u.value && a.value ? a.value.getAnnotations() || [] : ((s = e.batchImages[n]) == null ? void 0 : s.annotations) || [];
867
- }, Ht = (n) => n.type === "rectangle", Lt = (n) => n.type === "polygon", Rt = (n) => n.type === "point", Bt = (n) => n.type === "rotatedRect", Z = (n) => {
868
- var l, h;
869
- const s = (l = m.value.find((v) => v.name === n.label)) == null ? void 0 : l.color;
870
- return ((h = n.style) == null ? void 0 : h.strokeColor) || s || "#409eff";
871
- }, ft = (n) => {
872
- const s = n.coordinates;
873
- return (s == null ? void 0 : s.points) || [];
874
- }, Q = (n) => {
875
- const s = e.batchImages[n];
876
- if (s != null && s.width && (s != null && s.height))
877
- return { width: s.width, height: s.height };
878
- const l = s != null && s.imageUrl ? R.value[s.imageUrl] : void 0;
879
- return l || (s != null && s.imageUrl && j(s.imageUrl), { width: 1, height: 1 });
880
- }, Dt = (n) => {
881
- const s = e.batchImages[n];
882
- return s != null && s.width && (s != null && s.height) ? !0 : s != null && s.imageUrl ? !!R.value[s.imageUrl] : !1;
883
- }, Ut = (n, s) => {
884
- const l = s.coordinates, h = Q(n), v = Z(s), A = Math.min(l.x1, l.x2), $ = Math.min(l.y1, l.y2), Nt = Math.max(l.x1, l.x2), Wt = Math.max(l.y1, l.y2);
878
+ }, ot = (s) => {
879
+ s >= 0 && s < e.batchImages.length && (gt(), x.value = s, W(), ut());
880
+ }, Gt = (s) => {
881
+ var i;
882
+ return s === x.value && r.value ? r.value.getAnnotations() || [] : ((i = e.batchImages[s]) == null ? void 0 : i.annotations) || [];
883
+ }, Yt = (s) => s.type === "rectangle", Jt = (s) => s.type === "polygon", jt = (s) => s.type === "point", Xt = (s) => s.type === "rotatedRect", qt = (s) => s.type === "category", et = (s) => {
884
+ var a, d;
885
+ const i = (a = _.value.find((f) => f.name === s.label)) == null ? void 0 : a.color;
886
+ return ((d = s.style) == null ? void 0 : d.strokeColor) || i || "#409eff";
887
+ }, _t = (s) => {
888
+ const i = s.coordinates;
889
+ return (i == null ? void 0 : i.points) || [];
890
+ }, st = (s) => {
891
+ const i = e.batchImages[s];
892
+ if (i != null && i.width && (i != null && i.height))
893
+ return { width: i.width, height: i.height };
894
+ const a = i != null && i.imageUrl ? H.value[i.imageUrl] : void 0;
895
+ return a || (i != null && i.imageUrl && it(i.imageUrl), { width: 1, height: 1 });
896
+ }, Kt = (s) => {
897
+ const i = e.batchImages[s];
898
+ return i != null && i.width && (i != null && i.height) ? !0 : i != null && i.imageUrl ? !!H.value[i.imageUrl] : !1;
899
+ }, Zt = (s, i) => {
900
+ const a = i.coordinates, d = st(s), f = et(i), A = Math.min(a.x1, a.x2), P = Math.min(a.y1, a.y2), ne = Math.max(a.x1, a.x2), oe = Math.max(a.y1, a.y2);
885
901
  return {
886
- left: `${A / h.width * 100}%`,
887
- top: `${$ / h.height * 100}%`,
888
- width: `${(Nt - A) / h.width * 100}%`,
889
- height: `${(Wt - $) / h.height * 100}%`,
890
- borderColor: v,
891
- backgroundColor: `${v}22`
902
+ left: `${A / d.width * 100}%`,
903
+ top: `${P / d.height * 100}%`,
904
+ width: `${(ne - A) / d.width * 100}%`,
905
+ height: `${(oe - P) / d.height * 100}%`,
906
+ borderColor: f,
907
+ backgroundColor: `${f}22`
892
908
  };
893
- }, Ft = (n, s) => {
894
- const l = Q(n);
895
- return ft(s).map((h) => `${h.x / l.width * 100},${h.y / l.height * 100}`).join(" ");
896
- }, Ot = (n) => {
897
- const s = Z(n);
909
+ }, Qt = (s, i) => {
910
+ const a = st(s);
911
+ return _t(i).map((d) => `${d.x / a.width * 100},${d.y / a.height * 100}`).join(" ");
912
+ }, te = (s) => {
913
+ const i = et(s);
898
914
  return {
899
- fill: `${s}33`,
900
- stroke: s,
915
+ fill: `${i}33`,
916
+ stroke: i,
901
917
  strokeWidth: "1.4"
902
918
  };
903
- }, Et = (n, s, l) => {
904
- const h = Q(n), v = Z(l);
919
+ }, ee = (s, i, a) => {
920
+ const d = st(s), f = et(a);
905
921
  return {
906
- left: `${s.x / h.width * 100}%`,
907
- top: `${s.y / h.height * 100}%`,
908
- backgroundColor: v
922
+ left: `${i.x / d.width * 100}%`,
923
+ top: `${i.y / d.height * 100}%`,
924
+ backgroundColor: f
909
925
  };
910
- }, Vt = (n, s) => {
911
- const l = s.coordinates, h = Q(n), v = Z(s), A = Math.abs(l.width), $ = Math.abs(l.height);
926
+ }, se = (s, i) => {
927
+ const a = i.coordinates, d = st(s), f = et(i), A = Math.abs(a.width), P = Math.abs(a.height);
912
928
  return {
913
- left: `${(l.x - A / 2) / h.width * 100}%`,
914
- top: `${(l.y - $ / 2) / h.height * 100}%`,
915
- width: `${A / h.width * 100}%`,
916
- height: `${$ / h.height * 100}%`,
917
- transform: `rotate(${l.angle || 0}deg)`,
918
- borderColor: v,
919
- backgroundColor: `${v}22`
929
+ left: `${(a.x - A / 2) / d.width * 100}%`,
930
+ top: `${(a.y - P / 2) / d.height * 100}%`,
931
+ width: `${A / d.width * 100}%`,
932
+ height: `${P / d.height * 100}%`,
933
+ transform: `rotate(${a.angle || 0}deg)`,
934
+ borderColor: f,
935
+ backgroundColor: `${f}22`
936
+ };
937
+ }, ie = (s, i) => {
938
+ const a = i.coordinates, d = st(s), f = et(i);
939
+ return {
940
+ left: `${a.x / d.width * 100}%`,
941
+ top: `${a.y / d.height * 100}%`,
942
+ backgroundColor: `${f}d9`
943
+ // ~85% opacity
920
944
  };
921
945
  };
922
946
  return t({
923
- jumpTo: mt,
924
- setImage: zt,
925
- setAnnotations: $t,
926
- getAnnotations: vt,
927
- selectTool: p,
928
- loadPredictionCandidates: ut,
929
- applyPredictions: St,
930
- rejectPredictions: Mt,
931
- exportAnnotations: Tt,
947
+ jumpTo: ot,
948
+ setImage: Ft,
949
+ setAnnotations: Nt,
950
+ getAnnotations: Ct,
951
+ selectTool: Y,
952
+ loadPredictionCandidates: bt,
953
+ applyPredictions: Vt,
954
+ rejectPredictions: Ot,
955
+ exportAnnotations: Wt,
932
956
  getAllAnnotations: () => {
933
- var n, s;
957
+ var s, i;
934
958
  return e.batchImages.length > 0 ? e.batchImages : [{
935
- imageUrl: ((n = e.image) == null ? void 0 : n.url) || "",
936
- annotations: ((s = a.value) == null ? void 0 : s.getAnnotations()) || []
959
+ imageUrl: ((s = e.image) == null ? void 0 : s.url) || "",
960
+ annotations: ((i = r.value) == null ? void 0 : i.getAnnotations()) || []
937
961
  }];
938
962
  },
939
963
  getCurrentAnnotation: () => {
940
- var n, s, l;
964
+ var s, i, a;
941
965
  return {
942
- imageUrl: ((n = e.batchImages[u.value]) == null ? void 0 : n.imageUrl) || ((s = e.image) == null ? void 0 : s.url) || "",
943
- annotations: ((l = a.value) == null ? void 0 : l.getAnnotations()) || []
966
+ imageUrl: ((s = e.batchImages[x.value]) == null ? void 0 : s.imageUrl) || ((i = e.image) == null ? void 0 : i.url) || "",
967
+ annotations: ((a = r.value) == null ? void 0 : a.getAnnotations()) || []
944
968
  };
945
969
  }
946
- }), Y(() => {
947
- var n;
948
- return (n = e.image) == null ? void 0 : n.url;
970
+ }), K(() => {
971
+ var s;
972
+ return (s = e.image) == null ? void 0 : s.url;
949
973
  }, () => {
950
- var n;
951
- e.batchImages.length === 0 && ((n = e.image) != null && n.url) && W();
952
- }), Y(() => e.predictionCandidates, (n) => {
953
- n && ut(n);
954
- }, { immediate: !0, deep: !0 }), Y(
955
- () => e.batchImages.map((n) => `${n.imageUrl}:${n.width || ""}x${n.height || ""}`),
974
+ var s;
975
+ e.batchImages.length === 0 && ((s = e.image) != null && s.url) && W();
976
+ }), K(() => e.predictionCandidates, (s) => {
977
+ s && bt(s);
978
+ }, { immediate: !0, deep: !0 }), K(
979
+ () => e.batchImages.map((s) => `${s.imageUrl}:${s.width || ""}x${s.height || ""}`),
956
980
  () => {
957
- X();
981
+ nt(), u.value = u.value.slice(0, e.batchImages.length), at(() => Q());
958
982
  },
959
983
  { immediate: !0 }
960
- ), (n, s) => (y(), x("div", {
961
- class: J(["annotation-container", f.theme])
984
+ ), K(
985
+ () => x.value,
986
+ () => {
987
+ at(() => Q());
988
+ }
989
+ ), (s, i) => (v(), m("div", {
990
+ class: X(["annotation-container", w.theme])
962
991
  }, [
963
- f.batchImages && f.batchImages.length > 0 ? (y(), x("div", ye, [
964
- g("div", pe, "批量图片(" + P(f.batchImages.length) + "", 1),
965
- g("div", xe, [
966
- (y(!0), x(B, null, F(f.batchImages, (l, h) => (y(), x("button", {
967
- key: `${l.imageUrl}-${h}`,
968
- class: J(["image-list-item", { active: h === u.value }]),
969
- onClick: (v) => mt(h)
992
+ w.batchImages && w.batchImages.length > 0 ? (v(), m("div", Pe, [
993
+ h("div", ze, "" + z(w.batchImages.length) + "", 1),
994
+ h("div", {
995
+ ref_key: "imageListScrollRef",
996
+ ref: g,
997
+ class: "image-list-scroll"
998
+ }, [
999
+ (v(!0), m(N, null, J(w.batchImages, (a, d) => (v(), m("button", {
1000
+ key: `${a.imageUrl}-${d}`,
1001
+ ref_for: !0,
1002
+ ref: (f) => ht(f, d),
1003
+ class: X(["image-list-item", { active: d === x.value }]),
1004
+ onClick: (f) => ot(d)
970
1005
  }, [
971
- g("div", we, [
972
- g("img", {
973
- src: l.imageUrl,
974
- alt: `第${h + 1}张`,
1006
+ h("div", Le, [
1007
+ h("img", {
1008
+ src: a.imageUrl,
1009
+ alt: `第${d + 1}张`,
975
1010
  class: "image-list-thumb"
976
- }, null, 8, Ce),
977
- Dt(h) ? (y(), x("div", Ae, [
978
- (y(!0), x(B, null, F(Pt(h), (v) => (y(), x(B, {
979
- key: v.id
1011
+ }, null, 8, Be),
1012
+ Kt(d) ? (v(), m("div", Re, [
1013
+ (v(!0), m(N, null, J(Gt(d), (f) => (v(), m(N, {
1014
+ key: f.id
980
1015
  }, [
981
- Ht(v) ? (y(), x("div", {
1016
+ Yt(f) ? (v(), m("div", {
982
1017
  key: 0,
983
1018
  class: "thumb-overlay-rect",
984
- style: V(Ut(h, v))
985
- }, null, 4)) : Lt(v) ? (y(), x("svg", _e, [
986
- g("polygon", {
987
- points: Ft(h, v),
988
- style: V(Ot(v))
989
- }, null, 12, Ie)
990
- ])) : Rt(v) ? (y(!0), x(B, { key: 2 }, F(ft(v), (A, $) => (y(), x("div", {
991
- key: `${v.id}-${$}`,
1019
+ style: U(Zt(d, f))
1020
+ }, null, 4)) : Jt(f) ? (v(), m("svg", He, [
1021
+ h("polygon", {
1022
+ points: Qt(d, f),
1023
+ style: U(te(f))
1024
+ }, null, 12, Ee)
1025
+ ])) : jt(f) ? (v(!0), m(N, { key: 2 }, J(_t(f), (A, P) => (v(), m("div", {
1026
+ key: `${f.id}-${P}`,
992
1027
  class: "thumb-overlay-point",
993
- style: V(Et(h, A, v))
994
- }, null, 4))), 128)) : Bt(v) ? (y(), x("div", {
1028
+ style: U(ee(d, A, f))
1029
+ }, null, 4))), 128)) : Xt(f) ? (v(), m("div", {
995
1030
  key: 3,
996
1031
  class: "thumb-overlay-rotated",
997
- style: V(Vt(h, v))
998
- }, null, 4)) : T("", !0)
1032
+ style: U(se(d, f))
1033
+ }, null, 4)) : qt(f) ? (v(), m("div", {
1034
+ key: 4,
1035
+ class: "thumb-overlay-category",
1036
+ style: U(ie(d, f))
1037
+ }, z(f.label), 5)) : B("", !0)
999
1038
  ], 64))), 128))
1000
- ])) : T("", !0)
1039
+ ])) : B("", !0)
1001
1040
  ]),
1002
- g("span", ke, "第 " + P(h + 1) + " 张", 1)
1003
- ], 10, be))), 128))
1004
- ])
1005
- ])) : T("", !0),
1006
- f.readOnly ? T("", !0) : (y(), x("div", Se, [
1007
- g("div", {
1008
- class: J(["tool-btn", { active: d.value === "pan" }]),
1009
- onClick: s[0] || (s[0] = (l) => p("pan")),
1010
- title: "拖动"
1011
- }, [
1012
- L(H, { name: "rank" })
1013
- ], 2),
1014
- g("div", {
1015
- class: J(["tool-btn", { active: d.value === "select" }]),
1016
- onClick: s[1] || (s[1] = (l) => p("select")),
1017
- title: "选择"
1018
- }, [
1019
- L(H, { name: "pointer" })
1020
- ], 2),
1021
- s[5] || (s[5] = g("div", { class: "divider" }, null, -1)),
1022
- (y(!0), x(B, null, F(nt.value, (l) => (y(), x("div", {
1023
- key: l,
1024
- class: J(["tool-btn", { active: d.value === l }]),
1025
- onClick: (h) => p(l),
1026
- title: it(l)
1027
- }, [
1028
- L(H, {
1029
- name: st(l)
1030
- }, null, 8, ["name"])
1031
- ], 10, Me))), 128)),
1032
- s[6] || (s[6] = g("div", { class: "divider" }, null, -1)),
1033
- g("div", {
1034
- class: "tool-btn",
1035
- onClick: q,
1036
- title: "放大"
1037
- }, [
1038
- L(H, { name: "zoom-in" })
1039
- ]),
1040
- g("div", {
1041
- class: "tool-btn",
1042
- onClick: dt,
1043
- title: "缩小"
1044
- }, [
1045
- L(H, { name: "zoom-out" })
1046
- ]),
1047
- s[7] || (s[7] = g("div", { class: "divider" }, null, -1)),
1048
- N.value ? (y(), x("div", {
1049
- key: 0,
1050
- class: "tool-btn",
1051
- onClick: b,
1052
- title: "删除选中"
1053
- }, [
1054
- L(H, { name: "delete" })
1055
- ])) : T("", !0)
1056
- ])),
1057
- g("div", ze, [
1058
- f.readOnly ? T("", !0) : (y(), x("div", $e, [
1059
- g("div", Te, [
1060
- s[8] || (s[8] = g("span", { class: "label-text" }, "当前标签:", -1)),
1061
- g("div", Pe, [
1062
- (y(!0), x(B, null, F(m.value, (l) => (y(), x("div", {
1063
- key: l.id,
1064
- class: J(["tag-chip", { active: _.value === l.id }]),
1065
- style: V({ backgroundColor: l.color, borderColor: l.color }),
1066
- onClick: (h) => G(l)
1067
- }, P(l.name), 15, He))), 128)),
1068
- m.value.length === 0 ? (y(), x("div", Le, "请在右侧创建标签")) : T("", !0)
1069
- ])
1070
- ])
1071
- ])),
1072
- g("div", {
1041
+ h("span", Ue, "第 " + z(d + 1) + " 张", 1)
1042
+ ], 10, $e))), 128))
1043
+ ], 512)
1044
+ ])) : B("", !0),
1045
+ h("div", Ve, [
1046
+ w.readOnly ? B("", !0) : (v(), m("div", Oe, [
1047
+ h("div", {
1048
+ class: X(["tool-btn", { active: k.value === "pan" }]),
1049
+ onClick: i[0] || (i[0] = (a) => Y("pan")),
1050
+ title: "拖动"
1051
+ }, [
1052
+ R(L, { name: "rank" })
1053
+ ], 2),
1054
+ h("div", {
1055
+ class: X(["tool-btn", { active: k.value === "select" }]),
1056
+ onClick: i[1] || (i[1] = (a) => Y("select")),
1057
+ title: "选择"
1058
+ }, [
1059
+ R(L, { name: "pointer" })
1060
+ ], 2),
1061
+ i[5] || (i[5] = h("div", { class: "divider" }, null, -1)),
1062
+ (v(!0), m(N, null, J(b.value, (a) => (v(), m("div", {
1063
+ key: a,
1064
+ class: X(["tool-btn", { active: k.value === a }]),
1065
+ onClick: (d) => Y(a),
1066
+ title: F(a)
1067
+ }, [
1068
+ R(L, {
1069
+ name: I(a)
1070
+ }, null, 8, ["name"])
1071
+ ], 10, Fe))), 128)),
1072
+ i[6] || (i[6] = h("div", { class: "divider" }, null, -1)),
1073
+ h("div", {
1074
+ class: "tool-btn",
1075
+ onClick: Mt,
1076
+ title: "放大"
1077
+ }, [
1078
+ R(L, { name: "zoom-in" })
1079
+ ]),
1080
+ h("div", {
1081
+ class: "tool-btn",
1082
+ onClick: Tt,
1083
+ title: "缩小"
1084
+ }, [
1085
+ R(L, { name: "zoom-out" })
1086
+ ]),
1087
+ O.value ? (v(), m("div", Ne)) : B("", !0),
1088
+ O.value ? (v(), m("div", {
1089
+ key: 1,
1090
+ class: "tool-btn",
1091
+ onClick: St,
1092
+ title: "删除选中"
1093
+ }, [
1094
+ R(L, { name: "delete" })
1095
+ ])) : B("", !0)
1096
+ ]))
1097
+ ]),
1098
+ h("div", We, [
1099
+ h("div", {
1073
1100
  class: "canvas-wrapper",
1074
1101
  ref_key: "canvasWrapper",
1075
- ref: r,
1076
- onWheel: s[2] || (s[2] = qt(() => {
1102
+ ref: c,
1103
+ onWheel: i[2] || (i[2] = It(() => {
1077
1104
  }, ["prevent"]))
1078
1105
  }, [
1079
- g("canvas", {
1106
+ h("canvas", {
1080
1107
  ref_key: "canvasRef",
1081
- ref: c
1082
- }, null, 512)
1108
+ ref: o
1109
+ }, null, 512),
1110
+ w.readOnly ? B("", !0) : (v(), m("div", Ge, [
1111
+ h("div", {
1112
+ class: "selector-trigger",
1113
+ onClick: yt
1114
+ }, [
1115
+ Z.value ? (v(), m("div", Ye, [
1116
+ h("span", {
1117
+ class: "color-dot",
1118
+ style: U({ backgroundColor: Z.value.color })
1119
+ }, null, 4),
1120
+ h("span", Je, z(Z.value.name), 1)
1121
+ ])) : (v(), m("div", je, [...i[7] || (i[7] = [
1122
+ h("span", { class: "label-name" }, "请选择标签", -1)
1123
+ ])])),
1124
+ R(L, {
1125
+ name: "right",
1126
+ class: X(["arrow-icon", { "is-open": G.value }])
1127
+ }, null, 8, ["class"])
1128
+ ]),
1129
+ G.value ? (v(), m("div", Xe, [
1130
+ _.value.length === 0 ? (v(), m("div", qe, "请在右侧创建标签")) : (v(!0), m(N, { key: 1 }, J(_.value, (a) => (v(), m("div", {
1131
+ key: a.id,
1132
+ class: X(["dropdown-item", { active: $.value === a.id }]),
1133
+ onClick: (d) => wt(a)
1134
+ }, [
1135
+ h("span", {
1136
+ class: "color-dot",
1137
+ style: U({ backgroundColor: a.color })
1138
+ }, null, 4),
1139
+ h("span", Ze, z(a.name), 1),
1140
+ $.value === a.id ? (v(), vt(L, {
1141
+ key: 0,
1142
+ name: "aim",
1143
+ class: "check-icon"
1144
+ })) : B("", !0)
1145
+ ], 10, Ke))), 128))
1146
+ ])) : B("", !0)
1147
+ ]))
1083
1148
  ], 544),
1084
- f.batchImages && f.batchImages.length > 0 ? (y(), x("div", Re, [
1085
- g("button", {
1086
- onClick: It,
1087
- disabled: u.value <= 0
1149
+ w.batchImages && w.batchImages.length > 0 ? (v(), m("div", Qe, [
1150
+ h("button", {
1151
+ class: "icon-btn",
1152
+ onClick: Et,
1153
+ disabled: x.value <= 0,
1154
+ title: "第一张"
1088
1155
  }, [
1089
- L(H, { name: "back" }),
1090
- s[9] || (s[9] = K(" 上一张 ", -1))
1091
- ], 8, Be),
1092
- g("span", null, P(u.value + 1) + " / " + P(f.batchImages.length), 1),
1093
- g("button", {
1094
- onClick: kt,
1095
- disabled: u.value >= f.batchImages.length - 1
1156
+ R(L, { name: "first" })
1157
+ ], 8, ts),
1158
+ h("button", {
1159
+ class: "icon-btn",
1160
+ onClick: Rt,
1161
+ disabled: x.value <= 0,
1162
+ title: "上一张"
1096
1163
  }, [
1097
- s[10] || (s[10] = K(" 下一张 ", -1)),
1098
- L(H, { name: "right" })
1099
- ], 8, De)
1100
- ])) : T("", !0)
1164
+ R(L, { name: "back" })
1165
+ ], 8, es),
1166
+ h("span", null, z(x.value + 1) + " / " + z(w.batchImages.length), 1),
1167
+ h("button", {
1168
+ class: "icon-btn",
1169
+ onClick: Ht,
1170
+ disabled: x.value >= w.batchImages.length - 1,
1171
+ title: "下一张"
1172
+ }, [
1173
+ R(L, { name: "right" })
1174
+ ], 8, ss),
1175
+ h("button", {
1176
+ class: "icon-btn",
1177
+ onClick: Ut,
1178
+ disabled: x.value >= w.batchImages.length - 1,
1179
+ title: "最后一张"
1180
+ }, [
1181
+ R(L, { name: "last" })
1182
+ ], 8, is)
1183
+ ])) : B("", !0)
1101
1184
  ]),
1102
- f.readOnly ? T("", !0) : (y(), x("div", Ue, [
1103
- g("div", { class: "sidebar-header" }, [
1104
- s[11] || (s[11] = g("h3", null, "标签管理", -1)),
1105
- g("button", {
1185
+ w.readOnly ? B("", !0) : (v(), m("div", ns, [
1186
+ h("div", { class: "sidebar-header" }, [
1187
+ i[8] || (i[8] = h("h3", null, "标签", -1)),
1188
+ h("button", {
1106
1189
  class: "add-btn",
1107
- onClick: xt
1190
+ onClick: Dt
1108
1191
  }, "添加标签")
1109
1192
  ]),
1110
- g("div", Fe, [
1111
- (y(!0), x(B, null, F(m.value, (l) => (y(), x("div", {
1112
- key: l.id,
1113
- class: "label-item"
1193
+ h("div", os, [
1194
+ (v(!0), m(N, null, J(_.value, (a) => (v(), m("div", {
1195
+ key: a.id,
1196
+ class: "label-item",
1197
+ style: U({ backgroundColor: a.color + "1A", color: a.color })
1114
1198
  }, [
1115
- g("div", Oe, [
1116
- g("label", {
1199
+ h("div", as, [
1200
+ h("label", {
1117
1201
  class: "color-wrapper",
1118
- style: V({ backgroundColor: l.color })
1202
+ style: U({ backgroundColor: a.color })
1119
1203
  }, [
1120
- lt(g("input", {
1204
+ ft(h("input", {
1121
1205
  type: "color",
1122
- "onUpdate:modelValue": (h) => l.color = h,
1123
- onChange: (h) => Ct(l),
1206
+ "onUpdate:modelValue": (d) => a.color = d,
1207
+ onChange: (d) => $t(a),
1124
1208
  style: { visibility: "hidden", width: "0", height: "0" }
1125
- }, null, 40, Ee), [
1126
- [rt, l.color]
1209
+ }, null, 40, ls), [
1210
+ [mt, a.color]
1127
1211
  ])
1128
1212
  ], 4),
1129
- g("span", {
1213
+ h("span", {
1130
1214
  class: "label-name",
1131
- title: l.name
1132
- }, P(l.name), 9, Ve),
1133
- g("span", {
1215
+ title: a.name
1216
+ }, z(a.name), 9, cs),
1217
+ h("span", {
1134
1218
  class: "action-icon eye",
1135
- onClick: (h) => At(l)
1219
+ onClick: (d) => Lt(a)
1136
1220
  }, [
1137
- l.visible ? (y(), yt(H, {
1221
+ a.visible ? (v(), vt(L, {
1138
1222
  key: 0,
1139
1223
  name: "view"
1140
- })) : (y(), yt(H, {
1224
+ })) : (v(), vt(L, {
1141
1225
  key: 1,
1142
1226
  name: "hide"
1143
1227
  }))
1144
- ], 8, Ne),
1145
- g("div", We, [
1146
- s[12] || (s[12] = g("span", { class: "dots" }, "•••", -1)),
1147
- g("span", {
1228
+ ], 8, rs),
1229
+ h("div", hs, [
1230
+ i[9] || (i[9] = h("span", { class: "dots" }, "•••", -1)),
1231
+ h("span", {
1148
1232
  class: "delete-btn",
1149
- onClick: (h) => _t(l.id),
1233
+ onClick: (d) => Bt(a.id),
1150
1234
  title: "删除"
1151
1235
  }, [
1152
- L(H, { name: "delete" })
1153
- ], 8, Je)
1236
+ R(L, { name: "delete" })
1237
+ ], 8, ds)
1154
1238
  ])
1155
1239
  ])
1156
- ]))), 128))
1240
+ ], 4))), 128))
1157
1241
  ])
1158
1242
  ])),
1159
- U.value ? (y(), x("div", je, [
1160
- g("div", Ye, [
1161
- s[15] || (s[15] = g("h3", null, "新增标签", -1)),
1162
- g("div", Xe, [
1163
- s[13] || (s[13] = g("label", null, "名称", -1)),
1164
- lt(g("input", {
1165
- "onUpdate:modelValue": s[3] || (s[3] = (l) => k.value.name = l),
1166
- placeholder: "请输入标签名称",
1167
- class: "modal-input"
1168
- }, null, 512), [
1169
- [rt, k.value.name]
1170
- ])
1171
- ]),
1172
- g("div", qe, [
1173
- s[14] || (s[14] = g("label", null, "颜色", -1)),
1174
- g("div", Ge, [
1175
- lt(g("input", {
1176
- type: "color",
1177
- "onUpdate:modelValue": s[4] || (s[4] = (l) => k.value.color = l),
1178
- class: "modal-color-picker"
1243
+ q.value ? (v(), m("div", {
1244
+ key: 2,
1245
+ class: "modal-overlay",
1246
+ onClick: It(dt, ["self"])
1247
+ }, [
1248
+ h("div", gs, [
1249
+ i[12] || (i[12] = h("div", { class: "modal-header" }, [
1250
+ h("h3", null, "新增标签")
1251
+ ], -1)),
1252
+ h("div", us, [
1253
+ h("div", vs, [
1254
+ i[10] || (i[10] = h("label", null, [
1255
+ lt("标签名称 "),
1256
+ h("span", { class: "required" }, "*")
1257
+ ], -1)),
1258
+ ft(h("input", {
1259
+ "onUpdate:modelValue": i[3] || (i[3] = (a) => C.value.name = a),
1260
+ placeholder: "请输入标签名称",
1261
+ class: "modal-input",
1262
+ autofocus: ""
1179
1263
  }, null, 512), [
1180
- [rt, k.value.color]
1181
- ]),
1182
- g("span", null, P(k.value.color), 1)
1264
+ [mt, C.value.name]
1265
+ ])
1266
+ ]),
1267
+ h("div", fs, [
1268
+ i[11] || (i[11] = h("label", null, "标签颜色", -1)),
1269
+ h("div", ms, [
1270
+ h("label", {
1271
+ class: "color-picker-box",
1272
+ style: U({ backgroundColor: C.value.color })
1273
+ }, [
1274
+ ft(h("input", {
1275
+ type: "color",
1276
+ "onUpdate:modelValue": i[4] || (i[4] = (a) => C.value.color = a),
1277
+ class: "modal-color-picker"
1278
+ }, null, 512), [
1279
+ [mt, C.value.color]
1280
+ ])
1281
+ ], 4),
1282
+ h("span", ps, z(C.value.color), 1)
1283
+ ])
1183
1284
  ])
1184
1285
  ]),
1185
- g("div", { class: "modal-actions" }, [
1186
- g("button", {
1187
- onClick: gt,
1286
+ h("div", ys, [
1287
+ h("button", {
1288
+ onClick: dt,
1188
1289
  class: "cancel-btn"
1189
1290
  }, "取消"),
1190
- g("button", {
1191
- onClick: bt,
1192
- class: "confirm-btn"
1193
- }, "确认")
1291
+ h("button", {
1292
+ onClick: Pt,
1293
+ class: "confirm-btn",
1294
+ disabled: !C.value.name.trim()
1295
+ }, "确认", 8, ws)
1194
1296
  ])
1195
1297
  ])
1196
- ])) : T("", !0)
1298
+ ])) : B("", !0)
1197
1299
  ], 2));
1198
1300
  }
1199
- }), Ze = /* @__PURE__ */ et(Ke, [["__scopeId", "data-v-ccc538f3"]]), Qe = {
1301
+ }), bs = /* @__PURE__ */ rt(xs, [["__scopeId", "data-v-914fe07d"]]), Cs = {
1200
1302
  class: "thumbnail-wrapper",
1201
1303
  ref: "wrapper"
1202
- }, tn = ["src", "alt"], en = ["viewBox", "preserveAspectRatio"], nn = ["x", "y", "width", "height", "stroke", "stroke-width"], sn = ["points", "stroke", "stroke-width"], on = ["x", "y", "fill", "font-size"], an = {
1304
+ }, _s = ["src", "alt"], ks = ["viewBox", "preserveAspectRatio"], Is = ["x", "y", "width", "height", "stroke", "stroke-width"], As = ["points", "stroke", "stroke-width"], Ss = ["transform"], Ms = ["x", "y", "width", "height", "stroke", "stroke-width"], Ts = { key: 3 }, Ds = ["cx", "cy", "r", "fill", "stroke-width"], Ps = ["x", "y", "width", "height", "fill"], zs = ["x", "y", "fill", "font-size", "font-weight", "text-anchor", "dominant-baseline"], $s = {
1203
1305
  key: 1,
1204
1306
  class: "loading-placeholder"
1205
- }, ln = /* @__PURE__ */ tt({
1307
+ }, Ls = /* @__PURE__ */ ct({
1206
1308
  __name: "AnnotationThumbnail",
1207
1309
  props: {
1208
1310
  src: {},
@@ -1213,89 +1315,134 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
1213
1315
  strokeWidth: {},
1214
1316
  fontSize: {}
1215
1317
  },
1216
- setup(f) {
1217
- const t = f, i = M(null), e = M(!1), o = M(0), c = M(0), r = () => {
1218
- i.value && (o.value = i.value.naturalWidth, c.value = i.value.naturalHeight, e.value = !0);
1219
- }, a = D(() => t.fit === "contain" ? "xMidYMid meet" : "xMidYMid slice"), d = D(() => t.strokeWidth ?? 10), u = D(() => t.fontSize ?? 30), w = (k) => {
1220
- var I;
1221
- if ((I = k.style) != null && I.strokeColor) return k.style.strokeColor;
1318
+ setup(w) {
1319
+ const t = w, n = M(null), e = M(!1), l = M(0), o = M(0), c = () => {
1320
+ n.value && (l.value = n.value.naturalWidth, o.value = n.value.naturalHeight, e.value = !0);
1321
+ }, g = V(() => t.fit === "contain" ? "xMidYMid meet" : "xMidYMid slice"), u = V(() => t.strokeWidth ?? 10), r = V(() => t.fontSize ?? 30), k = (C) => {
1322
+ var S;
1323
+ if ((S = C.style) != null && S.strokeColor) return C.style.strokeColor;
1222
1324
  if (t.labels) {
1223
- const C = t.labels.find((R) => R.name === k.label);
1224
- if (C) return C.color;
1325
+ const p = t.labels.find((H) => H.name === C.label);
1326
+ if (p) return p.color;
1225
1327
  }
1226
1328
  return "#FF0000";
1227
- }, m = (k) => {
1228
- const I = k.coordinates, C = Math.min(I.x1, I.x2), R = Math.min(I.y1, I.y2), N = Math.abs(I.x1 - I.x2), j = Math.abs(I.y1 - I.y2);
1229
- return { x: C, y: R, width: N, height: j };
1230
- }, _ = (k) => k.coordinates.points.map((C) => `${C.x},${C.y}`).join(" "), U = (k) => {
1231
- if (k.type === "rectangle") {
1232
- const I = m(k);
1233
- return { x: I.x, y: I.y - 5 };
1234
- } else if (k.type === "polygon") {
1235
- const I = k.coordinates.points;
1236
- if (I.length > 0) return { x: I[0].x, y: I[0].y - 5 };
1329
+ }, x = (C) => {
1330
+ const S = C.coordinates, p = Math.min(S.x1, S.x2), H = Math.min(S.y1, S.y2), O = Math.abs(S.x1 - S.x2), G = Math.abs(S.y1 - S.y2);
1331
+ return { x: p, y: H, width: O, height: G };
1332
+ }, D = (C) => C.coordinates.points.map((p) => `${p.x},${p.y}`).join(" "), _ = (C) => {
1333
+ if (C.type === "rectangle") {
1334
+ const S = x(C);
1335
+ return { x: S.x, y: S.y - 5 };
1336
+ } else if (C.type === "polygon") {
1337
+ const S = C.coordinates.points;
1338
+ if (S.length > 0) return { x: S[0].x, y: S[0].y - 5 };
1339
+ } else {
1340
+ if (C.type === "rotatedRect")
1341
+ return { x: C.coordinates.x, y: C.coordinates.y - C.coordinates.height / 2 - 5 };
1342
+ if (C.type === "point") {
1343
+ const S = C.coordinates.points;
1344
+ if (S.length > 0) return { x: S[0].x, y: S[0].y - 15 };
1345
+ } else if (C.type === "category")
1346
+ return { x: C.coordinates.x, y: C.coordinates.y };
1237
1347
  }
1238
1348
  return { x: 0, y: 0 };
1239
- };
1240
- return (k, I) => (y(), x("div", Qe, [
1241
- g("img", {
1349
+ }, $ = (C) => {
1350
+ const { x: S, y: p, angle: H } = C.coordinates, O = H * 180 / Math.PI;
1351
+ return `translate(${S}, ${p}) rotate(${O})`;
1352
+ }, q = (C) => ({ x: C.coordinates.x, y: C.coordinates.y });
1353
+ return (C, S) => (v(), m("div", Cs, [
1354
+ h("img", {
1242
1355
  ref_key: "img",
1243
- ref: i,
1244
- src: f.src,
1356
+ ref: n,
1357
+ src: w.src,
1245
1358
  class: "thumbnail-image",
1246
- style: V({ objectFit: f.fit }),
1247
- onLoad: r,
1248
- alt: f.alt
1249
- }, null, 44, tn),
1250
- e.value ? (y(), x("svg", {
1359
+ style: U({ objectFit: w.fit }),
1360
+ onLoad: c,
1361
+ alt: w.alt
1362
+ }, null, 44, _s),
1363
+ e.value ? (v(), m("svg", {
1251
1364
  key: 0,
1252
1365
  class: "annotation-overlay",
1253
- viewBox: `0 0 ${o.value} ${c.value}`,
1254
- preserveAspectRatio: a.value
1366
+ viewBox: `0 0 ${l.value} ${o.value}`,
1367
+ preserveAspectRatio: g.value
1255
1368
  }, [
1256
- (y(!0), x(B, null, F(f.annotations, (C) => (y(), x(B, {
1257
- key: C.id
1369
+ (v(!0), m(N, null, J(w.annotations, (p) => (v(), m(N, {
1370
+ key: p.id
1258
1371
  }, [
1259
- C.type === "rectangle" ? (y(), x("rect", {
1372
+ p.type === "rectangle" ? (v(), m("rect", {
1260
1373
  key: 0,
1261
- x: m(C).x,
1262
- y: m(C).y,
1263
- width: m(C).width,
1264
- height: m(C).height,
1265
- stroke: w(C),
1266
- "stroke-width": d.value,
1374
+ x: x(p).x,
1375
+ y: x(p).y,
1376
+ width: x(p).width,
1377
+ height: x(p).height,
1378
+ stroke: k(p),
1379
+ "stroke-width": u.value,
1267
1380
  fill: "transparent"
1268
- }, null, 8, nn)) : T("", !0),
1269
- C.type === "polygon" ? (y(), x("polygon", {
1381
+ }, null, 8, Is)) : p.type === "polygon" ? (v(), m("polygon", {
1270
1382
  key: 1,
1271
- points: _(C),
1272
- stroke: w(C),
1273
- "stroke-width": d.value,
1383
+ points: D(p),
1384
+ stroke: k(p),
1385
+ "stroke-width": u.value,
1274
1386
  fill: "transparent"
1275
- }, null, 8, sn)) : T("", !0),
1276
- C.label ? (y(), x("text", {
1387
+ }, null, 8, As)) : p.type === "rotatedRect" ? (v(), m("g", {
1277
1388
  key: 2,
1278
- x: U(C).x,
1279
- y: U(C).y,
1280
- fill: w(C),
1281
- "font-size": u.value,
1282
- "font-weight": "bold",
1283
- class: "anno-label"
1284
- }, P(C.label), 9, on)) : T("", !0)
1389
+ transform: $(p)
1390
+ }, [
1391
+ h("rect", {
1392
+ x: -p.coordinates.width / 2,
1393
+ y: -p.coordinates.height / 2,
1394
+ width: p.coordinates.width,
1395
+ height: p.coordinates.height,
1396
+ stroke: k(p),
1397
+ "stroke-width": u.value,
1398
+ fill: "transparent"
1399
+ }, null, 8, Ms)
1400
+ ], 8, Ss)) : p.type === "point" ? (v(), m("g", Ts, [
1401
+ (v(!0), m(N, null, J(p.coordinates.points, (H, O) => (v(), m("circle", {
1402
+ key: O,
1403
+ cx: H.x,
1404
+ cy: H.y,
1405
+ r: u.value * 1.5,
1406
+ fill: k(p),
1407
+ stroke: "white",
1408
+ "stroke-width": u.value * 0.5
1409
+ }, null, 8, Ds))), 128))
1410
+ ])) : p.type === "category" ? (v(), m("rect", {
1411
+ key: 4,
1412
+ x: q(p).x - (p.label || "").length * r.value * 0.6 / 2 - 8,
1413
+ y: q(p).y - r.value / 2 - 4,
1414
+ width: (p.label || "").length * r.value * 0.6 + 16,
1415
+ height: r.value + 8,
1416
+ rx: "6",
1417
+ ry: "6",
1418
+ fill: k(p),
1419
+ "fill-opacity": "0.85"
1420
+ }, null, 8, Ps)) : B("", !0),
1421
+ p.label ? (v(), m("text", {
1422
+ key: 5,
1423
+ x: _(p).x,
1424
+ y: _(p).y,
1425
+ fill: p.type === "category" ? "#ffffff" : k(p),
1426
+ "font-size": r.value,
1427
+ "font-weight": p.type === "category" ? "normal" : "bold",
1428
+ "text-anchor": p.type === "category" ? "middle" : "start",
1429
+ "dominant-baseline": p.type === "category" ? "middle" : "auto",
1430
+ class: X({ "anno-label": p.type !== "category" })
1431
+ }, z(p.label), 11, zs)) : B("", !0)
1285
1432
  ], 64))), 128))
1286
- ], 8, en)) : (y(), x("div", an, "Loading..."))
1433
+ ], 8, ks)) : (v(), m("div", $s, "Loading..."))
1287
1434
  ], 512));
1288
1435
  }
1289
- }), rn = /* @__PURE__ */ et(ln, [["__scopeId", "data-v-d2fd08ec"]]), cn = {
1436
+ }), Bs = /* @__PURE__ */ rt(Ls, [["__scopeId", "data-v-159a7956"]]), Rs = {
1290
1437
  key: 0,
1291
1438
  class: "gallery-view"
1292
- }, hn = { class: "gallery-header" }, dn = { class: "label-summary" }, gn = ["onClick"], un = { class: "thumbnail-wrapper" }, vn = { class: "img-meta" }, mn = { class: "img-index" }, fn = { class: "anno-count" }, yn = {
1439
+ }, Hs = { class: "gallery-layout" }, Es = { class: "gallery-sidebar" }, Us = { class: "label-stats-table" }, Vs = { class: "label-cover-wrapper" }, Os = ["src"], Fs = { class: "gallery-content" }, Ns = ["onClick"], Ws = { class: "thumbnail-wrapper" }, Gs = { class: "img-meta" }, Ys = { class: "img-index" }, Js = { class: "anno-count" }, js = {
1293
1440
  key: 0,
1294
1441
  class: "bottom-bar"
1295
- }, pn = {
1442
+ }, Xs = {
1296
1443
  key: 1,
1297
1444
  class: "editor-view"
1298
- }, xn = { class: "editor-header" }, bn = { class: "header-left" }, wn = { class: "editor-title" }, Cn = { class: "editor-content" }, An = /* @__PURE__ */ tt({
1445
+ }, qs = { class: "editor-header" }, Ks = { class: "header-left" }, Zs = { class: "editor-title" }, Qs = { class: "editor-content" }, ti = /* @__PURE__ */ ct({
1299
1446
  __name: "BatchAnnotator",
1300
1447
  props: {
1301
1448
  images: {},
@@ -1305,166 +1452,227 @@ const Qt = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" widt
1305
1452
  thumbStrokeWidth: {},
1306
1453
  thumbFontSize: {}
1307
1454
  },
1308
- emits: ["export", "update:images", "imageClick", "update:labels"],
1309
- setup(f, { expose: t, emit: i }) {
1310
- const e = f, o = i, c = M("gallery"), r = M([]), a = M([]), d = M(0), u = M(null), w = M(null), m = M(null), _ = D(() => {
1311
- var p, b;
1312
- return ((b = (p = e.actionBar) == null ? void 0 : p.annotateButton) == null ? void 0 : b.show) === !0;
1313
- }), U = D(() => {
1314
- var p, b;
1315
- return ((b = (p = e.actionBar) == null ? void 0 : p.exportButton) == null ? void 0 : b.show) === !0;
1316
- }), k = D(() => _.value || U.value), I = D(() => {
1317
- var p, b;
1318
- return ((b = (p = e.actionBar) == null ? void 0 : p.annotateButton) == null ? void 0 : b.text) || "手动标注";
1319
- }), C = D(() => {
1320
- var p, b;
1321
- return ((b = (p = e.actionBar) == null ? void 0 : p.exportButton) == null ? void 0 : b.text) || "导出";
1322
- }), R = D(() => e.clickToEnterEditor !== !1);
1323
- Y(() => e.images, (p) => {
1324
- r.value = JSON.parse(JSON.stringify(p));
1325
- }, { immediate: !0, deep: !0 }), Y(() => e.labels, (p) => {
1326
- a.value = JSON.parse(JSON.stringify(p || []));
1455
+ emits: ["export", "update:images", "imageClick", "update:labels", "pageChange"],
1456
+ setup(w, { expose: t, emit: n }) {
1457
+ const e = w, l = n, o = M("gallery"), c = M([]), g = M([]), u = M(0), r = M(null), k = M(null), x = M(null), D = V(() => {
1458
+ var y, b;
1459
+ return ((b = (y = e.actionBar) == null ? void 0 : y.annotateButton) == null ? void 0 : b.show) === !0;
1460
+ }), _ = V(() => {
1461
+ var y, b;
1462
+ return ((b = (y = e.actionBar) == null ? void 0 : y.exportButton) == null ? void 0 : b.show) === !0;
1463
+ }), $ = V(() => D.value || _.value), q = V(() => {
1464
+ var y, b;
1465
+ return ((b = (y = e.actionBar) == null ? void 0 : y.annotateButton) == null ? void 0 : b.text) || "手动标注";
1466
+ }), C = V(() => {
1467
+ var y, b;
1468
+ return ((b = (y = e.actionBar) == null ? void 0 : y.exportButton) == null ? void 0 : b.text) || "导出";
1469
+ }), S = V(() => e.clickToEnterEditor !== !1), p = V(() => {
1470
+ const y = {};
1471
+ g.value.forEach((I) => {
1472
+ y[I.name] = { count: 0, cover: "" };
1473
+ });
1474
+ let b = 0;
1475
+ return c.value.forEach((I) => {
1476
+ I.annotations && I.annotations.forEach((F) => {
1477
+ var W;
1478
+ const E = F.label || (F.labelId ? (W = g.value.find((Y) => Y.id === F.labelId)) == null ? void 0 : W.name : null);
1479
+ E && y[E] && (y[E].count++, b++, y[E].cover || (y[E].cover = I.imageUrl));
1480
+ });
1481
+ }), g.value.map((I) => {
1482
+ var W, Y;
1483
+ const F = ((W = y[I.name]) == null ? void 0 : W.count) || 0, E = b === 0 ? "0.00%" : (F / b * 100).toFixed(2) + "%";
1484
+ return {
1485
+ id: I.id,
1486
+ name: I.name,
1487
+ color: I.color,
1488
+ count: F,
1489
+ percentage: E,
1490
+ cover: ((Y = y[I.name]) == null ? void 0 : Y.cover) || ""
1491
+ };
1492
+ });
1493
+ }), H = (y) => ({
1494
+ color: y.color,
1495
+ backgroundColor: y.color + "1A"
1496
+ // 1A represents ~10% opacity in hex
1497
+ });
1498
+ K(() => e.images, (y) => {
1499
+ c.value = JSON.parse(JSON.stringify(y));
1500
+ }, { immediate: !0, deep: !0 }), K(() => e.labels, (y) => {
1501
+ g.value = JSON.parse(JSON.stringify(y || []));
1327
1502
  }, { immediate: !0, deep: !0 });
1328
- const N = (p) => {
1329
- d.value = p, c.value = "editor", m.value && (m.value.scrollTop = 0), Gt(() => {
1330
- w.value && (w.value.scrollTop = 0), window.scrollTo(0, 0), requestAnimationFrame(() => {
1331
- var b, z;
1332
- (z = (b = u.value) == null ? void 0 : b.jumpTo) == null || z.call(b, p);
1503
+ const O = (y) => {
1504
+ u.value = y, o.value = "editor", l("pageChange", { nowPage: "editPage" }), x.value && (x.value.scrollTop = 0), at(() => {
1505
+ k.value && (k.value.scrollTop = 0), window.scrollTo(0, 0), requestAnimationFrame(() => {
1506
+ var b, I;
1507
+ (I = (b = r.value) == null ? void 0 : b.jumpTo) == null || I.call(b, y);
1333
1508
  });
1334
1509
  });
1335
- }, j = (p, b) => {
1336
- if (R.value) {
1337
- N(p);
1510
+ }, G = (y, b) => {
1511
+ if (S.value) {
1512
+ O(y);
1338
1513
  return;
1339
1514
  }
1340
- o("imageClick", { index: p, imageId: b.id, image: b });
1341
- }, X = (p) => r.value.findIndex((b) => b.id === p);
1515
+ l("imageClick", { index: y, imageId: b.id, image: b });
1516
+ }, Z = (y) => c.value.findIndex((b) => b.id === y);
1342
1517
  t({
1343
- openImageById: (p) => {
1344
- const b = X(p);
1345
- return b < 0 ? !1 : (N(b), !0);
1518
+ openImageById: (y) => {
1519
+ const b = Z(y);
1520
+ return b < 0 ? !1 : (O(b), !0);
1346
1521
  },
1347
- triggerImageClickById: (p) => {
1348
- const b = X(p);
1522
+ triggerImageClickById: (y) => {
1523
+ const b = Z(y);
1349
1524
  if (b < 0)
1350
1525
  return !1;
1351
- const z = r.value[b];
1352
- return z ? (o("imageClick", { index: b, imageId: z.id, image: z }), !0) : !1;
1526
+ const I = c.value[b];
1527
+ return I ? (l("imageClick", { index: b, imageId: I.id, image: I }), !0) : !1;
1353
1528
  },
1354
1529
  getFinalData: () => ({
1355
- images: JSON.parse(JSON.stringify(r.value)),
1356
- labels: JSON.parse(JSON.stringify(a.value))
1530
+ images: JSON.parse(JSON.stringify(c.value)),
1531
+ labels: JSON.parse(JSON.stringify(g.value))
1357
1532
  })
1358
1533
  });
1359
- const nt = () => {
1360
- if (u.value && u.value.getCurrentAnnotation) {
1361
- const p = u.value.getCurrentAnnotation();
1362
- r.value[d.value] && (r.value[d.value].annotations = p.annotations);
1534
+ const it = () => {
1535
+ if (r.value && r.value.getCurrentAnnotation) {
1536
+ const y = r.value.getCurrentAnnotation();
1537
+ c.value[u.value] && (c.value[u.value].annotations = y.annotations);
1363
1538
  }
1364
- c.value = "gallery";
1365
- }, st = () => {
1366
- o("export", r.value);
1367
- }, it = (p) => {
1368
- d.value = p.currentIndex, r.value[p.currentIndex] && (r.value[p.currentIndex].annotations = p.currentAnnotations);
1369
- }, E = (p) => {
1370
- if (u.value && u.value.getCurrentAnnotation) {
1371
- const b = u.value.getCurrentAnnotation();
1372
- r.value[d.value] && (r.value[d.value].annotations = b.annotations, o("update:images", r.value));
1539
+ o.value = "gallery", l("pageChange", { nowPage: "listPage" });
1540
+ }, nt = () => {
1541
+ l("export", c.value);
1542
+ }, ht = (y) => {
1543
+ u.value = y.currentIndex, c.value[y.currentIndex] && (c.value[y.currentIndex].annotations = y.currentAnnotations);
1544
+ }, Q = (y) => {
1545
+ if (r.value && r.value.getCurrentAnnotation) {
1546
+ const b = r.value.getCurrentAnnotation();
1547
+ c.value[u.value] && (c.value[u.value].annotations = b.annotations, l("update:images", c.value));
1373
1548
  }
1374
- }, W = (p) => {
1375
- a.value = JSON.parse(JSON.stringify(p || [])), o("update:labels", a.value);
1549
+ }, j = (y) => {
1550
+ g.value = JSON.parse(JSON.stringify(y || [])), l("update:labels", g.value);
1376
1551
  };
1377
- return (p, b) => (y(), x("div", {
1552
+ return (y, b) => (v(), m("div", {
1378
1553
  ref_key: "batchRootRef",
1379
- ref: w,
1554
+ ref: k,
1380
1555
  class: "batch-annotator"
1381
1556
  }, [
1382
- c.value === "gallery" ? (y(), x("div", cn, [
1383
- g("div", hn, [
1384
- g("h3", null, "批量查看与标注 (" + P(r.value.length) + " 张)", 1),
1385
- g("div", dn, [
1386
- (y(!0), x(B, null, F(a.value, (z) => (y(), x("span", {
1387
- key: z.id,
1388
- class: "label-badge",
1389
- style: V({ backgroundColor: z.color })
1390
- }, P(z.name), 5))), 128))
1557
+ o.value === "gallery" ? (v(), m("div", Rs, [
1558
+ h("div", Hs, [
1559
+ h("div", Es, [
1560
+ h("table", Us, [
1561
+ b[1] || (b[1] = h("thead", null, [
1562
+ h("tr", null, [
1563
+ h("th", null, "标签封面"),
1564
+ h("th", null, "标签名称"),
1565
+ h("th", null, "标注数"),
1566
+ h("th", null, "占比")
1567
+ ])
1568
+ ], -1)),
1569
+ h("tbody", null, [
1570
+ (v(!0), m(N, null, J(p.value, (I) => (v(), m("tr", {
1571
+ key: I.id,
1572
+ style: U(H(I))
1573
+ }, [
1574
+ h("td", null, [
1575
+ h("div", Vs, [
1576
+ I.cover ? (v(), m("img", {
1577
+ key: 0,
1578
+ src: I.cover,
1579
+ class: "label-cover"
1580
+ }, null, 8, Os)) : (v(), m("div", {
1581
+ key: 1,
1582
+ class: "label-cover-empty",
1583
+ style: U({ backgroundColor: I.color })
1584
+ }, null, 4))
1585
+ ])
1586
+ ]),
1587
+ h("td", null, z(I.name), 1),
1588
+ h("td", null, z(I.count), 1),
1589
+ h("td", null, z(I.percentage), 1)
1590
+ ], 4))), 128))
1591
+ ])
1592
+ ])
1593
+ ]),
1594
+ h("div", Fs, [
1595
+ h("div", {
1596
+ ref_key: "galleryGridRef",
1597
+ ref: x,
1598
+ class: "gallery-grid"
1599
+ }, [
1600
+ (v(!0), m(N, null, J(c.value, (I, F) => (v(), m("div", {
1601
+ key: F,
1602
+ class: "gallery-item",
1603
+ onClick: (E) => G(F, I)
1604
+ }, [
1605
+ h("div", Ws, [
1606
+ R(Bs, {
1607
+ src: I.imageUrl,
1608
+ annotations: I.annotations || [],
1609
+ labels: g.value,
1610
+ fit: "cover",
1611
+ strokeWidth: e.thumbStrokeWidth,
1612
+ fontSize: e.thumbFontSize
1613
+ }, null, 8, ["src", "annotations", "labels", "strokeWidth", "fontSize"])
1614
+ ]),
1615
+ h("div", Gs, [
1616
+ h("span", Ys, "#" + z(F + 1), 1),
1617
+ h("span", Js, z((I.annotations || []).length) + " 标注", 1)
1618
+ ])
1619
+ ], 8, Ns))), 128))
1620
+ ], 512)
1391
1621
  ])
1392
1622
  ]),
1393
- g("div", {
1394
- ref_key: "galleryGridRef",
1395
- ref: m,
1396
- class: "gallery-grid"
1397
- }, [
1398
- (y(!0), x(B, null, F(r.value, (z, q) => (y(), x("div", {
1399
- key: q,
1400
- class: "gallery-item",
1401
- onClick: (dt) => j(q, z)
1402
- }, [
1403
- g("div", un, [
1404
- L(rn, {
1405
- src: z.imageUrl,
1406
- annotations: z.annotations || [],
1407
- labels: a.value,
1408
- fit: "cover",
1409
- strokeWidth: e.thumbStrokeWidth,
1410
- fontSize: e.thumbFontSize
1411
- }, null, 8, ["src", "annotations", "labels", "strokeWidth", "fontSize"])
1412
- ]),
1413
- g("div", vn, [
1414
- g("span", mn, "#" + P(q + 1), 1),
1415
- g("span", fn, P((z.annotations || []).length) + " 标注", 1)
1416
- ])
1417
- ], 8, gn))), 128))
1418
- ], 512),
1419
- k.value ? (y(), x("div", yn, [
1420
- _.value ? (y(), x("button", {
1623
+ $.value ? (v(), m("div", js, [
1624
+ D.value ? (v(), m("button", {
1421
1625
  key: 0,
1422
1626
  class: "action-btn primary",
1423
- onClick: b[0] || (b[0] = (z) => N(0))
1627
+ onClick: b[0] || (b[0] = (I) => O(0))
1424
1628
  }, [
1425
- L(H, { name: "edit" }),
1426
- K(" " + P(I.value), 1)
1427
- ])) : T("", !0),
1428
- U.value ? (y(), x("button", {
1629
+ R(L, { name: "edit" }),
1630
+ lt(" " + z(q.value), 1)
1631
+ ])) : B("", !0),
1632
+ _.value ? (v(), m("button", {
1429
1633
  key: 1,
1430
1634
  class: "action-btn success",
1431
- onClick: st
1635
+ onClick: nt
1432
1636
  }, [
1433
- L(H, { name: "download" }),
1434
- K(" " + P(C.value), 1)
1435
- ])) : T("", !0)
1436
- ])) : T("", !0)
1437
- ])) : (y(), x("div", pn, [
1438
- g("div", xn, [
1439
- g("div", bn, [
1440
- g("button", {
1637
+ R(L, { name: "download" }),
1638
+ lt(" " + z(C.value), 1)
1639
+ ])) : B("", !0)
1640
+ ])) : B("", !0)
1641
+ ])) : (v(), m("div", Xs, [
1642
+ h("div", qs, [
1643
+ h("div", Ks, [
1644
+ h("button", {
1441
1645
  class: "back-btn",
1442
- onClick: nt
1646
+ onClick: it
1443
1647
  }, [
1444
- L(H, { name: "back" }),
1445
- b[1] || (b[1] = K(" 返回列表 ", -1))
1648
+ R(L, {
1649
+ name: "back",
1650
+ class: "back-icon"
1651
+ }),
1652
+ b[2] || (b[2] = lt()),
1653
+ b[3] || (b[3] = h("span", { class: "back-text" }, "返回", -1))
1446
1654
  ]),
1447
- g("span", wn, "正在标注: " + P(d.value + 1) + " / " + P(r.value.length), 1)
1655
+ h("span", Zs, "正在标注: " + z(u.value + 1) + " / " + z(c.value.length), 1)
1448
1656
  ])
1449
1657
  ]),
1450
- g("div", Cn, [
1451
- L(Ze, {
1658
+ h("div", Qs, [
1659
+ R(bs, {
1452
1660
  ref_key: "annotatorRef",
1453
- ref: u,
1454
- batchImages: r.value,
1455
- labels: a.value,
1456
- annotationTypes: ["rectangle", "polygon", "point", "rotatedRect"],
1457
- onBatchChange: it,
1458
- onAnnotationChange: E,
1459
- onLabelChange: W
1661
+ ref: r,
1662
+ batchImages: c.value,
1663
+ labels: g.value,
1664
+ annotationTypes: ["rectangle", "polygon", "point", "rotatedRect", "category"],
1665
+ onBatchChange: ht,
1666
+ onAnnotationChange: Q,
1667
+ onLabelChange: j
1460
1668
  }, null, 8, ["batchImages", "labels"])
1461
1669
  ])
1462
1670
  ]))
1463
1671
  ], 512));
1464
1672
  }
1465
- }), kn = /* @__PURE__ */ et(An, [["__scopeId", "data-v-0ae1040a"]]);
1673
+ }), ii = /* @__PURE__ */ rt(ti, [["__scopeId", "data-v-701c81a6"]]);
1466
1674
  export {
1467
- kn as BatchAnnotator,
1468
- Ze as ImageAnnotator,
1469
- kn as default
1675
+ ii as BatchAnnotator,
1676
+ bs as ImageAnnotator,
1677
+ ii as default
1470
1678
  };