@annotorious/annotorious 3.0.11 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotorious.es.js +1155 -1151
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +7 -7
package/dist/annotorious.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var hn = Object.defineProperty;
|
|
2
|
+
var gn = (e, t, n) => t in e ? hn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var Ze = (e, t, n) => gn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
function j() {
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function ft(e, t) {
|
|
7
7
|
for (const n in t) e[n] = t[n];
|
|
8
8
|
return (
|
|
9
9
|
/** @type {T & S} */
|
|
10
10
|
e
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Kt(e) {
|
|
14
14
|
return e();
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function wt() {
|
|
17
17
|
return /* @__PURE__ */ Object.create(null);
|
|
18
18
|
}
|
|
19
19
|
function ge(e) {
|
|
20
|
-
e.forEach(
|
|
20
|
+
e.forEach(Kt);
|
|
21
21
|
}
|
|
22
22
|
function W(e) {
|
|
23
23
|
return typeof e == "function";
|
|
@@ -25,10 +25,10 @@ function W(e) {
|
|
|
25
25
|
function Q(e, t) {
|
|
26
26
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function mn(e) {
|
|
29
29
|
return Object.keys(e).length === 0;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Jt(e, ...t) {
|
|
32
32
|
if (e == null) {
|
|
33
33
|
for (const o of t)
|
|
34
34
|
o(void 0);
|
|
@@ -37,19 +37,19 @@ function Zt(e, ...t) {
|
|
|
37
37
|
const n = e.subscribe(...t);
|
|
38
38
|
return n.unsubscribe ? () => n.unsubscribe() : n;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
e.$$.on_destroy.push(
|
|
40
|
+
function xe(e, t, n) {
|
|
41
|
+
e.$$.on_destroy.push(Jt(t, n));
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function pn(e, t, n, o) {
|
|
44
44
|
if (e) {
|
|
45
|
-
const i =
|
|
45
|
+
const i = Qt(e, t, n, o);
|
|
46
46
|
return e[0](i);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return e[1] && o ?
|
|
49
|
+
function Qt(e, t, n, o) {
|
|
50
|
+
return e[1] && o ? ft(n.ctx.slice(), e[1](o(t))) : n.ctx;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function yn(e, t, n, o) {
|
|
53
53
|
if (e[2] && o) {
|
|
54
54
|
const i = e[2](o(n));
|
|
55
55
|
if (t.dirty === void 0)
|
|
@@ -64,13 +64,13 @@ function wn(e, t, n, o) {
|
|
|
64
64
|
}
|
|
65
65
|
return t.dirty;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function _n(e, t, n, o, i, s) {
|
|
68
68
|
if (i) {
|
|
69
|
-
const r =
|
|
69
|
+
const r = Qt(t, n, o, s);
|
|
70
70
|
e.p(r, i);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function wn(e) {
|
|
74
74
|
if (e.ctx.length > 32) {
|
|
75
75
|
const t = [], n = e.ctx.length / 32;
|
|
76
76
|
for (let o = 0; o < n; o++)
|
|
@@ -79,12 +79,12 @@ function En(e) {
|
|
|
79
79
|
}
|
|
80
80
|
return -1;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function bt(e) {
|
|
83
83
|
const t = {};
|
|
84
84
|
for (const n in e) n[0] !== "$" && (t[n] = e[n]);
|
|
85
85
|
return t;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function We(e) {
|
|
88
88
|
return e ?? "";
|
|
89
89
|
}
|
|
90
90
|
function he(e, t) {
|
|
@@ -96,54 +96,54 @@ function B(e, t, n) {
|
|
|
96
96
|
function O(e) {
|
|
97
97
|
e.parentNode && e.parentNode.removeChild(e);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function gt(e, t) {
|
|
100
100
|
for (let n = 0; n < e.length; n += 1)
|
|
101
101
|
e[n] && e[n].d(t);
|
|
102
102
|
}
|
|
103
103
|
function X(e) {
|
|
104
104
|
return document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Zt(e) {
|
|
107
107
|
return document.createTextNode(e);
|
|
108
108
|
}
|
|
109
109
|
function ie() {
|
|
110
|
-
return
|
|
110
|
+
return Zt(" ");
|
|
111
111
|
}
|
|
112
112
|
function le() {
|
|
113
|
-
return
|
|
113
|
+
return Zt("");
|
|
114
114
|
}
|
|
115
115
|
function H(e, t, n, o) {
|
|
116
116
|
return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function d(e, t, n) {
|
|
119
119
|
n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function bn(e) {
|
|
122
122
|
return Array.from(e.childNodes);
|
|
123
123
|
}
|
|
124
124
|
function pe(e, t, n) {
|
|
125
125
|
e.classList.toggle(t, !!n);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function En(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) {
|
|
128
128
|
return new CustomEvent(e, { detail: t, bubbles: n, cancelable: o });
|
|
129
129
|
}
|
|
130
130
|
let Re;
|
|
131
131
|
function Xe(e) {
|
|
132
132
|
Re = e;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function xt() {
|
|
135
135
|
if (!Re) throw new Error("Function called outside component initialization");
|
|
136
136
|
return Re;
|
|
137
137
|
}
|
|
138
138
|
function Ne(e) {
|
|
139
|
-
|
|
139
|
+
xt().$$.on_mount.push(e);
|
|
140
140
|
}
|
|
141
141
|
function ke() {
|
|
142
|
-
const e =
|
|
142
|
+
const e = xt();
|
|
143
143
|
return (t, n, { cancelable: o = !1 } = {}) => {
|
|
144
144
|
const i = e.$$.callbacks[t];
|
|
145
145
|
if (i) {
|
|
146
|
-
const s =
|
|
146
|
+
const s = En(
|
|
147
147
|
/** @type {string} */
|
|
148
148
|
t,
|
|
149
149
|
n,
|
|
@@ -160,54 +160,54 @@ function me(e, t) {
|
|
|
160
160
|
const n = e.$$.callbacks[t.type];
|
|
161
161
|
n && n.slice().forEach((o) => o.call(this, t));
|
|
162
162
|
}
|
|
163
|
-
const
|
|
163
|
+
const Te = [], qe = [];
|
|
164
164
|
let Me = [];
|
|
165
|
-
const
|
|
166
|
-
let
|
|
167
|
-
function
|
|
168
|
-
|
|
165
|
+
const Et = [], An = /* @__PURE__ */ Promise.resolve();
|
|
166
|
+
let ut = !1;
|
|
167
|
+
function Sn() {
|
|
168
|
+
ut || (ut = !0, An.then($t));
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function dt(e) {
|
|
171
171
|
Me.push(e);
|
|
172
172
|
}
|
|
173
|
-
const
|
|
173
|
+
const $e = /* @__PURE__ */ new Set();
|
|
174
174
|
let be = 0;
|
|
175
|
-
function
|
|
175
|
+
function $t() {
|
|
176
176
|
if (be !== 0)
|
|
177
177
|
return;
|
|
178
178
|
const e = Re;
|
|
179
179
|
do {
|
|
180
180
|
try {
|
|
181
|
-
for (; be <
|
|
182
|
-
const t =
|
|
183
|
-
be++, Xe(t),
|
|
181
|
+
for (; be < Te.length; ) {
|
|
182
|
+
const t = Te[be];
|
|
183
|
+
be++, Xe(t), Tn(t.$$);
|
|
184
184
|
}
|
|
185
185
|
} catch (t) {
|
|
186
|
-
throw
|
|
186
|
+
throw Te.length = 0, be = 0, t;
|
|
187
187
|
}
|
|
188
|
-
for (Xe(null),
|
|
188
|
+
for (Xe(null), Te.length = 0, be = 0; qe.length; ) qe.pop()();
|
|
189
189
|
for (let t = 0; t < Me.length; t += 1) {
|
|
190
190
|
const n = Me[t];
|
|
191
|
-
|
|
191
|
+
$e.has(n) || ($e.add(n), n());
|
|
192
192
|
}
|
|
193
193
|
Me.length = 0;
|
|
194
|
-
} while (
|
|
195
|
-
for (;
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
} while (Te.length);
|
|
195
|
+
for (; Et.length; )
|
|
196
|
+
Et.pop()();
|
|
197
|
+
ut = !1, $e.clear(), Xe(e);
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Tn(e) {
|
|
200
200
|
if (e.fragment !== null) {
|
|
201
201
|
e.update(), ge(e.before_update);
|
|
202
202
|
const t = e.dirty;
|
|
203
|
-
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(
|
|
203
|
+
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(dt);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function vn(e) {
|
|
207
207
|
const t = [], n = [];
|
|
208
208
|
Me.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), Me = t;
|
|
209
209
|
}
|
|
210
|
-
const
|
|
210
|
+
const He = /* @__PURE__ */ new Set();
|
|
211
211
|
let we;
|
|
212
212
|
function se() {
|
|
213
213
|
we = {
|
|
@@ -220,14 +220,14 @@ function se() {
|
|
|
220
220
|
function re() {
|
|
221
221
|
we.r || ge(we.c), we = we.p;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
e && e.i && (
|
|
223
|
+
function Y(e, t) {
|
|
224
|
+
e && e.i && (He.delete(e), e.i(t));
|
|
225
225
|
}
|
|
226
226
|
function C(e, t, n, o) {
|
|
227
227
|
if (e && e.o) {
|
|
228
|
-
if (
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
if (He.has(e)) return;
|
|
229
|
+
He.add(e), we.c.push(() => {
|
|
230
|
+
He.delete(e), o && (n && e.d(1), o());
|
|
231
231
|
}), e.o(t);
|
|
232
232
|
} else o && o();
|
|
233
233
|
}
|
|
@@ -239,17 +239,17 @@ function ee(e) {
|
|
|
239
239
|
}
|
|
240
240
|
function x(e, t, n) {
|
|
241
241
|
const { fragment: o, after_update: i } = e.$$;
|
|
242
|
-
o && o.m(t, n),
|
|
243
|
-
const s = e.$$.on_mount.map(
|
|
242
|
+
o && o.m(t, n), dt(() => {
|
|
243
|
+
const s = e.$$.on_mount.map(Kt).filter(W);
|
|
244
244
|
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : ge(s), e.$$.on_mount = [];
|
|
245
|
-
}), i.forEach(
|
|
245
|
+
}), i.forEach(dt);
|
|
246
246
|
}
|
|
247
247
|
function $(e, t) {
|
|
248
248
|
const n = e.$$;
|
|
249
|
-
n.fragment !== null && (
|
|
249
|
+
n.fragment !== null && (vn(n.after_update), ge(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
e.$$.dirty[0] === -1 && (
|
|
251
|
+
function Mn(e, t) {
|
|
252
|
+
e.$$.dirty[0] === -1 && (Te.push(e), Sn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
253
253
|
}
|
|
254
254
|
function te(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
255
255
|
const a = Re;
|
|
@@ -261,7 +261,7 @@ function te(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
261
261
|
props: s,
|
|
262
262
|
update: j,
|
|
263
263
|
not_equal: i,
|
|
264
|
-
bound:
|
|
264
|
+
bound: wt(),
|
|
265
265
|
// lifecycle
|
|
266
266
|
on_mount: [],
|
|
267
267
|
on_destroy: [],
|
|
@@ -270,23 +270,23 @@ function te(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
270
270
|
after_update: [],
|
|
271
271
|
context: new Map(t.context || (a ? a.$$.context : [])),
|
|
272
272
|
// everything else
|
|
273
|
-
callbacks:
|
|
273
|
+
callbacks: wt(),
|
|
274
274
|
dirty: l,
|
|
275
275
|
skip_bound: !1,
|
|
276
276
|
root: t.target || a.$$.root
|
|
277
277
|
};
|
|
278
278
|
r && r(c.root);
|
|
279
|
-
let
|
|
280
|
-
if (c.ctx = n ? n(e, t.props || {}, (
|
|
279
|
+
let u = !1;
|
|
280
|
+
if (c.ctx = n ? n(e, t.props || {}, (f, h, ...g) => {
|
|
281
281
|
const m = g.length ? g[0] : h;
|
|
282
|
-
return c.ctx && i(c.ctx[
|
|
283
|
-
}) : [], c.update(),
|
|
282
|
+
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u && Mn(e, f)), h;
|
|
283
|
+
}) : [], c.update(), u = !0, ge(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
284
284
|
if (t.hydrate) {
|
|
285
|
-
const
|
|
286
|
-
c.fragment && c.fragment.l(
|
|
285
|
+
const f = bn(t.target);
|
|
286
|
+
c.fragment && c.fragment.l(f), f.forEach(O);
|
|
287
287
|
} else
|
|
288
288
|
c.fragment && c.fragment.c();
|
|
289
|
-
t.intro &&
|
|
289
|
+
t.intro && Y(e.$$.fragment), x(e, t.target, t.anchor), $t();
|
|
290
290
|
}
|
|
291
291
|
Xe(a);
|
|
292
292
|
}
|
|
@@ -299,7 +299,7 @@ class ne {
|
|
|
299
299
|
*
|
|
300
300
|
* @type {any}
|
|
301
301
|
*/
|
|
302
|
-
|
|
302
|
+
Ze(this, "$$");
|
|
303
303
|
/**
|
|
304
304
|
* ### PRIVATE API
|
|
305
305
|
*
|
|
@@ -307,7 +307,7 @@ class ne {
|
|
|
307
307
|
*
|
|
308
308
|
* @type {any}
|
|
309
309
|
*/
|
|
310
|
-
|
|
310
|
+
Ze(this, "$$set");
|
|
311
311
|
}
|
|
312
312
|
/** @returns {void} */
|
|
313
313
|
$destroy() {
|
|
@@ -333,26 +333,26 @@ class ne {
|
|
|
333
333
|
* @returns {void}
|
|
334
334
|
*/
|
|
335
335
|
$set(t) {
|
|
336
|
-
this.$$set && !
|
|
336
|
+
this.$$set && !mn(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
339
|
+
const Ln = "4";
|
|
340
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Ln);
|
|
341
341
|
var F = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(F || {});
|
|
342
|
-
const
|
|
342
|
+
const mt = {}, pt = (e, t) => mt[e] = t, ht = (e) => mt[e.type].area(e), kn = (e, t, n) => mt[e.type].intersects(e, t, n), Ke = (e) => {
|
|
343
343
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, i = -1 / 0;
|
|
344
344
|
return e.forEach(([s, r]) => {
|
|
345
345
|
t = Math.min(t, s), n = Math.min(n, r), o = Math.max(o, s), i = Math.max(i, r);
|
|
346
346
|
}), { minX: t, minY: n, maxX: o, maxY: i };
|
|
347
|
-
},
|
|
347
|
+
}, In = {
|
|
348
348
|
area: (e) => Math.PI * e.geometry.rx * e.geometry.ry,
|
|
349
349
|
intersects: (e, t, n) => {
|
|
350
|
-
const { cx: o, cy: i, rx: s, ry: r } = e.geometry, l = 0, a = Math.cos(l), c = Math.sin(l),
|
|
350
|
+
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, h = a * u + c * f, g = c * u - a * f;
|
|
351
351
|
return h * h / (s * s) + g * g / (r * r) <= 1;
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
355
|
-
const
|
|
354
|
+
pt(F.ELLIPSE, In);
|
|
355
|
+
const On = {
|
|
356
356
|
area: (e) => {
|
|
357
357
|
const { points: t } = e.geometry;
|
|
358
358
|
let n = 0, o = t.length - 1;
|
|
@@ -364,72 +364,72 @@ const Dn = {
|
|
|
364
364
|
const { points: o } = e.geometry;
|
|
365
365
|
let i = !1;
|
|
366
366
|
for (let s = 0, r = o.length - 1; s < o.length; r = s++) {
|
|
367
|
-
const l = o[s][0], a = o[s][1], c = o[r][0],
|
|
368
|
-
a > n !=
|
|
367
|
+
const l = o[s][0], a = o[s][1], c = o[r][0], u = o[r][1];
|
|
368
|
+
a > n != u > n && t < (c - l) * (n - a) / (u - a) + l && (i = !i);
|
|
369
369
|
}
|
|
370
370
|
return i;
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
|
-
|
|
374
|
-
const
|
|
373
|
+
pt(F.POLYGON, On);
|
|
374
|
+
const Bn = {
|
|
375
375
|
area: (e) => e.geometry.w * e.geometry.h,
|
|
376
376
|
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
|
|
377
377
|
};
|
|
378
|
-
|
|
379
|
-
const
|
|
378
|
+
pt(F.RECTANGLE, Bn);
|
|
379
|
+
const Je = (e) => Fe(e.target), Fe = (e) => {
|
|
380
380
|
var t, n;
|
|
381
381
|
return (e == null ? void 0 : e.annotation) !== void 0 && ((n = (t = e == null ? void 0 : e.selector) == null ? void 0 : t.geometry) == null ? void 0 : n.bounds) !== void 0;
|
|
382
|
-
},
|
|
383
|
-
const n = typeof e == "string" ? e : e.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, i = [...n.matchAll(o)][0], [s, r, l, a, c,
|
|
382
|
+
}, Dn = (e, t = !1) => {
|
|
383
|
+
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;
|
|
384
384
|
if (r !== "xywh") throw new Error("Unsupported MediaFragment: " + n);
|
|
385
385
|
if (l && l !== "pixel") throw new Error(`Unsupported MediaFragment unit: ${l}`);
|
|
386
|
-
const [h, g, m,
|
|
386
|
+
const [h, g, m, w] = [a, c, u, f].map(parseFloat);
|
|
387
387
|
return {
|
|
388
388
|
type: F.RECTANGLE,
|
|
389
389
|
geometry: {
|
|
390
390
|
x: h,
|
|
391
391
|
y: g,
|
|
392
392
|
w: m,
|
|
393
|
-
h:
|
|
393
|
+
h: w,
|
|
394
394
|
bounds: {
|
|
395
395
|
minX: h,
|
|
396
|
-
minY: t ? g -
|
|
396
|
+
minY: t ? g - w : g,
|
|
397
397
|
maxX: h + m,
|
|
398
|
-
maxY: t ? g : g +
|
|
398
|
+
maxY: t ? g : g + w
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
};
|
|
402
|
-
},
|
|
402
|
+
}, Yn = (e) => {
|
|
403
403
|
const { x: t, y: n, w: o, h: i } = e;
|
|
404
404
|
return {
|
|
405
405
|
type: "FragmentSelector",
|
|
406
406
|
conformsTo: "http://www.w3.org/TR/media-frags/",
|
|
407
407
|
value: `xywh=pixel:${t},${n},${o},${i}`
|
|
408
408
|
};
|
|
409
|
-
},
|
|
409
|
+
}, en = "http://www.w3.org/2000/svg", At = (e) => {
|
|
410
410
|
const t = (o) => {
|
|
411
411
|
Array.from(o.attributes).forEach((i) => {
|
|
412
412
|
i.name.startsWith("on") && o.removeAttribute(i.name);
|
|
413
413
|
});
|
|
414
414
|
}, n = e.getElementsByTagName("script");
|
|
415
415
|
return Array.from(n).reverse().forEach((o) => o.parentNode.removeChild(o)), Array.from(e.querySelectorAll("*")).forEach(t), e;
|
|
416
|
-
},
|
|
417
|
-
const o = new XMLSerializer().serializeToString(e.documentElement).replace("<svg>", `<svg xmlns="${
|
|
416
|
+
}, Pn = (e) => {
|
|
417
|
+
const o = new XMLSerializer().serializeToString(e.documentElement).replace("<svg>", `<svg xmlns="${en}">`);
|
|
418
418
|
return new DOMParser().parseFromString(o, "image/svg+xml").documentElement;
|
|
419
|
-
},
|
|
420
|
-
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(
|
|
421
|
-
return o || i ?
|
|
422
|
-
},
|
|
419
|
+
}, Cn = (e) => {
|
|
420
|
+
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(en), i = n.lookupNamespaceURI(null);
|
|
421
|
+
return o || i ? At(n).firstChild : At(Pn(n)).firstChild;
|
|
422
|
+
}, Xn = (e) => {
|
|
423
423
|
const [t, n, o] = e.match(/(<polygon points=["|'])([^("|')]*)/) || [], i = o.split(" ").map((s) => s.split(",").map(parseFloat));
|
|
424
424
|
return {
|
|
425
425
|
type: F.POLYGON,
|
|
426
426
|
geometry: {
|
|
427
427
|
points: i,
|
|
428
|
-
bounds:
|
|
428
|
+
bounds: Ke(i)
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
|
-
},
|
|
432
|
-
const t =
|
|
431
|
+
}, Rn = (e) => {
|
|
432
|
+
const t = Cn(e), n = parseFloat(t.getAttribute("cx")), o = parseFloat(t.getAttribute("cy")), i = parseFloat(t.getAttribute("rx")), s = parseFloat(t.getAttribute("ry")), r = {
|
|
433
433
|
minX: n - i,
|
|
434
434
|
minY: o - s,
|
|
435
435
|
maxX: n + i,
|
|
@@ -445,14 +445,14 @@ const Ze = (e) => qe(e.target), qe = (e) => {
|
|
|
445
445
|
bounds: r
|
|
446
446
|
}
|
|
447
447
|
};
|
|
448
|
-
},
|
|
448
|
+
}, Nn = (e) => {
|
|
449
449
|
const t = typeof e == "string" ? e : e.value;
|
|
450
450
|
if (t.includes("<polygon points="))
|
|
451
|
-
return
|
|
451
|
+
return Xn(t);
|
|
452
452
|
if (t.includes("<ellipse "))
|
|
453
|
-
return
|
|
453
|
+
return Rn(t);
|
|
454
454
|
throw "Unsupported SVG shape: " + t;
|
|
455
|
-
},
|
|
455
|
+
}, Un = (e) => {
|
|
456
456
|
let t;
|
|
457
457
|
if (e.type === F.POLYGON) {
|
|
458
458
|
const n = e.geometry, { points: o } = n;
|
|
@@ -464,31 +464,31 @@ const Ze = (e) => qe(e.target), qe = (e) => {
|
|
|
464
464
|
if (t)
|
|
465
465
|
return { type: "SvgSelector", value: t };
|
|
466
466
|
throw `Unsupported shape type: ${e.type}`;
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
function jn(e, t = 0) {
|
|
467
|
+
}, q = [];
|
|
468
|
+
for (let e = 0; e < 256; ++e)
|
|
469
|
+
q.push((e + 256).toString(16).slice(1));
|
|
470
|
+
function Vn(e, t = 0) {
|
|
472
471
|
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]]).toLowerCase();
|
|
473
472
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
473
|
+
let et;
|
|
474
|
+
const Gn = new Uint8Array(16);
|
|
475
|
+
function jn() {
|
|
476
|
+
if (!et) {
|
|
477
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
478
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
479
|
+
et = crypto.getRandomValues.bind(crypto);
|
|
480
|
+
}
|
|
481
|
+
return et(Gn);
|
|
479
482
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
randomUUID
|
|
483
|
-
|
|
484
|
-
function on(e, t, n) {
|
|
485
|
-
if (Tt.randomUUID && !t && !e)
|
|
486
|
-
return Tt.randomUUID();
|
|
483
|
+
const zn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), St = { randomUUID: zn };
|
|
484
|
+
function tn(e, t, n) {
|
|
485
|
+
if (St.randomUUID && !t && !e)
|
|
486
|
+
return St.randomUUID();
|
|
487
487
|
e = e || {};
|
|
488
|
-
|
|
489
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
488
|
+
const o = e.random || (e.rng || jn)();
|
|
489
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Vn(o);
|
|
490
490
|
}
|
|
491
|
-
var
|
|
491
|
+
var Tt = Object.prototype.hasOwnProperty;
|
|
492
492
|
function ye(e, t) {
|
|
493
493
|
var n, o;
|
|
494
494
|
if (e === t) return !0;
|
|
@@ -503,23 +503,23 @@ function ye(e, t) {
|
|
|
503
503
|
if (!n || typeof e == "object") {
|
|
504
504
|
o = 0;
|
|
505
505
|
for (n in e)
|
|
506
|
-
if (
|
|
506
|
+
if (Tt.call(e, n) && ++o && !Tt.call(t, n) || !(n in t) || !ye(e[n], t[n])) return !1;
|
|
507
507
|
return Object.keys(t).length === o;
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
return e !== e && t !== t;
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function tt() {
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function Hn(e, t) {
|
|
515
515
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
516
516
|
}
|
|
517
517
|
const Ee = [];
|
|
518
|
-
function
|
|
518
|
+
function yt(e, t = tt) {
|
|
519
519
|
let n;
|
|
520
520
|
const o = /* @__PURE__ */ new Set();
|
|
521
521
|
function i(l) {
|
|
522
|
-
if (
|
|
522
|
+
if (Hn(e, l) && (e = l, n)) {
|
|
523
523
|
const a = !Ee.length;
|
|
524
524
|
for (const c of o)
|
|
525
525
|
c[1](), Ee.push(c, e);
|
|
@@ -533,16 +533,16 @@ function wt(e, t = ot) {
|
|
|
533
533
|
function s(l) {
|
|
534
534
|
i(l(e));
|
|
535
535
|
}
|
|
536
|
-
function r(l, a =
|
|
536
|
+
function r(l, a = tt) {
|
|
537
537
|
const c = [l, a];
|
|
538
|
-
return o.add(c), o.size === 1 && (n = t(i, s) ||
|
|
538
|
+
return o.add(c), o.size === 1 && (n = t(i, s) || tt), l(e), () => {
|
|
539
539
|
o.delete(c), o.size === 0 && n && (n(), n = null);
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
542
|
return { set: i, update: s, subscribe: r };
|
|
543
543
|
}
|
|
544
|
-
const
|
|
545
|
-
const { subscribe: t, set: n } =
|
|
544
|
+
const Fn = (e) => {
|
|
545
|
+
const { subscribe: t, set: n } = yt();
|
|
546
546
|
let o;
|
|
547
547
|
return t((i) => o = i), e.observe(({ changes: i }) => {
|
|
548
548
|
if (o) {
|
|
@@ -558,53 +558,57 @@ const qn = (e) => {
|
|
|
558
558
|
set: n
|
|
559
559
|
};
|
|
560
560
|
};
|
|
561
|
-
var
|
|
562
|
-
const
|
|
563
|
-
const { subscribe: o, set: i } =
|
|
564
|
-
let s = t, r =
|
|
561
|
+
var nn = /* @__PURE__ */ ((e) => (e.EDIT = "EDIT", e.SELECT = "SELECT", e.NONE = "NONE", e))(nn || {});
|
|
562
|
+
const Ge = { selected: [] }, Wn = (e, t, n) => {
|
|
563
|
+
const { subscribe: o, set: i } = yt(Ge);
|
|
564
|
+
let s = t, r = Ge;
|
|
565
565
|
o((m) => r = m);
|
|
566
566
|
const l = () => {
|
|
567
|
-
ye(r,
|
|
567
|
+
ye(r, Ge) || i(Ge);
|
|
568
568
|
}, a = () => {
|
|
569
569
|
var m;
|
|
570
570
|
return ((m = r.selected) == null ? void 0 : m.length) === 0;
|
|
571
571
|
}, c = (m) => {
|
|
572
572
|
if (a())
|
|
573
573
|
return !1;
|
|
574
|
-
const
|
|
575
|
-
return r.selected.some((
|
|
576
|
-
},
|
|
577
|
-
|
|
578
|
-
if (
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
i({ selected: [], event: y });
|
|
574
|
+
const w = typeof m == "string" ? m : m.id;
|
|
575
|
+
return r.selected.some((T) => T.id === w);
|
|
576
|
+
}, u = (m, w) => {
|
|
577
|
+
let T;
|
|
578
|
+
if (Array.isArray(m)) {
|
|
579
|
+
if (T = m.map((p) => e.getAnnotation(p)).filter(Boolean), T.length < m.length) {
|
|
580
|
+
console.warn("Invalid selection: " + m.filter((p) => !T.some((_) => _.id === p)));
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
} else {
|
|
584
|
+
const p = e.getAnnotation(m);
|
|
585
|
+
if (!p) {
|
|
586
|
+
console.warn("Invalid selection: " + m);
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
T = [p];
|
|
591
590
|
}
|
|
592
|
-
|
|
593
|
-
|
|
591
|
+
const y = T.reduce((p, _) => {
|
|
592
|
+
const E = vt(_, s, n);
|
|
593
|
+
return E === "EDIT" ? [...p, { id: _.id, editable: !0 }] : E === "SELECT" ? [...p, { id: _.id }] : p;
|
|
594
|
+
}, []);
|
|
595
|
+
i({ selected: y, event: w });
|
|
596
|
+
}, f = (m, w) => {
|
|
597
|
+
const T = Array.isArray(m) ? m : [m], y = T.map((p) => e.getAnnotation(p)).filter((p) => !!p);
|
|
594
598
|
i({
|
|
595
|
-
selected:
|
|
596
|
-
const _ =
|
|
597
|
-
return { id:
|
|
599
|
+
selected: y.map((p) => {
|
|
600
|
+
const _ = w === void 0 ? vt(p, s, n) === "EDIT" : w;
|
|
601
|
+
return { id: p.id, editable: _ };
|
|
598
602
|
})
|
|
599
|
-
}),
|
|
603
|
+
}), y.length !== T.length && console.warn("Invalid selection", m);
|
|
600
604
|
}, h = (m) => {
|
|
601
605
|
if (a())
|
|
602
606
|
return !1;
|
|
603
|
-
const { selected:
|
|
604
|
-
|
|
607
|
+
const { selected: w } = r;
|
|
608
|
+
w.some(({ id: T }) => m.includes(T)) && i({ selected: w.filter(({ id: T }) => !m.includes(T)) });
|
|
605
609
|
}, g = (m) => s = m;
|
|
606
610
|
return e.observe(
|
|
607
|
-
({ changes: m }) => h((m.deleted || []).map((
|
|
611
|
+
({ changes: m }) => h((m.deleted || []).map((w) => w.id))
|
|
608
612
|
), {
|
|
609
613
|
get event() {
|
|
610
614
|
return r ? r.event : null;
|
|
@@ -618,39 +622,39 @@ const je = { selected: [] }, Kn = (e, t, n) => {
|
|
|
618
622
|
clear: l,
|
|
619
623
|
isEmpty: a,
|
|
620
624
|
isSelected: c,
|
|
621
|
-
setSelected:
|
|
625
|
+
setSelected: f,
|
|
622
626
|
setUserSelectAction: g,
|
|
623
627
|
subscribe: o,
|
|
624
|
-
userSelect:
|
|
628
|
+
userSelect: u
|
|
625
629
|
};
|
|
626
|
-
},
|
|
630
|
+
}, vt = (e, t, n) => {
|
|
627
631
|
const o = n ? n.serialize(e) : e;
|
|
628
632
|
return typeof t == "function" ? t(o) : t || "EDIT";
|
|
629
|
-
};
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
function Jn(e, t = 0) {
|
|
633
|
+
}, K = [];
|
|
634
|
+
for (let e = 0; e < 256; ++e)
|
|
635
|
+
K.push((e + 256).toString(16).slice(1));
|
|
636
|
+
function qn(e, t = 0) {
|
|
634
637
|
return (K[e[t + 0]] + K[e[t + 1]] + K[e[t + 2]] + K[e[t + 3]] + "-" + K[e[t + 4]] + K[e[t + 5]] + "-" + K[e[t + 6]] + K[e[t + 7]] + "-" + K[e[t + 8]] + K[e[t + 9]] + "-" + K[e[t + 10]] + K[e[t + 11]] + K[e[t + 12]] + K[e[t + 13]] + K[e[t + 14]] + K[e[t + 15]]).toLowerCase();
|
|
635
638
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
639
|
+
let nt;
|
|
640
|
+
const Kn = new Uint8Array(16);
|
|
641
|
+
function Jn() {
|
|
642
|
+
if (!nt) {
|
|
643
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
644
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
645
|
+
nt = crypto.getRandomValues.bind(crypto);
|
|
646
|
+
}
|
|
647
|
+
return nt(Kn);
|
|
641
648
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
randomUUID
|
|
645
|
-
|
|
646
|
-
function rn(e, t, n) {
|
|
647
|
-
if (kt.randomUUID && !t && !e)
|
|
648
|
-
return kt.randomUUID();
|
|
649
|
+
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Mt = { randomUUID: Qn };
|
|
650
|
+
function on(e, t, n) {
|
|
651
|
+
if (Mt.randomUUID && !t && !e)
|
|
652
|
+
return Mt.randomUUID();
|
|
649
653
|
e = e || {};
|
|
650
|
-
|
|
651
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
654
|
+
const o = e.random || (e.rng || Jn)();
|
|
655
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, qn(o);
|
|
652
656
|
}
|
|
653
|
-
const
|
|
657
|
+
const ot = (e) => {
|
|
654
658
|
const t = (n) => {
|
|
655
659
|
const o = { ...n };
|
|
656
660
|
return n.created && typeof n.created == "string" && (o.created = new Date(n.created)), n.updated && typeof n.updated == "string" && (o.updated = new Date(n.updated)), o;
|
|
@@ -660,34 +664,34 @@ const st = (e) => {
|
|
|
660
664
|
bodies: (e.bodies || []).map(t),
|
|
661
665
|
target: t(e.target)
|
|
662
666
|
};
|
|
663
|
-
},
|
|
664
|
-
id:
|
|
667
|
+
}, zi = (e, t, n, o) => ({
|
|
668
|
+
id: on(),
|
|
665
669
|
annotation: typeof e == "string" ? e : e.id,
|
|
666
670
|
created: n || /* @__PURE__ */ new Date(),
|
|
667
671
|
creator: o,
|
|
668
672
|
...t
|
|
669
|
-
}),
|
|
673
|
+
}), Zn = (e, t) => {
|
|
670
674
|
const n = new Set(e.bodies.map((o) => o.id));
|
|
671
675
|
return t.bodies.filter((o) => !n.has(o.id));
|
|
672
|
-
},
|
|
676
|
+
}, xn = (e, t) => {
|
|
673
677
|
const n = new Set(t.bodies.map((o) => o.id));
|
|
674
678
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
675
|
-
},
|
|
679
|
+
}, $n = (e, t) => t.bodies.map((n) => {
|
|
676
680
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
677
681
|
return { newBody: n, oldBody: o && !ye(o, n) ? o : void 0 };
|
|
678
|
-
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })),
|
|
679
|
-
const n =
|
|
682
|
+
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), eo = (e, t) => !ye(e.target, t.target), sn = (e, t) => {
|
|
683
|
+
const n = Zn(e, t), o = xn(e, t), i = $n(e, t);
|
|
680
684
|
return {
|
|
681
685
|
oldValue: e,
|
|
682
686
|
newValue: t,
|
|
683
687
|
bodiesCreated: n.length > 0 ? n : void 0,
|
|
684
688
|
bodiesDeleted: o.length > 0 ? o : void 0,
|
|
685
689
|
bodiesUpdated: i.length > 0 ? i : void 0,
|
|
686
|
-
targetUpdated:
|
|
690
|
+
targetUpdated: eo(e, t) ? { oldTarget: e.target, newTarget: t.target } : void 0
|
|
687
691
|
};
|
|
688
692
|
};
|
|
689
693
|
var G = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.REMOTE = "REMOTE", e.SILENT = "SILENT", e))(G || {});
|
|
690
|
-
const
|
|
694
|
+
const to = (e, t) => {
|
|
691
695
|
var n, o;
|
|
692
696
|
const { changes: i, origin: s } = t;
|
|
693
697
|
if (!(e.options.origin ? e.options.origin === s : s !== "SILENT"))
|
|
@@ -695,7 +699,7 @@ const oo = (e, t) => {
|
|
|
695
699
|
if (e.options.ignore) {
|
|
696
700
|
const { ignore: r } = e.options, l = (a) => a && a.length > 0;
|
|
697
701
|
if (!(l(i.created) || l(i.deleted))) {
|
|
698
|
-
const a = (n = i.updated) == null ? void 0 : n.some((
|
|
702
|
+
const a = (n = i.updated) == null ? void 0 : n.some((u) => l(u.bodiesCreated) || l(u.bodiesDeleted) || l(u.bodiesUpdated)), c = (o = i.updated) == null ? void 0 : o.some((u) => u.targetUpdated);
|
|
699
703
|
if (r === "BODY_ONLY" && a && !c || r === "TARGET_ONLY" && c && !a)
|
|
700
704
|
return !1;
|
|
701
705
|
}
|
|
@@ -709,27 +713,27 @@ const oo = (e, t) => {
|
|
|
709
713
|
return !!(Array.isArray(e.options.annotations) ? e.options.annotations : [e.options.annotations]).find((l) => r.has(l));
|
|
710
714
|
} else
|
|
711
715
|
return !0;
|
|
712
|
-
},
|
|
713
|
-
const n = new Set((e.created || []).map((
|
|
714
|
-
...(e.created || []).filter((
|
|
716
|
+
}, no = (e, t) => {
|
|
717
|
+
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 = [
|
|
718
|
+
...(e.created || []).filter((f) => !s.has(f.id)).map((f) => r.has(f.id) ? t.updated.find(({ oldValue: h }) => h.id === f.id).newValue : f),
|
|
715
719
|
...t.created || []
|
|
716
720
|
], c = [
|
|
717
|
-
...(e.deleted || []).filter((
|
|
718
|
-
...(t.deleted || []).filter((
|
|
719
|
-
],
|
|
720
|
-
...(e.updated || []).filter(({ newValue:
|
|
721
|
-
const { oldValue: h, newValue: g } =
|
|
721
|
+
...(e.deleted || []).filter((f) => !i.has(f.id)),
|
|
722
|
+
...(t.deleted || []).filter((f) => !n.has(f.id))
|
|
723
|
+
], u = [
|
|
724
|
+
...(e.updated || []).filter(({ newValue: f }) => !s.has(f.id)).map((f) => {
|
|
725
|
+
const { oldValue: h, newValue: g } = f;
|
|
722
726
|
if (r.has(g.id)) {
|
|
723
|
-
const m = t.updated.find((
|
|
724
|
-
return
|
|
727
|
+
const m = t.updated.find((w) => w.oldValue.id === g.id).newValue;
|
|
728
|
+
return sn(h, m);
|
|
725
729
|
} else
|
|
726
|
-
return
|
|
730
|
+
return f;
|
|
727
731
|
}),
|
|
728
|
-
...(t.updated || []).filter(({ oldValue:
|
|
732
|
+
...(t.updated || []).filter(({ oldValue: f }) => !l.has(f.id))
|
|
729
733
|
];
|
|
730
|
-
return { created: a, deleted: c, updated:
|
|
731
|
-
},
|
|
732
|
-
const t = e.id === void 0 ?
|
|
734
|
+
return { created: a, deleted: c, updated: u };
|
|
735
|
+
}, it = (e) => {
|
|
736
|
+
const t = e.id === void 0 ? on() : e.id;
|
|
733
737
|
return {
|
|
734
738
|
...e,
|
|
735
739
|
id: t,
|
|
@@ -742,7 +746,7 @@ const oo = (e, t) => {
|
|
|
742
746
|
annotation: t
|
|
743
747
|
}
|
|
744
748
|
};
|
|
745
|
-
},
|
|
749
|
+
}, oo = (e) => e.id !== void 0, io = () => {
|
|
746
750
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (A, S = {}) => {
|
|
747
751
|
n.push({ onChange: A, options: S });
|
|
748
752
|
}, i = (A) => {
|
|
@@ -758,105 +762,105 @@ const oo = (e, t) => {
|
|
|
758
762
|
},
|
|
759
763
|
state: [...e.values()]
|
|
760
764
|
};
|
|
761
|
-
n.forEach((
|
|
762
|
-
|
|
765
|
+
n.forEach((v) => {
|
|
766
|
+
to(v, b) && v.onChange(b);
|
|
763
767
|
});
|
|
764
768
|
}, r = (A, S = G.LOCAL) => {
|
|
765
769
|
if (A.id && e.get(A.id))
|
|
766
770
|
throw Error(`Cannot add annotation ${A.id} - exists already`);
|
|
767
771
|
{
|
|
768
|
-
const b =
|
|
769
|
-
e.set(b.id, b), b.bodies.forEach((
|
|
772
|
+
const b = it(A);
|
|
773
|
+
e.set(b.id, b), b.bodies.forEach((v) => t.set(v.id, b.id)), s(S, { created: [b] });
|
|
770
774
|
}
|
|
771
775
|
}, l = (A, S) => {
|
|
772
|
-
const b =
|
|
773
|
-
if (
|
|
774
|
-
const D =
|
|
775
|
-
return
|
|
776
|
+
const b = it(typeof A == "string" ? S : A), v = typeof A == "string" ? A : A.id, P = v && e.get(v);
|
|
777
|
+
if (P) {
|
|
778
|
+
const D = sn(P, b);
|
|
779
|
+
return v === b.id ? e.set(v, b) : (e.delete(v), e.set(b.id, b)), P.bodies.forEach((z) => t.delete(z.id)), b.bodies.forEach((z) => t.set(z.id, b.id)), D;
|
|
776
780
|
} else
|
|
777
|
-
console.warn(`Cannot update annotation ${
|
|
781
|
+
console.warn(`Cannot update annotation ${v} - does not exist`);
|
|
778
782
|
}, a = (A, S = G.LOCAL, b = G.LOCAL) => {
|
|
779
|
-
const
|
|
780
|
-
|
|
783
|
+
const v = oo(S) ? b : S, P = l(A, S);
|
|
784
|
+
P && s(v, { updated: [P] });
|
|
781
785
|
}, c = (A, S = G.LOCAL) => {
|
|
782
|
-
const b = A.reduce((
|
|
783
|
-
const D = l(
|
|
784
|
-
return D ? [...
|
|
786
|
+
const b = A.reduce((v, P) => {
|
|
787
|
+
const D = l(P);
|
|
788
|
+
return D ? [...v, D] : v;
|
|
785
789
|
}, []);
|
|
786
790
|
b.length > 0 && s(S, { updated: b });
|
|
787
|
-
},
|
|
791
|
+
}, u = (A, S = G.LOCAL) => {
|
|
788
792
|
const b = e.get(A.annotation);
|
|
789
793
|
if (b) {
|
|
790
|
-
const
|
|
794
|
+
const v = {
|
|
791
795
|
...b,
|
|
792
796
|
bodies: [...b.bodies, A]
|
|
793
797
|
};
|
|
794
|
-
e.set(b.id,
|
|
798
|
+
e.set(b.id, v), t.set(A.id, v.id), s(S, { updated: [{
|
|
795
799
|
oldValue: b,
|
|
796
|
-
newValue:
|
|
800
|
+
newValue: v,
|
|
797
801
|
bodiesCreated: [A]
|
|
798
802
|
}] });
|
|
799
803
|
} else
|
|
800
804
|
console.warn(`Attempt to add body to missing annotation: ${A.annotation}`);
|
|
801
|
-
},
|
|
805
|
+
}, f = () => [...e.values()], h = (A = G.LOCAL) => {
|
|
802
806
|
const S = [...e.values()];
|
|
803
807
|
e.clear(), t.clear(), s(A, { deleted: S });
|
|
804
808
|
}, g = (A, S = !0, b = G.LOCAL) => {
|
|
805
|
-
const
|
|
809
|
+
const v = A.map(it);
|
|
806
810
|
if (S) {
|
|
807
|
-
const
|
|
808
|
-
e.clear(), t.clear(),
|
|
811
|
+
const P = [...e.values()];
|
|
812
|
+
e.clear(), t.clear(), v.forEach((D) => {
|
|
809
813
|
e.set(D.id, D), D.bodies.forEach((z) => t.set(z.id, D.id));
|
|
810
|
-
}), s(b, { created:
|
|
814
|
+
}), s(b, { created: v, deleted: P });
|
|
811
815
|
} else {
|
|
812
|
-
const
|
|
816
|
+
const P = A.reduce((D, z) => {
|
|
813
817
|
const oe = z.id && e.get(z.id);
|
|
814
818
|
return oe ? [...D, oe] : D;
|
|
815
819
|
}, []);
|
|
816
|
-
if (
|
|
817
|
-
throw Error(`Bulk insert would overwrite the following annotations: ${
|
|
818
|
-
|
|
820
|
+
if (P.length > 0)
|
|
821
|
+
throw Error(`Bulk insert would overwrite the following annotations: ${P.map((D) => D.id).join(", ")}`);
|
|
822
|
+
v.forEach((D) => {
|
|
819
823
|
e.set(D.id, D), D.bodies.forEach((z) => t.set(z.id, D.id));
|
|
820
|
-
}), s(b, { created:
|
|
824
|
+
}), s(b, { created: v });
|
|
821
825
|
}
|
|
822
826
|
}, m = (A) => {
|
|
823
827
|
const S = typeof A == "string" ? A : A.id, b = e.get(S);
|
|
824
828
|
if (b)
|
|
825
|
-
return e.delete(S), b.bodies.forEach((
|
|
829
|
+
return e.delete(S), b.bodies.forEach((v) => t.delete(v.id)), b;
|
|
826
830
|
console.warn(`Attempt to delete missing annotation: ${S}`);
|
|
827
|
-
},
|
|
831
|
+
}, w = (A, S = G.LOCAL) => {
|
|
828
832
|
const b = m(A);
|
|
829
833
|
b && s(S, { deleted: [b] });
|
|
830
|
-
},
|
|
831
|
-
const b = A.reduce((
|
|
832
|
-
const D = m(
|
|
833
|
-
return D ? [...
|
|
834
|
+
}, T = (A, S = G.LOCAL) => {
|
|
835
|
+
const b = A.reduce((v, P) => {
|
|
836
|
+
const D = m(P);
|
|
837
|
+
return D ? [...v, D] : v;
|
|
834
838
|
}, []);
|
|
835
839
|
b.length > 0 && s(S, { deleted: b });
|
|
836
|
-
},
|
|
840
|
+
}, y = (A) => {
|
|
837
841
|
const S = e.get(A.annotation);
|
|
838
842
|
if (S) {
|
|
839
|
-
const b = S.bodies.find((
|
|
843
|
+
const b = S.bodies.find((v) => v.id === A.id);
|
|
840
844
|
if (b) {
|
|
841
845
|
t.delete(b.id);
|
|
842
|
-
const
|
|
846
|
+
const v = {
|
|
843
847
|
...S,
|
|
844
|
-
bodies: S.bodies.filter((
|
|
848
|
+
bodies: S.bodies.filter((P) => P.id !== A.id)
|
|
845
849
|
};
|
|
846
|
-
return e.set(S.id,
|
|
850
|
+
return e.set(S.id, v), {
|
|
847
851
|
oldValue: S,
|
|
848
|
-
newValue:
|
|
852
|
+
newValue: v,
|
|
849
853
|
bodiesDeleted: [b]
|
|
850
854
|
};
|
|
851
855
|
} else
|
|
852
856
|
console.warn(`Attempt to delete missing body ${A.id} from annotation ${A.annotation}`);
|
|
853
857
|
} else
|
|
854
858
|
console.warn(`Attempt to delete body from missing annotation ${A.annotation}`);
|
|
855
|
-
},
|
|
856
|
-
const b =
|
|
859
|
+
}, p = (A, S = G.LOCAL) => {
|
|
860
|
+
const b = y(A);
|
|
857
861
|
b && s(S, { updated: [b] });
|
|
858
862
|
}, _ = (A, S = G.LOCAL) => {
|
|
859
|
-
const b = A.map((
|
|
863
|
+
const b = A.map((v) => y(v)).filter(Boolean);
|
|
860
864
|
b.length > 0 && s(S, { updated: b });
|
|
861
865
|
}, E = (A) => {
|
|
862
866
|
const S = e.get(A);
|
|
@@ -864,7 +868,7 @@ const oo = (e, t) => {
|
|
|
864
868
|
}, I = (A) => {
|
|
865
869
|
const S = t.get(A);
|
|
866
870
|
if (S) {
|
|
867
|
-
const b = E(S).bodies.find((
|
|
871
|
+
const b = E(S).bodies.find((v) => v.id === A);
|
|
868
872
|
if (b)
|
|
869
873
|
return b;
|
|
870
874
|
console.error(`Store integrity error: body ${A} in index, but not in annotation`);
|
|
@@ -875,22 +879,22 @@ const oo = (e, t) => {
|
|
|
875
879
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
876
880
|
const b = e.get(A.annotation);
|
|
877
881
|
if (b) {
|
|
878
|
-
const
|
|
882
|
+
const v = b.bodies.find((D) => D.id === A.id), P = {
|
|
879
883
|
...b,
|
|
880
|
-
bodies: b.bodies.map((D) => D.id ===
|
|
884
|
+
bodies: b.bodies.map((D) => D.id === v.id ? S : D)
|
|
881
885
|
};
|
|
882
|
-
return e.set(b.id,
|
|
886
|
+
return e.set(b.id, P), v.id !== S.id && (t.delete(v.id), t.set(S.id, P.id)), {
|
|
883
887
|
oldValue: b,
|
|
884
|
-
newValue:
|
|
885
|
-
bodiesUpdated: [{ oldBody:
|
|
888
|
+
newValue: P,
|
|
889
|
+
bodiesUpdated: [{ oldBody: v, newBody: S }]
|
|
886
890
|
};
|
|
887
891
|
} else
|
|
888
892
|
console.warn(`Attempt to add body to missing annotation ${A.annotation}`);
|
|
889
893
|
}, U = (A, S, b = G.LOCAL) => {
|
|
890
|
-
const
|
|
891
|
-
|
|
894
|
+
const v = R(A, S);
|
|
895
|
+
v && s(b, { updated: [v] });
|
|
892
896
|
}, V = (A, S = G.LOCAL) => {
|
|
893
|
-
const b = A.map((
|
|
897
|
+
const b = A.map((v) => R({ id: v.id, annotation: v.annotation }, v)).filter(Boolean);
|
|
894
898
|
s(S, { updated: b });
|
|
895
899
|
}, Z = (A) => {
|
|
896
900
|
const S = e.get(A.annotation);
|
|
@@ -915,20 +919,20 @@ const oo = (e, t) => {
|
|
|
915
919
|
};
|
|
916
920
|
return {
|
|
917
921
|
addAnnotation: r,
|
|
918
|
-
addBody:
|
|
919
|
-
all:
|
|
922
|
+
addBody: u,
|
|
923
|
+
all: f,
|
|
920
924
|
bulkAddAnnotation: g,
|
|
921
|
-
bulkDeleteAnnotation:
|
|
925
|
+
bulkDeleteAnnotation: T,
|
|
922
926
|
bulkDeleteBodies: _,
|
|
923
927
|
bulkUpdateAnnotation: c,
|
|
924
928
|
bulkUpdateBodies: V,
|
|
925
929
|
bulkUpdateTargets: (A, S = G.LOCAL) => {
|
|
926
|
-
const b = A.map((
|
|
930
|
+
const b = A.map((v) => Z(v)).filter(Boolean);
|
|
927
931
|
b.length > 0 && s(S, { updated: b });
|
|
928
932
|
},
|
|
929
933
|
clear: h,
|
|
930
|
-
deleteAnnotation:
|
|
931
|
-
deleteBody:
|
|
934
|
+
deleteAnnotation: w,
|
|
935
|
+
deleteBody: p,
|
|
932
936
|
getAnnotation: E,
|
|
933
937
|
getBody: I,
|
|
934
938
|
observe: o,
|
|
@@ -940,17 +944,17 @@ const oo = (e, t) => {
|
|
|
940
944
|
b && s(S, { updated: [b] });
|
|
941
945
|
}
|
|
942
946
|
};
|
|
943
|
-
},
|
|
947
|
+
}, so = (e) => ({
|
|
944
948
|
...e,
|
|
945
949
|
subscribe: (t) => {
|
|
946
950
|
const n = (o) => t(o.state);
|
|
947
951
|
return e.observe(n), t(e.all()), () => e.unobserve(n);
|
|
948
952
|
}
|
|
949
953
|
});
|
|
950
|
-
let
|
|
954
|
+
let ro = () => ({
|
|
951
955
|
emit(e, ...t) {
|
|
952
|
-
for (let n =
|
|
953
|
-
o
|
|
956
|
+
for (let n = this.events[e] || [], o = 0, i = n.length; o < i; o++)
|
|
957
|
+
n[o](...t);
|
|
954
958
|
},
|
|
955
959
|
events: {},
|
|
956
960
|
on(e, t) {
|
|
@@ -961,24 +965,24 @@ let ao = () => ({
|
|
|
961
965
|
};
|
|
962
966
|
}
|
|
963
967
|
});
|
|
964
|
-
const
|
|
965
|
-
const t =
|
|
968
|
+
const lo = 250, ao = (e) => {
|
|
969
|
+
const t = ro(), n = [];
|
|
966
970
|
let o = -1, i = !1, s = 0;
|
|
967
971
|
const r = (g) => {
|
|
968
972
|
if (!i) {
|
|
969
|
-
const { changes: m } = g,
|
|
970
|
-
if (
|
|
973
|
+
const { changes: m } = g, w = performance.now();
|
|
974
|
+
if (w - s > lo)
|
|
971
975
|
n.splice(o + 1), n.push(m), o = n.length - 1;
|
|
972
976
|
else {
|
|
973
|
-
const
|
|
974
|
-
n[
|
|
977
|
+
const T = n.length - 1;
|
|
978
|
+
n[T] = no(n[T], m);
|
|
975
979
|
}
|
|
976
|
-
s =
|
|
980
|
+
s = w;
|
|
977
981
|
}
|
|
978
982
|
i = !1;
|
|
979
983
|
};
|
|
980
984
|
e.observe(r, { origin: G.LOCAL });
|
|
981
|
-
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)),
|
|
985
|
+
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), h = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g);
|
|
982
986
|
return {
|
|
983
987
|
canRedo: () => n.length - 1 > o,
|
|
984
988
|
canUndo: () => o > -1,
|
|
@@ -987,63 +991,63 @@ const co = 250, fo = (e) => {
|
|
|
987
991
|
redo: () => {
|
|
988
992
|
if (n.length - 1 > o) {
|
|
989
993
|
i = !0;
|
|
990
|
-
const { created: g, updated: m, deleted:
|
|
991
|
-
a(g),
|
|
994
|
+
const { created: g, updated: m, deleted: w } = n[o + 1];
|
|
995
|
+
a(g), u(m), h(w), t.emit("redo", n[o + 1]), o += 1;
|
|
992
996
|
}
|
|
993
997
|
},
|
|
994
998
|
undo: () => {
|
|
995
999
|
if (o > -1) {
|
|
996
1000
|
i = !0;
|
|
997
|
-
const { created: g, updated: m, deleted:
|
|
998
|
-
l(g), c(m),
|
|
1001
|
+
const { created: g, updated: m, deleted: w } = n[o];
|
|
1002
|
+
l(g), c(m), f(w), t.emit("undo", n[o]), o -= 1;
|
|
999
1003
|
}
|
|
1000
1004
|
}
|
|
1001
1005
|
};
|
|
1002
|
-
},
|
|
1003
|
-
const { subscribe: e, set: t } =
|
|
1006
|
+
}, co = () => {
|
|
1007
|
+
const { subscribe: e, set: t } = yt([]);
|
|
1004
1008
|
return {
|
|
1005
1009
|
subscribe: e,
|
|
1006
1010
|
set: t
|
|
1007
1011
|
};
|
|
1008
|
-
},
|
|
1012
|
+
}, fo = (e, t, n, o) => {
|
|
1009
1013
|
const { hover: i, selection: s, store: r, viewport: l } = e, a = /* @__PURE__ */ new Map();
|
|
1010
|
-
let c = [],
|
|
1011
|
-
const h = (
|
|
1012
|
-
a.has(
|
|
1013
|
-
}, g = (
|
|
1014
|
-
const _ = a.get(
|
|
1014
|
+
let c = [], u, f;
|
|
1015
|
+
const h = (y, p) => {
|
|
1016
|
+
a.has(y) ? a.get(y).push(p) : a.set(y, [p]);
|
|
1017
|
+
}, g = (y, p) => {
|
|
1018
|
+
const _ = a.get(y);
|
|
1015
1019
|
if (_) {
|
|
1016
|
-
const E = _.indexOf(
|
|
1020
|
+
const E = _.indexOf(p);
|
|
1017
1021
|
E !== -1 && _.splice(E, 1);
|
|
1018
1022
|
}
|
|
1019
|
-
}, m = (
|
|
1020
|
-
a.has(
|
|
1021
|
-
a.get(
|
|
1023
|
+
}, m = (y, p, _) => {
|
|
1024
|
+
a.has(y) && setTimeout(() => {
|
|
1025
|
+
a.get(y).forEach((E) => {
|
|
1022
1026
|
if (n) {
|
|
1023
|
-
const I = Array.isArray(
|
|
1027
|
+
const I = Array.isArray(p) ? p.map((U) => n.serialize(U)) : n.serialize(p), R = _ ? _ instanceof PointerEvent ? _ : n.serialize(_) : void 0;
|
|
1024
1028
|
E(I, R);
|
|
1025
1029
|
} else
|
|
1026
|
-
E(
|
|
1030
|
+
E(p, _);
|
|
1027
1031
|
});
|
|
1028
1032
|
}, 1);
|
|
1029
|
-
},
|
|
1030
|
-
const { selected:
|
|
1031
|
-
|
|
1033
|
+
}, w = () => {
|
|
1034
|
+
const { selected: y } = s, p = (y || []).map(({ id: _ }) => r.getAnnotation(_));
|
|
1035
|
+
p.forEach((_) => {
|
|
1032
1036
|
const E = c.find((I) => I.id === _.id);
|
|
1033
1037
|
(!E || !ye(E, _)) && m("updateAnnotation", _, E);
|
|
1034
|
-
}), c = c.map((_) =>
|
|
1038
|
+
}), c = c.map((_) => p.find(({ id: I }) => I === _.id) || _);
|
|
1035
1039
|
};
|
|
1036
|
-
s.subscribe(({ selected:
|
|
1037
|
-
if (!(c.length === 0 &&
|
|
1038
|
-
if (c.length === 0 &&
|
|
1039
|
-
c =
|
|
1040
|
-
else if (c.length > 0 &&
|
|
1041
|
-
c.forEach((
|
|
1042
|
-
const _ = r.getAnnotation(
|
|
1043
|
-
_ && !ye(_,
|
|
1040
|
+
s.subscribe(({ selected: y }) => {
|
|
1041
|
+
if (!(c.length === 0 && y.length === 0)) {
|
|
1042
|
+
if (c.length === 0 && y.length > 0)
|
|
1043
|
+
c = y.map(({ id: p }) => r.getAnnotation(p));
|
|
1044
|
+
else if (c.length > 0 && y.length === 0)
|
|
1045
|
+
c.forEach((p) => {
|
|
1046
|
+
const _ = r.getAnnotation(p.id);
|
|
1047
|
+
_ && !ye(_, p) && m("updateAnnotation", _, p);
|
|
1044
1048
|
}), c = [];
|
|
1045
1049
|
else {
|
|
1046
|
-
const
|
|
1050
|
+
const p = new Set(c.map((E) => E.id)), _ = new Set(y.map(({ id: E }) => E));
|
|
1047
1051
|
c.filter((E) => !_.has(E.id)).forEach((E) => {
|
|
1048
1052
|
const I = r.getAnnotation(E.id);
|
|
1049
1053
|
I && !ye(I, E) && m("updateAnnotation", I, E);
|
|
@@ -1051,17 +1055,17 @@ const co = 250, fo = (e) => {
|
|
|
1051
1055
|
// Remove annotations that were deselected
|
|
1052
1056
|
...c.filter((E) => _.has(E.id)),
|
|
1053
1057
|
// Add editable annotations that were selected
|
|
1054
|
-
...
|
|
1058
|
+
...y.filter(({ id: E }) => !p.has(E)).map(({ id: E }) => r.getAnnotation(E))
|
|
1055
1059
|
];
|
|
1056
1060
|
}
|
|
1057
1061
|
m("selectionChanged", c);
|
|
1058
1062
|
}
|
|
1059
|
-
}), i.subscribe((
|
|
1060
|
-
!
|
|
1061
|
-
}), l == null || l.subscribe((
|
|
1062
|
-
o && (
|
|
1063
|
-
const { created:
|
|
1064
|
-
(
|
|
1063
|
+
}), i.subscribe((y) => {
|
|
1064
|
+
!u && y ? m("mouseEnterAnnotation", r.getAnnotation(y)) : u && !y ? m("mouseLeaveAnnotation", r.getAnnotation(u)) : u && y && (m("mouseLeaveAnnotation", r.getAnnotation(u)), m("mouseEnterAnnotation", r.getAnnotation(y))), u = y;
|
|
1065
|
+
}), l == null || l.subscribe((y) => m("viewportIntersect", y.map((p) => r.getAnnotation(p)))), r.observe((y) => {
|
|
1066
|
+
o && (f && clearTimeout(f), f = setTimeout(w, 1e3));
|
|
1067
|
+
const { created: p, deleted: _ } = y.changes;
|
|
1068
|
+
(p || []).forEach((E) => m("createAnnotation", E)), (_ || []).forEach((E) => m("deleteAnnotation", E)), (y.changes.updated || []).filter((E) => [
|
|
1065
1069
|
...E.bodiesCreated || [],
|
|
1066
1070
|
...E.bodiesDeleted || [],
|
|
1067
1071
|
...E.bodiesUpdated || []
|
|
@@ -1069,18 +1073,18 @@ const co = 250, fo = (e) => {
|
|
|
1069
1073
|
const R = c.find((U) => U.id === E.id) || E;
|
|
1070
1074
|
c = c.map((U) => U.id === E.id ? I : U), m("updateAnnotation", I, R);
|
|
1071
1075
|
});
|
|
1072
|
-
}, { origin: G.LOCAL }), r.observe((
|
|
1076
|
+
}, { origin: G.LOCAL }), r.observe((y) => {
|
|
1073
1077
|
if (c) {
|
|
1074
|
-
const
|
|
1078
|
+
const p = new Set(c.map((E) => E.id)), _ = (y.changes.updated || []).filter(({ newValue: E }) => p.has(E.id)).map(({ newValue: E }) => E);
|
|
1075
1079
|
_.length > 0 && (c = c.map((E) => _.find((R) => R.id === E.id) || E));
|
|
1076
1080
|
}
|
|
1077
1081
|
}, { origin: G.REMOTE });
|
|
1078
|
-
const
|
|
1079
|
-
const { updated: _ } =
|
|
1080
|
-
|
|
1082
|
+
const T = (y) => (p) => {
|
|
1083
|
+
const { updated: _ } = p;
|
|
1084
|
+
y ? (_ || []).forEach((E) => m("updateAnnotation", E.oldValue, E.newValue)) : (_ || []).forEach((E) => m("updateAnnotation", E.newValue, E.oldValue));
|
|
1081
1085
|
};
|
|
1082
|
-
return t.on("undo",
|
|
1083
|
-
},
|
|
1086
|
+
return t.on("undo", T(!0)), t.on("redo", T(!1)), { on: h, off: g, emit: m };
|
|
1087
|
+
}, uo = (e) => (t) => t.reduce((n, o) => {
|
|
1084
1088
|
const { parsed: i, error: s } = e.parse(o);
|
|
1085
1089
|
return s ? {
|
|
1086
1090
|
parsed: n.parsed,
|
|
@@ -1091,47 +1095,47 @@ const co = 250, fo = (e) => {
|
|
|
1091
1095
|
} : {
|
|
1092
1096
|
...n
|
|
1093
1097
|
};
|
|
1094
|
-
}, { parsed: [], failed: [] }),
|
|
1095
|
-
const { store: o, selection: i } = e, s = (
|
|
1098
|
+
}, { parsed: [], failed: [] }), ho = (e, t, n) => {
|
|
1099
|
+
const { store: o, selection: i } = e, s = (y) => {
|
|
1096
1100
|
if (n) {
|
|
1097
|
-
const { parsed:
|
|
1098
|
-
|
|
1101
|
+
const { parsed: p, error: _ } = n.parse(y);
|
|
1102
|
+
p ? o.addAnnotation(p, G.REMOTE) : console.error(_);
|
|
1099
1103
|
} else
|
|
1100
|
-
o.addAnnotation(
|
|
1101
|
-
}, r = () => i.clear(), l = () => o.clear(), a = (
|
|
1102
|
-
const
|
|
1103
|
-
return n &&
|
|
1104
|
-
}, c = () => n ? o.all().map(n.serialize) : o.all(),
|
|
1105
|
-
var
|
|
1106
|
-
const
|
|
1107
|
-
return n ?
|
|
1108
|
-
},
|
|
1109
|
-
if (typeof
|
|
1110
|
-
const
|
|
1111
|
-
if (o.deleteAnnotation(
|
|
1112
|
-
return n ? n.serialize(
|
|
1104
|
+
o.addAnnotation(ot(y), G.REMOTE);
|
|
1105
|
+
}, r = () => i.clear(), l = () => o.clear(), a = (y) => {
|
|
1106
|
+
const p = o.getAnnotation(y);
|
|
1107
|
+
return n && p ? n.serialize(p) : p;
|
|
1108
|
+
}, c = () => n ? o.all().map(n.serialize) : o.all(), u = () => {
|
|
1109
|
+
var y;
|
|
1110
|
+
const p = (((y = i.selected) == null ? void 0 : y.map((_) => _.id)) || []).map((_) => o.getAnnotation(_)).filter(Boolean);
|
|
1111
|
+
return n ? p.map(n.serialize) : p;
|
|
1112
|
+
}, f = (y, p = !0) => fetch(y).then((_) => _.json()).then((_) => (g(_, p), _)), h = (y) => {
|
|
1113
|
+
if (typeof y == "string") {
|
|
1114
|
+
const p = o.getAnnotation(y);
|
|
1115
|
+
if (o.deleteAnnotation(y), p)
|
|
1116
|
+
return n ? n.serialize(p) : p;
|
|
1113
1117
|
} else {
|
|
1114
|
-
const
|
|
1115
|
-
if (
|
|
1116
|
-
return o.deleteAnnotation(
|
|
1118
|
+
const p = n ? n.parse(y).parsed : y;
|
|
1119
|
+
if (p)
|
|
1120
|
+
return o.deleteAnnotation(p), y;
|
|
1117
1121
|
}
|
|
1118
|
-
}, g = (
|
|
1122
|
+
}, g = (y, p = !0) => {
|
|
1119
1123
|
if (n) {
|
|
1120
|
-
const _ = n.parseAll ||
|
|
1121
|
-
I.length > 0 && console.warn(`Discarded ${I.length} invalid annotations`, I), o.bulkAddAnnotation(E,
|
|
1124
|
+
const _ = n.parseAll || uo(n), { parsed: E, failed: I } = _(y);
|
|
1125
|
+
I.length > 0 && console.warn(`Discarded ${I.length} invalid annotations`, I), o.bulkAddAnnotation(E, p, G.REMOTE);
|
|
1122
1126
|
} else
|
|
1123
|
-
o.bulkAddAnnotation(
|
|
1124
|
-
}, m = (
|
|
1125
|
-
|
|
1126
|
-
},
|
|
1127
|
-
i.clear(), i.setUserSelectAction(
|
|
1128
|
-
},
|
|
1127
|
+
o.bulkAddAnnotation(y.map(ot), p, G.REMOTE);
|
|
1128
|
+
}, m = (y, p) => {
|
|
1129
|
+
y ? i.setSelected(y, p) : i.clear();
|
|
1130
|
+
}, w = (y) => {
|
|
1131
|
+
i.clear(), i.setUserSelectAction(y);
|
|
1132
|
+
}, T = (y) => {
|
|
1129
1133
|
if (n) {
|
|
1130
|
-
const
|
|
1131
|
-
return o.updateAnnotation(
|
|
1134
|
+
const p = n.parse(y).parsed, _ = n.serialize(o.getAnnotation(p.id));
|
|
1135
|
+
return o.updateAnnotation(p), _;
|
|
1132
1136
|
} else {
|
|
1133
|
-
const
|
|
1134
|
-
return o.updateAnnotation(
|
|
1137
|
+
const p = o.getAnnotation(y.id);
|
|
1138
|
+
return o.updateAnnotation(ot(y)), p;
|
|
1135
1139
|
}
|
|
1136
1140
|
};
|
|
1137
1141
|
return {
|
|
@@ -1142,17 +1146,17 @@ const co = 250, fo = (e) => {
|
|
|
1142
1146
|
clearAnnotations: l,
|
|
1143
1147
|
getAnnotationById: a,
|
|
1144
1148
|
getAnnotations: c,
|
|
1145
|
-
getSelected:
|
|
1146
|
-
loadAnnotations:
|
|
1149
|
+
getSelected: u,
|
|
1150
|
+
loadAnnotations: f,
|
|
1147
1151
|
redo: t.redo,
|
|
1148
1152
|
removeAnnotation: h,
|
|
1149
1153
|
setAnnotations: g,
|
|
1150
1154
|
setSelected: m,
|
|
1151
|
-
setUserSelectAction:
|
|
1155
|
+
setUserSelectAction: w,
|
|
1152
1156
|
undo: t.undo,
|
|
1153
|
-
updateAnnotation:
|
|
1157
|
+
updateAnnotation: T
|
|
1154
1158
|
};
|
|
1155
|
-
},
|
|
1159
|
+
}, Hi = (e, t, n) => typeof t == "function" ? t(e, n) : t, Fi = (e, t) => typeof e != "function" && typeof t != "function" ? {
|
|
1156
1160
|
...e || {},
|
|
1157
1161
|
...t || {}
|
|
1158
1162
|
} : (n, o) => {
|
|
@@ -1161,9 +1165,9 @@ const co = 250, fo = (e) => {
|
|
|
1161
1165
|
...i || {},
|
|
1162
1166
|
...s || {}
|
|
1163
1167
|
};
|
|
1164
|
-
},
|
|
1165
|
-
let
|
|
1166
|
-
let o = (2 << Math.
|
|
1168
|
+
}, go = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1169
|
+
let mo = (e) => crypto.getRandomValues(new Uint8Array(e)), po = (e, t, n) => {
|
|
1170
|
+
let o = (2 << Math.log2(e.length - 1)) - 1, i = -~(1.6 * o * t / e.length);
|
|
1167
1171
|
return (s = t) => {
|
|
1168
1172
|
let r = "";
|
|
1169
1173
|
for (; ; ) {
|
|
@@ -1172,13 +1176,13 @@ let yo = (e) => crypto.getRandomValues(new Uint8Array(e)), _o = (e, t, n) => {
|
|
|
1172
1176
|
if (r += e[l[a] & o] || "", r.length === s) return r;
|
|
1173
1177
|
}
|
|
1174
1178
|
};
|
|
1175
|
-
},
|
|
1179
|
+
}, yo = (e, t = 21) => po(e, t, mo), _o = (e = 21) => {
|
|
1176
1180
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e));
|
|
1177
1181
|
for (; e--; )
|
|
1178
|
-
t +=
|
|
1182
|
+
t += go[n[e] & 63];
|
|
1179
1183
|
return t;
|
|
1180
1184
|
};
|
|
1181
|
-
const
|
|
1185
|
+
const wo = () => ({ isGuest: !0, id: yo("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", 20)() }), bo = (e) => {
|
|
1182
1186
|
const t = JSON.stringify(e);
|
|
1183
1187
|
let n = 0;
|
|
1184
1188
|
for (let o = 0, i = t.length; o < i; o++) {
|
|
@@ -1186,20 +1190,20 @@ const Eo = () => ({ isGuest: !0, id: wo("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1186
1190
|
n = (n << 5) - n + s, n |= 0;
|
|
1187
1191
|
}
|
|
1188
1192
|
return `${n}`;
|
|
1189
|
-
},
|
|
1190
|
-
const { id: o, type: i, purpose: s, value: r, created: l, modified: a, creator: c, ...
|
|
1193
|
+
}, rn = (e) => e ? typeof e == "object" ? { ...e } : e : void 0, Eo = (e, t) => (Array.isArray(e) ? e : [e]).map((n) => {
|
|
1194
|
+
const { id: o, type: i, purpose: s, value: r, created: l, modified: a, creator: c, ...u } = n;
|
|
1191
1195
|
return {
|
|
1192
|
-
id: o || `temp-${
|
|
1196
|
+
id: o || `temp-${bo(n)}`,
|
|
1193
1197
|
annotation: t,
|
|
1194
1198
|
type: i,
|
|
1195
1199
|
purpose: s,
|
|
1196
1200
|
value: r,
|
|
1197
|
-
creator:
|
|
1201
|
+
creator: rn(c),
|
|
1198
1202
|
created: l ? new Date(l) : void 0,
|
|
1199
1203
|
updated: a ? new Date(a) : void 0,
|
|
1200
|
-
...
|
|
1204
|
+
...u
|
|
1201
1205
|
};
|
|
1202
|
-
}),
|
|
1206
|
+
}), Ao = (e) => e.map((t) => {
|
|
1203
1207
|
var n;
|
|
1204
1208
|
const { annotation: o, created: i, updated: s, ...r } = t, l = {
|
|
1205
1209
|
...r,
|
|
@@ -1207,7 +1211,7 @@ const Eo = () => ({ isGuest: !0, id: wo("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1207
1211
|
modified: s == null ? void 0 : s.toISOString()
|
|
1208
1212
|
};
|
|
1209
1213
|
return (n = l.id) != null && n.startsWith("temp-") && delete l.id, l;
|
|
1210
|
-
}),
|
|
1214
|
+
}), So = [
|
|
1211
1215
|
"#ff7c00",
|
|
1212
1216
|
// orange
|
|
1213
1217
|
"#1ac938",
|
|
@@ -1226,40 +1230,40 @@ const Eo = () => ({ isGuest: !0, id: wo("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1226
1230
|
// cyan
|
|
1227
1231
|
"#023eff"
|
|
1228
1232
|
// blue
|
|
1229
|
-
],
|
|
1230
|
-
const e = [...
|
|
1233
|
+
], Wi = () => {
|
|
1234
|
+
const e = [...So];
|
|
1231
1235
|
return { assignRandomColor: () => {
|
|
1232
1236
|
const t = Math.floor(Math.random() * e.length), n = e[t];
|
|
1233
1237
|
return e.splice(t, 1), n;
|
|
1234
1238
|
}, releaseColor: (t) => e.push(t) };
|
|
1235
1239
|
};
|
|
1236
|
-
|
|
1237
|
-
const
|
|
1238
|
-
const n = e.id ||
|
|
1240
|
+
_o();
|
|
1241
|
+
const qi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => To(i, t), serialize: (i) => vo(i, e, t) }), To = (e, t = { strict: !0, invertY: !1 }) => {
|
|
1242
|
+
const n = e.id || tn(), {
|
|
1239
1243
|
creator: o,
|
|
1240
1244
|
created: i,
|
|
1241
1245
|
modified: s,
|
|
1242
1246
|
body: r,
|
|
1243
1247
|
...l
|
|
1244
|
-
} = e, a =
|
|
1245
|
-
return
|
|
1248
|
+
} = e, a = Eo(r || [], n), c = Array.isArray(e.target) ? e.target[0] : e.target, u = Array.isArray(c.selector) ? c.selector[0] : c.selector, f = (u == null ? void 0 : u.type) === "FragmentSelector" ? Dn(u, t.invertY) : (u == null ? void 0 : u.type) === "SvgSelector" ? Nn(u) : void 0;
|
|
1249
|
+
return f || !t.strict ? {
|
|
1246
1250
|
parsed: {
|
|
1247
1251
|
...l,
|
|
1248
1252
|
id: n,
|
|
1249
1253
|
bodies: a,
|
|
1250
1254
|
target: {
|
|
1251
1255
|
created: i ? new Date(i) : void 0,
|
|
1252
|
-
creator:
|
|
1256
|
+
creator: rn(o),
|
|
1253
1257
|
updated: s ? new Date(s) : void 0,
|
|
1254
1258
|
...Array.isArray(l.target) ? l.target[0] : l.target,
|
|
1255
1259
|
annotation: n,
|
|
1256
|
-
selector:
|
|
1260
|
+
selector: f || u
|
|
1257
1261
|
}
|
|
1258
1262
|
}
|
|
1259
1263
|
} : {
|
|
1260
|
-
error: Error(`Invalid selector: ${JSON.stringify(
|
|
1264
|
+
error: Error(`Invalid selector: ${JSON.stringify(u)}`)
|
|
1261
1265
|
};
|
|
1262
|
-
},
|
|
1266
|
+
}, vo = (e, t, n = { strict: !0, invertY: !1 }) => {
|
|
1263
1267
|
const {
|
|
1264
1268
|
selector: o,
|
|
1265
1269
|
creator: i,
|
|
@@ -1271,18 +1275,18 @@ const Ji = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => Mo(i, t), se
|
|
|
1271
1275
|
} = e.target;
|
|
1272
1276
|
let c;
|
|
1273
1277
|
try {
|
|
1274
|
-
c = o.type == F.RECTANGLE ?
|
|
1275
|
-
} catch (
|
|
1278
|
+
c = o.type == F.RECTANGLE ? Yn(o.geometry) : Un(o);
|
|
1279
|
+
} catch (f) {
|
|
1276
1280
|
if (n.strict)
|
|
1277
|
-
throw
|
|
1281
|
+
throw f;
|
|
1278
1282
|
c = o;
|
|
1279
1283
|
}
|
|
1280
|
-
const
|
|
1284
|
+
const u = {
|
|
1281
1285
|
...e,
|
|
1282
1286
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1283
1287
|
id: e.id,
|
|
1284
1288
|
type: "Annotation",
|
|
1285
|
-
body:
|
|
1289
|
+
body: Ao(e.bodies),
|
|
1286
1290
|
created: s == null ? void 0 : s.toISOString(),
|
|
1287
1291
|
creator: i,
|
|
1288
1292
|
modified: r == null ? void 0 : r.toISOString(),
|
|
@@ -1292,15 +1296,15 @@ const Ji = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => Mo(i, t), se
|
|
|
1292
1296
|
selector: c
|
|
1293
1297
|
}
|
|
1294
1298
|
};
|
|
1295
|
-
return delete
|
|
1299
|
+
return delete u.bodies, "annotation" in u.target && delete u.target.annotation, u;
|
|
1296
1300
|
};
|
|
1297
|
-
function
|
|
1301
|
+
function Lt(e, t, n) {
|
|
1298
1302
|
const o = e.slice();
|
|
1299
1303
|
return o[10] = t[n], o[12] = n, o;
|
|
1300
1304
|
}
|
|
1301
|
-
function
|
|
1305
|
+
function kt(e) {
|
|
1302
1306
|
let t, n;
|
|
1303
|
-
return t = new
|
|
1307
|
+
return t = new Ye({
|
|
1304
1308
|
props: {
|
|
1305
1309
|
x: (
|
|
1306
1310
|
/*point*/
|
|
@@ -1341,7 +1345,7 @@ function Ot(e) {
|
|
|
1341
1345
|
e[3]), t.$set(s);
|
|
1342
1346
|
},
|
|
1343
1347
|
i(o) {
|
|
1344
|
-
n || (
|
|
1348
|
+
n || (Y(t.$$.fragment, o), n = !0);
|
|
1345
1349
|
},
|
|
1346
1350
|
o(o) {
|
|
1347
1351
|
C(t.$$.fragment, o), n = !1;
|
|
@@ -1351,36 +1355,36 @@ function Ot(e) {
|
|
|
1351
1355
|
}
|
|
1352
1356
|
};
|
|
1353
1357
|
}
|
|
1354
|
-
function
|
|
1355
|
-
let t, n, o, i, s, r, l, a, c,
|
|
1358
|
+
function Mo(e) {
|
|
1359
|
+
let t, n, o, i, s, r, l, a, c, u, f, h = Le(
|
|
1356
1360
|
/*geom*/
|
|
1357
1361
|
e[4].points
|
|
1358
1362
|
), g = [];
|
|
1359
|
-
for (let
|
|
1360
|
-
g[
|
|
1361
|
-
const m = (
|
|
1362
|
-
g[
|
|
1363
|
+
for (let w = 0; w < h.length; w += 1)
|
|
1364
|
+
g[w] = kt(Lt(e, h, w));
|
|
1365
|
+
const m = (w) => C(g[w], 1, 1, () => {
|
|
1366
|
+
g[w] = null;
|
|
1363
1367
|
});
|
|
1364
1368
|
return {
|
|
1365
1369
|
c() {
|
|
1366
1370
|
t = X("polygon"), i = ie(), s = X("polygon"), l = ie();
|
|
1367
|
-
for (let
|
|
1368
|
-
g[
|
|
1369
|
-
a = le(),
|
|
1370
|
-
e[1] ? "display:none;" : void 0),
|
|
1371
|
-
e[4].points.map(
|
|
1371
|
+
for (let w = 0; w < g.length; w += 1)
|
|
1372
|
+
g[w].c();
|
|
1373
|
+
a = le(), d(t, "class", "a9s-outer"), d(t, "style", n = /*computedStyle*/
|
|
1374
|
+
e[1] ? "display:none;" : void 0), d(t, "points", o = /*geom*/
|
|
1375
|
+
e[4].points.map(It).join(" ")), d(s, "class", "a9s-inner a9s-shape-handle"), d(
|
|
1372
1376
|
s,
|
|
1373
1377
|
"style",
|
|
1374
1378
|
/*computedStyle*/
|
|
1375
1379
|
e[1]
|
|
1376
|
-
),
|
|
1377
|
-
e[4].points.map(
|
|
1378
|
-
},
|
|
1379
|
-
m(
|
|
1380
|
-
B(
|
|
1381
|
-
for (let
|
|
1382
|
-
g[
|
|
1383
|
-
B(
|
|
1380
|
+
), d(s, "points", r = /*geom*/
|
|
1381
|
+
e[4].points.map(Ot).join(" "));
|
|
1382
|
+
},
|
|
1383
|
+
m(w, T) {
|
|
1384
|
+
B(w, t, T), B(w, i, T), B(w, s, T), B(w, l, T);
|
|
1385
|
+
for (let y = 0; y < g.length; y += 1)
|
|
1386
|
+
g[y] && g[y].m(w, T);
|
|
1387
|
+
B(w, a, T), c = !0, u || (f = [
|
|
1384
1388
|
H(t, "pointerdown", function() {
|
|
1385
1389
|
W(
|
|
1386
1390
|
/*grab*/
|
|
@@ -1393,58 +1397,58 @@ function ko(e) {
|
|
|
1393
1397
|
e[9]("SHAPE")
|
|
1394
1398
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1395
1399
|
})
|
|
1396
|
-
],
|
|
1400
|
+
], u = !0);
|
|
1397
1401
|
},
|
|
1398
|
-
p(
|
|
1399
|
-
if (e =
|
|
1402
|
+
p(w, T) {
|
|
1403
|
+
if (e = w, (!c || T & /*computedStyle*/
|
|
1400
1404
|
2 && n !== (n = /*computedStyle*/
|
|
1401
|
-
e[1] ? "display:none;" : void 0)) &&
|
|
1405
|
+
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!c || T & /*geom*/
|
|
1402
1406
|
16 && o !== (o = /*geom*/
|
|
1403
|
-
e[4].points.map(
|
|
1404
|
-
2) &&
|
|
1407
|
+
e[4].points.map(It).join(" "))) && d(t, "points", o), (!c || T & /*computedStyle*/
|
|
1408
|
+
2) && d(
|
|
1405
1409
|
s,
|
|
1406
1410
|
"style",
|
|
1407
1411
|
/*computedStyle*/
|
|
1408
1412
|
e[1]
|
|
1409
|
-
), (!c ||
|
|
1413
|
+
), (!c || T & /*geom*/
|
|
1410
1414
|
16 && r !== (r = /*geom*/
|
|
1411
|
-
e[4].points.map(
|
|
1415
|
+
e[4].points.map(Ot).join(" "))) && d(s, "points", r), T & /*geom, viewportScale, grab*/
|
|
1412
1416
|
536) {
|
|
1413
1417
|
h = Le(
|
|
1414
1418
|
/*geom*/
|
|
1415
1419
|
e[4].points
|
|
1416
1420
|
);
|
|
1417
|
-
let
|
|
1418
|
-
for (
|
|
1419
|
-
const
|
|
1420
|
-
g[
|
|
1421
|
+
let y;
|
|
1422
|
+
for (y = 0; y < h.length; y += 1) {
|
|
1423
|
+
const p = Lt(e, h, y);
|
|
1424
|
+
g[y] ? (g[y].p(p, T), Y(g[y], 1)) : (g[y] = kt(p), g[y].c(), Y(g[y], 1), g[y].m(a.parentNode, a));
|
|
1421
1425
|
}
|
|
1422
|
-
for (se(),
|
|
1423
|
-
m(
|
|
1426
|
+
for (se(), y = h.length; y < g.length; y += 1)
|
|
1427
|
+
m(y);
|
|
1424
1428
|
re();
|
|
1425
1429
|
}
|
|
1426
1430
|
},
|
|
1427
|
-
i(
|
|
1431
|
+
i(w) {
|
|
1428
1432
|
if (!c) {
|
|
1429
|
-
for (let
|
|
1430
|
-
|
|
1433
|
+
for (let T = 0; T < h.length; T += 1)
|
|
1434
|
+
Y(g[T]);
|
|
1431
1435
|
c = !0;
|
|
1432
1436
|
}
|
|
1433
1437
|
},
|
|
1434
|
-
o(
|
|
1438
|
+
o(w) {
|
|
1435
1439
|
g = g.filter(Boolean);
|
|
1436
|
-
for (let
|
|
1437
|
-
C(g[
|
|
1440
|
+
for (let T = 0; T < g.length; T += 1)
|
|
1441
|
+
C(g[T]);
|
|
1438
1442
|
c = !1;
|
|
1439
1443
|
},
|
|
1440
|
-
d(
|
|
1441
|
-
|
|
1444
|
+
d(w) {
|
|
1445
|
+
w && (O(t), O(i), O(s), O(l), O(a)), gt(g, w), u = !1, ge(f);
|
|
1442
1446
|
}
|
|
1443
1447
|
};
|
|
1444
1448
|
}
|
|
1445
|
-
function
|
|
1449
|
+
function Lo(e) {
|
|
1446
1450
|
let t, n;
|
|
1447
|
-
return t = new
|
|
1451
|
+
return t = new an({
|
|
1448
1452
|
props: {
|
|
1449
1453
|
shape: (
|
|
1450
1454
|
/*shape*/
|
|
@@ -1460,7 +1464,7 @@ function Io(e) {
|
|
|
1460
1464
|
),
|
|
1461
1465
|
$$slots: {
|
|
1462
1466
|
default: [
|
|
1463
|
-
|
|
1467
|
+
Mo,
|
|
1464
1468
|
({ grab: o }) => ({ 9: o }),
|
|
1465
1469
|
({ grab: o }) => o ? 512 : 0
|
|
1466
1470
|
]
|
|
@@ -1496,7 +1500,7 @@ function Io(e) {
|
|
|
1496
1500
|
8730 && (s.$$scope = { dirty: i, ctx: o }), t.$set(s);
|
|
1497
1501
|
},
|
|
1498
1502
|
i(o) {
|
|
1499
|
-
n || (
|
|
1503
|
+
n || (Y(t.$$.fragment, o), n = !0);
|
|
1500
1504
|
},
|
|
1501
1505
|
o(o) {
|
|
1502
1506
|
C(t.$$.fragment, o), n = !1;
|
|
@@ -1506,23 +1510,23 @@ function Io(e) {
|
|
|
1506
1510
|
}
|
|
1507
1511
|
};
|
|
1508
1512
|
}
|
|
1509
|
-
const
|
|
1510
|
-
function
|
|
1513
|
+
const It = (e) => e.join(","), Ot = (e) => e.join(",");
|
|
1514
|
+
function ko(e, t, n) {
|
|
1511
1515
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1512
1516
|
const a = (h, g, m) => {
|
|
1513
|
-
let
|
|
1514
|
-
const
|
|
1515
|
-
g === "SHAPE" ?
|
|
1516
|
-
const
|
|
1517
|
-
return { ...h, geometry: { points:
|
|
1517
|
+
let w;
|
|
1518
|
+
const T = h.geometry;
|
|
1519
|
+
g === "SHAPE" ? w = T.points.map(([p, _]) => [p + m[0], _ + m[1]]) : w = T.points.map(([p, _], E) => g === `HANDLE-${E}` ? [p + m[0], _ + m[1]] : [p, _]);
|
|
1520
|
+
const y = Ke(w);
|
|
1521
|
+
return { ...h, geometry: { points: w, bounds: y } };
|
|
1518
1522
|
};
|
|
1519
1523
|
function c(h) {
|
|
1520
1524
|
me.call(this, e, h);
|
|
1521
1525
|
}
|
|
1522
|
-
function
|
|
1526
|
+
function u(h) {
|
|
1523
1527
|
me.call(this, e, h);
|
|
1524
1528
|
}
|
|
1525
|
-
function
|
|
1529
|
+
function f(h) {
|
|
1526
1530
|
me.call(this, e, h);
|
|
1527
1531
|
}
|
|
1528
1532
|
return e.$$set = (h) => {
|
|
@@ -1538,13 +1542,13 @@ function Oo(e, t, n) {
|
|
|
1538
1542
|
o,
|
|
1539
1543
|
a,
|
|
1540
1544
|
c,
|
|
1541
|
-
|
|
1542
|
-
|
|
1545
|
+
u,
|
|
1546
|
+
f
|
|
1543
1547
|
];
|
|
1544
1548
|
}
|
|
1545
|
-
class
|
|
1549
|
+
class Io extends ne {
|
|
1546
1550
|
constructor(t) {
|
|
1547
|
-
super(), te(this, t,
|
|
1551
|
+
super(), te(this, t, ko, Lo, Q, {
|
|
1548
1552
|
shape: 0,
|
|
1549
1553
|
computedStyle: 1,
|
|
1550
1554
|
transform: 2,
|
|
@@ -1552,11 +1556,11 @@ class Bo extends ne {
|
|
|
1552
1556
|
});
|
|
1553
1557
|
}
|
|
1554
1558
|
}
|
|
1555
|
-
const
|
|
1559
|
+
const st = (e, t) => {
|
|
1556
1560
|
const n = Math.abs(t[0] - e[0]), o = Math.abs(t[1] - e[1]);
|
|
1557
1561
|
return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
|
|
1558
1562
|
}, Ae = [];
|
|
1559
|
-
function
|
|
1563
|
+
function Oo(e, t = j) {
|
|
1560
1564
|
let n;
|
|
1561
1565
|
const o = /* @__PURE__ */ new Set();
|
|
1562
1566
|
function i(l) {
|
|
@@ -1582,7 +1586,7 @@ function Do(e, t = j) {
|
|
|
1582
1586
|
}
|
|
1583
1587
|
return { set: i, update: s, subscribe: r };
|
|
1584
1588
|
}
|
|
1585
|
-
const
|
|
1589
|
+
const Bo = (e, t) => {
|
|
1586
1590
|
const { naturalWidth: n, naturalHeight: o } = e;
|
|
1587
1591
|
if (!n && !o) {
|
|
1588
1592
|
const { width: i, height: s } = e;
|
|
@@ -1592,9 +1596,9 @@ const Po = (e, t) => {
|
|
|
1592
1596
|
});
|
|
1593
1597
|
} else
|
|
1594
1598
|
t.setAttribute("viewBox", `0 0 ${n} ${o}`);
|
|
1595
|
-
},
|
|
1596
|
-
|
|
1597
|
-
const { subscribe: n, set: o } =
|
|
1599
|
+
}, Do = (e, t) => {
|
|
1600
|
+
Bo(e, t);
|
|
1601
|
+
const { subscribe: n, set: o } = Oo(1);
|
|
1598
1602
|
let i;
|
|
1599
1603
|
return window.ResizeObserver && (i = new ResizeObserver(() => {
|
|
1600
1604
|
const r = t.getBoundingClientRect(), { width: l, height: a } = t.viewBox.baseVal, c = Math.max(
|
|
@@ -1605,23 +1609,23 @@ const Po = (e, t) => {
|
|
|
1605
1609
|
}), i.observe(t.parentElement)), { destroy: () => {
|
|
1606
1610
|
i && i.disconnect();
|
|
1607
1611
|
}, subscribe: n };
|
|
1608
|
-
},
|
|
1612
|
+
}, Yo = typeof window > "u" || typeof navigator > "u" ? !1 : "ontouchstart" in window || navigator.maxTouchPoints > 0 || // @ts-ignore
|
|
1609
1613
|
navigator.msMaxTouchPoints > 0;
|
|
1610
|
-
function
|
|
1614
|
+
function Po(e) {
|
|
1611
1615
|
let t, n, o, i, s, r;
|
|
1612
1616
|
return {
|
|
1613
1617
|
c() {
|
|
1614
|
-
t = X("rect"),
|
|
1615
|
-
e[8].class || ""}`.trim()) + " svelte-1sgkh33"),
|
|
1618
|
+
t = X("rect"), d(t, "class", n = We(`a9s-handle ${/*$$props*/
|
|
1619
|
+
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), d(t, "x", o = /*x*/
|
|
1616
1620
|
e[0] - /*handleSize*/
|
|
1617
|
-
e[5] / 2),
|
|
1621
|
+
e[5] / 2), d(t, "y", i = /*y*/
|
|
1618
1622
|
e[1] - /*handleSize*/
|
|
1619
|
-
e[5] / 2),
|
|
1623
|
+
e[5] / 2), d(
|
|
1620
1624
|
t,
|
|
1621
1625
|
"width",
|
|
1622
1626
|
/*handleSize*/
|
|
1623
1627
|
e[5]
|
|
1624
|
-
),
|
|
1628
|
+
), d(
|
|
1625
1629
|
t,
|
|
1626
1630
|
"height",
|
|
1627
1631
|
/*handleSize*/
|
|
@@ -1638,21 +1642,21 @@ function Xo(e) {
|
|
|
1638
1642
|
},
|
|
1639
1643
|
p(l, a) {
|
|
1640
1644
|
a & /*$$props*/
|
|
1641
|
-
256 && n !== (n =
|
|
1642
|
-
l[8].class || ""}`.trim()) + " svelte-1sgkh33") &&
|
|
1645
|
+
256 && n !== (n = We(`a9s-handle ${/*$$props*/
|
|
1646
|
+
l[8].class || ""}`.trim()) + " svelte-1sgkh33") && d(t, "class", n), a & /*x, handleSize*/
|
|
1643
1647
|
33 && o !== (o = /*x*/
|
|
1644
1648
|
l[0] - /*handleSize*/
|
|
1645
|
-
l[5] / 2) &&
|
|
1649
|
+
l[5] / 2) && d(t, "x", o), a & /*y, handleSize*/
|
|
1646
1650
|
34 && i !== (i = /*y*/
|
|
1647
1651
|
l[1] - /*handleSize*/
|
|
1648
|
-
l[5] / 2) &&
|
|
1649
|
-
32 &&
|
|
1652
|
+
l[5] / 2) && d(t, "y", i), a & /*handleSize*/
|
|
1653
|
+
32 && d(
|
|
1650
1654
|
t,
|
|
1651
1655
|
"width",
|
|
1652
1656
|
/*handleSize*/
|
|
1653
1657
|
l[5]
|
|
1654
1658
|
), a & /*handleSize*/
|
|
1655
|
-
32 &&
|
|
1659
|
+
32 && d(
|
|
1656
1660
|
t,
|
|
1657
1661
|
"height",
|
|
1658
1662
|
/*handleSize*/
|
|
@@ -1664,46 +1668,46 @@ function Xo(e) {
|
|
|
1664
1668
|
}
|
|
1665
1669
|
};
|
|
1666
1670
|
}
|
|
1667
|
-
function
|
|
1671
|
+
function Co(e) {
|
|
1668
1672
|
let t, n, o, i, s, r, l, a, c;
|
|
1669
1673
|
return {
|
|
1670
1674
|
c() {
|
|
1671
|
-
t = X("g"), n = X("circle"), i = X("rect"),
|
|
1675
|
+
t = X("g"), n = X("circle"), i = X("rect"), d(
|
|
1672
1676
|
n,
|
|
1673
1677
|
"cx",
|
|
1674
1678
|
/*x*/
|
|
1675
1679
|
e[0]
|
|
1676
|
-
),
|
|
1680
|
+
), d(
|
|
1677
1681
|
n,
|
|
1678
1682
|
"cy",
|
|
1679
1683
|
/*y*/
|
|
1680
1684
|
e[1]
|
|
1681
|
-
),
|
|
1685
|
+
), d(n, "r", o = /*radius*/
|
|
1682
1686
|
e[3] / /*scale*/
|
|
1683
|
-
e[2]),
|
|
1687
|
+
e[2]), d(n, "class", "a9s-touch-halo svelte-1sgkh33"), pe(
|
|
1684
1688
|
n,
|
|
1685
1689
|
"touched",
|
|
1686
1690
|
/*touched*/
|
|
1687
1691
|
e[4]
|
|
1688
|
-
),
|
|
1689
|
-
e[8].class || ""}`.trim()) + " svelte-1sgkh33"),
|
|
1692
|
+
), d(i, "class", s = We(`a9s-handle ${/*$$props*/
|
|
1693
|
+
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), d(i, "x", r = /*x*/
|
|
1690
1694
|
e[0] - /*handleSize*/
|
|
1691
|
-
e[5] / 2),
|
|
1695
|
+
e[5] / 2), d(i, "y", l = /*y*/
|
|
1692
1696
|
e[1] - /*handleSize*/
|
|
1693
|
-
e[5] / 2),
|
|
1697
|
+
e[5] / 2), d(
|
|
1694
1698
|
i,
|
|
1695
1699
|
"width",
|
|
1696
1700
|
/*handleSize*/
|
|
1697
1701
|
e[5]
|
|
1698
|
-
),
|
|
1702
|
+
), d(
|
|
1699
1703
|
i,
|
|
1700
1704
|
"height",
|
|
1701
1705
|
/*handleSize*/
|
|
1702
1706
|
e[5]
|
|
1703
|
-
),
|
|
1707
|
+
), d(t, "class", "a9s-touch-handle");
|
|
1704
1708
|
},
|
|
1705
|
-
m(
|
|
1706
|
-
B(
|
|
1709
|
+
m(u, f) {
|
|
1710
|
+
B(u, t, f), he(t, n), he(t, i), a || (c = [
|
|
1707
1711
|
H(
|
|
1708
1712
|
n,
|
|
1709
1713
|
"pointerdown",
|
|
@@ -1742,59 +1746,59 @@ function Ro(e) {
|
|
|
1742
1746
|
)
|
|
1743
1747
|
], a = !0);
|
|
1744
1748
|
},
|
|
1745
|
-
p(
|
|
1746
|
-
|
|
1747
|
-
1 &&
|
|
1749
|
+
p(u, f) {
|
|
1750
|
+
f & /*x*/
|
|
1751
|
+
1 && d(
|
|
1748
1752
|
n,
|
|
1749
1753
|
"cx",
|
|
1750
1754
|
/*x*/
|
|
1751
|
-
|
|
1752
|
-
),
|
|
1753
|
-
2 &&
|
|
1755
|
+
u[0]
|
|
1756
|
+
), f & /*y*/
|
|
1757
|
+
2 && d(
|
|
1754
1758
|
n,
|
|
1755
1759
|
"cy",
|
|
1756
1760
|
/*y*/
|
|
1757
|
-
|
|
1758
|
-
),
|
|
1761
|
+
u[1]
|
|
1762
|
+
), f & /*radius, scale*/
|
|
1759
1763
|
12 && o !== (o = /*radius*/
|
|
1760
|
-
|
|
1761
|
-
|
|
1764
|
+
u[3] / /*scale*/
|
|
1765
|
+
u[2]) && d(n, "r", o), f & /*touched*/
|
|
1762
1766
|
16 && pe(
|
|
1763
1767
|
n,
|
|
1764
1768
|
"touched",
|
|
1765
1769
|
/*touched*/
|
|
1766
|
-
|
|
1767
|
-
),
|
|
1768
|
-
256 && s !== (s =
|
|
1769
|
-
|
|
1770
|
+
u[4]
|
|
1771
|
+
), f & /*$$props*/
|
|
1772
|
+
256 && s !== (s = We(`a9s-handle ${/*$$props*/
|
|
1773
|
+
u[8].class || ""}`.trim()) + " svelte-1sgkh33") && d(i, "class", s), f & /*x, handleSize*/
|
|
1770
1774
|
33 && r !== (r = /*x*/
|
|
1771
|
-
|
|
1772
|
-
|
|
1775
|
+
u[0] - /*handleSize*/
|
|
1776
|
+
u[5] / 2) && d(i, "x", r), f & /*y, handleSize*/
|
|
1773
1777
|
34 && l !== (l = /*y*/
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
32 &&
|
|
1778
|
+
u[1] - /*handleSize*/
|
|
1779
|
+
u[5] / 2) && d(i, "y", l), f & /*handleSize*/
|
|
1780
|
+
32 && d(
|
|
1777
1781
|
i,
|
|
1778
1782
|
"width",
|
|
1779
1783
|
/*handleSize*/
|
|
1780
|
-
|
|
1781
|
-
),
|
|
1782
|
-
32 &&
|
|
1784
|
+
u[5]
|
|
1785
|
+
), f & /*handleSize*/
|
|
1786
|
+
32 && d(
|
|
1783
1787
|
i,
|
|
1784
1788
|
"height",
|
|
1785
1789
|
/*handleSize*/
|
|
1786
|
-
|
|
1790
|
+
u[5]
|
|
1787
1791
|
);
|
|
1788
1792
|
},
|
|
1789
|
-
d(
|
|
1790
|
-
|
|
1793
|
+
d(u) {
|
|
1794
|
+
u && O(t), a = !1, ge(c);
|
|
1791
1795
|
}
|
|
1792
1796
|
};
|
|
1793
1797
|
}
|
|
1794
|
-
function
|
|
1798
|
+
function Xo(e) {
|
|
1795
1799
|
let t;
|
|
1796
1800
|
function n(s, r) {
|
|
1797
|
-
return
|
|
1801
|
+
return Yo ? Co : Po;
|
|
1798
1802
|
}
|
|
1799
1803
|
let i = n()(e);
|
|
1800
1804
|
return {
|
|
@@ -1814,12 +1818,12 @@ function No(e) {
|
|
|
1814
1818
|
}
|
|
1815
1819
|
};
|
|
1816
1820
|
}
|
|
1817
|
-
function
|
|
1821
|
+
function Ro(e, t, n) {
|
|
1818
1822
|
let o, { x: i } = t, { y: s } = t, { scale: r } = t, { radius: l = 30 } = t, a = !1;
|
|
1819
1823
|
const c = (m) => {
|
|
1820
1824
|
m.pointerType === "touch" && n(4, a = !0);
|
|
1821
|
-
},
|
|
1822
|
-
function
|
|
1825
|
+
}, u = () => n(4, a = !1);
|
|
1826
|
+
function f(m) {
|
|
1823
1827
|
me.call(this, e, m);
|
|
1824
1828
|
}
|
|
1825
1829
|
function h(m) {
|
|
@@ -1829,11 +1833,11 @@ function Uo(e, t, n) {
|
|
|
1829
1833
|
me.call(this, e, m);
|
|
1830
1834
|
}
|
|
1831
1835
|
return e.$$set = (m) => {
|
|
1832
|
-
n(8, t =
|
|
1836
|
+
n(8, t = ft(ft({}, t), bt(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);
|
|
1833
1837
|
}, e.$$.update = () => {
|
|
1834
1838
|
e.$$.dirty & /*scale*/
|
|
1835
1839
|
4 && n(5, o = 10 / r);
|
|
1836
|
-
}, t =
|
|
1840
|
+
}, t = bt(t), [
|
|
1837
1841
|
i,
|
|
1838
1842
|
s,
|
|
1839
1843
|
r,
|
|
@@ -1841,21 +1845,21 @@ function Uo(e, t, n) {
|
|
|
1841
1845
|
a,
|
|
1842
1846
|
o,
|
|
1843
1847
|
c,
|
|
1844
|
-
|
|
1848
|
+
u,
|
|
1845
1849
|
t,
|
|
1846
|
-
|
|
1850
|
+
f,
|
|
1847
1851
|
h,
|
|
1848
1852
|
g
|
|
1849
1853
|
];
|
|
1850
1854
|
}
|
|
1851
|
-
class
|
|
1855
|
+
class Ye extends ne {
|
|
1852
1856
|
constructor(t) {
|
|
1853
|
-
super(), te(this, t,
|
|
1857
|
+
super(), te(this, t, Ro, Xo, Q, { x: 0, y: 1, scale: 2, radius: 3 });
|
|
1854
1858
|
}
|
|
1855
1859
|
}
|
|
1856
|
-
function
|
|
1857
|
-
let t, n, o, i, s, r, l, a, c,
|
|
1858
|
-
return ae = new
|
|
1860
|
+
function No(e) {
|
|
1861
|
+
let t, n, o, i, s, r, l, a, c, u, f, h, g, m, w, T, y, p, _, E, I, R, U, V, Z, A, S, b, v, P, D, z, oe, ae, Ie, ce, Oe, fe, Be, ue, N, k, J;
|
|
1862
|
+
return ae = new Ye({
|
|
1859
1863
|
props: {
|
|
1860
1864
|
class: "a9s-corner-handle-topleft",
|
|
1861
1865
|
x: (
|
|
@@ -1876,7 +1880,7 @@ function Vo(e) {
|
|
|
1876
1880
|
/*grab*/
|
|
1877
1881
|
e[9]("TOP_LEFT")
|
|
1878
1882
|
) && e[9]("TOP_LEFT").apply(this, arguments);
|
|
1879
|
-
}), ce = new
|
|
1883
|
+
}), ce = new Ye({
|
|
1880
1884
|
props: {
|
|
1881
1885
|
class: "a9s-corner-handle-topright",
|
|
1882
1886
|
x: (
|
|
@@ -1898,7 +1902,7 @@ function Vo(e) {
|
|
|
1898
1902
|
/*grab*/
|
|
1899
1903
|
e[9]("TOP_RIGHT")
|
|
1900
1904
|
) && e[9]("TOP_RIGHT").apply(this, arguments);
|
|
1901
|
-
}),
|
|
1905
|
+
}), fe = new Ye({
|
|
1902
1906
|
props: {
|
|
1903
1907
|
class: "a9s-corner-handle-bottomright",
|
|
1904
1908
|
x: (
|
|
@@ -1916,12 +1920,12 @@ function Vo(e) {
|
|
|
1916
1920
|
e[3]
|
|
1917
1921
|
)
|
|
1918
1922
|
}
|
|
1919
|
-
}),
|
|
1923
|
+
}), fe.$on("pointerdown", function() {
|
|
1920
1924
|
W(
|
|
1921
1925
|
/*grab*/
|
|
1922
1926
|
e[9]("BOTTOM_RIGHT")
|
|
1923
1927
|
) && e[9]("BOTTOM_RIGHT").apply(this, arguments);
|
|
1924
|
-
}),
|
|
1928
|
+
}), ue = new Ye({
|
|
1925
1929
|
props: {
|
|
1926
1930
|
class: "a9s-corner-handle-bottomleft",
|
|
1927
1931
|
x: (
|
|
@@ -1938,45 +1942,45 @@ function Vo(e) {
|
|
|
1938
1942
|
e[3]
|
|
1939
1943
|
)
|
|
1940
1944
|
}
|
|
1941
|
-
}),
|
|
1945
|
+
}), ue.$on("pointerdown", function() {
|
|
1942
1946
|
W(
|
|
1943
1947
|
/*grab*/
|
|
1944
1948
|
e[9]("BOTTOM_LEFT")
|
|
1945
1949
|
) && e[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
1946
1950
|
}), {
|
|
1947
1951
|
c() {
|
|
1948
|
-
t = X("rect"), l = ie(), a = X("rect"), g = ie(), m = X("rect"),
|
|
1949
|
-
e[1] ? "display:none;" : void 0),
|
|
1950
|
-
e[4].x),
|
|
1951
|
-
e[4].y),
|
|
1952
|
-
e[4].w),
|
|
1953
|
-
e[4].h),
|
|
1952
|
+
t = X("rect"), l = ie(), a = X("rect"), g = ie(), m = X("rect"), p = ie(), _ = X("rect"), U = ie(), V = X("rect"), b = ie(), v = X("rect"), oe = ie(), ee(ae.$$.fragment), Ie = ie(), ee(ce.$$.fragment), Oe = ie(), ee(fe.$$.fragment), Be = ie(), ee(ue.$$.fragment), d(t, "class", "a9s-outer"), d(t, "style", n = /*computedStyle*/
|
|
1953
|
+
e[1] ? "display:none;" : void 0), d(t, "x", o = /*geom*/
|
|
1954
|
+
e[4].x), d(t, "y", i = /*geom*/
|
|
1955
|
+
e[4].y), d(t, "width", s = /*geom*/
|
|
1956
|
+
e[4].w), d(t, "height", r = /*geom*/
|
|
1957
|
+
e[4].h), d(a, "class", "a9s-inner a9s-shape-handle"), d(
|
|
1954
1958
|
a,
|
|
1955
1959
|
"style",
|
|
1956
1960
|
/*computedStyle*/
|
|
1957
1961
|
e[1]
|
|
1958
|
-
),
|
|
1959
|
-
e[4].x),
|
|
1960
|
-
e[4].y),
|
|
1961
|
-
e[4].w),
|
|
1962
|
-
e[4].h),
|
|
1963
|
-
e[4].x),
|
|
1964
|
-
e[4].y),
|
|
1965
|
-
e[4].w),
|
|
1962
|
+
), d(a, "x", c = /*geom*/
|
|
1963
|
+
e[4].x), d(a, "y", u = /*geom*/
|
|
1964
|
+
e[4].y), d(a, "width", f = /*geom*/
|
|
1965
|
+
e[4].w), d(a, "height", h = /*geom*/
|
|
1966
|
+
e[4].h), d(m, "class", "a9s-edge-handle a9s-edge-handle-top"), d(m, "x", w = /*geom*/
|
|
1967
|
+
e[4].x), d(m, "y", T = /*geom*/
|
|
1968
|
+
e[4].y), d(m, "height", 1), d(m, "width", y = /*geom*/
|
|
1969
|
+
e[4].w), d(_, "class", "a9s-edge-handle a9s-edge-handle-right"), d(_, "x", E = /*geom*/
|
|
1966
1970
|
e[4].x + /*geom*/
|
|
1967
|
-
e[4].w),
|
|
1968
|
-
e[4].y),
|
|
1969
|
-
e[4].h),
|
|
1970
|
-
e[4].x),
|
|
1971
|
+
e[4].w), d(_, "y", I = /*geom*/
|
|
1972
|
+
e[4].y), d(_, "height", R = /*geom*/
|
|
1973
|
+
e[4].h), d(_, "width", 1), d(V, "class", "a9s-edge-handle a9s-edge-handle-bottom"), d(V, "x", Z = /*geom*/
|
|
1974
|
+
e[4].x), d(V, "y", A = /*geom*/
|
|
1971
1975
|
e[4].y + /*geom*/
|
|
1972
|
-
e[4].h),
|
|
1973
|
-
e[4].w),
|
|
1974
|
-
e[4].x),
|
|
1975
|
-
e[4].y),
|
|
1976
|
-
e[4].h),
|
|
1976
|
+
e[4].h), d(V, "height", 1), d(V, "width", S = /*geom*/
|
|
1977
|
+
e[4].w), d(v, "class", "a9s-edge-handle a9s-edge-handle-left"), d(v, "x", P = /*geom*/
|
|
1978
|
+
e[4].x), d(v, "y", D = /*geom*/
|
|
1979
|
+
e[4].y), d(v, "height", z = /*geom*/
|
|
1980
|
+
e[4].h), d(v, "width", 1);
|
|
1977
1981
|
},
|
|
1978
1982
|
m(L, M) {
|
|
1979
|
-
B(L, t, M), B(L, l, M), B(L, a, M), B(L, g, M), B(L, m, M), B(L,
|
|
1983
|
+
B(L, t, M), B(L, l, M), B(L, a, M), B(L, g, M), B(L, m, M), B(L, p, M), B(L, _, M), B(L, U, M), B(L, V, M), B(L, b, M), B(L, v, M), B(L, oe, M), x(ae, L, M), B(L, Ie, M), x(ce, L, M), B(L, Oe, M), x(fe, L, M), B(L, Be, M), x(ue, L, M), N = !0, k || (J = [
|
|
1980
1984
|
H(t, "pointerdown", function() {
|
|
1981
1985
|
W(
|
|
1982
1986
|
/*grab*/
|
|
@@ -2007,7 +2011,7 @@ function Vo(e) {
|
|
|
2007
2011
|
e[9]("BOTTOM")
|
|
2008
2012
|
) && e[9]("BOTTOM").apply(this, arguments);
|
|
2009
2013
|
}),
|
|
2010
|
-
H(
|
|
2014
|
+
H(v, "pointerdown", function() {
|
|
2011
2015
|
W(
|
|
2012
2016
|
/*grab*/
|
|
2013
2017
|
e[9]("LEFT")
|
|
@@ -2018,63 +2022,63 @@ function Vo(e) {
|
|
|
2018
2022
|
p(L, M) {
|
|
2019
2023
|
e = L, (!N || M & /*computedStyle*/
|
|
2020
2024
|
2 && n !== (n = /*computedStyle*/
|
|
2021
|
-
e[1] ? "display:none;" : void 0)) &&
|
|
2025
|
+
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!N || M & /*geom*/
|
|
2022
2026
|
16 && o !== (o = /*geom*/
|
|
2023
|
-
e[4].x)) &&
|
|
2027
|
+
e[4].x)) && d(t, "x", o), (!N || M & /*geom*/
|
|
2024
2028
|
16 && i !== (i = /*geom*/
|
|
2025
|
-
e[4].y)) &&
|
|
2029
|
+
e[4].y)) && d(t, "y", i), (!N || M & /*geom*/
|
|
2026
2030
|
16 && s !== (s = /*geom*/
|
|
2027
|
-
e[4].w)) &&
|
|
2031
|
+
e[4].w)) && d(t, "width", s), (!N || M & /*geom*/
|
|
2028
2032
|
16 && r !== (r = /*geom*/
|
|
2029
|
-
e[4].h)) &&
|
|
2030
|
-
2) &&
|
|
2033
|
+
e[4].h)) && d(t, "height", r), (!N || M & /*computedStyle*/
|
|
2034
|
+
2) && d(
|
|
2031
2035
|
a,
|
|
2032
2036
|
"style",
|
|
2033
2037
|
/*computedStyle*/
|
|
2034
2038
|
e[1]
|
|
2035
2039
|
), (!N || M & /*geom*/
|
|
2036
2040
|
16 && c !== (c = /*geom*/
|
|
2037
|
-
e[4].x)) &&
|
|
2041
|
+
e[4].x)) && d(a, "x", c), (!N || M & /*geom*/
|
|
2042
|
+
16 && u !== (u = /*geom*/
|
|
2043
|
+
e[4].y)) && d(a, "y", u), (!N || M & /*geom*/
|
|
2038
2044
|
16 && f !== (f = /*geom*/
|
|
2039
|
-
e[4].
|
|
2040
|
-
16 && d !== (d = /*geom*/
|
|
2041
|
-
e[4].w)) && u(a, "width", d), (!N || M & /*geom*/
|
|
2045
|
+
e[4].w)) && d(a, "width", f), (!N || M & /*geom*/
|
|
2042
2046
|
16 && h !== (h = /*geom*/
|
|
2043
|
-
e[4].h)) &&
|
|
2047
|
+
e[4].h)) && d(a, "height", h), (!N || M & /*geom*/
|
|
2048
|
+
16 && w !== (w = /*geom*/
|
|
2049
|
+
e[4].x)) && d(m, "x", w), (!N || M & /*geom*/
|
|
2050
|
+
16 && T !== (T = /*geom*/
|
|
2051
|
+
e[4].y)) && d(m, "y", T), (!N || M & /*geom*/
|
|
2044
2052
|
16 && y !== (y = /*geom*/
|
|
2045
|
-
e[4].
|
|
2046
|
-
16 && v !== (v = /*geom*/
|
|
2047
|
-
e[4].y)) && u(m, "y", v), (!N || M & /*geom*/
|
|
2048
|
-
16 && p !== (p = /*geom*/
|
|
2049
|
-
e[4].w)) && u(m, "width", p), (!N || M & /*geom*/
|
|
2053
|
+
e[4].w)) && d(m, "width", y), (!N || M & /*geom*/
|
|
2050
2054
|
16 && E !== (E = /*geom*/
|
|
2051
2055
|
e[4].x + /*geom*/
|
|
2052
|
-
e[4].w)) &&
|
|
2056
|
+
e[4].w)) && d(_, "x", E), (!N || M & /*geom*/
|
|
2053
2057
|
16 && I !== (I = /*geom*/
|
|
2054
|
-
e[4].y)) &&
|
|
2058
|
+
e[4].y)) && d(_, "y", I), (!N || M & /*geom*/
|
|
2055
2059
|
16 && R !== (R = /*geom*/
|
|
2056
|
-
e[4].h)) &&
|
|
2060
|
+
e[4].h)) && d(_, "height", R), (!N || M & /*geom*/
|
|
2057
2061
|
16 && Z !== (Z = /*geom*/
|
|
2058
|
-
e[4].x)) &&
|
|
2062
|
+
e[4].x)) && d(V, "x", Z), (!N || M & /*geom*/
|
|
2059
2063
|
16 && A !== (A = /*geom*/
|
|
2060
2064
|
e[4].y + /*geom*/
|
|
2061
|
-
e[4].h)) &&
|
|
2065
|
+
e[4].h)) && d(V, "y", A), (!N || M & /*geom*/
|
|
2062
2066
|
16 && S !== (S = /*geom*/
|
|
2063
|
-
e[4].w)) &&
|
|
2064
|
-
16 &&
|
|
2065
|
-
e[4].x)) &&
|
|
2067
|
+
e[4].w)) && d(V, "width", S), (!N || M & /*geom*/
|
|
2068
|
+
16 && P !== (P = /*geom*/
|
|
2069
|
+
e[4].x)) && d(v, "x", P), (!N || M & /*geom*/
|
|
2066
2070
|
16 && D !== (D = /*geom*/
|
|
2067
|
-
e[4].y)) &&
|
|
2071
|
+
e[4].y)) && d(v, "y", D), (!N || M & /*geom*/
|
|
2068
2072
|
16 && z !== (z = /*geom*/
|
|
2069
|
-
e[4].h)) &&
|
|
2070
|
-
const
|
|
2073
|
+
e[4].h)) && d(v, "height", z);
|
|
2074
|
+
const de = {};
|
|
2071
2075
|
M & /*geom*/
|
|
2072
|
-
16 && (
|
|
2076
|
+
16 && (de.x = /*geom*/
|
|
2073
2077
|
e[4].x), M & /*geom*/
|
|
2074
|
-
16 && (
|
|
2078
|
+
16 && (de.y = /*geom*/
|
|
2075
2079
|
e[4].y), M & /*viewportScale*/
|
|
2076
|
-
8 && (
|
|
2077
|
-
e[3]), ae.$set(
|
|
2080
|
+
8 && (de.scale = /*viewportScale*/
|
|
2081
|
+
e[3]), ae.$set(de);
|
|
2078
2082
|
const _e = {};
|
|
2079
2083
|
M & /*geom*/
|
|
2080
2084
|
16 && (_e.x = /*geom*/
|
|
@@ -2093,7 +2097,7 @@ function Vo(e) {
|
|
|
2093
2097
|
e[4].y + /*geom*/
|
|
2094
2098
|
e[4].h), M & /*viewportScale*/
|
|
2095
2099
|
8 && (Ue.scale = /*viewportScale*/
|
|
2096
|
-
e[3]),
|
|
2100
|
+
e[3]), fe.$set(Ue);
|
|
2097
2101
|
const Ve = {};
|
|
2098
2102
|
M & /*geom*/
|
|
2099
2103
|
16 && (Ve.x = /*geom*/
|
|
@@ -2102,22 +2106,22 @@ function Vo(e) {
|
|
|
2102
2106
|
e[4].y + /*geom*/
|
|
2103
2107
|
e[4].h), M & /*viewportScale*/
|
|
2104
2108
|
8 && (Ve.scale = /*viewportScale*/
|
|
2105
|
-
e[3]),
|
|
2109
|
+
e[3]), ue.$set(Ve);
|
|
2106
2110
|
},
|
|
2107
2111
|
i(L) {
|
|
2108
|
-
N || (
|
|
2112
|
+
N || (Y(ae.$$.fragment, L), Y(ce.$$.fragment, L), Y(fe.$$.fragment, L), Y(ue.$$.fragment, L), N = !0);
|
|
2109
2113
|
},
|
|
2110
2114
|
o(L) {
|
|
2111
|
-
C(ae.$$.fragment, L), C(ce.$$.fragment, L), C(
|
|
2115
|
+
C(ae.$$.fragment, L), C(ce.$$.fragment, L), C(fe.$$.fragment, L), C(ue.$$.fragment, L), N = !1;
|
|
2112
2116
|
},
|
|
2113
2117
|
d(L) {
|
|
2114
|
-
L && (O(t), O(l), O(a), O(g), O(m), O(
|
|
2118
|
+
L && (O(t), O(l), O(a), O(g), O(m), O(p), O(_), O(U), O(V), O(b), O(v), O(oe), O(Ie), O(Oe), O(Be)), $(ae, L), $(ce, L), $(fe, L), $(ue, L), k = !1, ge(J);
|
|
2115
2119
|
}
|
|
2116
2120
|
};
|
|
2117
2121
|
}
|
|
2118
|
-
function
|
|
2122
|
+
function Uo(e) {
|
|
2119
2123
|
let t, n;
|
|
2120
|
-
return t = new
|
|
2124
|
+
return t = new an({
|
|
2121
2125
|
props: {
|
|
2122
2126
|
shape: (
|
|
2123
2127
|
/*shape*/
|
|
@@ -2133,7 +2137,7 @@ function Go(e) {
|
|
|
2133
2137
|
),
|
|
2134
2138
|
$$slots: {
|
|
2135
2139
|
default: [
|
|
2136
|
-
|
|
2140
|
+
No,
|
|
2137
2141
|
({ grab: o }) => ({ 9: o }),
|
|
2138
2142
|
({ grab: o }) => o ? 512 : 0
|
|
2139
2143
|
]
|
|
@@ -2169,7 +2173,7 @@ function Go(e) {
|
|
|
2169
2173
|
1562 && (s.$$scope = { dirty: i, ctx: o }), t.$set(s);
|
|
2170
2174
|
},
|
|
2171
2175
|
i(o) {
|
|
2172
|
-
n || (
|
|
2176
|
+
n || (Y(t.$$.fragment, o), n = !0);
|
|
2173
2177
|
},
|
|
2174
2178
|
o(o) {
|
|
2175
2179
|
C(t.$$.fragment, o), n = !1;
|
|
@@ -2179,20 +2183,20 @@ function Go(e) {
|
|
|
2179
2183
|
}
|
|
2180
2184
|
};
|
|
2181
2185
|
}
|
|
2182
|
-
function
|
|
2186
|
+
function Vo(e, t, n) {
|
|
2183
2187
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
2184
2188
|
const a = (h, g, m) => {
|
|
2185
|
-
const
|
|
2186
|
-
let [
|
|
2189
|
+
const w = h.geometry.bounds;
|
|
2190
|
+
let [T, y] = [w.minX, w.minY], [p, _] = [w.maxX, w.maxY];
|
|
2187
2191
|
const [E, I] = m;
|
|
2188
2192
|
if (g === "SHAPE")
|
|
2189
|
-
|
|
2193
|
+
T += E, p += E, y += I, _ += I;
|
|
2190
2194
|
else {
|
|
2191
2195
|
switch (g) {
|
|
2192
2196
|
case "TOP":
|
|
2193
2197
|
case "TOP_LEFT":
|
|
2194
2198
|
case "TOP_RIGHT": {
|
|
2195
|
-
|
|
2199
|
+
y += I;
|
|
2196
2200
|
break;
|
|
2197
2201
|
}
|
|
2198
2202
|
case "BOTTOM":
|
|
@@ -2206,18 +2210,18 @@ function jo(e, t, n) {
|
|
|
2206
2210
|
case "LEFT":
|
|
2207
2211
|
case "TOP_LEFT":
|
|
2208
2212
|
case "BOTTOM_LEFT": {
|
|
2209
|
-
|
|
2213
|
+
T += E;
|
|
2210
2214
|
break;
|
|
2211
2215
|
}
|
|
2212
2216
|
case "RIGHT":
|
|
2213
2217
|
case "TOP_RIGHT":
|
|
2214
2218
|
case "BOTTOM_RIGHT": {
|
|
2215
|
-
|
|
2219
|
+
p += E;
|
|
2216
2220
|
break;
|
|
2217
2221
|
}
|
|
2218
2222
|
}
|
|
2219
2223
|
}
|
|
2220
|
-
const R = Math.min(
|
|
2224
|
+
const R = Math.min(T, p), U = Math.min(y, _), V = Math.abs(p - T), Z = Math.abs(_ - y);
|
|
2221
2225
|
return {
|
|
2222
2226
|
...h,
|
|
2223
2227
|
geometry: {
|
|
@@ -2237,10 +2241,10 @@ function jo(e, t, n) {
|
|
|
2237
2241
|
function c(h) {
|
|
2238
2242
|
me.call(this, e, h);
|
|
2239
2243
|
}
|
|
2240
|
-
function
|
|
2244
|
+
function u(h) {
|
|
2241
2245
|
me.call(this, e, h);
|
|
2242
2246
|
}
|
|
2243
|
-
function
|
|
2247
|
+
function f(h) {
|
|
2244
2248
|
me.call(this, e, h);
|
|
2245
2249
|
}
|
|
2246
2250
|
return e.$$set = (h) => {
|
|
@@ -2256,13 +2260,13 @@ function jo(e, t, n) {
|
|
|
2256
2260
|
o,
|
|
2257
2261
|
a,
|
|
2258
2262
|
c,
|
|
2259
|
-
|
|
2260
|
-
|
|
2263
|
+
u,
|
|
2264
|
+
f
|
|
2261
2265
|
];
|
|
2262
2266
|
}
|
|
2263
|
-
class
|
|
2267
|
+
class Go extends ne {
|
|
2264
2268
|
constructor(t) {
|
|
2265
|
-
super(), te(this, t,
|
|
2269
|
+
super(), te(this, t, Vo, Uo, Q, {
|
|
2266
2270
|
shape: 0,
|
|
2267
2271
|
computedStyle: 1,
|
|
2268
2272
|
transform: 2,
|
|
@@ -2270,28 +2274,28 @@ class zo extends ne {
|
|
|
2270
2274
|
});
|
|
2271
2275
|
}
|
|
2272
2276
|
}
|
|
2273
|
-
const
|
|
2274
|
-
[F.RECTANGLE,
|
|
2275
|
-
[F.POLYGON,
|
|
2276
|
-
]),
|
|
2277
|
+
const ln = /* @__PURE__ */ new Map([
|
|
2278
|
+
[F.RECTANGLE, Go],
|
|
2279
|
+
[F.POLYGON, Io]
|
|
2280
|
+
]), jo = (e) => ln.get(e.type), zo = (e, t) => ln.set(e, t), Ho = (e) => ({}), Bt = (e) => ({ grab: (
|
|
2277
2281
|
/*onGrab*/
|
|
2278
2282
|
e[0]
|
|
2279
2283
|
) });
|
|
2280
|
-
function
|
|
2284
|
+
function Fo(e) {
|
|
2281
2285
|
let t, n, o, i;
|
|
2282
2286
|
const s = (
|
|
2283
2287
|
/*#slots*/
|
|
2284
2288
|
e[7].default
|
|
2285
|
-
), r =
|
|
2289
|
+
), r = pn(
|
|
2286
2290
|
s,
|
|
2287
2291
|
e,
|
|
2288
2292
|
/*$$scope*/
|
|
2289
2293
|
e[6],
|
|
2290
|
-
|
|
2294
|
+
Bt
|
|
2291
2295
|
);
|
|
2292
2296
|
return {
|
|
2293
2297
|
c() {
|
|
2294
|
-
t = X("g"), r && r.c(),
|
|
2298
|
+
t = X("g"), r && r.c(), d(t, "class", "a9s-annotation selected");
|
|
2295
2299
|
},
|
|
2296
2300
|
m(l, a) {
|
|
2297
2301
|
B(l, t, a), r && r.m(t, null), n = !0, o || (i = [
|
|
@@ -2311,27 +2315,27 @@ function qo(e) {
|
|
|
2311
2315
|
},
|
|
2312
2316
|
p(l, [a]) {
|
|
2313
2317
|
r && r.p && (!n || a & /*$$scope*/
|
|
2314
|
-
64) &&
|
|
2318
|
+
64) && _n(
|
|
2315
2319
|
r,
|
|
2316
2320
|
s,
|
|
2317
2321
|
l,
|
|
2318
2322
|
/*$$scope*/
|
|
2319
2323
|
l[6],
|
|
2320
|
-
n ?
|
|
2324
|
+
n ? yn(
|
|
2321
2325
|
s,
|
|
2322
2326
|
/*$$scope*/
|
|
2323
2327
|
l[6],
|
|
2324
2328
|
a,
|
|
2325
|
-
|
|
2326
|
-
) :
|
|
2329
|
+
Ho
|
|
2330
|
+
) : wn(
|
|
2327
2331
|
/*$$scope*/
|
|
2328
2332
|
l[6]
|
|
2329
2333
|
),
|
|
2330
|
-
|
|
2334
|
+
Bt
|
|
2331
2335
|
);
|
|
2332
2336
|
},
|
|
2333
2337
|
i(l) {
|
|
2334
|
-
n || (
|
|
2338
|
+
n || (Y(r, l), n = !0);
|
|
2335
2339
|
},
|
|
2336
2340
|
o(l) {
|
|
2337
2341
|
C(r, l), n = !1;
|
|
@@ -2341,30 +2345,30 @@ function qo(e) {
|
|
|
2341
2345
|
}
|
|
2342
2346
|
};
|
|
2343
2347
|
}
|
|
2344
|
-
function
|
|
2348
|
+
function Wo(e, t, n) {
|
|
2345
2349
|
let { $$slots: o = {}, $$scope: i } = t;
|
|
2346
2350
|
const s = ke();
|
|
2347
|
-
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c,
|
|
2348
|
-
const h = (
|
|
2349
|
-
c =
|
|
2350
|
-
}, g = (
|
|
2351
|
+
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c, u, f;
|
|
2352
|
+
const h = (w) => (T) => {
|
|
2353
|
+
c = w, u = a.elementToImage(T.offsetX, T.offsetY), f = r, T.target.setPointerCapture(T.pointerId), s("grab", T);
|
|
2354
|
+
}, g = (w) => {
|
|
2351
2355
|
if (c) {
|
|
2352
|
-
const [
|
|
2353
|
-
n(3, r = l(
|
|
2356
|
+
const [T, y] = a.elementToImage(w.offsetX, w.offsetY), p = [T - u[0], y - u[1]];
|
|
2357
|
+
n(3, r = l(f, c, p)), s("change", r);
|
|
2354
2358
|
}
|
|
2355
|
-
}, m = (
|
|
2356
|
-
|
|
2359
|
+
}, m = (w) => {
|
|
2360
|
+
w.target.releasePointerCapture(w.pointerId), c = void 0, f = r, s("release", w);
|
|
2357
2361
|
};
|
|
2358
|
-
return e.$$set = (
|
|
2359
|
-
"shape" in
|
|
2362
|
+
return e.$$set = (w) => {
|
|
2363
|
+
"shape" in w && n(3, r = w.shape), "editor" in w && n(4, l = w.editor), "transform" in w && n(5, a = w.transform), "$$scope" in w && n(6, i = w.$$scope);
|
|
2360
2364
|
}, [h, g, m, r, l, a, i, o];
|
|
2361
2365
|
}
|
|
2362
|
-
class
|
|
2366
|
+
class an extends ne {
|
|
2363
2367
|
constructor(t) {
|
|
2364
|
-
super(), te(this, t,
|
|
2368
|
+
super(), te(this, t, Wo, Fo, Q, { shape: 3, editor: 4, transform: 5 });
|
|
2365
2369
|
}
|
|
2366
2370
|
}
|
|
2367
|
-
const
|
|
2371
|
+
const Qe = (e, t) => {
|
|
2368
2372
|
const n = typeof t == "function" ? t(e) : t;
|
|
2369
2373
|
if (n) {
|
|
2370
2374
|
const { fill: o, fillOpacity: i, stroke: s, strokeWidth: r, strokeOpacity: l } = n;
|
|
@@ -2372,45 +2376,45 @@ const xe = (e, t) => {
|
|
|
2372
2376
|
return o && (a += `fill:${o};`, a += `fill-opacity:${i || "0.25"};`), s && (a += `stroke:${s};`, a += `stroke-width:${r || "1"};`, a += `stroke-opacity:${l || "1"};`), a;
|
|
2373
2377
|
}
|
|
2374
2378
|
};
|
|
2375
|
-
function
|
|
2379
|
+
function qo(e, t, n) {
|
|
2376
2380
|
let o;
|
|
2377
2381
|
const i = ke();
|
|
2378
|
-
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale:
|
|
2379
|
-
return Ne(() => (n(6,
|
|
2382
|
+
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale: u } = t, f;
|
|
2383
|
+
return Ne(() => (n(6, f = new r({
|
|
2380
2384
|
target: a,
|
|
2381
2385
|
props: {
|
|
2382
2386
|
shape: s.target.selector,
|
|
2383
2387
|
computedStyle: o,
|
|
2384
2388
|
transform: c,
|
|
2385
|
-
viewportScale:
|
|
2389
|
+
viewportScale: u
|
|
2386
2390
|
}
|
|
2387
|
-
})),
|
|
2388
|
-
|
|
2389
|
-
}),
|
|
2390
|
-
|
|
2391
|
+
})), f.$on("change", (h) => {
|
|
2392
|
+
f.$$set({ shape: h.detail }), i("change", h.detail);
|
|
2393
|
+
}), f.$on("grab", (h) => i("grab", h.detail)), f.$on("release", (h) => i("release", h.detail)), () => {
|
|
2394
|
+
f.$destroy();
|
|
2391
2395
|
})), e.$$set = (h) => {
|
|
2392
|
-
"annotation" in h && n(0, s = h.annotation), "editor" in h && n(1, r = h.editor), "style" in h && n(2, l = h.style), "target" in h && n(3, a = h.target), "transform" in h && n(4, c = h.transform), "viewportScale" in h && n(5,
|
|
2396
|
+
"annotation" in h && n(0, s = h.annotation), "editor" in h && n(1, r = h.editor), "style" in h && n(2, l = h.style), "target" in h && n(3, a = h.target), "transform" in h && n(4, c = h.transform), "viewportScale" in h && n(5, u = h.viewportScale);
|
|
2393
2397
|
}, e.$$.update = () => {
|
|
2394
2398
|
e.$$.dirty & /*annotation, style*/
|
|
2395
|
-
5 && n(7, o =
|
|
2396
|
-
65 && s && (
|
|
2397
|
-
80 &&
|
|
2398
|
-
96 &&
|
|
2399
|
-
192 &&
|
|
2399
|
+
5 && n(7, o = Qe(s, l)), e.$$.dirty & /*annotation, editorComponent*/
|
|
2400
|
+
65 && s && (f == null || f.$set({ shape: s.target.selector })), e.$$.dirty & /*editorComponent, transform*/
|
|
2401
|
+
80 && f && f.$set({ transform: c }), e.$$.dirty & /*editorComponent, viewportScale*/
|
|
2402
|
+
96 && f && f.$set({ viewportScale: u }), e.$$.dirty & /*editorComponent, computedStyle*/
|
|
2403
|
+
192 && f && o && f.$set({ computedStyle: o });
|
|
2400
2404
|
}, [
|
|
2401
2405
|
s,
|
|
2402
2406
|
r,
|
|
2403
2407
|
l,
|
|
2404
2408
|
a,
|
|
2405
2409
|
c,
|
|
2410
|
+
u,
|
|
2406
2411
|
f,
|
|
2407
|
-
d,
|
|
2408
2412
|
o
|
|
2409
2413
|
];
|
|
2410
2414
|
}
|
|
2411
|
-
class
|
|
2415
|
+
class Ko extends ne {
|
|
2412
2416
|
constructor(t) {
|
|
2413
|
-
super(), te(this, t,
|
|
2417
|
+
super(), te(this, t, qo, null, Q, {
|
|
2414
2418
|
annotation: 0,
|
|
2415
2419
|
editor: 1,
|
|
2416
2420
|
style: 2,
|
|
@@ -2420,12 +2424,12 @@ class Qo extends ne {
|
|
|
2420
2424
|
});
|
|
2421
2425
|
}
|
|
2422
2426
|
}
|
|
2423
|
-
function
|
|
2427
|
+
function Jo(e, t, n) {
|
|
2424
2428
|
const o = ke();
|
|
2425
2429
|
let { drawingMode: i } = t, { target: s } = t, { tool: r } = t, { transform: l } = t, { viewportScale: a } = t, c;
|
|
2426
2430
|
return Ne(() => {
|
|
2427
|
-
const
|
|
2428
|
-
|
|
2431
|
+
const u = s.closest("svg"), f = [], h = (g, m, w) => {
|
|
2432
|
+
u == null || u.addEventListener(g, m, w), f.push(() => u == null ? void 0 : u.removeEventListener(g, m, w));
|
|
2429
2433
|
};
|
|
2430
2434
|
return n(5, c = new r({
|
|
2431
2435
|
target: s,
|
|
@@ -2436,19 +2440,19 @@ function Zo(e, t, n) {
|
|
|
2436
2440
|
viewportScale: a
|
|
2437
2441
|
}
|
|
2438
2442
|
})), c.$on("create", (g) => o("create", g.detail)), () => {
|
|
2439
|
-
|
|
2443
|
+
f.forEach((g) => g()), c.$destroy();
|
|
2440
2444
|
};
|
|
2441
|
-
}), e.$$set = (
|
|
2442
|
-
"drawingMode" in
|
|
2445
|
+
}), e.$$set = (u) => {
|
|
2446
|
+
"drawingMode" in u && n(0, i = u.drawingMode), "target" in u && n(1, s = u.target), "tool" in u && n(2, r = u.tool), "transform" in u && n(3, l = u.transform), "viewportScale" in u && n(4, a = u.viewportScale);
|
|
2443
2447
|
}, e.$$.update = () => {
|
|
2444
2448
|
e.$$.dirty & /*toolComponent, transform*/
|
|
2445
2449
|
40 && c && c.$set({ transform: l }), e.$$.dirty & /*toolComponent, viewportScale*/
|
|
2446
2450
|
48 && c && c.$set({ viewportScale: a });
|
|
2447
2451
|
}, [i, s, r, l, a, c];
|
|
2448
2452
|
}
|
|
2449
|
-
class
|
|
2453
|
+
class Qo extends ne {
|
|
2450
2454
|
constructor(t) {
|
|
2451
|
-
super(), te(this, t,
|
|
2455
|
+
super(), te(this, t, Jo, null, Q, {
|
|
2452
2456
|
drawingMode: 0,
|
|
2453
2457
|
target: 1,
|
|
2454
2458
|
tool: 2,
|
|
@@ -2457,46 +2461,46 @@ class xo extends ne {
|
|
|
2457
2461
|
});
|
|
2458
2462
|
}
|
|
2459
2463
|
}
|
|
2460
|
-
function
|
|
2464
|
+
function Dt(e) {
|
|
2461
2465
|
let t, n;
|
|
2462
2466
|
return {
|
|
2463
2467
|
c() {
|
|
2464
|
-
t = X("rect"), n = X("rect"),
|
|
2468
|
+
t = X("rect"), n = X("rect"), d(t, "class", "a9s-outer"), d(
|
|
2465
2469
|
t,
|
|
2466
2470
|
"x",
|
|
2467
2471
|
/*x*/
|
|
2468
2472
|
e[1]
|
|
2469
|
-
),
|
|
2473
|
+
), d(
|
|
2470
2474
|
t,
|
|
2471
2475
|
"y",
|
|
2472
2476
|
/*y*/
|
|
2473
2477
|
e[2]
|
|
2474
|
-
),
|
|
2478
|
+
), d(
|
|
2475
2479
|
t,
|
|
2476
2480
|
"width",
|
|
2477
2481
|
/*w*/
|
|
2478
2482
|
e[3]
|
|
2479
|
-
),
|
|
2483
|
+
), d(
|
|
2480
2484
|
t,
|
|
2481
2485
|
"height",
|
|
2482
2486
|
/*h*/
|
|
2483
2487
|
e[4]
|
|
2484
|
-
),
|
|
2488
|
+
), d(n, "class", "a9s-inner"), d(
|
|
2485
2489
|
n,
|
|
2486
2490
|
"x",
|
|
2487
2491
|
/*x*/
|
|
2488
2492
|
e[1]
|
|
2489
|
-
),
|
|
2493
|
+
), d(
|
|
2490
2494
|
n,
|
|
2491
2495
|
"y",
|
|
2492
2496
|
/*y*/
|
|
2493
2497
|
e[2]
|
|
2494
|
-
),
|
|
2498
|
+
), d(
|
|
2495
2499
|
n,
|
|
2496
2500
|
"width",
|
|
2497
2501
|
/*w*/
|
|
2498
2502
|
e[3]
|
|
2499
|
-
),
|
|
2503
|
+
), d(
|
|
2500
2504
|
n,
|
|
2501
2505
|
"height",
|
|
2502
2506
|
/*h*/
|
|
@@ -2508,49 +2512,49 @@ function Yt(e) {
|
|
|
2508
2512
|
},
|
|
2509
2513
|
p(o, i) {
|
|
2510
2514
|
i & /*x*/
|
|
2511
|
-
2 &&
|
|
2515
|
+
2 && d(
|
|
2512
2516
|
t,
|
|
2513
2517
|
"x",
|
|
2514
2518
|
/*x*/
|
|
2515
2519
|
o[1]
|
|
2516
2520
|
), i & /*y*/
|
|
2517
|
-
4 &&
|
|
2521
|
+
4 && d(
|
|
2518
2522
|
t,
|
|
2519
2523
|
"y",
|
|
2520
2524
|
/*y*/
|
|
2521
2525
|
o[2]
|
|
2522
2526
|
), i & /*w*/
|
|
2523
|
-
8 &&
|
|
2527
|
+
8 && d(
|
|
2524
2528
|
t,
|
|
2525
2529
|
"width",
|
|
2526
2530
|
/*w*/
|
|
2527
2531
|
o[3]
|
|
2528
2532
|
), i & /*h*/
|
|
2529
|
-
16 &&
|
|
2533
|
+
16 && d(
|
|
2530
2534
|
t,
|
|
2531
2535
|
"height",
|
|
2532
2536
|
/*h*/
|
|
2533
2537
|
o[4]
|
|
2534
2538
|
), i & /*x*/
|
|
2535
|
-
2 &&
|
|
2539
|
+
2 && d(
|
|
2536
2540
|
n,
|
|
2537
2541
|
"x",
|
|
2538
2542
|
/*x*/
|
|
2539
2543
|
o[1]
|
|
2540
2544
|
), i & /*y*/
|
|
2541
|
-
4 &&
|
|
2545
|
+
4 && d(
|
|
2542
2546
|
n,
|
|
2543
2547
|
"y",
|
|
2544
2548
|
/*y*/
|
|
2545
2549
|
o[2]
|
|
2546
2550
|
), i & /*w*/
|
|
2547
|
-
8 &&
|
|
2551
|
+
8 && d(
|
|
2548
2552
|
n,
|
|
2549
2553
|
"width",
|
|
2550
2554
|
/*w*/
|
|
2551
2555
|
o[3]
|
|
2552
2556
|
), i & /*h*/
|
|
2553
|
-
16 &&
|
|
2557
|
+
16 && d(
|
|
2554
2558
|
n,
|
|
2555
2559
|
"height",
|
|
2556
2560
|
/*h*/
|
|
@@ -2562,21 +2566,21 @@ function Yt(e) {
|
|
|
2562
2566
|
}
|
|
2563
2567
|
};
|
|
2564
2568
|
}
|
|
2565
|
-
function
|
|
2569
|
+
function Zo(e) {
|
|
2566
2570
|
let t, n = (
|
|
2567
2571
|
/*origin*/
|
|
2568
|
-
e[0] &&
|
|
2572
|
+
e[0] && Dt(e)
|
|
2569
2573
|
);
|
|
2570
2574
|
return {
|
|
2571
2575
|
c() {
|
|
2572
|
-
t = X("g"), n && n.c(),
|
|
2576
|
+
t = X("g"), n && n.c(), d(t, "class", "a9s-annotation a9s-rubberband");
|
|
2573
2577
|
},
|
|
2574
2578
|
m(o, i) {
|
|
2575
2579
|
B(o, t, i), n && n.m(t, null);
|
|
2576
2580
|
},
|
|
2577
2581
|
p(o, [i]) {
|
|
2578
2582
|
/*origin*/
|
|
2579
|
-
o[0] ? n ? n.p(o, i) : (n =
|
|
2583
|
+
o[0] ? n ? n.p(o, i) : (n = Dt(o), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2580
2584
|
},
|
|
2581
2585
|
i: j,
|
|
2582
2586
|
o: j,
|
|
@@ -2585,58 +2589,58 @@ function $o(e) {
|
|
|
2585
2589
|
}
|
|
2586
2590
|
};
|
|
2587
2591
|
}
|
|
2588
|
-
function
|
|
2592
|
+
function xo(e, t, n) {
|
|
2589
2593
|
const o = ke();
|
|
2590
|
-
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c,
|
|
2591
|
-
const m = (
|
|
2592
|
-
const _ =
|
|
2593
|
-
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(_.offsetX, _.offsetY)), c = a, n(1,
|
|
2594
|
-
},
|
|
2595
|
-
const _ =
|
|
2596
|
-
a && (c = r.elementToImage(_.offsetX, _.offsetY), n(1,
|
|
2597
|
-
},
|
|
2598
|
-
const _ =
|
|
2594
|
+
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f, h, g;
|
|
2595
|
+
const m = (p) => {
|
|
2596
|
+
const _ = p;
|
|
2597
|
+
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(_.offsetX, _.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, h = 1), n(4, g = 1));
|
|
2598
|
+
}, w = (p) => {
|
|
2599
|
+
const _ = p;
|
|
2600
|
+
a && (c = r.elementToImage(_.offsetX, _.offsetY), n(1, u = Math.min(c[0], a[0])), n(2, f = Math.min(c[1], a[1])), n(3, h = Math.abs(c[0] - a[0])), n(4, g = Math.abs(c[1] - a[1])));
|
|
2601
|
+
}, T = (p) => {
|
|
2602
|
+
const _ = p, E = performance.now() - l;
|
|
2599
2603
|
if (s === "click") {
|
|
2600
2604
|
if (E > 300) return;
|
|
2601
|
-
a ?
|
|
2602
|
-
} else a && (E > 300 || h * g > 100 ? (_.stopPropagation(),
|
|
2603
|
-
},
|
|
2605
|
+
a ? y() : (n(0, a = r.elementToImage(_.offsetX, _.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, h = 1), n(4, g = 1));
|
|
2606
|
+
} else a && (E > 300 || h * g > 100 ? (_.stopPropagation(), y()) : (n(0, a = void 0), c = void 0));
|
|
2607
|
+
}, y = () => {
|
|
2604
2608
|
if (h * g > 15) {
|
|
2605
|
-
const
|
|
2609
|
+
const p = {
|
|
2606
2610
|
type: F.RECTANGLE,
|
|
2607
2611
|
geometry: {
|
|
2608
2612
|
bounds: {
|
|
2609
|
-
minX:
|
|
2610
|
-
minY:
|
|
2611
|
-
maxX:
|
|
2612
|
-
maxY:
|
|
2613
|
+
minX: u,
|
|
2614
|
+
minY: f,
|
|
2615
|
+
maxX: u + h,
|
|
2616
|
+
maxY: f + g
|
|
2613
2617
|
},
|
|
2614
|
-
x:
|
|
2615
|
-
y:
|
|
2618
|
+
x: u,
|
|
2619
|
+
y: f,
|
|
2616
2620
|
w: h,
|
|
2617
2621
|
h: g
|
|
2618
2622
|
}
|
|
2619
2623
|
};
|
|
2620
|
-
o("create",
|
|
2624
|
+
o("create", p);
|
|
2621
2625
|
}
|
|
2622
2626
|
n(0, a = void 0), c = void 0;
|
|
2623
2627
|
};
|
|
2624
2628
|
return Ne(() => {
|
|
2625
|
-
i("pointerdown", m), i("pointermove",
|
|
2626
|
-
}), e.$$set = (
|
|
2627
|
-
"addEventListener" in
|
|
2628
|
-
}, [a,
|
|
2629
|
+
i("pointerdown", m), i("pointermove", w), i("pointerup", T, !0);
|
|
2630
|
+
}), e.$$set = (p) => {
|
|
2631
|
+
"addEventListener" in p && n(5, i = p.addEventListener), "drawingMode" in p && n(6, s = p.drawingMode), "transform" in p && n(7, r = p.transform);
|
|
2632
|
+
}, [a, u, f, h, g, i, s, r];
|
|
2629
2633
|
}
|
|
2630
|
-
class
|
|
2634
|
+
class $o extends ne {
|
|
2631
2635
|
constructor(t) {
|
|
2632
|
-
super(), te(this, t,
|
|
2636
|
+
super(), te(this, t, xo, Zo, Q, {
|
|
2633
2637
|
addEventListener: 5,
|
|
2634
2638
|
drawingMode: 6,
|
|
2635
2639
|
transform: 7
|
|
2636
2640
|
});
|
|
2637
2641
|
}
|
|
2638
2642
|
}
|
|
2639
|
-
function
|
|
2643
|
+
function rt(e) {
|
|
2640
2644
|
const t = e.slice(), n = (
|
|
2641
2645
|
/*isClosable*/
|
|
2642
2646
|
(t[2] ? (
|
|
@@ -2651,15 +2655,15 @@ function at(e) {
|
|
|
2651
2655
|
);
|
|
2652
2656
|
return t[16] = n, t;
|
|
2653
2657
|
}
|
|
2654
|
-
function
|
|
2658
|
+
function Yt(e) {
|
|
2655
2659
|
let t, n, o, i, s, r = (
|
|
2656
2660
|
/*isClosable*/
|
|
2657
|
-
e[2] &&
|
|
2661
|
+
e[2] && Pt(e)
|
|
2658
2662
|
);
|
|
2659
2663
|
return {
|
|
2660
2664
|
c() {
|
|
2661
|
-
t = X("polygon"), o = X("polygon"), r && r.c(), s = le(),
|
|
2662
|
-
e[16]),
|
|
2665
|
+
t = X("polygon"), o = X("polygon"), r && r.c(), s = le(), d(t, "class", "a9s-outer"), d(t, "points", n = /*coords*/
|
|
2666
|
+
e[16]), d(o, "class", "a9s-inner"), d(o, "points", i = /*coords*/
|
|
2663
2667
|
e[16]);
|
|
2664
2668
|
},
|
|
2665
2669
|
m(l, a) {
|
|
@@ -2668,30 +2672,30 @@ function Ct(e) {
|
|
|
2668
2672
|
p(l, a) {
|
|
2669
2673
|
a & /*isClosable, points, cursor*/
|
|
2670
2674
|
7 && n !== (n = /*coords*/
|
|
2671
|
-
l[16]) &&
|
|
2675
|
+
l[16]) && d(t, "points", n), a & /*isClosable, points, cursor*/
|
|
2672
2676
|
7 && i !== (i = /*coords*/
|
|
2673
|
-
l[16]) &&
|
|
2674
|
-
l[2] ? r ? r.p(l, a) : (r =
|
|
2677
|
+
l[16]) && d(o, "points", i), /*isClosable*/
|
|
2678
|
+
l[2] ? r ? r.p(l, a) : (r = Pt(l), r.c(), r.m(s.parentNode, s)) : r && (r.d(1), r = null);
|
|
2675
2679
|
},
|
|
2676
2680
|
d(l) {
|
|
2677
2681
|
l && (O(t), O(o), O(s)), r && r.d(l);
|
|
2678
2682
|
}
|
|
2679
2683
|
};
|
|
2680
2684
|
}
|
|
2681
|
-
function
|
|
2685
|
+
function Pt(e) {
|
|
2682
2686
|
let t, n, o;
|
|
2683
2687
|
return {
|
|
2684
2688
|
c() {
|
|
2685
|
-
t = X("rect"),
|
|
2689
|
+
t = X("rect"), d(t, "class", "a9s-corner-handle"), d(t, "x", n = /*points*/
|
|
2686
2690
|
e[0][0][0] - /*handleSize*/
|
|
2687
|
-
e[3] / 2),
|
|
2691
|
+
e[3] / 2), d(t, "y", o = /*points*/
|
|
2688
2692
|
e[0][0][1] - /*handleSize*/
|
|
2689
|
-
e[3] / 2),
|
|
2693
|
+
e[3] / 2), d(
|
|
2690
2694
|
t,
|
|
2691
2695
|
"height",
|
|
2692
2696
|
/*handleSize*/
|
|
2693
2697
|
e[3]
|
|
2694
|
-
),
|
|
2698
|
+
), d(
|
|
2695
2699
|
t,
|
|
2696
2700
|
"width",
|
|
2697
2701
|
/*handleSize*/
|
|
@@ -2705,17 +2709,17 @@ function Xt(e) {
|
|
|
2705
2709
|
s & /*points, handleSize*/
|
|
2706
2710
|
9 && n !== (n = /*points*/
|
|
2707
2711
|
i[0][0][0] - /*handleSize*/
|
|
2708
|
-
i[3] / 2) &&
|
|
2712
|
+
i[3] / 2) && d(t, "x", n), s & /*points, handleSize*/
|
|
2709
2713
|
9 && o !== (o = /*points*/
|
|
2710
2714
|
i[0][0][1] - /*handleSize*/
|
|
2711
|
-
i[3] / 2) &&
|
|
2712
|
-
8 &&
|
|
2715
|
+
i[3] / 2) && d(t, "y", o), s & /*handleSize*/
|
|
2716
|
+
8 && d(
|
|
2713
2717
|
t,
|
|
2714
2718
|
"height",
|
|
2715
2719
|
/*handleSize*/
|
|
2716
2720
|
i[3]
|
|
2717
2721
|
), s & /*handleSize*/
|
|
2718
|
-
8 &&
|
|
2722
|
+
8 && d(
|
|
2719
2723
|
t,
|
|
2720
2724
|
"width",
|
|
2721
2725
|
/*handleSize*/
|
|
@@ -2727,21 +2731,21 @@ function Xt(e) {
|
|
|
2727
2731
|
}
|
|
2728
2732
|
};
|
|
2729
2733
|
}
|
|
2730
|
-
function
|
|
2734
|
+
function ei(e) {
|
|
2731
2735
|
let t, n = (
|
|
2732
2736
|
/*cursor*/
|
|
2733
|
-
e[1] &&
|
|
2737
|
+
e[1] && Yt(rt(e))
|
|
2734
2738
|
);
|
|
2735
2739
|
return {
|
|
2736
2740
|
c() {
|
|
2737
|
-
t = X("g"), n && n.c(),
|
|
2741
|
+
t = X("g"), n && n.c(), d(t, "class", "a9s-annotation a9s-rubberband");
|
|
2738
2742
|
},
|
|
2739
2743
|
m(o, i) {
|
|
2740
2744
|
B(o, t, i), n && n.m(t, null);
|
|
2741
2745
|
},
|
|
2742
2746
|
p(o, [i]) {
|
|
2743
2747
|
/*cursor*/
|
|
2744
|
-
o[1] ? n ? n.p(
|
|
2748
|
+
o[1] ? n ? n.p(rt(o), i) : (n = Yt(rt(o)), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2745
2749
|
},
|
|
2746
2750
|
i: j,
|
|
2747
2751
|
o: j,
|
|
@@ -2750,77 +2754,77 @@ function ni(e) {
|
|
|
2750
2754
|
}
|
|
2751
2755
|
};
|
|
2752
2756
|
}
|
|
2753
|
-
const
|
|
2754
|
-
function
|
|
2757
|
+
const ti = 20, ni = 1500;
|
|
2758
|
+
function oi(e, t, n) {
|
|
2755
2759
|
let o;
|
|
2756
2760
|
const i = ke();
|
|
2757
|
-
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c,
|
|
2761
|
+
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, h, g = !1;
|
|
2758
2762
|
const m = (_) => {
|
|
2759
2763
|
const E = _, { timeStamp: I, offsetX: R, offsetY: U } = E;
|
|
2760
|
-
if (c = { timeStamp: I, offsetX: R, offsetY: U }, r === "drag" &&
|
|
2764
|
+
if (c = { timeStamp: I, offsetX: R, offsetY: U }, r === "drag" && u.length === 0) {
|
|
2761
2765
|
const V = l.elementToImage(E.offsetX, E.offsetY);
|
|
2762
|
-
|
|
2766
|
+
u.push(V), n(1, f = V);
|
|
2763
2767
|
}
|
|
2764
|
-
},
|
|
2768
|
+
}, w = (_) => {
|
|
2765
2769
|
const E = _;
|
|
2766
|
-
if (h && clearTimeout(h),
|
|
2767
|
-
if (n(1,
|
|
2768
|
-
const I =
|
|
2769
|
-
n(2, g = I <
|
|
2770
|
+
if (h && clearTimeout(h), u.length > 0) {
|
|
2771
|
+
if (n(1, f = l.elementToImage(E.offsetX, E.offsetY)), u.length > 2) {
|
|
2772
|
+
const I = st(f, u[0]) * a;
|
|
2773
|
+
n(2, g = I < ti);
|
|
2770
2774
|
}
|
|
2771
2775
|
E.pointerType === "touch" && (h = setTimeout(
|
|
2772
2776
|
() => {
|
|
2773
|
-
|
|
2777
|
+
y();
|
|
2774
2778
|
},
|
|
2775
|
-
|
|
2779
|
+
ni
|
|
2776
2780
|
));
|
|
2777
2781
|
}
|
|
2778
|
-
},
|
|
2782
|
+
}, T = (_) => {
|
|
2779
2783
|
const E = _;
|
|
2780
2784
|
if (h && clearTimeout(h), r === "click") {
|
|
2781
|
-
const I = E.timeStamp - c.timeStamp, R =
|
|
2785
|
+
const I = E.timeStamp - c.timeStamp, R = st([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
|
|
2782
2786
|
if (I > 300 || R > 15) return;
|
|
2783
2787
|
if (g)
|
|
2784
|
-
|
|
2785
|
-
else if (
|
|
2788
|
+
p();
|
|
2789
|
+
else if (u.length === 0) {
|
|
2786
2790
|
const U = l.elementToImage(E.offsetX, E.offsetY);
|
|
2787
|
-
|
|
2791
|
+
u.push(U), n(1, f = U);
|
|
2788
2792
|
} else
|
|
2789
|
-
|
|
2793
|
+
u.push(f);
|
|
2790
2794
|
} else {
|
|
2791
|
-
if (
|
|
2792
|
-
n(0,
|
|
2795
|
+
if (u.length === 1 && st(u[0], f) <= 4) {
|
|
2796
|
+
n(0, u = []), n(1, f = void 0);
|
|
2793
2797
|
return;
|
|
2794
2798
|
}
|
|
2795
|
-
E.stopImmediatePropagation(), g ?
|
|
2799
|
+
E.stopImmediatePropagation(), g ? p() : u.push(f);
|
|
2796
2800
|
}
|
|
2797
|
-
},
|
|
2798
|
-
if (!
|
|
2799
|
-
const _ = [...
|
|
2801
|
+
}, y = () => {
|
|
2802
|
+
if (!f) return;
|
|
2803
|
+
const _ = [...u, f], E = {
|
|
2800
2804
|
type: F.POLYGON,
|
|
2801
|
-
geometry: { bounds:
|
|
2805
|
+
geometry: { bounds: Ke(_), points: _ }
|
|
2802
2806
|
};
|
|
2803
|
-
|
|
2804
|
-
},
|
|
2807
|
+
ht(E) > 4 && (n(0, u = []), n(1, f = void 0), i("create", E));
|
|
2808
|
+
}, p = () => {
|
|
2805
2809
|
const _ = {
|
|
2806
2810
|
type: F.POLYGON,
|
|
2807
2811
|
geometry: {
|
|
2808
|
-
bounds:
|
|
2809
|
-
points: [...
|
|
2812
|
+
bounds: Ke(u),
|
|
2813
|
+
points: [...u]
|
|
2810
2814
|
}
|
|
2811
2815
|
};
|
|
2812
|
-
n(0,
|
|
2816
|
+
n(0, u = []), n(1, f = void 0), i("create", _);
|
|
2813
2817
|
};
|
|
2814
2818
|
return Ne(() => {
|
|
2815
|
-
s("pointerdown", m, !0), s("pointermove",
|
|
2819
|
+
s("pointerdown", m, !0), s("pointermove", w), s("pointerup", T, !0), s("dblclick", y, !0);
|
|
2816
2820
|
}), e.$$set = (_) => {
|
|
2817
2821
|
"addEventListener" in _ && n(4, s = _.addEventListener), "drawingMode" in _ && n(5, r = _.drawingMode), "transform" in _ && n(6, l = _.transform), "viewportScale" in _ && n(7, a = _.viewportScale);
|
|
2818
2822
|
}, e.$$.update = () => {
|
|
2819
2823
|
e.$$.dirty & /*viewportScale*/
|
|
2820
2824
|
128 && n(3, o = 10 / a);
|
|
2821
2825
|
}, [
|
|
2826
|
+
u,
|
|
2822
2827
|
f,
|
|
2823
|
-
d,
|
|
2824
2828
|
g,
|
|
2825
2829
|
o,
|
|
2826
2830
|
s,
|
|
@@ -2829,9 +2833,9 @@ function si(e, t, n) {
|
|
|
2829
2833
|
a
|
|
2830
2834
|
];
|
|
2831
2835
|
}
|
|
2832
|
-
class
|
|
2836
|
+
class ii extends ne {
|
|
2833
2837
|
constructor(t) {
|
|
2834
|
-
super(), te(this, t,
|
|
2838
|
+
super(), te(this, t, oi, ei, Q, {
|
|
2835
2839
|
addEventListener: 4,
|
|
2836
2840
|
drawingMode: 5,
|
|
2837
2841
|
transform: 6,
|
|
@@ -2839,61 +2843,61 @@ class ri extends ne {
|
|
|
2839
2843
|
});
|
|
2840
2844
|
}
|
|
2841
2845
|
}
|
|
2842
|
-
const
|
|
2843
|
-
["rectangle", { tool:
|
|
2844
|
-
["polygon", { tool:
|
|
2845
|
-
]),
|
|
2846
|
-
function
|
|
2846
|
+
const _t = /* @__PURE__ */ new Map([
|
|
2847
|
+
["rectangle", { tool: $o }],
|
|
2848
|
+
["polygon", { tool: ii }]
|
|
2849
|
+
]), cn = () => [..._t.keys()], fn = (e) => _t.get(e), si = (e, t, n) => _t.set(e, { tool: t, opts: n });
|
|
2850
|
+
function ri(e) {
|
|
2847
2851
|
let t, n, o, i, s;
|
|
2848
2852
|
return {
|
|
2849
2853
|
c() {
|
|
2850
|
-
t = X("g"), n = X("ellipse"), i = X("ellipse"),
|
|
2851
|
-
e[1] ? "display:none;" : void 0),
|
|
2854
|
+
t = X("g"), n = X("ellipse"), i = X("ellipse"), d(n, "class", "a9s-outer"), d(n, "style", o = /*computedStyle*/
|
|
2855
|
+
e[1] ? "display:none;" : void 0), d(
|
|
2852
2856
|
n,
|
|
2853
2857
|
"cx",
|
|
2854
2858
|
/*cx*/
|
|
2855
2859
|
e[2]
|
|
2856
|
-
),
|
|
2860
|
+
), d(
|
|
2857
2861
|
n,
|
|
2858
2862
|
"cy",
|
|
2859
2863
|
/*cy*/
|
|
2860
2864
|
e[3]
|
|
2861
|
-
),
|
|
2865
|
+
), d(
|
|
2862
2866
|
n,
|
|
2863
2867
|
"rx",
|
|
2864
2868
|
/*rx*/
|
|
2865
2869
|
e[4]
|
|
2866
|
-
),
|
|
2870
|
+
), d(
|
|
2867
2871
|
n,
|
|
2868
2872
|
"ry",
|
|
2869
2873
|
/*ry*/
|
|
2870
2874
|
e[5]
|
|
2871
|
-
),
|
|
2875
|
+
), d(i, "class", "a9s-inner"), d(
|
|
2872
2876
|
i,
|
|
2873
2877
|
"style",
|
|
2874
2878
|
/*computedStyle*/
|
|
2875
2879
|
e[1]
|
|
2876
|
-
),
|
|
2880
|
+
), d(
|
|
2877
2881
|
i,
|
|
2878
2882
|
"cx",
|
|
2879
2883
|
/*cx*/
|
|
2880
2884
|
e[2]
|
|
2881
|
-
),
|
|
2885
|
+
), d(
|
|
2882
2886
|
i,
|
|
2883
2887
|
"cy",
|
|
2884
2888
|
/*cy*/
|
|
2885
2889
|
e[3]
|
|
2886
|
-
),
|
|
2890
|
+
), d(
|
|
2887
2891
|
i,
|
|
2888
2892
|
"rx",
|
|
2889
2893
|
/*rx*/
|
|
2890
2894
|
e[4]
|
|
2891
|
-
),
|
|
2895
|
+
), d(
|
|
2892
2896
|
i,
|
|
2893
2897
|
"ry",
|
|
2894
2898
|
/*ry*/
|
|
2895
2899
|
e[5]
|
|
2896
|
-
),
|
|
2900
|
+
), d(t, "class", "a9s-annotation"), d(t, "data-id", s = /*annotation*/
|
|
2897
2901
|
e[0].id);
|
|
2898
2902
|
},
|
|
2899
2903
|
m(r, l) {
|
|
@@ -2902,15 +2906,15 @@ function ai(e) {
|
|
|
2902
2906
|
p(r, [l]) {
|
|
2903
2907
|
l & /*computedStyle*/
|
|
2904
2908
|
2 && o !== (o = /*computedStyle*/
|
|
2905
|
-
r[1] ? "display:none;" : void 0) &&
|
|
2906
|
-
2 &&
|
|
2909
|
+
r[1] ? "display:none;" : void 0) && d(n, "style", o), l & /*computedStyle*/
|
|
2910
|
+
2 && d(
|
|
2907
2911
|
i,
|
|
2908
2912
|
"style",
|
|
2909
2913
|
/*computedStyle*/
|
|
2910
2914
|
r[1]
|
|
2911
2915
|
), l & /*annotation*/
|
|
2912
2916
|
1 && s !== (s = /*annotation*/
|
|
2913
|
-
r[0].id) &&
|
|
2917
|
+
r[0].id) && d(t, "data-id", s);
|
|
2914
2918
|
},
|
|
2915
2919
|
i: j,
|
|
2916
2920
|
o: j,
|
|
@@ -2919,42 +2923,42 @@ function ai(e) {
|
|
|
2919
2923
|
}
|
|
2920
2924
|
};
|
|
2921
2925
|
}
|
|
2922
|
-
function
|
|
2926
|
+
function li(e, t, n) {
|
|
2923
2927
|
let o, { annotation: i } = t, { geom: s } = t, { style: r } = t;
|
|
2924
|
-
const { cx: l, cy: a, rx: c, ry:
|
|
2925
|
-
return e.$$set = (
|
|
2926
|
-
"annotation" in
|
|
2928
|
+
const { cx: l, cy: a, rx: c, ry: u } = s;
|
|
2929
|
+
return e.$$set = (f) => {
|
|
2930
|
+
"annotation" in f && n(0, i = f.annotation), "geom" in f && n(6, s = f.geom), "style" in f && n(7, r = f.style);
|
|
2927
2931
|
}, e.$$.update = () => {
|
|
2928
2932
|
e.$$.dirty & /*annotation, style*/
|
|
2929
|
-
129 && n(1, o =
|
|
2930
|
-
}, [i, o, l, a, c,
|
|
2933
|
+
129 && n(1, o = Qe(i, r));
|
|
2934
|
+
}, [i, o, l, a, c, u, s, r];
|
|
2931
2935
|
}
|
|
2932
|
-
class
|
|
2936
|
+
class ai extends ne {
|
|
2933
2937
|
constructor(t) {
|
|
2934
|
-
super(), te(this, t,
|
|
2938
|
+
super(), te(this, t, li, ri, Q, { annotation: 0, geom: 6, style: 7 });
|
|
2935
2939
|
}
|
|
2936
2940
|
}
|
|
2937
|
-
function
|
|
2941
|
+
function ci(e) {
|
|
2938
2942
|
let t, n, o, i, s;
|
|
2939
2943
|
return {
|
|
2940
2944
|
c() {
|
|
2941
|
-
t = X("g"), n = X("polygon"), i = X("polygon"),
|
|
2942
|
-
e[1] ? "display:none;" : void 0),
|
|
2945
|
+
t = X("g"), n = X("polygon"), i = X("polygon"), d(n, "class", "a9s-outer"), d(n, "style", o = /*computedStyle*/
|
|
2946
|
+
e[1] ? "display:none;" : void 0), d(
|
|
2943
2947
|
n,
|
|
2944
2948
|
"points",
|
|
2945
2949
|
/*points*/
|
|
2946
|
-
e[2].map(
|
|
2947
|
-
),
|
|
2950
|
+
e[2].map(fi).join(" ")
|
|
2951
|
+
), d(i, "class", "a9s-inner"), d(
|
|
2948
2952
|
i,
|
|
2949
2953
|
"style",
|
|
2950
2954
|
/*computedStyle*/
|
|
2951
2955
|
e[1]
|
|
2952
|
-
),
|
|
2956
|
+
), d(
|
|
2953
2957
|
i,
|
|
2954
2958
|
"points",
|
|
2955
2959
|
/*points*/
|
|
2956
|
-
e[2].map(
|
|
2957
|
-
),
|
|
2960
|
+
e[2].map(ui).join(" ")
|
|
2961
|
+
), d(t, "class", "a9s-annotation"), d(t, "data-id", s = /*annotation*/
|
|
2958
2962
|
e[0].id);
|
|
2959
2963
|
},
|
|
2960
2964
|
m(r, l) {
|
|
@@ -2963,15 +2967,15 @@ function fi(e) {
|
|
|
2963
2967
|
p(r, [l]) {
|
|
2964
2968
|
l & /*computedStyle*/
|
|
2965
2969
|
2 && o !== (o = /*computedStyle*/
|
|
2966
|
-
r[1] ? "display:none;" : void 0) &&
|
|
2967
|
-
2 &&
|
|
2970
|
+
r[1] ? "display:none;" : void 0) && d(n, "style", o), l & /*computedStyle*/
|
|
2971
|
+
2 && d(
|
|
2968
2972
|
i,
|
|
2969
2973
|
"style",
|
|
2970
2974
|
/*computedStyle*/
|
|
2971
2975
|
r[1]
|
|
2972
2976
|
), l & /*annotation*/
|
|
2973
2977
|
1 && s !== (s = /*annotation*/
|
|
2974
|
-
r[0].id) &&
|
|
2978
|
+
r[0].id) && d(t, "data-id", s);
|
|
2975
2979
|
},
|
|
2976
2980
|
i: j,
|
|
2977
2981
|
o: j,
|
|
@@ -2980,73 +2984,73 @@ function fi(e) {
|
|
|
2980
2984
|
}
|
|
2981
2985
|
};
|
|
2982
2986
|
}
|
|
2983
|
-
const
|
|
2984
|
-
function
|
|
2987
|
+
const fi = (e) => e.join(","), ui = (e) => e.join(",");
|
|
2988
|
+
function di(e, t, n) {
|
|
2985
2989
|
let o, { annotation: i } = t, { geom: s } = t, { style: r } = t;
|
|
2986
2990
|
const { points: l } = s;
|
|
2987
2991
|
return e.$$set = (a) => {
|
|
2988
2992
|
"annotation" in a && n(0, i = a.annotation), "geom" in a && n(3, s = a.geom), "style" in a && n(4, r = a.style);
|
|
2989
2993
|
}, e.$$.update = () => {
|
|
2990
2994
|
e.$$.dirty & /*annotation, style*/
|
|
2991
|
-
17 && n(1, o =
|
|
2995
|
+
17 && n(1, o = Qe(i, r));
|
|
2992
2996
|
}, [i, o, l, s, r];
|
|
2993
2997
|
}
|
|
2994
|
-
class
|
|
2998
|
+
class hi extends ne {
|
|
2995
2999
|
constructor(t) {
|
|
2996
|
-
super(), te(this, t,
|
|
3000
|
+
super(), te(this, t, di, ci, Q, { annotation: 0, geom: 3, style: 4 });
|
|
2997
3001
|
}
|
|
2998
3002
|
}
|
|
2999
|
-
function
|
|
3003
|
+
function gi(e) {
|
|
3000
3004
|
let t, n, o, i, s;
|
|
3001
3005
|
return {
|
|
3002
3006
|
c() {
|
|
3003
|
-
t = X("g"), n = X("rect"), i = X("rect"),
|
|
3004
|
-
e[5] ? "display:none;" : void 0),
|
|
3007
|
+
t = X("g"), n = X("rect"), i = X("rect"), d(n, "class", "a9s-outer"), d(n, "style", o = /*computedStyle*/
|
|
3008
|
+
e[5] ? "display:none;" : void 0), d(
|
|
3005
3009
|
n,
|
|
3006
3010
|
"x",
|
|
3007
3011
|
/*x*/
|
|
3008
3012
|
e[4]
|
|
3009
|
-
),
|
|
3013
|
+
), d(
|
|
3010
3014
|
n,
|
|
3011
3015
|
"y",
|
|
3012
3016
|
/*y*/
|
|
3013
3017
|
e[3]
|
|
3014
|
-
),
|
|
3018
|
+
), d(
|
|
3015
3019
|
n,
|
|
3016
3020
|
"width",
|
|
3017
3021
|
/*w*/
|
|
3018
3022
|
e[2]
|
|
3019
|
-
),
|
|
3023
|
+
), d(
|
|
3020
3024
|
n,
|
|
3021
3025
|
"height",
|
|
3022
3026
|
/*h*/
|
|
3023
3027
|
e[1]
|
|
3024
|
-
),
|
|
3028
|
+
), d(i, "class", "a9s-inner"), d(
|
|
3025
3029
|
i,
|
|
3026
3030
|
"style",
|
|
3027
3031
|
/*computedStyle*/
|
|
3028
3032
|
e[5]
|
|
3029
|
-
),
|
|
3033
|
+
), d(
|
|
3030
3034
|
i,
|
|
3031
3035
|
"x",
|
|
3032
3036
|
/*x*/
|
|
3033
3037
|
e[4]
|
|
3034
|
-
),
|
|
3038
|
+
), d(
|
|
3035
3039
|
i,
|
|
3036
3040
|
"y",
|
|
3037
3041
|
/*y*/
|
|
3038
3042
|
e[3]
|
|
3039
|
-
),
|
|
3043
|
+
), d(
|
|
3040
3044
|
i,
|
|
3041
3045
|
"width",
|
|
3042
3046
|
/*w*/
|
|
3043
3047
|
e[2]
|
|
3044
|
-
),
|
|
3048
|
+
), d(
|
|
3045
3049
|
i,
|
|
3046
3050
|
"height",
|
|
3047
3051
|
/*h*/
|
|
3048
3052
|
e[1]
|
|
3049
|
-
),
|
|
3053
|
+
), d(t, "class", "a9s-annotation"), d(t, "data-id", s = /*annotation*/
|
|
3050
3054
|
e[0].id);
|
|
3051
3055
|
},
|
|
3052
3056
|
m(r, l) {
|
|
@@ -3055,63 +3059,63 @@ function pi(e) {
|
|
|
3055
3059
|
p(r, [l]) {
|
|
3056
3060
|
l & /*computedStyle*/
|
|
3057
3061
|
32 && o !== (o = /*computedStyle*/
|
|
3058
|
-
r[5] ? "display:none;" : void 0) &&
|
|
3059
|
-
16 &&
|
|
3062
|
+
r[5] ? "display:none;" : void 0) && d(n, "style", o), l & /*x*/
|
|
3063
|
+
16 && d(
|
|
3060
3064
|
n,
|
|
3061
3065
|
"x",
|
|
3062
3066
|
/*x*/
|
|
3063
3067
|
r[4]
|
|
3064
3068
|
), l & /*y*/
|
|
3065
|
-
8 &&
|
|
3069
|
+
8 && d(
|
|
3066
3070
|
n,
|
|
3067
3071
|
"y",
|
|
3068
3072
|
/*y*/
|
|
3069
3073
|
r[3]
|
|
3070
3074
|
), l & /*w*/
|
|
3071
|
-
4 &&
|
|
3075
|
+
4 && d(
|
|
3072
3076
|
n,
|
|
3073
3077
|
"width",
|
|
3074
3078
|
/*w*/
|
|
3075
3079
|
r[2]
|
|
3076
3080
|
), l & /*h*/
|
|
3077
|
-
2 &&
|
|
3081
|
+
2 && d(
|
|
3078
3082
|
n,
|
|
3079
3083
|
"height",
|
|
3080
3084
|
/*h*/
|
|
3081
3085
|
r[1]
|
|
3082
3086
|
), l & /*computedStyle*/
|
|
3083
|
-
32 &&
|
|
3087
|
+
32 && d(
|
|
3084
3088
|
i,
|
|
3085
3089
|
"style",
|
|
3086
3090
|
/*computedStyle*/
|
|
3087
3091
|
r[5]
|
|
3088
3092
|
), l & /*x*/
|
|
3089
|
-
16 &&
|
|
3093
|
+
16 && d(
|
|
3090
3094
|
i,
|
|
3091
3095
|
"x",
|
|
3092
3096
|
/*x*/
|
|
3093
3097
|
r[4]
|
|
3094
3098
|
), l & /*y*/
|
|
3095
|
-
8 &&
|
|
3099
|
+
8 && d(
|
|
3096
3100
|
i,
|
|
3097
3101
|
"y",
|
|
3098
3102
|
/*y*/
|
|
3099
3103
|
r[3]
|
|
3100
3104
|
), l & /*w*/
|
|
3101
|
-
4 &&
|
|
3105
|
+
4 && d(
|
|
3102
3106
|
i,
|
|
3103
3107
|
"width",
|
|
3104
3108
|
/*w*/
|
|
3105
3109
|
r[2]
|
|
3106
3110
|
), l & /*h*/
|
|
3107
|
-
2 &&
|
|
3111
|
+
2 && d(
|
|
3108
3112
|
i,
|
|
3109
3113
|
"height",
|
|
3110
3114
|
/*h*/
|
|
3111
3115
|
r[1]
|
|
3112
3116
|
), l & /*annotation*/
|
|
3113
3117
|
1 && s !== (s = /*annotation*/
|
|
3114
|
-
r[0].id) &&
|
|
3118
|
+
r[0].id) && d(t, "data-id", s);
|
|
3115
3119
|
},
|
|
3116
3120
|
i: j,
|
|
3117
3121
|
o: j,
|
|
@@ -3120,44 +3124,44 @@ function pi(e) {
|
|
|
3120
3124
|
}
|
|
3121
3125
|
};
|
|
3122
3126
|
}
|
|
3123
|
-
function
|
|
3124
|
-
let o, i, s, r, l, { annotation: a } = t, { geom: c } = t, { style:
|
|
3125
|
-
return e.$$set = (
|
|
3126
|
-
"annotation" in
|
|
3127
|
+
function mi(e, t, n) {
|
|
3128
|
+
let o, i, s, r, l, { annotation: a } = t, { geom: c } = t, { style: u } = t;
|
|
3129
|
+
return e.$$set = (f) => {
|
|
3130
|
+
"annotation" in f && n(0, a = f.annotation), "geom" in f && n(6, c = f.geom), "style" in f && n(7, u = f.style);
|
|
3127
3131
|
}, e.$$.update = () => {
|
|
3128
3132
|
e.$$.dirty & /*annotation, style*/
|
|
3129
|
-
129 && n(5, o =
|
|
3133
|
+
129 && n(5, o = Qe(a, u)), e.$$.dirty & /*geom*/
|
|
3130
3134
|
64 && n(4, { x: i, y: s, w: r, h: l } = c, i, (n(3, s), n(6, c)), (n(2, r), n(6, c)), (n(1, l), n(6, c)));
|
|
3131
|
-
}, [a, l, r, s, i, o, c,
|
|
3135
|
+
}, [a, l, r, s, i, o, c, u];
|
|
3132
3136
|
}
|
|
3133
|
-
class
|
|
3137
|
+
class pi extends ne {
|
|
3134
3138
|
constructor(t) {
|
|
3135
|
-
super(), te(this, t,
|
|
3139
|
+
super(), te(this, t, mi, gi, Q, { annotation: 0, geom: 6, style: 7 });
|
|
3136
3140
|
}
|
|
3137
3141
|
}
|
|
3138
|
-
const
|
|
3142
|
+
const Ki = {
|
|
3139
3143
|
elementToImage: (e, t) => [e, t]
|
|
3140
|
-
},
|
|
3144
|
+
}, yi = (e) => ({
|
|
3141
3145
|
elementToImage: (t, n) => {
|
|
3142
3146
|
const o = e.getBoundingClientRect(), i = e.createSVGPoint();
|
|
3143
3147
|
i.x = t + o.x, i.y = n + o.y;
|
|
3144
3148
|
const { x: s, y: r } = i.matrixTransform(e.getScreenCTM().inverse());
|
|
3145
3149
|
return [s, r];
|
|
3146
3150
|
}
|
|
3147
|
-
}),
|
|
3151
|
+
}), _i = 250, wi = (e, t) => {
|
|
3148
3152
|
const n = ke();
|
|
3149
3153
|
let o;
|
|
3150
3154
|
return { onPointerDown: () => o = performance.now(), onPointerUp: (r) => {
|
|
3151
|
-
if (performance.now() - o <
|
|
3152
|
-
const { x: a, y: c } =
|
|
3153
|
-
|
|
3155
|
+
if (performance.now() - o < _i) {
|
|
3156
|
+
const { x: a, y: c } = un(r, e), u = t.getAt(a, c);
|
|
3157
|
+
u ? n("click", { originalEvent: r, annotation: u }) : n("click", { originalEvent: r });
|
|
3154
3158
|
}
|
|
3155
3159
|
} };
|
|
3156
|
-
},
|
|
3160
|
+
}, un = (e, t) => {
|
|
3157
3161
|
const n = t.createSVGPoint(), o = t.getBoundingClientRect(), i = e.clientX - o.x, s = e.clientY - o.y, { left: r, top: l } = t.getBoundingClientRect();
|
|
3158
3162
|
return n.x = i + r, n.y = s + l, n.matrixTransform(t.getScreenCTM().inverse());
|
|
3159
3163
|
};
|
|
3160
|
-
function
|
|
3164
|
+
function Ct(e, t, n) {
|
|
3161
3165
|
const o = e.slice();
|
|
3162
3166
|
o[37] = t[n];
|
|
3163
3167
|
const i = (
|
|
@@ -3169,22 +3173,22 @@ function Rt(e, t, n) {
|
|
|
3169
3173
|
);
|
|
3170
3174
|
return o[38] = i, o;
|
|
3171
3175
|
}
|
|
3172
|
-
function
|
|
3176
|
+
function Xt(e, t, n) {
|
|
3173
3177
|
const o = e.slice();
|
|
3174
3178
|
return o[41] = t[n], o;
|
|
3175
3179
|
}
|
|
3176
|
-
function
|
|
3180
|
+
function lt(e) {
|
|
3177
3181
|
const t = e.slice(), n = (
|
|
3178
3182
|
/*annotation*/
|
|
3179
3183
|
t[41].target.selector
|
|
3180
3184
|
);
|
|
3181
3185
|
return t[44] = n, t;
|
|
3182
3186
|
}
|
|
3183
|
-
function
|
|
3187
|
+
function Rt(e) {
|
|
3184
3188
|
let t = (
|
|
3185
3189
|
/*annotation*/
|
|
3186
3190
|
e[41].id
|
|
3187
|
-
), n, o, i =
|
|
3191
|
+
), n, o, i = Nt(e);
|
|
3188
3192
|
return {
|
|
3189
3193
|
c() {
|
|
3190
3194
|
i.c(), n = le();
|
|
@@ -3195,10 +3199,10 @@ function Ut(e) {
|
|
|
3195
3199
|
p(s, r) {
|
|
3196
3200
|
r[0] & /*$store*/
|
|
3197
3201
|
32768 && Q(t, t = /*annotation*/
|
|
3198
|
-
s[41].id) ? (se(), C(i, 1, 1, j), re(), i =
|
|
3202
|
+
s[41].id) ? (se(), C(i, 1, 1, j), re(), i = Nt(s), i.c(), Y(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3199
3203
|
},
|
|
3200
3204
|
i(s) {
|
|
3201
|
-
o || (
|
|
3205
|
+
o || (Y(i), o = !0);
|
|
3202
3206
|
},
|
|
3203
3207
|
o(s) {
|
|
3204
3208
|
C(i), o = !1;
|
|
@@ -3208,9 +3212,9 @@ function Ut(e) {
|
|
|
3208
3212
|
}
|
|
3209
3213
|
};
|
|
3210
3214
|
}
|
|
3211
|
-
function
|
|
3215
|
+
function bi(e) {
|
|
3212
3216
|
let t, n;
|
|
3213
|
-
return t = new
|
|
3217
|
+
return t = new hi({
|
|
3214
3218
|
props: {
|
|
3215
3219
|
annotation: (
|
|
3216
3220
|
/*annotation*/
|
|
@@ -3243,7 +3247,7 @@ function Ai(e) {
|
|
|
3243
3247
|
o[1]), t.$set(s);
|
|
3244
3248
|
},
|
|
3245
3249
|
i(o) {
|
|
3246
|
-
n || (
|
|
3250
|
+
n || (Y(t.$$.fragment, o), n = !0);
|
|
3247
3251
|
},
|
|
3248
3252
|
o(o) {
|
|
3249
3253
|
C(t.$$.fragment, o), n = !1;
|
|
@@ -3253,9 +3257,9 @@ function Ai(e) {
|
|
|
3253
3257
|
}
|
|
3254
3258
|
};
|
|
3255
3259
|
}
|
|
3256
|
-
function
|
|
3260
|
+
function Ei(e) {
|
|
3257
3261
|
let t, n;
|
|
3258
|
-
return t = new
|
|
3262
|
+
return t = new pi({
|
|
3259
3263
|
props: {
|
|
3260
3264
|
annotation: (
|
|
3261
3265
|
/*annotation*/
|
|
@@ -3288,7 +3292,7 @@ function Si(e) {
|
|
|
3288
3292
|
o[1]), t.$set(s);
|
|
3289
3293
|
},
|
|
3290
3294
|
i(o) {
|
|
3291
|
-
n || (
|
|
3295
|
+
n || (Y(t.$$.fragment, o), n = !0);
|
|
3292
3296
|
},
|
|
3293
3297
|
o(o) {
|
|
3294
3298
|
C(t.$$.fragment, o), n = !1;
|
|
@@ -3298,10 +3302,10 @@ function Si(e) {
|
|
|
3298
3302
|
}
|
|
3299
3303
|
};
|
|
3300
3304
|
}
|
|
3301
|
-
function
|
|
3305
|
+
function Ai(e) {
|
|
3302
3306
|
var o;
|
|
3303
3307
|
let t, n;
|
|
3304
|
-
return t = new
|
|
3308
|
+
return t = new ai({
|
|
3305
3309
|
props: {
|
|
3306
3310
|
annotation: (
|
|
3307
3311
|
/*annotation*/
|
|
@@ -3335,7 +3339,7 @@ function vi(e) {
|
|
|
3335
3339
|
i[1]), t.$set(r);
|
|
3336
3340
|
},
|
|
3337
3341
|
i(i) {
|
|
3338
|
-
n || (
|
|
3342
|
+
n || (Y(t.$$.fragment, i), n = !0);
|
|
3339
3343
|
},
|
|
3340
3344
|
o(i) {
|
|
3341
3345
|
C(t.$$.fragment, i), n = !1;
|
|
@@ -3345,16 +3349,16 @@ function vi(e) {
|
|
|
3345
3349
|
}
|
|
3346
3350
|
};
|
|
3347
3351
|
}
|
|
3348
|
-
function
|
|
3352
|
+
function Nt(e) {
|
|
3349
3353
|
let t, n, o, i;
|
|
3350
|
-
const s = [
|
|
3354
|
+
const s = [Ai, Ei, bi], r = [];
|
|
3351
3355
|
function l(a, c) {
|
|
3352
|
-
var
|
|
3356
|
+
var u, f, h;
|
|
3353
3357
|
return (
|
|
3354
3358
|
/*selector*/
|
|
3355
|
-
((
|
|
3359
|
+
((u = a[44]) == null ? void 0 : u.type) === F.ELLIPSE ? 0 : (
|
|
3356
3360
|
/*selector*/
|
|
3357
|
-
((
|
|
3361
|
+
((f = a[44]) == null ? void 0 : f.type) === F.RECTANGLE ? 1 : (
|
|
3358
3362
|
/*selector*/
|
|
3359
3363
|
((h = a[44]) == null ? void 0 : h.type) === F.POLYGON ? 2 : -1
|
|
3360
3364
|
)
|
|
@@ -3369,13 +3373,13 @@ function Vt(e) {
|
|
|
3369
3373
|
~t && r[t].m(a, c), B(a, o, c), i = !0;
|
|
3370
3374
|
},
|
|
3371
3375
|
p(a, c) {
|
|
3372
|
-
let
|
|
3373
|
-
t = l(a), t ===
|
|
3374
|
-
r[
|
|
3375
|
-
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()),
|
|
3376
|
+
let u = t;
|
|
3377
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (se(), C(r[u], 1, 1, () => {
|
|
3378
|
+
r[u] = null;
|
|
3379
|
+
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), Y(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3376
3380
|
},
|
|
3377
3381
|
i(a) {
|
|
3378
|
-
i || (
|
|
3382
|
+
i || (Y(n), i = !0);
|
|
3379
3383
|
},
|
|
3380
3384
|
o(a) {
|
|
3381
3385
|
C(n), i = !1;
|
|
@@ -3385,15 +3389,15 @@ function Vt(e) {
|
|
|
3385
3389
|
}
|
|
3386
3390
|
};
|
|
3387
3391
|
}
|
|
3388
|
-
function
|
|
3389
|
-
let t =
|
|
3392
|
+
function Ut(e) {
|
|
3393
|
+
let t = Je(
|
|
3390
3394
|
/*annotation*/
|
|
3391
3395
|
e[41]
|
|
3392
3396
|
) && !/*isEditable*/
|
|
3393
3397
|
e[8](
|
|
3394
3398
|
/*annotation*/
|
|
3395
3399
|
e[41]
|
|
3396
|
-
), n, o, i = t &&
|
|
3400
|
+
), n, o, i = t && Rt(lt(e));
|
|
3397
3401
|
return {
|
|
3398
3402
|
c() {
|
|
3399
3403
|
i && i.c(), n = le();
|
|
@@ -3403,20 +3407,20 @@ function Gt(e) {
|
|
|
3403
3407
|
},
|
|
3404
3408
|
p(s, r) {
|
|
3405
3409
|
r[0] & /*$store, isEditable*/
|
|
3406
|
-
33024 && (t =
|
|
3410
|
+
33024 && (t = Je(
|
|
3407
3411
|
/*annotation*/
|
|
3408
3412
|
s[41]
|
|
3409
3413
|
) && !/*isEditable*/
|
|
3410
3414
|
s[8](
|
|
3411
3415
|
/*annotation*/
|
|
3412
3416
|
s[41]
|
|
3413
|
-
)), t ? i ? (i.p(
|
|
3414
|
-
33024 &&
|
|
3417
|
+
)), t ? i ? (i.p(lt(s), r), r[0] & /*$store, isEditable*/
|
|
3418
|
+
33024 && Y(i, 1)) : (i = Rt(lt(s)), i.c(), Y(i, 1), i.m(n.parentNode, n)) : i && (se(), C(i, 1, 1, () => {
|
|
3415
3419
|
i = null;
|
|
3416
3420
|
}), re());
|
|
3417
3421
|
},
|
|
3418
3422
|
i(s) {
|
|
3419
|
-
o || (
|
|
3423
|
+
o || (Y(i), o = !0);
|
|
3420
3424
|
},
|
|
3421
3425
|
o(s) {
|
|
3422
3426
|
C(i), o = !1;
|
|
@@ -3426,9 +3430,9 @@ function Gt(e) {
|
|
|
3426
3430
|
}
|
|
3427
3431
|
};
|
|
3428
3432
|
}
|
|
3429
|
-
function
|
|
3433
|
+
function Vt(e) {
|
|
3430
3434
|
let t, n, o, i;
|
|
3431
|
-
const s = [
|
|
3435
|
+
const s = [Ti, Si], r = [];
|
|
3432
3436
|
function l(a, c) {
|
|
3433
3437
|
return (
|
|
3434
3438
|
/*editableAnnotations*/
|
|
@@ -3447,13 +3451,13 @@ function jt(e) {
|
|
|
3447
3451
|
~t && r[t].m(a, c), B(a, o, c), i = !0;
|
|
3448
3452
|
},
|
|
3449
3453
|
p(a, c) {
|
|
3450
|
-
let
|
|
3451
|
-
t = l(a), t ===
|
|
3452
|
-
r[
|
|
3453
|
-
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()),
|
|
3454
|
+
let u = t;
|
|
3455
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (se(), C(r[u], 1, 1, () => {
|
|
3456
|
+
r[u] = null;
|
|
3457
|
+
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), Y(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3454
3458
|
},
|
|
3455
3459
|
i(a) {
|
|
3456
|
-
i || (
|
|
3460
|
+
i || (Y(n), i = !0);
|
|
3457
3461
|
},
|
|
3458
3462
|
o(a) {
|
|
3459
3463
|
C(n), i = !1;
|
|
@@ -3463,11 +3467,11 @@ function jt(e) {
|
|
|
3463
3467
|
}
|
|
3464
3468
|
};
|
|
3465
3469
|
}
|
|
3466
|
-
function
|
|
3470
|
+
function Si(e) {
|
|
3467
3471
|
let t = (
|
|
3468
3472
|
/*toolName*/
|
|
3469
3473
|
e[2]
|
|
3470
|
-
), n, o, i =
|
|
3474
|
+
), n, o, i = Gt(e);
|
|
3471
3475
|
return {
|
|
3472
3476
|
c() {
|
|
3473
3477
|
i.c(), n = le();
|
|
@@ -3478,10 +3482,10 @@ function Ti(e) {
|
|
|
3478
3482
|
p(s, r) {
|
|
3479
3483
|
r[0] & /*toolName*/
|
|
3480
3484
|
4 && Q(t, t = /*toolName*/
|
|
3481
|
-
s[2]) ? (se(), C(i, 1, 1, j), re(), i =
|
|
3485
|
+
s[2]) ? (se(), C(i, 1, 1, j), re(), i = Gt(s), i.c(), Y(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3482
3486
|
},
|
|
3483
3487
|
i(s) {
|
|
3484
|
-
o || (
|
|
3488
|
+
o || (Y(i), o = !0);
|
|
3485
3489
|
},
|
|
3486
3490
|
o(s) {
|
|
3487
3491
|
C(i), o = !1;
|
|
@@ -3491,13 +3495,13 @@ function Ti(e) {
|
|
|
3491
3495
|
}
|
|
3492
3496
|
};
|
|
3493
3497
|
}
|
|
3494
|
-
function
|
|
3498
|
+
function Ti(e) {
|
|
3495
3499
|
let t, n, o = Le(
|
|
3496
3500
|
/*editableAnnotations*/
|
|
3497
3501
|
e[7]
|
|
3498
3502
|
), i = [];
|
|
3499
3503
|
for (let r = 0; r < o.length; r += 1)
|
|
3500
|
-
i[r] =
|
|
3504
|
+
i[r] = Ht(Ct(e, o, r));
|
|
3501
3505
|
const s = (r) => C(i[r], 1, 1, () => {
|
|
3502
3506
|
i[r] = null;
|
|
3503
3507
|
});
|
|
@@ -3521,8 +3525,8 @@ function Mi(e) {
|
|
|
3521
3525
|
);
|
|
3522
3526
|
let a;
|
|
3523
3527
|
for (a = 0; a < o.length; a += 1) {
|
|
3524
|
-
const c =
|
|
3525
|
-
i[a] ? (i[a].p(c, l),
|
|
3528
|
+
const c = Ct(r, o, a);
|
|
3529
|
+
i[a] ? (i[a].p(c, l), Y(i[a], 1)) : (i[a] = Ht(c), i[a].c(), Y(i[a], 1), i[a].m(t.parentNode, t));
|
|
3526
3530
|
}
|
|
3527
3531
|
for (se(), a = o.length; a < i.length; a += 1)
|
|
3528
3532
|
s(a);
|
|
@@ -3532,7 +3536,7 @@ function Mi(e) {
|
|
|
3532
3536
|
i(r) {
|
|
3533
3537
|
if (!n) {
|
|
3534
3538
|
for (let l = 0; l < o.length; l += 1)
|
|
3535
|
-
|
|
3539
|
+
Y(i[l]);
|
|
3536
3540
|
n = !0;
|
|
3537
3541
|
}
|
|
3538
3542
|
},
|
|
@@ -3543,13 +3547,13 @@ function Mi(e) {
|
|
|
3543
3547
|
n = !1;
|
|
3544
3548
|
},
|
|
3545
3549
|
d(r) {
|
|
3546
|
-
r && O(t),
|
|
3550
|
+
r && O(t), gt(i, r);
|
|
3547
3551
|
}
|
|
3548
3552
|
};
|
|
3549
3553
|
}
|
|
3550
|
-
function
|
|
3554
|
+
function Gt(e) {
|
|
3551
3555
|
let t, n;
|
|
3552
|
-
return t = new
|
|
3556
|
+
return t = new Qo({
|
|
3553
3557
|
props: {
|
|
3554
3558
|
target: (
|
|
3555
3559
|
/*drawingEl*/
|
|
@@ -3598,7 +3602,7 @@ function zt(e) {
|
|
|
3598
3602
|
o[16]), t.$set(s);
|
|
3599
3603
|
},
|
|
3600
3604
|
i(o) {
|
|
3601
|
-
n || (
|
|
3605
|
+
n || (Y(t.$$.fragment, o), n = !0);
|
|
3602
3606
|
},
|
|
3603
3607
|
o(o) {
|
|
3604
3608
|
C(t.$$.fragment, o), n = !1;
|
|
@@ -3608,11 +3612,11 @@ function zt(e) {
|
|
|
3608
3612
|
}
|
|
3609
3613
|
};
|
|
3610
3614
|
}
|
|
3611
|
-
function
|
|
3615
|
+
function jt(e) {
|
|
3612
3616
|
let t = (
|
|
3613
3617
|
/*editable*/
|
|
3614
3618
|
e[37].id
|
|
3615
|
-
), n, o, i =
|
|
3619
|
+
), n, o, i = zt(e);
|
|
3616
3620
|
return {
|
|
3617
3621
|
c() {
|
|
3618
3622
|
i.c(), n = le();
|
|
@@ -3623,10 +3627,10 @@ function Ht(e) {
|
|
|
3623
3627
|
p(s, r) {
|
|
3624
3628
|
r[0] & /*editableAnnotations*/
|
|
3625
3629
|
128 && Q(t, t = /*editable*/
|
|
3626
|
-
s[37].id) ? (se(), C(i, 1, 1, j), re(), i =
|
|
3630
|
+
s[37].id) ? (se(), C(i, 1, 1, j), re(), i = zt(s), i.c(), Y(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3627
3631
|
},
|
|
3628
3632
|
i(s) {
|
|
3629
|
-
o || (
|
|
3633
|
+
o || (Y(i), o = !0);
|
|
3630
3634
|
},
|
|
3631
3635
|
o(s) {
|
|
3632
3636
|
C(i), o = !1;
|
|
@@ -3636,9 +3640,9 @@ function Ht(e) {
|
|
|
3636
3640
|
}
|
|
3637
3641
|
};
|
|
3638
3642
|
}
|
|
3639
|
-
function
|
|
3643
|
+
function zt(e) {
|
|
3640
3644
|
let t, n;
|
|
3641
|
-
return t = new
|
|
3645
|
+
return t = new Ko({
|
|
3642
3646
|
props: {
|
|
3643
3647
|
target: (
|
|
3644
3648
|
/*drawingEl*/
|
|
@@ -3707,7 +3711,7 @@ function Ft(e) {
|
|
|
3707
3711
|
e[16]), t.$set(s);
|
|
3708
3712
|
},
|
|
3709
3713
|
i(o) {
|
|
3710
|
-
n || (
|
|
3714
|
+
n || (Y(t.$$.fragment, o), n = !0);
|
|
3711
3715
|
},
|
|
3712
3716
|
o(o) {
|
|
3713
3717
|
C(t.$$.fragment, o), n = !1;
|
|
@@ -3717,10 +3721,10 @@ function Ft(e) {
|
|
|
3717
3721
|
}
|
|
3718
3722
|
};
|
|
3719
3723
|
}
|
|
3720
|
-
function
|
|
3724
|
+
function Ht(e) {
|
|
3721
3725
|
let t, n, o = (
|
|
3722
3726
|
/*editor*/
|
|
3723
|
-
e[38] &&
|
|
3727
|
+
e[38] && jt(e)
|
|
3724
3728
|
);
|
|
3725
3729
|
return {
|
|
3726
3730
|
c() {
|
|
@@ -3732,12 +3736,12 @@ function Wt(e) {
|
|
|
3732
3736
|
p(i, s) {
|
|
3733
3737
|
/*editor*/
|
|
3734
3738
|
i[38] ? o ? (o.p(i, s), s[0] & /*editableAnnotations*/
|
|
3735
|
-
128 &&
|
|
3739
|
+
128 && Y(o, 1)) : (o = jt(i), o.c(), Y(o, 1), o.m(t.parentNode, t)) : o && (se(), C(o, 1, 1, () => {
|
|
3736
3740
|
o = null;
|
|
3737
3741
|
}), re());
|
|
3738
3742
|
},
|
|
3739
3743
|
i(i) {
|
|
3740
|
-
n || (
|
|
3744
|
+
n || (Y(o), n = !0);
|
|
3741
3745
|
},
|
|
3742
3746
|
o(i) {
|
|
3743
3747
|
C(o), n = !1;
|
|
@@ -3747,7 +3751,7 @@ function Wt(e) {
|
|
|
3747
3751
|
}
|
|
3748
3752
|
};
|
|
3749
3753
|
}
|
|
3750
|
-
function
|
|
3754
|
+
function vi(e) {
|
|
3751
3755
|
let t, n, o, i, s, r, l = Le(
|
|
3752
3756
|
/*$store*/
|
|
3753
3757
|
e[15].filter(
|
|
@@ -3755,21 +3759,21 @@ function Li(e) {
|
|
|
3755
3759
|
e[32]
|
|
3756
3760
|
)
|
|
3757
3761
|
), a = [];
|
|
3758
|
-
for (let
|
|
3759
|
-
a[
|
|
3760
|
-
const c = (
|
|
3761
|
-
a[
|
|
3762
|
+
for (let f = 0; f < l.length; f += 1)
|
|
3763
|
+
a[f] = Ut(Xt(e, l, f));
|
|
3764
|
+
const c = (f) => C(a[f], 1, 1, () => {
|
|
3765
|
+
a[f] = null;
|
|
3762
3766
|
});
|
|
3763
|
-
let
|
|
3767
|
+
let u = (
|
|
3764
3768
|
/*drawingEl*/
|
|
3765
|
-
e[5] &&
|
|
3769
|
+
e[5] && Vt(e)
|
|
3766
3770
|
);
|
|
3767
3771
|
return {
|
|
3768
3772
|
c() {
|
|
3769
3773
|
t = X("svg"), n = X("g");
|
|
3770
|
-
for (let
|
|
3771
|
-
a[
|
|
3772
|
-
o = X("g"),
|
|
3774
|
+
for (let f = 0; f < a.length; f += 1)
|
|
3775
|
+
a[f].c();
|
|
3776
|
+
o = X("g"), u && u.c(), d(o, "class", "drawing"), d(t, "class", "a9s-annotationlayer"), pe(
|
|
3773
3777
|
t,
|
|
3774
3778
|
"drawing",
|
|
3775
3779
|
/*tool*/
|
|
@@ -3782,11 +3786,11 @@ function Li(e) {
|
|
|
3782
3786
|
e[14]
|
|
3783
3787
|
);
|
|
3784
3788
|
},
|
|
3785
|
-
m(
|
|
3786
|
-
B(
|
|
3789
|
+
m(f, h) {
|
|
3790
|
+
B(f, t, h), he(t, n);
|
|
3787
3791
|
for (let g = 0; g < a.length; g += 1)
|
|
3788
3792
|
a[g] && a[g].m(n, null);
|
|
3789
|
-
he(t, o),
|
|
3793
|
+
he(t, o), u && u.m(o, null), e[33](o), e[34](t), i = !0, s || (r = [
|
|
3790
3794
|
H(t, "pointerup", function() {
|
|
3791
3795
|
W(
|
|
3792
3796
|
/*onPointerUp*/
|
|
@@ -3807,8 +3811,8 @@ function Li(e) {
|
|
|
3807
3811
|
)
|
|
3808
3812
|
], s = !0);
|
|
3809
3813
|
},
|
|
3810
|
-
p(
|
|
3811
|
-
if (e =
|
|
3814
|
+
p(f, h) {
|
|
3815
|
+
if (e = f, h[0] & /*$store, style, isEditable*/
|
|
3812
3816
|
33026) {
|
|
3813
3817
|
l = Le(
|
|
3814
3818
|
/*$store*/
|
|
@@ -3819,17 +3823,17 @@ function Li(e) {
|
|
|
3819
3823
|
);
|
|
3820
3824
|
let g;
|
|
3821
3825
|
for (g = 0; g < l.length; g += 1) {
|
|
3822
|
-
const m =
|
|
3823
|
-
a[g] ? (a[g].p(m, h),
|
|
3826
|
+
const m = Xt(e, l, g);
|
|
3827
|
+
a[g] ? (a[g].p(m, h), Y(a[g], 1)) : (a[g] = Ut(m), a[g].c(), Y(a[g], 1), a[g].m(n, null));
|
|
3824
3828
|
}
|
|
3825
3829
|
for (se(), g = l.length; g < a.length; g += 1)
|
|
3826
3830
|
c(g);
|
|
3827
3831
|
re();
|
|
3828
3832
|
}
|
|
3829
3833
|
/*drawingEl*/
|
|
3830
|
-
e[5] ?
|
|
3831
|
-
32 &&
|
|
3832
|
-
|
|
3834
|
+
e[5] ? u ? (u.p(e, h), h[0] & /*drawingEl*/
|
|
3835
|
+
32 && Y(u, 1)) : (u = Vt(e), u.c(), Y(u, 1), u.m(o, null)) : u && (se(), C(u, 1, 1, () => {
|
|
3836
|
+
u = null;
|
|
3833
3837
|
}), re()), (!i || h[0] & /*tool*/
|
|
3834
3838
|
8192) && pe(
|
|
3835
3839
|
t,
|
|
@@ -3846,43 +3850,43 @@ function Li(e) {
|
|
|
3846
3850
|
e[14]
|
|
3847
3851
|
);
|
|
3848
3852
|
},
|
|
3849
|
-
i(
|
|
3853
|
+
i(f) {
|
|
3850
3854
|
if (!i) {
|
|
3851
3855
|
for (let h = 0; h < l.length; h += 1)
|
|
3852
|
-
|
|
3853
|
-
|
|
3856
|
+
Y(a[h]);
|
|
3857
|
+
Y(u), i = !0;
|
|
3854
3858
|
}
|
|
3855
3859
|
},
|
|
3856
|
-
o(
|
|
3860
|
+
o(f) {
|
|
3857
3861
|
a = a.filter(Boolean);
|
|
3858
3862
|
for (let h = 0; h < a.length; h += 1)
|
|
3859
3863
|
C(a[h]);
|
|
3860
|
-
C(
|
|
3864
|
+
C(u), i = !1;
|
|
3861
3865
|
},
|
|
3862
|
-
d(
|
|
3863
|
-
|
|
3866
|
+
d(f) {
|
|
3867
|
+
f && O(t), gt(a, f), u && u.d(), e[33](null), e[34](null), s = !1, ge(r);
|
|
3864
3868
|
}
|
|
3865
3869
|
};
|
|
3866
3870
|
}
|
|
3867
|
-
function
|
|
3868
|
-
let o, i, s, r, l, a, c,
|
|
3871
|
+
function Mi(e, t, n) {
|
|
3872
|
+
let o, i, s, r, l, a, c, u, f, h, g, m = j, w = () => (m(), m = Jt(b, (k) => n(16, g = k)), b);
|
|
3869
3873
|
e.$$.on_destroy.push(() => m());
|
|
3870
|
-
let { drawingEnabled:
|
|
3871
|
-
const V = () => I, Z = () =>
|
|
3874
|
+
let { drawingEnabled: T } = t, { image: y } = t, { preferredDrawingMode: p } = t, { state: _ } = t, { style: E = void 0 } = t, { toolName: I = cn()[0] } = t, { user: R } = t, { visible: U = !0 } = t;
|
|
3875
|
+
const V = () => I, Z = () => T;
|
|
3872
3876
|
let A, S, b;
|
|
3873
|
-
Ne(() =>
|
|
3874
|
-
const { hover:
|
|
3875
|
-
|
|
3877
|
+
Ne(() => w(n(6, b = Do(y, S))));
|
|
3878
|
+
const { hover: v, selection: P, store: D } = _;
|
|
3879
|
+
xe(e, v, (k) => n(14, u = k)), xe(e, P, (k) => n(31, f = k)), xe(e, D, (k) => n(15, h = k));
|
|
3876
3880
|
let z, oe;
|
|
3877
3881
|
const ae = (k) => {
|
|
3878
3882
|
z && D.unobserve(z);
|
|
3879
3883
|
const J = k.filter(({ editable: L }) => L).map(({ id: L }) => L);
|
|
3880
|
-
J.length > 0 ? (n(7, oe = J.map((L) => D.getAnnotation(L)).filter((L) => L &&
|
|
3884
|
+
J.length > 0 ? (n(7, oe = J.map((L) => D.getAnnotation(L)).filter((L) => L && Je(L))), z = (L) => {
|
|
3881
3885
|
const { updated: M } = L.changes;
|
|
3882
|
-
n(7, oe = M == null ? void 0 : M.map((
|
|
3886
|
+
n(7, oe = M == null ? void 0 : M.map((de) => de.newValue));
|
|
3883
3887
|
}, D.observe(z, { annotations: J })) : n(7, oe = void 0);
|
|
3884
3888
|
}, Ie = (k) => {
|
|
3885
|
-
const J =
|
|
3889
|
+
const J = tn(), L = {
|
|
3886
3890
|
id: J,
|
|
3887
3891
|
bodies: [],
|
|
3888
3892
|
target: {
|
|
@@ -3892,43 +3896,43 @@ function ki(e, t, n) {
|
|
|
3892
3896
|
created: /* @__PURE__ */ new Date()
|
|
3893
3897
|
}
|
|
3894
3898
|
};
|
|
3895
|
-
D.addAnnotation(L),
|
|
3899
|
+
D.addAnnotation(L), P.setSelected(L.id);
|
|
3896
3900
|
}, ce = (k) => (J) => {
|
|
3897
3901
|
var _e;
|
|
3898
|
-
const { target: L } = k, M = 10 * 60 * 1e3,
|
|
3902
|
+
const { target: L } = k, M = 10 * 60 * 1e3, de = ((_e = L.creator) == null ? void 0 : _e.id) !== R.id || !L.created || (/* @__PURE__ */ new Date()).getTime() - L.created.getTime() > M;
|
|
3899
3903
|
D.updateTarget({
|
|
3900
3904
|
...L,
|
|
3901
3905
|
selector: J.detail,
|
|
3902
|
-
created:
|
|
3903
|
-
updated:
|
|
3904
|
-
updatedBy:
|
|
3906
|
+
created: de ? L.created : /* @__PURE__ */ new Date(),
|
|
3907
|
+
updated: de ? /* @__PURE__ */ new Date() : void 0,
|
|
3908
|
+
updatedBy: de ? R : void 0
|
|
3905
3909
|
});
|
|
3906
3910
|
}, Oe = (k) => {
|
|
3907
|
-
const { x: J, y: L } =
|
|
3908
|
-
M ?
|
|
3909
|
-
},
|
|
3910
|
-
function
|
|
3911
|
-
|
|
3911
|
+
const { x: J, y: L } = un(k, S), M = D.getAt(J, L);
|
|
3912
|
+
M ? u !== M.id && v.set(M.id) : v.set(void 0);
|
|
3913
|
+
}, fe = (k) => jo(k), Be = (k) => Je(k);
|
|
3914
|
+
function ue(k) {
|
|
3915
|
+
qe[k ? "unshift" : "push"](() => {
|
|
3912
3916
|
A = k, n(5, A);
|
|
3913
3917
|
});
|
|
3914
3918
|
}
|
|
3915
3919
|
function N(k) {
|
|
3916
|
-
|
|
3920
|
+
qe[k ? "unshift" : "push"](() => {
|
|
3917
3921
|
S = k, n(4, S);
|
|
3918
3922
|
});
|
|
3919
3923
|
}
|
|
3920
3924
|
return e.$$set = (k) => {
|
|
3921
|
-
"drawingEnabled" in k && n(0,
|
|
3925
|
+
"drawingEnabled" in k && n(0, T = k.drawingEnabled), "image" in k && n(24, y = k.image), "preferredDrawingMode" in k && n(25, p = k.preferredDrawingMode), "state" in k && n(26, _ = k.state), "style" in k && n(1, E = k.style), "toolName" in k && n(2, I = k.toolName), "user" in k && n(27, R = k.user), "visible" in k && n(3, U = k.visible);
|
|
3922
3926
|
}, e.$$.update = () => {
|
|
3923
3927
|
e.$$.dirty[0] & /*toolName*/
|
|
3924
|
-
4 && n(13, { tool: o, opts: i } =
|
|
3925
|
-
1107296256 && n(12, s = (i == null ? void 0 : i.drawingMode) ||
|
|
3926
|
-
16 && n(11, r =
|
|
3927
|
-
16 && n(10, { onPointerDown: l, onPointerUp: a } =
|
|
3928
|
-
1 && n(8, c = (k) =>
|
|
3929
|
-
1 && ae(
|
|
3928
|
+
4 && n(13, { tool: o, opts: i } = fn(I) || { tool: void 0, opts: void 0 }, o, (n(30, i), n(2, I))), e.$$.dirty[0] & /*opts, preferredDrawingMode*/
|
|
3929
|
+
1107296256 && n(12, s = (i == null ? void 0 : i.drawingMode) || p), e.$$.dirty[0] & /*svgEl*/
|
|
3930
|
+
16 && n(11, r = yi(S)), e.$$.dirty[0] & /*svgEl*/
|
|
3931
|
+
16 && n(10, { onPointerDown: l, onPointerUp: a } = wi(S, D), l, (n(9, a), n(4, S))), e.$$.dirty[1] & /*$selection*/
|
|
3932
|
+
1 && n(8, c = (k) => f.selected.find((J) => J.id === k.id && J.editable)), e.$$.dirty[1] & /*$selection*/
|
|
3933
|
+
1 && ae(f.selected);
|
|
3930
3934
|
}, [
|
|
3931
|
-
|
|
3935
|
+
T,
|
|
3932
3936
|
E,
|
|
3933
3937
|
I,
|
|
3934
3938
|
U,
|
|
@@ -3942,36 +3946,36 @@ function ki(e, t, n) {
|
|
|
3942
3946
|
r,
|
|
3943
3947
|
s,
|
|
3944
3948
|
o,
|
|
3945
|
-
|
|
3949
|
+
u,
|
|
3946
3950
|
h,
|
|
3947
3951
|
g,
|
|
3948
|
-
|
|
3949
|
-
|
|
3952
|
+
v,
|
|
3953
|
+
P,
|
|
3950
3954
|
D,
|
|
3951
3955
|
Ie,
|
|
3952
3956
|
ce,
|
|
3953
3957
|
Oe,
|
|
3954
|
-
|
|
3958
|
+
fe,
|
|
3959
|
+
y,
|
|
3955
3960
|
p,
|
|
3956
|
-
w,
|
|
3957
3961
|
_,
|
|
3958
3962
|
R,
|
|
3959
3963
|
V,
|
|
3960
3964
|
Z,
|
|
3961
3965
|
i,
|
|
3962
|
-
|
|
3966
|
+
f,
|
|
3963
3967
|
Be,
|
|
3964
|
-
|
|
3968
|
+
ue,
|
|
3965
3969
|
N
|
|
3966
3970
|
];
|
|
3967
3971
|
}
|
|
3968
|
-
class
|
|
3972
|
+
class Li extends ne {
|
|
3969
3973
|
constructor(t) {
|
|
3970
3974
|
super(), te(
|
|
3971
3975
|
this,
|
|
3972
3976
|
t,
|
|
3973
|
-
|
|
3974
|
-
|
|
3977
|
+
Mi,
|
|
3978
|
+
vi,
|
|
3975
3979
|
Q,
|
|
3976
3980
|
{
|
|
3977
3981
|
drawingEnabled: 0,
|
|
@@ -3996,11 +4000,11 @@ class Ii extends ne {
|
|
|
3996
4000
|
return this.$$.ctx[29];
|
|
3997
4001
|
}
|
|
3998
4002
|
}
|
|
3999
|
-
function
|
|
4003
|
+
function dn(e, t, n = 0, o = e.length - 1, i = ki) {
|
|
4000
4004
|
for (; o > n; ) {
|
|
4001
4005
|
if (o - n > 600) {
|
|
4002
|
-
const a = o - n + 1, c = t - n + 1,
|
|
4003
|
-
|
|
4006
|
+
const a = o - n + 1, c = t - n + 1, u = Math.log(a), f = 0.5 * Math.exp(2 * u / 3), h = 0.5 * Math.sqrt(u * f * (a - f) / a) * (c - a / 2 < 0 ? -1 : 1), g = Math.max(n, Math.floor(t - c * f / a + h)), m = Math.min(o, Math.floor(t + (a - c) * f / a + h));
|
|
4007
|
+
dn(e, t, g, m, i);
|
|
4004
4008
|
}
|
|
4005
4009
|
const s = e[t];
|
|
4006
4010
|
let r = n, l = o;
|
|
@@ -4015,10 +4019,10 @@ function De(e, t, n) {
|
|
|
4015
4019
|
const o = e[t];
|
|
4016
4020
|
e[t] = e[n], e[n] = o;
|
|
4017
4021
|
}
|
|
4018
|
-
function
|
|
4022
|
+
function ki(e, t) {
|
|
4019
4023
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
4020
4024
|
}
|
|
4021
|
-
class
|
|
4025
|
+
class Ii {
|
|
4022
4026
|
constructor(t = 9) {
|
|
4023
4027
|
this._maxEntries = Math.max(4, t), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();
|
|
4024
4028
|
}
|
|
@@ -4028,12 +4032,12 @@ class Bi {
|
|
|
4028
4032
|
search(t) {
|
|
4029
4033
|
let n = this.data;
|
|
4030
4034
|
const o = [];
|
|
4031
|
-
if (!
|
|
4035
|
+
if (!ze(t, n)) return o;
|
|
4032
4036
|
const i = this.toBBox, s = [];
|
|
4033
4037
|
for (; n; ) {
|
|
4034
4038
|
for (let r = 0; r < n.children.length; r++) {
|
|
4035
4039
|
const l = n.children[r], a = n.leaf ? i(l) : l;
|
|
4036
|
-
|
|
4040
|
+
ze(t, a) && (n.leaf ? o.push(l) : ct(t, a) ? this._all(l, o) : s.push(l));
|
|
4037
4041
|
}
|
|
4038
4042
|
n = s.pop();
|
|
4039
4043
|
}
|
|
@@ -4041,13 +4045,13 @@ class Bi {
|
|
|
4041
4045
|
}
|
|
4042
4046
|
collides(t) {
|
|
4043
4047
|
let n = this.data;
|
|
4044
|
-
if (!
|
|
4048
|
+
if (!ze(t, n)) return !1;
|
|
4045
4049
|
const o = [];
|
|
4046
4050
|
for (; n; ) {
|
|
4047
4051
|
for (let i = 0; i < n.children.length; i++) {
|
|
4048
4052
|
const s = n.children[i], r = n.leaf ? this.toBBox(s) : s;
|
|
4049
|
-
if (
|
|
4050
|
-
if (n.leaf ||
|
|
4053
|
+
if (ze(t, r)) {
|
|
4054
|
+
if (n.leaf || ct(t, r)) return !0;
|
|
4051
4055
|
o.push(s);
|
|
4052
4056
|
}
|
|
4053
4057
|
}
|
|
@@ -4080,7 +4084,7 @@ class Bi {
|
|
|
4080
4084
|
return t && this._insert(t, this.data.height - 1), this;
|
|
4081
4085
|
}
|
|
4082
4086
|
clear() {
|
|
4083
|
-
return this.data =
|
|
4087
|
+
return this.data = ve([]), this;
|
|
4084
4088
|
}
|
|
4085
4089
|
remove(t, n) {
|
|
4086
4090
|
if (!t) return this;
|
|
@@ -4089,11 +4093,11 @@ class Bi {
|
|
|
4089
4093
|
let l, a, c;
|
|
4090
4094
|
for (; o || s.length; ) {
|
|
4091
4095
|
if (o || (o = s.pop(), a = s[s.length - 1], l = r.pop(), c = !0), o.leaf) {
|
|
4092
|
-
const
|
|
4093
|
-
if (
|
|
4094
|
-
return o.children.splice(
|
|
4096
|
+
const u = Oi(t, o.children, n);
|
|
4097
|
+
if (u !== -1)
|
|
4098
|
+
return o.children.splice(u, 1), s.push(o), this._condense(s), this;
|
|
4095
4099
|
}
|
|
4096
|
-
!c && !o.leaf &&
|
|
4100
|
+
!c && !o.leaf && ct(o, i) ? (s.push(o), r.push(l), l = 0, a = o, o = o.children[0]) : a ? (l++, o = a.children[l], c = !1) : o = null;
|
|
4097
4101
|
}
|
|
4098
4102
|
return this;
|
|
4099
4103
|
}
|
|
@@ -4122,15 +4126,15 @@ class Bi {
|
|
|
4122
4126
|
const s = o - n + 1;
|
|
4123
4127
|
let r = this._maxEntries, l;
|
|
4124
4128
|
if (s <= r)
|
|
4125
|
-
return l =
|
|
4126
|
-
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l =
|
|
4129
|
+
return l = ve(t.slice(n, o + 1)), Se(l, this.toBBox), l;
|
|
4130
|
+
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l = ve([]), l.leaf = !1, l.height = i;
|
|
4127
4131
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
4128
|
-
|
|
4129
|
-
for (let
|
|
4130
|
-
const
|
|
4131
|
-
|
|
4132
|
-
for (let h =
|
|
4133
|
-
const g = Math.min(h + a - 1,
|
|
4132
|
+
Ft(t, n, o, c, this.compareMinX);
|
|
4133
|
+
for (let u = n; u <= o; u += c) {
|
|
4134
|
+
const f = Math.min(u + c - 1, o);
|
|
4135
|
+
Ft(t, u, f, a, this.compareMinY);
|
|
4136
|
+
for (let h = u; h <= f; h += a) {
|
|
4137
|
+
const g = Math.min(h + a - 1, f);
|
|
4134
4138
|
l.children.push(this._build(t, h, g, i - 1));
|
|
4135
4139
|
}
|
|
4136
4140
|
}
|
|
@@ -4140,8 +4144,8 @@ class Bi {
|
|
|
4140
4144
|
for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {
|
|
4141
4145
|
let s = 1 / 0, r = 1 / 0, l;
|
|
4142
4146
|
for (let a = 0; a < n.children.length; a++) {
|
|
4143
|
-
const c = n.children[a],
|
|
4144
|
-
|
|
4147
|
+
const c = n.children[a], u = at(c), f = Yi(t, c) - u;
|
|
4148
|
+
f < r ? (r = f, s = u < s ? u : s, l = c) : f === r && u < s && (s = u, l = c);
|
|
4145
4149
|
}
|
|
4146
4150
|
n = l || n.children[0];
|
|
4147
4151
|
}
|
|
@@ -4157,37 +4161,37 @@ class Bi {
|
|
|
4157
4161
|
_split(t, n) {
|
|
4158
4162
|
const o = t[n], i = o.children.length, s = this._minEntries;
|
|
4159
4163
|
this._chooseSplitAxis(o, s, i);
|
|
4160
|
-
const r = this._chooseSplitIndex(o, s, i), l =
|
|
4164
|
+
const r = this._chooseSplitIndex(o, s, i), l = ve(o.children.splice(r, o.children.length - r));
|
|
4161
4165
|
l.height = o.height, l.leaf = o.leaf, Se(o, this.toBBox), Se(l, this.toBBox), n ? t[n - 1].children.push(l) : this._splitRoot(o, l);
|
|
4162
4166
|
}
|
|
4163
4167
|
_splitRoot(t, n) {
|
|
4164
|
-
this.data =
|
|
4168
|
+
this.data = ve([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, Se(this.data, this.toBBox);
|
|
4165
4169
|
}
|
|
4166
4170
|
_chooseSplitIndex(t, n, o) {
|
|
4167
4171
|
let i, s = 1 / 0, r = 1 / 0;
|
|
4168
4172
|
for (let l = n; l <= o - n; l++) {
|
|
4169
|
-
const a =
|
|
4170
|
-
|
|
4173
|
+
const a = Pe(t, 0, l, this.toBBox), c = Pe(t, l, o, this.toBBox), u = Pi(a, c), f = at(a) + at(c);
|
|
4174
|
+
u < s ? (s = u, i = l, r = f < r ? f : r) : u === s && f < r && (r = f, i = l);
|
|
4171
4175
|
}
|
|
4172
4176
|
return i || o - n;
|
|
4173
4177
|
}
|
|
4174
4178
|
// sorts node children by the best axis for split
|
|
4175
4179
|
_chooseSplitAxis(t, n, o) {
|
|
4176
|
-
const i = t.leaf ? this.compareMinX :
|
|
4180
|
+
const i = t.leaf ? this.compareMinX : Bi, s = t.leaf ? this.compareMinY : Di, r = this._allDistMargin(t, n, o, i), l = this._allDistMargin(t, n, o, s);
|
|
4177
4181
|
r < l && t.children.sort(i);
|
|
4178
4182
|
}
|
|
4179
4183
|
// total margin of all possible split distributions where each node is at least m full
|
|
4180
4184
|
_allDistMargin(t, n, o, i) {
|
|
4181
4185
|
t.children.sort(i);
|
|
4182
|
-
const s = this.toBBox, r =
|
|
4183
|
-
let a =
|
|
4186
|
+
const s = this.toBBox, r = Pe(t, 0, n, s), l = Pe(t, o - n, o, s);
|
|
4187
|
+
let a = je(r) + je(l);
|
|
4184
4188
|
for (let c = n; c < o - n; c++) {
|
|
4185
|
-
const
|
|
4186
|
-
Ce(r, t.leaf ? s(
|
|
4189
|
+
const u = t.children[c];
|
|
4190
|
+
Ce(r, t.leaf ? s(u) : u), a += je(r);
|
|
4187
4191
|
}
|
|
4188
4192
|
for (let c = o - n - 1; c >= n; c--) {
|
|
4189
|
-
const
|
|
4190
|
-
Ce(l, t.leaf ? s(
|
|
4193
|
+
const u = t.children[c];
|
|
4194
|
+
Ce(l, t.leaf ? s(u) : u), a += je(l);
|
|
4191
4195
|
}
|
|
4192
4196
|
return a;
|
|
4193
4197
|
}
|
|
@@ -4200,17 +4204,17 @@ class Bi {
|
|
|
4200
4204
|
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() : Se(t[n], this.toBBox);
|
|
4201
4205
|
}
|
|
4202
4206
|
}
|
|
4203
|
-
function
|
|
4207
|
+
function Oi(e, t, n) {
|
|
4204
4208
|
if (!n) return t.indexOf(e);
|
|
4205
4209
|
for (let o = 0; o < t.length; o++)
|
|
4206
4210
|
if (n(e, t[o])) return o;
|
|
4207
4211
|
return -1;
|
|
4208
4212
|
}
|
|
4209
4213
|
function Se(e, t) {
|
|
4210
|
-
|
|
4214
|
+
Pe(e, 0, e.children.length, t, e);
|
|
4211
4215
|
}
|
|
4212
|
-
function
|
|
4213
|
-
i || (i =
|
|
4216
|
+
function Pe(e, t, n, o, i) {
|
|
4217
|
+
i || (i = ve(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
4214
4218
|
for (let s = t; s < n; s++) {
|
|
4215
4219
|
const r = e.children[s];
|
|
4216
4220
|
Ce(i, e.leaf ? o(r) : r);
|
|
@@ -4220,32 +4224,32 @@ function Ye(e, t, n, o, i) {
|
|
|
4220
4224
|
function Ce(e, t) {
|
|
4221
4225
|
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;
|
|
4222
4226
|
}
|
|
4223
|
-
function
|
|
4227
|
+
function Bi(e, t) {
|
|
4224
4228
|
return e.minX - t.minX;
|
|
4225
4229
|
}
|
|
4226
|
-
function
|
|
4230
|
+
function Di(e, t) {
|
|
4227
4231
|
return e.minY - t.minY;
|
|
4228
4232
|
}
|
|
4229
|
-
function
|
|
4233
|
+
function at(e) {
|
|
4230
4234
|
return (e.maxX - e.minX) * (e.maxY - e.minY);
|
|
4231
4235
|
}
|
|
4232
|
-
function
|
|
4236
|
+
function je(e) {
|
|
4233
4237
|
return e.maxX - e.minX + (e.maxY - e.minY);
|
|
4234
4238
|
}
|
|
4235
|
-
function
|
|
4239
|
+
function Yi(e, t) {
|
|
4236
4240
|
return (Math.max(t.maxX, e.maxX) - Math.min(t.minX, e.minX)) * (Math.max(t.maxY, e.maxY) - Math.min(t.minY, e.minY));
|
|
4237
4241
|
}
|
|
4238
|
-
function
|
|
4242
|
+
function Pi(e, t) {
|
|
4239
4243
|
const n = Math.max(e.minX, t.minX), o = Math.max(e.minY, t.minY), i = Math.min(e.maxX, t.maxX), s = Math.min(e.maxY, t.maxY);
|
|
4240
4244
|
return Math.max(0, i - n) * Math.max(0, s - o);
|
|
4241
4245
|
}
|
|
4242
|
-
function
|
|
4246
|
+
function ct(e, t) {
|
|
4243
4247
|
return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
|
|
4244
4248
|
}
|
|
4245
|
-
function
|
|
4249
|
+
function ze(e, t) {
|
|
4246
4250
|
return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
|
|
4247
4251
|
}
|
|
4248
|
-
function
|
|
4252
|
+
function ve(e) {
|
|
4249
4253
|
return {
|
|
4250
4254
|
children: e,
|
|
4251
4255
|
height: 1,
|
|
@@ -4256,87 +4260,87 @@ function Te(e) {
|
|
|
4256
4260
|
maxY: -1 / 0
|
|
4257
4261
|
};
|
|
4258
4262
|
}
|
|
4259
|
-
function
|
|
4263
|
+
function Ft(e, t, n, o, i) {
|
|
4260
4264
|
const s = [t, n];
|
|
4261
4265
|
for (; s.length; ) {
|
|
4262
4266
|
if (n = s.pop(), t = s.pop(), n - t <= o) continue;
|
|
4263
4267
|
const r = t + Math.ceil((n - t) / o / 2) * o;
|
|
4264
|
-
|
|
4268
|
+
dn(e, r, t, n, i), s.push(t, r, r, n);
|
|
4265
4269
|
}
|
|
4266
4270
|
}
|
|
4267
|
-
const
|
|
4268
|
-
const e = new
|
|
4271
|
+
const Ci = () => {
|
|
4272
|
+
const e = new Ii(), t = /* @__PURE__ */ new Map(), n = () => [...t.values()], o = () => {
|
|
4269
4273
|
e.clear(), t.clear();
|
|
4270
|
-
}, i = (
|
|
4271
|
-
if (!
|
|
4272
|
-
const { minX: h, minY: g, maxX: m, maxY:
|
|
4273
|
-
e.insert(
|
|
4274
|
-
}, s = (
|
|
4275
|
-
if (!
|
|
4276
|
-
const h = t.get(
|
|
4277
|
-
h && e.remove(h), t.delete(
|
|
4274
|
+
}, i = (f) => {
|
|
4275
|
+
if (!Fe(f)) return;
|
|
4276
|
+
const { minX: h, minY: g, maxX: m, maxY: w } = f.selector.geometry.bounds, T = { minX: h, minY: g, maxX: m, maxY: w, target: f };
|
|
4277
|
+
e.insert(T), t.set(f.annotation, T);
|
|
4278
|
+
}, s = (f) => {
|
|
4279
|
+
if (!Fe(f)) return;
|
|
4280
|
+
const h = t.get(f.annotation);
|
|
4281
|
+
h && e.remove(h), t.delete(f.annotation);
|
|
4278
4282
|
};
|
|
4279
4283
|
return {
|
|
4280
4284
|
all: n,
|
|
4281
4285
|
clear: o,
|
|
4282
|
-
getAt: (
|
|
4286
|
+
getAt: (f, h) => {
|
|
4283
4287
|
const m = e.search({
|
|
4284
|
-
minX:
|
|
4288
|
+
minX: f,
|
|
4285
4289
|
minY: h,
|
|
4286
|
-
maxX:
|
|
4290
|
+
maxX: f,
|
|
4287
4291
|
maxY: h
|
|
4288
|
-
}).map((
|
|
4292
|
+
}).map((w) => w.target).filter((w) => w.selector.type === F.RECTANGLE || kn(w.selector, f, h));
|
|
4289
4293
|
if (m.length > 0)
|
|
4290
|
-
return m.sort((
|
|
4294
|
+
return m.sort((w, T) => ht(w.selector) - ht(T.selector)), m[0];
|
|
4291
4295
|
},
|
|
4292
|
-
getIntersecting: (
|
|
4293
|
-
minX:
|
|
4296
|
+
getIntersecting: (f, h, g, m) => e.search({
|
|
4297
|
+
minX: f,
|
|
4294
4298
|
minY: h,
|
|
4295
|
-
maxX:
|
|
4299
|
+
maxX: f + g,
|
|
4296
4300
|
maxY: h + m
|
|
4297
|
-
}).map((
|
|
4301
|
+
}).map((w) => w.target),
|
|
4298
4302
|
insert: i,
|
|
4299
4303
|
remove: s,
|
|
4300
|
-
set: (
|
|
4304
|
+
set: (f, h = !0) => {
|
|
4301
4305
|
h && o();
|
|
4302
|
-
const g =
|
|
4303
|
-
if (
|
|
4304
|
-
const { minX:
|
|
4305
|
-
return [...m, { minX:
|
|
4306
|
+
const g = f.reduce((m, w) => {
|
|
4307
|
+
if (Fe(w)) {
|
|
4308
|
+
const { minX: T, minY: y, maxX: p, maxY: _ } = w.selector.geometry.bounds;
|
|
4309
|
+
return [...m, { minX: T, minY: y, maxX: p, maxY: _, target: w }];
|
|
4306
4310
|
} else
|
|
4307
4311
|
return m;
|
|
4308
4312
|
}, []);
|
|
4309
4313
|
g.forEach((m) => t.set(m.target.annotation, m)), e.load(g);
|
|
4310
4314
|
},
|
|
4311
4315
|
size: () => e.all().length,
|
|
4312
|
-
update: (
|
|
4313
|
-
s(
|
|
4316
|
+
update: (f, h) => {
|
|
4317
|
+
s(f), i(h);
|
|
4314
4318
|
}
|
|
4315
4319
|
};
|
|
4316
|
-
},
|
|
4317
|
-
const t =
|
|
4320
|
+
}, Xi = (e) => {
|
|
4321
|
+
const t = io(), n = Ci(), o = Wn(t, e.userSelectAction, e.adapter), i = Fn(t), s = co();
|
|
4318
4322
|
return t.observe(({ changes: a }) => {
|
|
4319
|
-
n.set((a.created || []).map((c) => c.target), !1), (a.deleted || []).forEach((c) => n.remove(c.target)), (a.updated || []).forEach(({ oldValue: c, newValue:
|
|
4323
|
+
n.set((a.created || []).map((c) => c.target), !1), (a.deleted || []).forEach((c) => n.remove(c.target)), (a.updated || []).forEach(({ oldValue: c, newValue: u }) => n.update(c.target, u.target));
|
|
4320
4324
|
}), {
|
|
4321
4325
|
store: {
|
|
4322
4326
|
...t,
|
|
4323
4327
|
getAt: (a, c) => {
|
|
4324
|
-
const
|
|
4325
|
-
return
|
|
4328
|
+
const u = n.getAt(a, c);
|
|
4329
|
+
return u ? t.getAnnotation(u.annotation) : void 0;
|
|
4326
4330
|
},
|
|
4327
|
-
getIntersecting: (a, c,
|
|
4331
|
+
getIntersecting: (a, c, u, f) => n.getIntersecting(a, c, u, f).map((h) => t.getAnnotation(h.annotation))
|
|
4328
4332
|
},
|
|
4329
4333
|
selection: o,
|
|
4330
4334
|
hover: i,
|
|
4331
4335
|
viewport: s
|
|
4332
4336
|
};
|
|
4333
|
-
},
|
|
4334
|
-
const t =
|
|
4337
|
+
}, Ri = (e) => {
|
|
4338
|
+
const t = Xi(e);
|
|
4335
4339
|
return {
|
|
4336
4340
|
...t,
|
|
4337
|
-
store:
|
|
4341
|
+
store: so(t.store)
|
|
4338
4342
|
};
|
|
4339
|
-
},
|
|
4343
|
+
}, Ni = (e) => {
|
|
4340
4344
|
let t, n;
|
|
4341
4345
|
if (e.nodeName === "CANVAS")
|
|
4342
4346
|
t = e, n = t.getContext("2d", { willReadFrequently: !0 });
|
|
@@ -4351,16 +4355,16 @@ const Ri = () => {
|
|
|
4351
4355
|
o += c;
|
|
4352
4356
|
}
|
|
4353
4357
|
return o / 81;
|
|
4354
|
-
},
|
|
4355
|
-
const t =
|
|
4358
|
+
}, Ui = (e) => {
|
|
4359
|
+
const t = Ni(e), n = t > 0.6 ? "dark" : "light";
|
|
4356
4360
|
return console.log(`[Annotorious] Image brightness: ${t.toFixed(1)}. Setting ${n} theme.`), n;
|
|
4357
|
-
},
|
|
4361
|
+
}, Wt = (e, t, n) => t.setAttribute("data-theme", n === "auto" ? Ui(e) : n), Vi = (e, t) => ({
|
|
4358
4362
|
...e,
|
|
4359
4363
|
drawingEnabled: e.drawingEnabled === void 0 ? t.drawingEnabled : e.drawingEnabled,
|
|
4360
4364
|
drawingMode: e.drawingMode || t.drawingMode,
|
|
4361
4365
|
userSelectAction: e.userSelectAction || t.userSelectAction,
|
|
4362
4366
|
theme: e.theme || t.theme
|
|
4363
|
-
}),
|
|
4367
|
+
}), qt = typeof navigator > "u" ? !1 : navigator.userAgent.indexOf("Mac OS X") !== -1, Gi = (e, t) => {
|
|
4364
4368
|
const n = t || document, o = (r) => {
|
|
4365
4369
|
const l = r;
|
|
4366
4370
|
l.key === "z" && l.ctrlKey ? e.undo() : l.key === "y" && l.ctrlKey && e.redo();
|
|
@@ -4368,30 +4372,30 @@ const Ri = () => {
|
|
|
4368
4372
|
const l = r;
|
|
4369
4373
|
l.key === "z" && l.metaKey && (l.shiftKey ? e.redo() : e.undo());
|
|
4370
4374
|
}, s = () => {
|
|
4371
|
-
|
|
4375
|
+
qt ? n.removeEventListener("keydown", i) : n.removeEventListener("keydown", o);
|
|
4372
4376
|
};
|
|
4373
|
-
return
|
|
4377
|
+
return qt ? n.addEventListener("keydown", i) : n.addEventListener("keydown", o), {
|
|
4374
4378
|
destroy: s
|
|
4375
4379
|
};
|
|
4376
|
-
},
|
|
4380
|
+
}, Ji = (e, t = {}) => {
|
|
4377
4381
|
if (!e)
|
|
4378
4382
|
throw "Missing argument: image";
|
|
4379
|
-
const n = typeof e == "string" ? document.getElementById(e) : e, o =
|
|
4383
|
+
const n = typeof e == "string" ? document.getElementById(e) : e, o = Vi(t, {
|
|
4380
4384
|
drawingEnabled: !0,
|
|
4381
4385
|
drawingMode: "drag",
|
|
4382
|
-
userSelectAction:
|
|
4386
|
+
userSelectAction: nn.EDIT,
|
|
4383
4387
|
theme: "light"
|
|
4384
|
-
}), i =
|
|
4388
|
+
}), i = Ri(o), { selection: s, store: r } = i, l = ao(r), a = fo(
|
|
4385
4389
|
i,
|
|
4386
4390
|
l,
|
|
4387
4391
|
o.adapter,
|
|
4388
4392
|
o.autoSave
|
|
4389
4393
|
), c = document.createElement("DIV");
|
|
4390
4394
|
c.style.position = "relative", c.style.display = "inline-block", n.style.display = "block", n.parentNode.insertBefore(c, n), c.appendChild(n);
|
|
4391
|
-
const
|
|
4392
|
-
let
|
|
4393
|
-
|
|
4394
|
-
const h = new
|
|
4395
|
+
const u = Gi(l);
|
|
4396
|
+
let f = wo();
|
|
4397
|
+
Wt(n, c, o.theme);
|
|
4398
|
+
const h = new Li({
|
|
4395
4399
|
target: c,
|
|
4396
4400
|
props: {
|
|
4397
4401
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4399,25 +4403,25 @@ const Ri = () => {
|
|
|
4399
4403
|
preferredDrawingMode: o.drawingMode,
|
|
4400
4404
|
state: i,
|
|
4401
4405
|
style: o.style,
|
|
4402
|
-
user:
|
|
4406
|
+
user: f
|
|
4403
4407
|
}
|
|
4404
4408
|
});
|
|
4405
4409
|
h.$on("click", (b) => {
|
|
4406
|
-
const { originalEvent:
|
|
4407
|
-
|
|
4410
|
+
const { originalEvent: v, annotation: P } = b.detail;
|
|
4411
|
+
P ? s.userSelect(P.id, v) : s.isEmpty() || s.clear();
|
|
4408
4412
|
});
|
|
4409
|
-
const g =
|
|
4413
|
+
const g = ho(i, l, o.adapter), m = () => {
|
|
4410
4414
|
h.$set({ drawingEnabled: !1 }), setTimeout(() => h.$set({ drawingEnabled: !0 }), 1);
|
|
4411
|
-
},
|
|
4412
|
-
h.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c),
|
|
4413
|
-
},
|
|
4414
|
-
if (!
|
|
4415
|
+
}, w = () => {
|
|
4416
|
+
h.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4417
|
+
}, T = () => h.getDrawingTool(), y = () => f, p = () => h.isDrawingEnabled(), _ = (b, v, P) => si(b, v, P), E = (b, v) => zo(b, v), I = (b) => {
|
|
4418
|
+
if (!fn(b))
|
|
4415
4419
|
throw `No drawing tool named ${b}`;
|
|
4416
4420
|
h.$set({ toolName: b });
|
|
4417
4421
|
}, R = (b) => h.$set({ drawingEnabled: b }), U = (b) => {
|
|
4418
4422
|
console.warn("Filter not implemented yet");
|
|
4419
|
-
}, V = (b) => h.$set({ style: b }), Z = (b) =>
|
|
4420
|
-
|
|
4423
|
+
}, V = (b) => h.$set({ style: b }), Z = (b) => Wt(n, c, b), A = (b) => {
|
|
4424
|
+
f = b, h.$set({ user: b });
|
|
4421
4425
|
}, S = (b) => (
|
|
4422
4426
|
// @ts-ignore
|
|
4423
4427
|
h.$set({ visible: b })
|
|
@@ -4425,11 +4429,11 @@ const Ri = () => {
|
|
|
4425
4429
|
return {
|
|
4426
4430
|
...g,
|
|
4427
4431
|
cancelDrawing: m,
|
|
4428
|
-
destroy:
|
|
4429
|
-
getDrawingTool:
|
|
4430
|
-
getUser:
|
|
4431
|
-
isDrawingEnabled:
|
|
4432
|
-
listDrawingTools:
|
|
4432
|
+
destroy: w,
|
|
4433
|
+
getDrawingTool: T,
|
|
4434
|
+
getUser: y,
|
|
4435
|
+
isDrawingEnabled: p,
|
|
4436
|
+
listDrawingTools: cn,
|
|
4433
4437
|
on: a.on,
|
|
4434
4438
|
off: a.off,
|
|
4435
4439
|
registerDrawingTool: _,
|
|
@@ -4446,54 +4450,54 @@ const Ri = () => {
|
|
|
4446
4450
|
};
|
|
4447
4451
|
};
|
|
4448
4452
|
export {
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4453
|
+
an as Editor,
|
|
4454
|
+
Ko as EditorMount,
|
|
4455
|
+
Ye as Handle,
|
|
4456
|
+
Ki as IdentityTransform,
|
|
4457
|
+
Io as PolygonEditor,
|
|
4458
|
+
Go as RectangleEditor,
|
|
4459
|
+
Bn as RectangleUtil,
|
|
4460
|
+
$o as RubberbandRectangle,
|
|
4461
|
+
Li as SVGAnnotationLayer,
|
|
4458
4462
|
F as ShapeType,
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4463
|
+
Qo as ToolMount,
|
|
4464
|
+
nn as UserSelectAction,
|
|
4465
|
+
qi as W3CImageFormat,
|
|
4466
|
+
wi as addEventListeners,
|
|
4467
|
+
Ke as boundsFromPoints,
|
|
4468
|
+
Fi as chainStyles,
|
|
4469
|
+
ht as computeArea,
|
|
4470
|
+
Hi as computeStyle,
|
|
4471
|
+
zi as createBody,
|
|
4472
|
+
Ji as createImageAnnotator,
|
|
4473
|
+
Xi as createImageAnnotatorState,
|
|
4474
|
+
yi as createSVGTransform,
|
|
4475
|
+
Ri as createSvelteImageAnnotatorState,
|
|
4476
|
+
Wi as defaultColorProvider,
|
|
4477
|
+
Ui as detectTheme,
|
|
4478
|
+
st as distance,
|
|
4479
|
+
Do as enableResponsive,
|
|
4480
|
+
Vi as fillDefaults,
|
|
4481
|
+
jo as getEditor,
|
|
4482
|
+
un as getSVGPoint,
|
|
4483
|
+
fn as getTool,
|
|
4484
|
+
Gi as initKeyboardCommands,
|
|
4485
|
+
kn as intersects,
|
|
4486
|
+
Je as isImageAnnotation,
|
|
4487
|
+
Fe as isImageAnnotationTarget,
|
|
4488
|
+
qt as isMac,
|
|
4489
|
+
Yo as isTouch,
|
|
4490
|
+
cn as listDrawingTools,
|
|
4491
|
+
Dn as parseFragmentSelector,
|
|
4492
|
+
Nn as parseSVGSelector,
|
|
4493
|
+
To as parseW3CImageAnnotation,
|
|
4494
|
+
zo as registerEditor,
|
|
4495
|
+
pt as registerShapeUtil,
|
|
4496
|
+
si as registerTool,
|
|
4497
|
+
Ni as sampleBrightness,
|
|
4498
|
+
Yn as serializeFragmentSelector,
|
|
4499
|
+
Un as serializeSVGSelector,
|
|
4500
|
+
vo as serializeW3CImageAnnotation,
|
|
4501
|
+
Wt as setTheme
|
|
4498
4502
|
};
|
|
4499
4503
|
//# sourceMappingURL=annotorious.es.js.map
|