@annotorious/annotorious 3.0.0-rc.20 → 3.0.0-rc.22
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.d.ts +1 -1
- package/dist/Annotorious.d.ts.map +1 -1
- package/dist/annotation/utils/styling.d.ts +2 -2
- package/dist/annotation/utils/styling.d.ts.map +1 -1
- package/dist/annotorious.css +1 -1
- package/dist/annotorious.es.js +1081 -1072
- 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/src/Annotorious.css +4 -0
- package/src/Annotorious.ts +8 -2
- package/src/annotation/SVGAnnotationLayer.svelte +4 -2
- package/src/annotation/editors/EditorMount.svelte +2 -2
- package/src/annotation/shapes/Ellipse.svelte +2 -2
- package/src/annotation/shapes/Polygon.svelte +2 -2
- package/src/annotation/shapes/Rectangle.svelte +2 -2
- package/src/annotation/utils/styling.ts +5 -2
package/dist/annotorious.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var nn = Object.defineProperty;
|
|
2
2
|
var on = (e, t, n) => t in e ? nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Ke = (e, t, n) => (on(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
-
function
|
|
4
|
+
function G() {
|
|
5
5
|
}
|
|
6
6
|
function nt(e, t) {
|
|
7
7
|
for (const n in t)
|
|
@@ -17,13 +17,13 @@ function Nt(e) {
|
|
|
17
17
|
function dt() {
|
|
18
18
|
return /* @__PURE__ */ Object.create(null);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function le(e) {
|
|
21
21
|
e.forEach(Nt);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function j(e) {
|
|
24
24
|
return typeof e == "function";
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function K(e, t) {
|
|
27
27
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
28
28
|
}
|
|
29
29
|
function sn(e) {
|
|
@@ -33,7 +33,7 @@ function Vt(e, ...t) {
|
|
|
33
33
|
if (e == null) {
|
|
34
34
|
for (const o of t)
|
|
35
35
|
o(void 0);
|
|
36
|
-
return
|
|
36
|
+
return G;
|
|
37
37
|
}
|
|
38
38
|
const n = e.subscribe(...t);
|
|
39
39
|
return n.unsubscribe ? () => n.unsubscribe() : n;
|
|
@@ -86,63 +86,63 @@ function gt(e) {
|
|
|
86
86
|
n[0] !== "$" && (t[n] = e[n]);
|
|
87
87
|
return t;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function ze(e) {
|
|
90
90
|
return e ?? "";
|
|
91
91
|
}
|
|
92
92
|
const fn = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : (
|
|
93
93
|
// @ts-ignore Node typings have this
|
|
94
94
|
global
|
|
95
95
|
);
|
|
96
|
-
function
|
|
96
|
+
function ie(e, t) {
|
|
97
97
|
e.appendChild(t);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function B(e, t, n) {
|
|
100
100
|
e.insertBefore(t, n || null);
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function k(e) {
|
|
103
103
|
e.parentNode && e.parentNode.removeChild(e);
|
|
104
104
|
}
|
|
105
105
|
function rt(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
112
|
function zt(e) {
|
|
113
113
|
return document.createTextNode(e);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function ne() {
|
|
116
116
|
return zt(" ");
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function ae() {
|
|
119
119
|
return zt("");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function H(e, t, n, o) {
|
|
122
122
|
return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function h(e, t, n) {
|
|
125
125
|
n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
126
126
|
}
|
|
127
127
|
function un(e) {
|
|
128
128
|
return Array.from(e.childNodes);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Ee(e, t, n) {
|
|
131
131
|
e.classList.toggle(t, !!n);
|
|
132
132
|
}
|
|
133
133
|
function dn(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) {
|
|
134
134
|
return new CustomEvent(e, { detail: t, bubbles: n, cancelable: o });
|
|
135
135
|
}
|
|
136
|
-
let
|
|
137
|
-
function
|
|
138
|
-
|
|
136
|
+
let Pe;
|
|
137
|
+
function Ie(e) {
|
|
138
|
+
Pe = e;
|
|
139
139
|
}
|
|
140
140
|
function Ht() {
|
|
141
|
-
if (!
|
|
141
|
+
if (!Pe)
|
|
142
142
|
throw new Error("Function called outside component initialization");
|
|
143
|
-
return
|
|
143
|
+
return Pe;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Ye(e) {
|
|
146
146
|
Ht().$$.on_mount.push(e);
|
|
147
147
|
}
|
|
148
148
|
function Te() {
|
|
@@ -163,11 +163,11 @@ function Te() {
|
|
|
163
163
|
return !0;
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function fe(e, t) {
|
|
167
167
|
const n = e.$$.callbacks[t.type];
|
|
168
168
|
n && n.slice().forEach((o) => o.call(this, t));
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const we = [], He = [];
|
|
171
171
|
let Ae = [];
|
|
172
172
|
const mt = [], hn = /* @__PURE__ */ Promise.resolve();
|
|
173
173
|
let ot = !1;
|
|
@@ -178,35 +178,35 @@ function it(e) {
|
|
|
178
178
|
Ae.push(e);
|
|
179
179
|
}
|
|
180
180
|
const We = /* @__PURE__ */ new Set();
|
|
181
|
-
let
|
|
181
|
+
let me = 0;
|
|
182
182
|
function Ft() {
|
|
183
|
-
if (
|
|
183
|
+
if (me !== 0)
|
|
184
184
|
return;
|
|
185
|
-
const e =
|
|
185
|
+
const e = Pe;
|
|
186
186
|
do {
|
|
187
187
|
try {
|
|
188
|
-
for (;
|
|
189
|
-
const t =
|
|
190
|
-
|
|
188
|
+
for (; me < we.length; ) {
|
|
189
|
+
const t = we[me];
|
|
190
|
+
me++, Ie(t), mn(t.$$);
|
|
191
191
|
}
|
|
192
192
|
} catch (t) {
|
|
193
|
-
throw
|
|
193
|
+
throw we.length = 0, me = 0, t;
|
|
194
194
|
}
|
|
195
|
-
for (
|
|
195
|
+
for (Ie(null), we.length = 0, me = 0; He.length; )
|
|
196
196
|
He.pop()();
|
|
197
197
|
for (let t = 0; t < Ae.length; t += 1) {
|
|
198
198
|
const n = Ae[t];
|
|
199
199
|
We.has(n) || (We.add(n), n());
|
|
200
200
|
}
|
|
201
201
|
Ae.length = 0;
|
|
202
|
-
} while (
|
|
202
|
+
} while (we.length);
|
|
203
203
|
for (; mt.length; )
|
|
204
204
|
mt.pop()();
|
|
205
|
-
ot = !1, We.clear(),
|
|
205
|
+
ot = !1, We.clear(), Ie(e);
|
|
206
206
|
}
|
|
207
207
|
function mn(e) {
|
|
208
208
|
if (e.fragment !== null) {
|
|
209
|
-
e.update(),
|
|
209
|
+
e.update(), le(e.before_update);
|
|
210
210
|
const t = e.dirty;
|
|
211
211
|
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(it);
|
|
212
212
|
}
|
|
@@ -215,28 +215,28 @@ function pn(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
|
}
|
|
218
|
-
const
|
|
219
|
-
let
|
|
220
|
-
function
|
|
221
|
-
|
|
218
|
+
const Ge = /* @__PURE__ */ new Set();
|
|
219
|
+
let ue;
|
|
220
|
+
function se() {
|
|
221
|
+
ue = {
|
|
222
222
|
r: 0,
|
|
223
223
|
c: [],
|
|
224
|
-
p:
|
|
224
|
+
p: ue
|
|
225
225
|
// parent group
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
|
|
228
|
+
function re() {
|
|
229
|
+
ue.r || le(ue.c), ue = ue.p;
|
|
230
230
|
}
|
|
231
231
|
function P(e, t) {
|
|
232
|
-
e && e.i && (
|
|
232
|
+
e && e.i && (Ge.delete(e), e.i(t));
|
|
233
233
|
}
|
|
234
234
|
function D(e, t, n, o) {
|
|
235
235
|
if (e && e.o) {
|
|
236
|
-
if (
|
|
236
|
+
if (Ge.has(e))
|
|
237
237
|
return;
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
Ge.add(e), ue.c.push(() => {
|
|
239
|
+
Ge.delete(e), o && (n && e.d(1), o());
|
|
240
240
|
}), e.o(t);
|
|
241
241
|
} else
|
|
242
242
|
o && o();
|
|
@@ -250,26 +250,26 @@ function $(e) {
|
|
|
250
250
|
function Q(e, t, n) {
|
|
251
251
|
const { fragment: o, after_update: i } = e.$$;
|
|
252
252
|
o && o.m(t, n), it(() => {
|
|
253
|
-
const s = e.$$.on_mount.map(Nt).filter(
|
|
254
|
-
e.$$.on_destroy ? e.$$.on_destroy.push(...s) :
|
|
253
|
+
const s = e.$$.on_mount.map(Nt).filter(j);
|
|
254
|
+
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : le(s), e.$$.on_mount = [];
|
|
255
255
|
}), i.forEach(it);
|
|
256
256
|
}
|
|
257
257
|
function x(e, t) {
|
|
258
258
|
const n = e.$$;
|
|
259
|
-
n.fragment !== null && (pn(n.after_update),
|
|
259
|
+
n.fragment !== null && (pn(n.after_update), le(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
260
260
|
}
|
|
261
261
|
function yn(e, t) {
|
|
262
|
-
e.$$.dirty[0] === -1 && (
|
|
262
|
+
e.$$.dirty[0] === -1 && (we.push(e), gn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
263
263
|
}
|
|
264
264
|
function ee(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
265
|
-
const a =
|
|
266
|
-
|
|
265
|
+
const a = Pe;
|
|
266
|
+
Ie(e);
|
|
267
267
|
const c = e.$$ = {
|
|
268
268
|
fragment: null,
|
|
269
269
|
ctx: [],
|
|
270
270
|
// state
|
|
271
271
|
props: s,
|
|
272
|
-
update:
|
|
272
|
+
update: G,
|
|
273
273
|
not_equal: i,
|
|
274
274
|
bound: dt(),
|
|
275
275
|
// lifecycle
|
|
@@ -287,18 +287,18 @@ function ee(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
287
287
|
};
|
|
288
288
|
r && r(c.root);
|
|
289
289
|
let u = !1;
|
|
290
|
-
if (c.ctx = n ? n(e, t.props || {}, (f,
|
|
291
|
-
const m = g.length ? g[0] :
|
|
292
|
-
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u && yn(e, f)),
|
|
293
|
-
}) : [], c.update(), u = !0,
|
|
290
|
+
if (c.ctx = n ? n(e, t.props || {}, (f, d, ...g) => {
|
|
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 && yn(e, f)), d;
|
|
293
|
+
}) : [], c.update(), u = !0, le(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
294
294
|
if (t.hydrate) {
|
|
295
295
|
const f = un(t.target);
|
|
296
|
-
c.fragment && c.fragment.l(f), f.forEach(
|
|
296
|
+
c.fragment && c.fragment.l(f), f.forEach(k);
|
|
297
297
|
} else
|
|
298
298
|
c.fragment && c.fragment.c();
|
|
299
299
|
t.intro && P(e.$$.fragment), Q(e, t.target, t.anchor), Ft();
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
Ie(a);
|
|
302
302
|
}
|
|
303
303
|
class te {
|
|
304
304
|
constructor() {
|
|
@@ -321,7 +321,7 @@ class te {
|
|
|
321
321
|
}
|
|
322
322
|
/** @returns {void} */
|
|
323
323
|
$destroy() {
|
|
324
|
-
x(this, 1), this.$destroy =
|
|
324
|
+
x(this, 1), this.$destroy = G;
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
327
327
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -330,8 +330,8 @@ class te {
|
|
|
330
330
|
* @returns {() => void}
|
|
331
331
|
*/
|
|
332
332
|
$on(t, n) {
|
|
333
|
-
if (!
|
|
334
|
-
return
|
|
333
|
+
if (!j(n))
|
|
334
|
+
return G;
|
|
335
335
|
const o = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
|
|
336
336
|
return o.push(n), () => {
|
|
337
337
|
const i = o.indexOf(n);
|
|
@@ -348,7 +348,7 @@ class te {
|
|
|
348
348
|
}
|
|
349
349
|
const _n = "4";
|
|
350
350
|
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(_n);
|
|
351
|
-
var
|
|
351
|
+
var F = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(F || {});
|
|
352
352
|
const lt = {}, at = (e, t) => lt[e] = t, st = (e) => lt[e.type].area(e), wn = (e, t, n) => lt[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]) => {
|
|
@@ -357,11 +357,11 @@ const lt = {}, at = (e, t) => lt[e] = t, st = (e) => lt[e.type].area(e), wn = (e
|
|
|
357
357
|
}, bn = {
|
|
358
358
|
area: (e) => Math.PI * e.geometry.rx * e.geometry.ry,
|
|
359
359
|
intersects: (e, t, n) => {
|
|
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,
|
|
361
|
-
return
|
|
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
|
+
return d * d / (s * s) + g * g / (r * r) <= 1;
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
|
-
at(
|
|
364
|
+
at(F.ELLIPSE, bn);
|
|
365
365
|
const En = {
|
|
366
366
|
area: (e) => {
|
|
367
367
|
const { points: t } = e.geometry;
|
|
@@ -380,31 +380,31 @@ const En = {
|
|
|
380
380
|
return i;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
at(
|
|
383
|
+
at(F.POLYGON, En);
|
|
384
384
|
const An = {
|
|
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
|
-
at(
|
|
388
|
+
at(F.RECTANGLE, An);
|
|
389
389
|
const Sn = (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);
|
|
393
393
|
if (l && l !== "pixel")
|
|
394
394
|
throw new Error(`Unsupported MediaFragment unit: ${l}`);
|
|
395
|
-
const [
|
|
395
|
+
const [d, g, m, y] = [a, c, u, f].map(parseFloat);
|
|
396
396
|
return {
|
|
397
|
-
type:
|
|
397
|
+
type: F.RECTANGLE,
|
|
398
398
|
geometry: {
|
|
399
|
-
x:
|
|
399
|
+
x: d,
|
|
400
400
|
y: g,
|
|
401
401
|
w: m,
|
|
402
|
-
h:
|
|
402
|
+
h: y,
|
|
403
403
|
bounds: {
|
|
404
|
-
minX:
|
|
405
|
-
minY: t ? g -
|
|
406
|
-
maxX:
|
|
407
|
-
maxY: t ? g : g +
|
|
404
|
+
minX: d,
|
|
405
|
+
minY: t ? g - y : g,
|
|
406
|
+
maxX: d + m,
|
|
407
|
+
maxY: t ? g : g + y
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
};
|
|
@@ -431,7 +431,7 @@ const Sn = (e, t = !1) => {
|
|
|
431
431
|
}, Ln = (e) => {
|
|
432
432
|
const [t, n, o] = e.match(/(<polygon points=["|'])([^("|')]*)/) || [], i = o.split(" ").map((s) => s.split(",").map(parseFloat));
|
|
433
433
|
return {
|
|
434
|
-
type:
|
|
434
|
+
type: F.POLYGON,
|
|
435
435
|
geometry: {
|
|
436
436
|
points: i,
|
|
437
437
|
bounds: Fe(i)
|
|
@@ -445,7 +445,7 @@ const Sn = (e, t = !1) => {
|
|
|
445
445
|
maxY: o + s
|
|
446
446
|
};
|
|
447
447
|
return {
|
|
448
|
-
type:
|
|
448
|
+
type: F.ELLIPSE,
|
|
449
449
|
geometry: {
|
|
450
450
|
cx: n,
|
|
451
451
|
cy: o,
|
|
@@ -463,10 +463,10 @@ const Sn = (e, t = !1) => {
|
|
|
463
463
|
throw "Unsupported SVG shape: " + t;
|
|
464
464
|
}, Bn = (e) => {
|
|
465
465
|
let t;
|
|
466
|
-
if (e.type ===
|
|
466
|
+
if (e.type === F.POLYGON) {
|
|
467
467
|
const n = e.geometry, { points: o } = n;
|
|
468
468
|
t = `<svg><polygon points="${o.map((i) => i.join(",")).join(" ")}" /></svg>`;
|
|
469
|
-
} else if (e.type ===
|
|
469
|
+
} else if (e.type === F.ELLIPSE) {
|
|
470
470
|
const n = e.geometry;
|
|
471
471
|
t = `<svg><ellipse cx="${n.cx}" cy="${n.cy}" rx="${n.rx}" ry="${n.ry}" /></svg>`;
|
|
472
472
|
}
|
|
@@ -474,18 +474,18 @@ const Sn = (e, t = !1) => {
|
|
|
474
474
|
return { type: "SvgSelector", value: t };
|
|
475
475
|
throw `Unsupported shape type: ${e.type}`;
|
|
476
476
|
};
|
|
477
|
-
let
|
|
477
|
+
let Ue;
|
|
478
478
|
const In = new Uint8Array(16);
|
|
479
479
|
function Pn() {
|
|
480
|
-
if (!
|
|
480
|
+
if (!Ue && (Ue = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ue))
|
|
481
481
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
482
|
-
return
|
|
482
|
+
return Ue(In);
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const q = [];
|
|
485
485
|
for (let e = 0; e < 256; ++e)
|
|
486
|
-
|
|
486
|
+
q.push((e + 256).toString(16).slice(1));
|
|
487
487
|
function Yn(e, t = 0) {
|
|
488
|
-
return
|
|
488
|
+
return q[e[t + 0]] + q[e[t + 1]] + q[e[t + 2]] + q[e[t + 3]] + "-" + q[e[t + 4]] + q[e[t + 5]] + "-" + q[e[t + 6]] + q[e[t + 7]] + "-" + q[e[t + 8]] + q[e[t + 9]] + "-" + q[e[t + 10]] + q[e[t + 11]] + q[e[t + 12]] + q[e[t + 13]] + q[e[t + 14]] + q[e[t + 15]];
|
|
489
489
|
}
|
|
490
490
|
const Cn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), yt = {
|
|
491
491
|
randomUUID: Cn
|
|
@@ -504,7 +504,7 @@ function qt(e, t, n) {
|
|
|
504
504
|
return Yn(o);
|
|
505
505
|
}
|
|
506
506
|
var _t = Object.prototype.hasOwnProperty;
|
|
507
|
-
function
|
|
507
|
+
function de(e, t) {
|
|
508
508
|
var n, o;
|
|
509
509
|
if (e === t)
|
|
510
510
|
return !0;
|
|
@@ -515,14 +515,14 @@ function he(e, t) {
|
|
|
515
515
|
return e.toString() === t.toString();
|
|
516
516
|
if (n === Array) {
|
|
517
517
|
if ((o = e.length) === t.length)
|
|
518
|
-
for (; o-- &&
|
|
518
|
+
for (; o-- && de(e[o], t[o]); )
|
|
519
519
|
;
|
|
520
520
|
return o === -1;
|
|
521
521
|
}
|
|
522
522
|
if (!n || typeof e == "object") {
|
|
523
523
|
o = 0;
|
|
524
524
|
for (n in e)
|
|
525
|
-
if (_t.call(e, n) && ++o && !_t.call(t, n) || !(n in t) || !
|
|
525
|
+
if (_t.call(e, n) && ++o && !_t.call(t, n) || !(n in t) || !de(e[n], t[n]))
|
|
526
526
|
return !1;
|
|
527
527
|
return Object.keys(t).length === o;
|
|
528
528
|
}
|
|
@@ -534,19 +534,19 @@ function Je() {
|
|
|
534
534
|
function Dn(e, t) {
|
|
535
535
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
536
536
|
}
|
|
537
|
-
const
|
|
537
|
+
const pe = [];
|
|
538
538
|
function ct(e, t = Je) {
|
|
539
539
|
let n;
|
|
540
540
|
const o = /* @__PURE__ */ new Set();
|
|
541
541
|
function i(l) {
|
|
542
542
|
if (Dn(e, l) && (e = l, n)) {
|
|
543
|
-
const a = !
|
|
543
|
+
const a = !pe.length;
|
|
544
544
|
for (const c of o)
|
|
545
|
-
c[1](),
|
|
545
|
+
c[1](), pe.push(c, e);
|
|
546
546
|
if (a) {
|
|
547
|
-
for (let c = 0; c <
|
|
548
|
-
|
|
549
|
-
|
|
547
|
+
for (let c = 0; c < pe.length; c += 2)
|
|
548
|
+
pe[c][0](pe[c + 1]);
|
|
549
|
+
pe.length = 0;
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
}
|
|
@@ -589,25 +589,25 @@ const Ze = { selected: [] }, Rn = (e, t = "EDIT") => {
|
|
|
589
589
|
}, l = (f) => {
|
|
590
590
|
if (i.selected.length === 0)
|
|
591
591
|
return !1;
|
|
592
|
-
const
|
|
593
|
-
return i.selected.some((g) => g.id ===
|
|
594
|
-
}, a = (f,
|
|
592
|
+
const d = typeof f == "string" ? f : f.id;
|
|
593
|
+
return i.selected.some((g) => g.id === d);
|
|
594
|
+
}, a = (f, d) => {
|
|
595
595
|
const g = e.getAnnotation(f);
|
|
596
596
|
if (g) {
|
|
597
597
|
const m = Un(g, t);
|
|
598
|
-
o(m === "EDIT" ? { selected: [{ id: f, editable: !0 }], pointerEvent:
|
|
598
|
+
o(m === "EDIT" ? { selected: [{ id: f, editable: !0 }], pointerEvent: d } : m === "SELECT" ? { selected: [{ id: f }], pointerEvent: d } : { selected: [], pointerEvent: d });
|
|
599
599
|
} else
|
|
600
600
|
console.warn("Invalid selection: " + f);
|
|
601
|
-
}, c = (f,
|
|
602
|
-
const g = Array.isArray(f) ? f : [f], m = g.map((
|
|
603
|
-
o({ selected: m.map(({ id:
|
|
601
|
+
}, c = (f, d = !0) => {
|
|
602
|
+
const g = Array.isArray(f) ? f : [f], m = g.map((y) => e.getAnnotation(y)).filter(Boolean);
|
|
603
|
+
o({ selected: m.map(({ id: y }) => ({ id: y, editable: d })) }), m.length !== g.length && console.warn("Invalid selection", f);
|
|
604
604
|
}, u = (f) => {
|
|
605
605
|
if (i.selected.length === 0)
|
|
606
606
|
return !1;
|
|
607
|
-
const { selected:
|
|
608
|
-
|
|
607
|
+
const { selected: d } = i;
|
|
608
|
+
d.filter(({ id: g }) => f.includes(g)).length > 0 && o({ selected: d.filter(({ id: g }) => !f.includes(g)) });
|
|
609
609
|
};
|
|
610
|
-
return e.observe(({ changes: f }) => u((f.deleted || []).map((
|
|
610
|
+
return e.observe(({ changes: f }) => u((f.deleted || []).map((d) => d.id))), {
|
|
611
611
|
clear: s,
|
|
612
612
|
clickSelect: a,
|
|
613
613
|
get selected() {
|
|
@@ -633,8 +633,8 @@ const Vn = (e, t) => {
|
|
|
633
633
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
634
634
|
}, zn = (e, t) => t.bodies.map((n) => {
|
|
635
635
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
636
|
-
return { newBody: n, oldBody: o && !
|
|
637
|
-
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), Hn = (e, t) => !
|
|
636
|
+
return { newBody: n, oldBody: o && !de(o, n) ? o : void 0 };
|
|
637
|
+
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), Hn = (e, t) => !de(e.target, t.target), Wt = (e, t) => {
|
|
638
638
|
const n = Vn(e, t), o = Gn(e, t), i = zn(e, t);
|
|
639
639
|
return {
|
|
640
640
|
oldValue: e,
|
|
@@ -645,7 +645,7 @@ const Vn = (e, t) => {
|
|
|
645
645
|
targetUpdated: Hn(e, t) ? { oldTarget: e.target, newTarget: t.target } : void 0
|
|
646
646
|
};
|
|
647
647
|
};
|
|
648
|
-
var
|
|
648
|
+
var z = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.REMOTE = "REMOTE", e))(z || {});
|
|
649
649
|
const Fn = (e, t) => {
|
|
650
650
|
var n, o;
|
|
651
651
|
const { changes: i, origin: s } = t;
|
|
@@ -670,17 +670,17 @@ const Fn = (e, t) => {
|
|
|
670
670
|
return !0;
|
|
671
671
|
}, jn = (e, t) => {
|
|
672
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 = [
|
|
673
|
-
...(e.created || []).filter((f) => !s.has(f.id)).map((f) => r.has(f.id) ? t.updated.find(({ oldValue:
|
|
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),
|
|
674
674
|
...t.created || []
|
|
675
675
|
], c = [
|
|
676
676
|
...(e.deleted || []).filter((f) => !i.has(f.id)),
|
|
677
677
|
...(t.deleted || []).filter((f) => !n.has(f.id))
|
|
678
678
|
], u = [
|
|
679
679
|
...(e.updated || []).filter(({ newValue: f }) => !s.has(f.id)).map((f) => {
|
|
680
|
-
const { oldValue:
|
|
680
|
+
const { oldValue: d, newValue: g } = f;
|
|
681
681
|
if (r.has(g.id)) {
|
|
682
|
-
const m = t.updated.find((
|
|
683
|
-
return Wt(
|
|
682
|
+
const m = t.updated.find((y) => y.oldValue.id === g.id).newValue;
|
|
683
|
+
return Wt(d, m);
|
|
684
684
|
} else
|
|
685
685
|
return f;
|
|
686
686
|
}),
|
|
@@ -688,188 +688,188 @@ const Fn = (e, t) => {
|
|
|
688
688
|
];
|
|
689
689
|
return { created: a, deleted: c, updated: u };
|
|
690
690
|
}, qn = (e) => e.id !== void 0, Kn = () => {
|
|
691
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
}, s = (
|
|
695
|
-
const
|
|
696
|
-
origin:
|
|
691
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (_, b = {}) => n.push({ onChange: _, options: b }), i = (_) => {
|
|
692
|
+
const b = n.findIndex((T) => T.onChange == _);
|
|
693
|
+
b > -1 && n.splice(b, 1);
|
|
694
|
+
}, s = (_, b) => {
|
|
695
|
+
const T = {
|
|
696
|
+
origin: _,
|
|
697
697
|
changes: {
|
|
698
|
-
created:
|
|
699
|
-
updated:
|
|
700
|
-
deleted:
|
|
698
|
+
created: b.created || [],
|
|
699
|
+
updated: b.updated || [],
|
|
700
|
+
deleted: b.deleted || []
|
|
701
701
|
},
|
|
702
702
|
state: [...e.values()]
|
|
703
703
|
};
|
|
704
704
|
n.forEach((M) => {
|
|
705
|
-
Fn(M,
|
|
705
|
+
Fn(M, T) && M.onChange(T);
|
|
706
706
|
});
|
|
707
|
-
}, r = (
|
|
708
|
-
if (e.get(
|
|
709
|
-
throw Error(`Cannot add annotation ${
|
|
710
|
-
e.set(
|
|
711
|
-
}, l = (
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
const
|
|
715
|
-
return M ===
|
|
707
|
+
}, r = (_, b = z.LOCAL) => {
|
|
708
|
+
if (e.get(_.id))
|
|
709
|
+
throw Error(`Cannot add annotation ${_.id} - exists already`);
|
|
710
|
+
e.set(_.id, _), _.bodies.forEach((T) => t.set(T.id, _.id)), s(b, { created: [_] });
|
|
711
|
+
}, l = (_, b) => {
|
|
712
|
+
const T = typeof _ == "string" ? b : _, M = typeof _ == "string" ? _ : _.id, O = e.get(M);
|
|
713
|
+
if (O) {
|
|
714
|
+
const Y = Wt(O, T);
|
|
715
|
+
return M === T.id ? e.set(M, T) : (e.delete(M), e.set(T.id, T)), O.bodies.forEach((Z) => t.delete(Z.id)), T.bodies.forEach((Z) => t.set(Z.id, T.id)), Y;
|
|
716
716
|
} else
|
|
717
717
|
console.warn(`Cannot update annotation ${M} - does not exist`);
|
|
718
|
-
}, a = (
|
|
719
|
-
const M = qn(
|
|
720
|
-
|
|
721
|
-
}, c = (
|
|
722
|
-
const
|
|
723
|
-
const
|
|
724
|
-
return
|
|
718
|
+
}, a = (_, b = z.LOCAL, T = z.LOCAL) => {
|
|
719
|
+
const M = qn(b) ? T : b, O = l(_, b);
|
|
720
|
+
O && s(M, { updated: [O] });
|
|
721
|
+
}, c = (_, b = z.LOCAL) => {
|
|
722
|
+
const T = _.reduce((M, O) => {
|
|
723
|
+
const Y = l(O);
|
|
724
|
+
return Y ? [...M, Y] : M;
|
|
725
725
|
}, []);
|
|
726
|
-
|
|
727
|
-
}, u = (
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
726
|
+
T.length > 0 && s(b, { updated: T });
|
|
727
|
+
}, u = (_, b = z.LOCAL) => {
|
|
728
|
+
const T = e.get(_.annotation);
|
|
729
|
+
if (T) {
|
|
730
730
|
const M = {
|
|
731
|
-
...
|
|
732
|
-
bodies: [...
|
|
731
|
+
...T,
|
|
732
|
+
bodies: [...T.bodies, _]
|
|
733
733
|
};
|
|
734
|
-
e.set(
|
|
735
|
-
oldValue:
|
|
734
|
+
e.set(T.id, M), t.set(_.id, M.id), s(b, { updated: [{
|
|
735
|
+
oldValue: T,
|
|
736
736
|
newValue: M,
|
|
737
|
-
bodiesCreated: [
|
|
737
|
+
bodiesCreated: [_]
|
|
738
738
|
}] });
|
|
739
739
|
} else
|
|
740
|
-
console.warn(`Attempt to add body to missing annotation: ${
|
|
741
|
-
}, f = () => [...e.values()],
|
|
742
|
-
const
|
|
743
|
-
e.clear(), t.clear(), s(
|
|
744
|
-
}, g = (
|
|
745
|
-
if (
|
|
740
|
+
console.warn(`Attempt to add body to missing annotation: ${_.annotation}`);
|
|
741
|
+
}, f = () => [...e.values()], d = (_ = z.LOCAL) => {
|
|
742
|
+
const b = [...e.values()];
|
|
743
|
+
e.clear(), t.clear(), s(_, { deleted: b });
|
|
744
|
+
}, g = (_, b = !0, T = z.LOCAL) => {
|
|
745
|
+
if (b) {
|
|
746
746
|
const M = [...e.values()];
|
|
747
|
-
e.clear(), t.clear(),
|
|
748
|
-
e.set(
|
|
749
|
-
}), s(
|
|
747
|
+
e.clear(), t.clear(), _.forEach((O) => {
|
|
748
|
+
e.set(O.id, O), O.bodies.forEach((Y) => t.set(Y.id, O.id));
|
|
749
|
+
}), s(T, { created: _, deleted: M });
|
|
750
750
|
} else {
|
|
751
|
-
const M =
|
|
752
|
-
const Z = e.get(
|
|
753
|
-
return Z ? [...
|
|
751
|
+
const M = _.reduce((O, Y) => {
|
|
752
|
+
const Z = e.get(Y.id);
|
|
753
|
+
return Z ? [...O, Z] : O;
|
|
754
754
|
}, []);
|
|
755
755
|
if (M.length > 0)
|
|
756
|
-
throw Error(`Bulk insert would overwrite the following annotations: ${M.map((
|
|
757
|
-
|
|
758
|
-
e.set(
|
|
759
|
-
}), s(
|
|
756
|
+
throw Error(`Bulk insert would overwrite the following annotations: ${M.map((O) => O.id).join(", ")}`);
|
|
757
|
+
_.forEach((O) => {
|
|
758
|
+
e.set(O.id, O), O.bodies.forEach((Y) => t.set(Y.id, O.id));
|
|
759
|
+
}), s(T, { created: _ });
|
|
760
760
|
}
|
|
761
|
-
}, m = (
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
764
|
-
return e.delete(
|
|
765
|
-
console.warn(`Attempt to delete missing annotation: ${
|
|
766
|
-
},
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
},
|
|
770
|
-
const
|
|
771
|
-
const
|
|
772
|
-
return
|
|
761
|
+
}, m = (_) => {
|
|
762
|
+
const b = typeof _ == "string" ? _ : _.id, T = e.get(b);
|
|
763
|
+
if (T)
|
|
764
|
+
return e.delete(b), T.bodies.forEach((M) => t.delete(M.id)), T;
|
|
765
|
+
console.warn(`Attempt to delete missing annotation: ${b}`);
|
|
766
|
+
}, y = (_, b = z.LOCAL) => {
|
|
767
|
+
const T = m(_);
|
|
768
|
+
T && s(b, { deleted: [T] });
|
|
769
|
+
}, E = (_, b = z.LOCAL) => {
|
|
770
|
+
const T = _.reduce((M, O) => {
|
|
771
|
+
const Y = m(O);
|
|
772
|
+
return Y ? [...M, Y] : M;
|
|
773
773
|
}, []);
|
|
774
|
-
|
|
775
|
-
},
|
|
776
|
-
const
|
|
777
|
-
if (
|
|
778
|
-
const M =
|
|
774
|
+
T.length > 0 && s(b, { deleted: T });
|
|
775
|
+
}, p = (_, b = z.LOCAL) => {
|
|
776
|
+
const T = e.get(_.annotation);
|
|
777
|
+
if (T) {
|
|
778
|
+
const M = T.bodies.find((O) => O.id === _.id);
|
|
779
779
|
if (M) {
|
|
780
780
|
t.delete(M.id);
|
|
781
|
-
const
|
|
782
|
-
...
|
|
783
|
-
bodies:
|
|
781
|
+
const O = {
|
|
782
|
+
...T,
|
|
783
|
+
bodies: T.bodies.filter((Y) => Y.id !== _.id)
|
|
784
784
|
};
|
|
785
|
-
e.set(
|
|
786
|
-
oldValue:
|
|
787
|
-
newValue:
|
|
785
|
+
e.set(T.id, O), s(b, { updated: [{
|
|
786
|
+
oldValue: T,
|
|
787
|
+
newValue: O,
|
|
788
788
|
bodiesDeleted: [M]
|
|
789
789
|
}] });
|
|
790
790
|
} else
|
|
791
|
-
console.warn(`Attempt to delete missing body ${
|
|
791
|
+
console.warn(`Attempt to delete missing body ${_.id} from annotation ${_.annotation}`);
|
|
792
792
|
} else
|
|
793
|
-
console.warn(`Attempt to delete body from missing annotation ${
|
|
794
|
-
},
|
|
795
|
-
const
|
|
796
|
-
return
|
|
797
|
-
}, w = (
|
|
798
|
-
const
|
|
799
|
-
if (
|
|
800
|
-
const
|
|
801
|
-
if (
|
|
802
|
-
return
|
|
803
|
-
console.error(`Store integrity error: body ${
|
|
793
|
+
console.warn(`Attempt to delete body from missing annotation ${_.annotation}`);
|
|
794
|
+
}, S = (_) => {
|
|
795
|
+
const b = e.get(_);
|
|
796
|
+
return b ? { ...b } : void 0;
|
|
797
|
+
}, w = (_) => {
|
|
798
|
+
const b = t.get(_);
|
|
799
|
+
if (b) {
|
|
800
|
+
const T = S(b).bodies.find((M) => M.id === _);
|
|
801
|
+
if (T)
|
|
802
|
+
return T;
|
|
803
|
+
console.error(`Store integrity error: body ${_} in index, but not in annotation`);
|
|
804
804
|
} else
|
|
805
|
-
console.warn(`Attempt to retrieve missing body: ${
|
|
806
|
-
},
|
|
807
|
-
if (
|
|
805
|
+
console.warn(`Attempt to retrieve missing body: ${_}`);
|
|
806
|
+
}, A = (_, b) => {
|
|
807
|
+
if (_.annotation !== b.annotation)
|
|
808
808
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
811
|
-
const M =
|
|
812
|
-
...
|
|
813
|
-
bodies:
|
|
809
|
+
const T = e.get(_.annotation);
|
|
810
|
+
if (T) {
|
|
811
|
+
const M = T.bodies.find((Y) => Y.id === _.id), O = {
|
|
812
|
+
...T,
|
|
813
|
+
bodies: T.bodies.map((Y) => Y.id === M.id ? b : Y)
|
|
814
814
|
};
|
|
815
|
-
return e.set(
|
|
816
|
-
oldValue:
|
|
817
|
-
newValue:
|
|
818
|
-
bodiesUpdated: [{ oldBody: M, newBody:
|
|
815
|
+
return e.set(T.id, O), M.id !== b.id && (t.delete(M.id), t.set(b.id, O.id)), {
|
|
816
|
+
oldValue: T,
|
|
817
|
+
newValue: O,
|
|
818
|
+
bodiesUpdated: [{ oldBody: M, newBody: b }]
|
|
819
819
|
};
|
|
820
820
|
} else
|
|
821
|
-
console.warn(`Attempt to add body to missing annotation ${
|
|
822
|
-
},
|
|
823
|
-
const M =
|
|
824
|
-
M && s(
|
|
825
|
-
},
|
|
826
|
-
const
|
|
827
|
-
s(
|
|
828
|
-
},
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
831
|
-
const
|
|
832
|
-
...
|
|
821
|
+
console.warn(`Attempt to add body to missing annotation ${_.annotation}`);
|
|
822
|
+
}, I = (_, b, T = z.LOCAL) => {
|
|
823
|
+
const M = A(_, b);
|
|
824
|
+
M && s(T, { updated: [M] });
|
|
825
|
+
}, N = (_, b = z.LOCAL) => {
|
|
826
|
+
const T = _.map((M) => A({ id: M.id, annotation: M.annotation }, M)).filter(Boolean);
|
|
827
|
+
s(b, { updated: T });
|
|
828
|
+
}, U = (_) => {
|
|
829
|
+
const b = e.get(_.annotation);
|
|
830
|
+
if (b) {
|
|
831
|
+
const T = {
|
|
832
|
+
...b,
|
|
833
833
|
target: {
|
|
834
|
-
...
|
|
835
|
-
...
|
|
834
|
+
...b.target,
|
|
835
|
+
..._
|
|
836
836
|
}
|
|
837
837
|
};
|
|
838
|
-
return e.set(
|
|
839
|
-
oldValue:
|
|
840
|
-
newValue:
|
|
838
|
+
return e.set(b.id, T), {
|
|
839
|
+
oldValue: b,
|
|
840
|
+
newValue: T,
|
|
841
841
|
targetUpdated: {
|
|
842
|
-
oldTarget:
|
|
843
|
-
newTarget:
|
|
842
|
+
oldTarget: b.target,
|
|
843
|
+
newTarget: _
|
|
844
844
|
}
|
|
845
845
|
};
|
|
846
846
|
} else
|
|
847
|
-
console.warn(`Attempt to update target on missing annotation: ${
|
|
847
|
+
console.warn(`Attempt to update target on missing annotation: ${_.annotation}`);
|
|
848
848
|
};
|
|
849
849
|
return {
|
|
850
850
|
addAnnotation: r,
|
|
851
851
|
addBody: u,
|
|
852
852
|
all: f,
|
|
853
853
|
bulkAddAnnotation: g,
|
|
854
|
-
bulkDeleteAnnotation:
|
|
854
|
+
bulkDeleteAnnotation: E,
|
|
855
855
|
bulkUpdateAnnotation: c,
|
|
856
|
-
bulkUpdateBodies:
|
|
857
|
-
bulkUpdateTargets: (
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
},
|
|
861
|
-
clear:
|
|
862
|
-
deleteAnnotation:
|
|
863
|
-
deleteBody:
|
|
864
|
-
getAnnotation:
|
|
856
|
+
bulkUpdateBodies: N,
|
|
857
|
+
bulkUpdateTargets: (_, b = z.LOCAL) => {
|
|
858
|
+
const T = _.map((M) => U(M)).filter(Boolean);
|
|
859
|
+
T.length > 0 && s(b, { updated: T });
|
|
860
|
+
},
|
|
861
|
+
clear: d,
|
|
862
|
+
deleteAnnotation: y,
|
|
863
|
+
deleteBody: p,
|
|
864
|
+
getAnnotation: S,
|
|
865
865
|
getBody: w,
|
|
866
866
|
observe: o,
|
|
867
867
|
unobserve: i,
|
|
868
868
|
updateAnnotation: a,
|
|
869
|
-
updateBody:
|
|
870
|
-
updateTarget: (
|
|
871
|
-
const
|
|
872
|
-
|
|
869
|
+
updateBody: I,
|
|
870
|
+
updateTarget: (_, b = z.LOCAL) => {
|
|
871
|
+
const T = U(_);
|
|
872
|
+
T && s(b, { updated: [T] });
|
|
873
873
|
}
|
|
874
874
|
};
|
|
875
875
|
}, Wn = (e) => ({
|
|
@@ -898,19 +898,19 @@ const Zn = 250, Qn = (e) => {
|
|
|
898
898
|
let o = -1, i = !1, s = 0;
|
|
899
899
|
const r = (g) => {
|
|
900
900
|
if (!i) {
|
|
901
|
-
const { changes: m } = g,
|
|
902
|
-
if (
|
|
901
|
+
const { changes: m } = g, y = performance.now();
|
|
902
|
+
if (y - s > Zn)
|
|
903
903
|
n.splice(o + 1), n.push(m), o = n.length - 1;
|
|
904
904
|
else {
|
|
905
|
-
const
|
|
906
|
-
n[
|
|
905
|
+
const E = n.length - 1;
|
|
906
|
+
n[E] = jn(n[E], m);
|
|
907
907
|
}
|
|
908
|
-
s =
|
|
908
|
+
s = y;
|
|
909
909
|
}
|
|
910
910
|
i = !1;
|
|
911
911
|
};
|
|
912
|
-
e.observe(r, { origin:
|
|
913
|
-
const l = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g), a = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), c = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ oldValue: m }) => m)), u = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ newValue: m }) => m)), f = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1),
|
|
912
|
+
e.observe(r, { origin: z.LOCAL });
|
|
913
|
+
const l = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g), a = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), c = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ oldValue: m }) => m)), u = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ newValue: m }) => m)), f = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), d = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g);
|
|
914
914
|
return {
|
|
915
915
|
canRedo: () => n.length - 1 > o,
|
|
916
916
|
canUndo: () => o > -1,
|
|
@@ -919,15 +919,15 @@ const Zn = 250, Qn = (e) => {
|
|
|
919
919
|
redo: () => {
|
|
920
920
|
if (n.length - 1 > o) {
|
|
921
921
|
i = !0;
|
|
922
|
-
const { created: g, updated: m, deleted:
|
|
923
|
-
a(g), u(m),
|
|
922
|
+
const { created: g, updated: m, deleted: y } = n[o + 1];
|
|
923
|
+
a(g), u(m), d(y), t.emit("redo", n[o + 1]), o += 1;
|
|
924
924
|
}
|
|
925
925
|
},
|
|
926
926
|
undo: () => {
|
|
927
927
|
if (o > -1) {
|
|
928
928
|
i = !0;
|
|
929
|
-
const { created: g, updated: m, deleted:
|
|
930
|
-
l(g), c(m), f(
|
|
929
|
+
const { created: g, updated: m, deleted: y } = n[o];
|
|
930
|
+
l(g), c(m), f(y), t.emit("undo", n[o]), o -= 1;
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
933
|
};
|
|
@@ -940,75 +940,75 @@ const Zn = 250, Qn = (e) => {
|
|
|
940
940
|
}, $n = (e, t, n, o) => {
|
|
941
941
|
const { store: i, selection: s, hover: r, viewport: l } = e, a = /* @__PURE__ */ new Map();
|
|
942
942
|
let c = [], u, f;
|
|
943
|
-
const
|
|
944
|
-
a.has(
|
|
945
|
-
}, g = (
|
|
946
|
-
const w = a.get(
|
|
947
|
-
w && w.indexOf(
|
|
948
|
-
}, m = (
|
|
949
|
-
a.has(
|
|
950
|
-
a.get(
|
|
943
|
+
const d = (p, S) => {
|
|
944
|
+
a.has(p) ? a.get(p).push(S) : a.set(p, [S]);
|
|
945
|
+
}, g = (p, S) => {
|
|
946
|
+
const w = a.get(p);
|
|
947
|
+
w && w.indexOf(S) > 0 && w.splice(w.indexOf(S), 1);
|
|
948
|
+
}, m = (p, S, w) => {
|
|
949
|
+
a.has(p) && setTimeout(() => {
|
|
950
|
+
a.get(p).forEach((A) => {
|
|
951
951
|
if (n) {
|
|
952
|
-
const
|
|
953
|
-
|
|
952
|
+
const I = Array.isArray(S) ? S.map((U) => n.serialize(U)) : n.serialize(S), N = w ? w instanceof PointerEvent ? w : n.serialize(w) : void 0;
|
|
953
|
+
A(I, N);
|
|
954
954
|
} else
|
|
955
|
-
|
|
955
|
+
A(S, w);
|
|
956
956
|
});
|
|
957
957
|
}, 1);
|
|
958
|
-
},
|
|
959
|
-
const { selected:
|
|
960
|
-
|
|
961
|
-
const
|
|
962
|
-
(!
|
|
963
|
-
}), c = c.map((w) =>
|
|
958
|
+
}, y = () => {
|
|
959
|
+
const { selected: p } = s, S = (p || []).map(({ id: w }) => i.getAnnotation(w));
|
|
960
|
+
S.forEach((w) => {
|
|
961
|
+
const A = c.find((I) => I.id === w.id);
|
|
962
|
+
(!A || !de(A, w)) && m("updateAnnotation", w, A);
|
|
963
|
+
}), c = c.map((w) => S.find(({ id: I }) => I === w.id) || w);
|
|
964
964
|
};
|
|
965
|
-
s.subscribe(({ selected:
|
|
966
|
-
if (!(c.length === 0 &&
|
|
967
|
-
if (c.length === 0 &&
|
|
968
|
-
c =
|
|
969
|
-
else if (c.length > 0 &&
|
|
970
|
-
c.forEach((
|
|
971
|
-
const w = i.getAnnotation(
|
|
972
|
-
w && !
|
|
965
|
+
s.subscribe(({ selected: p }) => {
|
|
966
|
+
if (!(c.length === 0 && p.length === 0)) {
|
|
967
|
+
if (c.length === 0 && p.length > 0)
|
|
968
|
+
c = p.map(({ id: S }) => i.getAnnotation(S));
|
|
969
|
+
else if (c.length > 0 && p.length === 0)
|
|
970
|
+
c.forEach((S) => {
|
|
971
|
+
const w = i.getAnnotation(S.id);
|
|
972
|
+
w && !de(w, S) && m("updateAnnotation", w, S);
|
|
973
973
|
}), c = [];
|
|
974
974
|
else {
|
|
975
|
-
const
|
|
976
|
-
c.filter((
|
|
977
|
-
const
|
|
978
|
-
|
|
975
|
+
const S = new Set(c.map((A) => A.id)), w = new Set(p.map(({ id: A }) => A));
|
|
976
|
+
c.filter((A) => !w.has(A.id)).forEach((A) => {
|
|
977
|
+
const I = i.getAnnotation(A.id);
|
|
978
|
+
I && !de(I, A) && m("updateAnnotation", I, A);
|
|
979
979
|
}), c = [
|
|
980
980
|
// Remove annotations that were deselected
|
|
981
|
-
...c.filter((
|
|
981
|
+
...c.filter((A) => w.has(A.id)),
|
|
982
982
|
// Add editable annotations that were selected
|
|
983
|
-
...
|
|
983
|
+
...p.filter(({ id: A }) => !S.has(A)).map(({ id: A }) => i.getAnnotation(A))
|
|
984
984
|
];
|
|
985
985
|
}
|
|
986
986
|
m("selectionChanged", c);
|
|
987
987
|
}
|
|
988
|
-
}), r.subscribe((
|
|
989
|
-
!u &&
|
|
990
|
-
}), l == null || l.subscribe((
|
|
991
|
-
o && (f && clearTimeout(f), f = setTimeout(
|
|
992
|
-
const { created:
|
|
993
|
-
(
|
|
994
|
-
...
|
|
995
|
-
...
|
|
996
|
-
...
|
|
997
|
-
].length > 0).forEach(({ oldValue:
|
|
998
|
-
const
|
|
999
|
-
c = c.map((
|
|
988
|
+
}), r.subscribe((p) => {
|
|
989
|
+
!u && p ? m("mouseEnterAnnotation", i.getAnnotation(p)) : u && !p ? m("mouseLeaveAnnotation", i.getAnnotation(u)) : u && p && (m("mouseLeaveAnnotation", i.getAnnotation(u)), m("mouseEnterAnnotation", i.getAnnotation(p))), u = p;
|
|
990
|
+
}), l == null || l.subscribe((p) => m("viewportIntersect", p.map((S) => i.getAnnotation(S)))), i.observe((p) => {
|
|
991
|
+
o && (f && clearTimeout(f), f = setTimeout(y, 1e3));
|
|
992
|
+
const { created: S, deleted: w } = p.changes;
|
|
993
|
+
(S || []).forEach((A) => m("createAnnotation", A)), (w || []).forEach((A) => m("deleteAnnotation", A)), (p.changes.updated || []).filter((A) => [
|
|
994
|
+
...A.bodiesCreated || [],
|
|
995
|
+
...A.bodiesDeleted || [],
|
|
996
|
+
...A.bodiesUpdated || []
|
|
997
|
+
].length > 0).forEach(({ oldValue: A, newValue: I }) => {
|
|
998
|
+
const N = c.find((U) => U.id === A.id) || A;
|
|
999
|
+
c = c.map((U) => U.id === A.id ? I : U), m("updateAnnotation", I, N);
|
|
1000
1000
|
});
|
|
1001
|
-
}, { origin:
|
|
1001
|
+
}, { origin: z.LOCAL }), i.observe((p) => {
|
|
1002
1002
|
if (c) {
|
|
1003
|
-
const
|
|
1004
|
-
w.length > 0 && (c = c.map((
|
|
1003
|
+
const S = new Set(c.map((A) => A.id)), w = (p.changes.updated || []).filter(({ newValue: A }) => S.has(A.id)).map(({ newValue: A }) => A);
|
|
1004
|
+
w.length > 0 && (c = c.map((A) => w.find((N) => N.id === A.id) || A));
|
|
1005
1005
|
}
|
|
1006
|
-
}, { origin:
|
|
1007
|
-
const
|
|
1008
|
-
const { updated: w } =
|
|
1009
|
-
|
|
1006
|
+
}, { origin: z.REMOTE });
|
|
1007
|
+
const E = (p) => (S) => {
|
|
1008
|
+
const { updated: w } = S;
|
|
1009
|
+
p ? (w || []).forEach((A) => m("updateAnnotation", A.oldValue, A.newValue)) : (w || []).forEach((A) => m("updateAnnotation", A.newValue, A.oldValue));
|
|
1010
1010
|
};
|
|
1011
|
-
return t.on("undo",
|
|
1011
|
+
return t.on("undo", E(!0)), t.on("redo", E(!1)), { on: d, off: g, emit: m };
|
|
1012
1012
|
}, eo = (e) => (t) => t.reduce((n, o) => {
|
|
1013
1013
|
const { parsed: i, error: s } = e.parse(o);
|
|
1014
1014
|
return s ? {
|
|
@@ -1021,44 +1021,44 @@ const Zn = 250, Qn = (e) => {
|
|
|
1021
1021
|
...n
|
|
1022
1022
|
};
|
|
1023
1023
|
}, { parsed: [], failed: [] }), to = (e, t, n) => {
|
|
1024
|
-
const { store: o, selection: i } = e, s = (
|
|
1024
|
+
const { store: o, selection: i } = e, s = (E) => {
|
|
1025
1025
|
if (n) {
|
|
1026
|
-
const { parsed:
|
|
1027
|
-
|
|
1026
|
+
const { parsed: p, error: S } = n.parse(E);
|
|
1027
|
+
p ? o.addAnnotation(p, z.REMOTE) : console.error(S);
|
|
1028
1028
|
} else
|
|
1029
|
-
o.addAnnotation(
|
|
1030
|
-
}, r = () => i.clear(), l = () => o.clear(), a = (
|
|
1031
|
-
const
|
|
1032
|
-
return n &&
|
|
1029
|
+
o.addAnnotation(E, z.REMOTE);
|
|
1030
|
+
}, r = () => i.clear(), l = () => o.clear(), a = (E) => {
|
|
1031
|
+
const p = o.getAnnotation(E);
|
|
1032
|
+
return n && p ? n.serialize(p) : p;
|
|
1033
1033
|
}, c = () => n ? o.all().map(n.serialize) : o.all(), u = () => {
|
|
1034
|
-
var
|
|
1035
|
-
const
|
|
1036
|
-
return n ?
|
|
1037
|
-
}, f = (
|
|
1038
|
-
if (typeof
|
|
1039
|
-
const
|
|
1040
|
-
if (o.deleteAnnotation(
|
|
1041
|
-
return n ? n.serialize(
|
|
1034
|
+
var E;
|
|
1035
|
+
const p = (((E = i.selected) == null ? void 0 : E.map((S) => S.id)) || []).map((S) => o.getAnnotation(S)).filter(Boolean);
|
|
1036
|
+
return n ? p.map(n.serialize) : p;
|
|
1037
|
+
}, f = (E, p = !0) => fetch(E).then((S) => S.json()).then((S) => (g(S, p), S)), d = (E) => {
|
|
1038
|
+
if (typeof E == "string") {
|
|
1039
|
+
const p = o.getAnnotation(E);
|
|
1040
|
+
if (o.deleteAnnotation(E), p)
|
|
1041
|
+
return n ? n.serialize(p) : p;
|
|
1042
1042
|
} else {
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
return o.deleteAnnotation(
|
|
1043
|
+
const p = n ? n.parse(E).parsed : E;
|
|
1044
|
+
if (p)
|
|
1045
|
+
return o.deleteAnnotation(p), E;
|
|
1046
1046
|
}
|
|
1047
|
-
}, g = (
|
|
1047
|
+
}, g = (E, p = !0) => {
|
|
1048
1048
|
if (n) {
|
|
1049
|
-
const { parsed:
|
|
1050
|
-
w.length > 0 && console.warn(`Discarded ${w.length} invalid annotations`, w), o.bulkAddAnnotation(
|
|
1049
|
+
const { parsed: S, failed: w } = eo(n)(E);
|
|
1050
|
+
w.length > 0 && console.warn(`Discarded ${w.length} invalid annotations`, w), o.bulkAddAnnotation(S, p, z.REMOTE);
|
|
1051
1051
|
} else
|
|
1052
|
-
o.bulkAddAnnotation(
|
|
1053
|
-
}, m = (
|
|
1054
|
-
|
|
1055
|
-
},
|
|
1052
|
+
o.bulkAddAnnotation(E, p, z.REMOTE);
|
|
1053
|
+
}, m = (E) => {
|
|
1054
|
+
E ? i.setSelected(E) : i.clear();
|
|
1055
|
+
}, y = (E) => {
|
|
1056
1056
|
if (n) {
|
|
1057
|
-
const
|
|
1058
|
-
return o.updateAnnotation(
|
|
1057
|
+
const p = n.parse(E).parsed, S = n.serialize(o.getAnnotation(p.id));
|
|
1058
|
+
return o.updateAnnotation(p), S;
|
|
1059
1059
|
} else {
|
|
1060
|
-
const
|
|
1061
|
-
return o.updateAnnotation(
|
|
1060
|
+
const p = o.getAnnotation(E.id);
|
|
1061
|
+
return o.updateAnnotation(E), p;
|
|
1062
1062
|
}
|
|
1063
1063
|
};
|
|
1064
1064
|
return {
|
|
@@ -1072,11 +1072,11 @@ const Zn = 250, Qn = (e) => {
|
|
|
1072
1072
|
getSelected: u,
|
|
1073
1073
|
loadAnnotations: f,
|
|
1074
1074
|
redo: t.redo,
|
|
1075
|
-
removeAnnotation:
|
|
1075
|
+
removeAnnotation: d,
|
|
1076
1076
|
setAnnotations: g,
|
|
1077
1077
|
setSelected: m,
|
|
1078
1078
|
undo: t.undo,
|
|
1079
|
-
updateAnnotation:
|
|
1079
|
+
updateAnnotation: y
|
|
1080
1080
|
};
|
|
1081
1081
|
}, no = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1082
1082
|
let oo = (e) => crypto.getRandomValues(new Uint8Array(e)), io = (e, t, n) => {
|
|
@@ -1156,7 +1156,7 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1156
1156
|
updatedBy: r,
|
|
1157
1157
|
// Excluded from serialization
|
|
1158
1158
|
...l
|
|
1159
|
-
} = e.target, a = n.type ==
|
|
1159
|
+
} = e.target, a = n.type == F.RECTANGLE ? Tn(n.geometry) : Bn(n), c = {
|
|
1160
1160
|
...e,
|
|
1161
1161
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1162
1162
|
id: e.id,
|
|
@@ -1179,7 +1179,7 @@ function wt(e, t, n) {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
function bt(e) {
|
|
1181
1181
|
let t, n;
|
|
1182
|
-
return t = new
|
|
1182
|
+
return t = new ke({
|
|
1183
1183
|
props: {
|
|
1184
1184
|
x: (
|
|
1185
1185
|
/*point*/
|
|
@@ -1195,7 +1195,7 @@ function bt(e) {
|
|
|
1195
1195
|
)
|
|
1196
1196
|
}
|
|
1197
1197
|
}), t.$on("pointerdown", function() {
|
|
1198
|
-
|
|
1198
|
+
j(
|
|
1199
1199
|
/*grab*/
|
|
1200
1200
|
e[9](`HANDLE-${/*idx*/
|
|
1201
1201
|
e[12]}`)
|
|
@@ -1231,93 +1231,93 @@ function bt(e) {
|
|
|
1231
1231
|
};
|
|
1232
1232
|
}
|
|
1233
1233
|
function go(e) {
|
|
1234
|
-
let t, n, o, i, s, r, l, a, c, u, f,
|
|
1234
|
+
let t, n, o, i, s, r, l, a, c, u, f, d = Se(
|
|
1235
1235
|
/*geom*/
|
|
1236
1236
|
e[4].points
|
|
1237
1237
|
), g = [];
|
|
1238
|
-
for (let
|
|
1239
|
-
g[
|
|
1240
|
-
const m = (
|
|
1241
|
-
g[
|
|
1238
|
+
for (let y = 0; y < d.length; y += 1)
|
|
1239
|
+
g[y] = bt(wt(e, d, y));
|
|
1240
|
+
const m = (y) => D(g[y], 1, 1, () => {
|
|
1241
|
+
g[y] = null;
|
|
1242
1242
|
});
|
|
1243
1243
|
return {
|
|
1244
1244
|
c() {
|
|
1245
|
-
t =
|
|
1246
|
-
for (let
|
|
1247
|
-
g[
|
|
1248
|
-
a =
|
|
1249
|
-
e[1] ? "display:none;" : void 0),
|
|
1250
|
-
e[4].points.map(Et).join(" ")),
|
|
1245
|
+
t = X("polygon"), i = ne(), s = X("polygon"), l = ne();
|
|
1246
|
+
for (let y = 0; y < g.length; y += 1)
|
|
1247
|
+
g[y].c();
|
|
1248
|
+
a = ae(), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1249
|
+
e[1] ? "display:none;" : void 0), h(t, "points", o = /*geom*/
|
|
1250
|
+
e[4].points.map(Et).join(" ")), h(s, "class", "a9s-inner a9s-shape-handle"), h(
|
|
1251
1251
|
s,
|
|
1252
1252
|
"style",
|
|
1253
1253
|
/*computedStyle*/
|
|
1254
1254
|
e[1]
|
|
1255
|
-
),
|
|
1255
|
+
), h(s, "points", r = /*geom*/
|
|
1256
1256
|
e[4].points.map(At).join(" "));
|
|
1257
1257
|
},
|
|
1258
|
-
m(
|
|
1259
|
-
|
|
1260
|
-
for (let
|
|
1261
|
-
g[
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1258
|
+
m(y, E) {
|
|
1259
|
+
B(y, t, E), B(y, i, E), B(y, s, E), B(y, l, E);
|
|
1260
|
+
for (let p = 0; p < g.length; p += 1)
|
|
1261
|
+
g[p] && g[p].m(y, E);
|
|
1262
|
+
B(y, a, E), c = !0, u || (f = [
|
|
1263
|
+
H(t, "pointerdown", function() {
|
|
1264
|
+
j(
|
|
1265
1265
|
/*grab*/
|
|
1266
1266
|
e[9]("SHAPE")
|
|
1267
1267
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1268
1268
|
}),
|
|
1269
|
-
|
|
1270
|
-
|
|
1269
|
+
H(s, "pointerdown", function() {
|
|
1270
|
+
j(
|
|
1271
1271
|
/*grab*/
|
|
1272
1272
|
e[9]("SHAPE")
|
|
1273
1273
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1274
1274
|
})
|
|
1275
1275
|
], u = !0);
|
|
1276
1276
|
},
|
|
1277
|
-
p(
|
|
1278
|
-
if (e =
|
|
1277
|
+
p(y, E) {
|
|
1278
|
+
if (e = y, (!c || E & /*computedStyle*/
|
|
1279
1279
|
2 && n !== (n = /*computedStyle*/
|
|
1280
|
-
e[1] ? "display:none;" : void 0)) &&
|
|
1280
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!c || E & /*geom*/
|
|
1281
1281
|
16 && o !== (o = /*geom*/
|
|
1282
|
-
e[4].points.map(Et).join(" "))) &&
|
|
1283
|
-
2) &&
|
|
1282
|
+
e[4].points.map(Et).join(" "))) && h(t, "points", o), (!c || E & /*computedStyle*/
|
|
1283
|
+
2) && h(
|
|
1284
1284
|
s,
|
|
1285
1285
|
"style",
|
|
1286
1286
|
/*computedStyle*/
|
|
1287
1287
|
e[1]
|
|
1288
|
-
), (!c ||
|
|
1288
|
+
), (!c || E & /*geom*/
|
|
1289
1289
|
16 && r !== (r = /*geom*/
|
|
1290
|
-
e[4].points.map(At).join(" "))) &&
|
|
1290
|
+
e[4].points.map(At).join(" "))) && h(s, "points", r), E & /*geom, viewportScale, grab*/
|
|
1291
1291
|
536) {
|
|
1292
|
-
|
|
1292
|
+
d = Se(
|
|
1293
1293
|
/*geom*/
|
|
1294
1294
|
e[4].points
|
|
1295
1295
|
);
|
|
1296
|
-
let
|
|
1297
|
-
for (
|
|
1298
|
-
const
|
|
1299
|
-
g[
|
|
1296
|
+
let p;
|
|
1297
|
+
for (p = 0; p < d.length; p += 1) {
|
|
1298
|
+
const S = wt(e, d, p);
|
|
1299
|
+
g[p] ? (g[p].p(S, E), P(g[p], 1)) : (g[p] = bt(S), g[p].c(), P(g[p], 1), g[p].m(a.parentNode, a));
|
|
1300
1300
|
}
|
|
1301
|
-
for (
|
|
1302
|
-
m(
|
|
1303
|
-
|
|
1301
|
+
for (se(), p = d.length; p < g.length; p += 1)
|
|
1302
|
+
m(p);
|
|
1303
|
+
re();
|
|
1304
1304
|
}
|
|
1305
1305
|
},
|
|
1306
|
-
i(
|
|
1306
|
+
i(y) {
|
|
1307
1307
|
if (!c) {
|
|
1308
|
-
for (let
|
|
1309
|
-
P(g[
|
|
1308
|
+
for (let E = 0; E < d.length; E += 1)
|
|
1309
|
+
P(g[E]);
|
|
1310
1310
|
c = !0;
|
|
1311
1311
|
}
|
|
1312
1312
|
},
|
|
1313
|
-
o(
|
|
1313
|
+
o(y) {
|
|
1314
1314
|
g = g.filter(Boolean);
|
|
1315
|
-
for (let
|
|
1316
|
-
D(g[
|
|
1315
|
+
for (let E = 0; E < g.length; E += 1)
|
|
1316
|
+
D(g[E]);
|
|
1317
1317
|
c = !1;
|
|
1318
1318
|
},
|
|
1319
|
-
d(
|
|
1320
|
-
|
|
1319
|
+
d(y) {
|
|
1320
|
+
y && (k(t), k(i), k(s), k(l), k(a)), rt(g, y), u = !1, le(f);
|
|
1321
1321
|
}
|
|
1322
1322
|
};
|
|
1323
1323
|
}
|
|
@@ -1388,24 +1388,24 @@ function mo(e) {
|
|
|
1388
1388
|
const Et = (e) => e.join(","), At = (e) => e.join(",");
|
|
1389
1389
|
function po(e, t, n) {
|
|
1390
1390
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1391
|
-
const a = (
|
|
1392
|
-
let
|
|
1393
|
-
const
|
|
1394
|
-
g === "SHAPE" ?
|
|
1395
|
-
const
|
|
1396
|
-
return { ...
|
|
1391
|
+
const a = (d, g, m) => {
|
|
1392
|
+
let y;
|
|
1393
|
+
const E = d.geometry;
|
|
1394
|
+
g === "SHAPE" ? y = E.points.map(([S, w]) => [S + m[0], w + m[1]]) : y = E.points.map(([S, w], A) => g === `HANDLE-${A}` ? [S + m[0], w + m[1]] : [S, w]);
|
|
1395
|
+
const p = Fe(y);
|
|
1396
|
+
return { ...d, geometry: { points: y, bounds: p } };
|
|
1397
1397
|
};
|
|
1398
|
-
function c(
|
|
1399
|
-
|
|
1398
|
+
function c(d) {
|
|
1399
|
+
fe.call(this, e, d);
|
|
1400
1400
|
}
|
|
1401
|
-
function u(
|
|
1402
|
-
|
|
1401
|
+
function u(d) {
|
|
1402
|
+
fe.call(this, e, d);
|
|
1403
1403
|
}
|
|
1404
|
-
function f(
|
|
1405
|
-
|
|
1404
|
+
function f(d) {
|
|
1405
|
+
fe.call(this, e, d);
|
|
1406
1406
|
}
|
|
1407
|
-
return e.$$set = (
|
|
1408
|
-
"shape" in
|
|
1407
|
+
return e.$$set = (d) => {
|
|
1408
|
+
"shape" in d && n(0, i = d.shape), "computedStyle" in d && n(1, s = d.computedStyle), "transform" in d && n(2, r = d.transform), "viewportScale" in d && n(3, l = d.viewportScale);
|
|
1409
1409
|
}, e.$$.update = () => {
|
|
1410
1410
|
e.$$.dirty & /*shape*/
|
|
1411
1411
|
1 && n(4, o = i.geometry);
|
|
@@ -1423,7 +1423,7 @@ function po(e, t, n) {
|
|
|
1423
1423
|
}
|
|
1424
1424
|
class yo extends te {
|
|
1425
1425
|
constructor(t) {
|
|
1426
|
-
super(), ee(this, t, po, mo,
|
|
1426
|
+
super(), ee(this, t, po, mo, K, {
|
|
1427
1427
|
shape: 0,
|
|
1428
1428
|
computedStyle: 1,
|
|
1429
1429
|
transform: 2,
|
|
@@ -1434,28 +1434,28 @@ class yo extends te {
|
|
|
1434
1434
|
const Qe = (e, t) => {
|
|
1435
1435
|
const n = Math.abs(t[0] - e[0]), o = Math.abs(t[1] - e[1]);
|
|
1436
1436
|
return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
|
|
1437
|
-
},
|
|
1438
|
-
function _o(e, t =
|
|
1437
|
+
}, ye = [];
|
|
1438
|
+
function _o(e, t = G) {
|
|
1439
1439
|
let n;
|
|
1440
1440
|
const o = /* @__PURE__ */ new Set();
|
|
1441
1441
|
function i(l) {
|
|
1442
|
-
if (
|
|
1443
|
-
const a = !
|
|
1442
|
+
if (K(e, l) && (e = l, n)) {
|
|
1443
|
+
const a = !ye.length;
|
|
1444
1444
|
for (const c of o)
|
|
1445
|
-
c[1](),
|
|
1445
|
+
c[1](), ye.push(c, e);
|
|
1446
1446
|
if (a) {
|
|
1447
|
-
for (let c = 0; c <
|
|
1448
|
-
|
|
1449
|
-
|
|
1447
|
+
for (let c = 0; c < ye.length; c += 2)
|
|
1448
|
+
ye[c][0](ye[c + 1]);
|
|
1449
|
+
ye.length = 0;
|
|
1450
1450
|
}
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
1453
|
function s(l) {
|
|
1454
1454
|
i(l(e));
|
|
1455
1455
|
}
|
|
1456
|
-
function r(l, a =
|
|
1456
|
+
function r(l, a = G) {
|
|
1457
1457
|
const c = [l, a];
|
|
1458
|
-
return o.add(c), o.size === 1 && (n = t(i, s) ||
|
|
1458
|
+
return o.add(c), o.size === 1 && (n = t(i, s) || G), l(e), () => {
|
|
1459
1459
|
o.delete(c), o.size === 0 && n && (n(), n = null);
|
|
1460
1460
|
};
|
|
1461
1461
|
}
|
|
@@ -1489,17 +1489,17 @@ function Ao(e) {
|
|
|
1489
1489
|
let t, n, o, i, s, r;
|
|
1490
1490
|
return {
|
|
1491
1491
|
c() {
|
|
1492
|
-
t =
|
|
1493
|
-
e[8].class || ""}`.trim()) + " svelte-1sgkh33"),
|
|
1492
|
+
t = X("rect"), h(t, "class", n = ze(`a9s-handle ${/*$$props*/
|
|
1493
|
+
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), h(t, "x", o = /*x*/
|
|
1494
1494
|
e[0] - /*handleSize*/
|
|
1495
|
-
e[5] / 2),
|
|
1495
|
+
e[5] / 2), h(t, "y", i = /*y*/
|
|
1496
1496
|
e[1] - /*handleSize*/
|
|
1497
|
-
e[5] / 2),
|
|
1497
|
+
e[5] / 2), h(
|
|
1498
1498
|
t,
|
|
1499
1499
|
"width",
|
|
1500
1500
|
/*handleSize*/
|
|
1501
1501
|
e[5]
|
|
1502
|
-
),
|
|
1502
|
+
), h(
|
|
1503
1503
|
t,
|
|
1504
1504
|
"height",
|
|
1505
1505
|
/*handleSize*/
|
|
@@ -1507,7 +1507,7 @@ function Ao(e) {
|
|
|
1507
1507
|
);
|
|
1508
1508
|
},
|
|
1509
1509
|
m(l, a) {
|
|
1510
|
-
|
|
1510
|
+
B(l, t, a), s || (r = H(
|
|
1511
1511
|
t,
|
|
1512
1512
|
"pointerdown",
|
|
1513
1513
|
/*pointerdown_handler_2*/
|
|
@@ -1516,21 +1516,21 @@ function Ao(e) {
|
|
|
1516
1516
|
},
|
|
1517
1517
|
p(l, a) {
|
|
1518
1518
|
a & /*$$props*/
|
|
1519
|
-
256 && n !== (n =
|
|
1520
|
-
l[8].class || ""}`.trim()) + " svelte-1sgkh33") &&
|
|
1519
|
+
256 && n !== (n = ze(`a9s-handle ${/*$$props*/
|
|
1520
|
+
l[8].class || ""}`.trim()) + " svelte-1sgkh33") && h(t, "class", n), a & /*x, handleSize*/
|
|
1521
1521
|
33 && o !== (o = /*x*/
|
|
1522
1522
|
l[0] - /*handleSize*/
|
|
1523
|
-
l[5] / 2) &&
|
|
1523
|
+
l[5] / 2) && h(t, "x", o), a & /*y, handleSize*/
|
|
1524
1524
|
34 && i !== (i = /*y*/
|
|
1525
1525
|
l[1] - /*handleSize*/
|
|
1526
|
-
l[5] / 2) &&
|
|
1527
|
-
32 &&
|
|
1526
|
+
l[5] / 2) && h(t, "y", i), a & /*handleSize*/
|
|
1527
|
+
32 && h(
|
|
1528
1528
|
t,
|
|
1529
1529
|
"width",
|
|
1530
1530
|
/*handleSize*/
|
|
1531
1531
|
l[5]
|
|
1532
1532
|
), a & /*handleSize*/
|
|
1533
|
-
32 &&
|
|
1533
|
+
32 && h(
|
|
1534
1534
|
t,
|
|
1535
1535
|
"height",
|
|
1536
1536
|
/*handleSize*/
|
|
@@ -1538,7 +1538,7 @@ function Ao(e) {
|
|
|
1538
1538
|
);
|
|
1539
1539
|
},
|
|
1540
1540
|
d(l) {
|
|
1541
|
-
l &&
|
|
1541
|
+
l && k(t), s = !1, r();
|
|
1542
1542
|
}
|
|
1543
1543
|
};
|
|
1544
1544
|
}
|
|
@@ -1546,73 +1546,73 @@ function So(e) {
|
|
|
1546
1546
|
let t, n, o, i, s, r, l, a, c;
|
|
1547
1547
|
return {
|
|
1548
1548
|
c() {
|
|
1549
|
-
t =
|
|
1549
|
+
t = X("g"), n = X("circle"), i = X("rect"), h(
|
|
1550
1550
|
n,
|
|
1551
1551
|
"cx",
|
|
1552
1552
|
/*x*/
|
|
1553
1553
|
e[0]
|
|
1554
|
-
),
|
|
1554
|
+
), h(
|
|
1555
1555
|
n,
|
|
1556
1556
|
"cy",
|
|
1557
1557
|
/*y*/
|
|
1558
1558
|
e[1]
|
|
1559
|
-
),
|
|
1559
|
+
), h(n, "r", o = /*radius*/
|
|
1560
1560
|
e[3] / /*scale*/
|
|
1561
|
-
e[2]),
|
|
1561
|
+
e[2]), h(n, "class", "a9s-touch-halo svelte-1sgkh33"), Ee(
|
|
1562
1562
|
n,
|
|
1563
1563
|
"touched",
|
|
1564
1564
|
/*touched*/
|
|
1565
1565
|
e[4]
|
|
1566
|
-
),
|
|
1567
|
-
e[8].class || ""}`.trim()) + " svelte-1sgkh33"),
|
|
1566
|
+
), h(i, "class", s = ze(`a9s-handle ${/*$$props*/
|
|
1567
|
+
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), h(i, "x", r = /*x*/
|
|
1568
1568
|
e[0] - /*handleSize*/
|
|
1569
|
-
e[5] / 2),
|
|
1569
|
+
e[5] / 2), h(i, "y", l = /*y*/
|
|
1570
1570
|
e[1] - /*handleSize*/
|
|
1571
|
-
e[5] / 2),
|
|
1571
|
+
e[5] / 2), h(
|
|
1572
1572
|
i,
|
|
1573
1573
|
"width",
|
|
1574
1574
|
/*handleSize*/
|
|
1575
1575
|
e[5]
|
|
1576
|
-
),
|
|
1576
|
+
), h(
|
|
1577
1577
|
i,
|
|
1578
1578
|
"height",
|
|
1579
1579
|
/*handleSize*/
|
|
1580
1580
|
e[5]
|
|
1581
|
-
),
|
|
1581
|
+
), h(t, "class", "a9s-touch-handle");
|
|
1582
1582
|
},
|
|
1583
1583
|
m(u, f) {
|
|
1584
|
-
|
|
1585
|
-
|
|
1584
|
+
B(u, t, f), ie(t, n), ie(t, i), a || (c = [
|
|
1585
|
+
H(
|
|
1586
1586
|
n,
|
|
1587
1587
|
"pointerdown",
|
|
1588
1588
|
/*pointerdown_handler*/
|
|
1589
1589
|
e[10]
|
|
1590
1590
|
),
|
|
1591
|
-
|
|
1591
|
+
H(
|
|
1592
1592
|
n,
|
|
1593
1593
|
"pointerdown",
|
|
1594
1594
|
/*onPointerDown*/
|
|
1595
1595
|
e[6]
|
|
1596
1596
|
),
|
|
1597
|
-
|
|
1597
|
+
H(
|
|
1598
1598
|
n,
|
|
1599
1599
|
"pointerup",
|
|
1600
1600
|
/*onPointerUp*/
|
|
1601
1601
|
e[7]
|
|
1602
1602
|
),
|
|
1603
|
-
|
|
1603
|
+
H(
|
|
1604
1604
|
i,
|
|
1605
1605
|
"pointerdown",
|
|
1606
1606
|
/*pointerdown_handler_1*/
|
|
1607
1607
|
e[9]
|
|
1608
1608
|
),
|
|
1609
|
-
|
|
1609
|
+
H(
|
|
1610
1610
|
i,
|
|
1611
1611
|
"pointerdown",
|
|
1612
1612
|
/*onPointerDown*/
|
|
1613
1613
|
e[6]
|
|
1614
1614
|
),
|
|
1615
|
-
|
|
1615
|
+
H(
|
|
1616
1616
|
i,
|
|
1617
1617
|
"pointerup",
|
|
1618
1618
|
/*onPointerUp*/
|
|
@@ -1622,13 +1622,13 @@ function So(e) {
|
|
|
1622
1622
|
},
|
|
1623
1623
|
p(u, f) {
|
|
1624
1624
|
f & /*x*/
|
|
1625
|
-
1 &&
|
|
1625
|
+
1 && h(
|
|
1626
1626
|
n,
|
|
1627
1627
|
"cx",
|
|
1628
1628
|
/*x*/
|
|
1629
1629
|
u[0]
|
|
1630
1630
|
), f & /*y*/
|
|
1631
|
-
2 &&
|
|
1631
|
+
2 && h(
|
|
1632
1632
|
n,
|
|
1633
1633
|
"cy",
|
|
1634
1634
|
/*y*/
|
|
@@ -1636,28 +1636,28 @@ function So(e) {
|
|
|
1636
1636
|
), f & /*radius, scale*/
|
|
1637
1637
|
12 && o !== (o = /*radius*/
|
|
1638
1638
|
u[3] / /*scale*/
|
|
1639
|
-
u[2]) &&
|
|
1640
|
-
16 &&
|
|
1639
|
+
u[2]) && h(n, "r", o), f & /*touched*/
|
|
1640
|
+
16 && Ee(
|
|
1641
1641
|
n,
|
|
1642
1642
|
"touched",
|
|
1643
1643
|
/*touched*/
|
|
1644
1644
|
u[4]
|
|
1645
1645
|
), f & /*$$props*/
|
|
1646
|
-
256 && s !== (s =
|
|
1647
|
-
u[8].class || ""}`.trim()) + " svelte-1sgkh33") &&
|
|
1646
|
+
256 && s !== (s = ze(`a9s-handle ${/*$$props*/
|
|
1647
|
+
u[8].class || ""}`.trim()) + " svelte-1sgkh33") && h(i, "class", s), f & /*x, handleSize*/
|
|
1648
1648
|
33 && r !== (r = /*x*/
|
|
1649
1649
|
u[0] - /*handleSize*/
|
|
1650
|
-
u[5] / 2) &&
|
|
1650
|
+
u[5] / 2) && h(i, "x", r), f & /*y, handleSize*/
|
|
1651
1651
|
34 && l !== (l = /*y*/
|
|
1652
1652
|
u[1] - /*handleSize*/
|
|
1653
|
-
u[5] / 2) &&
|
|
1654
|
-
32 &&
|
|
1653
|
+
u[5] / 2) && h(i, "y", l), f & /*handleSize*/
|
|
1654
|
+
32 && h(
|
|
1655
1655
|
i,
|
|
1656
1656
|
"width",
|
|
1657
1657
|
/*handleSize*/
|
|
1658
1658
|
u[5]
|
|
1659
1659
|
), f & /*handleSize*/
|
|
1660
|
-
32 &&
|
|
1660
|
+
32 && h(
|
|
1661
1661
|
i,
|
|
1662
1662
|
"height",
|
|
1663
1663
|
/*handleSize*/
|
|
@@ -1665,7 +1665,7 @@ function So(e) {
|
|
|
1665
1665
|
);
|
|
1666
1666
|
},
|
|
1667
1667
|
d(u) {
|
|
1668
|
-
u &&
|
|
1668
|
+
u && k(t), a = !1, le(c);
|
|
1669
1669
|
}
|
|
1670
1670
|
};
|
|
1671
1671
|
}
|
|
@@ -1677,18 +1677,18 @@ function To(e) {
|
|
|
1677
1677
|
let i = n()(e);
|
|
1678
1678
|
return {
|
|
1679
1679
|
c() {
|
|
1680
|
-
i.c(), t =
|
|
1680
|
+
i.c(), t = ae();
|
|
1681
1681
|
},
|
|
1682
1682
|
m(s, r) {
|
|
1683
|
-
i.m(s, r),
|
|
1683
|
+
i.m(s, r), B(s, t, r);
|
|
1684
1684
|
},
|
|
1685
1685
|
p(s, [r]) {
|
|
1686
1686
|
i.p(s, r);
|
|
1687
1687
|
},
|
|
1688
|
-
i:
|
|
1689
|
-
o:
|
|
1688
|
+
i: G,
|
|
1689
|
+
o: G,
|
|
1690
1690
|
d(s) {
|
|
1691
|
-
s &&
|
|
1691
|
+
s && k(t), i.d(s);
|
|
1692
1692
|
}
|
|
1693
1693
|
};
|
|
1694
1694
|
}
|
|
@@ -1698,13 +1698,13 @@ function Mo(e, t, n) {
|
|
|
1698
1698
|
m.pointerType === "touch" && n(4, a = !0);
|
|
1699
1699
|
}, u = () => n(4, a = !1);
|
|
1700
1700
|
function f(m) {
|
|
1701
|
-
|
|
1701
|
+
fe.call(this, e, m);
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1704
|
-
|
|
1703
|
+
function d(m) {
|
|
1704
|
+
fe.call(this, e, m);
|
|
1705
1705
|
}
|
|
1706
1706
|
function g(m) {
|
|
1707
|
-
|
|
1707
|
+
fe.call(this, e, m);
|
|
1708
1708
|
}
|
|
1709
1709
|
return e.$$set = (m) => {
|
|
1710
1710
|
n(8, t = nt(nt({}, t), gt(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);
|
|
@@ -1722,18 +1722,18 @@ function Mo(e, t, n) {
|
|
|
1722
1722
|
u,
|
|
1723
1723
|
t,
|
|
1724
1724
|
f,
|
|
1725
|
-
|
|
1725
|
+
d,
|
|
1726
1726
|
g
|
|
1727
1727
|
];
|
|
1728
1728
|
}
|
|
1729
|
-
class
|
|
1729
|
+
class ke extends te {
|
|
1730
1730
|
constructor(t) {
|
|
1731
|
-
super(), ee(this, t, Mo, To,
|
|
1731
|
+
super(), ee(this, t, Mo, To, K, { x: 0, y: 1, scale: 2, radius: 3 });
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
1734
|
function vo(e) {
|
|
1735
|
-
let t, n, o, i, s, r, l, a, c, u, f,
|
|
1736
|
-
return
|
|
1735
|
+
let t, n, o, i, s, r, l, a, c, u, f, d, g, m, y, E, p, S, w, A, I, N, U, _, b, T, M, O, Y, Z, he, ge, Me, oe, ve, L, W, V, ce, J, R, qe, ut;
|
|
1736
|
+
return oe = new ke({
|
|
1737
1737
|
props: {
|
|
1738
1738
|
class: "a9s-corner-handle-topleft",
|
|
1739
1739
|
x: (
|
|
@@ -1749,12 +1749,12 @@ function vo(e) {
|
|
|
1749
1749
|
e[3]
|
|
1750
1750
|
)
|
|
1751
1751
|
}
|
|
1752
|
-
}),
|
|
1753
|
-
|
|
1752
|
+
}), oe.$on("pointerdown", function() {
|
|
1753
|
+
j(
|
|
1754
1754
|
/*grab*/
|
|
1755
1755
|
e[9]("TOP_LEFT")
|
|
1756
1756
|
) && e[9]("TOP_LEFT").apply(this, arguments);
|
|
1757
|
-
}),
|
|
1757
|
+
}), L = new ke({
|
|
1758
1758
|
props: {
|
|
1759
1759
|
class: "a9s-corner-handle-topright",
|
|
1760
1760
|
x: (
|
|
@@ -1771,12 +1771,12 @@ function vo(e) {
|
|
|
1771
1771
|
e[3]
|
|
1772
1772
|
)
|
|
1773
1773
|
}
|
|
1774
|
-
}),
|
|
1775
|
-
|
|
1774
|
+
}), L.$on("pointerdown", function() {
|
|
1775
|
+
j(
|
|
1776
1776
|
/*grab*/
|
|
1777
1777
|
e[9]("TOP_RIGHT")
|
|
1778
1778
|
) && e[9]("TOP_RIGHT").apply(this, arguments);
|
|
1779
|
-
}),
|
|
1779
|
+
}), V = new ke({
|
|
1780
1780
|
props: {
|
|
1781
1781
|
class: "a9s-corner-handle-bottomright",
|
|
1782
1782
|
x: (
|
|
@@ -1794,12 +1794,12 @@ function vo(e) {
|
|
|
1794
1794
|
e[3]
|
|
1795
1795
|
)
|
|
1796
1796
|
}
|
|
1797
|
-
}),
|
|
1798
|
-
|
|
1797
|
+
}), V.$on("pointerdown", function() {
|
|
1798
|
+
j(
|
|
1799
1799
|
/*grab*/
|
|
1800
1800
|
e[9]("BOTTOM_RIGHT")
|
|
1801
1801
|
) && e[9]("BOTTOM_RIGHT").apply(this, arguments);
|
|
1802
|
-
}),
|
|
1802
|
+
}), J = new ke({
|
|
1803
1803
|
props: {
|
|
1804
1804
|
class: "a9s-corner-handle-bottomleft",
|
|
1805
1805
|
x: (
|
|
@@ -1816,180 +1816,180 @@ function vo(e) {
|
|
|
1816
1816
|
e[3]
|
|
1817
1817
|
)
|
|
1818
1818
|
}
|
|
1819
|
-
}),
|
|
1820
|
-
|
|
1819
|
+
}), J.$on("pointerdown", function() {
|
|
1820
|
+
j(
|
|
1821
1821
|
/*grab*/
|
|
1822
1822
|
e[9]("BOTTOM_LEFT")
|
|
1823
1823
|
) && e[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
1824
1824
|
}), {
|
|
1825
1825
|
c() {
|
|
1826
|
-
t =
|
|
1827
|
-
e[1] ? "display:none;" : void 0),
|
|
1828
|
-
e[4].x),
|
|
1829
|
-
e[4].y),
|
|
1830
|
-
e[4].w),
|
|
1831
|
-
e[4].h),
|
|
1826
|
+
t = X("rect"), l = ne(), a = X("rect"), g = ne(), m = X("rect"), S = ne(), w = X("rect"), U = ne(), _ = X("rect"), O = ne(), Y = X("rect"), Me = ne(), $(oe.$$.fragment), ve = ne(), $(L.$$.fragment), W = ne(), $(V.$$.fragment), ce = ne(), $(J.$$.fragment), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1827
|
+
e[1] ? "display:none;" : void 0), h(t, "x", o = /*geom*/
|
|
1828
|
+
e[4].x), h(t, "y", i = /*geom*/
|
|
1829
|
+
e[4].y), h(t, "width", s = /*geom*/
|
|
1830
|
+
e[4].w), h(t, "height", r = /*geom*/
|
|
1831
|
+
e[4].h), h(a, "class", "a9s-inner a9s-shape-handle"), h(
|
|
1832
1832
|
a,
|
|
1833
1833
|
"style",
|
|
1834
1834
|
/*computedStyle*/
|
|
1835
1835
|
e[1]
|
|
1836
|
-
),
|
|
1837
|
-
e[4].x),
|
|
1838
|
-
e[4].y),
|
|
1839
|
-
e[4].w),
|
|
1840
|
-
e[4].h),
|
|
1841
|
-
e[4].x),
|
|
1842
|
-
e[4].y),
|
|
1843
|
-
e[4].w),
|
|
1836
|
+
), h(a, "x", c = /*geom*/
|
|
1837
|
+
e[4].x), h(a, "y", u = /*geom*/
|
|
1838
|
+
e[4].y), h(a, "width", f = /*geom*/
|
|
1839
|
+
e[4].w), h(a, "height", d = /*geom*/
|
|
1840
|
+
e[4].h), h(m, "class", "a9s-edge-handle a9s-edge-handle-top"), h(m, "x", y = /*geom*/
|
|
1841
|
+
e[4].x), h(m, "y", E = /*geom*/
|
|
1842
|
+
e[4].y), h(m, "height", 1), h(m, "width", p = /*geom*/
|
|
1843
|
+
e[4].w), h(w, "class", "a9s-edge-handle a9s-edge-handle-right"), h(w, "x", A = /*geom*/
|
|
1844
1844
|
e[4].x + /*geom*/
|
|
1845
|
-
e[4].w),
|
|
1846
|
-
e[4].y),
|
|
1847
|
-
e[4].h),
|
|
1848
|
-
e[4].x),
|
|
1845
|
+
e[4].w), h(w, "y", I = /*geom*/
|
|
1846
|
+
e[4].y), h(w, "height", N = /*geom*/
|
|
1847
|
+
e[4].h), h(w, "width", 1), h(_, "class", "a9s-edge-handle a9s-edge-handle-bottom"), h(_, "x", b = /*geom*/
|
|
1848
|
+
e[4].x), h(_, "y", T = /*geom*/
|
|
1849
1849
|
e[4].y + /*geom*/
|
|
1850
|
-
e[4].h),
|
|
1851
|
-
e[4].w),
|
|
1852
|
-
e[4].x),
|
|
1853
|
-
e[4].y),
|
|
1854
|
-
e[4].h),
|
|
1855
|
-
},
|
|
1856
|
-
m(
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1850
|
+
e[4].h), h(_, "height", 1), h(_, "width", M = /*geom*/
|
|
1851
|
+
e[4].w), h(Y, "class", "a9s-edge-handle a9s-edge-handle-left"), h(Y, "x", Z = /*geom*/
|
|
1852
|
+
e[4].x), h(Y, "y", he = /*geom*/
|
|
1853
|
+
e[4].y), h(Y, "height", ge = /*geom*/
|
|
1854
|
+
e[4].h), h(Y, "width", 1);
|
|
1855
|
+
},
|
|
1856
|
+
m(C, v) {
|
|
1857
|
+
B(C, t, v), B(C, l, v), B(C, a, v), B(C, g, v), B(C, m, v), B(C, S, v), B(C, w, v), B(C, U, v), B(C, _, v), B(C, O, v), B(C, Y, v), B(C, Me, v), Q(oe, C, v), B(C, ve, v), Q(L, C, v), B(C, W, v), Q(V, C, v), B(C, ce, v), Q(J, C, v), R = !0, qe || (ut = [
|
|
1858
|
+
H(t, "pointerdown", function() {
|
|
1859
|
+
j(
|
|
1860
1860
|
/*grab*/
|
|
1861
1861
|
e[9]("SHAPE")
|
|
1862
1862
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1863
1863
|
}),
|
|
1864
|
-
|
|
1865
|
-
|
|
1864
|
+
H(a, "pointerdown", function() {
|
|
1865
|
+
j(
|
|
1866
1866
|
/*grab*/
|
|
1867
1867
|
e[9]("SHAPE")
|
|
1868
1868
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1869
1869
|
}),
|
|
1870
|
-
|
|
1871
|
-
|
|
1870
|
+
H(m, "pointerdown", function() {
|
|
1871
|
+
j(
|
|
1872
1872
|
/*grab*/
|
|
1873
1873
|
e[9]("TOP")
|
|
1874
1874
|
) && e[9]("TOP").apply(this, arguments);
|
|
1875
1875
|
}),
|
|
1876
|
-
|
|
1877
|
-
|
|
1876
|
+
H(w, "pointerdown", function() {
|
|
1877
|
+
j(
|
|
1878
1878
|
/*grab*/
|
|
1879
1879
|
e[9]("RIGHT")
|
|
1880
1880
|
) && e[9]("RIGHT").apply(this, arguments);
|
|
1881
1881
|
}),
|
|
1882
|
-
|
|
1883
|
-
|
|
1882
|
+
H(_, "pointerdown", function() {
|
|
1883
|
+
j(
|
|
1884
1884
|
/*grab*/
|
|
1885
1885
|
e[9]("BOTTOM")
|
|
1886
1886
|
) && e[9]("BOTTOM").apply(this, arguments);
|
|
1887
1887
|
}),
|
|
1888
|
-
|
|
1889
|
-
|
|
1888
|
+
H(Y, "pointerdown", function() {
|
|
1889
|
+
j(
|
|
1890
1890
|
/*grab*/
|
|
1891
1891
|
e[9]("LEFT")
|
|
1892
1892
|
) && e[9]("LEFT").apply(this, arguments);
|
|
1893
1893
|
})
|
|
1894
1894
|
], qe = !0);
|
|
1895
1895
|
},
|
|
1896
|
-
p(
|
|
1897
|
-
e =
|
|
1896
|
+
p(C, v) {
|
|
1897
|
+
e = C, (!R || v & /*computedStyle*/
|
|
1898
1898
|
2 && n !== (n = /*computedStyle*/
|
|
1899
|
-
e[1] ? "display:none;" : void 0)) &&
|
|
1899
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!R || v & /*geom*/
|
|
1900
1900
|
16 && o !== (o = /*geom*/
|
|
1901
|
-
e[4].x)) &&
|
|
1901
|
+
e[4].x)) && h(t, "x", o), (!R || v & /*geom*/
|
|
1902
1902
|
16 && i !== (i = /*geom*/
|
|
1903
|
-
e[4].y)) &&
|
|
1903
|
+
e[4].y)) && h(t, "y", i), (!R || v & /*geom*/
|
|
1904
1904
|
16 && s !== (s = /*geom*/
|
|
1905
|
-
e[4].w)) &&
|
|
1905
|
+
e[4].w)) && h(t, "width", s), (!R || v & /*geom*/
|
|
1906
1906
|
16 && r !== (r = /*geom*/
|
|
1907
|
-
e[4].h)) &&
|
|
1908
|
-
2) &&
|
|
1907
|
+
e[4].h)) && h(t, "height", r), (!R || v & /*computedStyle*/
|
|
1908
|
+
2) && h(
|
|
1909
1909
|
a,
|
|
1910
1910
|
"style",
|
|
1911
1911
|
/*computedStyle*/
|
|
1912
1912
|
e[1]
|
|
1913
|
-
), (!
|
|
1913
|
+
), (!R || v & /*geom*/
|
|
1914
1914
|
16 && c !== (c = /*geom*/
|
|
1915
|
-
e[4].x)) &&
|
|
1915
|
+
e[4].x)) && h(a, "x", c), (!R || v & /*geom*/
|
|
1916
1916
|
16 && u !== (u = /*geom*/
|
|
1917
|
-
e[4].y)) &&
|
|
1917
|
+
e[4].y)) && h(a, "y", u), (!R || v & /*geom*/
|
|
1918
1918
|
16 && f !== (f = /*geom*/
|
|
1919
|
-
e[4].w)) &&
|
|
1920
|
-
16 &&
|
|
1921
|
-
e[4].h)) &&
|
|
1922
|
-
16 && _ !== (_ = /*geom*/
|
|
1923
|
-
e[4].x)) && d(m, "x", _), (!N || v & /*geom*/
|
|
1924
|
-
16 && b !== (b = /*geom*/
|
|
1925
|
-
e[4].y)) && d(m, "y", b), (!N || v & /*geom*/
|
|
1919
|
+
e[4].w)) && h(a, "width", f), (!R || v & /*geom*/
|
|
1920
|
+
16 && d !== (d = /*geom*/
|
|
1921
|
+
e[4].h)) && h(a, "height", d), (!R || v & /*geom*/
|
|
1926
1922
|
16 && y !== (y = /*geom*/
|
|
1927
|
-
e[4].
|
|
1923
|
+
e[4].x)) && h(m, "x", y), (!R || v & /*geom*/
|
|
1928
1924
|
16 && E !== (E = /*geom*/
|
|
1925
|
+
e[4].y)) && h(m, "y", E), (!R || v & /*geom*/
|
|
1926
|
+
16 && p !== (p = /*geom*/
|
|
1927
|
+
e[4].w)) && h(m, "width", p), (!R || v & /*geom*/
|
|
1928
|
+
16 && A !== (A = /*geom*/
|
|
1929
1929
|
e[4].x + /*geom*/
|
|
1930
|
-
e[4].w)) &&
|
|
1931
|
-
16 &&
|
|
1932
|
-
e[4].y)) &&
|
|
1933
|
-
16 &&
|
|
1934
|
-
e[4].h)) &&
|
|
1930
|
+
e[4].w)) && h(w, "x", A), (!R || v & /*geom*/
|
|
1931
|
+
16 && I !== (I = /*geom*/
|
|
1932
|
+
e[4].y)) && h(w, "y", I), (!R || v & /*geom*/
|
|
1933
|
+
16 && N !== (N = /*geom*/
|
|
1934
|
+
e[4].h)) && h(w, "height", N), (!R || v & /*geom*/
|
|
1935
|
+
16 && b !== (b = /*geom*/
|
|
1936
|
+
e[4].x)) && h(_, "x", b), (!R || v & /*geom*/
|
|
1935
1937
|
16 && T !== (T = /*geom*/
|
|
1936
|
-
e[4].x)) && d(p, "x", T), (!N || v & /*geom*/
|
|
1937
|
-
16 && S !== (S = /*geom*/
|
|
1938
1938
|
e[4].y + /*geom*/
|
|
1939
|
-
e[4].h)) &&
|
|
1939
|
+
e[4].h)) && h(_, "y", T), (!R || v & /*geom*/
|
|
1940
1940
|
16 && M !== (M = /*geom*/
|
|
1941
|
-
e[4].w)) &&
|
|
1941
|
+
e[4].w)) && h(_, "width", M), (!R || v & /*geom*/
|
|
1942
1942
|
16 && Z !== (Z = /*geom*/
|
|
1943
|
-
e[4].x)) &&
|
|
1943
|
+
e[4].x)) && h(Y, "x", Z), (!R || v & /*geom*/
|
|
1944
|
+
16 && he !== (he = /*geom*/
|
|
1945
|
+
e[4].y)) && h(Y, "y", he), (!R || v & /*geom*/
|
|
1944
1946
|
16 && ge !== (ge = /*geom*/
|
|
1945
|
-
e[4].
|
|
1946
|
-
16 && me !== (me = /*geom*/
|
|
1947
|
-
e[4].h)) && d(C, "height", me);
|
|
1948
|
-
const Ye = {};
|
|
1949
|
-
v & /*geom*/
|
|
1950
|
-
16 && (Ye.x = /*geom*/
|
|
1951
|
-
e[4].x), v & /*geom*/
|
|
1952
|
-
16 && (Ye.y = /*geom*/
|
|
1953
|
-
e[4].y), v & /*viewportScale*/
|
|
1954
|
-
8 && (Ye.scale = /*viewportScale*/
|
|
1955
|
-
e[3]), ie.$set(Ye);
|
|
1947
|
+
e[4].h)) && h(Y, "height", ge);
|
|
1956
1948
|
const Ce = {};
|
|
1957
1949
|
v & /*geom*/
|
|
1958
1950
|
16 && (Ce.x = /*geom*/
|
|
1959
|
-
e[4].x
|
|
1960
|
-
e[4].w), v & /*geom*/
|
|
1951
|
+
e[4].x), v & /*geom*/
|
|
1961
1952
|
16 && (Ce.y = /*geom*/
|
|
1962
1953
|
e[4].y), v & /*viewportScale*/
|
|
1963
1954
|
8 && (Ce.scale = /*viewportScale*/
|
|
1964
|
-
e[3]),
|
|
1955
|
+
e[3]), oe.$set(Ce);
|
|
1965
1956
|
const De = {};
|
|
1966
1957
|
v & /*geom*/
|
|
1967
1958
|
16 && (De.x = /*geom*/
|
|
1968
1959
|
e[4].x + /*geom*/
|
|
1969
1960
|
e[4].w), v & /*geom*/
|
|
1970
1961
|
16 && (De.y = /*geom*/
|
|
1971
|
-
e[4].y
|
|
1972
|
-
e[4].h), v & /*viewportScale*/
|
|
1962
|
+
e[4].y), v & /*viewportScale*/
|
|
1973
1963
|
8 && (De.scale = /*viewportScale*/
|
|
1974
|
-
e[3]),
|
|
1964
|
+
e[3]), L.$set(De);
|
|
1975
1965
|
const Xe = {};
|
|
1976
1966
|
v & /*geom*/
|
|
1977
1967
|
16 && (Xe.x = /*geom*/
|
|
1978
|
-
e[4].x
|
|
1968
|
+
e[4].x + /*geom*/
|
|
1969
|
+
e[4].w), v & /*geom*/
|
|
1979
1970
|
16 && (Xe.y = /*geom*/
|
|
1980
1971
|
e[4].y + /*geom*/
|
|
1981
1972
|
e[4].h), v & /*viewportScale*/
|
|
1982
1973
|
8 && (Xe.scale = /*viewportScale*/
|
|
1983
|
-
e[3]),
|
|
1974
|
+
e[3]), V.$set(Xe);
|
|
1975
|
+
const Re = {};
|
|
1976
|
+
v & /*geom*/
|
|
1977
|
+
16 && (Re.x = /*geom*/
|
|
1978
|
+
e[4].x), v & /*geom*/
|
|
1979
|
+
16 && (Re.y = /*geom*/
|
|
1980
|
+
e[4].y + /*geom*/
|
|
1981
|
+
e[4].h), v & /*viewportScale*/
|
|
1982
|
+
8 && (Re.scale = /*viewportScale*/
|
|
1983
|
+
e[3]), J.$set(Re);
|
|
1984
1984
|
},
|
|
1985
|
-
i(
|
|
1986
|
-
|
|
1985
|
+
i(C) {
|
|
1986
|
+
R || (P(oe.$$.fragment, C), P(L.$$.fragment, C), P(V.$$.fragment, C), P(J.$$.fragment, C), R = !0);
|
|
1987
1987
|
},
|
|
1988
|
-
o(
|
|
1989
|
-
D(
|
|
1988
|
+
o(C) {
|
|
1989
|
+
D(oe.$$.fragment, C), D(L.$$.fragment, C), D(V.$$.fragment, C), D(J.$$.fragment, C), R = !1;
|
|
1990
1990
|
},
|
|
1991
|
-
d(
|
|
1992
|
-
|
|
1991
|
+
d(C) {
|
|
1992
|
+
C && (k(t), k(l), k(a), k(g), k(m), k(S), k(w), k(U), k(_), k(O), k(Y), k(Me), k(ve), k(W), k(ce)), x(oe, C), x(L, C), x(V, C), x(J, C), qe = !1, le(ut);
|
|
1993
1993
|
}
|
|
1994
1994
|
};
|
|
1995
1995
|
}
|
|
@@ -2059,24 +2059,24 @@ function Lo(e) {
|
|
|
2059
2059
|
}
|
|
2060
2060
|
function ko(e, t, n) {
|
|
2061
2061
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
2062
|
-
const a = (
|
|
2063
|
-
const
|
|
2064
|
-
let [
|
|
2065
|
-
const [
|
|
2062
|
+
const a = (d, g, m) => {
|
|
2063
|
+
const y = d.geometry.bounds;
|
|
2064
|
+
let [E, p] = [y.minX, y.minY], [S, w] = [y.maxX, y.maxY];
|
|
2065
|
+
const [A, I] = m;
|
|
2066
2066
|
if (g === "SHAPE")
|
|
2067
|
-
|
|
2067
|
+
E += A, S += A, p += I, w += I;
|
|
2068
2068
|
else {
|
|
2069
2069
|
switch (g) {
|
|
2070
2070
|
case "TOP":
|
|
2071
2071
|
case "TOP_LEFT":
|
|
2072
2072
|
case "TOP_RIGHT": {
|
|
2073
|
-
|
|
2073
|
+
p += I;
|
|
2074
2074
|
break;
|
|
2075
2075
|
}
|
|
2076
2076
|
case "BOTTOM":
|
|
2077
2077
|
case "BOTTOM_LEFT":
|
|
2078
2078
|
case "BOTTOM_RIGHT": {
|
|
2079
|
-
w +=
|
|
2079
|
+
w += I;
|
|
2080
2080
|
break;
|
|
2081
2081
|
}
|
|
2082
2082
|
}
|
|
@@ -2084,45 +2084,45 @@ function ko(e, t, n) {
|
|
|
2084
2084
|
case "LEFT":
|
|
2085
2085
|
case "TOP_LEFT":
|
|
2086
2086
|
case "BOTTOM_LEFT": {
|
|
2087
|
-
|
|
2087
|
+
E += A;
|
|
2088
2088
|
break;
|
|
2089
2089
|
}
|
|
2090
2090
|
case "RIGHT":
|
|
2091
2091
|
case "TOP_RIGHT":
|
|
2092
2092
|
case "BOTTOM_RIGHT": {
|
|
2093
|
-
|
|
2093
|
+
S += A;
|
|
2094
2094
|
break;
|
|
2095
2095
|
}
|
|
2096
2096
|
}
|
|
2097
2097
|
}
|
|
2098
|
-
const
|
|
2098
|
+
const N = Math.min(E, S), U = Math.min(p, w), _ = Math.abs(S - E), b = Math.abs(w - p);
|
|
2099
2099
|
return {
|
|
2100
|
-
...
|
|
2100
|
+
...d,
|
|
2101
2101
|
geometry: {
|
|
2102
|
-
x:
|
|
2103
|
-
y:
|
|
2104
|
-
w:
|
|
2105
|
-
h:
|
|
2102
|
+
x: N,
|
|
2103
|
+
y: U,
|
|
2104
|
+
w: _,
|
|
2105
|
+
h: b,
|
|
2106
2106
|
bounds: {
|
|
2107
|
-
minX:
|
|
2108
|
-
minY:
|
|
2109
|
-
maxX:
|
|
2110
|
-
maxY:
|
|
2107
|
+
minX: N,
|
|
2108
|
+
minY: U,
|
|
2109
|
+
maxX: N + _,
|
|
2110
|
+
maxY: U + b
|
|
2111
2111
|
}
|
|
2112
2112
|
}
|
|
2113
2113
|
};
|
|
2114
2114
|
};
|
|
2115
|
-
function c(
|
|
2116
|
-
|
|
2115
|
+
function c(d) {
|
|
2116
|
+
fe.call(this, e, d);
|
|
2117
2117
|
}
|
|
2118
|
-
function u(
|
|
2119
|
-
|
|
2118
|
+
function u(d) {
|
|
2119
|
+
fe.call(this, e, d);
|
|
2120
2120
|
}
|
|
2121
|
-
function f(
|
|
2122
|
-
|
|
2121
|
+
function f(d) {
|
|
2122
|
+
fe.call(this, e, d);
|
|
2123
2123
|
}
|
|
2124
|
-
return e.$$set = (
|
|
2125
|
-
"shape" in
|
|
2124
|
+
return e.$$set = (d) => {
|
|
2125
|
+
"shape" in d && n(0, i = d.shape), "computedStyle" in d && n(1, s = d.computedStyle), "transform" in d && n(2, r = d.transform), "viewportScale" in d && n(3, l = d.viewportScale);
|
|
2126
2126
|
}, e.$$.update = () => {
|
|
2127
2127
|
e.$$.dirty & /*shape*/
|
|
2128
2128
|
1 && n(4, o = i.geometry);
|
|
@@ -2140,7 +2140,7 @@ function ko(e, t, n) {
|
|
|
2140
2140
|
}
|
|
2141
2141
|
class Oo extends te {
|
|
2142
2142
|
constructor(t) {
|
|
2143
|
-
super(), ee(this, t, ko, Lo,
|
|
2143
|
+
super(), ee(this, t, ko, Lo, K, {
|
|
2144
2144
|
shape: 0,
|
|
2145
2145
|
computedStyle: 1,
|
|
2146
2146
|
transform: 2,
|
|
@@ -2149,8 +2149,8 @@ class Oo extends te {
|
|
|
2149
2149
|
}
|
|
2150
2150
|
}
|
|
2151
2151
|
const Zt = /* @__PURE__ */ new Map([
|
|
2152
|
-
[
|
|
2153
|
-
[
|
|
2152
|
+
[F.RECTANGLE, Oo],
|
|
2153
|
+
[F.POLYGON, yo]
|
|
2154
2154
|
]), Bo = (e) => Zt.get(e.type), Io = (e, t) => Zt.set(e, t), Po = (e) => ({}), St = (e) => ({ grab: (
|
|
2155
2155
|
/*onGrab*/
|
|
2156
2156
|
e[0]
|
|
@@ -2169,17 +2169,17 @@ function Yo(e) {
|
|
|
2169
2169
|
);
|
|
2170
2170
|
return {
|
|
2171
2171
|
c() {
|
|
2172
|
-
t =
|
|
2172
|
+
t = X("g"), r && r.c(), h(t, "class", "a9s-annotation selected");
|
|
2173
2173
|
},
|
|
2174
2174
|
m(l, a) {
|
|
2175
|
-
|
|
2176
|
-
|
|
2175
|
+
B(l, t, a), r && r.m(t, null), n = !0, o || (i = [
|
|
2176
|
+
H(
|
|
2177
2177
|
t,
|
|
2178
2178
|
"pointerup",
|
|
2179
2179
|
/*onRelease*/
|
|
2180
2180
|
e[2]
|
|
2181
2181
|
),
|
|
2182
|
-
|
|
2182
|
+
H(
|
|
2183
2183
|
t,
|
|
2184
2184
|
"pointermove",
|
|
2185
2185
|
/*onPointerMove*/
|
|
@@ -2215,7 +2215,7 @@ function Yo(e) {
|
|
|
2215
2215
|
D(r, l), n = !1;
|
|
2216
2216
|
},
|
|
2217
2217
|
d(l) {
|
|
2218
|
-
l &&
|
|
2218
|
+
l && k(t), r && r.d(l), o = !1, le(i);
|
|
2219
2219
|
}
|
|
2220
2220
|
};
|
|
2221
2221
|
}
|
|
@@ -2223,23 +2223,23 @@ function Co(e, t, n) {
|
|
|
2223
2223
|
let { $$slots: o = {}, $$scope: i } = t;
|
|
2224
2224
|
const s = Te();
|
|
2225
2225
|
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c, u, f;
|
|
2226
|
-
const
|
|
2227
|
-
c =
|
|
2228
|
-
}, g = (
|
|
2226
|
+
const d = (y) => (E) => {
|
|
2227
|
+
c = y, u = a.elementToImage(E.offsetX, E.offsetY), f = r, E.target.setPointerCapture(E.pointerId), s("grab", E);
|
|
2228
|
+
}, g = (y) => {
|
|
2229
2229
|
if (c) {
|
|
2230
|
-
const [
|
|
2231
|
-
n(3, r = l(f, c,
|
|
2230
|
+
const [E, p] = a.elementToImage(y.offsetX, y.offsetY), S = [E - u[0], p - u[1]];
|
|
2231
|
+
n(3, r = l(f, c, S)), s("change", r);
|
|
2232
2232
|
}
|
|
2233
|
-
}, m = (
|
|
2234
|
-
|
|
2233
|
+
}, m = (y) => {
|
|
2234
|
+
y.target.releasePointerCapture(y.pointerId), c = void 0, f = r, s("release", y);
|
|
2235
2235
|
};
|
|
2236
|
-
return e.$$set = (
|
|
2237
|
-
"shape" in
|
|
2238
|
-
}, [
|
|
2236
|
+
return e.$$set = (y) => {
|
|
2237
|
+
"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);
|
|
2238
|
+
}, [d, g, m, r, l, a, i, o];
|
|
2239
2239
|
}
|
|
2240
2240
|
class Qt extends te {
|
|
2241
2241
|
constructor(t) {
|
|
2242
|
-
super(), ee(this, t, Co, Yo,
|
|
2242
|
+
super(), ee(this, t, Co, Yo, K, { shape: 3, editor: 4, transform: 5 });
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
2245
|
const je = (e, t) => {
|
|
@@ -2254,7 +2254,7 @@ function Do(e, t, n) {
|
|
|
2254
2254
|
let o;
|
|
2255
2255
|
const i = Te();
|
|
2256
2256
|
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale: u } = t, f;
|
|
2257
|
-
return
|
|
2257
|
+
return Ye(() => (n(6, f = new r({
|
|
2258
2258
|
target: a,
|
|
2259
2259
|
props: {
|
|
2260
2260
|
shape: s.target.selector,
|
|
@@ -2262,12 +2262,12 @@ function Do(e, t, n) {
|
|
|
2262
2262
|
transform: c,
|
|
2263
2263
|
viewportScale: u
|
|
2264
2264
|
}
|
|
2265
|
-
})), f.$on("change", (
|
|
2266
|
-
f.$$set({ shape:
|
|
2267
|
-
}), f.$on("grab", (
|
|
2265
|
+
})), f.$on("change", (d) => {
|
|
2266
|
+
f.$$set({ shape: d.detail }), i("change", d.detail);
|
|
2267
|
+
}), f.$on("grab", (d) => i("grab", d.detail)), f.$on("release", (d) => i("release", d.detail)), () => {
|
|
2268
2268
|
f.$destroy();
|
|
2269
|
-
})), e.$$set = (
|
|
2270
|
-
"annotation" in
|
|
2269
|
+
})), e.$$set = (d) => {
|
|
2270
|
+
"annotation" in d && n(0, s = d.annotation), "editor" in d && n(1, r = d.editor), "style" in d && n(2, l = d.style), "target" in d && n(3, a = d.target), "transform" in d && n(4, c = d.transform), "viewportScale" in d && n(5, u = d.viewportScale);
|
|
2271
2271
|
}, e.$$.update = () => {
|
|
2272
2272
|
e.$$.dirty & /*annotation, style*/
|
|
2273
2273
|
5 && (o = je(s, l)), e.$$.dirty & /*annotation, editorComponent*/
|
|
@@ -2278,7 +2278,7 @@ function Do(e, t, n) {
|
|
|
2278
2278
|
}
|
|
2279
2279
|
class Xo extends te {
|
|
2280
2280
|
constructor(t) {
|
|
2281
|
-
super(), ee(this, t, Do, null,
|
|
2281
|
+
super(), ee(this, t, Do, null, K, {
|
|
2282
2282
|
annotation: 0,
|
|
2283
2283
|
editor: 1,
|
|
2284
2284
|
style: 2,
|
|
@@ -2291,14 +2291,14 @@ class Xo extends te {
|
|
|
2291
2291
|
function Ro(e, t, n) {
|
|
2292
2292
|
const o = Te();
|
|
2293
2293
|
let { drawingMode: i } = t, { target: s } = t, { tool: r } = t, { transform: l } = t, { viewportScale: a } = t, c;
|
|
2294
|
-
return
|
|
2295
|
-
const u = s.closest("svg"), f = [],
|
|
2296
|
-
u == null || u.addEventListener(g, m,
|
|
2294
|
+
return Ye(() => {
|
|
2295
|
+
const u = s.closest("svg"), f = [], d = (g, m, y) => {
|
|
2296
|
+
u == null || u.addEventListener(g, m, y), f.push(() => u == null ? void 0 : u.removeEventListener(g, m, y));
|
|
2297
2297
|
};
|
|
2298
2298
|
return n(5, c = new r({
|
|
2299
2299
|
target: s,
|
|
2300
2300
|
props: {
|
|
2301
|
-
addEventListener:
|
|
2301
|
+
addEventListener: d,
|
|
2302
2302
|
drawingMode: i,
|
|
2303
2303
|
transform: l,
|
|
2304
2304
|
viewportScale: a
|
|
@@ -2316,7 +2316,7 @@ function Ro(e, t, n) {
|
|
|
2316
2316
|
}
|
|
2317
2317
|
class Uo extends te {
|
|
2318
2318
|
constructor(t) {
|
|
2319
|
-
super(), ee(this, t, Ro, null,
|
|
2319
|
+
super(), ee(this, t, Ro, null, K, {
|
|
2320
2320
|
drawingMode: 0,
|
|
2321
2321
|
target: 1,
|
|
2322
2322
|
tool: 2,
|
|
@@ -2329,42 +2329,42 @@ function Tt(e) {
|
|
|
2329
2329
|
let t, n;
|
|
2330
2330
|
return {
|
|
2331
2331
|
c() {
|
|
2332
|
-
t =
|
|
2332
|
+
t = X("rect"), n = X("rect"), h(t, "class", "a9s-outer"), h(
|
|
2333
2333
|
t,
|
|
2334
2334
|
"x",
|
|
2335
2335
|
/*x*/
|
|
2336
2336
|
e[1]
|
|
2337
|
-
),
|
|
2337
|
+
), h(
|
|
2338
2338
|
t,
|
|
2339
2339
|
"y",
|
|
2340
2340
|
/*y*/
|
|
2341
2341
|
e[2]
|
|
2342
|
-
),
|
|
2342
|
+
), h(
|
|
2343
2343
|
t,
|
|
2344
2344
|
"width",
|
|
2345
2345
|
/*w*/
|
|
2346
2346
|
e[3]
|
|
2347
|
-
),
|
|
2347
|
+
), h(
|
|
2348
2348
|
t,
|
|
2349
2349
|
"height",
|
|
2350
2350
|
/*h*/
|
|
2351
2351
|
e[4]
|
|
2352
|
-
),
|
|
2352
|
+
), h(n, "class", "a9s-inner"), h(
|
|
2353
2353
|
n,
|
|
2354
2354
|
"x",
|
|
2355
2355
|
/*x*/
|
|
2356
2356
|
e[1]
|
|
2357
|
-
),
|
|
2357
|
+
), h(
|
|
2358
2358
|
n,
|
|
2359
2359
|
"y",
|
|
2360
2360
|
/*y*/
|
|
2361
2361
|
e[2]
|
|
2362
|
-
),
|
|
2362
|
+
), h(
|
|
2363
2363
|
n,
|
|
2364
2364
|
"width",
|
|
2365
2365
|
/*w*/
|
|
2366
2366
|
e[3]
|
|
2367
|
-
),
|
|
2367
|
+
), h(
|
|
2368
2368
|
n,
|
|
2369
2369
|
"height",
|
|
2370
2370
|
/*h*/
|
|
@@ -2372,53 +2372,53 @@ function Tt(e) {
|
|
|
2372
2372
|
);
|
|
2373
2373
|
},
|
|
2374
2374
|
m(o, i) {
|
|
2375
|
-
|
|
2375
|
+
B(o, t, i), B(o, n, i);
|
|
2376
2376
|
},
|
|
2377
2377
|
p(o, i) {
|
|
2378
2378
|
i & /*x*/
|
|
2379
|
-
2 &&
|
|
2379
|
+
2 && h(
|
|
2380
2380
|
t,
|
|
2381
2381
|
"x",
|
|
2382
2382
|
/*x*/
|
|
2383
2383
|
o[1]
|
|
2384
2384
|
), i & /*y*/
|
|
2385
|
-
4 &&
|
|
2385
|
+
4 && h(
|
|
2386
2386
|
t,
|
|
2387
2387
|
"y",
|
|
2388
2388
|
/*y*/
|
|
2389
2389
|
o[2]
|
|
2390
2390
|
), i & /*w*/
|
|
2391
|
-
8 &&
|
|
2391
|
+
8 && h(
|
|
2392
2392
|
t,
|
|
2393
2393
|
"width",
|
|
2394
2394
|
/*w*/
|
|
2395
2395
|
o[3]
|
|
2396
2396
|
), i & /*h*/
|
|
2397
|
-
16 &&
|
|
2397
|
+
16 && h(
|
|
2398
2398
|
t,
|
|
2399
2399
|
"height",
|
|
2400
2400
|
/*h*/
|
|
2401
2401
|
o[4]
|
|
2402
2402
|
), i & /*x*/
|
|
2403
|
-
2 &&
|
|
2403
|
+
2 && h(
|
|
2404
2404
|
n,
|
|
2405
2405
|
"x",
|
|
2406
2406
|
/*x*/
|
|
2407
2407
|
o[1]
|
|
2408
2408
|
), i & /*y*/
|
|
2409
|
-
4 &&
|
|
2409
|
+
4 && h(
|
|
2410
2410
|
n,
|
|
2411
2411
|
"y",
|
|
2412
2412
|
/*y*/
|
|
2413
2413
|
o[2]
|
|
2414
2414
|
), i & /*w*/
|
|
2415
|
-
8 &&
|
|
2415
|
+
8 && h(
|
|
2416
2416
|
n,
|
|
2417
2417
|
"width",
|
|
2418
2418
|
/*w*/
|
|
2419
2419
|
o[3]
|
|
2420
2420
|
), i & /*h*/
|
|
2421
|
-
16 &&
|
|
2421
|
+
16 && h(
|
|
2422
2422
|
n,
|
|
2423
2423
|
"height",
|
|
2424
2424
|
/*h*/
|
|
@@ -2426,7 +2426,7 @@ function Tt(e) {
|
|
|
2426
2426
|
);
|
|
2427
2427
|
},
|
|
2428
2428
|
d(o) {
|
|
2429
|
-
o && (
|
|
2429
|
+
o && (k(t), k(n));
|
|
2430
2430
|
}
|
|
2431
2431
|
};
|
|
2432
2432
|
}
|
|
@@ -2437,69 +2437,69 @@ function No(e) {
|
|
|
2437
2437
|
);
|
|
2438
2438
|
return {
|
|
2439
2439
|
c() {
|
|
2440
|
-
t =
|
|
2440
|
+
t = X("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2441
2441
|
},
|
|
2442
2442
|
m(o, i) {
|
|
2443
|
-
|
|
2443
|
+
B(o, t, i), n && n.m(t, null);
|
|
2444
2444
|
},
|
|
2445
2445
|
p(o, [i]) {
|
|
2446
2446
|
/*origin*/
|
|
2447
2447
|
o[0] ? n ? n.p(o, i) : (n = Tt(o), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2448
2448
|
},
|
|
2449
|
-
i:
|
|
2450
|
-
o:
|
|
2449
|
+
i: G,
|
|
2450
|
+
o: G,
|
|
2451
2451
|
d(o) {
|
|
2452
|
-
o &&
|
|
2452
|
+
o && k(t), n && n.d();
|
|
2453
2453
|
}
|
|
2454
2454
|
};
|
|
2455
2455
|
}
|
|
2456
2456
|
function Vo(e, t, n) {
|
|
2457
2457
|
const o = Te();
|
|
2458
|
-
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f,
|
|
2459
|
-
const m = (
|
|
2460
|
-
const w =
|
|
2461
|
-
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(w.offsetX, w.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3,
|
|
2462
|
-
},
|
|
2463
|
-
const w =
|
|
2464
|
-
a && (c = r.elementToImage(w.offsetX, w.offsetY), n(1, u = Math.min(c[0], a[0])), n(2, f = Math.min(c[1], a[1])), n(3,
|
|
2465
|
-
},
|
|
2466
|
-
const w =
|
|
2458
|
+
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f, d, g;
|
|
2459
|
+
const m = (S) => {
|
|
2460
|
+
const w = S;
|
|
2461
|
+
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(w.offsetX, w.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, d = 1), n(4, g = 1));
|
|
2462
|
+
}, y = (S) => {
|
|
2463
|
+
const w = S;
|
|
2464
|
+
a && (c = r.elementToImage(w.offsetX, w.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])));
|
|
2465
|
+
}, E = (S) => {
|
|
2466
|
+
const w = S, A = performance.now() - l;
|
|
2467
2467
|
if (s === "click") {
|
|
2468
|
-
if (
|
|
2468
|
+
if (A > 300)
|
|
2469
2469
|
return;
|
|
2470
|
-
w.stopPropagation(), a ?
|
|
2470
|
+
w.stopPropagation(), a ? p() : (n(0, a = r.elementToImage(w.offsetX, w.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, d = 1), n(4, g = 1));
|
|
2471
2471
|
} else
|
|
2472
|
-
a && (
|
|
2473
|
-
},
|
|
2474
|
-
if (
|
|
2475
|
-
const
|
|
2476
|
-
type:
|
|
2472
|
+
a && (A > 300 || d * g > 100 ? (w.stopPropagation(), p()) : (n(0, a = void 0), c = void 0));
|
|
2473
|
+
}, p = () => {
|
|
2474
|
+
if (d * g > 15) {
|
|
2475
|
+
const S = {
|
|
2476
|
+
type: F.RECTANGLE,
|
|
2477
2477
|
geometry: {
|
|
2478
2478
|
bounds: {
|
|
2479
2479
|
minX: u,
|
|
2480
2480
|
minY: f,
|
|
2481
|
-
maxX: u +
|
|
2481
|
+
maxX: u + d,
|
|
2482
2482
|
maxY: f + g
|
|
2483
2483
|
},
|
|
2484
2484
|
x: u,
|
|
2485
2485
|
y: f,
|
|
2486
|
-
w:
|
|
2486
|
+
w: d,
|
|
2487
2487
|
h: g
|
|
2488
2488
|
}
|
|
2489
2489
|
};
|
|
2490
|
-
o("create",
|
|
2490
|
+
o("create", S);
|
|
2491
2491
|
}
|
|
2492
2492
|
n(0, a = void 0), c = void 0;
|
|
2493
2493
|
};
|
|
2494
|
-
return
|
|
2495
|
-
i("pointerdown", m), i("pointermove",
|
|
2496
|
-
}), e.$$set = (
|
|
2497
|
-
"addEventListener" in
|
|
2498
|
-
}, [a, u, f,
|
|
2494
|
+
return Ye(() => {
|
|
2495
|
+
i("pointerdown", m), i("pointermove", y), i("pointerup", E, !0);
|
|
2496
|
+
}), e.$$set = (S) => {
|
|
2497
|
+
"addEventListener" in S && n(5, i = S.addEventListener), "drawingMode" in S && n(6, s = S.drawingMode), "transform" in S && n(7, r = S.transform);
|
|
2498
|
+
}, [a, u, f, d, g, i, s, r];
|
|
2499
2499
|
}
|
|
2500
2500
|
class Go extends te {
|
|
2501
2501
|
constructor(t) {
|
|
2502
|
-
super(), ee(this, t, Vo, No,
|
|
2502
|
+
super(), ee(this, t, Vo, No, K, {
|
|
2503
2503
|
addEventListener: 5,
|
|
2504
2504
|
drawingMode: 6,
|
|
2505
2505
|
transform: 7
|
|
@@ -2528,23 +2528,23 @@ function Mt(e) {
|
|
|
2528
2528
|
);
|
|
2529
2529
|
return {
|
|
2530
2530
|
c() {
|
|
2531
|
-
t =
|
|
2532
|
-
e[16]),
|
|
2531
|
+
t = X("polygon"), o = X("polygon"), r && r.c(), s = ae(), h(t, "class", "a9s-outer"), h(t, "points", n = /*coords*/
|
|
2532
|
+
e[16]), h(o, "class", "a9s-inner"), h(o, "points", i = /*coords*/
|
|
2533
2533
|
e[16]);
|
|
2534
2534
|
},
|
|
2535
2535
|
m(l, a) {
|
|
2536
|
-
|
|
2536
|
+
B(l, t, a), B(l, o, a), r && r.m(l, a), B(l, s, a);
|
|
2537
2537
|
},
|
|
2538
2538
|
p(l, a) {
|
|
2539
2539
|
a & /*isClosable, points, cursor*/
|
|
2540
2540
|
7 && n !== (n = /*coords*/
|
|
2541
|
-
l[16]) &&
|
|
2541
|
+
l[16]) && h(t, "points", n), a & /*isClosable, points, cursor*/
|
|
2542
2542
|
7 && i !== (i = /*coords*/
|
|
2543
|
-
l[16]) &&
|
|
2543
|
+
l[16]) && h(o, "points", i), /*isClosable*/
|
|
2544
2544
|
l[2] ? r ? r.p(l, a) : (r = vt(l), r.c(), r.m(s.parentNode, s)) : r && (r.d(1), r = null);
|
|
2545
2545
|
},
|
|
2546
2546
|
d(l) {
|
|
2547
|
-
l && (
|
|
2547
|
+
l && (k(t), k(o), k(s)), r && r.d(l);
|
|
2548
2548
|
}
|
|
2549
2549
|
};
|
|
2550
2550
|
}
|
|
@@ -2552,16 +2552,16 @@ function vt(e) {
|
|
|
2552
2552
|
let t, n, o;
|
|
2553
2553
|
return {
|
|
2554
2554
|
c() {
|
|
2555
|
-
t =
|
|
2555
|
+
t = X("rect"), h(t, "class", "a9s-corner-handle"), h(t, "x", n = /*points*/
|
|
2556
2556
|
e[0][0][0] - /*handleSize*/
|
|
2557
|
-
e[3] / 2),
|
|
2557
|
+
e[3] / 2), h(t, "y", o = /*points*/
|
|
2558
2558
|
e[0][0][1] - /*handleSize*/
|
|
2559
|
-
e[3] / 2),
|
|
2559
|
+
e[3] / 2), h(
|
|
2560
2560
|
t,
|
|
2561
2561
|
"height",
|
|
2562
2562
|
/*handleSize*/
|
|
2563
2563
|
e[3]
|
|
2564
|
-
),
|
|
2564
|
+
), h(
|
|
2565
2565
|
t,
|
|
2566
2566
|
"width",
|
|
2567
2567
|
/*handleSize*/
|
|
@@ -2569,23 +2569,23 @@ function vt(e) {
|
|
|
2569
2569
|
);
|
|
2570
2570
|
},
|
|
2571
2571
|
m(i, s) {
|
|
2572
|
-
|
|
2572
|
+
B(i, t, s);
|
|
2573
2573
|
},
|
|
2574
2574
|
p(i, s) {
|
|
2575
2575
|
s & /*points, handleSize*/
|
|
2576
2576
|
9 && n !== (n = /*points*/
|
|
2577
2577
|
i[0][0][0] - /*handleSize*/
|
|
2578
|
-
i[3] / 2) &&
|
|
2578
|
+
i[3] / 2) && h(t, "x", n), s & /*points, handleSize*/
|
|
2579
2579
|
9 && o !== (o = /*points*/
|
|
2580
2580
|
i[0][0][1] - /*handleSize*/
|
|
2581
|
-
i[3] / 2) &&
|
|
2582
|
-
8 &&
|
|
2581
|
+
i[3] / 2) && h(t, "y", o), s & /*handleSize*/
|
|
2582
|
+
8 && h(
|
|
2583
2583
|
t,
|
|
2584
2584
|
"height",
|
|
2585
2585
|
/*handleSize*/
|
|
2586
2586
|
i[3]
|
|
2587
2587
|
), s & /*handleSize*/
|
|
2588
|
-
8 &&
|
|
2588
|
+
8 && h(
|
|
2589
2589
|
t,
|
|
2590
2590
|
"width",
|
|
2591
2591
|
/*handleSize*/
|
|
@@ -2593,7 +2593,7 @@ function vt(e) {
|
|
|
2593
2593
|
);
|
|
2594
2594
|
},
|
|
2595
2595
|
d(i) {
|
|
2596
|
-
i &&
|
|
2596
|
+
i && k(t);
|
|
2597
2597
|
}
|
|
2598
2598
|
};
|
|
2599
2599
|
}
|
|
@@ -2604,19 +2604,19 @@ function zo(e) {
|
|
|
2604
2604
|
);
|
|
2605
2605
|
return {
|
|
2606
2606
|
c() {
|
|
2607
|
-
t =
|
|
2607
|
+
t = X("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2608
2608
|
},
|
|
2609
2609
|
m(o, i) {
|
|
2610
|
-
|
|
2610
|
+
B(o, t, i), n && n.m(t, null);
|
|
2611
2611
|
},
|
|
2612
2612
|
p(o, [i]) {
|
|
2613
2613
|
/*cursor*/
|
|
2614
2614
|
o[1] ? n ? n.p(xe(o), i) : (n = Mt(xe(o)), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2615
2615
|
},
|
|
2616
|
-
i:
|
|
2617
|
-
o:
|
|
2616
|
+
i: G,
|
|
2617
|
+
o: G,
|
|
2618
2618
|
d(o) {
|
|
2619
|
-
o &&
|
|
2619
|
+
o && k(t), n && n.d();
|
|
2620
2620
|
}
|
|
2621
2621
|
};
|
|
2622
2622
|
}
|
|
@@ -2624,38 +2624,38 @@ const Ho = 20, Fo = 1500;
|
|
|
2624
2624
|
function jo(e, t, n) {
|
|
2625
2625
|
let o;
|
|
2626
2626
|
const i = Te();
|
|
2627
|
-
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f,
|
|
2627
|
+
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, d, g = !1;
|
|
2628
2628
|
const m = (w) => {
|
|
2629
|
-
const
|
|
2630
|
-
if (c = { timeStamp:
|
|
2631
|
-
const
|
|
2632
|
-
u.push(
|
|
2629
|
+
const A = w, { timeStamp: I, offsetX: N, offsetY: U } = A;
|
|
2630
|
+
if (c = { timeStamp: I, offsetX: N, offsetY: U }, r === "drag" && u.length === 0) {
|
|
2631
|
+
const _ = l.elementToImage(A.offsetX, A.offsetY);
|
|
2632
|
+
u.push(_), n(1, f = _);
|
|
2633
2633
|
}
|
|
2634
|
-
},
|
|
2635
|
-
const
|
|
2636
|
-
if (
|
|
2637
|
-
if (n(1, f = l.elementToImage(
|
|
2638
|
-
const
|
|
2639
|
-
n(2, g =
|
|
2634
|
+
}, y = (w) => {
|
|
2635
|
+
const A = w;
|
|
2636
|
+
if (d && clearTimeout(d), u.length > 0) {
|
|
2637
|
+
if (n(1, f = l.elementToImage(A.offsetX, A.offsetY)), u.length > 2) {
|
|
2638
|
+
const I = Qe(f, u[0]) * a;
|
|
2639
|
+
n(2, g = I < Ho);
|
|
2640
2640
|
}
|
|
2641
|
-
|
|
2641
|
+
A.pointerType === "touch" && (d = setTimeout(
|
|
2642
2642
|
() => {
|
|
2643
|
-
|
|
2643
|
+
p();
|
|
2644
2644
|
},
|
|
2645
2645
|
Fo
|
|
2646
2646
|
));
|
|
2647
2647
|
}
|
|
2648
|
-
},
|
|
2649
|
-
const
|
|
2650
|
-
if (
|
|
2651
|
-
const
|
|
2652
|
-
if (
|
|
2648
|
+
}, E = (w) => {
|
|
2649
|
+
const A = w;
|
|
2650
|
+
if (d && clearTimeout(d), r === "click") {
|
|
2651
|
+
const I = A.timeStamp - c.timeStamp, N = Qe([c.offsetX, c.offsetY], [A.offsetX, A.offsetY]);
|
|
2652
|
+
if (I > 300 || N > 15)
|
|
2653
2653
|
return;
|
|
2654
2654
|
if (g)
|
|
2655
|
-
|
|
2655
|
+
S();
|
|
2656
2656
|
else if (u.length === 0) {
|
|
2657
|
-
const
|
|
2658
|
-
u.push(
|
|
2657
|
+
const U = l.elementToImage(A.offsetX, A.offsetY);
|
|
2658
|
+
u.push(U), n(1, f = U);
|
|
2659
2659
|
} else
|
|
2660
2660
|
u.push(f);
|
|
2661
2661
|
} else {
|
|
@@ -2663,19 +2663,19 @@ function jo(e, t, n) {
|
|
|
2663
2663
|
n(0, u = []), n(1, f = void 0);
|
|
2664
2664
|
return;
|
|
2665
2665
|
}
|
|
2666
|
-
|
|
2666
|
+
A.stopImmediatePropagation(), g ? S() : u.push(f);
|
|
2667
2667
|
}
|
|
2668
|
-
},
|
|
2668
|
+
}, p = () => {
|
|
2669
2669
|
if (!f)
|
|
2670
2670
|
return;
|
|
2671
|
-
const w = [...u, f],
|
|
2672
|
-
type:
|
|
2671
|
+
const w = [...u, f], A = {
|
|
2672
|
+
type: F.POLYGON,
|
|
2673
2673
|
geometry: { bounds: Fe(w), points: w }
|
|
2674
2674
|
};
|
|
2675
|
-
st(
|
|
2676
|
-
},
|
|
2675
|
+
st(A) > 4 && (n(0, u = []), n(1, f = void 0), i("create", A));
|
|
2676
|
+
}, S = () => {
|
|
2677
2677
|
const w = {
|
|
2678
|
-
type:
|
|
2678
|
+
type: F.POLYGON,
|
|
2679
2679
|
geometry: {
|
|
2680
2680
|
bounds: Fe(u),
|
|
2681
2681
|
points: [...u]
|
|
@@ -2683,8 +2683,8 @@ function jo(e, t, n) {
|
|
|
2683
2683
|
};
|
|
2684
2684
|
n(0, u = []), n(1, f = void 0), i("create", w);
|
|
2685
2685
|
};
|
|
2686
|
-
return
|
|
2687
|
-
s("pointerdown", m, !0), s("pointermove",
|
|
2686
|
+
return Ye(() => {
|
|
2687
|
+
s("pointerdown", m, !0), s("pointermove", y), s("pointerup", E, !0), s("dblclick", p, !0);
|
|
2688
2688
|
}), e.$$set = (w) => {
|
|
2689
2689
|
"addEventListener" in w && n(4, s = w.addEventListener), "drawingMode" in w && n(5, r = w.drawingMode), "transform" in w && n(6, l = w.transform), "viewportScale" in w && n(7, a = w.viewportScale);
|
|
2690
2690
|
}, e.$$.update = () => {
|
|
@@ -2703,7 +2703,7 @@ function jo(e, t, n) {
|
|
|
2703
2703
|
}
|
|
2704
2704
|
class qo extends te {
|
|
2705
2705
|
constructor(t) {
|
|
2706
|
-
super(), ee(this, t, jo, zo,
|
|
2706
|
+
super(), ee(this, t, jo, zo, K, {
|
|
2707
2707
|
addEventListener: 4,
|
|
2708
2708
|
drawingMode: 5,
|
|
2709
2709
|
transform: 6,
|
|
@@ -2719,75 +2719,75 @@ function Wo(e) {
|
|
|
2719
2719
|
let t, n, o, i, s;
|
|
2720
2720
|
return {
|
|
2721
2721
|
c() {
|
|
2722
|
-
t =
|
|
2723
|
-
e[1] ? "display:none;" : void 0),
|
|
2722
|
+
t = X("g"), n = X("ellipse"), i = X("ellipse"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2723
|
+
e[1] ? "display:none;" : void 0), h(
|
|
2724
2724
|
n,
|
|
2725
2725
|
"cx",
|
|
2726
2726
|
/*cx*/
|
|
2727
2727
|
e[2]
|
|
2728
|
-
),
|
|
2728
|
+
), h(
|
|
2729
2729
|
n,
|
|
2730
2730
|
"cy",
|
|
2731
2731
|
/*cy*/
|
|
2732
2732
|
e[3]
|
|
2733
|
-
),
|
|
2733
|
+
), h(
|
|
2734
2734
|
n,
|
|
2735
2735
|
"rx",
|
|
2736
2736
|
/*rx*/
|
|
2737
2737
|
e[4]
|
|
2738
|
-
),
|
|
2738
|
+
), h(
|
|
2739
2739
|
n,
|
|
2740
2740
|
"ry",
|
|
2741
2741
|
/*ry*/
|
|
2742
2742
|
e[5]
|
|
2743
|
-
),
|
|
2743
|
+
), h(i, "class", "a9s-inner"), h(
|
|
2744
2744
|
i,
|
|
2745
2745
|
"style",
|
|
2746
2746
|
/*computedStyle*/
|
|
2747
2747
|
e[1]
|
|
2748
|
-
),
|
|
2748
|
+
), h(
|
|
2749
2749
|
i,
|
|
2750
2750
|
"cx",
|
|
2751
2751
|
/*cx*/
|
|
2752
2752
|
e[2]
|
|
2753
|
-
),
|
|
2753
|
+
), h(
|
|
2754
2754
|
i,
|
|
2755
2755
|
"cy",
|
|
2756
2756
|
/*cy*/
|
|
2757
2757
|
e[3]
|
|
2758
|
-
),
|
|
2758
|
+
), h(
|
|
2759
2759
|
i,
|
|
2760
2760
|
"rx",
|
|
2761
2761
|
/*rx*/
|
|
2762
2762
|
e[4]
|
|
2763
|
-
),
|
|
2763
|
+
), h(
|
|
2764
2764
|
i,
|
|
2765
2765
|
"ry",
|
|
2766
2766
|
/*ry*/
|
|
2767
2767
|
e[5]
|
|
2768
|
-
),
|
|
2768
|
+
), h(t, "data-id", s = /*annotation*/
|
|
2769
2769
|
e[0].id);
|
|
2770
2770
|
},
|
|
2771
2771
|
m(r, l) {
|
|
2772
|
-
|
|
2772
|
+
B(r, t, l), ie(t, n), ie(t, i);
|
|
2773
2773
|
},
|
|
2774
2774
|
p(r, [l]) {
|
|
2775
2775
|
l & /*computedStyle*/
|
|
2776
2776
|
2 && o !== (o = /*computedStyle*/
|
|
2777
|
-
r[1] ? "display:none;" : void 0) &&
|
|
2778
|
-
2 &&
|
|
2777
|
+
r[1] ? "display:none;" : void 0) && h(n, "style", o), l & /*computedStyle*/
|
|
2778
|
+
2 && h(
|
|
2779
2779
|
i,
|
|
2780
2780
|
"style",
|
|
2781
2781
|
/*computedStyle*/
|
|
2782
2782
|
r[1]
|
|
2783
2783
|
), l & /*annotation*/
|
|
2784
2784
|
1 && s !== (s = /*annotation*/
|
|
2785
|
-
r[0].id) &&
|
|
2785
|
+
r[0].id) && h(t, "data-id", s);
|
|
2786
2786
|
},
|
|
2787
|
-
i:
|
|
2788
|
-
o:
|
|
2787
|
+
i: G,
|
|
2788
|
+
o: G,
|
|
2789
2789
|
d(r) {
|
|
2790
|
-
r &&
|
|
2790
|
+
r && k(t);
|
|
2791
2791
|
}
|
|
2792
2792
|
};
|
|
2793
2793
|
}
|
|
@@ -2803,52 +2803,52 @@ function Jo(e, t, n) {
|
|
|
2803
2803
|
}
|
|
2804
2804
|
class Zo extends te {
|
|
2805
2805
|
constructor(t) {
|
|
2806
|
-
super(), ee(this, t, Jo, Wo,
|
|
2806
|
+
super(), ee(this, t, Jo, Wo, K, { annotation: 0, geom: 6, style: 7 });
|
|
2807
2807
|
}
|
|
2808
2808
|
}
|
|
2809
2809
|
function Qo(e) {
|
|
2810
2810
|
let t, n, o, i, s;
|
|
2811
2811
|
return {
|
|
2812
2812
|
c() {
|
|
2813
|
-
t =
|
|
2814
|
-
e[1] ? "display:none;" : void 0),
|
|
2813
|
+
t = X("g"), n = X("polygon"), i = X("polygon"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2814
|
+
e[1] ? "display:none;" : void 0), h(
|
|
2815
2815
|
n,
|
|
2816
2816
|
"points",
|
|
2817
2817
|
/*points*/
|
|
2818
2818
|
e[2].map(xo).join(" ")
|
|
2819
|
-
),
|
|
2819
|
+
), h(i, "class", "a9s-inner"), h(
|
|
2820
2820
|
i,
|
|
2821
2821
|
"style",
|
|
2822
2822
|
/*computedStyle*/
|
|
2823
2823
|
e[1]
|
|
2824
|
-
),
|
|
2824
|
+
), h(
|
|
2825
2825
|
i,
|
|
2826
2826
|
"points",
|
|
2827
2827
|
/*points*/
|
|
2828
2828
|
e[2].map($o).join(" ")
|
|
2829
|
-
),
|
|
2829
|
+
), h(t, "data-id", s = /*annotation*/
|
|
2830
2830
|
e[0].id);
|
|
2831
2831
|
},
|
|
2832
2832
|
m(r, l) {
|
|
2833
|
-
|
|
2833
|
+
B(r, t, l), ie(t, n), ie(t, i);
|
|
2834
2834
|
},
|
|
2835
2835
|
p(r, [l]) {
|
|
2836
2836
|
l & /*computedStyle*/
|
|
2837
2837
|
2 && o !== (o = /*computedStyle*/
|
|
2838
|
-
r[1] ? "display:none;" : void 0) &&
|
|
2839
|
-
2 &&
|
|
2838
|
+
r[1] ? "display:none;" : void 0) && h(n, "style", o), l & /*computedStyle*/
|
|
2839
|
+
2 && h(
|
|
2840
2840
|
i,
|
|
2841
2841
|
"style",
|
|
2842
2842
|
/*computedStyle*/
|
|
2843
2843
|
r[1]
|
|
2844
2844
|
), l & /*annotation*/
|
|
2845
2845
|
1 && s !== (s = /*annotation*/
|
|
2846
|
-
r[0].id) &&
|
|
2846
|
+
r[0].id) && h(t, "data-id", s);
|
|
2847
2847
|
},
|
|
2848
|
-
i:
|
|
2849
|
-
o:
|
|
2848
|
+
i: G,
|
|
2849
|
+
o: G,
|
|
2850
2850
|
d(r) {
|
|
2851
|
-
r &&
|
|
2851
|
+
r && k(t);
|
|
2852
2852
|
}
|
|
2853
2853
|
};
|
|
2854
2854
|
}
|
|
@@ -2865,130 +2865,130 @@ function ei(e, t, n) {
|
|
|
2865
2865
|
}
|
|
2866
2866
|
class ti extends te {
|
|
2867
2867
|
constructor(t) {
|
|
2868
|
-
super(), ee(this, t, ei, Qo,
|
|
2868
|
+
super(), ee(this, t, ei, Qo, K, { annotation: 0, geom: 3, style: 4 });
|
|
2869
2869
|
}
|
|
2870
2870
|
}
|
|
2871
2871
|
function ni(e) {
|
|
2872
2872
|
let t, n, o, i, s;
|
|
2873
2873
|
return {
|
|
2874
2874
|
c() {
|
|
2875
|
-
t =
|
|
2876
|
-
e[5] ? "display:none;" : void 0),
|
|
2875
|
+
t = X("g"), n = X("rect"), i = X("rect"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2876
|
+
e[5] ? "display:none;" : void 0), h(
|
|
2877
2877
|
n,
|
|
2878
2878
|
"x",
|
|
2879
2879
|
/*x*/
|
|
2880
2880
|
e[4]
|
|
2881
|
-
),
|
|
2881
|
+
), h(
|
|
2882
2882
|
n,
|
|
2883
2883
|
"y",
|
|
2884
2884
|
/*y*/
|
|
2885
2885
|
e[3]
|
|
2886
|
-
),
|
|
2886
|
+
), h(
|
|
2887
2887
|
n,
|
|
2888
2888
|
"width",
|
|
2889
2889
|
/*w*/
|
|
2890
2890
|
e[2]
|
|
2891
|
-
),
|
|
2891
|
+
), h(
|
|
2892
2892
|
n,
|
|
2893
2893
|
"height",
|
|
2894
2894
|
/*h*/
|
|
2895
2895
|
e[1]
|
|
2896
|
-
),
|
|
2896
|
+
), h(i, "class", "a9s-inner"), h(
|
|
2897
2897
|
i,
|
|
2898
2898
|
"style",
|
|
2899
2899
|
/*computedStyle*/
|
|
2900
2900
|
e[5]
|
|
2901
|
-
),
|
|
2901
|
+
), h(
|
|
2902
2902
|
i,
|
|
2903
2903
|
"x",
|
|
2904
2904
|
/*x*/
|
|
2905
2905
|
e[4]
|
|
2906
|
-
),
|
|
2906
|
+
), h(
|
|
2907
2907
|
i,
|
|
2908
2908
|
"y",
|
|
2909
2909
|
/*y*/
|
|
2910
2910
|
e[3]
|
|
2911
|
-
),
|
|
2911
|
+
), h(
|
|
2912
2912
|
i,
|
|
2913
2913
|
"width",
|
|
2914
2914
|
/*w*/
|
|
2915
2915
|
e[2]
|
|
2916
|
-
),
|
|
2916
|
+
), h(
|
|
2917
2917
|
i,
|
|
2918
2918
|
"height",
|
|
2919
2919
|
/*h*/
|
|
2920
2920
|
e[1]
|
|
2921
|
-
),
|
|
2921
|
+
), h(t, "data-id", s = /*annotation*/
|
|
2922
2922
|
e[0].id);
|
|
2923
2923
|
},
|
|
2924
2924
|
m(r, l) {
|
|
2925
|
-
|
|
2925
|
+
B(r, t, l), ie(t, n), ie(t, i);
|
|
2926
2926
|
},
|
|
2927
2927
|
p(r, [l]) {
|
|
2928
2928
|
l & /*computedStyle*/
|
|
2929
2929
|
32 && o !== (o = /*computedStyle*/
|
|
2930
|
-
r[5] ? "display:none;" : void 0) &&
|
|
2931
|
-
16 &&
|
|
2930
|
+
r[5] ? "display:none;" : void 0) && h(n, "style", o), l & /*x*/
|
|
2931
|
+
16 && h(
|
|
2932
2932
|
n,
|
|
2933
2933
|
"x",
|
|
2934
2934
|
/*x*/
|
|
2935
2935
|
r[4]
|
|
2936
2936
|
), l & /*y*/
|
|
2937
|
-
8 &&
|
|
2937
|
+
8 && h(
|
|
2938
2938
|
n,
|
|
2939
2939
|
"y",
|
|
2940
2940
|
/*y*/
|
|
2941
2941
|
r[3]
|
|
2942
2942
|
), l & /*w*/
|
|
2943
|
-
4 &&
|
|
2943
|
+
4 && h(
|
|
2944
2944
|
n,
|
|
2945
2945
|
"width",
|
|
2946
2946
|
/*w*/
|
|
2947
2947
|
r[2]
|
|
2948
2948
|
), l & /*h*/
|
|
2949
|
-
2 &&
|
|
2949
|
+
2 && h(
|
|
2950
2950
|
n,
|
|
2951
2951
|
"height",
|
|
2952
2952
|
/*h*/
|
|
2953
2953
|
r[1]
|
|
2954
2954
|
), l & /*computedStyle*/
|
|
2955
|
-
32 &&
|
|
2955
|
+
32 && h(
|
|
2956
2956
|
i,
|
|
2957
2957
|
"style",
|
|
2958
2958
|
/*computedStyle*/
|
|
2959
2959
|
r[5]
|
|
2960
2960
|
), l & /*x*/
|
|
2961
|
-
16 &&
|
|
2961
|
+
16 && h(
|
|
2962
2962
|
i,
|
|
2963
2963
|
"x",
|
|
2964
2964
|
/*x*/
|
|
2965
2965
|
r[4]
|
|
2966
2966
|
), l & /*y*/
|
|
2967
|
-
8 &&
|
|
2967
|
+
8 && h(
|
|
2968
2968
|
i,
|
|
2969
2969
|
"y",
|
|
2970
2970
|
/*y*/
|
|
2971
2971
|
r[3]
|
|
2972
2972
|
), l & /*w*/
|
|
2973
|
-
4 &&
|
|
2973
|
+
4 && h(
|
|
2974
2974
|
i,
|
|
2975
2975
|
"width",
|
|
2976
2976
|
/*w*/
|
|
2977
2977
|
r[2]
|
|
2978
2978
|
), l & /*h*/
|
|
2979
|
-
2 &&
|
|
2979
|
+
2 && h(
|
|
2980
2980
|
i,
|
|
2981
2981
|
"height",
|
|
2982
2982
|
/*h*/
|
|
2983
2983
|
r[1]
|
|
2984
2984
|
), l & /*annotation*/
|
|
2985
2985
|
1 && s !== (s = /*annotation*/
|
|
2986
|
-
r[0].id) &&
|
|
2986
|
+
r[0].id) && h(t, "data-id", s);
|
|
2987
2987
|
},
|
|
2988
|
-
i:
|
|
2989
|
-
o:
|
|
2988
|
+
i: G,
|
|
2989
|
+
o: G,
|
|
2990
2990
|
d(r) {
|
|
2991
|
-
r &&
|
|
2991
|
+
r && k(t);
|
|
2992
2992
|
}
|
|
2993
2993
|
};
|
|
2994
2994
|
}
|
|
@@ -3004,7 +3004,7 @@ function oi(e, t, n) {
|
|
|
3004
3004
|
}
|
|
3005
3005
|
class ii extends te {
|
|
3006
3006
|
constructor(t) {
|
|
3007
|
-
super(), ee(this, t, oi, ni,
|
|
3007
|
+
super(), ee(this, t, oi, ni, K, { annotation: 0, geom: 6, style: 7 });
|
|
3008
3008
|
}
|
|
3009
3009
|
}
|
|
3010
3010
|
const Ci = {
|
|
@@ -3031,35 +3031,35 @@ const Ci = {
|
|
|
3031
3031
|
}, { Boolean: en } = fn;
|
|
3032
3032
|
function Lt(e, t, n) {
|
|
3033
3033
|
const o = e.slice();
|
|
3034
|
-
return o[
|
|
3034
|
+
return o[31] = t[n], o;
|
|
3035
3035
|
}
|
|
3036
3036
|
function kt(e, t, n) {
|
|
3037
3037
|
const o = e.slice();
|
|
3038
|
-
return o[
|
|
3038
|
+
return o[34] = t[n], o;
|
|
3039
3039
|
}
|
|
3040
3040
|
function $e(e) {
|
|
3041
3041
|
const t = e.slice(), n = (
|
|
3042
3042
|
/*annotation*/
|
|
3043
|
-
t[
|
|
3043
|
+
t[34].target.selector
|
|
3044
3044
|
);
|
|
3045
|
-
return t[
|
|
3045
|
+
return t[37] = n, t;
|
|
3046
3046
|
}
|
|
3047
3047
|
function Ot(e) {
|
|
3048
3048
|
let t = (
|
|
3049
3049
|
/*annotation*/
|
|
3050
|
-
e[
|
|
3050
|
+
e[34].id
|
|
3051
3051
|
), n, o, i = Bt(e);
|
|
3052
3052
|
return {
|
|
3053
3053
|
c() {
|
|
3054
|
-
i.c(), n =
|
|
3054
|
+
i.c(), n = ae();
|
|
3055
3055
|
},
|
|
3056
3056
|
m(s, r) {
|
|
3057
|
-
i.m(s, r),
|
|
3057
|
+
i.m(s, r), B(s, n, r), o = !0;
|
|
3058
3058
|
},
|
|
3059
3059
|
p(s, r) {
|
|
3060
3060
|
r[0] & /*$store*/
|
|
3061
|
-
|
|
3062
|
-
s[
|
|
3061
|
+
16384 && K(t, t = /*annotation*/
|
|
3062
|
+
s[34].id) ? (se(), D(i, 1, 1, G), re(), i = Bt(s), i.c(), P(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3063
3063
|
},
|
|
3064
3064
|
i(s) {
|
|
3065
3065
|
o || (P(i), o = !0);
|
|
@@ -3068,7 +3068,7 @@ function Ot(e) {
|
|
|
3068
3068
|
D(i), o = !1;
|
|
3069
3069
|
},
|
|
3070
3070
|
d(s) {
|
|
3071
|
-
s &&
|
|
3071
|
+
s && k(n), i.d(s);
|
|
3072
3072
|
}
|
|
3073
3073
|
};
|
|
3074
3074
|
}
|
|
@@ -3078,11 +3078,11 @@ function ci(e) {
|
|
|
3078
3078
|
props: {
|
|
3079
3079
|
annotation: (
|
|
3080
3080
|
/*annotation*/
|
|
3081
|
-
e[
|
|
3081
|
+
e[34]
|
|
3082
3082
|
),
|
|
3083
3083
|
geom: (
|
|
3084
3084
|
/*selector*/
|
|
3085
|
-
e[
|
|
3085
|
+
e[37].geometry
|
|
3086
3086
|
),
|
|
3087
3087
|
style: (
|
|
3088
3088
|
/*style*/
|
|
@@ -3099,10 +3099,10 @@ function ci(e) {
|
|
|
3099
3099
|
p(o, i) {
|
|
3100
3100
|
const s = {};
|
|
3101
3101
|
i[0] & /*$store*/
|
|
3102
|
-
|
|
3103
|
-
o[
|
|
3104
|
-
|
|
3105
|
-
o[
|
|
3102
|
+
16384 && (s.annotation = /*annotation*/
|
|
3103
|
+
o[34]), i[0] & /*$store*/
|
|
3104
|
+
16384 && (s.geom = /*selector*/
|
|
3105
|
+
o[37].geometry), i[0] & /*style*/
|
|
3106
3106
|
2 && (s.style = /*style*/
|
|
3107
3107
|
o[1]), t.$set(s);
|
|
3108
3108
|
},
|
|
@@ -3123,11 +3123,11 @@ function fi(e) {
|
|
|
3123
3123
|
props: {
|
|
3124
3124
|
annotation: (
|
|
3125
3125
|
/*annotation*/
|
|
3126
|
-
e[
|
|
3126
|
+
e[34]
|
|
3127
3127
|
),
|
|
3128
3128
|
geom: (
|
|
3129
3129
|
/*selector*/
|
|
3130
|
-
e[
|
|
3130
|
+
e[37].geometry
|
|
3131
3131
|
),
|
|
3132
3132
|
style: (
|
|
3133
3133
|
/*style*/
|
|
@@ -3144,10 +3144,10 @@ function fi(e) {
|
|
|
3144
3144
|
p(o, i) {
|
|
3145
3145
|
const s = {};
|
|
3146
3146
|
i[0] & /*$store*/
|
|
3147
|
-
|
|
3148
|
-
o[
|
|
3149
|
-
|
|
3150
|
-
o[
|
|
3147
|
+
16384 && (s.annotation = /*annotation*/
|
|
3148
|
+
o[34]), i[0] & /*$store*/
|
|
3149
|
+
16384 && (s.geom = /*selector*/
|
|
3150
|
+
o[37].geometry), i[0] & /*style*/
|
|
3151
3151
|
2 && (s.style = /*style*/
|
|
3152
3152
|
o[1]), t.$set(s);
|
|
3153
3153
|
},
|
|
@@ -3168,11 +3168,11 @@ function ui(e) {
|
|
|
3168
3168
|
props: {
|
|
3169
3169
|
annotation: (
|
|
3170
3170
|
/*annotation*/
|
|
3171
|
-
e[
|
|
3171
|
+
e[34]
|
|
3172
3172
|
),
|
|
3173
3173
|
geom: (
|
|
3174
3174
|
/*selector*/
|
|
3175
|
-
e[
|
|
3175
|
+
e[37].geometry
|
|
3176
3176
|
),
|
|
3177
3177
|
style: (
|
|
3178
3178
|
/*style*/
|
|
@@ -3189,10 +3189,10 @@ function ui(e) {
|
|
|
3189
3189
|
p(o, i) {
|
|
3190
3190
|
const s = {};
|
|
3191
3191
|
i[0] & /*$store*/
|
|
3192
|
-
|
|
3193
|
-
o[
|
|
3194
|
-
|
|
3195
|
-
o[
|
|
3192
|
+
16384 && (s.annotation = /*annotation*/
|
|
3193
|
+
o[34]), i[0] & /*$store*/
|
|
3194
|
+
16384 && (s.geom = /*selector*/
|
|
3195
|
+
o[37].geometry), i[0] & /*style*/
|
|
3196
3196
|
2 && (s.style = /*style*/
|
|
3197
3197
|
o[1]), t.$set(s);
|
|
3198
3198
|
},
|
|
@@ -3213,27 +3213,27 @@ function Bt(e) {
|
|
|
3213
3213
|
function l(a, c) {
|
|
3214
3214
|
return (
|
|
3215
3215
|
/*selector*/
|
|
3216
|
-
a[
|
|
3216
|
+
a[37].type === F.ELLIPSE ? 0 : (
|
|
3217
3217
|
/*selector*/
|
|
3218
|
-
a[
|
|
3218
|
+
a[37].type === F.RECTANGLE ? 1 : (
|
|
3219
3219
|
/*selector*/
|
|
3220
|
-
a[
|
|
3220
|
+
a[37].type === F.POLYGON ? 2 : -1
|
|
3221
3221
|
)
|
|
3222
3222
|
)
|
|
3223
3223
|
);
|
|
3224
3224
|
}
|
|
3225
3225
|
return ~(t = l(e)) && (n = r[t] = s[t](e)), {
|
|
3226
3226
|
c() {
|
|
3227
|
-
n && n.c(), o =
|
|
3227
|
+
n && n.c(), o = ae();
|
|
3228
3228
|
},
|
|
3229
3229
|
m(a, c) {
|
|
3230
|
-
~t && r[t].m(a, c),
|
|
3230
|
+
~t && r[t].m(a, c), B(a, o, c), i = !0;
|
|
3231
3231
|
},
|
|
3232
3232
|
p(a, c) {
|
|
3233
3233
|
let u = t;
|
|
3234
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (
|
|
3234
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (se(), D(r[u], 1, 1, () => {
|
|
3235
3235
|
r[u] = null;
|
|
3236
|
-
}),
|
|
3236
|
+
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), P(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3237
3237
|
},
|
|
3238
3238
|
i(a) {
|
|
3239
3239
|
i || (P(n), i = !0);
|
|
@@ -3242,33 +3242,33 @@ function Bt(e) {
|
|
|
3242
3242
|
D(n), i = !1;
|
|
3243
3243
|
},
|
|
3244
3244
|
d(a) {
|
|
3245
|
-
a &&
|
|
3245
|
+
a && k(o), ~t && r[t].d(a);
|
|
3246
3246
|
}
|
|
3247
3247
|
};
|
|
3248
3248
|
}
|
|
3249
3249
|
function It(e) {
|
|
3250
3250
|
let t = !/*isEditable*/
|
|
3251
|
-
e[
|
|
3251
|
+
e[8](
|
|
3252
3252
|
/*annotation*/
|
|
3253
|
-
e[
|
|
3253
|
+
e[34]
|
|
3254
3254
|
), n, o, i = t && Ot($e(e));
|
|
3255
3255
|
return {
|
|
3256
3256
|
c() {
|
|
3257
|
-
i && i.c(), n =
|
|
3257
|
+
i && i.c(), n = ae();
|
|
3258
3258
|
},
|
|
3259
3259
|
m(s, r) {
|
|
3260
|
-
i && i.m(s, r),
|
|
3260
|
+
i && i.m(s, r), B(s, n, r), o = !0;
|
|
3261
3261
|
},
|
|
3262
3262
|
p(s, r) {
|
|
3263
3263
|
r[0] & /*isEditable, $store*/
|
|
3264
|
-
|
|
3265
|
-
s[
|
|
3264
|
+
16640 && (t = !/*isEditable*/
|
|
3265
|
+
s[8](
|
|
3266
3266
|
/*annotation*/
|
|
3267
|
-
s[
|
|
3267
|
+
s[34]
|
|
3268
3268
|
)), t ? i ? (i.p($e(s), r), r[0] & /*isEditable, $store*/
|
|
3269
|
-
|
|
3269
|
+
16640 && P(i, 1)) : (i = Ot($e(s)), i.c(), P(i, 1), i.m(n.parentNode, n)) : i && (se(), D(i, 1, 1, () => {
|
|
3270
3270
|
i = null;
|
|
3271
|
-
}),
|
|
3271
|
+
}), re());
|
|
3272
3272
|
},
|
|
3273
3273
|
i(s) {
|
|
3274
3274
|
o || (P(i), o = !0);
|
|
@@ -3277,7 +3277,7 @@ function It(e) {
|
|
|
3277
3277
|
D(i), o = !1;
|
|
3278
3278
|
},
|
|
3279
3279
|
d(s) {
|
|
3280
|
-
s &&
|
|
3280
|
+
s && k(n), i && i.d(s);
|
|
3281
3281
|
}
|
|
3282
3282
|
};
|
|
3283
3283
|
}
|
|
@@ -3287,25 +3287,25 @@ function Pt(e) {
|
|
|
3287
3287
|
function l(a, c) {
|
|
3288
3288
|
return (
|
|
3289
3289
|
/*editableAnnotations*/
|
|
3290
|
-
a[
|
|
3290
|
+
a[7] ? 0 : (
|
|
3291
3291
|
/*tool*/
|
|
3292
|
-
a[
|
|
3292
|
+
a[13] && /*drawingEnabled*/
|
|
3293
3293
|
a[0] ? 1 : -1
|
|
3294
3294
|
)
|
|
3295
3295
|
);
|
|
3296
3296
|
}
|
|
3297
3297
|
return ~(t = l(e)) && (n = r[t] = s[t](e)), {
|
|
3298
3298
|
c() {
|
|
3299
|
-
n && n.c(), o =
|
|
3299
|
+
n && n.c(), o = ae();
|
|
3300
3300
|
},
|
|
3301
3301
|
m(a, c) {
|
|
3302
|
-
~t && r[t].m(a, c),
|
|
3302
|
+
~t && r[t].m(a, c), B(a, o, c), i = !0;
|
|
3303
3303
|
},
|
|
3304
3304
|
p(a, c) {
|
|
3305
3305
|
let u = t;
|
|
3306
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (
|
|
3306
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (se(), D(r[u], 1, 1, () => {
|
|
3307
3307
|
r[u] = null;
|
|
3308
|
-
}),
|
|
3308
|
+
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), P(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3309
3309
|
},
|
|
3310
3310
|
i(a) {
|
|
3311
3311
|
i || (P(n), i = !0);
|
|
@@ -3314,7 +3314,7 @@ function Pt(e) {
|
|
|
3314
3314
|
D(n), i = !1;
|
|
3315
3315
|
},
|
|
3316
3316
|
d(a) {
|
|
3317
|
-
a &&
|
|
3317
|
+
a && k(o), ~t && r[t].d(a);
|
|
3318
3318
|
}
|
|
3319
3319
|
};
|
|
3320
3320
|
}
|
|
@@ -3325,15 +3325,15 @@ function di(e) {
|
|
|
3325
3325
|
), n, o, i = Yt(e);
|
|
3326
3326
|
return {
|
|
3327
3327
|
c() {
|
|
3328
|
-
i.c(), n =
|
|
3328
|
+
i.c(), n = ae();
|
|
3329
3329
|
},
|
|
3330
3330
|
m(s, r) {
|
|
3331
|
-
i.m(s, r),
|
|
3331
|
+
i.m(s, r), B(s, n, r), o = !0;
|
|
3332
3332
|
},
|
|
3333
3333
|
p(s, r) {
|
|
3334
3334
|
r[0] & /*toolName*/
|
|
3335
|
-
4 &&
|
|
3336
|
-
s[2]) ? (
|
|
3335
|
+
4 && K(t, t = /*toolName*/
|
|
3336
|
+
s[2]) ? (se(), D(i, 1, 1, G), re(), i = Yt(s), i.c(), P(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3337
3337
|
},
|
|
3338
3338
|
i(s) {
|
|
3339
3339
|
o || (P(i), o = !0);
|
|
@@ -3342,14 +3342,14 @@ function di(e) {
|
|
|
3342
3342
|
D(i), o = !1;
|
|
3343
3343
|
},
|
|
3344
3344
|
d(s) {
|
|
3345
|
-
s &&
|
|
3345
|
+
s && k(n), i.d(s);
|
|
3346
3346
|
}
|
|
3347
3347
|
};
|
|
3348
3348
|
}
|
|
3349
3349
|
function hi(e) {
|
|
3350
3350
|
let t, n, o = Se(
|
|
3351
3351
|
/*editableAnnotations*/
|
|
3352
|
-
e[
|
|
3352
|
+
e[7]
|
|
3353
3353
|
), i = [];
|
|
3354
3354
|
for (let r = 0; r < o.length; r += 1)
|
|
3355
3355
|
i[r] = Dt(Lt(e, o, r));
|
|
@@ -3360,28 +3360,28 @@ function hi(e) {
|
|
|
3360
3360
|
c() {
|
|
3361
3361
|
for (let r = 0; r < i.length; r += 1)
|
|
3362
3362
|
i[r].c();
|
|
3363
|
-
t =
|
|
3363
|
+
t = ae();
|
|
3364
3364
|
},
|
|
3365
3365
|
m(r, l) {
|
|
3366
3366
|
for (let a = 0; a < i.length; a += 1)
|
|
3367
3367
|
i[a] && i[a].m(r, l);
|
|
3368
|
-
|
|
3368
|
+
B(r, t, l), n = !0;
|
|
3369
3369
|
},
|
|
3370
3370
|
p(r, l) {
|
|
3371
3371
|
if (l[0] & /*editableAnnotations, drawingEl, getEditor, style, transform, $scale, onChangeSelected*/
|
|
3372
|
-
|
|
3372
|
+
1607842) {
|
|
3373
3373
|
o = Se(
|
|
3374
3374
|
/*editableAnnotations*/
|
|
3375
|
-
r[
|
|
3375
|
+
r[7]
|
|
3376
3376
|
);
|
|
3377
3377
|
let a;
|
|
3378
3378
|
for (a = 0; a < o.length; a += 1) {
|
|
3379
3379
|
const c = Lt(r, o, a);
|
|
3380
3380
|
i[a] ? (i[a].p(c, l), P(i[a], 1)) : (i[a] = Dt(c), i[a].c(), P(i[a], 1), i[a].m(t.parentNode, t));
|
|
3381
3381
|
}
|
|
3382
|
-
for (
|
|
3382
|
+
for (se(), a = o.length; a < i.length; a += 1)
|
|
3383
3383
|
s(a);
|
|
3384
|
-
|
|
3384
|
+
re();
|
|
3385
3385
|
}
|
|
3386
3386
|
},
|
|
3387
3387
|
i(r) {
|
|
@@ -3398,7 +3398,7 @@ function hi(e) {
|
|
|
3398
3398
|
n = !1;
|
|
3399
3399
|
},
|
|
3400
3400
|
d(r) {
|
|
3401
|
-
r &&
|
|
3401
|
+
r && k(t), rt(i, r);
|
|
3402
3402
|
}
|
|
3403
3403
|
};
|
|
3404
3404
|
}
|
|
@@ -3408,29 +3408,29 @@ function Yt(e) {
|
|
|
3408
3408
|
props: {
|
|
3409
3409
|
target: (
|
|
3410
3410
|
/*drawingEl*/
|
|
3411
|
-
e[
|
|
3411
|
+
e[5]
|
|
3412
3412
|
),
|
|
3413
3413
|
tool: (
|
|
3414
3414
|
/*tool*/
|
|
3415
|
-
e[
|
|
3415
|
+
e[13]
|
|
3416
3416
|
),
|
|
3417
3417
|
drawingMode: (
|
|
3418
3418
|
/*drawingMode*/
|
|
3419
|
-
e[
|
|
3419
|
+
e[12]
|
|
3420
3420
|
),
|
|
3421
3421
|
transform: (
|
|
3422
3422
|
/*transform*/
|
|
3423
|
-
e[
|
|
3423
|
+
e[11]
|
|
3424
3424
|
),
|
|
3425
3425
|
viewportScale: (
|
|
3426
3426
|
/*$scale*/
|
|
3427
|
-
e[
|
|
3427
|
+
e[15]
|
|
3428
3428
|
)
|
|
3429
3429
|
}
|
|
3430
3430
|
}), t.$on(
|
|
3431
3431
|
"create",
|
|
3432
3432
|
/*onSelectionCreated*/
|
|
3433
|
-
e[
|
|
3433
|
+
e[18]
|
|
3434
3434
|
), {
|
|
3435
3435
|
c() {
|
|
3436
3436
|
$(t.$$.fragment);
|
|
@@ -3441,16 +3441,16 @@ function Yt(e) {
|
|
|
3441
3441
|
p(o, i) {
|
|
3442
3442
|
const s = {};
|
|
3443
3443
|
i[0] & /*drawingEl*/
|
|
3444
|
-
|
|
3445
|
-
o[
|
|
3446
|
-
|
|
3447
|
-
o[
|
|
3448
|
-
|
|
3449
|
-
o[
|
|
3450
|
-
|
|
3451
|
-
o[
|
|
3452
|
-
|
|
3453
|
-
o[
|
|
3444
|
+
32 && (s.target = /*drawingEl*/
|
|
3445
|
+
o[5]), i[0] & /*tool*/
|
|
3446
|
+
8192 && (s.tool = /*tool*/
|
|
3447
|
+
o[13]), i[0] & /*drawingMode*/
|
|
3448
|
+
4096 && (s.drawingMode = /*drawingMode*/
|
|
3449
|
+
o[12]), i[0] & /*transform*/
|
|
3450
|
+
2048 && (s.transform = /*transform*/
|
|
3451
|
+
o[11]), i[0] & /*$scale*/
|
|
3452
|
+
32768 && (s.viewportScale = /*$scale*/
|
|
3453
|
+
o[15]), t.$set(s);
|
|
3454
3454
|
},
|
|
3455
3455
|
i(o) {
|
|
3456
3456
|
n || (P(t.$$.fragment, o), n = !0);
|
|
@@ -3469,18 +3469,18 @@ function Ct(e) {
|
|
|
3469
3469
|
props: {
|
|
3470
3470
|
target: (
|
|
3471
3471
|
/*drawingEl*/
|
|
3472
|
-
e[
|
|
3472
|
+
e[5]
|
|
3473
3473
|
),
|
|
3474
3474
|
editor: (
|
|
3475
3475
|
/*getEditor*/
|
|
3476
|
-
e[
|
|
3476
|
+
e[20](
|
|
3477
3477
|
/*editable*/
|
|
3478
|
-
e[
|
|
3478
|
+
e[31].target.selector
|
|
3479
3479
|
)
|
|
3480
3480
|
),
|
|
3481
3481
|
annotation: (
|
|
3482
3482
|
/*editable*/
|
|
3483
|
-
e[
|
|
3483
|
+
e[31]
|
|
3484
3484
|
),
|
|
3485
3485
|
style: (
|
|
3486
3486
|
/*style*/
|
|
@@ -3488,23 +3488,23 @@ function Ct(e) {
|
|
|
3488
3488
|
),
|
|
3489
3489
|
transform: (
|
|
3490
3490
|
/*transform*/
|
|
3491
|
-
e[
|
|
3491
|
+
e[11]
|
|
3492
3492
|
),
|
|
3493
3493
|
viewportScale: (
|
|
3494
3494
|
/*$scale*/
|
|
3495
|
-
e[
|
|
3495
|
+
e[15]
|
|
3496
3496
|
)
|
|
3497
3497
|
}
|
|
3498
3498
|
}), t.$on("change", function() {
|
|
3499
|
-
|
|
3499
|
+
j(
|
|
3500
3500
|
/*onChangeSelected*/
|
|
3501
|
-
e[
|
|
3501
|
+
e[19](
|
|
3502
3502
|
/*editable*/
|
|
3503
|
-
e[
|
|
3503
|
+
e[31]
|
|
3504
3504
|
)
|
|
3505
|
-
) && e[
|
|
3505
|
+
) && e[19](
|
|
3506
3506
|
/*editable*/
|
|
3507
|
-
e[
|
|
3507
|
+
e[31]
|
|
3508
3508
|
).apply(this, arguments);
|
|
3509
3509
|
}), {
|
|
3510
3510
|
c() {
|
|
@@ -3517,21 +3517,21 @@ function Ct(e) {
|
|
|
3517
3517
|
e = o;
|
|
3518
3518
|
const s = {};
|
|
3519
3519
|
i[0] & /*drawingEl*/
|
|
3520
|
-
|
|
3521
|
-
e[
|
|
3522
|
-
|
|
3523
|
-
e[
|
|
3520
|
+
32 && (s.target = /*drawingEl*/
|
|
3521
|
+
e[5]), i[0] & /*editableAnnotations*/
|
|
3522
|
+
128 && (s.editor = /*getEditor*/
|
|
3523
|
+
e[20](
|
|
3524
3524
|
/*editable*/
|
|
3525
|
-
e[
|
|
3525
|
+
e[31].target.selector
|
|
3526
3526
|
)), i[0] & /*editableAnnotations*/
|
|
3527
|
-
|
|
3528
|
-
e[
|
|
3527
|
+
128 && (s.annotation = /*editable*/
|
|
3528
|
+
e[31]), i[0] & /*style*/
|
|
3529
3529
|
2 && (s.style = /*style*/
|
|
3530
3530
|
e[1]), i[0] & /*transform*/
|
|
3531
|
-
|
|
3532
|
-
e[
|
|
3533
|
-
|
|
3534
|
-
e[
|
|
3531
|
+
2048 && (s.transform = /*transform*/
|
|
3532
|
+
e[11]), i[0] & /*$scale*/
|
|
3533
|
+
32768 && (s.viewportScale = /*$scale*/
|
|
3534
|
+
e[15]), t.$set(s);
|
|
3535
3535
|
},
|
|
3536
3536
|
i(o) {
|
|
3537
3537
|
n || (P(t.$$.fragment, o), n = !0);
|
|
@@ -3547,19 +3547,19 @@ function Ct(e) {
|
|
|
3547
3547
|
function Dt(e) {
|
|
3548
3548
|
let t = (
|
|
3549
3549
|
/*editable*/
|
|
3550
|
-
e[
|
|
3550
|
+
e[31].id
|
|
3551
3551
|
), n, o, i = Ct(e);
|
|
3552
3552
|
return {
|
|
3553
3553
|
c() {
|
|
3554
|
-
i.c(), n =
|
|
3554
|
+
i.c(), n = ae();
|
|
3555
3555
|
},
|
|
3556
3556
|
m(s, r) {
|
|
3557
|
-
i.m(s, r),
|
|
3557
|
+
i.m(s, r), B(s, n, r), o = !0;
|
|
3558
3558
|
},
|
|
3559
3559
|
p(s, r) {
|
|
3560
3560
|
r[0] & /*editableAnnotations*/
|
|
3561
|
-
|
|
3562
|
-
s[
|
|
3561
|
+
128 && K(t, t = /*editable*/
|
|
3562
|
+
s[31].id) ? (se(), D(i, 1, 1, G), re(), i = Ct(s), i.c(), P(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3563
3563
|
},
|
|
3564
3564
|
i(s) {
|
|
3565
3565
|
o || (P(i), o = !0);
|
|
@@ -3568,14 +3568,14 @@ function Dt(e) {
|
|
|
3568
3568
|
D(i), o = !1;
|
|
3569
3569
|
},
|
|
3570
3570
|
d(s) {
|
|
3571
|
-
s &&
|
|
3571
|
+
s && k(n), i.d(s);
|
|
3572
3572
|
}
|
|
3573
3573
|
};
|
|
3574
3574
|
}
|
|
3575
3575
|
function gi(e) {
|
|
3576
3576
|
let t, n, o, i, s, r, l = Se(
|
|
3577
3577
|
/*$store*/
|
|
3578
|
-
e[
|
|
3578
|
+
e[14]
|
|
3579
3579
|
), a = [];
|
|
3580
3580
|
for (let f = 0; f < l.length; f += 1)
|
|
3581
3581
|
a[f] = It(kt(e, l, f));
|
|
@@ -3584,151 +3584,155 @@ function gi(e) {
|
|
|
3584
3584
|
});
|
|
3585
3585
|
let u = (
|
|
3586
3586
|
/*drawingEl*/
|
|
3587
|
-
e[
|
|
3587
|
+
e[5] && Pt(e)
|
|
3588
3588
|
);
|
|
3589
3589
|
return {
|
|
3590
3590
|
c() {
|
|
3591
|
-
t =
|
|
3591
|
+
t = X("svg"), n = X("g");
|
|
3592
3592
|
for (let f = 0; f < a.length; f += 1)
|
|
3593
3593
|
a[f].c();
|
|
3594
|
-
o =
|
|
3594
|
+
o = X("g"), u && u.c(), h(o, "class", "drawing"), h(t, "class", "a9s-annotationlayer"), Ee(
|
|
3595
3595
|
t,
|
|
3596
3596
|
"drawing",
|
|
3597
3597
|
/*tool*/
|
|
3598
|
-
e[
|
|
3599
|
-
)
|
|
3598
|
+
e[13]
|
|
3599
|
+
), Ee(t, "hidden", !/*visible*/
|
|
3600
|
+
e[3]);
|
|
3600
3601
|
},
|
|
3601
|
-
m(f,
|
|
3602
|
-
|
|
3602
|
+
m(f, d) {
|
|
3603
|
+
B(f, t, d), ie(t, n);
|
|
3603
3604
|
for (let g = 0; g < a.length; g += 1)
|
|
3604
3605
|
a[g] && a[g].m(n, null);
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3606
|
+
ie(t, o), u && u.m(o, null), e[27](o), e[28](t), i = !0, s || (r = [
|
|
3607
|
+
H(t, "pointerup", function() {
|
|
3608
|
+
j(
|
|
3608
3609
|
/*onPointerUp*/
|
|
3609
|
-
e[8]
|
|
3610
|
-
) && e[8].apply(this, arguments);
|
|
3611
|
-
}),
|
|
3612
|
-
F(t, "pointerdown", function() {
|
|
3613
|
-
q(
|
|
3614
|
-
/*onPointerDown*/
|
|
3615
3610
|
e[9]
|
|
3616
3611
|
) && e[9].apply(this, arguments);
|
|
3612
|
+
}),
|
|
3613
|
+
H(t, "pointerdown", function() {
|
|
3614
|
+
j(
|
|
3615
|
+
/*onPointerDown*/
|
|
3616
|
+
e[10]
|
|
3617
|
+
) && e[10].apply(this, arguments);
|
|
3617
3618
|
})
|
|
3618
3619
|
], s = !0);
|
|
3619
3620
|
},
|
|
3620
|
-
p(f,
|
|
3621
|
-
if (e = f,
|
|
3622
|
-
|
|
3621
|
+
p(f, d) {
|
|
3622
|
+
if (e = f, d[0] & /*$store, style, isEditable*/
|
|
3623
|
+
16642) {
|
|
3623
3624
|
l = Se(
|
|
3624
3625
|
/*$store*/
|
|
3625
|
-
e[
|
|
3626
|
+
e[14]
|
|
3626
3627
|
);
|
|
3627
3628
|
let g;
|
|
3628
3629
|
for (g = 0; g < l.length; g += 1) {
|
|
3629
3630
|
const m = kt(e, l, g);
|
|
3630
|
-
a[g] ? (a[g].p(m,
|
|
3631
|
+
a[g] ? (a[g].p(m, d), P(a[g], 1)) : (a[g] = It(m), a[g].c(), P(a[g], 1), a[g].m(n, null));
|
|
3631
3632
|
}
|
|
3632
|
-
for (
|
|
3633
|
+
for (se(), g = l.length; g < a.length; g += 1)
|
|
3633
3634
|
c(g);
|
|
3634
|
-
|
|
3635
|
+
re();
|
|
3635
3636
|
}
|
|
3636
3637
|
/*drawingEl*/
|
|
3637
|
-
e[
|
|
3638
|
-
|
|
3638
|
+
e[5] ? u ? (u.p(e, d), d[0] & /*drawingEl*/
|
|
3639
|
+
32 && P(u, 1)) : (u = Pt(e), u.c(), P(u, 1), u.m(o, null)) : u && (se(), D(u, 1, 1, () => {
|
|
3639
3640
|
u = null;
|
|
3640
|
-
}),
|
|
3641
|
-
|
|
3641
|
+
}), re()), (!i || d[0] & /*tool*/
|
|
3642
|
+
8192) && Ee(
|
|
3642
3643
|
t,
|
|
3643
3644
|
"drawing",
|
|
3644
3645
|
/*tool*/
|
|
3645
|
-
e[
|
|
3646
|
-
)
|
|
3646
|
+
e[13]
|
|
3647
|
+
), (!i || d[0] & /*visible*/
|
|
3648
|
+
8) && Ee(t, "hidden", !/*visible*/
|
|
3649
|
+
e[3]);
|
|
3647
3650
|
},
|
|
3648
3651
|
i(f) {
|
|
3649
3652
|
if (!i) {
|
|
3650
|
-
for (let
|
|
3651
|
-
P(a[
|
|
3653
|
+
for (let d = 0; d < l.length; d += 1)
|
|
3654
|
+
P(a[d]);
|
|
3652
3655
|
P(u), i = !0;
|
|
3653
3656
|
}
|
|
3654
3657
|
},
|
|
3655
3658
|
o(f) {
|
|
3656
3659
|
a = a.filter(en);
|
|
3657
|
-
for (let
|
|
3658
|
-
D(a[
|
|
3660
|
+
for (let d = 0; d < a.length; d += 1)
|
|
3661
|
+
D(a[d]);
|
|
3659
3662
|
D(u), i = !1;
|
|
3660
3663
|
},
|
|
3661
3664
|
d(f) {
|
|
3662
|
-
f &&
|
|
3665
|
+
f && k(t), rt(a, f), u && u.d(), e[27](null), e[28](null), s = !1, le(r);
|
|
3663
3666
|
}
|
|
3664
3667
|
};
|
|
3665
3668
|
}
|
|
3666
3669
|
function mi(e, t, n) {
|
|
3667
|
-
let o, i, s, r, l, a, c, u, f,
|
|
3670
|
+
let o, i, s, r, l, a, c, u, f, d, g = G, m = () => (g(), g = Vt(b, (L) => n(15, d = L)), b);
|
|
3668
3671
|
e.$$.on_destroy.push(() => g());
|
|
3669
|
-
let { drawingEnabled:
|
|
3670
|
-
|
|
3671
|
-
const { selection: T, store:
|
|
3672
|
-
ht(e, T, (
|
|
3673
|
-
let
|
|
3674
|
-
const
|
|
3675
|
-
|
|
3676
|
-
const
|
|
3677
|
-
|
|
3678
|
-
const { updated:
|
|
3679
|
-
n(
|
|
3680
|
-
},
|
|
3681
|
-
},
|
|
3682
|
-
const
|
|
3683
|
-
id:
|
|
3672
|
+
let { drawingEnabled: y } = t, { image: E } = t, { preferredDrawingMode: p } = t, { state: S } = t, { style: w = void 0 } = t, { toolName: A = xt()[0] } = t, { user: I } = t, { visible: N = !0 } = t, U, _, b;
|
|
3673
|
+
Ye(() => m(n(6, b = bo(E, _))));
|
|
3674
|
+
const { selection: T, store: M } = S;
|
|
3675
|
+
ht(e, T, (L) => n(26, u = L)), ht(e, M, (L) => n(14, f = L));
|
|
3676
|
+
let O, Y;
|
|
3677
|
+
const Z = (L) => {
|
|
3678
|
+
O && M.unobserve(O);
|
|
3679
|
+
const W = L.filter(({ editable: V }) => V).map(({ id: V }) => V);
|
|
3680
|
+
W.length > 0 ? (n(7, Y = W.map((V) => M.getAnnotation(V)).filter(Boolean)), O = (V) => {
|
|
3681
|
+
const { updated: ce } = V.changes;
|
|
3682
|
+
n(7, Y = ce == null ? void 0 : ce.map((J) => J.newValue));
|
|
3683
|
+
}, M.observe(O, { annotations: W })) : n(7, Y = void 0);
|
|
3684
|
+
}, he = (L) => {
|
|
3685
|
+
const W = qt(), V = {
|
|
3686
|
+
id: W,
|
|
3684
3687
|
bodies: [],
|
|
3685
3688
|
target: {
|
|
3686
|
-
annotation:
|
|
3687
|
-
selector:
|
|
3688
|
-
creator:
|
|
3689
|
+
annotation: W,
|
|
3690
|
+
selector: L.detail,
|
|
3691
|
+
creator: I,
|
|
3689
3692
|
created: /* @__PURE__ */ new Date()
|
|
3690
3693
|
}
|
|
3691
3694
|
};
|
|
3692
|
-
|
|
3693
|
-
}, ge = (
|
|
3694
|
-
var
|
|
3695
|
-
const { target:
|
|
3696
|
-
|
|
3697
|
-
...
|
|
3698
|
-
selector:
|
|
3699
|
-
created:
|
|
3700
|
-
updated:
|
|
3701
|
-
updatedBy:
|
|
3695
|
+
M.addAnnotation(V), T.setSelected(V.id);
|
|
3696
|
+
}, ge = (L) => (W) => {
|
|
3697
|
+
var R;
|
|
3698
|
+
const { target: V } = L, ce = 10 * 60 * 1e3, J = ((R = V.creator) == null ? void 0 : R.id) !== I.id || !V.created || (/* @__PURE__ */ new Date()).getTime() - V.created.getTime() > ce;
|
|
3699
|
+
M.updateTarget({
|
|
3700
|
+
...V,
|
|
3701
|
+
selector: W.detail,
|
|
3702
|
+
created: J ? V.created : /* @__PURE__ */ new Date(),
|
|
3703
|
+
updated: J ? /* @__PURE__ */ new Date() : void 0,
|
|
3704
|
+
updatedBy: J ? I : void 0
|
|
3702
3705
|
});
|
|
3703
|
-
},
|
|
3704
|
-
function
|
|
3705
|
-
He[
|
|
3706
|
-
U =
|
|
3706
|
+
}, Me = (L) => Bo(L);
|
|
3707
|
+
function oe(L) {
|
|
3708
|
+
He[L ? "unshift" : "push"](() => {
|
|
3709
|
+
U = L, n(5, U);
|
|
3707
3710
|
});
|
|
3708
3711
|
}
|
|
3709
|
-
function
|
|
3710
|
-
He[
|
|
3711
|
-
|
|
3712
|
+
function ve(L) {
|
|
3713
|
+
He[L ? "unshift" : "push"](() => {
|
|
3714
|
+
_ = L, n(4, _);
|
|
3712
3715
|
});
|
|
3713
3716
|
}
|
|
3714
|
-
return e.$$set = (
|
|
3715
|
-
"drawingEnabled" in
|
|
3717
|
+
return e.$$set = (L) => {
|
|
3718
|
+
"drawingEnabled" in L && n(0, y = L.drawingEnabled), "image" in L && n(21, E = L.image), "preferredDrawingMode" in L && n(22, p = L.preferredDrawingMode), "state" in L && n(23, S = L.state), "style" in L && n(1, w = L.style), "toolName" in L && n(2, A = L.toolName), "user" in L && n(24, I = L.user), "visible" in L && n(3, N = L.visible);
|
|
3716
3719
|
}, e.$$.update = () => {
|
|
3717
3720
|
e.$$.dirty[0] & /*toolName*/
|
|
3718
|
-
4 && n(
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3721
|
+
4 && n(13, { tool: o, opts: i } = $t(A) || { tool: void 0, opts: void 0 }, o, (n(25, i), n(2, A))), e.$$.dirty[0] & /*opts, preferredDrawingMode*/
|
|
3722
|
+
37748736 && n(12, s = (i == null ? void 0 : i.drawingMode) || p), e.$$.dirty[0] & /*svgEl*/
|
|
3723
|
+
16 && n(11, r = si(_)), e.$$.dirty[0] & /*svgEl*/
|
|
3724
|
+
16 && n(10, { onPointerDown: l, onPointerUp: a } = li(_, M), l, (n(9, a), n(4, _))), e.$$.dirty[0] & /*$selection*/
|
|
3725
|
+
67108864 && n(8, c = (L) => u.selected.find((W) => W.id === L.id && W.editable)), e.$$.dirty[0] & /*$selection*/
|
|
3726
|
+
67108864 && Z(u.selected);
|
|
3724
3727
|
}, [
|
|
3725
|
-
|
|
3728
|
+
y,
|
|
3726
3729
|
w,
|
|
3727
|
-
|
|
3728
|
-
|
|
3730
|
+
A,
|
|
3731
|
+
N,
|
|
3732
|
+
_,
|
|
3729
3733
|
U,
|
|
3730
|
-
|
|
3731
|
-
|
|
3734
|
+
b,
|
|
3735
|
+
Y,
|
|
3732
3736
|
c,
|
|
3733
3737
|
a,
|
|
3734
3738
|
l,
|
|
@@ -3736,20 +3740,20 @@ function mi(e, t, n) {
|
|
|
3736
3740
|
s,
|
|
3737
3741
|
o,
|
|
3738
3742
|
f,
|
|
3739
|
-
|
|
3743
|
+
d,
|
|
3740
3744
|
T,
|
|
3741
|
-
|
|
3742
|
-
|
|
3745
|
+
M,
|
|
3746
|
+
he,
|
|
3743
3747
|
ge,
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3748
|
+
Me,
|
|
3749
|
+
E,
|
|
3750
|
+
p,
|
|
3751
|
+
S,
|
|
3752
|
+
I,
|
|
3749
3753
|
i,
|
|
3750
3754
|
u,
|
|
3751
|
-
|
|
3752
|
-
|
|
3755
|
+
oe,
|
|
3756
|
+
ve
|
|
3753
3757
|
];
|
|
3754
3758
|
}
|
|
3755
3759
|
class pi extends te {
|
|
@@ -3759,15 +3763,16 @@ class pi extends te {
|
|
|
3759
3763
|
t,
|
|
3760
3764
|
mi,
|
|
3761
3765
|
gi,
|
|
3762
|
-
|
|
3766
|
+
K,
|
|
3763
3767
|
{
|
|
3764
3768
|
drawingEnabled: 0,
|
|
3765
|
-
image:
|
|
3766
|
-
preferredDrawingMode:
|
|
3767
|
-
state:
|
|
3769
|
+
image: 21,
|
|
3770
|
+
preferredDrawingMode: 22,
|
|
3771
|
+
state: 23,
|
|
3768
3772
|
style: 1,
|
|
3769
3773
|
toolName: 2,
|
|
3770
|
-
user:
|
|
3774
|
+
user: 24,
|
|
3775
|
+
visible: 3
|
|
3771
3776
|
},
|
|
3772
3777
|
null,
|
|
3773
3778
|
[-1, -1]
|
|
@@ -3783,17 +3788,17 @@ function tn(e, t, n, o, i) {
|
|
|
3783
3788
|
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));
|
|
3784
3789
|
tn(e, t, u, f, i);
|
|
3785
3790
|
}
|
|
3786
|
-
var
|
|
3787
|
-
for (
|
|
3788
|
-
for (
|
|
3791
|
+
var d = e[t], g = n, m = o;
|
|
3792
|
+
for (Le(e, n, t), i(e[o], d) > 0 && Le(e, n, o); g < m; ) {
|
|
3793
|
+
for (Le(e, g, m), g++, m--; i(e[g], d) < 0; )
|
|
3789
3794
|
g++;
|
|
3790
|
-
for (; i(e[m],
|
|
3795
|
+
for (; i(e[m], d) > 0; )
|
|
3791
3796
|
m--;
|
|
3792
3797
|
}
|
|
3793
|
-
i(e[n],
|
|
3798
|
+
i(e[n], d) === 0 ? Le(e, n, m) : (m++, Le(e, m, o)), m <= t && (n = m + 1), t <= m && (o = m - 1);
|
|
3794
3799
|
}
|
|
3795
3800
|
}
|
|
3796
|
-
function
|
|
3801
|
+
function Le(e, t, n) {
|
|
3797
3802
|
var o = e[t];
|
|
3798
3803
|
e[t] = e[n], e[n] = o;
|
|
3799
3804
|
}
|
|
@@ -3810,13 +3815,13 @@ class wi {
|
|
|
3810
3815
|
search(t) {
|
|
3811
3816
|
let n = this.data;
|
|
3812
3817
|
const o = [];
|
|
3813
|
-
if (!
|
|
3818
|
+
if (!Ve(t, n))
|
|
3814
3819
|
return o;
|
|
3815
3820
|
const i = this.toBBox, s = [];
|
|
3816
3821
|
for (; n; ) {
|
|
3817
3822
|
for (let r = 0; r < n.children.length; r++) {
|
|
3818
3823
|
const l = n.children[r], a = n.leaf ? i(l) : l;
|
|
3819
|
-
|
|
3824
|
+
Ve(t, a) && (n.leaf ? o.push(l) : tt(t, a) ? this._all(l, o) : s.push(l));
|
|
3820
3825
|
}
|
|
3821
3826
|
n = s.pop();
|
|
3822
3827
|
}
|
|
@@ -3824,13 +3829,13 @@ class wi {
|
|
|
3824
3829
|
}
|
|
3825
3830
|
collides(t) {
|
|
3826
3831
|
let n = this.data;
|
|
3827
|
-
if (!
|
|
3832
|
+
if (!Ve(t, n))
|
|
3828
3833
|
return !1;
|
|
3829
3834
|
const o = [];
|
|
3830
3835
|
for (; n; ) {
|
|
3831
3836
|
for (let i = 0; i < n.children.length; i++) {
|
|
3832
3837
|
const s = n.children[i], r = n.leaf ? this.toBBox(s) : s;
|
|
3833
|
-
if (
|
|
3838
|
+
if (Ve(t, r)) {
|
|
3834
3839
|
if (n.leaf || tt(t, r))
|
|
3835
3840
|
return !0;
|
|
3836
3841
|
o.push(s);
|
|
@@ -3866,7 +3871,7 @@ class wi {
|
|
|
3866
3871
|
return t && this._insert(t, this.data.height - 1), this;
|
|
3867
3872
|
}
|
|
3868
3873
|
clear() {
|
|
3869
|
-
return this.data =
|
|
3874
|
+
return this.data = be([]), this;
|
|
3870
3875
|
}
|
|
3871
3876
|
remove(t, n) {
|
|
3872
3877
|
if (!t)
|
|
@@ -3909,19 +3914,19 @@ class wi {
|
|
|
3909
3914
|
const s = o - n + 1;
|
|
3910
3915
|
let r = this._maxEntries, l;
|
|
3911
3916
|
if (s <= r)
|
|
3912
|
-
return l =
|
|
3913
|
-
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l =
|
|
3917
|
+
return l = be(t.slice(n, o + 1)), _e(l, this.toBBox), l;
|
|
3918
|
+
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;
|
|
3914
3919
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
3915
3920
|
Xt(t, n, o, c, this.compareMinX);
|
|
3916
3921
|
for (let u = n; u <= o; u += c) {
|
|
3917
3922
|
const f = Math.min(u + c - 1, o);
|
|
3918
3923
|
Xt(t, u, f, a, this.compareMinY);
|
|
3919
|
-
for (let
|
|
3920
|
-
const g = Math.min(
|
|
3921
|
-
l.children.push(this._build(t,
|
|
3924
|
+
for (let d = u; d <= f; d += a) {
|
|
3925
|
+
const g = Math.min(d + a - 1, f);
|
|
3926
|
+
l.children.push(this._build(t, d, g, i - 1));
|
|
3922
3927
|
}
|
|
3923
3928
|
}
|
|
3924
|
-
return
|
|
3929
|
+
return _e(l, this.toBBox), l;
|
|
3925
3930
|
}
|
|
3926
3931
|
_chooseSubtree(t, n, o, i) {
|
|
3927
3932
|
for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {
|
|
@@ -3936,7 +3941,7 @@ class wi {
|
|
|
3936
3941
|
}
|
|
3937
3942
|
_insert(t, n, o) {
|
|
3938
3943
|
const i = o ? t : this.toBBox(t), s = [], r = this._chooseSubtree(i, this.data, n, s);
|
|
3939
|
-
for (r.children.push(t),
|
|
3944
|
+
for (r.children.push(t), Be(r, i); n >= 0 && s[n].children.length > this._maxEntries; )
|
|
3940
3945
|
this._split(s, n), n--;
|
|
3941
3946
|
this._adjustParentBBoxes(i, s, n);
|
|
3942
3947
|
}
|
|
@@ -3944,16 +3949,16 @@ class wi {
|
|
|
3944
3949
|
_split(t, n) {
|
|
3945
3950
|
const o = t[n], i = o.children.length, s = this._minEntries;
|
|
3946
3951
|
this._chooseSplitAxis(o, s, i);
|
|
3947
|
-
const r = this._chooseSplitIndex(o, s, i), l =
|
|
3948
|
-
l.height = o.height, l.leaf = o.leaf,
|
|
3952
|
+
const r = this._chooseSplitIndex(o, s, i), l = be(o.children.splice(r, o.children.length - r));
|
|
3953
|
+
l.height = o.height, l.leaf = o.leaf, _e(o, this.toBBox), _e(l, this.toBBox), n ? t[n - 1].children.push(l) : this._splitRoot(o, l);
|
|
3949
3954
|
}
|
|
3950
3955
|
_splitRoot(t, n) {
|
|
3951
|
-
this.data =
|
|
3956
|
+
this.data = be([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, _e(this.data, this.toBBox);
|
|
3952
3957
|
}
|
|
3953
3958
|
_chooseSplitIndex(t, n, o) {
|
|
3954
3959
|
let i, s = 1 / 0, r = 1 / 0;
|
|
3955
3960
|
for (let l = n; l <= o - n; l++) {
|
|
3956
|
-
const a =
|
|
3961
|
+
const a = Oe(t, 0, l, this.toBBox), c = Oe(t, l, o, this.toBBox), u = Ti(a, c), f = et(a) + et(c);
|
|
3957
3962
|
u < s ? (s = u, i = l, r = f < r ? f : r) : u === s && f < r && (r = f, i = l);
|
|
3958
3963
|
}
|
|
3959
3964
|
return i || o - n;
|
|
@@ -3966,25 +3971,25 @@ class wi {
|
|
|
3966
3971
|
// total margin of all possible split distributions where each node is at least m full
|
|
3967
3972
|
_allDistMargin(t, n, o, i) {
|
|
3968
3973
|
t.children.sort(i);
|
|
3969
|
-
const s = this.toBBox, r =
|
|
3970
|
-
let a =
|
|
3974
|
+
const s = this.toBBox, r = Oe(t, 0, n, s), l = Oe(t, o - n, o, s);
|
|
3975
|
+
let a = Ne(r) + Ne(l);
|
|
3971
3976
|
for (let c = n; c < o - n; c++) {
|
|
3972
3977
|
const u = t.children[c];
|
|
3973
|
-
|
|
3978
|
+
Be(r, t.leaf ? s(u) : u), a += Ne(r);
|
|
3974
3979
|
}
|
|
3975
3980
|
for (let c = o - n - 1; c >= n; c--) {
|
|
3976
3981
|
const u = t.children[c];
|
|
3977
|
-
|
|
3982
|
+
Be(l, t.leaf ? s(u) : u), a += Ne(l);
|
|
3978
3983
|
}
|
|
3979
3984
|
return a;
|
|
3980
3985
|
}
|
|
3981
3986
|
_adjustParentBBoxes(t, n, o) {
|
|
3982
3987
|
for (let i = o; i >= 0; i--)
|
|
3983
|
-
|
|
3988
|
+
Be(n[i], t);
|
|
3984
3989
|
}
|
|
3985
3990
|
_condense(t) {
|
|
3986
3991
|
for (let n = t.length - 1, o; n >= 0; n--)
|
|
3987
|
-
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() :
|
|
3992
|
+
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);
|
|
3988
3993
|
}
|
|
3989
3994
|
}
|
|
3990
3995
|
function bi(e, t, n) {
|
|
@@ -3995,18 +4000,18 @@ function bi(e, t, n) {
|
|
|
3995
4000
|
return o;
|
|
3996
4001
|
return -1;
|
|
3997
4002
|
}
|
|
3998
|
-
function
|
|
3999
|
-
|
|
4003
|
+
function _e(e, t) {
|
|
4004
|
+
Oe(e, 0, e.children.length, t, e);
|
|
4000
4005
|
}
|
|
4001
|
-
function
|
|
4002
|
-
i || (i =
|
|
4006
|
+
function Oe(e, t, n, o, i) {
|
|
4007
|
+
i || (i = be(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
4003
4008
|
for (let s = t; s < n; s++) {
|
|
4004
4009
|
const r = e.children[s];
|
|
4005
|
-
|
|
4010
|
+
Be(i, e.leaf ? o(r) : r);
|
|
4006
4011
|
}
|
|
4007
4012
|
return i;
|
|
4008
4013
|
}
|
|
4009
|
-
function
|
|
4014
|
+
function Be(e, t) {
|
|
4010
4015
|
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;
|
|
4011
4016
|
}
|
|
4012
4017
|
function Ei(e, t) {
|
|
@@ -4018,7 +4023,7 @@ function Ai(e, t) {
|
|
|
4018
4023
|
function et(e) {
|
|
4019
4024
|
return (e.maxX - e.minX) * (e.maxY - e.minY);
|
|
4020
4025
|
}
|
|
4021
|
-
function
|
|
4026
|
+
function Ne(e) {
|
|
4022
4027
|
return e.maxX - e.minX + (e.maxY - e.minY);
|
|
4023
4028
|
}
|
|
4024
4029
|
function Si(e, t) {
|
|
@@ -4031,10 +4036,10 @@ function Ti(e, t) {
|
|
|
4031
4036
|
function tt(e, t) {
|
|
4032
4037
|
return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
|
|
4033
4038
|
}
|
|
4034
|
-
function
|
|
4039
|
+
function Ve(e, t) {
|
|
4035
4040
|
return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
|
|
4036
4041
|
}
|
|
4037
|
-
function
|
|
4042
|
+
function be(e) {
|
|
4038
4043
|
return {
|
|
4039
4044
|
children: e,
|
|
4040
4045
|
height: 1,
|
|
@@ -4058,44 +4063,44 @@ const Mi = () => {
|
|
|
4058
4063
|
const e = new wi(), t = /* @__PURE__ */ new Map(), n = () => [...t.values()], o = () => {
|
|
4059
4064
|
e.clear(), t.clear();
|
|
4060
4065
|
}, i = (f) => {
|
|
4061
|
-
const { minX:
|
|
4062
|
-
e.insert(
|
|
4066
|
+
const { minX: d, minY: g, maxX: m, maxY: y } = f.selector.geometry.bounds, E = { minX: d, minY: g, maxX: m, maxY: y, target: f };
|
|
4067
|
+
e.insert(E), t.set(f.annotation, E);
|
|
4063
4068
|
}, s = (f) => {
|
|
4064
|
-
const
|
|
4065
|
-
|
|
4069
|
+
const d = t.get(f.annotation);
|
|
4070
|
+
d && e.remove(d), t.delete(f.annotation);
|
|
4066
4071
|
};
|
|
4067
4072
|
return {
|
|
4068
4073
|
all: n,
|
|
4069
4074
|
clear: o,
|
|
4070
|
-
getAt: (f,
|
|
4075
|
+
getAt: (f, d) => {
|
|
4071
4076
|
const m = e.search({
|
|
4072
4077
|
minX: f,
|
|
4073
|
-
minY:
|
|
4078
|
+
minY: d,
|
|
4074
4079
|
maxX: f,
|
|
4075
|
-
maxY:
|
|
4076
|
-
}).map((
|
|
4080
|
+
maxY: d
|
|
4081
|
+
}).map((y) => y.target).filter((y) => y.selector.type === F.RECTANGLE || wn(y.selector, f, d));
|
|
4077
4082
|
if (m.length > 0)
|
|
4078
|
-
return m.sort((
|
|
4083
|
+
return m.sort((y, E) => st(y.selector) - st(E.selector)), m[0];
|
|
4079
4084
|
},
|
|
4080
|
-
getIntersecting: (f,
|
|
4085
|
+
getIntersecting: (f, d, g, m) => e.search({
|
|
4081
4086
|
minX: f,
|
|
4082
|
-
minY:
|
|
4087
|
+
minY: d,
|
|
4083
4088
|
maxX: f + g,
|
|
4084
|
-
maxY:
|
|
4085
|
-
}).map((
|
|
4089
|
+
maxY: d + m
|
|
4090
|
+
}).map((y) => y.target),
|
|
4086
4091
|
insert: i,
|
|
4087
4092
|
remove: s,
|
|
4088
|
-
set: (f,
|
|
4089
|
-
|
|
4093
|
+
set: (f, d = !0) => {
|
|
4094
|
+
d && o();
|
|
4090
4095
|
const g = f.map((m) => {
|
|
4091
|
-
const { minX:
|
|
4092
|
-
return { minX:
|
|
4096
|
+
const { minX: y, minY: E, maxX: p, maxY: S } = m.selector.geometry.bounds;
|
|
4097
|
+
return { minX: y, minY: E, maxX: p, maxY: S, target: m };
|
|
4093
4098
|
});
|
|
4094
4099
|
g.forEach((m) => t.set(m.target.annotation, m)), e.load(g);
|
|
4095
4100
|
},
|
|
4096
4101
|
size: () => e.all().length,
|
|
4097
|
-
update: (f,
|
|
4098
|
-
s(f), i(
|
|
4102
|
+
update: (f, d) => {
|
|
4103
|
+
s(f), i(d);
|
|
4099
4104
|
}
|
|
4100
4105
|
};
|
|
4101
4106
|
}, vi = (e) => {
|
|
@@ -4109,7 +4114,7 @@ const Mi = () => {
|
|
|
4109
4114
|
const u = n.getAt(a, c);
|
|
4110
4115
|
return u ? t.getAnnotation(u.annotation) : void 0;
|
|
4111
4116
|
},
|
|
4112
|
-
getIntersecting: (a, c, u, f) => n.getIntersecting(a, c, u, f).map((
|
|
4117
|
+
getIntersecting: (a, c, u, f) => n.getIntersecting(a, c, u, f).map((d) => t.getAnnotation(d.annotation))
|
|
4113
4118
|
},
|
|
4114
4119
|
selection: o,
|
|
4115
4120
|
hover: i,
|
|
@@ -4176,7 +4181,7 @@ const Mi = () => {
|
|
|
4176
4181
|
const u = Ii(l);
|
|
4177
4182
|
let f = lo();
|
|
4178
4183
|
Rt(n, c, o.theme);
|
|
4179
|
-
const
|
|
4184
|
+
const d = new pi({
|
|
4180
4185
|
target: c,
|
|
4181
4186
|
props: {
|
|
4182
4187
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4187,50 +4192,54 @@ const Mi = () => {
|
|
|
4187
4192
|
user: f
|
|
4188
4193
|
}
|
|
4189
4194
|
});
|
|
4190
|
-
|
|
4191
|
-
const { originalEvent: T, annotation:
|
|
4192
|
-
|
|
4195
|
+
d.$on("click", (b) => {
|
|
4196
|
+
const { originalEvent: T, annotation: M } = b.detail;
|
|
4197
|
+
M ? s.clickSelect(M.id, T) : s.isEmpty() || s.clear();
|
|
4193
4198
|
});
|
|
4194
4199
|
const g = to(i, l, o.adapter), m = () => {
|
|
4195
|
-
|
|
4196
|
-
},
|
|
4197
|
-
if (!$t(
|
|
4198
|
-
throw `No drawing tool named ${
|
|
4199
|
-
|
|
4200
|
-
}, w = (
|
|
4200
|
+
d.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4201
|
+
}, y = () => f, E = (b, T, M) => Ko(b, T, M), p = (b, T) => Io(b, T), S = (b) => {
|
|
4202
|
+
if (!$t(b))
|
|
4203
|
+
throw `No drawing tool named ${b}`;
|
|
4204
|
+
d.$set({ toolName: b });
|
|
4205
|
+
}, w = (b) => d.$set({ drawingEnabled: b }), A = (b) => {
|
|
4201
4206
|
console.warn("Filter not implemented yet");
|
|
4202
|
-
},
|
|
4203
|
-
f =
|
|
4204
|
-
}
|
|
4207
|
+
}, I = (b) => d.$set({ style: b }), N = (b) => Rt(n, c, b), U = (b) => {
|
|
4208
|
+
f = b, d.$set({ user: b });
|
|
4209
|
+
}, _ = (b) => (
|
|
4210
|
+
// @ts-ignore
|
|
4211
|
+
d.$set({ visible: b })
|
|
4212
|
+
);
|
|
4205
4213
|
return {
|
|
4206
4214
|
...g,
|
|
4207
4215
|
destroy: m,
|
|
4208
|
-
getUser:
|
|
4216
|
+
getUser: y,
|
|
4209
4217
|
listDrawingTools: xt,
|
|
4210
4218
|
on: a.on,
|
|
4211
4219
|
off: a.off,
|
|
4212
|
-
registerDrawingTool:
|
|
4213
|
-
registerShapeEditor:
|
|
4220
|
+
registerDrawingTool: E,
|
|
4221
|
+
registerShapeEditor: p,
|
|
4214
4222
|
setDrawingEnabled: w,
|
|
4215
|
-
setDrawingTool:
|
|
4216
|
-
setFilter:
|
|
4217
|
-
setStyle:
|
|
4218
|
-
setTheme:
|
|
4219
|
-
setUser:
|
|
4223
|
+
setDrawingTool: S,
|
|
4224
|
+
setFilter: A,
|
|
4225
|
+
setStyle: I,
|
|
4226
|
+
setTheme: N,
|
|
4227
|
+
setUser: U,
|
|
4228
|
+
setVisible: _,
|
|
4220
4229
|
state: i
|
|
4221
4230
|
};
|
|
4222
4231
|
};
|
|
4223
4232
|
export {
|
|
4224
4233
|
Qt as Editor,
|
|
4225
4234
|
Xo as EditorMount,
|
|
4226
|
-
|
|
4235
|
+
ke as Handle,
|
|
4227
4236
|
Ci as IdentityTransform,
|
|
4228
4237
|
yo as PolygonEditor,
|
|
4229
4238
|
Oo as RectangleEditor,
|
|
4230
4239
|
An as RectangleUtil,
|
|
4231
4240
|
Go as RubberbandRectangle,
|
|
4232
4241
|
pi as SVGAnnotationLayer,
|
|
4233
|
-
|
|
4242
|
+
F as ShapeType,
|
|
4234
4243
|
Uo as ToolMount,
|
|
4235
4244
|
Yi as W3CImageFormat,
|
|
4236
4245
|
li as addEventListeners,
|