@annotorious/svelte 3.1.0 → 3.1.2

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,67 +1,67 @@
1
- var it = Object.defineProperty;
2
- var st = (e, t, n) => t in e ? it(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var pe = (e, t, n) => st(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { toSvelteStore as lt } from "@annotorious/core";
5
- import { Origin as Vt, UserSelectAction as qt, createAnonymousGuest as zt, createBody as Wt, defaultColorProvider as $t } from "@annotorious/core";
6
- import { ShapeType as Gt, W3CImageFormat as Jt, createImageAnnotator as Kt } from "@annotorious/annotorious";
7
- import { createOSDAnnotator as at } from "@annotorious/openseadragon";
8
- import Pe from "openseadragon";
9
- function j() {
10
- }
11
- function ut(e, t) {
1
+ var ct = Object.defineProperty;
2
+ var dt = (e, t, n) => t in e ? ct(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var ve = (e, t, n) => dt(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { toSvelteStore as gt } from "@annotorious/core";
5
+ import { Origin as $t, UserSelectAction as Jt, createAnonymousGuest as Kt, createBody as Qt, defaultColorProvider as Zt } from "@annotorious/core";
6
+ import { ShapeType as tn, W3CImageFormat as nn, createImageAnnotator as on } from "@annotorious/annotorious";
7
+ import { createOSDAnnotator as pt } from "@annotorious/openseadragon";
8
+ import Re from "openseadragon";
9
+ function R() {
10
+ }
11
+ function ht(e, t) {
12
12
  for (const n in t) e[n] = t[n];
13
13
  return (
14
14
  /** @type {T & S} */
15
15
  e
16
16
  );
17
17
  }
18
- function ze(e) {
18
+ function Ke(e) {
19
19
  return e();
20
20
  }
21
- function Oe() {
21
+ function Xe() {
22
22
  return /* @__PURE__ */ Object.create(null);
23
23
  }
24
- function H(e) {
25
- e.forEach(ze);
24
+ function z(e) {
25
+ e.forEach(Ke);
26
26
  }
27
- function te(e) {
27
+ function se(e) {
28
28
  return typeof e == "function";
29
29
  }
30
- function we(e, t) {
30
+ function De(e, t) {
31
31
  return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
32
32
  }
33
- function ft(e) {
33
+ function mt(e) {
34
34
  return Object.keys(e).length === 0;
35
35
  }
36
- function ct(e, ...t) {
36
+ function _t(e, ...t) {
37
37
  if (e == null) {
38
38
  for (const o of t)
39
39
  o(void 0);
40
- return j;
40
+ return R;
41
41
  }
42
42
  const n = e.subscribe(...t);
43
43
  return n.unsubscribe ? () => n.unsubscribe() : n;
44
44
  }
45
- function We(e, t, n) {
46
- e.$$.on_destroy.push(ct(t, n));
45
+ function Qe(e, t, n) {
46
+ e.$$.on_destroy.push(_t(t, n));
47
47
  }
48
- function $e(e, t, n, o) {
48
+ function Ze(e, t, n, o) {
49
49
  if (e) {
50
- const r = Fe(e, t, n, o);
50
+ const r = et(e, t, n, o);
51
51
  return e[0](r);
52
52
  }
53
53
  }
54
- function Fe(e, t, n, o) {
55
- return e[1] && o ? ut(n.ctx.slice(), e[1](o(t))) : n.ctx;
54
+ function et(e, t, n, o) {
55
+ return e[1] && o ? ht(n.ctx.slice(), e[1](o(t))) : n.ctx;
56
56
  }
57
- function Ge(e, t, n, o) {
57
+ function tt(e, t, n, o) {
58
58
  if (e[2] && o) {
59
59
  const r = e[2](o(n));
60
60
  if (t.dirty === void 0)
61
61
  return r;
62
62
  if (typeof r == "object") {
63
- const i = [], s = Math.max(t.dirty.length, r.length);
64
- for (let a = 0; a < s; a += 1)
63
+ const i = [], l = Math.max(t.dirty.length, r.length);
64
+ for (let a = 0; a < l; a += 1)
65
65
  i[a] = t.dirty[a] | r[a];
66
66
  return i;
67
67
  }
@@ -69,13 +69,13 @@ function Ge(e, t, n, o) {
69
69
  }
70
70
  return t.dirty;
71
71
  }
72
- function Je(e, t, n, o, r, i) {
72
+ function nt(e, t, n, o, r, i) {
73
73
  if (r) {
74
- const s = Fe(t, n, o, i);
75
- e.p(s, r);
74
+ const l = et(t, n, o, i);
75
+ e.p(l, r);
76
76
  }
77
77
  }
78
- function Ke(e) {
78
+ function ot(e) {
79
79
  if (e.ctx.length > 32) {
80
80
  const t = [], n = e.ctx.length / 32;
81
81
  for (let o = 0; o < n; o++)
@@ -84,182 +84,182 @@ function Ke(e) {
84
84
  }
85
85
  return -1;
86
86
  }
87
- function dt(e) {
88
- return e && te(e.destroy) ? e.destroy : j;
87
+ function yt(e) {
88
+ return e && se(e.destroy) ? e.destroy : R;
89
89
  }
90
- function pt(e, t) {
90
+ function bt(e, t) {
91
91
  e.appendChild(t);
92
92
  }
93
- function F(e, t, n) {
93
+ function K(e, t, n) {
94
94
  e.insertBefore(t, n || null);
95
95
  }
96
- function U(e) {
96
+ function W(e) {
97
97
  e.parentNode && e.parentNode.removeChild(e);
98
98
  }
99
- function Qe(e) {
99
+ function rt(e) {
100
100
  return document.createElement(e);
101
101
  }
102
- function Ze(e) {
102
+ function it(e) {
103
103
  return document.createTextNode(e);
104
104
  }
105
- function Ee() {
106
- return Ze("");
105
+ function Me() {
106
+ return it("");
107
107
  }
108
- function Be(e, t, n, o) {
108
+ function Ye(e, t, n, o) {
109
109
  return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o);
110
110
  }
111
- function Z(e, t, n) {
111
+ function re(e, t, n) {
112
112
  n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
113
113
  }
114
- function gt(e) {
114
+ function vt(e) {
115
115
  return Array.from(e.childNodes);
116
116
  }
117
- function ht(e, t) {
117
+ function wt(e, t) {
118
118
  t = "" + t, e.data !== t && (e.data = /** @type {string} */
119
119
  t);
120
120
  }
121
- let $;
122
- function W(e) {
123
- $ = e;
121
+ let J;
122
+ function $(e) {
123
+ J = e;
124
124
  }
125
- function Se() {
126
- if (!$) throw new Error("Function called outside component initialization");
127
- return $;
125
+ function Pe() {
126
+ if (!J) throw new Error("Function called outside component initialization");
127
+ return J;
128
128
  }
129
- function et(e) {
130
- Se().$$.on_mount.push(e);
129
+ function st(e) {
130
+ Pe().$$.on_mount.push(e);
131
131
  }
132
- function je(e, t) {
133
- return Se().$$.context.set(e, t), t;
132
+ function He(e, t) {
133
+ return Pe().$$.context.set(e, t), t;
134
134
  }
135
- function mt(e) {
136
- return Se().$$.context.get(e);
137
- }
138
- const R = [], Te = [];
139
- let X = [];
140
- const Ie = [], _t = /* @__PURE__ */ Promise.resolve();
141
- let ye = !1;
142
- function yt() {
143
- ye || (ye = !0, _t.then(tt));
144
- }
145
- function be(e) {
146
- X.push(e);
147
- }
148
- const ge = /* @__PURE__ */ new Set();
149
- let I = 0;
150
- function tt() {
151
- if (I !== 0)
135
+ function Et(e) {
136
+ return Pe().$$.context.get(e);
137
+ }
138
+ const U = [], Ue = [];
139
+ let q = [];
140
+ const qe = [], St = /* @__PURE__ */ Promise.resolve();
141
+ let Ae = !1;
142
+ function xt() {
143
+ Ae || (Ae = !0, St.then(lt));
144
+ }
145
+ function Ne(e) {
146
+ q.push(e);
147
+ }
148
+ const we = /* @__PURE__ */ new Set();
149
+ let H = 0;
150
+ function lt() {
151
+ if (H !== 0)
152
152
  return;
153
- const e = $;
153
+ const e = J;
154
154
  do {
155
155
  try {
156
- for (; I < R.length; ) {
157
- const t = R[I];
158
- I++, W(t), bt(t.$$);
156
+ for (; H < U.length; ) {
157
+ const t = U[H];
158
+ H++, $(t), Ct(t.$$);
159
159
  }
160
160
  } catch (t) {
161
- throw R.length = 0, I = 0, t;
161
+ throw U.length = 0, H = 0, t;
162
162
  }
163
- for (W(null), R.length = 0, I = 0; Te.length; ) Te.pop()();
164
- for (let t = 0; t < X.length; t += 1) {
165
- const n = X[t];
166
- ge.has(n) || (ge.add(n), n());
163
+ for ($(null), U.length = 0, H = 0; Ue.length; ) Ue.pop()();
164
+ for (let t = 0; t < q.length; t += 1) {
165
+ const n = q[t];
166
+ we.has(n) || (we.add(n), n());
167
167
  }
168
- X.length = 0;
169
- } while (R.length);
170
- for (; Ie.length; )
171
- Ie.pop()();
172
- ye = !1, ge.clear(), W(e);
168
+ q.length = 0;
169
+ } while (U.length);
170
+ for (; qe.length; )
171
+ qe.pop()();
172
+ Ae = !1, we.clear(), $(e);
173
173
  }
174
- function bt(e) {
174
+ function Ct(e) {
175
175
  if (e.fragment !== null) {
176
- e.update(), H(e.before_update);
176
+ e.update(), z(e.before_update);
177
177
  const t = e.dirty;
178
- e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(be);
178
+ e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(Ne);
179
179
  }
180
180
  }
181
- function vt(e) {
181
+ function At(e) {
182
182
  const t = [], n = [];
183
- X.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), X = t;
183
+ q.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), q = t;
184
184
  }
185
- const ee = /* @__PURE__ */ new Set();
186
- let B;
187
- function nt() {
188
- B = {
185
+ const ie = /* @__PURE__ */ new Set();
186
+ let I;
187
+ function at() {
188
+ I = {
189
189
  r: 0,
190
190
  c: [],
191
- p: B
191
+ p: I
192
192
  // parent group
193
193
  };
194
194
  }
195
- function ot() {
196
- B.r || H(B.c), B = B.p;
195
+ function ut() {
196
+ I.r || z(I.c), I = I.p;
197
197
  }
198
- function D(e, t) {
199
- e && e.i && (ee.delete(e), e.i(t));
198
+ function k(e, t) {
199
+ e && e.i && (ie.delete(e), e.i(t));
200
200
  }
201
- function Y(e, t, n, o) {
201
+ function V(e, t, n, o) {
202
202
  if (e && e.o) {
203
- if (ee.has(e)) return;
204
- ee.add(e), B.c.push(() => {
205
- ee.delete(e), o && (n && e.d(1), o());
203
+ if (ie.has(e)) return;
204
+ ie.add(e), I.c.push(() => {
205
+ ie.delete(e), o && (n && e.d(1), o());
206
206
  }), e.o(t);
207
207
  } else o && o();
208
208
  }
209
- function wt(e, t, n) {
209
+ function Nt(e, t, n) {
210
210
  const { fragment: o, after_update: r } = e.$$;
211
- o && o.m(t, n), be(() => {
212
- const i = e.$$.on_mount.map(ze).filter(te);
213
- e.$$.on_destroy ? e.$$.on_destroy.push(...i) : H(i), e.$$.on_mount = [];
214
- }), r.forEach(be);
211
+ o && o.m(t, n), Ne(() => {
212
+ const i = e.$$.on_mount.map(Ke).filter(se);
213
+ e.$$.on_destroy ? e.$$.on_destroy.push(...i) : z(i), e.$$.on_mount = [];
214
+ }), r.forEach(Ne);
215
215
  }
216
- function Et(e, t) {
216
+ function kt(e, t) {
217
217
  const n = e.$$;
218
- n.fragment !== null && (vt(n.after_update), H(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
218
+ n.fragment !== null && (At(n.after_update), z(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
219
219
  }
220
- function St(e, t) {
221
- e.$$.dirty[0] === -1 && (R.push(e), yt(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
220
+ function Dt(e, t) {
221
+ e.$$.dirty[0] === -1 && (U.push(e), xt(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
222
222
  }
223
- function xe(e, t, n, o, r, i, s = null, a = [-1]) {
224
- const d = $;
225
- W(e);
223
+ function Le(e, t, n, o, r, i, l = null, a = [-1]) {
224
+ const g = J;
225
+ $(e);
226
226
  const u = e.$$ = {
227
227
  fragment: null,
228
228
  ctx: [],
229
229
  // state
230
230
  props: i,
231
- update: j,
231
+ update: R,
232
232
  not_equal: r,
233
- bound: Oe(),
233
+ bound: Xe(),
234
234
  // lifecycle
235
235
  on_mount: [],
236
236
  on_destroy: [],
237
237
  on_disconnect: [],
238
238
  before_update: [],
239
239
  after_update: [],
240
- context: new Map(t.context || (d ? d.$$.context : [])),
240
+ context: new Map(t.context || (g ? g.$$.context : [])),
241
241
  // everything else
242
- callbacks: Oe(),
242
+ callbacks: Xe(),
243
243
  dirty: a,
244
244
  skip_bound: !1,
245
- root: t.target || d.$$.root
245
+ root: t.target || g.$$.root
246
246
  };
247
- s && s(u.root);
248
- let y = !1;
249
- if (u.ctx = n ? n(e, t.props || {}, (g, m, ...v) => {
250
- const f = v.length ? v[0] : m;
251
- return u.ctx && r(u.ctx[g], u.ctx[g] = f) && (!u.skip_bound && u.bound[g] && u.bound[g](f), y && St(e, g)), m;
252
- }) : [], u.update(), y = !0, H(u.before_update), u.fragment = o ? o(u.ctx) : !1, t.target) {
247
+ l && l(u.root);
248
+ let b = !1;
249
+ if (u.ctx = n ? n(e, t.props || {}, (p, m, ...E) => {
250
+ const h = E.length ? E[0] : m;
251
+ return u.ctx && r(u.ctx[p], u.ctx[p] = h) && (!u.skip_bound && u.bound[p] && u.bound[p](h), b && Dt(e, p)), m;
252
+ }) : [], u.update(), b = !0, z(u.before_update), u.fragment = o ? o(u.ctx) : !1, t.target) {
253
253
  if (t.hydrate) {
254
- const g = gt(t.target);
255
- u.fragment && u.fragment.l(g), g.forEach(U);
254
+ const p = vt(t.target);
255
+ u.fragment && u.fragment.l(p), p.forEach(W);
256
256
  } else
257
257
  u.fragment && u.fragment.c();
258
- t.intro && D(e.$$.fragment), wt(e, t.target, t.anchor), tt();
258
+ t.intro && k(e.$$.fragment), Nt(e, t.target, t.anchor), lt();
259
259
  }
260
- W(d);
260
+ $(g);
261
261
  }
262
- class Ae {
262
+ class Oe {
263
263
  constructor() {
264
264
  /**
265
265
  * ### PRIVATE API
@@ -268,7 +268,7 @@ class Ae {
268
268
  *
269
269
  * @type {any}
270
270
  */
271
- pe(this, "$$");
271
+ ve(this, "$$");
272
272
  /**
273
273
  * ### PRIVATE API
274
274
  *
@@ -276,11 +276,11 @@ class Ae {
276
276
  *
277
277
  * @type {any}
278
278
  */
279
- pe(this, "$$set");
279
+ ve(this, "$$set");
280
280
  }
281
281
  /** @returns {void} */
282
282
  $destroy() {
283
- Et(this, 1), this.$destroy = j;
283
+ kt(this, 1), this.$destroy = R;
284
284
  }
285
285
  /**
286
286
  * @template {Extract<keyof Events, string>} K
@@ -289,8 +289,8 @@ class Ae {
289
289
  * @returns {() => void}
290
290
  */
291
291
  $on(t, n) {
292
- if (!te(n))
293
- return j;
292
+ if (!se(n))
293
+ return R;
294
294
  const o = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
295
295
  return o.push(n), () => {
296
296
  const r = o.indexOf(n);
@@ -302,17 +302,17 @@ class Ae {
302
302
  * @returns {void}
303
303
  */
304
304
  $set(t) {
305
- this.$$set && !ft(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
305
+ this.$$set && !mt(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
306
306
  }
307
307
  }
308
- const xt = "4";
309
- typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(xt);
310
- function Re(e) {
308
+ const Mt = "4";
309
+ typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Mt);
310
+ function Ve(e) {
311
311
  let t;
312
312
  const n = (
313
313
  /*#slots*/
314
314
  e[4].default
315
- ), o = $e(
315
+ ), o = Ze(
316
316
  n,
317
317
  e,
318
318
  /*$$scope*/
@@ -328,19 +328,19 @@ function Re(e) {
328
328
  },
329
329
  p(r, i) {
330
330
  o && o.p && (!t || i & /*$$scope*/
331
- 8) && Je(
331
+ 8) && nt(
332
332
  o,
333
333
  n,
334
334
  r,
335
335
  /*$$scope*/
336
336
  r[3],
337
- t ? Ge(
337
+ t ? tt(
338
338
  n,
339
339
  /*$$scope*/
340
340
  r[3],
341
341
  i,
342
342
  null
343
- ) : Ke(
343
+ ) : ot(
344
344
  /*$$scope*/
345
345
  r[3]
346
346
  ),
@@ -348,183 +348,191 @@ function Re(e) {
348
348
  );
349
349
  },
350
350
  i(r) {
351
- t || (D(o, r), t = !0);
351
+ t || (k(o, r), t = !0);
352
352
  },
353
353
  o(r) {
354
- Y(o, r), t = !1;
354
+ V(o, r), t = !1;
355
355
  },
356
356
  d(r) {
357
357
  o && o.d(r);
358
358
  }
359
359
  };
360
360
  }
361
- function At(e) {
361
+ function Pt(e) {
362
362
  let t, n, o = (
363
363
  /*viewer*/
364
- e[0] && Re(e)
364
+ e[0] && Ve(e)
365
365
  );
366
366
  return {
367
367
  c() {
368
- o && o.c(), t = Ee();
368
+ o && o.c(), t = Me();
369
369
  },
370
370
  m(r, i) {
371
- o && o.m(r, i), F(r, t, i), n = !0;
371
+ o && o.m(r, i), K(r, t, i), n = !0;
372
372
  },
373
373
  p(r, [i]) {
374
374
  /*viewer*/
375
375
  r[0] ? o ? (o.p(r, i), i & /*viewer*/
376
- 1 && D(o, 1)) : (o = Re(r), o.c(), D(o, 1), o.m(t.parentNode, t)) : o && (nt(), Y(o, 1, 1, () => {
376
+ 1 && k(o, 1)) : (o = Ve(r), o.c(), k(o, 1), o.m(t.parentNode, t)) : o && (at(), V(o, 1, 1, () => {
377
377
  o = null;
378
- }), ot());
378
+ }), ut());
379
379
  },
380
380
  i(r) {
381
- n || (D(o), n = !0);
381
+ n || (k(o), n = !0);
382
382
  },
383
383
  o(r) {
384
- Y(o), n = !1;
384
+ V(o), n = !1;
385
385
  },
386
386
  d(r) {
387
- r && U(t), o && o.d(r);
387
+ r && W(t), o && o.d(r);
388
388
  }
389
389
  };
390
390
  }
391
- function Ct(e, t, n) {
392
- let { $$slots: o = {}, $$scope: r } = t, { viewer: i } = t, { opts: s = {} } = t, { anno: a = void 0 } = t;
393
- const d = (u) => {
391
+ function Lt(e, t, n) {
392
+ let { $$slots: o = {}, $$scope: r } = t, { viewer: i } = t, { opts: l = {} } = t, { anno: a = void 0 } = t;
393
+ const g = (u) => {
394
394
  if (u) {
395
- const y = at(u, s), g = lt(y.state.store), m = {
396
- ...y,
397
- state: { ...y.state, store: g }
395
+ const b = pt(u, l), p = gt(b.state.store), m = {
396
+ ...b,
397
+ state: { ...b.state, store: p }
398
398
  };
399
- je("anno", m), je("viewer", u), n(1, a = m);
399
+ He("anno", m), He("viewer", u), n(1, a = m);
400
400
  }
401
401
  };
402
402
  return e.$$set = (u) => {
403
- "viewer" in u && n(0, i = u.viewer), "opts" in u && n(2, s = u.opts), "anno" in u && n(1, a = u.anno), "$$scope" in u && n(3, r = u.$$scope);
403
+ "viewer" in u && n(0, i = u.viewer), "opts" in u && n(2, l = u.opts), "anno" in u && n(1, a = u.anno), "$$scope" in u && n(3, r = u.$$scope);
404
404
  }, e.$$.update = () => {
405
405
  e.$$.dirty & /*viewer*/
406
- 1 && d(i);
407
- }, [i, a, s, r, o];
406
+ 1 && g(i);
407
+ }, [i, a, l, r, o];
408
408
  }
409
- class Rt extends Ae {
409
+ class Vt extends Oe {
410
410
  constructor(t) {
411
- super(), xe(this, t, Ct, At, we, { viewer: 0, opts: 2, anno: 1 });
411
+ super(), Le(this, t, Lt, Pt, De, { viewer: 0, opts: 2, anno: 1 });
412
412
  }
413
413
  }
414
- var he = { dragStart: !0 }, Xe = (e, t, n) => Math.min(Math.max(e, t), n), me = (e) => typeof e == "string", Nt = ([e, t], n, o) => {
415
- const r = (i, s) => s === 0 ? 0 : Math.ceil(i / s) * s;
414
+ var Ee = { dragStart: !0 }, Se = { delay: 0, distance: 3 }, ze = (e, t, n) => Math.min(Math.max(e, t), n), xe = (e) => typeof e == "string", Ot = ([e, t], n, o) => {
415
+ const r = (i, l) => l === 0 ? 0 : Math.ceil(i / l) * l;
416
416
  return [r(n, e), r(o, t)];
417
- }, Ye = (e, t) => e.some((n) => t.some((o) => n.contains(o)));
418
- function _e(e, t) {
417
+ }, We = (e, t) => e.some((n) => t.some((o) => n.contains(o)));
418
+ function Ce(e, t) {
419
419
  if (e === void 0) return;
420
- if (ve(e)) return e.getBoundingClientRect();
420
+ if (ke(e)) return e.getBoundingClientRect();
421
421
  if (typeof e == "object") {
422
- const { top: o = 0, left: r = 0, right: i = 0, bottom: s = 0 } = e;
423
- return { top: o, right: window.innerWidth - i, bottom: window.innerHeight - s, left: r };
422
+ const { top: o = 0, left: r = 0, right: i = 0, bottom: l = 0 } = e;
423
+ return { top: o, right: window.innerWidth - i, bottom: window.innerHeight - l, left: r };
424
424
  }
425
425
  if (e === "parent") return t.parentNode.getBoundingClientRect();
426
426
  const n = document.querySelector(e);
427
427
  if (n === null) throw new Error("The selector provided for bound doesn't exists in the document.");
428
428
  return n.getBoundingClientRect();
429
429
  }
430
- var Q = (e, t, n) => e.style.setProperty(t, n), ve = (e) => e instanceof HTMLElement, kt = (e, t = {}) => {
431
- let n, o, { bounds: r, axis: i = "both", gpuAcceleration: s = !0, legacyTranslate: a = !0, transform: d, applyUserSelectHack: u = !0, disabled: y = !1, ignoreMultitouch: g = !1, recomputeBounds: m = he, grid: v, position: f, cancel: A, handle: w, defaultClass: c = "neodrag", defaultClassDragging: x = "neodrag-dragging", defaultClassDragged: C = "neodrag-dragged", defaultPosition: ne = { x: 0, y: 0 }, onDragStart: oe, onDrag: re, onDragEnd: ie } = t, T = !1, N = 0, k = 0, V = 0, q = 0, se = 0, le = 0, { x: G, y: J } = f ? { x: (f == null ? void 0 : f.x) ?? 0, y: (f == null ? void 0 : f.y) ?? 0 } : ne;
432
- fe(G, J);
433
- let L, O, z, ae, Ce, Ne = "", rt = !!f;
434
- m = { ...he, ...m };
435
- let K = /* @__PURE__ */ new Set();
436
- const ue = document.body.style, P = e.classList;
437
- function fe(l = N, h = k) {
438
- if (!d) {
430
+ var oe = (e, t, n) => e.style.setProperty(t, n), ke = (e) => e instanceof HTMLElement, Bt = function(e, t = {}) {
431
+ let n, o, { bounds: r, axis: i = "both", gpuAcceleration: l = !0, legacyTranslate: a = !1, transform: g, applyUserSelectHack: u = !0, disabled: b = !1, ignoreMultitouch: p = !1, recomputeBounds: m = Ee, grid: E, threshold: h = Se, position: w, cancel: S, handle: d, defaultClass: x = "neodrag", defaultClassDragging: P = "neodrag-dragging", defaultClassDragged: L = "neodrag-dragged", defaultPosition: le = { x: 0, y: 0 }, onDragStart: ae, onDrag: ue, onDragEnd: fe } = t, O = !1, D = !1, Be = 0, F = !1, Q = !1, B = 0, j = 0, X = 0, Y = 0, ce = 0, de = 0, { x: Z, y: ee } = w ? { x: (w == null ? void 0 : w.x) ?? 0, y: (w == null ? void 0 : w.y) ?? 0 } : le;
432
+ me(Z, ee);
433
+ let A, T, G, ge, pe, je = "", ft = !!w;
434
+ m = { ...Ee, ...m }, h = { ...Se, ...h ?? {} };
435
+ let te = /* @__PURE__ */ new Set();
436
+ function Te(s) {
437
+ O && !D && Q && F && pe && (D = !0, function(f) {
438
+ _e("neodrag:start", ae, f);
439
+ }(s), M.add(P), u && (je = he.userSelect, he.userSelect = "none"));
440
+ }
441
+ const he = document.body.style, M = e.classList;
442
+ function me(s = B, f = j) {
443
+ if (!g) {
439
444
  if (a) {
440
- let b = `${+l}px, ${+h}px`;
441
- return Q(e, "transform", s ? `translate3d(${b}, 0)` : `translate(${b})`);
445
+ let y = `${+s}px, ${+f}px`;
446
+ return oe(e, "transform", l ? `translate3d(${y}, 0)` : `translate(${y})`);
442
447
  }
443
- return Q(e, "translate", `${+l}px ${+h}px ${s ? "1px" : ""}`);
448
+ return oe(e, "translate", `${+s}px ${+f}px`);
444
449
  }
445
- const _ = d({ offsetX: l, offsetY: h, rootNode: e });
446
- me(_) && Q(e, "transform", _);
450
+ const _ = g({ offsetX: s, offsetY: f, rootNode: e });
451
+ xe(_) && oe(e, "transform", _);
447
452
  }
448
- const ce = (l, h) => {
449
- const _ = { offsetX: N, offsetY: k, rootNode: e, currentNode: Ce };
450
- e.dispatchEvent(new CustomEvent(l, { detail: _ })), h == null || h(_);
451
- }, de = addEventListener;
452
- de("pointerdown", Le, !1), de("pointerup", Me, !1), de("pointermove", De, !1), Q(e, "touch-action", "none");
453
- const ke = () => {
454
- let l = e.offsetWidth / O.width;
455
- return isNaN(l) && (l = 1), l;
456
- };
457
- function Le(l) {
458
- if (y || l.button === 2) return;
459
- if (K.add(l.pointerId), g && K.size > 1) return l.preventDefault();
460
- if (m.dragStart && (L = _e(r, e)), me(w) && me(A) && w === A) throw new Error("`handle` selector can't be same as `cancel` selector");
461
- if (P.add(c), z = function(p, S) {
462
- if (!p) return [S];
463
- if (ve(p)) return [p];
464
- if (Array.isArray(p)) return p;
465
- const M = S.querySelectorAll(p);
466
- if (M === null) throw new Error("Selector passed for `handle` option should be child of the element on which the action is applied");
467
- return Array.from(M.values());
468
- }(w, e), ae = function(p, S) {
469
- if (!p) return [];
470
- if (ve(p)) return [p];
471
- if (Array.isArray(p)) return p;
472
- const M = S.querySelectorAll(p);
473
- if (M === null) throw new Error("Selector passed for `cancel` option should be child of the element on which the action is applied");
474
- return Array.from(M.values());
475
- }(A, e), n = /(both|x)/.test(i), o = /(both|y)/.test(i), Ye(ae, z)) throw new Error("Element being dragged can't be a child of the element on which `cancel` is applied");
476
- const h = l.composedPath()[0];
477
- if (!z.some((p) => {
478
- var S;
479
- return p.contains(h) || ((S = p.shadowRoot) == null ? void 0 : S.contains(h));
480
- }) || Ye(ae, [h])) return;
481
- Ce = z.length === 1 ? e : z.find((p) => p.contains(h)), T = !0, O = e.getBoundingClientRect(), u && (Ne = ue.userSelect, ue.userSelect = "none"), ce("neodrag:start", oe);
482
- const { clientX: _, clientY: b } = l, E = ke();
483
- n && (V = _ - G / E), o && (q = b - J / E), L && (se = _ - O.left, le = b - O.top);
453
+ function _e(s, f, _) {
454
+ const y = /* @__PURE__ */ function(v) {
455
+ return { offsetX: B, offsetY: j, rootNode: e, currentNode: pe, event: v };
456
+ }(_);
457
+ e.dispatchEvent(new CustomEvent(s, { detail: y })), f == null || f(y);
484
458
  }
485
- function Me(l) {
486
- K.delete(l.pointerId), T && (m.dragEnd && (L = _e(r, e)), P.remove(x), P.add(C), u && (ue.userSelect = Ne), ce("neodrag:end", ie), n && (V = N), o && (q = k), T = !1);
459
+ const ne = addEventListener, ye = new AbortController(), be = { signal: ye.signal, capture: !1 };
460
+ function Ie() {
461
+ let s = e.offsetWidth / T.width;
462
+ return isNaN(s) && (s = 1), s;
487
463
  }
488
- function De(l) {
489
- if (!T || g && K.size > 1) return;
490
- m.drag && (L = _e(r, e)), P.add(x), l.preventDefault(), O = e.getBoundingClientRect();
491
- let h = l.clientX, _ = l.clientY;
492
- const b = ke();
493
- if (L) {
494
- const E = { left: L.left + se, top: L.top + le, right: L.right + se - O.width, bottom: L.bottom + le - O.height };
495
- h = Xe(h, E.left, E.right), _ = Xe(_, E.top, E.bottom);
464
+ return oe(e, "touch-action", "none"), ne("pointerdown", (s) => {
465
+ if (b || s.button === 2) return;
466
+ if (te.add(s.pointerId), p && te.size > 1) return s.preventDefault();
467
+ if (m.dragStart && (A = Ce(r, e)), xe(d) && xe(S) && d === S) throw new Error("`handle` selector can't be same as `cancel` selector");
468
+ if (M.add(x), G = function(c, C) {
469
+ if (!c) return [C];
470
+ if (ke(c)) return [c];
471
+ if (Array.isArray(c)) return c;
472
+ const N = C.querySelectorAll(c);
473
+ if (N === null) throw new Error("Selector passed for `handle` option should be child of the element on which the action is applied");
474
+ return Array.from(N.values());
475
+ }(d, e), ge = function(c, C) {
476
+ if (!c) return [];
477
+ if (ke(c)) return [c];
478
+ if (Array.isArray(c)) return c;
479
+ const N = C.querySelectorAll(c);
480
+ if (N === null) throw new Error("Selector passed for `cancel` option should be child of the element on which the action is applied");
481
+ return Array.from(N.values());
482
+ }(S, e), n = /(both|x)/.test(i), o = /(both|y)/.test(i), We(ge, G)) throw new Error("Element being dragged can't be a child of the element on which `cancel` is applied");
483
+ const f = s.composedPath()[0];
484
+ if (!G.some((c) => {
485
+ var C;
486
+ return c.contains(f) || ((C = c.shadowRoot) == null ? void 0 : C.contains(f));
487
+ }) || We(ge, [f])) return;
488
+ pe = G.length === 1 ? e : G.find((c) => c.contains(f)), O = !0, Be = Date.now(), h.delay || (F = !0), T = e.getBoundingClientRect();
489
+ const { clientX: _, clientY: y } = s, v = Ie();
490
+ n && (X = _ - Z / v), o && (Y = y - ee / v), A && (ce = _ - T.left, de = y - T.top);
491
+ }, be), ne("pointermove", (s) => {
492
+ if (!O || p && te.size > 1) return;
493
+ if (!D) {
494
+ if (F || Date.now() - Be >= h.delay && (F = !0, Te(s)), !Q) {
495
+ const v = s.clientX - X, c = s.clientY - Y;
496
+ Math.sqrt(v ** 2 + c ** 2) >= h.distance && (Q = !0, Te(s));
497
+ }
498
+ if (!D) return;
496
499
  }
497
- if (Array.isArray(v)) {
498
- let [E, p] = v;
499
- if (isNaN(+E) || E < 0) throw new Error("1st argument of `grid` must be a valid positive number");
500
- if (isNaN(+p) || p < 0) throw new Error("2nd argument of `grid` must be a valid positive number");
501
- let S = h - V, M = _ - q;
502
- [S, M] = Nt([E / b, p / b], S, M), h = V + S, _ = q + M;
500
+ m.drag && (A = Ce(r, e)), s.preventDefault(), T = e.getBoundingClientRect();
501
+ let f = s.clientX, _ = s.clientY;
502
+ const y = Ie();
503
+ if (A) {
504
+ const v = { left: A.left + ce, top: A.top + de, right: A.right + ce - T.width, bottom: A.bottom + de - T.height };
505
+ f = ze(f, v.left, v.right), _ = ze(_, v.top, v.bottom);
503
506
  }
504
- n && (N = Math.round((h - V) * b)), o && (k = Math.round((_ - q) * b)), G = N, J = k, ce("neodrag", re), fe();
505
- }
506
- return { destroy: () => {
507
- const l = removeEventListener;
508
- l("pointerdown", Le, !1), l("pointerup", Me, !1), l("pointermove", De, !1);
509
- }, update: (l) => {
510
- var _, b;
511
- i = l.axis || "both", y = l.disabled ?? !1, g = l.ignoreMultitouch ?? !1, w = l.handle, r = l.bounds, m = l.recomputeBounds ?? he, A = l.cancel, u = l.applyUserSelectHack ?? !0, v = l.grid, s = l.gpuAcceleration ?? !0, a = l.legacyTranslate ?? !0, d = l.transform;
512
- const h = P.contains(C);
513
- P.remove(c, C), c = l.defaultClass ?? "neodrag", x = l.defaultClassDragging ?? "neodrag-dragging", C = l.defaultClassDragged ?? "neodrag-dragged", P.add(c), h && P.add(C), rt && (G = N = ((_ = l.position) == null ? void 0 : _.x) ?? N, J = k = ((b = l.position) == null ? void 0 : b.y) ?? k, fe());
507
+ if (Array.isArray(E)) {
508
+ let [v, c] = E;
509
+ if (isNaN(+v) || v < 0) throw new Error("1st argument of `grid` must be a valid positive number");
510
+ if (isNaN(+c) || c < 0) throw new Error("2nd argument of `grid` must be a valid positive number");
511
+ let C = f - X, N = _ - Y;
512
+ [C, N] = Ot([v / y, c / y], C, N), f = X + C, _ = Y + N;
513
+ }
514
+ n && (B = Math.round((f - X) * y)), o && (j = Math.round((_ - Y) * y)), Z = B, ee = j, _e("neodrag", ue, s), me();
515
+ }, be), ne("pointerup", (s) => {
516
+ te.delete(s.pointerId), O && (D && (ne("click", (f) => f.stopPropagation(), { once: !0, signal: ye.signal, capture: !0 }), m.dragEnd && (A = Ce(r, e)), M.remove(P), M.add(L), u && (he.userSelect = je), _e("neodrag:end", fe, s), n && (X = B), o && (Y = j)), O = !1, D = !1, F = !1, Q = !1);
517
+ }, be), { destroy: () => ye.abort(), update: (s) => {
518
+ var _, y;
519
+ i = s.axis || "both", b = s.disabled ?? !1, p = s.ignoreMultitouch ?? !1, d = s.handle, r = s.bounds, m = s.recomputeBounds ?? Ee, S = s.cancel, u = s.applyUserSelectHack ?? !0, E = s.grid, l = s.gpuAcceleration ?? !0, a = s.legacyTranslate ?? !0, g = s.transform, h = { ...Se, ...s.threshold ?? {} };
520
+ const f = M.contains(L);
521
+ M.remove(x, L), x = s.defaultClass ?? "neodrag", P = s.defaultClassDragging ?? "neodrag-dragging", L = s.defaultClassDragged ?? "neodrag-dragged", M.add(x), f && M.add(L), ft && (Z = B = ((_ = s.position) == null ? void 0 : _.x) ?? B, ee = j = ((y = s.position) == null ? void 0 : y.y) ?? j, me());
514
522
  } };
515
523
  };
516
- function He(e) {
524
+ function Fe(e) {
517
525
  let t, n = (
518
526
  /*$selection*/
519
- e[0].selected.map(Ue).join(", ") + ""
520
- ), o, r, i, s;
527
+ e[0].selected.map(Ge).join(", ") + ""
528
+ ), o, r, i, l;
521
529
  return {
522
530
  c() {
523
- t = Qe("div"), o = Ze(n), Z(t, "class", "a9s-popup a9s-osd-popup svelte-1xuxeat");
531
+ t = rt("div"), o = it(n), re(t, "class", "a9s-popup a9s-osd-popup svelte-1xuxeat");
524
532
  },
525
- m(a, d) {
526
- F(a, t, d), pt(t, o), i || (s = [
527
- dt(r = kt.call(null, t, {
533
+ m(a, g) {
534
+ K(a, t, g), bt(t, o), i || (l = [
535
+ yt(r = Bt.call(null, t, {
528
536
  position: { x: (
529
537
  /*left*/
530
538
  e[1]
@@ -533,13 +541,13 @@ function He(e) {
533
541
  e[2]
534
542
  ) }
535
543
  })),
536
- Be(
544
+ Ye(
537
545
  t,
538
546
  "neodrag:start",
539
547
  /*onDragStart*/
540
548
  e[4]
541
549
  ),
542
- Be(
550
+ Ye(
543
551
  t,
544
552
  "neodrag:end",
545
553
  /*onDragEnd*/
@@ -547,10 +555,10 @@ function He(e) {
547
555
  )
548
556
  ], i = !0);
549
557
  },
550
- p(a, d) {
551
- d & /*$selection*/
558
+ p(a, g) {
559
+ g & /*$selection*/
552
560
  1 && n !== (n = /*$selection*/
553
- a[0].selected.map(Ue).join(", ") + "") && ht(o, n), r && te(r.update) && d & /*left, top*/
561
+ a[0].selected.map(Ge).join(", ") + "") && wt(o, n), r && se(r.update) && g & /*left, top*/
554
562
  6 && r.update.call(null, {
555
563
  position: { x: (
556
564
  /*left*/
@@ -562,207 +570,207 @@ function He(e) {
562
570
  });
563
571
  },
564
572
  d(a) {
565
- a && U(t), i = !1, H(s);
573
+ a && W(t), i = !1, z(l);
566
574
  }
567
575
  };
568
576
  }
569
- function Lt(e) {
577
+ function jt(e) {
570
578
  let t, n = (
571
579
  /*$selection*/
572
- e[0] && He(e)
580
+ e[0] && Fe(e)
573
581
  );
574
582
  return {
575
583
  c() {
576
- n && n.c(), t = Ee();
584
+ n && n.c(), t = Me();
577
585
  },
578
586
  m(o, r) {
579
- n && n.m(o, r), F(o, t, r);
587
+ n && n.m(o, r), K(o, t, r);
580
588
  },
581
589
  p(o, [r]) {
582
590
  /*$selection*/
583
- o[0] ? n ? n.p(o, r) : (n = He(o), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
591
+ o[0] ? n ? n.p(o, r) : (n = Fe(o), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
584
592
  },
585
- i: j,
586
- o: j,
593
+ i: R,
594
+ o: R,
587
595
  d(o) {
588
- o && U(t), n && n.d(o);
596
+ o && W(t), n && n.d(o);
589
597
  }
590
598
  };
591
599
  }
592
- const Ue = (e) => e.id;
593
- function Mt(e, t, n) {
594
- let o, { state: r } = t, { viewer: i } = t, s, a, d = !1, u;
595
- const { selection: y, store: g } = r;
596
- We(e, y, (c) => n(0, o = c));
597
- const m = (c) => {
600
+ const Ge = (e) => e.id;
601
+ function Tt(e, t, n) {
602
+ let o, { state: r } = t, { viewer: i } = t, l, a, g = !1, u;
603
+ const { selection: b, store: p } = r;
604
+ Qe(e, b, (d) => n(0, o = d));
605
+ const m = (d) => {
598
606
  var x;
599
- return ((x = c.selected) == null ? void 0 : x.length) > 0;
600
- }, v = () => {
601
- d = !0, i.setMouseNavEnabled(!1);
602
- }, f = () => {
607
+ return ((x = d.selected) == null ? void 0 : x.length) > 0;
608
+ }, E = () => {
609
+ g = !0, i.setMouseNavEnabled(!1);
610
+ }, h = () => {
603
611
  i.setMouseNavEnabled(!0);
604
- }, A = () => {
605
- u && g.unobserve(u), m(o) && (d = !1, w(o), u = (c) => {
606
- d || w(o);
607
- }, g.observe(u, {
608
- annotations: o.selected.map((c) => c.id)
612
+ }, w = () => {
613
+ u && p.unobserve(u), m(o) && (g = !1, S(o), u = (d) => {
614
+ g || S(o);
615
+ }, p.observe(u, {
616
+ annotations: o.selected.map((d) => d.id)
609
617
  }));
610
- }, w = (c) => {
611
- const x = c.selected[0].id, C = g.getAnnotation(x), { minX: ne, minY: oe, maxX: re, maxY: ie } = C.target.selector.geometry.bounds, T = 14, N = i.viewport.imageToViewerElementCoordinates(new Pe.Point(ne, oe)), k = i.viewport.imageToViewerElementCoordinates(new Pe.Point(re, ie));
612
- n(1, s = k.x + T), n(2, a = N.y);
618
+ }, S = (d) => {
619
+ const x = d.selected[0].id, P = p.getAnnotation(x), { minX: L, minY: le, maxX: ae, maxY: ue } = P.target.selector.geometry.bounds, fe = 14, O = i.viewport.imageToViewerElementCoordinates(new Re.Point(L, le)), D = i.viewport.imageToViewerElementCoordinates(new Re.Point(ae, ue));
620
+ n(1, l = D.x + fe), n(2, a = O.y);
613
621
  };
614
- return et(() => {
615
- const c = () => {
616
- m(o) && !d && w(o);
622
+ return st(() => {
623
+ const d = () => {
624
+ m(o) && !g && S(o);
617
625
  };
618
- return i.addHandler("update-viewport", c), () => {
619
- i.removeHandler("update-viewport", c);
626
+ return i.addHandler("update-viewport", d), () => {
627
+ i.removeHandler("update-viewport", d);
620
628
  };
621
- }), e.$$set = (c) => {
622
- "state" in c && n(6, r = c.state), "viewer" in c && n(7, i = c.viewer);
629
+ }), e.$$set = (d) => {
630
+ "state" in d && n(6, r = d.state), "viewer" in d && n(7, i = d.viewer);
623
631
  }, e.$$.update = () => {
624
632
  e.$$.dirty & /*$selection*/
625
- 1 && A();
626
- }, [o, s, a, y, v, f, r, i];
633
+ 1 && w();
634
+ }, [o, l, a, b, E, h, r, i];
627
635
  }
628
- class Xt extends Ae {
636
+ class zt extends Oe {
629
637
  constructor(t) {
630
- super(), xe(this, t, Mt, Lt, we, { state: 6, viewer: 7 });
638
+ super(), Le(this, t, Tt, jt, De, { state: 6, viewer: 7 });
631
639
  }
632
640
  }
633
- const Dt = (e) => ({ hovered: e & /*hovered*/
634
- 16 }), Ve = (e) => ({ hovered: (
641
+ const It = (e) => ({ hovered: e & /*hovered*/
642
+ 16 }), $e = (e) => ({ hovered: (
635
643
  /*hovered*/
636
644
  e[4]
637
645
  ) });
638
- function qe(e) {
646
+ function Je(e) {
639
647
  let t, n, o;
640
648
  const r = (
641
649
  /*#slots*/
642
650
  e[8].default
643
- ), i = $e(
651
+ ), i = Ze(
644
652
  r,
645
653
  e,
646
654
  /*$$scope*/
647
655
  e[7],
648
- Ve
656
+ $e
649
657
  );
650
658
  return {
651
659
  c() {
652
- t = Qe("div"), i && i.c(), Z(t, "class", "a9s-tooltip svelte-14kj0as"), Z(t, "style", n = `left:${/*left*/
660
+ t = rt("div"), i && i.c(), re(t, "class", "a9s-tooltip svelte-14kj0as"), re(t, "style", n = `left:${/*left*/
653
661
  e[2]}px; top:${/*top*/
654
662
  e[1]}px; position: absolute;`);
655
663
  },
656
- m(s, a) {
657
- F(s, t, a), i && i.m(t, null), o = !0;
664
+ m(l, a) {
665
+ K(l, t, a), i && i.m(t, null), o = !0;
658
666
  },
659
- p(s, a) {
667
+ p(l, a) {
660
668
  i && i.p && (!o || a & /*$$scope, hovered*/
661
- 144) && Je(
669
+ 144) && nt(
662
670
  i,
663
671
  r,
664
- s,
672
+ l,
665
673
  /*$$scope*/
666
- s[7],
667
- o ? Ge(
674
+ l[7],
675
+ o ? tt(
668
676
  r,
669
677
  /*$$scope*/
670
- s[7],
678
+ l[7],
671
679
  a,
672
- Dt
673
- ) : Ke(
680
+ It
681
+ ) : ot(
674
682
  /*$$scope*/
675
- s[7]
683
+ l[7]
676
684
  ),
677
- Ve
685
+ $e
678
686
  ), (!o || a & /*left, top*/
679
687
  6 && n !== (n = `left:${/*left*/
680
- s[2]}px; top:${/*top*/
681
- s[1]}px; position: absolute;`)) && Z(t, "style", n);
688
+ l[2]}px; top:${/*top*/
689
+ l[1]}px; position: absolute;`)) && re(t, "style", n);
682
690
  },
683
- i(s) {
684
- o || (D(i, s), o = !0);
691
+ i(l) {
692
+ o || (k(i, l), o = !0);
685
693
  },
686
- o(s) {
687
- Y(i, s), o = !1;
694
+ o(l) {
695
+ V(i, l), o = !1;
688
696
  },
689
- d(s) {
690
- s && U(t), i && i.d(s);
697
+ d(l) {
698
+ l && W(t), i && i.d(l);
691
699
  }
692
700
  };
693
701
  }
694
- function Pt(e) {
702
+ function Rt(e) {
695
703
  let t, n, o = (
696
704
  /*$hover*/
697
705
  e[0] && /*show*/
698
- e[3] && qe(e)
706
+ e[3] && Je(e)
699
707
  );
700
708
  return {
701
709
  c() {
702
- o && o.c(), t = Ee();
710
+ o && o.c(), t = Me();
703
711
  },
704
712
  m(r, i) {
705
- o && o.m(r, i), F(r, t, i), n = !0;
713
+ o && o.m(r, i), K(r, t, i), n = !0;
706
714
  },
707
715
  p(r, [i]) {
708
716
  /*$hover*/
709
717
  r[0] && /*show*/
710
718
  r[3] ? o ? (o.p(r, i), i & /*$hover, show*/
711
- 9 && D(o, 1)) : (o = qe(r), o.c(), D(o, 1), o.m(t.parentNode, t)) : o && (nt(), Y(o, 1, 1, () => {
719
+ 9 && k(o, 1)) : (o = Je(r), o.c(), k(o, 1), o.m(t.parentNode, t)) : o && (at(), V(o, 1, 1, () => {
712
720
  o = null;
713
- }), ot());
721
+ }), ut());
714
722
  },
715
723
  i(r) {
716
- n || (D(o), n = !0);
724
+ n || (k(o), n = !0);
717
725
  },
718
726
  o(r) {
719
- Y(o), n = !1;
727
+ V(o), n = !1;
720
728
  },
721
729
  d(r) {
722
- r && U(t), o && o.d(r);
730
+ r && W(t), o && o.d(r);
723
731
  }
724
732
  };
725
733
  }
726
- function Ot(e, t, n) {
727
- let o, r, { $$slots: i = {}, $$scope: s } = t, { container: a } = t;
728
- const d = mt("anno"), { store: u, hover: y } = d.state;
729
- We(e, y, (f) => n(0, r = f));
730
- let g, m, v = !0;
731
- return et(() => {
732
- const f = () => {
733
- n(3, v = !0);
734
- }, A = (c) => {
735
- const { offsetX: x, offsetY: C } = c;
736
- n(2, m = x), n(1, g = C);
737
- }, w = () => {
738
- n(3, v = !1);
734
+ function Xt(e, t, n) {
735
+ let o, r, { $$slots: i = {}, $$scope: l } = t, { container: a } = t;
736
+ const g = Et("anno"), { store: u, hover: b } = g.state;
737
+ Qe(e, b, (h) => n(0, r = h));
738
+ let p, m, E = !0;
739
+ return st(() => {
740
+ const h = () => {
741
+ n(3, E = !0);
742
+ }, w = (d) => {
743
+ const { offsetX: x, offsetY: P } = d;
744
+ n(2, m = x), n(1, p = P);
745
+ }, S = () => {
746
+ n(3, E = !1);
739
747
  };
740
- return a.addEventListener("pointerenter", f), a.addEventListener("pointermove", A), a.addEventListener("pointerleave", w), () => {
741
- a.removeEventListener("pointerenter", f), a.removeEventListener("pointermove", A), a.removeEventListener("pointerleave", w);
748
+ return a.addEventListener("pointerenter", h), a.addEventListener("pointermove", w), a.addEventListener("pointerleave", S), () => {
749
+ a.removeEventListener("pointerenter", h), a.removeEventListener("pointermove", w), a.removeEventListener("pointerleave", S);
742
750
  };
743
- }), e.$$set = (f) => {
744
- "container" in f && n(6, a = f.container), "$$scope" in f && n(7, s = f.$$scope);
751
+ }), e.$$set = (h) => {
752
+ "container" in h && n(6, a = h.container), "$$scope" in h && n(7, l = h.$$scope);
745
753
  }, e.$$.update = () => {
746
754
  e.$$.dirty & /*$hover*/
747
755
  1 && n(4, o = r ? u.getAnnotation(r) : void 0);
748
- }, [r, g, m, v, o, y, a, s, i];
756
+ }, [r, p, m, E, o, b, a, l, i];
749
757
  }
750
- class Yt extends Ae {
758
+ class Wt extends Oe {
751
759
  constructor(t) {
752
- super(), xe(this, t, Ot, Pt, we, { container: 6 });
760
+ super(), Le(this, t, Xt, Rt, De, { container: 6 });
753
761
  }
754
762
  }
755
763
  export {
756
- Yt as MouseOverTooltip,
757
- Rt as OpenSeadragonAnnotator,
758
- Xt as OpenSeadragonPopup,
759
- Vt as Origin,
760
- Gt as ShapeType,
761
- qt as UserSelectAction,
762
- Jt as W3CImageFormat,
763
- zt as createAnonymousGuest,
764
- Wt as createBody,
765
- Kt as createImageAnnotator,
766
- $t as defaultColorProvider
764
+ Wt as MouseOverTooltip,
765
+ Vt as OpenSeadragonAnnotator,
766
+ zt as OpenSeadragonPopup,
767
+ $t as Origin,
768
+ tn as ShapeType,
769
+ Jt as UserSelectAction,
770
+ nn as W3CImageFormat,
771
+ Kt as createAnonymousGuest,
772
+ Qt as createBody,
773
+ on as createImageAnnotator,
774
+ Zt as defaultColorProvider
767
775
  };
768
776
  //# sourceMappingURL=annotorious-svelte.es.js.map