@annotorious/react 3.0.0-rc.5 → 3.0.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,47 +1,47 @@
1
- function G() {
1
+ function U() {
2
2
  }
3
3
  function Qe(t, e) {
4
4
  for (const n in e)
5
5
  t[n] = e[n];
6
6
  return t;
7
7
  }
8
- function Ve(t) {
8
+ function ke(t) {
9
9
  return t();
10
10
  }
11
- function ce() {
11
+ function ue() {
12
12
  return /* @__PURE__ */ Object.create(null);
13
13
  }
14
14
  function it(t) {
15
- t.forEach(Ve);
15
+ t.forEach(ke);
16
16
  }
17
17
  function H(t) {
18
18
  return typeof t == "function";
19
19
  }
20
- function K(t, e) {
20
+ function W(t, e) {
21
21
  return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
22
22
  }
23
- function Ze(t) {
23
+ function tn(t) {
24
24
  return Object.keys(t).length === 0;
25
25
  }
26
26
  function De(t, ...e) {
27
27
  if (t == null)
28
- return G;
28
+ return U;
29
29
  const n = t.subscribe(...e);
30
30
  return n.unsubscribe ? () => n.unsubscribe() : n;
31
31
  }
32
- function ue(t, e, n) {
32
+ function he(t, e, n) {
33
33
  t.$$.on_destroy.push(De(e, n));
34
34
  }
35
- function tn(t, e, n, o) {
35
+ function en(t, e, n, o) {
36
36
  if (t) {
37
- const r = Ce(t, e, n, o);
37
+ const r = Ue(t, e, n, o);
38
38
  return t[0](r);
39
39
  }
40
40
  }
41
- function Ce(t, e, n, o) {
41
+ function Ue(t, e, n, o) {
42
42
  return t[1] && o ? Qe(n.ctx.slice(), t[1](o(e))) : n.ctx;
43
43
  }
44
- function en(t, e, n, o) {
44
+ function nn(t, e, n, o) {
45
45
  if (t[2] && o) {
46
46
  const r = t[2](o(n));
47
47
  if (e.dirty === void 0)
@@ -56,13 +56,13 @@ function en(t, e, n, o) {
56
56
  }
57
57
  return e.dirty;
58
58
  }
59
- function nn(t, e, n, o, r, i) {
59
+ function on(t, e, n, o, r, i) {
60
60
  if (r) {
61
- const a = Ce(e, n, o, i);
61
+ const a = Ue(e, n, o, i);
62
62
  t.p(a, r);
63
63
  }
64
64
  }
65
- function on(t) {
65
+ function rn(t) {
66
66
  if (t.ctx.length > 32) {
67
67
  const e = [], n = t.ctx.length / 32;
68
68
  for (let o = 0; o < n; o++)
@@ -71,30 +71,30 @@ function on(t) {
71
71
  }
72
72
  return -1;
73
73
  }
74
- function dt(t, e) {
74
+ function lt(t, e) {
75
75
  t.appendChild(e);
76
76
  }
77
- function Y(t, e, n) {
77
+ function _(t, e, n) {
78
78
  t.insertBefore(e, n || null);
79
79
  }
80
- function L(t) {
80
+ function Y(t) {
81
81
  t.parentNode && t.parentNode.removeChild(t);
82
82
  }
83
- function re(t, e) {
83
+ function ie(t, e) {
84
84
  for (let n = 0; n < t.length; n += 1)
85
85
  t[n] && t[n].d(e);
86
86
  }
87
- function N(t) {
87
+ function R(t) {
88
88
  return document.createElementNS("http://www.w3.org/2000/svg", t);
89
89
  }
90
- function Ue(t) {
90
+ function Ge(t) {
91
91
  return document.createTextNode(t);
92
92
  }
93
93
  function tt() {
94
- return Ue(" ");
94
+ return Ge(" ");
95
95
  }
96
96
  function at() {
97
- return Ue("");
97
+ return Ge("");
98
98
  }
99
99
  function z(t, e, n, o) {
100
100
  return t.addEventListener(e, n, o), () => t.removeEventListener(e, n, o);
@@ -102,34 +102,34 @@ function z(t, e, n, o) {
102
102
  function u(t, e, n) {
103
103
  n == null ? t.removeAttribute(e) : t.getAttribute(e) !== n && t.setAttribute(e, n);
104
104
  }
105
- function rn(t) {
105
+ function an(t) {
106
106
  return Array.from(t.childNodes);
107
107
  }
108
- function he(t, e, n) {
108
+ function pe(t, e, n) {
109
109
  t.classList[n ? "add" : "remove"](e);
110
110
  }
111
- function an(t, e, { bubbles: n = !1, cancelable: o = !1 } = {}) {
111
+ function sn(t, e, { bubbles: n = !1, cancelable: o = !1 } = {}) {
112
112
  const r = document.createEvent("CustomEvent");
113
113
  return r.initCustomEvent(t, n, o, e), r;
114
114
  }
115
- let It;
116
- function _t(t) {
117
- It = t;
115
+ let _t;
116
+ function Yt(t) {
117
+ _t = t;
118
118
  }
119
- function Ge() {
120
- if (!It)
119
+ function Fe() {
120
+ if (!_t)
121
121
  throw new Error("Function called outside component initialization");
122
- return It;
122
+ return _t;
123
123
  }
124
124
  function Mt(t) {
125
- Ge().$$.on_mount.push(t);
125
+ Fe().$$.on_mount.push(t);
126
126
  }
127
- function Tt() {
128
- const t = Ge();
127
+ function At() {
128
+ const t = Fe();
129
129
  return (e, n, { cancelable: o = !1 } = {}) => {
130
130
  const r = t.$$.callbacks[e];
131
131
  if (r) {
132
- const i = an(e, n, { cancelable: o });
132
+ const i = sn(e, n, { cancelable: o });
133
133
  return r.slice().forEach((a) => {
134
134
  a.call(t, i);
135
135
  }), !i.defaultPrevented;
@@ -137,112 +137,112 @@ function Tt() {
137
137
  return !0;
138
138
  };
139
139
  }
140
- function vt(t, e) {
140
+ function Et(t, e) {
141
141
  const n = t.$$.callbacks[e.type];
142
142
  n && n.slice().forEach((o) => o.call(this, e));
143
143
  }
144
- const bt = [], Ut = [];
145
- let At = [];
146
- const pe = [], sn = /* @__PURE__ */ Promise.resolve();
144
+ const xt = [], Ut = [];
145
+ let vt = [];
146
+ const ge = [], ln = /* @__PURE__ */ Promise.resolve();
147
147
  let ee = !1;
148
- function ln() {
149
- ee || (ee = !0, sn.then(Fe));
148
+ function dn() {
149
+ ee || (ee = !0, ln.then(He));
150
150
  }
151
151
  function ne(t) {
152
- At.push(t);
152
+ vt.push(t);
153
153
  }
154
154
  const zt = /* @__PURE__ */ new Set();
155
- let yt = 0;
156
- function Fe() {
157
- if (yt !== 0)
155
+ let mt = 0;
156
+ function He() {
157
+ if (mt !== 0)
158
158
  return;
159
- const t = It;
159
+ const t = _t;
160
160
  do {
161
161
  try {
162
- for (; yt < bt.length; ) {
163
- const e = bt[yt];
164
- yt++, _t(e), dn(e.$$);
162
+ for (; mt < xt.length; ) {
163
+ const e = xt[mt];
164
+ mt++, Yt(e), cn(e.$$);
165
165
  }
166
166
  } catch (e) {
167
- throw bt.length = 0, yt = 0, e;
167
+ throw xt.length = 0, mt = 0, e;
168
168
  }
169
- for (_t(null), bt.length = 0, yt = 0; Ut.length; )
169
+ for (Yt(null), xt.length = 0, mt = 0; Ut.length; )
170
170
  Ut.pop()();
171
- for (let e = 0; e < At.length; e += 1) {
172
- const n = At[e];
171
+ for (let e = 0; e < vt.length; e += 1) {
172
+ const n = vt[e];
173
173
  zt.has(n) || (zt.add(n), n());
174
174
  }
175
- At.length = 0;
176
- } while (bt.length);
177
- for (; pe.length; )
178
- pe.pop()();
179
- ee = !1, zt.clear(), _t(t);
175
+ vt.length = 0;
176
+ } while (xt.length);
177
+ for (; ge.length; )
178
+ ge.pop()();
179
+ ee = !1, zt.clear(), Yt(t);
180
180
  }
181
- function dn(t) {
181
+ function cn(t) {
182
182
  if (t.fragment !== null) {
183
183
  t.update(), it(t.before_update);
184
184
  const e = t.dirty;
185
185
  t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, e), t.after_update.forEach(ne);
186
186
  }
187
187
  }
188
- function cn(t) {
188
+ function un(t) {
189
189
  const e = [], n = [];
190
- At.forEach((o) => t.indexOf(o) === -1 ? e.push(o) : n.push(o)), n.forEach((o) => o()), At = e;
190
+ vt.forEach((o) => t.indexOf(o) === -1 ? e.push(o) : n.push(o)), n.forEach((o) => o()), vt = e;
191
191
  }
192
- const Ct = /* @__PURE__ */ new Set();
193
- let ht;
192
+ const Dt = /* @__PURE__ */ new Set();
193
+ let ut;
194
194
  function ot() {
195
- ht = {
195
+ ut = {
196
196
  r: 0,
197
197
  c: [],
198
- p: ht
198
+ p: ut
199
199
  // parent group
200
200
  };
201
201
  }
202
202
  function rt() {
203
- ht.r || it(ht.c), ht = ht.p;
203
+ ut.r || it(ut.c), ut = ut.p;
204
204
  }
205
- function k(t, e) {
206
- t && t.i && (Ct.delete(t), t.i(e));
205
+ function N(t, e) {
206
+ t && t.i && (Dt.delete(t), t.i(e));
207
207
  }
208
- function V(t, e, n, o) {
208
+ function k(t, e, n, o) {
209
209
  if (t && t.o) {
210
- if (Ct.has(t))
210
+ if (Dt.has(t))
211
211
  return;
212
- Ct.add(t), ht.c.push(() => {
213
- Ct.delete(t), o && (n && t.d(1), o());
212
+ Dt.add(t), ut.c.push(() => {
213
+ Dt.delete(t), o && (n && t.d(1), o());
214
214
  }), t.o(e);
215
215
  } else
216
216
  o && o();
217
217
  }
218
- function gt(t) {
218
+ function pt(t) {
219
219
  t && t.c();
220
220
  }
221
- function ct(t, e, n, o) {
221
+ function dt(t, e, n, o) {
222
222
  const { fragment: r, after_update: i } = t.$$;
223
223
  r && r.m(e, n), o || ne(() => {
224
- const a = t.$$.on_mount.map(Ve).filter(H);
224
+ const a = t.$$.on_mount.map(ke).filter(H);
225
225
  t.$$.on_destroy ? t.$$.on_destroy.push(...a) : it(a), t.$$.on_mount = [];
226
226
  }), i.forEach(ne);
227
227
  }
228
- function ut(t, e) {
228
+ function ct(t, e) {
229
229
  const n = t.$$;
230
- n.fragment !== null && (cn(n.after_update), it(n.on_destroy), n.fragment && n.fragment.d(e), n.on_destroy = n.fragment = null, n.ctx = []);
230
+ n.fragment !== null && (un(n.after_update), it(n.on_destroy), n.fragment && n.fragment.d(e), n.on_destroy = n.fragment = null, n.ctx = []);
231
231
  }
232
- function un(t, e) {
233
- t.$$.dirty[0] === -1 && (bt.push(t), ln(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
232
+ function hn(t, e) {
233
+ t.$$.dirty[0] === -1 && (xt.push(t), dn(), t.$$.dirty.fill(0)), t.$$.dirty[e / 31 | 0] |= 1 << e % 31;
234
234
  }
235
235
  function et(t, e, n, o, r, i, a, s = [-1]) {
236
- const l = It;
237
- _t(t);
236
+ const l = _t;
237
+ Yt(t);
238
238
  const d = t.$$ = {
239
239
  fragment: null,
240
240
  ctx: [],
241
241
  // state
242
242
  props: i,
243
- update: G,
243
+ update: U,
244
244
  not_equal: r,
245
- bound: ce(),
245
+ bound: ue(),
246
246
  // lifecycle
247
247
  on_mount: [],
248
248
  on_destroy: [],
@@ -251,7 +251,7 @@ function et(t, e, n, o, r, i, a, s = [-1]) {
251
251
  after_update: [],
252
252
  context: new Map(e.context || (l ? l.$$.context : [])),
253
253
  // everything else
254
- callbacks: ce(),
254
+ callbacks: ue(),
255
255
  dirty: s,
256
256
  skip_bound: !1,
257
257
  root: e.target || l.$$.root
@@ -260,24 +260,24 @@ function et(t, e, n, o, r, i, a, s = [-1]) {
260
260
  let p = !1;
261
261
  if (d.ctx = n ? n(t, e.props || {}, (c, g, ...h) => {
262
262
  const m = h.length ? h[0] : g;
263
- return d.ctx && r(d.ctx[c], d.ctx[c] = m) && (!d.skip_bound && d.bound[c] && d.bound[c](m), p && un(t, c)), g;
263
+ return d.ctx && r(d.ctx[c], d.ctx[c] = m) && (!d.skip_bound && d.bound[c] && d.bound[c](m), p && hn(t, c)), g;
264
264
  }) : [], d.update(), p = !0, it(d.before_update), d.fragment = o ? o(d.ctx) : !1, e.target) {
265
265
  if (e.hydrate) {
266
- const c = rn(e.target);
267
- d.fragment && d.fragment.l(c), c.forEach(L);
266
+ const c = an(e.target);
267
+ d.fragment && d.fragment.l(c), c.forEach(Y);
268
268
  } else
269
269
  d.fragment && d.fragment.c();
270
- e.intro && k(t.$$.fragment), ct(t, e.target, e.anchor, e.customElement), Fe();
270
+ e.intro && N(t.$$.fragment), dt(t, e.target, e.anchor, e.customElement), He();
271
271
  }
272
- _t(l);
272
+ Yt(l);
273
273
  }
274
274
  class nt {
275
275
  $destroy() {
276
- ut(this, 1), this.$destroy = G;
276
+ ct(this, 1), this.$destroy = U;
277
277
  }
278
278
  $on(e, n) {
279
279
  if (!H(n))
280
- return G;
280
+ return U;
281
281
  const o = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
282
282
  return o.push(n), () => {
283
283
  const r = o.indexOf(n);
@@ -285,24 +285,24 @@ class nt {
285
285
  };
286
286
  }
287
287
  $set(e) {
288
- this.$$set && !Ze(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
288
+ this.$$set && !tn(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
289
289
  }
290
290
  }
291
- var F = /* @__PURE__ */ ((t) => (t.ELLIPSE = "ELLIPSE", t.POLYGON = "POLYGON", t.RECTANGLE = "RECTANGLE", t))(F || {});
292
- const ie = {}, ae = (t, e) => ie[t] = e, oe = (t) => ie[t.type].area(t), hn = (t, e, n) => ie[t.type].intersects(t, e, n), Gt = (t) => {
291
+ var G = /* @__PURE__ */ ((t) => (t.ELLIPSE = "ELLIPSE", t.POLYGON = "POLYGON", t.RECTANGLE = "RECTANGLE", t))(G || {});
292
+ const ae = {}, se = (t, e) => ae[t] = e, oe = (t) => ae[t.type].area(t), pn = (t, e, n) => ae[t.type].intersects(t, e, n), Gt = (t) => {
293
293
  let e = 1 / 0, n = 1 / 0, o = -1 / 0, r = -1 / 0;
294
294
  return t.forEach(([i, a]) => {
295
295
  e = Math.min(e, i), n = Math.min(n, a), o = Math.max(o, i), r = Math.max(r, a);
296
296
  }), { minX: e, minY: n, maxX: o, maxY: r };
297
- }, pn = {
297
+ }, gn = {
298
298
  area: (t) => Math.PI * t.geometry.rx * t.geometry.ry,
299
299
  intersects: (t, e, n) => {
300
300
  const { cx: o, cy: r, rx: i, ry: a } = t.geometry, s = 0, l = Math.cos(s), d = Math.sin(s), p = e - o, c = n - r, g = l * p + d * c, h = d * p - l * c;
301
301
  return g * g / (i * i) + h * h / (a * a) <= 1;
302
302
  }
303
303
  };
304
- ae(F.ELLIPSE, pn);
305
- const gn = {
304
+ se(G.ELLIPSE, gn);
305
+ const fn = {
306
306
  area: (t) => {
307
307
  const { points: e } = t.geometry;
308
308
  let n = 0, o = e.length - 1;
@@ -320,13 +320,13 @@ const gn = {
320
320
  return r;
321
321
  }
322
322
  };
323
- ae(F.POLYGON, gn);
324
- const fn = {
323
+ se(G.POLYGON, fn);
324
+ const mn = {
325
325
  area: (t) => t.geometry.w * t.geometry.h,
326
326
  intersects: (t, e, n) => e >= t.geometry.x && e <= t.geometry.x + t.geometry.w && n >= t.geometry.y && n <= t.geometry.y + t.geometry.h
327
327
  };
328
- ae(F.RECTANGLE, fn);
329
- const mn = (t, e = !1) => {
328
+ se(G.RECTANGLE, mn);
329
+ const yn = (t, e = !1) => {
330
330
  const n = typeof t == "string" ? t : t.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, r = [...n.matchAll(o)][0], [i, a, s, l, d, p, c] = r;
331
331
  if (a !== "xywh")
332
332
  throw new Error("Unsupported MediaFragment: " + n);
@@ -334,7 +334,7 @@ const mn = (t, e = !1) => {
334
334
  throw new Error(`Unsupported MediaFragment unit: ${s}`);
335
335
  const [g, h, m, x] = [l, d, p, c].map(parseFloat);
336
336
  return {
337
- type: F.RECTANGLE,
337
+ type: G.RECTANGLE,
338
338
  geometry: {
339
339
  x: g,
340
340
  y: h,
@@ -348,47 +348,47 @@ const mn = (t, e = !1) => {
348
348
  }
349
349
  }
350
350
  };
351
- }, yn = (t) => {
351
+ }, wn = (t) => {
352
352
  const { x: e, y: n, w: o, h: r } = t;
353
353
  return {
354
354
  type: "FragmentSelector",
355
355
  conformsTo: "http://www.w3.org/TR/media-frags/",
356
356
  value: `xywh=pixel:${e},${n},${o},${r}`
357
357
  };
358
- }, He = "http://www.w3.org/2000/svg", ge = (t) => {
358
+ }, Pe = "http://www.w3.org/2000/svg", fe = (t) => {
359
359
  const e = (o) => {
360
360
  Array.from(o.attributes).forEach((r) => {
361
361
  r.name.startsWith("on") && o.removeAttribute(r.name);
362
362
  });
363
363
  }, n = t.getElementsByTagName("script");
364
364
  return Array.from(n).reverse().forEach((o) => o.parentNode.removeChild(o)), Array.from(t.querySelectorAll("*")).forEach(e), t;
365
- }, wn = (t) => {
366
- const e = new XMLSerializer().serializeToString(t.documentElement).replace("<svg>", `<svg xmlns="${He}">`);
367
- return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
368
365
  }, $n = (t) => {
369
- const e = new DOMParser().parseFromString(t, "image/svg+xml"), n = e.lookupPrefix(He), o = e.lookupNamespaceURI(null);
370
- return n || o ? ge(e).firstChild : ge(wn(e)).firstChild;
366
+ const e = new XMLSerializer().serializeToString(t.documentElement).replace("<svg>", `<svg xmlns="${Pe}">`);
367
+ return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
371
368
  }, xn = (t) => {
369
+ const e = new DOMParser().parseFromString(t, "image/svg+xml"), n = e.lookupPrefix(Pe), o = e.lookupNamespaceURI(null);
370
+ return n || o ? fe(e).firstChild : fe($n(e)).firstChild;
371
+ }, bn = (t) => {
372
372
  const [e, n, o] = t.match(/(<polygon points=["|'])([^("|')]*)/) || [];
373
373
  if (!o)
374
374
  return;
375
375
  const r = o.split(" ").map((i) => i.split(",").map(parseFloat));
376
376
  return {
377
- type: F.POLYGON,
377
+ type: G.POLYGON,
378
378
  geometry: {
379
379
  points: r,
380
380
  bounds: Gt(r)
381
381
  }
382
382
  };
383
- }, bn = (t) => {
384
- const e = $n(t), n = parseFloat(e.getAttribute("cx")), o = parseFloat(e.getAttribute("cy")), r = parseFloat(e.getAttribute("rx")), i = parseFloat(e.getAttribute("ry")), a = {
383
+ }, En = (t) => {
384
+ const e = xn(t), n = parseFloat(e.getAttribute("cx")), o = parseFloat(e.getAttribute("cy")), r = parseFloat(e.getAttribute("rx")), i = parseFloat(e.getAttribute("ry")), a = {
385
385
  minX: n - r,
386
386
  minY: o - i,
387
387
  maxX: n + r,
388
388
  maxY: o + i
389
389
  };
390
390
  return {
391
- type: F.ELLIPSE,
391
+ type: G.ELLIPSE,
392
392
  geometry: {
393
393
  cx: n,
394
394
  cy: o,
@@ -397,18 +397,18 @@ const mn = (t, e = !1) => {
397
397
  bounds: a
398
398
  }
399
399
  };
400
- }, En = (t) => {
400
+ }, vn = (t) => {
401
401
  const e = typeof t == "string" ? t : t.value;
402
402
  if (e.includes("<polygon points="))
403
- return xn(e);
404
- if (e.includes("<ellipse "))
405
403
  return bn(e);
406
- }, vn = (t) => {
404
+ if (e.includes("<ellipse "))
405
+ return En(e);
406
+ }, An = (t) => {
407
407
  let e;
408
- if (t.type === F.POLYGON) {
408
+ if (t.type === G.POLYGON) {
409
409
  const n = t.geometry, { points: o } = n;
410
410
  e = `<svg><polygon points="${o.map((r) => r.join(",")).join(" ")}" /></svg>`;
411
- } else if (t.type === F.ELLIPSE) {
411
+ } else if (t.type === G.ELLIPSE) {
412
412
  const n = t.geometry;
413
413
  e = `<svg><ellipse cx="${n.cx}" cy="${n.cy}" rx="${n.rx}" ry="${n.ry}" /></svg>`;
414
414
  }
@@ -416,37 +416,37 @@ const mn = (t, e = !1) => {
416
416
  return { type: "SvgSelector", value: e };
417
417
  throw `Unsupported shape type: ${t.type}`;
418
418
  };
419
- let kt;
420
- const An = new Uint8Array(16);
421
- function Tn() {
422
- if (!kt && (kt = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !kt))
419
+ let Nt;
420
+ const Tn = new Uint8Array(16);
421
+ function Sn() {
422
+ if (!Nt && (Nt = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Nt))
423
423
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
424
- return kt(An);
424
+ return Nt(Tn);
425
425
  }
426
- const P = [];
426
+ const j = [];
427
427
  for (let t = 0; t < 256; ++t)
428
- P.push((t + 256).toString(16).slice(1));
429
- function Sn(t, e = 0) {
430
- return P[t[e + 0]] + P[t[e + 1]] + P[t[e + 2]] + P[t[e + 3]] + "-" + P[t[e + 4]] + P[t[e + 5]] + "-" + P[t[e + 6]] + P[t[e + 7]] + "-" + P[t[e + 8]] + P[t[e + 9]] + "-" + P[t[e + 10]] + P[t[e + 11]] + P[t[e + 12]] + P[t[e + 13]] + P[t[e + 14]] + P[t[e + 15]];
428
+ j.push((t + 256).toString(16).slice(1));
429
+ function On(t, e = 0) {
430
+ return j[t[e + 0]] + j[t[e + 1]] + j[t[e + 2]] + j[t[e + 3]] + "-" + j[t[e + 4]] + j[t[e + 5]] + "-" + j[t[e + 6]] + j[t[e + 7]] + "-" + j[t[e + 8]] + j[t[e + 9]] + "-" + j[t[e + 10]] + j[t[e + 11]] + j[t[e + 12]] + j[t[e + 13]] + j[t[e + 14]] + j[t[e + 15]];
431
431
  }
432
- const On = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), fe = {
433
- randomUUID: On
432
+ const Ln = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), me = {
433
+ randomUUID: Ln
434
434
  };
435
435
  function je(t, e, n) {
436
- if (fe.randomUUID && !e && !t)
437
- return fe.randomUUID();
436
+ if (me.randomUUID && !e && !t)
437
+ return me.randomUUID();
438
438
  t = t || {};
439
- const o = t.random || (t.rng || Tn)();
439
+ const o = t.random || (t.rng || Sn)();
440
440
  if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, e) {
441
441
  n = n || 0;
442
442
  for (let r = 0; r < 16; ++r)
443
443
  e[n + r] = o[r];
444
444
  return e;
445
445
  }
446
- return Sn(o);
446
+ return On(o);
447
447
  }
448
- var me = Object.prototype.hasOwnProperty;
449
- function pt(t, e) {
448
+ var ye = Object.prototype.hasOwnProperty;
449
+ function ht(t, e) {
450
450
  var n, o;
451
451
  if (t === e)
452
452
  return !0;
@@ -457,14 +457,14 @@ function pt(t, e) {
457
457
  return t.toString() === e.toString();
458
458
  if (n === Array) {
459
459
  if ((o = t.length) === e.length)
460
- for (; o-- && pt(t[o], e[o]); )
460
+ for (; o-- && ht(t[o], e[o]); )
461
461
  ;
462
462
  return o === -1;
463
463
  }
464
464
  if (!n || typeof t == "object") {
465
465
  o = 0;
466
466
  for (n in t)
467
- if (me.call(t, n) && ++o && !me.call(e, n) || !(n in e) || !pt(t[n], e[n]))
467
+ if (ye.call(t, n) && ++o && !ye.call(e, n) || !(n in e) || !ht(t[n], e[n]))
468
468
  return !1;
469
469
  return Object.keys(e).length === o;
470
470
  }
@@ -473,22 +473,22 @@ function pt(t, e) {
473
473
  }
474
474
  function qt() {
475
475
  }
476
- function Ln(t, e) {
476
+ function Yn(t, e) {
477
477
  return t != t ? e == e : t !== e || t && typeof t == "object" || typeof t == "function";
478
478
  }
479
- const wt = [];
480
- function se(t, e = qt) {
479
+ const yt = [];
480
+ function le(t, e = qt) {
481
481
  let n;
482
482
  const o = /* @__PURE__ */ new Set();
483
483
  function r(s) {
484
- if (Ln(t, s) && (t = s, n)) {
485
- const l = !wt.length;
484
+ if (Yn(t, s) && (t = s, n)) {
485
+ const l = !yt.length;
486
486
  for (const d of o)
487
- d[1](), wt.push(d, t);
487
+ d[1](), yt.push(d, t);
488
488
  if (l) {
489
- for (let d = 0; d < wt.length; d += 2)
490
- wt[d][0](wt[d + 1]);
491
- wt.length = 0;
489
+ for (let d = 0; d < yt.length; d += 2)
490
+ yt[d][0](yt[d + 1]);
491
+ yt.length = 0;
492
492
  }
493
493
  }
494
494
  }
@@ -503,8 +503,8 @@ function se(t, e = qt) {
503
503
  }
504
504
  return { set: r, update: i, subscribe: a };
505
505
  }
506
- const Yn = (t) => {
507
- const { subscribe: e, set: n } = se(null);
506
+ const _n = (t) => {
507
+ const { subscribe: e, set: n } = le(null);
508
508
  let o = null;
509
509
  return e((r) => o = r), t.observe(({ changes: r }) => {
510
510
  if (o) {
@@ -520,9 +520,9 @@ const Yn = (t) => {
520
520
  set: n
521
521
  };
522
522
  };
523
- var Pe = /* @__PURE__ */ ((t) => (t.EDIT = "EDIT", t.SELECT = "SELECT", t.NONE = "NONE", t))(Pe || {});
524
- const Wt = { selected: [] }, _n = (t, e = "EDIT") => {
525
- const { subscribe: n, set: o } = se(Wt);
523
+ var ze = /* @__PURE__ */ ((t) => (t.EDIT = "EDIT", t.SELECT = "SELECT", t.NONE = "NONE", t))(ze || {});
524
+ const Wt = { selected: [] }, Mn = (t, e = "EDIT") => {
525
+ const { subscribe: n, set: o } = le(Wt);
526
526
  let r = Wt;
527
527
  n((c) => r = c);
528
528
  const i = () => o(Wt), a = () => {
@@ -536,7 +536,7 @@ const Wt = { selected: [] }, _n = (t, e = "EDIT") => {
536
536
  }, l = (c, g) => {
537
537
  const h = t.getAnnotation(c);
538
538
  if (h) {
539
- const m = In(h, e);
539
+ const m = Bn(h, e);
540
540
  o(m === "EDIT" ? { selected: [{ id: c, editable: !0 }], pointerEvent: g } : m === "SELECT" ? { selected: [{ id: c }], pointerEvent: g } : { selected: [], pointerEvent: g });
541
541
  } else
542
542
  console.warn("Invalid selection: " + c);
@@ -563,21 +563,21 @@ const Wt = { selected: [] }, _n = (t, e = "EDIT") => {
563
563
  setSelected: d,
564
564
  subscribe: n
565
565
  };
566
- }, In = (t, e) => typeof e == "function" ? e(t) || "EDIT" : e || "EDIT", Mn = [];
566
+ }, Bn = (t, e) => typeof e == "function" ? e(t) || "EDIT" : e || "EDIT", Xn = [];
567
567
  for (let t = 0; t < 256; ++t)
568
- Mn.push((t + 256).toString(16).slice(1));
568
+ Xn.push((t + 256).toString(16).slice(1));
569
569
  typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
570
- const Bn = (t, e) => {
570
+ const Cn = (t, e) => {
571
571
  const n = new Set(t.bodies.map((o) => o.id));
572
572
  return e.bodies.filter((o) => !n.has(o.id));
573
- }, Xn = (t, e) => {
573
+ }, In = (t, e) => {
574
574
  const n = new Set(e.bodies.map((o) => o.id));
575
575
  return t.bodies.filter((o) => !n.has(o.id));
576
576
  }, Rn = (t, e) => e.bodies.map((n) => {
577
577
  const o = t.bodies.find((r) => r.id === n.id);
578
- return { newBody: n, oldBody: o && !pt(o, n) ? o : void 0 };
579
- }).filter(({ oldBody: n }) => n), Nn = (t, e) => !pt(t.target, e.target), ze = (t, e) => {
580
- const n = Bn(t, e), o = Xn(t, e), r = Rn(t, e);
578
+ return { newBody: n, oldBody: o && !ht(o, n) ? o : void 0 };
579
+ }).filter(({ oldBody: n }) => n), Nn = (t, e) => !ht(t.target, e.target), qe = (t, e) => {
580
+ const n = Cn(t, e), o = In(t, e), r = Rn(t, e);
581
581
  return {
582
582
  oldValue: t,
583
583
  newValue: e,
@@ -587,8 +587,8 @@ const Bn = (t, e) => {
587
587
  targetUpdated: Nn(t, e) ? { oldTarget: t.target, newTarget: e.target } : void 0
588
588
  };
589
589
  };
590
- var C = /* @__PURE__ */ ((t) => (t.LOCAL = "LOCAL", t.REMOTE = "REMOTE", t))(C || {});
591
- const kn = (t, e) => {
590
+ var D = /* @__PURE__ */ ((t) => (t.LOCAL = "LOCAL", t.REMOTE = "REMOTE", t))(D || {});
591
+ const Vn = (t, e) => {
592
592
  var n, o;
593
593
  const { changes: r, origin: i } = e;
594
594
  if (!(!t.options.origin || t.options.origin === i))
@@ -610,7 +610,7 @@ const kn = (t, e) => {
610
610
  return !!(Array.isArray(t.options.annotations) ? t.options.annotations : [t.options.annotations]).find((s) => a.has(s));
611
611
  } else
612
612
  return !0;
613
- }, Vn = (t, e) => {
613
+ }, kn = (t, e) => {
614
614
  const n = new Set((t.created || []).map((c) => c.id)), o = new Set((t.updated || []).map(({ newValue: c }) => c.id)), r = new Set((e.created || []).map((c) => c.id)), i = new Set((e.deleted || []).map((c) => c.id)), a = new Set((e.updated || []).map(({ oldValue: c }) => c.id)), s = new Set((e.updated || []).filter(({ oldValue: c }) => n.has(c.id) || o.has(c.id)).map(({ oldValue: c }) => c.id)), l = [
615
615
  ...(t.created || []).filter((c) => !i.has(c.id)).map((c) => a.has(c.id) ? e.updated.find(({ oldValue: g }) => g.id === c.id).newValue : c),
616
616
  ...e.created || []
@@ -622,19 +622,19 @@ const kn = (t, e) => {
622
622
  const { oldValue: g, newValue: h } = c;
623
623
  if (a.has(h.id)) {
624
624
  const m = e.updated.find((x) => x.oldValue.id === h.id).newValue;
625
- return ze(g, m);
625
+ return qe(g, m);
626
626
  } else
627
627
  return c;
628
628
  }),
629
629
  ...(e.updated || []).filter(({ oldValue: c }) => !s.has(c.id))
630
630
  ];
631
631
  return { created: l, deleted: d, updated: p };
632
- }, Dn = (t) => t.id !== void 0, Cn = () => {
632
+ }, Dn = (t) => t.id !== void 0, Un = () => {
633
633
  const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), n = [], o = (f, b = {}) => n.push({ onChange: f, options: b }), r = (f) => {
634
- const b = n.findIndex(($) => $.onChange == f);
634
+ const b = n.findIndex((w) => w.onChange == f);
635
635
  b > -1 && n.splice(b, 1);
636
636
  }, i = (f, b) => {
637
- const $ = {
637
+ const w = {
638
638
  origin: f,
639
639
  changes: {
640
640
  created: b.created || [],
@@ -643,91 +643,91 @@ const kn = (t, e) => {
643
643
  },
644
644
  state: [...t.values()]
645
645
  };
646
- n.forEach((T) => {
647
- kn(T, $) && T.onChange($);
646
+ n.forEach((S) => {
647
+ Vn(S, w) && S.onChange(w);
648
648
  });
649
- }, a = (f, b = C.LOCAL) => {
649
+ }, a = (f, b = D.LOCAL) => {
650
650
  if (t.get(f.id))
651
651
  throw Error(`Cannot add annotation ${f.id} - exists already`);
652
- t.set(f.id, f), f.bodies.forEach(($) => e.set($.id, f.id)), i(b, { created: [f] });
652
+ t.set(f.id, f), f.bodies.forEach((w) => e.set(w.id, f.id)), i(b, { created: [f] });
653
653
  }, s = (f, b) => {
654
- const $ = typeof f == "string" ? b : f, T = typeof f == "string" ? f : f.id, _ = t.get(T);
655
- if (_) {
656
- const X = ze(_, $);
657
- return T === $.id ? t.set(T, $) : (t.delete(T), t.set($.id, $)), _.bodies.forEach((J) => e.delete(J.id)), $.bodies.forEach((J) => e.set(J.id, $.id)), X;
654
+ const w = typeof f == "string" ? b : f, S = typeof f == "string" ? f : f.id, M = t.get(S);
655
+ if (M) {
656
+ const C = qe(M, w);
657
+ return S === w.id ? t.set(S, w) : (t.delete(S), t.set(w.id, w)), M.bodies.forEach((K) => e.delete(K.id)), w.bodies.forEach((K) => e.set(K.id, w.id)), C;
658
658
  } else
659
- console.warn(`Cannot update annotation ${T} - does not exist`);
660
- }, l = (f, b = C.LOCAL, $ = C.LOCAL) => {
661
- const T = Dn(b) ? $ : b, _ = s(f, b);
662
- _ && i(T, { updated: [_] });
663
- }, d = (f, b = C.LOCAL) => {
664
- const $ = f.reduce((T, _) => {
665
- const X = s(_);
666
- return X ? [...T, X] : T;
659
+ console.warn(`Cannot update annotation ${S} - does not exist`);
660
+ }, l = (f, b = D.LOCAL, w = D.LOCAL) => {
661
+ const S = Dn(b) ? w : b, M = s(f, b);
662
+ M && i(S, { updated: [M] });
663
+ }, d = (f, b = D.LOCAL) => {
664
+ const w = f.reduce((S, M) => {
665
+ const C = s(M);
666
+ return C ? [...S, C] : S;
667
667
  }, []);
668
- $.length > 0 && i(b, { updated: $ });
669
- }, p = (f, b = C.LOCAL) => {
670
- const $ = t.get(f.annotation);
671
- if ($) {
672
- const T = {
673
- ...$,
674
- bodies: [...$.bodies, f]
668
+ w.length > 0 && i(b, { updated: w });
669
+ }, p = (f, b = D.LOCAL) => {
670
+ const w = t.get(f.annotation);
671
+ if (w) {
672
+ const S = {
673
+ ...w,
674
+ bodies: [...w.bodies, f]
675
675
  };
676
- t.set($.id, T), e.set(f.id, T.id), i(b, { updated: [{
677
- oldValue: $,
678
- newValue: T,
676
+ t.set(w.id, S), e.set(f.id, S.id), i(b, { updated: [{
677
+ oldValue: w,
678
+ newValue: S,
679
679
  bodiesCreated: [f]
680
680
  }] });
681
681
  } else
682
682
  console.warn(`Attempt to add body to missing annotation: ${f.annotation}`);
683
- }, c = () => [...t.values()], g = (f = C.LOCAL) => {
683
+ }, c = () => [...t.values()], g = (f = D.LOCAL) => {
684
684
  const b = [...t.values()];
685
685
  t.clear(), e.clear(), i(f, { deleted: b });
686
- }, h = (f, b = !0, $ = C.LOCAL) => {
686
+ }, h = (f, b = !0, w = D.LOCAL) => {
687
687
  if (b) {
688
- const T = [...t.values()];
689
- t.clear(), e.clear(), f.forEach((_) => {
690
- t.set(_.id, _), _.bodies.forEach((X) => e.set(X.id, _.id));
691
- }), i($, { created: f, deleted: T });
688
+ const S = [...t.values()];
689
+ t.clear(), e.clear(), f.forEach((M) => {
690
+ t.set(M.id, M), M.bodies.forEach((C) => e.set(C.id, M.id));
691
+ }), i(w, { created: f, deleted: S });
692
692
  } else {
693
- const T = f.reduce((_, X) => {
694
- const J = t.get(X.id);
695
- return J ? [..._, J] : _;
693
+ const S = f.reduce((M, C) => {
694
+ const K = t.get(C.id);
695
+ return K ? [...M, K] : M;
696
696
  }, []);
697
- if (T.length > 0)
698
- throw Error(`Bulk insert would overwrite the following annotations: ${T.map((_) => _.id).join(", ")}`);
699
- f.forEach((_) => {
700
- t.set(_.id, _), _.bodies.forEach((X) => e.set(X.id, _.id));
701
- }), i($, { created: f });
697
+ if (S.length > 0)
698
+ throw Error(`Bulk insert would overwrite the following annotations: ${S.map((M) => M.id).join(", ")}`);
699
+ f.forEach((M) => {
700
+ t.set(M.id, M), M.bodies.forEach((C) => e.set(C.id, M.id));
701
+ }), i(w, { created: f });
702
702
  }
703
703
  }, m = (f) => {
704
- const b = typeof f == "string" ? f : f.id, $ = t.get(b);
705
- if ($)
706
- return t.delete(b), $.bodies.forEach((T) => e.delete(T.id)), $;
704
+ const b = typeof f == "string" ? f : f.id, w = t.get(b);
705
+ if (w)
706
+ return t.delete(b), w.bodies.forEach((S) => e.delete(S.id)), w;
707
707
  console.warn(`Attempt to delete missing annotation: ${b}`);
708
- }, x = (f, b = C.LOCAL) => {
709
- const $ = m(f);
710
- $ && i(b, { deleted: [$] });
711
- }, A = (f, b = C.LOCAL) => {
712
- const $ = f.reduce((T, _) => {
713
- const X = m(_);
714
- return X ? [...T, X] : T;
708
+ }, x = (f, b = D.LOCAL) => {
709
+ const w = m(f);
710
+ w && i(b, { deleted: [w] });
711
+ }, A = (f, b = D.LOCAL) => {
712
+ const w = f.reduce((S, M) => {
713
+ const C = m(M);
714
+ return C ? [...S, C] : S;
715
715
  }, []);
716
- $.length > 0 && i(b, { deleted: $ });
717
- }, w = (f, b = C.LOCAL) => {
718
- const $ = t.get(f.annotation);
719
- if ($) {
720
- const T = $.bodies.find((_) => _.id === f.id);
721
- if (T) {
722
- e.delete(T.id);
723
- const _ = {
724
- ...$,
725
- bodies: $.bodies.filter((X) => X.id !== f.id)
716
+ w.length > 0 && i(b, { deleted: w });
717
+ }, $ = (f, b = D.LOCAL) => {
718
+ const w = t.get(f.annotation);
719
+ if (w) {
720
+ const S = w.bodies.find((M) => M.id === f.id);
721
+ if (S) {
722
+ e.delete(S.id);
723
+ const M = {
724
+ ...w,
725
+ bodies: w.bodies.filter((C) => C.id !== f.id)
726
726
  };
727
- t.set($.id, _), i(b, { updated: [{
728
- oldValue: $,
729
- newValue: _,
730
- bodiesDeleted: [T]
727
+ t.set(w.id, M), i(b, { updated: [{
728
+ oldValue: w,
729
+ newValue: M,
730
+ bodiesDeleted: [S]
731
731
  }] });
732
732
  } else
733
733
  console.warn(`Attempt to delete missing body ${f.id} from annotation ${f.annotation}`);
@@ -739,47 +739,47 @@ const kn = (t, e) => {
739
739
  }, E = (f) => {
740
740
  const b = e.get(f);
741
741
  if (b) {
742
- const $ = y(b).bodies.find((T) => T.id === f);
743
- if ($)
744
- return $;
742
+ const w = y(b).bodies.find((S) => S.id === f);
743
+ if (w)
744
+ return w;
745
745
  console.error(`Store integrity error: body ${f} in index, but not in annotation`);
746
746
  } else
747
747
  console.warn(`Attempt to retrieve missing body: ${f}`);
748
748
  }, v = (f, b) => {
749
749
  if (f.annotation !== b.annotation)
750
750
  throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
751
- const $ = t.get(f.annotation);
752
- if ($) {
753
- const T = $.bodies.find((X) => X.id === f.id), _ = {
754
- ...$,
755
- bodies: $.bodies.map((X) => X.id === T.id ? b : X)
751
+ const w = t.get(f.annotation);
752
+ if (w) {
753
+ const S = w.bodies.find((C) => C.id === f.id), M = {
754
+ ...w,
755
+ bodies: w.bodies.map((C) => C.id === S.id ? b : C)
756
756
  };
757
- return t.set($.id, _), T.id !== b.id && (e.delete(T.id), e.set(b.id, _.id)), {
758
- oldValue: $,
759
- newValue: _,
760
- bodiesUpdated: [{ oldBody: T, newBody: b }]
757
+ return t.set(w.id, M), S.id !== b.id && (e.delete(S.id), e.set(b.id, M.id)), {
758
+ oldValue: w,
759
+ newValue: M,
760
+ bodiesUpdated: [{ oldBody: S, newBody: b }]
761
761
  };
762
762
  } else
763
763
  console.warn(`Attempt to add body to missing annotation ${f.annotation}`);
764
- }, B = (f, b, $ = C.LOCAL) => {
765
- const T = v(f, b);
766
- i($, { updated: [T] });
767
- }, R = (f, b = C.LOCAL) => {
768
- const $ = f.map((T) => v({ id: T.id, annotation: T.annotation }, T));
769
- i(b, { updated: $ });
770
- }, D = (f) => {
764
+ }, X = (f, b, w = D.LOCAL) => {
765
+ const S = v(f, b);
766
+ i(w, { updated: [S] });
767
+ }, I = (f, b = D.LOCAL) => {
768
+ const w = f.map((S) => v({ id: S.id, annotation: S.annotation }, S));
769
+ i(b, { updated: w });
770
+ }, V = (f) => {
771
771
  const b = t.get(f.annotation);
772
772
  if (b) {
773
- const $ = {
773
+ const w = {
774
774
  ...b,
775
775
  target: {
776
776
  ...b.target,
777
777
  ...f
778
778
  }
779
779
  };
780
- return t.set(b.id, $), {
780
+ return t.set(b.id, w), {
781
781
  oldValue: b,
782
- newValue: $,
782
+ newValue: w,
783
783
  targetUpdated: {
784
784
  oldTarget: b.target,
785
785
  newTarget: f
@@ -795,33 +795,33 @@ const kn = (t, e) => {
795
795
  bulkAddAnnotation: h,
796
796
  bulkDeleteAnnotation: A,
797
797
  bulkUpdateAnnotation: d,
798
- bulkUpdateBodies: R,
799
- bulkUpdateTargets: (f, b = C.LOCAL) => {
800
- const $ = f.map(D).filter((T) => T);
801
- $.length > 0 && i(b, { updated: $ });
798
+ bulkUpdateBodies: I,
799
+ bulkUpdateTargets: (f, b = D.LOCAL) => {
800
+ const w = f.map(V).filter((S) => S);
801
+ w.length > 0 && i(b, { updated: w });
802
802
  },
803
803
  clear: g,
804
804
  deleteAnnotation: x,
805
- deleteBody: w,
805
+ deleteBody: $,
806
806
  getAnnotation: y,
807
807
  getBody: E,
808
808
  observe: o,
809
809
  unobserve: r,
810
810
  updateAnnotation: l,
811
- updateBody: B,
812
- updateTarget: (f, b = C.LOCAL) => {
813
- const $ = D(f);
814
- $ && i(b, { updated: [$] });
811
+ updateBody: X,
812
+ updateTarget: (f, b = D.LOCAL) => {
813
+ const w = V(f);
814
+ w && i(b, { updated: [w] });
815
815
  }
816
816
  };
817
- }, Un = (t) => ({
817
+ }, Gn = (t) => ({
818
818
  ...t,
819
819
  subscribe: (e) => {
820
820
  const n = (o) => e(o.state);
821
821
  return t.observe(n), e(t.all()), () => t.unobserve(n);
822
822
  }
823
823
  });
824
- let Gn = () => ({
824
+ let Fn = () => ({
825
825
  emit(t, ...e) {
826
826
  let n = this.events[t] || [];
827
827
  for (let o = 0, r = n.length; o < r; o++)
@@ -836,23 +836,23 @@ let Gn = () => ({
836
836
  };
837
837
  }
838
838
  });
839
- const Fn = 250, Hn = (t) => {
840
- const e = Gn(), n = [];
839
+ const Hn = 250, Pn = (t) => {
840
+ const e = Fn(), n = [];
841
841
  let o = -1, r = !1, i = 0;
842
842
  const a = (h) => {
843
843
  if (!r) {
844
844
  const { changes: m } = h, x = performance.now();
845
- if (x - i > Fn)
845
+ if (x - i > Hn)
846
846
  n.splice(o + 1), n.push(m), o = n.length - 1;
847
847
  else {
848
848
  const A = n.length - 1;
849
- n[A] = Vn(n[A], m);
849
+ n[A] = kn(n[A], m);
850
850
  }
851
851
  i = x;
852
852
  }
853
853
  r = !1;
854
854
  };
855
- t.observe(a, { origin: C.LOCAL });
855
+ t.observe(a, { origin: D.LOCAL });
856
856
  const s = (h) => (h == null ? void 0 : h.length) > 0 && t.bulkDeleteAnnotation(h), l = (h) => (h == null ? void 0 : h.length) > 0 && t.bulkAddAnnotation(h, !1), d = (h) => (h == null ? void 0 : h.length) > 0 && t.bulkUpdateAnnotation(h.map(({ oldValue: m }) => m)), p = (h) => (h == null ? void 0 : h.length) > 0 && t.bulkUpdateAnnotation(h.map(({ newValue: m }) => m)), c = (h) => (h == null ? void 0 : h.length) > 0 && t.bulkAddAnnotation(h, !1), g = (h) => (h == null ? void 0 : h.length) > 0 && t.bulkDeleteAnnotation(h);
857
857
  return {
858
858
  canRedo: () => n.length - 1 > o,
@@ -875,84 +875,84 @@ const Fn = 250, Hn = (t) => {
875
875
  }
876
876
  };
877
877
  }, jn = () => {
878
- const { subscribe: t, set: e } = se([]);
878
+ const { subscribe: t, set: e } = le([]);
879
879
  return {
880
880
  subscribe: t,
881
881
  set: e
882
882
  };
883
- }, Pn = (t, e, n, o) => {
883
+ }, zn = (t, e, n, o) => {
884
884
  const { store: r, selection: i, hover: a, viewport: s } = t, l = /* @__PURE__ */ new Map();
885
885
  let d = [], p, c;
886
- const g = (w, y) => {
887
- l.has(w) ? l.get(w).push(y) : l.set(w, [y]);
888
- }, h = (w, y) => {
889
- const E = l.get(w);
886
+ const g = ($, y) => {
887
+ l.has($) ? l.get($).push(y) : l.set($, [y]);
888
+ }, h = ($, y) => {
889
+ const E = l.get($);
890
890
  E && E.indexOf(y) > 0 && E.splice(E.indexOf(y), 1);
891
- }, m = (w, y, E) => {
892
- l.has(w) && setTimeout(() => {
893
- l.get(w).forEach((v) => {
891
+ }, m = ($, y, E) => {
892
+ l.has($) && setTimeout(() => {
893
+ l.get($).forEach((v) => {
894
894
  if (n) {
895
- const B = Array.isArray(y) ? y.map((D) => n.serialize(D)) : n.serialize(y), R = E ? E instanceof PointerEvent ? E : n.serialize(E) : void 0;
896
- v(B, R);
895
+ const X = Array.isArray(y) ? y.map((V) => n.serialize(V)) : n.serialize(y), I = E ? E instanceof PointerEvent ? E : n.serialize(E) : void 0;
896
+ v(X, I);
897
897
  } else
898
898
  v(y, E);
899
899
  });
900
900
  }, 1);
901
901
  }, x = () => {
902
- const { selected: w } = i, y = w.map(({ id: E }) => r.getAnnotation(E));
902
+ const { selected: $ } = i, y = $.map(({ id: E }) => r.getAnnotation(E));
903
903
  y.forEach((E) => {
904
- const v = d.find((B) => B.id === E.id);
905
- (!v || !pt(v, E)) && m("updateAnnotation", E, v);
904
+ const v = d.find((X) => X.id === E.id);
905
+ (!v || !ht(v, E)) && m("updateAnnotation", E, v);
906
906
  }), d = d.map((E) => y.find(({ id: v }) => v === E.id) || E);
907
907
  };
908
- i.subscribe(({ selected: w }) => {
909
- if (!(d.length === 0 && w.length === 0)) {
910
- if (d.length === 0 && w.length > 0)
911
- d = w.map(({ id: y }) => r.getAnnotation(y));
912
- else if (d.length > 0 && w.length === 0)
908
+ i.subscribe(({ selected: $ }) => {
909
+ if (!(d.length === 0 && $.length === 0)) {
910
+ if (d.length === 0 && $.length > 0)
911
+ d = $.map(({ id: y }) => r.getAnnotation(y));
912
+ else if (d.length > 0 && $.length === 0)
913
913
  d.forEach((y) => {
914
914
  const E = r.getAnnotation(y.id);
915
- E && !pt(E, y) && m("updateAnnotation", E, y);
915
+ E && !ht(E, y) && m("updateAnnotation", E, y);
916
916
  }), d = [];
917
917
  else {
918
- const y = new Set(d.map((v) => v.id)), E = new Set(w.map(({ id: v }) => v));
918
+ const y = new Set(d.map((v) => v.id)), E = new Set($.map(({ id: v }) => v));
919
919
  d.filter((v) => !E.has(v.id)).forEach((v) => {
920
- const B = r.getAnnotation(v.id);
921
- B && !pt(B, v) && m("updateAnnotation", B, v);
920
+ const X = r.getAnnotation(v.id);
921
+ X && !ht(X, v) && m("updateAnnotation", X, v);
922
922
  }), d = [
923
923
  // Remove annotations that were deselected
924
924
  ...d.filter((v) => E.has(v.id)),
925
925
  // Add editable annotations that were selected
926
- ...w.filter(({ id: v }) => !y.has(v)).map(({ id: v }) => r.getAnnotation(v))
926
+ ...$.filter(({ id: v }) => !y.has(v)).map(({ id: v }) => r.getAnnotation(v))
927
927
  ];
928
928
  }
929
929
  m("selectionChanged", d);
930
930
  }
931
- }), a.subscribe((w) => {
932
- !p && w ? m("mouseEnterAnnotation", r.getAnnotation(w)) : p && !w ? m("mouseLeaveAnnotation", r.getAnnotation(p)) : p && w && (m("mouseLeaveAnnotation", r.getAnnotation(p)), m("mouseEnterAnnotation", r.getAnnotation(w))), p = w;
933
- }), s == null || s.subscribe((w) => m("viewportIntersect", w.map(r.getAnnotation))), r.observe((w) => {
931
+ }), a.subscribe(($) => {
932
+ !p && $ ? m("mouseEnterAnnotation", r.getAnnotation($)) : p && !$ ? m("mouseLeaveAnnotation", r.getAnnotation(p)) : p && $ && (m("mouseLeaveAnnotation", r.getAnnotation(p)), m("mouseEnterAnnotation", r.getAnnotation($))), p = $;
933
+ }), s == null || s.subscribe(($) => m("viewportIntersect", $.map(r.getAnnotation))), r.observe(($) => {
934
934
  o && (c && clearTimeout(c), c = setTimeout(x, 1e3));
935
- const { created: y, deleted: E } = w.changes;
936
- y.forEach((v) => m("createAnnotation", v)), E.forEach((v) => m("deleteAnnotation", v)), w.changes.updated.filter((v) => [
935
+ const { created: y, deleted: E } = $.changes;
936
+ y.forEach((v) => m("createAnnotation", v)), E.forEach((v) => m("deleteAnnotation", v)), $.changes.updated.filter((v) => [
937
937
  ...v.bodiesCreated || [],
938
938
  ...v.bodiesDeleted || [],
939
939
  ...v.bodiesUpdated || []
940
- ].length > 0).forEach(({ oldValue: v, newValue: B }) => {
941
- const R = d.find((D) => D.id === v.id) || v;
942
- d = d.map((D) => D.id === v.id ? B : D), m("updateAnnotation", B, R);
940
+ ].length > 0).forEach(({ oldValue: v, newValue: X }) => {
941
+ const I = d.find((V) => V.id === v.id) || v;
942
+ d = d.map((V) => V.id === v.id ? X : V), m("updateAnnotation", X, I);
943
943
  });
944
- }, { origin: C.LOCAL }), r.observe((w) => {
944
+ }, { origin: D.LOCAL }), r.observe(($) => {
945
945
  if (d) {
946
- const y = new Set(d.map((v) => v.id)), E = w.changes.updated.filter(({ newValue: v }) => y.has(v.id)).map(({ newValue: v }) => v);
947
- E.length > 0 && (d = d.map((v) => E.find((B) => B.id === v.id) || v));
946
+ const y = new Set(d.map((v) => v.id)), E = $.changes.updated.filter(({ newValue: v }) => y.has(v.id)).map(({ newValue: v }) => v);
947
+ E.length > 0 && (d = d.map((v) => E.find((X) => X.id === v.id) || v));
948
948
  }
949
- }, { origin: C.REMOTE });
950
- const A = (w) => (y) => {
951
- const { created: E, deleted: v, updated: B } = y;
952
- E.forEach((R) => m("createAnnotation", R)), v.forEach((R) => m("deleteAnnotation", R)), w ? B.forEach((R) => m("updateAnnotation", R.oldValue, R.newValue)) : B.forEach((R) => m("updateAnnotation", R.newValue, R.oldValue));
949
+ }, { origin: D.REMOTE });
950
+ const A = ($) => (y) => {
951
+ const { created: E, deleted: v, updated: X } = y;
952
+ E.forEach((I) => m("createAnnotation", I)), v.forEach((I) => m("deleteAnnotation", I)), $ ? X.forEach((I) => m("updateAnnotation", I.oldValue, I.newValue)) : X.forEach((I) => m("updateAnnotation", I.newValue, I.oldValue));
953
953
  };
954
954
  return e.on("undo", A(!0)), e.on("redo", A(!1)), { on: g, off: h, emit: m };
955
- }, zn = (t) => (e) => e.reduce((n, o) => {
955
+ }, qn = (t) => (e) => e.reduce((n, o) => {
956
956
  const { parsed: r, error: i } = t.parse(o);
957
957
  return i ? {
958
958
  parsed: n.parsed,
@@ -961,43 +961,43 @@ const Fn = 250, Hn = (t) => {
961
961
  parsed: [...n.parsed, r],
962
962
  failed: n.failed
963
963
  };
964
- }, { parsed: [], failed: [] }), qn = (t, e, n) => {
964
+ }, { parsed: [], failed: [] }), Wn = (t, e, n) => {
965
965
  const { store: o, selection: r } = t, i = (A) => {
966
966
  if (n) {
967
- const { parsed: w, error: y } = n.parse(A);
968
- w ? o.addAnnotation(w, C.REMOTE) : console.error(y);
967
+ const { parsed: $, error: y } = n.parse(A);
968
+ $ ? o.addAnnotation($, D.REMOTE) : console.error(y);
969
969
  } else
970
- o.addAnnotation(A, C.REMOTE);
970
+ o.addAnnotation(A, D.REMOTE);
971
971
  }, a = () => r.clear(), s = () => o.clear(), l = (A) => {
972
- const w = o.getAnnotation(A);
973
- return n && w ? n.serialize(w) : w;
972
+ const $ = o.getAnnotation(A);
973
+ return n && $ ? n.serialize($) : $;
974
974
  }, d = () => n ? o.all().map(n.serialize) : o.all(), p = () => {
975
975
  var A;
976
- const w = (((A = r.selected) == null ? void 0 : A.map((y) => y.id)) || []).map((y) => o.getAnnotation(y));
977
- return n ? w.map(n.serialize) : w;
978
- }, c = (A) => fetch(A).then((w) => w.json()).then((w) => (h(w), w)), g = (A) => {
976
+ const $ = (((A = r.selected) == null ? void 0 : A.map((y) => y.id)) || []).map((y) => o.getAnnotation(y));
977
+ return n ? $.map(n.serialize) : $;
978
+ }, c = (A) => fetch(A).then(($) => $.json()).then(($) => (h($), $)), g = (A) => {
979
979
  if (typeof A == "string") {
980
- const w = o.getAnnotation(A);
981
- return o.deleteAnnotation(A), n ? n.serialize(w) : w;
980
+ const $ = o.getAnnotation(A);
981
+ return o.deleteAnnotation(A), n ? n.serialize($) : $;
982
982
  } else {
983
- const w = n ? n.parse(A).parsed : A;
984
- return o.deleteAnnotation(w), A;
983
+ const $ = n ? n.parse(A).parsed : A;
984
+ return o.deleteAnnotation($), A;
985
985
  }
986
986
  }, h = (A) => {
987
987
  if (n) {
988
- const { parsed: w, failed: y } = zn(n)(A);
989
- y.length > 0 && console.warn(`Discarded ${y.length} invalid annotations`, y), o.bulkAddAnnotation(w, !0, C.REMOTE);
988
+ const { parsed: $, failed: y } = qn(n)(A);
989
+ y.length > 0 && console.warn(`Discarded ${y.length} invalid annotations`, y), o.bulkAddAnnotation($, !0, D.REMOTE);
990
990
  } else
991
- o.bulkAddAnnotation(A, !0, C.REMOTE);
991
+ o.bulkAddAnnotation(A, !0, D.REMOTE);
992
992
  }, m = (A) => {
993
993
  A ? r.setSelected(A) : r.clear();
994
994
  }, x = (A) => {
995
995
  if (n) {
996
- const w = n.parse(A).parsed, y = n.serialize(o.getAnnotation(w.id));
997
- return o.updateAnnotation(w), y;
996
+ const $ = n.parse(A).parsed, y = n.serialize(o.getAnnotation($.id));
997
+ return o.updateAnnotation($), y;
998
998
  } else {
999
- const w = o.getAnnotation(A.id);
1000
- return o.updateAnnotation(A), w;
999
+ const $ = o.getAnnotation(A.id);
1000
+ return o.updateAnnotation(A), $;
1001
1001
  }
1002
1002
  };
1003
1003
  return {
@@ -1018,7 +1018,7 @@ const Fn = 250, Hn = (t) => {
1018
1018
  updateAnnotation: x
1019
1019
  };
1020
1020
  };
1021
- let Wn = (t) => crypto.getRandomValues(new Uint8Array(t)), Kn = (t, e, n) => {
1021
+ let Kn = (t) => crypto.getRandomValues(new Uint8Array(t)), Jn = (t, e, n) => {
1022
1022
  let o = (2 << Math.log(t.length - 1) / Math.LN2) - 1, r = -~(1.6 * o * e / t.length);
1023
1023
  return (i = e) => {
1024
1024
  let a = "";
@@ -1029,8 +1029,8 @@ let Wn = (t) => crypto.getRandomValues(new Uint8Array(t)), Kn = (t, e, n) => {
1029
1029
  return a;
1030
1030
  }
1031
1031
  };
1032
- }, Jn = (t, e = 21) => Kn(t, e, Wn), Qn = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((e, n) => (n &= 63, n < 36 ? e += n.toString(36) : n < 62 ? e += (n - 26).toString(36).toUpperCase() : n > 62 ? e += "-" : e += "_", e), "");
1033
- const Zn = () => ({ isGuest: !0, id: Jn("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", 20)() }), to = (t) => {
1032
+ }, Zn = (t, e = 21) => Jn(t, e, Kn), Qn = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((e, n) => (n &= 63, n < 36 ? e += n.toString(36) : n < 62 ? e += (n - 26).toString(36).toUpperCase() : n > 62 ? e += "-" : e += "_", e), "");
1033
+ const to = () => ({ isGuest: !0, id: Zn("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", 20)() }), eo = (t) => {
1034
1034
  const e = JSON.stringify(t);
1035
1035
  let n = 0;
1036
1036
  for (let o = 0, r = e.length; o < r; o++) {
@@ -1038,10 +1038,10 @@ const Zn = () => ({ isGuest: !0, id: Jn("1234567890abcdefghijklmnopqrstuvwxyzABC
1038
1038
  n = (n << 5) - n + i, n |= 0;
1039
1039
  }
1040
1040
  return `${n}`;
1041
- }, eo = (t, e) => (Array.isArray(t) ? t : [t]).map((n) => {
1041
+ }, no = (t, e) => (Array.isArray(t) ? t : [t]).map((n) => {
1042
1042
  const { id: o, type: r, purpose: i, value: a, created: s, creator: l, ...d } = n;
1043
1043
  return {
1044
- id: o || `temp-${to(n)}`,
1044
+ id: o || `temp-${eo(n)}`,
1045
1045
  annotation: e,
1046
1046
  type: r,
1047
1047
  purpose: i,
@@ -1050,14 +1050,14 @@ const Zn = () => ({ isGuest: !0, id: Jn("1234567890abcdefghijklmnopqrstuvwxyzABC
1050
1050
  creator: l ? typeof l == "object" ? { ...l } : l : void 0,
1051
1051
  ...d
1052
1052
  };
1053
- }), no = (t) => t.map((e) => {
1053
+ }), oo = (t) => t.map((e) => {
1054
1054
  var n;
1055
1055
  const o = { ...e };
1056
1056
  return delete o.annotation, (n = o.id) != null && n.startsWith("temp-") && delete o.id, o;
1057
1057
  });
1058
1058
  Qn();
1059
- const $r = (t, e = !1) => ({ parse: (n) => oo(n, e), serialize: (n) => ro(n, t) }), oo = (t, e = !1) => {
1060
- const n = t.id || je(), { body: o, ...r } = t, i = eo(o, n), a = Array.isArray(t.target) ? t.target[0] : t.target, s = Array.isArray(a.selector) ? a.selector[0] : a.selector, l = s.type === "FragmentSelector" ? mn(s, e) : s.type === "SvgSelector" ? En(s) : void 0;
1059
+ const $r = (t, e = !1) => ({ parse: (n) => ro(n, e), serialize: (n) => io(n, t) }), ro = (t, e = !1) => {
1060
+ const n = t.id || je(), { body: o, ...r } = t, i = no(o, n), a = Array.isArray(t.target) ? t.target[0] : t.target, s = Array.isArray(a.selector) ? a.selector[0] : a.selector, l = s.type === "FragmentSelector" ? yn(s, e) : s.type === "SvgSelector" ? vn(s) : void 0;
1061
1061
  return l ? {
1062
1062
  parsed: {
1063
1063
  ...r,
@@ -1072,29 +1072,29 @@ const $r = (t, e = !1) => ({ parse: (n) => oo(n, e), serialize: (n) => ro(n, t)
1072
1072
  } : {
1073
1073
  error: Error(`Unknown selector type: ${s.type}`)
1074
1074
  };
1075
- }, ro = (t, e) => {
1076
- const n = t.target.selector, o = n.type == F.RECTANGLE ? yn(n.geometry) : vn(n);
1075
+ }, io = (t, e) => {
1076
+ const n = t.target.selector, o = n.type == G.RECTANGLE ? wn(n.geometry) : An(n);
1077
1077
  return {
1078
1078
  ...t,
1079
1079
  "@context": "http://www.w3.org/ns/anno.jsonld",
1080
1080
  id: t.id,
1081
1081
  type: "Annotation",
1082
- body: no(t.bodies),
1082
+ body: oo(t.bodies),
1083
1083
  target: {
1084
1084
  source: e,
1085
1085
  selector: o
1086
1086
  }
1087
1087
  };
1088
1088
  };
1089
- function ye(t, e, n) {
1089
+ function we(t, e, n) {
1090
1090
  const o = t.slice();
1091
1091
  return o[11] = e[n], o[13] = n, o;
1092
1092
  }
1093
- function we(t) {
1093
+ function $e(t) {
1094
1094
  let e, n, o, r, i;
1095
1095
  return {
1096
1096
  c() {
1097
- e = N("rect"), u(e, "class", "a9s-corner-handle"), u(e, "x", n = /*point*/
1097
+ e = R("rect"), u(e, "class", "a9s-corner-handle"), u(e, "x", n = /*point*/
1098
1098
  t[11][0] - /*handleSize*/
1099
1099
  t[3] / 2), u(e, "y", o = /*point*/
1100
1100
  t[11][1] - /*handleSize*/
@@ -1111,7 +1111,7 @@ function we(t) {
1111
1111
  );
1112
1112
  },
1113
1113
  m(a, s) {
1114
- Y(a, e, s), r || (i = z(e, "pointerdown", function() {
1114
+ _(a, e, s), r || (i = z(e, "pointerdown", function() {
1115
1115
  H(
1116
1116
  /*grab*/
1117
1117
  t[10](O(
@@ -1146,37 +1146,37 @@ function we(t) {
1146
1146
  );
1147
1147
  },
1148
1148
  d(a) {
1149
- a && L(e), r = !1, i();
1149
+ a && Y(e), r = !1, i();
1150
1150
  }
1151
1151
  };
1152
1152
  }
1153
- function io(t) {
1153
+ function ao(t) {
1154
1154
  let e, n, o, r, i, a, s, l, d, p, c = (
1155
1155
  /*geom*/
1156
1156
  t[4].points
1157
1157
  ), g = [];
1158
1158
  for (let h = 0; h < c.length; h += 1)
1159
- g[h] = we(ye(t, c, h));
1159
+ g[h] = $e(we(t, c, h));
1160
1160
  return {
1161
1161
  c() {
1162
- e = N("polygon"), r = tt(), i = N("polygon"), s = tt();
1162
+ e = R("polygon"), r = tt(), i = R("polygon"), s = tt();
1163
1163
  for (let h = 0; h < g.length; h += 1)
1164
1164
  g[h].c();
1165
1165
  l = at(), u(e, "class", "a9s-outer"), u(e, "style", n = /*computedStyle*/
1166
1166
  t[1] ? "display:none;" : void 0), u(e, "points", o = /*geom*/
1167
- t[4].points.map($e).join(" ")), u(i, "class", "a9s-inner a9s-shape-handle"), u(
1167
+ t[4].points.map(xe).join(" ")), u(i, "class", "a9s-inner a9s-shape-handle"), u(
1168
1168
  i,
1169
1169
  "style",
1170
1170
  /*computedStyle*/
1171
1171
  t[1]
1172
1172
  ), u(i, "points", a = /*geom*/
1173
- t[4].points.map(xe).join(" "));
1173
+ t[4].points.map(be).join(" "));
1174
1174
  },
1175
1175
  m(h, m) {
1176
- Y(h, e, m), Y(h, r, m), Y(h, i, m), Y(h, s, m);
1176
+ _(h, e, m), _(h, r, m), _(h, i, m), _(h, s, m);
1177
1177
  for (let x = 0; x < g.length; x += 1)
1178
1178
  g[x] && g[x].m(h, m);
1179
- Y(h, l, m), d || (p = [
1179
+ _(h, l, m), d || (p = [
1180
1180
  z(e, "pointerdown", function() {
1181
1181
  H(
1182
1182
  /*grab*/
@@ -1196,7 +1196,7 @@ function io(t) {
1196
1196
  2 && n !== (n = /*computedStyle*/
1197
1197
  t[1] ? "display:none;" : void 0) && u(e, "style", n), m & /*geom*/
1198
1198
  16 && o !== (o = /*geom*/
1199
- t[4].points.map($e).join(" ")) && u(e, "points", o), m & /*computedStyle*/
1199
+ t[4].points.map(xe).join(" ")) && u(e, "points", o), m & /*computedStyle*/
1200
1200
  2 && u(
1201
1201
  i,
1202
1202
  "style",
@@ -1204,14 +1204,14 @@ function io(t) {
1204
1204
  t[1]
1205
1205
  ), m & /*geom*/
1206
1206
  16 && a !== (a = /*geom*/
1207
- t[4].points.map(xe).join(" ")) && u(i, "points", a), m & /*geom, handleSize, grab, Handle*/
1207
+ t[4].points.map(be).join(" ")) && u(i, "points", a), m & /*geom, handleSize, grab, Handle*/
1208
1208
  1048) {
1209
1209
  c = /*geom*/
1210
1210
  t[4].points;
1211
1211
  let x;
1212
1212
  for (x = 0; x < c.length; x += 1) {
1213
- const A = ye(t, c, x);
1214
- g[x] ? g[x].p(A, m) : (g[x] = we(A), g[x].c(), g[x].m(l.parentNode, l));
1213
+ const A = we(t, c, x);
1214
+ g[x] ? g[x].p(A, m) : (g[x] = $e(A), g[x].c(), g[x].m(l.parentNode, l));
1215
1215
  }
1216
1216
  for (; x < g.length; x += 1)
1217
1217
  g[x].d(1);
@@ -1219,13 +1219,13 @@ function io(t) {
1219
1219
  }
1220
1220
  },
1221
1221
  d(h) {
1222
- h && L(e), h && L(r), h && L(i), h && L(s), re(g, h), h && L(l), d = !1, it(p);
1222
+ h && Y(e), h && Y(r), h && Y(i), h && Y(s), ie(g, h), h && Y(l), d = !1, it(p);
1223
1223
  }
1224
1224
  };
1225
1225
  }
1226
- function ao(t) {
1226
+ function so(t) {
1227
1227
  let e, n;
1228
- return e = new We({
1228
+ return e = new Ke({
1229
1229
  props: {
1230
1230
  shape: (
1231
1231
  /*shape*/
@@ -1241,7 +1241,7 @@ function ao(t) {
1241
1241
  ),
1242
1242
  $$slots: {
1243
1243
  default: [
1244
- io,
1244
+ ao,
1245
1245
  ({ grab: o }) => ({ 10: o }),
1246
1246
  ({ grab: o }) => o ? 1024 : 0
1247
1247
  ]
@@ -1262,10 +1262,10 @@ function ao(t) {
1262
1262
  t[9]
1263
1263
  ), {
1264
1264
  c() {
1265
- gt(e.$$.fragment);
1265
+ pt(e.$$.fragment);
1266
1266
  },
1267
1267
  m(o, r) {
1268
- ct(e, o, r), n = !0;
1268
+ dt(e, o, r), n = !0;
1269
1269
  },
1270
1270
  p(o, [r]) {
1271
1271
  const i = {};
@@ -1277,33 +1277,33 @@ function ao(t) {
1277
1277
  17434 && (i.$$scope = { dirty: r, ctx: o }), e.$set(i);
1278
1278
  },
1279
1279
  i(o) {
1280
- n || (k(e.$$.fragment, o), n = !0);
1280
+ n || (N(e.$$.fragment, o), n = !0);
1281
1281
  },
1282
1282
  o(o) {
1283
- V(e.$$.fragment, o), n = !1;
1283
+ k(e.$$.fragment, o), n = !1;
1284
1284
  },
1285
1285
  d(o) {
1286
- ut(e, o);
1286
+ ct(e, o);
1287
1287
  }
1288
1288
  };
1289
1289
  }
1290
- const $e = (t) => t.join(","), xe = (t) => t.join(",");
1291
- function so(t, e, n) {
1290
+ const xe = (t) => t.join(","), be = (t) => t.join(",");
1291
+ function lo(t, e, n) {
1292
1292
  let o, r, { shape: i } = e, { computedStyle: a = void 0 } = e, { transform: s } = e, { viewportScale: l = 1 } = e;
1293
1293
  const d = (h, m, x) => {
1294
1294
  let A;
1295
1295
  m === O.SHAPE ? A = h.geometry.points.map(([y, E]) => [y + x[0], E + x[1]]) : A = h.geometry.points.map(([y, E], v) => m === O(v) ? [y + x[0], E + x[1]] : [y, E]);
1296
- const w = Gt(A);
1297
- return { ...h, geometry: { points: A, bounds: w } };
1296
+ const $ = Gt(A);
1297
+ return { ...h, geometry: { points: A, bounds: $ } };
1298
1298
  };
1299
1299
  function p(h) {
1300
- vt.call(this, t, h);
1300
+ Et.call(this, t, h);
1301
1301
  }
1302
1302
  function c(h) {
1303
- vt.call(this, t, h);
1303
+ Et.call(this, t, h);
1304
1304
  }
1305
1305
  function g(h) {
1306
- vt.call(this, t, h);
1306
+ Et.call(this, t, h);
1307
1307
  }
1308
1308
  return t.$$set = (h) => {
1309
1309
  "shape" in h && n(0, i = h.shape), "computedStyle" in h && n(1, a = h.computedStyle), "transform" in h && n(2, s = h.transform), "viewportScale" in h && n(6, l = h.viewportScale);
@@ -1324,9 +1324,9 @@ function so(t, e, n) {
1324
1324
  g
1325
1325
  ];
1326
1326
  }
1327
- class lo extends nt {
1327
+ class co extends nt {
1328
1328
  constructor(e) {
1329
- super(), et(this, e, so, ao, K, {
1329
+ super(), et(this, e, lo, so, W, {
1330
1330
  shape: 0,
1331
1331
  computedStyle: 1,
1332
1332
  transform: 2,
@@ -1334,11 +1334,11 @@ class lo extends nt {
1334
1334
  });
1335
1335
  }
1336
1336
  }
1337
- function co(t) {
1338
- let e, n, o, r, i, a, s, l, d, p, c, g, h, m, x, A, w, y, E, v, B, R, D, f, b, $, T, _, X, J, ft, mt, St, W, I, q, j, U, st, lt, Ht, Q, Bt, Xt, jt, Z, Rt, Nt, Pt, de;
1337
+ function uo(t) {
1338
+ let e, n, o, r, i, a, s, l, d, p, c, g, h, m, x, A, $, y, E, v, X, I, V, f, b, w, S, M, C, K, gt, ft, Tt, L, q, F, Q, P, st, Bt, Ht, J, Xt, Ct, Pt, Z, It, Rt, jt, ce;
1339
1339
  return {
1340
1340
  c() {
1341
- e = N("rect"), s = tt(), l = N("rect"), h = tt(), m = N("rect"), y = tt(), E = N("rect"), D = tt(), f = N("rect"), _ = tt(), X = N("rect"), St = tt(), W = N("rect"), j = tt(), U = N("rect"), Ht = tt(), Q = N("rect"), jt = tt(), Z = N("rect"), u(e, "class", "a9s-outer"), u(e, "style", n = /*computedStyle*/
1341
+ e = R("rect"), s = tt(), l = R("rect"), h = tt(), m = R("rect"), y = tt(), E = R("rect"), V = tt(), f = R("rect"), M = tt(), C = R("rect"), Tt = tt(), L = R("rect"), Q = tt(), P = R("rect"), Ht = tt(), J = R("rect"), Pt = tt(), Z = R("rect"), u(e, "class", "a9s-outer"), u(e, "style", n = /*computedStyle*/
1342
1342
  t[1] ? "display:none;" : void 0), u(e, "x", o = /*geom*/
1343
1343
  t[4].x), u(e, "y", r = /*geom*/
1344
1344
  t[4].y), u(e, "width", i = /*geom*/
@@ -1354,66 +1354,66 @@ function co(t) {
1354
1354
  t[4].w), u(l, "height", g = /*geom*/
1355
1355
  t[4].h), u(m, "class", "a9s-edge-handle a9s-edge-handle-top"), u(m, "x", x = /*geom*/
1356
1356
  t[4].x), u(m, "y", A = /*geom*/
1357
- t[4].y), u(m, "height", 1), u(m, "width", w = /*geom*/
1357
+ t[4].y), u(m, "height", 1), u(m, "width", $ = /*geom*/
1358
1358
  t[4].w), u(E, "class", "a9s-edge-handle a9s-edge-handle-right"), u(E, "x", v = /*geom*/
1359
1359
  t[4].x + /*geom*/
1360
- t[4].w), u(E, "y", B = /*geom*/
1361
- t[4].y), u(E, "height", R = /*geom*/
1360
+ t[4].w), u(E, "y", X = /*geom*/
1361
+ t[4].y), u(E, "height", I = /*geom*/
1362
1362
  t[4].h), u(E, "width", 1), u(f, "class", "a9s-edge-handle a9s-edge-handle-bottom"), u(f, "x", b = /*geom*/
1363
- t[4].x), u(f, "y", $ = /*geom*/
1363
+ t[4].x), u(f, "y", w = /*geom*/
1364
1364
  t[4].y + /*geom*/
1365
- t[4].h), u(f, "height", 1), u(f, "width", T = /*geom*/
1366
- t[4].w), u(X, "class", "a9s-edge-handle a9s-edge-handle-left"), u(X, "x", J = /*geom*/
1367
- t[4].x), u(X, "y", ft = /*geom*/
1368
- t[4].y), u(X, "height", mt = /*geom*/
1369
- t[4].h), u(X, "width", 1), u(W, "class", "a9s-corner-handle a9s-corner-handle-topleft"), u(W, "x", I = /*geom*/
1365
+ t[4].h), u(f, "height", 1), u(f, "width", S = /*geom*/
1366
+ t[4].w), u(C, "class", "a9s-edge-handle a9s-edge-handle-left"), u(C, "x", K = /*geom*/
1367
+ t[4].x), u(C, "y", gt = /*geom*/
1368
+ t[4].y), u(C, "height", ft = /*geom*/
1369
+ t[4].h), u(C, "width", 1), u(L, "class", "a9s-corner-handle a9s-corner-handle-topleft"), u(L, "x", q = /*geom*/
1370
1370
  t[4].x - /*handleSize*/
1371
- t[3] / 2), u(W, "y", q = /*geom*/
1371
+ t[3] / 2), u(L, "y", F = /*geom*/
1372
1372
  t[4].y - /*handleSize*/
1373
1373
  t[3] / 2), u(
1374
- W,
1374
+ L,
1375
1375
  "height",
1376
1376
  /*handleSize*/
1377
1377
  t[3]
1378
1378
  ), u(
1379
- W,
1379
+ L,
1380
1380
  "width",
1381
1381
  /*handleSize*/
1382
1382
  t[3]
1383
- ), u(U, "class", "a9s-corner-handle a9s-corner-handle-topright"), u(U, "x", st = /*geom*/
1383
+ ), u(P, "class", "a9s-corner-handle a9s-corner-handle-topright"), u(P, "x", st = /*geom*/
1384
1384
  t[4].x + /*geom*/
1385
1385
  t[4].w - /*handleSize*/
1386
- t[3] / 2), u(U, "y", lt = /*geom*/
1386
+ t[3] / 2), u(P, "y", Bt = /*geom*/
1387
1387
  t[4].y - /*handleSize*/
1388
1388
  t[3] / 2), u(
1389
- U,
1389
+ P,
1390
1390
  "height",
1391
1391
  /*handleSize*/
1392
1392
  t[3]
1393
1393
  ), u(
1394
- U,
1394
+ P,
1395
1395
  "width",
1396
1396
  /*handleSize*/
1397
1397
  t[3]
1398
- ), u(Q, "class", "a9s-corner-handle a9s-corner-handle-bottomright"), u(Q, "x", Bt = /*geom*/
1398
+ ), u(J, "class", "a9s-corner-handle a9s-corner-handle-bottomright"), u(J, "x", Xt = /*geom*/
1399
1399
  t[4].x + /*geom*/
1400
1400
  t[4].w - /*handleSize*/
1401
- t[3] / 2), u(Q, "y", Xt = /*geom*/
1401
+ t[3] / 2), u(J, "y", Ct = /*geom*/
1402
1402
  t[4].y + /*geom*/
1403
1403
  t[4].h - /*handleSize*/
1404
1404
  t[3] / 2), u(
1405
- Q,
1405
+ J,
1406
1406
  "height",
1407
1407
  /*handleSize*/
1408
1408
  t[3]
1409
1409
  ), u(
1410
- Q,
1410
+ J,
1411
1411
  "width",
1412
1412
  /*handleSize*/
1413
1413
  t[3]
1414
- ), u(Z, "class", "a9s-corner-handle a9s-corner-handle-bottomleft"), u(Z, "x", Rt = /*geom*/
1414
+ ), u(Z, "class", "a9s-corner-handle a9s-corner-handle-bottomleft"), u(Z, "x", It = /*geom*/
1415
1415
  t[4].x - /*handleSize*/
1416
- t[3] / 2), u(Z, "y", Nt = /*geom*/
1416
+ t[3] / 2), u(Z, "y", Rt = /*geom*/
1417
1417
  t[4].y + /*geom*/
1418
1418
  t[4].h - /*handleSize*/
1419
1419
  t[3] / 2), u(
@@ -1428,8 +1428,8 @@ function co(t) {
1428
1428
  t[3]
1429
1429
  );
1430
1430
  },
1431
- m(M, S) {
1432
- Y(M, e, S), Y(M, s, S), Y(M, l, S), Y(M, h, S), Y(M, m, S), Y(M, y, S), Y(M, E, S), Y(M, D, S), Y(M, f, S), Y(M, _, S), Y(M, X, S), Y(M, St, S), Y(M, W, S), Y(M, j, S), Y(M, U, S), Y(M, Ht, S), Y(M, Q, S), Y(M, jt, S), Y(M, Z, S), Pt || (de = [
1431
+ m(B, T) {
1432
+ _(B, e, T), _(B, s, T), _(B, l, T), _(B, h, T), _(B, m, T), _(B, y, T), _(B, E, T), _(B, V, T), _(B, f, T), _(B, M, T), _(B, C, T), _(B, Tt, T), _(B, L, T), _(B, Q, T), _(B, P, T), _(B, Ht, T), _(B, J, T), _(B, Pt, T), _(B, Z, T), jt || (ce = [
1433
1433
  z(e, "pointerdown", function() {
1434
1434
  H(
1435
1435
  /*grab*/
@@ -1460,25 +1460,25 @@ function co(t) {
1460
1460
  t[10](O.BOTTOM)
1461
1461
  ) && t[10](O.BOTTOM).apply(this, arguments);
1462
1462
  }),
1463
- z(X, "pointerdown", function() {
1463
+ z(C, "pointerdown", function() {
1464
1464
  H(
1465
1465
  /*grab*/
1466
1466
  t[10](O.LEFT)
1467
1467
  ) && t[10](O.LEFT).apply(this, arguments);
1468
1468
  }),
1469
- z(W, "pointerdown", function() {
1469
+ z(L, "pointerdown", function() {
1470
1470
  H(
1471
1471
  /*grab*/
1472
1472
  t[10](O.TOP_LEFT)
1473
1473
  ) && t[10](O.TOP_LEFT).apply(this, arguments);
1474
1474
  }),
1475
- z(U, "pointerdown", function() {
1475
+ z(P, "pointerdown", function() {
1476
1476
  H(
1477
1477
  /*grab*/
1478
1478
  t[10](O.TOP_RIGHT)
1479
1479
  ) && t[10](O.TOP_RIGHT).apply(this, arguments);
1480
1480
  }),
1481
- z(Q, "pointerdown", function() {
1481
+ z(J, "pointerdown", function() {
1482
1482
  H(
1483
1483
  /*grab*/
1484
1484
  t[10](O.BOTTOM_RIGHT)
@@ -1490,130 +1490,130 @@ function co(t) {
1490
1490
  t[10](O.BOTTOM_LEFT)
1491
1491
  ) && t[10](O.BOTTOM_LEFT).apply(this, arguments);
1492
1492
  })
1493
- ], Pt = !0);
1493
+ ], jt = !0);
1494
1494
  },
1495
- p(M, S) {
1496
- t = M, S & /*computedStyle*/
1495
+ p(B, T) {
1496
+ t = B, T & /*computedStyle*/
1497
1497
  2 && n !== (n = /*computedStyle*/
1498
- t[1] ? "display:none;" : void 0) && u(e, "style", n), S & /*geom*/
1498
+ t[1] ? "display:none;" : void 0) && u(e, "style", n), T & /*geom*/
1499
1499
  16 && o !== (o = /*geom*/
1500
- t[4].x) && u(e, "x", o), S & /*geom*/
1500
+ t[4].x) && u(e, "x", o), T & /*geom*/
1501
1501
  16 && r !== (r = /*geom*/
1502
- t[4].y) && u(e, "y", r), S & /*geom*/
1502
+ t[4].y) && u(e, "y", r), T & /*geom*/
1503
1503
  16 && i !== (i = /*geom*/
1504
- t[4].w) && u(e, "width", i), S & /*geom*/
1504
+ t[4].w) && u(e, "width", i), T & /*geom*/
1505
1505
  16 && a !== (a = /*geom*/
1506
- t[4].h) && u(e, "height", a), S & /*computedStyle*/
1506
+ t[4].h) && u(e, "height", a), T & /*computedStyle*/
1507
1507
  2 && u(
1508
1508
  l,
1509
1509
  "style",
1510
1510
  /*computedStyle*/
1511
1511
  t[1]
1512
- ), S & /*geom*/
1512
+ ), T & /*geom*/
1513
1513
  16 && d !== (d = /*geom*/
1514
- t[4].x) && u(l, "x", d), S & /*geom*/
1514
+ t[4].x) && u(l, "x", d), T & /*geom*/
1515
1515
  16 && p !== (p = /*geom*/
1516
- t[4].y) && u(l, "y", p), S & /*geom*/
1516
+ t[4].y) && u(l, "y", p), T & /*geom*/
1517
1517
  16 && c !== (c = /*geom*/
1518
- t[4].w) && u(l, "width", c), S & /*geom*/
1518
+ t[4].w) && u(l, "width", c), T & /*geom*/
1519
1519
  16 && g !== (g = /*geom*/
1520
- t[4].h) && u(l, "height", g), S & /*geom*/
1520
+ t[4].h) && u(l, "height", g), T & /*geom*/
1521
1521
  16 && x !== (x = /*geom*/
1522
- t[4].x) && u(m, "x", x), S & /*geom*/
1522
+ t[4].x) && u(m, "x", x), T & /*geom*/
1523
1523
  16 && A !== (A = /*geom*/
1524
- t[4].y) && u(m, "y", A), S & /*geom*/
1525
- 16 && w !== (w = /*geom*/
1526
- t[4].w) && u(m, "width", w), S & /*geom*/
1524
+ t[4].y) && u(m, "y", A), T & /*geom*/
1525
+ 16 && $ !== ($ = /*geom*/
1526
+ t[4].w) && u(m, "width", $), T & /*geom*/
1527
1527
  16 && v !== (v = /*geom*/
1528
1528
  t[4].x + /*geom*/
1529
- t[4].w) && u(E, "x", v), S & /*geom*/
1530
- 16 && B !== (B = /*geom*/
1531
- t[4].y) && u(E, "y", B), S & /*geom*/
1532
- 16 && R !== (R = /*geom*/
1533
- t[4].h) && u(E, "height", R), S & /*geom*/
1529
+ t[4].w) && u(E, "x", v), T & /*geom*/
1530
+ 16 && X !== (X = /*geom*/
1531
+ t[4].y) && u(E, "y", X), T & /*geom*/
1532
+ 16 && I !== (I = /*geom*/
1533
+ t[4].h) && u(E, "height", I), T & /*geom*/
1534
1534
  16 && b !== (b = /*geom*/
1535
- t[4].x) && u(f, "x", b), S & /*geom*/
1536
- 16 && $ !== ($ = /*geom*/
1535
+ t[4].x) && u(f, "x", b), T & /*geom*/
1536
+ 16 && w !== (w = /*geom*/
1537
1537
  t[4].y + /*geom*/
1538
- t[4].h) && u(f, "y", $), S & /*geom*/
1539
- 16 && T !== (T = /*geom*/
1540
- t[4].w) && u(f, "width", T), S & /*geom*/
1541
- 16 && J !== (J = /*geom*/
1542
- t[4].x) && u(X, "x", J), S & /*geom*/
1538
+ t[4].h) && u(f, "y", w), T & /*geom*/
1539
+ 16 && S !== (S = /*geom*/
1540
+ t[4].w) && u(f, "width", S), T & /*geom*/
1541
+ 16 && K !== (K = /*geom*/
1542
+ t[4].x) && u(C, "x", K), T & /*geom*/
1543
+ 16 && gt !== (gt = /*geom*/
1544
+ t[4].y) && u(C, "y", gt), T & /*geom*/
1543
1545
  16 && ft !== (ft = /*geom*/
1544
- t[4].y) && u(X, "y", ft), S & /*geom*/
1545
- 16 && mt !== (mt = /*geom*/
1546
- t[4].h) && u(X, "height", mt), S & /*geom, handleSize*/
1547
- 24 && I !== (I = /*geom*/
1548
- t[4].x - /*handleSize*/
1549
- t[3] / 2) && u(W, "x", I), S & /*geom, handleSize*/
1546
+ t[4].h) && u(C, "height", ft), T & /*geom, handleSize*/
1550
1547
  24 && q !== (q = /*geom*/
1548
+ t[4].x - /*handleSize*/
1549
+ t[3] / 2) && u(L, "x", q), T & /*geom, handleSize*/
1550
+ 24 && F !== (F = /*geom*/
1551
1551
  t[4].y - /*handleSize*/
1552
- t[3] / 2) && u(W, "y", q), S & /*handleSize*/
1552
+ t[3] / 2) && u(L, "y", F), T & /*handleSize*/
1553
1553
  8 && u(
1554
- W,
1554
+ L,
1555
1555
  "height",
1556
1556
  /*handleSize*/
1557
1557
  t[3]
1558
- ), S & /*handleSize*/
1558
+ ), T & /*handleSize*/
1559
1559
  8 && u(
1560
- W,
1560
+ L,
1561
1561
  "width",
1562
1562
  /*handleSize*/
1563
1563
  t[3]
1564
- ), S & /*geom, handleSize*/
1564
+ ), T & /*geom, handleSize*/
1565
1565
  24 && st !== (st = /*geom*/
1566
1566
  t[4].x + /*geom*/
1567
1567
  t[4].w - /*handleSize*/
1568
- t[3] / 2) && u(U, "x", st), S & /*geom, handleSize*/
1569
- 24 && lt !== (lt = /*geom*/
1568
+ t[3] / 2) && u(P, "x", st), T & /*geom, handleSize*/
1569
+ 24 && Bt !== (Bt = /*geom*/
1570
1570
  t[4].y - /*handleSize*/
1571
- t[3] / 2) && u(U, "y", lt), S & /*handleSize*/
1571
+ t[3] / 2) && u(P, "y", Bt), T & /*handleSize*/
1572
1572
  8 && u(
1573
- U,
1573
+ P,
1574
1574
  "height",
1575
1575
  /*handleSize*/
1576
1576
  t[3]
1577
- ), S & /*handleSize*/
1577
+ ), T & /*handleSize*/
1578
1578
  8 && u(
1579
- U,
1579
+ P,
1580
1580
  "width",
1581
1581
  /*handleSize*/
1582
1582
  t[3]
1583
- ), S & /*geom, handleSize*/
1584
- 24 && Bt !== (Bt = /*geom*/
1583
+ ), T & /*geom, handleSize*/
1584
+ 24 && Xt !== (Xt = /*geom*/
1585
1585
  t[4].x + /*geom*/
1586
1586
  t[4].w - /*handleSize*/
1587
- t[3] / 2) && u(Q, "x", Bt), S & /*geom, handleSize*/
1588
- 24 && Xt !== (Xt = /*geom*/
1587
+ t[3] / 2) && u(J, "x", Xt), T & /*geom, handleSize*/
1588
+ 24 && Ct !== (Ct = /*geom*/
1589
1589
  t[4].y + /*geom*/
1590
1590
  t[4].h - /*handleSize*/
1591
- t[3] / 2) && u(Q, "y", Xt), S & /*handleSize*/
1591
+ t[3] / 2) && u(J, "y", Ct), T & /*handleSize*/
1592
1592
  8 && u(
1593
- Q,
1593
+ J,
1594
1594
  "height",
1595
1595
  /*handleSize*/
1596
1596
  t[3]
1597
- ), S & /*handleSize*/
1597
+ ), T & /*handleSize*/
1598
1598
  8 && u(
1599
- Q,
1599
+ J,
1600
1600
  "width",
1601
1601
  /*handleSize*/
1602
1602
  t[3]
1603
- ), S & /*geom, handleSize*/
1604
- 24 && Rt !== (Rt = /*geom*/
1603
+ ), T & /*geom, handleSize*/
1604
+ 24 && It !== (It = /*geom*/
1605
1605
  t[4].x - /*handleSize*/
1606
- t[3] / 2) && u(Z, "x", Rt), S & /*geom, handleSize*/
1607
- 24 && Nt !== (Nt = /*geom*/
1606
+ t[3] / 2) && u(Z, "x", It), T & /*geom, handleSize*/
1607
+ 24 && Rt !== (Rt = /*geom*/
1608
1608
  t[4].y + /*geom*/
1609
1609
  t[4].h - /*handleSize*/
1610
- t[3] / 2) && u(Z, "y", Nt), S & /*handleSize*/
1610
+ t[3] / 2) && u(Z, "y", Rt), T & /*handleSize*/
1611
1611
  8 && u(
1612
1612
  Z,
1613
1613
  "height",
1614
1614
  /*handleSize*/
1615
1615
  t[3]
1616
- ), S & /*handleSize*/
1616
+ ), T & /*handleSize*/
1617
1617
  8 && u(
1618
1618
  Z,
1619
1619
  "width",
@@ -1621,14 +1621,14 @@ function co(t) {
1621
1621
  t[3]
1622
1622
  );
1623
1623
  },
1624
- d(M) {
1625
- M && L(e), M && L(s), M && L(l), M && L(h), M && L(m), M && L(y), M && L(E), M && L(D), M && L(f), M && L(_), M && L(X), M && L(St), M && L(W), M && L(j), M && L(U), M && L(Ht), M && L(Q), M && L(jt), M && L(Z), Pt = !1, it(de);
1624
+ d(B) {
1625
+ B && Y(e), B && Y(s), B && Y(l), B && Y(h), B && Y(m), B && Y(y), B && Y(E), B && Y(V), B && Y(f), B && Y(M), B && Y(C), B && Y(Tt), B && Y(L), B && Y(Q), B && Y(P), B && Y(Ht), B && Y(J), B && Y(Pt), B && Y(Z), jt = !1, it(ce);
1626
1626
  }
1627
1627
  };
1628
1628
  }
1629
- function uo(t) {
1629
+ function ho(t) {
1630
1630
  let e, n;
1631
- return e = new We({
1631
+ return e = new Ke({
1632
1632
  props: {
1633
1633
  shape: (
1634
1634
  /*shape*/
@@ -1644,7 +1644,7 @@ function uo(t) {
1644
1644
  ),
1645
1645
  $$slots: {
1646
1646
  default: [
1647
- co,
1647
+ uo,
1648
1648
  ({ grab: o }) => ({ 10: o }),
1649
1649
  ({ grab: o }) => o ? 1024 : 0
1650
1650
  ]
@@ -1665,10 +1665,10 @@ function uo(t) {
1665
1665
  t[9]
1666
1666
  ), {
1667
1667
  c() {
1668
- gt(e.$$.fragment);
1668
+ pt(e.$$.fragment);
1669
1669
  },
1670
1670
  m(o, r) {
1671
- ct(e, o, r), n = !0;
1671
+ dt(e, o, r), n = !0;
1672
1672
  },
1673
1673
  p(o, [r]) {
1674
1674
  const i = {};
@@ -1680,36 +1680,36 @@ function uo(t) {
1680
1680
  3098 && (i.$$scope = { dirty: r, ctx: o }), e.$set(i);
1681
1681
  },
1682
1682
  i(o) {
1683
- n || (k(e.$$.fragment, o), n = !0);
1683
+ n || (N(e.$$.fragment, o), n = !0);
1684
1684
  },
1685
1685
  o(o) {
1686
- V(e.$$.fragment, o), n = !1;
1686
+ k(e.$$.fragment, o), n = !1;
1687
1687
  },
1688
1688
  d(o) {
1689
- ut(e, o);
1689
+ ct(e, o);
1690
1690
  }
1691
1691
  };
1692
1692
  }
1693
- function ho(t, e, n) {
1693
+ function po(t, e, n) {
1694
1694
  let o, r, { shape: i } = e, { computedStyle: a = void 0 } = e, { transform: s } = e, { viewportScale: l = 1 } = e;
1695
1695
  const d = (h, m, x) => {
1696
1696
  const A = h.geometry.bounds;
1697
- let [w, y] = [A.minX, A.minY], [E, v] = [A.maxX, A.maxY];
1698
- const [B, R] = x;
1697
+ let [$, y] = [A.minX, A.minY], [E, v] = [A.maxX, A.maxY];
1698
+ const [X, I] = x;
1699
1699
  if (m === O.SHAPE)
1700
- w += B, E += B, y += R, v += R;
1700
+ $ += X, E += X, y += I, v += I;
1701
1701
  else {
1702
1702
  switch (m) {
1703
1703
  case O.TOP:
1704
1704
  case O.TOP_LEFT:
1705
1705
  case O.TOP_RIGHT: {
1706
- y += R;
1706
+ y += I;
1707
1707
  break;
1708
1708
  }
1709
1709
  case O.BOTTOM:
1710
1710
  case O.BOTTOM_LEFT:
1711
1711
  case O.BOTTOM_RIGHT: {
1712
- v += R;
1712
+ v += I;
1713
1713
  break;
1714
1714
  }
1715
1715
  }
@@ -1717,42 +1717,42 @@ function ho(t, e, n) {
1717
1717
  case O.LEFT:
1718
1718
  case O.TOP_LEFT:
1719
1719
  case O.BOTTOM_LEFT: {
1720
- w += B;
1720
+ $ += X;
1721
1721
  break;
1722
1722
  }
1723
1723
  case O.RIGHT:
1724
1724
  case O.TOP_RIGHT:
1725
1725
  case O.BOTTOM_RIGHT: {
1726
- E += B;
1726
+ E += X;
1727
1727
  break;
1728
1728
  }
1729
1729
  }
1730
1730
  }
1731
- const D = Math.min(w, E), f = Math.min(y, v), b = Math.abs(E - w), $ = Math.abs(v - y);
1731
+ const V = Math.min($, E), f = Math.min(y, v), b = Math.abs(E - $), w = Math.abs(v - y);
1732
1732
  return {
1733
1733
  ...h,
1734
1734
  geometry: {
1735
- x: D,
1735
+ x: V,
1736
1736
  y: f,
1737
1737
  w: b,
1738
- h: $,
1738
+ h: w,
1739
1739
  bounds: {
1740
- minX: D,
1740
+ minX: V,
1741
1741
  minY: f,
1742
- maxX: D + b,
1743
- maxY: f + $
1742
+ maxX: V + b,
1743
+ maxY: f + w
1744
1744
  }
1745
1745
  }
1746
1746
  };
1747
1747
  };
1748
1748
  function p(h) {
1749
- vt.call(this, t, h);
1749
+ Et.call(this, t, h);
1750
1750
  }
1751
1751
  function c(h) {
1752
- vt.call(this, t, h);
1752
+ Et.call(this, t, h);
1753
1753
  }
1754
1754
  function g(h) {
1755
- vt.call(this, t, h);
1755
+ Et.call(this, t, h);
1756
1756
  }
1757
1757
  return t.$$set = (h) => {
1758
1758
  "shape" in h && n(0, i = h.shape), "computedStyle" in h && n(1, a = h.computedStyle), "transform" in h && n(2, s = h.transform), "viewportScale" in h && n(6, l = h.viewportScale);
@@ -1773,9 +1773,9 @@ function ho(t, e, n) {
1773
1773
  g
1774
1774
  ];
1775
1775
  }
1776
- class po extends nt {
1776
+ class go extends nt {
1777
1777
  constructor(e) {
1778
- super(), et(this, e, ho, uo, K, {
1778
+ super(), et(this, e, po, ho, W, {
1779
1779
  shape: 0,
1780
1780
  computedStyle: 1,
1781
1781
  transform: 2,
@@ -1783,10 +1783,10 @@ class po extends nt {
1783
1783
  });
1784
1784
  }
1785
1785
  }
1786
- const qe = /* @__PURE__ */ new Map([
1787
- [F.RECTANGLE, po],
1788
- [F.POLYGON, lo]
1789
- ]), be = (t) => qe.get(t.type), go = (t, e) => qe.set(t, e), O = (t) => `HANDLE-${t}`;
1786
+ const We = /* @__PURE__ */ new Map([
1787
+ [G.RECTANGLE, go],
1788
+ [G.POLYGON, co]
1789
+ ]), Ee = (t) => We.get(t.type), fo = (t, e) => We.set(t, e), O = (t) => `HANDLE-${t}`;
1790
1790
  O.SHAPE = "SHAPE";
1791
1791
  O.TOP = "TOP";
1792
1792
  O.RIGHT = "RIGHT";
@@ -1796,28 +1796,28 @@ O.TOP_LEFT = "TOP_LEFT";
1796
1796
  O.TOP_RIGHT = "TOP_RIGHT";
1797
1797
  O.BOTTOM_RIGHT = "BOTTOM_RIGHT";
1798
1798
  O.BOTTOM_LEFT = "BOTTOM_LEFT";
1799
- const fo = (t) => ({}), Ee = (t) => ({ grab: (
1799
+ const mo = (t) => ({}), ve = (t) => ({ grab: (
1800
1800
  /*onGrab*/
1801
1801
  t[0]
1802
1802
  ) });
1803
- function mo(t) {
1803
+ function yo(t) {
1804
1804
  let e, n, o, r;
1805
1805
  const i = (
1806
1806
  /*#slots*/
1807
1807
  t[7].default
1808
- ), a = tn(
1808
+ ), a = en(
1809
1809
  i,
1810
1810
  t,
1811
1811
  /*$$scope*/
1812
1812
  t[6],
1813
- Ee
1813
+ ve
1814
1814
  );
1815
1815
  return {
1816
1816
  c() {
1817
- e = N("g"), a && a.c(), u(e, "class", "a9s-annotation selected");
1817
+ e = R("g"), a && a.c(), u(e, "class", "a9s-annotation selected");
1818
1818
  },
1819
1819
  m(s, l) {
1820
- Y(s, e, l), a && a.m(e, null), n = !0, o || (r = [
1820
+ _(s, e, l), a && a.m(e, null), n = !0, o || (r = [
1821
1821
  z(
1822
1822
  e,
1823
1823
  "pointerup",
@@ -1834,45 +1834,45 @@ function mo(t) {
1834
1834
  },
1835
1835
  p(s, [l]) {
1836
1836
  a && a.p && (!n || l & /*$$scope*/
1837
- 64) && nn(
1837
+ 64) && on(
1838
1838
  a,
1839
1839
  i,
1840
1840
  s,
1841
1841
  /*$$scope*/
1842
1842
  s[6],
1843
- n ? en(
1843
+ n ? nn(
1844
1844
  i,
1845
1845
  /*$$scope*/
1846
1846
  s[6],
1847
1847
  l,
1848
- fo
1849
- ) : on(
1848
+ mo
1849
+ ) : rn(
1850
1850
  /*$$scope*/
1851
1851
  s[6]
1852
1852
  ),
1853
- Ee
1853
+ ve
1854
1854
  );
1855
1855
  },
1856
1856
  i(s) {
1857
- n || (k(a, s), n = !0);
1857
+ n || (N(a, s), n = !0);
1858
1858
  },
1859
1859
  o(s) {
1860
- V(a, s), n = !1;
1860
+ k(a, s), n = !1;
1861
1861
  },
1862
1862
  d(s) {
1863
- s && L(e), a && a.d(s), o = !1, it(r);
1863
+ s && Y(e), a && a.d(s), o = !1, it(r);
1864
1864
  }
1865
1865
  };
1866
1866
  }
1867
- function yo(t, e, n) {
1867
+ function wo(t, e, n) {
1868
1868
  let { $$slots: o = {}, $$scope: r } = e;
1869
- const i = Tt();
1869
+ const i = At();
1870
1870
  let { shape: a } = e, { editor: s } = e, { transform: l } = e, d = null, p, c = null;
1871
1871
  const g = (x) => (A) => {
1872
1872
  d = x, p = l.elementToImage(A.offsetX, A.offsetY), c = a, A.target.setPointerCapture(A.pointerId), i("grab");
1873
1873
  }, h = (x) => {
1874
1874
  if (d) {
1875
- const [A, w] = l.elementToImage(x.offsetX, x.offsetY), y = [A - p[0], w - p[1]];
1875
+ const [A, $] = l.elementToImage(x.offsetX, x.offsetY), y = [A - p[0], $ - p[1]];
1876
1876
  n(3, a = s(c, d, y)), i("change", a);
1877
1877
  }
1878
1878
  }, m = (x) => {
@@ -1882,9 +1882,9 @@ function yo(t, e, n) {
1882
1882
  "shape" in x && n(3, a = x.shape), "editor" in x && n(4, s = x.editor), "transform" in x && n(5, l = x.transform), "$$scope" in x && n(6, r = x.$$scope);
1883
1883
  }, [g, h, m, a, s, l, r, o];
1884
1884
  }
1885
- class We extends nt {
1885
+ class Ke extends nt {
1886
1886
  constructor(e) {
1887
- super(), et(this, e, yo, mo, K, { shape: 3, editor: 4, transform: 5 });
1887
+ super(), et(this, e, wo, yo, W, { shape: 3, editor: 4, transform: 5 });
1888
1888
  }
1889
1889
  }
1890
1890
  const Ft = (t, e) => {
@@ -1895,9 +1895,9 @@ const Ft = (t, e) => {
1895
1895
  return o && (i += `fill:${o};stroke:${o};`), i += `fill-opacity:${r || "0.25"};`, i;
1896
1896
  }
1897
1897
  };
1898
- function wo(t, e, n) {
1898
+ function $o(t, e, n) {
1899
1899
  let o;
1900
- const r = Tt();
1900
+ const r = At();
1901
1901
  let { annotation: i } = e, { editor: a } = e, { style: s = void 0 } = e, { target: l } = e, { transform: d } = e, { viewportScale: p } = e, c;
1902
1902
  return Mt(() => (n(6, c = new a({
1903
1903
  target: l,
@@ -1921,9 +1921,9 @@ function wo(t, e, n) {
1921
1921
  96 && c && c.$set({ viewportScale: p });
1922
1922
  }, [i, a, s, l, d, p, c];
1923
1923
  }
1924
- class $o extends nt {
1924
+ class xo extends nt {
1925
1925
  constructor(e) {
1926
- super(), et(this, e, wo, null, K, {
1926
+ super(), et(this, e, $o, null, W, {
1927
1927
  annotation: 0,
1928
1928
  editor: 1,
1929
1929
  style: 2,
@@ -1933,8 +1933,8 @@ class $o extends nt {
1933
1933
  });
1934
1934
  }
1935
1935
  }
1936
- function xo(t, e, n) {
1937
- const o = Tt();
1936
+ function bo(t, e, n) {
1937
+ const o = At();
1938
1938
  let { drawingMode: r } = e, { target: i } = e, { tool: a } = e, { transform: s } = e, { viewportScale: l } = e, d;
1939
1939
  return Mt(() => {
1940
1940
  const p = i.closest("svg"), c = [], g = (h, m, x) => {
@@ -1959,9 +1959,9 @@ function xo(t, e, n) {
1959
1959
  48 && d && d.$set({ viewportScale: l });
1960
1960
  }, [r, i, a, s, l, d];
1961
1961
  }
1962
- class bo extends nt {
1962
+ class Eo extends nt {
1963
1963
  constructor(e) {
1964
- super(), et(this, e, xo, null, K, {
1964
+ super(), et(this, e, bo, null, W, {
1965
1965
  drawingMode: 0,
1966
1966
  target: 1,
1967
1967
  tool: 2,
@@ -1970,11 +1970,11 @@ class bo extends nt {
1970
1970
  });
1971
1971
  }
1972
1972
  }
1973
- function ve(t) {
1973
+ function Ae(t) {
1974
1974
  let e, n;
1975
1975
  return {
1976
1976
  c() {
1977
- e = N("rect"), n = N("rect"), u(e, "class", "a9s-outer"), u(
1977
+ e = R("rect"), n = R("rect"), u(e, "class", "a9s-outer"), u(
1978
1978
  e,
1979
1979
  "x",
1980
1980
  /*x*/
@@ -2017,7 +2017,7 @@ function ve(t) {
2017
2017
  );
2018
2018
  },
2019
2019
  m(o, r) {
2020
- Y(o, e, r), Y(o, n, r);
2020
+ _(o, e, r), _(o, n, r);
2021
2021
  },
2022
2022
  p(o, r) {
2023
2023
  r & /*x*/
@@ -2071,34 +2071,34 @@ function ve(t) {
2071
2071
  );
2072
2072
  },
2073
2073
  d(o) {
2074
- o && L(e), o && L(n);
2074
+ o && Y(e), o && Y(n);
2075
2075
  }
2076
2076
  };
2077
2077
  }
2078
- function Eo(t) {
2078
+ function vo(t) {
2079
2079
  let e, n = (
2080
2080
  /*origin*/
2081
- t[0] && ve(t)
2081
+ t[0] && Ae(t)
2082
2082
  );
2083
2083
  return {
2084
2084
  c() {
2085
- e = N("g"), n && n.c(), u(e, "class", "a9s-annotation a9s-rubberband");
2085
+ e = R("g"), n && n.c(), u(e, "class", "a9s-annotation a9s-rubberband");
2086
2086
  },
2087
2087
  m(o, r) {
2088
- Y(o, e, r), n && n.m(e, null);
2088
+ _(o, e, r), n && n.m(e, null);
2089
2089
  },
2090
2090
  p(o, [r]) {
2091
- o[0] ? n ? n.p(o, r) : (n = ve(o), n.c(), n.m(e, null)) : n && (n.d(1), n = null);
2091
+ o[0] ? n ? n.p(o, r) : (n = Ae(o), n.c(), n.m(e, null)) : n && (n.d(1), n = null);
2092
2092
  },
2093
- i: G,
2094
- o: G,
2093
+ i: U,
2094
+ o: U,
2095
2095
  d(o) {
2096
- o && L(e), n && n.d();
2096
+ o && Y(e), n && n.d();
2097
2097
  }
2098
2098
  };
2099
2099
  }
2100
- function vo(t, e, n) {
2101
- const o = Tt();
2100
+ function Ao(t, e, n) {
2101
+ const o = At();
2102
2102
  let { addEventListener: r } = e, { drawingMode: i } = e, { transform: a } = e, s, l, d, p, c, g, h;
2103
2103
  const m = (y) => {
2104
2104
  s = performance.now(), i === "drag" && (n(0, l = a.elementToImage(y.offsetX, y.offsetY)), d = l, n(1, p = l[0]), n(2, c = l[1]), n(3, g = 1), n(4, h = 1));
@@ -2109,13 +2109,13 @@ function vo(t, e, n) {
2109
2109
  if (i === "click") {
2110
2110
  if (E > 300)
2111
2111
  return;
2112
- y.stopPropagation(), l ? w() : (n(0, l = a.elementToImage(y.offsetX, y.offsetY)), d = l, n(1, p = l[0]), n(2, c = l[1]), n(3, g = 1), n(4, h = 1));
2112
+ y.stopPropagation(), l ? $() : (n(0, l = a.elementToImage(y.offsetX, y.offsetY)), d = l, n(1, p = l[0]), n(2, c = l[1]), n(3, g = 1), n(4, h = 1));
2113
2113
  } else
2114
- l && (E > 300 || g * h > 100 ? (y.stopPropagation(), w()) : (n(0, l = null), d = null));
2115
- }, w = () => {
2114
+ l && (E > 300 || g * h > 100 ? (y.stopPropagation(), $()) : (n(0, l = null), d = null));
2115
+ }, $ = () => {
2116
2116
  if (g * h > 15) {
2117
2117
  const y = {
2118
- type: F.RECTANGLE,
2118
+ type: G.RECTANGLE,
2119
2119
  geometry: {
2120
2120
  bounds: {
2121
2121
  minX: p,
@@ -2139,9 +2139,9 @@ function vo(t, e, n) {
2139
2139
  "addEventListener" in y && n(5, r = y.addEventListener), "drawingMode" in y && n(6, i = y.drawingMode), "transform" in y && n(7, a = y.transform);
2140
2140
  }, [l, p, c, g, h, r, i, a];
2141
2141
  }
2142
- class Ao extends nt {
2142
+ class To extends nt {
2143
2143
  constructor(e) {
2144
- super(), et(this, e, vo, Eo, K, {
2144
+ super(), et(this, e, Ao, vo, W, {
2145
2145
  addEventListener: 5,
2146
2146
  drawingMode: 6,
2147
2147
  transform: 7
@@ -2151,34 +2151,34 @@ class Ao extends nt {
2151
2151
  const Kt = (t, e) => {
2152
2152
  const n = Math.abs(e[0] - t[0]), o = Math.abs(e[1] - t[1]);
2153
2153
  return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
2154
- }, $t = [];
2155
- function To(t, e = G) {
2154
+ }, wt = [];
2155
+ function So(t, e = U) {
2156
2156
  let n;
2157
2157
  const o = /* @__PURE__ */ new Set();
2158
2158
  function r(s) {
2159
- if (K(t, s) && (t = s, n)) {
2160
- const l = !$t.length;
2159
+ if (W(t, s) && (t = s, n)) {
2160
+ const l = !wt.length;
2161
2161
  for (const d of o)
2162
- d[1](), $t.push(d, t);
2162
+ d[1](), wt.push(d, t);
2163
2163
  if (l) {
2164
- for (let d = 0; d < $t.length; d += 2)
2165
- $t[d][0]($t[d + 1]);
2166
- $t.length = 0;
2164
+ for (let d = 0; d < wt.length; d += 2)
2165
+ wt[d][0](wt[d + 1]);
2166
+ wt.length = 0;
2167
2167
  }
2168
2168
  }
2169
2169
  }
2170
2170
  function i(s) {
2171
2171
  r(s(t));
2172
2172
  }
2173
- function a(s, l = G) {
2173
+ function a(s, l = U) {
2174
2174
  const d = [s, l];
2175
- return o.add(d), o.size === 1 && (n = e(r) || G), s(t), () => {
2175
+ return o.add(d), o.size === 1 && (n = e(r) || U), s(t), () => {
2176
2176
  o.delete(d), o.size === 0 && n && (n(), n = null);
2177
2177
  };
2178
2178
  }
2179
2179
  return { set: r, update: i, subscribe: a };
2180
2180
  }
2181
- const So = (t, e) => {
2181
+ const Oo = (t, e) => {
2182
2182
  const { naturalWidth: n, naturalHeight: o } = t;
2183
2183
  if (!n && !o) {
2184
2184
  const { width: r, height: i } = t;
@@ -2188,9 +2188,9 @@ const So = (t, e) => {
2188
2188
  });
2189
2189
  } else
2190
2190
  e.setAttribute("viewBox", `0 0 ${n} ${o}`);
2191
- }, Oo = (t, e) => {
2192
- So(t, e);
2193
- const { subscribe: n, set: o } = To(1);
2191
+ }, Lo = (t, e) => {
2192
+ Oo(t, e);
2193
+ const { subscribe: n, set: o } = So(1);
2194
2194
  let r;
2195
2195
  return window.ResizeObserver && (r = new ResizeObserver(() => {
2196
2196
  const i = e.getBoundingClientRect(), { width: a, height: s } = e.viewBox.baseVal, l = Math.max(
@@ -2217,19 +2217,19 @@ function Jt(t) {
2217
2217
  );
2218
2218
  return e[15] = n, e;
2219
2219
  }
2220
- function Ae(t) {
2220
+ function Te(t) {
2221
2221
  let e, n, o, r, i, a = (
2222
2222
  /*isClosable*/
2223
- t[2] && Te(t)
2223
+ t[2] && Se(t)
2224
2224
  );
2225
2225
  return {
2226
2226
  c() {
2227
- e = N("polygon"), o = N("polygon"), a && a.c(), i = at(), u(e, "class", "a9s-outer"), u(e, "points", n = /*coords*/
2227
+ e = R("polygon"), o = R("polygon"), a && a.c(), i = at(), u(e, "class", "a9s-outer"), u(e, "points", n = /*coords*/
2228
2228
  t[15]), u(o, "class", "a9s-inner"), u(o, "points", r = /*coords*/
2229
2229
  t[15]);
2230
2230
  },
2231
2231
  m(s, l) {
2232
- Y(s, e, l), Y(s, o, l), a && a.m(s, l), Y(s, i, l);
2232
+ _(s, e, l), _(s, o, l), a && a.m(s, l), _(s, i, l);
2233
2233
  },
2234
2234
  p(s, l) {
2235
2235
  l & /*isClosable, points, cursor*/
@@ -2237,18 +2237,18 @@ function Ae(t) {
2237
2237
  s[15]) && u(e, "points", n), l & /*isClosable, points, cursor*/
2238
2238
  7 && r !== (r = /*coords*/
2239
2239
  s[15]) && u(o, "points", r), /*isClosable*/
2240
- s[2] ? a ? a.p(s, l) : (a = Te(s), a.c(), a.m(i.parentNode, i)) : a && (a.d(1), a = null);
2240
+ s[2] ? a ? a.p(s, l) : (a = Se(s), a.c(), a.m(i.parentNode, i)) : a && (a.d(1), a = null);
2241
2241
  },
2242
2242
  d(s) {
2243
- s && L(e), s && L(o), a && a.d(s), s && L(i);
2243
+ s && Y(e), s && Y(o), a && a.d(s), s && Y(i);
2244
2244
  }
2245
2245
  };
2246
2246
  }
2247
- function Te(t) {
2247
+ function Se(t) {
2248
2248
  let e, n, o;
2249
2249
  return {
2250
2250
  c() {
2251
- e = N("rect"), u(e, "class", "a9s-corner-handle"), u(e, "x", n = /*points*/
2251
+ e = R("rect"), u(e, "class", "a9s-corner-handle"), u(e, "x", n = /*points*/
2252
2252
  t[0][0][0] - /*handleSize*/
2253
2253
  t[3] / 2), u(e, "y", o = /*points*/
2254
2254
  t[0][0][1] - /*handleSize*/
@@ -2265,7 +2265,7 @@ function Te(t) {
2265
2265
  );
2266
2266
  },
2267
2267
  m(r, i) {
2268
- Y(r, e, i);
2268
+ _(r, e, i);
2269
2269
  },
2270
2270
  p(r, i) {
2271
2271
  i & /*points, handleSize*/
@@ -2289,47 +2289,47 @@ function Te(t) {
2289
2289
  );
2290
2290
  },
2291
2291
  d(r) {
2292
- r && L(e);
2292
+ r && Y(e);
2293
2293
  }
2294
2294
  };
2295
2295
  }
2296
- function Lo(t) {
2296
+ function Yo(t) {
2297
2297
  let e, n = (
2298
2298
  /*cursor*/
2299
- t[1] && Ae(Jt(t))
2299
+ t[1] && Te(Jt(t))
2300
2300
  );
2301
2301
  return {
2302
2302
  c() {
2303
- e = N("g"), n && n.c(), u(e, "class", "a9s-annotation a9s-rubberband");
2303
+ e = R("g"), n && n.c(), u(e, "class", "a9s-annotation a9s-rubberband");
2304
2304
  },
2305
2305
  m(o, r) {
2306
- Y(o, e, r), n && n.m(e, null);
2306
+ _(o, e, r), n && n.m(e, null);
2307
2307
  },
2308
2308
  p(o, [r]) {
2309
- o[1] ? n ? n.p(Jt(o), r) : (n = Ae(Jt(o)), n.c(), n.m(e, null)) : n && (n.d(1), n = null);
2309
+ o[1] ? n ? n.p(Jt(o), r) : (n = Te(Jt(o)), n.c(), n.m(e, null)) : n && (n.d(1), n = null);
2310
2310
  },
2311
- i: G,
2312
- o: G,
2311
+ i: U,
2312
+ o: U,
2313
2313
  d(o) {
2314
- o && L(e), n && n.d();
2314
+ o && Y(e), n && n.d();
2315
2315
  }
2316
2316
  };
2317
2317
  }
2318
- const Yo = 20;
2319
- function _o(t, e, n) {
2318
+ const _o = 20;
2319
+ function Mo(t, e, n) {
2320
2320
  let o;
2321
- const r = Tt();
2321
+ const r = At();
2322
2322
  let { addEventListener: i } = e, { drawingMode: a } = e, { transform: s } = e, { viewportScale: l = 1 } = e, d, p = [], c = null, g = !1;
2323
2323
  const h = (y) => {
2324
- const { timeStamp: E, offsetX: v, offsetY: B } = y;
2325
- if (d = { timeStamp: E, offsetX: v, offsetY: B }, a === "drag" && p.length === 0) {
2326
- const R = s.elementToImage(y.offsetX, y.offsetY);
2327
- p.push(R), n(1, c = R);
2324
+ const { timeStamp: E, offsetX: v, offsetY: X } = y;
2325
+ if (d = { timeStamp: E, offsetX: v, offsetY: X }, a === "drag" && p.length === 0) {
2326
+ const I = s.elementToImage(y.offsetX, y.offsetY);
2327
+ p.push(I), n(1, c = I);
2328
2328
  }
2329
2329
  }, m = (y) => {
2330
2330
  if (p.length > 0 && (n(1, c = s.elementToImage(y.offsetX, y.offsetY)), p.length > 2)) {
2331
2331
  const E = Kt(c, p[0]) * l;
2332
- n(2, g = E < Yo);
2332
+ n(2, g = E < _o);
2333
2333
  }
2334
2334
  }, x = (y) => {
2335
2335
  if (a === "click") {
@@ -2337,10 +2337,10 @@ function _o(t, e, n) {
2337
2337
  if (E > 300 || v > 15)
2338
2338
  return;
2339
2339
  if (g)
2340
- w();
2340
+ $();
2341
2341
  else if (p.length === 0) {
2342
- const B = s.elementToImage(y.offsetX, y.offsetY);
2343
- p.push(B), n(1, c = B);
2342
+ const X = s.elementToImage(y.offsetX, y.offsetY);
2343
+ p.push(X), n(1, c = X);
2344
2344
  } else
2345
2345
  p.push(c);
2346
2346
  } else {
@@ -2348,17 +2348,17 @@ function _o(t, e, n) {
2348
2348
  n(0, p = []), n(1, c = null);
2349
2349
  return;
2350
2350
  }
2351
- y.stopImmediatePropagation(), g ? w() : p.push(c);
2351
+ y.stopImmediatePropagation(), g ? $() : p.push(c);
2352
2352
  }
2353
2353
  }, A = () => {
2354
2354
  const y = [...p, c], E = {
2355
- type: F.POLYGON,
2355
+ type: G.POLYGON,
2356
2356
  geometry: { bounds: Gt(y), points: y }
2357
2357
  };
2358
2358
  oe(E) > 4 && (n(0, p = []), n(1, c = null), r("create", E));
2359
- }, w = () => {
2359
+ }, $ = () => {
2360
2360
  const y = {
2361
- type: F.POLYGON,
2361
+ type: G.POLYGON,
2362
2362
  geometry: {
2363
2363
  bounds: Gt(p),
2364
2364
  points: [...p]
@@ -2384,9 +2384,9 @@ function _o(t, e, n) {
2384
2384
  l
2385
2385
  ];
2386
2386
  }
2387
- class Io extends nt {
2387
+ class Bo extends nt {
2388
2388
  constructor(e) {
2389
- super(), et(this, e, _o, Lo, K, {
2389
+ super(), et(this, e, Mo, Yo, W, {
2390
2390
  addEventListener: 4,
2391
2391
  drawingMode: 5,
2392
2392
  transform: 6,
@@ -2394,15 +2394,15 @@ class Io extends nt {
2394
2394
  });
2395
2395
  }
2396
2396
  }
2397
- const le = /* @__PURE__ */ new Map([
2398
- ["rectangle", { tool: Ao }],
2399
- ["polygon", { tool: Io }]
2400
- ]), Mo = () => [...le.keys()], Ke = (t) => le.get(t), Bo = (t, e, n) => le.set(t, { tool: e, opts: n });
2401
- function Xo(t) {
2397
+ const de = /* @__PURE__ */ new Map([
2398
+ ["rectangle", { tool: To }],
2399
+ ["polygon", { tool: Bo }]
2400
+ ]), re = () => [...de.keys()], Je = (t) => de.get(t), Xo = (t, e, n) => de.set(t, { tool: e, opts: n });
2401
+ function Co(t) {
2402
2402
  let e, n, o, r, i;
2403
2403
  return {
2404
2404
  c() {
2405
- e = N("g"), n = N("ellipse"), r = N("ellipse"), u(n, "class", "a9s-outer"), u(n, "style", o = /*computedStyle*/
2405
+ e = R("g"), n = R("ellipse"), r = R("ellipse"), u(n, "class", "a9s-outer"), u(n, "style", o = /*computedStyle*/
2406
2406
  t[1] ? "display:none;" : void 0), u(
2407
2407
  n,
2408
2408
  "cx",
@@ -2452,7 +2452,7 @@ function Xo(t) {
2452
2452
  t[0].id);
2453
2453
  },
2454
2454
  m(a, s) {
2455
- Y(a, e, s), dt(e, n), dt(e, r);
2455
+ _(a, e, s), lt(e, n), lt(e, r);
2456
2456
  },
2457
2457
  p(a, [s]) {
2458
2458
  s & /*computedStyle*/
@@ -2467,14 +2467,14 @@ function Xo(t) {
2467
2467
  1 && i !== (i = /*annotation*/
2468
2468
  a[0].id) && u(e, "data-id", i);
2469
2469
  },
2470
- i: G,
2471
- o: G,
2470
+ i: U,
2471
+ o: U,
2472
2472
  d(a) {
2473
- a && L(e);
2473
+ a && Y(e);
2474
2474
  }
2475
2475
  };
2476
2476
  }
2477
- function Ro(t, e, n) {
2477
+ function Io(t, e, n) {
2478
2478
  let o, { annotation: r } = e, { geom: i } = e, { style: a = void 0 } = e;
2479
2479
  const { cx: s, cy: l, rx: d, ry: p } = i;
2480
2480
  return t.$$set = (c) => {
@@ -2484,16 +2484,16 @@ function Ro(t, e, n) {
2484
2484
  129 && n(1, o = Ft(r, a));
2485
2485
  }, [r, o, s, l, d, p, i, a];
2486
2486
  }
2487
- class No extends nt {
2487
+ class Ro extends nt {
2488
2488
  constructor(e) {
2489
- super(), et(this, e, Ro, Xo, K, { annotation: 0, geom: 6, style: 7 });
2489
+ super(), et(this, e, Io, Co, W, { annotation: 0, geom: 6, style: 7 });
2490
2490
  }
2491
2491
  }
2492
- function ko(t) {
2492
+ function No(t) {
2493
2493
  let e, n, o, r, i;
2494
2494
  return {
2495
2495
  c() {
2496
- e = N("g"), n = N("polygon"), r = N("polygon"), u(n, "class", "a9s-outer"), u(n, "style", o = /*computedStyle*/
2496
+ e = R("g"), n = R("polygon"), r = R("polygon"), u(n, "class", "a9s-outer"), u(n, "style", o = /*computedStyle*/
2497
2497
  t[1] ? "display:none;" : void 0), u(
2498
2498
  n,
2499
2499
  "points",
@@ -2508,12 +2508,12 @@ function ko(t) {
2508
2508
  r,
2509
2509
  "points",
2510
2510
  /*points*/
2511
- t[2].map(Do).join(" ")
2511
+ t[2].map(ko).join(" ")
2512
2512
  ), u(e, "data-id", i = /*annotation*/
2513
2513
  t[0].id);
2514
2514
  },
2515
2515
  m(a, s) {
2516
- Y(a, e, s), dt(e, n), dt(e, r);
2516
+ _(a, e, s), lt(e, n), lt(e, r);
2517
2517
  },
2518
2518
  p(a, [s]) {
2519
2519
  s & /*computedStyle*/
@@ -2528,15 +2528,15 @@ function ko(t) {
2528
2528
  1 && i !== (i = /*annotation*/
2529
2529
  a[0].id) && u(e, "data-id", i);
2530
2530
  },
2531
- i: G,
2532
- o: G,
2531
+ i: U,
2532
+ o: U,
2533
2533
  d(a) {
2534
- a && L(e);
2534
+ a && Y(e);
2535
2535
  }
2536
2536
  };
2537
2537
  }
2538
- const Vo = (t) => t.join(","), Do = (t) => t.join(",");
2539
- function Co(t, e, n) {
2538
+ const Vo = (t) => t.join(","), ko = (t) => t.join(",");
2539
+ function Do(t, e, n) {
2540
2540
  let o, { annotation: r } = e, { geom: i } = e, { style: a = void 0 } = e;
2541
2541
  const { points: s } = i;
2542
2542
  return t.$$set = (l) => {
@@ -2548,14 +2548,14 @@ function Co(t, e, n) {
2548
2548
  }
2549
2549
  class Uo extends nt {
2550
2550
  constructor(e) {
2551
- super(), et(this, e, Co, ko, K, { annotation: 0, geom: 3, style: 4 });
2551
+ super(), et(this, e, Do, No, W, { annotation: 0, geom: 3, style: 4 });
2552
2552
  }
2553
2553
  }
2554
2554
  function Go(t) {
2555
2555
  let e, n, o, r, i;
2556
2556
  return {
2557
2557
  c() {
2558
- e = N("g"), n = N("rect"), r = N("rect"), u(n, "class", "a9s-outer"), u(n, "style", o = /*computedStyle*/
2558
+ e = R("g"), n = R("rect"), r = R("rect"), u(n, "class", "a9s-outer"), u(n, "style", o = /*computedStyle*/
2559
2559
  t[5] ? "display:none;" : void 0), u(
2560
2560
  n,
2561
2561
  "x",
@@ -2605,7 +2605,7 @@ function Go(t) {
2605
2605
  t[0].id);
2606
2606
  },
2607
2607
  m(a, s) {
2608
- Y(a, e, s), dt(e, n), dt(e, r);
2608
+ _(a, e, s), lt(e, n), lt(e, r);
2609
2609
  },
2610
2610
  p(a, [s]) {
2611
2611
  s & /*computedStyle*/
@@ -2668,10 +2668,10 @@ function Go(t) {
2668
2668
  1 && i !== (i = /*annotation*/
2669
2669
  a[0].id) && u(e, "data-id", i);
2670
2670
  },
2671
- i: G,
2672
- o: G,
2671
+ i: U,
2672
+ o: U,
2673
2673
  d(a) {
2674
- a && L(e);
2674
+ a && Y(e);
2675
2675
  }
2676
2676
  };
2677
2677
  }
@@ -2687,21 +2687,21 @@ function Fo(t, e, n) {
2687
2687
  }
2688
2688
  class Ho extends nt {
2689
2689
  constructor(e) {
2690
- super(), et(this, e, Fo, Go, K, { annotation: 0, geom: 6, style: 7 });
2690
+ super(), et(this, e, Fo, Go, W, { annotation: 0, geom: 6, style: 7 });
2691
2691
  }
2692
2692
  }
2693
- const jo = (t) => ({
2693
+ const Po = (t) => ({
2694
2694
  elementToImage: (e, n) => {
2695
2695
  const o = t.getBoundingClientRect(), r = t.createSVGPoint();
2696
2696
  r.x = e + o.x, r.y = n + o.y;
2697
2697
  const { x: i, y: a } = r.matrixTransform(t.getScreenCTM().inverse());
2698
2698
  return [i, a];
2699
2699
  }
2700
- }), Po = 250, zo = (t, e) => {
2701
- const n = Tt();
2700
+ }), jo = 250, zo = (t, e) => {
2701
+ const n = At();
2702
2702
  let o;
2703
2703
  return { onPointerDown: () => o = performance.now(), onPointerUp: (r) => {
2704
- if (performance.now() - o < Po) {
2704
+ if (performance.now() - o < jo) {
2705
2705
  const { x: i, y: a } = qo(r, t), s = e.getAt(i, a);
2706
2706
  s ? n("click", { originalEvent: r, annotation: s }) : n("click", { originalEvent: r });
2707
2707
  }
@@ -2710,46 +2710,46 @@ const jo = (t) => ({
2710
2710
  const n = e.createSVGPoint(), o = e.getBoundingClientRect(), r = t.clientX - o.x, i = t.clientY - o.y, { left: a, top: s } = e.getBoundingClientRect();
2711
2711
  return n.x = r + a, n.y = i + s, n.matrixTransform(e.getScreenCTM().inverse());
2712
2712
  };
2713
- function Se(t, e, n) {
2713
+ function Oe(t, e, n) {
2714
2714
  const o = t.slice();
2715
- return o[28] = e[n], o;
2715
+ return o[29] = e[n], o;
2716
2716
  }
2717
- function Oe(t, e, n) {
2717
+ function Le(t, e, n) {
2718
2718
  const o = t.slice();
2719
- return o[31] = e[n], o;
2719
+ return o[32] = e[n], o;
2720
2720
  }
2721
- function Qt(t) {
2721
+ function Zt(t) {
2722
2722
  const e = t.slice(), n = (
2723
2723
  /*annotation*/
2724
- e[31].target.selector
2724
+ e[32].target.selector
2725
2725
  );
2726
- return e[34] = n, e;
2726
+ return e[35] = n, e;
2727
2727
  }
2728
- function Le(t) {
2728
+ function Ye(t) {
2729
2729
  let e = (
2730
2730
  /*annotation*/
2731
- t[31].id
2732
- ), n, o, r = Ye(t);
2731
+ t[32].id
2732
+ ), n, o, r = _e(t);
2733
2733
  return {
2734
2734
  c() {
2735
2735
  r.c(), n = at();
2736
2736
  },
2737
2737
  m(i, a) {
2738
- r.m(i, a), Y(i, n, a), o = !0;
2738
+ r.m(i, a), _(i, n, a), o = !0;
2739
2739
  },
2740
2740
  p(i, a) {
2741
2741
  a[0] & /*$store*/
2742
- 4096 && K(e, e = /*annotation*/
2743
- i[31].id) ? (ot(), V(r, 1, 1, G), rt(), r = Ye(i), r.c(), k(r, 1), r.m(n.parentNode, n)) : r.p(i, a);
2742
+ 8192 && W(e, e = /*annotation*/
2743
+ i[32].id) ? (ot(), k(r, 1, 1, U), rt(), r = _e(i), r.c(), N(r, 1), r.m(n.parentNode, n)) : r.p(i, a);
2744
2744
  },
2745
2745
  i(i) {
2746
- o || (k(r), o = !0);
2746
+ o || (N(r), o = !0);
2747
2747
  },
2748
2748
  o(i) {
2749
- V(r), o = !1;
2749
+ k(r), o = !1;
2750
2750
  },
2751
2751
  d(i) {
2752
- i && L(n), r.d(i);
2752
+ i && Y(n), r.d(i);
2753
2753
  }
2754
2754
  };
2755
2755
  }
@@ -2759,11 +2759,11 @@ function Wo(t) {
2759
2759
  props: {
2760
2760
  annotation: (
2761
2761
  /*annotation*/
2762
- t[31]
2762
+ t[32]
2763
2763
  ),
2764
2764
  geom: (
2765
2765
  /*selector*/
2766
- t[34].geometry
2766
+ t[35].geometry
2767
2767
  ),
2768
2768
  style: (
2769
2769
  /*style*/
@@ -2772,29 +2772,29 @@ function Wo(t) {
2772
2772
  }
2773
2773
  }), {
2774
2774
  c() {
2775
- gt(e.$$.fragment);
2775
+ pt(e.$$.fragment);
2776
2776
  },
2777
2777
  m(o, r) {
2778
- ct(e, o, r), n = !0;
2778
+ dt(e, o, r), n = !0;
2779
2779
  },
2780
2780
  p(o, r) {
2781
2781
  const i = {};
2782
2782
  r[0] & /*$store*/
2783
- 4096 && (i.annotation = /*annotation*/
2784
- o[31]), r[0] & /*$store*/
2785
- 4096 && (i.geom = /*selector*/
2786
- o[34].geometry), r[0] & /*style*/
2783
+ 8192 && (i.annotation = /*annotation*/
2784
+ o[32]), r[0] & /*$store*/
2785
+ 8192 && (i.geom = /*selector*/
2786
+ o[35].geometry), r[0] & /*style*/
2787
2787
  2 && (i.style = /*style*/
2788
2788
  o[1]), e.$set(i);
2789
2789
  },
2790
2790
  i(o) {
2791
- n || (k(e.$$.fragment, o), n = !0);
2791
+ n || (N(e.$$.fragment, o), n = !0);
2792
2792
  },
2793
2793
  o(o) {
2794
- V(e.$$.fragment, o), n = !1;
2794
+ k(e.$$.fragment, o), n = !1;
2795
2795
  },
2796
2796
  d(o) {
2797
- ut(e, o);
2797
+ ct(e, o);
2798
2798
  }
2799
2799
  };
2800
2800
  }
@@ -2804,11 +2804,11 @@ function Ko(t) {
2804
2804
  props: {
2805
2805
  annotation: (
2806
2806
  /*annotation*/
2807
- t[31]
2807
+ t[32]
2808
2808
  ),
2809
2809
  geom: (
2810
2810
  /*selector*/
2811
- t[34].geometry
2811
+ t[35].geometry
2812
2812
  ),
2813
2813
  style: (
2814
2814
  /*style*/
@@ -2817,43 +2817,43 @@ function Ko(t) {
2817
2817
  }
2818
2818
  }), {
2819
2819
  c() {
2820
- gt(e.$$.fragment);
2820
+ pt(e.$$.fragment);
2821
2821
  },
2822
2822
  m(o, r) {
2823
- ct(e, o, r), n = !0;
2823
+ dt(e, o, r), n = !0;
2824
2824
  },
2825
2825
  p(o, r) {
2826
2826
  const i = {};
2827
2827
  r[0] & /*$store*/
2828
- 4096 && (i.annotation = /*annotation*/
2829
- o[31]), r[0] & /*$store*/
2830
- 4096 && (i.geom = /*selector*/
2831
- o[34].geometry), r[0] & /*style*/
2828
+ 8192 && (i.annotation = /*annotation*/
2829
+ o[32]), r[0] & /*$store*/
2830
+ 8192 && (i.geom = /*selector*/
2831
+ o[35].geometry), r[0] & /*style*/
2832
2832
  2 && (i.style = /*style*/
2833
2833
  o[1]), e.$set(i);
2834
2834
  },
2835
2835
  i(o) {
2836
- n || (k(e.$$.fragment, o), n = !0);
2836
+ n || (N(e.$$.fragment, o), n = !0);
2837
2837
  },
2838
2838
  o(o) {
2839
- V(e.$$.fragment, o), n = !1;
2839
+ k(e.$$.fragment, o), n = !1;
2840
2840
  },
2841
2841
  d(o) {
2842
- ut(e, o);
2842
+ ct(e, o);
2843
2843
  }
2844
2844
  };
2845
2845
  }
2846
2846
  function Jo(t) {
2847
2847
  let e, n;
2848
- return e = new No({
2848
+ return e = new Ro({
2849
2849
  props: {
2850
2850
  annotation: (
2851
2851
  /*annotation*/
2852
- t[31]
2852
+ t[32]
2853
2853
  ),
2854
2854
  geom: (
2855
2855
  /*selector*/
2856
- t[34].geometry
2856
+ t[35].geometry
2857
2857
  ),
2858
2858
  style: (
2859
2859
  /*style*/
@@ -2862,43 +2862,43 @@ function Jo(t) {
2862
2862
  }
2863
2863
  }), {
2864
2864
  c() {
2865
- gt(e.$$.fragment);
2865
+ pt(e.$$.fragment);
2866
2866
  },
2867
2867
  m(o, r) {
2868
- ct(e, o, r), n = !0;
2868
+ dt(e, o, r), n = !0;
2869
2869
  },
2870
2870
  p(o, r) {
2871
2871
  const i = {};
2872
2872
  r[0] & /*$store*/
2873
- 4096 && (i.annotation = /*annotation*/
2874
- o[31]), r[0] & /*$store*/
2875
- 4096 && (i.geom = /*selector*/
2876
- o[34].geometry), r[0] & /*style*/
2873
+ 8192 && (i.annotation = /*annotation*/
2874
+ o[32]), r[0] & /*$store*/
2875
+ 8192 && (i.geom = /*selector*/
2876
+ o[35].geometry), r[0] & /*style*/
2877
2877
  2 && (i.style = /*style*/
2878
2878
  o[1]), e.$set(i);
2879
2879
  },
2880
2880
  i(o) {
2881
- n || (k(e.$$.fragment, o), n = !0);
2881
+ n || (N(e.$$.fragment, o), n = !0);
2882
2882
  },
2883
2883
  o(o) {
2884
- V(e.$$.fragment, o), n = !1;
2884
+ k(e.$$.fragment, o), n = !1;
2885
2885
  },
2886
2886
  d(o) {
2887
- ut(e, o);
2887
+ ct(e, o);
2888
2888
  }
2889
2889
  };
2890
2890
  }
2891
- function Ye(t) {
2891
+ function _e(t) {
2892
2892
  let e, n, o, r;
2893
2893
  const i = [Jo, Ko, Wo], a = [];
2894
2894
  function s(l, d) {
2895
2895
  return (
2896
2896
  /*selector*/
2897
- l[34].type === F.ELLIPSE ? 0 : (
2897
+ l[35].type === G.ELLIPSE ? 0 : (
2898
2898
  /*selector*/
2899
- l[34].type === F.RECTANGLE ? 1 : (
2899
+ l[35].type === G.RECTANGLE ? 1 : (
2900
2900
  /*selector*/
2901
- l[34].type === F.POLYGON ? 2 : -1
2901
+ l[35].type === G.POLYGON ? 2 : -1
2902
2902
  )
2903
2903
  )
2904
2904
  );
@@ -2908,69 +2908,69 @@ function Ye(t) {
2908
2908
  n && n.c(), o = at();
2909
2909
  },
2910
2910
  m(l, d) {
2911
- ~e && a[e].m(l, d), Y(l, o, d), r = !0;
2911
+ ~e && a[e].m(l, d), _(l, o, d), r = !0;
2912
2912
  },
2913
2913
  p(l, d) {
2914
2914
  let p = e;
2915
- e = s(l), e === p ? ~e && a[e].p(l, d) : (n && (ot(), V(a[p], 1, 1, () => {
2915
+ e = s(l), e === p ? ~e && a[e].p(l, d) : (n && (ot(), k(a[p], 1, 1, () => {
2916
2916
  a[p] = null;
2917
- }), rt()), ~e ? (n = a[e], n ? n.p(l, d) : (n = a[e] = i[e](l), n.c()), k(n, 1), n.m(o.parentNode, o)) : n = null);
2917
+ }), rt()), ~e ? (n = a[e], n ? n.p(l, d) : (n = a[e] = i[e](l), n.c()), N(n, 1), n.m(o.parentNode, o)) : n = null);
2918
2918
  },
2919
2919
  i(l) {
2920
- r || (k(n), r = !0);
2920
+ r || (N(n), r = !0);
2921
2921
  },
2922
2922
  o(l) {
2923
- V(n), r = !1;
2923
+ k(n), r = !1;
2924
2924
  },
2925
2925
  d(l) {
2926
- ~e && a[e].d(l), l && L(o);
2926
+ ~e && a[e].d(l), l && Y(o);
2927
2927
  }
2928
2928
  };
2929
2929
  }
2930
- function _e(t) {
2930
+ function Me(t) {
2931
2931
  let e = !/*isEditable*/
2932
2932
  t[7](
2933
2933
  /*annotation*/
2934
- t[31]
2935
- ), n, o, r = e && Le(Qt(t));
2934
+ t[32]
2935
+ ), n, o, r = e && Ye(Zt(t));
2936
2936
  return {
2937
2937
  c() {
2938
2938
  r && r.c(), n = at();
2939
2939
  },
2940
2940
  m(i, a) {
2941
- r && r.m(i, a), Y(i, n, a), o = !0;
2941
+ r && r.m(i, a), _(i, n, a), o = !0;
2942
2942
  },
2943
2943
  p(i, a) {
2944
2944
  a[0] & /*isEditable, $store*/
2945
- 4224 && (e = !/*isEditable*/
2945
+ 8320 && (e = !/*isEditable*/
2946
2946
  i[7](
2947
2947
  /*annotation*/
2948
- i[31]
2949
- )), e ? r ? (r.p(Qt(i), a), a[0] & /*isEditable, $store*/
2950
- 4224 && k(r, 1)) : (r = Le(Qt(i)), r.c(), k(r, 1), r.m(n.parentNode, n)) : r && (ot(), V(r, 1, 1, () => {
2948
+ i[32]
2949
+ )), e ? r ? (r.p(Zt(i), a), a[0] & /*isEditable, $store*/
2950
+ 8320 && N(r, 1)) : (r = Ye(Zt(i)), r.c(), N(r, 1), r.m(n.parentNode, n)) : r && (ot(), k(r, 1, 1, () => {
2951
2951
  r = null;
2952
2952
  }), rt());
2953
2953
  },
2954
2954
  i(i) {
2955
- o || (k(r), o = !0);
2955
+ o || (N(r), o = !0);
2956
2956
  },
2957
2957
  o(i) {
2958
- V(r), o = !1;
2958
+ k(r), o = !1;
2959
2959
  },
2960
2960
  d(i) {
2961
- r && r.d(i), i && L(n);
2961
+ r && r.d(i), i && Y(n);
2962
2962
  }
2963
2963
  };
2964
2964
  }
2965
- function Ie(t) {
2965
+ function Be(t) {
2966
2966
  let e, n, o, r;
2967
- const i = [Zo, Qo], a = [];
2967
+ const i = [Qo, Zo], a = [];
2968
2968
  function s(l, d) {
2969
2969
  return (
2970
2970
  /*editableAnnotations*/
2971
2971
  l[6] ? 0 : (
2972
2972
  /*tool*/
2973
- l[2] && /*drawingEnabled*/
2973
+ l[12] && /*drawingEnabled*/
2974
2974
  l[0] ? 1 : -1
2975
2975
  )
2976
2976
  );
@@ -2980,61 +2980,61 @@ function Ie(t) {
2980
2980
  n && n.c(), o = at();
2981
2981
  },
2982
2982
  m(l, d) {
2983
- ~e && a[e].m(l, d), Y(l, o, d), r = !0;
2983
+ ~e && a[e].m(l, d), _(l, o, d), r = !0;
2984
2984
  },
2985
2985
  p(l, d) {
2986
2986
  let p = e;
2987
- e = s(l), e === p ? ~e && a[e].p(l, d) : (n && (ot(), V(a[p], 1, 1, () => {
2987
+ e = s(l), e === p ? ~e && a[e].p(l, d) : (n && (ot(), k(a[p], 1, 1, () => {
2988
2988
  a[p] = null;
2989
- }), rt()), ~e ? (n = a[e], n ? n.p(l, d) : (n = a[e] = i[e](l), n.c()), k(n, 1), n.m(o.parentNode, o)) : n = null);
2989
+ }), rt()), ~e ? (n = a[e], n ? n.p(l, d) : (n = a[e] = i[e](l), n.c()), N(n, 1), n.m(o.parentNode, o)) : n = null);
2990
2990
  },
2991
2991
  i(l) {
2992
- r || (k(n), r = !0);
2992
+ r || (N(n), r = !0);
2993
2993
  },
2994
2994
  o(l) {
2995
- V(n), r = !1;
2995
+ k(n), r = !1;
2996
2996
  },
2997
2997
  d(l) {
2998
- ~e && a[e].d(l), l && L(o);
2998
+ ~e && a[e].d(l), l && Y(o);
2999
2999
  }
3000
3000
  };
3001
3001
  }
3002
- function Qo(t) {
3002
+ function Zo(t) {
3003
3003
  let e = (
3004
- /*tool*/
3004
+ /*toolName*/
3005
3005
  t[2]
3006
- ), n, o, r = Me(t);
3006
+ ), n, o, r = Xe(t);
3007
3007
  return {
3008
3008
  c() {
3009
3009
  r.c(), n = at();
3010
3010
  },
3011
3011
  m(i, a) {
3012
- r.m(i, a), Y(i, n, a), o = !0;
3012
+ r.m(i, a), _(i, n, a), o = !0;
3013
3013
  },
3014
3014
  p(i, a) {
3015
- a[0] & /*tool*/
3016
- 4 && K(e, e = /*tool*/
3017
- i[2]) ? (ot(), V(r, 1, 1, G), rt(), r = Me(i), r.c(), k(r, 1), r.m(n.parentNode, n)) : r.p(i, a);
3015
+ a[0] & /*toolName*/
3016
+ 4 && W(e, e = /*toolName*/
3017
+ i[2]) ? (ot(), k(r, 1, 1, U), rt(), r = Xe(i), r.c(), N(r, 1), r.m(n.parentNode, n)) : r.p(i, a);
3018
3018
  },
3019
3019
  i(i) {
3020
- o || (k(r), o = !0);
3020
+ o || (N(r), o = !0);
3021
3021
  },
3022
3022
  o(i) {
3023
- V(r), o = !1;
3023
+ k(r), o = !1;
3024
3024
  },
3025
3025
  d(i) {
3026
- i && L(n), r.d(i);
3026
+ i && Y(n), r.d(i);
3027
3027
  }
3028
3028
  };
3029
3029
  }
3030
- function Zo(t) {
3030
+ function Qo(t) {
3031
3031
  let e, n, o = (
3032
3032
  /*editableAnnotations*/
3033
3033
  t[6]
3034
3034
  ), r = [];
3035
3035
  for (let a = 0; a < o.length; a += 1)
3036
- r[a] = Xe(Se(t, o, a));
3037
- const i = (a) => V(r[a], 1, 1, () => {
3036
+ r[a] = Ie(Oe(t, o, a));
3037
+ const i = (a) => k(r[a], 1, 1, () => {
3038
3038
  r[a] = null;
3039
3039
  });
3040
3040
  return {
@@ -3046,17 +3046,17 @@ function Zo(t) {
3046
3046
  m(a, s) {
3047
3047
  for (let l = 0; l < r.length; l += 1)
3048
3048
  r[l] && r[l].m(a, s);
3049
- Y(a, e, s), n = !0;
3049
+ _(a, e, s), n = !0;
3050
3050
  },
3051
3051
  p(a, s) {
3052
3052
  if (s[0] & /*editableAnnotations, drawingEl, style, transform, $scale, onChangeSelected*/
3053
- 140370) {
3053
+ 279634) {
3054
3054
  o = /*editableAnnotations*/
3055
3055
  a[6];
3056
3056
  let l;
3057
3057
  for (l = 0; l < o.length; l += 1) {
3058
- const d = Se(a, o, l);
3059
- r[l] ? (r[l].p(d, s), k(r[l], 1)) : (r[l] = Xe(d), r[l].c(), k(r[l], 1), r[l].m(e.parentNode, e));
3058
+ const d = Oe(a, o, l);
3059
+ r[l] ? (r[l].p(d, s), N(r[l], 1)) : (r[l] = Ie(d), r[l].c(), N(r[l], 1), r[l].m(e.parentNode, e));
3060
3060
  }
3061
3061
  for (ot(), l = o.length; l < r.length; l += 1)
3062
3062
  i(l);
@@ -3066,24 +3066,24 @@ function Zo(t) {
3066
3066
  i(a) {
3067
3067
  if (!n) {
3068
3068
  for (let s = 0; s < o.length; s += 1)
3069
- k(r[s]);
3069
+ N(r[s]);
3070
3070
  n = !0;
3071
3071
  }
3072
3072
  },
3073
3073
  o(a) {
3074
3074
  r = r.filter(Boolean);
3075
3075
  for (let s = 0; s < r.length; s += 1)
3076
- V(r[s]);
3076
+ k(r[s]);
3077
3077
  n = !1;
3078
3078
  },
3079
3079
  d(a) {
3080
- re(r, a), a && L(e);
3080
+ ie(r, a), a && Y(e);
3081
3081
  }
3082
3082
  };
3083
3083
  }
3084
- function Me(t) {
3084
+ function Xe(t) {
3085
3085
  let e, n;
3086
- return e = new bo({
3086
+ return e = new Eo({
3087
3087
  props: {
3088
3088
  target: (
3089
3089
  /*drawingEl*/
@@ -3091,7 +3091,7 @@ function Me(t) {
3091
3091
  ),
3092
3092
  tool: (
3093
3093
  /*tool*/
3094
- t[2]
3094
+ t[12]
3095
3095
  ),
3096
3096
  drawingMode: (
3097
3097
  /*drawingMode*/
@@ -3103,60 +3103,60 @@ function Me(t) {
3103
3103
  ),
3104
3104
  viewportScale: (
3105
3105
  /*$scale*/
3106
- t[13]
3106
+ t[14]
3107
3107
  )
3108
3108
  }
3109
3109
  }), e.$on(
3110
3110
  "create",
3111
3111
  /*onSelectionCreated*/
3112
- t[16]
3112
+ t[17]
3113
3113
  ), {
3114
3114
  c() {
3115
- gt(e.$$.fragment);
3115
+ pt(e.$$.fragment);
3116
3116
  },
3117
3117
  m(o, r) {
3118
- ct(e, o, r), n = !0;
3118
+ dt(e, o, r), n = !0;
3119
3119
  },
3120
3120
  p(o, r) {
3121
3121
  const i = {};
3122
3122
  r[0] & /*drawingEl*/
3123
3123
  16 && (i.target = /*drawingEl*/
3124
3124
  o[4]), r[0] & /*tool*/
3125
- 4 && (i.tool = /*tool*/
3126
- o[2]), r[0] & /*drawingMode*/
3125
+ 4096 && (i.tool = /*tool*/
3126
+ o[12]), r[0] & /*drawingMode*/
3127
3127
  2048 && (i.drawingMode = /*drawingMode*/
3128
3128
  o[11]), r[0] & /*transform*/
3129
3129
  1024 && (i.transform = /*transform*/
3130
3130
  o[10]), r[0] & /*$scale*/
3131
- 8192 && (i.viewportScale = /*$scale*/
3132
- o[13]), e.$set(i);
3131
+ 16384 && (i.viewportScale = /*$scale*/
3132
+ o[14]), e.$set(i);
3133
3133
  },
3134
3134
  i(o) {
3135
- n || (k(e.$$.fragment, o), n = !0);
3135
+ n || (N(e.$$.fragment, o), n = !0);
3136
3136
  },
3137
3137
  o(o) {
3138
- V(e.$$.fragment, o), n = !1;
3138
+ k(e.$$.fragment, o), n = !1;
3139
3139
  },
3140
3140
  d(o) {
3141
- ut(e, o);
3141
+ ct(e, o);
3142
3142
  }
3143
3143
  };
3144
3144
  }
3145
- function Be(t) {
3145
+ function Ce(t) {
3146
3146
  let e, n;
3147
- return e = new $o({
3147
+ return e = new xo({
3148
3148
  props: {
3149
3149
  target: (
3150
3150
  /*drawingEl*/
3151
3151
  t[4]
3152
3152
  ),
3153
- editor: be(
3153
+ editor: Ee(
3154
3154
  /*editable*/
3155
- t[28].target.selector
3155
+ t[29].target.selector
3156
3156
  ),
3157
3157
  annotation: (
3158
3158
  /*editable*/
3159
- t[28]
3159
+ t[29]
3160
3160
  ),
3161
3161
  style: (
3162
3162
  /*style*/
@@ -3168,26 +3168,26 @@ function Be(t) {
3168
3168
  ),
3169
3169
  viewportScale: (
3170
3170
  /*$scale*/
3171
- t[13]
3171
+ t[14]
3172
3172
  )
3173
3173
  }
3174
3174
  }), e.$on("change", function() {
3175
3175
  H(
3176
3176
  /*onChangeSelected*/
3177
- t[17](
3177
+ t[18](
3178
3178
  /*editable*/
3179
- t[28]
3179
+ t[29]
3180
3180
  )
3181
- ) && t[17](
3181
+ ) && t[18](
3182
3182
  /*editable*/
3183
- t[28]
3183
+ t[29]
3184
3184
  ).apply(this, arguments);
3185
3185
  }), {
3186
3186
  c() {
3187
- gt(e.$$.fragment);
3187
+ pt(e.$$.fragment);
3188
3188
  },
3189
3189
  m(o, r) {
3190
- ct(e, o, r), n = !0;
3190
+ dt(e, o, r), n = !0;
3191
3191
  },
3192
3192
  p(o, r) {
3193
3193
  t = o;
@@ -3195,89 +3195,89 @@ function Be(t) {
3195
3195
  r[0] & /*drawingEl*/
3196
3196
  16 && (i.target = /*drawingEl*/
3197
3197
  t[4]), r[0] & /*editableAnnotations*/
3198
- 64 && (i.editor = be(
3198
+ 64 && (i.editor = Ee(
3199
3199
  /*editable*/
3200
- t[28].target.selector
3200
+ t[29].target.selector
3201
3201
  )), r[0] & /*editableAnnotations*/
3202
3202
  64 && (i.annotation = /*editable*/
3203
- t[28]), r[0] & /*style*/
3203
+ t[29]), r[0] & /*style*/
3204
3204
  2 && (i.style = /*style*/
3205
3205
  t[1]), r[0] & /*transform*/
3206
3206
  1024 && (i.transform = /*transform*/
3207
3207
  t[10]), r[0] & /*$scale*/
3208
- 8192 && (i.viewportScale = /*$scale*/
3209
- t[13]), e.$set(i);
3208
+ 16384 && (i.viewportScale = /*$scale*/
3209
+ t[14]), e.$set(i);
3210
3210
  },
3211
3211
  i(o) {
3212
- n || (k(e.$$.fragment, o), n = !0);
3212
+ n || (N(e.$$.fragment, o), n = !0);
3213
3213
  },
3214
3214
  o(o) {
3215
- V(e.$$.fragment, o), n = !1;
3215
+ k(e.$$.fragment, o), n = !1;
3216
3216
  },
3217
3217
  d(o) {
3218
- ut(e, o);
3218
+ ct(e, o);
3219
3219
  }
3220
3220
  };
3221
3221
  }
3222
- function Xe(t) {
3222
+ function Ie(t) {
3223
3223
  let e = (
3224
3224
  /*editable*/
3225
- t[28].id
3226
- ), n, o, r = Be(t);
3225
+ t[29].id
3226
+ ), n, o, r = Ce(t);
3227
3227
  return {
3228
3228
  c() {
3229
3229
  r.c(), n = at();
3230
3230
  },
3231
3231
  m(i, a) {
3232
- r.m(i, a), Y(i, n, a), o = !0;
3232
+ r.m(i, a), _(i, n, a), o = !0;
3233
3233
  },
3234
3234
  p(i, a) {
3235
3235
  a[0] & /*editableAnnotations*/
3236
- 64 && K(e, e = /*editable*/
3237
- i[28].id) ? (ot(), V(r, 1, 1, G), rt(), r = Be(i), r.c(), k(r, 1), r.m(n.parentNode, n)) : r.p(i, a);
3236
+ 64 && W(e, e = /*editable*/
3237
+ i[29].id) ? (ot(), k(r, 1, 1, U), rt(), r = Ce(i), r.c(), N(r, 1), r.m(n.parentNode, n)) : r.p(i, a);
3238
3238
  },
3239
3239
  i(i) {
3240
- o || (k(r), o = !0);
3240
+ o || (N(r), o = !0);
3241
3241
  },
3242
3242
  o(i) {
3243
- V(r), o = !1;
3243
+ k(r), o = !1;
3244
3244
  },
3245
3245
  d(i) {
3246
- i && L(n), r.d(i);
3246
+ i && Y(n), r.d(i);
3247
3247
  }
3248
3248
  };
3249
3249
  }
3250
3250
  function tr(t) {
3251
3251
  let e, n, o, r, i, a, s = (
3252
3252
  /*$store*/
3253
- t[12]
3253
+ t[13]
3254
3254
  ), l = [];
3255
3255
  for (let c = 0; c < s.length; c += 1)
3256
- l[c] = _e(Oe(t, s, c));
3257
- const d = (c) => V(l[c], 1, 1, () => {
3256
+ l[c] = Me(Le(t, s, c));
3257
+ const d = (c) => k(l[c], 1, 1, () => {
3258
3258
  l[c] = null;
3259
3259
  });
3260
3260
  let p = (
3261
3261
  /*drawingEl*/
3262
- t[4] && Ie(t)
3262
+ t[4] && Be(t)
3263
3263
  );
3264
3264
  return {
3265
3265
  c() {
3266
- e = N("svg"), n = N("g");
3266
+ e = R("svg"), n = R("g");
3267
3267
  for (let c = 0; c < l.length; c += 1)
3268
3268
  l[c].c();
3269
- o = N("g"), p && p.c(), u(o, "class", "drawing"), u(e, "class", "a9s-annotationlayer"), he(
3269
+ o = R("g"), p && p.c(), u(o, "class", "drawing"), u(e, "class", "a9s-annotationlayer"), pe(
3270
3270
  e,
3271
3271
  "drawing",
3272
3272
  /*tool*/
3273
- t[2]
3273
+ t[12]
3274
3274
  );
3275
3275
  },
3276
3276
  m(c, g) {
3277
- Y(c, e, g), dt(e, n);
3277
+ _(c, e, g), lt(e, n);
3278
3278
  for (let h = 0; h < l.length; h += 1)
3279
3279
  l[h] && l[h].m(n, null);
3280
- dt(e, o), p && p.m(o, null), t[24](o), t[25](e), r = !0, i || (a = [
3280
+ lt(e, o), p && p.m(o, null), t[25](o), t[26](e), r = !0, i || (a = [
3281
3281
  z(e, "pointerup", function() {
3282
3282
  H(
3283
3283
  /*onPointerUp*/
@@ -3294,131 +3294,133 @@ function tr(t) {
3294
3294
  },
3295
3295
  p(c, g) {
3296
3296
  if (t = c, g[0] & /*$store, style, isEditable*/
3297
- 4226) {
3297
+ 8322) {
3298
3298
  s = /*$store*/
3299
- t[12];
3299
+ t[13];
3300
3300
  let h;
3301
3301
  for (h = 0; h < s.length; h += 1) {
3302
- const m = Oe(t, s, h);
3303
- l[h] ? (l[h].p(m, g), k(l[h], 1)) : (l[h] = _e(m), l[h].c(), k(l[h], 1), l[h].m(n, null));
3302
+ const m = Le(t, s, h);
3303
+ l[h] ? (l[h].p(m, g), N(l[h], 1)) : (l[h] = Me(m), l[h].c(), N(l[h], 1), l[h].m(n, null));
3304
3304
  }
3305
3305
  for (ot(), h = s.length; h < l.length; h += 1)
3306
3306
  d(h);
3307
3307
  rt();
3308
3308
  }
3309
3309
  t[4] ? p ? (p.p(t, g), g[0] & /*drawingEl*/
3310
- 16 && k(p, 1)) : (p = Ie(t), p.c(), k(p, 1), p.m(o, null)) : p && (ot(), V(p, 1, 1, () => {
3310
+ 16 && N(p, 1)) : (p = Be(t), p.c(), N(p, 1), p.m(o, null)) : p && (ot(), k(p, 1, 1, () => {
3311
3311
  p = null;
3312
3312
  }), rt()), (!r || g[0] & /*tool*/
3313
- 4) && he(
3313
+ 4096) && pe(
3314
3314
  e,
3315
3315
  "drawing",
3316
3316
  /*tool*/
3317
- t[2]
3317
+ t[12]
3318
3318
  );
3319
3319
  },
3320
3320
  i(c) {
3321
3321
  if (!r) {
3322
3322
  for (let g = 0; g < s.length; g += 1)
3323
- k(l[g]);
3324
- k(p), r = !0;
3323
+ N(l[g]);
3324
+ N(p), r = !0;
3325
3325
  }
3326
3326
  },
3327
3327
  o(c) {
3328
3328
  l = l.filter(Boolean);
3329
3329
  for (let g = 0; g < l.length; g += 1)
3330
- V(l[g]);
3331
- V(p), r = !1;
3330
+ k(l[g]);
3331
+ k(p), r = !1;
3332
3332
  },
3333
3333
  d(c) {
3334
- c && L(e), re(l, c), p && p.d(), t[24](null), t[25](null), i = !1, it(a);
3334
+ c && Y(e), ie(l, c), p && p.d(), t[25](null), t[26](null), i = !1, it(a);
3335
3335
  }
3336
3336
  };
3337
3337
  }
3338
3338
  function er(t, e, n) {
3339
- let o, r, i, a, s, l, d, p, c = G, g = () => (c(), c = De(b, (I) => n(13, p = I)), b);
3340
- t.$$.on_destroy.push(() => c());
3341
- let { drawingEnabled: h } = e, { image: m } = e, { preferredDrawingMode: x } = e, { state: A } = e, { style: w = void 0 } = e, { tool: y, opts: E } = Ke("rectangle"), { tool: v = y, opts: B = E } = e, { user: R } = e, D, f, b;
3342
- Mt(() => g(n(5, b = Oo(m, f))));
3343
- const { selection: $, store: T } = A;
3344
- ue(t, $, (I) => n(23, l = I)), ue(t, T, (I) => n(12, d = I));
3345
- let _ = null, X = null;
3346
- const J = (I) => {
3347
- T.unobserve(_);
3348
- const q = I.filter(({ editable: j }) => j).map(({ id: j }) => j);
3349
- q.length > 0 ? (n(6, X = q.map((j) => T.getAnnotation(j))), _ = (j) => {
3350
- const { updated: U } = j.changes;
3351
- n(6, X = U.map((st) => st.newValue));
3352
- }, T.observe(_, { annotations: q })) : n(6, X = null);
3353
- }, ft = (I) => {
3354
- const q = je(), j = {
3339
+ let o, r, i, a, s, l, d, p, c, g, h = U, m = () => (h(), h = De(f, (L) => n(14, g = L)), f);
3340
+ t.$$.on_destroy.push(() => h());
3341
+ let { drawingEnabled: x } = e, { image: A } = e, { preferredDrawingMode: $ } = e, { state: y } = e, { style: E = void 0 } = e, { toolName: v = re().length > 0 ? re()[0] : void 0 } = e, { user: X } = e, I, V, f;
3342
+ Mt(() => m(n(5, f = Lo(A, V))));
3343
+ const { selection: b, store: w } = y;
3344
+ he(t, b, (L) => n(24, p = L)), he(t, w, (L) => n(13, c = L));
3345
+ let S = null, M = null;
3346
+ const C = (L) => {
3347
+ w.unobserve(S);
3348
+ const q = L.filter(({ editable: F }) => F).map(({ id: F }) => F);
3349
+ q.length > 0 ? (n(6, M = q.map((F) => w.getAnnotation(F))), S = (F) => {
3350
+ const { updated: Q } = F.changes;
3351
+ n(6, M = Q.map((P) => P.newValue));
3352
+ }, w.observe(S, { annotations: q })) : n(6, M = null);
3353
+ }, K = (L) => {
3354
+ const q = je(), F = {
3355
3355
  id: q,
3356
3356
  bodies: [],
3357
3357
  target: {
3358
3358
  annotation: q,
3359
- selector: I.detail,
3360
- creator: R,
3359
+ selector: L.detail,
3360
+ creator: X,
3361
3361
  created: /* @__PURE__ */ new Date()
3362
3362
  }
3363
3363
  };
3364
- T.addAnnotation(j), $.setSelected(j.id);
3365
- }, mt = (I) => (q) => {
3366
- var j;
3367
- const { target: U } = I, st = 10 * 60 * 1e3, lt = ((j = U.creator) == null ? void 0 : j.id) !== R.id || !U.created || (/* @__PURE__ */ new Date()).getTime() - U.created.getTime() > st;
3368
- T.updateTarget({
3369
- ...U,
3364
+ w.addAnnotation(F), b.setSelected(F.id);
3365
+ }, gt = (L) => (q) => {
3366
+ var F;
3367
+ const { target: Q } = L, P = 10 * 60 * 1e3, st = ((F = Q.creator) == null ? void 0 : F.id) !== X.id || !Q.created || (/* @__PURE__ */ new Date()).getTime() - Q.created.getTime() > P;
3368
+ w.updateTarget({
3369
+ ...Q,
3370
3370
  selector: q.detail,
3371
- created: lt ? U.created : /* @__PURE__ */ new Date(),
3372
- updated: lt ? /* @__PURE__ */ new Date() : null,
3373
- updatedBy: lt ? R : null
3371
+ created: st ? Q.created : /* @__PURE__ */ new Date(),
3372
+ updated: st ? /* @__PURE__ */ new Date() : null,
3373
+ updatedBy: st ? X : null
3374
3374
  });
3375
3375
  };
3376
- function St(I) {
3377
- Ut[I ? "unshift" : "push"](() => {
3378
- D = I, n(4, D);
3376
+ function ft(L) {
3377
+ Ut[L ? "unshift" : "push"](() => {
3378
+ I = L, n(4, I);
3379
3379
  });
3380
3380
  }
3381
- function W(I) {
3382
- Ut[I ? "unshift" : "push"](() => {
3383
- f = I, n(3, f);
3381
+ function Tt(L) {
3382
+ Ut[L ? "unshift" : "push"](() => {
3383
+ V = L, n(3, V);
3384
3384
  });
3385
3385
  }
3386
- return t.$$set = (I) => {
3387
- "drawingEnabled" in I && n(0, h = I.drawingEnabled), "image" in I && n(18, m = I.image), "preferredDrawingMode" in I && n(19, x = I.preferredDrawingMode), "state" in I && n(20, A = I.state), "style" in I && n(1, w = I.style), "tool" in I && n(2, v = I.tool), "opts" in I && n(21, B = I.opts), "user" in I && n(22, R = I.user);
3386
+ return t.$$set = (L) => {
3387
+ "drawingEnabled" in L && n(0, x = L.drawingEnabled), "image" in L && n(19, A = L.image), "preferredDrawingMode" in L && n(20, $ = L.preferredDrawingMode), "state" in L && n(21, y = L.state), "style" in L && n(1, E = L.style), "toolName" in L && n(2, v = L.toolName), "user" in L && n(22, X = L.user);
3388
3388
  }, t.$$.update = () => {
3389
- t.$$.dirty[0] & /*opts, preferredDrawingMode*/
3390
- 2621440 && n(11, o = (B == null ? void 0 : B.drawingMode) || x), t.$$.dirty[0] & /*svgEl*/
3391
- 8 && n(10, r = jo(f)), t.$$.dirty[0] & /*svgEl*/
3392
- 8 && n(9, { onPointerDown: i, onPointerUp: a } = zo(f, T), i, (n(8, a), n(3, f))), t.$$.dirty[0] & /*$selection*/
3393
- 8388608 && n(7, s = (I) => l.selected.find((q) => q.id === I.id && q.editable)), t.$$.dirty[0] & /*$selection*/
3394
- 8388608 && J(l.selected);
3389
+ t.$$.dirty[0] & /*toolName*/
3390
+ 4 && n(12, { tool: o, opts: r } = Je(v), o, (n(23, r), n(2, v))), t.$$.dirty[0] & /*opts, preferredDrawingMode*/
3391
+ 9437184 && n(11, i = (r == null ? void 0 : r.drawingMode) || $), t.$$.dirty[0] & /*svgEl*/
3392
+ 8 && n(10, a = Po(V)), t.$$.dirty[0] & /*svgEl*/
3393
+ 8 && n(9, { onPointerDown: s, onPointerUp: l } = zo(V, w), s, (n(8, l), n(3, V))), t.$$.dirty[0] & /*$selection*/
3394
+ 16777216 && n(7, d = (L) => p.selected.find((q) => q.id === L.id && q.editable)), t.$$.dirty[0] & /*$selection*/
3395
+ 16777216 && C(p.selected);
3395
3396
  }, [
3396
- h,
3397
- w,
3397
+ x,
3398
+ E,
3398
3399
  v,
3400
+ V,
3401
+ I,
3399
3402
  f,
3400
- D,
3401
- b,
3402
- X,
3403
+ M,
3404
+ d,
3405
+ l,
3403
3406
  s,
3404
3407
  a,
3405
3408
  i,
3406
- r,
3407
3409
  o,
3408
- d,
3409
- p,
3410
+ c,
3411
+ g,
3412
+ b,
3413
+ w,
3414
+ K,
3415
+ gt,
3416
+ A,
3410
3417
  $,
3411
- T,
3418
+ y,
3419
+ X,
3420
+ r,
3421
+ p,
3412
3422
  ft,
3413
- mt,
3414
- m,
3415
- x,
3416
- A,
3417
- B,
3418
- R,
3419
- l,
3420
- St,
3421
- W
3423
+ Tt
3422
3424
  ];
3423
3425
  }
3424
3426
  class nr extends nt {
@@ -3428,15 +3430,14 @@ class nr extends nt {
3428
3430
  e,
3429
3431
  er,
3430
3432
  tr,
3431
- K,
3433
+ W,
3432
3434
  {
3433
3435
  drawingEnabled: 0,
3434
- image: 18,
3435
- preferredDrawingMode: 19,
3436
- state: 20,
3436
+ image: 19,
3437
+ preferredDrawingMode: 20,
3438
+ state: 21,
3437
3439
  style: 1,
3438
- tool: 2,
3439
- opts: 21,
3440
+ toolName: 2,
3440
3441
  user: 22
3441
3442
  },
3442
3443
  null,
@@ -3445,25 +3446,25 @@ class nr extends nt {
3445
3446
  }
3446
3447
  }
3447
3448
  function or(t, e, n, o, r) {
3448
- Je(t, e, n || 0, o || t.length - 1, r || rr);
3449
+ Ze(t, e, n || 0, o || t.length - 1, r || rr);
3449
3450
  }
3450
- function Je(t, e, n, o, r) {
3451
+ function Ze(t, e, n, o, r) {
3451
3452
  for (; o > n; ) {
3452
3453
  if (o - n > 600) {
3453
3454
  var i = o - n + 1, a = e - n + 1, s = Math.log(i), l = 0.5 * Math.exp(2 * s / 3), d = 0.5 * Math.sqrt(s * l * (i - l) / i) * (a - i / 2 < 0 ? -1 : 1), p = Math.max(n, Math.floor(e - a * l / i + d)), c = Math.min(o, Math.floor(e + (i - a) * l / i + d));
3454
- Je(t, e, p, c, r);
3455
+ Ze(t, e, p, c, r);
3455
3456
  }
3456
3457
  var g = t[e], h = n, m = o;
3457
- for (Ot(t, n, e), r(t[o], g) > 0 && Ot(t, n, o); h < m; ) {
3458
- for (Ot(t, h, m), h++, m--; r(t[h], g) < 0; )
3458
+ for (St(t, n, e), r(t[o], g) > 0 && St(t, n, o); h < m; ) {
3459
+ for (St(t, h, m), h++, m--; r(t[h], g) < 0; )
3459
3460
  h++;
3460
3461
  for (; r(t[m], g) > 0; )
3461
3462
  m--;
3462
3463
  }
3463
- r(t[n], g) === 0 ? Ot(t, n, m) : (m++, Ot(t, m, o)), m <= e && (n = m + 1), e <= m && (o = m - 1);
3464
+ r(t[n], g) === 0 ? St(t, n, m) : (m++, St(t, m, o)), m <= e && (n = m + 1), e <= m && (o = m - 1);
3464
3465
  }
3465
3466
  }
3466
- function Ot(t, e, n) {
3467
+ function St(t, e, n) {
3467
3468
  var o = t[e];
3468
3469
  t[e] = t[n], t[n] = o;
3469
3470
  }
@@ -3480,13 +3481,13 @@ class ir {
3480
3481
  search(e) {
3481
3482
  let n = this.data;
3482
3483
  const o = [];
3483
- if (!Dt(e, n))
3484
+ if (!kt(e, n))
3484
3485
  return o;
3485
3486
  const r = this.toBBox, i = [];
3486
3487
  for (; n; ) {
3487
3488
  for (let a = 0; a < n.children.length; a++) {
3488
3489
  const s = n.children[a], l = n.leaf ? r(s) : s;
3489
- Dt(e, l) && (n.leaf ? o.push(s) : te(e, l) ? this._all(s, o) : i.push(s));
3490
+ kt(e, l) && (n.leaf ? o.push(s) : te(e, l) ? this._all(s, o) : i.push(s));
3490
3491
  }
3491
3492
  n = i.pop();
3492
3493
  }
@@ -3494,13 +3495,13 @@ class ir {
3494
3495
  }
3495
3496
  collides(e) {
3496
3497
  let n = this.data;
3497
- if (!Dt(e, n))
3498
+ if (!kt(e, n))
3498
3499
  return !1;
3499
3500
  const o = [];
3500
3501
  for (; n; ) {
3501
3502
  for (let r = 0; r < n.children.length; r++) {
3502
3503
  const i = n.children[r], a = n.leaf ? this.toBBox(i) : i;
3503
- if (Dt(e, a)) {
3504
+ if (kt(e, a)) {
3504
3505
  if (n.leaf || te(e, a))
3505
3506
  return !0;
3506
3507
  o.push(i);
@@ -3536,7 +3537,7 @@ class ir {
3536
3537
  return e && this._insert(e, this.data.height - 1), this;
3537
3538
  }
3538
3539
  clear() {
3539
- return this.data = Et([]), this;
3540
+ return this.data = bt([]), this;
3540
3541
  }
3541
3542
  remove(e, n) {
3542
3543
  if (!e)
@@ -3579,8 +3580,8 @@ class ir {
3579
3580
  const i = o - n + 1;
3580
3581
  let a = this._maxEntries, s;
3581
3582
  if (i <= a)
3582
- return s = Et(e.slice(n, o + 1)), xt(s, this.toBBox), s;
3583
- r || (r = Math.ceil(Math.log(i) / Math.log(a)), a = Math.ceil(i / Math.pow(a, r - 1))), s = Et([]), s.leaf = !1, s.height = r;
3583
+ return s = bt(e.slice(n, o + 1)), $t(s, this.toBBox), s;
3584
+ r || (r = Math.ceil(Math.log(i) / Math.log(a)), a = Math.ceil(i / Math.pow(a, r - 1))), s = bt([]), s.leaf = !1, s.height = r;
3584
3585
  const l = Math.ceil(i / a), d = l * Math.ceil(Math.sqrt(a));
3585
3586
  Re(e, n, o, d, this.compareMinX);
3586
3587
  for (let p = n; p <= o; p += d) {
@@ -3591,13 +3592,13 @@ class ir {
3591
3592
  s.children.push(this._build(e, g, h, r - 1));
3592
3593
  }
3593
3594
  }
3594
- return xt(s, this.toBBox), s;
3595
+ return $t(s, this.toBBox), s;
3595
3596
  }
3596
3597
  _chooseSubtree(e, n, o, r) {
3597
3598
  for (; r.push(n), !(n.leaf || r.length - 1 === o); ) {
3598
3599
  let i = 1 / 0, a = 1 / 0, s;
3599
3600
  for (let l = 0; l < n.children.length; l++) {
3600
- const d = n.children[l], p = Zt(d), c = dr(e, d) - p;
3601
+ const d = n.children[l], p = Qt(d), c = dr(e, d) - p;
3601
3602
  c < a ? (a = c, i = p < i ? p : i, s = d) : c === a && p < i && (i = p, s = d);
3602
3603
  }
3603
3604
  n = s || n.children[0];
@@ -3606,7 +3607,7 @@ class ir {
3606
3607
  }
3607
3608
  _insert(e, n, o) {
3608
3609
  const r = o ? e : this.toBBox(e), i = [], a = this._chooseSubtree(r, this.data, n, i);
3609
- for (a.children.push(e), Yt(a, r); n >= 0 && i[n].children.length > this._maxEntries; )
3610
+ for (a.children.push(e), Lt(a, r); n >= 0 && i[n].children.length > this._maxEntries; )
3610
3611
  this._split(i, n), n--;
3611
3612
  this._adjustParentBBoxes(r, i, n);
3612
3613
  }
@@ -3614,16 +3615,16 @@ class ir {
3614
3615
  _split(e, n) {
3615
3616
  const o = e[n], r = o.children.length, i = this._minEntries;
3616
3617
  this._chooseSplitAxis(o, i, r);
3617
- const a = this._chooseSplitIndex(o, i, r), s = Et(o.children.splice(a, o.children.length - a));
3618
- s.height = o.height, s.leaf = o.leaf, xt(o, this.toBBox), xt(s, this.toBBox), n ? e[n - 1].children.push(s) : this._splitRoot(o, s);
3618
+ const a = this._chooseSplitIndex(o, i, r), s = bt(o.children.splice(a, o.children.length - a));
3619
+ s.height = o.height, s.leaf = o.leaf, $t(o, this.toBBox), $t(s, this.toBBox), n ? e[n - 1].children.push(s) : this._splitRoot(o, s);
3619
3620
  }
3620
3621
  _splitRoot(e, n) {
3621
- this.data = Et([e, n]), this.data.height = e.height + 1, this.data.leaf = !1, xt(this.data, this.toBBox);
3622
+ this.data = bt([e, n]), this.data.height = e.height + 1, this.data.leaf = !1, $t(this.data, this.toBBox);
3622
3623
  }
3623
3624
  _chooseSplitIndex(e, n, o) {
3624
3625
  let r, i = 1 / 0, a = 1 / 0;
3625
3626
  for (let s = n; s <= o - n; s++) {
3626
- const l = Lt(e, 0, s, this.toBBox), d = Lt(e, s, o, this.toBBox), p = cr(l, d), c = Zt(l) + Zt(d);
3627
+ const l = Ot(e, 0, s, this.toBBox), d = Ot(e, s, o, this.toBBox), p = cr(l, d), c = Qt(l) + Qt(d);
3627
3628
  p < i ? (i = p, r = s, a = c < a ? c : a) : p === i && c < a && (a = c, r = s);
3628
3629
  }
3629
3630
  return r || o - n;
@@ -3636,25 +3637,25 @@ class ir {
3636
3637
  // total margin of all possible split distributions where each node is at least m full
3637
3638
  _allDistMargin(e, n, o, r) {
3638
3639
  e.children.sort(r);
3639
- const i = this.toBBox, a = Lt(e, 0, n, i), s = Lt(e, o - n, o, i);
3640
+ const i = this.toBBox, a = Ot(e, 0, n, i), s = Ot(e, o - n, o, i);
3640
3641
  let l = Vt(a) + Vt(s);
3641
3642
  for (let d = n; d < o - n; d++) {
3642
3643
  const p = e.children[d];
3643
- Yt(a, e.leaf ? i(p) : p), l += Vt(a);
3644
+ Lt(a, e.leaf ? i(p) : p), l += Vt(a);
3644
3645
  }
3645
3646
  for (let d = o - n - 1; d >= n; d--) {
3646
3647
  const p = e.children[d];
3647
- Yt(s, e.leaf ? i(p) : p), l += Vt(s);
3648
+ Lt(s, e.leaf ? i(p) : p), l += Vt(s);
3648
3649
  }
3649
3650
  return l;
3650
3651
  }
3651
3652
  _adjustParentBBoxes(e, n, o) {
3652
3653
  for (let r = o; r >= 0; r--)
3653
- Yt(n[r], e);
3654
+ Lt(n[r], e);
3654
3655
  }
3655
3656
  _condense(e) {
3656
3657
  for (let n = e.length - 1, o; n >= 0; n--)
3657
- e[n].children.length === 0 ? n > 0 ? (o = e[n - 1].children, o.splice(o.indexOf(e[n]), 1)) : this.clear() : xt(e[n], this.toBBox);
3658
+ e[n].children.length === 0 ? n > 0 ? (o = e[n - 1].children, o.splice(o.indexOf(e[n]), 1)) : this.clear() : $t(e[n], this.toBBox);
3658
3659
  }
3659
3660
  }
3660
3661
  function ar(t, e, n) {
@@ -3665,18 +3666,18 @@ function ar(t, e, n) {
3665
3666
  return o;
3666
3667
  return -1;
3667
3668
  }
3668
- function xt(t, e) {
3669
- Lt(t, 0, t.children.length, e, t);
3669
+ function $t(t, e) {
3670
+ Ot(t, 0, t.children.length, e, t);
3670
3671
  }
3671
- function Lt(t, e, n, o, r) {
3672
- r || (r = Et(null)), r.minX = 1 / 0, r.minY = 1 / 0, r.maxX = -1 / 0, r.maxY = -1 / 0;
3672
+ function Ot(t, e, n, o, r) {
3673
+ r || (r = bt(null)), r.minX = 1 / 0, r.minY = 1 / 0, r.maxX = -1 / 0, r.maxY = -1 / 0;
3673
3674
  for (let i = e; i < n; i++) {
3674
3675
  const a = t.children[i];
3675
- Yt(r, t.leaf ? o(a) : a);
3676
+ Lt(r, t.leaf ? o(a) : a);
3676
3677
  }
3677
3678
  return r;
3678
3679
  }
3679
- function Yt(t, e) {
3680
+ function Lt(t, e) {
3680
3681
  return t.minX = Math.min(t.minX, e.minX), t.minY = Math.min(t.minY, e.minY), t.maxX = Math.max(t.maxX, e.maxX), t.maxY = Math.max(t.maxY, e.maxY), t;
3681
3682
  }
3682
3683
  function sr(t, e) {
@@ -3685,7 +3686,7 @@ function sr(t, e) {
3685
3686
  function lr(t, e) {
3686
3687
  return t.minY - e.minY;
3687
3688
  }
3688
- function Zt(t) {
3689
+ function Qt(t) {
3689
3690
  return (t.maxX - t.minX) * (t.maxY - t.minY);
3690
3691
  }
3691
3692
  function Vt(t) {
@@ -3701,10 +3702,10 @@ function cr(t, e) {
3701
3702
  function te(t, e) {
3702
3703
  return t.minX <= e.minX && t.minY <= e.minY && e.maxX <= t.maxX && e.maxY <= t.maxY;
3703
3704
  }
3704
- function Dt(t, e) {
3705
+ function kt(t, e) {
3705
3706
  return e.minX <= t.maxX && e.minY <= t.maxY && e.maxX >= t.minX && e.maxY >= t.minY;
3706
3707
  }
3707
- function Et(t) {
3708
+ function bt(t) {
3708
3709
  return {
3709
3710
  children: t,
3710
3711
  height: 1,
@@ -3743,7 +3744,7 @@ const ur = () => {
3743
3744
  minY: s,
3744
3745
  maxX: a,
3745
3746
  maxY: s
3746
- }).map((d) => d.target).filter((d) => d.selector.type === F.RECTANGLE || hn(d.selector, a, s));
3747
+ }).map((d) => d.target).filter((d) => d.selector.type === G.RECTANGLE || pn(d.selector, a, s));
3747
3748
  if (l.length > 0)
3748
3749
  return l.sort((d, p) => oe(d.selector) - oe(p.selector)), l[0];
3749
3750
  },
@@ -3769,7 +3770,7 @@ const ur = () => {
3769
3770
  }
3770
3771
  };
3771
3772
  }, hr = (t) => {
3772
- const e = Cn(), n = ur(), o = _n(e, t.pointerSelectAction), r = Yn(e), i = jn();
3773
+ const e = Un(), n = ur(), o = Mn(e, t.pointerSelectAction), r = _n(e), i = jn();
3773
3774
  return e.observe(({ changes: a }) => {
3774
3775
  n.set(a.created.map((s) => s.target), !1), a.deleted.forEach((s) => n.remove(s.target)), a.updated.forEach(({ oldValue: s, newValue: l }) => n.update(s.target, l.target));
3775
3776
  }), {
@@ -3789,7 +3790,7 @@ const ur = () => {
3789
3790
  const e = hr(t);
3790
3791
  return {
3791
3792
  ...e,
3792
- store: Un(e.store)
3793
+ store: Gn(e.store)
3793
3794
  };
3794
3795
  }, gr = (t) => {
3795
3796
  let e, n;
@@ -3813,23 +3814,23 @@ const ur = () => {
3813
3814
  ...t,
3814
3815
  drawingEnabled: t.drawingEnabled === void 0 ? !0 : t.drawingEnabled,
3815
3816
  drawingMode: t.drawingMode || "drag",
3816
- pointerSelectAction: t.pointerSelectAction || Pe.EDIT,
3817
+ pointerSelectAction: t.pointerSelectAction || ze.EDIT,
3817
3818
  theme: t.theme || "light"
3818
- }), ke = navigator.userAgent.indexOf("Mac OS X") !== -1, yr = (t, e) => {
3819
+ }), Ve = navigator.userAgent.indexOf("Mac OS X") !== -1, yr = (t, e) => {
3819
3820
  const n = e || document, o = (a) => {
3820
3821
  a.key === "Z" && a.ctrlKey ? t.undo() : a.key === "Y" && a.ctrlKey && t.redo();
3821
3822
  }, r = (a) => {
3822
3823
  a.key === "z" && a.metaKey && (a.shiftKey ? t.redo() : t.undo());
3823
3824
  }, i = () => {
3824
- ke ? n.removeEventListener("keydown", r) : n.removeEventListener("keydown", o);
3825
+ Ve ? n.removeEventListener("keydown", r) : n.removeEventListener("keydown", o);
3825
3826
  };
3826
- return ke ? n.addEventListener("keydown", r) : n.addEventListener("keydown", o), {
3827
+ return Ve ? n.addEventListener("keydown", r) : n.addEventListener("keydown", o), {
3827
3828
  destroy: i
3828
3829
  };
3829
3830
  }, xr = (t, e = {}) => {
3830
3831
  if (!t)
3831
3832
  throw "Missing argument: image";
3832
- const n = typeof t == "string" ? document.getElementById(t) : t, o = mr(e), r = pr(o), { selection: i, store: a } = r, s = Hn(a), l = Pn(
3833
+ const n = typeof t == "string" ? document.getElementById(t) : t, o = mr(e), r = pr(o), { selection: i, store: a } = r, s = Pn(a), l = zn(
3833
3834
  r,
3834
3835
  s,
3835
3836
  o.adapter,
@@ -3837,7 +3838,7 @@ const ur = () => {
3837
3838
  ), d = document.createElement("DIV");
3838
3839
  d.style.position = "relative", d.style.display = "inline-block", n.style.display = "block", n.parentNode.insertBefore(d, n), d.appendChild(n);
3839
3840
  const p = yr(s);
3840
- let c = Zn();
3841
+ let c = to();
3841
3842
  Ne(n, d, o.theme);
3842
3843
  const g = new nr({
3843
3844
  target: d,
@@ -3851,77 +3852,78 @@ const ur = () => {
3851
3852
  }
3852
3853
  });
3853
3854
  g.$on("click", (f) => {
3854
- const { originalEvent: b, annotation: $ } = f.detail;
3855
- $ ? i.clickSelect($.id, b) : i.isEmpty() || i.clear();
3855
+ const { originalEvent: b, annotation: w } = f.detail;
3856
+ w ? i.clickSelect(w.id, b) : i.isEmpty() || i.clear();
3856
3857
  });
3857
- const h = qn(r, s, o.adapter), m = () => {
3858
+ const h = Wn(r, s, o.adapter), m = () => {
3858
3859
  g.$destroy(), d.parentNode.insertBefore(n, d), d.parentNode.removeChild(d), p.destroy(), s.destroy();
3859
- }, x = () => c, A = (f, b, $) => Bo(f, b, $), w = (f, b) => go(f, b), y = (f) => {
3860
- const { tool: b, opts: $ } = Ke(f);
3861
- g.$set({ tool: b, opts: $ });
3860
+ }, x = () => c, A = (f, b, w) => Xo(f, b, w), $ = (f, b) => fo(f, b), y = (f) => {
3861
+ if (!Je(f))
3862
+ throw `No drawing tool named ${f}`;
3863
+ g.$set({ toolName: f });
3862
3864
  }, E = (f) => g.$set({ drawingEnabled: f }), v = (f) => {
3863
3865
  console.warn("Filter not implemented yet");
3864
- }, B = (f) => g.$set({ style: f }), R = (f) => Ne(n, d, f), D = (f) => {
3866
+ }, X = (f) => g.$set({ style: f }), I = (f) => Ne(n, d, f), V = (f) => {
3865
3867
  c = f, g.$set({ user: f });
3866
3868
  };
3867
3869
  return {
3868
3870
  ...h,
3869
3871
  destroy: m,
3870
3872
  getUser: x,
3871
- listDrawingTools: Mo,
3873
+ listDrawingTools: re,
3872
3874
  on: l.on,
3873
3875
  off: l.off,
3874
3876
  registerDrawingTool: A,
3875
- registerShapeEditor: w,
3877
+ registerShapeEditor: $,
3876
3878
  setDrawingEnabled: E,
3877
3879
  setDrawingTool: y,
3878
3880
  setFilter: v,
3879
- setStyle: B,
3880
- setTheme: R,
3881
- setUser: D,
3881
+ setStyle: X,
3882
+ setTheme: I,
3883
+ setUser: V,
3882
3884
  state: r
3883
3885
  };
3884
3886
  };
3885
3887
  let wr = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((e, n) => (n &= 63, n < 36 ? e += n.toString(36) : n < 62 ? e += (n - 26).toString(36).toUpperCase() : n > 62 ? e += "-" : e += "_", e), "");
3886
3888
  wr();
3887
3889
  export {
3888
- We as Editor,
3889
- $o as EditorMount,
3890
+ Ke as Editor,
3891
+ xo as EditorMount,
3890
3892
  O as Handle,
3891
- lo as PolygonEditor,
3892
- po as RectangleEditor,
3893
- fn as RectangleUtil,
3894
- Ao as RubberbandRectangle,
3893
+ co as PolygonEditor,
3894
+ go as RectangleEditor,
3895
+ mn as RectangleUtil,
3896
+ To as RubberbandRectangle,
3895
3897
  nr as SVGAnnotationLayer,
3896
- F as ShapeType,
3897
- bo as ToolMount,
3898
+ G as ShapeType,
3899
+ Eo as ToolMount,
3898
3900
  $r as W3CImageFormat,
3899
3901
  zo as addEventListeners,
3900
3902
  Gt as boundsFromPoints,
3901
3903
  oe as computeArea,
3902
3904
  xr as createImageAnnotator,
3903
3905
  hr as createImageAnnotatorState,
3904
- jo as createSVGTransform,
3906
+ Po as createSVGTransform,
3905
3907
  pr as createSvelteImageAnnotatorState,
3906
3908
  fr as detectTheme,
3907
3909
  Kt as distance,
3908
- Oo as enableResponsive,
3910
+ Lo as enableResponsive,
3909
3911
  mr as fillDefaults,
3910
- be as getEditor,
3911
- Ke as getTool,
3912
+ Ee as getEditor,
3913
+ Je as getTool,
3912
3914
  yr as initKeyboardCommands,
3913
- hn as intersects,
3914
- Mo as listDrawingTools,
3915
- mn as parseFragmentSelector,
3916
- En as parseSVGSelector,
3917
- oo as parseW3CImageAnnotation,
3918
- go as registerEditor,
3919
- ae as registerShapeUtil,
3920
- Bo as registerTool,
3915
+ pn as intersects,
3916
+ re as listDrawingTools,
3917
+ yn as parseFragmentSelector,
3918
+ vn as parseSVGSelector,
3919
+ ro as parseW3CImageAnnotation,
3920
+ fo as registerEditor,
3921
+ se as registerShapeUtil,
3922
+ Xo as registerTool,
3921
3923
  gr as sampleBrightness,
3922
- yn as serializeFragmentSelector,
3923
- vn as serializeSVGSelector,
3924
- ro as serializeW3CImageAnnotation,
3924
+ wn as serializeFragmentSelector,
3925
+ An as serializeSVGSelector,
3926
+ io as serializeW3CImageAnnotation,
3925
3927
  Ne as setTheme
3926
3928
  };
3927
3929
  //# sourceMappingURL=annotorious-react.es18.js.map