@abi-software/mapintegratedvuer 1.10.1 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,20 @@
1
1
  import { markRaw as F } from "vue";
2
- import { u as C, c as M, d as I, a as h, T as A, e as S, f as N, h as T, l as $ } from "./index-Dg5B_ClS.js";
3
- import { mapStores as H } from "pinia";
4
- const d = function(e) {
5
- return e ? [...new Set(e.map((t) => JSON.stringify(t)))].map(
6
- (t) => JSON.parse(t)
2
+ import { u as C, c as I, d as A, a as h, T as M, g as S, e as $, f as H, l as L } from "./index-DL73mn-k.js";
3
+ import { mapStores as N } from "pinia";
4
+ const d = function(t) {
5
+ return t ? [...new Set(t.map((e) => JSON.stringify(e)))].map(
6
+ (e) => JSON.parse(e)
7
7
  ) : [];
8
- }, m = [], v = async function(e, t) {
9
- const i = t.filter(
8
+ }, m = [], v = async function(t, e) {
9
+ const i = e.filter(
10
10
  (o) => m.some((a) => a.taxon === o)
11
11
  ), n = m.filter(
12
12
  (o) => i.includes(o.taxon)
13
- ), s = t.filter(
13
+ ), s = e.filter(
14
14
  (o) => !i.includes(o)
15
15
  );
16
16
  if (s.length) {
17
- const o = await e.queryLabels(s);
17
+ const o = await t.queryLabels(s);
18
18
  if (o.length)
19
19
  return o.forEach((a) => {
20
20
  let { entity: r, label: l } = a;
@@ -24,25 +24,25 @@ const d = function(e) {
24
24
  }), n;
25
25
  } else
26
26
  return n;
27
- }, g = function(e, t) {
28
- if (!e || !t) return !1;
29
- let i = JSON.stringify(e), n = JSON.stringify(t);
27
+ }, g = function(t, e) {
28
+ if (!t || !e) return !1;
29
+ let i = JSON.stringify(t), n = JSON.stringify(e);
30
30
  return i.indexOf(n) !== -1;
31
- }, p = (e, t) => {
32
- const i = e.name ?? e, n = t.name ?? t, s = i.toUpperCase(), o = n.toUpperCase();
31
+ }, p = (t, e) => {
32
+ const i = t.name ?? t, n = e.name ?? e, s = i.toUpperCase(), o = n.toUpperCase();
33
33
  return s < o ? -1 : s > o ? 1 : 0;
34
34
  };
35
- let L = function() {
36
- this.initialise = function(e) {
37
- this.flatmapAPI = e, this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "sckan";
38
- }, this.createTooltipData = async function(e, t) {
35
+ let P = function() {
36
+ this.initialise = function(t) {
37
+ this.flatmapAPI = t, this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "sckan";
38
+ }, this.createTooltipData = async function(t, e) {
39
39
  let i = [];
40
- t.feature.hyperlinks && t.feature.hyperlinks.length > 0 ? i = t.feature.hyperlinks : i = this.rawURLs;
40
+ e.feature.hyperlinks && e.feature.hyperlinks.length > 0 ? i = e.feature.hyperlinks : i = this.rawURLs;
41
41
  let n;
42
- if (t.provenanceTaxonomy) {
42
+ if (e.provenanceTaxonomy) {
43
43
  n = [];
44
44
  try {
45
- const o = await v(e, t.provenanceTaxonomy);
45
+ const o = await v(t, e.provenanceTaxonomy);
46
46
  o.length && o.forEach((a) => {
47
47
  const { label: r } = a;
48
48
  n.push(r);
@@ -58,16 +58,16 @@ let L = function() {
58
58
  destinationsWithDatasets: this.destinationsWithDatasets,
59
59
  originsWithDatasets: this.originsWithDatasets,
60
60
  componentsWithDatasets: this.componentsWithDatasets,
61
- title: t.label,
62
- featureId: t.resource,
61
+ title: e.label,
62
+ featureId: e.resource,
63
63
  hyperlinks: i,
64
- provenanceTaxonomy: t.provenanceTaxonomy,
64
+ provenanceTaxonomy: e.provenanceTaxonomy,
65
65
  provenanceTaxonomyLabel: n,
66
66
  connectivitySource: this.connectivitySource
67
67
  };
68
- }, this.updateTooltipData = function(e) {
68
+ }, this.updateTooltipData = function(t) {
69
69
  return {
70
- ...e,
70
+ ...t,
71
71
  origins: this.origins,
72
72
  originsWithDatasets: this.originsWithDatasets,
73
73
  components: this.components,
@@ -76,16 +76,16 @@ let L = function() {
76
76
  destinationsWithDatasets: this.destinationsWithDatasets,
77
77
  connectivitySource: this.connectivitySource
78
78
  };
79
- }, this.createComponentsLabelList = function(e, t) {
79
+ }, this.createComponentsLabelList = function(t, e) {
80
80
  let i = [];
81
- return e.forEach((n) => {
82
- i.push(this.createLabelFromNeuralNode(n[0]), t), n.length === 2 && i.push(this.createLabelFromNeuralNode(n[1]), t);
81
+ return t.forEach((n) => {
82
+ i.push(this.createLabelFromNeuralNode(n[0]), e), n.length === 2 && i.push(this.createLabelFromNeuralNode(n[1]), e);
83
83
  }), i;
84
- }, this.createLabelLookup = function(e, t) {
84
+ }, this.createLabelLookup = function(t, e) {
85
85
  return new Promise(async (i) => {
86
86
  let n = {};
87
87
  this.uberons = [];
88
- const s = await v(e, t);
88
+ const s = await v(t, e);
89
89
  s.length && (s.forEach((o) => {
90
90
  const { taxon: a, label: r } = o;
91
91
  n[a] = r, this.uberons.push({
@@ -94,59 +94,59 @@ let L = function() {
94
94
  });
95
95
  }), i(n));
96
96
  });
97
- }, this.buildConnectivitySqlStatement = function(e) {
98
- let t = "select knowledge from knowledge where entity in (";
99
- if (e.length === 1)
100
- t += `'${e[0]}')`;
101
- else if (e.length > 1)
102
- for (let i in e)
103
- t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
104
- return t;
105
- }, this.buildLabelSqlStatement = function(e) {
106
- let t = "select entity, label from labels where entity in (";
107
- if (e.length === 1)
108
- t += `'${e[0]}')`;
109
- else if (e.length > 1)
110
- for (let i in e)
111
- t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
112
- return t;
113
- }, this.findAllIdsFromConnectivity = function(e) {
114
- let t = e.connectivity.flat(), i = [...new Set(t)], n = [];
97
+ }, this.buildConnectivitySqlStatement = function(t) {
98
+ let e = "select knowledge from knowledge where entity in (";
99
+ if (t.length === 1)
100
+ e += `'${t[0]}')`;
101
+ else if (t.length > 1)
102
+ for (let i in t)
103
+ e += `'${t[i]}'${i >= t.length - 1 ? ")" : ","} `;
104
+ return e;
105
+ }, this.buildLabelSqlStatement = function(t) {
106
+ let e = "select entity, label from labels where entity in (";
107
+ if (t.length === 1)
108
+ e += `'${t[0]}')`;
109
+ else if (t.length > 1)
110
+ for (let i in t)
111
+ e += `'${t[i]}'${i >= t.length - 1 ? ")" : ","} `;
112
+ return e;
113
+ }, this.findAllIdsFromConnectivity = function(t) {
114
+ let e = t.connectivity.flat(), i = [...new Set(e)], n = [];
115
115
  return i.forEach((s) => {
116
116
  Array.isArray(s) ? n.push(s.flat()) : n.push(s);
117
117
  }), [...new Set(n.flat())];
118
- }, this.flattenConnectivity = function(e) {
119
- let t = e.flat(), i = [...new Set(t)], n = [];
118
+ }, this.flattenConnectivity = function(t) {
119
+ let e = t.flat(), i = [...new Set(e)], n = [];
120
120
  return i.forEach((s) => {
121
121
  Array.isArray(s) ? n.push(s.flat()) : n.push(s);
122
122
  }), n.flat();
123
- }, this.findComponents = function(e, t, i, n) {
124
- let s = e.connectivity.flat(), o = d(s), a = [], r = !1;
123
+ }, this.findComponents = function(t, e, i, n) {
124
+ let s = t.connectivity.flat(), o = d(s), a = [], r = !1;
125
125
  return o.forEach((l) => {
126
- r = !1, g(t, l) && (r = !0), n && g(n, l) && (r = !0), g(i, l) && (r = !0), r || a.push(l);
126
+ r = !1, g(e, l) && (r = !0), n && g(n, l) && (r = !0), g(i, l) && (r = !0), r || a.push(l);
127
127
  }), a;
128
- }, this.retrieveFlatmapKnowledgeForEvent = async function(e, t) {
128
+ }, this.retrieveFlatmapKnowledgeForEvent = async function(t, e) {
129
129
  this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
130
- const i = t.resource;
130
+ const i = e.resource;
131
131
  if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !i || i.length === 0 || !i[0]) return;
132
- let n = this.queryForConnectivityNew(e, i[0]);
132
+ let n = this.queryForConnectivityNew(t, i[0]);
133
133
  return await Promise.all([n]);
134
- }, this.queryForConnectivityNew = function(e, t, i = "sckan", n = !0) {
134
+ }, this.queryForConnectivityNew = function(t, e, i = "sckan", n = !0) {
135
135
  return this.connectivitySource = i, new Promise((s) => {
136
- (i === "map" ? this.queryMapConnectivity(e.provenance.uuid, t) : e.queryKnowledge(t)).then((a) => {
136
+ (i === "map" ? this.queryMapConnectivity(t.provenance.uuid, e) : t.queryKnowledge(e)).then((a) => {
137
137
  if (this.checkConnectivityExists(a)) {
138
138
  let r = a;
139
- n ? this.processConnectivity(e, r).then((l) => {
139
+ n ? this.processConnectivity(t, r).then((l) => {
140
140
  a.references && (this.rawURLs = [...a.references]), s(l);
141
141
  }) : s(r);
142
142
  } else
143
143
  s(!1);
144
144
  }).catch((a) => {
145
- a.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${t}.`), s(!1);
145
+ a.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${e}.`), s(!1);
146
146
  });
147
147
  });
148
- }, this.queryMapConnectivity = async function(e, t) {
149
- const i = this.flatmapAPI + `flatmap/${e}/connectivity/${t}`;
148
+ }, this.queryMapConnectivity = async function(t, e) {
149
+ const i = this.flatmapAPI + `flatmap/${t}/connectivity/${e}`;
150
150
  try {
151
151
  const n = await fetch(i);
152
152
  if (!n.ok)
@@ -155,8 +155,8 @@ let L = function() {
155
155
  } catch (n) {
156
156
  throw new Error(n);
157
157
  }
158
- }, this.queryForConnectivity = function(e, t, i, n = !0) {
159
- const s = { sql: this.buildConnectivitySqlStatement(t) }, o = {
158
+ }, this.queryForConnectivity = function(t, e, i, n = !0) {
159
+ const s = { sql: this.buildConnectivitySqlStatement(e) }, o = {
160
160
  method: "POST",
161
161
  headers: {
162
162
  "Content-Type": "application/json"
@@ -169,7 +169,7 @@ let L = function() {
169
169
  fetch(`${this.flatmapAPI}knowledge/query/`, o).then((r) => r.json()).then((r) => {
170
170
  if (this.connectivityExists(r)) {
171
171
  let l = JSON.parse(r.values[0][0]);
172
- n ? this.processConnectivity(e, l).then((c) => {
172
+ n ? this.processConnectivity(t, l).then((c) => {
173
173
  a(c);
174
174
  }) : a(l);
175
175
  } else
@@ -178,23 +178,23 @@ let L = function() {
178
178
  r.name === "AbortError" || console.error("Error:", r), a(!1);
179
179
  });
180
180
  });
181
- }, this.checkConnectivityExists = function(e) {
182
- var t;
183
- return e && ((t = e.connectivity) == null ? void 0 : t.length);
184
- }, this.connectivityExists = function(e) {
185
- return !!(e.values && e.values.length > 0 && JSON.parse(e.values[0][0]).connectivity && JSON.parse(e.values[0][0]).connectivity.length > 0);
186
- }, this.findIfNodeIsSingle = function(e) {
187
- return e.length === 1 ? (console.error("Server returns a single node", e), e[0]) : e.length === 2 && e[1].length === 0 ? e[0] : !1;
188
- }, this.createLabelFromNeuralNode = function(e, t) {
189
- let i = this.findIfNodeIsSingle(e);
181
+ }, this.checkConnectivityExists = function(t) {
182
+ var e;
183
+ return t && ((e = t.connectivity) == null ? void 0 : e.length);
184
+ }, this.connectivityExists = function(t) {
185
+ return !!(t.values && t.values.length > 0 && JSON.parse(t.values[0][0]).connectivity && JSON.parse(t.values[0][0]).connectivity.length > 0);
186
+ }, this.findIfNodeIsSingle = function(t) {
187
+ return t.length === 1 ? (console.error("Server returns a single node", t), t[0]) : t.length === 2 && t[1].length === 0 ? t[0] : !1;
188
+ }, this.createLabelFromNeuralNode = function(t, e) {
189
+ let i = this.findIfNodeIsSingle(t);
190
190
  if (i)
191
- return t[i];
192
- let n = t[e[0]];
193
- return e.length === 2 && e[1].length > 0 && e[1].forEach((s) => {
194
- t[s] == null ? n += `, ${s}` : n += `, ${t[s]}`;
191
+ return e[i];
192
+ let n = e[t[0]];
193
+ return t.length === 2 && t[1].length > 0 && t[1].forEach((s) => {
194
+ e[s] == null ? n += `, ${s}` : n += `, ${e[s]}`;
195
195
  }), n;
196
- }, this.flattenAndFindDatasets = function(e, t, i) {
197
- let n = this.flattenConnectivity(e), s = this.flattenConnectivity(t), o = this.flattenConnectivity(i);
196
+ }, this.flattenAndFindDatasets = function(t, e, i) {
197
+ let n = this.flattenConnectivity(t), s = this.flattenConnectivity(e), o = this.flattenConnectivity(i);
198
198
  this.originsWithDatasets = this.uberons.filter(
199
199
  (a) => n.indexOf(a.id) !== -1
200
200
  ).sort(p), this.componentsWithDatasets = this.uberons.filter(
@@ -202,20 +202,20 @@ let L = function() {
202
202
  ).sort(p), this.destinationsWithDatasets = this.uberons.filter(
203
203
  (a) => o.indexOf(a.id) !== -1
204
204
  ).sort(p);
205
- }, this.processConnectivity = function(e, t) {
205
+ }, this.processConnectivity = function(t, e) {
206
206
  return new Promise((i) => {
207
207
  let n = [], s = [], o;
208
- if (t && t["node-phenotypes"]) {
208
+ if (e && e["node-phenotypes"]) {
209
209
  const l = ["ilxtr:hasSomaLocatedIn"], c = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
210
210
  l.forEach((f) => {
211
- f in t["node-phenotypes"] && n.push(...t["node-phenotypes"][f]);
211
+ f in e["node-phenotypes"] && n.push(...e["node-phenotypes"][f]);
212
212
  }), n = d(n), c.forEach((f) => {
213
- f in t["node-phenotypes"] && s.push(...t["node-phenotypes"][f]);
213
+ f in e["node-phenotypes"] && s.push(...e["node-phenotypes"][f]);
214
214
  }), s = d(s);
215
215
  } else
216
- s = d(t.axons), t.somas && t.somas.length > 0 && n.push(...t.somas), t.dendrites && t.dendrites.length > 0 && n.push(...t.dendrites), n = d(n), o = t.somas;
217
- const a = this.findComponents(t, s, n, o), r = this.findAllIdsFromConnectivity(t);
218
- this.createLabelLookup(e, r).then((l) => {
216
+ s = d(e.axons), e.somas && e.somas.length > 0 && n.push(...e.somas), e.dendrites && e.dendrites.length > 0 && n.push(...e.dendrites), n = d(n), o = e.somas;
217
+ const a = this.findComponents(e, s, n, o), r = this.findAllIdsFromConnectivity(e);
218
+ this.createLabelLookup(t, r).then((l) => {
219
219
  this.origins = n.map(
220
220
  (c) => this.createLabelFromNeuralNode(c, l)
221
221
  ).sort(p), this.components = a.map(
@@ -236,33 +236,33 @@ let L = function() {
236
236
  });
237
237
  });
238
238
  });
239
- }, this.buildPubmedSqlStatement = function(e) {
240
- let t = "select distinct publication from publications where entity in (";
241
- if (e.length === 1)
242
- t += `'${e[0]}')`;
243
- else if (e.length > 1)
244
- for (let i in e)
245
- t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
246
- return t;
247
- }, this.buildPubmedSqlStatementForModels = function(e) {
248
- return `select distinct publication from publications where entity = '${e}'`;
249
- }, this.flatmapQuery = function(e) {
250
- const t = { sql: e };
239
+ }, this.buildPubmedSqlStatement = function(t) {
240
+ let e = "select distinct publication from publications where entity in (";
241
+ if (t.length === 1)
242
+ e += `'${t[0]}')`;
243
+ else if (t.length > 1)
244
+ for (let i in t)
245
+ e += `'${t[i]}'${i >= t.length - 1 ? ")" : ","} `;
246
+ return e;
247
+ }, this.buildPubmedSqlStatementForModels = function(t) {
248
+ return `select distinct publication from publications where entity = '${t}'`;
249
+ }, this.flatmapQuery = function(t) {
250
+ const e = { sql: t };
251
251
  return fetch(`${this.flatmapAPI}knowledge/query/`, {
252
252
  method: "POST",
253
253
  headers: {
254
254
  "Content-Type": "application/json"
255
255
  },
256
- body: JSON.stringify(t)
256
+ body: JSON.stringify(e)
257
257
  }).then((i) => i.json()).catch((i) => {
258
258
  console.error("Error:", i);
259
259
  });
260
260
  };
261
261
  };
262
- function P(e) {
263
- return e[0].toUpperCase() + e.substring(1);
262
+ function T(t) {
263
+ return t[0].toUpperCase() + t.substring(1);
264
264
  }
265
- const x = {
265
+ const O = {
266
266
  emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
267
267
  props: {
268
268
  /**
@@ -281,13 +281,10 @@ const x = {
281
281
  },
282
282
  inject: ["showGlobalSettings", "showOpenMapButton"],
283
283
  computed: {
284
- ...H(C, M, I),
284
+ ...N(C, I, A),
285
285
  idNamePair() {
286
286
  return this.splitFlowStore.idNamePair;
287
287
  },
288
- syncMode() {
289
- return this.splitFlowStore.syncMode;
290
- },
291
288
  useHelpModeDialog() {
292
289
  return this.settingsStore.useHelpModeDialog;
293
290
  },
@@ -312,27 +309,25 @@ const x = {
312
309
  onConnectivityItemClose() {
313
310
  if (this != null && this.alive) {
314
311
  if (this.multiflatmapRef) {
315
- const e = this.multiflatmapRef.getCurrentFlatmap();
316
- e && e.closeTooltip();
312
+ const t = this.multiflatmapRef.getCurrentFlatmap();
313
+ t && t.closeTooltip();
317
314
  }
318
315
  this.flatmapRef && this.flatmapRef.closeTooltip();
319
316
  }
320
317
  },
321
- toggleSyncMode: function() {
322
- },
323
318
  getState: function() {
324
319
  },
325
- openMap: function(e) {
326
- e === "SYNC" ? (this.toggleSyncMode(), this.trackOpenMap("toggle_map_sync_mode")) : (h.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`));
320
+ openMap: function(t) {
321
+ h.emit("OpenNewMap", t), this.trackOpenMap(`open_new_${t}_map`);
327
322
  },
328
- onMapmanagerLoaded: function(e) {
329
- this.settingsStore.updateMapManager(e);
323
+ onMapmanagerLoaded: function(t) {
324
+ this.settingsStore.updateMapManager(t);
330
325
  },
331
- trackOpenMap: function(e) {
332
- A.sendEvent({
326
+ trackOpenMap: function(t) {
327
+ M.sendEvent({
333
328
  event: "interaction_event",
334
329
  event_name: "portal_maps_open_map",
335
- category: e,
330
+ category: t,
336
331
  location: "open_new_map"
337
332
  });
338
333
  },
@@ -352,9 +347,9 @@ const x = {
352
347
  /**
353
348
  * Callback when the vuers emit a selected event.
354
349
  */
355
- resourceSelected: function(e, t) {
350
+ resourceSelected: function(t, e) {
356
351
  var a, r, l, c;
357
- const i = t[0];
352
+ const i = e[0];
358
353
  if (this.resourceHasAction(i)) {
359
354
  h.emit("PopoverActionClick", i);
360
355
  return;
@@ -362,13 +357,13 @@ const x = {
362
357
  let n, s = !1;
363
358
  const o = {
364
359
  paneIndex: this.entry.id,
365
- type: e,
366
- resource: t,
360
+ type: t,
361
+ resource: e,
367
362
  internalName: void 0,
368
363
  eventType: void 0
369
364
  };
370
- if (e == "MultiFlatmap" || e == "Flatmap")
371
- if (o.internalName = (a = i == null ? void 0 : i.feature) != null && a.label ? i.feature.label : this.idNamePair[i.feature.models], i.eventType == "click")
365
+ if (t == "MultiFlatmap" || t == "Flatmap")
366
+ if (o.internalName = (a = i == null ? void 0 : i.feature) != null && a.label ? i.feature.label : this.idNamePair[i.feature.models], i.eventType == "click") {
372
367
  if (o.eventType = "selected", i.feature.type == "marker") {
373
368
  let f = o.internalName;
374
369
  if (this.settingsStore.isFeaturedMarkerIdentifier(i.feature.id))
@@ -393,19 +388,19 @@ const x = {
393
388
  labels: [...u]
394
389
  });
395
390
  }
396
- s = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
397
- } else i.feature.type == "feature" && this.syncMode && (s = !0);
398
- else i.eventType == "mouseenter" && (o.eventType = "highlighted", s = !0);
399
- else e == "Scaffold" && (i && ((((r = i.data) == null ? void 0 : r.id) === void 0 || ((l = i.data) == null ? void 0 : l.id) === "") && (i.data.id = (c = i.data) == null ? void 0 : c.group), o.internalName = i.data.id, i.data.lastActionOnMarker === !0 && (n = {
391
+ s = !0, t == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
392
+ }
393
+ } else i.eventType == "mouseenter" && (o.eventType = "highlighted", s = !0);
394
+ else t == "Scaffold" && (i && ((((r = i.data) == null ? void 0 : r.id) === void 0 || ((l = i.data) == null ? void 0 : l.id) === "") && (i.data.id = (c = i.data) == null ? void 0 : c.group), o.internalName = i.data.id, i.data.lastActionOnMarker === !0 && (n = {
400
395
  type: "Facet",
401
- facet: P(i.data.id),
396
+ facet: T(i.data.id),
402
397
  facetPropPath: "anatomy.organ.category.name",
403
398
  term: "Anatomical structure"
404
399
  })), o.eventType = "selected", s = !0);
405
400
  n && h.emit("PopoverActionClick", n), s && this.$emit("resource-selected", o);
406
401
  },
407
- resourceHasAction: function(e) {
408
- return e && (e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets");
402
+ resourceHasAction: function(t) {
403
+ return t && (t.type === "URL" || t.type === "Search" || t.type === "Neuron Search" || t.type == "Facet" || t.type == "Facets");
409
404
  },
410
405
  /**
411
406
  * Check if this viewer is currently visible
@@ -420,39 +415,39 @@ const x = {
420
415
  * if it cannot be found in the map, it will perform several
421
416
  * calls to try to ge a valid name/id.
422
417
  */
423
- getNameAndIdFromSyncData: async function(e) {
424
- let t = e.internalName;
425
- t === void 0 && e.resource && (t = e.resource.label);
418
+ getNameAndIdFromSyncData: async function(t) {
419
+ let e = t.internalName;
420
+ e === void 0 && t.resource && (e = t.resource.label);
426
421
  let i;
427
- if (e.resource && e.resource.resource && (i = e.resource.resource[0]), this.entry.type === "Scaffold") {
428
- if (this.$refs.scaffold.findObjectsWithGroupName(t).length === 0) {
429
- if (e.resource && e.resource.feature) {
430
- const o = S(e.resource.feature.models);
422
+ if (t.resource && t.resource.resource && (i = t.resource.resource[0]), this.entry.type === "Scaffold") {
423
+ if (this.$refs.scaffold.findObjectsWithGroupName(e).length === 0) {
424
+ if (t.resource && t.resource.feature) {
425
+ const o = S(t.resource.feature.models);
431
426
  if (o.length > 0) return o;
432
427
  }
433
- let s = N(t);
428
+ let s = $(e);
434
429
  if (s)
435
430
  return s;
436
- if (i && e.eventType === "selected")
431
+ if (i && t.eventType === "selected")
437
432
  return fetch(`${this.apiLocation}get-related-terms/${i}`).then((o) => o.json()).then((o) => {
438
433
  var a;
439
434
  if (((a = o.uberon) == null ? void 0 : a.array.length) > 0)
440
- return t = o.uberon.array[0].name.charAt(0).toUpperCase() + o.uberon.array[0].name.slice(1), i = o.uberon.array[0].id.toUpperCase(), { id: i, name: t };
435
+ return e = o.uberon.array[0].name.charAt(0).toUpperCase() + o.uberon.array[0].name.slice(1), i = o.uberon.array[0].id.toUpperCase(), { id: i, name: e };
441
436
  });
442
437
  }
443
438
  } else if (this.entry.type === "MultiFlatmap")
444
- if (t === "Bladder")
445
- t = "Urinary Bladder";
439
+ if (e === "Bladder")
440
+ e = "Urinary Bladder";
446
441
  else {
447
- const n = S(t);
448
- n.length > 0 && (t = n[0]);
442
+ const n = S(e);
443
+ n.length > 0 && (e = n[0]);
449
444
  }
450
- return { id: i, name: t };
445
+ return { id: i, name: e };
451
446
  },
452
447
  // Get the species and andaotmy info for the featured datasets
453
- getDatasetAnatomyInfo: function(e) {
454
- fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((t) => t.json()).then((t) => {
455
- const i = t.result[0];
448
+ getDatasetAnatomyInfo: function(t) {
449
+ fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${t}`).then((e) => e.json()).then((e) => {
450
+ const i = e.result[0];
456
451
  let n;
457
452
  try {
458
453
  n = i.anatomy.organ[0].curie;
@@ -476,7 +471,7 @@ const x = {
476
471
  o = void 0;
477
472
  }
478
473
  this.settingsStore.updateFeaturedMarker({
479
- identifier: e,
474
+ identifier: t,
480
475
  marker: n,
481
476
  doi: s,
482
477
  species: o
@@ -485,51 +480,32 @@ const x = {
485
480
  },
486
481
  // Check if the old featured dataset api has any info
487
482
  oldFeaturedDatasetApiHasInfo: async function() {
488
- let t = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
489
- return !t.identifiers || t.identifiers.length == 0 ? !1 : t.identifiers;
483
+ let e = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
484
+ return !e.identifiers || e.identifiers.length == 0 ? !1 : e.identifiers;
490
485
  },
491
486
  // Check if the new featured dataset api has any info
492
487
  newFeaturedDatasetApiHasInfo: async function() {
493
- let t = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
494
- return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((i) => i.id);
488
+ let e = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
489
+ return !e.datasets || e.datasets.length == 0 ? !1 : e.datasets.map((i) => i.id);
495
490
  },
496
491
  /**
497
492
  * Get a list of featured datasets to display.
498
493
  */
499
494
  getFeaturedDatasets: async function() {
500
- let e = [], t = await this.oldFeaturedDatasetApiHasInfo();
501
- if (t) e = t;
495
+ let t = [], e = await this.oldFeaturedDatasetApiHasInfo();
496
+ if (e) t = e;
502
497
  else {
503
498
  let i = await this.newFeaturedDatasetApiHasInfo();
504
- i && (e = i);
499
+ i && (t = i);
505
500
  }
506
- this.settingsStore.updateFeatured(e), e.forEach((i) => {
501
+ this.settingsStore.updateFeatured(t), t.forEach((i) => {
507
502
  this.getDatasetAnatomyInfo(i);
508
503
  });
509
504
  },
510
505
  zoomToFeatures: function() {
511
506
  },
512
- handleSyncMouseEvent: async function(e) {
513
- let t = await this.getNameAndIdFromSyncData(e);
514
- e.eventType === "highlighted" ? this.highlightFeatures(t) : e.eventType === "selected" && this.displayTooltip(t);
515
- },
516
- /**
517
- * Handle sync pan zoom event
518
- */
519
- handleSyncPanZoomEvent: function() {
520
- },
521
507
  highlightFeatures: function() {
522
508
  },
523
- receiveSynchronisedEvent: async function(e) {
524
- if (e.paneIndex !== this.entry.id)
525
- e.eventType == "panZoom" || this.handleSyncMouseEvent(e);
526
- else if (e.eventType == "selected") {
527
- let t = await this.getNameAndIdFromSyncData(e);
528
- this.zoomToFeatures(t, !1);
529
- }
530
- },
531
- requestSynchronisedEvent: function() {
532
- },
533
509
  flatmapMarkerUpdate() {
534
510
  },
535
511
  onResize: function() {
@@ -547,8 +523,8 @@ const x = {
547
523
  onHelpModeShowNext: function() {
548
524
  this.helpModeActiveItem += 1;
549
525
  },
550
- onHelpModeLastItem: function(e) {
551
- e && (this.helpModeLastItem = !0);
526
+ onHelpModeLastItem: function(t) {
527
+ t && (this.helpModeLastItem = !0);
552
528
  },
553
529
  onFinishHelpMode: function() {
554
530
  this.helpMode = !1, this.helpModeActiveItem = 0, this.helpModeLastItem = !1;
@@ -562,28 +538,28 @@ const x = {
562
538
  /**
563
539
  * End help-mode only if user clicks outside of help mode dialog.
564
540
  */
565
- checkEndHelpMouseDown: function(e) {
566
- e.target.closest(".help-mode-dialog") || this.endHelp();
541
+ checkEndHelpMouseDown: function(t) {
542
+ t.target.closest(".help-mode-dialog") || this.endHelp();
567
543
  },
568
- flatmapHighlight: async function(e, t, i, n) {
569
- let s = [...t, ...n];
544
+ flatmapHighlight: async function(t, e, i, n) {
545
+ let s = [...e, ...n];
570
546
  const o = this.settingsStore.globalSettings;
571
547
  if (o.highlightConnectedPaths) {
572
- const a = t.length ? t : n.length ? n : [], r = await e.retrieveConnectedPaths(a);
548
+ const a = e.length ? e : n.length ? n : [], r = await t.retrieveConnectedPaths(a);
573
549
  r && s.push(...r);
574
550
  }
575
551
  if (o.highlightDOIPaths) {
576
- const a = await e.searchConnectivitiesByReference(i);
552
+ const a = await t.searchConnectivitiesByReference(i);
577
553
  a && s.push(...a);
578
554
  }
579
555
  return s = [...new Set(s)], s;
580
556
  },
581
- sidebarHoverHighlight: function(e) {
582
- var t, i;
557
+ sidebarHoverHighlight: function(t) {
558
+ var e, i;
583
559
  if (this.visible && ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady || this.scaffoldRef && this.scaffoldLoaded)) {
584
560
  const n = this.settingsStore.hoverAnatomies, s = this.settingsStore.hoverOrgans, o = this.settingsStore.hoverDOI, a = this.settingsStore.hoverConnectivity;
585
561
  let r = null, l = null;
586
- this.flatmapRef && (r = this.flatmapRef), this.multiflatmapRef && (r = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (l = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !s.length && !o && !a.length && ((this.multiflatmapRef || this.flatmapRef) && r ? ((t = r.mapImp) == null || t.clearSearchResults(), e.connectivitySearch && ((i = r.mapImp) == null || i.setPaint({ dimmed: !0 }))) : this.scaffoldRef && l && l.changeHighlightedByName(s, "", !1)), this.highlightDelay = setTimeout(() => {
562
+ this.flatmapRef && (r = this.flatmapRef), this.multiflatmapRef && (r = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (l = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !s.length && !o && !a.length && ((this.multiflatmapRef || this.flatmapRef) && r ? ((e = r.mapImp) == null || e.clearSearchResults(), t.connectivityProcessed && ((i = r.mapImp) == null || i.setPaint({ dimmed: !0 }))) : this.scaffoldRef && l && l.changeHighlightedByName(s, "", !1)), this.highlightDelay = setTimeout(() => {
587
563
  (n.length || s.length || o || a.length) && ((this.multiflatmapRef || this.flatmapRef) && r ? this.flatmapHighlight(r, n, o, a).then((c) => {
588
564
  try {
589
565
  r.showConnectivityTooltips({
@@ -604,38 +580,40 @@ const x = {
604
580
  }, 100);
605
581
  }
606
582
  },
607
- onAnnotationOpen: function(e) {
608
- h.emit("annotation-open", e);
583
+ onAnnotationOpen: function(t) {
584
+ h.emit("annotation-open", t);
609
585
  },
610
586
  onAnnotationClose: function() {
611
587
  h.emit("sidebar-annotation-close");
612
588
  },
613
- updateOfflineAnnotationEnabled: function(e) {
614
- h.emit("update-offline-annotation-enabled", e);
589
+ updateOfflineAnnotationEnabled: function(t) {
590
+ h.emit("update-offline-annotation-enabled", t);
615
591
  },
616
- onConnectivityInfoOpen: function(e) {
617
- h.emit("connectivity-info-open", e);
592
+ onConnectivityInfoOpen: function(t) {
593
+ h.emit("connectivity-info-open", t);
618
594
  },
619
- onConnectivityError: function(e) {
620
- h.emit("connectivity-error", e);
595
+ onConnectivityError: function(t) {
596
+ h.emit("connectivity-error", t);
621
597
  },
622
598
  onConnectivityInfoClose: function() {
623
599
  h.emit("connectivity-info-close");
624
600
  },
625
601
  onSidebarAnnotationClose: function() {
626
602
  },
627
- showConnectivity: function(e) {
603
+ showConnectivity: function() {
604
+ },
605
+ showConnectivitiesByReference: function() {
628
606
  },
629
- showConnectivitiesByReference: function(e) {
607
+ showConnectivityTooltips: function() {
630
608
  },
631
- showConnectivityTooltips: function(e) {
609
+ changeConnectivitySource: function() {
632
610
  },
633
- changeConnectivitySource: function(e) {
611
+ setVisibilityFilter: function() {
634
612
  },
635
- loadConnectivityExplorerConfig: async function(e) {
636
- const t = e.mapImp, i = T(t), n = F(new L());
613
+ loadConnectivityExplorerConfig: async function(t) {
614
+ const e = t.mapImp, i = H(e), n = F(new P());
637
615
  n.initialise(this.flatmapAPI);
638
- const s = await $(t, n), o = t.uuid, a = t.pathways;
616
+ const s = await L(e, n), o = e.uuid, a = e.pathways;
639
617
  if (this.connectivityKnowledge[i] || (this.connectivityKnowledge[i] = s.filter((r) => {
640
618
  var l;
641
619
  return r.source === i && ((l = r.connectivity) == null ? void 0 : l.length);
@@ -643,7 +621,7 @@ const x = {
643
621
  const r = a ? a.paths : {};
644
622
  this.connectivityKnowledge[o] = this.connectivityKnowledge[i].filter((l) => l.id in r);
645
623
  }
646
- this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), this.connectivityFilterOptions[o] || (this.connectivityFilterOptions[o] = await e.getFilterOptions()), this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivityFilterSources[o] || (this.connectivityFilterSources[o] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources), h.emit("species-layout-connectivity-update");
624
+ this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), this.connectivityFilterOptions[o] || (this.connectivityFilterOptions[o] = await t.getFilterOptions()), this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivityFilterSources[o] || (this.connectivityFilterSources[o] = t.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources), h.emit("species-layout-connectivity-update");
647
625
  }
648
626
  },
649
627
  data: function() {
@@ -676,11 +654,11 @@ const x = {
676
654
  this.flatmapAPI = void 0, this.apiLocation = void 0, this.settingsStore.flatmapAPI && (this.flatmapAPI = this.settingsStore.flatmapAPI), this.settingsStore.sparcApi && (this.apiLocation = this.settingsStore.sparcApi), this.settingsStore.mapManager && (this.mapManager = this.settingsStore.mapManager);
677
655
  },
678
656
  watch: {
679
- helpMode: function(e) {
680
- e || (this.helpModeActiveItem = 0);
657
+ helpMode: function(t) {
658
+ t || (this.helpModeActiveItem = 0);
681
659
  }
682
660
  }
683
661
  };
684
662
  export {
685
- x as C
663
+ O as C
686
664
  };