@annotorious/annotorious 3.0.0-rc.27 → 3.0.0-rc.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotorious.es.js +680 -674
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +6 -6
package/dist/annotorious.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Ke = (e, t, n) => (
|
|
1
|
+
var rn = Object.defineProperty;
|
|
2
|
+
var ln = (e, t, n) => t in e ? rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var Ke = (e, t, n) => (ln(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
4
|
function F() {
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function it(e, t) {
|
|
7
7
|
for (const n in t)
|
|
8
8
|
e[n] = t[n];
|
|
9
9
|
return (
|
|
@@ -11,14 +11,14 @@ function nt(e, t) {
|
|
|
11
11
|
e
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function zt(e) {
|
|
15
15
|
return e();
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function gt() {
|
|
18
18
|
return /* @__PURE__ */ Object.create(null);
|
|
19
19
|
}
|
|
20
20
|
function ce(e) {
|
|
21
|
-
e.forEach(
|
|
21
|
+
e.forEach(zt);
|
|
22
22
|
}
|
|
23
23
|
function K(e) {
|
|
24
24
|
return typeof e == "function";
|
|
@@ -26,10 +26,10 @@ function K(e) {
|
|
|
26
26
|
function J(e, t) {
|
|
27
27
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function an(e) {
|
|
30
30
|
return Object.keys(e).length === 0;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Ht(e, ...t) {
|
|
33
33
|
if (e == null) {
|
|
34
34
|
for (const o of t)
|
|
35
35
|
o(void 0);
|
|
@@ -38,19 +38,19 @@ function Vt(e, ...t) {
|
|
|
38
38
|
const n = e.subscribe(...t);
|
|
39
39
|
return n.unsubscribe ? () => n.unsubscribe() : n;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
e.$$.on_destroy.push(
|
|
41
|
+
function mt(e, t, n) {
|
|
42
|
+
e.$$.on_destroy.push(Ht(t, n));
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function cn(e, t, n, o) {
|
|
45
45
|
if (e) {
|
|
46
|
-
const i =
|
|
46
|
+
const i = Ft(e, t, n, o);
|
|
47
47
|
return e[0](i);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
return e[1] && o ?
|
|
50
|
+
function Ft(e, t, n, o) {
|
|
51
|
+
return e[1] && o ? it(n.ctx.slice(), e[1](o(t))) : n.ctx;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function fn(e, t, n, o) {
|
|
54
54
|
if (e[2] && o) {
|
|
55
55
|
const i = e[2](o(n));
|
|
56
56
|
if (t.dirty === void 0)
|
|
@@ -65,13 +65,13 @@ function ln(e, t, n, o) {
|
|
|
65
65
|
}
|
|
66
66
|
return t.dirty;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function un(e, t, n, o, i, s) {
|
|
69
69
|
if (i) {
|
|
70
|
-
const r =
|
|
70
|
+
const r = Ft(t, n, o, s);
|
|
71
71
|
e.p(r, i);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function dn(e) {
|
|
75
75
|
if (e.ctx.length > 32) {
|
|
76
76
|
const t = [], n = e.ctx.length / 32;
|
|
77
77
|
for (let o = 0; o < n; o++)
|
|
@@ -80,7 +80,7 @@ function cn(e) {
|
|
|
80
80
|
}
|
|
81
81
|
return -1;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function pt(e) {
|
|
84
84
|
const t = {};
|
|
85
85
|
for (const n in e)
|
|
86
86
|
n[0] !== "$" && (t[n] = e[n]);
|
|
@@ -89,7 +89,7 @@ function gt(e) {
|
|
|
89
89
|
function ze(e) {
|
|
90
90
|
return e ?? "";
|
|
91
91
|
}
|
|
92
|
-
const
|
|
92
|
+
const hn = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : (
|
|
93
93
|
// @ts-ignore Node typings have this
|
|
94
94
|
global
|
|
95
95
|
);
|
|
@@ -102,21 +102,21 @@ function O(e, t, n) {
|
|
|
102
102
|
function k(e) {
|
|
103
103
|
e.parentNode && e.parentNode.removeChild(e);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function at(e, t) {
|
|
106
106
|
for (let n = 0; n < e.length; n += 1)
|
|
107
107
|
e[n] && e[n].d(t);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function X(e) {
|
|
110
110
|
return document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function jt(e) {
|
|
113
113
|
return document.createTextNode(e);
|
|
114
114
|
}
|
|
115
115
|
function ie() {
|
|
116
|
-
return
|
|
116
|
+
return jt(" ");
|
|
117
117
|
}
|
|
118
118
|
function fe() {
|
|
119
|
-
return
|
|
119
|
+
return jt("");
|
|
120
120
|
}
|
|
121
121
|
function j(e, t, n, o) {
|
|
122
122
|
return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o);
|
|
@@ -124,33 +124,33 @@ function j(e, t, n, o) {
|
|
|
124
124
|
function h(e, t, n) {
|
|
125
125
|
n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function gn(e) {
|
|
128
128
|
return Array.from(e.childNodes);
|
|
129
129
|
}
|
|
130
130
|
function Ee(e, t, n) {
|
|
131
131
|
e.classList.toggle(t, !!n);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function mn(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) {
|
|
134
134
|
return new CustomEvent(e, { detail: t, bubbles: n, cancelable: o });
|
|
135
135
|
}
|
|
136
136
|
let Pe;
|
|
137
137
|
function Ie(e) {
|
|
138
138
|
Pe = e;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function qt() {
|
|
141
141
|
if (!Pe)
|
|
142
142
|
throw new Error("Function called outside component initialization");
|
|
143
143
|
return Pe;
|
|
144
144
|
}
|
|
145
145
|
function Ye(e) {
|
|
146
|
-
|
|
146
|
+
qt().$$.on_mount.push(e);
|
|
147
147
|
}
|
|
148
148
|
function Te() {
|
|
149
|
-
const e =
|
|
149
|
+
const e = qt();
|
|
150
150
|
return (t, n, { cancelable: o = !1 } = {}) => {
|
|
151
151
|
const i = e.$$.callbacks[t];
|
|
152
152
|
if (i) {
|
|
153
|
-
const s =
|
|
153
|
+
const s = mn(
|
|
154
154
|
/** @type {string} */
|
|
155
155
|
t,
|
|
156
156
|
n,
|
|
@@ -169,17 +169,17 @@ function de(e, t) {
|
|
|
169
169
|
}
|
|
170
170
|
const we = [], He = [];
|
|
171
171
|
let Ae = [];
|
|
172
|
-
const
|
|
173
|
-
let
|
|
174
|
-
function
|
|
175
|
-
|
|
172
|
+
const yt = [], pn = /* @__PURE__ */ Promise.resolve();
|
|
173
|
+
let st = !1;
|
|
174
|
+
function yn() {
|
|
175
|
+
st || (st = !0, pn.then(Kt));
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function rt(e) {
|
|
178
178
|
Ae.push(e);
|
|
179
179
|
}
|
|
180
180
|
const We = /* @__PURE__ */ new Set();
|
|
181
181
|
let me = 0;
|
|
182
|
-
function
|
|
182
|
+
function Kt() {
|
|
183
183
|
if (me !== 0)
|
|
184
184
|
return;
|
|
185
185
|
const e = Pe;
|
|
@@ -187,7 +187,7 @@ function Ft() {
|
|
|
187
187
|
try {
|
|
188
188
|
for (; me < we.length; ) {
|
|
189
189
|
const t = we[me];
|
|
190
|
-
me++, Ie(t),
|
|
190
|
+
me++, Ie(t), _n(t.$$);
|
|
191
191
|
}
|
|
192
192
|
} catch (t) {
|
|
193
193
|
throw we.length = 0, me = 0, t;
|
|
@@ -200,18 +200,18 @@ function Ft() {
|
|
|
200
200
|
}
|
|
201
201
|
Ae.length = 0;
|
|
202
202
|
} while (we.length);
|
|
203
|
-
for (;
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
for (; yt.length; )
|
|
204
|
+
yt.pop()();
|
|
205
|
+
st = !1, We.clear(), Ie(e);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function _n(e) {
|
|
208
208
|
if (e.fragment !== null) {
|
|
209
209
|
e.update(), ce(e.before_update);
|
|
210
210
|
const t = e.dirty;
|
|
211
|
-
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(
|
|
211
|
+
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(rt);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function wn(e) {
|
|
215
215
|
const t = [], n = [];
|
|
216
216
|
Ae.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), Ae = t;
|
|
217
217
|
}
|
|
@@ -231,7 +231,7 @@ function ae() {
|
|
|
231
231
|
function I(e, t) {
|
|
232
232
|
e && e.i && (Ge.delete(e), e.i(t));
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function C(e, t, n, o) {
|
|
235
235
|
if (e && e.o) {
|
|
236
236
|
if (Ge.has(e))
|
|
237
237
|
return;
|
|
@@ -249,17 +249,17 @@ function te(e) {
|
|
|
249
249
|
}
|
|
250
250
|
function $(e, t, n) {
|
|
251
251
|
const { fragment: o, after_update: i } = e.$$;
|
|
252
|
-
o && o.m(t, n),
|
|
253
|
-
const s = e.$$.on_mount.map(
|
|
252
|
+
o && o.m(t, n), rt(() => {
|
|
253
|
+
const s = e.$$.on_mount.map(zt).filter(K);
|
|
254
254
|
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : ce(s), e.$$.on_mount = [];
|
|
255
|
-
}), i.forEach(
|
|
255
|
+
}), i.forEach(rt);
|
|
256
256
|
}
|
|
257
257
|
function ee(e, t) {
|
|
258
258
|
const n = e.$$;
|
|
259
|
-
n.fragment !== null && (
|
|
259
|
+
n.fragment !== null && (wn(n.after_update), ce(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
e.$$.dirty[0] === -1 && (we.push(e),
|
|
261
|
+
function bn(e, t) {
|
|
262
|
+
e.$$.dirty[0] === -1 && (we.push(e), yn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
263
263
|
}
|
|
264
264
|
function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
265
265
|
const a = Pe;
|
|
@@ -271,7 +271,7 @@ function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
271
271
|
props: s,
|
|
272
272
|
update: F,
|
|
273
273
|
not_equal: i,
|
|
274
|
-
bound:
|
|
274
|
+
bound: gt(),
|
|
275
275
|
// lifecycle
|
|
276
276
|
on_mount: [],
|
|
277
277
|
on_destroy: [],
|
|
@@ -280,7 +280,7 @@ function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
280
280
|
after_update: [],
|
|
281
281
|
context: new Map(t.context || (a ? a.$$.context : [])),
|
|
282
282
|
// everything else
|
|
283
|
-
callbacks:
|
|
283
|
+
callbacks: gt(),
|
|
284
284
|
dirty: l,
|
|
285
285
|
skip_bound: !1,
|
|
286
286
|
root: t.target || a.$$.root
|
|
@@ -289,14 +289,14 @@ function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
289
289
|
let u = !1;
|
|
290
290
|
if (c.ctx = n ? n(e, t.props || {}, (f, d, ...g) => {
|
|
291
291
|
const m = g.length ? g[0] : d;
|
|
292
|
-
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u &&
|
|
292
|
+
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u && bn(e, f)), d;
|
|
293
293
|
}) : [], c.update(), u = !0, ce(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
294
294
|
if (t.hydrate) {
|
|
295
|
-
const f =
|
|
295
|
+
const f = gn(t.target);
|
|
296
296
|
c.fragment && c.fragment.l(f), f.forEach(k);
|
|
297
297
|
} else
|
|
298
298
|
c.fragment && c.fragment.c();
|
|
299
|
-
t.intro && I(e.$$.fragment), $(e, t.target, t.anchor),
|
|
299
|
+
t.intro && I(e.$$.fragment), $(e, t.target, t.anchor), Kt();
|
|
300
300
|
}
|
|
301
301
|
Ie(a);
|
|
302
302
|
}
|
|
@@ -343,26 +343,26 @@ class oe {
|
|
|
343
343
|
* @returns {void}
|
|
344
344
|
*/
|
|
345
345
|
$set(t) {
|
|
346
|
-
this.$$set && !
|
|
346
|
+
this.$$set && !an(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
const
|
|
350
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
349
|
+
const En = "4";
|
|
350
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(En);
|
|
351
351
|
var q = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(q || {});
|
|
352
|
-
const
|
|
352
|
+
const ct = {}, ft = (e, t) => ct[e] = t, lt = (e) => ct[e.type].area(e), An = (e, t, n) => ct[e.type].intersects(e, t, n), Fe = (e) => {
|
|
353
353
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, i = -1 / 0;
|
|
354
354
|
return e.forEach(([s, r]) => {
|
|
355
355
|
t = Math.min(t, s), n = Math.min(n, r), o = Math.max(o, s), i = Math.max(i, r);
|
|
356
356
|
}), { minX: t, minY: n, maxX: o, maxY: i };
|
|
357
|
-
},
|
|
357
|
+
}, Sn = {
|
|
358
358
|
area: (e) => Math.PI * e.geometry.rx * e.geometry.ry,
|
|
359
359
|
intersects: (e, t, n) => {
|
|
360
360
|
const { cx: o, cy: i, rx: s, ry: r } = e.geometry, l = 0, a = Math.cos(l), c = Math.sin(l), u = t - o, f = n - i, d = a * u + c * f, g = c * u - a * f;
|
|
361
361
|
return d * d / (s * s) + g * g / (r * r) <= 1;
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
|
-
|
|
365
|
-
const
|
|
364
|
+
ft(q.ELLIPSE, Sn);
|
|
365
|
+
const Tn = {
|
|
366
366
|
area: (e) => {
|
|
367
367
|
const { points: t } = e.geometry;
|
|
368
368
|
let n = 0, o = t.length - 1;
|
|
@@ -380,13 +380,13 @@ const En = {
|
|
|
380
380
|
return i;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
|
|
384
|
-
const
|
|
383
|
+
ft(q.POLYGON, Tn);
|
|
384
|
+
const vn = {
|
|
385
385
|
area: (e) => e.geometry.w * e.geometry.h,
|
|
386
386
|
intersects: (e, t, n) => t >= e.geometry.x && t <= e.geometry.x + e.geometry.w && n >= e.geometry.y && n <= e.geometry.y + e.geometry.h
|
|
387
387
|
};
|
|
388
|
-
|
|
389
|
-
const
|
|
388
|
+
ft(q.RECTANGLE, vn);
|
|
389
|
+
const Mn = (e, t = !1) => {
|
|
390
390
|
const n = typeof e == "string" ? e : e.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, i = [...n.matchAll(o)][0], [s, r, l, a, c, u, f] = i;
|
|
391
391
|
if (r !== "xywh")
|
|
392
392
|
throw new Error("Unsupported MediaFragment: " + n);
|
|
@@ -408,27 +408,27 @@ const Sn = (e, t = !1) => {
|
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
|
-
},
|
|
411
|
+
}, Ln = (e) => {
|
|
412
412
|
const { x: t, y: n, w: o, h: i } = e;
|
|
413
413
|
return {
|
|
414
414
|
type: "FragmentSelector",
|
|
415
415
|
conformsTo: "http://www.w3.org/TR/media-frags/",
|
|
416
416
|
value: `xywh=pixel:${t},${n},${o},${i}`
|
|
417
417
|
};
|
|
418
|
-
},
|
|
418
|
+
}, Wt = "http://www.w3.org/2000/svg", _t = (e) => {
|
|
419
419
|
const t = (o) => {
|
|
420
420
|
Array.from(o.attributes).forEach((i) => {
|
|
421
421
|
i.name.startsWith("on") && o.removeAttribute(i.name);
|
|
422
422
|
});
|
|
423
423
|
}, n = e.getElementsByTagName("script");
|
|
424
424
|
return Array.from(n).reverse().forEach((o) => o.parentNode.removeChild(o)), Array.from(e.querySelectorAll("*")).forEach(t), e;
|
|
425
|
-
},
|
|
426
|
-
const o = new XMLSerializer().serializeToString(e.documentElement).replace("<svg>", `<svg xmlns="${
|
|
425
|
+
}, kn = (e) => {
|
|
426
|
+
const o = new XMLSerializer().serializeToString(e.documentElement).replace("<svg>", `<svg xmlns="${Wt}">`);
|
|
427
427
|
return new DOMParser().parseFromString(o, "image/svg+xml").documentElement;
|
|
428
|
-
},
|
|
429
|
-
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(
|
|
430
|
-
return o || i ?
|
|
431
|
-
},
|
|
428
|
+
}, On = (e) => {
|
|
429
|
+
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(Wt), i = n.lookupNamespaceURI(null);
|
|
430
|
+
return o || i ? _t(n).firstChild : _t(kn(n)).firstChild;
|
|
431
|
+
}, Bn = (e) => {
|
|
432
432
|
const [t, n, o] = e.match(/(<polygon points=["|'])([^("|')]*)/) || [], i = o.split(" ").map((s) => s.split(",").map(parseFloat));
|
|
433
433
|
return {
|
|
434
434
|
type: q.POLYGON,
|
|
@@ -437,8 +437,8 @@ const Sn = (e, t = !1) => {
|
|
|
437
437
|
bounds: Fe(i)
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
},
|
|
441
|
-
const t =
|
|
440
|
+
}, In = (e) => {
|
|
441
|
+
const t = On(e), n = parseFloat(t.getAttribute("cx")), o = parseFloat(t.getAttribute("cy")), i = parseFloat(t.getAttribute("rx")), s = parseFloat(t.getAttribute("ry")), r = {
|
|
442
442
|
minX: n - i,
|
|
443
443
|
minY: o - s,
|
|
444
444
|
maxX: n + i,
|
|
@@ -454,14 +454,14 @@ const Sn = (e, t = !1) => {
|
|
|
454
454
|
bounds: r
|
|
455
455
|
}
|
|
456
456
|
};
|
|
457
|
-
},
|
|
457
|
+
}, Pn = (e) => {
|
|
458
458
|
const t = typeof e == "string" ? e : e.value;
|
|
459
459
|
if (t.includes("<polygon points="))
|
|
460
|
-
return
|
|
460
|
+
return Bn(t);
|
|
461
461
|
if (t.includes("<ellipse "))
|
|
462
|
-
return
|
|
462
|
+
return In(t);
|
|
463
463
|
throw "Unsupported SVG shape: " + t;
|
|
464
|
-
},
|
|
464
|
+
}, Yn = (e) => {
|
|
465
465
|
let t;
|
|
466
466
|
if (e.type === q.POLYGON) {
|
|
467
467
|
const n = e.geometry, { points: o } = n;
|
|
@@ -474,30 +474,30 @@ const Sn = (e, t = !1) => {
|
|
|
474
474
|
return { type: "SvgSelector", value: t };
|
|
475
475
|
throw `Unsupported shape type: ${e.type}`;
|
|
476
476
|
};
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
477
|
+
var W = [];
|
|
478
|
+
for (var Je = 0; Je < 256; ++Je)
|
|
479
|
+
W.push((Je + 256).toString(16).slice(1));
|
|
480
|
+
function Dn(e, t = 0) {
|
|
481
|
+
return (W[e[t + 0]] + W[e[t + 1]] + W[e[t + 2]] + W[e[t + 3]] + "-" + W[e[t + 4]] + W[e[t + 5]] + "-" + W[e[t + 6]] + W[e[t + 7]] + "-" + W[e[t + 8]] + W[e[t + 9]] + "-" + W[e[t + 10]] + W[e[t + 11]] + W[e[t + 12]] + W[e[t + 13]] + W[e[t + 14]] + W[e[t + 15]]).toLowerCase();
|
|
482
|
+
}
|
|
483
|
+
var Ne, Cn = new Uint8Array(16);
|
|
484
|
+
function Xn() {
|
|
480
485
|
if (!Ne && (Ne = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ne))
|
|
481
486
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
482
|
-
return Ne(
|
|
487
|
+
return Ne(Cn);
|
|
483
488
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
function Yn(e, t = 0) {
|
|
488
|
-
return W[e[t + 0]] + W[e[t + 1]] + W[e[t + 2]] + W[e[t + 3]] + "-" + W[e[t + 4]] + W[e[t + 5]] + "-" + W[e[t + 6]] + W[e[t + 7]] + "-" + W[e[t + 8]] + W[e[t + 9]] + "-" + W[e[t + 10]] + W[e[t + 11]] + W[e[t + 12]] + W[e[t + 13]] + W[e[t + 14]] + W[e[t + 15]];
|
|
489
|
-
}
|
|
490
|
-
const Dn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), yt = {
|
|
491
|
-
randomUUID: Dn
|
|
489
|
+
var Rn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
490
|
+
const wt = {
|
|
491
|
+
randomUUID: Rn
|
|
492
492
|
};
|
|
493
|
-
function
|
|
494
|
-
if (
|
|
495
|
-
return
|
|
493
|
+
function Jt(e, t, n) {
|
|
494
|
+
if (wt.randomUUID && !t && !e)
|
|
495
|
+
return wt.randomUUID();
|
|
496
496
|
e = e || {};
|
|
497
|
-
|
|
498
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
497
|
+
var o = e.random || (e.rng || Xn)();
|
|
498
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Dn(o);
|
|
499
499
|
}
|
|
500
|
-
var
|
|
500
|
+
var bt = Object.prototype.hasOwnProperty;
|
|
501
501
|
function ge(e, t) {
|
|
502
502
|
var n, o;
|
|
503
503
|
if (e === t)
|
|
@@ -516,24 +516,24 @@ function ge(e, t) {
|
|
|
516
516
|
if (!n || typeof e == "object") {
|
|
517
517
|
o = 0;
|
|
518
518
|
for (n in e)
|
|
519
|
-
if (
|
|
519
|
+
if (bt.call(e, n) && ++o && !bt.call(t, n) || !(n in t) || !ge(e[n], t[n]))
|
|
520
520
|
return !1;
|
|
521
521
|
return Object.keys(t).length === o;
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
return e !== e && t !== t;
|
|
525
525
|
}
|
|
526
|
-
function
|
|
526
|
+
function Qe() {
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Nn(e, t) {
|
|
529
529
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
530
530
|
}
|
|
531
531
|
const pe = [];
|
|
532
|
-
function
|
|
532
|
+
function ut(e, t = Qe) {
|
|
533
533
|
let n;
|
|
534
534
|
const o = /* @__PURE__ */ new Set();
|
|
535
535
|
function i(l) {
|
|
536
|
-
if (
|
|
536
|
+
if (Nn(e, l) && (e = l, n)) {
|
|
537
537
|
const a = !pe.length;
|
|
538
538
|
for (const c of o)
|
|
539
539
|
c[1](), pe.push(c, e);
|
|
@@ -547,16 +547,16 @@ function ct(e, t = Je) {
|
|
|
547
547
|
function s(l) {
|
|
548
548
|
i(l(e));
|
|
549
549
|
}
|
|
550
|
-
function r(l, a =
|
|
550
|
+
function r(l, a = Qe) {
|
|
551
551
|
const c = [l, a];
|
|
552
|
-
return o.add(c), o.size === 1 && (n = t(i, s) ||
|
|
552
|
+
return o.add(c), o.size === 1 && (n = t(i, s) || Qe), l(e), () => {
|
|
553
553
|
o.delete(c), o.size === 0 && n && (n(), n = null);
|
|
554
554
|
};
|
|
555
555
|
}
|
|
556
556
|
return { set: i, update: s, subscribe: r };
|
|
557
557
|
}
|
|
558
|
-
const
|
|
559
|
-
const { subscribe: t, set: n } =
|
|
558
|
+
const Un = (e) => {
|
|
559
|
+
const { subscribe: t, set: n } = ut();
|
|
560
560
|
let o;
|
|
561
561
|
return t((i) => o = i), e.observe(({ changes: i }) => {
|
|
562
562
|
if (o) {
|
|
@@ -572,12 +572,12 @@ const Cn = (e) => {
|
|
|
572
572
|
set: n
|
|
573
573
|
};
|
|
574
574
|
};
|
|
575
|
-
var
|
|
576
|
-
const
|
|
577
|
-
const { subscribe: n, set: o } =
|
|
578
|
-
let i =
|
|
575
|
+
var Qt = /* @__PURE__ */ ((e) => (e.EDIT = "EDIT", e.SELECT = "SELECT", e.NONE = "NONE", e))(Qt || {});
|
|
576
|
+
const Ze = { selected: [] }, Vn = (e, t = "EDIT") => {
|
|
577
|
+
const { subscribe: n, set: o } = ut(Ze);
|
|
578
|
+
let i = Ze;
|
|
579
579
|
n((f) => i = f);
|
|
580
|
-
const s = () => o(
|
|
580
|
+
const s = () => o(Ze), r = () => {
|
|
581
581
|
var f;
|
|
582
582
|
return ((f = i.selected) == null ? void 0 : f.length) === 0;
|
|
583
583
|
}, l = (f) => {
|
|
@@ -588,13 +588,18 @@ const Qe = { selected: [] }, Rn = (e, t = "EDIT") => {
|
|
|
588
588
|
}, a = (f, d) => {
|
|
589
589
|
const g = e.getAnnotation(f);
|
|
590
590
|
if (g) {
|
|
591
|
-
const m =
|
|
591
|
+
const m = Et(g, t);
|
|
592
592
|
o(m === "EDIT" ? { selected: [{ id: f, editable: !0 }], pointerEvent: d } : m === "SELECT" ? { selected: [{ id: f }], pointerEvent: d } : { selected: [], pointerEvent: d });
|
|
593
593
|
} else
|
|
594
594
|
console.warn("Invalid selection: " + f);
|
|
595
|
-
}, c = (f, d
|
|
595
|
+
}, c = (f, d) => {
|
|
596
596
|
const g = Array.isArray(f) ? f : [f], m = g.map((y) => e.getAnnotation(y)).filter(Boolean);
|
|
597
|
-
o({
|
|
597
|
+
o({
|
|
598
|
+
selected: m.map((y) => {
|
|
599
|
+
const w = d === void 0 ? Et(y, t) === "EDIT" : d;
|
|
600
|
+
return { id: y.id, editable: w };
|
|
601
|
+
})
|
|
602
|
+
}), m.length !== g.length && console.warn("Invalid selection", f);
|
|
598
603
|
}, u = (f) => {
|
|
599
604
|
if (i.selected.length === 0)
|
|
600
605
|
return !1;
|
|
@@ -615,32 +620,33 @@ const Qe = { selected: [] }, Rn = (e, t = "EDIT") => {
|
|
|
615
620
|
setSelected: c,
|
|
616
621
|
subscribe: n
|
|
617
622
|
};
|
|
618
|
-
},
|
|
619
|
-
|
|
620
|
-
|
|
623
|
+
}, Et = (e, t) => typeof t == "function" ? t(e) || "EDIT" : t || "EDIT";
|
|
624
|
+
var Gn = [];
|
|
625
|
+
for (var xe = 0; xe < 256; ++xe)
|
|
626
|
+
Gn.push((xe + 256).toString(16).slice(1));
|
|
621
627
|
typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
622
|
-
const
|
|
628
|
+
const zn = (e, t) => {
|
|
623
629
|
const n = new Set(e.bodies.map((o) => o.id));
|
|
624
630
|
return t.bodies.filter((o) => !n.has(o.id));
|
|
625
|
-
},
|
|
631
|
+
}, Hn = (e, t) => {
|
|
626
632
|
const n = new Set(t.bodies.map((o) => o.id));
|
|
627
633
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
628
|
-
},
|
|
634
|
+
}, Fn = (e, t) => t.bodies.map((n) => {
|
|
629
635
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
630
636
|
return { newBody: n, oldBody: o && !ge(o, n) ? o : void 0 };
|
|
631
|
-
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })),
|
|
632
|
-
const n =
|
|
637
|
+
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), jn = (e, t) => !ge(e.target, t.target), Zt = (e, t) => {
|
|
638
|
+
const n = zn(e, t), o = Hn(e, t), i = Fn(e, t);
|
|
633
639
|
return {
|
|
634
640
|
oldValue: e,
|
|
635
641
|
newValue: t,
|
|
636
642
|
bodiesCreated: n.length > 0 ? n : void 0,
|
|
637
643
|
bodiesDeleted: o.length > 0 ? o : void 0,
|
|
638
644
|
bodiesUpdated: i.length > 0 ? i : void 0,
|
|
639
|
-
targetUpdated:
|
|
645
|
+
targetUpdated: jn(e, t) ? { oldTarget: e.target, newTarget: t.target } : void 0
|
|
640
646
|
};
|
|
641
647
|
};
|
|
642
648
|
var H = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.REMOTE = "REMOTE", e))(H || {});
|
|
643
|
-
const
|
|
649
|
+
const qn = (e, t) => {
|
|
644
650
|
var n, o;
|
|
645
651
|
const { changes: i, origin: s } = t;
|
|
646
652
|
if (!(!e.options.origin || e.options.origin === s))
|
|
@@ -662,7 +668,7 @@ const Fn = (e, t) => {
|
|
|
662
668
|
return !!(Array.isArray(e.options.annotations) ? e.options.annotations : [e.options.annotations]).find((l) => r.has(l));
|
|
663
669
|
} else
|
|
664
670
|
return !0;
|
|
665
|
-
},
|
|
671
|
+
}, Kn = (e, t) => {
|
|
666
672
|
const n = new Set((e.created || []).map((f) => f.id)), o = new Set((e.updated || []).map(({ newValue: f }) => f.id)), i = new Set((t.created || []).map((f) => f.id)), s = new Set((t.deleted || []).map((f) => f.id)), r = new Set((t.updated || []).map(({ oldValue: f }) => f.id)), l = new Set((t.updated || []).filter(({ oldValue: f }) => n.has(f.id) || o.has(f.id)).map(({ oldValue: f }) => f.id)), a = [
|
|
667
673
|
...(e.created || []).filter((f) => !s.has(f.id)).map((f) => r.has(f.id) ? t.updated.find(({ oldValue: d }) => d.id === f.id).newValue : f),
|
|
668
674
|
...t.created || []
|
|
@@ -674,20 +680,20 @@ const Fn = (e, t) => {
|
|
|
674
680
|
const { oldValue: d, newValue: g } = f;
|
|
675
681
|
if (r.has(g.id)) {
|
|
676
682
|
const m = t.updated.find((y) => y.oldValue.id === g.id).newValue;
|
|
677
|
-
return
|
|
683
|
+
return Zt(d, m);
|
|
678
684
|
} else
|
|
679
685
|
return f;
|
|
680
686
|
}),
|
|
681
687
|
...(t.updated || []).filter(({ oldValue: f }) => !l.has(f.id))
|
|
682
688
|
];
|
|
683
689
|
return { created: a, deleted: c, updated: u };
|
|
684
|
-
},
|
|
685
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (
|
|
686
|
-
const S = n.findIndex((T) => T.onChange ==
|
|
690
|
+
}, Wn = (e) => e.id !== void 0, Jn = () => {
|
|
691
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (b, S = {}) => n.push({ onChange: b, options: S }), i = (b) => {
|
|
692
|
+
const S = n.findIndex((T) => T.onChange == b);
|
|
687
693
|
S > -1 && n.splice(S, 1);
|
|
688
|
-
}, s = (
|
|
694
|
+
}, s = (b, S) => {
|
|
689
695
|
const T = {
|
|
690
|
-
origin:
|
|
696
|
+
origin: b,
|
|
691
697
|
changes: {
|
|
692
698
|
created: S.created || [],
|
|
693
699
|
updated: S.updated || [],
|
|
@@ -695,144 +701,144 @@ const Fn = (e, t) => {
|
|
|
695
701
|
},
|
|
696
702
|
state: [...e.values()]
|
|
697
703
|
};
|
|
698
|
-
n.forEach((
|
|
699
|
-
|
|
704
|
+
n.forEach((v) => {
|
|
705
|
+
qn(v, T) && v.onChange(T);
|
|
700
706
|
});
|
|
701
|
-
}, r = (
|
|
702
|
-
if (e.get(
|
|
703
|
-
throw Error(`Cannot add annotation ${
|
|
704
|
-
e.set(
|
|
705
|
-
}, l = (
|
|
706
|
-
const T = typeof
|
|
707
|
+
}, r = (b, S = H.LOCAL) => {
|
|
708
|
+
if (e.get(b.id))
|
|
709
|
+
throw Error(`Cannot add annotation ${b.id} - exists already`);
|
|
710
|
+
e.set(b.id, b), b.bodies.forEach((T) => t.set(T.id, b.id)), s(S, { created: [b] });
|
|
711
|
+
}, l = (b, S) => {
|
|
712
|
+
const T = typeof b == "string" ? S : b, v = typeof b == "string" ? b : b.id, P = e.get(v);
|
|
707
713
|
if (P) {
|
|
708
|
-
const G =
|
|
709
|
-
return
|
|
714
|
+
const G = Zt(P, T);
|
|
715
|
+
return v === T.id ? e.set(v, T) : (e.delete(v), e.set(T.id, T)), P.bodies.forEach((x) => t.delete(x.id)), T.bodies.forEach((x) => t.set(x.id, T.id)), G;
|
|
710
716
|
} else
|
|
711
|
-
console.warn(`Cannot update annotation ${
|
|
712
|
-
}, a = (
|
|
713
|
-
const
|
|
714
|
-
P && s(
|
|
715
|
-
}, c = (
|
|
716
|
-
const T =
|
|
717
|
+
console.warn(`Cannot update annotation ${v} - does not exist`);
|
|
718
|
+
}, a = (b, S = H.LOCAL, T = H.LOCAL) => {
|
|
719
|
+
const v = Wn(S) ? T : S, P = l(b, S);
|
|
720
|
+
P && s(v, { updated: [P] });
|
|
721
|
+
}, c = (b, S = H.LOCAL) => {
|
|
722
|
+
const T = b.reduce((v, P) => {
|
|
717
723
|
const G = l(P);
|
|
718
|
-
return G ? [...
|
|
724
|
+
return G ? [...v, G] : v;
|
|
719
725
|
}, []);
|
|
720
726
|
T.length > 0 && s(S, { updated: T });
|
|
721
|
-
}, u = (
|
|
722
|
-
const T = e.get(
|
|
727
|
+
}, u = (b, S = H.LOCAL) => {
|
|
728
|
+
const T = e.get(b.annotation);
|
|
723
729
|
if (T) {
|
|
724
|
-
const
|
|
730
|
+
const v = {
|
|
725
731
|
...T,
|
|
726
|
-
bodies: [...T.bodies,
|
|
732
|
+
bodies: [...T.bodies, b]
|
|
727
733
|
};
|
|
728
|
-
e.set(T.id,
|
|
734
|
+
e.set(T.id, v), t.set(b.id, v.id), s(S, { updated: [{
|
|
729
735
|
oldValue: T,
|
|
730
|
-
newValue:
|
|
731
|
-
bodiesCreated: [
|
|
736
|
+
newValue: v,
|
|
737
|
+
bodiesCreated: [b]
|
|
732
738
|
}] });
|
|
733
739
|
} else
|
|
734
|
-
console.warn(`Attempt to add body to missing annotation: ${
|
|
735
|
-
}, f = () => [...e.values()], d = (
|
|
740
|
+
console.warn(`Attempt to add body to missing annotation: ${b.annotation}`);
|
|
741
|
+
}, f = () => [...e.values()], d = (b = H.LOCAL) => {
|
|
736
742
|
const S = [...e.values()];
|
|
737
|
-
e.clear(), t.clear(), s(
|
|
738
|
-
}, g = (
|
|
743
|
+
e.clear(), t.clear(), s(b, { deleted: S });
|
|
744
|
+
}, g = (b, S = !0, T = H.LOCAL) => {
|
|
739
745
|
if (S) {
|
|
740
|
-
const
|
|
741
|
-
e.clear(), t.clear(),
|
|
746
|
+
const v = [...e.values()];
|
|
747
|
+
e.clear(), t.clear(), b.forEach((P) => {
|
|
742
748
|
e.set(P.id, P), P.bodies.forEach((G) => t.set(G.id, P.id));
|
|
743
|
-
}), s(T, { created:
|
|
749
|
+
}), s(T, { created: b, deleted: v });
|
|
744
750
|
} else {
|
|
745
|
-
const
|
|
751
|
+
const v = b.reduce((P, G) => {
|
|
746
752
|
const x = e.get(G.id);
|
|
747
753
|
return x ? [...P, x] : P;
|
|
748
754
|
}, []);
|
|
749
|
-
if (
|
|
750
|
-
throw Error(`Bulk insert would overwrite the following annotations: ${
|
|
751
|
-
|
|
755
|
+
if (v.length > 0)
|
|
756
|
+
throw Error(`Bulk insert would overwrite the following annotations: ${v.map((P) => P.id).join(", ")}`);
|
|
757
|
+
b.forEach((P) => {
|
|
752
758
|
e.set(P.id, P), P.bodies.forEach((G) => t.set(G.id, P.id));
|
|
753
|
-
}), s(T, { created:
|
|
759
|
+
}), s(T, { created: b });
|
|
754
760
|
}
|
|
755
|
-
}, m = (
|
|
756
|
-
const S = typeof
|
|
761
|
+
}, m = (b) => {
|
|
762
|
+
const S = typeof b == "string" ? b : b.id, T = e.get(S);
|
|
757
763
|
if (T)
|
|
758
|
-
return e.delete(S), T.bodies.forEach((
|
|
764
|
+
return e.delete(S), T.bodies.forEach((v) => t.delete(v.id)), T;
|
|
759
765
|
console.warn(`Attempt to delete missing annotation: ${S}`);
|
|
760
|
-
}, y = (
|
|
761
|
-
const T = m(
|
|
766
|
+
}, y = (b, S = H.LOCAL) => {
|
|
767
|
+
const T = m(b);
|
|
762
768
|
T && s(S, { deleted: [T] });
|
|
763
|
-
},
|
|
764
|
-
const T =
|
|
769
|
+
}, w = (b, S = H.LOCAL) => {
|
|
770
|
+
const T = b.reduce((v, P) => {
|
|
765
771
|
const G = m(P);
|
|
766
|
-
return G ? [...
|
|
772
|
+
return G ? [...v, G] : v;
|
|
767
773
|
}, []);
|
|
768
774
|
T.length > 0 && s(S, { deleted: T });
|
|
769
|
-
}, p = (
|
|
770
|
-
const S = e.get(
|
|
775
|
+
}, p = (b) => {
|
|
776
|
+
const S = e.get(b.annotation);
|
|
771
777
|
if (S) {
|
|
772
|
-
const T = S.bodies.find((
|
|
778
|
+
const T = S.bodies.find((v) => v.id === b.id);
|
|
773
779
|
if (T) {
|
|
774
780
|
t.delete(T.id);
|
|
775
|
-
const
|
|
781
|
+
const v = {
|
|
776
782
|
...S,
|
|
777
|
-
bodies: S.bodies.filter((P) => P.id !==
|
|
783
|
+
bodies: S.bodies.filter((P) => P.id !== b.id)
|
|
778
784
|
};
|
|
779
|
-
return e.set(S.id,
|
|
785
|
+
return e.set(S.id, v), {
|
|
780
786
|
oldValue: S,
|
|
781
|
-
newValue:
|
|
787
|
+
newValue: v,
|
|
782
788
|
bodiesDeleted: [T]
|
|
783
789
|
};
|
|
784
790
|
} else
|
|
785
|
-
console.warn(`Attempt to delete missing body ${
|
|
791
|
+
console.warn(`Attempt to delete missing body ${b.id} from annotation ${b.annotation}`);
|
|
786
792
|
} else
|
|
787
|
-
console.warn(`Attempt to delete body from missing annotation ${
|
|
788
|
-
}, A = (
|
|
789
|
-
const T = p(
|
|
793
|
+
console.warn(`Attempt to delete body from missing annotation ${b.annotation}`);
|
|
794
|
+
}, A = (b, S = H.LOCAL) => {
|
|
795
|
+
const T = p(b);
|
|
790
796
|
T && s(S, { updated: [T] });
|
|
791
|
-
}, _ = (
|
|
792
|
-
const T =
|
|
797
|
+
}, _ = (b, S = H.LOCAL) => {
|
|
798
|
+
const T = b.map((v) => p(v)).filter(Boolean);
|
|
793
799
|
T.length > 0 && s(S, { updated: T });
|
|
794
|
-
}, E = (
|
|
795
|
-
const S = e.get(
|
|
800
|
+
}, E = (b) => {
|
|
801
|
+
const S = e.get(b);
|
|
796
802
|
return S ? { ...S } : void 0;
|
|
797
|
-
}, B = (
|
|
798
|
-
const S = t.get(
|
|
803
|
+
}, B = (b) => {
|
|
804
|
+
const S = t.get(b);
|
|
799
805
|
if (S) {
|
|
800
|
-
const T = E(S).bodies.find((
|
|
806
|
+
const T = E(S).bodies.find((v) => v.id === b);
|
|
801
807
|
if (T)
|
|
802
808
|
return T;
|
|
803
|
-
console.error(`Store integrity error: body ${
|
|
809
|
+
console.error(`Store integrity error: body ${b} in index, but not in annotation`);
|
|
804
810
|
} else
|
|
805
|
-
console.warn(`Attempt to retrieve missing body: ${
|
|
806
|
-
}, V = (
|
|
807
|
-
if (
|
|
811
|
+
console.warn(`Attempt to retrieve missing body: ${b}`);
|
|
812
|
+
}, V = (b, S) => {
|
|
813
|
+
if (b.annotation !== S.annotation)
|
|
808
814
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
809
|
-
const T = e.get(
|
|
815
|
+
const T = e.get(b.annotation);
|
|
810
816
|
if (T) {
|
|
811
|
-
const
|
|
817
|
+
const v = T.bodies.find((G) => G.id === b.id), P = {
|
|
812
818
|
...T,
|
|
813
|
-
bodies: T.bodies.map((G) => G.id ===
|
|
819
|
+
bodies: T.bodies.map((G) => G.id === v.id ? S : G)
|
|
814
820
|
};
|
|
815
|
-
return e.set(T.id, P),
|
|
821
|
+
return e.set(T.id, P), v.id !== S.id && (t.delete(v.id), t.set(S.id, P.id)), {
|
|
816
822
|
oldValue: T,
|
|
817
823
|
newValue: P,
|
|
818
|
-
bodiesUpdated: [{ oldBody:
|
|
824
|
+
bodiesUpdated: [{ oldBody: v, newBody: S }]
|
|
819
825
|
};
|
|
820
826
|
} else
|
|
821
|
-
console.warn(`Attempt to add body to missing annotation ${
|
|
822
|
-
}, U = (
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
}, R = (
|
|
826
|
-
const T =
|
|
827
|
+
console.warn(`Attempt to add body to missing annotation ${b.annotation}`);
|
|
828
|
+
}, U = (b, S, T = H.LOCAL) => {
|
|
829
|
+
const v = V(b, S);
|
|
830
|
+
v && s(T, { updated: [v] });
|
|
831
|
+
}, R = (b, S = H.LOCAL) => {
|
|
832
|
+
const T = b.map((v) => V({ id: v.id, annotation: v.annotation }, v)).filter(Boolean);
|
|
827
833
|
s(S, { updated: T });
|
|
828
|
-
}, Y = (
|
|
829
|
-
const S = e.get(
|
|
834
|
+
}, Y = (b) => {
|
|
835
|
+
const S = e.get(b.annotation);
|
|
830
836
|
if (S) {
|
|
831
837
|
const T = {
|
|
832
838
|
...S,
|
|
833
839
|
target: {
|
|
834
840
|
...S.target,
|
|
835
|
-
...
|
|
841
|
+
...b
|
|
836
842
|
}
|
|
837
843
|
};
|
|
838
844
|
return e.set(S.id, T), {
|
|
@@ -840,23 +846,23 @@ const Fn = (e, t) => {
|
|
|
840
846
|
newValue: T,
|
|
841
847
|
targetUpdated: {
|
|
842
848
|
oldTarget: S.target,
|
|
843
|
-
newTarget:
|
|
849
|
+
newTarget: b
|
|
844
850
|
}
|
|
845
851
|
};
|
|
846
852
|
} else
|
|
847
|
-
console.warn(`Attempt to update target on missing annotation: ${
|
|
853
|
+
console.warn(`Attempt to update target on missing annotation: ${b.annotation}`);
|
|
848
854
|
};
|
|
849
855
|
return {
|
|
850
856
|
addAnnotation: r,
|
|
851
857
|
addBody: u,
|
|
852
858
|
all: f,
|
|
853
859
|
bulkAddAnnotation: g,
|
|
854
|
-
bulkDeleteAnnotation:
|
|
860
|
+
bulkDeleteAnnotation: w,
|
|
855
861
|
bulkDeleteBodies: _,
|
|
856
862
|
bulkUpdateAnnotation: c,
|
|
857
863
|
bulkUpdateBodies: R,
|
|
858
|
-
bulkUpdateTargets: (
|
|
859
|
-
const T =
|
|
864
|
+
bulkUpdateTargets: (b, S = H.LOCAL) => {
|
|
865
|
+
const T = b.map((v) => Y(v)).filter(Boolean);
|
|
860
866
|
T.length > 0 && s(S, { updated: T });
|
|
861
867
|
},
|
|
862
868
|
clear: d,
|
|
@@ -868,19 +874,19 @@ const Fn = (e, t) => {
|
|
|
868
874
|
unobserve: i,
|
|
869
875
|
updateAnnotation: a,
|
|
870
876
|
updateBody: U,
|
|
871
|
-
updateTarget: (
|
|
872
|
-
const T = Y(
|
|
877
|
+
updateTarget: (b, S = H.LOCAL) => {
|
|
878
|
+
const T = Y(b);
|
|
873
879
|
T && s(S, { updated: [T] });
|
|
874
880
|
}
|
|
875
881
|
};
|
|
876
|
-
},
|
|
882
|
+
}, Qn = (e) => ({
|
|
877
883
|
...e,
|
|
878
884
|
subscribe: (t) => {
|
|
879
885
|
const n = (o) => t(o.state);
|
|
880
886
|
return e.observe(n), t(e.all()), () => e.unobserve(n);
|
|
881
887
|
}
|
|
882
888
|
});
|
|
883
|
-
let
|
|
889
|
+
let Zn = () => ({
|
|
884
890
|
emit(e, ...t) {
|
|
885
891
|
for (let n = 0, o = this.events[e] || [], i = o.length; n < i; n++)
|
|
886
892
|
o[n](...t);
|
|
@@ -894,17 +900,17 @@ let Jn = () => ({
|
|
|
894
900
|
};
|
|
895
901
|
}
|
|
896
902
|
});
|
|
897
|
-
const
|
|
898
|
-
const t =
|
|
903
|
+
const xn = 250, $n = (e) => {
|
|
904
|
+
const t = Zn(), n = [];
|
|
899
905
|
let o = -1, i = !1, s = 0;
|
|
900
906
|
const r = (g) => {
|
|
901
907
|
if (!i) {
|
|
902
908
|
const { changes: m } = g, y = performance.now();
|
|
903
|
-
if (y - s >
|
|
909
|
+
if (y - s > xn)
|
|
904
910
|
n.splice(o + 1), n.push(m), o = n.length - 1;
|
|
905
911
|
else {
|
|
906
|
-
const
|
|
907
|
-
n[
|
|
912
|
+
const w = n.length - 1;
|
|
913
|
+
n[w] = Kn(n[w], m);
|
|
908
914
|
}
|
|
909
915
|
s = y;
|
|
910
916
|
}
|
|
@@ -932,13 +938,13 @@ const Qn = 250, Zn = (e) => {
|
|
|
932
938
|
}
|
|
933
939
|
}
|
|
934
940
|
};
|
|
935
|
-
},
|
|
936
|
-
const { subscribe: e, set: t } =
|
|
941
|
+
}, eo = () => {
|
|
942
|
+
const { subscribe: e, set: t } = ut([]);
|
|
937
943
|
return {
|
|
938
944
|
subscribe: e,
|
|
939
945
|
set: t
|
|
940
946
|
};
|
|
941
|
-
},
|
|
947
|
+
}, to = (e, t, n, o) => {
|
|
942
948
|
const { store: i, selection: s, hover: r, viewport: l } = e, a = /* @__PURE__ */ new Map();
|
|
943
949
|
let c = [], u, f;
|
|
944
950
|
const d = (p, A) => {
|
|
@@ -1005,12 +1011,12 @@ const Qn = 250, Zn = (e) => {
|
|
|
1005
1011
|
_.length > 0 && (c = c.map((E) => _.find((V) => V.id === E.id) || E));
|
|
1006
1012
|
}
|
|
1007
1013
|
}, { origin: H.REMOTE });
|
|
1008
|
-
const
|
|
1014
|
+
const w = (p) => (A) => {
|
|
1009
1015
|
const { updated: _ } = A;
|
|
1010
1016
|
p ? (_ || []).forEach((E) => m("updateAnnotation", E.oldValue, E.newValue)) : (_ || []).forEach((E) => m("updateAnnotation", E.newValue, E.oldValue));
|
|
1011
1017
|
};
|
|
1012
|
-
return t.on("undo",
|
|
1013
|
-
},
|
|
1018
|
+
return t.on("undo", w(!0)), t.on("redo", w(!1)), { on: d, off: g, emit: m };
|
|
1019
|
+
}, no = (e) => (t) => t.reduce((n, o) => {
|
|
1014
1020
|
const { parsed: i, error: s } = e.parse(o);
|
|
1015
1021
|
return s ? {
|
|
1016
1022
|
parsed: n.parsed,
|
|
@@ -1021,45 +1027,45 @@ const Qn = 250, Zn = (e) => {
|
|
|
1021
1027
|
} : {
|
|
1022
1028
|
...n
|
|
1023
1029
|
};
|
|
1024
|
-
}, { parsed: [], failed: [] }),
|
|
1025
|
-
const { store: o, selection: i } = e, s = (
|
|
1030
|
+
}, { parsed: [], failed: [] }), oo = (e, t, n) => {
|
|
1031
|
+
const { store: o, selection: i } = e, s = (w) => {
|
|
1026
1032
|
if (n) {
|
|
1027
|
-
const { parsed: p, error: A } = n.parse(
|
|
1033
|
+
const { parsed: p, error: A } = n.parse(w);
|
|
1028
1034
|
p ? o.addAnnotation(p, H.REMOTE) : console.error(A);
|
|
1029
1035
|
} else
|
|
1030
|
-
o.addAnnotation(
|
|
1031
|
-
}, r = () => i.clear(), l = () => o.clear(), a = (
|
|
1032
|
-
const p = o.getAnnotation(
|
|
1036
|
+
o.addAnnotation(w, H.REMOTE);
|
|
1037
|
+
}, r = () => i.clear(), l = () => o.clear(), a = (w) => {
|
|
1038
|
+
const p = o.getAnnotation(w);
|
|
1033
1039
|
return n && p ? n.serialize(p) : p;
|
|
1034
1040
|
}, c = () => n ? o.all().map(n.serialize) : o.all(), u = () => {
|
|
1035
|
-
var
|
|
1036
|
-
const p = (((
|
|
1041
|
+
var w;
|
|
1042
|
+
const p = (((w = i.selected) == null ? void 0 : w.map((A) => A.id)) || []).map((A) => o.getAnnotation(A)).filter(Boolean);
|
|
1037
1043
|
return n ? p.map(n.serialize) : p;
|
|
1038
|
-
}, f = (
|
|
1039
|
-
if (typeof
|
|
1040
|
-
const p = o.getAnnotation(
|
|
1041
|
-
if (o.deleteAnnotation(
|
|
1044
|
+
}, f = (w, p = !0) => fetch(w).then((A) => A.json()).then((A) => (g(A, p), A)), d = (w) => {
|
|
1045
|
+
if (typeof w == "string") {
|
|
1046
|
+
const p = o.getAnnotation(w);
|
|
1047
|
+
if (o.deleteAnnotation(w), p)
|
|
1042
1048
|
return n ? n.serialize(p) : p;
|
|
1043
1049
|
} else {
|
|
1044
|
-
const p = n ? n.parse(
|
|
1050
|
+
const p = n ? n.parse(w).parsed : w;
|
|
1045
1051
|
if (p)
|
|
1046
|
-
return o.deleteAnnotation(p),
|
|
1052
|
+
return o.deleteAnnotation(p), w;
|
|
1047
1053
|
}
|
|
1048
|
-
}, g = (
|
|
1054
|
+
}, g = (w, p = !0) => {
|
|
1049
1055
|
if (n) {
|
|
1050
|
-
const { parsed: A, failed: _ } =
|
|
1056
|
+
const { parsed: A, failed: _ } = no(n)(w);
|
|
1051
1057
|
_.length > 0 && console.warn(`Discarded ${_.length} invalid annotations`, _), o.bulkAddAnnotation(A, p, H.REMOTE);
|
|
1052
1058
|
} else
|
|
1053
|
-
o.bulkAddAnnotation(
|
|
1054
|
-
}, m = (
|
|
1055
|
-
|
|
1056
|
-
}, y = (
|
|
1059
|
+
o.bulkAddAnnotation(w, p, H.REMOTE);
|
|
1060
|
+
}, m = (w, p) => {
|
|
1061
|
+
w ? i.setSelected(w, p) : i.clear();
|
|
1062
|
+
}, y = (w) => {
|
|
1057
1063
|
if (n) {
|
|
1058
|
-
const p = n.parse(
|
|
1064
|
+
const p = n.parse(w).parsed, A = n.serialize(o.getAnnotation(p.id));
|
|
1059
1065
|
return o.updateAnnotation(p), A;
|
|
1060
1066
|
} else {
|
|
1061
|
-
const p = o.getAnnotation(
|
|
1062
|
-
return o.updateAnnotation(
|
|
1067
|
+
const p = o.getAnnotation(w.id);
|
|
1068
|
+
return o.updateAnnotation(w), p;
|
|
1063
1069
|
}
|
|
1064
1070
|
};
|
|
1065
1071
|
return {
|
|
@@ -1079,8 +1085,8 @@ const Qn = 250, Zn = (e) => {
|
|
|
1079
1085
|
undo: t.undo,
|
|
1080
1086
|
updateAnnotation: y
|
|
1081
1087
|
};
|
|
1082
|
-
},
|
|
1083
|
-
let
|
|
1088
|
+
}, io = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1089
|
+
let so = (e) => crypto.getRandomValues(new Uint8Array(e)), ro = (e, t, n) => {
|
|
1084
1090
|
let o = (2 << Math.log(e.length - 1) / Math.LN2) - 1, i = -~(1.6 * o * t / e.length);
|
|
1085
1091
|
return (s = t) => {
|
|
1086
1092
|
let r = "";
|
|
@@ -1091,13 +1097,13 @@ let oo = (e) => crypto.getRandomValues(new Uint8Array(e)), io = (e, t, n) => {
|
|
|
1091
1097
|
return r;
|
|
1092
1098
|
}
|
|
1093
1099
|
};
|
|
1094
|
-
},
|
|
1100
|
+
}, lo = (e, t = 21) => ro(e, t, so), ao = (e = 21) => {
|
|
1095
1101
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e));
|
|
1096
1102
|
for (; e--; )
|
|
1097
|
-
t +=
|
|
1103
|
+
t += io[n[e] & 63];
|
|
1098
1104
|
return t;
|
|
1099
1105
|
};
|
|
1100
|
-
const
|
|
1106
|
+
const co = () => ({ isGuest: !0, id: lo("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", 20)() }), fo = (e) => {
|
|
1101
1107
|
const t = JSON.stringify(e);
|
|
1102
1108
|
let n = 0;
|
|
1103
1109
|
for (let o = 0, i = t.length; o < i; o++) {
|
|
@@ -1105,20 +1111,20 @@ const lo = () => ({ isGuest: !0, id: so("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1105
1111
|
n = (n << 5) - n + s, n |= 0;
|
|
1106
1112
|
}
|
|
1107
1113
|
return `${n}`;
|
|
1108
|
-
},
|
|
1114
|
+
}, xt = (e) => e ? typeof e == "object" ? { ...e } : e : void 0, uo = (e, t) => (Array.isArray(e) ? e : [e]).map((n) => {
|
|
1109
1115
|
const { id: o, type: i, purpose: s, value: r, created: l, modified: a, creator: c, ...u } = n;
|
|
1110
1116
|
return {
|
|
1111
|
-
id: o || `temp-${
|
|
1117
|
+
id: o || `temp-${fo(n)}`,
|
|
1112
1118
|
annotation: t,
|
|
1113
1119
|
type: i,
|
|
1114
1120
|
purpose: s,
|
|
1115
1121
|
value: r,
|
|
1116
|
-
creator:
|
|
1122
|
+
creator: xt(c),
|
|
1117
1123
|
created: l ? new Date(l) : void 0,
|
|
1118
1124
|
updated: a ? new Date(a) : void 0,
|
|
1119
1125
|
...u
|
|
1120
1126
|
};
|
|
1121
|
-
}),
|
|
1127
|
+
}), ho = (e) => e.map((t) => {
|
|
1122
1128
|
var n;
|
|
1123
1129
|
const { annotation: o, created: i, updated: s, ...r } = t, l = {
|
|
1124
1130
|
...r,
|
|
@@ -1127,15 +1133,15 @@ const lo = () => ({ isGuest: !0, id: so("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1127
1133
|
};
|
|
1128
1134
|
return (n = l.id) != null && n.startsWith("temp-") && delete l.id, l;
|
|
1129
1135
|
});
|
|
1130
|
-
|
|
1131
|
-
const
|
|
1132
|
-
const n = e.id ||
|
|
1136
|
+
ao();
|
|
1137
|
+
const Ci = (e, t = !1) => ({ parse: (i) => go(i, t), serialize: (i) => mo(i, e) }), go = (e, t = !1) => {
|
|
1138
|
+
const n = e.id || Jt(), {
|
|
1133
1139
|
creator: o,
|
|
1134
1140
|
created: i,
|
|
1135
1141
|
modified: s,
|
|
1136
1142
|
body: r,
|
|
1137
1143
|
...l
|
|
1138
|
-
} = e, a =
|
|
1144
|
+
} = e, a = uo(r, n), c = Array.isArray(e.target) ? e.target[0] : e.target, u = Array.isArray(c.selector) ? c.selector[0] : c.selector, f = (u == null ? void 0 : u.type) === "FragmentSelector" ? Mn(u, t) : (u == null ? void 0 : u.type) === "SvgSelector" ? Pn(u) : void 0;
|
|
1139
1145
|
return f ? {
|
|
1140
1146
|
parsed: {
|
|
1141
1147
|
...l,
|
|
@@ -1143,7 +1149,7 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1143
1149
|
bodies: a,
|
|
1144
1150
|
target: {
|
|
1145
1151
|
created: i ? new Date(i) : void 0,
|
|
1146
|
-
creator:
|
|
1152
|
+
creator: xt(o),
|
|
1147
1153
|
updated: s ? new Date(s) : void 0,
|
|
1148
1154
|
...Array.isArray(l.target) ? l.target[0] : l.target,
|
|
1149
1155
|
annotation: n,
|
|
@@ -1153,7 +1159,7 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1153
1159
|
} : {
|
|
1154
1160
|
error: Error(`Invalid selector: ${JSON.stringify(u)}`)
|
|
1155
1161
|
};
|
|
1156
|
-
},
|
|
1162
|
+
}, mo = (e, t) => {
|
|
1157
1163
|
const {
|
|
1158
1164
|
selector: n,
|
|
1159
1165
|
creator: o,
|
|
@@ -1162,12 +1168,12 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1162
1168
|
updatedBy: r,
|
|
1163
1169
|
// Excluded from serialization
|
|
1164
1170
|
...l
|
|
1165
|
-
} = e.target, a = n.type == q.RECTANGLE ?
|
|
1171
|
+
} = e.target, a = n.type == q.RECTANGLE ? Ln(n.geometry) : Yn(n), c = {
|
|
1166
1172
|
...e,
|
|
1167
1173
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1168
1174
|
id: e.id,
|
|
1169
1175
|
type: "Annotation",
|
|
1170
|
-
body:
|
|
1176
|
+
body: ho(e.bodies),
|
|
1171
1177
|
created: i == null ? void 0 : i.toISOString(),
|
|
1172
1178
|
creator: o,
|
|
1173
1179
|
modified: s == null ? void 0 : s.toISOString(),
|
|
@@ -1179,11 +1185,11 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1179
1185
|
};
|
|
1180
1186
|
return delete c.bodies, "annotation" in c.target && delete c.target.annotation, c;
|
|
1181
1187
|
};
|
|
1182
|
-
function
|
|
1188
|
+
function At(e, t, n) {
|
|
1183
1189
|
const o = e.slice();
|
|
1184
1190
|
return o[10] = t[n], o[12] = n, o;
|
|
1185
1191
|
}
|
|
1186
|
-
function
|
|
1192
|
+
function St(e) {
|
|
1187
1193
|
let t, n;
|
|
1188
1194
|
return t = new ke({
|
|
1189
1195
|
props: {
|
|
@@ -1229,43 +1235,43 @@ function bt(e) {
|
|
|
1229
1235
|
n || (I(t.$$.fragment, o), n = !0);
|
|
1230
1236
|
},
|
|
1231
1237
|
o(o) {
|
|
1232
|
-
|
|
1238
|
+
C(t.$$.fragment, o), n = !1;
|
|
1233
1239
|
},
|
|
1234
1240
|
d(o) {
|
|
1235
1241
|
ee(t, o);
|
|
1236
1242
|
}
|
|
1237
1243
|
};
|
|
1238
1244
|
}
|
|
1239
|
-
function
|
|
1245
|
+
function po(e) {
|
|
1240
1246
|
let t, n, o, i, s, r, l, a, c, u, f, d = Se(
|
|
1241
1247
|
/*geom*/
|
|
1242
1248
|
e[4].points
|
|
1243
1249
|
), g = [];
|
|
1244
1250
|
for (let y = 0; y < d.length; y += 1)
|
|
1245
|
-
g[y] =
|
|
1246
|
-
const m = (y) =>
|
|
1251
|
+
g[y] = St(At(e, d, y));
|
|
1252
|
+
const m = (y) => C(g[y], 1, 1, () => {
|
|
1247
1253
|
g[y] = null;
|
|
1248
1254
|
});
|
|
1249
1255
|
return {
|
|
1250
1256
|
c() {
|
|
1251
|
-
t =
|
|
1257
|
+
t = X("polygon"), i = ie(), s = X("polygon"), l = ie();
|
|
1252
1258
|
for (let y = 0; y < g.length; y += 1)
|
|
1253
1259
|
g[y].c();
|
|
1254
1260
|
a = fe(), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1255
1261
|
e[1] ? "display:none;" : void 0), h(t, "points", o = /*geom*/
|
|
1256
|
-
e[4].points.map(
|
|
1262
|
+
e[4].points.map(Tt).join(" ")), h(s, "class", "a9s-inner a9s-shape-handle"), h(
|
|
1257
1263
|
s,
|
|
1258
1264
|
"style",
|
|
1259
1265
|
/*computedStyle*/
|
|
1260
1266
|
e[1]
|
|
1261
1267
|
), h(s, "points", r = /*geom*/
|
|
1262
|
-
e[4].points.map(
|
|
1268
|
+
e[4].points.map(vt).join(" "));
|
|
1263
1269
|
},
|
|
1264
|
-
m(y,
|
|
1265
|
-
O(y, t,
|
|
1270
|
+
m(y, w) {
|
|
1271
|
+
O(y, t, w), O(y, i, w), O(y, s, w), O(y, l, w);
|
|
1266
1272
|
for (let p = 0; p < g.length; p += 1)
|
|
1267
|
-
g[p] && g[p].m(y,
|
|
1268
|
-
O(y, a,
|
|
1273
|
+
g[p] && g[p].m(y, w);
|
|
1274
|
+
O(y, a, w), c = !0, u || (f = [
|
|
1269
1275
|
j(t, "pointerdown", function() {
|
|
1270
1276
|
K(
|
|
1271
1277
|
/*grab*/
|
|
@@ -1280,20 +1286,20 @@ function go(e) {
|
|
|
1280
1286
|
})
|
|
1281
1287
|
], u = !0);
|
|
1282
1288
|
},
|
|
1283
|
-
p(y,
|
|
1284
|
-
if (e = y, (!c ||
|
|
1289
|
+
p(y, w) {
|
|
1290
|
+
if (e = y, (!c || w & /*computedStyle*/
|
|
1285
1291
|
2 && n !== (n = /*computedStyle*/
|
|
1286
|
-
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!c ||
|
|
1292
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!c || w & /*geom*/
|
|
1287
1293
|
16 && o !== (o = /*geom*/
|
|
1288
|
-
e[4].points.map(
|
|
1294
|
+
e[4].points.map(Tt).join(" "))) && h(t, "points", o), (!c || w & /*computedStyle*/
|
|
1289
1295
|
2) && h(
|
|
1290
1296
|
s,
|
|
1291
1297
|
"style",
|
|
1292
1298
|
/*computedStyle*/
|
|
1293
1299
|
e[1]
|
|
1294
|
-
), (!c ||
|
|
1300
|
+
), (!c || w & /*geom*/
|
|
1295
1301
|
16 && r !== (r = /*geom*/
|
|
1296
|
-
e[4].points.map(
|
|
1302
|
+
e[4].points.map(vt).join(" "))) && h(s, "points", r), w & /*geom, viewportScale, grab*/
|
|
1297
1303
|
536) {
|
|
1298
1304
|
d = Se(
|
|
1299
1305
|
/*geom*/
|
|
@@ -1301,8 +1307,8 @@ function go(e) {
|
|
|
1301
1307
|
);
|
|
1302
1308
|
let p;
|
|
1303
1309
|
for (p = 0; p < d.length; p += 1) {
|
|
1304
|
-
const A =
|
|
1305
|
-
g[p] ? (g[p].p(A,
|
|
1310
|
+
const A = At(e, d, p);
|
|
1311
|
+
g[p] ? (g[p].p(A, w), I(g[p], 1)) : (g[p] = St(A), g[p].c(), I(g[p], 1), g[p].m(a.parentNode, a));
|
|
1306
1312
|
}
|
|
1307
1313
|
for (le(), p = d.length; p < g.length; p += 1)
|
|
1308
1314
|
m(p);
|
|
@@ -1311,25 +1317,25 @@ function go(e) {
|
|
|
1311
1317
|
},
|
|
1312
1318
|
i(y) {
|
|
1313
1319
|
if (!c) {
|
|
1314
|
-
for (let
|
|
1315
|
-
I(g[
|
|
1320
|
+
for (let w = 0; w < d.length; w += 1)
|
|
1321
|
+
I(g[w]);
|
|
1316
1322
|
c = !0;
|
|
1317
1323
|
}
|
|
1318
1324
|
},
|
|
1319
1325
|
o(y) {
|
|
1320
1326
|
g = g.filter(Boolean);
|
|
1321
|
-
for (let
|
|
1322
|
-
|
|
1327
|
+
for (let w = 0; w < g.length; w += 1)
|
|
1328
|
+
C(g[w]);
|
|
1323
1329
|
c = !1;
|
|
1324
1330
|
},
|
|
1325
1331
|
d(y) {
|
|
1326
|
-
y && (k(t), k(i), k(s), k(l), k(a)),
|
|
1332
|
+
y && (k(t), k(i), k(s), k(l), k(a)), at(g, y), u = !1, ce(f);
|
|
1327
1333
|
}
|
|
1328
1334
|
};
|
|
1329
1335
|
}
|
|
1330
|
-
function
|
|
1336
|
+
function yo(e) {
|
|
1331
1337
|
let t, n;
|
|
1332
|
-
return t = new
|
|
1338
|
+
return t = new en({
|
|
1333
1339
|
props: {
|
|
1334
1340
|
shape: (
|
|
1335
1341
|
/*shape*/
|
|
@@ -1345,7 +1351,7 @@ function mo(e) {
|
|
|
1345
1351
|
),
|
|
1346
1352
|
$$slots: {
|
|
1347
1353
|
default: [
|
|
1348
|
-
|
|
1354
|
+
po,
|
|
1349
1355
|
({ grab: o }) => ({ 9: o }),
|
|
1350
1356
|
({ grab: o }) => o ? 512 : 0
|
|
1351
1357
|
]
|
|
@@ -1384,20 +1390,20 @@ function mo(e) {
|
|
|
1384
1390
|
n || (I(t.$$.fragment, o), n = !0);
|
|
1385
1391
|
},
|
|
1386
1392
|
o(o) {
|
|
1387
|
-
|
|
1393
|
+
C(t.$$.fragment, o), n = !1;
|
|
1388
1394
|
},
|
|
1389
1395
|
d(o) {
|
|
1390
1396
|
ee(t, o);
|
|
1391
1397
|
}
|
|
1392
1398
|
};
|
|
1393
1399
|
}
|
|
1394
|
-
const
|
|
1395
|
-
function
|
|
1400
|
+
const Tt = (e) => e.join(","), vt = (e) => e.join(",");
|
|
1401
|
+
function _o(e, t, n) {
|
|
1396
1402
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1397
1403
|
const a = (d, g, m) => {
|
|
1398
1404
|
let y;
|
|
1399
|
-
const
|
|
1400
|
-
g === "SHAPE" ? y =
|
|
1405
|
+
const w = d.geometry;
|
|
1406
|
+
g === "SHAPE" ? y = w.points.map(([A, _]) => [A + m[0], _ + m[1]]) : y = w.points.map(([A, _], E) => g === `HANDLE-${E}` ? [A + m[0], _ + m[1]] : [A, _]);
|
|
1401
1407
|
const p = Fe(y);
|
|
1402
1408
|
return { ...d, geometry: { points: y, bounds: p } };
|
|
1403
1409
|
};
|
|
@@ -1427,9 +1433,9 @@ function po(e, t, n) {
|
|
|
1427
1433
|
f
|
|
1428
1434
|
];
|
|
1429
1435
|
}
|
|
1430
|
-
class
|
|
1436
|
+
class wo extends oe {
|
|
1431
1437
|
constructor(t) {
|
|
1432
|
-
super(), ne(this, t,
|
|
1438
|
+
super(), ne(this, t, _o, yo, J, {
|
|
1433
1439
|
shape: 0,
|
|
1434
1440
|
computedStyle: 1,
|
|
1435
1441
|
transform: 2,
|
|
@@ -1437,11 +1443,11 @@ class yo extends oe {
|
|
|
1437
1443
|
});
|
|
1438
1444
|
}
|
|
1439
1445
|
}
|
|
1440
|
-
const
|
|
1446
|
+
const $e = (e, t) => {
|
|
1441
1447
|
const n = Math.abs(t[0] - e[0]), o = Math.abs(t[1] - e[1]);
|
|
1442
1448
|
return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
|
|
1443
1449
|
}, ye = [];
|
|
1444
|
-
function
|
|
1450
|
+
function bo(e, t = F) {
|
|
1445
1451
|
let n;
|
|
1446
1452
|
const o = /* @__PURE__ */ new Set();
|
|
1447
1453
|
function i(l) {
|
|
@@ -1467,7 +1473,7 @@ function _o(e, t = F) {
|
|
|
1467
1473
|
}
|
|
1468
1474
|
return { set: i, update: s, subscribe: r };
|
|
1469
1475
|
}
|
|
1470
|
-
const
|
|
1476
|
+
const Eo = (e, t) => {
|
|
1471
1477
|
const { naturalWidth: n, naturalHeight: o } = e;
|
|
1472
1478
|
if (!n && !o) {
|
|
1473
1479
|
const { width: i, height: s } = e;
|
|
@@ -1477,9 +1483,9 @@ const wo = (e, t) => {
|
|
|
1477
1483
|
});
|
|
1478
1484
|
} else
|
|
1479
1485
|
t.setAttribute("viewBox", `0 0 ${n} ${o}`);
|
|
1480
|
-
},
|
|
1481
|
-
|
|
1482
|
-
const { subscribe: n, set: o } =
|
|
1486
|
+
}, Ao = (e, t) => {
|
|
1487
|
+
Eo(e, t);
|
|
1488
|
+
const { subscribe: n, set: o } = bo(1);
|
|
1483
1489
|
let i;
|
|
1484
1490
|
return window.ResizeObserver && (i = new ResizeObserver(() => {
|
|
1485
1491
|
const r = t.getBoundingClientRect(), { width: l, height: a } = t.viewBox.baseVal, c = Math.max(
|
|
@@ -1490,12 +1496,12 @@ const wo = (e, t) => {
|
|
|
1490
1496
|
}), i.observe(t.parentElement)), { destroy: () => {
|
|
1491
1497
|
i && i.disconnect();
|
|
1492
1498
|
}, subscribe: n };
|
|
1493
|
-
},
|
|
1494
|
-
function
|
|
1499
|
+
}, So = "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
1500
|
+
function To(e) {
|
|
1495
1501
|
let t, n, o, i, s, r;
|
|
1496
1502
|
return {
|
|
1497
1503
|
c() {
|
|
1498
|
-
t =
|
|
1504
|
+
t = X("rect"), h(t, "class", n = ze(`a9s-handle ${/*$$props*/
|
|
1499
1505
|
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), h(t, "x", o = /*x*/
|
|
1500
1506
|
e[0] - /*handleSize*/
|
|
1501
1507
|
e[5] / 2), h(t, "y", i = /*y*/
|
|
@@ -1548,11 +1554,11 @@ function Ao(e) {
|
|
|
1548
1554
|
}
|
|
1549
1555
|
};
|
|
1550
1556
|
}
|
|
1551
|
-
function
|
|
1557
|
+
function vo(e) {
|
|
1552
1558
|
let t, n, o, i, s, r, l, a, c;
|
|
1553
1559
|
return {
|
|
1554
1560
|
c() {
|
|
1555
|
-
t =
|
|
1561
|
+
t = X("g"), n = X("circle"), i = X("rect"), h(
|
|
1556
1562
|
n,
|
|
1557
1563
|
"cx",
|
|
1558
1564
|
/*x*/
|
|
@@ -1675,10 +1681,10 @@ function So(e) {
|
|
|
1675
1681
|
}
|
|
1676
1682
|
};
|
|
1677
1683
|
}
|
|
1678
|
-
function
|
|
1684
|
+
function Mo(e) {
|
|
1679
1685
|
let t;
|
|
1680
1686
|
function n(s, r) {
|
|
1681
|
-
return
|
|
1687
|
+
return So ? vo : To;
|
|
1682
1688
|
}
|
|
1683
1689
|
let i = n()(e);
|
|
1684
1690
|
return {
|
|
@@ -1698,7 +1704,7 @@ function To(e) {
|
|
|
1698
1704
|
}
|
|
1699
1705
|
};
|
|
1700
1706
|
}
|
|
1701
|
-
function
|
|
1707
|
+
function Lo(e, t, n) {
|
|
1702
1708
|
let o, { x: i } = t, { y: s } = t, { scale: r } = t, { radius: l = 30 } = t, a = !1;
|
|
1703
1709
|
const c = (m) => {
|
|
1704
1710
|
m.pointerType === "touch" && n(4, a = !0);
|
|
@@ -1713,11 +1719,11 @@ function Mo(e, t, n) {
|
|
|
1713
1719
|
de.call(this, e, m);
|
|
1714
1720
|
}
|
|
1715
1721
|
return e.$$set = (m) => {
|
|
1716
|
-
n(8, t =
|
|
1722
|
+
n(8, t = it(it({}, t), pt(m))), "x" in m && n(0, i = m.x), "y" in m && n(1, s = m.y), "scale" in m && n(2, r = m.scale), "radius" in m && n(3, l = m.radius);
|
|
1717
1723
|
}, e.$$.update = () => {
|
|
1718
1724
|
e.$$.dirty & /*scale*/
|
|
1719
1725
|
4 && n(5, o = 10 / r);
|
|
1720
|
-
}, t =
|
|
1726
|
+
}, t = pt(t), [
|
|
1721
1727
|
i,
|
|
1722
1728
|
s,
|
|
1723
1729
|
r,
|
|
@@ -1734,11 +1740,11 @@ function Mo(e, t, n) {
|
|
|
1734
1740
|
}
|
|
1735
1741
|
class ke extends oe {
|
|
1736
1742
|
constructor(t) {
|
|
1737
|
-
super(), ne(this, t,
|
|
1743
|
+
super(), ne(this, t, Lo, Mo, J, { x: 0, y: 1, scale: 2, radius: 3 });
|
|
1738
1744
|
}
|
|
1739
1745
|
}
|
|
1740
|
-
function
|
|
1741
|
-
let t, n, o, i, s, r, l, a, c, u, f, d, g, m, y,
|
|
1746
|
+
function ko(e) {
|
|
1747
|
+
let t, n, o, i, s, r, l, a, c, u, f, d, g, m, y, w, p, A, _, E, B, V, U, R, Y, b, S, T, v, P, G, x, ve, se, Me, L, Q, z, ue, Z, N, qe, ht;
|
|
1742
1748
|
return se = new ke({
|
|
1743
1749
|
props: {
|
|
1744
1750
|
class: "a9s-corner-handle-topleft",
|
|
@@ -1829,7 +1835,7 @@ function vo(e) {
|
|
|
1829
1835
|
) && e[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
1830
1836
|
}), {
|
|
1831
1837
|
c() {
|
|
1832
|
-
t =
|
|
1838
|
+
t = X("rect"), l = ie(), a = X("rect"), g = ie(), m = X("rect"), A = ie(), _ = X("rect"), U = ie(), R = X("rect"), T = ie(), v = X("rect"), ve = ie(), te(se.$$.fragment), Me = ie(), te(L.$$.fragment), Q = ie(), te(z.$$.fragment), ue = ie(), te(Z.$$.fragment), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1833
1839
|
e[1] ? "display:none;" : void 0), h(t, "x", o = /*geom*/
|
|
1834
1840
|
e[4].x), h(t, "y", i = /*geom*/
|
|
1835
1841
|
e[4].y), h(t, "width", s = /*geom*/
|
|
@@ -1844,23 +1850,23 @@ function vo(e) {
|
|
|
1844
1850
|
e[4].y), h(a, "width", f = /*geom*/
|
|
1845
1851
|
e[4].w), h(a, "height", d = /*geom*/
|
|
1846
1852
|
e[4].h), h(m, "class", "a9s-edge-handle a9s-edge-handle-top"), h(m, "x", y = /*geom*/
|
|
1847
|
-
e[4].x), h(m, "y",
|
|
1853
|
+
e[4].x), h(m, "y", w = /*geom*/
|
|
1848
1854
|
e[4].y), h(m, "height", 1), h(m, "width", p = /*geom*/
|
|
1849
1855
|
e[4].w), h(_, "class", "a9s-edge-handle a9s-edge-handle-right"), h(_, "x", E = /*geom*/
|
|
1850
1856
|
e[4].x + /*geom*/
|
|
1851
1857
|
e[4].w), h(_, "y", B = /*geom*/
|
|
1852
1858
|
e[4].y), h(_, "height", V = /*geom*/
|
|
1853
1859
|
e[4].h), h(_, "width", 1), h(R, "class", "a9s-edge-handle a9s-edge-handle-bottom"), h(R, "x", Y = /*geom*/
|
|
1854
|
-
e[4].x), h(R, "y",
|
|
1860
|
+
e[4].x), h(R, "y", b = /*geom*/
|
|
1855
1861
|
e[4].y + /*geom*/
|
|
1856
1862
|
e[4].h), h(R, "height", 1), h(R, "width", S = /*geom*/
|
|
1857
|
-
e[4].w), h(
|
|
1858
|
-
e[4].x), h(
|
|
1859
|
-
e[4].y), h(
|
|
1860
|
-
e[4].h), h(
|
|
1863
|
+
e[4].w), h(v, "class", "a9s-edge-handle a9s-edge-handle-left"), h(v, "x", P = /*geom*/
|
|
1864
|
+
e[4].x), h(v, "y", G = /*geom*/
|
|
1865
|
+
e[4].y), h(v, "height", x = /*geom*/
|
|
1866
|
+
e[4].h), h(v, "width", 1);
|
|
1861
1867
|
},
|
|
1862
|
-
m(D,
|
|
1863
|
-
O(D, t,
|
|
1868
|
+
m(D, M) {
|
|
1869
|
+
O(D, t, M), O(D, l, M), O(D, a, M), O(D, g, M), O(D, m, M), O(D, A, M), O(D, _, M), O(D, U, M), O(D, R, M), O(D, T, M), O(D, v, M), O(D, ve, M), $(se, D, M), O(D, Me, M), $(L, D, M), O(D, Q, M), $(z, D, M), O(D, ue, M), $(Z, D, M), N = !0, qe || (ht = [
|
|
1864
1870
|
j(t, "pointerdown", function() {
|
|
1865
1871
|
K(
|
|
1866
1872
|
/*grab*/
|
|
@@ -1891,7 +1897,7 @@ function vo(e) {
|
|
|
1891
1897
|
e[9]("BOTTOM")
|
|
1892
1898
|
) && e[9]("BOTTOM").apply(this, arguments);
|
|
1893
1899
|
}),
|
|
1894
|
-
j(
|
|
1900
|
+
j(v, "pointerdown", function() {
|
|
1895
1901
|
K(
|
|
1896
1902
|
/*grab*/
|
|
1897
1903
|
e[9]("LEFT")
|
|
@@ -1899,92 +1905,92 @@ function vo(e) {
|
|
|
1899
1905
|
})
|
|
1900
1906
|
], qe = !0);
|
|
1901
1907
|
},
|
|
1902
|
-
p(D,
|
|
1903
|
-
e = D, (!N ||
|
|
1908
|
+
p(D, M) {
|
|
1909
|
+
e = D, (!N || M & /*computedStyle*/
|
|
1904
1910
|
2 && n !== (n = /*computedStyle*/
|
|
1905
|
-
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!N ||
|
|
1911
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!N || M & /*geom*/
|
|
1906
1912
|
16 && o !== (o = /*geom*/
|
|
1907
|
-
e[4].x)) && h(t, "x", o), (!N ||
|
|
1913
|
+
e[4].x)) && h(t, "x", o), (!N || M & /*geom*/
|
|
1908
1914
|
16 && i !== (i = /*geom*/
|
|
1909
|
-
e[4].y)) && h(t, "y", i), (!N ||
|
|
1915
|
+
e[4].y)) && h(t, "y", i), (!N || M & /*geom*/
|
|
1910
1916
|
16 && s !== (s = /*geom*/
|
|
1911
|
-
e[4].w)) && h(t, "width", s), (!N ||
|
|
1917
|
+
e[4].w)) && h(t, "width", s), (!N || M & /*geom*/
|
|
1912
1918
|
16 && r !== (r = /*geom*/
|
|
1913
|
-
e[4].h)) && h(t, "height", r), (!N ||
|
|
1919
|
+
e[4].h)) && h(t, "height", r), (!N || M & /*computedStyle*/
|
|
1914
1920
|
2) && h(
|
|
1915
1921
|
a,
|
|
1916
1922
|
"style",
|
|
1917
1923
|
/*computedStyle*/
|
|
1918
1924
|
e[1]
|
|
1919
|
-
), (!N ||
|
|
1925
|
+
), (!N || M & /*geom*/
|
|
1920
1926
|
16 && c !== (c = /*geom*/
|
|
1921
|
-
e[4].x)) && h(a, "x", c), (!N ||
|
|
1927
|
+
e[4].x)) && h(a, "x", c), (!N || M & /*geom*/
|
|
1922
1928
|
16 && u !== (u = /*geom*/
|
|
1923
|
-
e[4].y)) && h(a, "y", u), (!N ||
|
|
1929
|
+
e[4].y)) && h(a, "y", u), (!N || M & /*geom*/
|
|
1924
1930
|
16 && f !== (f = /*geom*/
|
|
1925
|
-
e[4].w)) && h(a, "width", f), (!N ||
|
|
1931
|
+
e[4].w)) && h(a, "width", f), (!N || M & /*geom*/
|
|
1926
1932
|
16 && d !== (d = /*geom*/
|
|
1927
|
-
e[4].h)) && h(a, "height", d), (!N ||
|
|
1933
|
+
e[4].h)) && h(a, "height", d), (!N || M & /*geom*/
|
|
1928
1934
|
16 && y !== (y = /*geom*/
|
|
1929
|
-
e[4].x)) && h(m, "x", y), (!N ||
|
|
1930
|
-
16 &&
|
|
1931
|
-
e[4].y)) && h(m, "y",
|
|
1935
|
+
e[4].x)) && h(m, "x", y), (!N || M & /*geom*/
|
|
1936
|
+
16 && w !== (w = /*geom*/
|
|
1937
|
+
e[4].y)) && h(m, "y", w), (!N || M & /*geom*/
|
|
1932
1938
|
16 && p !== (p = /*geom*/
|
|
1933
|
-
e[4].w)) && h(m, "width", p), (!N ||
|
|
1939
|
+
e[4].w)) && h(m, "width", p), (!N || M & /*geom*/
|
|
1934
1940
|
16 && E !== (E = /*geom*/
|
|
1935
1941
|
e[4].x + /*geom*/
|
|
1936
|
-
e[4].w)) && h(_, "x", E), (!N ||
|
|
1942
|
+
e[4].w)) && h(_, "x", E), (!N || M & /*geom*/
|
|
1937
1943
|
16 && B !== (B = /*geom*/
|
|
1938
|
-
e[4].y)) && h(_, "y", B), (!N ||
|
|
1944
|
+
e[4].y)) && h(_, "y", B), (!N || M & /*geom*/
|
|
1939
1945
|
16 && V !== (V = /*geom*/
|
|
1940
|
-
e[4].h)) && h(_, "height", V), (!N ||
|
|
1946
|
+
e[4].h)) && h(_, "height", V), (!N || M & /*geom*/
|
|
1941
1947
|
16 && Y !== (Y = /*geom*/
|
|
1942
|
-
e[4].x)) && h(R, "x", Y), (!N ||
|
|
1943
|
-
16 &&
|
|
1948
|
+
e[4].x)) && h(R, "x", Y), (!N || M & /*geom*/
|
|
1949
|
+
16 && b !== (b = /*geom*/
|
|
1944
1950
|
e[4].y + /*geom*/
|
|
1945
|
-
e[4].h)) && h(R, "y",
|
|
1951
|
+
e[4].h)) && h(R, "y", b), (!N || M & /*geom*/
|
|
1946
1952
|
16 && S !== (S = /*geom*/
|
|
1947
|
-
e[4].w)) && h(R, "width", S), (!N ||
|
|
1953
|
+
e[4].w)) && h(R, "width", S), (!N || M & /*geom*/
|
|
1948
1954
|
16 && P !== (P = /*geom*/
|
|
1949
|
-
e[4].x)) && h(
|
|
1955
|
+
e[4].x)) && h(v, "x", P), (!N || M & /*geom*/
|
|
1950
1956
|
16 && G !== (G = /*geom*/
|
|
1951
|
-
e[4].y)) && h(
|
|
1957
|
+
e[4].y)) && h(v, "y", G), (!N || M & /*geom*/
|
|
1952
1958
|
16 && x !== (x = /*geom*/
|
|
1953
|
-
e[4].h)) && h(
|
|
1959
|
+
e[4].h)) && h(v, "height", x);
|
|
1954
1960
|
const De = {};
|
|
1955
|
-
|
|
1961
|
+
M & /*geom*/
|
|
1956
1962
|
16 && (De.x = /*geom*/
|
|
1957
|
-
e[4].x),
|
|
1963
|
+
e[4].x), M & /*geom*/
|
|
1958
1964
|
16 && (De.y = /*geom*/
|
|
1959
|
-
e[4].y),
|
|
1965
|
+
e[4].y), M & /*viewportScale*/
|
|
1960
1966
|
8 && (De.scale = /*viewportScale*/
|
|
1961
1967
|
e[3]), se.$set(De);
|
|
1962
|
-
const Xe = {};
|
|
1963
|
-
v & /*geom*/
|
|
1964
|
-
16 && (Xe.x = /*geom*/
|
|
1965
|
-
e[4].x + /*geom*/
|
|
1966
|
-
e[4].w), v & /*geom*/
|
|
1967
|
-
16 && (Xe.y = /*geom*/
|
|
1968
|
-
e[4].y), v & /*viewportScale*/
|
|
1969
|
-
8 && (Xe.scale = /*viewportScale*/
|
|
1970
|
-
e[3]), L.$set(Xe);
|
|
1971
1968
|
const Ce = {};
|
|
1972
|
-
|
|
1969
|
+
M & /*geom*/
|
|
1973
1970
|
16 && (Ce.x = /*geom*/
|
|
1974
1971
|
e[4].x + /*geom*/
|
|
1975
|
-
e[4].w),
|
|
1972
|
+
e[4].w), M & /*geom*/
|
|
1976
1973
|
16 && (Ce.y = /*geom*/
|
|
1977
|
-
e[4].y
|
|
1978
|
-
e[4].h), v & /*viewportScale*/
|
|
1974
|
+
e[4].y), M & /*viewportScale*/
|
|
1979
1975
|
8 && (Ce.scale = /*viewportScale*/
|
|
1980
|
-
e[3]),
|
|
1976
|
+
e[3]), L.$set(Ce);
|
|
1977
|
+
const Xe = {};
|
|
1978
|
+
M & /*geom*/
|
|
1979
|
+
16 && (Xe.x = /*geom*/
|
|
1980
|
+
e[4].x + /*geom*/
|
|
1981
|
+
e[4].w), M & /*geom*/
|
|
1982
|
+
16 && (Xe.y = /*geom*/
|
|
1983
|
+
e[4].y + /*geom*/
|
|
1984
|
+
e[4].h), M & /*viewportScale*/
|
|
1985
|
+
8 && (Xe.scale = /*viewportScale*/
|
|
1986
|
+
e[3]), z.$set(Xe);
|
|
1981
1987
|
const Re = {};
|
|
1982
|
-
|
|
1988
|
+
M & /*geom*/
|
|
1983
1989
|
16 && (Re.x = /*geom*/
|
|
1984
|
-
e[4].x),
|
|
1990
|
+
e[4].x), M & /*geom*/
|
|
1985
1991
|
16 && (Re.y = /*geom*/
|
|
1986
1992
|
e[4].y + /*geom*/
|
|
1987
|
-
e[4].h),
|
|
1993
|
+
e[4].h), M & /*viewportScale*/
|
|
1988
1994
|
8 && (Re.scale = /*viewportScale*/
|
|
1989
1995
|
e[3]), Z.$set(Re);
|
|
1990
1996
|
},
|
|
@@ -1992,16 +1998,16 @@ function vo(e) {
|
|
|
1992
1998
|
N || (I(se.$$.fragment, D), I(L.$$.fragment, D), I(z.$$.fragment, D), I(Z.$$.fragment, D), N = !0);
|
|
1993
1999
|
},
|
|
1994
2000
|
o(D) {
|
|
1995
|
-
|
|
2001
|
+
C(se.$$.fragment, D), C(L.$$.fragment, D), C(z.$$.fragment, D), C(Z.$$.fragment, D), N = !1;
|
|
1996
2002
|
},
|
|
1997
2003
|
d(D) {
|
|
1998
|
-
D && (k(t), k(l), k(a), k(g), k(m), k(A), k(_), k(U), k(R), k(T), k(
|
|
2004
|
+
D && (k(t), k(l), k(a), k(g), k(m), k(A), k(_), k(U), k(R), k(T), k(v), k(ve), k(Me), k(Q), k(ue)), ee(se, D), ee(L, D), ee(z, D), ee(Z, D), qe = !1, ce(ht);
|
|
1999
2005
|
}
|
|
2000
2006
|
};
|
|
2001
2007
|
}
|
|
2002
|
-
function
|
|
2008
|
+
function Oo(e) {
|
|
2003
2009
|
let t, n;
|
|
2004
|
-
return t = new
|
|
2010
|
+
return t = new en({
|
|
2005
2011
|
props: {
|
|
2006
2012
|
shape: (
|
|
2007
2013
|
/*shape*/
|
|
@@ -2017,7 +2023,7 @@ function Lo(e) {
|
|
|
2017
2023
|
),
|
|
2018
2024
|
$$slots: {
|
|
2019
2025
|
default: [
|
|
2020
|
-
|
|
2026
|
+
ko,
|
|
2021
2027
|
({ grab: o }) => ({ 9: o }),
|
|
2022
2028
|
({ grab: o }) => o ? 512 : 0
|
|
2023
2029
|
]
|
|
@@ -2056,21 +2062,21 @@ function Lo(e) {
|
|
|
2056
2062
|
n || (I(t.$$.fragment, o), n = !0);
|
|
2057
2063
|
},
|
|
2058
2064
|
o(o) {
|
|
2059
|
-
|
|
2065
|
+
C(t.$$.fragment, o), n = !1;
|
|
2060
2066
|
},
|
|
2061
2067
|
d(o) {
|
|
2062
2068
|
ee(t, o);
|
|
2063
2069
|
}
|
|
2064
2070
|
};
|
|
2065
2071
|
}
|
|
2066
|
-
function
|
|
2072
|
+
function Bo(e, t, n) {
|
|
2067
2073
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
2068
2074
|
const a = (d, g, m) => {
|
|
2069
2075
|
const y = d.geometry.bounds;
|
|
2070
|
-
let [
|
|
2076
|
+
let [w, p] = [y.minX, y.minY], [A, _] = [y.maxX, y.maxY];
|
|
2071
2077
|
const [E, B] = m;
|
|
2072
2078
|
if (g === "SHAPE")
|
|
2073
|
-
|
|
2079
|
+
w += E, A += E, p += B, _ += B;
|
|
2074
2080
|
else {
|
|
2075
2081
|
switch (g) {
|
|
2076
2082
|
case "TOP":
|
|
@@ -2090,7 +2096,7 @@ function ko(e, t, n) {
|
|
|
2090
2096
|
case "LEFT":
|
|
2091
2097
|
case "TOP_LEFT":
|
|
2092
2098
|
case "BOTTOM_LEFT": {
|
|
2093
|
-
|
|
2099
|
+
w += E;
|
|
2094
2100
|
break;
|
|
2095
2101
|
}
|
|
2096
2102
|
case "RIGHT":
|
|
@@ -2101,7 +2107,7 @@ function ko(e, t, n) {
|
|
|
2101
2107
|
}
|
|
2102
2108
|
}
|
|
2103
2109
|
}
|
|
2104
|
-
const V = Math.min(
|
|
2110
|
+
const V = Math.min(w, A), U = Math.min(p, _), R = Math.abs(A - w), Y = Math.abs(_ - p);
|
|
2105
2111
|
return {
|
|
2106
2112
|
...d,
|
|
2107
2113
|
geometry: {
|
|
@@ -2144,9 +2150,9 @@ function ko(e, t, n) {
|
|
|
2144
2150
|
f
|
|
2145
2151
|
];
|
|
2146
2152
|
}
|
|
2147
|
-
class
|
|
2153
|
+
class Io extends oe {
|
|
2148
2154
|
constructor(t) {
|
|
2149
|
-
super(), ne(this, t,
|
|
2155
|
+
super(), ne(this, t, Bo, Oo, J, {
|
|
2150
2156
|
shape: 0,
|
|
2151
2157
|
computedStyle: 1,
|
|
2152
2158
|
transform: 2,
|
|
@@ -2154,28 +2160,28 @@ class Oo extends oe {
|
|
|
2154
2160
|
});
|
|
2155
2161
|
}
|
|
2156
2162
|
}
|
|
2157
|
-
const
|
|
2158
|
-
[q.RECTANGLE,
|
|
2159
|
-
[q.POLYGON,
|
|
2160
|
-
]),
|
|
2163
|
+
const $t = /* @__PURE__ */ new Map([
|
|
2164
|
+
[q.RECTANGLE, Io],
|
|
2165
|
+
[q.POLYGON, wo]
|
|
2166
|
+
]), Po = (e) => $t.get(e.type), Yo = (e, t) => $t.set(e, t), Do = (e) => ({}), Mt = (e) => ({ grab: (
|
|
2161
2167
|
/*onGrab*/
|
|
2162
2168
|
e[0]
|
|
2163
2169
|
) });
|
|
2164
|
-
function
|
|
2170
|
+
function Co(e) {
|
|
2165
2171
|
let t, n, o, i;
|
|
2166
2172
|
const s = (
|
|
2167
2173
|
/*#slots*/
|
|
2168
2174
|
e[7].default
|
|
2169
|
-
), r =
|
|
2175
|
+
), r = cn(
|
|
2170
2176
|
s,
|
|
2171
2177
|
e,
|
|
2172
2178
|
/*$$scope*/
|
|
2173
2179
|
e[6],
|
|
2174
|
-
|
|
2180
|
+
Mt
|
|
2175
2181
|
);
|
|
2176
2182
|
return {
|
|
2177
2183
|
c() {
|
|
2178
|
-
t =
|
|
2184
|
+
t = X("g"), r && r.c(), h(t, "class", "a9s-annotation selected");
|
|
2179
2185
|
},
|
|
2180
2186
|
m(l, a) {
|
|
2181
2187
|
O(l, t, a), r && r.m(t, null), n = !0, o || (i = [
|
|
@@ -2195,45 +2201,45 @@ function Yo(e) {
|
|
|
2195
2201
|
},
|
|
2196
2202
|
p(l, [a]) {
|
|
2197
2203
|
r && r.p && (!n || a & /*$$scope*/
|
|
2198
|
-
64) &&
|
|
2204
|
+
64) && un(
|
|
2199
2205
|
r,
|
|
2200
2206
|
s,
|
|
2201
2207
|
l,
|
|
2202
2208
|
/*$$scope*/
|
|
2203
2209
|
l[6],
|
|
2204
|
-
n ?
|
|
2210
|
+
n ? fn(
|
|
2205
2211
|
s,
|
|
2206
2212
|
/*$$scope*/
|
|
2207
2213
|
l[6],
|
|
2208
2214
|
a,
|
|
2209
|
-
|
|
2210
|
-
) :
|
|
2215
|
+
Do
|
|
2216
|
+
) : dn(
|
|
2211
2217
|
/*$$scope*/
|
|
2212
2218
|
l[6]
|
|
2213
2219
|
),
|
|
2214
|
-
|
|
2220
|
+
Mt
|
|
2215
2221
|
);
|
|
2216
2222
|
},
|
|
2217
2223
|
i(l) {
|
|
2218
2224
|
n || (I(r, l), n = !0);
|
|
2219
2225
|
},
|
|
2220
2226
|
o(l) {
|
|
2221
|
-
|
|
2227
|
+
C(r, l), n = !1;
|
|
2222
2228
|
},
|
|
2223
2229
|
d(l) {
|
|
2224
2230
|
l && k(t), r && r.d(l), o = !1, ce(i);
|
|
2225
2231
|
}
|
|
2226
2232
|
};
|
|
2227
2233
|
}
|
|
2228
|
-
function
|
|
2234
|
+
function Xo(e, t, n) {
|
|
2229
2235
|
let { $$slots: o = {}, $$scope: i } = t;
|
|
2230
2236
|
const s = Te();
|
|
2231
2237
|
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c, u, f;
|
|
2232
|
-
const d = (y) => (
|
|
2233
|
-
c = y, u = a.elementToImage(
|
|
2238
|
+
const d = (y) => (w) => {
|
|
2239
|
+
c = y, u = a.elementToImage(w.offsetX, w.offsetY), f = r, w.target.setPointerCapture(w.pointerId), s("grab", w);
|
|
2234
2240
|
}, g = (y) => {
|
|
2235
2241
|
if (c) {
|
|
2236
|
-
const [
|
|
2242
|
+
const [w, p] = a.elementToImage(y.offsetX, y.offsetY), A = [w - u[0], p - u[1]];
|
|
2237
2243
|
n(3, r = l(f, c, A)), s("change", r);
|
|
2238
2244
|
}
|
|
2239
2245
|
}, m = (y) => {
|
|
@@ -2243,9 +2249,9 @@ function Do(e, t, n) {
|
|
|
2243
2249
|
"shape" in y && n(3, r = y.shape), "editor" in y && n(4, l = y.editor), "transform" in y && n(5, a = y.transform), "$$scope" in y && n(6, i = y.$$scope);
|
|
2244
2250
|
}, [d, g, m, r, l, a, i, o];
|
|
2245
2251
|
}
|
|
2246
|
-
class
|
|
2252
|
+
class en extends oe {
|
|
2247
2253
|
constructor(t) {
|
|
2248
|
-
super(), ne(this, t,
|
|
2254
|
+
super(), ne(this, t, Xo, Co, J, { shape: 3, editor: 4, transform: 5 });
|
|
2249
2255
|
}
|
|
2250
2256
|
}
|
|
2251
2257
|
const je = (e, t) => {
|
|
@@ -2256,7 +2262,7 @@ const je = (e, t) => {
|
|
|
2256
2262
|
return o && (s += `fill:${o};stroke:${o};`), s += `fill-opacity:${i || "0.25"};`, s;
|
|
2257
2263
|
}
|
|
2258
2264
|
};
|
|
2259
|
-
function
|
|
2265
|
+
function Ro(e, t, n) {
|
|
2260
2266
|
let o;
|
|
2261
2267
|
const i = Te();
|
|
2262
2268
|
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale: u } = t, f;
|
|
@@ -2282,9 +2288,9 @@ function Xo(e, t, n) {
|
|
|
2282
2288
|
96 && f && f.$set({ viewportScale: u });
|
|
2283
2289
|
}, [s, r, l, a, c, u, f];
|
|
2284
2290
|
}
|
|
2285
|
-
class
|
|
2291
|
+
class No extends oe {
|
|
2286
2292
|
constructor(t) {
|
|
2287
|
-
super(), ne(this, t,
|
|
2293
|
+
super(), ne(this, t, Ro, null, J, {
|
|
2288
2294
|
annotation: 0,
|
|
2289
2295
|
editor: 1,
|
|
2290
2296
|
style: 2,
|
|
@@ -2294,7 +2300,7 @@ class Co extends oe {
|
|
|
2294
2300
|
});
|
|
2295
2301
|
}
|
|
2296
2302
|
}
|
|
2297
|
-
function
|
|
2303
|
+
function Uo(e, t, n) {
|
|
2298
2304
|
const o = Te();
|
|
2299
2305
|
let { drawingMode: i } = t, { target: s } = t, { tool: r } = t, { transform: l } = t, { viewportScale: a } = t, c;
|
|
2300
2306
|
return Ye(() => {
|
|
@@ -2320,9 +2326,9 @@ function Ro(e, t, n) {
|
|
|
2320
2326
|
48 && c && c.$set({ viewportScale: a });
|
|
2321
2327
|
}, [i, s, r, l, a, c];
|
|
2322
2328
|
}
|
|
2323
|
-
class
|
|
2329
|
+
class Vo extends oe {
|
|
2324
2330
|
constructor(t) {
|
|
2325
|
-
super(), ne(this, t,
|
|
2331
|
+
super(), ne(this, t, Uo, null, J, {
|
|
2326
2332
|
drawingMode: 0,
|
|
2327
2333
|
target: 1,
|
|
2328
2334
|
tool: 2,
|
|
@@ -2331,11 +2337,11 @@ class No extends oe {
|
|
|
2331
2337
|
});
|
|
2332
2338
|
}
|
|
2333
2339
|
}
|
|
2334
|
-
function
|
|
2340
|
+
function Lt(e) {
|
|
2335
2341
|
let t, n;
|
|
2336
2342
|
return {
|
|
2337
2343
|
c() {
|
|
2338
|
-
t =
|
|
2344
|
+
t = X("rect"), n = X("rect"), h(t, "class", "a9s-outer"), h(
|
|
2339
2345
|
t,
|
|
2340
2346
|
"x",
|
|
2341
2347
|
/*x*/
|
|
@@ -2436,21 +2442,21 @@ function Tt(e) {
|
|
|
2436
2442
|
}
|
|
2437
2443
|
};
|
|
2438
2444
|
}
|
|
2439
|
-
function
|
|
2445
|
+
function Go(e) {
|
|
2440
2446
|
let t, n = (
|
|
2441
2447
|
/*origin*/
|
|
2442
|
-
e[0] &&
|
|
2448
|
+
e[0] && Lt(e)
|
|
2443
2449
|
);
|
|
2444
2450
|
return {
|
|
2445
2451
|
c() {
|
|
2446
|
-
t =
|
|
2452
|
+
t = X("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2447
2453
|
},
|
|
2448
2454
|
m(o, i) {
|
|
2449
2455
|
O(o, t, i), n && n.m(t, null);
|
|
2450
2456
|
},
|
|
2451
2457
|
p(o, [i]) {
|
|
2452
2458
|
/*origin*/
|
|
2453
|
-
o[0] ? n ? n.p(o, i) : (n =
|
|
2459
|
+
o[0] ? n ? n.p(o, i) : (n = Lt(o), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2454
2460
|
},
|
|
2455
2461
|
i: F,
|
|
2456
2462
|
o: F,
|
|
@@ -2459,7 +2465,7 @@ function Uo(e) {
|
|
|
2459
2465
|
}
|
|
2460
2466
|
};
|
|
2461
2467
|
}
|
|
2462
|
-
function
|
|
2468
|
+
function zo(e, t, n) {
|
|
2463
2469
|
const o = Te();
|
|
2464
2470
|
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f, d, g;
|
|
2465
2471
|
const m = (A) => {
|
|
@@ -2468,7 +2474,7 @@ function Vo(e, t, n) {
|
|
|
2468
2474
|
}, y = (A) => {
|
|
2469
2475
|
const _ = A;
|
|
2470
2476
|
a && (c = r.elementToImage(_.offsetX, _.offsetY), n(1, u = Math.min(c[0], a[0])), n(2, f = Math.min(c[1], a[1])), n(3, d = Math.abs(c[0] - a[0])), n(4, g = Math.abs(c[1] - a[1])));
|
|
2471
|
-
},
|
|
2477
|
+
}, w = (A) => {
|
|
2472
2478
|
const _ = A, E = performance.now() - l;
|
|
2473
2479
|
if (s === "click") {
|
|
2474
2480
|
if (E > 300)
|
|
@@ -2498,21 +2504,21 @@ function Vo(e, t, n) {
|
|
|
2498
2504
|
n(0, a = void 0), c = void 0;
|
|
2499
2505
|
};
|
|
2500
2506
|
return Ye(() => {
|
|
2501
|
-
i("pointerdown", m), i("pointermove", y), i("pointerup",
|
|
2507
|
+
i("pointerdown", m), i("pointermove", y), i("pointerup", w, !0);
|
|
2502
2508
|
}), e.$$set = (A) => {
|
|
2503
2509
|
"addEventListener" in A && n(5, i = A.addEventListener), "drawingMode" in A && n(6, s = A.drawingMode), "transform" in A && n(7, r = A.transform);
|
|
2504
2510
|
}, [a, u, f, d, g, i, s, r];
|
|
2505
2511
|
}
|
|
2506
|
-
class
|
|
2512
|
+
class Ho extends oe {
|
|
2507
2513
|
constructor(t) {
|
|
2508
|
-
super(), ne(this, t,
|
|
2514
|
+
super(), ne(this, t, zo, Go, J, {
|
|
2509
2515
|
addEventListener: 5,
|
|
2510
2516
|
drawingMode: 6,
|
|
2511
2517
|
transform: 7
|
|
2512
2518
|
});
|
|
2513
2519
|
}
|
|
2514
2520
|
}
|
|
2515
|
-
function
|
|
2521
|
+
function et(e) {
|
|
2516
2522
|
const t = e.slice(), n = (
|
|
2517
2523
|
/*isClosable*/
|
|
2518
2524
|
(t[2] ? (
|
|
@@ -2527,14 +2533,14 @@ function xe(e) {
|
|
|
2527
2533
|
);
|
|
2528
2534
|
return t[16] = n, t;
|
|
2529
2535
|
}
|
|
2530
|
-
function
|
|
2536
|
+
function kt(e) {
|
|
2531
2537
|
let t, n, o, i, s, r = (
|
|
2532
2538
|
/*isClosable*/
|
|
2533
|
-
e[2] &&
|
|
2539
|
+
e[2] && Ot(e)
|
|
2534
2540
|
);
|
|
2535
2541
|
return {
|
|
2536
2542
|
c() {
|
|
2537
|
-
t =
|
|
2543
|
+
t = X("polygon"), o = X("polygon"), r && r.c(), s = fe(), h(t, "class", "a9s-outer"), h(t, "points", n = /*coords*/
|
|
2538
2544
|
e[16]), h(o, "class", "a9s-inner"), h(o, "points", i = /*coords*/
|
|
2539
2545
|
e[16]);
|
|
2540
2546
|
},
|
|
@@ -2547,18 +2553,18 @@ function Mt(e) {
|
|
|
2547
2553
|
l[16]) && h(t, "points", n), a & /*isClosable, points, cursor*/
|
|
2548
2554
|
7 && i !== (i = /*coords*/
|
|
2549
2555
|
l[16]) && h(o, "points", i), /*isClosable*/
|
|
2550
|
-
l[2] ? r ? r.p(l, a) : (r =
|
|
2556
|
+
l[2] ? r ? r.p(l, a) : (r = Ot(l), r.c(), r.m(s.parentNode, s)) : r && (r.d(1), r = null);
|
|
2551
2557
|
},
|
|
2552
2558
|
d(l) {
|
|
2553
2559
|
l && (k(t), k(o), k(s)), r && r.d(l);
|
|
2554
2560
|
}
|
|
2555
2561
|
};
|
|
2556
2562
|
}
|
|
2557
|
-
function
|
|
2563
|
+
function Ot(e) {
|
|
2558
2564
|
let t, n, o;
|
|
2559
2565
|
return {
|
|
2560
2566
|
c() {
|
|
2561
|
-
t =
|
|
2567
|
+
t = X("rect"), h(t, "class", "a9s-corner-handle"), h(t, "x", n = /*points*/
|
|
2562
2568
|
e[0][0][0] - /*handleSize*/
|
|
2563
2569
|
e[3] / 2), h(t, "y", o = /*points*/
|
|
2564
2570
|
e[0][0][1] - /*handleSize*/
|
|
@@ -2603,21 +2609,21 @@ function vt(e) {
|
|
|
2603
2609
|
}
|
|
2604
2610
|
};
|
|
2605
2611
|
}
|
|
2606
|
-
function
|
|
2612
|
+
function Fo(e) {
|
|
2607
2613
|
let t, n = (
|
|
2608
2614
|
/*cursor*/
|
|
2609
|
-
e[1] &&
|
|
2615
|
+
e[1] && kt(et(e))
|
|
2610
2616
|
);
|
|
2611
2617
|
return {
|
|
2612
2618
|
c() {
|
|
2613
|
-
t =
|
|
2619
|
+
t = X("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2614
2620
|
},
|
|
2615
2621
|
m(o, i) {
|
|
2616
2622
|
O(o, t, i), n && n.m(t, null);
|
|
2617
2623
|
},
|
|
2618
2624
|
p(o, [i]) {
|
|
2619
2625
|
/*cursor*/
|
|
2620
|
-
o[1] ? n ? n.p(
|
|
2626
|
+
o[1] ? n ? n.p(et(o), i) : (n = kt(et(o)), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2621
2627
|
},
|
|
2622
2628
|
i: F,
|
|
2623
2629
|
o: F,
|
|
@@ -2626,8 +2632,8 @@ function zo(e) {
|
|
|
2626
2632
|
}
|
|
2627
2633
|
};
|
|
2628
2634
|
}
|
|
2629
|
-
const
|
|
2630
|
-
function
|
|
2635
|
+
const jo = 20, qo = 1500;
|
|
2636
|
+
function Ko(e, t, n) {
|
|
2631
2637
|
let o;
|
|
2632
2638
|
const i = Te();
|
|
2633
2639
|
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, d, g = !1;
|
|
@@ -2641,20 +2647,20 @@ function jo(e, t, n) {
|
|
|
2641
2647
|
const E = _;
|
|
2642
2648
|
if (d && clearTimeout(d), u.length > 0) {
|
|
2643
2649
|
if (n(1, f = l.elementToImage(E.offsetX, E.offsetY)), u.length > 2) {
|
|
2644
|
-
const B =
|
|
2645
|
-
n(2, g = B <
|
|
2650
|
+
const B = $e(f, u[0]) * a;
|
|
2651
|
+
n(2, g = B < jo);
|
|
2646
2652
|
}
|
|
2647
2653
|
E.pointerType === "touch" && (d = setTimeout(
|
|
2648
2654
|
() => {
|
|
2649
2655
|
p();
|
|
2650
2656
|
},
|
|
2651
|
-
|
|
2657
|
+
qo
|
|
2652
2658
|
));
|
|
2653
2659
|
}
|
|
2654
|
-
},
|
|
2660
|
+
}, w = (_) => {
|
|
2655
2661
|
const E = _;
|
|
2656
2662
|
if (d && clearTimeout(d), r === "click") {
|
|
2657
|
-
const B = E.timeStamp - c.timeStamp, V =
|
|
2663
|
+
const B = E.timeStamp - c.timeStamp, V = $e([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
|
|
2658
2664
|
if (B > 300 || V > 15)
|
|
2659
2665
|
return;
|
|
2660
2666
|
if (g)
|
|
@@ -2665,7 +2671,7 @@ function jo(e, t, n) {
|
|
|
2665
2671
|
} else
|
|
2666
2672
|
u.push(f);
|
|
2667
2673
|
} else {
|
|
2668
|
-
if (u.length === 1 &&
|
|
2674
|
+
if (u.length === 1 && $e(u[0], f) <= 4) {
|
|
2669
2675
|
n(0, u = []), n(1, f = void 0);
|
|
2670
2676
|
return;
|
|
2671
2677
|
}
|
|
@@ -2678,7 +2684,7 @@ function jo(e, t, n) {
|
|
|
2678
2684
|
type: q.POLYGON,
|
|
2679
2685
|
geometry: { bounds: Fe(_), points: _ }
|
|
2680
2686
|
};
|
|
2681
|
-
|
|
2687
|
+
lt(E) > 4 && (n(0, u = []), n(1, f = void 0), i("create", E));
|
|
2682
2688
|
}, A = () => {
|
|
2683
2689
|
const _ = {
|
|
2684
2690
|
type: q.POLYGON,
|
|
@@ -2690,7 +2696,7 @@ function jo(e, t, n) {
|
|
|
2690
2696
|
n(0, u = []), n(1, f = void 0), i("create", _);
|
|
2691
2697
|
};
|
|
2692
2698
|
return Ye(() => {
|
|
2693
|
-
s("pointerdown", m, !0), s("pointermove", y), s("pointerup",
|
|
2699
|
+
s("pointerdown", m, !0), s("pointermove", y), s("pointerup", w, !0), s("dblclick", p, !0);
|
|
2694
2700
|
}), e.$$set = (_) => {
|
|
2695
2701
|
"addEventListener" in _ && n(4, s = _.addEventListener), "drawingMode" in _ && n(5, r = _.drawingMode), "transform" in _ && n(6, l = _.transform), "viewportScale" in _ && n(7, a = _.viewportScale);
|
|
2696
2702
|
}, e.$$.update = () => {
|
|
@@ -2707,9 +2713,9 @@ function jo(e, t, n) {
|
|
|
2707
2713
|
a
|
|
2708
2714
|
];
|
|
2709
2715
|
}
|
|
2710
|
-
class
|
|
2716
|
+
class Wo extends oe {
|
|
2711
2717
|
constructor(t) {
|
|
2712
|
-
super(), ne(this, t,
|
|
2718
|
+
super(), ne(this, t, Ko, Fo, J, {
|
|
2713
2719
|
addEventListener: 4,
|
|
2714
2720
|
drawingMode: 5,
|
|
2715
2721
|
transform: 6,
|
|
@@ -2717,15 +2723,15 @@ class qo extends oe {
|
|
|
2717
2723
|
});
|
|
2718
2724
|
}
|
|
2719
2725
|
}
|
|
2720
|
-
const
|
|
2721
|
-
["rectangle", { tool:
|
|
2722
|
-
["polygon", { tool:
|
|
2723
|
-
]),
|
|
2724
|
-
function
|
|
2726
|
+
const dt = /* @__PURE__ */ new Map([
|
|
2727
|
+
["rectangle", { tool: Ho }],
|
|
2728
|
+
["polygon", { tool: Wo }]
|
|
2729
|
+
]), tn = () => [...dt.keys()], nn = (e) => dt.get(e), Jo = (e, t, n) => dt.set(e, { tool: t, opts: n });
|
|
2730
|
+
function Qo(e) {
|
|
2725
2731
|
let t, n, o, i, s;
|
|
2726
2732
|
return {
|
|
2727
2733
|
c() {
|
|
2728
|
-
t =
|
|
2734
|
+
t = X("g"), n = X("ellipse"), i = X("ellipse"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2729
2735
|
e[1] ? "display:none;" : void 0), h(
|
|
2730
2736
|
n,
|
|
2731
2737
|
"cx",
|
|
@@ -2797,7 +2803,7 @@ function Wo(e) {
|
|
|
2797
2803
|
}
|
|
2798
2804
|
};
|
|
2799
2805
|
}
|
|
2800
|
-
function
|
|
2806
|
+
function Zo(e, t, n) {
|
|
2801
2807
|
let o, { annotation: i } = t, { geom: s } = t, { style: r } = t;
|
|
2802
2808
|
const { cx: l, cy: a, rx: c, ry: u } = s;
|
|
2803
2809
|
return e.$$set = (f) => {
|
|
@@ -2807,21 +2813,21 @@ function Jo(e, t, n) {
|
|
|
2807
2813
|
129 && n(1, o = je(i, r));
|
|
2808
2814
|
}, [i, o, l, a, c, u, s, r];
|
|
2809
2815
|
}
|
|
2810
|
-
class
|
|
2816
|
+
class xo extends oe {
|
|
2811
2817
|
constructor(t) {
|
|
2812
|
-
super(), ne(this, t,
|
|
2818
|
+
super(), ne(this, t, Zo, Qo, J, { annotation: 0, geom: 6, style: 7 });
|
|
2813
2819
|
}
|
|
2814
2820
|
}
|
|
2815
|
-
function
|
|
2821
|
+
function $o(e) {
|
|
2816
2822
|
let t, n, o, i, s;
|
|
2817
2823
|
return {
|
|
2818
2824
|
c() {
|
|
2819
|
-
t =
|
|
2825
|
+
t = X("g"), n = X("polygon"), i = X("polygon"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2820
2826
|
e[1] ? "display:none;" : void 0), h(
|
|
2821
2827
|
n,
|
|
2822
2828
|
"points",
|
|
2823
2829
|
/*points*/
|
|
2824
|
-
e[2].map(
|
|
2830
|
+
e[2].map(ei).join(" ")
|
|
2825
2831
|
), h(i, "class", "a9s-inner"), h(
|
|
2826
2832
|
i,
|
|
2827
2833
|
"style",
|
|
@@ -2831,7 +2837,7 @@ function Zo(e) {
|
|
|
2831
2837
|
i,
|
|
2832
2838
|
"points",
|
|
2833
2839
|
/*points*/
|
|
2834
|
-
e[2].map(
|
|
2840
|
+
e[2].map(ti).join(" ")
|
|
2835
2841
|
), h(t, "data-id", s = /*annotation*/
|
|
2836
2842
|
e[0].id);
|
|
2837
2843
|
},
|
|
@@ -2858,8 +2864,8 @@ function Zo(e) {
|
|
|
2858
2864
|
}
|
|
2859
2865
|
};
|
|
2860
2866
|
}
|
|
2861
|
-
const
|
|
2862
|
-
function
|
|
2867
|
+
const ei = (e) => e.join(","), ti = (e) => e.join(",");
|
|
2868
|
+
function ni(e, t, n) {
|
|
2863
2869
|
let o, { annotation: i } = t, { geom: s } = t, { style: r } = t;
|
|
2864
2870
|
const { points: l } = s;
|
|
2865
2871
|
return e.$$set = (a) => {
|
|
@@ -2869,16 +2875,16 @@ function ei(e, t, n) {
|
|
|
2869
2875
|
17 && n(1, o = je(i, r));
|
|
2870
2876
|
}, [i, o, l, s, r];
|
|
2871
2877
|
}
|
|
2872
|
-
class
|
|
2878
|
+
class oi extends oe {
|
|
2873
2879
|
constructor(t) {
|
|
2874
|
-
super(), ne(this, t,
|
|
2880
|
+
super(), ne(this, t, ni, $o, J, { annotation: 0, geom: 3, style: 4 });
|
|
2875
2881
|
}
|
|
2876
2882
|
}
|
|
2877
|
-
function
|
|
2883
|
+
function ii(e) {
|
|
2878
2884
|
let t, n, o, i, s;
|
|
2879
2885
|
return {
|
|
2880
2886
|
c() {
|
|
2881
|
-
t =
|
|
2887
|
+
t = X("g"), n = X("rect"), i = X("rect"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2882
2888
|
e[5] ? "display:none;" : void 0), h(
|
|
2883
2889
|
n,
|
|
2884
2890
|
"x",
|
|
@@ -2998,7 +3004,7 @@ function ni(e) {
|
|
|
2998
3004
|
}
|
|
2999
3005
|
};
|
|
3000
3006
|
}
|
|
3001
|
-
function
|
|
3007
|
+
function si(e, t, n) {
|
|
3002
3008
|
let o, i, s, r, l, { annotation: a } = t, { geom: c } = t, { style: u } = t;
|
|
3003
3009
|
return e.$$set = (f) => {
|
|
3004
3010
|
"annotation" in f && n(0, a = f.annotation), "geom" in f && n(6, c = f.geom), "style" in f && n(7, u = f.style);
|
|
@@ -3008,53 +3014,53 @@ function oi(e, t, n) {
|
|
|
3008
3014
|
64 && n(4, { x: i, y: s, w: r, h: l } = c, i, (n(3, s), n(6, c)), (n(2, r), n(6, c)), (n(1, l), n(6, c)));
|
|
3009
3015
|
}, [a, l, r, s, i, o, c, u];
|
|
3010
3016
|
}
|
|
3011
|
-
class
|
|
3017
|
+
class ri extends oe {
|
|
3012
3018
|
constructor(t) {
|
|
3013
|
-
super(), ne(this, t,
|
|
3019
|
+
super(), ne(this, t, si, ii, J, { annotation: 0, geom: 6, style: 7 });
|
|
3014
3020
|
}
|
|
3015
3021
|
}
|
|
3016
|
-
const
|
|
3022
|
+
const Xi = {
|
|
3017
3023
|
elementToImage: (e, t) => [e, t]
|
|
3018
|
-
},
|
|
3024
|
+
}, li = (e) => ({
|
|
3019
3025
|
elementToImage: (t, n) => {
|
|
3020
3026
|
const o = e.getBoundingClientRect(), i = e.createSVGPoint();
|
|
3021
3027
|
i.x = t + o.x, i.y = n + o.y;
|
|
3022
3028
|
const { x: s, y: r } = i.matrixTransform(e.getScreenCTM().inverse());
|
|
3023
3029
|
return [s, r];
|
|
3024
3030
|
}
|
|
3025
|
-
}),
|
|
3031
|
+
}), ai = 250, ci = (e, t) => {
|
|
3026
3032
|
const n = Te();
|
|
3027
3033
|
let o;
|
|
3028
3034
|
return { onPointerDown: () => o = performance.now(), onPointerUp: (r) => {
|
|
3029
|
-
if (performance.now() - o <
|
|
3030
|
-
const { x: a, y: c } =
|
|
3035
|
+
if (performance.now() - o < ai) {
|
|
3036
|
+
const { x: a, y: c } = fi(r, e), u = t.getAt(a, c);
|
|
3031
3037
|
u ? n("click", { originalEvent: r, annotation: u }) : n("click", { originalEvent: r });
|
|
3032
3038
|
}
|
|
3033
3039
|
} };
|
|
3034
|
-
},
|
|
3040
|
+
}, fi = (e, t) => {
|
|
3035
3041
|
const n = t.createSVGPoint(), o = t.getBoundingClientRect(), i = e.clientX - o.x, s = e.clientY - o.y, { left: r, top: l } = t.getBoundingClientRect();
|
|
3036
3042
|
return n.x = i + r, n.y = s + l, n.matrixTransform(t.getScreenCTM().inverse());
|
|
3037
|
-
}, { Boolean:
|
|
3038
|
-
function
|
|
3043
|
+
}, { Boolean: on } = hn;
|
|
3044
|
+
function Bt(e, t, n) {
|
|
3039
3045
|
const o = e.slice();
|
|
3040
3046
|
return o[31] = t[n], o;
|
|
3041
3047
|
}
|
|
3042
|
-
function
|
|
3048
|
+
function It(e, t, n) {
|
|
3043
3049
|
const o = e.slice();
|
|
3044
3050
|
return o[34] = t[n], o;
|
|
3045
3051
|
}
|
|
3046
|
-
function
|
|
3052
|
+
function tt(e) {
|
|
3047
3053
|
const t = e.slice(), n = (
|
|
3048
3054
|
/*annotation*/
|
|
3049
3055
|
t[34].target.selector
|
|
3050
3056
|
);
|
|
3051
3057
|
return t[37] = n, t;
|
|
3052
3058
|
}
|
|
3053
|
-
function
|
|
3059
|
+
function Pt(e) {
|
|
3054
3060
|
let t = (
|
|
3055
3061
|
/*annotation*/
|
|
3056
3062
|
e[34].id
|
|
3057
|
-
), n, o, i =
|
|
3063
|
+
), n, o, i = Yt(e);
|
|
3058
3064
|
return {
|
|
3059
3065
|
c() {
|
|
3060
3066
|
i.c(), n = fe();
|
|
@@ -3065,22 +3071,22 @@ function Ot(e) {
|
|
|
3065
3071
|
p(s, r) {
|
|
3066
3072
|
r[0] & /*$store*/
|
|
3067
3073
|
16384 && J(t, t = /*annotation*/
|
|
3068
|
-
s[34].id) ? (le(),
|
|
3074
|
+
s[34].id) ? (le(), C(i, 1, 1, F), ae(), i = Yt(s), i.c(), I(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3069
3075
|
},
|
|
3070
3076
|
i(s) {
|
|
3071
3077
|
o || (I(i), o = !0);
|
|
3072
3078
|
},
|
|
3073
3079
|
o(s) {
|
|
3074
|
-
|
|
3080
|
+
C(i), o = !1;
|
|
3075
3081
|
},
|
|
3076
3082
|
d(s) {
|
|
3077
3083
|
s && k(n), i.d(s);
|
|
3078
3084
|
}
|
|
3079
3085
|
};
|
|
3080
3086
|
}
|
|
3081
|
-
function
|
|
3087
|
+
function ui(e) {
|
|
3082
3088
|
let t, n;
|
|
3083
|
-
return t = new
|
|
3089
|
+
return t = new oi({
|
|
3084
3090
|
props: {
|
|
3085
3091
|
annotation: (
|
|
3086
3092
|
/*annotation*/
|
|
@@ -3116,16 +3122,16 @@ function ci(e) {
|
|
|
3116
3122
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3117
3123
|
},
|
|
3118
3124
|
o(o) {
|
|
3119
|
-
|
|
3125
|
+
C(t.$$.fragment, o), n = !1;
|
|
3120
3126
|
},
|
|
3121
3127
|
d(o) {
|
|
3122
3128
|
ee(t, o);
|
|
3123
3129
|
}
|
|
3124
3130
|
};
|
|
3125
3131
|
}
|
|
3126
|
-
function
|
|
3132
|
+
function di(e) {
|
|
3127
3133
|
let t, n;
|
|
3128
|
-
return t = new
|
|
3134
|
+
return t = new ri({
|
|
3129
3135
|
props: {
|
|
3130
3136
|
annotation: (
|
|
3131
3137
|
/*annotation*/
|
|
@@ -3161,16 +3167,16 @@ function fi(e) {
|
|
|
3161
3167
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3162
3168
|
},
|
|
3163
3169
|
o(o) {
|
|
3164
|
-
|
|
3170
|
+
C(t.$$.fragment, o), n = !1;
|
|
3165
3171
|
},
|
|
3166
3172
|
d(o) {
|
|
3167
3173
|
ee(t, o);
|
|
3168
3174
|
}
|
|
3169
3175
|
};
|
|
3170
3176
|
}
|
|
3171
|
-
function
|
|
3177
|
+
function hi(e) {
|
|
3172
3178
|
let t, n;
|
|
3173
|
-
return t = new
|
|
3179
|
+
return t = new xo({
|
|
3174
3180
|
props: {
|
|
3175
3181
|
annotation: (
|
|
3176
3182
|
/*annotation*/
|
|
@@ -3206,16 +3212,16 @@ function ui(e) {
|
|
|
3206
3212
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3207
3213
|
},
|
|
3208
3214
|
o(o) {
|
|
3209
|
-
|
|
3215
|
+
C(t.$$.fragment, o), n = !1;
|
|
3210
3216
|
},
|
|
3211
3217
|
d(o) {
|
|
3212
3218
|
ee(t, o);
|
|
3213
3219
|
}
|
|
3214
3220
|
};
|
|
3215
3221
|
}
|
|
3216
|
-
function
|
|
3222
|
+
function Yt(e) {
|
|
3217
3223
|
let t, n, o, i;
|
|
3218
|
-
const s = [
|
|
3224
|
+
const s = [hi, di, ui], r = [];
|
|
3219
3225
|
function l(a, c) {
|
|
3220
3226
|
return (
|
|
3221
3227
|
/*selector*/
|
|
@@ -3237,7 +3243,7 @@ function Bt(e) {
|
|
|
3237
3243
|
},
|
|
3238
3244
|
p(a, c) {
|
|
3239
3245
|
let u = t;
|
|
3240
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(),
|
|
3246
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(), C(r[u], 1, 1, () => {
|
|
3241
3247
|
r[u] = null;
|
|
3242
3248
|
}), ae()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), I(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3243
3249
|
},
|
|
@@ -3245,19 +3251,19 @@ function Bt(e) {
|
|
|
3245
3251
|
i || (I(n), i = !0);
|
|
3246
3252
|
},
|
|
3247
3253
|
o(a) {
|
|
3248
|
-
|
|
3254
|
+
C(n), i = !1;
|
|
3249
3255
|
},
|
|
3250
3256
|
d(a) {
|
|
3251
3257
|
a && k(o), ~t && r[t].d(a);
|
|
3252
3258
|
}
|
|
3253
3259
|
};
|
|
3254
3260
|
}
|
|
3255
|
-
function
|
|
3261
|
+
function Dt(e) {
|
|
3256
3262
|
let t = !/*isEditable*/
|
|
3257
3263
|
e[8](
|
|
3258
3264
|
/*annotation*/
|
|
3259
3265
|
e[34]
|
|
3260
|
-
), n, o, i = t &&
|
|
3266
|
+
), n, o, i = t && Pt(tt(e));
|
|
3261
3267
|
return {
|
|
3262
3268
|
c() {
|
|
3263
3269
|
i && i.c(), n = fe();
|
|
@@ -3271,8 +3277,8 @@ function It(e) {
|
|
|
3271
3277
|
s[8](
|
|
3272
3278
|
/*annotation*/
|
|
3273
3279
|
s[34]
|
|
3274
|
-
)), t ? i ? (i.p(
|
|
3275
|
-
16640 && I(i, 1)) : (i =
|
|
3280
|
+
)), t ? i ? (i.p(tt(s), r), r[0] & /*isEditable, $store*/
|
|
3281
|
+
16640 && I(i, 1)) : (i = Pt(tt(s)), i.c(), I(i, 1), i.m(n.parentNode, n)) : i && (le(), C(i, 1, 1, () => {
|
|
3276
3282
|
i = null;
|
|
3277
3283
|
}), ae());
|
|
3278
3284
|
},
|
|
@@ -3280,16 +3286,16 @@ function It(e) {
|
|
|
3280
3286
|
o || (I(i), o = !0);
|
|
3281
3287
|
},
|
|
3282
3288
|
o(s) {
|
|
3283
|
-
|
|
3289
|
+
C(i), o = !1;
|
|
3284
3290
|
},
|
|
3285
3291
|
d(s) {
|
|
3286
3292
|
s && k(n), i && i.d(s);
|
|
3287
3293
|
}
|
|
3288
3294
|
};
|
|
3289
3295
|
}
|
|
3290
|
-
function
|
|
3296
|
+
function Ct(e) {
|
|
3291
3297
|
let t, n, o, i;
|
|
3292
|
-
const s = [
|
|
3298
|
+
const s = [mi, gi], r = [];
|
|
3293
3299
|
function l(a, c) {
|
|
3294
3300
|
return (
|
|
3295
3301
|
/*editableAnnotations*/
|
|
@@ -3309,7 +3315,7 @@ function Pt(e) {
|
|
|
3309
3315
|
},
|
|
3310
3316
|
p(a, c) {
|
|
3311
3317
|
let u = t;
|
|
3312
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(),
|
|
3318
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(), C(r[u], 1, 1, () => {
|
|
3313
3319
|
r[u] = null;
|
|
3314
3320
|
}), ae()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), I(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3315
3321
|
},
|
|
@@ -3317,18 +3323,18 @@ function Pt(e) {
|
|
|
3317
3323
|
i || (I(n), i = !0);
|
|
3318
3324
|
},
|
|
3319
3325
|
o(a) {
|
|
3320
|
-
|
|
3326
|
+
C(n), i = !1;
|
|
3321
3327
|
},
|
|
3322
3328
|
d(a) {
|
|
3323
3329
|
a && k(o), ~t && r[t].d(a);
|
|
3324
3330
|
}
|
|
3325
3331
|
};
|
|
3326
3332
|
}
|
|
3327
|
-
function
|
|
3333
|
+
function gi(e) {
|
|
3328
3334
|
let t = (
|
|
3329
3335
|
/*toolName*/
|
|
3330
3336
|
e[2]
|
|
3331
|
-
), n, o, i =
|
|
3337
|
+
), n, o, i = Xt(e);
|
|
3332
3338
|
return {
|
|
3333
3339
|
c() {
|
|
3334
3340
|
i.c(), n = fe();
|
|
@@ -3339,27 +3345,27 @@ function di(e) {
|
|
|
3339
3345
|
p(s, r) {
|
|
3340
3346
|
r[0] & /*toolName*/
|
|
3341
3347
|
4 && J(t, t = /*toolName*/
|
|
3342
|
-
s[2]) ? (le(),
|
|
3348
|
+
s[2]) ? (le(), C(i, 1, 1, F), ae(), i = Xt(s), i.c(), I(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3343
3349
|
},
|
|
3344
3350
|
i(s) {
|
|
3345
3351
|
o || (I(i), o = !0);
|
|
3346
3352
|
},
|
|
3347
3353
|
o(s) {
|
|
3348
|
-
|
|
3354
|
+
C(i), o = !1;
|
|
3349
3355
|
},
|
|
3350
3356
|
d(s) {
|
|
3351
3357
|
s && k(n), i.d(s);
|
|
3352
3358
|
}
|
|
3353
3359
|
};
|
|
3354
3360
|
}
|
|
3355
|
-
function
|
|
3361
|
+
function mi(e) {
|
|
3356
3362
|
let t, n, o = Se(
|
|
3357
3363
|
/*editableAnnotations*/
|
|
3358
3364
|
e[7]
|
|
3359
3365
|
), i = [];
|
|
3360
3366
|
for (let r = 0; r < o.length; r += 1)
|
|
3361
|
-
i[r] =
|
|
3362
|
-
const s = (r) =>
|
|
3367
|
+
i[r] = Nt(Bt(e, o, r));
|
|
3368
|
+
const s = (r) => C(i[r], 1, 1, () => {
|
|
3363
3369
|
i[r] = null;
|
|
3364
3370
|
});
|
|
3365
3371
|
return {
|
|
@@ -3382,8 +3388,8 @@ function hi(e) {
|
|
|
3382
3388
|
);
|
|
3383
3389
|
let a;
|
|
3384
3390
|
for (a = 0; a < o.length; a += 1) {
|
|
3385
|
-
const c =
|
|
3386
|
-
i[a] ? (i[a].p(c, l), I(i[a], 1)) : (i[a] =
|
|
3391
|
+
const c = Bt(r, o, a);
|
|
3392
|
+
i[a] ? (i[a].p(c, l), I(i[a], 1)) : (i[a] = Nt(c), i[a].c(), I(i[a], 1), i[a].m(t.parentNode, t));
|
|
3387
3393
|
}
|
|
3388
3394
|
for (le(), a = o.length; a < i.length; a += 1)
|
|
3389
3395
|
s(a);
|
|
@@ -3398,19 +3404,19 @@ function hi(e) {
|
|
|
3398
3404
|
}
|
|
3399
3405
|
},
|
|
3400
3406
|
o(r) {
|
|
3401
|
-
i = i.filter(
|
|
3407
|
+
i = i.filter(on);
|
|
3402
3408
|
for (let l = 0; l < i.length; l += 1)
|
|
3403
|
-
|
|
3409
|
+
C(i[l]);
|
|
3404
3410
|
n = !1;
|
|
3405
3411
|
},
|
|
3406
3412
|
d(r) {
|
|
3407
|
-
r && k(t),
|
|
3413
|
+
r && k(t), at(i, r);
|
|
3408
3414
|
}
|
|
3409
3415
|
};
|
|
3410
3416
|
}
|
|
3411
|
-
function
|
|
3417
|
+
function Xt(e) {
|
|
3412
3418
|
let t, n;
|
|
3413
|
-
return t = new
|
|
3419
|
+
return t = new Vo({
|
|
3414
3420
|
props: {
|
|
3415
3421
|
target: (
|
|
3416
3422
|
/*drawingEl*/
|
|
@@ -3462,16 +3468,16 @@ function Yt(e) {
|
|
|
3462
3468
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3463
3469
|
},
|
|
3464
3470
|
o(o) {
|
|
3465
|
-
|
|
3471
|
+
C(t.$$.fragment, o), n = !1;
|
|
3466
3472
|
},
|
|
3467
3473
|
d(o) {
|
|
3468
3474
|
ee(t, o);
|
|
3469
3475
|
}
|
|
3470
3476
|
};
|
|
3471
3477
|
}
|
|
3472
|
-
function
|
|
3478
|
+
function Rt(e) {
|
|
3473
3479
|
let t, n;
|
|
3474
|
-
return t = new
|
|
3480
|
+
return t = new No({
|
|
3475
3481
|
props: {
|
|
3476
3482
|
target: (
|
|
3477
3483
|
/*drawingEl*/
|
|
@@ -3543,18 +3549,18 @@ function Dt(e) {
|
|
|
3543
3549
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3544
3550
|
},
|
|
3545
3551
|
o(o) {
|
|
3546
|
-
|
|
3552
|
+
C(t.$$.fragment, o), n = !1;
|
|
3547
3553
|
},
|
|
3548
3554
|
d(o) {
|
|
3549
3555
|
ee(t, o);
|
|
3550
3556
|
}
|
|
3551
3557
|
};
|
|
3552
3558
|
}
|
|
3553
|
-
function
|
|
3559
|
+
function Nt(e) {
|
|
3554
3560
|
let t = (
|
|
3555
3561
|
/*editable*/
|
|
3556
3562
|
e[31].id
|
|
3557
|
-
), n, o, i =
|
|
3563
|
+
), n, o, i = Rt(e);
|
|
3558
3564
|
return {
|
|
3559
3565
|
c() {
|
|
3560
3566
|
i.c(), n = fe();
|
|
@@ -3565,39 +3571,39 @@ function Xt(e) {
|
|
|
3565
3571
|
p(s, r) {
|
|
3566
3572
|
r[0] & /*editableAnnotations*/
|
|
3567
3573
|
128 && J(t, t = /*editable*/
|
|
3568
|
-
s[31].id) ? (le(),
|
|
3574
|
+
s[31].id) ? (le(), C(i, 1, 1, F), ae(), i = Rt(s), i.c(), I(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3569
3575
|
},
|
|
3570
3576
|
i(s) {
|
|
3571
3577
|
o || (I(i), o = !0);
|
|
3572
3578
|
},
|
|
3573
3579
|
o(s) {
|
|
3574
|
-
|
|
3580
|
+
C(i), o = !1;
|
|
3575
3581
|
},
|
|
3576
3582
|
d(s) {
|
|
3577
3583
|
s && k(n), i.d(s);
|
|
3578
3584
|
}
|
|
3579
3585
|
};
|
|
3580
3586
|
}
|
|
3581
|
-
function
|
|
3587
|
+
function pi(e) {
|
|
3582
3588
|
let t, n, o, i, s, r, l = Se(
|
|
3583
3589
|
/*$store*/
|
|
3584
3590
|
e[14]
|
|
3585
3591
|
), a = [];
|
|
3586
3592
|
for (let f = 0; f < l.length; f += 1)
|
|
3587
|
-
a[f] = It(
|
|
3588
|
-
const c = (f) =>
|
|
3593
|
+
a[f] = Dt(It(e, l, f));
|
|
3594
|
+
const c = (f) => C(a[f], 1, 1, () => {
|
|
3589
3595
|
a[f] = null;
|
|
3590
3596
|
});
|
|
3591
3597
|
let u = (
|
|
3592
3598
|
/*drawingEl*/
|
|
3593
|
-
e[5] &&
|
|
3599
|
+
e[5] && Ct(e)
|
|
3594
3600
|
);
|
|
3595
3601
|
return {
|
|
3596
3602
|
c() {
|
|
3597
|
-
t =
|
|
3603
|
+
t = X("svg"), n = X("g");
|
|
3598
3604
|
for (let f = 0; f < a.length; f += 1)
|
|
3599
3605
|
a[f].c();
|
|
3600
|
-
o =
|
|
3606
|
+
o = X("g"), u && u.c(), h(o, "class", "drawing"), h(t, "class", "a9s-annotationlayer"), Ee(
|
|
3601
3607
|
t,
|
|
3602
3608
|
"drawing",
|
|
3603
3609
|
/*tool*/
|
|
@@ -3633,8 +3639,8 @@ function gi(e) {
|
|
|
3633
3639
|
);
|
|
3634
3640
|
let g;
|
|
3635
3641
|
for (g = 0; g < l.length; g += 1) {
|
|
3636
|
-
const m =
|
|
3637
|
-
a[g] ? (a[g].p(m, d), I(a[g], 1)) : (a[g] =
|
|
3642
|
+
const m = It(e, l, g);
|
|
3643
|
+
a[g] ? (a[g].p(m, d), I(a[g], 1)) : (a[g] = Dt(m), a[g].c(), I(a[g], 1), a[g].m(n, null));
|
|
3638
3644
|
}
|
|
3639
3645
|
for (le(), g = l.length; g < a.length; g += 1)
|
|
3640
3646
|
c(g);
|
|
@@ -3642,7 +3648,7 @@ function gi(e) {
|
|
|
3642
3648
|
}
|
|
3643
3649
|
/*drawingEl*/
|
|
3644
3650
|
e[5] ? u ? (u.p(e, d), d[0] & /*drawingEl*/
|
|
3645
|
-
32 && I(u, 1)) : (u =
|
|
3651
|
+
32 && I(u, 1)) : (u = Ct(e), u.c(), I(u, 1), u.m(o, null)) : u && (le(), C(u, 1, 1, () => {
|
|
3646
3652
|
u = null;
|
|
3647
3653
|
}), ae()), (!i || d[0] & /*tool*/
|
|
3648
3654
|
8192) && Ee(
|
|
@@ -3662,33 +3668,33 @@ function gi(e) {
|
|
|
3662
3668
|
}
|
|
3663
3669
|
},
|
|
3664
3670
|
o(f) {
|
|
3665
|
-
a = a.filter(
|
|
3671
|
+
a = a.filter(on);
|
|
3666
3672
|
for (let d = 0; d < a.length; d += 1)
|
|
3667
|
-
|
|
3668
|
-
|
|
3673
|
+
C(a[d]);
|
|
3674
|
+
C(u), i = !1;
|
|
3669
3675
|
},
|
|
3670
3676
|
d(f) {
|
|
3671
|
-
f && k(t),
|
|
3677
|
+
f && k(t), at(a, f), u && u.d(), e[27](null), e[28](null), s = !1, ce(r);
|
|
3672
3678
|
}
|
|
3673
3679
|
};
|
|
3674
3680
|
}
|
|
3675
|
-
function
|
|
3676
|
-
let o, i, s, r, l, a, c, u, f, d, g = F, m = () => (g(), g =
|
|
3681
|
+
function yi(e, t, n) {
|
|
3682
|
+
let o, i, s, r, l, a, c, u, f, d, g = F, m = () => (g(), g = Ht(Y, (L) => n(15, d = L)), Y);
|
|
3677
3683
|
e.$$.on_destroy.push(() => g());
|
|
3678
|
-
let { drawingEnabled: y } = t, { image:
|
|
3679
|
-
Ye(() => m(n(6, Y =
|
|
3680
|
-
const { selection:
|
|
3681
|
-
|
|
3682
|
-
let T,
|
|
3684
|
+
let { drawingEnabled: y } = t, { image: w } = t, { preferredDrawingMode: p } = t, { state: A } = t, { style: _ = void 0 } = t, { toolName: E = tn()[0] } = t, { user: B } = t, { visible: V = !0 } = t, U, R, Y;
|
|
3685
|
+
Ye(() => m(n(6, Y = Ao(w, R))));
|
|
3686
|
+
const { selection: b, store: S } = A;
|
|
3687
|
+
mt(e, b, (L) => n(26, u = L)), mt(e, S, (L) => n(14, f = L));
|
|
3688
|
+
let T, v;
|
|
3683
3689
|
const P = (L) => {
|
|
3684
3690
|
T && S.unobserve(T);
|
|
3685
3691
|
const Q = L.filter(({ editable: z }) => z).map(({ id: z }) => z);
|
|
3686
|
-
Q.length > 0 ? (n(7,
|
|
3692
|
+
Q.length > 0 ? (n(7, v = Q.map((z) => S.getAnnotation(z)).filter(Boolean)), T = (z) => {
|
|
3687
3693
|
const { updated: ue } = z.changes;
|
|
3688
|
-
n(7,
|
|
3689
|
-
}, S.observe(T, { annotations: Q })) : n(7,
|
|
3694
|
+
n(7, v = ue == null ? void 0 : ue.map((Z) => Z.newValue));
|
|
3695
|
+
}, S.observe(T, { annotations: Q })) : n(7, v = void 0);
|
|
3690
3696
|
}, G = (L) => {
|
|
3691
|
-
const Q =
|
|
3697
|
+
const Q = Jt(), z = {
|
|
3692
3698
|
id: Q,
|
|
3693
3699
|
bodies: [],
|
|
3694
3700
|
target: {
|
|
@@ -3698,7 +3704,7 @@ function mi(e, t, n) {
|
|
|
3698
3704
|
created: /* @__PURE__ */ new Date()
|
|
3699
3705
|
}
|
|
3700
3706
|
};
|
|
3701
|
-
S.addAnnotation(z),
|
|
3707
|
+
S.addAnnotation(z), b.setSelected(z.id);
|
|
3702
3708
|
}, x = (L) => (Q) => {
|
|
3703
3709
|
var N;
|
|
3704
3710
|
const { target: z } = L, ue = 10 * 60 * 1e3, Z = ((N = z.creator) == null ? void 0 : N.id) !== B.id || !z.created || (/* @__PURE__ */ new Date()).getTime() - z.created.getTime() > ue;
|
|
@@ -3709,25 +3715,25 @@ function mi(e, t, n) {
|
|
|
3709
3715
|
updated: Z ? /* @__PURE__ */ new Date() : void 0,
|
|
3710
3716
|
updatedBy: Z ? B : void 0
|
|
3711
3717
|
});
|
|
3712
|
-
},
|
|
3718
|
+
}, ve = (L) => Po(L);
|
|
3713
3719
|
function se(L) {
|
|
3714
3720
|
He[L ? "unshift" : "push"](() => {
|
|
3715
3721
|
U = L, n(5, U);
|
|
3716
3722
|
});
|
|
3717
3723
|
}
|
|
3718
|
-
function
|
|
3724
|
+
function Me(L) {
|
|
3719
3725
|
He[L ? "unshift" : "push"](() => {
|
|
3720
3726
|
R = L, n(4, R);
|
|
3721
3727
|
});
|
|
3722
3728
|
}
|
|
3723
3729
|
return e.$$set = (L) => {
|
|
3724
|
-
"drawingEnabled" in L && n(0, y = L.drawingEnabled), "image" in L && n(21,
|
|
3730
|
+
"drawingEnabled" in L && n(0, y = L.drawingEnabled), "image" in L && n(21, w = L.image), "preferredDrawingMode" in L && n(22, p = L.preferredDrawingMode), "state" in L && n(23, A = L.state), "style" in L && n(1, _ = L.style), "toolName" in L && n(2, E = L.toolName), "user" in L && n(24, B = L.user), "visible" in L && n(3, V = L.visible);
|
|
3725
3731
|
}, e.$$.update = () => {
|
|
3726
3732
|
e.$$.dirty[0] & /*toolName*/
|
|
3727
|
-
4 && n(13, { tool: o, opts: i } =
|
|
3733
|
+
4 && n(13, { tool: o, opts: i } = nn(E) || { tool: void 0, opts: void 0 }, o, (n(25, i), n(2, E))), e.$$.dirty[0] & /*opts, preferredDrawingMode*/
|
|
3728
3734
|
37748736 && n(12, s = (i == null ? void 0 : i.drawingMode) || p), e.$$.dirty[0] & /*svgEl*/
|
|
3729
|
-
16 && n(11, r =
|
|
3730
|
-
16 && n(10, { onPointerDown: l, onPointerUp: a } =
|
|
3735
|
+
16 && n(11, r = li(R)), e.$$.dirty[0] & /*svgEl*/
|
|
3736
|
+
16 && n(10, { onPointerDown: l, onPointerUp: a } = ci(R, S), l, (n(9, a), n(4, R))), e.$$.dirty[0] & /*$selection*/
|
|
3731
3737
|
67108864 && n(8, c = (L) => u.selected.find((Q) => Q.id === L.id && Q.editable)), e.$$.dirty[0] & /*$selection*/
|
|
3732
3738
|
67108864 && P(u.selected);
|
|
3733
3739
|
}, [
|
|
@@ -3738,7 +3744,7 @@ function mi(e, t, n) {
|
|
|
3738
3744
|
R,
|
|
3739
3745
|
U,
|
|
3740
3746
|
Y,
|
|
3741
|
-
|
|
3747
|
+
v,
|
|
3742
3748
|
c,
|
|
3743
3749
|
a,
|
|
3744
3750
|
l,
|
|
@@ -3747,28 +3753,28 @@ function mi(e, t, n) {
|
|
|
3747
3753
|
o,
|
|
3748
3754
|
f,
|
|
3749
3755
|
d,
|
|
3750
|
-
|
|
3756
|
+
b,
|
|
3751
3757
|
S,
|
|
3752
3758
|
G,
|
|
3753
3759
|
x,
|
|
3754
|
-
|
|
3755
|
-
|
|
3760
|
+
ve,
|
|
3761
|
+
w,
|
|
3756
3762
|
p,
|
|
3757
3763
|
A,
|
|
3758
3764
|
B,
|
|
3759
3765
|
i,
|
|
3760
3766
|
u,
|
|
3761
3767
|
se,
|
|
3762
|
-
|
|
3768
|
+
Me
|
|
3763
3769
|
];
|
|
3764
3770
|
}
|
|
3765
|
-
class
|
|
3771
|
+
class _i extends oe {
|
|
3766
3772
|
constructor(t) {
|
|
3767
3773
|
super(), ne(
|
|
3768
3774
|
this,
|
|
3769
3775
|
t,
|
|
3770
|
-
|
|
3771
|
-
|
|
3776
|
+
yi,
|
|
3777
|
+
pi,
|
|
3772
3778
|
J,
|
|
3773
3779
|
{
|
|
3774
3780
|
drawingEnabled: 0,
|
|
@@ -3785,14 +3791,14 @@ class pi extends oe {
|
|
|
3785
3791
|
);
|
|
3786
3792
|
}
|
|
3787
3793
|
}
|
|
3788
|
-
function
|
|
3789
|
-
|
|
3794
|
+
function wi(e, t, n, o, i) {
|
|
3795
|
+
sn(e, t, n || 0, o || e.length - 1, i || bi);
|
|
3790
3796
|
}
|
|
3791
|
-
function
|
|
3797
|
+
function sn(e, t, n, o, i) {
|
|
3792
3798
|
for (; o > n; ) {
|
|
3793
3799
|
if (o - n > 600) {
|
|
3794
3800
|
var s = o - n + 1, r = t - n + 1, l = Math.log(s), a = 0.5 * Math.exp(2 * l / 3), c = 0.5 * Math.sqrt(l * a * (s - a) / s) * (r - s / 2 < 0 ? -1 : 1), u = Math.max(n, Math.floor(t - r * a / s + c)), f = Math.min(o, Math.floor(t + (s - r) * a / s + c));
|
|
3795
|
-
|
|
3801
|
+
sn(e, t, u, f, i);
|
|
3796
3802
|
}
|
|
3797
3803
|
var d = e[t], g = n, m = o;
|
|
3798
3804
|
for (Le(e, n, t), i(e[o], d) > 0 && Le(e, n, o); g < m; ) {
|
|
@@ -3808,10 +3814,10 @@ function Le(e, t, n) {
|
|
|
3808
3814
|
var o = e[t];
|
|
3809
3815
|
e[t] = e[n], e[n] = o;
|
|
3810
3816
|
}
|
|
3811
|
-
function
|
|
3817
|
+
function bi(e, t) {
|
|
3812
3818
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
3813
3819
|
}
|
|
3814
|
-
class
|
|
3820
|
+
class Ei {
|
|
3815
3821
|
constructor(t = 9) {
|
|
3816
3822
|
this._maxEntries = Math.max(4, t), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();
|
|
3817
3823
|
}
|
|
@@ -3827,7 +3833,7 @@ class wi {
|
|
|
3827
3833
|
for (; n; ) {
|
|
3828
3834
|
for (let r = 0; r < n.children.length; r++) {
|
|
3829
3835
|
const l = n.children[r], a = n.leaf ? i(l) : l;
|
|
3830
|
-
Ve(t, a) && (n.leaf ? o.push(l) :
|
|
3836
|
+
Ve(t, a) && (n.leaf ? o.push(l) : ot(t, a) ? this._all(l, o) : s.push(l));
|
|
3831
3837
|
}
|
|
3832
3838
|
n = s.pop();
|
|
3833
3839
|
}
|
|
@@ -3842,7 +3848,7 @@ class wi {
|
|
|
3842
3848
|
for (let i = 0; i < n.children.length; i++) {
|
|
3843
3849
|
const s = n.children[i], r = n.leaf ? this.toBBox(s) : s;
|
|
3844
3850
|
if (Ve(t, r)) {
|
|
3845
|
-
if (n.leaf ||
|
|
3851
|
+
if (n.leaf || ot(t, r))
|
|
3846
3852
|
return !0;
|
|
3847
3853
|
o.push(s);
|
|
3848
3854
|
}
|
|
@@ -3887,11 +3893,11 @@ class wi {
|
|
|
3887
3893
|
let l, a, c;
|
|
3888
3894
|
for (; o || s.length; ) {
|
|
3889
3895
|
if (o || (o = s.pop(), a = s[s.length - 1], l = r.pop(), c = !0), o.leaf) {
|
|
3890
|
-
const u =
|
|
3896
|
+
const u = Ai(t, o.children, n);
|
|
3891
3897
|
if (u !== -1)
|
|
3892
3898
|
return o.children.splice(u, 1), s.push(o), this._condense(s), this;
|
|
3893
3899
|
}
|
|
3894
|
-
!c && !o.leaf &&
|
|
3900
|
+
!c && !o.leaf && ot(o, i) ? (s.push(o), r.push(l), l = 0, a = o, o = o.children[0]) : a ? (l++, o = a.children[l], c = !1) : o = null;
|
|
3895
3901
|
}
|
|
3896
3902
|
return this;
|
|
3897
3903
|
}
|
|
@@ -3923,10 +3929,10 @@ class wi {
|
|
|
3923
3929
|
return l = be(t.slice(n, o + 1)), _e(l, this.toBBox), l;
|
|
3924
3930
|
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l = be([]), l.leaf = !1, l.height = i;
|
|
3925
3931
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
3926
|
-
|
|
3932
|
+
Ut(t, n, o, c, this.compareMinX);
|
|
3927
3933
|
for (let u = n; u <= o; u += c) {
|
|
3928
3934
|
const f = Math.min(u + c - 1, o);
|
|
3929
|
-
|
|
3935
|
+
Ut(t, u, f, a, this.compareMinY);
|
|
3930
3936
|
for (let d = u; d <= f; d += a) {
|
|
3931
3937
|
const g = Math.min(d + a - 1, f);
|
|
3932
3938
|
l.children.push(this._build(t, d, g, i - 1));
|
|
@@ -3938,7 +3944,7 @@ class wi {
|
|
|
3938
3944
|
for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {
|
|
3939
3945
|
let s = 1 / 0, r = 1 / 0, l;
|
|
3940
3946
|
for (let a = 0; a < n.children.length; a++) {
|
|
3941
|
-
const c = n.children[a], u =
|
|
3947
|
+
const c = n.children[a], u = nt(c), f = vi(t, c) - u;
|
|
3942
3948
|
f < r ? (r = f, s = u < s ? u : s, l = c) : f === r && u < s && (s = u, l = c);
|
|
3943
3949
|
}
|
|
3944
3950
|
n = l || n.children[0];
|
|
@@ -3964,14 +3970,14 @@ class wi {
|
|
|
3964
3970
|
_chooseSplitIndex(t, n, o) {
|
|
3965
3971
|
let i, s = 1 / 0, r = 1 / 0;
|
|
3966
3972
|
for (let l = n; l <= o - n; l++) {
|
|
3967
|
-
const a = Oe(t, 0, l, this.toBBox), c = Oe(t, l, o, this.toBBox), u =
|
|
3973
|
+
const a = Oe(t, 0, l, this.toBBox), c = Oe(t, l, o, this.toBBox), u = Mi(a, c), f = nt(a) + nt(c);
|
|
3968
3974
|
u < s ? (s = u, i = l, r = f < r ? f : r) : u === s && f < r && (r = f, i = l);
|
|
3969
3975
|
}
|
|
3970
3976
|
return i || o - n;
|
|
3971
3977
|
}
|
|
3972
3978
|
// sorts node children by the best axis for split
|
|
3973
3979
|
_chooseSplitAxis(t, n, o) {
|
|
3974
|
-
const i = t.leaf ? this.compareMinX :
|
|
3980
|
+
const i = t.leaf ? this.compareMinX : Si, s = t.leaf ? this.compareMinY : Ti, r = this._allDistMargin(t, n, o, i), l = this._allDistMargin(t, n, o, s);
|
|
3975
3981
|
r < l && t.children.sort(i);
|
|
3976
3982
|
}
|
|
3977
3983
|
// total margin of all possible split distributions where each node is at least m full
|
|
@@ -3998,7 +4004,7 @@ class wi {
|
|
|
3998
4004
|
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() : _e(t[n], this.toBBox);
|
|
3999
4005
|
}
|
|
4000
4006
|
}
|
|
4001
|
-
function
|
|
4007
|
+
function Ai(e, t, n) {
|
|
4002
4008
|
if (!n)
|
|
4003
4009
|
return t.indexOf(e);
|
|
4004
4010
|
for (let o = 0; o < t.length; o++)
|
|
@@ -4020,26 +4026,26 @@ function Oe(e, t, n, o, i) {
|
|
|
4020
4026
|
function Be(e, t) {
|
|
4021
4027
|
return e.minX = Math.min(e.minX, t.minX), e.minY = Math.min(e.minY, t.minY), e.maxX = Math.max(e.maxX, t.maxX), e.maxY = Math.max(e.maxY, t.maxY), e;
|
|
4022
4028
|
}
|
|
4023
|
-
function
|
|
4029
|
+
function Si(e, t) {
|
|
4024
4030
|
return e.minX - t.minX;
|
|
4025
4031
|
}
|
|
4026
|
-
function
|
|
4032
|
+
function Ti(e, t) {
|
|
4027
4033
|
return e.minY - t.minY;
|
|
4028
4034
|
}
|
|
4029
|
-
function
|
|
4035
|
+
function nt(e) {
|
|
4030
4036
|
return (e.maxX - e.minX) * (e.maxY - e.minY);
|
|
4031
4037
|
}
|
|
4032
4038
|
function Ue(e) {
|
|
4033
4039
|
return e.maxX - e.minX + (e.maxY - e.minY);
|
|
4034
4040
|
}
|
|
4035
|
-
function
|
|
4041
|
+
function vi(e, t) {
|
|
4036
4042
|
return (Math.max(t.maxX, e.maxX) - Math.min(t.minX, e.minX)) * (Math.max(t.maxY, e.maxY) - Math.min(t.minY, e.minY));
|
|
4037
4043
|
}
|
|
4038
|
-
function
|
|
4044
|
+
function Mi(e, t) {
|
|
4039
4045
|
const n = Math.max(e.minX, t.minX), o = Math.max(e.minY, t.minY), i = Math.min(e.maxX, t.maxX), s = Math.min(e.maxY, t.maxY);
|
|
4040
4046
|
return Math.max(0, i - n) * Math.max(0, s - o);
|
|
4041
4047
|
}
|
|
4042
|
-
function
|
|
4048
|
+
function ot(e, t) {
|
|
4043
4049
|
return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
|
|
4044
4050
|
}
|
|
4045
4051
|
function Ve(e, t) {
|
|
@@ -4056,21 +4062,21 @@ function be(e) {
|
|
|
4056
4062
|
maxY: -1 / 0
|
|
4057
4063
|
};
|
|
4058
4064
|
}
|
|
4059
|
-
function
|
|
4065
|
+
function Ut(e, t, n, o, i) {
|
|
4060
4066
|
const s = [t, n];
|
|
4061
4067
|
for (; s.length; ) {
|
|
4062
4068
|
if (n = s.pop(), t = s.pop(), n - t <= o)
|
|
4063
4069
|
continue;
|
|
4064
4070
|
const r = t + Math.ceil((n - t) / o / 2) * o;
|
|
4065
|
-
|
|
4071
|
+
wi(e, r, t, n, i), s.push(t, r, r, n);
|
|
4066
4072
|
}
|
|
4067
4073
|
}
|
|
4068
|
-
const
|
|
4069
|
-
const e = new
|
|
4074
|
+
const Li = () => {
|
|
4075
|
+
const e = new Ei(), t = /* @__PURE__ */ new Map(), n = () => [...t.values()], o = () => {
|
|
4070
4076
|
e.clear(), t.clear();
|
|
4071
4077
|
}, i = (f) => {
|
|
4072
|
-
const { minX: d, minY: g, maxX: m, maxY: y } = f.selector.geometry.bounds,
|
|
4073
|
-
e.insert(
|
|
4078
|
+
const { minX: d, minY: g, maxX: m, maxY: y } = f.selector.geometry.bounds, w = { minX: d, minY: g, maxX: m, maxY: y, target: f };
|
|
4079
|
+
e.insert(w), t.set(f.annotation, w);
|
|
4074
4080
|
}, s = (f) => {
|
|
4075
4081
|
const d = t.get(f.annotation);
|
|
4076
4082
|
d && e.remove(d), t.delete(f.annotation);
|
|
@@ -4084,9 +4090,9 @@ const Mi = () => {
|
|
|
4084
4090
|
minY: d,
|
|
4085
4091
|
maxX: f,
|
|
4086
4092
|
maxY: d
|
|
4087
|
-
}).map((y) => y.target).filter((y) => y.selector.type === q.RECTANGLE ||
|
|
4093
|
+
}).map((y) => y.target).filter((y) => y.selector.type === q.RECTANGLE || An(y.selector, f, d));
|
|
4088
4094
|
if (m.length > 0)
|
|
4089
|
-
return m.sort((y,
|
|
4095
|
+
return m.sort((y, w) => lt(y.selector) - lt(w.selector)), m[0];
|
|
4090
4096
|
},
|
|
4091
4097
|
getIntersecting: (f, d, g, m) => e.search({
|
|
4092
4098
|
minX: f,
|
|
@@ -4099,8 +4105,8 @@ const Mi = () => {
|
|
|
4099
4105
|
set: (f, d = !0) => {
|
|
4100
4106
|
d && o();
|
|
4101
4107
|
const g = f.map((m) => {
|
|
4102
|
-
const { minX: y, minY:
|
|
4103
|
-
return { minX: y, minY:
|
|
4108
|
+
const { minX: y, minY: w, maxX: p, maxY: A } = m.selector.geometry.bounds;
|
|
4109
|
+
return { minX: y, minY: w, maxX: p, maxY: A, target: m };
|
|
4104
4110
|
});
|
|
4105
4111
|
g.forEach((m) => t.set(m.target.annotation, m)), e.load(g);
|
|
4106
4112
|
},
|
|
@@ -4109,8 +4115,8 @@ const Mi = () => {
|
|
|
4109
4115
|
s(f), i(d);
|
|
4110
4116
|
}
|
|
4111
4117
|
};
|
|
4112
|
-
},
|
|
4113
|
-
const t =
|
|
4118
|
+
}, ki = (e) => {
|
|
4119
|
+
const t = Jn(), n = Li(), o = Vn(t, e.pointerSelectAction), i = Un(t), s = eo();
|
|
4114
4120
|
return t.observe(({ changes: a }) => {
|
|
4115
4121
|
n.set((a.created || []).map((c) => c.target), !1), (a.deleted || []).forEach((c) => n.remove(c.target)), (a.updated || []).forEach(({ oldValue: c, newValue: u }) => n.update(c.target, u.target));
|
|
4116
4122
|
}), {
|
|
@@ -4126,13 +4132,13 @@ const Mi = () => {
|
|
|
4126
4132
|
hover: i,
|
|
4127
4133
|
viewport: s
|
|
4128
4134
|
};
|
|
4129
|
-
},
|
|
4130
|
-
const t =
|
|
4135
|
+
}, Oi = (e) => {
|
|
4136
|
+
const t = ki(e);
|
|
4131
4137
|
return {
|
|
4132
4138
|
...t,
|
|
4133
|
-
store:
|
|
4139
|
+
store: Qn(t.store)
|
|
4134
4140
|
};
|
|
4135
|
-
},
|
|
4141
|
+
}, Bi = (e) => {
|
|
4136
4142
|
let t, n;
|
|
4137
4143
|
if (e.nodeName === "CANVAS")
|
|
4138
4144
|
t = e, n = t.getContext("2d", { willReadFrequently: !0 });
|
|
@@ -4147,16 +4153,16 @@ const Mi = () => {
|
|
|
4147
4153
|
o += c;
|
|
4148
4154
|
}
|
|
4149
4155
|
return o / 81;
|
|
4150
|
-
},
|
|
4151
|
-
const t =
|
|
4156
|
+
}, Ii = (e) => {
|
|
4157
|
+
const t = Bi(e), n = t > 0.6 ? "dark" : "light";
|
|
4152
4158
|
return console.log(`[Annotorious] Image brightness: ${t.toFixed(1)}. Setting ${n} theme.`), n;
|
|
4153
|
-
},
|
|
4159
|
+
}, Vt = (e, t, n) => t.setAttribute("data-theme", n === "auto" ? Ii(e) : n), Pi = (e, t) => ({
|
|
4154
4160
|
...e,
|
|
4155
4161
|
drawingEnabled: e.drawingEnabled === void 0 ? t.drawingEnabled : e.drawingEnabled,
|
|
4156
4162
|
drawingMode: e.drawingMode || t.drawingMode,
|
|
4157
4163
|
pointerSelectAction: e.pointerSelectAction || t.pointerSelectAction,
|
|
4158
4164
|
theme: e.theme || t.theme
|
|
4159
|
-
}),
|
|
4165
|
+
}), Gt = navigator.userAgent.indexOf("Mac OS X") !== -1, Yi = (e, t) => {
|
|
4160
4166
|
const n = t || document, o = (r) => {
|
|
4161
4167
|
const l = r;
|
|
4162
4168
|
l.key === "z" && l.ctrlKey ? e.undo() : l.key === "y" && l.ctrlKey && e.redo();
|
|
@@ -4164,30 +4170,30 @@ const Mi = () => {
|
|
|
4164
4170
|
const l = r;
|
|
4165
4171
|
l.key === "z" && l.metaKey && (l.shiftKey ? e.redo() : e.undo());
|
|
4166
4172
|
}, s = () => {
|
|
4167
|
-
|
|
4173
|
+
Gt ? n.removeEventListener("keydown", i) : n.removeEventListener("keydown", o);
|
|
4168
4174
|
};
|
|
4169
|
-
return
|
|
4175
|
+
return Gt ? n.addEventListener("keydown", i) : n.addEventListener("keydown", o), {
|
|
4170
4176
|
destroy: s
|
|
4171
4177
|
};
|
|
4172
|
-
},
|
|
4178
|
+
}, Ri = (e, t = {}) => {
|
|
4173
4179
|
if (!e)
|
|
4174
4180
|
throw "Missing argument: image";
|
|
4175
|
-
const n = typeof e == "string" ? document.getElementById(e) : e, o =
|
|
4181
|
+
const n = typeof e == "string" ? document.getElementById(e) : e, o = Pi(t, {
|
|
4176
4182
|
drawingEnabled: !0,
|
|
4177
4183
|
drawingMode: "drag",
|
|
4178
|
-
pointerSelectAction:
|
|
4184
|
+
pointerSelectAction: Qt.EDIT,
|
|
4179
4185
|
theme: "light"
|
|
4180
|
-
}), i =
|
|
4186
|
+
}), i = Oi(o), { selection: s, store: r } = i, l = $n(r), a = to(
|
|
4181
4187
|
i,
|
|
4182
4188
|
l,
|
|
4183
4189
|
o.adapter,
|
|
4184
4190
|
o.autoSave
|
|
4185
4191
|
), c = document.createElement("DIV");
|
|
4186
4192
|
c.style.position = "relative", c.style.display = "inline-block", n.style.display = "block", n.parentNode.insertBefore(c, n), c.appendChild(n);
|
|
4187
|
-
const u =
|
|
4188
|
-
let f =
|
|
4189
|
-
|
|
4190
|
-
const d = new
|
|
4193
|
+
const u = Yi(l);
|
|
4194
|
+
let f = co();
|
|
4195
|
+
Vt(n, c, o.theme);
|
|
4196
|
+
const d = new _i({
|
|
4191
4197
|
target: c,
|
|
4192
4198
|
props: {
|
|
4193
4199
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4199,18 +4205,18 @@ const Mi = () => {
|
|
|
4199
4205
|
}
|
|
4200
4206
|
});
|
|
4201
4207
|
d.$on("click", (Y) => {
|
|
4202
|
-
const { originalEvent:
|
|
4203
|
-
S ? s.clickSelect(S.id,
|
|
4208
|
+
const { originalEvent: b, annotation: S } = Y.detail;
|
|
4209
|
+
S ? s.clickSelect(S.id, b) : s.isEmpty() || s.clear();
|
|
4204
4210
|
});
|
|
4205
|
-
const g =
|
|
4211
|
+
const g = oo(i, l, o.adapter), m = () => {
|
|
4206
4212
|
d.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4207
|
-
}, y = () => f,
|
|
4208
|
-
if (
|
|
4213
|
+
}, y = () => f, w = (Y, b, S) => Jo(Y, b, S), p = (Y, b) => Yo(Y, b), A = (Y) => {
|
|
4214
|
+
if (!nn(Y))
|
|
4209
4215
|
throw `No drawing tool named ${Y}`;
|
|
4210
4216
|
d.$set({ toolName: Y });
|
|
4211
4217
|
}, _ = (Y) => d.$set({ drawingEnabled: Y }), E = (Y) => {
|
|
4212
4218
|
console.warn("Filter not implemented yet");
|
|
4213
|
-
}, B = (Y) => d.$set({ style: Y }), V = (Y) =>
|
|
4219
|
+
}, B = (Y) => d.$set({ style: Y }), V = (Y) => Vt(n, c, Y), U = (Y) => {
|
|
4214
4220
|
f = Y, d.$set({ user: Y });
|
|
4215
4221
|
}, R = (Y) => (
|
|
4216
4222
|
// @ts-ignore
|
|
@@ -4220,10 +4226,10 @@ const Mi = () => {
|
|
|
4220
4226
|
...g,
|
|
4221
4227
|
destroy: m,
|
|
4222
4228
|
getUser: y,
|
|
4223
|
-
listDrawingTools:
|
|
4229
|
+
listDrawingTools: tn,
|
|
4224
4230
|
on: a.on,
|
|
4225
4231
|
off: a.off,
|
|
4226
|
-
registerDrawingTool:
|
|
4232
|
+
registerDrawingTool: w,
|
|
4227
4233
|
registerShapeEditor: p,
|
|
4228
4234
|
setDrawingEnabled: _,
|
|
4229
4235
|
setDrawingTool: A,
|
|
@@ -4236,45 +4242,45 @@ const Mi = () => {
|
|
|
4236
4242
|
};
|
|
4237
4243
|
};
|
|
4238
4244
|
export {
|
|
4239
|
-
|
|
4240
|
-
|
|
4245
|
+
en as Editor,
|
|
4246
|
+
No as EditorMount,
|
|
4241
4247
|
ke as Handle,
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
+
Xi as IdentityTransform,
|
|
4249
|
+
wo as PolygonEditor,
|
|
4250
|
+
Io as RectangleEditor,
|
|
4251
|
+
vn as RectangleUtil,
|
|
4252
|
+
Ho as RubberbandRectangle,
|
|
4253
|
+
_i as SVGAnnotationLayer,
|
|
4248
4254
|
q as ShapeType,
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4255
|
+
Vo as ToolMount,
|
|
4256
|
+
Ci as W3CImageFormat,
|
|
4257
|
+
ci as addEventListeners,
|
|
4252
4258
|
Fe as boundsFromPoints,
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4259
|
+
lt as computeArea,
|
|
4260
|
+
Ri as createImageAnnotator,
|
|
4261
|
+
ki as createImageAnnotatorState,
|
|
4262
|
+
li as createSVGTransform,
|
|
4263
|
+
Oi as createSvelteImageAnnotatorState,
|
|
4264
|
+
Ii as detectTheme,
|
|
4265
|
+
$e as distance,
|
|
4266
|
+
Ao as enableResponsive,
|
|
4267
|
+
Pi as fillDefaults,
|
|
4268
|
+
Po as getEditor,
|
|
4269
|
+
nn as getTool,
|
|
4270
|
+
Yi as initKeyboardCommands,
|
|
4271
|
+
An as intersects,
|
|
4272
|
+
So as isTouch,
|
|
4273
|
+
tn as listDrawingTools,
|
|
4274
|
+
Mn as parseFragmentSelector,
|
|
4275
|
+
Pn as parseSVGSelector,
|
|
4276
|
+
go as parseW3CImageAnnotation,
|
|
4277
|
+
Yo as registerEditor,
|
|
4278
|
+
ft as registerShapeUtil,
|
|
4279
|
+
Jo as registerTool,
|
|
4280
|
+
Bi as sampleBrightness,
|
|
4281
|
+
Ln as serializeFragmentSelector,
|
|
4282
|
+
Yn as serializeSVGSelector,
|
|
4283
|
+
mo as serializeW3CImageAnnotation,
|
|
4284
|
+
Vt as setTheme
|
|
4279
4285
|
};
|
|
4280
4286
|
//# sourceMappingURL=annotorious.es.js.map
|