@annotorious/annotorious 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/annotorious.es.js
CHANGED
|
@@ -161,14 +161,14 @@ function me(e, t) {
|
|
|
161
161
|
n && n.slice().forEach((o) => o.call(this, t));
|
|
162
162
|
}
|
|
163
163
|
const Me = [], We = [];
|
|
164
|
-
let
|
|
164
|
+
let Le = [];
|
|
165
165
|
const Et = [], An = /* @__PURE__ */ Promise.resolve();
|
|
166
166
|
let ut = !1;
|
|
167
167
|
function Sn() {
|
|
168
168
|
ut || (ut = !0, An.then($t));
|
|
169
169
|
}
|
|
170
170
|
function dt(e) {
|
|
171
|
-
|
|
171
|
+
Le.push(e);
|
|
172
172
|
}
|
|
173
173
|
const $e = /* @__PURE__ */ new Set();
|
|
174
174
|
let Ee = 0;
|
|
@@ -186,11 +186,11 @@ function $t() {
|
|
|
186
186
|
throw Me.length = 0, Ee = 0, t;
|
|
187
187
|
}
|
|
188
188
|
for (Re(null), Me.length = 0, Ee = 0; We.length; ) We.pop()();
|
|
189
|
-
for (let t = 0; t <
|
|
190
|
-
const n =
|
|
189
|
+
for (let t = 0; t < Le.length; t += 1) {
|
|
190
|
+
const n = Le[t];
|
|
191
191
|
$e.has(n) || ($e.add(n), n());
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
Le.length = 0;
|
|
194
194
|
} while (Me.length);
|
|
195
195
|
for (; Et.length; )
|
|
196
196
|
Et.pop()();
|
|
@@ -205,7 +205,7 @@ function Tn(e) {
|
|
|
205
205
|
}
|
|
206
206
|
function Mn(e) {
|
|
207
207
|
const t = [], n = [];
|
|
208
|
-
|
|
208
|
+
Le.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), Le = t;
|
|
209
209
|
}
|
|
210
210
|
const He = /* @__PURE__ */ new Set();
|
|
211
211
|
let be;
|
|
@@ -231,7 +231,7 @@ function P(e, t, n, o) {
|
|
|
231
231
|
}), e.o(t);
|
|
232
232
|
} else o && o();
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function ke(e) {
|
|
235
235
|
return (e == null ? void 0 : e.length) !== void 0 ? e : Array.from(e);
|
|
236
236
|
}
|
|
237
237
|
function ne(e) {
|
|
@@ -248,7 +248,7 @@ function te(e, t) {
|
|
|
248
248
|
const n = e.$$;
|
|
249
249
|
n.fragment !== null && (Mn(n.after_update), ge(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function vn(e, t) {
|
|
252
252
|
e.$$.dirty[0] === -1 && (Me.push(e), Sn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
253
253
|
}
|
|
254
254
|
function oe(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
@@ -279,7 +279,7 @@ function oe(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
279
279
|
let u = !1;
|
|
280
280
|
if (c.ctx = n ? n(e, t.props || {}, (f, h, ...y) => {
|
|
281
281
|
const g = y.length ? y[0] : h;
|
|
282
|
-
return c.ctx && i(c.ctx[f], c.ctx[f] = g) && (!c.skip_bound && c.bound[f] && c.bound[f](g), u &&
|
|
282
|
+
return c.ctx && i(c.ctx[f], c.ctx[f] = g) && (!c.skip_bound && c.bound[f] && c.bound[f](g), u && vn(e, f)), h;
|
|
283
283
|
}) : [], c.update(), u = !0, ge(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
284
284
|
if (t.hydrate) {
|
|
285
285
|
const f = bn(t.target);
|
|
@@ -336,10 +336,10 @@ class ie {
|
|
|
336
336
|
this.$$set && !mn(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
339
|
+
const Ln = "4";
|
|
340
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Ln);
|
|
341
341
|
var F = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(F || {});
|
|
342
|
-
const mt = {}, pt = (e, t) => mt[e] = t, ht = (e) => mt[e.type].area(e),
|
|
342
|
+
const mt = {}, pt = (e, t) => mt[e] = t, ht = (e) => mt[e.type].area(e), kn = (e, t, n) => mt[e.type].intersects(e, t, n), qe = (e) => {
|
|
343
343
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, i = -1 / 0;
|
|
344
344
|
return e.forEach(([s, r]) => {
|
|
345
345
|
t = Math.min(t, s), n = Math.min(n, r), o = Math.max(o, s), i = Math.max(i, r);
|
|
@@ -651,11 +651,11 @@ function Jn() {
|
|
|
651
651
|
}
|
|
652
652
|
return nt(qn);
|
|
653
653
|
}
|
|
654
|
-
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
654
|
+
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), vt = { randomUUID: Qn };
|
|
655
655
|
function on(e, t, n) {
|
|
656
656
|
var o;
|
|
657
|
-
if (
|
|
658
|
-
return
|
|
657
|
+
if (vt.randomUUID && !e)
|
|
658
|
+
return vt.randomUUID();
|
|
659
659
|
e = e || {};
|
|
660
660
|
const i = e.random ?? ((o = e.rng) == null ? void 0 : o.call(e)) ?? Jn();
|
|
661
661
|
if (i.length < 16)
|
|
@@ -755,55 +755,55 @@ const to = (e, t) => {
|
|
|
755
755
|
}
|
|
756
756
|
};
|
|
757
757
|
}, oo = (e) => e.id !== void 0, io = () => {
|
|
758
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (S,
|
|
759
|
-
n.push({ onChange: S, options:
|
|
758
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (S, v = {}) => {
|
|
759
|
+
n.push({ onChange: S, options: v });
|
|
760
760
|
}, i = (S) => {
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
}, s = (S,
|
|
761
|
+
const v = n.findIndex((b) => b.onChange == S);
|
|
762
|
+
v > -1 && n.splice(v, 1);
|
|
763
|
+
}, s = (S, v) => {
|
|
764
764
|
const b = {
|
|
765
765
|
origin: S,
|
|
766
766
|
changes: {
|
|
767
|
-
created:
|
|
768
|
-
updated:
|
|
769
|
-
deleted:
|
|
767
|
+
created: v.created || [],
|
|
768
|
+
updated: v.updated || [],
|
|
769
|
+
deleted: v.deleted || []
|
|
770
770
|
},
|
|
771
771
|
state: [...e.values()]
|
|
772
772
|
};
|
|
773
773
|
n.forEach((T) => {
|
|
774
774
|
to(T, b) && T.onChange(b);
|
|
775
775
|
});
|
|
776
|
-
}, r = (S,
|
|
776
|
+
}, r = (S, v = G.LOCAL) => {
|
|
777
777
|
if (S.id && e.get(S.id))
|
|
778
778
|
throw Error(`Cannot add annotation ${S.id} - exists already`);
|
|
779
779
|
{
|
|
780
780
|
const b = it(S);
|
|
781
|
-
e.set(b.id, b), b.bodies.forEach((T) => t.set(T.id, b.id)), s(
|
|
781
|
+
e.set(b.id, b), b.bodies.forEach((T) => t.set(T.id, b.id)), s(v, { created: [b] });
|
|
782
782
|
}
|
|
783
|
-
}, l = (S,
|
|
784
|
-
const b = it(typeof S == "string" ?
|
|
783
|
+
}, l = (S, v) => {
|
|
784
|
+
const b = it(typeof S == "string" ? v : S), T = typeof S == "string" ? S : S.id, Y = T && e.get(T);
|
|
785
785
|
if (Y) {
|
|
786
786
|
const D = sn(Y, b);
|
|
787
787
|
return T === b.id ? e.set(T, b) : (e.delete(T), e.set(b.id, b)), Y.bodies.forEach((H) => t.delete(H.id)), b.bodies.forEach((H) => t.set(H.id, b.id)), D;
|
|
788
788
|
} else
|
|
789
789
|
console.warn(`Cannot update annotation ${T} - does not exist`);
|
|
790
|
-
}, a = (S,
|
|
791
|
-
const T = oo(
|
|
790
|
+
}, a = (S, v = G.LOCAL, b = G.LOCAL) => {
|
|
791
|
+
const T = oo(v) ? b : v, Y = l(S, v);
|
|
792
792
|
Y && s(T, { updated: [Y] });
|
|
793
|
-
}, c = (S,
|
|
793
|
+
}, c = (S, v = G.LOCAL) => {
|
|
794
794
|
const b = S.reduce((T, Y) => {
|
|
795
795
|
const D = l(Y);
|
|
796
796
|
return D ? [...T, D] : T;
|
|
797
797
|
}, []);
|
|
798
|
-
b.length > 0 && s(
|
|
799
|
-
}, u = (S,
|
|
798
|
+
b.length > 0 && s(v, { updated: b });
|
|
799
|
+
}, u = (S, v = G.LOCAL) => {
|
|
800
800
|
const b = e.get(S.annotation);
|
|
801
801
|
if (b) {
|
|
802
802
|
const T = {
|
|
803
803
|
...b,
|
|
804
804
|
bodies: [...b.bodies, S]
|
|
805
805
|
};
|
|
806
|
-
e.set(b.id, T), t.set(S.id, T.id), s(
|
|
806
|
+
e.set(b.id, T), t.set(S.id, T.id), s(v, { updated: [{
|
|
807
807
|
oldValue: b,
|
|
808
808
|
newValue: T,
|
|
809
809
|
bodiesCreated: [S]
|
|
@@ -811,11 +811,11 @@ const to = (e, t) => {
|
|
|
811
811
|
} else
|
|
812
812
|
console.warn(`Attempt to add body to missing annotation: ${S.annotation}`);
|
|
813
813
|
}, f = () => [...e.values()], h = (S = G.LOCAL) => {
|
|
814
|
-
const
|
|
815
|
-
e.clear(), t.clear(), s(S, { deleted:
|
|
816
|
-
}, y = (S,
|
|
814
|
+
const v = [...e.values()];
|
|
815
|
+
e.clear(), t.clear(), s(S, { deleted: v });
|
|
816
|
+
}, y = (S, v = !0, b = G.LOCAL) => {
|
|
817
817
|
const T = S.map(it);
|
|
818
|
-
if (
|
|
818
|
+
if (v) {
|
|
819
819
|
const Y = [...e.values()];
|
|
820
820
|
e.clear(), t.clear(), T.forEach((D) => {
|
|
821
821
|
e.set(D.id, D), D.bodies.forEach((H) => t.set(H.id, D.id));
|
|
@@ -832,31 +832,31 @@ const to = (e, t) => {
|
|
|
832
832
|
}), s(b, { created: T });
|
|
833
833
|
}
|
|
834
834
|
}, g = (S) => {
|
|
835
|
-
const
|
|
835
|
+
const v = typeof S == "string" ? S : S.id, b = e.get(v);
|
|
836
836
|
if (b)
|
|
837
|
-
return e.delete(
|
|
838
|
-
console.warn(`Attempt to delete missing annotation: ${
|
|
839
|
-
}, m = (S,
|
|
837
|
+
return e.delete(v), b.bodies.forEach((T) => t.delete(T.id)), b;
|
|
838
|
+
console.warn(`Attempt to delete missing annotation: ${v}`);
|
|
839
|
+
}, m = (S, v = G.LOCAL) => {
|
|
840
840
|
const b = g(S);
|
|
841
|
-
b && s(
|
|
842
|
-
}, A = (S,
|
|
841
|
+
b && s(v, { deleted: [b] });
|
|
842
|
+
}, A = (S, v = G.LOCAL) => {
|
|
843
843
|
const b = S.reduce((T, Y) => {
|
|
844
844
|
const D = g(Y);
|
|
845
845
|
return D ? [...T, D] : T;
|
|
846
846
|
}, []);
|
|
847
|
-
b.length > 0 && s(
|
|
847
|
+
b.length > 0 && s(v, { deleted: b });
|
|
848
848
|
}, p = (S) => {
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
851
|
-
const b =
|
|
849
|
+
const v = e.get(S.annotation);
|
|
850
|
+
if (v) {
|
|
851
|
+
const b = v.bodies.find((T) => T.id === S.id);
|
|
852
852
|
if (b) {
|
|
853
853
|
t.delete(b.id);
|
|
854
854
|
const T = {
|
|
855
|
-
...
|
|
856
|
-
bodies:
|
|
855
|
+
...v,
|
|
856
|
+
bodies: v.bodies.filter((Y) => Y.id !== S.id)
|
|
857
857
|
};
|
|
858
|
-
return e.set(
|
|
859
|
-
oldValue:
|
|
858
|
+
return e.set(v.id, T), {
|
|
859
|
+
oldValue: v,
|
|
860
860
|
newValue: T,
|
|
861
861
|
bodiesDeleted: [b]
|
|
862
862
|
};
|
|
@@ -864,61 +864,61 @@ const to = (e, t) => {
|
|
|
864
864
|
console.warn(`Attempt to delete missing body ${S.id} from annotation ${S.annotation}`);
|
|
865
865
|
} else
|
|
866
866
|
console.warn(`Attempt to delete body from missing annotation ${S.annotation}`);
|
|
867
|
-
}, _ = (S,
|
|
867
|
+
}, _ = (S, v = G.LOCAL) => {
|
|
868
868
|
const b = p(S);
|
|
869
|
-
b && s(
|
|
870
|
-
}, w = (S,
|
|
869
|
+
b && s(v, { updated: [b] });
|
|
870
|
+
}, w = (S, v = G.LOCAL) => {
|
|
871
871
|
const b = S.map((T) => p(T)).filter(Boolean);
|
|
872
|
-
b.length > 0 && s(
|
|
872
|
+
b.length > 0 && s(v, { updated: b });
|
|
873
873
|
}, E = (S) => {
|
|
874
|
-
const
|
|
875
|
-
return
|
|
876
|
-
},
|
|
877
|
-
const
|
|
878
|
-
if (
|
|
879
|
-
const b = E(
|
|
874
|
+
const v = e.get(S);
|
|
875
|
+
return v ? { ...v } : void 0;
|
|
876
|
+
}, k = (S) => {
|
|
877
|
+
const v = t.get(S);
|
|
878
|
+
if (v) {
|
|
879
|
+
const b = E(v).bodies.find((T) => T.id === S);
|
|
880
880
|
if (b)
|
|
881
881
|
return b;
|
|
882
882
|
console.error(`Store integrity error: body ${S} in index, but not in annotation`);
|
|
883
883
|
} else
|
|
884
884
|
console.warn(`Attempt to retrieve missing body: ${S}`);
|
|
885
|
-
}, X = (S,
|
|
886
|
-
if (S.annotation !==
|
|
885
|
+
}, X = (S, v) => {
|
|
886
|
+
if (S.annotation !== v.annotation)
|
|
887
887
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
888
888
|
const b = e.get(S.annotation);
|
|
889
889
|
if (b) {
|
|
890
890
|
const T = b.bodies.find((D) => D.id === S.id), Y = {
|
|
891
891
|
...b,
|
|
892
|
-
bodies: b.bodies.map((D) => D.id === T.id ?
|
|
892
|
+
bodies: b.bodies.map((D) => D.id === T.id ? v : D)
|
|
893
893
|
};
|
|
894
|
-
return e.set(b.id, Y), T.id !==
|
|
894
|
+
return e.set(b.id, Y), T.id !== v.id && (t.delete(T.id), t.set(v.id, Y.id)), {
|
|
895
895
|
oldValue: b,
|
|
896
896
|
newValue: Y,
|
|
897
|
-
bodiesUpdated: [{ oldBody: T, newBody:
|
|
897
|
+
bodiesUpdated: [{ oldBody: T, newBody: v }]
|
|
898
898
|
};
|
|
899
899
|
} else
|
|
900
900
|
console.warn(`Attempt to add body to missing annotation ${S.annotation}`);
|
|
901
|
-
}, U = (S,
|
|
902
|
-
const T = X(S,
|
|
901
|
+
}, U = (S, v, b = G.LOCAL) => {
|
|
902
|
+
const T = X(S, v);
|
|
903
903
|
T && s(b, { updated: [T] });
|
|
904
|
-
}, V = (S,
|
|
904
|
+
}, V = (S, v = G.LOCAL) => {
|
|
905
905
|
const b = S.map((T) => X({ id: T.id, annotation: T.annotation }, T)).filter(Boolean);
|
|
906
|
-
s(
|
|
906
|
+
s(v, { updated: b });
|
|
907
907
|
}, Z = (S) => {
|
|
908
|
-
const
|
|
909
|
-
if (
|
|
908
|
+
const v = e.get(S.annotation);
|
|
909
|
+
if (v) {
|
|
910
910
|
const b = {
|
|
911
|
-
...
|
|
911
|
+
...v,
|
|
912
912
|
target: {
|
|
913
|
-
...
|
|
913
|
+
...v.target,
|
|
914
914
|
...S
|
|
915
915
|
}
|
|
916
916
|
};
|
|
917
|
-
return e.set(
|
|
918
|
-
oldValue:
|
|
917
|
+
return e.set(v.id, b), {
|
|
918
|
+
oldValue: v,
|
|
919
919
|
newValue: b,
|
|
920
920
|
targetUpdated: {
|
|
921
|
-
oldTarget:
|
|
921
|
+
oldTarget: v.target,
|
|
922
922
|
newTarget: S
|
|
923
923
|
}
|
|
924
924
|
};
|
|
@@ -934,22 +934,22 @@ const to = (e, t) => {
|
|
|
934
934
|
bulkDeleteBodies: w,
|
|
935
935
|
bulkUpdateAnnotation: c,
|
|
936
936
|
bulkUpdateBodies: V,
|
|
937
|
-
bulkUpdateTargets: (S,
|
|
937
|
+
bulkUpdateTargets: (S, v = G.LOCAL) => {
|
|
938
938
|
const b = S.map((T) => Z(T)).filter(Boolean);
|
|
939
|
-
b.length > 0 && s(
|
|
939
|
+
b.length > 0 && s(v, { updated: b });
|
|
940
940
|
},
|
|
941
941
|
clear: h,
|
|
942
942
|
deleteAnnotation: m,
|
|
943
943
|
deleteBody: _,
|
|
944
944
|
getAnnotation: E,
|
|
945
|
-
getBody:
|
|
945
|
+
getBody: k,
|
|
946
946
|
observe: o,
|
|
947
947
|
unobserve: i,
|
|
948
948
|
updateAnnotation: a,
|
|
949
949
|
updateBody: U,
|
|
950
|
-
updateTarget: (S,
|
|
950
|
+
updateTarget: (S, v = G.LOCAL) => {
|
|
951
951
|
const b = Z(S);
|
|
952
|
-
b && s(
|
|
952
|
+
b && s(v, { updated: [b] });
|
|
953
953
|
}
|
|
954
954
|
};
|
|
955
955
|
}, so = (e) => ({
|
|
@@ -1033,8 +1033,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1033
1033
|
a.has(p) && setTimeout(() => {
|
|
1034
1034
|
a.get(p).forEach((E) => {
|
|
1035
1035
|
if (n) {
|
|
1036
|
-
const
|
|
1037
|
-
E(
|
|
1036
|
+
const k = Array.isArray(_) ? _.map((U) => n.serialize(U)) : n.serialize(_), X = w ? w instanceof PointerEvent ? w : n.serialize(w) : void 0;
|
|
1037
|
+
E(k, X);
|
|
1038
1038
|
} else
|
|
1039
1039
|
E(_, w);
|
|
1040
1040
|
});
|
|
@@ -1042,9 +1042,9 @@ const lo = 250, ao = (e, t) => {
|
|
|
1042
1042
|
}, m = () => {
|
|
1043
1043
|
const { selected: p } = s, _ = (p || []).map(({ id: w }) => r.getAnnotation(w));
|
|
1044
1044
|
_.forEach((w) => {
|
|
1045
|
-
const E = c.find((
|
|
1045
|
+
const E = c.find((k) => k.id === w.id);
|
|
1046
1046
|
(!E || !_e(E, w)) && g("updateAnnotation", w, E);
|
|
1047
|
-
}), c = c.map((w) => _.find(({ id:
|
|
1047
|
+
}), c = c.map((w) => _.find(({ id: k }) => k === w.id) || w);
|
|
1048
1048
|
};
|
|
1049
1049
|
s.subscribe(({ selected: p }) => {
|
|
1050
1050
|
if (!(c.length === 0 && p.length === 0)) {
|
|
@@ -1058,8 +1058,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1058
1058
|
else {
|
|
1059
1059
|
const _ = new Set(c.map((E) => E.id)), w = new Set(p.map(({ id: E }) => E));
|
|
1060
1060
|
c.filter((E) => !w.has(E.id)).forEach((E) => {
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1061
|
+
const k = r.getAnnotation(E.id);
|
|
1062
|
+
k && !_e(k, E) && g("updateAnnotation", k, E);
|
|
1063
1063
|
}), c = [
|
|
1064
1064
|
// Remove annotations that were deselected
|
|
1065
1065
|
...c.filter((E) => w.has(E.id)),
|
|
@@ -1078,9 +1078,9 @@ const lo = 250, ao = (e, t) => {
|
|
|
1078
1078
|
...E.bodiesCreated || [],
|
|
1079
1079
|
...E.bodiesDeleted || [],
|
|
1080
1080
|
...E.bodiesUpdated || []
|
|
1081
|
-
].length > 0).forEach(({ oldValue: E, newValue:
|
|
1081
|
+
].length > 0).forEach(({ oldValue: E, newValue: k }) => {
|
|
1082
1082
|
const X = c.find((U) => U.id === E.id) || E;
|
|
1083
|
-
c = c.map((U) => U.id === E.id ?
|
|
1083
|
+
c = c.map((U) => U.id === E.id ? k : U), g("updateAnnotation", k, X);
|
|
1084
1084
|
});
|
|
1085
1085
|
}, { origin: G.LOCAL }), r.observe((p) => {
|
|
1086
1086
|
if (c) {
|
|
@@ -1130,8 +1130,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
}, y = (p, _ = !0) => {
|
|
1132
1132
|
if (n) {
|
|
1133
|
-
const w = n.parseAll || uo(n), { parsed: E, failed:
|
|
1134
|
-
|
|
1133
|
+
const w = n.parseAll || uo(n), { parsed: E, failed: k } = w(p);
|
|
1134
|
+
k.length > 0 && console.warn(`Discarded ${k.length} invalid annotations`, k), o.bulkAddAnnotation(E, _, G.REMOTE);
|
|
1135
1135
|
} else
|
|
1136
1136
|
o.bulkAddAnnotation(p.map(ot), _, G.REMOTE);
|
|
1137
1137
|
}, g = (p, _) => {
|
|
@@ -1308,11 +1308,11 @@ const Wi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => To(i, t), se
|
|
|
1308
1308
|
};
|
|
1309
1309
|
return delete u.bodies, "annotation" in u.target && delete u.target.annotation, u;
|
|
1310
1310
|
};
|
|
1311
|
-
function
|
|
1311
|
+
function Lt(e, t, n) {
|
|
1312
1312
|
const o = e.slice();
|
|
1313
1313
|
return o[10] = t[n], o[12] = n, o;
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function kt(e) {
|
|
1316
1316
|
let t, n;
|
|
1317
1317
|
return t = new Pe({
|
|
1318
1318
|
props: {
|
|
@@ -1365,13 +1365,13 @@ function vt(e) {
|
|
|
1365
1365
|
}
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1369
|
-
let t, n, o, i, s, r, l, a, c, u, f, h =
|
|
1368
|
+
function vo(e) {
|
|
1369
|
+
let t, n, o, i, s, r, l, a, c, u, f, h = ke(
|
|
1370
1370
|
/*geom*/
|
|
1371
1371
|
e[4].points
|
|
1372
1372
|
), y = [];
|
|
1373
1373
|
for (let m = 0; m < h.length; m += 1)
|
|
1374
|
-
y[m] =
|
|
1374
|
+
y[m] = kt(Lt(e, h, m));
|
|
1375
1375
|
const g = (m) => P(y[m], 1, 1, () => {
|
|
1376
1376
|
y[m] = null;
|
|
1377
1377
|
});
|
|
@@ -1424,14 +1424,14 @@ function Lo(e) {
|
|
|
1424
1424
|
16 && r !== (r = /*geom*/
|
|
1425
1425
|
e[4].points.map(Bt).join(" "))) && d(s, "points", r), A & /*geom, viewportScale, grab*/
|
|
1426
1426
|
536) {
|
|
1427
|
-
h =
|
|
1427
|
+
h = ke(
|
|
1428
1428
|
/*geom*/
|
|
1429
1429
|
e[4].points
|
|
1430
1430
|
);
|
|
1431
1431
|
let p;
|
|
1432
1432
|
for (p = 0; p < h.length; p += 1) {
|
|
1433
|
-
const _ =
|
|
1434
|
-
y[p] ? (y[p].p(_, A), O(y[p], 1)) : (y[p] =
|
|
1433
|
+
const _ = Lt(e, h, p);
|
|
1434
|
+
y[p] ? (y[p].p(_, A), O(y[p], 1)) : (y[p] = kt(_), y[p].c(), O(y[p], 1), y[p].m(a.parentNode, a));
|
|
1435
1435
|
}
|
|
1436
1436
|
for (re(), p = h.length; p < y.length; p += 1)
|
|
1437
1437
|
g(p);
|
|
@@ -1456,7 +1456,7 @@ function Lo(e) {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
};
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function Lo(e) {
|
|
1460
1460
|
let t, n;
|
|
1461
1461
|
return t = new an({
|
|
1462
1462
|
props: {
|
|
@@ -1474,7 +1474,7 @@ function ko(e) {
|
|
|
1474
1474
|
),
|
|
1475
1475
|
$$slots: {
|
|
1476
1476
|
default: [
|
|
1477
|
-
|
|
1477
|
+
vo,
|
|
1478
1478
|
({ grab: o }) => ({ 9: o }),
|
|
1479
1479
|
({ grab: o }) => o ? 512 : 0
|
|
1480
1480
|
]
|
|
@@ -1521,7 +1521,7 @@ function ko(e) {
|
|
|
1521
1521
|
};
|
|
1522
1522
|
}
|
|
1523
1523
|
const It = (e) => e.join(","), Bt = (e) => e.join(",");
|
|
1524
|
-
function
|
|
1524
|
+
function ko(e, t, n) {
|
|
1525
1525
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1526
1526
|
const a = (h, y, g) => {
|
|
1527
1527
|
let m;
|
|
@@ -1558,7 +1558,7 @@ function vo(e, t, n) {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
class Io extends ie {
|
|
1560
1560
|
constructor(t) {
|
|
1561
|
-
super(), oe(this, t,
|
|
1561
|
+
super(), oe(this, t, ko, Lo, Q, {
|
|
1562
1562
|
shape: 0,
|
|
1563
1563
|
computedStyle: 1,
|
|
1564
1564
|
transform: 2,
|
|
@@ -1868,7 +1868,7 @@ class Pe extends ie {
|
|
|
1868
1868
|
}
|
|
1869
1869
|
}
|
|
1870
1870
|
function Uo(e) {
|
|
1871
|
-
let t, n, o, i, s, r, l, a, c, u, f, h, y, g, m, A, p, _, w, E,
|
|
1871
|
+
let t, n, o, i, s, r, l, a, c, u, f, h, y, g, m, A, p, _, w, E, k, X, U, V, Z, S, v, b, T, Y, D, H, J, $, pe, ce, Be, fe, Oe, ue, R, De, Ve;
|
|
1872
1872
|
return $ = new Pe({
|
|
1873
1873
|
props: {
|
|
1874
1874
|
class: "a9s-corner-handle-topleft",
|
|
@@ -1978,19 +1978,19 @@ function Uo(e) {
|
|
|
1978
1978
|
e[4].y), d(g, "height", 1), d(g, "width", p = /*geom*/
|
|
1979
1979
|
e[4].w), d(w, "class", "a9s-edge-handle a9s-edge-handle-right"), d(w, "x", E = /*geom*/
|
|
1980
1980
|
e[4].x + /*geom*/
|
|
1981
|
-
e[4].w), d(w, "y",
|
|
1981
|
+
e[4].w), d(w, "y", k = /*geom*/
|
|
1982
1982
|
e[4].y), d(w, "height", X = /*geom*/
|
|
1983
1983
|
e[4].h), d(w, "width", 1), d(V, "class", "a9s-edge-handle a9s-edge-handle-bottom"), d(V, "x", Z = /*geom*/
|
|
1984
1984
|
e[4].x), d(V, "y", S = /*geom*/
|
|
1985
1985
|
e[4].y + /*geom*/
|
|
1986
|
-
e[4].h), d(V, "height", 1), d(V, "width",
|
|
1986
|
+
e[4].h), d(V, "height", 1), d(V, "width", v = /*geom*/
|
|
1987
1987
|
e[4].w), d(T, "class", "a9s-edge-handle a9s-edge-handle-left"), d(T, "x", Y = /*geom*/
|
|
1988
1988
|
e[4].x), d(T, "y", D = /*geom*/
|
|
1989
1989
|
e[4].y), d(T, "height", H = /*geom*/
|
|
1990
1990
|
e[4].h), d(T, "width", 1);
|
|
1991
1991
|
},
|
|
1992
|
-
m(M,
|
|
1993
|
-
B(M, t,
|
|
1992
|
+
m(M, L) {
|
|
1993
|
+
B(M, t, L), B(M, l, L), B(M, a, L), B(M, y, L), B(M, g, L), B(M, _, L), B(M, w, L), B(M, U, L), B(M, V, L), B(M, b, L), B(M, T, L), B(M, J, L), ee($, M, L), B(M, pe, L), ee(ce, M, L), B(M, Be, L), ee(fe, M, L), B(M, Oe, L), ee(ue, M, L), R = !0, De || (Ve = [
|
|
1994
1994
|
z(t, "pointerdown", function() {
|
|
1995
1995
|
K(
|
|
1996
1996
|
/*grab*/
|
|
@@ -2029,92 +2029,92 @@ function Uo(e) {
|
|
|
2029
2029
|
})
|
|
2030
2030
|
], De = !0);
|
|
2031
2031
|
},
|
|
2032
|
-
p(M,
|
|
2033
|
-
e = M, (!R ||
|
|
2032
|
+
p(M, L) {
|
|
2033
|
+
e = M, (!R || L & /*computedStyle*/
|
|
2034
2034
|
2 && n !== (n = /*computedStyle*/
|
|
2035
|
-
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!R ||
|
|
2035
|
+
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!R || L & /*geom*/
|
|
2036
2036
|
16 && o !== (o = /*geom*/
|
|
2037
|
-
e[4].x)) && d(t, "x", o), (!R ||
|
|
2037
|
+
e[4].x)) && d(t, "x", o), (!R || L & /*geom*/
|
|
2038
2038
|
16 && i !== (i = /*geom*/
|
|
2039
|
-
e[4].y)) && d(t, "y", i), (!R ||
|
|
2039
|
+
e[4].y)) && d(t, "y", i), (!R || L & /*geom*/
|
|
2040
2040
|
16 && s !== (s = /*geom*/
|
|
2041
|
-
e[4].w)) && d(t, "width", s), (!R ||
|
|
2041
|
+
e[4].w)) && d(t, "width", s), (!R || L & /*geom*/
|
|
2042
2042
|
16 && r !== (r = /*geom*/
|
|
2043
|
-
e[4].h)) && d(t, "height", r), (!R ||
|
|
2043
|
+
e[4].h)) && d(t, "height", r), (!R || L & /*computedStyle*/
|
|
2044
2044
|
2) && d(
|
|
2045
2045
|
a,
|
|
2046
2046
|
"style",
|
|
2047
2047
|
/*computedStyle*/
|
|
2048
2048
|
e[1]
|
|
2049
|
-
), (!R ||
|
|
2049
|
+
), (!R || L & /*geom*/
|
|
2050
2050
|
16 && c !== (c = /*geom*/
|
|
2051
|
-
e[4].x)) && d(a, "x", c), (!R ||
|
|
2051
|
+
e[4].x)) && d(a, "x", c), (!R || L & /*geom*/
|
|
2052
2052
|
16 && u !== (u = /*geom*/
|
|
2053
|
-
e[4].y)) && d(a, "y", u), (!R ||
|
|
2053
|
+
e[4].y)) && d(a, "y", u), (!R || L & /*geom*/
|
|
2054
2054
|
16 && f !== (f = /*geom*/
|
|
2055
|
-
e[4].w)) && d(a, "width", f), (!R ||
|
|
2055
|
+
e[4].w)) && d(a, "width", f), (!R || L & /*geom*/
|
|
2056
2056
|
16 && h !== (h = /*geom*/
|
|
2057
|
-
e[4].h)) && d(a, "height", h), (!R ||
|
|
2057
|
+
e[4].h)) && d(a, "height", h), (!R || L & /*geom*/
|
|
2058
2058
|
16 && m !== (m = /*geom*/
|
|
2059
|
-
e[4].x)) && d(g, "x", m), (!R ||
|
|
2059
|
+
e[4].x)) && d(g, "x", m), (!R || L & /*geom*/
|
|
2060
2060
|
16 && A !== (A = /*geom*/
|
|
2061
|
-
e[4].y)) && d(g, "y", A), (!R ||
|
|
2061
|
+
e[4].y)) && d(g, "y", A), (!R || L & /*geom*/
|
|
2062
2062
|
16 && p !== (p = /*geom*/
|
|
2063
|
-
e[4].w)) && d(g, "width", p), (!R ||
|
|
2063
|
+
e[4].w)) && d(g, "width", p), (!R || L & /*geom*/
|
|
2064
2064
|
16 && E !== (E = /*geom*/
|
|
2065
2065
|
e[4].x + /*geom*/
|
|
2066
|
-
e[4].w)) && d(w, "x", E), (!R ||
|
|
2067
|
-
16 &&
|
|
2068
|
-
e[4].y)) && d(w, "y",
|
|
2066
|
+
e[4].w)) && d(w, "x", E), (!R || L & /*geom*/
|
|
2067
|
+
16 && k !== (k = /*geom*/
|
|
2068
|
+
e[4].y)) && d(w, "y", k), (!R || L & /*geom*/
|
|
2069
2069
|
16 && X !== (X = /*geom*/
|
|
2070
|
-
e[4].h)) && d(w, "height", X), (!R ||
|
|
2070
|
+
e[4].h)) && d(w, "height", X), (!R || L & /*geom*/
|
|
2071
2071
|
16 && Z !== (Z = /*geom*/
|
|
2072
|
-
e[4].x)) && d(V, "x", Z), (!R ||
|
|
2072
|
+
e[4].x)) && d(V, "x", Z), (!R || L & /*geom*/
|
|
2073
2073
|
16 && S !== (S = /*geom*/
|
|
2074
2074
|
e[4].y + /*geom*/
|
|
2075
|
-
e[4].h)) && d(V, "y", S), (!R ||
|
|
2076
|
-
16 &&
|
|
2077
|
-
e[4].w)) && d(V, "width",
|
|
2075
|
+
e[4].h)) && d(V, "y", S), (!R || L & /*geom*/
|
|
2076
|
+
16 && v !== (v = /*geom*/
|
|
2077
|
+
e[4].w)) && d(V, "width", v), (!R || L & /*geom*/
|
|
2078
2078
|
16 && Y !== (Y = /*geom*/
|
|
2079
|
-
e[4].x)) && d(T, "x", Y), (!R ||
|
|
2079
|
+
e[4].x)) && d(T, "x", Y), (!R || L & /*geom*/
|
|
2080
2080
|
16 && D !== (D = /*geom*/
|
|
2081
|
-
e[4].y)) && d(T, "y", D), (!R ||
|
|
2081
|
+
e[4].y)) && d(T, "y", D), (!R || L & /*geom*/
|
|
2082
2082
|
16 && H !== (H = /*geom*/
|
|
2083
2083
|
e[4].h)) && d(T, "height", H);
|
|
2084
2084
|
const N = {};
|
|
2085
|
-
|
|
2085
|
+
L & /*geom*/
|
|
2086
2086
|
16 && (N.x = /*geom*/
|
|
2087
|
-
e[4].x),
|
|
2087
|
+
e[4].x), L & /*geom*/
|
|
2088
2088
|
16 && (N.y = /*geom*/
|
|
2089
|
-
e[4].y),
|
|
2089
|
+
e[4].y), L & /*viewportScale*/
|
|
2090
2090
|
8 && (N.scale = /*viewportScale*/
|
|
2091
2091
|
e[3]), $.$set(N);
|
|
2092
2092
|
const x = {};
|
|
2093
|
-
|
|
2093
|
+
L & /*geom*/
|
|
2094
2094
|
16 && (x.x = /*geom*/
|
|
2095
2095
|
e[4].x + /*geom*/
|
|
2096
|
-
e[4].w),
|
|
2096
|
+
e[4].w), L & /*geom*/
|
|
2097
2097
|
16 && (x.y = /*geom*/
|
|
2098
|
-
e[4].y),
|
|
2098
|
+
e[4].y), L & /*viewportScale*/
|
|
2099
2099
|
8 && (x.scale = /*viewportScale*/
|
|
2100
2100
|
e[3]), ce.$set(x);
|
|
2101
2101
|
const de = {};
|
|
2102
|
-
|
|
2102
|
+
L & /*geom*/
|
|
2103
2103
|
16 && (de.x = /*geom*/
|
|
2104
2104
|
e[4].x + /*geom*/
|
|
2105
|
-
e[4].w),
|
|
2105
|
+
e[4].w), L & /*geom*/
|
|
2106
2106
|
16 && (de.y = /*geom*/
|
|
2107
2107
|
e[4].y + /*geom*/
|
|
2108
|
-
e[4].h),
|
|
2108
|
+
e[4].h), L & /*viewportScale*/
|
|
2109
2109
|
8 && (de.scale = /*viewportScale*/
|
|
2110
2110
|
e[3]), fe.$set(de);
|
|
2111
2111
|
const we = {};
|
|
2112
|
-
|
|
2112
|
+
L & /*geom*/
|
|
2113
2113
|
16 && (we.x = /*geom*/
|
|
2114
|
-
e[4].x),
|
|
2114
|
+
e[4].x), L & /*geom*/
|
|
2115
2115
|
16 && (we.y = /*geom*/
|
|
2116
2116
|
e[4].y + /*geom*/
|
|
2117
|
-
e[4].h),
|
|
2117
|
+
e[4].h), L & /*viewportScale*/
|
|
2118
2118
|
8 && (we.scale = /*viewportScale*/
|
|
2119
2119
|
e[3]), ue.$set(we);
|
|
2120
2120
|
},
|
|
@@ -2198,21 +2198,21 @@ function Vo(e, t, n) {
|
|
|
2198
2198
|
const a = (h, y, g) => {
|
|
2199
2199
|
const m = h.geometry.bounds;
|
|
2200
2200
|
let [A, p] = [m.minX, m.minY], [_, w] = [m.maxX, m.maxY];
|
|
2201
|
-
const [E,
|
|
2201
|
+
const [E, k] = g;
|
|
2202
2202
|
if (y === "SHAPE")
|
|
2203
|
-
A += E, _ += E, p +=
|
|
2203
|
+
A += E, _ += E, p += k, w += k;
|
|
2204
2204
|
else {
|
|
2205
2205
|
switch (y) {
|
|
2206
2206
|
case "TOP":
|
|
2207
2207
|
case "TOP_LEFT":
|
|
2208
2208
|
case "TOP_RIGHT": {
|
|
2209
|
-
p +=
|
|
2209
|
+
p += k;
|
|
2210
2210
|
break;
|
|
2211
2211
|
}
|
|
2212
2212
|
case "BOTTOM":
|
|
2213
2213
|
case "BOTTOM_LEFT":
|
|
2214
2214
|
case "BOTTOM_RIGHT": {
|
|
2215
|
-
w +=
|
|
2215
|
+
w += k;
|
|
2216
2216
|
break;
|
|
2217
2217
|
}
|
|
2218
2218
|
}
|
|
@@ -2770,8 +2770,8 @@ function oi(e, t, n) {
|
|
|
2770
2770
|
const i = Ie();
|
|
2771
2771
|
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, h, y = !1;
|
|
2772
2772
|
const g = (w) => {
|
|
2773
|
-
const E = w, { timeStamp:
|
|
2774
|
-
if (c = { timeStamp:
|
|
2773
|
+
const E = w, { timeStamp: k, offsetX: X, offsetY: U } = E;
|
|
2774
|
+
if (c = { timeStamp: k, offsetX: X, offsetY: U }, r === "drag" && u.length === 0) {
|
|
2775
2775
|
const V = l.elementToImage(E.offsetX, E.offsetY);
|
|
2776
2776
|
u.push(V), n(1, f = V);
|
|
2777
2777
|
}
|
|
@@ -2779,8 +2779,8 @@ function oi(e, t, n) {
|
|
|
2779
2779
|
const E = w;
|
|
2780
2780
|
if (h && clearTimeout(h), u.length > 0) {
|
|
2781
2781
|
if (n(1, f = l.elementToImage(E.offsetX, E.offsetY)), u.length > 2) {
|
|
2782
|
-
const
|
|
2783
|
-
n(2, y =
|
|
2782
|
+
const k = st(f, u[0]) * a;
|
|
2783
|
+
n(2, y = k < ti);
|
|
2784
2784
|
}
|
|
2785
2785
|
E.pointerType === "touch" && (h = setTimeout(
|
|
2786
2786
|
() => {
|
|
@@ -2792,8 +2792,8 @@ function oi(e, t, n) {
|
|
|
2792
2792
|
}, A = (w) => {
|
|
2793
2793
|
const E = w;
|
|
2794
2794
|
if (h && clearTimeout(h), r === "click") {
|
|
2795
|
-
const
|
|
2796
|
-
if (
|
|
2795
|
+
const k = E.timeStamp - c.timeStamp, X = st([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
|
|
2796
|
+
if (k > 300 || X > 15) return;
|
|
2797
2797
|
if (y)
|
|
2798
2798
|
_();
|
|
2799
2799
|
else if (u.length === 0) {
|
|
@@ -3202,7 +3202,7 @@ function lt(e) {
|
|
|
3202
3202
|
function Rt(e) {
|
|
3203
3203
|
let t = (
|
|
3204
3204
|
/*annotation*/
|
|
3205
|
-
e[43]
|
|
3205
|
+
e[43]
|
|
3206
3206
|
), n, o, i = Ut(e);
|
|
3207
3207
|
return {
|
|
3208
3208
|
c() {
|
|
@@ -3214,7 +3214,7 @@ function Rt(e) {
|
|
|
3214
3214
|
p(s, r) {
|
|
3215
3215
|
r[0] & /*$store*/
|
|
3216
3216
|
65536 && Q(t, t = /*annotation*/
|
|
3217
|
-
s[43]
|
|
3217
|
+
s[43]) ? (re(), P(i, 1, 1, j), le(), i = Ut(s), i.c(), O(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3218
3218
|
},
|
|
3219
3219
|
i(s) {
|
|
3220
3220
|
o || (O(i), o = !0);
|
|
@@ -3511,7 +3511,7 @@ function Si(e) {
|
|
|
3511
3511
|
};
|
|
3512
3512
|
}
|
|
3513
3513
|
function Ti(e) {
|
|
3514
|
-
let t, n, o =
|
|
3514
|
+
let t, n, o = ke(
|
|
3515
3515
|
/*editableAnnotations*/
|
|
3516
3516
|
e[8]
|
|
3517
3517
|
), i = [];
|
|
@@ -3534,7 +3534,7 @@ function Ti(e) {
|
|
|
3534
3534
|
p(r, l) {
|
|
3535
3535
|
if (l[0] & /*editableAnnotations, drawingEl, getEditor, style, transform, $scale, onChangeSelected*/
|
|
3536
3536
|
21107010) {
|
|
3537
|
-
o =
|
|
3537
|
+
o = ke(
|
|
3538
3538
|
/*editableAnnotations*/
|
|
3539
3539
|
r[8]
|
|
3540
3540
|
);
|
|
@@ -3767,7 +3767,7 @@ function Ht(e) {
|
|
|
3767
3767
|
};
|
|
3768
3768
|
}
|
|
3769
3769
|
function Mi(e) {
|
|
3770
|
-
let t, n, o, i, s, r, l =
|
|
3770
|
+
let t, n, o, i, s, r, l = ke(
|
|
3771
3771
|
/*$store*/
|
|
3772
3772
|
e[16].filter(
|
|
3773
3773
|
/*func*/
|
|
@@ -3829,7 +3829,7 @@ function Mi(e) {
|
|
|
3829
3829
|
p(f, h) {
|
|
3830
3830
|
if (e = f, h[0] & /*$store, style, isEditable*/
|
|
3831
3831
|
66050) {
|
|
3832
|
-
l =
|
|
3832
|
+
l = ke(
|
|
3833
3833
|
/*$store*/
|
|
3834
3834
|
e[16].filter(
|
|
3835
3835
|
/*func*/
|
|
@@ -3883,11 +3883,11 @@ function Mi(e) {
|
|
|
3883
3883
|
}
|
|
3884
3884
|
};
|
|
3885
3885
|
}
|
|
3886
|
-
function
|
|
3886
|
+
function vi(e, t, n) {
|
|
3887
3887
|
let o, i, s, r, l, a, c, u, f, h, y, g = j, m = () => (g(), g = Jt(Y, (M) => n(17, y = M)), Y);
|
|
3888
3888
|
e.$$.on_destroy.push(() => g());
|
|
3889
|
-
let { drawingEnabled: A } = t, { image: p } = t, { preferredDrawingMode: _ } = t, { state: w } = t, { style: E = void 0 } = t, { toolName:
|
|
3890
|
-
const Z = () => n(5, V += 1), S = () =>
|
|
3889
|
+
let { drawingEnabled: A } = t, { image: p } = t, { preferredDrawingMode: _ } = t, { state: w } = t, { style: E = void 0 } = t, { toolName: k = cn()[0] } = t, { user: X } = t, { visible: U = !0 } = t, V = 0;
|
|
3890
|
+
const Z = () => n(5, V += 1), S = () => k, v = () => A;
|
|
3891
3891
|
let b, T, Y;
|
|
3892
3892
|
Ne(() => m(n(7, Y = Do(p, T))));
|
|
3893
3893
|
const { hover: D, selection: H, store: J } = w;
|
|
@@ -3895,35 +3895,35 @@ function Li(e, t, n) {
|
|
|
3895
3895
|
let $, pe;
|
|
3896
3896
|
const ce = (M) => {
|
|
3897
3897
|
$ && J.unobserve($);
|
|
3898
|
-
const
|
|
3899
|
-
|
|
3898
|
+
const L = M.filter(({ editable: N }) => N).map(({ id: N }) => N);
|
|
3899
|
+
L.length > 0 ? (n(8, pe = L.map((N) => J.getAnnotation(N)).filter((N) => N && Je(N))), $ = (N) => {
|
|
3900
3900
|
const { updated: x } = N.changes;
|
|
3901
3901
|
n(8, pe = x == null ? void 0 : x.map((de) => de.newValue));
|
|
3902
|
-
}, J.observe($, { annotations:
|
|
3902
|
+
}, J.observe($, { annotations: L })) : n(8, pe = void 0);
|
|
3903
3903
|
}, Be = (M) => {
|
|
3904
|
-
const
|
|
3905
|
-
id:
|
|
3904
|
+
const L = tn(), N = {
|
|
3905
|
+
id: L,
|
|
3906
3906
|
bodies: [],
|
|
3907
3907
|
target: {
|
|
3908
|
-
annotation:
|
|
3908
|
+
annotation: L,
|
|
3909
3909
|
selector: M.detail,
|
|
3910
3910
|
creator: X,
|
|
3911
3911
|
created: /* @__PURE__ */ new Date()
|
|
3912
3912
|
}
|
|
3913
3913
|
};
|
|
3914
3914
|
J.addAnnotation(N), H.setSelected(N.id);
|
|
3915
|
-
}, fe = (M) => (
|
|
3915
|
+
}, fe = (M) => (L) => {
|
|
3916
3916
|
var we;
|
|
3917
3917
|
const { target: N } = M, x = 10 * 60 * 1e3, de = ((we = N.creator) == null ? void 0 : we.id) !== X.id || !N.created || (/* @__PURE__ */ new Date()).getTime() - N.created.getTime() > x;
|
|
3918
3918
|
J.updateTarget({
|
|
3919
3919
|
...N,
|
|
3920
|
-
selector:
|
|
3920
|
+
selector: L.detail,
|
|
3921
3921
|
created: de ? N.created : /* @__PURE__ */ new Date(),
|
|
3922
3922
|
updated: de ? /* @__PURE__ */ new Date() : void 0,
|
|
3923
3923
|
updatedBy: de ? X : void 0
|
|
3924
3924
|
});
|
|
3925
3925
|
}, Oe = (M) => {
|
|
3926
|
-
const { x:
|
|
3926
|
+
const { x: L, y: N } = un(M, T), x = J.getAt(L, N);
|
|
3927
3927
|
x ? u !== x.id && D.set(x.id) : D.set(void 0);
|
|
3928
3928
|
}, ue = (M) => jo(M), R = (M) => Je(M);
|
|
3929
3929
|
function De(M) {
|
|
@@ -3937,20 +3937,20 @@ function Li(e, t, n) {
|
|
|
3937
3937
|
});
|
|
3938
3938
|
}
|
|
3939
3939
|
return e.$$set = (M) => {
|
|
3940
|
-
"drawingEnabled" in M && n(0, A = M.drawingEnabled), "image" in M && n(25, p = M.image), "preferredDrawingMode" in M && n(26, _ = M.preferredDrawingMode), "state" in M && n(27, w = M.state), "style" in M && n(1, E = M.style), "toolName" in M && n(2,
|
|
3940
|
+
"drawingEnabled" in M && n(0, A = M.drawingEnabled), "image" in M && n(25, p = M.image), "preferredDrawingMode" in M && n(26, _ = M.preferredDrawingMode), "state" in M && n(27, w = M.state), "style" in M && n(1, E = M.style), "toolName" in M && n(2, k = M.toolName), "user" in M && n(28, X = M.user), "visible" in M && n(3, U = M.visible);
|
|
3941
3941
|
}, e.$$.update = () => {
|
|
3942
3942
|
e.$$.dirty[0] & /*toolName*/
|
|
3943
|
-
4 && n(14, { tool: o, opts: i } = fn(
|
|
3943
|
+
4 && n(14, { tool: o, opts: i } = fn(k) || { tool: void 0, opts: void 0 }, o, (n(32, i), n(2, k))), e.$$.dirty[0] & /*preferredDrawingMode*/
|
|
3944
3944
|
67108864 | e.$$.dirty[1] & /*opts*/
|
|
3945
3945
|
2 && n(13, s = (i == null ? void 0 : i.drawingMode) || _), e.$$.dirty[0] & /*svgEl*/
|
|
3946
3946
|
16 && n(12, r = yi(T)), e.$$.dirty[0] & /*svgEl*/
|
|
3947
3947
|
16 && n(11, { onPointerDown: l, onPointerUp: a } = wi(T, J), l, (n(10, a), n(4, T))), e.$$.dirty[1] & /*$selection*/
|
|
3948
|
-
4 && n(9, c = (M) => f.selected.find((
|
|
3948
|
+
4 && n(9, c = (M) => f.selected.find((L) => L.id === M.id && L.editable)), e.$$.dirty[1] & /*$selection*/
|
|
3949
3949
|
4 && ce(f.selected);
|
|
3950
3950
|
}, [
|
|
3951
3951
|
A,
|
|
3952
3952
|
E,
|
|
3953
|
-
|
|
3953
|
+
k,
|
|
3954
3954
|
U,
|
|
3955
3955
|
T,
|
|
3956
3956
|
V,
|
|
@@ -3979,7 +3979,7 @@ function Li(e, t, n) {
|
|
|
3979
3979
|
X,
|
|
3980
3980
|
Z,
|
|
3981
3981
|
S,
|
|
3982
|
-
|
|
3982
|
+
v,
|
|
3983
3983
|
i,
|
|
3984
3984
|
f,
|
|
3985
3985
|
R,
|
|
@@ -3987,12 +3987,12 @@ function Li(e, t, n) {
|
|
|
3987
3987
|
Ve
|
|
3988
3988
|
];
|
|
3989
3989
|
}
|
|
3990
|
-
class
|
|
3990
|
+
class Li extends ie {
|
|
3991
3991
|
constructor(t) {
|
|
3992
3992
|
super(), oe(
|
|
3993
3993
|
this,
|
|
3994
3994
|
t,
|
|
3995
|
-
|
|
3995
|
+
vi,
|
|
3996
3996
|
Mi,
|
|
3997
3997
|
Q,
|
|
3998
3998
|
{
|
|
@@ -4022,7 +4022,7 @@ class ki extends ie {
|
|
|
4022
4022
|
return this.$$.ctx[31];
|
|
4023
4023
|
}
|
|
4024
4024
|
}
|
|
4025
|
-
function dn(e, t, n = 0, o = e.length - 1, i =
|
|
4025
|
+
function dn(e, t, n = 0, o = e.length - 1, i = ki) {
|
|
4026
4026
|
for (; o > n; ) {
|
|
4027
4027
|
if (o - n > 600) {
|
|
4028
4028
|
const a = o - n + 1, c = t - n + 1, u = Math.log(a), f = 0.5 * Math.exp(2 * u / 3), h = 0.5 * Math.sqrt(u * f * (a - f) / a) * (c - a / 2 < 0 ? -1 : 1), y = Math.max(n, Math.floor(t - c * f / a + h)), g = Math.min(o, Math.floor(t + (a - c) * f / a + h));
|
|
@@ -4041,7 +4041,7 @@ function Ye(e, t, n) {
|
|
|
4041
4041
|
const o = e[t];
|
|
4042
4042
|
e[t] = e[n], e[n] = o;
|
|
4043
4043
|
}
|
|
4044
|
-
function
|
|
4044
|
+
function ki(e, t) {
|
|
4045
4045
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
4046
4046
|
}
|
|
4047
4047
|
class Ii {
|
|
@@ -4106,7 +4106,7 @@ class Ii {
|
|
|
4106
4106
|
return t && this._insert(t, this.data.height - 1), this;
|
|
4107
4107
|
}
|
|
4108
4108
|
clear() {
|
|
4109
|
-
return this.data =
|
|
4109
|
+
return this.data = ve([]), this;
|
|
4110
4110
|
}
|
|
4111
4111
|
remove(t, n) {
|
|
4112
4112
|
if (!t) return this;
|
|
@@ -4148,8 +4148,8 @@ class Ii {
|
|
|
4148
4148
|
const s = o - n + 1;
|
|
4149
4149
|
let r = this._maxEntries, l;
|
|
4150
4150
|
if (s <= r)
|
|
4151
|
-
return l =
|
|
4152
|
-
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l =
|
|
4151
|
+
return l = ve(t.slice(n, o + 1)), Te(l, this.toBBox), l;
|
|
4152
|
+
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l = ve([]), l.leaf = !1, l.height = i;
|
|
4153
4153
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
4154
4154
|
Ft(t, n, o, c, this.compareMinX);
|
|
4155
4155
|
for (let u = n; u <= o; u += c) {
|
|
@@ -4183,11 +4183,11 @@ class Ii {
|
|
|
4183
4183
|
_split(t, n) {
|
|
4184
4184
|
const o = t[n], i = o.children.length, s = this._minEntries;
|
|
4185
4185
|
this._chooseSplitAxis(o, s, i);
|
|
4186
|
-
const r = this._chooseSplitIndex(o, s, i), l =
|
|
4186
|
+
const r = this._chooseSplitIndex(o, s, i), l = ve(o.children.splice(r, o.children.length - r));
|
|
4187
4187
|
l.height = o.height, l.leaf = o.leaf, Te(o, this.toBBox), Te(l, this.toBBox), n ? t[n - 1].children.push(l) : this._splitRoot(o, l);
|
|
4188
4188
|
}
|
|
4189
4189
|
_splitRoot(t, n) {
|
|
4190
|
-
this.data =
|
|
4190
|
+
this.data = ve([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, Te(this.data, this.toBBox);
|
|
4191
4191
|
}
|
|
4192
4192
|
_chooseSplitIndex(t, n, o) {
|
|
4193
4193
|
let i, s = 1 / 0, r = 1 / 0;
|
|
@@ -4236,7 +4236,7 @@ function Te(e, t) {
|
|
|
4236
4236
|
Ce(e, 0, e.children.length, t, e);
|
|
4237
4237
|
}
|
|
4238
4238
|
function Ce(e, t, n, o, i) {
|
|
4239
|
-
i || (i =
|
|
4239
|
+
i || (i = ve(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
4240
4240
|
for (let s = t; s < n; s++) {
|
|
4241
4241
|
const r = e.children[s];
|
|
4242
4242
|
Xe(i, e.leaf ? o(r) : r);
|
|
@@ -4271,7 +4271,7 @@ function ct(e, t) {
|
|
|
4271
4271
|
function ze(e, t) {
|
|
4272
4272
|
return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
|
|
4273
4273
|
}
|
|
4274
|
-
function
|
|
4274
|
+
function ve(e) {
|
|
4275
4275
|
return {
|
|
4276
4276
|
children: e,
|
|
4277
4277
|
height: 1,
|
|
@@ -4311,7 +4311,7 @@ const Ci = () => {
|
|
|
4311
4311
|
minY: h,
|
|
4312
4312
|
maxX: f,
|
|
4313
4313
|
maxY: h
|
|
4314
|
-
}).map((m) => m.target).filter((m) => m.selector.type === F.RECTANGLE ||
|
|
4314
|
+
}).map((m) => m.target).filter((m) => m.selector.type === F.RECTANGLE || kn(m.selector, f, h));
|
|
4315
4315
|
if (g.length > 0)
|
|
4316
4316
|
return g.sort((m, A) => ht(m.selector) - ht(A.selector)), g[0];
|
|
4317
4317
|
},
|
|
@@ -4417,7 +4417,7 @@ const Ci = () => {
|
|
|
4417
4417
|
const u = Gi(l);
|
|
4418
4418
|
let f = wo();
|
|
4419
4419
|
Kt(n, c, o.theme);
|
|
4420
|
-
const h = new
|
|
4420
|
+
const h = new Li({
|
|
4421
4421
|
target: c,
|
|
4422
4422
|
props: {
|
|
4423
4423
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4434,7 +4434,7 @@ const Ci = () => {
|
|
|
4434
4434
|
});
|
|
4435
4435
|
const y = ho(i, l, o.adapter), g = () => h.cancelDrawing(), m = () => {
|
|
4436
4436
|
h.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4437
|
-
}, A = () => h.getDrawingTool(), p = () => f, _ = () => h.isDrawingEnabled(), w = (b, T, Y) => si(b, T, Y), E = (b, T) => zo(b, T),
|
|
4437
|
+
}, A = () => h.getDrawingTool(), p = () => f, _ = () => h.isDrawingEnabled(), w = (b, T, Y) => si(b, T, Y), E = (b, T) => zo(b, T), k = (b) => {
|
|
4438
4438
|
if (!fn(b))
|
|
4439
4439
|
throw `No drawing tool named ${b}`;
|
|
4440
4440
|
h.$set({ toolName: b });
|
|
@@ -4442,7 +4442,7 @@ const Ci = () => {
|
|
|
4442
4442
|
console.warn("Filter not implemented yet");
|
|
4443
4443
|
}, V = (b) => h.$set({ style: b }), Z = (b) => Kt(n, c, b), S = (b) => {
|
|
4444
4444
|
f = b, h.$set({ user: b });
|
|
4445
|
-
},
|
|
4445
|
+
}, v = (b) => (
|
|
4446
4446
|
// @ts-ignore
|
|
4447
4447
|
h.$set({ visible: b })
|
|
4448
4448
|
);
|
|
@@ -4459,12 +4459,12 @@ const Ci = () => {
|
|
|
4459
4459
|
registerDrawingTool: w,
|
|
4460
4460
|
registerShapeEditor: E,
|
|
4461
4461
|
setDrawingEnabled: X,
|
|
4462
|
-
setDrawingTool:
|
|
4462
|
+
setDrawingTool: k,
|
|
4463
4463
|
setFilter: U,
|
|
4464
4464
|
setStyle: V,
|
|
4465
4465
|
setTheme: Z,
|
|
4466
4466
|
setUser: S,
|
|
4467
|
-
setVisible:
|
|
4467
|
+
setVisible: v,
|
|
4468
4468
|
element: c,
|
|
4469
4469
|
state: i
|
|
4470
4470
|
};
|
|
@@ -4478,7 +4478,7 @@ export {
|
|
|
4478
4478
|
Go as RectangleEditor,
|
|
4479
4479
|
On as RectangleUtil,
|
|
4480
4480
|
$o as RubberbandRectangle,
|
|
4481
|
-
|
|
4481
|
+
Li as SVGAnnotationLayer,
|
|
4482
4482
|
F as ShapeType,
|
|
4483
4483
|
Qo as ToolMount,
|
|
4484
4484
|
nn as UserSelectAction,
|
|
@@ -4502,7 +4502,7 @@ export {
|
|
|
4502
4502
|
un as getSVGPoint,
|
|
4503
4503
|
fn as getTool,
|
|
4504
4504
|
Gi as initKeyboardCommands,
|
|
4505
|
-
|
|
4505
|
+
kn as intersects,
|
|
4506
4506
|
Je as isImageAnnotation,
|
|
4507
4507
|
Fe as isImageAnnotationTarget,
|
|
4508
4508
|
Wt as isMac,
|