@annotorious/annotorious 3.0.19 → 3.0.21
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 +1062 -1049
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +8 -8
- package/src/Annotorious.ts +2 -4
- package/src/annotation/SVGAnnotationLayer.svelte +5 -1
- package/src/annotation/tools/polygon/RubberbandPolygon.svelte +1 -1
package/dist/annotorious.es.js
CHANGED
|
@@ -10,16 +10,16 @@ function ft(e, t) {
|
|
|
10
10
|
e
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function qt(e) {
|
|
14
14
|
return e();
|
|
15
15
|
}
|
|
16
16
|
function wt() {
|
|
17
17
|
return /* @__PURE__ */ Object.create(null);
|
|
18
18
|
}
|
|
19
19
|
function ge(e) {
|
|
20
|
-
e.forEach(
|
|
20
|
+
e.forEach(qt);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function K(e) {
|
|
23
23
|
return typeof e == "function";
|
|
24
24
|
}
|
|
25
25
|
function Q(e, t) {
|
|
@@ -84,35 +84,35 @@ function bt(e) {
|
|
|
84
84
|
for (const n in e) n[0] !== "$" && (t[n] = e[n]);
|
|
85
85
|
return t;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Ke(e) {
|
|
88
88
|
return e ?? "";
|
|
89
89
|
}
|
|
90
90
|
function he(e, t) {
|
|
91
91
|
e.appendChild(t);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function B(e, t, n) {
|
|
94
94
|
e.insertBefore(t, n || null);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function I(e) {
|
|
97
97
|
e.parentNode && e.parentNode.removeChild(e);
|
|
98
98
|
}
|
|
99
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
|
-
function
|
|
103
|
+
function C(e) {
|
|
104
104
|
return document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
105
105
|
}
|
|
106
106
|
function Zt(e) {
|
|
107
107
|
return document.createTextNode(e);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function se() {
|
|
110
110
|
return Zt(" ");
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function ae() {
|
|
113
113
|
return Zt("");
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function z(e, t, n, o) {
|
|
116
116
|
return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o);
|
|
117
117
|
}
|
|
118
118
|
function d(e, t, n) {
|
|
@@ -121,24 +121,24 @@ function d(e, t, n) {
|
|
|
121
121
|
function bn(e) {
|
|
122
122
|
return Array.from(e.childNodes);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function ye(e, t, n) {
|
|
125
125
|
e.classList.toggle(t, !!n);
|
|
126
126
|
}
|
|
127
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 Ue;
|
|
131
|
-
function
|
|
131
|
+
function Re(e) {
|
|
132
132
|
Ue = e;
|
|
133
133
|
}
|
|
134
134
|
function xt() {
|
|
135
135
|
if (!Ue) throw new Error("Function called outside component initialization");
|
|
136
136
|
return Ue;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function Ne(e) {
|
|
139
139
|
xt().$$.on_mount.push(e);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Ie() {
|
|
142
142
|
const e = xt();
|
|
143
143
|
return (t, n, { cancelable: o = !1 } = {}) => {
|
|
144
144
|
const i = e.$$.callbacks[t];
|
|
@@ -160,41 +160,41 @@ 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
|
|
164
|
-
let
|
|
163
|
+
const Me = [], We = [];
|
|
164
|
+
let ke = [];
|
|
165
165
|
const Et = [], An = /* @__PURE__ */ Promise.resolve();
|
|
166
166
|
let ut = !1;
|
|
167
167
|
function Sn() {
|
|
168
168
|
ut || (ut = !0, An.then($t));
|
|
169
169
|
}
|
|
170
170
|
function dt(e) {
|
|
171
|
-
|
|
171
|
+
ke.push(e);
|
|
172
172
|
}
|
|
173
173
|
const $e = /* @__PURE__ */ new Set();
|
|
174
|
-
let
|
|
174
|
+
let Ee = 0;
|
|
175
175
|
function $t() {
|
|
176
|
-
if (
|
|
176
|
+
if (Ee !== 0)
|
|
177
177
|
return;
|
|
178
178
|
const e = Ue;
|
|
179
179
|
do {
|
|
180
180
|
try {
|
|
181
|
-
for (;
|
|
182
|
-
const t =
|
|
183
|
-
|
|
181
|
+
for (; Ee < Me.length; ) {
|
|
182
|
+
const t = Me[Ee];
|
|
183
|
+
Ee++, Re(t), Tn(t.$$);
|
|
184
184
|
}
|
|
185
185
|
} catch (t) {
|
|
186
|
-
throw
|
|
186
|
+
throw Me.length = 0, Ee = 0, t;
|
|
187
187
|
}
|
|
188
|
-
for (
|
|
189
|
-
for (let t = 0; t <
|
|
190
|
-
const n =
|
|
188
|
+
for (Re(null), Me.length = 0, Ee = 0; We.length; ) We.pop()();
|
|
189
|
+
for (let t = 0; t < ke.length; t += 1) {
|
|
190
|
+
const n = ke[t];
|
|
191
191
|
$e.has(n) || ($e.add(n), n());
|
|
192
192
|
}
|
|
193
|
-
|
|
194
|
-
} while (
|
|
193
|
+
ke.length = 0;
|
|
194
|
+
} while (Me.length);
|
|
195
195
|
for (; Et.length; )
|
|
196
196
|
Et.pop()();
|
|
197
|
-
ut = !1, $e.clear(),
|
|
197
|
+
ut = !1, $e.clear(), Re(e);
|
|
198
198
|
}
|
|
199
199
|
function Tn(e) {
|
|
200
200
|
if (e.fragment !== null) {
|
|
@@ -205,55 +205,55 @@ function Tn(e) {
|
|
|
205
205
|
}
|
|
206
206
|
function Mn(e) {
|
|
207
207
|
const t = [], n = [];
|
|
208
|
-
|
|
208
|
+
ke.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), ke = t;
|
|
209
209
|
}
|
|
210
210
|
const He = /* @__PURE__ */ new Set();
|
|
211
|
-
let
|
|
212
|
-
function
|
|
213
|
-
|
|
211
|
+
let be;
|
|
212
|
+
function re() {
|
|
213
|
+
be = {
|
|
214
214
|
r: 0,
|
|
215
215
|
c: [],
|
|
216
|
-
p:
|
|
216
|
+
p: be
|
|
217
217
|
// parent group
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
220
|
+
function le() {
|
|
221
|
+
be.r || ge(be.c), be = be.p;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function O(e, t) {
|
|
224
224
|
e && e.i && (He.delete(e), e.i(t));
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function P(e, t, n, o) {
|
|
227
227
|
if (e && e.o) {
|
|
228
228
|
if (He.has(e)) return;
|
|
229
|
-
He.add(e),
|
|
229
|
+
He.add(e), be.c.push(() => {
|
|
230
230
|
He.delete(e), o && (n && e.d(1), o());
|
|
231
231
|
}), e.o(t);
|
|
232
232
|
} else o && o();
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function ve(e) {
|
|
235
235
|
return (e == null ? void 0 : e.length) !== void 0 ? e : Array.from(e);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function ne(e) {
|
|
238
238
|
e && e.c();
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function ee(e, t, n) {
|
|
241
241
|
const { fragment: o, after_update: i } = e.$$;
|
|
242
242
|
o && o.m(t, n), dt(() => {
|
|
243
|
-
const s = e.$$.on_mount.map(
|
|
243
|
+
const s = e.$$.on_mount.map(qt).filter(K);
|
|
244
244
|
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : ge(s), e.$$.on_mount = [];
|
|
245
245
|
}), i.forEach(dt);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function te(e, t) {
|
|
248
248
|
const n = e.$$;
|
|
249
249
|
n.fragment !== null && (Mn(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 Ln(e, t) {
|
|
252
|
+
e.$$.dirty[0] === -1 && (Me.push(e), Sn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function oe(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
255
255
|
const a = Ue;
|
|
256
|
-
|
|
256
|
+
Re(e);
|
|
257
257
|
const c = e.$$ = {
|
|
258
258
|
fragment: null,
|
|
259
259
|
ctx: [],
|
|
@@ -277,20 +277,20 @@ function te(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
277
277
|
};
|
|
278
278
|
r && r(c.root);
|
|
279
279
|
let u = !1;
|
|
280
|
-
if (c.ctx = n ? n(e, t.props || {}, (f, h, ...
|
|
281
|
-
const g =
|
|
282
|
-
return c.ctx && i(c.ctx[f], c.ctx[f] = g) && (!c.skip_bound && c.bound[f] && c.bound[f](g), u &&
|
|
280
|
+
if (c.ctx = n ? n(e, t.props || {}, (f, h, ...y) => {
|
|
281
|
+
const g = y.length ? y[0] : h;
|
|
282
|
+
return c.ctx && i(c.ctx[f], c.ctx[f] = g) && (!c.skip_bound && c.bound[f] && c.bound[f](g), u && Ln(e, f)), h;
|
|
283
283
|
}) : [], c.update(), u = !0, ge(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
284
284
|
if (t.hydrate) {
|
|
285
285
|
const f = bn(t.target);
|
|
286
|
-
c.fragment && c.fragment.l(f), f.forEach(
|
|
286
|
+
c.fragment && c.fragment.l(f), f.forEach(I);
|
|
287
287
|
} else
|
|
288
288
|
c.fragment && c.fragment.c();
|
|
289
|
-
t.intro &&
|
|
289
|
+
t.intro && O(e.$$.fragment), ee(e, t.target, t.anchor), $t();
|
|
290
290
|
}
|
|
291
|
-
|
|
291
|
+
Re(a);
|
|
292
292
|
}
|
|
293
|
-
class
|
|
293
|
+
class ie {
|
|
294
294
|
constructor() {
|
|
295
295
|
/**
|
|
296
296
|
* ### PRIVATE API
|
|
@@ -311,7 +311,7 @@ class ne {
|
|
|
311
311
|
}
|
|
312
312
|
/** @returns {void} */
|
|
313
313
|
$destroy() {
|
|
314
|
-
|
|
314
|
+
te(this, 1), this.$destroy = j;
|
|
315
315
|
}
|
|
316
316
|
/**
|
|
317
317
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -320,7 +320,7 @@ class ne {
|
|
|
320
320
|
* @returns {() => void}
|
|
321
321
|
*/
|
|
322
322
|
$on(t, n) {
|
|
323
|
-
if (!
|
|
323
|
+
if (!K(n))
|
|
324
324
|
return j;
|
|
325
325
|
const o = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
|
|
326
326
|
return o.push(n), () => {
|
|
@@ -336,10 +336,10 @@ class ne {
|
|
|
336
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 kn = "4";
|
|
340
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(kn);
|
|
341
341
|
var F = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(F || {});
|
|
342
|
-
const mt = {}, pt = (e, t) => mt[e] = t, ht = (e) => mt[e.type].area(e),
|
|
342
|
+
const mt = {}, pt = (e, t) => mt[e] = t, ht = (e) => mt[e.type].area(e), vn = (e, t, n) => mt[e.type].intersects(e, t, n), qe = (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);
|
|
@@ -347,8 +347,8 @@ const mt = {}, pt = (e, t) => mt[e] = t, ht = (e) => mt[e.type].area(e), kn = (e
|
|
|
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), u = t - o, f = n - i, h = a * u + c * f,
|
|
351
|
-
return h * h / (s * s) +
|
|
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, y = c * u - a * f;
|
|
351
|
+
return h * h / (s * s) + y * y / (r * r) <= 1;
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
354
|
pt(F.ELLIPSE, In);
|
|
@@ -383,19 +383,19 @@ const Je = (e) => Fe(e.target), Fe = (e) => {
|
|
|
383
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,
|
|
386
|
+
const [h, y, g, m] = [a, c, u, f].map(parseFloat);
|
|
387
387
|
return {
|
|
388
388
|
type: F.RECTANGLE,
|
|
389
389
|
geometry: {
|
|
390
390
|
x: h,
|
|
391
|
-
y
|
|
391
|
+
y,
|
|
392
392
|
w: g,
|
|
393
|
-
h:
|
|
393
|
+
h: m,
|
|
394
394
|
bounds: {
|
|
395
395
|
minX: h,
|
|
396
|
-
minY: t ?
|
|
396
|
+
minY: t ? y - m : y,
|
|
397
397
|
maxX: h + g,
|
|
398
|
-
maxY: t ?
|
|
398
|
+
maxY: t ? y : y + m
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
};
|
|
@@ -425,10 +425,10 @@ const Je = (e) => Fe(e.target), Fe = (e) => {
|
|
|
425
425
|
type: F.POLYGON,
|
|
426
426
|
geometry: {
|
|
427
427
|
points: i,
|
|
428
|
-
bounds:
|
|
428
|
+
bounds: qe(i)
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
|
-
},
|
|
431
|
+
}, Rn = (e) => {
|
|
432
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,
|
|
@@ -445,12 +445,12 @@ const Je = (e) => Fe(e.target), Fe = (e) => {
|
|
|
445
445
|
bounds: r
|
|
446
446
|
}
|
|
447
447
|
};
|
|
448
|
-
},
|
|
448
|
+
}, Un = (e) => {
|
|
449
449
|
const t = typeof e == "string" ? e : e.value;
|
|
450
450
|
if (t.includes("<polygon points="))
|
|
451
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
|
}, Nn = (e) => {
|
|
456
456
|
let t;
|
|
@@ -464,11 +464,11 @@ const Je = (e) => Fe(e.target), Fe = (e) => {
|
|
|
464
464
|
if (t)
|
|
465
465
|
return { type: "SvgSelector", value: t };
|
|
466
466
|
throw `Unsupported shape type: ${e.type}`;
|
|
467
|
-
},
|
|
467
|
+
}, W = [];
|
|
468
468
|
for (let e = 0; e < 256; ++e)
|
|
469
|
-
|
|
469
|
+
W.push((e + 256).toString(16).slice(1));
|
|
470
470
|
function Vn(e, t = 0) {
|
|
471
|
-
return (
|
|
471
|
+
return (W[e[t + 0]] + W[e[t + 1]] + W[e[t + 2]] + W[e[t + 3]] + "-" + W[e[t + 4]] + W[e[t + 5]] + "-" + W[e[t + 6]] + W[e[t + 7]] + "-" + W[e[t + 8]] + W[e[t + 9]] + "-" + W[e[t + 10]] + W[e[t + 11]] + W[e[t + 12]] + W[e[t + 13]] + W[e[t + 14]] + W[e[t + 15]]).toLowerCase();
|
|
472
472
|
}
|
|
473
473
|
let et;
|
|
474
474
|
const Gn = new Uint8Array(16);
|
|
@@ -482,14 +482,17 @@ function jn() {
|
|
|
482
482
|
}
|
|
483
483
|
const zn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), St = { randomUUID: zn };
|
|
484
484
|
function tn(e, t, n) {
|
|
485
|
-
|
|
485
|
+
var i;
|
|
486
|
+
if (St.randomUUID && !e)
|
|
486
487
|
return St.randomUUID();
|
|
487
488
|
e = e || {};
|
|
488
|
-
const o = e.random
|
|
489
|
+
const o = e.random ?? ((i = e.rng) == null ? void 0 : i.call(e)) ?? jn();
|
|
490
|
+
if (o.length < 16)
|
|
491
|
+
throw new Error("Random bytes length must be >= 16");
|
|
489
492
|
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Vn(o);
|
|
490
493
|
}
|
|
491
494
|
var Tt = Object.prototype.hasOwnProperty;
|
|
492
|
-
function
|
|
495
|
+
function _e(e, t) {
|
|
493
496
|
var n, o;
|
|
494
497
|
if (e === t) return !0;
|
|
495
498
|
if (e && t && (n = e.constructor) === t.constructor) {
|
|
@@ -497,13 +500,13 @@ function ye(e, t) {
|
|
|
497
500
|
if (n === RegExp) return e.toString() === t.toString();
|
|
498
501
|
if (n === Array) {
|
|
499
502
|
if ((o = e.length) === t.length)
|
|
500
|
-
for (; o-- &&
|
|
503
|
+
for (; o-- && _e(e[o], t[o]); ) ;
|
|
501
504
|
return o === -1;
|
|
502
505
|
}
|
|
503
506
|
if (!n || typeof e == "object") {
|
|
504
507
|
o = 0;
|
|
505
508
|
for (n in e)
|
|
506
|
-
if (Tt.call(e, n) && ++o && !Tt.call(t, n) || !(n in t) || !
|
|
509
|
+
if (Tt.call(e, n) && ++o && !Tt.call(t, n) || !(n in t) || !_e(e[n], t[n])) return !1;
|
|
507
510
|
return Object.keys(t).length === o;
|
|
508
511
|
}
|
|
509
512
|
}
|
|
@@ -514,19 +517,19 @@ function tt() {
|
|
|
514
517
|
function Hn(e, t) {
|
|
515
518
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
516
519
|
}
|
|
517
|
-
const
|
|
520
|
+
const Ae = [];
|
|
518
521
|
function yt(e, t = tt) {
|
|
519
522
|
let n;
|
|
520
523
|
const o = /* @__PURE__ */ new Set();
|
|
521
524
|
function i(l) {
|
|
522
525
|
if (Hn(e, l) && (e = l, n)) {
|
|
523
|
-
const a = !
|
|
526
|
+
const a = !Ae.length;
|
|
524
527
|
for (const c of o)
|
|
525
|
-
c[1](),
|
|
528
|
+
c[1](), Ae.push(c, e);
|
|
526
529
|
if (a) {
|
|
527
|
-
for (let c = 0; c <
|
|
528
|
-
|
|
529
|
-
|
|
530
|
+
for (let c = 0; c < Ae.length; c += 2)
|
|
531
|
+
Ae[c][0](Ae[c + 1]);
|
|
532
|
+
Ae.length = 0;
|
|
530
533
|
}
|
|
531
534
|
}
|
|
532
535
|
}
|
|
@@ -559,56 +562,58 @@ const Fn = (e) => {
|
|
|
559
562
|
};
|
|
560
563
|
};
|
|
561
564
|
var nn = /* @__PURE__ */ ((e) => (e.EDIT = "EDIT", e.SELECT = "SELECT", e.NONE = "NONE", e))(nn || {});
|
|
562
|
-
const Ge = { selected: [] },
|
|
565
|
+
const Ge = { selected: [] }, Kn = (e, t, n) => {
|
|
563
566
|
const { subscribe: o, set: i } = yt(Ge);
|
|
564
567
|
let s = t, r = Ge;
|
|
565
568
|
o((g) => r = g);
|
|
566
569
|
const l = () => {
|
|
567
|
-
|
|
570
|
+
_e(r, Ge) || i(Ge);
|
|
568
571
|
}, a = () => {
|
|
569
572
|
var g;
|
|
570
573
|
return ((g = r.selected) == null ? void 0 : g.length) === 0;
|
|
571
574
|
}, c = (g) => {
|
|
572
575
|
if (a())
|
|
573
576
|
return !1;
|
|
574
|
-
const
|
|
575
|
-
return r.selected.some((A) => A.id ===
|
|
576
|
-
}, u = (g,
|
|
577
|
+
const m = typeof g == "string" ? g : g.id;
|
|
578
|
+
return r.selected.some((A) => A.id === m);
|
|
579
|
+
}, u = (g, m) => {
|
|
577
580
|
let A;
|
|
578
581
|
if (Array.isArray(g)) {
|
|
579
|
-
if (A = g.map((
|
|
580
|
-
console.warn("Invalid selection: " + g.filter((
|
|
582
|
+
if (A = g.map((_) => e.getAnnotation(_)).filter(Boolean), A.length < g.length) {
|
|
583
|
+
console.warn("Invalid selection: " + g.filter((_) => !A.some((w) => w.id === _)));
|
|
581
584
|
return;
|
|
582
585
|
}
|
|
583
586
|
} else {
|
|
584
|
-
const
|
|
585
|
-
if (!
|
|
587
|
+
const _ = e.getAnnotation(g);
|
|
588
|
+
if (!_) {
|
|
586
589
|
console.warn("Invalid selection: " + g);
|
|
587
590
|
return;
|
|
588
591
|
}
|
|
589
|
-
A = [
|
|
592
|
+
A = [_];
|
|
590
593
|
}
|
|
591
|
-
const
|
|
594
|
+
const p = A.reduce((_, w) => {
|
|
592
595
|
const E = Mt(w, s, n);
|
|
593
|
-
return E === "EDIT" ? [...
|
|
596
|
+
return E === "EDIT" ? [..._, { id: w.id, editable: !0 }] : E === "SELECT" ? [..._, { id: w.id }] : _;
|
|
594
597
|
}, []);
|
|
595
|
-
i({ selected:
|
|
596
|
-
}, f = (g,
|
|
597
|
-
const A = Array.isArray(g) ? g : [g],
|
|
598
|
+
i({ selected: p, event: m });
|
|
599
|
+
}, f = (g, m) => {
|
|
600
|
+
const A = Array.isArray(g) ? g : [g], p = A.map((_) => e.getAnnotation(_)).filter((_) => !!_);
|
|
598
601
|
i({
|
|
599
|
-
selected:
|
|
600
|
-
const w =
|
|
601
|
-
return { id:
|
|
602
|
+
selected: p.map((_) => {
|
|
603
|
+
const w = m === void 0 ? Mt(_, s, n) === "EDIT" : m;
|
|
604
|
+
return { id: _.id, editable: w };
|
|
602
605
|
})
|
|
603
|
-
}),
|
|
606
|
+
}), p.length !== A.length && console.warn("Invalid selection", g);
|
|
604
607
|
}, h = (g) => {
|
|
605
608
|
if (a())
|
|
606
609
|
return !1;
|
|
607
|
-
const { selected:
|
|
608
|
-
|
|
609
|
-
},
|
|
610
|
+
const { selected: m } = r;
|
|
611
|
+
m.some(({ id: A }) => g.includes(A)) && i({ selected: m.filter(({ id: A }) => !g.includes(A)) });
|
|
612
|
+
}, y = (g) => {
|
|
613
|
+
s = g, f(r.selected.map(({ id: m }) => m));
|
|
614
|
+
};
|
|
610
615
|
return e.observe(
|
|
611
|
-
({ changes: g }) => h((g.deleted || []).map((
|
|
616
|
+
({ changes: g }) => h((g.deleted || []).map((m) => m.id))
|
|
612
617
|
), {
|
|
613
618
|
get event() {
|
|
614
619
|
return r ? r.event : null;
|
|
@@ -623,36 +628,39 @@ const Ge = { selected: [] }, Wn = (e, t, n) => {
|
|
|
623
628
|
isEmpty: a,
|
|
624
629
|
isSelected: c,
|
|
625
630
|
setSelected: f,
|
|
626
|
-
setUserSelectAction:
|
|
631
|
+
setUserSelectAction: y,
|
|
627
632
|
subscribe: o,
|
|
628
633
|
userSelect: u
|
|
629
634
|
};
|
|
630
635
|
}, Mt = (e, t, n) => {
|
|
631
636
|
const o = n ? n.serialize(e) : e;
|
|
632
637
|
return typeof t == "function" ? t(o) : t || "EDIT";
|
|
633
|
-
},
|
|
638
|
+
}, q = [];
|
|
634
639
|
for (let e = 0; e < 256; ++e)
|
|
635
|
-
|
|
636
|
-
function
|
|
637
|
-
return (
|
|
640
|
+
q.push((e + 256).toString(16).slice(1));
|
|
641
|
+
function Wn(e, t = 0) {
|
|
642
|
+
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();
|
|
638
643
|
}
|
|
639
644
|
let nt;
|
|
640
|
-
const
|
|
645
|
+
const qn = new Uint8Array(16);
|
|
641
646
|
function Jn() {
|
|
642
647
|
if (!nt) {
|
|
643
648
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
644
649
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
645
650
|
nt = crypto.getRandomValues.bind(crypto);
|
|
646
651
|
}
|
|
647
|
-
return nt(
|
|
652
|
+
return nt(qn);
|
|
648
653
|
}
|
|
649
|
-
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
654
|
+
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Lt = { randomUUID: Qn };
|
|
650
655
|
function on(e, t, n) {
|
|
651
|
-
|
|
652
|
-
|
|
656
|
+
var o;
|
|
657
|
+
if (Lt.randomUUID && !e)
|
|
658
|
+
return Lt.randomUUID();
|
|
653
659
|
e = e || {};
|
|
654
|
-
const
|
|
655
|
-
|
|
660
|
+
const i = e.random ?? ((o = e.rng) == null ? void 0 : o.call(e)) ?? Jn();
|
|
661
|
+
if (i.length < 16)
|
|
662
|
+
throw new Error("Random bytes length must be >= 16");
|
|
663
|
+
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Wn(i);
|
|
656
664
|
}
|
|
657
665
|
const ot = (e) => {
|
|
658
666
|
const t = (n) => {
|
|
@@ -678,8 +686,8 @@ const ot = (e) => {
|
|
|
678
686
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
679
687
|
}, $n = (e, t) => t.bodies.map((n) => {
|
|
680
688
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
681
|
-
return { newBody: n, oldBody: o && !
|
|
682
|
-
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), eo = (e, t) => !
|
|
689
|
+
return { newBody: n, oldBody: o && !_e(o, n) ? o : void 0 };
|
|
690
|
+
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), eo = (e, t) => !_e(e.target, t.target), sn = (e, t) => {
|
|
683
691
|
const n = Zn(e, t), o = xn(e, t), i = $n(e, t);
|
|
684
692
|
return {
|
|
685
693
|
oldValue: e,
|
|
@@ -722,9 +730,9 @@ const to = (e, t) => {
|
|
|
722
730
|
...(t.deleted || []).filter((f) => !n.has(f.id))
|
|
723
731
|
], u = [
|
|
724
732
|
...(e.updated || []).filter(({ newValue: f }) => !s.has(f.id)).map((f) => {
|
|
725
|
-
const { oldValue: h, newValue:
|
|
726
|
-
if (r.has(
|
|
727
|
-
const g = t.updated.find((
|
|
733
|
+
const { oldValue: h, newValue: y } = f;
|
|
734
|
+
if (r.has(y.id)) {
|
|
735
|
+
const g = t.updated.find((m) => m.oldValue.id === y.id).newValue;
|
|
728
736
|
return sn(h, g);
|
|
729
737
|
} else
|
|
730
738
|
return f;
|
|
@@ -747,170 +755,170 @@ const to = (e, t) => {
|
|
|
747
755
|
}
|
|
748
756
|
};
|
|
749
757
|
}, oo = (e) => e.id !== void 0, io = () => {
|
|
750
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (S,
|
|
751
|
-
n.push({ onChange: S, options:
|
|
758
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (S, L = {}) => {
|
|
759
|
+
n.push({ onChange: S, options: L });
|
|
752
760
|
}, i = (S) => {
|
|
753
|
-
const
|
|
754
|
-
|
|
755
|
-
}, s = (S,
|
|
761
|
+
const L = n.findIndex((b) => b.onChange == S);
|
|
762
|
+
L > -1 && n.splice(L, 1);
|
|
763
|
+
}, s = (S, L) => {
|
|
756
764
|
const b = {
|
|
757
765
|
origin: S,
|
|
758
766
|
changes: {
|
|
759
|
-
created:
|
|
760
|
-
updated:
|
|
761
|
-
deleted:
|
|
767
|
+
created: L.created || [],
|
|
768
|
+
updated: L.updated || [],
|
|
769
|
+
deleted: L.deleted || []
|
|
762
770
|
},
|
|
763
771
|
state: [...e.values()]
|
|
764
772
|
};
|
|
765
|
-
n.forEach((
|
|
766
|
-
to(
|
|
773
|
+
n.forEach((T) => {
|
|
774
|
+
to(T, b) && T.onChange(b);
|
|
767
775
|
});
|
|
768
|
-
}, r = (S,
|
|
776
|
+
}, r = (S, L = G.LOCAL) => {
|
|
769
777
|
if (S.id && e.get(S.id))
|
|
770
778
|
throw Error(`Cannot add annotation ${S.id} - exists already`);
|
|
771
779
|
{
|
|
772
780
|
const b = it(S);
|
|
773
|
-
e.set(b.id, b), b.bodies.forEach((
|
|
781
|
+
e.set(b.id, b), b.bodies.forEach((T) => t.set(T.id, b.id)), s(L, { created: [b] });
|
|
774
782
|
}
|
|
775
|
-
}, l = (S,
|
|
776
|
-
const b = it(typeof S == "string" ?
|
|
777
|
-
if (
|
|
778
|
-
const D = sn(
|
|
779
|
-
return
|
|
783
|
+
}, l = (S, L) => {
|
|
784
|
+
const b = it(typeof S == "string" ? L : S), T = typeof S == "string" ? S : S.id, Y = T && e.get(T);
|
|
785
|
+
if (Y) {
|
|
786
|
+
const D = sn(Y, b);
|
|
787
|
+
return T === b.id ? e.set(T, b) : (e.delete(T), e.set(b.id, b)), Y.bodies.forEach((H) => t.delete(H.id)), b.bodies.forEach((H) => t.set(H.id, b.id)), D;
|
|
780
788
|
} else
|
|
781
|
-
console.warn(`Cannot update annotation ${
|
|
782
|
-
}, a = (S,
|
|
783
|
-
const
|
|
784
|
-
|
|
785
|
-
}, c = (S,
|
|
786
|
-
const b = S.reduce((
|
|
787
|
-
const D = l(
|
|
788
|
-
return D ? [...
|
|
789
|
+
console.warn(`Cannot update annotation ${T} - does not exist`);
|
|
790
|
+
}, a = (S, L = G.LOCAL, b = G.LOCAL) => {
|
|
791
|
+
const T = oo(L) ? b : L, Y = l(S, L);
|
|
792
|
+
Y && s(T, { updated: [Y] });
|
|
793
|
+
}, c = (S, L = G.LOCAL) => {
|
|
794
|
+
const b = S.reduce((T, Y) => {
|
|
795
|
+
const D = l(Y);
|
|
796
|
+
return D ? [...T, D] : T;
|
|
789
797
|
}, []);
|
|
790
|
-
b.length > 0 && s(
|
|
791
|
-
}, u = (S,
|
|
798
|
+
b.length > 0 && s(L, { updated: b });
|
|
799
|
+
}, u = (S, L = G.LOCAL) => {
|
|
792
800
|
const b = e.get(S.annotation);
|
|
793
801
|
if (b) {
|
|
794
|
-
const
|
|
802
|
+
const T = {
|
|
795
803
|
...b,
|
|
796
804
|
bodies: [...b.bodies, S]
|
|
797
805
|
};
|
|
798
|
-
e.set(b.id,
|
|
806
|
+
e.set(b.id, T), t.set(S.id, T.id), s(L, { updated: [{
|
|
799
807
|
oldValue: b,
|
|
800
|
-
newValue:
|
|
808
|
+
newValue: T,
|
|
801
809
|
bodiesCreated: [S]
|
|
802
810
|
}] });
|
|
803
811
|
} else
|
|
804
812
|
console.warn(`Attempt to add body to missing annotation: ${S.annotation}`);
|
|
805
813
|
}, f = () => [...e.values()], h = (S = G.LOCAL) => {
|
|
806
|
-
const
|
|
807
|
-
e.clear(), t.clear(), s(S, { deleted:
|
|
808
|
-
},
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
811
|
-
const
|
|
812
|
-
e.clear(), t.clear(),
|
|
813
|
-
e.set(D.id, D), D.bodies.forEach((
|
|
814
|
-
}), s(b, { created:
|
|
814
|
+
const L = [...e.values()];
|
|
815
|
+
e.clear(), t.clear(), s(S, { deleted: L });
|
|
816
|
+
}, y = (S, L = !0, b = G.LOCAL) => {
|
|
817
|
+
const T = S.map(it);
|
|
818
|
+
if (L) {
|
|
819
|
+
const Y = [...e.values()];
|
|
820
|
+
e.clear(), t.clear(), T.forEach((D) => {
|
|
821
|
+
e.set(D.id, D), D.bodies.forEach((H) => t.set(H.id, D.id));
|
|
822
|
+
}), s(b, { created: T, deleted: Y });
|
|
815
823
|
} else {
|
|
816
|
-
const
|
|
817
|
-
const
|
|
818
|
-
return
|
|
824
|
+
const Y = S.reduce((D, H) => {
|
|
825
|
+
const J = H.id && e.get(H.id);
|
|
826
|
+
return J ? [...D, J] : D;
|
|
819
827
|
}, []);
|
|
820
|
-
if (
|
|
821
|
-
throw Error(`Bulk insert would overwrite the following annotations: ${
|
|
822
|
-
|
|
823
|
-
e.set(D.id, D), D.bodies.forEach((
|
|
824
|
-
}), s(b, { created:
|
|
828
|
+
if (Y.length > 0)
|
|
829
|
+
throw Error(`Bulk insert would overwrite the following annotations: ${Y.map((D) => D.id).join(", ")}`);
|
|
830
|
+
T.forEach((D) => {
|
|
831
|
+
e.set(D.id, D), D.bodies.forEach((H) => t.set(H.id, D.id));
|
|
832
|
+
}), s(b, { created: T });
|
|
825
833
|
}
|
|
826
834
|
}, g = (S) => {
|
|
827
|
-
const
|
|
835
|
+
const L = typeof S == "string" ? S : S.id, b = e.get(L);
|
|
828
836
|
if (b)
|
|
829
|
-
return e.delete(
|
|
830
|
-
console.warn(`Attempt to delete missing annotation: ${
|
|
831
|
-
},
|
|
837
|
+
return e.delete(L), b.bodies.forEach((T) => t.delete(T.id)), b;
|
|
838
|
+
console.warn(`Attempt to delete missing annotation: ${L}`);
|
|
839
|
+
}, m = (S, L = G.LOCAL) => {
|
|
832
840
|
const b = g(S);
|
|
833
|
-
b && s(
|
|
834
|
-
}, A = (S,
|
|
835
|
-
const b = S.reduce((
|
|
836
|
-
const D = g(
|
|
837
|
-
return D ? [...
|
|
841
|
+
b && s(L, { deleted: [b] });
|
|
842
|
+
}, A = (S, L = G.LOCAL) => {
|
|
843
|
+
const b = S.reduce((T, Y) => {
|
|
844
|
+
const D = g(Y);
|
|
845
|
+
return D ? [...T, D] : T;
|
|
838
846
|
}, []);
|
|
839
|
-
b.length > 0 && s(
|
|
840
|
-
},
|
|
841
|
-
const
|
|
842
|
-
if (
|
|
843
|
-
const b =
|
|
847
|
+
b.length > 0 && s(L, { deleted: b });
|
|
848
|
+
}, p = (S) => {
|
|
849
|
+
const L = e.get(S.annotation);
|
|
850
|
+
if (L) {
|
|
851
|
+
const b = L.bodies.find((T) => T.id === S.id);
|
|
844
852
|
if (b) {
|
|
845
853
|
t.delete(b.id);
|
|
846
|
-
const
|
|
847
|
-
...
|
|
848
|
-
bodies:
|
|
854
|
+
const T = {
|
|
855
|
+
...L,
|
|
856
|
+
bodies: L.bodies.filter((Y) => Y.id !== S.id)
|
|
849
857
|
};
|
|
850
|
-
return e.set(
|
|
851
|
-
oldValue:
|
|
852
|
-
newValue:
|
|
858
|
+
return e.set(L.id, T), {
|
|
859
|
+
oldValue: L,
|
|
860
|
+
newValue: T,
|
|
853
861
|
bodiesDeleted: [b]
|
|
854
862
|
};
|
|
855
863
|
} else
|
|
856
864
|
console.warn(`Attempt to delete missing body ${S.id} from annotation ${S.annotation}`);
|
|
857
865
|
} else
|
|
858
866
|
console.warn(`Attempt to delete body from missing annotation ${S.annotation}`);
|
|
859
|
-
},
|
|
860
|
-
const b =
|
|
861
|
-
b && s(
|
|
862
|
-
}, w = (S,
|
|
863
|
-
const b = S.map((
|
|
864
|
-
b.length > 0 && s(
|
|
867
|
+
}, _ = (S, L = G.LOCAL) => {
|
|
868
|
+
const b = p(S);
|
|
869
|
+
b && s(L, { updated: [b] });
|
|
870
|
+
}, w = (S, L = G.LOCAL) => {
|
|
871
|
+
const b = S.map((T) => p(T)).filter(Boolean);
|
|
872
|
+
b.length > 0 && s(L, { updated: b });
|
|
865
873
|
}, E = (S) => {
|
|
866
|
-
const
|
|
867
|
-
return
|
|
868
|
-
},
|
|
869
|
-
const
|
|
870
|
-
if (
|
|
871
|
-
const b = E(
|
|
874
|
+
const L = e.get(S);
|
|
875
|
+
return L ? { ...L } : void 0;
|
|
876
|
+
}, v = (S) => {
|
|
877
|
+
const L = t.get(S);
|
|
878
|
+
if (L) {
|
|
879
|
+
const b = E(L).bodies.find((T) => T.id === S);
|
|
872
880
|
if (b)
|
|
873
881
|
return b;
|
|
874
882
|
console.error(`Store integrity error: body ${S} in index, but not in annotation`);
|
|
875
883
|
} else
|
|
876
884
|
console.warn(`Attempt to retrieve missing body: ${S}`);
|
|
877
|
-
},
|
|
878
|
-
if (S.annotation !==
|
|
885
|
+
}, X = (S, L) => {
|
|
886
|
+
if (S.annotation !== L.annotation)
|
|
879
887
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
880
888
|
const b = e.get(S.annotation);
|
|
881
889
|
if (b) {
|
|
882
|
-
const
|
|
890
|
+
const T = b.bodies.find((D) => D.id === S.id), Y = {
|
|
883
891
|
...b,
|
|
884
|
-
bodies: b.bodies.map((D) => D.id ===
|
|
892
|
+
bodies: b.bodies.map((D) => D.id === T.id ? L : D)
|
|
885
893
|
};
|
|
886
|
-
return e.set(b.id,
|
|
894
|
+
return e.set(b.id, Y), T.id !== L.id && (t.delete(T.id), t.set(L.id, Y.id)), {
|
|
887
895
|
oldValue: b,
|
|
888
|
-
newValue:
|
|
889
|
-
bodiesUpdated: [{ oldBody:
|
|
896
|
+
newValue: Y,
|
|
897
|
+
bodiesUpdated: [{ oldBody: T, newBody: L }]
|
|
890
898
|
};
|
|
891
899
|
} else
|
|
892
900
|
console.warn(`Attempt to add body to missing annotation ${S.annotation}`);
|
|
893
|
-
},
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
}, V = (S,
|
|
897
|
-
const b = S.map((
|
|
898
|
-
s(
|
|
901
|
+
}, U = (S, L, b = G.LOCAL) => {
|
|
902
|
+
const T = X(S, L);
|
|
903
|
+
T && s(b, { updated: [T] });
|
|
904
|
+
}, V = (S, L = G.LOCAL) => {
|
|
905
|
+
const b = S.map((T) => X({ id: T.id, annotation: T.annotation }, T)).filter(Boolean);
|
|
906
|
+
s(L, { updated: b });
|
|
899
907
|
}, Z = (S) => {
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
908
|
+
const L = e.get(S.annotation);
|
|
909
|
+
if (L) {
|
|
902
910
|
const b = {
|
|
903
|
-
...
|
|
911
|
+
...L,
|
|
904
912
|
target: {
|
|
905
|
-
...
|
|
913
|
+
...L.target,
|
|
906
914
|
...S
|
|
907
915
|
}
|
|
908
916
|
};
|
|
909
|
-
return e.set(
|
|
910
|
-
oldValue:
|
|
917
|
+
return e.set(L.id, b), {
|
|
918
|
+
oldValue: L,
|
|
911
919
|
newValue: b,
|
|
912
920
|
targetUpdated: {
|
|
913
|
-
oldTarget:
|
|
921
|
+
oldTarget: L.target,
|
|
914
922
|
newTarget: S
|
|
915
923
|
}
|
|
916
924
|
};
|
|
@@ -921,27 +929,27 @@ const to = (e, t) => {
|
|
|
921
929
|
addAnnotation: r,
|
|
922
930
|
addBody: u,
|
|
923
931
|
all: f,
|
|
924
|
-
bulkAddAnnotation:
|
|
932
|
+
bulkAddAnnotation: y,
|
|
925
933
|
bulkDeleteAnnotation: A,
|
|
926
934
|
bulkDeleteBodies: w,
|
|
927
935
|
bulkUpdateAnnotation: c,
|
|
928
936
|
bulkUpdateBodies: V,
|
|
929
|
-
bulkUpdateTargets: (S,
|
|
930
|
-
const b = S.map((
|
|
931
|
-
b.length > 0 && s(
|
|
937
|
+
bulkUpdateTargets: (S, L = G.LOCAL) => {
|
|
938
|
+
const b = S.map((T) => Z(T)).filter(Boolean);
|
|
939
|
+
b.length > 0 && s(L, { updated: b });
|
|
932
940
|
},
|
|
933
941
|
clear: h,
|
|
934
|
-
deleteAnnotation:
|
|
935
|
-
deleteBody:
|
|
942
|
+
deleteAnnotation: m,
|
|
943
|
+
deleteBody: _,
|
|
936
944
|
getAnnotation: E,
|
|
937
|
-
getBody:
|
|
945
|
+
getBody: v,
|
|
938
946
|
observe: o,
|
|
939
947
|
unobserve: i,
|
|
940
948
|
updateAnnotation: a,
|
|
941
|
-
updateBody:
|
|
942
|
-
updateTarget: (S,
|
|
949
|
+
updateBody: U,
|
|
950
|
+
updateTarget: (S, L = G.LOCAL) => {
|
|
943
951
|
const b = Z(S);
|
|
944
|
-
b && s(
|
|
952
|
+
b && s(L, { updated: [b] });
|
|
945
953
|
}
|
|
946
954
|
};
|
|
947
955
|
}, so = (e) => ({
|
|
@@ -970,37 +978,37 @@ const lo = 250, ao = (e, t) => {
|
|
|
970
978
|
let i = t ? t.pointer : -1, s = !1, r = 0;
|
|
971
979
|
const l = (g) => {
|
|
972
980
|
if (!s) {
|
|
973
|
-
const { changes:
|
|
981
|
+
const { changes: m } = g, A = performance.now();
|
|
974
982
|
if (A - r > lo)
|
|
975
|
-
o.splice(i + 1), o.push(
|
|
983
|
+
o.splice(i + 1), o.push(m), i = o.length - 1;
|
|
976
984
|
else {
|
|
977
|
-
const
|
|
978
|
-
o[
|
|
985
|
+
const p = o.length - 1;
|
|
986
|
+
o[p] = no(o[p], m);
|
|
979
987
|
}
|
|
980
988
|
r = A;
|
|
981
989
|
}
|
|
982
990
|
s = !1;
|
|
983
991
|
};
|
|
984
992
|
e.observe(l, { origin: G.LOCAL });
|
|
985
|
-
const a = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g), c = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), u = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ oldValue:
|
|
993
|
+
const a = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g), c = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), u = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ oldValue: m }) => m)), f = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ newValue: m }) => m)), h = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), y = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g);
|
|
986
994
|
return {
|
|
987
995
|
canRedo: () => o.length - 1 > i,
|
|
988
996
|
canUndo: () => i > -1,
|
|
989
997
|
destroy: () => e.unobserve(l),
|
|
990
998
|
getHistory: () => ({ changes: [...o], pointer: i }),
|
|
991
|
-
on: (g,
|
|
999
|
+
on: (g, m) => n.on(g, m),
|
|
992
1000
|
redo: () => {
|
|
993
1001
|
if (o.length - 1 > i) {
|
|
994
1002
|
s = !0;
|
|
995
|
-
const { created: g, updated:
|
|
996
|
-
c(g), f(
|
|
1003
|
+
const { created: g, updated: m, deleted: A } = o[i + 1];
|
|
1004
|
+
c(g), f(m), y(A), n.emit("redo", o[i + 1]), i += 1;
|
|
997
1005
|
}
|
|
998
1006
|
},
|
|
999
1007
|
undo: () => {
|
|
1000
1008
|
if (i > -1) {
|
|
1001
1009
|
s = !0;
|
|
1002
|
-
const { created: g, updated:
|
|
1003
|
-
a(g), u(
|
|
1010
|
+
const { created: g, updated: m, deleted: A } = o[i];
|
|
1011
|
+
a(g), u(m), h(A), n.emit("undo", o[i]), i -= 1;
|
|
1004
1012
|
}
|
|
1005
1013
|
}
|
|
1006
1014
|
};
|
|
@@ -1013,78 +1021,78 @@ const lo = 250, ao = (e, t) => {
|
|
|
1013
1021
|
}, fo = (e, t, n, o) => {
|
|
1014
1022
|
const { hover: i, selection: s, store: r, viewport: l } = e, a = /* @__PURE__ */ new Map();
|
|
1015
1023
|
let c = [], u, f;
|
|
1016
|
-
const h = (
|
|
1017
|
-
a.has(
|
|
1018
|
-
},
|
|
1019
|
-
const w = a.get(
|
|
1024
|
+
const h = (p, _) => {
|
|
1025
|
+
a.has(p) ? a.get(p).push(_) : a.set(p, [_]);
|
|
1026
|
+
}, y = (p, _) => {
|
|
1027
|
+
const w = a.get(p);
|
|
1020
1028
|
if (w) {
|
|
1021
|
-
const E = w.indexOf(
|
|
1029
|
+
const E = w.indexOf(_);
|
|
1022
1030
|
E !== -1 && w.splice(E, 1);
|
|
1023
1031
|
}
|
|
1024
|
-
}, g = (
|
|
1025
|
-
a.has(
|
|
1026
|
-
a.get(
|
|
1032
|
+
}, g = (p, _, w) => {
|
|
1033
|
+
a.has(p) && setTimeout(() => {
|
|
1034
|
+
a.get(p).forEach((E) => {
|
|
1027
1035
|
if (n) {
|
|
1028
|
-
const
|
|
1029
|
-
E(
|
|
1036
|
+
const v = Array.isArray(_) ? _.map((U) => n.serialize(U)) : n.serialize(_), X = w ? w instanceof PointerEvent ? w : n.serialize(w) : void 0;
|
|
1037
|
+
E(v, X);
|
|
1030
1038
|
} else
|
|
1031
|
-
E(
|
|
1039
|
+
E(_, w);
|
|
1032
1040
|
});
|
|
1033
1041
|
}, 1);
|
|
1034
|
-
},
|
|
1035
|
-
const { selected:
|
|
1036
|
-
|
|
1037
|
-
const E = c.find((
|
|
1038
|
-
(!E || !
|
|
1039
|
-
}), c = c.map((w) =>
|
|
1042
|
+
}, m = () => {
|
|
1043
|
+
const { selected: p } = s, _ = (p || []).map(({ id: w }) => r.getAnnotation(w));
|
|
1044
|
+
_.forEach((w) => {
|
|
1045
|
+
const E = c.find((v) => v.id === w.id);
|
|
1046
|
+
(!E || !_e(E, w)) && g("updateAnnotation", w, E);
|
|
1047
|
+
}), c = c.map((w) => _.find(({ id: v }) => v === w.id) || w);
|
|
1040
1048
|
};
|
|
1041
|
-
s.subscribe(({ selected:
|
|
1042
|
-
if (!(c.length === 0 &&
|
|
1043
|
-
if (c.length === 0 &&
|
|
1044
|
-
c =
|
|
1045
|
-
else if (c.length > 0 &&
|
|
1046
|
-
c.forEach((
|
|
1047
|
-
const w = r.getAnnotation(
|
|
1048
|
-
w && !
|
|
1049
|
+
s.subscribe(({ selected: p }) => {
|
|
1050
|
+
if (!(c.length === 0 && p.length === 0)) {
|
|
1051
|
+
if (c.length === 0 && p.length > 0)
|
|
1052
|
+
c = p.map(({ id: _ }) => r.getAnnotation(_));
|
|
1053
|
+
else if (c.length > 0 && p.length === 0)
|
|
1054
|
+
c.forEach((_) => {
|
|
1055
|
+
const w = r.getAnnotation(_.id);
|
|
1056
|
+
w && !_e(w, _) && g("updateAnnotation", w, _);
|
|
1049
1057
|
}), c = [];
|
|
1050
1058
|
else {
|
|
1051
|
-
const
|
|
1059
|
+
const _ = new Set(c.map((E) => E.id)), w = new Set(p.map(({ id: E }) => E));
|
|
1052
1060
|
c.filter((E) => !w.has(E.id)).forEach((E) => {
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1061
|
+
const v = r.getAnnotation(E.id);
|
|
1062
|
+
v && !_e(v, E) && g("updateAnnotation", v, E);
|
|
1055
1063
|
}), c = [
|
|
1056
1064
|
// Remove annotations that were deselected
|
|
1057
1065
|
...c.filter((E) => w.has(E.id)),
|
|
1058
1066
|
// Add editable annotations that were selected
|
|
1059
|
-
...
|
|
1067
|
+
...p.filter(({ id: E }) => !_.has(E)).map(({ id: E }) => r.getAnnotation(E))
|
|
1060
1068
|
];
|
|
1061
1069
|
}
|
|
1062
1070
|
g("selectionChanged", c);
|
|
1063
1071
|
}
|
|
1064
|
-
}), i.subscribe((
|
|
1065
|
-
!u &&
|
|
1066
|
-
}), l == null || l.subscribe((
|
|
1067
|
-
o && (f && clearTimeout(f), f = setTimeout(
|
|
1068
|
-
const { created:
|
|
1069
|
-
(
|
|
1072
|
+
}), i.subscribe((p) => {
|
|
1073
|
+
!u && p ? g("mouseEnterAnnotation", r.getAnnotation(p)) : u && !p ? g("mouseLeaveAnnotation", r.getAnnotation(u)) : u && p && (g("mouseLeaveAnnotation", r.getAnnotation(u)), g("mouseEnterAnnotation", r.getAnnotation(p))), u = p;
|
|
1074
|
+
}), l == null || l.subscribe((p) => g("viewportIntersect", p.map((_) => r.getAnnotation(_)))), r.observe((p) => {
|
|
1075
|
+
o && (f && clearTimeout(f), f = setTimeout(m, 1e3));
|
|
1076
|
+
const { created: _, deleted: w } = p.changes;
|
|
1077
|
+
(_ || []).forEach((E) => g("createAnnotation", E)), (w || []).forEach((E) => g("deleteAnnotation", E)), (p.changes.updated || []).filter((E) => [
|
|
1070
1078
|
...E.bodiesCreated || [],
|
|
1071
1079
|
...E.bodiesDeleted || [],
|
|
1072
1080
|
...E.bodiesUpdated || []
|
|
1073
|
-
].length > 0).forEach(({ oldValue: E, newValue:
|
|
1074
|
-
const
|
|
1075
|
-
c = c.map((
|
|
1081
|
+
].length > 0).forEach(({ oldValue: E, newValue: v }) => {
|
|
1082
|
+
const X = c.find((U) => U.id === E.id) || E;
|
|
1083
|
+
c = c.map((U) => U.id === E.id ? v : U), g("updateAnnotation", v, X);
|
|
1076
1084
|
});
|
|
1077
|
-
}, { origin: G.LOCAL }), r.observe((
|
|
1085
|
+
}, { origin: G.LOCAL }), r.observe((p) => {
|
|
1078
1086
|
if (c) {
|
|
1079
|
-
const
|
|
1080
|
-
w.length > 0 && (c = c.map((E) => w.find((
|
|
1087
|
+
const _ = new Set(c.map((E) => E.id)), w = (p.changes.updated || []).filter(({ newValue: E }) => _.has(E.id)).map(({ newValue: E }) => E);
|
|
1088
|
+
w.length > 0 && (c = c.map((E) => w.find((X) => X.id === E.id) || E));
|
|
1081
1089
|
}
|
|
1082
1090
|
}, { origin: G.REMOTE });
|
|
1083
|
-
const A = (
|
|
1084
|
-
const { updated: w } =
|
|
1085
|
-
|
|
1091
|
+
const A = (p) => (_) => {
|
|
1092
|
+
const { updated: w } = _;
|
|
1093
|
+
p ? (w || []).forEach((E) => g("updateAnnotation", E.oldValue, E.newValue)) : (w || []).forEach((E) => g("updateAnnotation", E.newValue, E.oldValue));
|
|
1086
1094
|
};
|
|
1087
|
-
return t.on("undo", A(!0)), t.on("redo", A(!1)), { on: h, off:
|
|
1095
|
+
return t.on("undo", A(!0)), t.on("redo", A(!1)), { on: h, off: y, emit: g };
|
|
1088
1096
|
}, uo = (e) => (t) => t.reduce((n, o) => {
|
|
1089
1097
|
const { parsed: i, error: s } = e.parse(o);
|
|
1090
1098
|
return s ? {
|
|
@@ -1097,46 +1105,46 @@ const lo = 250, ao = (e, t) => {
|
|
|
1097
1105
|
...n
|
|
1098
1106
|
};
|
|
1099
1107
|
}, { parsed: [], failed: [] }), ho = (e, t, n) => {
|
|
1100
|
-
const { store: o, selection: i } = e, s = (
|
|
1108
|
+
const { store: o, selection: i } = e, s = (p) => {
|
|
1101
1109
|
if (n) {
|
|
1102
|
-
const { parsed:
|
|
1103
|
-
|
|
1110
|
+
const { parsed: _, error: w } = n.parse(p);
|
|
1111
|
+
_ ? o.addAnnotation(_, G.REMOTE) : console.error(w);
|
|
1104
1112
|
} else
|
|
1105
|
-
o.addAnnotation(ot(
|
|
1106
|
-
}, r = () => i.clear(), l = () => o.clear(), a = (
|
|
1107
|
-
const
|
|
1108
|
-
return n &&
|
|
1113
|
+
o.addAnnotation(ot(p), G.REMOTE);
|
|
1114
|
+
}, r = () => i.clear(), l = () => o.clear(), a = (p) => {
|
|
1115
|
+
const _ = o.getAnnotation(p);
|
|
1116
|
+
return n && _ ? n.serialize(_) : _;
|
|
1109
1117
|
}, c = () => n ? o.all().map(n.serialize) : o.all(), u = () => {
|
|
1110
|
-
var
|
|
1111
|
-
const
|
|
1112
|
-
return n ?
|
|
1113
|
-
}, f = (
|
|
1114
|
-
if (typeof
|
|
1115
|
-
const
|
|
1116
|
-
if (o.deleteAnnotation(
|
|
1117
|
-
return n ? n.serialize(
|
|
1118
|
+
var p;
|
|
1119
|
+
const _ = (((p = i.selected) == null ? void 0 : p.map((w) => w.id)) || []).map((w) => o.getAnnotation(w)).filter(Boolean);
|
|
1120
|
+
return n ? _.map(n.serialize) : _;
|
|
1121
|
+
}, f = (p, _ = !0) => fetch(p).then((w) => w.json()).then((w) => (y(w, _), w)), h = (p) => {
|
|
1122
|
+
if (typeof p == "string") {
|
|
1123
|
+
const _ = o.getAnnotation(p);
|
|
1124
|
+
if (o.deleteAnnotation(p), _)
|
|
1125
|
+
return n ? n.serialize(_) : _;
|
|
1118
1126
|
} else {
|
|
1119
|
-
const
|
|
1120
|
-
if (
|
|
1121
|
-
return o.deleteAnnotation(
|
|
1127
|
+
const _ = n ? n.parse(p).parsed : p;
|
|
1128
|
+
if (_)
|
|
1129
|
+
return o.deleteAnnotation(_), p;
|
|
1122
1130
|
}
|
|
1123
|
-
},
|
|
1131
|
+
}, y = (p, _ = !0) => {
|
|
1124
1132
|
if (n) {
|
|
1125
|
-
const w = n.parseAll || uo(n), { parsed: E, failed:
|
|
1126
|
-
|
|
1133
|
+
const w = n.parseAll || uo(n), { parsed: E, failed: v } = w(p);
|
|
1134
|
+
v.length > 0 && console.warn(`Discarded ${v.length} invalid annotations`, v), o.bulkAddAnnotation(E, _, G.REMOTE);
|
|
1127
1135
|
} else
|
|
1128
|
-
o.bulkAddAnnotation(
|
|
1129
|
-
}, g = (
|
|
1130
|
-
|
|
1131
|
-
},
|
|
1132
|
-
i.clear(), i.setUserSelectAction(
|
|
1133
|
-
}, A = (
|
|
1136
|
+
o.bulkAddAnnotation(p.map(ot), _, G.REMOTE);
|
|
1137
|
+
}, g = (p, _) => {
|
|
1138
|
+
p ? i.setSelected(p, _) : i.clear();
|
|
1139
|
+
}, m = (p) => {
|
|
1140
|
+
i.clear(), i.setUserSelectAction(p);
|
|
1141
|
+
}, A = (p) => {
|
|
1134
1142
|
if (n) {
|
|
1135
|
-
const
|
|
1136
|
-
return o.updateAnnotation(
|
|
1143
|
+
const _ = n.parse(p).parsed, w = n.serialize(o.getAnnotation(_.id));
|
|
1144
|
+
return o.updateAnnotation(_), w;
|
|
1137
1145
|
} else {
|
|
1138
|
-
const
|
|
1139
|
-
return o.updateAnnotation(ot(
|
|
1146
|
+
const _ = o.getAnnotation(p.id);
|
|
1147
|
+
return o.updateAnnotation(ot(p)), _;
|
|
1140
1148
|
}
|
|
1141
1149
|
};
|
|
1142
1150
|
return {
|
|
@@ -1152,9 +1160,9 @@ const lo = 250, ao = (e, t) => {
|
|
|
1152
1160
|
loadAnnotations: f,
|
|
1153
1161
|
redo: t.redo,
|
|
1154
1162
|
removeAnnotation: h,
|
|
1155
|
-
setAnnotations:
|
|
1163
|
+
setAnnotations: y,
|
|
1156
1164
|
setSelected: g,
|
|
1157
|
-
setUserSelectAction:
|
|
1165
|
+
setUserSelectAction: m,
|
|
1158
1166
|
undo: t.undo,
|
|
1159
1167
|
updateAnnotation: A
|
|
1160
1168
|
};
|
|
@@ -1232,7 +1240,7 @@ const wo = () => ({ isGuest: !0, id: yo("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1232
1240
|
// cyan
|
|
1233
1241
|
"#023eff"
|
|
1234
1242
|
// blue
|
|
1235
|
-
],
|
|
1243
|
+
], Ki = () => {
|
|
1236
1244
|
const e = [...So];
|
|
1237
1245
|
return { assignRandomColor: () => {
|
|
1238
1246
|
const t = Math.floor(Math.random() * e.length), n = e[t];
|
|
@@ -1240,14 +1248,14 @@ const wo = () => ({ isGuest: !0, id: yo("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1240
1248
|
}, releaseColor: (t) => e.push(t) };
|
|
1241
1249
|
};
|
|
1242
1250
|
_o();
|
|
1243
|
-
const
|
|
1251
|
+
const Wi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => To(i, t), serialize: (i) => Mo(i, e, t) }), To = (e, t = { strict: !0, invertY: !1 }) => {
|
|
1244
1252
|
const n = e.id || tn(), {
|
|
1245
1253
|
creator: o,
|
|
1246
1254
|
created: i,
|
|
1247
1255
|
modified: s,
|
|
1248
1256
|
body: r,
|
|
1249
1257
|
...l
|
|
1250
|
-
} = 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" ?
|
|
1258
|
+
} = 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" ? Un(u) : void 0;
|
|
1251
1259
|
return f || !t.strict ? {
|
|
1252
1260
|
parsed: {
|
|
1253
1261
|
...l,
|
|
@@ -1300,13 +1308,13 @@ const qi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => To(i, t), se
|
|
|
1300
1308
|
};
|
|
1301
1309
|
return delete u.bodies, "annotation" in u.target && delete u.target.annotation, u;
|
|
1302
1310
|
};
|
|
1303
|
-
function
|
|
1311
|
+
function kt(e, t, n) {
|
|
1304
1312
|
const o = e.slice();
|
|
1305
1313
|
return o[10] = t[n], o[12] = n, o;
|
|
1306
1314
|
}
|
|
1307
|
-
function
|
|
1315
|
+
function vt(e) {
|
|
1308
1316
|
let t, n;
|
|
1309
|
-
return t = new
|
|
1317
|
+
return t = new Pe({
|
|
1310
1318
|
props: {
|
|
1311
1319
|
x: (
|
|
1312
1320
|
/*point*/
|
|
@@ -1322,7 +1330,7 @@ function kt(e) {
|
|
|
1322
1330
|
)
|
|
1323
1331
|
}
|
|
1324
1332
|
}), t.$on("pointerdown", function() {
|
|
1325
|
-
|
|
1333
|
+
K(
|
|
1326
1334
|
/*grab*/
|
|
1327
1335
|
e[9](`HANDLE-${/*idx*/
|
|
1328
1336
|
e[12]}`)
|
|
@@ -1330,10 +1338,10 @@ function kt(e) {
|
|
|
1330
1338
|
e[12]}`).apply(this, arguments);
|
|
1331
1339
|
}), {
|
|
1332
1340
|
c() {
|
|
1333
|
-
|
|
1341
|
+
ne(t.$$.fragment);
|
|
1334
1342
|
},
|
|
1335
1343
|
m(o, i) {
|
|
1336
|
-
|
|
1344
|
+
ee(t, o, i), n = !0;
|
|
1337
1345
|
},
|
|
1338
1346
|
p(o, i) {
|
|
1339
1347
|
e = o;
|
|
@@ -1347,32 +1355,32 @@ function kt(e) {
|
|
|
1347
1355
|
e[3]), t.$set(s);
|
|
1348
1356
|
},
|
|
1349
1357
|
i(o) {
|
|
1350
|
-
n || (
|
|
1358
|
+
n || (O(t.$$.fragment, o), n = !0);
|
|
1351
1359
|
},
|
|
1352
1360
|
o(o) {
|
|
1353
|
-
|
|
1361
|
+
P(t.$$.fragment, o), n = !1;
|
|
1354
1362
|
},
|
|
1355
1363
|
d(o) {
|
|
1356
|
-
|
|
1364
|
+
te(t, o);
|
|
1357
1365
|
}
|
|
1358
1366
|
};
|
|
1359
1367
|
}
|
|
1360
|
-
function
|
|
1361
|
-
let t, n, o, i, s, r, l, a, c, u, f, h =
|
|
1368
|
+
function Lo(e) {
|
|
1369
|
+
let t, n, o, i, s, r, l, a, c, u, f, h = ve(
|
|
1362
1370
|
/*geom*/
|
|
1363
1371
|
e[4].points
|
|
1364
|
-
),
|
|
1365
|
-
for (let
|
|
1366
|
-
|
|
1367
|
-
const g = (
|
|
1368
|
-
|
|
1372
|
+
), y = [];
|
|
1373
|
+
for (let m = 0; m < h.length; m += 1)
|
|
1374
|
+
y[m] = vt(kt(e, h, m));
|
|
1375
|
+
const g = (m) => P(y[m], 1, 1, () => {
|
|
1376
|
+
y[m] = null;
|
|
1369
1377
|
});
|
|
1370
1378
|
return {
|
|
1371
1379
|
c() {
|
|
1372
|
-
t =
|
|
1373
|
-
for (let
|
|
1374
|
-
|
|
1375
|
-
a =
|
|
1380
|
+
t = C("polygon"), i = se(), s = C("polygon"), l = se();
|
|
1381
|
+
for (let m = 0; m < y.length; m += 1)
|
|
1382
|
+
y[m].c();
|
|
1383
|
+
a = ae(), d(t, "class", "a9s-outer"), d(t, "style", n = /*computedStyle*/
|
|
1376
1384
|
e[1] ? "display:none;" : void 0), d(t, "points", o = /*geom*/
|
|
1377
1385
|
e[4].points.map(It).join(" ")), d(s, "class", "a9s-inner a9s-shape-handle"), d(
|
|
1378
1386
|
s,
|
|
@@ -1382,27 +1390,27 @@ function vo(e) {
|
|
|
1382
1390
|
), d(s, "points", r = /*geom*/
|
|
1383
1391
|
e[4].points.map(Bt).join(" "));
|
|
1384
1392
|
},
|
|
1385
|
-
m(
|
|
1386
|
-
|
|
1387
|
-
for (let
|
|
1388
|
-
p
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1393
|
+
m(m, A) {
|
|
1394
|
+
B(m, t, A), B(m, i, A), B(m, s, A), B(m, l, A);
|
|
1395
|
+
for (let p = 0; p < y.length; p += 1)
|
|
1396
|
+
y[p] && y[p].m(m, A);
|
|
1397
|
+
B(m, a, A), c = !0, u || (f = [
|
|
1398
|
+
z(t, "pointerdown", function() {
|
|
1399
|
+
K(
|
|
1392
1400
|
/*grab*/
|
|
1393
1401
|
e[9]("SHAPE")
|
|
1394
1402
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1395
1403
|
}),
|
|
1396
|
-
|
|
1397
|
-
|
|
1404
|
+
z(s, "pointerdown", function() {
|
|
1405
|
+
K(
|
|
1398
1406
|
/*grab*/
|
|
1399
1407
|
e[9]("SHAPE")
|
|
1400
1408
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1401
1409
|
})
|
|
1402
1410
|
], u = !0);
|
|
1403
1411
|
},
|
|
1404
|
-
p(
|
|
1405
|
-
if (e =
|
|
1412
|
+
p(m, A) {
|
|
1413
|
+
if (e = m, (!c || A & /*computedStyle*/
|
|
1406
1414
|
2 && n !== (n = /*computedStyle*/
|
|
1407
1415
|
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!c || A & /*geom*/
|
|
1408
1416
|
16 && o !== (o = /*geom*/
|
|
@@ -1416,39 +1424,39 @@ function vo(e) {
|
|
|
1416
1424
|
16 && r !== (r = /*geom*/
|
|
1417
1425
|
e[4].points.map(Bt).join(" "))) && d(s, "points", r), A & /*geom, viewportScale, grab*/
|
|
1418
1426
|
536) {
|
|
1419
|
-
h =
|
|
1427
|
+
h = ve(
|
|
1420
1428
|
/*geom*/
|
|
1421
1429
|
e[4].points
|
|
1422
1430
|
);
|
|
1423
|
-
let
|
|
1424
|
-
for (
|
|
1425
|
-
const
|
|
1426
|
-
p
|
|
1431
|
+
let p;
|
|
1432
|
+
for (p = 0; p < h.length; p += 1) {
|
|
1433
|
+
const _ = kt(e, h, p);
|
|
1434
|
+
y[p] ? (y[p].p(_, A), O(y[p], 1)) : (y[p] = vt(_), y[p].c(), O(y[p], 1), y[p].m(a.parentNode, a));
|
|
1427
1435
|
}
|
|
1428
|
-
for (
|
|
1429
|
-
g(
|
|
1430
|
-
|
|
1436
|
+
for (re(), p = h.length; p < y.length; p += 1)
|
|
1437
|
+
g(p);
|
|
1438
|
+
le();
|
|
1431
1439
|
}
|
|
1432
1440
|
},
|
|
1433
|
-
i(
|
|
1441
|
+
i(m) {
|
|
1434
1442
|
if (!c) {
|
|
1435
1443
|
for (let A = 0; A < h.length; A += 1)
|
|
1436
|
-
|
|
1444
|
+
O(y[A]);
|
|
1437
1445
|
c = !0;
|
|
1438
1446
|
}
|
|
1439
1447
|
},
|
|
1440
|
-
o(
|
|
1441
|
-
|
|
1442
|
-
for (let A = 0; A <
|
|
1443
|
-
|
|
1448
|
+
o(m) {
|
|
1449
|
+
y = y.filter(Boolean);
|
|
1450
|
+
for (let A = 0; A < y.length; A += 1)
|
|
1451
|
+
P(y[A]);
|
|
1444
1452
|
c = !1;
|
|
1445
1453
|
},
|
|
1446
|
-
d(
|
|
1447
|
-
|
|
1454
|
+
d(m) {
|
|
1455
|
+
m && (I(t), I(i), I(s), I(l), I(a)), gt(y, m), u = !1, ge(f);
|
|
1448
1456
|
}
|
|
1449
1457
|
};
|
|
1450
1458
|
}
|
|
1451
|
-
function
|
|
1459
|
+
function ko(e) {
|
|
1452
1460
|
let t, n;
|
|
1453
1461
|
return t = new an({
|
|
1454
1462
|
props: {
|
|
@@ -1466,7 +1474,7 @@ function Lo(e) {
|
|
|
1466
1474
|
),
|
|
1467
1475
|
$$slots: {
|
|
1468
1476
|
default: [
|
|
1469
|
-
|
|
1477
|
+
Lo,
|
|
1470
1478
|
({ grab: o }) => ({ 9: o }),
|
|
1471
1479
|
({ grab: o }) => o ? 512 : 0
|
|
1472
1480
|
]
|
|
@@ -1487,10 +1495,10 @@ function Lo(e) {
|
|
|
1487
1495
|
e[8]
|
|
1488
1496
|
), {
|
|
1489
1497
|
c() {
|
|
1490
|
-
|
|
1498
|
+
ne(t.$$.fragment);
|
|
1491
1499
|
},
|
|
1492
1500
|
m(o, i) {
|
|
1493
|
-
|
|
1501
|
+
ee(t, o, i), n = !0;
|
|
1494
1502
|
},
|
|
1495
1503
|
p(o, [i]) {
|
|
1496
1504
|
const s = {};
|
|
@@ -1502,25 +1510,25 @@ function Lo(e) {
|
|
|
1502
1510
|
8730 && (s.$$scope = { dirty: i, ctx: o }), t.$set(s);
|
|
1503
1511
|
},
|
|
1504
1512
|
i(o) {
|
|
1505
|
-
n || (
|
|
1513
|
+
n || (O(t.$$.fragment, o), n = !0);
|
|
1506
1514
|
},
|
|
1507
1515
|
o(o) {
|
|
1508
|
-
|
|
1516
|
+
P(t.$$.fragment, o), n = !1;
|
|
1509
1517
|
},
|
|
1510
1518
|
d(o) {
|
|
1511
|
-
|
|
1519
|
+
te(t, o);
|
|
1512
1520
|
}
|
|
1513
1521
|
};
|
|
1514
1522
|
}
|
|
1515
1523
|
const It = (e) => e.join(","), Bt = (e) => e.join(",");
|
|
1516
|
-
function
|
|
1524
|
+
function vo(e, t, n) {
|
|
1517
1525
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1518
|
-
const a = (h,
|
|
1519
|
-
let
|
|
1526
|
+
const a = (h, y, g) => {
|
|
1527
|
+
let m;
|
|
1520
1528
|
const A = h.geometry;
|
|
1521
|
-
|
|
1522
|
-
const
|
|
1523
|
-
return { ...h, geometry: { points:
|
|
1529
|
+
y === "SHAPE" ? m = A.points.map(([_, w]) => [_ + g[0], w + g[1]]) : m = A.points.map(([_, w], E) => y === `HANDLE-${E}` ? [_ + g[0], w + g[1]] : [_, w]);
|
|
1530
|
+
const p = qe(m);
|
|
1531
|
+
return { ...h, geometry: { points: m, bounds: p } };
|
|
1524
1532
|
};
|
|
1525
1533
|
function c(h) {
|
|
1526
1534
|
me.call(this, e, h);
|
|
@@ -1548,9 +1556,9 @@ function ko(e, t, n) {
|
|
|
1548
1556
|
f
|
|
1549
1557
|
];
|
|
1550
1558
|
}
|
|
1551
|
-
class Io extends
|
|
1559
|
+
class Io extends ie {
|
|
1552
1560
|
constructor(t) {
|
|
1553
|
-
super(),
|
|
1561
|
+
super(), oe(this, t, vo, ko, Q, {
|
|
1554
1562
|
shape: 0,
|
|
1555
1563
|
computedStyle: 1,
|
|
1556
1564
|
transform: 2,
|
|
@@ -1561,19 +1569,19 @@ class Io extends ne {
|
|
|
1561
1569
|
const st = (e, t) => {
|
|
1562
1570
|
const n = Math.abs(t[0] - e[0]), o = Math.abs(t[1] - e[1]);
|
|
1563
1571
|
return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
|
|
1564
|
-
},
|
|
1572
|
+
}, Se = [];
|
|
1565
1573
|
function Bo(e, t = j) {
|
|
1566
1574
|
let n;
|
|
1567
1575
|
const o = /* @__PURE__ */ new Set();
|
|
1568
1576
|
function i(l) {
|
|
1569
1577
|
if (Q(e, l) && (e = l, n)) {
|
|
1570
|
-
const a = !
|
|
1578
|
+
const a = !Se.length;
|
|
1571
1579
|
for (const c of o)
|
|
1572
|
-
c[1](),
|
|
1580
|
+
c[1](), Se.push(c, e);
|
|
1573
1581
|
if (a) {
|
|
1574
|
-
for (let c = 0; c <
|
|
1575
|
-
|
|
1576
|
-
|
|
1582
|
+
for (let c = 0; c < Se.length; c += 2)
|
|
1583
|
+
Se[c][0](Se[c + 1]);
|
|
1584
|
+
Se.length = 0;
|
|
1577
1585
|
}
|
|
1578
1586
|
}
|
|
1579
1587
|
}
|
|
@@ -1617,7 +1625,7 @@ function Po(e) {
|
|
|
1617
1625
|
let t, n, o, i, s, r;
|
|
1618
1626
|
return {
|
|
1619
1627
|
c() {
|
|
1620
|
-
t =
|
|
1628
|
+
t = C("rect"), d(t, "class", n = Ke(`a9s-handle ${/*$$props*/
|
|
1621
1629
|
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), d(t, "x", o = /*x*/
|
|
1622
1630
|
e[0] - /*handleSize*/
|
|
1623
1631
|
e[5] / 2), d(t, "y", i = /*y*/
|
|
@@ -1635,7 +1643,7 @@ function Po(e) {
|
|
|
1635
1643
|
);
|
|
1636
1644
|
},
|
|
1637
1645
|
m(l, a) {
|
|
1638
|
-
|
|
1646
|
+
B(l, t, a), s || (r = z(
|
|
1639
1647
|
t,
|
|
1640
1648
|
"pointerdown",
|
|
1641
1649
|
/*pointerdown_handler_2*/
|
|
@@ -1644,7 +1652,7 @@ function Po(e) {
|
|
|
1644
1652
|
},
|
|
1645
1653
|
p(l, a) {
|
|
1646
1654
|
a & /*$$props*/
|
|
1647
|
-
256 && n !== (n =
|
|
1655
|
+
256 && n !== (n = Ke(`a9s-handle ${/*$$props*/
|
|
1648
1656
|
l[8].class || ""}`.trim()) + " svelte-1sgkh33") && d(t, "class", n), a & /*x, handleSize*/
|
|
1649
1657
|
33 && o !== (o = /*x*/
|
|
1650
1658
|
l[0] - /*handleSize*/
|
|
@@ -1666,7 +1674,7 @@ function Po(e) {
|
|
|
1666
1674
|
);
|
|
1667
1675
|
},
|
|
1668
1676
|
d(l) {
|
|
1669
|
-
l &&
|
|
1677
|
+
l && I(t), s = !1, r();
|
|
1670
1678
|
}
|
|
1671
1679
|
};
|
|
1672
1680
|
}
|
|
@@ -1674,7 +1682,7 @@ function Co(e) {
|
|
|
1674
1682
|
let t, n, o, i, s, r, l, a, c;
|
|
1675
1683
|
return {
|
|
1676
1684
|
c() {
|
|
1677
|
-
t =
|
|
1685
|
+
t = C("g"), n = C("circle"), i = C("rect"), d(
|
|
1678
1686
|
n,
|
|
1679
1687
|
"cx",
|
|
1680
1688
|
/*x*/
|
|
@@ -1686,12 +1694,12 @@ function Co(e) {
|
|
|
1686
1694
|
e[1]
|
|
1687
1695
|
), d(n, "r", o = /*radius*/
|
|
1688
1696
|
e[3] / /*scale*/
|
|
1689
|
-
e[2]), d(n, "class", "a9s-touch-halo svelte-1sgkh33"),
|
|
1697
|
+
e[2]), d(n, "class", "a9s-touch-halo svelte-1sgkh33"), ye(
|
|
1690
1698
|
n,
|
|
1691
1699
|
"touched",
|
|
1692
1700
|
/*touched*/
|
|
1693
1701
|
e[4]
|
|
1694
|
-
), d(i, "class", s =
|
|
1702
|
+
), d(i, "class", s = Ke(`a9s-handle ${/*$$props*/
|
|
1695
1703
|
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), d(i, "x", r = /*x*/
|
|
1696
1704
|
e[0] - /*handleSize*/
|
|
1697
1705
|
e[5] / 2), d(i, "y", l = /*y*/
|
|
@@ -1709,38 +1717,38 @@ function Co(e) {
|
|
|
1709
1717
|
), d(t, "class", "a9s-touch-handle");
|
|
1710
1718
|
},
|
|
1711
1719
|
m(u, f) {
|
|
1712
|
-
|
|
1713
|
-
|
|
1720
|
+
B(u, t, f), he(t, n), he(t, i), a || (c = [
|
|
1721
|
+
z(
|
|
1714
1722
|
n,
|
|
1715
1723
|
"pointerdown",
|
|
1716
1724
|
/*pointerdown_handler*/
|
|
1717
1725
|
e[10]
|
|
1718
1726
|
),
|
|
1719
|
-
|
|
1727
|
+
z(
|
|
1720
1728
|
n,
|
|
1721
1729
|
"pointerdown",
|
|
1722
1730
|
/*onPointerDown*/
|
|
1723
1731
|
e[6]
|
|
1724
1732
|
),
|
|
1725
|
-
|
|
1733
|
+
z(
|
|
1726
1734
|
n,
|
|
1727
1735
|
"pointerup",
|
|
1728
1736
|
/*onPointerUp*/
|
|
1729
1737
|
e[7]
|
|
1730
1738
|
),
|
|
1731
|
-
|
|
1739
|
+
z(
|
|
1732
1740
|
i,
|
|
1733
1741
|
"pointerdown",
|
|
1734
1742
|
/*pointerdown_handler_1*/
|
|
1735
1743
|
e[9]
|
|
1736
1744
|
),
|
|
1737
|
-
|
|
1745
|
+
z(
|
|
1738
1746
|
i,
|
|
1739
1747
|
"pointerdown",
|
|
1740
1748
|
/*onPointerDown*/
|
|
1741
1749
|
e[6]
|
|
1742
1750
|
),
|
|
1743
|
-
|
|
1751
|
+
z(
|
|
1744
1752
|
i,
|
|
1745
1753
|
"pointerup",
|
|
1746
1754
|
/*onPointerUp*/
|
|
@@ -1765,13 +1773,13 @@ function Co(e) {
|
|
|
1765
1773
|
12 && o !== (o = /*radius*/
|
|
1766
1774
|
u[3] / /*scale*/
|
|
1767
1775
|
u[2]) && d(n, "r", o), f & /*touched*/
|
|
1768
|
-
16 &&
|
|
1776
|
+
16 && ye(
|
|
1769
1777
|
n,
|
|
1770
1778
|
"touched",
|
|
1771
1779
|
/*touched*/
|
|
1772
1780
|
u[4]
|
|
1773
1781
|
), f & /*$$props*/
|
|
1774
|
-
256 && s !== (s =
|
|
1782
|
+
256 && s !== (s = Ke(`a9s-handle ${/*$$props*/
|
|
1775
1783
|
u[8].class || ""}`.trim()) + " svelte-1sgkh33") && d(i, "class", s), f & /*x, handleSize*/
|
|
1776
1784
|
33 && r !== (r = /*x*/
|
|
1777
1785
|
u[0] - /*handleSize*/
|
|
@@ -1793,7 +1801,7 @@ function Co(e) {
|
|
|
1793
1801
|
);
|
|
1794
1802
|
},
|
|
1795
1803
|
d(u) {
|
|
1796
|
-
u &&
|
|
1804
|
+
u && I(t), a = !1, ge(c);
|
|
1797
1805
|
}
|
|
1798
1806
|
};
|
|
1799
1807
|
}
|
|
@@ -1805,10 +1813,10 @@ function Xo(e) {
|
|
|
1805
1813
|
let i = n()(e);
|
|
1806
1814
|
return {
|
|
1807
1815
|
c() {
|
|
1808
|
-
i.c(), t =
|
|
1816
|
+
i.c(), t = ae();
|
|
1809
1817
|
},
|
|
1810
1818
|
m(s, r) {
|
|
1811
|
-
i.m(s, r),
|
|
1819
|
+
i.m(s, r), B(s, t, r);
|
|
1812
1820
|
},
|
|
1813
1821
|
p(s, [r]) {
|
|
1814
1822
|
i.p(s, r);
|
|
@@ -1816,11 +1824,11 @@ function Xo(e) {
|
|
|
1816
1824
|
i: j,
|
|
1817
1825
|
o: j,
|
|
1818
1826
|
d(s) {
|
|
1819
|
-
s &&
|
|
1827
|
+
s && I(t), i.d(s);
|
|
1820
1828
|
}
|
|
1821
1829
|
};
|
|
1822
1830
|
}
|
|
1823
|
-
function
|
|
1831
|
+
function Ro(e, t, n) {
|
|
1824
1832
|
let o, { x: i } = t, { y: s } = t, { scale: r } = t, { radius: l = 30 } = t, a = !1;
|
|
1825
1833
|
const c = (g) => {
|
|
1826
1834
|
g.pointerType === "touch" && n(4, a = !0);
|
|
@@ -1831,7 +1839,7 @@ function Uo(e, t, n) {
|
|
|
1831
1839
|
function h(g) {
|
|
1832
1840
|
me.call(this, e, g);
|
|
1833
1841
|
}
|
|
1834
|
-
function
|
|
1842
|
+
function y(g) {
|
|
1835
1843
|
me.call(this, e, g);
|
|
1836
1844
|
}
|
|
1837
1845
|
return e.$$set = (g) => {
|
|
@@ -1851,17 +1859,17 @@ function Uo(e, t, n) {
|
|
|
1851
1859
|
t,
|
|
1852
1860
|
f,
|
|
1853
1861
|
h,
|
|
1854
|
-
|
|
1862
|
+
y
|
|
1855
1863
|
];
|
|
1856
1864
|
}
|
|
1857
|
-
class
|
|
1865
|
+
class Pe extends ie {
|
|
1858
1866
|
constructor(t) {
|
|
1859
|
-
super(),
|
|
1867
|
+
super(), oe(this, t, Ro, Xo, Q, { x: 0, y: 1, scale: 2, radius: 3 });
|
|
1860
1868
|
}
|
|
1861
1869
|
}
|
|
1862
|
-
function
|
|
1863
|
-
let t, n, o, i, s, r, l, a, c, u, f, h,
|
|
1864
|
-
return
|
|
1870
|
+
function Uo(e) {
|
|
1871
|
+
let t, n, o, i, s, r, l, a, c, u, f, h, y, g, m, A, p, _, w, E, v, X, U, V, Z, S, L, b, T, Y, D, H, J, $, pe, ce, Be, fe, Oe, ue, R, De, Ve;
|
|
1872
|
+
return $ = new Pe({
|
|
1865
1873
|
props: {
|
|
1866
1874
|
class: "a9s-corner-handle-topleft",
|
|
1867
1875
|
x: (
|
|
@@ -1877,12 +1885,12 @@ function Ro(e) {
|
|
|
1877
1885
|
e[3]
|
|
1878
1886
|
)
|
|
1879
1887
|
}
|
|
1880
|
-
}),
|
|
1881
|
-
|
|
1888
|
+
}), $.$on("pointerdown", function() {
|
|
1889
|
+
K(
|
|
1882
1890
|
/*grab*/
|
|
1883
1891
|
e[9]("TOP_LEFT")
|
|
1884
1892
|
) && e[9]("TOP_LEFT").apply(this, arguments);
|
|
1885
|
-
}), ce = new
|
|
1893
|
+
}), ce = new Pe({
|
|
1886
1894
|
props: {
|
|
1887
1895
|
class: "a9s-corner-handle-topright",
|
|
1888
1896
|
x: (
|
|
@@ -1900,11 +1908,11 @@ function Ro(e) {
|
|
|
1900
1908
|
)
|
|
1901
1909
|
}
|
|
1902
1910
|
}), ce.$on("pointerdown", function() {
|
|
1903
|
-
|
|
1911
|
+
K(
|
|
1904
1912
|
/*grab*/
|
|
1905
1913
|
e[9]("TOP_RIGHT")
|
|
1906
1914
|
) && e[9]("TOP_RIGHT").apply(this, arguments);
|
|
1907
|
-
}), fe = new
|
|
1915
|
+
}), fe = new Pe({
|
|
1908
1916
|
props: {
|
|
1909
1917
|
class: "a9s-corner-handle-bottomright",
|
|
1910
1918
|
x: (
|
|
@@ -1923,11 +1931,11 @@ function Ro(e) {
|
|
|
1923
1931
|
)
|
|
1924
1932
|
}
|
|
1925
1933
|
}), fe.$on("pointerdown", function() {
|
|
1926
|
-
|
|
1934
|
+
K(
|
|
1927
1935
|
/*grab*/
|
|
1928
1936
|
e[9]("BOTTOM_RIGHT")
|
|
1929
1937
|
) && e[9]("BOTTOM_RIGHT").apply(this, arguments);
|
|
1930
|
-
}), ue = new
|
|
1938
|
+
}), ue = new Pe({
|
|
1931
1939
|
props: {
|
|
1932
1940
|
class: "a9s-corner-handle-bottomleft",
|
|
1933
1941
|
x: (
|
|
@@ -1945,13 +1953,13 @@ function Ro(e) {
|
|
|
1945
1953
|
)
|
|
1946
1954
|
}
|
|
1947
1955
|
}), ue.$on("pointerdown", function() {
|
|
1948
|
-
|
|
1956
|
+
K(
|
|
1949
1957
|
/*grab*/
|
|
1950
1958
|
e[9]("BOTTOM_LEFT")
|
|
1951
1959
|
) && e[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
1952
1960
|
}), {
|
|
1953
1961
|
c() {
|
|
1954
|
-
t =
|
|
1962
|
+
t = C("rect"), l = se(), a = C("rect"), y = se(), g = C("rect"), _ = se(), w = C("rect"), U = se(), V = C("rect"), b = se(), T = C("rect"), J = se(), ne($.$$.fragment), pe = se(), ne(ce.$$.fragment), Be = se(), ne(fe.$$.fragment), Oe = se(), ne(ue.$$.fragment), d(t, "class", "a9s-outer"), d(t, "style", n = /*computedStyle*/
|
|
1955
1963
|
e[1] ? "display:none;" : void 0), d(t, "x", o = /*geom*/
|
|
1956
1964
|
e[4].x), d(t, "y", i = /*geom*/
|
|
1957
1965
|
e[4].y), d(t, "width", s = /*geom*/
|
|
@@ -1965,159 +1973,159 @@ function Ro(e) {
|
|
|
1965
1973
|
e[4].x), d(a, "y", u = /*geom*/
|
|
1966
1974
|
e[4].y), d(a, "width", f = /*geom*/
|
|
1967
1975
|
e[4].w), d(a, "height", h = /*geom*/
|
|
1968
|
-
e[4].h), d(g, "class", "a9s-edge-handle a9s-edge-handle-top"), d(g, "x",
|
|
1976
|
+
e[4].h), d(g, "class", "a9s-edge-handle a9s-edge-handle-top"), d(g, "x", m = /*geom*/
|
|
1969
1977
|
e[4].x), d(g, "y", A = /*geom*/
|
|
1970
|
-
e[4].y), d(g, "height", 1), d(g, "width",
|
|
1978
|
+
e[4].y), d(g, "height", 1), d(g, "width", p = /*geom*/
|
|
1971
1979
|
e[4].w), d(w, "class", "a9s-edge-handle a9s-edge-handle-right"), d(w, "x", E = /*geom*/
|
|
1972
1980
|
e[4].x + /*geom*/
|
|
1973
|
-
e[4].w), d(w, "y",
|
|
1974
|
-
e[4].y), d(w, "height",
|
|
1981
|
+
e[4].w), d(w, "y", v = /*geom*/
|
|
1982
|
+
e[4].y), d(w, "height", X = /*geom*/
|
|
1975
1983
|
e[4].h), d(w, "width", 1), d(V, "class", "a9s-edge-handle a9s-edge-handle-bottom"), d(V, "x", Z = /*geom*/
|
|
1976
1984
|
e[4].x), d(V, "y", S = /*geom*/
|
|
1977
1985
|
e[4].y + /*geom*/
|
|
1978
|
-
e[4].h), d(V, "height", 1), d(V, "width",
|
|
1979
|
-
e[4].w), d(
|
|
1980
|
-
e[4].x), d(
|
|
1981
|
-
e[4].y), d(
|
|
1982
|
-
e[4].h), d(
|
|
1983
|
-
},
|
|
1984
|
-
m(
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1986
|
+
e[4].h), d(V, "height", 1), d(V, "width", L = /*geom*/
|
|
1987
|
+
e[4].w), d(T, "class", "a9s-edge-handle a9s-edge-handle-left"), d(T, "x", Y = /*geom*/
|
|
1988
|
+
e[4].x), d(T, "y", D = /*geom*/
|
|
1989
|
+
e[4].y), d(T, "height", H = /*geom*/
|
|
1990
|
+
e[4].h), d(T, "width", 1);
|
|
1991
|
+
},
|
|
1992
|
+
m(M, k) {
|
|
1993
|
+
B(M, t, k), B(M, l, k), B(M, a, k), B(M, y, k), B(M, g, k), B(M, _, k), B(M, w, k), B(M, U, k), B(M, V, k), B(M, b, k), B(M, T, k), B(M, J, k), ee($, M, k), B(M, pe, k), ee(ce, M, k), B(M, Be, k), ee(fe, M, k), B(M, Oe, k), ee(ue, M, k), R = !0, De || (Ve = [
|
|
1994
|
+
z(t, "pointerdown", function() {
|
|
1995
|
+
K(
|
|
1988
1996
|
/*grab*/
|
|
1989
1997
|
e[9]("SHAPE")
|
|
1990
1998
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1991
1999
|
}),
|
|
1992
|
-
|
|
1993
|
-
|
|
2000
|
+
z(a, "pointerdown", function() {
|
|
2001
|
+
K(
|
|
1994
2002
|
/*grab*/
|
|
1995
2003
|
e[9]("SHAPE")
|
|
1996
2004
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1997
2005
|
}),
|
|
1998
|
-
|
|
1999
|
-
|
|
2006
|
+
z(g, "pointerdown", function() {
|
|
2007
|
+
K(
|
|
2000
2008
|
/*grab*/
|
|
2001
2009
|
e[9]("TOP")
|
|
2002
2010
|
) && e[9]("TOP").apply(this, arguments);
|
|
2003
2011
|
}),
|
|
2004
|
-
|
|
2005
|
-
|
|
2012
|
+
z(w, "pointerdown", function() {
|
|
2013
|
+
K(
|
|
2006
2014
|
/*grab*/
|
|
2007
2015
|
e[9]("RIGHT")
|
|
2008
2016
|
) && e[9]("RIGHT").apply(this, arguments);
|
|
2009
2017
|
}),
|
|
2010
|
-
|
|
2011
|
-
|
|
2018
|
+
z(V, "pointerdown", function() {
|
|
2019
|
+
K(
|
|
2012
2020
|
/*grab*/
|
|
2013
2021
|
e[9]("BOTTOM")
|
|
2014
2022
|
) && e[9]("BOTTOM").apply(this, arguments);
|
|
2015
2023
|
}),
|
|
2016
|
-
|
|
2017
|
-
|
|
2024
|
+
z(T, "pointerdown", function() {
|
|
2025
|
+
K(
|
|
2018
2026
|
/*grab*/
|
|
2019
2027
|
e[9]("LEFT")
|
|
2020
2028
|
) && e[9]("LEFT").apply(this, arguments);
|
|
2021
2029
|
})
|
|
2022
|
-
],
|
|
2030
|
+
], De = !0);
|
|
2023
2031
|
},
|
|
2024
|
-
p(
|
|
2025
|
-
e =
|
|
2032
|
+
p(M, k) {
|
|
2033
|
+
e = M, (!R || k & /*computedStyle*/
|
|
2026
2034
|
2 && n !== (n = /*computedStyle*/
|
|
2027
|
-
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!R ||
|
|
2035
|
+
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!R || k & /*geom*/
|
|
2028
2036
|
16 && o !== (o = /*geom*/
|
|
2029
|
-
e[4].x)) && d(t, "x", o), (!R ||
|
|
2037
|
+
e[4].x)) && d(t, "x", o), (!R || k & /*geom*/
|
|
2030
2038
|
16 && i !== (i = /*geom*/
|
|
2031
|
-
e[4].y)) && d(t, "y", i), (!R ||
|
|
2039
|
+
e[4].y)) && d(t, "y", i), (!R || k & /*geom*/
|
|
2032
2040
|
16 && s !== (s = /*geom*/
|
|
2033
|
-
e[4].w)) && d(t, "width", s), (!R ||
|
|
2041
|
+
e[4].w)) && d(t, "width", s), (!R || k & /*geom*/
|
|
2034
2042
|
16 && r !== (r = /*geom*/
|
|
2035
|
-
e[4].h)) && d(t, "height", r), (!R ||
|
|
2043
|
+
e[4].h)) && d(t, "height", r), (!R || k & /*computedStyle*/
|
|
2036
2044
|
2) && d(
|
|
2037
2045
|
a,
|
|
2038
2046
|
"style",
|
|
2039
2047
|
/*computedStyle*/
|
|
2040
2048
|
e[1]
|
|
2041
|
-
), (!R ||
|
|
2049
|
+
), (!R || k & /*geom*/
|
|
2042
2050
|
16 && c !== (c = /*geom*/
|
|
2043
|
-
e[4].x)) && d(a, "x", c), (!R ||
|
|
2051
|
+
e[4].x)) && d(a, "x", c), (!R || k & /*geom*/
|
|
2044
2052
|
16 && u !== (u = /*geom*/
|
|
2045
|
-
e[4].y)) && d(a, "y", u), (!R ||
|
|
2053
|
+
e[4].y)) && d(a, "y", u), (!R || k & /*geom*/
|
|
2046
2054
|
16 && f !== (f = /*geom*/
|
|
2047
|
-
e[4].w)) && d(a, "width", f), (!R ||
|
|
2055
|
+
e[4].w)) && d(a, "width", f), (!R || k & /*geom*/
|
|
2048
2056
|
16 && h !== (h = /*geom*/
|
|
2049
|
-
e[4].h)) && d(a, "height", h), (!R ||
|
|
2050
|
-
16 && _ !== (_ = /*geom*/
|
|
2051
|
-
e[4].x)) && d(g, "x", _), (!R || v & /*geom*/
|
|
2052
|
-
16 && A !== (A = /*geom*/
|
|
2053
|
-
e[4].y)) && d(g, "y", A), (!R || v & /*geom*/
|
|
2057
|
+
e[4].h)) && d(a, "height", h), (!R || k & /*geom*/
|
|
2054
2058
|
16 && m !== (m = /*geom*/
|
|
2055
|
-
e[4].
|
|
2059
|
+
e[4].x)) && d(g, "x", m), (!R || k & /*geom*/
|
|
2060
|
+
16 && A !== (A = /*geom*/
|
|
2061
|
+
e[4].y)) && d(g, "y", A), (!R || k & /*geom*/
|
|
2062
|
+
16 && p !== (p = /*geom*/
|
|
2063
|
+
e[4].w)) && d(g, "width", p), (!R || k & /*geom*/
|
|
2056
2064
|
16 && E !== (E = /*geom*/
|
|
2057
2065
|
e[4].x + /*geom*/
|
|
2058
|
-
e[4].w)) && d(w, "x", E), (!R ||
|
|
2059
|
-
16 &&
|
|
2060
|
-
e[4].y)) && d(w, "y",
|
|
2061
|
-
16 &&
|
|
2062
|
-
e[4].h)) && d(w, "height",
|
|
2066
|
+
e[4].w)) && d(w, "x", E), (!R || k & /*geom*/
|
|
2067
|
+
16 && v !== (v = /*geom*/
|
|
2068
|
+
e[4].y)) && d(w, "y", v), (!R || k & /*geom*/
|
|
2069
|
+
16 && X !== (X = /*geom*/
|
|
2070
|
+
e[4].h)) && d(w, "height", X), (!R || k & /*geom*/
|
|
2063
2071
|
16 && Z !== (Z = /*geom*/
|
|
2064
|
-
e[4].x)) && d(V, "x", Z), (!R ||
|
|
2072
|
+
e[4].x)) && d(V, "x", Z), (!R || k & /*geom*/
|
|
2065
2073
|
16 && S !== (S = /*geom*/
|
|
2066
2074
|
e[4].y + /*geom*/
|
|
2067
|
-
e[4].h)) && d(V, "y", S), (!R ||
|
|
2068
|
-
16 &&
|
|
2069
|
-
e[4].w)) && d(V, "width",
|
|
2070
|
-
16 &&
|
|
2071
|
-
e[4].x)) && d(
|
|
2075
|
+
e[4].h)) && d(V, "y", S), (!R || k & /*geom*/
|
|
2076
|
+
16 && L !== (L = /*geom*/
|
|
2077
|
+
e[4].w)) && d(V, "width", L), (!R || k & /*geom*/
|
|
2078
|
+
16 && Y !== (Y = /*geom*/
|
|
2079
|
+
e[4].x)) && d(T, "x", Y), (!R || k & /*geom*/
|
|
2072
2080
|
16 && D !== (D = /*geom*/
|
|
2073
|
-
e[4].y)) && d(
|
|
2074
|
-
16 &&
|
|
2075
|
-
e[4].h)) && d(
|
|
2081
|
+
e[4].y)) && d(T, "y", D), (!R || k & /*geom*/
|
|
2082
|
+
16 && H !== (H = /*geom*/
|
|
2083
|
+
e[4].h)) && d(T, "height", H);
|
|
2084
|
+
const N = {};
|
|
2085
|
+
k & /*geom*/
|
|
2086
|
+
16 && (N.x = /*geom*/
|
|
2087
|
+
e[4].x), k & /*geom*/
|
|
2088
|
+
16 && (N.y = /*geom*/
|
|
2089
|
+
e[4].y), k & /*viewportScale*/
|
|
2090
|
+
8 && (N.scale = /*viewportScale*/
|
|
2091
|
+
e[3]), $.$set(N);
|
|
2092
|
+
const x = {};
|
|
2093
|
+
k & /*geom*/
|
|
2094
|
+
16 && (x.x = /*geom*/
|
|
2095
|
+
e[4].x + /*geom*/
|
|
2096
|
+
e[4].w), k & /*geom*/
|
|
2097
|
+
16 && (x.y = /*geom*/
|
|
2098
|
+
e[4].y), k & /*viewportScale*/
|
|
2099
|
+
8 && (x.scale = /*viewportScale*/
|
|
2100
|
+
e[3]), ce.$set(x);
|
|
2076
2101
|
const de = {};
|
|
2077
|
-
|
|
2102
|
+
k & /*geom*/
|
|
2078
2103
|
16 && (de.x = /*geom*/
|
|
2079
|
-
e[4].x), v & /*geom*/
|
|
2080
|
-
16 && (de.y = /*geom*/
|
|
2081
|
-
e[4].y), v & /*viewportScale*/
|
|
2082
|
-
8 && (de.scale = /*viewportScale*/
|
|
2083
|
-
e[3]), ae.$set(de);
|
|
2084
|
-
const _e = {};
|
|
2085
|
-
v & /*geom*/
|
|
2086
|
-
16 && (_e.x = /*geom*/
|
|
2087
|
-
e[4].x + /*geom*/
|
|
2088
|
-
e[4].w), v & /*geom*/
|
|
2089
|
-
16 && (_e.y = /*geom*/
|
|
2090
|
-
e[4].y), v & /*viewportScale*/
|
|
2091
|
-
8 && (_e.scale = /*viewportScale*/
|
|
2092
|
-
e[3]), ce.$set(_e);
|
|
2093
|
-
const Ne = {};
|
|
2094
|
-
v & /*geom*/
|
|
2095
|
-
16 && (Ne.x = /*geom*/
|
|
2096
2104
|
e[4].x + /*geom*/
|
|
2097
|
-
e[4].w),
|
|
2098
|
-
16 && (
|
|
2105
|
+
e[4].w), k & /*geom*/
|
|
2106
|
+
16 && (de.y = /*geom*/
|
|
2099
2107
|
e[4].y + /*geom*/
|
|
2100
|
-
e[4].h),
|
|
2101
|
-
8 && (
|
|
2102
|
-
e[3]), fe.$set(
|
|
2103
|
-
const
|
|
2104
|
-
|
|
2105
|
-
16 && (
|
|
2106
|
-
e[4].x),
|
|
2107
|
-
16 && (
|
|
2108
|
+
e[4].h), k & /*viewportScale*/
|
|
2109
|
+
8 && (de.scale = /*viewportScale*/
|
|
2110
|
+
e[3]), fe.$set(de);
|
|
2111
|
+
const we = {};
|
|
2112
|
+
k & /*geom*/
|
|
2113
|
+
16 && (we.x = /*geom*/
|
|
2114
|
+
e[4].x), k & /*geom*/
|
|
2115
|
+
16 && (we.y = /*geom*/
|
|
2108
2116
|
e[4].y + /*geom*/
|
|
2109
|
-
e[4].h),
|
|
2110
|
-
8 && (
|
|
2111
|
-
e[3]), ue.$set(
|
|
2117
|
+
e[4].h), k & /*viewportScale*/
|
|
2118
|
+
8 && (we.scale = /*viewportScale*/
|
|
2119
|
+
e[3]), ue.$set(we);
|
|
2112
2120
|
},
|
|
2113
|
-
i(
|
|
2114
|
-
R || (
|
|
2121
|
+
i(M) {
|
|
2122
|
+
R || (O($.$$.fragment, M), O(ce.$$.fragment, M), O(fe.$$.fragment, M), O(ue.$$.fragment, M), R = !0);
|
|
2115
2123
|
},
|
|
2116
|
-
o(
|
|
2117
|
-
|
|
2124
|
+
o(M) {
|
|
2125
|
+
P($.$$.fragment, M), P(ce.$$.fragment, M), P(fe.$$.fragment, M), P(ue.$$.fragment, M), R = !1;
|
|
2118
2126
|
},
|
|
2119
|
-
d(
|
|
2120
|
-
|
|
2127
|
+
d(M) {
|
|
2128
|
+
M && (I(t), I(l), I(a), I(y), I(g), I(_), I(w), I(U), I(V), I(b), I(T), I(J), I(pe), I(Be), I(Oe)), te($, M), te(ce, M), te(fe, M), te(ue, M), De = !1, ge(Ve);
|
|
2121
2129
|
}
|
|
2122
2130
|
};
|
|
2123
2131
|
}
|
|
@@ -2139,7 +2147,7 @@ function No(e) {
|
|
|
2139
2147
|
),
|
|
2140
2148
|
$$slots: {
|
|
2141
2149
|
default: [
|
|
2142
|
-
|
|
2150
|
+
Uo,
|
|
2143
2151
|
({ grab: o }) => ({ 9: o }),
|
|
2144
2152
|
({ grab: o }) => o ? 512 : 0
|
|
2145
2153
|
]
|
|
@@ -2160,10 +2168,10 @@ function No(e) {
|
|
|
2160
2168
|
e[8]
|
|
2161
2169
|
), {
|
|
2162
2170
|
c() {
|
|
2163
|
-
|
|
2171
|
+
ne(t.$$.fragment);
|
|
2164
2172
|
},
|
|
2165
2173
|
m(o, i) {
|
|
2166
|
-
|
|
2174
|
+
ee(t, o, i), n = !0;
|
|
2167
2175
|
},
|
|
2168
2176
|
p(o, [i]) {
|
|
2169
2177
|
const s = {};
|
|
@@ -2175,40 +2183,40 @@ function No(e) {
|
|
|
2175
2183
|
1562 && (s.$$scope = { dirty: i, ctx: o }), t.$set(s);
|
|
2176
2184
|
},
|
|
2177
2185
|
i(o) {
|
|
2178
|
-
n || (
|
|
2186
|
+
n || (O(t.$$.fragment, o), n = !0);
|
|
2179
2187
|
},
|
|
2180
2188
|
o(o) {
|
|
2181
|
-
|
|
2189
|
+
P(t.$$.fragment, o), n = !1;
|
|
2182
2190
|
},
|
|
2183
2191
|
d(o) {
|
|
2184
|
-
|
|
2192
|
+
te(t, o);
|
|
2185
2193
|
}
|
|
2186
2194
|
};
|
|
2187
2195
|
}
|
|
2188
2196
|
function Vo(e, t, n) {
|
|
2189
2197
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
2190
|
-
const a = (h,
|
|
2191
|
-
const
|
|
2192
|
-
let [A,
|
|
2193
|
-
const [E,
|
|
2194
|
-
if (
|
|
2195
|
-
A += E,
|
|
2198
|
+
const a = (h, y, g) => {
|
|
2199
|
+
const m = h.geometry.bounds;
|
|
2200
|
+
let [A, p] = [m.minX, m.minY], [_, w] = [m.maxX, m.maxY];
|
|
2201
|
+
const [E, v] = g;
|
|
2202
|
+
if (y === "SHAPE")
|
|
2203
|
+
A += E, _ += E, p += v, w += v;
|
|
2196
2204
|
else {
|
|
2197
|
-
switch (
|
|
2205
|
+
switch (y) {
|
|
2198
2206
|
case "TOP":
|
|
2199
2207
|
case "TOP_LEFT":
|
|
2200
2208
|
case "TOP_RIGHT": {
|
|
2201
|
-
|
|
2209
|
+
p += v;
|
|
2202
2210
|
break;
|
|
2203
2211
|
}
|
|
2204
2212
|
case "BOTTOM":
|
|
2205
2213
|
case "BOTTOM_LEFT":
|
|
2206
2214
|
case "BOTTOM_RIGHT": {
|
|
2207
|
-
w +=
|
|
2215
|
+
w += v;
|
|
2208
2216
|
break;
|
|
2209
2217
|
}
|
|
2210
2218
|
}
|
|
2211
|
-
switch (
|
|
2219
|
+
switch (y) {
|
|
2212
2220
|
case "LEFT":
|
|
2213
2221
|
case "TOP_LEFT":
|
|
2214
2222
|
case "BOTTOM_LEFT": {
|
|
@@ -2218,24 +2226,24 @@ function Vo(e, t, n) {
|
|
|
2218
2226
|
case "RIGHT":
|
|
2219
2227
|
case "TOP_RIGHT":
|
|
2220
2228
|
case "BOTTOM_RIGHT": {
|
|
2221
|
-
|
|
2229
|
+
_ += E;
|
|
2222
2230
|
break;
|
|
2223
2231
|
}
|
|
2224
2232
|
}
|
|
2225
2233
|
}
|
|
2226
|
-
const
|
|
2234
|
+
const X = Math.min(A, _), U = Math.min(p, w), V = Math.abs(_ - A), Z = Math.abs(w - p);
|
|
2227
2235
|
return {
|
|
2228
2236
|
...h,
|
|
2229
2237
|
geometry: {
|
|
2230
|
-
x:
|
|
2231
|
-
y:
|
|
2238
|
+
x: X,
|
|
2239
|
+
y: U,
|
|
2232
2240
|
w: V,
|
|
2233
2241
|
h: Z,
|
|
2234
2242
|
bounds: {
|
|
2235
|
-
minX:
|
|
2236
|
-
minY:
|
|
2237
|
-
maxX:
|
|
2238
|
-
maxY:
|
|
2243
|
+
minX: X,
|
|
2244
|
+
minY: U,
|
|
2245
|
+
maxX: X + V,
|
|
2246
|
+
maxY: U + Z
|
|
2239
2247
|
}
|
|
2240
2248
|
}
|
|
2241
2249
|
};
|
|
@@ -2266,9 +2274,9 @@ function Vo(e, t, n) {
|
|
|
2266
2274
|
f
|
|
2267
2275
|
];
|
|
2268
2276
|
}
|
|
2269
|
-
class Go extends
|
|
2277
|
+
class Go extends ie {
|
|
2270
2278
|
constructor(t) {
|
|
2271
|
-
super(),
|
|
2279
|
+
super(), oe(this, t, Vo, No, Q, {
|
|
2272
2280
|
shape: 0,
|
|
2273
2281
|
computedStyle: 1,
|
|
2274
2282
|
transform: 2,
|
|
@@ -2297,17 +2305,17 @@ function Fo(e) {
|
|
|
2297
2305
|
);
|
|
2298
2306
|
return {
|
|
2299
2307
|
c() {
|
|
2300
|
-
t =
|
|
2308
|
+
t = C("g"), r && r.c(), d(t, "class", "a9s-annotation selected");
|
|
2301
2309
|
},
|
|
2302
2310
|
m(l, a) {
|
|
2303
|
-
|
|
2304
|
-
|
|
2311
|
+
B(l, t, a), r && r.m(t, null), n = !0, o || (i = [
|
|
2312
|
+
z(
|
|
2305
2313
|
t,
|
|
2306
2314
|
"pointerup",
|
|
2307
2315
|
/*onRelease*/
|
|
2308
2316
|
e[2]
|
|
2309
2317
|
),
|
|
2310
|
-
|
|
2318
|
+
z(
|
|
2311
2319
|
t,
|
|
2312
2320
|
"pointermove",
|
|
2313
2321
|
/*onPointerMove*/
|
|
@@ -2337,37 +2345,37 @@ function Fo(e) {
|
|
|
2337
2345
|
);
|
|
2338
2346
|
},
|
|
2339
2347
|
i(l) {
|
|
2340
|
-
n || (
|
|
2348
|
+
n || (O(r, l), n = !0);
|
|
2341
2349
|
},
|
|
2342
2350
|
o(l) {
|
|
2343
|
-
|
|
2351
|
+
P(r, l), n = !1;
|
|
2344
2352
|
},
|
|
2345
2353
|
d(l) {
|
|
2346
|
-
l &&
|
|
2354
|
+
l && I(t), r && r.d(l), o = !1, ge(i);
|
|
2347
2355
|
}
|
|
2348
2356
|
};
|
|
2349
2357
|
}
|
|
2350
|
-
function
|
|
2358
|
+
function Ko(e, t, n) {
|
|
2351
2359
|
let { $$slots: o = {}, $$scope: i } = t;
|
|
2352
|
-
const s =
|
|
2360
|
+
const s = Ie();
|
|
2353
2361
|
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c, u, f;
|
|
2354
|
-
const h = (
|
|
2355
|
-
c =
|
|
2356
|
-
},
|
|
2362
|
+
const h = (m) => (A) => {
|
|
2363
|
+
c = m, u = a.elementToImage(A.offsetX, A.offsetY), f = r, A.target.setPointerCapture(A.pointerId), s("grab", A);
|
|
2364
|
+
}, y = (m) => {
|
|
2357
2365
|
if (c) {
|
|
2358
|
-
const [A,
|
|
2359
|
-
n(3, r = l(f, c,
|
|
2366
|
+
const [A, p] = a.elementToImage(m.offsetX, m.offsetY), _ = [A - u[0], p - u[1]];
|
|
2367
|
+
n(3, r = l(f, c, _)), s("change", r);
|
|
2360
2368
|
}
|
|
2361
|
-
}, g = (
|
|
2362
|
-
|
|
2369
|
+
}, g = (m) => {
|
|
2370
|
+
m.target.releasePointerCapture(m.pointerId), c = void 0, f = r, s("release", m);
|
|
2363
2371
|
};
|
|
2364
|
-
return e.$$set = (
|
|
2365
|
-
"shape" in
|
|
2366
|
-
}, [h,
|
|
2372
|
+
return e.$$set = (m) => {
|
|
2373
|
+
"shape" in m && n(3, r = m.shape), "editor" in m && n(4, l = m.editor), "transform" in m && n(5, a = m.transform), "$$scope" in m && n(6, i = m.$$scope);
|
|
2374
|
+
}, [h, y, g, r, l, a, i, o];
|
|
2367
2375
|
}
|
|
2368
|
-
class an extends
|
|
2376
|
+
class an extends ie {
|
|
2369
2377
|
constructor(t) {
|
|
2370
|
-
super(),
|
|
2378
|
+
super(), oe(this, t, Ko, Fo, Q, { shape: 3, editor: 4, transform: 5 });
|
|
2371
2379
|
}
|
|
2372
2380
|
}
|
|
2373
2381
|
const Qe = (e, t) => {
|
|
@@ -2378,11 +2386,11 @@ const Qe = (e, t) => {
|
|
|
2378
2386
|
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;
|
|
2379
2387
|
}
|
|
2380
2388
|
};
|
|
2381
|
-
function
|
|
2389
|
+
function Wo(e, t, n) {
|
|
2382
2390
|
let o;
|
|
2383
|
-
const i =
|
|
2391
|
+
const i = Ie();
|
|
2384
2392
|
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale: u } = t, f;
|
|
2385
|
-
return
|
|
2393
|
+
return Ne(() => (n(6, f = new r({
|
|
2386
2394
|
target: a,
|
|
2387
2395
|
props: {
|
|
2388
2396
|
shape: s.target.selector,
|
|
@@ -2414,9 +2422,9 @@ function qo(e, t, n) {
|
|
|
2414
2422
|
o
|
|
2415
2423
|
];
|
|
2416
2424
|
}
|
|
2417
|
-
class
|
|
2425
|
+
class qo extends ie {
|
|
2418
2426
|
constructor(t) {
|
|
2419
|
-
super(),
|
|
2427
|
+
super(), oe(this, t, Wo, null, Q, {
|
|
2420
2428
|
annotation: 0,
|
|
2421
2429
|
editor: 1,
|
|
2422
2430
|
style: 2,
|
|
@@ -2427,11 +2435,11 @@ class Ko extends ne {
|
|
|
2427
2435
|
}
|
|
2428
2436
|
}
|
|
2429
2437
|
function Jo(e, t, n) {
|
|
2430
|
-
const o =
|
|
2438
|
+
const o = Ie();
|
|
2431
2439
|
let { drawingMode: i } = t, { target: s } = t, { tool: r } = t, { transform: l } = t, { viewportScale: a } = t, c;
|
|
2432
|
-
return
|
|
2433
|
-
const u = s.closest("svg"), f = [], h = (
|
|
2434
|
-
u == null || u.addEventListener(
|
|
2440
|
+
return Ne(() => {
|
|
2441
|
+
const u = s.closest("svg"), f = [], h = (y, g, m) => {
|
|
2442
|
+
u == null || u.addEventListener(y, g, m), f.push(() => u == null ? void 0 : u.removeEventListener(y, g, m));
|
|
2435
2443
|
};
|
|
2436
2444
|
return n(5, c = new r({
|
|
2437
2445
|
target: s,
|
|
@@ -2441,8 +2449,8 @@ function Jo(e, t, n) {
|
|
|
2441
2449
|
transform: l,
|
|
2442
2450
|
viewportScale: a
|
|
2443
2451
|
}
|
|
2444
|
-
})), c.$on("create", (
|
|
2445
|
-
f.forEach((
|
|
2452
|
+
})), c.$on("create", (y) => o("create", y.detail)), () => {
|
|
2453
|
+
f.forEach((y) => y()), c.$destroy();
|
|
2446
2454
|
};
|
|
2447
2455
|
}), e.$$set = (u) => {
|
|
2448
2456
|
"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);
|
|
@@ -2452,9 +2460,9 @@ function Jo(e, t, n) {
|
|
|
2452
2460
|
48 && c && c.$set({ viewportScale: a });
|
|
2453
2461
|
}, [i, s, r, l, a, c];
|
|
2454
2462
|
}
|
|
2455
|
-
class Qo extends
|
|
2463
|
+
class Qo extends ie {
|
|
2456
2464
|
constructor(t) {
|
|
2457
|
-
super(),
|
|
2465
|
+
super(), oe(this, t, Jo, null, Q, {
|
|
2458
2466
|
drawingMode: 0,
|
|
2459
2467
|
target: 1,
|
|
2460
2468
|
tool: 2,
|
|
@@ -2467,7 +2475,7 @@ function Dt(e) {
|
|
|
2467
2475
|
let t, n;
|
|
2468
2476
|
return {
|
|
2469
2477
|
c() {
|
|
2470
|
-
t =
|
|
2478
|
+
t = C("rect"), n = C("rect"), d(t, "class", "a9s-outer"), d(
|
|
2471
2479
|
t,
|
|
2472
2480
|
"x",
|
|
2473
2481
|
/*x*/
|
|
@@ -2510,7 +2518,7 @@ function Dt(e) {
|
|
|
2510
2518
|
);
|
|
2511
2519
|
},
|
|
2512
2520
|
m(o, i) {
|
|
2513
|
-
|
|
2521
|
+
B(o, t, i), B(o, n, i);
|
|
2514
2522
|
},
|
|
2515
2523
|
p(o, i) {
|
|
2516
2524
|
i & /*x*/
|
|
@@ -2564,7 +2572,7 @@ function Dt(e) {
|
|
|
2564
2572
|
);
|
|
2565
2573
|
},
|
|
2566
2574
|
d(o) {
|
|
2567
|
-
o && (
|
|
2575
|
+
o && (I(t), I(n));
|
|
2568
2576
|
}
|
|
2569
2577
|
};
|
|
2570
2578
|
}
|
|
@@ -2575,10 +2583,10 @@ function Zo(e) {
|
|
|
2575
2583
|
);
|
|
2576
2584
|
return {
|
|
2577
2585
|
c() {
|
|
2578
|
-
t =
|
|
2586
|
+
t = C("g"), n && n.c(), d(t, "class", "a9s-annotation a9s-rubberband");
|
|
2579
2587
|
},
|
|
2580
2588
|
m(o, i) {
|
|
2581
|
-
|
|
2589
|
+
B(o, t, i), n && n.m(t, null);
|
|
2582
2590
|
},
|
|
2583
2591
|
p(o, [i]) {
|
|
2584
2592
|
/*origin*/
|
|
@@ -2587,55 +2595,55 @@ function Zo(e) {
|
|
|
2587
2595
|
i: j,
|
|
2588
2596
|
o: j,
|
|
2589
2597
|
d(o) {
|
|
2590
|
-
o &&
|
|
2598
|
+
o && I(t), n && n.d();
|
|
2591
2599
|
}
|
|
2592
2600
|
};
|
|
2593
2601
|
}
|
|
2594
2602
|
function xo(e, t, n) {
|
|
2595
|
-
const o =
|
|
2596
|
-
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f, h,
|
|
2597
|
-
const g = (
|
|
2598
|
-
const w =
|
|
2599
|
-
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(w.offsetX, w.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, h = 1), n(4,
|
|
2600
|
-
},
|
|
2601
|
-
const w =
|
|
2602
|
-
a && (c = r.elementToImage(w.offsetX, w.offsetY), n(1, u = Math.min(c[0], a[0])), n(2, f = Math.min(c[1], a[1])), n(3, h = Math.abs(c[0] - a[0])), n(4,
|
|
2603
|
-
}, A = (
|
|
2604
|
-
const w =
|
|
2603
|
+
const o = Ie();
|
|
2604
|
+
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f, h, y;
|
|
2605
|
+
const g = (_) => {
|
|
2606
|
+
const w = _;
|
|
2607
|
+
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(w.offsetX, w.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, h = 1), n(4, y = 1));
|
|
2608
|
+
}, m = (_) => {
|
|
2609
|
+
const w = _;
|
|
2610
|
+
a && (c = r.elementToImage(w.offsetX, w.offsetY), n(1, u = Math.min(c[0], a[0])), n(2, f = Math.min(c[1], a[1])), n(3, h = Math.abs(c[0] - a[0])), n(4, y = Math.abs(c[1] - a[1])));
|
|
2611
|
+
}, A = (_) => {
|
|
2612
|
+
const w = _, E = performance.now() - l;
|
|
2605
2613
|
if (s === "click") {
|
|
2606
2614
|
if (E > 300) return;
|
|
2607
|
-
a ?
|
|
2608
|
-
} else a && (E > 300 || h *
|
|
2609
|
-
},
|
|
2610
|
-
if (h *
|
|
2611
|
-
const
|
|
2615
|
+
a ? p() : (n(0, a = r.elementToImage(w.offsetX, w.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, h = 1), n(4, y = 1));
|
|
2616
|
+
} else a && (E > 300 || h * y > 100 ? (w.stopPropagation(), p()) : (n(0, a = void 0), c = void 0));
|
|
2617
|
+
}, p = () => {
|
|
2618
|
+
if (h * y > 15) {
|
|
2619
|
+
const _ = {
|
|
2612
2620
|
type: F.RECTANGLE,
|
|
2613
2621
|
geometry: {
|
|
2614
2622
|
bounds: {
|
|
2615
2623
|
minX: u,
|
|
2616
2624
|
minY: f,
|
|
2617
2625
|
maxX: u + h,
|
|
2618
|
-
maxY: f +
|
|
2626
|
+
maxY: f + y
|
|
2619
2627
|
},
|
|
2620
2628
|
x: u,
|
|
2621
2629
|
y: f,
|
|
2622
2630
|
w: h,
|
|
2623
|
-
h:
|
|
2631
|
+
h: y
|
|
2624
2632
|
}
|
|
2625
2633
|
};
|
|
2626
|
-
o("create",
|
|
2634
|
+
o("create", _);
|
|
2627
2635
|
}
|
|
2628
2636
|
n(0, a = void 0), c = void 0;
|
|
2629
2637
|
};
|
|
2630
|
-
return
|
|
2631
|
-
i("pointerdown", g), i("pointermove",
|
|
2632
|
-
}), e.$$set = (
|
|
2633
|
-
"addEventListener" in
|
|
2634
|
-
}, [a, u, f, h,
|
|
2638
|
+
return Ne(() => {
|
|
2639
|
+
i("pointerdown", g), i("pointermove", m), i("pointerup", A, !0);
|
|
2640
|
+
}), e.$$set = (_) => {
|
|
2641
|
+
"addEventListener" in _ && n(5, i = _.addEventListener), "drawingMode" in _ && n(6, s = _.drawingMode), "transform" in _ && n(7, r = _.transform);
|
|
2642
|
+
}, [a, u, f, h, y, i, s, r];
|
|
2635
2643
|
}
|
|
2636
|
-
class $o extends
|
|
2644
|
+
class $o extends ie {
|
|
2637
2645
|
constructor(t) {
|
|
2638
|
-
super(),
|
|
2646
|
+
super(), oe(this, t, xo, Zo, Q, {
|
|
2639
2647
|
addEventListener: 5,
|
|
2640
2648
|
drawingMode: 6,
|
|
2641
2649
|
transform: 7
|
|
@@ -2664,12 +2672,12 @@ function Yt(e) {
|
|
|
2664
2672
|
);
|
|
2665
2673
|
return {
|
|
2666
2674
|
c() {
|
|
2667
|
-
t =
|
|
2675
|
+
t = C("polygon"), o = C("polygon"), r && r.c(), s = ae(), d(t, "class", "a9s-outer"), d(t, "points", n = /*coords*/
|
|
2668
2676
|
e[16]), d(o, "class", "a9s-inner"), d(o, "points", i = /*coords*/
|
|
2669
2677
|
e[16]);
|
|
2670
2678
|
},
|
|
2671
2679
|
m(l, a) {
|
|
2672
|
-
|
|
2680
|
+
B(l, t, a), B(l, o, a), r && r.m(l, a), B(l, s, a);
|
|
2673
2681
|
},
|
|
2674
2682
|
p(l, a) {
|
|
2675
2683
|
a & /*isClosable, points, cursor*/
|
|
@@ -2680,7 +2688,7 @@ function Yt(e) {
|
|
|
2680
2688
|
l[2] ? r ? r.p(l, a) : (r = Pt(l), r.c(), r.m(s.parentNode, s)) : r && (r.d(1), r = null);
|
|
2681
2689
|
},
|
|
2682
2690
|
d(l) {
|
|
2683
|
-
l && (
|
|
2691
|
+
l && (I(t), I(o), I(s)), r && r.d(l);
|
|
2684
2692
|
}
|
|
2685
2693
|
};
|
|
2686
2694
|
}
|
|
@@ -2688,7 +2696,7 @@ function Pt(e) {
|
|
|
2688
2696
|
let t, n, o;
|
|
2689
2697
|
return {
|
|
2690
2698
|
c() {
|
|
2691
|
-
t =
|
|
2699
|
+
t = C("rect"), d(t, "class", "a9s-handle"), d(t, "x", n = /*points*/
|
|
2692
2700
|
e[0][0][0] - /*handleSize*/
|
|
2693
2701
|
e[3] / 2), d(t, "y", o = /*points*/
|
|
2694
2702
|
e[0][0][1] - /*handleSize*/
|
|
@@ -2705,7 +2713,7 @@ function Pt(e) {
|
|
|
2705
2713
|
);
|
|
2706
2714
|
},
|
|
2707
2715
|
m(i, s) {
|
|
2708
|
-
|
|
2716
|
+
B(i, t, s);
|
|
2709
2717
|
},
|
|
2710
2718
|
p(i, s) {
|
|
2711
2719
|
s & /*points, handleSize*/
|
|
@@ -2729,7 +2737,7 @@ function Pt(e) {
|
|
|
2729
2737
|
);
|
|
2730
2738
|
},
|
|
2731
2739
|
d(i) {
|
|
2732
|
-
i &&
|
|
2740
|
+
i && I(t);
|
|
2733
2741
|
}
|
|
2734
2742
|
};
|
|
2735
2743
|
}
|
|
@@ -2740,10 +2748,10 @@ function ei(e) {
|
|
|
2740
2748
|
);
|
|
2741
2749
|
return {
|
|
2742
2750
|
c() {
|
|
2743
|
-
t =
|
|
2751
|
+
t = C("g"), n && n.c(), d(t, "class", "a9s-annotation a9s-rubberband");
|
|
2744
2752
|
},
|
|
2745
2753
|
m(o, i) {
|
|
2746
|
-
|
|
2754
|
+
B(o, t, i), n && n.m(t, null);
|
|
2747
2755
|
},
|
|
2748
2756
|
p(o, [i]) {
|
|
2749
2757
|
/*cursor*/
|
|
@@ -2752,31 +2760,31 @@ function ei(e) {
|
|
|
2752
2760
|
i: j,
|
|
2753
2761
|
o: j,
|
|
2754
2762
|
d(o) {
|
|
2755
|
-
o &&
|
|
2763
|
+
o && I(t), n && n.d();
|
|
2756
2764
|
}
|
|
2757
2765
|
};
|
|
2758
2766
|
}
|
|
2759
2767
|
const ti = 20, ni = 1500;
|
|
2760
2768
|
function oi(e, t, n) {
|
|
2761
2769
|
let o;
|
|
2762
|
-
const i =
|
|
2763
|
-
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, h,
|
|
2770
|
+
const i = Ie();
|
|
2771
|
+
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, h, y = !1;
|
|
2764
2772
|
const g = (w) => {
|
|
2765
|
-
const E = w, { timeStamp:
|
|
2766
|
-
if (c = { timeStamp:
|
|
2773
|
+
const E = w, { timeStamp: v, offsetX: X, offsetY: U } = E;
|
|
2774
|
+
if (c = { timeStamp: v, offsetX: X, offsetY: U }, r === "drag" && u.length === 0) {
|
|
2767
2775
|
const V = l.elementToImage(E.offsetX, E.offsetY);
|
|
2768
2776
|
u.push(V), n(1, f = V);
|
|
2769
2777
|
}
|
|
2770
|
-
},
|
|
2778
|
+
}, m = (w) => {
|
|
2771
2779
|
const E = w;
|
|
2772
2780
|
if (h && clearTimeout(h), u.length > 0) {
|
|
2773
2781
|
if (n(1, f = l.elementToImage(E.offsetX, E.offsetY)), u.length > 2) {
|
|
2774
|
-
const
|
|
2775
|
-
n(2,
|
|
2782
|
+
const v = st(f, u[0]) * a;
|
|
2783
|
+
n(2, y = v < ti);
|
|
2776
2784
|
}
|
|
2777
2785
|
E.pointerType === "touch" && (h = setTimeout(
|
|
2778
2786
|
() => {
|
|
2779
|
-
|
|
2787
|
+
p();
|
|
2780
2788
|
},
|
|
2781
2789
|
ni
|
|
2782
2790
|
));
|
|
@@ -2784,13 +2792,13 @@ function oi(e, t, n) {
|
|
|
2784
2792
|
}, A = (w) => {
|
|
2785
2793
|
const E = w;
|
|
2786
2794
|
if (h && clearTimeout(h), r === "click") {
|
|
2787
|
-
const
|
|
2788
|
-
if (
|
|
2789
|
-
if (
|
|
2790
|
-
|
|
2795
|
+
const v = E.timeStamp - c.timeStamp, X = st([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
|
|
2796
|
+
if (v > 300 || X > 15) return;
|
|
2797
|
+
if (y)
|
|
2798
|
+
_();
|
|
2791
2799
|
else if (u.length === 0) {
|
|
2792
|
-
const
|
|
2793
|
-
u.push(
|
|
2800
|
+
const U = l.elementToImage(E.offsetX, E.offsetY);
|
|
2801
|
+
u.push(U), n(1, f = U);
|
|
2794
2802
|
} else
|
|
2795
2803
|
u.push(f);
|
|
2796
2804
|
} else {
|
|
@@ -2798,27 +2806,27 @@ function oi(e, t, n) {
|
|
|
2798
2806
|
n(0, u = []), n(1, f = void 0);
|
|
2799
2807
|
return;
|
|
2800
2808
|
}
|
|
2801
|
-
E.stopImmediatePropagation(),
|
|
2809
|
+
E.stopImmediatePropagation(), y ? _() : u.push(f);
|
|
2802
2810
|
}
|
|
2803
|
-
},
|
|
2811
|
+
}, p = () => {
|
|
2804
2812
|
if (!f) return;
|
|
2805
2813
|
const w = [...u, f], E = {
|
|
2806
2814
|
type: F.POLYGON,
|
|
2807
|
-
geometry: { bounds:
|
|
2815
|
+
geometry: { bounds: qe(w), points: w }
|
|
2808
2816
|
};
|
|
2809
2817
|
ht(E) > 4 && (n(0, u = []), n(1, f = void 0), i("create", E));
|
|
2810
|
-
},
|
|
2818
|
+
}, _ = () => {
|
|
2811
2819
|
const w = {
|
|
2812
2820
|
type: F.POLYGON,
|
|
2813
2821
|
geometry: {
|
|
2814
|
-
bounds:
|
|
2822
|
+
bounds: qe(u),
|
|
2815
2823
|
points: [...u]
|
|
2816
2824
|
}
|
|
2817
2825
|
};
|
|
2818
2826
|
n(0, u = []), n(1, f = void 0), i("create", w);
|
|
2819
2827
|
};
|
|
2820
|
-
return
|
|
2821
|
-
s("pointerdown", g, !0), s("pointermove",
|
|
2828
|
+
return Ne(() => {
|
|
2829
|
+
s("pointerdown", g, !0), s("pointermove", m), s("pointerup", A, !0), s("dblclick", p, !0);
|
|
2822
2830
|
}), e.$$set = (w) => {
|
|
2823
2831
|
"addEventListener" in w && n(4, s = w.addEventListener), "drawingMode" in w && n(5, r = w.drawingMode), "transform" in w && n(6, l = w.transform), "viewportScale" in w && n(7, a = w.viewportScale);
|
|
2824
2832
|
}, e.$$.update = () => {
|
|
@@ -2827,7 +2835,7 @@ function oi(e, t, n) {
|
|
|
2827
2835
|
}, [
|
|
2828
2836
|
u,
|
|
2829
2837
|
f,
|
|
2830
|
-
|
|
2838
|
+
y,
|
|
2831
2839
|
o,
|
|
2832
2840
|
s,
|
|
2833
2841
|
r,
|
|
@@ -2835,9 +2843,9 @@ function oi(e, t, n) {
|
|
|
2835
2843
|
a
|
|
2836
2844
|
];
|
|
2837
2845
|
}
|
|
2838
|
-
class ii extends
|
|
2846
|
+
class ii extends ie {
|
|
2839
2847
|
constructor(t) {
|
|
2840
|
-
super(),
|
|
2848
|
+
super(), oe(this, t, oi, ei, Q, {
|
|
2841
2849
|
addEventListener: 4,
|
|
2842
2850
|
drawingMode: 5,
|
|
2843
2851
|
transform: 6,
|
|
@@ -2853,7 +2861,7 @@ function ri(e) {
|
|
|
2853
2861
|
let t, n, o, i, s;
|
|
2854
2862
|
return {
|
|
2855
2863
|
c() {
|
|
2856
|
-
t =
|
|
2864
|
+
t = C("g"), n = C("ellipse"), i = C("ellipse"), d(n, "class", "a9s-outer"), d(n, "style", o = /*computedStyle*/
|
|
2857
2865
|
e[1] ? "display:none;" : void 0), d(
|
|
2858
2866
|
n,
|
|
2859
2867
|
"cx",
|
|
@@ -2903,7 +2911,7 @@ function ri(e) {
|
|
|
2903
2911
|
e[0].id);
|
|
2904
2912
|
},
|
|
2905
2913
|
m(r, l) {
|
|
2906
|
-
|
|
2914
|
+
B(r, t, l), he(t, n), he(t, i);
|
|
2907
2915
|
},
|
|
2908
2916
|
p(r, [l]) {
|
|
2909
2917
|
l & /*computedStyle*/
|
|
@@ -2921,7 +2929,7 @@ function ri(e) {
|
|
|
2921
2929
|
i: j,
|
|
2922
2930
|
o: j,
|
|
2923
2931
|
d(r) {
|
|
2924
|
-
r &&
|
|
2932
|
+
r && I(t);
|
|
2925
2933
|
}
|
|
2926
2934
|
};
|
|
2927
2935
|
}
|
|
@@ -2935,16 +2943,16 @@ function li(e, t, n) {
|
|
|
2935
2943
|
129 && n(1, o = Qe(i, r));
|
|
2936
2944
|
}, [i, o, l, a, c, u, s, r];
|
|
2937
2945
|
}
|
|
2938
|
-
class ai extends
|
|
2946
|
+
class ai extends ie {
|
|
2939
2947
|
constructor(t) {
|
|
2940
|
-
super(),
|
|
2948
|
+
super(), oe(this, t, li, ri, Q, { annotation: 0, geom: 6, style: 7 });
|
|
2941
2949
|
}
|
|
2942
2950
|
}
|
|
2943
2951
|
function ci(e) {
|
|
2944
2952
|
let t, n, o, i, s;
|
|
2945
2953
|
return {
|
|
2946
2954
|
c() {
|
|
2947
|
-
t =
|
|
2955
|
+
t = C("g"), n = C("polygon"), i = C("polygon"), d(n, "class", "a9s-outer"), d(n, "style", o = /*computedStyle*/
|
|
2948
2956
|
e[1] ? "display:none;" : void 0), d(
|
|
2949
2957
|
n,
|
|
2950
2958
|
"points",
|
|
@@ -2964,7 +2972,7 @@ function ci(e) {
|
|
|
2964
2972
|
e[0].id);
|
|
2965
2973
|
},
|
|
2966
2974
|
m(r, l) {
|
|
2967
|
-
|
|
2975
|
+
B(r, t, l), he(t, n), he(t, i);
|
|
2968
2976
|
},
|
|
2969
2977
|
p(r, [l]) {
|
|
2970
2978
|
l & /*computedStyle*/
|
|
@@ -2982,7 +2990,7 @@ function ci(e) {
|
|
|
2982
2990
|
i: j,
|
|
2983
2991
|
o: j,
|
|
2984
2992
|
d(r) {
|
|
2985
|
-
r &&
|
|
2993
|
+
r && I(t);
|
|
2986
2994
|
}
|
|
2987
2995
|
};
|
|
2988
2996
|
}
|
|
@@ -2997,16 +3005,16 @@ function di(e, t, n) {
|
|
|
2997
3005
|
17 && n(1, o = Qe(i, r));
|
|
2998
3006
|
}, [i, o, l, s, r];
|
|
2999
3007
|
}
|
|
3000
|
-
class hi extends
|
|
3008
|
+
class hi extends ie {
|
|
3001
3009
|
constructor(t) {
|
|
3002
|
-
super(),
|
|
3010
|
+
super(), oe(this, t, di, ci, Q, { annotation: 0, geom: 3, style: 4 });
|
|
3003
3011
|
}
|
|
3004
3012
|
}
|
|
3005
3013
|
function gi(e) {
|
|
3006
3014
|
let t, n, o, i, s;
|
|
3007
3015
|
return {
|
|
3008
3016
|
c() {
|
|
3009
|
-
t =
|
|
3017
|
+
t = C("g"), n = C("rect"), i = C("rect"), d(n, "class", "a9s-outer"), d(n, "style", o = /*computedStyle*/
|
|
3010
3018
|
e[5] ? "display:none;" : void 0), d(
|
|
3011
3019
|
n,
|
|
3012
3020
|
"x",
|
|
@@ -3056,7 +3064,7 @@ function gi(e) {
|
|
|
3056
3064
|
e[0].id);
|
|
3057
3065
|
},
|
|
3058
3066
|
m(r, l) {
|
|
3059
|
-
|
|
3067
|
+
B(r, t, l), he(t, n), he(t, i);
|
|
3060
3068
|
},
|
|
3061
3069
|
p(r, [l]) {
|
|
3062
3070
|
l & /*computedStyle*/
|
|
@@ -3122,7 +3130,7 @@ function gi(e) {
|
|
|
3122
3130
|
i: j,
|
|
3123
3131
|
o: j,
|
|
3124
3132
|
d(r) {
|
|
3125
|
-
r &&
|
|
3133
|
+
r && I(t);
|
|
3126
3134
|
}
|
|
3127
3135
|
};
|
|
3128
3136
|
}
|
|
@@ -3136,12 +3144,12 @@ function mi(e, t, n) {
|
|
|
3136
3144
|
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)));
|
|
3137
3145
|
}, [a, l, r, s, i, o, c, u];
|
|
3138
3146
|
}
|
|
3139
|
-
class pi extends
|
|
3147
|
+
class pi extends ie {
|
|
3140
3148
|
constructor(t) {
|
|
3141
|
-
super(),
|
|
3149
|
+
super(), oe(this, t, mi, gi, Q, { annotation: 0, geom: 6, style: 7 });
|
|
3142
3150
|
}
|
|
3143
3151
|
}
|
|
3144
|
-
const
|
|
3152
|
+
const qi = {
|
|
3145
3153
|
elementToImage: (e, t) => [e, t]
|
|
3146
3154
|
}, yi = (e) => ({
|
|
3147
3155
|
elementToImage: (t, n) => {
|
|
@@ -3151,7 +3159,7 @@ const Ki = {
|
|
|
3151
3159
|
return [s, r];
|
|
3152
3160
|
}
|
|
3153
3161
|
}), _i = 250, wi = (e, t) => {
|
|
3154
|
-
const n =
|
|
3162
|
+
const n = Ie();
|
|
3155
3163
|
let o;
|
|
3156
3164
|
return { onPointerDown: () => o = performance.now(), onPointerUp: (r) => {
|
|
3157
3165
|
if (performance.now() - o < _i) {
|
|
@@ -3165,52 +3173,52 @@ const Ki = {
|
|
|
3165
3173
|
};
|
|
3166
3174
|
function Ct(e, t, n) {
|
|
3167
3175
|
const o = e.slice();
|
|
3168
|
-
o[
|
|
3176
|
+
o[39] = t[n];
|
|
3169
3177
|
const i = (
|
|
3170
3178
|
/*getEditor*/
|
|
3171
|
-
o[
|
|
3179
|
+
o[24](
|
|
3172
3180
|
/*editable*/
|
|
3173
|
-
o[
|
|
3181
|
+
o[39].target.selector
|
|
3174
3182
|
)
|
|
3175
3183
|
);
|
|
3176
|
-
return o[
|
|
3184
|
+
return o[40] = i, o;
|
|
3177
3185
|
}
|
|
3178
3186
|
function Xt(e, t, n) {
|
|
3179
3187
|
const o = e.slice();
|
|
3180
|
-
return o[
|
|
3188
|
+
return o[43] = t[n], o;
|
|
3181
3189
|
}
|
|
3182
3190
|
function lt(e) {
|
|
3183
3191
|
const t = e.slice(), n = (
|
|
3184
3192
|
/*annotation*/
|
|
3185
|
-
t[
|
|
3193
|
+
t[43].target.selector
|
|
3186
3194
|
);
|
|
3187
|
-
return t[
|
|
3195
|
+
return t[46] = n, t;
|
|
3188
3196
|
}
|
|
3189
|
-
function
|
|
3197
|
+
function Rt(e) {
|
|
3190
3198
|
let t = (
|
|
3191
3199
|
/*annotation*/
|
|
3192
|
-
e[
|
|
3193
|
-
), n, o, i =
|
|
3200
|
+
e[43].id
|
|
3201
|
+
), n, o, i = Ut(e);
|
|
3194
3202
|
return {
|
|
3195
3203
|
c() {
|
|
3196
|
-
i.c(), n =
|
|
3204
|
+
i.c(), n = ae();
|
|
3197
3205
|
},
|
|
3198
3206
|
m(s, r) {
|
|
3199
|
-
i.m(s, r),
|
|
3207
|
+
i.m(s, r), B(s, n, r), o = !0;
|
|
3200
3208
|
},
|
|
3201
3209
|
p(s, r) {
|
|
3202
3210
|
r[0] & /*$store*/
|
|
3203
|
-
|
|
3204
|
-
s[
|
|
3211
|
+
65536 && Q(t, t = /*annotation*/
|
|
3212
|
+
s[43].id) ? (re(), P(i, 1, 1, j), le(), i = Ut(s), i.c(), O(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3205
3213
|
},
|
|
3206
3214
|
i(s) {
|
|
3207
|
-
o || (
|
|
3215
|
+
o || (O(i), o = !0);
|
|
3208
3216
|
},
|
|
3209
3217
|
o(s) {
|
|
3210
|
-
|
|
3218
|
+
P(i), o = !1;
|
|
3211
3219
|
},
|
|
3212
3220
|
d(s) {
|
|
3213
|
-
s &&
|
|
3221
|
+
s && I(n), i.d(s);
|
|
3214
3222
|
}
|
|
3215
3223
|
};
|
|
3216
3224
|
}
|
|
@@ -3220,11 +3228,11 @@ function bi(e) {
|
|
|
3220
3228
|
props: {
|
|
3221
3229
|
annotation: (
|
|
3222
3230
|
/*annotation*/
|
|
3223
|
-
e[
|
|
3231
|
+
e[43]
|
|
3224
3232
|
),
|
|
3225
3233
|
geom: (
|
|
3226
3234
|
/*selector*/
|
|
3227
|
-
e[
|
|
3235
|
+
e[46].geometry
|
|
3228
3236
|
),
|
|
3229
3237
|
style: (
|
|
3230
3238
|
/*style*/
|
|
@@ -3233,29 +3241,29 @@ function bi(e) {
|
|
|
3233
3241
|
}
|
|
3234
3242
|
}), {
|
|
3235
3243
|
c() {
|
|
3236
|
-
|
|
3244
|
+
ne(t.$$.fragment);
|
|
3237
3245
|
},
|
|
3238
3246
|
m(o, i) {
|
|
3239
|
-
|
|
3247
|
+
ee(t, o, i), n = !0;
|
|
3240
3248
|
},
|
|
3241
3249
|
p(o, i) {
|
|
3242
3250
|
const s = {};
|
|
3243
3251
|
i[0] & /*$store*/
|
|
3244
|
-
|
|
3245
|
-
o[
|
|
3246
|
-
|
|
3247
|
-
o[
|
|
3252
|
+
65536 && (s.annotation = /*annotation*/
|
|
3253
|
+
o[43]), i[0] & /*$store*/
|
|
3254
|
+
65536 && (s.geom = /*selector*/
|
|
3255
|
+
o[46].geometry), i[0] & /*style*/
|
|
3248
3256
|
2 && (s.style = /*style*/
|
|
3249
3257
|
o[1]), t.$set(s);
|
|
3250
3258
|
},
|
|
3251
3259
|
i(o) {
|
|
3252
|
-
n || (
|
|
3260
|
+
n || (O(t.$$.fragment, o), n = !0);
|
|
3253
3261
|
},
|
|
3254
3262
|
o(o) {
|
|
3255
|
-
|
|
3263
|
+
P(t.$$.fragment, o), n = !1;
|
|
3256
3264
|
},
|
|
3257
3265
|
d(o) {
|
|
3258
|
-
|
|
3266
|
+
te(t, o);
|
|
3259
3267
|
}
|
|
3260
3268
|
};
|
|
3261
3269
|
}
|
|
@@ -3265,11 +3273,11 @@ function Ei(e) {
|
|
|
3265
3273
|
props: {
|
|
3266
3274
|
annotation: (
|
|
3267
3275
|
/*annotation*/
|
|
3268
|
-
e[
|
|
3276
|
+
e[43]
|
|
3269
3277
|
),
|
|
3270
3278
|
geom: (
|
|
3271
3279
|
/*selector*/
|
|
3272
|
-
e[
|
|
3280
|
+
e[46].geometry
|
|
3273
3281
|
),
|
|
3274
3282
|
style: (
|
|
3275
3283
|
/*style*/
|
|
@@ -3278,29 +3286,29 @@ function Ei(e) {
|
|
|
3278
3286
|
}
|
|
3279
3287
|
}), {
|
|
3280
3288
|
c() {
|
|
3281
|
-
|
|
3289
|
+
ne(t.$$.fragment);
|
|
3282
3290
|
},
|
|
3283
3291
|
m(o, i) {
|
|
3284
|
-
|
|
3292
|
+
ee(t, o, i), n = !0;
|
|
3285
3293
|
},
|
|
3286
3294
|
p(o, i) {
|
|
3287
3295
|
const s = {};
|
|
3288
3296
|
i[0] & /*$store*/
|
|
3289
|
-
|
|
3290
|
-
o[
|
|
3291
|
-
|
|
3292
|
-
o[
|
|
3297
|
+
65536 && (s.annotation = /*annotation*/
|
|
3298
|
+
o[43]), i[0] & /*$store*/
|
|
3299
|
+
65536 && (s.geom = /*selector*/
|
|
3300
|
+
o[46].geometry), i[0] & /*style*/
|
|
3293
3301
|
2 && (s.style = /*style*/
|
|
3294
3302
|
o[1]), t.$set(s);
|
|
3295
3303
|
},
|
|
3296
3304
|
i(o) {
|
|
3297
|
-
n || (
|
|
3305
|
+
n || (O(t.$$.fragment, o), n = !0);
|
|
3298
3306
|
},
|
|
3299
3307
|
o(o) {
|
|
3300
|
-
|
|
3308
|
+
P(t.$$.fragment, o), n = !1;
|
|
3301
3309
|
},
|
|
3302
3310
|
d(o) {
|
|
3303
|
-
|
|
3311
|
+
te(t, o);
|
|
3304
3312
|
}
|
|
3305
3313
|
};
|
|
3306
3314
|
}
|
|
@@ -3311,11 +3319,11 @@ function Ai(e) {
|
|
|
3311
3319
|
props: {
|
|
3312
3320
|
annotation: (
|
|
3313
3321
|
/*annotation*/
|
|
3314
|
-
e[
|
|
3322
|
+
e[43]
|
|
3315
3323
|
),
|
|
3316
3324
|
geom: (
|
|
3317
3325
|
/*selector*/
|
|
3318
|
-
(o = e[
|
|
3326
|
+
(o = e[46]) == null ? void 0 : o.geometry
|
|
3319
3327
|
),
|
|
3320
3328
|
style: (
|
|
3321
3329
|
/*style*/
|
|
@@ -3324,111 +3332,111 @@ function Ai(e) {
|
|
|
3324
3332
|
}
|
|
3325
3333
|
}), {
|
|
3326
3334
|
c() {
|
|
3327
|
-
|
|
3335
|
+
ne(t.$$.fragment);
|
|
3328
3336
|
},
|
|
3329
3337
|
m(i, s) {
|
|
3330
|
-
|
|
3338
|
+
ee(t, i, s), n = !0;
|
|
3331
3339
|
},
|
|
3332
3340
|
p(i, s) {
|
|
3333
3341
|
var l;
|
|
3334
3342
|
const r = {};
|
|
3335
3343
|
s[0] & /*$store*/
|
|
3336
|
-
|
|
3337
|
-
i[
|
|
3338
|
-
|
|
3339
|
-
(l = i[
|
|
3344
|
+
65536 && (r.annotation = /*annotation*/
|
|
3345
|
+
i[43]), s[0] & /*$store*/
|
|
3346
|
+
65536 && (r.geom = /*selector*/
|
|
3347
|
+
(l = i[46]) == null ? void 0 : l.geometry), s[0] & /*style*/
|
|
3340
3348
|
2 && (r.style = /*style*/
|
|
3341
3349
|
i[1]), t.$set(r);
|
|
3342
3350
|
},
|
|
3343
3351
|
i(i) {
|
|
3344
|
-
n || (
|
|
3352
|
+
n || (O(t.$$.fragment, i), n = !0);
|
|
3345
3353
|
},
|
|
3346
3354
|
o(i) {
|
|
3347
|
-
|
|
3355
|
+
P(t.$$.fragment, i), n = !1;
|
|
3348
3356
|
},
|
|
3349
3357
|
d(i) {
|
|
3350
|
-
|
|
3358
|
+
te(t, i);
|
|
3351
3359
|
}
|
|
3352
3360
|
};
|
|
3353
3361
|
}
|
|
3354
|
-
function
|
|
3362
|
+
function Ut(e) {
|
|
3355
3363
|
let t, n, o, i;
|
|
3356
3364
|
const s = [Ai, Ei, bi], r = [];
|
|
3357
3365
|
function l(a, c) {
|
|
3358
3366
|
var u, f, h;
|
|
3359
3367
|
return (
|
|
3360
3368
|
/*selector*/
|
|
3361
|
-
((u = a[
|
|
3369
|
+
((u = a[46]) == null ? void 0 : u.type) === F.ELLIPSE ? 0 : (
|
|
3362
3370
|
/*selector*/
|
|
3363
|
-
((f = a[
|
|
3371
|
+
((f = a[46]) == null ? void 0 : f.type) === F.RECTANGLE ? 1 : (
|
|
3364
3372
|
/*selector*/
|
|
3365
|
-
((h = a[
|
|
3373
|
+
((h = a[46]) == null ? void 0 : h.type) === F.POLYGON ? 2 : -1
|
|
3366
3374
|
)
|
|
3367
3375
|
)
|
|
3368
3376
|
);
|
|
3369
3377
|
}
|
|
3370
3378
|
return ~(t = l(e)) && (n = r[t] = s[t](e)), {
|
|
3371
3379
|
c() {
|
|
3372
|
-
n && n.c(), o =
|
|
3380
|
+
n && n.c(), o = ae();
|
|
3373
3381
|
},
|
|
3374
3382
|
m(a, c) {
|
|
3375
|
-
~t && r[t].m(a, c),
|
|
3383
|
+
~t && r[t].m(a, c), B(a, o, c), i = !0;
|
|
3376
3384
|
},
|
|
3377
3385
|
p(a, c) {
|
|
3378
3386
|
let u = t;
|
|
3379
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (
|
|
3387
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (re(), P(r[u], 1, 1, () => {
|
|
3380
3388
|
r[u] = null;
|
|
3381
|
-
}),
|
|
3389
|
+
}), le()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), O(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3382
3390
|
},
|
|
3383
3391
|
i(a) {
|
|
3384
|
-
i || (
|
|
3392
|
+
i || (O(n), i = !0);
|
|
3385
3393
|
},
|
|
3386
3394
|
o(a) {
|
|
3387
|
-
|
|
3395
|
+
P(n), i = !1;
|
|
3388
3396
|
},
|
|
3389
3397
|
d(a) {
|
|
3390
|
-
a &&
|
|
3398
|
+
a && I(o), ~t && r[t].d(a);
|
|
3391
3399
|
}
|
|
3392
3400
|
};
|
|
3393
3401
|
}
|
|
3394
3402
|
function Nt(e) {
|
|
3395
3403
|
let t = Je(
|
|
3396
3404
|
/*annotation*/
|
|
3397
|
-
e[
|
|
3405
|
+
e[43]
|
|
3398
3406
|
) && !/*isEditable*/
|
|
3399
|
-
e[
|
|
3407
|
+
e[9](
|
|
3400
3408
|
/*annotation*/
|
|
3401
|
-
e[
|
|
3402
|
-
), n, o, i = t &&
|
|
3409
|
+
e[43]
|
|
3410
|
+
), n, o, i = t && Rt(lt(e));
|
|
3403
3411
|
return {
|
|
3404
3412
|
c() {
|
|
3405
|
-
i && i.c(), n =
|
|
3413
|
+
i && i.c(), n = ae();
|
|
3406
3414
|
},
|
|
3407
3415
|
m(s, r) {
|
|
3408
|
-
i && i.m(s, r),
|
|
3416
|
+
i && i.m(s, r), B(s, n, r), o = !0;
|
|
3409
3417
|
},
|
|
3410
3418
|
p(s, r) {
|
|
3411
3419
|
r[0] & /*$store, isEditable*/
|
|
3412
|
-
|
|
3420
|
+
66048 && (t = Je(
|
|
3413
3421
|
/*annotation*/
|
|
3414
|
-
s[
|
|
3422
|
+
s[43]
|
|
3415
3423
|
) && !/*isEditable*/
|
|
3416
|
-
s[
|
|
3424
|
+
s[9](
|
|
3417
3425
|
/*annotation*/
|
|
3418
|
-
s[
|
|
3426
|
+
s[43]
|
|
3419
3427
|
)), t ? i ? (i.p(lt(s), r), r[0] & /*$store, isEditable*/
|
|
3420
|
-
|
|
3428
|
+
66048 && O(i, 1)) : (i = Rt(lt(s)), i.c(), O(i, 1), i.m(n.parentNode, n)) : i && (re(), P(i, 1, 1, () => {
|
|
3421
3429
|
i = null;
|
|
3422
|
-
}),
|
|
3430
|
+
}), le());
|
|
3423
3431
|
},
|
|
3424
3432
|
i(s) {
|
|
3425
|
-
o || (
|
|
3433
|
+
o || (O(i), o = !0);
|
|
3426
3434
|
},
|
|
3427
3435
|
o(s) {
|
|
3428
|
-
|
|
3436
|
+
P(i), o = !1;
|
|
3429
3437
|
},
|
|
3430
3438
|
d(s) {
|
|
3431
|
-
s &&
|
|
3439
|
+
s && I(n), i && i.d(s);
|
|
3432
3440
|
}
|
|
3433
3441
|
};
|
|
3434
3442
|
}
|
|
@@ -3438,118 +3446,118 @@ function Vt(e) {
|
|
|
3438
3446
|
function l(a, c) {
|
|
3439
3447
|
return (
|
|
3440
3448
|
/*editableAnnotations*/
|
|
3441
|
-
a[
|
|
3449
|
+
a[8] ? 0 : (
|
|
3442
3450
|
/*tool*/
|
|
3443
|
-
a[
|
|
3451
|
+
a[14] && /*drawingEnabled*/
|
|
3444
3452
|
a[0] ? 1 : -1
|
|
3445
3453
|
)
|
|
3446
3454
|
);
|
|
3447
3455
|
}
|
|
3448
3456
|
return ~(t = l(e)) && (n = r[t] = s[t](e)), {
|
|
3449
3457
|
c() {
|
|
3450
|
-
n && n.c(), o =
|
|
3458
|
+
n && n.c(), o = ae();
|
|
3451
3459
|
},
|
|
3452
3460
|
m(a, c) {
|
|
3453
|
-
~t && r[t].m(a, c),
|
|
3461
|
+
~t && r[t].m(a, c), B(a, o, c), i = !0;
|
|
3454
3462
|
},
|
|
3455
3463
|
p(a, c) {
|
|
3456
3464
|
let u = t;
|
|
3457
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (
|
|
3465
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (re(), P(r[u], 1, 1, () => {
|
|
3458
3466
|
r[u] = null;
|
|
3459
|
-
}),
|
|
3467
|
+
}), le()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), O(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3460
3468
|
},
|
|
3461
3469
|
i(a) {
|
|
3462
|
-
i || (
|
|
3470
|
+
i || (O(n), i = !0);
|
|
3463
3471
|
},
|
|
3464
3472
|
o(a) {
|
|
3465
|
-
|
|
3473
|
+
P(n), i = !1;
|
|
3466
3474
|
},
|
|
3467
3475
|
d(a) {
|
|
3468
|
-
a &&
|
|
3476
|
+
a && I(o), ~t && r[t].d(a);
|
|
3469
3477
|
}
|
|
3470
3478
|
};
|
|
3471
3479
|
}
|
|
3472
3480
|
function Si(e) {
|
|
3473
|
-
let t =
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
), n, o, i = Gt(e);
|
|
3481
|
+
let t = `${/*toolName*/
|
|
3482
|
+
e[2]}-${/*toolMountKey*/
|
|
3483
|
+
e[5]}`, n, o, i = Gt(e);
|
|
3477
3484
|
return {
|
|
3478
3485
|
c() {
|
|
3479
|
-
i.c(), n =
|
|
3486
|
+
i.c(), n = ae();
|
|
3480
3487
|
},
|
|
3481
3488
|
m(s, r) {
|
|
3482
|
-
i.m(s, r),
|
|
3489
|
+
i.m(s, r), B(s, n, r), o = !0;
|
|
3483
3490
|
},
|
|
3484
3491
|
p(s, r) {
|
|
3485
|
-
r[0] & /*toolName*/
|
|
3486
|
-
|
|
3487
|
-
s[2]
|
|
3492
|
+
r[0] & /*toolName, toolMountKey*/
|
|
3493
|
+
36 && Q(t, t = `${/*toolName*/
|
|
3494
|
+
s[2]}-${/*toolMountKey*/
|
|
3495
|
+
s[5]}`) ? (re(), P(i, 1, 1, j), le(), i = Gt(s), i.c(), O(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3488
3496
|
},
|
|
3489
3497
|
i(s) {
|
|
3490
|
-
o || (
|
|
3498
|
+
o || (O(i), o = !0);
|
|
3491
3499
|
},
|
|
3492
3500
|
o(s) {
|
|
3493
|
-
|
|
3501
|
+
P(i), o = !1;
|
|
3494
3502
|
},
|
|
3495
3503
|
d(s) {
|
|
3496
|
-
s &&
|
|
3504
|
+
s && I(n), i.d(s);
|
|
3497
3505
|
}
|
|
3498
3506
|
};
|
|
3499
3507
|
}
|
|
3500
3508
|
function Ti(e) {
|
|
3501
|
-
let t, n, o =
|
|
3509
|
+
let t, n, o = ve(
|
|
3502
3510
|
/*editableAnnotations*/
|
|
3503
|
-
e[
|
|
3511
|
+
e[8]
|
|
3504
3512
|
), i = [];
|
|
3505
3513
|
for (let r = 0; r < o.length; r += 1)
|
|
3506
3514
|
i[r] = Ht(Ct(e, o, r));
|
|
3507
|
-
const s = (r) =>
|
|
3515
|
+
const s = (r) => P(i[r], 1, 1, () => {
|
|
3508
3516
|
i[r] = null;
|
|
3509
3517
|
});
|
|
3510
3518
|
return {
|
|
3511
3519
|
c() {
|
|
3512
3520
|
for (let r = 0; r < i.length; r += 1)
|
|
3513
3521
|
i[r].c();
|
|
3514
|
-
t =
|
|
3522
|
+
t = ae();
|
|
3515
3523
|
},
|
|
3516
3524
|
m(r, l) {
|
|
3517
3525
|
for (let a = 0; a < i.length; a += 1)
|
|
3518
3526
|
i[a] && i[a].m(r, l);
|
|
3519
|
-
|
|
3527
|
+
B(r, t, l), n = !0;
|
|
3520
3528
|
},
|
|
3521
3529
|
p(r, l) {
|
|
3522
3530
|
if (l[0] & /*editableAnnotations, drawingEl, getEditor, style, transform, $scale, onChangeSelected*/
|
|
3523
|
-
|
|
3524
|
-
o =
|
|
3531
|
+
21107010) {
|
|
3532
|
+
o = ve(
|
|
3525
3533
|
/*editableAnnotations*/
|
|
3526
|
-
r[
|
|
3534
|
+
r[8]
|
|
3527
3535
|
);
|
|
3528
3536
|
let a;
|
|
3529
3537
|
for (a = 0; a < o.length; a += 1) {
|
|
3530
3538
|
const c = Ct(r, o, a);
|
|
3531
|
-
i[a] ? (i[a].p(c, l),
|
|
3539
|
+
i[a] ? (i[a].p(c, l), O(i[a], 1)) : (i[a] = Ht(c), i[a].c(), O(i[a], 1), i[a].m(t.parentNode, t));
|
|
3532
3540
|
}
|
|
3533
|
-
for (
|
|
3541
|
+
for (re(), a = o.length; a < i.length; a += 1)
|
|
3534
3542
|
s(a);
|
|
3535
|
-
|
|
3543
|
+
le();
|
|
3536
3544
|
}
|
|
3537
3545
|
},
|
|
3538
3546
|
i(r) {
|
|
3539
3547
|
if (!n) {
|
|
3540
3548
|
for (let l = 0; l < o.length; l += 1)
|
|
3541
|
-
|
|
3549
|
+
O(i[l]);
|
|
3542
3550
|
n = !0;
|
|
3543
3551
|
}
|
|
3544
3552
|
},
|
|
3545
3553
|
o(r) {
|
|
3546
3554
|
i = i.filter(Boolean);
|
|
3547
3555
|
for (let l = 0; l < i.length; l += 1)
|
|
3548
|
-
|
|
3556
|
+
P(i[l]);
|
|
3549
3557
|
n = !1;
|
|
3550
3558
|
},
|
|
3551
3559
|
d(r) {
|
|
3552
|
-
r &&
|
|
3560
|
+
r && I(t), gt(i, r);
|
|
3553
3561
|
}
|
|
3554
3562
|
};
|
|
3555
3563
|
}
|
|
@@ -3559,107 +3567,107 @@ function Gt(e) {
|
|
|
3559
3567
|
props: {
|
|
3560
3568
|
target: (
|
|
3561
3569
|
/*drawingEl*/
|
|
3562
|
-
e[
|
|
3570
|
+
e[6]
|
|
3563
3571
|
),
|
|
3564
3572
|
tool: (
|
|
3565
3573
|
/*tool*/
|
|
3566
|
-
e[
|
|
3574
|
+
e[14]
|
|
3567
3575
|
),
|
|
3568
3576
|
drawingMode: (
|
|
3569
3577
|
/*drawingMode*/
|
|
3570
|
-
e[
|
|
3578
|
+
e[13]
|
|
3571
3579
|
),
|
|
3572
3580
|
transform: (
|
|
3573
3581
|
/*transform*/
|
|
3574
|
-
e[
|
|
3582
|
+
e[12]
|
|
3575
3583
|
),
|
|
3576
3584
|
viewportScale: (
|
|
3577
3585
|
/*$scale*/
|
|
3578
|
-
e[
|
|
3586
|
+
e[17]
|
|
3579
3587
|
)
|
|
3580
3588
|
}
|
|
3581
3589
|
}), t.$on(
|
|
3582
3590
|
"create",
|
|
3583
3591
|
/*onSelectionCreated*/
|
|
3584
|
-
e[
|
|
3592
|
+
e[21]
|
|
3585
3593
|
), {
|
|
3586
3594
|
c() {
|
|
3587
|
-
|
|
3595
|
+
ne(t.$$.fragment);
|
|
3588
3596
|
},
|
|
3589
3597
|
m(o, i) {
|
|
3590
|
-
|
|
3598
|
+
ee(t, o, i), n = !0;
|
|
3591
3599
|
},
|
|
3592
3600
|
p(o, i) {
|
|
3593
3601
|
const s = {};
|
|
3594
3602
|
i[0] & /*drawingEl*/
|
|
3595
|
-
|
|
3596
|
-
o[
|
|
3597
|
-
|
|
3598
|
-
o[
|
|
3599
|
-
|
|
3600
|
-
o[
|
|
3601
|
-
|
|
3602
|
-
o[
|
|
3603
|
-
|
|
3604
|
-
o[
|
|
3603
|
+
64 && (s.target = /*drawingEl*/
|
|
3604
|
+
o[6]), i[0] & /*tool*/
|
|
3605
|
+
16384 && (s.tool = /*tool*/
|
|
3606
|
+
o[14]), i[0] & /*drawingMode*/
|
|
3607
|
+
8192 && (s.drawingMode = /*drawingMode*/
|
|
3608
|
+
o[13]), i[0] & /*transform*/
|
|
3609
|
+
4096 && (s.transform = /*transform*/
|
|
3610
|
+
o[12]), i[0] & /*$scale*/
|
|
3611
|
+
131072 && (s.viewportScale = /*$scale*/
|
|
3612
|
+
o[17]), t.$set(s);
|
|
3605
3613
|
},
|
|
3606
3614
|
i(o) {
|
|
3607
|
-
n || (
|
|
3615
|
+
n || (O(t.$$.fragment, o), n = !0);
|
|
3608
3616
|
},
|
|
3609
3617
|
o(o) {
|
|
3610
|
-
|
|
3618
|
+
P(t.$$.fragment, o), n = !1;
|
|
3611
3619
|
},
|
|
3612
3620
|
d(o) {
|
|
3613
|
-
|
|
3621
|
+
te(t, o);
|
|
3614
3622
|
}
|
|
3615
3623
|
};
|
|
3616
3624
|
}
|
|
3617
3625
|
function jt(e) {
|
|
3618
3626
|
let t = (
|
|
3619
3627
|
/*editable*/
|
|
3620
|
-
e[
|
|
3628
|
+
e[39].id
|
|
3621
3629
|
), n, o, i = zt(e);
|
|
3622
3630
|
return {
|
|
3623
3631
|
c() {
|
|
3624
|
-
i.c(), n =
|
|
3632
|
+
i.c(), n = ae();
|
|
3625
3633
|
},
|
|
3626
3634
|
m(s, r) {
|
|
3627
|
-
i.m(s, r),
|
|
3635
|
+
i.m(s, r), B(s, n, r), o = !0;
|
|
3628
3636
|
},
|
|
3629
3637
|
p(s, r) {
|
|
3630
3638
|
r[0] & /*editableAnnotations*/
|
|
3631
|
-
|
|
3632
|
-
s[
|
|
3639
|
+
256 && Q(t, t = /*editable*/
|
|
3640
|
+
s[39].id) ? (re(), P(i, 1, 1, j), le(), i = zt(s), i.c(), O(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3633
3641
|
},
|
|
3634
3642
|
i(s) {
|
|
3635
|
-
o || (
|
|
3643
|
+
o || (O(i), o = !0);
|
|
3636
3644
|
},
|
|
3637
3645
|
o(s) {
|
|
3638
|
-
|
|
3646
|
+
P(i), o = !1;
|
|
3639
3647
|
},
|
|
3640
3648
|
d(s) {
|
|
3641
|
-
s &&
|
|
3649
|
+
s && I(n), i.d(s);
|
|
3642
3650
|
}
|
|
3643
3651
|
};
|
|
3644
3652
|
}
|
|
3645
3653
|
function zt(e) {
|
|
3646
3654
|
let t, n;
|
|
3647
|
-
return t = new
|
|
3655
|
+
return t = new qo({
|
|
3648
3656
|
props: {
|
|
3649
3657
|
target: (
|
|
3650
3658
|
/*drawingEl*/
|
|
3651
|
-
e[
|
|
3659
|
+
e[6]
|
|
3652
3660
|
),
|
|
3653
3661
|
editor: (
|
|
3654
3662
|
/*getEditor*/
|
|
3655
|
-
e[
|
|
3663
|
+
e[24](
|
|
3656
3664
|
/*editable*/
|
|
3657
|
-
e[
|
|
3665
|
+
e[39].target.selector
|
|
3658
3666
|
)
|
|
3659
3667
|
),
|
|
3660
3668
|
annotation: (
|
|
3661
3669
|
/*editable*/
|
|
3662
|
-
e[
|
|
3670
|
+
e[39]
|
|
3663
3671
|
),
|
|
3664
3672
|
style: (
|
|
3665
3673
|
/*style*/
|
|
@@ -3667,281 +3675,283 @@ function zt(e) {
|
|
|
3667
3675
|
),
|
|
3668
3676
|
transform: (
|
|
3669
3677
|
/*transform*/
|
|
3670
|
-
e[
|
|
3678
|
+
e[12]
|
|
3671
3679
|
),
|
|
3672
3680
|
viewportScale: (
|
|
3673
3681
|
/*$scale*/
|
|
3674
|
-
e[
|
|
3682
|
+
e[17]
|
|
3675
3683
|
)
|
|
3676
3684
|
}
|
|
3677
3685
|
}), t.$on("change", function() {
|
|
3678
|
-
|
|
3686
|
+
K(
|
|
3679
3687
|
/*onChangeSelected*/
|
|
3680
|
-
e[
|
|
3688
|
+
e[22](
|
|
3681
3689
|
/*editable*/
|
|
3682
|
-
e[
|
|
3690
|
+
e[39]
|
|
3683
3691
|
)
|
|
3684
|
-
) && e[
|
|
3692
|
+
) && e[22](
|
|
3685
3693
|
/*editable*/
|
|
3686
|
-
e[
|
|
3694
|
+
e[39]
|
|
3687
3695
|
).apply(this, arguments);
|
|
3688
3696
|
}), {
|
|
3689
3697
|
c() {
|
|
3690
|
-
|
|
3698
|
+
ne(t.$$.fragment);
|
|
3691
3699
|
},
|
|
3692
3700
|
m(o, i) {
|
|
3693
|
-
|
|
3701
|
+
ee(t, o, i), n = !0;
|
|
3694
3702
|
},
|
|
3695
3703
|
p(o, i) {
|
|
3696
3704
|
e = o;
|
|
3697
3705
|
const s = {};
|
|
3698
3706
|
i[0] & /*drawingEl*/
|
|
3699
|
-
|
|
3700
|
-
e[
|
|
3701
|
-
|
|
3702
|
-
e[
|
|
3707
|
+
64 && (s.target = /*drawingEl*/
|
|
3708
|
+
e[6]), i[0] & /*editableAnnotations*/
|
|
3709
|
+
256 && (s.editor = /*getEditor*/
|
|
3710
|
+
e[24](
|
|
3703
3711
|
/*editable*/
|
|
3704
|
-
e[
|
|
3712
|
+
e[39].target.selector
|
|
3705
3713
|
)), i[0] & /*editableAnnotations*/
|
|
3706
|
-
|
|
3707
|
-
e[
|
|
3714
|
+
256 && (s.annotation = /*editable*/
|
|
3715
|
+
e[39]), i[0] & /*style*/
|
|
3708
3716
|
2 && (s.style = /*style*/
|
|
3709
3717
|
e[1]), i[0] & /*transform*/
|
|
3710
|
-
|
|
3711
|
-
e[
|
|
3712
|
-
|
|
3713
|
-
e[
|
|
3718
|
+
4096 && (s.transform = /*transform*/
|
|
3719
|
+
e[12]), i[0] & /*$scale*/
|
|
3720
|
+
131072 && (s.viewportScale = /*$scale*/
|
|
3721
|
+
e[17]), t.$set(s);
|
|
3714
3722
|
},
|
|
3715
3723
|
i(o) {
|
|
3716
|
-
n || (
|
|
3724
|
+
n || (O(t.$$.fragment, o), n = !0);
|
|
3717
3725
|
},
|
|
3718
3726
|
o(o) {
|
|
3719
|
-
|
|
3727
|
+
P(t.$$.fragment, o), n = !1;
|
|
3720
3728
|
},
|
|
3721
3729
|
d(o) {
|
|
3722
|
-
|
|
3730
|
+
te(t, o);
|
|
3723
3731
|
}
|
|
3724
3732
|
};
|
|
3725
3733
|
}
|
|
3726
3734
|
function Ht(e) {
|
|
3727
3735
|
let t, n, o = (
|
|
3728
3736
|
/*editor*/
|
|
3729
|
-
e[
|
|
3737
|
+
e[40] && jt(e)
|
|
3730
3738
|
);
|
|
3731
3739
|
return {
|
|
3732
3740
|
c() {
|
|
3733
|
-
o && o.c(), t =
|
|
3741
|
+
o && o.c(), t = ae();
|
|
3734
3742
|
},
|
|
3735
3743
|
m(i, s) {
|
|
3736
|
-
o && o.m(i, s),
|
|
3744
|
+
o && o.m(i, s), B(i, t, s), n = !0;
|
|
3737
3745
|
},
|
|
3738
3746
|
p(i, s) {
|
|
3739
3747
|
/*editor*/
|
|
3740
|
-
i[
|
|
3741
|
-
|
|
3748
|
+
i[40] ? o ? (o.p(i, s), s[0] & /*editableAnnotations*/
|
|
3749
|
+
256 && O(o, 1)) : (o = jt(i), o.c(), O(o, 1), o.m(t.parentNode, t)) : o && (re(), P(o, 1, 1, () => {
|
|
3742
3750
|
o = null;
|
|
3743
|
-
}),
|
|
3751
|
+
}), le());
|
|
3744
3752
|
},
|
|
3745
3753
|
i(i) {
|
|
3746
|
-
n || (
|
|
3754
|
+
n || (O(o), n = !0);
|
|
3747
3755
|
},
|
|
3748
3756
|
o(i) {
|
|
3749
|
-
|
|
3757
|
+
P(o), n = !1;
|
|
3750
3758
|
},
|
|
3751
3759
|
d(i) {
|
|
3752
|
-
i &&
|
|
3760
|
+
i && I(t), o && o.d(i);
|
|
3753
3761
|
}
|
|
3754
3762
|
};
|
|
3755
3763
|
}
|
|
3756
3764
|
function Mi(e) {
|
|
3757
|
-
let t, n, o, i, s, r, l =
|
|
3765
|
+
let t, n, o, i, s, r, l = ve(
|
|
3758
3766
|
/*$store*/
|
|
3759
|
-
e[
|
|
3767
|
+
e[16].filter(
|
|
3760
3768
|
/*func*/
|
|
3761
|
-
e[
|
|
3769
|
+
e[34]
|
|
3762
3770
|
)
|
|
3763
3771
|
), a = [];
|
|
3764
3772
|
for (let f = 0; f < l.length; f += 1)
|
|
3765
3773
|
a[f] = Nt(Xt(e, l, f));
|
|
3766
|
-
const c = (f) =>
|
|
3774
|
+
const c = (f) => P(a[f], 1, 1, () => {
|
|
3767
3775
|
a[f] = null;
|
|
3768
3776
|
});
|
|
3769
3777
|
let u = (
|
|
3770
3778
|
/*drawingEl*/
|
|
3771
|
-
e[
|
|
3779
|
+
e[6] && Vt(e)
|
|
3772
3780
|
);
|
|
3773
3781
|
return {
|
|
3774
3782
|
c() {
|
|
3775
|
-
t =
|
|
3783
|
+
t = C("svg"), n = C("g");
|
|
3776
3784
|
for (let f = 0; f < a.length; f += 1)
|
|
3777
3785
|
a[f].c();
|
|
3778
|
-
o =
|
|
3786
|
+
o = C("g"), u && u.c(), d(o, "class", "drawing"), d(t, "class", "a9s-annotationlayer"), ye(
|
|
3779
3787
|
t,
|
|
3780
3788
|
"drawing",
|
|
3781
3789
|
/*tool*/
|
|
3782
|
-
e[
|
|
3783
|
-
),
|
|
3784
|
-
e[3]),
|
|
3790
|
+
e[14]
|
|
3791
|
+
), ye(t, "hidden", !/*visible*/
|
|
3792
|
+
e[3]), ye(
|
|
3785
3793
|
t,
|
|
3786
3794
|
"hover",
|
|
3787
3795
|
/*$hover*/
|
|
3788
|
-
e[
|
|
3796
|
+
e[15]
|
|
3789
3797
|
);
|
|
3790
3798
|
},
|
|
3791
3799
|
m(f, h) {
|
|
3792
|
-
|
|
3793
|
-
for (let
|
|
3794
|
-
a[
|
|
3795
|
-
he(t, o), u && u.m(o, null), e[
|
|
3796
|
-
|
|
3797
|
-
|
|
3800
|
+
B(f, t, h), he(t, n);
|
|
3801
|
+
for (let y = 0; y < a.length; y += 1)
|
|
3802
|
+
a[y] && a[y].m(n, null);
|
|
3803
|
+
he(t, o), u && u.m(o, null), e[35](o), e[36](t), i = !0, s || (r = [
|
|
3804
|
+
z(t, "pointerup", function() {
|
|
3805
|
+
K(
|
|
3798
3806
|
/*onPointerUp*/
|
|
3799
|
-
e[9]
|
|
3800
|
-
) && e[9].apply(this, arguments);
|
|
3801
|
-
}),
|
|
3802
|
-
H(t, "pointerdown", function() {
|
|
3803
|
-
W(
|
|
3804
|
-
/*onPointerDown*/
|
|
3805
3807
|
e[10]
|
|
3806
3808
|
) && e[10].apply(this, arguments);
|
|
3807
3809
|
}),
|
|
3808
|
-
|
|
3810
|
+
z(t, "pointerdown", function() {
|
|
3811
|
+
K(
|
|
3812
|
+
/*onPointerDown*/
|
|
3813
|
+
e[11]
|
|
3814
|
+
) && e[11].apply(this, arguments);
|
|
3815
|
+
}),
|
|
3816
|
+
z(
|
|
3809
3817
|
t,
|
|
3810
3818
|
"pointermove",
|
|
3811
3819
|
/*onPointerMove*/
|
|
3812
|
-
e[
|
|
3820
|
+
e[23]
|
|
3813
3821
|
)
|
|
3814
3822
|
], s = !0);
|
|
3815
3823
|
},
|
|
3816
3824
|
p(f, h) {
|
|
3817
3825
|
if (e = f, h[0] & /*$store, style, isEditable*/
|
|
3818
|
-
|
|
3819
|
-
l =
|
|
3826
|
+
66050) {
|
|
3827
|
+
l = ve(
|
|
3820
3828
|
/*$store*/
|
|
3821
|
-
e[
|
|
3829
|
+
e[16].filter(
|
|
3822
3830
|
/*func*/
|
|
3823
|
-
e[
|
|
3831
|
+
e[34]
|
|
3824
3832
|
)
|
|
3825
3833
|
);
|
|
3826
|
-
let
|
|
3827
|
-
for (
|
|
3828
|
-
const g = Xt(e, l,
|
|
3829
|
-
a[
|
|
3834
|
+
let y;
|
|
3835
|
+
for (y = 0; y < l.length; y += 1) {
|
|
3836
|
+
const g = Xt(e, l, y);
|
|
3837
|
+
a[y] ? (a[y].p(g, h), O(a[y], 1)) : (a[y] = Nt(g), a[y].c(), O(a[y], 1), a[y].m(n, null));
|
|
3830
3838
|
}
|
|
3831
|
-
for (
|
|
3832
|
-
c(
|
|
3833
|
-
|
|
3839
|
+
for (re(), y = l.length; y < a.length; y += 1)
|
|
3840
|
+
c(y);
|
|
3841
|
+
le();
|
|
3834
3842
|
}
|
|
3835
3843
|
/*drawingEl*/
|
|
3836
|
-
e[
|
|
3837
|
-
|
|
3844
|
+
e[6] ? u ? (u.p(e, h), h[0] & /*drawingEl*/
|
|
3845
|
+
64 && O(u, 1)) : (u = Vt(e), u.c(), O(u, 1), u.m(o, null)) : u && (re(), P(u, 1, 1, () => {
|
|
3838
3846
|
u = null;
|
|
3839
|
-
}),
|
|
3840
|
-
|
|
3847
|
+
}), le()), (!i || h[0] & /*tool*/
|
|
3848
|
+
16384) && ye(
|
|
3841
3849
|
t,
|
|
3842
3850
|
"drawing",
|
|
3843
3851
|
/*tool*/
|
|
3844
|
-
e[
|
|
3852
|
+
e[14]
|
|
3845
3853
|
), (!i || h[0] & /*visible*/
|
|
3846
|
-
8) &&
|
|
3854
|
+
8) && ye(t, "hidden", !/*visible*/
|
|
3847
3855
|
e[3]), (!i || h[0] & /*$hover*/
|
|
3848
|
-
|
|
3856
|
+
32768) && ye(
|
|
3849
3857
|
t,
|
|
3850
3858
|
"hover",
|
|
3851
3859
|
/*$hover*/
|
|
3852
|
-
e[
|
|
3860
|
+
e[15]
|
|
3853
3861
|
);
|
|
3854
3862
|
},
|
|
3855
3863
|
i(f) {
|
|
3856
3864
|
if (!i) {
|
|
3857
3865
|
for (let h = 0; h < l.length; h += 1)
|
|
3858
|
-
|
|
3859
|
-
|
|
3866
|
+
O(a[h]);
|
|
3867
|
+
O(u), i = !0;
|
|
3860
3868
|
}
|
|
3861
3869
|
},
|
|
3862
3870
|
o(f) {
|
|
3863
3871
|
a = a.filter(Boolean);
|
|
3864
3872
|
for (let h = 0; h < a.length; h += 1)
|
|
3865
|
-
|
|
3866
|
-
|
|
3873
|
+
P(a[h]);
|
|
3874
|
+
P(u), i = !1;
|
|
3867
3875
|
},
|
|
3868
3876
|
d(f) {
|
|
3869
|
-
f &&
|
|
3877
|
+
f && I(t), gt(a, f), u && u.d(), e[35](null), e[36](null), s = !1, ge(r);
|
|
3870
3878
|
}
|
|
3871
3879
|
};
|
|
3872
3880
|
}
|
|
3873
|
-
function
|
|
3874
|
-
let o, i, s, r, l, a, c, u, f, h,
|
|
3881
|
+
function Li(e, t, n) {
|
|
3882
|
+
let o, i, s, r, l, a, c, u, f, h, y, g = j, m = () => (g(), g = Jt(Y, (M) => n(17, y = M)), Y);
|
|
3875
3883
|
e.$$.on_destroy.push(() => g());
|
|
3876
|
-
let { drawingEnabled: A } = t, { image:
|
|
3877
|
-
const V = () =>
|
|
3878
|
-
let
|
|
3879
|
-
|
|
3880
|
-
const { hover:
|
|
3881
|
-
xe(e,
|
|
3882
|
-
let
|
|
3883
|
-
const
|
|
3884
|
-
|
|
3885
|
-
const
|
|
3886
|
-
|
|
3887
|
-
const { updated:
|
|
3888
|
-
n(
|
|
3889
|
-
},
|
|
3890
|
-
},
|
|
3891
|
-
const
|
|
3892
|
-
id:
|
|
3884
|
+
let { drawingEnabled: A } = t, { image: p } = t, { preferredDrawingMode: _ } = t, { state: w } = t, { style: E = void 0 } = t, { toolName: v = cn()[0] } = t, { user: X } = t, { visible: U = !0 } = t, V = 0;
|
|
3885
|
+
const Z = () => n(5, V += 1), S = () => v, L = () => A;
|
|
3886
|
+
let b, T, Y;
|
|
3887
|
+
Ne(() => m(n(7, Y = Do(p, T))));
|
|
3888
|
+
const { hover: D, selection: H, store: J } = w;
|
|
3889
|
+
xe(e, D, (M) => n(15, u = M)), xe(e, H, (M) => n(33, f = M)), xe(e, J, (M) => n(16, h = M));
|
|
3890
|
+
let $, pe;
|
|
3891
|
+
const ce = (M) => {
|
|
3892
|
+
$ && J.unobserve($);
|
|
3893
|
+
const k = M.filter(({ editable: N }) => N).map(({ id: N }) => N);
|
|
3894
|
+
k.length > 0 ? (n(8, pe = k.map((N) => J.getAnnotation(N)).filter((N) => N && Je(N))), $ = (N) => {
|
|
3895
|
+
const { updated: x } = N.changes;
|
|
3896
|
+
n(8, pe = x == null ? void 0 : x.map((de) => de.newValue));
|
|
3897
|
+
}, J.observe($, { annotations: k })) : n(8, pe = void 0);
|
|
3898
|
+
}, Be = (M) => {
|
|
3899
|
+
const k = tn(), N = {
|
|
3900
|
+
id: k,
|
|
3893
3901
|
bodies: [],
|
|
3894
3902
|
target: {
|
|
3895
|
-
annotation:
|
|
3896
|
-
selector:
|
|
3897
|
-
creator:
|
|
3903
|
+
annotation: k,
|
|
3904
|
+
selector: M.detail,
|
|
3905
|
+
creator: X,
|
|
3898
3906
|
created: /* @__PURE__ */ new Date()
|
|
3899
3907
|
}
|
|
3900
3908
|
};
|
|
3901
|
-
|
|
3902
|
-
},
|
|
3903
|
-
var
|
|
3904
|
-
const { target:
|
|
3905
|
-
|
|
3906
|
-
...
|
|
3907
|
-
selector:
|
|
3908
|
-
created: de ?
|
|
3909
|
+
J.addAnnotation(N), H.setSelected(N.id);
|
|
3910
|
+
}, fe = (M) => (k) => {
|
|
3911
|
+
var we;
|
|
3912
|
+
const { target: N } = M, x = 10 * 60 * 1e3, de = ((we = N.creator) == null ? void 0 : we.id) !== X.id || !N.created || (/* @__PURE__ */ new Date()).getTime() - N.created.getTime() > x;
|
|
3913
|
+
J.updateTarget({
|
|
3914
|
+
...N,
|
|
3915
|
+
selector: k.detail,
|
|
3916
|
+
created: de ? N.created : /* @__PURE__ */ new Date(),
|
|
3909
3917
|
updated: de ? /* @__PURE__ */ new Date() : void 0,
|
|
3910
|
-
updatedBy: de ?
|
|
3918
|
+
updatedBy: de ? X : void 0
|
|
3911
3919
|
});
|
|
3912
|
-
},
|
|
3913
|
-
const { x:
|
|
3914
|
-
|
|
3915
|
-
},
|
|
3916
|
-
function
|
|
3917
|
-
|
|
3918
|
-
|
|
3920
|
+
}, Oe = (M) => {
|
|
3921
|
+
const { x: k, y: N } = un(M, T), x = J.getAt(k, N);
|
|
3922
|
+
x ? u !== x.id && D.set(x.id) : D.set(void 0);
|
|
3923
|
+
}, ue = (M) => jo(M), R = (M) => Je(M);
|
|
3924
|
+
function De(M) {
|
|
3925
|
+
We[M ? "unshift" : "push"](() => {
|
|
3926
|
+
b = M, n(6, b);
|
|
3919
3927
|
});
|
|
3920
3928
|
}
|
|
3921
|
-
function
|
|
3922
|
-
|
|
3923
|
-
T =
|
|
3929
|
+
function Ve(M) {
|
|
3930
|
+
We[M ? "unshift" : "push"](() => {
|
|
3931
|
+
T = M, n(4, T);
|
|
3924
3932
|
});
|
|
3925
3933
|
}
|
|
3926
|
-
return e.$$set = (
|
|
3927
|
-
"drawingEnabled" in
|
|
3934
|
+
return e.$$set = (M) => {
|
|
3935
|
+
"drawingEnabled" in M && n(0, A = M.drawingEnabled), "image" in M && n(25, p = M.image), "preferredDrawingMode" in M && n(26, _ = M.preferredDrawingMode), "state" in M && n(27, w = M.state), "style" in M && n(1, E = M.style), "toolName" in M && n(2, v = M.toolName), "user" in M && n(28, X = M.user), "visible" in M && n(3, U = M.visible);
|
|
3928
3936
|
}, e.$$.update = () => {
|
|
3929
3937
|
e.$$.dirty[0] & /*toolName*/
|
|
3930
|
-
4 && n(
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
16 && n(
|
|
3934
|
-
|
|
3935
|
-
|
|
3938
|
+
4 && n(14, { tool: o, opts: i } = fn(v) || { tool: void 0, opts: void 0 }, o, (n(32, i), n(2, v))), e.$$.dirty[0] & /*preferredDrawingMode*/
|
|
3939
|
+
67108864 | e.$$.dirty[1] & /*opts*/
|
|
3940
|
+
2 && n(13, s = (i == null ? void 0 : i.drawingMode) || _), e.$$.dirty[0] & /*svgEl*/
|
|
3941
|
+
16 && n(12, r = yi(T)), e.$$.dirty[0] & /*svgEl*/
|
|
3942
|
+
16 && n(11, { onPointerDown: l, onPointerUp: a } = wi(T, J), l, (n(10, a), n(4, T))), e.$$.dirty[1] & /*$selection*/
|
|
3943
|
+
4 && n(9, c = (M) => f.selected.find((k) => k.id === M.id && k.editable)), e.$$.dirty[1] & /*$selection*/
|
|
3944
|
+
4 && ce(f.selected);
|
|
3936
3945
|
}, [
|
|
3937
3946
|
A,
|
|
3938
3947
|
E,
|
|
3939
|
-
|
|
3940
|
-
|
|
3948
|
+
v,
|
|
3949
|
+
U,
|
|
3941
3950
|
T,
|
|
3942
|
-
|
|
3951
|
+
V,
|
|
3943
3952
|
b,
|
|
3944
|
-
|
|
3953
|
+
Y,
|
|
3954
|
+
pe,
|
|
3945
3955
|
c,
|
|
3946
3956
|
a,
|
|
3947
3957
|
l,
|
|
@@ -3950,78 +3960,83 @@ function vi(e, t, n) {
|
|
|
3950
3960
|
o,
|
|
3951
3961
|
u,
|
|
3952
3962
|
h,
|
|
3953
|
-
|
|
3954
|
-
M,
|
|
3955
|
-
P,
|
|
3963
|
+
y,
|
|
3956
3964
|
D,
|
|
3957
|
-
|
|
3958
|
-
|
|
3965
|
+
H,
|
|
3966
|
+
J,
|
|
3959
3967
|
Be,
|
|
3960
3968
|
fe,
|
|
3961
|
-
|
|
3962
|
-
|
|
3969
|
+
Oe,
|
|
3970
|
+
ue,
|
|
3971
|
+
p,
|
|
3972
|
+
_,
|
|
3963
3973
|
w,
|
|
3964
|
-
|
|
3965
|
-
V,
|
|
3974
|
+
X,
|
|
3966
3975
|
Z,
|
|
3976
|
+
S,
|
|
3977
|
+
L,
|
|
3967
3978
|
i,
|
|
3968
3979
|
f,
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3980
|
+
R,
|
|
3981
|
+
De,
|
|
3982
|
+
Ve
|
|
3972
3983
|
];
|
|
3973
3984
|
}
|
|
3974
|
-
class
|
|
3985
|
+
class ki extends ie {
|
|
3975
3986
|
constructor(t) {
|
|
3976
|
-
super(),
|
|
3987
|
+
super(), oe(
|
|
3977
3988
|
this,
|
|
3978
3989
|
t,
|
|
3979
|
-
|
|
3990
|
+
Li,
|
|
3980
3991
|
Mi,
|
|
3981
3992
|
Q,
|
|
3982
3993
|
{
|
|
3983
3994
|
drawingEnabled: 0,
|
|
3984
|
-
image:
|
|
3985
|
-
preferredDrawingMode:
|
|
3986
|
-
state:
|
|
3995
|
+
image: 25,
|
|
3996
|
+
preferredDrawingMode: 26,
|
|
3997
|
+
state: 27,
|
|
3987
3998
|
style: 1,
|
|
3988
3999
|
toolName: 2,
|
|
3989
|
-
user:
|
|
4000
|
+
user: 28,
|
|
3990
4001
|
visible: 3,
|
|
3991
|
-
|
|
3992
|
-
|
|
4002
|
+
cancelDrawing: 29,
|
|
4003
|
+
getDrawingTool: 30,
|
|
4004
|
+
isDrawingEnabled: 31
|
|
3993
4005
|
},
|
|
3994
4006
|
null,
|
|
3995
4007
|
[-1, -1]
|
|
3996
4008
|
);
|
|
3997
4009
|
}
|
|
4010
|
+
get cancelDrawing() {
|
|
4011
|
+
return this.$$.ctx[29];
|
|
4012
|
+
}
|
|
3998
4013
|
get getDrawingTool() {
|
|
3999
|
-
return this.$$.ctx[
|
|
4014
|
+
return this.$$.ctx[30];
|
|
4000
4015
|
}
|
|
4001
4016
|
get isDrawingEnabled() {
|
|
4002
|
-
return this.$$.ctx[
|
|
4017
|
+
return this.$$.ctx[31];
|
|
4003
4018
|
}
|
|
4004
4019
|
}
|
|
4005
|
-
function dn(e, t, n = 0, o = e.length - 1, i =
|
|
4020
|
+
function dn(e, t, n = 0, o = e.length - 1, i = vi) {
|
|
4006
4021
|
for (; o > n; ) {
|
|
4007
4022
|
if (o - n > 600) {
|
|
4008
|
-
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),
|
|
4009
|
-
dn(e, t,
|
|
4023
|
+
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), y = Math.max(n, Math.floor(t - c * f / a + h)), g = Math.min(o, Math.floor(t + (a - c) * f / a + h));
|
|
4024
|
+
dn(e, t, y, g, i);
|
|
4010
4025
|
}
|
|
4011
4026
|
const s = e[t];
|
|
4012
4027
|
let r = n, l = o;
|
|
4013
|
-
for (
|
|
4014
|
-
for (
|
|
4028
|
+
for (Ye(e, n, t), i(e[o], s) > 0 && Ye(e, n, o); r < l; ) {
|
|
4029
|
+
for (Ye(e, r, l), r++, l--; i(e[r], s) < 0; ) r++;
|
|
4015
4030
|
for (; i(e[l], s) > 0; ) l--;
|
|
4016
4031
|
}
|
|
4017
|
-
i(e[n], s) === 0 ?
|
|
4032
|
+
i(e[n], s) === 0 ? Ye(e, n, l) : (l++, Ye(e, l, o)), l <= t && (n = l + 1), t <= l && (o = l - 1);
|
|
4018
4033
|
}
|
|
4019
4034
|
}
|
|
4020
|
-
function
|
|
4035
|
+
function Ye(e, t, n) {
|
|
4021
4036
|
const o = e[t];
|
|
4022
4037
|
e[t] = e[n], e[n] = o;
|
|
4023
4038
|
}
|
|
4024
|
-
function
|
|
4039
|
+
function vi(e, t) {
|
|
4025
4040
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
4026
4041
|
}
|
|
4027
4042
|
class Ii {
|
|
@@ -4086,7 +4101,7 @@ class Ii {
|
|
|
4086
4101
|
return t && this._insert(t, this.data.height - 1), this;
|
|
4087
4102
|
}
|
|
4088
4103
|
clear() {
|
|
4089
|
-
return this.data =
|
|
4104
|
+
return this.data = Le([]), this;
|
|
4090
4105
|
}
|
|
4091
4106
|
remove(t, n) {
|
|
4092
4107
|
if (!t) return this;
|
|
@@ -4128,19 +4143,19 @@ class Ii {
|
|
|
4128
4143
|
const s = o - n + 1;
|
|
4129
4144
|
let r = this._maxEntries, l;
|
|
4130
4145
|
if (s <= r)
|
|
4131
|
-
return l =
|
|
4132
|
-
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l =
|
|
4146
|
+
return l = Le(t.slice(n, o + 1)), Te(l, this.toBBox), l;
|
|
4147
|
+
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l = Le([]), l.leaf = !1, l.height = i;
|
|
4133
4148
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
4134
4149
|
Ft(t, n, o, c, this.compareMinX);
|
|
4135
4150
|
for (let u = n; u <= o; u += c) {
|
|
4136
4151
|
const f = Math.min(u + c - 1, o);
|
|
4137
4152
|
Ft(t, u, f, a, this.compareMinY);
|
|
4138
4153
|
for (let h = u; h <= f; h += a) {
|
|
4139
|
-
const
|
|
4140
|
-
l.children.push(this._build(t, h,
|
|
4154
|
+
const y = Math.min(h + a - 1, f);
|
|
4155
|
+
l.children.push(this._build(t, h, y, i - 1));
|
|
4141
4156
|
}
|
|
4142
4157
|
}
|
|
4143
|
-
return
|
|
4158
|
+
return Te(l, this.toBBox), l;
|
|
4144
4159
|
}
|
|
4145
4160
|
_chooseSubtree(t, n, o, i) {
|
|
4146
4161
|
for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {
|
|
@@ -4155,7 +4170,7 @@ class Ii {
|
|
|
4155
4170
|
}
|
|
4156
4171
|
_insert(t, n, o) {
|
|
4157
4172
|
const i = o ? t : this.toBBox(t), s = [], r = this._chooseSubtree(i, this.data, n, s);
|
|
4158
|
-
for (r.children.push(t),
|
|
4173
|
+
for (r.children.push(t), Xe(r, i); n >= 0 && s[n].children.length > this._maxEntries; )
|
|
4159
4174
|
this._split(s, n), n--;
|
|
4160
4175
|
this._adjustParentBBoxes(i, s, n);
|
|
4161
4176
|
}
|
|
@@ -4163,16 +4178,16 @@ class Ii {
|
|
|
4163
4178
|
_split(t, n) {
|
|
4164
4179
|
const o = t[n], i = o.children.length, s = this._minEntries;
|
|
4165
4180
|
this._chooseSplitAxis(o, s, i);
|
|
4166
|
-
const r = this._chooseSplitIndex(o, s, i), l =
|
|
4167
|
-
l.height = o.height, l.leaf = o.leaf,
|
|
4181
|
+
const r = this._chooseSplitIndex(o, s, i), l = Le(o.children.splice(r, o.children.length - r));
|
|
4182
|
+
l.height = o.height, l.leaf = o.leaf, Te(o, this.toBBox), Te(l, this.toBBox), n ? t[n - 1].children.push(l) : this._splitRoot(o, l);
|
|
4168
4183
|
}
|
|
4169
4184
|
_splitRoot(t, n) {
|
|
4170
|
-
this.data =
|
|
4185
|
+
this.data = Le([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, Te(this.data, this.toBBox);
|
|
4171
4186
|
}
|
|
4172
4187
|
_chooseSplitIndex(t, n, o) {
|
|
4173
4188
|
let i, s = 1 / 0, r = 1 / 0;
|
|
4174
4189
|
for (let l = n; l <= o - n; l++) {
|
|
4175
|
-
const a =
|
|
4190
|
+
const a = Ce(t, 0, l, this.toBBox), c = Ce(t, l, o, this.toBBox), u = Pi(a, c), f = at(a) + at(c);
|
|
4176
4191
|
u < s ? (s = u, i = l, r = f < r ? f : r) : u === s && f < r && (r = f, i = l);
|
|
4177
4192
|
}
|
|
4178
4193
|
return i || o - n;
|
|
@@ -4185,25 +4200,25 @@ class Ii {
|
|
|
4185
4200
|
// total margin of all possible split distributions where each node is at least m full
|
|
4186
4201
|
_allDistMargin(t, n, o, i) {
|
|
4187
4202
|
t.children.sort(i);
|
|
4188
|
-
const s = this.toBBox, r =
|
|
4203
|
+
const s = this.toBBox, r = Ce(t, 0, n, s), l = Ce(t, o - n, o, s);
|
|
4189
4204
|
let a = je(r) + je(l);
|
|
4190
4205
|
for (let c = n; c < o - n; c++) {
|
|
4191
4206
|
const u = t.children[c];
|
|
4192
|
-
|
|
4207
|
+
Xe(r, t.leaf ? s(u) : u), a += je(r);
|
|
4193
4208
|
}
|
|
4194
4209
|
for (let c = o - n - 1; c >= n; c--) {
|
|
4195
4210
|
const u = t.children[c];
|
|
4196
|
-
|
|
4211
|
+
Xe(l, t.leaf ? s(u) : u), a += je(l);
|
|
4197
4212
|
}
|
|
4198
4213
|
return a;
|
|
4199
4214
|
}
|
|
4200
4215
|
_adjustParentBBoxes(t, n, o) {
|
|
4201
4216
|
for (let i = o; i >= 0; i--)
|
|
4202
|
-
|
|
4217
|
+
Xe(n[i], t);
|
|
4203
4218
|
}
|
|
4204
4219
|
_condense(t) {
|
|
4205
4220
|
for (let n = t.length - 1, o; n >= 0; n--)
|
|
4206
|
-
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() :
|
|
4221
|
+
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() : Te(t[n], this.toBBox);
|
|
4207
4222
|
}
|
|
4208
4223
|
}
|
|
4209
4224
|
function Bi(e, t, n) {
|
|
@@ -4212,18 +4227,18 @@ function Bi(e, t, n) {
|
|
|
4212
4227
|
if (n(e, t[o])) return o;
|
|
4213
4228
|
return -1;
|
|
4214
4229
|
}
|
|
4215
|
-
function
|
|
4216
|
-
|
|
4230
|
+
function Te(e, t) {
|
|
4231
|
+
Ce(e, 0, e.children.length, t, e);
|
|
4217
4232
|
}
|
|
4218
|
-
function
|
|
4219
|
-
i || (i =
|
|
4233
|
+
function Ce(e, t, n, o, i) {
|
|
4234
|
+
i || (i = Le(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
4220
4235
|
for (let s = t; s < n; s++) {
|
|
4221
4236
|
const r = e.children[s];
|
|
4222
|
-
|
|
4237
|
+
Xe(i, e.leaf ? o(r) : r);
|
|
4223
4238
|
}
|
|
4224
4239
|
return i;
|
|
4225
4240
|
}
|
|
4226
|
-
function
|
|
4241
|
+
function Xe(e, t) {
|
|
4227
4242
|
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;
|
|
4228
4243
|
}
|
|
4229
4244
|
function Oi(e, t) {
|
|
@@ -4251,7 +4266,7 @@ function ct(e, t) {
|
|
|
4251
4266
|
function ze(e, t) {
|
|
4252
4267
|
return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
|
|
4253
4268
|
}
|
|
4254
|
-
function
|
|
4269
|
+
function Le(e) {
|
|
4255
4270
|
return {
|
|
4256
4271
|
children: e,
|
|
4257
4272
|
height: 1,
|
|
@@ -4275,7 +4290,7 @@ const Ci = () => {
|
|
|
4275
4290
|
e.clear(), t.clear();
|
|
4276
4291
|
}, i = (f) => {
|
|
4277
4292
|
if (!Fe(f)) return;
|
|
4278
|
-
const { minX: h, minY:
|
|
4293
|
+
const { minX: h, minY: y, maxX: g, maxY: m } = f.selector.geometry.bounds, A = { minX: h, minY: y, maxX: g, maxY: m, target: f };
|
|
4279
4294
|
e.insert(A), t.set(f.annotation, A);
|
|
4280
4295
|
}, s = (f) => {
|
|
4281
4296
|
if (!Fe(f)) return;
|
|
@@ -4291,28 +4306,28 @@ const Ci = () => {
|
|
|
4291
4306
|
minY: h,
|
|
4292
4307
|
maxX: f,
|
|
4293
4308
|
maxY: h
|
|
4294
|
-
}).map((
|
|
4309
|
+
}).map((m) => m.target).filter((m) => m.selector.type === F.RECTANGLE || vn(m.selector, f, h));
|
|
4295
4310
|
if (g.length > 0)
|
|
4296
|
-
return g.sort((
|
|
4311
|
+
return g.sort((m, A) => ht(m.selector) - ht(A.selector)), g[0];
|
|
4297
4312
|
},
|
|
4298
|
-
getIntersecting: (f, h,
|
|
4313
|
+
getIntersecting: (f, h, y, g) => e.search({
|
|
4299
4314
|
minX: f,
|
|
4300
4315
|
minY: h,
|
|
4301
|
-
maxX: f +
|
|
4316
|
+
maxX: f + y,
|
|
4302
4317
|
maxY: h + g
|
|
4303
|
-
}).map((
|
|
4318
|
+
}).map((m) => m.target),
|
|
4304
4319
|
insert: i,
|
|
4305
4320
|
remove: s,
|
|
4306
4321
|
set: (f, h = !0) => {
|
|
4307
4322
|
h && o();
|
|
4308
|
-
const
|
|
4309
|
-
if (Fe(
|
|
4310
|
-
const { minX: A, minY:
|
|
4311
|
-
return [...g, { minX: A, minY:
|
|
4323
|
+
const y = f.reduce((g, m) => {
|
|
4324
|
+
if (Fe(m)) {
|
|
4325
|
+
const { minX: A, minY: p, maxX: _, maxY: w } = m.selector.geometry.bounds;
|
|
4326
|
+
return [...g, { minX: A, minY: p, maxX: _, maxY: w, target: m }];
|
|
4312
4327
|
} else
|
|
4313
4328
|
return g;
|
|
4314
4329
|
}, []);
|
|
4315
|
-
|
|
4330
|
+
y.forEach((g) => t.set(g.target.annotation, g)), e.load(y);
|
|
4316
4331
|
},
|
|
4317
4332
|
size: () => e.all().length,
|
|
4318
4333
|
update: (f, h) => {
|
|
@@ -4320,7 +4335,7 @@ const Ci = () => {
|
|
|
4320
4335
|
}
|
|
4321
4336
|
};
|
|
4322
4337
|
}, Xi = (e) => {
|
|
4323
|
-
const t = io(), n = Ci(), o =
|
|
4338
|
+
const t = io(), n = Ci(), o = Kn(t, e.userSelectAction, e.adapter), i = Fn(t), s = co();
|
|
4324
4339
|
return t.observe(({ changes: a }) => {
|
|
4325
4340
|
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));
|
|
4326
4341
|
}), {
|
|
@@ -4336,13 +4351,13 @@ const Ci = () => {
|
|
|
4336
4351
|
hover: i,
|
|
4337
4352
|
viewport: s
|
|
4338
4353
|
};
|
|
4339
|
-
},
|
|
4354
|
+
}, Ri = (e) => {
|
|
4340
4355
|
const t = Xi(e);
|
|
4341
4356
|
return {
|
|
4342
4357
|
...t,
|
|
4343
4358
|
store: so(t.store)
|
|
4344
4359
|
};
|
|
4345
|
-
},
|
|
4360
|
+
}, Ui = (e) => {
|
|
4346
4361
|
let t, n;
|
|
4347
4362
|
if (e.nodeName === "CANVAS")
|
|
4348
4363
|
t = e, n = t.getContext("2d", { willReadFrequently: !0 });
|
|
@@ -4358,15 +4373,15 @@ const Ci = () => {
|
|
|
4358
4373
|
}
|
|
4359
4374
|
return o / 81;
|
|
4360
4375
|
}, Ni = (e) => {
|
|
4361
|
-
const t =
|
|
4376
|
+
const t = Ui(e), n = t > 0.6 ? "dark" : "light";
|
|
4362
4377
|
return console.log(`[Annotorious] Image brightness: ${t.toFixed(1)}. Setting ${n} theme.`), n;
|
|
4363
|
-
},
|
|
4378
|
+
}, Kt = (e, t, n) => t.setAttribute("data-theme", n === "auto" ? Ni(e) : n), Vi = (e, t) => ({
|
|
4364
4379
|
...e,
|
|
4365
4380
|
drawingEnabled: e.drawingEnabled === void 0 ? t.drawingEnabled : e.drawingEnabled,
|
|
4366
4381
|
drawingMode: e.drawingMode || t.drawingMode,
|
|
4367
4382
|
userSelectAction: e.userSelectAction || t.userSelectAction,
|
|
4368
4383
|
theme: e.theme || t.theme
|
|
4369
|
-
}),
|
|
4384
|
+
}), Wt = typeof navigator > "u" ? !1 : navigator.userAgent.indexOf("Mac OS X") !== -1, Gi = (e, t) => {
|
|
4370
4385
|
const n = t || document, o = (r) => {
|
|
4371
4386
|
const l = r;
|
|
4372
4387
|
l.key === "z" && l.ctrlKey ? e.undo() : l.key === "y" && l.ctrlKey && e.redo();
|
|
@@ -4374,9 +4389,9 @@ const Ci = () => {
|
|
|
4374
4389
|
const l = r;
|
|
4375
4390
|
l.key === "z" && l.metaKey && (l.shiftKey ? e.redo() : e.undo());
|
|
4376
4391
|
}, s = () => {
|
|
4377
|
-
|
|
4392
|
+
Wt ? n.removeEventListener("keydown", i) : n.removeEventListener("keydown", o);
|
|
4378
4393
|
};
|
|
4379
|
-
return
|
|
4394
|
+
return Wt ? n.addEventListener("keydown", i) : n.addEventListener("keydown", o), {
|
|
4380
4395
|
destroy: s
|
|
4381
4396
|
};
|
|
4382
4397
|
}, Ji = (e, t = {}) => {
|
|
@@ -4387,7 +4402,7 @@ const Ci = () => {
|
|
|
4387
4402
|
drawingMode: "drag",
|
|
4388
4403
|
userSelectAction: nn.EDIT,
|
|
4389
4404
|
theme: "light"
|
|
4390
|
-
}), i =
|
|
4405
|
+
}), i = Ri(o), { selection: s, store: r } = i, l = ao(r, o.initialHistory), a = fo(
|
|
4391
4406
|
i,
|
|
4392
4407
|
l,
|
|
4393
4408
|
o.adapter,
|
|
@@ -4396,8 +4411,8 @@ const Ci = () => {
|
|
|
4396
4411
|
c.style.position = "relative", c.style.display = "inline-block", n.style.display = "block", n.parentNode.insertBefore(c, n), c.appendChild(n);
|
|
4397
4412
|
const u = Gi(l);
|
|
4398
4413
|
let f = wo();
|
|
4399
|
-
|
|
4400
|
-
const h = new
|
|
4414
|
+
Kt(n, c, o.theme);
|
|
4415
|
+
const h = new ki({
|
|
4401
4416
|
target: c,
|
|
4402
4417
|
props: {
|
|
4403
4418
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4409,64 +4424,62 @@ const Ci = () => {
|
|
|
4409
4424
|
}
|
|
4410
4425
|
});
|
|
4411
4426
|
h.$on("click", (b) => {
|
|
4412
|
-
const { originalEvent:
|
|
4413
|
-
|
|
4427
|
+
const { originalEvent: T, annotation: Y } = b.detail;
|
|
4428
|
+
Y ? s.userSelect(Y.id, T) : s.isEmpty() || s.clear();
|
|
4414
4429
|
});
|
|
4415
|
-
const
|
|
4416
|
-
h.$set({ drawingEnabled: !1 }), setTimeout(() => h.$set({ drawingEnabled: !0 }), 1);
|
|
4417
|
-
}, _ = () => {
|
|
4430
|
+
const y = ho(i, l, o.adapter), g = () => h.cancelDrawing(), m = () => {
|
|
4418
4431
|
h.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4419
|
-
}, A = () => h.getDrawingTool(),
|
|
4432
|
+
}, A = () => h.getDrawingTool(), p = () => f, _ = () => h.isDrawingEnabled(), w = (b, T, Y) => si(b, T, Y), E = (b, T) => zo(b, T), v = (b) => {
|
|
4420
4433
|
if (!fn(b))
|
|
4421
4434
|
throw `No drawing tool named ${b}`;
|
|
4422
4435
|
h.$set({ toolName: b });
|
|
4423
|
-
},
|
|
4436
|
+
}, X = (b) => h.$set({ drawingEnabled: b }), U = (b) => {
|
|
4424
4437
|
console.warn("Filter not implemented yet");
|
|
4425
|
-
}, V = (b) => h.$set({ style: b }), Z = (b) =>
|
|
4438
|
+
}, V = (b) => h.$set({ style: b }), Z = (b) => Kt(n, c, b), S = (b) => {
|
|
4426
4439
|
f = b, h.$set({ user: b });
|
|
4427
|
-
},
|
|
4440
|
+
}, L = (b) => (
|
|
4428
4441
|
// @ts-ignore
|
|
4429
4442
|
h.$set({ visible: b })
|
|
4430
4443
|
);
|
|
4431
4444
|
return {
|
|
4432
|
-
...
|
|
4445
|
+
...y,
|
|
4433
4446
|
cancelDrawing: g,
|
|
4434
|
-
destroy:
|
|
4447
|
+
destroy: m,
|
|
4435
4448
|
getDrawingTool: A,
|
|
4436
|
-
getUser:
|
|
4437
|
-
isDrawingEnabled:
|
|
4449
|
+
getUser: p,
|
|
4450
|
+
isDrawingEnabled: _,
|
|
4438
4451
|
listDrawingTools: cn,
|
|
4439
4452
|
on: a.on,
|
|
4440
4453
|
off: a.off,
|
|
4441
4454
|
registerDrawingTool: w,
|
|
4442
4455
|
registerShapeEditor: E,
|
|
4443
|
-
setDrawingEnabled:
|
|
4444
|
-
setDrawingTool:
|
|
4445
|
-
setFilter:
|
|
4456
|
+
setDrawingEnabled: X,
|
|
4457
|
+
setDrawingTool: v,
|
|
4458
|
+
setFilter: U,
|
|
4446
4459
|
setStyle: V,
|
|
4447
4460
|
setTheme: Z,
|
|
4448
4461
|
setUser: S,
|
|
4449
|
-
setVisible:
|
|
4462
|
+
setVisible: L,
|
|
4450
4463
|
element: c,
|
|
4451
4464
|
state: i
|
|
4452
4465
|
};
|
|
4453
4466
|
};
|
|
4454
4467
|
export {
|
|
4455
4468
|
an as Editor,
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4469
|
+
qo as EditorMount,
|
|
4470
|
+
Pe as Handle,
|
|
4471
|
+
qi as IdentityTransform,
|
|
4459
4472
|
Io as PolygonEditor,
|
|
4460
4473
|
Go as RectangleEditor,
|
|
4461
4474
|
On as RectangleUtil,
|
|
4462
4475
|
$o as RubberbandRectangle,
|
|
4463
|
-
|
|
4476
|
+
ki as SVGAnnotationLayer,
|
|
4464
4477
|
F as ShapeType,
|
|
4465
4478
|
Qo as ToolMount,
|
|
4466
4479
|
nn as UserSelectAction,
|
|
4467
|
-
|
|
4480
|
+
Wi as W3CImageFormat,
|
|
4468
4481
|
wi as addEventListeners,
|
|
4469
|
-
|
|
4482
|
+
qe as boundsFromPoints,
|
|
4470
4483
|
Fi as chainStyles,
|
|
4471
4484
|
ht as computeArea,
|
|
4472
4485
|
Hi as computeStyle,
|
|
@@ -4474,8 +4487,8 @@ export {
|
|
|
4474
4487
|
Ji as createImageAnnotator,
|
|
4475
4488
|
Xi as createImageAnnotatorState,
|
|
4476
4489
|
yi as createSVGTransform,
|
|
4477
|
-
|
|
4478
|
-
|
|
4490
|
+
Ri as createSvelteImageAnnotatorState,
|
|
4491
|
+
Ki as defaultColorProvider,
|
|
4479
4492
|
Ni as detectTheme,
|
|
4480
4493
|
st as distance,
|
|
4481
4494
|
Do as enableResponsive,
|
|
@@ -4484,22 +4497,22 @@ export {
|
|
|
4484
4497
|
un as getSVGPoint,
|
|
4485
4498
|
fn as getTool,
|
|
4486
4499
|
Gi as initKeyboardCommands,
|
|
4487
|
-
|
|
4500
|
+
vn as intersects,
|
|
4488
4501
|
Je as isImageAnnotation,
|
|
4489
4502
|
Fe as isImageAnnotationTarget,
|
|
4490
|
-
|
|
4503
|
+
Wt as isMac,
|
|
4491
4504
|
Yo as isTouch,
|
|
4492
4505
|
cn as listDrawingTools,
|
|
4493
4506
|
Dn as parseFragmentSelector,
|
|
4494
|
-
|
|
4507
|
+
Un as parseSVGSelector,
|
|
4495
4508
|
To as parseW3CImageAnnotation,
|
|
4496
4509
|
zo as registerEditor,
|
|
4497
4510
|
pt as registerShapeUtil,
|
|
4498
4511
|
si as registerTool,
|
|
4499
|
-
|
|
4512
|
+
Ui as sampleBrightness,
|
|
4500
4513
|
Yn as serializeFragmentSelector,
|
|
4501
4514
|
Nn as serializeSVGSelector,
|
|
4502
4515
|
Mo as serializeW3CImageAnnotation,
|
|
4503
|
-
|
|
4516
|
+
Kt as setTheme
|
|
4504
4517
|
};
|
|
4505
4518
|
//# sourceMappingURL=annotorious.es.js.map
|