@abi-software/mapintegratedvuer 1.17.3-simulation.2 → 1.17.4

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.
Files changed (47) hide show
  1. package/dist/{ConnectivityGraph-9pXPgFJR.js → ConnectivityGraph-CNtSLKGZ.js} +19 -21
  2. package/dist/{ContentMixin-DIqgKIz6.js → ContentMixin-BImmmP1E.js} +521 -295
  3. package/dist/Flatmap-CakK_75H.js +202 -0
  4. package/dist/{Iframe-CCEA3d9c.js → Iframe-C7E9XJu7.js} +2 -2
  5. package/dist/{MultiFlatmap-Cuke1uNp.js → MultiFlatmap-DnDXuvTw.js} +3 -3
  6. package/dist/{Plot-B4oTBVAT.js → Plot-CxCj3uTj.js} +2 -2
  7. package/dist/Scaffold-D1NyLNzW.js +304 -0
  8. package/dist/Simulation-Br3Grrd6.js +28 -0
  9. package/dist/{index-_b4VBGHk.js → index-qyfmiqHe.js} +22862 -27602
  10. package/dist/mapintegratedvuer.js +1 -1
  11. package/dist/mapintegratedvuer.umd.cjs +232 -4291
  12. package/dist/style-DezYtA61.js +57 -0
  13. package/dist/style.css +1 -1
  14. package/package.json +5 -10
  15. package/src/App.vue +258 -285
  16. package/src/assets/styles.scss +1 -1
  17. package/src/components/ContextCard.vue +1 -0
  18. package/src/components/EventBus.js +3 -0
  19. package/src/components/MapContent.vue +4 -9
  20. package/src/components/SplitDialog.vue +6 -2
  21. package/src/components/SplitFlow.vue +445 -504
  22. package/src/components/scripts/utilities.js +1 -1
  23. package/src/components/viewers/ConnectivityGraph.vue +1 -9
  24. package/src/components/viewers/Flatmap.vue +83 -166
  25. package/src/components/viewers/Scaffold.vue +130 -78
  26. package/src/components/viewers/Simulation.vue +11 -118
  27. package/src/components.d.ts +0 -3
  28. package/src/main.js +3 -9
  29. package/src/mixins/ContentMixin.js +384 -496
  30. package/src/mixins/DynamicMarkerMixin.js +17 -50
  31. package/src/stores/connectivities.js +10 -1
  32. package/src/stores/entries.js +1 -1
  33. package/src/stores/settings.js +0 -4
  34. package/src/stores/splitFlow.js +352 -425
  35. package/dist/Flatmap-D7GVPV7o.js +0 -103422
  36. package/dist/Scaffold-Czz8X5kL.js +0 -310
  37. package/dist/Simulation-BKmz8zwm.js +0 -107
  38. package/dist/style-CM86xE3J.js +0 -119
  39. package/src/components/DummyRouteComponent.vue +0 -1
  40. package/src/components/EventBus.ts +0 -13
  41. package/src/components/FloatingWindow.vue +0 -142
  42. package/src/components/PlotComponent.vue +0 -56
  43. package/src/services/mapping.js +0 -69
  44. package/src/services/testData.js +0 -71
  45. package/src/stores/mapping.js +0 -29
  46. package/src/stores/simulationPlotStore.js +0 -124
  47. package/src/types/simulation.js +0 -18
