@abi-software/flatmapvuer 1.12.0-beta.1 → 1.12.0
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/flatmapvuer.js +74 -51
- package/dist/flatmapvuer.umd.cjs +5 -3
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/FlatmapVuer.vue +29 -23
- package/src/components/MultiFlatmapVuer.vue +37 -3
package/dist/flatmapvuer.js
CHANGED
|
@@ -9610,22 +9610,24 @@ const Ii = new Lb(), Rb = "cannot be found on the map.", Fb = (e) => {
|
|
|
9610
9610
|
});
|
|
9611
9611
|
} else {
|
|
9612
9612
|
const a = o.join();
|
|
9613
|
-
this.connectionType.toLowerCase() === "all"
|
|
9613
|
+
this.connectionType.toLowerCase() === "all" ? this.$emit("neuron-connection-feature-click", {
|
|
9614
9614
|
filters: [],
|
|
9615
9615
|
search: a
|
|
9616
|
-
});
|
|
9617
|
-
}
|
|
9618
|
-
} else {
|
|
9619
|
-
Tb(this.mapImp, this.flatmapQueries);
|
|
9620
|
-
let o = [];
|
|
9621
|
-
if (this.tooltipEntry = e.filter((i) => i.resource[0] in this.mapImp.pathways.paths).map((i) => ({ title: i.label, featureId: i.resource, ready: !1 })), this.tooltipEntry.length) {
|
|
9622
|
-
this.$emit("connectivity-info-open", this.tooltipEntry);
|
|
9623
|
-
for (let a = 0; a < e.length; a++)
|
|
9624
|
-
o.push(await this.getKnowledgeTooltip(e[a]));
|
|
9625
|
-
this.tooltipEntry = await Promise.all(o);
|
|
9626
|
-
const i = this.tooltipEntry.map((a) => a.featureId[0]);
|
|
9627
|
-
i.length > 0 && this.displayTooltip(i);
|
|
9616
|
+
}) : await this.openConnectivityInfo(e);
|
|
9628
9617
|
}
|
|
9618
|
+
} else
|
|
9619
|
+
await this.openConnectivityInfo(e);
|
|
9620
|
+
},
|
|
9621
|
+
openConnectivityInfo: async function(e) {
|
|
9622
|
+
Tb(this.mapImp, this.flatmapQueries);
|
|
9623
|
+
let t = [];
|
|
9624
|
+
if (this.tooltipEntry = e.filter((n) => n.resource[0] in this.mapImp.pathways.paths).map((n) => ({ title: n.label, featureId: n.resource, ready: !1 })), this.tooltipEntry.length) {
|
|
9625
|
+
this.$emit("connectivity-info-open", this.tooltipEntry);
|
|
9626
|
+
for (let o = 0; o < e.length; o++)
|
|
9627
|
+
t.push(await this.getKnowledgeTooltip(e[o]));
|
|
9628
|
+
this.tooltipEntry = await Promise.all(t);
|
|
9629
|
+
const n = this.tooltipEntry.map((o) => o.featureId[0]);
|
|
9630
|
+
n.length > 0 && this.displayTooltip(n);
|
|
9629
9631
|
}
|
|
9630
9632
|
},
|
|
9631
9633
|
/**
|
|
@@ -11313,7 +11315,7 @@ function Gb(e, t, n, o, i, a) {
|
|
|
11313
11315
|
[B, e.loading]
|
|
11314
11316
|
]);
|
|
11315
11317
|
}
|
|
11316
|
-
const wl = /* @__PURE__ */ Kt($b, [["render", Gb], ["__scopeId", "data-v-
|
|
11318
|
+
const wl = /* @__PURE__ */ Kt($b, [["render", Gb], ["__scopeId", "data-v-b1c18844"]]), Or = {
|
|
11317
11319
|
"NCBITaxon:10114": "01fedbf9-d783-509c-a10c-827941ab13da",
|
|
11318
11320
|
"NCBITaxon:9823": "a336ac04-24db-561f-a25f-1c994fe17410",
|
|
11319
11321
|
"NCBITaxon:9606": "42ed6323-f645-5fbe-bada-9581819cf689",
|
|
@@ -11347,48 +11349,69 @@ const wl = /* @__PURE__ */ Kt($b, [["render", Gb], ["__scopeId", "data-v-ba0755e
|
|
|
11347
11349
|
*/
|
|
11348
11350
|
initialise: function() {
|
|
11349
11351
|
return this.multiflatmapError = null, new Promise((e) => {
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11352
|
+
if (this.requireInitialisation) {
|
|
11353
|
+
this.requireInitialisation = !1;
|
|
11354
|
+
const t = new AbortController(), n = t.signal, o = setTimeout(() => t.abort(), 5e3);
|
|
11355
|
+
fetch(this.flatmapAPI, { signal: n }).then((i) => {
|
|
11356
|
+
if (!i.ok) {
|
|
11357
|
+
if (i.status === 404)
|
|
11358
|
+
return this.multiflatmapError = {}, this.multiflatmapError.title = "MultiFlatmap Error!", this.multiflatmapError.messages = [
|
|
11359
|
+
`Sorry, the component could not be loaded because the specified
|
|
11360
|
+
flatmap API endpoint is incorrect. Please check the endpoint URL
|
|
11361
|
+
or contact support if the problem persists.`
|
|
11362
|
+
], this.initialised = !0, e(), this.resolveList.forEach((a) => a()), Promise.reject({ handled: !0 });
|
|
11363
|
+
throw new Error(`HTTP ${i.status}: ${i.statusText}`);
|
|
11364
|
+
}
|
|
11365
|
+
return i.json();
|
|
11366
|
+
}).then((i) => {
|
|
11367
|
+
if (i && i.status_code === 404) {
|
|
11368
|
+
console.error("Flatmap API endpoint is incorrect", i), this.multiflatmapError = {}, this.multiflatmapError.title = "MultiFlatmap Error!", this.multiflatmapError.messages = [
|
|
11369
|
+
`Sorry, the component could not be loaded because the specified
|
|
11353
11370
|
flatmap API endpoint is incorrect. Please check the endpoint URL
|
|
11354
11371
|
or contact support if the problem persists.`
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11372
|
+
], this.initialised = !0, e(), this.resolveList.forEach((r) => r());
|
|
11373
|
+
return;
|
|
11374
|
+
}
|
|
11375
|
+
Object.keys(this.availableSpecies).forEach((r) => {
|
|
11376
|
+
const s = this.availableSpecies[r].uuid;
|
|
11377
|
+
if (s && i.length && i.map((l) => l.uuid).indexOf(s) > 0)
|
|
11378
|
+
this.speciesList[r] = this.availableSpecies[r];
|
|
11379
|
+
else
|
|
11380
|
+
for (let l = 0; l < i.length; l++)
|
|
11381
|
+
if (this.availableSpecies[r].taxo === i[l].taxon)
|
|
11382
|
+
if (this.availableSpecies[r].biologicalSex) {
|
|
11383
|
+
if (i[l].biologicalSex && i[l].biologicalSex === this.availableSpecies[r].biologicalSex) {
|
|
11384
|
+
this.speciesList[r] = this.availableSpecies[r];
|
|
11385
|
+
break;
|
|
11386
|
+
}
|
|
11387
|
+
} else {
|
|
11388
|
+
this.speciesList[r] = this.availableSpecies[r];
|
|
11365
11389
|
break;
|
|
11366
11390
|
}
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11373
|
-
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
});
|
|
11384
|
-
}).catch((t) => {
|
|
11385
|
-
console.error("Error fetching flatmap:", t), this.initialised = !0, this.multiflatmapError = {}, this.multiflatmapError.title = "MultiFlatmap Error!", this.multiflatmapError.messages = [
|
|
11386
|
-
`Sorry, the component could not be loaded due to an unexpected error.
|
|
11391
|
+
});
|
|
11392
|
+
let a = this.initial;
|
|
11393
|
+
if (this.state) {
|
|
11394
|
+
const r = this.state.state;
|
|
11395
|
+
(!r || !r.uuid && !r.entry) && this.state.species ? a = this.state.species : a = void 0;
|
|
11396
|
+
}
|
|
11397
|
+
a && (a && this.speciesList[a] !== void 0 ? this.activeSpecies = a : this.activeSpecies = Object.keys(this.speciesList)[0], this.setSpecies(
|
|
11398
|
+
this.activeSpecies,
|
|
11399
|
+
this.state ? this.state.state : void 0,
|
|
11400
|
+
5
|
|
11401
|
+
)), this.initialised = !0, e(), this.resolveList.forEach((r) => {
|
|
11402
|
+
r();
|
|
11403
|
+
});
|
|
11404
|
+
}).catch((i) => {
|
|
11405
|
+
i && i.handled || (console.error("Error fetching flatmap:", i), this.initialised = !0, this.multiflatmapError = {}, this.multiflatmapError.title = "MultiFlatmap Error!", this.multiflatmapError.messages = [
|
|
11406
|
+
`Sorry, the component could not be loaded due to an unexpected error.
|
|
11387
11407
|
Please try again later or contact support if the problem persists.`
|
|
11388
|
-
|
|
11389
|
-
|
|
11408
|
+
], e(), this.resolveList.forEach((a) => {
|
|
11409
|
+
a();
|
|
11410
|
+
}));
|
|
11411
|
+
}).finally(() => {
|
|
11412
|
+
clearTimeout(o);
|
|
11390
11413
|
});
|
|
11391
|
-
}
|
|
11414
|
+
} else this.initialised ? e() : this.resolveList.push(e);
|
|
11392
11415
|
});
|
|
11393
11416
|
},
|
|
11394
11417
|
/**
|
|
@@ -12038,7 +12061,7 @@ function Xb(e, t, n, o, i, a) {
|
|
|
12038
12061
|
}, null, 8, ["flatmapError"])) : V("", !0)
|
|
12039
12062
|
], 512);
|
|
12040
12063
|
}
|
|
12041
|
-
const r0 = /* @__PURE__ */ Kt(Jb, [["render", Xb], ["__scopeId", "data-v-
|
|
12064
|
+
const r0 = /* @__PURE__ */ Kt(Jb, [["render", Xb], ["__scopeId", "data-v-1a5d097a"]]);
|
|
12042
12065
|
export {
|
|
12043
12066
|
wl as FlatmapVuer,
|
|
12044
12067
|
r0 as MultiFlatmapVuer
|
package/dist/flatmapvuer.umd.cjs
CHANGED
|
@@ -21,7 +21,9 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:i,curr
|
|
|
21
21
|
where source="${ui(e)}" and
|
|
22
22
|
knowledge like "%${t}%" order by source desc`;return(await o.queryKnowledge(r)).map(c=>JSON.parse(c)).map(c=>c.id)}function ui(e){return By(e.mapMetadata)}function By(e){let t="";if(e!=null&&e.connectivity){const o=e.connectivity;"knowledge-source"in o?t=o["knowledge-source"]:"npo"in o&&(t=`${o.npo.release}-npo`)}return t}async function Ny(e,t){const o=ui(e),i=`select knowledge from knowledge
|
|
23
23
|
where source="${o}"
|
|
24
|
-
order by source desc`;ms();const r=sessionStorage.getItem("flatmap-knowledge"),a=sessionStorage.getItem("flatmap-knowledge-source");if(!r||a!==o){const l=(await t.queryKnowledge(i)).map(c=>JSON.parse(c));return sessionStorage.setItem("flatmap-knowledge",JSON.stringify(l)),sessionStorage.setItem("flatmap-knowledge-source",o),_y(),l}return JSON.parse(r)}function _y(){const o=new Date().getTime()+864e5;sessionStorage.setItem("flatmap-knowledge-expiry",o)}function Py(){["flatmap-knowledge","flatmap-knowledge-expiry","flatmap-knowledge-source"].forEach(t=>{sessionStorage.removeItem(t)})}function ms(){const e=sessionStorage.getItem("flatmap-knowledge-expiry");new Date().getTime()>e&&Py()}const Gn=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),Ly='<svg width="195px" height="24px" viewBox="0 0 200 24" fill="yellow"><path d="M22.0748 3.25583C22.4141 2.42845 23.5859 2.42845 23.9252 3.25583L25.6493 7.45955C25.793 7.80979 26.1221 8.04889 26.4995 8.07727L31.0303 8.41798C31.922 8.48504 32.2841 9.59942 31.6021 10.1778L28.1369 13.1166C27.8482 13.3614 27.7225 13.7483 27.8122 14.1161L28.8882 18.5304C29.1 19.3992 28.152 20.0879 27.3912 19.618L23.5255 17.2305C23.2034 17.0316 22.7966 17.0316 22.4745 17.2305L18.60881 19.618C17.84796 20.0879 16.9 19.3992 17.1118 18.5304L18.18785 14.1161C18.2775 13.7483 18.1518 13.3614 17.86309 13.1166L14.3979 10.1778C13.71588 9.59942 14.07796 8.48504 14.96971 8.41798L19.50046 8.07727C19.87794 8.04889 20.20704 7.80979 20.35068 7.45955L22.0748 3.25583Z" stroke="#000000" stroke-width="2"/><text x="47" y="52%" style="white-space: pre" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#333333">Featured dataset marker</text></svg>';var gs={exports:{}};(function(e,t){(function(o,i){e.exports=i()})(typeof window<"u"?window:mm,function(){if(typeof window>"u")return null;var o=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),i=o.requestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||function(f){return o.setTimeout(f,20)},r=o.cancelAnimationFrame||o.mozCancelAnimationFrame||o.webkitCancelAnimationFrame||function(f){o.clearTimeout(f)};function a(f,u){var p=Object.prototype.toString.call(f),g=p==="[object Array]"||p==="[object NodeList]"||p==="[object HTMLCollection]"||p==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,h=0,m=f.length;if(g)for(;h<m;h++)u(f[h]);else u(f)}function s(f){if(!f.getBoundingClientRect)return{width:f.offsetWidth,height:f.offsetHeight};var u=f.getBoundingClientRect();return{width:Math.round(u.width),height:Math.round(u.height)}}function l(f,u){Object.keys(u).forEach(function(p){f.style[p]=u[p]})}var c=function(f,u){var p=0;function g(){var m=[];this.add=function(C){m.push(C)};var y,b;this.call=function(C){for(y=0,b=m.length;y<b;y++)m[y].call(this,C)},this.remove=function(C){var I=[];for(y=0,b=m.length;y<b;y++)m[y]!==C&&I.push(m[y]);m=I},this.length=function(){return m.length}}function h(m,y){if(m){if(m.resizedAttached){m.resizedAttached.add(y);return}m.resizedAttached=new g,m.resizedAttached.add(y),m.resizeSensor=document.createElement("div"),m.resizeSensor.dir="ltr",m.resizeSensor.className="resize-sensor";var b={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},C={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(m.resizeSensor,b);var I=document.createElement("div");I.className="resize-sensor-expand",l(I,b);var k=document.createElement("div");l(k,C),I.appendChild(k);var v=document.createElement("div");v.className="resize-sensor-shrink",l(v,b);var S=document.createElement("div");l(S,C),l(S,{width:"200%",height:"200%"}),v.appendChild(S),m.resizeSensor.appendChild(I),m.resizeSensor.appendChild(v),m.appendChild(m.resizeSensor);var E=window.getComputedStyle(m),O=E?E.getPropertyValue("position"):null;O!=="absolute"&&O!=="relative"&&O!=="fixed"&&O!=="sticky"&&(m.style.position="relative");var M=!1,N=0,B=s(m),T=0,P=0,q=!0;p=0;var V=function(){var Z=m.offsetWidth,ce=m.offsetHeight;k.style.width=Z+10+"px",k.style.height=ce+10+"px",I.scrollLeft=Z+10,I.scrollTop=ce+10,v.scrollLeft=Z+10,v.scrollTop=ce+10},x=function(){if(q){var Z=m.offsetWidth===0&&m.offsetHeight===0;if(Z){p||(p=i(function(){p=0,x()}));return}else q=!1}V()};m.resizeSensor.resetSensor=x;var $=function(){N=0,M&&(T=B.width,P=B.height,m.resizedAttached&&m.resizedAttached.call(B))},pe=function(){B=s(m),M=B.width!==T||B.height!==P,M&&!N&&(N=i($)),x()},Y=function(Z,ce,Ee){Z.attachEvent?Z.attachEvent("on"+ce,Ee):Z.addEventListener(ce,Ee)};Y(I,"scroll",pe),Y(v,"scroll",pe),p=i(function(){p=0,x()})}}a(f,function(m){h(m,u)}),this.detach=function(m){p||(r(p),p=0),c.detach(f,m)},this.reset=function(){f.resizeSensor.resetSensor()}};if(c.reset=function(f){a(f,function(u){u.resizeSensor.resetSensor()})},c.detach=function(f,u){a(f,function(p){p&&(p.resizedAttached&&typeof u=="function"&&(p.resizedAttached.remove(u),p.resizedAttached.length())||p.resizeSensor&&(p.contains(p.resizeSensor)&&p.removeChild(p.resizeSensor),delete p.resizeSensor,delete p.resizedAttached))})},typeof MutationObserver<"u"){var d=new MutationObserver(function(f){for(var u in f)if(f.hasOwnProperty(u))for(var p=f[u].addedNodes,g=0;g<p.length;g++)p[g].resizeSensor&&c.reset(p[g])});document.addEventListener("DOMContentLoaded",function(f){d.observe(document.body,{childList:!0,subtree:!0})})}return c})})(gs);var Vy=gs.exports;const Ry=gm(Vy),Fy=Ci.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}});function Dy(e){return{all:e=e||new Map,on:function(t,o){var i=e.get(t);i?i.push(o):e.set(t,[o])},off:function(t,o){var i=e.get(t);i&&(o?i.splice(i.indexOf(o)>>>0,1):e.set(t,[]))},emit:function(t,o){var i=e.get(t);i&&i.slice().map(function(r){r(o)}),(i=e.get("*"))&&i.slice().map(function(r){r(t,o)})}}}const pi=new Dy,$y="cannot be found on the map.",zy=e=>{let t={lng:0,lat:0},o;return e.type==="Polygon"?e.coordinates.length&&(o=e.coordinates[0]):o=e.coordinates,o&&(e.type!=="Point"?(o.map(i=>{t.lng+=parseFloat(i[0]),t.lat+=parseFloat(i[1])}),t.lng=t.lng/o.length,t.lat=t.lat/o.length):(t.lng+=parseFloat(o[0]),t.lat+=parseFloat(o[1]))),t},ys=(e,t)=>{const o=[];let i=e.organs?e.organs:e.ftus;const r=i?i.filter((a,s)=>i.findIndex(l=>l.label===a.label)===s):void 0;return r&&r.forEach(a=>{const s={label:a.label,models:a.models,key:`${t}.${a.label}`},l=ys(a,s.key);l.length>0&&(s.children=l),o.push(s)}),o},jy={name:"FlatmapVuer",components:{Button:ei,Col:nn,Loading:Zg,Radio:ns,Icon:be,RadioGroup:os,Row:tn,Select:Un,Dialog:gg,MapSvgIcon:wi.MapSvgIcon,MapSvgSpriteColor:wi.MapSvgSpriteColor,Tooltip:Lt.Tooltip,TreeControls:Lt.TreeControls,SelectionsGroup:ps,SvgLegends:Ty,ElIconWarningFilled:W.WarningFilled,ElIconArrowDown:W.ArrowDown,ElIconArrowLeft:W.ArrowLeft,DrawToolbar:Lt.DrawToolbar,FlatmapError:li},beforeCreate:function(){this.setStateRequired=!1},setup(e){let t=n.inject("$annotator");return t||(t=n.markRaw(new Ts.AnnotationService(`${e.flatmapAPI}annotator`)),n.provide("$annotator",t)),{annotator:t}},methods:{enableFeatureResetOnClick:function(e){this.mapImp&&this.mapImp.enableFeatureResetOnClick(e)},setVisibilityFilter:function(e){this.mapImp&&(this.mapImp.contextLost?e?this.filterToRestore=n.markRaw(JSON.parse(JSON.stringify(e))):this.filterToRestore=void 0:(e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter(),this.filterToRestore=void 0))},manualAbortedOnClose:function(){this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEventCallback({},{type:"aborted"}),this.initialiseDrawing()},initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry=[{...this.drawnCreatedEvent.feature,resourceId:this.serverURL}],this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(e){if(this.mapImp)if(e){const t=Number(e);let i={feature:t?this.mapImp.featureProperties(t):{feature:this.existDrawnFeatures.find(r=>r.id===e.trim())}};this.checkAndCreatePopups([i],!1)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups([this.drawnCreatedEvent],!1),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry[0].feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(e,t){if(!this.isValidDrawnCreated){if(this.manualAbortedOnClose(),this.doubleClickedFeature=!1,this.changeAnnotationDrawMode({mode:"simple_select"}),e==="mode")this.activeDrawMode=t;else if(e==="tool"){if(this.cancelDrawnFeature(),t){const o=t.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${o}`})}this.activeDrawTool=t}}},annotationDrawModeEvent:function(e){this.activeDrawMode==="Edit"?this.doubleClickedFeature&&(e.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:e.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[e.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const e=Object.values(this.connectionEntry),t={type:"connectivity",source:e[0],target:e[e.length-1],intermediates:e.filter((o,i)=>i!==0&&i!==e.length-1)};this.annotationEntry[0].body=t}},changeAnnotationDrawMode:function(e){this.mapImp&&this.mapImp.changeAnnotationDrawMode(e)},clearAnnotationFeature:function(){this.mapImp&&this.mapImp.clearAnnotationFeature()},forceContextLoss:function(){this.mapImp&&!this.mapImp.contextLost&&!this.loading&&this.mapImp.forceContextLoss()},forceContextRestore:function(){this.mapImp&&(this.flatmapError=null,this.mapImp.forceContextRestore())},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&this.annotationEntry.length>0&&["created","updated","deleted"].includes(this.annotationEntry[0].type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry[0]),this.annotationEntry=[])},commitAnnotationEvent:function(e){this.mapImp&&(this.offlineAnnotationEnabled&&(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(e),this.annotationEntry[0].type==="deleted"&&(this.offlineAnnotations=this.offlineAnnotations.filter(t=>t.resource!==this.serverURL||t.item.id!==e.item.id)),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))),["created","updated","deleted"].includes(this.annotationEntry[0].type)&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry[0]),e.body.comment==="Position Updated"?this.annotationEntry[0].positionUpdated=!1:this.annotationEntry[0].type==="deleted"&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry=[]),this.addAnnotationFeature()))},fetchAnnotatedItemIds:async function(e=void 0,t=void 0){let o;return this.offlineAnnotationEnabled?(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],o=this.offlineAnnotations.filter(i=>i.resource===this.serverURL).map(i=>i.item.id)):(o=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,e,t),"resource"in o&&(o=o.itemIds)),o},setFeatureAnnotated:async function(){if(this.mapImp){const e=await this.fetchAnnotatedItemIds();for(const t of e)this.mapImp.setFeatureAnnotated(t)}},fetchDrawnFeatures:async function(e,t){let o;if(this.offlineAnnotationEnabled)this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],o=this.offlineAnnotations.filter(i=>i.feature&&i.resource===this.serverURL).map(i=>i.feature);else{const i=await this.fetchAnnotatedItemIds(e,t);o=await this.annotator.drawnFeatures(this.userToken,this.serverURL,i),"resource"in o&&(o=o.features)}return o},addAnnotationFeature:async function(){if(this.mapImp){this.featureAnnotationSubmitted||(this.clearAnnotationFeature(),this.loading=!0);const e=this.annotationFrom==="Anyone"?void 0:this.authorisedUser.orcid?this.authorisedUser.orcid:"0000-0000-0000-0000",t=this.annotationFrom==="Anyone"?void 0:this.annotationFrom==="Me",o=await this.fetchDrawnFeatures(e,t);if(this.existDrawnFeatures=o,this.loading=!1,!this.featureAnnotationSubmitted)for(const i of o)this.mapImp.addAnnotationFeature(i)}},showAnnotator:function(e){this.mapImp&&(this.mapImp.showAnnotator(e),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setAnnotationFrom:function(e){this.annotationFrom=e,this.mapImp&&(this.manualAbortedOnClose(),this.addAnnotationFeature())},emitOfflineAnnotationUpdate:function(){this.$emit("update-offline-annotation-enabled",this.offlineAnnotationEnabled)},setFlightPath3D:function(e){this.flightPath3DRadio=e,this.mapImp&&this.mapImp.enableFlightPaths(e)},viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(o=>{const i={colour:o.colour,enabled:o.enabled,label:o.id,key:o.id},r=ys(o,i.key);r.length>0&&(i.children=r),t.children.push(i)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,di(this.mapImp,e).then(o=>{o.length&&o.forEach(i=>{let r=!0;t&&(r=t.checkAll?!0:t.checked.includes(i.taxon)),this.taxonConnectivity.push({...i,enabled:r}),this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(i.taxon,r)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setPaint({coloured:e,outlined:this.outlinesRadio})},setOutlines:function(e){this.outlinesRadio=e,this.mapImp&&this.mapImp.setPaint({coloured:this.colourRadio,outlined:e})},setInitMapState:function(){if(this.mapImp){const e=this.mapImp.map,t=this.mapImp.options.bounds,o=[[t[0],t[1]],[t[2],t[3]]];e.setMaxBounds(null),e.setRenderWorldCopies(!1),this.initMapState=n.markRaw({initBounds:o})}},resetView:function(){if(this.mapImp){const e=this.mapImp.map,{initBounds:t}=this.initMapState;e.resetNorthPitch({animate:!1}),t&&e.fitBounds(t,{animate:!1}),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset()}},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},onSelectionsDataChanged:function(e){this.$emit("pathway-selection-changed",e)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},zoomToFeatures:function(e){this.mapImp&&this.mapImp.zoomToFeatures(e)},retrieveConnectedPaths:async function(e,t={}){var o,i,r,a,s;if(this.mapImp){let l=[],c=(o=t.target)!=null&&o.length?t.target:[];const d=[...this.mapImp.pathModelNodes(e)],f=await this.mapImp.queryPathsForFeatures(e);if(d.length){if(!c.length){const u=(i=t.type)!=null&&i.length?t.type:["all"],p=await this.flatmapQueries.queryForConnectivityNew(this.mapImp,e[0]),g=(r=p==null?void 0:p.ids)==null?void 0:r.dendrites.flat(1/0),h=(a=p==null?void 0:p.ids)==null?void 0:a.components.flat(1/0),m=(s=p==null?void 0:p.ids)==null?void 0:s.axons.flat(1/0);let y=[];u.includes("origins")&&y.push(...g),u.includes("components")&&y.push(...h),u.includes("destinations")&&y.push(...m),u.includes("all")&&y.push(...g,...h,...m),c=[...new Set(y)]}d.forEach(u=>{this.mapImp.nodePathModels(u).forEach(g=>{const m=this.mapImp.pathModelNodes(g).map(b=>this.mapImp.featureProperties(b).models);c.filter(b=>m.includes(b)).length&&!l.includes(g)&&l.push(g)})})}else f.length&&(c.length?f.forEach(u=>{const g=this.mapImp.pathModelNodes(u).map(m=>this.mapImp.featureProperties(m).models);c.filter(m=>g.includes(m)).length&&!l.includes(u)&&l.push(u)}):l=f);return l=[...new Set([...l,...e])],l}},resetMapFilter:function(){const e=this.mapFilters.alert;let t;const o={"tile-layer":"pathways"},i={NOT:o};e.with&&!e.without?t={OR:[i,{AND:[o,{HAS:"alert"}]}]}:!e.with&&e.without?t={OR:[i,{AND:[o,{NOT:{HAS:"alert"}}]}]}:!e.with&&!e.without&&(t=i),this.setVisibilityFilter(t)},alertMouseEnterEmitted:function(e){if(this.mapImp)if(e.value){let t;const o={"tile-layer":"pathways"},i={NOT:o};if(e.key==="alert"||e.key==="withoutAlert"){const r=e.key==="alert"?{HAS:"alert"}:{NOT:{HAS:"alert"}};t={OR:[i,{AND:[o,r]}]}}this.setVisibilityFilter(t)}else this.resetMapFilter()},alertSelected:function(e){this.mapImp&&(e.key==="alert"?e.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:e.key==="withoutAlert"&&(e.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(e){this.mapImp&&(e.value?(this.mapFilters.alert.without=!0,this.mapFilters.alert.with=!0):(this.mapFilters.alert.without=!1,this.mapFilters.alert.with=!1),this.resetMapFilter())},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},taxonMouseEnterEmitted:function(e){if(this.mapImp)if(e.value){clearTimeout(this.taxonLeaveDelay);let t=this.mapImp.taxonFeatureIds(e.key);this.mapImp.enableConnectivityByTaxonIds(e.key,e.value),this.mapImp.zoomToGeoJSONFeatures(t,{noZoomIn:!0})}else this.taxonLeaveDelay=setTimeout(()=>{this.mapImp.unselectGeoJSONFeatures(),e.selections.forEach(t=>{let o=e.checked.includes(t.taxon);this.mapImp.enableConnectivityByTaxonIds(t.taxon,o)})},1e3)},checkAllTaxons:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.keys,e.value)},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},annotationEventCallback:function(e,t){if(t.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent(),this.annotationEntry=[];else if(t.type==="modeChanged")t.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0),this.annotationSidebar&&t.feature.mode==="simple_select"&&this.activeDrawMode==="Deleted"&&this.annotationEventCallback({},{type:"aborted"});else if(t.type==="selectionChanged"){if(this.selectedDrawnFeature=t.feature.features.length===0?void 0:t.feature.features[0],e.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool)if(this.connectionEntry={},this.selectedDrawnFeature){const o=this.existDrawnFeatures.find(i=>i.id===this.selectedDrawnFeature.id);o&&o.connection&&(this.connectionEntry=o.connection),this.annotationDrawModeEvent(e)}else this.annotationSidebar&&this.previousEditEvent.type==="updated"&&(this.annotationEntry=[{...this.previousEditEvent,resourceId:this.serverURL}],this.annotationEventCallback({},{type:"aborted"})),this.previousEditEvent={}}else{if(t.type==="created"||t.type==="updated"){t.type==="updated"&&t.feature.action&&(t.positionUpdated=t.feature.action==="move");const o=this.mapImp.refreshAnnotationFeatureGeometry(t.feature);e.feature.feature=o}t.type==="created"?this.drawnCreatedEvent=e:this.checkAndCreatePopups([e])}t.type==="updated"&&(this.previousEditEvent=t),t.type==="deleted"?this.previousDeletedEvent=t:this.previousDeletedEvent={}},getTaxons:function(e){let t;return e.taxons&&(typeof e.taxons!="object"?t=JSON.parse(e.taxons):t=e.taxons),t},eventCallback:function(){return(e,t,...o)=>{if(e==="annotation"){const i={feature:t,userData:o,eventType:e};this.annotationEventCallback(i,t)}else if(e==="context-lost")this.onContextLost();else if(e==="context-restored")this.onContextRestored();else if(e==="pan-zoom")this.$emit("pan-zoom-callback",t);else{const i=t.label,r=[t.models],a=this.entry,s=this.biologicalSex,l=t.alert,c=this.getTaxons(t);let d=[{dataset:t.dataset,biologicalSex:s,taxonomy:a,resource:r,label:i,feature:t,userData:o,eventType:e,provenanceTaxonomy:c,alert:l}];if(e==="click"){const f=!t[0];if(!f){d=[];const p=t.mapUUID,g=new Set;for(let[h,m]of Object.entries(t))if(h!=="mapUUID"){const y=m.featureId,b=m.label,C=[m.models],I=this.getTaxons(m);if(g.has(y))continue;g.add(y),d.push({dataset:m.dataset,biologicalSex:s,taxonomy:a,resource:C,label:b,feature:m,userData:o,eventType:e,provenanceTaxonomy:I,alert:m.alert,mapUUID:p})}}const u=f?t:t[0];if(this.setConnectivityDataSource(this.viewingMode,u),this.viewingMode!=="Neuron Connection"){if(this.currentActive=u.models?u.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const p=u.featureId||this.existDrawnFeatures.find(g=>g.id===u.id);if(this.activeDrawTool==="LineString"&&p){const g=u.featureId?u.featureId:u.id,h=u.label?u.label:`Feature ${u.id}`;this.connectionEntry[` ${g}`]=Object.assign({label:h},Object.fromEntries(Object.entries(u).filter(([m])=>["featureId","models"].includes(m)).map(([m,y])=>[m==="featureId"?"id":m,y])))}}}t&&t.type!=="marker"&&!this.activeDrawTool&&this.checkAndCreatePopups(d)}else e==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=t.models?t.models:"");this.$emit("resource-selected",d)}}},setConnectivityDataSource:function(e,t){var o;e==="Exploration"?this.connectivityDataSource=(o=t.models)!=null&&o.startsWith("ilxtr:")?t.models:"":this.connectivityDataSource=t.featureId||t.id},changeViewingMode:function(e){e&&(this.viewingMode=e),this.manualAbortedOnClose()},removeActiveTooltips:function(){this.mapImp&&this.mapImp.removePopup(),this.$el.querySelectorAll(".flatmap-tooltip-popup").forEach(t=>t.remove())},createTooltipForConnectivity:function(e,t){const o=document.createElement("div");o.classList.add("flatmap-feature-label"),e.forEach((i,r)=>{const{label:a}=i;if(o.append(Gn(a)),r+1<e.length){const s=document.createElement("hr");o.appendChild(s)}}),this.mapImp.showPopup(t,o,{className:"custom-popup flatmap-tooltip-popup",positionAtLastClick:!1,preserveSelection:!0})},showConnectivityTooltips:function(e){const{connectivityInfo:t,data:o}=e,i=[],r=[],a=[],s=[];if(t&&t.featureId&&i.push(...t.featureId),this.mapImp){if(o.forEach(p=>{const g=this.mapImp.search(p.id);if(g!=null&&g.results.length){const h=g==null?void 0:g.results[0].featureId;a.push({featureId:h,...p})}else s.push(p)}),a.length){let p=a[0].featureId;this.mapImp.annotations.forEach(g=>{const h=g["anatomical-nodes"];if(h){const m=h.join("");a.every(b=>m.indexOf(b.id)!==-1)&&(p=g.featureId,r.push(p))}}),this.createTooltipForConnectivity(a,p)}else this.removeActiveTooltips();this.emitConnectivityError(s);const l=i.reduce((p,g)=>{const h=this.mapImp.pathways.paths[g],m=h?h.connectivity:null;if(m){const y=m.flat(1/0);p.push(...y)}return p},[]),c=[...new Set(l)],d=[...i,...c],u=[...this.mapImp.modelFeatureIdList(d),...r];this.mapImp.selectGeoJSONFeatures(u)}},showConnectivitiesByReference:function(e){this.searchConnectivitiesByReference(e).then(t=>{this.mapImp.selectFeatures(t)})},searchConnectivitiesByReference:async function(e){const t=sessionStorage.getItem("flatmap-knowledge");let o=[];return t?o=await xy(e):o=await My(this.mapImp,e,this.flatmapQueries),o},getFlatmapKnowledge:function(){let e=[];const t=sessionStorage.getItem("flatmap-knowledge");return t&&(e=JSON.parse(t)),e},emitConnectivityError:function(e){this.$emit("connectivity-error",{data:{errorData:e,errorMessage:$y}})},checkConnectivityTooltipEntry:function(e){return e!=null&&e.length?e.find(t=>{var o,i;return((o=t==null?void 0:t.destinations)==null?void 0:o.length)||((i=t==null?void 0:t.components)==null?void 0:i.length)})!==void 0:!1},changeConnectivitySource:async function(e){const{entry:t,connectivitySource:o}=e;t.mapId===this.mapImp.id&&(await this.flatmapQueries.queryForConnectivityNew(this.mapImp,t.featureId[0],o),this.tooltipEntry=this.tooltipEntry.map(i=>i.featureId[0]===t.featureId[0]?this.flatmapQueries.updateTooltipData(i):i),this.checkConnectivityTooltipEntry(this.tooltipEntry)&&this.$emit("connectivity-info-open",this.tooltipEntry))},checkAndCreatePopups:async function(e,t=!0){var o;if(this.viewingMode==="Annotation"){const i=e.filter(r=>r.feature).map(r=>r.feature);if(i.length>0)if(this.annotationSidebar&&this.previousDeletedEvent.type==="deleted"&&(this.annotationEntry=[{...this.previousDeletedEvent,resourceId:this.serverURL}],this.annotationEventCallback({},{type:"aborted"})),this.annotationEntry=[],i.forEach(r=>{var a;this.annotationEntry.push({...r,resourceId:this.serverURL,featureId:r.featureId?r.featureId:(a=r.feature)==null?void 0:a.id,offline:this.offlineAnnotationEnabled})}),i[0].feature)this.activeDrawTool||this.activeDrawMode||this.isValidDrawnCreated?(this.featureAnnotationSubmitted=!1,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(i[0].feature.id,zy(i[0].feature.geometry))):this.rollbackAnnotationEvent();else{const r=this.annotationEntry.filter(a=>a.featureId&&a.models).map(a=>a.models);r.length>0&&this.displayTooltip(r)}else this.annotation={}}else if(this.viewingMode==="Neuron Connection"&&t){const i=e.map(a=>a.resource[0]);if(i.find(a=>!a.startsWith("ilxtr:"))){const a=Array.isArray(i)?[...i]:[i];a.length===1&&a.push([]);const s=(o=e[0].feature)==null?void 0:o.featureId,l=this.mapImp.annotations.get(s),c=l==null?void 0:l["anatomical-nodes"],d=l==null?void 0:l.models;let f,u=a;const p=l==null?void 0:l.models;c!=null&&c.length&&(f=c.find(S=>JSON.parse(S)[0]===d)),f?u=JSON.parse(f):p&&(u=[p,[]]);const g=this.mapImp.knowledgeSource,h=u.flat(1/0),m=[...new Set(h)],b=(await Lt.fetchLabels(this.flatmapAPI,m)).reduce((S,E)=>{const O=E[0],M=JSON.parse(E[1]);return S.push({id:O,label:M.label,source:M.source}),S},[]);b.sort((S,E)=>S.id===E.id?S.source===g&&E.source!==g?-1:S.source!==g&&E.source===g?1:0:S.id.localeCompare(E.id));const C=[];for(let S=0;S<m.length;S++){const E=b.find(O=>O.id===m[S]);E&&C.push(E.label)}const I=Gn(C.join(", ")),k={facet:JSON.stringify(u),facetPropPath:`flatmap.connectivity.source.${this.connectionType.toLowerCase()}`,tagLabel:I,term:this.connectionType};this.connectivityFilters.some(S=>S.facet===k.facet&&S.facetPropPath===k.facetPropPath)||this.connectivityFilters.push(k),this.$emit("neuron-connection-feature-click",{filters:this.connectivityFilters,search:""})}else{const a=i.join();this.connectionType.toLowerCase()==="all"&&this.$emit("neuron-connection-feature-click",{filters:[],search:a})}}else{Ny(this.mapImp,this.flatmapQueries);let i=[];if(this.tooltipEntry=e.filter(r=>r.resource[0]in this.mapImp.pathways.paths).map(r=>({title:r.label,featureId:r.resource,ready:!1})),this.tooltipEntry.length){this.$emit("connectivity-info-open",this.tooltipEntry);for(let a=0;a<e.length;a++)i.push(await this.getKnowledgeTooltip(e[a]));this.tooltipEntry=await Promise.all(i);const r=this.tooltipEntry.map(a=>a.featureId[0]);r.length>0&&this.displayTooltip(r)}}},updateConnectivityFilters:function(e){e.length&&(this.connectivityFilters=e.filter(t=>t.facet.toLowerCase()!=="show all"))},resetConnectivityfilters:function(e){e.length?this.connectivityFilters=this.connectivityFilters.filter(t=>e.some(o=>o.facetPropPath===t.facetPropPath&&o.facet!==t.facet)):this.connectivityFilters=[]},getKnowledgeTooltip:async function(e){const t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp,e);let o=await this.flatmapQueries.createTooltipData(this.mapImp,e);return(t&&t[0]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(o.featuresAlert=e.alert,o.knowledgeSource=ui(this.mapImp),o.mapId=this.mapImp.mapMetadata.id,o.mapuuid=this.mapImp.mapMetadata.uuid),o.ready=!0,o},popUpCssHacks:function(){const e=document.querySelector(".flatmap-tooltip-popup"),t=document.querySelector(".maplibregl-popup-close-button");e&&(e.style.display="none"),t.style.display="block",this.$refs.tooltip.$el.style.display="flex",t.onclick=()=>{this.$emit("connectivity-info-close"),e&&(e.style.display="block")}},closeTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.$el.style.display="none"),document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},showPopup:function(e,t,o){let i=o;this.mapImp&&(i?i.className||(i.className="custom-popup"):i={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,i))},showMarkerPopup:function(e,t,o){this.mapImp&&this.mapImp.showMarkerPopup(e,t,o)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){const t=this.hoverVisibilities.length,o=t-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const a=i==null?void 0:i.refs,s=i==null?void 0:i.ref,l=this.$refs[a||s];if(l){const{parentElement:c,nextElementSibling:d}=l.$el,f=u=>u&&(u.classList.contains("pathway-container")||u.classList.contains("pathway-location"));(f(c)||f(d))&&(this.requiresDrawer?this.drawerOpen=!0:this.helpModeActiveIndex+=1)}else this.helpModeActiveIndex+=1,this.setHelpMode(e)}const r=this.hoverVisibilities[this.helpModeActiveIndex];(r==null?void 0:r.ref)==="checkBoxPopover"&&!this.showPathwayFilter&&(this.helpModeActiveIndex+=1,this.setHelpMode(e)),e||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=o),e&&this.helpModeActiveIndex>=o&&this.$emit("help-mode-last-item",!0),e&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(a=>{a.value=!0})):e&&this.helpModeDialog&&t>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(a=>{a.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(a=>{a.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(e,t=500){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0,this.$emit("shown-tooltip")},t))},hideTooltip:function(e,t=500){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},t))},displayTooltip:function(e,t=void 0){let o,i={className:"flatmapvuer-popover"};if(t)o=e,i.annotationFeatureGeometry=t,this.annotationEntry.length&&(i.annotationEvent={type:this.annotationEntry[0].type,feature:this.annotationEntry[0].feature});else{const r=Array.isArray(e)?e[0]:e;r&&(o=this.mapImp.modelFeatureIds(r)[0]),this.activeDrawTool||(i.positionAtLastClick=!0)}this.connectivityInfoSidebar&&this.tooltipEntry.length&&this.viewingMode!=="Annotation"&&this.checkConnectivityTooltipEntry(this.tooltipEntry)&&this.$emit("connectivity-info-open",this.tooltipEntry),this.annotationSidebar&&this.viewingMode==="Annotation"&&this.$emit("annotation-open",{annotationEntry:this.annotationEntry,commitCallback:this.commitAnnotationEvent}),o&&!this.disableUI&&(this.viewingMode==="Annotation"&&!this.annotationSidebar||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar)&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(o,this.$refs.tooltip.$el,i),this.popUpCssHacks()}))},moveMap:function(e,t={}){if(this.mapImp){const{offsetX:o=0,offsetY:i=0,zoom:r=4}=t,a=this.mapImp.map,s=this.mapImp.bounds.toArray();this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),s!=null&&s.length&&setTimeout(()=>{a.fitBounds(s,{offset:[o,i],zoom:r,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&(this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"}),this.$emit("shown-map-tooltip"))}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let o of t.values())o.label&&e.push(o.label);return Array.from(new Set(e))}},getVisibilityState:function(e){if(["alertSelection","pathwaysSelection","taxonSelection"].forEach(o=>{let i=this.$refs[o];i&&(e[o]=i.getState())}),this.$refs.treeControls){const o=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();e.systemsSelection=o.filter(i=>!i.includes("."))}},setVisibilityState:function(e){["alertSelection","pathwaysSelection","taxonSelection"].forEach(o=>{const i=e[o];if(i){const r=this.$refs[o];r&&r.setState(i)}}),"systemsSelection"in e&&this.$refs.treeControls&&(this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e.systemsSelection),this.systems[0].children.forEach(o=>{this.mapImp.enableSystem(o.key,e.systemsSelection.includes(o.key))}))},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e.viewingMode=this.viewingMode,e.searchTerm=this.searchTerm,e.flightPath3D=this.flightPath3DRadio,e.colour=this.colourRadio,e.outlines=this.outlinesRadio,e.background=this.currentBackground,this.offlineAnnotationEnabled&&(e.offlineAnnotations=sessionStorage.getItem("anonymous-annotation")),this.getVisibilityState(e),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?this.restoreMapState(e):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){if(e){if(e.viewport&&this.mapImp.setState(e.viewport),e.offlineAnnotations&&sessionStorage.setItem("anonymous-annotation",e.offlineAnnotations),e.viewingMode&&this.changeViewingMode(e.viewingMode),"flightPath3D"in e&&this.setFlightPath3D(e.flightPath3D),"colour"in e&&this.setColour(e.colour),"outlines"in e&&this.setOutlines(e.outlines),e.background&&this.backgroundChangeCallback(e.background),e.searchTerm){const t=e.searchTerm;this.searchAndShowResult(t,!0,!0)}this.setVisibilityState(e)}},setFlightPathInfo:function(e){(e===1.6||e>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0,this.flatmapError=null;let t={taxon:this.entry};this.uuid&&(t.uuid=this.uuid),e?(e.uuid?t={uuid:e.uuid}:e.entry&&(t.taxon=e.entry),e.biologicalSex?t.biologicalSex=e.biologicalSex:t.taxon==="NCBITaxon:9606"&&(t.biologicalSex="PATO:0000384")):this.biologicalSex&&(t.biologicalSex=this.biologicalSex),this.mapManagerRef.loadMap(t,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:!1,container:this.$refs.display}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let r=this.mapImp.details.version;this.setFlightPathInfo(r);const a=this._stateToBeSet?this._stateToBeSet:e;this.onFlatmapReady(a),this.$nextTick(()=>this.restoreMapState(a))}).catch(i=>{var r,a;if(console.error("Flatmap loading error:",i),this.flatmapError={},i.message&&i.message.indexOf("Unknown map")!==-1?(this.flatmapError.title="Unknown Map!",this.flatmapError.messages=Object.keys(t).map(s=>`${s==="uuid"?"UUID":Gn(s)}: ${t[s]}`)):(this.flatmapError.title="Error Loading Map!",this.flatmapError.messages=[i.message?i.message:i.toString(),"Please try again later or contact support if the problem persists."]),(a=(r=this.$parent)==null?void 0:r.$refs)!=null&&a.multiContainer){const s=this.$parent;this.flatmapError.button={text:"Load Default Map",callback:()=>{const l=s.initial;s.setSpecies(l,void 0,3)}}}this.loading=!1})}else e&&(this._stateToBeSet={...e},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),o=parseInt(t.paddingTop)+parseInt(t.paddingBottom),i=e.clientHeight-o;this.pathwaysMaxHeight=i-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&this.mapImp.resize()}catch{console.error("Map resize error")}},getFilterSources:function(){const e=["kind","taxons"];let t=new Set,o=new Set,i=new Map;for(const a of this.mapImp.annotations.values())if(a.source){"alert"in a?t.add(a.source):o.add(a.source);for(const[s,l]of Object.entries(a))if(e.includes(s)){i.has(s)||i.set(s,new Map);const c=i.get(s),d=f=>{const u=f;c.has(u)||c.set(u,new Set),c.get(u).add(`${a.source}`)};Array.isArray(l)?l.forEach(d):d(l)}}let r={alert:{with:[...t],without:[...o]}};for(const[a,s]of i.entries()){r[a]={};for(const[l,c]of s.entries())r[a][l]=[...c.values()]}return r},getFilterOptions:async function(e,t){const o=t||this.getFlatmapKnowledge(),i=this.pathways;return await Lt.getFlatmapFilterOptions(this.flatmapAPI,e,o,i)},onFlatmapReady:function(e){var t;if(this.sensor=n.markRaw(new Ry(this.$refs.display,this.mapResize)),((t=this.mapImp.options)==null?void 0:t.style)==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.pathways=this.pathways.filter(o=>o.enabled&&o.type!=="other"),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.mapImp.taxonIdentifiers,e?e.taxonSelection:void 0),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.flatmapLegends=this.mapImp.flatmapLegend,this.loading=!1,this.computePathControlsMaximumHeight(),this.mapResize(),this.handleMapClick(),this.setInitMapState(),this.displayMinimap){const o={position:"top-right"};this.mapImp.createMinimap(o),this.addResizeButtonToMinimap()}this.$emit("ready",this)},handleMapClick:function(){const e=this.mapImp.map;e&&e.on("click",t=>{this.connectivityDataSource||this.$emit("connectivity-info-close"),this.connectivityDataSource=""})},onContextLost:function(){this.lastViewport=n.markRaw(this.mapImp.getState()),this.flatmapError={},this.flatmapError.title="GL context lost!",this.flatmapError.messages=["GL context is lost due to too many concurrent GL contexts. Please try using the Restore Context button."],this.flatmapError.button={text:"Restore Context",callback:()=>{this.forceContextRestore()}}},onContextRestored:function(){if(this.mapImp){this.handleMapClick(),this.setInitMapState();const e=this.getState();if(e&&(e.viewport=this.lastViewport),this.restoreMapState(e),this.displayMinimap){const t={position:"top-right"};this.mapImp.createMinimap(t),this.addResizeButtonToMinimap()}this.filterToRestore&&(this.mapImp.setVisibilityFilter(this.filterToRestore),this.filterToRestore=void 0),this.$emit("context-restored",this)}},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t,o=!0){var i;if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),this.viewingMode==="Exploration"?this.$emit("connectivity-info-close"):this.viewingMode==="Annotation"&&this.manualAbortedOnClose(),this.searchTerm="",!0;{const r=this.mapImp.search(e);if((i=r==null?void 0:r.results)!=null&&i.length){if(this.mapImp.showSearchResults(r),t){let a;for(let s=0;s<r.results.length;s++){a=r.results[s].featureId;const l=this.mapImp.annotation(a);if(a&&(l!=null&&l.label))break}if(a){const s=this.mapImp.featureProperties(a),l={resource:[s.models],feature:s,label:s.label,provenanceTaxonomy:s.taxons,alert:s.alert};this.checkAndCreatePopups([l],o),this.mapImp.showPopup(a,Gn(s.label),{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}}return this.searchTerm=e,!0}else this.mapImp.clearSearchResults()}}return!1},highlightConnectedPaths:function(e){if(e.length){const t=e.filter(i=>i in this.mapImp.pathways.paths),o=this.mapImp.modelFeatureIdList(t);this.mapImp.selectGeoJSONFeatures(o)}},searchSuggestions:function(e){return this.mapImp?this.mapImp.search(e):[]},onActionClick:function(e){pi.emit("onActionClick",e)},setConnectionType:function(e){this.connectionType=e}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:1},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},render:{type:Boolean,default:!0},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},mapManager:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1},annotationSidebar:{type:Boolean,default:!1},showLocalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0},showPathwayFilter:{type:Boolean,default:!0},externalLegends:{type:Array,default:function(){return[]}}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,userApiKey:this.userToken}},data:function(){return{filterToRestore:void 0,flatmapError:null,sensor:null,mapManagerRef:void 0,flatmapQueries:void 0,annotationEntry:[],tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],initMapState:n.markRaw({}),sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:n.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:Ly,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:Ay,tooltipEntry:[],connectivityDataSource:"",connectivityTooltipVisible:!1,drawerOpen:!1,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},connectionType:"All",offlineAnnotationEnabled:!1,offlineAnnotations:[],annotationFrom:"Anyone",annotatedSource:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,authorisedUser:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},previousEditEvent:{},previousDeletedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:n.markRaw({alert:{with:!0,without:!0}}),searchTerm:"",taxonLeaveDelay:void 0,connectivityFilters:[],flatmapLegends:[],lastViewport:void 0}},computed:{...Ci.mapState(Fy,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0},requiresDrawer:function(){var e,t,o,i;return this.loading?(this.drawerOpen=!1,!1):((e=this.systems)==null?void 0:e.length)>0||this.containsAlert&&this.alertOptions||((t=this.pathways)==null?void 0:t.length)>0||((o=this.taxonConnectivity)==null?void 0:o.length)>0||((i=this.legendEntry)==null?void 0:i.length)>0?(this.drawerOpen=!0,!0):(this.drawerOpen=!1,!1)},modeDescription:function(){let e=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.authorisedUser?e[1]:e[0]:e},legendEntry:function(){return[...this.flatmapLegends,...this.externalLegends]},showDatasetMarkerTooltip:function(){return this.hoverVisibilities[9].value}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e,t){e!==t&&this.setHelpMode(e)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},render:function(e){e&&this.mapImp&&this.mapImp.contextLost&&!this.loading&&this.$nextTick(()=>{this.forceContextRestore()})},state:{handler:function(e,t){e!==t&&(this.mapManagerRef?this.setState(e):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(e){this.clearAnnotationFeature(),e==="Annotation"&&(this.loading=!0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate?(this.authorisedUser=t,this.offlineAnnotationEnabled=!1):(this.authorisedUser=void 0,this.offlineAnnotationEnabled=!0),this.emitOfflineAnnotationUpdate(),this.setFeatureAnnotated(),this.addAnnotationFeature(),this.loading=!1}))},disableUI:function(e){e&&this.closeTooltip()},activeDrawTool:function(e){let t=[],o={x:null,y:null};const i=this.$el.querySelector(".maplibregl-canvas"),r=()=>{i.removeEventListener("keydown",a),i.removeEventListener("click",s)},a=l=>{if(!["Escape","Enter"].includes(l.key))return;const c=e==="Point"&&t.length===1||e==="LineString"&&t.length>=2||e==="Polygon"&&t.length>=3;(l.key==="Escape"||l.key==="Enter"&&!c)&&(this.activeDrawTool=void 0),r()},s=l=>{const c=i.getBoundingClientRect(),d=l.clientX-c.left,f=l.clientY-c.top;if(Math.sqrt((d-o.x)**2+(f-o.y)**2)<8){this.isValidDrawnCreated||(this.activeDrawTool=void 0),r();return}o={x:d,y:f},t.push(o)};e&&(r(),i.addEventListener("keydown",a),i.addEventListener("click",s))}},created:function(){this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=n.markRaw(new vi.MapViewer(this.flatmapAPI,{container:void 0})),this.$emit("mapmanager-loaded",this.mapManagerRef))},mounted:function(){this.openMapRef=n.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=n.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.flatmapQueries=n.markRaw(new Oy),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap(),ms()}},Hy={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},Ky={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},Uy={style:{height:"100%",width:"100%"},ref:"display",class:"flatmap-display"},Wy={class:"beta-popovers"},qy={key:2,class:"warning-text"},Gy={class:"bottom-right-control"},Jy=["innerHTML"],Yy={style:{"margin-bottom":"2px"}},Zy={key:0,class:"viewing-mode-title"},Qy=["onClick"],Xy=["onClick"];function eb(e,t,o,i,r,a){const s=n.resolveComponent("map-svg-sprite-color"),l=li,c=W.WarningFilled,d=be,f=on,u=W.ArrowDown,p=n.resolveComponent("DrawToolbar"),g=n.resolveComponent("map-svg-icon"),h=hy,m=n.resolveComponent("tree-controls"),y=ps,b=W.ArrowLeft,C=ei,I=tn,k=nn,v=ii,S=Un,E=ns,O=os,M=n.resolveComponent("Tooltip"),N=ri,B=si;return n.withDirectives((n.openBlock(),n.createElementBlock("div",Hy,[n.createVNode(s),n.createElementVNode("div",Ky,[n.createElementVNode("div",Uy,null,512),e.flatmapError?(n.openBlock(),n.createBlock(l,{key:0,flatmapError:e.flatmapError},null,8,["flatmapError"])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("div",Wy,[n.createElementVNode("div",null,[o.displayWarning||o.isLegacy?(n.openBlock(),n.createBlock(f,{key:0,placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[7].value,ref:"warningPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:"warning-icon",onMouseover:t[7]||(t[7]=T=>a.showTooltip(7)),onMouseout:t[8]||(t[8]=T=>a.hideTooltip(7))},[o.displayWarning||o.isLegacy?(n.openBlock(),n.createBlock(d,{key:0},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})):n.createCommentVNode("",!0),o.isLegacy?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[t[31]||(t[31]=n.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),n.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...T)=>a.viewLatestMap&&a.viewLatestMap(...T))}," Click here for the latest map ")],64)):o.displayWarning?(n.openBlock(),n.createElementBlock("span",qy,"Beta")):n.createCommentVNode("",!0)],32)]),default:n.withCtx(()=>[o.isLegacy?(n.openBlock(),n.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=T=>a.showTooltip(7)),onMouseout:t[1]||(t[1]=T=>a.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(n.openBlock(),n.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=T=>a.showTooltip(7)),onMouseout:t[3]||(t[3]=T=>a.hideTooltip(7))},t[29]||(t[29]=[n.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),n.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1),n.createTextVNode(" models available in "),n.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1),n.createTextVNode(". ")]),32)):(n.openBlock(),n.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=T=>a.showTooltip(7)),onMouseout:t[5]||(t[5]=T=>a.hideTooltip(7))},t[30]||(t[30]=[n.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),n.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1),n.createTextVNode(" models available in "),n.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1),n.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")]),32))]),_:1},8,["visible"])):n.createCommentVNode("",!0)]),o.displayLatestChanges?(n.openBlock(),n.createBlock(f,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:n.withCtx(()=>[o.displayLatestChanges?(n.openBlock(),n.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=T=>a.showTooltip(8)),onMouseout:t[10]||(t[10]=T=>a.hideTooltip(8))},[n.createVNode(d,null,{default:n.withCtx(()=>[n.createVNode(c)]),_:1}),t[32]||(t[32]=n.createElementVNode("span",{class:"warning-text"},"What's new?",-1))],32)):n.createCommentVNode("",!0)]),default:n.withCtx(()=>t[33]||(t[33]=[n.createElementVNode("b",null,"Connectivity References",-1),n.createElementVNode("p",null," Connectivity references have been improved and available in various formats. ",-1),n.createElementVNode("b",null,"Improved state storing",-1),n.createElementVNode("p",null," Current selection and visibility filters are now stored when creating a permalink. ",-1)])),_:1},8,["visible"])):n.createCommentVNode("",!0)],512),[[n.vShow,!o.disableUI]]),n.withDirectives(n.createVNode(d,{class:n.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:a.closeMinimap},{default:n.withCtx(()=>[n.createVNode(u)]),_:1},8,["class","onClick"]),[[n.vShow,e.minimapResizeShow]]),e.viewingMode==="Annotation"&&(e.authorisedUser||e.offlineAnnotationEnabled)&&!o.disableUI?(n.openBlock(),n.createBlock(p,{key:1,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:e.toolbarOptions,activeDrawTool:e.activeDrawTool,activeDrawMode:e.activeDrawMode,newlyDrawnEntry:e.drawnCreatedEvent,connectionEntry:e.connectionEntry,hoverVisibilities:e.hoverVisibilities,onClickToolbar:a.toolbarEvent,onFeatureTooltip:a.connectedFeatureTooltip,onConfirmDrawn:a.confirmDrawnFeature,onCancelDrawn:a.cancelDrawnFeature,onShowTooltip:a.showTooltip,onHideTooltip:a.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("div",Gy,[n.createVNode(f,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:"icon-button-container",onClick:t[11]||(t[11]=T=>a.zoomIn()),onMouseover:t[12]||(t[12]=T=>a.showTooltip(1)),onMouseout:t[13]||(t[13]=T=>a.hideTooltip(1))},[n.createVNode(g,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),n.createVNode(f,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:"icon-button-container",onClick:t[14]||(t[14]=T=>a.zoomOut()),onMouseover:t[15]||(t[15]=T=>a.showTooltip(2)),onMouseout:t[16]||(t[16]=T=>a.hideTooltip(2))},[n.createVNode(g,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),n.createVNode(f,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:"icon-button-container",onClick:t[17]||(t[17]=T=>a.resetView()),onMouseover:t[18]||(t[18]=T=>a.showTooltip(3)),onMouseout:t[19]||(t[19]=T=>a.hideTooltip(3))},[n.createVNode(g,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:n.withCtx(()=>[t[34]||(t[34]=n.createElementVNode("div",null,[n.createTextVNode(" Fit to "),n.createElementVNode("br"),n.createTextVNode(" window ")],-1))]),_:1},8,["visible"])],512),[[n.vShow,!o.disableUI]]),n.createVNode(f,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:e.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:n.withCtx(()=>[n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:n.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[a.legendEntry.length?(n.openBlock(),n.createBlock(h,{key:0,identifierKey:"prompt",colourKey:"colour",styleKey:"style",legends:a.legendEntry,showStarInLegend:!0,showDatasetMarkerTooltip:a.showDatasetMarkerTooltip,ref:"featuredMarkerPopover",class:"svg-legends-container"},null,8,["legends","showDatasetMarkerTooltip"])):n.createCommentVNode("",!0),n.createVNode(f,{content:"Find these markers for data. The number inside the markers is the number of datasets available for each marker.",placement:"right",teleported:!1,width:"200",trigger:"manual","popper-class":"flatmap-popper flatmap-marker-popper",visible:e.hoverVisibilities[0].value,ref:"markerPopover"},{reference:n.withCtx(()=>[n.withDirectives(n.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,Jy),[[n.vShow,e.hoverVisibilities[0].value],[N,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(n.openBlock(),n.createBlock(m,{key:1,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:e.systems,active:e.currentActive,hover:e.currentHover,onCheckChanged:a.systemSelected,onCheckAll:a.checkAllSystems,onChangeActive:a.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):n.createCommentVNode("",!0),e.containsAlert&&e.alertOptions&&o.showPathwayFilter?(n.openBlock(),n.createBlock(y,{title:"Alert",labelKey:"label",identifierKey:"key",selections:e.alertOptions,onChanged:a.alertSelected,onCheckboxMouseEnter:a.alertMouseEnterEmitted,onSelectionsDataChanged:a.onSelectionsDataChanged,onCheckAll:a.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):n.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(n.openBlock(),n.createBlock(y,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,showAsLegend:!o.showPathwayFilter,onChanged:a.pathwaysSelected,onSelectionsDataChanged:a.onSelectionsDataChanged,onCheckAll:a.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","showAsLegend","onChanged","onSelectionsDataChanged","onCheckAll"])):n.createCommentVNode("",!0),e.taxonConnectivity&&e.taxonConnectivity.length>0&&o.showPathwayFilter?(n.openBlock(),n.createBlock(y,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:e.taxonConnectivity,onChanged:a.taxonsSelected,onCheckboxMouseEnter:a.taxonMouseEnterEmitted,onSelectionsDataChanged:a.onSelectionsDataChanged,onCheckAll:a.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):n.createCommentVNode("",!0)],6)),[[N,void 0,"checkBoxPopover"]]),n.createElementVNode("div",{onClick:t[20]||(t[20]=(...T)=>a.toggleDrawer&&a.toggleDrawer(...T)),class:n.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[n.createVNode(d,null,{default:n.withCtx(()=>[n.createVNode(b)]),_:1})],2)],2),[[n.vShow,!o.disableUI&&a.requiresDrawer]])]),_:1},8,["visible"]),e.openMapRef?(n.openBlock(),n.createBlock(f,{key:2,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.openMapOptions,T=>(n.openBlock(),n.createBlock(I,{key:T.key},{default:n.withCtx(()=>[n.createVNode(C,{type:"primary",plain:"",onClick:P=>e.$emit("open-map",T.key)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(T.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):n.createCommentVNode("",!0),n.createVNode(f,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:n.withCtx(()=>[n.createElementVNode("div",null,[n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[35]||(t[35]=[n.createTextVNode("Viewing Mode")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createElementVNode("div",Yy,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.viewingModes,(T,P,q)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:P},[P===e.viewingMode?(n.openBlock(),n.createElementBlock("span",Zy,[n.createElementVNode("b",null,n.toDisplayString(P),1)])):(n.openBlock(),n.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:V=>a.changeViewingMode(P)},n.toDisplayString(P),9,Qy))],64))),128))]),n.createVNode(I,{class:"viewing-mode-description"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a.modeDescription),1)]),_:1}),e.viewingMode==="Annotation"&&e.offlineAnnotationEnabled?(n.openBlock(),n.createBlock(I,{key:0,class:"viewing-mode-description"},{default:n.withCtx(()=>t[36]||(t[36]=[n.createTextVNode(" (Anonymous annotate) ")])),_:1})):n.createCommentVNode("",!0)]),_:1}),e.viewingMode==="Annotation"&&e.authorisedUser?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[37]||(t[37]=[n.createTextVNode("Annotations From")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(S,{teleported:!1,modelValue:e.annotationFrom,"onUpdate:modelValue":t[21]||(t[21]=T=>e.annotationFrom=T),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:a.setAnnotationFrom},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.annotatedSource,T=>(n.openBlock(),n.createBlock(v,{key:T,label:T,value:T},{default:n.withCtx(()=>[n.createVNode(I,null,{default:n.withCtx(()=>[n.createVNode(k,{span:12},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(T),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(I,{key:1,class:"backgroundSpacer"})):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(I,{key:2,class:"backgroundText"},{default:n.withCtx(()=>t[38]||(t[38]=[n.createTextVNode("Flight path display")])),_:1})):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(I,{key:3,class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[22]||(t[22]=T=>e.flightPath3DRadio=T),class:"flatmap-radio",onChange:a.setFlightPath3D},{default:n.withCtx(()=>[n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[39]||(t[39]=[n.createTextVNode("2D")])),_:1}),n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[40]||(t[40]=[n.createTextVNode("3D")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(I,{class:"backgroundSpacer"}),n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[41]||(t[41]=[n.createTextVNode("Organs display")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:e.colourRadio,"onUpdate:modelValue":t[23]||(t[23]=T=>e.colourRadio=T),class:"flatmap-radio",onChange:a.setColour},{default:n.withCtx(()=>[n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[42]||(t[42]=[n.createTextVNode("Colour")])),_:1}),n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[43]||(t[43]=[n.createTextVNode("Greyscale")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),n.createVNode(I,{class:"backgroundSpacer"}),n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[44]||(t[44]=[n.createTextVNode("Outlines display")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[24]||(t[24]=T=>e.outlinesRadio=T),class:"flatmap-radio",onChange:a.setOutlines},{default:n.withCtx(()=>[n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[45]||(t[45]=[n.createTextVNode("Show")])),_:1}),n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[46]||(t[46]=[n.createTextVNode("Hide")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),n.createVNode(I,{class:"backgroundSpacer"}),n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[47]||(t[47]=[n.createTextVNode("Change background")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.availableBackground,T=>(n.openBlock(),n.createElementBlock("div",{key:T,class:n.normalizeClass(["backgroundChoice",T,T==e.currentBackground?"active":""]),onClick:P=>a.backgroundChangeCallback(T)},null,10,Xy))),128))]),_:1})])]),_:1},8,["virtual-ref"]),n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[o.showOpenMapButton?(n.openBlock(),n.createBlock(I,{key:0},{default:n.withCtx(()=>[n.createVNode(f,{visible:e.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:n.withCtx(()=>[o.enableOpenMapUI&&o.openMapOptions.length>0?(n.openBlock(),n.createElementBlock("div",{key:0,ref:"openMapRef",class:"icon-button-container",onMouseover:t[25]||(t[25]=T=>a.showTooltip(4)),onMouseout:t[26]||(t[26]=T=>a.hideTooltip(4))},[n.createVNode(g,{icon:"openMap",class:"icon-button open-map-button"})],544)):n.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1})):n.createCommentVNode("",!0),o.showLocalSettings?(n.openBlock(),n.createBlock(I,{key:1},{default:n.withCtx(()=>[n.createVNode(f,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{ref:"backgroundIconRef",class:"icon-button-container",onMouseover:t[27]||(t[27]=T=>a.showTooltip(5)),onMouseout:t[28]||(t[28]=T=>a.hideTooltip(5))},[n.createVNode(g,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})):n.createCommentVNode("",!0)],2),[[n.vShow,!o.disableUI]]),e.tooltipDisplay?(n.openBlock(),n.createBlock(M,{key:3,ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,tooltipEntry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation",onAnnotation:a.commitAnnotationEvent,onOnActionClick:a.onActionClick},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation","onOnActionClick"])):n.createCommentVNode("",!0)])])),[[B,e.loading]])}const hi=st(jy,[["render",eb],["__scopeId","data-v-ba0755eb"]]),bs={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},tb={name:"MultiFlatmapVuer",components:{Col:nn,Row:tn,Option:ii,Select:Un,Popover:on,FlatmapVuer:hi},created:function(){this.loadMapManager()},mounted:function(){this.initialise(),pi.on("onActionClick",e=>{this.resourceSelected(e)}),pi.on("open-pubmed-url",e=>{this.$emit("open-pubmed-url",e)})},methods:{initialise:function(){return this.multiflatmapError=null,new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{t.status_code===404&&(console.error("Flatmap API endpoint is incorrect",t),this.multiflatmapError={},this.multiflatmapError.title="MultiFlatmap Error!",this.multiflatmapError.messages=[`Sorry, the component could not be loaded because the specified
|
|
24
|
+
order by source desc`;ms();const r=sessionStorage.getItem("flatmap-knowledge"),a=sessionStorage.getItem("flatmap-knowledge-source");if(!r||a!==o){const l=(await t.queryKnowledge(i)).map(c=>JSON.parse(c));return sessionStorage.setItem("flatmap-knowledge",JSON.stringify(l)),sessionStorage.setItem("flatmap-knowledge-source",o),_y(),l}return JSON.parse(r)}function _y(){const o=new Date().getTime()+864e5;sessionStorage.setItem("flatmap-knowledge-expiry",o)}function Py(){["flatmap-knowledge","flatmap-knowledge-expiry","flatmap-knowledge-source"].forEach(t=>{sessionStorage.removeItem(t)})}function ms(){const e=sessionStorage.getItem("flatmap-knowledge-expiry");new Date().getTime()>e&&Py()}const Gn=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),Ly='<svg width="195px" height="24px" viewBox="0 0 200 24" fill="yellow"><path d="M22.0748 3.25583C22.4141 2.42845 23.5859 2.42845 23.9252 3.25583L25.6493 7.45955C25.793 7.80979 26.1221 8.04889 26.4995 8.07727L31.0303 8.41798C31.922 8.48504 32.2841 9.59942 31.6021 10.1778L28.1369 13.1166C27.8482 13.3614 27.7225 13.7483 27.8122 14.1161L28.8882 18.5304C29.1 19.3992 28.152 20.0879 27.3912 19.618L23.5255 17.2305C23.2034 17.0316 22.7966 17.0316 22.4745 17.2305L18.60881 19.618C17.84796 20.0879 16.9 19.3992 17.1118 18.5304L18.18785 14.1161C18.2775 13.7483 18.1518 13.3614 17.86309 13.1166L14.3979 10.1778C13.71588 9.59942 14.07796 8.48504 14.96971 8.41798L19.50046 8.07727C19.87794 8.04889 20.20704 7.80979 20.35068 7.45955L22.0748 3.25583Z" stroke="#000000" stroke-width="2"/><text x="47" y="52%" style="white-space: pre" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#333333">Featured dataset marker</text></svg>';var gs={exports:{}};(function(e,t){(function(o,i){e.exports=i()})(typeof window<"u"?window:mm,function(){if(typeof window>"u")return null;var o=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),i=o.requestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||function(f){return o.setTimeout(f,20)},r=o.cancelAnimationFrame||o.mozCancelAnimationFrame||o.webkitCancelAnimationFrame||function(f){o.clearTimeout(f)};function a(f,u){var p=Object.prototype.toString.call(f),g=p==="[object Array]"||p==="[object NodeList]"||p==="[object HTMLCollection]"||p==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,h=0,m=f.length;if(g)for(;h<m;h++)u(f[h]);else u(f)}function s(f){if(!f.getBoundingClientRect)return{width:f.offsetWidth,height:f.offsetHeight};var u=f.getBoundingClientRect();return{width:Math.round(u.width),height:Math.round(u.height)}}function l(f,u){Object.keys(u).forEach(function(p){f.style[p]=u[p]})}var c=function(f,u){var p=0;function g(){var m=[];this.add=function(C){m.push(C)};var y,b;this.call=function(C){for(y=0,b=m.length;y<b;y++)m[y].call(this,C)},this.remove=function(C){var I=[];for(y=0,b=m.length;y<b;y++)m[y]!==C&&I.push(m[y]);m=I},this.length=function(){return m.length}}function h(m,y){if(m){if(m.resizedAttached){m.resizedAttached.add(y);return}m.resizedAttached=new g,m.resizedAttached.add(y),m.resizeSensor=document.createElement("div"),m.resizeSensor.dir="ltr",m.resizeSensor.className="resize-sensor";var b={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},C={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(m.resizeSensor,b);var I=document.createElement("div");I.className="resize-sensor-expand",l(I,b);var k=document.createElement("div");l(k,C),I.appendChild(k);var v=document.createElement("div");v.className="resize-sensor-shrink",l(v,b);var S=document.createElement("div");l(S,C),l(S,{width:"200%",height:"200%"}),v.appendChild(S),m.resizeSensor.appendChild(I),m.resizeSensor.appendChild(v),m.appendChild(m.resizeSensor);var E=window.getComputedStyle(m),O=E?E.getPropertyValue("position"):null;O!=="absolute"&&O!=="relative"&&O!=="fixed"&&O!=="sticky"&&(m.style.position="relative");var M=!1,N=0,B=s(m),T=0,P=0,q=!0;p=0;var V=function(){var Z=m.offsetWidth,ce=m.offsetHeight;k.style.width=Z+10+"px",k.style.height=ce+10+"px",I.scrollLeft=Z+10,I.scrollTop=ce+10,v.scrollLeft=Z+10,v.scrollTop=ce+10},x=function(){if(q){var Z=m.offsetWidth===0&&m.offsetHeight===0;if(Z){p||(p=i(function(){p=0,x()}));return}else q=!1}V()};m.resizeSensor.resetSensor=x;var $=function(){N=0,M&&(T=B.width,P=B.height,m.resizedAttached&&m.resizedAttached.call(B))},pe=function(){B=s(m),M=B.width!==T||B.height!==P,M&&!N&&(N=i($)),x()},Y=function(Z,ce,Ee){Z.attachEvent?Z.attachEvent("on"+ce,Ee):Z.addEventListener(ce,Ee)};Y(I,"scroll",pe),Y(v,"scroll",pe),p=i(function(){p=0,x()})}}a(f,function(m){h(m,u)}),this.detach=function(m){p||(r(p),p=0),c.detach(f,m)},this.reset=function(){f.resizeSensor.resetSensor()}};if(c.reset=function(f){a(f,function(u){u.resizeSensor.resetSensor()})},c.detach=function(f,u){a(f,function(p){p&&(p.resizedAttached&&typeof u=="function"&&(p.resizedAttached.remove(u),p.resizedAttached.length())||p.resizeSensor&&(p.contains(p.resizeSensor)&&p.removeChild(p.resizeSensor),delete p.resizeSensor,delete p.resizedAttached))})},typeof MutationObserver<"u"){var d=new MutationObserver(function(f){for(var u in f)if(f.hasOwnProperty(u))for(var p=f[u].addedNodes,g=0;g<p.length;g++)p[g].resizeSensor&&c.reset(p[g])});document.addEventListener("DOMContentLoaded",function(f){d.observe(document.body,{childList:!0,subtree:!0})})}return c})})(gs);var Vy=gs.exports;const Ry=gm(Vy),Fy=Ci.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}});function Dy(e){return{all:e=e||new Map,on:function(t,o){var i=e.get(t);i?i.push(o):e.set(t,[o])},off:function(t,o){var i=e.get(t);i&&(o?i.splice(i.indexOf(o)>>>0,1):e.set(t,[]))},emit:function(t,o){var i=e.get(t);i&&i.slice().map(function(r){r(o)}),(i=e.get("*"))&&i.slice().map(function(r){r(t,o)})}}}const pi=new Dy,$y="cannot be found on the map.",zy=e=>{let t={lng:0,lat:0},o;return e.type==="Polygon"?e.coordinates.length&&(o=e.coordinates[0]):o=e.coordinates,o&&(e.type!=="Point"?(o.map(i=>{t.lng+=parseFloat(i[0]),t.lat+=parseFloat(i[1])}),t.lng=t.lng/o.length,t.lat=t.lat/o.length):(t.lng+=parseFloat(o[0]),t.lat+=parseFloat(o[1]))),t},ys=(e,t)=>{const o=[];let i=e.organs?e.organs:e.ftus;const r=i?i.filter((a,s)=>i.findIndex(l=>l.label===a.label)===s):void 0;return r&&r.forEach(a=>{const s={label:a.label,models:a.models,key:`${t}.${a.label}`},l=ys(a,s.key);l.length>0&&(s.children=l),o.push(s)}),o},jy={name:"FlatmapVuer",components:{Button:ei,Col:nn,Loading:Zg,Radio:ns,Icon:be,RadioGroup:os,Row:tn,Select:Un,Dialog:gg,MapSvgIcon:wi.MapSvgIcon,MapSvgSpriteColor:wi.MapSvgSpriteColor,Tooltip:Lt.Tooltip,TreeControls:Lt.TreeControls,SelectionsGroup:ps,SvgLegends:Ty,ElIconWarningFilled:W.WarningFilled,ElIconArrowDown:W.ArrowDown,ElIconArrowLeft:W.ArrowLeft,DrawToolbar:Lt.DrawToolbar,FlatmapError:li},beforeCreate:function(){this.setStateRequired=!1},setup(e){let t=n.inject("$annotator");return t||(t=n.markRaw(new Ts.AnnotationService(`${e.flatmapAPI}annotator`)),n.provide("$annotator",t)),{annotator:t}},methods:{enableFeatureResetOnClick:function(e){this.mapImp&&this.mapImp.enableFeatureResetOnClick(e)},setVisibilityFilter:function(e){this.mapImp&&(this.mapImp.contextLost?e?this.filterToRestore=n.markRaw(JSON.parse(JSON.stringify(e))):this.filterToRestore=void 0:(e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter(),this.filterToRestore=void 0))},manualAbortedOnClose:function(){this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEventCallback({},{type:"aborted"}),this.initialiseDrawing()},initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry=[{...this.drawnCreatedEvent.feature,resourceId:this.serverURL}],this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(e){if(this.mapImp)if(e){const t=Number(e);let i={feature:t?this.mapImp.featureProperties(t):{feature:this.existDrawnFeatures.find(r=>r.id===e.trim())}};this.checkAndCreatePopups([i],!1)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups([this.drawnCreatedEvent],!1),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry[0].feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(e,t){if(!this.isValidDrawnCreated){if(this.manualAbortedOnClose(),this.doubleClickedFeature=!1,this.changeAnnotationDrawMode({mode:"simple_select"}),e==="mode")this.activeDrawMode=t;else if(e==="tool"){if(this.cancelDrawnFeature(),t){const o=t.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${o}`})}this.activeDrawTool=t}}},annotationDrawModeEvent:function(e){this.activeDrawMode==="Edit"?this.doubleClickedFeature&&(e.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:e.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[e.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const e=Object.values(this.connectionEntry),t={type:"connectivity",source:e[0],target:e[e.length-1],intermediates:e.filter((o,i)=>i!==0&&i!==e.length-1)};this.annotationEntry[0].body=t}},changeAnnotationDrawMode:function(e){this.mapImp&&this.mapImp.changeAnnotationDrawMode(e)},clearAnnotationFeature:function(){this.mapImp&&this.mapImp.clearAnnotationFeature()},forceContextLoss:function(){this.mapImp&&!this.mapImp.contextLost&&!this.loading&&this.mapImp.forceContextLoss()},forceContextRestore:function(){this.mapImp&&(this.flatmapError=null,this.mapImp.forceContextRestore())},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&this.annotationEntry.length>0&&["created","updated","deleted"].includes(this.annotationEntry[0].type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry[0]),this.annotationEntry=[])},commitAnnotationEvent:function(e){this.mapImp&&(this.offlineAnnotationEnabled&&(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(e),this.annotationEntry[0].type==="deleted"&&(this.offlineAnnotations=this.offlineAnnotations.filter(t=>t.resource!==this.serverURL||t.item.id!==e.item.id)),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))),["created","updated","deleted"].includes(this.annotationEntry[0].type)&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry[0]),e.body.comment==="Position Updated"?this.annotationEntry[0].positionUpdated=!1:this.annotationEntry[0].type==="deleted"&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry=[]),this.addAnnotationFeature()))},fetchAnnotatedItemIds:async function(e=void 0,t=void 0){let o;return this.offlineAnnotationEnabled?(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],o=this.offlineAnnotations.filter(i=>i.resource===this.serverURL).map(i=>i.item.id)):(o=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,e,t),"resource"in o&&(o=o.itemIds)),o},setFeatureAnnotated:async function(){if(this.mapImp){const e=await this.fetchAnnotatedItemIds();for(const t of e)this.mapImp.setFeatureAnnotated(t)}},fetchDrawnFeatures:async function(e,t){let o;if(this.offlineAnnotationEnabled)this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],o=this.offlineAnnotations.filter(i=>i.feature&&i.resource===this.serverURL).map(i=>i.feature);else{const i=await this.fetchAnnotatedItemIds(e,t);o=await this.annotator.drawnFeatures(this.userToken,this.serverURL,i),"resource"in o&&(o=o.features)}return o},addAnnotationFeature:async function(){if(this.mapImp){this.featureAnnotationSubmitted||(this.clearAnnotationFeature(),this.loading=!0);const e=this.annotationFrom==="Anyone"?void 0:this.authorisedUser.orcid?this.authorisedUser.orcid:"0000-0000-0000-0000",t=this.annotationFrom==="Anyone"?void 0:this.annotationFrom==="Me",o=await this.fetchDrawnFeatures(e,t);if(this.existDrawnFeatures=o,this.loading=!1,!this.featureAnnotationSubmitted)for(const i of o)this.mapImp.addAnnotationFeature(i)}},showAnnotator:function(e){this.mapImp&&(this.mapImp.showAnnotator(e),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setAnnotationFrom:function(e){this.annotationFrom=e,this.mapImp&&(this.manualAbortedOnClose(),this.addAnnotationFeature())},emitOfflineAnnotationUpdate:function(){this.$emit("update-offline-annotation-enabled",this.offlineAnnotationEnabled)},setFlightPath3D:function(e){this.flightPath3DRadio=e,this.mapImp&&this.mapImp.enableFlightPaths(e)},viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(o=>{const i={colour:o.colour,enabled:o.enabled,label:o.id,key:o.id},r=ys(o,i.key);r.length>0&&(i.children=r),t.children.push(i)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,di(this.mapImp,e).then(o=>{o.length&&o.forEach(i=>{let r=!0;t&&(r=t.checkAll?!0:t.checked.includes(i.taxon)),this.taxonConnectivity.push({...i,enabled:r}),this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(i.taxon,r)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setPaint({coloured:e,outlined:this.outlinesRadio})},setOutlines:function(e){this.outlinesRadio=e,this.mapImp&&this.mapImp.setPaint({coloured:this.colourRadio,outlined:e})},setInitMapState:function(){if(this.mapImp){const e=this.mapImp.map,t=this.mapImp.options.bounds,o=[[t[0],t[1]],[t[2],t[3]]];e.setMaxBounds(null),e.setRenderWorldCopies(!1),this.initMapState=n.markRaw({initBounds:o})}},resetView:function(){if(this.mapImp){const e=this.mapImp.map,{initBounds:t}=this.initMapState;e.resetNorthPitch({animate:!1}),t&&e.fitBounds(t,{animate:!1}),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset()}},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},onSelectionsDataChanged:function(e){this.$emit("pathway-selection-changed",e)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},zoomToFeatures:function(e){this.mapImp&&this.mapImp.zoomToFeatures(e)},retrieveConnectedPaths:async function(e,t={}){var o,i,r,a,s;if(this.mapImp){let l=[],c=(o=t.target)!=null&&o.length?t.target:[];const d=[...this.mapImp.pathModelNodes(e)],f=await this.mapImp.queryPathsForFeatures(e);if(d.length){if(!c.length){const u=(i=t.type)!=null&&i.length?t.type:["all"],p=await this.flatmapQueries.queryForConnectivityNew(this.mapImp,e[0]),g=(r=p==null?void 0:p.ids)==null?void 0:r.dendrites.flat(1/0),h=(a=p==null?void 0:p.ids)==null?void 0:a.components.flat(1/0),m=(s=p==null?void 0:p.ids)==null?void 0:s.axons.flat(1/0);let y=[];u.includes("origins")&&y.push(...g),u.includes("components")&&y.push(...h),u.includes("destinations")&&y.push(...m),u.includes("all")&&y.push(...g,...h,...m),c=[...new Set(y)]}d.forEach(u=>{this.mapImp.nodePathModels(u).forEach(g=>{const m=this.mapImp.pathModelNodes(g).map(b=>this.mapImp.featureProperties(b).models);c.filter(b=>m.includes(b)).length&&!l.includes(g)&&l.push(g)})})}else f.length&&(c.length?f.forEach(u=>{const g=this.mapImp.pathModelNodes(u).map(m=>this.mapImp.featureProperties(m).models);c.filter(m=>g.includes(m)).length&&!l.includes(u)&&l.push(u)}):l=f);return l=[...new Set([...l,...e])],l}},resetMapFilter:function(){const e=this.mapFilters.alert;let t;const o={"tile-layer":"pathways"},i={NOT:o};e.with&&!e.without?t={OR:[i,{AND:[o,{HAS:"alert"}]}]}:!e.with&&e.without?t={OR:[i,{AND:[o,{NOT:{HAS:"alert"}}]}]}:!e.with&&!e.without&&(t=i),this.setVisibilityFilter(t)},alertMouseEnterEmitted:function(e){if(this.mapImp)if(e.value){let t;const o={"tile-layer":"pathways"},i={NOT:o};if(e.key==="alert"||e.key==="withoutAlert"){const r=e.key==="alert"?{HAS:"alert"}:{NOT:{HAS:"alert"}};t={OR:[i,{AND:[o,r]}]}}this.setVisibilityFilter(t)}else this.resetMapFilter()},alertSelected:function(e){this.mapImp&&(e.key==="alert"?e.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:e.key==="withoutAlert"&&(e.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(e){this.mapImp&&(e.value?(this.mapFilters.alert.without=!0,this.mapFilters.alert.with=!0):(this.mapFilters.alert.without=!1,this.mapFilters.alert.with=!1),this.resetMapFilter())},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},taxonMouseEnterEmitted:function(e){if(this.mapImp)if(e.value){clearTimeout(this.taxonLeaveDelay);let t=this.mapImp.taxonFeatureIds(e.key);this.mapImp.enableConnectivityByTaxonIds(e.key,e.value),this.mapImp.zoomToGeoJSONFeatures(t,{noZoomIn:!0})}else this.taxonLeaveDelay=setTimeout(()=>{this.mapImp.unselectGeoJSONFeatures(),e.selections.forEach(t=>{let o=e.checked.includes(t.taxon);this.mapImp.enableConnectivityByTaxonIds(t.taxon,o)})},1e3)},checkAllTaxons:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.keys,e.value)},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},annotationEventCallback:function(e,t){if(t.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent(),this.annotationEntry=[];else if(t.type==="modeChanged")t.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0),this.annotationSidebar&&t.feature.mode==="simple_select"&&this.activeDrawMode==="Deleted"&&this.annotationEventCallback({},{type:"aborted"});else if(t.type==="selectionChanged"){if(this.selectedDrawnFeature=t.feature.features.length===0?void 0:t.feature.features[0],e.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool)if(this.connectionEntry={},this.selectedDrawnFeature){const o=this.existDrawnFeatures.find(i=>i.id===this.selectedDrawnFeature.id);o&&o.connection&&(this.connectionEntry=o.connection),this.annotationDrawModeEvent(e)}else this.annotationSidebar&&this.previousEditEvent.type==="updated"&&(this.annotationEntry=[{...this.previousEditEvent,resourceId:this.serverURL}],this.annotationEventCallback({},{type:"aborted"})),this.previousEditEvent={}}else{if(t.type==="created"||t.type==="updated"){t.type==="updated"&&t.feature.action&&(t.positionUpdated=t.feature.action==="move");const o=this.mapImp.refreshAnnotationFeatureGeometry(t.feature);e.feature.feature=o}t.type==="created"?this.drawnCreatedEvent=e:this.checkAndCreatePopups([e])}t.type==="updated"&&(this.previousEditEvent=t),t.type==="deleted"?this.previousDeletedEvent=t:this.previousDeletedEvent={}},getTaxons:function(e){let t;return e.taxons&&(typeof e.taxons!="object"?t=JSON.parse(e.taxons):t=e.taxons),t},eventCallback:function(){return(e,t,...o)=>{if(e==="annotation"){const i={feature:t,userData:o,eventType:e};this.annotationEventCallback(i,t)}else if(e==="context-lost")this.onContextLost();else if(e==="context-restored")this.onContextRestored();else if(e==="pan-zoom")this.$emit("pan-zoom-callback",t);else{const i=t.label,r=[t.models],a=this.entry,s=this.biologicalSex,l=t.alert,c=this.getTaxons(t);let d=[{dataset:t.dataset,biologicalSex:s,taxonomy:a,resource:r,label:i,feature:t,userData:o,eventType:e,provenanceTaxonomy:c,alert:l}];if(e==="click"){const f=!t[0];if(!f){d=[];const p=t.mapUUID,g=new Set;for(let[h,m]of Object.entries(t))if(h!=="mapUUID"){const y=m.featureId,b=m.label,C=[m.models],I=this.getTaxons(m);if(g.has(y))continue;g.add(y),d.push({dataset:m.dataset,biologicalSex:s,taxonomy:a,resource:C,label:b,feature:m,userData:o,eventType:e,provenanceTaxonomy:I,alert:m.alert,mapUUID:p})}}const u=f?t:t[0];if(this.setConnectivityDataSource(this.viewingMode,u),this.viewingMode!=="Neuron Connection"){if(this.currentActive=u.models?u.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const p=u.featureId||this.existDrawnFeatures.find(g=>g.id===u.id);if(this.activeDrawTool==="LineString"&&p){const g=u.featureId?u.featureId:u.id,h=u.label?u.label:`Feature ${u.id}`;this.connectionEntry[` ${g}`]=Object.assign({label:h},Object.fromEntries(Object.entries(u).filter(([m])=>["featureId","models"].includes(m)).map(([m,y])=>[m==="featureId"?"id":m,y])))}}}t&&t.type!=="marker"&&!this.activeDrawTool&&this.checkAndCreatePopups(d)}else e==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=t.models?t.models:"");this.$emit("resource-selected",d)}}},setConnectivityDataSource:function(e,t){var o;e==="Exploration"?this.connectivityDataSource=(o=t.models)!=null&&o.startsWith("ilxtr:")?t.models:"":this.connectivityDataSource=t.featureId||t.id},changeViewingMode:function(e){e&&(this.viewingMode=e),this.manualAbortedOnClose()},removeActiveTooltips:function(){this.mapImp&&this.mapImp.removePopup(),this.$el.querySelectorAll(".flatmap-tooltip-popup").forEach(t=>t.remove())},createTooltipForConnectivity:function(e,t){const o=document.createElement("div");o.classList.add("flatmap-feature-label"),e.forEach((i,r)=>{const{label:a}=i;if(o.append(Gn(a)),r+1<e.length){const s=document.createElement("hr");o.appendChild(s)}}),this.mapImp.showPopup(t,o,{className:"custom-popup flatmap-tooltip-popup",positionAtLastClick:!1,preserveSelection:!0})},showConnectivityTooltips:function(e){const{connectivityInfo:t,data:o}=e,i=[],r=[],a=[],s=[];if(t&&t.featureId&&i.push(...t.featureId),this.mapImp){if(o.forEach(p=>{const g=this.mapImp.search(p.id);if(g!=null&&g.results.length){const h=g==null?void 0:g.results[0].featureId;a.push({featureId:h,...p})}else s.push(p)}),a.length){let p=a[0].featureId;this.mapImp.annotations.forEach(g=>{const h=g["anatomical-nodes"];if(h){const m=h.join("");a.every(b=>m.indexOf(b.id)!==-1)&&(p=g.featureId,r.push(p))}}),this.createTooltipForConnectivity(a,p)}else this.removeActiveTooltips();this.emitConnectivityError(s);const l=i.reduce((p,g)=>{const h=this.mapImp.pathways.paths[g],m=h?h.connectivity:null;if(m){const y=m.flat(1/0);p.push(...y)}return p},[]),c=[...new Set(l)],d=[...i,...c],u=[...this.mapImp.modelFeatureIdList(d),...r];this.mapImp.selectGeoJSONFeatures(u)}},showConnectivitiesByReference:function(e){this.searchConnectivitiesByReference(e).then(t=>{this.mapImp.selectFeatures(t)})},searchConnectivitiesByReference:async function(e){const t=sessionStorage.getItem("flatmap-knowledge");let o=[];return t?o=await xy(e):o=await My(this.mapImp,e,this.flatmapQueries),o},getFlatmapKnowledge:function(){let e=[];const t=sessionStorage.getItem("flatmap-knowledge");return t&&(e=JSON.parse(t)),e},emitConnectivityError:function(e){this.$emit("connectivity-error",{data:{errorData:e,errorMessage:$y}})},checkConnectivityTooltipEntry:function(e){return e!=null&&e.length?e.find(t=>{var o,i;return((o=t==null?void 0:t.destinations)==null?void 0:o.length)||((i=t==null?void 0:t.components)==null?void 0:i.length)})!==void 0:!1},changeConnectivitySource:async function(e){const{entry:t,connectivitySource:o}=e;t.mapId===this.mapImp.id&&(await this.flatmapQueries.queryForConnectivityNew(this.mapImp,t.featureId[0],o),this.tooltipEntry=this.tooltipEntry.map(i=>i.featureId[0]===t.featureId[0]?this.flatmapQueries.updateTooltipData(i):i),this.checkConnectivityTooltipEntry(this.tooltipEntry)&&this.$emit("connectivity-info-open",this.tooltipEntry))},checkAndCreatePopups:async function(e,t=!0){var o;if(this.viewingMode==="Annotation"){const i=e.filter(r=>r.feature).map(r=>r.feature);if(i.length>0)if(this.annotationSidebar&&this.previousDeletedEvent.type==="deleted"&&(this.annotationEntry=[{...this.previousDeletedEvent,resourceId:this.serverURL}],this.annotationEventCallback({},{type:"aborted"})),this.annotationEntry=[],i.forEach(r=>{var a;this.annotationEntry.push({...r,resourceId:this.serverURL,featureId:r.featureId?r.featureId:(a=r.feature)==null?void 0:a.id,offline:this.offlineAnnotationEnabled})}),i[0].feature)this.activeDrawTool||this.activeDrawMode||this.isValidDrawnCreated?(this.featureAnnotationSubmitted=!1,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(i[0].feature.id,zy(i[0].feature.geometry))):this.rollbackAnnotationEvent();else{const r=this.annotationEntry.filter(a=>a.featureId&&a.models).map(a=>a.models);r.length>0&&this.displayTooltip(r)}else this.annotation={}}else if(this.viewingMode==="Neuron Connection"&&t){const i=e.map(a=>a.resource[0]);if(i.find(a=>!a.startsWith("ilxtr:"))){const a=Array.isArray(i)?[...i]:[i];a.length===1&&a.push([]);const s=(o=e[0].feature)==null?void 0:o.featureId,l=this.mapImp.annotations.get(s),c=l==null?void 0:l["anatomical-nodes"],d=l==null?void 0:l.models;let f,u=a;const p=l==null?void 0:l.models;c!=null&&c.length&&(f=c.find(S=>JSON.parse(S)[0]===d)),f?u=JSON.parse(f):p&&(u=[p,[]]);const g=this.mapImp.knowledgeSource,h=u.flat(1/0),m=[...new Set(h)],b=(await Lt.fetchLabels(this.flatmapAPI,m)).reduce((S,E)=>{const O=E[0],M=JSON.parse(E[1]);return S.push({id:O,label:M.label,source:M.source}),S},[]);b.sort((S,E)=>S.id===E.id?S.source===g&&E.source!==g?-1:S.source!==g&&E.source===g?1:0:S.id.localeCompare(E.id));const C=[];for(let S=0;S<m.length;S++){const E=b.find(O=>O.id===m[S]);E&&C.push(E.label)}const I=Gn(C.join(", ")),k={facet:JSON.stringify(u),facetPropPath:`flatmap.connectivity.source.${this.connectionType.toLowerCase()}`,tagLabel:I,term:this.connectionType};this.connectivityFilters.some(S=>S.facet===k.facet&&S.facetPropPath===k.facetPropPath)||this.connectivityFilters.push(k),this.$emit("neuron-connection-feature-click",{filters:this.connectivityFilters,search:""})}else{const a=i.join();this.connectionType.toLowerCase()==="all"?this.$emit("neuron-connection-feature-click",{filters:[],search:a}):await this.openConnectivityInfo(e)}}else await this.openConnectivityInfo(e)},openConnectivityInfo:async function(e){Ny(this.mapImp,this.flatmapQueries);let t=[];if(this.tooltipEntry=e.filter(o=>o.resource[0]in this.mapImp.pathways.paths).map(o=>({title:o.label,featureId:o.resource,ready:!1})),this.tooltipEntry.length){this.$emit("connectivity-info-open",this.tooltipEntry);for(let i=0;i<e.length;i++)t.push(await this.getKnowledgeTooltip(e[i]));this.tooltipEntry=await Promise.all(t);const o=this.tooltipEntry.map(i=>i.featureId[0]);o.length>0&&this.displayTooltip(o)}},updateConnectivityFilters:function(e){e.length&&(this.connectivityFilters=e.filter(t=>t.facet.toLowerCase()!=="show all"))},resetConnectivityfilters:function(e){e.length?this.connectivityFilters=this.connectivityFilters.filter(t=>e.some(o=>o.facetPropPath===t.facetPropPath&&o.facet!==t.facet)):this.connectivityFilters=[]},getKnowledgeTooltip:async function(e){const t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp,e);let o=await this.flatmapQueries.createTooltipData(this.mapImp,e);return(t&&t[0]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(o.featuresAlert=e.alert,o.knowledgeSource=ui(this.mapImp),o.mapId=this.mapImp.mapMetadata.id,o.mapuuid=this.mapImp.mapMetadata.uuid),o.ready=!0,o},popUpCssHacks:function(){const e=document.querySelector(".flatmap-tooltip-popup"),t=document.querySelector(".maplibregl-popup-close-button");e&&(e.style.display="none"),t.style.display="block",this.$refs.tooltip.$el.style.display="flex",t.onclick=()=>{this.$emit("connectivity-info-close"),e&&(e.style.display="block")}},closeTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.$el.style.display="none"),document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},showPopup:function(e,t,o){let i=o;this.mapImp&&(i?i.className||(i.className="custom-popup"):i={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,i))},showMarkerPopup:function(e,t,o){this.mapImp&&this.mapImp.showMarkerPopup(e,t,o)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){const t=this.hoverVisibilities.length,o=t-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const a=i==null?void 0:i.refs,s=i==null?void 0:i.ref,l=this.$refs[a||s];if(l){const{parentElement:c,nextElementSibling:d}=l.$el,f=u=>u&&(u.classList.contains("pathway-container")||u.classList.contains("pathway-location"));(f(c)||f(d))&&(this.requiresDrawer?this.drawerOpen=!0:this.helpModeActiveIndex+=1)}else this.helpModeActiveIndex+=1,this.setHelpMode(e)}const r=this.hoverVisibilities[this.helpModeActiveIndex];(r==null?void 0:r.ref)==="checkBoxPopover"&&!this.showPathwayFilter&&(this.helpModeActiveIndex+=1,this.setHelpMode(e)),e||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=o),e&&this.helpModeActiveIndex>=o&&this.$emit("help-mode-last-item",!0),e&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(a=>{a.value=!0})):e&&this.helpModeDialog&&t>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(a=>{a.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(a=>{a.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(e,t=500){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0,this.$emit("shown-tooltip")},t))},hideTooltip:function(e,t=500){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},t))},displayTooltip:function(e,t=void 0){let o,i={className:"flatmapvuer-popover"};if(t)o=e,i.annotationFeatureGeometry=t,this.annotationEntry.length&&(i.annotationEvent={type:this.annotationEntry[0].type,feature:this.annotationEntry[0].feature});else{const r=Array.isArray(e)?e[0]:e;r&&(o=this.mapImp.modelFeatureIds(r)[0]),this.activeDrawTool||(i.positionAtLastClick=!0)}this.connectivityInfoSidebar&&this.tooltipEntry.length&&this.viewingMode!=="Annotation"&&this.checkConnectivityTooltipEntry(this.tooltipEntry)&&this.$emit("connectivity-info-open",this.tooltipEntry),this.annotationSidebar&&this.viewingMode==="Annotation"&&this.$emit("annotation-open",{annotationEntry:this.annotationEntry,commitCallback:this.commitAnnotationEvent}),o&&!this.disableUI&&(this.viewingMode==="Annotation"&&!this.annotationSidebar||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar)&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(o,this.$refs.tooltip.$el,i),this.popUpCssHacks()}))},moveMap:function(e,t={}){if(this.mapImp){const{offsetX:o=0,offsetY:i=0,zoom:r=4}=t,a=this.mapImp.map,s=this.mapImp.bounds.toArray();this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),s!=null&&s.length&&setTimeout(()=>{a.fitBounds(s,{offset:[o,i],zoom:r,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&(this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"}),this.$emit("shown-map-tooltip"))}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let o of t.values())o.label&&e.push(o.label);return Array.from(new Set(e))}},getVisibilityState:function(e){if(["alertSelection","pathwaysSelection","taxonSelection"].forEach(o=>{let i=this.$refs[o];i&&(e[o]=i.getState())}),this.$refs.treeControls){const o=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();e.systemsSelection=o.filter(i=>!i.includes("."))}},setVisibilityState:function(e){["alertSelection","pathwaysSelection","taxonSelection"].forEach(o=>{const i=e[o];if(i){const r=this.$refs[o];r&&r.setState(i)}}),"systemsSelection"in e&&this.$refs.treeControls&&(this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e.systemsSelection),this.systems[0].children.forEach(o=>{this.mapImp.enableSystem(o.key,e.systemsSelection.includes(o.key))}))},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e.viewingMode=this.viewingMode,e.searchTerm=this.searchTerm,e.flightPath3D=this.flightPath3DRadio,e.colour=this.colourRadio,e.outlines=this.outlinesRadio,e.background=this.currentBackground,this.offlineAnnotationEnabled&&(e.offlineAnnotations=sessionStorage.getItem("anonymous-annotation")),this.getVisibilityState(e),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?this.restoreMapState(e):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){if(e){if(e.viewport&&this.mapImp.setState(e.viewport),e.offlineAnnotations&&sessionStorage.setItem("anonymous-annotation",e.offlineAnnotations),e.viewingMode&&this.changeViewingMode(e.viewingMode),"flightPath3D"in e&&this.setFlightPath3D(e.flightPath3D),"colour"in e&&this.setColour(e.colour),"outlines"in e&&this.setOutlines(e.outlines),e.background&&this.backgroundChangeCallback(e.background),e.searchTerm){const t=e.searchTerm;this.searchAndShowResult(t,!0,!0)}this.setVisibilityState(e)}},setFlightPathInfo:function(e){(e===1.6||e>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0,this.flatmapError=null;let t={taxon:this.entry};this.uuid&&(t.uuid=this.uuid),e?(e.uuid?t={uuid:e.uuid}:e.entry&&(t.taxon=e.entry),e.biologicalSex?t.biologicalSex=e.biologicalSex:t.taxon==="NCBITaxon:9606"&&(t.biologicalSex="PATO:0000384")):this.biologicalSex&&(t.biologicalSex=this.biologicalSex),this.mapManagerRef.loadMap(t,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:!1,container:this.$refs.display}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let r=this.mapImp.details.version;this.setFlightPathInfo(r);const a=this._stateToBeSet?this._stateToBeSet:e;this.onFlatmapReady(a),this.$nextTick(()=>this.restoreMapState(a))}).catch(i=>{var r,a;if(console.error("Flatmap loading error:",i),this.flatmapError={},i.message&&i.message.indexOf("Unknown map")!==-1?(this.flatmapError.title="Unknown Map!",this.flatmapError.messages=Object.keys(t).map(s=>`${s==="uuid"?"UUID":Gn(s)}: ${t[s]}`)):(this.flatmapError.title="Error Loading Map!",this.flatmapError.messages=[i.message?i.message:i.toString(),"Please try again later or contact support if the problem persists."]),(a=(r=this.$parent)==null?void 0:r.$refs)!=null&&a.multiContainer){const s=this.$parent;this.flatmapError.button={text:"Load Default Map",callback:()=>{const l=s.initial;s.setSpecies(l,void 0,3)}}}this.loading=!1})}else e&&(this._stateToBeSet={...e},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),o=parseInt(t.paddingTop)+parseInt(t.paddingBottom),i=e.clientHeight-o;this.pathwaysMaxHeight=i-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&this.mapImp.resize()}catch{console.error("Map resize error")}},getFilterSources:function(){const e=["kind","taxons"];let t=new Set,o=new Set,i=new Map;for(const a of this.mapImp.annotations.values())if(a.source){"alert"in a?t.add(a.source):o.add(a.source);for(const[s,l]of Object.entries(a))if(e.includes(s)){i.has(s)||i.set(s,new Map);const c=i.get(s),d=f=>{const u=f;c.has(u)||c.set(u,new Set),c.get(u).add(`${a.source}`)};Array.isArray(l)?l.forEach(d):d(l)}}let r={alert:{with:[...t],without:[...o]}};for(const[a,s]of i.entries()){r[a]={};for(const[l,c]of s.entries())r[a][l]=[...c.values()]}return r},getFilterOptions:async function(e,t){const o=t||this.getFlatmapKnowledge(),i=this.pathways;return await Lt.getFlatmapFilterOptions(this.flatmapAPI,e,o,i)},onFlatmapReady:function(e){var t;if(this.sensor=n.markRaw(new Ry(this.$refs.display,this.mapResize)),((t=this.mapImp.options)==null?void 0:t.style)==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.pathways=this.pathways.filter(o=>o.enabled&&o.type!=="other"),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.mapImp.taxonIdentifiers,e?e.taxonSelection:void 0),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.flatmapLegends=this.mapImp.flatmapLegend,this.loading=!1,this.computePathControlsMaximumHeight(),this.mapResize(),this.handleMapClick(),this.setInitMapState(),this.displayMinimap){const o={position:"top-right"};this.mapImp.createMinimap(o),this.addResizeButtonToMinimap()}this.$emit("ready",this)},handleMapClick:function(){const e=this.mapImp.map;e&&e.on("click",t=>{this.connectivityDataSource||this.$emit("connectivity-info-close"),this.connectivityDataSource=""})},onContextLost:function(){this.lastViewport=n.markRaw(this.mapImp.getState()),this.flatmapError={},this.flatmapError.title="GL context lost!",this.flatmapError.messages=["GL context is lost due to too many concurrent GL contexts. Please try using the Restore Context button."],this.flatmapError.button={text:"Restore Context",callback:()=>{this.forceContextRestore()}}},onContextRestored:function(){if(this.mapImp){this.handleMapClick(),this.setInitMapState();const e=this.getState();if(e&&(e.viewport=this.lastViewport),this.restoreMapState(e),this.displayMinimap){const t={position:"top-right"};this.mapImp.createMinimap(t),this.addResizeButtonToMinimap()}this.filterToRestore&&(this.mapImp.setVisibilityFilter(this.filterToRestore),this.filterToRestore=void 0),this.$emit("context-restored",this)}},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t,o=!0){var i;if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),this.viewingMode==="Exploration"?this.$emit("connectivity-info-close"):this.viewingMode==="Annotation"&&this.manualAbortedOnClose(),this.searchTerm="",!0;{const r=this.mapImp.search(e);if((i=r==null?void 0:r.results)!=null&&i.length){if(this.mapImp.showSearchResults(r),t){let a;for(let s=0;s<r.results.length;s++){a=r.results[s].featureId;const l=this.mapImp.annotation(a);if(a&&(l!=null&&l.label))break}if(a){const s=this.mapImp.featureProperties(a),l={resource:[s.models],feature:s,label:s.label,provenanceTaxonomy:s.taxons,alert:s.alert};this.checkAndCreatePopups([l],o),this.mapImp.showPopup(a,Gn(s.label),{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}}return this.searchTerm=e,!0}else this.mapImp.clearSearchResults()}}return!1},highlightConnectedPaths:function(e){if(e.length){const t=e.filter(i=>i in this.mapImp.pathways.paths),o=this.mapImp.modelFeatureIdList(t);this.mapImp.selectGeoJSONFeatures(o)}},searchSuggestions:function(e){return this.mapImp?this.mapImp.search(e):[]},onActionClick:function(e){pi.emit("onActionClick",e)},setConnectionType:function(e){this.connectionType=e}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:1},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},render:{type:Boolean,default:!0},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},mapManager:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1},annotationSidebar:{type:Boolean,default:!1},showLocalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0},showPathwayFilter:{type:Boolean,default:!0},externalLegends:{type:Array,default:function(){return[]}}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,userApiKey:this.userToken}},data:function(){return{filterToRestore:void 0,flatmapError:null,sensor:null,mapManagerRef:void 0,flatmapQueries:void 0,annotationEntry:[],tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],initMapState:n.markRaw({}),sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:n.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:Ly,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:Ay,tooltipEntry:[],connectivityDataSource:"",connectivityTooltipVisible:!1,drawerOpen:!1,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},connectionType:"All",offlineAnnotationEnabled:!1,offlineAnnotations:[],annotationFrom:"Anyone",annotatedSource:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,authorisedUser:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},previousEditEvent:{},previousDeletedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:n.markRaw({alert:{with:!0,without:!0}}),searchTerm:"",taxonLeaveDelay:void 0,connectivityFilters:[],flatmapLegends:[],lastViewport:void 0}},computed:{...Ci.mapState(Fy,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0},requiresDrawer:function(){var e,t,o,i;return this.loading?(this.drawerOpen=!1,!1):((e=this.systems)==null?void 0:e.length)>0||this.containsAlert&&this.alertOptions||((t=this.pathways)==null?void 0:t.length)>0||((o=this.taxonConnectivity)==null?void 0:o.length)>0||((i=this.legendEntry)==null?void 0:i.length)>0?(this.drawerOpen=!0,!0):(this.drawerOpen=!1,!1)},modeDescription:function(){let e=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.authorisedUser?e[1]:e[0]:e},legendEntry:function(){return[...this.flatmapLegends,...this.externalLegends]},showDatasetMarkerTooltip:function(){return this.hoverVisibilities[9].value}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e,t){e!==t&&this.setHelpMode(e)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},render:function(e){e&&this.mapImp&&this.mapImp.contextLost&&!this.loading&&this.$nextTick(()=>{this.forceContextRestore()})},state:{handler:function(e,t){e!==t&&(this.mapManagerRef?this.setState(e):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(e){this.clearAnnotationFeature(),e==="Annotation"&&(this.loading=!0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate?(this.authorisedUser=t,this.offlineAnnotationEnabled=!1):(this.authorisedUser=void 0,this.offlineAnnotationEnabled=!0),this.emitOfflineAnnotationUpdate(),this.setFeatureAnnotated(),this.addAnnotationFeature(),this.loading=!1}))},disableUI:function(e){e&&this.closeTooltip()},activeDrawTool:function(e){let t=[],o={x:null,y:null};const i=this.$el.querySelector(".maplibregl-canvas"),r=()=>{i.removeEventListener("keydown",a),i.removeEventListener("click",s)},a=l=>{if(!["Escape","Enter"].includes(l.key))return;const c=e==="Point"&&t.length===1||e==="LineString"&&t.length>=2||e==="Polygon"&&t.length>=3;(l.key==="Escape"||l.key==="Enter"&&!c)&&(this.activeDrawTool=void 0),r()},s=l=>{const c=i.getBoundingClientRect(),d=l.clientX-c.left,f=l.clientY-c.top;if(Math.sqrt((d-o.x)**2+(f-o.y)**2)<8){this.isValidDrawnCreated||(this.activeDrawTool=void 0),r();return}o={x:d,y:f},t.push(o)};e&&(r(),i.addEventListener("keydown",a),i.addEventListener("click",s))}},created:function(){this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=n.markRaw(new vi.MapViewer(this.flatmapAPI,{container:void 0})),this.$emit("mapmanager-loaded",this.mapManagerRef))},mounted:function(){this.openMapRef=n.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=n.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.flatmapQueries=n.markRaw(new Oy),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap(),ms()}},Hy={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},Ky={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},Uy={style:{height:"100%",width:"100%"},ref:"display",class:"flatmap-display"},Wy={class:"beta-popovers"},qy={key:2,class:"warning-text"},Gy={class:"bottom-right-control"},Jy=["innerHTML"],Yy={style:{"margin-bottom":"2px"}},Zy={key:0,class:"viewing-mode-title"},Qy=["onClick"],Xy=["onClick"];function eb(e,t,o,i,r,a){const s=n.resolveComponent("map-svg-sprite-color"),l=li,c=W.WarningFilled,d=be,f=on,u=W.ArrowDown,p=n.resolveComponent("DrawToolbar"),g=n.resolveComponent("map-svg-icon"),h=hy,m=n.resolveComponent("tree-controls"),y=ps,b=W.ArrowLeft,C=ei,I=tn,k=nn,v=ii,S=Un,E=ns,O=os,M=n.resolveComponent("Tooltip"),N=ri,B=si;return n.withDirectives((n.openBlock(),n.createElementBlock("div",Hy,[n.createVNode(s),n.createElementVNode("div",Ky,[n.createElementVNode("div",Uy,null,512),e.flatmapError?(n.openBlock(),n.createBlock(l,{key:0,flatmapError:e.flatmapError},null,8,["flatmapError"])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("div",Wy,[n.createElementVNode("div",null,[o.displayWarning||o.isLegacy?(n.openBlock(),n.createBlock(f,{key:0,placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[7].value,ref:"warningPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:"warning-icon",onMouseover:t[7]||(t[7]=T=>a.showTooltip(7)),onMouseout:t[8]||(t[8]=T=>a.hideTooltip(7))},[o.displayWarning||o.isLegacy?(n.openBlock(),n.createBlock(d,{key:0},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})):n.createCommentVNode("",!0),o.isLegacy?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[t[31]||(t[31]=n.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),n.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...T)=>a.viewLatestMap&&a.viewLatestMap(...T))}," Click here for the latest map ")],64)):o.displayWarning?(n.openBlock(),n.createElementBlock("span",qy,"Beta")):n.createCommentVNode("",!0)],32)]),default:n.withCtx(()=>[o.isLegacy?(n.openBlock(),n.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=T=>a.showTooltip(7)),onMouseout:t[1]||(t[1]=T=>a.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(n.openBlock(),n.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=T=>a.showTooltip(7)),onMouseout:t[3]||(t[3]=T=>a.hideTooltip(7))},t[29]||(t[29]=[n.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),n.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1),n.createTextVNode(" models available in "),n.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1),n.createTextVNode(". ")]),32)):(n.openBlock(),n.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=T=>a.showTooltip(7)),onMouseout:t[5]||(t[5]=T=>a.hideTooltip(7))},t[30]||(t[30]=[n.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),n.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1),n.createTextVNode(" models available in "),n.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1),n.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")]),32))]),_:1},8,["visible"])):n.createCommentVNode("",!0)]),o.displayLatestChanges?(n.openBlock(),n.createBlock(f,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:n.withCtx(()=>[o.displayLatestChanges?(n.openBlock(),n.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=T=>a.showTooltip(8)),onMouseout:t[10]||(t[10]=T=>a.hideTooltip(8))},[n.createVNode(d,null,{default:n.withCtx(()=>[n.createVNode(c)]),_:1}),t[32]||(t[32]=n.createElementVNode("span",{class:"warning-text"},"What's new?",-1))],32)):n.createCommentVNode("",!0)]),default:n.withCtx(()=>t[33]||(t[33]=[n.createElementVNode("b",null,"Connectivity References",-1),n.createElementVNode("p",null," Connectivity references have been improved and available in various formats. ",-1),n.createElementVNode("b",null,"Improved state storing",-1),n.createElementVNode("p",null," Current selection and visibility filters are now stored when creating a permalink. ",-1)])),_:1},8,["visible"])):n.createCommentVNode("",!0)],512),[[n.vShow,!o.disableUI]]),n.withDirectives(n.createVNode(d,{class:n.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:a.closeMinimap},{default:n.withCtx(()=>[n.createVNode(u)]),_:1},8,["class","onClick"]),[[n.vShow,e.minimapResizeShow]]),e.viewingMode==="Annotation"&&(e.authorisedUser||e.offlineAnnotationEnabled)&&!o.disableUI?(n.openBlock(),n.createBlock(p,{key:1,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:e.toolbarOptions,activeDrawTool:e.activeDrawTool,activeDrawMode:e.activeDrawMode,newlyDrawnEntry:e.drawnCreatedEvent,connectionEntry:e.connectionEntry,hoverVisibilities:e.hoverVisibilities,onClickToolbar:a.toolbarEvent,onFeatureTooltip:a.connectedFeatureTooltip,onConfirmDrawn:a.confirmDrawnFeature,onCancelDrawn:a.cancelDrawnFeature,onShowTooltip:a.showTooltip,onHideTooltip:a.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("div",Gy,[n.createVNode(f,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:"icon-button-container",onClick:t[11]||(t[11]=T=>a.zoomIn()),onMouseover:t[12]||(t[12]=T=>a.showTooltip(1)),onMouseout:t[13]||(t[13]=T=>a.hideTooltip(1))},[n.createVNode(g,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),n.createVNode(f,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:"icon-button-container",onClick:t[14]||(t[14]=T=>a.zoomOut()),onMouseover:t[15]||(t[15]=T=>a.showTooltip(2)),onMouseout:t[16]||(t[16]=T=>a.hideTooltip(2))},[n.createVNode(g,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),n.createVNode(f,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{class:"icon-button-container",onClick:t[17]||(t[17]=T=>a.resetView()),onMouseover:t[18]||(t[18]=T=>a.showTooltip(3)),onMouseout:t[19]||(t[19]=T=>a.hideTooltip(3))},[n.createVNode(g,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:n.withCtx(()=>[t[34]||(t[34]=n.createElementVNode("div",null,[n.createTextVNode(" Fit to "),n.createElementVNode("br"),n.createTextVNode(" window ")],-1))]),_:1},8,["visible"])],512),[[n.vShow,!o.disableUI]]),n.createVNode(f,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:e.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:n.withCtx(()=>[n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:n.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[a.legendEntry.length?(n.openBlock(),n.createBlock(h,{key:0,identifierKey:"prompt",colourKey:"colour",styleKey:"style",legends:a.legendEntry,showStarInLegend:!0,showDatasetMarkerTooltip:a.showDatasetMarkerTooltip,ref:"featuredMarkerPopover",class:"svg-legends-container"},null,8,["legends","showDatasetMarkerTooltip"])):n.createCommentVNode("",!0),n.createVNode(f,{content:"Find these markers for data. The number inside the markers is the number of datasets available for each marker.",placement:"right",teleported:!1,width:"200",trigger:"manual","popper-class":"flatmap-popper flatmap-marker-popper",visible:e.hoverVisibilities[0].value,ref:"markerPopover"},{reference:n.withCtx(()=>[n.withDirectives(n.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,Jy),[[n.vShow,e.hoverVisibilities[0].value],[N,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(n.openBlock(),n.createBlock(m,{key:1,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:e.systems,active:e.currentActive,hover:e.currentHover,onCheckChanged:a.systemSelected,onCheckAll:a.checkAllSystems,onChangeActive:a.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):n.createCommentVNode("",!0),e.containsAlert&&e.alertOptions&&o.showPathwayFilter?(n.openBlock(),n.createBlock(y,{title:"Alert",labelKey:"label",identifierKey:"key",selections:e.alertOptions,onChanged:a.alertSelected,onCheckboxMouseEnter:a.alertMouseEnterEmitted,onSelectionsDataChanged:a.onSelectionsDataChanged,onCheckAll:a.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):n.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(n.openBlock(),n.createBlock(y,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,showAsLegend:!o.showPathwayFilter,onChanged:a.pathwaysSelected,onSelectionsDataChanged:a.onSelectionsDataChanged,onCheckAll:a.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","showAsLegend","onChanged","onSelectionsDataChanged","onCheckAll"])):n.createCommentVNode("",!0),e.taxonConnectivity&&e.taxonConnectivity.length>0&&o.showPathwayFilter?(n.openBlock(),n.createBlock(y,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:e.taxonConnectivity,onChanged:a.taxonsSelected,onCheckboxMouseEnter:a.taxonMouseEnterEmitted,onSelectionsDataChanged:a.onSelectionsDataChanged,onCheckAll:a.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):n.createCommentVNode("",!0)],6)),[[N,void 0,"checkBoxPopover"]]),n.createElementVNode("div",{onClick:t[20]||(t[20]=(...T)=>a.toggleDrawer&&a.toggleDrawer(...T)),class:n.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[n.createVNode(d,null,{default:n.withCtx(()=>[n.createVNode(b)]),_:1})],2)],2),[[n.vShow,!o.disableUI&&a.requiresDrawer]])]),_:1},8,["visible"]),e.openMapRef?(n.openBlock(),n.createBlock(f,{key:2,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.openMapOptions,T=>(n.openBlock(),n.createBlock(I,{key:T.key},{default:n.withCtx(()=>[n.createVNode(C,{type:"primary",plain:"",onClick:P=>e.$emit("open-map",T.key)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(T.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):n.createCommentVNode("",!0),n.createVNode(f,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:n.withCtx(()=>[n.createElementVNode("div",null,[n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[35]||(t[35]=[n.createTextVNode("Viewing Mode")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createElementVNode("div",Yy,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.viewingModes,(T,P,q)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:P},[P===e.viewingMode?(n.openBlock(),n.createElementBlock("span",Zy,[n.createElementVNode("b",null,n.toDisplayString(P),1)])):(n.openBlock(),n.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:V=>a.changeViewingMode(P)},n.toDisplayString(P),9,Qy))],64))),128))]),n.createVNode(I,{class:"viewing-mode-description"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(a.modeDescription),1)]),_:1}),e.viewingMode==="Annotation"&&e.offlineAnnotationEnabled?(n.openBlock(),n.createBlock(I,{key:0,class:"viewing-mode-description"},{default:n.withCtx(()=>t[36]||(t[36]=[n.createTextVNode(" (Anonymous annotate) ")])),_:1})):n.createCommentVNode("",!0)]),_:1}),e.viewingMode==="Annotation"&&e.authorisedUser?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[37]||(t[37]=[n.createTextVNode("Annotations From")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(S,{teleported:!1,modelValue:e.annotationFrom,"onUpdate:modelValue":t[21]||(t[21]=T=>e.annotationFrom=T),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:a.setAnnotationFrom},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.annotatedSource,T=>(n.openBlock(),n.createBlock(v,{key:T,label:T,value:T},{default:n.withCtx(()=>[n.createVNode(I,null,{default:n.withCtx(()=>[n.createVNode(k,{span:12},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(T),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(I,{key:1,class:"backgroundSpacer"})):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(I,{key:2,class:"backgroundText"},{default:n.withCtx(()=>t[38]||(t[38]=[n.createTextVNode("Flight path display")])),_:1})):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(I,{key:3,class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[22]||(t[22]=T=>e.flightPath3DRadio=T),class:"flatmap-radio",onChange:a.setFlightPath3D},{default:n.withCtx(()=>[n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[39]||(t[39]=[n.createTextVNode("2D")])),_:1}),n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[40]||(t[40]=[n.createTextVNode("3D")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(I,{class:"backgroundSpacer"}),n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[41]||(t[41]=[n.createTextVNode("Organs display")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:e.colourRadio,"onUpdate:modelValue":t[23]||(t[23]=T=>e.colourRadio=T),class:"flatmap-radio",onChange:a.setColour},{default:n.withCtx(()=>[n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[42]||(t[42]=[n.createTextVNode("Colour")])),_:1}),n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[43]||(t[43]=[n.createTextVNode("Greyscale")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),n.createVNode(I,{class:"backgroundSpacer"}),n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[44]||(t[44]=[n.createTextVNode("Outlines display")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[24]||(t[24]=T=>e.outlinesRadio=T),class:"flatmap-radio",onChange:a.setOutlines},{default:n.withCtx(()=>[n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[45]||(t[45]=[n.createTextVNode("Show")])),_:1}),n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[46]||(t[46]=[n.createTextVNode("Hide")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),n.createVNode(I,{class:"backgroundSpacer"}),n.createVNode(I,{class:"backgroundText"},{default:n.withCtx(()=>t[47]||(t[47]=[n.createTextVNode("Change background")])),_:1}),n.createVNode(I,{class:"backgroundControl"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.availableBackground,T=>(n.openBlock(),n.createElementBlock("div",{key:T,class:n.normalizeClass(["backgroundChoice",T,T==e.currentBackground?"active":""]),onClick:P=>a.backgroundChangeCallback(T)},null,10,Xy))),128))]),_:1})])]),_:1},8,["virtual-ref"]),n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[o.showOpenMapButton?(n.openBlock(),n.createBlock(I,{key:0},{default:n.withCtx(()=>[n.createVNode(f,{visible:e.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:n.withCtx(()=>[o.enableOpenMapUI&&o.openMapOptions.length>0?(n.openBlock(),n.createElementBlock("div",{key:0,ref:"openMapRef",class:"icon-button-container",onMouseover:t[25]||(t[25]=T=>a.showTooltip(4)),onMouseout:t[26]||(t[26]=T=>a.hideTooltip(4))},[n.createVNode(g,{icon:"openMap",class:"icon-button open-map-button"})],544)):n.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1})):n.createCommentVNode("",!0),o.showLocalSettings?(n.openBlock(),n.createBlock(I,{key:1},{default:n.withCtx(()=>[n.createVNode(f,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:n.withCtx(()=>[n.createElementVNode("div",{ref:"backgroundIconRef",class:"icon-button-container",onMouseover:t[27]||(t[27]=T=>a.showTooltip(5)),onMouseout:t[28]||(t[28]=T=>a.hideTooltip(5))},[n.createVNode(g,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})):n.createCommentVNode("",!0)],2),[[n.vShow,!o.disableUI]]),e.tooltipDisplay?(n.openBlock(),n.createBlock(M,{key:3,ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,tooltipEntry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation",onAnnotation:a.commitAnnotationEvent,onOnActionClick:a.onActionClick},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation","onOnActionClick"])):n.createCommentVNode("",!0)])])),[[B,e.loading]])}const hi=st(jy,[["render",eb],["__scopeId","data-v-b1c18844"]]),bs={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},tb={name:"MultiFlatmapVuer",components:{Col:nn,Row:tn,Option:ii,Select:Un,Popover:on,FlatmapVuer:hi},created:function(){this.loadMapManager()},mounted:function(){this.initialise(),pi.on("onActionClick",e=>{this.resourceSelected(e)}),pi.on("open-pubmed-url",e=>{this.$emit("open-pubmed-url",e)})},methods:{initialise:function(){return this.multiflatmapError=null,new Promise(e=>{if(this.requireInitialisation){this.requireInitialisation=!1;const t=new AbortController,o=t.signal,i=setTimeout(()=>t.abort(),5e3);fetch(this.flatmapAPI,{signal:o}).then(r=>{if(!r.ok){if(r.status===404)return this.multiflatmapError={},this.multiflatmapError.title="MultiFlatmap Error!",this.multiflatmapError.messages=[`Sorry, the component could not be loaded because the specified
|
|
25
|
+
flatmap API endpoint is incorrect. Please check the endpoint URL
|
|
26
|
+
or contact support if the problem persists.`],this.initialised=!0,e(),this.resolveList.forEach(a=>a()),Promise.reject({handled:!0});throw new Error(`HTTP ${r.status}: ${r.statusText}`)}return r.json()}).then(r=>{if(r&&r.status_code===404){console.error("Flatmap API endpoint is incorrect",r),this.multiflatmapError={},this.multiflatmapError.title="MultiFlatmap Error!",this.multiflatmapError.messages=[`Sorry, the component could not be loaded because the specified
|
|
25
27
|
flatmap API endpoint is incorrect. Please check the endpoint URL
|
|
26
|
-
or contact support if the problem persists.`]),Object.keys(this.availableSpecies).forEach(
|
|
27
|
-
Please try again later or contact support if the problem persists.`],e(),this.resolveList.forEach(
|
|
28
|
+
or contact support if the problem persists.`],this.initialised=!0,e(),this.resolveList.forEach(s=>s());return}Object.keys(this.availableSpecies).forEach(s=>{const l=this.availableSpecies[s].uuid;if(l&&r.length&&r.map(c=>c.uuid).indexOf(l)>0)this.speciesList[s]=this.availableSpecies[s];else for(let c=0;c<r.length;c++)if(this.availableSpecies[s].taxo===r[c].taxon)if(this.availableSpecies[s].biologicalSex){if(r[c].biologicalSex&&r[c].biologicalSex===this.availableSpecies[s].biologicalSex){this.speciesList[s]=this.availableSpecies[s];break}}else{this.speciesList[s]=this.availableSpecies[s];break}});let a=this.initial;if(this.state){const s=this.state.state;(!s||!s.uuid&&!s.entry)&&this.state.species?a=this.state.species:a=void 0}a&&(a&&this.speciesList[a]!==void 0?this.activeSpecies=a:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this.initialised=!0,e(),this.resolveList.forEach(s=>{s()})}).catch(r=>{r&&r.handled||(console.error("Error fetching flatmap:",r),this.initialised=!0,this.multiflatmapError={},this.multiflatmapError.title="MultiFlatmap Error!",this.multiflatmapError.messages=[`Sorry, the component could not be loaded due to an unexpected error.
|
|
29
|
+
Please try again later or contact support if the problem persists.`],e(),this.resolveList.forEach(a=>{a()}))}).finally(()=>{clearTimeout(i)})}else this.initialised?e():this.resolveList.push(e)})},loadMapManager:function(){this.mapManagerRef||(this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=n.markRaw(new vi.MapViewer(this.flatmapAPI,{container:void 0})),this.$emit("mapmanager-loaded",this.mapManagerRef)))},resourceSelected:function(e){this.$emit("resource-selected",e)},onContextRestored:function(e){this.$emit("context-restored",e)},FlatmapReady:function(e){this.$emit("ready",e)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(e){this.$emit("pan-zoom-callback",e)},onAnnotationClose:function(){this.$emit("annotation-close")},onAnnotationOpen:function(e){this.$emit("annotation-open",e)},updateOfflineAnnotationEnabled:function(e){this.$emit("update-offline-annotation-enabled",e)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(e){this.$emit("connectivity-info-open",e)},onConnectivityError:function(e){this.$emit("connectivity-error",e)},onNeuronConnectionFeatureClick:function(e){this.$emit("neuron-connection-feature-click",e)},onSelectionsDataChanged:function(e){this.$emit("pathway-selection-changed",e)},showPopup:function(e,t,o){this.getCurrentFlatmap().showPopup(e,t,o)},showMarkerPopup:function(e,t,o){this.getCurrentFlatmap().showMarkerPopup(e,t,o)},setSpecies:function(e,t,o){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(o){const i=o-1;i>=0&&this.$nextTick(()=>{this.setSpecies(e,t,i)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let o=0;o<t.length;o++){const i=this.speciesList[t[o]];if(!i.isLegacy&&i.taxo===e.entry&&i.biologicalSex===e.biologicalSex){this.setSpecies(t[o],e,0);return}}},createLegacyEntry:function(e,t,o){if(o&&t){let i="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?i=e.species:i=i+` ${e.species}`),this.speciesList[i]={taxo:t,isLegacy:!0,displayWarning:!0},{species:i,state:{entry:t,uuid:o,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const o=e.state;if(o.uuid){if(o.entry)return new Promise(()=>{const i={taxon:o.entry};o.biologicalSex&&(i.biologicalSex=o.biologicalSex),this.mapManagerRef.findMap(i).then(r=>{if(r.uuid!==o.uuid)return this.createLegacyEntry(e,o.entry,o.uuid)}).then(r=>{t(r||e)}).catch(()=>{t(e)})})}else if(o.entry){const i=o.entry in bs?bs[o.entry]:void 0,r=this.createLegacyEntry(e,o.entry,i);t(r||e)}}t(e)})},getState:function(){let e={species:this.activeSpecies,state:void 0},t=this.getCurrentFlatmap();return e.state=t.getState(),e},setState:function(e){e&&(this.loadMapManager(),this.updateState(e).then(t=>{this.initialise().then(()=>{t.species&&t.species!==this.activeSpecies?this.setSpecies(t.species,t.state,5):t.state&&this.getCurrentFlatmap().setState(t.state)})}))},activateTooltipByIndex:function(e){return e===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(e){e&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(e){this.getCurrentFlatmap().changeViewingMode(e)},setConnectionType:function(e){this.getCurrentFlatmap().setConnectionType(e)}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:1},renderAtMounted:{type:Boolean,default:!1},render:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},displayMinimap:{type:Boolean,default:!1},showStarInLegend:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array},availableSpecies:{type:Object,default:function(){return{"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayWarning:!0}}}},state:{type:Object,default:void 0},mapManager:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1},annotationSidebar:{type:Boolean,default:!1},showLocalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0},showPathwayFilter:{type:Boolean,default:!0},externalLegends:{type:Array,default:function(){return[]}}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:n.markRaw([]),initialised:!1,mapManagerRef:void 0,multiflatmapError:null}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0},activeSpecies:{handler:function(e,t){t&&this.$refs[t][0].forceContextLoss()}}}},nb={class:"multi-container",ref:"multiContainer"},ob={key:0,style:{position:"absolute","z-index":"100"}},ib={class:"select-box-icon"};function rb(e,t,o,i,r,a){const s=ii,l=Un,c=on,d=hi,f=li;return n.openBlock(),n.createElementBlock("div",nb,[o.disableUI?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",ob,[t[2]||(t[2]=n.createElementVNode("div",{class:"species-display-text"},"Species",-1)),n.createVNode(c,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:a.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:n.withCtx(()=>[n.createVNode(l,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=u=>e.activeSpecies=u),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:a.setSpecies},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.speciesList,(u,p)=>(n.openBlock(),n.createBlock(s,{key:p,label:p,value:p},{default:n.withCtx(()=>[n.createElementVNode("span",ib,[n.createElementVNode("i",{class:n.normalizeClass(u.iconClass)},null,2)]),n.createTextVNode(" "+n.toDisplayString(p),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.speciesList,(u,p)=>n.withDirectives((n.openBlock(),n.createBlock(d,{key:p,entry:u.taxo,uuid:u.uuid,biologicalSex:u.biologicalSex,displayWarning:u.displayWarning,displayLatestChanges:u.displayLatestChanges,isLegacy:u.isLegacy,ref_for:!0,ref:p,enableOpenMapUI:o.enableOpenMapUI,openMapOptions:o.openMapOptions,disableUI:o.disableUI,onContextRestored:a.onContextRestored,onViewLatestMap:a.viewLatestMap,onResourceSelected:a.resourceSelected,onReady:a.FlatmapReady,onPanZoomCallback:a.panZoomCallback,annotationSidebar:o.annotationSidebar,onAnnotationOpen:a.onAnnotationOpen,onAnnotationClose:a.onAnnotationClose,onUpdateOfflineAnnotationEnabled:a.updateOfflineAnnotationEnabled,connectivityInfoSidebar:o.connectivityInfoSidebar,onConnectivityInfoOpen:a.onConnectivityInfoOpen,onConnectivityInfoClose:a.onConnectivityInfoClose,onConnectivityError:a.onConnectivityError,onNeuronConnectionFeatureClick:a.onNeuronConnectionFeatureClick,onOpenMap:t[1]||(t[1]=g=>e.$emit("open-map",g)),onPathwaySelectionChanged:a.onSelectionsDataChanged,minZoom:o.minZoom,helpMode:e.activeSpecies==p&&o.helpMode,helpModeActiveItem:o.helpModeActiveItem,helpModeDialog:o.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:a.onHelpModeLastItem,onShownTooltip:a.onTooltipShown,onShownMapTooltip:a.onMapTooltipShown,renderAtMounted:o.renderAtMounted,render:o.render&&e.activeSpecies==p,displayMinimap:o.displayMinimap,showStarInLegend:o.showStarInLegend,style:{height:"100%"},mapManager:e.mapManagerRef,flatmapAPI:o.flatmapAPI,sparcAPI:o.sparcAPI,showLocalSettings:o.showLocalSettings,showOpenMapButton:o.showOpenMapButton,showPathwayFilter:o.showPathwayFilter,externalLegends:o.externalLegends},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onContextRestored","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","annotationSidebar","onAnnotationOpen","onAnnotationClose","onUpdateOfflineAnnotationEnabled","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityError","onNeuronConnectionFeatureClick","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","render","displayMinimap","showStarInLegend","mapManager","flatmapAPI","sparcAPI","showLocalSettings","showOpenMapButton","showPathwayFilter","externalLegends"])),[[n.vShow,e.activeSpecies==p]])),128)),e.multiflatmapError?(n.openBlock(),n.createBlock(f,{key:1,flatmapError:e.multiflatmapError},null,8,["flatmapError"])):n.createCommentVNode("",!0)],512)}const ab=st(tb,[["render",rb],["__scopeId","data-v-1a5d097a"]]);H.FlatmapVuer=hi,H.MultiFlatmapVuer=ab,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|