@@ -1,8 +1,322 @@
1
- import { markRaw as M } from "vue";
2
- import { d as T, c as w, e as I, f as S, h as _, T as F, E as f, i as b, j as C, k as O } from "./index-_b4VBGHk.js";
3
- import { mapStores as E } from "pinia";
4
- import { getKnowledgeSource as d, FlatmapQueries as L, loadAndStoreKnowledge as N } from "@abi-software/flatmapvuer";
5
- const R = [
1
+ import { markRaw as A } from "vue";
2
+ import { G as C, c as _, u as E, d as O, e as N, f as x, T as d, E as m, h as R, l as P, i as B } from "./index-qyfmiqHe.js";
3
+ import { mapStores as X } from "pinia";
4
+ const b = function(e) {
5
+ return e ? [...new Set(e.map((n) => JSON.stringify(n)))].map(
6
+ (n) => JSON.parse(n)
7
+ ) : [];
8
+ }, L = [], w = async function(e, n) {
9
+ const r = n.filter(
10
+ (l) => L.some((s) => s.taxon === l)
11
+ ), t = L.filter(
12
+ (l) => r.includes(l.taxon)
13
+ ), a = n.filter(
14
+ (l) => !r.includes(l)
15
+ );
16
+ if (a.length) {
17
+ const l = await e.queryLabels(a);
18
+ if (l.length)
19
+ return l.forEach((s) => {
20
+ let { entity: i, label: h } = s;
21
+ h === "Mammalia" && (h = "Mammalia not otherwise specified");
22
+ const o = { taxon: i, label: h };
23
+ t.push(o), L.push(o);
24
+ }), t;
25
+ } else
26
+ return t;
27
+ }, y = function(e, n) {
28
+ if (!e || !n) return !1;
29
+ let r = JSON.stringify(e), t = JSON.stringify(n);
30
+ return r.indexOf(t) !== -1;
31
+ }, F = (e, n) => {
32
+ const r = e.name ?? e, t = n.name ?? n, a = r.toUpperCase(), l = t.toUpperCase();
33
+ return a < l ? -1 : a > l ? 1 : 0;
34
+ };
35
+ let T = function() {
36
+ this.initialise = function(e) {
37
+ this.flatmapAPI = e, this.destinations = [], this.origins = [], this.components = [], this.destinationsWithDatasets = [], this.originsWithDatasets = [], this.componentsWithDatasets = [], this.destinationsCombinations = [], this.originsCombinations = [], this.componentsCombinations = [], this.singleConnectivityList = [], this.hasSingleConnectivityList = !1, this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "map", this.noMapConnectivity = !1;
38
+ }, this.createTooltipData = async function(e, n) {
39
+ let r = [];
40
+ n.feature.hyperlinks && n.feature.hyperlinks.length > 0 ? r = n.feature.hyperlinks : r = this.rawURLs;
41
+ let t;
42
+ if (n.provenanceTaxonomy) {
43
+ t = [];
44
+ try {
45
+ const l = await w(e, n.provenanceTaxonomy);
46
+ l.length && l.forEach((s) => {
47
+ const { label: i } = s;
48
+ t.push(i);
49
+ });
50
+ } catch (l) {
51
+ console.log(l);
52
+ }
53
+ }
54
+ return {
55
+ destinations: this.destinations,
56
+ origins: this.origins,
57
+ components: this.components,
58
+ destinationsWithDatasets: this.destinationsWithDatasets,
59
+ originsWithDatasets: this.originsWithDatasets,
60
+ componentsWithDatasets: this.componentsWithDatasets,
61
+ destinationsCombinations: this.destinationsCombinations,
62
+ originsCombinations: this.originsCombinations,
63
+ componentsCombinations: this.componentsCombinations,
64
+ hasSingleConnectivityList: this.singleConnectivityList.length > 0,
65
+ title: n.label,
66
+ featureId: n.resource,
67
+ hyperlinks: r,
68
+ provenanceTaxonomy: n.provenanceTaxonomy,
69
+ provenanceTaxonomyLabel: t,
70
+ connectivitySource: this.connectivitySource,
71
+ noMapConnectivity: this.noMapConnectivity
72
+ };
73
+ }, this.updateTooltipData = function(e) {
74
+ return {
75
+ ...e,
76
+ origins: this.origins,
77
+ originsWithDatasets: this.originsWithDatasets,
78
+ components: this.components,
79
+ componentsWithDatasets: this.componentsWithDatasets,
80
+ destinations: this.destinations,
81
+ destinationsWithDatasets: this.destinationsWithDatasets,
82
+ destinationsCombinations: this.destinationsCombinations,
83
+ originsCombinations: this.originsCombinations,
84
+ componentsCombinations: this.componentsCombinations,
85
+ connectivitySource: this.connectivitySource,
86
+ noMapConnectivity: this.noMapConnectivity
87
+ };
88
+ }, this.createComponentsLabelList = function(e, n) {
89
+ let r = [];
90
+ return e.forEach((t) => {
91
+ r.push(this.createLabelFromNeuralNode(t[0]), n), t.length === 2 && r.push(this.createLabelFromNeuralNode(t[1]), n);
92
+ }), r;
93
+ }, this.createLabelLookup = function(e, n) {
94
+ return new Promise(async (r) => {
95
+ let t = {};
96
+ this.uberons = [];
97
+ const a = await w(e, n);
98
+ a.length && (a.forEach((l) => {
99
+ const { taxon: s, label: i } = l;
100
+ t[s] = i, this.uberons.push({
101
+ id: s,
102
+ name: i
103
+ });
104
+ }), r(t));
105
+ });
106
+ }, this.buildConnectivitySqlStatement = function(e) {
107
+ let n = "select knowledge from knowledge where entity in (";
108
+ if (e.length === 1)
109
+ n += `'${e[0]}')`;
110
+ else if (e.length > 1)
111
+ for (let r in e)
112
+ n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
113
+ return n;
114
+ }, this.buildLabelSqlStatement = function(e) {
115
+ let n = "select entity, label from labels where entity in (";
116
+ if (e.length === 1)
117
+ n += `'${e[0]}')`;
118
+ else if (e.length > 1)
119
+ for (let r in e)
120
+ n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
121
+ return n;
122
+ }, this.findAllIdsFromConnectivity = function(e) {
123
+ let n = e.connectivity.flat(), r = [...new Set(n)], t = [];
124
+ return r.forEach((a) => {
125
+ Array.isArray(a) ? t.push(a.flat()) : t.push(a);
126
+ }), [...new Set(t.flat())];
127
+ }, this.flattenConnectivity = function(e) {
128
+ let n = e.flat(), r = [...new Set(n)], t = [];
129
+ return r.forEach((a) => {
130
+ Array.isArray(a) ? t.push(a.flat()) : t.push(a);
131
+ }), t.flat();
132
+ }, this.findComponents = function(e, n, r, t) {
133
+ let a = e.connectivity.flat(), l = b(a), s = [], i = !1;
134
+ return l.forEach((h) => {
135
+ i = !1, y(n, h) && (i = !0), t && y(t, h) && (i = !0), y(r, h) && (i = !0), i || s.push(h);
136
+ }), s;
137
+ }, this.retrieveFlatmapKnowledgeForEvent = async function(e, n) {
138
+ this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
139
+ const r = n.resource;
140
+ if (this.destinations = [], this.origins = [], this.components = [], this.destinationsWithDatasets = [], this.originsWithDatasets = [], this.componentsWithDatasets = [], this.destinationsCombinations = [], this.originsCombinations = [], this.componentsCombinations = [], this.singleConnectivityList = [], this.rawURLs = [], !r || r.length === 0 || !r[0]) return;
141
+ let t = await this.queryForConnectivityNew(e, r[0]);
142
+ return await Promise.all([t]);
143
+ }, this.queryForConnectivityNew = async function(e, n, r = "map", t = !0) {
144
+ const a = /^sckan-(\d{4})/.exec(e.knowledgeSource || ""), s = (a ? Number(a[1]) : 0) >= 2026, i = e.mapMetadata.uuid, h = this.flatmapAPI;
145
+ return this.connectivitySource = s ? "sckan" : r, s && (this.singleConnectivityList = await C(h, i, n)), new Promise((o) => {
146
+ (this.connectivitySource === "map" ? this.queryMapConnectivity(e.mapMetadata.uuid, n) : e.queryKnowledge(n)).then((c) => {
147
+ if (this.checkConnectivityExists(c)) {
148
+ this.connectivitySource === "map" && (this.noMapConnectivity = !1);
149
+ let v = c;
150
+ t ? this.processConnectivity(e, v).then((f) => {
151
+ c.references && (this.rawURLs = [...c.references]), o(f);
152
+ }) : o(v);
153
+ } else this.connectivitySource === "map" ? (this.connectivitySource = "sckan", this.noMapConnectivity = !0, e.queryKnowledge(n).then((v) => {
154
+ if (this.checkConnectivityExists(v)) {
155
+ let f = v;
156
+ t ? this.processConnectivity(e, f).then((p) => {
157
+ v.references && (this.rawURLs = [...v.references]), o(p);
158
+ }) : o(f);
159
+ } else
160
+ o(!1);
161
+ }).catch(() => o(!1))) : o(!1);
162
+ }).catch((c) => {
163
+ c.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${n}.`), o(!1);
164
+ });
165
+ });
166
+ }, this.queryMapConnectivity = async function(e, n) {
167
+ const r = this.flatmapAPI + `flatmap/${e}/connectivity/${n}`;
168
+ try {
169
+ const t = await fetch(r);
170
+ if (!t.ok)
171
+ throw new Error(`Response status: ${t.status}`);
172
+ return await t.json();
173
+ } catch (t) {
174
+ throw new Error(t);
175
+ }
176
+ }, this.queryForConnectivity = function(e, n, r, t = !0) {
177
+ const a = { sql: this.buildConnectivitySqlStatement(n) }, l = {
178
+ method: "POST",
179
+ headers: {
180
+ "Content-Type": "application/json"
181
+ },
182
+ body: JSON.stringify(a),
183
+ ...r ? { signal: r } : {}
184
+ // add signal to header if it exists
185
+ };
186
+ return new Promise((s) => {
187
+ fetch(`${this.flatmapAPI}knowledge/query/`, l).then((i) => i.json()).then((i) => {
188
+ if (this.connectivityExists(i)) {
189
+ let h = JSON.parse(i.values[0][0]);
190
+ t ? this.processConnectivity(e, h).then((o) => {
191
+ s(o);
192
+ }) : s(h);
193
+ } else
194
+ s(!1);
195
+ }).catch((i) => {
196
+ i.name === "AbortError" || console.error("Error:", i), s(!1);
197
+ });
198
+ });
199
+ }, this.checkConnectivityExists = function(e) {
200
+ var n;
201
+ return e && ((n = e.connectivity) == null ? void 0 : n.length);
202
+ }, this.connectivityExists = function(e) {
203
+ return !!(e.values && e.values.length > 0 && JSON.parse(e.values[0][0]).connectivity && JSON.parse(e.values[0][0]).connectivity.length > 0);
204
+ }, this.findIfNodeIsSingle = function(e) {
205
+ return e.length === 1 ? (console.error("Server returns a single node", e), e[0]) : e.length === 2 && e[1].length === 0 ? e[0] : !1;
206
+ }, this.createLabelFromNeuralNode = function(e, n) {
207
+ let r = this.findIfNodeIsSingle(e);
208
+ if (r)
209
+ return n[r];
210
+ let t = n[e[0]];
211
+ return e.length === 2 && e[1].length > 0 && e[1].forEach((a) => {
212
+ n[a] == null ? t += `, ${a}` : t += `, ${n[a]}`;
213
+ }), t;
214
+ }, this.flattenAndFindDatasets = function(e, n, r) {
215
+ let t = this.flattenConnectivity(e), a = this.flattenConnectivity(n), l = this.flattenConnectivity(r);
216
+ this.originsWithDatasets = this.uberons.filter(
217
+ (s) => t.indexOf(s.id) !== -1
218
+ ).sort(F), this.componentsWithDatasets = this.uberons.filter(
219
+ (s) => a.indexOf(s.id) !== -1
220
+ ).sort(F), this.destinationsWithDatasets = this.uberons.filter(
221
+ (s) => l.indexOf(s.id) !== -1
222
+ ).sort(F), this.singleConnectivityList.length > 0 && this.singleConnectivityList.forEach((s) => {
223
+ const { sckanNodeId: i, sckanNodeLabel: h, mapNodeId: o, mapNodeLabel: u } = s;
224
+ r.find((c) => JSON.stringify(c) === JSON.stringify(i)) && (this.destinationsCombinations.push({
225
+ sckanId: i,
226
+ sckanLabel: h,
227
+ mapId: o,
228
+ mapLabel: u
229
+ }), o.forEach((c, v) => {
230
+ const f = typeof c == "string" ? c : c[0];
231
+ f && this.destinationsWithDatasets.push({
232
+ id: f,
233
+ name: u.split(",")[v]
234
+ });
235
+ })), e.find((c) => JSON.stringify(c) === JSON.stringify(i)) && (this.originsCombinations.push({
236
+ sckanId: i,
237
+ sckanLabel: h,
238
+ mapId: o,
239
+ mapLabel: u
240
+ }), o.forEach((c, v) => {
241
+ const f = typeof c == "string" ? c : c[0];
242
+ f && this.originsWithDatasets.push({
243
+ id: f,
244
+ name: u.split(",")[v]
245
+ });
246
+ })), n.find((c) => JSON.stringify(c) === JSON.stringify(i)) && (this.componentsCombinations.push({
247
+ sckanId: i,
248
+ sckanLabel: h,
249
+ mapId: o,
250
+ mapLabel: u
251
+ }), o.forEach((c, v) => {
252
+ const f = typeof c == "string" ? c : c[0];
253
+ f && this.componentsWithDatasets.push({
254
+ id: f,
255
+ name: u.split(",")[v]
256
+ });
257
+ }));
258
+ });
259
+ }, this.processConnectivity = function(e, n) {
260
+ return new Promise((r) => {
261
+ let t = [], a = [], l;
262
+ if (n && n["node-phenotypes"]) {
263
+ const h = ["ilxtr:hasSomaLocatedIn"], o = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
264
+ h.forEach((u) => {
265
+ u in n["node-phenotypes"] && t.push(...n["node-phenotypes"][u]);
266
+ }), t = b(t), o.forEach((u) => {
267
+ u in n["node-phenotypes"] && a.push(...n["node-phenotypes"][u]);
268
+ }), a = b(a);
269
+ } else
270
+ a = b(n.axons), n.somas && n.somas.length > 0 && t.push(...n.somas), n.dendrites && n.dendrites.length > 0 && t.push(...n.dendrites), t = b(t), l = n.somas;
271
+ const s = this.findComponents(n, a, t, l), i = this.findAllIdsFromConnectivity(n);
272
+ this.createLabelLookup(e, i).then((h) => {
273
+ this.origins = t.map(
274
+ (o) => this.createLabelFromNeuralNode(o, h)
275
+ ).sort(F), this.components = s.map(
276
+ (o) => this.createLabelFromNeuralNode(o, h)
277
+ ).sort(F), this.destinations = a.map(
278
+ (o) => this.createLabelFromNeuralNode(o, h)
279
+ ).sort(F), this.flattenAndFindDatasets(t, s, a), r({
280
+ ids: {
281
+ dendrites: t,
282
+ components: s,
283
+ axons: a
284
+ },
285
+ labels: {
286
+ origins: this.origins,
287
+ components: this.components,
288
+ destinations: this.destinations
289
+ }
290
+ });
291
+ });
292
+ });
293
+ }, this.buildPubmedSqlStatement = function(e) {
294
+ let n = "select distinct publication from publications where entity in (";
295
+ if (e.length === 1)
296
+ n += `'${e[0]}')`;
297
+ else if (e.length > 1)
298
+ for (let r in e)
299
+ n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
300
+ return n;
301
+ }, this.buildPubmedSqlStatementForModels = function(e) {
302
+ return `select distinct publication from publications where entity = '${e}'`;
303
+ }, this.queryKnowledge = async (e, n) => {
304
+ const r = `${this.flatmapAPI}knowledge/query/`, a = await fetch(r, {
305
+ method: "POST",
306
+ headers: {
307
+ Accept: "application/json"
308
+ },
309
+ body: JSON.stringify({ sql: e, params: n })
310
+ });
311
+ if (!a.ok)
312
+ throw new Error(`Cannot access ${r}`);
313
+ const l = await a.json();
314
+ if ("error" in l)
315
+ throw new TypeError(l.error);
316
+ return l.values;
317
+ };
318
+ };
319
+ const S = [
6
320
  {
7
321
  id: 0,
8
322
  nerve_id: "ILX:0793723",
@@ -815,50 +1129,50 @@ const R = [
815
1129
  "FMA subclasses (in human nerves)": ["FMA:6892", "FMA:6893"],
816
1130
  "subclass labels": ["Right T9 grey ramus communicans", "Left T9 grey ramus communicans"]
817
1131
  }
818
- ], B = () => {
1132
+ ], U = () => {
819
1133
  const e = {};
820
- return R.forEach((a) => {
821
- const r = a.nerve_id, n = a.label.toLowerCase(), t = a["subclass labels"];
822
- if (r && n !== "nerve") {
823
- if (!t.length)
1134
+ return S.forEach((n) => {
1135
+ const r = n.nerve_id, t = n.label.toLowerCase(), a = n["subclass labels"];
1136
+ if (r && t !== "nerve") {
1137
+ if (!a.length)
824
1138
  return;
825
1139
  r in e || (e[r] = {});
826
- const s = t.map((l) => l.toLowerCase()).sort();
1140
+ const l = a.map((s) => s.toLowerCase()).sort();
827
1141
  e[r] = {
828
- nerve: n,
829
- subNerves: s
1142
+ nerve: t,
1143
+ subNerves: l
830
1144
  };
831
1145
  }
832
1146
  }), e;
833
- }, X = () => {
834
- let e = [], a = {
1147
+ }, k = () => {
1148
+ let e = [], n = {
835
1149
  key: "scaffold.connectivity.nerve",
836
1150
  label: "Nerves",
837
1151
  children: []
838
1152
  }, r = [];
839
- for (const n of R) {
840
- if (n.label === "nerve")
1153
+ for (const t of S) {
1154
+ if (t.label === "nerve")
841
1155
  continue;
842
- let t = {
1156
+ let a = {
843
1157
  facetPropPath: "scaffold.connectivity.nerve",
844
1158
  label: "",
845
1159
  children: []
846
- }, s = [];
847
- for (const [l, i] of Object.entries(n))
848
- if (l === "label" && (t.label = i), l === "subclass labels")
849
- for (const o of i)
850
- s.push({
1160
+ }, l = [];
1161
+ for (const [s, i] of Object.entries(t))
1162
+ if (s === "label" && (a.label = i), s === "subclass labels")
1163
+ for (const h of i)
1164
+ l.push({
851
1165
  facetPropPath: "scaffold.connectivity.subnerve",
852
- label: o
1166
+ label: h
853
1167
  });
854
- s.length && (t.children = s.sort((l, i) => l.label.localeCompare(i.label)), r.push(t));
1168
+ l.length && (a.children = l.sort((s, i) => s.label.localeCompare(i.label)), r.push(a));
855
1169
  }
856
- return r.length && (a.children = r.sort((n, t) => n.label.localeCompare(t.label)), e.push(a)), e;
1170
+ return r.length && (n.children = r.sort((t, a) => t.label.localeCompare(a.label)), e.push(n)), e;
857
1171
  };
858
- function x(e) {
1172
+ function D(e) {
859
1173
  return e[0].toUpperCase() + e.substring(1);
860
1174
  }
861
- const $ = {
1175
+ const J = {
862
1176
  emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
863
1177
  props: {
864
1178
  /**
@@ -877,7 +1191,7 @@ const $ = {
877
1191
  },
878
1192
  inject: ["showGlobalSettings", "showOpenMapButton"],
879
1193
  computed: {
880
- ...E(T, w, I, S),
1194
+ ...X(_, E, O, N),
881
1195
  idNamePair() {
882
1196
  return this.splitFlowStore.idNamePair;
883
1197
  },
@@ -899,23 +1213,21 @@ const $ = {
899
1213
  this.alive = !1;
900
1214
  },
901
1215
  mounted: function() {
902
- this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.iframeRef = this.$refs.iframe, this.plotRef = this.$refs.plot, this.simulationRef = this.$refs.simulation, (this.scaffoldRef || this.iframeRef || this.plotRef || this.simulationRef) && this.loadExplorerConfig(), this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities, this.connectivityFilterOptions = this.connectivitiesStore.filterOptions, this.connectivityFilterSources = this.connectivitiesStore.filterSources;
1216
+ this.multiflatmapRef = A(this.$refs.multiflatmap), this.flatmapRef = A(this.$refs.flatmap), this.iframeRef = A(this.$refs.iframe), this.plotRef = A(this.$refs.plot), this.simulationRef = A(this.$refs.simulation), (this.iframeRef || this.plotRef || this.simulationRef) && this.loadExplorerConfig(), this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities, this.connectivityFilterOptions = this.connectivitiesStore.filterOptions, this.connectivityFilterSources = this.connectivitiesStore.filterSources;
903
1217
  },
904
1218
  methods: {
905
- toggleMinimap: function(e, a) {
1219
+ toggleMinimap: function(e, n) {
906
1220
  var r;
907
1221
  if (this.multiflatmapRef && this.flatmapIsReady()) {
908
- const n = this.multiflatmapRef.getCurrentFlatmap(), t = n == null ? void 0 : n.mapImp;
909
- if (t)
1222
+ const t = this.multiflatmapRef.getCurrentFlatmap(), a = t == null ? void 0 : t.mapImp;
1223
+ if (a)
910
1224
  if (e === !0) {
911
- if (a === !1) {
912
- const s = ((r = t.options) == null ? void 0 : r.minimap) || {
913
- position: "top-right"
914
- };
915
- t.createMinimap(s), n.addResizeButtonToMinimap(), n.minimapSmall = !1;
1225
+ if (n === !1) {
1226
+ const l = ((r = a.options) == null ? void 0 : r.minimap) || { position: "top-right" };
1227
+ a.createMinimap(l), t.addResizeButtonToMinimap(), t.minimapSmall = !1;
916
1228
  }
917
1229
  } else
918
- t.closeMinimap();
1230
+ a.closeMinimap();
919
1231
  }
920
1232
  },
921
1233
  onConnectivityItemClose() {
@@ -930,13 +1242,13 @@ const $ = {
930
1242
  getState: function() {
931
1243
  },
932
1244
  openMap: function(e) {
933
- f.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`);
1245
+ m.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`);
934
1246
  },
935
1247
  onMapmanagerLoaded: function(e) {
936
1248
  this.settingsStore.updateMapManager(e);
937
1249
  },
938
1250
  trackOpenMap: function(e) {
939
- F.sendEvent({
1251
+ d.sendEvent({
940
1252
  event: "interaction_event",
941
1253
  event_name: "portal_maps_open_map",
942
1254
  category: e,
@@ -965,197 +1277,131 @@ const $ = {
965
1277
  /**
966
1278
  * Callback when the vuers emit a selected event.
967
1279
  */
968
- resourceSelected: function(e, a) {
969
- var l, i, o, h;
970
- const r = a[0];
1280
+ resourceSelected: function(e, n) {
1281
+ var s, i, h, o;
1282
+ const r = n[0];
971
1283
  if (this.resourceHasAction(r)) {
972
- f.emit("PopoverActionClick", r);
1284
+ m.emit("PopoverActionClick", r);
973
1285
  return;
974
1286
  }
975
- let n, t = !1;
976
- const s = {
1287
+ let t, a = !1;
1288
+ const l = {
977
1289
  paneIndex: this.entry.id,
978
1290
  type: e,
979
- resource: a,
1291
+ resource: n,
980
1292
  internalName: void 0,
981
1293
  eventType: void 0
982
1294
  };
983
1295
  if (e == "MultiFlatmap" || e == "Flatmap")
984
- if (s.internalName = (l = r == null ? void 0 : r.feature) != null && l.label ? r.feature.label : this.idNamePair[r.feature.models], r.eventType == "click") {
985
- if (s.eventType = "selected", r.feature.type == "marker") {
986
- let c = s.internalName;
1296
+ if (l.internalName = (s = r == null ? void 0 : r.feature) != null && s.label ? r.feature.label : this.idNamePair[r.feature.models], r.eventType == "click") {
1297
+ if (l.eventType = "selected", r.feature.type == "marker") {
1298
+ let u = l.internalName;
987
1299
  if (this.settingsStore.isFeaturedMarkerIdentifier(r.feature.id))
988
- n = {
1300
+ t = {
989
1301
  type: "Search",
990
1302
  term: this.settingsStore.featuredMarkerDoi(r.feature.id),
991
1303
  featuredDataset: !0
992
1304
  };
993
1305
  else {
994
- if (r.protocol) {
995
- let u = r.feature.models ? r.feature.models : r.feature.variable;
996
- !u && this.markerToUberonID && (u = this.markerToUberonID[r.feature.id]), n = {
997
- type: "ProtocolSearch",
998
- protocol: r.protocol,
999
- term: u
1000
- };
1001
- } else {
1002
- n = {
1003
- type: "Facet",
1004
- facets: [c]
1005
- };
1006
- let u = /* @__PURE__ */ new Set();
1007
- if (r.feature["dataset-terms"].forEach((m) => {
1008
- u.add(m.label ? m.label : m.term);
1009
- }), u.size === 0 && u.add(c), n.facets = [...u], this.settingsStore.hasAppliedFacets(u) && this.settingsStore.appliedFacets.length <= u.size)
1010
- return;
1011
- if (this.settingsStore.appliedFacets.length) {
1012
- if (!this.settingsStore.hasAppliedFacets(u)) {
1013
- const m = [.../* @__PURE__ */ new Set([...this.settingsStore.appliedFacets, ...u])];
1014
- this.settingsStore.updateAppliedFacets(m);
1015
- }
1016
- } else
1017
- u.size > 1 && (n.type = "Facets"), this.settingsStore.updateAppliedFacets(n.facets);
1018
- }
1019
- t = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
1306
+ t = {
1307
+ type: "Facet",
1308
+ facets: [u]
1309
+ };
1310
+ let c = /* @__PURE__ */ new Set();
1311
+ if (r.feature["dataset-terms"].forEach((v) => {
1312
+ c.add(v.label ? v.label : v.term);
1313
+ }), c.size === 0 && c.add(u), t.facets = [...c], this.settingsStore.hasAppliedFacets(c) && this.settingsStore.appliedFacets.length <= c.size)
1314
+ return;
1315
+ if (this.settingsStore.appliedFacets.length) {
1316
+ if (!this.settingsStore.hasAppliedFacets(c)) {
1317
+ const v = [.../* @__PURE__ */ new Set([
1318
+ ...this.settingsStore.appliedFacets,
1319
+ ...c
1320
+ ])];
1321
+ this.settingsStore.updateAppliedFacets(v);
1322
+ }
1323
+ } else
1324
+ c.size > 1 && (t.type = "Facets"), this.settingsStore.updateAppliedFacets(t.facets);
1020
1325
  }
1326
+ a = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
1021
1327
  }
1022
- } else r.eventType == "mouseenter" && (s.eventType = "highlighted", t = !0);
1023
- else e == "Scaffold" && (r && ((((i = r.data) == null ? void 0 : i.id) === void 0 || ((o = r.data) == null ? void 0 : o.id) === "") && (r.data.id = (h = r.data) == null ? void 0 : h.group), s.internalName = r.data.id, r.data.lastActionOnMarker === !0 && (n = {
1328
+ } else r.eventType == "mouseenter" && (l.eventType = "highlighted", a = !0);
1329
+ else e == "Scaffold" && (r && ((((i = r.data) == null ? void 0 : i.id) === void 0 || ((h = r.data) == null ? void 0 : h.id) === "") && (r.data.id = (o = r.data) == null ? void 0 : o.group), l.internalName = r.data.id, r.data.lastActionOnMarker === !0 && (t = {
1024
1330
  type: "Facet",
1025
- facets: [x(r.data.id)]
1026
- })), s.eventType = "selected", t = !0);
1027
- n && f.emit("PopoverActionClick", n), t && this.$emit("resource-selected", s);
1331
+ facets: [D(r.data.id)]
1332
+ })), l.eventType = "selected", a = !0);
1333
+ t && m.emit("PopoverActionClick", t), a && this.$emit("resource-selected", l);
1028
1334
  },
1029
1335
  resourceHasAction: function(e) {
1030
1336
  return e && (e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets");
1031
1337
  },
1032
- /**
1033
- * Get the term to zoom/highlight in a synchronisation event,
1034
- * if it cannot be found in the map, it will perform several
1035
- * calls to try to ge a valid name/id.
1036
- */
1037
- getNameAndIdFromSyncData: async function(e) {
1038
- let a = e.internalName;
1039
- a === void 0 && e.resource && (a = e.resource.label);
1040
- let r;
1041
- if (e.resource && e.resource.resource && (r = e.resource.resource[0]), this.entry.type === "Scaffold") {
1042
- if (this.$refs.scaffold.findObjectsWithGroupName(a).length === 0) {
1043
- if (e.resource && e.resource.feature) {
1044
- const s = b(e.resource.feature.models);
1045
- if (s.length > 0) return s;
1046
- }
1047
- let t = C(a);
1048
- if (t)
1049
- return t;
1050
- if (r && e.eventType === "selected")
1051
- return fetch(`${this.apiLocation}get-related-terms/${r}`).then((s) => s.json()).then((s) => {
1052
- var l;
1053
- if (((l = s.uberon) == null ? void 0 : l.array.length) > 0)
1054
- return a = s.uberon.array[0].name.charAt(0).toUpperCase() + s.uberon.array[0].name.slice(1), r = s.uberon.array[0].id.toUpperCase(), { id: r, name: a };
1055
- });
1056
- }
1057
- } else if (this.entry.type === "MultiFlatmap")
1058
- if (a === "Bladder")
1059
- a = "Urinary Bladder";
1060
- else {
1061
- const n = b(a);
1062
- n.length > 0 && (a = n[0]);
1063
- }
1064
- return { id: r, name: a };
1065
- },
1066
1338
  // Get the species and andaotmy info for the featured datasets
1067
1339
  getDatasetAnatomyInfo: function(e) {
1068
- fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((a) => a.json()).then((a) => {
1069
- const r = a.result[0];
1070
- let n;
1340
+ fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((n) => n.json()).then((n) => {
1341
+ const r = n.result[0];
1342
+ let t;
1071
1343
  try {
1072
- n = r.anatomy.organ[0].curie;
1344
+ t = r.anatomy.organ[0].curie;
1073
1345
  } catch {
1074
- n = void 0;
1346
+ t = void 0;
1075
1347
  }
1076
- let t;
1348
+ let a;
1077
1349
  try {
1078
- t = r.item.curie;
1350
+ a = r.item.curie;
1079
1351
  } catch {
1080
- t = void 0;
1352
+ a = void 0;
1081
1353
  }
1082
- let s;
1354
+ let l;
1083
1355
  try {
1084
- let l = 0, i = !1;
1085
- for (; !i && l < r.organisms.subject.length; ) {
1086
- const o = r.organisms.subject[l];
1087
- o.species && (s = o.species.name, i = !0), l += 1;
1356
+ let s = 0, i = !1;
1357
+ for (; !i && s < r.organisms.subject.length; ) {
1358
+ const h = r.organisms.subject[s];
1359
+ h.species && (l = h.species.name, i = !0), s += 1;
1088
1360
  }
1089
1361
  } catch {
1090
- s = void 0;
1362
+ l = void 0;
1091
1363
  }
1092
1364
  this.settingsStore.updateFeaturedMarker({
1093
1365
  identifier: e,
1094
- marker: n,
1095
- doi: t,
1096
- species: s
1366
+ marker: t,
1367
+ doi: a,
1368
+ species: l
1097
1369
  });
1098
1370
  });
1099
1371
  },
1100
1372
  // Check if the old featured dataset api has any info
1101
1373
  oldFeaturedDatasetApiHasInfo: async function() {
1102
- let a = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
1103
- return !a.identifiers || a.identifiers.length == 0 ? !1 : a.identifiers;
1374
+ let n = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
1375
+ return !n.identifiers || n.identifiers.length == 0 ? !1 : n.identifiers;
1104
1376
  },
1105
1377
  // Check if the new featured dataset api has any info
1106
1378
  newFeaturedDatasetApiHasInfo: async function() {
1107
- let a = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
1108
- return !a.datasets || a.datasets.length == 0 ? !1 : a.datasets.map((r) => r.id);
1379
+ let n = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
1380
+ return !n.datasets || n.datasets.length == 0 ? !1 : n.datasets.map((r) => r.id);
1109
1381
  },
1110
- flatmapResourceSelected: function(e, a) {
1111
- var l;
1112
- this.resourceSelected(e, a);
1113
- const r = a[0], { eventType: n, feature: t } = r, { viewingMode: s } = this.settingsStore.globalSettings;
1114
- if (n === "click" && t.type === "feature" && ((l = t.models) != null && l.startsWith("ilxtr:"))) {
1382
+ flatmapResourceSelected: function(e, n) {
1383
+ var s;
1384
+ this.resourceSelected(e, n);
1385
+ const r = n[0], { eventType: t, feature: a } = r, { viewingMode: l } = this.settingsStore.globalSettings;
1386
+ if (t === "click" && a.type === "feature" && ((s = a.models) != null && s.startsWith("ilxtr:"))) {
1115
1387
  const i = [];
1116
- a.forEach((o) => {
1117
- const { models: h } = o.feature;
1118
- i.push(h);
1119
- }), F.sendEvent({
1388
+ n.forEach((h) => {
1389
+ const { models: o } = h.feature;
1390
+ i.push(o);
1391
+ }), d.sendEvent({
1120
1392
  event: "interaction_event",
1121
1393
  event_name: "portal_maps_connectivity",
1122
1394
  category: i.join(", "),
1123
- location: e + " " + s
1395
+ location: e + " " + l
1124
1396
  });
1125
1397
  }
1126
- if (n === "click" && t.type === "feature" && e === "Flatmap") {
1127
- let i, o;
1128
- if (t && t.variable) {
1129
- const c = t.variable.split("/");
1130
- c.length === 1 && (o = c[0]), c.length === 2 && (i = c[0], o = c[1]);
1131
- }
1132
- if (!o) {
1133
- const c = this.mappingStore.mapToCellMLIdentifiers(t.mapUUID, t.id);
1134
- i = c == null ? void 0 : c.component, o = c == null ? void 0 : c.variable;
1135
- }
1136
- if (!i || !o)
1137
- return;
1138
- const h = {
1139
- component: i,
1140
- featureId: t.id,
1141
- label: t.label,
1142
- mapId: t.mapUUID,
1143
- offset: { left: 15, top: 15 },
1144
- ownerId: this.entry.id,
1145
- position: { x: this.elementX + this.left, y: this.elementY + this.top },
1146
- protocol: r.protocol,
1147
- variable: o,
1148
- windowId: `simulation-window-${this.entry.id}-${i}-${o}`
1149
- };
1150
- this.simulationPlotStore.requestSimulation(h);
1151
- }
1152
1398
  },
1153
1399
  /**
1154
1400
  * Get a list of featured datasets to display.
1155
1401
  */
1156
1402
  getFeaturedDatasets: async function() {
1157
- let e = [], a = await this.oldFeaturedDatasetApiHasInfo();
1158
- if (a) e = a;
1403
+ let e = [], n = await this.oldFeaturedDatasetApiHasInfo();
1404
+ if (n) e = n;
1159
1405
  else {
1160
1406
  let r = await this.newFeaturedDatasetApiHasInfo();
1161
1407
  r && (e = r);
@@ -1199,65 +1445,67 @@ const $ = {
1199
1445
  checkEndHelpMouseDown: function(e) {
1200
1446
  e.target.closest(".help-mode-dialog") || this.endHelp();
1201
1447
  },
1202
- flatmapHighlight: async function(e, a, r, n) {
1203
- let t = [...a, ...n];
1204
- const s = this.settingsStore.globalSettings;
1205
- if (s.highlightConnectedPaths) {
1206
- const l = a.length ? a : n.length ? n : [], i = await e.retrieveConnectedPaths(l);
1207
- i && t.push(...i);
1448
+ flatmapHighlight: async function(e, n, r, t) {
1449
+ let a = [...n, ...t];
1450
+ const l = this.settingsStore.globalSettings;
1451
+ if (l.highlightConnectedPaths) {
1452
+ const s = n.length ? n : t.length ? t : [], i = await e.retrieveConnectedPaths(s);
1453
+ i && a.push(...i);
1208
1454
  }
1209
- if (s.highlightDOIPaths) {
1210
- const l = await e.searchConnectivitiesByReference(r);
1211
- l && t.push(...l);
1455
+ if (l.highlightDOIPaths) {
1456
+ const s = await e.searchConnectivitiesByReference(r);
1457
+ s && a.push(...s);
1212
1458
  }
1213
- return t = [...new Set(t)], t;
1459
+ return a = [...new Set(a)], a;
1214
1460
  },
1215
1461
  sidebarHoverHighlight: function(e) {
1216
- var a, r;
1462
+ var n, r;
1217
1463
  if (this.visible && ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady || this.scaffoldRef && this.scaffoldLoaded)) {
1218
- const n = this.settingsStore.hoverAnatomies, t = this.settingsStore.hoverOrgans, s = this.settingsStore.hoverDOI, l = this.settingsStore.hoverConnectivity;
1219
- let i = null, o = null;
1220
- this.flatmapRef && (i = this.flatmapRef), this.multiflatmapRef && (i = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (o = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !t.length && !s && !l.length && ((this.multiflatmapRef || this.flatmapRef) && i ? i.mapImp && !i.mapImp.contextLost && ((a = i.mapImp) == null || a.clearSearchResults(), e.connectivityProcessed && ((r = i.mapImp) == null || r.setPaint({ dimmed: !0 }))) : this.scaffoldRef && o && o.changeHighlightedByName(t, "", !1)), this.highlightDelay = setTimeout(() => {
1221
- (n.length || t.length || s || l.length) && ((this.multiflatmapRef || this.flatmapRef) && i ? this.flatmapHighlight(i, n, s, l).then((h) => {
1464
+ const t = this.settingsStore.hoverAnatomies, a = this.settingsStore.hoverOrgans, l = this.settingsStore.hoverDOI, s = this.settingsStore.hoverConnectivity;
1465
+ let i = null, h = null;
1466
+ this.flatmapRef && (i = this.flatmapRef), this.multiflatmapRef && (i = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (h = this.scaffoldRef), clearTimeout(this.highlightDelay), !t.length && !a.length && !l && !s.length && ((this.multiflatmapRef || this.flatmapRef) && i ? i.mapImp && !i.mapImp.contextLost && ((n = i.mapImp) == null || n.clearSearchResults(), e.connectivityProcessed && ((r = i.mapImp) == null || r.setPaint({ dimmed: !0 }))) : this.scaffoldRef && h && h.changeHighlightedByName(a, "", !1)), this.highlightDelay = setTimeout(() => {
1467
+ (t.length || a.length || l || s.length) && ((this.multiflatmapRef || this.flatmapRef) && i ? this.flatmapHighlight(i, t, l, s).then((o) => {
1222
1468
  try {
1223
1469
  i.showConnectivityTooltips({
1224
- connectivityInfo: { featureId: h },
1470
+ connectivityInfo: { featureId: o },
1225
1471
  data: []
1226
1472
  });
1227
- } catch {
1228
- if (l.length && i.mapImp) {
1229
- const u = i.mapImp.uuid;
1230
- h.every(
1231
- (v) => this.connectivityKnowledge[u].some((p) => p.id === v)
1473
+ } catch (u) {
1474
+ if (console.log(u), s.length && i.mapImp) {
1475
+ const c = i.mapImp.uuid;
1476
+ o.every(
1477
+ (f) => this.connectivityKnowledge[c].some(
1478
+ (p) => p.id === f
1479
+ )
1232
1480
  ) || i.mapImp && !i.mapImp.contextLost && i.mapImp.clearSearchResults();
1233
1481
  }
1234
1482
  }
1235
- }) : this.scaffoldRef && o && o.changeHighlightedByName(t, "", !1));
1483
+ }) : this.scaffoldRef && h && h.changeHighlightedByName(a, "", !1));
1236
1484
  }, 100);
1237
1485
  }
1238
1486
  },
1239
1487
  onAnnotationOpen: function(e) {
1240
- f.emit("annotation-open", e);
1488
+ m.emit("annotation-open", e);
1241
1489
  },
1242
1490
  onAnnotationClose: function() {
1243
- f.emit("sidebar-annotation-close");
1491
+ m.emit("sidebar-annotation-close");
1244
1492
  },
1245
1493
  updateOfflineAnnotationEnabled: function(e) {
1246
- f.emit("update-offline-annotation-enabled", e);
1494
+ m.emit("update-offline-annotation-enabled", e);
1247
1495
  },
1248
1496
  onConnectivityInfoOpen: function(e) {
1249
- f.emit("connectivity-info-open", e);
1497
+ m.emit("connectivity-info-open", e);
1250
1498
  },
1251
1499
  onConnectivityError: function(e) {
1252
- f.emit("connectivity-error", e);
1500
+ m.emit("connectivity-error", e);
1253
1501
  },
1254
1502
  onConnectivityInfoClose: function() {
1255
- f.emit("connectivity-info-close");
1503
+ m.emit("connectivity-info-close");
1256
1504
  },
1257
1505
  onSidebarAnnotationClose: function() {
1258
1506
  },
1259
1507
  onNeuronConnectionFeatureClick: function(e) {
1260
- f.emit("neuron-connection-feature-click", e);
1508
+ m.emit("neuron-connection-feature-click", e);
1261
1509
  },
1262
1510
  showConnectivity: function() {
1263
1511
  },
@@ -1269,140 +1517,115 @@ const $ = {
1269
1517
  this.flatmapService = await this.mockUpFlatmapService(), this.loadConnectivityExplorerConfig(this.flatmapService);
1270
1518
  },
1271
1519
  mockUpFlatmapService: async function() {
1272
- const r = (await (await fetch(this.flatmapAPI)).json()).filter((c) => c.id === "human-flatmap_male").sort((c, u) => u.created.localeCompare(c.created))[0], n = r.uuid, t = r.sckan["knowledge-source"], l = await (await fetch(`${this.flatmapAPI}/flatmap/${n}/pathways`)).json();
1273
- this.flatmapQueries = M(new L()), this.flatmapQueries.initialise(this.flatmapAPI);
1520
+ const r = (await (await fetch(this.flatmapAPI)).json()).filter((u) => u.id === "human-flatmap_male").sort((u, c) => c.created.localeCompare(u.created))[0], t = r.uuid, a = r.sckan["knowledge-source"], s = await (await fetch(`${this.flatmapAPI}/flatmap/${t}/pathways`)).json();
1521
+ this.flatmapQueries = A(new T()), this.flatmapQueries.initialise(this.flatmapAPI);
1274
1522
  const i = {
1275
1523
  mapMetadata: {
1276
- uuid: n,
1524
+ uuid: t,
1277
1525
  connectivity: {
1278
1526
  ...r.sckan
1279
1527
  }
1280
1528
  },
1281
- pathways: l,
1529
+ pathways: s,
1282
1530
  resource: this.entry.resource,
1283
- knowledgeSource: t,
1284
- queryKnowledge: async (c) => {
1285
- const u = "select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc", m = [t, c], v = await this.flatmapQueries.queryKnowledge(u, m);
1286
- return JSON.parse(v);
1531
+ knowledgeSource: a,
1532
+ queryKnowledge: async (u) => {
1533
+ const c = "select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc", v = [a, u], f = await this.flatmapQueries.queryKnowledge(c, v);
1534
+ return JSON.parse(f);
1287
1535
  },
1288
- queryLabels: async (c) => {
1289
- const u = `select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(
1290
- c.length - 1
1291
- )}) order by entity, source desc`, m = [t, ...c], v = await this.flatmapQueries.queryKnowledge(u, m), p = [];
1536
+ queryLabels: async (u) => {
1537
+ const c = `select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(u.length - 1)}) order by entity, source desc`, v = [a, ...u], f = await this.flatmapQueries.queryKnowledge(c, v), p = [];
1292
1538
  let g;
1293
- for (const A of v)
1294
- if (A[1] !== g) {
1295
- const y = JSON.parse(A[2]);
1539
+ for (const M of f)
1540
+ if (M[1] !== g) {
1541
+ const I = JSON.parse(M[2]);
1296
1542
  p.push({
1297
- entity: A[1],
1298
- label: y.label || A[1]
1299
- }), g = A[1];
1543
+ entity: M[1],
1544
+ label: I.label || M[1]
1545
+ }), g = M[1];
1300
1546
  }
1301
1547
  return p;
1302
1548
  }
1303
- }, o = X();
1549
+ }, h = k();
1304
1550
  return {
1305
1551
  mockup: !0,
1306
- getFilterOptions: async (c, u) => {
1307
- const v = await O(
1308
- this.flatmapAPI,
1309
- c,
1310
- u,
1311
- void 0
1312
- );
1313
- return [...o, ...v];
1552
+ getFilterOptions: async (u, c) => {
1553
+ const f = await B(this.flatmapAPI, u, c, void 0);
1554
+ return [...h, ...f];
1314
1555
  },
1315
- getTermNerveMaps: B,
1556
+ getTermNerveMaps: U,
1316
1557
  mapImp: i
1317
1558
  };
1318
1559
  },
1319
1560
  loadConnectivityExplorerConfig: async function(e) {
1320
- var s;
1321
- const a = e.mapImp, r = d(a), n = e.mockup ? a.resource : a.uuid;
1322
- let t = [];
1561
+ var l;
1562
+ const n = e.mapImp, r = R(n), t = e.mockup ? n.resource : n.uuid;
1563
+ let a = [];
1323
1564
  if (!this.connectivityKnowledge[r]) {
1324
- this.flatmapQueries = M(new L()), this.flatmapQueries.initialise(this.flatmapAPI);
1325
- const l = await N(a, this.flatmapQueries);
1326
- this.connectivityKnowledge[r] = l.filter((i) => {
1327
- var o;
1328
- return (o = i.connectivity) == null ? void 0 : o.length;
1329
- }).sort((i, o) => i.label.localeCompare(o.label));
1565
+ this.flatmapQueries = A(new T()), this.flatmapQueries.initialise(this.flatmapAPI);
1566
+ const s = await P(n, this.flatmapQueries);
1567
+ this.connectivityKnowledge[r] = s.filter((i) => {
1568
+ var h;
1569
+ return (h = i.connectivity) == null ? void 0 : h.length;
1570
+ }).sort((i, h) => i.label.localeCompare(h.label));
1330
1571
  }
1331
- if (!this.connectivityKnowledge[n]) {
1332
- const l = ((s = a.pathways) == null ? void 0 : s.paths) || {};
1333
- this.connectivityKnowledge[n] = this.connectivityKnowledge[r].filter(
1334
- (i) => i.id in l
1335
- );
1572
+ if (!this.connectivityKnowledge[t]) {
1573
+ const s = ((l = n.pathways) == null ? void 0 : l.paths) || {};
1574
+ this.connectivityKnowledge[t] = this.connectivityKnowledge[r].filter((i) => i.id in s);
1336
1575
  }
1337
- if (!this.connectivityFilterOptions[n] && !e.mockup && (this.connectivityFilterOptions[n] = await e.getFilterOptions(
1338
- a,
1339
- this.connectivityKnowledge[n]
1340
- )), e.mockup) {
1341
- const l = e.getTermNerveMaps() || {}, i = JSON.parse(JSON.stringify(this.connectivityKnowledge[n]));
1342
- this.connectivityKnowledge[n] = i.map((h) => {
1343
- var u;
1344
- let c = h;
1345
- if ((u = h.nerves) != null && u.length) {
1346
- const v = h.nerves.flat(1 / 0).reduce((p, g) => (g in l && p.push(l[g]), p), []);
1347
- v != null && v.length && (t.push(...v), c["nerve-label"] = v.sort((p, g) => p.nerve.localeCompare(g.nerve)));
1576
+ if (!this.connectivityFilterOptions[t] && !e.mockup && (this.connectivityFilterOptions[t] = await e.getFilterOptions(n, this.connectivityKnowledge[t])), e.mockup) {
1577
+ const s = e.getTermNerveMaps() || {}, i = JSON.parse(JSON.stringify(this.connectivityKnowledge[t]));
1578
+ this.connectivityKnowledge[t] = i.map((o) => {
1579
+ var c;
1580
+ let u = o;
1581
+ if ((c = o.nerves) != null && c.length) {
1582
+ const f = o.nerves.flat(1 / 0).reduce((p, g) => (g in s && p.push(s[g]), p), []);
1583
+ f != null && f.length && (a.push(...f), u["nerve-label"] = f.sort((p, g) => p.nerve.localeCompare(g.nerve)));
1348
1584
  }
1349
- return c;
1350
- }).filter((h) => h["nerve-label"]), this.connectivityFilterOptions[n] || (this.connectivityFilterOptions[n] = await e.getFilterOptions(
1351
- a,
1352
- this.connectivityKnowledge[n]
1353
- )), t = t.map((h) => h.nerve.toLowerCase());
1354
- const o = JSON.parse(JSON.stringify(this.connectivityFilterOptions[n]));
1355
- this.connectivityFilterOptions[n] = o.map((h) => {
1356
- if (h.key === "scaffold.connectivity.nerve") {
1357
- const c = h.children.filter((u) => t.includes(u.label.toLowerCase()));
1358
- return { ...h, children: c };
1585
+ return u;
1586
+ }).filter((o) => o["nerve-label"]), this.connectivityFilterOptions[t] || (this.connectivityFilterOptions[t] = await e.getFilterOptions(n, this.connectivityKnowledge[t])), a = a.map((o) => o.nerve.toLowerCase());
1587
+ const h = JSON.parse(JSON.stringify(this.connectivityFilterOptions[t]));
1588
+ this.connectivityFilterOptions[t] = h.map((o) => {
1589
+ if (o.key === "scaffold.connectivity.nerve") {
1590
+ const u = o.children.filter((c) => a.includes(c.label.toLowerCase()));
1591
+ return { ...o, children: u };
1359
1592
  } else
1360
- return h;
1593
+ return o;
1361
1594
  });
1362
1595
  } else
1363
- this.connectivityFilterSources[n] || (this.connectivityFilterSources[n] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);
1364
- this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), f.emit("species-layout-connectivity-update");
1596
+ this.connectivityFilterSources[t] || (this.connectivityFilterSources[t] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);
1597
+ this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), m.emit("species-layout-connectivity-update");
1365
1598
  },
1366
1599
  knowledgeTooltipQuery: async function(e) {
1367
1600
  await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.flatmapService.mapImp, { resource: [e.id] });
1368
- let a = await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp, {
1601
+ let n = await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp, {
1369
1602
  resource: [e.id],
1370
1603
  label: e.label,
1371
1604
  provenanceTaxonomy: e.taxons,
1372
1605
  feature: []
1373
1606
  });
1374
- return a.knowledgeSource = d(this.flatmapService.mapImp), a.mapId = this.flatmapService.mapImp.mapMetadata.id, a.mapuuid = this.flatmapService.mapImp.mapMetadata.uuid, a["nerve-label"] = e["nerve-label"], a.ready = !0, a;
1607
+ return n.knowledgeSource = R(this.flatmapService.mapImp), n.mapId = this.flatmapService.mapImp.mapMetadata.id, n.mapuuid = this.flatmapService.mapImp.mapMetadata.uuid, n["nerve-label"] = e["nerve-label"], n.ready = !0, n;
1375
1608
  },
1376
1609
  getKnowledgeTooltip: async function(e) {
1377
- this.tooltipEntry = [], e.data.forEach(
1378
- (n) => this.tooltipEntry.push({
1379
- title: n.label,
1380
- featureId: [n.id],
1381
- ready: !1
1382
- })
1383
- ), f.emit("connectivity-info-open", this.tooltipEntry);
1384
- let a = [];
1385
- for (let n = 0; n < e.data.length; n++)
1386
- a.push(await this.knowledgeTooltipQuery(e.data[n]));
1387
- this.tooltipEntry = await Promise.all(a), this.tooltipEntry.map((n) => n.featureId[0]).length > 0 && f.emit("connectivity-info-open", this.tooltipEntry);
1610
+ this.tooltipEntry = [], e.data.forEach((t) => this.tooltipEntry.push({ title: t.label, featureId: [t.id], ready: !1 })), m.emit("connectivity-info-open", this.tooltipEntry);
1611
+ let n = [];
1612
+ for (let t = 0; t < e.data.length; t++)
1613
+ n.push(await this.knowledgeTooltipQuery(e.data[t]));
1614
+ this.tooltipEntry = await Promise.all(n), this.tooltipEntry.map((t) => t.featureId[0]).length > 0 && m.emit("connectivity-info-open", this.tooltipEntry);
1388
1615
  },
1389
- changeConnectivitySource: async function(e, a) {
1390
- var s, l;
1391
- const { entry: r, connectivitySource: n } = e, t = (l = (s = this == null ? void 0 : this.flatmapService) == null ? void 0 : s.mapImp) == null ? void 0 : l.mapMetadata.uuid;
1392
- a.includes(t) || (a.push(t), await this.flatmapQueries.queryForConnectivityNew(
1393
- this.flatmapService.mapImp,
1394
- r.featureId[0],
1395
- n
1396
- ), this.tooltipEntry = this.tooltipEntry.map((i) => i.featureId[0] === r.featureId[0] ? this.flatmapQueries.updateTooltipData(i) : i), f.emit("connectivity-info-open", this.tooltipEntry));
1616
+ changeConnectivitySource: async function(e, n) {
1617
+ var l, s;
1618
+ const { entry: r, connectivitySource: t } = e, a = (s = (l = this == null ? void 0 : this.flatmapService) == null ? void 0 : l.mapImp) == null ? void 0 : s.mapMetadata.uuid;
1619
+ n.includes(a) || (n.push(a), await this.flatmapQueries.queryForConnectivityNew(this.flatmapService.mapImp, r.featureId[0], t), this.tooltipEntry = this.tooltipEntry.map((i) => i.featureId[0] === r.featureId[0] ? this.flatmapQueries.updateTooltipData(i) : i), m.emit("connectivity-info-open", this.tooltipEntry));
1397
1620
  },
1398
1621
  trackEvent: function(e) {
1399
- F.sendEvent(e);
1622
+ d.sendEvent(e);
1400
1623
  }
1401
1624
  },
1402
1625
  data: function() {
1403
1626
  return {
1404
1627
  apiLocation: void 0,
1405
- activeSpecies: _,
1628
+ activeSpecies: x,
1406
1629
  scaffoldCamera: void 0,
1407
1630
  mainStyle: {
1408
1631
  height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
@@ -1415,6 +1638,9 @@ const $ = {
1415
1638
  multiflatmapRef: null,
1416
1639
  flatmapRef: null,
1417
1640
  scaffoldRef: null,
1641
+ iframeRef: null,
1642
+ plotRef: null,
1643
+ simulationRef: null,
1418
1644
  scaffoldLoaded: !1,
1419
1645
  isInHelp: !1,
1420
1646
  mapManager: void 0,
@@ -1438,5 +1664,5 @@ const $ = {
1438
1664
  }
1439
1665
  };
1440
1666
  export {
1441
- $ as C
1667
+ J as C
1442
1668
  };